text
stringlengths
2
6.14k
scaffolder: https://github.com/coryhouse/react-slingshot ^we wont use this though well use: https://github.com/coryhouse/pluralsight-redux-starter Our dev environment: 1. Automated Testign 2. Linting 3. Minification 4. Bundling 5. JSXCompilation 6. ES6 Transpilation Babel-Polyfill: few things babel cant do and babel-polyfill can do for es6->5 array.from, set, map, promise, generator functions etc. Downsides: Its too large 50K but we can pull out whatever particula polyfill we want babel-preset-react-hmre its a babel preset that wraps up a number of other libraries and settings in a single prest It works by wrapping your components in a custom proxy using Babel. Proxies are classes that act just like your classes but they provide hooks for injectin new implementiaton So when you hit save, your changes are immd8ly applied without requiring a reload WARNINGS: experimental and doesnt reload functional components and container functions like mapStateTOprops (I think this is embedded into react now) npm scripts replaced gulp! cool right! https://medium.freecodecamp.com/why-i-left-gulp-and-grunt-for-npm-scripts-3d6853dd22b8#.scjzloi78
const path = require('path'); const fs = require('fs'); const escapeRegExp = require("lodash/escapeRegExp"); require("@babel/register")({ extensions: [".es6", ".es", ".jsx", ".js", ".mjs", ".ts"], only: [ new RegExp("^" + escapeRegExp(path.resolve(__dirname, "../../static/js")) + path.sep), new RegExp("^" + escapeRegExp(path.resolve(__dirname, "../../static/shared/js")) + path.sep), ], plugins: ["rewire-ts"], }); global.assert = require('assert').strict; global._ = require('underscore/underscore.js'); const _ = global._; // Create a helper function to avoid sneaky delays in tests. function immediate(f) { return () => { return f(); }; } // Find the files we need to run. const finder = require('./finder.js'); const files = finder.find_files_to_run(); // may write to console if (files.length === 0) { throw "No tests found"; } // Set up our namespace helpers. const namespace = require('./namespace.js'); global.set_global = namespace.set_global; global.patch_builtin = namespace.set_global; global.zrequire = namespace.zrequire; global.stub_out_jquery = namespace.stub_out_jquery; global.with_overrides = namespace.with_overrides; global.window = new Proxy(global, { set: (obj, prop, value) => namespace.set_global(prop, value), }); global.to_$ = () => window; // Set up stub helpers. const stub = require('./stub.js'); global.make_stub = stub.make_stub; global.with_stub = stub.with_stub; // Set up fake jQuery global.make_zjquery = require('./zjquery.js').make_zjquery; // Set up fake blueslip const make_blueslip = require('./zblueslip.js').make_zblueslip; // Set up fake translation const stub_i18n = require('./i18n.js'); // Set up Handlebars const handlebars = require('./handlebars.js'); global.make_handlebars = handlebars.make_handlebars; global.stub_templates = handlebars.stub_templates; const noop = function () {}; // Set up fake module.hot const Module = require('module'); Module.prototype.hot = { accept: noop, }; // Set up fixtures. global.read_fixture_data = (fn) => { const full_fn = path.join(__dirname, '../../zerver/tests/fixtures/', fn); const data = JSON.parse(fs.readFileSync(full_fn, 'utf8', 'r')); return data; }; function short_tb(tb) { const lines = tb.split('\n'); const i = lines.findIndex(line => line.includes('run_test') || line.includes('run_one_module')); if (i === -1) { return tb; } return lines.splice(0, i + 1).join('\n') + '\n(...)\n'; } // Set up markdown comparison helper global.markdown_assert = require('./markdown_assert.js'); function run_one_module(file) { console.info('running tests for ' + file.name); require(file.full_name); } global.run_test = (label, f) => { if (files.length === 1) { console.info(' test: ' + label); } f(); // defensively reset blueslip after each test. blueslip.reset(); }; try { files.forEach(function (file) { set_global('location', { hash: '#', }); global.patch_builtin('setTimeout', noop); global.patch_builtin('setInterval', noop); _.throttle = immediate; _.debounce = immediate; set_global('blueslip', make_blueslip()); set_global('i18n', stub_i18n); namespace.clear_zulip_refs(); run_one_module(file); if (blueslip.reset) { blueslip.reset(); } namespace.restore(); }); } catch (e) { if (e.stack) { console.info(short_tb(e.stack)); } else { console.info(e); } process.exit(1); }
/** * $Id$ * * @author Moxiecode * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved. */ /* Import plugin specific language pack */ tinyMCE.importPluginLanguagePack('nonbreaking'); var TinyMCE_NonBreakingPlugin = { getInfo : function() { return { longname : 'Nonbreaking space', author : 'Moxiecode Systems AB', authorurl : 'http://tinymce.moxiecode.com', infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_nonbreaking.html', version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion }; }, getControlHTML : function(cn) { switch (cn) { case "nonbreaking": return tinyMCE.getButtonHTML(cn, 'lang_nonbreaking_desc', '{$pluginurl}/images/nonbreaking.gif', 'mceNonBreaking', false); } return ""; }, execCommand : function(editor_id, element, command, user_interface, value) { var inst = tinyMCE.getInstanceById(editor_id), h; switch (command) { case "mceNonBreaking": h = (inst.visualChars && inst.visualChars.state) ? '<span class="mceItemHiddenVisualChar">&middot;</span>' : '&nbsp;'; tinyMCE.execInstanceCommand(editor_id, 'mceInsertContent', false, h); return true; } return false; }, handleEvent : function(e) { var inst, h; if (!tinyMCE.isOpera && e.type == 'keydown' && e.keyCode == 9 && tinyMCE.getParam('nonbreaking_force_tab', false)) { inst = tinyMCE.selectedInstance; h = (inst.visualChars && inst.visualChars.state) ? '<span class="mceItemHiddenVisualChar">&middot;&middot;&middot;</span>' : '&nbsp;&nbsp;&nbsp;'; tinyMCE.execInstanceCommand(inst.editorId, 'mceInsertContent', false, h); tinyMCE.cancelEvent(e); return false; } return true; } }; tinyMCE.addPlugin("nonbreaking", TinyMCE_NonBreakingPlugin);
/* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ (function (win) { var cordova = require('cordova'), Acceleration = require('cordova-plugin-device-motion.Acceleration'), accelerometerCallback = null; module.exports = { start: function (successCallback, errorCallback) { if (accelerometerCallback) { win.removeEventListener("devicemotion", accelerometerCallback, true); } accelerometerCallback = function (motion) { successCallback({ x: motion.accelerationIncludingGravity.x, y: motion.accelerationIncludingGravity.y, z: motion.accelerationIncludingGravity.z, timestamp: new Date().getTime() }); }; win.addEventListener("devicemotion", accelerometerCallback, true); }, stop: function (successCallback, errorCallback) { win.removeEventListener("devicemotion", accelerometerCallback, true); accelerometerCallback = null; } }; require("cordova/tizen/commandProxy").add("Accelerometer", module.exports); }(window));
import React from 'react'; let lastClicked = 0; export default class Candidate extends React.Component { constructor(props) { super(props); this.state = { wiggle: false }; this.castVote = this.castVote.bind(this); this.wiggleDone = this.wiggleDone.bind(this); } componentDidMount() { const anim = this.refs[this.props.candidate]; anim.addEventListener('animationend', this.wiggleDone); } componentWillUnmount() { const anim = this.refs[this.props.candidate]; anim.removeEventListener('animationend', this.wiggleDone); } wiggleDone() { this.setState({ wiggle: false }); } castVote() { if (new Date() - lastClicked >= 3000) { lastClicked = Date.now(); this.props.castVote(this.props.index); this.setState({ wiggle: true }); // console.log('vote cast'); } else { // console.log('waiting for delay, vote not cast'); } } render() { const wiggle = this.state.wiggle; return ( <img key={this.props.candidate} ref={this.props.candidate} className={wiggle ? 'candidate wiggle' : 'candidate'} onClick={this.castVote} src={`Image${this.props.index}.png`} /> ); } } Candidate.propTypes = { index: React.PropTypes.number, candidate: React.PropTypes.string, votes: React.PropTypes.oneOfType([ React.PropTypes.number, React.PropTypes.string, ]), castVote: React.PropTypes.func, };
// Changes XML to JSON exports.xml2json = function(xml){ return xmlToJson(xml); }; function xmlToJson(xml) { // Create the return object var obj = {}; if (xml.nodeType == 1) { // element // do attributes if (xml.attributes.length > 0) { obj["@attributes"] = {}; for (var j = 0; j < xml.attributes.length; j++) { var attribute = xml.attributes.item(j); obj["@attributes"][attribute.nodeName] = attribute.nodeValue; } } } else if (xml.nodeType == 3) { // text obj = xml.nodeValue; } // do children if (xml.hasChildNodes()) { for(var i = 0; i < xml.childNodes.length; i++) { var item = xml.childNodes.item(i); var nodeName = item.nodeName; if (typeof(obj[nodeName]) == "undefined") { obj[nodeName] = xmlToJson(item); } else { if (typeof(obj[nodeName].push) == "undefined") { var old = obj[nodeName]; obj[nodeName] = []; obj[nodeName].push(old); } obj[nodeName].push(xmlToJson(item)); } } } return obj; };
/* ============================================================= * bootstrap-collapse.js v2.2.2 * http://twitter.github.com/bootstrap/javascript.html#collapse * ============================================================= * Copyright 2012 Twitter, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================ */ !function ($) { "use strict"; // jshint ;_; /* COLLAPSE PUBLIC CLASS DEFINITION * ================================ */ var Collapse = function (element, options) { this.$element = $(element) this.options = $.extend({}, $.fn.collapse.defaults, options) if (this.options.parent) { this.$parent = $(this.options.parent) } this.options.toggle && this.toggle() } Collapse.prototype = { constructor: Collapse , dimension: function () { var hasWidth = this.$element.hasClass('width') return hasWidth ? 'width' : 'height' } , show: function () { var dimension , scroll , actives , hasData if (this.transitioning) return dimension = this.dimension() scroll = $.camelCase(['scroll', dimension].join('-')) actives = this.$parent && this.$parent.find('> .accordion-group > .in') if (actives && actives.length) { hasData = actives.data('collapse') if (hasData && hasData.transitioning) return actives.collapse('hide') hasData || actives.data('collapse', null) } this.$element[dimension](0) this.transition('addClass', $.Event('show'), 'shown') $.support.transition && this.$element[dimension](this.$element[0][scroll]) } , hide: function () { var dimension if (this.transitioning) return dimension = this.dimension() this.reset(this.$element[dimension]()) this.transition('removeClass', $.Event('hide'), 'hidden') this.$element[dimension](0) } , reset: function (size) { var dimension = this.dimension() this.$element .removeClass('collapse') [dimension](size || 'auto') [0].offsetWidth this.$element[size !== null ? 'addClass' : 'removeClass']('collapse') return this } , transition: function (method, startEvent, completeEvent) { var that = this , complete = function () { if (startEvent.type == 'show') that.reset() that.transitioning = 0 that.$element.trigger(completeEvent) } this.$element.trigger(startEvent) if (startEvent.isDefaultPrevented()) return this.transitioning = 1 this.$element[method]('in') $.support.transition && this.$element.hasClass('collapse') ? this.$element.one($.support.transition.end, complete) : complete() } , toggle: function () { this[this.$element.hasClass('in') ? 'hide' : 'show']() } } /* COLLAPSE PLUGIN DEFINITION * ========================== */ var old = $.fn.collapse $.fn.collapse = function (option) { return this.each(function () { var $this = $(this) , data = $this.data('collapse') , options = typeof option == 'object' && option if (!data) $this.data('collapse', (data = new Collapse(this, options))) if (typeof option == 'string') data[option]() }) } $.fn.collapse.defaults = { toggle: true } $.fn.collapse.Constructor = Collapse /* COLLAPSE NO CONFLICT * ==================== */ $.fn.collapse.noConflict = function () { $.fn.collapse = old return this } /* COLLAPSE DATA-API * ================= */ $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) { var $this = $(this), href , target = $this.attr('data-target') || e.preventDefault() || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 , option = $(target).data('collapse') ? 'toggle' : $this.data() $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed') $(target).collapse(option) }) }(window.jQuery);
import { GET_COMMENTS, GET_COMMENT, SUBMIT_VOTE_COMMENT, DELETE_COMMENT, EDIT_COMMENT, ADD_COMMENT, } from '../actions'; import _ from 'lodash'; function commentsReducer(state = {}, action) { switch (action.type) { case GET_COMMENTS: let comments = _.mapKeys( _.orderBy(action.payload.data, 'voteScore', 'desc'), 'id', ); return { ...state, ...comments, }; case GET_COMMENT: return action.payload.data; case SUBMIT_VOTE_COMMENT: let {id, option} = action.payload; let newScore = option === 'upVote' ? state[id].voteScore + 1 : state[id].voteScore - 1; return { ...state, [id]: {...state[id], voteScore: newScore}, }; case DELETE_COMMENT: return _.omit(state, [action.payload]); case EDIT_COMMENT: return state; case ADD_COMMENT: return state; default: return state; } } export default commentsReducer;
/** * @license Copyright 2017 Google Inc. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* * @fileoverview This audit determines if the images used are sufficiently larger * than JPEG compressed images without metadata at quality 85. */ 'use strict'; const ByteEfficiencyAudit = require('./byte-efficiency-audit'); const URL = require('../../lib/url-shim'); const IGNORE_THRESHOLD_IN_BYTES = 4096; class UsesOptimizedImages extends ByteEfficiencyAudit { /** * @return {!AuditMeta} */ static get meta() { return { name: 'uses-optimized-images', description: 'Optimize images', informative: true, helpText: 'Optimized images load faster and consume less cellular data. ' + '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/optimize-images).', requiredArtifacts: ['OptimizedImages', 'devtoolsLogs'], }; } /** * @param {{originalSize: number, webpSize: number, jpegSize: number}} image * @param {string} type * @return {{bytes: number, percent: number}} */ static computeSavings(image, type) { const bytes = image.originalSize - image[type + 'Size']; const percent = 100 * bytes / image.originalSize; return {bytes, percent}; } /** * @param {!Artifacts} artifacts * @return {!Audit.HeadingsResult} */ static audit_(artifacts) { const images = artifacts.OptimizedImages; const failedImages = []; const results = []; images.forEach(image => { if (image.failed) { failedImages.push(image); return; } else if (/(jpeg|bmp)/.test(image.mimeType) === false || image.originalSize < image.jpegSize + IGNORE_THRESHOLD_IN_BYTES) { return; } const url = URL.elideDataURI(image.url); const jpegSavings = UsesOptimizedImages.computeSavings(image, 'jpeg'); results.push({ url, fromProtocol: image.fromProtocol, isCrossOrigin: !image.isSameOrigin, preview: {url: image.url, mimeType: image.mimeType, type: 'thumbnail'}, totalBytes: image.originalSize, wastedBytes: jpegSavings.bytes, }); }); let debugString; if (failedImages.length) { const urls = failedImages.map(image => URL.getURLDisplayName(image.url)); debugString = `Lighthouse was unable to decode some of your images: ${urls.join(', ')}`; } const headings = [ {key: 'preview', itemType: 'thumbnail', text: ''}, {key: 'url', itemType: 'url', text: 'URL'}, {key: 'totalKb', itemType: 'text', text: 'Original'}, {key: 'potentialSavings', itemType: 'text', text: 'Potential Savings'}, ]; return { debugString, results, headings, }; } } module.exports = UsesOptimizedImages;
function drawCanvas() { var canvas = document.getElementById('canvas-container'); var context = canvas.getContext("2d"); var grd = context.createLinearGradient(0,0,170,0); grd.addColorStop(0,"red"); grd.addColorStop(0.5,"blue"); grd.addColorStop(1,"green"); context.fillStyle = grd; context.lineWidth = 50; context.lineJoin="round"; context.beginPath(); context.arc(100,100,50,0,1.5*Math.PI); context.closePath(); context.stroke(); context.fill(); } $(function() { drawCanvas(); });
var dataCacheName = 'Jblog-v1'; var cacheName = 'Jblog-1'; var filesToCache = [ '/', '/index.html' ]; self.addEventListener('install', function(e) { console.log('[ServiceWorker] Install'); e.waitUntil( caches.open(cacheName).then(function(cache) { console.log('[ServiceWorker] Caching app shell'); return cache.addAll(filesToCache); }) ); }); self.addEventListener('activate', function(e) { console.log('[ServiceWorker] Activate'); e.waitUntil( caches.keys().then(function(keyList) { return Promise.all(keyList.map(function(key) { if (key !== cacheName && key !== dataCacheName) { console.log('[ServiceWorker] Removing old cache', key); return caches.delete(key); } })); }) ); return self.clients.claim(); }); self.addEventListener('fetch', function(e) { console.log('[Service Worker] Fetch', e.request.url); e.respondWith( caches.match(e.request).then(function(response) { return response || fetch(e.request); }) ); });
/** * Created with JetBrains WebStorm. * User: k-nkgwj * Date: 13/01/21 * Time: 3:29 * To change this template use File | Settings | File Templates. */ var OutputBox = (function () { function OutputBox(selector) { this.jqueryObject = $(selector); this.enabled = true; } OutputBox.prototype.message = function (subject, body) { if (!this.enabled) { return; } $(this.jqueryObject).prepend($('<p>').addClass('message').append( $('<span>').addClass('message-subject').html(subject) ).append( $('<span>').addClass('message-body').html(body) )); }; OutputBox.prototype.log = function (msg) { if (!this.enabled) { return; } $(this.jqueryObject).prepend($('<p>').addClass('system-log').html(Array.apply(null, arguments).join(''))); }; return OutputBox; })();
wesabe.provide("fi-scripts.com.citibank.mfa", { dispatch: function() { if (page.present(e.mfa.indicator)) { action.answerSecurityQuestions(); return false; } }, actions: { }, elements: { mfa: { indicator: [ '//*[has-class("jrspageHeader")][contains(string(.), "Authorization Required")]', '//form[@action="/US/JRS/mfa/cq/ValidateCQ.do"]', ], cin: [ // ATM/Debit Card # (CIN) '//input[@type="text"][@name="cin"]', ], pin: [ // PIN '//input[@type="password"][@name="pin"]', ], continueButton: [ '//input[@type="image"][contains(@src, "cont_btn")]', '//input[@type="submit" or @type="image"]', ], }, security: { questions: [ '//form[contains(@action, "mfa")]//*[has-class("jrsnoteText")]/b/text()', ], answers: [ '//form[contains(@action, "mfa")]//input[@type="text" or @type="password"]', ], continueButton: [ '//input[@type="image"][contains(@src, "cont_btn")]', '//input[@type="submit" or @type="image"]', ], }, }, });
const path = require("path"); const webpack = require("webpack"); const HtmlWebpackPlugin = require('html-webpack-plugin'); const MiniCssExtractPlugin = require("mini-css-extract-plugin"); const CopyWebpackPlugin = require('copy-webpack-plugin'); var babelOptions = { presets: [ ["@babel/preset-env", { "targets": { "browsers": ["last 2 versions"] }, "modules": false, "useBuiltIns": "usage", "corejs": 3, // This saves around 4KB in minified bundle (not gzipped) // "loose": true, }] ], }; var commonPlugins = [ new HtmlWebpackPlugin({ filename: './index.html', template: './src/index.html' }) ]; module.exports = (env, options) => { // If no mode has been defined, default to `development` if (options.mode === undefined) options.mode = "development"; var isProduction = options.mode === "production"; console.log("Bundling for " + (isProduction ? "production" : "development") + "..."); return { devtool: undefined, mode: options.mode, entry: { demo: [ "@babel/polyfill", './src/App.fs.js', './src/scss/main.scss' ] }, output: { path: path.join(__dirname, './output'), filename: isProduction ? '[name].[chunkhash].js' : '[name].js' }, plugins: isProduction ? commonPlugins.concat([ new MiniCssExtractPlugin({ filename: 'style.css' }), new CopyWebpackPlugin({ patterns: [ { from: './static' } ] }) ]) : commonPlugins.concat([ new webpack.HotModuleReplacementPlugin(), ]), devServer: { contentBase: './static/', publicPath: "/", port: 8080, hot: true, inline: true }, module: { rules: [ { test: /\.js$/, exclude: /node_modules/, use: { loader: 'babel-loader', options: babelOptions }, }, { test: /\.(sass|scss|css)$/, use: [ isProduction ? MiniCssExtractPlugin.loader : 'style-loader', 'css-loader', 'sass-loader', ], }, { test: /\.css$/, use: ['style-loader', 'css-loader'] }, { test: /\.(png|jpg|jpeg|gif|svg|woff|woff2|ttf|eot)(\?.*$|$)/, use: ["file-loader"] } ] } }; }
/** * @license Apache-2.0 * * Copyright (c) 2018 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ 'use strict'; // MODULES // var bench = require( '@stdlib/bench' ); var fromCodePoint = require( '@stdlib/string/from-code-point' ); var pkg = require( './../package.json' ).name; var toJSON = require( './../lib' ); // MAIN // bench( pkg, function benchmark( b ) { var err; var o; var i; err = new Error( 'beep' ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { err.message = 'be-'+fromCodePoint( (i%25)+97 )+' -ep'; o = toJSON( err ); if ( typeof o !== 'object' ) { b.fail( 'should return an object' ); } } b.toc(); if ( typeof o !== 'object' ) { b.fail( 'should return an object' ); } b.pass( 'benchmark finished' ); b.end(); });
'use strict'; /** * Requirements * @ignore */ const Filter = require('./Filter.js').Filter; const PathesConfiguration = require('../../model/configuration/PathesConfiguration.js').PathesConfiguration; const assertParameter = require('../../utils/assert.js').assertParameter; const pathes = require('../../utils/pathes.js'); const fs = require('fs'); const templateString = require('es6-template-strings'); /** * @memberOf nunjucks.filter */ class SvgViewBoxFilter extends Filter { /** * @inheritDocs */ constructor(pathesConfiguration, basePath) { super(); this._name = 'svgViewBox'; // Check params assertParameter(this, 'pathesConfiguration', pathesConfiguration, true, PathesConfiguration); // Assign options this._basePath = basePath || '/'; this._pathesConfiguration = pathesConfiguration; } /** * @inheritDocs */ static get className() { return 'nunjucks.filter/SvgViewBoxFilter'; } /** * @inheritDocs */ static get injections() { return { 'parameters': [PathesConfiguration, 'nunjucks.filter/SvgViewBoxFilter.basePath'] }; } /** * @type {String} */ get basePath() { return this._basePath; } /** * @returns {String} */ getBasePath(globals) { let result = this._basePath; if (this.environment && this.environment.buildConfiguration) { result = this.environment.buildConfiguration.get('filters.svgPath', this._basePath); } return templateString(result, globals.location || {}); } /** * @type {model.configuration.PathesConfiguration} */ get pathesConfiguration() { return this._pathesConfiguration; } /** * @inheritDocs */ filter(value) { const scope = this; return function(value) { let result = '0 0 0 0'; const globals = scope.getGlobals(this); const filename = pathes.concat(scope.pathesConfiguration.sites, scope.getBasePath(globals), value + '.svg'); if (fs.existsSync(filename)) { const icon = fs.readFileSync(filename, { encoding: 'utf8' }); const viewbox = icon.match(/viewBox="([^"]*)"/i); if (viewbox && viewbox[1]) { result = viewbox[1]; } } else { scope.logger.warn('Could not locate svg <' + filename + '>'); } return scope.applyCallbacks(result, arguments); }; } } /** * Exports * @ignore */ module.exports.SvgViewBoxFilter = SvgViewBoxFilter;
"use strict"; 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); }; var core_1 = require('@angular/core'); var router_1 = require('@angular/router'); var hero_service_1 = require('../../services/hero.service'); var HeroeList = (function () { function HeroeList(router, heroService) { this.router = router; this.heroService = heroService; this.title = "Tour of Heroes"; } HeroeList.prototype.ngOnInit = function () { this.getHeroes(); }; HeroeList.prototype.getHeroes = function () { var _this = this; this.heroService.getHeroes().then(function (heroes) { return _this.heroes = heroes; }); }; HeroeList.prototype.add = function (name) { var _this = this; name = name.trim(); if (!name) { return; } this.heroService.create(name) .then(function (hero) { _this.heroes.push(hero); _this.selectedHero = null; }); }; HeroeList.prototype.delete = function (hero) { var _this = this; this.heroService .delete(hero.id) .then(function () { _this.heroes = _this.heroes.filter(function (h) { return h !== hero; }); if (_this.selectedHero === hero) { _this.selectedHero = null; } }); }; HeroeList.prototype.onSelect = function (hero) { this.selectedHero = hero; }; HeroeList.prototype.gotoDetail = function () { this.router.navigate(['/detail', this.selectedHero.id]); }; HeroeList = __decorate([ core_1.Component({ moduleId: module.id, selector: 'heroe-list', providers: [hero_service_1.HeroService], templateUrl: 'heroe-list.html', styleUrls: ['heroe-list.css'] }), __metadata('design:paramtypes', [router_1.Router, hero_service_1.HeroService]) ], HeroeList); return HeroeList; }()); exports.HeroeList = HeroeList; //# sourceMappingURL=heroe-list.component.js.map
import React from "react"; import { Link } from "react-router"; import Loader from "../../core/Loader"; import DataComponent from "../base/DataComponent"; import DataError from "../base/DataError"; import ResourceAction from "./../base/ResourceAction"; import history from "../../history"; /** * @author Niklas Keller */ class NotificationDetail extends DataComponent { getDataUri() { return "notifications/" + this.props.params.id; } componentWillReceiveProps(next) { let oldId = this.props.params.id; let newId = next.params.id; if (oldId !== newId) { this.fetchData(); } } render() { let content = null; if (this.state.loaded) { if (this.state.failed) { content = ( <DataError /> ); } else { let emails = this.state.data.emails.map((item) => ( <li><code>{item}</code></li> )); emails = ( <ul> {emails} </ul> ); content = ( <div> <div className="actions"> <Link to={this.props.location.pathname + "/edit"} className="action"> <i className="fa fa-pencil icon"/> Edit </Link> <ResourceAction icon="trash" method="DELETE" uri={"notifications/" + this.props.params.id} onClick={() => window.confirm("Do you really want to delete this notification?")} onSuccess={() => history.replaceState(null, "/notifications")} onError={(e) => { let error = typeof e === "object" && "data" in e ? e.data.detail : "Unknown error."; window.alert("Deletion failed. " + error); }} backend={this.props.backend}> Delete </ResourceAction> </div> <h1>Notification: {this.state.data.name}</h1> <label className="input-label">Description</label> <pre>{this.state.data.description}</pre> <label className="input-label">SQL Query</label> <pre>{this.state.data.query}</pre> <label className="input-label">Check Period</label> <div>Checked every <code>{this.state.data.checkPeriod}</code> seconds.</div> <label className="input-label">E-Mails</label> <div>{emails}</div> <label className="input-label">Send Once</label> <div>{this.state.data.sendOnce.value ? "Yes, will be sent once and then be deleted." : "No, will be sent on every change."}</div> </div> ); } } return ( <Loader loaded={this.state.loaded} className="loader"> {content} </Loader> ); } } export default NotificationDetail;
'use strict'; const _ = require('lodash'); const config = require('../../../common/config'); const CONST = require('../../../common/constants'); const errors = require('../../../common/errors'); const logger = require('../../../common/logger'); const jwt = require('../jwt'); const utils = require('../../../common/utils'); const cf = require('../../../data-access-layer/cf'); const DirectorManager = require('./DirectorManager'); const cloudController = cf.cloudController; const Conflict = errors.Conflict; const DeploymentAlreadyLocked = errors.DeploymentAlreadyLocked; const DeploymentAttemptRejected = errors.DeploymentAttemptRejected; function AsyncServiceInstanceOperationInProgress(err) { const response = _.get(err, 'error', {}); return response.code === 60016 || response.error_code === 'CF-AsyncServiceInstanceOperationInProgress'; } function DeploymentLocked(err) { const response = _.get(err, 'error', {}); const description = _.get(response, 'description', ''); return description.indexOf(CONST.OPERATION_TYPE.LOCK) > 0 && response.error_code === 'CF-ServiceBrokerRequestRejected'; } function DeploymentStaggered(err) { const response = _.get(err, 'error', {}); const description = _.get(response, 'description', ''); return description.indexOf(CONST.FABRIK_OPERATION_STAGGERED) > 0 && description.indexOf(CONST.FABRIK_OPERATION_COUNT_EXCEEDED) > 0 && response.error_code === 'CF-ServiceBrokerRequestRejected'; } class ServiceFabrikOperation { constructor(name, opts) { this.name = name; this.guid = undefined; opts = opts || {}; this.bearer = opts.bearer; this.username = opts.username; this.useremail = opts.useremail; this.arguments = opts.arguments || {}; this.isOperationSync = opts.isOperationSync ? true : false; this.runImmediately = opts.runImmediately; if (opts.instance_id) { this.instanceId = opts.instance_id; } else if (opts.deployment) { this.instanceId = _.nth(DirectorManager.parseDeploymentName(opts.deployment), 2); } } toJSON() { return _.pick(this, 'name', 'guid', 'username', 'useremail', 'arguments'); } getResult() { return _.pick(this, 'name', 'guid'); } getToken() { return utils .uuidV4() .then(guid => _.set(this, 'guid', guid)) .then(() => jwt.sign(this.toJSON(), config.password)); } updateServiceInstance(token) { const options = { parameters: { 'service-fabrik-operation': token } }; if (this.runImmediately) { options.parameters._runImmediately = this.runImmediately; } options.isOperationSync = this.isOperationSync; if (this.bearer) { options.auth = { bearer: this.bearer }; } return cloudController.updateServiceInstance(this.instanceId, options); } invoke() { return this .getToken() .then(token => this.updateServiceInstance(token)) .then(() => this.getResult()) .catch(AsyncServiceInstanceOperationInProgress, err => { const message = _.get(err.error, 'description', 'Async service instance operation in progress'); throw new Conflict(message); }) .catch(DeploymentStaggered, err => { logger.info('Deployment operation not proceeding due to rate limit exceeded', err.message); throw new DeploymentAttemptRejected(this.deployment || this.instanceId); }) .catch(DeploymentLocked, err => { // Sample error description is // Service broker error: Service Instance abcdefgh-abcd-abcd-abcd-abcdefghijkl __Locked__ at Mon Sep 10 2018 11:17:01 GMT+0000 (UTC) for backup const description = _.get(err, 'error.description', ''); const lookupString = 'error: '; const startIdx = description.indexOf(lookupString); let lockMsg; if (startIdx !== -1) { lockMsg = description.substring(startIdx + lookupString.length); } logger.info(`Lock message : ${lockMsg}`); throw new DeploymentAlreadyLocked(this.instanceId, undefined, lockMsg); }); } handle(req, res) { if (_.isObject(req.user)) { this.username = req.user.name; this.useremail = req.user.email || ''; } return this .invoke() .then(body => res .status(202) .send(body) ); } } module.exports = ServiceFabrikOperation;
var searchData= [ ['undefined_5fband',['UNDEFINED_BAND',['../a01181.html#a9efc501b4bfd07c8e00e55bbb5f28690',1,'blkocc.h']]], ['uni_5fmax_5flegal_5futf32',['UNI_MAX_LEGAL_UTF32',['../a00614.html#a98a2f50a1ca513613316ffd384dd1bfb',1,'unichar.cpp']]], ['unichar_5flen',['UNICHAR_LEN',['../a00617.html#a902bc40c9d89802bc063afe30ce9e708',1,'unichar.h']]], ['unlikely_5fnum_5ffeat',['UNLIKELY_NUM_FEAT',['../a00659.html#a17b4f36c5132ab55beb280e0cc233228',1,'adaptmatch.cpp']]], ['unlv_5fext',['UNLV_EXT',['../a00221.html#aa14fc11aa7528cfededa3d19c18901f1',1,'blread.cpp']]], ['unusedclassidin',['UnusedClassIdIn',['../a00749.html#a3e7ae3ffbac606326937a4c701aeeaf2',1,'intproto.h']]], ['unz_5fbadzipfile',['UNZ_BADZIPFILE',['../a01565.html#a3fcc1d41cbea304ce10286ce99577625',1,'unzip.h']]], ['unz_5fbufsize',['UNZ_BUFSIZE',['../a01562.html#ac88907609a3408a8ee6544287b6c9880',1,'unzip.c']]], ['unz_5fcrcerror',['UNZ_CRCERROR',['../a01565.html#ae9155f504a5db40587b390f9e487c303',1,'unzip.h']]], ['unz_5fend_5fof_5flist_5fof_5ffile',['UNZ_END_OF_LIST_OF_FILE',['../a01565.html#ac55ed190d07021ce9bc1bf34b91dcae9',1,'unzip.h']]], ['unz_5feof',['UNZ_EOF',['../a01565.html#a0438887aea4e1c58e1b3955838a907f3',1,'unzip.h']]], ['unz_5ferrno',['UNZ_ERRNO',['../a01565.html#aae99fb3e34ea9f78ca8ba4a716f86e68',1,'unzip.h']]], ['unz_5finternalerror',['UNZ_INTERNALERROR',['../a01565.html#a813da146afcb179d57e948bf6871799b',1,'unzip.h']]], ['unz_5fmaxfilenameinzip',['UNZ_MAXFILENAMEINZIP',['../a01562.html#a97ef86322b25dcc3d0fc5eb50d386b54',1,'unzip.c']]], ['unz_5fok',['UNZ_OK',['../a01565.html#ada043545f95ccd4dae93fa44d95e39a8',1,'unzip.h']]], ['unz_5fparamerror',['UNZ_PARAMERROR',['../a01565.html#aca983831f4d25e504d544eb07f48e39b',1,'unzip.h']]], ['update_5fedge_5fwindow',['update_edge_window',['../a01703.html#a3a90c5459659abe9227ab93d20042630',1,'plotedges.h']]] ];
// Here will be compiled design document DESIGNS=false;
/** * author: Shawn * time : 2017/8/15 17:19 * desc : */ var testJar = require('./testJar'); for (let i = 0; i < 10; i++) { testJar.tt(); } // testJar.tt(); // testJar.tt(); // testJar.tt();
/** * Created by Rory on 12/14/2015. */ Template.MessagesPage.helpers({ getMessages: function () { if (Meteor.user()) { return Messages.find({owner:Meteor.user().username}); } }, getSender: function () { return {username:this.sender}; }, getTextbook: function () { return {_title:this.title}; }, isSellMessage: function () { if(this.offerType === "sell" && !this.acceptMessage) { return true; } else { return false; } }, isAcceptSellMessage: function () { if(this.offerType === "sell" && this.acceptMessage) { return true; } else { return false; } }, isBuyMessage: function () { if(this.offerType === "buy" && !this.acceptMessage) { return true; } else { return false; } }, isAcceptBuyMessage: function () { if(this.offerType === "buy" && this.acceptMessage) { return true; } else { return false; } } });
import React from 'react'; import { action } from '@storybook/addon-actions'; import MultiColumnList from '../MultiColumnList'; import Button from '../../Button'; import { asyncGenerate } from './service'; export default class ClickableRows extends React.Component { constructor() { super(); this.state = { data: [], }; this.requestMore(2, 0); } requestMore = async (amount, index) => { const newData = await asyncGenerate(amount, index, 1000); this.setState(curState => ({ data: [...curState.data, ...newData] })); } onRowClick = (e, i) => { // eslint-disable-line no-unused-vars const act = action(`clicked row ${i.index}!`); act({ row: i }); } onRowActionClick = (e, i) => { e.stopPropagation(); const act = action(`clicked button in row ${i}!`); act(); // console.log('clicked button!'); } formatter = { actions: ({ index }) => (<Button onClick={(e) => this.onRowActionClick(e, index)}>{`Row ${index} action`}</Button>), } render() { const columnWidths = { 'title': '100px' }; return ( <div style={{ width: '800px', height:'400px' }}> <p>Check out the actions tab below to see logged row clicks and row action clicks.</p> <MultiColumnList contentData={this.state.data} columnWidths={columnWidths} visibleColumns={['index', 'title', 'date', 'email', 'actions']} onRowClick={this.onRowClick} formatter={this.formatter} height={400} virtualize onNeedMoreData={this.requestMore} /> </div> ); } }
'use strict'; module.exports = require('../lib/server');
var structofp12__experimenter__stats__header = [ [ "exp_type", "structofp12__experimenter__stats__header.html#a460441be714bfea09fad329cbf887740", null ], [ "experimenter", "structofp12__experimenter__stats__header.html#a26a1cc494706c82c3d8a1a79faf82463", null ] ];
function validateUser(req){ return (req.session.hasOwnProperty('user')&&req.session.user.length!=0); } module.exports = { index:function(req,res,next){ if(validateUser(req)){ next() }else{ res.render('login',{params:req.params,session:req.session}); } } };
'use strict'; /** * This file exports the main roles AnalyticsBackend uses which are: * 'developer', 'teacher' and 'student'. * * Also indicates the anonymous routes used by the gleaner-tracker module to * send data to the collector server. */ exports.app = { roles: [ { roles: 'student', allows: [ { resources: [ '/games/public', '/games/:gameId/versions', '/games/:gameId/versions/:versionId', '/games/:gameId/versions/:versionId/sessions/my', '/sessions/:sessionId/results' ], permissions: [ 'get' ] }, { resources: [ '/sessions/:sessionId' ], permissions: [ 'put', 'get' ] } ] }, { roles: 'teacher', allows: [ { resources: [ '/games/public', '/games/:gameId/versions', '/games/:gameId/versions/:versionId', '/games/:gameId/versions/:versionId/sessions/my', '/sessions/:sessionId/results' ], permissions: [ 'get' ] }, { resources: [ '/sessions/:sessionId', '/sessions/:sessionId/remove', '/sessions/:sessionId/results/:resultsId' ], permissions: [ '*' ] }, { resources: [ '/games/:gameId/versions/:versionId/sessions', '/sessions/:sessionId/event/:event' ], permissions: [ 'post' ] } ] }, { roles: 'developer', allows: [ { resources: [ '/games/my', '/games/:gameId', '/games/:gameId/versions', '/games/:gameId/versions/:versionId' ], permissions: [ '*' ] }, { resources: [ '/games/:gameId/versions/:versionId/sessions', '/sessions/:sessionId' ], permissions: [ 'get' ] }, { resources: [ '/games' ], permissions: [ 'post' ] } ] } ], anonymous: [ '/collector/start/:trackingCode', '/collector/track' ], autoroles: [ 'student', 'teacher', 'developer' ] };
var a00980 = [ [ "kDoNotReverse", "a00980.html#a0db2198747060995d61a01dcfac97eb7", null ], [ "kForceReverse", "a00980.html#a597d22620e40ecc0ec38dfa4f65a9d85", null ], [ "kReverseIfHasRTL", "a00980.html#a402a13eb2d1593daed0190a118f23d88", null ], [ "RTLReversePolicyNames", "a00980.html#af5c5a40d574f6ab56726b8b2f963f65c", null ] ];
// ----------------------------------------------- imports var Declare = require('tui/base/Declare'); var IValidator = require('tui/validation/IValidator'); // ----------------------------------------------- class var Require = Declare({ extends : IValidator, validate : function(value, options){ if(_.isNull(value)) return false; return _.isString(value) ? string.trim(value) !== "" : false; } }) module.exports = Require;
/*global angular*/ (function () { angular .module('simplAdmin.vendors') .controller('VendorListCtrl', ['vendorService', 'translateService', VendorListCtrl]); function VendorListCtrl(vendorService, translateService) { var vm = this; vm.tableStateRef = {}; vm.vendors = []; vm.translate = translateService; vm.getVendors = function getVendors(tableState) { vm.tableStateRef = tableState; vm.isLoading = true; vendorService.getVendors(tableState).then(function (result) { vm.vendors = result.data.items; tableState.pagination.numberOfPages = result.data.numberOfPages; tableState.pagination.totalItemCount = result.data.totalRecord; vm.isLoading = false; }); }; vm.deleteVendor = function deleteVendor(vendor) { bootbox.confirm('Are you sure you want to delete this vendor: ' + simplUtil.escapeHtml(vendor.name), function (result) { if (result) { vendorService.deleteVendor(vendor) .then(function (result) { vm.getVendors(vm.tableStateRef); toastr.success(vendor.name + ' has been deleted'); }) .catch(function (response) { toastr.error(response.data.error); }); } }); }; } })();
angular.module('ReceitasApp', ['ngRoute', 'minhasDiretivas']) .config(function ($routeProvider) { $routeProvider.when('/', { templateUrl: 'home.html', }); $routeProvider.when('/adicionar', { templateUrl: 'adicionar.html', }); }) .run(['DbFactory', function (DbFactory) { DbFactory.loadDb(); }]);
/** * @license Apache-2.0 * * Copyright (c) 2018 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ 'use strict'; var valid = []; var test; test = { 'code': [ '/**', '* Merges objects into a target object. Note that the target object is mutated.', '*', '* @name merge', '* @type {Function}', '* @param {Object} target - target object', '* @param {...Object} source - source objects (i.e., objects to be merged into the target object)', '* @throws {Error} must provide a target object and one or more source objects', '* @throws {TypeError} first argument must be an object', '* @throws {TypeError} source arguments must be objects', '* @returns {Object} merged (target) object', '*', '* @example', '* var target = {', '* \'a\': \'beep\'', '* };', '* var source = {', '* \'a\': \'boop\',', '* \'b\': \'bap\'', '* };', '*', '* var out = merge( target, source );', '* // returns {\'a\':\'boop\', \'b\':\'bap\'}', '*/', 'var merge = mergefcn( defaults );' ].join( '\n' ) }; valid.push( test ); test = { 'code': [ '/**', '* Merges objects into a target object. Note that the target object is mutated.', '*', '* @name merge', '* @type {Function}', '* @param {Object} target - target object', '* @param {...Object} source - source objects (i.e., objects to be merged into the target object)', '* @throws {Error} must provide a target object and one or more source objects', '* @throws {TypeError} first argument must be an object', '* @throws {TypeError} source arguments must be objects', '* @returns {Object} merged (target) object', '*', '* @example', '* var target = {', '* \'a\': \'beep\'', '* };', '* var source = {', '* \'a\': \'boop\',', '* \'b\': \'bap\'', '* };', '*', '* var out = merge( target, source );', '* // returns {...}', '*/', 'var merge = mergefcn( defaults );' ].join( '\n' ) }; valid.push( test ); test = { 'code': [ '/**', '* Merges objects into a target object. Note that the target object is mutated.', '*', '* @name merge', '* @type {Function}', '* @param {Object} target - target object', '* @param {...Object} source - source objects (i.e., objects to be merged into the target object)', '* @throws {Error} must provide a target object and one or more source objects', '* @throws {TypeError} first argument must be an object', '* @throws {TypeError} source arguments must be objects', '* @returns {Object} merged (target) object', '*', '* @example', '* var target = {', '* \'a\': \'beep\'', '* };', '* var source = {', '* \'a\': \'boop\',', '* \'b\': \'bap\'', '* };', '*', '* var out = merge( target, source );', '* /* returns {', '* \'a\':\'boop\',', '* \'b\':\'bap\'}', '* *\\/', '*/', 'var merge = mergefcn( defaults );' ].join( '\n' ) }; valid.push( test ); test = { 'code': [ '/**', '* Returns a high-resolution time difference.', '*', '* ## Notes', '*', '* - Output format: `[seconds, nanoseconds]`.', '*', '*', '* @param {NonNegativeIntegerArray} time - high-resolution time', '* @throws {TypeError} must provide a nonnegative integer array', '* @throws {RangeError} input array must have length `2`', '* @returns {NumberArray} high resolution time difference', '*', '* @example', '* var tic = require( \'@stdlib/time/tic\' );', '*', '* var start = tic();', '* var delta = toc( start );', '* // returns [<number>,<number>]', '*/', 'function toc( time ) {', ' var now = tic();', ' var sec;', ' var ns;', ' if ( !isNonNegativeIntegerArray( time ) ) {', ' throw new TypeError( \'invalid argument. Must provide an array of nonnegative integers. Value: `\' + time + \'`.\' );', ' }', ' if ( time.length !== 2 ) {', ' throw new RangeError( \'invalid argument. Input array must have length `2`.\' );', ' }', ' sec = now[ 0 ] - time[ 0 ];', ' ns = now[ 1 ] - time[ 1 ];', ' if ( sec > 0 && ns < 0 ) {', ' sec -= 1;', ' ns += 1e9;', ' }', ' else if ( sec < 0 && ns > 0 ) {', ' sec += 1;', ' ns -= 1e9;', ' }', ' return [ sec, ns ];', '}' ].join( '\n' ) }; valid.push( test ); test = { 'code': [ '/**', '* Returns Anscombe\'s quartet.', '*', '* ## Notes', '*', '* - This function synchronously reads data from disk for each invocation. Such behavior is intentional and so is the avoidance of `require`. We assume that invocations are infrequent, and we want to avoid the `require` cache. This means that we allow data to be garbage collected and a user is responsible for explicitly caching data.', '*', '*', '* @throws {Error} unable to read data', '* @returns {ArrayArray} Anscombe\'s quartet', '*', '* @example', '* var d = data();', '* // returns [[[10,8.04],...],[[10,9.14],...],[[10,7.46],...],[[8,6.58],...]]', '*/', 'function data() {', ' var d = readJSON( fpath, opts );', ' if ( d instanceof Error ) {', ' throw d;', ' }', ' return d;', '}' ].join( '\n' ) }; valid.push( test ); // EXPORTS // module.exports = valid;
import React, { Component } from 'react'; import MePanel from '../components/panels/MePanel'; import { Segment } from 'semantic-ui-react' import DetailedActivity from './activities/DetailedActivity'; import ActivityGraph from './activities/ActivityGraph'; class ActivityOverview extends Component { constructor(props) { super(props); this.state = { selectedActivity: { activityId: "N/A", averageHeartRate: 0, date: null, description: "N/A", distance: 0, maxHeartRate: 0, pace: 0, time: 0, type: "N/A", location: null } }; } renderActivity(activityId) { let activity = this.props.activities.filter(activity => activity.activityId === activityId); this.setState({ selectedActivity: activity.length > 0 ? activity[0] : null }); } render() { return ( <Segment.Group horizontal> <Segment compact basic className="rt-statistics-segment"> <MePanel me={this.props.me} loading={this.props.loading} /> </Segment> <Segment padded loading={this.props.loading} basic> <ActivityGraph loading={this.props.loading} chartData={this.props.chartData} activities={this.props.activities} fromDate={this.props.fromDate} toDate={this.props.toDate} pointOnClickHandler={this.renderActivity.bind(this)} /> <DetailedActivity loading={this.props.loading} activity={this.state.selectedActivity} /> </Segment> </Segment.Group> ); } } export default ActivityOverview;
// 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // const {OAuth2Client} = require('google-auth-library'); const {grpc} = require('google-gax'); const http = require('http'); const url = require('url'); const open = require('open'); const destroyer = require('server-destroy'); // [START nodejs_channel_quickstart] // Reads the secrets from a `oauth2.keys.json` file, which should be downloaded // from the Google Developers Console and saved in the same directory with the // sample app. // This sample app only calls read-only methods from the Channel API. Include // additional scopes if calling methods that modify the configuration. const SCOPES = ['https://www.googleapis.com/auth/apps.order']; async function listCustomers(authClient, accountId) { // Imports the Google Cloud client library const {CloudChannelServiceClient} = require('@google-cloud/channel'); // Instantiates a client using OAuth2 credentials. const sslCreds = grpc.credentials.createSsl(); const credentials = grpc.credentials.combineChannelCredentials( sslCreds, grpc.credentials.createFromGoogleCredential(authClient) ); // Instantiates a client const client = new CloudChannelServiceClient({ sslCreds: credentials, }); // Calls listCustomers() method const customers = await client.listCustomers({ parent: `accounts/${accountId}`, }); console.info(customers); } /** * Create a new OAuth2Client, and go through the OAuth2 content * workflow. Return the full client to the callback. */ function getAuthenticatedClient(keys) { return new Promise((resolve, reject) => { // Create an oAuth client to authorize the API call. Secrets are kept in a // `keys.json` file, which should be downloaded from the Google Developers // Console. const oAuth2Client = new OAuth2Client( keys.web.client_id, keys.web.client_secret, // The first redirect URL from the `oauth2.keys.json` file will be used // to generate the OAuth2 callback URL. Update the line below or edit // the redirect URL in the Google Developers Console if needed. // This sample app expects the callback URL to be // 'http://localhost:3000/oauth2callback' keys.web.redirect_uris[0] ); // Generate the url that will be used for the consent dialog. const authorizeUrl = oAuth2Client.generateAuthUrl({ access_type: 'offline', scope: SCOPES.join(' '), }); // Open an http server to accept the oauth callback. In this example, the // only request to our webserver is to /oauth2callback?code=<code> const server = http .createServer(async (req, res) => { try { if (req.url.indexOf('/oauth2callback') > -1) { // Acquire the code from the querystring, and close the web // server. const qs = new url.URL(req.url, 'http://localhost:3000') .searchParams; const code = qs.get('code'); console.log(`Code is ${code}`); res.end('Authentication successful! Please return to the console.'); server.destroy(); // Now that we have the code, use that to acquire tokens. const r = await oAuth2Client.getToken(code); // Make sure to set the credentials on the OAuth2 client. oAuth2Client.setCredentials(r.tokens); console.info('Tokens acquired.'); resolve(oAuth2Client); } } catch (e) { reject(e); } }) .listen(3000, () => { // Open the browser to the authorize url to start the workflow. // This line will not work if you are running the code in the // environment where a browser is not available. In this case, // copy the URL and open it manually in a browser. console.info(`Opening the browser with URL: ${authorizeUrl}`); open(authorizeUrl, {wait: false}).then(cp => cp.unref()); }); destroyer(server); }); } async function main(accountId, keys) { // TODO: uncomment with your account id // const accountId = 'C012345' // TODO: uncomment this line with your oAuth2 file //const keys = require('./oauth2.keys.json'); getAuthenticatedClient(keys).then(authClient => listCustomers(authClient, accountId) ); } // [END nodejs_channel_quickstart] main(...process.argv.slice(2)).catch(err => { console.error(err.message); process.exitCode = 1; }); process.on('unhandledRejection', err => { console.error(err.message); process.exitCode = 1; });
/* Copyright 2017 The BioBricks Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ var fs = require('fs') var methodNotAllowed = require('./method-not-allowed') var notFound = require('./not-found') var path = require('path') var BYTES_PER_LINE = require('../bytes-per-accession') module.exports = function (request, response, configuration) { if (request.method === 'GET') { var number = parseInt(request.params.number) var file = path.join(configuration.directory, 'accessions') // Get a file descriptor. fs.open(file, 'r', function (error, fd) { /* istanbul ignore if */ if (error) { request.log.error(error) response.statusCode = 500 response.end() } else { // Calculate the offset where the requested accession's line // begins, if we have it. var offset = BYTES_PER_LINE * (number - 1) // Stat the file and compare its size to the offset for the // accession number requested. fs.fstat(fd, function (error, stats) { /* istanbul ignore if */ if (error) { request.log.error(error) response.statusCode = 500 response.end() fs.close(fd) } else { // If the accessions file is too small to have the requested // accession number, respond 404. if (stats.size < (offset + BYTES_PER_LINE)) { notFound(request, response, configuration) // Otherwise, read the line for the accession from the file, // starting at the calculated offset. } else { var buffer = Buffer.alloc(BYTES_PER_LINE - 1) fs.read( fd, buffer, 0, buffer.byteLength, offset, function (error) { /* istanbul ignore if */ if (error) { request.log.error(error) response.statusCode = 500 response.end() } else { // Redirect the client to the publication path. var split = buffer .toString() .split(',') response.statusCode = 303 response.setHeader( 'Location', configuration.base + 'publications/' + split[1] ) response.end() } fs.close(fd, function () { // pass }) } ) } } }) } }) } else { methodNotAllowed(response) } }
'use strict'; /** * @ngdoc function * @name sbAdminApp.controller:MainCtrl * @description * # MainCtrl * Controller of the sbAdminApp */ angular.module('sbAdminApp') .controller('MainCtrl', function($scope,$position) { }) .controller('StoreCtrl',['$scope','$position','$state','XLSXReaderService',function ($scope,$position,$state,XLSXReaderService) { console.log($state.params.id); $scope.data = [{"UPC":"test"," Short Description":"test","Long description":"test","Store Price":111111,"Metric (ea or lb) ":12,"Department":"Vegetables","Sub-department ":"Fresh","Synonyms":"legumes"},{"UPC":"test2"," Short Description":"test2","Long description":"test2","Store Price":12222,"Metric (ea or lb) ":43,"Department":"Vegetables","Sub-department ":"Fresh","Synonyms":"legumes"}]; $scope.stores = [ {id:1, name:'Store 1'}, {id:2, name:'Store 2'}, {id:3, name:'Store 3'} ]; $scope.store = {}; $scope.saveStore = function (store) { console.log(store); store.id = $scope.stores.length + 1; $scope.store = store; $scope.stores.unshift(store); $scope.store = {}; } if($state.params.id){ $scope.store = _.find($scope.stores, function(chr) { return chr.id = $state.params.id; }) }; $scope.import = function (file) { $scope.isProcessing = true; $scope.sheets = []; $scope.excelFile = file; XLSXReaderService.readFile($scope.excelFile, true, false).then(function (xlsxData) { $scope.sheets = xlsxData.sheets; $scope.json_string = JSON.stringify($scope.sheets["Sheet1"], null, 2); $scope.json_string = $scope.parseExcelData($scope.json_string); $scope.data = $scope.json_string; console.log(JSON.stringify($scope.data)); }); } $scope.parseExcelData = function (json_string) { var excelData = JSON.parse(json_string); var headers = excelData.data[0]; var array = []; for (var i = 1; i < excelData.data.length; i++) { var item = excelData.data[i]; var element = {}; for (var j = 0; j < item.length; j++) { if(item[j]!=null){ var propertyName = headers[j]; element[propertyName] = item[j]; } } array.push(element); } var list = array; return list; } }]);
// Copyright 2016 The Oppia Authors. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS-IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. /** * @fileoverview Primary controller for the collection editor page. */ // TODO(bhenning): These constants should be provided by the backend. oppia.constant( 'COLLECTION_DATA_URL_TEMPLATE', '/collection_handler/data/<collection_id>'); oppia.constant( 'WRITABLE_COLLECTION_DATA_URL_TEMPLATE', '/collection_editor_handler/data/<collection_id>'); oppia.constant( 'COLLECTION_RIGHTS_URL_TEMPLATE', '/collection_editor_handler/rights/<collection_id>'); oppia.controller('CollectionEditor', ['$scope', 'WritableCollectionBackendApiService', 'CollectionRightsBackendApiService', 'CollectionObjectFactory', 'SkillListObjectFactory', 'CollectionUpdateService', 'UndoRedoService', 'alertsService', function( $scope, WritableCollectionBackendApiService, CollectionRightsBackendApiService, CollectionObjectFactory, SkillListObjectFactory, CollectionUpdateService, UndoRedoService, alertsService) { $scope.collection = null; $scope.collectionId = GLOBALS.collectionId; $scope.collectionSkillList = SkillListObjectFactory.create([]); $scope.isPublic = GLOBALS.isPublic; // Load the collection to be edited. WritableCollectionBackendApiService.fetchWritableCollection( $scope.collectionId).then( function(collectionBackendObject) { $scope.collection = CollectionObjectFactory.create( collectionBackendObject); $scope.collectionSkillList.setSkills(collectionBackendObject.skills); }, function(error) { alertsService.addWarning( error || 'There was an error loading the collection.'); }); $scope.getChangeListCount = function() { return UndoRedoService.getChangeCount(); }; // To be used after mutating the prerequisite and/or acquired skill lists. $scope.updateSkillList = function() { $scope.collectionSkillList.clearSkills(); $scope.collectionSkillList.addSkillsFromSkillList( $scope.collection.getSkillList()); $scope.collectionSkillList.sortSkills(); }; // An explicit save is needed to push all changes to the backend at once // because some likely working states of the collection will cause // validation errors when trying to incrementally save them. $scope.saveCollection = function(commitMessage) { // Don't attempt to save the collection if there are no changes pending. if (!UndoRedoService.hasChanges()) { return; } WritableCollectionBackendApiService.updateCollection( $scope.collection.getId(), $scope.collection.getVersion(), commitMessage, UndoRedoService.getCommittableChangeList()).then( function(collectionBackendObject) { $scope.collection = CollectionObjectFactory.create( collectionBackendObject); $scope.collectionSkillList.setSkills(collectionBackendObject.skills); UndoRedoService.clearChanges(); }, function(error) { alertsService.addWarning( error || 'There was an error updating the collection.'); }); }; $scope.publishCollection = function() { // TODO(bhenning): Publishing should not be doable when the exploration // may have errors/warnings. Publish should only show up if the collection // is private. This also needs a confirmation of destructive action since // it is not reversible. CollectionRightsBackendApiService.setCollectionPublic( $scope.collectionId, $scope.collection.getVersion()).then( function() { // TODO(bhenning): There should be a scope-level rights object used, // instead. The rights object should be loaded with the collection. $scope.isPublic = true; }, function() { alertsService.addWarning( 'There was an error when publishing the collection.'); }); }; }]);
//Create Tab Group var tabGroup = Titanium.UI.createTabGroup(); // Variables var Teas = ['#F5F5DC', '#FFE4B5', '#FFE4C4', '#D2B48C', '#C3b091', '#c3b091', '#926F5B', '#804000', '#654321', '#3D2B1F']; allRows = []; var theColours = Ti.UI.createTableView({}); for (var i=0; i<Teas.length; i++){ theRow = Ti.UI.createTableViewRow({backgroundColor:Teas[i], height:50, TeaColour:Teas[i]}); allRows.push(theRow); } theColours.setData(allRows); var options = Ti.UI.createView({layout: 'vertical'}); var showCamera = Ti.UI.createButton({title: 'Show Camera'}); // TeaSelection Function function getVerdict(colour){ var indicator = colour.charAt(1); var msg; switch(indicator){ case 'F': msg = 'Milky'; break; case 'D': msg = 'Nice'; break; case 'C': msg = 'Perfect'; break; case '9': msg = 'A bit strong'; break; case '8': msg = 'Builders tea'; break; case '6': msg = 'Send it back'; break; case '3': msg = 'No milk here'; break; } return msg; }; function showTeaVerdict(_args){ var teaVerdict = Ti.UI.createWindow({layout:'vertical'}); teaVerdict.backgroundColor = _args; teaVerdict.msg = getVerdict(_args); var judgement = Ti.UI.createLabel ({text:teaVerdict.msg, top:'50%'}); var close = Ti.UI.createButton ({title:'Choose Again', top:'25%'}); close.addEventListener('click', function(e){ teaVerdict.close(); teaVerdict = null; }); teaVerdict.add(judgement); teaVerdict.add(close); teaVerdict.open(); } //Camera Function function showPhoto(_args) { thePhoto.setImage(_args.media); } // Tab 1 var winTea = Titanium.UI.createWindow({ title:'Select Color', backgroundColor:'#fff' }); var tabTea = Titanium.UI.createTab({ title:'TeaSelection', window:winTea }); winTea.add(theColours); // Tab 2 var winCamera = Titanium.UI.createWindow({ title:'Camera', backgroundColor:'#fff' }); var tabCamera = Titanium.UI.createTab({ title:'Camera', window:winCamera }); winCamera.add(showCamera); // Add Listener theColours.addEventListener('click', function(e){showTeaVerdict(e.source.TeaColour);}); showCamera.addEventListener('click', function (e) { Ti.Media.showCamera({animated: true, autoHide: true, saveToPhotoGallery: true, showControls: true, mediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO], success: function(e) {showPhoto(e);} }); }); // Add Tabs tabGroup.addTab(tabTea); tabGroup.addTab(tabCamera); // Open tabGroup tabGroup.open();
/* * Copyright 2010-2011 Research In Motion Limited. * * 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. */ /** * <div><p> * The Attendee object is an instance object, where if a new instance is desired, it must be created using the new keyword. * </p></div> * @toc {PIM} Attendee * @BB50+ * @class The Attendee object is used to represent a person who is invited to a calendar appointment. * @featureID blackberry.pim.Attendee * @constructor Constructor for a new Attendee object. * @example * &lt;script type=&quot;text&sol;javascript&quot;&gt; * &sol;&sol; Create our Event * var newAppt = new blackberry.pim.Appointment(); * newAppt.location = &quot;Your office&quot;; * newAppt.summary = &quot;Talk about new project&quot;; * newAppt.freeBusy = 0; &sol;&sol; Free * * &sol;&sol; Create our hour time slot * var start = new Date(); * newAppt.start = start; * var end = start.setHours(start.getHours() + 1); * newAppt.end = end; * * &sol;&sol; Create Attendee * var attendees = []; * var onlyAttendee = new blackberry.pim.Attendee(); * onlyAttendee.address = &quot;john@foo.com&quot;; * onlyAttendee.type = blackberry.pim.Attendee.INVITED; * attendees.push(onlyAttendee); * * newAppt.attendees = attendees; * newAppt.save(); * &lt;&sol;script&gt; */ blackberry.pim.Attendee = function() { }; /** * Event organizer * @type Number * @constant * @BB50+ */ blackberry.pim.Attendee.ORGANIZER = 0; /** * Attendee as been invited. * @type Number * @constant * @BB50+ */ blackberry.pim.Attendee.INVITED = 1; /** * Attendee has accepted the invitation. * @type Number * @constant * @BB50+ */ blackberry.pim.Attendee.ACCEPTED = 2; /** * Attendee has declined the invitation. * @type Number * @constant * @BB50+ */ blackberry.pim.Attendee.DECLINED = 3; /** * Attendee has tentatively accepted the invitation. * @type Number * @constant * @BB50+ */ blackberry.pim.Attendee.TENTATIVE = 4; /** * Indicates the type of a particular attendee. Value can be one of the Attendee types. * @type Number * @BB50+ */ blackberry.pim.Attendee.prototype.type = { }; /** * Contains the email address of a particular attendee. * @type String * @BB50+ */ blackberry.pim.Attendee.prototype.address = { };
import {fromJS} from 'immutable'; import MAP_STYLE from '../assets/map-style-basic-v8.json'; // export multi object.. export const polyLayer = fromJS({ id: 'polyLayer', source: 'polyLayer', type: 'fill', interactive: true, paint: { 'fill-color': '#ffeb3b', 'fill-opacity': 0.8 } }); export const pointLayer = fromJS({ id: 'point', source: 'point', type: 'circle', paint: { 'circle-radius': 10, 'circle-color': '#ffeb3b' } }); export const rasterStyle = fromJS({ "version": 8, "name": "customRas", "sources": { "stamen": { // "tiles": ["https://stamen-tiles.a.ssl.fastly.net/toner/{z}/{x}/{y}.png"], "tiles": ["https://huangyixiu.co:3003/proxy/?proxyURI=http://map.geoq.cn/ArcGIS/rest/services/ChinaOnlineStreetPurplishBlue/MapServer/tile/{z}/{y}/{x}"], // "tiles": ["http://www.google.cn/maps/vt?lyrs=s@702&gl=cn&x={x}&y={y}&z={z}"], "type": "raster", 'tileSize': 256 } }, "layers": [ { 'id': 'custom-tms', 'type': 'raster', 'source': 'stamen', 'paint': {} }, ] }) export const defaultMapStyle = fromJS(MAP_STYLE);
describe('Controller: EditorCtrl', function () { var $rootScope, $scope, $controller; beforeEach( module( 'PMTViewer' ) ); beforeEach(inject(function (_$rootScope_, _$controller_) { $rootScope = _$rootScope_; $scope = $rootScope.$new(); $controller = _$controller_; $controller('EditorCtrl', { '$rootScope' : $rootScope, '$scope': $scope }); })); it('should have a defined title', function () { expect($scope.page.title).toBeDefined(); }); it('should have a defined sub-title', function () { expect($scope.page.subtitle).toBeDefined(); }); });
/* * /MathJax/extensions/TeX/noUndefined.js * * Copyright (c) 2010 Design Science, Inc. * * Part of the MathJax library. * See http://www.mathjax.org for details. * * Licensed under the Apache License, Version 2.0; * you may not use this file except in compliance with the License. * * http://www.apache.org/licenses/LICENSE-2.0 */ MathJax.Extension["TeX/noUndefined"]={version:"1.1",config:MathJax.Hub.CombineConfig("TeX.noUndefined",{attributes:{mathcolor:"red"}})};MathJax.Hub.Register.StartupHook("TeX Jax Ready",function(){var b=MathJax.Extension["TeX/noUndefined"].config;var a=MathJax.ElementJax.mml;MathJax.InputJax.TeX.Parse.Augment({csUndefined:function(c){this.Push(a.mtext(c).With(b.attributes))}});MathJax.Hub.Startup.signal.Post("TeX noUndefined Ready")});MathJax.Ajax.loadComplete("[MathJax]/extensions/TeX/noUndefined.js");
exports.setProperty =function(_args){ Ti.App.Properties.setString(_args.name, _args.value) }; exports.getProperty = function(_args){ return Ti.App.Properties.getString(_args.name) };
module.exports = function(config) { config.set({ files: [ // Each file acts as entry point for the webpack configuration { pattern: 'test/*.test.js', watched: false }, { pattern: 'test/**/*.test.js', watched: false } ], preprocessors: { // Add webpack as preprocessor 'test/*.test.js': ['webpack'], 'test/**/*.test.js': ['webpack'] }, webpack: { // Karma watches the test entry points // (you don't need to specify the entry option) // webpack watches dependencies }, webpackMiddleware: { stats: 'errors-only' }, // Which frameworks to use for testing frameworks: ['jasmine'], // Reporting strategy reporters: ['progress'], // Which browser to use for running tests browsers: ['Chrome'] }); };
var Pagination = Pagination || function(container, goto) { "use strict"; var $pg = $(container); var span = 5; $pg.on("click", "a", function() { event.preventDefault(); var page = $(this).prop("id"); goto(page); }); this.render = function(pageInfo) { var pageCount = pageInfo.pageCount; var page = pageInfo.page; var html = []; if (page > 1) { html.push("<a href='#' id='{0}'><span class='glyphicon glyphicon-chevron-left'></span></a>".build(page-1)); } var start = page - span < 1 ? 1 : page - span; var end = page + span > pageCount ? pageCount : page + span; for (var i = start; i <= end; i++) { if (i === page) { html.push("<b>{0}</b>".build(i)); } else { html.push("<a href='#' id='{0}'>{1}</a>".build(i, i)); } } if (page < pageCount) { html.push("<a href='#' id='{0}'><span class='glyphicon glyphicon-chevron-right'></span></a>".build(page+1)); } $pg.html(html.join("")); $pg.show(); }; this.hide = function() { $pg.hide(); }; };
// // 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 // // https://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. // // ** This file is automatically generated by gapic-generator-typescript. ** // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** 'use strict'; const path = require('path'); const {assert} = require('chai'); const cp = require('child_process'); const {describe, it} = require('mocha'); const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); const cwd = path.join(__dirname, '..'); const project = process.env.GCLOUD_PROJECT; describe('Quickstart', () => { it('should run quickstart', async () => { const output = execSync(`node ./quickstart.js ${project} us-west1-b`, { cwd, }); assert.match(output, /instance: projects/); }); });
/** * Created by BlueX on 6/11/16. */ angular .module('TK-WEB-PITCH') .factory('ConstantFactory', function(){ //var API_URL = 'http://127.0.0.1:8888/TK-API/'; var API_URL = 'http://api-test.tarangkhmer.com/'; // return $http.get('http://192.168.1.100:8888/TK-API/sportclubs.json', config); return { API_URL: API_URL } });
define( ({ addLayer: "レイヤーの追加", layerName: "レイヤー", layerRefresh: "更新", layerLabel: "ラベル", actions: "操作", popupOk: "OK", popupCancel: "キャンセル", mainPanelTextPlaceholder: "例: 高速道路の状態", invalidInterval: "数字のみがサポートされています。", uploadImage: "画像のアップロード", iconColumnText: "アイコン", refreshInterval: "1 \'分単位の時間として評価されました\'", refreshIntervalTitle: "分単位の時間として評価されました", mainPanelText: "メイン パネルのテキスト", mainPanelIcon: "メイン パネルの画像", refreshIntervalInstruction: "更新間隔", optionsText: "オプション", symbolOptionsText: "シンボルのオプション", iconOptionsText: "アイコンのオプション", sympolPopupTitle: "シンボルの設定", rdoLayer: "レイヤー シンボル", rdoCustom: "カスタム シンボル", chkCluster: "クラスタリングの有効化", defineClusterSymbol: "クラスター シンボル", defineThemeClusterSymbol: "テーマのクラスター シンボル", rdoEsri: "Esri シンボル", rdoLayerIcon: "シンボルをアイコンとして使用", rdoCustomIcon: "カスタム アイコンのアップロード", editCustomSymbol: "カスタム シンボルの編集", editCustomIcon: "カスタム アイコンの編集", missingRefreshValue: "更新間隔の値を入力してください。", panelIconOption: "パネルのヘッダーの表示", enableRefresh: "レイヤーの更新の有効化", disableRefresh: "レイヤーの更新はフィーチャ コレクションでのみサポートされています", layer_type_not_supported: "レイヤー タイプはサポートされていません: " }) );
/* Copyright (C) 2016 R&D Solutions Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ 'use strict'; var path = require('path'); var gulp = require('gulp'); var conf = require('./conf'); var $ = require('gulp-load-plugins')(); var wiredep = require('wiredep').stream; var _ = require('lodash'); var browserSync = require('browser-sync'); gulp.task('inject-reload', ['inject'], function () { browserSync.reload(); }); gulp.task('inject', ['scripts'], function () { var injectStyles = gulp.src([ path.join(conf.paths.src, '/app/**/*.css') ], {read: false}); var injectScripts = gulp.src([ path.join(conf.paths.src, '/app/**/*.main.js'), path.join(conf.paths.src, '/app/**/*.js'), path.join('!' + conf.paths.src, '/app/dataTables/*.js'), path.join('!' + conf.paths.src, '/app/**/bootstrap.js'), path.join('!' + conf.paths.src, '/app/**/quick-sidebar.js'), path.join('!' + conf.paths.src, '/app/**/app.js'), path.join('!' + conf.paths.src, '/app/**/layout.js'), path.join('!' + conf.paths.src, '/app/**/*.spec.js'), path.join('!' + conf.paths.src, '/app/**/*.mock.js'), path.join('!' + conf.paths.src, '/app/**/jstree.min.js'), path.join('!' + conf.paths.src, '/app/**/ngJsTree.min.js'), path.join('!' + conf.paths.src, '/app/**/ng-infinite-scroll.min.js'), path.join('!' + conf.paths.src, '/app/**/bootstrap-switch.js') ]) .pipe($.angularFilesort()).on('error', conf.errorHandler('AngularFilesort')); // var injectCustomScripts = gulp.src([ // path.join(conf.paths.src, '/app/js/app.js'), // path.join(conf.paths.src, '/app/js/layout.js'), // path.join(conf.paths.src, '/app/js/quick-sidebar.js') // ]).pipe($.angularFilesort()).on('error', conf.errorHandler('AngularFilesort')); var injectOptions = { ignorePath: [conf.paths.src, path.join(conf.paths.tmp, '/serve')], addRootSlash: false }; return gulp.src(path.join(conf.paths.src, '/*.html')) .pipe($.inject(injectStyles, injectOptions)) .pipe($.inject(injectScripts, injectOptions)) .pipe(wiredep(_.extend({}, conf.wiredep))) .pipe(gulp.dest(path.join(conf.paths.tmp, '/serve'))); });
define( ({ map: { error: "Karte kann nicht erstellt werden", mouseToolTip: "Klicken Sie auf die Karte, um den Service zu überprüfen" }, geocoder: { defaultText: "Geben Sie eine Adresse oder einen Point of Interest ein" }, error: { layerNotFound: "Layer ist nicht in der Webkarte enthalten", fieldNotFound: "Feld nicht gefunden", popupNotSet: "Pop-up ist für diesen Layer nicht aktiviert", noLayersSet: "In der Konfiguration wurden keine Layer definiert; das Suchfeld funktioniert nicht" }, page: { title: "Informationssuche", }, splashscreen: { buttonText: "OK", }, ui:{ basemapButton: "Grundkarte" }, popup: { urlMoreInfo: "Weitere Informationen" } }) );
/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: Apache-2.0 */ goog.provide('Main'); // Core // Either require 'Blockly.requires', or just the components you use: goog.require('Blockly'); goog.require('Blockly.geras.Renderer'); goog.require('Blockly.VerticalFlyout'); // Blocks goog.require('Blockly.libraryBlocks'); goog.require('Blockly.libraryBlocks.testBlocks'); Main.init = function() { Blockly.inject('blocklyDiv', { 'toolbox': document.getElementById('toolbox') }); }; window.addEventListener('load', Main.init);
/* * Sample Window */ function SampleWindow(navController){ /* * essentials */ var win = Titanium.UI.createWindow({ top: ULA_WIN_TOP, title: 'Sample Window', backgroundColor: 'red' }); var rootView = Titanium.UI.createView({ top: 10, bottom: 10, left: 10, right: 10, backgroundColor: 'blue', layout: 'vertical' }); /* * components */ var lblTitle = Titanium.UI.createLabel({ text: 'This is Sample window', color: 'black', font: ULA_FONT_A, top: 100 }); var btnClose =Titanium.UI.createButton({ title: 'Close', color: 'black', height: 60, width: 100, top: 20, }); btnClose.addEventListener('click',function(e){ _c('btnClosed clicked'); navController.back(1); }); /* * heirarchy */ rootView.add(lblTitle); win.add(rootView); win.rightNavButton = btnClose; return win; } module.exports = SampleWindow;
'use strict'; angular.module('footierepoApp').controller('FixtureDialogController', ['$scope', '$stateParams', '$uibModalInstance', 'entity', 'Fixture', function($scope, $stateParams, $uibModalInstance, entity, Fixture) { entity.kickOff = Date.parse(entity.kickOff); $scope.fixture = entity; $scope.load = function(id) { Fixture.get({id : id}, function(result) { result.kickOff = Date.parse(result.kickOff); $scope.fixture = result; }); }; $scope.$watch('fixture.kickOff', function(newval, oldval) { if (! (newval instanceof Date)) { $scope.fixture.kickOff = new Date(Date.parse(newval)); } }) var onSaveSuccess = function (result) { $scope.$emit('footierepoApp:fixtureUpdate', result); $uibModalInstance.close(result); $scope.isSaving = false; }; var onSaveError = function (result) { $scope.isSaving = false; }; $scope.save = function () { $scope.isSaving = true; $scope.fixture.kickOff = $scope.fixture.kickOff.getTime()/1000; if ($scope.fixture.id != null) { Fixture.update($scope.fixture, onSaveSuccess, onSaveError); } else { Fixture.save($scope.fixture, onSaveSuccess, onSaveError); } }; $scope.clear = function() { $uibModalInstance.dismiss('cancel'); }; $scope.datePickerForKickOff = {}; $scope.datePickerForKickOff.status = { opened: false }; $scope.datePickerForKickOffOpen = function($event) { $scope.datePickerForKickOff.status.opened = true; }; }]);
Template.addComment.events({ // press enter on input 'keyup #addcomment': function(event) { if (event.which === 13) { event.stopPropagation(); const comment = event.target.value; if (comment) { event.target.value = ''; const userName = Meteor.users.findOne().username; const pageId = Pages.findOne().slug; Meteor.call('addComment', comment, userName, pageId, function(err, res) { if (err) { alert(err); } }); } return false; } }, 'click #submitcomment': function() { const commentBox = document.querySelector('#addcomment'); if (commentBox.value) { const comment = commentBox.value; commentBox.value = ''; const userName = Meteor.users.findOne().username; const pageId = Pages.findOne().slug; Meteor.call('addComment', comment, userName, pageId, function(err, res) { if (err) { alert(err); } }); } return false; } });
(function (w) { var MIN_LENGTH = 4; if (w.self != w.top) { return; } function colorize(config) { if ((config.enabled && config.disallowed && config.disallowed.indexOf(w.location.hostname)!== -1) || (!config.enabled && (!config.allowed || config.allowed.indexOf(w.location.hostname)=== -1))) return; var freqRus = {}, freqEng = {}; var rus = config.charsets.indexOf("rus")!==-1; var eng = config.charsets.indexOf("eng")!==-1; var maxFreq = (config.status == 3 ? 1:2); var patternRus = /[^а-яё]/g var patternEng = /[^a-z]/g var patternBoth = /[^a-zа-яё]/g if (!rus && !eng) return; if (rus && !eng) patternCurrent = patternRus; else if (!rus && eng) patternCurrent = patternEng; else patternCurrent = patternBoth; function collect(text, frequences, pattern) { var words = text.split(/\s+/); for (var j = 0; j < words.length; j++) { var current = words[j].toLowerCase().replace(pattern,''); if (!current || current.length < MIN_LENGTH) continue; if (!frequences[current]) frequences[current] = 1; else frequences[current] += 1; } return frequences; } function remove(o, max) { var n = {}; for (var key in o) if (o[key] <= max) n[key] = o[key]; return n; } function removeUseless() { freqRus = remove(freqRus, maxFreq); freqEng = remove(freqEng, maxFreq); } function stat(element) { if (/(script|style)/i.test(element.tagName)) return; if (element.nodeType === Node.ELEMENT_NODE && element.childNodes.length > 0) for (var i = 0; i < element.childNodes.length; i++) stat(element.childNodes[i]); if (element.nodeType === Node.TEXT_NODE && (/\S/.test(element.nodeValue))) { if (rus) collect(element.nodeValue, freqRus, patternRus); if (eng) collect(element.nodeValue, freqEng, patternEng); } } function newNode(code) { // code here is total count of the word, only 1 and 2 are used for Russian alphabet and 1+10 and 2+10 for English var node = w.document.createElement(config.status == 3 ? 'strong' : 'span'); node.className = 'nlc47'; if (config.status == 2 && code !== 1 && code !== 11) node.style.color = '#999'; if (config.status == 2 || (config.status == 1 && (code === 1 || code === 11))) node.style.fontWeight = '700'; if (config.status == 1) node.style.color = code > 2 ? '#449' : '#494'; return node; } function markup(element, initial, pattern) { if (/(script|style)/i.test(element.tagName)) return; if (element.nodeType === Node.ELEMENT_NODE && element.childNodes.length > 0) { var freq = {}; for (var i = 0; i < element.childNodes.length; i++) { freq = markup(element.childNodes[i], freq, pattern); } if (freq && freq.length !== 0) { var efreq = []; var total = 0; for (var key in freq) { if (freqRus[key]) efreq.push([key, freqRus[key]]); if (freqEng[key]) efreq.push([key, freqEng[key] + 10]); } efreq.sort(function(a, b) {return a[0].length - b[0].length}); var max = element.childNodes.length*efreq.length*2; for (var i = 0; i < element.childNodes.length; i++) { if (total++ > max) break; if (element.childNodes[i].nodeType === Node.TEXT_NODE) { var minPos = -1, minJ = -1; for (var j in efreq) { key = efreq[j][0]; var pos = element.childNodes[i].nodeValue.toLowerCase().indexOf(key); if (pos >= 0 && (minJ === -1 || minPos>pos)) { minPos = pos; minJ = j; } } if (minPos !== -1) { key = efreq[minJ][0]; val = efreq[minJ][1]; var spannode = newNode(val); var middlebit = element.childNodes[i].splitText(minPos); var endbit = middlebit.splitText(key.length); var middleclone = middlebit.cloneNode(true); spannode.appendChild(middleclone); element.replaceChild(spannode, middlebit); } } } } } if (element.nodeType === Node.TEXT_NODE && (/\S/.test(element.nodeValue))) { return collect(element.nodeValue, initial, pattern); } return initial; } stat(w.document.getElementsByTagName('html')[0]); removeUseless(); markup(w.document.getElementsByTagName('html')[0], {}, patternCurrent); } function clean() { var affected = w.document.querySelectorAll(".nlc47"); if (!affected.length) return; for (var i=0;i<affected.length;i++) { affected[i].outerHTML = affected[i].innerHTML; } } function loadAndColorize() { chrome.storage.sync.get(['status', 'enabled', 'charsets', 'allowed', 'disallowed'], colorize); } chrome.runtime.onMessage.addListener(function(msg, sender, response) { if (msg.action && msg.action == "refresh") {clean(); loadAndColorize(); } if (msg.action && msg.action == "getHost") response({host:w.location.hostname}); }); loadAndColorize(); })(window);
// This file was procedurally generated from the following sources: // - src/dstr-assignment/array-elem-trlg-iter-list-nrml-close-skip.case // - src/dstr-assignment/default/for-of.template /*--- description: IteratorClose is not invoked when evaluation of AssignmentElementList exhausts the iterator (For..of statement) esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation es6id: 13.7.5.11 features: [Symbol.iterator, destructuring-binding] flags: [generated] info: | IterationStatement : for ( LeftHandSideExpression of AssignmentExpression ) Statement 1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« », AssignmentExpression, iterate). 2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement, keyResult, assignment, labelSet). 13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation [...] 4. If destructuring is true and if lhsKind is assignment, then a. Assert: lhs is a LeftHandSideExpression. b. Let assignmentPattern be the parse of the source text corresponding to lhs using AssignmentPattern as the goal symbol. [...] ArrayAssignmentPattern : [ AssignmentElementList , Elisionopt AssignmentRestElementopt ] [...] 3. Let iteratorRecord be Record {[[iterator]]: iterator, [[done]]: false}. 4. Let status be the result of performing IteratorDestructuringAssignmentEvaluation of AssignmentElementList using iteratorRecord as the argument. 5. If status is an abrupt completion, then a. If iteratorRecord.[[done]] is false, return IteratorClose(iterator, status). b. Return Completion(status). ---*/ var nextCount = 0; var returnCount = 0; var iterable = {}; var thrower = function() { throw new Test262Error(); }; var x; var iterator = { next: function() { nextCount += 1; return { done: true }; }, return: function() { returnCount += 1; } }; iterable[Symbol.iterator] = function() { return iterator; }; var counter = 0; for ([ x , ] of [iterable]) { assert.sameValue(nextCount, 1); assert.sameValue(returnCount, 0); counter += 1; } assert.sameValue(counter, 1);
Ext.form.BasicForm.override({ resetDirty: function() { this.items.each(function(field) { field.resetDirty(); }); }, setDefaultValues: function() { this.items.each(function(field) { field.setDefaultValue(); }, this); }, clearValues: function() { this.items.each(function(field) { if (field.rendered) field.clearValue(); }, this); }, //override stupid Ext behavior //better to ask the individual form fields //needed for: Checkbox, ComboBox, SwfUpload, Date... getValues: function() { var ret = {}; this.items.each(function(field) { if (field.getName && field.getName()) { ret[field.getName()] = field.getValue(); } }, this); return ret; } }); Ext.apply(Ext.form.VTypes, { //E-Mail Validierung darf ab Ext 2.2 keine Bindestriche mehr haben, jetzt schon wieder email: function(v) { return /^([a-zA-Z0-9_.+-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/.test(v); }, emailMask : /[a-z0-9_\.\-@+]/i, //include + urltel: function(v) { return /^(tel:\/\/[\d\s]+|(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?))+$/.test(v); }, urltelTest: trlKwf('This field should be a URL in the format "http://www.domain.com" or tel://0043 1234'), //Ersetzt alles außer a-z, 0-9 - durch _. So wie Kwf_Filter_Ascii //standard-ext implementierung überschrieben um den - zu erlauben alphanum: function(v) { return /^[a-zA-Z0-9_\-]+$/.test(v); }, alphanumText : trlKwf('This field should only contain letters, numbers, - and _'), alphanumMask : /[a-z0-9_\-]/i, num: function(v) { return /^[0-9]+$/.test(v); }, numText : trlKwf('This field should only contain numbers'), numMask : /[0-9]/, time: function(val, field) { return /^([0-9]{2}):([0-9]{2}):([0-9]{2})$/i.test(val); }, timeText: trlKwf('Not a valid time. Must be in the format "12:34:00".'), timeMask: /[\d:]/i });
/* Just Journal JavaScript Library author: Lucas Holt date created: June 10, 2007 */ function follow(friend) { 'use strict'; var request = jQuery.ajax({ url: "/api/friend/" + friend, type: "PUT", data: {} }); request.done(function () { window.alert('Now following ' + friend); }); request.fail(function (jqXHR, textStatus) { window.alert("Could not follow friend. Request failed: " + textStatus); }); } function unfollow(friend) { 'use strict'; var request = jQuery.ajax({ url: "/api/friend/" + friend, type: "DELETE", data: {} }); request.done(function () { window.alert('Unfollowing ' + friend); }); request.fail(function (jqXHR, textStatus) { window.alert("Could not unfollow friend. Request failed: " + textStatus); }); } function addFavorite(entryId) { 'use strict'; var request = jQuery.ajax({ url: "/api/favorite/" + entryId, type: "POST", data: {} }); request.done(function () { window.alert('Favorite saved.'); }); request.fail(function (jqXHR, textStatus) { window.alert("Favorite not saved. Request failed: " + textStatus); }); } function deleteFavorite(entryId) { 'use strict'; var request = jQuery.ajax({ url: "/api/favorite/" + entryId, type: "DELETE", data: {} }); request.done(function () { window.alert('Favorite removed.'); }); request.fail(function (jqXHR, textStatus) { window.alert("Favorite not removed. Request failed: " + textStatus); }); } function deleteEntry(entryId) { 'use strict'; if (confirmDelete()) { var request = jQuery.ajax({ url: "/api/entry/" + entryId, type: "DELETE", data: {} }); request.done(function() { window.alert('Removed Entry'); }); request.fail(function(jqXHR, textStatus) { window.alert("Request failed: " + textStatus); }); } } function deleteComment(commentId) { 'use strict'; if (confirmDelete()) { var request = jQuery.ajax({ url: "/api/comment/" + commentId, type: "DELETE", data: {} }); request.done(function() { window.alert('Removed Comment'); }); request.fail(function(jqXHR, textStatus) { window.alert("Request failed: " + textStatus); }); } } function confirmDelete() { 'use strict'; return window.confirm("Are you sure you want to delete this?"); } function showbox(boxId) { 'use strict'; var box = document.getElementById(boxId); var parentBox = document.getElementById(boxId + "parent"); box.style.top = getAbsY(parentBox) + "px"; box.style.left = getAbsX(parentBox) + "px"; box.style.visibility='visible'; } function hidebox(boxId) { 'use strict'; var box = document.getElementById(boxId); box.style.visibility='hidden'; } // get the true X offset of anything on NS4, IE4/5 & // NS6, even if it's in a table! function getAbsX(elt) { 'use strict'; return (elt.x) ? elt.x : getAbsPos(elt,"Left"); } // get the true Y offset of anything on NS4, IE4/5 & // NS6, even if it's in a table! function getAbsY(elt) { 'use strict'; return (elt.y) ? elt.y : getAbsPos(elt,"Top"); } function getAbsPos(elt,which) { 'use strict'; var iPos = 0; while (elt !== null) { iPos += elt["offset" + which]; elt = elt.offsetParent; } return iPos; }
"use strict"; module.exports = { tagName: "div", className: "", defaults: { content: "default content" }, render: function() { }, client: function(options) { var result = options.client_options.result; var session = result.data.session; var total = session.count; var cell_count; var cells = $("<div/>"); var index; var helpers = this.helpers; var color_picker = this.helpers['vendor/jquery.colors'].get_color; for (index = 0; index < total; index++) { cell_count = session[index] || 0; var opacity = Math.round(cell_count / parseFloat(session.active) * 100.0) / 100; var color = color_picker(result.sid); var div = $("<div />") .html("<div style='width: 10px; height: 20px' />") .css("background-color", color) .css("opacity", opacity || "0.001"); cells.append(div); } this.$el.find(".viz").append(cells); } };
var NN = NN || {}; NN.InstructionsState = NN.InstructionsState || {}; NN.InstructionsState.init = function(levelnum) { this.game.stage.backgroundColor = '#00f'; this.levelnum = levelnum; this.GAMEX = this.game.world.width; this.GAMEY = this.game.world.height; }; NN.InstructionsState.preload = function() { }; NN.InstructionsState.create = function() { var background = this.game.add.sprite(0,0,'instructions'); background.inputEnabled = true; background.x = 0; background.y = 0; background.height = this.GAMEY; background.width = this.GAMEX; // background.scaleX = (0.5); // background.scaleY = (0.2); // background.scaleX = (this.GAMEX / background.width); // background.scaleY = (this.GAMEY / background.height); var style = {font: 'bold 24pt Arial', fill: '#0f0'}; var words1 = this.game.add.text(this.GAMEX/2, this.GAMEY / 3, 'Text', style); var words2 = this.game.add.text(this.GAMEX/2, this.GAMEY / 2, 'Text', style); var words3 = this.game.add.text(this.GAMEX/2, this.GAMEY * 2 / 3, 'Text', style); words1.anchor.setTo(0.5); words2.anchor.setTo(0.5); words3.anchor.setTo(0.5); if ( this.levelnum == 1 ) { words1.text = 'Swipe to move'; words2.text = 'and tap to nab'; words3.text = 'all the answers'; } if ( this.levelnum == 2 ) { words1.text = 'The answers are'; words2.text = 'multiples of the'; words3.text = 'current level'; } if ( this.levelnum == 3 ) { words1.text = 'Enjoy your last'; words2.text = 'level without'; words3.text = 'enemies!'; } background.events.onInputDown.add(function() { this.startGameState(); }, this); }; NN.InstructionsState.startGameState = function(button) { this.state.start('GameState', true, false, this.levelnum, true); };
MessagesStore
/*jslint node: true*/ /*jslint expr: true*/ /*global describe, it*/ "use strict"; var irc = require('../..'); var Stream = require('stream').PassThrough; describe('mode.js', function () { describe('on MODE', function () { it('should parse usermode', function (done) { var stream = new Stream(), client = irc(stream, false); client.on('mode', function (err, event) { event.by.getNick().should.equal('foo'); event.adding.should.equal(true); event.mode.should.equal('x'); done(); }); stream.write(':foo!bar@baz.com MODE test +x\r\n'); }); it('should parse usermode aswell', function (done) { var stream = new Stream(), client = irc(stream, false); client.once('mode', function (err, event) { event.by.should.equal('foo'); event.adding.should.equal(true); event.mode.should.equal('Z'); client.once('mode', function (err, event) { event.by.should.equal('foo'); event.adding.should.equal(true); event.mode.should.equal('i'); done(); }); }); stream.write(':foo MODE foo :+Zi\r\n'); }); it('should parse channelmode', function (done) { var stream = new Stream(), client = irc(stream, false); client.once('mode', function (err, event) { event.channel.getName().should.equal('#foo'); event.by.getNick().should.equal('foo'); event.argument.should.equal('bar'); event.adding.should.equal(false); event.mode.should.equal('o'); client.once('mode', function (err, event) { event.channel.getName().should.equal('#foo'); event.by.getNick().should.equal('foo'); event.argument.should.equal('baz'); event.adding.should.equal(true); event.mode.should.equal('v'); client.once('mode', function (err, event) { event.channel.getName().should.equal('#foo'); event.by.getNick().should.equal('op'); event.argument.should.equal('badguy'); event.adding.should.equal(true); event.mode.should.equal('b'); done(); }); }); }); stream.write(':foo!bar@baz.com MODE #foo -o+v bar baz\r\n'); stream.write(':op!bar@baz.com MODE #foo +b badguy\r\n'); }); }); });
"use strict"; var antlr4 = require('antlr4/index'); var LambdaCalculusLexer = require("../antlr/generated/LambdaCalculusLexer"); var LambdaCalculusParser = require("../antlr/generated/LambdaCalculusParser"); var AstCreator = require("./ParseTreeListeningAstCreator").AstCreator; var Immutable = require('immutable'); module.exports.AntlrParser = function () { var self = {}; self.parse = function (input) { var chars = new antlr4.InputStream(input); var lexer = new LambdaCalculusLexer.LambdaCalculusLexer(chars); var tokens = new antlr4.CommonTokenStream(lexer); var parser = new LambdaCalculusParser.LambdaCalculusParser(tokens); parser.buildParseTrees = true; var tree = parser.expression(); var astCreator = new AstCreator(); var result = tree.accept(astCreator); // todo - implement error handling return Immutable.fromJS({ value: result, status: true }); }; return self; }();
// This file was procedurally generated from the following sources: // - src/dstr-binding/obj-ptrn-id-init-throws.case // - src/dstr-binding/error/for-of-let.template /*--- description: Error thrown when evaluating the initializer (for-of statement) esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation es6id: 13.7.5.11 features: [destructuring-binding] flags: [generated] info: | IterationStatement : for ( ForDeclaration of AssignmentExpression ) Statement [...] 3. Return ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult, lexicalBinding, labelSet). 13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation [...] 3. Let destructuring be IsDestructuring of lhs. [...] 5. Repeat [...] h. If destructuring is false, then [...] i. Else i. If lhsKind is assignment, then [...] ii. Else if lhsKind is varBinding, then [...] iii. Else, 1. Assert: lhsKind is lexicalBinding. 2. Assert: lhs is a ForDeclaration. 3. Let status be the result of performing BindingInitialization for lhs passing nextValue and iterationEnv as arguments. [...] 13.3.3.7 Runtime Semantics: KeyedBindingInitialization SingleNameBinding : BindingIdentifier Initializeropt [...] 6. If Initializer is present and v is undefined, then a. Let defaultValue be the result of evaluating Initializer. b. Let v be GetValue(defaultValue). c. ReturnIfAbrupt(v). ---*/ function thrower() { throw new Test262Error(); } assert.throws(Test262Error, function() { for (let { x = thrower() } of [{}]) { return; } });
define(["mobile-detect"], function(MobileDetect){ function Factory(){ var md = new MobileDetect(window.navigator.userAgent); return { isMobile : function(){ return md.mobile(); } }; } return [Factory]; });
module.exports = { plugins: [ require('autoprefixer'), require('postcss-nested') ] }
/** * Created with JetBrains WebStorm. * User: Dieter Beelaert * Date: 23/08/13 * Time: 11:42 * To change this template use File | Settings | File Templates. */ $(document).ready(function(){ localize(); }); function localize(){ $(".newEvent").html(localization.event); $(".weekname").html(localization.week); $(".monthname").html(localization.month); $(".yearname").html(localization.yearName); $(".exportCal").html(localization.exportCal); $(".exportmsg").html(localization.locExportMessage); $(".sunname").html(localization.sun); $(".monname").html(localization.mon); $(".tuename").html(localization.tue); $(".wedname").html(localization.wed); $(".thurname").html(localization.thur); $(".friname").html(localization.fri); $(".satname").html(localization.sat); $(".locShow").html(localization.locShow); $(".noschedule").html(localization.noschedule); $(".getMonthName").each(function(){var index = $(this).attr("mi"); $(this).html(localization.locFullMonthNames[index]);}) $(".locTitle").html(localization.locTitle); $(".locDesc").html(localization.locDesc); $(".locDate").html(localization.locDate); $(".locFrom").html(localization.locFrom); $(".locUntil").html(localization.locUntil); $(".locLocation").html(localization.locLocation); $(".locOccurrence").html(localization.locOccurrence); $(".locOnce").html(localization.locOnce); $(".locEveryDay").html(localization.locEveryDay); $(".locEveryWeek").html(localization.locEveryWeek); $(".locEveryMonth").html(localization.locEveryMonth); $(".locEveryYear").html(localization.locEveryYear); $(".locDelete").html(localization.locDelete); $(".locSave").html(localization.locSave); $(".locNoComments").html(localization.locNoComments); $(".locComment").html(localization.locComment); $(".locSend").html(localization.locSend); var i =0; $(".locMonth").each(function(){ $(this).html(localization.locFullMonthNames[i]); i++; }); var i =0; $(".dayName").each(function(){ $(this).html(localization.dayNames[i]); i++; }); var i=0; $(".yearCalHeader").each(function(){ $(this).html(localization.monthNames[i]); i++; }) }
var express = require('express'); var router = express.Router(); const env = require('env2')('./env.json'); var Tag = require('../mongo/tags') var IssueTag = require('../mongo/Issue') router.post('/removeTag', function (req, res, next) { var userID = req.body.userID; var repoID = req.body.repoID; var name = req.body.name; var tagID = req.body.tagID; Tag.remove({ userID: userID, repoID: repoID, tagID: tagID }, function (err, data) { res.send(data); }); }); router.post('/getTag', function (req, res, next) { var userID = req.body.userID; var repoID = req.body.repoID; Tag.find({ userID: userID, repoID: repoID }, function (err, docs) { res.send(docs); }); }); router.post('/addTag', function (req, res, next) { var userID = req.body.userID; var repoID = req.body.repoID; var tagID = req.body.tagID; var name = req.body.name; var color = req.body.color; var selected = req.body.selected; var tag = new Tag({ tagID: tagID, userID: userID, repoID: repoID, name: name, color: color, selected: selected }); tag.save(function (err, resp) { if (err) { console.log("Error:" + err); } else { res.send(resp); }; }); }); router.post('/updateIssueTag', function (req, res, next) { var userID = req.body.userID; var repoID = req.body.repoID; var number = req.body.number; var tagIDs = req.body.tagIDs; var query = { userID: userID, repoID: repoID, number: number }; IssueTag.update(query, { tagIDs: tagIDs }, { upsert: true }, function (err, docs) { res.send(docs); }); }); router.post('/updateIssueNote', function (req, res, next) { var userID = req.body.userID; var repoID = req.body.repoID; var number = req.body.number; var note = req.body.note; var query = { userID: userID, repoID: repoID, number: number }; IssueTag.update(query, { note: note }, { upsert: true }, function (err, docs) { res.send(docs); }); }); module.exports = router;
/*! * CanJS - 1.1.4 (2013-02-05) * http://canjs.us/ * Copyright (c) 2013 Bitovi * Licensed MIT */ define(['can/util/can', 'zepto', 'can/util/object/isplain', 'can/util/event', 'can/util/fragment', 'can/util/deferred', 'can/util/array/each'], function (can) { var $ = Zepto; // data.js // --------- // _jQuery-like data methods._ var data = {}, dataAttr = $.fn.data, uuid = $.uuid = +new Date(), exp = $.expando = 'Zepto' + uuid; function getData(node, name) { var id = node[exp], store = id && data[id]; return name === undefined ? store || setData(node) : (store && store[name]) || dataAttr.call($(node), name); } function setData(node, name, value) { var id = node[exp] || (node[exp] = ++uuid), store = data[id] || (data[id] = {}); if (name !== undefined) store[name] = value; return store; }; $.fn.data = function (name, value) { return value === undefined ? this.length == 0 ? undefined : getData(this[0], name) : this.each(function (idx) { setData(this, name, $.isFunction(value) ? value.call(this, idx, getData(this, name)) : value); }); }; $.cleanData = function (elems) { for (var i = 0, elem; (elem = elems[i]) !== undefined; i++) { can.trigger(elem, "destroyed", [], false) var id = elem[exp] delete data[id]; } } // zepto.js // --------- // _Zepto node list._ var oldEach = can.each; // Extend what you can out of Zepto. $.extend(can, Zepto); can.each = oldEach; var arrHas = function (obj, name) { return obj[0] && obj[0][name] || obj[name] } // Do what's similar for jQuery. can.trigger = function (obj, event, args, bubble) { if (obj.trigger) { obj.trigger(event, args) } else if (arrHas(obj, "dispatchEvent")) { if (bubble === false) { $([obj]).triggerHandler(event, args) } else { $([obj]).trigger(event, args) } } else { if (typeof event == "string") { event = { type: event } } event.target = event.target || obj; event.data = args; can.dispatch.call(obj, event) } } can.$ = Zepto; can.bind = function (ev, cb) { // If we can bind to it... if (this.bind) { this.bind(ev, cb) } else if (arrHas(this, "addEventListener")) { $([this]).bind(ev, cb) } else { can.addEvent.call(this, ev, cb) } return this; } can.unbind = function (ev, cb) { // If we can bind to it... if (this.unbind) { this.unbind(ev, cb) } else if (arrHas(this, "addEventListener")) { $([this]).unbind(ev, cb) } else { can.removeEvent.call(this, ev, cb) } return this; } can.delegate = function (selector, ev, cb) { if (this.delegate) { this.delegate(selector, ev, cb) } else { $([this]).delegate(selector, ev, cb) } } can.undelegate = function (selector, ev, cb) { if (this.undelegate) { this.undelegate(selector, ev, cb) } else { $([this]).undelegate(selector, ev, cb) } } $.each(["append", "filter", "addClass", "remove", "data"], function (i, name) { can[name] = function (wrapped) { return wrapped[name].apply(wrapped, can.makeArray(arguments).slice(1)) } }) can.makeArray = function (arr) { var ret = [] can.each(arr, function (a, i) { ret[i] = a }) return ret; }; can.proxy = function (f, ctx) { return function () { return f.apply(ctx, arguments) } } // Make ajax. var XHR = $.ajaxSettings.xhr; $.ajaxSettings.xhr = function () { var xhr = XHR() var open = xhr.open; xhr.open = function (type, url, async) { open.call(this, type, url, ASYNC === undefined ? true : ASYNC) } return xhr; } var ASYNC; var AJAX = $.ajax; var updateDeferred = function (xhr, d) { for (var prop in xhr) { if (typeof d[prop] == 'function') { d[prop] = function () { xhr[prop].apply(xhr, arguments) } } else { d[prop] = prop[xhr] } } } can.ajax = function (options) { var success = options.success, error = options.error; var d = can.Deferred(); options.success = function (data) { updateDeferred(xhr, d); d.resolve.call(d, data); success && success.apply(this, arguments); } options.error = function () { updateDeferred(xhr, d); d.reject.apply(d, arguments); error && error.apply(this, arguments); } if (options.async === false) { ASYNC = false } var xhr = AJAX(options); ASYNC = undefined; updateDeferred(xhr, d); return d; }; // Make destroyed and empty work. $.fn.empty = function () { return this.each(function () { $.cleanData(this.getElementsByTagName('*')) this.innerHTML = '' }) } $.fn.remove = function () { $.cleanData(this); this.each(function () { if (this.parentNode != null) { // might be a text node this.getElementsByTagName && $.cleanData(this.getElementsByTagName('*')) this.parentNode.removeChild(this); } }); return this; } can.trim = function (str) { return str.trim(); } can.isEmptyObject = function (object) { var name; for (name in object) {}; return name === undefined; } // Make extend handle `true` for deep. can.extend = function (first) { if (first === true) { var args = can.makeArray(arguments); args.shift(); return $.extend.apply($, args) } return $.extend.apply($, arguments) } can.get = function (wrapped, index) { return wrapped[index]; } return can; });
/*global Ext*/ /*jshint strict: false*/ Ext.define('Demo.view.portal.PortletsPanel', { extend: 'Ext.panel.Panel', alias: 'widget.portletspanel', uses: [ 'Demo.view.app.Portlet' ] });
'use strict'; // https://github.com/jambit/eslint-plugin-typed-redux-saga module.exports = { rules: { 'use-typed-effects': require('./rules/use-typed-effects'), 'delegate-effects': require('./rules/delegate-effects'), }, };
/*jslint browser: true, devel: true, node: true, ass: true, nomen: true, unparam: true, indent: 4 */ /** * @license * Copyright (c) 2015 The ExpandJS authors. All rights reserved. * This code may only be used under the BSD style license found at https://expandjs.github.io/LICENSE.txt * The complete set of authors may be found at https://expandjs.github.io/AUTHORS.txt * The complete set of contributors may be found at https://expandjs.github.io/CONTRIBUTORS.txt */ (function () { "use strict"; var assertArgument = require('../assert/assertArgument'), isVoid = require('../tester/isVoid'), isFinite = require('../tester/isFinite'), isIndex = require('../tester/isIndex'); /** * Rounds up a number to the nearest integet. If a second parameter is * specified the number can be rounded using digits after the decimal point. * * ```js * XP.round(1.2) * // => 1 * * XP.round(1.5) * // => 2 * * XP.fixed(1.49, 1) * // => 1.5 * * XP.round(1.492, 2) * // => 1.49 * * XP.round(1.499, 2) * // => 1.5 * ``` * * @function round * @param {number} number The reference number to format * @param {number} [precision = 0] The number of digits to be shown after the decimal point * @returns {number} Returns the number rounded up */ module.exports = function round(number, precision) { assertArgument(isFinite(number), 1, 'number'); assertArgument(isVoid(precision) || isIndex(precision), 2, 'number'); return Math.round(number * (precision = Math.pow(10, precision || 0))) / precision; }; }());
const certificationUrl = '/certification/developmentuser/responsive-web-design'; const projects = { superBlock: 'responsive-web-design', block: 'responsive-web-design-projects', challenges: [ { slug: 'build-a-tribute-page', solution: 'https://codepen.io/moT01/pen/ZpJpKp' }, { slug: 'build-a-survey-form', solution: 'https://codepen.io/moT01/pen/LrrjGz?editors=1010' }, { slug: 'build-a-product-landing-page', solution: 'https://codepen.io/moT01/full/qKyKYL/' }, { slug: 'build-a-technical-documentation-page', solution: 'https://codepen.io/moT01/full/JBvzNL/' }, { slug: 'build-a-personal-portfolio-webpage', solution: 'https://codepen.io/moT01/pen/vgOaoJ' } ] }; describe('A certification,', function () { before(() => { cy.exec('npm run seed'); cy.login(); // submit projects for certificate const { superBlock, block, challenges } = projects; challenges.forEach(({ slug, solution }) => { const url = `/learn/${superBlock}/${block}/${slug}`; cy.visit(url); cy.get('#dynamic-front-end-form') .get('#solution') .type(solution, { force: true, delay: 0 }); cy.contains("I've completed this challenge") .should('not.be.disabled') .click(); cy.contains('Submit and go to next challenge').click().wait(1000); }); cy.get('.donation-modal').should('be.visible'); cy.visit('/settings'); // set user settings to public to claim a cert cy.get('label:contains(Public)>input').each(el => { if (!/toggle-active/.test(el[0].parentElement.className)) { cy.wrap(el).click({ force: true }); cy.wait(1000); } }); // if honest policy not accepted cy.get('.honesty-policy button').then(btn => { if (btn[0].innerText === 'Agree') { btn[0].click({ force: true }); cy.wait(1000); } }); // claim certificate cy.get('a[href*="developmentuser/responsive-web-design"]').click({ force: true }); }); describe('while viewing your own,', function () { before(() => { cy.login(); cy.visit(certificationUrl); }); it('should render a LinkedIn button', function () { cy.contains('Add this certification to my LinkedIn profile') .should('have.attr', 'href') .and( 'match', // eslint-disable-next-line max-len /https:\/\/www\.linkedin\.com\/profile\/add\?startTask=CERTIFICATION_NAME&name=Responsive Web Design&organizationId=4831032&issueYear=\d\d\d\d&issueMonth=\d\d?&certUrl=https:\/\/freecodecamp\.org\/certification\/developmentuser\/responsive-web-design/ ); }); it('should render a Twitter button', function () { cy.contains('Share this certification on Twitter').should( 'have.attr', 'href', 'https://twitter.com/intent/tweet?text=I just earned the Responsive Web Design certification @freeCodeCamp! Check it out here: https://freecodecamp.org/certification/developmentuser/responsive-web-design' ); }); it("should be issued with today's date", () => { const date = new Date(); const issued = `Issued\xa0${new Intl.DateTimeFormat('en-US', { month: 'long' }).format(date)} ${date.getDate()}, ${date.getFullYear()}`; cy.get('[data-cy=issue-date]').should('have.text', issued); }); }); describe("while viewing someone else's,", function () { before(() => { cy.visit(certificationUrl); }); it('should display certificate', function () { cy.contains('has successfully completed the freeCodeCamp.org').should( 'exist' ); cy.contains('Responsive Web Design').should('exist'); }); it('should not render a LinkedIn button', function () { cy.contains('Add this certification to my LinkedIn profile').should( 'not.exist' ); }); it('should not render a Twitter button', function () { cy.contains('Share this certification on Twitter').should('not.exist'); }); }); });
const pathModule = require('path'); const expect = require('../../unexpected-with-plugins'); const AssetGraph = require('../../../lib/AssetGraph'); describe('relations/HtmlAlternateLink', function () { it('should handle a simple test case', async function () { const assetGraph = new AssetGraph({ root: pathModule.resolve( __dirname, '../../../testdata/relations/Html/HtmlAlternateLink/' ), }); await assetGraph.loadAssets('index.html'); await assetGraph.populate(); expect(assetGraph, 'to contain relations', 'HtmlAlternateLink', 4); expect(assetGraph, 'to contain assets', 'Rss', 2); expect(assetGraph, 'to contain asset', 'Atom'); expect(assetGraph, 'to contain asset', 'Xml'); }); });
var gulp = require('gulp'); var del = require('del'); var plumber = require('gulp-plumber'); var replace = require('gulp-replace'); // lib gulp.task('lib-clean', function () { return del('./lib/*'); }); gulp.task('lib-assets', ['lib-clean'], function () { return gulp.src(['./src/**/*.*', '!./src/**/*.js']) .pipe(gulp.dest('./lib')); }); gulp.task('lib-compile', ['lib-clean'], function () { return gulp.src(['./src/**/*.js']) .pipe(plumber()) .pipe(replace('require(\'zrender\')', 'require(\'zrenderjs\')')) .pipe(replace('require(\'zrender/', 'require(\'zrenderjs/')) .pipe(gulp.dest('./lib')); }); gulp.task('lib', ['lib-clean', 'lib-assets', 'lib-compile']); // dist gulp.task('dist-clean', function () { return del('./dist/*'); }); gulp.task('dist-assets', ['dist-clean'], function () { return gulp.src(['./src/**/*.*', '!./src/**/*.js']) .pipe(gulp.dest('./dist')); }); gulp.task('dist-compile', ['dist-clean'], function () { return gulp.src(['./src/**/*.js']) .pipe(plumber()) .pipe(replace('require(\'zrender\')', 'require(\'zrenderjs\')')) .pipe(replace('require(\'zrender/', 'require(\'zrenderjs/')) // .pipe(replace('require(\'text!', 'require(\'')) .pipe(gulp.dest('./dist')); }); gulp.task('dist-x', ['dist-clean'], function () { return gulp.src(['./package.json', './README.md', './LICENSE']) .pipe(gulp.dest('./dist')); }); gulp.task('dist', ['dist-clean', 'dist-assets', 'dist-compile', 'dist-x']); gulp.task('default', ['dist']);
import camelize from "./camelize"; const msPattern = /^-ms-/; function camelizeStyle(string) { return camelize(string.replace(msPattern, "ms-")); } export default camelizeStyle;
/** * Copyright 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule DraftFeatureFlags-core * */ 'use strict'; var DraftFeatureFlags = { draft_accept_selection_after_refocus: false, draft_killswitch_allow_nontextnodes: false, draft_segmented_entities_behavior: false }; module.exports = DraftFeatureFlags;
(function () { 'use strict'; angular.module('metronome.services.http', ['angular-jwt']) .factory('http', ['$http', 'CONFIG', 'jwtHelper', function($http, CONFIG, jwtHelper) { var token = Cookies.get('token'); var now = moment(); var expirationdate = moment(jwtHelper.getTokenExpirationDate(token)).subtract(1, 'm'); if (now.isAfter(expirationdate)) { $http({ method: 'POST', url: CONFIG.api + "/auth", data: JSON.stringify({ type: "access", refreshToken: Cookies.get("refreshToken") }) }).then(function successCallback(response) { Cookies.set('token', response.data.token); }, function errorCallback(response) { console.log("Error on call to renew accessToken:", response) }); } token = Cookies.get('token'); return function(config) { return $http(angular.extend({ headers: { 'Authorization': token }, url: CONFIG.api + config.path }, config)); }; }]); })();
define( //begin v1.x content { "dateFormatItem-yyyyMMMEd": "E, d MMM y G", "dateFormatItem-MMMEd": "E, d MMM", "dateFormatItem-hms": "hh:mm:ss a", "days-standAlone-wide": [ "niedziela", "poniedziałek", "wtorek", "środa", "czwartek", "piątek", "sobota" ], "months-standAlone-narrow": [ "s", "l", "m", "k", "m", "c", "l", "s", "w", "p", "l", "g" ], "dateTimeFormat-short": "{1}, {0}", "dateFormatItem-Gy": "y G", "dateTimeFormat-medium": "{1}, {0}", "quarters-standAlone-abbr": [ "1 kw.", "2 kw.", "3 kw.", "4 kw." ], "dateFormatItem-y": "y G", "dateFormatItem-yyyy": "y G", "months-standAlone-abbr": [ "sty", "lut", "mar", "kwi", "maj", "cze", "lip", "sie", "wrz", "paź", "lis", "gru" ], "dateFormatItem-Ed": "E, d", "days-standAlone-narrow": [ "N", "P", "W", "Ś", "C", "P", "S" ], "eraAbbr": [ "BE" ], "dateFormatItem-GyMMMd": "d MMM y G", "dateFormat-long": "d MMMM y G", "dateFormat-medium": "d MMM y G", "quarters-standAlone-wide": [ "I kwartał", "II kwartał", "III kwartał", "IV kwartał" ], "dateFormatItem-yyyyQQQQ": "QQQQ y G", "quarters-standAlone-narrow": [ "K1", "K2", "K3", "K4" ], "months-standAlone-wide": [ "styczeń", "luty", "marzec", "kwiecień", "maj", "czerwiec", "lipiec", "sierpień", "wrzesień", "październik", "listopad", "grudzień" ], "dateFormatItem-yyyyMd": "d.MM.y G", "dateFormatItem-yyyyMMMd": "d MMM y G", "dateFormatItem-yyyyMEd": "E, d.MM.y G", "dateFormatItem-MMMd": "d MMM", "months-format-abbr": [ "sty", "lut", "mar", "kwi", "maj", "cze", "lip", "sie", "wrz", "paź", "lis", "gru" ], "quarters-format-abbr": [ "K1", "K2", "K3", "K4" ], "days-format-abbr": [ "niedz.", "pon.", "wt.", "śr.", "czw.", "pt.", "sob." ], "days-format-narrow": [ "N", "P", "W", "Ś", "C", "P", "S" ], "dateFormatItem-GyMMMEd": "E, d MMM y G", "dateFormatItem-GyMMM": "LLL y G", "dateFormatItem-yyyyQQQ": "QQQ y G", "dateFormatItem-MEd": "E, d.MM", "months-format-narrow": [ "s", "l", "m", "k", "m", "c", "l", "s", "w", "p", "l", "g" ], "days-standAlone-short": [ "niedz.", "pon.", "wt.", "śr.", "czw.", "pt.", "sob." ], "dateFormatItem-hm": "hh:mm a", "days-standAlone-abbr": [ "niedz.", "pon.", "wt.", "śr.", "czw.", "pt.", "sob." ], "dateFormat-short": "dd.MM.y G", "dateFormatItem-yyyyM": "MM.y G", "dateFormat-full": "EEEE, d MMMM y G", "dateFormatItem-Md": "d.MM", "months-format-wide": [ "stycznia", "lutego", "marca", "kwietnia", "maja", "czerwca", "lipca", "sierpnia", "września", "października", "listopada", "grudnia" ], "days-format-short": [ "niedz.", "pon.", "wt.", "śr.", "czw.", "pt.", "sob." ], "dateFormatItem-yyyyMMM": "LLL y G", "quarters-format-wide": [ "I kwartał", "II kwartał", "III kwartał", "IV kwartał" ], "days-format-wide": [ "niedziela", "poniedziałek", "wtorek", "środa", "czwartek", "piątek", "sobota" ], "dateFormatItem-h": "hh a" } //end v1.x content );
var dir_4627380db2f0c36581ca02ea208a64c6 = [ [ "support", "dir_2e2aa096c82c7fb5ccae4b9643632450.html", "dir_2e2aa096c82c7fb5ccae4b9643632450" ] ];
var webpack = require('webpack'); var path = require('path'); module.exports = { entry: './main.jsx', output: { path: './output', publicPath: '/output', filename: 'bundle.js' }, module: { loaders: [ { test: /\.jsx/, loader: 'jsx-loader' } ] }, watch: true };
var http = require('http'); var fs = require('fs'); var url = require('url'); http.createServer( function (req, res) { var pathname = url.parse(req.url).pathname; if (pathname == '/data' && req.method == "POST") { req.setEncoding('utf8'); var t = new Date(); var body = ''; req.on('data', function(chunk){ body += chunk; console.log('data!');}); req.on('end', function () { var entry = { ts: t, d: body }; fs.appendFile('data.json', JSON.stringify(entry)); console.log("Recorded entry to data.json: " + JSON.stringify(entry)); }); res.writeHead(200); res.end(); } else { var fn = pathname.substr(1); var extn = pathname.slice (pathname.lastIndexOf('.')); var mimetype = 'none'; switch(pathname.slice( pathname.lastIndexOf('.'))) { case ".js": mimetype = "application/javascript"; break; case ".png": mimetype = "image/png"; break; case ".jpg": mimetype = "image/jpeg"; break; case ".html": mimetype = "text/html"; break; case ".css": mimetype = "text/css"; break; } fs.readFile(fn, function (err,data) { if (err) { console.log(err); res.writeHead(404,{'Content-Type':'text/html'}); res.end(); } else { res.writeHead(200, {'Content-Type':mimetype}); res.write(data); res.end(); } }); } }).listen(80);
(function() { 'use strict'; var module = angular.module('offerFormDirective'); module.factory('requestSuggestions', ['$http', function($http) { return function(args) { return Rx.Observable.fromPromise( $http.post('/api/v1/restaurants/' + args.restaurantID + '/offer_suggestions', { title: args.title, }) ); }; }]); // Can be used to avoid showing the single suggestion after the user has // selected a suggestion and the title field is filled with the selected // offer. function onlySuggestionSelected(args) { var suggestions = args.suggestions; var title = args.title; return suggestions.length == 1 && suggestions[0].title === title; } module.factory('suggestionsObservable', ['requestSuggestions', function(requestSuggestions) { return function(args) { var titleObservable = args.titleObservable; var restaurantID = args.restaurantID; var scheduler = args.scheduler || Rx.Scheduler.default; return titleObservable .filter(function(title) { // Test for self-equality, to avoid calling for NaN values return title !== null && (typeof title !== 'undefined') && title === title; }) .skip(1) // We don't want to show suggestions for the initial value .debounce(500, scheduler) .filter(R.compose( R.lt(2), R.length )) .flatMapLatest(function(title) { return requestSuggestions({ title: title, restaurantID: restaurantID, }).map(R.prop('data')) .map(function(suggestions) { return { suggestions: suggestions, title: title, }; }); }) .filter(R.propSatisfies(R.complement(R.isNil), 'suggestions')) .filter(R.complement(onlySuggestionSelected)) .map(R.prop('suggestions')); }; }]); })();
import WebSocket from 'ws'; import querystring from 'querystring'; import Socket from './Socket.js'; /** * Websocket server that creates and host all {@link server.Socket} instance. * * (@note - could be usefull for broadcasting messages, creating rooms, etc. * * @memberof server */ class Sockets { constructor() { /** * Store sockets per room. The romm `'*'` store all current connections. * @private */ this._rooms = new Map(); this._initializationCache = new Map(); } /** * Initialize sockets, all sockets are added by default added to two rooms: * - to the room corresponding to the client `clientType` * - to the '*' that holds all connected sockets * * @private */ start(httpServer, config, onConnectionCallback) { const path = config.path; // init global room this._rooms.set('*', new Set()); this.wss = new WebSocket.Server({ server: httpServer, path: `/${path}`, // @note - update according to existing config files (aka cosima-apps) }); this.wss.on('connection', (ws, req) => { const queryString = querystring.decode(req.url.split('?')[1]); const { clientType, key } = queryString; const binary = !!(parseInt(queryString.binary)); if (binary) { ws.binaryType = 'arraybuffer'; } if (!this._initializationCache.has(key)) { this._initializationCache.set(key, { ws, binary }); } else { const cached = this._initializationCache.get(key); this._initializationCache.delete(key); // should be in order, but just to be sure const stringWs = cached.binary ? ws : cached.ws; const binaryWs = cached.binary ? cached.ws : ws; const socket = new Socket(stringWs, binaryWs, this._rooms, this, config); socket.addToRoom('*'); socket.addToRoom(clientType); onConnectionCallback(clientType, socket); } }); } /** @private */ _broadcast(binary, roomIds, excludeSocket, channel, ...args) { const method = binary ? 'sendBinary' : 'send'; let targets = new Set(); if (typeof roomIds === 'string' || Array.isArray(roomIds)) { if (typeof roomIds === 'string') { roomIds = [roomIds]; } roomIds.forEach(roomId => { if (this._rooms.has(roomId)) { const room = this._rooms.get(roomId); room.forEach(socket => targets.add(socket)); } }); } else { targets = this._rooms.get('*'); } targets.forEach(socket => { if (socket.ws.readyState === WebSocket.OPEN) { if (excludeSocket !== null) { if (socket !== excludeSocket) { socket[method](channel, ...args); } } else { socket[method](channel, ...args); } } }); } /** * Add a socket to a room * * @param {server.Socket} socket - Socket to add to the room. * @param {String} roomId - Id of the room */ addToRoom(socket, roomId) { socket.addToRoom(roomId); } /** * Remove a socket from a room * * @param {server.Socket} socket - Socket to remove from the room. * @param {String} [roomId=null] - Id of the room */ removeFromRoom(socket, roomId) { socket.removeFromRoom(roomId); } /** * Send a string message to all client of given room(s). If no room * not specified, the message is sent to all clients * * @param {String|Array} roomsIds - Ids of the rooms that must receive * the message. If null the message is sent to all clients * @param {server.Socket} excludeSocket - Optionnal * socket to ignore when broadcasting the message, typically the client * at the origin of the message * @param {String} channel - Channel of the message * @param {...*} args - Arguments of the message (as many as needed, of any type) */ broadcast(roomIds, excludeSocket, channel, ...args) { this._broadcast(false, roomIds, excludeSocket, channel, ...args); } /** * Send a binary message (TypedArray) to all client of given room(s). If no room * not specified, the message is sent to all clients * * @param {String|Array} roomsIds - Ids of the rooms that must receive * the message. If null the message is sent to all clients * @param {server.Socket} excludeSocket - Optionnal * socket to ignore when broadcasting the message, typically the client * at the origin of the message * @param {String} channel - Channel of the message * @param {...*} args - Arguments of the message (as many as needed, of any type) */ broadcastBinary(roomIds, excludeSocket, channel, typedArray) { this._broadcast(true, roomIds, excludeSocket, channel, typedArray); } }; export default Sockets;
var path = require("path"); var fs = require("fs"); var wt = require("./walk-tree"); function createEvent(dirs, event, dir, fileName) { var fullPath = path.join(dir, fileName); var exists = dirs.some(function (d) { return d === fullPath; }); var statObj; function stat() { if (statObj) { return statObj; } if (!fullPath) { statObj = { isDirectory: function () { return false; } }; } else { try { statObj = fs.statSync(fullPath); } catch (e) { statObj = { isDirectory: function () { return false; }, deleted: true }; } } return statObj; } return { name: fullPath, isDirectory: function () { return stat().isDirectory(); }, isMkdir: function () { return this.isDirectory() && !exists; }, isDelete: function () { return !!stat().deleted; }, isModify: function () { return !this.isDelete() && !this.isMkdir(); } }; } var addWatch; function watch(state, dir, options, callback) { return fs.watch(dir, function (event, fileName) { var e = createEvent(state.dirs, event, dir, fileName); if (e.isDirectory() && e.isMkdir()) { addWatch(state, e.name, options, callback); } if (!wt.isExcluded(e.name, options.exclude) && typeof callback === "function") { callback(e); } }); } function addWatch(state, dir, options, callback) { state.dirs = state.dirs || []; state.dirs.push(dir); state.watches = state.watches || []; state.watches.push(watch(state, dir, options, callback)); } function watchTree(dir, options, callback) { var opt = options, cb = callback; if (arguments.length === 2 && typeof opt === "function") { cb = opt; opt = {}; } var state = {}; opt = opt || {}; opt.exclude = wt.excludeRegExes(opt.exclude); addWatch(state, dir, opt, cb); wt.walkTree(dir, opt, function (err, dir) { if (err) { return; } addWatch(state, dir, opt, cb); }); return { end: function () { state.watches.forEach(function (w) { w.close(); }); } }; } exports.watchTree = watchTree;
$('.ui.dropdown').dropdown(); $(document).ready(function() { $('#test-form').on('submit', function(e) { e.preventDefault(); var format = document.getElementsByName('test-format')[0].value; var email = document.getElementsByName('test-email')[0].value; // Verify the parameters were passed if (format === '' || email === '') { return; } $('#test-button').addClass('loading'); var xhr = new XMLHttpRequest(); xhr.open('GET', 'https://trumail.io/' + format + '/' + email, true); xhr.onload = function(e) { var results; if (format === 'json') { results = vkbeautify.json(xhr.responseText, 4); } if (format === 'xml') { results = vkbeautify.xml(xhr.responseText, 4); } document.getElementsByName('test-results')[0].textContent = results; $('.ui.modal').modal({ closable: false, transition: 'flip vertical' }).modal('show'); $('#test-button').removeClass('loading'); }; xhr.onerror = function(e) { console.error(xhr.statusText); }; xhr.send(null); }); });
import React from "react"; import { View } from "react-native"; import styles from "./styles"; import { ListItemSeparator } from "./styles/responsive"; const ArticleListItemSeparator = () => ( <ListItemSeparator> <View style={styles.listItemSeparator} /> </ListItemSeparator> ); export default ArticleListItemSeparator;
/* This is a generated file */ const React = require('React'); const JestIndex = require('JestIndex'); const index = React.createClass({ render() { return <JestIndex language={ 'en'} />; }, }); module.exports = index;
import React from 'react'; import { Icon } from 'design-react-kit'; import { createUseStyles } from 'react-jss'; import { SearchProvider } from '../../contexts/searchContext.js'; import { ALL_SITE } from '../../utils/constants.js'; import { useModal } from '../../hooks/useModal.js'; import { l10NLabels } from '../../utils/l10n.js'; import { SearchModal } from './SearchModal.js'; const useStyles = createUseStyles({ icon: { composes: 'd-none d-lg-inline', backgroundColor: 'var(--white)', borderRadius: '100%', fill: 'var(--primary)', height: '2.6rem', padding: '0.8rem', width: '2.6rem', }, }); export const SearchContainer = () => { const classes = useStyles(); const [isModalOpen, closeModal, openModal] = useModal(); return ( <> <div onClick={openModal} className="d-flex align-items-center pr-2" role="button" data-testid="search-button"> <span className="text-white mr-3 d-none d-lg-inline">{l10NLabels.search_form_label}</span> <Icon className={classes.icon} icon="it-search"></Icon> <Icon className="d-inline d-lg-none" icon="it-search" color="white"></Icon> </div> {isModalOpen && ( <SearchProvider initialType={ALL_SITE}> <SearchModal onClose={closeModal} /> </SearchProvider> )} </> ); };
Tinytest.add('peerdb - defined', function (test) { var isDefined = false; try { Document; isDefined = true; } catch (e) { } test.isTrue(isDefined, "Document is not defined"); test.isTrue(Package['peerlibrary:peerdb'].Document, "Package.peerlibrary:peerdb.Document is not defined"); });
function redrawFromSelection(obj, url, current_selection) { /* Create the selection */ var new_selection = {}; $.each(obj.exp_selection, function(ekey,evalue) { $.each(evalue.exp_data, function(dkey,dvalue) { if (dvalue.selected) { new_selection[ekey + "-" + dkey] = true; } }); }); var load_selection = []; $.each(new_selection, function(key,value) { if (!(key in current_selection)) { sel_key = key.split('-'); load_selection.push([ parseInt(sel_key[0], 10), parseInt(sel_key[1], 10), parseInt(sel_key[2], 10) ]); } /* Needed to update current_selection */ //current_selection[key] = value; }); /* Maybe nothing was selected ?! */ if (Object.keys(new_selection).length === 0) { obj.clearPlot(); return new_selection; } /* Nothing to reload, but we should trigger a redraw */ if (load_selection.length === 0) { changeDisplay(obj, obj.getDBData()); return new_selection; } /* Trigger the AJAX request to receive the data */ overlayToggle(null, 'Data request pending.'); var xhr = $.ajax({ type: 'POST', url: url, dataType: 'json', data: { sel: load_selection }, async: true, success: obj.redrawFromSelectionCallback }); return new_selection; }; function createExpSelection(obj) { obj.exp_selection = {}; // Re-Initialize experiments object var exp = experiments; var exp_selection = obj.exp_selection; var exp_to_load = 0; var exp_loaded = 0; $.ajax({ type: 'GET', url: '/get_experiments', dataType: 'json', data: { db: obj.db }, async: true, success: function(data) { exp_to_load = data.result.length; $.each(data.result, function(index, value) { var exp_id = value[0]; exp_selection[exp_id] = { 'exp_date': new Date(value[1] * 1000), 'exp_name': value[2], 'exp_start': value[3], 'exp_stop': value[4], 'exp_data': {} }; // Call to get details of experiments $.ajax({ type: 'GET', url: '/get_experiment_overview', dataType: 'json', data: { id: exp_id }, async: true, success: function(data) { $.each(data.result, function(index, value) { exp_selection[exp_id].exp_data[value[0] + '-' + value[2]] = { 'kname': value[1], 'dname': value[3], 'selected': false }; }); exp_loaded++; if (exp_loaded == exp_to_load) { redraw(exp, exp_selection); resizeDocument(e); overlayToggle('hide'); } } }); }); } }); };
const gulp = require('gulp'), eslint = require('gulp-eslint'), mocha = require('gulp-mocha'); const SOURCE = './src', TEST_SOURCE = './test', UNIT_TEST_SOURCE = './test/unit'; gulp.task('lint', function(){ return gulp .src([SOURCE + '/*.js', SOURCE + '/**/*.js']) .pipe(eslint()) .pipe(eslint.format()); }); gulp.task('lint-test', function(){ return gulp .src([TEST_SOURCE + '/*.js', TEST_SOURCE + '/**/*.js'] ) .pipe(eslint()) .pipe(eslint.format()); }); /** run unit tests */ gulp.task('test', ['lint-test'], function(){ return gulp .src([UNIT_TEST_SOURCE + '/*.js', UNIT_TEST_SOURCE + '/**/*.js']) .pipe(mocha({reporter: 'spec'})); });
/*jslint indent: 2 */ /*global $: false, document: false, togglbutton: false*/ 'use strict'; togglbutton.render('section.task-actions:not(.toggl)', {observe: true}, function (elem) { var link, linkAction = document.createElement("LI"), taskTitle = $("p.task-title"), firstAction = $('.task-actions ul li:first-child', elem), actionList = firstAction.parentNode; link = togglbutton.createTimerLink({ className: 'kanbanery', description: taskTitle.textContent }); linkAction.appendChild(link); actionList.insertBefore(linkAction, firstAction); });
/** * Created by praba on 2/13/2016. */ //JS page for outwardslip page Polymer({ is: "outwardslip-page", ready:function() { //Showing customerinfo page as the initial page in outwardslip page localStorage.setItem("curr_sess_saveflag","false"); if(sessionStorage.getItem("curr_sess_roleflag")=="0") { localStorage.setItem("curr_sess_showpage","Out Vehicle Info"); //document.querySelector("webcomponent-service").callWebcomponentService(); this.page="Out Vehicle Info"; } }, setPage:function(page) { //Setting current page in local storage to fetch the labels dynamically localStorage.setItem("curr_sess_showpage",page); //Calling web component service to fetch label and errro label info from config file document.querySelector("webcomponent-service").callWebcomponentService(); //Changing page view in Outwardslip page this.page=page; } });
var Lang = Y.Lang, getCN = Y.ClassNameManager.getClassName, //HTML5 Data Attributes DATA_CONTENT = 'data-content', DATA_PLACEMENT = 'data-placement', //Classes TIPSY = 'tipsy', FADE = 'fade', IN = 'in', CLASSES = { fade: getCN(TIPSY, FADE), fadeIn: getCN(TIPSY, IN) }; Y.Tipsy = Y.Base.create("tipsy", Y.Widget, [Y.WidgetPointer, Y.WidgetPosition, Y.WidgetPositionAlign, Y.WidgetStack], { _handles : [], _timer : null, //constructor initializer : function(config) { }, //clean up on destruction destructor : function() { Y.each(this._handles, function(v, k, o) { v.detach(); }); }, renderUI : function () { this.get('boundingBox').addClass(CLASSES.fade).setAttribute('role', 'tooltip'); }, bindUI : function () { var del = this.get('delegate'), selector = this.get('selector'), showOn = this.get('showOn'); //showOn = ['event1', 'event2'] if (Lang.isArray(showOn) || Lang.isString(showOn)) { this._handles.push(del.delegate(showOn, this._handleDelegateStart, selector, this)); } //showOn = { events: ['event1', 'event2'] } else if (Lang.isObject(showOn) && !showOn.node) { this._handles.push(del.delegate(showOn.events, this._handleDelegateStart, selector, this)); } //showOn = { node: '#selector', events: ['event1', 'event2'] } else if (Lang.isObject(showOn) && showOn.node && showOn.events) { this._handles.push(Y.one(showOn.selector).on(showOn.events, this._handleDelegateStart, this)); } else { Y.log('The showOn attribute should contain an array of events, or an object with keys "selector" (string), and "events" (array of events)'); } }, _handleDelegateStart : function (e) { var del = this.get('delegate'), delay = this.get('delay' ), selector = this.get('selector'), hideOn = this.get('hideOn'), node = e.currentTarget; if (Lang.isArray(hideOn) || Lang.isString(hideOn)) { this._handles.push(del.delegate(hideOn, this._handleDelegateEnd, selector, this)); } //hideOn = { events: ['event1', 'event2'] } else if (Lang.isObject(hideOn) && !hideOn.selector) { this._handles.push(del.delegate(hideOn.events, this._handleDelegateEnd, selector, this)); } //hideOn = { node: '#selector', events: ['event1', 'event2'] } else if (Lang.isObject(hideOn) && hideOn.selector && hideOn.events) { this._handles.push(Y.one(hideOn.selector).on(hideOn.events, this._handleDelegateEnd, this)); } else { Y.log('The hideOn attribute should contain an array of events, or an object with keys "selector" (string), and "events" (array of events)'); } if (delay) { this._timer = Y.later(delay*1000, this, 'showTooltip', node); } else { this.showTooltip(node); } }, _handleDelegateEnd: function (e) { this.hideTooltip(); if (this._timer) { this._timer.cancel(); this._timer = null; } }, showTooltip : function (node) { this._setTooltipContent(node); this._alignTooltip(node); this.alignPointer(node); this._showTooltip(); this.get('boundingBox').addClass(CLASSES.fadeIn).setAttribute('aria-hidden', 'false'); node.setAttribute('aria-describedby', this.get('boundingBox').getAttribute('id')); }, _showTooltip: function () { this.set('visible', true); }, hideTooltip : function () { this.get('boundingBox').removeClass(CLASSES.fadeIn).setAttrs({ 'aria-hidden': 'true', //clear out all inline styles 'styles': '' }); this._hideTooltip(); }, _hideTooltip: function () { this.set('visible', false); }, _setTooltipContent: function (node) { var content = (node.hasAttribute(DATA_CONTENT)) ? node.getAttribute(DATA_CONTENT) : this.get('content'), contentBox = this.get('contentBox'); contentBox.setHTML(content); }, _alignTooltip : function (node) { var placement = (node.hasAttribute(DATA_PLACEMENT)) ? node.getAttribute(DATA_PLACEMENT) : this.get('placement'); switch (placement) { case "above": this.align(node, ["bc", "tc"]); break; case "left": this.align(node, ["rc", "lc"]); break; case "below": this.align(node, ["tc", "bc"]); break; case "right": this.align(node, ["lc", "rc"]); break; default: break; } } }, { NS : "tipsy", ATTRS : { content : { value : '' }, selector: { value: null }, zIndex: { value: 2 }, delay: { value: 0 }, showOn: { value: ['mouseover', 'touchstart', 'focus'] }, hideOn: { value: ['mouseout', 'touchend', 'blur'] }, delegate: { value: null, setter: function(val) { return Y.one(val) || Y.one("document"); } } } });
/* * Copyright (c) 2015, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @flow */ import parseJsDoc from '../utils/parseJsDoc'; import type Documentation from '../Documentation'; // Merges two objects ignoring null/undefined. function merge(obj1, obj2) { if (obj1 == null && obj2 == null) { return null; } const merged = {...obj1}; for (const prop in obj2) { if (obj2[prop] != null) { merged[prop] = obj2[prop]; } } return merged; } /** * Extract info from the methods jsdoc blocks. Must be run after * flowComponentMethodsHandler. */ export default function componentMethodsJsDocHandler( documentation: Documentation ) { let methods = documentation.get('methods'); if (!methods) { return; } methods = methods.map(method => { if (!method.docblock) { return method; } const jsDoc = parseJsDoc(method.docblock); const returns = merge(jsDoc.returns, method.returns); const params = method.params.map(param => { const jsDocParam = jsDoc.params.find(p => p.name === param.name); return merge(jsDocParam, param); }); return { ...method, description: jsDoc.description || null, returns, params, }; }); documentation.set('methods', methods); }
/** * Regex patterns used through keigai * * `url` was authored by Diego Perini * * @namespace regex * @private * @type {Object} */ let regex = { after_space: /\s+.*/, allow: /^allow$/i, allow_cors: /^access-control-allow-methods$/i, and: /^&/, args: /\((.*)\)/, auth: /\/\/(.*)\@/, bool: /^(true|false)?$/, boolean_number_string: /boolean|number|string/, caps: /[A-Z]/, cdata: /\&|<|>|\"|\'|\t|\r|\n|\@|\$/, checked_disabled: /checked|disabled/i, complete_loaded: /^(complete|loaded)$/i, csv_quote: /^\s|\"|\n|,|\s$/, del: /^del/, domain: /^[\w.-_]+\.[A-Za-z]{2,}$/, down: /down/, endslash: /\/$/, eol_nl: /\n$/, element_update: /id|innerHTML|innerText|textContent|type|src/, get_headers: /^(head|get|options)$/, get_remove_set: /get|remove|set/, hash: /^\#/, header_replace: /:.*/, header_value_replace: /.*:\s+/, html: /^<.*>$/, http_body: /200|201|202|203|206/, http_ports: /80|443/, host: /\/\/(.*)\//, ie: /msie|ie|\.net|windows\snt/i, ip: /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/, is_xml: /^<\?xml.*\?>/, json_maybe: /json|plain|javascript/, json_wrap: /^[\[\{]/, klass: /^\./, no: /no-store|no-cache/i, not_dotnotation: /-|\s/, not_endpoint: /.*\//, null_undefined: /null|undefined/, number: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)|number/, number_format_1: /.*\./, number_format_2: /\..*/, number_present: /\d{1,}/, number_string: /number|string/i, number_string_object: /number|object|string/i, object_type: /\[object Object\]/, patch: /^patch$/, primitive: /^(boolean|function|number|string)$/, priv: /private/, protocol: /^(.*)\/\//, put_post: /^(post|put)$/i, question: /(\?{1,})/, radio_checkbox: /^(radio|checkbox)$/i, root: /^\/[^\/]/, select: /select/i, selector_is: /^:/, selector_complex: /\s+|\>|\+|\~|\:|\[/, set_del: /^(set|del|delete)$/, space_hyphen: /\s|-/, string_object: /string|object/i, svg: /svg/, top_bottom: /top|bottom/i, trick: /(\%3F{1,})/, url: /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/i, word: /^\w+$/, xdomainrequest: /^(get|post)$/i, xml: /xml/i };
/* medea.js - Open Source, High-Performance 3D Engine based on WebGL. * * (c) 2011-2013, Alexander C. Gessler * https://github.com/acgessler/medea.js * * Made available under the terms and conditions of a 3-clause BSD license. * */ medealib.define('light', ['entity', 'renderer'],function(medealib, undefined) { "use strict"; var medea = this, gl = medea.gl; // class LightJob medea.LightJob = medea.RenderJob.extend({ distance : null, light : null, init : function(light, node, camera) { this._super(light, node, camera); this.light = light; }, Draw : function(renderer, statepool) { renderer.DrawLight(this, statepool); }, }); // class Light this.Light = medea.Entity.extend( { cast_shadows : false, shadowmap_res_bias : 0, rq_idx : -1, init : function(color, rq) { this.color = color || [1,1,1]; this.rq_idx = rq === undefined ? medea.RENDERQUEUE_LIGHT : rq; }, Render : function(camera, node, rqmanager) { // Construct a renderable capable of drawing this light later rqmanager.Push(this.rq_idx, new medea.LightJob(this, node, camera)); }, CastShadows : medealib.Property('cast_shadows'), ShadowMapResolutionBias : medealib.Property('shadowmap_res_bias'), }); // class DirectionalLight this.DirectionalLight = medea.Light.extend( { dir : null, init : function(color, dir) { this._super(color); this.dir = vec3.create(dir || [0,-1,0]); vec3.normalize(this.dir); }, Direction : function(dir) { if (dir === undefined) { return this.dir; } this.dir = vec3.create(dir); vec3.normalize(this.dir); }, }); medea.CreateDirectionalLight = function(color, dir) { return new medea.DirectionalLight(color, dir); }; });
module.exports = { clientCheckin: function(req, res, sockets) { console.log("clientnameee:", req.body); req.body.alert.expiresAt = new Date(new Date().getTime() + 10000); //FIVE SECS DURATION HARD CODED! NOT COOL!! sockets.emit("client-checkin", req.body.alert); res.end(); }, clearAlerts: function(req, res, sockets) { sockets.emit("alert-deleted"); res.end("clear alerts!"); } };