text
stringlengths
2
6.14k
'use strict'; var React = require('react'), coreViews = require('../../core/views'), mixins = require('../mixins'); var Map = React.createBackboneClass({ mixins: [ mixins.LayersMixin() ], componentDidMount: function() { this.mapView = new coreViews.MapView({ el: '#map' }); }, componentWillUnmount: function() { this.mapView.destroy(); }, componentDidUpdate: function() { var model = this.getActiveLayer(); this.mapView.clearLayers(); if (model) { this.mapView.addLayer(model.getLeafletLayer(), model.getBounds()); this.mapView.fitBounds(model.getBounds()); } }, render: function() { return ( <div id="map-container"> <div id="map"></div> </div> ); } }); module.exports = Map;
const FormatNumber = (value) => { return value.toLocaleString("en-GB", { minimumFractionDigits: 2 }); }; export default FormatNumber;
// This file is part of MLDB. Copyright 2016 mldb.ai inc. All rights reserved. var mldb = require('mldb') var unittest = require('mldb/unittest') function expectEmpty(query) { var expected = []; var resp = mldb.query(query); mldb.log(resp); unittest.assertEqual(resp, expected); } function expectFound(query) { var expected = [ { "columns" : [ [ "x", 1, "-Inf" ] ], "rowName" : "\"msnbc.com\"" } ]; var resp = mldb.query(query); mldb.log(resp); unittest.assertEqual(resp, expected); } // Defeat optimization to use slow path expectEmpty("select * from (select 1 as x named 'msnbc.com') where rowName() + '' = 'msnbc.com'"); // Fast path for rowName = ... expectEmpty("select * from (select 1 as x named 'msnbc.com') where rowName() = 'msnbc.com'"); // Fast path for rowName = ... expectFound("select * from (select 1 as x named 'msnbc.com') where rowName() = '\"msnbc.com\"'"); // Check no exception when invalid rowName (unbalanced quotes) expectEmpty("select * from (select 1 as x named 'msnbc.com') where rowName() = '\"msnbc.com'"); // Check no exception when invalid rowName (empty) expectEmpty("select * from (select 1 as x named 'msnbc.com') where rowName() = ''"); // Check in (...) expectFound("select * from (select 1 as x named 'msnbc.com') where rowName() in ('\"msnbc.com\"')"); expectFound("select * from (select 1 as x named 'msnbc.com') where rowName() in ('\"msnbc.com\"', 'msnbc.com', '\"')"); expectEmpty("select * from (select 1 as x named 'msnbc.com') where rowName() in ('msnbc.com', '\"')"); expectFound("select * from (select 1 as x named 'msnbc.com') where true and rowName() != 'msnbc.com'"); expectEmpty("select * from (select 1 as x named 'msnbc.com') where rowName() != '\"msnbc.com\"' + ''"); expectEmpty("select * from (select 1 as x named 'msnbc.com') where true and rowName() != '\"msnbc.com\"'"); // rowPath() expectFound("select * from (select 1 as x named 'msnbc.com') where rowPath() = 'msnbc.com'"); expectEmpty("select * from (select 1 as x named 'msnbc.com') where rowPath() = '\"msnbc.com\"'"); expectFound("select * from (select 1 as x named 'msnbc.com') where rowPath() = 'msnbc.com' + ''"); // Check no exception when invalid rowPath (empty) expectEmpty("select * from (select 1 as x named 'msnbc.com') where rowPath() = ''"); // Check in (...) expectFound("select * from (select 1 as x named 'msnbc.com') where rowPath() in ('msnbc.com')"); expectFound("select * from (select 1 as x named 'msnbc.com') where rowPath() in ('msnbc.com', null, [ 1.2, 3.4, 5.6])"); expectEmpty("select * from (select 1 as x named 'msnbc.com') where true and rowPath() != 'msnbc.com'"); expectFound("select * from (select 1 as x named 'msnbc.com') where rowPath() != '\"msnbc.com\"'"); // Tests to add // rowName() in (keys of xxx) // rowName() in (values of xxx) // rowPath() in (keys of xxx) // rowPath() in (values of xxx) // Non-canonical rowName() should return no rows, eg '...' should not match "".""."" since we match as strings on rowName, not structured "success"
import React, { Component } from 'react'; import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'; import { connectStyle } from 'native-base-shoutem-theme'; import mapPropsToStyleNames from '../Utils/mapPropsToStyleNames'; class Content extends Component { render() { return ( <KeyboardAwareScrollView automaticallyAdjustContentInsets={false} resetScrollToCoords={(this.props.disableKBDismissScroll) ? null : { x: 0, y: 0 }} ref={(c) => { this._scrollview = c; this._root = c; }} {...this.props} > {this.props.children} </KeyboardAwareScrollView> ); } } Content.propTypes = { ...KeyboardAwareScrollView.propTypes, style: React.PropTypes.object, padder: React.PropTypes.bool, disableKBDismissScroll: React.PropTypes.bool, enableResetScrollToCoords: React.PropTypes.bool }; const StyledContent = connectStyle('NativeBase.Content', {}, mapPropsToStyleNames)(Content); export { StyledContent as Content, };
/** * Malay translation for bootstrap-datetimepicker * Ateman Faiz <noorulfaiz@gmail.com> */ ;(function ($) { $.fn.datetimepicker.dates['ms'] = { days: ["Ahad", "Isnin", "Selasa", "Rabu", "Khamis", "Jumaat", "Sabtu", "Ahad"], daysShort: ["Aha", "Isn", "Sel", "Rab", "Kha", "Jum", "Sab", "Aha"], daysMin: ["Ah", "Is", "Se", "Ra", "Kh", "Ju", "Sa", "Ah"], months: ["Januari", "Februari", "Mac", "April", "Mei", "Jun", "Julai", "Ogos", "September", "Oktober", "November", "Disember"], monthsShort: ["Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Ogo", "Sep", "Okt", "Nov", "Dis"], today: "Hari Ini", suffix: [], meridiem: [] }; }(jQuery));
/* * Copyright 2020 Verizon Media * * 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 Header from '../components/header/Header'; import UserDomains from '../components/domain/UserDomains'; import API from '../api.js'; import styled from '@emotion/styled'; import Head from 'next/head'; import Search from '../components/search/Search'; import RequestUtils from '../components/utils/RequestUtils'; import Error from './_error'; import createCache from '@emotion/cache'; import { CacheProvider } from '@emotion/react'; const HomeContainerDiv = styled.div` flex: 1 1; `; const HomeContentDiv = styled.div` align-items: center; height: 100%; justify-content: flex-start; width: 100%; display: flex; flex-direction: column; `; const Logo = ({ className }) => ( <img src='/static/athenz-logo.png' className={className} /> ); const LogoStyled = styled(Logo)` height: 100px; width: 100px; `; const MainLogoDiv = styled.div` padding-top: 20px; `; const DetailsDiv = styled.div` align-items: flex-start; line-height: 1.3; padding: 20px 0; text-align: center; width: 650px; `; const SearchContainerDiv = styled.div` padding: 20px 0 0 0; width: 600px; `; const AppContainerDiv = styled.div` align-items: stretch; flex-flow: row nowrap; height: 100%; display: flex; justify-content: flex-start; `; const MainContentDiv = styled.div` flex: 1 1 calc(100vh - 60px); overflow: hidden; font: 300 14px HelveticaNeue-Reg, Helvetica, Arial, sans-serif; `; const StyledAnchor = styled.a` color: #3570f4; text-decoration: none; cursor: pointer; `; export default class PageHome extends React.Component { static async getInitialProps({ req }) { let api = API(req); let reload = false; let error = null; const domains = await Promise.all([ api.listUserDomains(), api.getHeaderDetails(), api.getPendingDomainMembersList(), ]).catch((err) => { let response = RequestUtils.errorCheckHelper(err); reload = response.reload; error = response.error; return [{}, {}, {}]; }); return { api, reload, error, domains: domains[0], headerDetails: domains[1], pending: domains[2], nonce: req.headers.rid, }; } constructor(props) { super(props); this.api = props.api || API(); this.cache = createCache({ key: 'athenz', nonce: this.props.nonce, }); } render() { if (this.props.reload) { window.location.reload(); return <div />; } if (this.props.error) { return <Error err={this.props.error} />; } return ( <CacheProvider value={this.cache}> <div data-testid='home'> <Head> <title>Athenz</title> </Head> <Header showSearch={false} headerDetails={this.props.headerDetails} pending={this.props.pending} /> <MainContentDiv> <AppContainerDiv> <HomeContainerDiv> <HomeContentDiv> <MainLogoDiv> <LogoStyled /> </MainLogoDiv> <DetailsDiv> <span> Athenz is an open source platform which provides secure identity in the form of X.509 certificate to every workload for service authentication (mutual TLS authentication) and provides fine-grained Role Based Access Control (RBAC) for authorization. </span> <StyledAnchor rel='noopener' target='_blank' href='https://git.ouroath.com/pages/athens/athenz-guide/' > Learn more </StyledAnchor> </DetailsDiv> <SearchContainerDiv> <Search /> </SearchContainerDiv> </HomeContentDiv> </HomeContainerDiv> <UserDomains domains={this.props.domains} api={this.api} /> </AppContainerDiv> </MainContentDiv> </div> </CacheProvider> ); } }
(function () { 'use strict'; angular .module('brew_journal.layout', [ 'brew_journal.layout.controllers' ]); angular .module('brew_journal.layout.controllers', []); })();
import React from 'react'; import PropTypes from 'prop-types'; import createReactClass from 'create-react-class'; import _ from 'lodash'; import { api } from './Api'; import { formatJSON } from './utils'; export default createReactClass({ propTypes: { params: PropTypes.object, }, getInitialState() { return { data_container: null, }; }, componentDidMount() { const id = this.props.params.id; const payload = { aggregate: [ { $match: { _id: id } }, ], }; api.getDataContainers(payload) .then(response => this.setState({ data_container: _.get(response, 'data_containers[0]', {}) })); }, render() { if (this.state.data_container == null) { return (<h1>Loading Data Container<span className="loading" /></h1>); } if (_.isEmpty(this.state.data_container)) { return (<div className="alert alert-error">Data not available</div>); } return ( <div> <h1>Data Container</h1> <pre className="scroll"> {formatJSON(this.state.data_container)} </pre> </div> ); }, });
(function() { 'use strict'; function HomeController($scope, $q, $timeout) { var self = this; self.time = 50; self.message = "Mensagem para mostrar"; var promiseTimeout; var deferredToast; self.mostrarToast = function() { esconderToast(); deferredToast = $q.defer(); deferredToast.promise.then(toastResolved, toastRejected); self.activeShow = true; self.mensagemAtual = self.message; promiseTimeout = $timeout(timeoutToast, self.time * 1000); }; function timeoutToast() { deferredToast.reject(); esconderToast(); } function esconderToast() { if (promiseTimeout) { $timeout.cancel(promiseTimeout); promiseTimeout = undefined; } self.activeShow = false; } self.clickBotaoFechar = function() { if (deferredToast) { // verifica pra evitar problema com duplo clique rápido deferredToast.resolve(); deferredToast = undefined; } esconderToast(); }; self.clickNoToast = function() { if (deferredToast) { timeoutToast(); // clicar no toast equivale ao timeout } }; function toastResolved() { console.log('Resolved'); self.ultimaResposta = 'Resolved'; } function toastRejected() { console.log('Rejected'); self.ultimaResposta = 'Rejected'; } } angular .module('hotMilhasApp') .controller('HomeController', ['$scope', '$q', '$timeout', HomeController]); })();
'use strict'; describe('GodHasAPlan.version module', function() { beforeEach(module('GodHasAPlan.version')); describe('interpolate filter', function() { beforeEach(module(function($provide) { $provide.value('version', 'TEST_VER'); })); it('should replace VERSION', inject(function(interpolateFilter) { expect(interpolateFilter('before %VERSION% after')).toEqual('before TEST_VER after'); })); }); });
var BinaryWriter = require('./BinaryWriter'); function LeaderboardPosition(position) { this.place = position } module.exports = LeaderboardPosition; LeaderboardPosition.prototype.build = function() { var buf = new BinaryWriter(); buf.writeUInt8(0x30); buf.writeUInt16(this.place); return buf.toBuffer(); };
define( ({ loadingInfo: "Carregando...", emptyInfo: "Nenhum item a exibir", loadFailInfo: "Falha ao carregar dados!" }) );
Polymer('x-foo')
import IPTTProgram, { forIPTT } from '../models/ipttProgram'; describe("bare iptt program", () => { const Program = forIPTT; it("handles frequencies", () => { let program = Program({frequencies: [3, 4]}); expect(program.validFrequency(3)).toBeTruthy(); expect(program.validFrequency(2)).toBeFalsy(); let program2 = Program({frequencies: []}); expect(program2.validFrequency(3)).toBeFalsy(); }); it("handles disaggregations", () => { let program = Program({disaggregations: [{pk: 4, name: 'Test Disaggregation', labels: [{pk: '10', name: "banana"}]}]}); expect(Array.from(program.disaggregations.values())).toStrictEqual([{pk: 4, name: 'Test Disaggregation', labels: [{pk: 10, name: "banana"}], country: null}]); }); it("doesn't show category-less disaggregations", () => { let program = Program({disaggregations: [{pk: 4, name: 'Test Disaggregation', labels: []}]}); expect(Array.from(program.disaggregations.values())).toStrictEqual([]); }); });
import SectionUtilities from '../../transform/SectionUtilities' /** * Hide or unhide a section. * @param {!string} sectionId * @param {?boolean} hidden * @return {void} */ const setHidden = (sectionId, hidden) => { if (!document) { return } SectionUtilities.setHidden(document, sectionId, hidden) } export default { getOffsets: SectionUtilities.getSectionOffsets, setHidden }
"use strict"; window.mushroom.state.play2 = { preload: function(){ console.log("loading play2 state"); }, create: function(){ console.log("starting play2 state"); this.game.camera.x = 1800; this.redsea = mt.create("redsea"); this.Pathway2 = mt.create("Pathway2"); this.player=mt.create("weirdmushroom1"); this.enemy=mt.create("evilmushroom1"); this.enemy2=mt.create("evilmushroom2"); this.coins2=mt.create("coins2"); this.score=mt.create("score"); this.timer1=mt.create("timer1"); this.seconds = 0; this.timer1_count = 0; this.score_count = 0; this.Lkey = this.input.keyboard.addKey(Phaser.Keyboard.LEFT); this.Rkey = this.input.keyboard.addKey(Phaser.Keyboard.RIGHT); this.Ukey = this.input.keyboard.addKey(Phaser.Keyboard.UP); }, update: function(){ //Increase time by one second this.timer1_count +=1; if(this.timer1_count == 60 ){ this.seconds +=1; this.timer1.text = this.seconds; this.timer1_count = 0; } //this.game.physics.arcade.collide(this.player, this.pathway); this.game.physics.arcade.collide(this.player, this.Pathway2); this.game.physics.arcade.collide(this.player, this.enemy.self,this.restartGame, null, this); this.game.physics.arcade.collide(this.player, this.enemy2.self,this.restartGame, null, this); this.game.physics.arcade.overlap(this.player, this.coins2.self, this.destroyObject, null, this); this.game.camera.x = this.player.position.x - 400; this.game.camera.y = this.player.position.y - 300; if(this.enemy.body.position.y > 820){ this.enemy.body.position.y = -100; this.enemy.body.position.x = 1800 + Math.random() * 1800; this.enemy.body.velocity.y = 0; } if(this.enemy2.body.position.y > 820){ this.enemy2.body.position.y = -100; this.enemy2.body.position.x = 1800 + Math.random() * 1800; this.enemy2.body.velocity.y = 0; } if(this.Lkey.isDown){ this.player.body.velocity.x -= 5; } else if(this.Rkey.isDown){ this.player.body.velocity.x += 5; } else if (this.Ukey.isDown && this.player.body.touching.down ){ this.player.body.velocity.y -=400; } else{ this.player.body.velocity.x = 0; } /*if(this.score_count == 10){ this.switchLevel(); }*/ }, destroyObject: function(player,coin){ this.score_count +=10; this.score.text = this.score_count; coin.destroy(); }, restartGame: function(){ this.game.state.start("play2"); }, switchLevel: function(){ this.game.state.start("play3"); } };
'use strict'; angular.module('Home').controller('ModalDeleteAssetCtrl', function ($scope, $modalInstance, parentScope, HomeService, asset, name, token, typeId, menuId) { $scope.name = name; $scope.message = "Are you sure you want to delete this asset ?"; $scope.ok = function () { HomeService.deleteAsset( token, menuId, asset, function (response) { if (response) { if (response.error_description) { $scope.error = response.error_description + ". Please logout!"; } else { if (response.success) { parentScope.removeAssetFromTemplate(typeId, asset); } else { $scope.message = response.message; } } } else { $scope.error = "Invalid server response"; } } ); $modalInstance.close(); }; $scope.cancel = function () { $modalInstance.dismiss('cancel'); }; });
cmapi.channel["map.view.clicked"].examples = [ { "title": "Map Clicked", "description": "Report that the map was clicked at a location", "valid": true, "payload": { "lat": 40.195659093364654, "lon": -74.28955078125, "button": "right", "type": "single", "keys": ["shift", "ctrl"] } }, { "title": "Map Clicked", "description": "Report that the map was clicked at a location", "valid": true, "payload": { "lat": 40.195659093364654, "lon": -74.28955078125, "button": "middle", "type": "double", "keys": ["none"] } }, { "title": "Map Clicked", "description": "Report that the map was clicked at a location", "valid": false, "payload": { "lat": 40.195659093364654, "lon": -74.28955078125, "button": "taco", "type": "single", "keys": ["shift", "ctrl"] } }, { "title": "Map Clicked", "description": "Report that the map was clicked at a location", "valid": false, "payload": { "lat": 40.195659093364654, "lon": -74.28955078125, "type": "single", "keys": ["shift", "ctrl"] } } ];
'use strict'; var _ = require('underscore'); var express = require('express'); var router = express.Router(); var ObjectId = require('mongoose').Types.ObjectId; var path = require('path'); /** * @apiDefine group Group based access * Resource access controlled by user's groups */ /** * @apiDefine access Authenticated user access only * User should sign in for the request */ /** * @api {get} / Get home page * @apiName GetHomePage * @apiGroup Home */ router.get('/', (req, res) => res.sendFile(path.join(__dirname, 'public', 'index.html'))); module.exports = router; module.exports.getCollection = function(req, res, model, condition) { let id = req.params.id; let cond = id ? { _id: new ObjectId(id) } : {}; condition = _.extend(cond, condition); model.find(condition, (err, result) => { if (err) { throw err; } res.send(result); }); };
/** * Websocket Client */ (function() { window.Socket = window.Socket || {} var PacketTypes = { Command : 0, Status : 1 } class Socket { constructor(uri, game) { uri = uri || "" if(uri.length <= 0) { let loc = window.location uri = 'ws:' if(loc.protocol === 'https:') { uri = 'wss:' } uri += '//' + loc.host uri += loc.pathname + 'ws' } this.game = game this.ready = false this.socket = new WebSocket(uri) this.socket.binaryType = "arraybuffer" this.socket.onopen = () => { this.onOpen() } this.socket.onmessage = (ev) => { this.onMessage(ev) } this.socket.onclose = () => { this.onClose() } } get closed() { this.socket.readyState == WebSocket.CLOSED } close() { this.socket.close() } onOpen() { this.ready = true } onMessage(ev) { let data = new Uint8Array(ev.data) let packetObject = msgpack.unpack(data) // If data is not correctly if(packetObject == null || packetObject.Type == "undefined") { return } switch(packetObject.Type) { case PacketTypes.Command: this.pushCommand(packetObject.Data) break case PacketTypes.Status: this.handleStatus(packetObject.Data) break } } send(type, data) { // Ignore send data if socket not open if(this.socket.readyState != WebSocket.OPEN) { return } let rawPacket = { Type: type, Data: data } // Should package as binary let packet = new Uint8Array(msgpack.pack(rawPacket)) this.socket.send(packet) } execCommand(name, team, params) { params = params || {} this.send( PacketTypes.Command, { Name: name, Team: team, Params: params } ) } pushCommand(data) { let CommandClass = Command[data.Name] if(!CommandClass) { // Invalid command return } let CommandInstance = new CommandClass(this.game, data.Team) CommandInstance.deserialize(data.Params) // Send command Command.Resolver.push(CommandInstance) } handleStatus(stat) { // TODO: the handler can improve more switch(stat.Name){ case "Register": if(stat.Value == 1) { Game.Status = GameStatus.Registered this.updateStatus("Match", 0) } break case "Match": if(stat.Value == 1) { Game.Status = GameStatus.Start } break case "Exit": Game.Status = GameStatus.End break } } updateStatus(name, value) { this.send( PacketTypes.Status, { Name: name, Value: value } ) } onClose() { } } window.Socket = Socket window.PacketType = PacketTypes }())
 (function() { function getParentIndex(levels, level, index) { if (level > 0) { for (var i = index - 1; i >= 0; i--) { if (levels[i] == level - 1) { return i; } } } return -1; } function hasLittleBrother(levels, level, index) { if (index < levels.length - 1) { for (var i = index + 1; i < levels.length; i++) { if (levels[i] == level) { return true; } else if (levels[i] < level) { return false; } } } return false; } function getParentTempData(tempdatas, tempdata, prefixIndex) { for (var i = 0; i < prefixIndex - 1; i++) { tempdata = tempdatas[tempdata.parentIndex]; } return tempdata; } function getPrefixInner(tempdatas, tempdata, prefixIndex) { // If level = 3, then prefixIndex array will be: [3, 2, 1] // prefixIndex === 1 will always present the nearest prefix next to the Text. if (prefixIndex === 1) { if (tempdata.littleBrother) { return '<div class="x-elbow"></div>'; } else { return '<div class="x-elbow-end"></div>'; } } else { var parentdata = getParentTempData(tempdatas, tempdata, prefixIndex); if (parentdata.littleBrother) { return '<div class="x-elbow-line"></div>'; } else { return '<div class="x-elbow-empty"></div>'; } } return ""; } function getPrefix(tempdatas, index) { var tempdata = tempdatas[index]; var level = tempdata.level; var prefix = []; for (var i = level; i > 0; i--) { prefix.push(getPrefixInner(tempdatas, tempdata, i)); } return prefix.join(''); } F.simulateTree = { transform: function(datas) { if (!datas.length || datas[0].length < 4) { return datas; } //// store: new Ext.data.ArrayStore({ fields: ['value', 'text', 'enabled', 'prefix'] }) //// Sample data: //[ // ["0", "jQuery", 0, 0], // ["1", "Core", 0, 1], // ["2", "Selectors", 0, 1], // ["3", "Basic Filters", 1, 2], // ["4", "Content Filters", 1, 2], // ["41", "Contains", 1, 3], // ["5", "Attribute Filters", 1, 2], // ["6", "Traversing", 1, 1], // ["7", "Filtering", 1, 2], // ["8", "Finding", 1, 2], // ["9", "Events", 0, 1], // ["10", "Page Load", 1, 2], // ["11", "Event Handling", 1, 2], // ["12", "Interaction Helpers", 1, 2], // ["13", "Ajax", 1, 1] //] var levels = []; Ext.Array.each(datas, function (data, index) { levels.push(data[3]); }); var tempdatas = []; Ext.Array.each(levels, function (level, index) { tempdatas.push({ 'level': level, 'parentIndex': getParentIndex(levels, level, index), 'littleBrother': hasLittleBrother(levels, level, index) }); }); var newdatas = []; Ext.Array.each(datas, function (data, index) { newdatas.push([data[0], data[1], data[2], getPrefix(tempdatas, index)]); }); return newdatas; } }; })();
/* @flow strict-local */ import React, { PureComponent } from 'react'; import { FlatList } from 'react-native'; import config from '../config'; import { Screen } from '../common'; import InfoItem from './InfoItem'; export default class VariablesScreen extends PureComponent<{||}> { render() { const variables = { enableReduxLogging: config.enableReduxLogging, enableReduxSlowReducerWarnings: config.enableReduxSlowReducerWarnings, 'process.env.NODE_ENV': process.env.NODE_ENV ?? '(not defined)', 'global.btoa': !!global.btoa, }; return ( <Screen title="Variables" scrollEnabled={false}> <FlatList data={Object.keys(variables)} keyExtractor={item => item} renderItem={({ item }) => <InfoItem label={item} value={variables[item]} />} /> </Screen> ); } }
import React from 'react'; import PropTypes from 'prop-types'; import ColumnChooserRow from '../ColumnChooserRow'; import { columnsPropTypes } from '../../columnChooser.propTypes'; const ColumnChooserTable = ({ columns = [], id, onChangeCheckbox, t }) => columns.map(column => ( <ColumnChooserRow key={column.key}> <ColumnChooserRow.Checkbox checked={column.visible} id={id} dataFeature="column-chooser.select" description={t('CHECKBOX_DISPLAY_COLUMN_DESCRIPTION', { defaultValue: 'display the column {{label}}', label: column.label, })} label={column.label} locked={column.locked} onChange={onChangeCheckbox} t={t} /> </ColumnChooserRow> )); ColumnChooserTable.propTypes = { columns: columnsPropTypes, id: PropTypes.string.isRequired, onChangeCheckbox: PropTypes.func.isRequired, t: PropTypes.func.isRequired, }; export default ColumnChooserTable;
/** * Created by zura on 9/27/2016. */ (function () { 'use strict'; angular .module('app.pages', [ 'app.pages.auth.login' ]) .config(Config); /** @ngInject */ function Config(){ } })();
var util = require('util'), querystring = require('querystring'), request = require('request'); function FacebookProvider(client_id, client_secret, redirect_uri) { this.client_id = client_id; this.client_secret = client_secret; this.redirect_uri = redirect_uri; } FacebookProvider.prototype.getAuthenticateURL = function (options) { return util.format('https://www.facebook.com/dialog/oauth?client_id=%s&response_type=%s&state=%s&redirect_uri=%s', (options && options.client_id) || this.client_id, 'code', String(Math.random() * 100000000), encodeURIComponent((options && options.redirect_uri) || this.redirect_uri)); }; FacebookProvider.prototype.getAuthentication = function (options, callback) { var that = this, qs = { client_id: this.client_id, client_secret: this.client_secret, grant_type: 'authorization_code', redirect_uri: options.redirect_uri || this.redirect_uri, code: options.code }; request({ method: 'GET', uri: 'https://graph.facebook.com/oauth/access_token', qs: qs, timeout: 5000 // 5 seconds }, function (err, res, body) { if (err) { return callback(err); } if (res.statusCode !== 200) { return callback(new Error('Bad response code: ' + res.statusCode)); } console.log('>>> ' + body); var r = querystring.parse(body); // get id & profile: that.requestAPI('GET', 'me', r.access_token, null, function (err, p) { if (err) { return callback(err); } callback(null, { access_token: r.access_token, refresh_token: '', expires_in: parseInt(r.expires, 10), auth_id: p.id, name: p.name, url: p.link, image_url: '' }); }); }); }; FacebookProvider.prototype.requestAPI = function (method, apiName, access_token, options, callback) { options = options || {}; options.access_token = access_token; var opts = { method: method, uri: 'https://graph.facebook.com/' + apiName, timeout: 5000 }; if (method === 'GET') { opts.qs = options; } if (method === 'POST') { opts.form = options; } request(opts, function (err, res, body) { if (err) { return callback(err); } if (res.statusCode !== 200) { return callback(new Error('Bad response code: ' + res.statusCode)); } var r; try { r = JSON.parse(body); } catch (e) { return callback(e); } if (r.error) { return callback(new Error(r.error.message)); } callback(null, r); }); }; module.exports = FacebookProvider;
define( ({ "sourceSetting": "搜索源设置", "instruction": "添加并配置地理编码服务或要素图层为搜索源。这些指定的源决定了搜索框中的可搜索内容。", "add": "添加搜索源", "addGeocoder": "添加地理编码器", "geocoder": "地理编码器", "setLayerSource": "设置图层源", "setGeocoderURL": "设置地理编码器 URL", "searchableLayer": "要素图层", "name": "名称", "countryCode": "国家代码或区域代码", "countryCodeEg": "例如 ", "countryCodeHint": "将此值留空可搜索所有国家和地区", "generalSetting": "常规设置", "allPlaceholder": "用于搜索全部内容的占位符文本: ", "showInfoWindowOnSelect": "显示已找到要素或位置的弹出窗口", "searchInCurrentMapExtent": "仅在当前地图范围内搜索", "zoomScale": "缩放比例", "locatorUrl": "地理编码器 URL", "locatorName": "地理编码器名称", "locatorExample": "示例", "locatorWarning": "不支持此版本的地理编码服务。该微件支持 10.0 及更高版本的地理编码服务。", "locatorTips": "由于地理编码服务不支持建议功能,因此建议不可用。", "layerSource": "图层源", "searchLayerTips": "由于要素服务不支持分页功能,因此建议不可用。", "placeholder": "占位符文本", "searchFields": "搜索字段", "displayField": "显示字段", "exactMatch": "完全匹配", "maxSuggestions": "最大建议数", "maxResults": "最大结果数", "setSearchFields": "设置搜索字段", "set": "设置", "fieldSearchable": "可搜索", "fieldName": "名称", "fieldAlias": "别名", "ok": "确定", "cancel": "取消", "invalidUrlTip": "URL ${URL} 无效或不可访问。" }) );
/* globals describe, it, expect, hot, cold, expectObservable, expectSubscriptions */ var Rx = require('../../dist/cjs/Rx.KitchenSink'); var Observable = Rx.Observable; describe('Observable.prototype.windowCount', function () { it('should emit windows with count 2 and skip 1', function () { var source = hot('^-a--b--c--d--|'); var subs = '^ !'; var expected = 'u-v--x--y--z--|'; var u = cold( '--a--(b|) '); var v = cold( '---b--(c|) '); var x = cold( '---c--(d|)'); var y = cold( '---d--|'); var z = cold( '---|'); var values = { u: u, v: v, x: x, y: y, z: z }; var result = source.windowCount(2, 1); expectObservable(result).toBe(expected, values); expectSubscriptions(source.subscriptions).toBe(subs); }); it('should emit windows with count 2, and skip unspecified', function () { var source = hot('--a--b--c--d--e--f--|'); var subs = '^ !'; var expected = 'x----y-----z-----w--|'; var x = cold( '--a--(b|) '); var y = cold( '---c--(d|) '); var z = cold( '---e--(f|)'); var w = cold( '---|'); var values = { x: x, y: y, z: z, w: w }; var result = source.windowCount(2); expectObservable(result).toBe(expected, values); expectSubscriptions(source.subscriptions).toBe(subs); }); it('should return empty if source is empty', function () { var source = cold('|'); var subs = '(^!)'; var expected = '(w|)'; var w = cold('|'); var values = { w: w }; var result = source.windowCount(2, 1); expectObservable(result).toBe(expected, values); expectSubscriptions(source.subscriptions).toBe(subs); }); it('should return Never if source if Never', function () { var source = cold('-'); var subs = '^'; var expected = 'w'; var w = cold('-'); var expectedValues = { w: w }; var result = source.windowCount(2, 1); expectObservable(result).toBe(expected, expectedValues); expectSubscriptions(source.subscriptions).toBe(subs); }); it('should propagate error from a just-throw source', function () { var source = cold('#'); var subs = '(^!)'; var expected = '(w#)'; var w = cold('#'); var expectedValues = { w: w }; var result = source.windowCount(2, 1); expectObservable(result).toBe(expected, expectedValues); expectSubscriptions(source.subscriptions).toBe(subs); }); it('should raise error if source raises error', function () { var source = hot('--a--b--c--d--e--f--#'); var subs = '^ !'; var expected = 'u-v--w--x--y--z--q--#'; var u = cold( '--a--b--(c|) '); var v = cold( '---b--c--(d|) '); var w = cold( '---c--d--(e|) '); var x = cold( '---d--e--(f|)'); var y = cold( '---e--f--#'); var z = cold( '---f--#'); var q = cold( '---#'); var values = { u: u, v: v, w: w, x: x, y: y, z: z, q: q }; var result = source.windowCount(3, 1); expectObservable(result).toBe(expected, values); expectSubscriptions(source.subscriptions).toBe(subs); }); it('should dispose of inner windows once outer is unsubscribed early', function () { var source = hot('^-a--b--c--d--|'); var subs = '^ ! '; var expected = 'w-x--y--z- '; var w = cold( '--a--(b|) '); var x = cold( '---b--(c|) '); var y = cold( '---c- '); var z = cold( '-- '); var unsub = ' ! '; var values = { w: w, x: x, y: y, z: z }; var result = source.windowCount(2, 1); expectObservable(result, unsub).toBe(expected, values); expectSubscriptions(source.subscriptions).toBe(subs); }); it('should dispose window Subjects if the outer is unsubscribed early', function () { var source = hot('--a--b--c--d--e--f--g--h--|'); var sourceSubs = '^ ! '; var expected = 'x--------- '; var x = cold( '--a--b--c- '); var unsub = ' ! '; var late = time('---------------| '); var values = { x: x }; var window; var result = source.windowCount(10, 10) .do(function (w) { window = w; }); expectObservable(result, unsub).toBe(expected, values); expectSubscriptions(source.subscriptions).toBe(sourceSubs); rxTestScheduler.schedule(function () { expect(function () { window.subscribe(); }).toThrowError('Cannot subscribe to a disposed Subject.'); }, late); }); it('should not break unsubscription chains when result is unsubscribed explicitly', function () { var source = hot('^-a--b--c--d--|'); var subs = '^ ! '; var expected = 'w-x--y--z- '; var w = cold( '--a--(b|) '); var x = cold( '---b--(c|) '); var y = cold( '---c- '); var z = cold( '-- '); var unsub = ' ! '; var values = { w: w, x: x, y: y, z: z }; var result = source .mergeMap(function (i) { return Observable.of(i); }) .windowCount(2, 1) .mergeMap(function (i) { return Observable.of(i); }); expectObservable(result, unsub).toBe(expected, values); expectSubscriptions(source.subscriptions).toBe(subs); }); });
$(document).ready(function () { google.charts.load('current', { packages: ['corechart', 'bar'] }); google.charts.setOnLoadCallback(drawBuildSummary); function drawBuildSummary() { var elem = $('#elapsed_time_chart'); var data = [['Elapsed Time', 'Count']]; var categories = []; //Categorize elapsed time based on their range var values = elem.attr('data-values').split(';'); var eTime = ["0", "0", "0", "0", "0", "0"]; var i = 0; values.forEach(function (str, _, _) { eTime[i] = str; i = i + 1; }); var digits = 1; var lowerRange = '0 ~ ' for (var i in eTime) { var upperRange = Math.pow(10, digits); var strRange = lowerRange + upperRange + 's' data.push([strRange, parseInt(eTime[i])]); categories.push(strRange); lowerRange = upperRange + ' ~ '; digits = digits + 1; } var dataTable = google.visualization.arrayToDataTable(data); var options = { title: 'Elapsed Time', curveType: 'function', bar: { groupWidth: '75%' }, isStacked: true }; var chart = new google.visualization.BarChart(elem.get(0)); chart.draw(dataTable, options); google.visualization.events.addListener(chart, 'select', function () { var selectedItem = chart.getSelection()[0]; if (selectedItem) { var category = categories[selectedItem.row]; $('#category_form_kind').attr('value', category); var form = $('#category_form').submit() } }); } });
var s = "Connected";
import React from 'react'; import Reflux from 'reflux'; import ChatActions from '../events/chat-actions'; import ChatStore from '../events/chat-store'; import classNames from 'classnames'; import {deepEqual} from '../events/chat-store-utils'; import {Dropdown, MenuItem} from 'react-bootstrap'; var GroupHeaderPane = React.createClass({ mixins: [Reflux.connect(ChatStore, 'store')], shouldComponentUpdate: function(nextProps, nextState) { return !deepEqual(this.state.store, nextState.store, ["selectedGroup.id", "selectedGroup.followed", "selectedIntegration.id", "selectedIntegrationGroupTopic.id", "selectedTopic.id", "selectedIntegrationTopic.id", "topics.id", "integrationTopics.id"]); }, onClick: function () { if (this.state.store.selectedGroup) { ChatActions.selectTopic(); } else if (this.state.store.selectedIntegrationGroup) { ChatActions.selectIntegrationTopic(this.state.store.selectedIntegration, this.state.store.selectedIntegrationGroup); } }, onFollowStateChange: function (newFollowState) { if (this.state.store.selectedGroup) { ChatActions.groupFollowStatusChange(this.state.store.selectedGroup, newFollowState); } }, render: function () { var self = this; var newTopicClass = classNames({ ["selected"]: !(self.state.store.selectedTopic || self.state.store.selectedIntegrationTopic), ["enabled"]: ((self.state.store.selectedGroup || self.state.store.selectedIntegrationGroup)) }); var groupHeader = !self.state.store.selectedIntegration && !self.state.store.selectedGroup ? "" : (!self.state.store.selectedIntegration && self.state.store.selectedGroup ? ("# " + self.state.store.selectedGroup.name) : (self.state.store.selectedGroup ? self.state.store.selectedGroup.name : self.state.store.selectedIntegration.name) ); var followedClass = classNames({ ["followed"]: self.state.store.selectedGroup && self.state.store.selectedGroup.followed }); var followTitle = self.state.store.selectedGroup && self.state.store.selectedGroup.followed ? "Unfollow" : "Follow"; var star = self.state.store.selectedGroup ? ( <span className="glyphicon glyphicon-star-empty star" onClick={self.onFollowStateChange.bind(this, !self.state.store.selectedGroup.followed)}></span> ) : null; var dropDown = self.state.store.selectedGroup ? ( <Dropdown id="group-drop-down" className="pull-right"> <a href="#" bsRole="toggle"> <span className="glyphicon glyphicon-chevron-down"></span> </a> <Dropdown.Menu bsRole="menu"> <MenuItem eventKey="1" onSelect={self.onFollowStateChange.bind(this, !self.state.store.selectedGroup.followed)}>{followTitle}</MenuItem> </Dropdown.Menu> </Dropdown> ) : null; return self.state.store.selectedGroup || self.state.store.selectedIntegration ? (<div id="group-header-pane"> <a id="new-topic" className={newTopicClass} onClick={self.onClick}> New topic </a> <div id="group-header" className={followedClass}>{groupHeader}&nbsp;&nbsp; {star} {dropDown} </div> <div className="clearfix"></div> </div>) : ( <div className="space"></div>); } }); export default GroupHeaderPane;
/** * SyntaxHighlighter * http://alexgorbatchev.com/SyntaxHighlighter * * SyntaxHighlighter is donationware. If you are using it, please donate. * http://alexgorbatchev.com/SyntaxHighlighter/donate.html * * @version * 3.0.90 (Sat, 18 Jun 2016 21:01:41 GMT) * * @copyright * Copyright (C) 2004-2013 Alex Gorbatchev. * * @license * Dual licensed under the MIT and GPL licenses. */ ;(function() { // CommonJS SyntaxHighlighter = SyntaxHighlighter || (typeof require !== 'undefined'? require('shCore').SyntaxHighlighter : null); function Brush() { // Contributed by Gheorghe Milas and Ahmad Sherif var keywords = 'and assert break class continue def del elif else ' + 'except exec finally for from global if import in is ' + 'lambda not or pass raise return try yield while'; var funcs = '__import__ abs all any apply basestring bin bool buffer callable ' + 'chr classmethod cmp coerce compile complex delattr dict dir ' + 'divmod enumerate eval execfile file filter float format frozenset ' + 'getattr globals hasattr hash help hex id input int intern ' + 'isinstance issubclass iter len list locals long map max min next ' + 'object oct open ord pow print property range raw_input reduce ' + 'reload repr reversed round set setattr slice sorted staticmethod ' + 'str sum super tuple type type unichr unicode vars xrange zip'; var special = 'None True False self cls class_'; this.regexList = [ { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' }, { regex: /^\s*@\w+/gm, css: 'decorator' }, { regex: /(['\"]{3})([^\1])*?\1/gm, css: 'comments' }, { regex: /"(?!")(?:\.|\\\"|[^\""\n])*"/gm, css: 'string' }, { regex: /'(?!')(?:\.|(\\\')|[^\''\n])*'/gm, css: 'string' }, { regex: /\+|\-|\*|\/|\%|=|==/gm, css: 'keyword' }, { regex: /\b\d+\.?\w*/g, css: 'value' }, { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, { regex: new RegExp(this.getKeywords(special), 'gm'), css: 'color1' } ]; this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags); }; Brush.prototype = new SyntaxHighlighter.Highlighter(); Brush.aliases = ['py', 'python']; SyntaxHighlighter.brushes.Python = Brush; // CommonJS typeof(exports) != 'undefined' ? exports.Brush = Brush : null; })();
/** * Copyright (C) 2006-2020 Talend Inc. - www.talend.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. */const configuration = require('./configuration.json'); const bodyParser = require('body-parser'); const atob = require('atob'); function getConfiguration(req, res) { res.json(configuration); } function downloadZip(req, res) { const data = atob(req.body.project); console.log(data); const options = { root: `${__dirname}/../public/`, dotfiles: 'deny', headers: { 'x-timestamp': Date.now(), 'x-sent': true, }, }; const fileName = 'example.zip'; res.sendFile(fileName, options, err => { if (err) { res.status(500).send(err); } else { console.log('Sent:', fileName); } }); } function createOnGithub(req, res) { console.log(req.body); res.json({ success: true }); } function setup(app) { app.use(bodyParser.urlencoded({ extended: true })); app.use(bodyParser.json()); app.get('/api/project/configuration', getConfiguration); app.post('/api/project/zip/form', downloadZip); app.post('/api/project/openapi/zip/form', downloadZip); app.post('/api/project/github', createOnGithub); } module.exports = setup;
sap.ui.define([ "sap/ui/core/UIComponent" ], function(UIComponent) { "use strict"; return UIComponent.extend("sap.ui.webc.main.sample.FileUploader.Component", { metadata: { manifest: "json" } }); });
module.exports = { entry: { app : './app/app.js' }, output: { filename: '[name]_bundle.js', path: './dist' } };
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import { PostOptions, SettingsSidebar, } from '@support/ui/component'; import {SearchResultPostScreen} from '@support/ui/screen'; class SavedMessagesScreen { testID = { savedMessagesScreen: 'saved_messages.screen', closeSettingsButton: 'close.settings.button', }; savedMessagesScreen = element(by.id(this.testID.savedMessagesScreen)); closeSettingsButton = element(by.id(this.testID.closeSettingsButton)); getSearchResultPostItem = (postId, text, postProfileOptions = {}) => { return SearchResultPostScreen.getPost(postId, text, postProfileOptions); }; toBeVisible = async () => { await expect(this.savedMessagesScreen).toBeVisible(); return this.savedMessagesScreen; }; open = async () => { // # Open saved messages screen await SettingsSidebar.savedMessagesAction.tap(); return this.toBeVisible(); }; close = async () => { await this.closeSettingsButton.tap(); await expect(this.savedMessagesScreen).not.toBeVisible(); }; openPostOptionsFor = async (postId, text) => { const {searchResultPostItem} = await this.getSearchResultPostItem(postId, text); await expect(searchResultPostItem).toBeVisible(); // # Open post options await searchResultPostItem.longPress(); await PostOptions.toBeVisible(); }; } const savedMessagesScreen = new SavedMessagesScreen(); export default savedMessagesScreen;
// Copyright 2019 Google LLC // // 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 `npm run webpack` to produce Webpack bundle for this library. const path = require('path'); module.exports = { entry: './index.ts', resolve: { extensions: ['.ts', '.js', '.json'], fallback: { crypto: false, child_process: false, fs: false, http2: false, buffer: 'browserify', process: false, os: false, querystring: false, path: false, stream: 'stream-browserify', url: false, util: false, zlib: false, }, }, output: { library: 'Licensing', filename: 'licensing.min.js', path: path.resolve(__dirname, 'dist'), }, module: { rules: [ { test: /node_modules[\\/]google-auth-library[\\/]src[\\/]crypto[\\/]node[\\/]crypto/, use: 'null-loader', }, { test: /node_modules[\\/]https-proxy-agent[\\/]/, use: 'null-loader', }, { test: /node_modules[\\/]gcp-metadata[\\/]/, use: 'null-loader', }, { test: /node_modules[\\/]gtoken[\\/]/, use: 'null-loader', }, { test: /node_modules[\\/]pkginfo[\\/]/, use: 'null-loader', }, { test: /node_modules[\\/]semver[\\/]/, use: 'null-loader', }, { test: /\.ts$/, use: 'ts-loader', exclude: /node_modules/, }, ], }, mode: 'production', plugins: [], };
import PinSvg from './svg/PinSvg'; export default function ActivityInfo({title, price, stars, reviews, location}) { return ( <> <div className='h2 line-height-2 mb1'> <span className='travel-results-result-text'>{title}</span> <span className='travel-results-result-subtext h3'>&bull;</span> <span className='travel-results-result-subtext h3'>$&nbsp;</span> <span className='black bold'>{price}</span> </div> <div className='h4 line-height-2'> <div className='inline-block relative mr1 h3 line-height-2'> <div className='travel-results-result-stars green'>★★★★★</div> </div> <span className='travel-results-result-subtext mr1'>{reviews} Reviews</span> <span className='travel-results-result-subtext'> <PinSvg /> {location} </span> </div> </> ); }
$(function() { /* ------------ 合作伙伴信息 ------------ */ $( "#partner_id" ).combobox( { url : ksa.buildUrl( "/data/combo", "bd-partner-all" ), onSelect : function( record ) { $grid.datagrid( "load", { id : record.id } ); } } ); // 确认选择 $("#btn_ok").click( function() { var results = $("#extra_grid").datagrid("getSelected"); parent.$.close( results ); return false; }); // 添加确认 $("#btn_extra_ok").click( function() { $("#btn_extra_ok").attr("disabled", "disabled"); var extra = $("#extra").val(); if( ! extra ) { top.$.messager.warning("请输入新建的抬头信息。"); $("#btn_extra_ok").attr("disabled", null ); return false; } else { // 保存 $.ajax({ url: ksa.buildUrl( "/component/bd", "partner-alias-insert" ), data: { "partner.id" : $("#partner_id").combobox("getValue"), extra : extra }, success: function( result ) { try { if (result.status == "success") { // 添加成功 parent.$.close( extra ); return false; } else { $.messager.error( result.message ); $("#btn_extra_ok").attr("disabled", null ); } } catch (e) { $("#btn_extra_ok").attr("disabled", null ); } } }); } } ); // 添加关闭 $("#btn_extra_close").click( function() { $("#extra_window").window("close"); } ); // 单位别名 var NEW_LINE = "\n"; $.fn.datagrid.defaults.loadEmptyMsg = '<span class="label label-warning">注意</span> 没有获取到任何数据,请选择新的合作单位。'; var $grid = $('#extra_grid').datagrid({ title : '抬头信息:' + PARTNER_NAME, url: ksa.buildUrl( "/data/grid", "bd-partner-extra" ), pagination : false, queryParams : { id : $("#partner_id").combobox("getValue") }, fit : true, onDblClickRow : function( i, data ) { parent.$.close( data ); return false; }, columns:[[ { field:'dump', checkbox:true }, { field:'name', title:'抬头', width:200, formatter:function(v,data,i) { var a = data; try { while( a.indexOf( NEW_LINE ) >= 0 ) { a = a.replace( NEW_LINE, "<br/>" ); } return a; } catch(e) { return data; } } } ]], toolbar:[{ text:'添加...', cls: 'btn-primary', iconCls:'icon-plus icon-white', handler:function(){ var id = $("#partner_id").combobox("getValue"); if( !id || id == "" ) { top.$.messager.warning("请首先选择合作单位,再进行抬头信息的添加操作。"); return; } $("#extra_window").window("open"); $("#extra").val(""); try { $("#extra")[0].focus(); } catch(e){} } }, '-', { text:'删除', cls: 'btn-danger', iconCls:'icon-trash icon-white', handler:function(){ deleteExtra(); } }] }); // 删除 function deleteExtra() { var row = $grid.datagrid( "getSelected" ); if( ! row ) { top.$.messager.warning("请选择一条数据后,再进行删除操作。"); return; } $.messager.confirm( "确定删除所选抬头吗?", function( ok ){ if( ok ) { $.ajax({ url: ksa.buildUrl( "/component/bd", "partner-alias-delete" ), data: { "partner.id" : $("#partner_id").combobox("getValue"), extra : $grid.datagrid("getSelected") }, success: function( result ) { try { if (result.status == "success") { $.messager.success( result.message ); $grid.datagrid( "reload" ); } else { $.messager.error( result.message ); } } catch (e) { } } }); } } ); } });
var a04869 = [ [ "font_sample_count", "a04869.html#af23335c4319e0c5f010380d9de8f5a6d", null ], [ "Label", "a04869.html#ad4701118c2e75f005c1f7e4c53abb35d", null ], [ "List", "a04869.html#a848ab6ee611dbc860f80a47ecef2faa7", null ], [ "SampleCount", "a04869.html#aab481329945e65c4aeee79b145e4de51", null ] ];
'use strict'; /** * @ngdoc overview * @name hciApp * @description * # hciApp * * Main module of the application. */ angular .module('hciApp', [ 'ngAnimate', 'ngCookies', 'ngResource', 'ngRoute', 'ngSanitize', 'ngTouch', 'ui.bootstrap', 'ngMaterial' ]) .config(function ($routeProvider) { $routeProvider .when('/main', { templateUrl: 'views/main.html', controller: 'MainCtrl' }) .when('/main/:mode', { templateUrl: 'views/main.html', controller: 'MainCtrl' }) .when('/about', { templateUrl: 'views/about.html', controller: 'AboutCtrl' }) .when('/ideas', { templateUrl: 'views/ideas.html', controller: 'IdeasCtrl' }) .when('/details', { templateUrl: 'views/details.html', controller: 'DetailsCtrl' }) .otherwise({ redirectTo: '/main' }); });
const config = require('./protractor.conf').config; config.capabilities = { browserName: 'chrome', chromeOptions: { args: ['--headless', '--no-sandbox', '--disable-gpu'], }, }; exports.config = config;
export { default as Home} from './home'; export { default as Post} from './post'; export { default as Search} from './search'; export { default as About} from './about'; export { default as Author} from './author'; export { default as Comment} from './comment'; export { default as Setting} from './setting'; export { default as Offline} from './offline'; export { default as OfflinePost} from './offlinePost';
// 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. couchTests.delayed_commits = function(debug) { var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"}); db.deleteDb(); db.createDb(); if (debug) debugger; run_on_modified_server( [{section: "couchdb", key: "delayed_commits", value: "true"}], function () { // By default, couchdb doesn't fully commit documents to disk right away, // it waits about a second to batch the full commit flush along with any // other updates. If it crashes or is restarted you may lose the most // recent commits. T(db.save({_id:"1",a:2,b:4}).ok); T(db.open("1") != null); restartServer(); T(db.open("1") == null); // lost the update. // note if we waited > 1 sec before the restart, the doc would likely // commit. // Retry the same thing but with full commits on. var db2 = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"true"}); T(db2.save({_id:"1",a:2,b:4}).ok); T(db2.open("1") != null); restartServer(); T(db2.open("1") != null); // You can update but without committing immediately, and then ensure // everything is commited in the last step. T(db.save({_id:"2",a:2,b:4}).ok); T(db.open("2") != null); T(db.ensureFullCommit().ok); restartServer(); T(db.open("2") != null); // However, it's possible even when flushed, that the server crashed between // the update and the commit, and you don't want to check to make sure // every doc you updated actually made it to disk. So record the instance // start time of the database before the updates and then check it again // after the flush (the instance start time is returned by the flush // operation). if they are the same, we know everything was updated // safely. // First try it with a crash. var instanceStartTime = db.info().instance_start_time; T(db.save({_id:"3",a:2,b:4}).ok); T(db.open("3") != null); restartServer(); var commitResult = db.ensureFullCommit(); T(commitResult.ok && commitResult.instance_start_time != instanceStartTime); // start times don't match, meaning the server lost our change T(db.open("3") == null); // yup lost it // retry with no server restart var instanceStartTime = db.info().instance_start_time; T(db.save({_id:"4",a:2,b:4}).ok); T(db.open("4") != null); var commitResult = db.ensureFullCommit(); T(commitResult.ok && commitResult.instance_start_time == instanceStartTime); // Successful commit, start times match! restartServer(); T(db.open("4") != null); }); // Now test that when we exceed the max_dbs_open, pending commits are safely // written. T(db.save({_id:"5",foo:"bar"}).ok); var max = 2; run_on_modified_server( [{section: "couchdb", key: "delayed_commits", value: "true"}, {section: "couchdb", key: "max_dbs_open", value: max.toString()}], function () { for(var i=0; i<max; i++) { var dbi = new CouchDB("test_suite_db" + i); dbi.deleteDb(); dbi.createDb(); } T(db.open("5").foo=="bar"); for(var i=0; i<max+1; i++) { var dbi = new CouchDB("test_suite_db" + i); dbi.deleteDb(); } }); };
document.addEventListener('deviceready', ondeviceready, false); function Notifi (){ cordova.plugins.notification.local.schedule({ id: 1, title: "Atento!!!!!", message: "Este evento se ha agregado a tu lista " }); }
var a00278 = [ [ "c_blob_comparator", "a00278.html#adf90dfe481e3980859ab92739b51caa6", null ] ];
'use strict'; var auth = require('../middleware/auth'); var express = require('express'); var router = express.Router(); var achievements = require('../common/achievements'); var User = require('../models').users; var Action = require('../models').actions; var Log = require('../models').logs; /** * @api {get} /user/action Get user's action list * @apiGroup User Action * * @apiExample {curl} Example usage: * # Get API token via /api/user/token * export API_TOKEN=fc35e6b2f27e0f5ef... * * curl -i -X GET -H "Authorization: Bearer $API_TOKEN" \ * http://localhost:3000/api/user/action * * @apiSuccessExample {json} Success-Response: * { * "pending": {}, * "inProgress": { * "55b230d69a8c96f177154fa1": { * "_id": "55b230d69a8c96f177154fa1", * "name": "Disable standby", * "description": "Turn off and unplug standby power of TV, stereo, computer, etc.", * "effort": 2, * "impact": 2, * "category": null, * "startedDate": "2015-08-11T10:31:39.934Z" * }, * "55b230d69a8c96f177154fa2": { * "startedDate": "2015-08-11T10:43:33.485Z", * "impact": 3, * "effort": 4, * "description": "Find and seal up leaks", * "name": "Leaks", * "_id": "55b230d69a8c96f177154fa2" * } * }, * "done": {}, * "declined": {}, * "na": {} * } */ router.get('/', auth.authenticate(), function(req, res) { res.json(req.user.actions); Log.create({ userId: req.user._id, category: 'User Action', type: 'get', data: {} }); }); /** * @api {get} /user/action/suggested Get list of suggested user actions * @apiGroup User Action * @apiDescription Returns top three most recent actions that the user has not tried * * @apiExample {curl} Example usage: * # Get API token via /api/user/token * export API_TOKEN=fc35e6b2f27e0f5ef... * * curl -i -X GET -H "Authorization: Bearer $API_TOKEN" \ * http://localhost:3000/api/user/action/suggested * * @apiSuccessExample {json} Success-Response: * [ * { * "__v": 0, * "_id": "555f0163688305b57c7cef6c", * "description": "Disabling standby can save up to 10% in total electricity costs.", * "effort": 2, * "impact": 2, * "name": "Disable standby on your devices", * "ratings": [] * }, * { * ... * } * ] * * @apiVersion 1.0.0 */ router.get('/suggested', auth.authenticate(), function(req, res) { Action.getSuggested(req.user, res.successRes); Log.create({ userId: req.user._id, category: 'User Action', type: 'getSuggested', data: res.successRes }); }); /** * @api {post} /user/action/:actionId Change state for user action * @apiGroup User Action * @apiDescription Used to start/stop actions for a user. * * @apiParam {String} actionId Action's MongoId * @apiParam {String} state Can be one of: 'pending', 'inProgress', 'alreadyDoing', * 'done', 'canceled', 'declined', 'na'. * @apiParam {Date} postponed Must be provided if state is 'pending'. Specifies * at which time the user will be reminded of the action again. * * @apiExample {curl} Example usage: * # Get API token via /api/user/token * export API_TOKEN=fc35e6b2f27e0f5ef... * * curl -i -X POST -H "Authorization: Bearer $API_TOKEN" -H "Content-Type: application/json" -d \ * '{ * "state": "inProgress" * }' \ * http://localhost:3000/api/user/action/55b230d69a8c96f177154fa1 * * @apiSuccessExample {json} Success-Response: * { * "pending": {}, * "inProgress": { * "55b230d69a8c96f177154fa1": { * "_id": "55b230d69a8c96f177154fa1", * "name": "Disable standby", * "description": "Turn off and unplug standby power of TV, stereo, computer, etc.", * "effort": 2, * "impact": 2, * "category": null, * "startedDate": "2015-08-11T10:31:39.934Z" * }, * "55b230d69a8c96f177154fa2": { * "startedDate": "2015-08-11T10:43:33.485Z", * "impact": 3, * "effort": 4, * "description": "Find and seal up leaks", * "name": "Leaks", * "_id": "55b230d69a8c96f177154fa2" * } * }, * "done": {}, * "declined": {}, * "na": {} * } */ router.post('/:actionId', auth.authenticate(), function(req, res) { User.setActionState(req.user, req.params.actionId, req.body.state, req.body.postponed, function(err, user) { if (!err) { achievements.updateAchievement(req.user, 'actionsDone', function(oldVal) { // make sure we never decerase the action count return Math.max(oldVal, user.actions ? user.actions.done.length : 0); }); } res.successRes(err, user); }); Log.create({ userId: req.user._id, category: 'User Action', type: 'update', data: req.body }); }); module.exports = router;
/* * Copyright (c) 2015 Samsung Electronics Co., Ltd 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. */ var dispatchStorageEvent = function(key, oldValue, newValue) { var evt = document.createEvent("CustomEvent"); evt.initCustomEvent("storage", true, true); evt.key = key; evt.oldValue = oldValue; evt.newValue = newValue; evt.storageArea = window.widget.preference; document.dispatchEvent(evt); for (var i=0; i < window.frames.length; i++) { window.frames[i].document.dispatchEvent(evt); } }; var widget_info_ = requireNative('WidgetModule'); var preference_ = widget_info_['preference']; preference_.__onChanged_WRT__ = dispatchStorageEvent; function Widget() { Object.defineProperties(this, { "author": { value: widget_info_[ "author"], writable: false }, "description": { value: widget_info_["description"], writable: false }, "name": { value: widget_info_["name"], writable: false }, "shortName": { value: widget_info_["shortName"], writable: false }, "version": { value: widget_info_["version"], writable: false }, "id": { value: widget_info_["id"], writable: false }, "authorEmail": { value: widget_info_["authorEmail"], writable: false }, "authorHref": { value: widget_info_["authorHref"], writable: false }, "height": { get: function() { return window && window.innerHeight || 0; }, configurable: false }, "width": { get: function() { return window && window.innerWidth || 0; }, configurable: false }, "preferences": { value: preference_, writable: false } }); }; Widget.prototype.toString = function() { return "[object Widget]"; }; window.widget = new Widget(); exports = Widget;
//// [/lib/initial-buildOutput.txt] /lib/tsc --b /src/src/main /src/src/other exitCode:: ExitStatus.Success //// [/src/dist/main/a.d.ts] export {}; //// [/src/dist/main/a.js] "use strict"; exports.__esModule = true; var b_1 = require("./b"); var a = b_1.b; //// [/src/dist/main/b.d.ts] export declare const b = 0; //// [/src/dist/main/b.js] "use strict"; exports.__esModule = true; exports.b = void 0; exports.b = 0; //// [/src/dist/main/tsconfig.tsbuildinfo] { "program": { "fileInfos": { "../../../lib/lib.d.ts": { "version": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };", "signature": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };", "affectsGlobalScope": true }, "../../src/main/b.ts": { "version": "-11678562673-export const b = 0;\r\n", "signature": "-3829176033-export declare const b = 0;\r\n", "affectsGlobalScope": false }, "../../src/main/a.ts": { "version": "-17071184049-import { b } from './b';\r\nconst a = b;", "signature": "-4882119183-export {};\r\n", "affectsGlobalScope": false } }, "options": { "composite": true, "declaration": true, "rootDir": "../../src", "outDir": "..", "skipDefaultLibCheck": true, "configFilePath": "../../src/main/tsconfig.json" }, "referencedMap": { "../../src/main/a.ts": [ "../../src/main/b.ts" ] }, "exportedModulesMap": {}, "semanticDiagnosticsPerFile": [ "../../../lib/lib.d.ts", "../../src/main/a.ts", "../../src/main/b.ts" ] }, "version": "FakeTSVersion" } //// [/src/dist/other/other.d.ts] export declare const Other = 0; //// [/src/dist/other/other.js] "use strict"; exports.__esModule = true; exports.Other = void 0; exports.Other = 0; //// [/src/dist/other/tsconfig.tsbuildinfo] { "program": { "fileInfos": { "../../../lib/lib.d.ts": { "version": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };", "signature": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };", "affectsGlobalScope": true }, "../../src/other/other.ts": { "version": "-2951227185-export const Other = 0;\r\n", "signature": "-7996259489-export declare const Other = 0;\r\n", "affectsGlobalScope": false } }, "options": { "composite": true, "declaration": true, "rootDir": "../../src", "outDir": "..", "skipDefaultLibCheck": true, "configFilePath": "../../src/other/tsconfig.json" }, "referencedMap": {}, "exportedModulesMap": {}, "semanticDiagnosticsPerFile": [ "../../../lib/lib.d.ts", "../../src/other/other.ts" ] }, "version": "FakeTSVersion" }
var a00455 = [ [ "UnicharIdArrayUtils", "a02761.html", null ], [ "AmbigSpec", "a02765.html", "a02765" ], [ "UnicharAmbigs", "a02769.html", "a02769" ], [ "MAX_AMBIG_SIZE", "a00455.html#a66b35d22667233a1566433c6dd864463", null ], [ "UnicharAmbigsVector", "a00455.html#aa63fceec9a01c185fac83c0e7d04fe08", null ], [ "UnicharIdVector", "a00455.html#a3dad1b2dad5ed3069bdb4c971116b9c5", null ], [ "AmbigType", "a00455.html#aa13017f5f891a1f9f95074bf26a5b222", [ [ "NOT_AMBIG", "a00455.html#aa13017f5f891a1f9f95074bf26a5b222af40a6c3f3fbd83ba09a6607f534349dc", null ], [ "REPLACE_AMBIG", "a00455.html#aa13017f5f891a1f9f95074bf26a5b222a4de7fc7ae32fd87a4c53e4b6bf3322de", null ], [ "DEFINITE_AMBIG", "a00455.html#aa13017f5f891a1f9f95074bf26a5b222a36712914249ab1d96c4f395c06bc7009", null ], [ "SIMILAR_AMBIG", "a00455.html#aa13017f5f891a1f9f95074bf26a5b222aba0a03f0cccfdd9e45817623613dd740", null ], [ "CASE_AMBIG", "a00455.html#aa13017f5f891a1f9f95074bf26a5b222a29c650e9672a75e50491fc10c0f07ec5", null ], [ "AMBIG_TYPE_COUNT", "a00455.html#aa13017f5f891a1f9f95074bf26a5b222a79854db5a6d73c698dd9b003f426918f", null ] ] ], [ "ELISTIZEH", "a00455.html#aad9b817c74cee6bd76a4912e7f54ff7b", null ] ];
var robotsParser = require("robots-parser"), urlMod = require("url"); /** * This is a parse that analyzes URL with path /robots.txt. * * @return {Function} Returns the handler. */ module.exports = function (opts) { if (!opts) { opts = {}; } if (!opts.urlFilter) { opts.urlFilter = function () { return true; }; } return function (context) { var robots, urlObj; urlObj = urlMod.parse(context.url); // skip if this is not actually a robots.txt file. if (urlObj.pathname !== "/robots.txt") { return []; } robots = robotsParser(context.url, context.body.toString()); return robots.getSitemaps().map(function (sitemapHref) { return urlMod.resolve(context.url, sitemapHref); }).filter(function (sitemapUrl) { return opts.urlFilter(sitemapUrl, context.url); }); }; };
import React from "react"; import { mount } from "enzyme"; import { TextArea as VanillaTextArea } from "hig-vanilla"; import TextAreaAdapter from "./TextAreaAdapter"; describe("TextAreaAdapter", () => { it("implements the hig interface", () => { expect(spiedInstance => { mount( <TextAreaAdapter higInstance={spiedInstance} value="TextArea" instructions="Type in your favorite word" placeholder="Fizz" label="Favorite word" name="favorite-word" disabled required="You really have to fill this out" onBlur={() => {}} onChange={() => {}} onFocus={() => {}} onInput={() => {}} /> ); mount( <TextAreaAdapter higInstance={spiedInstance} disabled={false} required="" /> ); }).toImplementHIGInterfaceOf(VanillaTextArea); }); });
var a02762 = [ [ "AmbigSpec", "a02762.html#aaa3a04113f5db03951771afa6423e7f4", null ], [ "~AmbigSpec", "a02762.html#a5283933a9e7267b3505f5f18cf289f3e", null ], [ "correct_fragments", "a02762.html#ad3a4b121b26cf829422700494aed91e4", null ], [ "correct_ngram_id", "a02762.html#a879c6167dbfc54980bfeb5a15b32bf73", null ], [ "type", "a02762.html#ae29644f82c6feac4df14b22368fa0873", null ], [ "wrong_ngram", "a02762.html#a9d7f07e5b038c6d61acc9bb75ba7ef1b", null ], [ "wrong_ngram_size", "a02762.html#a4cfb10d18b7c636f3afa5f223afa445e", null ] ];
import React, {useContext} from 'react'; import {StyleSheet, ScrollView, Text, View, Platform, TouchableHighlight} from 'react-native'; import {NavigationContext} from 'navigation-react'; import {NavigationBar, RightBar, BarButton, SharedElement, useNavigated} from 'navigation-react-native'; export default ({colors, color}) => { const {stateNavigator} = useContext(NavigationContext); useNavigated(() => { if (Platform.OS === 'web') document.title = 'Color'; }); return ( <> <NavigationBar title="Color" barTintColor="#fff"> <RightBar> <BarButton systemItem="cancel" title="Cancel" show="always" accessibilityRole="link" href={stateNavigator.historyManager.getHref( stateNavigator.getNavigationBackLink(1) )} onPress={() => stateNavigator.navigateBack(1)} /> </RightBar> </NavigationBar> <ScrollView contentInsetAdjustmentBehavior="automatic"> <SharedElement name={color} data={{color}} style={styles.color}> <View style={{backgroundColor: color, flex: 1}} /> </SharedElement> <Text style={styles.text}>{color}</Text> <View style={styles.colors}> {[1,2,3].map(i => colors[(colors.indexOf(color) + i) % 15]) .map(subcolor => ( <TouchableHighlight key={subcolor} style={[styles.subcolor, {backgroundColor: subcolor}]} underlayColor={subcolor} accessibilityRole="link" href={stateNavigator.historyManager.getHref( stateNavigator.getRefreshLink({color: subcolor}) )} onPress={(e) => { if (e.ctrlKey || e.shiftKey || e.metaKey || e.altKey || e.button) return e.preventDefault() stateNavigator.refresh({color: subcolor}, 'replace'); }}> <View /> </TouchableHighlight> ) )} </View> </ScrollView> </> ); } const styles = StyleSheet.create({ back: { fontSize: 20, color: '#000', fontWeight: 'bold', paddingLeft: 20, paddingTop: 10, }, color: { height: 300, marginTop: 10, marginLeft: 15, marginRight: 15, }, text:{ fontSize: 80, color: '#000', textAlign:'center', fontWeight: 'bold', }, colors: { flexDirection: 'row', justifyContent: 'center', marginTop: 20, }, subcolor: { width: 100, height: 50, marginLeft: 4, marginRight: 4, marginBottom: 10, }, });
const OpencgaSampleBrowserConfig = { };
/** * @license Copyright 2017 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. */ 'use strict'; /** * @fileoverview Ensures the contrast between foreground and background colors meets * WCAG 2 AA contrast ratio thresholds. * See base class in axe-audit.js for audit() implementation. */ const AxeAudit = require('./axe-audit'); class ColorContrast extends AxeAudit { /** * @return {LH.Audit.Meta} */ static get meta() { return { id: 'color-contrast', title: 'Background and foreground colors have a sufficient contrast ratio', failureTitle: 'Background and foreground colors do not have a ' + 'sufficient contrast ratio.', description: 'Low-contrast text is difficult or impossible for many users to read. ' + '[Learn more](https://dequeuniversity.com/rules/axe/2.2/color-contrast?application=lighthouse).', requiredArtifacts: ['Accessibility'], }; } } module.exports = ColorContrast;
/* * 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. */ ({ testVerifyIfTestLoaded : { test:function(cmp){ var children = (cmp.getElements()[0]).childNodes; $A.test.assertEquals(4, children.length); $A.test.assertEquals("It is not true.It is literally not false.", $A.test.getText(children[0])); $A.test.assertEquals("It wishes it was true.It is not true.", $A.test.getText(children[1])); $A.test.assertEquals("It wishes it was true.It is not true.", $A.test.getText(children[2])); $A.test.assertEquals("It is not true.It is literally not false.", $A.test.getText(children[3])); } } })
import React from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; import { Headline } from '@folio/stripes/components'; import css from './ProxyViewList.css'; const ProxyViewList = ({ records, name, label, itemComponent, stripes }) => { const ComponentToRender = itemComponent; const items = records.map((record, index) => ( <ComponentToRender key={`item-${index}`} record={record} stripes={stripes} /> )); const noSponsorsFound = <FormattedMessage id="ui-users.permissions.noSponsorsFound" />; const noProxiesFound = <FormattedMessage id="ui-users.permissions.noProxiesFound" />; const noneFoundMsg = name === 'sponsors' ? noSponsorsFound : noProxiesFound; return ( <div className={css.list} data-test={name}> <Headline tag="h4" size="small" margin="small">{label}</Headline> {items.length ? items : <p className={css.isEmptyMessage}>{noneFoundMsg}</p>} </div> ); }; ProxyViewList.propTypes = { records: PropTypes.arrayOf(PropTypes.object), itemComponent: PropTypes.func.isRequired, name: PropTypes.string.isRequired, label: PropTypes.node.isRequired, stripes: PropTypes.object.isRequired, }; export default ProxyViewList;
'use strict'; import gulp from 'gulp'; import webpack from 'webpack'; import path from 'path'; import sync from 'run-sequence'; import rename from 'gulp-rename'; import template from 'gulp-template'; import fs from 'fs'; import yargs from 'yargs'; import lodash from 'lodash'; import gutil from 'gulp-util'; import serve from 'browser-sync'; import del from 'del'; import webpackDevMiddleware from 'webpack-dev-middleware'; import webpackHotMiddleware from 'webpack-hot-middleware'; import colorsSupported from 'supports-color'; import historyApiFallback from 'connect-history-api-fallback'; let root = 'client'; // helper method for resolving paths let resolveToApp = (glob = '') => { return path.join(root, 'app', glob); // app/{glob} }; let resolveToComponents = (glob = '') => { return path.join(root, 'app/components', glob); // app/components/{glob} }; // map of all paths let paths = { js: resolveToComponents('**/*!(.spec.js).js'), // exclude spec files styl: resolveToApp('**/*.scss'), // stylesheets html: [ resolveToApp('**/*.html'), path.join(root, 'index.html') ], entry: [ 'babel-polyfill', path.join(__dirname, root, 'app/app.js') ], output: root, blankTemplates: path.join(__dirname, 'generator', 'component/**/*.**'), dest: path.join(__dirname, 'dist') }; // use webpack.config.js to build modules gulp.task('webpack', ['clean'], (cb) => { const config = require('./webpack.dist.config'); config.entry.app = paths.entry; webpack(config, (err, stats) => { if(err) { throw new gutil.PluginError("webpack", err); } gutil.log("[webpack]", stats.toString({ colors: colorsSupported, chunks: false, errorDetails: true })); cb(); }); }); gulp.task('serve', () => { const config = require('./webpack.dev.config'); config.entry.app = [ // this modules required to make HRM working // it responsible for all this webpack magic 'webpack-hot-middleware/client?reload=true', // application entry point ].concat(paths.entry); var compiler = webpack(config); serve({ port: process.env.PORT || 3000, open: false, server: {baseDir: root}, middleware: [ historyApiFallback(), webpackDevMiddleware(compiler, { stats: { colors: colorsSupported, chunks: false, modules: false }, publicPath: config.output.publicPath }), webpackHotMiddleware(compiler) ] }); }); gulp.task('watch', ['serve']); gulp.task('component', () => { const cap = (val) => { return val.charAt(0).toUpperCase() + val.slice(1); }; const name = yargs.argv.name; const parentPath = yargs.argv.parent || ''; const destPath = path.join(resolveToComponents(), parentPath, name); return gulp.src(paths.blankTemplates) .pipe(template({ name: name, upCaseName: cap(name) })) .pipe(rename((path) => { path.basename = path.basename.replace('temp', name); })) .pipe(gulp.dest(destPath)); }); gulp.task('clean', (cb) => { del([paths.dest]).then(function (paths) { gutil.log("[clean]", paths); cb(); }) }); gulp.task('default', ['watch']);
// @Bind #menu1.#menuItem2.onClick !function() { dorado.MessageBox.alert("Dorado7.0 快速入门"); }; // @Bind #tree1.onDataRowClick !function(self) { // 定义Tab变量 var tab = {}; // self 代表事件所属的控件,此处指 Tree对象 // self.get("currentNode")表示获取当前被点击的节点。 with (self.get("currentNode")) { // 制定当前的tab为IFrameTab tab.$type = "IFrame"; // 定义新Tab的标签 tab.caption = get("label"); // 定义Tab的Path // get("userData")表示获取当前节点的UserData属性, // 也就是刚才设定的 sample.chapter01.HelloWorld.d tab.path = get("userData"); tab.name = get("label"); tab.closeable = true; } // 如果当前节点有指定的Path则打开新的tab if (tab.path) { with (view.get("#tabControl")) { // 根据name查找是否已经打开过当前的Tab。 // 如果没有打开过,则需要添加一个新的Tab var currentTab = getTab(tab.name); if (currentTab) { tab = currentTab; } else { // 获取ID为tabControl的对象,并添加一个新的Tab // 设定ID为tabControl的对象的当前Tab为新创建的Tab tab = addTab(tab); } // 设定当前的Tab为制定的tab set("currentTab", tab); } } };
var GPSClient = {}; GPSClient.send = function(exeurl, latitude,longitude,actionname,username) { var client = Titanium.Network.createHTTPClient({timeout : 100000}); var paramater = '&intaliouser=' + username + '&parameter=latitude:' + longitude + ','; //var paramater = '&username=' + username + '&parameter=latitude:' + longitude + ','; var paramater1 = 'longitude:' + latitude + ','; var paramater2 = 'timestamp:timestamp,'; var paramater3 = 'actionname:' + actionname + ','; var paramater4 = 'name:' + username + ','; var url = exeurl + paramater + paramater1 + paramater2 + paramater3 + paramater4; client.open(GET_REC, url); client.onload = function() { try { var resData = eval("("+this.responseText+")"); if (resData[0].error == 'Yes') { var dialog = Titanium.UI.createAlertDialog({}); dialog.title = Titanium.Locale.getString("gps_yes_title"); dialog.message = resData[0].contents; dialog.show(); return; } else { return; } } catch (e) { Titanium.API.error(e); var dialog = Titanium.UI.createAlertDialog({}); dialog.title = Titanium.Locale.getString("gps_catch_title"); dialog.message = Titanium.Locale.getString("gps_catch_message"); dialog.show(); return; } }; client.onerror = function() { if (client.status == 401) { var dialog = Titanium.UI.createAlertDialog({}); dialog.title = Titanium.Locale.getString("gps_connect_title"); dialog.message = Titanium.Locale.getString("gps_connect_message"); dialog.show(); return; } var dialog = Titanium.UI.createAlertDialog({}); dialog.title = Titanium.Locale.getString("gps_network_title"); dialog.message = Titanium.Locale.getString("gps_network_message"); dialog.show(); return; }; client.send(); };
'use strict'; /** * 블럭 모델 * * @class Block * * @exception {Error} Messages.CONSTRUCT_ERROR * 아래 문서의 1.3 Models Folder의 항목 참조 * @link https://github.com/Gaia3D/F4DConverter/blob/master/doc/F4D_SpecificationV1.pdf */ var Block = function() { if (!(this instanceof Block)) { throw new Error(Messages.CONSTRUCT_ERROR); } /** * This class is the container which holds the VBO Cache Keys. * @type {VBOVertexIdxCacheKeysContainer} */ this.vBOVertexIdxCacheKeysContainer = new VBOVertexIdxCacheKeysContainer(); /** * @deprecated * @type {number} * @default -1 */ this.mIFCEntityType = -1; /** * small object flag. * if bbox.getMaxLength() < 0.5, isSmallObj = true * * @type {Boolean} * @default false */ this.isSmallObj = false; /** * block radius * 일반적으로 bbox.getMaxLength() / 2.0 로 선언됨. * * @type {Boolean} * @default 10 */ this.radius = 10; /** * only for test.delete this. * @deprecated */ this.vertexCount = 0; /** * 각각의 사물중 복잡한 모델이 있을 경우 Lego로 처리 * 현재는 사용하지 않으나 추후에 필요할 수 있어서 그대로 둠. * legoBlock. * @type {Lego} */ this.lego; }; /** * block 초기화. gl에서 해당 block 및 lego 삭제 * * @param {WebGLRenderingContext} gl * @param {VboManager} vboMemManager */ Block.prototype.deleteObjects = function(gl, vboMemManager) { this.vBOVertexIdxCacheKeysContainer.deleteGlObjects(gl, vboMemManager); this.vBOVertexIdxCacheKeysContainer = undefined; this.mIFCEntityType = undefined; this.isSmallObj = undefined; this.radius = undefined; // only for test. delete this. this.vertexCount = undefined; if (this.lego) { this.lego.deleteGlObjects(gl); } this.lego = undefined; }; /** * render할 준비가 됬는지 체크 * * @param {NeoReference} neoReference magoManager의 objectSelected와 비교 하기 위한 neoReference 객체 * @param {MagoManager} magoManager * @param {Number} maxSizeToRender block의 radius와 비교하기 위한 ref number. * @returns {Boolean} block의 radius가 maxSizeToRender보다 크고, block의 radius가 magoManager의 보다 크고, 카메라가 움직이고 있지 않고, magoManager의 objectSelected와 neoReference가 같을 경우 true 반환 */ Block.prototype.isReadyToRender = function(neoReference, magoManager, maxSizeToRender) { if (maxSizeToRender && (this.radius < maxSizeToRender)) { return false; } if (magoManager.isCameraMoving && this.radius < magoManager.smallObjectSize && magoManager.objectSelected !== neoReference) { return false; } return true; };
/* Dopetrope 2.0 by HTML5 UP html5up.net | @n33co Free for personal and commercial use under the CCA 3.0 license (html5up.net/license) */ window._skel_config = { preset: 'standard', prefix: DPT.theme + '/css/style', resetCSS: true, breakpoints: { 'desktop': { grid: { gutters: 50 } } } }; window._skel_panels_config = { preset: 'standard' };
/** * @license * Copyright 2014 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. */ // Asynchronous eval workaround for lack of eval in Chrome Apps. Do not add // workaround in Cordova Chrome Apps. if ( ! (window.cordova && window.chrome) ) { TemplateUtil.compile = function() { return function() { return this.name_ + " wasn't required. Models must be arequired()'ed for Templates to be compiled in Packaged Apps."; }; }; var __EVAL_CALLBACKS__ = {}; var aeval = (function() { var nextID = 0; var future = afuture(); if ( ! document.body ) window.addEventListener('load', future.set); else future.set(); return function(src) { return aseq( future.get, function(ret) { var id = 'c' + (nextID++); var newjs = ['__EVAL_CALLBACKS__["' + id + '"](' + src + ');']; var blob = new Blob(newjs, {type: 'text/javascript'}); var url = window.URL.createObjectURL(blob); // TODO: best values? // url.defer = ?; // url.async = ?; __EVAL_CALLBACKS__[id] = function(data) { delete __EVAL_CALLBACKS__[id]; ret && ret.call(this, data); }; var script = document.createElement('script'); script.src = url; script.onload = function() { this.remove(); window.URL.revokeObjectURL(url); // document.body.removeChild(this); }; document.body.appendChild(script); }); }; })(); var TEMPLATE_FUNCTIONS = []; var aevalTemplate = function(t, model) { var doEval_ = function(t) { // Parse result: [isSimple, maybeCode]: [true, null] or [false, codeString]. var parseResult = TemplateCompiler.parseString(t.template); // Simple case, just a string literal if ( parseResult[0] ) return aconstant(ConstantTemplate(t.language === 'css' ? X.foam.grammars.CSS3.create().parser.parseString(t.template).toString() : t.template)); var code = TemplateUtil.HEADER + parseResult[1] + TemplateUtil.FOOTERS[t.language]; var args = ['opt_out']; if ( t.args ) { for ( var i = 0 ; i < t.args.length ; i++ ) { args.push(t.args[i].name); } } return aeval('function(' + args.join(',') + '){' + code + '}'); }; var doEval = function(t) { try { return doEval_(t); } catch (err) { console.log('Template Error: ', err); console.log(code); return aconstant(function() {return 'TemplateError: Check console.';}); } }; var i = TEMPLATE_FUNCTIONS.length; TEMPLATE_FUNCTIONS[i] = ''; return aseq( t.futureTemplate, function(ret, t) { doEval(t)(ret); }, function(ret, f) { TEMPLATE_FUNCTIONS[i] = f; ret(f); }); }; }
'use strict'; let lib = { "_id": "5e409c94c5a59210a815262c", "name": "pay", "description": "MS pay service for marketplace", "type": "service", "configuration": { "subType": "ecommerce", "port": 4102, "group": "Marketplace", "requestTimeout": 30, "requestTimeoutRenewal": 5, "maintenance": { "port": { "type": "maintenance" }, "readiness": "/heartbeat" } }, "versions": [ { "version": "1", "extKeyRequired": true, "oauth": true, "provision_ACL": false, "tenant_Profile": false, "urac": false, "urac_ACL": false, "urac_Config": false, "urac_GroupConfig": false, "urac_Profile": false, "apis": [ { l: "pay items", v: "/pay", m: "post", group: "Pay" }, { l: "Get all pay ", v: "/pays", m: "get", group: "Pay" } ], "documentation": {} } ], "metadata": { "tags": ["order", "ecommerce"], "program": ["marketplace"] }, "ui": { "main": "Gateway", "sub": "" }, "settings": { "acl": { "public": { "ro": true } }, "recipes": [], "environments": {} }, "src": { "provider": "github", "owner": "ht", "repo": "mkpl.order" } }; module.exports = lib;
/* ========================================================== * bootstrap-affix.js v2.2.2 * http://twitter.github.com/bootstrap/javascript.html#affix * ========================================================== * Copyright 2012 Twitter, 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. * ========================================================== */ !function ($) { "use strict"; // jshint ;_; /* AFFIX CLASS DEFINITION * ====================== */ var Affix = function (element, options) { this.options = $.extend({}, $.fn.affix.defaults, options) this.$window = $(window) .on('scroll.affix.data-api', $.proxy(this.checkPosition, this)) .on('click.affix.data-api', $.proxy(function () { setTimeout($.proxy(this.checkPosition, this), 1) }, this)) this.$element = $(element) this.checkPosition() } Affix.prototype.checkPosition = function () { if (!this.$element.is(':visible')) return var scrollHeight = $(document).height() , scrollTop = this.$window.scrollTop() , position = this.$element.offset() , offset = this.options.offset , offsetBottom = offset.bottom , offsetTop = offset.top , reset = 'affix affix-top affix-bottom' , affix if (typeof offset != 'object') offsetBottom = offsetTop = offset if (typeof offsetTop == 'function') offsetTop = offset.top() if (typeof offsetBottom == 'function') offsetBottom = offset.bottom() affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' : offsetTop != null && scrollTop <= offsetTop ? 'top' : false if (this.affixed === affix) return this.affixed = affix this.unpin = affix == 'bottom' ? position.top - scrollTop : null this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : '')) } /* AFFIX PLUGIN DEFINITION * ======================= */ var old = $.fn.affix $.fn.affix = function (option) { return this.each(function () { var $this = $(this) , data = $this.data('affix') , options = typeof option == 'object' && option if (!data) $this.data('affix', (data = new Affix(this, options))) if (typeof option == 'string') data[option]() }) } $.fn.affix.Constructor = Affix $.fn.affix.defaults = { offset: 0 } /* AFFIX NO CONFLICT * ================= */ $.fn.affix.noConflict = function () { $.fn.affix = old return this } /* AFFIX DATA-API * ============== */ $(window).on('load', function () { $('[data-spy="affix"]').each(function () { var $spy = $(this) , data = $spy.data() data.offset = data.offset || {} data.offsetBottom && (data.offset.bottom = data.offsetBottom) data.offsetTop && (data.offset.top = data.offsetTop) $spy.affix(data) }) }) }(window.jQuery);
describe('Service: angelloModel', function() { //load module for service beforeEach(module('Angello')); var modelService; beforeEach(inject(function(angelloModel) { modelService = angelloModel; })); describe('#getStatuses', function() { it('should return seven different statuses', function() { expect(modelService.getStatuses().length).toBe(7); }); it('should have a status named "To Do"', function() { expect(modelService.getStatuses().map(function(status) { // get just the name of each status return status.name; })).toContain('To Do'); }); describe('#getTypes', function() { it('should return four different types', function() { expect(modelService.getTypes().length).toBe(4); }); it('should have a type named "Bug"', function() { expect(modelService.getTypes().map(function(status) { // get just the name of each status return status.name; })). toContain('Bug'); }); }); describe('#getStories', function() { it('should return six different stories', function() { expect(modelService.getStories().length).toBe(6); }); it('should return stories that have a description property', function() { modelService.getStories().forEach(function(story) { expect(story.description).toBeDefined(); }); }); }); }); });
// Alias to import the folder import Logo from './Logo'; export default Logo;
var extend = require('node.extend'); var PersistentCollection = require('./persistent-collection'); var preference = require('../model/preference'); var preferences = extend(true, {}, new PersistentCollection(), function() { "use strict"; return { collectionName: 'preferences', fieldDefinition: preference }; }()); module.exports = preferences;
import React from 'react' import GenericField from './genericfield' import {object_is_equal, map_drop} from 'app/utils' import PropTypes from 'prop-types' import uuid4 from 'uuid/v4' class GenericForm extends React.Component{ constructor(props){ super(props) this.state = this.getInitialState(props) this.state.form_id = uuid4() this.updateForm = _.debounce(this.updateForm, 100) } getInitialState(props){ props = props || this.props let state={}; (props.fields || []).map((f) => { if (f.name){ let v = f.value if (v == undefined){ if (f.default == undefined) v = "" else v = f.default } state[f.name]=v } }) if (props.data){ Object.keys(props.data).map( (k) => { if (k){ state[k]=props.data[k] }}) } return state } setValue(k, v){ let update = {[k]: v } this.setState( update ) let nstate=Object.assign({}, this.state, update ) // looks like react delays state change, I need it now //console.log(nstate, this.props) this.updateForm() } componentWillReceiveProps(newprops){ if (!object_is_equal(newprops.fields, this.props.fields) || !object_is_equal(newprops.data, this.props.data)){ this.setState( this.getInitialState(newprops) ) } } componentDidMount(){ let fields = {}; (this.props.fields || []).map((f) => { if (f.validation) fields[f.name]=f.validation }) $(this.refs.form).form({ on: 'blur', fields }).on('submit', function(ev){ ev.preventDefault() }) this.updateForm() } updateForm(){ if (this.props.updateForm){ const data = map_drop(this.state, ["form_id"]) this.props.updateForm(data) } } render(){ const props=this.props return ( <form ref="form" className={`ui form ${props.className || ""}`} onSubmit={(ev) => { ev.preventDefault(); props.onSubmit && props.onSubmit(ev) }}> {(props.fields || []).map((f, i) => ( <GenericField {...f} key={f.name || i} setValue={(v) => this.setValue(f.name, v)} value={this.state[f.name]} fields={props.fields} form_data={this.state} /> ))} {props.children} </form> ) } } GenericForm.propTypes = { fields: PropTypes.arrayOf( PropTypes.shape({ label: PropTypes.string, name: PropTypes.string, description: PropTypes.string, type: PropTypes.string, value: PropTypes.oneOfType([PropTypes.string, PropTypes.Boolean]), params: PropTypes.string, }).isRequired).isRequired, data: PropTypes.object, updateForm: PropTypes.func.isRequired } export default GenericForm
'use strict'; var chai = require('chai'); var supertest = require('supertest'); var api = supertest('https://apis-bank-dev.apigee.net'); // supertest init; chai.should(); describe('/branches', function() { describe('get', function() { it('should respond with 200 OK', function(done) { this.timeout(0); api.get('/apis/v1/locations/branches') .expect(200) .end(function(err, res) { if (err) return done(err); done(); }); }); }); });
import React from 'react'; import { screen } from '@testing-library/react'; import { createMemoryHistory } from 'history'; import '__mock__/stripesCore.mock'; import renderWithRouter from 'helpers/renderWithRouter'; import account from 'fixtures/account'; import openLoans from 'fixtures/openLoans'; import okapiCurrentUser from 'fixtures/okapiCurrentUser'; import AccountDetails from './AccountDetails'; jest.mock('../../components/Accounts/Actions/FeeFineActions', () => () => <></>); jest.unmock('@folio/stripes/components'); const history = createMemoryHistory(); const props = { history, location: history.location, match: { params: { } }, isLoading: false, resources: { feefineshistory: { records: [] }, accountActions: {}, accounts: {}, feefineactions: {}, loans: {}, user: { update: jest.fn(), }, }, mutator: { activeRecord: { update: jest.fn(), }, feefineactions: { POST: jest.fn(), }, accountActions: { GET: jest.fn(), }, user: { update: jest.fn(), } }, num: 42, user: { id: '123' }, patronGroup: { group: 'Shiny happy people' }, itemDetails: {}, stripes: { hasPerm: () => true, }, account, owedAmount: 45.67, intl: {}, okapi: { url: 'https://localhost:9130', tenant: 'diku', okapiReady: true, authFailure: [], bindings: {}, currentUser: okapiCurrentUser, }, }; const accountWithLoan = { ...account, barcode: openLoans[0].item.barcode, loanId: openLoans[0].id, }; const accountWithAnonymizedLoan = { ...account, barcode: 'b612', }; const loanResources = { ...props.resources, loans: { records: openLoans, } }; const renderAccountDetails = (extraProps = {}) => renderWithRouter( <AccountDetails {...props} {...extraProps} /> ); afterEach(() => jest.clearAllMocks()); describe('Account Details', () => { test('without loan', () => { renderAccountDetails({ account }); expect(screen.getByTestId('loan-details')).toHaveTextContent(/-$/); }); test('with loan', () => { renderAccountDetails({ account: accountWithLoan, resources: loanResources }); expect(screen.getByTestId('loan-details')).toHaveTextContent(/ui-users.details.field.loan$/); }); test('with anonymized loan', () => { renderAccountDetails({ account: accountWithAnonymizedLoan, resources: loanResources }); expect(screen.getByTestId('loan-details')).toHaveTextContent(/ui-users.details.label.loanAnonymized$/); }); });
// this sets the background color of the master UIView (when there are no windows/tab groups on it) Titanium.UI.setBackgroundColor('#000'); Ti.API.info( "Platform: " + Titanium.Platform.name ); ///////////////////////////////////////////// // Global Variables ///////////////////////////////////////////// var site_url = 'http://www.wedvite.us/'; var idKey = ''; // This is the event_id_seq // Arbitrary Windows var arbitraryWinID = ''; var textAboutUs = ''; var textWeddingParty = ''; ///////////////////////////////////////////// // Creating All Windows ///////////////////////////////////////////// var windowLogin = Titanium.UI.createWindow({ title:'User Authentication', url:'main_windows/login.js', exitOnClose: true }); var windowHome = Titanium.UI.createWindow({ title:'Home Page', url:'main_windows/home.js' }); var windowEventInfo = Titanium.UI.createWindow({ title:'Event Info', url:'main_windows/eventInfo.js' }); var windowMap = Titanium.UI.createWindow({ title:'Map', url:'main_windows/map.js' }); var windowRsvp = Titanium.UI.createWindow({ title:'RSVP', url:'main_windows/rsvp.js' }); var windowArbitrary = Titanium.UI.createWindow({ title:'Arbitrary', url:'main_windows/arbitrary.js' }); // This window just displays a picture var windowFullPhoto = Titanium.UI.createWindow({ title:'Full PHoto', url:'main_windows/photoFullScreen.js' }); var windowPhotos = Titanium.UI.createWindow({ title:'Guests Photos', url:'main_windows/photos.js' }); var windowGiftRegistry = Titanium.UI.createWindow({ title:'Gift Registry', url:'main_windows/giftRegistry.js' }); var windowLBS = Titanium.UI.createWindow({ title:'Location Based Search', url:'main_windows/lbs.js' }); var windowLocationList = Titanium.UI.createWindow({ title:'LBS Location List', url:'main_windows/lbsLocationList.js' }); var windowLocationDetail = Titanium.UI.createWindow({ title:'LBS Location Details', url:'main_windows/lbsLocationDetails.js' }); var windowWeddingComments = Titanium.UI.createWindow({ title:'Wedding Comments', url:'main_windows/weddingComments.js' }); var windowComments = Titanium.UI.createWindow({ title:'Comment Anything Page', url:'main_windows/comments.js' }); var windowAnonymousLogin = Titanium.UI.createWindow({ title:'Anonymous Login', url:'main_windows/anonymousLogin.js' }); ///////////////////////////////////////////// // Creating App Objects ///////////////////////////////////////////// // Can only have one map view. Creating it here and passing it around var mapview = Titanium.Map.createView({ top:40, mapType: Titanium.Map.STANDARD_TYPE, animate:true, regionFit:true, userLocation:false }); // Having problems with webviews. Trying to create one and pass it around var webview = Titanium.UI.createWebView({ top:40, scalesPageToFit:false }); // Create our HTTP Client and name it "loader" //var loader = Titanium.Network.createHTTPClient(); ///////////////////////////////////////////// // Passing Variables to Each Window ///////////////////////////////////////////// // Login Window windowLogin.windowHome = windowHome; windowLogin.windowAnonymousLogin = windowAnonymousLogin; windowLogin.idkey = idKey; windowLogin.site_url = site_url; //windowLogin.loader = loader; // Home Screen Window windowHome.windowLogin = windowLogin; windowHome.windowEventInfo = windowEventInfo; windowHome.windowMap = windowMap; windowHome.mapview = mapview; windowHome.windowRsvp = windowRsvp; windowHome.idKey = idKey; windowHome.site_url = site_url; windowHome.windowArbitrary = windowArbitrary; windowHome.windowFullPhoto = windowFullPhoto; windowHome.windowPhotos = windowPhotos; windowHome.windowGiftRegistry = windowGiftRegistry; windowHome.windowLBS = windowLBS; windowHome.windowWeddingComments = windowWeddingComments; //windowHome.loader = loader; // Event Info Window windowEventInfo.windowHome = windowHome; windowEventInfo.idKey = idKey; windowEventInfo.site_url = site_url; //windowEventInfo.loader = loader; // Map Window windowMap.windowHome = windowHome; windowMap.mapview = mapview; windowMap.idKey = idKey; windowMap.site_url = site_url; //windowMap.loader = loader; // RSVP Window windowRsvp.windowHome = windowHome; windowRsvp.site_url = site_url; //windowRsvp.loader = loader; // Arbitrary Window windowArbitrary.windowHome = windowHome; windowArbitrary.site_url = site_url; //windowArbitrary.loader = loader; // Full Photo Window windowFullPhoto.windowHome = windowHome; windowFullPhoto.windowPhotos = windowPhotos; //windowFullPhoto.webview = webview; windowFullPhoto.windowComments = windowComments; // Photos windowPhotos.windowHome = windowHome; windowPhotos.windowFullPhoto = windowFullPhoto; windowPhotos.site_url = site_url; windowPhotos.idKey = idKey; //windowPhotos.loader = loader; // Gift Registry windowGiftRegistry.site_url = site_url; windowGiftRegistry.windowHome = windowHome; windowGiftRegistry.idKey = idKey; // LBS windowLBS.windowHome = windowHome; windowLBS.windowLocationList = windowLocationList; windowLBS.mapview = mapview; // LBS -> Category List windowLocationList.windowLocationDetail = windowLocationDetail; // LBS -> Category List -> Detail Page with map windowLocationDetail.windowLBS = windowLBS; // Wedding Comments windowWeddingComments.windowHome = windowHome; windowWeddingComments.idKey = idKey; windowWeddingComments.webview = webview; windowWeddingComments.site_url = site_url; // Comment Anything Page windowComments.webview = webview; windowComments.site_url = site_url; // Anonymous Login Screen windowAnonymousLogin.windowLogin = windowLogin; ///////////////////////////////////////////// // Open First Window ///////////////////////////////////////////// windowLogin.open();
// This is a manifest file that'll be compiled into application.js, which will include all the files // listed below. // // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. // // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the // the compiled file. // // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD // GO AFTER THE REQUIRES BELOW. // //= require jquery //= require jquery_ujs //= require jquery.Jcrop.min //= require bootstrap //= require bootstrap-datepicker //= require jquery-fileupload/basic //= require attendances //= require courses //= require jcrop_mugshot //= require people //= require rolls //= require users //= require hogan-2.0.0 //= require typeahead //= require people_typeahead //= require underscore //= require jquery.tokeninput //= require token-input-wireup //= require_tree . function initializeDatePicker() { $('input.date_picker').datepicker({ autoclose: true, todayHighlight: true, dateFormat: 'mm/dd/yyyy' }); } $(document).ready(initializeDatePicker); $(document).on('page:change', initializeDatePicker); // whenever the bootstrap modal closes, reset it's contents $(function() { $('#myModal').on('hidden', function () { $('#myModal div.modal-body').html("<p>Loading... <i class=\"icon-refresh\"></i></p>"); $('#myModalLabel').text(''); }); }); // handle link_to remote and replace contents into data-replace id element $(function() { $(document) .data('type', 'html') .delegate('[data-remote][data-replace]', 'ajax:success', function(event, data) { var $this = $(this); $($this.data('replace')).html(data); $this.trigger('ajax:replaced'); }); });
var searchData= [ ['scroll',['scroll',['../select2_8js.html#a6e3896ca7181e81b7757bfcca39055ec',1,'select2.js']]], ['scrollbardimensions',['scrollBarDimensions',['../select2_8js.html#a30eb565a7710bd54761b6bfbcfd9d3fd',1,'select2.js']]], ['select',['select',['../select2_8js.html#ac07257b5178416a2fbbba7365d2703a6',1,'select2.js']]], ['select2',['Select2',['../select2_8js.html#affb4af66e7784ac044be37289c148953',1,'Select2():&#160;select2.js'],['../select2_8js.html#a30a3359bfdd9ad6a698d6fd69a38a76a',1,'select2():&#160;select2.js']]], ['self',['self',['../select2_8js.html#ab3e74e211b41d329801623ae131d2585',1,'select2.js']]], ['singleselect2',['SingleSelect2',['../select2_8js.html#ab661105ae7b811b84224646465ea5c63',1,'select2.js']]], ['sizer',['sizer',['../select2_8js.html#a9db90058e07b269a04a8990251dab3c4',1,'select2.js']]], ['sn',['sn',['../j_query_8js.html#a70ece1b3f74db2cb3cb7e4b72d59b226',1,'jQuery.js']]] ];
/* globals define */ define(function(require, exports, module) { "use strict"; // Import famo.us dependencies var Engine = require("famous/core/Engine"); var FastClick = require("famous/inputs/FastClick"); // Create main application view var AppView = require("views/AppView"); var context = Engine.createContext(); context.setPerspective(2000); var view = new AppView(); context.add(view); });
/* global define */ define([ 'jquery', 'marionette' ], function($, Marionette) { var CountItem = Marionette.ItemView.extend({ tagName: 'tr', template: 'stats/count-item' }); var CountList = Marionette.CompositeView.extend({ template: 'stats/count-list', itemView: CountItem, itemViewContainer: 'tbody', ui: { 'statsTable': 'table', 'loader': '.loading-message' }, events: { 'click thead th': 'handleSort' }, collectionEvents: { 'sort': '_renderChildren', 'request': 'showLoader', 'reset': 'hideLoader' }, hideLoader: function() { this.ui.loader.hide(); this.ui.statsTable.show(); }, showLoader: function() { this.ui.loader.show(); this.ui.statsTable.hide(); }, handleSort: function(event) { if (!this.collection.length) return; this.applySort($(event.target).data('sort')); }, applySort: function(attr) { var dir = 'asc'; // Already sorted by the attribute, cycle direction. if (this.collection._sortAttr === attr) { dir = this.collection._sortDir === 'asc' ? 'desc' : 'asc'; } this.$('[data-sort=' + this.collection._sortAttr + ']') .removeClass(this.collection._sortDir); this.$('[data-sort=' + attr + ']').addClass(dir); // Reference for cycling. this.collection._sortAttr = attr; this.collection._sortDir = dir; // Parse function for handling the sort attributes. var parse = function(v) { return v; }; this.collection.comparator = function(m1, m2) { var v1 = parse(m1.get(attr)), v2 = parse(m2.get(attr)); if (v1 < v2) return (dir === 'asc' ? -1 : 1); if (v1 > v2) return (dir === 'asc' ? 1 : -1); return 0; }; this.collection.sort(); } }); return { CountList: CountList }; });
var proj4 = require('proj4'); var transformCoordinates = function transformCoordinates(fromProjection, toProjection, coordinates) { proj4.defs([ [ 'EPSG:3006', '+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs' ], [ 'EPSG:3007', '+proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs' ], [ 'EPSG:3008', '+proj=tmerc +lat_0=0 +lon_0=13.5 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs' ], [ 'EPSG:3009', '+proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs' ], [ 'EPSG:3010', '+proj=tmerc +lat_0=0 +lon_0=16.5 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs' ], [ 'EPSG:3011', '+proj=tmerc +lat_0=0 +lon_0=18 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs' ], [ 'EPSG:3012', '+proj=tmerc +lat_0=0 +lon_0=14.25 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs' ], [ 'EPSG:3013', '+proj=tmerc +lat_0=0 +lon_0=15.75 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs' ], [ 'EPSG:3014', '+proj=tmerc +lat_0=0 +lon_0=17.25 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs' ], [ 'EPSG:3015', '+proj=tmerc +lat_0=0 +lon_0=18.75 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs' ], [ 'EPSG:3016', '+proj=tmerc +lat_0=0 +lon_0=20.25 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs' ], [ 'EPSG:3017', '+proj=tmerc +lat_0=0 +lon_0=21.75 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs' ], [ 'EPSG:3018', '+proj=tmerc +lat_0=0 +lon_0=23.25 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs' ] ]); // If the projections is the same do nothing otherwise try transform if (fromProjection === toProjection) { return coordinates; } else { try { return proj4('EPSG:' + fromProjection, 'EPSG:' + toProjection, coordinates); } catch (e) { console.error('Error: ' + e); return coordinates; } } } module.exports = transformCoordinates;
/* */ "format cjs"; /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @module * @description * Entry point for all public APIs of the common/testing package. */ export { SpyLocation } from './location_mock'; export { MockLocationStrategy } from './mock_location_strategy'; //# sourceMappingURL=index.js.map
// This file was procedurally generated from the following sources: // - src/dstr-binding/obj-ptrn-id-get-value-err.case // - src/dstr-binding/error/gen-func-decl-dflt.template /*--- description: Error thrown when accessing the corresponding property of the value object (generator function declaration (default parameter)) esid: sec-generator-function-definitions-runtime-semantics-instantiatefunctionobject es6id: 14.4.12 features: [generators, destructuring-binding, default-parameters] flags: [generated] info: | GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody } [...] 2. Let F be GeneratorFunctionCreate(Normal, FormalParameters, GeneratorBody, scope, strict). [...] 9.2.1 [[Call]] ( thisArgument, argumentsList) [...] 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList). [...] 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList ) 1. Let status be FunctionDeclarationInstantiation(F, argumentsList). [...] 9.2.12 FunctionDeclarationInstantiation(func, argumentsList) [...] 23. Let iteratorRecord be Record {[[iterator]]: CreateListIterator(argumentsList), [[done]]: false}. 24. If hasDuplicates is true, then [...] 25. Else, b. Let formalStatus be IteratorBindingInitialization for formals with iteratorRecord and env as arguments. [...] 13.3.3.7 Runtime Semantics: KeyedBindingInitialization SingleNameBinding : BindingIdentifier Initializeropt [...] 4. Let v be GetV(value, propertyName). 5. ReturnIfAbrupt(v). ---*/ var poisonedProperty = Object.defineProperty({}, 'poisoned', { get: function() { throw new Test262Error(); } }); function* f({ poisoned } = poisonedProperty) {} assert.throws(Test262Error, function() { f(); });
// This file was procedurally generated from the following sources: // - src/dstr-binding/ary-ptrn-elem-obj-val-undef.case // - src/dstr-binding/error/cls-expr-meth.template /*--- description: Nested object destructuring with a value of `undefined` (class expression method) esid: sec-class-definitions-runtime-semantics-evaluation es6id: 14.5.16 features: [destructuring-binding] flags: [generated] info: | ClassExpression : class BindingIdentifieropt ClassTail 1. If BindingIdentifieropt is not present, let className be undefined. 2. Else, let className be StringValue of BindingIdentifier. 3. Let value be the result of ClassDefinitionEvaluation of ClassTail with argument className. [...] 14.5.14 Runtime Semantics: ClassDefinitionEvaluation 21. For each ClassElement m in order from methods a. If IsStatic of m is false, then i. Let status be the result of performing PropertyDefinitionEvaluation for m with arguments proto and false. [...] 14.3.8 Runtime Semantics: DefineMethod MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody } [...] 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody, scope, strict). If functionPrototype was passed as a parameter then pass its value as the functionPrototype optional argument of FunctionCreate. [...] 9.2.1 [[Call]] ( thisArgument, argumentsList) [...] 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList). [...] 9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList ) 1. Let status be FunctionDeclarationInstantiation(F, argumentsList). [...] 9.2.12 FunctionDeclarationInstantiation(func, argumentsList) [...] 23. Let iteratorRecord be Record {[[iterator]]: CreateListIterator(argumentsList), [[done]]: false}. 24. If hasDuplicates is true, then [...] 25. Else, b. Let formalStatus be IteratorBindingInitialization for formals with iteratorRecord and env as arguments. [...] 13.3.3.6 Runtime Semantics: IteratorBindingInitialization BindingElement : BindingPattern Initializeropt 1. If iteratorRecord.[[done]] is false, then [...] e. Else i. Let v be IteratorValue(next). [...] 4. Return the result of performing BindingInitialization of BindingPattern with v and environment as the arguments. 13.3.3.5 Runtime Semantics: BindingInitialization BindingPattern : ObjectBindingPattern 1. Let valid be RequireObjectCoercible(value). 2. ReturnIfAbrupt(valid). ---*/ var C = class { method([{ x }]) {} }; var c = new C(); assert.throws(TypeError, function() { c.method([]); });
'use strict' class ScheduleEvents { constructor (aws) { // Authenticated `aws` object in `lib/main.js` this.lambda = new aws.Lambda({ apiVersion: '2015-03-31' }) this.cloudwatchevents = new aws.CloudWatchEvents({ apiVersion: '2015-10-07' }) } _ruleDescription (params) { if ('ScheduleDescription' in params && params.ScheduleDescription != null) { return `${params.ScheduleDescription}` } return `${params.ScheduleName} - ${params.ScheduleExpression}` } _functionName (params) { return params.FunctionArn.split(':').pop() } _putRulePrams (params) { return { Name: params.ScheduleName, Description: this._ruleDescription(params), State: params.ScheduleState, ScheduleExpression: params.ScheduleExpression } } _putRule (params) { // return RuleArn if created return new Promise((resolve, reject) => { const _params = this._putRulePrams(params) this.cloudwatchevents.putRule(_params, (err, rule) => { if (err) reject(err) resolve(rule) }) }) } _addPermissionParams (params) { return { Action: 'lambda:InvokeFunction', FunctionName: this._functionName(params), Principal: 'events.amazonaws.com', SourceArn: params.RuleArn, StatementId: params.ScheduleName } } _addPermission (params) { return new Promise((resolve, reject) => { const _params = this._addPermissionParams(params) this.lambda.addPermission(_params, (err, data) => { if (err) { if (err.code !== 'ResourceConflictException') reject(err) // If it exists it will result in an error but there is no problem. resolve('Permission already set') } resolve(data) }) }) } _putTargetsParams (params) { return { Rule: params.ScheduleName, Targets: [{ Arn: params.FunctionArn, Id: this._functionName(params), Input: params.hasOwnProperty('Input') ? JSON.stringify(params.Input) : '' }] } } _putTargets (params) { return new Promise((resolve, reject) => { const _params = this._putTargetsParams(params) this.cloudwatchevents.putTargets(_params, (err, data) => { // even if it is already registered, it will not be an error. if (err) reject(err) resolve(data) }) }) } add (params) { return Promise.resolve().then(() => { return this._putRule(params) }).then(rule => { return this._addPermission(Object.assign(params, rule)) }).then(data => { return this._putTargets(params) }) } } module.exports = ScheduleEvents
var middleware = require('../../middleware') ; function handler (req, res, next) { var profile = { }; res.send(200, res.profile); next( ); return; } var endpoint = { path: '/users/:user/create' , method: 'get' , handler: handler }; module.exports = function configure (opts, server) { function mount (server) { server.get(endpoint.path, endpoint.middleware, updateUser, endpoint.handler); } var userInfo = middleware.minUser(opts, server); var mandatory = middleware.mandatory(opts, server); endpoint.middleware = mandatory.concat(userInfo); function updateUser (req, res, next) { var profile = { }; var name = req.params.user; var update = req.params; server.updateUser(name, update, {save:false, create:true}, function (result) { server.log.debug('UPDATED user', arguments); res.profile = result; next( ); }); } endpoint.mount = mount; return endpoint; }; module.exports.endpoint = endpoint;
if(!org) var org={}; if(!org.judison) org.judison={}; if(!org.judison.bmsp) org.judison.bmsp={}; with(org.judison.bmsp){ init = function(){ document.getElementById("bookmarks-view").place = "place:queryType=1&folder=" + window.top.PlacesUtils.bookmarksMenuFolderId; } }
import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; import App from './App'; console.log(process.env.NODE_ENV); ReactDOM.render(<App />, document.getElementById('root'));
define( ['helper/english', 'vendor/underscore'], function(englishHelper, _){ var persons, irregularVerbs; /** * @type {Array} */ persons = ['s1', 's2', 's3', 'p1', 'p2', 'p3']; irregularVerbs = { be: { present: ['am', 'are', 'is', 'are', 'are', 'are'], past: ['was', 'were', 'was', 'were', 'were', 'were'] }, have: { present: 'has', past: 'had' } }; /** * * @param {String} verb * @param {String} person * @return {Object} */ function irregularPresent(verb, person) { var result = false, personIndex; if (typeof irregularVerbs[verb] != 'undefined' && typeof irregularVerbs[verb].present != 'undefined') { result = irregularVerbs[verb].present; if (_.isArray(result)) { personIndex = persons.indexOf(person); return {result: result[personIndex], personalize: false}; } if ('s3' == person) { return {result: result, personalize: false}; } } return {result: verb, personalize: true}; } /** * * @param {String} defaultForm present tense, plural, 3rd person * @param {String} person to use, one of s1-s3, p1-p3 * @return {String} */ function personalize(defaultForm, person){ var shortenedVerb; switch (person) { case 's3': shortenedVerb = defaultForm.substr(0, defaultForm.length - 1); if (englishHelper.checkConsonantEnding(shortenedVerb)) { if (defaultForm[defaultForm.length-1] == 'y') { return shortenedVerb + 'ies'; } else if (defaultForm[defaultForm.length-1] == 'o') { return defaultForm + 'es'; } } return defaultForm + 's'; default: return defaultForm; } } /** * * @param {String} defaultForm present tense, plural, 3rd person * @param {String} person to use, one of s1-s3, p1-p3 * @return {*} */ function present(defaultForm, person){ var irregularResult, personIndex; personIndex = persons.indexOf(person); if (personIndex == -1) { throw 'Given person is not allowed'; } irregularResult = irregularPresent(defaultForm, person); if (irregularResult.personalize) { return personalize(irregularResult.result, person); } return irregularResult.result; } return { present: present }; } );
var Tag = require('./tag'); var ScriptTag = require('./script-tag'); var Utils = require('./../utils'); /** * Script tag class that is loaded in a synchronous way. * * This is the class that will generate script tags that will be appended to the * page using the document.write method. * * @param string The tag data. * @param TagLoader The loader instance that has instantiated the tag. * * @return void */ class SynchronousScriptTag extends ScriptTag { constructor(data = {}, loader_instance) { super(data, loader_instance); this.data = Utils.mergeObject(this.data, { attributes: { async: false, defer: false } }, false); this.data = Utils.mergeObject(this.data, data); if (this.data !== data) { this.data = Utils.getSanitizedObject(this.data, Tag.properties); } } /** * Returns the script node that will be appended to the DOM. * * @return HTMLElement */ getDomNode() { var s, data; if (!this.data.src) { return false; } if (Utils.isDomReady() === true) { data = Utils.mergeObject({}, this.data, false); data.type = 'script'; this.loader_instance.addToQueue([data]); return false; } s = this.getScriptNode(false); s.text = this.getDomNodeSource(s); return s; } /** * Returns the JS code that will insert the script source using * document.write. * * @return string */ getDomNodeSource(s) { var text; text = 'document.write(\'<script src="' + this.data.src + '"'; text += ' id="' + this.data.id + '"'; if (s.addEventListener) { text += ' onload="' + this.getOnTagLoadPageCode() + '"'; } else { text += ' onreadystatechange="' + this.getIeOnLoadFunction() + '"'; } text += '></scr' + 'ipt>\');'; return text; } /** * Returns function that will be called only on older IE versions when the * tag has been loaded by the browser. * * @return string */ getIeOnLoadFunction() { var text = ''; text += 'if (this.addEventListener || '; text += 'this.amc_load || '; text += '(this.readyState && '; text += 'this.readyState !== \\\'complete\\\')'; text += ') { return; } '; text += 'this.amc_load = true; '; text += this.getOnTagLoadPageCode(); return text; } } module.exports = SynchronousScriptTag;
(function() { 'use strict'; angular.module('character-tracker.charactersheet') .controller('GearController', GearController); GearController.$inject =['GearService', 'InventoryService', '$scope']; function GearController(GearService, InventoryService, $scope) { var vm = this; var currentItem = ''; vm.inventory = InventoryService.getItems(); vm.gearSlots = GearService.getGearSlots(); vm.equipItem = function (item, slot){ if (item.equipped) { vm.unequipItem(item); } for (i = 0; i < vm.gearSlots.length; i++) { if (vm.gearSlots[i].slot === slot) { vm.gearSlots[i].equipped = true; vm.gearSlots[i].equippedItem = item; } } InventoryService.equipItem(item); } vm.unequipItem = function(item) { for (i = 0; i < vm.gearSlots.length; i++) { if (vm.gearSlots[i].equippedItem == item) { vm.gearSlots[i].equippedItem = {}; } InventoryService.unequipItem(item); } } vm.getItemAtSlot = function(slot) { currentItem = InventoryService.getItemAtSlot(slot); } init(); function init() { $.material.init(); } return vm; } }());
module.exports = { selector: '.skilifts .skilift', parse: { name: 1, status: { child: 0, attribute: 'class', regex: / ([a-z]+)$/ } } };
function postTodo ({input, state, output, services}) { const todo = state.get(`app.todos.${input.ref}`) services.http.post('/api/todos', todo) .then(output.success) .catch(output.error) } postTodo.async = true postTodo.outputs = ['success', 'error'] export default postTodo
'use strict'; angular.module('user-filters') .directive('zoUserFilters', function(){ return { restrict: 'E', replace: true, templateUrl: 'app/user-filters/list-directive.html', controller: 'UserFiltersDirectiveCtrl' } }) .controller('UserFiltersDirectiveCtrl', ['$scope', function($scope){ }]);
import React from 'react'; import PrivateRoute from '../../../routes/PrivateRoute'; import TextNodesEditorLayout from '../layouts/TextNodesLayout/TextNodesEditorLayout'; export default ( <PrivateRoute exact path="/textNodes/edit" component={TextNodesEditorLayout} roles={['commenter', 'editor', 'admin']} /> );
var slug = require('slug'); var async = require('async'); var _ = require('underscore'); var kwery = require('kwery'); var functions = { getInstances: function (state, next) { var result = kwery.flat(state.db, { path: new RegExp('^' + state.data.path + '(/|$)') }); result.many(function (instances) { state.instances = instances; next(null, state); }); }, parentData: function (state, next) { // Get parent data if parent exists if (!state.data.parent) { return next(null, state); } if (state.data.parent === '/') { state.parent = { path: '/', sort: [], }; return next(null, state); } var result = kwery.flat(state.db, { path: state.data.parent }); result.one(function (instance) { state.parent = instance; next(null, state); }); }, targetData: function (state, next) { // Instance that's being updated var target = JSON.parse(JSON.stringify(state.instances[0])); _.extend(target, state.data); target.order = state.data.order || target.sort[target.sort.length - 1]; target.sort[target.sort.length - 1] = target.order; delete target.parent; if (state.parent) { target.path = (state.parent.path + '/' + slug(target.name).toLowerCase()).replace('//', '/'); target.sort = state.parent.sort.concat([target.sort[target.sort.length - 1]]); } else { target.path = target.path.substr(0, target.path.lastIndexOf('/') + 1) + slug(target.name).toLowerCase(); } state.target = target; next(null, state); }, instancesData: function (state, next) { var base; var instances = JSON.parse(JSON.stringify(state.instances)); var original = instances[0]; instances.forEach(function (instance, i) { if (i === 0) { instances[i] = state.target; } else { instance.path = instance.path.replace(new RegExp('^' + original.path), state.target.path); instance.sort = state.target.sort.concat(instance.sort.slice(original.sort.length)); } }); state.data_instances = instances; next(null, state); }, updateInstances: function (state, next) { var stored_instances = []; state.data_instances.forEach(function (instance, i) { stored_instances.push(_.extend(state.instances[i], instance)); }); state.stored_instances = stored_instances; next(null, state); }, }; module.exports = functions;
/** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule RelayDefaultNetworkLayer * @typechecks * @flow */ 'use strict'; var Promise = require('Promise'); import type RelayMutationRequest from 'RelayMutationRequest'; import type RelayQueryRequest from 'RelayQueryRequest'; var fetchWithRetries = require('fetchWithRetries'); import type {InitWithRetries} from 'fetchWithRetries'; type GraphQLError = { message: string; locations: Array<GraphQLErrorLocation>; }; type GraphQLErrorLocation = { column: number; line: number; }; class RelayDefaultNetworkLayer { _uri: string; _init: $FlowIssue; // InitWithRetries constructor(uri: string, init?: ?InitWithRetries) { this._uri = uri; this._init = {...init}; // Bind instance methods to facilitate reuse when creating custom network // layers. var self: any = this; self.sendMutation = this.sendMutation.bind(this); self.sendQueries = this.sendQueries.bind(this); self.supports = this.supports.bind(this); } sendMutation(request: RelayMutationRequest): Promise { return this._sendMutation(request).then( result => result.json() ).then(payload => { if (payload.hasOwnProperty('errors')) { var error = new Error( 'Server request for mutation `' + request.getDebugName() + '` ' + 'failed for the following reasons:\n\n' + formatRequestErrors(request, payload.errors) ); (error: any).source = payload; request.reject(error); } else { request.resolve({response: payload.data}); } }).catch( error => request.reject(error) ); } sendQueries(requests: Array<RelayQueryRequest>): Promise { return Promise.all(requests.map(request => ( this._sendQuery(request).then( result => result.json() ).then(payload => { if (payload.hasOwnProperty('errors')) { var error = new Error( 'Server request for query `' + request.getDebugName() + '` ' + 'failed for the following reasons:\n\n' + formatRequestErrors(request, payload.errors) ); (error: any).source = payload; request.reject(error); } else if (!payload.hasOwnProperty('data')) { request.reject(new Error( 'Server response was missing for query `' + request.getDebugName() + '`.' )); } else { request.resolve({response: payload.data}); } }).catch( error => request.reject(error) ) ))); } supports(...options: Array<string>): boolean { // Does not support the only defined option, "defer". return false; } /** * Sends a POST request with optional files. */ _sendMutation(request: RelayMutationRequest): Promise { var init; var files = request.getFiles(); if (files) { if (!global.FormData) { throw new Error('Uploading files without `FormData` not supported.'); } var formData = new FormData(); formData.append('query', request.getQueryString()); formData.append('variables', JSON.stringify(request.getVariables())); for (var filename in files) { if (files.hasOwnProperty(filename)) { formData.append(filename, files[filename]); } } init = { ...this._init, body: formData, method: 'POST', }; } else { init = { ...this._init, body: JSON.stringify({ query: request.getQueryString(), variables: request.getVariables(), }), headers: { ...this._init.headers, 'Content-Type': 'application/json', }, method: 'POST', }; } return fetch(this._uri, init).then(throwOnServerError); } /** * Sends a POST request and retries if the request fails or times out. */ _sendQuery(request: RelayQueryRequest): Promise { return fetchWithRetries(this._uri, { ...this._init, body: JSON.stringify({ query: request.getQueryString(), variables: request.getVariables(), }), headers: { ...this._init.headers, 'Content-Type': 'application/json', }, method: 'POST', }); } } /** * Rejects HTTP responses with a status code that is not >= 200 and < 300. * This is done to follow the internal behavior of `fetchWithRetries`. */ function throwOnServerError(response: any): any { if (response.status >= 200 && response.status < 300) { return response; } else { throw response; } } /** * Formats an error response from GraphQL server request. */ function formatRequestErrors( request: RelayMutationRequest | RelayQueryRequest, errors: Array<GraphQLError> ): string { var CONTEXT_BEFORE = 20; var CONTEXT_LENGTH = 60; var queryLines = request.getQueryString().split('\n'); return errors.map(({locations, message}, ii) => { var prefix = (ii + 1) + '. '; var indent = ' '.repeat(prefix.length); //custom errors thrown in graphql-server may not have locations var locationMessage = locations ? ('\n' + locations.map(({column, line}) => { var queryLine = queryLines[line - 1]; var offset = Math.min(column - 1, CONTEXT_BEFORE); return [ queryLine.substr(column - 1 - offset, CONTEXT_LENGTH), ' '.repeat(offset) + '^^^' ].map(messageLine => indent + messageLine).join('\n'); }).join('\n')) : ''; return prefix + message + locationMessage; }).join('\n'); } module.exports = RelayDefaultNetworkLayer;
$(document).ready(function(){ $('.service-wrapper img').hover( function(){ $(this).animate({'width':'100px'}); //$(this).next().css({'display':'none'}); }, function(){ $(this).animate({'width':'50px'}); //$(this).next().css({'display':'block'}); } ); /* $('.service-wrapper').hover(function () { $(this).css({'background':'red'}); })*/ }); /*$(document).ready(function(){ $('img').hover( function(){ $(this).animate({'width':'100px'}); //$(this).next().css({'display':'none'}); }, function(){ $(this).animate({'width':'50px'}); //$(this).next().css({'display':'block'}); } ); })*/
export default function(path, width, height) { this._images.push({path:path, width: width, height:height}) return this; };
/** * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ 'use strict'; const chalk = require('chalk'); const {KEYS} = require('../constants'); const runJestMock = jest.fn(); let terminalWidth; jest.mock('ansi-escapes', () => ({ clearScreen: '[MOCK - clearScreen]', cursorDown: (count = 1) => `[MOCK - cursorDown(${count})]`, cursorHide: '[MOCK - cursorHide]', cursorRestorePosition: '[MOCK - cursorRestorePosition]', cursorSavePosition: '[MOCK - cursorSavePosition]', cursorShow: '[MOCK - cursorShow]', cursorTo: (x, y) => `[MOCK - cursorTo(${x}, ${y})]`, })); jest.mock( '../search_source', () => class { findMatchingTests(pattern) { return {paths: []}; } }, ); jest.doMock('chalk', () => new chalk.constructor({enabled: false})); jest.doMock('strip-ansi'); require('strip-ansi').mockImplementation(str => str); jest.doMock( '../run_jest', () => function() { const args = Array.from(arguments); const [{onComplete}] = args; runJestMock.apply(null, args); // Call the callback onComplete({ snapshot: {}, testResults: [ { testResults: [{title: 'should return the correct index when'}], }, { testResults: [{title: 'should allow test siblings to modify'}], }, { testResults: [{title: 'might get confusing'}], }, { testResults: [ {title: 'should handle length properties that cannot'}, ], }, { testResults: [{title: 'should recognize various types'}], }, { testResults: [{title: 'should recognize null and undefined'}], }, { testResults: [{title: 'should not output colors to pipe'}], }, { testResults: [{title: 'should convert string to a RegExp'}], }, { testResults: [ {title: 'should escape and convert string to a RegExp'}, ], }, { testResults: [{title: 'should convert grep string to a RegExp'}], }, ], }); return Promise.resolve(); }, ); jest.doMock('../lib/terminal_utils', () => ({ getTerminalWidth: () => terminalWidth, })); const watch = require('../watch'); const toHex = char => Number(char.charCodeAt(0)).toString(16); const globalConfig = { watch: true, }; afterEach(runJestMock.mockReset); describe('Watch mode flows', () => { let pipe; let hasteMapInstances; let contexts; let stdin; beforeEach(() => { terminalWidth = 80; pipe = {write: jest.fn()}; hasteMapInstances = [{on: () => {}}]; contexts = [{config: {}}]; stdin = new MockStdin(); }); it('Pressing "T" enters pattern mode', () => { contexts[0].config = {rootDir: ''}; watch(globalConfig, contexts, pipe, hasteMapInstances, stdin); // Write a enter pattern mode stdin.emit(KEYS.T); expect(pipe.write).toBeCalledWith(' pattern › '); const assertPattern = hex => { pipe.write.mockReset(); stdin.emit(hex); expect(pipe.write.mock.calls.join('\n')).toMatchSnapshot(); }; // Write a pattern ['c', 'o', 'n', ' ', '1', '2'].map(toHex).forEach(assertPattern); [KEYS.BACKSPACE, KEYS.BACKSPACE].forEach(assertPattern); ['*'].map(toHex).forEach(assertPattern); // Runs Jest again runJestMock.mockReset(); stdin.emit(KEYS.ENTER); expect(runJestMock).toBeCalled(); // globalConfig is updated with the current pattern expect(runJestMock.mock.calls[0][0].globalConfig).toMatchObject({ onlyChanged: false, testNamePattern: 'con *', watch: true, watchAll: false, }); }); it('can select a specific test name from the typeahead results', () => { contexts[0].config = {rootDir: ''}; watch(globalConfig, contexts, pipe, hasteMapInstances, stdin); // Write a enter pattern mode stdin.emit(KEYS.T); // Write a pattern ['c', 'o', 'n'] .map(toHex) .concat([ KEYS.ARROW_DOWN, KEYS.ARROW_DOWN, KEYS.ARROW_DOWN, KEYS.ARROW_UP, ]) .forEach(key => stdin.emit(key)); stdin.emit(KEYS.ENTER); expect(runJestMock.mock.calls[1][0].globalConfig.testNamePattern).toBe( 'should convert string to a RegExp', ); }); it('Results in pattern mode get truncated appropriately', () => { contexts[0].config = {rootDir: ''}; watch(globalConfig, contexts, pipe, hasteMapInstances, stdin); stdin.emit(KEYS.T); [50, 30].forEach(width => { terminalWidth = width; stdin.emit(KEYS.BACKSPACE); pipe.write.mockReset(); stdin.emit(KEYS.T); expect(pipe.write.mock.calls.join('\n')).toMatchSnapshot(); }); }); }); class MockStdin { constructor() { this._callbacks = []; } setRawMode() {} resume() {} setEncoding() {} on(evt, callback) { this._callbacks.push(callback); } emit(key) { this._callbacks.forEach(cb => cb(key)); } }
/** * DOCUMENTANTION * ---------------------------------------------------------------------------- * Each key in the .eslintrc corresponds to a page in the rules directory. * [Rules on eslint.org]{@link http://eslint.org/docs/rules/} * * The rest of the otpiosn can be found here: * [Eslint Options][@link http://eslint.org/docs/user-guide/configuring] */ import project from './project'; // Read the eslintrc into JSON let config = project.getJSONConfig('.eslintrc'); /** * Add new rules to the linter */ Object.assign(config.rules, { /** * Since this tool will be used on linting production ready code * lets make it an error to have console statements in the code. */ 'no-console': 2 }); export default config;
var url = document.URL; var array = url.split("/"); var base = array[3]; if (array[2] == 'localhost') { var staticurl = '/' + base + '/client/dashboard/reporting'; //var url_action = array[6].split("?")[0]; } else { var staticurl = '/client/dashboard/reporting'; // var url_action = array[5].split("?")[0]; } $(document).ready(function(){ $('.basic_info_menu').click(function(){ $url = $(this).find('a').attr("href"); var res = $url.split("#"); var hash = '#'+res[1]; window.location.hash = hash; leftNavigation(); // now scroll to element with that id }); $('#selectall').click(function(){ var select = $("#selectall").is(":checked"); if(select) { $('.permission_check').prop('checked', true); $('.permission_check').css("pointer-events", "none"); } else { $('.permission_check').prop('checked', false); $('.permission_check').css("pointer-events", "auto"); } }); $('#select_all_0').click(function(){ var select = $("#select_all_0").is(":checked"); if(select) { $('#select_all_0').removeClass('permission_check'); $('.permission_check').prop('checked', true); $('.permission_check').css("pointer-events", "none"); } else { $('.permission_check').prop('checked', false); $('.permission_check').css("pointer-events", "auto"); } }); $('.benefit_plan_info').click(function(){ $url = $(this).find('a').attr("href"); var res = $url.split("#"); var hash = '#'+res[1]; window.location.hash = hash; benefitNavigation(); // now scroll to element with that id }); });
//= require ../store (function () { "use strict"; var AppJobs = FlynnDashboard.Stores.AppJobs = FlynnDashboard.Store.createClass({ displayName: "Stores.AppJobs", getState: function () { return this.state; }, willInitialize: function () { this.props = { appId: this.id.appId }; }, didInitialize: function () {}, didBecomeActive: function () { this.__fetchJobs(); }, getInitialState: function () { return { processes: [] }; }, handleEvent: function () { }, __fetchJobs: function () { FlynnDashboard.client.getAppJobs(this.props.appId).then(function (args) { var res = args[0]; this.setState({ processes: res.map(function (item) { if (item.hasOwnProperty("State")) { item.state = item.State; } return item; }) }); }.bind(this)); } }, Marbles.State); AppJobs.registerWithDispatcher(FlynnDashboard.Dispatcher); })();
$( document ).ready(function() { $('.switch').bootstrapSwitch({onText: 'вкл', offText: 'выкл'}).on('switchChange.bootstrapSwitch', function () { var checkbox = $(this); checkbox.bootstrapSwitch('disabled', true); $.getJSON(checkbox.data('link') + '?' + 'status=' + (checkbox.is(':checked') ? 1 : 0) + '&id=' + checkbox.data('id'), function (response) { if (response.result === 'error') { alert(response.error); } else { checkbox.bootstrapSwitch('disabled', false); } }); }); });