text
stringlengths
2
6.14k
import { inject as service } from '@ember/service'; import Route from '@ember/routing/route'; import notifyError from 'nomad-ui/utils/notify-error'; import { collect } from '@ember/object/computed'; import WithWatchers from 'nomad-ui/mixins/with-watchers'; import { watchRecord, watchRelationship } from 'nomad-ui/utils/properties/watch'; import classic from 'ember-classic-decorator'; @classic export default class ExecRoute extends Route.extend(WithWatchers) { @service store; @service token; serialize(model) { return { job_name: model.get('plainId') }; } model(params, transition) { const namespace = transition.to.queryParams.namespace; const name = params.job_name; const fullId = JSON.stringify([name, namespace || 'default']); const jobPromise = this.store .findRecord('job', fullId) .then(job => { return job.get('allocations').then(() => job); }) .catch(notifyError(this)); const xtermImport = import('xterm').then(module => module.Terminal); return Promise.all([jobPromise, xtermImport]); } setupController(controller, [job, Terminal]) { super.setupController(controller, job); controller.setUpTerminal(Terminal); } startWatchers(controller, model) { if (model) { controller.set('watcher', this.watch.perform(model)); controller.set('watchAllocations', this.watchAllocations.perform(model)); } } @watchRecord('job') watch; @watchRelationship('allocations') watchAllocations; @collect('watch', 'watchAllocations') watchers; }
// The including script sets this for us //var NUM_STEPS; var plugin; var left = 1, top = 1, width = 199, height = 199; function movePluginTo(x, y, w, h) { left = x; top = y; width = w; height = h; plugin.width = w; plugin.height = h; plugin.style.left = left + "px"; plugin.style.top = top + "px"; } function deltaInBounds(dx,dy, dw,dh) { var l = dx + left; var r = l + width + dw; var t = dy + top; var b = t + height + dh; return (0 <= l && l <= 20 && 0 <= t && t <= 20 && 200 <= r && r <= 220 && 200 <= b && b <= 220); } var initialFrame; function start() { window.removeEventListener("MozReftestInvalidate", start); window.addEventListener("MozAfterPaint", step); window.addEventListener("MozPaintWaitFinished", step); initialFrame = window.mozPaintCount; plugin = document.getElementById("plugin"); movePluginTo(0,0, 200,200); } var steps = 0; var which = "move"; // or "grow" var dx = 1, dy = 1, dw = 1, dh = 1; function step() { if (++steps >= NUM_STEPS) { window.removeEventListener("MozAfterPaint", step); window.removeEventListener("MozPaintWaitFinished", step); return finish(); } var didSomething = false; if (which == "grow") { if (deltaInBounds(0,0, dw,dh)) { movePluginTo(left,top, width+dw, height+dh); didSomething = true; } else { dw = -dw; dh = -dh; } } else { // "move" if (deltaInBounds(dx,dy, 0,0)) { movePluginTo(left+dx,top+dy, width, height); didSomething = true; } else { dx = -dx; dy = -dy; } } which = (which == "grow") ? "move" : "grow"; if (!didSomething) { step(); } } function finish() { document.documentElement.removeAttribute("class"); } window.addEventListener("MozReftestInvalidate", start);
registerModule.controller("UserController",function($scope,$log){ $scope.uname = "register"; $scope.pword = "admin"; $scope.submit = function() { alert("注册模块:UserController"); } });
var through = require('through2').obj; var jsx = require('jsx-transform'); module.exports = function(options) { var options = options || {}; return through(function write (file, enc, next) { if (file.isNull()) return next(null, file); if (file.path.match(options.match || /jsx?$/i)) { if (file.isStream()) { var data = ''; file.contents.on('data', function(chunk) { data += chunk.toString('utf8'); }); file.contents.on('end', function() { try { file.contents = jsx.transform(data, options); next(); } catch (err) { next(err); } }); return this.push(file); } if (file.isBuffer()) { file.contents = new Buffer( jsx.fromString(file.contents.toString('utf8'), options) ); } } this.push(file); next(); }); };
// DATA_TEMPLATE: js_data oTest.fnStart( "fnInitComplete" ); /* Fairly boring function compared to the others! */ $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "aaData": gaaData } ); var oSettings = oTable.fnSettings(); var mPass; oTest.fnTest( "Default should be null", null, function () { return oSettings.fnInitComplete == null; } ); oTest.fnTest( "Two arguments passed", function () { oSession.fnRestore(); mPass = -1; $('#example').dataTable( { "aaData": gaaData, "fnInitComplete": function ( ) { mPass = arguments.length===2 && arguments[1]===undefined; } } ); }, function () { return mPass; } ); oTest.fnTest( "That one argument is the settings object", function () { oSession.fnRestore(); oTable = $('#example').dataTable( { "aaData": gaaData, "fnInitComplete": function ( oSettings ) { mPass = oSettings; } } ); }, function () { return oTable.fnSettings() == mPass; } ); oTest.fnTest( "fnInitComplete called once on first draw", function () { oSession.fnRestore(); mPass = 0; $('#example').dataTable( { "aaData": gaaData, "fnInitComplete": function ( ) { mPass++; } } ); }, function () { return mPass == 1; } ); oTest.fnTest( "fnInitComplete never called there after", function () { $('#example_next').click(); $('#example_next').click(); $('#example_next').click(); }, function () { return mPass == 1; } ); oTest.fnComplete(); } );
import { photosUser } from '../helpers/roles' import { TESTCAFE_PHOTOS_URL, SLUG } from '../helpers/utils' import { THUMBNAIL_DELAY, maskPhotosCluster, IMG0, IMG1, IMG2, IMG3, IMG4 } from '../helpers/data' import { initVR } from '../helpers/visualreview-utils' import TimelinePage from '../pages/photos/photos-timeline-model' const timelinePage = new TimelinePage() //Scenario const const FEATURE_PREFIX = 'PhotosDelete' const FIXTURE_INIT = `${FEATURE_PREFIX} 1- Delete Photos` const TEST_DELETE1 = `1-1 Delete 1 photo` const TEST_DELETE2 = `1-2 Delete 4 photos` fixture`${FIXTURE_INIT}`.page`${TESTCAFE_PHOTOS_URL}/` .before(async ctx => { await initVR(ctx, SLUG, FIXTURE_INIT) }) .beforeEach(async t => { console.group(`\n↳ ℹ️ Login & Initialization`) await t.maximizeWindow() await t.useRole(photosUser) await timelinePage.waitForLoading() await timelinePage.initPhotosCount() console.groupEnd() }) .after(async ctx => { await ctx.vr.checkRunStatus() }) test(TEST_DELETE1, async t => { console.group(`↳ ℹ️ ${FEATURE_PREFIX} : ${TEST_DELETE1}`) await timelinePage.selectPhotosByName([IMG0]) //pic is removed await timelinePage.deletePhotosFromTimeline({ numOfFiles: 1, screenshotPath: 'DeleteImage/delete-1-pic-modal', withMask: maskPhotosCluster }) await t.fixtureCtx.vr.takeScreenshotAndUpload({ screenshotPath: `${FEATURE_PREFIX}/${TEST_DELETE1}-1`, withMask: maskPhotosCluster, delay: THUMBNAIL_DELAY, pageToWait: timelinePage }) console.groupEnd() }) test(TEST_DELETE2, async t => { console.group(`↳ ℹ️ ${FEATURE_PREFIX} : ${TEST_DELETE2}`) await timelinePage.selectPhotosByName([IMG1, IMG2, IMG3, IMG4]) //pics are removed, there are no more pictures on page await timelinePage.deletePhotosFromTimeline({ numOfFiles: 4, screenshotPath: 'DeleteImage/delete-4-pic-modal', withMask: maskPhotosCluster }) await t.fixtureCtx.vr.takeScreenshotAndUpload({ screenshotPath: `${FEATURE_PREFIX}/${TEST_DELETE2}-1`, delay: THUMBNAIL_DELAY, pageToWait: timelinePage }) console.groupEnd() })
/* * Copyright 2007-2017 Charles du Jeu - Abstrium SAS <team (at) pyd.io> * This file is part of Pydio. * * Pydio is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Pydio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with Pydio. If not, see <http://www.gnu.org/licenses/>. * * The latest code can be found at <https://pydio.com>. */ class Callbacks { static dynamicBuilder(controller) { const pydio = window.pydio; const MessageHash = pydio.MessageHash; const exts = { doc:'file-word', docx:'file-word', odt:'file-word', odg:'file-chart', odp:'file-powerpoint', ods:'file-excel', pot:'file-powerpoint', pptx:'file-powerpoint', rtf:'file-word', xls:'file-excel', xlsx:'file-excel' }; const dir = pydio.getContextHolder().getContextNode().getPath(); let builderMenuItems = []; Object.keys(exts).forEach((k) => { if(!MessageHash['libreoffice.ext.' + k]) return; builderMenuItems.push({ name:MessageHash['libreoffice.ext.' + k], alt:MessageHash['libreoffice.ext.' + k], icon_class:'mdi mdi-' + exts[k], callback:function(e){ PydioApi.getClient().request({ get_action: 'libreoffice_mkempty_file', dir : dir, format : k }); }.bind(this) }); }); return builderMenuItems; } } window.PydioLibreOfficeActions = {Callbacks};
/* * LICENCE : CloudUnit is available under the Affero Gnu Public License GPL V3 : https://www.gnu.org/licenses/agpl-3.0.html * but CloudUnit is licensed too under a standard commercial license. * Please contact our sales team if you would like to discuss the specifics of our Enterprise license. * If you are not sure whether the GPL is right for you, * you can always test our software under the GPL and inspect the source code before you contact us * about purchasing a commercial license. * * LEGAL TERMS : "CloudUnit" is a registered trademark of Treeptik and can't be used to endorse * or promote products derived from this project without prior written permission from Treeptik. * Products or services derived from this software may not be called "CloudUnit" * nor may "Treeptik" or similar confusing terms appear in their names without prior written permission. * For any questions, contact us : contact@treeptik.fr */ (function () { 'use strict'; angular .module ( 'webuiApp.account' ) .config ( ['paginationTemplateProvider', function ( paginationTemplateProvider ) { paginationTemplateProvider.setPath ( 'scripts/shared/pagination/pagination.html' ); } ]) .value ( 'statuses', [ { name: 'All', value: '' }, { name: 'Normal', value: 'normal' }, { name: 'Low', value: 'low' }, { name: 'Inactive', value: 'none' } ] ) .directive ( 'accountList', AccountList ); function AccountList () { return { restrict: 'E', templateUrl: 'scripts/components/account/list/account.admin.list.html', scope: { users: '=', roles: '=', onDelete: '&', onChangeRole: '&', selectedRole: '@', error: '=' }, controller: [ 'statuses', AccountListCtrl ], controllerAs: 'accountAdminList', bindToController: true }; } function AccountListCtrl ( statuses ) { var vm = this; vm.statuses = statuses; vm.selectedStatus = vm.statuses[0]; vm.currentPage = 1; vm.pageSize = 10; vm.handleDeleteUser = function ( user ) { vm.onDelete ( { user: user } ); }; vm.handleChangeRole = function ( user, role ) { vm.onChangeRole ( { user: user, role: role } ); } } }) ();
/** * @license Highcharts JS v8.1.0 (2020-05-05) * @module highcharts/modules/dumbbell * @requires highcharts * * (c) 2009-2019 Sebastian Bochan, Rafal Sebestjanski * * License: www.highcharts.com/license */ 'use strict'; import '../../modules/dumbbell.src.js';
// DATA_TEMPLATE: dom_data oTest.fnStart( "fnSetColumnVis" ); $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable(); var oSettings = oTable.fnSettings(); oTest.fnTest( "All columns are visible by default", null, function () { return $('#example tbody tr:eq(0) td').length == 5; } ); oTest.fnTest( "Can hide one column and it removes td column from DOM", function () { oSession.fnRestore(); $('#example').dataTable(); $('#example').dataTable().fnSetColumnVis( 1, false ); }, function () { return $('#example tbody tr:eq(0) td').length == 4; } ); oTest.fnTest( "Can hide one column and it removes thead th column from DOM", null, function () { return $('#example thead tr:eq(0) th').length == 4; } ); oTest.fnTest( "Can hide one column and it removes tfoot th column from DOM", null, function () { return $('#example tfoot tr:eq(0) th').length == 4; } ); oTest.fnTest( "The correct thead column has been hidden", null, function () { var jqNodes = $('#example thead tr:eq(0) th'); var bReturn = jqNodes[0].innerHTML == "Rendering engine" && jqNodes[1].innerHTML == "Platform(s)" && jqNodes[2].innerHTML == "Engine version" && jqNodes[3].innerHTML == "CSS grade"; return bReturn; } ); oTest.fnTest( "The correct tbody column has been hidden", function () { oDispacher.click( $('#example thead th:eq(1)')[0], { 'shift': true } ); }, function () { var jqNodes = $('#example tbody tr:eq(0) td'); var bReturn = jqNodes[0].innerHTML == "Gecko" && jqNodes[1].innerHTML == "Gnome" && jqNodes[2].innerHTML == "1.8" && jqNodes[3].innerHTML == "A"; return bReturn; } ); oTest.fnTest( "Can hide multiple columns and it removes td column from DOM", function () { oSession.fnRestore(); $('#example').dataTable(); $('#example').dataTable().fnSetColumnVis( 1, false ); $('#example').dataTable().fnSetColumnVis( 2, false ); $('#example').dataTable().fnSetColumnVis( 4, false ); }, function () { return $('#example tbody tr:eq(0) td').length == 2; } ); oTest.fnTest( "Multiple hide - removes thead th column from DOM", null, function () { return $('#example thead tr:eq(0) th').length == 2; } ); oTest.fnTest( "Multiple hide - removes tfoot th column from DOM", null, function () { return $('#example tfoot tr:eq(0) th').length == 2; } ); oTest.fnTest( "Multiple hide - the correct thead columns have been hidden", null, function () { var jqNodes = $('#example thead tr:eq(0) th'); var bReturn = jqNodes[0].innerHTML == "Rendering engine" && jqNodes[1].innerHTML == "Engine version" return bReturn; } ); oTest.fnTest( "Multiple hide - the correct tbody columns have been hidden", function () { oDispacher.click( $('#example thead th:eq(1)')[0], { 'shift': true } ); }, function () { var jqNodes = $('#example tbody tr:eq(0) td'); var bReturn = jqNodes[0].innerHTML == "Gecko" && jqNodes[1].innerHTML == "1" return bReturn; } ); oTest.fnComplete(); } );
import React from 'react'; import PropTypes from 'prop-types'; import { FlagCall } from './styles'; import { formatNtz } from '../../utils/amountFormatter'; const FlagAmountCall = ({ active, amountToCall, sliderOpen, myStack, }) => { // hide flag if only option is to 'check' or 'all-in' const hide = amountToCall === 0 || amountToCall > myStack || !active; return ( <FlagCall hide={hide} sliderOpen={sliderOpen}> {formatNtz(amountToCall)} </FlagCall> ); }; FlagAmountCall.propTypes = { active: PropTypes.bool, amountToCall: PropTypes.number, myStack: PropTypes.number, sliderOpen: PropTypes.bool, }; export default FlagAmountCall;
function widget_toggle_display(widget_id) { jQuery.ajax({ url: '/widgets/toggle_display/' + widget_id, dataType: 'json', success:function(response) { if (response.collapsed) { jQuery("#content_" + response.dom_id).hide(); jQuery("#indicator-" + response.dom_id).attr("class", "widget-collapsed"); } else { jQuery("#content_" + response.dom_id).show(); jQuery("#indicator-" + response.dom_id).attr("class", "widget-open"); } portal.refreshHeights(); }, beforeSend: function(){ showProgress(); }, complete: function(){ hideProgress(); }, error:function (xhr, thrownError) { alert("Invalid request"); } }); } function edit_widget(id, dom_id) { jQuery.ajax({ url: '/widgets/edit/' + id, dataType: 'html', success:function(response) { if(!jQuery('#config-' + dom_id).size() ) { jQuery(response).insertBefore('#content_' + dom_id); jQuery('#config-' + dom_id).fadeIn('slow'); update_widget_callback(id, dom_id); } else { jQuery('#config-' + dom_id).fadeOut('slow'); jQuery('#config-' + dom_id).remove().delay(1000); } }, beforeSend: function(){ showProgress(); }, complete: function(){ hideProgress(); }, error:function (xhr, thrownError) { alert("Invalid request"); } }); } function update_widget_callback(id, dom_id) { jQuery('#update_widget_' + id).bind("ajax:success", function(event, response, xhr) { var json = JSON.parse(response); jQuery("#config-" + dom_id).remove(); jQuery("#name-" + dom_id).replaceWith(json.widget_name); show_widget(id, dom_id, json.widget_type, json.configured, json.gadget_url); }).bind("ajax:before", function(event, json, xhr) { showProgress(); }).bind("ajax:complete", function(event, json, xhr) { hideProgress(); }); } function show_widget(id, dom_id, type, configured, gadget_url) { jQuery.ajax({ url: '/widgets/show/' + id, dataType: 'html', success:function(response) { if (configured == true) { jQuery("#content_" + dom_id).html(response); if (type == 8) { document.write = function(s) { jQuery('#gadget-wrapper-' + dom_id).innerHTML += s; } var e = new Element('script', {id:'gadget-' + dom_id}); jQuery('#gadget-wrapper-' + dom_id).prepend(e); jQuery('#gadget-' + dom_id).attr('src', gadget_url.gsub(/&amp;/,'&').gsub(/<script src=/,'').gsub(/><\/script>/,'')); } updateTooltips(); portal.refreshHeights(); } else { jQuery(response).insertBefore("#content_" + dom_id); jQuery('#config-' + dom_id).show('slow'); } }, beforeSend: function(){ showProgress(); }, complete: function(){ hideProgress(); }, error:function (xhr, thrownError) { jQuery("#content_" + dom_id).replaceWith("<span class='optional'><br/>Loading <b>" + jQuery("#name-widgets-" + id).html() +"</b> Failed</span>"); } }); } function add_widget() { if(! jQuery('#add-widget').length ) { jQuery.ajax({ url: '/widgets/add', dataType: 'html', success:function(response) { jQuery('#left_col').prepend(response); jQuery("#add-widget").fadeIn("slow"); }, beforeSend: function(){ showProgress(); }, complete: function(){ hideProgress(); }, error:function (xhr, thrownError) { alert("Invalid request"); } }); } else { jQuery("#add-widget").fadeOut("slow"); } } // functions for 'Projects' widget function toggle_projects(id, toggle) { toggle_projects_widget(id, toggle, 'project_', '#projects_customer_', '#indicator_', 'collapse-indicator-'); } function toggle_milestones(id, toggle){ toggle_projects_widget(id, toggle, 'milestone_', 'tr.project_', '#small_indicator_', 'small-collapse-indicator-'); } function toggle_projects_widget(id, toggle, cookie_prefix, container_prefix, indicator_prefix, class_prefix) { var collapsed = jQuery.cookie(cookie_prefix + id); collapsed = (collapsed == 'true' ? true : false); if(toggle) { collapsed = !collapsed; } jQuery.cookie(cookie_prefix + id, (collapsed ? 'true' : null)); if (collapsed) { jQuery(container_prefix + id).hide(); jQuery(indicator_prefix + id).attr('class', class_prefix + 'closed'); } else { jQuery(container_prefix + id).show(); jQuery(indicator_prefix + id).attr('class', class_prefix + 'open'); } } function init_projects_widget(){ if (document.cookie && document.cookie != '') { jQuery.each(document.cookie.match(/milestone_[0-9]+/g), function(index, key){ toggle_milestones(key.split('_')[1], false) }); jQuery.each(document.cookie.match(/project_[0-9]+/g), function(index, key){ toggle_projects(key.split('_')[1], false) }); } }
function GORef(obj) { this._object = obj; } GORef.prototype = { get object() { if (this._object instanceof ProxyObject) { return null; } return this._object; }, get position() { return this._object.position; }, get serverObjectIdx() { return this._object.serverObjectIdx; } }; module.exports = GORef;
/** * Sandcrawler Tests Samples * ========================== * * Collection of data needed for assertions. */ module.exports = { basic: [ 'http://nicesite.com', 'http://awesomesite.com', 'http://prettysite.com', 'http://unknownsite.com' ], iso: [ 'Eléphant', 'Crève', 'Fenêtre' ] };
/* * Copyright (c) 2015 Memorial Sloan-Kettering Cancer Center. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS * FOR A PARTICULAR PURPOSE. The software and documentation provided hereunder * is on an "as is" basis, and Memorial Sloan-Kettering Cancer Center has no * obligations to provide maintenance, support, updates, enhancements or * modifications. In no event shall Memorial Sloan-Kettering Cancer Center be * liable to any party for direct, indirect, special, incidental or * consequential damages, including lost profits, arising out of the use of this * software and its documentation, even if Memorial Sloan-Kettering Cancer * Center has been advised of the possibility of such damage. */ /* * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ var d3 = require("d3"); var _ = require("underscore"); /** * Singleton utility function for Pancancer Mutation Data. * * @author Selcuk Onur Sumer */ var PancanMutationDataUtil = (function() { function munge(response, key) { // munge data to get it into the format: keyword -> corresponding datum return d3.nest() .key(function(d) { return d[key]; }) .entries(response) .reduce(function(acc, next) { acc[next.key] = next.values; return acc; }, {}); } function getMutationFrequencies(data) { var frequencies = {}; _.each(_.keys(data), function(key, i) { frequencies = _.extend(frequencies, munge(data[key], key)); }); return frequencies; } /** * Counts number of total mutations for the given frequencies and key. * * @param frequencies pancan mutation frequencies * @param key key (keyword, gene symbol or protein change) * @returns {Object} mutation count */ function countByKey(frequencies, key) { var data = frequencies[key]; return _.reduce(data, function(acc, next) { return acc + next.count; }, 0); } return { getMutationFrequencies: getMutationFrequencies, countByKey: countByKey }; })(); module.exports = PancanMutationDataUtil;
/*globals define, _*/ /*jshint browser: true, camelcase: false*/ /** * This decorator inherits from the ModelDecorator.DiagramDesignerWidget. * With no changes to the methods - it will functions just like the ModelDecorator. * * For more methods see the ModelDecorator.DiagramDesignerWidget.js in the webgme repository. * * @author pmeijer / https://github.com/pmeijer */ define([ 'js/RegistryKeys', 'js/Constants', 'decorators/ModelDecorator/DiagramDesigner/ModelDecorator.DiagramDesignerWidget', 'jquery', 'underscore' ], function ( REGISTRY_KEYS, CONSTANTS, ModelDecoratorDiagramDesignerWidget) { 'use strict'; var openStackDecorator, DECORATOR_ID = 'openStackDecorator'; openStackDecorator = function (options) { var opts = _.extend({}, options); ModelDecoratorDiagramDesignerWidget.apply(this, [opts]); this.logger.debug('openStackDecorator ctor'); }; openStackDecorator.prototype = Object.create(ModelDecoratorDiagramDesignerWidget.prototype); openStackDecorator.prototype.constructor = openStackDecorator; openStackDecorator.prototype.DECORATORID = DECORATOR_ID; openStackDecorator.prototype.on_addTo = function () { var client = this._control._client, nodeObj = client.getNode(this._metaInfo[CONSTANTS.GME_ID]); this.logger.debug('This node was added to the canvas', nodeObj); // Call the base-class method.. ModelDecoratorDiagramDesignerWidget.prototype.on_addTo.apply(this, arguments); }; openStackDecorator.prototype.destroy = function () { ModelDecoratorDiagramDesignerWidget.prototype.destroy.apply(this, arguments); }; openStackDecorator.prototype.update = function () { var client = this._control._client, nodeObj = client.getNode(this._metaInfo[CONSTANTS.GME_ID]); this.logger.debug('This node is on the canvas and received an update event', nodeObj); ModelDecoratorDiagramDesignerWidget.prototype.update.apply(this, arguments); }; return openStackDecorator; });
// (C) Copyright 2014-2015 Hewlett Packard Enterprise Development LP import React, { Component, PropTypes } from 'react'; import Header from 'grommet/components/Header'; import Heading from 'grommet/components/Heading'; import Button from 'grommet/components/Button'; import Box from 'grommet/components/Box'; import AscIcon from 'grommet/components/icons/base/LinkDown'; import DescIcon from 'grommet/components/icons/base/LinkUp'; import Intl from 'grommet/utils/Intl'; import Props from 'grommet/utils/Props'; const CLASS_ROOT = "index-sort"; export default class Sort extends Component { constructor (props) { super(props); this._onChange = this._onChange.bind(this); this._onChangeDirection = this._onChangeDirection.bind(this); this.state = this._stateFromProps(props); } componentWillReceiveProps (nextProps) { this.setState(this._stateFromProps(nextProps)); } _stateFromProps (props) { const parts = props.value.split(':'); return { name: parts[0], direction: parts[1] }; } _onChange (event) { const value = event.target.value; this.props.onChange(value + ':' + this.state.direction); } _onChangeDirection (direction) { this.props.onChange(this.state.name + ':' + direction); } render () { const { attributes } = this.props; let boxProps = Props.pick(this.props, Object.keys(Box.propTypes)); let classNames = [CLASS_ROOT]; if (this.props.className) { classNames.push(this.props.className); } const options = attributes .map(attribute => { return ( <option key={attribute.name} value={attribute.name}> {attribute.label || attribute.name} </option> ); }); let title = Intl.getMessage(this.context.intl, 'Sort'); return ( <Box {...boxProps} flex={false} className={classNames.join(' ')}> <Header size="small"> <Heading tag="h4">{title}</Heading> </Header> <Box direction="row" justify="between" align="center"> <select value={this.state.name} onChange={this._onChange}> {options} </select> <Box direction="row"> <Button icon={<AscIcon colorIndex={'asc' === this.state.direction ? 'brand' : undefined} />} onClick={this._onChangeDirection.bind(this, 'asc')} /> <Button icon={<DescIcon colorIndex={'desc' === this.state.direction ? 'brand' : undefined} />} onClick={this._onChangeDirection.bind(this, 'desc')} /> </Box> </Box> </Box> ); } } Sort.propTypes = { attributes: PropTypes.arrayOf(PropTypes.shape({ label: PropTypes.string, name: PropTypes.string.isRequired })), onChange: PropTypes.func, // name:asc|desc value: PropTypes.string // name:asc|desc }; Sort.defaultProps = { value: '' }; Sort.contextTypes = { intl: PropTypes.object };
var check = require('../util/regex-check') module.exports = check(/[!-/:-@[-`{-~]/)
/** * Created by chenhao on 15/10/13. */ Template.thumbnail.helpers({ thumb: function () { // console.log("thumbnail", this.id); if (this.id) return Collections.Images.findOne({_id: this.id}); } });
/** * Copyright (c) Microsoft. 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'; var util = require('util'); var utils = require('../../../util/utils'); var $ = utils.getLocaleString; exports.getProviderName = function (resourceType) { var firstIndex = resourceType.indexOf('/'); var providerName; if (firstIndex !== -1) { providerName = resourceType.substr(0, firstIndex); } return providerName; }; exports.getResourceTypeName = function (resourceType) { var lastIndex = resourceType.lastIndexOf('/'); var resourceTypeName; if (lastIndex !== -1) { resourceTypeName = resourceType.substr(lastIndex + 1); } return resourceTypeName; }; exports.getResourceInformation = function (resourceIDFromServer) { function removeEmptyElement(existing) { var newArray = []; for (var i = 0; i < existing.length; i++) { if (existing[i]) { newArray.push(existing[i]); } } return newArray; } if (!resourceIDFromServer) { return {}; } var tokens = resourceIDFromServer.split('/'); tokens = removeEmptyElement(tokens); if (tokens.length < 8) { throw new Error('invalid resource id from server'); } var resourceGroupName = tokens[3]; var resourceName = tokens[tokens.length - 1]; var resourceTypeBuilder = []; resourceTypeBuilder.push(tokens[5]); // Extract out the 'parent resource' and 'full resource type' // for id like: subscriptions/abc123/resourceGroups/group1/providers/Microsoft.Test/servers/r12345sql/db/r45678db, // we will extract out parent resource: 'servers/r12345sql'. // from id like: subscriptions/abc123/resourceGroups/group1/providers/Microsoft.Test/db/r45678db, // parent resource does not exist. var parentResourceBuilder = []; for (var i = 6; i <= tokens.length - 3; i++) { parentResourceBuilder.push(tokens[i]); //from 'resourceType/resourcName/<same pattern...>', skip the "resourceName" and keep the type if (i % 2 === 0) { resourceTypeBuilder.push(tokens[i]); } } resourceTypeBuilder.push(tokens[tokens.length - 2]); var parentResource; if (parentResourceBuilder.length > 0) { parentResource = parentResourceBuilder.join('/'); } var resourceType; if (resourceTypeBuilder.length > 0) { resourceType = resourceTypeBuilder.join('/'); } return { 'resourceName': resourceName, 'resourceGroup' : resourceGroupName, 'resourceType' : resourceType, 'parentResource' : parentResource }; }; exports.getSourceResourceGroupForMove = function (resources) { var rgRegEx = new RegExp('resourceGroups/[A-Za-z0-9]+/'); var sourceGroup; for (var i = 0; i < resources.length; ++i) { var match = rgRegEx.exec(resources[i]); if (!match) { throw new Error(util.format($('%s is not a valid resource'), resources[i])); } if (!sourceGroup) { sourceGroup = match[0].split('/')[1]; } else if (sourceGroup && match[0].split('/')[1] != sourceGroup) { throw new Error('Resources to move must all reside in the same resource group.'); } } return sourceGroup; };
'use strict'; const Stream = require('stream'); const Boom = require('boom'); const internals = {}; module.exports = internals.Recorder = class extends Stream.Writable { constructor(options) { super(); this.settings = options; // No need to clone since called internally with new object this.buffers = []; this.length = 0; } _write(chunk, encoding, next) { if (this.settings.maxBytes && this.length + chunk.length > this.settings.maxBytes) { return this.emit('error', Boom.entityTooLarge('Payload content length greater than maximum allowed: ' + this.settings.maxBytes)); } this.length = this.length + chunk.length; this.buffers.push(chunk); next(); } collect() { const buffer = (this.buffers.length === 0 ? Buffer.alloc(0) : (this.buffers.length === 1 ? this.buffers[0] : Buffer.concat(this.buffers, this.length))); return buffer; } };
/* * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is * regenerated. */ 'use strict'; /** * Details of JobOutput errors. * */ class JobErrorDetail { /** * Create a JobErrorDetail. * @member {string} [code] Code describing the error detail. * @member {string} [message] A human-readable representation of the error. */ constructor() { } /** * Defines the metadata of JobErrorDetail * * @returns {object} metadata of JobErrorDetail * */ mapper() { return { required: false, serializedName: 'JobErrorDetail', type: { name: 'Composite', className: 'JobErrorDetail', modelProperties: { code: { required: false, readOnly: true, serializedName: 'code', type: { name: 'String' } }, message: { required: false, readOnly: true, serializedName: 'message', type: { name: 'String' } } } } }; } } module.exports = JobErrorDetail;
// Licensed to Cloudera, Inc. under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. Cloudera, Inc. licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. import $ from 'jquery'; import * as ko from 'knockout'; ko.bindingHandlers.fetchMore = { init: function (element, valueAccessor) { const options = valueAccessor(); const $element = $(element); let throttle = -1; $element.on('scroll.fetchMore', () => { window.clearTimeout(throttle); throttle = window.setTimeout(() => { if ( element.scrollTop + $element.innerHeight() >= element.scrollHeight - 10 && ko.unwrap(options.hasMore) && !ko.unwrap(options.loadingMore) ) { options.fetchMore(); } }, 100); }); ko.utils.domNodeDisposal.addDisposeCallback(element, () => { $element.off('scroll.fetchMore'); }); } };
/* http://keith-wood.name/datepick.html Greek localisation for jQuery Datepicker. Written by Alex Cicovic (http://www.alexcicovic.com) */ (function ($) { $.datepick.regionalOptions['el'] = { monthNames: ['Ιανουάριος', 'Φεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'Ιούνιος', 'Ιούλιος', 'Αύγουστος', 'Σεπτέμβριος', 'Οκτώβριος', 'Νοέμβριος', 'Δεκέμβριος'], monthNamesShort: ['Ιαν', 'Φεβ', 'Μαρ', 'Απρ', 'Μαι', 'Ιουν', 'Ιουλ', 'Αυγ', 'Σεπ', 'Οκτ', 'Νοε', 'Δεκ'], dayNames: ['Κυριακή', 'Δευτέρα', 'Τρίτη', 'Τετάρτη', 'Πέμπτη', 'Παρασκευή', 'Σάββατο'], dayNamesShort: ['Κυρ', 'Δευ', 'Τρι', 'Τετ', 'Πεμ', 'Παρ', 'Σαβ'], dayNamesMin: ['Κυ', 'Δε', 'Τρ', 'Τε', 'Πε', 'Πα', 'Σα'], dateFormat: 'dd/mm/yyyy', firstDay: 1, renderer: $.datepick.defaultRenderer, prevText: 'Προηγούμενος', prevStatus: 'Επισκόπηση προηγούμενου μήνα', prevJumpText: '&#x3c;&#x3c;', prevJumpStatus: '', nextText: 'Επόμενος', nextStatus: 'Επισκόπηση επόμενου μήνα', nextJumpText: '&#x3e;&#x3e;', nextJumpStatus: '', currentText: 'Τρέχων Μήνας', currentStatus: 'Επισκόπηση τρέχοντος μήνα', todayText: 'Τρέχων Μήνας', todayStatus: 'Επισκόπηση τρέχοντος μήνα', clearText: 'Σβήσιμο', clearStatus: 'Σβήσιμο της επιλεγμένης ημερομηνίας', closeText: 'Κλείσιμο', closeStatus: 'Κλείσιμο χωρίς αλλαγή', yearStatus: 'Επισκόπηση άλλου έτους', monthStatus: 'Επισκόπηση άλλου μήνα', weekText: 'Εβδ', weekStatus: '', dayStatus: 'Επιλογή DD d MM', defaultStatus: 'Επιλέξτε μια ημερομηνία', isRTL: false }; $.datepick.setDefaults($.datepick.regionalOptions['el']); })(jQuery);
import { createStore, applyMiddleware } from 'redux'; import thunkMiddleware from 'redux-thunk'; //import createLogger from 'redux-logger'; import rootReducer from './reducers'; export default function configureStore(preloadedState) { return createStore( rootReducer, applyMiddleware( thunkMiddleware, ), preloadedState, ); }
'use strict'; const path = require('path'); const fs = require('fs-extra'); const copyFile = require('./utils').copyFile; const ROOT_DIR = path.join(__dirname, '..', '..'); class Windows { /** * @param {Object} options options object * @param {String} options.sdkVersion version of Titanium SDK * @param {String} options.gitHash SHA of Titanium SDK HEAD */ constructor (options) { this.sdkVersion = options.sdkVersion; this.gitHash = options.gitHash; } babelOptions() { const windowsPackage = path.join(ROOT_DIR, 'windows', 'package.json'); if (fs.pathExistsSync(windowsPackage)) { const safariVersion = require(windowsPackage).safari; // eslint-disable-line security/detect-non-literal-require return { targets: { safari: safariVersion } }; } return { }; } async clean() { // no-op } async build () { // TODO Pull the zipfile down and extract it? } async package(packager) { console.log('Zipping Windows platform...'); // Windows is already all in place. We should be careful to ignore folders/files that don't apply for OS return copyFile(packager.srcDir, packager.zipSDKDir, 'windows'); } } module.exports = Windows;
function Controller() { function closePage() { $.window.close({ modal: true }); } require("alloy/controllers/BaseController").apply(this, Array.prototype.slice.call(arguments)); this.__controllerPath = "PMXOptionList"; arguments[0] ? arguments[0]["__parentSymbol"] : null; arguments[0] ? arguments[0]["$model"] : null; arguments[0] ? arguments[0]["__itemTemplate"] : null; var $ = this; var exports = {}; var __defers = {}; $.__views.window = Ti.UI.createWindow({ backgroundImage: "bg1.jpg", backgroundColor: "#FFF", height: Ti.UI.FILL, width: Ti.UI.FILL, fullscreen: true, top: 0, id: "window", layout: "vertical" }); $.__views.window && $.addTopLevelView($.__views.window); $.__views.__alloyId0 = Ti.UI.createView({ backgroundColor: "#222", height: "40dp", top: "0dp", id: "__alloyId0" }); $.__views.window.add($.__views.__alloyId0); $.__views.__alloyId1 = Ti.UI.createLabel({ font: { fontSize: 12, fontFamily: "Comfortaa", fontWeight: "Bold" }, text: "Sélection de la catégorie", height: Ti.UI.SIZE, color: "#FFF", id: "__alloyId1" }); $.__views.__alloyId0.add($.__views.__alloyId1); $.__views.__alloyId2 = Ti.UI.createButton({ image: "bt_close.png", width: "20dp", height: "20dp", right: "5dp", color: "#FFF", tintColor: "#FFF", id: "__alloyId2" }); $.__views.__alloyId0.add($.__views.__alloyId2); closePage ? $.__views.__alloyId2.addEventListener("click", closePage) : __defers["$.__views.__alloyId2!click!closePage"] = true; $.__views.tableview = Ti.UI.createTableView({ id: "tableview", backgroundColor: "transparent" }); $.__views.window.add($.__views.tableview); exports.destroy = function() {}; _.extend($, $.__views); var args = arguments[0] || {}; var tab_data = args.data; var ini_value = args.ini_value; args.short_answer; $.tableview.opacity = 0; var tableData = []; $.window.addEventListener("open", function() { for (var i = 0; tab_data.length - 1 >= i; i++) { var t = tab_data[i]; var row_c = Alloy.createController("PMXOptionListRow"); row_c.name = t.title; row_c.title = t.title; row = row_c.getView(); row.hasChild = false; row.title = t.title; row.rowIndex = t.id; t.id == ini_value && (row.hasCheck = true); tableData.push(row); } $.tableview.footerView = Ti.UI.createView({ height: 1, backgroundColor: "transparent" }); $.tableview.data = tableData; var animation1 = Titanium.UI.createAnimation(); animation1.opacity = 1; animation1.duration = 500; animation1.delay = 200; $.tableview.animate(animation1); }); $.tableview.addEventListener("click", function(e) { args.cb(e.row.title, e.row.rowIndex); $.window.close(); }); __defers["$.__views.__alloyId2!click!closePage"] && $.__views.__alloyId2.addEventListener("click", closePage); _.extend($, exports); } var Alloy = require("alloy"), Backbone = Alloy.Backbone, _ = Alloy._; module.exports = Controller;
define([ "collections/GroupsCollection" ], function(GroupsCollection){ return Backbone.Router.extend({ routes: { "try/:group/:endpoint" : "showEndpoint" }, showEndpoint: function(groupId, endpointId) { // Look for group var group = GroupsCollection.groups.models[groupId]; if( group ) { // Look for endpoint inside group var endpoint = group.get("endpoints").models[endpointId]; // Trigger endpoint if (endpoint) { APIBuddy.trigger("endpointSelected", endpoint); } } } }); });
/* * Copyright 2021 ThoughtWorks, 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. */ import {EnvironmentVariables} from "models/dashboard/environment_variables"; describe("Dashboard", () => { describe('Environment Variables Model', () => { it("should deserialize from json", () => { const envVars = EnvironmentVariables.fromJSON(json); expect(envVars.length).toBe(json.length); expect(envVars[0].name()).toBe(json[0].name); expect(envVars[0].value()).toEqual(''); expect(envVars[1].name()).toBe(json[1].name); expect(envVars[1].value()).toBe(json[1].value); }); it("should make environment variable non editable by default", () => { const envVars = EnvironmentVariables.fromJSON(json); expect(envVars[0].isEditingValue()).toBe(false); expect(envVars[1].isEditingValue()).toBe(true); }); const json = [ { "name": "version", "secure": true, "value": "***" }, { "name": "foobar", "secure": false, "value": "asdf" } ]; }); });
var dir_82a1580e18717db72c05fda59883f1c3 = [ [ "cpp", "dir_6a3a8465604a2177fc7f508c404589b1.html", "dir_6a3a8465604a2177fc7f508c404589b1" ], [ "java", "dir_29a654fef9ee522348956763c377cb52.html", "dir_29a654fef9ee522348956763c377cb52" ] ];
/* * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is * regenerated. */ 'use strict'; const models = require('./index'); /** * @class * Initializes a new instance of the UpgradeDomainNodesHealthEvaluation class. * @constructor * The evaluation of the upgrade domain nodes health * * @member {string} [upgradeDomainName] * * @member {array} [unhealthyEvaluations] * * @member {number} [totalCount] * * @member {number} [maxPercentUnhealthyNodes] * */ class UpgradeDomainNodesHealthEvaluation extends models['HealthEvaluation'] { constructor() { super(); } /** * Defines the metadata of UpgradeDomainNodesHealthEvaluation * * @returns {object} metadata of UpgradeDomainNodesHealthEvaluation * */ mapper() { return { required: false, serializedName: 'UpgradeDomainNodes', type: { name: 'Composite', className: 'UpgradeDomainNodesHealthEvaluation', modelProperties: { description: { required: false, serializedName: 'Description', type: { name: 'String' } }, aggregatedHealthState: { required: false, serializedName: 'AggregatedHealthState', type: { name: 'String' } }, kind: { required: true, serializedName: 'Kind', type: { name: 'String' } }, upgradeDomainName: { required: false, serializedName: 'UpgradeDomainName', type: { name: 'String' } }, unhealthyEvaluations: { required: false, serializedName: 'UnhealthyEvaluations', type: { name: 'Sequence', element: { required: false, serializedName: 'UnhealthyEvaluationElementType', type: { name: 'Composite', className: 'UnhealthyEvaluation' } } } }, totalCount: { required: false, serializedName: 'TotalCount', type: { name: 'Number' } }, maxPercentUnhealthyNodes: { required: false, serializedName: 'MaxPercentUnhealthyNodes', type: { name: 'Number' } } } } }; } } module.exports = UpgradeDomainNodesHealthEvaluation;
// Copyright 2011 Software Freedom Conservancy. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. /** * @fileoverview Factory methods for the supported locator strategies. */ goog.provide('webdriver.Locator'); goog.provide('webdriver.Locator.Strategy'); goog.require('goog.object'); goog.require('goog.string'); /** * An element locator. * @param {string} using The type of strategy to use for this locator. * @param {string} value The search target of this locator. * @constructor */ webdriver.Locator = function(using, value) { /** * The search strategy to use when searching for an element. * @type {string} */ this.using = using; /**u * The search target for this locator. * @type {string} */ this.value = value; }; /** * Creates a factory function for a {@code webdriver.Locator}. * @param {string} type The type of locator for the factory. * @return {function(string):!webdriver.Locator} The new factory function. * @private */ webdriver.Locator.factory_ = function(type) { return function(value) { return new webdriver.Locator(type, value); }; }; /** * Factory methods for the supported locator strategies. * @type {Object.<function(string):!webdriver.Locator>} */ webdriver.Locator.Strategy = { 'className': webdriver.Locator.factory_('class name'), 'class name': webdriver.Locator.factory_('class name'), 'css': webdriver.Locator.factory_('css selector'), 'id': webdriver.Locator.factory_('id'), 'js': webdriver.Locator.factory_('js'), 'linkText': webdriver.Locator.factory_('link text'), 'link text': webdriver.Locator.factory_('link text'), 'name': webdriver.Locator.factory_('name'), 'partialLinkText': webdriver.Locator.factory_('partial link text'), 'partial link text': webdriver.Locator.factory_('partial link text'), 'tagName': webdriver.Locator.factory_('tag name'), 'tag name': webdriver.Locator.factory_('tag name'), 'xpath': webdriver.Locator.factory_('xpath') }; goog.exportSymbol('By', webdriver.Locator.Strategy); /** * Creates a new Locator from an object whose only property is also a key in * the {@code webdriver.Locator.Strategy} map. * @param {Object.<string>} obj The object to convert into a locator. * @return {webdriver.Locator} The new locator object. */ webdriver.Locator.createFromObj = function(obj) { var key = goog.object.getAnyKey(obj); if (!key) { throw Error('No keys found in locator hash object'); } else if (key in webdriver.Locator.Strategy) { return webdriver.Locator.Strategy[key](obj[key]); } throw Error('Unsupported locator strategy: ' + key); }; /** * Verifies that a {@code locator} is a valid locator to use for searching for * elements on the page. * @param {webdriver.Locator|Object.<string>} locator The locator * to verify, or a short-hand object that can be converted into a locator * to verify. * @return {!webdriver.Locator} The validated locator. */ webdriver.Locator.checkLocator = function(locator) { if (!locator.using || !locator.value) { locator = webdriver.Locator.createFromObj(locator); } return (/**@type {!webdriver.Locator} */locator); }; /** @return {string} String representation of this locator. */ webdriver.Locator.prototype.toString = function() { return 'By ' + this.using + ' (' + this.value + ')'; };
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; import { Injectable } from 'angular2/core'; /** * A backend for http that uses the `XMLHttpRequest` browser API. * * Take care not to evaluate this in non-browser contexts. */ export let BrowserXhr = class BrowserXhr { constructor() { } build() { return (new XMLHttpRequest()); } }; BrowserXhr = __decorate([ Injectable(), __metadata('design:paramtypes', []) ], BrowserXhr); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnJvd3Nlcl94aHIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJkaWZmaW5nX3BsdWdpbl93cmFwcGVyLW91dHB1dF9wYXRoLTlEMWlHUVZHLnRtcC9hbmd1bGFyMi9zcmMvaHR0cC9iYWNrZW5kcy9icm93c2VyX3hoci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7T0FBTyxFQUFDLFVBQVUsRUFBQyxNQUFNLGVBQWU7QUFFeEM7Ozs7R0FJRztBQUVIO0lBQ0U7SUFBZSxDQUFDO0lBQ2hCLEtBQUssS0FBVSxNQUFNLENBQU0sQ0FBQyxJQUFJLGNBQWMsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ3RELENBQUM7QUFKRDtJQUFDLFVBQVUsRUFBRTs7Y0FBQTtBQUlaIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHtJbmplY3RhYmxlfSBmcm9tICdhbmd1bGFyMi9jb3JlJztcblxuLyoqXG4gKiBBIGJhY2tlbmQgZm9yIGh0dHAgdGhhdCB1c2VzIHRoZSBgWE1MSHR0cFJlcXVlc3RgIGJyb3dzZXIgQVBJLlxuICpcbiAqIFRha2UgY2FyZSBub3QgdG8gZXZhbHVhdGUgdGhpcyBpbiBub24tYnJvd3NlciBjb250ZXh0cy5cbiAqL1xuQEluamVjdGFibGUoKVxuZXhwb3J0IGNsYXNzIEJyb3dzZXJYaHIge1xuICBjb25zdHJ1Y3RvcigpIHt9XG4gIGJ1aWxkKCk6IGFueSB7IHJldHVybiA8YW55PihuZXcgWE1MSHR0cFJlcXVlc3QoKSk7IH1cbn1cbiJdfQ==
var fn_hello = async (ctx, next) => { var name = ctx.params.name; ctx.response.body = `<h1>Hello, ${name}!</h1>`; }; module.exports = { 'GET /hello/:name': fn_hello };
// (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P. var React = require('react'); var IntlMixin = require('../../../mixins/GrommetIntlMixin'); var uuid = require('node-uuid'); var ErrorStatus = React.createClass({ propTypes: { a11yTitle: React.PropTypes.string }, mixins: [IntlMixin], render: function() { var className = 'status-icon status-icon-error'; var a11yTitle = this.getGrommetIntlMessage(this.props.a11yTitle); if (this.props.className) { className += ' ' + this.props.className; } if (typeof a11yTitle === "undefined") { // this.props.a11yTitle emplty string is an acceptable value. Only if undefined // should use the default title value. a11yTitle = this.getGrommetIntlMessage('Error'); } var errorTitleId = 'error-title-' + uuid.v1(); return ( <svg className={className} viewBox="0 0 24 24" aria-labelledby={errorTitleId} role="img" version="1.1"> <title id={errorTitleId}>{a11yTitle}</title> <g className={"status-icon__base"} stroke="none"> <path role="presentation" d="M12,0 L24,12 L12,24 L0,12 Z"></path> </g> <g className={"status-icon__detail"} fill="none"> <path role="presentation" d="M8,8 L16,16" strokeWidth="2"></path> <path role="presentation" d="M8,16 L16,8" strokeWidth="2"></path> </g> </svg> ); } }); module.exports = ErrorStatus;
"use strict"; (function (EntryType) { EntryType[EntryType["Bool"] = 0] = "Bool"; EntryType[EntryType["String"] = 1] = "String"; EntryType[EntryType["Path"] = 2] = "Path"; EntryType[EntryType["FilePath"] = 3] = "FilePath"; EntryType[EntryType["Internal"] = 4] = "Internal"; EntryType[EntryType["Uninitialized"] = 5] = "Uninitialized"; EntryType[EntryType["Static"] = 6] = "Static"; })(exports.EntryType || (exports.EntryType = {})); var EntryType = exports.EntryType; //# sourceMappingURL=api.js.map
var express = require('express'); var path = require('path'); var favicon = require('serve-favicon'); var logger = require('morgan'); var cookieParser = require('cookie-parser'); var bodyParser = require('body-parser'); var scraper = require('./scripts/scraper.js'); var routes = require('./routes/index'); var users = require('./routes/users'); var app = express(); // view engine setup app.set('views', path.join(__dirname, 'views')); app.set('view engine', 'jade'); // uncomment after placing your favicon in /public //app.use(favicon(__dirname + '/public/favicon.ico')); app.use(logger('dev')); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: false })); app.use(cookieParser()); app.use(express.static(path.join(__dirname, 'public'))); app.use('/', routes); app.use('/users', users); // catch 404 and forward to error handler app.use(function(req, res, next) { var err = new Error('Not Found'); err.status = 404; next(err); }); //START SCRAPER UP AND BEGIN WORK scraper.initialize(); //start getting provinces scraper.getProvinces(); // error handlers // development error handler // will print stacktrace if (app.get('env') === 'development') { app.use(function(err, req, res, next) { res.status(err.status || 500); res.render('error', { message: err.message, error: err }); }); } // production error handler // no stacktraces leaked to user app.use(function(err, req, res, next) { res.status(err.status || 500); res.render('error', { message: err.message, error: {} }); }); module.exports = app;
'use strict'; const ReactDOM = require('react-dom'); const routes = require('./routes'); ReactDOM.render(routes, document.getElementById('app'));
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var _ionicIonic = require('ionic/ionic'); var _angular2Angular2 = require('angular2/angular2'); var _helpers = require('../../helpers'); var __decorate = undefined && undefined.__decorate || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function (o, d) { return d && d(o) || o; }, target); case 3: return decorators.reduceRight(function (o, d) { return (d && d(target, key), void 0); }, void 0); case 4: return decorators.reduceRight(function (o, d) { return d && d(target, key, o) || o; }, desc); } }; var __metadata = undefined && undefined.__metadata || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var OutlinePage = function OutlinePage() { _classCallCheck(this, OutlinePage); }; exports.OutlinePage = OutlinePage; exports.OutlinePage = OutlinePage = __decorate([(0, _ionicIonic.Page)({ templateUrl: 'buttons/outline.html', directives: [(0, _angular2Angular2.forwardRef)(function () { return _helpers.AndroidAttribute; })] }), __metadata('design:paramtypes', [])], OutlinePage);
/** * Copyright (c) 2013 The Chromium Authors. All rights reserved. Use of this * source code is governed by a BSD-style license that can be found in the * LICENSE file. */ var warningId = 'notification.warning'; function hideWarning(done) { chrome.notifications.clear(warningId, function() { if (done) done(); }); } function showWarning() { hideWarning(function() { chrome.notifications.create(warningId, { iconUrl: chrome.runtime.getURL('images/icon-48.png'), title: 'Removal required', type: 'basic', message: chrome.i18n.getMessage('name') + ' is obsolete ' + 'and must be removed. A replacement Extension ' + 'is available.', buttons: [{ title: 'Learn More' }], priority: 2, }, function() {}); }); } function openWarningPage() { chrome.tabs.create({ url: 'chrome://extensions?options=' + chrome.runtime.id }); } chrome.browserAction.setBadgeBackgroundColor({ color: '#FF0000' }); chrome.browserAction.setBadgeText({ text: '!' }); chrome.browserAction.onClicked.addListener(openWarningPage); chrome.notifications.onClicked.addListener(openWarningPage); chrome.notifications.onButtonClicked.addListener(openWarningPage); chrome.runtime.onInstalled.addListener(showWarning);
'use strict'; var utils = require('../utils'); module.exports = function (app) { // there is only one node, but these APIs // are required for fauxton app.get('/_membership', function (req, res, next) { utils.sendJSON(res, 200, { all_nodes: ['node1@127.0.0.1'], cluster_nodes: ['node1@127.0.0.1'] }); }); app.get('/_cluster_setup', function (req, res, next) { utils.sendJSON(res, 201, { state: 'cluster_disabled' }); }); };
// Simple phantom.js integration script // Taken from Twitter Bootstrap function waitFor(testFx, onReady, timeOutMillis) { var maxtimeOutMillis = timeOutMillis ? timeOutMillis : 5001 //< Default Max Timout is 5s , start = new Date().getTime() , condition = false , interval = setInterval(function () { if ((new Date().getTime() - start < maxtimeOutMillis) && !condition) { // If not time-out yet and condition not yet fulfilled condition = (typeof(testFx) === "string" ? eval(testFx) : testFx()) //< defensive code } else { if (!condition) { // If condition still not fulfilled (timeout but condition is 'false') console.log("'waitFor()' timeout") phantom.exit(1) } else { // Condition fulfilled (timeout and/or condition is 'true') typeof(onReady) === "string" ? eval(onReady) : onReady() //< Do what it's supposed to do once the condition is fulfilled clearInterval(interval) //< Stop this interval } } }, 100) //< repeat check every 100ms } if (phantom.args.length === 0 || phantom.args.length > 2) { console.log('Usage: phantom.js URL') phantom.exit() } var page = new WebPage() // Route "console.log()" calls from within the Page context to the main Phantom context (i.e. current "this") page.onConsoleMessage = function(msg) { console.log(msg) }; page.open(phantom.args[0], function(status){ if (status !== "success") { console.log("Unable to access network") phantom.exit() } else { waitFor(function(){ return page.evaluate(function(){ var el = document.getElementById('qunit-testresult') if (el && el.innerText.match('completed')) { return true } return false }) }, function(){ var failedNum = page.evaluate(function(){ var el = document.getElementById('qunit-testresult') try { return el.getElementsByClassName('failed')[0].innerHTML } catch (e) { } return 10000 }); phantom.exit((parseInt(failedNum, 10) > 0) ? 1 : 0) }) } })
import Application from './Application'; export default class ChatBuilder { constructor() { this._application = new Application(); } withApiKey(apiKey) { this._application._apiKey = apiKey; return this; } build(opts) { this._application.openBlipThread(opts); } destroy(){ if (this._application) { this._application.destroy(); this._application = null; } } sendMessage(message) { this._application._sendMessage(message); } }
// @!!! Content begin mark. This is required to mark beginning of the file part to compare to the reference without bridge.js content // This is resource from referenced project A for testing issue #2717 // --- A ---
/** * @author: Dennis Hernández * @webSite: http://djhvscf.github.io/Blog * @version: v1.0.0 * * @update zhixin wen <wenzhixin2010@gmail.com> */ !function ($) { 'use strict'; $.extend($.fn.bootstrapTable.defaults, { keyEvents: false }); var BootstrapTable = $.fn.bootstrapTable.Constructor, _init = BootstrapTable.prototype.init; BootstrapTable.prototype.init = function () { _init.apply(this, Array.prototype.slice.apply(arguments)); this.initKeyEvents(); }; BootstrapTable.prototype.initKeyEvents = function () { if (this.options.keyEvents) { var that = this; $(document).off('keydown').on('keydown', function (e) { var $search = that.$toolbar.find('.search input'), $refresh = that.$toolbar.find('button[name="refresh"]'), $toggle = that.$toolbar.find('button[name="toggle"]'), $paginationSwitch = that.$toolbar.find('button[name="paginationSwitch"]'); if (document.activeElement === $search.get(0) || !$.contains(document.activeElement, that.$toolbar.get(0))) { return true; } switch (e.keyCode) { case 83: //s if (!that.options.search) { return; } $search.focus(); return false; case 82: //r if (!that.options.showRefresh) { return; } $refresh.click(); return false; case 84: //t if (!that.options.showToggle) { return; } $toggle.click(); return false; case 80: //p if (!that.options.showPaginationSwitch) { return; } $paginationSwitch.click(); return false; case 37: // left if (!that.options.pagination) { return; } that.prevPage(); return false; case 39: // right if (!that.options.pagination) { return; } that.nextPage(); return; } }); } }; }(jQuery);
// Licensed to Cloudera, Inc. under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. Cloudera, Inc. licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Array polyfills for older browsers if (!('clean' in Array.prototype)) { Array.prototype.clean = function (deleteValue) { for (var i = 0; i < this.length; i++) { if (this[i] == deleteValue) { this.splice(i, 1); i--; } } return this; }; } if (!('move' in Array.prototype)) { Array.prototype.move = function (old_index, new_index) { if (new_index >= this.length) { var k = new_index - this.length; while ((k--) + 1) { this.push(undefined); } } this.splice(new_index, 0, this.splice(old_index, 1)[0]); return this; }; } if (!('indexOf' in Array.prototype)) { Array.prototype.indexOf = function (needle) { for (var i = 0; i < this.length; i++) { if (this[i] === needle) { return i; } } return -1; }; } // adding missing .filter for IE8 if (!('filter' in Array.prototype)) { Array.prototype.filter = function (filter, that /*opt*/) { var other = [], v; for (var i = 0, n = this.length; i < n; i++) if (i in this && filter.call(that, v = this[i], i, this)) other.push(v); return other; }; } Array.prototype.diff = function (a) { return this.filter(function (i) { return a.indexOf(i) < 0; }); }; /* * Add utility methods to the HUE object */ (function (hue) { 'use strict'; /* * Convert text to URLs * Selector arg can be jQuery or document.querySelectorAll() */ hue.text2Url = function (selectors) { var i = 0, len = selectors.length; for (i; i < len; i++) { var arr = [], selector = selectors[i], val = selector.innerHTML.replace(/&nbsp;/g, ' ').split(' '); val.forEach(function(word) { var matched = null, re = /(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?/gi; if (re.test(word)) { matched = word.match(re); word = word.replace(matched, '<a href="' + matched + '">' + matched + '</a>') arr.push(word); } else { arr.push(word); } }); selector.innerHTML = arr.join(' '); } return this; }; /* * Create a in-memory div, set it's inner text(which jQuery automatically encodes) * then grab the encoded contents back out. */ hue.htmlEncode = function (value){ return $('<div/>').text(value).html(); }; }(hue = window.hue || {})); if (!Object.keys) { Object.keys = (function () { 'use strict'; var hasOwnProperty = Object.prototype.hasOwnProperty, hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'), dontEnums = [ 'toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor' ], dontEnumsLength = dontEnums.length; return function (obj) { if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) { throw new TypeError('Object.keys called on non-object'); } var result = [], prop, i; for (prop in obj) { if (hasOwnProperty.call(obj, prop)) { result.push(prop); } } if (hasDontEnumBug) { for (i = 0; i < dontEnumsLength; i++) { if (hasOwnProperty.call(obj, dontEnums[i])) { result.push(dontEnums[i]); } } } return result; }; }()); } function s4() { return Math.floor((1 + Math.random()) * 0x10000) .toString(16) .substring(1); } function UUID() { return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4(); } // Based on original pub/sub implementation from http://davidwalsh.name/pubsub-javascript var huePubSub = (function () { var topics = {}; var hOP = topics.hasOwnProperty; return { subscribe: function (topic, listener) { if(! hOP.call(topics, topic)) { topics[topic] = []; } var index = topics[topic].push(listener) - 1; return { remove: function () { delete topics[topic][index]; } }; }, subscribeOnce: function (topic, listener) { var ephemeral = this.subscribe(topic, function(){ listener.apply(arguments); ephemeral.remove(); }); }, publish: function (topic, info) { if (! hOP.call(topics, topic)) { return; } topics[topic].forEach(function (item) { item(info); }); } }; })(); Number.prototype.toHHMMSS = function () { var _s = this; var _ms = _s % 1000; _s = (_s - _ms) / 1000; var _secs = _s % 60; _s = (_s - _secs) / 60; var _mins = _s % 60; var _hrs = (_s - _mins) / 60; return (_hrs > 0 ? _hrs + "h, " : "") + (_mins > 0 ? _mins + "m, " : "") + _secs + "." + _ms + "s"; }
/** * Copyright 2015 The AMP HTML Authors. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS-IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import {dev} from '../../src/log'; import {loadScript} from '#3p/3p'; /* global Criteo: false */ /** @const {string} */ const TAG = 'CRITEO'; /** * @param {!Window} global * @param {!Object} data */ export function criteo(global, data) { loadScript(global, 'https://static.criteo.net/js/ld/publishertag.js', () => { if (!data.tagtype || data.tagtype === 'passback') { Criteo.DisplayAd({ zoneid: data.zone, containerid: 'c', integrationmode: 'amp', }); } else if (data.tagtype === 'rta' || data.tagtype === 'standalone') { dev().error( TAG, 'You are using a deprecated Criteo integration', data.tagtype ); } else { dev().error( TAG, 'You are using an unknown Criteo integration', data.tagtype ); } }); }
/** * Emits "milestone" event on Navigation Timing related events: * * - domContentLoaded * - domInteractive * - domComplete * * Code taken from windowPerformance module */ "use strict"; // no-op, see scope.js module.exports = () => {};
// Generated by CoffeeScript 1.9.2 (function() { var COMMANDS, TAB, argv, c, command, fs, optimist, possibilities, indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; fs = require('fs'); optimist = require('optimist'); COMMANDS = ['cover', 'report']; TAB = ' '; argv = optimist.usage("Usage: $0 subcommand\n=== subcommands ===\n" + TAB + (COMMANDS.join("\n" + TAB))).argv; command = argv._[0]; if (command == null) { optimist.showHelp(); process.exit(0); } if (indexOf.call(COMMANDS, command) < 0) { possibilities = (function() { var i, len, results; results = []; for (i = 0, len = COMMANDS.length; i < len; i++) { c = COMMANDS[i]; if (command === c.slice(0, command.length)) { results.push(c); } } return results; })(); switch (possibilities.length) { case 0: console.error("Unrecognised command: `" + command + "`. Run `" + argv['$0'] + "` for help."); process.exit(1); break; case 1: command = possibilities[0]; break; default: console.error("Ambiguous command `" + command + "` matches `" + (possibilities.join('`, `')) + "`"); process.exit(1); } } (require("./" + command))(argv, function(err) { if (err) { console.error(err); process.exit(1); } return process.exit(0); }); }).call(this);
var EPUBJS = EPUBJS || {}; EPUBJS.replace = {}; //-- Replaces the relative links within the book to use our internal page changer EPUBJS.replace.hrefs = function(callback, renderer){ var book = this; var replacments = function(link, done){ var href = link.getAttribute("href"), isRelative = href.search("://"), directory, relative, location, base, uri, url; if(isRelative != -1){ link.setAttribute("target", "_blank"); }else{ // Links may need to be resolved, such as ../chp1.xhtml base = renderer.render.docEl.querySelector('base'); url = base.getAttribute("href"); uri = EPUBJS.core.uri(url); directory = uri.directory; if(directory) { // We must ensure that the file:// protocol is preserved for // local file links, as in certain contexts (such as under // Titanium), file links without the file:// protocol will not // work if (uri.protocol === "file") { relative = EPUBJS.core.resolveUrl(uri.base, href); } else { relative = EPUBJS.core.resolveUrl(directory, href); } } else { relative = href; } link.onclick = function(){ book.goto(relative); return false; }; } done(); }; renderer.replace("a[href]", replacments, callback); }; EPUBJS.replace.head = function(callback, renderer) { renderer.replaceWithStored("link[href]", "href", EPUBJS.replace.links, callback); }; //-- Replaces assets src's to point to stored version if browser is offline EPUBJS.replace.resources = function(callback, renderer){ //srcs = this.doc.querySelectorAll('[src]'); renderer.replaceWithStored("[src]", "src", EPUBJS.replace.srcs, callback); }; EPUBJS.replace.svg = function(callback, renderer) { renderer.replaceWithStored("svg image", "xlink:href", function(_store, full, done){ _store.getUrl(full).then(done); }, callback); }; EPUBJS.replace.srcs = function(_store, full, done){ _store.getUrl(full).then(done); }; //-- Replaces links in head, such as stylesheets - link[href] EPUBJS.replace.links = function(_store, full, done, link){ //-- Handle replacing urls in CSS if(link.getAttribute("rel") === "stylesheet") { EPUBJS.replace.stylesheets(_store, full).then(function(url, full){ // done done(url, full); }, function(reason) { // we were unable to replace the style sheets done(null); }); }else{ _store.getUrl(full).then(done, function(reason) { // we were unable to get the url, signal to upper layer done(null); }); } }; EPUBJS.replace.stylesheets = function(_store, full) { var deferred = new RSVP.defer(); if(!_store) return; _store.getText(full).then(function(text){ var url; EPUBJS.replace.cssImports(_store, full, text).then(function (importText) { text = importText + text; EPUBJS.replace.cssUrls(_store, full, text).then(function(newText){ var _URL = window.URL || window.webkitURL || window.mozURL; var blob = new Blob([newText], { "type" : "text\/css" }), url = _URL.createObjectURL(blob); deferred.resolve(url); }, function(reason) { deferred.reject(reason); }); }); }, function(reason) { deferred.reject(reason); }); return deferred.promise; }; EPUBJS.replace.cssImports = function (_store, base, text) { var deferred = new RSVP.defer(); if(!_store) return; // check for css @import var importRegex = /@import\s+(?:url\()?\'?\"?((?!data:)[^\'|^\"^\)]*)\'?\"?\)?/gi; var importMatches, importFiles = [], allImportText = ''; while (importMatches = importRegex.exec(text)) { importFiles.push(importMatches[1]); } if (importFiles.length === 0) { deferred.resolve(allImportText); } importFiles.forEach(function (fileUrl) { var full = EPUBJS.core.resolveUrl(base, fileUrl); full = EPUBJS.core.uri(full).path; _store.getText(full).then(function(importText){ allImportText += importText; if (importFiles.indexOf(fileUrl) === importFiles.length - 1) { deferred.resolve(allImportText); } }, function(reason) { deferred.reject(reason); }); }); return deferred.promise; }; EPUBJS.replace.cssUrls = function(_store, base, text){ var deferred = new RSVP.defer(), promises = [], matches = text.match(/url\(\'?\"?((?!data:)[^\'|^\"^\)]*)\'?\"?\)/g); if(!_store) return; if(!matches){ deferred.resolve(text); return deferred.promise; } matches.forEach(function(str){ var full = EPUBJS.core.resolveUrl(base, str.replace(/url\(|[|\)|\'|\"]|\?.*$/g, '')); full = EPUBJS.core.uri(full).path; var replaced = _store.getUrl(full).then(function(url){ text = text.replace(str, 'url("'+url+'")'); }, function(reason) { deferred.reject(reason); }); promises.push(replaced); }); RSVP.all(promises).then(function(){ deferred.resolve(text); }); return deferred.promise; };
/* * Tangram * Copyright 2009 Baidu Inc. All rights reserved. * * path: baidu/dom.js * author: allstar, erik * version: 1.1.0 * date: 2009/12/02 */ ///import baidu; /** * @namespace baidu.dom 操作dom的方法。 */ baidu.dom = baidu.dom || {};
/** * @fileOverview 文件选择相关 */ define([ '../base', '../uploader', '../lib/filepicker', './widget' ], function( Base, Uploader, FilePicker ) { var $ = Base.$; $.extend( Uploader.options, { /** * @property {Selector | Object} [pick=undefined] * @namespace options * @for Uploader * @description 指定选择文件的按钮容器,不指定则不创建按钮。 * * * `id` {Seletor|dom} 指定选择文件的按钮容器,不指定则不创建按钮。**注意** 这里虽然写的是 id, 但是不是只支持 id, 还支持 class, 或者 dom 节点。 * * `label` {String} 请采用 `innerHTML` 代替 * * `innerHTML` {String} 指定按钮文字。不指定时优先从指定的容器中看是否自带文字。 * * `multiple` {Boolean} 是否开起同时选择多个文件能力。 */ pick: null, /** * @property {Arroy} [accept=null] * @namespace options * @for Uploader * @description 指定接受哪些类型的文件。 由于目前还有ext转mimeType表,所以这里需要分开指定。 * * * `title` {String} 文字描述 * * `extensions` {String} 允许的文件后缀,不带点,多个用逗号分割。 * * `mimeTypes` {String} 多个用逗号分割。 * * 如: * * ``` * { * title: 'Images', * extensions: 'gif,jpg,jpeg,bmp,png', * mimeTypes: 'image/*' * } * ``` */ accept: null/*{ title: 'Images', extensions: 'gif,jpg,jpeg,bmp,png', mimeTypes: 'image/*' }*/ }); return Uploader.register({ name: 'picker', init: function( opts ) { this.pickers = []; return opts.pick && this.addBtn( opts.pick ); }, refresh: function() { $.each( this.pickers, function() { this.refresh(); }); }, /** * @method addButton * @for Uploader * @grammar addButton( pick ) => Promise * @description * 添加文件选择按钮,如果一个按钮不够,需要调用此方法来添加。参数跟[options.pick](#WebUploader:Uploader:options)一致。 * @example * uploader.addButton({ * id: '#btnContainer', * innerHTML: '选择文件' * }); */ addBtn: function( pick ) { var me = this, opts = me.options, accept = opts.accept, promises = []; if ( !pick ) { return; } $.isPlainObject( pick ) || (pick = { id: pick }); $( pick.id ).each(function() { var options, picker, deferred; deferred = Base.Deferred(); options = $.extend({}, pick, { accept: $.isPlainObject( accept ) ? [ accept ] : accept, swf: opts.swf, runtimeOrder: opts.runtimeOrder, id: this }); picker = new FilePicker( options ); picker.once( 'ready', deferred.resolve ); picker.on( 'select', function( files ) { me.owner.request( 'add-file', [ files ]); }); picker.on('dialogopen', function() { me.owner.trigger('dialogOpen', picker.button); }); picker.init(); me.pickers.push( picker ); promises.push( deferred.promise() ); }); return Base.when.apply( Base, promises ); }, disable: function() { $.each( this.pickers, function() { this.disable(); }); }, enable: function() { $.each( this.pickers, function() { this.enable(); }); }, destroy: function() { $.each( this.pickers, function() { this.destroy(); }); this.pickers = null; } }); });
/* global SETTINGS:false */ __webpack_public_path__ = `http://${SETTINGS.host}:8072/`; // eslint-disable-line no-undef, camelcase import React from 'react'; import ReactDOM from 'react-dom'; import App from './containers/App'; import { Provider } from 'react-redux'; import configureStore from './store/configureStore'; import createBrowserHistory from 'history/lib/createBrowserHistory'; import { devTools, persistState } from 'redux-devtools'; import { DevTools, DebugPanel, LogMonitor } from 'redux-devtools/lib/react'; import { Router, Route, IndexRoute } from 'react-router'; import ga from 'react-ga'; const store = configureStore(); let debug = SETTINGS.reactGaDebug === "true"; ga.initialize(SETTINGS.gaTrackingID, { debug: debug }); let debugTools; if (process.env.NODE_ENV !== 'production') { debugTools = <DebugPanel top right bottom> <DevTools store={store} monitor={LogMonitor} visibleOnLoad={false}/> </DebugPanel>; } ReactDOM.render( <div> <Provider store={store}> <Router history={createBrowserHistory()}> <Route path="/" component={App} onUpdate={ga.pageview(window.location.pathname)}></Route> </Router> </Provider> {debugTools} </div>, document.getElementById("container") );
/* Copyright (c) 2014-2015, ArrayFire Copyright (c) 2015 Gábor Mező aka unbornchikken (gabor.mezo@outlook.com) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the ArrayFire nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ "use strict"; var interpType = module.exports = { nearest: 0, ///< Nearest Interpolation linear: 1, ///< Linear Interpolation bilinerar: 2, ///< Bilinear Interpolation cubic: 3, ///< Cubic Interpolation, AF_INTERP_NEAREST: 0, ///< Nearest Interpolation AF_INTERP_LINEAR: 1, ///< Linear Interpolation AF_INTERP_BILINEAR: 2, ///< Bilinear Interpolation AF_INTERP_CUBIC: 3 ///< Cubic Interpolation }; //# sourceMappingURL=interpType.js.map
#!/usr/bin/env node var server = require('./lib/server');
$(document).ready(function(){ json = jQuery.parseJSON($('div.jsonContent').html()); if(json.type == 'mp3') { $("#jquery_jplayer_1").jPlayer( { ready: function () { $(this).jPlayer("setMedia", {mp3: json.global.webroot+"/download?items="+json.itemId}); } }) } if(json.type == 'm4a') { $("#jquery_jplayer_1").jPlayer({ ready: function () { $(this).jPlayer("setMedia", { m4a: json.global.webroot+"/download?items="+json.itemId }); supplied = 'm4a, oga'; }, ended: function (event) { }, swfPath: json.global.moduleWebroot+"/public/js/jquery", supplied: "m4a, oga" }) } if(json.type == 'm4v') { $("#jquery_jplayer_1").jPlayer({ ready: function () { $(this).jPlayer("setMedia", { m4v: json.global.webroot+"/download?items="+json.itemId }); }, ended: function (event) { $(this).jPlayer("play"); }, swfPath: json.global.webroot+"/modules/visualize/public/js/jquery", solution: "flash, html", supplied: "m4v, ogv" }); } });
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @format strict-local * @flow */ import * as React from 'react'; import type {ImageProps as ImagePropsType} from './ImageProps'; import ImageViewNativeComponent from './ImageViewNativeComponent'; import TextInlineImageNativeComponent from './TextInlineImageNativeComponent'; export default { unstable_createImageComponent: (null: ?( Image: React.AbstractComponent< ImagePropsType, | React.ElementRef<typeof TextInlineImageNativeComponent> | React.ElementRef<typeof ImageViewNativeComponent>, >, ) => React.AbstractComponent< ImagePropsType, | React.ElementRef<typeof TextInlineImageNativeComponent> | React.ElementRef<typeof ImageViewNativeComponent>, >), };
function createShip () { return doodle.createSprite(function () { //method to call when key pressed this.draw = function (showFlame) { this.graphics.clear(); this.graphics.lineStyle(1, 0xffffff); this.graphics.beginPath(); this.graphics.moveTo(10, 0); this.graphics.lineTo(-10, 10); this.graphics.lineTo(-5, 0); this.graphics.lineTo(-10, -10); this.graphics.lineTo(10, 0); this.graphics.stroke(); if (showFlame) { this.graphics.beginPath(); this.graphics.moveTo(-7.5, -5); this.graphics.lineTo(-15, 0); this.graphics.lineTo(-7.5, 5); this.graphics.stroke(); } }; }); }
Ext.define('icc.view.idatabase.Data.Field.md5field', { extend : 'Ext.form.field.Text', alias : 'widget.md5field', title : 'MD5输入框' });
var url = require('url'); var request = require('request'); exports.proxy = function(auth, req, res) { var uri = url.parse('https://www.yammer.com/api/v1/'+req.url); uri.query = req.query; uri.query.access_token = auth.token.access_token.token; // trying to mirror everything needed from orig req var arg = {method:req.method}; arg.uri = url.format(uri); if(req.headers['content-type']) { // post or put only? req.headers = {'content-type':req.headers['content-type']}; arg.body = req.body; } arg.json = true; request(arg).pipe(res); };
var webpack = require('webpack'); var loaders = ['babel']; var port = process.env.PORT || 3000; var plugins = [ new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV) }) ]; var entry = { demo0: './demos/demo0/index.jsx', demo1: './demos/demo1/index.jsx', demo2: './demos/demo2/index.jsx', demo3: './demos/demo3/index.jsx', demo4: './demos/demo4/index.jsx', demo5: './demos/demo5/index.jsx', demo6: './demos/demo6/index.jsx', }; if (process.env.NODE_ENV === 'development') { devtool = 'eval-source-map'; loaders = ['react-hot'].concat(loaders); plugins = plugins.concat([ new webpack.HotModuleReplacementPlugin() ]); entry = Object.keys(entry).reduce(function (result, key) { result[key] = [ 'webpack-dev-server/client?http://0.0.0.0:' + port, 'webpack/hot/only-dev-server', entry[key] ]; return result; }, {}); } else { plugins = plugins.concat([ new webpack.optimize.OccurenceOrderPlugin() ]); } module.exports = { entry: entry, output: { filename: '[name]/all.js', publicPath: '/demos/', path: __dirname + '/demos/' }, module: { loaders: [{ test: /\.jsx?$/, exclude: /build|lib|bower_components|node_modules/, loaders: loaders }], preLoaders: [ {test: /\.jsx?$/, loader: 'eslint', exclude: /build|lib|bower_components|node_modules/}, ], }, resolve: { extensions: ['', '.js', '.jsx'] }, plugins: plugins, eslint: {configFile: '.eslintrc'} };
#!/usr/bin/env node var RSVP = require('rsvp'); var spawn = require('child_process').spawn; var chalk = require('chalk'); var getFeatures = require('../ember-cli-build').getFeatures; var getPackages = require('../lib/packages'); var runInSequence = require('../lib/run-in-sequence'); var finalhandler = require('finalhandler'); var http = require('http'); var serveStatic = require('serve-static'); // Serve up public/ftp folder. var serve = serveStatic('./dist/', { 'index': ['index.html', 'index.htm'] }); // Create server. var server = http.createServer(function(req, res) { var done = finalhandler(req, res); serve(req, res, done); }); var PORT = 13141; // Listen. server.listen(PORT); function run(queryString) { return new RSVP.Promise(function(resolve, reject) { var url = 'http://localhost:' + PORT + '/tests/?' + queryString; runInPhantom(url, 3, resolve, reject); }); } function runInPhantom(url, retries, resolve, reject) { var args = [require.resolve('qunit-phantomjs-runner'), url, '900']; console.log('Running: phantomjs ' + args.join(' ')); var crashed = false; var child = spawn('phantomjs', args); var result = {output: [], errors: [], code: null}; child.stdout.on('data', function (data) { var string = data.toString(); var lines = string.split('\n'); lines.forEach(function(line) { if (line.indexOf('0 failed.') > -1) { console.log(chalk.green(line)); } else { console.log(line); } }); result.output.push(string); }); child.stderr.on('data', function (data) { var string = data.toString(); if (string.indexOf('PhantomJS has crashed.') > -1) { crashed = true; } result.errors.push(string); console.error(chalk.red(string)); }); child.on('close', function (code) { result.code = code; if (!crashed && code === 0) { resolve(result); } else if (crashed) { console.log(chalk.red('Phantom crashed with exit code ' + code)); if (retries > 1) { console.log(chalk.yellow('Retrying... ¯\_(ツ)_/¯')); runInPhantom(url, retries - 1, resolve, reject); } else { console.log(chalk.red('Giving up! (╯°□°)╯︵ ┻━┻')); console.log(chalk.yellow('This might be a known issue with PhantomJS 1.9.8, skipping for now')); resolve(result); } } else { reject(result); } }); } var testFunctions = []; function generateEachPackageTests() { var features = getFeatures(); var packages = getPackages(features); Object.keys(packages).forEach(function(packageName) { if (packages[packageName].skipTests) { return; } testFunctions.push(function() { return run('package=' + packageName); }); testFunctions.push(function() { return run('package=' + packageName + '&enableoptionalfeatures=true'); }); }); } function generateBuiltTests() { // Container isn't publicly available. // ember-testing/ember-debug are stripped from prod/min. var common = 'skipPackage=container,ember-testing,ember-debug'; testFunctions.push(function() { return run(common + '&nojshint=true'); }); testFunctions.push(function() { return run(common + '&dist=min&prod=true'); }); testFunctions.push(function() { return run(common + '&dist=prod&prod=true'); }); testFunctions.push(function() { return run(common + '&enableoptionalfeatures=true&dist=prod&prod=true'); }); } function generateOldJQueryTests() { testFunctions.push(function() { return run('jquery=1.8.3&nojshint=true'); }); testFunctions.push(function() { return run('jquery=1.10.2&nojshint=true'); }); testFunctions.push(function() { return run('jquery=2.2.4&nojshint=true'); }); } function generateExtendPrototypeTests() { testFunctions.push(function() { return run('extendprototypes=true&nojshint=true'); }); testFunctions.push(function() { return run('extendprototypes=true&nojshint=true&enableoptionalfeatures=true'); }); } switch (process.env.TEST_SUITE) { case 'built-tests': console.log('suite: built-tests'); generateBuiltTests(); break; case 'old-jquery-and-extend-prototypes': console.log('suite: old-jquery-and-extend-prototypes'); generateOldJQueryTests(); generateExtendPrototypeTests(); break; case 'all': console.log('suite: all'); generateBuiltTests(); generateOldJQueryTests(); generateExtendPrototypeTests(); generateEachPackageTests(); break; case 'node': console.log('suite: node'); require('./run-node-tests'); return; case 'blueprints': console.log('suite: blueprints'); require('../node-tests/nodetest-runner'); server.close(); return; case 'travis-browsers': console.log('suite: sauce'); require('./run-travis-browser-tests'); return; case 'sauce': console.log('suite: sauce'); require('./run-sauce-tests'); return; default: console.log('suite: default (generate each package)'); generateEachPackageTests(); } runInSequence(testFunctions) .then(function() { console.log(chalk.green('Passed!')); process.exit(0); }) .catch(function() { console.error(chalk.red('Failed!')); process.exit(1); });
define("gridx/nls/de/QuickFilter", { filterLabel: 'Filtern', clearButtonTitle: 'Filter aufheben', buildFilterMenuLabel: 'Filter erstellen&hellip;', apply: 'Filter anwenden' });
/* eslint-env mocha */ import expect from 'expect'; import React from 'react'; import { render } from '../../__tests__/render'; import { FooterDropDownSection } from '../'; describe('Footer', () => { describe('FooterDropDownSection', () => { it('should render a div with the dropdown section css class', () => { const output = render(<FooterDropDownSection title="Section" />); expect(output.type).toBe('div'); expect(output.props.className) .toInclude('mdl-mega-footer__drop-down-section'); }); it('should allow custom css classes', () => { const output = render(<FooterDropDownSection className="my-dropdown" title="Section" />); expect(output.props.className) .toInclude('mdl-mega-footer__drop-down-section') .toInclude('my-dropdown'); }); it('should render with a mini size if specified', () => { const output = render(<FooterDropDownSection size="mini" title="Section" />); expect(output.props.className) .toInclude('mdl-mini-footer__drop-down-section'); }); it('should pass the size to children', () => { const element = ( <FooterDropDownSection title="Section"> <div>Allo</div> </FooterDropDownSection> ); const output = render(element); expect(output.props.size) .toBe(output.props.children[0].props.size); }); }); });
version https://git-lfs.github.com/spec/v1 oid sha256:98e41e7d7c54f3a57f3cd2c5ba518b76b0c219847b65ddb077aa465f4c73c4e9 size 8767
var knexConfig = require('./knexfile'); var knex = require('knex')(knexConfig); var express = require('express'); var path = require('path'); var favicon = require('serve-favicon'); var logger = require('morgan'); var cookieParser = require('cookie-parser'); var bodyParser = require('body-parser'); var app = express(); app.set('database', knex); module.exports = app; var routes = require('./routes/index'); var users = require('./routes/users'); // view engine setup app.set('views', path.join(__dirname, 'views')); app.set('view engine', 'jade'); // uncomment after placing your favicon in /public //app.use(favicon(__dirname + '/public/favicon.ico')); app.use(logger('dev')); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: false })); app.use(cookieParser()); app.use(express.static(path.join(__dirname, 'public'))); app.use('/', routes); app.use('/users', users); // catch 404 and forward to error handler app.use(function(req, res, next) { var err = new Error('Not Found'); err.status = 404; next(err); }); // error handlers // development error handler // will print stacktrace if (app.get('env') === 'development') { app.use(function(err, req, res, next) { res.status(err.status || 500); res.render('error', { message: err.message, error: err }); }); } // production error handler // no stacktraces leaked to user app.use(function(err, req, res, next) { res.status(err.status || 500); res.render('error', { message: err.message, error: {} }); });
import eq from '../eq.js' /** * Gets the index at which the `key` is found in `array` of key-value pairs. * * @private * @param {Array} array The array to inspect. * @param {*} key The key to search for. * @returns {number} Returns the index of the matched value, else `-1`. */ function assocIndexOf(array, key) { let { length } = array while (length--) { if (eq(array[length][0], key)) { return length } } return -1 } export default assocIndexOf
const express = require('express') const morgan = require('morgan') const cors = require('cors') const path = require('path') const plugins = require('../plugins') const isCompatible = require('./validator').isCompatible const app = express() // Middleware Settings app.use(cors()) app.use(express.static(path.resolve(__dirname, '..', 'build'))) app.use('/public', express.static(path.resolve(__dirname, '..', 'public'))) app.use(morgan('dev')) // Allowed HTTP methods const METHODS = { 'GET': app.get.bind(app), 'POST': app.post.bind(app), 'PATCH': app.patch.bind(app), 'DELETE': app.delete.bind(app) } // Main UI Page Rendered app.get('/', (req, res) => res.status(200).render('index.html')) // Plugin Handler for (var i = 0; i < plugins.length; i++) { /* Each plugin is expected to have a name and a reference to a list of features. We iterate through this list and handle each feature seperately and according to its specifications. */ const plugin = plugins[i] const plugingRef = plugin.ref if (isCompatible(plugin.ref)) { const pluginFeatures = plugingRef.features handleFeatures(pluginFeatures, plugin) } } function handleFeatures (pluginFeatures, plugin) { for (var j = 0; j < pluginFeatures.length; j++) { const pluginFeature = pluginFeatures[j] const pluginFeatureName = pluginFeature.name const pluginFeaturesMethods = pluginFeature.methods const pluginFeatureRef = pluginFeature.ref for (var k = 0; k < pluginFeaturesMethods.length; k++) { const pluginFeaturesMethod = pluginFeaturesMethods[k].toUpperCase() if (METHODS[pluginFeaturesMethod] === undefined) { console.error(`${pluginFeaturesMethod} is invalid on upsupported request. Skipping this feature`) } else { const subAPIURL = `/API/${plugin.name}/${pluginFeatureName}` console.log(`Serving ${pluginFeaturesMethod} @ ${subAPIURL}`) METHODS[pluginFeaturesMethod](subAPIURL, pluginFeatureRef) } } } } module.exports = {app}
$(function() { $('form.signup-form').each(function(i, el) { signupForm($(el)) }) function signupForm($form) { var $submits = $form.find('[type=submit]') var $spinner = $form.find('.spinner') function formState($form) { return R.mergeAll( $form.serializeArray().map(function(o) { var obj = {} obj[o.name] = o.value return obj })) } var requiredKeys = $form.find('label.required') .map(function(i, el) { return $(el).attr('for').split('_')[1] }).get() $form.find('input').keyup(function() { var data = formState($form) var formValid = requiredKeys.map(function(key) { return !R.isEmpty(data[key]) }).reduce(function(a, b) { return a && b }) $submits.prop('disabled', !formValid) }) // Set age to 0 or round it if value is not allowed $form.find('.age').focusout(function() { var age = Math.round($(this).val()) ? Math.abs(Math.round($(this).val())) : 0; $(this).val(age) }) $form.submit(function(e) { e.preventDefault() $form.find('.submit-message').hide() $spinner.show() $submits.prop('disabled', true) $.ajax({ url: $form.attr('action'), type: $form.attr('method'), data: $form.serialize(), success: function(res) { $spinner.hide() $form.trigger('reset') $submits.prop('disabled', true) $form.find('.submit-message.success').fadeIn().delay(5000).fadeOut() }, error: function(res) { $spinner.hide() $submits.prop('disabled', false) $form.find('.submit-message.error').fadeIn().delay(5000).fadeOut() } }) }) } })
/* * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is * regenerated. */ 'use strict'; const models = require('./index'); /** * The data stored in Parquet format. * * @extends models['DatasetStorageFormat'] */ class ParquetFormat extends models['DatasetStorageFormat'] { /** * Create a ParquetFormat. */ constructor() { super(); } /** * Defines the metadata of ParquetFormat * * @returns {object} metadata of ParquetFormat * */ mapper() { return { required: false, serializedName: 'ParquetFormat', type: { name: 'Composite', className: 'ParquetFormat', modelProperties: { serializer: { required: false, serializedName: 'serializer', type: { name: 'Object' } }, deserializer: { required: false, serializedName: 'deserializer', type: { name: 'Object' } }, type: { required: true, serializedName: 'type', type: { name: 'String' } } } } }; } } module.exports = ParquetFormat;
var spawn = require("child_process").spawn; exports.handler = function(event, context) { child = spawn(event.file, event.args); child.stdout.on("data", function (data) { console.log(data.toString()) }); child.stderr.on("data", function (data) { console.error(data.toString()) }); child.on("close", function(code) { if (code == 0) { context.succeed("Process complete!"); } else { context.fail("Process failed with exit code: " + code); } }); };
module.exports = { description: 'do not fail for recursive calls' };
function rm6_u_en(str) { var e="", i=0; for(i=0;i<str.length;i++){ if(str.charCodeAt(i)>=0&&str.charCodeAt(i)<=255){ e=e+escape(str.charAt(i)); } else{ e=e+str.charAt(i); } } return e; } function rm6_g_sr() { if (self.screen) { sr=screen.width+"x"+screen.height; } else if (self.java) { var j=java.awt.Toolkit.getDefaultToolkit(); var s=j.getScreenSize(); sr=s.width+"x"+s.height; } return sr; } function rm6_g_sc() { var sc=""; if (self.screen) { sc=screen.colorDepth+"-bit"; } return sc; } function rm6_g_lg() { var lg=""; var n=navigator; if (n.language) { lg=n.language.toLowerCase(); } else if (n.browserLanguage) { lg=n.browserLanguage.toLowerCase(); } return lg; } function rm6_g_ag() { var ag=""; var n=navigator; if (n.userAgent) { ag = n.userAgent; } return ag; } function rm6_g_je() { var je=""; var n=navigator; je = n.javaEnabled()?1:0; return je; } function rm6_g_fl() { var f="",n=navigator; if (n.plugins && n.plugins.length) { for (var ii=0;ii<n.plugins.length;ii++) { if (n.plugins[ii].name.indexOf('Shockwave Flash')!=-1) { f=n.plugins[ii].description.split('Shockwave Flash ')[1]; break; } } } else if (window.ActiveXObject) { for (var ii=10;ii>=2;ii--) { try { var fl=eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash."+ii+"');"); if (fl) { f=ii + '.0'; break; } } catch(e) { } } } return f; } function rm6_g_co(name) { var mn=name+"="; var b,e; var co=document.cookie; if (mn=="=") { return co; } b=co.indexOf(mn); if (b < 0) { return ""; } e=co.indexOf(";", b+name.length); if (e < 0) { return co.substring(b+name.length + 1); } else { return co.substring(b+name.length + 1, e); } } function rm6_s_co(name,val,cotp) { var date=new Date; var year=date.getYear(); var hour=date.getHours(); if (cotp == 0) { document.cookie=name+"="+val+";"; } else if (cotp == 1) { year=year+10; date.setYear(year); document.cookie=name+"="+val+";expires="+date.toGMTString()+";"; } else if (cotp == 2) { hour=hour+1; date.setHours(hour); document.cookie=name+"="+val+";expires="+date.toGMTString()+";"; } } function rm6_g_so() { var so=""; var n=navigator; if (n.appName) { so=n.appName; } return so; } function rm6_grm6m() { var date = new Date(); var yy=date.getYear(); var mm=date.getMonth(); var dd=date.getDate(); var hh=date.getHours(); var ii=date.getMinutes(); var ss=date.getSeconds(); var i; var tm=0; for(i = 1970; i < yy; i++) { if ((i % 4 == 0 && i % 100 != 0) || (i % 100 == 0 && i % 400 == 0)) { tm=tm+31622400; } else { tm=tm+31536000; } } mm=mm+1; for(i = 1; i < mm; i++) { if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12) { tm=tm+2678400; } else { if (i == 2) { if ((yy % 4 == 0 && yy % 100 != 0) || (yy % 100 == 0 && yy % 400 == 0)) { tm=tm+2505600; } else { tm=tm+2419200; } } else { tm=tm+2592000; } } } tm = tm + (dd-1) * 86400; tm = tm + hh * 3600; tm = tm + ii * 60; tm = tm + ss; return tm; } function rm6_g_ctm(str) { len=str.indexOf("_"); str=str.substring(len+1); len=str.indexOf("_"); str=str.substring(0,len); return parseInt(str, 10); } function $random(min, max){ return Math.floor(Math.random() * (max - min + 1) + min); } function main() { var ipArr = ["122.70.135.84","122.70.135.85","122.70.135.87","122.70.135.88"] ; var rm6_ip = ipArr[$random(0,3)]; var rm6_dest="/rm6_stat.do?"; var rm6_usn=""; var rm6_nuv=0; var rm6_uv =""; var rm6_ss =""; var rm6_ref=""; var rm6_url=""; var rm6_clr=""; var rm6_scr=""; var rm6_lng=""; var rm6_agt=""; var rm6_jav=""; var rm6_flu=""; var rm6_sof=""; var rm6_cva=""; var rm6_len=0; rm6_uv=rm6_g_co("rm6_stat_bck"); if (rm6_uv=="") { rm6_nuv = 1; rm6_uv=String(Math.random())+String(Math.random()); rm6_s_co("rm6_stat_bck", rm6_uv, 1); } rm6_usn=rm6_g_co("username"); rm6_ss=rm6_g_co("rm6_stat_sck"); if (rm6_ss=="") { rm6_ss=rm6_ip+"_"+rm6_grm6m()+"_"+String(Math.random())+String(Math.random()); rm6_s_co("rm6_stat_sck", rm6_ss, 0); } else { if (rm6_grm6m() - rm6_g_ctm(rm6_ss) > rm6_expr_tm) { rm6_ss=rm6_ip+"_"+rm6_grm6m()+"_"+String(Math.random())+String(Math.random()); } rm6_s_co("rm6_stat_sck", rm6_ss, 0); } rm6_usn=rm6_u_en(String(rm6_usn)); rm6_cva=String(Math.random())+String(Math.random()); rm6_len=rm6_ss.indexOf("_"); rm6_ip=rm6_ss.substring(0,rm6_len); rm6_ss=rm6_ss.substring(rm6_len+1); rm6_ref=document.referrer; rm6_ref=rm6_u_en(String(rm6_ref)); rm6_url=document.URL; rm6_url=rm6_u_en(String(rm6_url)); rm6_clr=rm6_g_sc(); rm6_clr=rm6_u_en(String(rm6_clr)); rm6_scr=rm6_g_sr(); rm6_scr=rm6_u_en(String(rm6_scr)); rm6_lng=rm6_g_lg(); rm6_lng=rm6_u_en(String(rm6_lng)); rm6_agt=rm6_g_ag(); rm6_agt=rm6_u_en(String(rm6_agt)); rm6_jav=rm6_g_je(); rm6_jav=rm6_u_en(String(rm6_jav)); rm6_flu=rm6_g_fl(); rm6_flu=rm6_u_en(String(rm6_flu)); rm6_sof=rm6_g_so(); rm6_sof=rm6_u_en(String(rm6_sof)); rm6_dest="http://"+rm6_ip+rm6_dest+"uv="+rm6_uv+"&nuv="+rm6_nuv+"&usn="+rm6_usn+"&ss="+rm6_ss+"&ref="+rm6_ref+"&url="+rm6_url+"&nac="+rm6_sof+"&agt="+rm6_agt+"&clr="+rm6_clr+"&scr="+rm6_scr+"&lng="+rm6_lng+"&jav="+rm6_jav+"&flu="+rm6_flu+"&cnu="+rm6_cva; document.open(); document.write("<script language=\"JavaScript\" type=\"text/javascript\" src=\""+rm6_dest+"\"></script>"); document.close(); } main();
'use strict'; angular.module('core').controller('HeaderController', ['$scope', 'Authentication', 'Menus', function($scope, Authentication, Menus) { $scope.authentication = Authentication; $scope.isCollapsed = false; $scope.menu = Menus.getMenu('topbar'); $scope.toggleCollapsibleMenu = function() { $scope.isCollapsed = !$scope.isCollapsed; }; // Collapsing the menu after navigation $scope.$on('$stateChangeSuccess', function() { $scope.isCollapsed = false; }); } ]);
'use strict'; var merge = require('lodash.merge'); var url = require('url'); // take a url and merge a query object into it module.exports = function(modelUrl, query){ // shortcut if (query == null) { return modelUrl; } var parsed = url.parse(modelUrl, true); delete parsed.search; parsed.query = merge(parsed.query, query); return url.format(parsed); };
#!/usr/bin/env node var sys = require('sys'); var Buffer = require('buffer').Buffer; var BufferList = require('bufferlist'); var Binary = require('bufferlist/binary'); var bufferList = new BufferList; var binary = Binary(bufferList) .getWord16be('xLen') .getBuffer('xs', 'xLen') .tap(function (vars) { vars.moo = 'xs:' + vars.xLen + ':' + vars.xs; }) .end() ; var buf = new Buffer(6); buf.write('\x00\x04meow', 'binary'); bufferList.push(buf); sys.puts(binary.vars.moo); // xs:4:meow
/** * @license * Copyright 2016 Palantir Technologies, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var ts = require("typescript"); var Lint = require("../index"); var Rule = (function (_super) { __extends(Rule, _super); function Rule() { return _super.apply(this, arguments) || this; } /* tslint:enable:object-literal-sort-keys */ Rule.failureStringFactory = function (identifier, locationToMerge) { return "Mergeable namespace " + identifier + " found. Merge its contents with the namespace on line " + locationToMerge.line + "."; }; Rule.prototype.apply = function (sourceFile, languageService) { var noMergeableNamespaceWalker = new NoMergeableNamespaceWalker(sourceFile, this.getOptions(), languageService); return this.applyWithWalker(noMergeableNamespaceWalker); }; return Rule; }(Lint.Rules.AbstractRule)); /* tslint:disable:object-literal-sort-keys */ Rule.metadata = { ruleName: "no-mergeable-namespace", description: "Disallows mergeable namespaces in the same file.", optionsDescription: "Not configurable.", options: null, optionExamples: ["true"], type: "maintainability", typescriptOnly: true, }; exports.Rule = Rule; var NoMergeableNamespaceWalker = (function (_super) { __extends(NoMergeableNamespaceWalker, _super); function NoMergeableNamespaceWalker(sourceFile, options, languageService) { var _this = _super.call(this, sourceFile, options) || this; _this.languageService = languageService; return _this; } NoMergeableNamespaceWalker.prototype.visitModuleDeclaration = function (node) { if (Lint.isNodeFlagSet(node, ts.NodeFlags.Namespace) && node.name.kind === ts.SyntaxKind.Identifier) { this.validateReferencesForNamespace(node.name.text, node.name.getStart()); } _super.prototype.visitModuleDeclaration.call(this, node); }; NoMergeableNamespaceWalker.prototype.validateReferencesForNamespace = function (name, position) { var fileName = this.getSourceFile().fileName; var highlights = this.languageService.getDocumentHighlights(fileName, position, [fileName]); if (highlights == null || highlights[0].highlightSpans.length > 1) { var failureString = Rule.failureStringFactory(name, this.findLocationToMerge(position, highlights[0].highlightSpans)); this.addFailureAt(position, name.length, failureString); } }; NoMergeableNamespaceWalker.prototype.findLocationToMerge = function (currentPosition, highlightSpans) { var line = ts.getLineAndCharacterOfPosition(this.getSourceFile(), currentPosition).line; for (var _i = 0, highlightSpans_1 = highlightSpans; _i < highlightSpans_1.length; _i++) { var span = highlightSpans_1[_i]; var lineAndCharacter = ts.getLineAndCharacterOfPosition(this.getSourceFile(), span.textSpan.start); if (lineAndCharacter.line !== line) { return lineAndCharacter; } } }; return NoMergeableNamespaceWalker; }(Lint.RuleWalker));
/* eslint-env jest */ import fs from 'fs-extra' import { join } from 'path' import { launchApp, killApp, findPort, nextBuild, nextStart, renderViaHTTP, } from 'next-test-utils' let appDir = join(__dirname, '..') let buildId let appPort let app const runTests = () => { it('should rewrite and render page correctly', async () => { const html = await renderViaHTTP(appPort, '/docs/hello') expect(html).toMatch(/hello world/) }) it('should rewrite to /_next/static correctly', async () => { const bundlePath = await join( '/docs/_next/static/', buildId, '_buildManifest.js' ) const data = await renderViaHTTP(appPort, bundlePath) expect(data).toContain('/hello') }) it('should rewrite to public/static correctly', async () => { const data = await renderViaHTTP(appPort, '/docs/static/data.json') expect(data).toContain('some data...') }) it('should rewrite to public file correctly', async () => { const data = await renderViaHTTP(appPort, '/docs/another.txt') expect(data).toContain('some text') }) } describe('Custom routes', () => { describe('dev mode', () => { beforeAll(async () => { appPort = await findPort() app = await launchApp(appDir, appPort) buildId = 'development' }) afterAll(() => killApp(app)) runTests(true) }) describe('production mode', () => { beforeAll(async () => { await nextBuild(appDir) appPort = await findPort() app = await nextStart(appDir, appPort) buildId = await fs.readFile(join(appDir, '.next/BUILD_ID'), 'utf8') }) afterAll(() => killApp(app)) runTests() }) })
// Copyright (C) 2008 Google 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. /** * @param {string} json per RFC 4627 * @return {Object|Array} * @author Mike Samuel <mikesamuel@gmail.com> */ //var jsonParse = (function () { var fluoFromJson = (function () { var number = '(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)'; var oneChar = '(?:[^\\0-\\x08\\x0a-\\x1f\"\\\\]' + '|\\\\(?:[\"/\\\\bfnrt]|u[0-9A-Fa-f]{4}))'; var string = '(?:\"' + oneChar + '*\")'; // Will match a value in a well-formed JSON file. // If the input is not well-formed, may match strangely, but not in an unsafe // way. // Since this only matches value tokens, it does not match whitespace, colons, // or commas. var jsonToken = new RegExp( '(?:false|true|null|[\\{\\}\\[\\]]' + '|' + number + '|' + string + ')', 'g'); // Matches escape sequences in a string literal var escapeSequence = new RegExp('\\\\(?:([^u])|u(.{4}))', 'g'); // Decodes escape sequences in object literals var escapes = { '"': '"', '/': '/', '\\': '\\', 'b': '\b', 'f': '\f', 'n': '\n', 'r': '\r', 't': '\t' }; function unescapeOne(_, ch, hex) { return ch ? escapes[ch] : String.fromCharCode(parseInt(hex, 16)); } // A non-falsy value that coerces to the empty string when used as a key. var EMPTY_STRING = new String(''); var SLASH = '\\'; // Constructor to use based on an open token. var firstTokenCtors = { '{': Object, '[': Array }; return function (json) { // Split into tokens var toks = json.match(jsonToken); // Construct the object to return var result; var tok = toks[0]; if ('{' === tok) { result = {}; } else if ('[' === tok) { result = []; } else { throw new Error(tok); } // If undefined, the key in an object key/value record to use for the next // value parsed. var key; // Loop over remaining tokens maintaining a stack of uncompleted objects and // arrays. var stack = [result]; for (var i = 1, n = toks.length; i < n; ++i) { tok = toks[i]; var cont; switch (tok.charCodeAt(0)) { default: // sign or digit cont = stack[0]; cont[key || cont.length] = +(tok); key = void 0; break; case 0x22: // '"' tok = tok.substring(1, tok.length - 1); if (tok.indexOf(SLASH) !== -1) { tok = tok.replace(escapeSequence, unescapeOne); } cont = stack[0]; if (!key) { if (cont instanceof Array) { key = cont.length; } else { key = tok || EMPTY_STRING; // Use as key for next value seen. break; } } cont[key] = tok; key = void 0; break; case 0x5b: // '[' cont = stack[0]; stack.unshift(cont[key || cont.length] = []); key = void 0; break; case 0x5d: // ']' stack.shift(); break; case 0x66: // 'f' cont = stack[0]; cont[key || cont.length] = false; key = void 0; break; case 0x6e: // 'n' cont = stack[0]; cont[key || cont.length] = null; key = void 0; break; case 0x74: // 't' cont = stack[0]; cont[key || cont.length] = true; key = void 0; break; case 0x7b: // '{' cont = stack[0]; stack.unshift(cont[key || cont.length] = {}); key = void 0; break; case 0x7d: // '}' stack.shift(); break; } } // Fail if we've got an uncompleted object. if (stack.length) { throw new Error(); } return result; }; })(); // // the following code is ruote-fluo code, under the BSD license. // function fluoToJson (o, quotes) { if (quotes != false) quotes = true; if (o == null) return 'null'; var t = (typeof o); if (t == 'undefined') return 'null' // really ? if (t == 'number') return o; if (t == 'string') { //return quotes ? '"' + o + '"' : o; if ( ! quotes) return o; return '"' + o .replace(/"/g, '\\"') .replace(/\r/g, '') .replace(/\n/g, '\\n') + '"'; // this global replace works with safari (webkit) and ffox } if (o.constructor.toString().indexOf(' Array()') == 8) { var a = []; for (var i = 0; i < o.length; i++) a.push(fluoToJson(o[i])); return '[' + a.join(', ') + ']'; } if (t == 'object') { var a = []; for (var key in o) a.push(fluoToJson(key) + ': ' + fluoToJson(o[key])); return '{' + a.join(', ') + '}'; } return o.toString(); }
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin module.exports = { webpack(config) { config.plugins = config.plugins || [] config.plugins.push( new BundleAnalyzerPlugin({ analyzerMode: 'disabled', generateStatsFile: true, }) ) return config }, }
import png from "../_images/file.png"; import svg from "../_images/file.svg"; import jpg from "../_images/file.jpg"; it("should generate various asset types by a custom encoder", () => { expect(png).toMatch(/^data:image\/png;base64,[0-9a-zA-Z+/]+=*$/); expect(jpg).toMatch(/^[\da-f]{20}\.jpg$/); expect(svg).toMatch(/^[\da-f]{20}\.svg$/); });
define(function () { // [[Class]] -> type pairs return {}; });
const debug = require('ghost-ignition').debug('api:v3:utils:serializers:output:integrations'); const mapper = require('./utils/mapper'); module.exports = { browse({data, meta}, apiConfig, frame) { debug('browse'); frame.response = { integrations: data.map(model => mapper.mapIntegration(model, frame)), meta }; }, read(model, apiConfig, frame) { debug('read'); frame.response = { integrations: [mapper.mapIntegration(model, frame)] }; }, add(model, apiConfig, frame) { debug('add'); frame.response = { integrations: [mapper.mapIntegration(model, frame)] }; }, edit(model, apiConfig, frame) { debug('edit'); frame.response = { integrations: [mapper.mapIntegration(model, frame)] }; } };
version https://git-lfs.github.com/spec/v1 oid sha256:493b42fe5f35b2cd007e337285fa89e335cfb88038ff746daf843822df349115 size 3627
import auth from './auth' export default auth
export class Collection { activate(vm) { this.vm = vm; } /** * Generates a schema for each of the items in the collection. This is done * to add an index to the each of the schema elements of the collection. * * @param {number} index * @param {object[]} schema for a single item * * @returns {object[]} schema elements with an index property */ itemSchema(schema, index) { return schema.map(element => { let el = Object.create(element); el.index = index; return el; }); } }
Ext.define("Tonyprr.mvc.model.cart.ProductoCategoriaLanguage",{ extend : "Tonyprr.abstract.Model", fields : [ {name:"idProductocateLanguage",type:"integer"}, {name:"idcontcate",type:"integer"}, {name:"idLanguage",type:"integer"}, {name : 'descripcion'}, {name : 'detalle'}, {name : 'idioma'} ] });
/** * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or http://ckeditor.com/license */ /* jshint node: true, browser: false, es3: false */ 'use strict'; module.exports = function( grunt ) { var banner = [ '/**', ' * @license Copyright (c) 2003-' + new Date().getFullYear() + ', CKSource - Frederico Knabben. All rights reserved.', ' * For licensing, see LICENSE.md or http://ckeditor.com/license', ' */\n', ], lintFreeBlockTemplate = [ '// jshint ignore:start', '// jscs:disable', '<%= block %>', '// jscs:enable', '// jshint ignore:end' ].join( '\n' ), samplesFrameworkDir = 'node_modules/cksource-samples-framework', samplesFrameworkJsFiles = [ samplesFrameworkDir + '/js/sf.js', samplesFrameworkDir + '/components/**/*.js', samplesFrameworkDir + '/node_modules/picomodal/src/picoModal.js' ]; grunt.config.merge( { less: { samples: { files: [ { src: 'samples/less/samples.less', dest: 'samples/css/samples.css' } ], options: { ieCompat: true, paths: [ 'samples/' ], relativeUrls: true, banner: banner.join( '\n' ), sourceMap: true, sourceMapFileInline: true, sourceMapFilename: 'samples/css/samples.css.map', sourceMapURL: 'samples.css.map', sourceMapRootpath: '../../' } } }, watch: { 'samples-less': { files: [ '<%= less.samples.options.paths[ 0 ] + "/**/*.less" %>', samplesFrameworkDir + '/components/**/*.less' ], tasks: [ 'less:samples' ], options: { nospawn: true } }, 'samples-js': { files: samplesFrameworkJsFiles, tasks: [ 'concat:samples' ] } }, jsduck: { toolbarconfigurator: { src: [ 'samples/toolbarconfigurator/js' ], dest: 'samples/toolbarconfigurator/docs' } }, concat: { samples: { options: { stripBanners: true, banner: banner.join( '\n' ), // Don't run the linter on 3rd party libraries. You wouldn't be able to fix the errors anyway. process: function( src, path ) { console.log( path ); if ( path.match( /cksource-samples-framework\/node_modules/ig ) ) { src = grunt.template.process( lintFreeBlockTemplate, { data: { block: src } } ); } return src; } }, src: samplesFrameworkJsFiles, dest: 'samples/js/sf.js' } } } ); grunt.loadNpmTasks( 'grunt-contrib-concat' ); grunt.loadNpmTasks( 'grunt-contrib-less' ); grunt.loadNpmTasks( 'grunt-contrib-watch' ); grunt.loadNpmTasks( 'grunt-jsduck' ); };
$(window).load(function(){FusionCharts.ready(function () { var salesChart = new FusionCharts({ type: 'bulb', renderAt: 'chart-container', id: 'myChart', width: '300', height: '300', dataFormat: 'json', dataSource: { "chart": { "caption": "Temperature status of deep freezers", "upperlimit": "-5", "lowerlimit": "-60", "captionPadding":"30", "showshadow":"0", "showvalue": "1", "useColorNameAsValue":"1", "placeValuesInside":"1", "valueFontSize": "16", //Tool-text with HTML and $value macro "plottooltext": "<span id='headerdiv'>Current Temperature:</span>{br}<div id='valueDiv'>$value°C</div>", //Theme "theme" : "fint" }, "colorrange": { "color": [ { "minvalue": "-60", "maxvalue": "-35", "label": "Mission control, <br> we have a situation!", "code": "#ff0000" }, { "minvalue": "-35", "maxvalue": "-25", "label": "Something is just not right!", "code": "#ff9900" }, { "minvalue": "-25", "maxvalue": "-5", "label": "All well ahoy!", "code": "#00ff00" } ] }, "value": "-5" }, "events":{ "rendered": function(evtObj, argObj){ //Funcation to change value of the the bulb-gauge in real-timd setInterval(function () { var num = (Math.floor(Math.random() * 55)*-1) -5; FusionCharts("myChart").feedData("&value=" + num); }, 10000); } } }); salesChart.render(); }); });
/* Author : bieler batiste Company : doSimple : http://www.dosimple.ch send me a mail for more informations : faden@PASDEPOURRIELaltern.org - remove ( PASDEPOURRIEL ) Short javascript function to create and handle a CSS navigation menu Copyright (C) 2004 Bieler Batiste This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ // the timeout for the menu var timeout = 1000; // not very clean but simple // the function can be run in the HTML for faster display // window.onload=initMenu; // creat timeout variables for list item // it's for avoid some warning with IE for( var i = 0; i < 100; i++ ) { eval("var timeoutli" + i + " = false;"); } // this fonction apply the CSS style and the event function initMenu() { // a test to avoid some browser like IE4, Opera 6, and IE Mac if ( browser.isDOM1 && !( browser.isMac && browser.isIE ) && !( browser.isOpera && browser.versionMajor < 7 ) && !( browser.isIE && browser.versionMajor < 5 ) ) { // get some element var menu = document.getElementById('menu'); // the root element var lis = menu.getElementsByTagName('li'); // all the li // change the class name of the menu, // it's usefull for compatibility with old browser menu.className='menu'; // i am searching for ul element in li element for ( var i=0; i<lis.length; i++ ) { // is there a ul element ? if ( lis.item(i).getElementsByTagName('ul').length > 0 ) { // improve IE key navigation if ( browser.isIE ) { addAnEvent(lis.item(i),'keyup',show); } // link events to list item addAnEvent(lis.item(i),'mouseover',show); addAnEvent(lis.item(i),'mouseout',timeoutHide); addAnEvent(lis.item(i),'blur',timeoutHide); addAnEvent(lis.item(i),'focus',show); // add an id to list item lis.item(i).setAttribute( 'id', "li"+i ); } } } } function addAnEvent( target, eventName, functionName ) { // apply the method to IE if ( browser.isIE ) { //attachEvent dont work properly with this eval('target.on'+eventName+'=functionName'); } // apply the method to DOM compliant browsers else { target.addEventListener( eventName , functionName , true ); // true is important for Opera7 } } // hide the first ul element of the current element function timeoutHide() { // start the timeout eval( "timeout" + this.id + " = window.setTimeout('hideUlUnder( \"" + this.id + "\" )', " + timeout + " );"); } // hide the ul elements under the element identified by id function hideUlUnder( id ) { document.getElementById(id).getElementsByTagName('ul')[0].style['visibility'] = 'hidden'; } // show the first ul element found under this element function show() { // show the sub menu this.getElementsByTagName('ul')[0].style['visibility'] = 'visible'; var currentNode=this; while(currentNode) { if( currentNode.nodeName=='LI') { currentNode.getElementsByTagName('a')[0].className = 'linkOver'; } currentNode=currentNode.parentNode; } // clear the timeout eval ( "clearTimeout( timeout"+ this.id +");" ); hideAllOthersUls( this ); } // hide all ul on the same level of this list item function hideAllOthersUls( currentLi ) { var lis = currentLi.parentNode; for ( var i=0; i<lis.childNodes.length; i++ ) { if ( lis.childNodes[i].nodeName=='LI' && lis.childNodes[i].id != currentLi.id ) { hideUlUnderLi( lis.childNodes[i] ); } } } // hide all the ul wich are in the li element function hideUlUnderLi( li ) { var as = li.getElementsByTagName('a'); for ( var i=0; i<as.length; i++ ) { as.item(i).className=""; } var uls = li.getElementsByTagName('ul'); for ( var i=0; i<uls.length; i++ ) { uls.item(i).style['visibility'] = 'hidden'; } }
$(function() { function updateCharacterCount() { var abstractElement = $('#Abstract'); if (!abstractElement.length) return; var length = abstractElement.val().length; var remaining = 160 - length; var abstractCharacterCountMessage = $('#abstract-character-count'); abstractCharacterCountMessage.html($('<span>').html(remaining + ' characters remaining')); if (remaining < 0) { abstractCharacterCountMessage.addClass('field-validation-error'); } else { abstractCharacterCountMessage.removeClass('field-validation-error'); } } $(document).on('keyup', '#Abstract', updateCharacterCount); updateCharacterCount(); });
jQuery(document).ready(function(){ trackerUrl = "../wp-content/plugins/adrotate/adrotate-out.php"; jQuery(".adrotate_ad").click(function() { meta = jQuery(this).attr("id"); meta.match(/adrotate_(0-9)/i); buffer = meta.replace("adrotate_", "") buffer.split("",3); alert("You clicked the ad with:\nid " + buffer[0] + "\ngroup " + buffer[1] + "\nblock " + buffer[2] + "\nContacting " + trackerUrl); jQuery.post( trackerUrl, {ad: buffer[0], group: buffer[1], block: buffer[2]}, function(d){ alert(trackerUrl + "was successfully contacted and responded with the following data: " + d); }, "text" ); if(!confirm("Proceed to website?")) { return false; } }); });
/************************************************************************ * This file is part of EspoCRM. * * EspoCRM - Open Source CRM application. * Copyright (C) 2014-2017 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko * Website: http://www.espocrm.com * * EspoCRM is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * EspoCRM is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with EspoCRM. If not, see http://www.gnu.org/licenses/. * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU General Public License version 3. * * In accordance with Section 7(b) of the GNU General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ Espo.define('crm:views/meeting/record/list-expanded', ['views/record/list-expanded', 'crm:views/meeting/record/list'], function (Dep, List) { return Dep.extend({ actionSetHeld: function (data) { List.prototype.actionSetHeld.call(this, data); }, actionSetNotHeld: function (data) { List.prototype.actionSetNotHeld.call(this, data); }, }); });
var Modeler = require("../Modeler.js"); var className = 'ElementCreateNetworkAcl'; var ElementCreateNetworkAcl = function(json, parentObj) { parentObj = parentObj || this; // Class property definitions here: Modeler.extend(className, { CreateNetworkAcl: { type: "TypeCreateNetworkAclType", wsdlDefinition: { name: "CreateNetworkAcl", type: "tns:CreateNetworkAclType" }, mask: Modeler.GET | Modeler.SET, required: false } }, parentObj, json); }; module.exports = ElementCreateNetworkAcl; Modeler.register(ElementCreateNetworkAcl, "ElementCreateNetworkAcl");
/** * This file is part of OXID eShop Community Edition. * * OXID eShop Community Edition is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * OXID eShop Community Edition is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with OXID eShop Community Edition. If not, see <http://www.gnu.org/licenses/>. * * @link http://www.oxid-esales.com * @copyright (C) OXID eSales AG 2003-2014 * @version OXID eShop CE */ ( function( $ ) { oxCenterElementOnHover = { _create: function(){ var self = this; var el = self.element; el.hover(function(){ var targetObj = $(".viewAllHover", el); var targetObjWidth = targetObj.outerWidth() / 2; var parentObjWidth = el.width() / 2; targetObj.css("left", parentObjWidth - targetObjWidth + "px"); targetObj.show(); }, function(){ $(".viewAllHover", el).hide(); }); } } $.widget( "ui.oxCenterElementOnHover", oxCenterElementOnHover ); } )( jQuery );
/* * Copyright (C) 2016-2022 phantombot.github.io/PhantomBot * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ // Function that querys all of the data we need. $(function() { socket.getDBTableValues('get_all_hosts', 'hosthistory', function(results) { let hosts = []; for (let i = 0; i < results.length; i++) { let json = JSON.parse(results[i].value); hosts.push([ json.host, new Date(parseInt(json.time)).toLocaleString(), helpers.getDefaultIfNullOrUndefined(json.viewers, 'N/A'), parseInt(json.time) ]); } // Create table. $('#hostHistoryTable').DataTable({ 'searching': true, 'autoWidth': false, 'data': hosts, 'columnDefs': [ { 'width': '35%', 'targets': 0 } ], 'columns': [ { 'title': 'Username' }, { 'title': 'Date', 'orderData': [3] }, { 'title': 'Viewers' }, { 'visible': false } ] }); }); });
import { createAction } from 'redux-actions'; import createFetchHandler from 'Store/Actions/Creators/createFetchHandler'; import createSaveProviderHandler from 'Store/Actions/Creators/createSaveProviderHandler'; import createSetProviderFieldValueReducer from 'Store/Actions/Creators/Reducers/createSetProviderFieldValueReducer'; import createSetSettingValueReducer from 'Store/Actions/Creators/Reducers/createSetSettingValueReducer'; import { createThunk } from 'Store/thunks'; // // Variables const section = 'settings.metadata'; // // Actions Types export const FETCH_METADATA = 'settings/metadata/fetchMetadata'; export const SET_METADATA_VALUE = 'settings/metadata/setMetadataValue'; export const SET_METADATA_FIELD_VALUE = 'settings/metadata/setMetadataFieldValue'; export const SAVE_METADATA = 'settings/metadata/saveMetadata'; // // Action Creators export const fetchMetadata = createThunk(FETCH_METADATA); export const saveMetadata = createThunk(SAVE_METADATA); export const setMetadataValue = createAction(SET_METADATA_VALUE, (payload) => { return { section, ...payload }; }); export const setMetadataFieldValue = createAction(SET_METADATA_FIELD_VALUE, (payload) => { return { section, ...payload }; }); // // Details export default { // // State defaultState: { isFetching: false, isPopulated: false, error: null, isSaving: false, saveError: null, items: [], pendingChanges: {} }, // // Action Handlers actionHandlers: { [FETCH_METADATA]: createFetchHandler(section, '/metadata'), [SAVE_METADATA]: createSaveProviderHandler(section, '/metadata') }, // // Reducers reducers: { [SET_METADATA_VALUE]: createSetSettingValueReducer(section), [SET_METADATA_FIELD_VALUE]: createSetProviderFieldValueReducer(section) } };
// Debugger.Memory.prototype.takeCensus returns a value of an appropriate shape. var dbg = new Debugger; function checkProperties(census) { assertEq(typeof census, 'object'); for (prop of Object.getOwnPropertyNames(census)) { var desc = Object.getOwnPropertyDescriptor(census, prop); assertEq(desc.enumerable, true); assertEq(desc.configurable, true); assertEq(desc.writable, true); if (typeof desc.value === 'object') checkProperties(desc.value); else assertEq(typeof desc.value, 'number'); } } checkProperties(dbg.memory.takeCensus()); var g = newGlobal(); dbg.addDebuggee(g); checkProperties(dbg.memory.takeCensus());
import React from 'react'; import BaseChecklist from 'parser/shared/modules/features/Checklist/Module'; import CastEfficiency from 'parser/shared/modules/CastEfficiency'; import Combatants from 'parser/shared/modules/Combatants'; import PreparationRuleAnalyzer from 'parser/shared/modules/features/Checklist/PreparationRuleAnalyzer'; import AlwaysBeCasting from '../AlwaysBeCasting'; import AgonyUptime from '../DotUptimes/AgonyUptime'; import CorruptionUptime from '../DotUptimes/CorruptionUptime'; import UnstableAfflictionUptime from '../DotUptimes/UnstableAfflictionUptime'; import SiphonLifeUptime from '../../talents/SiphonLifeUptime'; import SoulShardDetails from '../../soulshards/SoulShardDetails'; import SoulShardTracker from '../../soulshards/SoulShardTracker'; import Component from './Component'; class Checklist extends BaseChecklist { static dependencies = { combatants: Combatants, castEfficiency: CastEfficiency, alwaysBeCasting: AlwaysBeCasting, preparationRuleAnalyzer: PreparationRuleAnalyzer, agonyUptime: AgonyUptime, corruptionUptime: CorruptionUptime, siphonLifeUptime: SiphonLifeUptime, unstableAfflictionUptime: UnstableAfflictionUptime, soulShardDetails: SoulShardDetails, soulShardTracker: SoulShardTracker, }; render() { return ( <Component castEfficiency={this.castEfficiency} combatant={this.combatants.selected} thresholds={{ ...this.preparationRuleAnalyzer.thresholds, agony: this.agonyUptime.suggestionThresholds, corruption: this.corruptionUptime.suggestionThresholds, unstableAffliction: this.unstableAfflictionUptime.suggestionThresholds, siphonLife: this.siphonLifeUptime.suggestionThresholds, soulShards: this.soulShardDetails.suggestionThresholds, downtime: this.alwaysBeCasting.suggestionThresholds, }} shardTracker={this.soulShardTracker} /> ); } } export default Checklist;
/* * CodePress regular expressions for SQL syntax highlighting * By Merlin Moncure */ // SQL Language.syntax = [ { input : /\'(.*?)(\')/g, output : '<s>\'$1$2</s>' }, // strings single quote { input : /\b(add|after|aggregate|alias|all|and|as|authorization|between|by|cascade|cache|cache|called|case|check|column|comment|constraint|createdb|createuser|cycle|database|default|deferrable|deferred|diagnostics|distinct|domain|each|else|elseif|elsif|encrypted|except|exception|for|foreign|from|from|full|function|get|group|having|if|immediate|immutable|in|increment|initially|increment|index|inherits|inner|input|intersect|into|invoker|is|join|key|language|left|like|limit|local|loop|match|maxvalue|minvalue|natural|nextval|no|nocreatedb|nocreateuser|not|null|of|offset|oids|on|only|operator|or|order|outer|owner|partial|password|perform|plpgsql|primary|record|references|replace|restrict|return|returns|right|row|rule|schema|security|sequence|session|sql|stable|statistics|table|temp|temporary|then|time|to|transaction|trigger|type|unencrypted|union|unique|user|using|valid|value|values|view|volatile|when|where|with|without|zone)\b/gi, output : '<b>$1</b>' }, // reserved words { input : /\b(bigint|bigserial|bit|boolean|box|bytea|char|character|cidr|circle|date|decimal|double|float4|float8|inet|int2|int4|int8|integer|interval|line|lseg|macaddr|money|numeric|oid|path|point|polygon|precision|real|refcursor|serial|serial4|serial8|smallint|text|timestamp|varbit|varchar)\b/gi, output : '<u>$1</u>' }, // types { input : /\b(abort|alter|analyze|begin|checkpoint|close|cluster|comment|commit|copy|create|deallocate|declare|delete|drop|end|execute|explain|fetch|grant|insert|listen|load|lock|move|notify|prepare|reindex|reset|restart|revoke|rollback|select|set|show|start|truncate|unlisten|update)\b/gi, output : '<a>$1</a>' }, // commands { input : /([^:]|^)\-\-(.*?)(<br|<\/P)/g, output: '$1<i>--$2</i>$3' } // comments // ] Language.snippets = [ { input : 'select', output : 'select $0 from where ' } ] Language.complete = [ { input : '\'', output : '\'$0\'' }, { input : '"', output : '"$0"' }, { input : '(', output : '\($0\)' }, { input : '[', output : '\[$0\]' }, { input : '{', output : '{\n\t$0\n}' } ] Language.shortcuts = []