text
stringlengths
2
6.14k
'use strict'; angular.module('athenaApp') .config(function ($stateProvider) { $stateProvider .state('login', { parent: 'account', url: '/login', data: { roles: [], pageTitle: 'Authentication' }, views: { 'content@': { templateUrl: 'scripts/app/account/login/login.html', controller: 'LoginController' } }, resolve: { } }); });
({ failOnWarning : true, /** * Check to make sure that when the user puts in invalid options (i.e. an option missing the value element) */ testInputSelect_WarningForInvalidOption : { auraWarningsExpectedDuringInit: ["Option at index 1 in select component"], attributes : { "case" : "badsel"}, test : function(cmp) { this.dummyFunc(); } }, /** * Verify that correct usage of InputSelect does not throw warnings */ testInputSelect_WarningDoesNotShowUp : { test : function(cmp) { this.dummyFunc(); } }, /** * Dummy function that will return true in all cases */ dummyFunc : function(){ return true; } })
/* * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. */ 'use strict'; exports.EntitySearchAPI = require('./entitySearch/entitySearchAPI'); exports = module.exports;
var DATA = {"a" : "b", "c" : "d"}; var RESPONSE = {"vendor":"OpenPolicy","name":"alex","locations":[{"continent":"Europe","country":"Germany","price":5,"latitude":"48.105964","name":"Slot_ger_4","longitude":"11.612549"},{"continent":"Europe","country":"Germany","price":6,"latitude":"52.473412","name":"Slot_ger_1","longitude":"13.390961"},{"continent":"Europe","country":"Germany","price":5,"latitude":"48.105964","name":"Slot_ger_2","longitude":"11.612549"},{"continent":"Europe","country":"Germany","price":4,"latitude":"52.473412","name":"Slot_ger_3","longitude":"13.390961"}],"version":"0.1"} var REQUEST = { "name":"alex", "vendor":"OpenPolicy", "version":"0.1", "preferences":["germany"], "attributes":[ { "#http://www.q-team.org/Ontology#Einwilligung_Zur_Datensammlung":true }, { "#http://www.q-team.org/Ontology#minAge":12 }, { "#http://www.q-team.org/Ontology#Recht_auf_Vergessen":false }, { "#http://www.q-team.org/Ontology#Meldepflicht_bei_Verletzung":true } ] }
'use strict' var gulp = require('gulp') var $ = require('gulp-load-plugins')() gulp.task('default', function() { gulp.src('./src/**/*.js') .pipe($.wrap('!function(a,b){"function"==typeof define&&define.amd?define(b):"object"==typeof exports?module.exports=b(require,exports,module):a.audioWave=b()}(this,function(){<%= contents %>});')) .pipe($.jsbeautifier({ config: '.jsbeautifyrc' })) .pipe(gulp.dest('./dist')) .pipe($.uglify({ "mangle": true })) .pipe($.rename({ suffix: ".min" })) .pipe(gulp.dest('./dist')) .pipe(gulp.dest('./demo/js')) }) gulp.task('demo', $.serve('demo'))
//engine: JScript //uname: diff_1C //dname: Backend к diff, типовое сравнение от 1С (mxl,txt,js,vbs) //addin: global global.connectGlobals(SelfScript) function СравнениеФайлов1С(Path1, Path2) { var file1 = v8New("File", Path1); var file2 = v8New("File", Path2); if ((!file1.isFile()) & (!file2.isFile())) return null var ext1 = file1.Extension.substr(1).toLowerCase(); //Уберем первый символ, да в нижний регистр, этоже windows var ext2 = file2.Extension.substr(1).toLowerCase(); //Уберем первый символ, да в нижний регистр, этоже windows var fc = v8New("СравнениеФайлов") fc.ПервыйФайл = Path1; fc.ВторойФайл = Path2; fc.СпособСравнения = СпособСравненияФайлов.Двоичное; if ((ext1.indexOf("mxl") >= 0) & (ext2.indexOf("mxl") >= 0)) fc.СпособСравнения = СпособСравненияФайлов.ТабличныйДокумент; if ((ext1.indexOf("txt") >= 0) & (ext2.indexOf("txt") >= 0)) fc.СпособСравнения = СпособСравненияФайлов.ТекстовыйДокумент; if ((ext1.indexOf("js") >= 0) & (ext2.indexOf("js") >= 0)) fc.СпособСравнения = СпособСравненияФайлов.ТекстовыйДокумент; if ((ext1.indexOf("vbs") >= 0) & (ext2.indexOf("vbs") >= 0)) fc.СпособСравнения = СпособСравненияФайлов.ТекстовыйДокумент; fc.ПоказатьРазличия(); } //СравнениеФайлов1С function GetExtension () { return "mxl|txt|js|vbs"; } //GetExtension function GetBackend() { return СравнениеФайлов1С } //GetBackend
/* * Copyright IBM Corp. 2017 * * 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 path = require('path'); module.exports = { fileExists: function (filePath) { try { return fs.statSync(filePath).isFile(); } catch (err) { return false; } }, size: function (filePath) { try { var units = ['Bytes', 'KB', 'MB', 'GB', 'TB']; var size = fs.statSync(filePath).size; var exponent = Math.floor(Math.log(size) / Math.log(1024)); return (size / Math.pow(1024, exponent)).toFixed(2) + ' ' + units[exponent]; } catch (err) { throw err; } }, read: function (filePath) { try { return fs.readFileSync(filePath, 'utf8'); } catch (err) { throw err; } }, write: function (filePath, content) { try { return fs.writeFileSync(filePath, content, 'utf8'); } catch (err) { throw err; } }, stream: function (filePath) { try { return fs.createReadStream(filePath); } catch(err) { throw err; } }, name: function (filePath) { return path.parse(filePath).name; }, ext: function (filePath) { return path.parse(filePath).ext; } };
/* * Kendo UI v2014.3.1119 (http://www.telerik.com/kendo-ui) * Copyright 2014 Telerik AD. All rights reserved. * * Kendo UI commercial licenses may be obtained at * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete * If you do not own a commercial license, this file shall be governed by the trial license terms. */ (function(f, define){ define([], f); })(function(){ (function( window, undefined ) { var kendo = window.kendo || (window.kendo = { cultures: {} }); kendo.cultures["ms"] = { name: "ms", numberFormat: { pattern: ["-n"], decimals: 2, ",": ",", ".": ".", groupSize: [3], percent: { pattern: ["-n %","n %"], decimals: 2, ",": ",", ".": ".", groupSize: [3], symbol: "%" }, currency: { pattern: ["($n)","$n"], decimals: 0, ",": ",", ".": ".", groupSize: [3], symbol: "RM" } }, calendars: { standard: { days: { names: ["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu"], namesAbbr: ["Ahad","Isnin","Sel","Rabu","Khamis","Jumaat","Sabtu"], namesShort: ["A","I","S","R","K","J","S"] }, months: { names: ["Januari","Februari","Mac","April","Mei","Jun","Julai","Ogos","September","Oktober","November","Disember",""], namesAbbr: ["Jan","Feb","Mac","Apr","Mei","Jun","Jul","Ogos","Sept","Okt","Nov","Dis",""] }, AM: [""], PM: [""], patterns: { d: "dd/MM/yyyy", D: "dd MMMM yyyy", F: "dd MMMM yyyy H:mm:ss", g: "dd/MM/yyyy H:mm", G: "dd/MM/yyyy H:mm:ss", m: "dd MMMM", M: "dd MMMM", s: "yyyy'-'MM'-'dd'T'HH':'mm':'ss", t: "H:mm", T: "H:mm:ss", u: "yyyy'-'MM'-'dd HH':'mm':'ss'Z'", y: "MMMM yyyy", Y: "MMMM yyyy" }, "/": "/", ":": ":", firstDay: 1 } } } })(this); return window.kendo; }, typeof define == 'function' && define.amd ? define : function(_, f){ f(); });
import React from 'react'; import PageTemplate from '../../components/PageTemplate'; import BannerMain from '../../components/BannerMain'; import Carousel from '../../components/Carousel'; import dadosIniciais from '../../data/dados_iniciais.json'; function Home() { return ( <PageTemplate> <BannerMain videoTitle={dadosIniciais.categorias[0].videos[0].titulo} url={dadosIniciais.categorias[0].videos[0].url} videoDescription={'O que é front end?'} /> <Carousel ignoreFirstVideo category={dadosIniciais.categorias[0]} /> <Carousel category={dadosIniciais.categorias[1]} /> <Carousel category={dadosIniciais.categorias[2]} /> <Carousel category={dadosIniciais.categorias[3]} /> <Carousel category={dadosIniciais.categorias[4]} /> <Carousel category={dadosIniciais.categorias[5]} /> </PageTemplate> ); } export default Home;
'use strict' const utils = require('../../utils') const debug = require('debug') const log = debug('cli:object') log.error = debug('cli:object:error') module.exports = { command: 'stat <key>', describe: 'Get stats for the DAG node named by <key>', builder: {}, handler (argv) { utils.getIPFS((err, ipfs) => { if (err) { throw err } ipfs.object.stat(argv.key, {enc: 'base58'}, (err, stats) => { if (err) { throw err } delete stats.Hash // only for js-ipfs-api output Object.keys(stats).forEach((key) => { console.log(`${key}: ${stats[key]}`) }) }) }) } }
'use strict'; const _ = require('lodash'); const utils = require('../common/utils'); const bosh = require('../data-access-layer/bosh'); const Agent = require('../data-access-layer/service-agent'); const logger = require('../common/logger'); const errors = require('../common/errors'); const ServiceInstanceNotFound = errors.ServiceInstanceNotFound; const BoshDirectorClient = bosh.BoshDirectorClient; const Networks = bosh.manifest.Networks; const BaseService = require('./BaseService'); class BaseDirectorService extends BaseService { constructor(plan) { super(plan); this.plan = plan; this.director = bosh.director; this.agent = new Agent(this.settings.agent); } static parseDeploymentName(deploymentName, subnet) { return _ .chain(utils.deploymentNameRegExp(subnet).exec(deploymentName)) .slice(1) .tap(parts => parts[1] = parts.length ? parseInt(parts[1]) : undefined) .value(); } getDeploymentIps(deploymentName) { return this.director.getDeploymentIps(deploymentName); } get template() { return new Buffer(this.settings.template, 'base64').toString('utf8'); } findDeploymentNameByInstanceId(guid) { logger.info(`Finding deployment name with instance id : '${guid}'`); return this.getDeploymentNames(false) .then(deploymentNames => { const deploymentName = _.find(deploymentNames, name => _.endsWith(name, guid)); if (!deploymentName) { logger.warn(`+-> Could not find a matching deployment for guid: ${guid}`); throw new ServiceInstanceNotFound(guid); } return deploymentName; }) .tap(deploymentName => logger.info(`+-> Found deployment '${deploymentName}' for '${guid}'`)); } getDeploymentNames(queued) { return this.director.getDeploymentNames(queued); } get stemcell() { return _(this.settings) .chain() .get('stemcell', {}) .defaults(BoshDirectorClient.getInfrastructure().stemcell) .update('version', version => '' + version) .value(); } get releases() { return _(this.settings) .chain() .get('releases') .map(release => _.pick(release, 'name', 'version')) .sortBy(release => `${release.name}/${release.version}`) .value(); } get networkName() { return this.subnet || BoshDirectorClient.getInfrastructure().segmentation.network_name || 'default'; } getNetworks(index) { return new Networks(BoshDirectorClient.getInfrastructure().networks, index, BoshDirectorClient.getInfrastructure().segmentation); } getNetwork(index) { return this.getNetworks(index)[this.networkName]; } } module.exports = BaseDirectorService;
/** @name dimensions */ var width = 12
/** * 首页 */ pageData = window.pageData?window.pageData:[]; var vm = avalon.define({ $id : "sidebar", test: "tst", //domainBuyList1 : [{title:"test"},{title:"test2"}], //domainSoldList1 : [{title:"test"},{title:"test2"}],//买标信息一览(最新11条,首页只表示最新的) datas : { domainArticleList : [],//sidebar信息一览(最新5条)12.31 timeStamp: 0, tmp : { currentClientId : null, newDate : new Date() }, userinfo : { id : "" } }, }); // 初始化动作 $(function(){ avalon.scan(); //TODO }); //sidebar信息一览(最新5条)12.31 var interval_GbjArticle_status_check = function() { //var v = window.location.href.split("?")[1].substring(3,35); //alert(u); var count = 5;//首页最多显示11条 //var id= v; $.post( "polling/GbjArticle.json", { count : count //参数1,检索的limit条数 // id:id }, function(res) { if (res.type == "success") { //vm.datas.domainArticleList.clear(); vm.datas.domainArticleList.pushArray(res.data.GbjArticle); timeout_GbjArticle = setTimeout(interval_GbjArticle_status_check, 30000); //30秒自动刷新一次 } } ); } interval_GbjArticle_status_check();
/*global jQuery */ /*jshint browser:true */ /*! * FitVids 1.1 * * Copyright 2013, Chris Coyier - https://css-tricks.com + Dave Rupert - https://daverupert.com * Credit to Thierry Koblentz - https://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/ * Released under the WTFPL license - https://sam.zoy.org/wtfpl/ * */ (function($) { "use strict"; $.fn.fitVids = function(options) { var settings = { customSelector: null, ignore: null }; if (!document.getElementById('fit-vids-style')) { // appendStyles: https://github.com/toddmotto/fluidvids/blob/master/dist/fluidvids.js var head = document.head || document.getElementsByTagName('head')[0]; var css = '.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}'; var div = document.createElement('div'); div.innerHTML = '<p>x</p><style id="fit-vids-style">' + css + '</style>'; head.appendChild(div.childNodes[1]); } if (options) { $.extend(settings, options); } return this.each(function() { var selectors = [ "iframe[src*='player.vimeo.com']", "iframe[src*='youtube.com']", "iframe[src*='youtube-nocookie.com']", "iframe[src*='kickstarter.com'][src*='video.html']", "object", "embed" ]; if (settings.customSelector) { selectors.push(settings.customSelector); } var ignoreList = '.fitvidsignore'; if (settings.ignore) { ignoreList = ignoreList + ', ' + settings.ignore; } var $allVideos = $(this).find(selectors.join(',')); $allVideos = $allVideos.not("object object"); // SwfObj conflict patch $allVideos = $allVideos.not(ignoreList); // Disable FitVids on this video. $allVideos.each(function() { var $this = $(this); if ($this.parents(ignoreList).length > 0) { return; // Disable FitVids on this video. } if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; } if ((!$this.css('height') && !$this.css('width')) && (isNaN($this.attr('height')) || isNaN($this.attr('width')))) { $this.attr('height', 9); $this.attr('width', 16); } var height = (this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10)))) ? parseInt($this.attr('height'), 10) : $this.height(), width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(), aspectRatio = height / width; if (!$this.attr('id')) { var videoID = 'fitvid' + Math.floor(Math.random() * 999999); $this.attr('id', videoID); } $this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100) + "%"); $this.removeAttr('height').removeAttr('width'); }); }); }; // Works with either jQuery or Zepto })(window.jQuery || window.Zepto);
/* * nodekit.io * * Copyright (c) 2016 OffGrid Networks. 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. */ /* * D E F A U L T A P P L I C A T I O N * * Simple http response server to display default.html * */ console.log("STARTING DEFAULT APPLICATION"); var fs = require('fs'); var path = require('path'); var server = io.nodekit.electro.protocol.createServer('node:', function (request, response) { console.log("EXECUTING DEFAULT APPLICATION"); var file = path.resolve(__dirname, 'default.html'); fs.readFile(file, function read(err, content) { if (err) { console.log(err); response.writeHead(500, { 'Content-Type': 'text/html' }); response.end('<html><body>An internal server error occurred</body>', 'utf-8'); } else { response.writeHead(200, { 'Content-Type': 'text/html' }); response.end(content, 'utf-8'); } }); }); server.listen(); console.log("Server running");
define({ root:({ mode: "Mode", saveToPortal: "Save to Portal", saveToDisk: "Save To Disk", title: "Title", description: "Description", tags: "Tags", defineExtent: "Define Extent", submit: "Submit", pixelSize: "Pixel Size", outputSpatialReference: "Output Spatial Reference", currentRenderer: "Current Renderer", note: "Note", currentRendererChecked: "If Current Renderer is checked, the rendering", originalDataValues: "is exported, else the original data values", exported: "will be exported.", export: "Export", exportImage: "Export Image", layerSaved: "Layer saved.", error: "Error! ", errorNotification: "Error! No Imagery Layer visible on the map.", utmZone: "WGS84 UTM Zone ", WKID: "WKID : ", webMercatorAs: "WebMercatorAS", default: "Default", pixelSizeRestricted: "PixelSize of export is restricted to ", thisExtent: " for this extent.", errorPixelSize: "Error! No Imagery Layer visible on the map.", layer: "Layer", exportLayerMsg: "No visible imagery layers on the map." }), "ar": 1, "fr": 1 });
var express= require('express'), path= require('path'), bodyParser = require('body-parser'), routes = require('./server/config/routes'), app= express(); app.use(bodyParser.json()); routes(app); app.use('/', express.static(path.join(__dirname, 'client'))); app.listen(8080); console.log('listening on 8080');
/** * * Online store PWA sample. * 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 * * 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 * */ import initApp from './app.js'; import {instance as router} from './router'; initApp(); router.loadCurrentRoute();
exports.definition = { config: { columns: { title: "text", attachments: "text" }, adapter: { type: "sql", collection_name: "works", idAttribute: "_id" } }, extendModel: function(Model) { _.extend(Model.prototype, { initialize: function(data) { data && data.cover && data.cover.thumbs && data.cover.thumbs.m && this.set("cover_m", data.cover.thumbs.m); return this; } }); return Model; }, extendCollection: function(Collection) { _.extend(Collection.prototype, {}); return Collection; } }; var Alloy = require("alloy"), _ = require("alloy/underscore")._, model, collection; model = Alloy.M("works", exports.definition, []); collection = Alloy.C("works", exports.definition, model); exports.Model = model; exports.Collection = collection;
/** * @license Copyright 2018 The Lighthouse 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. */ 'use strict'; module.exports = { collectCoverage: false, coverageReporters: ['none'], collectCoverageFrom: [ '**/lighthouse-core/**/*.js', '**/lighthouse-cli/**/*.js', '**/lighthouse-viewer/**/*.js', ], coveragePathIgnorePatterns: [ '/test/', '/scripts/', ], setupFilesAfterEnv: ['./lighthouse-core/test/test-utils.js'], testEnvironment: 'node', testMatch: [ '**/lighthouse-core/**/*-test.js', '**/lighthouse-cli/**/*-test.js', '**/lighthouse-viewer/**/*-test.js', '**/lighthouse-viewer/**/*-test-pptr.js', '**/clients/test/**/*-test.js', '**/docs/**/*.test.js', ], };
/** * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0 */ define(['require', 'elementUtils'], function (require, ElementUtils) { /** * @class Trigger * @constructor * @class Trigger Creates a Trigger * @param {Object} options Rendering options for the view */ var Trigger = function (options) { /* Data storing structure as follows id*: '', previousCommentSegment:'', name*: '', at*: ‘’, atEvery*: '', annotationList: [annotation1, annotation2, ...] */ if (options !== undefined) { this.id = options.id; this.previousCommentSegment = options.previousCommentSegment; this.name = options.name; this.criteria = options.criteria; this.criteriaType = options.criteriaType; } this.annotationList = []; }; Trigger.prototype.addAnnotation = function (annotation) { this.annotationList.push(annotation); }; Trigger.prototype.clearAnnotationList = function () { ElementUtils.prototype.removeAllElements(this.annotationList); }; Trigger.prototype.getId = function () { return this.id; }; Trigger.prototype.getName = function () { return this.name; }; Trigger.prototype.getCriteria = function () { return this.criteria; }; Trigger.prototype.getCriteriaType = function () { return this.criteriaType; }; Trigger.prototype.getAnnotationList = function () { return this.annotationList; }; Trigger.prototype.setId = function (id) { this.id = id; }; Trigger.prototype.setName = function (name) { this.name = name; }; Trigger.prototype.setCriteria = function (criteria) { this.criteria = criteria; }; Trigger.prototype.setCriteriaType = function (criteriaType) { this.criteriaType = criteriaType; }; Trigger.prototype.setAnnotationList = function (annotationList) { this.annotationList = annotationList; }; return Trigger; });
var express = require('express'); var app = express(); var request = require("request"); var bodyParser = require('body-parser'); app.use(express.static(__dirname+"/public")); app.use(express.static(__dirname+"/bower_components")); app.use(bodyParser.json()); app.use(function(req, res, next) { res.header("Access-Control-Allow-Origin", "*"); res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); next(); }); app.get('/getNames', function(req, res) { request({ url: 'http://localhost:8080/names.min.json', json: true }, function (error, response, body) { if (!error && response.statusCode === 200) res.send(body); }); }); app.use(function(req, res) { // Use res.sendfile, as it streams instead of reading the file into memory. res.sendFile(__dirname + '/public/index.html'); }); app.listen(666); console.log(__dirname); console.log('running server at 666');
/*! UIkit 2.27.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */ (function (UI) { "use strict"; UI.component('cover', { defaults: { automute: true }, boot: function () { // auto init UI.ready(function (context) { UI.$('[data-uk-cover]', context).each(function () { var ele = UI.$(this); if (!ele.data('cover')) { var plugin = UI.cover(ele, UI.Utils.options(ele.attr('data-uk-cover'))); } }); }); }, init: function () { this.parent = this.element.parent(); UI.$win.on('load resize orientationchange', UI.Utils.debounce(function () { this.check(); }.bind(this), 100)); this.on('display.uk.check', function (e) { if (this.element.is(':visible')) this.check(); }.bind(this)); this.check(); if (this.element.is('iframe') && this.options.automute) { var src = this.element.attr('src'); this.element.attr('src', '').on('load', function () { this.contentWindow.postMessage('{ "event": "command", "func": "mute", "method":"setVolume", "value":0}', '*'); }).attr('src', [src, (src.indexOf('?') > -1 ? '&' : '?'), 'enablejsapi=1&api=1'].join('')); } }, check: function () { this.element.css({width: '', height: ''}); this.dimension = {w: this.element.width(), h: this.element.height()}; if (this.element.attr('width') && !isNaN(this.element.attr('width'))) { this.dimension.w = this.element.attr('width'); } if (this.element.attr('height') && !isNaN(this.element.attr('height'))) { this.dimension.h = this.element.attr('height'); } this.ratio = this.dimension.w / this.dimension.h; var w = this.parent.width(), h = this.parent.height(), width, height; // if element height < parent height (gap underneath) if ((w / this.ratio) < h) { width = Math.ceil(h * this.ratio); height = h; // element width < parent width (gap to right) } else { width = w; height = Math.ceil(w / this.ratio); } this.element.css({width: width, height: height}); } }); })(UIkit);
import svelte from 'rollup-plugin-svelte'; import resolve from 'rollup-plugin-node-resolve'; import commonjs from 'rollup-plugin-commonjs'; import livereload from 'rollup-plugin-livereload'; import { terser } from 'rollup-plugin-terser'; import copy from 'rollup-plugin-cpy' const production = !process.env.ROLLUP_WATCH; // 1. If in production, we build the App.svelte component that would be injected into the parent application host // 2. If in development, we build the stand alone main.js entry which would be used inside stand alone index.html const inputFile = production ? 'src/App.svelte' : 'src/main.js'; // 1. If in production, we build an EcmaScript bundle.mjs module // 2. If in development, we build a standard Javascript bundle.js const outputFile = production ? 'public/bundle.mjs' : 'public/bundle.js'; export default { input: inputFile, output: { sourcemap: true, // In production, we build an EcmaScript module (ESM) // In development, we build an Immediately Invoked Function Expression (IIFE) format: production ? 'esm' : 'iife', name: 'app', file: outputFile }, plugins: [ svelte({ // enable run-time checks when not in production dev: !production, // we'll extract any component CSS out into // a separate file — better for performance css: css => { css.write('public/bundle.css'); } }), // If you have external dependencies installed from // npm, you'll most likely need these plugins. In // some cases you'll need additional configuration — // consult the documentation for details: // https://github.com/rollup/rollup-plugin-commonjs resolve(), commonjs(), // Watch the `public` directory and refresh the // browser on changes when not in production !production && livereload('public'), // If we're building for production (npm run build // instead of npm run dev), minify production && terser(), // TODO! Only copy at build time production && copy({ // Copy EcmaScript modules and dependent resources from public folder files: ['public/*.mjs', 'public/*.mjs.map', 'public/bundle.css', 'public/*.css.map'], // To external folder static-apps from where the parent application host can load it dest: '../../static-apps/hello-world', options: { verbose: true } }) ] };
var debug = false; var isStatsOn = false; var authWindow; var app; var runLoop = function() { app.update(); app.draw(); } var initApp = function() { if (app!=null) { return; } app = new App({}, document.getElementById('canvas')); window.addEventListener('resize', app.resize, false); document.addEventListener('mousemove', app.mousemove, false); document.addEventListener('mousedown', app.mousedown, false); document.addEventListener('mouseup', app.mouseup, false); document.addEventListener('touchstart', app.touchstart, false); document.addEventListener('touchend', app.touchend, false); document.addEventListener('touchcancel', app.touchend, false); document.addEventListener('touchmove', app.touchmove, false); document.addEventListener('keydown', app.keydown, false); document.addEventListener('keyup', app.keyup, false); /** document.getElementById('authorize-user-button').addEventListener('click', function(e) { app.authorize(null,null); authWindow = window.open("auth.html","","width=950,height=460,menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes')") return false; },false); */ setInterval(runLoop,30); } var forceInit = function() { initApp() document.getElementById('unsupported-browser').style.display = "none"; return false; } if(Modernizr.canvas && Modernizr.websockets) { initApp(); } else { document.getElementById('unsupported-browser').style.display = "block"; document.getElementById('force-init-button').addEventListener('click', forceInit, false); } var addStats = function() { if (isStatsOn) { return; } // Draw fps var stats = new Stats(); document.getElementById('fps').appendChild(stats.domElement); setInterval(function () { stats.update(); }, 1000/60); // Array Remove - By John Resig (MIT Licensed) Array.remove = function(array, from, to) { var rest = array.slice((to || from) + 1 || array.length); array.length = from < 0 ? array.length + from : from; return array.push.apply(array, rest); }; isStatsOn = true; } //document.addEventListener('keydown',function(e) { // if(e.which == 27) { // addStats(); // } //}) if(debug) { addStats(); } $(function() { $('a[rel=external]').click(function(e) { e.preventDefault(); window.open($(this).attr('href')); }); }); document.body.onselectstart = function() { return false; }
$(document).ready(function(){ $('#bx1').bxSlider(); $('#bx2').bxSlider({ hideControlOnEnd: true, captions: true, pager: false }) $('#bx3').bxSlider({ hideControlOnEnd: true, minSlides: 3, maxSlides: 3, slideWidth: 360, slideMargin: 10, pager: false, nextSelector: '#bx-next', prevSelector: '#bx-prev', nextText: '>', prevText: '<' }) $('#bx4').bxSlider({ hideControlOnEnd: true, minSlides: 4, maxSlides: 4, slideWidth: 360, slideMargin: 10, pager: false, nextSelector: '#bx-next4', prevSelector: '#bx-prev4', nextText: '>', prevText: '<', }) $('#bx5').bxSlider({ minSlides: 2, maxSlides: 3, slideWidth: 360, slideMargin: 10, pager: false, ticker: true, speed: 12000, tickerHover: true, useCSS: false }) });
var searchData= [ ['utils',['utils',['../classsrc_1_1tests_1_1utils_1_1utils_1_1utils.html',1,'src::tests::utils::utils']]] ];
const readdirp = require('readdirp'), path = require('path'), fs = require('graceful-fs'), _ = require('lodash'), frontMatterParser = require('./parsers/front_matter_parser'), markdownParser = require('./parsers/markdown_parser'), fileParser = require('./parsers/file_parser'), linkParser = require('./parsers/link_parser'), linkAttributeParser = require('./parsers/link_attribute_parser'), parsers = [ frontMatterParser, markdownParser, fileParser, linkAttributeParser ], directoryFilters = ['!node_modules', '!lib', '!Archive'], fileFilters = '*.md', F = { failed: null }, Ignored = { files: [] }; function loadIgnored() { let err, files; try { files = fs.readFileSync('../commit_analyzer_ignore.txt', 'utf-8'); files = files.split('\n'); console.log("\n\nIgnoring " + (files.join(', '))); return _.each(files, function(file) { return Ignored.files.push(file); }); } catch (error) { err = error; return console.log("\n\nunable to find commit_analyzer_ignore.txt file; not ignoring any files...\n\n"); } } function readOpts() { return { root: path.join(__dirname, '..'), fileFilter: fileFilters, directoryFilter: directoryFilters }; } function fileIsIgnored(file) { return _.indexOf(Ignored.files, file) >= 0; } function analyze() { loadIgnored(); return readdirp( readOpts(), function(file) { if (fileIsIgnored(file.name)) { return; } return _.each(parsers, function(parser) { const failed = F.failed; return F.failed = parser.parse(file, failed); }); }, function(err, res) { if (F.failed) { return process.exit(1); } else { return process.exit(0); } } ); } analyze();
import React from "react"; import { TRANSACTION_STATUSES } from "../enums/transactions"; const { AWAITING_PROCESS, PROCESSING, PROCESSED } = TRANSACTION_STATUSES; const STATUS_MAP = { "Awaiting Process": AWAITING_PROCESS, Processing: PROCESSING, Processed: PROCESSED }; export default class TransactionStatusDropdown extends React.Component { constructor(props) { super(props); this.handleChange = this.handleChange.bind(this); } handleChange(event) { this.props.onChange(event.target.value); } render() { return ( <div className="bp3-select bp3-fill"> <select disabled={this.props.disabled} value={this.props.status} onChange={this.handleChange}> <option value="">Select a status</option> {Object.entries(STATUS_MAP).map(([key, value]) => { return ( <option key={value} value={value}> {key} </option> ); })} </select> </div> ); } }
// Generated by CoffeeScript 1.12.4 (function() { var BaseButtonTask, ButtonTask, extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, hasProp = {}.hasOwnProperty; BaseButtonTask = require('zooniverse-decision-tree/lib/button-task'); ButtonTask = (function(superClass) { extend(ButtonTask, superClass); function ButtonTask() { return ButtonTask.__super__.constructor.apply(this, arguments); } ButtonTask.prototype.choiceTemplate = require('../templates/choice'); return ButtonTask; })(BaseButtonTask); module.exports = ButtonTask; }).call(this);
var buf = new Buffer(39); var len = buf.write("www.baidu.com"); console.log("写入字节数为 : "+len); for(var i=13;i < 39;i++){ buf[i] = i+84; } var json = buf.toJSON(); console.log(json);
export const FLAT_TABLE_THEMES = [ "light", "dark", "transparent-base", "transparent-white", ]; export const FLAT_TABLE_SIZES = ["compact", "small", "medium", "large"];
module.exports = { 'name': 'largereq', 'category': 'Operators', 'syntax': [ 'x >= y', 'largereq(x, y)' ], 'description': 'Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.', 'examples': [ '2 > 1+1', '2 >= 1+1', 'a = 3.2', 'b = 6-2.8', '(a > b)' ], 'seealso': [ 'equal', 'unequal', 'smallereq', 'smaller', 'largereq', 'compare' ] };
/* Copyright 2016 ElasticBox All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ import './ek-instances.less'; import Directive from 'directive'; import Controller from './ek-instances.controller'; import constants from '../constants'; import template from './ek-instances.html'; class InstancesDirective extends Directive { constructor() { super({ Controller, template }); } compile(tElement) { tElement .addClass('ek-instances layout-column'); return ($scope) => _.extend($scope, constants); } } export default InstancesDirective;
import { Template } from 'meteor/templating'; import { Meteor } from 'meteor/meteor'; import { Roles } from 'meteor/alanning:roles'; import { FlowRouter } from 'meteor/kadira:flow-router'; import { $ } from 'meteor/jquery'; import { getStudentProfileMethod } from '../../../api/user/StudentProfileCollection.methods'; /* global alert */ Template.RadGrad_Login_Buttons.events({ /** * Handle the .cas-login click event. * @param event The click event. * @returns {boolean} False. * @memberOf ui/components/landing */ 'click .cas-login': function casLogin(event, instance) { event.preventDefault(); const callback = function loginCallback(error) { if (error) { console.log('Error during CAS Login: ', error); instance.$('div .ui.error.message.hidden').text('You are not yet registered. Go see your Advisor.'); instance.$('div .ui.error.message.hidden').removeClass('hidden'); } else { const { username } = Meteor.user('username'); if (!username) { alert('You must use only lower case letters in your username.'); Meteor.logout(); } const id = Meteor.userId(); let role = Roles.getRolesForUser(id)[0]; const studentp = role.toLowerCase() === 'student'; if (studentp) { getStudentProfileMethod.call(username, (err, result) => { if (err) { console.error('Failed to get profile', error); } else { if (result.isAlumni) { role = 'Alumni'; } FlowRouter.go(`/${role.toLowerCase()}/${username}/home`); } }); } FlowRouter.go(`/${role.toLowerCase()}/${username}/home`); } }; Meteor.loginWithCas(callback); return false; }, /** * Handle the .meteor-login click event, * @param event The click event. * @returns {boolean} False. * @memberOf ui/components/landing */ 'click .meteor-login': function clickOpenModal(event) { event.preventDefault(); $('.ui.modal').modal('show'); }, }); // Here's how to do the required initialization for Semantic UI dropdown menus. Template.RadGrad_Login_Buttons.onRendered(function enableDropDown() { this.$('.dropdown').dropdown({ action: 'select', }); this.$('.modal').modal({ onApprove: function foo(event) { console.log('approved', event, event.target); }, }); });
export function getCorrectFontSizeForScreen(PixelRatio, screenWidth, screenHeight, currentFont){ let devRatio = PixelRatio.get(); let factor = (((screenWidth*devRatio)/320)+((screenHeight*devRatio)/640))/2.0; let maxFontDifferFactor = 5; //the maximum pixels of font size we can go up or down if(factor<=1){ return currentFont-float2int(maxFontDifferFactor*0.3); }else if((factor>=1) && (factor<=1.6)){ return currentFont-float2int(maxFontDifferFactor*0.1); }else if((factor>=1.6) && (factor<=2)){ return currentFont; }else if((factor>=2) && (factor<=3)){ return currentFont+float2int(maxFontDifferFactor*0.65); }else if (factor>=3){ return currentFont+float2int(maxFontDifferFactor); } } function float2int (value) { return value | 0; }
'use strict' /* globals describe, test, expect, jest */ const path = require('path') // This is the module we are testing const { crawlForMovies } = require('../crawlForMovies') const crawlParams = { rootDirectory: __dirname, searchDirCb: jest.fn(), movieFileCb: jest.fn() } describe('crawlForMovies', () => { test('discovers test movies without crashing', () => { return expect(crawlForMovies(crawlParams)).resolves.toBeUndefined() }) test('calls search directory callback during crawl', () => { const testDirs = crawlParams.searchDirCb.mock.calls.map(dir => { const { name } = path.parse(dir[0]) return name }) expect(testDirs).toMatchSnapshot() }) test('calls movie file callback during crawl', () => { const movies = crawlParams.movieFileCb.mock.calls.map(file => { const { name, ext } = path.parse(file[0]) return `${name}${ext}` }) expect(movies).toMatchSnapshot() }) })
import React from 'react'; import PropTypes from 'prop-types'; import { Link } from 'react-router-dom'; import List from '../../components/List'; import UserIcon from '../../icons/User'; const Item = (props) => { const { className, item: user } = props; const classNames = ['item__container']; if (className) { classNames.push(className); } let avatar; if (user.image) { avatar = <img className="avatar" alt="avatar" src={user.image.data} />; } else { avatar = <UserIcon className="avatar" />; } return ( <Link className={classNames.join(' ')} to={`/users/${user._id}`}> <div className="item"> <span className="box--row box--static"> {avatar} <span className="item__name">{user.name}</span> </span> <span>{user.email}</span> </div> </Link> ); }; Item.propTypes = { className: PropTypes.string, item: PropTypes.shape({ administrator: PropTypes.bool, domainIds: PropTypes.arrayOf(PropTypes.string), email: PropTypes.string, }).isRequired, }; Item.defaultProps = { className: undefined, }; export default class Users extends List {} Users.defaultProps = { ...List.defaultProps, category: 'users', adminable: false, Item, path: '/users', sort: '-modified name email', title: 'People', };
/* * Kendo UI v2014.3.1119 (http://www.telerik.com/kendo-ui) * Copyright 2014 Telerik AD. All rights reserved. * * Kendo UI commercial licenses may be obtained at * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete * If you do not own a commercial license, this file shall be governed by the trial license terms. */ (function(f, define){ define([], f); })(function(){ (function( window, undefined ) { var kendo = window.kendo || (window.kendo = { cultures: {} }); kendo.cultures["pa-IN"] = { name: "pa-IN", numberFormat: { pattern: ["-n"], decimals: 2, ",": ",", ".": ".", groupSize: [3,2], percent: { pattern: ["-n %","n %"], decimals: 2, ",": ",", ".": ".", groupSize: [3,2], symbol: "%" }, currency: { pattern: ["$ -n","$ n"], decimals: 2, ",": ",", ".": ".", groupSize: [3,2], symbol: "ਰੁ" } }, calendars: { standard: { days: { names: ["ਐਤਵਾਰ","ਸੋਮਵਾਰ","ਮੰਗਲਵਾਰ","ਬੁੱਧਵਾਰ","ਵੀਰਵਾਰ","ਸ਼ੁੱਕਰਵਾਰ","ਸ਼ਨਿੱਚਰਵਾਰ"], namesAbbr: ["ਐਤ.","ਸੋਮ.","ਮੰਗਲ.","ਬੁੱਧ.","ਵੀਰ.","ਸ਼ੁਕਰ.","ਸ਼ਨਿੱਚਰ."], namesShort: ["ਐ","ਸ","ਮ","ਬ","ਵ","ਸ਼","ਸ਼"] }, months: { names: ["ਜਨਵਰੀ","ਫ਼ਰਵਰੀ","ਮਾਰਚ","ਅਪ੍ਰੈਲ","ਮਈ","ਜੂਨ","ਜੁਲਾਈ","ਅਗਸਤ","ਸਤੰਬਰ","ਅਕਤੂਬਰ","ਨਵੰਬਰ","ਦਸੰਬਰ",""], namesAbbr: ["ਜਨਵਰੀ","ਫ਼ਰਵਰੀ","ਮਾਰਚ","ਅਪ੍ਰੈਲ","ਮਈ","ਜੂਨ","ਜੁਲਾਈ","ਅਗਸਤ","ਸਤੰਬਰ","ਅਕਤੂਬਰ","ਨਵੰਬਰ","ਦਸੰਬਰ",""] }, AM: ["ਸਵੇਰ","ਸਵੇਰ","ਸਵੇਰ"], PM: ["ਸ਼ਾਮ","ਸ਼ਾਮ","ਸ਼ਾਮ"], patterns: { d: "dd-MM-yy", D: "dd MMMM yyyy dddd", F: "dd MMMM yyyy dddd tt hh:mm:ss", g: "dd-MM-yy tt hh:mm", G: "dd-MM-yy tt hh:mm:ss", m: "dd MMMM", M: "dd MMMM", s: "yyyy'-'MM'-'dd'T'HH':'mm':'ss", t: "tt hh:mm", T: "tt hh:mm:ss", u: "yyyy'-'MM'-'dd HH':'mm':'ss'Z'", y: "MMMM, yyyy", Y: "MMMM, yyyy" }, "/": "-", ":": ":", firstDay: 1 } } } })(this); return window.kendo; }, typeof define == 'function' && define.amd ? define : function(_, f){ f(); });
/* * Copyright (c) 2016 Juniper Networks, Inc. All rights reserved. */ define([ 'lodash', 'controlnode-widgetcfg', 'vrouter-widgetcfg','databasenode-widgetcfg', 'analyticsnode-widgetcfg','confignode-widgetcfg','monitor-infra-widgetcfg', 'security-dashboard-widgetcfg', 'confignode-modelcfg','controlnode-modelcfg','vrouter-modelcfg', 'databasenode-modelcfg','analyticsnode-modelcfg','monitor-infra-modelcfg', 'security-dashboard-modelcfg', 'monitor-infra-viewcfg','confignode-viewcfg', 'databasenode-viewcfg', 'vrouter-viewcfg', 'security-dashboard-viewcfg', 'alarms-viewconfig' ], function( _,ControlNodeWidgetCfg, VRouterWidgetCfg, DBNodeWidgetCfg, AnalyticsNodeWidgetCfg, CfgNodeWidgetCfg,MonitorInfraWidgetCfg, SecurityDashboardWidgetCfg, CfgNodeModelCfg,ControlNodeModelCfg,VRouterModelCfg,DatabaseNodeModelCfg, AnaltyicsNodeModelCfg,MonitorInfraModelCfg,SecurityDashboardModelCfg, MonitorInfraViewCfg,CfgNodeViewCfg, DBNodeViewCfg, VRouterViewCfg, SecurityDashboardViewConfig, AlarmsViewConfig, SecurityDashboardViewCfg ) { var widgetCfgManager = function() { var self = this; var widgetCfgMap = {}, widgetViewCfgMap = {}, widgetModelCfgMap = {}; //Populate the available widget config maps $.extend(widgetCfgMap, ControlNodeWidgetCfg, VRouterWidgetCfg, DBNodeWidgetCfg, AnalyticsNodeWidgetCfg, CfgNodeWidgetCfg,MonitorInfraWidgetCfg, SecurityDashboardWidgetCfg); //Populate the available model config maps $.extend(widgetModelCfgMap, CfgNodeModelCfg,ControlNodeModelCfg,VRouterModelCfg, DatabaseNodeModelCfg,AnaltyicsNodeModelCfg,MonitorInfraModelCfg, SecurityDashboardModelCfg); $.extend(widgetViewCfgMap, MonitorInfraViewCfg, CfgNodeViewCfg, DBNodeViewCfg, VRouterViewCfg, SecurityDashboardViewConfig, AlarmsViewConfig, SecurityDashboardViewCfg); //,ControlNodeViewCfg,VRouterViewCfg,DatabaseNodeViewCfg,AnaltyicsNodeViewCfg,); self.get = function(widgetId,overrideCfg,i) { var widgetCfg = _.isFunction(widgetCfgMap[widgetId]) ? widgetCfgMap[widgetId](overrideCfg,i) : widgetCfgMap[widgetId]; if (widgetCfg == null) { widgetCfg = _.isFunction(widgetViewCfgMap[widgetId]) ? widgetViewCfgMap[widgetId](overrideCfg) : widgetViewCfgMap[widgetId]; } var modelCfg = {},viewCfg = {},baseModelCfg; if(widgetCfg['baseModel'] != null) { baseModelCfg = widgetModelCfgMap[widgetCfg['baseModel']]; if(widgetCfg['modelCfg'] != null) { $.extend(true,modelCfg,baseModelCfg,widgetCfg['modelCfg']) } else { modelCfg = baseModelCfg; } if(_.result(baseModelCfg,'type','')) { widgetCfg['tag'] = baseModelCfg['type']; } widgetCfg['modelCfg'] = modelCfg; } if(_.result(widgetCfg,'modelCfg.type','')) { widgetCfg['tag'] = _.result(widgetCfg,'modelCfg.type'); } if(widgetCfg['baseView'] != null) { baseViewCfg = widgetViewCfgMap[widgetCfg['baseView']]; if(widgetCfg['viewCfg'] != null) { $.extend(true,viewCfg,baseViewCfg,widgetCfg['viewCfg']) } else { viewCfg= baseViewCfg; } widgetCfg['viewCfg'] = viewCfg; } return widgetCfg; } //Returns list of available widgets self.getWidgetList = function() { // return _.keys(widgetCfgMap); var widgetMap = _.map(_.keys(widgetCfgMap),function(widgetId) { return { key: widgetId, value: self.get(widgetId), tag: self.get(widgetId)['tag'] } }); widgetMap = _.groupBy(widgetMap,function(d) { return d.tag; }); //Pick yAxisLabel if exists else return widgetId return _.map(widgetMap,function(value,key) { return { text: key, children: _.map(value, function(widgetCfg) { return { id:widgetCfg['key'], text:_.result(widgetCfg['value'],'viewCfg.viewConfig.chartOptions.yAxisLabel',widgetCfg['key']) } }) // val:_.result(widgetCfg['value'],'viewCfg.viewConfig.chartOptions.yAxisLabel',widgetCfg['key']) } }); } self.modelInstMap = {}; } return new widgetCfgManager(); });
import React from 'react' import { connect } from 'react-redux' import { Timeline, Alert } from 'antd' const Item = Timeline.Item @connect(state => ({ stage: state.config.stage, news: state.config.news, timeline: state.config.timeline })) class Events extends React.Component { render ( { news, timeline, endorsements } = this.props ) { let past = Array.isArray(timeline) ? timeline.slice() : [] let future = past.pop() return ( <div> <Alert type='info' showIcon banner message='Weekly Meetings' description={<ul> <li>Every Monday</li> <li>3:30-5:30PM</li> <li>HUB 303</li> </ul>} /> <h2>Announcements</h2> <p>{news || 'No news for now.'}</p> {past && future ? <Timeline pending={future}> {past.map((e, i) => ( <Item key={i} color='green'>{e}</Item> ))} </Timeline> : <em>We are currently developing our schedule.</em> } </div> ) } } export default Events
/* * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * 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. */ /** * External dependencies */ import { useCallback } from '@googleforcreators/react'; import { __ } from '@googleforcreators/i18n'; import { trackEvent } from '@googleforcreators/tracking'; import { Icons } from '@googleforcreators/design-system'; import { STORY_ANIMATION_STATE } from '@googleforcreators/animation'; /** * Internal dependencies */ import { useStory } from '../../../app'; import PageMenuButton from './pageMenuButton'; function AnimationToggle() { const { animationState, updateAnimationState } = useStory( ({ state: { animationState }, actions: { updateAnimationState } }) => { return { animationState, updateAnimationState, }; } ); const isPlaying = [ STORY_ANIMATION_STATE.PLAYING, STORY_ANIMATION_STATE.PLAYING_SELECTED, ].includes(animationState); const tooltip = isPlaying ? __('Stop', 'web-stories') : __('Play', 'web-stories'); const label = isPlaying ? __('Stop Page Animations', 'web-stories') : __('Play Page Animations', 'web-stories'); const shortcut = 'mod+k'; const Icon = isPlaying ? Icons.StopOutline : Icons.PlayOutline; const toggleAnimationState = useCallback(() => { updateAnimationState({ animationState: isPlaying ? STORY_ANIMATION_STATE.RESET : STORY_ANIMATION_STATE.PLAYING, }); trackEvent('canvas_play_animations', { status: isPlaying ? 'stop' : 'play', }); }, [isPlaying, updateAnimationState]); return ( <PageMenuButton title={tooltip} shortcut={shortcut} onClick={toggleAnimationState} aria-label={label} > <Icon /> </PageMenuButton> ); } export default AnimationToggle;
/** * @description CoatCheck SVG Icon. * @property {string} a11yTitle - Accessibility Title. If not set uses the default title of the status icon. * @property {string} colorIndex - The color identifier to use for the stroke color. * If not specified, this component will default to muiTheme.palette.textColor. * @property {xsmall|small|medium|large|xlarge|huge} size - The icon size. Defaults to small. * @property {boolean} responsive - Allows you to redefine what the coordinates. * @example * <svg width="24" height="24" ><path d="M12,11 L22.1551134,17.4623449 C22.6217314,17.7592836 23,18.4433532 23,19.0093689 L23,20.9906311 C23,21.5480902 22.5605417,22 21.9975383,22 L2.00246167,22 C1.44881738,22 1,21.5566468 1,20.9906311 L1,19.0093689 C1,18.4519098 1.3786449,17.7590442 1.84488659,17.4623449 L12,11 Z M15,5 C15,3.34314575 13.6568542,2 12,2 C10.3431458,2 9,3.34314575 9,5 C9,5.93157601 9.41137234,6.80169553 10.0908534,7.31422922 C11,8 12,8 12,9.5 L12,11"/></svg> */ // (C) Copyright 2014-2015 Hewlett Packard Enterprise Development LP import React, { Component } from 'react'; import PropTypes from 'prop-types'; import classnames from 'classnames'; import CSSClassnames from '../../../utils/CSSClassnames'; import Intl from '../../../utils/Intl'; import Props from '../../../utils/Props'; const CLASS_ROOT = CSSClassnames.CONTROL_ICON; const COLOR_INDEX = CSSClassnames.COLOR_INDEX; export default class Icon extends Component { render () { const { className, colorIndex } = this.props; let { a11yTitle, size, responsive } = this.props; let { intl } = this.context; const classes = classnames( CLASS_ROOT, `${CLASS_ROOT}-coat-check`, className, { [`${CLASS_ROOT}--${size}`]: size, [`${CLASS_ROOT}--responsive`]: responsive, [`${COLOR_INDEX}-${colorIndex}`]: colorIndex } ); a11yTitle = a11yTitle || Intl.getMessage(intl, 'coat-check'); const restProps = Props.omit(this.props, Object.keys(Icon.propTypes)); return <svg {...restProps} version="1.1" viewBox="0 0 24 24" width="24px" height="24px" role="img" className={classes} aria-label={a11yTitle}><path fill="none" stroke="#000" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M12,11 L22.1551134,17.4623449 C22.6217314,17.7592836 23,18.4433532 23,19.0093689 L23,20.9906311 C23,21.5480902 22.5605417,22 21.9975383,22 L2.00246167,22 C1.44881738,22 1,21.5566468 1,20.9906311 L1,19.0093689 C1,18.4519098 1.3786449,17.7590442 1.84488659,17.4623449 L12,11 Z M15,5 C15,3.34314575 13.6568542,2 12,2 C10.3431458,2 9,3.34314575 9,5 C9,5.93157601 9.41137234,6.80169553 10.0908534,7.31422922 C11,8 12,8 12,9.5 L12,11"/></svg>; } }; Icon.contextTypes = { intl: PropTypes.object }; Icon.defaultProps = { responsive: true }; Icon.displayName = 'CoatCheck'; Icon.icon = true; Icon.propTypes = { a11yTitle: PropTypes.string, colorIndex: PropTypes.string, size: PropTypes.oneOf(['xsmall', 'small', 'medium', 'large', 'xlarge', 'huge']), responsive: PropTypes.bool };
/* * ! ${copyright} */ // Provides control sap.m.P13nSelectionItem. sap.ui.define([ 'jquery.sap.global', './library', 'sap/ui/core/Item' ], function(jQuery, library, Item) { "use strict"; /** * Constructor for a new P13nSelectionItem. * * @param {string} [sId] ID for the new control, generated automatically if no ID is given * @param {object} [mSettings] initial settings for the new control * @class Type for <code>selectionItems</code> aggregation in <code>P13nSelectionPanel</code> control. * @extends sap.ui.core.Item * @version ${version} * @constructor * @author SAP SE * @private * @since 1.46.0 * @alias sap.m.P13nSelectionItem * @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel */ var P13nSelectionItem = Item.extend("sap.m.P13nSelectionItem", /** @lends sap.m.P13nSelectionItem.prototype */ { metadata: { library: "sap.m", properties: { /** * Defines the unique table column key. */ columnKey: { type: "string", defaultValue: undefined }, /** * Defines the index of a table column. */ index: { type: "int", defaultValue: -1 }, /** * Defines whether the <code>P13nSelectionItem</code> is selected. */ selected: { type: "boolean", defaultValue: false } } } }); return P13nSelectionItem; }, /* bExport= */true);
/******************************************************************************** * Ledger Node JS API * (c) 2016-2017 Ledger * * 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 runTest(comm, ledger, timeout) { return comm.create_async(timeout, true).then(function (comm) { var eth = new ledger.eth(comm); return eth.signPersonalMessage_async("44'/60'/0'/0'/0", Buffer.from('test').toString('hex')).then(function (result) { var v = result['v'] - 27; v = v.toString(16); if (v.length < 2) { v = "0" + v; } console.log("Signature 0x" + result['r'] + result['s'] + v); }) }) } module.exports = runTest;
var params = { title: 'Hello Dynamic :-)', resourcesPath: portal.url.createResourceUrl('') }; var body = system.thymeleaf.render('view/page.html', params); portal.response.contentType = 'text/html'; portal.response.body = body;
/* * Twitter Search Plugin jquery.retina.js * https://github.com/tylercraft/jQuery-Retina * * Copyright (c) 2012 tylercraft.com * Author: Tyler Craft * Dual licensed under the MIT and GPL licenses. * https://github.com/tylercraft/jQuery-Retina * */ (function( $ ) { $.fn.retina = function( options ) { var settings = { // Check for data-retina attribute. If exists, swap out image dataRetina: true, // Suffix to append to image file name suffix: "", // Check if image exists before swapping out checkIfImageExists: false, // Callback function if custom logic needs to be // applied to image file name customFileNameCallback: "", // override window.devicePixelRatio overridePixelRation: false }; if(options){ jQuery.extend(settings,options); } var retinaEnabled = false; // If retina enabled only if(settings.overridePixelRation || window.devicePixelRatio >= 1.2) { retinaEnabled = true; } // Begin to iterate over the jQuery collection that the method was called on return this.each(function () { // Cache `this` var $this = $(this); $this.addClass('retina-off'); if(!retinaEnabled){ return false; } var newImageSrc = ''; // Get data-retina attribute if(settings.dataRetina && $this.attr('data-retina')){ newImageSrc = $this.attr('data-retina'); } if(settings.suffix){ // If there is a data-retina attribute, suffix that // Otherwise, suffix the primary image if(!newImageSrc){ newImageSrc = $this.attr('src'); } } if(settings.suffix){ // Get filename sans extension var baseFileName = newImageSrc.replace(/.[^.]+$/,''); var baseFileExtension = newImageSrc.replace(/^.*\./,''); newImageSrc = baseFileName + settings.suffix + '.' + baseFileExtension; } if(settings.customFileNameCallback){ newImageSrc = settings.customFileNameCallback($this); } if(settings.checkIfImageExists && newImageSrc){ $.ajax({url: newImageSrc, type: "HEAD", success: function() { $this.attr('src',newImageSrc); $this.removeClass('retina-off'); $this.addClass('retina-on'); }}); }else if(newImageSrc){ $this.attr('src',newImageSrc); $this.removeClass('retina-off'); $this.addClass('retina-on'); } }); }; }(jQuery));
var structofp13__meter__band__dscp__remark = [ [ "burst_size", "structofp13__meter__band__dscp__remark.html#a65ae2e874c730303bbc5d780640f7fc9", null ], [ "len", "structofp13__meter__band__dscp__remark.html#ad56aaad8bcc7a48f6f2328ff81b0d67f", null ], [ "pad", "structofp13__meter__band__dscp__remark.html#a5e621372646568aa14544869bbbdcf46", null ], [ "prec_level", "structofp13__meter__band__dscp__remark.html#a753ecc92ac6a4685c02baa954acee8aa", null ], [ "rate", "structofp13__meter__band__dscp__remark.html#a1087876e1f2f5eacbb785424dad28347", null ], [ "type", "structofp13__meter__band__dscp__remark.html#a6837249197a1667e26a848d4870ebaff", null ] ];
/* * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * 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. */ /** * External dependencies */ import { visitDashboard } from '@web-stories-wp/e2e-test-utils'; describe('Admin Menu', () => { // eslint-disable-next-line jest/no-disabled-tests -- broken by https://github.com/googleforcreators/web-stories-wp/pull/7213, needs updating. it.skip('should sync the WP nav with the dashboard nav', async () => { await visitDashboard(); // Initial visit to `/` makes `Dashboard` link current in WP await page.hover('#menu-posts-web-story'); await expect(page.$('#menu-posts-web-story .current a')).resolves.toMatch( 'Dashboard' ); await page.hover('[aria-label="Main dashboard navigation"]'); // Navigating through the application to a new page syncs the WP current page in Nav await page.waitForTimeout(100); await Promise.all([ page.waitForNavigation(), expect(page).toClick('[aria-label="Main dashboard navigation"] a', { text: 'Explore Templates', }), ]); await page.waitForTimeout(100); await page.hover('#menu-posts-web-story'); await expect(page.$('#menu-posts-web-story .current a')).resolves.toMatch( 'Explore Templates' ); await page.hover('[aria-label="Main dashboard navigation"]'); // Navigating through WP to a new page syncs the WP current page in Nav await page.hover('#menu-posts-web-story'); await page.waitForTimeout(100); await Promise.all([ page.waitForNavigation(), expect(page).toClick('#menu-posts-web-story a', { text: 'Settings', }), ]); await page.waitForTimeout(100); await expect(page.$('#menu-posts-web-story .current a')).resolves.toMatch( 'Settings' ); // await page.hover('[aria-label="Main dashboard navigation"]'); // Navigating through application back to My Story from another route await page.waitForTimeout(100); await Promise.all([ page.waitForNavigation(), expect(page).toClick('[aria-label="Main dashboard navigation"] a', { text: 'Dashboard', }), ]); await page.waitForTimeout(100); await page.hover('#menu-posts-web-story'); await expect(page.$('#menu-posts-web-story .current a')).resolves.toMatch( 'Dashboard' ); }); });
/* eslint camelcase: "off" */ /* eslint angular/angularelement: "off" */ (function() { 'use strict'; angular.module('app.services') .factory('DialogFieldRefresh', ['lodash', 'CollectionsApi', 'EventNotifications', DialogFieldRefreshFactory]); /** @ngInject */ function DialogFieldRefreshFactory(lodash, CollectionsApi, EventNotifications) { var service = { listenForAutoRefreshMessages: listenForAutoRefreshMessages, refreshSingleDialogField: refreshSingleDialogField, setupDialogData: setupDialogData, triggerAutoRefresh: triggerAutoRefresh, }; return service; function listenForAutoRefreshMessages(allDialogFields, autoRefreshableDialogFields, url, resourceId) { var listenerFunction = function(event) { var dialogFieldsToRefresh = autoRefreshableDialogFields.filter(function(fieldName) { if (event.originalEvent.data.fieldName !== fieldName) { return fieldName; } }); allDialogFields.forEach(function(dialogField) { if (lodash.includes(dialogFieldsToRefresh, dialogField.name)) { dialogField.beingRefreshed = true; } }); if (dialogFieldsToRefresh !== []) { refreshMultipleDialogFields(allDialogFields, dialogFieldsToRefresh, url, resourceId); } }; $(window).off('message'); // Unbind all previous message listeners $(window).on('message', listenerFunction); } function refreshSingleDialogField(allDialogFields, dialogField, url, resourceId) { function refreshSuccess(result) { var resultObj = result.result[dialogField.name]; updateAttributesForDialogField(dialogField, resultObj); triggerAutoRefresh(dialogField); } function refreshFailure(result) { EventNotifications.error('There was an error refreshing this dialog: ' + result); } dialogField.beingRefreshed = true; fetchDialogFieldInfo(allDialogFields, [dialogField.name], url, resourceId, refreshSuccess, refreshFailure); } function selectDefaultValue(dialogField, newDialogField) { if (angular.isObject(newDialogField.values)) { dialogField.values = newDialogField.values; if (angular.isDefined(newDialogField.default_value) && newDialogField.default_value !== null) { dialogField.default_value = newDialogField.default_value; } else { dialogField.default_value = newDialogField.values[0][0]; } } else { if (dialogField.type === 'DialogFieldDateControl' || dialogField.type === 'DialogFieldDateTimeControl') { dialogField.default_value = new Date(newDialogField.values); } else { if (angular.isUndefined(newDialogField.default_value) || newDialogField.default_value === null || newDialogField.default_value === '') { dialogField.default_value = newDialogField.values; } } } } function setupDialogData(dialogs, allDialogFields, autoRefreshableDialogFields) { angular.forEach(dialogs, function(dialog) { angular.forEach(dialog.dialog_tabs, function(dialogTab) { angular.forEach(dialogTab.dialog_groups, function(dialogGroup) { angular.forEach(dialogGroup.dialog_fields, function(dialogField) { allDialogFields.push(dialogField); selectDefaultValue(dialogField, dialogField); dialogField.triggerAutoRefresh = function() { triggerAutoRefresh(dialogField); }; if (dialogField.auto_refresh === true) { autoRefreshableDialogFields.push(dialogField.name); } }); }); }); }); } function triggerAutoRefresh(dialogField) { if (dialogField.trigger_auto_refresh === true) { parent.postMessage({fieldName: dialogField.name}, '*'); } } // Private function refreshMultipleDialogFields(allDialogFields, fieldNamesToRefresh, url, resourceId) { function refreshSuccess(result) { angular.forEach(allDialogFields, function(dialogField) { if (fieldNamesToRefresh.indexOf(dialogField.name) > -1) { var resultObj = result.result[dialogField.name]; updateAttributesForDialogField(dialogField, resultObj); } }); } function refreshFailure(result) { EventNotifications.error('There was an error automatically refreshing dialogs' + result); } fetchDialogFieldInfo(allDialogFields, fieldNamesToRefresh, url, resourceId, refreshSuccess, refreshFailure); } function updateAttributesForDialogField(dialogField, newDialogField) { copyDynamicAttributes(dialogField, newDialogField); selectDefaultValue(dialogField, newDialogField); dialogField.beingRefreshed = false; function copyDynamicAttributes(currentDialogField, newDialogField) { currentDialogField.data_type = newDialogField.data_type; currentDialogField.options = newDialogField.options; currentDialogField.read_only = newDialogField.read_only; currentDialogField.required = newDialogField.required; } } function fetchDialogFieldInfo(allDialogFields, dialogFieldsToFetch, url, resourceId, successCallback, failureCallback) { CollectionsApi.post( url, resourceId, {}, angular.toJson({ action: 'refresh_dialog_fields', resource: { dialog_fields: dialogFieldInfoToSend(allDialogFields), fields: dialogFieldsToFetch, }, }) ).then(successCallback, failureCallback); } function dialogFieldInfoToSend(allDialogFields) { var fieldValues = {}; angular.forEach(allDialogFields, function(dialogField) { fieldValues[dialogField.name] = dialogField.default_value; }); return fieldValues; } } })();
var dir_449a8fc0a8176498514757a163fc6e60 = [ [ "SensorBarControl.g.cs", "_a_r_m_2_debug_2_controls_2_sensor_bar_2_sensor_bar_control_8g_8cs.html", [ [ "SensorBarControl", "class_x_labs_1_1_forms_1_1_controls_1_1_sensor_bar_control.html", "class_x_labs_1_1_forms_1_1_controls_1_1_sensor_bar_control" ] ] ], [ "SensorBarControl.g.i.cs", "_a_r_m_2_debug_2_controls_2_sensor_bar_2_sensor_bar_control_8g_8i_8cs.html", [ [ "SensorBarControl", "class_x_labs_1_1_forms_1_1_controls_1_1_sensor_bar_control.html", "class_x_labs_1_1_forms_1_1_controls_1_1_sensor_bar_control" ] ] ] ];
/** * @license Apache-2.0 * * Copyright (c) 2021 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 pow = require( '@stdlib/math/base/special/pow' ); var isArray = require( '@stdlib/assert/is-array' ); var filled = require( '@stdlib/array/base/filled' ); var abs = require( '@stdlib/math/base/special/abs' ); var pkg = require( './../package.json' ).name; var map = require( './../lib' ); // FUNCTIONS // /** * Creates a benchmark function. * * @private * @param {PositiveInteger} len - array length * @returns {Function} benchmark function */ function createBenchmark( len ) { var x = filled( -3.0, len ); return benchmark; /** * Benchmark function. * * @private * @param {Benchmark} b - benchmark instance */ function benchmark( b ) { var out; var i; b.tic(); for ( i = 0; i < b.iterations; i++ ) { out = map( x, abs ); if ( out.length !== len ) { b.fail( 'unexpected length' ); } } b.toc(); if ( !isArray( out ) ) { b.fail( 'should return an array' ); } b.pass( 'benchmark finished' ); b.end(); } } // MAIN // /** * Main execution sequence. * * @private */ function main() { var len; var min; var max; var f; var i; min = 1; // 10^min max = 6; // 10^max for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); bench( pkg+'::array:len='+len, f ); } } main();
/** * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com) */ /*jshint jquery:true*/ (function (factory) { if (typeof define === 'function' && define.amd) { define([ "jquery", "mage/validation", "mage/translate" ], factory); } else { factory(jQuery); } }(function ($) { "use strict"; /** * Validation rule for grouped product, with multiple qty fields, * only one qty needs to have a positive integer */ $.validator.addMethod( "validate-grouped-qty", function(value, element, params) { var result = false; var total = 0; $(params).find('input[data-validate*="validate-grouped-qty"]').each(function(i, e) { var val = $(e).val(); if (val && val.length > 0) { result = true; var valInt = parseInt(val, 10) || 0; if (valInt >= 0) { total += valInt; } else { result = false; return result; } } }); return result && total > 0; }, 'Please specify the quantity of product(s).' ); $.validator.addMethod( "validate-one-checkbox-required-by-name", function(value, element, params) { var checkedCount = 0; if (element.type === 'checkbox') { $('[name="' + element.name + '"]').each(function() { if ($(this).is(':checked')) { checkedCount += 1; return false; } }); } var container = '#' + params; if (checkedCount > 0) { $(container).removeClass('validation-failed'); $(container).addClass('validation-passed'); return true; } else { $(container).addClass('validation-failed'); $(container).removeClass('validation-passed'); return false; } }, 'Please select one of the options.' ); $.validator.addMethod( "validate-date-between", function(value, element, params) { var minDate = new Date(params[0]), maxDate = new Date(params[1]), inputDate = new Date(element.value); minDate.setHours(0); maxDate.setHours(0); if (inputDate >= minDate && inputDate <= maxDate) { return true; } this.dateBetweenErrorMessage = $.mage.__('Please enter a date between %min and %max.').replace('%min', minDate).replace('%max', maxDate); return false; }, function(){ return this.dateBetweenErrorMessage; } ); }));
/* * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * 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. */ export { createContext, useContext } from 'use-context-selector'; export const identity = (state) => state;
// Link.test.js - temporary example class to show unit tests working // Use React's test renderer and Jest's snapshot feature to interact // with the component and capture the rendered output and create a snapshot file import React from 'react'; import Link from '../../src/components/Link'; import renderer from 'react-test-renderer'; test('Link changes the class when hovered', () => { const component = renderer.create( <Link page="http://www.facebook.com">Facebook</Link> ); let tree = component.toJSON(); expect(tree).toMatchSnapshot(); // manually trigger the callback tree.props.onMouseEnter(); // re-rendering tree = component.toJSON(); expect(tree).toMatchSnapshot(); // manually trigger the callback tree.props.onMouseLeave(); // re-rendering tree = component.toJSON(); expect(tree).toMatchSnapshot(); });
import { moduleForComponent, test } from 'ember-qunit'; import hbs from 'htmlbars-inline-precompile'; moduleForComponent('stage-details', 'Integration | Component | stage details', { integration: true }); test('it renders', function(assert) { assert.expect(2); // Set any properties with this.set('myProperty', 'value'); // Handle any actions with this.on('myAction', function(val) { ... }); this.render(hbs`{{stage-details}}`); assert.equal(this.$().text().trim(), ''); // Template block usage: this.render(hbs` {{#stage-details}} template block text {{/stage-details}} `); assert.equal(this.$().text().trim(), 'template block text'); });
const { Command } = require("klasa"); const { MessageEmbed } = require("discord.js"); const statusList = { online: "online", idle: "idle", dnd: "in do not disturb" }; module.exports = class extends Command { constructor(...args) { super(...args, { name: "userinfo", enabled: true, runIn: ["text"], aliases: ["user"], description: "Get a user's information", usage: "<user:usersearch>", extendedHelp: "Need Discord info on a specific user? I got you covered!" }); this.humanUse = "<user>"; } async run(msg, [user]) { user = msg.guild.members.cache.get(user.id); var userActivity = null; // If presence intent is enabled, grab presence activity for display. if (user.presence.clientStatus != null) { var status = statusList[user.presence.status] || "offline"; var activity = user.presence.activities[0]; if (user.presence.activity === null) { userActivity += " "; } else { switch (activity.type) { //All cases covered case "PLAYING": userActivity = " while playing "; break; case "LISTENING": userActivity = " while listening to "; break; case "WATCHING": userActivity = " while watching "; break; case "STREAMING": userActivity = " while streaming "; break; } userActivity += activity.name; } } var lastMsgTime; if (user.lastMessageChannelID) { var lastMsg = user.guild.channels.cache.get(user.lastMessageChannelID) .messages.cache.get(user.lastMessageID); lastMsgTime = this.client.util.dateDisplay(new Date(lastMsg.createdTimestamp)); } else { lastMsgTime = "No message found..."; } const embed = new MessageEmbed() .setTimestamp() .setFooter(msg.guild.name, msg.guild.iconURL()) .setThumbnail(user.user.displayAvatarURL()) .setAuthor(user.user.tag); if (userActivity != null) { embed.setDescription(`Currently ${status}${userActivity}`); } embed.addField("ID", user.id, true); if (user.nickname) { embed.addField("Nickname", user.nickname, true); } embed.addField("User Type", user.user.bot ? "Bot": "Human", true) .addField("Last Guild Message", lastMsgTime) .addField("Created", this.client.util.dateDisplay(user.user.createdAt), true) .addField("Joined", this.client.util.dateDisplay(user.joinedAt), true) .setColor(0x04d5fd); msg.channel.send({embed}); } };
function dictionaryAddCtrl($scope, DictService, $state) { $scope.$emit("update-title", { pageTitle: "字典列表", links: [ { url: "common.dictionary-list", name: "字典列表" }, { url: "common.dictionary-add", name: "新增字典" } ] }); $scope.save = function () { DictService.save($scope.dict, function () { //MessageService.saveSuccess(); //LocationTo.path("/sys/dict/list"); $state.transitionTo('common.dictionary-list') }, function () { }); }; } dictionaryAddCtrl.$inject = [ '$scope', 'DictService', '$state'];
#!/usr/bin/env node 'use strict'; const Engine = require('../').Engine; const browserScripts = require('../lib/support/browserScript'); const logging = require('../').logging; const cli = require('../lib/support/cli'); const StorageManager = require('../lib/support/storageManager'); const merge = require('lodash.merge'); const fs = require('fs'); const path = require('path'); const log = require('intel').getLogger('browsertime'); const engineUtils = require('../lib/support/engineUtils'); const AsyncFunction = Object.getPrototypeOf(async function() {}).constructor; async function parseUserScripts(scripts) { if (!Array.isArray(scripts)) scripts = [scripts]; const results = {}; for (const script of scripts) { const code = await browserScripts.findAndParseScripts( path.resolve(script), 'custom' ); merge(results, code); } return results; } async function run(urls, options) { try { let dir = 'browsertime-results'; if (!fs.existsSync(dir)) { fs.mkdirSync(dir); } let engine = new Engine(options); const scriptCategories = await browserScripts.allScriptCategories; let scriptsByCategory = await browserScripts.getScriptsForCategories( scriptCategories ); if (options.script) { const userScripts = await parseUserScripts(options.script); scriptsByCategory = merge(scriptsByCategory, userScripts); } try { await engine.start(); const result = await engine.runMultiple(urls, scriptsByCategory); let saveOperations = []; // TODO setup by name let firstUrl = urls[0]; // if the url is an array, it's of the form [filename, function] if (firstUrl instanceof Array) { firstUrl = firstUrl[0]; } const storageManager = new StorageManager(firstUrl, options); const harName = options.har ? options.har : 'browsertime'; const jsonName = options.output ? options.output : 'browsertime'; saveOperations.push(storageManager.writeJson(jsonName + '.json', result)); if (result.har) { const useGzip = options.gzipHar === true; saveOperations.push( storageManager.writeJson(harName + '.har', result.har, useGzip) ); } await Promise.all(saveOperations); const resultDir = path.relative(process.cwd(), storageManager.directory); // check for errors for (let eachResult of result) { for (let errors of eachResult.errors) { if (errors.length > 0) { process.exitCode = 1; } } } log.info(`Wrote data to ${resultDir}`); } finally { log.debug('Stopping Browsertime'); try { await engine.stop(); log.debug('Stopped Browsertime'); } catch (e) { log.error('Error stopping Browsertime!', e); process.exitCode = 1; } } } catch (e) { log.error('Error running browsertime', e); process.exitCode = 1; } finally { process.exit(); } } let cliResult = cli.parseCommandLine(); /* Each url can be: - an url value - an array of tests. In that case it's a mapping containing theses values: - test: an async function containing the test to run - setUp: an async function for the preScript [optional] - tearDown: an async function for the postScript [optional] */ const tests = []; cliResult.urls.forEach(function convert(url) { // for each url, we try to load it as a script, that may contain // export a single function or an object containing setUp/test/tearDown functions. let testScript = engineUtils.loadScript(url); // if the value is an url or a not a single function, we can return the original value if (typeof testScript == 'string' || testScript instanceof AsyncFunction) { tests.push(url); return; } if (testScript.setUp) { if (!cliResult.options.preScript) { cliResult.options.preScript = []; } cliResult.options.preScript.push(testScript.setUp); } if (testScript.tearDown) { if (!cliResult.options.postScript) { cliResult.options.postScript = []; } cliResult.options.postScript.push(testScript.tearDown); } // here, url is the filename containing the script, and test the callable. tests.push([url, testScript.test]); }); logging.configure(cliResult.options); run(tests, cliResult.options);
$(function() { $("input,textarea").jqBootstrapValidation({ preventSubmit: true, submitError: function($form, event, errors) { // additional error messages or events }, submitSuccess: function($form, event) { event.preventDefault(); // prevent default submit behaviour // get values from FORM var name = $("input#name").val(); var email = $("input#email").val(); var phone = $("input#phone").val(); var message = $("textarea#message").val(); var firstName = name; // For Success/Failure Message // Check for white space in name for Success/Fail message if (firstName.indexOf(' ') >= 0) { firstName = name.split(' ').slice(0, -1).join(' '); } $.ajax({ url: "././mail/contact_me.php", type: "POST", data: { name: name, phone: phone, email: email, message: message }, cache: false, success: function() { // Success message $('#success').html("<div class='alert alert-success'>"); $('#success > .alert-success').html("<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;") .append("</button>"); $('#success > .alert-success') .append("<strong>Votre message a bien été envoyé. </strong>"); $('#success > .alert-success') .append('</div>'); //clear all fields $('#contactForm').trigger("reset"); }, error: function() { // Fail message $('#success').html("<div class='alert alert-danger'>"); $('#success > .alert-danger').html("<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;") .append("</button>"); $('#success > .alert-danger').append("<strong>Désolé " + firstName + ", il semble que mon serveur mail ne réponde pas. Réessayez plus tard !"); $('#success > .alert-danger').append('</div>'); //clear all fields $('#contactForm').trigger("reset"); }, }) }, filter: function() { return $(this).is(":visible"); }, }); $("a[data-toggle=\"tab\"]").click(function(e) { e.preventDefault(); $(this).tab("show"); }); }); /*When clicking on Full hide fail/success boxes */ $('#name').focus(function() { $('#success').html(''); });
/************************************************************* * * MathJax/jax/output/HTML-CSS/config.js * * Initializes the HTML-CCS OutputJax (the main definition is in * MathJax/jax/input/HTML-CSS/jax.js, which is loaded when needed). * * --------------------------------------------------------------------- * * Copyright (c) 2009-2011 Design Science, 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. */ MathJax.OutputJax["HTML-CSS"] = MathJax.OutputJax({ id: "HTML-CSS", version: "1.1.5", directory: MathJax.OutputJax.directory + "/HTML-CSS", extensionDir: MathJax.OutputJax.extensionDir + "/HTML-CSS", autoloadDir: MathJax.OutputJax.directory + "/HTML-CSS/autoload", fontDir: MathJax.OutputJax.directory + "/HTML-CSS/fonts", // font name added later webfontDir: MathJax.OutputJax.fontDir + "/HTML-CSS", // font name added later config: { scale: 100, minScaleAdjust: 50, availableFonts: ["STIX","TeX"], preferredFont: "TeX", webFont: "TeX", imageFont: "TeX", undefinedFamily: "STIXGeneral,'Arial Unicode MS',serif", showMathMenu: true, styles: { ".MathJax_Display": { "text-align": "center", margin: "1em 0em" }, ".MathJax .merror": { "background-color": "#FFFF88", color: "#CC0000", border: "1px solid #CC0000", padding: "1px 3px", "font-family": "serif", "font-style": "normal", "font-size": "90%" }, ".MathJax_Preview": {color: "#888888"}, "#MathJax_Tooltip": { "background-color": "InfoBackground", color: "InfoText", border: "1px solid black", "box-shadow": "2px 2px 5px #AAAAAA", // Opera 10.5 "-webkit-box-shadow": "2px 2px 5px #AAAAAA", // Safari 3 and Chrome "-moz-box-shadow": "2px 2px 5px #AAAAAA", // Forefox 3.5 "-khtml-box-shadow": "2px 2px 5px #AAAAAA", // Konqueror filter: "progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')", // IE padding: "3px 4px" } } } }); if (MathJax.Hub.Browser.isMSIE && document.documentMode >= 9) {delete MathJax.OutputJax["HTML-CSS"].config.styles["#MathJax_Tooltip"].filter} if (!MathJax.Hub.config.delayJaxRegistration) {MathJax.OutputJax["HTML-CSS"].Register("jax/mml")} MathJax.Hub.Register.StartupHook("End Config",[function (HUB,HTMLCSS) { var CONFIG = HUB.Insert({ // // The minimum versions that HTML-CSS supports // minBrowserVersion: { Firefox: 3.0, Opera: 9.52, MSIE: 6.0, Chrome: 0.3, Safari: 2.0, Konqueror: 4.0 }, // // For unsupported browsers, put back these delimiters for the preview // inlineMathDelimiters: ['$','$'], // or ["",""] or ["\\(","\\)"] displayMathDelimiters: ['$$','$$'], // or ["",""] or ["\\[","\\]"] // // For displayed math, insert <BR> for \n? // multilineDisplay: true, // // The function to call to display the math for unsupported browsers // minBrowserTranslate: function (script) { var MJ = HUB.getJaxFor(script), text = ["[Math]"], delim; var span = document.createElement("span",{className: "MathJax_Preview"}); if (MJ.inputJax.id === "TeX") { if (MJ.root.Get("displaystyle")) { delim = CONFIG.displayMathDelimiters; text = [delim[0]+MJ.originalText+delim[1]]; if (CONFIG.multilineDisplay) text = text[0].split(/\n/); } else { delim = CONFIG.inlineMathDelimiters; text = [delim[0]+MJ.originalText.replace(/^\s+/,"").replace(/\s+$/,"")+delim[1]]; } } for (var i = 0, m = text.length; i < m; i++) { span.appendChild(document.createTextNode(text[i])); if (i < m-1) {span.appendChild(document.createElement("br"))} } script.parentNode.insertBefore(span,script); } },(HUB.config["HTML-CSS"]||{})); if (HUB.Browser.version !== "0.0" && !HUB.Browser.versionAtLeast(CONFIG.minBrowserVersion[HUB.Browser]||0.0)) { HTMLCSS.Translate = CONFIG.minBrowserTranslate; HUB.Config({showProcessingMessages: false}); MathJax.Message.Set("Your browser does not support MathJax",null,4000); HUB.Startup.signal.Post("MathJax not supported"); } },MathJax.Hub,MathJax.OutputJax["HTML-CSS"]]); MathJax.OutputJax["HTML-CSS"].loadComplete("config.js");
/* * Copyright 2015 NamieTown * http://www.town.namie.fukushima.jp/ * 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. */ define(function(require, exports, module) { "use strict"; module.exports = { HeaderView : require("./HeaderView") }; });
checkRolesInFunction = function (doRole, userId) { if (!Meteor.userId() || ENUM.getUserById(userId)) throw ENUM.ERROR(403); }; getSelector = function (selector) { var baseSelector = { delete_flg: {$ne: 1} }; return _.extend(baseSelector, selector); }; detectEnv = function(){ var appFolder = process.env.PWD; var lastEnv = ""; for (let env in Meteor.settings.env_address){ var addr = Meteor.settings.env_address[env] if (appFolder === addr){ return env; } if (addr === "default"){ lastEnv = env; } } return lastEnv; }; getSettings = function(){ var env = detectEnv(); return Meteor.settings[env]; }
module.exports = { attach: function attach(app) { app.actions.flip = (image, metadata, config, callback) => { const axis = config.axis || 'y'; if (axis === 'y') { return callback(undefined, image.flip()); } return callback(undefined, image.flop()); }; }, };
import SerialNumber from './SerialNumber.jsx'; export default SerialNumber;
exports.netCheck = function() { var url = "http://api.openbeerdatabase.com/v1/beers.json"; var client = Ti.Network.createHTTPClient({ onload : function(evt) { var newCrud = new crud(); newCrud.dele(); var data = JSON.parse(this.responseText); var beers = data.beers; for ( i = 0, j = beers.length; i < j; i++) { var post = { title : beers[i].name, desc : beers[i].description }; newCrud.create(post); } }, onerror : function(evt) { if (!Ti.Network.online) { alert("Could not find connection!"); var newCrud = new crud(); newCrud.read(); } } }); client.open("GET", url); client.send(); };
const elixir = require('laravel-elixir'); require('laravel-elixir-vue-2'); var jsuglify = require('gulp-uglify'); var rename = require('gulp-rename'); var node_path = 'node_modules'; var paths = { 'jquery': node_path + '/jquery', 'bootstrap': node_path + '/bootstrap', 'icheck': node_path + '/icheck', 'jqueryvalidation': node_path + '/jquery-validation', 'fontawesome': node_path + '/font-awesome', }; elixir.config.sourcemaps = false; elixir.config.versioning = { buildFolder: '' }; elixir.extend('jsminify', function () { new elixir.Task('jsminify', function () { return gulp.src(['public/js/admin.js', paths.jqueryvalidation + '/dist/jquery.validate.js']) .pipe(rename({suffix: '.min'})) .pipe(jsuglify()) .pipe(gulp.dest('public/js')); }); }); elixir(mix => { mix.less([ 'AdminLTE/AdminLTE.less', 'AdminLTE/skins/skin-green.less' ], 'public/css/admin.css') .copy(paths.jquery + '/dist/jquery.min.js', 'public/js/jquery.min.js') // .copy(paths.jqueryvalidation + '/dist/jquery.validate.js', 'public/js/jquery.validate.js') .copy(paths.icheck + '/icheck.min.js', 'public/icheck/icheck.min.js') .copy(paths.icheck + '/skins', 'public/icheck/skins') .copy(paths.bootstrap + '/dist/js/bootstrap.min.js', 'public/bootstrap/js/bootstrap.min.js') .copy(paths.bootstrap + '/dist/fonts', 'public/bootstrap/fonts') .copy(paths.bootstrap + '/dist/css/bootstrap.min.css', 'public/bootstrap/css/bootstrap.min.css') .copy(paths.fontawesome + '/fonts', 'public/font-awesome/fonts') .copy(paths.fontawesome + '/css/font-awesome.min.css', 'public/font-awesome/css/font-awesome.min.css') .copy('resources/assets/fonts', 'public/fonts') .copy('resources/assets/js/admin', 'public/js/admin') .webpack('admin.js') .jsminify() // .webpack('jquery.validate.js', 'public/js/jquery.validate.min.js', 'public/js') .version(['css/admin.css', 'js/admin.min.js']) ; });
import React from "react"; import StorybookWrapper from "stories/helpers/storybookWrapper.js"; import baseProps from "stories/helpers/baseProps.js"; import Component, { MEDICAL_ROSTER_CREW_SUB, MEDICAL_ROSTER_QUERY, MEDICAL_ROSTER_SUB, } from "components/views/MedicalRoster/index.js"; export default { title: "Cards|Medical/MedicalRoster", }; export const MedicalRoster = () => ( <StorybookWrapper queries={[ MEDICAL_ROSTER_CREW_SUB, MEDICAL_ROSTER_QUERY, MEDICAL_ROSTER_SUB, ]} > <Component {...baseProps} /> </StorybookWrapper> );
(function () { "use strict"; /** Product detail view controller */ angular.module('app') .controller('DetailController', ['$scope', '$location', '$routeParams', 'catalogService', 'ProductUtils', function ($scope, $location, $routeParams, catalogService, ProductUtils) { $scope.product = {}; catalogService.getProduct($routeParams.id).success(function (result) { $scope.product = result; }); $scope.quantity = 1; $scope.getImage = ProductUtils.getImage; /** Returns the CSS class for the average rating of a given product. */ $scope.getCSSRating = ProductUtils.getRatingCss; }]); })();
/* * 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. */ Ext.define('OPF.console.domain.model.FilestoreModel', { extend: 'Ext.data.Model', statics: { pageSuffixUrl: 'console/domain', restSuffixUrl: 'registry/filestore', editorClassName: 'OPF.console.domain.view.system.FilestoreEditor', constraintName: 'OPF.registry.Filestore' }, idProperty: 'id', fields: [ { name: 'id', type: 'int', useNull: true }, { name: 'name', type: 'string' }, { name: 'type', type: 'string' }, { name: 'path', type: 'string' }, { name: 'lookup', type: 'string' }, { name: 'description', type: 'string' }, { name: 'serverName', type: 'string' }, { name: 'port', type: 'int', defaultValue: 8080 }, { name: 'urlPath', type: 'string' }, { name: 'status', type: 'string' }, { name: 'serverDirectory', type: 'string' }, { name: 'parentId', type: 'int' }, { name: 'childCount', type: 'int' }, { name: 'created', type: 'int' }, { name: 'canUpdate', type: 'boolean' }, { name: 'canDelete', type: 'boolean' } ] });
try { await kuzzle.ms.sadd('set1', ['foo', 'bar', 'baz']); await kuzzle.ms.sadd('set2', ['qux']); await kuzzle.ms.smove('set1', 'set2', 'foo'); // Prints: [ 'bar', 'baz' ] console.log(await kuzzle.ms.smembers('set1')); // Prints: [ 'foo', 'qux' ] console.log(await kuzzle.ms.smembers('set2')); } catch (error) { console.error(error.message); }
// ***************************************************************************** // Copyright 2013-2019 Aerospike, Inc. // // Licensed under the Apache License, Version 2.0 (the "License") // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // ***************************************************************************** 'use strict' /* global expect, describe, it, before, after */ const Aerospike = require('../lib/aerospike') const helper = require('./test_helper') const AerospikeError = Aerospike.AerospikeError const keygen = helper.keygen describe('client.apply()', function () { const client = helper.client const key = keygen.string(helper.namespace, helper.set, { prefix: 'test/apply/' })() before(() => helper.udf.register('udf.lua') .then(() => client.put(key, { foo: 'bar' }, { ttl: 1000 }))) after(() => helper.udf.remove('udf.lua') .then(() => client.remove(key))) it('should invoke an UDF to without any args', function (done) { const udfArgs = { module: 'udf', funcname: 'withoutArguments' } client.apply(key, udfArgs, function (error, result) { if (error) throw error expect(result).to.equal(1) done() }) }) it('should invoke an UDF with arguments', function (done) { const udfArgs = { module: 'udf', funcname: 'withArguments', args: [42] } client.apply(key, udfArgs, function (error, result) { if (error) throw error expect(result).to.equal(42) done() }) }) it('should invoke an UDF with apply policy', function (done) { const policy = new Aerospike.ApplyPolicy({ totalTimeout: 1500 }) const udf = { module: 'udf', funcname: 'withArguments', args: [[1, 2, 3]] } client.apply(key, udf, policy, function (error, result) { if (error) throw error expect(result).to.eql([1, 2, 3]) done() }) }) it('should return an error if the user-defined function does not exist', function (done) { const udfArgs = { module: 'udf', funcname: 'not-such-function' } client.apply(key, udfArgs, function (error, result) { expect(error).to.be.instanceof(AerospikeError).with.property('code', Aerospike.status.ERR_UDF) done() }) }) it('should return an error if the UDF arguments are invalid', function (done) { const udfArgs = { module: 'udf', funcname: 'noop', args: 42 } // args should always be an array client.apply(key, udfArgs, function (error, result) { expect(error).to.be.instanceof(AerospikeError).with.property('code', Aerospike.status.ERR_PARAM) done() }) }) it('should return a Promise that resolves to the return value of the UDF function', function () { const udfArgs = { module: 'udf', funcname: 'withoutArguments' } return client.apply(key, udfArgs) .then(result => expect(result).to.equal(1)) }) })
#!/usr/bin/env node var execSync = require('child_process').execSync; var fs = require("fs"); var args = process.argv.slice(2); var guid = args[0]; if (typeof guid === "undefined") { console.log("provide a guid"); } else { var fileList = ""+execSync("ls -lh"); var lines = fileList.split("\n"); var count = 0; for (l in lines) { if (lines[l].indexOf(".wav") != -1) { count++; } } var rep = 0; console.log("About "+count+" audio files to analyze..."); for (l in lines) { if (lines[l].indexOf(".wav") != -1) { rep++; var fileName = lines[l].substr(lines[l].lastIndexOf(".wav")-32,32)+".wav"; var timestamp = lines[l].substr(lines[l].lastIndexOf(".wav")-19,19); var dateTime = (new Date(timestamp.substr(0,timestamp.indexOf("T"))+"T"+timestamp.substr(1+timestamp.indexOf("T")).replace(/-/g,":"))).toISOString(); var checkInId = lines[l].substr(lines[l].lastIndexOf(".wav")-32,32); var audioId = lines[l].substr(lines[l].lastIndexOf(".wav")-32,32); var execStr = "cd /Users/topher/code/rfcx/worker-analysis && /usr/local/bin/python2.7" +" /Users/topher/code/rfcx/worker-analysis/analyze.py" +" --wav_path /Volumes/rfcx-audio/GuardianAudio/"+guid+"/"+fileName // +" -data /Users/topher/code/rfcx/worker-analysis/config/input_defaults.properties" +" --guardian_id "+guid +" --checkin_id checkin-"+checkInId +" --audio_id audio-"+audioId +" --start_time '"+dateTime+"'" +" --ambient_temp "+40 +" --lat_lng "+"3.6141375,14.2108033" +" --local" +" >> /Volumes/rfcx-audio/GuardianAudio/"+guid+"/"+fileName+".txt" ; console.log(fileName); execSync(execStr); } } }
#!/usr/bin/env node /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ let baseModule; try { // To support easy development when making changes in the source repo, we // first try looking for a copy of the base module using a relative path. In // this context, we prefer the local copy over one that may already be // installed. baseModule = require('../../generic-webdriver-server'); } catch (error) { if (!error.message.includes('Cannot find module')) { throw error; } // When this module is running in an installed context, we fall back to // requiring the installed base module by name. baseModule = require('generic-webdriver-server'); } const {GenericSingleSessionWebDriverServer, yargs} = baseModule; const { checkPlatformRequirements, loadOnXboxOne, takeScreenshot, addXboxOneArgs, } = require('./xbox-one-utils'); /** WebDriver server backend for Xbox One */ class XboxOneWebDriverServer extends GenericSingleSessionWebDriverServer { constructor() { super(); checkPlatformRequirements(); } /** @override */ async navigateToSingleSession(url) { await loadOnXboxOne(this.flags, this.log, url); } /** @override */ async closeSingleSession() { // Send the device back to the home screen. await loadOnXboxOne(this.flags, this.log, null); } /** @override */ async screenshot(sessionId) { return await takeScreenshot( this.flags.hostname, this.flags.username, this.flags.password); } } addXboxOneArgs(yargs); const server = new XboxOneWebDriverServer(); server.listen();
import app from './app'; app.run(process.argv);
/***************************************************************************** ** Copyright (C) 2015 Intel Corporation. ** ** ** ** 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. ** *****************************************************************************/ console.log('you\'r in the world of content.js'); var cryptid = 1; var script = document.createElement('script'); script.src = chrome.extension.getURL('gmail/inject.js'); script.onload = function() { this.parentNode.removeChild(this); }; (document.head||document.documentElement).appendChild(script); function reeeplace() { $( ".a3s:contains(crypted_stuff)").each(function() { if($(this).hasClass("handled")) { } else { $(this).addClass("handled") cryptid = cryptid + 1; var cryid = "cryptid" + cryptid; var old_content = $(this).html().replace('crypted_stuff ',''); $(this).empty().append("<div class='crypted' id='"+cryid+"'>" + old_content + "</div>"); $(this).append("<div class='crypted_info' onclick='decrypt(\""+cryid+"\");style.visibility=\"hidden\";'>content is crypted, click here to show</div>"); $(this).children(".crypted").css("opacity","0.3"); $(this).children(".crypted_info").css("background-color","red"); console.log('added uncrypt button'); } }); $( ".editable").each(function() { if($(this).hasClass("encryption")) { } else { $(this).addClass("encryption"); console.log("id" + $(this).attr('id') ); $(this).closest('tr').append("<td class='Ap'><div class='crypted_info' style=\"background-color:green;color:white\" onclick='encrypt(\""+$(this).attr('id') +"\");style.visibility=\"hidden\";'>encrypt</div></td>"); } }); } reeeplace(); MutationObserver = window.MutationObserver || window.WebKitMutationObserver; var observer = new MutationObserver(function(mutations, observer) { reeeplace(); }); // define what element should be observed by the observer // and what types of mutations trigger the callback observer.observe(document, { subtree: true, attributes: true //... });
'use strict'; /** * Module dependencies. */ var fs = require('fs'), http = require('http'), https = require('https'), express = require('express'), morgan = require('morgan'), logger = require('./logger'), bodyParser = require('body-parser'), session = require('express-session'), compress = require('compression'), methodOverride = require('method-override'), cookieParser = require('cookie-parser'), helmet = require('helmet'), passport = require('passport'), mongoStore = require('connect-mongo')({ session: session }), flash = require('connect-flash'), config = require('./config'), consolidate = require('consolidate'), path = require('path'); // multer = require('multer') module.exports = function(db) { // Initialize express app var app = express(); // Globbing model files config.getGlobbedFiles('./models/**/*.js').forEach(function(modelPath) { require(path.resolve(modelPath)); }); // Setting application local variables app.locals.title = config.app.title; app.locals.description = config.app.description; app.locals.keywords = config.app.keywords; // app.locals.facebookAppId = config.facebook.clientID; if (!fs.existsSync(config.uploadDir)){ fs.mkdirSync(config.uploadDir); fs.mkdirSync(config.uploadDirTmp); } // Passing the request url to environment locals app.use(function(req, res, next) { res.locals.url = req.protocol + '://' + req.headers.host + req.url; next(); }); // Should be placed before express.static app.use(compress({ filter: function(req, res) { return (/json|text|javascript|css/).test(res.getHeader('Content-Type')); }, level: 9 })); // Showing stack errors app.set('showStackError', true); // Set swig as the template engine app.engine('server.view.html', consolidate[config.templateEngine]); // TODO: Review this. // Set views path and view engine app.set('view engine', 'server.view.html'); // TODO: Review this. // app.set('views', './app/views'); // TODO: Review this. app.set('views', './templates'); // TODO: Review this. // Enable logger (morgan) app.use(morgan(logger.getLogFormat(), logger.getLogOptions())); // Environment dependent middleware if (process.env.NODE_ENV === 'development') { // Disable views cache app.set('view cache', false); } else if (process.env.NODE_ENV === 'production') { app.locals.cache = 'memory'; } // app.use(multer({ // dest: './uploads/', // limits: { // files: 10, // fileSize: 2, // parts: 10 // }, // rename: function(fieldname, filename) { // return filename.replace(/\W+/g, '-').toLowerCase(); // }, // onFileUploadStart: function(file) { // console.log(file.fieldname + ' is starting ...'); // }, // onFileUploadComplete: function(file) { // console.log(file.fieldname + ' uploaded to ' + file.path); // }, // onError: function(error, next) { // console.log(error); // next(error); // }, // onFileSizeLimit: function(file) { // console.log('Failed: ', file.originalname); // fs.unlink('./' + file.path); // delete the partially written file // }, // onFilesLimit: function() { // console.log('Crossed file limit!'); // } // })); // Request body parsing middleware should be above methodOverride app.use(bodyParser.urlencoded({ extended: true })); app.use(bodyParser.json()); app.use(methodOverride()); // CookieParser should be above session app.use(cookieParser()); // Express MongoDB session storage app.use(session({ saveUninitialized: true, resave: true, secret: config.sessionSecret, store: new mongoStore({ db: db.connection.db, collection: config.sessionCollection }), cookie: config.sessionCookie, name: config.sessionName })); // use passport session app.use(passport.initialize()); app.use(passport.session()); // connect flash for flash messages app.use(flash()); // Use helmet to secure Express headers app.use(helmet.xframe()); app.use(helmet.xssFilter()); app.use(helmet.nosniff()); app.use(helmet.ienoopen()); app.disable('x-powered-by'); // Setting the app router and static folder app.use(express.static(path.resolve(config.root))); // Globbing routing files config.getGlobbedFiles('./routers/**/*.js').forEach(function(routePath) { require(path.resolve(routePath))(app); }); // require('../routers/routes'); // Assume 'not found' in the error msgs is a 404. this is somewhat silly, but valid, you can do whatever you like, set properties, use instanceof etc. app.use(function(err, req, res, next) { // If the error object doesn't exists if (!err) return next(); // Log it console.error(err.stack); res.status(500).json({ error: err.stack }); }); // Assume 404 since no middleware responded app.use(function(req, res) { res.status(404).json({ msg: 'Not Found' }); }); if (process.env.NODE_ENV === 'secure') { // Load SSL key and certificate var privateKey = fs.readFileSync('./config/sslcerts/key.pem', 'utf8'); var certificate = fs.readFileSync('./config/sslcerts/cert.pem', 'utf8'); // Create HTTPS Server var httpsServer = https.createServer({ key: privateKey, cert: certificate }, app); // Return HTTPS server instance return httpsServer; } // Return Express server instance return app; };
export default function (value, opts) { return value > Date.now() ? opts.fn(this) : ''; }
"use strict"; var valueToString = require("@sinonjs/commons").valueToString; var indexOf = require("@sinonjs/commons").prototypes.string.indexOf; var forEach = require("@sinonjs/commons").prototypes.array.forEach; var type = require("type-detect"); var engineCanCompareMaps = typeof Array.from === "function"; var deepEqual = require("./deep-equal").use(match); // eslint-disable-line no-use-before-define var isArrayType = require("./is-array-type"); var isSubset = require("./is-subset"); var createMatcher = require("./create-matcher"); /** * Returns true when `array` contains all of `subset` as defined by the `compare` * argument * * @param {Array} array An array to search for a subset * @param {Array} subset The subset to find in the array * @param {Function} compare A comparison function * @returns {boolean} [description] * @private */ function arrayContains(array, subset, compare) { if (subset.length === 0) { return true; } var i, l, j, k; for (i = 0, l = array.length; i < l; ++i) { if (compare(array[i], subset[0])) { for (j = 0, k = subset.length; j < k; ++j) { if (i + j >= l) { return false; } if (!compare(array[i + j], subset[j])) { return false; } } return true; } } return false; } /* eslint-disable complexity */ /** * Matches an object with a matcher (or value) * * @alias module:samsam.match * @param {object} object The object candidate to match * @param {object} matcherOrValue A matcher or value to match against * @returns {boolean} true when `object` matches `matcherOrValue` */ function match(object, matcherOrValue) { if (matcherOrValue && typeof matcherOrValue.test === "function") { return matcherOrValue.test(object); } switch (type(matcherOrValue)) { case "bigint": case "boolean": case "number": case "symbol": return matcherOrValue === object; case "function": return matcherOrValue(object) === true; case "string": var notNull = typeof object === "string" || Boolean(object); return ( notNull && indexOf( valueToString(object).toLowerCase(), matcherOrValue.toLowerCase() ) >= 0 ); case "null": return object === null; case "undefined": return typeof object === "undefined"; case "Date": /* istanbul ignore else */ if (type(object) === "Date") { return object.getTime() === matcherOrValue.getTime(); } /* istanbul ignore next: this is basically the rest of the function, which is covered */ break; case "Array": case "Int8Array": case "Uint8Array": case "Uint8ClampedArray": case "Int16Array": case "Uint16Array": case "Int32Array": case "Uint32Array": case "Float32Array": case "Float64Array": return ( isArrayType(matcherOrValue) && arrayContains(object, matcherOrValue, match) ); case "Map": /* istanbul ignore next: this is covered by a test, that is only run in IE, but we collect coverage information in node*/ if (!engineCanCompareMaps) { throw new Error( "The JavaScript engine does not support Array.from and cannot reliably do value comparison of Map instances" ); } return ( type(object) === "Map" && arrayContains( Array.from(object), Array.from(matcherOrValue), match ) ); default: break; } switch (type(object)) { case "null": return false; case "Set": return isSubset(matcherOrValue, object, match); default: break; } /* istanbul ignore else */ if (matcherOrValue && typeof matcherOrValue === "object") { if (matcherOrValue === object) { return true; } if (typeof object !== "object") { return false; } var prop; // eslint-disable-next-line guard-for-in for (prop in matcherOrValue) { var value = object[prop]; if ( typeof value === "undefined" && typeof object.getAttribute === "function" ) { value = object.getAttribute(prop); } if ( matcherOrValue[prop] === null || typeof matcherOrValue[prop] === "undefined" ) { if (value !== matcherOrValue[prop]) { return false; } } else if ( typeof value === "undefined" || !deepEqual(value, matcherOrValue[prop]) ) { return false; } } return true; } /* istanbul ignore next */ throw new Error("Matcher was an unknown or unsupported type"); } /* eslint-enable complexity */ forEach(Object.keys(createMatcher), function(key) { match[key] = createMatcher[key]; }); module.exports = match;
/** * @license * Copyright 2013 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 Utilities for asynchronous operations. */ goog.provide('e2e.async.util'); goog.require('e2e.async.Result'); goog.require('goog.async.Deferred'); /** * Wraps a function within a port. * @param {function(...*):*} callback The callback to use. * @return {!MessagePort} The port that wraps the callback. */ e2e.async.util.wrapFunction = function(callback) { var mc = new MessageChannel(); mc.port1.onmessage = function(event) { var args = []; for (var i = 0; i < event.data.arguments.length; i++) { var arg = event.data.arguments[i]; if (goog.isObject(arg) && typeof arg.__port__ === 'number') { args.push(e2e.async.util.unwrapFunction(event.ports[arg.__port__])); } else { args.push(arg); } } try { var returnValue = callback.apply(null, args); if (goog.async.Deferred && returnValue instanceof goog.async.Deferred) { returnValue.addCallback(function(ret) { e2e.async.util.return_(event.target, ret, ''); }).addErrback(function(err) { e2e.async.util.return_(event.target, undefined, String(err)); }); } else { e2e.async.util.return_(event.target, returnValue, ''); } } catch (e) { if (e instanceof Error) { e2e.async.util.return_(event.target, undefined, String(e.message)); } else { e2e.async.util.return_(event.target, undefined, 'Unknown error'); } } }; return mc.port2; }; /** * Sends a return message to the port. * @param {MessagePort} port The port to respond to. * @param {*} returnValue The return value of the function. * @param {string} error The error to send. * @private */ e2e.async.util.return_ = function(port, returnValue, error) { port.postMessage({ 'returnValue': returnValue, 'error': error }); }; /** * Unwraps a function from a port. * @param {MessagePort} port The port that is wrapping the function. * @return {function(...*):!e2e.async.Result} A function that calls the wrapped * function and returns a deferred result object. */ e2e.async.util.unwrapFunction = function(port) { return function() { var result = new e2e.async.Result(); port.onmessage = function(event) { if (event.data.error) { result.errback(event.data.error); } else { result.callback(event.data.returnValue); } }; var args = []; var ports = []; for (var i = 0; i < arguments.length; i++) { if (typeof arguments[i] == 'function') { var wrappedPort = e2e.async.util.wrapFunction(arguments[i]); ports.push(wrappedPort); args.push({ '__port__': ports.length - 1 }); } else { args.push(arguments[i]); } } port.postMessage({ 'arguments': args }, ports); return result; }; };
'use strict'; /** * 어떤 일을 하고 있습니까? * @class VBOKeysNation */ var VBOKeysNation = function(bufferSizes, minSize) { if (!(this instanceof VBOKeysNation)) { throw new Error(Messages.CONSTRUCT_ERROR); } // buffer sizes are in bytes. this.vboKeysStoreMap = {}; this.bufferSizes = bufferSizes; this.minSize = minSize; this.maxSize = bufferSizes[bufferSizes.length-1]; this.totalBytesUsed = 0; var vboKeysStore; var sizesCount = bufferSizes.length; for (var i=0; i<sizesCount; i++) { vboKeysStore = new VBOKeysStore(bufferSizes[i]); this.vboKeysStoreMap[bufferSizes[i]] = vboKeysStore; if (bufferSizes[i] > this.maxSize) { this.maxSize = bufferSizes[i]; } } }; /** * 어떤 일을 하고 있습니까? * @returns vboBufferKey. */ VBOKeysNation.prototype.getClassifiedBufferKey = function(gl, bufferSize, keyWorld, onlyReuse) { // 1rst find the vboKeyStore for this bufferSize. var closestBufferSize = this.getClosestBufferSize(bufferSize); var vboKeyStore = this.vboKeysStoreMap[closestBufferSize]; if (vboKeyStore) { return vboKeyStore.getBufferKey(gl, this, keyWorld, onlyReuse); } else { return -1; } }; /** * 어떤 일을 하고 있습니까? * @returns vboBufferKey. */ VBOKeysNation.prototype.storeClassifiedBufferKey = function(bufferKey, bufferSize) { // 1rst find the vboKeyStore for this bufferSize. var vboKeyStore = this.vboKeysStoreMap[bufferSize]; if (vboKeyStore) { vboKeyStore.storeBufferKey(bufferKey); } }; /** * 어떤 일을 하고 있습니까? * @returns boolean. true if the currentBufferSize is in the range of this nation. */ VBOKeysNation.prototype.getClosestBufferSize = function(currentBufferSize) { if (!this.isInsideRange(currentBufferSize)) { return -1; } var sizesCount = this.bufferSizes.length; for (var i=0; i<sizesCount; i++) { if (currentBufferSize <= this.bufferSizes[i]) { return this.bufferSizes[i]; } } return -1; }; /** * 어떤 일을 하고 있습니까? * @returns boolean. true if the currentBufferSize is in the range of this nation. */ VBOKeysNation.prototype.isInsideRange = function(bufferSize) { if (bufferSize > this.maxSize || bufferSize < this.minSize) { return false; } return true; };
'use strict'; var yeoman = require('yeoman-generator'); var chalk = require('chalk'); var yosay = require('yosay'); var path = require('path'); var urllib = require('urllib'); module.exports = yeoman.generators.Base.extend({ prompting: function () { var done = this.async(); this.pkg = require(path.join(__dirname, '../../package.json')); let noUpdate = null if (process && process.argv && process.argv[3]) { noUpdate = process.argv[3] } if (noUpdate !== '-noupdate') { this.log( chalk.yellow('正在检查更新...') ); urllib.request('http://registry.npm.taobao.org/generator-tvwheel/latest', function (err, data, res) { if (err || res.statusCode != 200) { this.log( chalk.red('检查更新出错') ); } else { data = JSON.parse(data.toString()); if (data.version !== this.pkg.version) { this.log( '发现新版本:' + chalk.red(data.version) + ', 当前版本:' + chalk.yellow(this.pkg.version) + '.' ); this.log( '版本有更新,建议更新:npm install -g generator-tvwheel' ); } else { this.log( '当前版本为最新版本' ); } } this.log(yosay( 'Welcome to the polished ' + chalk.red('tvwheel') + ' generator!' )); done(); }.bind(this)); } else { done(); } }, writing: { init: function () { }, askFor: function () { var cb = this.async(); var fileName = path.basename(process.cwd()); var prompts = [ { type: 'rawlist', name: 'type', message: 'Type of Component?', choices: [ { name: 'BaseComponent(无界面功能性组件)', value: '0' }, { name: 'DisplayComponent(显示UI组件)', value: '1' }, { name: 'FocusableComponent(有焦点切换组件,且基于FocusEngine)', value: '2' } ], default: '0', warning: '' }, { name: 'projectName', message: 'Name of Component?', default: fileName, warning: '' }, { name: 'author', message: 'Author Name:', default: '', warning: '' }, { name: 'email', message: 'Author Email:', default: '', warning: '' }, // { // name: 'groupName', // message: 'Group Name:', // default: 'de', // warning: '' // }, { name: 'version', message: 'Version:', default: '0.0.1', warning: '' } ]; // your-mojo-name => YourMojoName function parseMojoName(name) { return name.replace(/\b(\w)|(-\w)/g, function (m) { return m.toUpperCase().replace('-', ''); }); } this.prompt(prompts, function (props) { this.type = props.type; this.packageName = props.projectName;// project-name this.projectName = parseMojoName(this.packageName); //ProjectName this.author = props.author; this.email = props.email; this.version = props.version; // this.groupName = props.groupName; var base = '~0.0.1' var display = '~0.0.1' var focusable = '~0.0.1' if (props.type == '0') { this.dependencies = '{\n' + '\t\t"silver-base": "' + base + '"\n' + '\t}'; } else if (props.type == '1') { this.dependencies = '{\n' + '\t\t"silver-base": "' + base + '",\n' + '\t\t"silver-display": "' + display + '"\n' + '\t}'; } else { this.dependencies = '{\n' + '\t\t"silver-base": "' + base + '",\n' + '\t\t"silver-display": "' + display + '",\n' + '\t\t"silver-focusable": "' + focusable + '"\n' + '\t}'; } cb(); }.bind(this)); }, app: function () { this.template( this.templatePath('index.js'), this.destinationPath('index.js') ); this.template( this.templatePath('index.mobile.js'), this.destinationPath('index.mobile.js') ); this.fs.copy( this.templatePath('gulpfile.js'), this.destinationPath('gulpfile.js') ); this.fs.copy( this.templatePath('gulp'), this.destinationPath('gulp') ); this.template( this.templatePath('_package.json'), this.destinationPath('package.json') ); this.fs.copy( this.templatePath('_hubrc'), this.destinationPath('.hubrc') ); this.fs.copy( this.templatePath('_docConfig.json'), this.destinationPath('docConfig.json') ); this.fs.copy( this.templatePath('_gitignore'), this.destinationPath('.gitignore') ); this.template( this.templatePath('README.md'), this.destinationPath('README.md') ); //this.template( // this.templatePath('lib'), // this.destinationPath('lib') //); this.mkdir('lib'); this.mkdir('build'); this.mkdir('demo'); if (this.type == 1) { this.template( this.templatePath('lib/index-1.js'), this.destinationPath('lib/index.js') ); } else if (this.type == 2) { this.template( this.templatePath('lib/index-2.js'), this.destinationPath('lib/index.js') ); } else { this.template( this.templatePath('lib/index.js'), this.destinationPath('lib/index.js') ); } }, projectfiles: function () { this.fs.copy( this.templatePath('editorconfig'), this.destinationPath('.editorconfig') ); } }, install: function () { //this.installDependencies(); } });
var mongoose = require('mongoose'); var Schemas = require('./Schemas'); var Game = mongoose.model('Game',Schemas.gameSchema); exports.Game = Game;
var // get util library util = require("core/Util"), // get product manager ProductManager = require("core/ProductManager"); function ProductListWindow() { var Window = Ti.UI.createWindow({ title : L("products"), navBarHidden : false, barColor : Theme.TabGroup.BarColor, navTintColor : Theme.TabGroup.NavTintColor, backgroundColor : Theme.Windows.BackgroundColor }), Table = Ti.UI.createTableView({ width : Ti.UI.FILL, height : Ti.UI.FILL, backgroundColor : "#FFFFFF" }); // get product manager var products = require("core/ProductManager"), productEvents = products.events; // assemble UI Window.add(Table); /* * Product row factory method * * @param {String} name: the product name to display * @param {String} image: the icon image to display * @param {String} desc: description of item to display in row * @param {String} itemId: item id used to load product page */ function createRow(name, image, desc, itemId){ var row = Ti.UI.createTableViewRow({ className : "product_rows", backgroundColor : Theme.ProductsList.RowsBackgroundColor, selectedBackgroundColor : Theme.ProductsList.SelectedBackgroundColor, hasChild : true }), img = Ti.UI.createImageView({ image : image, left : 1, top : 1, borderWidth : 3, borderColor : Theme.ProductsList.ImageBorderColor, defaultImage : Config.PRODUCTS_DEFAULT_THUMB_IMAGE }), bodyView = Ti.UI.createView({ layout : "vertical" }), title = Ti.UI.createLabel({ text : name, minimumFontSize : 12, color : Theme.ProductsList.TitleColor, height : Ti.UI.SIZE, left : 2, top : 4, font : { fontSize : Theme.ProductsList.TitleFontSize, fontWeight : Theme.ProductsList.TitleFontWeight } }), body = Ti.UI.createLabel({ text : desc, height : Ti.UI.SIZE, left : 2, top : 2, color : Theme.ProductsList.DescriptionColor, font : { fontSize : Theme.ProductsList.DescriptionFontSize, fontWeight : Theme.ProductsList.DescriptionFontWeight } }); // assemble row bodyView.add(title); bodyView.add(body); row.add(img); if(util.osname==="android"){ img.width = Theme.ProductsList.ImageWidth + "dip"; img.height = Theme.ProductsList.ImageHeight + "dip"; bodyView.left = (Theme.ProductsList.ImageWidth + 1) + "dip"; bodyView.right = "3dip"; bodyView.top = 0; bodyView.bottom = 0; body.height = Ti.UI.SIZE; } else{ img.width = 81; bodyView.left = 82; bodyView.height = Ti.UI.SIZE; } row.add(bodyView); // handle featured item click event row.addEventListener( "click", function(e){ Ti.App.fireEvent( "APP:SHOW_PRODUCT", { "itemId" : itemId, "tab" : "Products" } ); } ); return row; } /* * Product group factory method * * @param {String} name: the name of the group/section * @param {Array} products: array of products for this group/section */ function createProductGroup(name, products){ var productGroupHeader = Ti.UI.createLabel({ text : " "+name, //add space for padding (border not working for left padding) textAlign : Ti.UI.TEXT_ALIGNMENT_LEFT, color : Theme.ProductsList.HeaderColor, backgroundColor : Theme.ProductsList.HeaderBackgroundColor, borderWidth : 2, borderColor : Theme.ProductsList.HeaderBackgroundColor, font : { fontSize : Theme.ProductsList.HeaderFontSize, fontWeight : Theme.ProductsList.HeaderFontWeight } }), productGroup = Ti.UI.createTableViewSection({ headerView : productGroupHeader }); for(var i=0,l=products.length;i<l;i++){ productGroup.add( createRow( products[i].name, products[i].imgs.thumb, products[i].desc.short, products[i].id ) ); } return productGroup; } /* * Assemble product groups for table view * * @param {Object} groups: the groups object containing product arrays for each group/section */ function displayProducts(){ var data = [], groups = require("core/ProductManager").getProductGroup("__ALL__"); for(var key in groups){ data.push( createProductGroup( key, groups[key] ) ); } Table.setData(data); } Window.addEventListener( "focus", displayProducts ); return Window; }; module.exports = ProductListWindow;
var AutoSubmit = { setupAutoSubmit: function(field, button) { $(field).keypress(function(evt) { if (AutoSubmit.isEnter(evt)) { return false; } }); $(field).keydown(function(evt) { if (AutoSubmit.isEnter(evt)) { $(button).click(); return false; } return true; }); $(field).bind("focus", function() { $(button).addClass("autoselect"); }); $(field).bind("blur", function() { $(button).removeClass("autoselect"); }); }, isEnter: function(evt) { var key = 0; if (evt && evt.keyCode) { key = evt.keyCode; } else if (evt && evt.which) { key = evt.which; } if (key == 13) { return true; } return false; } };
(function($) { module("applicationSettings1"); // Test case : Application Settings _asyncTest("Application Settings 1", function() { expect(14); var gitana = GitanaTest.authenticateFullOAuth(); gitana.then(function() { // NOTE: this = platform var platform = this; // create a application this.createApplication().then(function() { // NOTE: this = application var application = this; // ensure zero settings at onset this.listSettings().count(function(count) { equal(count, 0, "No settings"); }); var applicationSettings; this.readApplicationSettings().then(function() { applicationSettings = this; }); // should now be 1 setting this.listSettings().count(function(count) { equal(count, 1, "One setting"); }); this.then(function() { this.subchain(applicationSettings).then(function() { this.setSetting('key1','val1'); this.setSetting('key2',true); this.setSetting('key3',['arr1','arr2']); this.setSetting('key4',3); this.setSetting('key5',{ "foo" : "bar", "foo2" : "bar2" }); this.update(); }); }); this.readApplicationSettings().then(function() { equal(this.getSetting('key1'), 'val1', "String setting is set with correct value."); equal(this.getSetting('key2'), true, "Boolean setting is set with correct value."); deepEqual(this.getSetting('key3'), ['arr1','arr2'], "Array setting is set with correct value."); equal(this.getSetting('key4'), 3, "Integer setting is set with correct value."); deepEqual(this.getSetting('key5'), { "foo" : "bar", "foo2" : "bar2" }, "Object setting is set with correct value."); }); this.querySettings({ "settings.key1" : "val1" }).count(function(count) { equal(count, 1, "Found the setting via query."); }); this.subchain(platform).readPrimaryDomain().then(function() { var user1 = null; var userName1 = "user" + new Date().getTime(); this.createUser({ "name": userName1 }).then(function() { user1 = this; this.subchain(application).readApplicationPrincipalSettings(user1).then(function() { this.setSetting('ukey1', 'val1'); this.setSetting('ukey2', true); this.setSetting('ukey3', ['arr1','arr2']); this.setSetting('ukey4', 3); this.setSetting('ukey5', { "foo" : "bar", "foo2" : "bar2" }); this.update().reload().then(function() { equal(this.getSetting('ukey1'), 'val1', "Principal string setting is set with correct value."); equal(this.getSetting('ukey2'), true, "Principal boolean setting is set with correct value."); deepEqual(this.getSetting('ukey3'), ['arr1','arr2'], "Principal array setting is set with correct value."); equal(this.getSetting('ukey4'), 3, "Principal integer setting is set with correct value."); deepEqual(this.getSetting('ukey5'), { "foo" : "bar", "foo2" : "bar2" }, "Object setting is set with correct value."); }); this.then(function() { this.subchain(user1).del(); }); }); }); }); this.then(function() { this.subchain(applicationSettings).del().then(function() { this.subchain(application).querySettings({ "settings.key1" : "val1" }).count(function(count) { equal(count, 0, "Application settings has been deleted."); }); }); }); this.del(); }); this.then(function() { success(); }); }); var success = function() { start(); }; }); }(jQuery) );
import Base from '../Base'; import RelaunchMixin from '../mixins/Relaunch.mixin'; const BASE_URLS = { playbook: '/jobs/', project: '/project_updates/', system: '/system_jobs/', inventory: '/inventory_updates/', command: '/ad_hoc_commands/', workflow: '/workflow_jobs/', }; class Jobs extends RelaunchMixin(Base) { constructor(http) { super(http); this.baseUrl = '/api/v2/jobs/'; } readDetail(id, type) { return this.http.get(`/api/v2${BASE_URLS[type]}${id}/`); } readEvents(id, type = 'playbook', params = {}) { let endpoint; if (type === 'playbook') { endpoint = `/api/v2${BASE_URLS[type]}${id}/job_events/`; } else { endpoint = `/api/v2${BASE_URLS[type]}${id}/events/`; } return this.http.get(endpoint, { params }); } } export default Jobs;
/** * Copyright 2014 SCN SDK Community * * Original Source Code Location: * https://github.com/org-scn-design-studio-community/sdkpackage/ * * 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. */ jQuery.sap.require("sap.ui.table.Table"); sap.ui.commons.layout.AbsoluteLayout.extend("org.scn.community.databound.UI5Table", { setData : function(value) { var that = this; this._data = value; // clean mixed Data that._flatData = undefined; return this; }, getData : function(value) { return this._data; }, setMetadata : function(value) { this._metadata = value; return this; }, getMetadata : function() { return this._metadata; }, /* special code as we want to reset */ setDElements : function(value) { this.DElements = value; this._isInitialized = undefined; this._flatData = undefined; return this; }, getDElements : function() { return this.DElements; }, /* special code as we want to reset */ setDContentMode : function(value) { this.DContentMode = value; this._isInitialized = undefined; this._flatData = undefined; return this; }, getDContentMode : function() { return this.DContentMode; }, metadata: { properties: { "DVisibleRowCount": {type: "int"}, "DRowHeight": {type: "int"}, "DNavigationMode": {type: "string"}, "DCustomDimensions": {type: "string"}, "DHeaderColWidth": {type: "int"}, } }, initDesignStudio: function() { var that = this; that._table = new sap.ui.table.Table(this.getId() + "_ta", { selectionMode: sap.ui.table.SelectionMode.Single, // enableGrouping: true, } ); this.addStyleClass("scn-pack-FullSizeChildren"); // set the model that._oModel = new sap.ui.model.json.JSONModel(); that._table.setModel(that._oModel); that._table.bindRows("/data2DPlain"); this.addContent( that._table, {left: "0px", top: "0px"} ); org_scn_community_basics.hideNoDataOverlay(this.getId(), true); that.onAfterRendering = function() { }; }, renderer: {}, afterDesignStudioUpdate: function() { var that = this; that._table.setVisibleRowCount(this.getDVisibleRowCount()); that._table.setRowHeight(this.getDRowHeight()); var lNavMode = this.getDNavigationMode(); if(lNavMode == "Paginator") { that._table.setNavigationMode(sap.ui.table.NavigationMode.Paginator); } else { that._table.setNavigationMode(sap.ui.table.NavigationMode.Scrollbar); } // define model if(that._flatData == undefined) { var lData = this._data; var lMetadata = this._metadata; var lDimensions = this.getDElements(); if(lMetadata == undefined) { lMetadata = lData; } if(lData == "") { this._fakeData(); } else { var options = org_scn_community_databound.initializeOptions(); options.ignoreResults = true; that._vals = []; try{ that._flatData = org_scn_community_databound.flatten(lData,options); that._rowData = org_scn_community_databound.toRowTable(that._flatData,options); if(that._flatData && that._flatData.formattedValues && that._flatData.formattedValues.length > 0) { that._vals = that._flatData.formattedValues.slice(); }else if(that._flatData && that._flatData.values && that._flatData.values.length > 0){ that._vals = that._flatData.values.slice(); }else{ // Something happened. throw("No formatted or unformatted values found."); } }catch(e){ var errorMessage = e; if(e && e.indexOf("Incomplete data given.")>-1) errorMessage = "Incomplete data. Try assigning a datasource."; if(!that._flatData) that._flatData = { columnHeaders : ["Error"], rowHeaders : [errorMessage] }; that._vals = [[]]; } } that._table.removeAllColumns(); var rI=0; if(that._rowData) { for(rI=0;rI<that._rowData.dimensionHeaders.length;rI++){ that._table.addColumn(new sap.ui.table.Column({ label: new sap.ui.commons.Label( { text: that._rowData.dimensionHeaders[rI], design: sap.ui.commons.LabelDesign.Bold, }), template: new sap.ui.commons.Label( { design: sap.ui.commons.LabelDesign.Bold, }).bindProperty("text", ""+rI), sortProperty: ""+rI, filterProperty: ""+rI, width: that.getDHeaderColWidth()+"px" })); } for(var cI=0;cI<that._rowData.columnHeaders.length;cI++){ that._table.addColumn(new sap.ui.table.Column({ label: new sap.ui.commons.Label({text: that._rowData.columnHeaders[cI]}), template: new sap.ui.commons.Label( { design: sap.ui.commons.LabelDesign.Normal, textAlign: sap.ui.core.TextAlign.Right, } ).bindProperty("text", ""+rI), sortProperty: ""+rI, filterProperty: ""+rI, })); rI = rI+1; } that._table.setFixedColumnCount(that._rowData.dimensionHeaders.length); } } that._oModel.setData(that._rowData); }, _fakeData : function () { } });
module.exports = function (client) { const baseUrl = '/api-endpoints/'; return { create (name, endpointConfig) { return client .put(`${baseUrl}${encodeURIComponent(name)}`) .send(endpointConfig) .then(res => res.body); }, update (name, endpointConfig) { return this.create(name, endpointConfig); }, remove (name) { return client .del(`${baseUrl}${encodeURIComponent(name)}`) .then(res => res.body); }, info (name) { return client .get(`${baseUrl}${encodeURIComponent(name)}`) .then(res => res.body); }, list () { return client .get(baseUrl) .then(res => res.body); } }; };
define(function(require) { 'use strict'; var modules = require('modules'); var states = require('states'); var _ = require('lodash'); var angular = require('angular'); states.state('applications.detail.deployment.input', { url: '/input', templateUrl: 'views/applications/application_deployment_input.html', controller: 'ApplicationDeploymentSetupCtrl', menu: { id: 'am.applications.detail.deployment.input', state: 'applications.detail.deployment.input', key: 'APPLICATIONS.DEPLOYMENT.INPUT', icon: 'fa fa-sign-in', roles: ['APPLICATION_MANAGER', 'APPLICATION_DEPLOYER'], // is deployer, priority: 300, step: { nextStepId: 'am.applications.detail.deployment.deploy', taskCodes: ['INPUT_PROPERTY', 'ORCHESTRATOR_PROPERTY'] } } }); modules.get('a4c-applications').controller('ApplicationDeploymentSetupCtrl', ['$scope', '$upload', 'applicationServices', '$http', '$filter', 'deploymentTopologyServices', function($scope, $upload, applicationServices, $http, $filter, deploymentTopologyServices) { $scope.isAllowedInputDeployment = function() { return !_.isEmpty($filter('allowedInputs')($scope.deploymentContext.deploymentTopologyDTO.topology.inputs)); }; /* Handle properties inputs */ $scope.updateInputValue = function(definition, inputValue, inputId) { // No update if it's the same value if (_.undefined($scope.deploymentContext.deploymentTopologyDTO.topology.inputProperties)) { $scope.deploymentContext.deploymentTopologyDTO.topology.inputProperties = {}; } if (inputValue === $scope.deploymentContext.deploymentTopologyDTO.topology.inputProperties[inputId]) { return; } else { $scope.deploymentContext.deploymentTopologyDTO.topology.inputProperties[inputId] = inputValue; } return deploymentTopologyServices.updateInputProperties({ appId: $scope.application.id, envId: $scope.deploymentContext.selectedEnvironment.id }, angular.toJson({ inputProperties: $scope.deploymentContext.deploymentTopologyDTO.topology.inputProperties }), function(result){ if(!result.error) { $scope.updateScopeDeploymentTopologyDTO(result.data); } }).$promise; }; // Artifact upload handler $scope.doUploadArtifact = function(file, artifactName) { if (_.undefined($scope.uploads)) { $scope.uploads = {}; } $scope.uploads[artifactName] = { 'isUploading': true, 'type': 'info' }; $upload.upload({ url: 'rest/latest/topologies/' + $scope.topologyDTO.topology.id + '/inputArtifacts/' + artifactName + '/upload', file: file }).progress(function(evt) { $scope.uploads[artifactName].uploadProgress = parseInt(100.0 * evt.loaded / evt.total); }).success(function(success) { $scope.deploymentContext.deploymentTopologyDTO.topology.inputArtifacts[artifactName].artifactRef = success.data.topology.inputArtifacts[artifactName].artifactRef; $scope.deploymentContext.deploymentTopologyDTO.topology.inputArtifacts[artifactName].artifactName = success.data.topology.inputArtifacts[artifactName].artifactName; $scope.uploads[artifactName].isUploading = false; $scope.uploads[artifactName].type = 'success'; }).error(function(data, status) { $scope.uploads[artifactName].type = 'error'; $scope.uploads[artifactName].error = {}; $scope.uploads[artifactName].error.code = status; $scope.uploads[artifactName].error.message = 'An Error has occurred on the server!'; }); }; $scope.onArtifactSelected = function($files, artifactName) { var file = $files[0]; $scope.doUploadArtifact(file, artifactName); }; $scope.refreshOrchestratorDeploymentPropertyDefinitions = function() { return $http.get('rest/latest/orchestrators/' + $scope.deploymentContext.deploymentTopologyDTO.topology.orchestratorId + '/deployment-property-definitions').success(function(result) { if (result.data) { $scope.deploymentContext.orchestratorDeploymentPropertyDefinitions = result.data; } }); }; $scope.refreshOrchestratorDeploymentPropertyDefinitions(); $scope.updateDeploymentProperty = function(propertyDefinition, propertyName, propertyValue) { if (propertyValue === $scope.deploymentContext.deploymentTopologyDTO.topology.providerDeploymentProperties[propertyName]) { return; // no change } var deploymentPropertyObject = { 'definitionId': propertyName, 'value': propertyValue }; return applicationServices.checkProperty({ orchestratorId: $scope.deploymentContext.deploymentTopologyDTO.topology.orchestratorId }, angular.toJson(deploymentPropertyObject), function(data) { if (data.error === null) { $scope.deploymentContext.deploymentTopologyDTO.topology.providerDeploymentProperties[propertyName] = propertyValue; // Update deployment setup when properties change deploymentTopologyServices.updateInputProperties({ appId: $scope.application.id, envId: $scope.deploymentContext.selectedEnvironment.id }, angular.toJson({ providerDeploymentProperties: $scope.deploymentContext.deploymentTopologyDTO.topology.providerDeploymentProperties }), function(result){ if(!result.error) { $scope.updateScopeDeploymentTopologyDTO(result.data); } } ); } }).$promise; }; } ]); //controller }); //Define
var searchData= [ ['ebert_5fgraph_2eh_0',['ebert_graph.h',['../ebert__graph_8h.html',1,'']]], ['element_2ecc_1',['element.cc',['../element_8cc.html',1,'']]], ['encoding_2ecc_2',['encoding.cc',['../encoding_8cc.html',1,'']]], ['encoding_2eh_3',['encoding.h',['../encoding_8h.html',1,'']]], ['encodingutils_2eh_4',['encodingutils.h',['../encodingutils_8h.html',1,'']]], ['entering_5fvariable_2ecc_5',['entering_variable.cc',['../entering__variable_8cc.html',1,'']]], ['entering_5fvariable_2eh_6',['entering_variable.h',['../entering__variable_8h.html',1,'']]], ['environment_2ecc_7',['environment.cc',['../environment_8cc.html',1,'']]], ['environment_2eh_8',['environment.h',['../environment_8h.html',1,'']]], ['eulerian_5fpath_2eh_9',['eulerian_path.h',['../eulerian__path_8h.html',1,'']]], ['expr_5farray_2ecc_10',['expr_array.cc',['../expr__array_8cc.html',1,'']]], ['expr_5fcst_2ecc_11',['expr_cst.cc',['../expr__cst_8cc.html',1,'']]], ['expressions_2ecc_12',['expressions.cc',['../expressions_8cc.html',1,'']]] ];
/* Run a HTTP server that registers its location using the Datawire * Microservices Development Kit (MDK). * * Make sure you have the DATAWIRE_TOKEN environment variable set with your * access control token. */ /* jshint node: true */ "use strict"; var process = require("process"); var args = process.argv.splice(process.execArgv.length + 2); if (args.length === 0) { throw "usage: server service-name [port]"; } var mdk = require("datawire_mdk").mdk; var MDK = mdk.start(); process.on("beforeExit", function (code) { MDK.stop(); }); var host = "127.0.0.1"; // We are reachable only on localhost var port = 5000; var service = args[0]; if (args.length > 1) { port = parseInt(args[1]) || port; } MDK.register(service, "1.0.0", "http://" + host + ":" + port.toString()); var express = require("express"); var app = express(); app.get("/", function (req, res) { // Join the logging context from the request, if possible: var ssn = MDK.join(req.get(mdk.MDK.CONTEXT_HEADER)); ssn.info(service, "Received a request."); res.send("Hello World (Node/Express)"); }); app.listen(port, host);
'use strict'; var common = require('../common'); var assert = require('assert'); var Transform = require('stream').Transform; var _transformCalled = false; function _transform(d, e, n) { _transformCalled = true; n(); } var _flushCalled = false; function _flush(n) { _flushCalled = true; n(); } var t = new Transform({ transform: _transform, flush: _flush }); t.end(new Buffer('blerg')); t.resume(); process.on('exit', function() { assert.equal(t._transform, _transform); assert.equal(t._flush, _flush); assert(_transformCalled); assert(_flushCalled); });
/** * @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 resolve = require( 'path' ).resolve; var glob = require( 'glob' ).sync; var cwd = require( '@stdlib/process/cwd' ); var copy = require( '@stdlib/utils/copy' ); var DEFAULTS = require( './defaults.json' ); var validate = require( './validate.js' ); var linter = require( './lint.js' ); var IGNORE = require( './ignore_patterns.json' ); // MAIN // /** * Synchronously lints filenames. * * @param {Options} [options] - function options * @param {string} [options.dir] - root directory from which to search for files * @param {string} [options.pattern='**\/*'] - filename pattern * @throws {TypeError} options argument must be an object * @throws {TypeError} must provide valid options * @returns {(ObjectArray|EmptyArray)} list of lint errors * * @example * var errs = lint(); * // returns [...] */ function lint( options ) { var pattern; var names; var opts; var err; var dir; opts = copy( DEFAULTS ); if ( arguments.length ) { err = validate( opts, options ); if ( err ) { throw err; } } if ( opts.dir ) { dir = resolve( cwd(), opts.dir ); } else { dir = cwd(); } pattern = opts.pattern; opts = { 'cwd': dir, 'ignore': IGNORE, 'nodir': true // do not match directories }; names = glob( pattern, opts ); return linter( names ); } // EXPORTS // module.exports = lint;
"use strict"; // check number && integer && strictly positive module.exports.isNatural = function (d) { return (typeof d === "number") && (d % 1 === 0) && (d > 0); }; module.exports.isPositive = function (d) { return (typeof d === "number") && (d > 0); };
const { Command } = require("discord.js-commando"); module.exports = class Say extends Command { constructor(client) { super(client, { name: "say", aliases: ["echo", "speak"], group: "util", memberName: "say", description: "Says what you want it to say", examples: ["say hello"], autoAliases: true, args: [{ key: "sayText", prompt: "What do you want me to say?", type: "string" }] }); } run(msg, { sayText }) { if (msg.deletable === true) { msg.delete(); } return msg.say(sayText); }; }
var getColor = function (value, p, record) { return "<span style='color:blue;'>" + value + "</span>"; } var getDayNumber = function (value, p, record) { if (value == "" || value == 0) { return "<span style='float:right;'>0</span>"; } return "<b style='float:right;color:blue;'>" + value + "</b>"; } //Lấy số ngày phép được hưởng mỗi tháng var getUsedDayPerMonth = function (value, p, record) { if (value == "" || value == 0) { return ""; } return "<b style='float:right;color:red;'>" + value + "</b>"; } //Lấy số ngày phép được hưởng mỗi năm var getUsedDayPerYear = function (value, p, record) { if (value == "" || value == 0) { return "<span style='float:right;'>0</span>"; } return "<b style='float:right;color:red;'>" + value + "</b>"; } //Lấy tổng số ngày phép được hưởng var getTotalDaysPerYear = function (value, p, record) { if (value == "" || value == 0) { return "<span style='float:right;'>0</span>"; } return "<b style='float:right;color:blue;'>" + value + "</b>"; } var enterKeyPressHandler = function (f, e) { if (e.getKey() == e.ENTER) { PagingToolbar1.pageIndex = 0; PagingToolbar1.doLoad(); Store1.reload(); } } //Xóa các điều kiện lọc var clearFilter = function () { txtMaCB.reset(); txtHoTen.reset(); cbPhongBan.reset(); cbTo.reset(); txtTongSoNgayPhep.reset(); txtSoNgayDaSuDung.reset(); txtSoNgayConLai.reset(); txtCongDonNgayPhep.reset(); txtThamNien.reset(); PagingToolbar1.pageIndex = 0; PagingToolbar1.doLoad(); Store1.reload(); } var ValidateNgayPhep = function () { if (nbfSoNgayPhep.getValue() == '') { alert("Bạn chưa nhập số ngày nghỉ phép năm nay"); nbfSoNgayPhep.focus(); return false; } if (nbfSoNgayPhepCongDonToiDaTrong1Thang.getValue() == '') { alert("Bạn chưa nhập số ngày phép được cộng dồn trong 1 tháng"); nbfSoNgayPhepCongDonToiDaTrong1Thang.focus(); return false; } if (nbfSoNgayPhepThuongThem.getValue() != '' && dfHanDungNgayPhepThuongThem.getValue() == '') { alert("Bạn chưa nhập hạn sử dụng ngày phép được thưởng thêm"); return false; } if (chkNgayNghiPhepNamTruoc.checked == true && dfHanDungNgayPhepNamTruoc.getValue() == '') { alert("Bạn chưa nhập hạn dùng ngày nghỉ phép của năm trước"); return false; } if (rdChiNhungNhanVienDuocChon.checked == false && rdApDungChoTatCaNhanVien.checked == false) { alert("Bạn chưa chọn đối tượng được tính ngày phép"); return false; } return true; } var RenderSoNgayPhepDaSuDung = function (value, p, record) { if (value == "0" || value == null) { return ""; } return value; } var ResetForm = function () { dfHanSuDungNPNamTruoc.reset(); nbfSoNgayPhep.reset(); nbfSoNgayPhepThuongThem.reset(); chkNgayNghiPhepNamTruoc.reset(); dfHanDungNgayPhepNamTruoc.reset(); dfHanDungNgayPhepThuongThem.reset(); nbfSoNgayPhepCongDonToiDaTrong1Thang.reset(); rdApDungChoTatCaNhanVien.enable(); rdChiNhungNhanVienDuocChon.setValue(false); rdApDungChoTatCaNhanVien.setValue(false); } var RenderThamNien = function (value, p, record) { var totalDay = value * 1; if (totalDay == 0) { return ""; } var month = Math.floor(totalDay / 30); var remainDay = totalDay % 30; var year = 0; var remainMonth = 0; var rs = ""; if (month >= 12) { year = Math.floor(month / 12); remainMonth = month % 12; } if (year > 0) { rs = year + " năm "; if (remainMonth > 0) { rs += remainMonth + " tháng"; } } else { rs = month + " tháng "; if (remainDay > 0) { rs += remainDay + " ngày"; } } return rs; }
Package('{Name}.Services', { Bootstrap : new Class({ implements: ['exportService', 'importService', 'getUserId'], initialize : function() { this.serviceName = 'bootstrap'; this.exportServices = [this.serviceName]; this.importServices = [] SYMPHONY.services.make(this.serviceName, this, this.implements, true); SAPPHIRE.application.listen('start', this.onStart.bind(this)); SAPPHIRE.application.listen('ready', this.onReady.bind(this)); }, exportService : function(name) { this.exportServices.push(name); }, importService : function(name) { this.importServices.push(name); }, getUserId : function() { return this.userId; }, onStart : function(done) { SYMPHONY.remote.hello() .then(function(data) { done(); }.bind(this)) }, onReady : function() { return SYMPHONY.application.register({NAME}.appId, this.importServices.unique(), this.exportServices.unique()) .then(function(response) { this.userId = response.userReferenceId; {NAME}.events.fire('start'); }.bind(this)) .done(); }, }) }); new {Name}.Services.Bootstrap();
var net = require('net'); Stomp = require('./stomp'); wrapTCP = function(port, host) { var socket, ws; socket = null; ws = { url: 'tcp:// ' + host + ':' + port, send: function(d) { return socket.write(d); }, close: function() { return socket.end(); } }; socket = net.connect(port, host, function(e) { return ws.onopen(); }); socket.on('error', function(e) { return typeof ws.onclose === "function" ? ws.onclose(e) : void 0; }); socket.on('close', function(e) { return typeof ws.onclose === "function" ? ws.onclose(e) : void 0; }); socket.on('data', function(data) { var event; event = { 'data': data.toString() }; return ws.onmessage(event); }); return ws; };
var structdpctl__params = [ [ "aux", "structdpctl__params.html#a875761aaf475439ac2f51f564f8a558d", null ], [ "is_appctl", "structdpctl__params.html#a4d1857bb1afb99d03f1586a81c415b17", null ], [ "may_create", "structdpctl__params.html#aad17dd95f7fe3ebcceb3a0745e84b372", null ], [ "output", "structdpctl__params.html#a9dce609f19744eec92e846c45eef8b5a", null ], [ "print_statistics", "structdpctl__params.html#ab7e264c4a84c35d004e4e5df863438a7", null ], [ "usage", "structdpctl__params.html#a4d369f75cf9f886b57ead7cf1aabd1cf", null ], [ "verbosity", "structdpctl__params.html#a08a8be187581be2eb16d38bf0ede8f57", null ], [ "zero_statistics", "structdpctl__params.html#ae830308818ce5edb0dcb5a6a70f48eb8", null ] ];