text
stringlengths
2
6.14k
/** * @license * Copyright 2019 Google LLC. * This code may only be used under the BSD style license found at * http://polymer.github.io/LICENSE.txt * Code distributed by Google as part of this project is also * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ import {PolymerElement} from '../deps/@polymer/polymer/polymer-element.js'; import {MessengerMixin} from './arcs-shared.js'; import {html} from '../deps/@polymer/polymer/lib/utils/html-tag.js'; import '../deps/golden-layout/src/css/goldenlayout-base.css.js'; import '../deps/golden-layout/src/css/goldenlayout-light-theme.css.js'; import './arcs-overview.js'; import './arcs-stores.js'; import './arcs-planning.js'; import './arcs-communication-channel.js'; import './arcs-environment.js'; import './arcs-notifications.js'; import './arcs-tracing.js'; import './arcs-pec-log.js'; import './arcs-hcr-list.js'; import './arcs-selector.js'; import './strategy-explorer/strategy-explorer.js'; import './arcs-recipe-editor.js'; import './arcs-connection-status.js'; class ArcsDevtoolsApp extends MessengerMixin(PolymerElement) { static get template() { return html` <style include="shared-styles goldenlayout-base.css goldenlayout-light-theme.css"> :host { height: 100vh; display: flex; flex-direction: column; } header { height: 27px; flex-grow: 0; } arcs-notifications:not([visible]) + [divider] { display: none; } #main { position: relative; flex-grow: 1; } /* TODO: Create our own golden-layout theme instead of overriding. */ .lm_content { background: white; position: relative; overflow: auto; } .lm_header .lm_tab { /* Fixing uneven padding caused by missing close button. This can be reverted once we allow closing and re-opening tools. */ padding: 0 10px 4px; } </style> <arcs-communication-channel></arcs-communication-channel> <arcs-connection-status></arcs-connection-status> <header id="header" class="header"> <div section> <arcs-notifications></arcs-notifications><div divider></div> <arcs-selector active-page="[[routeData.page]]"></arcs-selector> </div> </header> <div id="main"></div> `; } static get is() { return 'arcs-devtools-app'; } ready() { super.ready(); const tools = { 'Overview': 'arcs-overview', 'Environment': 'arcs-environment', 'Storage': 'arcs-stores', 'Execution Log': 'arcs-pec-log', 'Strategizer': 'strategy-explorer', 'Planner': 'arcs-planning', 'Tracing': 'arcs-tracing', 'Editor': 'arcs-recipe-editor', 'HCR': 'arcs-hcr-list' }; // TODO: Save user's layout to local storage and restore from it. const layout = new GoldenLayout({ content: [{ type: 'stack', content: Object.entries(tools).map(([name]) => ({ type: 'component', componentName: name, // TODO: Allow closing and then re-opening tools. isClosable: false })) }], settings: { // Pulling a tool into a popup resets its state, // which we cannot recover. showPopoutIcon: false, }, }, this.$.main); for (const [name, elementName] of Object.entries(tools)) { layout.registerComponent(name, function(container) { const element = document.createElement(elementName); container.getElement().append(element); container.on('show', () => element.setAttribute('active', '')); container.on('hide', () => element.removeAttribute('active')); }); } layout.init(); // We need to observe the body for changes as opposed to #main, because when the viewport // shrinks #main will not shrink if it is filled with content, body however will. new ResizeObserver(rects => { const {height, width} = rects[0].contentRect; layout.updateSize(width, height - this.$.header.offsetHeight); }).observe(document.body); } } window.customElements.define(ArcsDevtoolsApp.is, ArcsDevtoolsApp);
import assert from "assert"; import {Point2D, Vector2D, Matrix2D} from "../index.js"; describe("Point2D", () => { it("new point", () => { const p = new Point2D(10, 20); assert.strictEqual(p.x, 10); assert.strictEqual(p.y, 20); }); it("clone", () => { const p = new Point2D(10, 20); const c = p.clone(); assert.strictEqual(p.x, c.x); assert.strictEqual(p.y, c.y); assert.strictEqual(c.x, 10); assert.strictEqual(c.y, 20); }); it("add", () => { const p1 = new Point2D(10, 20); const p2 = new Point2D(20, 30); const p3 = p1.add(p2); assert.strictEqual(p3.x, 30); assert.strictEqual(p3.y, 50); }); it("subtract", () => { const p1 = new Point2D(10, 20); const p2 = new Point2D(20, 40); const p3 = p1.subtract(p2); assert.strictEqual(p3.x, -10); assert.strictEqual(p3.y, -20); }); it("multiply", () => { const p1 = new Point2D(10, 20); const p2 = p1.multiply(0.5); assert.strictEqual(p2.x, 5); assert.strictEqual(p2.y, 10); }); it("divide", () => { const p1 = new Point2D(10, 20); const p2 = p1.divide(2); assert.strictEqual(p2.x, 5); assert.strictEqual(p2.y, 10); }); it("equal", () => { const p1 = new Point2D(10, 20); const p2 = new Point2D(10, 20); assert.strictEqual(p1.equals(p2), true); }); it("not equal", () => { const p1 = new Point2D(10, 20); const p2 = new Point2D(10, 21); assert.strictEqual(p1.equals(p2), false); }); it("interpolate between two points", () => { const p1 = new Point2D(10, 20); const p2 = new Point2D(30, 40); const p3 = p1.lerp(p2, 0.25); assert.strictEqual(p3.x, 15); assert.strictEqual(p3.y, 25); }); it("distance between two points", () => { const p1 = new Point2D(10, 20); const p2 = new Point2D(13, 24); const dist = p1.distanceFrom(p2); assert.strictEqual(dist, 5); }); it("min", () => { const p1 = new Point2D(30, 5); const p2 = new Point2D(10, 50); const p3 = p1.min(p2); assert.strictEqual(p3.x, 10); assert.strictEqual(p3.y, 5); }); it("max", () => { const p1 = new Point2D(30, 5); const p2 = new Point2D(10, 50); const p3 = p1.max(p2); assert.strictEqual(p3.x, 30); assert.strictEqual(p3.y, 50); }); it("translate", () => { const p1 = new Point2D(10, 20); const m = new Matrix2D().translate(20, 30); const p2 = p1.transform(m); assert.strictEqual(p2.x, 30); assert.strictEqual(p2.y, 50); }); it("scale", () => { const p1 = new Point2D(10, 20); const m = new Matrix2D().scale(2); const p2 = p1.transform(m); assert.strictEqual(p2.x, 20); assert.strictEqual(p2.y, 40); }); it("scale non-uniform", () => { const p1 = new Point2D(10, 20); const m = new Matrix2D().scaleNonUniform(2, 3); const p2 = p1.transform(m); assert.strictEqual(p2.x, 20); assert.strictEqual(p2.y, 60); }); it("rotate", () => { const p1 = new Point2D(10, 0); const m = new Matrix2D().rotate(Math.PI / 4.0); const p2 = p1.transform(m); assert.strictEqual(p2.x, 7.0710678118654755); assert.strictEqual(p2.y, 7.071067811865475); }); it("rotate from vector", () => { const p1 = new Point2D(10, 0); const v = new Vector2D(Math.PI / 4.0, Math.PI / 4.0); const m = new Matrix2D().rotateFromVector(v); const p2 = p1.transform(m); assert.strictEqual(p2.x, 7.0710678118654755); assert.strictEqual(p2.y, 7.0710678118654755); }); it("flip x", () => { const p1 = new Point2D(10, 20); const m = new Matrix2D().flipX(); const p2 = p1.transform(m); assert.strictEqual(p2.x, -10); assert.strictEqual(p2.y, 20); }); it("flip y", () => { const p1 = new Point2D(10, 20); const m = new Matrix2D().flipY(); const p2 = p1.transform(m); assert.strictEqual(p2.x, 10); assert.strictEqual(p2.y, -20); }); it("inverse transform", () => { const p1 = new Point2D(10, 20); const m = new Matrix2D().translate(30, 50).inverse(); const p2 = p1.transform(m); assert.strictEqual(p2.x, -20); assert.strictEqual(p2.y, -30); }); it("to string", () => { const p = new Point2D(10, 20); assert.strictEqual("point(10,20)", p.toString()); }); });
'use strict'; exports.__esModule = true; const moduleRequire = require('./module-require').default; const extname = require('path').extname; const fs = require('fs'); const log = require('debug')('eslint-plugin-import:parse'); function getBabelEslintVisitorKeys(parserPath) { if (parserPath.endsWith('index.js')) { const hypotheticalLocation = parserPath.replace('index.js', 'visitor-keys.js'); if (fs.existsSync(hypotheticalLocation)) { const keys = moduleRequire(hypotheticalLocation); return keys.default || keys; } } return null; } function keysFromParser(parserPath, parserInstance, parsedResult) { // Exposed by @typescript-eslint/parser and @babel/eslint-parser if (parsedResult && parsedResult.visitorKeys) { return parsedResult.visitorKeys; } if (/.*espree.*/.test(parserPath)) { return parserInstance.VisitorKeys; } if (/.*babel-eslint.*/.test(parserPath)) { return getBabelEslintVisitorKeys(parserPath); } return null; } exports.default = function parse(path, content, context) { if (context == null) throw new Error('need context to parse properly'); let parserOptions = context.parserOptions; const parserPath = getParserPath(path, context); if (!parserPath) throw new Error('parserPath is required!'); // hack: espree blows up with frozen options parserOptions = Object.assign({}, parserOptions); parserOptions.ecmaFeatures = Object.assign({}, parserOptions.ecmaFeatures); // always include comments and tokens (for doc parsing) parserOptions.comment = true; parserOptions.attachComment = true; // keeping this for backward-compat with older parsers parserOptions.tokens = true; // attach node locations parserOptions.loc = true; parserOptions.range = true; // provide the `filePath` like eslint itself does, in `parserOptions` // https://github.com/eslint/eslint/blob/3ec436ee/lib/linter.js#L637 parserOptions.filePath = path; // @typescript-eslint/parser will parse the entire project with typechecking if you provide // "project" or "projects" in parserOptions. Removing these options means the parser will // only parse one file in isolate mode, which is much, much faster. // https://github.com/import-js/eslint-plugin-import/issues/1408#issuecomment-509298962 delete parserOptions.project; delete parserOptions.projects; // require the parser relative to the main module (i.e., ESLint) const parser = moduleRequire(parserPath); if (typeof parser.parseForESLint === 'function') { let ast; try { const parserRaw = parser.parseForESLint(content, parserOptions); ast = parserRaw.ast; return { ast, visitorKeys: keysFromParser(parserPath, parser, parserRaw), }; } catch (e) { console.warn(); console.warn('Error while parsing ' + parserOptions.filePath); console.warn('Line ' + e.lineNumber + ', column ' + e.column + ': ' + e.message); } if (!ast || typeof ast !== 'object') { console.warn( '`parseForESLint` from parser `' + parserPath + '` is invalid and will just be ignored' ); } else { return { ast, visitorKeys: keysFromParser(parserPath, parser, undefined), }; } } const keys = keysFromParser(parserPath, parser, undefined); return { ast: parser.parse(content, parserOptions), visitorKeys: keys, }; }; function getParserPath(path, context) { const parsers = context.settings['import/parsers']; if (parsers != null) { const extension = extname(path); for (const parserPath in parsers) { if (parsers[parserPath].indexOf(extension) > -1) { // use this alternate parser log('using alt parser:', parserPath); return parserPath; } } } // default to use ESLint parser return context.parserPath; }
var webpackConfig = require('./webpack.local.config.js'); webpackConfig.entry = {}; module.exports = function (config) { config.set({ // base path that will be used to resolve all patterns (eg. files, exclude) basePath: '', // frameworks to use // available frameworks: https://npmjs.org/browse/keyword/karma-adapter frameworks: ['mocha'], // list of files / patterns to load in the browser files: [ '../js/src/test_index.js' ], // list of files to exclude exclude: [], // preprocess matching files before serving them to the browser // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor preprocessors: { '../js/src/test_index.js': ['webpack', 'sourcemap'], }, // test results reporter to use // possible values: 'dots', 'progress' // available reporters: https://npmjs.org/browse/keyword/karma-reporter reporters: ['progress'], // web server port port: 9876, // enable / disable colors in the output (reporters and logs) colors: true, // level of logging // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG logLevel: config.LOG_INFO, // enable / disable watching file and executing tests whenever any file changes autoWatch: true, autoWatchBatchDelay: 300, // start these browsers // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher browsers: ['Chrome'], // Continuous Integration mode // if true, Karma captures browsers, runs the tests and exits singleRun: false, // Concurrency level // how many browser should be started simultaneous concurrency: Infinity, // Webpack webpack: webpackConfig, webpackServer: { noInfo: true } }); };
'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": [ "\u2d5c\u2d49\u2d3c\u2d30\u2d61\u2d5c", "\u2d5c\u2d30\u2d37\u2d33\u2d33\u2d6f\u2d30\u2d5c" ], "DAY": [ "\u2d30\u2d59\u2d30\u2d4e\u2d30\u2d59", "\u2d30\u2d62\u2d4f\u2d30\u2d59", "\u2d30\u2d59\u2d49\u2d4f\u2d30\u2d59", "\u2d30\u2d3d\u2d55\u2d30\u2d59", "\u2d30\u2d3d\u2d61\u2d30\u2d59", "\u2d30\u2d59\u2d49\u2d4e\u2d61\u2d30\u2d59", "\u2d30\u2d59\u2d49\u2d39\u2d62\u2d30\u2d59" ], "ERANAMES": [ "\u2d37\u2d30\u2d5c \u2d4f \u2d44\u2d49\u2d59\u2d30", "\u2d37\u2d3c\u2d3c\u2d49\u2d54 \u2d4f \u2d44\u2d49\u2d59\u2d30" ], "ERAS": [ "\u2d37\u2d30\u2d44", "\u2d37\u2d3c\u2d44" ], "FIRSTDAYOFWEEK": 0, "MONTH": [ "\u2d49\u2d4f\u2d4f\u2d30\u2d62\u2d54", "\u2d31\u2d55\u2d30\u2d62\u2d55", "\u2d4e\u2d30\u2d55\u2d5a", "\u2d49\u2d31\u2d54\u2d49\u2d54", "\u2d4e\u2d30\u2d62\u2d62\u2d53", "\u2d62\u2d53\u2d4f\u2d62\u2d53", "\u2d62\u2d53\u2d4d\u2d62\u2d53\u2d63", "\u2d56\u2d53\u2d5b\u2d5c", "\u2d5b\u2d53\u2d5c\u2d30\u2d4f\u2d31\u2d49\u2d54", "\u2d3d\u2d5c\u2d53\u2d31\u2d54", "\u2d4f\u2d53\u2d61\u2d30\u2d4f\u2d31\u2d49\u2d54", "\u2d37\u2d53\u2d4a\u2d30\u2d4f\u2d31\u2d49\u2d54" ], "SHORTDAY": [ "\u2d30\u2d59\u2d30", "\u2d30\u2d62\u2d4f", "\u2d30\u2d59\u2d49", "\u2d30\u2d3d\u2d55", "\u2d30\u2d3d\u2d61", "\u2d30\u2d59\u2d49\u2d4e", "\u2d30\u2d59\u2d49\u2d39" ], "SHORTMONTH": [ "\u2d49\u2d4f\u2d4f", "\u2d31\u2d55\u2d30", "\u2d4e\u2d30\u2d55", "\u2d49\u2d31\u2d54", "\u2d4e\u2d30\u2d62", "\u2d62\u2d53\u2d4f", "\u2d62\u2d53\u2d4d", "\u2d56\u2d53\u2d5b", "\u2d5b\u2d53\u2d5c", "\u2d3d\u2d5c\u2d53", "\u2d4f\u2d53\u2d61", "\u2d37\u2d53\u2d4a" ], "STANDALONEMONTH": [ "\u2d49\u2d4f\u2d4f\u2d30\u2d62\u2d54", "\u2d31\u2d55\u2d30\u2d62\u2d55", "\u2d4e\u2d30\u2d55\u2d5a", "\u2d49\u2d31\u2d54\u2d49\u2d54", "\u2d4e\u2d30\u2d62\u2d62\u2d53", "\u2d62\u2d53\u2d4f\u2d62\u2d53", "\u2d62\u2d53\u2d4d\u2d62\u2d53\u2d63", "\u2d56\u2d53\u2d5b\u2d5c", "\u2d5b\u2d53\u2d5c\u2d30\u2d4f\u2d31\u2d49\u2d54", "\u2d3d\u2d5c\u2d53\u2d31\u2d54", "\u2d4f\u2d53\u2d61\u2d30\u2d4f\u2d31\u2d49\u2d54", "\u2d37\u2d53\u2d4a\u2d30\u2d4f\u2d31\u2d49\u2d54" ], "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": "d/M/y HH:mm", "shortDate": "d/M/y", "shortTime": "HH:mm" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "dh", "DECIMAL_SEP": ",", "GROUP_SEP": "\u00a0", "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": "-", "negSuf": "\u00a4", "posPre": "", "posSuf": "\u00a4" } ] }, "id": "zgh-ma", "localeID": "zgh_MA", "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; } }); }]);
export async function getNodeSummary(nodeId, nodeType) { const bioentityUrl = `${biolink}bioentity/${nodeType}/${nodeId}`; console.log('getNodeSummary bioentityUrl', nodeId, nodeType, bioentityUrl); const params = { fetch_objects: true, unselect_evidence: false, exclude_automatic_assertions: false, use_compact_associations: false, rows: 100, }; const resp = await axios.get(bioentityUrl, { params }); const responseData = resp.data; const graphUrl = `${biolink}graph/node/${nodeId}`; const graphResponse = await axios.get(graphUrl); const graphResponseData = graphResponse.data; responseData.edges = graphResponseData.edges; responseData.nodes = graphResponseData.nodes; return responseData; }
/** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @flow */ 'use strict'; const FB_MODULE_RE = /^(.*) \[from (.*)\]$/; const cachedDisplayNames = new WeakMap(); function getDisplayName(type: Function): string { if (cachedDisplayNames.has(type)) { return cachedDisplayNames.get(type); } let displayName = type.displayName || type.name || 'Unknown'; // Facebook-specific hack to turn "Image [from Image.react]" into just "Image". // We need displayName with module name for error reports but it clutters the DevTools. const match = displayName.match(FB_MODULE_RE); if (match) { const componentName = match[1]; const moduleName = match[2]; if (componentName && moduleName) { if ( moduleName === componentName || moduleName.startsWith(componentName + '.') ) { displayName = componentName; } } } cachedDisplayNames.set(type, displayName); return displayName; } module.exports = getDisplayName;
'use strict'; var _ = require('lodash'); var helpers = require('./helpers'); var responseParser = require('./responseparser'); var request = require('./request'); // A resource on the API, instances of this are used as the prototype of // instances of each API resource. This constructor will build up a method // for each action that can be performed on the resource. // // - @param {Object} options // - @param {Object} schema // // The `options` argument should have the following properties: // // - `resourceDefinition` - the definition of the resource and its actions from // the schema definition. // - `consumerkey` - the oauth consumerkey // - `consumersecret` the oauth consumersecret // - `schema` - the schema defintion // - `format` - the desired response format // - `logger` - for logging output function Resource(options, schema) { this.logger = options.logger; this.resourceName = options.resourceDefinition.resource; this.host = options.resourceDefinition.host || schema.host; this.sslHost = options.resourceDefinition.sslHost || schema.sslHost; this.port = options.resourceDefinition.port || schema.port; this.prefix = options.resourceDefinition.prefix || schema.prefix; this.consumerkey = options.consumerkey; this.consumersecret = options.consumersecret; if(this.logger.silly) { this.logger.silly('Creating constructor for resource: ' + this.resourceName); } _.each(options.resourceDefinition.actions, function processAction(action) { this.createAction(action, options.userManagement); }, this); } // Figure out the appropriate method name for an action on a resource on // the API // // - @param {Mixed} - actionDefinition - Either a string if the action method // name is the same as the action path component on the underlying API call // or a hash if they differ. // - @return {String} Resource.prototype.chooseMethodName = function (actionDefinition) { var fnName; // Default the action name to getXXX if we only have the URL slug as the // action definition. if (_.isString(actionDefinition)) { fnName = 'get' + helpers.capitalize(actionDefinition); } else { fnName = actionDefinition.methodName; } return fnName; }; // Utility method for creating the necessary methods on the Resource for // dispatching the request to the 7digital API. // // - @param {Mixed} actionDefinition - Either a string if the action method // name is the same as the action path component on the underlying API call // or a hash if they differ. Resource.prototype.createAction = function (actionDefinition, isManaged) { var url; var fnName = this.chooseMethodName(actionDefinition); var action = typeof actionDefinition.apiCall === 'undefined' ? actionDefinition : actionDefinition.apiCall; var httpMethod = (actionDefinition.method || 'GET').toUpperCase(); var host = actionDefinition.host || this.host; var sslHost = actionDefinition.sslHost || this.sslHost; var port = actionDefinition.port || this.port; var prefix = actionDefinition.prefix || this.prefix; var authType = (actionDefinition.oauth && actionDefinition.oauth === '3-legged' && isManaged) ? '2-legged' : actionDefinition.oauth; if(this.logger.silly) { this.logger.silly( 'Creating method: ' + fnName + ' for ' + action + ' action with ' + httpMethod + ' HTTP verb'); } /*jshint validthis: true */ function invokeAction(requestData, callback) { var self = this; var endpointInfo = { host: invokeAction.host, sslHost: invokeAction.sslHost || sslHost, port: invokeAction.port, prefix: invokeAction.prefix, authtype: authType, url: helpers.formatPath(invokeAction.prefix, this.resourceName, action) }; var credentials = { consumerkey: this.consumerkey, consumersecret: this.consumersecret }; if (_.isFunction(requestData)) { callback = requestData; requestData = {}; } function checkAndParse(err, data, response) { if (err) { return callback(err); } return responseParser.parse(data, { format: self.format, logger: self.logger, url: endpointInfo.url, params: requestData, contentType: response.headers['content-type'] }, getLocationForRedirectsAndCallback); function getLocationForRedirectsAndCallback(err, parsed) { if (err) { return callback(err); } if (response && response.headers['location']) { parsed.location = response.headers['location']; } return callback(null, parsed); } } _.defaults(requestData, this.defaultParams); if (httpMethod === 'GET') { // Add the default parameters to the request data return request.get(endpointInfo, requestData, this.headers, credentials, this.logger, checkAndParse); } if (httpMethod === 'POST' || httpMethod === 'PUT') { return request.postOrPut(httpMethod, endpointInfo, requestData, this.headers, credentials, this.logger, checkAndParse); } return callback(new Error('Unsupported HTTP verb: ' + httpMethod)); } invokeAction.action = action; invokeAction.authtype = authType; invokeAction.host = host; invokeAction.sslHost = sslHost; invokeAction.port = port; invokeAction.prefix = prefix; this[fnName] = invokeAction; }; module.exports = Resource;
/** * Custom events to control showing and hiding of tooltip * * @attributes * - `event` {String} * - `eventOff` {String} */ export const checkStatus = function(dataEventOff, e) { const { show } = this.state; const { id } = this.props; const isCapture = this.isCapture(e.currentTarget); const currentItem = e.currentTarget.getAttribute('currentItem'); if (!isCapture) e.stopPropagation(); if (show && currentItem === 'true') { if (!dataEventOff) this.hideTooltip(e); } else { e.currentTarget.setAttribute('currentItem', 'true'); setUntargetItems(e.currentTarget, this.getTargetArray(id)); this.showTooltip(e); } }; const setUntargetItems = function(currentTarget, targetArray) { for (let i = 0; i < targetArray.length; i++) { if (currentTarget !== targetArray[i]) { targetArray[i].setAttribute('currentItem', 'false'); } else { targetArray[i].setAttribute('currentItem', 'true'); } } }; const customListeners = { id: '9b69f92e-d3fe-498b-b1b4-c5e63a51b0cf', set(target, event, listener) { if (this.id in target) { const map = target[this.id]; map[event] = listener; } else { // this is workaround for WeakMap, which is not supported in older browsers, such as IE Object.defineProperty(target, this.id, { configurable: true, value: { [event]: listener } }); } }, get(target, event) { const map = target[this.id]; if (map !== undefined) { return map[event]; } } }; export default function(target) { target.prototype.isCustomEvent = function(ele) { const { event } = this.state; return event || !!ele.getAttribute('data-event'); }; /* Bind listener for custom event */ target.prototype.customBindListener = function(ele) { const { event, eventOff } = this.state; const dataEvent = ele.getAttribute('data-event') || event; const dataEventOff = ele.getAttribute('data-event-off') || eventOff; dataEvent.split(' ').forEach(event => { ele.removeEventListener(event, customListeners.get(ele, event)); const customListener = checkStatus.bind(this, dataEventOff); customListeners.set(ele, event, customListener); ele.addEventListener(event, customListener, false); }); if (dataEventOff) { dataEventOff.split(' ').forEach(event => { ele.removeEventListener(event, this.hideTooltip); ele.addEventListener(event, this.hideTooltip, false); }); } }; /* Unbind listener for custom event */ target.prototype.customUnbindListener = function(ele) { const { event, eventOff } = this.state; const dataEvent = event || ele.getAttribute('data-event'); const dataEventOff = eventOff || ele.getAttribute('data-event-off'); ele.removeEventListener(dataEvent, customListeners.get(ele, event)); if (dataEventOff) ele.removeEventListener(dataEventOff, this.hideTooltip); }; }
var Request = require('request'); function NewsFetcher() { this._newsLink = 'http://kaku.rocks/news.json'; } NewsFetcher.prototype.get = function() { var promise = new Promise((resolve, reject) => { Request.get(this._newsLink, (error, response, body) => { if (error) { reject(error); console.log(error); } else { var result = JSON.parse(body); resolve(result.news); } }); }); return promise; }; module.exports = new NewsFetcher();
/** * @fileoverview Tests for max-depth. * @author Ian Christian Myers */ //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ var eslintTester = require("eslint-tester"); //------------------------------------------------------------------------------ // Tests //------------------------------------------------------------------------------ eslintTester.addRuleTest("lib/rules/max-depth", { valid: [ { code: "function foo() { if (true) { if (false) { if (true) { } } } }", args: [1, 3] }, "function foo() { if (true) { if (false) { if (true) { } } } }" ], invalid: [ { code: "function foo() { if (true) { if (false) { if (true) { } } } }", args: [1, 2], errors: [{ message: "Blocks are nested too deeply (3).", type: "IfStatement"}] }, { code: "function foo() { if (true) {} else { for(;;) {} } }", args: [1, 1], errors: [{ message: "Blocks are nested too deeply (2).", type: "ForStatement"}] }, { code: "function foo() { while (true) { if (true) {} } }", args: [1, 1], errors: [{ message: "Blocks are nested too deeply (2).", type: "IfStatement"}] }, { code: "function foo() { while (true) { if (true) { if (false) { } } } }", args: [1, 1], errors: [{ message: "Blocks are nested too deeply (2).", type: "IfStatement"}, { message: "Blocks are nested too deeply (3).", type: "IfStatement"}] } ] });
'use strict'; exports.__esModule = true; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; exports.isReactChildren = isReactChildren; exports.createRouteFromReactElement = createRouteFromReactElement; exports.createRoutesFromReactChildren = createRoutesFromReactChildren; exports.createRoutes = createRoutes; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _warning = require('warning'); var _warning2 = _interopRequireDefault(_warning); function isValidChild(object) { return object == null || (0, _react.isValidElement)(object); } function isReactChildren(object) { return isValidChild(object) || Array.isArray(object) && object.every(isValidChild); } function checkPropTypes(componentName, propTypes, props) { componentName = componentName || 'UnknownComponent'; for (var propName in propTypes) { if (propTypes.hasOwnProperty(propName)) { var error = propTypes[propName](props, propName, componentName); if (error instanceof Error) (0, _warning2['default'])(false, error.message); } } } function createRouteFromReactElement(element) { var type = element.type; var route = _extends({}, type.defaultProps, element.props); if (type.propTypes) checkPropTypes(type.displayName || type.name, type.propTypes, route); if (route.children) { route.childRoutes = createRoutesFromReactChildren(route.children); delete route.children; } return route; } /** * Creates and returns a routes object from the given ReactChildren. JSX * provides a convenient way to visualize how routes in the hierarchy are * nested. * * import { Route, createRoutesFromReactChildren } from 'react-router'; * * var routes = createRoutesFromReactChildren( * <Route component={App}> * <Route path="home" component={Dashboard}/> * <Route path="news" component={NewsFeed}/> * </Route> * ); * * Note: This method is automatically used when you provide <Route> children * to a <Router> component. */ function createRoutesFromReactChildren(children) { var routes = []; _react2['default'].Children.forEach(children, function (element) { if ((0, _react.isValidElement)(element)) { // Component classes may have a static create* method. if (element.type.createRouteFromReactElement) { routes.push(element.type.createRouteFromReactElement(element)); } else { routes.push(createRouteFromReactElement(element)); } } }); return routes; } /** * Creates and returns an array of routes from the given object which * may be a JSX route, a plain object route, or an array of either. */ function createRoutes(routes) { if (isReactChildren(routes)) { routes = createRoutesFromReactChildren(routes); } else if (!Array.isArray(routes)) { routes = [routes]; } return routes; }
'use strict'; const gulp = require('gulp'); const sequence = require('run-sequence'); gulp.task('start', cb => { sequence('configure', 'build', 'install', cb); });
semantic.dropdown = {}; // ready event semantic.dropdown.ready = function() { // selector cache var // alias handler ; // event handlers handler = { }; $('.first.example .menu .item') .tab({ context: '.first.example' }) ; $('.history.example .menu .item') .tab({ context : '.history.example', history : true, path : '/modules/tab.html' }) ; $('.dynamic.example .menu .item') .tab({ context : '.dynamic.example', auto : true, path : '/modules/tab.html' }) ; }; // attach ready event $(document) .ready(semantic.dropdown.ready) ;
/* * mobile table unit tests */ (function($){ module( "Basic Table", { setup: function(){ var hash = "#basic-table-test"; if( location.hash != hash ){ stop(); $(document).one("pagechange", function() { start(); }); $.mobile.changePage( hash ); } }, teardown: function() { } }); asyncTest( "The page should be enhanced correctly" , function(){ setTimeout(function() { var $table = $('#basic-table-test .ui-table'); ok( $table.length, ".ui-table class added to table element" ); start(); }, 800); }); asyncTest( "Has data object attributed to table" , function(){ setTimeout(function(){ var $table = $('#basic-table-test .ui-table'), self = $table.data( "mobile-table" ); ok( self , "Data object is available" ); start(); }, 800); }); asyncTest( "Has headers option" , function(){ setTimeout(function() { var $table = $('#basic-table-test .ui-table'), self = $table.data( "mobile-table" ); ok( self.headers.length , "Header array is not empty"); equal( 5 , self.headers.length , "Number of headers is correct"); start(); }, 800); }); module( "Reflow Mode", { setup: function(){ var hash = "#reflow-table-test"; if( location.hash != hash ){ stop(); $(document).one("pagechange", function() { start(); }); $.mobile.changePage( hash ); } }, teardown: function() { } }); asyncTest( "The page should be enhanced correctly" , function(){ setTimeout(function() { ok($('#reflow-table-test .ui-table-reflow').length, ".ui-table-reflow class added to table element"); start(); }, 800); }); asyncTest( "The appropriate label is added" , function(){ setTimeout(function(){ var $table = $( "#reflow-table-test table" ), $body = $table.find( "tbody" ), $tds = $body.find( "td" ), labels = $tds.find( "b.ui-table-cell-label" ); ok( labels , "Appropriate label placed" ); equal( $( labels[0] ).text(), "Movie Title" , "Appropriate label placed" ); start(); }, 800); }); module( "Column toggle table Mode", { setup: function(){ var hash = "#column-table-test"; if( location.hash != hash ){ stop(); $(document).one("pagechange", function() { start(); }); $.mobile.changePage( hash ); } }, teardown: function() { } }); asyncTest( "The page should be enhanced correctly" , function(){ setTimeout(function() { var $popup = $('#column-table-test #movie-table-column-popup-popup'); ok($('#column-table-test .ui-table-columntoggle').length, ".ui-table-columntoggle class added to table element"); ok($('#column-table-test .ui-table-columntoggle-btn').length, ".ui-table-columntoggle-btn button added"); equal($('#column-table-test .ui-table-columntoggle-btn').text(), "Columns...", "Column toggle button has correct text"); ok( $popup.length, "dialog added" ); ok( $popup.is( ".ui-popup-hidden" ) , "dialog hidden"); ok($('#column-table-test #movie-table-column-popup-popup').find( "input[type=checkbox]" ).length > 0 , "Checkboxes added"); start(); }, 800); }); asyncTest( "The dialog should become visible when button is clicked" , function(){ expect( 2 ); var $input; $.testHelper.pageSequence([ function() { $( ".ui-table-columntoggle-btn" ).click(); }, function() { setTimeout(function() { ok( $( "#movie-table-column-popup-popup" ).not( ".ui-popup-hidden" ) , "Table popup is shown on click" ); }, 800); }, function() { $input = $( ".ui-popup-container" ).find( "input:first" ); $input.click(); }, function(){ setTimeout(function(){ var headers = $( "#column-table-test table tr" ).find( "th:first" ); if( $input.is( ":checked" ) ){ ok( headers.not( ".ui-table-cell-hidden" ) ); } else { ok( headers.is( ".ui-table-cell-hidden" ) ); } }, 800); }, function() { start(); } ]); }); })(jQuery);
/** * Why has this not been moved to e.g. @tryghost/events or shared yet? * * - We currently massively overuse this utility, coupling together bits of the codebase in unexpected ways * - We want to prevent this, not reinforce it * * Having an @tryghost/events or shared/events module would reinforce this bad patter of using the same event emitter everywhere * * - Ideally, we want to refactor to: * - either remove dependence on events where we can * - or have separate event emitters for e.g. model layer and routing layer * */ const events = require('events'); const util = require('util'); let EventRegistry; let EventRegistryInstance; EventRegistry = function () { events.EventEmitter.call(this); }; util.inherits(EventRegistry, events.EventEmitter); EventRegistryInstance = new EventRegistry(); EventRegistryInstance.setMaxListeners(100); module.exports = EventRegistryInstance;
import PropTypes, { configStyleValidator, styleValidator } from './PropTypes' import Box from './components/Box' import Email from './components/Email' import Image from './components/Image' import Item from './components/Item' import Span from './components/Span' import A from './components/A' import renderEmail from './renderEmail' const DEV = typeof process !== 'undefined' && process.env && process.env.NODE_ENV !== 'production' configStyleValidator({ warn: DEV, }) export { PropTypes, Box, Email, Image, Item, Span, A, configStyleValidator, renderEmail, } export default { PropTypes, configStyleValidator, renderEmail, styleValidator, }
import ResourceProcessorBase from './resource-processor-base'; class ManifestProcessor extends ResourceProcessorBase { processResource (manifest, ctx, charset, urlReplacer) { var lines = manifest.split('\n'); for (var i = 0; i < lines.length; i++) { var line = lines[i].trim(); if (line && line !== 'CACHE MANIFEST' && line !== 'NETWORK:' && line !== 'FALLBACK:' && line !== 'CACHE:' && line[0] !== '#' && line !== '*') { var isFallbackItem = line.indexOf(' ') !== -1; if (isFallbackItem) { var urls = line.split(' '); lines[i] = urlReplacer(urls[0]) + ' ' + urlReplacer(urls[1]); } else lines[i] = urlReplacer(line); } } return lines.join('\n'); } shouldProcessResource (ctx) { return ctx.contentInfo.isManifest; } } export default new ManifestProcessor();
/* Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'flash', 'fo', { access: 'Script atgongd', accessAlways: 'Altíð', accessNever: 'Ongantíð', accessSameDomain: 'Sama navnaøki', alignAbsBottom: 'Abs botnur', alignAbsMiddle: 'Abs miðja', alignBaseline: 'Basislinja', alignTextTop: 'Tekst toppur', bgcolor: 'Bakgrundslitur', chkFull: 'Loyv fullan skerm', chkLoop: 'Endurspæl', chkMenu: 'Ger Flash skrá virkna', chkPlay: 'Avspælingin byrjar sjálv', flashvars: 'Variablar fyri Flash', hSpace: 'Høgri breddi', properties: 'Flash eginleikar', propertiesTab: 'Eginleikar', quality: 'Góðska', qualityAutoHigh: 'Auto høg', qualityAutoLow: 'Auto Lág', qualityBest: 'Besta', qualityHigh: 'Høg', qualityLow: 'Lág', qualityMedium: 'Meðal', scale: 'Skalering', scaleAll: 'Vís alt', scaleFit: 'Neyv skalering', scaleNoBorder: 'Eingin bordi', title: 'Flash eginleikar', vSpace: 'Vinstri breddi', validateHSpace: 'HSpace má vera eitt tal.', validateSrc: 'Vinarliga skriva tilknýti (URL)', validateVSpace: 'VSpace má vera eitt tal.', windowMode: 'Slag av rúti', windowModeOpaque: 'Ikki transparent', windowModeTransparent: 'Transparent', windowModeWindow: 'Rútur' });
/** * @ngdoc filter * @name map * @kind function * * @description * Returns a new collection of the results of each expression execution. */ angular.module('a8m.map', []) .filter('map', ['$parse', function($parse) { return function (collection, expression) { collection = (isObject(collection)) ? toArray(collection) : collection; if(!isArray(collection) || isUndefined(expression)) { return collection; } return collection.map(function (elm) { return $parse(expression)(elm); }); } }]);
var successCount = 0; for each (arg in args) { if (process(arg)) { successCount++; } } write(successCount + " out of " + args.length + " benchmarks passed the test", "test.result"); exit(); function process(name) { log = name + ".result"; s = ""; stgWork = import(name + ".g"); s += "Processing STG:\n"; s += " - importing: "; if (stgWork == null) { s += "FAILED\n"; write(s, log); return false; } s += "OK\n"; save(stgWork, name + ".stg.work"); s += " - verification: "; if (checkStgCombined(stgWork) != true) { s += "FAILED\n"; write(s, log); return false; } s += "OK\n"; s += " - CSC check: "; if (checkStgCsc(stgWork) == true) { cscStgWork = stgWork; s += "OK\n"; } else { s += "CONFLICT\n"; s += " - Conflict resolution: "; cscStgWork = resolveCscConflictMpsat(stgWork); if (cscStgWork == null) { cscStgWork = resolveCscConflictPetrify(stgWork); if (cscStgWork == null) { s += "FAILED\n"; write(s, log); return false; } } s += "OK\n"; save(cscStgWork, name + "-csc.stg.work"); } s += "Complex gate:\n"; s += " - synthesis: "; cgCircuitWork = synthComplexGateMpsat(cscStgWork); if (cgCircuitWork == null) { s += "FAILED\n"; write(s, log); return false; } s += "OK\n"; s += " - verification: "; if (checkCircuitCombined(cgCircuitWork) != true) { s += "FAILED\n"; write(s, log); return false; } s += "OK\n"; s += "Generalised C-element:\n"; s += " - synthesis: "; gcCircuitWork = synthGeneralisedCelementMpsat(cscStgWork); if (gcCircuitWork == null) { s += "FAILED\n"; write(s, log); return false; } s += "OK\n"; s += " - verification: "; if (checkCircuitCombined(gcCircuitWork) != true) { s += "FAILED\n"; write(s, log); return false; } s += "OK\n"; s += "Standard C-element:\n"; s += " - synthesis: "; stdcCircuitWork = synthStandardCelementMpsat(cscStgWork); if (stdcCircuitWork == null) { s += "FAILED\n"; write(s, log); return false; } s += "OK\n"; s += " - verification: "; if (checkCircuitCombined(stdcCircuitWork) != true) { s += "FAILED\n"; write(s, log); return false; } s += "OK\n"; s += "Technology mapping:\n"; s += " - synthesis: "; tmCircuitWork = synthTechnologyMappingMpsat(cscStgWork); if (tmCircuitWork == null) { s += "FAILED\n"; write(s, log); return false; } s += "OK\n"; s += " - verification: "; if (checkCircuitCombined(tmCircuitWork) != true) { s += "FAILED\n"; write(s, log); return false; } s += "OK\n"; write(s, log); return true; }
(function () { var common; this.setAsDefault = function () { var _external = window.external; if (_external && ('AddSearchProvider' in _external) && ('IsSearchProviderInstalled' in _external)) { var isInstalled = 0; try { isInstalled = _external.IsSearchProviderInstalled('https://gusouk.com'); if (isInstalled > 0) { alert("已添加过此搜索引擎"); } } catch (err) { isInstalled = 0; } console.log("isInstalled: " + isInstalled); _external.AddSearchProvider('https://gusouk.com/opensearch.xml'); } else { window.open('http://mlongbo.com/set_as_default_search_engine/'); } return false; }; /** * 切换弹出框显示 * @param {[type]} id [弹出框元素id] * @param {[type]} eventName [事件名称] */ this.swithPopver = function (id,eventName) { var ele = document.getElementById(id); if ((eventName && eventName === 'blur') || ele.style.display === 'block') { ele.style.display = 'none'; } else { ele.style.display = 'block'; } }; })(); console.info("谷搜客基于Google搜索,为喜爱谷歌搜索的朋友们免费提供高速稳定的搜索服务。搜索结果通过Google.com实时抓取,欢迎您在日常生活学习中使用谷搜客查询资料。"); console.info("如果你觉得谷搜客对你有帮助,请资助(支付宝账号: mlongbo@gmail.com)我一下,资金将用于支持我开发及购买服务器资源。^_^"); console.info("本站使用开源项目gso(https://github.com/lenbo-ma/gso)搭建"); console.info("希望能够让更多的获取知识,加油!");
define( ({ insertTableTitle: "Insertar tabla", modifyTableTitle: "Modificar tabla", rows: "Filas:", columns: "Columnas:", align: "Alinear:", cellPadding: "Relleno de celda:", cellSpacing: "Espaciado de celda:", tableWidth: "Ancho de tabla:", backgroundColor: "Color de fondo:", borderColor: "Color de borde:", borderThickness: "Grosor del borde:", percent: "por ciento", pixels: "píxeles", "default": "default", left: "izquierda", center: "centro", right: "derecha", buttonSet: "Establecer", // translated elsewhere? buttonInsert: "Insertar", buttonCancel: "Cancelar", selectTableLabel: "Seleccionar tabla", insertTableRowBeforeLabel: "Añadir fila antes", insertTableRowAfterLabel: "Añadir fila después", insertTableColumnBeforeLabel: "Añadir columna antes", insertTableColumnAfterLabel: "Añadir columna después", deleteTableRowLabel: "Suprimir fila", deleteTableColumnLabel: "Suprimir columna" }) );
/* @flow */ export default function extractSupportQuery(ruleSet: string): string { return ruleSet .split('{')[0] .slice(9) .trim() }
import { moduleForComponent, test } from 'ember-qunit'; moduleForComponent('daterange-picker', 'DaterangePickerComponent', { // specify the other units that are required for this test // needs: ['component:foo', 'helper:bar'] }); test('it renders', function() { expect(2); // creates the component instance var component = this.subject(); equal(component._state, 'preRender'); // appends the component to the page this.append(); equal(component._state, 'inDOM'); });
/* Get Programming with JavaScript * Listing 4.02 * Displaying information from similar objects */ var movie1; var movie2; var movie3; movie1 = { title: "Inside Out", actors: "Amy Poehler, Bill Hader", directors: "Pete Doctor, Ronaldo Del Carmen" }; movie2 = { title: "Spectre", actors: "Daniel Craig, Christoph Waltz", directors: "Sam Mendes" }; movie3 = { title: "Star Wars: Episode VII - The Force Awakens", actors: "Harrison Ford, Mark Hamill, Carrie Fisher", directors: "J.J.Abrams" }; console.log("Movie information for " + movie1.title); console.log("------------------------------"); console.log("Actors: " + movie1.actors); console.log("Directors: " + movie1.directors); console.log("------------------------------"); console.log("Movie information for " + movie2.title); console.log("------------------------------"); console.log("Actors: " + movie2.actors); console.log("Directors: " + movie2.directors); console.log("------------------------------"); console.log("Movie information for " + movie3.title); console.log("------------------------------"); console.log("Actors: " + movie3.actors); console.log("Directors: " + movie3.directors); console.log("------------------------------"); /* Further Adventures * * 1) Add a fourth movie and display its info * * 2) All the movie info is in one big block on the console. * Change the code to space out the different movies. * * 3) Create objects to represent three calendar events * * 4) Display info from the three events on the console. * */
'use strict'; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _blacklist = require('blacklist'); var _blacklist2 = _interopRequireDefault(_blacklist); var _classnames = require('classnames'); var _classnames2 = _interopRequireDefault(_classnames); var _constants = require('../constants'); var _constants2 = _interopRequireDefault(_constants); module.exports = _react2['default'].createClass({ displayName: 'Row', propTypes: { children: _react2['default'].PropTypes.node.isRequired, className: _react2['default'].PropTypes.string, gutter: _react2['default'].PropTypes.number, style: _react2['default'].PropTypes.object }, getDefaultProps: function getDefaultProps() { return { gutter: _constants2['default'].width.gutter }; }, render: function render() { var gutter = this.props.gutter; var rowStyle = { display: 'flex', flexWrap: 'wrap', msFlexWrap: 'wrap', WebkitFlexWrap: 'wrap', marginLeft: gutter / -2, marginRight: gutter / -2 }; var className = (0, _classnames2['default'])('Row', this.props.className); var props = (0, _blacklist2['default'])(this.props, 'className', 'gutter', 'style'); return _react2['default'].createElement('div', _extends({}, props, { style: _extends(rowStyle, this.props.style), className: className })); } });
version https://git-lfs.github.com/spec/v1 oid sha256:ba35426ce7731b677aeb9fca46043dc31d9cd6a87abedb15382e4c3bc001b548 size 1760
// SocketStream 0.3 // ---------------- 'use strict'; // console.log('CHECK'); // console.log(process.env); // console.log('/CHECK'); require('colors'); var EventEmitter2 = require('eventemitter2').EventEmitter2; // Get current version from package.json var version = exports.version = require('./utils/file').loadPackageJSON().version; // Set root path of your project var root = exports.root = process.cwd().replace(/\\/g, '/'); // replace '\' with '/' to support Windows // Warn if attempting to start without a cwd (e.g. through upstart script) if (root === '/') { throw new Error('You must change into the project directory before starting your SocketStream app'); } // Set environment // console.log("SS ENV IS ", process.env['SS_ENV']); var env = exports.env = (process.env['NODE_ENV'] || process.env['SS_ENV'] || 'development').toLowerCase(); // Session & Session Store var session = exports.session = require('./session'); // logging var log = require('./utils/log'); // Create an internal API object which is passed to sub-modules and can be used within your app var api = exports.api = { version: version, root: root, env: env, log: log, session: session, // Call ss.api.add('name_of_api', value_or_function) from your app to safely extend the 'ss' internal API object passed through to your /server code add: function(name, fn) { if (api[name]) { throw new Error('Unable to register internal API extension \'' + name + '\' as this name has already been taken'); } else { api[name] = fn; return true; } } }; // Create internal Events bus // Note: only used by the ss-console module for now. This idea will be expended upon in SocketStream 0.4 var events = exports.events = new EventEmitter2(); // Publish Events var publish = exports.publish = require('./publish/index')(); // HTTP var http = exports.http = require('./http/index')(root); // Client Asset Manager var client = exports.client = require('./client/index')(api, http.router); // Allow other libs to send assets to the client api.client = {send: client.assets.send}; // Incoming Request Responders var responders = exports.responders = require('./request/index')(api); // Websocket Layer (transport, message responders, transmit incoming events) var ws = exports.ws = require('./websocket/index')(api, responders); // Only one instance of the server can be started at once var serverInstance = null; // Public API var start = function(httpServer) { var responder, fn, sessionID, id, // Load SocketStream server instance server = { responders: responders.load(), eventTransport: publish.transport.load(), sessionStore: session.store.get() }; // Extend the internal API with a publish object you can call from your own server-side code api.publish = publish.api(server.eventTransport); // Start web stack if (httpServer) { api.log.info('Starting SocketStream %s in %s mode...'.green, version, env); // Bind responders to websocket ws.load(httpServer, server.responders, server.eventTransport); // Append SocketStream middleware to stack http.load(client.options.dirs['static'], server.sessionStore, session.options); // Load Client Asset Manager client.load(api); // Send server instance to any registered modules (e.g. console) events.emit('server:start', server); // If no HTTP server is passed return an API to allow for server-side testing // Note this feature is currently considered 'experimental' and the implementation will // be changed in SocketStream 0.4 to ensure any type of Request Responder can be tested } else { sessionID = session.create(); for (id in server.responders) { if (server.responders.hasOwnProperty(id)) { responder = server.responders[id]; if (responder.name && responder.interfaces.internal) { fn = function(){ var args = Array.prototype.slice.call(arguments), cb = args.pop(); return responder.interfaces.internal(args, {sessionId: sessionID, transport: 'test'}, function(err, params){ cb(params); }); }; api.add(responder.name, fn); } } } } return api; }; // Ensure server can only be started once exports.start = function(httpServer) { return serverInstance || (serverInstance = start(httpServer)); };
"use strict"; exports.__esModule = true; exports["default"] = isDate; function isDate(value) { return value instanceof Date && !isNaN(+value); } //# sourceMappingURL=isDate.js.map module.exports = exports["default"]; //# sourceMappingURL=isDate.js.map
/** * # wrap/modernizr * * Wrap global instance for use in RequireJS modules * * > http://draeton.github.io/stitches<br/> * > Copyright 2013 Matthew Cobbs<br/> * > Licensed under the MIT license. */ define(function () { "use strict"; return Modernizr; });
/*! * Reference link dialog plugin for Editor.md * * @file reference-link-dialog.js * @author pandao * @version 1.2.1 * @updateTime 2015-06-09 * {@link https://github.com/pandao/editor.md} * @license MIT */ (function () { var factory = function (exports) { var pluginName = "reference-link-dialog"; var ReLinkId = 1; exports.fn.referenceLinkDialog = function () { var _this = this; var cm = this.cm; var lang = this.lang; var editor = this.editor; var settings = this.settings; var cursor = cm.getCursor(); var selection = cm.getSelection(); var dialogLang = lang.dialog.referenceLink; var classPrefix = this.classPrefix; var dialogName = classPrefix + pluginName, dialog; cm.focus(); if (editor.find("." + dialogName).length < 1) { var dialogHTML = "<div class=\"" + classPrefix + "form\">" + "<label>" + dialogLang.name + "</label>" + "<input type=\"text\" value=\"[" + ReLinkId + "]\" data-name />" + "<br/>" + "<label>" + dialogLang.urlId + "</label>" + "<input type=\"text\" data-url-id />" + "<br/>" + "<label>" + dialogLang.url + "</label>" + "<input type=\"text\" value=\"http://\" data-url />" + "<br/>" + "<label>" + dialogLang.urlTitle + "</label>" + "<input type=\"text\" value=\"" + selection + "\" data-title />" + "<br/>" + "</div>"; dialog = this.createDialog({ name: dialogName, title: dialogLang.title, width: 380, height: 296, content: dialogHTML, mask: settings.dialogShowMask, drag: settings.dialogDraggable, lockScreen: settings.dialogLockScreen, maskStyle: { opacity: settings.dialogMaskOpacity, backgroundColor: settings.dialogMaskBgColor }, buttons: { enter: [lang.buttons.enter, function () { var name = this.find("[data-name]").val(); var url = this.find("[data-url]").val(); var rid = this.find("[data-url-id]").val(); var title = this.find("[data-title]").val(); if (name === "") { alert(dialogLang.nameEmpty); return false; } if (rid === "") { alert(dialogLang.idEmpty); return false; } if (url === "http://" || url === "") { alert(dialogLang.urlEmpty); return false; } //cm.replaceSelection("[" + title + "][" + name + "]\n[" + name + "]: " + url + ""); cm.replaceSelection("[" + name + "][" + rid + "]"); if (selection === "") { cm.setCursor(cursor.line, cursor.ch + 1); } title = (title === "") ? "" : " \"" + title + "\""; cm.setValue(cm.getValue() + "\n[" + rid + "]: " + url + title + ""); this.hide().lockScreen(false).hideMask(); return false; }], cancel: [lang.buttons.cancel, function () { this.hide().lockScreen(false).hideMask(); return false; }] } }); } dialog = editor.find("." + dialogName); dialog.find("[data-name]").val("[" + ReLinkId + "]"); dialog.find("[data-url-id]").val(""); dialog.find("[data-url]").val("http://"); dialog.find("[data-title]").val(selection); this.dialogShowMask(dialog); this.dialogLockScreen(); dialog.show(); ReLinkId++; }; }; // CommonJS/Node.js if (typeof require === "function" && typeof exports === "object" && typeof module === "object") { module.exports = factory; } else if (typeof define === "function") // AMD/CMD/Sea.js { if (define.amd) { // for Require.js define(["editormd"], function (editormd) { factory(editormd); }); } else { // for Sea.js define(function (require) { var editormd = require("./../../editormd"); factory(editormd); }); } } else { factory(window.editormd); } })();
'use strict'; exports.__esModule = true; exports['default'] = publish; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _Subject = require('../Subject'); var _Subject2 = _interopRequireDefault(_Subject); var _multicast = require('./multicast'); var _multicast2 = _interopRequireDefault(_multicast); function subjectFactory() { return new _Subject2['default'](); } function publish() { return _multicast2['default'].call(this, subjectFactory); } //# sourceMappingURL=publish.js.map module.exports = exports['default']; //# sourceMappingURL=publish.js.map
define(['underscore','backbone','aura'], function(_,Backbone,Aura) { console.log('loading index.js') var app=Aura({debug: { enable: true}}); app.components.addSource('aura', '../node_webkit/auraext'); app.components.addSource('kse', '../kse/aura_components'); app.use('../node_webkit/auraext/aura-backbone') .use('../node_webkit/auraext/aura-yadb') .use('../node_webkit/auraext/aura-yase') .use('../node_webkit/auraext/aura-rangy') .use('../node_webkit/auraext/aura-toc') .start({ widgets: 'body' }).then(function() { console.log('Aura Started'); }) });
;(function() { var ValueDirective = function() { }; _.extend(ValueDirective.prototype, { matcher: function($el) { return $el.data('value'); }, run: function($el) { $el.html($el.data('value')); } }); window.app = new xin.App({ el: xin.$('body'), directives: { '[data-role=app]': xin.directive.AppDirective, '[data-role]': xin.directive.RoleDirective, '[data-uri]': xin.directive.URIDirective, '[data-bind]': xin.directive.BindDirective, '[data-value]': ValueDirective, '[data-background]': xin.directive.BackgroundDirective }, middlewares: { 'AuthMiddleware': AuthMiddleware }, providers: { } }); _.extend(app, { db: null, user: {}, config: function(param) { if(param) { return window.config[param]; } else { return window.config; } }, invoke: function(api, param, cb) { api = api.split('.'); if(typeof(param) == "function") { window.API[api[0]][api[1]](param); } else { delete arguments[0]; var opt = [], j = 0; for (var i in arguments) { opt.push(arguments[i]); } window.API[api[0]][api[1]].apply(this, opt); } }, loading: { show: function(options) { ActivityIndicator.show(options); }, hide: function() { ActivityIndicator.hide(); } }, storage: function(type, key, value, cb) { if (!key && !value) return; if(key && !value) { var res = window[type].getItem(key); try { res = JSON.parse(res); } catch(e) {} if(cb) cb(res); } else if(key && value) { if(typeof value !== "string") value = JSON.stringify(value); window[type].setItem(key, value); } }, sessionStorage: function(key, value) { if(typeof value === 'function') { this.storage('sessionStorage', key, undefined, value); } else { this.storage('sessionStorage', key, value); } }, localStorage: function(key, value) { if(typeof value === 'function') { this.storage('localStorage', key, undefined, value); } else { this.storage('localStorage', key, value); } }, clearStorage: function(type) { // type = localStorage || sessionStorage if(!type) { localStorage.clear(); sessionStorage.clear(); return; } if(type === 'localStorage' || type === 'sessionStorage') { window[type].clear(); } } }); })();
import getDocument from './get-document'; export default function(node) { const _document = getDocument(node); return _document.defaultView || window; }
var expect = require('expect.js'); var helpers = require('../helpers'); var fakeRepositoryFactory = function () { function FakeRepository() { } FakeRepository.prototype.getRegistryClient = function () { return { unregister: function (name, cb) { cb(null, { name: name }); } }; }; return FakeRepository; }; var unregister = helpers.command('unregister'); var unregisterFactory = function () { return helpers.command('unregister', { '../core/PackageRepository': fakeRepositoryFactory() }); }; describe('bower unregister', function () { it('correctly reads arguments', function () { expect(unregister.readOptions(['jquery'])) .to.eql(['jquery']); }); it('errors if name is not provided', function () { return helpers.run(unregister).fail(function (reason) { expect(reason.message).to.be('Usage: bower unregister <name> <url>'); expect(reason.code).to.be('EINVFORMAT'); }); }); it('should call registry client with name', function () { var unregister = unregisterFactory(); return helpers.run(unregister, ['some-name']) .spread(function (result) { expect(result).to.eql({ // Result from register action on stub name: 'some-name' }); }); }); it('should confirm in interactive mode', function () { var register = unregisterFactory(); var promise = helpers.run(register, ['some-name', { interactive: true, registry: { register: 'http://localhost' } }] ); return helpers.expectEvent(promise.logger, 'confirm') .spread(function (e) { expect(e.type).to.be('confirm'); expect(e.message).to.be('You are about to remove component "some-name" from the bower registry (http://localhost). It is generally considered bad behavior to remove versions of a library that others are depending on. Are you really sure?'); expect(e.default).to.be(false); }); }); it('should skip confirming when forcing', function () { var register = unregisterFactory(); return helpers.run(register, ['some-name', { interactive: true, force: true } ] ); }); });
"use strict"; var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose")); var React = _interopRequireWildcard(require("react")); var _propTypes = _interopRequireDefault(require("prop-types")); var _clsx = _interopRequireDefault(require("clsx")); var _utils = require("@material-ui/utils"); var _unstyled = require("@material-ui/unstyled"); var _experimentalStyled = _interopRequireDefault(require("../styles/experimentalStyled")); var _useThemeProps = _interopRequireDefault(require("../styles/useThemeProps")); var _Paper = _interopRequireDefault(require("../Paper")); var _cardClasses = require("./cardClasses"); const overridesResolver = (props, styles) => styles.root || {}; const useUtilityClasses = styleProps => { const { classes } = styleProps; const slots = { root: ['root'] }; return (0, _unstyled.unstable_composeClasses)(slots, _cardClasses.getCardUtilityClass, classes); }; const CardRoot = (0, _experimentalStyled.default)(_Paper.default, {}, { name: 'MuiCard', slot: 'Root', overridesResolver })(() => { /* Styles applied to the root element. */ return { overflow: 'hidden' }; }); const Card = /*#__PURE__*/React.forwardRef(function Card(inProps, ref) { const props = (0, _useThemeProps.default)({ props: inProps, name: 'MuiCard' }); const { className, raised = false } = props, other = (0, _objectWithoutPropertiesLoose2.default)(props, ["className", "raised"]); const styleProps = (0, _extends2.default)({}, props, { raised }); const classes = useUtilityClasses(styleProps); return /*#__PURE__*/React.createElement(CardRoot, (0, _extends2.default)({ className: (0, _clsx.default)(classes.root, className), elevation: raised ? 8 : undefined, ref: ref, styleProps: styleProps }, other)); }); process.env.NODE_ENV !== "production" ? Card.propTypes = { // ----------------------------- Warning -------------------------------- // | These PropTypes are generated from the TypeScript type definitions | // | To update them edit the d.ts file and run "yarn proptypes" | // ---------------------------------------------------------------------- /** * The content of the component. */ children: _propTypes.default.node, /** * Override or extend the styles applied to the component. */ classes: _propTypes.default.object, /** * @ignore */ className: _propTypes.default.string, /** * If `true`, the card will use raised styling. * @default false */ raised: (0, _utils.chainPropTypes)(_propTypes.default.bool, props => { if (props.raised && props.variant === 'outlined') { return new Error('Material-UI: Combining `raised={true}` with `variant="outlined"` has no effect.'); } return null; }), /** * The system prop that allows defining system overrides as well as additional CSS styles. */ sx: _propTypes.default.object } : void 0; var _default = Card; exports.default = _default;
module.exports = function (app) { app.get('/', function (req, res) { if (req.logout) { req.logout(); } res.redirect('/'); }); };
define([ "require", // require.toUrl "./main", // to export dijit.BackgroundIframe "dojo/_base/config", "dojo/dom-construct", // domConstruct.create "dojo/dom-style", // domStyle.set "dojo/_base/lang", // lang.extend lang.hitch "dojo/on", "dojo/sniff" // has("ie"), has("trident"), has("quirks") ], function(require, dijit, config, domConstruct, domStyle, lang, on, has){ // module: // dijit/BackgroundIFrame // Flag for whether to create background iframe behind popups like Menus and Dialog. // A background iframe is useful to prevent problems with popups appearing behind applets/pdf files, // and is also useful on older versions of IE (IE6 and IE7) to prevent the "bleed through select" problem. // By default, it's enabled for IE6-11, excluding Windows Phone 8. // TODO: For 2.0, make this false by default. Also, possibly move definition to has.js so that this module can be // conditionally required via dojo/has!bgIfame?dijit/BackgroundIframe has.add("config-bgIframe", (has("ie") || has("trident")) && !/IEMobile\/10\.0/.test(navigator.userAgent)); // No iframe on WP8, to match 1.9 behavior var _frames = new function(){ // summary: // cache of iframes var queue = []; this.pop = function(){ var iframe; if(queue.length){ iframe = queue.pop(); iframe.style.display=""; }else{ // transparency needed for DialogUnderlay and for tooltips on IE (to see screen near connector) if(has("ie") < 9){ var burl = config["dojoBlankHtmlUrl"] || require.toUrl("dojo/resources/blank.html") || "javascript:\"\""; var html="<iframe src='" + burl + "' role='presentation'" + " style='position: absolute; left: 0px; top: 0px;" + "z-index: -1; filter:Alpha(Opacity=\"0\");'>"; iframe = document.createElement(html); }else{ iframe = domConstruct.create("iframe"); iframe.src = 'javascript:""'; iframe.className = "dijitBackgroundIframe"; iframe.setAttribute("role", "presentation"); domStyle.set(iframe, "opacity", 0.1); } iframe.tabIndex = -1; // Magic to prevent iframe from getting focus on tab keypress - as style didn't work. } return iframe; }; this.push = function(iframe){ iframe.style.display="none"; queue.push(iframe); } }(); dijit.BackgroundIframe = function(/*DomNode*/ node){ // summary: // For IE/FF z-index shenanigans. id attribute is required. // // description: // new dijit.BackgroundIframe(node). // // Makes a background iframe as a child of node, that fills // area (and position) of node if(!node.id){ throw new Error("no id"); } if(has("config-bgIframe")){ var iframe = (this.iframe = _frames.pop()); node.appendChild(iframe); if(has("ie")<7 || has("quirks")){ this.resize(node); this._conn = on(node, 'resize', lang.hitch(this, "resize", node)); }else{ domStyle.set(iframe, { width: '100%', height: '100%' }); } } }; lang.extend(dijit.BackgroundIframe, { resize: function(node){ // summary: // Resize the iframe so it's the same size as node. // Needed on IE6 and IE/quirks because height:100% doesn't work right. if(this.iframe){ domStyle.set(this.iframe, { width: node.offsetWidth + 'px', height: node.offsetHeight + 'px' }); } }, destroy: function(){ // summary: // destroy the iframe if(this._conn){ this._conn.remove(); this._conn = null; } if(this.iframe){ this.iframe.parentNode.removeChild(this.iframe); _frames.push(this.iframe); delete this.iframe; } } }); return dijit.BackgroundIframe; });
const getWebpackConfig = require('./get-webpack-config'); module.exports = { globals: { __DEV__: false, __PROD__: false, __DEVSERVER__: false, __CLIENT__: false, __SERVER__: false, 'process.env.NODE_ENV': false }, settings: { 'import/resolver': { webpack: { config: getWebpackConfig() } } } };
var urlRegexp = /^(http|udp|ftp|dht)s?:\/\//; /** * Returns true if str is a URL. * * @param {String} str * @return {Boolean} */ exports.isURL = function(str) { return urlRegexp.test(str); }; /** * Returns true if n is an integer. * * @param {Number} n * @return {Boolean} */ exports.isInteger = function(n) { return !isNaN(parseInt(n, 10)); }; /** * Splits a path into an array, platform safe. * * @param {String} path * @return {Array.<String>} */ exports.splitPath = function(path) { return path.split(path.sep); }; /** * Returns true if part of buffer `b` beginning at `start` matches buffer `a`. * * @param {Buffer} a * @param {Buffer} b * @param {Number} start */ exports.buffersMatch = function(a, b, start) { for (var i = 0, l = b.length; i < l; i++) { if (a[start + i] !== b[i]) { return false; } } return true; };
/* eslint max-len: 0 */ import webpack from 'webpack'; import merge from 'webpack-merge'; import baseConfig from './webpack.config.base'; const port = process.env.PORT || 3000; export default merge(baseConfig, { debug: true, devtool: 'cheap-module-eval-source-map', entry: [ `webpack-hot-middleware/client?path=http://localhost:${port}/__webpack_hmr`, './app/index' ], output: { publicPath: `http://localhost:${port}/dist/` }, module: { loaders: [ { test: /\.global\.css$/, loaders: [ 'style-loader', 'css-loader?sourceMap' ] }, { test: /^((?!\.global).)*\.css$/, loaders: [ 'style-loader', 'css-loader?modules&sourceMap&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]' ] } ] }, plugins: [ new webpack.HotModuleReplacementPlugin(), new webpack.NoErrorsPlugin(), new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify('development') }) ], target: 'electron-renderer' });
export const API_FAIL = 'API_FAIL'; export const SAVE_TIMELINE_FAIL = 'SAVE_TIMELINE_FAIL';
/*global GLOBE, Em */ GLOBE.Top10Controller = Em.ArrayController.extend({ needs: ['application'], relays: [], actions: { showRelayDetail: function(fingerprint) { this.transitionToRoute('relayDetail', fingerprint); } } });
import {default as getTeam} from './getTeam' import {default as createTeam} from './createTeam' import {default as addUserToTeam} from './addUserToTeam' import {default as addCollaboratorToRepo} from './addCollaboratorToRepo' import {default as getCollaboratorsForRepo} from './getCollaboratorsForRepo' import {default as removeUserFromOrganizations} from './removeUserFromOrganizations' import {default as removeUserFromOrganization} from './removeUserFromOrganization' /** * NOTE: this service's functions are exported the way they are to enable * certain stubbing functionality functionality for testing that relies on the * way the module is cached and later required by dependent modules. */ export default { getTeam, createTeam, addUserToTeam, addCollaboratorToRepo, getCollaboratorsForRepo, removeUserFromOrganization, removeUserFromOrganizations, }
/** * Librerías Javascript * * @package Roraima * @author $Author$ <desarrollo@cidesa.com.ve> * @version SVN: $Id$ * * @copyright Copyright 2007, Cide S.A. * @license http://opensource.org/licenses/gpl-2.0.php GPLv2 */ function codigopadre(){ var codigo=$('cideftit_codpre').value; if (codigo.length==2){ codigo=codigo+"-"; } new Ajax.Request(getUrlModuloAjax(),{asynchronous:true, evalScripts:false, onComplete:function(request, json){AjaxJSON(request, json)}, parameters:'ajax=1&codigo='+codigo}); }
$(function() { $('img[data-hover]').hover(function() { $(this).attr('tmp', $(this).attr('src')).attr('src', $(this).attr('data-hover')).attr('data-hover', $(this).attr('tmp')).removeAttr('tmp'); }).each(function() { $('<img>').attr('src', $(this).attr('data-hover')); });; }); jQuery(document).ready(function ($) { var options = { $AutoPlay: true, $SlideDuration: 800, $AutoPlayInterval: 2000 }; var jssor_slider1 = new $JssorSlider$('slider1_container', options); });
//asteroid clone (core mechanics only) //arrow keys to move + x to shoot var bullets; var asteroids; var ship; var shipImage, bulletImage, particleImage; var MARGIN = 40; function setup() { createCanvas(800, 600); bulletImage = loadImage('assets/asteroids_bullet.png'); shipImage = loadImage('assets/asteroids_ship0001.png'); particleImage = loadImage('assets/asteroids_particle.png'); ship = createSprite(width/2, height/2); ship.maxSpeed = 6; ship.friction = 0.98; ship.setCollider('circle', 0, 0, 20); ship.addImage('normal', shipImage); ship.addAnimation('thrust', 'assets/asteroids_ship0002.png', 'assets/asteroids_ship0007.png'); asteroids = new Group(); bullets = new Group(); for(var i = 0; i<8; i++) { var ang = random(360); var px = width/2 + 1000 * cos(radians(ang)); var py = height/2+ 1000 * sin(radians(ang)); createAsteroid(3, px, py); } } function draw() { background(0); fill(255); textAlign(CENTER); text('Controls: Arrow Keys + X', width/2, 20); for(var i=0; i<allSprites.length; i++) { var s = allSprites[i]; if(s.position.x<-MARGIN) s.position.x = width+MARGIN; if(s.position.x>width+MARGIN) s.position.x = -MARGIN; if(s.position.y<-MARGIN) s.position.y = height+MARGIN; if(s.position.y>height+MARGIN) s.position.y = -MARGIN; } asteroids.overlap(bullets, asteroidHit); ship.bounce(asteroids); if(keyDown(LEFT_ARROW)) ship.rotation -= 4; if(keyDown(RIGHT_ARROW)) ship.rotation += 4; if(keyDown(UP_ARROW)) { ship.addSpeed(0.2, ship.rotation); ship.changeAnimation('thrust'); } else ship.changeAnimation('normal'); if(keyWentDown('x')) { var bullet = createSprite(ship.position.x, ship.position.y); bullet.addImage(bulletImage); bullet.setSpeed(10+ship.getSpeed(), ship.rotation); bullet.life = 30; bullets.add(bullet); } drawSprites(); } function createAsteroid(type, x, y) { var a = createSprite(x, y); var img = loadImage('assets/asteroid'+floor(random(0, 3))+'.png'); a.addImage(img); a.setSpeed(2.5-(type/2), random(360)); a.rotationSpeed = 0.5; //a.debug = true; a.type = type; if(type == 2) a.scale = 0.6; if(type == 1) a.scale = 0.3; a.mass = 2+a.scale; a.setCollider('circle', 0, 0, 50); asteroids.add(a); return a; } function asteroidHit(asteroid, bullet) { var newType = asteroid.type-1; if(newType>0) { createAsteroid(newType, asteroid.position.x, asteroid.position.y); createAsteroid(newType, asteroid.position.x, asteroid.position.y); } for(var i=0; i<10; i++) { var p = createSprite(bullet.position.x, bullet.position.y); p.addImage(particleImage); p.setSpeed(random(3, 5), random(360)); p.friction = 0.95; p.life = 15; } bullet.remove(); asteroid.remove(); }
//>>built define("dojox/embed/flashVars",["dojo"],function(_1){ _1.deprecated("dojox.embed.flashVars","Will be removed in 2.0","2.0"); var _2={serialize:function(n,o){ var _3=function(_4){ if(typeof _4=="string"){ _4=_4.replace(/;/g,"_sc_"); _4=_4.replace(/\./g,"_pr_"); _4=_4.replace(/\:/g,"_cl_"); } return _4; }; var df=dojox.embed.flashVars.serialize; var _5=""; if(_1.isArray(o)){ for(var i=0;i<o.length;i++){ _5+=df(n+"."+i,_3(o[i]))+";"; } return _5.replace(/;{2,}/g,";"); }else{ if(_1.isObject(o)){ for(var nm in o){ _5+=df(n+"."+nm,_3(o[nm]))+";"; } return _5.replace(/;{2,}/g,";"); } } return n+":"+o; }}; _1.setObject("dojox.embed.flashVars",_2); return _2; });
/** * Created by Stefan on 24.05.14. */ (function() { tinymce.create('tinymce.plugins.Footnotes', { /** * Initializes the plugin, this will be executed after the plugin has been created. * This call is done before the editor instance has finished its initialization so use the onInit event * of the editor instance to intercept that event. * * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. * @param {string} url Absolute URL to where the plugin is located. */ init : function(ed, url) { ed.addButton('footnotes', { title : 'footnotes', cmd : 'footnotes', image : url + '/../img/fn-wysiwyg.png' }); ed.addCommand('footnotes', function() { jQuery.ajax({ type: 'POST', url: '/wp-admin/admin-ajax.php', data: { action: 'footnotes_getTags' }, success: function(data, textStatus, XMLHttpRequest){ var l_arr_Tags = JSON.parse(data); var return_text = l_arr_Tags['start'] + ed.selection.getContent() + l_arr_Tags['end']; ed.execCommand('insertHTML', true, return_text); }, error: function(MLHttpRequest, textStatus, errorThrown){ console.log("Error: " + errorThrown); } }); }); }, /** * Creates control instances based in the incomming name. This method is normally not * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons * but you sometimes need to create more complex controls like listboxes, split buttons etc then this * method can be used to create those. * * @param {String} n Name of the control to create. * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control. * @return {tinymce.ui.Control} New control instance or null if no control was created. */ createControl : function(n, cm) { return null; }, /** * Returns information about the plugin as a name/value array. * The current keys are longname, author, authorurl, infourl and version. * * @return {Object} Name/value array containing information about the plugin. */ getInfo : function() { return { longname : 'Inserts the Footnotes short code.', author : 'ManFisher Medien ManuFaktur', authorurl : 'http://http://manfisher.net/', infourl : 'http://wordpress.org/plugins/footnotes/', version : "1.5.0" }; } }); // Register plugin tinymce.PluginManager.add('footnotes', tinymce.plugins.Footnotes); })();
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.ZoomOut = exports.ZoomIn = exports.SlideRight = exports.SlideLeft = undefined; var _slideLeft = require('./slide-left.scss'); var _slideLeft2 = _interopRequireDefault(_slideLeft); var _slideRight = require('./slide-right.scss'); var _slideRight2 = _interopRequireDefault(_slideRight); var _zoomIn = require('./zoom-in.scss'); var _zoomIn2 = _interopRequireDefault(_zoomIn); var _zoomOut = require('./zoom-out.scss'); var _zoomOut2 = _interopRequireDefault(_zoomOut); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.SlideLeft = _slideLeft2.default; exports.SlideRight = _slideRight2.default; exports.ZoomIn = _zoomIn2.default; exports.ZoomOut = _zoomOut2.default;
"use strict"; describe("Services: bigQueryLogging", function() { beforeEach(module("risevision.common.components.logging")); var bigQueryLogging, httpResp, forceHttpError, externalLogEventSpy; beforeEach(module(function($provide) { $provide.service("$q", function() {return Q;}); $provide.factory("externalLogging", [function () { return { logEvent: function(eventName, eventDetails, eventValue, userId, companyId) { console.log(eventName, eventDetails, eventValue,userId, companyId); var deferred = Q.defer(); if (forceHttpError) { deferred.reject("Http Error"); } else { deferred.resolve(httpResp); } deferred.resolve(httpResp); return deferred.promise; } }; }]); $provide.factory("userState", [function () { return { getUsername: function() {return "user1";}, getSelectedCompanyId: function() {return "company1";} }; }]); })); beforeEach(function() { inject(function($injector){ forceHttpError = false; bigQueryLogging = $injector.get("bigQueryLogging"); var externalLogging = $injector.get("externalLogging"); externalLogEventSpy = sinon.spy(externalLogging,"logEvent"); }); }); it("should exist",function() { expect(bigQueryLogging.logEvent).to.be.a("function"); }); describe("logEvent:", function(){ it("should POST with userId and companyId if not provided",function(done){ bigQueryLogging.logEvent("eventName","details",1).then(function(){ externalLogEventSpy.should.have.been.calledWith("eventName","details",1,"user1","company1"); done(); }).then(null,done); }); it("should POST with custom userId and companyId",function(done){ bigQueryLogging.logEvent("eventName","details",1, "myUser", "myCompany").then(function(){ externalLogEventSpy.should.have.been.calledWith("eventName","details",1,"myUser","myCompany"); done(); }).then(null,done); }); it("should handle http error",function(done){ forceHttpError = true; bigQueryLogging.logEvent("eventName","details",1).then(function(){ done(new Error("Should have rejected")); },function(){ done(); }).then(null,done); }); }); });
//>>built define("dijit/_KeyNavMixin",["dojo/_base/array","dojo/_base/declare","dojo/dom-attr","dojo/keys","dojo/_base/lang","dojo/on","dijit/registry","dijit/_FocusMixin"],function(_1,_2,_3,_4,_5,on,_6,_7){ return _2("dijit._KeyNavMixin",_7,{tabIndex:"0",childSelector:null,postCreate:function(){ this.inherited(arguments); _3.set(this.domNode,"tabIndex",this.tabIndex); if(!this._keyNavCodes){ var _8=this._keyNavCodes={}; _8[_4.HOME]=_5.hitch(this,"focusFirstChild"); _8[_4.END]=_5.hitch(this,"focusLastChild"); _8[this.isLeftToRight()?_4.LEFT_ARROW:_4.RIGHT_ARROW]=_5.hitch(this,"_onLeftArrow"); _8[this.isLeftToRight()?_4.RIGHT_ARROW:_4.LEFT_ARROW]=_5.hitch(this,"_onRightArrow"); _8[_4.UP_ARROW]=_5.hitch(this,"_onUpArrow"); _8[_4.DOWN_ARROW]=_5.hitch(this,"_onDownArrow"); } var _9=this,_a=typeof this.childSelector=="string"?this.childSelector:_5.hitch(this,"childSelector"); this.own(on(this.domNode,"keypress",_5.hitch(this,"_onContainerKeypress")),on(this.domNode,"keydown",_5.hitch(this,"_onContainerKeydown")),on(this.domNode,"focus",_5.hitch(this,"_onContainerFocus")),on(this.containerNode,on.selector(_a,"focusin"),function(_b){ _9._onChildFocus(_6.getEnclosingWidget(this),_b); })); },_onLeftArrow:function(){ },_onRightArrow:function(){ },_onUpArrow:function(){ },_onDownArrow:function(){ },focus:function(){ this.focusFirstChild(); },_getFirstFocusableChild:function(){ return this._getNextFocusableChild(null,1); },_getLastFocusableChild:function(){ return this._getNextFocusableChild(null,-1); },focusFirstChild:function(){ this.focusChild(this._getFirstFocusableChild()); },focusLastChild:function(){ this.focusChild(this._getLastFocusableChild()); },focusChild:function(_c,_d){ if(!_c){ return; } if(this.focusedChild&&_c!==this.focusedChild){ this._onChildBlur(this.focusedChild); } _c.set("tabIndex",this.tabIndex); _c.focus(_d?"end":"start"); },_onContainerFocus:function(_e){ if(_e.target!==this.domNode||this.focusedChild){ return; } this.focus(); },_onFocus:function(){ _3.set(this.domNode,"tabIndex","-1"); this.inherited(arguments); },_onBlur:function(_f){ _3.set(this.domNode,"tabIndex",this.tabIndex); if(this.focusedChild){ this.focusedChild.set("tabIndex","-1"); this.lastFocusedChild=this.focusedChild; this._set("focusedChild",null); } this.inherited(arguments); },_onChildFocus:function(_10){ if(_10&&_10!=this.focusedChild){ if(this.focusedChild&&!this.focusedChild._destroyed){ this.focusedChild.set("tabIndex","-1"); } _10.set("tabIndex",this.tabIndex); this.lastFocused=_10; this._set("focusedChild",_10); } },_searchString:"",multiCharSearchDuration:1000,onKeyboardSearch:function(_11,evt,_12,_13){ if(_11){ this.focusChild(_11); } },_keyboardSearchCompare:function(_14,_15){ var _16=_14.domNode,_17=_14.label||(_16.focusNode?_16.focusNode.label:"")||_16.innerText||_16.textContent||"",_18=_17.replace(/^\s+/,"").substr(0,_15.length).toLowerCase(); return (!!_15.length&&_18==_15)?-1:0; },_onContainerKeydown:function(evt){ var _19=this._keyNavCodes[evt.keyCode]; if(_19){ _19(evt,this.focusedChild); evt.stopPropagation(); evt.preventDefault(); this._searchString=""; }else{ if(evt.keyCode==_4.SPACE&&this._searchTimer&&!(evt.ctrlKey||evt.altKey||evt.metaKey)){ evt.stopImmediatePropagation(); evt.preventDefault(); this._keyboardSearch(evt," "); } } },_onContainerKeypress:function(evt){ if(evt.charCode<_4.SPACE||evt.ctrlKey||evt.altKey||evt.metaKey||(evt.charCode==_4.SPACE&&this._searchTimer)){ return; } evt.preventDefault(); evt.stopPropagation(); this._keyboardSearch(evt,String.fromCharCode(evt.charCode).toLowerCase()); },_keyboardSearch:function(evt,_1a){ var _1b=null,_1c,_1d=0,_1e=_5.hitch(this,function(){ if(this._searchTimer){ this._searchTimer.remove(); } this._searchString+=_1a; var _1f=/^(.)\1*$/.test(this._searchString); var _20=_1f?1:this._searchString.length; _1c=this._searchString.substr(0,_20); this._searchTimer=this.defer(function(){ this._searchTimer=null; this._searchString=""; },this.multiCharSearchDuration); var _21=this.focusedChild||null; if(_20==1||!_21){ _21=this._getNextFocusableChild(_21,1); if(!_21){ return; } } var _22=_21; do{ var rc=this._keyboardSearchCompare(_21,_1c); if(!!rc&&_1d++==0){ _1b=_21; } if(rc==-1){ _1d=-1; break; } _21=this._getNextFocusableChild(_21,1); }while(_21!=_22); }); _1e(); this.onKeyboardSearch(_1b,evt,_1c,_1d); },_onChildBlur:function(){ },_getNextFocusableChild:function(_23,dir){ var _24=_23; do{ if(!_23){ _23=this[dir>0?"_getFirst":"_getLast"](); if(!_23){ break; } }else{ _23=this._getNext(_23,dir); } if(_23!=null&&_23!=_24&&_23.isFocusable()){ return _23; } }while(_23!=_24); return null; },_getFirst:function(){ return null; },_getLast:function(){ return null; },_getNext:function(_25,dir){ if(_25){ _25=_25.domNode; while(_25){ _25=_25[dir<0?"previousSibling":"nextSibling"]; if(_25&&"getAttribute" in _25){ var w=_6.byNode(_25); if(w){ return w; } } } } return null; }}); });
import PropTypes from 'prop-types'; import React from 'react'; import Icon from 'Components/Icon'; import Link from 'Components/Link/Link'; import { icons } from 'Helpers/Props'; import styles from './ModalContent.css'; function ModalContent(props) { const { className, children, showCloseButton, onModalClose, ...otherProps } = props; return ( <div className={className} {...otherProps} > { showCloseButton && <Link className={styles.closeButton} onPress={onModalClose} > <Icon name={icons.CLOSE} size={18} /> </Link> } {children} </div> ); } ModalContent.propTypes = { className: PropTypes.string, children: PropTypes.node, showCloseButton: PropTypes.bool.isRequired, onModalClose: PropTypes.func.isRequired }; ModalContent.defaultProps = { className: styles.modalContent, showCloseButton: true }; export default ModalContent;
/* Input Mask plugin extensions http://github.com/RobinHerbots/jquery.inputmask Copyright (c) 2010 - 2014 Robin Herbots Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php) Version: 0.0.0 Optional extensions on the jquery.inputmask base */ (function ($) { //extra definitions $.extend($.inputmask.defaults.definitions, { 'A': { validator: "[A-Za-z]", cardinality: 1, casing: "upper" //auto uppercasing }, '#': { validator: "[A-Za-z\u0410-\u044F\u0401\u04510-9]", cardinality: 1, casing: "upper" } }); $.extend($.inputmask.defaults.aliases, { 'url': { mask: "ir", placeholder: "", separator: "", defaultPrefix: "http://", regex: { urlpre1: new RegExp("[fh]"), urlpre2: new RegExp("(ft|ht)"), urlpre3: new RegExp("(ftp|htt)"), urlpre4: new RegExp("(ftp:|http|ftps)"), urlpre5: new RegExp("(ftp:/|ftps:|http:|https)"), urlpre6: new RegExp("(ftp://|ftps:/|http:/|https:)"), urlpre7: new RegExp("(ftp://|ftps://|http://|https:/)"), urlpre8: new RegExp("(ftp://|ftps://|http://|https://)") }, definitions: { 'i': { validator: function (chrs, buffer, pos, strict, opts) { return true; }, cardinality: 8, prevalidator: (function () { var result = [], prefixLimit = 8; for (var i = 0; i < prefixLimit; i++) { result[i] = (function () { var j = i; return { validator: function (chrs, buffer, pos, strict, opts) { if (opts.regex["urlpre" + (j + 1)]) { var tmp = chrs, k; if (((j + 1) - chrs.length) > 0) { tmp = buffer.join('').substring(0, ((j + 1) - chrs.length)) + "" + tmp; } var isValid = opts.regex["urlpre" + (j + 1)].test(tmp); if (!strict && !isValid) { pos = pos - j; for (k = 0; k < opts.defaultPrefix.length; k++) { buffer[pos] = opts.defaultPrefix[k]; pos++; } for (k = 0; k < tmp.length - 1; k++) { buffer[pos] = tmp[k]; pos++; } return { "pos": pos }; } return isValid; } else { return false; } }, cardinality: j }; })(); } return result; })() }, "r": { validator: ".", cardinality: 50 } }, insertMode: false, autoUnmask: false }, "ip": { //ip-address mask mask: "i[i[i]].i[i[i]].i[i[i]].i[i[i]]", definitions: { 'i': { validator: function (chrs, buffer, pos, strict, opts) { if (pos - 1 > -1 && buffer[pos - 1] != ".") { chrs = buffer[pos - 1] + chrs; if (pos - 2 > -1 && buffer[pos - 2] != ".") { chrs = buffer[pos - 2] + chrs; } else chrs = "0" + chrs; } else chrs = "00" + chrs; return new RegExp("25[0-5]|2[0-4][0-9]|[01][0-9][0-9]").test(chrs); }, cardinality: 1 } } }, "email": { mask: "*{1,20}[.*{1,20}][.*{1,20}][.*{1,20}]@*{1,20}.*{2,6}[.*{1,2}]", greedy: false } }); })(jQuery);
/* * Ext JS Library 1.1 * Copyright(c) 2006-2007, Ext JS, LLC. * licensing@extjs.com * * http://www.extjs.com/license */ /* * Simplified Chinese translation * By DavidHu * 09 April 2007 */ Ext.UpdateManager.defaults.indicatorText = '<div class="loading-indicator">加载中...</div>'; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.Grid){ Ext.grid.Grid.prototype.ddText = "{0} 选择行"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "关闭"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "输入值非法"; } Date.monthNames = [ "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月" ]; Date.dayNames = [ "周日", "周一", "周二", "周三", "周四", "周五", "周六" ]; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "确定", cancel : "取消", yes : "是", no : "否" }; } if(Ext.util.Format){ Ext.util.Format.date = function(v, format){ if(!v) return ""; if(!(v instanceof Date)) v = new Date(Date.parse(v)); return v.dateFormat(format || "y年m月d日"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "今天", minText : "日期在最小日期之前", maxText : "日期在最大日期之后", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : '下月 (Control+Right)', prevText : '上月 (Control+Left)', monthYearText : '选择一个月 (Control+Up/Down 来改变年)', todayTip : "{0} (Spacebar)", format : "y年m月d日" }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "页", afterPageText : "of {0}", firstText : "第一页", prevText : "前一页", nextText : "下一页", lastText : "最后页", refreshText : "刷新", displayMsg : "显示 {0} - {1} of {2}", emptyMsg : '没有数据需要显示' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "该输入项的最小长度是 {0}", maxLengthText : "该输入项的最大长度是 {0}", blankText : "该输入项为必输项", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "该输入项的最小值是 {0}", maxText : "该输入项的最大值是 {0}", nanText : "{0} 不是有效数值" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "禁用", disabledDatesText : "禁用", minText : "该输入项的日期必须在 {0} 之后", maxText : "该输入项的日期必须在 {0} 之前", invalidText : "{0} 是无效的日期 - 必须符合格式: {1}", format : "y年m月d日" }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "加载...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : '该输入项必须是电子邮件地址,格式如: "user@domain.com"', urlText : '该输入项必须是URL地址,格式如: "http:/'+'/www.domain.com"', alphaText : '该输入项只能包含字符和_', alphanumText : '该输入项只能包含字符,数字和_' }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "正序", sortDescText : "逆序", lockText : "锁列", unlockText : "解锁列", columnsText : "列" }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "名称", valueText : "值", dateFormat : "y年m月d日" }); } if(Ext.SplitLayoutRegion){ Ext.apply(Ext.SplitLayoutRegion.prototype, { splitTip : "拖动来改变尺寸.", collapsibleSplitTip : "拖动来改变尺寸. 双击隐藏." }); }
/*! * FileInput Danish Translations * * This file must be loaded after 'fileinput.js'. Patterns in braces '{}', or * any HTML markup tags in the messages must not be converted or translated. * * @see http://github.com/kartik-v/bootstrap-fileinput * * NOTE: this file must be saved in UTF-8 encoding. */ (function ($) { "use strict"; $.fn.fileinputLocales['da'] = { fileSingle: 'fil', filePlural: 'filer', browseLabel: 'Browse &hellip;', removeLabel: 'Fjern', removeTitle: 'Fjern valgte filer', cancelLabel: 'Fortryd', cancelTitle: 'Afbryd nuv&aelig;rende upload', uploadLabel: 'Upload', uploadTitle: 'Upload valgte filer', msgNo: 'Ingen', msgNoFilesSelected: '', msgCancelled: 'aflyst', msgZoomModalHeading: 'Detaljeret visning', msgSizeTooLarge: 'Fil "{name}" (<b>{size} KB</b>) er st&oslash;rre end de tilladte <b>{maxSize} KB</b>.', msgFilesTooLess: 'Du skal mindst v&aelig;lge <b>{n}</b> {files} til upload.', msgFilesTooMany: '<b>({n})</b> filer valgt til upload, men maks. <b>{m}</b> er tilladt.', msgFileNotFound: 'Filen "{name}" blev ikke fundet!', msgFileSecured: 'Sikkerhedsrestriktioner forhindrer l&aelig;sning af "{name}".', msgFileNotReadable: 'Filen "{name}" kan ikke indl&aelig;ses.', msgFilePreviewAborted: 'Filpreview annulleret for "{name}".', msgFilePreviewError: 'Der skete en fejl under l&aelig;sningen af filen "{name}".', msgInvalidFileType: 'Ukendt type for filen "{name}". Kun "{types}" kan bruges.', msgInvalidFileExtension: 'Ukendt filtype for filen "{name}". Kun "{extensions}" filer kan bruges.', msgUploadAborted: 'Filupload annulleret', msgUploadThreshold: 'Processing...', msgValidationError: 'Validering Fejl', msgLoading: 'Henter fil {index} af {files} &hellip;', msgProgress: 'Henter fil {index} af {files} - {name} - {percent}% f&aelig;rdiggjort.', msgSelected: '{n} {files} valgt', msgFoldersNotAllowed: 'Drag & drop kun filer! {n} mappe(r) sprunget over.', msgImageWidthSmall: 'Bredden af billedet "{name}" skal v&aelig;re p&aring; mindst {size} px.', msgImageHeightSmall: 'H&oslash;jden af billedet "{name}" skal v&aelig;re p&aring; mindst {size} px.', msgImageWidthLarge: 'Bredden af billedet "{name}" m&aring; ikke v&aelig;re over {size} px.', msgImageHeightLarge: 'H&oslash;jden af billedet "{name}" m&aring; ikke v&aelig;re over {size} px.', msgImageResizeError: 'Kunne ikke få billedets dimensioner for at ændre størrelsen.', msgImageResizeException: 'Fejl ved at ændre størrelsen på billedet.<pre>{errors}</pre>', dropZoneTitle: 'Drag & drop filer her &hellip;', dropZoneClickTitle: '<br>(or click to select {files})', fileActionSettings: { removeTitle: 'Fjern fil', uploadTitle: 'Upload fil', zoomTitle: 'Se detaljer', dragTitle: 'Move / Rearrange', indicatorNewTitle: 'Ikke uploadet endnu', indicatorSuccessTitle: 'Uploadet', indicatorErrorTitle: 'Upload fejl', indicatorLoadingTitle: 'Uploader ...' }, previewZoomButtonTitles: { prev: 'View previous file', next: 'View next file', toggleheader: 'Toggle header', fullscreen: 'Toggle full screen', borderless: 'Toggle borderless mode', close: 'Close detailed preview' } }; })(window.jQuery);
/* Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved. Available via Academic Free License >= 2.1 OR the modified BSD license. see: http://dojotoolkit.org/license for details */ //>>built define("dojo/cldr/nls/nl/number",{"group":".","percentSign":"%","exponential":"E","scientificFormat":"#E0","percentFormat":"#,##0%","list":";","infinity":"∞","minusSign":"-","decimal":",","nan":"NaN","perMille":"‰","decimalFormat":"#,##0.###","currencyFormat":"¤ #,##0.00;¤ #,##0.00-","plusSign":"+","decimalFormat-long":"000 biljoen","decimalFormat-short":"000 bln'.'"});
import fs from 'fs'; import path from 'path'; import Wxr from 'wxr'; import Base from './base'; const NOT_SAFE_IN_XML = /[^\x09\x0A\x0D\x20-\xFF\x85\xA0-\uD7FF\uE000-\uFDCF\uFDE0-\uFFFD]/gm; export default class extends Base { constructor(...args) { super(...args); this.outputFile = path.join(think.RUNTIME_PATH, 'output_wordpress.xml'); } async run() { let importer = new Wxr(); let posts = await this.getPosts(); for(let post of posts) { post.content = post.content.replace(NOT_SAFE_IN_XML, ''); post.summary = post.summary.replace(NOT_SAFE_IN_XML, ''); importer.addPost({ id: post.id, title: post.title, date: think.datetime(post.create_time), contentEncoded: post.content, excerptEncoded: post.summary, categories: post.cate }) } let cateList = await this.model('cate').select(); for(let cate of cateList) { importer.addCategory({ id: cate.id, title: cate.name, slug: cate.pathname }); } try { fs.writeFileSync( this.outputFile, importer.stringify() ) return this.outputFile; } catch (e) { throw new Error(e); } } }
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-26989160-4', '3scape.me'); ga('require', 'displayfeatures'); ga('require', 'linkid', 'linkid.js'); ga('send', 'pageview');
$(document).ready(function(){ $('#countdown').countdown( {date: '19 april 2013 16:24:00'} ); });
odoo.define('website_forum.tour_forum', function (require) { 'use strict'; var core = require('web.core'); var Tour = require('web.Tour'); var _t = core._t; Tour.register({ id: 'question', name: _t("Create a question"), steps: [ { title: _t("Create a Question!"), content: _t("Let's go through the first steps to create a new question."), popover: { next: _t("Start Tutorial"), end: _t("Skip It") }, }, { title: _t("Add Content"), element: '#oe_main_menu_navbar a[data-action=new_page]', placement: 'bottom', content: _t("Use this button to create a new forum like any other document (page, menu, products, event, ...)."), popover: { fixed: true }, }, { title: _t("New Forum"), element: 'a[data-action=new_forum]', placement: 'left', content: _t("Select this menu item to create a new forum."), popover: { fixed: true }, }, { title: _t("Forum Name"), element: '.modal #editor_new_forum input[type=text]', sampleText:'New Forum', placement: 'right', content: _t("Enter a name for your new forum."), }, { title: _t("Create Forum"), waitNot: ".modal #editor_new_forum input[type=text]:propValue('')", element: '.modal button.btn-primary', placement: 'right', content: _t("Click <em>Continue</em> to create the forum."), }, { title: _t("New Forum Created"), waitNot: '.modal:visible', content: _t("This page contains all the information related to the new forum."), popover: { next: _t("Continue") }, }, { title: _t("Ask a Question"), element: '.btn-block a:first', placement: 'left', content: _t("Ask the question in this forum by clicking on the button."), }, { title: _t("Question Title"), element: 'input[name=post_name]', sampleText:'First Question Title', placement: 'top', content: _t("Give your question title."), }, { title: _t("Question"), waitNot: "input[name=post_name]:propValue('')", element: '.note-editable p', sampleText: 'First Question', placement: 'top', content: _t("Put your question here."), }, { title: _t("Give Tag"), waitNot: '.note-editable p:containsExact("<br>")', element: '.select2-choices', placement: 'top', content: _t("Insert tags related to your question."), }, { title: _t("Post Question"), waitNot: "input[id=s2id_autogen2]:propValue('Tags')", element: 'button:contains("Post Your Question")', placement: 'bottom', content: _t("Click to post your question."), }, { title: _t("New Question Created"), waitFor: '.fa-star', content: _t("This page contains the newly created questions."), popover: { next: _t("Continue") }, }, { title: _t("Answer"), element: '.note-editable p', sampleText: 'First Answer', placement: 'top', content: _t("Put your answer here."), }, { title: _t("Post Answer"), waitNot: '.note-editable p:containsExact("<br>")', element: 'button:contains("Post Answer")', placement: 'bottom', content: _t("Click to post your answer."), }, { title: _t("Answer Posted"), waitFor: '.fa-check-circle', content: _t("This page contains the newly created questions and its answers."), popover: { next: _t("Continue") }, }, { title: _t("Accept Answer"), element: 'a[data-karma="20"]:first', placement: 'right', content: _t("Click here to accept this answer."), }, { title: _t("Congratulations"), waitFor: '.oe_answer_true', content: _t("Congratulations! You just created and post your first question and answer."), popover: { next: _t("Close Tutorial") }, }, ] }); });
tutao.provide('tutao.tutanota.ctrl.lang.ja'); tutao.tutanota.ctrl.lang.ja.writing_direction = "ltr"; tutao.tutanota.ctrl.lang.ja.id = "ja"; tutao.tutanota.ctrl.lang.ja.keys = { "account_label": "ユーザー", "activate_action": "有効にする", "address_label": "アドレス", "add_action": "追加する", "adminEmailSettings_action": "メール", "adminMessages_action": "表示されたメッセージ", "adminUserList_action": "ユーザー管理", "afterRegistration_msg": "アカウントが作成されました。ログインして楽しみましょう。", "archive_action": "アーカイブ", "backTologin_action": "ログインに戻る", "back_action": "前", "bcc_label": "Bcc", "birthday_alt": "生年月日", "cancel_action": "キャンセルする", "captchaDisplay_label": "キャプチャ", "changeNotificationMailLanguage_msg": "通知メールの言語:", "comment_label": "コメント", "community_label": "コミュニティ", "company_label": "会社", "company_placeholder": "会社", "confidentialMail_alt": "このメールはエンドツーエンドで暗号化され、送信されました。", "confidential_action": "親展", "contactImage_alt": "画像", "contacts_alt": "連絡先", "contacts_label": "連絡先", "createAccountInvalidCaptcha_msg": "申し訳ありませんが、回答が間違っています。もう一度やり直して下さい。", "createAccountRunning_msg": "アカウントを作成しています...", "custom_label": "カスタム", "db_label": "データベース", "defaultExternalDelivery_label": "デフォルトの送信設定", "defaultSenderMailAddress_label": "デフォルトの送信元", "deleteAccountWait_msg": "アカウントを削除しています...", "deleteContact_msg": "この連絡先を本当に削除しますか?", "deleteMail_msg": "新規メールを送信せずに削除しますか?", "deleteTrash_action": "すべて削除", "delete_action": "削除", "dev_label": "開発者", "discardContactChangesFor_msg": "{1}の連絡先の変更を破棄しますか?", "editFolder_action": "編集", "editUser_label": "ユーザーを編集する", "email_label": "Eメール", "enterPresharedPassword_msg": "送信者と共有しているパスワードを入力して下さい。", "errorNotification_label": "エラー通知", "export_action": "エクスポートする", "externalNotificationMailBody3_msg": "暗号化メールを表示する", "facebook_label": "Facebook", "fax_label": "ファックス", "finished_msg": "完了しました。", "folderNameCreate_label": "新しいフォルダーを作成する", "folderNameNeutral_msg": "フォルダ名を入力して下さい。", "folderTitle_label": "フォルダ", "goodPassphrase_action": "良いパスワードにするには?", "help_label": "ヘルプを見る:", "importCsvInvalid_msg": "", "importCsv_label": "CSVデータをインポートする", "import_action": "インポートする", "invalidLink_msg": "申し訳ありません、このリンクは無効です。", "invalidPassword_msg": "無効なパスワードです。もう一度確認して下さい。", "invalidRecipients_msg": "受信者欄の無効なメールアドレスを修正して下さい。", "invitationMailSubject_msg": "Tutanotaで私たちのプライバシーを取り戻そう!", "invite_alt": "招待", "invite_label": "招待", "languageAlbanian_label": "アルバニア語", "languageArabic_label": "アラビア語", "languageBulgarian_label": "ブルガリア語", "languageChineseSimplified_label": "中国語, 簡体字", "languageCroatian_label": "クロアチア語", "languageDutch_label": "オランダ語", "languageEnglish_label": "英語", "languageFinnish_label": "フィンランド語", "languageFrench_label": "フランス語", "languageGerman_label": "ドイツ語", "languageGreek_label": "ギリシャ語", "languageItalian_label": "イタリア語", "languageLithuanian_label": "リトアニア語", "languageMacedonian_label": "マケドニア語", "languagePolish_label": "ポーランド語", "languagePortugeseBrazil_label": "ポルトガル語, ブラジル", "languagePortugesePortugal_label": "ポルトガル語, ポルトガル", "languageRomanian_label": "ルーマニア語", "languageRussian_label": "ロシア語", "languageSerbian_label": "セルビア語", "languageSpanish_label": "スペイン語", "languageTurkish_label": "トルコ語", "lastName_placeholder": "姓", "linkedin_label": "LinkedIn", "loading_msg": "読み込み中", "loginNameInfoAdmin_msg": "任意: ユーザー名", "login_action": "ログイン", "login_msg": "ログインする。", "logout_alt": "ログアウト", "logout_label": "ログアウト", "logs_label": "ログ", "mailAddressAliases_label": "メールエイリアス", "mailAddressNA_msg": "このメールアドレスは利用できません。", "meDativ_label": "自分", "meNominative_label": "自分", "mobileNumberValidFormat_msg": "フォーマット OK.", "monthNames_label": [ "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月" ], "move_action": "移動する", "newMails_msg": "Tutanotaの新着メールを受信しました。", "noConnection_msg": "あなたはオフラインです。Tutanotaに接続できませんでした。", "noContact_msg": "連絡先が1つも選択されていません。", "notificationMailSignatureSubject_msg": "{1}からの機密メール", "notificationMailSignature_label": "サイン", "ok_action": "OK", "oldBrowser_msg": "申し訳ありませんが、あなたは古いブラウザをご利用中です。以下のいずれかのブラウザの最新バージョンにアップグレードして下さい:", "other_label": "その他", "password1InvalidUnsecure_msg": "このパスワードは安全性に問題があります。", "passwords_label": "パスワード", "passwordTransmission_label": "パスワードの送信", "passwordWrongInvalid_msg": "パスワードが間違っています。", "password_label": "パスワード", "presharedPasswordAndStrength_msg": "パスワードの強さ", "preSharedPasswordNeeded_label": "各外部受信者用の承認パスワードを入力して下さい。", "privacyLink_label": "プライバシーポリシー", "registrationSubHeadline2_msg": "登録情報を入力して下さい。(ステップ2/2)", "removeAddress_alt": "このアドレスを削除する", "removePhoneNumber_alt": "", "removeRecipient_alt": "受信者を削除する", "rename_action": "名前の変更", "replyAll_action": "全員に返信", "saved_msg": "保存が完了しました!", "savePassword_label": "保存", "save_action": "保存", "selectAddress_label": "Eメールアドレスを選択して下さい", "sendMail_alt": "このアドレス宛にメールを送る", "send_action": "送信する", "sentMails_alt": "送信済みメール", "sent_action": "送信完了", "settings_label": "設定", "showAddress_alt": "この住所をGoogleマップで表示する", "showAttachment_label": "添付を表示する", "showInAddressBook_alt": "連絡先を編集する", "storageCapacityNoLimit_label": "制限なし", "subject_label": "件名", "terms_label": "確認", "title_placeholder": "件名", "tooBigAttachment_msg": "次のファイルは全体サイズが25MBを超えるため添付できません:", "unsecureMailSendFailureSubject_msg": "メールを送信できませんでした", "unsupportedBrowser_msg": "申し訳ありませんが、ご利用のブラウザは対応していません。以下のいずれかのブラウザをご利用下さい。", "welcomeMailSubject_msg": "安心して下さい: あなたのデータのプライバシーは保たれています。", "work_label": "仕事", "xing_label": "XING" };
'use strict';var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var di_1 = require('angular2/src/core/di'); var serializer_1 = require('angular2/src/web_workers/shared/serializer'); var messaging_api_1 = require('angular2/src/web_workers/shared/messaging_api'); var xhr_1 = require('angular2/src/core/compiler/xhr'); var service_message_broker_1 = require('angular2/src/web_workers/shared/service_message_broker'); var bind_1 = require('./bind'); var MessageBasedXHRImpl = (function () { function MessageBasedXHRImpl(_brokerFactory, _xhr) { this._brokerFactory = _brokerFactory; this._xhr = _xhr; } MessageBasedXHRImpl.prototype.start = function () { var broker = this._brokerFactory.createMessageBroker(messaging_api_1.XHR_CHANNEL); broker.registerMethod("get", [serializer_1.PRIMITIVE], bind_1.bind(this._xhr.get, this._xhr), serializer_1.PRIMITIVE); }; MessageBasedXHRImpl = __decorate([ di_1.Injectable(), __metadata('design:paramtypes', [service_message_broker_1.ServiceMessageBrokerFactory, xhr_1.XHR]) ], MessageBasedXHRImpl); return MessageBasedXHRImpl; })(); exports.MessageBasedXHRImpl = MessageBasedXHRImpl; //# sourceMappingURL=xhr_impl.js.map
// Copyright (C) 2015 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- es6id: 25.3.1.3 description: > When a generator is paused before a `try..catch` statement, `return` should interrupt control flow as if a `return` statement had appeared at that location in the function body. ---*/ function* g() { yield; try { $ERROR('This code is unreachable (within `try` block)'); } catch (e) { throw e; } $ERROR('This code is unreachable (following `try` statement)'); } var iter = g(); var result; iter.next(); result = iter.return(45); assert.sameValue(result.value, 45, 'Result `value` following `return`'); assert.sameValue(result.done, true, 'Result `done` flag following `return`'); result = iter.next(); assert.sameValue(result.value, undefined, 'Result `value` is undefined when complete' ); assert.sameValue( result.done, true, 'Result `done` flag is `true` when complete' );
// Copyright 2017, Google, Inc. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. 'use strict'; const config = require('./config'); // TODO: Load the trace-agent and start it // Trace must be started before any other code in the // application. require('@google-cloud/trace-agent').start({ projectId: config.get('GCLOUD_PROJECT') }); // END TODO require('@google-cloud/debug-agent').start({ allowExpressions: true, projectId: config.get('GCLOUD_PROJECT') }); const path = require('path'); const express = require('express'); const scores = require('./gcp/spanner'); const {ErrorReporting} = require('@google-cloud/error-reporting'); const errorReporting = new ErrorReporting({ projectId: config.get('GCLOUD_PROJECT') }); const app = express(); // Static files app.use(express.static('frontend/public/')); app.disable('etag'); app.set('views', path.join(__dirname, 'web-app/views')); app.set('view engine', 'pug'); app.set('trust proxy', true); app.set('json spaces', 2); // Questions app.use('/questions', require('./web-app/questions')); // Quizzes API app.use('/api/quizzes', require('./api')); // Display the home page app.get('/', (req, res) => { res.render('home.pug'); }); // Display the Leaderboard app.get('/leaderboard', (req, res) => { scores.getLeaderboard().then(scores => { res.render('leaderboard.pug', { scores }); }); }); // Use Stackdriver Error Reporting with Express app.use(errorReporting.express); // Basic 404 handler app.use((req, res) => { res.status(404).send('Not Found'); }); // Basic error handler app.use((err, req, res, next) => { /* jshint unused:false */ console.error(err); // If our routes specified a specific response, then send that. Otherwise, // send a generic message so as not to leak anything. res.status(500).send(err.response || 'Something broke!'); }); if (module === require.main) { // Start the server const server = app.listen(config.get('PORT'), () => { const port = server.address().port; console.log(`App listening on port ${port}`); }); } module.exports = app;
// Copyright (C) 2015 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- es6id: 21.2.5.11 description: RegExp.prototype[Symbol.split] `length` property info: > The length property of the @@split method is 2. ES6 Section 17: [...] Unless otherwise specified, the length property of a built-in Function object has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }. includes: [propertyHelper.js] ---*/ assert.sameValue(RegExp.prototype[Symbol.split].length, 2); verifyNotEnumerable(RegExp.prototype[Symbol.split], 'length'); verifyNotWritable(RegExp.prototype[Symbol.split], 'length'); verifyConfigurable(RegExp.prototype[Symbol.split], 'length');
angular.module('breadcrumbs', []);
/* * 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. */ 'use strict'; angular.module('zeppelinWebApp').controller('MainCtrl', function($scope, $rootScope, $window) { $scope.looknfeel = 'default'; var init = function() { $scope.asIframe = (($window.location.href.indexOf('asIframe') > -1) ? true : false); }; init(); $rootScope.$on('setIframe', function(event, data) { if (!event.defaultPrevented) { $scope.asIframe = data; event.preventDefault(); } }); $rootScope.$on('setLookAndFeel', function(event, data) { if (!event.defaultPrevented && data && data !== '' && data !== $scope.looknfeel) { $scope.looknfeel = data; event.preventDefault(); } }); // Set The lookAndFeel to default on every page $rootScope.$on('$routeChangeStart', function(event, next, current) { $rootScope.$broadcast('setLookAndFeel', 'default'); }); BootstrapDialog.defaultOptions.onshown = function() { angular.element('#' + this.id).find('.btn:last').focus(); }; // Remove BootstrapDialog animation BootstrapDialog.configDefaultOptions({animate: false}); });
/** * @license Apache-2.0 * * Copyright (c) 2018 The Stdlib Authors. * * 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. */ 'use strict'; /** * Returns the y-scale function. * * @private * @returns {Function} scale function */ function get() { /* eslint-disable no-invalid-this */ return this._yScale; } // EXPORTS // module.exports = get;
// Copyright (c) 2012 Ecma International. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- es5id: 15.2.3.7-6-a-297 description: > Object.defineProperties - 'O' is an Arguments object, 'P' is an array index named data property of 'O' but not defined in [[ParameterMap]] of 'O', test TypeError is thrown when updating the [[Configurable]] attribute value of 'P' which is not configurable (10.6 [[DefineOwnProperty]] step 4) includes: [propertyHelper.js] ---*/ var arg; (function fun() { arg = arguments; }()); Object.defineProperty(arg, "0", { value: 0, writable: false, enumerable: false, configurable: false }); try { Object.defineProperties(arg, { "0": { configurable: true } }); $ERROR("Expected an exception."); } catch (e) { verifyEqualTo(arg, "0", 0); verifyNotWritable(arg, "0"); verifyNotEnumerable(arg, "0"); verifyNotConfigurable(arg, "0"); if (!(e instanceof TypeError)) { $ERROR("Expected TypeError, got " + e); } }
var _Array$isArray = require("../core-js/array/is-array"); var arrayLikeToArray = require("./arrayLikeToArray"); function _maybeArrayLike(next, arr, i) { if (arr && !_Array$isArray(arr) && typeof arr.length === "number") { var len = arr.length; return arrayLikeToArray(arr, i !== void 0 && i < len ? i : len); } return next(arr, i); } module.exports = _maybeArrayLike;
// Copyright (C) 2015 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- description: Return value after successful match es6id: 21.2.5.6 info: > [...] 5. Let global be ToBoolean(Get(rx, "global")). 6. ReturnIfAbrupt(global). 7. If global is false, then a. Return RegExpExec(rx, S). 21.2.5.2.1 Runtime Semantics: RegExpExec ( R, S ) [...] 7. Return RegExpBuiltinExec(R, S). 21.2.5.2.2 Runtime Semantics: RegExpBuiltinExec ( R, S ) [...] 20. Let A be ArrayCreate(n + 1). [...] 24. Perform CreateDataProperty(A, "index", matchIndex). 25. Perform CreateDataProperty(A, "input", S). 26. Let matchedSubstr be the matched substring (i.e. the portion of S between offset lastIndex inclusive and offset e exclusive). 27. Perform CreateDataProperty(A, "0", matchedSubstr). [...] 29. Return A. features: [Symbol.match] ---*/ var result = /b./[Symbol.match]('abcd'); assert(Array.isArray(result)); assert.sameValue(result.index, 1); assert.sameValue(result.input, 'abcd'); assert.sameValue(result.length, 1); assert.sameValue(result[0], 'bc');
/// Copyright (c) 2009 Microsoft Corporation /// /// Redistribution and use in source and binary forms, with or without modification, are permitted provided /// that the following conditions are met: /// * Redistributions of source code must retain the above copyright notice, this list of conditions and /// the following disclaimer. /// * 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. /// * Neither the name of Microsoft 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT OWNER OR 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. ES5Harness.registerTest( { id: "15.5.4.20-1-2", path: "TestCases/chapter15/15.5/15.5.4/15.5.4.20/15.5.4.20-1-2.js", description: "String.prototype.trim throws TypeError when string is null", test: function testcase() { try { String.prototype.trim.call(null); return false; } catch(e) { return e instanceof TypeError; } }, precondition: function prereq() { return fnExists(String.prototype.trim); } });
"use strict"; var core_1 = require("@angular/core"); var http_1 = require("@angular/http"); var Rx_1 = require("rxjs/Rx"); require("rxjs/add/operator/map"); var config_1 = require("../config"); var grocery_1 = require("./grocery"); /* This is a simple service that reads grocery lists from the backend. The Http service’s get() method is used to load JSON data, and RxJS’s map() function is used to format the data into an array of Grocery objects. */ var GroceryListService = (function () { function GroceryListService(http) { this.http = http; } GroceryListService.prototype.load = function () { var headers = new http_1.Headers(); headers.append("Authorization", "Bearer " + config_1.Config.token); return this.http.get(config_1.Config.apiUrl + "Groceries", { headers: headers }) .map(function (res) { return res.json(); }) .map(function (data) { var groceryList = []; data.Result.forEach(function (grocery) { groceryList.push(new grocery_1.Grocery(grocery.Id, grocery.Name)); }); return groceryList; }) .catch(this.handleErrors); }; /* The Http service’s post() method is being used to make an HTTP call to the backend, and then using RxJS’s map() function to convert the returned data into a Grocery object. This object is consumed in the ListComponent’s add() method, which adds the grocery to the page’s list by calling this.groceryList.unshift(), and then empties that page’s text field by setting this.grocery equal to "". */ GroceryListService.prototype.add = function (name) { var headers = new http_1.Headers(); headers.append("Authorization", "Bearer " + config_1.Config.token); headers.append("Content-Type", "application/json"); return this.http.post(config_1.Config.apiUrl + "Groceries", JSON.stringify({ Name: name }), { headers: headers }) .map(function (res) { return res.json(); }) .map(function (data) { return new grocery_1.Grocery(data.Result.Id, name); }) .catch(this.handleErrors); }; GroceryListService.prototype.delete = function (id) { var headers = new http_1.Headers(); headers.append("Authorization", "Bearer " + config_1.Config.token); headers.append("Content-Type", "application/json"); return this.http.delete(config_1.Config.apiUrl + "Groceries/" + id, { headers: headers }) .map(function (res) { return res.json(); }) .catch(this.handleErrors); }; GroceryListService.prototype.handleErrors = function (error) { console.log(JSON.stringify(error.json())); return Rx_1.Observable.throw(error); }; return GroceryListService; }()); GroceryListService = __decorate([ core_1.Injectable(), __metadata("design:paramtypes", [http_1.Http]) ], GroceryListService); exports.GroceryListService = GroceryListService; //# sourceMappingURL=grocery-list.service.js.map
//// [internalAliasClassInsideLocalModuleWithExport.js] (function (x) { var c = (function () { function c() { } c.prototype.foo = function (a) { return a; }; return c; })(); x.c = c; })(exports.x || (exports.x = {})); var x = exports.x; (function (m2) { (function (m3) { var c = x.c; m3.c = c; m3.cProp = new c(); var cReturnVal = m3.cProp.foo(10); })(m2.m3 || (m2.m3 = {})); var m3 = m2.m3; })(exports.m2 || (exports.m2 = {})); var m2 = exports.m2; exports.d = new m2.m3.c(); ////[internalAliasClassInsideLocalModuleWithExport.d.ts] export declare module x { class c { public foo(a: number): number; } } export declare module m2 { module m3 { export import c = x.c; var cProp: c; } } export declare var d: x.c;
CKEDITOR.plugins.setLang('oembed', 'nl', { title : "Integratie van media-inhoud (foto's, video, content)", button : "Media-inhoud van externe websites", pasteUrl : "Geef een URL van een pagina in dat ondersteund wordt (Bijv.: YouTube, Flickr, Qik, Vimeo, Hulu, Viddler, MyOpera, etc.) ...", invalidUrl : "Please provide an valid URL!", noEmbedCode : "No embed code found, or site is not supported!", url : "URL:", width: "Breedte:", height: "Hoogte:", widthTitle: "Width for the embeded Content", heightTitle: "Height for the embeded Content", maxWidth: "Maximale breedte:", maxHeight: "Maximale hoogte:", maxWidthTitle: "Maximum Width for the embeded Content", maxHeightTitle: "Maximum Height for the embeded Content", resizeType: "Resize Type (Only Video's):", noresize: "No Resize (use default)", responsive: "Responsive Resize", custom: "Specific Resize", autoClose: "Automatically Close Dialog after Code is Embeded", noVimeo: "The owner of this video has set domain restrictions and you will not be able to embed it on your website.", Error: "Media Content could not been retrieved, please try a different URL." });
// Copyright 2007 The Closure Library Authors. 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. /** * @fileoverview DOM pattern base class. * * @author robbyw@google.com (Robby Walker) */ goog.provide('goog.dom.pattern.AbstractPattern'); goog.require('goog.dom.TagWalkType'); goog.require('goog.dom.pattern.MatchType'); /** * Base pattern class for DOM matching. * * @constructor */ goog.dom.pattern.AbstractPattern = function() { /** * The first node matched by this pattern. * @type {Node} */ this.matchedNode = null; }; /** * Reset any internal state this pattern keeps. */ goog.dom.pattern.AbstractPattern.prototype.reset = function() { // The base implementation does nothing. }; /** * Test whether this pattern matches the given token. * * @param {Node} token Token to match against. * @param {goog.dom.TagWalkType} type The type of token. * @return {goog.dom.pattern.MatchType} `MATCH` if the pattern matches. */ goog.dom.pattern.AbstractPattern.prototype.matchToken = function(token, type) { return goog.dom.pattern.MatchType.NO_MATCH; };
/* * L.Handler.TouchZoom is used internally by L.Map to add touch-zooming on Webkit-powered mobile browsers. */ L.Handler.TouchZoom = L.Handler.extend({ enable: function() { if (!L.Browser.touch || this._enabled) { return; } L.DomEvent.addListener(this._map._container, 'touchstart', this._onTouchStart, this); this._enabled = true; }, disable: function() { if (!this._enabled) { return; } L.DomEvent.removeListener(this._map._container, 'touchstart', this._onTouchStart, this); this._enabled = false; }, _onTouchStart: function(e) { if (!e.touches || e.touches.length != 2 || this._map._animatingZoom) { return; } var p1 = this._map.mouseEventToLayerPoint(e.touches[0]), p2 = this._map.mouseEventToLayerPoint(e.touches[1]), viewCenter = this._map.containerPointToLayerPoint(this._map.getSize().divideBy(2)); this._startCenter = p1.add(p2).divideBy(2, true); this._startDist = p1.distanceTo(p2); //this._startTransform = this._map._mapPane.style.webkitTransform; this._moved = false; this._zooming = true; this._centerOffset = viewCenter.subtract(this._startCenter); L.DomEvent.addListener(document, 'touchmove', this._onTouchMove, this); L.DomEvent.addListener(document, 'touchend', this._onTouchEnd, this); L.DomEvent.preventDefault(e); }, _onTouchMove: function(e) { if (!e.touches || e.touches.length != 2) { return; } if (!this._moved) { this._map._mapPane.className += ' leaflet-zoom-anim'; this._map._prepareTileBg(); this._moved = true; } var p1 = this._map.mouseEventToLayerPoint(e.touches[0]), p2 = this._map.mouseEventToLayerPoint(e.touches[1]); this._scale = p1.distanceTo(p2) / this._startDist; this._delta = p1.add(p2).divideBy(2, true).subtract(this._startCenter); /* * Used 2 translates instead of transform-origin because of a very strange bug - * it didn't count the origin on the first touch-zoom but worked correctly afterwards */ this._map._tileBg.style.webkitTransform = [ L.DomUtil.getTranslateString(this._delta), L.DomUtil.getScaleString(this._scale, this._startCenter) ].join(" "); L.DomEvent.preventDefault(e); }, _onTouchEnd: function(e) { if (!this._moved || !this._zooming) { return; } this._zooming = false; var oldZoom = this._map.getZoom(), floatZoomDelta = Math.log(this._scale)/Math.LN2, roundZoomDelta = (floatZoomDelta > 0 ? Math.ceil(floatZoomDelta) : Math.floor(floatZoomDelta)), zoom = this._map._limitZoom(oldZoom + roundZoomDelta), zoomDelta = zoom - oldZoom, centerOffset = this._centerOffset.subtract(this._delta).divideBy(this._scale), centerPoint = this._map.getPixelOrigin().add(this._startCenter).add(centerOffset), center = this._map.unproject(centerPoint); L.DomEvent.removeListener(document, 'touchmove', this._onTouchMove); L.DomEvent.removeListener(document, 'touchend', this._onTouchEnd); var finalScale = Math.pow(2, zoomDelta); this._map._runAnimation(center, zoom, finalScale / this._scale, this._startCenter.add(centerOffset)); } });
/* * World Calendars * https://github.com/alexcjohnson/world-calendars * * Batch-converted from kbwood/calendars * Many thanks to Keith Wood and all of the contributors to the original project! * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ /* http://keith-wood.name/calendars.html Hindi INDIA localisation for Gregorian/Julian calendars for jQuery. Written by Pawan Kumar Singh. */ var main = require('../main'); var _gregorian = main.calendars.gregorian; var _julian = main.calendars.julian; _gregorian.prototype.regionalOptions['hi-IN'] = { name: 'Gregorian', epochs: ['BCE', 'CE'], monthNames: ['जनवरी',' फरवरी', 'मार्च', 'अप्रैल', 'मई', 'जून','जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'], monthNamesShort: ['जन', 'फर', 'मार्च','अप्रै', 'मई', 'जून','जुलाई', 'अग', 'सित', 'अक्टू', 'नव', 'दिस'], dayNames: ['रविवार', 'सोमवार', 'मंगलवार', 'बुधवार', 'गुरुवार', 'शुक्रवार', 'शनिवार'], dayNamesShort: ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरु', 'शुक्र', 'शनि'], dayNamesMin: ['र','सो','मं','बु','गु','शु','श'], digits: null, dateFormat: 'dd/mm/yyyy', firstDay: 1, isRTL: false }; if (_julian) { _julian.prototype.regionalOptions['hi-IN'] = _gregorian.prototype.regionalOptions['hi-IN']; }
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow * @format */ import React, {Component} from 'react'; import Link from 'gatsby-link'; import {Icon} from 'antd'; import './Footer.css'; import FacebookOSSLogo from './FacebookOSSLogo'; export default class Footer extends Component<{}> { render() { return ( <div className="Footer"> <a href="https://code.facebook.com/projects/" className="logoOSS"> <FacebookOSSLogo /> Facebook Open Source </a> <div className="SocialNetwork"> <a href="https://github.com/facebook/yoga">GitHub</a> <a href="https://twitter.com/yogalayout">Twitter</a> </div> </div> ); } }
"aaaaaaaaaa,aaaaaaaaaaaaaaa".replace(/^(a+)\1*,\1+$/,"$1")
// ========================================================================== // Project: SproutCore - JavaScript Application Framework // Copyright: ©2006-2011 Strobe Inc. and contributors. // Portions ©2008-2011 Apple Inc. All rights reserved. // License: Licensed under MIT license (see license.js) // ==========================================================================
/* ########################################################################### GLOBAL ASSETS RELEASE v6.0.2 BUILD DATE: 20100224 ########################################################################### */ // init values hele = new Array(); newspause = 4; // time to pause news items in seconds fx = op = ni = 0; tp = ns = 1; nop = .1; nextf = -1; mout = "mout"; done = false; newspause = newspause * 1000; function featurefade(selectedf){ if (is.docom){ if (done){ done = false; if (selectedf != 0){ hele['subhover'+selectedf].style.visibility = "visible"; hele['mout'].style.visibility = "visible"; if (fx != 0){ hele['feature'+fx].style.zIndex = 10; hele['subhover'+fx].style.visibility = "hidden"; } hele['feature'+selectedf].style.zIndex = 20; hele['feature'+selectedf].style.visibility = "visible"; fc = fx; fx = selectedf; setTimeout('fadein();',1); }else{ hele['mout'].style.visibility = "hidden"; hele['subhover'+fx].style.visibility = "hidden"; fc = fx; fx = selectedf; op = 1; setTimeout('fadeout();',1); } }else{ nextf = selectedf; } } } function fadein(){ if (!is.op && !is.iemac && !is.oldmoz){ setopacity('feature'+fx,.99); }else{ setopacity('feature'+fx,1); } if (fc != 0){ hele['feature'+fc].style.visibility = "hidden"; } op = 0; done = true; if (nextf != -1){ featurefade(nextf); nextf = -1; } } function fadeout(){ if (!is.op && !is.iemac && !is.oldmoz){ op = op - .5; if (op <= 0){ op = 0; hele['feature'+fc].style.visibility = "hidden"; setopacity('feature'+fc,.99); done = true; }else{ setopacity('feature'+fc,op); setTimeout('fadeout();',50); } }else{ hele['feature'+fc].style.visibility = "hidden"; done = true; } } function fadenews(){ if (nop == .1){ nx = ns + 1; if(nx > tp){ nx = 1; } if (!is.safari && !is.oldmoz && !is.ns6 && !is.iemac){ setopacity('newsitem'+nx,.1); }else{ var nn = 1; while (hele['newsitem'+nn]){ if (nn != nx){ hele['newsitem'+nn].style.visibility = "hidden"; }else{ if (!is.oldmoz){ setopacity('newsitem'+nn,.99); } hele['newsitem'+nn].style.visibility = "visible"; } nn++; } } hele['newsitem'+nx].style.visibility = "visible"; hele['newsitem'+ns].style.zIndex = 3; hele['newsitem'+nx].style.zIndex = 5; } if (!is.safari && !is.oldmoz && !is.ns6){ nop = nop + .2; if (nop >= .99){ nop = .1; hele['newsitem'+ns].style.visibility = "hidden"; setopacity('newsitem'+ns,.99); ns++; if(ns > tp){ ns = 1; } setTimeout('fadenews();',newspause); }else{ setopacity('newsitem'+nx,nop); setTimeout('fadenews();',130); } }else{ ns++; if(ns > tp){ ns = 1; } setTimeout('fadenews();',newspause); } } function setopacity(cobj,opac){ if (document.all && !is.op && !is.iemac){ //ie hele[cobj].filters.alpha.opacity = opac * 100; }else{ hele[cobj].style.MozOpacity = opac; hele[cobj].style.opacity = opac; } } var rollNames=["",""]; function prephome(){ if (is.docom && !hele['newsitem1']){ while (document.getElementById('newsitem'+tp)){ hele['newsitem'+tp] = document.getElementById('newsitem'+tp); hele['newsitem'+tp].style.left='10px'; if (is.oldmoz){ setopacity('newsitem'+tp,1); hele['newsitem'+tp].style.visibility = "hidden"; } if (is.iewin){ hele['newsitem'+tp].style.backgroundImage = 'url(/im/bg_home_b3_iewin.gif)'; } if (tp == 1){ hele['newsitem1'].style.zIndex = 3; } if (is.oldmoz && tp == 1){ hele['newsitem'+tp].style.visibility = "visible"; } tp++; } tp--; // get names for omniture if(rollNames[0] == "" && document.getElementById('ipfeature')){ rollNames[0] = document.getElementById('ipfeature').src.replace(/.*\/b1_([^\/.]+_d).jpg/,"$1");; rollNames[1] = document.getElementById('ipsub1').src.replace(/.*\/b1_([^\/.]+)_p1.gif/,"$1_s");; rollNames[2] = document.getElementById('ipsub2').src.replace(/.*\/b1_([^\/.]+)_p2.gif/,"$1_s");; rollNames[3] = document.getElementById('ipsub3').src.replace(/.*\/b1_([^\/.]+)_p3.gif/,"$1_s");; } var sf = 1; while (document.getElementById('subhover'+sf)){ hele['subhover'+sf] = document.getElementById('subhover'+sf); hele['feature'+sf] = document.getElementById('feature'+sf); if (!is.op && !is.iemac && !is.oldmoz){ setopacity('feature'+sf,1); } sf++; } hele['mout'] = document.getElementById('mout'); if (tp > 0){ setTimeout('fadenews();',newspause); } } // for old code with new page if (!document.getElementById('mtopics')){ movin(); } } // omniture code function customlink(thisfeature) { if(window.s_account){ s_linkType='o'; s_linkName=thisfeature; s_lnk=s_co(this); s_gs(s_account); } } // legacy function var rollCount=[0,0,0,0]; function sendRollData() {}
import * as chai from 'chai'; const expect = chai.expect; const chaiAsPromised = require('chai-as-promised'); import * as sinon from 'sinon'; import * as sinonAsPromised from 'sinon-as-promised'; import { ClickReport } from '../src/models/click_report'; chai.use(chaiAsPromised); describe('ClickReport', () => { const tableName = 'ClickReports-table'; const campaignId = 'thatCampaignId'; let tNameStub; const clickReportHashKey = 'campaignId'; const clickReportRangeKey = 'timestamp'; before(() => { sinon.stub(ClickReport, '_client').resolves(true); tNameStub = sinon.stub(ClickReport, 'tableName', { get: () => tableName}); }); describe('#get', () => { it('calls the DynamoDB get method with correct params', (done) => { ClickReport.get(campaignId, clickReportRangeKey).then(() => { const args = ClickReport._client.lastCall.args; expect(args[0]).to.equal('get'); expect(args[1]).to.have.deep.property(`Key.${clickReportHashKey}`, campaignId); expect(args[1]).to.have.deep.property(`Key.${clickReportRangeKey}`, clickReportRangeKey); expect(args[1]).to.have.property('TableName', tableName); done(); }); }); }); describe('#hashKey', () => { it('returns the hash key name', () => { expect(ClickReport.hashKey).to.equal(clickReportHashKey); }); }); describe('#rangeKey', () => { it('returns the range key name', () => { expect(ClickReport.rangeKey).to.equal(clickReportRangeKey); }); }); after(() => { ClickReport._client.restore(); tNameStub.restore(); }); });
'use strict'; // // Data-forge enumerator for iterating a standard JavaScript array. // var TakeIterator = function (iterator, takeAmount) { var self = this; self._iterator = iterator; self._takeAmount = takeAmount; }; module.exports = TakeIterator; TakeIterator.prototype.moveNext = function () { var self = this; if (--self._takeAmount >= 0) { return self._iterator.moveNext(); } return false; }; TakeIterator.prototype.getCurrent = function () { var self = this; return self._iterator.getCurrent(); };
define([], function() { /** * A specialized version of `_.map` for arrays without support for callback * shorthands or `this` binding. * * @private * @param {Array} array The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function arrayMap(array, iteratee) { var index = -1, length = array.length, result = Array(length); while (++index < length) { result[index] = iteratee(array[index], index, array); } return result; } return arrayMap; });
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ /* SHA-1 implementation in JavaScript (c) Chris Veness 2002-2014 / MIT Licence */ /* */ /* - see http://csrc.nist.gov/groups/ST/toolkit/secure_hashing.html */ /* http://csrc.nist.gov/groups/ST/toolkit/examples.html */ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ /* jshint node:true *//* global define, escape, unescape */ 'use strict'; /** * SHA-1 hash function reference implementation. * * @namespace */ var Sha1 = {}; /** * Generates SHA-1 hash of string. * * @param {string} msg - (Unicode) string to be hashed. * @returns {string} Hash of msg as hex character string. */ Sha1.hash = function(msg) { // convert string to UTF-8, as SHA only deals with byte-streams msg = msg.utf8Encode(); // constants [§4.2.1] var K = [ 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6 ]; // PREPROCESSING msg += String.fromCharCode(0x80); // add trailing '1' bit (+ 0's padding) to string [§5.1.1] // convert string msg into 512-bit/16-integer blocks arrays of ints [§5.2.1] var l = msg.length/4 + 2; // length (in 32-bit integers) of msg + ‘1’ + appended length var N = Math.ceil(l/16); // number of 16-integer-blocks required to hold 'l' ints var M = new Array(N); for (var i=0; i<N; i++) { M[i] = new Array(16); for (var j=0; j<16; j++) { // encode 4 chars per integer, big-endian encoding M[i][j] = (msg.charCodeAt(i*64+j*4)<<24) | (msg.charCodeAt(i*64+j*4+1)<<16) | (msg.charCodeAt(i*64+j*4+2)<<8) | (msg.charCodeAt(i*64+j*4+3)); } // note running off the end of msg is ok 'cos bitwise ops on NaN return 0 } // add length (in bits) into final pair of 32-bit integers (big-endian) [§5.1.1] // note: most significant word would be (len-1)*8 >>> 32, but since JS converts // bitwise-op args to 32 bits, we need to simulate this by arithmetic operators M[N-1][14] = ((msg.length-1)*8) / Math.pow(2, 32); M[N-1][14] = Math.floor(M[N-1][14]); M[N-1][15] = ((msg.length-1)*8) & 0xffffffff; // set initial hash value [§5.3.1] var H0 = 0x67452301; var H1 = 0xefcdab89; var H2 = 0x98badcfe; var H3 = 0x10325476; var H4 = 0xc3d2e1f0; // HASH COMPUTATION [§6.1.2] var W = new Array(80); var a, b, c, d, e; for (var i=0; i<N; i++) { // 1 - prepare message schedule 'W' for (var t=0; t<16; t++) W[t] = M[i][t]; for (var t=16; t<80; t++) W[t] = Sha1.ROTL(W[t-3] ^ W[t-8] ^ W[t-14] ^ W[t-16], 1); // 2 - initialise five working variables a, b, c, d, e with previous hash value a = H0; b = H1; c = H2; d = H3; e = H4; // 3 - main loop for (var t=0; t<80; t++) { var s = Math.floor(t/20); // seq for blocks of 'f' functions and 'K' constants var T = (Sha1.ROTL(a,5) + Sha1.f(s,b,c,d) + e + K[s] + W[t]) & 0xffffffff; e = d; d = c; c = Sha1.ROTL(b, 30); b = a; a = T; } // 4 - compute the new intermediate hash value (note 'addition modulo 2^32') H0 = (H0+a) & 0xffffffff; H1 = (H1+b) & 0xffffffff; H2 = (H2+c) & 0xffffffff; H3 = (H3+d) & 0xffffffff; H4 = (H4+e) & 0xffffffff; } return Sha1.toHexStr(H0) + Sha1.toHexStr(H1) + Sha1.toHexStr(H2) + Sha1.toHexStr(H3) + Sha1.toHexStr(H4); }; /** * Function 'f' [§4.1.1]. * @private */ Sha1.f = function(s, x, y, z) { switch (s) { case 0: return (x & y) ^ (~x & z); // Ch() case 1: return x ^ y ^ z; // Parity() case 2: return (x & y) ^ (x & z) ^ (y & z); // Maj() case 3: return x ^ y ^ z; // Parity() } }; /** * Rotates left (circular left shift) value x by n positions [§3.2.5]. * @private */ Sha1.ROTL = function(x, n) { return (x<<n) | (x>>>(32-n)); }; /** * Hexadecimal representation of a number. * @private */ Sha1.toHexStr = function(n) { // note can't use toString(16) as it is implementation-dependant, // and in IE returns signed numbers when used on full words var s="", v; for (var i=7; i>=0; i--) { v = (n>>>(i*4)) & 0xf; s += v.toString(16); } return s; }; /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ /** Extend String object with method to encode multi-byte string to utf8 * - monsur.hossa.in/2012/07/20/utf-8-in-javascript.html */ if (typeof String.prototype.utf8Encode == 'undefined') { String.prototype.utf8Encode = function() { return unescape( encodeURIComponent( this ) ); }; } /** Extend String object with method to decode utf8 string to multi-byte */ if (typeof String.prototype.utf8Decode == 'undefined') { String.prototype.utf8Decode = function() { try { return decodeURIComponent( escape( this ) ); } catch (e) { return this; // invalid UTF-8? return as-is } }; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ if (typeof module != 'undefined' && module.exports) module.exports = Sha1; // CommonJs export if (typeof define == 'function' && define.amd) define([], function() { return Sha1; }); // AMD
import { cachedData, getCurrentHoverElement, setCurrentHoverElement, addInteractionClass, } from '~/code_navigation/utils'; afterEach(() => { if (cachedData.has('current')) { cachedData.delete('current'); } }); describe('getCurrentHoverElement', () => { it.each` value ${'test'} ${undefined} `('it returns cached current key', ({ value }) => { if (value) { cachedData.set('current', value); } expect(getCurrentHoverElement()).toEqual(value); }); }); describe('setCurrentHoverElement', () => { it('sets cached current key', () => { setCurrentHoverElement('test'); expect(getCurrentHoverElement()).toEqual('test'); }); }); describe('addInteractionClass', () => { beforeEach(() => { setFixtures( '<div data-path="index.js"><div class="blob-content"><div id="LC1" class="line"><span>console</span><span>.</span><span>log</span></div><div id="LC2" class="line"><span>function</span></div></div></div>', ); }); it.each` line | char | index ${0} | ${0} | ${0} ${0} | ${8} | ${2} ${1} | ${0} | ${0} `( 'it sets code navigation attributes for line $line and character $char', ({ line, char, index }) => { addInteractionClass('index.js', { start_line: line, start_char: char }); expect(document.querySelectorAll(`#LC${line + 1} span`)[index].classList).toContain( 'js-code-navigation', ); }, ); });
const path = require(`path`) exports.chunkNamer = chunk => { if (chunk.name) return chunk.name let n = [] chunk.forEachModule(m => { n.push(path.relative(m.context, m.userRequest)) }) return n.join(`_`) }
var engine = require('../'); var express = require('express'); var path = require('path'); var app = express(); app.engine('dot', engine.__express); app.set('views', path.join(__dirname, './views')); app.set('view engine', 'dot'); app.get('/', function(req, res) { res.render('index', { fromServer: 'Hello from server', }); }); app.get('/layout', function(req, res) { res.render('layout/index'); }); app.get('/cascade', function(req, res) { res.render('cascade/me'); }); app.get('/partial', function(req, res) { res.render('partial/index'); }); app.get('/helper', function(req, res) { // helper as a property engine.helper.myHelperProperty = 'Hello from server property helper'; // helper as a method engine.helper.myHelperMethod = function(param) { return 'Hello from server method helper (parameter: ' + param + ', server model: ' + this.model.fromServer + ')'; } res.render('helper/index', { fromServer: 'Hello from server', }); }); var server = app.listen(2015, function() { console.log('Run the example at http://locahost:%d', server.address().port); });
var EventEmitter = require('events').EventEmitter; var util = require('util'); var WSProcessor = require('./wsprocessor'); var TCPProcessor = require('./tcpprocessor'); var logger = require('pomelo-logger').getLogger('pomelo', __filename); var HTTP_METHODS = [ 'GET', 'POST', 'DELETE', 'PUT', 'HEAD' ]; var ST_STARTED = 1; var ST_CLOSED = 2; var DEFAULT_TIMEOUT = 90; /** * Switcher for tcp and websocket protocol * * @param {Object} server tcp server instance from node.js net module */ var Switcher = function(server, opts) { EventEmitter.call(this); this.server = server; this.wsprocessor = new WSProcessor(); this.tcpprocessor = new TCPProcessor(opts.closeMethod); this.id = 1; this.timers = {}; this.timeout = opts.timeout || DEFAULT_TIMEOUT; this.setNoDelay = opts.setNoDelay; this.server.on('connection', this.newSocket.bind(this)); this.wsprocessor.on('connection', this.emit.bind(this, 'connection')); this.tcpprocessor.on('connection', this.emit.bind(this, 'connection')); this.state = ST_STARTED; }; util.inherits(Switcher, EventEmitter); module.exports = Switcher; Switcher.prototype.newSocket = function(socket) { if(this.state !== ST_STARTED) { return; } // if set connection timeout if(!!this.timeout) { var timer = setTimeout(function() { logger.warn('connection is timeout without communication, the remote ip is %s && port is %s', socket.remoteAddress, socket.remotePort); socket.destroy(); }, this.timeout * 1000); this.timers[this.id] = timer; socket.id = this.id++; } var self = this; socket.once('close', function() { if (!!socket.id) { clearTimeout(self.timers[socket.id]); delete self.timers[socket.id]; } }); socket.once('data', function(data) { if(!!socket.id) { clearTimeout(self.timers[socket.id]); delete self.timers[socket.id]; } if(isHttp(data)) { processHttp(self, self.wsprocessor, socket, data); } else { if(!!self.setNoDelay) { socket.setNoDelay(true); } processTcp(self, self.tcpprocessor, socket, data); } }); }; Switcher.prototype.close = function() { if(this.state !== ST_STARTED) { return; } this.state = ST_CLOSED; this.wsprocessor.close(); this.tcpprocessor.close(); }; var isHttp = function(data) { var head = data.toString('utf8', 0, 4); for(var i=0, l=HTTP_METHODS.length; i<l; i++) { if(head.indexOf(HTTP_METHODS[i]) === 0) { return true; } } return false; }; var processHttp = function(switcher, processor, socket, data) { processor.add(socket, data); }; var processTcp = function(switcher, processor, socket, data) { processor.add(socket, data); };
'use strict'; var app = angular.module('myApp.payloads.directives', []); app.directive('runPayload', ['Payload', 'Command', '$routeParams', 'showToast', 'showErrors', 'gettextCatalog', function(Payload, Command, $routeParams, showToast, showErrors, gettextCatalog) { var link = function( scope, element, attrs ) { scope.location = { slug: $routeParams.id }; var box = { slug: $routeParams.box_id }; var loadCommands = function() { Command.query().$promise.then(function(results) { scope.commands = results; scope.loading_commands = undefined; }); }; scope.runCommand = function() { scope.processing = true; updateCT(); }; var updateCT = function() { var cmd = scope.command.selected; scope.command.selected = undefined; Payload.create({}, { location_id: scope.location.slug, box_id: box.slug, payload: { box_ids: box.slug, command_id: cmd, save: true } }).$promise.then(function() { showToast(gettextCatalog.getString('Payload running, please wait.')); }, function(errors) { showErrors(errors); }); }; loadCommands(); }; return { link: link, scope: { command: '=', allowed: '@' }, templateUrl: 'components/payloads/_run_payload.html', }; }]);
define([ 'gui/GuiTR' ], function (TR) { 'use strict'; var GuiConfig = function (guiParent, ctrlGui) { this._ctrlGui = ctrlGui; this._menu = null; // ui menu this.init(guiParent); }; GuiConfig.prototype = { /** Initialize */ init: function (guiParent) { // config stuffs this._langs = Object.keys(TR.languages); this._menu = guiParent.addMenu('Language'); this._menu.addCombobox('', this._langs.indexOf(TR.select), this.onLangChange.bind(this), this._langs); }, onLangChange: function (value) { TR.select = this._langs[parseInt(value, 10)]; this._ctrlGui.initGui(); } }; return GuiConfig; });
import React, { memo } from 'react'; import SideBarItemTemplateWithData from '../RoomList/SideBarItemTemplateWithData'; import UserItem from './UserItem'; const Row = ({ item, data }) => { const { t, SideBarItemTemplate, avatarTemplate: AvatarTemplate, useRealName, extended } = data; if (item.t === 'd' && !item.u) { return ( <UserItem id={`search-${item._id}`} useRealName={useRealName} t={t} item={item} SideBarItemTemplate={SideBarItemTemplate} AvatarTemplate={AvatarTemplate} /> ); } return ( <SideBarItemTemplateWithData id={`search-${item._id}`} tabIndex={-1} extended={extended} t={t} room={item} SideBarItemTemplate={SideBarItemTemplate} AvatarTemplate={AvatarTemplate} /> ); }; export default memo(Row);
module.exports = { visionKey: 'AIzaSyAA14j-7sIJLDTRZd3bYpZrmCEoFA9IN40', pairingID: 'b5378ca6', pairingKey: '690be2968f8f08b26fcc1f2c9c8f5b90', recipesKey: 'qAjqbB5sPamshJwWJJh01Y3exb3Jp1wBzcOjsnrqegcRf1PCXT', backUpRecipesKey: 'jHbWfZqPEUmsh0NElMAPdMXlfPm1p1M9n5NjsnPD1l0Vjhsjng' }
'use strict'; /** * Module dependencies. */ var init = require('./config/init')(), config = require('./config/config'), mongoose = require('mongoose'), chalk = require('chalk'); /** * Main application entry file. * Please note that the order of loading is important. */ // Bootstrap db connection var db = mongoose.connect(config.db, function(err) { if (err) { console.error(chalk.red('Could not connect to MongoDB!')); console.log(chalk.red(err)); } }); // Init the express application var app = require('./config/express')(db); // Bootstrap passport config require('./config/passport')(); // Start the app by listening on <port> app.listen(config.port); // Expose app exports = module.exports = app; // Logging initialization console.log('MEAN.JS application started on port ' + config.port); //Initialize add-on plugin
/** * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. * For licensing, see https://ckeditor.com/legal/ckeditor-oss-license */ CKEDITOR.editorConfig = function( config ) { // Define changes to default configuration here. // For complete reference see: // https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html // The toolbar groups arrangement, optimized for a single toolbar row. config.toolbarGroups = [ { name: 'document', groups: [ 'mode', 'document', 'doctools' ] }, { name: 'clipboard', groups: [ 'clipboard', 'undo' ] }, { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] }, { name: 'forms' }, { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] }, { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] }, { name: 'links' }, { name: 'insert' }, { name: 'styles' }, { name: 'colors' }, { name: 'tools' }, { name: 'others' }, { name: 'about' } ]; // The default plugins included in the basic setup define some buttons that // are not needed in a basic editor. They are removed here. config.removeButtons = 'Cut,Copy,Paste,Undo,Redo,Anchor,Underline,Strike,Subscript,Superscript'; // Dialog windows are also simplified. config.removeDialogTabs = 'link:advanced'; };
'use strict'; if (mejs.i18n.ca !== undefined) { //mejs.i18n.en["mejs.frame-rate"] = "Media frame rate (select according to your video source)"; //mejs.i18n.en["mejs.step-fwd"] = "Step forward"; //mejs.i18n.en["mejs.step-back"] = "Step back"; } if (mejs.i18n.cs !== undefined) { //mejs.i18n.en["mejs.frame-rate"] = "Media frame rate (select according to your video source)"; //mejs.i18n.en["mejs.step-fwd"] = "Step forward"; //mejs.i18n.en["mejs.step-back"] = "Step back"; } if (mejs.i18n.de !== undefined) { //mejs.i18n.en["mejs.frame-rate"] = "Media frame rate (select according to your video source)"; //mejs.i18n.en["mejs.step-fwd"] = "Step forward"; //mejs.i18n.en["mejs.step-back"] = "Step back"; } if (mejs.i18n.es !== undefined) { //mejs.i18n.en["mejs.frame-rate"] = "Media frame rate (select according to your video source)"; //mejs.i18n.en["mejs.step-fwd"] = "Step forward"; //mejs.i18n.en["mejs.step-back"] = "Step back"; } if (mejs.i18n.fr !== undefined) { //mejs.i18n.en["mejs.frame-rate"] = "Media frame rate (select according to your video source)"; //mejs.i18n.en["mejs.step-fwd"] = "Step forward"; //mejs.i18n.en["mejs.step-back"] = "Step back"; } if (mejs.i18n.hr !== undefined) { //mejs.i18n.en["mejs.frame-rate"] = "Media frame rate (select according to your video source)"; //mejs.i18n.en["mejs.step-fwd"] = "Step forward"; //mejs.i18n.en["mejs.step-back"] = "Step back"; } if (mejs.i18n.hu !== undefined) { //mejs.i18n.en["mejs.frame-rate"] = "Media frame rate (select according to your video source)"; //mejs.i18n.en["mejs.step-fwd"] = "Step forward"; //mejs.i18n.en["mejs.step-back"] = "Step back"; } if (mejs.i18n.it !== undefined) { //mejs.i18n.en["mejs.frame-rate"] = "Media frame rate (select according to your video source)"; //mejs.i18n.en["mejs.step-fwd"] = "Step forward"; //mejs.i18n.en["mejs.step-back"] = "Step back"; } if (mejs.i18n.ja !== undefined) { //mejs.i18n.en["mejs.frame-rate"] = "Media frame rate (select according to your video source)"; //mejs.i18n.en["mejs.step-fwd"] = "Step forward"; //mejs.i18n.en["mejs.step-back"] = "Step back"; } if (mejs.i18n.ko !== undefined) { //mejs.i18n.en["mejs.frame-rate"] = "Media frame rate (select according to your video source)"; //mejs.i18n.en["mejs.step-fwd"] = "Step forward"; //mejs.i18n.en["mejs.step-back"] = "Step back"; } if (mejs.i18n.nl !== undefined) { //mejs.i18n.en["mejs.frame-rate"] = "Media frame rate (select according to your video source)"; //mejs.i18n.en["mejs.step-fwd"] = "Step forward"; //mejs.i18n.en["mejs.step-back"] = "Step back"; } if (mejs.i18n.pl !== undefined) { //mejs.i18n.en["mejs.frame-rate"] = "Media frame rate (select according to your video source)"; //mejs.i18n.en["mejs.step-fwd"] = "Step forward"; //mejs.i18n.en["mejs.step-back"] = "Step back"; } if (mejs.i18n.pt !== undefined) { //mejs.i18n.en["mejs.frame-rate"] = "Media frame rate (select according to your video source)"; //mejs.i18n.en["mejs.step-fwd"] = "Step forward"; //mejs.i18n.en["mejs.step-back"] = "Step back"; } if (mejs.i18n['pt-BR'] !== undefined) { //mejs.i18n.en["mejs.frame-rate"] = "Media frame rate (select according to your video source)"; //mejs.i18n.en["mejs.step-fwd"] = "Step forward"; //mejs.i18n.en["mejs.step-back"] = "Step back"; } if (mejs.i18n.ro !== undefined) { //mejs.i18n.en["mejs.frame-rate"] = "Media frame rate (select according to your video source)"; //mejs.i18n.en["mejs.step-fwd"] = "Step forward"; //mejs.i18n.en["mejs.step-back"] = "Step back"; } if (mejs.i18n.ru !== undefined) { //mejs.i18n.en["mejs.frame-rate"] = "Media frame rate (select according to your video source)"; //mejs.i18n.en["mejs.step-fwd"] = "Step forward"; //mejs.i18n.en["mejs.step-back"] = "Step back"; } if (mejs.i18n.sk !== undefined) { //mejs.i18n.en["mejs.frame-rate"] = "Media frame rate (select according to your video source)"; //mejs.i18n.en["mejs.step-fwd"] = "Step forward"; //mejs.i18n.en["mejs.step-back"] = "Step back"; } if (mejs.i18n.sv !== undefined) { //mejs.i18n.en["mejs.frame-rate"] = "Media frame rate (select according to your video source)"; //mejs.i18n.en["mejs.step-fwd"] = "Step forward"; //mejs.i18n.en["mejs.step-back"] = "Step back"; } if (mejs.i18n.uk !== undefined) { //mejs.i18n.en["mejs.frame-rate"] = "Media frame rate (select according to your video source)"; //mejs.i18n.en["mejs.step-fwd"] = "Step forward"; //mejs.i18n.en["mejs.step-back"] = "Step back"; } if (mejs.i18n.zh !== undefined) { //mejs.i18n.en["mejs.frame-rate"] = "Media frame rate (select according to your video source)"; //mejs.i18n.en["mejs.step-fwd"] = "Step forward"; //mejs.i18n.en["mejs.step-back"] = "Step back"; } if (mejs.i18n['zh-CN'] !== undefined) { //mejs.i18n.en["mejs.frame-rate"] = "Media frame rate (select according to your video source)"; //mejs.i18n.en["mejs.step-fwd"] = "Step forward"; //mejs.i18n.en["mejs.step-back"] = "Step back"; }