text
stringlengths
2
6.14k
/** @module ember @submodule ember-runtime */ import Ember from 'ember-metal/core'; import { Mixin } from 'ember-metal/mixin'; import { get } from 'ember-metal/property_get'; import { deprecateProperty } from 'ember-metal/deprecate_property'; /** `Ember.ActionHandler` is available on some familiar classes including `Ember.Route`, `Ember.View`, `Ember.Component`, and `Ember.Controller`. (Internally the mixin is used by `Ember.CoreView`, `Ember.ControllerMixin`, and `Ember.Route` and available to the above classes through inheritance.) @class ActionHandler @namespace Ember @private */ var ActionHandler = Mixin.create({ mergedProperties: ['actions'], /** The collection of functions, keyed by name, available on this `ActionHandler` as action targets. These functions will be invoked when a matching `{{action}}` is triggered from within a template and the application's current route is this route. Actions can also be invoked from other parts of your application via `ActionHandler#send`. The `actions` hash will inherit action handlers from the `actions` hash defined on extended parent classes or mixins rather than just replace the entire hash, e.g.: ```js App.CanDisplayBanner = Ember.Mixin.create({ actions: { displayBanner: function(msg) { // ... } } }); App.WelcomeRoute = Ember.Route.extend(App.CanDisplayBanner, { actions: { playMusic: function() { // ... } } }); // `WelcomeRoute`, when active, will be able to respond // to both actions, since the actions hash is merged rather // then replaced when extending mixins / parent classes. this.send('displayBanner'); this.send('playMusic'); ``` Within a Controller, Route, View or Component's action handler, the value of the `this` context is the Controller, Route, View or Component object: ```js App.SongRoute = Ember.Route.extend({ actions: { myAction: function() { this.controllerFor("song"); this.transitionTo("other.route"); ... } } }); ``` It is also possible to call `this._super.apply(this, arguments)` from within an action handler if it overrides a handler defined on a parent class or mixin: Take for example the following routes: ```js App.DebugRoute = Ember.Mixin.create({ actions: { debugRouteInformation: function() { console.debug("trololo"); } } }); App.AnnoyingDebugRoute = Ember.Route.extend(App.DebugRoute, { actions: { debugRouteInformation: function() { // also call the debugRouteInformation of mixed in App.DebugRoute this._super.apply(this, arguments); // show additional annoyance window.alert(...); } } }); ``` ## Bubbling By default, an action will stop bubbling once a handler defined on the `actions` hash handles it. To continue bubbling the action, you must return `true` from the handler: ```js App.Router.map(function() { this.route("album", function() { this.route("song"); }); }); App.AlbumRoute = Ember.Route.extend({ actions: { startPlaying: function() { } } }); App.AlbumSongRoute = Ember.Route.extend({ actions: { startPlaying: function() { // ... if (actionShouldAlsoBeTriggeredOnParentRoute) { return true; } } } }); ``` @property actions @type Object @default null @public */ /** Triggers a named action on the `ActionHandler`. Any parameters supplied after the `actionName` string will be passed as arguments to the action target function. If the `ActionHandler` has its `target` property set, actions may bubble to the `target`. Bubbling happens when an `actionName` can not be found in the `ActionHandler`'s `actions` hash or if the action target function returns `true`. Example ```js App.WelcomeRoute = Ember.Route.extend({ actions: { playTheme: function() { this.send('playMusic', 'theme.mp3'); }, playMusic: function(track) { // ... } } }); ``` @method send @param {String} actionName The action to trigger @param {*} context a context to send with the action @public */ send(actionName, ...args) { var target; if (this.actions && this.actions[actionName]) { var shouldBubble = this.actions[actionName].apply(this, args) === true; if (!shouldBubble) { return; } } if (target = get(this, 'target')) { Ember.assert('The `target` for ' + this + ' (' + target + ') does not have a `send` method', typeof target.send === 'function'); target.send(...arguments); } } }); export default ActionHandler; export function deprecateUnderscoreActions(factory) { deprecateProperty(factory.prototype, '_actions', 'actions', { id: 'ember-runtime.action-handler-_actions', until: '3.0.0' }); }
"use strict"; // copied from http://www.broofa.com/Tools/Math.uuid.js var CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split(''); exports.uuid = function () { var chars = CHARS, uuid = new Array(36), rnd=0, r; for (var i = 0; i < 36; i++) { if (i==8 || i==13 || i==18 || i==23) { uuid[i] = '-'; } else if (i==14) { uuid[i] = '4'; } else { if (rnd <= 0x02) rnd = 0x2000000 + (Math.random()*0x1000000)|0; r = rnd & 0xf; rnd = rnd >> 4; uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r]; } } return uuid.join(''); }; exports.in_array = function (item, array) { return (array.indexOf(item) != -1); }; exports.sort_keys = function (obj) { return Object.keys(obj).sort(); }; exports.uniq = function (arr) { var out = []; var o = 0; for (var i=0,l=arr.length; i < l; i++) { if (out.length === 0) { out.push(arr[i]); } else if (out[o] != arr[i]) { out.push(arr[i]); o++; } } return out; } exports.ISODate = function (d) { function pad(n) {return n<10 ? '0'+n : n} return d.getUTCFullYear()+'-' + pad(d.getUTCMonth()+1)+'-' + pad(d.getUTCDate())+'T' + pad(d.getUTCHours())+':' + pad(d.getUTCMinutes())+':' + pad(d.getUTCSeconds())+'Z' } var _daynames = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; var _monnames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; function _pad (num, n, p) { var s = '' + num; p = p || '0'; while (s.length < n) s = p + s; return s; } exports.pad = _pad; exports.date_to_str = function (d) { return _daynames[d.getDay()] + ', ' + _pad(d.getDate(),2) + ' ' + _monnames[d.getMonth()] + ' ' + d.getFullYear() + ' ' + _pad(d.getHours(),2) + ':' + _pad(d.getMinutes(),2) + ':' + _pad(d.getSeconds(),2) + ' ' + d.toString().match(/\sGMT([+-]\d+)/)[1]; } exports.decode_qp = function (line) { line = line.replace(/\r\n/g,"\n").replace(/[ \t]+\r?\n/g,"\n"); if (! /=/.test(line)) { // this may be a pointless optimisation... return new Buffer(line); } line = line.replace(/=\n/mg, ''); var buf = new Buffer(line.length); var pos = 0; for (var i=0,l=line.length; i < l; i++) { if (line[i] === '=' && /=[0-9a-fA-F]{2}/.test(line[i] + line[i+1] + line[i+2])) { i++; buf[pos] = parseInt(line[i] + line[i+1], 16); i++; } else { buf[pos] = line.charCodeAt(i); } pos++; } return buf.slice(0, pos); } function _char_to_qp (ch) { return "=" + _pad(ch.charCodeAt(0).toString(16).toUpperCase(), 2); } // Shameless attempt to copy from Perl's MIME::QuotedPrint::Perl code. exports.encode_qp = function (str) { str = str.replace(/([^\ \t\n!"#\$%&'()*+,\-.\/0-9:;<>?\@A-Z\[\\\]^_`a-z{|}~])/g, function (orig, p1) { return _char_to_qp(p1); }).replace(/([ \t]+)$/gm, function (orig, p1) { return p1.split('').map(_char_to_qp).join(''); }); // Now shorten lines to 76 chars, but don't break =XX encodes. // Method: iterate over to char 73. // If char 74, 75 or 76 is = we need to break before the =. // Otherwise break at 76. var cur_length = 0; var out = ''; for (var i=0; i<str.length; i++) { if (str[i] === '\n') { out += '\n'; cur_length = 0; continue; } cur_length++; if (cur_length <= 73) { out += str[i]; } else if (cur_length > 73 && cur_length < 76) { if (str[i] === '=') { out += '=\n='; cur_length = 1; } else { out += str[i]; } } else { // Otherwise got to char 76 // Don't insert '=\n' if end of string or next char is already \n: if ((i === (str.length - 1)) || (str[i+1] === '\n')) { out += str[i]; } else { out += '=\n' + str[i]; cur_length = 1; } } } return out; } var versions = process.version.split('.'), version = Number(versions[0].substring(1)), subversion = Number(versions[1]); exports.existsSync = require((version > 0 || subversion >= 8) ? 'fs' : 'path').existsSync; exports.indexOfLF = function (buf, maxlength) { for (var i=0; i<buf.length; i++) { if (maxlength && (i === maxlength)) break; if (buf[i] === 0x0a) return i; } return -1; }
// Learn more about configuring this file at <https://theintern.github.io/intern/#configuration>. // These default settings work OK for most people. The options that *must* be changed below are the // packages, suites, excludeInstrumentation, and (if you want functional tests) functionalSuites define({ // Default desired capabilities for all environments. Individual capabilities can be overridden by any of the // specified browser environments in the `environments` array below as well. See // <https://theintern.github.io/intern/#option-capabilities> for links to the different capabilities options for // different services. // Maximum number of simultaneous integration tests that should be executed on the remote WebDriver service maxConcurrency: 2, // Non-functional test suite(s) to run in each browser suites: [ 'tests/plugin' ], // A regular expression matching URLs to files that should not be included in code coverage analysis excludeInstrumentation: /^(?:tests|node_modules)\// });
/** * Shopware 4.0 * Copyright © 2012 shopware AG * * According to our dual licensing model, this program can be used either * under the terms of the GNU Affero General Public License, version 3, * or under a proprietary license. * * The texts of the GNU Affero General Public License with an additional * permission and of our proprietary license can be found at and * in the LICENSE file you have received along with this program. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * "Shopware" is a registered trademark of shopware AG. * The licensing of the program under the AGPLv3 does not imply a * trademark license. Therefore any rights, title and interest in * our trademarks remain entirely with us. * * @category Shopware * @package Login * @subpackage Model * @copyright Copyright (c) 2012, shopware AG (http://www.shopware.de) * @version $Id$ * @author shopware AG */ /** * Shopware Backend - ErrorReporter Main Model * * todo@all: Documentation */ Ext.define('Shopware.apps.UserManager.model.Locale', { extend: 'Ext.data.Model', fields: [ 'id', 'name' ] });
var Model; module("Ember.FilteredRecordArray", { setup: function() { Model = Ember.Model.extend({ id: Ember.attr(), name: Ember.attr() }); Model.adapter = Ember.FixtureAdapter.create(); Model.FIXTURES = [ {id: 1, name: 'Erik'}, {id: 2, name: 'Stefan'}, {id: 'abc', name: 'Charles'} ]; }, teardown: function() { } }); test("must be created with a modelClass property", function() { throws(function() { Ember.FilteredRecordArray.create(); }, /FilteredRecordArrays must be created with a modelClass/); }); test("must be created with a filterFunction property", function() { throws(function() { Ember.FilteredRecordArray.create({modelClass: Model}); }, /FilteredRecordArrays must be created with a filterFunction/); }); test("must be created with a filterProperties property", function() { throws(function() { Ember.FilteredRecordArray.create({modelClass: Model, filterFunction: Ember.K}); }, /FilteredRecordArrays must be created with filterProperties/); }); test("with a noop filter will return all the loaded records", function() { expect(1); Model.fetch().then(function() { start(); var recordArray = Ember.FilteredRecordArray.create({ modelClass: Model, filterFunction: Ember.K, filterProperties: [] }); equal(recordArray.get('length'), 3, "There are 3 records"); }); stop(); }); test("with a filter will return only the relevant loaded records", function() { expect(2); Model.fetch().then(function() { start(); var recordArray = Ember.FilteredRecordArray.create({ modelClass: Model, filterFunction: function(record) { return record.get('name') === 'Erik'; }, filterProperties: ['name'] }); equal(recordArray.get('length'), 1, "There is 1 record"); equal(recordArray.get('firstObject.name'), 'Erik', "The record data matches"); }); stop(); }); test("loading a record that doesn't match the filter after creating a FilteredRecordArray shouldn't change the content", function() { expect(2); Model.fetch().then(function() { start(); var recordArray = Ember.FilteredRecordArray.create({ modelClass: Model, filterFunction: function(record) { return record.get('name') === 'Erik'; }, filterProperties: ['name'] }); Model.create({id: 3, name: 'Kris'}).save().then(function(record) { start(); equal(recordArray.get('length'), 1, "There is still 1 record"); equal(recordArray.get('firstObject.name'), 'Erik', "The record data matches"); }); stop(); }); stop(); }); test("loading a record that matches the filter after creating a FilteredRecordArray should update the content of it", function() { expect(3); Model.fetch().then(function() { start(); var recordArray = Ember.FilteredRecordArray.create({ modelClass: Model, filterFunction: function(record) { return record.get('name') === 'Erik' || record.get('name') === 'Kris'; }, filterProperties: ['name'] }); Model.create({id: 3, name: 'Kris'}).save().then(function(record) { start(); equal(recordArray.get('length'), 2, "There are 2 records"); equal(recordArray.get('firstObject.name'), 'Erik', "The record data matches"); equal(recordArray.get('lastObject.name'), 'Kris', "The record data matches"); }); stop(); }); stop(); }); test("changing a property that matches the filter should update the FilteredRecordArray to include it", function() { expect(5); Model.fetch().then(function() { start(); var recordArray = Ember.FilteredRecordArray.create({ modelClass: Model, filterFunction: function(record) { return record.get('name').match(/^E/); }, filterProperties: ['name'] }); equal(recordArray.get('length'), 1, "There is 1 record initially"); equal(recordArray.get('firstObject.name'), 'Erik', "The record data matches"); Model.fetch(2).then(function(record) { start(); record.set('name', 'Estefan'); equal(recordArray.get('length'), 2, "There are 2 records after changing the name"); equal(recordArray.get('firstObject.name'), 'Erik', "The record data matches"); equal(recordArray.get('lastObject.name'), 'Estefan', "The record data matches"); }); stop(); }); stop(); }); test("adding a new record and changing a property that matches the filter should update the FilteredRecordArray to include it", function() { expect(8); Model.fetch().then(function() { start(); var recordArray = Ember.FilteredRecordArray.create({ modelClass: Model, filterFunction: function(record) { return record.get('name').match(/^E/); }, filterProperties: ['name'] }); equal(recordArray.get('length'), 1, "There is 1 record initially"); equal(recordArray.get('firstObject.name'), 'Erik', "The record data matches"); Model.create({id: 3, name: 'Kris'}).save().then(function(record) { start(); record.set('name', 'Ekris'); equal(recordArray.get('length'), 2, "There are 2 records after changing the name"); equal(recordArray.get('firstObject.name'), 'Erik', "The record data matches"); equal(recordArray.get('lastObject.name'), 'Ekris', "The record data matches"); record.set('name', 'Eskil'); equal(recordArray.get('length'), 2, "There are still 2 records after changing the name again"); equal(recordArray.get('firstObject.name'), 'Erik', "The record data still matches"); equal(recordArray.get('lastObject.name'), 'Eskil', "The record data still matches"); }); stop(); }); stop(); });
Ext.define('Ext.rtl.scroll.Indicator', { override: 'Ext.scroll.Indicator', privates: { translateX: function(value) { if (this.getScroller().getRtl()) { value = -value; } this.callParent([value]); } } });
if (typeof process !== "undefined") { require("amd-loader"); require("../../test/setup_paths"); } define(function(require, exports, module) { var assert = require("assert"); var report = require("./linereport_base"); module.exports = { "test parse line" : function(next) { var results = report.parseOutput("1:2: 3"); console.log(results[0]); assert.equal(results[0].pos.sl, 0); assert.equal(results[0].pos.sc, 1); assert.equal(results[0].message, "3"); next(); }, "test parse two lines" : function(next) { var results = report.parseOutput("1:1: line 1\n1:2: line 2"); assert.equal(results.length, 2); next(); }, "test ignore lines" : function(next) { var results = report.parseOutput("1:1: line 1\n1:2: line 2\bmove zig"); assert.equal(results.length, 2); next(); } }; }); if (typeof module !== "undefined" && module === require.main) { require("asyncjs").test.testcase(module.exports).exec(); }
//// [wrappedAndRecursiveConstraints.ts] // no errors expected class C<T extends Date> { constructor(public data: T) { } foo<U extends T>(x: U) { return x; } } interface Foo extends Date { foo: string; } var y: Foo = null; var c = new C(y); var r = c.foo(y); //// [wrappedAndRecursiveConstraints.js] // no errors expected var C = /** @class */ (function () { function C(data) { this.data = data; } C.prototype.foo = function (x) { return x; }; return C; }()); var y = null; var c = new C(y); var r = c.foo(y);
//// [es6ClassTest8.ts] function f1(x:any) {return x;} class C { constructor() { var bar:any = (function() { return bar; // 'bar' should be resolvable }); var b = f1(f1(bar)); } } class Vector { static norm(v:Vector):Vector {return null;} static minus(v1:Vector, v2:Vector):Vector {return null;} static times(v1:Vector, v2:Vector):Vector {return null;} static cross(v1:Vector, v2:Vector):Vector {return null;} constructor(public x: number, public y: number, public z: number) { } static dot(v1:Vector, v2:Vector):Vector {return null;} } class Camera { public forward: Vector; public right: Vector; public up: Vector; constructor(public pos: Vector, lookAt: Vector) { var down = new Vector(0.0, -1.0, 0.0); this.forward = Vector.norm(Vector.minus(lookAt,this.pos)); this.right = Vector.times(down, Vector.norm(Vector.cross(this.forward, down))); this.up = Vector.times(down, Vector.norm(Vector.cross(this.forward, this.right))); } } //// [es6ClassTest8.js] function f1(x) { return x; } var C = /** @class */ (function () { function C() { var bar = (function () { return bar; // 'bar' should be resolvable }); var b = f1(f1(bar)); } return C; }()); var Vector = /** @class */ (function () { function Vector(x, y, z) { this.x = x; this.y = y; this.z = z; } Vector.norm = function (v) { return null; }; Vector.minus = function (v1, v2) { return null; }; Vector.times = function (v1, v2) { return null; }; Vector.cross = function (v1, v2) { return null; }; Vector.dot = function (v1, v2) { return null; }; return Vector; }()); var Camera = /** @class */ (function () { function Camera(pos, lookAt) { this.pos = pos; var down = new Vector(0.0, -1.0, 0.0); this.forward = Vector.norm(Vector.minus(lookAt, this.pos)); this.right = Vector.times(down, Vector.norm(Vector.cross(this.forward, down))); this.up = Vector.times(down, Vector.norm(Vector.cross(this.forward, this.right))); } return Camera; }());
var fs = require('fs') , child_process = require('child_process') , _glob = require('glob') , bunch = require('./bunch') ; exports.loadEnv = function loadEnv(env, cb) { var loaders = [] function load(name, cb) { fs.readFile(env[name], function(error, data) { env[name] = env[name].match(/.*\.json$/) ? JSON.parse(data) : data; cb(error, data) }) } for (var name in env) { loaders.push([load, name]) } bunch(loaders, cb) } exports.commandActor = function command(executable) { return function command(args, opts, cb) { if (!cb) { cb = opts; opts = {} } var cmd = child_process.spawn(executable, args, opts); function log(b) { console.log(b.toString()) } cmd.stdout.on('data', log); cmd.stderr.on('data', log); cmd.on('exit', function(code) { if (code) { cb(new Error(executable + ' exited with status ' + code)); } else { cb(); } }); return cmd; } } exports.jsonParse = function(str, cb) { try { cb(null, JSON.parse(str)); } catch (ex) { cb(ex); } } exports.jsonStringify = function(obj, cb) { try { cb(null, JSON.stringify(obj)); } catch (ex) { cb(ex); } } exports.glob = function glob(pattern, cb) { console.log('pattern', pattern); _glob(pattern, function(error, files) { cb(error, [files]); }); }
Function.prototype.bind = Function.prototype.bind || function (target) { var self = this; return function (args) { if (!(args instanceof Array)) { args = [args]; } self.apply(target, args); }; };
// DATA_TEMPLATE: js_data oTest.fnStart( "oLanguage.oPaginate" ); /* Note that the paging language information only has relevence in full numbers */ $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "aaData": gaaData, "sPaginationType": "full_numbers" } ); var oSettings = oTable.fnSettings(); oTest.fnTest( "oLanguage.oPaginate defaults", null, function () { var bReturn = oSettings.oLanguage.oPaginate.sFirst == "First" && oSettings.oLanguage.oPaginate.sPrevious == "Previous" && oSettings.oLanguage.oPaginate.sNext == "Next" && oSettings.oLanguage.oPaginate.sLast == "Last"; return bReturn; } ); oTest.fnTest( "oLanguage.oPaginate defaults are in the DOM", null, function () { var bReturn = $('#example_paginate .first').html() == "First" && $('#example_paginate .previous').html() == "Previous" && $('#example_paginate .next').html() == "Next" && $('#example_paginate .last').html() == "Last"; return bReturn; } ); oTest.fnTest( "oLanguage.oPaginate can be defined", function () { oSession.fnRestore(); oTable = $('#example').dataTable( { "aaData": gaaData, "sPaginationType": "full_numbers", "oLanguage": { "oPaginate": { "sFirst": "unit1", "sPrevious": "test2", "sNext": "unit3", "sLast": "test4" } } } ); oSettings = oTable.fnSettings(); }, function () { var bReturn = oSettings.oLanguage.oPaginate.sFirst == "unit1" && oSettings.oLanguage.oPaginate.sPrevious == "test2" && oSettings.oLanguage.oPaginate.sNext == "unit3" && oSettings.oLanguage.oPaginate.sLast == "test4"; return bReturn; } ); oTest.fnTest( "oLanguage.oPaginate definitions are in the DOM", null, function () { var bReturn = $('#example_paginate .first').html() == "unit1" && $('#example_paginate .previous').html() == "test2" && $('#example_paginate .next').html() == "unit3" && $('#example_paginate .last').html() == "test4"; return bReturn; } ); oTest.fnComplete(); } );
/** * Notification.js * * Released under LGPL License. * Copyright (c) 1999-2015 Ephox Corp. All rights reserved * * License: http://www.tinymce.com/license * Contributing: http://www.tinymce.com/contributing */ /** * Creates a notification instance. * * @-x-less Notification.less * @class tinymce.ui.Notification * @extends tinymce.ui.Container * @mixes tinymce.ui.Movable */ define("tinymce/ui/Notification", [ "tinymce/ui/Control", "tinymce/ui/Movable", "tinymce/ui/Progress", "tinymce/util/Delay" ], function(Control, Movable, Progress, Delay) { return Control.extend({ Mixins: [Movable], Defaults: { classes: 'widget notification' }, init: function(settings) { var self = this; self._super(settings); if (settings.text) { self.text(settings.text); } if (settings.icon) { self.icon = settings.icon; } if (settings.color) { self.color = settings.color; } if (settings.type) { self.classes.add('notification-' + settings.type); } if (settings.timeout && (settings.timeout < 0 || settings.timeout > 0) && !settings.closeButton) { self.closeButton = false; } else { self.classes.add('has-close'); self.closeButton = true; } if (settings.progressBar) { self.progressBar = new Progress(); } self.on('click', function(e) { if (e.target.className.indexOf(self.classPrefix + 'close') != -1) { self.close(); } }); }, /** * Renders the control as a HTML string. * * @method renderHtml * @return {String} HTML representing the control. */ renderHtml: function() { var self = this, prefix = self.classPrefix, icon = '', closeButton = '', progressBar = '', notificationStyle = ''; if (self.icon) { icon = '<i class="' + prefix + 'ico' + ' ' + prefix + 'i-' + self.icon + '"></i>'; } if (self.color) { notificationStyle = ' style="background-color: ' + self.color + '"'; } if (self.closeButton) { closeButton = '<button type="button" class="' + prefix + 'close" aria-hidden="true">\u00d7</button>'; } if (self.progressBar) { progressBar = self.progressBar.renderHtml(); } return ( '<div id="' + self._id + '" class="' + self.classes + '"' + notificationStyle + ' role="presentation">' + icon + '<div class="' + prefix + 'notification-inner">' + self.state.get('text') + '</div>' + progressBar + closeButton + '</div>' ); }, postRender: function() { var self = this; Delay.setTimeout(function() { self.$el.addClass(self.classPrefix + 'in'); }); return self._super(); }, bindStates: function() { var self = this; self.state.on('change:text', function(e) { self.getEl().childNodes[1].innerHTML = e.value; }); if (self.progressBar) { self.progressBar.bindStates(); } return self._super(); }, close: function() { var self = this; if (!self.fire('close').isDefaultPrevented()) { self.remove(); } return self; }, /** * Repaints the control after a layout operation. * * @method repaint */ repaint: function() { var self = this, style, rect; style = self.getEl().style; rect = self._layoutRect; style.left = rect.x + 'px'; style.top = rect.y + 'px'; // Hardcoded arbitrary z-value because we want the // notifications under the other windows style.zIndex = 0xFFFF - 1; } }); });
/** * 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. */ 'use strict'; const path = require('../fastpath'); const getPlatformExtension = require('./getPlatformExtension'); function getAssetDataFromName(filename, platforms) { const ext = path.extname(filename); const platformExt = getPlatformExtension(filename, platforms); let pattern = '@([\\d\\.]+)x'; if (platformExt != null) { pattern += '(\\.' + platformExt + ')?'; } pattern += '\\' + ext + '$'; const re = new RegExp(pattern); const match = filename.match(re); let resolution; if (!(match && match[1])) { resolution = 1; } else { resolution = parseFloat(match[1], 10); if (isNaN(resolution)) { resolution = 1; } } let assetName; if (match) { assetName = filename.replace(re, ext); } else if (platformExt != null) { assetName = filename.replace(new RegExp(`\\.${platformExt}\\${ext}`), ext); } else { assetName = filename; } return { resolution: resolution, assetName: assetName, type: ext.slice(1), name: path.basename(assetName, ext), platform: platformExt, }; } module.exports = getAssetDataFromName;
var utils = require('../../lib/utils'); // if they agree to the ULA, notify hubspot, create a trial and send verification link module.exports = function trialSignup(request, reply) { var postToHubspot = request.server.methods.npme.sendData, getCustomer = request.server.methods.npme.getCustomer; var opts = {}; var data = { hs_context: { pageName: "enterprise-trial-signup", ipAddress: utils.getUserIP(request) }, // we can trust the email is fine because we've verified it in the show-ula handler email: request.payload.customer_email, }; postToHubspot(process.env.HUBSPOT_FORM_NPME_AGREED_ULA, data, function(er) { if (er) { request.logger.error('Could not hit ULA notification form on Hubspot'); request.logger.error(er); reply.view('errors/internal', opts).code(500); return; } getCustomer(data.email, function(err, customer) { if (err) { request.logger.error('Unknown problem with customer record'); request.logger.error(err); reply.view('errors/internal', opts).code(500); return; } if (!customer) { request.logger.error('Unable to locate customer error ' + data.email); reply.view('errors/internal', opts).code(500); return; } if (customer && customer.id + '' === request.payload.customer_id + '') { return createTrialAccount(request, reply, customer); } request.logger.error('Unable to verify customer record ', data.email); reply.view('errors/internal', opts).code(500); }); }); }; function createTrialAccount(request, reply, customer) { var createTrial = request.server.methods.npme.createTrial; var opts = {}; createTrial(customer, function(er, trial) { if (er) { request.logger.error('There was an error with creating a trial for ', customer.id); request.logger.error(er); reply.view('errors/internal', opts).code(500); return; } return sendVerificationEmail(request, reply, customer, trial); }); } function sendVerificationEmail(request, reply, customer, trial) { var opts = {}; var sendEmail = request.server.methods.email.send; var user = { name: customer.name, email: customer.email, verification_key: trial.verification_key }; sendEmail('npme-trial-verification', user, request.redis) .catch(function(er) { request.logger.error('Unable to send verification email to ', customer); request.logger.error(er); reply.view('errors/internal', opts).code(500); return; }) .then(function() { return reply.view('enterprise/thanks', opts); }); }
var insert = require('./insert') var concat = require('concat-stream') insert('aggregate', [{ name: 'Squirtle', type: 'water' }, { name: 'Starmie', type: 'water' }, { name: 'Charmander', type: 'fire' }, { name: 'Lapras', type: 'water' }], function (db, t, done) { db.a.aggregate([{$group: {_id: '$type'}}, {$project: { _id: 0, foo: '$_id' }}], function (err, types) { console.log(err, types) var arr = types.map(function (x) {return x.foo}) console.log('arr', arr) t.equal(types.length, 2) console.log('here') t.notEqual(arr.indexOf('fire'), -1) console.log('there') t.notEqual(arr.indexOf('water'), -1) console.log('where') // test as a stream var strm = db.a.aggregate([{$group: {_id: '$type'}}, {$project: {_id: 0, foo: '$_id'}}]) strm.pipe(concat(function (types) { var arr = types.map(function (x) {return x.foo}) t.equal(types.length, 2) t.notEqual(arr.indexOf('fire'), -1) t.notEqual(arr.indexOf('water'), -1) t.end() })) strm.on('error', function (err) { // Aggregation cursors are only supported on mongodb 2.6+ // this shouldn't fail the tests for other versions of mongodb if (err.message === 'unrecognized field "cursor') t.ok(1) else t.fail(err) t.end() }) }) })
import {addClass, hasClass, empty} from './../helpers/dom/element'; import {eventManager as eventManagerObject} from './../eventManager'; import {getRenderer, registerRenderer} from './../renderers'; import {WalkontableCellCoords} from './../3rdparty/walkontable/src/cell/coords'; var clonableWRAPPER = document.createElement('DIV'); clonableWRAPPER.className = 'htAutocompleteWrapper'; var clonableARROW = document.createElement('DIV'); clonableARROW.className = 'htAutocompleteArrow'; // workaround for https://github.com/handsontable/handsontable/issues/1946 // this is faster than innerHTML. See: https://github.com/handsontable/handsontable/wiki/JavaScript-&-DOM-performance-tips clonableARROW.appendChild(document.createTextNode(String.fromCharCode(9660))); var wrapTdContentWithWrapper = function(TD, WRAPPER) { WRAPPER.innerHTML = TD.innerHTML; empty(TD); TD.appendChild(WRAPPER); }; /** * Autocomplete renderer * * @private * @renderer AutocompleteRenderer * @param {Object} instance Handsontable instance * @param {Element} TD Table cell where to render * @param {Number} row * @param {Number} col * @param {String|Number} prop Row object property name * @param value Value to render (remember to escape unsafe HTML before inserting to DOM!) * @param {Object} cellProperties Cell properites (shared by cell renderer and editor) */ function autocompleteRenderer(instance, TD, row, col, prop, value, cellProperties) { var WRAPPER = clonableWRAPPER.cloneNode(true); //this is faster than createElement var ARROW = clonableARROW.cloneNode(true); //this is faster than createElement getRenderer('text')(instance, TD, row, col, prop, value, cellProperties); TD.appendChild(ARROW); addClass(TD, 'htAutocomplete'); if (!TD.firstChild) { //http://jsperf.com/empty-node-if-needed //otherwise empty fields appear borderless in demo/renderers.html (IE) TD.appendChild(document.createTextNode(String.fromCharCode(160))); // workaround for https://github.com/handsontable/handsontable/issues/1946 //this is faster than innerHTML. See: https://github.com/handsontable/handsontable/wiki/JavaScript-&-DOM-performance-tips } if (!instance.acArrowListener) { var eventManager = eventManagerObject(instance); //not very elegant but easy and fast instance.acArrowListener = function(event) { if (hasClass(event.target, 'htAutocompleteArrow')) { instance.view.wt.getSetting('onCellDblClick', null, new WalkontableCellCoords(row, col), TD); } }; eventManager.addEventListener(instance.rootElement, 'mousedown', instance.acArrowListener); //We need to unbind the listener after the table has been destroyed instance.addHookOnce('afterDestroy', function() { eventManager.destroy(); }); } } export {autocompleteRenderer}; registerRenderer('autocomplete', autocompleteRenderer);
var one = { name: 'one' };
var crypto = require('crypto'); var scmp = require('scmp'); var utils = require('keystone-utils'); // The DISABLE_CSRF environment variable is available to automatically pass // CSRF validation. This is useful in development scenarios where you want to // restart the node process and aren't using a persistent session store, but // should NEVER be set in production environments!! var DISABLE_CSRF = process.env.DISABLE_CSRF === 'true'; exports.TOKEN_KEY = '_csrf'; exports.LOCAL_KEY = 'csrf_token_key'; exports.LOCAL_VALUE = 'csrf_token_value'; exports.SECRET_KEY = exports.TOKEN_KEY + '_secret'; exports.SECRET_LENGTH = 10; exports.CSRF_HEADER_KEY = 'x-csrf-token'; exports.XSRF_HEADER_KEY = 'x-xsrf-token'; exports.XSRF_COOKIE_KEY = 'XSRF-TOKEN'; function tokenize (salt, secret) { return salt + crypto.createHash('sha1').update(salt + secret).digest('hex'); } exports.createSecret = function () { return crypto.pseudoRandomBytes(exports.SECRET_LENGTH).toString('base64'); }; exports.getSecret = function (req) { return req.session[exports.SECRET_KEY] || (req.session[exports.SECRET_KEY] = exports.createSecret()); }; exports.createToken = function (req) { return tokenize(utils.randomString(exports.SECRET_LENGTH), exports.getSecret(req)); }; exports.getToken = function (req, res) { res.locals[exports.LOCAL_VALUE] = res.locals[exports.LOCAL_VALUE] || exports.createToken(req); res.cookie(exports.XSRF_COOKIE_KEY, res.locals[exports.LOCAL_VALUE]); return res.locals[exports.LOCAL_VALUE]; }; exports.requestToken = function (req) { if (req.body && req.body[exports.TOKEN_KEY]) { return req.body[exports.TOKEN_KEY]; } else if (req.query && req.query[exports.TOKEN_KEY]) { return req.query[exports.TOKEN_KEY]; } else if (req.headers && req.headers[exports.XSRF_HEADER_KEY]) { return req.headers[exports.XSRF_HEADER_KEY]; } else if (req.headers && req.headers[exports.CSRF_HEADER_KEY]) { return req.headers[exports.CSRF_HEADER_KEY]; } return ''; }; exports.validate = function (req, token) { // Allow environment variable to disable check if (DISABLE_CSRF) return true; if (arguments.length === 1) { token = exports.requestToken(req); } if (typeof token !== 'string') { return false; } return scmp(token, tokenize(token.slice(0, exports.SECRET_LENGTH), req.session[exports.SECRET_KEY])); }; exports.middleware = { init: function (req, res, next) { res.locals[exports.LOCAL_KEY] = exports.LOCAL_VALUE; exports.getToken(req, res); next(); }, validate: function (req, res, next) { // Allow environment variable to disable check if (DISABLE_CSRF) return next(); // Bail on safe methods if (req.method === 'GET' || req.method === 'HEAD' || req.method === 'OPTIONS') { return next(); } // Validate token if (exports.validate(req)) { next(); } else { res.statusCode = 403; next(new Error('CSRF token mismatch')); } }, };
module.exports = require("./mime-functions"); module.exports.contentTypes = require("./content-types");
/** * @license Highstock JS v2.1.4 (2015-03-10) * Plugin for displaying a message when there is no data visible in chart. * * (c) 2010-2014 Highsoft AS * Author: Oystein Moseng * * License: www.highcharts.com/license */ (function (H) { var seriesTypes = H.seriesTypes, chartPrototype = H.Chart.prototype, defaultOptions = H.getOptions(), extend = H.extend, each = H.each; // Add language option extend(defaultOptions.lang, { noData: 'No data to display' }); // Add default display options for message defaultOptions.noData = { position: { x: 0, y: 0, align: 'center', verticalAlign: 'middle' }, attr: { }, style: { fontWeight: 'bold', fontSize: '12px', color: '#60606a' } }; /** * Define hasData functions for series. These return true if there are data points on this series within the plot area */ function hasDataPie() { return !!this.points.length; /* != 0 */ } each(['pie', 'gauge', 'waterfall', 'bubble'], function (type) { if (seriesTypes[type]) { seriesTypes[type].prototype.hasData = hasDataPie; } }); H.Series.prototype.hasData = function () { return this.visible && this.dataMax !== undefined && this.dataMin !== undefined; // #3703 }; /** * Display a no-data message. * * @param {String} str An optional message to show in place of the default one */ chartPrototype.showNoData = function (str) { var chart = this, options = chart.options, text = str || options.lang.noData, noDataOptions = options.noData; if (!chart.noDataLabel) { chart.noDataLabel = chart.renderer.label(text, 0, 0, null, null, null, null, null, 'no-data') .attr(noDataOptions.attr) .css(noDataOptions.style) .add(); chart.noDataLabel.align(extend(chart.noDataLabel.getBBox(), noDataOptions.position), false, 'plotBox'); } }; /** * Hide no-data message */ chartPrototype.hideNoData = function () { var chart = this; if (chart.noDataLabel) { chart.noDataLabel = chart.noDataLabel.destroy(); } }; /** * Returns true if there are data points within the plot area now */ chartPrototype.hasData = function () { var chart = this, series = chart.series, i = series.length; while (i--) { if (series[i].hasData() && !series[i].options.isInternal) { return true; } } return false; }; /** * Show no-data message if there is no data in sight. Otherwise, hide it. */ function handleNoData() { var chart = this; if (chart.hasData()) { chart.hideNoData(); } else { chart.showNoData(); } } /** * Add event listener to handle automatic display of no-data message */ chartPrototype.callbacks.push(function (chart) { H.addEvent(chart, 'load', handleNoData); H.addEvent(chart, 'redraw', handleNoData); }); }(Highcharts));
(function ($) { $.Redactor.opts.langs['el'] = { html: 'HTML', video: 'Εισαγωγή βίντεο...', image: 'Εισαγωγή εικόνας...', table: 'Πίνακας', link: 'Σύνδεσμος', link_insert: 'Εισαγωγή συνδέσμου...', link_edit: 'Edit link', unlink: 'Ακύρωση συνδέσμου', formatting: 'Μορφοποίηση', paragraph: 'Παράγραφος', quote: 'Παράθεση', code: 'Κώδικας', header1: 'Κεφαλίδα 1', header2: 'Κεφαλίδα 2', header3: 'Κεφαλίδα 3', header4: 'Κεφαλίδα 4', bold: 'Έντονα', italic: 'Πλάγια', fontcolor: 'Χρώμα γραμματοσειράς', backcolor: 'Χρώμα επισήμανσης κειμένου', unorderedlist: 'Κουκκίδες', orderedlist: 'Αρίθμηση', outdent: 'Μείωση εσοχής', indent: 'Αύξηση εσοχής', cancel: 'Ακύρωση', insert: 'Εισαγωγή', save: 'Αποθήκευση', _delete: 'Διαγραφή', insert_table: 'Εισαγωγή πίνακα...', insert_row_above: 'Προσθήκη σειράς επάνω', insert_row_below: 'Προσθήκη σειράς κάτω', insert_column_left: 'Προσθήκη στήλης αριστερά', insert_column_right: 'Προσθήκη στήλης δεξιά', delete_column: 'Διαγραφή στήλης', delete_row: 'Διαγραφή σειράς', delete_table: 'Διαγραφή πίνακα', rows: 'Γραμμές', columns: 'Στήλες', add_head: 'Προσθήκη κεφαλίδας', delete_head: 'Διαγραφή κεφαλίδας', title: 'Τίτλος', image_position: 'Θέση', none: 'Καμία', left: 'Αριστερά', right: 'Δεξιά', image_web_link: 'Υπερσύνδεσμος εικόνας', text: 'Κείμενο', mailto: 'Email', web: 'URL', video_html_code: 'Video Embed Code', file: 'Εισαγωγή αρχείου...', upload: 'Upload', download: 'Download', choose: 'Επέλεξε', or_choose: 'ή επέλεξε', drop_file_here: 'Σύρατε αρχεία εδώ', align_left: 'Στοίχιση αριστερά', align_center: 'Στοίχιση στο κέντρο', align_right: 'Στοίχιση δεξιά', align_justify: 'Πλήρησ στοίχηση', horizontalrule: 'Εισαγωγή οριζόντιας γραμμής', deleted: 'Διαγράφτηκε', anchor: 'Anchor', link_new_tab: 'Open link in new tab', underline: 'Underline', alignment: 'Alignment', filename: 'Name (optional)', edit: 'Edit' }; })( jQuery );
import Ember from 'ember-metal/core'; import { get } from 'ember-metal/property_get'; import { internal } from 'htmlbars-runtime'; import { read } from 'ember-metal/streams/utils'; export default { setupState(state, env, scope, params, hash) { var controller = hash.controller; if (controller) { if (!state.controller) { var context = params[0]; var controllerFactory = env.container.lookupFactory('controller:' + controller); var parentController = null; if (scope.locals.controller) { parentController = read(scope.locals.controller); } else if (scope.locals.view) { parentController = get(read(scope.locals.view), 'context'); } var controllerInstance = controllerFactory.create({ model: env.hooks.getValue(context), parentController: parentController, target: parentController }); params[0] = controllerInstance; return { controller: controllerInstance }; } return state; } return { controller: null }; }, isStable() { return true; }, isEmpty(state) { return false; }, render(morph, env, scope, params, hash, template, inverse, visitor) { if (morph.state.controller) { morph.addDestruction(morph.state.controller); hash.controller = morph.state.controller; } Ember.assert( '{{#with foo}} must be called with a single argument or the use the ' + '{{#with foo as |bar|}} syntax', params.length === 1 ); Ember.assert( 'The {{#with}} helper must be called with a block', !!template ); internal.continueBlock(morph, env, scope, 'with', params, hash, template, inverse, visitor); }, rerender(morph, env, scope, params, hash, template, inverse, visitor) { internal.continueBlock(morph, env, scope, 'with', params, hash, template, inverse, visitor); } };
/* Copyright 2013 10gen 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. */ /* global describe, expect, it, mongo */ describe('The const module', function () { it('stores keycode constants', function () { var key = mongo.config.keycodes; expect(key.enter).toBe(13); expect(key.left).toBe(37); expect(key.up).toBe(38); expect(key.right).toBe(39); expect(key.down).toBe(40); }); it('stores the keep alive timeout', function () { expect(mongo.config.keepAliveTime).toBeDefined(); }); it('stores the root element CSS selector', function () { expect(mongo.config.rootElementSelector).toBeDefined(); }); it('stores the script name', function () { expect(mongo.config.scriptName).toBeDefined(); }); it('stores the shell batch size', function () { expect(mongo.config.shellBatchSize).toBeDefined(); }); it('gets and stores the MWS host', function () { expect(mongo.config.mwsHost).toEqual('http://mwshost.example.com'); }); it('generates and stores the baseUrl', function(){ expect(mongo.config.baseUrl).toBeDefined(); expect(mongo.config.baseUrl.indexOf(mongo.config.mwsHost) > -1).toBe(true); }); });
// Copyright 2014 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. 'use strict'; // This file relies on the fact that the following declaration has been made // in runtime.js: // var $Array = global.Array; // ------------------------------------------------------------------- // Proposed for ES7 // https://github.com/tc39/Array.prototype.includes // 6e3b78c927aeda20b9d40e81303f9d44596cd904 function ArrayIncludes(searchElement, fromIndex) { var array = ToObject(this); var len = ToLength(array.length); if (len === 0) { return false; } var n = ToInteger(fromIndex); var k; if (n >= 0) { k = n; } else { k = len + n; if (k < 0) { k = 0; } } while (k < len) { var elementK = array[k]; if (SameValueZero(searchElement, elementK)) { return true; } ++k; } return false; } // ------------------------------------------------------------------- function HarmonyArrayIncludesExtendArrayPrototype() { %CheckIsBootstrapping(); %FunctionSetLength(ArrayIncludes, 1); // Set up the non-enumerable functions on the Array prototype object. InstallFunctions($Array.prototype, DONT_ENUM, $Array( "includes", ArrayIncludes )); } HarmonyArrayIncludesExtendArrayPrototype();
// File: chapter14/appUnderTest/app/scripts/app.js angular.module('fifaApp', ['ngRoute']) .config(function($routeProvider) { $routeProvider.when('/', { templateUrl: 'views/team_list.html', controller: 'TeamListCtrl as teamListCtrl' }) .when('/login', { templateUrl: 'views/login.html', }) .when('/team/:code', { templateUrl: 'views/team_details.html', controller:'TeamDetailsCtrl as teamDetailsCtrl', resolve: { auth: ['$q', '$location', 'UserService', function($q, $location, UserService) { return UserService.session().then( function(success) {}, function(err) { $location.path('/login'); return $q.reject(err); }); }] } }); $routeProvider.otherwise({ redirectTo: '/' }); });
tinymce.PluginManager.add("insertdatetime", function (e) { function t(t, n) { function i(e, t) { if (e = "" + e, e.length < t)for (var n = 0; n < t - e.length; n++)e = "0" + e; return e } return n = n || new Date, t = t.replace("%D", "%m/%d/%Y"), t = t.replace("%r", "%I:%M:%S %p"), t = t.replace("%Y", "" + n.getFullYear()), t = t.replace("%y", "" + n.getYear()), t = t.replace("%m", i(n.getMonth() + 1, 2)), t = t.replace("%d", i(n.getDate(), 2)), t = t.replace("%H", "" + i(n.getHours(), 2)), t = t.replace("%M", "" + i(n.getMinutes(), 2)), t = t.replace("%S", "" + i(n.getSeconds(), 2)), t = t.replace("%I", "" + ((n.getHours() + 11) % 12 + 1)), t = t.replace("%p", "" + (n.getHours() < 12 ? "AM" : "PM")), t = t.replace("%B", "" + e.translate(s[n.getMonth()])), t = t.replace("%b", "" + e.translate(o[n.getMonth()])), t = t.replace("%A", "" + e.translate(r[n.getDay()])), t = t.replace("%a", "" + e.translate(a[n.getDay()])), t = t.replace("%%", "%") } function n(n) { var i = t(n); if (e.settings.insertdatetime_element) { var a; a = /%[HMSIp]/.test(n) ? t("%Y-%m-%dT%H:%M") : t("%Y-%m-%d"), i = '<time datetime="' + a + '">' + i + "</time>"; var r = e.dom.getParent(e.selection.getStart(), "time"); if (r)return e.dom.setOuterHTML(r, i), void 0 } e.insertContent(i) } var i, a = "Sun Mon Tue Wed Thu Fri Sat Sun".split(" "), r = "Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "), o = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "), s = "January February March April May June July August September October November December".split(" "), l = []; e.addCommand("mceInsertDate", function () { n(e.getParam("insertdatetime_dateformat", e.translate("%Y-%m-%d"))) }), e.addCommand("mceInsertTime", function () { n(e.getParam("insertdatetime_timeformat", e.translate("%H:%M:%S"))) }), e.addButton("inserttime", { type: "splitbutton", title: "Insert time", onclick: function () { n(i || "%H:%M:%S") }, menu: l }), tinymce.each(e.settings.insertdatetime_formats || ["%H:%M:%S", "%Y-%m-%d", "%I:%M:%S %p", "%D"], function (e) { l.push({ text: t(e), onclick: function () { i = e, n(e) } }) }), e.addMenuItem("insertdatetime", {icon: "date", text: "Insert date/time", menu: l, context: "insert"}) });
/* * ContextMenu Plugin * * */ (function($) { $.extend(mejs.MepDefaults, contextMenuItems = [ // demo of a fullscreen option { render: function(player) { // check for fullscreen plugin if (typeof player.enterFullScreen == 'undefined') return null; if (player.isFullScreen) { return "Turn off Fullscreen"; } else { return "Go Fullscreen"; } }, click: function(player) { if (player.isFullScreen) { player.exitFullScreen(); } else { player.enterFullScreen(); } } } , // demo of a mute/unmute button { render: function(player) { if (player.media.muted) { return "Unmute"; } else { return "Mute"; } }, click: function(player) { if (player.media.muted) { player.setMuted(false); } else { player.setMuted(true); } } }, // separator { isSeparator: true } , // demo of simple download video { render: function(player) { return "Download Video"; }, click: function(player) { window.location.href = player.media.currentSrc; } } ] ); $.extend(MediaElementPlayer.prototype, { buildcontextmenu: function(player, controls, layers, media) { // create context menu player.contextMenu = $('<div class="mejs-contextmenu"></div>') .appendTo($('body')) .hide(); // create events for showing context menu player.container.bind('contextmenu', function(e) { if (player.isContextMenuEnabled) { e.preventDefault(); player.renderContextMenu(e.clientX-1, e.clientY-1); return false; } }); player.container.bind('click', function() { player.contextMenu.hide(); }); player.contextMenu.bind('mouseleave', function() { //console.log('context hover out'); player.startContextMenuTimer(); }); }, isContextMenuEnabled: true, enableContextMenu: function() { this.isContextMenuEnabled = true; }, disableContextMenu: function() { this.isContextMenuEnabled = false; }, contextMenuTimeout: null, startContextMenuTimer: function() { //console.log('startContextMenuTimer'); var t = this; t.killContextMenuTimer(); t.contextMenuTimer = setTimeout(function() { t.hideContextMenu(); t.killContextMenuTimer(); }, 750); }, killContextMenuTimer: function() { var timer = this.contextMenuTimer; //console.log('killContextMenuTimer', timer); if (timer != null) { clearTimeout(timer); delete timer; timer = null; } }, hideContextMenu: function() { this.contextMenu.hide(); }, renderContextMenu: function(x,y) { // alway re-render the items so that things like "turn fullscreen on" and "turn fullscreen off" are always written correctly var t = this, html = '', items = t.options.contextMenuItems; for (var i=0, il=items.length; i<il; i++) { if (items[i].isSeparator) { html += '<div class="mejs-contextmenu-separator"></div>'; } else { var rendered = items[i].render(t); // render can return null if the item doesn't need to be used at the moment if (rendered != null) { html += '<div class="mejs-contextmenu-item" data-itemindex="' + i + '" id="element-' + (Math.random()*1000000) + '">' + rendered + '</div>'; } } } // position and show the context menu t.contextMenu .empty() .append($(html)) .css({top:y, left:x}) .show(); // bind events t.contextMenu.find('.mejs-contextmenu-item').each(function() { // which one is this? var $dom = $(this), itemIndex = parseInt( $dom.data('itemindex'), 10 ), item = t.options.contextMenuItems[itemIndex]; // bind extra functionality? if (typeof item.show != 'undefined') item.show( $dom , t); // bind click action $dom.click(function() { // perform click action if (typeof item.click != 'undefined') item.click(t); // close t.contextMenu.hide(); }); }); // stop the controls from hiding setTimeout(function() { t.killControlsTimer('rev3'); }, 100); } }); })(mejs.$);
// Copyright 2009 the Sputnik authors. All rights reserved. /** * The production x >>>= y is the same as x = x >>> y * * @path ch11/11.13/11.13.2/S11.13.2_A4.8_T1.3.js * @description Type(x) and Type(y) vary between primitive string and String object */ //CHECK#1 x = "1"; x >>>= "1"; if (x !== 0) { $ERROR('#1: x = "1"; x >>>= "1"; x === 0. Actual: ' + (x)); } //CHECK#2 x = new String("1"); x >>>= "1"; if (x !== 0) { $ERROR('#2: x = new String("1"); x >>>= "1"; x === 0. Actual: ' + (x)); } //CHECK#3 x = "1"; x >>>= new String("1"); if (x !== 0) { $ERROR('#3: x = "1"; x >>>= new String("1"); x === 0. Actual: ' + (x)); } //CHECK#4 x = new String("1"); x >>>= new String("1"); if (x !== 0) { $ERROR('#4: x = new String("1"); x >>>= new String("1"); x === 0. Actual: ' + (x)); } //CHECK#5 x = "x"; x >>>= "1"; if (x !== 0) { $ERROR('#5: x = "x"; x >>>= "1"; x === 0. Actual: ' + (x)); } //CHECK#6 x = "1"; x >>>= "x"; if (x !== 1) { $ERROR('#6: x = "1"; x >>>= "x"; x === 1. Actual: ' + (x)); }
/// Copyright (c) 2012 Ecma International. All rights reserved. /** * @path ch11/11.4/11.4.1/11.4.1-5-a-27-s.js * @description Strict Mode - TypeError is thrown after deleting a property, calling preventExtensions, and attempting to reassign the property * @onlyStrict */ function testcase() { "use strict"; var a = {x:0, get y() { return 0;}}; delete a.x; Object.preventExtensions(a); try { a.x = 1; return false; } catch (e) { return e instanceof TypeError; } } runTestCase(testcase);
/// Copyright (c) 2012 Ecma International. All rights reserved. /** * @path ch15/15.2/15.2.3/15.2.3.5/15.2.3.5-4-258.js * @description Object.create - 'get' property of one property in 'Properties' is the primitive value null (8.10.5 step 7.b) */ function testcase() { try { Object.create({}, { prop: { get: null } }); return false; } catch (e) { return (e instanceof TypeError); } } runTestCase(testcase);
module.exports = require('./lib/socket.io');
var _complement = require('./internal/_complement'); var _curry2 = require('./internal/_curry2'); var filter = require('./filter'); /** * Similar to `filter`, except that it keeps only values for which the given predicate * function returns falsy. The predicate function is passed one argument: *(value)*. * * Acts as a transducer if a transformer is given in list position. * @see R.transduce * * @func * @memberOf R * @category List * @sig (a -> Boolean) -> [a] -> [a] * @param {Function} fn The function called per iteration. * @param {Array} list The collection to iterate over. * @return {Array} The new filtered array. * @see R.filter * @example * * var isOdd = function(n) { * return n % 2 === 1; * }; * R.reject(isOdd, [1, 2, 3, 4]); //=> [2, 4] */ module.exports = _curry2(function reject(fn, list) { return filter(_complement(fn), list); });
/************************************************************* * * MathJax/jax/output/HTML-CSS/fonts/Asana-Math/Size1/Regular/Main.js * * Copyright (c) 2013-2014 The MathJax Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ MathJax.OutputJax['HTML-CSS'].FONTDATA.FONTS['AsanaMathJax_Size1'] = { directory: 'Size1/Regular', family: 'AsanaMathJax_Size1', testString: '\u0302\u0303\u0305\u0306\u030C\u0332\u0333\u033F\u2016\u2044\u2045\u2046\u20D6\u20D7\u220F', 0x20: [0,0,249,0,0], 0x28: [981,490,399,84,360], 0x29: [981,490,399,40,316], 0x5B: [984,492,350,84,321], 0x5D: [984,492,350,84,321], 0x7B: [981,490,362,84,328], 0x7C: [908,367,241,86,156], 0x7D: [981,490,362,84,328], 0x302: [783,-627,453,0,453], 0x303: [763,-654,700,0,701], 0x305: [587,-542,510,0,511], 0x306: [664,-506,383,0,384], 0x30C: [783,-627,736,0,737], 0x332: [-130,175,510,0,511], 0x333: [-130,283,510,0,511], 0x33F: [695,-542,510,0,511], 0x2016: [908,367,436,86,351], 0x2044: [742,463,382,-69,383], 0x2045: [943,401,353,64,303], 0x2046: [943,401,358,30,269], 0x20D6: [790,-519,807,0,807], 0x20D7: [790,-519,807,0,807], 0x220F: [901,448,1431,78,1355], 0x2210: [901,448,1431,78,1355], 0x2211: [893,446,1224,89,1135], 0x221A: [1280,0,770,63,803], 0x2229: [1039,520,1292,124,1169], 0x222B: [1310,654,1000,54,1001], 0x222C: [1310,654,1659,54,1540], 0x222D: [1310,654,2198,54,2079], 0x222E: [1310,654,1120,54,1001], 0x222F: [1310,654,1659,54,1540], 0x2230: [1310,654,2198,54,2079], 0x2231: [1310,654,1120,54,1001], 0x2232: [1310,654,1146,80,1027], 0x2233: [1310,654,1120,54,1001], 0x22C0: [1040,519,1217,85,1132], 0x22C1: [1040,519,1217,85,1132], 0x22C2: [1039,520,1292,124,1169], 0x22C3: [1039,520,1292,124,1169], 0x2308: [980,490,390,84,346], 0x2309: [980,490,390,84,346], 0x230A: [980,490,390,84,346], 0x230B: [980,490,390,84,346], 0x23B4: [755,-518,977,0,978], 0x23B5: [-238,475,977,0,978], 0x23DC: [821,-545,972,0,973], 0x23DD: [-545,821,972,0,973], 0x23DE: [789,-545,1572,51,1522], 0x23DF: [-545,789,1572,51,1522], 0x23E0: [755,-545,1359,0,1360], 0x23E1: [-545,755,1359,0,1360], 0x27C5: [781,240,450,53,397], 0x27C6: [781,240,450,53,397], 0x27E6: [684,341,502,84,473], 0x27E7: [684,341,502,84,473], 0x27E8: [681,340,422,53,371], 0x27E9: [681,340,422,53,371], 0x27EA: [681,340,605,53,554], 0x27EB: [681,340,605,53,554], 0x29FC: [915,457,518,50,469], 0x29FD: [915,457,518,49,469], 0x2A00: [1100,550,1901,124,1778], 0x2A01: [1100,550,1901,124,1778], 0x2A02: [1100,550,1901,124,1778], 0x2A03: [1039,520,1292,124,1169], 0x2A04: [1039,520,1292,124,1169], 0x2A05: [1024,513,1292,124,1169], 0x2A06: [1024,513,1292,124,1169], 0x2A07: [1039,520,1415,86,1330], 0x2A08: [1039,520,1415,86,1330], 0x2A09: [888,445,1581,124,1459], 0x2A0C: [1310,654,2736,54,2617], 0x2A0D: [1310,654,1120,54,1001], 0x2A0E: [1310,654,1120,54,1001], 0x2A0F: [1310,654,1120,54,1001], 0x2A10: [1310,654,1120,54,1001], 0x2A11: [1310,654,1182,54,1063], 0x2A12: [1310,654,1120,54,1001], 0x2A13: [1310,654,1120,54,1001], 0x2A14: [1310,654,1120,54,1001], 0x2A15: [1310,654,1120,54,1001], 0x2A16: [1310,654,1120,54,1001], 0x2A17: [1310,654,1431,54,1362], 0x2A18: [1310,654,1120,54,1001], 0x2A19: [1310,654,1120,54,1001], 0x2A1A: [1310,654,1120,54,1001], 0x2A1B: [1471,654,1130,54,1011], 0x2A1C: [1471,654,1156,80,1037] }; MathJax.Callback.Queue( ["initFont",MathJax.OutputJax["HTML-CSS"],"AsanaMathJax_Size1"], ["loadComplete",MathJax.Ajax,MathJax.OutputJax["HTML-CSS"].fontDir+"/Size1/Regular/Main.js"] );
/************************************************************* * * MathJax/jax/output/HTML-CSS/fonts/Neo-Euler/Variants/Regular/Main.js * * Copyright (c) 2013-2014 The MathJax Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ MathJax.OutputJax['HTML-CSS'].FONTDATA.FONTS['NeoEulerMathJax_Variants'] = { directory: 'Variants/Regular', family: 'NeoEulerMathJax_Variants', testString: '\u00A0\u2032\u2033\u2034\u2035\u2036\u2037\u2057\uE200\uE201\uE202\uE203\uE204\uE205\uE206', 0x20: [0,0,333,0,0], 0xA0: [0,0,333,0,0], 0x2032: [559,-41,329,48,299], 0x2033: [559,-41,640,48,610], 0x2034: [559,-41,950,48,920], 0x2035: [559,-41,329,48,299], 0x2036: [559,-41,640,48,610], 0x2037: [559,-41,950,48,919], 0x2057: [559,-41,1260,48,1230], 0xE200: [493,13,501,41,456], 0xE201: [469,1,501,46,460], 0xE202: [474,-1,501,59,485], 0xE203: [474,182,501,38,430], 0xE204: [476,192,501,10,482], 0xE205: [458,184,501,47,441], 0xE206: [700,13,501,45,471], 0xE207: [468,181,501,37,498], 0xE208: [706,10,501,40,461], 0xE209: [470,182,501,27,468] }; MathJax.Callback.Queue( ["initFont",MathJax.OutputJax["HTML-CSS"],"NeoEulerMathJax_Variants"], ["loadComplete",MathJax.Ajax,MathJax.OutputJax["HTML-CSS"].fontDir+"/Variants/Regular/Main.js"] );
/** * ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v9.0.3 * @link http://www.ag-grid.com/ * @license MIT */ "use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; Object.defineProperty(exports, "__esModule", { value: true }); var context_1 = require("./context/context"); var LINE_SEPARATOR = '\r\n'; var XmlFactory = (function () { function XmlFactory() { } XmlFactory.prototype.createXml = function (xmlElement, booleanTransformer) { var _this = this; var props = ""; if (xmlElement.properties) { if (xmlElement.properties.prefixedAttributes) { xmlElement.properties.prefixedAttributes.forEach(function (prefixedSet) { Object.keys(prefixedSet.map).forEach(function (key) { props += _this.returnAttributeIfPopulated(prefixedSet.prefix + key, prefixedSet.map[key], booleanTransformer); }); }); } if (xmlElement.properties.rawMap) { Object.keys(xmlElement.properties.rawMap).forEach(function (key) { props += _this.returnAttributeIfPopulated(key, xmlElement.properties.rawMap[key], booleanTransformer); }); } } var result = "<" + xmlElement.name + props; if (!xmlElement.children && !xmlElement.textNode) { return result + "/>" + LINE_SEPARATOR; } if (xmlElement.textNode) { return result + ">" + xmlElement.textNode + "</" + xmlElement.name + ">" + LINE_SEPARATOR; } result += ">" + LINE_SEPARATOR; xmlElement.children.forEach(function (it) { result += _this.createXml(it, booleanTransformer); }); return result + "</" + xmlElement.name + ">" + LINE_SEPARATOR; }; XmlFactory.prototype.returnAttributeIfPopulated = function (key, value, booleanTransformer) { if (!value) { return ""; } var xmlValue = value; if ((typeof (value) === 'boolean')) { if (booleanTransformer) { xmlValue = booleanTransformer(value); } } xmlValue = '"' + xmlValue + '"'; return " " + key + "=" + xmlValue; }; return XmlFactory; }()); XmlFactory = __decorate([ context_1.Bean('xmlFactory') ], XmlFactory); exports.XmlFactory = XmlFactory;
/** * High performant way to check whether an element with a specific class name is in the given document * Optimized for being heavily executed * Unleashes the power of live node lists * * @param {Object} doc The document object of the context where to check * @param {String} tagName Upper cased tag name * @example * wysihtml5.dom.hasElementWithClassName(document, "foobar"); */ (function(wysihtml5) { var LIVE_CACHE = {}, DOCUMENT_IDENTIFIER = 1; function _getDocumentIdentifier(doc) { return doc._wysihtml5_identifier || (doc._wysihtml5_identifier = DOCUMENT_IDENTIFIER++); } wysihtml5.dom.hasElementWithClassName = function(doc, className) { // getElementsByClassName is not supported by IE<9 // but is sometimes mocked via library code (which then doesn't return live node lists) if (!wysihtml5.browser.supportsNativeGetElementsByClassName()) { return !!doc.querySelector("." + className); } var key = _getDocumentIdentifier(doc) + ":" + className, cacheEntry = LIVE_CACHE[key]; if (!cacheEntry) { cacheEntry = LIVE_CACHE[key] = doc.getElementsByClassName(className); } return cacheEntry.length > 0; }; })(wysihtml5);
{ "EL": {"custom":["org.nutz.el.issue279.Uuuid"]} }
'use strict'; angular.module('showcase', [ 'showcase.angularWay', 'showcase.angularWay.withOptions', 'showcase.withAjax', 'showcase.withOptions', 'showcase.withPromise', 'showcase.angularWay.dataChange', 'showcase.bindAngularDirective', 'showcase.changeOptions', 'showcase.dataReload.withAjax', 'showcase.dataReload.withPromise', 'showcase.disableDeepWatchers', 'showcase.loadOptionsWithPromise', 'showcase.angularDirectiveInDOM', 'showcase.rerender', 'showcase.rowClickEvent', 'showcase.rowSelect', 'showcase.serverSideProcessing', 'showcase.bootstrapIntegration', 'showcase.overrideBootstrapOptions', 'showcase.withAngularTranslate', 'showcase.withColReorder', 'showcase.withColumnFilter', 'showcase.withLightColumnFilter', 'showcase.withColVis', 'showcase.withResponsive', 'showcase.withScroller', 'showcase.withTableTools', 'showcase.withFixedColumns', 'showcase.withFixedHeader', 'showcase.withButtons', 'showcase.withSelect', 'showcase.dtInstances', 'showcase.usages', 'ui.bootstrap', 'ui.router', 'hljs' ]) .config(sampleConfig) .config(routerConfig) .config(translateConfig) .config(debugDisabled) .run(initDT); backToTop.init({ theme: 'classic', // Available themes: 'classic', 'sky', 'slate' animation: 'fade' // Available animations: 'fade', 'slide' }); function debugDisabled($compileProvider)  { $compileProvider.debugInfoEnabled(false); } function sampleConfig(hljsServiceProvider) { hljsServiceProvider.setOptions({ // replace tab with 4 spaces tabReplace: ' ' }); } function routerConfig($stateProvider, $urlRouterProvider, USAGES) { $urlRouterProvider.otherwise('/welcome'); $stateProvider .state('welcome', { url: '/welcome', templateUrl: 'demo/partials/welcome.html', controller: function($rootScope) { $rootScope.$broadcast('event:changeView', 'welcome'); } }) .state('gettingStarted', { url: '/gettingStarted', templateUrl: 'demo/partials/gettingStarted.html', controller: function($rootScope) { $rootScope.$broadcast('event:changeView', 'gettingStarted'); } }) .state('api', { url: '/api', templateUrl: 'demo/api/api.html', controller: function($rootScope) { $rootScope.$broadcast('event:changeView', 'api'); } }); angular.forEach(USAGES, function(usages, key) { angular.forEach(usages, function(usage) { $stateProvider.state(usage.name, { url: '/' + usage.name, templateUrl: 'demo/' + key + '/' + usage.name + '.html', controller: function($rootScope) { $rootScope.$broadcast('event:changeView', usage.name); }, onExit: usage.onExit }); }); }); } function translateConfig($translateProvider) { $translateProvider.translations('en', { id: 'ID with angular-translate', firstName: 'First name with angular-translate', lastName: 'Last name with angular-translate' }); $translateProvider.translations('fr', { id: 'ID avec angular-translate', firstName: 'Prénom avec angular-translate', lastName: 'Nom avec angular-translate' }); $translateProvider.preferredLanguage('en'); } function initDT(DTDefaultOptions) { DTDefaultOptions.setLoadingTemplate('<img src="/angular-datatables/images/loading.gif" />'); }
/* * Dynamic To Top Plugin * http://www.mattvarone.com * * By Matt Varone * @sksmatt * */ var mv_dynamic_to_top;(function($,mv_dynamic_to_top){jQuery.fn.DynamicToTop=function(options){var defaults={text:mv_dynamic_to_top.text,min:parseInt(mv_dynamic_to_top.min,10),fade_in:600,fade_out:400,speed:parseInt(mv_dynamic_to_top.speed,10),easing:mv_dynamic_to_top.easing,version:mv_dynamic_to_top.version,id:'dynamic-to-top'},settings=$.extend(defaults,options);if(settings.version===""||settings.version==='0'){settings.text='<span>&nbsp;</span>';} if(!$.isFunction(settings.easing)){settings.easing='linear';} var $toTop=$('<a href=\"#\" id=\"'+settings.id+'\"></a>').html(settings.text);$toTop.hide().appendTo('body').click(function(){$('html, body').stop().animate({scrollTop:0},settings.speed,settings.easing);return false;});$(window).scroll(function(){var sd=jQuery(window).scrollTop();if(typeof document.body.style.maxHeight==="undefined"){$toTop.css({'position':'absolute','top':sd+$(window).height()-mv_dynamic_to_top.margin});} if(sd>settings.min){$toTop.fadeIn(settings.fade_in);}else{$toTop.fadeOut(settings.fade_out);}});};$('body').DynamicToTop();})(jQuery,mv_dynamic_to_top);
export default (...modifiers): Array<string> => {};
// Karma configuration // Generated on Sun Apr 14 2013 18:31:17 GMT+0200 (CEST) // base path, that will be used to resolve files and exclude basePath = ''; // list of files / patterns to load in the browser files = [ JASMINE, JASMINE_ADAPTER, 'http://code.angularjs.org/1.1.4/angular.js', 'http://code.angularjs.org/1.1.4/angular-resource.js', 'http://code.angularjs.org/1.1.4/angular-mocks.js', 'http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.4/underscore-min.js', 'src/restangular.js', 'test/*.js' ]; // list of files to exclude exclude = [ ]; // test results reporter to use // possible values: 'dots', 'progress', 'junit' reporters = ['progress']; // web server port port = 9877; // cli runner port runnerPort = 9101; // enable / disable colors in the output (reporters and logs) colors = true; // level of logging // possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG logLevel = LOG_INFO; // enable / disable watching file and executing tests whenever any file changes autoWatch = true; // Start these browsers, currently available: // - Chrome // - ChromeCanary // - Firefox // - Opera // - Safari (only Mac) // - PhantomJS // - IE (only Windows) browsers = ['PhantomJS']; // If browser does not capture in given timeout [ms], kill it captureTimeout = 60000; // Continuous Integration mode // if true, it capture browsers, run tests and exit singleRun = false;
$(document).delegate('.storage_graph_link', 'click', function(e){ var anchor = this, el = $(anchor), id = el.attr('data-status'); if(e.ctrlKey || e.metaKey){ return true; }else{ e.preventDefault(); } var cell = document.getElementById(id); var text = el.html(); if (text == '[:: show ::]') { anchor.innerHTML = '[:: hide ::]'; if (cell.nodeName == 'IMG') { // <img src='...'/> cell.src=anchor.href; } else { $.ajax({ type: "get", url: anchor.href, success : function(response, textStatus) { cell.style.display = 'block'; cell.parentNode.style.display = 'block'; cell.innerHTML = response; var data = $('#countTrendMeta',cell).text(); graphLineChart($('#countTrend',cell)[0],eval('('+data+')')); data = $('#longTrendMeta',cell).text(); graphLineChart($('#longTrend',cell)[0],eval('('+data+')')); data = $('#avgTrendMeta',cell).text(); graphLineChart($('#avgTrend',cell)[0],eval('('+data+')')); data = $('#errorTrendMeta',cell).text(); graphLineChart($('#errorTrend',cell)[0],eval('('+data+')')); data = $('#piechartMeta',cell).text(); graphPieChart($('#piechart',cell)[0],eval('('+data+')')); } }); } } else { anchor.innerHTML = '[:: show ::]'; cell.style.display = 'none'; cell.parentNode.style.display = 'none'; } })
description("Test path animation where coordinate modes of start and end differ. You should see PASS messages"); createSVGTestCase(); // Setup test document var path = createSVGElement("path"); path.setAttribute("id", "path"); path.setAttribute("d", "M -30 -30 q 30 0 30 30 t -30 30 Z"); path.setAttribute("fill", "green"); path.setAttribute("onclick", "executeTest()"); path.setAttribute("transform", "translate(50, 50)"); var animate = createSVGElement("animate"); animate.setAttribute("id", "animation"); animate.setAttribute("attributeName", "d"); animate.setAttribute("from", "M -30 -30 q 30 0 30 30 t -30 30 Z"); animate.setAttribute("to", "M -30 -30 Q 30 -30 30 0 T -30 30 Z"); animate.setAttribute("begin", "click"); animate.setAttribute("dur", "4s"); path.appendChild(animate); rootSVGElement.appendChild(path); // Setup animation test function sample1() { // Check initial/end conditions shouldBeEqualToString("path.getAttribute('d')", "M -30 -30 q 30 0 30 30 t -30 30 Z"); } function sample2() { shouldBeEqualToString("path.getAttribute('d')", "M -30 -30 q 37.5 0 37.5 30 t -37.5 30 Z"); } function sample3() { shouldBeEqualToString("path.getAttribute('d')", "M -30 -30 Q 22.5 -30 22.5 0 T -30 30 Z"); } function sample4() { shouldBeEqualToString("path.getAttribute('d')", "M -30 -30 Q 29.9925 -30 29.9925 0 T -30 30 Z"); } function executeTest() { const expectedValues = [ // [animationId, time, sampleCallback] ["animation", 0.0, sample1], ["animation", 1.0, sample2], ["animation", 3.0, sample3], ["animation", 3.999, sample4], ["animation", 4.001, sample1] ]; runAnimationTest(expectedValues); } window.clickX = 40; window.clickY = 70; var successfullyParsed = true;
define( ({ "collapse": "Spusti traku s alatima editora", "expand": "Proširi traku s alatima editora" }) );
'use strict'; angular.module('openshiftConsole') .directive('overviewDeployment', function($location, $timeout, LabelFilter) { return { restrict: 'E', scope: { // Replication controller / deployment fields rc: '=', deploymentConfigId: '=', deploymentConfigMissing: '=', deploymentConfigDifferentService: '=', // Nested podTemplate fields imagesByDockerReference: '=', builds: '=', // Pods pods: '=' }, templateUrl: 'views/_overview-deployment.html', controller: function($scope) { $scope.viewPodsForDeployment = function(deployment) { $location.url("/project/" + deployment.metadata.namespace + "/browse/pods"); $timeout(function() { LabelFilter.setLabelSelector(new LabelSelector(deployment.spec.selector, true)); }, 1); }; } }; }) .directive('overviewMonopod', function() { return { restrict: 'E', scope: { pod: '=' }, templateUrl: 'views/_overview-monopod.html' }; }) .directive('podTemplate', function() { return { restrict: 'E', scope: { podTemplate: '=', imagesByDockerReference: '=', builds: '=' }, templateUrl: 'views/_pod-template.html' }; }) .directive('pods', function() { return { restrict: 'E', scope: { pods: '=', projectName: '@?' //TODO optional for now }, templateUrl: 'views/_pods.html', controller: function($scope) { $scope.phases = [ "Failed", "Pending", "Running", "Succeeded", "Unknown" ]; $scope.expandedPhase = null; $scope.warningsExpanded = false; $scope.expandPhase = function(phase, warningsExpanded, $event) { $scope.expandedPhase = phase; $scope.warningsExpanded = warningsExpanded; if ($event) { $event.stopPropagation(); } }; } }; }) .directive('podContent', function() { // sub-directive used by the pods directive return { restrict: 'E', scope: { pod: '=', troubled: '=' }, templateUrl: 'views/directives/_pod-content.html' }; }) .directive('triggers', function() { var hideBuildKey = function(build) { return 'hide/build/' + build.metadata.namespace + '/' + build.metadata.name; }; return { restrict: 'E', scope: { triggers: '=' }, link: function(scope) { scope.isBuildHidden = function(build) { var key = hideBuildKey(build); return sessionStorage.getItem(key) === 'true'; }; scope.hideBuild = function(build) { var key = hideBuildKey(build); sessionStorage.setItem(key, 'true'); }; }, templateUrl: 'views/_triggers.html' }; }) .directive('deploymentConfigMetadata', function() { return { restrict: 'E', scope: { deploymentConfigId: '=', exists: '=', differentService: '=' }, templateUrl: 'views/_deployment-config-metadata.html' }; });
/** * */ var obj = { num: 123, str: 'hello', }; obj.
function error_log(message, message_type, destination, extra_headers) { // http://kevin.vanzonneveld.net // + original by: Paul Hutchinson (http://restaurantthing.com/) // + revised by: Brett Zamir (http://brett-zamir.me) // % note 1: The dependencies, mail(), syslog(), and file_put_contents() // % note 1: are either not fullly implemented or implemented at all // - depends on: mail // - depends on: syslog // - depends on: file_put_contents // * example 1: error_log('Oops!'); // * returns 1: true var that = this, _sapi = function() { // SAPI logging (we treat console as the "server" logging; the // syslog option could do so potentially as well) if (!that.window.console || !that.window.console.log) { return false; } that.window.console.log(message); return true; }; message_type = message_type || 0; switch (message_type) { case 1: // Email var subject = 'PHP error_log message'; // Apparently no way to customize the subject return this.mail(destination, subject, message, extra_headers); case 2: // No longer an option in PHP, but had been to send via TCP/IP to 'destination' (name or IP:port) // use socket_create() and socket_send()? return false; case 0: // syslog or file depending on ini var log = this.php_js && this.php_js.ini && this.php_js.ini.error_log && this.php_js.ini.error_log.local_value; if (!log) { return _sapi(); } if (log === 'syslog') { return this.syslog(4, message); // presumably 'LOG_ERR' (4) is correct? } destination = log; // Fall-through case 3: // File logging var ret = this.file_put_contents(destination, message, 8); // FILE_APPEND (8) return ret === false ? false : true; case 4: // SAPI logging return _sapi(); default: // Unrecognized value return false; } return false; // Shouldn't get here }
/** * 404 (Not Found) Handler * * Usage: * return res.notFound(); * return res.notFound(err); * return res.notFound(err, 'some/specific/notfound/view'); * * e.g.: * ``` * return res.notFound(); * ``` * * NOTE: * If a request doesn't match any explicit routes (i.e. `config/routes.js`) * or route blueprints (i.e. "shadow routes", Sails will call `res.notFound()` * automatically. */ module.exports = function notFound (data, options) { // Get access to `req`, `res`, & `sails` var req = this.req; var res = this.res; var sails = req._sails; // Set status code res.status(404); // Log error to console if (data !== undefined) { sails.log.verbose('Sending 404 ("Not Found") response: \n',data); } else sails.log.verbose('Sending 404 ("Not Found") response'); // Only include errors in response if application environment // is not set to 'production'. In production, we shouldn't // send back any identifying information about errors. if (sails.config.environment === 'production' && sails.config.keepResponseErrors !== true) { data = undefined; } // If the user-agent wants JSON, always respond with JSON if (req.wantsJSON) { return res.jsonx(data); } // If second argument is a string, we take that to mean it refers to a view. // If it was omitted, use an empty object (`{}`) options = (typeof options === 'string') ? { view: options } : options || {}; // If a view was provided in options, serve it. // Otherwise try to guess an appropriate view, or if that doesn't // work, just send JSON. if (options.view) { return res.view(options.view, { data: data }); } // If no second argument provided, try to serve the default view, // but fall back to sending JSON(P) if any errors occur. else return res.view('404', { data: data }, function (err, html) { // If a view error occured, fall back to JSON(P). if (err) { // // Additionally: // • If the view was missing, ignore the error but provide a verbose log. if (err.code === 'E_VIEW_FAILED') { sails.log.verbose('res.notFound() :: Could not locate view for error page (sending JSON instead). Details: ',err); } // Otherwise, if this was a more serious error, log to the console with the details. else { sails.log.warn('res.notFound() :: When attempting to render error page view, an error occured (sending JSON instead). Details: ', err); } return res.jsonx(data); } return res.send(html); }); };
/** * Copyright 2015 IBM Corp. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. **/ var express = require("express"); var util = require("util"); var path = require("path"); var fs = require("fs"); var clone = require("clone"); var defaultContext = { page: { title: "Node-RED", favicon: "favicon.ico" }, header: { title: "Node-RED", image: "red/images/node-red.png" }, asset: { red: (process.env.NODE_ENV == "development")? "red/red.js":"red/red.min.js" } }; var themeContext = clone(defaultContext); var themeSettings = null; function serveFile(app,baseUrl,file) { try { var stats = fs.statSync(file); var url = baseUrl+path.basename(file); //console.log(url,"->",file); app.get(url,function(req, res) { res.sendfile(file); }); return "theme"+url; } catch(err) { //TODO: log filenotfound return null; } } module.exports = { init: function(settings) { var i; var url; themeContext = clone(defaultContext); themeSettings = null; if (settings.editorTheme) { var theme = settings.editorTheme; themeSettings = {}; var themeApp = express(); if (theme.page) { if (theme.page.css) { var styles = theme.page.css; if (!util.isArray(styles)) { styles = [styles]; } themeContext.page.css = []; for (i=0;i<styles.length;i++) { url = serveFile(themeApp,"/css/",styles[i]); if (url) { themeContext.page.css.push(url); } } } if (theme.page.favicon) { url = serveFile(themeApp,"/favicon/",theme.page.favicon) if (url) { themeContext.page.favicon = url; } } themeContext.page.title = theme.page.title || themeContext.page.title; } if (theme.header) { themeContext.header.title = theme.header.title || themeContext.header.title; if (theme.header.hasOwnProperty("url")) { themeContext.header.url = theme.header.url; } if (theme.header.hasOwnProperty("image")) { if (theme.header.image) { url = serveFile(themeApp,"/header/",theme.header.image); if (url) { themeContext.header.image = url; } } else { themeContext.header.image = null; } } } if (theme.deployButton) { if (theme.deployButton.type == "simple") { themeSettings.deployButton = { type: "simple" } if (theme.deployButton.label) { themeSettings.deployButton.label = theme.deployButton.label; } if (theme.deployButton.icon) { url = serveFile(themeApp,"/deploy/",theme.deployButton.icon); if (url) { themeSettings.deployButton.icon = url; } } } } if (theme.hasOwnProperty("userMenu")) { themeSettings.userMenu = theme.userMenu; } if (theme.login) { if (theme.login.image) { url = serveFile(themeApp,"/login/",theme.login.image); if (url) { themeContext.login = { image: url } } } } if (theme.hasOwnProperty("menu")) { themeSettings.menu = theme.menu; } return themeApp; } }, context: function() { return themeContext; }, settings: function() { return themeSettings; } }
// Random number generator - requires a PRNG backend, e.g. prng4.js // For best results, put code like // <body onClick='rng_seed_time();' onKeyPress='rng_seed_time();'> // in your main HTML document. var rng_state; var rng_pool; var rng_pptr; // Mix in a 32-bit integer into the pool function rng_seed_int(x) { rng_pool[rng_pptr++] ^= x & 255; rng_pool[rng_pptr++] ^= (x >> 8) & 255; rng_pool[rng_pptr++] ^= (x >> 16) & 255; rng_pool[rng_pptr++] ^= (x >> 24) & 255; if(rng_pptr >= rng_psize) rng_pptr -= rng_psize; } // Mix in the current time (w/milliseconds) into the pool function rng_seed_time() { rng_seed_int(new Date().getTime()); } // Initialize the pool with junk if needed. if(rng_pool == null) { rng_pool = new Array(); rng_pptr = 0; var t; if(window.crypto && window.crypto.getRandomValues) { // Use webcrypto if available var ua = new Uint8Array(32); window.crypto.getRandomValues(ua); for(t = 0; t < 32; ++t) rng_pool[rng_pptr++] = ua[t]; } if(navigator.appName == "Netscape" && navigator.appVersion < "5" && window.crypto) { // Extract entropy (256 bits) from NS4 RNG if available var z = window.crypto.random(32); for(t = 0; t < z.length; ++t) rng_pool[rng_pptr++] = z.charCodeAt(t) & 255; } while(rng_pptr < rng_psize) { // extract some randomness from Math.random() t = Math.floor(65536 * Math.random()); rng_pool[rng_pptr++] = t >>> 8; rng_pool[rng_pptr++] = t & 255; } rng_pptr = 0; rng_seed_time(); //rng_seed_int(window.screenX); //rng_seed_int(window.screenY); } function rng_get_byte() { if(rng_state == null) { rng_seed_time(); rng_state = prng_newstate(); rng_state.init(rng_pool); for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr) rng_pool[rng_pptr] = 0; rng_pptr = 0; //rng_pool = null; } // TODO: allow reseeding after first request return rng_state.next(); } function rng_get_bytes(ba) { var i; for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte(); } function SecureRandom() {} SecureRandom.prototype.nextBytes = rng_get_bytes;
/*before*/"use strict"; /*after*/foo();
tinyMCE.addI18n('th.advimage_dlg',{ tab_general:"\u0E17\u0E31\u0E48\u0E27\u0E44\u0E1B", tab_appearance:"\u0E25\u0E31\u0E01\u0E29\u0E13\u0E30", tab_advanced:"\u0E02\u0E31\u0E49\u0E19\u0E2A\u0E39\u0E07", general:"\u0E17\u0E31\u0E48\u0E27\u0E44\u0E1B", title:"\u0E0A\u0E37\u0E48\u0E2D", preview:"\u0E14\u0E39\u0E15\u0E31\u0E27\u0E2D\u0E22\u0E48\u0E32\u0E07", constrain_proportions:"\u0E04\u0E07\u0E2A\u0E31\u0E14\u0E2A\u0E48\u0E27\u0E19", langdir:"\u0E17\u0E34\u0E28\u0E17\u0E32\u0E07\u0E01\u0E32\u0E23\u0E2D\u0E48\u0E32\u0E19", langcode:"\u0E42\u0E04\u0E49\u0E14\u0E20\u0E32\u0E29\u0E32", long_desc:"\u0E23\u0E32\u0E22\u0E25\u0E30\u0E40\u0E2D\u0E35\u0E22\u0E14\u0E25\u0E34\u0E49\u0E07\u0E04\u0E4C", style:"\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A", classes:"\u0E04\u0E25\u0E32\u0E2A", ltr:"\u0E0B\u0E49\u0E32\u0E22\u0E44\u0E1B\u0E02\u0E27\u0E32", rtl:"\u0E02\u0E27\u0E32\u0E44\u0E1B\u0E0B\u0E49\u0E32\u0E22", id:"Id", map:"Image map", swap_image:"Swap image", alt_image:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E23\u0E39\u0E1B", mouseover:"\u0E40\u0E21\u0E37\u0E48\u0E2D\u0E40\u0E2D\u0E32\u0E40\u0E21\u0E49\u0E32\u0E2A\u0E4C\u0E0A\u0E35\u0E49", mouseout:"\u0E40\u0E21\u0E37\u0E48\u0E2D\u0E40\u0E2D\u0E32\u0E40\u0E21\u0E49\u0E32\u0E2A\u0E4C\u0E2D\u0E2D\u0E01", misc:"\u0E40\u0E1A\u0E47\u0E14\u0E40\u0E15\u0E25\u0E47\u0E14", example_img:"\u0E14\u0E39\u0E15\u0E31\u0E27\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E25\u0E31\u0E01\u0E29\u0E13\u0E30\u0E02\u0E2D\u0E07\u0E23\u0E39\u0E1B", missing_alt:"\u0E04\u0E38\u0E13\u0E41\u0E19\u0E48\u0E43\u0E08\u0E2B\u0E23\u0E37\u0E2D\u0E44\u0E21\u0E48\u0E27\u0E48\u0E32\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23\u0E14\u0E33\u0E40\u0E19\u0E34\u0E19\u0E01\u0E32\u0E23\u0E15\u0E48\u0E2D\u0E42\u0E14\u0E22\u0E44\u0E21\u0E48\u0E43\u0E2A\u0E48\u0E04\u0E33\u0E2D\u0E18\u0E34\u0E1A\u0E32\u0E22\u0E23\u0E39\u0E1B\u0E20\u0E32\u0E1E ? \u0E01\u0E32\u0E23\u0E43\u0E2A\u0E48\u0E04\u0E33\u0E2D\u0E18\u0E34\u0E1A\u0E32\u0E22\u0E23\u0E39\u0E1B\u0E17\u0E33\u0E43\u0E2B\u0E49\u0E1C\u0E39\u0E49\u0E1E\u0E34\u0E01\u0E32\u0E23\u0E17\u0E32\u0E07\u0E2A\u0E32\u0E22\u0E15\u0E32\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E23\u0E39\u0E49\u0E44\u0E14\u0E49\u0E27\u0E48\u0E32\u0E23\u0E39\u0E1B\u0E04\u0E38\u0E13\u0E04\u0E37\u0E2D\u0E23\u0E39\u0E1B\u0E2D\u0E30\u0E44\u0E23", dialog_title:"\u0E40\u0E1E\u0E34\u0E48\u0E21/\u0E41\u0E01\u0E49\u0E44\u0E02 image", src:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E23\u0E39\u0E1B", alt:"\u0E23\u0E32\u0E22\u0E25\u0E30\u0E40\u0E2D\u0E35\u0E22\u0E14\u0E23\u0E39\u0E1B", list:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E23\u0E39\u0E1B", border:"\u0E01\u0E23\u0E2D\u0E1A", dimensions:"\u0E15\u0E33\u0E41\u0E2B\u0E19\u0E48\u0E07", vspace:"\u0E23\u0E30\u0E22\u0E30\u0E2B\u0E48\u0E32\u0E07\u0E41\u0E19\u0E27\u0E15\u0E31\u0E49\u0E07", hspace:"\u0E23\u0E30\u0E22\u0E30\u0E2B\u0E48\u0E32\u0E07\u0E41\u0E19\u0E27\u0E19\u0E2D\u0E19", align:"\u0E15\u0E33\u0E41\u0E2B\u0E19\u0E48\u0E07\u0E08\u0E31\u0E14\u0E27\u0E32\u0E07", align_baseline:"\u0E40\u0E2A\u0E49\u0E19\u0E1E\u0E37\u0E49\u0E19", align_top:"\u0E1A\u0E19", align_middle:"\u0E01\u0E25\u0E32\u0E07", align_bottom:"\u0E25\u0E48\u0E32\u0E07", align_texttop:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23\u0E2D\u0E22\u0E39\u0E48\u0E1A\u0E19", align_textbottom:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23\u0E2D\u0E22\u0E39\u0E48\u0E25\u0E48\u0E32\u0E07", align_left:"\u0E0B\u0E49\u0E32\u0E22", align_right:"\u0E02\u0E27\u0E32", image_list:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E23\u0E39\u0E1B" });
/* ***** BEGIN LICENSE BLOCK ***** * Distributed under the BSD license: * * Copyright (c) 2012, Ajax.org B.V. * All rights reserved. * * 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 Ajax.org B.V. 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 AJAX.ORG B.V. 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. * * ***** END LICENSE BLOCK ***** */ /* THIS FILE WAS AUTOGENERATED BY mode.tmpl.js */ define(function(require, exports, module) { "use strict"; var oop = require("../lib/oop"); var TextMode = require("./text").Mode; var NSISHighlightRules = require("./nsis_highlight_rules").NSISHighlightRules; var FoldMode = require("./folding/cstyle").FoldMode; var Mode = function() { this.HighlightRules = NSISHighlightRules; this.foldingRules = new FoldMode(); this.$behaviour = this.$defaultBehaviour; }; oop.inherits(Mode, TextMode); (function() { this.lineCommentStart = [";", "#"]; this.blockComment = {start: "/*", end: "*/"}; this.$id = "ace/mode/nsis"; }).call(Mode.prototype); exports.Mode = Mode; });
import FixtureSet from '../../FixtureSet'; import TestCase from '../../TestCase'; import PasswordTestCase from './PasswordTestCase'; const React = window.React; function NumberInputs() { return ( <FixtureSet title="Password inputs"> <TestCase title="The show password icon" description={` Some browsers have an unmask password icon that React accidentally prevents the display of. `} affectedBrowsers="IE Edge, IE 11"> <TestCase.Steps> <li>Type any string (not an actual password)</li> </TestCase.Steps> <TestCase.ExpectedResult> The field should include the "unmasking password" icon. </TestCase.ExpectedResult> <PasswordTestCase /> </TestCase> </FixtureSet> ); } export default NumberInputs;
(function( $ ) { /** * Activity reply object for the activity index screen * * @since 1.6 */ var activityReply = { /** * Attach event handler functions to the relevant elements. * * @since 1.6 */ init : function() { $(document).on( 'click', '.row-actions a.reply', activityReply.open ); $(document).on( 'click', '#bp-activities-container a.cancel', activityReply.close ); $(document).on( 'click', '#bp-activities-container a.save', activityReply.send ); // Close textarea on escape $(document).on( 'keyup', '#bp-activities:visible', function( e ) { if ( 27 == e.which ) { activityReply.close(); } }); }, /** * Reveals the entire row when "reply" is pressed. * * @since 1.6 */ open : function( e ) { // Hide the container row, and move it to the new location var box = $( '#bp-activities-container' ).hide(); $( this ).parents( 'tr' ).after( box ); // Fade the whole row in, and set focus on the text area. box.fadeIn( '300' ); $( '#bp-activities' ).focus(); return false; }, /** * Hide and reset the entire row when "cancel", or escape, are pressed. * * @since 1.6 */ close : function( e ) { // Hide the container row $('#bp-activities-container').fadeOut( '200', function () { // Empty and unfocus the text area $( '#bp-activities' ).val( '' ).blur(); // Remove any error message and disable the spinner $( '#bp-replysubmit .error' ).html( '' ).hide(); $( '#bp-replysubmit .waiting' ).hide(); }); return false; }, /** * Submits "form" via AJAX back to WordPress. * * @since 1.6 */ send : function( e ) { // Hide any existing error message, and show the loading spinner $( '#bp-replysubmit .error' ).hide(); $( '#bp-replysubmit .waiting' ).show(); // Grab the nonce var reply = {}; reply['_ajax_nonce-bp-activity-admin-reply'] = $( '#bp-activities-container input[name="_ajax_nonce-bp-activity-admin-reply"]' ).val(); // Get the rest of the data reply.action = 'bp-activity-admin-reply'; reply.content = $( '#bp-activities' ).val(); reply.parent_id = $( '#bp-activities-container' ).prev().data( 'parent_id' ); reply.root_id = $( '#bp-activities-container' ).prev().data( 'root_id' ); // Make the AJAX call $.ajax({ data : reply, type : 'POST', url : ajaxurl, // Callbacks error : function( r ) { activityReply.error( r ); }, success : function( r ) { activityReply.show( r ); } }); return false; }, /** * send() error message handler * * @since 1.6 */ error : function( r ) { var er = r.statusText; $('#bp-replysubmit .waiting').hide(); if ( r.responseText ) { er = r.responseText.replace( /<.[^<>]*?>/g, '' ); } if ( er ) { $('#bp-replysubmit .error').html( er ).show(); } }, /** * send() success handler * * @since 1.6 */ show : function ( xml ) { var bg, id, response; // Handle any errors in the response if ( typeof( xml ) == 'string' ) { activityReply.error( { 'responseText': xml } ); return false; } response = wpAjax.parseAjaxResponse( xml ); if ( response.errors ) { activityReply.error( { 'responseText': wpAjax.broken } ); return false; } response = response.responses[0]; // Close and reset the reply row, and add the new Activity item into the list. $('#bp-activities-container').fadeOut( '200', function () { // Empty and unfocus the text area $( '#bp-activities' ).val( '' ).blur(); // Remove any error message and disable the spinner $( '#bp-replysubmit .error' ).html( '' ).hide(); $( '#bp-replysubmit .waiting' ).hide(); // Insert new activity item $( '#bp-activities-container' ).before( response.data ); // Get background colour and animate the flash id = $( '#activity-' + response.id ); bg = id.closest( '.widefat' ).css( 'backgroundColor' ); id.animate( { 'backgroundColor': '#CEB' }, 300 ).animate( { 'backgroundColor': bg }, 300 ); }); } }; $(document).ready( function () { // Create the Activity reply object after domready event activityReply.init(); // On the edit screen, unload the close/open toggle js for the action & content metaboxes $( '#bp_activity_action h3, #bp_activity_content h3' ).unbind( 'click' ); }); })(jQuery);
/** * @preserve SelectNav.js (v. 0.1) * Converts your <ul>/<ol> navigation into a dropdown list for small screens * https://github.com/lukaszfiszer/selectnav.js */ window.selectnav = (function(){ "use strict"; var selectnav = function(element,options){ element = document.getElementById(element); // return immediately if element doesn't exist if( ! element){ return; } // return immediately if element is not a list if( ! islist(element) ){ return; } // return immediately if no support for insertAdjacentHTML (Firefox 7 and under) if( ! ('insertAdjacentHTML' in window.document.documentElement) ){ return; } // add a js class to <html> tag document.documentElement.className += " js"; // retreive options and set defaults var o = options || {}, activeclass = o.activeclass || 'active', autoselect = typeof(o.autoselect) === "boolean" ? o.autoselect : true, nested = typeof(o.nested) === "boolean" ? o.nested : true, indent = o.indent || "→", label = o.label || "- Navigation -", // helper variables level = 0, selected = " selected "; // insert the freshly created dropdown navigation after the existing navigation element.insertAdjacentHTML('afterend', parselist(element) ); var nav = document.getElementById(id()); // autoforward on click if (nav.addEventListener) { nav.addEventListener('change',goTo); } if (nav.attachEvent) { nav.attachEvent('onchange', goTo); } return nav; function goTo(e){ // Crossbrowser issues - http://www.quirksmode.org/js/events_properties.html var targ; if (!e) e = window.event; if (e.target) targ = e.target; else if (e.srcElement) targ = e.srcElement; if (targ.nodeType === 3) // defeat Safari bug targ = targ.parentNode; if(targ.value) window.location.href = targ.value; } function islist(list){ var n = list.nodeName.toLowerCase(); return (n === 'ul' || n === 'ol'); } function id(nextId){ for(var j=1; document.getElementById('selectnav'+j);j++); return (nextId) ? 'selectnav'+j : 'selectnav'+(j-1); } function parselist(list){ // go one level down level++; var length = list.children.length, html = '', prefix = '', k = level-1 ; // return immediately if has no children if (!length) { return; } if(k) { while(k--){ prefix += indent; } prefix += " "; } for(var i=0; i < length; i++){ var link = list.children[i].children[0]; if(typeof(link) !== 'undefined'){ var text = link.innerText || link.textContent; var isselected = ''; if(activeclass){ isselected = link.className.search(activeclass) !== -1 || link.parentNode.className.search(activeclass) !== -1 ? selected : ''; } if(autoselect && !isselected){ isselected = link.href === document.URL ? selected : ''; } html += '<option value="' + link.href + '" ' + isselected + '>' + prefix + text +'</option>'; if(nested){ var subElement = list.children[i].children[1]; if( subElement && islist(subElement) ){ html += parselist(subElement); } } } } // adds label if(level === 1 && label) { html = '<option value="">' + label + '</option>' + html; } // add <select> tag to the top level of the list if(level === 1) { html = '<select class="selectnav" id="'+id(true)+'">' + html + '</select>'; } // go 1 level up level--; return html; } }; return function (element,options) { selectnav(element,options); }; })();
function __processArg(obj, key) { var arg = null; if (obj) { arg = obj[key] || null; delete obj[key]; } return arg; } function Controller() { require("alloy/controllers/BaseController").apply(this, Array.prototype.slice.call(arguments)); this.__controllerPath = "index"; this.args = arguments[0] || {}; if (arguments[0]) { { __processArg(arguments[0], "__parentSymbol"); } { __processArg(arguments[0], "$model"); } { __processArg(arguments[0], "__itemTemplate"); } } var $ = this; var exports = {}; $.__views.index = Ti.UI.createWindow({ backgroundColor: "#fff", fullscreen: false, exitOnClose: true, id: "index" }); $.__views.index && $.addTopLevelView($.__views.index); $.__views.__alloyId0 = Ti.UI.createLabel({ text: "This app is supported only on iOS", id: "__alloyId0" }); $.__views.index.add($.__views.__alloyId0); exports.destroy = function() {}; _.extend($, $.__views); $.index.open(); _.extend($, exports); } var Alloy = require("alloy"), Backbone = Alloy.Backbone, _ = Alloy._; module.exports = Controller;
/* Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ CKEDITOR.plugins.setLang("placeholder","sv",{title:"Innehållsrutans egenskaper",toolbar:"Skapa innehållsruta",name:"Innehållsrutans namn",invalidName:"Innehållsrutan får inte vara tom och får inte innehålla någon av följande tecken: [, ], \x3c, \x3e",pathName:"innehållsruta"});
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ActionThumbDown = (props) => ( <SvgIcon {...props}> <path d="M15 3H6c-.83 0-1.54.5-1.84 1.22l-3.02 7.05c-.09.23-.14.47-.14.73v1.91l.01.01L1 14c0 1.1.9 2 2 2h6.31l-.95 4.57-.03.32c0 .41.17.79.44 1.06L9.83 23l6.59-6.59c.36-.36.58-.86.58-1.41V5c0-1.1-.9-2-2-2zm4 0v12h4V3h-4z"/> </SvgIcon> ); ActionThumbDown = pure(ActionThumbDown); ActionThumbDown.displayName = 'ActionThumbDown'; ActionThumbDown.muiName = 'SvgIcon'; export default ActionThumbDown;
/** * Module dependencies. */ var Connection = require('../../connection') , mongo = require('mongodb') , Server = mongo.Server , ReplSetServers = mongo.ReplSetServers; /** * Connection for mongodb-native driver * * @api private */ function NativeConnection() { Connection.apply(this, arguments); }; /** * Inherits from Connection. */ NativeConnection.prototype.__proto__ = Connection.prototype; /** * Opens the connection. * * Example server options: * auto_reconnect (default: false) * poolSize (default: 1) * * Example db options: * pk - custom primary key factory to generate `_id` values * * Some of these may break Mongoose. Use at your own risk. You have been warned. * * @param {Function} callback * @api private */ NativeConnection.prototype.doOpen = function (fn) { var server; if (!this.db) { server = new mongo.Server(this.host, Number(this.port), this.options.server); this.db = new mongo.Db(this.name, server, this.options.db); } this.db.open(fn); return this; }; /** * Opens a set connection * * See description of doOpen for server options. In this case options.replset * is also passed to ReplSetServers. Some additional options there are * * reconnectWait (default: 1000) * retries (default: 30) * rs_name (default: false) * read_secondary (default: false) Are reads allowed from secondaries? * * @param {Function} fn * @api private */ NativeConnection.prototype.doOpenSet = function (fn) { if (!this.db) { var servers = [] , ports = this.port , self = this this.host.forEach(function (host, i) { servers.push(new mongo.Server(host, Number(ports[i]), self.options.server)); }); var server = new ReplSetServers(servers, this.options.replset); this.db = new mongo.Db(this.name, server, this.options.db); } this.db.open(fn); return this; }; /** * Closes the connection * * @param {Function} callback * @api private */ NativeConnection.prototype.doClose = function (fn) { this.db.close(); if (fn) fn(); return this; } /** * Module exports. */ module.exports = NativeConnection;
esprima.tokenize(null);
// Copyright JS Foundation and other contributors, http://js.foundation // // 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. print("help tests");
/** * angular-strap * @version v2.1.6 - 2015-01-11 * @link http://mgcrea.github.io/angular-strap * @author Olivier Louvignes (olivier@mg-crea.com) * @license MIT License, http://www.opensource.org/licenses/MIT */ "use strict";angular.module("mgcrea.ngStrap.helpers.dateFormatter",[]).service("$dateFormatter",["$locale","dateFilter",function(t,e){function r(t){return/(h+)([:\.])?(m+)[ ]?(a?)/i.exec(t).slice(1)}this.getDefaultLocale=function(){return t.id},this.getDatetimeFormat=function(e){return t.DATETIME_FORMATS[e]||e},this.weekdaysShort=function(){return t.DATETIME_FORMATS.SHORTDAY},this.hoursFormat=function(t){return r(t)[0]},this.minutesFormat=function(t){return r(t)[2]},this.timeSeparator=function(t){return r(t)[1]},this.showAM=function(t){return!!r(t)[3]},this.formatDate=function(t,r){return e(t,r)}}]); //# sourceMappingURL=date-formatter.min.js.map
/** * @author Richard Davey <rich@photonstorm.com> * @copyright 2016 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ /** * An Image is a light-weight object you can use to display anything that doesn't need physics or animation. * It can still rotate, scale, crop and receive input events. This makes it perfect for logos, backgrounds, simple buttons and other non-Sprite graphics. * * @class Phaser.Image * @extends PIXI.Sprite * @extends Phaser.Component.Core * @extends Phaser.Component.Angle * @extends Phaser.Component.Animation * @extends Phaser.Component.AutoCull * @extends Phaser.Component.Bounds * @extends Phaser.Component.BringToTop * @extends Phaser.Component.Crop * @extends Phaser.Component.Destroy * @extends Phaser.Component.FixedToCamera * @extends Phaser.Component.InputEnabled * @extends Phaser.Component.LifeSpan * @extends Phaser.Component.LoadTexture * @extends Phaser.Component.Overlap * @extends Phaser.Component.Reset * @extends Phaser.Component.ScaleMinMax * @extends Phaser.Component.Smoothed * @constructor * @param {Phaser.Game} game - A reference to the currently running game. * @param {number} [x=0] - The x coordinate of the Image. The coordinate is relative to any parent container this Image may be in. * @param {number} [y=0] - The y coordinate of the Image. The coordinate is relative to any parent container this Image may be in. * @param {string|Phaser.RenderTexture|Phaser.BitmapData|PIXI.Texture} [key] - The texture used by the Image during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture, BitmapData or PIXI.Texture. * @param {string|number} [frame] - If this Image is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index. */ Phaser.Image = function (game, x, y, key, frame) { x = x || 0; y = y || 0; key = key || null; frame = frame || null; /** * @property {number} type - The const type of this object. * @readonly */ this.type = Phaser.IMAGE; PIXI.Sprite.call(this, Phaser.Cache.DEFAULT); Phaser.Component.Core.init.call(this, game, x, y, key, frame); }; Phaser.Image.prototype = Object.create(PIXI.Sprite.prototype); Phaser.Image.prototype.constructor = Phaser.Image; Phaser.Component.Core.install.call(Phaser.Image.prototype, [ 'Angle', 'Animation', 'AutoCull', 'Bounds', 'BringToTop', 'Crop', 'Destroy', 'FixedToCamera', 'InputEnabled', 'LifeSpan', 'LoadTexture', 'Overlap', 'Reset', 'ScaleMinMax', 'Smoothed' ]); Phaser.Image.prototype.preUpdateInWorld = Phaser.Component.InWorld.preUpdate; Phaser.Image.prototype.preUpdateCore = Phaser.Component.Core.preUpdate; /** * Automatically called by World.preUpdate. * * @method Phaser.Image#preUpdate * @memberof Phaser.Image */ Phaser.Image.prototype.preUpdate = function() { if (!this.preUpdateInWorld()) { return false; } return this.preUpdateCore(); };
// FIXME: Tell people that this is a manifest file, real code should go into discrete files // FIXME: Tell people how Sprockets and CoffeeScript works // //= require jquery //= require jquery_ujs //= require_tree .
(function ($, Drupal) { /** * Toggle show/hide links for off canvas layout. */ Drupal.behaviors.omegaOffCanvasLayout = { attach: function (context) { $('#off-canvas').click(function(e) { if (!$(this).hasClass('is-visible')) { $(this).addClass('is-visible'); e.preventDefault(); e.stopPropagation(); } }); $('#off-canvas-hide').click(function(e) { $(this).parent().removeClass('is-visible'); e.preventDefault(); e.stopPropagation(); }); $('.l-page').click(function(e) { if($('#off-canvas').hasClass('is-visible') && $(e.target).closest('#off-canvas').length === 0) { $('#off-canvas').removeClass('is-visible'); e.stopPropagation(); } }); } }; })(jQuery, Drupal);
/*! MVW-Injection (0.2.5). (C) 2015 Xavier Boubert. MIT @license: en.wikipedia.org/wiki/MIT_License */ (function(root) { 'use strict'; var DependencyInjection = new (function DependencyInjection() { var _this = this, _interfaces = {}; function _formatFactoryFunction(factoryFunction) { if (typeof factoryFunction == 'function') { var funcString = factoryFunction .toString() // remove comments .replace(/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg, ''); var matches = funcString.match(/^function\s*[^\(]*\s*\(\s*([^\)]*)\)/m); if (matches === null || matches.length < 2) { factoryFunction = [factoryFunction]; } else { factoryFunction = matches[1] .replace(/\s/g, '') .split(',') .filter(function(arg) { return arg.trim().length > 0; }) .concat(factoryFunction); } return factoryFunction; } else { var factoryArrayCopy = []; for (var i = 0; i < factoryFunction.length; i++) { factoryArrayCopy.push(factoryFunction[i]); } factoryFunction = factoryArrayCopy; } return factoryFunction; } function Injector(instanceName) { function _getInjections(dependencies, name, customDependencies, noError) { var interfaces = _interfaces[name].interfacesSupported, injections = [], i, j; for (i = 0; i < dependencies.length; i++) { var factory = null; if (customDependencies && typeof customDependencies[dependencies[i]] != 'undefined') { factory = customDependencies[dependencies[i]]; } else { for (j = 0; j < interfaces.length; j++) { if (!_interfaces[interfaces[j]]) { if (noError) { return false; } throw new Error('DependencyInjection: "' + interfaces[j] + '" interface is not registered.'); } factory = _interfaces[interfaces[j]].factories[dependencies[i]]; if (factory) { factory.interfaceName = interfaces[j]; break; } } } if (factory) { if (!factory.instantiated) { var deps = _formatFactoryFunction(factory.result); factory.result = deps.pop(); var factoryInjections = _getInjections(deps, factory.interfaceName); factory.result = factory.result.apply(_this, factoryInjections); factory.instantiated = true; } injections.push(factory.result); } else { if (noError) { return false; } throw new Error('DependencyInjection: "' + dependencies[i] + '" is not registered or accessible in ' + name + '.'); } } return injections; } this.get = function(factoryName, noError) { var injections = _getInjections([factoryName], instanceName, null, noError); if (injections.length) { return injections[0]; } return false; }; this.invoke = function(thisArg, func, customDependencies) { var dependencies = _formatFactoryFunction(func); func = dependencies.pop(); if (customDependencies) { var formatcustomDependencies = {}, interfaceName, factory; for (interfaceName in customDependencies) { for (factory in customDependencies[interfaceName]) { formatcustomDependencies[factory] = { interfaceName: interfaceName, instantiated: false, result: customDependencies[interfaceName][factory] }; } } customDependencies = formatcustomDependencies; } var injections = _getInjections(dependencies, instanceName, customDependencies); return func.apply(thisArg, injections); }; } this.injector = {}; this.registerInterface = function(name, canInjectInterfaces) { if (_this[name]) { return _this; } _interfaces[name] = { interfacesSupported: (canInjectInterfaces || []).concat(name), factories: {} }; _this.injector[name] = new Injector(name); _this[name] = function DependencyInjectionFactory(factoryName, factoryFunction, replaceIfExists) { if (!replaceIfExists && _interfaces[name].factories[factoryName]) { return _this; } _interfaces[name].factories[factoryName] = { instantiated: false, result: factoryFunction }; return _this; }; return _this; }; })(); if (typeof module != 'undefined' && typeof module.exports != 'undefined') { module.exports = DependencyInjection; } else { root.DependencyInjection = DependencyInjection; } })(this);
/** * Copyright 2016 The AMP HTML 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. */ // Entry point into AMP for compilation with babel. Just loads amp.js and // Babel's helpers. import '../third_party/babel/custom-babel-helpers'; import './amp-shadow';
angular .module('menuDemoPosition', ['ngMaterial']) .config(function($mdIconProvider) { $mdIconProvider .iconSet("call", 'img/icons/sets/communication-icons.svg', 24) .iconSet("social", 'img/icons/sets/social-icons.svg', 24); }) .controller('PositionDemoCtrl', function DemoCtrl($mdDialog) { var originatorEv; this.openMenu = function($mdOpenMenu, ev) { originatorEv = ev; $mdOpenMenu(ev); }; this.announceClick = function(index) { $mdDialog.show( $mdDialog.alert() .title('You clicked!') .textContent('You clicked the menu item at index ' + index) .ok('Nice') .targetEvent(originatorEv) ); originatorEv = null; }; });
/** * @author mrdoob / http://mrdoob.com/ */ THREE.XHRLoader = function ( manager ) { this.cache = new THREE.Cache(); this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager; }; THREE.XHRLoader.prototype = { constructor: THREE.XHRLoader, load: function ( url, onLoad, onProgress, onError ) { var scope = this; var cached = scope.cache.get( url ); if ( cached !== undefined ) { if ( onLoad ) onLoad( cached ); return; } var request = new XMLHttpRequest(); request.open( 'GET', url, true ); request.addEventListener( 'load', function ( event ) { scope.cache.add( url, this.response ); if ( onLoad ) onLoad( this.response ); scope.manager.itemEnd( url ); }, false ); if ( onProgress !== undefined ) { request.addEventListener( 'progress', function ( event ) { onProgress( event ); }, false ); } if ( onError !== undefined ) { request.addEventListener( 'error', function ( event ) { onError( event ); }, false ); } if ( this.crossOrigin !== undefined ) request.crossOrigin = this.crossOrigin; if ( this.responseType !== undefined ) request.responseType = this.responseType; request.send( null ); scope.manager.itemStart( url ); }, setResponseType: function ( value ) { this.responseType = value; }, setCrossOrigin: function ( value ) { this.crossOrigin = value; } };
/** * ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v4.1.5 * @link http://www.ag-grid.com/ * @license MIT */ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var context_1 = require("./context/context"); var rowNode_1 = require("./entities/rowNode"); var renderedRow_1 = require("./rendering/renderedRow"); var utils_1 = require('./utils'); var SelectionRendererFactory = (function () { function SelectionRendererFactory() { } SelectionRendererFactory.prototype.createSelectionCheckbox = function (rowNode, addRenderedRowEventListener) { var eCheckbox = document.createElement('input'); eCheckbox.type = "checkbox"; eCheckbox.name = "name"; eCheckbox.className = 'ag-selection-checkbox'; utils_1.Utils.setCheckboxState(eCheckbox, rowNode.isSelected()); eCheckbox.addEventListener('click', function (event) { return event.stopPropagation(); }); eCheckbox.addEventListener('change', function () { var newValue = eCheckbox.checked; if (newValue) { rowNode.setSelected(newValue); } else { rowNode.setSelected(newValue); } }); var selectionChangedCallback = function () { return utils_1.Utils.setCheckboxState(eCheckbox, rowNode.isSelected()); }; rowNode.addEventListener(rowNode_1.RowNode.EVENT_ROW_SELECTED, selectionChangedCallback); addRenderedRowEventListener(renderedRow_1.RenderedRow.EVENT_RENDERED_ROW_REMOVED, function () { rowNode.removeEventListener(rowNode_1.RowNode.EVENT_ROW_SELECTED, selectionChangedCallback); }); return eCheckbox; }; SelectionRendererFactory = __decorate([ context_1.Bean('selectionRendererFactory'), __metadata('design:paramtypes', []) ], SelectionRendererFactory); return SelectionRendererFactory; })(); exports.SelectionRendererFactory = SelectionRendererFactory;
/** File Name: expression-014.js Corresponds To: ecma/Expressions/11.2.2-9-n.js ECMA Section: 11.2.2. The new operator Description: Author: christine@netscape.com Date: 12 november 1997 */ var SECTION = "expression-014.js"; var VERSION = "ECMA_1"; var TITLE = "The new operator"; var BUGNUMBER= "327765"; startTest(); writeHeaderToLog( SECTION + " "+ TITLE); var tc = 0; var testcases = new Array(); var BOOLEAN = new Boolean(); var result = "Failed"; var exception = "No exception thrown"; var expect = "Passed"; try { result = new BOOLEAN(); } catch ( e ) { result = expect; exception = e.toString(); } testcases[tc++] = new TestCase( SECTION, "BOOLEAN = new Boolean(); result = new BOOLEAN()" + " (threw " + exception +")", expect, result ); test();
"use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var AsyncAction_1 = require('./AsyncAction'); var AsyncScheduler_1 = require('./AsyncScheduler'); var VirtualTimeScheduler = (function (_super) { __extends(VirtualTimeScheduler, _super); function VirtualTimeScheduler(SchedulerAction, maxFrames) { var _this = this; if (SchedulerAction === void 0) { SchedulerAction = VirtualAction; } if (maxFrames === void 0) { maxFrames = Number.POSITIVE_INFINITY; } _super.call(this, SchedulerAction, function () { return _this.frame; }); this.maxFrames = maxFrames; this.frame = 0; this.index = -1; } /** * Prompt the Scheduler to execute all of its queued actions, therefore * clearing its queue. * @return {void} */ VirtualTimeScheduler.prototype.flush = function () { var _a = this, actions = _a.actions, maxFrames = _a.maxFrames; var error, action; while ((action = actions.shift()) && (this.frame = action.delay) <= maxFrames) { if (error = action.execute(action.state, action.delay)) { break; } } if (error) { while (action = actions.shift()) { action.unsubscribe(); } throw error; } }; VirtualTimeScheduler.frameTimeFactor = 10; return VirtualTimeScheduler; }(AsyncScheduler_1.AsyncScheduler)); exports.VirtualTimeScheduler = VirtualTimeScheduler; /** * We need this JSDoc comment for affecting ESDoc. * @ignore * @extends {Ignored} */ var VirtualAction = (function (_super) { __extends(VirtualAction, _super); function VirtualAction(scheduler, work, index) { if (index === void 0) { index = scheduler.index += 1; } _super.call(this, scheduler, work); this.scheduler = scheduler; this.work = work; this.index = index; this.index = scheduler.index = index; } VirtualAction.prototype.schedule = function (state, delay) { if (delay === void 0) { delay = 0; } if (!this.id) { return _super.prototype.schedule.call(this, state, delay); } // If an action is rescheduled, we save allocations by mutating its state, // pushing it to the end of the scheduler queue, and recycling the action. // But since the VirtualTimeScheduler is used for testing, VirtualActions // must be immutable so they can be inspected later. var action = new VirtualAction(this.scheduler, this.work); this.add(action); return action.schedule(state, delay); }; VirtualAction.prototype.requestAsyncId = function (scheduler, id, delay) { if (delay === void 0) { delay = 0; } this.delay = scheduler.frame + delay; var actions = scheduler.actions; actions.push(this); actions.sort(VirtualAction.sortActions); return true; }; VirtualAction.prototype.recycleAsyncId = function (scheduler, id, delay) { if (delay === void 0) { delay = 0; } return undefined; }; VirtualAction.sortActions = function (a, b) { if (a.delay === b.delay) { if (a.index === b.index) { return 0; } else if (a.index > b.index) { return 1; } else { return -1; } } else if (a.delay > b.delay) { return 1; } else { return -1; } }; return VirtualAction; }(AsyncAction_1.AsyncAction)); exports.VirtualAction = VirtualAction; //# sourceMappingURL=VirtualTimeScheduler.js.map
import css from './source.css'; __export__ = css; export default css;
'use strict'; module.exports = function (t, a) { var x; a.throws(function () { t(0); }, TypeError, "0"); a.throws(function () { t(false); }, TypeError, "false"); a.throws(function () { t(''); }, TypeError, "''"); a(t(x = {}), x, "Object"); a(t(x = function () {}), x, "Function"); a(t(x = new String('raz')), x, "String object"); //jslint: ignore a(t(x = new Date()), x, "Date"); a.throws(function () { t(); }, TypeError, "Undefined"); a.throws(function () { t(null); }, TypeError, "null"); };
/** * React Starter Kit (http://www.reactstarterkit.com/) * * Copyright © 2014-2015 Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ import path from 'path'; import cp from 'child_process'; /** * Launches Node.js/Express web server in a separate (forked) process. */ export default () => new Promise((resolve, reject) => { console.log('serve'); const server = cp.fork(path.join(__dirname, '../build/server.js'), { env: Object.assign({NODE_ENV: 'development'}, process.env) }); server.once('message', message => { if (message.match(/^online$/)) { resolve(); } }); server.once('error', err => reject(error)); process.on('exit', () => server.kill('SIGTERM')); });
/* Project: angular-gantt v1.2.8 - Gantt chart component for AngularJS Authors: Marco Schweighauser, Rémi Alvergnat License: MIT Homepage: https://www.angular-gantt.com Github: https://github.com/angular-gantt/angular-gantt.git */ (function(){ /* global ResizeSensor: false */ /* global ElementQueries: false */ 'use strict'; angular.module('gantt.resizeSensor', ['gantt']).directive('ganttResizeSensor', [function() { return { restrict: 'E', require: '^gantt', scope: { enabled: '=?' }, link: function(scope, element, attrs, ganttCtrl) { var api = ganttCtrl.gantt.api; // Load options from global options attribute. if (scope.options && typeof(scope.options.progress) === 'object') { for (var option in scope.options.progress) { scope[option] = scope.options[option]; } } if (scope.enabled === undefined) { scope.enabled = true; } function buildSensor() { var ganttElement = element.parent().parent().parent()[0].querySelectorAll('div.gantt')[0]; return new ResizeSensor(ganttElement, function() { ganttCtrl.gantt.$scope.ganttElementWidth = ganttElement.clientWidth; ganttCtrl.gantt.$scope.$apply(); }); } var rendered = false; api.core.on.rendered(scope, function() { rendered = true; if (sensor !== undefined) { sensor.detach(); } if (scope.enabled) { ElementQueries.update(); sensor = buildSensor(); } }); var sensor; scope.$watch('enabled', function(newValue) { if (rendered) { if (newValue && sensor === undefined) { ElementQueries.update(); sensor = buildSensor(); } else if (!newValue && sensor !== undefined) { sensor.detach(); sensor = undefined; } } }); } }; }]); }()); angular.module('gantt.resizeSensor.templates', []).run(['$templateCache', function($templateCache) { }]); //# sourceMappingURL=angular-gantt-resizeSensor-plugin.js.map
a enum;
Package.describe({ summary: "Github OAuth flow", version: "1.1.4-plugins.0" }); Package.onUse(function(api) { api.use('oauth2', ['client', 'server']); api.use('oauth', ['client', 'server']); api.use('http', ['server']); api.use('underscore', 'client'); api.use('templating', 'client'); api.use('random', 'client'); api.use('service-configuration', ['client', 'server']); api.export('Github'); api.addFiles( ['github_configure.html', 'github_configure.js'], 'client'); api.addFiles('github_server.js', 'server'); api.addFiles('github_client.js', 'client'); });
define( "dijit/form/nls/ca/validate", ({ invalidMessage: "El valor introduït no és vàlid", missingMessage: "Aquest valor és necessari", rangeMessage: "Aquest valor és fora de l'interval" }) );
declare var a: number; var b: typeof a = "..."; var c: typeof a = "..."; type T = number; var x:T = "..."; // what about recursive unions?
/** * Italian translation for bootstrap-datepicker * Enrico Rubboli <rubboli@gmail.com> */ ;(function($){ $.fn.datepicker.dates['it'] = { days: ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato", "Domenica"], daysShort: ["Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab", "Dom"], daysMin: ["Do", "Lu", "Ma", "Me", "Gi", "Ve", "Sa", "Do"], months: ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"], monthsShort: ["Gen", "Feb", "Mar", "Apr", "Mag", "Giu", "Lug", "Ago", "Set", "Ott", "Nov", "Dic"], today: "Oggi", weekStart: 1, format: "dd/mm/yyyy" }; }(jQuery));
'use strict'; var $ = require('jquery'); require('./github-node-cfg.js'); var AddonHelper = require('js/addonHelper'); $(window.contextVars.githubSettingsSelector).on('submit', AddonHelper.onSubmitSettings);
// https://github.com/isaacs/sax-js/issues/124 require(__dirname).test ( { xml : "<!-- stand alone comment -->" , expect : [ [ "comment", " stand alone comment " ] ] , strict : true , opt : {} } )
//// [symbolDeclarationEmit8.ts] var obj = { [Symbol.isConcatSpreadable]: 0 } //// [symbolDeclarationEmit8.js] var obj = { [Symbol.isConcatSpreadable]: 0 }; //// [symbolDeclarationEmit8.d.ts] declare var obj: { [Symbol.isConcatSpreadable]: number; };
/* Highcharts JS v5.0.13 (2017-07-27) (c) 2009-2017 Highsoft AS License: www.highcharts.com/license */ (function(a){"object"===typeof module&&module.exports?module.exports=a:a(Highcharts)})(function(a){a.theme={colors:["#FDD089","#FF7F79","#A0446E","#251535"],colorAxis:{maxColor:"#60042E",minColor:"#FDD089"},plotOptions:{map:{nullColor:"#fefefc"}},navigator:{series:{color:"#FF7F79",lineColor:"#A0446E"}}};a.setOptions(a.theme)});
/* HISTORY 02-Aug-10 L-05-28 $$1 pdeshmuk Created. */ function deleteItemsInSimpRep () { if (!pfcIsWindows()) netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); /*--------------------------------------------------------------------*\ Get the current assembly \*--------------------------------------------------------------------*/ var session = pfcGetProESession (); var assembly = session.CurrentModel; if (assembly.Type != pfcCreate ("pfcModelType").MDL_ASSEMBLY) throw new Error (0, "Current model is not an assembly"); /*--------------------------------------------------------------------*\ Get the current active simprep. \*--------------------------------------------------------------------*/ var simp_rep = assembly.GetActiveSimpRep(); /*--------------------------------------------------------------------*\ Get the current number of items \*--------------------------------------------------------------------*/ var simp_rep_instructions = simp_rep.GetInstructions(); var number_items = simp_rep_instructions.Items.Count; document.getElementById("numItems").value = number_items; /*--------------------------------------------------------------------*\ Deleting items \*--------------------------------------------------------------------*/ var simp_rep_instructions_item = simp_rep_instructions.Items.Item(number_items-1); simp_rep_instructions_item.Action = null; simp_rep.SetInstructions(simp_rep_instructions); number_items = simp_rep.GetInstructions().Items.Count; document.getElementById("numItems").value = number_items; return; } function addItemsInSimpRep () { if (!pfcIsWindows()) netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); /*--------------------------------------------------------------------*\ Get the current assembly \*--------------------------------------------------------------------*/ var session = pfcGetProESession (); var assembly = session.CurrentModel; if (assembly.Type != pfcCreate ("pfcModelType").MDL_ASSEMBLY) throw new Error (0, "Current model is not an assembly"); /*--------------------------------------------------------------------*\ Get the current active simprep. \*--------------------------------------------------------------------*/ var simp_rep = assembly.GetActiveSimpRep(); /*--------------------------------------------------------------------*\ Get the current number of items \*--------------------------------------------------------------------*/ var simp_rep_instructions = simp_rep.GetInstructions(); var number_items = simp_rep_instructions.Items.Count; document.getElementById("numItems").value = number_items; /*--------------------------------------------------------------------*\ Add an item \*--------------------------------------------------------------------*/ var item_path = pfcCreate ("intseq"); /*--------------------------------------------------------------------*\ Prompt for selection. \*--------------------------------------------------------------------*/ selOptions = pfcCreate ("pfcSelectionOptions").Create ("feature"); selOptions.MaxNumSels = parseInt (1); var selections = void null; try { selections = session.Select (selOptions, void null); } catch (err) { /*--------------------------------------------------------------------*\ Handle the situation where the user didn't make selections, but picked elsewhere instead. \*--------------------------------------------------------------------*/ if (pfcGetExceptionType (err) == "pfcXToolkitUserAbort" || pfcGetExceptionType (err) == "pfcXToolkitPickAbove") return (void null); else throw err; } if (selections.Count == 0) return (void null); var selection = selections.Item(0); var componentpath = selection.Path; var intseqIds = componentpath.ComponentIds; item_path.Append(intseqIds.Item(0)); simp_rep_comp_item_path = pfcCreate("pfcSimpRepCompItemPath").Create(item_path); simp_rep_item = pfcCreate("pfcSimpRepItem").Create(simp_rep_comp_item_path); simp_rep_action = pfcCreate("pfcSimpRepExclude").Create(); simp_rep_item.Action = simp_rep_action; simp_rep_instructions.Items.Append(simp_rep_item); simp_rep.SetInstructions(simp_rep_instructions); simp_rep_instructions = simp_rep.GetInstructions(); number_items = simp_rep_instructions.Items.Count; document.getElementById("numItems").value = number_items; return; }
function acosh (arg) { // http://kevin.vanzonneveld.net // + original by: Onno Marsman // * example 1: acosh(8723321.4); // * returns 1: 16.674657798418625 return Math.log(arg + Math.sqrt(arg * arg - 1)); }
/* This file is part of Ext JS 3.4 Copyright (c) 2011-2013 Sencha Inc Contact: http://www.sencha.com/contact GNU General Public License Usage This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html. If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact. Build date: 2013-04-03 15:07:25 */ /** * List compiled by mystix on the extjs.com forums. * Thank you Mystix! */ /* Slovak Translation by Michal Thomka * 14 April 2007 */ Ext.UpdateManager.defaults.indicatorText = '<div class="loading-indicator">Nahrávam...</div>'; if(Ext.View){ Ext.View.prototype.emptyText = ""; } if(Ext.grid.GridPanel){ Ext.grid.GridPanel.prototype.ddText = "{0} označených riadkov"; } if(Ext.TabPanelItem){ Ext.TabPanelItem.prototype.closeText = "Zavrieť túto záložku"; } if(Ext.form.Field){ Ext.form.Field.prototype.invalidText = "Hodnota v tomto poli je nesprávna"; } if(Ext.LoadMask){ Ext.LoadMask.prototype.msg = "Nahrávam..."; } Date.monthNames = [ "Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December" ]; Date.dayNames = [ "Nedeľa", "Pondelok", "Utorok", "Streda", "Štvrtok", "Piatok", "Sobota" ]; if(Ext.MessageBox){ Ext.MessageBox.buttonText = { ok : "OK", cancel : "Zrušiť", yes : "Áno", no : "Nie" }; } 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 || "d.m.Y"); }; } if(Ext.DatePicker){ Ext.apply(Ext.DatePicker.prototype, { todayText : "Dnes", minText : "Tento dátum je menší ako minimálny možný dátum", maxText : "Tento dátum je väčší ako maximálny možný dátum", disabledDaysText : "", disabledDatesText : "", monthNames : Date.monthNames, dayNames : Date.dayNames, nextText : 'Ďalší Mesiac (Control+Doprava)', prevText : 'Predch. Mesiac (Control+Doľava)', monthYearText : 'Vyberte Mesiac (Control+Hore/Dole pre posun rokov)', todayTip : "{0} (Medzerník)", format : "d.m.Y" }); } if(Ext.PagingToolbar){ Ext.apply(Ext.PagingToolbar.prototype, { beforePageText : "Strana", afterPageText : "z {0}", firstText : "Prvá Strana", prevText : "Predch. Strana", nextText : "Ďalšia Strana", lastText : "Posledná strana", refreshText : "Obnoviť", displayMsg : "Zobrazujem {0} - {1} z {2}", emptyMsg : 'Žiadne dáta' }); } if(Ext.form.TextField){ Ext.apply(Ext.form.TextField.prototype, { minLengthText : "Minimálna dĺžka pre toto pole je {0}", maxLengthText : "Maximálna dĺžka pre toto pole je {0}", blankText : "Toto pole je povinné", regexText : "", emptyText : null }); } if(Ext.form.NumberField){ Ext.apply(Ext.form.NumberField.prototype, { minText : "Minimálna hodnota pre toto pole je {0}", maxText : "Maximálna hodnota pre toto pole je {0}", nanText : "{0} je nesprávne číslo" }); } if(Ext.form.DateField){ Ext.apply(Ext.form.DateField.prototype, { disabledDaysText : "Zablokované", disabledDatesText : "Zablokované", minText : "Dátum v tomto poli musí byť až po {0}", maxText : "Dátum v tomto poli musí byť pred {0}", invalidText : "{0} nie je správny dátum - musí byť vo formáte {1}", format : "d.m.Y" }); } if(Ext.form.ComboBox){ Ext.apply(Ext.form.ComboBox.prototype, { loadingText : "Nahrávam...", valueNotFoundText : undefined }); } if(Ext.form.VTypes){ Ext.apply(Ext.form.VTypes, { emailText : 'Toto pole musí byť e-mailová adresa vo formáte "user@example.com"', urlText : 'Toto pole musí byť URL vo formáte "http:/'+'/www.example.com"', alphaText : 'Toto pole može obsahovať iba písmená a znak _', alphanumText : 'Toto pole može obsahovať iba písmená, čísla a znak _' }); } if(Ext.grid.GridView){ Ext.apply(Ext.grid.GridView.prototype, { sortAscText : "Zoradiť vzostupne", sortDescText : "Zoradiť zostupne", lockText : "Zamknúť stľpec", unlockText : "Odomknúť stľpec", columnsText : "Stľpce" }); } if(Ext.grid.PropertyColumnModel){ Ext.apply(Ext.grid.PropertyColumnModel.prototype, { nameText : "Názov", valueText : "Hodnota", dateFormat : "d.m.Y" }); } if(Ext.layout.BorderLayout && Ext.layout.BorderLayout.SplitRegion){ Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, { splitTip : "Potiahnite pre zmenu rozmeru", collapsibleSplitTip : "Potiahnite pre zmenu rozmeru. Dvojklikom schováte." }); }
var hat = require('../'); var assert = require('assert'); exports.rack = function () { var rack = hat.rack(4); var seen = {}; for (var i = 0; i < 8; i++) { var id = rack(); assert.ok(!seen[id], 'seen this id'); seen[id] = true; assert.ok(id.match(/^[0-9a-f]$/)); } assert.throws(function () { for (var i = 0; i < 10; i++) rack() }); }; exports.data = function () { var rack = hat.rack(64); var a = rack('a!'); var b = rack("it's a b!") var c = rack([ 'c', 'c', 'c' ]); assert.equal(rack.get(a), 'a!'); assert.equal(rack.get(b), "it's a b!"); assert.deepEqual(rack.get(c), [ 'c', 'c', 'c' ]); assert.equal(rack.hats[a], 'a!'); assert.equal(rack.hats[b], "it's a b!"); assert.deepEqual(rack.hats[c], [ 'c', 'c', 'c' ]); rack.set(a, 'AAA'); assert.equal(rack.get(a), 'AAA'); }; exports.expandBy = function () { var rack = hat.rack(4, 16, 4); var seen = {}; for (var i = 0; i < 8; i++) { var id = rack(); assert.ok(!seen[id], 'seen this id'); seen[id] = true; assert.ok(id.match(/^[0-9a-f]$/)); } for (var i = 0; i < 8; i++) { var id = rack(); assert.ok(!seen[id], 'seen this id'); seen[id] = true; assert.ok(id.match(/^[0-9a-f]{1,2}$/)); } for (var i = 0; i < 8; i++) { var id = rack(); assert.ok(!seen[id], 'seen this id'); seen[id] = true; assert.ok(id.match(/^[0-9a-f]{2}$/)); } };
import {Parser} from "./state" import {SourceLocation} from "./locutil" export class Node { constructor(parser, pos, loc) { this.type = "" this.start = pos this.end = 0 if (parser.options.locations) this.loc = new SourceLocation(parser, loc) if (parser.options.directSourceFile) this.sourceFile = parser.options.directSourceFile if (parser.options.ranges) this.range = [pos, 0] } } // Start an AST node, attaching a start offset. const pp = Parser.prototype pp.startNode = function() { return new Node(this, this.start, this.startLoc) } pp.startNodeAt = function(pos, loc) { return new Node(this, pos, loc) } // Finish an AST node, adding `type` and `end` properties. function finishNodeAt(node, type, pos, loc) { node.type = type node.end = pos if (this.options.locations) node.loc.end = loc if (this.options.ranges) node.range[1] = pos return node } pp.finishNode = function(node, type) { return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc) } // Finish node at given position pp.finishNodeAt = function(node, type, pos, loc) { return finishNodeAt.call(this, node, type, pos, loc) }
/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; class IgnorePlugin { constructor(resourceRegExp, contextRegExp) { this.resourceRegExp = resourceRegExp; this.contextRegExp = contextRegExp; this.checkIgnore = this.checkIgnore.bind(this); } /* * Only returns true if a "resourceRegExp" exists * and the resource given matches the regexp. */ checkResource(resource) { if(!this.resourceRegExp) { return false; } return this.resourceRegExp.test(resource); } /* * Returns true if contextRegExp does not exist * or if context matches the given regexp. */ checkContext(context) { if(!this.contextRegExp) { return true; } return this.contextRegExp.test(context); } /* * Returns true if result should be ignored. * false if it shouldn't. * * Not that if "contextRegExp" is given, both the "resourceRegExp" * and "contextRegExp" have to match. */ checkResult(result) { if(!result) { return true; } return this.checkResource(result.request) && this.checkContext(result.context); } checkIgnore(result, callback) { // check if result is ignored if(this.checkResult(result)) { return callback(); } return callback(null, result); } apply(compiler) { compiler.plugin("normal-module-factory", (nmf) => { nmf.plugin("before-resolve", this.checkIgnore); }); compiler.plugin("context-module-factory", (cmf) => { cmf.plugin("before-resolve", this.checkIgnore); }); } } module.exports = IgnorePlugin;
/*! * Connect - cookieParser * Copyright(c) 2010 Sencha Inc. * Copyright(c) 2011 TJ Holowaychuk * MIT Licensed */ /** * Module dependencies. */ var utils = require('./../utils') , cookie = require('cookie'); /** * Cookie parser: * * Parse _Cookie_ header and populate `req.cookies` * with an object keyed by the cookie names. Optionally * you may enabled signed cookie support by passing * a `secret` string, which assigns `req.secret` so * it may be used by other middleware. * * Examples: * * connect() * .use(connect.cookieParser('optional secret string')) * .use(function(req, res, next){ * res.end(JSON.stringify(req.cookies)); * }) * * @param {String} secret * @return {Function} * @api public */ module.exports = function cookieParser(secret){ return function cookieParser(req, res, next) { if (req.cookies) return next(); var cookies = req.headers.cookie; req.secret = secret; req.cookies = {}; req.signedCookies = {}; if (cookies) { try { req.cookies = cookie.parse(cookies); if (secret) { req.signedCookies = utils.parseSignedCookies(req.cookies, secret); req.signedCookies = utils.parseJSONCookies(req.signedCookies); } req.cookies = utils.parseJSONCookies(req.cookies); } catch (err) { err.status = 400; return next(err); } } next(); }; };
'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": [ "OD", "OT" ], "DAY": [ "Jumapil", "Wuok Tich", "Tich Ariyo", "Tich Adek", "Tich Ang\u2019wen", "Tich Abich", "Ngeso" ], "ERANAMES": [ "Kapok Kristo obiro", "Ka Kristo osebiro" ], "ERAS": [ "BC", "AD" ], "FIRSTDAYOFWEEK": 0, "MONTH": [ "Dwe mar Achiel", "Dwe mar Ariyo", "Dwe mar Adek", "Dwe mar Ang\u2019wen", "Dwe mar Abich", "Dwe mar Auchiel", "Dwe mar Abiriyo", "Dwe mar Aboro", "Dwe mar Ochiko", "Dwe mar Apar", "Dwe mar gi achiel", "Dwe mar Apar gi ariyo" ], "SHORTDAY": [ "JMP", "WUT", "TAR", "TAD", "TAN", "TAB", "NGS" ], "SHORTMONTH": [ "DAC", "DAR", "DAD", "DAN", "DAH", "DAU", "DAO", "DAB", "DOC", "DAP", "DGI", "DAG" ], "STANDALONEMONTH": [ "Dwe mar Achiel", "Dwe mar Ariyo", "Dwe mar Adek", "Dwe mar Ang\u2019wen", "Dwe mar Abich", "Dwe mar Auchiel", "Dwe mar Abiriyo", "Dwe mar Aboro", "Dwe mar Ochiko", "Dwe mar Apar", "Dwe mar gi achiel", "Dwe mar Apar gi ariyo" ], "WEEKENDRANGE": [ 5, 6 ], "fullDate": "EEEE, d MMMM y", "longDate": "d MMMM y", "medium": "d MMM y h:mm:ss a", "mediumDate": "d MMM y", "mediumTime": "h:mm:ss a", "short": "dd/MM/y h:mm a", "shortDate": "dd/MM/y", "shortTime": "h:mm a" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "Ksh", "DECIMAL_SEP": ".", "GROUP_SEP": ",", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "-", "negSuf": "\u00a4", "posPre": "", "posSuf": "\u00a4" } ] }, "id": "luo", "localeID": "luo", "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;} }); }]);
let arr = []; for(let i = 0; i < 10; i++) { for (let i = 0; i < 10; i++) { arr.push(() => i); } }
/** * Lo-Dash 2.4.1 (Custom Build) <http://lodash.com/> * Build: `lodash modularize modern exports="node" -o ./modern/` * Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/> * Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE> * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license <http://lodash.com/license> */ var baseIndexOf = require('./baseIndexOf'), cacheIndexOf = require('./cacheIndexOf'), createCache = require('./createCache'), getArray = require('./getArray'), largeArraySize = require('./largeArraySize'), releaseArray = require('./releaseArray'), releaseObject = require('./releaseObject'); /** * The base implementation of `_.uniq` without support for callback shorthands * or `thisArg` binding. * * @private * @param {Array} array The array to process. * @param {boolean} [isSorted=false] A flag to indicate that `array` is sorted. * @param {Function} [callback] The function called per iteration. * @returns {Array} Returns a duplicate-value-free array. */ function baseUniq(array, isSorted, callback) { var index = -1, indexOf = baseIndexOf, length = array ? array.length : 0, result = []; var isLarge = !isSorted && length >= largeArraySize, seen = (callback || isLarge) ? getArray() : result; if (isLarge) { var cache = createCache(seen); indexOf = cacheIndexOf; seen = cache; } while (++index < length) { var value = array[index], computed = callback ? callback(value, index, array) : value; if (isSorted ? !index || seen[seen.length - 1] !== computed : indexOf(seen, computed) < 0 ) { if (callback || isLarge) { seen.push(computed); } result.push(value); } } if (isLarge) { releaseArray(seen.array); releaseObject(seen); } else if (callback) { releaseArray(seen); } return result; } module.exports = baseUniq;
import { Duration, isDuration } from './constructor'; import toInt from '../utils/to-int'; import hasOwnProp from '../utils/has-own-prop'; import { DATE, HOUR, MINUTE, SECOND, MILLISECOND } from '../units/constants'; import { cloneWithOffset } from '../units/offset'; import { createLocal } from '../create/local'; // ASP.NET json date format regex var aspNetRegex = /^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/; // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere // and further modified to allow for strings containing both week and day var isoRegex = /^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/; export function createDuration (input, key) { var duration = input, // matching against regexp is expensive, do it on demand match = null, sign, ret, diffRes; if (isDuration(input)) { duration = { ms : input._milliseconds, d : input._days, M : input._months }; } else if (typeof input === 'number') { duration = {}; if (key) { duration[key] = input; } else { duration.milliseconds = input; } } else if (!!(match = aspNetRegex.exec(input))) { sign = (match[1] === '-') ? -1 : 1; duration = { y : 0, d : toInt(match[DATE]) * sign, h : toInt(match[HOUR]) * sign, m : toInt(match[MINUTE]) * sign, s : toInt(match[SECOND]) * sign, ms : toInt(match[MILLISECOND]) * sign }; } else if (!!(match = isoRegex.exec(input))) { sign = (match[1] === '-') ? -1 : 1; duration = { y : parseIso(match[2], sign), M : parseIso(match[3], sign), w : parseIso(match[4], sign), d : parseIso(match[5], sign), h : parseIso(match[6], sign), m : parseIso(match[7], sign), s : parseIso(match[8], sign) }; } else if (duration == null) {// checks for null or undefined duration = {}; } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) { diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to)); duration = {}; duration.ms = diffRes.milliseconds; duration.M = diffRes.months; } ret = new Duration(duration); if (isDuration(input) && hasOwnProp(input, '_locale')) { ret._locale = input._locale; } return ret; } createDuration.fn = Duration.prototype; function parseIso (inp, sign) { // We'd normally use ~~inp for this, but unfortunately it also // converts floats to ints. // inp may be undefined, so careful calling replace on it. var res = inp && parseFloat(inp.replace(',', '.')); // apply sign while we're at it return (isNaN(res) ? 0 : res) * sign; } function positiveMomentsDifference(base, other) { var res = {milliseconds: 0, months: 0}; res.months = other.month() - base.month() + (other.year() - base.year()) * 12; if (base.clone().add(res.months, 'M').isAfter(other)) { --res.months; } res.milliseconds = +other - +(base.clone().add(res.months, 'M')); return res; } function momentsDifference(base, other) { var res; if (!(base.isValid() && other.isValid())) { return {milliseconds: 0, months: 0}; } other = cloneWithOffset(other, base); if (base.isBefore(other)) { res = positiveMomentsDifference(base, other); } else { res = positiveMomentsDifference(other, base); res.milliseconds = -res.milliseconds; res.months = -res.months; } return res; }
/* jshint -W100 */ /* jslint maxlen: 86 */ define(function () { // Farsi (Persian) return { errorLoading: function () { return 'امکان بارگذاری نتایج وجود ندارد.'; }, inputTooLong: function (args) { var overChars = args.input.length - args.maximum; var message = 'لطفاً ' + overChars + ' کاراکتر را حذف نمایید'; return message; }, inputTooShort: function (args) { var remainingChars = args.minimum - args.input.length; var message = 'لطفاً تعداد ' + remainingChars + ' کاراکتر یا بیشتر وارد نمایید'; return message; }, loadingMore: function () { return 'در حال بارگذاری نتایج بیشتر...'; }, maximumSelected: function (args) { var message = 'شما تنها می‌توانید ' + args.maximum + ' آیتم را انتخاب نمایید'; return message; }, noResults: function () { return 'هیچ نتیجه‌ای یافت نشد'; }, searching: function () { return 'در حال جستجو...'; } }; });
//! moment.js locale configuration //! locale : belarusian (be) //! author : Dmitry Demidov : https://github.com/demidov91 //! author: Praleska: http://praleska.pro/ //! Author : Menelion Elensúle : https://github.com/Oire import moment from '../moment'; function plural(word, num) { var forms = word.split('_'); return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]); } function relativeTimeWithPlural(number, withoutSuffix, key) { var format = { 'mm': withoutSuffix ? 'хвіліна_хвіліны_хвілін' : 'хвіліну_хвіліны_хвілін', 'hh': withoutSuffix ? 'гадзіна_гадзіны_гадзін' : 'гадзіну_гадзіны_гадзін', 'dd': 'дзень_дні_дзён', 'MM': 'месяц_месяцы_месяцаў', 'yy': 'год_гады_гадоў' }; if (key === 'm') { return withoutSuffix ? 'хвіліна' : 'хвіліну'; } else if (key === 'h') { return withoutSuffix ? 'гадзіна' : 'гадзіну'; } else { return number + ' ' + plural(format[key], +number); } } function monthsCaseReplace(m, format) { var months = { 'nominative': 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split('_'), 'accusative': 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split('_') }, nounCase = (/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/).test(format) ? 'accusative' : 'nominative'; return months[nounCase][m.month()]; } function weekdaysCaseReplace(m, format) { var weekdays = { 'nominative': 'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split('_'), 'accusative': 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split('_') }, nounCase = (/\[ ?[Вв] ?(?:мінулую|наступную)? ?\] ?dddd/).test(format) ? 'accusative' : 'nominative'; return weekdays[nounCase][m.day()]; } export default moment.defineLocale('be', { months : monthsCaseReplace, monthsShort : 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split('_'), weekdays : weekdaysCaseReplace, weekdaysShort : 'нд_пн_ат_ср_чц_пт_сб'.split('_'), weekdaysMin : 'нд_пн_ат_ср_чц_пт_сб'.split('_'), longDateFormat : { LT : 'HH:mm', LTS : 'HH:mm:ss', L : 'DD.MM.YYYY', LL : 'D MMMM YYYY г.', LLL : 'D MMMM YYYY г., HH:mm', LLLL : 'dddd, D MMMM YYYY г., HH:mm' }, calendar : { sameDay: '[Сёння ў] LT', nextDay: '[Заўтра ў] LT', lastDay: '[Учора ў] LT', nextWeek: function () { return '[У] dddd [ў] LT'; }, lastWeek: function () { switch (this.day()) { case 0: case 3: case 5: case 6: return '[У мінулую] dddd [ў] LT'; case 1: case 2: case 4: return '[У мінулы] dddd [ў] LT'; } }, sameElse: 'L' }, relativeTime : { future : 'праз %s', past : '%s таму', s : 'некалькі секунд', m : relativeTimeWithPlural, mm : relativeTimeWithPlural, h : relativeTimeWithPlural, hh : relativeTimeWithPlural, d : 'дзень', dd : relativeTimeWithPlural, M : 'месяц', MM : relativeTimeWithPlural, y : 'год', yy : relativeTimeWithPlural }, meridiemParse: /ночы|раніцы|дня|вечара/, isPM : function (input) { return /^(дня|вечара)$/.test(input); }, meridiem : function (hour, minute, isLower) { if (hour < 4) { return 'ночы'; } else if (hour < 12) { return 'раніцы'; } else if (hour < 17) { return 'дня'; } else { return 'вечара'; } }, ordinalParse: /\d{1,2}-(і|ы|га)/, ordinal: function (number, period) { switch (period) { case 'M': case 'd': case 'DDD': case 'w': case 'W': return (number % 10 === 2 || number % 10 === 3) && (number % 100 !== 12 && number % 100 !== 13) ? number + '-і' : number + '-ы'; case 'D': return number + '-га'; default: return number; } }, week : { dow : 1, // Monday is the first day of the week. doy : 7 // The week that contains Jan 1st is the first week of the year. } });