text
stringlengths
2
6.14k
export { default } from './FilterForm';
import styled, { css } from 'react-emotion'; import theme from './theme'; export const title = css` color: white; font-family: Pacifico, cursive; font-size: 2rem; text-align: center; `; const Navbar = styled.nav` background: ${theme.colors.secondaryColor}; width: 100%; top: 0; padding: 1rem; position: fixed; z-index: 5; `; export default Navbar;
'use strict'; import _ from 'lodash'; const angular = require('angular'); module.exports = angular.module('spinnaker.deck.projects.dashboard.regionFilter.service', [ require('../../../filterModel/filter.model.service.js'), ]) .factory('regionFilterService', function (filterModelService) { let callbacks = []; let filterModelConfig = [{ model: 'region', param: 'reg', type: 'trueKeyObject' }]; filterModelService.configureFilterModel(this, filterModelConfig); this.registerCallback = (cb) => callbacks.push(cb); this.deregisterCallback = (cb) => callbacks = _.without(callbacks, cb); this.runCallbacks = () => callbacks.forEach(cb => cb(this.sortFilter.region)); this.toggleRegion = (region) => { let path = `sortFilter.region[${region}]`; _.set(this, path, !_.get(this, path)); this.applyParamsToUrl(); this.runCallbacks(); }; this.clearFilter = () => { _.forEach(this.sortFilter.region, (val, key) => delete this.sortFilter.region[key]); this.applyParamsToUrl(); this.runCallbacks(); }; this.activate(); return this; });
/* monitor.js : js specific to monitor app */ /* we do not want this on CDN */ /* declare required namespaces */ webgloo = window.webgloo || {}; webgloo.sc = webgloo.sc || {}; webgloo.sc.item = webgloo.sc.item || {}; webgloo.sc.item.addAdminActions = function() { //feature posts $("a.feature-post").click(function(event){ event.preventDefault(); var dataObj = {} ; dataObj.params = {} ; dataObj.params.postId = $(this).attr("id"); dataObj.params.action = "ADD" ; dataObj.endPoint = "/monitor/action/item/tag.php"; //open popup webgloo.sc.SimplePopup.init(); webgloo.sc.SimplePopup.post(dataObj,{ dataType : "json", reload : false, onSuccess : function () { $("#fps-" + dataObj.params.postId).html('<span class="badge badge-warning">F</span>'); } }); }) ; //unfeature posts $("a.unfeature-post").click(function(event){ event.preventDefault(); var dataObj = {} ; dataObj.params = {} ; dataObj.params.postId = $(this).attr("id"); dataObj.params.action = "REMOVE" ; dataObj.endPoint = "/monitor/action/item/tag.php"; //open popup webgloo.sc.SimplePopup.init(); webgloo.sc.SimplePopup.post(dataObj,{ "dataType" : "json", "reload" : false, onSuccess : function () { $("#fps-" + dataObj.params.postId).html(""); } }); }) ; //unfeature posts $("a.ban-user").click(function(event){ event.preventDefault(); var dataObj = {} ; dataObj.params = {} ; dataObj.params.loginId = $(this).attr("id"); dataObj.params.action = "BAN" ; dataObj.endPoint = "/monitor/action/user/tag.php"; //open popup webgloo.sc.SimplePopup.init(); webgloo.sc.SimplePopup.post(dataObj,{ "dataType" : "json", "reload" : true }); }) ; //unfeature posts $("a.unban-user").click(function(event){ event.preventDefault(); var dataObj = {} ; dataObj.params = {} ; dataObj.params.loginId = $(this).attr("id"); dataObj.params.action = "UNBAN" ; dataObj.endPoint = "/monitor/action/user/tag.php"; //open popup webgloo.sc.SimplePopup.init(); webgloo.sc.SimplePopup.post(dataObj,{ "dataType" : "json", "reload" : true }); }) ; //unfeature posts $("a.taint-user").click(function(event){ event.preventDefault(); var dataObj = {} ; dataObj.params = {} ; dataObj.params.userId = $(this).attr("id"); dataObj.params.action = "TAINT" ; dataObj.endPoint = "/monitor/action/user/tag.php"; //open popup webgloo.sc.SimplePopup.init(); webgloo.sc.SimplePopup.post(dataObj,{ "dataType" : "json", "reload" : true }); }) ; }
const CollateralToken = artifacts.require('CollateralToken'); // basic tests to ensure collateral token works and is set up to allow trading contract('CollateralToken', function(accounts) { let initBalance; let collateralToken; // test setup of token for collateral it('Initial supply should be 1e+22', async function() { collateralToken = await CollateralToken.deployed(); initBalance = await collateralToken.totalSupply(); assert.equal(initBalance, 1e22, 'Initial balance not as expected'); }); it('Main account should have entire balance', async function() { const mainAcctBalance = await collateralToken.balanceOf.call(accounts[0]); assert.isTrue( mainAcctBalance.eq(initBalance), 'Entire coin balance should be in primary account' ); }); it('Main account should be able to transfer balance', async function() { const balanceToTransfer = initBalance / 2; await collateralToken.transfer(accounts[1], balanceToTransfer, { from: accounts[0] }); const secondAcctBalance = await collateralToken.balanceOf.call(accounts[1]); assert.isTrue(secondAcctBalance.eq(balanceToTransfer), "Transfer didn't register correctly"); }); });
import angular from 'angular'; import uiRouter from 'angular-ui-router'; import divtableComponent from './divtable.component'; let divtableModule = angular.module('divtable', [ uiRouter ]) .config(($stateProvider) => { "ngInject"; $stateProvider .state('divtable', { url: '/divtable', component: 'divtable' }); }) .component('divtable', divtableComponent) .name; export default divtableModule;
/* @flow */ import { type ZalgoPromise } from 'zalgo-promise/src'; import { componentTemplate } from '../../../src/button/template'; import { getElement, getElements, errorOnWindowOpen } from '../../tests/common'; let { action, flow = 'popup', authed = false, bridge = false, delay = 0, onRender, checkout, selector, remembered } = window.xprops.test; let button = componentTemplate({ props: window.xprops }); if (document.body) { document.body.innerHTML = button; } if (flow === 'iframe') { window.paypal.Checkout.contexts.iframe = true; } if (bridge) { errorOnWindowOpen(); delay = 100; } function renderCheckout(props = {}) { window.paypal.Checkout.renderTo(window.xchild.getParentRenderWindow(), { payment: window.xprops.payment, onAuthorize(data, actions) : void | ZalgoPromise<void> { return window.xprops.onAuthorize({ ...data, payment: {} }, { ...actions, payment: { execute() { // pass }, get() : Object { return {}; } }, restart() { window.paypal.Checkout.contexts.iframe = true; renderCheckout(); } }).catch(err => { return window.xchild.error(err); }); }, onAuth() { // pass }, style: { overlayColor: window.xprops.style.overlayColor }, onCancel: window.xprops.onCancel, onError: window.xprops.onError, commit: window.xprops.commit, locale: window.xprops.locale, test: { action: action || 'checkout', ...checkout }, ...props }); } getElements('.paypal-button', document).forEach(el => { el.addEventListener('click', () => { if (window.xprops.onClick) { window.xprops.onClick(); } renderCheckout({ fundingSource: el.getAttribute('data-funding-source') }); }); }); if (action === 'auth') { if (authed && window.xprops.onAuth) { window.xprops.onAuth(); } } else if (action === 'remember') { window.xprops.funding.remember([ remembered ]); } else if (action === 'checkout' || action === 'cancel' || action === 'fallback' || action === 'error' || action === 'popout') { if (delay) { setTimeout(() => { getElement(selector || '.paypal-button', document).click(); }, delay); } else { getElement(selector || '.paypal-button', document).click(); } } if (onRender) { onRender({ fundingSources: Array.from(new Set(getElements('[data-funding-source]').map(el => el.getAttribute('data-funding-source')))), click() { getElement('.paypal-button', document).click(); } }); }
function initTree(treeData, treeDiv) { document.getElementById(treeDiv).innerHTML = ""; // ************** Generate the tree diagram ***************** var margin = { top: 20, right: 120, bottom: 20, left: 120 }, width = 1800 - margin.right - margin.left, height = 500 - margin.top - margin.bottom; var i = 0, duration = 750, root; var tree = d3.layout.tree() .size([height, width]); var diagonal = d3.svg.diagonal() .projection(function(d) { return [d.y, d.x]; }); var svg = d3.select("#"+treeDiv).append("svg") .attr("width", width + margin.right + margin.left) .attr("height", height + margin.top + margin.bottom) .append("g") .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); root = treeData; root.x0 = height / 2; root.y0 = 0; update(root); d3.select(self.frameElement).style("height", "500px"); function update(source) { // Compute the new tree layout. var nodes = tree.nodes(root).reverse(), links = tree.links(nodes); // Normalize for fixed-depth. nodes.forEach(function(d) { d.y = d.depth * 180; }); // Update the nodes… var node = svg.selectAll("g.node") .data(nodes, function(d) { return d.id || (d.id = ++i); }); // Enter any new nodes at the parent's previous position. var nodeEnter = node.enter().append("g") .attr("class", "node") .attr("transform", function(d) { return "translate(" + source.y0 + "," + source.x0 + ")"; }) .on("click", click); nodeEnter.append("circle") .attr("r", 1e-6) .style("fill", function(d) { return d._children ? "lightsteelblue" : "#fff"; }); nodeEnter.append("text") .attr("x", function(d) { return d.children || d._children ? -13 : 13; }) .attr("dy", ".35em") .attr("text-anchor", function(d) { return d.children || d._children ? "end" : "start"; }) .text(function(d) { return d.name; }) .style("fill-opacity", 1e-6); // Transition nodes to their new position. var nodeUpdate = node.transition() .duration(duration) .attr("transform", function(d) { return "translate(" + d.y + "," + d.x + ")"; }); nodeUpdate.select("circle") .attr("r", 10) .style("fill", function(d) { return d._children ? "lightsteelblue" : "#fff"; }); nodeUpdate.select("text") .style("fill-opacity", 1); // Transition exiting nodes to the parent's new position. var nodeExit = node.exit().transition() .duration(duration) .attr("transform", function(d) { return "translate(" + source.y + "," + source.x + ")"; }) .remove(); nodeExit.select("circle") .attr("r", 1e-6); nodeExit.select("text") .style("fill-opacity", 1e-6); // Update the links… var link = svg.selectAll("path.link") .data(links, function(d) { return d.target.id; }); // Enter any new links at the parent's previous position. link.enter().insert("path", "g") .attr("class", "link") .attr("d", function(d) { var o = { x: source.x0, y: source.y0 }; return diagonal({ source: o, target: o }); }); // Transition links to their new position. link.transition() .duration(duration) .attr("d", diagonal); // Transition exiting nodes to the parent's new position. link.exit().transition() .duration(duration) .attr("d", function(d) { var o = { x: source.x, y: source.y }; return diagonal({ source: o, target: o }); }) .remove(); // Stash the old positions for transition. nodes.forEach(function(d) { d.x0 = d.x; d.y0 = d.y; }); } // Toggle children on click. function click(d) { if (d.children) { d._children = d.children; d.children = null; } else { d.children = d._children; d._children = null; } update(d); } }
// Copyright 2011 Traceur 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. suite('parser.js', function() { var errorReporter = { reportError: function(position, message) { throw new chai.AssertionError({message: message + ', ' + position}); } }; teardown(function() { traceur.options.reset(); }); test('Module', function() { var program = 'export var x = 42;\n' + 'import * as M from \'url\';\n' + 'import {z} from \'x\';\n' + 'import {a as b, c} from \'M\';\n'; var sourceFile = new traceur.syntax.SourceFile('Name', program); var parser = new traceur.syntax.Parser(sourceFile, errorReporter); parser.parseModule(); }); test('handleComment', function() { traceur.options.commentCallback = true; var program = '// AAA\n' + 'var b = \'c\';\n' + '/* DDD */ function e() {}\n'; var sourceFile = new traceur.syntax.SourceFile('Name', program); var parser = new traceur.syntax.Parser(sourceFile, errorReporter); var comments = []; parser.handleComment = function(sourceRange) { comments.push(sourceRange); }; parser.parseScript(); assert.equal(comments.length, 2); assert.equal(comments[0].start.offset, 0); assert.equal(comments[0].end.offset, 7); assert.equal(comments[0].toString(), '// AAA\n'); assert.equal(comments[1].start.line, 2); assert.equal(comments[1].start.column, 0); assert.equal(comments[1].end.line, 2); assert.equal(comments[1].end.column, 9); assert.equal(comments[1].toString(), '/* DDD */'); }); });
/** * Copyright 2016 Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ const Auditor = require('../core'); const assert = require('assert'); /* global describe, it*/ describe('Core', () => { it('maps all audits to an array of Promises', () => { return Auditor .audit([{}], ['is-on-https']) .then(modifiedResults => { assert.ok(Array.isArray(modifiedResults)); assert.equal(modifiedResults.length, 1); }); }); });
//This script is to delete a resource within the node var deleteFile = exports; deleteFile.handle = function(req, res, pathInfo, resource) { const filename = pathInfo.parameters.name || pathInfo.parameters.filename; if (filename == undefined) { res.writeHead(500, {"Content-Type": "text/plain; charset=utf-8"}); res.write("The url-parameter [name] is not set. This parameter defines the filename within the selected resource."); res.end(); } else if (!resource.isAuthorized("delete")) { res.writeHead(401, {"Content-Type": "text/plain; charset=utf-8"}); res.write("User is not authorized to delete here files and resources."); res.end(); } else { resource.fileExists(filename).then(function() { return resource.deleteFile(filename); }).then(function() { return resource.getFiles(true); }).then(function(fileList){ res.writeHead(200, {"Content-Type": "application/json; charset=utf-8"}); res.write(JSON.stringify(fileList)); res.end(); }).fail(function() { res.writeHead(500, {"Content-Type": "text/plain; charset=utf-8"}); res.write("The resource [" + filename + "] does not exists within [" + resource.path + "]"); res.end(); }); } };
import { assertIsNotNullOrUndefined } from "../../utils/contracts"; import { isNullOrUndefined } from "../../utils/checks"; import { UNDEFINED } from "../../types/primitive-type"; import { toString } from "../../utils/native"; import { exhaust as x } from "../../utils/async"; import { getMethod } from "../../utils/helpers"; export default function ($target, env, factory) { $target.define("replace", factory.createBuiltInFunction(function* (regexOrSubstr, substrOrFn) { assertIsNotNullOrUndefined(this.object, "String.prototype.replace"); let replaceKey = env.getSymbol("replace"); if (replaceKey && !isNullOrUndefined(regexOrSubstr)) { let replaceMethod = getMethod(regexOrSubstr, replaceKey); if (replaceMethod) { return yield replaceMethod.call(regexOrSubstr, [this.object, substrOrFn]); } } let stringValue = yield toString(this.object); let matcher; if (regexOrSubstr && regexOrSubstr.className === "RegExp") { matcher = regexOrSubstr.source; } else { matcher = yield toString(regexOrSubstr); } let replacer; if (substrOrFn && substrOrFn.type === "function") { replacer = function (...args) { let thisArg = substrOrFn.isStrict() || substrOrFn.isStrict() ? UNDEFINED : env.global; let mappedArgs = args.map(arg => factory.createPrimitive(arg)); let replacedValue = x(substrOrFn.call(thisArg, mappedArgs)); return replacedValue ? x(toString(replacedValue)) : undefined; }; } else { replacer = yield toString(substrOrFn); } return factory.create("String", stringValue.replace(matcher, replacer)); }, 2, "String.prototype.replace")); }
/** * @author alteredq / http://alteredqualia.com/ * @author mrdoob / http://mrdoob.com/ * @author WestLangley / http://github.com/WestLangley */ import { Vector3 } from '../math/Vector3.js'; import { Object3D } from '../core/Object3D.js'; import { Line } from '../objects/Line.js'; import { Float32BufferAttribute } from '../core/BufferAttribute.js'; import { BufferGeometry } from '../core/BufferGeometry.js'; import { LineBasicMaterial } from '../materials/LineBasicMaterial.js'; const _v1 = new Vector3(); const _v2 = new Vector3(); const _v3 = new Vector3(); function DirectionalLightHelper( light, size, color ) { Object3D.call( this ); this.light = light; this.light.updateMatrixWorld(); this.matrix = light.matrixWorld; this.matrixAutoUpdate = false; this.color = color; if ( size === undefined ) size = 1; let geometry = new BufferGeometry(); geometry.setAttribute( 'position', new Float32BufferAttribute( [ - size, size, 0, size, size, 0, size, - size, 0, - size, - size, 0, - size, size, 0 ], 3 ) ); const material = new LineBasicMaterial( { fog: false, toneMapped: false } ); this.lightPlane = new Line( geometry, material ); this.add( this.lightPlane ); geometry = new BufferGeometry(); geometry.setAttribute( 'position', new Float32BufferAttribute( [ 0, 0, 0, 0, 0, 1 ], 3 ) ); this.targetLine = new Line( geometry, material ); this.add( this.targetLine ); this.update(); } DirectionalLightHelper.prototype = Object.create( Object3D.prototype ); DirectionalLightHelper.prototype.constructor = DirectionalLightHelper; DirectionalLightHelper.prototype.dispose = function () { this.lightPlane.geometry.dispose(); this.lightPlane.material.dispose(); this.targetLine.geometry.dispose(); this.targetLine.material.dispose(); }; DirectionalLightHelper.prototype.update = function () { _v1.setFromMatrixPosition( this.light.matrixWorld ); _v2.setFromMatrixPosition( this.light.target.matrixWorld ); _v3.subVectors( _v2, _v1 ); this.lightPlane.lookAt( _v2 ); if ( this.color !== undefined ) { this.lightPlane.material.color.set( this.color ); this.targetLine.material.color.set( this.color ); } else { this.lightPlane.material.color.copy( this.light.color ); this.targetLine.material.color.copy( this.light.color ); } this.targetLine.lookAt( _v2 ); this.targetLine.scale.z = _v3.length(); }; export { DirectionalLightHelper };
//// [callOnClass.js] var C = (function () { function C() { } return C; })(); var c = C();
'use strict'; const _ = require('lodash'); const Promise = require('bluebird'); const errors = require('../errors'); const Timeout = errors.Timeout; class RetryOperation { constructor(options) { _.assign(this, { maxAttempts: 10, timeout: Infinity, factor: 2, minDelay: 1174, // last attempt after 10 min maxDelay: Infinity }, options); } predicate(err) { /* jshint unused:false */ return true; } backoff(tries) { if (tries > 0) { return Math.min(this.minDelay * Math.pow(this.factor, tries - 1), this.maxDelay); } return 0; } retry(fn) { const self = this; const retryStart = Date.now(); let tries = 0; function attempt() { const attemptStart = Date.now(); return Promise .try(() => { return fn(tries); }) .catch(self.predicate, (err) => { const now = Date.now(); const delay = Math.max(self.backoff(++tries) - (now - attemptStart), 0); const time = now + delay - retryStart; if (tries >= self.maxAttempts) { return Promise.reject(Timeout.toManyAttempts(tries, err)); } if (time >= self.timeout) { return Promise.reject(Timeout.timedOut(time, err)); } if (delay > 0) { return Promise.delay(delay).then(attempt); } return attempt(); }); } return attempt(); } static create(options) { return new RetryOperation(options); } static retry(fn, options) { return RetryOperation.create(options).retry(fn); } } module.exports = RetryOperation;
/* Copyright JS Foundation and other contributors, http://js.foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ var console = { assert : assert }; class C1 { f () { return 5; } } class C2 extends C1 { f () { assert (super.f () === 5); class G { g () { assert (super.f === undefined); assert (super.toString () === "[object Object]"); var a = super.valueOf (); try { a (); assert (false); } catch (e) { assert (e instanceof TypeError); } } constructor () { // Test to overwrite the current lit-object console.assert (Object.getPrototypeOf (this) === G.prototype); try { eval ("super ()"); assert (false); } catch (e) { assert (e instanceof SyntaxError); } } } var g = new G (); g.g (); } } (new C2).f ();
'use strict'; app.config(function($stateProvider, $urlRouterProvider){ $urlRouterProvider.otherwise('/home'); $stateProvider.state('home',{ url:'/home', templateUrl:'./theme/partials/main.tpl.html', }); $stateProvider.state('post',{ url:'/post/:postName', templateUrl:'./theme/partials/post.tpl.html', controller:'postCtrl as post' }); $stateProvider.state('aboutus',{ url:'/about', templateUrl:'./theme/partials/aboutus.tpl.html', }); $stateProvider.state('contact',{ url:'/contact', templateUrl:'./theme/partials/contact.tpl.html', }); $stateProvider.state('blogPosts',{ url:'/posts', templateUrl:'./theme/partials/blog.tpl.html', controller:'postCtrl as post' }); }); app.directive('themeGoesHere',function(){ return { restrict: 'E', templateUrl: './theme/partials/structure.tpl.html', }; }); app.directive('home',function(){ return { restrict: 'E', templateUrl: './theme/partials/home.tpl.html' }; }); app.directive('aboutus',function(){ return { restrict: 'E', templateUrl: './theme/partials/aboutus.tpl.html' }; }); app.directive('contact',function(){ return { restrict: 'E', templateUrl: './theme/partials/contact.tpl.html' }; }); app.directive('blog',function(){ return { restrict: 'E', templateUrl: './theme/partials/blog.tpl.html' }; }); app.directive('plugins',function(){ return { restrict: 'E', templateUrl: './theme/partials/plugins.tpl.html' }; }); app.directive('pageFooter',function(){ return { restrict: 'E', templateUrl: './theme/partials/footer.tpl.html' }; }); app.directive('commentForm',function(){ return { restrict: 'E', templateUrl: './theme/partials/commentForm.tpl.html' }; }); app.directive('replies',function(){ return { restrict: 'E', templateUrl: './theme/partials/reply.tpl.html' }; }); app.directive('templatenav',function(){ return { restrict: 'E', templateUrl: './theme/partials/nav.tpl.html' }; }); app.directive('banner',function(){ return { restrict: 'E', templateUrl: './theme/partials/blogBanner.tpl.html' }; });
describe("domain landing page", () => { beforeEach(() => { cy.elektraLogin( Cypress.env("TEST_DOMAIN"), Cypress.env("TEST_USER"), Cypress.env("TEST_PASSWORD") ) }) it("open reverse lookup page and search for elektra test vm", () => { cy.visit(`/${Cypress.env("TEST_DOMAIN")}/lookup/reverselookup`) cy.contains('[data-test=page-title]','Find Project') cy.get('#reverseLookupValue').type('elektra-test-vm (do not delete){enter}') cy.contains('Could not load object (Request failed with status code 404)') cy.get('#reverseLookupValue').type('{selectall}df628236-e1a5-4dcd-9715-e204e184fe71{enter}') cy.contains('elektra-test-vm (do not delete)') }) })
const path = require("path"); module.exports = { includePaths: __dirname };
const showLoadingImage = require('../../../../../base/utility').showLoadingImage; const showLocalTimeOnHover = require('../../../../../base/clock').Clock.showLocalTimeOnHover; const localize = require('../../../../../base/localize').localize; const Button = require('../../../../../common_functions/attach_dom/button').Button; const FlexTableUI = require('../../../../../common_functions/attach_dom/flextable').FlexTableUI; const ConnectionsData = require('./connections.data').ConnectionsData; const ConnectionsUI = (function() { 'use strict'; const containerSelector = '#connections-ws-container'; const messages = { no_connect_list: 'You do not have any connection.', }; let flexTable; const formatConnect = function(connect) { return [ connect, '', // for the "Del Connection" button ]; }; const createDelButton = function(container, connect) { const $buttonSpan = Button.createBinaryStyledButton(); const $button = $buttonSpan.children('.button').first(); $button.text('Delete Connection'); $button.on('click', function() { if (window.confirm("Confirm: '" + connect + "'?")) { ConnectionsData.del(connect); container.css({ opacity: 0.5 }); } }); return $buttonSpan; }; const createTable = function(data) { if (flexTable) { return flexTable.replace(data); } const headers = ['Provider', 'Action']; const columns = ['provider', 'action']; flexTable = new FlexTableUI({ container: containerSelector, header : headers.map(function(s) { return localize(s); }), id : 'connections-table', cols : columns, data : data, style : function($row, connect) { $row.children('.action').first() .append(createDelButton($row, connect)); }, formatter: formatConnect, }); return showLocalTimeOnHover('td.last_used'); }; const update = function(connect_list) { $('#loading').remove(); createTable(connect_list); if (!connect_list.length) { flexTable.displayError(localize(messages.no_connect_list), 7); } }; const displayError = function(message) { $(containerSelector + ' .error-msg').text(message); }; const init = function() { showLoadingImage($('<div/>', { id: 'loading' }).insertAfter('#connections-title')); const $title = $('#connections-title').children().first(); const $desc = $('#description'); $title.text(localize($title.text())); $desc.text(localize($desc.text())); }; const clean = function() { $(containerSelector + ' .error-msg').text(''); flexTable.clear(); flexTable = null; }; return { init : init, clean : clean, update : update, displayError: displayError, }; })(); module.exports = { ConnectionsUI: ConnectionsUI, };
/* * Copyright (c) 2015-2016 Dilvan Moreira. * Copyright (c) 2015-2016 John Garavito. * * 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( factory ) { if ( typeof define === "function" && define.amd ) { define( ["jquery", "../jquery.validate"], factory ); } else if (typeof module === "object" && module.exports) { module.exports = factory( require( "jquery" ) ); } else { factory( jQuery ); } }(function( $ ) { /* * Translated default messages for the jQuery validation plugin. * Locale: CS (Czech; čeština, český jazyk) */ $.extend( $.validator.messages, { required: "Tento údaj je povinný.", remote: "Prosím, opravte tento údaj.", email: "Prosím, zadejte platný e-mail.", url: "Prosím, zadejte platné URL.", date: "Prosím, zadejte platné datum.", dateISO: "Prosím, zadejte platné datum (ISO).", number: "Prosím, zadejte číslo.", digits: "Prosím, zadávejte pouze číslice.", creditcard: "Prosím, zadejte číslo kreditní karty.", equalTo: "Prosím, zadejte znovu stejnou hodnotu.", extension: "Prosím, zadejte soubor se správnou příponou.", maxlength: $.validator.format( "Prosím, zadejte nejvíce {0} znaků." ), minlength: $.validator.format( "Prosím, zadejte nejméně {0} znaků." ), rangelength: $.validator.format( "Prosím, zadejte od {0} do {1} znaků." ), range: $.validator.format( "Prosím, zadejte hodnotu od {0} do {1}." ), max: $.validator.format( "Prosím, zadejte hodnotu menší nebo rovnu {0}." ), min: $.validator.format( "Prosím, zadejte hodnotu větší nebo rovnu {0}." ) } ); }));
"use strict"; var testing_1 = require('@angular/core/testing'); var login_component_1 = require('./login.component'); describe('LoginComponent', function () { var component; var fixture; beforeEach(testing_1.async(function () { testing_1.TestBed.configureTestingModule({ declarations: [login_component_1.LoginComponent] }) .compileComponents(); })); beforeEach(function () { fixture = testing_1.TestBed.createComponent(login_component_1.LoginComponent); component = fixture.componentInstance; fixture.detectChanges(); }); it('should create', function () { expect(component).toBeTruthy(); }); });
(function () { 'use strict'; angular .module('boardGamesApp') .factory('Register', Register); Register.$inject = ['$resource']; function Register ($resource) { return $resource('api/register', {}, {}); } })();
angular.module("admin-app").controller("CertificatesController", CertificatesController); CertificatesController.$inject = ['$scope', '$state', 'urls', 'HttpRequest', 'toastr', 'validators', 'SweetAlert']; function CertificatesController($scope, $state, urls, HttpRequest, toastr, validators, SweetAlert) { $scope.updateCertificate = updateCertificate; var url = urls.BASE_API + '/enrollments/certificates_requested'; var promise = HttpRequest.send("GET", url); promise.then(function (response) { $scope.enrollments = response; var $contenido = $('#contenido'); $contenido.addClass("loaded"); }, function(error){ toastr.error("Hubo un error"); }); function updateCertificate(enrollment) { SweetAlert.swal({ title: "Estás seguro?", text: "Esta acción es irreversible!", type: "warning", showCancelButton: true, cancelButtonClass: "button-ln", confirmButtonClass: "button-bg primary", confirmButtonText: "Si", cancelButtonText: "No", closeOnConfirm: false, closeOnCancel: false }, function(isConfirm) { if (isConfirm) { var url = urls.BASE_API + '/enrollments/' + enrollment.id + '/update_certificate'; var promise_delete = HttpRequest.send("PUT", url, enrollment); promise_delete.then(function(response) { SweetAlert.swal("Actualizado!", "Se actualizó el certificado correctamente", "success"); $state.reload(); }, function(error) { toastr.error("Hubo un error"); }); } else { SweetAlert.swal("Cancelado", "Se canceló la acción", "error"); } }); } }
/* * Copyright 2017 Vojtech Krizek, info@LLmaps.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. */ /* global $DM */ $DM.addTemplate('dm:data:processors:type_conversion', function (div, context) { var columnTemplate = null; var columnsDiv = null; var tmpl = {}; tmpl.onRender = function () { var entities = context.getAllEntities(); var dataTypes = div.find('select[data-id="data_types"]'); for (var i = 0; i < entities.types.length; i++) { var type = entities.types[i]; $('<option value=""></option>').attr('value', type.id).text(type.name).appendTo(dataTypes); } columnTemplate = div.find('div[data-id="column_template"]').remove(); columnsDiv = div.find('div[data-id="columns"]'); div.find('[data-id="add"]').click(function (evt) { evt.preventDefault(); var config = tmpl.getConfig(); log(config); config.columns.push({ name: '', dataType: '' }); log(config); tmpl.setConfig(config); }); }; tmpl.setConfig = function (config) { columnsDiv.empty(); for (var i = 0; i < config.columns.length; i++) { var col = columnTemplate.clone(); col.find('[data-id="column_name"]').val(config.columns[i].name); col.find('[data-id="data_types"]').val(config.columns[i].dataType); col.find('[data-id="remove"]').click(function (evt) { evt.preventDefault(); $(this).parent().remove(); }); col.appendTo(columnsDiv); } }; tmpl.getConfig = function () { var obj = { columns: [] }; columnsDiv.find('>div').each(function () { var col = $(this); var name = col.find('[data-id="column_name"]').val(); var dataType = col.find('[data-id="data_types"]').val(); if (name !== '' && dataType !== '') { obj.columns.push({ name: name, dataType: dataType }); } }); return obj; }; return tmpl; });
/** * @license Apache-2.0 * * Copyright (c) 2018 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ 'use strict'; // MODULES // var tape = require( 'tape' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var abs = require( '@stdlib/math/base/special/abs' ); var EPS = require( '@stdlib/constants/float64/eps' ); var factory = require( './../lib/factory.js' ); // FIXTURES // var decimalDecimal = require( './fixtures/julia/decimal_decimal.json' ); // TESTS // tape( 'main export is a function', function test( t ) { t.ok( true, __filename ); t.equal( typeof factory, 'function', 'main export is a function' ); t.end(); }); tape( 'the function returns a function', function test( t ) { var mgf = factory( 0.0, 1.0 ); t.equal( typeof mgf, 'function', 'returns a function' ); t.end(); }); tape( 'if provided `NaN` for any parameter, the created function returns `NaN`', function test( t ) { var mgf; var y; mgf = factory( 1.0 ); y = mgf( NaN ); t.equal( isnan( y ), true, 'returns NaN' ); mgf = factory( NaN ); y = mgf( 0.0 ); t.equal( isnan( y ), true, 'returns NaN' ); t.end(); }); tape( 'if provided a negative `k`, the created function always returns `NaN`', function test( t ) { var mgf; var y; mgf = factory( -1.0 ); y = mgf( 0.4 ); t.equal( isnan( y ), true, 'returns NaN' ); y = mgf( 0.0 ); t.equal( isnan( y ), true, 'returns NaN' ); t.end(); }); tape( 'if provided a `t >= 0.5`, the created function always returns `NaN`', function test( t ) { var mgf; var y; mgf = factory( 1.0 ); y = mgf( 0.5 ); t.equal( isnan( y ), true, 'returns NaN' ); y = mgf( 1.0 ); t.equal( isnan( y ), true, 'returns NaN' ); t.end(); }); tape( 'the created function evaluates the MGF for `x` given degrees of freedom `k`', function test( t ) { var expected; var delta; var mgf; var tol; var x; var k; var y; var i; expected = decimalDecimal.expected; x = decimalDecimal.x; k = decimalDecimal.k; for ( i = 0; i < x.length; i++ ) { mgf = factory( k[i] ); y = mgf( x[i] ); if ( y === expected[i] ) { t.equal( y, expected[i], 'x: '+x[i]+', k: '+k[i]+', y: '+y+', expected: '+expected[i] ); } else { delta = abs( y - expected[ i ] ); tol = EPS * abs( expected[ i ] ); t.ok( delta <= tol, 'within tolerance. x: '+x[ i ]+'. k: '+k[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' ); } } t.end(); });
import _ from 'lodash/fp'; import { findDOMNode } from 'react-dom'; export const unmountOnBlur = ({ componentDidMount() { const { toggleVisibility } = this.props; const componentDOMNode = findDOMNode(this); this._toggleVisibility = (e, ...restArgs) => { const isClickInsideComponent = componentDOMNode.contains(e.target); return isClickInsideComponent ? e.stopPropagation() : toggleVisibility(e, ...restArgs); }; if (_.isFunction(toggleVisibility)) document.addEventListener('click', this._toggleVisibility, false); }, componentWillUnmount() { if (_.isFunction(this._toggleVisibility)) document.removeEventListener('click', this._toggleVisibility, false); }, });
function clamp(val, min, max) { if (val > max) { return max; } if (val < min) { return min; } return val; } export class MazeCanvasRenderer { constructor(grid, colors) { this.grid = grid; this.colors = colors; } setDistanceGrid(distances, floorValue, fromColor, toColor) { this.distances = distances; this.floorValue = floorValue; this.fromColor = fromColor; this.toColor = toColor; this.distanceColors = [ this.buildColor(fromColor) ]; let len = distances.maxDistance + 1; let color = { r: fromColor.r, g: fromColor.g, b: fromColor.b }; let delta = { r: ((toColor.r - fromColor.r) / len), g: ((toColor.g - fromColor.g) / len), b: ((toColor.b - fromColor.b) / len) }; for (let i = 1; i < len; i++) { color.r = clamp( color.r + delta.r ); color.g = clamp( color.g + delta.g ); color.b = clamp( color.b + delta.b ); this.distanceColors.push( this.buildColor(color) ); } console.debug('distanceColors', this.distanceColors); } buildColor(color) { return `rgb(${color.r|0},${color.g|0},${color.b|0})`; } getColor(x, y) { let value = this.grid.get(x, y); let color; if (value === this.floorValue && this.distanceColors) { let distance = this.distances.getDistanceAt(x, y); if (typeof distance === 'undefined') { color = this.colors[this.floorValue]; } else { color = this.distanceColors[distance]; } //console.debug("distance:", distance, "cell:", cell, "color:", color); } else { color = this.colors[value]; } return color; } render(ctx) { let grid = this.grid; let last = null, color, x, y; for (y = 0; y < grid.height; y++) { for (x = 0; x < grid.width; x++) { color = this.getColor(x, y); //grid.get(x, y); if (color !== last) ctx.fillStyle = color; //this.colors[color]; last = color; ctx.fillRect(x, y, 1, 1); } } } }
// Generated by CoffeeScript 1.6.3 /* jQuery Growl Copyright 2013 Kevin Sylvestre 1.2.0 */ (function() { "use strict"; var $, Animation, Growl, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; $ = jQuery; Animation = (function() { function Animation() {} Animation.transitions = { "webkitTransition": "webkitTransitionEnd", "mozTransition": "mozTransitionEnd", "oTransition": "oTransitionEnd", "transition": "transitionend" }; Animation.transition = function($el) { var el, result, type, _ref; el = $el[0]; _ref = this.transitions; for (type in _ref) { result = _ref[type]; if (el.style[type] != null) { return result; } } }; return Animation; })(); Growl = (function() { Growl.settings = { namespace: 'growl', duration: 3200, close: "&#215;", location: "default", style: "default", size: "medium" }; Growl.growl = function(settings) { if (settings == null) { settings = {}; } this.initialize(); return new Growl(settings); }; Growl.initialize = function() { return $("body:not(:has(#growls))").append('<div id="growls" />'); }; function Growl(settings) { if (settings == null) { settings = {}; } this.html = __bind(this.html, this); this.$growl = __bind(this.$growl, this); this.$growls = __bind(this.$growls, this); this.animate = __bind(this.animate, this); this.remove = __bind(this.remove, this); this.dismiss = __bind(this.dismiss, this); this.present = __bind(this.present, this); this.cycle = __bind(this.cycle, this); this.close = __bind(this.close, this); this.unbind = __bind(this.unbind, this); this.bind = __bind(this.bind, this); this.render = __bind(this.render, this); this.settings = $.extend({}, Growl.settings, settings); this.$growls().attr('class', this.settings.location); this.render(); } Growl.prototype.render = function() { var $growl; $growl = this.$growl(); this.$growls().append($growl); if (this.settings["static"] != null) { this.present(); } else { this.cycle(); } }; Growl.prototype.bind = function($growl) { if ($growl == null) { $growl = this.$growl(); } return $growl.on("contextmenu", this.close).find("." + this.settings.namespace + "-close").on("click", this.close); }; Growl.prototype.unbind = function($growl) { if ($growl == null) { $growl = this.$growl(); } return $growl.off("contextmenu", this.close).find("." + (this.settings.namespace - close)).off("click", this.close); }; Growl.prototype.close = function(event) { var $growl; event.preventDefault(); event.stopPropagation(); $growl = this.$growl(); return $growl.stop().queue(this.dismiss).queue(this.remove); }; Growl.prototype.cycle = function() { var $growl; $growl = this.$growl(); return $growl.queue(this.present).delay(this.settings.duration).queue(this.dismiss).queue(this.remove); }; Growl.prototype.present = function(callback) { var $growl; $growl = this.$growl(); this.bind($growl); return this.animate($growl, "" + this.settings.namespace + "-incoming", 'out', callback); }; Growl.prototype.dismiss = function(callback) { var $growl; $growl = this.$growl(); this.unbind($growl); return this.animate($growl, "" + this.settings.namespace + "-outgoing", 'in', callback); }; Growl.prototype.remove = function(callback) { this.$growl().remove(); return callback(); }; Growl.prototype.animate = function($element, name, direction, callback) { var transition; if (direction == null) { direction = 'in'; } transition = Animation.transition($element); $element[direction === 'in' ? 'removeClass' : 'addClass'](name); $element.offset().position; $element[direction === 'in' ? 'addClass' : 'removeClass'](name); if (callback == null) { return; } if (transition != null) { $element.one(transition, callback); } else { callback(); } }; Growl.prototype.$growls = function() { return this.$_growls != null ? this.$_growls : this.$_growls = $('#growls'); }; Growl.prototype.$growl = function() { return this.$_growl != null ? this.$_growl : this.$_growl = $(this.html()); }; Growl.prototype.html = function() { return "<div class='" + this.settings.namespace + " " + this.settings.namespace + "-" + this.settings.style + " " + this.settings.namespace + "-" + this.settings.size + "'>\n <div class='" + this.settings.namespace + "-close'>" + this.settings.close + "</div>\n <div class='" + this.settings.namespace + "-title'>" + this.settings.title + "</div>\n <div class='" + this.settings.namespace + "-message'>" + this.settings.message + "</div>\n</div>"; }; return Growl; })(); $.growl = function(options) { if (options == null) { options = {}; } return Growl.growl(options); }; $.growl.error = function(options) { var settings; if (options == null) { options = {}; } settings = { title: "Error!", style: "error" }; return $.growl($.extend(settings, options)); }; $.growl.notice = function(options) { var settings; if (options == null) { options = {}; } settings = { title: "Notice!", style: "notice" }; return $.growl($.extend(settings, options)); }; $.growl.warning = function(options) { var settings; if (options == null) { options = {}; } settings = { title: "Warning!", style: "warning" }; return $.growl($.extend(settings, options)); }; }).call(this);
;Quintus.Websocket = function (Q) { // prepare websocket connection var connection; var connect = function() { var url = "ws://" + window.location.host + "/ws/"; connection = new WebSocket(url); connection.onopen = function(){ console.log("webSocket open"); Q.state.set(WEBSOCKET_INIT_READY, true); }; connection.onerror = function (error) { console.log("webSocket error: " + error); // nothing we can do...? }; connection.onmessage = function (message) { console.log("received message: " + message.data); // parse json to command and data var jsonMessage = JSON.parse(message.data); var command = 'ws-' + jsonMessage.command; var data = {}; if(jsonMessage.data){ data = jsonMessage.data; } // set command to Quintus state, so we can add state change listeners // where we need to react on commands Q.state.set(command, data); }; }; // add send message to Q so that it's easy available everywhere var sendMessage = function(message) { console.log("sending message: " + message); connection.send(message); }; // send message with command and data Q.sendCommand = function (command, data) { var jsonCommand = {}; jsonCommand.command = command; if(data){ jsonCommand.data = data; } else { jsonCommand.data = {}; } var commandString = JSON.stringify(jsonCommand); sendMessage(commandString); }; // generate a unique id var generateUUID = function () { var d = new Date().getTime(); var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { var r = (d + Math.random() * 16) % 16 | 0; d = Math.floor(d / 16); return (c == 'x' ? r : (r & 0x7 | 0x8)).toString(16); }); return uuid; }; // register client when websocket connection is up and running AND Quintus ist ready var registerClient = function () { var clientId = generateUUID(); Q.state.set(CLIENTID, clientId); var data = {}; data[WSC_REGISTER_CLIENT_ID] = clientId; Q.sendCommand(WSC_REGISTER_CLIENT, data); }; var initReady = function(){ var websocketReady = Q.state.get(WEBSOCKET_INIT_READY); var quintusReady = Q.state.get(QUINTUS_INIT_READY); if(websocketReady && quintusReady){ registerClient(); } }; Q.state.on("change." + WEBSOCKET_INIT_READY, initReady); Q.state.on("change." + QUINTUS_INIT_READY, initReady); // called from html form joinRace = function (form) { var name = form.name.value; if (name.trim().length == 0) { alert("Please enter your name"); return false; } else { var data = {}; data[WSC_REGISTER_CAR_NAME] = name; Q.sendCommand(WSC_REGISTER_CAR, data); return false; } }; connect(); };
!function ($) { var ProgressBar = function (element, options) { this.element = $(element); this.position = 0; this.percent = 0; var hasOptions = typeof options == 'object'; this.dangerMarker = $.fn.progressbar.defaults.dangerMarker; if (hasOptions && typeof options.dangerMarker == 'number') { this.setDangerMarker(options.dangerMarker); } this.warningMarker = $.fn.progressbar.defaults.warningMarker; if (hasOptions && typeof options.warningMarker == 'number') { this.setWarningMarker(options.warningMarker); } this.maximum = $.fn.progressbar.defaults.maximum; if (hasOptions && typeof options.maximum == 'number') { this.setMaximum(options.maximum); } this.step = $.fn.progressbar.defaults.step; if (hasOptions && typeof options.step == 'number') { this.setStep(options.step); } this.element.html($(DRPGlobal.template)); }; ProgressBar.prototype = { constructor: ProgressBar, stepIt: function () { if (this.position < this.maximum) this.position += this.step; this.setPosition(this.position); }, setWarningMarker: function (marker) { marker = parseInt(marker); if (marker > this.dangerMarker) { this.warningMarker = this.dangerMarker; return; } this.warningMarker = marker; }, setDangerMarker: function (marker) { this.dangerMarker = parseInt(marker); }, setMaximum: function (maximum) { this.maximum = parseInt(maximum); }, setStep: function (step) { step = parseInt(step); if (step <= 0) step = 1; this.step = parseInt(step); }, setPosition: function (position) { position = parseInt(position); if (position < 0) position = 0; if (position > this.maximum) position = this.maximum; this.position = position; this.percent = Math.ceil((this.position / this.maximum) * 100); try { if (this.percent <= this.warningMarker) { this.element.find('.bar-success').css('width', this.percent + "%"); this.element.find('.bar-warning').css('width', "0%"); this.element.find('.bar-danger').css('width', "0%"); return; } this.element.find('.bar-success').css('width', this.warningMarker + "%"); if (this.percent > this.warningMarker && this.percent <= this.dangerMarker) { this.element.find('.bar-warning').css('width', (this.percent - this.warningMarker) + "%"); this.element.find('.bar-danger').css('width', "0%"); return; } this.element.find('.bar-warning').css('width', (this.dangerMarker - this.warningMarker) + "%"); this.element.find('.bar-danger').css('width', (this.percent - this.dangerMarker) + "%"); } finally { this._triggerPositionChanged(); } }, reset: function () { this.position = 0; this.percent = 0; this._triggerPositionChanged(); this.element.find('.bar-success').css('width', "0%"); this.element.find('.bar-warning').css('width', "0%"); this.element.find('.bar-danger').css('width', "0%"); }, _triggerPositionChanged: function () { this.element.trigger({ type: "positionChanged", position: this.position, percent: this.percent }); } }; $.fn.progressbar = function (option) { var args = Array.apply(null, arguments); args.shift(); return this.each(function () { var $this = $(this), data = $this.data('progressbar'), options = typeof option == 'object' && option; if (!data) { $this.data('progressbar', new ProgressBar(this, $.extend({}, $.fn.progressbar().defaults, options))); } if (typeof option == 'string' && typeof data[option] == 'function') { data[option].apply(data, args); } }); }; $.fn.progressbar.defaults = { warningMarker: 50, dangerMarker: 90, maximum: 100, step: 1 }; $.fn.progressbar.Constructor = ProgressBar; var DRPGlobal = {}; DRPGlobal.template = '<div class="progress">' + '<div class="bar bar-success progress-bar progress-bar-success" style="width: 0%;"></div>' + '<div class="bar bar-warning progress-bar progress-bar-warning" style="width: 0%;"></div>' + '<div class="bar bar-danger progress-bar progress-bar-danger" style="width: 0%;"></div>' + '</div>'; } (window.jQuery);
/* * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is * regenerated. */ 'use strict'; const models = require('./index'); /** * Update network mappings input properties/behaviour specific to vmm to vmm. * * @extends models['FabricSpecificUpdateNetworkMappingInput'] */ class VmmToVmmUpdateNetworkMappingInput extends models['FabricSpecificUpdateNetworkMappingInput'] { /** * Create a VmmToVmmUpdateNetworkMappingInput. */ constructor() { super(); } /** * Defines the metadata of VmmToVmmUpdateNetworkMappingInput * * @returns {object} metadata of VmmToVmmUpdateNetworkMappingInput * */ mapper() { return { required: false, serializedName: 'VmmToVmm', type: { name: 'Composite', className: 'VmmToVmmUpdateNetworkMappingInput', modelProperties: { instanceType: { required: true, serializedName: 'instanceType', type: { name: 'String' } } } } }; } } module.exports = VmmToVmmUpdateNetworkMappingInput;
// Copyright (C) 2017 The Android Open Source Project // // 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(window) { 'use strict'; function GrAttributeHelper(element) { this.element = element; this._promises = {}; } GrAttributeHelper.prototype._getChangedEventName = function(name) { return name.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase() + '-changed'; }; /** * Returns true if the property is defined on wrapped element. * @param {string} name * @return {boolean} */ GrAttributeHelper.prototype._elementHasProperty = function(name) { return this.element[name] !== undefined; }; GrAttributeHelper.prototype._reportValue = function(callback, value) { try { callback(value); } catch (e) { console.info(e); } }; /** * Binds callback to property updates. * * @param {string} name Property name. * @param {function(?)} callback * @return {function()} Unbind function. */ GrAttributeHelper.prototype.bind = function(name, callback) { const attributeChangedEventName = this._getChangedEventName(name); const changedHandler = e => this._reportValue(callback, e.detail.value); const unbind = () => this.element.removeEventListener( attributeChangedEventName, changedHandler); this.element.addEventListener( attributeChangedEventName, changedHandler); if (this._elementHasProperty(name)) { this._reportValue(callback, this.element[name]); } return unbind; }; /** * Get value of the property from wrapped object. Waits for the property * to be initialized if it isn't defined. * * @param {string} name Property name. * @return {!Promise<?>} */ GrAttributeHelper.prototype.get = function(name) { if (this._elementHasProperty(name)) { return Promise.resolve(this.element[name]); } if (!this._promises[name]) { let resolve; const promise = new Promise(r => resolve = r); const unbind = this.bind(name, value => { resolve(value); unbind(); }); this._promises[name] = promise; } return this._promises[name]; }; window.GrAttributeHelper = GrAttributeHelper; })(window);
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ function getHookKey (componentId, type, hookName) { return `${type}@${hookName}#${componentId}` } /** * For general callback management of a certain Weex instance. * Because function can not passed into native, so we create callback * callback id for each function and pass the callback id into native * in fact. And when a callback called from native, we can find the real * callback through the callback id we have passed before. */ export default class CallbackManager { constructor (instanceId) { this.instanceId = String(instanceId) this.lastCallbackId = 0 this.callbacks = {} this.hooks = {} } add (callback) { this.lastCallbackId++ this.callbacks[this.lastCallbackId] = callback return this.lastCallbackId } remove (callbackId) { const callback = this.callbacks[callbackId] delete this.callbacks[callbackId] return callback } registerHook (componentId, type, hookName, hookFunction) { // TODO: validate arguments const key = getHookKey(componentId, type, hookName) if (this.hooks[key]) { console.warn(`[JS Framework] Override an existing component hook "${key}".`) } this.hooks[key] = hookFunction } triggerHook (componentId, type, hookName, args) { // TODO: validate arguments const key = getHookKey(componentId, type, hookName) const hookFunction = this.hooks[key] if (typeof hookFunction !== 'function') { console.error(`[JS Framework] Invalid hook function type (${typeof hookFunction}) on "${key}".`) return null } let result = null try { result = hookFunction.apply(null, args || []) } catch (e) { console.error(`[JS Framework] Failed to execute the hook function on "${key}".`) } return result } consume (callbackId, data, ifKeepAlive) { const callback = this.callbacks[callbackId] if (typeof ifKeepAlive === 'undefined' || ifKeepAlive === false) { delete this.callbacks[callbackId] } if (typeof callback === 'function') { try { return callback.call(null, data) } catch (error) { console.error(`[JS Framework] Failed to execute the callback function:\n ${error.toString()}`) } } return new Error(`invalid callback id "${callbackId}"`) } close () { this.callbacks = {} this.hooks = {} } }
angular.module('socially').filter('uninvited', [function () { return function (users, party) { if (!party) return false; return _.filter(users, function (user) { if (user._id === party.owner || _.contains(party.invited, user._id)) return false; return true; }); }; }]);
var dir_7265ac5285a52c426ae9b593dbd1bc17 = [ [ "org", "dir_eed327807d80cce46dc89b56e2758421.html", "dir_eed327807d80cce46dc89b56e2758421" ] ];
window.onload=onLoad; var tl; function onLoad() { var eventSource = new Timeline.DefaultEventSource(); var bandInfos = [ Timeline.createBandInfo({ eventSource: eventSource, date: "Jun 28 2006 00:00:00 GMT", width: "70%", intervalUnit: Timeline.DateTime.MONTH, intervalPixels: 100 }), Timeline.createBandInfo({ eventSource: eventSource, date: "Jun 28 2006 00:00:00 GMT", width: "30%", intervalUnit: Timeline.DateTime.YEAR, intervalPixels: 200 }) ]; bandInfos[1].syncWith = 0; bandInfos[1].highlight = true; tl = Timeline.create(document.getElementById("my_timeline"), bandInfos); Timeline.loadXML("example.xml",function(xml,url) { eventSource.loadXML(xml,url) } ); } var resizeTimerID = null; function onResize() { if (resizeTimerID == null) { resizeTimerID = window.setTimeout(function() { resizeTimerID = null; tl.layout(); }, 500); } }
var oper = { width : 400, height : 500, form : document.form1, jqgrid : function() { var fields = $("form").serializeArray(); var jsonData = {}; jQuery.each( fields, function(i, field){ jsonData[field.name]=field.value; }); $('#jqGrid').jqGrid('setGridParam', { postData : jsonData }).trigger('reloadGrid'); return false; }, list : function() { oper.jqgrid(); }, view : function(id) { var url = 'system/dict/view/'+id; var title = '查看数据字典类型'; Iframe(url, this.width, this.height, title, false, false, false, EmptyFunc); }, add : function() { var url = 'system/dict/add'; var title = '添加数据字典类型'; Iframe(url, this.width, this.height, title); }, edit : function(id) { var url = 'system/dict/edit/'+id; var title = '修改数据字典类型'; Iframe(url, this.width, this.height, title); }, del : function(id) { var title = '确认要删除该数据字典类型信息?'; var url = 'system/dict/delete/'+id; Confirm(title, function() { ajax_post(url,null, function (data) { if(data.code==0){ oper.list(); } else { ErrorInfo('操作失败:'+data.msg); } }); }); } }; // 初始化 jQuery(function($) { // 加载jqgrid var editStr = $('#jqGridEdit').html(); $('#jqGrid').jqGrid({ url:"system/dict/jqgrid", mtype: "POST", styleUI : 'Bootstrap', datatype: "json", colModel: [ {label: "id",name: 'id',width: 75,hidden:true,key:true}, {label: "名称",name: 'name',width: 120,sortable:true}, {label: "类型",name: 'type',width: 120,sortable:true}, {label: "备注",name: 'remark',width: 120,sortable:true}, {label: "是否启用",name: 'enable',width: 120,sortable:true,hidden:true}, {label : "更新时间",name: 'updateTime',width: 240}, {label : "更新人",name: 'updateName',width: 160,sortable:false}, {label : "创建时间",name: 'createTime',width: 240}, {label : "创建人",name: 'createName',width: 160,sortable:false}, { name: '操作', index: '', width: 200, fixed: true, sortable: false, resize: false, formatter: function(cellvalue, options, rowObject) { var replaceStr = "\\[id\\]"; var buttonStr = editStr; try{ buttonStr = buttonStr.replace(/\r\n/g,""); buttonStr = buttonStr.replace(/\n/g,""); buttonStr = buttonStr.replace(new RegExp(replaceStr,'gm'),rowObject.id ); }catch(e) { alert(e.message); } return buttonStr ; } } ], rownumbers: true, sortname: 'id', viewrecords: true, autowidth: true, width: 1050, height: 630, rowNum: 20, caption: "数据字典类型列表", pager: "#jqGridPager" }); // 宽高自适应 $("#jqGrid").setGridHeight($(window).height() - 250); $("#tree").height($(window).height() - 150); $(window).resize(function(){ $(window).unbind("onresize"); $("#jqGrid").setGridHeight($(window).height() - 250).jqGrid('setGridWidth', $('#data_content').width() - 5); $("#tree").height($(window).height() - 150); $(window).bind("onresize", this); }); $('#jqGrid').jqGrid('navGrid',"#jqGridPager", { search: false, // show search button on the toolbar add: false, edit: false, del: false, refresh: true, view: false }); $('#jqGrid').navButtonAdd('#jqGridPager', { buttonicon: "glyphicon-plus", title: "新增", caption: "新增", position: "first", onClickButton: function(){ oper.add(); } }); });
/* jshint asi: true */ var UUID = require('node-uuid') var _ = require('lodash') var objectAssign = require('object-assign') var example = require('../../examples/linked-proposal.json') function genId (obj) { var id = '_:' + UUID.v4() if (obj) { var self = _.find(obj.links, function(link) { return link.rel === 'self' }) if (self) { id = self.href } } return id } /* * */ function process(obj) { // 1) check if rel="self" and use href for @id return { '@id': genId (obj) } } module.exports = function(data, url) { var jsonld = { } jsonld['@context'] = require('./context.json')['@context'] var graphName = '@graph' if (url) { graphName = url } jsonld[graphName] = [] if (data.session) { var session = process({}) if (data.session.presenters) { jsonld[graphName].presenter = [] _.each(data.session.presenters, function(presenter) { jsonld[graphName].push(process(presenter)) }) } } return jsonld } console.log(JSON.stringify(module.exports(example)))
// Copyright 2013 SAP AG. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http: //www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, // either express or implied. See the License for the specific // language governing permissions and limitations under the License. 'use strict'; var util = require('../../util'); exports.read = read; exports.write = write; exports.getByteLength = getByteLength; exports.getArgumentCount = getArgumentCount; function read(part) { return util.convert.decode(part.buffer, part.useCesu8); } function write(part, value) { /* jshint validthis:true */ value = value || this; part = part || {}; part.argumentCount = getArgumentCount(value); part.buffer = util.convert.encode(value, part.useCesu8); return part; } function getByteLength(value) { return Buffer.byteLength(value); } function getArgumentCount(value) { /* jshint unused:false */ return 1; }
//--------------------------------------- // Story Model //--------------------------------------- var Story = Backbone.Model.extend({ initialize: function() { } });
'use strict'; var common = require('../common'); var R = require('_stream_readable'); var assert = require('assert'); var fs = require('fs'); var FSReadable = fs.ReadStream; var path = require('path'); var file = path.resolve(common.fixturesDir, 'x1024.txt'); var size = fs.statSync(file).size; var expectLengths = [1024]; var util = require('util'); var Stream = require('stream'); util.inherits(TestWriter, Stream); function TestWriter() { Stream.apply(this); this.buffer = []; this.length = 0; } TestWriter.prototype.write = function(c) { this.buffer.push(c.toString()); this.length += c.length; return true; }; TestWriter.prototype.end = function(c) { if (c) this.buffer.push(c.toString()); this.emit('results', this.buffer); }; var r = new FSReadable(file); var w = new TestWriter(); w.on('results', function(res) { console.error(res, w.length); assert.equal(w.length, size); var l = 0; assert.deepEqual(res.map(function(c) { return c.length; }), expectLengths); console.log('ok'); }); r.pipe(w);
import {ipcMain} from "electron"; import videoProcessor from "../../processors/video-processor"; ipcMain.handle('processing.availableCodecs', async () => { return videoProcessor.getAvailableCodecs(); }); ipcMain.handle('processing.availableFilters', async () => { return videoProcessor.getAvailableFilters(); }); ipcMain.handle('processing.availableEncoders', async () => { return videoProcessor.getAvailableEncoders(); }); ipcMain.handle('processing.availableFormats', async () => { return videoProcessor.getAvailableFormats(); });
var RxOld = require('rx'); var RxNew = require('../../../../index'); module.exports = function (suite) { var oldMergeMapWithCurrentThreadScheduler = RxOld.Observable.range(0, 25, RxOld.Scheduler.currentThread) .flatMapFirst(function (x) { return RxOld.Observable.range(x, 25, RxOld.Scheduler.currentThread); }); var newMergeMapWithCurrentThreadScheduler = RxNew.Observable.range(0, 25, RxNew.Scheduler.immediate) .switchMapFirst(function (x) { return RxNew.Observable.range(x, 25, RxNew.Scheduler.immediate); }); function _next(x) { } function _error(e) { } function _complete() { } return suite .add('old switchMapFirst with current thread scheduler', function () { oldMergeMapWithCurrentThreadScheduler.subscribe(_next, _error, _complete); }) .add('new switchMapFirst with current thread scheduler', function () { newMergeMapWithCurrentThreadScheduler.subscribe(_next, _error, _complete); }); };
import Color from "./../../webgl/Color"; export default { prepareVector : prepareVector, initColorArray : initColorArray, scalePaletteColorValues: scalePaletteColorValues }; export function prepareVector(mesh, min, max, colorArray) { const colors = []; for (let i = 0; i < mesh.vectorData.length; i++) { const color = getColorFromArray(mesh.vectorData[i], min, max, colorArray); colors[3 * i] = color ? color.r : 0; colors[3 * i + 1] = color ? color.g : 0; colors[3 * i + 2] = color ? color.b : 0; } return colors; } export function initColorArray(numColors, steps, minValue, maxValue, inverted) { if (maxValue - minValue === 0) return [new Color(0x000000)]; const n = !!numColors ? numColors : 1024; const colorArray = []; const step = (maxValue - minValue) / n; for (let stepVal = minValue; stepVal <= maxValue; stepVal += step) { for (let i = 0; i < steps.length - 1; i++) { if (stepVal >= steps[i].scaledVal && stepVal < steps[i + 1].scaledVal) { const min = steps[i].scaledVal; const max = steps[i + 1].scaledVal; const minColor = new Color(0xffffff).setHex("0x" + steps[i].color.getHexString()); const maxColor = new Color(0xffffff).setHex("0x" + steps[i + 1].color.getHexString()); const color = minColor.lerp(maxColor, (stepVal - min) / (max - min)); if (inverted) { colorArray.unshift(color); } else { colorArray.push(color); } } } } return colorArray; } export function getColorFromArray(alpha, min, max, array) { if (alpha <= min || min === max) { alpha = min; } else if (alpha >= max) { alpha = max; } else { alpha = (alpha - min) / (max - min); } let colorPosition = Math.round(alpha * array.length); if (colorPosition === array.length) { colorPosition -= 1; } return array[colorPosition]; } export function scalePaletteColorValues(min, max, steps) { const newSteps = []; for (let i = 0; i < steps.length; i++) { newSteps.push({...steps[i], scaledVal: min + i * (max - min) / (steps.length - 1)}); } return newSteps; }
sap.ui.define([ "sap/ui/test/Opa5", "sap/ui/test/actions/Press" ], function (Opa5, Press) { "use strict"; Opa5.createPageObjects({ onTheAppPage: { actions: { iClickButton: function (sViewName, sId) { return this.waitFor({ id: sId, viewName: sViewName, actions: [new Press()], errorMessage: "button with id: " + sId + " in view: " + sViewName + " can not be pressed!" }); } }, assertions: { iShouldSeeTheApp: function () { return this.waitFor({ id: "app", viewName: "MainView", success: function () { Opa5.assert.ok(true, "The MainView view is displayed"); }, errorMessage: "Did not find the MainView view" }); }, iPersonalizationStatusShouldBeCorrect: function (sViewName, sId, bIsPersonalized) { return this.waitFor({ id: sId, viewName: sViewName, matchers: [function (oControl) { var bStatus = oControl.getText().indexOf("NOT") === -1; return bIsPersonalized === bStatus; }], success: function () { Opa5.assert.ok(true, "View: " + sViewName + " , ContronlId: " + sId + " has correct Personalization status"); }, errorMessage: "View: " + sViewName + " , ContronlId: " + sId + " has incorrect Personalization status" }); }, iChangesAreApplied: function (sViewName, sId, sText) { return this.waitFor({ id: sId, viewName: sViewName, matchers: [function (oControl) { return oControl.getText().indexOf(sText) !== -1; }], success: function () { Opa5.assert.ok(true, "Changes have been applied correctly for View: " + sViewName + " , ContronlId: " + sId); }, errorMessage: "Changes have not been applied correctly for View: " + sViewName + " , ContronlId: " + sId }); }, iNoChangeIsApplied: function (sViewName, sId) { return this.waitFor({ id: sId, viewName: sViewName, matchers: [function (oControl) { return oControl.getText().indexOf("X") === -1; }], success: function () { Opa5.assert.ok(true, "No changes has been applied for View: " + sViewName + " , ContronlId: " + sId); }, errorMessage: "Some changes have been applied correctly for View: " + sViewName + " , ContronlId: " + sId }); } } } }); });
angular.module("gerritDashboard").config(["i18nProvider", "supportedLanguages", function (i18nProvider, supportedLanguages) { i18nProvider.translations[supportedLanguages.EN] = { "total_number_of_projects": "Total Number Of Project", "number_of_open_reviews": "Number Of Open Reviews", "number_of_commits": "Number Of Commits", "average_review_interval": "Average Review Interval", "most_committed_projects": "Most Committed Projects", "top_committers": "Top Committers", "top_reviewers": "Top Reviewers", "project_stats": "Project Stats", "project_reviewed": "Project Reviewed", "project_name": "Project Name", "reviews": "Reviews", "scores": "Scores", "score": "Score", "count": "Count", "average_merge_time": "Average Merge Time", "average_first_review_time": "Average First Review Time", "today": "Today", "this_week": "This Week", "this_month": "This Month", "last_30_days": "Last 30 Days", "last_6_months": "Last 6 Months" }; i18nProvider.translations[supportedLanguages.TR] = { "total_number_of_projects": "Toplam Proje Sayısı", "number_of_open_reviews": "Açık Review Sayısı", "number_of_commits": "Commit Sayısı", "average_review_interval": "Ortalama Review Süresi", "most_committed_projects": "En çok Commit Yapılan Projeler", "top_committers": "En Çok Commit Yapanlar", "top_reviewers": "En Çok Review Yapanlar", "project_stats": "Proje İstatistikleri", "project_reviewed": "Review Yapılan Proje", "project_name": "Proje Adı", "reviews": "Reviewler", "scores": "Skorlar", "score": "Skor", "count": "Sayı", "average_merge_time": "Ortalama Mergelenme Süresi", "average_first_review_time": "Ortalama İlk Review Süresi", "today": "Bugün", "this_week": "Bu Hafta", "this_month": "Bu Ay", "last_30_days": "Son 30 Gün", "last_6_months": "Son 6 Ay" } }]);
var winston = require('winston'); require('./lib/winston-graphite-tcp.js');
/* Copyright 2010-2011 Vodafone Group Services GmbH 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(){ RULER_MM_HTML = '<div style="height: 40px; background: #678; color: white; border: 1px solid #8dadd2; border-width: 1px 0; position: relative">' + '<span style="position: absolute; left: 0; border-left: 1px solid #8dadd2; height: 100%;">0</span>' + '<span style="position: absolute; right: 2cm; border-right: 1px solid #8dadd2; height: 100%;">1cm</span>' + '<span style="position: absolute; right: 1cm; border-right: 1px solid #8dadd2; height: 100%;">2cm</span>' + '<span style="position: absolute; right: 0; border-right: 1px solid #8dadd2; height: 100%;">3cm</span>' + '</div>'; RULER_IN_HTML = '<div style="height: 40px; background: #678; color: white; border: 1px solid #8dadd2; border-width: 1px 0; position: relative">' + '<span style="position: absolute; left: 0; border-left: 1px solid #8dadd2; height: 100%;">0</span>' + '<span style="position: absolute; right: 0.5in; border-right: 1px solid #8dadd2; height: 100%;">0.5in</span>' + '<span style="position: absolute; right: 0; border-right: 1px solid #8dadd2; height: 100%;">1in</span>' + '</div>'; dohx.add({ name: "Metrics", mqcExecutionOrderBaseOffset:370000, // This number is the base offset for the execution order, the test ID gets added. Never change this number unless you know what you are doing. requiredObjects: [], tests: [ { id: 1, name: "Instructions", instructions: [ "This series of tests checks whether physical lengths are displayed correctly on the device.", "You will need a ruler to measure objects on the screen.", "For each test, please check whether the size of the box displayed matches the expected result." ].join("<br><br>"), test: function(t){ t.success() } }, { id: 100, name: "Millimeters", instructions: "This test displays a box with <code>width</code> set to <code>3cm</code>. <br><br>Please measure the width with the ruler.", expectedResult: "Is the width of the box exactly 3&nbsp;cm? (1&nbsp;cm = 0.3937&nbsp;in)", test: function(){ dohx.showInfo('<div style="width: 3cm">' + RULER_MM_HTML + '</div>'); } }, { id: 200, name: "Inches", instructions: "This test displays a box with <code>width</code> set to <code>1in</code>. <br><br>Please measure the width with the ruler.", expectedResult: "Is the width of the box exactly 1&nbsp;inch? (1&nbsp;in = 2.54&nbsp cm)", test: function(){ dohx.showInfo('<div style="width: 1in">' + RULER_IN_HTML + '</div>'); } }, { id: 300, name: "Font in <code>mm</code>, width in <code>em</code>", instructions: "This test displays a box with <code>width:10 em; font-size: 3mm;</code>.<br><br>Please measure the width with the ruler.", expectedResult: "Is the width of the box exactly 3&nbsp;cm? (1&nbsp;cm = 0.3937&nbsp;in)", test: function(){ dohx.showInfo('<div style="width: 10em; font-size: 3mm">' + RULER_MM_HTML + '</div>'); } }, { id: 400, name: "Font in <code>in</code>, width in <code>em</code>", instructions: "This test displays a box with <code>width:10 em; font-size: 0.1in;</code>.<br><br>Please measure the width with the ruler.", expectedResult: "Is the width of the box exactly 1&nbsp;inch? (1&nbsp;in = 2.54&nbsp cm)", test: function(){ dohx.showInfo('<div style="width: 10em; font-size: 0.1in">' + RULER_IN_HTML + '</div>'); } }, { id: 500, name: "Font in <code>mm</code> (CSS shorthand syntax), width in <code>em</code>", instructions: "This test displays a box with <code>width: 10em; font: 3mm/1.5 sans-serif;</code> to test the <code>font</code> shorthand syntax.<br><br>Please measure the width with the ruler.", expectedResult: "Is the width of the box exactly 3&nbsp;cm? (1&nbsp;cm = 0.3937&nbsp;in)", test: function(){ dohx.showInfo('<div style="width: 10em; font: 3mm/1.5 sans-serif">' + RULER_MM_HTML + '</div>'); } }, { id: 600, name: "Font in <code>in</code> (CSS shorthand syntax), width in <code>em</code>", instructions: "This test displays a box with <code>width: 10em; font: 0.1in/1.5 sans-serif;</code> to test the <code>font</code> shorthand syntax.<br><br>Please measure the width with the ruler.", expectedResult: "Is the width exactly 1&nbsp;inch? (1&nbsp;in = 2.54&nbsp cm)", test: function(){ dohx.showInfo('<div style="width: 10em; font: 0.1in/1.5 sans-serif">' + RULER_IN_HTML + '</div>'); } } ] }) }());
module.exports = function(app){ app.schema.WorldObject = app.Mongoose.model( 'NPCBrain', { _id:app.Mongoose.schema.ObjectId, name: String, object_id:String, x:{ type:'number'}, y:{ type:'number'}, z:{ type:'number'}, serialized:{ type: 'object' } } ); }
"use strict"; const IoRedis = require("ioredis"); const DATASTORE = "LITTLETABLE:MASTER:DATASTORE"; const config = { port: 6379, host: "localhost", family:4, password:"", db:0, enableReadyCheck:true, enableOfflineQueue:true }; var redis = new IoRedis( config ); function DataStore(){ } DataStore.prototype.saveChunk = function( data, hash, callback ){ redis.hset( DATASTORE, hash, data, callback ); }; DataStore.prototype.loadChunk = function( hash, callback ){ redis.hget( DATASTORE, hash, callback ); }; module.exports = DataStore;
angular.module('DataService', []).factory('DataService', [ '$q', '$http', '$rootScope', function($q, $http, $rootScope) { var logout = function() { var data = $q.defer(); $http.post('logout', {}).success(function() { data.resolve(); }, function() { data.resolve(); }); return data.promise; }; return { getProfile : function() { var deferred = $q.defer(); $http.get('console/data').success(function(data) { deferred.resolve(data); }).error(function(e) { deferred.reject(e); }); return deferred.promise; }, publishApp : function() { var deferred = $q.defer(); $http.put('console/publish', {}).success(function(data) { deferred.resolve(data); }).error(function(e) { deferred.reject(e); }); return deferred.promise; }, logout : logout }; } ]);
import metadataMapping from './metadataMapping'; export const metadataTypes = Object.keys(metadataMapping); export const defaultMetadataType = metadataTypes.includes("Imaging MS") ? "Imaging MS" : metadataTypes[0]; export const metadataSchemas = {}; for (const mdType of metadataTypes) { const mdFilename = metadataMapping[mdType]; metadataSchemas[mdType] = require(`../assets/${mdFilename}`); }
function ExportCamera(props, exportOptions) { var options = props.property("Camera Options"); var aeNames = ["Blur Level", "Depth of Field", "Focus Distance", "Zoom"]; var codeNames = ["blur", "DOF", "focus", "zoom"]; var data = {}; var i, total = aeNames.length; for (i = 0; i < total; ++i) { data[codeNames[i]] = options.property(aeNames[i]).value; } // Determine FOV var comp = props.containingComp; var width = comp.width; var aspect = width / comp.height; data.fov = Number((2 * Math.atan(width / aspect / (2 * data.zoom)) * (180 / Math.PI)).toFixed(3)); data.timeline = exportProps(props, aeNames, codeNames, exportOptions); return data; };
FlowRouter.route('/Admin', { name: 'Admin', action: function() { BlazeLayout.render("layoutDefault", {header: "navigation", main: "Admin"}); } });
/* Copyright 2016 Covistra Technologies Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ module.exports = { redis: { $filter: 'env', $base: { type: 'redis-queue', timeout: 25000 }, production: { host: 'redis', port: 6379 }, $default: { host: 'localhost', port: 6379 } } };
export function copy(dst, src) { dst.x = src.x; dst.y = src.y; } export function dot(p, q) { return p.x * q.x + p.y * q.y; } export function len(p) { return Math.sqrt(len2(p)); } export function len2(p) { return dot(p, p); } export function dist(p, q) { return len(sub(p, q)); } export function dist2(p, q) { return len2(sub(p, q)); } export function sub(p, q) { return {x: p.x - q.x, y: p.y - q.y}; } export function add(p, q) { return {x: p.x + q.x, y: p.y + q.y}; } export function scale(p, s) { return {x: p.x * s, y: p.y * s}; } export function crossMag(p, q) { // The magnitude of the cross product of two 2d vectors is easy to calculate: return p.x * q.y - q.x * p.y; } export function side(p, q, x) { return crossMag(sub(q, p), sub(x, p)); } export function lerp(p, q, s) { return add(p, scale(sub(q, p), s)); } export function project(v, b) { return scale(b, dot(v, b) / len2(b)); } export function flip(v, b) { const vOnB = project(v, b); return sub(v, scale(sub(v, vOnB), 2)); } // CW, of all things. export function rot(v, angle) { return rotCW(v, angle); } export function rotCW(v, angle) { return rotCCW(v, -angle); } export function rotCCW(v, angle) { return { x: v.x * Math.cos(angle) - v.y * Math.sin(angle), y: v.x * Math.sin(angle) + v.y * Math.cos(angle), }; }
/* Copyright 2016 Paul Bevis 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 React from 'react'; import {render} from 'react-dom'; import {Provider} from 'react-redux'; import Spelling from './js/containers/spelling'; import {createStore} from 'redux'; import spellingAppReducers from './js/reducers/spelling'; import injectTapEventPlugin from 'react-tap-event-plugin'; injectTapEventPlugin(); const store = createStore(spellingAppReducers); render( <Provider store={store}> <Spelling /> </Provider>, document.getElementById('framework') ); if (typeof Object.assign != 'function') { (function() { Object.assign = function(target) { 'use strict'; if (target === undefined || target === null) { throw new TypeError('Cannot convert undefined or null to object'); } var output = Object(target); for (var index = 1; index < arguments.length; index++) { var source = arguments[index]; if (source !== undefined && source !== null) { for (var nextKey in source) { if (source.hasOwnProperty(nextKey)) { output[nextKey] = source[nextKey]; } } } } return output; }; })(); } if (!Array.prototype.find) { Array.prototype.find = function(predicate) { if (this === null) { throw new TypeError('Array.prototype.find called on null or undefined'); } if (typeof predicate !== 'function') { throw new TypeError('predicate must be a function'); } var list = Object(this); var length = list.length >>> 0; var thisArg = arguments[1]; var value; for (var i = 0; i < length; i++) { value = list[i]; if (predicate.call(thisArg, value, i, list)) { return value; } } return undefined; }; }
module.exports = { "Redis":{ "redisip":"104.131.105.222", "redisport":6379, "redisdb":6 }, "Services" : { "routingServiceHost": "localhost", "routingServicePort": "2223", "routingServiceVersion": "1.0.0.0" }, "Host": { "LBIP":"127.0.0.1", "LBPort":"2225", "Ip": "127.0.0.1", "Port": "2225", "Version": "1.0.0.0" }, "DB": { "Type": "postgres", "User": "duo", "Password": "DuoS123", "Port": 5432, "Host": "104.131.105.222", "Database": "dvpdb" } };
export const BASE_API = 'https://go.joway.wang/'; // export const BASE_API = 'http://localhost:8000/'; export const AUTH_API_LOGIN = BASE_API + 'auth/login/'; export const AUTH_API_LOGOUT = BASE_API + 'auth/logout/'; export const AUTH_API_REGISTER = BASE_API + 'auth/register/'; export const AUTH_API_ACTIVATE = BASE_API + 'auth/activate/'; export const USER_API = BASE_API + 'user/'; export const ARTICLE_LIST_API = BASE_API + 'article/'; export const ARTICLE_DETAIL_API = BASE_API + 'article/:id/'; export const ARTICLE_ABOUT_API = BASE_API + 'article/about/'; export const COMMENT_API = BASE_API + 'comment/'; // lab export const GITHUB_REPOS_API = 'https://api.github.com/users/joway/repos';
import './directory-item.html';
var class_tri_1_1_util_1_1_vector2 = [ [ "Vector2", "class_tri_1_1_util_1_1_vector2.html#a5bd9af497b1e94182828557c8c32d9b2", null ], [ "Vector2", "class_tri_1_1_util_1_1_vector2.html#a9e93686dcffd21464698f12a37b7f5c7", null ], [ "absV2", "class_tri_1_1_util_1_1_vector2.html#a1030fb4c61ebb13be8127ef599644fd8", null ], [ "distance", "class_tri_1_1_util_1_1_vector2.html#a958c40bacc64414b2e7605a9aa0795bb", null ], [ "operator Vector1< T >", "class_tri_1_1_util_1_1_vector2.html#a2ad4acbe3cb1f0af438fe2b99fb04ea2", null ], [ "operator=", "class_tri_1_1_util_1_1_vector2.html#a0a679026dfa4fa180af2b77a2c0af691", null ], [ "operator[]", "class_tri_1_1_util_1_1_vector2.html#a0b6ad3a90190a53461edd5905484d60c", null ], [ "m_YPosition", "class_tri_1_1_util_1_1_vector2.html#aa4c9efb1df95560f85c812ffed4fb903", null ] ];
sap.ui.define(['sap/ui/core/UIComponent'], function (UIComponent) { "use strict"; var Component = UIComponent.extend("sap.ui.core.tutorial.databinding.15.Component", { metadata: { config: { sample: { iframe: "webapp/index.html", stretch: true, files: [ "webapp/controller/App.controller.js", "webapp/i18n/i18n.properties", "webapp/i18n/i18n_de.properties", "webapp/model/Products.json", "webapp/view/App.view.xml", "webapp/view/ProductExtended.fragment.xml", "webapp/view/ProductSimple.fragment.xml", "webapp/index.html", "ui5.yaml", "package.json" ] } } } }); return Component; });
const webpack = require('webpack') const base = require('./webpack.base.config') const vueConfig = require('./vue-loader.config') const utils = require('./utils') const path = require('path') const HTMLPlugin = require('html-webpack-plugin') const ExtractTextPlugin = require('extract-text-webpack-plugin') const SWPrecachePlugin = require('sw-precache-webpack-plugin') const config = Object.assign({}, base, { resolve: { alias: Object.assign({}, base.resolve.alias, { 'create-api': './create-api-client.js', 'create-route': './create-route-client.js' }), extensions: base.resolve.extensions }, plugins: (base.plugins || []).concat([ // strip comments in Vue code new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development'), 'process.env.VUE_ENV': '"client"', 'process.BROWSER': true }), // generate output HTML new HTMLPlugin({ template: 'src/index.template.html' }) ]) }) if (process.env.NODE_ENV === 'production') { // Use ExtractTextPlugin to extract CSS into a single file // so it's applied on initial render. vueConfig.loaders = utils.cssLoaders({ extract: true }) config.plugins.push( new ExtractTextPlugin('styles.css'), // this is needed in webpack 2 for minifying CSS new webpack.LoaderOptionsPlugin({ minimize: true }), // minify JS new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false }, output: { comments: false } }), new SWPrecachePlugin({ cacheId: 'blog', filename: 'service-worker.js', minify: true, mergeStaticsConfig: true, staticFileGlobs: [ path.join(__dirname, '../dist/static/*.*') ], stripPrefixMulti: { [path.join(__dirname, '../dist/static')]: '/static' }, // add hash to path to force updated dontCacheBustUrlsMatching: false, staticFileGlobsIgnorePatterns: [ /index\.html$/, /\.map$/, /\.css$/, /\.svg$/, /\.eot$/ ], // runtime caching for offline pwa runtimeCaching: [ { // never cache service worker urlPattern: /service-worker.js/, handler: 'networkOnly' }, { // note that this pattern will cache ajax request urlPattern: /(.+\/[^\.]*$)/, handler: 'networkFirst', options: { cache: { maxEntries: 30, name: 'blog-runtime-cache' } } }, { urlPattern: /\.(png|jpg|webp|gif)/, handler: 'cacheFirst', options: { cache: { maxEntries: 20, name: 'blog-picture-cache' } } } ] }) ) } module.exports = config
/** * Copyright (c) 2017-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ // translation object contains all translations for each string in i18n/en.json const CWD = process.cwd(); const fs = require('fs'); const glob = require('glob'); const path = require('path'); let languages; if (fs.existsSync(CWD + '/languages.js')) { languages = require(CWD + '/languages.js'); } else { languages = [ { enabled: true, name: 'English', tag: 'en', }, ]; } const enabledLanguages = languages.filter(lang => lang.enabled); const translation = {languages: enabledLanguages}; const files = glob.sync(CWD + '/i18n/**'); const langRegex = /\/i18n\/(.*)\.json$/; files.forEach(file => { const extension = path.extname(file); if (extension === '.json') { const match = langRegex.exec(file); const language = match[1]; translation[language] = require(file); } }); module.exports = translation;
'use strict'; describe('Controller: azureCreateLoadBalancerCtrl', function () { // load the controller's module beforeEach( window.module( require('./createLoadBalancer.controller') ) ); // Initialize the controller and a mock scope beforeEach(window.inject(function ($controller, $rootScope) { this.$scope = $rootScope.$new(); this.ctrl = $controller('azureCreateLoadBalancerCtrl', { $scope: this.$scope, $modalInstance: { dismiss: angular.noop, result: { then: angular.noop } }, application: {name: 'app'}, loadBalancer: null, isNew: true }); })); it('requires health check path for HTTP/S', function () { var loadBalancer = { healthCheckProtocol: 'HTTP' }; this.$scope.loadBalancer = loadBalancer; expect(this.ctrl.requiresHealthCheckPath()).toBe(true); loadBalancer.healthCheckProtocol = 'HTTPS'; expect(this.ctrl.requiresHealthCheckPath()).toBe(true); loadBalancer.healthCheckProtocol = 'SSL'; expect(this.ctrl.requiresHealthCheckPath()).toBe(false); loadBalancer.healthCheckProtocol = 'TCP'; expect(this.ctrl.requiresHealthCheckPath()).toBe(false); }); it('includes SSL Certificate field when any listener is HTTPS or SSL', function() { var loadBalancer = { listeners: [], }; this.$scope.loadBalancer = loadBalancer; expect(this.ctrl.showSslCertificateIdField()).toBe(false); loadBalancer.listeners.push({ externalProtocol: 'HTTP' }); expect(this.ctrl.showSslCertificateIdField()).toBe(false); loadBalancer.listeners.push({ externalProtocol: 'TCP' }); expect(this.ctrl.showSslCertificateIdField()).toBe(false); loadBalancer.listeners.push({ externalProtocol: 'SSL' }); expect(this.ctrl.showSslCertificateIdField()).toBe(true); loadBalancer.listeners = [{externalProtocol: 'HTTP'}]; loadBalancer.listeners.push({ externalProtocol: 'HTTPS' }); expect(this.ctrl.showSslCertificateIdField()).toBe(true); loadBalancer.listeners = [ { externalProtocol: 'HTTPS' }, { externalProtocol: 'HTTPS' }]; expect(this.ctrl.showSslCertificateIdField()).toBe(true); }); });
import { makeStyles } from '@material-ui/core/styles' export const WarningBannerStyles = makeStyles(() => ({ customPaper: { display: 'flex', backgroundColor: 'rgb(255, 244, 229)', padding: '15px 30px', borderRadius: '4px', alignItems: 'center', }, icon: { fontSize: '1.8em', color: '#ff9800', opacity: '0.9', marginRight: '20px', }, }))
/* * Copyright (C) 2013 salesforce.com, inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ ({ afterRender: function (component, helper) { this.superAfterRender(); helper.afterRenderCarouselPage(component); }, unrender: function (component, helper) { this.superUnrender(); } })
#!/usr/bin/env node var device = require('./nordicserial.json'); var chars = []; for(var service of device.services) for(var char of service.characteristics) chars.push(char.name); for(var char of chars) { console.log(char); //console.log(`<string name="${char}"></string>`); }
// // create base UI tab and root window // var win; win = Titanium.UI.createWindow({ title:'Guide des formations', orientationModes:[Titanium.UI.PORTRAIT] }); // create table view data object var data = [ { title:'TRONC COMMUN', hasChild:true, test:'uvsTC.js' }, { title:'BRANCHES + FILIERES', hasChild:true, test:'uvs_branches.js' }, { title:'MASTERS', hasChild:true, test:'uvsMasters.js' }, { title:'AUTRES', hasChild:true, test:'uvsAutres.js' } ]; var tableview = Titanium.UI.createTableView( { separatorColor:"#000" }); for (var c = 0; c < data.length; c++) { row = Ti.UI.createTableViewRow({ height:60 }); var labelTitle = Ti.UI.createLabel({ text:data[c].title, left:10, top:12, height:35, font:{ fontSize:20 }, color:'#000' }); row.add(labelTitle); row.pageTitle = data[c].title; row.test = data[c].test; tableview.appendRow(row); } var subWin; // create table view event listener tableview.addEventListener('click', function(e) { subWin = Titanium.UI.createWindow({ modal:true, url:e.rowData.test }); subWin.open({ animated:true }); }); // add table view to the window win.add(tableview); Titanium.UI.currentWindow = win; win.open({});
import { Controller } from 'stimulus' import Uppy from '@uppy/core' import AwsS3Multipart from '@uppy/aws-s3-multipart' import Dashboard from '@uppy/dashboard' export default class extends Controller { connect () { this.uploadSubmit = document.querySelector('.upload-submit') this.parentForm = document.getElementById(this.data.get('parentForm')) this.blacklist = JSON.parse(this.data.get('blacklist') || '[]') this.initializeUppy() } initializeUppy () { var uppy = Uppy({ id: 'uppy_' + (new Date().getTime()), autoProceed: true, allowMultipleUploads: true, onBeforeFileAdded: (currentFile, files) => { const filename = currentFile.name const isBlacklisted = this.blacklist.includes(filename) if (isBlacklisted) { uppy.info(`Error: ${filename} already exists in this version`, 'error', 10000) return false } } }) .use(Dashboard, { id: 'dashboard', target: this.element, inline: 'true', showProgressDetails: true, height: 350 }).use(AwsS3Multipart, { companionUrl: '/' }) .on('complete', result => this.onUppyComplete(result)) } onUppyComplete (result) { // this.uploadSubmit.style.visibility='visible' result.successful.forEach(success => { this.parentForm.appendChild(this.createHiddenFileInput(success)) }) } createHiddenFileInput (success) { const inputName = this.data.get('inputName') const uploadedFileData = JSON.stringify({ id: success.uploadURL.match(/\/cache\/([^?]+)/)[1], storage: 'cache', metadata: { size: success.data.size, filename: success.data.name, mime_type: success.data.type } }) const input = document.createElement('input') input.setAttribute('type', 'hidden') input.setAttribute('name', inputName) input.setAttribute('value', uploadedFileData) return input } }
'use strict'; var express = require('express'); var controller = require('./suicideData.controller'); var router = express.Router(); router.get('/', controller.index); module.exports = router;
app.controller('ForumDetail', function ($scope, $location, $rootScope) { $rootScope.pageTitle = "FORUM"; $rootScope.isBack = true; setRootscopeDefault($location, $rootScope); })
/* Create a static build with webpack Thus far, we've been running all of our code with Node.js. Now Redux does work, and can be used on the server or in native applications built with Node.js. However, Redux is primarily used to manage state and client applications. So at this point, we're going to start running our code on the client side in the browser. Now, in order to run our code in the browser. We must first bundle all of our code into a single Javascript file that can be used by the browser, and we'll use web pack along with babel to do that. (https://github.com/iitjee/SteppinsWebDev/blob/master/Modules/webpack.js) */ (in pkg.json) "dependencies": { "redux": "^3.6.0" }, "devDependencies": { "babel-core": "^6.18.0", "babel-loader": "^6.2.6", "babel-preset-latest": "^6.16.0", "babel-preset-stage-0": "^6.16.0", "json-loader": "^0.5.4", "webpack": "^1.13.3", "webpack-dev-server": "^1.16.2" } $npm install (note: just like npm install --save pkgname, remember $npm install --save-dev pkgname) /** webpack and webpack-dev-server Web pack is the tool that we're going to use to actually create our bundle.js file, but we will also use the web pack dev server. The web pack dev server is an express server that we can use to actually host our application. It will help improve our workflow by listening to any changes in our source code and automatically recreating the bundle. Now, with web pack, we need to use loaders. Loaders are the instructions that web pack follows when transpiling our code and * babel-loader and json-loader The first loader that I want to install is the babel loader. This is the loader used by babel to transpile our ES6 and other emerging Javascript syntax into ES5 compatible Javascript. Additionally we want to make sure any JSON documents make it inside of our bundle. I'm going to need to use the JSON loader for that. So I'll install the JSON loader as well, * babel-core (we're no longer usign babel-CLI) and then finally, we've been using the babel CLI. That's come with the babel core, but since we're no longer using it, I want to make sure that the babel core package has been installed, and this includes any core functionality required by babel.creating the bundle. */ (create root/webpack-config.js) module.exports = { entry: "./src/index.js", output: { path: "dist/assets", filename: "bundle.js", publicPath: "assets" //so that the dev server knows where to find this file on the client }, // The next thing I'm going to add is the node for the dev server. This will tell the web pack dev server how it should operate. devServer: { inline: true, contentBase: "./dist", // to tell the dev server is where to serve content from. port: 3000 }, module: { loaders: [ { test: /\.js$/, exclude: /(node_modules)/, loader: ['babel'], query: { //to make sure babel knows which presets to use in order to transpile our code. presets: ['latest', 'stage-0'] } }, { test: /\.json$/, exclude: /(node_modules)/, loader: 'json-loader' //Node.js automatically loads JSON documents, but the client and the browser does not. // So we need to use a loader to make sure any improted JSON gets added to our bundle. So again, we're // going to do another test using a regular expression, and we will test for the JSON extension, and also // we want to make sure that we exclude anything found in the node modules folder, } ] } } //and finally put this in pkg.json "scripts": { "start": "./node_modules/.bin/webpack-dev-server" },
const crypto = require('crypto'); exports.up = function(knex) { const now = new Date(); // Internal user for requests within the backend. // Log in is disabled for this user. const internalUser = { username: '_internal', passwordHash: '', passwordSalt: '', createdAt: now, updatedAt: now, }; // Admin user. const adminPassword = process.env.ADMIN_PASSWORD; const adminPasswordSalt = crypto.randomBytes(24).toString('base64'); const adminPasswordHash = crypto.pbkdf2Sync(adminPassword, adminPasswordSalt, 5000, 72, 'sha512').toString('base64'); const adminUser = { username: 'admin', passwordHash: adminPasswordHash, passwordSalt: adminPasswordSalt, createdAt: now, updatedAt: now, }; const users = [internalUser, adminUser]; return Promise.all(users.map(u => knex('users').insert(u))); }; exports.down = function(knex) { return knex('users').whereIn('username', ['admin', '_internal']).del(); };
define( ({ timeout: "Pārtraukums", highlightLocation: "Izcelt atrašanās vietu", useTracking: "Skatīties atrašanās vietas izmaiņas", warning: "Nepareiza ievade", zoomScale: "Mērogmaiņas skala" }) );
'use strict' module.exports = function (Settings) { // We have 1 settings object we save... const settingsId = 'MasterSettings' const defaultSettings = { id : settingsId, wksModelId: '', wksModelDateTime: '' } Settings.load = function load (cb) { Settings.exists(settingsId, (err, result) => { if (err) { console.log('Settings.load() failed on exists...') } if (result) { // result is false, (doesn't exist, then...) Settings.findById(settingsId, cb) } else { Settings.create(defaultSettings, cb) } }) } Settings.save = function save (doc, cb) { // Reset the ID... // default method is upsert, changes if settingsId doesn't exist let method = Settings.upsert.bind(Settings) let logMessage = `Settings.save(): Updating...` if (doc) { doc.id = settingsId doc.wksModelDateTime = Date.now() } Settings.exists(settingsId, (err, result) => { if (err) { console.log('Settings.save() failed on exists...') } if (!result) { // result is false, (doesn't exist, then...) method = Settings.create.bind(Settings) logMessage = `Settings.save(): Creating...` } console.log(logMessage) method(doc, cb) }) } Settings.remoteMethod('load', { http: { verb: 'get' }, returns: { root: true, type: 'object' } }) Settings.remoteMethod('save', { http: { verb: 'put' }, accepts: [{ arg: 'data', type: 'object', http: { source: 'body' } }], returns: { root: true, type: 'object' } }) }
import { moduleFor, test } from 'ember-qunit'; moduleFor('route:libraries/index', 'Unit | Route | libraries/index', { // Specify the other units that are required for this test. // needs: ['controller:foo'] }); test('it exists', function(assert) { let route = this.subject(); assert.ok(route); });
/* * Copyright (C) 2013 salesforce.com, inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ ({ init: function() { }, handleMouseDown: function(cmp, evt, helper) { helper.handleMouseDown(cmp, evt); }, handleChange: function(cmp, evt, helper) { var advanced = evt.source.get('v.value'); cmp.set('v.advanced', advanced); }, handlePress: function(cmp, evt, helper) { var advanced = cmp.get('v.advanced'); var body = $A.createComponentFromConfig({descriptor: 'markup://aura:unescapedHtml', attributes: {value: '<div class="panel-content">This is the panel</div>'}}) var bigTarget = cmp.find('bigTarget').getElement(); var littleTarget = cmp.find('littleTarget').getElement(); var value = cmp.find('direction').get('v.value'); var pad = parseInt(cmp.find('pad').get('v.value'),10); var padTop = cmp.find('padTop').get('v.value'); var isInside; isInside = cmp.find('isInside').get('v.value'); var panelConfig ={ referenceElement: isInside ? bigTarget : littleTarget, showCloseButton: false, closeOnClickOut: true, useTransition: false, body : body, direction: value, showPointer: false, boundingElement: isInside ? window : bigTarget, inside: isInside, pad: pad, padTop: padTop !== undefined ? parseInt(padTop, 10) : undefined }; if(cmp.find('isAdvanced').get('v.value')) { delete panelConfig.direction; panelConfig.advanced = true; panelConfig.align = cmp.find('align').get('v.value'); panelConfig.targetAlign = cmp.find('targetAlign').get('v.value'); } $A.get('e.ui:createPanel').setParams({ panelType :'panel', visible: true, panelConfig : panelConfig }).fire(); } })
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ // http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating // requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel // MIT license define({ init: (function() { var lastTime = 0; var vendors = ['ms', 'moz', 'webkit', 'o']; for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame'] || window[vendors[x]+'CancelRequestAnimationFrame']; } if (!window.requestAnimationFrame) window.requestAnimationFrame = function(callback, element) { var currTime = new Date().getTime(); var timeToCall = Math.max(0, 16 - (currTime - lastTime)); var id = window.setTimeout(function() { callback(currTime + timeToCall); }, timeToCall); lastTime = currTime + timeToCall; return id; }; if (!window.cancelAnimationFrame) window.cancelAnimationFrame = function(id) { clearTimeout(id); }; }()) });
//# sourceMappingURL=mocha.parallel.d.js.map
/** * @fileoverview Externs for JS-Interpreter. * @externs */ /** * Create a new interpreter. * @param {string|!Object} code Raw JavaScript text or AST. * @param {Function=} opt_initFunc Optional initialization function. Used to * define APIs. When called it is passed the interpreter object and the * global scope object. * @constructor */ var Interpreter = function(code, opt_initFunc) {}; /** * Typedef for JS values. * @typedef {!Interpreter.Object|boolean|number|string|undefined|null} */ Interpreter.Value; /** * Class for a state. * @param {!Object} node AST node for the state. * @param {!Interpreter.Scope} scope Scope object for the state. * @constructor */ Interpreter.State = function(node, scope) {}; /** * Class for an object. * @param {Interpreter.Object} proto Prototype object or null. * @constructor */ Interpreter.Object = function(proto) {}; /** * @type {!Object} */ Interpreter.prototype.OBJECT; /** * @type {!Object} */ Interpreter.prototype.ARRAY; /** * @type {!Object} */ Interpreter.prototype.FUNCTION; /** * @type {!Object} */ Interpreter.prototype.STRING; /** * @type {!Object} */ Interpreter.prototype.BOOLEAN; /** * @type {!Object} */ Interpreter.prototype.value; /** * @type {!Array.<!Interpreter.State>} */ Interpreter.prototype.stateStack; /** * @type {Interpreter.Scope} */ Interpreter.prototype.globalScope; /** * Add more code to the interpreter. * @param {string|!Object} code Raw JavaScript text or AST. */ Interpreter.prototype.appendCode = function(code) {}; /** * Execute one step of the interpreter. * @return {boolean} True if a step was executed, false if no more instructions. */ Interpreter.prototype.step = function() {}; /** * Execute the interpreter to program completion. Vulnerable to infinite loops. * @return {boolean} True if a execution is asynchronously blocked, * false if no more instructions. */ Interpreter.prototype.run = function() {}; /** * Create a new data object based on a constructor's prototype. * @param {Interpreter.Object} constructor Parent constructor function, * or null if scope object. * @return {!Interpreter.Object} New data object. */ Interpreter.prototype.createObject = function(constructor) {}; /** * Create a new interpreted function. * @param {!Object} node AST node defining the function. * @param {!Interpreter.Scope} scope Parent scope. * @return {!Interpreter.Object} New function. */ Interpreter.prototype.createFunction = function(node, scope) {}; /** * Create a new native function. * @param {!Function} nativeFunc JavaScript function. * @param {boolean} isConstructor True if function can be used with 'new'. * @return {!Interpreter.Object} New function. */ Interpreter.prototype.createNativeFunction = function(nativeFunc, opt_constructor) {}; /** * Create a new native asynchronous function. * @param {!Function} asyncFunc JavaScript function. * @return {!Interpreter.Object} New function. */ Interpreter.prototype.createAsyncFunction = function(asyncFunc) {}; /** * Converts from a native JavaScript object or value to a JS-Interpreter object. * Can handle JSON-style values, regular expressions, dates and functions. * Does NOT handle cycles. * @param {*} nativeObj The native JavaScript object to be converted. * @return {Interpreter.Value} The equivalent JS-Interpreter object. */ Interpreter.prototype.nativeToPseudo = function(nativeObj) {}; /** * Converts from a JS-Interpreter object to native JavaScript object. * Can handle JSON-style values, regular expressions, and dates. * Does handle cycles. * @param {Interpreter.Value} pseudoObj The JS-Interpreter object to be * converted. * @param {Object=} opt_cycles Cycle detection (used in recursive calls). * @return {*} The equivalent native JavaScript object or value. */ Interpreter.prototype.pseudoToNative = function(pseudoObj, opt_cycles) {}; /** * Fetch a property value from a data object. * @param {Interpreter.Value} obj Data object. * @param {Interpreter.Value} name Name of property. * @return {Interpreter.Value} Property value (may be undefined). */ Interpreter.prototype.getProperty = function(obj, name) {}; /** * Set a property value on a data object. * @param {!Interpreter.Object} obj Data object. * @param {Interpreter.Value} name Name of property. * @param {Interpreter.Value|ReferenceError} value New property value. * Use ReferenceError if value is handled by descriptor instead. * @param {Object=} opt_descriptor Optional descriptor object. * @return {!Interpreter.Object|undefined} Returns a setter function if one * needs to be called, otherwise undefined. */ Interpreter.prototype.setProperty = function(obj, name, value, opt_descriptor) {};
var puse = require('./puse/index.js'); exports.puse = puse; var foo = require('./foo/index.js'); exports.foo = foo; var puse_md = require('./puse_md/index.js'); exports.puse_md = puse_md;
function paintSprite(ctx,x,y,sprite) { try { ctx.drawImage(sprite,x,y); } catch(e) { ctx.restore(); } } function paintSpriteMir(ctx,x,y,sprite) { ctx.save(); ctx.scale(-1,1); try{ ctx.drawImage(sprite,-x,y); } catch (e) { } ctx.restore(); } var deathSprite = true; function preDraw() { if (sceneCounter<320) { sceneCounter++; ctx.drawImage(imgLevel,0,0); ctx.fillStyle="#d00"; ctx.font = "normal 32pt VT323"; ctx.fillText(lvlMsg,320-(lvlMsg.length*8),32); } else { sceneCounter=0; gameState="play"; } } function redraw() { ctx.drawImage(bg,0,0); ctx.translate(300-player.x,height-256-player.y); //Платформы // //ctx.fillStyle = "#abf"; for (var i = 0;i < platforms.length; i++) { p = platforms[i]; if ( (p.x>player.x-400)&&(p.y>player.y-300)&& (p.x<player.x+400)&&(p.y<player.y+400) ) paintSprite(ctx,p.x,p.y,brick); // ctx.fillRect(p.x,p.y,p.width+1,p.height+1); } //Экстра-объекты(финиши и т.д.) for (var i=0;i<xtra.length;i++) { x=xtra[i]; p=x; if ( (p.x>player.x-400)&&(p.y>player.y-300)&& (p.x<player.x+400)&&(p.y<player.y+400) ) { if (x.type=="switch") { if (x.state) paintSpriteMir(ctx,x.x+32,x.y,grpX_switch); else paintSprite(ctx,x.x,x.y,grpX_switch); } if (x.type=="d") { paintSprite(ctx,x.x,x.y,grpX_D); } if (x.type=="f") { paintSprite(ctx,x.x,x.y,grpX_F); if (gameState=="win") paintSprite(ctx,x.x-180,x.y-64,saw); } if (x.type=="+") { paintSprite(ctx,x.x,x.y,grpX_Crs); } if (x.type=="-") { paintSprite(ctx,x.x,x.y,grpX_Mns); } if (x.type=="she") { paintSprite(ctx,x.x,x.y-10,grp_She); } if (x.type=="arrow") { if (x.direction=="left") paintSprite(ctx,x.x,x.y,owl_left); if (x.direction=="right") paintSprite(ctx,x.x,x.y,owl_right); if (x.direction=="up") paintSprite(ctx,x.x,x.y,owl_up); if (x.direction=="down") paintSprite(ctx,x.x,x.y,owl_down); } } } //Монетки for (var i=0;i<money.length;i++) { m = money[i];p=m; if ( (p.x>player.x-400)||(p.y>player.y-300)|| (p.x<player.x+400)||(p.y<player.y+400) ) paintSprite(ctx,m.x,m.y,grpMoney); } //Враги for (var i=0;i<enemies.length;i++) { e=enemies[i]; p=e; if ( (p.x>player.x-400)&&(p.y>player.y-300)&& (p.x<player.x+400)&&(p.y<player.y+400) ) { if (e.type=="spikes") { paintSprite(ctx,e.x,e.y,grpE_spikes); } if (e.type=="walrus") { e.step++; if (e.step>40) e.step=0; if (e.step<20) { if (e.velX<0) { paintSprite(ctx,e.x,e.y,grpE_walrus); } else { paintSpriteMir(ctx,e.x+142,e.y,grpE_walrus); } } else if (e.step<40) { if (e.velX<0) { paintSprite(ctx,e.x,e.y,grpE_walrus_w); } else { paintSpriteMir(ctx,e.x+142,e.y,grpE_walrus_w); } } } if (e.type=="crab") { if (e.state=="walk") { if (e.step<20) paintSprite(ctx,e.x,e.y,grpE_crab); else { if (e.step>40) e.step=0; paintSprite(ctx,e.x,e.y,grpE_crabWalk); } } if (e.state=="attack") { if (e.step<40) paintSprite(ctx,e.x,e.y,grpE_crabAttack); else if (e.step<50) paintSprite(ctx,e.x,e.y,grpE_crab); else if (e.step<70) paintSprite(ctx,e.x,e.y,grpE_crabAttack); else if (e.step<90) paintSprite(ctx,e.x,e.y,grpE_crab); else { e.step=0; paintSprite(ctx,e.x,e.y,grpE_crabAttack); } } } if (e.type=="ball") { paintSprite(ctx,e.x,e.y,grpE_ball); } if (e.type=="seal") { if (e.velX<0) paintSprite(ctx,e.x,e.y,grpE_seal); else paintSpriteMir(ctx,e.x+64,e.y,grpE_seal); } } } //Игрок p = player; if (p.dead) { if (sceneCounter%20==0) deathSprite=!deathSprite; if (deathSprite == true) paintSprite(ctx,p.x,p.y+5,grpPlayer_ded); else paintSpriteMir(ctx,p.x+32,p.y+5,grpPlayer_jd); } else if (!p.mirror) { if (!p.jump) { if (p.step<5) paintSprite(ctx,p.x,p.y,grpPlayer_s1); else { paintSprite(ctx,p.x,p.y,grpPlayer_rl); if (p.step>10) p.step=0; } } else if (p.velY>0) paintSprite(ctx,p.x,p.y,grpPlayer_jd); if (p.velY<0) paintSprite(ctx,p.x,p.y,grpPlayer_ju); } else { if (!p.jump) { if (p.step<5) paintSpriteMir(ctx,p.x+p.width,p.y,grpPlayer_s1); else { paintSpriteMir(ctx,p.x+p.width,p.y,grpPlayer_rl); if (p.step>10) p.step=0; } } else if (p.velY>0) paintSpriteMir(ctx,p.x+p.width,p.y,grpPlayer_jd); if (p.velY<0) paintSpriteMir(ctx,p.x+p.width,p.y,grpPlayer_ju); } ctx.translate(player.x-300,player.y+256-height); }
let main = module.exports = { init, logMessage, logErrorMessage, win: null } const electron = require('electron') const config = require('../../config') const log = require('../../lib/log') const getMenu = require('../../lib/menu-template') function init(windowType) { if (main.win) { main.win.webContents.send('selected-window', windowType) if (!main.win.isVisible()) { main.win.show() } if (main.win.isMinimized()) { main.win.restore() } return main.win.focus() } let win = main.win = new electron.BrowserWindow({ backgroundColor: '#ECECEC', center: true, fullscreen: false, icon: config.APP_ICON, maximizable: false, minimizable: false, resizable: false, title: config.APP_WINDOW_TITLE, useContentSize: true, width: 800, height: 400, show: false }) win.loadURL(config.WINDOW_MAIN) win.setMenu(electron.Menu.buildFromTemplate(getMenu())) win.once('closed', (e) => main.win = null) win.webContents.on('did-frame-finish-load', ()=> { win.webContents.send('selected-window', windowType) }) win.once('ready-to-show', () => win.show()) } function logMessage(msg) { if (main.win) { main.win.webContents.send('log-message', msg) } } function logErrorMessage(msg) { if (main.win) { main.win.webContents.send('log-error-message', msg) } }
'use strict'; var common = require('../common'); var assert = require('assert'); var os = require('os'); switch (process.argv[2]) { case 'child': return child(); case undefined: return parent(); default: throw new Error('wtf? ' + process.argv[2]); } function parent() { var spawn = require('child_process').spawn; var child = spawn(process.execPath, [__filename, 'child']); var output = ''; child.stderr.on('data', function(c) { output += c; }); child.stderr.setEncoding('utf8'); child.stderr.on('end', function() { assert.equal(output, 'I can still debug!' + os.EOL); console.log('ok - got expected message'); }); child.on('exit', function(c) { assert(!c); console.log('ok - child exited nicely'); }); } function child() { // even when all hope is lost... process.nextTick = function() { throw new Error('No ticking!'); }; var stderr = process.stderr; stderr.write = function() { throw new Error('No writing to stderr!'); }; process._rawDebug('I can still %s!', 'debug'); }
import { HTTPError } from 'utils/APIConnector' import * as AWS from 'utils/AWS' import * as Config from 'utils/Config' import * as Data from 'utils/Data' import { mkSearch } from 'utils/NamedRoutes' import { PreviewData, PreviewError } from '../types' import * as utils from './utils' export const detect = utils.extIs('.pdf') async function loadPdf({ endpoint, sign, handle }) { try { const url = sign(handle) const search = mkSearch({ url, input: 'pdf', output: 'raw', size: 'w1024h768', }) const r = await fetch(`${endpoint}/thumbnail${search}`) if (r.status >= 400) { const text = await r.text() throw new HTTPError(r, text) } const firstPageBlob = await r.blob() return PreviewData.Pdf({ handle, firstPageBlob }) } catch (e) { if (e instanceof HTTPError && e.json?.error === 'Forbidden') { if (e.json.text?.match(utils.GLACIER_ERROR_RE)) { throw PreviewError.Archived({ handle }) } throw PreviewError.Forbidden({ handle }) } // eslint-disable-next-line no-console console.warn('error loading pdf preview', { ...e }) // eslint-disable-next-line no-console console.error(e) throw e } } export const Loader = function PdfLoader({ handle, children }) { const endpoint = Config.use().binaryApiGatewayEndpoint const sign = AWS.Signer.useS3Signer() const data = Data.use(loadPdf, { endpoint, sign, handle }) return children(utils.useErrorHandling(data.result, { handle, retry: data.fetch })) }
import React from 'react'; import {render} from 'react-dom'; class StaffList extends React.Component { render() { console.log(this.props); var stafflist = Object.values(this.props.staffs).map(staffObject => <Staff staffObject = {JSON.parse(staffObject)}/> ); return( <table> <thead> <tr> <th><center>IDNumber</center></th> <th><center>PersonName</center></th> <th><center>ShiftHours</center></th> <th><center>Position</center></th> </tr> </thead> <tbody> {stafflist} </tbody> </table> ); } } var ControllerButton = { deleteStaff: function(id){ $.ajax({ method: "DELETE", async: false, url: "./api/staff/" + id, }).done(function(msg) { console.log(msg); render(<View />, document.getElementById('target')); }); } }; class Staff extends React.Component { render() { return( <tr id={"staff-"+this.props.staffObject['IDNumber']}> <td><center>{this.props.staffObject['IDNumber']}</center></td> <td><center>{this.props.staffObject['PersonName']}</center></td> <td><center>{this.props.staffObject['ShiftHours']}</center></td> <td><center>{this.props.staffObject['Position']}</center></td> <td><center><a onClick={ControllerButton.deleteStaff.bind(this, this.props.staffObject['IDNumber'])}>Delete</a></center></td> </tr> ); } } class View extends React.Component { getStaffList() { var list = {}; $.ajax({ method: "GET", async: false, url: "./api/staff", }).done(function(msg) { console.log(msg); list = JSON.parse(msg); }); return list; } render() { return( <StaffList staffs = {this.getStaffList()} /> ); } } render(<View />, document.getElementById('target'));
import React from 'react'; import { Box, InfiniteScroll, Text } from 'grommet'; const allItems = Array(240) .fill() .map((_, i) => i + 1); export const Height = () => ( // Uncomment <Grommet> lines when using outside of storybook // <Grommet theme={...}> <Box> <InfiniteScroll items={allItems}> {(item) => ( <Box key={item} height={item <= 25 ? 'xsmall' : 'xxsmall'} pad="medium" border={{ side: 'bottom' }} align="center" > <Text>item {item}</Text> </Box> )} </InfiniteScroll> </Box> // </Grommet> ); Height.storyName = 'Variable item height'; Height.parameters = { chromatic: { disable: true }, }; export default { title: 'Utilities/InfiniteScroll/Variable item height', };
'use strict'; module.exports = function(Chaincodeinstantiate) { };
/* Latvia +*/ /*global $ */ $.ig = $.ig || {}; $.ig.regional = $.ig.regional || {}; $.ig.regional.lv = { monthNames: ['Janvāris', 'Februāris', 'Marts', 'Aprīlis', 'Maijs', 'Jūnijs', 'Jūlijs', 'Augusts', 'Septembris', 'Oktobris', 'Novembris', 'Decembris'], monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jūn', 'Jūl', 'Aug', 'Sep', 'Okt', 'Nov', 'Dec'], dayNames: ['svētdiena', 'pirmdiena', 'otrdiena', 'trešdiena', 'ceturtdiena', 'piektdiena', 'sestdiena'], dayNamesShort: ['svt', 'prm', 'otr', 'tre', 'ctr', 'pkt', 'sst'], datePattern: 'yyyy.MM.dd', dateLongPattern: 'dddd, yyyy. g\\a\\d\\a d. MMMM', dateTimePattern: 'yyyy.MM.dd HH:mm', timePattern: 'HH:mm', timeLongPattern: 'HH:mm:ss', // numericDecimalSeparator: ',', numericGroupSeparator: ' ', numericMaxDecimals: 2, currencyPositivePattern: 'n $', currencyNegativePattern: '-n $', currencySymbol: 'Ls', currencyDecimalSeparator: ',', currencyGroupSeparator: ' ', percentDecimalSeparator: ',', percentGroupSeparator: ' ' }; if ($.ig.setRegionalDefault) { $.ig.setRegionalDefault('lv'); }
function Controller() { require("alloy/controllers/BaseController").apply(this, Array.prototype.slice.call(arguments)); this.__controllerPath = "FamilyWallet/EmptyMembers"; arguments[0] ? arguments[0]["__parentSymbol"] : null; arguments[0] ? arguments[0]["$model"] : null; arguments[0] ? arguments[0]["__itemTemplate"] : null; var $ = this; var exports = {}; $.__views.EmptyMembers = Ti.UI.createView({ id: "EmptyMembers" }); $.__views.EmptyMembers && $.addTopLevelView($.__views.EmptyMembers); $.__views.containerLabel = Ti.UI.createView({ height: Ti.UI.SIZE, width: Ti.UI.SIZE, top: "30%", id: "containerLabel" }); $.__views.EmptyMembers.add($.__views.containerLabel); $.__views.blueText = Ti.UI.createImageView({ width: 210, height: 159, image: "/images/txt_family_wallet.png", id: "blueText" }); $.__views.containerLabel.add($.__views.blueText); $.__views.bottomTitle = Ti.UI.createView({ layout: "vertical", height: Ti.UI.SIZE, width: Ti.UI.SIZE, bottom: 80, left: 70, id: "bottomTitle" }); $.__views.EmptyMembers.add($.__views.bottomTitle); $.__views.__alloyId14 = Ti.UI.createLabel({ color: "#505050", font: { fontSize: 14 }, left: 0, text: "Start adding", id: "__alloyId14" }); $.__views.bottomTitle.add($.__views.__alloyId14); $.__views.__alloyId15 = Ti.UI.createLabel({ color: "#505050", font: { fontSize: 14 }, left: 0, text: "a family member", id: "__alloyId15" }); $.__views.bottomTitle.add($.__views.__alloyId15); $.__views.arrowImage = Ti.UI.createImageView({ image: "/images/ic_arrow_family_wallet.png", left: 20, bottom: 60, width: 46, height: 40, id: "arrowImage" }); $.__views.EmptyMembers.add($.__views.arrowImage); exports.destroy = function() {}; _.extend($, $.__views); var APP = require("/core"); $.bottomTitle.bottom = APP.fixSizeAds($.bottomTitle.bottom); $.arrowImage.bottom = APP.fixSizeAds($.arrowImage.bottom); _.extend($, exports); } var Alloy = require("alloy"), Backbone = Alloy.Backbone, _ = Alloy._; module.exports = Controller;
sap.ui.define([ 'sap/ui/core/mvc/Controller', 'sap/ui/model/json/JSONModel' ], function(Controller, JSONModel) { "use strict"; return Controller.extend("sap.m.sample.TimePickerValueState.TimePicker", { onInit: function () { var oModel, sText = "TimePicker with valueState ", aData = [ { label: sText + "None", valueState: "None"}, { label: sText + "Information", valueState: "Information"}, { label: sText + "Success", valueState: "Success"}, { label: sText + "Warning and long valueStateText", valueState: "Warning", valueStateText: "Warning message. This is an extra long text used as a warning message. It illustrates how the text wraps into two or more lines without truncation to show the full length of the message."}, { label: sText + "Error", valueState: "Error"} ]; oModel = new JSONModel({ modelData: aData }); this.getView().setModel(oModel); } }); });
'use strict'; import AuthorizationStorage from '../authorization/AuthorizationStorage'; import Router from '../../services/Router'; import * as es_US from '../../translates/en_US'; /** * Handle on login button press */ function handleOnLoginPress() { AuthorizationStorage.destroy(); Router.push('initial'); } export default { handle(error) { if (error.code === 401) { AuthorizationStorage.destroy(); return Router.push('initial'); } } };
'use strict'; const fs = require('fs') , path = require('path') , expect = require('chai').expect , co = require('co') , nedb = require('nedb') , wrapper = require('co-nedb'); const sdeFixture = require('./fixtures/sde.json'); const sdeDbFile = path.join(__dirname, '../../lib/db/staticData.db'); const sdeMapFixture = require('./fixtures/sde_map.json'); const sdeMapDbFile = path.join(__dirname, '../../lib/db/universeData.db'); describe('CCP Item SDE', () => { var db; before(() => { db = wrapper(new nedb({ filename: sdeDbFile, autoload: true })); }); after(() => { db = undefined; }); it('should load', () => { expect(db).to.be.an('object'); expect(db.filename).to.equal(sdeDbFile); }); it('should let us query the collection', () => { expect(db).to.respondTo('findOne'); }); it('should correctly find a thing', () => { co(function * () { let thing = yield db.findOne({ id: 583 }); return expect(thing).to.equal(sdeFixture); }); }); }); describe('CCP Map SDE', () => { var db; before(() => { db = wrapper(new nedb({ filename: sdeMapDbFile, autoload: true })); }); after(() => { db = undefined; }); it('should load', () => { expect(db).to.be.an('object'); expect(db.filename).to.equal(sdeMapDbFile); }); it('should let us query the collection', () => { expect(db).to.respondTo('findOne'); }); it('should correctly find a celestial thing', () => { co(function * () { let mapData = yield db.findOne({ itemID: 40151384 }); return expect(mapData).to.equal(sdeMapFixture); }); }); });
/** * @author Mike Hill * @version 1.0.0 (2014/09/30) * * This plugin attaches tooltips to grid cells. */ Ext.define('Ext.ux.GridTooltips.grid.plugin.GridTooltips', { extend: 'Ext.plugin.Abstract', alias: 'plugin.gridtooltips', /* * Internal */ tooltipEl: null, /* * Configurable */ // Tooltip configuration delegate: '.x-grid-cell-inner', showDelay: 100, dismissDelay: 0, // Disable automatic hiding anchor: 'top', trackMouse: false, renderTo: Ext.getBody(), // Plugin configuration /** * If set to true, show tooltips only when contents are overflowing. */ overflowOnly: true, /** * Initializes the tooltips plugin. */ init: function (grid) { grid.mon(grid, 'afterrender', this.createTooltip, this, { single: true }); }, /** * Creates the configured tooltip which will be used for the grid. */ createTooltip: function (grid) { var me; var tooltip; me = this; tooltip = Ext.create('Ext.tip.ToolTip', { target: grid.view.getEl(), delegate: me.delegate, showDelay: me.showDelay, dismissDelay: me.dismissDelay, anchor: me.anchor, trackMouse: me.trackMouse, renderTo: me.renderTo }); // Attach listener to manipulate tooltip contents tooltip.mon(tooltip, 'beforeshow', me.showTooltip, me); // Store internally me.tooltipEl = tooltip; }, /** * Evaluates the tooltip properties before it is shown. This function * determines whether the tooltip should be shown. If the tooltip is to be * shown, then this function also sets the contents of the tooltip. */ showTooltip: function (tooltip, listeners) { var me; var showTooltip; var target, clientWidth, scrollWidth; me = this; target = tooltip.anchorTarget; showTooltip = true; if (me.overflowOnly === true) { // Show tooltip only if the target's contents are overflowing /* * TODO: (Tested in Chrome 37) When clientWidth is equal to the * minimum scrollWidth, CSS text-overflow: ellipsis will still * display an ellipsis. * * For example, consider the scenario where clientWidth = 50 and * scrollWidth = 100. In this case, there is clearly overflow and * this method will work. However, if the visible width is then * expanded so that clientWidth == scrollWidth == 100, then an * ellipsis will be shown, but this method will not display a * tooltip since clientWidth is not less than scrollWidth. If * clientWidth and scrollWidth are brought above 100 (scrollWidth's * minimum value) then all functionality will again be as expected. * * Try to find a workaround for this one failure-case. */ clientWidth = target.clientWidth; scrollWidth = target.scrollWidth; showTooltip = (scrollWidth > clientWidth); } if (showTooltip === true) { // Set tooltip contents to the target's text tooltip.update(target.innerText); } return showTooltip; }, /** * Deconstructs objects created by this plugin. */ destroy: function () { var me; me = this; // Delete/dereference tooltip me.tooltipEl.destroy(); me.tooltipEl = null; me.callParent(arguments); } });
/** * Resend the invitation email for sharing a BitGo wallet * * Copyright 2019, BitGo, Inc. All Rights Reserved. */ const Promise = require('bluebird'); const BitGoJS = require('bitgo'); const bitgo = new BitGoJS.BitGo({ env: 'test' }); // TODO: set your access token here const accessToken = null; // TODO: set your wallet share ID here // you can get this using the listShares() convienence method const walletShareId = null; const coin = 'tltc'; Promise.coroutine(function *() { bitgo.authenticateWithAccessToken({ accessToken }); const shareResult = yield bitgo.coin(coin).wallets().resendShareInvite({ walletShareId }); console.log('Share invite resent successfully'); console.dir(shareResult); })();
var dir_260e49eb67c1e3ad3e46dff2748d9375 = [ [ "fhxamarinandroidsdk", "dir_4e2eb0eb7797860c496c1c0ee1737d07.html", "dir_4e2eb0eb7797860c496c1c0ee1737d07" ], [ "src", "dir_53054deadd112b1ca4a356d995ee6fa9.html", "dir_53054deadd112b1ca4a356d995ee6fa9" ] ];
import React from 'react'; import ReactDOM from 'react-dom'; import App from './app'; import { BrowserRouter as Router } from 'react-router-dom'; import './index.css'; // import 'bootstrap/dist/css/bootstrap-theme.min.css'; ReactDOM.render( <Router > <App /> </Router>, document.getElementById('root') );
'use strict'; /* global THREE,Modernizr */ angular.module('artpopApp') .directive('webglDetector', function (X3) { function Detector(){ X3.apply(this,arguments); } Detector.prototype = Object.create(X3.prototype); var app = new Detector(); window.apwgl = app; app.init(); function configCamera(){ app.camera.position.z = 20; } configCamera(); function addObject(){ //onetime use only. var material = new THREE.MeshLambertMaterial({ color: 0xff0000, wireframe: true, wireframeLinewidth: 2, side: THREE.BackSide, transparent: true, opacity: 0.9, }); var inner = new THREE.Mesh( new THREE.IcosahedronGeometry( 10, 2 ), material ); app.scene.add(inner); app.updateStack.push(function(){ inner.rotation.z += 0.004; inner.rotation.x += 0.004; inner.rotation.y += 0.004; inner.material.color.offsetHSL(0.001,0.0,0); }); } addObject(); function addLight(){ var lightBack = new THREE.DirectionalLight( 0xffffff, 5, 1000 ); lightBack.position.set( 0, 0, 400 ); app.scene.add( lightBack ); app.updateStack.push(function(){ lightBack.rotation.z += 0.004; lightBack.rotation.x += 0.004; lightBack.rotation.y += 0.004; lightBack.color.offsetHSL(0.001,0.0,0); }); } addLight(); return { template: '<div class="gl-canvas-container"></div>', restrict: 'E', transclude: true, //link function is not di. link: function($scope, $element, $transclude){ var container = $element[0].querySelector('.gl-canvas-container'); if (Modernizr.webgl){ app.reconfig($scope, $element, container); }else{ container.appendChild($transclude()); } } }; }); /**/