text
stringlengths
2
6.14k
function Point() { this.x = 3; } var x = new Point(); // error at "new"
// Copyright (c) 2012 Ecma International. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- es5id: 15.2.3.6-4-523 description: > ES5 Attributes - property ([[Get]] is a Function, [[Set]] is undefined, [[Enumerable]] is false, [[Configurable]] is false) is non-enumerable ---*/ var obj = {}; var getFunc = function () { return 1001; }; Object.defineProperty(obj, "prop", { get: getFunc, set: undefined, enumerable: false, configurable: false }); var propertyDefineCorrect = obj.hasOwnProperty("prop"); var desc = Object.getOwnPropertyDescriptor(obj, "prop"); for (var p in obj) { assert.notSameValue(p, "prop", 'p'); } assert(propertyDefineCorrect, 'propertyDefineCorrect !== true'); assert.sameValue(desc.enumerable, false, 'desc.enumerable');
/** * Allows for tracking changes to a file input object (<input type="file" ...>) * By adding the attribute file-input-handler and setting it to a function, its possible * to record the name of the file that has been selected */ (function () { 'use strict'; var pluginName = 'vdb-bench.widgets'; var pluginDirName = 'vdb-bench-widgets'; angular .module(pluginName) .directive('fileInputHandler', FileInputHandler); function FileInputHandler() { var directive = { restrict: 'A', link: link }; return directive; function link(scope, element, attrs) { var onChangeHandler = scope.$eval(attrs.fileInputHandler); element.bind('change', onChangeHandler); } } })();
/** * Upload5 0.1.0 * (c) 2011 BitCandies * http://github.com/bitcandies/upload5 * * Upload5 is a flexible HTML5/JavaScript library that handles multiple file uploads. * * Upload5 is freely distributable under the MIT license, * see LICENSE. * * http://www.bitcandies.com/ */ var bitcandies = bitcandies || {}; bitcandies.defaults = function (dest, source) { for (var i in source) { if (typeof dest[i] == 'undefined') { dest[i] = source[i]; } } }; bitcandies.FileUploader = function (options) { var default_options = { fieldname: 'file', maxconnections: 2, //maxfilesize: 1024, method: 'POST', default_params: {}, url: '', enqueued: function (item) { }, aborted: function (item) { }, start: function (item, xhr) { }, progress: function (item, loaded, total, xhr) { }, success: function (item, xhr) { }, error: function (item, xhr) { }, complete: function (item, xhr) { } }; this.options = options || {}; bitcandies.defaults(this.options, default_options); this.queue = []; this.running = []; this.completed = []; this._curid = 1; }; bitcandies.FileUploader.Statuses = { QUEUED: 'queued', ABORTED: 'aborted', UPLOADING: 'uploading', COMPLETED: 'completed' }; bitcandies.FileUploader.QueuedFile = function (uploader, file, params, id) { if (!(file instanceof File)) { throw new Error('Cannot add a non-File object to upload queue.'); } this.uploader = uploader; this.file = file; this.params = params || {}; this.id = id; this.status = bitcandies.FileUploader.Statuses.QUEUED; } bitcandies.FileUploader.QueuedFile.prototype = { getFilename: function () { return this.file.fileName ? this.file.fileName : this.file.name; }, getSize: function () { return this.file.fileSize ? this.file.fileSize : this.file.size; }, getFile: function () { return this.file; }, getParams: function () { return this.params; }, getStatus: function () { return this.status; } }; bitcandies.FileUploader.prototype = { add: function (file, params) { params = params || {}; bitcandies.defaults(params, this.options.default_params); var item = new bitcandies.FileUploader.QueuedFile(this, file, params, this._curid); this._curid++; this.queue.push(item); this.options.enqueued.call(this, item); this.run(); return item; }, abort: function (item) { if (item.status !== bitcandies.FileUploader.Statuses.COMPLETED && item.status !== bitcandies.FileUploader.Statuses.ABORTED) { for (var i = 0; i < this.queue.length; ++i) { if (item.id === this.queue[i].id) { this.queue.splice(i, 1); item.status = bitcandies.FileUploader.Statuses.ABORTED; this.options.aborted.call(this, item); return; } } for (var i = 0; i < this.running.length; ++i) { if (item.id === this.running[i].id) { item.status = bitcandies.FileUploader.Statuses.ABORTED; item.xhr.abort(); this.options.aborted.call(this, item); return; } } } }, doUpload: function (item) { var self = this, xhr = new XMLHttpRequest(), formData = new FormData(); item.status = bitcandies.FileUploader.Statuses.UPLOADING; item.xhr = xhr; this.options.start.call(this, item, xhr); xhr.onreadystatechange = function () { if (xhr.readyState == 4) { self.onComplete(item, xhr); } }; xhr.upload.onprogress = function (e) { if (e.lengthComputable) { self.options.progress.call(self, item, e.loaded, e.total, xhr); } }; xhr.open(this.options.method, this.options.url, true); for (var key in item.params) { formData.append(key, item.params[key]); } formData.append("fileName",encodeURI(item.file.name)); formData.append(this.options.fieldname, item.file); xhr.send(formData); }, isRunning: function () { return this.queue.length || this.running.length; }, onComplete: function (item, xhr) { if (item.status !== bitcandies.FileUploader.Statuses.ABORTED) { item.status = bitcandies.FileUploader.Statuses.COMPLETED; this.options.progress.call(this, item, item.getSize(), item.getSize(), xhr); if (xhr.status == 200) { this.options.success.call(this, item, xhr); } else { this.options.error.call(this, item, xhr); } this.options.complete.call(this, item, xhr); } if (item.xhr) { delete item.xhr; } for (var i in this.running) { if (this.running[i].id === item.id) { this.running.splice(i, 1); break; } } this.run(); }, run: function () { if (this.queue.length > 0 && this.running.length < this.options.maxconnections) { for (var i = 0; i < this.options.maxconnections - this.running.length; ++i) { var item = this.queue.shift(); this.running.push(item); this.doUpload(item); } } } };
import Ember from 'ember'; import describePromise from 'klondike/util/describe-promise'; function promiseAlias(name) { return function () { var promise = this.get('_promise'); return promise[name].apply(promise, arguments); }; } export default Ember.Object.extend({ users: null, fixedKeyBinding: 'application.apiKey', user: null, usernameBinding: 'user.username', keyBinding: 'user.key', rolesBinding: 'user.roles', isInitialized: false, _promise: null, isLoggedIn: Ember.computed('username', function () { return !Ember.isEmpty(this.get('username')); }), init: function () { this._super(); var self = this; var settings = {}; var sessionKey = window.sessionStorage.getItem('key') || this.get('fixedKey'); if (!Ember.isEmpty(sessionKey)) { settings.beforeSend = function(xhr) { xhr.setRequestHeader(self.get('restClient').get('apiKeyRequestHeaderName'), sessionKey); }; } var initPromise = self._invokeLogin('users.getAuthenticationInfo', settings).then(function() { self.set('isInitialized', true); return true; }, function() { self.set('isInitialized', true); return true; }, describePromise(this, 'init')); self.set('_promise', initPromise); }, 'then': promiseAlias('then'), 'catch': promiseAlias('catch'), 'finally': promiseAlias('finally'), isAllowed: function(apiName, method) { var self = this; return this.get('restClient').getApi(apiName, method).then(function (api) { if (!api.requiresAuthentication) { return true; } var userRoles = self.get('user.roles') || []; var userRoleMissing = function(roleName) { return !userRoles.contains(roleName); }; var any = api.requiresRoles.any(function(roleSet) { return roleSet.any(userRoleMissing); }); return !any; }, null, describePromise(this, 'isAllowed', arguments)); }, logOut: function() { this.set('user', null); }, tryLogIn: function() { return this.logIn().then(function() { return true; }).catch(function() { return false; }); }, logIn: function(username, password) { var settings = {}; if (!Ember.isEmpty(username)) { settings.beforeSend = function(xhr) { xhr.setRequestHeader('Authorization', 'Basic ' + window.btoa(username + ':' + password)); }; } return this._invokeLogin('users.getRequiredAuthenticationInfo', settings); }, changeKey: function() { var self = this; var settings = { type: 'POST', data: { key: '' } }; var call = this.get('restClient').ajax('users.changeApiKey', settings); return call.then(function(data) { self.set('key', data.key); window.sessionStorage.setItem('key', self.get('key')); return data.key; }, null, describePromise(this, 'changeKey')); }, _invokeLogin: function (apiName, settings) { var self = this; return self.get('restClient').ajax(apiName, settings).then(function(json) { json = json || {}; json.roles = Ember.A(json.roles || []); var user = self.get('store').createModel('user', json); self.set('user', user); return user; }, function(err) { self.set('user', null); throw err; }, describePromise(this, '_invokeLogin')); }, _keyDidChange: Ember.observer('key', function() { var key = this.get('key'); if (key) { window.sessionStorage.setItem('key', key); } else { window.sessionStorage.removeItem('key'); } this.get('restClient').set('apiKey', key); }), });
// Copyright (c) 2012 Ecma International. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- es5id: 15.4.4.22-8-b-iii-1-4 description: > Array.prototype.reduceRight - element to be retrieved is own data property that overrides an inherited data property on an Array ---*/ var testResult = false; function callbackfn(prevVal, curVal, idx, obj) { if (idx === 1) { testResult = (prevVal === 2); } } Array.prototype[2] = "11"; [0, 1, 2].reduceRight(callbackfn); assert(testResult, 'testResult !== true');
'use strict'; let angular = require('angular'); module.exports = angular.module('spinnaker.core.pipeline.stage.script.executionDetails.controller', [ require('angular-ui-router'), require('../../../../delivery/details/executionDetailsSection.service.js'), require('../../../../delivery/details/executionDetailsSectionNav.directive.js'), ]) .controller('ScriptExecutionDetailsCtrl', function ($scope, $stateParams, executionDetailsSectionService) { $scope.configSections = ['scriptConfig', 'taskStatus']; function initialize() { executionDetailsSectionService.synchronizeSection($scope.configSections); $scope.detailsSection = $stateParams.details; } initialize(); $scope.$on('$stateChangeSuccess', initialize, true); }).name;
// Copyright (c) 2012 Ecma International. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- es5id: 15.12.3-6-b-3 description: > JSON.stringify treats numeric space arguments less than 1 (-5) the same as empty string space argument. ---*/ var obj = {a1: {b1: [1,2,3,4], b2: {c1: 1, c2: 2}},a2: 'a2'}; /* empty string should be same as no space arg */ assert.sameValue(JSON.stringify(obj,null, -5), JSON.stringify(obj));
/// Copyright (c) 2009 Microsoft Corporation /// /// Redistribution and use in source and binary forms, with or without modification, are permitted provided /// that the following conditions are met: /// * Redistributions of source code must retain the above copyright notice, this list of conditions and /// the following disclaimer. /// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and /// the following disclaimer in the documentation and/or other materials provided with the distribution. /// * Neither the name of Microsoft nor the names of its contributors may be used to /// endorse or promote products derived from this software without specific prior written permission. /// /// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR /// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS /// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE /// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT /// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS /// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, /// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF /// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ES5Harness.registerTest({ id: "15.4.4.20-9-c-iii-28", path: "TestCases/chapter15/15.4/15.4.4/15.4.4.20/15.4.4.20-9-c-iii-28.js", description: "Array.prototype.filter - return value of callbackfn is the global object", test: function testcase() { function callbackfn(val, idx, obj) { return fnGlobalObject(); } var newArr = [11].filter(callbackfn); return newArr.length === 1 && newArr[0] === 11; }, precondition: function prereq() { return fnExists(Array.prototype.filter); } });
// Copyright 2017 The Kubernetes Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. import {isError, kdErrors} from 'common/errorhandling/errors'; import errorhandlingModule from 'common/errorhandling/module'; describe('Errorhandling service', () => { /** @type {!ErrorDialog} */ let errorDialog; /** @type {!md.$dialog} */ let mdDialog; beforeEach(() => { angular.mock.module(errorhandlingModule.name); angular.mock.inject(($mdDialog, _errorDialog_) => { errorDialog = _errorDialog_; mdDialog = $mdDialog; }); }); it('should show error title and error message in the md dialog', () => { spyOn(mdDialog, 'show'); /** @type {string} */ let errorTitle = 'Error title'; /** @type {string} */ let errorMessage = 'Error message'; // open the error dialog errorDialog.open(errorTitle, errorMessage); // and expect it to show expect(mdDialog.show).toHaveBeenCalled(); }); }); describe('Errorhandling', () => { it('should return true when error message matches one of the provided errors', () => { // given let errMsg = 'MSG_ENCRYPTION_KEY_CHANGED'; // when let result = isError(errMsg, kdErrors.TOKEN_EXPIRED, kdErrors.ENCRYPTION_KEY_CHANGED); // then expect(result).toBeTruthy(); }); it('should return false when error message does not match on of the provided errors', () => { // given let errMsg = 'MSG_ENCRYPTION_KEY_CHANGED'; // when let result = isError(errMsg, kdErrors.TOKEN_EXPIRED); // then expect(result).toBeFalsy(); }); });
/* Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'templates', 'ro', { button: 'Template-uri (şabloane)', emptyListMsg: '(Niciun template (şablon) definit)', insertOption: 'Înlocuieşte cuprinsul actual', options: 'Opțiuni șabloane', selectPromptMsg: 'Vă rugăm selectaţi template-ul (şablonul) ce se va deschide în editor<br>(conţinutul actual va fi pierdut):', title: 'Template-uri (şabloane) de conţinut' });
import STORE from 'store'; import Worker from 'utils/webworker.js'; export default class TeleopWebSocketEndpoint { constructor(serverAddr) { this.serverAddr = serverAddr; this.websocket = null; this.worker = new Worker(); } initialize() { try { this.websocket = new WebSocket(this.serverAddr); this.websocket.binaryType = 'arraybuffer'; } catch (error) { console.error(`Failed to establish a connection: ${error}`); setTimeout(() => { this.initialize(); }, 1000); return; } this.websocket.onmessage = (event) => { this.worker.postMessage({ source: 'teleop', data: event.data, }); }; this.websocket.onclose = (event) => { console.log(`WebSocket connection closed with code: ${event.code}`); this.initialize(); }; this.worker.onmessage = (event) => { const message = event.data; STORE.teleop.update(message); }; // Request status every 100ms. clearInterval(this.timer); this.timer = setInterval(() => { if (this.websocket.readyState === this.websocket.OPEN) { this.websocket.send(JSON.stringify({ type: 'RequestTeleopStatus', })); } }, 200); } close() { clearInterval(this.timer); if (this.websocket) { this.websocket.onclose = undefined; this.websocket.close(); } } executeCommand(command) { this.websocket.send(JSON.stringify({ type: command, })); } }
/* Copyright 2015 Samsung Electronics Co., Ltd. * * 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. */ /* @TIMEOUT=10 */ var assert = require('assert'); var gpio = require('gpio'); var gpioSequence = ''; var result; result = gpio.initialize(); if (result >= 0) gpioSequence += "I"; gpio.setPin(1, "in"); gpioSequence += "A"; try { gpio.setPin(-1, "out"); } catch(err) { if(err.code == gpio.ERR_INVALIDPARAM) { gpioSequence += '1'; } } try { gpio.writePin(-1, true); } catch(err) { if(err.code == gpio.ERR_INVALIDPARAM) { gpioSequence += '2'; } } try { gpio.readPin(-1); } catch(err) { if(err.code == gpio.ERR_INVALIDPARAM) { gpioSequence += '3'; } } try { gpio.readPin(2); } catch(err) { if(err.code == gpio.ERR_INVALIDPARAM) { gpioSequence += '4'; } } gpio.setPin(2, "out", function(err) { gpioSequence += 'B'; }); gpio.setPin(-1, "out", function(err) { if(err.code == gpio.ERR_INVALIDPARAM) { gpioSequence += 'C'; } }); gpio.setPin(3, "in", "float", function(err) { gpioSequence += 'D'; }); gpio.writePin(2, true, function(err) { gpioSequence += 'E'; }); gpio.readPin(3, function(err,value) { if (value == true) gpioSequence += 'F'; }); gpio.readPin(4, function(err,value) { if (value == false) gpioSequence += 'G'; }); process.on('exit', function(code) { gpio.release(); assert.equal(gpioSequence, 'IA1234BCDEFG'); });
/** * $Id$ * * @author Moxiecode - based on work by Andrew Tetlaw * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved. */ function preinit() { // Initialize tinyMCE.setWindowArg('mce_windowresize', false); } function init() { tinyMCEPopup.resizeToInnerSize(); SXE.initElementDialog('ins'); if (SXE.currentAction == "update") { setFormValue('datetime', tinyMCE.getAttrib(SXE.updateElement, 'datetime')); setFormValue('cite', tinyMCE.getAttrib(SXE.updateElement, 'cite')); SXE.showRemoveButton(); } } function setElementAttribs(elm) { setAllCommonAttribs(elm); setAttrib(elm, 'datetime'); setAttrib(elm, 'cite'); } function insertIns() { var elm = tinyMCE.getParentElement(SXE.focusElement, 'ins'); tinyMCEPopup.execCommand('mceBeginUndoLevel'); if (elm == null) { var s = SXE.inst.selection.getSelectedHTML(); if(s.length > 0) { tinyMCEPopup.execCommand('mceInsertContent', false, '<ins id="#sxe_temp_ins#">' + s + '</ins>'); var elementArray = tinyMCE.getElementsByAttributeValue(SXE.inst.getBody(), 'ins', 'id', '#sxe_temp_ins#'); for (var i=0; i<elementArray.length; i++) { var elm = elementArray[i]; setElementAttribs(elm); } } } else { setElementAttribs(elm); } tinyMCE.triggerNodeChange(); tinyMCEPopup.execCommand('mceEndUndoLevel'); tinyMCEPopup.close(); } function removeIns() { SXE.removeElement('ins'); tinyMCEPopup.close(); }
// -*- coding: utf-8 -*- // Copyright (C) 2014 Yusuke Suzuki <utatane.tea@gmail.com> // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // 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 <COPYRIGHT HOLDER> 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. import { expect } from 'chai'; import { analyze } from '..'; const parse = require('../third_party/espree'); describe('ES6 new.target', function() { it('should not make references of new.target', function() { const ast = parse(` class A { constructor() { new.target; } } `); const scopeManager = analyze(ast, {ecmaVersion: 6}); expect(scopeManager.scopes).to.have.length(3); const scope = scopeManager.scopes[2]; expect(scope.type).to.be.equal('function'); expect(scope.block.type).to.be.equal('FunctionExpression'); expect(scope.isStrict).to.be.true; expect(scope.variables).to.have.length(1); expect(scope.variables[0].name).to.be.equal('arguments'); expect(scope.references).to.have.length(0); }); }); // vim: set sw=4 ts=4 et tw=80 :
// Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- esid: sec-integer-indexed-exotic-objects-hasproperty-p description: Return false if P's value is < 0 info: | 9.4.5.2 [[HasProperty]](P) ... 3. If Type(P) is String, then a. Let numericIndex be ! CanonicalNumericIndexString(P). b. If numericIndex is not undefined, then ... iii. If ! IsValidIntegerIndex(O, numericIndex) is false, return false. ... includes: [testBigIntTypedArray.js] features: [align-detached-buffer-semantics-with-web-reality, BigInt, Reflect, TypedArray] ---*/ // Prevents false positives using OrdinaryHasProperty TypedArray.prototype[-1] = "test262"; testWithBigIntTypedArrayConstructors(function(TA) { var sample = new TA(1); assert.sameValue(Reflect.has(sample, "-1"), false, 'Reflect.has(sample, "-1") must return false'); });
function (doc) { if (doc.doc_type === 'Application' && doc.copy_of === null) { var lang, key; for (lang in doc.translations) { for (key in doc.translations[lang]) { emit([lang, key, doc.translations[lang][key]], null); } } } }
module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), browserify: { control: { src: ['src/L.Realtime.js'], dest: 'dist/leaflet-realtime.js', options: { transform: [ [ 'browserify-shim', { 'leaflet': 'global:L' } ], ], browserifyOptions: { standalone: 'L.Realtime' } } } }, uglify: { options: { banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' + '<%= grunt.template.today("yyyy-mm-dd") %> */\n\n' }, build: { src: 'dist/leaflet-realtime.js', dest: 'dist/leaflet-realtime.min.js' } } }); grunt.loadNpmTasks('grunt-browserify'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.registerTask('default', ['browserify', 'uglify']); };
/** * @license * Copyright (c) 2016 The {life-parser} Project Authors. All rights reserved. * This code may only be used under the MIT style license found at http://100dayproject.github.io/LICENSE.txt * The complete set of authors may be found at http://100dayproject.github.io/AUTHORS.txt * The complete set of contributors may be found at http://100dayproject.github.io/CONTRIBUTORS.txt * Code distributed by 100dayproject as part of the life. */ "use strict"; CKEDITOR.plugins.add('crab_media', { icon: 'timestamp', init: function (editor) { editor.addCommand('insertMedia', { exec: function (e) { var now = new Date(); e.insertHtml('The current date and time is: <em>' + now.toString() + '</em>'); } }); editor.ui.addButton('crab_media', { label: 'CrabJS: Insert Media', command: 'insertMedia', toolbar: 'insert' }); } });
define([ 'pex/geom/hem/HEMesh', 'pex/geom/hem/HEVertex', 'pex/geom/hem/HEEdge', 'pex/geom/hem/HEFace', 'pex/geom/Vec3' ], function(HEMesh, HEVertex, HEEdge, HEFace, Vec3) { function Extrude() { } HEMesh.prototype.extrude = function(height, direction) { height = height || 0.1; var numFaces = this.faces.length; var self = this; var faces = this.faces; var selectedFaces = this.getSelectedFaces(); if (selectedFaces.length > 0) { faces = selectedFaces; } faces.forEach(function(face, i) { var normal = direction || face.getNormal(); var edge = face.edge; var lastEdge = edge.findPrev(); var edgeToSplit = edge; var prevNewEdge = null; var center = face.getCenter(); var newEdges = []; //we split all the corners within the face effectively adding new internal vertices do { //var newVertexPos = edgeToSplit.vert.added(normal.scaled(height)); var newVertexPos = normal.clone().scale(height).add(edgeToSplit.vert.position); edgeToSplit.vert.edge = edgeToSplit; //TODO: fix that, making sure we split the right face var newEdge = self.splitVertex(edgeToSplit.vert, newVertexPos); newEdges.push(newEdge); if (edgeToSplit == lastEdge) { break; } edgeToSplit = edgeToSplit.next; } while(edgeToSplit != edge); //go through all new corners and cut out faces from them var prevCornerEdge = newEdges[newEdges.length-1].next; for(var i=0; i<newEdges.length; i++) { //we remember what's the next edge pointing to a new corner as //this might change when we add new face var tmp = newEdges[i].next; var newFace = self.splitFace(newEdges[i].next, prevCornerEdge); prevCornerEdge = tmp; } }); return this; } return Extrude; });
/* * A range */ module.exports = function(obj) { if(obj.type !== 'RANGE') { throw "This is not a range!"; } var parser = require('./expression.js'); return 'range(' + parser(obj.from) + ', ' + parser(obj.to) + ')'; };
import { moduleForModel, test } from 'ember-qunit'; moduleForModel('user', 'Unit | Serializer | user', { // Specify the other units that are required for this test. needs: ['serializer:user'] }); // Replace this with your real tests. test('it serializes records', function(assert) { let record = this.subject(); let serializedRecord = record.serialize(); assert.ok(serializedRecord); });
"use strict"; /* globals describe it */ require("should"); const path = require("path"); const fs = require("fs"); const webpack = require("../"); describe("Examples", () => { const examples = fs.readdirSync(path.join(__dirname, "..", "examples")).map((name) => path.join(__dirname, "..", "examples", name)).filter((p) => fs.statSync(p).isDirectory() && fs.existsSync(path.join(p, "build.js"))); examples.forEach((examplePath) => { it("should compile " + path.basename(examplePath), function(done) { this.timeout(20000); let options = {}; let webpackConfigPath = path.join(examplePath, "webpack.config.js"); webpackConfigPath = webpackConfigPath.substr(0, 1).toUpperCase() + webpackConfigPath.substr(1); if(fs.existsSync(webpackConfigPath)) options = require(webpackConfigPath); if(Array.isArray(options)) options.forEach(processOptions); else processOptions(options); function processOptions(options) { options.context = examplePath; options.output = options.output || {}; options.output.pathinfo = true; options.output.path = path.join(examplePath, "js"); options.output.publicPath = "js/"; if(!options.output.filename) options.output.filename = "output.js"; if(!options.entry) options.entry = "./example.js"; } webpack(options, (err, stats) => { if(err) return done(err); stats = stats.toJson({ errorDetails: true }); if(stats.errors.length > 0) { return done(new Error(stats.errors[0])); } 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. * * @flow strict * @format */ // flowlint ambiguous-object-type:error 'use strict'; function createPrintRequireModuleDependency( extension: string, ): string => string { return moduleName => `require('./${moduleName}.${extension}')`; } module.exports = createPrintRequireModuleDependency;
describe('[Regression](GH-3724)', () => { it('Should correctly type text in an editable iframe', () => runTests('testcafe-fixtures/index.js')); });
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function getFailedSnapshotTests(testResults) { const failedTestPaths = []; if (testResults.numFailedTests === 0 || !testResults.testResults) { return failedTestPaths; } testResults.testResults.forEach(testResult => { if (testResult.snapshot && testResult.snapshot.unmatched) { failedTestPaths.push(testResult.testFilePath); } }); return failedTestPaths; } exports.default = getFailedSnapshotTests;
module.exports = React.createClass({ displayName: "actual", render: function render() { return null; } });
'use strict'; // Configuring the Articles module angular.module('jobs').run(['Menus', function(Menus) { // Set top bar menu items Menus.addMenuItem('topbar', 'Jobs', 'jobs', 'dropdown', '/jobs(/create)?'); Menus.addSubMenuItem('topbar', 'jobs', 'List Jobs', 'jobs'); Menus.addSubMenuItem('topbar', 'jobs', 'New Job', 'jobs/create'); } ]);
import Events from "v2/Utils/Events" import { configure, addParameters } from "@storybook/react" import { createMediaStyle } from "v2/Utils/Responsive" const req = require.context("../", true, /\.story\.tsx$/) function loadStories() { req.keys().forEach(filename => { return req(filename) }) } // Add RRM styles to Storybooks head const rrmStyle = document.createElement("style") rrmStyle.innerHTML = createMediaStyle() document.head.appendChild(rrmStyle) addParameters({ inline: true, brandTitle: "Reaction", showAddonPanel: false, sortStoriesByKind: true, }) setTimeout(() => { configure(loadStories, module) }) Events.onEvent(data => { console.log("Tracked event", data) }) if (!window.sd || !(typeof window.sd === "object")) { window.sd = {} }
function SomeComponent (props) { // Create styles as if you're calling css and the class will be applied to the component return (<div css={` color: blue; font-size: 17 px; &:hover { color: green; } & .some-class { font-size: 20px; } `}> This will be blue until hovered. <div className="some-class"> This font size will be 20px </div> </div>) } const TestComponent = ({ children, ...props }) => ( <div css={`color: white; background: black`}> {children} </div> );
YUI.add('node-event-delegate', function (Y, NAME) { /** * Functionality to make the node a delegated event container * @module node * @submodule node-event-delegate */ /** * <p>Sets up a delegation listener for an event occurring inside the Node. * The delegated event will be verified against a supplied selector or * filtering function to test if the event references at least one node that * should trigger the subscription callback.</p> * * <p>Selector string filters will trigger the callback if the event originated * from a node that matches it or is contained in a node that matches it. * Function filters are called for each Node up the parent axis to the * subscribing container node, and receive at each level the Node and the event * object. The function should return true (or a truthy value) if that Node * should trigger the subscription callback. Note, it is possible for filters * to match multiple Nodes for a single event. In this case, the delegate * callback will be executed for each matching Node.</p> * * <p>For each matching Node, the callback will be executed with its 'this' * object set to the Node matched by the filter (unless a specific context was * provided during subscription), and the provided event's * <code>currentTarget</code> will also be set to the matching Node. The * containing Node from which the subscription was originally made can be * referenced as <code>e.container</code>. * * @method delegate * @param type {String} the event type to delegate * @param fn {Function} the callback function to execute. This function * will be provided the event object for the delegated event. * @param spec {String|Function} a selector that must match the target of the * event or a function to test target and its parents for a match * @param context {Object} optional argument that specifies what 'this' refers to. * @param args* {any} 0..n additional arguments to pass on to the callback function. * These arguments will be added after the event object. * @return {EventHandle} the detach handle * @for Node */ Y.Node.prototype.delegate = function(type) { var args = Y.Array(arguments, 0, true), index = (Y.Lang.isObject(type) && !Y.Lang.isArray(type)) ? 1 : 2; args.splice(index, 0, this._node); return Y.delegate.apply(Y, args); }; }, 'patched-v3.16.0', {"requires": ["node-base", "event-delegate"]});
'use strict'; var docsURL = 'http://bitcore.io/'; module.exports = [{ name: 'InvalidB58Char', message: 'Invalid Base58 character: {0} in {1}' }, { name: 'InvalidB58Checksum', message: 'Invalid Base58 checksum for {0}' }, { name: 'InvalidNetwork', message: 'Invalid version for network: got {0}' }, { name: 'InvalidState', message: 'Invalid state: {0}' }, { name: 'NotImplemented', message: 'Function {0} was not implemented yet' }, { name: 'InvalidNetworkArgument', message: 'Invalid network: must be "livenet" or "testnet", got {0}' }, { name: 'InvalidArgument', message: function() { return 'Invalid Argument' + (arguments[0] ? (': ' + arguments[0]) : '') + (arguments[1] ? (' Documentation: ' + docsURL + arguments[1]) : ''); } }, { name: 'AbstractMethodInvoked', message: 'Abstract Method Invocation: {0}' }, { name: 'InvalidArgumentType', message: function() { return 'Invalid Argument for ' + arguments[2] + ', expected ' + arguments[1] + ' but got ' + typeof arguments[0]; } }, { name: 'Unit', message: 'Internal Error on Unit {0}', errors: [{ 'name': 'UnknownCode', 'message': 'Unrecognized unit code: {0}' }, { 'name': 'InvalidRate', 'message': 'Invalid exchange rate: {0}' }] }, { name: 'Transaction', message: 'Internal Error on Transaction {0}', errors: [{ name: 'Input', message: 'Internal Error on Input {0}', errors: [{ name: 'MissingScript', message: 'Need a script to create an input' }, { name: 'UnsupportedScript', message: 'Unsupported input script type: {0}' }, { name: 'MissingPreviousOutput', message: 'No previous output information.' }] }, { name: 'NeedMoreInfo', message: '{0}' }, { name: 'InvalidSorting', message: 'The sorting function provided did not return the change output as one of the array elements' }, { name: 'InvalidOutputAmountSum', message: '{0}' }, { name: 'MissingSignatures', message: 'Some inputs have not been fully signed' }, { name: 'InvalidIndex', message: 'Invalid index: {0} is not between 0, {1}' }, { name: 'UnableToVerifySignature', message: 'Unable to verify signature: {0}' }, { name: 'DustOutputs', message: 'Dust amount detected in one output' }, { name: 'InvalidSatoshis', message: 'Output satoshis are invalid', }, { name: 'FeeError', message: 'Internal Error on Fee {0}', errors: [{ name: 'TooSmall', message: 'Fee is too small: {0}', }, { name: 'TooLarge', message: 'Fee is too large: {0}', }, { name: 'Different', message: 'Unspent value is different from specified fee: {0}', }] }, { name: 'ChangeAddressMissing', message: 'Change address is missing' }, { name: 'BlockHeightTooHigh', message: 'Block Height can be at most 2^32 -1' }, { name: 'NLockTimeOutOfRange', message: 'Block Height can only be between 0 and 499 999 999' }, { name: 'LockTimeTooEarly', message: 'Lock Time can\'t be earlier than UNIX date 500 000 000' }] }, { name: 'Script', message: 'Internal Error on Script {0}', errors: [{ name: 'UnrecognizedAddress', message: 'Expected argument {0} to be an address' }, { name: 'CantDeriveAddress', message: 'Can\'t derive address associated with script {0}, needs to be p2pkh in, p2pkh out, p2sh in, or p2sh out.' }, { name: 'InvalidBuffer', message: 'Invalid script buffer: can\'t parse valid script from given buffer {0}' }] }, { name: 'HDPrivateKey', message: 'Internal Error on HDPrivateKey {0}', errors: [{ name: 'InvalidDerivationArgument', message: 'Invalid derivation argument {0}, expected string, or number and boolean' }, { name: 'InvalidEntropyArgument', message: 'Invalid entropy: must be an hexa string or binary buffer, got {0}', errors: [{ name: 'TooMuchEntropy', message: 'Invalid entropy: more than 512 bits is non standard, got "{0}"' }, { name: 'NotEnoughEntropy', message: 'Invalid entropy: at least 128 bits needed, got "{0}"' }] }, { name: 'InvalidLength', message: 'Invalid length for xprivkey string in {0}' }, { name: 'InvalidPath', message: 'Invalid derivation path: {0}' }, { name: 'UnrecognizedArgument', message: 'Invalid argument: creating a HDPrivateKey requires a string, buffer, json or object, got "{0}"' }] }, { name: 'HDPublicKey', message: 'Internal Error on HDPublicKey {0}', errors: [{ name: 'ArgumentIsPrivateExtended', message: 'Argument is an extended private key: {0}' }, { name: 'InvalidDerivationArgument', message: 'Invalid derivation argument: got {0}' }, { name: 'InvalidLength', message: 'Invalid length for xpubkey: got "{0}"' }, { name: 'InvalidPath', message: 'Invalid derivation path, it should look like: "m/1/100", got "{0}"' }, { name: 'MustSupplyArgument', message: 'Must supply an argument to create a HDPublicKey' }, { name: 'UnrecognizedArgument', message: 'Invalid argument for creation, must be string, json, buffer, or object' }] }];
'use strict'; var SERVER_ROOT = 'http://localhost:3000'; servicesModule .factory('Events', function($http){ // helper function to extract data from response var getData = function(res) { return res.data; }; // ---- Export functions ---- var addOne = function(friendId, eventObj){ return $http.post(SERVER_ROOT + '/api/friends/' + friendId + '/events', eventObj) .then(getData); }; var getAllForFriend = function(friendId){ return $http.get(SERVER_ROOT + '/api/friends/' + friendId + '/events') .then(getData); } var getOne = function(eventId) { return $http.get(SERVER_ROOT + '/api/events/' + eventId) .then(getData); }; var updateOne = function(eventId, newEventObj){ return $http.put(SERVER_ROOT + '/api/events/' + eventId, newEventObj) .then(getData); } var deleteOne = function(eventId){ return $http.delete(SERVER_ROOT + '/api/events/' + eventId) .then(getData); } var prettifyDate = function(dateStr) { //date is of format TIMESTAMP from sql var dateObj = new Date(dateStr); var month = (dateObj.getUTCMonth()+1 % 12); var date = dateObj.getUTCDate(); var year = dateObj.getUTCFullYear(); var hours = (dateObj.getHours() + 4) % 24; // 24 hour clock, but then plus 4 for timezone var minutes = dateObj.getMinutes(); var monthString = month; var dateString = date; var yearString = year; var hoursString = (hours % 12 === 0 ? 12 : hours % 12).toString(); var minutesString = ((minutes <= 10) ? '0' : '') + minutes.toString(); var suffix = (hours <= 12) ? 'am' : 'pm'; console.log(hoursString + ":" + minutesString + suffix); return monthString + '/' + dateString + '/' + yearString + ', ' + hoursString + ":" + minutesString + suffix; }; return { addOne: addOne, getAllForFriend: getAllForFriend, getOne: getOne, updateOne: updateOne, deleteOne: deleteOne, prettifyDate: prettifyDate } });
/* Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'save', 'no', { toolbar: 'Lagre' });
/** @license Copyright (c) 2015 The Polymer Project Authors. All rights reserved. This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ import "../polymer/polymer-legacy.js"; import { NeonAnimationBehavior } from './neon-animation-behavior.js'; /** * Use `NeonSharedElementAnimationBehavior` to implement shared element * animations. * @polymerBehavior NeonSharedElementAnimationBehavior */ export const NeonSharedElementAnimationBehaviorImpl = { properties: { /** * Cached copy of shared elements. */ sharedElements: { type: Object } }, /** * Finds shared elements based on `config`. */ findSharedElements: function (config) { var fromPage = config.fromPage; var toPage = config.toPage; if (!fromPage || !toPage) { console.warn(this.is + ':', !fromPage ? 'fromPage' : 'toPage', 'is undefined!'); return null; } ; if (!fromPage.sharedElements || !toPage.sharedElements) { console.warn(this.is + ':', 'sharedElements are undefined for', !fromPage.sharedElements ? fromPage : toPage); return null; } ; var from = fromPage.sharedElements[config.id]; var to = toPage.sharedElements[config.id]; if (!from || !to) { console.warn(this.is + ':', 'sharedElement with id', config.id, 'not found in', !from ? fromPage : toPage); return null; } this.sharedElements = { from: from, to: to }; return this.sharedElements; } }; /** @polymerBehavior */ export const NeonSharedElementAnimationBehavior = [NeonAnimationBehavior, NeonSharedElementAnimationBehaviorImpl];
'use strict'; var path = require('path'); var gulp = require('gulp'); var shell = require('gulp-shell'); var clean = require('gulp-clean'); var config = require('../../../config'); // 启动browser sync gulp.task('browser-sync', function() { setTimeout(function() { shell.task('browser-sync start --config build/bs/bs-config.js', { cwd: config.root })(); }, 15000); }); gulp.task('webpack', shell.task('webpack --config ../../webpack/webpack.config.js')); gulp.task('webpack-watch', shell.task('webpack --config ../../webpack/webpack.config.js --watch')); // 开始处断点调试~~ gulp.task('inspector-brk', function() { shell.task('node-inspector --web-port=8081', { cwd: config.root })(); setTimeout(function() { shell.task('node-dev --debug-brk server/index.js', { cwd: config.root })(); }, 12000); }); gulp.task('fis3-debug', function() { shell.task('node-inspector --web-port=8081', { cwd: config.root })(); shell.task(path.join('node --debug ' + process.env['APPDATA'], 'npm/node_modules/fis3/bin/fis.js') + ' release -w -d ' + path.resolve(config.root, config.dest))(); }); gulp.task('fis3-server', function() { shell.task('node-inspector --web-port=8081', { cwd: config.root })(); setTimeout(function() { shell.task('node-dev --debug server/index.js', { cwd: config.root })(); }, 12000); }); gulp.task('fis3-clean', function() { return gulp.src('process.env["LOCALAPPDATA"]' + '/.fis3-tmp/cache', {read: false}) .pipe(clean()); }); gulp.task('fis3-release', ['fis3-clean', 'webpack'], shell.task('fis3 release --verbose -d ' + path.resolve(config.root, config.dest))); gulp.task('fis3-watch', shell.task('fis3 release -w -d ' + path.resolve(config.root, config.dest))); // 对外命令 gulp.task('debug', ['fis3-watch', 'inspector-brk']); gulp.task('dev', ['fis3-release'], function() { gulp.start('webpack-watch'); gulp.start('fis3-watch'); gulp.start('fis3-server'); gulp.start('browser-sync'); });
'use strict'; module.exports.hash = function hash(plainPassword) { const bcrypt = require('bcryptjs'), bcryptGenSalt = Promise.promisify(bcrypt.genSalt), bcryptHash = Promise.promisify(bcrypt.hash); return bcryptGenSalt().then(function (salt) { return bcryptHash(plainPassword, salt); }); }; module.exports.compare = function compare(plainPassword, hashedPassword) { const bcrypt = require('bcryptjs'), bcryptCompare = Promise.promisify(bcrypt.compare); return bcryptCompare(plainPassword, hashedPassword); };
angular.module('ai.common.directives.dropdown', []) .directive('aiDropdown', function() { return { restrict: 'EA', require: 'ngModel', scope: { ngModel: '=', list: '=' }, link: function(scope, elem, attrs, ngModel) { var data = []; _.each(scope.list, function (item) { data.push({ 'text': item, 'click': 'setter('+item+')' }); }); scope.setter = function (val) { scope.ngModel = val; }; scope.data = data; scope.$watch(function () { return ngModel.$modelValue; }, function() { scope.selected = scope.ngModel; }); }, template: '<button type="button" class="btn-dropdown full-width" bs-dropdown="data" html="true"> {{selected}} </button>' }; }) ;
Tinytest.add('EasySearch - Unit - Core - ReactiveEngine', function (test) { var CustomReactiveEngine = TestHelpers.createReactiveEngine({ getSearchCursor: function (s, o) { test.equal(s, { name: 'testCursor' }); test.equal(o.foo, 'bar'); return new EasySearch.Cursor(new Mongo.Cursor(), 155); } }); test.throws(function () { new EasySearch.ReactiveEngine(); }); var engineInstance = new CustomReactiveEngine(), indexConfig = { name: 'testIndex' }; engineInstance.onIndexCreate(indexConfig); if (Meteor.isClient) { var counter = engineInstance.search('test', { index: { fields: ['name'], searchCollection: { find: function (d, o) { test.equal(d, 'test'); test.equal(o, { limit: 9 }); return new EasySearch.Cursor(new Mongo.Cursor(), 777); } } }, search: { limit: 9 } }); test.equal(counter.count(), 777); } else if (Meteor.isServer) { var cursor = engineInstance.search('testCursor', { foo: 'bar', index: { fields: ['name'] } }); test.instanceOf(cursor, EasySearch.Cursor); test.equal(cursor.count(), 155); } });
import conf from '../../conf/index' describe('close', () => { it('should close the current window', async function () { /** * safari doenst support `newWindow` */ if (this.client.desiredCapabilities.browserName === 'safari') { return } // get current tab id const openTab = (await this.client.getTabIds())[0] // open new tab await this.client.newWindow(conf.testPage.subPage).pause(1000); // ensure that there are two tabs open (await this.client.getTabIds()).should.have.length(2) // close window await this.client.close().pause(1000); (await this.client.getTabIds()).should.have.length(1); // test if there is only one tab open (await this.client.windowHandle()).value.should.be.equal(openTab) }) })
const fs = require('fs-plus'); const path = require('path'); const season = require('season'); const temp = require('temp').track(); const runAtom = require('./helpers/start-atom'); describe('Smoke Test', () => { // Fails on win32 if (process.platform !== 'darwin') { return; } const atomHome = temp.mkdirSync('atom-home'); beforeEach(() => { jasmine.useRealClock(); season.writeFileSync(path.join(atomHome, 'config.cson'), { '*': { welcome: { showOnStartup: false }, core: { telemetryConsent: 'no', disabledPackages: ['github'] } } }); }); it('can open a file in Atom and perform basic operations on it', async () => { const tempDirPath = temp.mkdirSync('empty-dir'); const filePath = path.join(tempDirPath, 'new-file'); fs.writeFileSync(filePath, '', { encoding: 'utf8' }); runAtom([tempDirPath], { ATOM_HOME: atomHome }, async client => { const roots = await client.treeViewRootDirectories(); expect(roots).toEqual([tempDirPath]); await client.execute(filePath => atom.workspace.open(filePath), filePath); const textEditorElement = await client.$('atom-text-editor'); await textEditorElement.waitForExist(5000); await client.waitForPaneItemCount(1, 1000); await textEditorElement.click(); const closestElement = await client.execute(() => document.activeElement.closest('atom-text-editor') ); expect(closestElement).not.toBeNull(); await client.keys('Hello!'); const text = await client.execute(() => atom.workspace.getActiveTextEditor().getText() ); expect(text).toBe('Hello!'); await client.dispatchCommand('editor:delete-line'); }); }); });
jQuery(document).ready(function($) { var t_test = $('input:radio[name=socialize_twitterWidget]:checked').val(); $(".socialize-twitter-select").hide(); $("#socialize-twitter-"+t_test).show(); var f_test = $('input:radio[name=socialize_fbWidget]:checked').val(); $(".socialize-facebook-select").hide(); $("#socialize-facebook-"+f_test).show(); var d_test = $("input[name=socialize_button_display]:checked").val(); if(d_test == 'in') $("input[name=socialize_out_margin]").attr("disabled", "disabled"); else $("input[name=socialize_out_margin]").removeAttr("disabled"); $("input[name=socialize_twitterWidget]").change(function() { var t_test = $(this).val(); $(".socialize-twitter-select").hide(); $("#socialize-twitter-"+t_test).show(); }); $("input[name=socialize_fbWidget]").change(function() { var f_test = $(this).val(); $(".socialize-facebook-select").hide(); $("#socialize-facebook-"+f_test).show(); }); $("input[name=socialize_button_display]").change(function() { var d_test = $(this).val(); if(d_test == 'in') $("input[name=socialize_out_margin]").attr("disabled", "disabled"); else $("input[name=socialize_out_margin]").removeAttr("disabled"); }); });
/* Copyright (c) 2004-2008, The Dojo Foundation All Rights Reserved. Available via Academic Free License >= 2.1 OR the modified BSD license. see: http://dojotoolkit.org/license for details */ if(!dojo._hasResource["dojox.storage.AirFileStorageProvider"]){ dojo._hasResource["dojox.storage.AirFileStorageProvider"]=true; dojo.provide("dojox.storage.AirFileStorageProvider"); dojo.require("dojox.storage.manager"); dojo.require("dojox.storage.Provider"); if(dojo.isAIR){ (function(){ if(!_1){ var _1={}; } _1.File=window.runtime.flash.filesystem.File; _1.FileStream=window.runtime.flash.filesystem.FileStream; _1.FileMode=window.runtime.flash.filesystem.FileMode; dojo.declare("dojox.storage.AirFileStorageProvider",[dojox.storage.Provider],{initialized:false,_storagePath:"__DOJO_STORAGE/",initialize:function(){ this.initialized=false; try{ var _2=_1.File.applicationStorageDirectory.resolvePath(this._storagePath); if(!_2.exists){ _2.createDirectory(); } this.initialized=true; } catch(e){ } dojox.storage.manager.loaded(); },isAvailable:function(){ return true; },put:function(_3,_4,_5,_6){ if(this.isValidKey(_3)==false){ throw new Error("Invalid key given: "+_3); } _6=_6||this.DEFAULT_NAMESPACE; if(this.isValidKey(_6)==false){ throw new Error("Invalid namespace given: "+_6); } try{ this.remove(_3,_6); var _7=_1.File.applicationStorageDirectory.resolvePath(this._storagePath+_6); if(!_7.exists){ _7.createDirectory(); } var _8=_7.resolvePath(_3); var _9=new _1.FileStream(); _9.open(_8,_1.FileMode.WRITE); _9.writeObject(_4); _9.close(); } catch(e){ _5(this.FAILED,_3,e.toString(),_6); return; } if(_5){ _5(this.SUCCESS,_3,null,_6); } },get:function(_a,_b){ if(this.isValidKey(_a)==false){ throw new Error("Invalid key given: "+_a); } _b=_b||this.DEFAULT_NAMESPACE; var _c=null; var _d=_1.File.applicationStorageDirectory.resolvePath(this._storagePath+_b+"/"+_a); if(_d.exists&&!_d.isDirectory){ var _e=new _1.FileStream(); _e.open(_d,_1.FileMode.READ); _c=_e.readObject(); _e.close(); } return _c; },getNamespaces:function(){ var _f=[this.DEFAULT_NAMESPACE]; var dir=_1.File.applicationStorageDirectory.resolvePath(this._storagePath); var _11=dir.getDirectoryListing(),i; for(i=0;i<_11.length;i++){ if(_11[i].isDirectory&&_11[i].name!=this.DEFAULT_NAMESPACE){ _f.push(_11[i].name); } } return _f; },getKeys:function(_13){ _13=_13||this.DEFAULT_NAMESPACE; if(this.isValidKey(_13)==false){ throw new Error("Invalid namespace given: "+_13); } var _14=[]; var dir=_1.File.applicationStorageDirectory.resolvePath(this._storagePath+_13); if(dir.exists&&dir.isDirectory){ var _16=dir.getDirectoryListing(),i; for(i=0;i<_16.length;i++){ _14.push(_16[i].name); } } return _14; },clear:function(_18){ if(this.isValidKey(_18)==false){ throw new Error("Invalid namespace given: "+_18); } var dir=_1.File.applicationStorageDirectory.resolvePath(this._storagePath+_18); if(dir.exists&&dir.isDirectory){ dir.deleteDirectory(true); } },remove:function(key,_1b){ _1b=_1b||this.DEFAULT_NAMESPACE; var _1c=_1.File.applicationStorageDirectory.resolvePath(this._storagePath+_1b+"/"+key); if(_1c.exists&&!_1c.isDirectory){ _1c.deleteFile(); } },putMultiple:function(_1d,_1e,_1f,_20){ if(this.isValidKeyArray(_1d)===false||!_1e instanceof Array||_1d.length!=_1e.length){ throw new Error("Invalid arguments: keys = ["+_1d+"], values = ["+_1e+"]"); } if(_20==null||typeof _20=="undefined"){ _20=this.DEFAULT_NAMESPACE; } if(this.isValidKey(_20)==false){ throw new Error("Invalid namespace given: "+_20); } this._statusHandler=_1f; try{ for(var i=0;i<_1d.length;i++){ this.put(_1d[i],_1e[i],null,_20); } } catch(e){ if(_1f){ _1f(this.FAILED,_1d,e.toString(),_20); } return; } if(_1f){ _1f(this.SUCCESS,_1d,null,_20); } },getMultiple:function(_22,_23){ if(this.isValidKeyArray(_22)===false){ throw new Error("Invalid key array given: "+_22); } if(_23==null||typeof _23=="undefined"){ _23=this.DEFAULT_NAMESPACE; } if(this.isValidKey(_23)==false){ throw new Error("Invalid namespace given: "+_23); } var _24=[]; for(var i=0;i<_22.length;i++){ _24[i]=this.get(_22[i],_23); } return _24; },removeMultiple:function(_26,_27){ _27=_27||this.DEFAULT_NAMESPACE; for(var i=0;i<_26.length;i++){ this.remove(_26[i],_27); } },isPermanent:function(){ return true; },getMaximumSize:function(){ return this.SIZE_NO_LIMIT; },hasSettingsUI:function(){ return false; },showSettingsUI:function(){ throw new Error(this.declaredClass+" does not support a storage settings user-interface"); },hideSettingsUI:function(){ throw new Error(this.declaredClass+" does not support a storage settings user-interface"); }}); dojox.storage.manager.register("dojox.storage.AirFileStorageProvider",new dojox.storage.AirFileStorageProvider()); dojox.storage.manager.initialize(); })(); } }
(function(a){a.effects.transfer=function(b){return this.queue(function(){var f=a(this),h=a(b.options.to),e=h.offset(),g={top:e.top,left:e.left,height:h.innerHeight(),width:h.innerWidth()},d=f.offset(),c=a('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(b.options.className).css({top:d.top,left:d.left,height:f.innerHeight(),width:f.innerWidth(),position:"absolute"}).animate(g,b.duration,b.options.easing,function(){c.remove(); (b.callback&&b.callback.apply(f[0],arguments)); f.dequeue() }) }) } })(jQuery);
OC.L10N.register( "encryption", { "Missing recovery key password" : "遺失還原金鑰密碼", "Please repeat the recovery key password" : "請您再輸入新的還原金鑰密碼一次", "Repeated recovery key password does not match the provided recovery key password" : "輸入的還原金鑰密碼與設定的並不相符", "Recovery key successfully enabled" : "還原金鑰已成功開啟", "Could not enable recovery key. Please check your recovery key password!" : "無法啟用還原金鑰。請檢查您的還原金鑰密碼!", "Recovery key successfully disabled" : "還原金鑰已成功停用", "Could not disable recovery key. Please check your recovery key password!" : "無法停用還原金鑰。請檢查您的還原金鑰密碼!", "Missing parameters" : "遺失參數", "Please provide the old recovery password" : "請提供舊的還原密碼", "Please provide a new recovery password" : "請提供新的還原密碼", "Please repeat the new recovery password" : "請您再輸入新的還原密碼", "Password successfully changed." : "成功變更密碼。", "Could not change the password. Maybe the old password was not correct." : "無法變更密碼,或許是輸入的舊密碼不正確。", "Recovery Key disabled" : "還原金鑰停用", "Recovery Key enabled" : "還原金鑰啟用", "Could not enable the recovery key, please try again or contact your administrator" : "無法啟用還原金鑰功能,請重試或聯絡系統管理員", "Could not update the private key password." : "無法更新私人金鑰密碼", "The old password was not correct, please try again." : "舊密碼不正確,請再試一次", "The current log-in password was not correct, please try again." : "目前登入的密碼不正確,請再試一次", "Private key password successfully updated." : "私人金鑰密碼已成功更新。", "You need to migrate your encryption keys from the old encryption (ownCloud <= 8.0) to the new one. Please run 'occ encryption:migrate' or contact your administrator" : "您需要搬移您的加密鑰匙從舊版的加密 (ownCloud <= 8.0) 到新版,請執行 'occ encryption:migrate' 或是聯絡系統管理員", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." : "無效的檔案加密私鑰,請在個人設定中更新您的私鑰密語以存取加密的檔案。", "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "檔案加密已啓用,但是您的金鑰尚未初始化,請重新登入一次", "Encryption App is enabled and ready" : "加密應用程式已經被啟用", "Bad Signature" : "壞的簽章", "Missing Signature" : "遺失簽章", "one-time password for server-side-encryption" : "一次性密碼用於伺服器端的加密", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "無法解密這個檔案,也許這是分享的檔案。請詢問檔案所有人重新分享檔案給您。", "Can not read this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "無法檢視這個檔案,或許這是分享的檔案,請詢問這個檔案的擁有者並請他重新分享給您。", "Hey there,\n\nthe admin enabled server-side-encryption. Your files were encrypted using the password '%s'.\n\nPlease login to the web interface, go to the section 'ownCloud basic encryption module' of your personal settings and update your encryption password by entering this password into the 'old log-in password' field and your current login-password.\n\n" : "嗨,請看這裡,\n\n系管理員啟用了伺服器端的加密功能,您的檔案將會使用密碼 '%s' 加密\n\n請從網頁登入,到 'ownCloud basic encryption module' 設置您的個人設定並透過更新加密密碼,將這個組密碼設定在 'old log-in password' 以及您的目前登入密碼\n", "The share will expire on %s." : "這個分享將會於 %s 過期", "Cheers!" : "太棒了!", "Hey there,<br><br>the admin enabled server-side-encryption. Your files were encrypted using the password <strong>%s</strong>.<br><br>Please login to the web interface, go to the section \"ownCloud basic encryption module\" of your personal settings and update your encryption password by entering this password into the \"old log-in password\" field and your current login-password.<br><br>" : "嗨,請看這裡,<br><br>系管理員啟用了伺服器端的加密功能,您的檔案將會使用密碼<strong> '%s' </strong>加密,請從網頁登入,到 'ownCloud basic encryption module' 設置您的個人設定並透過更新加密密碼,將這個組密碼設定在 'old log-in password' 以及您的目前登入密碼<br><br>", "Encrypt the home storage" : "加密家目錄空間", "Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted" : "請啟用這個功能以用來加密主要儲存空間的檔案,否則只有再外部儲存的檔案會加密", "Enable recovery key" : "啟用還原金鑰", "Disable recovery key" : "關閉還原金鑰", "The recovery key is an extra encryption key that is used to encrypt files. It allows recovery of a user's files if the user forgets his or her password." : "加密金鑰是另一種加密檔案方式,當使用者忘記密碼時,可以用還原金鑰來還原檔案", "Recovery key password" : "還原金鑰密碼", "Repeat recovery key password" : "再輸入還原金鑰密碼一次", "Change recovery key password:" : "變更還原金鑰密碼:", "Old recovery key password" : "舊的還原金鑰密碼", "New recovery key password" : "新的還原金鑰密碼", "Repeat new recovery key password" : "再輸入新的還原金鑰密碼一次", "Change Password" : "變更密碼", "ownCloud basic encryption module" : "ownCloud 基本加密模組", "Your private key password no longer matches your log-in password." : "您的私人金鑰密碼不符合您的登入密碼", "Set your old private key password to your current log-in password:" : "設定您的舊私人金鑰密碼到您現在的登入密碼:", " If you don't remember your old password you can ask your administrator to recover your files." : "如果您忘記舊密碼,可以請求管理員協助取回檔案。", "Old log-in password" : "舊登入密碼", "Current log-in password" : "目前的登入密碼", "Update Private Key Password" : "更新私人金鑰密碼", "Enable password recovery:" : "啟用密碼還原:", "Enabling this option will allow you to reobtain access to your encrypted files in case of password loss" : "啟用這個選項將會允許您因忘記密碼但需要存取您的加密檔案", "Enabled" : "已啓用", "Disabled" : "已停用" }, "nplurals=1; plural=0;");
define([ "./numbering-system", "../common/create-error/unsupported-feature" ], function( numberNumberingSystem, createErrorUnsupportedFeature ) { /** * nuMap( cldr ) * * @cldr [Cldr instance]. * * Return digits map if numbering system is different than `latn`. */ return function( cldr ) { var aux, nu = numberNumberingSystem( cldr ); if ( nu === "latn" ) { return; } aux = cldr.supplemental([ "numberingSystems", nu ]); if ( aux._type !== "numeric" ) { throw createErrorUnsupportedFeature( "`" + aux._type + "` numbering system" ); } return aux._digits; }; });
import $ from "jquery"; import * as color_class from "./color_class"; import {$t} from "./i18n"; import * as message_view_header from "./message_view_header"; import * as stream_settings_ui from "./stream_settings_ui"; function update_table_stream_color(table, stream_name, color) { // This is ugly, but temporary, as the new design will make it // so that we only have color in the headers. const style = color; const stream_labels = $("#floating_recipient_bar").add(table).find(".stream_label"); for (const label of stream_labels) { const $label = $(label); if ($label.text().trim() === stream_name) { const messages = $label.closest(".recipient_row").children(".message_row"); messages .children(".messagebox") .css( "box-shadow", "inset 2px 0px 0px 0px " + style + ", -1px 0px 0px 0px " + style, ); messages .children(".date_row") .css( "box-shadow", "inset 2px 0px 0px 0px " + style + ", -1px 0px 0px 0px " + style, ); $label.css({background: style, "border-left-color": style}); $label.removeClass("dark_background"); $label.addClass(color_class.get_css_class(color)); } } } function update_stream_sidebar_swatch_color(id, color) { $(`#stream_sidebar_swatch_${CSS.escape(id)}`).css("background-color", color); $(`#stream_sidebar_privacy_swatch_${CSS.escape(id)}`).css("color", color); } function update_historical_message_color(stream_name, color) { update_table_stream_color($(".focused_table"), stream_name, color); if ($(".focused_table").attr("id") !== "#zhome") { update_table_stream_color($("#zhome"), stream_name, color); } } const stream_color_palette = [ ["a47462", "c2726a", "e4523d", "e7664d", "ee7e4a", "f4ae55"], ["76ce90", "53a063", "94c849", "bfd56f", "fae589", "f5ce6e"], ["a6dcbf", "addfe5", "a6c7e5", "4f8de4", "95a5fd", "b0a5fd"], ["c2c2c2", "c8bebf", "c6a8ad", "e79ab5", "bd86e5", "9987e1"], ]; const subscriptions_table_colorpicker_options = { clickoutFiresChange: true, showPalette: true, showInput: true, palette: stream_color_palette, }; export function set_colorpicker_color(colorpicker, color) { colorpicker.spectrum({ ...subscriptions_table_colorpicker_options, color, container: "#subscription_overlay .subscription_settings.show", }); } export function update_stream_color(sub, color, {update_historical = false} = {}) { sub.color = color; const stream_id = sub.stream_id; // The swatch in the subscription row header. $(`.stream-row[data-stream-id='${CSS.escape(stream_id)}'] .icon`).css( "background-color", color, ); // The swatch in the color picker. set_colorpicker_color( $( `#subscription_overlay .subscription_settings[data-stream-id='${CSS.escape( stream_id, )}'] .colorpicker`, ), color, ); $( `#subscription_overlay .subscription_settings[data-stream-id='${CSS.escape( stream_id, )}'] .large-icon`, ).css("color", color); if (update_historical) { update_historical_message_color(sub.name, color); } update_stream_sidebar_swatch_color(stream_id, color); message_view_header.colorize_message_view_header(); } function picker_do_change_color(color) { const stream_id = Number.parseInt($(this).attr("stream_id"), 10); const hex_color = color.toHexString(); stream_settings_ui.set_color(stream_id, hex_color); } subscriptions_table_colorpicker_options.change = picker_do_change_color; export const sidebar_popover_colorpicker_options = { clickoutFiresChange: true, showPaletteOnly: true, showPalette: true, showInput: true, flat: true, palette: stream_color_palette, change: picker_do_change_color, }; export const sidebar_popover_colorpicker_options_full = { clickoutFiresChange: false, showPalette: true, showInput: true, flat: true, cancelText: "", chooseText: $t({defaultMessage: "Confirm"}), palette: stream_color_palette, change: picker_do_change_color, };
define( ({ _themeLabel: "Tema de Demonstração", _layout_default: "Layout Padrão", _layout_right: "Layout Direita" }) );
function PopWinObject() { //var i = document.createElement("<iframe IsPopWin=1 name=PopWinIframe scrolling=no style='position:absolute;top:200;border:2 outset'></iframe>"); var i=document.createElement("div"); document.body.insertBefore(i); i.outerHTML = "<iframe IsPopWin=1 id=PopWinIframe width=1 height=1 frameborder=0 scrolling=no style='position:absolute;display:none;'></iframe>"; this.Iframe = document.all.PopWinIframe; this.Iframe.Object = this; this.Parent = self; this.Window = document.frames("PopWinIframe"); this.Document = document.frames("PopWinIframe").document; document.frames("PopWinIframe").document.open(); document.frames("PopWinIframe").document.close(); document.frames("PopWinIframe").PopWinObject = this; this.Body = document.frames("PopWinIframe").document.body; this.Iframe.removeAttribute("id"); this.Body.style.border="2 outset"; this.Body.style.marginTop=0; this.Body.style.marginLeft=0; this.Body.style.marginRight=0; this.Body.style.marginBottom=0; this.Body.style.backgroundColor="#cccccc"; this.IsAutoSize = true; this.HideWhenMouseOut = true; this.ClearWhenHide = false; EventHandler.AddObject(this); this.Iframe.onmouseover = function() { this.Object.Display = "block"; } this.Iframe.onmouseout = function() { this.Object.Display = "none"; this.Object.Window.setTimeout("if(PopWinObject.Display=='none' && PopWinObject.HideWhenMouseOut) PopWinObject.Hide();",2000) } this.Show = function (x,y,w,h,html) { if(html) this.Body.innerHTML = html; if(h) this.Iframe.style.posHeight = h; if(w) this.Iframe.style.posWidth = w; if(y) this.Iframe.style.posTop = y; if(x) this.Iframe.style.posLeft = x; this.Iframe.style.display = "block"; if(this.IsAutoSize) this.Window.setTimeout("PopWinObject.AutoSize();",1); if(this.OnShow) this.Window.setTimeout("PopWinObject.OnShow();",10); } this.AutoSize = function() { this.Iframe.style.posWidth = this.Body.scrollWidth; this.Iframe.style.posHeight = this.Body.scrollHeight; } this.BestPosition = function() { var x,y,cx,cy; cx = document.body.clientWidth - this.ReferX - this.Iframe.style.posWidth;; cy = document.body.clientHeight - this.ReferY - this.Iframe.style.posHeight; if(cx<0) this.Iframe.style.posLeft += cx; if(cy<0) this.Iframe.style.posTop += cy; } this.PopByPoint = function(html,x,y) { this.ReferX = x; this.ReferY = y; this.Show(this.ReferX + document.body.scrollLeft,this.ReferY+document.body.scrollTop,null,null,html); this.Window.setTimeout("PopWinObject.BestPosition();",100); } this.PopByMouse = function(html) { this.ReferX = event.x; this.ReferY = event.y; this.Show(this.ReferX + document.body.scrollLeft,this.ReferY+document.body.scrollTop,null,null,html); this.Window.setTimeout("PopWinObject.BestPosition();",100); } this.Hide = function() { this.Iframe.style.display = "none"; if(this.ClearWhenHide) this.Iframe.removeNode(true); } this.OnDocumentMouseDown = function() { this.Hide(); } } EventHandler = new Object; EventHandler.ObjectList = new Array; EventHandler.AddObject = function(obj) { this.ObjectList[this.ObjectList.length] = obj; } document.onmousedown = function() { for(var i = 0; i < EventHandler.ObjectList.length; i++) { if(EventHandler.ObjectList[i].OnDocumentMouseDown) { try {EventHandler.ObjectList[i].OnDocumentMouseDown();} catch(err) {} } } }
/* 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. */ db.email_address_old.find({'migrated': {'$ne': true}}).snapshot().forEach(function (e) { e.email = e._id; e._id = new ObjectId(); db.email_address.insert(e); db.email_address_old.update({'_id': e.email}, {$set: {migrated: true}}); }); // Drop the collection manually if everything is okay // db.email_address_old.drop();
({ insertImageTitle: "Insereix imatge", url: "Imatge", browse: "Navega...", text: "Descripció", set: "Insereix", invalidMessage: "Tipus de fitxer d\'imatge no vàlid", prePopuTextUrl: "Especifiqueu un URL d\'imatge", prePopuTextBrowse: " o navegueu fins un fitxer local." })
/* * Copyright 2013 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.templates.autorefresh.AutorefreshTestCase2", $events : { "Ready" : { description : "Raised when the template content is fully displayed." } }, $extends : 'aria.jsunit.TemplateTestCase', $dependencies : ['aria.templates.RefreshManager'], $constructor : function () { this.$TemplateTestCase.constructor.call(this); var testData = { a : { a : "aa", b : "ab" }, b : "b", c : "c" }; this.setTestEnv({ template : "test.aria.templates.autorefresh.Template2A", data : testData }); this.rm = aria.templates.RefreshManager; this._refreshesAA = 0; this._refreshesAAA = 0; this._template2A = 0; this._refreshesTemplateC = 0; }, $destructor : function () { this._refreshesAA = null; this._refreshesAAA = null; this._templateC = null; this._template2A; this._refreshesTemplateC; this.$TemplateTestCase.$destructor.call(this); }, $prototype : { runTemplateTest : function () { this.rm.updateHierarchies(); var h = this.rm.getHierarchies(); this.rm.stop(); var root = null; for (var i = 0; i < h.length; i++) { if (h[i].elem.tplClasspath == this.env.template) { root = h[i]; break; } } var sectionAA = root.content[0].elem; var template2A = root.elem; var templateC = root.content[1].elem.behavior; aria.utils.Json.setValue(this.templateCtxt._tpl.data.a, "a", "newA"); sectionAA.tplCtxt.$on({ "SectionRefreshed" : { fn : function (evt) { // evt.name ==SectionRefreshed if (evt.sectionID == "SectionAA") { this._refreshesAA++; } }, scope : this } }); templateC.subTplCtxt.$on({ "Ready" : { fn : function () { this._refreshesTemplateC++; }, scope : this } }); this.rm.resume(); this.assertTrue(this.getInputField("AAAtextfield").value === "newA"); this.assertTrue(this._refreshesTemplateC === 0); this.assertTrue(this._refreshesAA === 1); this.end(); } } });
import { get, set, observer, computed } from '@ember/object'; import { inject as service } from '@ember/service'; import Component from '@ember/component'; import layout from './template'; export default Component.extend({ intl: service(), layout, // Inputs instance: null, errors: null, editing: true, service: null, isSidekick: null, scaleMode: null, // ---------------------------------- terminal: null, statusClass: null, status: null, init() { this._super(...arguments); this.initTerminal(); this.scaleModeDidChange(); }, terminalDidChange: observer('terminal.type', function() { var val = get(this, 'terminal.type'); var stdin = ( val === 'interactive' || val === 'both' ); var tty = (val === 'terminal' || val === 'both'); set(this, 'instance.tty', tty); set(this, 'instance.stdin', stdin); }), scaleModeDidChange: observer('scaleMode', function() { const restartPolicy = get(this, 'service.restartPolicy'); if ( get(this, 'isJob') ) { if ( restartPolicy === 'Always' ) { set(this, 'service.restartPolicy', 'Never'); } } else { set(this, 'service.restartPolicy', 'Always'); } }), isJob: computed('scaleMode', function() { return get(this, 'scaleMode') === 'job' || get(this, 'scaleMode') === 'cronJob'; }), // ---------------------------------- // Terminal // 'both', initTerminal() { var instance = get(this, 'instance'); var tty = get(instance, 'tty'); var stdin = get(instance, 'stdin'); var out = { type: 'both', name: get(this, 'intl').t('formCommand.console.both', { htmlSafe: true }), }; if ( tty !== undefined || stdin !== undefined ) { if ( tty && stdin ) { out.type = 'both'; out.name = get(this, 'intl').t('formCommand.console.both', { htmlSafe: true }); } else if ( tty ) { out.type = 'terminal'; out.name = get(this, 'intl').t('formCommand.console.terminal', { htmlSafe: true }); } else if ( stdin ) { out.type = 'interactive'; out.name = get(this, 'intl').t('formCommand.console.interactive', { htmlSafe: true }); } else { out.type = 'none'; out.name = get(this, 'intl').t('formCommand.console.none', { htmlSafe: true }); } } set(this, 'terminal', out); this.terminalDidChange(); } });
/*! * SAP UI development toolkit for HTML5 (SAPUI5/OpenUI5) * (c) Copyright 2009-2015 SAP SE or an SAP affiliate company. * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. */ // Provides default renderer for control sap.ui.commons.ColorPicker sap.ui.define(['jquery.sap.global'], function(jQuery) { "use strict"; /** * ColorPicker renderer. * @namespace */ var ColorPickerRenderer = { }; /** * Renders the HTML for the given control, using the provided {@link sap.ui.core.RenderManager}. * * @param {sap.ui.core.RenderManager} oRenderManager the RenderManager that can be used for writing to the Render-Output-Buffer * @param {sap.ui.core.Control} oControl an object representation of the control that should be rendered */ ColorPickerRenderer.render = function(oRm, oControl){ // write the HTML into the render manager oRm.write("<div"); // Outer DIV oRm.writeControlData(oControl); oRm.writeClasses(); oRm.write(">"); // <DIV> element oRm.renderControl(oControl.oMatrix); oRm.write("</div>"); // outer DIV }; return ColorPickerRenderer; }, /* bExport= */ true);
// Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- es6id: 13.12.11 description: > Completion value when execution continues through multiple cases and ends with a normal completion info: | SwitchStatement : switch ( Expression ) CaseBlock [...] 8. Let R be the result of performing CaseBlockEvaluation of CaseBlock with argument switchValue. 9. Set the running execution context’s LexicalEnvironment to oldEnv. 10. Return R. 13.12.9 Runtime Semantics: CaseBlockEvaluation CaseBlock : { CaseClausesopt DefaultClause CaseClausesopt } 1. Let V = undefined. 2. Let A be the list of CaseClause items in the first CaseClauses, in source text order. If the first CaseClauses is not present A is « ». 3. Let found be false. 4. Repeat for each CaseClause C in A [...] 5. Let foundInB be false. 6. Let B be the List containing the CaseClause items in the second CaseClauses, in source text order. If the second CaseClauses is not present B is « ». 7. If found is false, then a. Repeat for each CaseClause C in B i. If foundInB is false, then 1. Let clauseSelector be the result of CaseSelectorEvaluation of C. [...] 3. Let foundInB be the result of performing Strict Equality Comparison input === clauseSelector.[[value]]. ii. If foundInB is true, then [...] 8. If foundInB is true, return NormalCompletion(V). 9. Let R be the result of evaluating DefaultClause. 10. If R.[[value]] is not empty, let V = R.[[value]]. 11. If R is an abrupt completion, return Completion(UpdateEmpty(R, V)). 12. Repeat for each CaseClause C in B (NOTE this is another complete iteration of the second CaseClauses) a. Let R be the result of evaluating CaseClause C. b. If R.[[value]] is not empty, let V = R.[[value]]. c. If R is an abrupt completion, return Completion(UpdateEmpty(R, V)). 13. Return NormalCompletion(V). ---*/ assert.sameValue( eval('1; switch ("a") { default: case "b": 2; case "c": 3; }'), 3, 'Non-empty value replaces previous non-empty value' ); assert.sameValue( eval('4; switch ("a") { default: case "b": case "c": 5; }'), 5, 'Non-empty value replaces empty value' ); assert.sameValue( eval('6; switch ("a") { default: case "b": 7; case "c": }'), 7, 'Empty value does not replace previous non-empty value' );
/** * 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 */ // flowlint ambiguous-object-type:error 'use strict'; export type CompileResult = 'HAS_CHANGES' | 'NO_CHANGES' | 'ERROR'; export type File = | { exists: false, relPath: string, ... } | { exists: true, relPath: string, hash: string, ... };
ivphpanYandexMap = { id:'', idCords:'#ivphpanYandexMapCords', options: { center: [], zoom: 16, controls: ["zoomControl", "fullscreenControl","geolocationControl"] }, map:'', cords:[], points:[], events:[], init:function(id,options) { ivphpanYandexMap.reset(); ivphpanYandexMap.id=id; if(typeof options != 'undefined') { ivphpanYandexMap.options = options; } ymaps.ready(function(){ ivphpanYandexMap.map = new ymaps.Map(ivphpanYandexMap.id,ivphpanYandexMap.options); ivphpanYandexMap.map.events.add('click', function (e) { // Получение координат щелчка ivphpanYandexMap.cords = e.get('coords'); $(ivphpanYandexMap.idCords).val(ivphpanYandexMap.cords).change(); }); var timerId = setInterval(function(){ if(ivphpanYandexMap.cords) { for(var i = 0;i<ivphpanYandexMap.events.length;i++) { var event = ivphpanYandexMap.events[i]; if(event == "setCenter") { ivphpanYandexMap.setCenter(); } if(event == "panTo") { ivphpanYandexMap.panTo(); } if(event == "drawPoints") { ivphpanYandexMap.drawPoints(); } } ivphpanYandexMap.reset(); } },1000); }); }, setEvent:function(event){ ivphpanYandexMap.events.push(event); }, resetPoints:function(){ ivphpanYandexMap.points = []; }, addPoint:function(coords,title){ var point = {}; point.main = { // Описание геометрии. geometry: { type: "Point", coordinates: coords }, // Свойства. properties: { // Контент метки. iconContent: title||'Местоположение на карте' } }; point.options = { // Опции. // Иконка метки будет растягиваться под размер ее содержимого. preset: 'islands#blackStretchyIcon', // Метку можно перемещать. draggable: false }; ivphpanYandexMap.points.push(point); }, drawPoints: function () { ivphpanYandexMap.map.geoObjects.removeAll(); for(var i = 0;i<ivphpanYandexMap.points.length;i++) { var point = ivphpanYandexMap.points[i]; var main = point.main; var options = point.options; myGeoObject = new ymaps.GeoObject(main,options); ivphpanYandexMap.map.geoObjects.add(myGeoObject); } }, getBackgroundCordsByAddress:function(address) { var geocoder = ymaps.geocode(address); geocoder.then( function (res) { ivphpanYandexMap.cords = res.geoObjects.get(0).geometry.getCoordinates(); }, function (err) { ivphpanYandexMap.cords = [55.76, 37.64]; } ); }, getCordsByAddress:function(address) { ivphpanYandexMap.getBackgroundCordsByAddress(address); }, setCenter:function(){ ivphpanYandexMap.map.setCenter( ivphpanYandexMap.cords ); }, reset:function() { ivphpanYandexMap.cords = []; ivphpanYandexMap.events = []; }, panTo:function(cords) { var cords = typeof cords!='undefined' ? cords : ivphpanYandexMap.cords; for(key in cords) { cords[key]=parseFloat(cords[key]); } ivphpanYandexMap.map.panTo(cords); } };
module.exports = { // COLORS: // redish: .C-f2438c // blueish: .C-07f 'breakPoints': { 'sm': '@media(min-width:700px)', 'md': '@media(min-width:992px)', 'lg': '@media(min-width:1200px)' }, // custom atomic classes mapped to their values 'custom': { 'Bdx(1)': '1px solid #ccc', 'Bd(1)': '1px solid rgba(2, 128, 174, .3)', 'Bdt(1)': '1px solid rgba(2, 128, 174, .3)', 'Bd(2)': '1px solid rgb(255, 255, 255)', 'Bdb(1)': '1px solid rgba(2, 128, 174, .3)', 'Bgc(logo)': '#0262AA', 'Bg(splash)': 'url("../images/splash_background.jpg") no-repeat #0262AA', 'Tsh(1)': '0 1px 0 rgba(0, 0, 0, 0.8)' } };
import state from './state'; import mutations from './mutations'; import * as actions from './actions'; export default () => ({ namespaced: true, state: state(), mutations, actions, });
var chai = require('chai'); var expect = chai.expect; describe('Environment Variables', function() { describe('process.env.FACEBOOK_TEST_EMAIL', function() { it('should be set', function() { expect(process.env.FACEBOOK_TEST_EMAIL).to.exist; }); }); describe('process.env.FACEBOOK_TEST_PASSWORD', function() { it('should be set', function() { expect(process.env.FACEBOOK_TEST_PASSWORD).to.exist; }); }); describe('process.env.GOOGLE_TEST_EMAIL', function() { it('should be set', function() { expect(process.env.GOOGLE_TEST_EMAIL).to.exist; }); }); describe('process.env.GOOGLE_TEST_PASSWORD', function() { it('should be set', function() { expect(process.env.GOOGLE_TEST_PASSWORD).to.exist; }); }); });
"use strict"; var helper = require('../../helper'); var DealTrackingStageManager = require('../../../src/managers/sales/deal-tracking-stage-manager'); var generateCode = require("../../../src/utils/code-generator"); var dealTrackingBoard = require("./deal-tracking-board-data-util"); class DealTrackingStageDataUtil { getNewData() { return dealTrackingBoard.getTestData() .then((result) => { var Model = require('dl-models').sales.DealTrackingStage; var data = new Model(); var code = generateCode(); data.code = code; data.boardId = result._id; data.name = `name[${code}]`; data.deals = []; return Promise.resolve(data); }); } getTestData() { return helper .getManager(DealTrackingStageManager) .then((manager) => { return this.getNewData().then((data) => { return manager.create(data) .then((id) => manager.getSingleById(id)); }); }); } } module.exports = new DealTrackingStageDataUtil();
/** * @module ember-paper */ import Component from '@ember/component'; import { run } from '@ember/runloop'; import Translate3dMixin from '../mixins/translate3d-mixin'; /** * @class PaperDialogInner * @extends Ember.Component * @uses Translate3dMixin */ export default Component.extend(Translate3dMixin, { tagName: 'md-dialog', classNames: ['md-default-theme'], classNameBindings: ['contentOverflow:md-content-overflow', 'fullscreen:md-dialog-fullscreen'], onTranslateFromEnd() { if (this.get('focusOnOpen')) { let toFocus = this.$('[autofocus]').last(); if (toFocus.length === 0) { toFocus = this.$('md-dialog-actions button').last(); } toFocus.focus(); } }, onTranslateToEnd($origin) { if ($origin) { $origin.focus(); } }, didInsertElement() { this._super(...arguments); this.checkContentOverflow(); // content overflow might change depending on load of images inside dialog. let images = this.$().find('img'); images.on(`load.${this.elementId}`, run.bind(this, this.checkContentOverflow)); }, willDestroyElement() { this._super(...arguments); let images = this.$().find('img'); images.off(`load.${this.elementId}`); }, checkContentOverflow() { let content = this.element.querySelector('md-dialog-content'); if (content) { this.set('contentOverflow', content.scrollHeight > content.clientHeight); } } });
/** * Release * Called as last, tells the user has released the screen * @events release */ Hammer.gestures.Release = { name : 'release', index : Infinity, handler: function releaseGesture(ev, inst) { if(ev.eventType == Hammer.EVENT_END) { inst.trigger(this.name, ev); } } };
var macros = require('./macros') , statsd = require('statsd-parser') , lynx = macros.lynx , test = macros.test , udpServer = macros.udpServer , connection = macros.connection , count = 0 , finished = false ; // // TOTAL is the number of iterations to do // DESIRED is the minimum number of requests expected // SAMPLE Number of samples to send, e.g. @0.1 (1 in 10) // var DESIRED = 90 , TOTAL = 1000 , SAMPLE = 0.1 ; // // Try to do this a thousand times // [1,2,3,...,1000] // var coll = []; for(i=0; i<TOTAL; i++) { coll.push(i); } // // Remove console.log from errors, plenty of nothing to send here // connection.on_error = function () {}; // // We are going to do one thousand `TOTAL` packets // and see if we hit our minimums // // When you specify sampling `lynx` must track that it only send the amount // of packages you are specifying (e.g. 1 in each 10 for @0.1 as in `SAMPLE`) // // To do this we use random numbers, making our process not perfect but // accurate enough // // Because of the randomness that is used to select which packets are sent // this can never be an exact test and might break while the code is // perfectly fine // test('sampling', function (t) { var server = udpServer(function (message, remote) { count++; // // Add, check if its a valid statsd message and includes sample rate // that is teh same as being tested // var match = statsd.matchStatsd(message.toString()); t.ok(match, message.toString()); t.equal(SAMPLE.toString(), match.sample_rate); // // When we finally hit our lower threshold // if(count > DESIRED) { finished = true; t.ok(true, 'Reached ' + DESIRED + ' on ' + (TOTAL - coll.length) + ' packets.'); server.close(); } }); // // Run all the iterations // var runAll = function(coll, callback) { (function iterate() { if (coll.length === 0) { return callback(); } coll.pop(); setTimeout(function send_packet() { // // Send a sample // connection.gauge('spl.foo', 500, SAMPLE); process.nextTick(iterate); }, Math.ceil(Math.random() * 10)); })(); }; runAll(coll, function() { if (finished) { t.ok(true, 'Reached ' + DESIRED + ' on ' + TOTAL + ' packets.'); t.end(); return; } // // If we reached the end and this has not closed by having // the desired amount of requests // t.ok(false, 'Didnt reach the desired amount of packets ' + DESIRED + '/' + TOTAL + ' was -> ' + count); server.close(); t.end(); }); }); // // TODO: Sampling with irregular batches //
var FieldType = require('../Type'); var util = require('util'); var utils = require('keystone-utils'); /** * Text FieldType Constructor * @extends Field * @api public */ function text(list, path, options) { this._nativeType = String; this._underscoreMethods = ['crop']; text.super_.call(this, list, path, options); } util.inherits(text, FieldType); /** * Add filters to a query */ text.prototype.addFilterToQuery = function(filter, query) { query = query || {}; if (filter.mode === 'exactly' && !filter.value) { query[this.path] = filter.inverted ? { $nin: ['', null] } : { $in: ['', null] }; return; } var value = utils.escapeRegExp(filter.value); if (filter.mode === 'startsWith') { value = '^' + value; } else if (filter.mode === 'endsWith') { value = value + '$'; } else if (filter.mode === 'exactly') { value = '^' + value + '$'; } value = new RegExp(value, filter.caseSensitive ? '' : 'i'); query[this.path] = filter.inverted ? { $not: value } : value; return query; }; /** * Crops the string to the specifed length. */ text.prototype.crop = function(item, length, append, preserveWords) { return utils.cropString(item.get(this.path), length, append, preserveWords); }; /* Export Field Type */ module.exports = text;
Class.Binds = new Class({ bindMethods: function(){} });
import { Meteor } from 'meteor/meteor'; import { check } from 'meteor/check'; import { hasPermission } from '../../app/authorization'; import { Users, Subscriptions, Messages } from '../../app/models'; import { settings } from '../../app/settings'; import { Notifications } from '../../app/notifications'; Meteor.methods({ removeRoomLeader(rid, userId) { check(rid, String); check(userId, String); if (!Meteor.userId()) { throw new Meteor.Error('error-invalid-user', 'Invalid user', { method: 'removeRoomLeader', }); } if (!hasPermission(Meteor.userId(), 'set-leader', rid)) { throw new Meteor.Error('error-not-allowed', 'Not allowed', { method: 'removeRoomLeader', }); } const user = Users.findOneById(userId); if (!user || !user.username) { throw new Meteor.Error('error-invalid-user', 'Invalid user', { method: 'removeRoomLeader', }); } const subscription = Subscriptions.findOneByRoomIdAndUserId(rid, user._id); if (!subscription) { throw new Meteor.Error('error-user-not-in-room', 'User is not in this room', { method: 'removeRoomLeader', }); } if (Array.isArray(subscription.roles) === true && subscription.roles.includes('leader') === false) { throw new Meteor.Error('error-user-not-leader', 'User is not a leader', { method: 'removeRoomLeader', }); } Subscriptions.removeRoleById(subscription._id, 'leader'); const fromUser = Users.findOneById(Meteor.userId()); Messages.createSubscriptionRoleRemovedWithRoomIdAndUser(rid, user, { u: { _id: fromUser._id, username: fromUser.username, }, role: 'leader', }); if (settings.get('UI_DisplayRoles')) { Notifications.notifyLogged('roles-change', { type: 'removed', _id: 'leader', u: { _id: user._id, username: user.username, name: user.name, }, scope: rid, }); } return true; }, });
import AccountsServer from '@accounts/server'; import MongoAdapter from '@accounts/mongo'; import { MongoInternals } from 'meteor/mongo'; import { Meteor } from 'meteor/meteor'; Meteor.startup(() => { const mongodb = MongoInternals.defaultRemoteCollectionDriver().mongo.db; const mongoAdapter = new MongoAdapter(mongodb, { convertUserIdToMongoObjectId: false, }); AccountsServer.config({ tokenConfigs: { accessToken: { expiresIn: '3d', }, refreshToken: { expiresIn: '30d', }, }, passwordHashAlgorithm: 'sha256', }, mongoAdapter); });
const expect = require('chai').expect; const errorInEachBrowserContains = require('../../../../assertion-helper.js').errorInEachBrowserContains; describe('[Raw API] Drag actions', function () { describe('drag', function () { it('Should drag an element by an offset', function () { return runTests('./testcafe-fixtures/drag.testcafe', 'Drag to offset', { shouldFail: true }) .catch(function (errs) { errorInEachBrowserContains(errs, 'Drag to offset completed successfully', 0); }); }); }); describe('drag-to-element', function () { it('Should drag an element to another element', function () { return runTests('./testcafe-fixtures/drag.testcafe', 'Drag to element', { shouldFail: true }) .catch(function (errs) { errorInEachBrowserContains(errs, 'Drag to element completed successfully', 0); }); }); it("Should fail if a dragged element doesn't exist", function () { return runTests('./testcafe-fixtures/drag.testcafe', 'Drag non-existent element to another element', { shouldFail: true }) .catch(function (errs) { expect(errs[0]).contains( 'The specified selector does not match any element in the DOM tree.' + ' > | Selector(\'#non-existent\')' ); expect(errs[0]).contains('[[Drag non-existent element to another element callsite]]'); }); }); it('Should fail if a dragged element is invisible', function () { return runTests('./testcafe-fixtures/drag.testcafe', 'Drag invisible element to another element', { shouldFail: true }) .catch(function (errs) { expect(errs[0]).contains('The element that matches the specified selector is not visible.'); expect(errs[0]).contains('[[Drag invisible element to another element callsite]]'); }); }); it("Should fail if a destination element doesn't exist", function () { return runTests('./testcafe-fixtures/drag.testcafe', 'Drag to non-existent element', { shouldFail: true }) .catch(function (errs) { expect(errs[0]).contains( 'The specified "destinationSelector" does not match any element in the DOM tree.' + ' > | Selector(\'#non-existent\')' ); expect(errs[0]).contains('[[Drag to non-existent element callsite]]'); }); }); it('Should fail if a destination element is invisible', function () { return runTests('./testcafe-fixtures/drag.testcafe', 'Drag to invisible element', { shouldFail: true }) .catch(function (errs) { expect(errs[0]).contains('The element that matches the specified "destinationSelector" is not visible.'); expect(errs[0]).contains('[[Drag to invisible element callsite]]'); }); }); }); });
/** * Created by aleckim on 2017. 7. 11.. */ "use strict"; var Logger = require('../lib/log'); global.log = new Logger(__dirname + "/debug.log"); var assert = require('assert'); describe('unit test - kasi rise set controller', function() { //it('test gather rise set from api', function (done) { // this.timeout(24*60*60*1000); // var KasiRiseSet = require('../controllers/kasi.riseset.controller'); // // KasiRiseSet.gatherAreaRiseSetFromApi(function (err, results) { // if (err) { // log.error(err); // } // else { // log.info(results); // } // done(); // }); //}); });
Tinytest.add("blaze-tools - token parsers", function (test) { var run = function (func, input, expected) { var scanner = new HTMLTools.Scanner('z' + input); // make sure the parse function respects `scanner.pos` scanner.pos = 1; var result = func(scanner); if (expected === null) { test.equal(scanner.pos, 1); test.equal(result, null); } else { test.isTrue(scanner.isEOF()); test.equal(result, expected); } }; var runValue = function (func, input, expectedValue) { var expected; if (expectedValue === null) expected = null; else expected = { text: input, value: expectedValue }; run(func, input, expected); }; var parseNumber = BlazeTools.parseNumber; var parseIdentifierName = BlazeTools.parseIdentifierName; var parseStringLiteral = BlazeTools.parseStringLiteral; runValue(parseNumber, "0", 0); runValue(parseNumber, "-0", 0); runValue(parseNumber, "-", null); runValue(parseNumber, ".a", null); runValue(parseNumber, ".1", 0.1); runValue(parseNumber, "1.", 1); runValue(parseNumber, "1.1", 1.1); runValue(parseNumber, "0x", null); runValue(parseNumber, "0xa", 10); runValue(parseNumber, "-0xa", -10); runValue(parseNumber, "1e+1", 10); run(parseIdentifierName, "a", "a"); run(parseIdentifierName, "true", "true"); run(parseIdentifierName, "null", "null"); run(parseIdentifierName, "if", "if"); run(parseIdentifierName, "1", null); run(parseIdentifierName, "1a", null); run(parseIdentifierName, "+a", null); run(parseIdentifierName, "a1", "a1"); run(parseIdentifierName, "a1a", "a1a"); run(parseIdentifierName, "_a8f_f8d88_", "_a8f_f8d88_"); runValue(parseStringLiteral, '"a"', 'a'); runValue(parseStringLiteral, '"\'"', "'"); runValue(parseStringLiteral, '\'"\'', '"'); runValue(parseStringLiteral, '"a\\\nb"', 'ab'); // line continuation runValue(parseStringLiteral, '"a\u0062c"', 'abc'); // Note: IE 8 doesn't correctly parse '\v' in JavaScript. runValue(parseStringLiteral, '"\\0\\b\\f\\n\\r\\t\\v"', '\0\b\f\n\r\t\u000b'); runValue(parseStringLiteral, '"\\x41"', 'A'); runValue(parseStringLiteral, '"\\\\"', '\\'); runValue(parseStringLiteral, '"\\\""', '\"'); runValue(parseStringLiteral, '"\\\'"', '\''); runValue(parseStringLiteral, "'\\\\'", '\\'); runValue(parseStringLiteral, "'\\\"'", '\"'); runValue(parseStringLiteral, "'\\\''", '\''); });
'use strict'; var personalsApp = angular.module('personals'); personalsApp.controller('ApptSlotController', ['$scope', 'slotService', function($scope, slotService) { $scope.slotList = slotService.slotList; $scope.slot = []; $scope.disabled = false; $scope.dayOptions = [ { label: 'Monday' }, { label: 'Tuesday' }, { label: 'Wednesday' }, { label: 'Thursday' }, { label: 'Friday' }, { label: 'Saturday' }, { label: 'Sunday' } ]; var refresh = function(personal) { console.log(personal); slotService.slotList = personal.slots; $scope.slot = ''; $scope.disabled = false; }; // Create new Appt Slot $scope.addSlots = function() { console.log(slotService.slotList); slotService.slotList.push({ day: $scope.slot.selectedDay.label, location: $scope.slot.location, starttime: $scope.slot.starttime, endtime: $scope.slot.endtime }); $scope.slotList = slotService.slotList; }; // Remove existing Slot $scope.remove = function(personal, slot) { if (slot) { for (var i in this.slotList) { if (this.slotList[i] === slot) { this.slotList.splice(i, 1); } } } else { this.slot.$remove(function() { }); } }; // Update existing Slot $scope.update = function(personal) { personal.slots = []; for (var index = 0; index < slotService.slotList.length; index++) { personal.slots.push( { day: slotService.slotList[index].day, starttime: slotService.slotList[index].starttime, endtime: slotService.slotList[index].endtime, location: slotService.slotList[index].location } ); } personal.$update(function() { refresh(personal); }, function(errorResponse) { $scope.error = errorResponse.data.message; console.log(errorResponse.data.message); }); }; $scope.edit = function(slot) { for (var i in this.slotList) { if (this.slotList[i] === slot) { $scope.slot = slot; } } $scope.disabled = true; }; $scope.deselect = function() { $scope.slot = ''; $scope.disabled = false; }; } ]);
/** * @author alteredq / http://alteredqualia.com/ * * Dot screen shader * based on glfx.js sepia shader * https://github.com/evanw/glfx.js */ THREE.DotScreenRGBShader = { uniforms: { "tDiffuse": { type: "t", value: null }, "tSize": { type: "v2", value: new THREE.Vector2( 256, 256 ) }, "center": { type: "v2", value: new THREE.Vector2( 0.5, 0.5 ) }, "angle": { type: "f", value: 1.57 }, "scale": { type: "f", value: 1.0 } }, vertexShader: [ "varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}" ].join("\n"), fragmentShader: [ "uniform vec2 center;", "uniform float angle;", "uniform float scale;", "uniform vec2 tSize;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "float pattern() {", "float s = sin( angle ), c = cos( angle );", "vec2 tex = vUv * tSize - center;", "vec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale;", "return ( sin( point.x ) * sin( point.y ) ) * 4.0;", "}", "void main() {", "vec4 color = texture2D( tDiffuse, vUv );", "float r = color.r * 10.0 - 5.0 + pattern();", "float g = color.g * 10.0 - 5.0 + pattern();", "float b = color.b * 10.0 - 5.0 + pattern();", "gl_FragColor = vec4( r, g, b, color.a );", "}" ].join("\n") };
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _reactAddonsPureRenderMixin = require('react-addons-pure-render-mixin'); var _reactAddonsPureRenderMixin2 = _interopRequireDefault(_reactAddonsPureRenderMixin); var _svgIcon = require('../../svg-icon'); var _svgIcon2 = _interopRequireDefault(_svgIcon); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var SocialPerson = _react2.default.createClass({ displayName: 'SocialPerson', mixins: [_reactAddonsPureRenderMixin2.default], render: function render() { return _react2.default.createElement( _svgIcon2.default, this.props, _react2.default.createElement('path', { d: 'M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z' }) ); } }); exports.default = SocialPerson; module.exports = exports['default'];
/** * @file * Adds smooth scrolling to TOC anchor links. * * From: Scroll window smoothly in jQuery - Animated scroll * http://blog.freelancer-id.com/2009/03/26/scroll-window-smoothly-in-jquery/ */ (function ($) { Drupal.tocFilterScrollToOnClick = function() { // Make sure links still has hash. if (!this.hash || this.hash == '#') { return true; } // Make sure the href is pointing to an anchor link on this page. var href = this.href.replace(/#[^#]*$/, ''); var url = window.location.toString(); if (href && url.indexOf(href) === -1) { return true; } // Find hash target. var $a = $('a[name=' + this.hash.substring(1) + ']'); // Make hash target is on the current page. if (!$a.length) { return true; } // Scroll to hash target var duration = Drupal.settings.toc_filter_smooth_scroll_duration || 'medium'; $('html, body').animate({scrollTop: $a.offset().top}, duration); return false; } Drupal.behaviors.tocFilterSmoothScroll = { attach: function (context) { // Only map <a href="#..."> links $('a[href*="#"]', context).once('toc-filter').click(Drupal.tocFilterScrollToOnClick); } }; })(jQuery)
/* * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code 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 * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ function readMsi(msiPath, callback) { var installer = new ActiveXObject('WindowsInstaller.Installer') var database = installer.OpenDatabase(msiPath, 0 /* msiOpenDatabaseModeReadOnly */) return callback(database) } function queryAllProperties(db) { var reply = {} var view = db.OpenView("SELECT `Property`, `Value` FROM Property") view.Execute() try { while(true) { var record = view.Fetch() if (!record) { break } var name = record.StringData(1) var value = record.StringData(2) reply[name] = value } } finally { view.Close() } return reply } (function () { var msi = WScript.arguments(0) var propName = WScript.arguments(1) var props = readMsi(msi, queryAllProperties) WScript.Echo(props[propName]) })()
module.exports = { options: { jshintrc: true }, beforeconcat: '<%= concat.dev.src %>' };
// Copyright (c) 2016, Velometro Mobility Inc and contributors // For license information, please see license.txt frappe.query_reports["Production Order Stock Report"] = { "filters": [ { "fieldname":"warehouse", "label": __("Warehouse"), "fieldtype": "Link", "options": "Warehouse" } ] }
/** * Created by panos on 10/16/15. */ (function () { 'use strict'; window.Toolbar = function (panels, editor) { this.element = document.createElement("div"); this.element.className = "fm-editor-toolbar"; this.editor = editor; this.createPanels(panels); }; Toolbar.__name__ = ["Toolbar"]; Toolbar.prototype = { createPanels: function (panels) { this.panels = []; this.activePanel = null; var panelDiv = document.createElement("div"); panelDiv.className = "fm-editor-panel-container"; this.createMlangPanel(panelDiv); for (var i = 0; i < panels.length; i++) { var panel = panels[i]; if (panel.visible) { var panelObj = new AreaPanel(panel, this); } else { var panelObj = new ButtonPanel(panel, this); } panelDiv.appendChild(panelObj.element); this.panels.push(panelObj); } this.element.appendChild(panelDiv); }, createMlangPanel: function (parentDiv) { this.mlangPanel = new MlangPanel(this); parentDiv.appendChild(this.mlangPanel.element); }, redraw: function () { for (var i = 0; i < this.panels.length; i++) { var panel = this.panels[i]; panel.redraw(); } }, element: null, activePanel: null, mlangPanel: null, editor: null, panels: null, __class__: Toolbar }; }());
/*global dojoConfig:true */ /*jslint browser:true,sloppy:true,nomen:true,unparam:true,plusplus:true,indent:4 */ /* | Copyright 2013 Esri | | 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. */ //============================================================================================================================// /** * initialize default dojo configuration attributes by creating a dojoConfig object */ var root = location.href.slice(0, location.href.lastIndexOf('/')); dojoConfig = { parseOnLoad: true, async: true, baseURL: root, packages: [{ name: "application", location: root }, { name: "widgets", location: root + '/js/library/widgets' }, { name: "coreLibrary", location: root + '/js/library/coreLibrary' }] };
//// [tests/cases/compiler/declarationEmitInferredTypeAlias5.ts] //// //// [0.ts] export type Data = string | boolean; let obj: Data = true; //// [1.ts] import * as Z from "./0" //let v2: Z.Data; let v = "str" || true; export { v } //// [0.js] "use strict"; exports.__esModule = true; var obj = true; //// [1.js] "use strict"; exports.__esModule = true; exports.v = void 0; //let v2: Z.Data; var v = "str" || true; exports.v = v; //// [0.d.ts] export declare type Data = string | boolean; //// [1.d.ts] declare let v: string | boolean; export { v };
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _reactAddonsPureRenderMixin = require('react-addons-pure-render-mixin'); var _reactAddonsPureRenderMixin2 = _interopRequireDefault(_reactAddonsPureRenderMixin); var _svgIcon = require('../../svg-icon'); var _svgIcon2 = _interopRequireDefault(_svgIcon); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var NotificationAirlineSeatReclineNormal = _react2.default.createClass({ displayName: 'NotificationAirlineSeatReclineNormal', mixins: [_reactAddonsPureRenderMixin2.default], render: function render() { return _react2.default.createElement( _svgIcon2.default, this.props, _react2.default.createElement('path', { d: 'M7.59 5.41c-.78-.78-.78-2.05 0-2.83.78-.78 2.05-.78 2.83 0 .78.78.78 2.05 0 2.83-.79.79-2.05.79-2.83 0zM6 16V7H4v9c0 2.76 2.24 5 5 5h6v-2H9c-1.66 0-3-1.34-3-3zm14 4.07L14.93 15H11.5v-3.68c1.4 1.15 3.6 2.16 5.5 2.16v-2.16c-1.66.02-3.61-.87-4.67-2.04l-1.4-1.55c-.19-.21-.43-.38-.69-.5-.29-.14-.62-.23-.96-.23h-.03C8.01 7 7 8.01 7 9.25V15c0 1.66 1.34 3 3 3h5.07l3.5 3.5L20 20.07z' }) ); } }); exports.default = NotificationAirlineSeatReclineNormal; module.exports = exports['default'];
enyo.kind({ name: "enyo.sample.ListNoSelectSample", classes: "list-sample enyo-fit", components: [ {name: "list", kind: "List", count: 20000, noSelect: true, multiSelect: false, classes: "enyo-fit list-sample-list", onSetupItem: "setupItem", components: [ {name: "item", classes: "list-sample-item enyo-border-box", components: [ {name: "index", classes: "list-sample-index"}, {name: "name"} ]} ]} ], names: [], setupItem: function(inSender, inEvent) { // this is the row we're setting up var i = inEvent.index; // make some mock data if we have none for this row if (!this.names[i]) { this.names[i] = makeName(5, 10, '', ''); } var n = this.names[i]; var ni = ("00000000" + i).slice(-7); this.$.name.setContent(n); this.$.index.setContent(ni); } });
//// [computedPropertyNames31_ES5.ts] class Base { bar() { return 0; } } class C extends Base { foo() { () => { var obj = { [super.bar()]() { } // needs capture }; } return 0; } } //// [computedPropertyNames31_ES5.js] var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var Base = /** @class */ (function () { function Base() { } Base.prototype.bar = function () { return 0; }; return Base; }()); var C = /** @class */ (function (_super) { __extends(C, _super); function C() { return _super !== null && _super.apply(this, arguments) || this; } C.prototype.foo = function () { var _this = this; (function () { var _a; var obj = (_a = {}, _a[_super.prototype.bar.call(_this)] = function () { } // needs capture , _a); }); return 0; }; return C; }(Base));
/* * Copyright (C) 2015 Stratio (http://stratio.com) * * 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. */ (function () { 'use strict'; /*DELETE POLICIES MODAL CONTROLLER */ angular .module('webApp') .controller('CreatePolicyJSONModalCtrl', CreatePolicyJSONModalCtrl); CreatePolicyJSONModalCtrl.$inject = ['$uibModalInstance', 'PolicyFactory', 'TemplateFactory', '$q']; function CreatePolicyJSONModalCtrl($uibModalInstance, PolicyFactory, TemplateFactory, $q) { /*jshint validthis: true*/ var vm = this; vm.cancel = cancel; vm.policy = {}; vm.validateForm = validateForm; init(); /////////////////////////////////////// function init() { return TemplateFactory.getPolicyJsonTemplate().then(function (template) { vm.template = template; }); } function cancel() { $uibModalInstance.dismiss('cancel'); } function validateForm() { vm.form.$setSubmitted(); vm.error = false; var name = ""; var description = ""; var parsedJSON; try { parsedJSON = JSON.parse(vm.policy.json); } catch (e) { vm.error = true; vm.errorText = "_ERROR_._INVALID_JSON_FORMAT_"; return; } name = vm.policy.name && vm.policy.name.length ? vm.policy.name : parsedJSON.name; description = vm.policy.description && vm.policy.description.length ? vm.policy.description : parsedJSON.description; if (name && name.length && description && description.length) { /*Check if the name of the policy already exists*/ return PolicyFactory.existsPolicy(name, vm.policy.id).then(function (found) { vm.error = found; /* Policy name doesn't exist */ if (!found) { createPolicy(parsedJSON, name, description); } /* Policy name exists */ else { vm.errorText = "_ERROR_._200_"; vm.error = true; } }); } else { vm.errorText = "_ERROR_._INVALID_JSON_FORMAT_"; vm.error = true; } } function createPolicy(json, name, description) { delete json.id; json.name = name; json.description = description; PolicyFactory.createPolicy(json).then(function () { $uibModalInstance.close(); }, function (error) { vm.error = true; vm.errorText = "_ERROR_._INVALID_JSON_FORMAT_"; }); } } })();
import React, { Component } from 'react'; import { Image } from 'react-native'; const splashscreen = require('../../../img/splashscreen.png'); export default class SplashPage extends Component { static propTypes = { navigator: React.PropTypes.shape({}), } componentWillMount() { const navigator = this.props.navigator; setTimeout(() => { navigator.replace({ id: 'home', }); }, 1500); } render() { // eslint-disable-line class-methods-use-this return ( <Image source={splashscreen} style={{ flex: 1, height: null, width: null }} /> ); } }
var __extends = this.__extends || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var derived = (function (_super) { __extends(derived, _super); function derived() { _super.apply(this, arguments); } return derived; })(base); var base = (function () { function base(n) { this.n = n; } return base; })();
function JSLINT(source, options) { JSLINT.errors = [ { line: 1, character: 1, reason: "I don't like you", evidence: "eWeWeWeWeWe" } ]; return false; }
define([ 'require', 'jquery', 'base/js/namespace', 'base/js/events', 'base/js/utils', 'notebook/js/codecell', ], function ( requirejs, $, Jupyter, events, utils, codecell ) { "use strict"; var CodeCell = codecell.CodeCell; var Scratchpad = function (nb) { var scratchpad = this; this.notebook = nb; this.kernel = nb.kernel; this.km = nb.keyboard_manager; this.collapsed = true; // create elements this.element = $("<div id='nbextension-scratchpad'>"); this.close_button = $("<i>").addClass("fa fa-caret-square-o-down scratchpad-btn scratchpad-close"); this.open_button = $("<i>").addClass("fa fa-caret-square-o-up scratchpad-btn scratchpad-open"); this.element.append(this.close_button); this.element.append(this.open_button); this.open_button.click(function () { scratchpad.expand(); }); this.close_button.click(function () { scratchpad.collapse(); }); // create my cell var cell = this.cell = new CodeCell(nb.kernel, { events: nb.events, config: nb.config, keyboard_manager: nb.keyboard_manager, notebook: nb, tooltip: nb.tooltip, }); cell.set_input_prompt(); this.element.append($("<div/>").addClass('cell-wrapper').append(this.cell.element)); cell.render(); cell.refresh(); this.collapse(); // override ctrl/shift-enter to execute me if I'm focused instead of the notebook's cell var execute_and_select_action = this.km.actions.register({ handler: $.proxy(this.execute_and_select_event, this), }, 'scratchpad-execute-and-select'); var execute_action = this.km.actions.register({ handler: $.proxy(this.execute_event, this), }, 'scratchpad-execute'); var toggle_action = this.km.actions.register({ handler: $.proxy(this.toggle, this), }, 'scratchpad-toggle'); var shortcuts = { 'shift-enter': execute_and_select_action, 'ctrl-enter': execute_action, 'ctrl-b': toggle_action, } this.km.edit_shortcuts.add_shortcuts(shortcuts); this.km.command_shortcuts.add_shortcuts(shortcuts); // finally, add me to the page $("body").append(this.element); }; Scratchpad.prototype.toggle = function () { if (this.collapsed) { this.expand(); } else { this.collapse(); } return false; }; Scratchpad.prototype.expand = function () { this.collapsed = false; var site_height = $("#site").height(); this.element.animate({ height: site_height, }, 200); this.open_button.hide(); this.close_button.show(); this.cell.element.show(); this.cell.focus_editor(); //$("#notebook-container").css('margin-left', 0); }; Scratchpad.prototype.collapse = function () { this.collapsed = true; //$("#notebook-container").css('margin-left', 'auto'); this.element.animate({ height: 0, }, 100); this.close_button.hide(); this.open_button.show(); this.cell.element.hide(); }; Scratchpad.prototype.execute_and_select_event = function (evt) { if (utils.is_focused(this.element)) { this.cell.execute(); } else { this.notebook.execute_cell_and_select_below(); } }; Scratchpad.prototype.execute_event = function (evt) { if (utils.is_focused(this.element)) { this.cell.execute(); } else { this.notebook.execute_selected_cells(); } }; function setup_scratchpad () { // lazy, hook it up to Jupyter.notebook as the handle on all the singletons console.log("Setting up scratchpad"); return new Scratchpad(Jupyter.notebook); } function load_extension () { // add css var link = document.createElement("link"); link.type = "text/css"; link.rel = "stylesheet"; link.href = requirejs.toUrl("./scratchpad.css"); document.getElementsByTagName("head")[0].appendChild(link); // load when the kernel's ready if (Jupyter.notebook.kernel) { setup_scratchpad(); } else { events.on('kernel_ready.Kernel', setup_scratchpad); } } return { load_ipython_extension: load_extension, }; });
import { TempNode } from '../core/TempNode.js'; import { FunctionNode } from '../core/FunctionNode.js'; import { UVNode } from '../accessors/UVNode.js'; class CheckerNode extends TempNode { constructor( uv ) { super( 'f' ); this.uv = uv || new UVNode(); } generate( builder, output ) { const snoise = builder.include( CheckerNode.Nodes.checker ); return builder.format( snoise + '( ' + this.uv.build( builder, 'v2' ) + ' )', this.getType( builder ), output ); } copy( source ) { super.copy( source ); this.uv = source.uv; return this; } toJSON( meta ) { let data = this.getJSONNode( meta ); if ( ! data ) { data = this.createJSONNode( meta ); data.uv = this.uv.toJSON( meta ).uuid; } return data; } } CheckerNode.Nodes = ( function () { // https://github.com/mattdesl/glsl-checker/blob/master/index.glsl const checker = new FunctionNode( /* glsl */` float checker( vec2 uv ) { float cx = floor( uv.x ); float cy = floor( uv.y ); float result = mod( cx + cy, 2.0 ); return sign( result ); }` ); return { checker: checker }; } )(); CheckerNode.prototype.nodeType = 'Noise'; export { CheckerNode };
/** * Lo-Dash 2.4.1 (Custom Build) <http://lodash.com/> * Build: `lodash modularize modern exports="amd" -o ./modern/` * Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/> * Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE> * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license <http://lodash.com/license> */ define(['../functions/createCallback', '../utilities/identity'], function(createCallback, identity) { /** * Uses a binary search to determine the smallest index at which a value * should be inserted into a given sorted array in order to maintain the sort * order of the array. If a callback is provided it will be executed for * `value` and each element of `array` to compute their sort ranking. The * callback is bound to `thisArg` and invoked with one argument; (value). * * If a property name is provided for `callback` the created "_.pluck" style * callback will return the property value of the given element. * * If an object is provided for `callback` the created "_.where" style callback * will return `true` for elements that have the properties of the given object, * else `false`. * * @static * @memberOf _ * @category Arrays * @param {Array} array The array to inspect. * @param {*} value The value to evaluate. * @param {Function|Object|string} [callback=identity] The function called * per iteration. If a property name or object is provided it will be used * to create a "_.pluck" or "_.where" style callback, respectively. * @param {*} [thisArg] The `this` binding of `callback`. * @returns {number} Returns the index at which `value` should be inserted * into `array`. * @example * * _.sortedIndex([20, 30, 50], 40); * // => 2 * * // using "_.pluck" callback shorthand * _.sortedIndex([{ 'x': 20 }, { 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x'); * // => 2 * * var dict = { * 'wordToNumber': { 'twenty': 20, 'thirty': 30, 'fourty': 40, 'fifty': 50 } * }; * * _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) { * return dict.wordToNumber[word]; * }); * // => 2 * * _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) { * return this.wordToNumber[word]; * }, dict); * // => 2 */ function sortedIndex(array, value, callback, thisArg) { var low = 0, high = array ? array.length : low; // explicitly reference `identity` for better inlining in Firefox callback = callback ? createCallback(callback, thisArg, 1) : identity; value = callback(value); while (low < high) { var mid = (low + high) >>> 1; (callback(array[mid]) < value) ? low = mid + 1 : high = mid; } return low; } return sortedIndex; });
PANDA.models.RelatedUpload = Backbone.Model.extend({ /* Equivalent of panda.models.RelatedUpload. */ urlRoot: PANDA.API + "/upload" }); PANDA.collections.RelatedUploads = Backbone.Collection.extend({ /* A collection of panda.models.RelatedUpload equivalents. */ model: PANDA.models.RelatedUpload, urlRoot: PANDA.API + "/related_upload" });
import { dateTickFormat, initDateFormats } from '~/lib/utils/tick_formats'; import { setLanguage } from '../../helpers/locale_helper'; describe('tick formats', () => { describe('dateTickFormat', () => { beforeAll(() => { setLanguage('de'); initDateFormats(); }); afterAll(() => { setLanguage(null); }); it('returns year for first of January', () => { const tick = dateTickFormat(new Date('2001-01-01')); expect(tick).toBe('2001'); }); it('returns month for first of February', () => { const tick = dateTickFormat(new Date('2001-02-01')); expect(tick).toBe('Februar'); }); it('returns day and month for second of February', () => { const tick = dateTickFormat(new Date('2001-02-02')); expect(tick).toBe('2. Feb.'); }); it('ignores time', () => { const tick = dateTickFormat(new Date('2001-02-02 12:34:56')); expect(tick).toBe('2. Feb.'); }); }); });
'use strict'; /** * @typedef {import('../lib/types').XastElement} XastElement * @typedef {import('../lib/types').XastParent} XastParent * @typedef {import('../lib/types').XastNode} XastNode */ const JSAPI = require('../lib/svgo/jsAPI.js'); exports.type = 'visitor'; exports.name = 'reusePaths'; exports.active = false; exports.description = 'Finds <path> elements with the same d, fill, and ' + 'stroke, and converts them to <use> elements ' + 'referencing a single <path> def.'; /** * Finds <path> elements with the same d, fill, and stroke, and converts them to * <use> elements referencing a single <path> def. * * @author Jacob Howcroft * * @type {import('../lib/types').Plugin<void>} */ exports.fn = () => { /** * @type {Map<string, Array<XastElement>>} */ const paths = new Map(); return { element: { enter: (node) => { if (node.name === 'path' && node.attributes.d != null) { const d = node.attributes.d; const fill = node.attributes.fill || ''; const stroke = node.attributes.stroke || ''; const key = d + ';s:' + stroke + ';f:' + fill; let list = paths.get(key); if (list == null) { list = []; paths.set(key, list); } list.push(node); } }, exit: (node, parentNode) => { if (node.name === 'svg' && parentNode.type === 'root') { /** * @type {XastElement} */ const rawDefs = { type: 'element', name: 'defs', attributes: {}, children: [], }; /** * @type {XastElement} */ const defsTag = new JSAPI(rawDefs, node); let index = 0; for (const list of paths.values()) { if (list.length > 1) { // add reusable path to defs /** * @type {XastElement} */ const rawPath = { type: 'element', name: 'path', attributes: { ...list[0].attributes }, children: [], }; delete rawPath.attributes.transform; let id; if (rawPath.attributes.id == null) { id = 'reuse-' + index; index += 1; rawPath.attributes.id = id; } else { id = rawPath.attributes.id; delete list[0].attributes.id; } /** * @type {XastElement} */ const reusablePath = new JSAPI(rawPath, defsTag); defsTag.children.push(reusablePath); // convert paths to <use> for (const pathNode of list) { pathNode.name = 'use'; pathNode.attributes['xlink:href'] = '#' + id; delete pathNode.attributes.d; delete pathNode.attributes.stroke; delete pathNode.attributes.fill; } } } if (defsTag.children.length !== 0) { if (node.attributes['xmlns:xlink'] == null) { node.attributes['xmlns:xlink'] = 'http://www.w3.org/1999/xlink'; } node.children.unshift(defsTag); } } }, }, }; };
var http = require('http'), httpProxy = require('http-proxy'); // Create a proxy server with custom application logic var proxy = httpProxy.createProxyServer({}); proxy.on('error', function (err, req, res) { res.writeHead(500, { 'Content-Type': 'text/plain' }); res.end(err); }); // If "-pm" is at the end of the app/domain name, or PM_URL matches the route, // proxy to the Process Manager. Otherwise, proxy to the application itself var server = http.createServer(function(req, res) { if (req.headers.host.indexOf('-pm.') != -1){ proxy.web(req, res, { target: 'http://127.0.0.1:8701' }); } // specify something like myapp-pm.mybluemix.net else if (req.headers.host.indexOf(process.env.PM_URL) != -1){ proxy.web(req, res, { target: 'http://127.0.0.1:8701' }); } else { proxy.web(req, res, { target: 'http://127.0.0.1:3001' }); } }); console.log("listening on port " + process.env.PORT) server.listen(process.env.PORT);
version https://git-lfs.github.com/spec/v1 oid sha256:37458aa009289b4e322bdafbe4cf377fe339d7935c23e14bbbac5cc19e1ac4b0 size 150033
define(["pex/sys/Platform"], function(Platform) { function Test() { } if (Platform.isPlask) Test.msg = "Hello Node!"; if (Platform.isBrowser) Test.msg = "Hello World Wide Web!"; if (Platform.isEjecta) Test.msg = "Hello iOS!"; return Test; });
/* */ "format cjs"; "use strict"; exports.__esModule = true; exports.CallExpression = CallExpression; exports.ModuleDeclaration = ModuleDeclaration; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj["default"] = obj; return newObj; } } var _messages = require("../../../messages"); var messages = _interopRequireWildcard(_messages); var _types = require("../../../types"); var t = _interopRequireWildcard(_types); // check if the input Literal `source` is an alternate casing of "react" function check(source, file) { if (t.isLiteral(source)) { var name = source.value; var lower = name.toLowerCase(); if (lower === "react" && name !== lower) { throw file.errorWithNode(source, messages.get("didYouMean", "react")); } } } function CallExpression(node, parent, scope, file) { if (this.get("callee").isIdentifier({ name: "require" }) && node.arguments.length === 1) { check(node.arguments[0], file); } } function ModuleDeclaration(node, parent, scope, file) { check(node.source, file); }
wn.provide("wn.model"); $.extend(wn.model, { new_names: {}, new_name_count: {}, get_new_doc: function(doctype) { wn.provide("locals." + doctype); var doc = { docstatus: 0, doctype: doctype, name: wn.model.get_new_name(doctype), __islocal: 1, owner: user }; wn.model.set_default_values(doc); locals[doctype][doc.name] = doc; return doc; }, make_new_doc_and_get_name: function(doctype) { return wn.model.get_new_doc(doctype).name; }, get_new_name: function(doctype) { var cnt = wn.model.new_name_count if(!cnt[doctype]) cnt[doctype] = 0; cnt[doctype]++; return 'New '+ doctype + ' ' + cnt[doctype]; }, set_default_values: function(doc) { var doctype = doc.doctype; var docfields = wn.meta.docfield_list[doctype] || []; var updated = []; for(var fid=0;fid<docfields.length;fid++) { var f = docfields[fid]; if(!in_list(no_value_fields, f.fieldtype) && doc[f.fieldname]==null) { var v = wn.model.get_default_value(f, doc); if(v) { if(in_list(["Int", "Check"], f.fieldtype)) v = cint(v); else if(in_list(["Currency", "Float"], f.fieldtype)) v = flt(v); doc[f.fieldname] = v; updated.push(f.fieldname); } } } return updated; }, get_default_value: function(df, doc) { var def_vals = { "_Login": user, "__user": user, "Today": dateutil.get_today(), "__today": dateutil.get_today(), "Now": dateutil.get_cur_time() } if(def_vals[df["default"]]) return def_vals[df["default"]]; else if(df.fieldtype=="Time" && (!df["default"])) return dateutil.get_cur_time() else if(df["default"] && df["default"][0]!==":") return df["default"]; else if(wn.defaults.get_user_default(df.fieldname)) return wn.defaults.get_user_default(df.fieldname); else if(df["default"] && df["default"][0]===":") return wn.model.get_default_from_boot_docs(df, doc); }, get_default_from_boot_docs: function(df, doc) { // set default from partial docs passed during boot like ":Profile" if(wn.model.get(df["default"]).length > 0) { var ref_fieldname = df["default"].slice(1).toLowerCase().replace(" ", "_"); var ref_value = (doc && doc[ref_fieldname]) || (cur_frm && cur_frm.doc[ref_fieldname]); var ref_doc = ref_value ? wn.model.get_doc(df["default"], ref_value) : null; if(ref_doc && ref_doc[df.fieldname]) { return ref_doc[df.fieldname]; } } }, add_child: function(doc, childtype, parentfield) { // create row doc var d = wn.model.get_new_doc(childtype); $.extend(d, { parent: doc.name, parentfield: parentfield, parenttype: doc.doctype, idx: getchildren(childtype, d.parent, d.parentfield, d.parenttype).length }); return d; }, copy_doc: function(dt, dn, from_amend) { var no_copy_list = ['name','amended_from','amendment_date','cancel_reason']; var newdoc = wn.model.get_new_doc(dt); for(var key in locals[dt][dn]) { // dont copy name and blank fields var df = wn.meta.get_docfield(dt, key); if(key.substr(0,2)!='__' && !in_list(no_copy_list, key) && !(df && (!from_amend && cint(df.no_copy)==1))) { newdoc[key] = locals[dt][dn][key]; } } return newdoc; }, })
// route.delete.config.js const RouteConfig = { action: 'delete' , method: 'delete' , url: '/:id' , callback: '' }; module.exports = RouteConfig;