text
stringlengths
2
6.14k
FD40.ready(function($) { var jQuery = $;// Catalan jQuery.timeago.settings.strings = { prefixAgo: "fa", prefixFromNow: "d'aqui a", suffixAgo: null, suffixFromNow: null, seconds: "menys d'1 minut", minute: "1 minut", minutes: "uns %d minuts", hour: "1 hora", hours: "unes %d hores", day: "1 dia", days: "%d dies", month: "aproximadament un mes", months: "%d mesos", year: "aproximadament un any", years: "%d anys" }; });
/* * JCE Editor 2.2.4 * @package JCE * @url http://www.joomlacontenteditor.net * @copyright Copyright (C) 2006 - 2012 Ryan Demmer. All rights reserved * @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html * @date 16 July 2012 * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * 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 General Public License for more details. * * NOTE : Javascript files have been compressed for speed and can be uncompressed using http://jsbeautifier.org/ */ tinyMCEPopup.requireLangPack();var ColorPicker={settings:{},init:function(){var self=this,ed=tinyMCEPopup.editor,color=tinyMCEPopup.getWindowArg('input_color')||'#FFFFFF';$('#tmp_color').val(color).colorpicker($.extend(this.settings,{dialog:false,insert:function(){return ColorPicker.insert();},close:function(){return tinyMCEPopup.close();}}));$('button#insert').button({icons:{primary:'ui-icon-check'}});$('#jce').css('display','block');},insert:function(){var color=$("#colorpicker_color").val(),f=tinyMCEPopup.getWindowArg('func');tinyMCEPopup.restoreSelection();if(f) f(color);tinyMCEPopup.close();}};tinyMCEPopup.onInit.add(ColorPicker.init,ColorPicker);
var express = require('express') var app = module.exports = express() app.get('/404', require('lib/site/layout')) app.get('*', function (req, res) { res.redirect('/404') })
// Set iterators produces entries in the order they were inserted. var set = Set(); var i; for (i = 7; i !== 1; i = i * 7 % 1117) set.add(i); assertEq(set.size, 557); i = 7; for (var v of set) { assertEq(v, i); i = i * 7 % 1117; } assertEq(i, 1);
/* * /MathJax/localization/br/br.js * * Copyright (c) 2009-2015 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.Localization.addTranslation( "br", null, { menuTitle: "brezhoneg", version: "2.5.0", isLoaded: true, domains: { _: { version: "2.5.0", isLoaded: true, strings: { MathProcessingError: "Fazi o treta\u00F1 ar formulenn", MathError: "Fazi er formulenn", LoadFile: "O karga\u00F1 %1", Loading: "O karga\u00F1", LoadFailed: "N'eus ket bet gallet karga\u00F1 %1", ProcessMath: "Treta\u00F1 ar formulenno\u00F9 : %1%%", Processing: "O treta\u00F1", TypesetMath: "Aoza\u00F1 formulenno\u00F9 : %1%%", Typesetting: "Aoza\u00F1", MathJaxNotSupported: "Ne c'hall ket ho merdeer ober gant MathJax" } }, FontWarnings: {}, "HTML-CSS": {}, HelpDialog: {}, MathML: {}, MathMenu: {}, TeX: {} }, plural: function( a ) { if (a % 10 === 1 && !(a % 100 === 11 || a % 100 === 71 || a % 100 === 91)) { return 1 } if (a % 10 === 2 && !(a % 100 === 12 || a % 100 === 72 || a % 100 === 92)) { return 2 } if ((a % 10 === 3 || a % 10 === 4 || a % 10 === 9) && !(10 <= a % 100 && a % 100 <= 19 || 70 <= a % 100 && a % 100 <= 79 || 90 <= a % 100 && a % 100 <= 99)) { return 3 } if (a !== 0 && a % 1000000 === 0) { return 4 } return 5 }, number: function( a ) { return a } } ); MathJax.Ajax.loadComplete( "[MathJax]/localization/br/br.js" );
/* Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'blockquote', 'af', { toolbar: 'Sitaatblok' } );
$(document).ready( function() { var $roles = $(".role_change"); $roles.each( function() { var str = $(this).find("input").val(); var en_role_index = getRoleIndex(str,"EN"); var cn_role_str = indexToRole(en_role_index,"CN"); $(this).find("span").append(cn_role_str); } ); } );
(function () { var pigKeywordsU = pigKeywordsL = pigTypesU = pigTypesL = pigBuiltinsU = pigBuiltinsL = []; var mimeMode = CodeMirror.mimeModes['text/x-pig']; Object.keys(mimeMode.keywords).forEach( function(w) { pigKeywordsU.push(w.toUpperCase()); pigKeywordsL.push(w.toLowerCase()); }); Object.keys(mimeMode.types).forEach( function(w) { pigTypesU.push(w.toUpperCase()); pigTypesL.push(w.toLowerCase()); }); Object.keys(mimeMode.builtins).forEach( function(w) { pigBuiltinsU.push(w.toUpperCase()); pigBuiltinsL.push(w.toLowerCase()); }); function forEach(arr, f) { for (var i = 0, e = arr.length; i < e; ++i) { f(arr[i]); } } function arrayContains(arr, item) { if (!Array.prototype.indexOf) { var i = arr.length; while (i--) { if (arr[i] === item) { return true; } } return false; } return arr.indexOf(item) != -1; } function scriptHint(editor, keywords, getToken) { // Find the token at the cursor var cur = editor.getCursor(), token = getToken(editor, cur), tprop = token; // If it's not a 'word-style' token, ignore the token. if (!/^[\w$_]*$/.test(token.string)) { token = tprop = {start: cur.ch, end: cur.ch, string: "", state: token.state, type: token.string == ":" ? "pig-type" : null}; } if (!context) var context = []; context.push(tprop); completionList = getCompletions(token, context); completionList = completionList.sort(); return {list: completionList, from: {line: cur.line, ch: token.start}, to: {line: cur.line, ch: token.end}}; } function toTitleCase(str) { return str.replace(/(?:^|\s)\w/g, function(match) { return match.toUpperCase(); }); } function getCompletions(token, context) { var found = [], start = token.string; function maybeAdd(str) { if (str.indexOf(start) == 0 && !arrayContains(found, str)) found.push(str); } function gatherCompletions(obj) { if(obj == ":") { forEach(pigTypesL, maybeAdd); } else { forEach(pigBuiltinsU, maybeAdd); forEach(pigBuiltinsL, maybeAdd); forEach(pigTypesU, maybeAdd); forEach(pigTypesL, maybeAdd); forEach(pigKeywordsU, maybeAdd); forEach(pigKeywordsL, maybeAdd); } } if (context) { // If this is a property, see if it belongs to some object we can // find in the current environment. var obj = context.pop(), base; if (obj.type == "pig-word") base = obj.string; else if(obj.type == "pig-type") base = ":" + obj.string; while (base != null && context.length) base = base[context.pop().string]; if (base != null) gatherCompletions(base); } return found; } CodeMirror.registerHelper("hint", "pig", function(cm, options) { return scriptHint(cm, pigKeywordsU, function (e, cur) {return e.getTokenAt(cur);}); }); })();
import {removeElement} from '#core/dom'; import {Layout_Enum, applyFillContent} from '#core/dom/layout'; import {Services} from '#service'; import {userAssert} from '#utils/log'; import {TAG as KEY_TAG} from './amp-embedly-key'; import {getIframe} from '../../../src/3p-frame'; import {listenFor} from '../../../src/iframe-helper'; /** * Component tag identifier. * @const {string} */ export const TAG = 'amp-embedly-card'; /** * Attribute name used to set api key with name * expected by embedly. * @const {string} */ const API_KEY_ATTR_NAME = 'data-card-key'; /** * Implementation of the amp-embedly-card component. * See {@link ../amp-embedly-card.md} for the spec. */ export class AmpEmbedlyCard extends AMP.BaseElement { /** @param {!AmpElement} element */ constructor(element) { super(element); /** @private {?HTMLIFrameElement} */ this.iframe_ = null; /** @private {?string} */ this.apiKey_ = null; } /** @override */ buildCallback() { userAssert( this.element.getAttribute('data-url'), 'The data-url attribute is required for <%s> %s', TAG, this.element ); const ampEmbedlyKeyElement = document.querySelector(KEY_TAG); if (ampEmbedlyKeyElement) { this.apiKey_ = ampEmbedlyKeyElement.getAttribute('value'); } } /** @override */ layoutCallback() { // Add optional paid api key attribute if provided // to remove embedly branding. if (this.apiKey_) { this.element.setAttribute(API_KEY_ATTR_NAME, this.apiKey_); } const iframe = getIframe(this.win, this.element, 'embedly'); iframe.title = this.element.title || 'Embedly card'; const opt_is3P = true; listenFor( iframe, 'embed-size', (data) => { this.forceChangeHeight(data['height']); }, opt_is3P ); applyFillContent(iframe); this.getVsync().mutate(() => { this.element.appendChild(iframe); }); this.iframe_ = iframe; return this.loadPromise(iframe); } /** @override */ unlayoutCallback() { if (this.iframe_) { removeElement(this.iframe_); this.iframe_ = null; } return true; } /** @override */ isLayoutSupported(layout) { return layout == Layout_Enum.RESPONSIVE; } /** * @param {boolean=} opt_onLayout * @override */ preconnectCallback(opt_onLayout) { Services.preconnectFor(this.win).url( this.getAmpDoc(), 'https://cdn.embedly.com', opt_onLayout ); } }
/** * Sitespeed.io - How speedy is your site? (https://www.sitespeed.io) * Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog * and other contributors * Released under the Apache 2.0 License */ 'use strict'; var util = require('../util/util'), RequestTiming = require('../requestTiming'), Stats = require('fast-stats').Stats, winston = require('winston'); var domains = {}; exports.processPage = function(pageData) { var log = winston.loggers.get('sitespeed.io'); var harData = []; if (pageData.browsertime && pageData.browsertime.har) { Array.prototype.push.apply(harData, pageData.browsertime.har); } if (pageData.webpagetest && pageData.webpagetest.har) { Array.prototype.push.apply(harData, pageData.webpagetest.har); } // Workaround to avoid issues when bt doesn't generate a har due to useProxy being set to false harData = harData.filter(function(har) { return !!har; }); var pageURL = util.getURLFromPageData(pageData); harData.forEach(function(har) { har.log.entries.forEach(function(entry) { var domain = domains[util.getHostname(entry.request.url)]; var total; if (domain) { if (entry.timings) { total = entry.timings.blocked + entry.timings.dns + entry.timings.connect + entry.timings.ssl + entry.timings .send + entry.timings.wait + entry.timings.receive; domain.blocked.add(entry.timings.blocked, entry.request.url, pageURL); domain.dns.add(entry.timings.dns, entry.request.url, pageURL); domain.connect.add(entry.timings.connect, entry.request.url, pageURL); domain.ssl.add(entry.timings.ssl, entry.request.url, pageURL); domain.send.add(entry.timings.send, entry.request.url, pageURL); domain.wait.add(entry.timings.wait, entry.request.url, pageURL); domain.receive.add(entry.timings.receive, entry.request.url, pageURL); domain.total.add(total, entry.request.url, pageURL); domain.accumulatedTime += total; } else { log.log('info', 'Missing timings in the HAR'); } } else { if (entry.timings) { total = entry.timings.blocked + entry.timings.dns + entry.timings.connect + entry.timings.ssl + entry.timings .send + entry.timings.wait + entry.timings.receive; domains[util.getHostname(entry.request.url)] = { domain: util.getHostname(entry.request.url), blocked: new RequestTiming(entry.timings.blocked, entry.request.url, pageURL), dns: new RequestTiming(entry.timings.dns, entry.request.url, pageURL), connect: new RequestTiming(entry.timings.connect, entry.request.url, pageURL), ssl: new RequestTiming(entry.timings.ssl, entry.request.url, pageURL), send: new RequestTiming(entry.timings.send, entry.request.url, pageURL), wait: new RequestTiming(entry.timings.wait, entry.request.url, pageURL), receive: new RequestTiming(entry.timings.receive, entry.request.url, pageURL), total: new RequestTiming(total, entry.request.url, pageURL), accumulatedTime: total }; } else { log.log('info', 'Missing timings in the HAR'); } } }); }); // we have HAR files with one page tested multiple times, // make sure we only get data from the first run // and we kind of add items & size for requests missing // but only for the first one var pageref = ''; // add request & size, just do it for the first run if (harData.length > 0) { harData[0].log.entries.forEach(function(entry) { if (pageref === '' || entry.pageref === pageref) { pageref = entry.pageref; var domain = domains[util.getHostname(entry.request.url)]; if (domain.count) { domain.count++; } else { domain.count = 1; } if (domain.size) { domain.size.total += entry.response.content.size; domain.size[util.getContentType(entry.response.content.mimeType)] += entry.response.content.size; } else { domain.size = { total: entry.response.content.size, css: 0, doc: 0, js: 0, image: 0, font: 0, flash: 0, unknown: 0 }; domain.size[util.getContentType(entry.response.content.mimeType)] = entry.response.content.size; } } else { // all other har files var daDomain = domains[util.getHostname(entry.request.url)]; if (!daDomain.count) { daDomain.count = 1; } if (!daDomain.size) { // this is not perfect, we will miss request in other HAR..s daDomain.size = { total: entry.response.content.size, css: 0, doc: 0, js: 0, image: 0, font: 0, flash: 0, unknown: 0 }; daDomain.size[util.getContentType(entry.response.content.mimeType)] = entry.response.content.size; } } }); } }; exports.generateResults = function() { var values = Object.keys(domains).map(function(key) { return domains[key]; }); return { id: 'domains', list: values }; }; exports.clear = function() { domains = {}; };
import type { Config } from '../src/core/config' import type VNode from '../src/core/vdom/vnode' import type Watcher from '../src/core/observer/watcher' declare interface Component { // constructor information static cid: number; static options: Object; // extend static extend: (options: Object) => Function; static superOptions: Object; static extendOptions: Object; static sealedOptions: Object; static super: Class<Component>; // assets static directive: (id: string, def?: Function | Object) => Function | Object | void; static component: (id: string, def?: Class<Component> | Object) => Class<Component>; static filter: (id: string, def?: Function) => Function | void; // public properties $el: any; // so that we can attach __vue__ to it $data: Object; $options: ComponentOptions; $parent: Component | void; $root: Component; $children: Array<Component>; $refs: { [key: string]: Component | Element | Array<Component | Element> | void }; $slots: { [key: string]: Array<VNode> }; $scopedSlots: { [key: string]: () => VNodeChildren }; $vnode: VNode; // the placeholder node for the component in parent's render tree $isServer: boolean; $props: Object; // public methods $mount: (el?: Element | string, hydrating?: boolean) => Component; $forceUpdate: () => void; $destroy: () => void; $set: <T>(target: Object | Array<T>, key: string | number, val: T) => T; $delete: <T>(target: Object | Array<T>, key: string | number) => void; $watch: (expOrFn: string | Function, cb: Function, options?: Object) => Function; $on: (event: string | Array<string>, fn: Function) => Component; $once: (event: string, fn: Function) => Component; $off: (event?: string | Array<string>, fn?: Function) => Component; $emit: (event: string, ...args: Array<mixed>) => Component; $nextTick: (fn: Function) => void | Promise<*>; $createElement: (tag?: string | Component, data?: Object, children?: VNodeChildren) => VNode; // private properties _uid: number; _name: string; // this only exists in dev mode _isVue: true; _self: Component; _renderProxy: Component; _renderContext: ?Component; _watcher: Watcher; _watchers: Array<Watcher>; _computedWatchers: { [key: string]: Watcher }; _data: Object; _props: Object; _events: Object; _inactive: boolean | null; _directInactive: boolean; _isMounted: boolean; _isDestroyed: boolean; _isBeingDestroyed: boolean; _vnode: ?VNode; // self root node _staticTrees: ?Array<VNode>; _hasHookEvent: boolean; _provided: ?Object; // private methods // lifecycle _init: Function; _mount: (el?: Element | void, hydrating?: boolean) => Component; _update: (vnode: VNode, hydrating?: boolean) => void; // rendering _render: () => VNode; __patch__: (a: Element | VNode | void, b: VNode) => any; // createElement // _c is internal that accepts `normalizationType` optimization hint _c: (vnode?: VNode, data?: VNodeData, children?: VNodeChildren, normalizationType?: number) => VNode | void; // renderStatic _m: (index: number, isInFor?: boolean) => VNode | VNodeChildren; // markOnce _o: (vnode: VNode | Array<VNode>, index: number, key: string) => VNode | VNodeChildren; // toString _s: (value: mixed) => string; // text to VNode _v: (value: string | number) => VNode; // toNumber _n: (value: string) => number | string; // empty vnode _e: () => VNode; // loose equal _q: (a: mixed, b: mixed) => boolean; // loose indexOf _i: (arr: Array<mixed>, val: mixed) => number; // resolveFilter _f: (id: string) => Function; // renderList _l: (val: mixed, render: Function) => ?Array<VNode>; // renderSlot _t: (name: string, fallback: ?Array<VNode>, props: ?Object) => ?Array<VNode>; // apply v-bind object _b: (data: any, value: any, asProp?: boolean) => VNodeData; // check custom keyCode _k: (eventKeyCode: number, key: string, builtInAlias: number | Array<number> | void) => boolean; // resolve scoped slots _u: (scopedSlots: ScopedSlotsData, res?: Object) => { [key: string]: Function }; // allow dynamic method registration [key: string]: any }
/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ // THIS CODE IS GENERATED - DO NOT MODIFY // See angular/tools/gulp-tasks/cldr/extract.js function plural(n) { if (n === 0) return 0; if (n === 1) return 1; if (n === 2) return 2; if (n % 100 === Math.floor(n % 100) && n % 100 >= 3 && n % 100 <= 10) return 3; if (n % 100 === Math.floor(n % 100) && n % 100 >= 11 && n % 100 <= 99) return 4; return 5; } export default [ 'ar-JO', [ ['ص', 'م'], , ], [['ص', 'م'], , ['صباحًا', 'مساءً']], [ ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], [ 'الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت' ], , ['أحد', 'إثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'] ], , [ ['ك', 'ش', 'آ', 'ن', 'أ', 'ح', 'ت', 'آ', 'أ', 'ت', 'ت', 'ك'], [ 'كانون الثاني', 'شباط', 'آذار', 'نيسان', 'أيار', 'حزيران', 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول' ], ], , [['ق.م', 'م'], , ['قبل الميلاد', 'ميلادي']], 6, [5, 6], ['d\u200f/M\u200f/y', 'dd\u200f/MM\u200f/y', 'd MMMM y', 'EEEE، d MMMM y'], ['h:mm a', 'h:mm:ss a', 'h:mm:ss a z', 'h:mm:ss a zzzz'], [ '{1} {0}', , , ], [ '.', ',', ';', '\u200e%\u200e', '\u200e+', '\u200e-', 'E', '×', '‰', '∞', 'ليس رقمًا', ':' ], ['#,##0.###', '#,##0%', '¤ #,##0.00', '#E0'], 'د.أ.\u200f', 'دينار أردني', plural ]; //# sourceMappingURL=ar-JO.js.map
// Declare internals var internals = {}; // Plugin registration exports.register = function (plugin, options, next) { plugin.route({ path: '/test2', method: 'GET', handler: function (request, reply) { reply('testing123'); } }); plugin.route({ path: '/test2/path', method: 'GET', handler: function (request, reply) { reply(plugin.path); } }); plugin.log('test', 'abc'); return next(); };
// Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- info: Compound Assignment Operator evaluates its operands from left to right. description: > The left-hand side expression is evaluated before the right-hand side. Left-hand side expression is MemberExpression: base[prop]. base is the undefined value. Check operator is "x <<= y". ---*/ function DummyError() { } assert.throws(DummyError, function() { var base = undefined; var prop = function() { throw new DummyError(); }; var expr = function() { $ERROR("right-hand side expression evaluated"); }; base[prop()] <<= expr(); }); assert.throws(TypeError, function() { var base = undefined; var prop = { toString: function() { $ERROR("property key evaluated"); } }; var expr = function() { $ERROR("right-hand side expression evaluated"); }; base[prop] <<= expr(); });
/*! * FileInput Polish Translations * * This file must be loaded after 'fileinput.js'. Patterns in braces '{}', or * any HTML markup tags in the messages must not be converted or translated. * * @see http://github.com/kartik-v/bootstrap-fileinput * * NOTE: this file must be saved in UTF-8 encoding. */ (function ($) { "use strict"; $.fn.fileinputLocales['pl'] = { fileSingle: 'plik', filePlural: 'pliki', browseLabel: 'Przeglądaj &hellip;', removeLabel: 'Usuń', removeTitle: 'Usuń zaznaczone pliki', cancelLabel: 'Przerwij', cancelTitle: 'Anuluj wysyłanie', pauseLabel: 'Wstrzymaj', pauseTitle: 'Wstrzymaj trwające przesyłanie', uploadLabel: 'Wgraj', uploadTitle: 'Wgraj zaznaczone pliki', msgNo: 'Nie', msgNoFilesSelected: 'Brak zaznaczonych plików', msgPaused: 'Wstrzymano', msgCancelled: 'Odwołany', msgPlaceholder: 'Wybierz {files} ...', msgZoomModalHeading: 'Szczegółowy podgląd', msgFileRequired: 'Musisz wybrać plik do wgrania.', msgSizeTooSmall: 'Plik "{name}" (<b>{size} KB</b>) jest zbyt mały i musi być większy niż <b>{minSize} KB</b>.', msgSizeTooLarge: 'Plik o nazwie "{name}" (<b>{size} KB</b>) przekroczył maksymalną dopuszczalną wielkość pliku wynoszącą <b>{maxSize} KB</b>.', msgFilesTooLess: 'Minimalna liczba plików do wgrania: <b>{n}</b>.', msgFilesTooMany: 'Liczba plików wybranych do wgrania w liczbie <b>({n})</b>, przekracza maksymalny dozwolony limit wynoszący <b>{m}</b>.', msgTotalFilesTooMany: 'Możesz wgrać maksymalnie <b>{m}</b> plików (wykryto <b>{n}</b>).', msgFileNotFound: 'Plik "{name}" nie istnieje!', msgFileSecured: 'Ustawienia zabezpieczeń uniemożliwiają odczyt pliku "{name}".', msgFileNotReadable: 'Plik "{name}" nie jest plikiem do odczytu.', msgFilePreviewAborted: 'Podgląd pliku "{name}" został przerwany.', msgFilePreviewError: 'Wystąpił błąd w czasie odczytu pliku "{name}".', msgInvalidFileName: 'Nieprawidłowe lub nieobsługiwane znaki w nazwie pliku "{name}".', msgInvalidFileType: 'Nieznany typ pliku "{name}". Tylko następujące rodzaje plików są dozwolone: "{types}".', msgInvalidFileExtension: 'Złe rozszerzenie dla pliku "{name}". Tylko następujące rozszerzenia plików są dozwolone: "{extensions}".', msgUploadAborted: 'Przesyłanie pliku zostało przerwane', msgUploadThreshold: 'Przetwarzanie &hellip;', msgUploadBegin: 'Rozpoczynanie &hellip;', msgUploadEnd: 'Gotowe!', msgUploadResume: 'Wznawianie przesyłania &hellip;', msgUploadEmpty: 'Brak poprawnych danych do przesłania.', msgUploadError: 'Błąd przesyłania', msgDeleteError: 'Błąd usuwania', msgProgressError: 'Błąd', msgValidationError: 'Błąd walidacji', msgLoading: 'Wczytywanie pliku {index} z {files} &hellip;', msgProgress: 'Wczytywanie pliku {index} z {files} - {name} - {percent}% zakończone.', msgSelected: '{n} Plików zaznaczonych', msgFoldersNotAllowed: 'Metodą przeciągnij i upuść, można przenosić tylko pliki. Pominięto {n} katalogów.', msgImageWidthSmall: 'Szerokość pliku obrazu "{name}" musi być co najmniej {size} px.', msgImageHeightSmall: 'Wysokość pliku obrazu "{name}" musi być co najmniej {size} px.', msgImageWidthLarge: 'Szerokość pliku obrazu "{name}" nie może przekraczać {size} px.', msgImageHeightLarge: 'Wysokość pliku obrazu "{name}" nie może przekraczać {size} px.', msgImageResizeError: 'Nie udało się uzyskać wymiaru obrazu, aby zmienić rozmiar.', msgImageResizeException: 'Błąd podczas zmiany rozmiaru obrazu.<pre>{errors}</pre>', msgAjaxError: 'Coś poczło nie tak podczas {operation}. Spróbuj ponownie!', msgAjaxProgressError: '{operation} nie powiodło się', msgDuplicateFile: 'Plik "{name}" o identycznym rozmiarze "{size} KB" został wgrany wcześniej. Pomijanie zduplikowanego pliku.', msgResumableUploadRetriesExceeded: 'Przekroczono limit <b>{max}</b> prób wgrania pliku <b>{file}</b>! Szczegóły błędu: <pre>{error}</pre>', msgPendingTime: 'Pozostało {time}', msgCalculatingTime: 'obliczanie pozostałego czasu', ajaxOperations: { deleteThumb: 'usuwanie pliku', uploadThumb: 'przesyłanie pliku', uploadBatch: 'masowe przesyłanie plików', uploadExtra: 'przesyłanie danych formularza' }, dropZoneTitle: 'Przeciągnij i upuść pliki tutaj &hellip;', dropZoneClickTitle: '<br>(lub kliknij tutaj i wybierz {files} z komputera)', fileActionSettings: { removeTitle: 'Usuń plik', uploadTitle: 'Przesyłanie pliku', uploadRetryTitle: 'Ponów', downloadTitle: 'Pobierz plik', zoomTitle: 'Pokaż szczegóły', dragTitle: 'Przenies / Ponownie zaaranżuj', indicatorNewTitle: 'Jeszcze nie przesłany', indicatorSuccessTitle: 'Dodane', indicatorErrorTitle: 'Błąd', indicatorPausedTitle: 'Przesyłanie zatrzymane', indicatorLoadingTitle: 'Przesyłanie &hellip;' }, previewZoomButtonTitles: { prev: 'Pokaż poprzedni plik', next: 'Pokaż następny plik', toggleheader: 'Włącz / wyłącz nagłówek', fullscreen: 'Włącz / wyłącz pełny ekran', borderless: 'Włącz / wyłącz tryb bez ramek', close: 'Zamknij szczegółowy widok' } }; })(window.jQuery);
var path = require('path'); var url = require('url'); var closure = require('closure-util'); var nomnom = require('nomnom'); var log = closure.log; var options = nomnom.options({ port: { abbr: 'p', 'default': 4000, help: 'Port for incoming connections', metavar: 'PORT' }, loglevel: { abbr: 'l', choices: ['silly', 'verbose', 'info', 'warn', 'error'], 'default': 'info', help: 'Log level', metavar: 'LEVEL' } }).parse(); /** @type {string} */ log.level = options.loglevel; log.info('ol3-cesium', 'Parsing dependencies ...'); var manager = new closure.Manager({ closure: true, // use the bundled Closure Library lib: [ 'src/**/*.js' ], ignoreRequires: '^ol\\.' }); manager.on('error', function(e) { log.error('ol3-cesium', e.message); }); manager.on('ready', function() { var server = new closure.Server({ manager: manager, loader: '/@loader' }); server.listen(options.port, function() { log.info('ol3-cesium', 'Listening on http://localhost:' + options.port + '/ (Ctrl+C to stop)'); }); server.on('error', function(err) { log.error('ol3-cesium', 'Server failed to start: ' + err.message); process.exit(1); }); });
/** * This is specifically for the builder where the * dependencies have been resolved and you just want * to access the component.jsons locally. */ var semver = require('semver'); var fs = require('graceful-fs'); var join = require('path').join; var resolve = require('path').resolve; var debug = require('debug')('remotes:local'); var Remote = require('../remote') module.exports = Local Remote.extend(Local) function Local(options) { if (!(this instanceof Local)) return new Local(options) options = Object.create(options || {}); this.out = resolve(options.out || options.dir || 'components') debug('checking local components at %s', this.out); Remote.call(this, options) } Local.prototype.name = 'local'; /** * Local resolution is a little different than other remotes. * In particular, if no `ref` is set, * we check for any version. * * @param {String} repo * @return {this} * @api public */ Local.prototype.resolve = function* (remotes, repo, ref) { debug('resolving local remote'); if (typeof remotes === 'string') { ref = repo; repo = remotes; } else if (Array.isArray(remotes) && !~remotes.indexOf('local')) { // if the current remote is not in this list, // then it's obviously not valid. return; } var folders = yield* this.folders(repo); // none installed if (!folders || !folders.length) return; // no specific version we care about if (!ref) return this; // exact tag version if (~folders.indexOf(ref)) return this; // check for equal semantic versions if (semver.maxSatisfying(folders.filter(valid), ref)) return this; } /** * Get the currently downloaded versions of a repo. * * @param {String} repo * @return {Array} folders * @api public */ Local.prototype.folders = function* (repo) { try { var frags = repo.toLowerCase().split('/'); // ignore malformed repos for now if (frags.length !== 2) return; var folder = join(this.out, frags[0], frags[1]); debug('checking folder: %s', folder); var folders = yield readdir(folder); debug('got folders: %s', folders.join(', ')); return folders.filter(noLeadingDot); } catch (err) { if (err.code === 'ENOENT') return; throw err; } } /** * Return the currently downloaded components' semantic versions. * * @param {String} repo * @return {Array} references * @api public */ Local.prototype._versions = function* (repo) { return yield* this.folders(repo); } /** * Return the existing component.json, if any. * @param {String} repo * @param {String} reference * @return {Object} component.json * @api public */ Local.prototype._json = function* (repo, ref) { var body; var filename = join(this.out, repo, ref, 'component.json'); try { body = yield read(filename); } catch (err) { if (err.code === 'ENOENT') return; throw err; } try { return JSON.parse(body); } catch (_err) { throw new Error('JSON parsing error with "' + filename + '"'); } } /** * NOT RELEVANT WITH THIS REMOTE */ Local.prototype._tree = function* () { /* jshint noyield:true */ } function valid(x) { return semver.valid(x, true); } function noLeadingDot(x) { return x[0] !== '.'; } function readdir(root) { return function (done) { fs.readdir(root, done) } } function read(filename) { return function (done) { fs.readFile(filename, 'utf8', done) } }
// Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import {createElementWithClassName} from 'chrome://resources/js/util.m.js'; /** * Create by |LineChart.LineChart|. * Create a dummy scrollbar to show the position of the line chart and to scroll * the line chart, so we can draw the visible part of the line chart only * instead of drawing the whole chart. * @const */ export class Scrollbar { constructor(/** function(): undefined */ callback) { /** @const {function(): undefined} - Handle the scrolling event. */ this.callback_ = callback; /** @type {number} - The range the scrollbar can scroll. */ this.range_ = 0; /** @type {number} - The current position of the scrollbar. */ this.position_ = 0; /** @type {number} - The real width of this scrollbar, in pixels. */ this.width_ = 0; /** @type {Element} - The outer div to show the scrollbar. */ this.outerDiv_ = createElementWithClassName('div', 'horizontal-scrollbar-outer'); this.outerDiv_.addEventListener('scroll', this.onScroll_.bind(this)); /** @type {Element} - The inner div to make outer div scrollable. */ this.innerDiv_ = createElementWithClassName('div', 'horizontal-scrollbar-inner'); this.outerDiv_.appendChild(this.innerDiv_); } /** * Scrolling event handler. */ onScroll_() { const /** number */ newPosition = this.outerDiv_.scrollLeft; if (newPosition == this.position_) return; this.position_ = newPosition; this.callback_(); } /** @return {Element} */ getRootDiv() { return this.outerDiv_; } /** * Return the height of scrollbar element. * @return {number} */ getHeight() { return this.outerDiv_.offsetHeight; } /** @return {number} */ getRange() { return this.range_; } /** * Position may be float point number because |document.scrollLeft| may be * float point number. * @return {number} */ getPosition() { return Math.round(this.position_); } /** * Change the size of the outer div and update the scrollbar position. * @param {number} width */ resize(width) { if (this.width_ == width) return; this.width_ = width; this.updateOuterDivWidth_(); } updateOuterDivWidth_() { this.constructor.setNodeWidth(this.outerDiv_, this.width_); } /** * Set the scrollable range to |range|. Use the inner div's width to control * the scrollable range. If position go out of range after range update, set * it to the boundary value. * @param {number} range */ setRange(range) { this.range_ = range; this.updateInnerDivWidth_(); if (range < this.position_) { this.position_ = range; this.updateScrollbarPosition_(); } } updateInnerDivWidth_() { const width = this.outerDiv_.clientWidth; this.constructor.setNodeWidth(this.innerDiv_, width + this.range_); } /** * @param {Element} node * @param {number} width */ static setNodeWidth(node, width) { node.style.width = width + 'px'; } /** * Set the scrollbar position to |position|. If the new position go out of * range, set it to the boundary value. * @param {number} position */ setPosition(position) { const /** number */ newPosition = Math.max(0, Math.min(position, this.range_)); this.position_ = newPosition; this.updateScrollbarPosition_(); } /** * Update the scrollbar position via Javascript scrollbar api. Position may * not be the same value as what we assigned even if the value is in the * range. See crbug.com/760425. */ updateScrollbarPosition_() { if (this.outerDiv_.scrollLeft == this.position_) return; this.outerDiv_.scrollLeft = this.position_; } /** * Return true if scrollbar is at the right edge of the chart. * @return {boolean} */ isScrolledToRightEdge() { /* |scrollLeft| may become a float point number even if we set it to some * integer value. If the distance to the right edge less than 2 pixels, we * consider that it is scrolled to the right edge. */ const scrollLeftErrorAmount = 2; return this.position_ + scrollLeftErrorAmount > this.range_; } /** * Scroll the scrollbar to the right edge. */ scrollToRightEdge() { this.setPosition(this.range_); } }
function safeMatchMedia(query) { var m = window.matchMedia(query); return !!m && m.matches; } define('capabilities', [], function() { var capabilities = { 'JSON': window.JSON && typeof JSON.parse == 'function', 'debug': (('' + document.location).indexOf('dbg') >= 0), 'debug_in_page': (('' + document.location).indexOf('dbginpage') >= 0), 'console': window.console && (typeof window.console.log == 'function'), 'replaceState': typeof history.replaceState === 'function', 'chromeless': window.locationbar && !window.locationbar.visible, 'localStorage': false, 'sessionStorage': false, 'webApps': !!(navigator.mozApps && navigator.mozApps.install), 'app_runtime': !!( navigator.mozApps && typeof navigator.mozApps.html5Implementation === 'undefined' ), 'fileAPI': !!window.FileReader, 'userAgent': navigator.userAgent, 'desktop': false, 'tablet': false, 'mobile': safeMatchMedia('(max-width: 600px)'), 'firefoxAndroid': (navigator.userAgent.indexOf('Firefox') != -1 && navigator.userAgent.indexOf('Android') != -1), 'touch': ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch, 'nativeScroll': (function() { return 'WebkitOverflowScrolling' in document.createElement('div').style; })(), 'performance': !!(window.performance || window.msPerformance || window.webkitPerformance || window.mozPerformance), 'navPay': !!navigator.mozPay, 'webactivities': !!(window.setMessageHandler || window.mozSetMessageHandler), 'firefoxOS': null // This is set below. }; // We're probably tablet if we have touch and we're larger than mobile. capabilities.tablet = capabilities.touch && safeMatchMedia('(min-width: 601px)'); // We're probably desktop if we don't have touch and we're larger than some arbitrary dimension. capabilities.desktop = !capabilities.touch && safeMatchMedia('(min-width: 673px)'); // Packaged-app installation are supported only on Firefox OS, so this is how we sniff. capabilities.gaia = !!(capabilities.mobile && navigator.mozApps && navigator.mozApps.installPackage); capabilities.getDeviceType = function() { return this.desktop ? 'desktop' : (this.tablet ? 'tablet' : 'mobile'); }; if (capabilities.tablet) { // If we're on tablet, then we're not on desktop. capabilities.desktop = false; } if (capabilities.mobile) { // If we're on mobile, then we're not on desktop nor tablet. capabilities.desktop = capabilities.tablet = false; } // Detect Firefox OS. // This will be true if the request is from a Firefox OS phone *or* // a desktop B2G build with the correct UA pref, such as this: // https://github.com/mozilla/r2d2b2g/blob/master/prosthesis/defaults/preferences/prefs.js capabilities.firefoxOS = capabilities.gaia && !capabilities.firefoxAndroid; try { if ('localStorage' in window && window.localStorage !== null) { capabilities.localStorage = true; } } catch (e) { } try { if ('sessionStorage' in window && window.sessionStorage !== null) { capabilities.sessionStorage = true; } } catch (e) { } return capabilities; }); z.capabilities = require('capabilities');
var expect = require('expect.js'); var path = require('path'); var fs = require('../extfs'); describe('extfs', function () { var rootPath = path.join(__dirname, '../'); it('should return all directories', function (done) { fs.getDirs(rootPath, function (err, dirs) { expect(dirs).to.be.an(Array); expect(dirs.length).to.be.greaterThan(0); done(); }); }); it('should return all directories sync', function () { var dirs = fs.getDirsSync(rootPath); expect(dirs).to.be.an(Array); expect(dirs.length > 0).to.be.ok(); }); it('should check if a file is empty', function (done) { var notEmptyFile = path.join(__dirname, '../README.md'); var emptyFile = './AN EMPTY FILE'; fs.isEmpty(notEmptyFile, function (empty) { expect(empty).to.be(false); fs.isEmpty(emptyFile, function (empty) { expect(empty).to.be(true); done(); }); }); }); it('should check if a file is empty sync', function () { var notEmptyFile = path.join(__dirname, '../README.md'); var emptyFile = './AN EMPTY FILE'; var empty = fs.isEmptySync(notEmptyFile); expect(empty).to.be(false); empty = fs.isEmptySync(emptyFile); expect(empty).to.be(true); }); it('should check if a directory is empty', function (done) { var notEmptyDir = __dirname; var emptyDir = './AN EMPTY DIR'; fs.isEmpty(notEmptyDir, function (empty) { expect(empty).to.be(false); fs.isEmpty(emptyDir, function (empty) { expect(empty).to.be(true); done(); }) }); }); it('should check if a directory is empty sync', function () { var notEmptyDir = __dirname; var emptyDir = './AN EMPTY DIR'; expect(fs.isEmptySync(notEmptyDir)).to.be(false); expect(fs.isEmptySync(emptyDir)).to.be(true); }); describe('remove directories', function () { var tmpPath = path.join(rootPath, 'tmp'); var folders = [ 'folder1', 'folder2', 'folder3' ]; var files = [ '1.txt', '2.txt', '3.txt' ]; folders = folders.map(function (folder) { return path.join(tmpPath, folder); }); /** * Create 3 folders with 3 files each */ beforeEach(function () { if (!fs.existsSync(tmpPath)) { fs.mkdirSync(tmpPath, '0755'); } folders.forEach(function (folder) { if (!fs.existsSync(folder)) { fs.mkdirSync(folder, '0755'); } files.forEach(function (file) { fs.writeFile(path.join(folder, file), 'file content'); }); }); }); it('should remove a non empty directory', function (done) { fs.remove(tmpPath, function (err) { expect(err).to.be(null); expect(fs.existsSync(tmpPath)).to.be(false); done(); }); }); it('should remove a non empty directory synchronously', function () { fs.removeSync(tmpPath); expect(fs.existsSync(tmpPath)).to.be(false); }); it('should remove an array of directories', function (done) { fs.remove(folders, function (err) { expect(err).to.be(null); expect(fs.existsSync(folders[0])).to.be(false); expect(fs.existsSync(folders[1])).to.be(false); expect(fs.existsSync(folders[2])).to.be(false); expect(fs.existsSync(tmpPath)).to.be(true); done(); }); }); it('should remove an array of directories synchronously', function () { fs.removeSync(folders); expect(fs.existsSync(folders[0])).to.be(false); expect(fs.existsSync(folders[1])).to.be(false); expect(fs.existsSync(folders[2])).to.be(false); expect(fs.existsSync(tmpPath)).to.be(true); }); }); it('should extends to fs', function () { expect(fs.readdir).to.be.a(Function); }); });
describe("BASIC CRUD SCENARIOS", function() { require("./basic"); }); describe("VALIDATE CRUD SCENARIOS", function() { require("./validation"); }); describe("REPORT SCENARIOS", function() { require("./report"); });
var mongodb = process.env['TEST_NATIVE'] != null ? require('../../lib/mongodb').native() : require('../../lib/mongodb').pure(); var testCase = require('../../deps/nodeunit').testCase, debug = require('util').debug, inspect = require('util').inspect, nodeunit = require('../../deps/nodeunit'), gleak = require('../../tools/gleak'), Db = mongodb.Db, Cursor = mongodb.Cursor, Collection = mongodb.Collection, Server = mongodb.Server, ServerManager = require('../../test/tools/server_manager').ServerManager, Step = require("../../deps/step/lib/step"); var MONGODB = 'integration_tests'; var client = new Db(MONGODB, new Server("127.0.0.1", 27017, {auto_reconnect: true, poolSize: 1}), {native_parser: (process.env['TEST_NATIVE'] != null)}); var serverManager = null; // Define the tests, we want them to run as a nested test so we only clean up the // db connection once var tests = testCase({ setUp: function(callback) { callback(); }, tearDown: function(callback) { // serverManager.stop(9, function(err, result) { callback(); // }); }, shouldCorrectlyKeepInsertingDocumentsWhenServerDiesAndComesUp : function(test) { var db1 = new Db('mongo-ruby-test-single-server', new Server("127.0.0.1", 27017, {auto_reconnect: true}), {native_parser: (process.env['TEST_NATIVE'] != null)}); // All inserted docs var docs = []; var errs = []; var insertDocs = []; // Start server serverManager = new ServerManager({auth:false, purgedirectories:true, journal:true}) serverManager.start(true, function() { db1.open(function(err, db) { // Startup the insert of documents var intervalId = setInterval(function() { db.collection('inserts', function(err, collection) { var doc = {timestamp:new Date().getTime()}; insertDocs.push(doc); // Insert document collection.insert(doc, {safe:{fsync:true}}, function(err, result) { // Save errors if(err != null) errs.push(err); if(err == null) { docs.push(result[0]); } }) }); }, 500); // Wait for a second and then kill the server setTimeout(function() { // Kill server instance serverManager.stop(9, function(err, result) { // Server down for 1 second setTimeout(function() { // Restart server serverManager = new ServerManager({auth:false, purgedirectories:false, journal:true}); serverManager.start(true, function() { // Wait for it setTimeout(function() { // Drop db db.dropDatabase(function(err, result) { // Close db db.close(); // Check that we got at least one error // test.ok(errs.length > 0); test.ok(docs.length > 0); test.ok(insertDocs.length > 0); // Finish up test.done(); }); }, 5000) }) }, 1000); }); }, 3000); }) }); }, shouldCorrectlyInsertKillServerFailThenRestartServerAndSucceed : function(test) { var db = new Db('test-single-server-recovery', new Server("127.0.0.1", 27017, {auto_reconnect: true}), {numberOfRetries:3, retryMiliSeconds:500, native_parser: (process.env['TEST_NATIVE'] != null)}); // All inserted docs var docs = []; var errs = []; var insertDocs = []; // Start server serverManager = new ServerManager({auth:false, purgedirectories:true, journal:true}) serverManager.start(true, function() { db.open(function(err, db) { // Add an error handler db.on("error", function(err) { console.log("----------------------------------------------- received error") console.dir(err) errs.push(err); }); db.collection('inserts', function(err, collection) { var doc = {timestamp:new Date().getTime(), a:1}; collection.insert(doc, {safe:true}, function(err, result) { test.equal(null, err); // Kill server instance serverManager.stop(9, function(err, result) { // Attemp insert (should timeout) var doc = {timestamp:new Date().getTime(), b:1}; collection.insert(doc, {safe:true}, function(err, result) { test.ok(err != null); test.equal(null, result); // Restart server serverManager = new ServerManager({auth:false, purgedirectories:false, journal:true}); serverManager.start(true, function() { // Attemp insert again collection.insert(doc, {safe:true}, function(err, result) { // Fetch the documents collection.find({b:1}).toArray(function(err, items) { test.equal(null, err); test.equal(1, items[0].b); test.done(); }); }); }); }); }); }) }); }); }); }, noGlobalsLeaked : function(test) { var leaks = gleak.detectNew(); test.equal(0, leaks.length, "global var leak detected: " + leaks.join(', ')); test.done(); } }) // Assign out tests module.exports = tests;
'use strict'; describe('Controller: AboutCtrl', function () { // load the controller's module beforeEach(module('e01App')); var AboutCtrl, scope; // Initialize the controller and a mock scope beforeEach(inject(function ($controller, $rootScope) { scope = $rootScope.$new(); AboutCtrl = $controller('AboutCtrl', { $scope: scope // place here mocked dependencies }); })); it('should attach a list of awesomeThings to the scope', function () { expect(AboutCtrl.awesomeThings.length).toBe(3); }); });
var searchData= [ ['digitalpin_2eh',['DigitalPin.h',['../_digital_pin_8h.html',1,'']]] ];
/** * @typedef {object} Phaser.Types.GameObjects.BitmapText.DisplayCallbackConfig * @since 3.0.0 * * @property {Phaser.GameObjects.DynamicBitmapText} parent - The Dynamic Bitmap Text object that owns this character being rendered. * @property {Phaser.Types.GameObjects.BitmapText.TintConfig} tint - The tint of the character being rendered. Always zero in Canvas. * @property {number} index - The index of the character being rendered. * @property {number} charCode - The character code of the character being rendered. * @property {number} x - The x position of the character being rendered. * @property {number} y - The y position of the character being rendered. * @property {number} scale - The scale of the character being rendered. * @property {number} rotation - The rotation of the character being rendered. * @property {any} data - Custom data stored with the character being rendered. */ /** * @callback Phaser.Types.GameObjects.BitmapText.DisplayCallback * * @param {Phaser.Types.GameObjects.BitmapText.DisplayCallbackConfig} display - Settings of the character that is about to be rendered. * * @return {Phaser.Types.GameObjects.BitmapText.DisplayCallbackConfig} Altered position, scale and rotation values for the character that is about to be rendered. */
define('lodash/internal/createWrapper', ['exports', 'lodash/internal/baseSetData', 'lodash/internal/createBindWrapper', 'lodash/internal/createHybridWrapper', 'lodash/internal/createPartialWrapper', 'lodash/internal/getData', 'lodash/internal/mergeData', 'lodash/internal/setData'], function (exports, _lodashInternalBaseSetData, _lodashInternalCreateBindWrapper, _lodashInternalCreateHybridWrapper, _lodashInternalCreatePartialWrapper, _lodashInternalGetData, _lodashInternalMergeData, _lodashInternalSetData) { 'use strict'; /** Used to compose bitmasks for wrapper metadata. */ var BIND_FLAG = 1, BIND_KEY_FLAG = 2, PARTIAL_FLAG = 32, PARTIAL_RIGHT_FLAG = 64; /** Used as the `TypeError` message for "Functions" methods. */ var FUNC_ERROR_TEXT = 'Expected a function'; /* Native method references for those with the same name as other `lodash` methods. */ var nativeMax = Math.max; /** * Creates a function that either curries or invokes `func` with optional * `this` binding and partially applied arguments. * * @private * @param {Function|string} func The function or method name to reference. * @param {number} bitmask The bitmask of flags. * The bitmask may be composed of the following flags: * 1 - `_.bind` * 2 - `_.bindKey` * 4 - `_.curry` or `_.curryRight` of a bound function * 8 - `_.curry` * 16 - `_.curryRight` * 32 - `_.partial` * 64 - `_.partialRight` * 128 - `_.rearg` * 256 - `_.ary` * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to be partially applied. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { var isBindKey = bitmask & BIND_KEY_FLAG; if (!isBindKey && typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } var length = partials ? partials.length : 0; if (!length) { bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG); partials = holders = undefined; } length -= holders ? holders.length : 0; if (bitmask & PARTIAL_RIGHT_FLAG) { var partialsRight = partials, holdersRight = holders; partials = holders = undefined; } var data = isBindKey ? undefined : (0, _lodashInternalGetData['default'])(func), newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity]; if (data) { (0, _lodashInternalMergeData['default'])(newData, data); bitmask = newData[1]; arity = newData[9]; } newData[9] = arity == null ? isBindKey ? 0 : func.length : nativeMax(arity - length, 0) || 0; if (bitmask == BIND_FLAG) { var result = (0, _lodashInternalCreateBindWrapper['default'])(newData[0], newData[2]); } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) { result = _lodashInternalCreatePartialWrapper['default'].apply(undefined, newData); } else { result = _lodashInternalCreateHybridWrapper['default'].apply(undefined, newData); } var setter = data ? _lodashInternalBaseSetData['default'] : _lodashInternalSetData['default']; return setter(result, newData); } exports['default'] = createWrapper; });
import Ember from 'ember'; export default Ember.Object.extend({ content: {}, contentLength: 0, add: function(obj) { var id = this.generateId(); this.get('content')[id] = obj; this.incrementProperty("contentLength"); return id; }, getObj: function(key) { var res = this.get('content')[key]; if (!res) { throw "no obj for key "+key; } return res; }, generateId: function() { var num = Math.random() * 1000000000000.0; num = parseInt(num); num = ""+num; return num; }, keys: function() { var res = []; for (var key in this.get('content')) { res.push(key); } return Ember.A(res); }, lengthBinding: "contentLength" });
/*! * Bootstrap-select v1.13.2 (https://developer.snapappointments.com/bootstrap-select) * * Copyright 2012-2018 SnapAppointments, LLC * Licensed under MIT (https://github.com/snapappointments/bootstrap-select/blob/master/LICENSE) */ (function (root, factory) { if (root === undefined && window !== undefined) root = window; if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module unless amdModuleId is set define(["jquery"], function (a0) { return (factory(a0)); }); } else if (typeof module === 'object' && module.exports) { // Node. Does not work with strict CommonJS, but // only CommonJS-like environments that support module.exports, // like Node. module.exports = factory(require("jquery")); } else { factory(root["jQuery"]); } }(this, function (jQuery) { (function ($) { $.fn.selectpicker.defaults = { noneSelectedText: 'Нищо избрано', noneResultsText: 'Няма резултат за {0}', countSelectedText: function (numSelected, numTotal) { return (numSelected == 1) ? "{0} избран елемент" : "{0} избрани елемента"; }, maxOptionsText: function (numAll, numGroup) { return [ (numAll == 1) ? 'Лимита е достигнат ({n} елемент максимум)' : 'Лимита е достигнат ({n} елемента максимум)', (numGroup == 1) ? 'Груповия лимит е достигнат ({n} елемент максимум)' : 'Груповия лимит е достигнат ({n} елемента максимум)' ]; }, selectAllText: 'Избери всички', deselectAllText: 'Размаркирай всички', multipleSeparator: ', ' }; })(jQuery); }));
// methods (functions of objects) // see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Method_definitions // http://www.ecma-international.org/ecma-262/6.0/#sec-method-definitions var Obj = { myMethod(a, b) { }, *myGenerator(a, b) { } }
"use strict"; tutao.provide('tutao.entity.base.PersistenceResourcePostReturn'); /** * @constructor * @param {Object=} data The json data to store in this entity. */ tutao.entity.base.PersistenceResourcePostReturn = function(data) { if (data) { this.updateData(data); } else { this.__format = "0"; this._generatedId = null; this._permissionListId = null; } this._entityHelper = new tutao.entity.EntityHelper(this); this.prototype = tutao.entity.base.PersistenceResourcePostReturn.prototype; }; /** * Updates the data of this entity. * @param {Object=} data The json data to store in this entity. */ tutao.entity.base.PersistenceResourcePostReturn.prototype.updateData = function(data) { this.__format = data._format; this._generatedId = data.generatedId; this._permissionListId = data.permissionListId; }; /** * The version of the model this type belongs to. * @const */ tutao.entity.base.PersistenceResourcePostReturn.MODEL_VERSION = '1'; /** * The encrypted flag. * @const */ tutao.entity.base.PersistenceResourcePostReturn.prototype.ENCRYPTED = false; /** * Provides the data of this instances as an object that can be converted to json. * @return {Object} The json object. */ tutao.entity.base.PersistenceResourcePostReturn.prototype.toJsonData = function() { return { _format: this.__format, generatedId: this._generatedId, permissionListId: this._permissionListId }; }; /** * The id of the PersistenceResourcePostReturn type. */ tutao.entity.base.PersistenceResourcePostReturn.prototype.TYPE_ID = 0; /** * The id of the generatedId attribute. */ tutao.entity.base.PersistenceResourcePostReturn.prototype.GENERATEDID_ATTRIBUTE_ID = 2; /** * The id of the permissionListId attribute. */ tutao.entity.base.PersistenceResourcePostReturn.prototype.PERMISSIONLISTID_ATTRIBUTE_ID = 3; /** * Sets the format of this PersistenceResourcePostReturn. * @param {string} format The format of this PersistenceResourcePostReturn. */ tutao.entity.base.PersistenceResourcePostReturn.prototype.setFormat = function(format) { this.__format = format; return this; }; /** * Provides the format of this PersistenceResourcePostReturn. * @return {string} The format of this PersistenceResourcePostReturn. */ tutao.entity.base.PersistenceResourcePostReturn.prototype.getFormat = function() { return this.__format; }; /** * Sets the generatedId of this PersistenceResourcePostReturn. * @param {string} generatedId The generatedId of this PersistenceResourcePostReturn. */ tutao.entity.base.PersistenceResourcePostReturn.prototype.setGeneratedId = function(generatedId) { this._generatedId = generatedId; return this; }; /** * Provides the generatedId of this PersistenceResourcePostReturn. * @return {string} The generatedId of this PersistenceResourcePostReturn. */ tutao.entity.base.PersistenceResourcePostReturn.prototype.getGeneratedId = function() { return this._generatedId; }; /** * Sets the permissionListId of this PersistenceResourcePostReturn. * @param {string} permissionListId The permissionListId of this PersistenceResourcePostReturn. */ tutao.entity.base.PersistenceResourcePostReturn.prototype.setPermissionListId = function(permissionListId) { this._permissionListId = permissionListId; return this; }; /** * Provides the permissionListId of this PersistenceResourcePostReturn. * @return {string} The permissionListId of this PersistenceResourcePostReturn. */ tutao.entity.base.PersistenceResourcePostReturn.prototype.getPermissionListId = function() { return this._permissionListId; }; /** * Provides the entity helper of this entity. * @return {tutao.entity.EntityHelper} The entity helper. */ tutao.entity.base.PersistenceResourcePostReturn.prototype.getEntityHelper = function() { return this._entityHelper; };
// |jit-test| error: TestComplete // onPop can change a normal return into a throw. load(libdir + "asserts.js"); var g = newGlobal('new-compartment'); var dbg = new Debugger(g); function test(type, provocation) { var log; // Help people figure out which 'test' call failed. print("type: " + uneval(type)); print("provocation: " + uneval(provocation)); dbg.onDebuggerStatement = function handleDebuggerStatement(f) { log += 'd'; }; dbg.onEnterFrame = function handleEnterFrame(f) { log += '('; assertEq(f.type, type); f.onPop = function handlePop(c) { log += ')'; assertEq(c.return, 'compliment'); return { throw: 'snow' }; }; }; log = ''; assertThrowsValue(provocation, 'snow'); assertEq(log, "(d)"); print(); } g.eval("function f() { debugger; return 'compliment'; }"); test("call", g.f); test("call", function () { return new g.f; }); test("eval", function () { return g.eval("debugger; \'compliment\';"); }); test("global", function () { return g.evaluate("debugger; \'compliment\';"); }); throw 'TestComplete';
// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /** * If x is -Infinity and y>0 and y is an odd integer, Math.pow(x,y) is -Infinity * * @path ch15/15.8/15.8.2/15.8.2.13/S15.8.2.13_A13.js * @description Checking if Math.pow(x,y) equals to -Infinity, where x is -Infinity and y>0 */ // CHECK#1 x = -Infinity; y = new Array(); y[0] = 1; y[1] = 111; y[2] = 111111; ynum = 3; for (i = 0; i < ynum; i++) { if (Math.pow(x,y[i]) !== -Infinity) { $ERROR("#1: Math.pow(" + x + ", " + y[i] + ") !== -Infinity"); } }
var fs = require('fs') var path = require('path') var resolve = path.resolve var osenv = require('osenv') var mkdirp = require('mkdirp') var rimraf = require('rimraf') var test = require('tap').test var npm = require('../../lib/npm') var common = require('../common-tap') var chain = require('slide').chain var mockPath = resolve(__dirname, 'install-shrinkwrapped') var parentPath = resolve(mockPath, 'parent') var parentNodeModulesPath = path.join(parentPath, 'node_modules') var outdatedNodeModulesPath = resolve(mockPath, 'node-modules-backup') var childPath = resolve(mockPath, 'child.git') var gitDaemon var gitDaemonPID var git var parentPackageJSON = JSON.stringify({ name: 'parent', version: '0.1.0' }) var childPackageJSON = JSON.stringify({ name: 'child', version: '0.1.0' }) test('setup', function (t) { cleanup() setup(function (err, result) { t.ifError(err, 'git started up successfully') if (!err) { gitDaemon = result[result.length - 2] gitDaemonPID = result[result.length - 1] } t.end() }) }) test('shrinkwrapped git dependency got updated', function (t) { t.comment('test for https://github.com/npm/npm/issues/12718') // Prepare the child package git repo with two commits prepareChildAndGetRefs(function (refs) { chain([ // Install & shrinkwrap child package's first commit [npm.commands.install, ['git://localhost:1234/child.git#' + refs[0]]], // Backup node_modules with the first commit [fs.rename, parentNodeModulesPath, outdatedNodeModulesPath], // Install & shrinkwrap child package's second commit [npm.commands.install, ['git://localhost:1234/child.git#' + refs[1]]], // Restore node_modules with the first commit [rimraf, parentNodeModulesPath], [fs.rename, outdatedNodeModulesPath, parentNodeModulesPath], // Update node_modules [npm.commands.install, []] ], function () { var childPackageJSON = require(path.join(parentNodeModulesPath, 'child', 'package.json')) t.equal( childPackageJSON._resolved, 'git://localhost:1234/child.git#' + refs[1], "Child package wasn't updated" ) t.end() }) }) }) test('clean', function (t) { gitDaemon.on('close', function () { cleanup() t.end() }) process.kill(gitDaemonPID) }) function setup (cb) { // Setup parent package mkdirp.sync(parentPath) fs.writeFileSync(resolve(parentPath, 'package.json'), parentPackageJSON) process.chdir(parentPath) // Setup child mkdirp.sync(childPath) fs.writeFileSync(resolve(childPath, 'package.json'), childPackageJSON) // Setup npm and then git npm.load({ registry: common.registry, loglevel: 'silent', save: true // Always install packages with --save }, function () { // It's important to initialize git after npm because it uses config initializeGit(cb) }) } function cleanup () { process.chdir(osenv.tmpdir()) rimraf.sync(mockPath) rimraf.sync(common['npm_config_cache']) } function prepareChildAndGetRefs (cb) { var opts = { cwd: childPath, env: { PATH: process.env.PATH } } chain([ [fs.writeFile, path.join(childPath, 'README.md'), ''], git.chainableExec(['add', 'README.md'], opts), git.chainableExec(['commit', '-m', 'Add README'], opts), git.chainableExec(['log', '--pretty=format:"%H"', '-2'], opts) ], function () { var gitLogStdout = arguments[arguments.length - 1] var refs = gitLogStdout[gitLogStdout.length - 1].split('\n').map(function (ref) { return ref.match(/^"(.+)"$/)[1] }).reverse() // Reverse refs order: last, first -> first, last cb(refs) }) } function initializeGit (cb) { git = require('../../lib/utils/git') common.makeGitRepo({ path: childPath, commands: [startGitDaemon] }, cb) } function startGitDaemon (cb) { var daemon = git.spawn( [ 'daemon', '--verbose', '--listen=localhost', '--export-all', '--base-path=' + mockPath, // Path to the dir that contains child.git '--reuseaddr', '--port=1234' ], { cwd: parentPath, env: process.env, stdio: ['pipe', 'pipe', 'pipe'] } ) daemon.stderr.on('data', function findChild (c) { var cpid = c.toString().match(/^\[(\d+)\]/) if (cpid[1]) { this.removeListener('data', findChild) cb(null, [daemon, cpid[1]]) } }) }
// test cube var assert = require('assert'), math = require('../../../index'), error = require('../../../lib/error/index'), unit = math.unit, bignumber = math.bignumber, matrix = math.matrix, range = math.range, cube = math.cube; describe('cube', function() { it('should return the cube of a boolean', function () { assert.equal(cube(true), 1); assert.equal(cube(false), 0); }); it('should return the cube of null', function () { assert.equal(math.ceil(null), 0); }); it('should return the cube of a number', function() { assert.equal(cube(4), 64); assert.equal(cube(-2), -8); assert.equal(cube(0), 0); }); it('should return the cube of a big number', function() { assert.deepEqual(cube(bignumber(4)), bignumber(64)); assert.deepEqual(cube(bignumber(-2)), bignumber(-8)); assert.deepEqual(cube(bignumber(0)), bignumber(0)); }); it('should return the cube of a complex number', function() { assert.deepEqual(cube(math.complex('2i')), math.complex('-8i')); assert.deepEqual(cube(math.complex('2+3i')), math.complex('-46+9i')); assert.deepEqual(cube(math.complex('2')), math.complex('8')); }); it('should throw an error with strings', function() { assert.throws(function () {cube('text')}); }); it('should throw an error with units', function() { assert.throws(function () {cube(unit('5cm'))}); }); it('should throw an error if there\'s wrong number of args', function() { assert.throws(function () {cube()}, error.ArgumentsError); assert.throws(function () {cube(1, 2)}, error.ArgumentsError); }); it('should cube each element in a matrix, array or range', function() { // array, matrix, range // arrays are evaluated element wise assert.deepEqual(cube([2,3,4,5]), [8,27,64,125]); assert.deepEqual(cube(matrix([2,3,4,5])), matrix([8,27,64,125])); assert.deepEqual(cube(matrix([[1,2],[3,4]])), matrix([[1,8],[27,64]])); }); });
/* * Copyright 2012 Amadeus s.a.s. * 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. */ Aria.classDefinition({ $classpath : "test.aria.storage.localStorage.NamespaceTestCase", $dependencies : ["aria.storage.LocalStorage"], $extends : "test.aria.storage.base.GeneralNamespaceBase", $constructor : function () { this.storageLocation = "localStorage"; this.$GeneralNamespaceBase.constructor.call(this); }, $prototype : { /** * Check what happens when you use namespaces, one namespaced shouldn't affect the others */ testNamespaceAPI : function () { if (this.canRunHTML5Tests(false) || this.canRunUserDataTests()) { this.$GeneralNamespaceBase.testNamespaceAPI.call(this); } }, /** * Verify if the events are raised correctly */ testNamespaceEvents : function () { if (this.canRunHTML5Tests(false) || this.canRunUserDataTests()) { this.$GeneralNamespaceBase.testNamespaceEvents.call(this); } } } });
// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /** * Number.NEGATIVE_INFINITY is -Infinity * * @path ch15/15.7/15.7.3/15.7.3.5/S15.7.3.5_A1.js * @description Checking sign and finiteness of Number.NEGATIVE_INFINITY */ // CHECK#1 if (isFinite(Number.NEGATIVE_INFINITY) !== false) { $ERROR('#1: Number.NEGATIVE_INFINITY === Not-a-Finite'); } else { if ((Number.NEGATIVE_INFINITY < 0) !== true) { $ERROR('#1: Number.NEGATIVE_INFINITY === -Infinity'); } }
/*! * Module dependencies. */ var Command = require('./util/command'), phonegapbuild = require('./util/phonegap-build'), util = require('util'); /*! * Command setup. */ module.exports = { create: function(phonegap) { return new RemoteLogoutCommand(phonegap); } }; function RemoteLogoutCommand(phonegap) { return Command.apply(this, arguments); } util.inherits(RemoteLogoutCommand, Command); /** * Logout. * * Logout of PhoneGap/Build. * * Options: * * - `options` {Object} is unused and should be `{}`. * - [`callback`] {Function} is a callback function. * - `e` {Error} is null unless there is an error. * * Returns: * * {PhoneGap} for chaining. */ RemoteLogoutCommand.prototype.run = function(options, callback) { var self = this; // require options if (!options) throw new Error('requires options parameter'); // optional callback callback = callback || function() {}; // logout phonegapbuild.logout(options, function(e) { callback(e); }); return self.phonegap; };
// This file was procedurally generated from the following sources: // - src/dstr-binding/obj-ptrn-id-init-skipped.case // - src/dstr-binding/default/cls-decl-async-gen-meth-dflt.template /*--- description: Destructuring initializer is not evaluated when value is not `undefined` (class expression async generator method (default parameters)) esid: sec-class-definitions-runtime-semantics-evaluation features: [async-iteration] flags: [generated, async] info: | ClassDeclaration : class BindingIdentifier ClassTail 1. Let className be StringValue of BindingIdentifier. 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with argument className. [...] 14.5.14 Runtime Semantics: ClassDefinitionEvaluation 21. For each ClassElement m in order from methods a. If IsStatic of m is false, then i. Let status be the result of performing PropertyDefinitionEvaluation for m with arguments proto and false. [...] Runtime Semantics: PropertyDefinitionEvaluation AsyncGeneratorMethod : async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody } 1. Let propKey be the result of evaluating PropertyName. 2. ReturnIfAbrupt(propKey). 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true. Otherwise let strict be false. 4. Let scope be the running execution context's LexicalEnvironment. 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters, AsyncGeneratorBody, scope, strict). [...] 13.3.3.7 Runtime Semantics: KeyedBindingInitialization SingleNameBinding : BindingIdentifier Initializeropt [...] 6. If Initializer is present and v is undefined, then [...] [...] ---*/ var initCount = 0; function counter() { initCount += 1; } var callCount = 0; class C { async *method({ w = counter(), x = counter(), y = counter(), z = counter() } = { w: null, x: 0, y: false, z: '' }) { assert.sameValue(w, null); assert.sameValue(x, 0); assert.sameValue(y, false); assert.sameValue(z, ''); assert.sameValue(initCount, 0); callCount = callCount + 1; } }; new C().method().next().then(() => { assert.sameValue(callCount, 1, 'invoked exactly once'); }).then($DONE, $DONE);
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @format * @flow */ 'use strict'; const EventEmitter = require('../../vendor/emitter/EventEmitter'); const RCTDeviceEventEmitter = require('../RCTDeviceEventEmitter'); /** * Mock the NativeEventEmitter as a normal JS EventEmitter. */ class NativeEventEmitter extends EventEmitter { constructor() { super(RCTDeviceEventEmitter.sharedSubscriber); } } module.exports = NativeEventEmitter;
'use strict'; // Load modules const Http = require('http'); const Stream = require('stream'); // Declare internals const internals = {}; exports = module.exports = class Response extends Http.ServerResponse { constructor(req, onEnd) { super({ method: req.method, httpVersionMajor: 1, httpVersionMinor: 1 }); this._shot = { headers: null, trailers: {}, payloadChunks: [] }; this._headers = {}; // This forces node@8 to always render the headers this.assignSocket(internals.nullSocket()); this.once('finish', () => { const res = internals.payload(this); res.raw.req = req; process.nextTick(() => onEnd(res)); }); } writeHead() { const result = super.writeHead.apply(this, arguments); this._shot.headers = Object.assign({}, this._headers); // Should be .getHeaders() since node v7.7 // Add raw headers ['Date', 'Connection', 'Transfer-Encoding'].forEach((name) => { const regex = new RegExp('\\r\\n' + name + ': ([^\\r]*)\\r\\n'); const field = this._header.match(regex); if (field) { this._shot.headers[name.toLowerCase()] = field[1]; } }); return result; } write(data, encoding, callback) { super.write(data, encoding, callback); this._shot.payloadChunks.push(new Buffer(data, encoding)); return true; // Write always returns false when disconnected } end(data, encoding, callback) { if (data) { this.write(data, encoding); } super.end(callback); this.emit('finish'); } destroy() { } addTrailers(trailers) { for (const key in trailers) { this._shot.trailers[key.toLowerCase().trim()] = trailers[key].toString().trim(); } } }; internals.payload = function (response) { // Prepare response object const res = { raw: { res: response }, headers: response._shot.headers, statusCode: response.statusCode, statusMessage: response.statusMessage, trailers: {} }; // Prepare payload and trailers const rawBuffer = Buffer.concat(response._shot.payloadChunks); res.rawPayload = rawBuffer; res.payload = rawBuffer.toString(); res.trailers = response._shot.trailers; return res; }; // Throws away all written data to prevent response from buffering payload internals.nullSocket = function () { return new Stream.Writable({ write(chunk, encoding, callback) { setImmediate(callback); } }); };
"use strict"; // local import of the exported AngularPage class var angularPage_1 = require('./angularPage'); // The jasmine typings are brought in via DefinitelyTyped ambient typings. describe('angularjs homepage', function () { it('should greet the named user', function () { var angularHomepage = new angularPage_1.AngularHomepage(); angularHomepage.get(); angularHomepage.setName('Julie'); expect(angularHomepage.getGreeting()).toEqual('Hello Julie!'); }); });
import answer from './answer'; var answer2 = answer; export default answer2;
export default window['%testCafeAutomation%'];
// sensible server which advertises itself via Bonjour // NODE INCLUDES var dgram = require ("dgram"); var fs = require ("fs"); var http = require ("http"); var os = require ("os"); var url = require ("url"); // REGULAR JS INCLUDES // assume that sensible.js lives in the same directory as our mainline var code = fs.readFileSync (require ("path").dirname (process.argv [1]) + "/sensible.js"); eval (code.toString ()); // MAINLINE sensible.ApplicationFactory.createApplication ( function (inError) { if (inError) { console.error ("error during sensible application startup"); console.error (inError); } else { console.log ("sensible application startup"); } } ); // called just before sensible.Application.start() sensible.node.Application.prototype.onBeforeStart = function (inCallback) { console.log ("node.Application.onBeforeStart()"); inCallback (); } // called just after sensible.Application.start() sensible.node.Application.prototype.onAfterStart = function (inCallback) { console.log ("node.Application.onAfterStart()"); inCallback (); }
/** * @fileoverview Restrict usage of duplicate imports. * @author Simen Bekkhus * @copyright 2016 Simen Bekkhus. All rights reserved. * See LICENSE file in root directory for full license. */ "use strict"; //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ /** * Returns the name of the module imported or re-exported. * * @param {ASTNode} node - A node to get. * @returns {string} the name of the module, or empty string if no name. */ function getValue(node) { if (node && node.source && node.source.value) { return node.source.value.trim(); } return ""; } /** * Checks if the name of the import or export exists in the given array, and reports if so. * * @param {RuleContext} context - The ESLint rule context object. * @param {ASTNode} node - A node to get. * @param {string} value - The name of the imported or exported module. * @param {string[]} array - The array containing other imports or exports in the file. * @param {string} message - A message to be reported after the name of the module * * @returns {void} No return value */ function checkAndReport(context, node, value, array, message) { if (array.indexOf(value) !== -1) { context.report({ node: node, message: "'{{module}}' " + message, data: {module: value} }); } } /** * @callback nodeCallback * @param {ASTNode} node - A node to handle. */ /** * Returns a function handling the imports of a given file * * @param {RuleContext} context - The ESLint rule context object. * @param {boolean} includeExports - Whether or not to check for exports in addition to imports. * @param {string[]} importsInFile - The array containing other imports in the file. * @param {string[]} exportsInFile - The array containing other exports in the file. * * @returns {nodeCallback} A function passed to ESLint to handle the statement. */ function handleImports(context, includeExports, importsInFile, exportsInFile) { return function(node) { var value = getValue(node); if (value) { checkAndReport(context, node, value, importsInFile, "import is duplicated."); if (includeExports) { checkAndReport(context, node, value, exportsInFile, "import is duplicated as export."); } importsInFile.push(value); } }; } /** * Returns a function handling the exports of a given file * * @param {RuleContext} context - The ESLint rule context object. * @param {string[]} importsInFile - The array containing other imports in the file. * @param {string[]} exportsInFile - The array containing other exports in the file. * * @returns {nodeCallback} A function passed to ESLint to handle the statement. */ function handleExports(context, importsInFile, exportsInFile) { return function(node) { var value = getValue(node); if (value) { checkAndReport(context, node, value, exportsInFile, "export is duplicated."); checkAndReport(context, node, value, importsInFile, "export is duplicated as import."); exportsInFile.push(value); } }; } module.exports = function(context) { var includeExports = (context.options[0] || {}).includeExports, importsInFile = [], exportsInFile = []; var handlers = { "ImportDeclaration": handleImports(context, includeExports, importsInFile, exportsInFile) }; if (includeExports) { handlers.ExportNamedDeclaration = handleExports(context, importsInFile, exportsInFile); handlers.ExportAllDeclaration = handleExports(context, importsInFile, exportsInFile); } return handlers; }; module.exports.schema = [{ "type": "object", "properties": { "includeExports": { "type": "boolean" } }, "additionalProperties": false }];
// I18N constants // LANG: "pl", ENCODING: UTF-8 // translated: Krzysztof Kotowicz koto@webworkers.pl { "Align": "Wyrównanie", "All four sides": "Wszystkie 4 strony", "Background": "Tło", "Baseline": "Linia bazowa", "Border": "Ramka", "Borders": "Ramki", "Bottom": "Dół", "Style [CSS]": "Styl [CSS]", "CSS Style": "Styl CSS", "Caption": "Podpis", "Cell Properties": "Właściwości komórki", "Center": "Środek", "Char": "Znak", "Collapsed borders": "Ramki skolapsowane", "Color": "Kolor", "Description": "Opis", "FG Color": "Kolor czcionek", "Float": "Opływanie", "Frames": "Ramki zewn.", "Frame and borders": "Obramowania", "Height": "Wysokość", "How many columns would you like to merge?": "Ile kolumn chcesz scalić?", "How many rows would you like to merge?": "Ile wierszy chcesz scalić?", "Image URL": "URL obrazka", "Justify": "Wyjustuj", "Layout": "Layout", "Left": "Lewo", "Margin": "Margines", "Middle": "Środek", "No rules": "Bez wewnętrzych", "No sides": "Bez ramek", "None": "Brak", "Padding": "Wcięcia", "Please click into some cell": "Kliknij w jakąś komórkę", "Right": "Prawo", "Row Properties": "Właściwości wiersza", "Rules will appear between all rows and columns": "Linie będą widoczne pomiędzy kolumnami i wierszami", "Rules will appear between columns only": "Linie będą widoczne tylko pomiędzy kolumnami", "Rules will appear between rows only": "Linie będą widoczne tylko pomiędzy wierszami", "Rules": "Linie wewn.", "Spacing and padding": "Spacjowanie", "Spacing": "Odstęp", "Summary": "Podsumowanie", "Delete cell": "Usuń komórkę", "Insert cell after": "Wstaw komórkę po", "Insert cell before": "Wstaw komórkę przed", "Merge cells": "Scal komórki", "Cell properties": "Właściwości komórki", "Split cell": "Rozdziel komórkę", "Delete column": "Usuń kolumnę", "Insert column after": "Wstaw kolumnę po", "Insert column before": "Wstaw kolumnę przed", "Split column": "Rozdziel kolumnę", "Delete row": "Usuń wiersz", "Insert row before": "Wstaw wiersz przed", "Insert row after": "Wstaw wiersz po", "Row properties": "Właściwości wiersza", "Split row": "Rozdziel wiersz", "Table properties": "Właściwości tabeli", "Table Properties": "Właściwości tabeli", "Text align": "Wyr. w poziomie", "The bottom side only": "Tylko dolna linia", "The left-hand side only": "Tylko lewa linia", "The right and left sides only": "Lewa i prawa linia", "The right-hand side only": "Tylko prawa linia", "The top and bottom sides only": "Górna i dolna linia", "The top side only": "Tylko górna linia", "Top": "Góra", "Unset color": "Usuń kolor", "Vertical align": "Wyr. w pionie", "Width": "Szerokość", "HTMLArea cowardly refuses to delete the last cell in row.": "Nie możesz skasować ostatniej komórki w wierszu.", "HTMLArea cowardly refuses to delete the last column in table.": "Nie możesz skasować ostatniej kolumny w tabeli.", "HTMLArea cowardly refuses to delete the last row in table.": "Nie możesz skasować ostatniego wiersza w tabeli.", "percent": "%", "pixels": "pikseli", "OK": "OK", "Cancel": "Anuluj" };
define(["../../buildControl"], function(bc){ if(bc.stripConsole){ var consoleMethods = "assert|count|debug|dir|dirxml|group|groupEnd|info|profile|profileEnd|time|timeEnd|trace|log"; if(bc.stripConsole === "warn"){ consoleMethods += "|warn"; }else if(bc.stripConsole === "all"){ consoleMethods += "|warn|error"; } // Match on "window.console" and plain "console" but not things like "myconsole" or "my.console" var stripConsoleRe = new RegExp("([^\\w\\.]|^)((window.)?console\\.(" + consoleMethods + ")\\s*\\()", "g"); return function(text){ return text.replace(stripConsoleRe, "$1 0 && $2"); }; }else{ return function(text){ return text; }; } });
/* ######################################################################### # # Copyright (C) 2019 OSGeo # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # 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 General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # ######################################################################### */ export default 'ALERT_SETTINGS';
/** * Model that represents our form template. * * @package Ninja Forms client * @copyright (c) 2017 WP Ninjas * @since 3.0 */ define( [], function() { var model = Backbone.Model.extend( { defaults: { objectType: 'template', id: 'none', title: 'unknown' }, initialize: function() { this.set( 'desc', this.get( 'template-desc' ) ); } } ); return model; } );
"use strict"; var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property"); _Object$defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var noteRole = { abstract: false, accessibleNameRequired: false, baseConcepts: [], childrenPresentational: false, nameFrom: ['author'], prohibitedProps: [], props: {}, relatedConcepts: [], requireContextRole: [], requiredContextRole: [], requiredOwnedElements: [], requiredProps: {}, superClass: [['roletype', 'structure', 'section']] }; var _default = noteRole; exports.default = _default;
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Variable = void 0; const VariableBase_1 = require("./VariableBase"); /** * A Variable represents a locally scoped identifier. These include arguments to functions. */ class Variable extends VariableBase_1.VariableBase { /** * `true` if the variable is valid in a type context, false otherwise * @public */ get isTypeVariable() { if (this.defs.length === 0) { // we don't statically know whether this is a type or a value return true; } return this.defs.some(def => def.isTypeDefinition); } /** * `true` if the variable is valid in a value context, false otherwise * @public */ get isValueVariable() { if (this.defs.length === 0) { // we don't statically know whether this is a type or a value return true; } return this.defs.some(def => def.isVariableDefinition); } } exports.Variable = Variable; //# sourceMappingURL=Variable.js.map
// Copyright 2018 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. function waitUntilIdle() { return new Promise(resolve=>{ window.requestIdleCallback(()=>resolve()); }); } (async function() { TestRunner.addResult(`Tests V8 code cache for javascript resources\n`); await TestRunner.loadLegacyModule('timeline'); await TestRunner.loadTestModule('performance_test_runner'); await TestRunner.showPanel('timeline'); // Clear browser cache to avoid any existing entries for the fetched // scripts in the cache. SDK.multitargetNetworkManager.clearBrowserCache(); // There are two scripts: // [A] http://127.0.0.1:8000/devtools/resources/v8-cache-script.cgi // [B] http://localhost:8000/devtools/resources/v8-cache-script.cgi // An iframe that loads [A]. // The script is executed as a parser-inserted script, // to keep the ScriptResource on the MemoryCache. // ScriptResources for dynamically-inserted <script>s can be // garbage-collected and thus removed from MemoryCache after its execution. const scope = 'resources/same-origin-script.html'; // An iframe that loads [B]. const scopeCrossOrigin = 'resources/cross-origin-script.html'; TestRunner.addResult('--- Trace events related to code caches ------'); await PerformanceTestRunner.startTimeline(); async function stopAndPrintTimeline() { await PerformanceTestRunner.stopTimeline(); await PerformanceTestRunner.printTimelineRecordsWithDetails( TimelineModel.TimelineModel.RecordType.CompileScript, TimelineModel.TimelineModel.RecordType.CacheScript); } async function expectationComment(msg) { await stopAndPrintTimeline(); TestRunner.addResult(msg); await PerformanceTestRunner.startTimeline(); } // Load [A] thrice. With the current V8 heuristics (defined in // third_party/blink/renderer/bindings/core/v8/v8_code_cache.cc) we produce // cache on second fetch and consume it in the third fetch. This tests these // heuristics. // Note that addIframe() waits for iframe's load event, which waits for the // <script> loading. await expectationComment('Load [A] 1st time. Produce timestamp. -->'); await TestRunner.addIframe(scope); await expectationComment('Load [A] 2nd time. Produce code cache. -->'); await TestRunner.addIframe(scope); await waitUntilIdle(); await expectationComment('Load [A] 3rd time. Consume code cache. -->'); await TestRunner.addIframe(scope); await expectationComment('Load [B]. Should not use the cached code. -->'); await TestRunner.addIframe(scopeCrossOrigin); await expectationComment('Load [A] again from MemoryCache. ' + 'Should use the cached code. -->'); await TestRunner.addIframe(scope); await expectationComment('Clear [A] from MemoryCache. -->'); // Blink evicts previous Resource when a new request to the same URL but with // different resource type is started. We fetch() to the URL of [A], and thus // evicts the previous ScriptResource of [A]. await TestRunner.evaluateInPageAsync( `fetch('/devtools/resources/v8-cache-script.cgi')`); await expectationComment('Load [A] from Disk Cache. -->'); // As we cleared [A] from MemoryCache, this doesn't hit MemoryCache, but still // hits Disk Cache. await TestRunner.addIframe(scope); await stopAndPrintTimeline(); TestRunner.addResult('-----------------------------------------------'); TestRunner.completeTest(); })();
// This is not the set of all possible signals. // // It IS, however, the set of all signals that trigger // an exit on either Linux or BSD systems. Linux is a // superset of the signal names supported on BSD, and // the unknown signals just fail to register, so we can // catch that easily enough. // // Don't bother with SIGKILL. It's uncatchable, which // means that we can't fire any callbacks anyway. // // If a user does happen to register a handler on a non- // fatal signal like SIGWINCH or something, and then // exit, it'll end up firing `process.emit('exit')`, so // the handler will be fired anyway. // // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised // artificially, inherently leave the process in a // state from which it is not safe to try and enter JS // listeners. module.exports = [ 'SIGABRT', 'SIGALRM', 'SIGHUP', 'SIGINT', 'SIGTERM' ] if (process.platform !== 'win32') { module.exports.push( 'SIGVTALRM', 'SIGXCPU', 'SIGXFSZ', 'SIGUSR2', 'SIGTRAP', 'SIGSYS', 'SIGQUIT', 'SIGIOT' // should detect profiler and enable/disable accordingly. // see #21 // 'SIGPROF' ) } if (process.platform === 'linux') { module.exports.push( 'SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT', 'SIGUNUSED' ) }
import { css, StyleSheet } from 'aphrodite/no-important'; import React, { PropTypes } from 'react'; import octicons from './octicons'; import colors from './colors'; import sizes from './sizes'; import styles from './styles'; const classes = StyleSheet.create(styles); // FIXME static octicon classes leaning on Elemental to avoid duplicate // font and CSS; inflating the project size function Glyph ({ aphroditeStyles, className, color, component: Component, name, size, style, ...props }) { const colorIsValidType = Object.keys(colors).includes(color); props.className = css( classes.glyph, colorIsValidType && classes['color__' + color], classes['size__' + size], aphroditeStyles ) + ` ${octicons[name]}`; if (className) { props.className += (' ' + className); } // support random color strings props.style = { color: !colorIsValidType ? color : null, ...style, }; return <Component {...props} />; }; Glyph.propTypes = { aphroditeStyles: PropTypes.shape({ _definition: PropTypes.object, _name: PropTypes.string, }), color: PropTypes.oneOfType([ PropTypes.oneOf(Object.keys(colors)), PropTypes.string, // support random color strings ]), name: PropTypes.oneOf(Object.keys(octicons)).isRequired, size: PropTypes.oneOf(Object.keys(sizes)), }; Glyph.defaultProps = { component: 'i', color: 'inherit', size: 'small', }; module.exports = Glyph;
angular.module('merchello.plugins.braintree').controller('Merchello.Plugins.GatewayProviders.Dialogs.PaymentMethodAddEditController', ['$scope', 'braintreeProviderSettingsBuilder', function($scope, braintreeProviderSettingsBuilder) { $scope.providerSettings = {}; function init() { var json = JSON.parse($scope.dialogData.provider.extendedData.getValue('braintreeProviderSettings')); $scope.providerSettings = braintreeProviderSettingsBuilder.transform(json); $scope.$watch(function () { return $scope.providerSettings; }, function (newValue, oldValue) { $scope.dialogData.provider.extendedData.setValue('braintreeProviderSettings', angular.toJson(newValue)); }, true); } // initialize the controller init(); }]);
function dec(target, name, descriptor) { assert(target); assert.equal(typeof name, "string"); assert.equal(typeof descriptor, "object"); target.decoratedProps = (target.decoratedProps || []).concat([name]); let value = descriptor.value; Object.assign(descriptor, { enumerable: name.indexOf("enum") !== -1, configurable: name.indexOf("conf") !== -1, writable: name.indexOf("write") !== -1, value: function(...args) { return "__" + value.apply(this, args) + "__"; }, }); } const inst = { @dec enumconfwrite(){ return 1; }, @dec enumconf(){ return 2; }, @dec enumwrite(){ return 3; }, @dec enum(){ return 4; }, @dec confwrite(){ return 5; }, @dec conf(){ return 6; }, @dec write(){ return 7; }, @dec _(){ return 8; }, } assert(inst.hasOwnProperty('decoratedProps')); assert.deepEqual(inst.decoratedProps, [ "enumconfwrite", "enumconf", "enumwrite", "enum", "confwrite", "conf", "write", "_", ]); const descs = Object.getOwnPropertyDescriptors(inst); assert(descs.enumconfwrite.enumerable); assert(descs.enumconfwrite.writable); assert(descs.enumconfwrite.configurable); assert.equal(inst.enumconfwrite(), "__1__"); assert(descs.enumconf.enumerable); assert.equal(descs.enumconf.writable, false); assert(descs.enumconf.configurable); assert.equal(inst.enumconf(), "__2__"); assert(descs.enumwrite.enumerable); assert(descs.enumwrite.writable); assert.equal(descs.enumwrite.configurable, false); assert.equal(inst.enumwrite(), "__3__"); assert(descs.enum.enumerable); assert.equal(descs.enum.writable, false); assert.equal(descs.enum.configurable, false); assert.equal(inst.enum(), "__4__"); assert.equal(descs.confwrite.enumerable, false); assert(descs.confwrite.writable); assert(descs.confwrite.configurable); assert.equal(inst.confwrite(), "__5__"); assert.equal(descs.conf.enumerable, false); assert.equal(descs.conf.writable, false); assert(descs.conf.configurable); assert.equal(inst.conf(), "__6__"); assert.equal(descs.write.enumerable, false); assert(descs.write.writable); assert.equal(descs.write.configurable, false); assert.equal(inst.write(), "__7__"); assert.equal(descs._.enumerable, false); assert.equal(descs._.writable, false); assert.equal(descs._.configurable, false); assert.equal(inst._(), "__8__");
/* Language: Lisp Description: Generic lisp syntax Author: Vasily Polovnyov <vast@whiteants.net> Category: lisp */ function lisp(hljs) { var LISP_IDENT_RE = '[a-zA-Z_\\-+\\*\\/<=>&#][a-zA-Z0-9_\\-+*\\/<=>&#!]*'; var MEC_RE = '\\|[^]*?\\|'; var LISP_SIMPLE_NUMBER_RE = '(-|\\+)?\\d+(\\.\\d+|\\/\\d+)?((d|e|f|l|s|D|E|F|L|S)(\\+|-)?\\d+)?'; var LITERAL = { className: 'literal', begin: '\\b(t{1}|nil)\\b' }; var NUMBER = { className: 'number', variants: [ {begin: LISP_SIMPLE_NUMBER_RE, relevance: 0}, {begin: '#(b|B)[0-1]+(/[0-1]+)?'}, {begin: '#(o|O)[0-7]+(/[0-7]+)?'}, {begin: '#(x|X)[0-9a-fA-F]+(/[0-9a-fA-F]+)?'}, {begin: '#(c|C)\\(' + LISP_SIMPLE_NUMBER_RE + ' +' + LISP_SIMPLE_NUMBER_RE, end: '\\)'} ] }; var STRING = hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null}); var COMMENT = hljs.COMMENT( ';', '$', { relevance: 0 } ); var VARIABLE = { begin: '\\*', end: '\\*' }; var KEYWORD = { className: 'symbol', begin: '[:&]' + LISP_IDENT_RE }; var IDENT = { begin: LISP_IDENT_RE, relevance: 0 }; var MEC = { begin: MEC_RE }; var QUOTED_LIST = { begin: '\\(', end: '\\)', contains: ['self', LITERAL, STRING, NUMBER, IDENT] }; var QUOTED = { contains: [NUMBER, STRING, VARIABLE, KEYWORD, QUOTED_LIST, IDENT], variants: [ { begin: '[\'`]\\(', end: '\\)' }, { begin: '\\(quote ', end: '\\)', keywords: {name: 'quote'} }, { begin: '\'' + MEC_RE } ] }; var QUOTED_ATOM = { variants: [ {begin: '\'' + LISP_IDENT_RE}, {begin: '#\'' + LISP_IDENT_RE + '(::' + LISP_IDENT_RE + ')*'} ] }; var LIST = { begin: '\\(\\s*', end: '\\)' }; var BODY = { endsWithParent: true, relevance: 0 }; LIST.contains = [ { className: 'name', variants: [ { begin: LISP_IDENT_RE, relevance: 0, }, {begin: MEC_RE} ] }, BODY ]; BODY.contains = [QUOTED, QUOTED_ATOM, LIST, LITERAL, NUMBER, STRING, COMMENT, VARIABLE, KEYWORD, MEC, IDENT]; return { name: 'Lisp', illegal: /\S/, contains: [ NUMBER, hljs.SHEBANG(), LITERAL, STRING, COMMENT, QUOTED, QUOTED_ATOM, LIST, IDENT ] }; } module.exports = lisp;
var Deferred = require('./') var assert = require('assert') var d = new Deferred() var t = require('tap') t.match(d, { resolve: Function, reject: Function, promise: Object })
/* TL.Point Inspired by Leaflet TL.Point represents a point with x and y coordinates. ================================================== */ TL.Point = function (/*Number*/ x, /*Number*/ y, /*Boolean*/ round) { this.x = (round ? Math.round(x) : x); this.y = (round ? Math.round(y) : y); }; TL.Point.prototype = { add: function (point) { return this.clone()._add(point); }, _add: function (point) { this.x += point.x; this.y += point.y; return this; }, subtract: function (point) { return this.clone()._subtract(point); }, // destructive subtract (faster) _subtract: function (point) { this.x -= point.x; this.y -= point.y; return this; }, divideBy: function (num, round) { return new TL.Point(this.x / num, this.y / num, round); }, multiplyBy: function (num) { return new TL.Point(this.x * num, this.y * num); }, distanceTo: function (point) { var x = point.x - this.x, y = point.y - this.y; return Math.sqrt(x * x + y * y); }, round: function () { return this.clone()._round(); }, // destructive round _round: function () { this.x = Math.round(this.x); this.y = Math.round(this.y); return this; }, clone: function () { return new TL.Point(this.x, this.y); }, toString: function () { return 'Point(' + TL.Util.formatNum(this.x) + ', ' + TL.Util.formatNum(this.y) + ')'; } };
var classCqrs_1_1MongoDB_1_1Serialisers_1_1TypeSerialiser = [ [ "Deserialize", "classCqrs_1_1MongoDB_1_1Serialisers_1_1TypeSerialiser_a5e8aa7ae1372033da215d02b79947b20.html#a5e8aa7ae1372033da215d02b79947b20", null ], [ "Serialize", "classCqrs_1_1MongoDB_1_1Serialisers_1_1TypeSerialiser_a4aec60f5df74f482b576f4e0dad0d5f6.html#a4aec60f5df74f482b576f4e0dad0d5f6", null ], [ "Serialize", "classCqrs_1_1MongoDB_1_1Serialisers_1_1TypeSerialiser_a2362ae784859054bf5b9281dafeb37cd.html#a2362ae784859054bf5b9281dafeb37cd", null ], [ "ValueType", "classCqrs_1_1MongoDB_1_1Serialisers_1_1TypeSerialiser_af5d06e2fe995f816c840a8ceefd22991.html#af5d06e2fe995f816c840a8ceefd22991", null ] ];
//// [privateIdentifierChain.1.ts] class A { a?: A #b?: A; getA(): A { return new A(); } constructor() { this?.#b; // Error this?.a.#b; // Error this?.getA().#b; // Error } } //// [privateIdentifierChain.1.js] "use strict"; class A { constructor() { this?.#b; // Error this?.a.#b; // Error this?.getA().#b; // Error } #b; getA() { return new A(); } }
/* Uncaught exception * Output: EH_UNCAUGHT_EXCEPTION */ function throwsException() { throw new Error(); } function doSomething() { try { throwsException(); } catch (e) { } } function doSomethingElse() { throwsException(); } doSomething(); doSomethingElse();
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow strict * @format */ 'use strict'; const {polyfillObjectProperty} = require('../Utilities/PolyfillFunctions'); let navigator = global.navigator; if (navigator === undefined) { global.navigator = navigator = {}; } // see https://github.com/facebook/react-native/issues/10881 polyfillObjectProperty(navigator, 'product', () => 'ReactNative');
version https://git-lfs.github.com/spec/v1 oid sha256:ff6a5c1204e476c89870c6f14e75db666fa26de9359f9d8c372ef779b55c8875 size 2736
function example(name, deps) { console.log('This is where fpscounter plugin code would execute in the node process.'); } module.exports = example;
// Node if (typeof module !== 'undefined' && module.exports) { var numeral = require('../../numeral'); var expect = require('chai').expect; var language = require('../../languages/th'); } describe('Language: th', function() { before(function() { numeral.language('th', language); numeral.language('th'); }); after(function() { numeral.reset(); }); describe('Number', function() { it('should format a number', function() { var tests = [ [10000,'0,0.0000','10,000.0000'], [10000.23,'0,0','10,000'], [-10000,'0,0.0','-10,000.0'], [10000.1234,'0.000','10000.123'], [-10000,'(0,0.0000)','(10,000.0000)'], [-0.23,'.00','-.23'], [-0.23,'(.00)','(.23)'], [0.23,'0.00000','0.23000'], [1230974,'0.0a','1.2ล้าน'], [1460,'0a','1พัน'], [-104000,'0a','-104พัน'], [1,'0o','1.'], [52,'0o','52.'], [23,'0o','23.'], [100,'0o','100.'], [1,'0[.]0','1'] ]; for (var i = 0; i < tests.length; i++) { expect(numeral(tests[i][0]).format(tests[i][1])).to.equal(tests[i][2]); } }); }); describe('Currency', function() { it('should format a currency', function() { var tests = [ [1000.234,'$0,0.00','฿1,000.23'], [-1000.234,'($0,0)','(฿1,000)'], [-1000.234,'$0.00','-฿1000.23'], [1230974,'($0.00a)','฿1.23ล้าน'] ]; for (var i = 0; i < tests.length; i++) { expect(numeral(tests[i][0]).format(tests[i][1])).to.equal(tests[i][2]); } }); }); describe('Percentages', function() { it('should format a percentages', function() { var tests = [ [1,'0%','100%'], [0.974878234,'0.000%','97.488%'], [-0.43,'0%','-43%'], [0.43,'(0.000%)','43.000%'] ]; for (var i = 0; i < tests.length; i++) { expect(numeral(tests[i][0]).format(tests[i][1])).to.equal(tests[i][2]); } }); }); describe('Unformat', function() { it('should unformat', function() { var tests = [ ['10,000.123',10000.123], ['(0.12345)',-0.12345], ['(฿1.23ล้าน)',-1230000], ['10พัน',10000], ['-10พัน',-10000], ['23.',23], ['฿10,000.00',10000], ['-76%',-0.76], ['2:23:57',8637] ]; for (var i = 0; i < tests.length; i++) { expect(numeral().unformat(tests[i][0])).to.equal(tests[i][1]); } }); }); });
'use strict'; var BigNumber = require('../../type/BigNumber'); var Range = require('../../type/Range'); var Index = require('../../type/Index'); var isNumber = require('../../util/number').isNumber; /** * Attach a transform function to math.index * Adds a property transform containing the transform function. * * This transform creates a one-based index instead of a zero-based index * @param {Object} math */ module.exports = function (math) { var transform = function () { var args = []; for (var i = 0, ii = arguments.length; i < ii; i++) { var arg = arguments[i]; // change from one-based to zero based, and convert BigNumber to number if (arg instanceof Range) { arg.start--; arg.end -= (arg.step > 0 ? 0 : 2); } else if (isNumber(arg)) { arg--; } else if (arg instanceof BigNumber) { arg = arg.toNumber() - 1; } else { throw new TypeError('Ranges must be a Number or Range'); } args[i] = arg; } var res = new Index(); Index.apply(res, args); return res; }; math.index.transform = transform; return transform; };
define("ace/snippets/typescript",["require","exports","module"],function(e,t,n){"use strict";t.snippetText="",t.scope="typescript"}); (function() { window.require(["ace/snippets/typescript"], function(m) { if (typeof module == "object") { module.exports = m; } }); })();
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var React = _interopRequireWildcard(require("react")); var _createSvgIcon = _interopRequireDefault(require("../../utils/createSvgIcon")); var _jsxRuntime = require("react/jsx-runtime"); /** * @ignore - internal component. */ var _default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)("path", { d: "M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z" }), 'Star'); exports.default = _default;
// Copyright 2012 Mark Cavage, Inc. All rights reserved. 'use strict'; ///--- Exports /** * JSONP formatter. like JSON, but with a callback invocation. * * Unicode escapes line and paragraph separators. * * @public * @function formatJSONP * @param {Object} req the request object * @param {Object} res the response object * @param {Object} body response body * @returns {String} */ function formatJSONP(req, res, body) { if (!body) { res.setHeader('Content-Length', 0); return (null); } if (Buffer.isBuffer(body)) { body = body.toString('base64'); } var _cb = req.query.callback || req.query.jsonp; var data; if (_cb) { data = 'typeof ' + _cb + ' === \'function\' && ' + _cb + '(' + JSON.stringify(body) + ');'; } else { data = JSON.stringify(body); } data = data.replace(/\u2028/g, '\\u2028') .replace(/\u2029/g, '\\u2029'); res.setHeader('Content-Length', Buffer.byteLength(data)); return data; } module.exports = formatJSONP;
/** * @file * @copyright 2020 Aleksej Komarov * @license MIT */ // Themes import './styles/main.scss'; import './styles/themes/abductor.scss'; import './styles/themes/cardtable.scss'; import './styles/themes/hackerman.scss'; import './styles/themes/malfunction.scss'; import './styles/themes/neutral.scss'; import './styles/themes/ntos.scss'; import './styles/themes/paper.scss'; import './styles/themes/retro.scss'; import './styles/themes/syndicate.scss'; import './styles/themes/wizard.scss'; import { perf } from 'common/perf'; import { setupHotReloading } from 'tgui-dev-server/link/client'; import { setupHotKeys } from './hotkeys'; import { captureExternalLinks } from './links'; import { createRenderer } from './renderer'; import { configureStore, StoreProvider } from './store'; import { setupGlobalEvents } from './events'; perf.mark('inception', window.performance?.timing?.navigationStart); perf.mark('init'); const store = configureStore(); const renderApp = createRenderer(() => { const { getRoutedComponent } = require('./routes'); const Component = getRoutedComponent(store); return ( <StoreProvider store={store}> <Component /> </StoreProvider> ); }); const setupApp = () => { // Delay setup if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', setupApp); return; } setupGlobalEvents(); setupHotKeys(); captureExternalLinks(); // Subscribe for state updates store.subscribe(renderApp); // Dispatch incoming messages window.update = msg => store.dispatch(Byond.parseJson(msg)); // Process the early update queue while (true) { const msg = window.__updateQueue__.shift(); if (!msg) { break; } window.update(msg); } // Enable hot module reloading if (module.hot) { setupHotReloading(); module.hot.accept([ './components', './debug', './layouts', './routes', ], () => { renderApp(); }); } }; setupApp();
(function() { 'use strict'; Features.$inject = ['urls']; function Features(urls) { var self = this; urls.links().then(function(links) { angular.extend(self, links); }); } /** * Provides info what features are available on server */ angular.module('superdesk.features', ['superdesk.api']) .service('features', Features); })();
// Tests for the JavaScriptMVC compatibility layer. Will be removed eventually steal('funcunit/qunit', 'jquerypp/controller/view/test/qunit' , 'jquerypp/class/class_test.js' , 'jquerypp/model/test/qunit' , 'jquerypp/controller/controller_test.js' , 'jquerypp/view/test/qunit' , 'jquerypp/dom/route/route_test.js' , './integration.js');
/* * Copyright 2012 the original author or authors * @license MIT, see LICENSE.txt for details * * @author Scott Andrews */ (function (define) { 'use strict'; var undef; /** * Aggregate messages into batches as they are received. */ define(function (require) { var msgs = require('..'); /** * Aggregates messages into batches as they are received. Batches may * be chunked either by an absolute size and/or a timeout since the * first message was received for the chunk. Either a batch size or * timeout must be specified. * * @param {string} [name] the name to register the aggregator as * @param {number} [opts.batch=0] absolute size of a chunk. If <=0, * batch size is not a factor * @param {number} [opts.timeout=0] number of milliseconds since the * first message arrived to queue the chunk. If <=0, timeout is not a * factor * @param {string|Channel} [opts.output] the channel to post the * aggregated messages to * @param {string|Channel} [opts.input] the channel to receive message * from * @param {string|Channel} [opts.error] channel to receive errors * @returns the aggregator * @throws on invalid configuration, batch size or timeout is required */ msgs.prototype.batchingAggregator = msgs.utils.optionalName(function batchingAggregator(name, opts) { var timeout, batch; batch = []; opts = opts || {}; opts.batch = opts.batch || 0; opts.timeout = opts.timeout || 0; if (opts.batch <= 0 && opts.timeout <= 0) { throw new Error('Invalid configuration: batch size or timeout must be defined'); } function releaseHelper(release) { release(batch); batch = []; clearTimeout(timeout); timeout = undef; } return this.aggregator(name, function (message, release) { batch.push(message.payload); if (opts.batch > 0 && batch.length >= opts.batch) { releaseHelper(release); } else if (!timeout && opts.timeout > 0) { timeout = setTimeout(function () { releaseHelper(release); }, opts.timeout); } }, opts); }); return msgs; }); }( typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); } // Boilerplate for AMD and Node ));
/** * Copyright 2017 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. */ import {isLayoutSizeDefined} from '../../../src/layout'; import {tryParseJson} from '../../../src/json'; import {user} from '../../../src/log'; import {removeElement} from '../../../src/dom'; import { installVideoManagerForDoc, } from '../../../src/service/video-manager-impl'; import {isObject} from '../../../src/types'; import {listen} from '../../../src/event-helper'; import {VideoEvents} from '../../../src/video-interface'; import {videoManagerForDoc} from '../../../src/services'; /** * @implements {../../../src/video-interface.VideoInterface} */ class Amp3QPlayer extends AMP.BaseElement { /** @param {!AmpElement} element */ constructor(element) { super(element); /** @private {?Element} */ this.iframe_ = null; /** @private {?Function} */ this.unlistenMessage_ = null; /** @private {?Promise} */ this.playerReadyPromise_ = null; /** @private {?Function} */ this.playerReadyResolver_ = null; this.dataId = null; } /** * @param {boolean=} opt_onLayout * @override */ preconnectCallback(opt_onLayout) { this.preconnect.url('https://playout.3qsdn.com', opt_onLayout); } /** @override */ buildCallback() { this.dataId = user().assert( this.element.getAttribute('data-id'), 'The data-id attribute is required for <amp-3q-player> %s', this.element); this.playerReadyPromise_ = new Promise(resolve => { this.playerReadyResolver_ = resolve; }); installVideoManagerForDoc(this.element); videoManagerForDoc(this.element).register(this); } /** @override */ layoutCallback() { const iframe = this.element.ownerDocument.createElement('iframe'); iframe.setAttribute('frameborder', '0'); iframe.setAttribute('allowfullscreen', 'true'); this.iframe_ = iframe; this.unlistenMessage_ = listen( this.win, 'message', this.sdnBridge_.bind(this) ); this.applyFillContent(iframe, true); iframe.src = 'https://playout.3qsdn.com/' + encodeURIComponent(this.dataId) + '?autoplay=false&amp=true'; this.element.appendChild(iframe); return this.loadPromise(this.iframe_).then(() => this.playerReadyPromise_); } /** @override */ unlayoutCallback() { if (this.iframe_) { removeElement(this.iframe_); this.iframe_ = null; } if (this.unlistenMessage_) { this.unlistenMessage_(); } this.playerReadyPromise_ = new Promise(resolve => { this.playerReadyResolver_ = resolve; }); return true; } /** @override */ isLayoutSupported(layout) { return isLayoutSizeDefined(layout); } /** @override */ viewportCallback(visible) { this.element.dispatchCustomEvent(VideoEvents.VISIBILITY, {visible}); } /** @override */ pauseCallback() { if (this.iframe_) { this.pause(); } } sdnBridge_(event) { if (event.source) { if (event.source != this.iframe_.contentWindow) { return; } } const data = isObject(event.data) ? event.data : tryParseJson(event.data); if (data === undefined) { return; } switch (data.data) { case 'ready': this.element.dispatchCustomEvent(VideoEvents.LOAD); this.playerReadyResolver_(); break; case 'playing': this.element.dispatchCustomEvent(VideoEvents.PLAY); break; case 'paused': this.element.dispatchCustomEvent(VideoEvents.PAUSE); break; case 'muted': this.element.dispatchCustomEvent(VideoEvents.MUTED); break; case 'unmuted': this.element.dispatchCustomEvent(VideoEvents.UNMUTED); break; } } sdnPostMessage_(message) { this.playerReadyPromise_.then(() => { if (this.iframe_ && this.iframe_.contentWindow) { this.iframe_.contentWindow./*OK*/postMessage(message, '*'); } }); } // VideoInterface Implementation. See ../src/video-interface.VideoInterface /** @override */ play() { this.sdnPostMessage_('play2'); } /** @override */ pause() { this.sdnPostMessage_('pause'); } /** @override */ mute() { this.sdnPostMessage_('mute'); } /** @override */ unmute() { this.sdnPostMessage_('unmute'); } /** @override */ supportsPlatform() { return true; } /** @override */ isInteractive() { return true; } /** @override */ showControls() { this.sdnPostMessage_('showControlbar'); } /** @override */ hideControls() { this.sdnPostMessage_('hideControlbar'); } }; AMP.registerElement('amp-3q-player', Amp3QPlayer);
/** * Coder for Raspberry Pi * A simple platform for experimenting with web stuff. * http://goo.gl/coder * * Copyright 2013 Google Inc. 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. */ exports.settings={}; //These are dynamically updated by the runtime //settings.appname - the app id (folder) where your app is installed //settings.viewpath - prefix to where your view html files are located //settings.staticurl - base url path to static assets /static/apps/appname //settings.appurl - base url path to this app /app/appname exports.get_routes = [ { path:'/', handler:'index_handler' }, ]; exports.post_routes = [ ]; exports.index_handler = function( req, res ) { var tmplvars = {}; tmplvars['static_url'] = exports.settings.staticurl; tmplvars['app_name'] = exports.settings.appname; tmplvars['app_url'] = exports.settings.appurl; tmplvars['device_name'] = exports.settings.device_name; res.render( exports.settings.viewpath + '/index', tmplvars ); }; exports.on_destroy = function() { };
/* eslint strict:0 */ var modules = Object.create(null); var inGuard = false; function define(id, factory) { modules[id] = { factory, module: {exports: {}}, isInitialized: false, hasError: false, }; if (__DEV__) { // HMR Object.assign(modules[id].module, { hot: { acceptCallback: null, accept: function(callback) { modules[id].module.hot.acceptCallback = callback; } } }); } } function require(id) { var mod = modules[id]; if (mod && mod.isInitialized) { return mod.module.exports; } return requireImpl(id); } function requireImpl(id) { if (global.ErrorUtils && !inGuard) { inGuard = true; var returnValue; try { returnValue = requireImpl.apply(this, arguments); } catch (e) { global.ErrorUtils.reportFatalError(e); } inGuard = false; return returnValue; } var mod = modules[id]; if (!mod) { var msg = 'Requiring unknown module "' + id + '"'; if (__DEV__) { msg += '. If you are sure the module is there, try restarting the packager.'; } throw new Error(msg); } if (mod.hasError) { throw new Error( 'Requiring module "' + id + '" which threw an exception' ); } try { // We must optimistically mark mod as initialized before running the factory to keep any // require cycles inside the factory from causing an infinite require loop. mod.isInitialized = true; __DEV__ && Systrace().beginEvent('JS_require_' + id); // keep args in sync with with defineModuleCode in // packager/react-packager/src/Resolver/index.js mod.factory.call(global, global, require, mod.module, mod.module.exports); __DEV__ && Systrace().endEvent(); } catch (e) { mod.hasError = true; mod.isInitialized = false; throw e; } return mod.module.exports; } const Systrace = __DEV__ && (() => { var _Systrace; try { _Systrace = require('Systrace'); } catch (e) {} return _Systrace && _Systrace.beginEvent ? _Systrace : { beginEvent: () => {}, endEvent: () => {} }; }); global.__d = define; global.require = require; if (__DEV__) { // HMR function accept(id, factory) { var mod = modules[id]; if (!mod) { define(id, factory); return; // new modules don't need to be accepted } if (!mod.module.hot) { console.warn( 'Cannot accept module because Hot Module Replacement ' + 'API was not installed.' ); return; } if (mod.module.hot.acceptCallback) { mod.factory = factory; mod.isInitialized = false; require(id); mod.module.hot.acceptCallback(); } else { console.warn( '[HMR] Module `' + id + '` can\'t be hot reloaded because it ' + 'doesn\'t provide accept callback hook. Reload the app to get the updates.' ); } } global.__accept = accept; }
KB.onClick('.accordion-toggle', function (e) { var sectionElement = KB.dom(e.target).parent('.accordion-section'); if (sectionElement) { KB.dom(sectionElement).toggleClass('accordion-collapsed'); } });
alert("foo!");
})(); Clazz._coreLoaded = true;
/* Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'elementspath', 'si', { eleLabel: 'මුලද්‍රව්‍ය මාර්ගය', eleTitle: '%1 මුල' } );
/* YUI 3.8.0 (build 5744) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ YUI.add('anim-scroll', function (Y, NAME) { /** * Adds support for the <code>scroll</code> property in <code>to</code> * and <code>from</code> attributes. * @module anim * @submodule anim-scroll */ var NUM = Number; //TODO: deprecate for scrollTop/Left properties? Y.Anim.behaviors.scroll = { set: function(anim, att, from, to, elapsed, duration, fn) { var node = anim._node, val = ([ fn(elapsed, NUM(from[0]), NUM(to[0]) - NUM(from[0]), duration), fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration) ]); if (val[0]) { node.set('scrollLeft', val[0]); } if (val[1]) { node.set('scrollTop', val[1]); } }, get: function(anim) { var node = anim._node; return [node.get('scrollLeft'), node.get('scrollTop')]; } }; }, '3.8.0', {"requires": ["anim-base"]});
// Copyright 2007 The Closure Library Authors. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS-IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. /** * @fileoverview DOM pattern to match a sequence of other patterns. */ goog.provide('goog.dom.pattern.Sequence'); goog.require('goog.dom.NodeType'); goog.require('goog.dom.pattern'); goog.require('goog.dom.pattern.AbstractPattern'); goog.require('goog.dom.pattern.MatchType'); /** * Pattern object that matches a sequence of other patterns. * * @param {Array<goog.dom.pattern.AbstractPattern>} patterns Ordered array of * patterns to match. * @param {boolean=} opt_ignoreWhitespace Optional flag to ignore text nodes * consisting entirely of whitespace. The default is to not ignore them. * @constructor * @extends {goog.dom.pattern.AbstractPattern} * @final */ goog.dom.pattern.Sequence = function(patterns, opt_ignoreWhitespace) { /** * Ordered array of patterns to match. * * @type {Array<goog.dom.pattern.AbstractPattern>} */ this.patterns = patterns; /** * Whether or not to ignore whitespace only Text nodes. * * @private {boolean} */ this.ignoreWhitespace_ = !!opt_ignoreWhitespace; /** * Position in the patterns array we have reached by successful matches. * * @private {number} */ this.currentPosition_ = 0; }; goog.inherits(goog.dom.pattern.Sequence, goog.dom.pattern.AbstractPattern); /** * Regular expression for breaking text nodes. * @private {!RegExp} */ goog.dom.pattern.Sequence.BREAKING_TEXTNODE_RE_ = /^\s*$/; /** * Test whether the given token starts, continues, or finishes the sequence * of patterns given in the constructor. * * @param {Node} token Token to match against. * @param {goog.dom.TagWalkType} type The type of token. * @return {goog.dom.pattern.MatchType} <code>MATCH</code> if the pattern * matches, <code>MATCHING</code> if the pattern starts a match, and * <code>NO_MATCH</code> if the pattern does not match. * @override */ goog.dom.pattern.Sequence.prototype.matchToken = function(token, type) { // If the option is set, ignore any whitespace only text nodes if (this.ignoreWhitespace_ && token.nodeType == goog.dom.NodeType.TEXT && goog.dom.pattern.Sequence.BREAKING_TEXTNODE_RE_.test(token.nodeValue)) { return goog.dom.pattern.MatchType.MATCHING; } switch (this.patterns[this.currentPosition_].matchToken(token, type)) { case goog.dom.pattern.MatchType.MATCH: // Record the first token we match. if (this.currentPosition_ == 0) { this.matchedNode = token; } // Move forward one position. this.currentPosition_++; // Check if this is the last position. if (this.currentPosition_ == this.patterns.length) { this.reset(); return goog.dom.pattern.MatchType.MATCH; } else { return goog.dom.pattern.MatchType.MATCHING; } case goog.dom.pattern.MatchType.MATCHING: // This can happen when our child pattern is a sequence or a repetition. return goog.dom.pattern.MatchType.MATCHING; case goog.dom.pattern.MatchType.BACKTRACK_MATCH: // This means a repetitive match succeeded 1 token ago. // TODO(robbyw): Backtrack further if necessary. this.currentPosition_++; if (this.currentPosition_ == this.patterns.length) { this.reset(); return goog.dom.pattern.MatchType.BACKTRACK_MATCH; } else { // Retry the same token on the next pattern. return this.matchToken(token, type); } default: this.reset(); return goog.dom.pattern.MatchType.NO_MATCH; } }; /** * Reset any internal state this pattern keeps. * @override */ goog.dom.pattern.Sequence.prototype.reset = function() { if (this.patterns[this.currentPosition_]) { this.patterns[this.currentPosition_].reset(); } this.currentPosition_ = 0; };
angular.module('ordercloud-address', []) .directive('ordercloudAddressForm', AddressFormDirective) .directive('ordercloudAddressInfo', AddressInfoDirective) .filter('address', AddressFilter) ; function AddressFormDirective(OCGeography) { return { restrict: 'E', scope: { address: '=', isbilling: '=' }, templateUrl: 'common/address/templates/address.form.tpl.html', link: function(scope) { scope.countries = OCGeography.Countries; scope.states = OCGeography.States; } }; } function AddressInfoDirective() { return { restrict: 'E', scope: { addressid: '@' }, templateUrl: 'common/address/templates/address.info.tpl.html', controller: 'AddressInfoCtrl', controllerAs: 'addressInfo' }; } function AddressFilter() { return function(address, option) { if (!address) return null; if (option === 'full') { var result = []; if (address.AddressName) { result.push(address.AddressName); } result.push((address.FirstName ? address.FirstName + ' ' : '') + address.LastName); result.push(address.Street1); if (address.Street2) { result.push(address.Street2); } result.push(address.City + ', ' + address.State + ' ' + address.Zip); return result.join('\n'); } else { return address.Street1 + (address.Street2 ? ', ' + address.Street2 : ''); } } }
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ (function() { 'use strict'; var ALERT_FETCH_LIMIT = 1000 * 60 * 60 * 12; var ALERT_REFRESH_INTERVAL = 1000 * 10; var ALERT_TEMPLATE = '#/site/${siteId}/alert/detail/${alertId}?timestamp=${timestamp}'; var serviceModule = angular.module('eagle.service'); serviceModule.service('Alert', function ($notification, Time, CompatibleEntity) { var Alert = { list: null, }; $notification.getPromise().then(function () { function queryAlerts() { var endTime = new Time(); var list = CompatibleEntity.query("LIST", { query: "AlertService", startTime: endTime.clone().subtract(ALERT_FETCH_LIMIT, 'ms'), endTime: endTime }); list._then(function () { if (!Alert.list) { Alert.list = list; return; } var subList = common.array.minus(list, Alert.list, ['encodedRowkey'], ['encodedRowkey']); Alert.list = list; $.each(subList, function (i, alert) { $notification(alert.alertSubject, common.template(ALERT_TEMPLATE, { siteId: alert.tags.siteId, alertId: alert.tags.alertId, timestamp: alert.timestamp, })); }); }); } queryAlerts(); setInterval(queryAlerts, ALERT_REFRESH_INTERVAL); }); return Alert; }); })();
/*jshint globalstrict:false, strict:false, unused : false */ /*global assertEqual, assertFalse, assertTrue */ //////////////////////////////////////////////////////////////////////////////// /// @brief tests for dump/reload /// /// @file /// /// DISCLAIMER /// /// Copyright 2010-2012 triagens GmbH, Cologne, Germany /// /// 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. /// /// Copyright holder is triAGENS GmbH, Cologne, Germany /// /// @author Jan Steemann /// @author Copyright 2012, triAGENS GmbH, Cologne, Germany //////////////////////////////////////////////////////////////////////////////// var db = require("org/arangodb").db; var internal = require("internal"); var jsunity = require("jsunity"); function runSetup () { 'use strict'; internal.debugClearFailAt(); db._drop("UnitTestsRecovery1"); var c = db._create("UnitTestsRecovery1"), i; c.ensureSkiplist("value"); for (i = 0; i < 1000; ++i) { c.save({ value: i }); } db._drop("UnitTestsRecovery2"); c = db._create("UnitTestsRecovery2"); c.ensureUniqueSkiplist("a.value"); for (i = 0; i < 1000; ++i) { c.save({ a: { value: i } }); } db._drop("UnitTestsRecovery3"); c = db._create("UnitTestsRecovery3"); c.ensureSkiplist("a", "b"); for (i = 0; i < 500; ++i) { c.save({ a: (i % 2) + 1, b: 1 }); c.save({ a: (i % 2) + 1, b: 2 }); } db._drop("test"); c = db._create("test"); c.save({ _key: "crashme" }, true); internal.debugSegfault("crashing server"); } //////////////////////////////////////////////////////////////////////////////// /// @brief test suite //////////////////////////////////////////////////////////////////////////////// function recoverySuite () { 'use strict'; jsunity.jsUnity.attachAssertions(); return { setUp: function () { }, tearDown: function () { }, //////////////////////////////////////////////////////////////////////////////// /// @brief test whether we can restore the trx data //////////////////////////////////////////////////////////////////////////////// testIndexesSkiplist : function () { var c = db._collection("UnitTestsRecovery1"), idx, i; idx = c.getIndexes()[1]; assertFalse(idx.unique); assertFalse(idx.sparse); assertEqual([ "value" ], idx.fields); for (i = 0; i < 1000; ++i) { assertEqual(1, c.byExampleSkiplist(idx.id, { value: i }).toArray().length); } c = db._collection("UnitTestsRecovery2"); idx = c.getIndexes()[1]; assertTrue(idx.unique); assertFalse(idx.sparse); assertEqual([ "a.value" ], idx.fields); for (i = 0; i < 1000; ++i) { assertEqual(1, c.byExampleSkiplist(idx.id, { "a.value" : i }).toArray().length); } c = db._collection("UnitTestsRecovery3"); idx = c.getIndexes()[1]; assertFalse(idx.unique); assertFalse(idx.sparse); assertEqual([ "a", "b" ], idx.fields); assertEqual(250, c.byExampleSkiplist(idx.id, { a: 1, b: 1 }).toArray().length); assertEqual(250, c.byExampleSkiplist(idx.id, { a: 1, b: 2 }).toArray().length); assertEqual(250, c.byExampleSkiplist(idx.id, { a: 2, b: 1 }).toArray().length); assertEqual(250, c.byExampleSkiplist(idx.id, { a: 2, b: 2 }).toArray().length); } }; } //////////////////////////////////////////////////////////////////////////////// /// @brief executes the test suite //////////////////////////////////////////////////////////////////////////////// function main (argv) { 'use strict'; if (argv[1] === "setup") { runSetup(); return 0; } else { jsunity.run(recoverySuite); return jsunity.done().status ? 0 : 1; } }
// Any copyright is dedicated to the Public Domain. // http://creativecommons.org/licenses/publicdomain/ //----------------------------------------------------------------------------- var BUGNUMBER = 565604; var summary = "Typed-array properties don't work when accessed from an object whose " + "prototype (or further-descended prototype) is a typed array"; print(BUGNUMBER + ": " + summary); /************** * BEGIN TEST * **************/ var o = Object.create(new Uint8Array(1)); assertEq(o.length, 1); var o2 = Object.create(o); assertEq(o2.length, 1); var VARIABLE_OBJECT = {}; var props = [ { property: "length", value: 1 }, { property: "byteLength", value: 1 }, { property: "byteOffset", value: 0 }, { property: "buffer", value: VARIABLE_OBJECT }, ]; for (var i = 0, sz = props.length; i < sz; i++) { var p = props[i]; var o = Object.create(new Uint8Array(1)); var v = o[p.property]; if (p.value !== VARIABLE_OBJECT) assertEq(o[p.property], p.value, "bad " + p.property + " (proto)"); var o2 = Object.create(o); if (p.value !== VARIABLE_OBJECT) assertEq(o2[p.property], p.value, "bad " + p.property + " (grand-proto)"); assertEq(o2[p.property], v, p.property + " mismatch"); } reportCompare(true, true);
import AuthenticatedRoute from 'ghost/routes/authenticated'; import CurrentUserSettings from 'ghost/mixins/current-user-settings'; import styleBody from 'ghost/mixins/style-body'; var AppsRoute = AuthenticatedRoute.extend(styleBody, CurrentUserSettings, { titleToken: 'Apps', classNames: ['settings-view-apps'], beforeModel: function () { if (!this.get('config.apps')) { return this.transitionTo('settings.general'); } return this.get('session.user') .then(this.transitionAuthor()) .then(this.transitionEditor()); }, model: function () { return this.store.find('app'); } }); export default AppsRoute;
import Ember from 'ember-metal'; // Ember as namespace import { A as emberA, typeOf, String as StringUtils, Namespace, Object as EmberObject } from 'ember-runtime'; /** @module ember @submodule ember-extension-support */ /** The `ContainerDebugAdapter` helps the container and resolver interface with tools that debug Ember such as the [Ember Extension](https://github.com/tildeio/ember-extension) for Chrome and Firefox. This class can be extended by a custom resolver implementer to override some of the methods with library-specific code. The methods likely to be overridden are: * `canCatalogEntriesByType` * `catalogEntriesByType` The adapter will need to be registered in the application's container as `container-debug-adapter:main`. Example: ```javascript Application.initializer({ name: "containerDebugAdapter", initialize(application) { application.register('container-debug-adapter:main', require('app/container-debug-adapter')); } }); ``` @class ContainerDebugAdapter @namespace Ember @extends Ember.Object @since 1.5.0 @public */ export default EmberObject.extend({ /** The resolver instance of the application being debugged. This property will be injected on creation. @property resolver @default null @public */ resolver: null, /** Returns true if it is possible to catalog a list of available classes in the resolver for a given type. @method canCatalogEntriesByType @param {String} type The type. e.g. "model", "controller", "route". @return {boolean} whether a list is available for this type. @public */ canCatalogEntriesByType(type) { if (type === 'model' || type === 'template') { return false; } return true; }, /** Returns the available classes a given type. @method catalogEntriesByType @param {String} type The type. e.g. "model", "controller", "route". @return {Array} An array of strings. @public */ catalogEntriesByType(type) { let namespaces = emberA(Namespace.NAMESPACES); let types = emberA(); let typeSuffixRegex = new RegExp(`${StringUtils.classify(type)}$`); namespaces.forEach(namespace => { if (namespace !== Ember) { for (let key in namespace) { if (!namespace.hasOwnProperty(key)) { continue; } if (typeSuffixRegex.test(key)) { let klass = namespace[key]; if (typeOf(klass) === 'class') { types.push(StringUtils.dasherize(key.replace(typeSuffixRegex, ''))); } } } } }); return types; } });
(function ($) { 'use strict'; $.extend(true, $.trumbowyg, { langs: { // jshint camelcase:false en: { fontFamily: 'Font' }, es: { fontFamily: 'Fuente' }, da: { fontFamily: 'Skrifttype' }, fr: { fontFamily: 'Police' }, de: { fontFamily: 'Schriftart' }, nl: { fontFamily: 'Lettertype' }, tr: { fontFamily: 'Yazı Tipi' }, zh_tw: { fontFamily: '字體', }, pt_br: { fontFamily: 'Fonte', } } }); // jshint camelcase:true var defaultOptions = { fontList: [ {name: 'Arial', family: 'Arial, Helvetica, sans-serif'}, {name: 'Arial Black', family: '\'Arial Black\', Gadget, sans-serif'}, {name: 'Comic Sans', family: '\'Comic Sans MS\', Textile, cursive, sans-serif'}, {name: 'Courier New', family: '\'Courier New\', Courier, monospace'}, {name: 'Georgia', family: 'Georgia, serif'}, {name: 'Impact', family: 'Impact, Charcoal, sans-serif'}, {name: 'Lucida Console', family: '\'Lucida Console\', Monaco, monospace'}, {name: 'Lucida Sans', family: '\'Lucida Sans Uncide\', \'Lucida Grande\', sans-serif'}, {name: 'Palatino', family: '\'Palatino Linotype\', \'Book Antiqua\', Palatino, serif'}, {name: 'Tahoma', family: 'Tahoma, Geneva, sans-serif'}, {name: 'Times New Roman', family: '\'Times New Roman\', Times, serif'}, {name: 'Trebuchet', family: '\'Trebuchet MS\', Helvetica, sans-serif'}, {name: 'Verdana', family: 'Verdana, Geneva, sans-serif'} ] }; // Add dropdown with web safe fonts $.extend(true, $.trumbowyg, { plugins: { fontfamily: { init: function (trumbowyg) { trumbowyg.o.plugins.fontfamily = $.extend(true, {}, defaultOptions, trumbowyg.o.plugins.fontfamily || {} ); trumbowyg.addBtnDef('fontfamily', { dropdown: buildDropdown(trumbowyg), hasIcon: false, text: trumbowyg.lang.fontFamily }); } } } }); function buildDropdown(trumbowyg) { var dropdown = []; $.each(trumbowyg.o.plugins.fontfamily.fontList, function (index, font) { trumbowyg.addBtnDef('fontfamily_' + index, { title: '<span style="font-family: ' + font.family + ';">' + font.name + '</span>', hasIcon: false, fn: function () { trumbowyg.execCmd('fontName', font.family, true); } }); dropdown.push('fontfamily_' + index); }); return dropdown; } })(jQuery);
s = new ShardingTest( "diffservers1" , 2 ); assert.eq( 2 , s.config.shards.count() , "server count wrong" ); assert.eq( 2 , s._connections[0].getDB( "config" ).shards.count() , "where are servers!" ); assert.eq( 0 , s._connections[1].getDB( "config" ).shards.count() , "shouldn't be here" ); test1 = s.getDB( "test1" ).foo; test1.save( { a : 1 } ); test1.save( { a : 2 } ); test1.save( { a : 3 } ); assert( 3 , test1.count() ); assert( ! s.admin.runCommand( { addshard: "sdd$%" } ).ok , "bad hostname" ); assert( ! s.admin.runCommand( { addshard: "127.0.0.1:43415" } ).ok , "host not up" ); assert( ! s.admin.runCommand( { addshard: "10.0.0.1:43415" } ).ok , "allowed shard in IP when config is localhost" ); s.stop();
// ========================================== // RECESS // RULE: .js prefixes should not be styled // ========================================== // Copyright 2012 Twitter, Inc // Licensed under the Apache License v2.0 // http://www.apache.org/licenses/LICENSE-2.0 // ========================================== 'use strict' var util = require('../util') , RULE = { type: 'noJSPrefix' , exp: /^\.js\-/ , message: '.js prefixes should not be styled' } // validation method module.exports = function (def, data) { // default validation to true var isValid = true // return if no selector to validate if (!def.selectors) return isValid // loop over selectors def.selectors.forEach(function (selector) { // loop over selector entities selector.elements.forEach(function (element) { var extract // continue to next element if .js- prefix not styled if (!RULE.exp.test(element.value)) return // calculate line number for the extract extract = util.getLine(element.index - element.value.length, data) extract = util.padLine(extract) // highlight invalid styling of .js- prefix extract += element.value.replace(RULE.exp, '.js-'.magenta) // set invalid flag to false isValid = false // set error object on defintion token util.throwError(def, { type: RULE.type , message: RULE.message , extract: extract }) }) }) // return valid state return isValid }
module.exports.twitter = function twitter(username) { // Creates the canonical twitter URL without the '@' return 'https://twitter.com/' + username.replace(/^@/, ''); }; module.exports.facebook = function facebook(username) { // Handles a starting slash, this shouldn't happen, but just in case return 'https://www.facebook.com/' + username.replace(/^\//, ''); };
var utils = exports; var uglify = require('uglify-js'); utils.extend = function extend(target, source) { Object.keys(source).forEach(function (key) { target[key] = source[key]; }); }; utils.beautify = function beautify(code) { var ast = uglify.parser.parse(code); return uglify.uglify.gen_code(ast, { beautify: true }); }; utils.expressionify = function expressionify(code) { try { var ast = uglify.parser.parse('(function(){\n' + code + '\n})'); } catch(e) { console.error(e.message + ' on ' + (e.line - 1) + ':' + e.pos); console.error('in'); console.error(code); throw e; } ast[1] = ast[1][0][1][3]; function traverse(ast) { if (!Array.isArray(ast)) return ast; switch (ast[0]) { case 'toplevel': if (ast[1].length === 1 && ast[1][0][0] !== 'block') { return ast; } else { var children = ast[1][0][0] === 'block' ? ast[1][0][1] : ast[1]; return ['toplevel', [[ 'call', [ 'dot', [ 'function', null, [], children.map(function(child, i, children) { return (i == children.length - 1) ? traverse(child) : child; }) ], 'call' ], [ ['name', 'this'] ] ]]]; } case 'block': // Empty blocks can't be processed if (ast[1].length <= 0) return ast; var last = ast[1][ast[1].length - 1]; return [ ast[0], ast[1].slice(0, -1).concat([traverse(last)]) ]; case 'while': case 'for': case 'switch': return ast; case 'if': return [ 'if', ast[1], traverse(ast[2]), traverse(ast[3]) ]; case 'stat': return [ 'stat', traverse(ast[1]) ]; default: if (ast[0] === 'return') return ast; return [ 'return', ast ] } return ast; } return uglify.uglify.gen_code(traverse(ast)).replace(/;$/, ''); }; utils.localify = function localify(code, id) { var ast = uglify.parser.parse(code); if (ast[1].length !== 1 || ast[1][0][0] !== 'stat') { throw new TypeError('Incorrect code for local: ' + code); } var vars = [], set = [], unset = []; function traverse(node) { if (node[0] === 'assign') { if (node[1] !== true) { throw new TypeError('Incorrect assignment in local'); } if (node[2][0] === 'dot' || node[2][0] === 'sub') { var host = ['name', '$l' + id++]; vars.push(host[1]); set.push(['assign', true, host, node[2][1]]); node[2][1] = host; if (node[2][0] === 'sub') { var property = ['name', '$l' + id++]; vars.push(property[1]); set.push(['assign', true, property, node[2][2]]); node[2][2] = property; } } var target = ['name', '$l' + id++]; vars.push(target[1]); set.push(['assign', true, target, node[2]]); set.push(['assign', true, node[2], node[3]]); unset.push(['assign', true, node[2], target]); } else if (node[0] === 'seq') { traverse(node[1]); traverse(node[2]); } else { throw new TypeError( 'Incorrect code for local (' + node[0] + '): ' + code ); } } traverse(ast[1][0][1]); function generate(seqs) { return uglify.uglify.gen_code(seqs.reduce(function (current, acc) { return ['seq', current, acc]; })); } return { vars: vars, before: generate(set.concat([['name', 'true']])), afterSuccess: generate(unset.concat([['name', 'true']])), afterFail: generate(unset.concat([['name', 'false']])) }; }; utils.merge = function merge(a, b) { Object.keys(b).forEach(function(key) { a[key] = b[key]; }); };
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ /* * Plugin to hide series in flot graphs. * * To activate, set legend.hideable to true in the flot options object. * To hide one or more series by default, set legend.hidden to an array of * label strings. * * At the moment, this only works with line and point graphs. * * Example: * * var plotdata = [ * { * data: [[1, 1], [2, 1], [3, 3], [4, 2], [5, 5]], * label: "graph 1" * }, * { * data: [[1, 0], [2, 1], [3, 0], [4, 4], [5, 3]], * label: "graph 2" * } * ]; * * plot = $.plot($("#placeholder"), plotdata, { * series: { * points: { show: true }, * lines: { show: true } * }, * legend: { * hideable: true, * hidden: ["graph 1", "graph 2"] * } * }); * */ (function ($) { var options = { }; var drawnOnce = false; function init(plot) { function findPlotSeries(label) { var plotdata = plot.getData(); for (var i = 0; i < plotdata.length; i++) { if (plotdata[i].label == label) { return plotdata[i]; } } return null; } function plotLabelClicked(label, mouseOut) { var series = findPlotSeries(label); if (!series) { return; } var switchedOff = false; if (typeof series.points.oldShow === "undefined") { series.points.oldShow = false; } if (typeof series.lines.oldShow === "undefined") { series.lines.oldShow = false; } if (series.points.show && !series.points.oldShow) { series.points.show = false; series.points.oldShow = true; switchedOff = true; } if (series.lines.show && !series.lines.oldShow) { series.lines.show = false; series.lines.oldShow = true; switchedOff = true; } if (switchedOff) { series.oldColor = series.color; series.color = "#fff"; } else { var switchedOn = false; if (!series.points.show && series.points.oldShow) { series.points.show = true; series.points.oldShow = false; switchedOn = true; } if (!series.lines.show && series.lines.oldShow) { series.lines.show = true; series.lines.oldShow = false; switchedOn = true; } if (switchedOn) { series.color = series.oldColor; } } // HACK: Reset the data, triggering recalculation of graph bounds plot.setData(plot.getData()); plot.setupGrid(); plot.draw(); } function plotLabelHandlers(plot, options) { $(".graphlabel").mouseenter(function() { $(this).css("cursor", "pointer"); }) .mouseleave(function() { $(this).css("cursor", "default"); }) .unbind("click").click(function() { plotLabelClicked($(this).parent().text()); }); if (!drawnOnce) { drawnOnce = true; if (options.legend.hidden) { for (var i = 0; i < options.legend.hidden.length; i++) { plotLabelClicked(options.legend.hidden[i], true); } } } } function checkOptions(plot, options) { if (!options.legend.hideable) { return; } options.legend.labelFormatter = function(label, series) { return '<span class="graphlabel">' + label + '</span>'; }; // Really just needed for initial draw; the mouse-enter/leave // functions will call plotLabelHandlers() directly, since they // only call setupGrid(). plot.hooks.draw.push(function (plot, ctx) { plotLabelHandlers(plot, options); }); } plot.hooks.processOptions.push(checkOptions); function hideDatapointsIfNecessary(plot, s, datapoints) { if (!plot.getOptions().legend.hideable) { return; } if (!s.points.show && !s.lines.show) { s.datapoints.format = [ null, null ]; } } plot.hooks.processDatapoints.push(hideDatapointsIfNecessary); } $.plot.plugins.push({ init: init, options: options, name: 'hiddenGraphs', version: '1.0' }); })(jQuery);
//DO NOT DELETE THIS, this is in use... angular.module('umbraco') .controller("Umbraco.PropertyEditors.MacroContainerController", function($scope, dialogService, entityResource, macroService){ $scope.renderModel = []; $scope.allowOpenButton = true; $scope.allowRemoveButton = true; $scope.sortableOptions = {}; if($scope.model.value){ var macros = $scope.model.value.split('>'); angular.forEach(macros, function(syntax, key){ if(syntax && syntax.length > 10){ //re-add the char we split on syntax = syntax + ">"; var parsed = macroService.parseMacroSyntax(syntax); if(!parsed){ parsed = {}; } parsed.syntax = syntax; collectDetails(parsed); $scope.renderModel.push(parsed); setSortingState($scope.renderModel); } }); } function collectDetails(macro){ macro.details = ""; macro.icon = "icon-settings-alt"; if(macro.macroParamsDictionary){ angular.forEach((macro.macroParamsDictionary), function(value, key){ macro.details += key + ": " + value + " "; }); } } function openDialog(index){ var dialogData = { allowedMacros: $scope.model.config.allowed }; if(index !== null && $scope.renderModel[index]) { var macro = $scope.renderModel[index]; dialogData["macroData"] = macro; } $scope.macroPickerOverlay = {}; $scope.macroPickerOverlay.view = "macropicker"; $scope.macroPickerOverlay.dialogData = dialogData; $scope.macroPickerOverlay.show = true; $scope.macroPickerOverlay.submit = function(model) { var macroObject = macroService.collectValueData(model.selectedMacro, model.macroParams, dialogData.renderingEngine); collectDetails(macroObject); //update the raw syntax and the list... if(index !== null && $scope.renderModel[index]) { $scope.renderModel[index] = macroObject; } else { $scope.renderModel.push(macroObject); } setSortingState($scope.renderModel); $scope.macroPickerOverlay.show = false; $scope.macroPickerOverlay = null; }; $scope.macroPickerOverlay.close = function(oldModel) { $scope.macroPickerOverlay.show = false; $scope.macroPickerOverlay = null; }; } $scope.edit =function(index){ openDialog(index); }; $scope.add = function () { if ($scope.model.config.max && $scope.model.config.max > 0 && $scope.renderModel.length >= $scope.model.config.max) { //cannot add more than the max return; } openDialog(); }; $scope.remove =function(index){ $scope.renderModel.splice(index, 1); setSortingState($scope.renderModel); }; $scope.clear = function() { $scope.model.value = ""; $scope.renderModel = []; }; var unsubscribe = $scope.$on("formSubmitting", function (ev, args) { var syntax = []; angular.forEach($scope.renderModel, function(value, key){ syntax.push(value.syntax); }); $scope.model.value = syntax.join(""); }); //when the scope is destroyed we need to unsubscribe $scope.$on('$destroy', function () { unsubscribe(); }); function trim(str, chr) { var rgxtrim = (!chr) ? new RegExp('^\\s+|\\s+$', 'g') : new RegExp('^'+chr+'+|'+chr+'+$', 'g'); return str.replace(rgxtrim, ''); } function setSortingState(items) { // disable sorting if the list only consist of one item if(items.length > 1) { $scope.sortableOptions.disabled = false; } else { $scope.sortableOptions.disabled = true; } } });
// Copyright 2014 The Oppia Authors. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS-IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. /** * @fileoverview Unit tests for the editor prerequisites page. */ describe('Signup controller', function() { describe('SignupCtrl', function() { var scope, ctrl, $httpBackend, rootScope, mockAlertsService, urlParams; beforeEach(module('oppia', GLOBALS.TRANSLATOR_PROVIDER_FOR_TESTS)); beforeEach(inject(function(_$httpBackend_, $http, $rootScope, $controller) { $httpBackend = _$httpBackend_; $httpBackend.expectGET('/signuphandler/data').respond({ username: 'myUsername', has_agreed_to_latest_terms: false }); rootScope = $rootScope; mockAlertsService = { addWarning: function() {} }; spyOn(mockAlertsService, 'addWarning'); scope = { getUrlParams: function() { return { return_url: 'return_url' }; } }; ctrl = $controller('Signup', { $scope: scope, $http: $http, $rootScope: rootScope, alertsService: mockAlertsService }); })); it('should show warning if user has not agreed to terms', function() { scope.submitPrerequisitesForm(false, null); expect(mockAlertsService.addWarning).toHaveBeenCalledWith( 'I18N_SIGNUP_ERROR_MUST_AGREE_TO_TERMS'); }); it('should get data correctly from the server', function() { $httpBackend.flush(); expect(scope.username).toBe('myUsername'); expect(scope.hasAgreedToLatestTerms).toBe(false); }); it('should show a loading message until the data is retrieved', function() { expect(rootScope.loadingMessage).toBe('I18N_SIGNUP_LOADING'); $httpBackend.flush(); expect(rootScope.loadingMessage).toBeFalsy(); }); it('should show warning if terms are not agreed to', function() { scope.submitPrerequisitesForm(false, ''); expect(mockAlertsService.addWarning).toHaveBeenCalledWith( 'I18N_SIGNUP_ERROR_MUST_AGREE_TO_TERMS'); }); it('should show warning if no username provided', function() { scope.updateWarningText(''); expect(scope.warningI18nCode).toEqual('I18N_SIGNUP_ERROR_NO_USERNAME'); scope.submitPrerequisitesForm(false); expect(scope.warningI18nCode).toEqual('I18N_SIGNUP_ERROR_NO_USERNAME'); }); it('should show warning if username is too long', function() { scope.updateWarningText( 'abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba'); expect(scope.warningI18nCode).toEqual( 'I18N_SIGNUP_ERROR_USERNAME_MORE_50_CHARS'); }); it('should show warning if username has non-alphanumeric characters', function() { scope.updateWarningText('a-a'); expect(scope.warningI18nCode).toEqual( 'I18N_SIGNUP_ERROR_USERNAME_ONLY_ALPHANUM'); }); it('should show warning if username has \'admin\' in it', function() { scope.updateWarningText('administrator'); expect(scope.warningI18nCode).toEqual( 'I18N_SIGNUP_ERROR_USERNAME_WITH_ADMIN'); }); }); });
(function (enyo, scope) { /** * The {@link enyo.RepeaterChildSupport} [mixin]{@glossary mixin} contains methods and * properties that are automatically applied to all children of {@link enyo.DataRepeater} * to assist in selection support. (See {@link enyo.DataRepeater} for details on how to * use selection support.) This mixin also [adds]{@link enyo.Repeater#decorateEvent} the * `model`, `child` ([control]{@link enyo.Control} instance), and `index` properties to * all [events]{@glossary event} emitted from the repeater's children. * * @mixin enyo.RepeaterChildSupport * @public */ enyo.RepeaterChildSupport = { /* * @private */ name: 'RepeaterChildSupport', /** * Indicates whether the current child is selected in the [repeater]{@link enyo.DataRepeater}. * * @type {Boolean} * @default false * @public */ selected: false, /* * @method * @private */ selectedChanged: enyo.inherit(function (sup) { return function () { if (this.repeater.selection) { this.addRemoveClass(this.selectedClass || 'selected', this.selected); // for efficiency purposes, we now directly call this method as opposed to // forcing a synchronous event dispatch var idx = this.repeater.collection.indexOf(this.model); if (this.selected && !this.repeater.isSelected(this.model)) { this.repeater.select(idx); } else if (!this.selected && this.repeater.isSelected(this.model)) { this.repeater.deselect(idx); } } sup.apply(this, arguments); }; }), /* * @method * @private */ decorateEvent: enyo.inherit(function (sup) { return function (sender, event) { event.model = this.model; event.child = this; event.index = this.repeater.collection.indexOf(this.model); sup.apply(this, arguments); }; }), /* * @private */ _selectionHandler: function () { if (this.repeater.selection && !this.get('disabled')) { if (!this.repeater.groupSelection || !this.selected) { this.set('selected', !this.selected); } } }, /** * Deliberately used to supersede the default method and set * [owner]{@link enyo.Component#owner} to this [control]{@link enyo.Control} so that there * are no name collisions in the instance [owner]{@link enyo.Component#owner}, and also so * that [bindings]{@link enyo.Binding} will correctly map to names. * * @method * @private */ createClientComponents: enyo.inherit(function () { return function (components) { this.createComponents(components, {owner: this}); }; }), /** * Used so that we don't stomp on any built-in handlers for the `ontap` * {@glossary event}. * * @method * @private */ dispatchEvent: enyo.inherit(function (sup) { return function (name, event, sender) { if (!event._fromRepeaterChild) { if (!!~enyo.indexOf(name, this.repeater.selectionEvents)) { this._selectionHandler(); event._fromRepeaterChild = true; } } return sup.apply(this, arguments); }; }), /* * @method * @private */ constructed: enyo.inherit(function (sup) { return function () { sup.apply(this, arguments); var r = this.repeater, s = r.selectionProperty; // this property will only be set if the instance of the repeater needs // to track the selected state from the view and model and keep them in sync if (s) { var bnd = this.binding({ from: 'model.' + s, to: 'selected', oneWay: false/*, kind: enyo.BooleanBinding*/ }); this._selectionBindingId = bnd.euid; } }; }), /* * @method * @private */ destroy: enyo.inherit(function (sup) { return function () { if (this._selectionBindingId) { var b$ = enyo.Binding.find(this._selectionBindingId); if (b$) { b$.destroy(); } } sup.apply(this, arguments); }; }), /* * @private */ _selectionBindingId: null }; })(enyo, this);
/*! * Copyright (c) 2015, Salesforce.com, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of Salesforce.com nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ 'use strict'; var vows = require('vows'); var assert = require('assert'); var async = require('async'); var tough = require('../lib/cookie'); var Cookie = tough.Cookie; var CookieJar = tough.CookieJar; var atNow = Date.now(); function at(offset) { return {now: new Date(atNow + offset)}; } vows .describe('Regression tests') .addBatch({ "Issue 1": { topic: function () { var cj = new CookieJar(); cj.setCookie('hello=world; path=/some/path/', 'http://domain/some/path/file', function (err, cookie) { this.callback(err, {cj: cj, cookie: cookie}); }.bind(this)); }, "stored a cookie": function (t) { assert.ok(t.cookie); }, "getting it back": { topic: function (t) { t.cj.getCookies('http://domain/some/path/file', function (err, cookies) { this.callback(err, {cj: t.cj, cookies: cookies || []}); }.bind(this)); }, "got one cookie": function (t) { assert.lengthOf(t.cookies, 1); }, "it's the right one": function (t) { var c = t.cookies[0]; assert.equal(c.key, 'hello'); assert.equal(c.value, 'world'); } } } }) .addBatch({ "trailing semi-colon set into cj": { topic: function () { var cb = this.callback; var cj = new CookieJar(); var ex = 'http://www.example.com'; var tasks = []; tasks.push(function (next) { cj.setCookie('broken_path=testme; path=/;', ex, at(-1), next); }); tasks.push(function (next) { cj.setCookie('b=2; Path=/;;;;', ex, at(-1), next); }); async.parallel(tasks, function (err, cookies) { cb(null, { cj: cj, cookies: cookies }); }); }, "check number of cookies": function (t) { assert.lengthOf(t.cookies, 2, "didn't set"); }, "check *broken_path* was set properly": function (t) { assert.equal(t.cookies[0].key, "broken_path"); assert.equal(t.cookies[0].value, "testme"); assert.equal(t.cookies[0].path, "/"); }, "check *b* was set properly": function (t) { assert.equal(t.cookies[1].key, "b"); assert.equal(t.cookies[1].value, "2"); assert.equal(t.cookies[1].path, "/"); }, "retrieve the cookie": { topic: function (t) { var cb = this.callback; t.cj.getCookies('http://www.example.com', {}, function (err, cookies) { t.cookies = cookies; cb(err, t); }); }, "get the cookie": function (t) { assert.lengthOf(t.cookies, 2); assert.equal(t.cookies[0].key, 'broken_path'); assert.equal(t.cookies[0].value, 'testme'); assert.equal(t.cookies[1].key, "b"); assert.equal(t.cookies[1].value, "2"); assert.equal(t.cookies[1].path, "/"); } } } }) .addBatch({ "tough-cookie throws exception on malformed URI (GH-32)": { topic: function () { var url = "http://www.example.com/?test=100%"; var cj = new CookieJar(); cj.setCookieSync("Test=Test", url); return cj.getCookieStringSync(url); }, "cookies are set": function (cookieStr) { assert.strictEqual(cookieStr, "Test=Test"); } } }) .export(module);
import * as RSVP from 'rsvp'; import { backburner, _rsvpErrorQueue } from '@ember/runloop'; import { getDispatchOverride } from '@ember/-internals/error-handling'; import { assert } from '@ember/debug'; RSVP.configure('async', (callback, promise) => { backburner.schedule('actions', null, callback, promise); }); RSVP.configure('after', cb => { backburner.schedule(_rsvpErrorQueue, null, cb); }); RSVP.on('error', onerrorDefault); export function onerrorDefault(reason) { let error = errorFor(reason); if (error) { let overrideDispatch = getDispatchOverride(); if (overrideDispatch) { overrideDispatch(error); } else { throw error; } } } function errorFor(reason) { if (!reason) return; if (reason.errorThrown) { return unwrapErrorThrown(reason); } if (reason.name === 'UnrecognizedURLError') { assert(`The URL '${reason.message}' did not match any routes in your application`, false); return; } if (reason.name === 'TransitionAborted') { return; } return reason; } function unwrapErrorThrown(reason) { let error = reason.errorThrown; if (typeof error === 'string') { error = new Error(error); } Object.defineProperty(error, '__reason_with_error_thrown__', { value: reason, enumerable: false, }); return error; } export default RSVP;