text
stringlengths
2
6.14k
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const path = require("path"); const cordova_config_1 = require("../utils/cordova-config"); function LabAppView(req, res) { return res.sendFile('index.html', { root: path.join(__dirname, '..', '..', 'lab') }); } exports.LabAppView = LabAppView; function ApiCordovaProject(req, res) { cordova_config_1.buildCordovaConfig((err) => { res.status(400).json({ status: 'error', message: 'Unable to load config.xml' }); }, (config) => { res.json(config); }); } exports.ApiCordovaProject = ApiCordovaProject;
angular.module('CareFull', ['ui.router','rzModule']);
import { check } from "meteor/check"; import processDoc from "./processDoc"; /** * getDoc * fetch repo profile from github and store in RepoData collection * @param {Object} doc - mongo style selector for the doc * @returns {undefined} returns */ function getDoc(options) { check(options, Object); // get repo details const docRepo = ReDoc.Collections.Repos.findOne({ repo: options.repo }); // we need to have a repo if (!docRepo) { console.log(`redoc/getDocSet: Failed to load repo data for ${options.repo}`); return false; } // TOC item for this doc const tocItem = ReDoc.Collections.TOC.findOne({ alias: options.alias, repo: options.repo }); processDoc({ branch: options.branch, repo: options.repo, alias: options.alias, docRepo, tocItem }); } export default getDoc; export { flushDocCache };
/* Um carro, e só */ class Car { constructor(posx, posy, width, height, lifeTime, color) { this.x = posx; this.y = posy; this.lifeTime = lifeTime; this.color = color; this.width = width; this.height = height; this.im = new Image(); this.im.src = carSprite.src; } draw(ctx) { ctx.save(); ctx.fillStyle = this.color; ctx.lineWidth = 1; ctx.drawImage( this.im, carSprite.x, carSprite.y, carSprite.w, carSprite.h, this.x, this.y, this.width, this.height ); } }
var _engine_core_8h = [ [ "EngineCore", "class_ludo_1_1_engine_core.html", "class_ludo_1_1_engine_core" ], [ "LD_EXPORT_ENGINE_CORE", "_engine_core_8h.html#a0ced60c95a44fd7969a8d0b789257241", null ] ];
(function () { 'use strict'; angular.module('ph.account') // http://bartwullems.blogspot.hu/2015/02/angular-13-pending.html .directive("isUniqueEmailAddress", ['$q', '$http', function ($q, $http) { return { restrict: "A", require: "ngModel", link: function (scope, element, attributes, ngModel) { ngModel.$asyncValidators.isUnique = function (modelValue, viewValue) { return $http.post('/api/v0/email-address-check', {emailAddress: viewValue}).then( function (response) { if (!response.data.validEmailAddress) { return $q.reject(response.data.errorMessage); } return true; } ); }; } }; }]); })();
function drawBall() { ctx.beginPath(); ctx.arc(x, y, ballRadius, 0, Math.PI*2); ctx.fillStyle = color; ctx.strokeStyle = "#FF0000"; ctx.stroke(); ctx.fill(); ctx.closePath(); }
const {series} = require("gulp"), bump = require("./gulp_modules/task-bump"), bump_minor = require("./gulp_modules/task-bump-minor"), bump_major = require("./gulp_modules/task-bump-major"), readme = require("./gulp_modules/task-readme"), replace_version = require("./gulp_modules/task-replace-version"), make_pot = series(replace_version, require("./gulp_modules/task-pot")), // pot = series(make_pot, require("./gulp_modules/task-clean-pot")), pot = make_pot, pomo = series(pot, require("./gulp_modules/task-tivwp_pomo")), sass = require("./gulp_modules/task-sass"), uglify = require("./gulp_modules/task-uglify"), product_info = require("./gulp_modules/task-product-info"), dist = series(readme, sass, uglify, product_info, pomo) ; exports.bump = bump; exports.bump_minor = bump_minor; exports.bump_major = bump_major; exports.readme = readme; exports.replace_version = replace_version; exports.pot = pot; exports.pomo = pomo; exports.sass = sass; exports.uglify = uglify; exports.dist = dist; exports.default = exports.dist;
function date(pub_date){ var date = new Date( Date.parse(pub_date+' UTC')); return date.toLocaleString(); }
/* Copyright 2019-2022 Michael Pozhidaev <msp@luwrain.org> This file is part of LUWRAIN. LUWRAIN is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. LUWRAIN is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ Luwrain.addCommand("suspend", function(){ if (!Luwrain.popups.confirmDefaultYes(Luwrain.i18n.static.powerSuspendPopupName, Luwrain.i18n.static.powerSuspendPopupText)) return; Luwrain.os.suspend(); });
'use strict'; // Create the valorchat configuration module.exports = function (io, socket) { // Emit the status event when a new socket client is connected io.emit('ValorchatMessage', { type: 'status', text: 'Is now connected', created: Date.now(), profileImageURL: socket.request.user.profileImageURL, username: socket.request.user.username }); // Send a valorchat messages to all connected sockets when a message is received socket.on('ValorchatMessage', function (message) { message.type = 'message'; message.created = Date.now(); message.profileImageURL = socket.request.user.profileImageURL; message.username = socket.request.user.username; // Emit the 'ValorchatMessage' event io.emit('ValorchatMessage', message); }); // Emit the status event when a socket client is disconnected socket.on('disconnect', function () { io.emit('ValorchatMessage', { type: 'status', text: 'disconnected', created: Date.now(), profileImageURL: socket.request.user.profileImageURL, username: socket.request.user.username }); }); };
///////////////////////////////////////////////////////////////////////////////// // // Jobbox WebGUI // Copyright (C) 2014-2015 Komatsu Yuji(Zheng Chuyu) // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. // ///////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////// // // Function: // // Purpose: // // Parameters: // // Return value: // // Author: Komatsu Yuji(Zheng Chuyu) // ///////////////////////////////////////////////////////////////////////////////// Ext.define('Jobbox.store.HistJobunit', { extend: 'Ext.data.Store', model: 'Jobbox.model.HistJobunit', autoLoad: true, autoDestroy: false, autoSync: false, remoteSort: true, proxy: { type: 'rest', url: location.pathname + '/hist_jobunits', appendId: true, format: 'json', reader: { root: 'hist_jobunits', totalProperty: 'total_count', }, }, });
// @flow import React from 'react'; import type { Trigger } from '../../Domain/Trigger'; import type { Maintenance } from '../../Domain/Maintenance'; import TriggerListItem from '../TriggerListItem/TriggerListItem'; import cn from './TriggerList.less'; type Props = {| items: Array<Trigger>; onChange?: (triggerId: string, maintenance: Maintenance, metric: string) => void; onRemove?: (triggerId: string, metric: string) => void; |}; export default function TriggerList(props: Props): React.Element<*> { const { items, onChange, onRemove } = props; return ( <div> {items.length === 0 ? <div className={cn('no-result')}>No results :-(</div> : items.map(item => <div className={cn('item')} key={item.id}> <TriggerListItem data={item} onChange={onChange && ((maintenance, metric) => onChange(item.id, maintenance, metric))} onRemove={onRemove && (metric => onRemove(item.id, metric))} /> </div> )} </div> ); }
var jsVars = { appBaseUrl: null, appBasePath: null, init: function () { var jsVarsAttributes = angular.element('#js-vars')[0].attributes; jsVars.appBaseUrl = jsVarsAttributes['data-base-url'].value; jsVars.appBasePath = jsVarsAttributes['data-basepath'].value; } }; jsVars.init(); var config = { basePath: jsVars.appBasePath+'/ng-front/', restServer: jsVars.appBaseUrl+'/api' }; var Question = { TYPE_QCM: 1, TYPE_FREE: 2 }; function getUTCTimestamp() { var now = new Date(); var utc_now = new Date( now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), now.getUTCHours(), now.getUTCMinutes(), now.getUTCSeconds(), now.getUTCMilliseconds() ); return utc_now.getTime(); } /** * Filter to create a Javascript date */ angular.module('zcpeFilters', []).filter('jsDate', function () { return function (sDate) { return new Date(sDate); } }); var zcpe = angular.module('zcpe', [ 'ngRoute', 'pascalprecht.translate', 'ngCookies', 'ngStorage', 'angular-locker', 'controllers-quizz', 'hljs', 'timer', 'zcpeFilters' ]);
const Command = require('../../structures/Command'); const request = require('node-superfetch'); const { GOOGLE_KEY } = process.env; module.exports = class ToxicityCommand extends Command { constructor(client) { super(client, { name: 'toxicity', aliases: ['perspective', 'comment-toxicity'], group: 'analyze', memberName: 'toxicity', description: 'Determines the toxicity of text.', credit: [ { name: 'Perspective API', url: 'https://www.perspectiveapi.com/#/' } ], args: [ { key: 'text', prompt: 'What text do you want to test the toxicity of?', type: 'string' } ] }); } async run(msg, { text }) { try { const { body } = await request .post('https://commentanalyzer.googleapis.com/v1alpha1/comments:analyze') .query({ key: GOOGLE_KEY }) .send({ comment: { text }, languages: ['en'], requestedAttributes: { TOXICITY: {} } }); const toxicity = Math.round(body.attributeScores.TOXICITY.summaryScore.value * 100); if (toxicity >= 70) return msg.reply(`Likely to be perceived as toxic. (${toxicity}%)`); if (toxicity >= 40) return msg.reply(`Unsure if this will be perceived as toxic. (${toxicity}%)`); return msg.reply(`Unlikely to be perceived as toxic. (${toxicity}%)`); } catch (err) { return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); } } };
export const getIsAdmin = (state) => state.session.user?.administrator; export const getUserId = (state) => state.session.user?.id; export const getDevices = (state) => Object.values(state.devices.items); export const getPosition = (id) => (state) => state.positions.items[id];
import sinon from 'sinon'; import chai from 'chai'; import sinonChai from "sinon-chai"; import subset from 'chai-subset'; window.sinon = sinon; window.chai = chai; chai.use(sinonChai); chai.use(subset); window.expect = chai.expect; window.should = chai.should; import * as fixtures from './fixtures.js'; window.fixtures = fixtures; var context = require.context('.', true, /.spec.js(x?)$/); //make sure you have your directory and regex test set correctly! context.keys().forEach(context);
var classglobal = [ [ "Buffer", "df/d84/classglobal.html#a77b5ab3a88955255ac7abc7251919fbc", null ], [ "run", "df/d84/classglobal.html#a917c15ea7d2eafaa6df0aea5868a86e7", null ], [ "require", "df/d84/classglobal.html#a9b11defd1000737a5b70b50edfcc8156", null ], [ "GC", "df/d84/classglobal.html#a02a28758a633a7b1493471415c8949ba", null ], [ "console", "df/d84/classglobal.html#a69cd8fa430cb4536156e8052a37c9303", null ] ];
//Settings actype = ['image/png','image/jpeg','image/jpg','image/gif']; /* Accepted mime type */ maxweight = 819200; /* Max file size in octets */ maxwidth = 150; /* Max width of the image */ maxheight = 150; /* Max height*/ //Caching variable selector ish = $('.ish'); /* On attach element hide or show */ msgUp = $('.msgUp'); /* container message, infos, error... */ filezone = $('.filezone'); /* Selector filezone label */ fileprev = $('.filezone').children('img'); /* Selector img element */ filesend = $('#filesend'); /* Selector input file (children label) */ fileup = $('#fileup'); /* Selector button submit */ reset = $('#reset'); /* Selector button reset */ ish.hide(); /* Initial hide */ $(':file').change(function(e) { //Cancel the default execution e.preventDefault(); //Full file file = this.files[0]; var filer = new FileReader; filer.onload = function() { //Get size and type var aType = file.type; var aSize = file.size; //Check the file size if(aSize > maxweight) { msgUp.text('To large, maximum'+ maxweight +' bytes'); return; } //Check the file type if($.inArray(aType, actype) === -1) { msgUp.text('File type not allowed'); return; } //Set src / preview fileprev.attr('src', filer.result); //Make new Image for get the width / height var image = new Image(); image.src = filer.result; image.onload = function() { //Set width / height aWidth = image.width; aHeight = image.height; //Check width if(aWidth > maxwidth) { msgUp.text('Maximum' + maxwidth +' width allowed'); return; } //Check height if(aHeight > maxheight) { msgUp.text('Maximum' + maxheight +' height allowed'); return; } //Success of every check, display infos about the image and show up the <img> tag msgUp.html('Size :'+ aSize +' bytes<br>Filetype : '+ aType +'<br>Width :'+ aWidth +' px<br>Height: '+ aHeight +' px'); ish.show(); filesend.addClass('lock').css('height','0%'); //End image }; //End filer }; //File is up filer.readAsDataURL(file); }); //input file prevent on lock $(document).off('click', '#filesend'); $(document).on('click', '#filesend', function(e) { //Cancel the default execution if img ready to be send to php if($(this).hasClass('lock')) e.preventDefault(); }); //On reset $(document).off('click', '#reset'); $(document).on('click', '#reset', function(e) { //Cancel the default execution e.preventDefault(); //Remove the href link fileprev.attr('src', ''); //Set default message msgUp.text('Drop your avatar !'); //Remove the lock of the input file if(filesend.hasClass('lock')) filesend.css('height','100%').removeClass(); //Set default reset value $(this).val('Clear'); //Back to hide ish.hide(); }); //On fileup $(document).off('click', '#fileup'); $(document).on('click', '#fileup', function(e) { //Cancel the default execution e.preventDefault(); //Set variable which contain the entiere form / field var filesfm = new FormData(document.querySelector("form")); $.ajax({ url: 'upload.php', //Server side script (php...) type: 'POST', data:filesfm, processData: false, //Avoid jquery process contentType: false //Avoid set content type (done by var filesfm) }).done(function(msg) { //Hide the button upload fileup.hide(); //Change the text reset button (make as reinitialize the form) reset.val('Upload again !'); //On success upload if(msg === 'err') msgUp.text('Something went wrong, try again.'); //That should not happen ! else msgUp.text('Success, your file is available '+ msg); //Add the url of your file except the filename generated }); });
const {ipcFuncMain, ipcFuncMainCb, getIpcNameFunc, sendToBackgroundPage} = require('./util-main') const {ipcMain} = require('electron') const getIpcName = getIpcNameFunc('ContextMenus') const extInfos = require('../../extensionInfos') const sharedState = require('../../sharedStateMain') ipcMain.on('get-extension-menu',(e) => ipcMain.emit('get-extension-menu-reply', null, sharedState.extensionMenu)) ipcMain.on('chrome-context-menus-clicked', async (e, extensionId, tabId, info)=>{ sendToBackgroundPage(extensionId, getIpcName('onClicked'), info, tabId) }) ipcFuncMainCb('contextMenus', 'create', (e, extensionId, createProperties, cb)=> { console.log('contextMenu', 'create', extensionId, createProperties) const manifest = extInfos[extensionId].manifest const icon = Object.values(manifest.icons)[0] const menuItemId = createProperties.id if(!sharedState.extensionMenu[extensionId]) sharedState.extensionMenu[extensionId] = [] sharedState.extensionMenu[extensionId].push({properties: createProperties, menuItemId, icon}) sharedState.extensionMenu[extensionId].sort((a,b) => (a.properties.count || 99) - (b.properties.count || 99)) //TODO onClick cb() }) ipcFuncMain('contextMenus', 'update', (e, extensionId, id, updateProperties) => { const menu = sharedState.extensionMenu[extensionId] if(menu){ const item = menu.find(propeties=>propeties.id === id || propeties.menuItemId === id) if(item) Object.assign(item.properties,updateProperties) } }) ipcFuncMain('contextMenus', 'remove', (e, extensionId, menuItemId) => { const menu = sharedState.extensionMenu[extensionId] if(menu){ const i = menu.findIndex(propeties=>propeties.menuItemId === menuItemId || propeties.id === menuItemId) if(i != -1) menu.splice(i,1) } }) ipcFuncMain('contextMenus', 'removeAll', (e, extensionId) => { console.log('contextMenu', 'removeAll', extensionId) delete sharedState.extensionMenu[extensionId] })
var Card = require("./Card"); var CARDS = require("./cards"); var CARDNUM = require("./cardnum"); var api = require("../rpcapi"); var util = require("../util"); var state = require("../state"); var imgUtil = require("../img"); // INDEX ----------------------------------------------------------------------- function IndexCard() { Card.call(this, CARDNUM.INDEX, "#card-index"); } IndexCard.prototype = Object.create(Card.prototype); IndexCard.prototype.show = function() { Card.prototype.show.call(this); state.toCard(this); util.setHeader("Foxi"); util.setSubheader(); util.showBackButton(function() { CARDS.CONNECTION.activate(); }); }; IndexCard.prototype.load = function() { var card = this; card.render('index'); $("a[data-card-link]").on('click', function() { util.freezeUI(this); var linked = CARDS[$(this).attr('data-card-link')]; linked.activate(); }); api.VideoLibrary.GetRecentlyAddedMovies({ properties: [ 'art' ], limits: { end: 4 } }).then(function(data) { card.render('index_recent_movies', data.result, '#index-recent-movies'); imgUtil.loadImages($("#index-recent-movies img[data-cache-url]"), imgUtil.dimensions.movie); }); api.VideoLibrary.GetRecentlyAddedEpisodes({ properties: [ 'art' ], limits: { end: 4 } }).then(function(data) { card.render('index_recent_episodes', data.result, '#index-recent-episodes'); imgUtil.loadImages($("#index-recent-episodes img[data-cache-url]"), imgUtil.dimensions.tv_thumb); }); this.loaded = true; this.show(); }; module.exports = new IndexCard();
/* * Katana - a powerful, open-source screenshot utility * * Copyright (C) 2018, Gage Alexander <gage@washedout.co> * * Katana is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * Katana is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Katana. If not, see <http://www.gnu.org/licenses/>. */ const packager = require('electron-packager') const options = { platform: ['darwin'], arch: 'x64', icon: './app/static/images/icon', dir: '.', ignore: ['build'], out: './build/Release', overwrite: true, prune: true } packager(options, (error, path) => { if (error) { return ( console.log(`Error: ${error}`) ) } console.log(`Package created, path: ${path}`) })
// GoSquared var GoSquared = {}; GoSquared.acct = "GSN-064561-T"; (function(w){ function gs(){ w._gstc_lt = +new Date; var d = document, g = d.createElement("script"); g.type = "text/javascript"; g.src = "//d1l6p2sc9645hc.cloudfront.net/tracker.js"; var s = d.getElementsByTagName("script")[0]; s.parentNode.insertBefore(g, s); } w.addEventListener ? w.addEventListener("load", gs, false) : w.attachEvent("onload", gs); })(window); // Google Analytics var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-40084408-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();
/*! * jQuery UI Effects Transfer 1.10.1 * http://jqueryui.com * * Copyright 2013 jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license * * http://api.jqueryui.com/transfer-effect/ * * Depends: * jquery.ui.effect.js */ (function( $, undefined ) { $.effects.effect.transfer = function( o, done ) { var elem = $( this ), target = $( o.to ), targetFixed = target.css( "position" ) === "fixed", body = $("body"), fixTop = targetFixed ? body.scrollTop() : 0, fixLeft = targetFixed ? body.scrollLeft() : 0, endPosition = target.offset(), animation = { top: endPosition.top - fixTop , left: endPosition.left - fixLeft , height: target.innerHeight(), width: target.innerWidth() }, startPosition = elem.offset(), transfer = $( "<div class='ui-effects-transfer'></div>" ) .appendTo( document.body ) .addClass( o.className ) .css({ top: startPosition.top - fixTop , left: startPosition.left - fixLeft , height: elem.innerHeight(), width: elem.innerWidth(), position: targetFixed ? "fixed" : "absolute" }) .animate( animation, o.duration, o.easing, function() { transfer.remove(); done(); }); }; })(jQuery);
var request = require('request'); var cheerio = require('cheerio'); var admin = require("firebase-admin"); //var serviceAccount = require("tehillim-17559-firebase-adminsdk-gx90v-b712a63ab5.json"); admin.initializeApp({ credential: admin.credential.cert("tehillim-17559-firebase-adminsdk-gx90v-b712a63ab5.json"), databaseURL: "https://tehillim-17559.firebaseio.com" }); // As an admin, the app has access to read and write all data, regardless of Security Rules var db = admin.database(); // Attach an asynchronous callback to read the data at our posts reference //ref.on("value", function (snapshot) { // console.log(snapshot.val()); //}, function (errorObject) { // console.log("The read failed: " + errorObject.code); //}); var psalmId = 1; var stripeHtml = function (text) { return text.replace(/<i><\/i>/g, ''); }; var removeLeadingVerseIndex = function (text) { return text.replace(/\d{1,2}/g, ''); }; var runEnHeRequest = function (id) { request('http://www.sefaria.org/api/texts/Psalms.' + id + '?commentary=0&context=1&pad=0', function (error, response, html) { if (!error && response.statusCode == 200) { console.log("Psalm: " + id + " OK"); var objHtml = JSON.parse(html); var enArray = []; objHtml.text.forEach(function (item) { enArray.push(stripeHtml(item)); }); var newObj = { id: id, name: "Psalm " + id, en: enArray, he: objHtml.he } var path = "psalms/" + (id-1).toString(); var ref = db.ref(path); ref.update(newObj, function (error) { if (error) { console.log("Data could not be saved." + error); } else { console.log("Psalm " + id + " saved successfully."); } }); } if (error) { console.log(response); } }); } var runPhonetiqueFrRequest = function (id) { request('http://tehilim-online.com/les-psaumes-de-David/Tehilim-' + id, function (error, response, html) { if (!error && response.statusCode == 200) { console.log("Psalm: " + id + " OK"); var $ = cheerio.load(html); var ph = $('#phonetiqueBlock span').text().split("\n"); var frNotFormatted = $('#traductionBlock p').text().split("\n"); var fr = []; frNotFormatted.forEach(function (item) { fr.push(removeLeadingVerseIndex(item)); }); var newObj = { ph: ph, fr: fr } // console.log(newObj); var path = "psalms/" + (id - 1).toString(); var ref = db.ref(path); ref.update(newObj, function (error) { if (error) { console.log("Data could not be saved." + error); } else { console.log("Psalm " + id + " saved successfully."); } }); } if (error) { console.log(response); } }); } while(psalmId <= 150) { var psalmTextArray = []; //runEnHeRequest(psalmId); runPhonetiqueFrRequest(psalmId); psalmId++; }
var _ = require('lodash'); var doFacesIntersect = require('./face-intersection').doFacesIntersect; function flatMeshIntersects(mesh){ var numFaces = mesh.faces.length; for (var i = 0; i < numFaces; ++i) { var firstFace = _.map(mesh.faces[i].vertices, function(vertexIndex){ return mesh.vertices[vertexIndex]; }); for (var j = i + 1; j < numFaces; ++j) { var secondFace = _.map(mesh.faces[j].vertices, function(vertexIndex){ return mesh.vertices[vertexIndex]; }); if (doFacesIntersect(firstFace, secondFace)) { return true; } } } return false; } exports.flatMeshIntersects = flatMeshIntersects;
angular.module('app.travels', ['pascalprecht.translate']) .controller('TravelsCtrl', function($scope, $http, $ionicModal, $timeout, $ionicLoading, $filter) { $scope.loadMorePagination = true; $scope.travels = []; $scope.page = 0; $scope.doRefresh = function() { /* travels refresh: */ $http.get(urlapi + 'travels?page=' + $scope.page) .then(function(data) { console.log('data success travels'); console.log(data); // for browser console //$scope.travels = data.data; // for UI $scope.travels = $scope.travels.concat(data.data); $scope.$broadcast('scroll.refreshComplete'); //refresher stop $scope.$broadcast('scroll.infiniteScrollComplete'); if (data.data.length < 1) { console.log("setting loadMorePagination to false"); $scope.loadMorePagination = false; $scope.$broadcast('scroll.infiniteScrollComplete'); } }, function(data) { console.log('data error'); $scope.$broadcast('scroll.refreshComplete'); //refresher stop $ionicLoading.show({ template: 'Error connecting server', noBackdrop: true, duration: 2000 }); }); }; $scope.doRefresh(); $scope.paginationNext = function() { if ($scope.loadMorePagination == true) { $scope.page++; console.log($scope.page); $scope.doRefresh(); }else{ console.log("limit pagination reached"); $scope.$broadcast('scroll.infiniteScrollComplete'); } }; });
import React, { Component } from 'react'; import { Link } from 'react-router-dom' import { CSSTransition } from 'react-transition-group'; class Nav extends Component { constructor(props) { super(props); this.state = { menuActive: false } this.handleClick = this.handleClick.bind(this); } handleClick() { var obj = {}; obj['menuActive'] = !this.state.menuActive; this.setState(obj); } render() { return ( <div className={this.state.menuActive? 'nav active': 'nav'} > <div className='nav__button' onClick={this.handleClick}> <div className='nav__buttonPart' /> <div className='nav__buttonPart' /> <div className='nav__buttonPart' /> <div className="nav__buttonTitle"> {this.state.menuActive? <div>Close</div> : <div>Menu</div>} </div> </div> <div className='nav__menuBox'> <ul className='nav__menu'> <li className='nav__menuItem'> <Link to='/'> home </Link> </li> <li className='nav__menuItem'> <Link to='/'> blog </Link> </li> <li className='nav__menuItem'> <Link to='/About'> about </Link> </li> </ul> </div> <CSSTransition in={this.state.menuActive} timeout={300} classNames="nav__background" > <div className="nav__background"/> </CSSTransition> <CSSTransition in={this.state.menuActive} timeout={300} classNames="nav__shadowBackground" > <div className="nav__shadowBackground"/> </CSSTransition> </div> ); } } export default Nav;
(function () { angular .module("WebAppMaker") .controller("EditPageController", EditPageController) .controller("PageListController", PageListController) .controller("NewPageController", NewPageController); function EditPageController(PageService, $routeParams, $location) { var vm = this; vm.updatePage = updatePage; vm.deletePage = deletePage; vm.userId = $routeParams['uid']; vm.websiteId = $routeParams['wid']; vm.pageId = $routeParams['pid']; function init() { PageService.findPageById(vm.pageId) .then( res => { vm.page = res.data; }, res => { vm.pageNotFound = true; }); } init(); function updatePage(page) { PageService.updatePage( vm.pageId, page ) .then( res => { $location.url(`/user/${vm.userId}/website/${vm.websiteId}/page`); }, res => { vm.errorUpdating = true; }); } function deletePage() { PageService.deletePage(vm.pageId) .then( res => { $location.url(`/user/${ vm.userId }/website/${ vm.websiteId }/page`); }, res => { vm.errorDeleting = true; }); } }; function PageListController(PageService, $routeParams) { var vm = this; var userId = $routeParams.uid; var websiteId = $routeParams.wid; vm.userId = userId; vm.websiteId = websiteId; function init() { PageService.findPagesByWebsiteId( vm.websiteId ) .then( res => { vm.pages = res.data; }, res => { vm.error = true; }); } init(); }; function NewPageController(PageService, $routeParams, $location) { var vm = this; vm.create = create; function init() { vm.userId = $routeParams.uid; vm.websiteId = $routeParams.wid; PageService.findPagesByWebsiteId( vm.websiteId ) .then( res => { vm.pages = res.data; }, res => { vm.error = true; }); } init(); function create(newPage) { PageService.createPage( vm.websiteId, newPage ) .then( res => { $location.url(`/user/${ vm.userId }/website/${ vm.websiteId }/page`); }, res => { vm.errorCreating = true; }); } }; })();
$(function() { (function() { $('.j_toClass').each(function(index, el) { var $it = $(this); var targetTo = $it.attr('data-target'); var thisTo = $it.attr('data-this'); var targetId = $it.attr('href'); var $target = $(targetId); var _fn = { on: function() { $target.addClass(targetTo); $it.addClass(thisTo); }, off: function() { $target.removeClass(targetTo); $it.removeClass(thisTo); } }; targetTo = targetTo && targetTo !== '' ? targetTo : 'on'; thisTo = thisTo && thisTo !== '' ? thisTo : 'on'; $it.on('click', function(e) { e.preventDefault; }).on('mouseenter', function() { _fn.on(); return false; }).on('mouseleave', function() { _fn.off(); return false; }); }); })(); $('.j-tab').on('click','a',function(e){ e.preventDefault(); var $it=$(this); var targetId=$it.attr('href'); var $target=$(targetId); $it.addClass('on').siblings('.on').removeClass('on'); $target.addClass('on').siblings('.on').removeClass('on'); $target.find('img[data-src]').each(function(index, el) { var $it=$(this); var src=$it.attr('data-src'); $it.attr('src',src).removeAttr('data-src'); }); }); //弹出框 $('body').on('click','.modal-close, .modal .j-close',function(e){ e.preventDefault(); var $it=$(this); var $moldal=$it.parents('.modal'); $it.parents('.modal').removeClass('on'); }).on('click','.j-modal',function(e){ e.preventDefault(); var $it=$(this); var targetId=$it.attr('href'); var $target=$(targetId); $target.addClass('on'); }); });
'use strict'; var Dispatcher = require('../core/appDispatcher'); var EventEmitter = require('events').EventEmitter; var ActionTypes = require('./actionTypes'); var CHANGE_EVENT = 'change'; var utils = require('../core/utils'); function TradingStore() { var previousRate = null; var symbols = "GBP/USD"; var quantity = "GBP 1,000,000"; var model = null; var self = this; var store = { getInitialState: getInitialState, addChangeListener: addChangeListener, removeChangeListener: removeChangeListener }; init(); return store; //////////////////////// function init() { model = { isExecuting: false, symbols: 'GBP/USD', quantity: "GBP 1,000,000", movement: "none", spread: 1.6, buyPips: { bigFig: "1.61", fractionalPips: "5", pips: "49" }, sellPips: { bigFig: "1.61", fractionalPips: "9", pips: "47" } }; Dispatcher.register(function(action) { switch(action.actionType) { case ActionTypes.RATE_CHANGED: onRateChanged(action.updatedRate); break; case ActionTypes.TRADE_WILLEXECUTE: onTradeWillExecute(); break; case ActionTypes.TRADE_EXECUTED: onTradeDidExecute(action.updatedTrade); break; default: // no op } }); } function onTradeDidExecute(updatedTrade) { model.isExecuting = false; } function onTradeWillExecute() { model.isExecuting = true; self.emit(CHANGE_EVENT, model); } function onRateChanged(newRate) { if (model.isExecuting) { return; } model = $.extend(model, { movement: calculateMovement(previousRate || newRate, newRate), buyPips: formatPips(newRate.buy), sellPips: formatPips(newRate.sell) }, newRate); previousRate = newRate; self.emit(CHANGE_EVENT, model); } function addChangeListener(callback) { self.on(CHANGE_EVENT, callback); } function removeChangeListener(callback) { self.removeListener(CHANGE_EVENT, callback); } function calculateMovement(priorRate, newRate) { var x = newRate.buy - priorRate.buy; switch(true) { case x < 0 : return "down"; case x > 0 : return "up"; default : return "none"; } } function formatPips(spotRate) { var str = "" + spotRate; var pad = "0000000"; var ans = str + pad.substring(0, pad.length - str.length); return { bigFig: ans.substring(0, 4), pips: ans.substring(4, 6), fractionalPips: ans.substring(6, 8) }; } function getInitialState() { return model; } } utils.inherits(TradingStore, EventEmitter); module.exports = new TradingStore();
require.config({ baseUrl: 'vendor', waitSeconds: 10, paths: { core: '../core', lang: '../lang', root: '..' }, shim: { 'backbone': { deps: ['underscore', 'jquery'], exports: 'Backbone' }, 'underscore': { exports: '_' } } }); require(['root/config'],function(Config){ require.config({ paths: { theme: '../themes/'+ Config.theme } }); require(['jquery', 'core/app-utils', 'core/app', 'core/router', 'core/region-manager', 'core/stats', 'core/phonegap-utils'], function ($, Utils, App, Router, RegionManager, Stats, PhoneGap) { var launch = function() { // Initialize application before using it App.initialize( function() { RegionManager.buildHead(function(){ RegionManager.buildLayout(function(){ RegionManager.buildHeader(function(){ App.router = new Router(); require(['theme/js/functions'], function(){ App.sync( function(){ RegionManager.buildMenu(function(){ //Menu items are loaded by App.sync Stats.updateVersion(); Stats.incrementCountOpen(); Stats.incrementLastOpenTime(); if( Config.debug_mode == 'on' ){ Utils.log( 'App version : ', Stats.getVersionDiff() ); Utils.log( 'App opening count : ', Stats.getCountOpen() ); Utils.log( 'Last app opening was on ', Stats.getLastOpenDate() ); } App.launchRouting(); App.sendInfo('app-launched'); //triggers info:app-ready, info:app-first-launch and info:app-version-changed //Refresh at app launch can be canceled using the 'refresh-at-app-launch' App param, //this is useful if we set a specific launch page and don't want to be redirected //after the refresh. if( App.getParam('refresh-at-app-launch') ){ //Refresh at app launch : as the theme is now loaded, use theme-app : require(['core/theme-app'],function(ThemeApp){ last_updated = App.options.get( 'last_updated' ); refresh_interval = App.options.get( 'refresh_interval' ); if( undefined === last_updated || undefined === refresh_interval || Date.now() > last_updated.get( 'value' ) + ( refresh_interval.get( 'value' ) * 1000 ) ) { Utils.log( 'Refresh interval exceeded, refreshing', { last_updated: last_updated, refresh_interval: refresh_interval } ); ThemeApp.refresh(); } }); } PhoneGap.hideSplashScreen(); }); }, function(){ Backbone.history.start(); Utils.log("launch.js error : App could not synchronize with website."); PhoneGap.hideSplashScreen(); App.sendInfo('no-content'); }, false //true to force refresh local storage at each app launch. ); }, function(error){ Utils.log('Error : theme/js/functions.js not found', error); } ); }); }); }); }); }; if( PhoneGap.isLoaded() ){ PhoneGap.setNetworkEvents(App.onOnline,App.onOffline); document.addEventListener('deviceready', launch, false); }else{ window.ononline = App.onOnline; window.onoffline = App.onOffline; $(document).ready(launch); } }); },function(){ //Config.js not found //Can't use Utils.log here : log messages by hand : var message = 'WP AppKit error : config.js not found.'; console && console.log(message); document.write(message); //Check if we are simulating in browser : var query = window.location.search.substring(1); if( query.length && query.indexOf('wpak_app_id') != -1 ){ message = 'Please check that you are connected to your WordPress back office.'; console && console.log(message); document.write('<br>'+ message); } });
import { module, test } from 'qunit'; import { setupTest } from 'ember-qunit'; module('Unit | Service | slider', function(hooks) { setupTest(hooks); // Replace this with your real tests. test('it exists', function(assert) { let service = this.owner.lookup('service:slider'); assert.ok(service); }); });
module.exports = function(el, state, container) { var ul = el.getElementsByTagName('ul')[0] var lastFlags = [] var controlsTouch = -1 var containerTouch = {"id":-1, "x":-1, "y":-1} el.addEventListener('touchstart', startTouchControls) el.addEventListener('touchmove', handleTouchControls) el.addEventListener('touchend', unTouchControls) container.addEventListener('touchstart', startTouchContainer) container.addEventListener('touchmove', handleTouchContainer) container.addEventListener('touchend', unTouchContainer) function startTouchControls(event) { if (controlsTouch === -1) { controlsTouch = event.targetTouches[0].identifier } handleTouchControls(event) } function handleTouchControls(event) { event.preventDefault() var touch = null if (event.targetTouches.length > 1) { for (t in event.targetTouches) { if (event.targetTouches[t].identifier === controlsTouch) { touch = event.targetTouches[t] break } } } else { touch = event.targetTouches[0] } if (touch === null) return var top=touch.clientY-el.offsetTop var left=touch.clientX-el.offsetLeft var flags=[] if (top < 50) flags.push('forward') if (left < 50 && top < 100) flags.push('left') if (left > 100 && top < 100) flags.push('right') if (top > 100 && left > 50 && left < 100) flags.push('backward') if (top > 50 && top < 100 && left > 50 && left < 100) flags.push('jump') if (flags.indexOf('jump') === -1) { for (flag in lastFlags) { if (flags.indexOf(lastFlags[flag]) !== -1) { lastFlags.splice(flag, 1) } } setState(lastFlags, 0) setState(flags, 1) lastFlags = flags } else if (lastFlags.indexOf('jump') === -1) { // Start jumping (in additional to existing movement) lastFlags.push('jump') setState(['jump'], 1) } } function unTouchControls() { setState(lastFlags, 0) lastFlags = [] controlsTouch = -1 } function setState(states, value) { var delta = {} for(s in states) { delta[states[s]] = value } state.write(delta) } function startTouchContainer(event) { if (containerTouch.id === -1) { containerTouch.id = event.targetTouches[0].identifier containerTouch.x = event.targetTouches[0].clientX containerTouch.y = event.targetTouches[0].clientY } handleTouchContainer(event) } function handleTouchContainer(event) { event.preventDefault() var touch = null, x = y = -1, delta = {} for (t in event.targetTouches) { if (event.targetTouches[t].identifier === containerTouch.id) { touch = event.targetTouches[t] break } } if (touch === null) return dx = containerTouch.x - touch.clientX dy = containerTouch.y - touch.clientY delta.x_rotation_accum = dy * 2 delta.y_rotation_accum = dx * 8 state.write(delta) containerTouch.x = touch.clientX containerTouch.y = touch.clientY } function unTouchContainer(event) { containerTouch = {"id":-1, "x":-1, "y":-1} } }
define("view/mission", ["jquery", "laces.tie", "lodash", "view", "tmpl/joboutput", "tmpl/mission"], function($, Laces, _, View, tmpl) { "use strict"; return View.extend({ initialize: function(options) { this.mission = options.mission; this.mission.jobs.on("add", this._onNewJobs, { context: this }); this.subscribe("server-push:missions:job-output", this._onJobOutput); this.$jobs = null; }, events: { "click .action-expand-job": "_expandJob" }, remove: function() { this.mission.jobs.off("add", this._onNewJobs); }, render: function() { var lastJob = this.mission.jobs[this.mission.jobs.length - 1]; if (lastJob) { lastJob.expanded = true; lastJob.fetchResults({ context: this }).then(function() { var tie = new Laces.Tie(lastJob, tmpl.joboutput); var $jobOutput = this.$(".js-job-output[data-job-id='" + lastJob.id + "']"); $jobOutput.replaceWith(tie.render()); }); } var tie = new Laces.Tie(this.mission, tmpl.mission); this.$el.html(tie.render()); this.$jobs = this.$(".js-jobs"); _.each(this.mission.jobs, _.bind(this._renderJob, this)); return this.$el; }, _expandJob: function(event) { var jobId = this.targetData(event, "job-id"); var job = _.find(this.mission.jobs, { id: jobId }); job.expanded = !job.expanded; if (job.expanded) { job.fetchResults(); } }, _onNewJobs: function(event) { _.each(event.elements, _.bind(this._renderJob, this)); }, _onJobOutput: function(data) { if (data.missionId === this.mission.id) { var job = _.find(this.mission.jobs, { id: data.jobId }); if (job && job.expanded) { var $output = this.$(".js-job-output[data-job-id=" + $.jsEscape(data.jobId) + "] .js-output"); if ($output.length) { $output[0].innerHTML += $.colored(data.output); } } } }, _renderJob: function(job) { if (this.$jobs) { var tie = new Laces.Tie(job, tmpl.joboutput); this.$jobs.prepend(tie.render()); } } }); });
// QChartGallery.js --- // // Author: Julien Wintz // Created: Thu Feb 13 23:43:13 2014 (+0100) // Version: // Last-Updated: // By: // Update #: 13 // // Change Log: // // // ///////////////////////////////////////////////////////////////// // Line Chart Data Sample // ///////////////////////////////////////////////////////////////// var ChartLineData = { labels: [], datasets: [{ fillColor: "rgba(151,187,205,0.5)", strokeColor: "grey", pointColor: "rgba(151,187,205,1)", pointStrokeColor: "grey", data: [] }/**, { fillColor: "rgba(151,187,205,0.5)", strokeColor: "rgba(151,187,205,1)", pointColor: "rgba(151,187,205,1)", pointStrokeColor: "#ffffff", data: [] }**/] } // ///////////////////////////////////////////////////////////////// // Polar Chart Data Sample // ///////////////////////////////////////////////////////////////// var ChartPolarData = [{ value: 30, color: "#D97041" }, { value: 90, color: "#C7604C" }, { value: 24, color: "#21323D" }, { value: 58, color: "#9D9B7F" }, { value: 82, color: "#7D4F6D" }, { value: 8, color: "#584A5E" }] // ///////////////////////////////////////////////////////////////// // Radar Chart Data Sample // ///////////////////////////////////////////////////////////////// var ChartRadarData = { labels: ["Eating","Drinking","Sleeping","Designing","Coding","Partying","Running"], datasets: [{ fillColor: "rgba(220,220,220,0.5)", strokeColor: "rgba(220,220,220,1)", pointColor: "rgba(220,220,220,1)", pointStrokeColor: "#fff", data: [65,59,90,81,56,55,40] }, { fillColor: "rgba(151,187,205,0.5)", strokeColor: "rgba(151,187,205,1)", pointColor: "rgba(151,187,205,1)", pointStrokeColor: "#fff", data: [28,48,40,19,96,27,100] }] } // ///////////////////////////////////////////////////////////////// // Pie Chart Data Sample // ///////////////////////////////////////////////////////////////// var ChartPieData = [{ value: 30, color: "#F38630" }, { value: 50, color: "#E0E4CC" }, { value: 100, color: "#69D2E7" }] // ///////////////////////////////////////////////////////////////// // Doughnut Chart Data Sample // ///////////////////////////////////////////////////////////////// var ChartDoughnutData = [{ value: 30, color: "#F7464A" }, { value: 50, color: "#E2EAE9" }, { value: 100, color: "#D4CCC5" }, { value: 40, color: "#949FB1" }, { value: 120, color: "#4D5360" }] // ///////////////////////////////////////////////////////////////// // Bar Chart Data Sample // ///////////////////////////////////////////////////////////////// var ChartBarData = { labels: ["January","February","March","April","May","June","July"], datasets: [{ fillColor: "rgba(220,220,220,0.5)", strokeColor: "rgba(220,220,220,1)", data: [65,59,90,81,56,55,40] }, { fillColor: "rgba(151,187,205,0.5)", strokeColor: "rgba(151,187,205,1)", data: [28,48,40,19,96,27,100] }] }
OJ.extendClass( 'NwEvent', [OjEvent], { '_get_props_' : { 'data' : null }, '_constructor' : function(type/*, bubbles = false, cancelable = false, data = null*/){ var ln = arguments.length; this._super(OjEvent, '_constructor', ln > 3 ? [].slice.call(arguments, 0, 3) : arguments); if(ln > 3){ this._data = arguments[3]; } } } );
'use strict'; angular.module('MainConsole') .factory('WebSocketService', ['$rootScope', '$q', '$filter', '$location', function ($rootScope, $q, $filter, $location) { var service = {}; service.wsConnect = function() { // Websocket is at wss://hostname:port/ws var host = $location.host(); var port = $location.port(); var wsUrl = $rootScope.urlscheme.websocket + '/ws'; var ws = new WebSocket(wsUrl); ws.onopen = function(){ $rootScope.connected = 1; console.log("Socket has been opened!"); }; ws.onerror = function(){ $rootScope.connected = 0; console.log("Socket received an error!"); }; ws.onclose = function(){ $rootScope.connected = 0; console.log("Socket has been closed!"); } ws.onmessage = function(message) { //listener(JSON.parse(message.data)); service.callback(JSON.parse(message.data)); }; service.ws = ws; console.log('WebSocket Initialized'); }; service.listener = function(callback) { service.callback = callback; }; service.send = function(message) { service.ws.send(message); }; service.close = function(){ service.ws.close(); $rootScope.connected = 0; console.log("Socket has been closed!"); }; return service; }]);
var webpack = require('webpack'); var path = require('path'); const ExtractTextPlugin = require("extract-text-webpack-plugin"); const extractLess = new ExtractTextPlugin({ filename: "[name].[contenthash].css", disable: process.env.NODE_ENV === "development" }); module.exports = { context: path.join(__dirname, "src"), devtool: "source-map", entry: "./app/index.jsx", module: { loaders: [{ test: /(\.js|\.jsx)$/, exclude: /(node_modules|dist)/, loader: 'babel-loader', query: { presets: ['react', 'es2015'] } }, { test: /\.svg$/, use: [{ loader: 'babel-loader' }, { loader: 'react-svg-loader', options: { svgo: { plugins: [{ removeTitle: false }], floatPrecision: 2 } } } ] }, { test: /\.scss$/, loader: "style-loader!css-loader!sass-loader" }, { test: /\.jpg$/, use: ["file-loader"] }, { test: /\.png$/, use: ["url-loader?mimetype=image/png"] }, { test: /\.(html)$/, use: { loader: 'html-loader', options: { attrs: [':data-src'] } } } ] }, output: { path: __dirname + "/dist/", filename: "bundle.js" }, plugins: [ new webpack.ProvidePlugin({ 'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch' }), extractLess ], };
// Make screen : lists different control activities and allows to select which to use var MakeScreen = Screen.extend({ enter: function(){ // Display this screen this.display('make_screen'); // Setup button clicks this.html.find(".btn-play").off().click(function(){ fabrica.navigation.go("/make/play"); }); this.html.find(".btn-upload").off().click(function(){ fabrica.navigation.go("/make/upload"); }); }, }); screens.make = new MakeScreen();
const chart = { format: '{point.name}: {point.y:,.2f}', colorNames: [ 'success', 'info', 'warning', 'danger', 'primary', 'highlight', 'default' ], colors: [], patterns: [], style: {}, plotOptions: function () { return { series: { animation: false, dataLabels: { enabled: true, format: this.format }, cursor: 'pointer', borderWidth: 3, } } }, responsivePlotOptions: function () { return { series: { animation: false, dataLabels: { format: this.format } } } }, rule: function () { return { condition: { maxWidth: 500 }, chartOptions: { plotOptions: this.responsivePlotOptions() } } }, getPattern: function(index, colors) { const p = index % Highcharts.patterns.length; return { pattern: Highcharts.merge( Highcharts.patterns[p], { color: colors[index] } ) } }, cssVar: function(name) { return this.style.getPropertyValue(`--${name}`) }, init: function(decimal, thousand) { this.style = getComputedStyle(document.documentElement) for (let p = 0; p < 4; p++) { for (let n = 0; n < this.colorNames.length; n++) { const color = this.cssVar( `${this.colorNames[n]}-${p}` ) this.colors.push(color) } } this.patterns = this.colors.map( (_, index, array) => this.getPattern(index, array) ) Highcharts.setOptions({ chart: { style: { fontFamily: this.cssVar('--font-general'), }, }, lang: { decimalPoint: decimal, thousandsSep: thousand, }, }); }, draw: function(id, title, seriesName, data) { const chart = Highcharts.chart( id, { chart: { type: 'pie' }, title: { text: title, style: { color: this.cssVar('primary-0'), } }, colors: this.patterns, plotOptions: this.plotOptions(), series: [{ name: seriesName, data: data }], responsive: { rules: [this.rule()] }, } ) const that = this $('#patterns-enabled').click(function () { chart.update({ colors: this.checked ? that.patterns : that.colors }) }) }, }
if (Meteor.isClient) { Session.setDefault('degF',-40); Session.setDefault('degC',-40); Template.temperatureBoxes.helpers({ degF: function(){ return Session.get('degF'); }, degC: function(){ return Session.get('degC'); } }); Template.temperatureBoxes.events({ 'keyup #c': function(e){ if(e.which === 13) { var degC = e.target.value; var degF = Math.round(degC*9/5 + 32); Session.set('degF',degF); } }, 'keyup #f': function(e){ if(e.which === 13) { var degF = e.target.value; var degC = Math.round((degF-32)* 5/9); Session.set('degC',degC); } } }); } if (Meteor.isServer) { Meteor.startup(function () { // code to run on server at startup }); }
function handleDialogRequest(dialogName, xhr, status, args) { if (!args.success) { PF(dialogName).jq.effect("shake", {times : 5}, 100); } else { PF(dialogName).hide(); } }
var __v=[ { "Id": 2056, "Panel": 1052, "Name": "array", "Sort": 0, "Str": "" }, { "Id": 2057, "Panel": 1052, "Name": "相關接口", "Sort": 0, "Str": "" }, { "Id": 2058, "Panel": 1052, "Name": "Example", "Sort": 0, "Str": "" } ]
/* * Copyright (C) 2020 Graylog, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the Server Side Public License, version 1, * as published by MongoDB, Inc. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * Server Side Public License for more details. * * You should have received a copy of the Server Side Public License * along with this program. If not, see * <http://www.mongodb.com/licensing/server-side-public-license>. */ import Reflux from 'reflux'; import URLUtils from 'util/URLUtils'; import ApiRoutes from 'routing/ApiRoutes'; import fetch from 'logic/rest/FetchProvider'; import MessageFormatter from 'logic/message/MessageFormatter'; import ObjectUtils from 'util/ObjectUtils'; import CombinedProvider from 'injection/CombinedProvider'; const { SimulatorActions } = CombinedProvider.get('Simulator'); const SimulatorStore = Reflux.createStore({ listenables: [SimulatorActions], simulate(stream, messageFields, inputId) { const url = URLUtils.qualifyUrl(ApiRoutes.SimulatorController.simulate().url); const simulation = { stream_id: stream.id, message: messageFields, input_id: inputId, }; let promise = fetch('POST', url, simulation); promise = promise.then((response) => { const formattedResponse = ObjectUtils.clone(response); formattedResponse.messages = response.messages.map((msg) => MessageFormatter.formatMessageSummary(msg)); return formattedResponse; }); SimulatorActions.simulate.promise(promise); }, }); export default SimulatorStore;
app .service('LanguageService', function LanguageService(ExchangeService) { this.translate = (label) => ExchangeService.i18n().__(label); });
/** * Created by ken_kilgore1 on 1/11/2015. */ jQuery(document).ready(function ($) { $("#spouse_info").hide(); $("#spouse_spacer").hide(); $("#family_info").hide(); $("#family_spacer").hide(); $("input:radio[name$='memb_type']").click(function () { if ($("input[name$='memb_type']:checked").val() === 1) { $("#spouse_info").hide(); $("#spouse_spacer").hide(); $("#family_info").hide(); $("#family_spacer").hide(); } else if ($("input[name$='memb_type']:checked").val() === 2) { $("#spouse_info").hide(); $("#spouse_spacer").hide(); $("#family_info").show(); $("#family_spacer").show(); } else if ($("input[name$='memb_type']:checked").val() === 3) { $("#spouse_spacer").show(); $("#spouse_info").show(); $("#family_info").hide(); $("#family_spacer").hide(); } else if ($("input[name$='memb_type']:checked").val() === 4) { $("#spouse_info").show(); $("#spouse_spacer").show(); $("#family_info").show(); $("#family_spacer").show(); } }); });
var __v=[ { "Id": 2329, "Chapter": 746, "Name": "nodejs", "Sort": 0 } ]
function content($slide) { return $slide.children().first().nextAll(); } function addReplToSlide($, deck, $slide) { var endpoint = $[deck]('getOptions').repl.endpoint; content($slide).wrapAll('<div class="repl-slide-column repl-text-column"></div>'); var replHtmlId = "console-" + $slide[0].id; $('<div/>', { id: replHtmlId, class: 'repl-slide-column repl-console-column' }) .appendTo($slide); $('<script></script>') .append("$(function () { newConsole('" + endpoint + "', $('#" + replHtmlId + "')); });") .appendTo($slide); content($slide).wrapAll('<div class="repl-slide-columns"></div>'); } function protocol() { switch (location.protocol) { case 'https:': return 'wss:'; default: return 'ws:'; } } function url(endpoint) { return protocol() + endpoint; } function getContext(element) { return element.attr('data-repl-context') || element.parents('[data-repl-context]').attr('data-repl-context'); } function hasContext(element) { var ctx = getContext(element); return ctx !== undefined && ctx !== ""; } function newConsole(endpoint, element) { var replContext = getContext(element); var jqconsole = element.jqconsole("", "> "); var startPrompt; var writeText = function(text) { jqconsole.Write(text, 'jqconsole-output'); startPrompt(); }; var writeError = function(text) { jqconsole.Write(text, 'jqconsole-error'); startPrompt(); } jqconsole.Disable(); addFullscreenHint(element); if (endpoint) { var connect = function () { var ws = new WebSocket(url(endpoint)); ws.onmessage = function(event) { jqconsole.Enable(); writeText(event.data); }; ws.onerror = function(event) { writeError("Connection error\n"); }; ws.onopen = function(event) { ws.send("/load " + replContext); }; return ws; } var ws = connect(); startPrompt = function () { jqconsole.Prompt(true, function (input) { if (input === '/reconnect') { ws = connect(); } else if (input !== '') { if (ws.readyState === WebSocket.OPEN) { ws.send(input); } else { writeError("Not connected."); } } }); }; var setup = function() { jqconsole.RegisterShortcut('L', reset); startPrompt(); }; var reset = function() { var history = jqconsole.GetHistory(); jqconsole.Reset(); jqconsole.SetHistory(history); setup(); }; setup(); } else { startPrompt = function() {}; writeText("REPL offline.\n" + "No livecoding for you :-("); jqconsole.Prompt(true, function() {}); } }; function addFullscreenHint(element) { $('<div/>', { class: 'repl-fullscreen-hint', text: 'Fullscreen — Hit F to quit' }).appendTo(element); } function toggleOrder(i, order) { switch (order) { case '0': return '1'; default: return '0'; } } function isKey(e, keyValue) { return e.which === keyValue || $.inArray(e.which, keyValue) > -1; } (function($, deck, window, undefined) { var $d = $(document); /* Extends defaults/options. options.keys.replPositionToggle Key to toggle REPL position between left and right (right by default). Default key is 'T'. options.keys.replFullscreenToggle Key to toggle REPL to fullscreen, hiding the other column and slide title. Default key is 'F'. options.repl.endpoint URL of the websocket endpoint to use for REPL without the protocol part. */ $.extend(true, $[deck].defaults, { classes: { repl: 'deck-repl' }, keys: { replPositionToggle: 84, // t replFullscreenToggle: 70 // f }, repl: { endpoint: '' } }); $d.bind('deck.beforeInit', function() { if ($[deck]('getOptions').repl.endpoint) { warnAgainstCtrlW($); } $.each($[deck]('getSlides'), function(i, $slide) { if ($slide.hasClass('repl') && hasContext($slide)) { addReplToSlide($, deck, $slide); } }); }); /* jQuery.deck('toggleReplPosition') Toggles REPL position (right column first). */ $[deck]('extend', 'toggleReplPosition', function() { $('.repl-console-column').css('order', toggleOrder); }); $[deck]('extend', 'toggleReplFullscreen', function() { $('.deck-current .repl-slide-columns').siblings().toggle(); $('.deck-current .repl-text-column').toggle(); $('.deck-current .repl-console-column').toggleClass('repl-console-column-fullscreen'); }); $d.bind('deck.init', function() { var opts = $[deck]('getOptions'); // Bind key events $d.unbind('keydown.deckrepl').bind('keydown.deckrepl', function(e) { if (isKey(e, opts.keys.replPositionToggle)) { $[deck]('toggleReplPosition'); e.preventDefault(); } if (isKey(e, opts.keys.replFullscreenToggle)) { $[deck]('toggleReplFullscreen'); e.preventDefault(); } }); }); })(jQuery, 'deck', this); function warnAgainstCtrlW($) { $(window).on('beforeunload', function(e) { return 'Bad habit of deleting words with Ctrl-W? ESC to stay here.'; }); }
/** * * @author xedushx */ $(document).bind("touchmove", function (event) { event.preventDefault(); }); /* * Función que permite bloquear la pantalla mientras esta procesando */ $(function () { $(document).ajaxStart($.blockUI).ajaxStop($.unblockUI); }); /* * Función que bloquea la tecla F5 y Enter de la pagina y detectar tecla arriba y abajo */ $(function () { $(document).keydown(function (e) { if ($('#formulario\\:menu').length) { var code = (e.keyCode ? e.keyCode : e.which); //if(code == 116 || code == 13) { if (code == 13) { e.preventDefault(); } if (code == 40) { teclaAbajo(); e.preventDefault(); } if (code == 38) { teclaArriba(); e.preventDefault(); } } }); }); /* *Función Desabilitar el clik derecho */ //$(function() { // $(document).ready(function(){ // $(document).bind("contextmenu",function(e){ // return false; // }); // }); //}); /* * Funcion que calcula y asigna el ancho y el alto del navegador */ function dimiensionesNavegador() { var na = $(window).height(); document.getElementById('formulario:alto').value = na; var ancho = $(window).width(); document.getElementById('formulario:ancho').value = ancho; } /* * Funcion que calcula y asigna el ancho y el alto disponible sin la barra de menu */ function dimensionesDisponibles() { var na = $(window).height(); var me = $('#formulario\\:menu').height(); var alto = na - me - 45; alto = parseInt(alto); document.getElementById('formulario:ith_alto').value = alto; document.getElementById('formulario:alto').value = na; var ancho = $(window).width(); document.getElementById('formulario:ancho').value = ancho; } /* * Para poner los calendarios, las horas en español */ PrimeFaces.locales['es'] = { closeText: 'Cerrar', prevText: 'Anterior', nextText: 'Siguiente', monthNames: ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'], monthNamesShort: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'], dayNames: ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'], dayNamesShort: ['Dom', 'Lun', 'Mar', 'Mie', 'Jue', 'Vie', 'Sab'], dayNamesMin: ['D', 'L', 'M', 'M', 'J', 'V', 'S'], weekHeader: 'Semana', firstDay: 1, isRTL: false, showMonthAfterYear: false, yearSuffix: '', timeOnlyTitle: 'Sólo hora', timeText: 'Tiempo', hourText: 'Hora', minuteText: 'Minuto', secondText: 'Segundo', currentText: 'Hora actual', ampm: false, month: 'Mes', week: 'Semana', day: 'Día', allDayText: 'Todo el día' }; function abrirPopUp(dir) { var w = window.open(dir, "sistemadj", "width=" + screen.availWidth + ", height=" + screen.availHeight + ", screenX=0,screenY=0, top=0, left=0, status=0 , resizable=yes, scrollbars=yes"); w.focus(); } function abrirNuevoPopUp(dir) { var w = window.open(dir, "", "width=" + screen.availWidth + ", height=" + screen.availHeight + ", screenX=0,screenY=0, top=0, left=0, status=0 , resizable=yes, scrollbars=yes"); w.focus(); }
/** * Standalone Window. * * A window in standalone display mode. */ /** * Standalone Window Constructor. * * @extends BaseWindow. * @param {number} id Window ID to give standalone window. * @param {string} url URL to navigate to. * @param {Object} webApp WebApp with metadata to generate window from. */ var StandaloneWindow = function(id, url, webApp) { this.currentUrl = url; if (webApp && webApp.name) { this.name = webApp.name; } else if (webApp && webApp.shortName) { this.name = webApp.shortName; } else { try { this.name = new URL(url).hostname; } catch(e) { this.name = ''; } } if (webApp && webApp.themeColor) { this.themeColor = webApp.themeColor; } BaseWindow.call(this, id); return this; }; StandaloneWindow.prototype = Object.create(BaseWindow.prototype); /** * Window View. */ StandaloneWindow.prototype.view = function() { var titleBarStyle = ''; var titleBarClass = 'standalone-window-title-bar'; if (this.themeColor) { titleBarStyle = 'background-color: ' + this.themeColor + ';'; var rgb = this.hexToRgb(this.themeColor); backgroundBrightness = this.darkOrLight(rgb); titleBarClass += ' ' + backgroundBrightness; } return '<div id="window' + this.id + '"class="standalone-window">' + '<div class="' + titleBarClass + '" style="' + titleBarStyle + '">' + '<span id="standalone-window-title' + this.id + '" class="standalone-window-title">' + this.name + '</span>' + '<button type="button" id="close-window-button' + this.id + '" ' + 'class="close-window-button">' + '</div>' + '<webview src="' + this.currentUrl + '" id="standalone-window-frame' + this.id + '" class="standalone-window-frame">' + '</div>'; }; /** * Render the window. */ StandaloneWindow.prototype.render = function() { this.container.insertAdjacentHTML('beforeend', this.view()); this.element = document.getElementById('window' + this.id); this.title = document.getElementById('standalone-window-title' + this.id); this.closeButton = document.getElementById('close-window-button' + this.id); this.closeButton.addEventListener('click', this.close.bind(this)); this.frame = document.getElementById('standalone-window-frame' + this.id); this.frame.addEventListener('did-navigate', this.handleLocationChange.bind(this)); this.frame.addEventListener('did-navigate-in-page', this.handleLocationChange.bind(this)); this.frame.addEventListener('new-window', this.handleOpenWindow.bind(this)); }; /** * Show the Window. */ StandaloneWindow.prototype.show = function() { this.element.classList.remove('hidden'); }; /** * Hide the window. */ StandaloneWindow.prototype.hide = function() { this.element.classList.add('hidden'); }; /** * Handle location change. * * @param {Event} e mozbrowserlocationchange event. */ StandaloneWindow.prototype.handleLocationChange = function(e) { this.currentUrl = e.url; }; /** * Convert hex color value to rgb. * * @argument {String} hex color string e.g. #ff0000 * @returns {Object} RGB object with separate r, g and b properties */ StandaloneWindow.prototype.hexToRgb = function(hex) { var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); return result ? { r: parseInt(result[1], 16), g: parseInt(result[2], 16), b: parseInt(result[3], 16) } : null; }; /** * Measure whether color is dark or light. * * @param {Object} RGB object with r, g, b properties. * @return {String} 'dark' or 'light'. */ StandaloneWindow.prototype.darkOrLight = function(rgb) { if ((rgb.r*0.299 + rgb.g*0.587 + rgb.b*0.114) > 186) { return 'light'; } else { return 'dark'; } };
/* * Copyright 2016(c) The Ontario Institute for Cancer Research. All rights reserved. * * This program and the accompanying materials are made available under the terms of the GNU Public * License v3.0. You should have received a copy of the GNU General Public License along with this * program. If not, see <http://www.gnu.org/licenses/>. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ import _ from 'lodash'; import moment from 'moment'; const dummyUsers = [ 'Jeff', 'Ryan', 'Brad', 'Alex', 'Matt', ]; const projectIds = [ 'project_1', 'project_2', 'project_3', 'project_4', 'project_5', 'project_6', ]; const DATE_FORMAT = 'YYYY-MM-DD'; const bucketMaps = { DAILY: { interval: [1, 'd'], multiplier: 1, }, WEEKLY: { interval: [1, 'w'], multiplier: 7, }, MONTHLY: { interval: [1, 'm'], multiplier: 30, }, YEARLY: { interval: [1, 'y'], multiplier: 365, }, } function randomDate(start, end) { return new Date(start.getTime() + Math.random() * (end.getTime() - start.getTime())); } export default function makeDummyReport({number, bucketSize, fromDate, toDate}) { const startDate = moment(fromDate, DATE_FORMAT); const endDate = moment(toDate, DATE_FORMAT); const bucketVars = bucketMaps[bucketSize]; return { fromDate: startDate.format(DATE_FORMAT), toDate: endDate.format(DATE_FORMAT), bucket: bucketSize, entries: _.sortBy(_.range(number).map((x, i) => { const bucketStartDate = moment(randomDate(startDate.toDate(), endDate.toDate())); const bucketEndDate = bucketStartDate.add(bucketMaps[bucketSize].interval[0], bucketMaps[bucketSize].interval[1]); return { fromDate: bucketStartDate.format(DATE_FORMAT), toDate: bucketEndDate.format(DATE_FORMAT), user: _.sample(dummyUsers), projectId: _.sample(projectIds), cpu: _.random(1, 50 * bucketVars.multiplier), volume: _.random(10 * bucketVars.multiplier, 60 * bucketVars.multiplier), image: _.random(1, 40 * bucketVars.multiplier), }; }), 'fromDate') } };
import React, { Component } from 'react' import { Button, Dropdown, Icon, Image, Form, Modal, Segment } from 'semantic-ui-react' import tr from '../app/utils/Translation'; const verticallyCenteredTextStyle = { display: 'inline-flex', alignItems: 'center' } const verticallyCenteredContainerStyle = { display: 'flex', justifyContent: 'space-between' } class ActiveDictionarySelector extends Component { static propTypes = { dictionaries: React.PropTypes.array.isRequired, activeDictionaryIds: React.PropTypes.array.isRequired, onActiveDictionariesChanged: React.PropTypes.func }; render() { if (!this.props.dictionaries.length) { return ( // <main className="ui container"> <Segment> <Segment basic style={verticallyCenteredContainerStyle}> <span style={verticallyCenteredTextStyle}>{tr('You have no dictionaries')}</span> <Button content={tr('Add a dictionary')} icon='plus' floated='right' /> </Segment> </Segment> // </main> ); } return ( // <main className="ui container"> <Segment> <Form> <Form.Select label={tr('Active Dictionaries')} name='activeDictionaries' options={this.props.dictionaries} fluid multiple search selection /> <Button content={tr('Clear All')} icon='trash'/> <Button content={tr('Select All')} icon='checkmark'/> </Form> </Segment> // </main> ) } } export default ActiveDictionarySelector;
/** ***** BEGIN LICENSE BLOCK ***** * * Copyright (C) 2019 Marc Ruiz Altisent. All rights reserved. * * This file is part of FoxReplace. * * FoxReplace is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later version. * * FoxReplace is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR * A PARTICULAR PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with FoxReplace. If not, see <http://www.gnu.org/licenses/>. * * ***** END LICENSE BLOCK ***** */ function onLoad() { document.removeEventListener("DOMContentLoaded", onLoad); document.getElementById("form").addEventListener("submit", onSubmit); } function onUnload() { document.removeEventListener("unload", onUnload); document.getElementById("form").removeEventListener("submit", onSubmit); } function onSubmit(event) { event.preventDefault(); // we just want to get the values, we don't want to submit anything let serialized = $('#form').serializeArray(); let formValues = {}; for (let item of serialized) { formValues[item.name] = item.value; } // Checkbox values are returned as 'on' when checked and missing (thus undefined) when unchecked. This works well when converted to Boolean. let substitutionList = [new SubstitutionGroup("", [], [new Substitution(formValues.input, formValues.output, formValues.caseSensitive, formValues.inputType)], formValues.html, true)]; browser.runtime.sendMessage({ key: "replace", list: substitutionListToJSON(substitutionList) }); } document.addEventListener("DOMContentLoaded", onLoad); document.addEventListener("unload", onUnload);
var searchData= [ ['unbancategories',['unbanCategories',['../classunban_categories.html',1,'']]], ['unbancategorieshandler',['unbanCategoriesHandler',['../classunban_categories_handler.html',1,'']]], ['unbanformrecaptcha',['unbanFormRecaptcha',['../classunban_form_recaptcha.html',1,'']]], ['unbanformselectcategory',['unbanFormSelectCategory',['../classunban_form_select_category.html',1,'']]], ['unbanformselectmember',['unbanFormSelectMember',['../classunban_form_select_member.html',1,'']]], ['unbanmembers',['unbanMembers',['../classunban_members.html',1,'']]], ['unbanmembershandler',['unbanMembersHandler',['../classunban_members_handler.html',1,'']]] ];
Meteor.methods({ 'deviceId/isClaimed': function(deviceId) { check(deviceId, String); return isClaimed(deviceId) }, 'deviceId/gen': function() { return gen(); }, 'deviceId/store': function(deviceId) { check(deviceId, String); return store(deviceId); }, }); var isClaimed = function(deviceId) { return !!DeviceIds.findOne({deviceId: deviceId}) } var gen = function() { var deviceId = Random.id(); if(isClaimed(deviceId)) return gen(); store(deviceId); return deviceId; } var store = function(deviceId) { if(isClaimed(deviceId)) throw new Meteor.Error('device-already-exists', "That deviceId already exists.") return !!DeviceIds.insert({deviceId: deviceId}) } _.extend(DeviceId, { isClaimed: isClaimed })
var direccion = '/api/Usuarios/' + sessionStorage.userId + '?access_token=' + sessionStorage.userToken; var nombre; /* Eliminar los valores de sesión */ function eliminarStorage(){ sessionStorage.removeItem("userToken"); sessionStorage.removeItem("userId"); sessionStorage.removeItem("userTtl"); sessionStorage.removeItem("userCreated"); sessionStorage.removeItem("userNombre"); sessionStorage.removeItem("userApellidos"); sessionStorage.removeItem("userDni"); sessionStorage.removeItem("userTelefono"); sessionStorage.removeItem("userCurso"); sessionStorage.removeItem("userUsername"); sessionStorage.removeItem("userEmail"); sessionStorage.removeItem("userObjetivoId"); sessionStorage.removeItem("userCentroId"); sessionStorage.removeItem("NombreCentro"); sessionStorage.removeItem("CodigoCentro"); sessionStorage.removeItem("LocalidadCentro"); sessionStorage.removeItem("userIdAlumnado"); sessionStorage.removeItem("NombreObjetivo"); } conexion('GET','',direccion); function conexion(metodo,datos,url){ $.ajax({ async: true, dataType: 'json', data: datos, method: metodo, url: url, }).done(function (respuesta){ if(typeof(respuesta.id) !== undefined){ sessionStorage.userNombre = respuesta.Nombre; sessionStorage.userApellidos = respuesta.Apellidos; sessionStorage.userDni = respuesta.DNI; sessionStorage.userTelefono = respuesta.Telefono; sessionStorage.userCurso = respuesta.Curso; sessionStorage.userUsername = respuesta.username; sessionStorage.userEmail = respuesta.email; sessionStorage.userCentroId = respuesta.centroId; sessionStorage.userObjetivoId = respuesta.objetivo; nombre = "<i class='fa fa-user-circle' aria-hidden='true'></i> " + sessionStorage.userNombre; $("#botonPerfil").html(nombre); $("#botonPerfilAdmin").html(nombre); $('#mensajeInicio').html("BIENVENIDO " + sessionStorage.userNombre + " A LA APLICACIÓN DE GESTIÓN DEL VIAJE DE ESTUDIOS"); }else{ console.log("Error Inicio"); eliminarStorage(); window.location.href = "../index.html"; } }).fail(function (xhr){ console.log("Error Inicio"); eliminarStorage(); window.location.href = "../index.html"; }); } $(document).ready(function() { $("#botonSalir").click(function(){ eliminarStorage(); window.location.href = "../index.html"; }); $("#botonPerfil").click(function(){ window.location.href = "perfil.html"; }); })
/* * Add a new ingredient form to the bottom of the formset */ function add_ingredient() { // Find the empty form var empty_form = $("#uses-formset .ingredient.empty-form"); // Clone it and remove the unneeded classes to get a new form var new_form = empty_form.clone(); new_form.removeClass('empty-form'); new_form.removeClass('sorting-disabled'); // Update the new forms number var total_forms = $("#id_ingredients-ingredients-TOTAL_FORMS"); var new_form_number = parseInt(total_forms.val()); updateFormNumber(new_form, new_form_number); // Update total forms counter total_forms.val(new_form_number + 1); // Insert after the last ingredient form var last_not_empty_form = $('#uses-formset li.ingredient:not(".empty-form"), #uses-formset li.group:not(".empty-form")').last(); new_form.insertAfter(last_not_empty_form); // Fix the ingredient list fix_ingredient_list(); return false; } /* * Add a new ingredient group to the bottom of the formset */ function add_group() { // Find the empty group var empty_group = $("#uses-formset .group.empty-form"); // Clone it and remove the unneeded classes to get a new group var new_group = empty_group.clone(); new_group.removeClass("empty-form"); new_group.removeClass("sorting-disabled"); // Insert after the last ingredient form var last_not_empty_form = $('#uses-formset li.ingredient:not(".empty-form"), #uses-formset li.group:not(".empty-form")').last(); new_group.insertAfter(last_not_empty_form); // Fix the ingredient list fix_ingredient_list(); return false; } /** * This function fixes the ingredient list. It handles the following cases: * - Hides or show the first label, depending on wether there is a group that already provides labels at the top * - Assigns the correct group to every ingredient form and indent them if needed * - Make sure this function is called again when a group has changed * - Add delete functionality to the delete buttons * - Add autocomplete functionality to ingredient forms */ function fix_ingredient_list() { // Get all ingredient forms and groups (except the empty ones) var lis = $("#uses-formset #sortable-ingredients li:not('.column-labels, .empty-form')"); // Hide the labels at the start if they are redundant because of group labels if (lis.first().hasClass("group")) { $("#uses-formset #sortable-ingredients .column-labels").hide(); } else { $("#uses-formset #sortable-ingredients .column-labels").show(); } // Assign a group to every ingredient form var group_name = ""; var found_group = false; lis.each(function() { if ($(this).hasClass("group")) { // This is a group li, all ingredients between this li and the next group li should belong to this group group_name = $(this).find(".group-name").val(); found_group = true; } else if ($(this).hasClass("ingredient")) { // Assign the current group to this ingredient $(this).find("input.group").val(group_name); // If this ingredient is in a group, indent the form if (found_group) { $(this).css('padding-left', '50px'); } else { $(this).css('padding-left', '30px'); } } }); // Change a group name when the user presses enter while editing it $("#sortable-ingredients .group input").pressEnter(function() { $(this).blur(); }); // When a group name has changed, fix the ingredient list $("#sortable-ingredients .group input").blur(function() { fix_ingredient_list(); }); // Add delete functionality to ingredient forms $("#sortable-ingredients .ingredient .delete-button").click(function() { var delete_checkbox = $(this).children("input"); if (delete_checkbox.length) { $(this).parents("li").hide() } else { $(this).parents("li").remove(); } delete_checkbox.val("True"); return false; }); // Add delete functionality to group forms $("#sortable-ingredients .group .delete-button").click(function() { $(this).parents("li").remove(); fix_ingredient_list(); return false; }); // Add autocomplete functionality to ingredient forms $("input.keywords-searchbar").each(function() { $(this).autocomplete({ source: "/ingredients/ing_list/", minLength: 2 }); $(this).blur(function() { $.ajax({ url: '/recipes/ingunits/', type: "POST", data: {ingredient_name: $(this).val()}, context: this, success: function(data) { var $options = $(this).closest('li').find('select'); var selected_id = $options.find('option:selected').val(); $options.empty(); $("<option value=\"\">---------</option>").appendTo($options); $.each($.parseJSON(data), function(id, val) { var option_string = "<option value=\"" + id.toString() + "\""; if (selected_id == id) { option_string = option_string + " selected=\"selected\""; } option_string = option_string + ">" + val + "</option>"; $(option_string).appendTo($options); }); } }); }) }); } $(document).ready(function() { // Make the ingredients and groups sortable $( "#sortable-ingredients" ).sortable({ stop: fix_ingredient_list, items: "li:not(.sorting-disabled)", handle: ".move-handle" }); $( "#sortable" ).disableSelection(); // Fix the list fix_ingredient_list(); // Add functionality to the add buttons $(".add-ingredient-button").click(add_ingredient); $(".add-ingredientgroup-button").click(add_group); });
/** * Exports lists of modules to be bundled as external "dynamic" libraries * * (@see webpack DllPlugin and DllReferencePlugin) */ module.exports = { 'angular_dll': [ 'angular', 'angular/angular.min', 'angular-animate', 'angular-bootstrap', 'angular-bootstrap-colorpicker', 'angular-breadcrumb', 'angular-daterangepicker', 'angular-datetime', 'angular-data-table/release/dataTable.helpers.min', 'angular-dragula', 'angular-loading-bar', 'angular-resource', 'angular-route', 'angular-sanitize', 'angular-strap', 'angular-toArrayFilter', 'angular-touch', 'angular-ui-router', 'angular-ui-select', 'angular-ui-tinymce', 'angular-ui-translation', 'angular-ui-tree', 'angular-ui-pageslide', 'ng-file-upload', 'at-table/dist/angular-table', 'angular-dragula' ] }
'use strict'; const { expect } = require('chai'); const kadence = require('..'); const network = require('./fixtures/node-generator'); const trust = require('../lib/plugin-trust'); const sinon = require('sinon'); const async = require('async'); describe('@module kadence/trust + @class UDPTransport', function() { let clock = null; let [node1, node2, node3, node4] = network(4, kadence.UDPTransport); before(function(done) { this.timeout(12000); clock = sinon.useFakeTimers(0); async.eachSeries([node1, node2, node3, node4], (node, next) => { node.listen(node.contact.port, next); }, done); }); after(function() { clock.restore(); process._getActiveHandles().forEach((h) => h.unref()); }) it('should allow the whitelisted contact', function(done) { node2.trust = node2.plugin(trust([ { identity: node1.identity, methods: ['PING'] } ], trust.MODE_WHITELIST)); node1.trust = node1.plugin(trust([ { identity: node2.identity, methods: ['PING'] } ], trust.MODE_WHITELIST)); node1.send('PING', [], [ node2.identity.toString('hex'), node2.contact ], done); }); it('should prevent the blacklisted contact', function(done) { node3.trust = node3.plugin(trust([ { identity: node1.identity, methods: ['PING'] } ], trust.MODE_BLACKLIST)); node1.trust.addTrustPolicy({ identity: node3.identity, methods: ['*'] }) node1.send('PING', [], [ node3.identity.toString('hex'), node3.contact ], err => { expect(err.message.includes('Refusing')).to.equal(true); done(); }); }); it('should allow the non-blacklisted contact', function(done) { node2.trust.addTrustPolicy({ identity: node3.identity.toString('hex'), methods: ['PING'] }) node2.send('PING', [], [ node3.identity.toString('hex'), node3.contact ], done); }); it('should prevent the non-whitelisted contact', function(done) { node4.send('PING', [], [ node2.identity.toString('hex'), node2.contact ], err => { expect(err.message.includes('Refusing')).to.equal(true); done(); }); }); it('should blacklist all nodes from using PING', function(done) { node3.trust.addTrustPolicy({ identity: '*', methods: ['PING'] }); node2.send('PING', [], [ node3.identity.toString('hex'), node3.contact ], err => { expect(err.message.includes('Refusing')).to.equal(true); node2.send('PING', [], [ node3.identity.toString('hex'), node3.contact ], err => { expect(err.message.includes('Refusing')).to.equal(true); done(); }); }); }); it('should refuse send to node with missing trust policy', function(done) { node1.trust.removeTrustPolicy(node2.identity); node1.send('PING', [], [ node2.identity.toString('hex'), node2.contact ], err => { expect(err.message.includes('Refusing')).to.equal(true); done(); }); }); it('should allow if method is not blacklisted', function(done) { node2.trust.addTrustPolicy({ identity: node3.identity, methods: ['PING'] }); node3.trust.addTrustPolicy({ identity: node2.identity, methods: ['FIND_NODE'] }); node2.send('PING', [], [ node3.identity, node3.contact ], done); }); it('should reject if method is not whitelisted', function(done) { node4.trust = node4.plugin(trust([ { identity: node2.identity, methods: ['FIND_NODE'] } ], trust.MODE_WHITELIST)); node2.trust.addTrustPolicy({ identity: node4.identity, methods: ['PING'] }); node4.send('FIND_NODE', [], [ node2.identity.toString('hex'), node2.contact ], err => { expect(err.message.includes('Refusing')).to.equal(true); done(); }); }); });
(function (tree) { tree.mixin = {}; tree.mixin.Call = function (elements, args, index) { this.selector = new(tree.Selector)(elements); this.arguments = args; this.index = index; }; tree.mixin.Call.prototype = { eval: function (env) { var mixins, rules = [], match = false; for (var i = 0; i < env.frames.length; i++) { if ((mixins = env.frames[i].find(this.selector)).length > 0) { for (var m = 0; m < mixins.length; m++) { if (mixins[m].match(this.arguments, env)) { try { Array.prototype.push.apply( rules, mixins[m].eval(env, this.arguments).rules); match = true; } catch (e) { throw { message: e.message, index: e.index, stack: e.stack, call: this.index }; } } } if (match) { return rules; } else { throw { message: 'No matching definition was found for `' + this.selector.toCSS().trim() + '(' + this.arguments.map(function (a) { return a.toCSS(); }).join(', ') + ")`", index: this.index }; } } } throw { message: this.selector.toCSS().trim() + " is undefined", index: this.index }; } }; tree.mixin.Definition = function (name, params, rules) { this.name = name; this.selectors = [new(tree.Selector)([new(tree.Element)(null, name)])]; this.params = params; this.arity = params.length; this.rules = rules; this._lookups = {}; this.required = params.reduce(function (count, p) { if (p.name && !p.value) { return count + 1 } else { return count } }, 0); this.parent = tree.Ruleset.prototype; this.frames = []; }; tree.mixin.Definition.prototype = { toCSS: function () { return "" }, variable: function (name) { return this.parent.variable.call(this, name) }, variables: function () { return this.parent.variables.call(this) }, find: function () { return this.parent.find.apply(this, arguments) }, rulesets: function () { return this.parent.rulesets.apply(this) }, eval: function (env, args) { var frame = new(tree.Ruleset)(null, []), context; for (var i = 0, val; i < this.params.length; i++) { if (this.params[i].name) { if (val = (args && args[i]) || this.params[i].value) { frame.rules.unshift(new(tree.Rule)(this.params[i].name, val.eval(env))); } else { throw { message: "wrong number of arguments for " + this.name + ' (' + args.length + ' for ' + this.arity + ')' }; } } } return new(tree.Ruleset)(null, this.rules.slice(0)).eval({ frames: [this, frame].concat(this.frames, env.frames) }); }, match: function (args, env) { var argsLength = (args && args.length) || 0, len; if (argsLength < this.required) { return false } len = Math.min(argsLength, this.arity); for (var i = 0; i < len; i++) { if (!this.params[i].name) { if (args[i].eval(env).toCSS() != this.params[i].value.eval(env).toCSS()) { return false; } } } return true; } }; })(require('less/tree'));
dojo.provide("tests.currency"); dojo.require("dojo.currency"); tests.register("tests.currency", [ { // Test formatting and parsing of currencies in various locales pre-built in dojo.cldr // NOTE: we can't set djConfig.extraLocale before bootstrapping unit tests, so directly // load resources here for specific locales: name: "currency", setUp: function(){ var partLocaleList = ["en-us", "en-ca", "de-de"]; for(var i = 0 ; i < partLocaleList.length; i ++){ dojo.requireLocalization("dojo.cldr","currency",partLocaleList[i]); dojo.requireLocalization("dojo.cldr","number",partLocaleList[i]); } }, runTest: function(t){ t.is("\u20ac123.45", dojo.currency.format(123.45, {currency: "EUR", locale: "en-us"})); t.is("$123.45", dojo.currency.format(123.45, {currency: "USD", locale: "en-us"})); t.is("$1,234.56", dojo.currency.format(1234.56, {currency: "USD", locale: "en-us"})); t.is("US$123.45", dojo.currency.format(123.45, {currency: "USD", locale: "en-ca"})); t.is("$123.45", dojo.currency.format(123.45, {currency: "CAD", locale: "en-ca"})); t.is("Can$123.45", dojo.currency.format(123.45, {currency: "CAD", locale: "en-us"})); t.is("123,45 \u20ac", dojo.currency.format(123.45, {currency: "EUR", locale: "de-de"})); t.is("1.234,56 \u20ac", dojo.currency.format(1234.56, {currency: "EUR", locale: "de-de"})); // There is no special currency symbol for ADP, so expect the ISO code instead t.is("ADP123", dojo.currency.format(123, {currency: "ADP", locale: "en-us"})); t.is(123.45, dojo.currency.parse("$123.45", {currency: "USD", locale: "en-us"})); t.is(1234.56, dojo.currency.parse("$1,234.56", {currency: "USD", locale: "en-us"})); t.is(123.45, dojo.currency.parse("123,45 \u20ac", {currency: "EUR", locale: "de-de"})); t.is(1234.56, dojo.currency.parse("1.234,56 \u20ac", {currency: "EUR", locale: "de-de"})); t.is(1234.56, dojo.currency.parse("1.234,56\u20ac", {currency: "EUR", locale: "de-de"})); t.is(1234, dojo.currency.parse("$1,234", {currency: "USD", locale: "en-us"})); t.is(1234, dojo.currency.parse("$1,234", {currency: "USD", fractional: false, locale: "en-us"})); t.t(isNaN(dojo.currency.parse("$1,234", {currency: "USD", fractional: true, locale: "en-us"}))); } } ] );
import Struct from "ref-struct-napi"; const Registers = Struct({ "r15": "int64", "r14": "int64", "r13": "int64", "r12": "int64", "rbp": "int64", "rbx": "int64", "r11": "int64", "r10": "int64", "r9": "int64", "r8": "int64", "rax": "int64", "rcx": "int64", "rdx": "int64", "rsi": "int64", "rdi": "int64", "orig_rax": "int64", "rip": "int64", "cs": "int64", "eflags": "int64", "rsp": "int64", "ss": "int64", "fs_base": "int64", "gs_base": "int64", "ds": "int64", "es": "int64", "fs": "int64", "gs": "int64", }); export default { Registers };
var searchData= [ ['img',['IMG',['../define_8h.html#a116f6464c8184676310301dc13ed1dd5',1,'define.h']]], ['items',['ITEMS',['../define_8h.html#a8e3d0b04841186d4f38b7880a9e4b5c6',1,'define.h']]] ];
/** * Iniciar panel de navegación (menú) */ function initSideBar(nav) { //-------------- Declaraciones ------------// let addMenuItem = function(menu, icon, label, click){ let li = $('<li><a href="javascript:void(0)"><i class="fa '+icon+' fa-fw"></i> '+label+'</a></li>'); if(click) li.on('click', click); menu.append(li); } let addSubMenu = function(id, menu, icon, label, filler){ let li = $('<li><a href="javascript:void(0)"><i class="fa '+icon+' fa-fw"></i> '+label+'<span class="fa arrow"></span></a></li>'); let ul = $('<ul class="nav nav-second-level"></ul>'); filler(ul); li.append(ul); menu.append(li); } let addSubMenuItem = function(menu, label, click){ let li = $('<li><a href="javascript:void(0)">'+label+'</a></li>'); if(click) li.on('click', click); menu.append(li); } let sidebar = $(` <div class="navbar-default sidebar" role="navigation"> <div class="sidebar-nav navbar-collapse"> <ul class="nav" id="side-menu"> </ul> </div> </div>`); let menu = sidebar.find('#side-menu'); //-------------- Ejecución -------------// // Agregar item "Inicio" addMenuItem(menu, 'fa-home', 'Inicio', function() { initHomePanel(); }); // Agregar item "Perfil" addMenuItem(menu, 'fa-user', 'Perfil', function() { initProfilePanel(); }); // Agregar item "Marcas" addMenuItem(menu, 'fa-bookmark', 'Marcas', function() { api.getAllBrands(function(data) { initContentPanel('Marcas', function(container) { createTable ( container, columnas = [ {title: "#", data: "id"}, {title: "Nombre", data: "name"} ], 'brands', data.brands ); }); }); }); // Agregar item "Categorías" addMenuItem(menu, 'fa-tags', 'Categorías', function() { api.getAllCategories(function(data) { initContentPanel('Categorías', function(container) { createTable ( container, columnas = [ {title: "#", data: "id"}, {title: "Descripción", data: "description"} ], 'categories', data.categories ); }); }); }); // Agregar item "Clientes" addMenuItem(menu, 'fa-users', 'Clientes', function() { api.getAllClients(function(data) { initContentPanel('Clientes', function(container) { createTable ( container, columnas = [ {title: "#", data: "id"}, {title: "Nombre", data: "name"}, {title: "CUIT", data: "cuit"}, {title: "Correo electrónico", data: "email"}, {title: "Teléfono", data:"phone"}, {title: "Dirección", data: "location"}, ], 'clients', data.clients ); }); }); }); // Agregar item "Productos" addMenuItem(menu, 'fa-th-list', 'Productos', function() { api.getAllProducts(function(data) { initContentPanel('Products', function(container) { createTable ( container, columnas = [ {title: "#", data: "id"}, {title: "Nombre", data: "name"}, {title: "Marca", data: "brand"}, {title: "Proveedor", data: "provider"}, {title: "Precio minorista", data:"retail_price"}, {title: "Precio mayorista", data: "wholesale_price"}, ], 'products', data.products ); let btnSubmit = $('<button type="button" id="submit-products" class="btn btn-success">Success</button>'); container.append(btnSubmit); }); }); }); // Agregar item "Proveedores" addMenuItem(menu, 'fa-truck', 'Proveedores', function() { api.getAllProviders(function(data) { initContentPanel('Providers', function(container) { createTable ( container, columnas = [ {title: "#", data: "id"}, {title: "Nombre", data: "name"}, {title: "Correo electrónico", data: "email"}, {title: "Teléfono", data:"phone"}, {title: "Compañía", data: "company"}, ], 'providers', data.providers ); }); }); }); // Agregar item "Ventas" addMenuItem(menu, 'fa-shopping-cart', 'Ventas', function() { api.getAllSales(function(data) { initContentPanel('Ventas', function(container) { createTable( container, columnas = [ {title: "#", data: "id"}, {title: "Usuario", data: "user"}, {title: "Cliente", data: "client"}, {title: "Total", data: "total"}, {title: "Fecha", data:"timestamp"}, ], 'sales', data.sales ); }); }); }); // Agregar item "Entregas" addSubMenu("deliveries", menu, 'fa-car', 'Entregas', function(submenu) { addSubMenuItem(submenu, "Hoy", function() { initDeliveriesPanel('today'); }); addSubMenuItem(submenu, "Atrasadas", function() { initDeliveriesPanel('delayed'); }); addSubMenuItem(submenu, "Pendientes", function() { initDeliveriesPanel('pending'); }); }); // Agregar item "Deudores" addMenuItem(menu, 'fa-warning', 'Deudores', function() { initDebtorsPanel(); }); nav.append(sidebar); }
$(document).ready(function () { // Open contact modal $('.contact').click(function(){ $('#contactModal').modal('toggle', { keyboard: false }).on('shown.bs.modal', function(){ var form = $('#ContactForm'); var submitButton = $('.submitContactForm'); submitButton.click(function(){ var email = $('#id_email'); var message = $('#id_message'); if(validateEmail(email.val()) && message.val() != ""){ //Valid information $.post( "/frontpage/contact/", form.serialize(), function(data){ if (data == 'True'){ $('#contactFormContainer').hide(); $('.submitContactForm').hide(); $('.contactformWarning').hide(); $('.contactformSuccess').show(); } else { $('.contactformWarning').show(); } }).fail(function() { $('.contactformWarning').show(); }); } else { //Not valid information $('.contactformWarning').show(); } }); }); }); // Validate email. function validateEmail($email) { var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; if( !emailReg.test( $email ) ) { return false; } else { return true; } } // Mobile messages var mobileUser = jQuery.browser.mobile; if (mobileUser){ $('.mobile-show').show(); $('.mobile-hide').hide(); } else { $('.mobile-show').hide(); $('.mobile-hide').show(); } });
/** * @fileOverview scripts about the frontpage. */ var calendarth = require('calendarth'); var util = require('./util'); var Front = module.exports = function() { this.$agendaContainer = null; this.$agendaItem = null; this.$error = null; }; /** @const {number} Maximum events to display, use an even number */ Front.MAX_EVENTS_SHOW = 10; /** * Initialize the frontpage view. * */ Front.prototype.init = function() { this.$agendaContainer = $('#agenda-items'); this.$agendaItem = $('#agenda-tpl'); this.$error = $('#agenda-error'); this.calendarth = calendarth({ apiKey: window.serv.calendarApiKey, calendarId: window.serv.callendarId, maxResults: 12 }); this.calendarth.fetch(this._handleCalResult.bind(this)); this._fixPanels(); }; /** * A temp fix for panels height. * * @private */ Front.prototype._fixPanels = function() { var max = 0; $('.panel-info').each(function() { var currentHeight = $(this).height(); if (currentHeight > max) { max = currentHeight; } }); $('.panel-info').height(max); }; /** * Handle incoming calendarth data. * * @param {?string|Error} err Possible error message. * @param {Object=} data The calendar data object. * @private */ Front.prototype._handleCalResult = function(err, data) { this.$agendaContainer.empty(); if (err) { this.$agendaContainer.append(this.$error.clone().removeClass('hide')); return; } var meetups = []; var displayed = 0; var elements = '<div class="row">'; data.items.forEach(function(item) { if (displayed >= Front.MAX_EVENTS_SHOW) { return; } if (meetups.indexOf(item.summary) > -1) { return; } else { meetups.push(item.summary); } if (displayed && displayed % 2 === 0) { // rows elements += '</div><div class="row">'; } elements += this._assignValues(this.$agendaItem.clone(), item); displayed++; }, this); elements += '</div>'; this.$agendaContainer.append(elements); }; /** * Assign the Calendar item values to the Calendar item element. * * @param {jQuery} $item A jquery item we will manipulate. * @param {Object} item [description] * @return {string} The html representation. * @private */ Front.prototype._assignValues = function($item, item) { $item.removeClass('hide'); $item.find('.panel-title').text(item.summary); var data = this._parseDesc(item.description); $item.find('.agenda-tpl-when span').text(util.formatDate(item.start, item.end)); var location = ''; if (data.mapUrl) { location = '<a href="' + data.mapUrl + '" target="_blank">'; location += item.location; location += '</a>'; } else { location = item.location; } $item.find('.agenda-tpl-address span').html(location); if (data.venue) { $item.find('.agenda-tpl-venue span').text(data.venue); } else { $item.find('.agenda-tpl-venue').addClass('hide'); } if (data.infoUrl) { var infoUrl = ''; if (data.infoUrl.length > 25) { infoUrl = data.infoUrl.substr(0, 25) + '...'; } else { infoUrl = data.infoUrl; } $item.find('.agenda-tpl-info a').attr('href', data.infoUrl).text(infoUrl); } else { $item.find('.agenda-tpl-info').addClass('hide'); } if (data.about) { $item.find('.agenda-tpl-about span').html(data.about); } else { $item.find('.agenda-tpl-about').addClass('hide'); } if (data.language) { $item.find('.agenda-tpl-language span').html(data.language); } else { $item.find('.agenda-tpl-language').addClass('hide'); } var eventUrl = this.calendarth.getEventUrl(item); $item.find('.addcal').attr('href', eventUrl); $item.find('.viewcal').attr('href', item.htmlLink); return $item.html(); }; /** * Parse the description and generated info. * * @param {string} descr The description * @return {Object} An object containing the following properties: * venue {?string} The venue where the event happens or null. * info {?string} The informational url or null. * map {?string} The map url or null. * language {?string} The event language. * @private */ Front.prototype._parseDesc = function(descr) { var out = { venue: null, infoUrl: null, mapUrl: null, about: null, language: null, rest: '' }; if (!descr) { return out; } var lines = descr.split('\n'); lines.forEach(function(line) { if (!line.length) { return; } var splitPos = line.indexOf(':'); if (splitPos === -1) { return; } var key = line.substr(0, splitPos).toLowerCase().trim(); var value = line.substr(splitPos + 1).trim(); switch(key) { case 'venue': out.venue = value; break; case 'info': out.infoUrl = value; break; case 'map': out.mapUrl = value; break; case 'about': out.about = value; break; case 'language': out.language = value; break; default: out.rest += line + '<br />'; break; } }, this); return out; };
// DO NOT EDIT! This test has been generated by tools/gentest.py. // OffscreenCanvas test in a worker:2d.fillStyle.parse.hsl-clamp-4 // Description: // Note:<p class="notes"> importScripts("/resources/testharness.js"); importScripts("/2dcontext/resources/canvas-tests.js"); var t = async_test(""); var t_pass = t.done.bind(t); var t_fail = t.step_func(function(reason) { throw reason; }); t.step(function() { var offscreenCanvas = new OffscreenCanvas(100, 50); var ctx = offscreenCanvas.getContext('2d'); ctx.fillStyle = '#f00'; ctx.fillStyle = 'hsl(120, 100%, -200%)'; ctx.fillRect(0, 0, 100, 50); _assertPixel(offscreenCanvas, 50,25, 0,0,0,255, "50,25", "0,0,0,255"); t.done(); }); done();
/* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* * * Date: 05 June 2003 * SUMMARY: Testing |with (f)| inside the definition of |function f()| * * See http://bugzilla.mozilla.org/show_bug.cgi?id=208496 * */ //----------------------------------------------------------------------------- var gTestfile = 'regress-208496-001.js'; var UBound = 0; var BUGNUMBER = 208496; var summary = 'Testing |with (f)| inside the definition of |function f()|'; var status = ''; var statusitems = []; var actual = '(TEST FAILURE)'; var actualvalues = []; var expect= ''; var expectedvalues = []; /* * GLOBAL SCOPE */ function f(par) { var a = par; with(f) { var b = par; actual = b; } } status = inSection(1); f('abc'); // this sets |actual| expect = 'abc'; addThis(); status = inSection(2); f(111 + 222); // sets |actual| expect = 333; addThis(); /* * EVAL SCOPE */ var s = ''; s += 'function F(par)'; s += '{'; s += ' var a = par;'; s += ' with(F)'; s += ' {'; s += ' var b = par;'; s += ' actual = b;'; s += ' }'; s += '}'; s += 'status = inSection(3);'; s += 'F("abc");'; // sets |actual| s += 'expect = "abc";'; s += 'addThis();'; s += 'status = inSection(4);'; s += 'F(111 + 222);'; // sets |actual| s += 'expect = 333;'; s += 'addThis();'; eval(s); /* * FUNCTION SCOPE */ function g(par) { // Add outer variables to complicate the scope chain - var a = '(TEST FAILURE)'; var b = '(TEST FAILURE)'; h(par); function h(par) { var a = par; with(h) { var b = par; actual = b; } } } status = inSection(5); g('abc'); // sets |actual| expect = 'abc'; addThis(); status = inSection(6); g(111 + 222); // sets |actual| expect = 333; addThis(); //----------------------------------------------------------------------------- test(); //----------------------------------------------------------------------------- function addThis() { statusitems[UBound] = status; actualvalues[UBound] = actual; expectedvalues[UBound] = expect; UBound++; } function test() { enterFunc('test'); printBugNumber(BUGNUMBER); printStatus(summary); for (var i=0; i<UBound; i++) { reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]); } exitFunc ('test'); }
/** * @class PrettyJSON.view.Leaf * @extends Backbone.View * * @author #rbarriga * @version 0.1 * */ PrettyJSON.view.Leaf = Backbone.View.extend({ tagName:'span', data:null, level:0, path:'', type:'string', isLast: true, events: { "mouseover .leaf-container": "mouseover", "mouseout .leaf-container": "mouseout" }, initialize: function(){ this.data = this.options.data; this.level = this.options.level; this.path = this.options.path; this.type = this.getType(); this.isLast = _.isUndefined(this.options.isLast) ? this.isLast : this.options.isLast; this.render(); }, getType: function(){ var m = 'string'; var d = this.data; if(_.isNumber(d)) m = 'number'; else if(_.isBoolean(d)) m = 'boolean'; else if(_.isDate(d)) m = 'date'; return m; }, getState:function(){ var coma = this.isLast ? '': ','; var state = { data: this.data, level: this.level, path: this.path, type: this.type, coma: coma }; return state; }, render: function(){ var state = this.getState(); this.tpl = _.template(PrettyJSON.tpl.Leaf, state); $(this.el).html(this.tpl); return this; }, mouseover:function(e){ e.stopPropagation(); this.toggleTdPath(true); var path = this.path + '&nbsp;:&nbsp;<span class="' + this.type +'"><b>' + this.data + '</b></span>'; this.trigger("mouseover",e, path); }, mouseout:function(e){ e.stopPropagation(); this.toggleTdPath(false); this.trigger("mouseout",e); }, getTds:function(){ this.tds = []; var view = this; while (view){ var td = view.parentTd; if(td) this.tds.push(td); view = view.parent; } }, toggleTdPath:function(show){ this.getTds(); _.each(this.tds,function(td){ show ? td.addClass('node-hgl-path'): td.removeClass('node-hgl-path'); },this); } });
/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* * Copyright (c) 2015, Joyent, Inc. */ /* * CollectorStream: transform that collects all input and makes it available as * a single string */ var readable = require('readable-stream'); var util = require('util'); module.exports = CollectorStream; function CollectorStream(options) { readable.Transform.call(this, options); this.data = ''; } util.inherits(CollectorStream, readable.Transform); CollectorStream.prototype._transform = function (chunk, encoding, done) { this.data += chunk; done(); }; CollectorStream.prototype._flush = function (callback) { callback(); };
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // @flow import * as React from 'react'; import { Provider } from 'react-redux'; import copy from 'copy-to-clipboard'; import { render } from 'firefox-profiler/test/fixtures/testing-library'; import { CallNodeContextMenu } from '../../components/shared/CallNodeContextMenu'; import { storeWithProfile } from '../fixtures/stores'; import { getProfileFromTextSamples } from '../fixtures/profiles/processed-profile'; import { changeRightClickedCallNode, changeExpandedCallNodes, setContextMenuVisibility, } from '../../actions/profile-view'; import { selectedThreadSelectors } from '../../selectors/per-thread'; import { ensureExists } from '../../utils/flow'; import { fireFullClick } from '../fixtures/utils'; describe('calltree/CallNodeContextMenu', function () { // Provide a store with a useful profile to assert context menu operations off of. function createStore() { // Create a profile that every transform can be applied to. const { profile, funcNamesDictPerThread: [{ A, B }], } = getProfileFromTextSamples(` A A A B[lib:XUL] B[lib:XUL] B[lib:XUL] B[lib:XUL] B[lib:XUL] B[lib:XUL] B[lib:XUL] B[lib:XUL] B[lib:XUL] C C H D F I E E `); const store = storeWithProfile(profile); store.dispatch(changeExpandedCallNodes(0, [[A]])); store.dispatch(changeRightClickedCallNode(0, [A, B])); return store; } function setup(store = createStore(), openMenuState = true) { store.dispatch(setContextMenuVisibility(openMenuState)); const renderResult = render( <Provider store={store}> <CallNodeContextMenu /> </Provider> ); return { ...renderResult, getState: store.getState }; } describe('basic rendering', function () { it('does not render the context menu when it is closed', () => { const isContextMenuOpen = false; const { container } = setup(createStore(), isContextMenuOpen); expect(container.querySelector('.react-contextmenu')).toBeNull(); }); it('renders a full context menu when open, with many nav items', () => { const isContextMenuOpen = true; const { container } = setup(createStore(), isContextMenuOpen); expect( ensureExists( container.querySelector('.react-contextmenu'), `Couldn't find the context menu root component .react-contextmenu` ).children.length > 1 ).toBeTruthy(); expect(container.firstChild).toMatchSnapshot(); }); }); describe('clicking on call tree transforms', function () { // Iterate through each transform slug, and click things in it. const fixtures = [ { matcher: /Merge function/, type: 'merge-function' }, { matcher: /Merge node only/, type: 'merge-call-node' }, { matcher: /Focus on subtree only/, type: 'focus-subtree' }, { matcher: /Focus on function/, type: 'focus-function' }, { matcher: /Collapse function/, type: 'collapse-function-subtree' }, { matcher: /XUL/, type: 'collapse-resource' }, { matcher: /Collapse direct recursion/, type: 'collapse-direct-recursion', }, { matcher: /Drop samples/, type: 'drop-function' }, ]; fixtures.forEach(({ matcher, type }) => { it(`adds a transform for "${type}"`, function () { const { getState, getByText } = setup(); fireFullClick(getByText(matcher)); expect( selectedThreadSelectors.getTransformStack(getState())[0].type ).toBe(type); }); }); }); describe('clicking on the rest of the menu items', function () { it('can expand all call nodes in the call tree', function () { const { getState, getByText } = setup(); expect( selectedThreadSelectors.getExpandedCallNodeIndexes(getState()) ).toHaveLength(1); fireFullClick(getByText('Expand all')); // This test only asserts that a bunch of call nodes were actually expanded. expect( selectedThreadSelectors.getExpandedCallNodeIndexes(getState()) ).toHaveLength(11); }); it('can look up functions on SearchFox', function () { const { getByText } = setup(); jest.spyOn(window, 'open').mockImplementation(() => {}); fireFullClick(getByText(/Searchfox/)); expect(window.open).toBeCalledWith( 'https://searchfox.org/mozilla-central/search?q=B', '_blank' ); }); it('can copy a function name', function () { const { getByText } = setup(); // Copy is a mocked module, clear it both before and after. fireFullClick(getByText('Copy function name')); expect(copy).toBeCalledWith('B'); }); it('can copy a script URL', function () { // Create a new profile that has JavaScript in it. const { profile, funcNamesPerThread: [funcNames], } = getProfileFromTextSamples(` A.js `); const funcIndex = funcNames.indexOf('A.js'); const [thread] = profile.threads; thread.funcTable.fileName[funcIndex] = thread.stringTable.indexForString( 'https://example.com/script.js' ); const store = storeWithProfile(profile); store.dispatch(changeRightClickedCallNode(0, [funcIndex])); const { getByText } = setup(store); // Copy is a mocked module, clear it both before and after. fireFullClick(getByText('Copy script URL')); expect(copy).toBeCalledWith('https://example.com/script.js'); }); it('can copy a stack', function () { const { getByText } = setup(); // Copy is a mocked module, clear it both before and after. fireFullClick(getByText('Copy stack')); expect(copy).toBeCalledWith(`B\nA\n`); }); }); });
/*global getAccessToken*/ function notifyUser(user) { browser.notifications.create({ "type": "basic", "title": "Google info", "message": `Hi ${user.name}` });} function logError(error) { console.error(`Error: ${error}`); } /** When the button's clicked: - get an access token using the identity API - use it to get the user's info - show a notification containing some of it */ browser.browserAction.onClicked.addListener(() => { getAccessToken() .then(getUserInfo) .then(notifyUser) .catch(logError); });
(function (badges, $, undefined) { "use strict"; var options = {}, geocoder, map, marker; badges.options = function (o) { $.extend(options, o); }; badges.init = function () { initializeTypeahead(); initializeImagePreview(); $(".datepicker").datepicker({ format: 'm/d/yyyy', autoclose: true }); initializeMap(); }; function initializeTypeahead() { $("#Experience_Name").typeahead({ name: 'title', prefetch: options.TitlesUrl, limit: 10 }); $("#Experience_Organization").typeahead({ name: 'orgs', prefetch: options.OrganizationsUrl, limit: 10 }); } function initializeImagePreview() { $("#cover-image").change(function () { var filesToUpload = this.files; if (filesToUpload.length !== 1) return; var file = filesToUpload[0]; if (!file.type.match(/image.*/)) { alert("only images, please"); } var img = document.getElementById("cover-preview"); img.src = window.URL.createObjectURL(file); img.onload = function(e) { window.URL.revokeObjectURL(this.src); }; //img.height = 500; }); } function initializeMap() { var davisLatLng = new google.maps.LatLng(38.5449065, -121.7405167); geocoder = new google.maps.Geocoder(); var mapOptions = { center: davisLatLng, zoom: 10, mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions); marker = new google.maps.Marker({ map: map, position: davisLatLng }); $("#Experience_Location").blur(function () { var address = this.value; geocoder.geocode({ 'address': address }, function (results, status) { if (status == google.maps.GeocoderStatus.OK) { if (marker) marker.setMap(null); //clear existing marker map.setCenter(results[0].geometry.location); marker = new google.maps.Marker({ map: map, position: results[0].geometry.location }); if (results[0].geometry.viewport) map.fitBounds(results[0].geometry.viewport); } else { alert('Geocode was not successful for the following reason: ' + status); } }); }); } }(window.Badges = window.Badges || {}, jQuery));
export default (collection, clickable, text) => () => { return collection('.consul-auth-method-list [data-test-list-row]', { authMethod: clickable('a'), name: text('[data-test-auth-method]'), displayName: text('[data-test-display-name]'), type: text('[data-test-type]'), }); };
'use strict'; require('should'); describe('index.html', () => { beforeEach(() => { browser.url('/'); // browser.localStorage('DELETE') does not work in PhantomJS browser.execute(function() { delete window.localStorage; window.localStorage = {}; }); browser.url('/'); $('#default-username').waitForEnabled(); $('#default-username').setValue('test'); $('#shared-secret').setValue('test'); $('.save-settings').click(); $('#domain').waitForEnabled(); // wait for .modal-bg to be hidden browser.waitUntil(() => $('.modal-bg').getCssProperty('z-index').value == -1 ); }); it('should generate a password', () => { $('#domain').setValue('example.com'); browser.waitUntil(() => $('#password').getValue() == 'z<u9N_[c"R' ); }); it('should generate a password at a given index', () => { $('#index').selectByVisibleText('1'); $('#domain').setValue('example.com'); browser.waitUntil(() => $('#password').getValue() == 'g:3WGYj0}~' ); }); it('should generate a password of a given length', () => { $('#length').selectByVisibleText('8'); $('#domain').setValue('example.com'); browser.waitUntil(() => $('#password').getValue() == 'u9N_[c"R' ); }); it('should open settings menu', () => { $('#open-settings').click(); browser.waitUntil(() => $('#settings').getLocation('y') >= 0 ); }); it('should change the algorithm', () => { $('#open-settings').click(); $('#algorithm').waitForEnabled(); $('#algorithm').selectByVisibleText('SHA-512'); $('.save-settings').click(); $('#domain').waitForEnabled(); $('#domain').setValue('example.com'); browser.waitUntil(() => $('#password').getValue() == 'V{fvC^YRi(' ); }); });
import React from 'react'; import cn from 'classnames'; import keyboardJS from 'keyboardjs'; import ReactTooltip from 'react-tooltip'; import sendToAddon from '../client-lib/send-to-addon'; export default class PrevButton extends React.Component { constructor(props) { super(props); this.state = {historyIndex: 0}; } componentDidMount() { // previous track keyboardJS.bind('<', () => this.prevTrack()); } prevTrack() { let index; // if clicked more than once within // 5 seconds increment the index so // the user can get to further back // in history. Resets when timeout wears out. if (this.searchingHistory) { if (this.props.history.length > this.state.historyIndex + 1) { this.setState({historyIndex: this.state.historyIndex + 1}); } index = this.state.historyIndex; } else { index = 0; this.searchingHistory = true; setTimeout(() => { this.searchingHistory = false; this.setState({historyIndex: 0}); }, 5000); } sendToAddon({ action: 'track-added-from-history', index }); } render() { return ( <div className={cn('prev-wrapper', {hidden: (!this.props.hovered && !this.props.minimized) || this.props.confirm || !this.props.history.length})}> <a onClick={this.prevTrack.bind(this)} className='prev' data-tip data-for='prev' /> <ReactTooltip id='prev' effect='solid' place='right'>{this.props.strings.ttPrev}</ReactTooltip> </div> ); } }
#!/usr/bin/env node process.chdir(__dirname) var crypto = require('crypto'), fs = require('fs'), config = require('../config.js') var newPasswordSha1 = crypto.createHash('sha1').update('').digest('hex') var content = '// auto-generated\n' + 'exports.port = ' + config.port + '\n' + 'exports.host = ' + JSON.stringify(config.host) + '\n' + 'exports.keySha1 = ' + JSON.stringify(newPasswordSha1) + '\n' fs.writeFileSync('../config.js', content) console.log('New key is an empty string')
"use strict"; var types = require('./types'); var Tree = require('./tree'); var Rule = require('./rule'); var Principle = require('./principle'); var Lexicon = require('./lexicon'); var Nothing = types.Nothing; var eq = types.eq; var normalize = types.normalize; function Parser ( grammar ) { return { borjes: 'parser', rules: grammar.rules, principles: grammar.principles, lexicon: grammar.lexicon, table: [], n: 0 } } function all_matches ( p, a_x, a_y, b_x, b_y ) { var a = p.table[a_x][a_y]; var b = p.table[b_x][b_y]; var matches = []; for (var i = 0; i<a.length; i++) { for (var j = 0; j<b.length; j++) { matches.push([a[i], b[j]]); } } return matches; } function all_legs ( p, from, to, n ) { if (n!=2) { throw "Non-binary rules not supported"; } var legs = []; for (var i = to-1; i >= 0; i--) { legs = legs.concat(all_matches(p, from, i, from+i+1, to-(i+1))); } return legs; }; function apply_principles ( p, ms, success, i ) { i = i || 0; if (i>=p.principles.length) { for (var j=0; j<ms.length; j++) { success(ms[j]); } } else { var prin = p.principles[i]; for (var j=0; j<ms.length; j++) { var r = Principle.apply(prin, ms[j]); apply_principles(p, r, success, i+1); } } } function exhaust ( p, from, to ) { p.table[from][to] = []; var cell = p.table[from][to]; for (var i = 0; i<p.rules.length; i++) { var rule = p.rules[i]; var legs = all_legs(p, from, to, rule.arity); for (var j = 0; j<legs.length; j++) { var mothers = Rule.apply(rule, legs[j].map(function(t) { return t.node; })); apply_principles(p, mothers, function(x) { cell.push(Tree(normalize(x), legs[j])); }); } } }; function input ( p, word ) { var w = Lexicon.get(p.lexicon, word); if (w === undefined) { w = Nothing; } var wordt = Tree(word); if (!w.length) { p.table[p.n] = [[ Tree(w, wordt) ]]; } else { p.table[p.n] = []; p.table[p.n][0] = w.map(function(x) { return Tree(x, wordt); }); } for (var i = p.n-1; i>=0; i--) { exhaust(p, i, p.n-i); } p.n++; }; function parse ( p, sentence ) { if (p.borjes !== 'parser') { p = Parser(p); } else { reset(p); } for (var i = 0; i<sentence.length; i++) { input(p, sentence[i]); } var top = p.table[0][p.n-1]; if (top.length === 0) { return Nothing; } else { return top; } }; function reset ( p ) { p.table = []; p.n = 0; }; Parser.reset = reset; Parser.input = input; Parser.parse = parse; module.exports = Parser;
import React from 'react'; export function MessagePanel(props, context) { let message = context.messenger.getMessage(); let messagePanel; if (message !== undefined) { messagePanel = ( <div className={ 'alert alert-' + message.type }> { message.text } </div> ); context.messenger.clearMessages(); } else { messagePanel = ( <div style={{ 'display': 'none' }}></div> ); } return messagePanel; } MessagePanel.contextTypes = { messenger: React.PropTypes.object };
'use strict'; var mongoose = require('mongoose'), Schema = mongoose.Schema; var Event = new Schema({ name: String, description: String, sport: String, place: { name: String, coords: { longitude: { type: Number }, latitude: { type: Number } }, address: {type: String, default: '', unique: true, trim: true}, landmarks: [{type: String, default: '', trim: true}], city : {type: String, default: '', trim: true}, }, when: Date, organizer: {type: Schema.ObjectId, ref: 'User'}, players: { 'yes': [{type: Schema.ObjectId, ref: 'User'}], 'no': [{type: Schema.ObjectId, ref: 'User'}], 'maybe': [{type: Schema.ObjectId, ref: 'User'}], 'none': [{type: Schema.ObjectId, ref: 'User'}] }, subscribers: [{type: Schema.ObjectId, ref: 'User'}], score: String, comments: [{ comment: String, commented_on: Date, by: {type: Schema.ObjectId, ref: 'User'} }], created_at: {type: Date, default: Date.now}, modified_at: {type: Date, default: Date.now} }); module.exports = mongoose.model('Event', Event);
/* Places, Copyright 2014 Ansamb. This file is part of Places By Ansamb. Places By Ansamb is free software: you can redistribute it and/or modify it under the terms of the Affero GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Places By Ansamb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Affero GNU General Public License for more details. You should have received a copy of the Affero GNU General Public License along with Places By Ansamb. If not, see <http://www.gnu.org/licenses/>. */ module.exports = { up: function(migration, DataTypes, done) { migration.addColumn('places','request_id',{ type:DataTypes.STRING, allowNull:true, defaultValue:null }).success(function(res){ console.log("Migration to v0.0.4: Added request_id into table places",res); done() }); // add altering commands here, calling 'done' when finished }, down: function(migration, DataTypes, done) { // add reverting commands here, calling 'done' when finished done() } }
// This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. CKEDITOR.plugins.setLang('GeSHi', 'en', { langGeSHi : { title: 'GeSHi', label: 'Post syntax highlighted code', langLbl: 'Select language' } });
'use strict'; import Flickity from 'flickity-imagesloaded' export default function LessonHeader() { console.log("-- LessonHeader initialized") let photosSelector = '.LessonHeader__photos' let $photos = $(photosSelector) if ($photos.length > 0) { let photoSelector = '.LessonHeader__photo' let $status = $('.LessonHeader__photos__status') let $current = $status.find('.current') let $total = $status.find('.total') // Init flickity for all carousels let flkty = new Flickity(photosSelector, { cellAlign: 'left', cellSelector: photoSelector, contain: true, pageDots: false, prevNextButtons: false, wrapAround: true, imagesLoaded: true, percentPosition: false, }) document.addEventListener("turbolinks:request-start", function() { flkty.destroy() }) $total.html($(photoSelector).length) flkty.on( 'select', function() { $current.html(flkty.selectedIndex + 1) }) return flkty } }
define([], function () { return function (distributor) { var container = document.createElement("ul") container.classList.add("filters") var div = document.createElement("div") function render(el) { el.appendChild(div) } function filtersChanged(filters) { while (container.firstChild) container.removeChild(container.firstChild) filters.forEach( function (d) { var li = document.createElement("li") container.appendChild(li) d.render(li) var button = document.createElement("button") button.textContent = "" button.onclick = function () { distributor.removeFilter(d) } li.appendChild(button) }) if (container.parentNode === div && filters.length === 0) div.removeChild(container) else if (filters.length > 0) div.appendChild(container) } return { render: render, filtersChanged: filtersChanged } } })
/* The Conflict of Interest (COI) module of Kuali Research Copyright © 2005-2016 Kuali, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/> */ /* eslint-disable no-magic-numbers, camelcase */ import { DISCLOSURE_TYPE, DISCLOSURE_STEP, ROLES } from '../coi-constants'; import hashCode from '../hash'; export function createProject(sourceIdentifier) { return { title: 'TEST TITLE', typeCode: 1, sourceSystem: 'KC-PD', sourceIdentifier, sourceStatus: '1', sponsors: [ { sponsorCode: '000340', sponsorName: 'NIH', sourceSystem: 'KC-PD', sourceIdentifier } ], startDate: '2017-01-01', endDate: '2017-1-31' }; } export async function insertProject(knex, project) { const id = await knex('project').insert({ title: project.title, type_cd: project.typeCode, source_system: project.sourceSystem, source_identifier: project.sourceIdentifier, source_status: project.sourceStatus, start_date: new Date(project.startDate), end_date: new Date(project.endDate) }, 'id'); await knex('project_sponsor').insert({ project_id: id[0], source_identifier: project.sourceIdentifier, source_system: project.sourceSystem, sponsor_cd: project.sponsors[0].sponsorCode, sponsor_name: project.sponsors[0].sponsorName }); return id[0]; } export function createPerson(personId, roleCode, active) { return { personId, sourcePersonType: 'EMPLOYEE', roleCode, active }; } export async function insertProjectPerson(knex, projectPerson, projectId, dispositionTypeCd, isNew) { const id = await knex('project_person') .insert({ project_id: projectId, person_id: projectPerson.personId, source_person_type: projectPerson.sourcePersonType, role_cd: projectPerson.roleCode, active: projectPerson.active, disposition_type_cd: dispositionTypeCd, new: isNew !== undefined ? isNew : true },'id'); return id[0]; } export function createDisclosure(statusCd) { return { typeCd: DISCLOSURE_TYPE.ANNUAL, statusCd, startDate: new Date(), configId: 1 }; } export async function insertDisclosure(knex, disclosure, user_id) { const id = await knex('disclosure').insert({ type_cd: disclosure.typeCd, status_cd: disclosure.statusCd, user_id, start_date: new Date(disclosure.startDate), config_id: disclosure.configId, submitted_by: user_id }, 'id'); return id[0]; } export function createComment(disclosureId, user) { return { disclosureId, topicSection: DISCLOSURE_STEP.QUESTIONNAIRE, topicId: 1, text: 'blah', userId: hashCode(user), author: user, date: new Date(), piVisible: true, reviewerVisible: true }; } export async function insertComment(knex, disclosure_id, user, text) { const id = await knex('review_comment').insert({ disclosure_id, text: text || 'I like this.', topic_section: DISCLOSURE_STEP.QUESTIONNAIRE, topic_id: 1, date: new Date(), user_id: hashCode(user), user_role: ROLES.USER, author: user, pi_visible: false, reviewer_visible: true }, 'id'); return id[0]; } export async function getComment(knex, id) { const comments = await knex('review_comment') .select( 'id', 'disclosure_id as disclosureId', 'topic_section as topicSection', 'topic_id as topicId', 'text', 'user_id as userId', 'author', 'date', 'pi_visible as piVisible', 'reviewer_visible as reviewerVisible', 'user_role as userRole', 'editable', 'current' ) .where('id', id); return comments[0]; } export function createDeclaration(disclosureId, finEntityId, projectId) { return { disclosureId, finEntityId, projectId }; } export async function insertDeclaration(knex, declaration) { const id = await knex('declaration').insert({ disclosure_id: declaration.disclosureId, fin_entity_id: declaration.finEntityId, project_id: declaration.projectId }, 'id'); return id[0]; } export function createEntity(disclosureId, status, active) { return { disclosureId, status, active }; } export async function insertEntity(knex, entity) { const id = await knex('fin_entity') .insert({ disclosure_id: entity.disclosureId, status: entity.status, active: entity.active }, 'id'); return id[0]; } export function randomInteger(max = 1000000) { return Math.floor(Math.random() * max); } export async function asyncThrows(fn, ...params) { let errorThrown = false; try { await fn(...params); } catch (err) { errorThrown = true; } return errorThrown; } export async function cleanUp(knex, tableName, id, idColumnName = 'id') { await knex(tableName) .del() .where({ [idColumnName]: id }); }
import test from 'ava'; import {big64, get64} from '../../src/index.js'; function macro(t, a, o, expected) { expected = get64(...expected); t.deepEqual(big64(a, o), expected); } macro.title = (providedTitle, a, o, expected) => `${providedTitle || ''} big64(${a}, ${o}) === ${expected}`.trim(); test( macro, [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], 0, [0x00_00_00_00, 0x00_00_00_00], ); test( macro, [0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], 0, [0xff_00_00_00, 0x00_00_00_00], ); test( macro, [0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00], 0, [0xff_ff_ff_ff, 0xff_ff_ff_00], ); test( macro, [0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff], 0, [0xff_ff_ff_ff, 0xff_ff_ff_ff], ); test( macro, [0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00], 0, [0x00_00_ff_00, 0x00_00_00_00], ); test( macro, [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00], 0, [0x00_00_00_00, 0x00_00_01_00], ); test( macro, [0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00], 0, [0x00_00_00_a0, 0x00_00_00_00], ); test( macro, [0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0c], 1, [0x00_00_a0_00, 0x00_00_00_03], );
/* This file is part of the HeavenMS MapleStory Server Copyleft (L) 2016 - 2019 RonanLana This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation version 3 as published by the Free Software Foundation. You may not use, modify or distribute this program under any other version of the GNU Affero General Public License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ var status = -1; function start(mode, type, selection) { if (mode == -1) { qm.dispose(); } else { if(mode == 0 && type > 0) { qm.dispose(); return; } if (mode == 1) status++; else status--; if (status == 0) { qm.sendNext("We're a pack of wolves looking for our lost child. I hear you are taking care of our baby. We appreciate your kindness, but it's time to return our baby to us.", 9); } else if (status == 1) { qm.sendNextPrev("Werewolf is my friend, I can't just hand over a friend.", 3); } else if (status == 2) { qm.sendAcceptDecline("We understand, but we won't leave without our pup. Tell you what, we'll test you to see if you are worthy of raising a wolf. #rGet ready to be tested by wolves.#k"); } else if (status == 3) { var em = qm.getEventManager("Aran_3rdmount"); if (em == null) { qm.sendOk("Sorry, but the 3rd mount quest (Wolves) is closed."); return; } else { var em = qm.getEventManager("Aran_3rdmount"); if (!em.startInstance(qm.getPlayer())) { qm.sendOk("There is currently someone in this map, come back later."); } else { qm.forceStartQuest(); } } } else if (status == 4) { qm.dispose(); } } }
bpmnGatewayInclusive=function(width,_30ab){ VectorFigure.call(this); this.stroke =1; }; bpmnGatewayInclusive.prototype=new VectorFigure; bpmnGatewayInclusive.prototype.type="bpmnGatewayInclusive"; bpmnGatewayInclusive.prototype.paint=function(){ VectorFigure.prototype.paint.call(this); if(typeof workflow.zoomfactor == 'undefined') workflow.zoomfactor = 1; //Set the Task Limitation if(typeof this.limitFlag == 'undefined' || this.limitFlag == false) { this.originalWidth = 40; this.originalHeight = 40; this.orgXPos = this.getX(); this.orgYPos = this.getY(); this.orgFontSize =this.fontSize; } this.width = this.originalWidth * workflow.zoomfactor; this.height = this.originalHeight * workflow.zoomfactor; var cw = this.getWidth(); var ch = this.getHeight(); var x=new Array(0,cw*0.5,cw,cw*0.5); var y=new Array(ch*0.5,ch,ch*0.5,0); //var x=new Array(0,this.width/2,this.width,this.width/2); //var y=new Array(this.height/2,this.height,this.height/2,0); var x2 = new Array(); var y2 = new Array(); for(var i=0;i<x.length;i++){ x2[i]=x[i]+4; y2[i]=y[i]+1; } this.graphics.setStroke(this.stroke); this.graphics.setColor( "#c0c0c0" ); this.graphics.fillPolygon(x2,y2); this.graphics.setStroke(1); this.graphics.setColor( "#ffffe5" ); this.graphics.fillPolygon(x,y); this.graphics.setColor("#c8c865"); this.graphics.drawPolygon(x,y); var x_cir = 15; var y_cir = 15; this.graphics.setColor("#c8c865"); this.graphics.drawEllipse(this.getWidth()/4,this.getHeight()/4,this.getWidth()/2,this.getHeight()/2); this.graphics.paint(); if (this.input1 != null) { this.input1.setPosition(0, this.height / 2); } if (this.input2 != null) { this.input2.setPosition(this.width / 2, 0); } if (this.output1 != null) { this.output1.setPosition(this.height / 2, this.width); } if (this.output2 != null) { this.output2.setPosition(this.width, this.height / 2); } if (this.output3 != null) { this.output3.setPosition(0, this.height /2 ); } }; bpmnGatewayInclusive.prototype.setWorkflow=function(_40c5){ VectorFigure.prototype.setWorkflow.call(this,_40c5); if(_40c5!=null){ var h2 = this.height/2; var w2 = this.width/2; var gatewayPortName = ['output1', 'output2', 'output3', 'input1', 'input2' ]; var gatewayPortType = ['OutputPort','OutputPort','OutputPort','InputPort','InputPort']; var gatewayPositionX= [w2, this.width, 0 , 0, w2 ]; var gatewayPositionY= [this.width, h2, h2, h2, 0 ]; for(var i=0; i< gatewayPortName.length ; i++){ eval('this.'+gatewayPortName[i]+' = new '+gatewayPortType[i]+'()'); //Create New Port eval('this.'+gatewayPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow eval('this.'+gatewayPortName[i]+'.setName("'+gatewayPortName[i]+'")'); //Set PortName eval('this.'+gatewayPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure eval('this.'+gatewayPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white eval('this.'+gatewayPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white eval('this.addPort(this.'+gatewayPortName[i]+','+gatewayPositionX[i]+', '+gatewayPositionY[i]+')'); //Setting Position of the port } } }; bpmnGatewayInclusive.prototype.getContextMenu=function(){ if(this.id != null){ this.workflow.handleContextMenu(this); } };
import SPELLS from 'common/SPELLS/index'; /* * Fields: * int: spell scales with Intellect * crit: spell scales with (is able to or procced from) Critical Strike * hasteHpm: spell does more healing due to Haste, e.g. HoTs that gain more ticks * hasteHpct: spell can be cast more frequently due to Haste, basically any spell except for non haste scaling CDs * mastery: spell is boosted by Mastery * masteryStack: spell's HoT counts as a Mastery Stack * vers: spell scales with Versatility * multiplier: spell scales with whatever procs it, should be ignored for purpose of weights and for 'total healing' number * ignored: spell should be ignored for purpose of stat weights */ // This only works with actual healing events; casts are not recognized. export default { [SPELLS.LEECH.id]: { // procs a percent of all your healing, so we ignore for weights and total healing multiplier: true, }, [SPELLS.XAVARICS_MAGNUM_OPUS.id]: { // Prydaz int: false, crit: false, hasteHpct: false, mastery: false, vers: true, }, [SPELLS.HEALTHSTONE.id]: { int: false, crit: false, hasteHpct: false, mastery: false, vers: true, // confirmed }, [SPELLS.COASTAL_HEALING_POTION.id]: { int: false, crit: false, hasteHpct: false, mastery: false, vers: true, }, [SPELLS.MARK_OF_THE_ANCIENT_PRIESTESS.id]: { int: false, crit: true, hasteHpct: false, mastery: false, vers: true, }, // https://www.warcraftlogs.com/reports/zxXDd7CJFbLQpHGM/#fight=12&source=3&type=summary [SPELLS.RESOUNDING_PROTECTION_ABSORB.id]: { // General Azerite Power int: false, crit: false, hasteHpct: false, mastery: false, vers: true, }, [SPELLS.IMPASSIVE_VISAGE_HEAL.id]: { int: false, crit: true, hasteHpct: false, mastery: false, vers: true, }, [SPELLS.VAMPIRIC_SPEED_HEAL.id]: { // General(?) Azerite trait int: false, crit: true, hasteHpct: false, mastery: false, vers: true, }, [SPELLS.STALWART_PROTECTOR.id]: { // General Paladin Azerite Power int: false, crit: false, hasteHpct: false, mastery: false, vers: true, }, [SPELLS.REJUVENATING_TIDES.id]: { // Darkmoon Deck: Tides int: false, crit: true, hasteHpct: false, mastery: false, vers: true, }, [SPELLS.TOUCH_OF_THE_VOODOO.id]: { // Revitalizing Voodoo Totem int: false, crit: true, hasteHpct: false, hasteHpm: true, mastery: false, vers: true, }, // https://www.warcraftlogs.com/reports/zxXDd7CJFbLQpHGM/#fight=12&source=3 [SPELLS.CONCENTRATED_MENDING_HEALING.id]: { // Healing Azerite Power int: false, crit: true, hasteHpm: true, mastery: true, // TODO: Re-evaluate, going on word of mouth and I have my doubts vers: true, }, // https://www.warcraftlogs.com/reports/cXnPABVbLjk68qyM#fight=6&type=healing&source=10 271682: { // Harmonious Chord - Lady Waycrest's Music Box (trinket) int: false, crit: true, hasteHpct: false, hasteHpm: true, mastery: false, vers: true, }, // https://www.warcraftlogs.com/reports/cXnPABVbLjk68qyM#fight=6&type=healing&source=10&ability=267537&view=events 267537: { // Coastal Surge (Weapon enchant) int: false, crit: true, hasteHpct: false, hasteHpm: true, mastery: false, vers: true, }, // https://www.warcraftlogs.com/reports/axKCmGyfgXFw6QVL/#fight=28&source=156 [SPELLS.BLESSED_PORTENTS_HEAL.id]: { // General Azerite Power int: false, crit: true, hasteHpm: true, mastery: false, vers: true, }, // https://www.warcraftlogs.com/reports/axKCmGyfgXFw6QVL/#fight=28&source=156 [SPELLS.BRACING_CHILL_HEAL.id]: { // General Azerite Power int: false, crit: true, hasteHpm: true, mastery: false, vers: true, }, // https://www.warcraftlogs.com/reports/fKaZdyWcQYAwTtz2/#fight=4&source=9&type=healing&options=8 [SPELLS.AZERITE_FORTIFICATION.id]: { // General Azerite Power int: false, crit: true, hasteHpct: false, mastery: false, vers: true, }, // https://www.warcraftlogs.com/reports/fKaZdyWcQYAwTtz2/#fight=4&source=9&type=healing&options=8 [SPELLS.AZERITE_VEINS.id]: { // General Azerite Power int: false, crit: true, hasteHpm: true, mastery: false, vers: true, }, // https://www.warcraftlogs.com/reports/fKaZdyWcQYAwTtz2/#fight=4&source=9&type=healing&options=8 [SPELLS.SAVIOR.id]: { // General Azerite Power int: false, crit: true, hasteHpm: true, mastery: false, vers: true, }, // https://www.warcraftlogs.com/reports/LpM43CgfYQ9ntXyz/#fight=4&source=3 [SPELLS.LASER_MATRIX_HEAL.id]: { // General Azerite trait int: false, crit: true, hasteHpm: true, mastery: false, vers: true, }, // https://www.warcraftlogs.com/reports/LpM43CgfYQ9ntXyz/#fight=4&source=3 [SPELLS.MUTATING_ANTIBODY.id]: { // Inoculating Extract int: false, crit: true, hasteHpct: false, mastery: false, vers: true, }, };
import SPELLS from 'common/SPELLS'; import RESOURCE_TYPES from 'game/RESOURCE_TYPES'; import Analyzer, { SELECTED_PLAYER } from 'parser/core/Analyzer'; import Events from 'parser/core/Events'; import STATISTIC_ORDER from 'parser/ui/STATISTIC_ORDER'; import TalentStatisticBox from 'parser/ui/TalentStatisticBox'; import React from 'react'; const DEATHSTRIKE_COST = 40; class Heartbreaker extends Analyzer { rpGains = []; hsCasts = 0; constructor(...args) { super(...args); this.active = this.selectedCombatant.hasTalent(SPELLS.HEARTBREAKER_TALENT.id); this.addEventListener(Events.cast.by(SELECTED_PLAYER).spell(SPELLS.HEART_STRIKE), this.onCast); this.addEventListener(Events.energize.spell(SPELLS.HEARTBREAKER), this.onEnergize); } onCast(event) { this.hsCasts += 1; } onEnergize(event) { if (event.resourceChangeType !== RESOURCE_TYPES.RUNIC_POWER.id) { return; } this.rpGains.push(event.resourceChange); } get totalRPGained() { return this.rpGains.reduce((a, b) => a + b, 0); } get averageHearStrikeHits() { return (this.rpGains.length / this.hsCasts).toFixed(2); } statistic() { return ( <TalentStatisticBox talent={SPELLS.HEARTBREAKER_TALENT.id} position={STATISTIC_ORDER.OPTIONAL(1)} value={this.totalRPGained} label="Runic Power gained" tooltip={ <> Resulting in about {Math.floor(this.totalRPGained / DEATHSTRIKE_COST)} extra Death Strikes. <br /> Your Heart Strike hit on average {this.averageHearStrikeHits} targets. </> } /> ); } } export default Heartbreaker;
var clover = new Object(); // JSON: {classes : [{name, id, sl, el, methods : [{sl, el}, ...]}, ...]} clover.pageData = {"classes":[{"el":46,"id":86762,"methods":[{"el":38,"sc":2,"sl":36}],"name":"AbstractEigenvectorModel","sl":32}]} // JSON: {test_ID : {"methods": [ID1, ID2, ID3...], "name" : "testXXX() void"}, ...}; clover.testTargets = {} // JSON: { lines : [{tests : [testid1, testid2, testid3, ...]}, ...]}; clover.srcFileLines = [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []]
'use strict'; angular.module('impactApp') .controller('PartenairesEditCtrl', function($scope, $state, partenaire) { $scope.partenaire = partenaire; $scope.update = function() { $scope.partenaire.$save(function() { $state.go('^', {}, {reload: true}); }); }; $scope.delete = function() { $scope.partenaire.$delete(function() { $state.go('^', {}, {reload: true}); }); }; });
'use strict'; const _ = require('underscore'); const Handlebars = require('handlebars'); const moment = require('moment'); const VPREmulatorModel = require('./vprEmulatorModel'); const toFMDateTime = require('../vdmUtils').toFMDateTime; class VPRPatientEmulator extends VPREmulatorModel { template() { return [ "<results version='{{vprDataVersion}}' timeZone='-0500' >", "<demographics total='{{total}}' >", '<patient>', "<bid value='{{bid}}' />", "<dob value='{{toDate dateOfBirth}}' />", '{{{getFacilities}}}', "<familyName value='{{toFamilyName name}}' />", "<fullName value='{{name}}' />", "<gender value='{{toGender sex}}' />", "<givenNames value='{{toGivenName name}}' />", "<id value='{{patientId}}' />", "<inpatient value='{{getInpatient}}' />", "<lrdfn value='{{getLrdfn}}' />", "<sc value='{{sc}}' />", "<ssn value='{{socialSecurityNumber}}' />", "<veteran value='{{veteran}}' />", '</patient>', '</demographics>', '</results>', ]; } compileTemplate(mvdmForm) { Handlebars.registerHelper('toDate', date => toFMDateTime(date.value)); Handlebars.registerHelper('toFamilyName', name => name.substring(0, name.indexOf(','))); Handlebars.registerHelper('toGender', (sex) => { const map = { MALE: 'M', FEMALE: 'F', }; return map[sex]; }); Handlebars.registerHelper('toGivenName', name => name.substring(name.indexOf(',') + 1, name.length)); Handlebars.registerHelper('getInpatient', () => { if (mvdmForm.currentAdmission) { return 'true'; } return 'false'; }); Handlebars.registerHelper('getLrdfn', () => { if (_.has(mvdmForm, 'laboratoryReference')) { return mvdmForm.laboratoryReference.id.split('-')[1]; } return 0; }); Handlebars.registerHelper('getFacilities', () => { /* * Facilities visited by the Patient * * In the general case there may be many facilities (MPI can be called). For an * isolate VISTA, there will be at most one, this VISTA. * * TODO: replace with a Javascript Utility or a computed property in Patient */ const dateStr = moment().format('YYYY-MM-DD'); return `${'<facilities>' + "<facility code='050' name='SOFTWARE SERVICE' latestDate='"}${toFMDateTime(dateStr)}' domain='FOIA.DOMAIN.EXT' />` + '</facilities>'; }); mvdmForm.bid = `C${mvdmForm.socialSecurityNumber.substring(5, 9)}`; mvdmForm.patientId = mvdmForm.id.replace('2-', ''); mvdmForm.sc = mvdmForm.isServiceConnected ? 1 : 0; mvdmForm.veteran = mvdmForm.isVeteran ? 1 : 0; const temp = Handlebars.compile(this.template().join('')); const res = temp(mvdmForm); return res; } getOnePatientDetail(res) { if (res === 'error') { return `<results version='${this.vprDataVersion}' timeZone='-0500' ><demographics total='0' ></demographics></results>`; } res.vprDataVersion = this.vprDataVersion; res.total = 1; const result = this.compileTemplate(res); return result.replace(/"/g, '\''); } toReturnValue(invokeResult) { return this.getOnePatientDetail(invokeResult); } transformIEN(ien) { return `2-${ien}`; } } module.exports = VPRPatientEmulator;
/* Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'specialchar', 'de-ch', { options: 'Sonderzeichenoptionen', title: 'Sonderzeichen auswählen', toolbar: 'Sonderzeichen einfügen' } );
/** * This file is part of agora-gui-admin. * Copyright (C) 2015-2016 Agora Voting SL <agora@agoravoting.com> * agora-gui-admin is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License. * agora-gui-admin is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with agora-gui-admin. If not, see <http://www.gnu.org/licenses/>. **/ angular.module('avAdmin') .controller( 'AddCsvModal', function($scope, $modalInstance, election, ConfigService, Plugins) { $scope.election = election; $scope.textarea = ""; $scope.helpurl = ConfigService.helpUrl; $scope.ok = function () { $modalInstance.close($("#csv-textarea").val()); }; // if there's a parent election, add those fields at the end of the example if ($scope.election.children_election_info) { $scope.childrenElections = _.map( $scope.election.children_election_info.natural_order, function (election_id) { return $scope.election.childrenElectionNames[election_id]; } ); } else { $scope.childrenElections = []; } var exhtml = {html: [], scope: {}}; Plugins.hook( 'census-add-csv-modal', { exhtml: exhtml } ); $scope.exhtml = exhtml.html; $scope = _.extend($scope, exhtml.scope); $scope.cancel = function () { $modalInstance.dismiss('cancel'); }; } );
(function() { 'use strict'; angular .module('blocks.logger') .factory('logListeners', logListeners); /** * @ngdoc service * @name spaghetto.logger:logListeners * * @description * Manage different log listeners so that log messages can have various * destinations. * * * The default behaviour is to send log messages to : * * * '$log' : Angular simple logging service, writing into the browser's console * * 'toaster' : Toaster screen notifications * * You can change this behaviour by installing new log listeners and/or removing * the default ones * ## Log listener definition * <pre> * // here instead of an exdample, we should definie the required properties (with ngdoc) of a logListener object * </pre> * */ /* @ngInject */ function logListeners() { var listeners = {}; var service = { addListener: addListener, getListeners: getListeners, removeListener: removeListener }; return service; /////////////// /** * @ngdoc method * @name addListener * @methodOf spaghetto.logger:logListeners * @kind function * * @description * Add log listener * * ## Add a Log listener * <pre> // define my Log Listener var myLogListener = { error : errorLog, info : infoLog, success : successLog, warning : warningLog } function errorLog(msg, data, title) { console.log('Error: ' + title + '\n' + data); } function infoLog(msg, data, title) { console.log('Info: ' + title + '\n' + data); } function successLog(msg, data, title) { console.log('Success: ' + title + '\n' + data); } function warningLog(msg, data, title) { console.log('Warning: ' + title + '\n' + data); } logListeners.addListener('mylog', myLogListener); * </pre> * @param {string} name log listener name * @param {Object} logListener log listener object * @param {Function} logListener.error log an error message * @param {Function} logListener.info log an info message * @param {Function} logListener.success log a success message * @param {Function} logListener.warning log a warning message */ function addListener(name, logListener) { listeners[name] = logListener; } /** * @ngdoc method * @name removeListener * @methodOf spaghetto.logger:logListeners * @kind function * * @description * Remove a log listener * * ## Remove a log listener * <pre> // 'toastr' log listener is installed by default // if you want to remove it, you can do: logListeners.removeListener('toastr'); * </pre> * @param {string} name log listener name */ function removeListener(name) { delete listeners[name]; } /** * @ngdoc method * @name getListeners * @methodOf spaghetto.logger:logListeners * @kind function * * @description * returns all installed log listeners * * @return {Array} keys is the log listener name * and value is the log listener object **/ function getListeners() { return listeners; } } }());
/* @flow */ import oEmbedStorage from './oEmbedStorage'; import getContentType from './getContentType'; import regexes from './regexes'; import providers from './providers'; import type { Embed } from './oEmbedTypes'; function getProperty(prop: string, type: ?string): RegExp { if (typeof type === 'string') { return new RegExp("<meta[^>]*property[ ]*=[ ]*['|\"]og:" + type + ':' + prop + "['|\"][^>]*[>]", 'i'); } return new RegExp("<meta[^>]*property[ ]*=[ ]*['|\"]og:" + prop + "['|\"][^>]*[>]", 'i'); } function getContent(regex) { return regex[0].match(regexes.content)[0].match(/['|"].*/)[0].slice(1); } function decodeText(text) { return text .replace(/&lt;/g, '<') .replace(/&gt;/g, '>') .replace(/&amp;/g, '&') .replace(/&quot;/g, '"') .replace(/&nbsp;/g, ' ') .replace(/&#(x?)(\d+);/g, (m, p1, p2) => String.fromCharCode(((p1 === 'x') ? parseInt(p2, 16) : p2))); } function parseHTML(body): ?Embed { const data: Embed = { type: 'link', }; const props = [ 'title', 'description' ]; for (let i = 0; i < props.length; i++) { const match = body.match(getProperty(props[i])); if (match && match.length) { data[props[i]] = decodeText(getContent(match)); } } const propsWithType = [ 'width', 'height' ]; for (let i = 0; i < propsWithType.length; i++) { const types = [ 'video', 'image' ]; for (let j = 0; j < types.length; j++) { const match = body.match(getProperty(propsWithType[i], types[j])); if (match && match.length) { data['thumbnail_' + propsWithType[i]] = parseInt(getContent(match), 10); } } } const imageUrl = body.match(regexes.image); if (imageUrl) { data.thumbnail_url = getContent(imageUrl); } if (!data.title) { const matches = body.match(regexes.title); if (matches && matches.length) { const title = matches[0].match(/[>][^<]*/); if (title && title.length) { data.title = decodeText(title[0].slice(1)); } } } if (!data.description) { const matches = body.match(regexes.description); if (matches && matches.length) { const description = matches[0].match(regexes.content)[0].match(/['|"][^'|^"]*/); if (description && description.length) { data.description = decodeText(description[0].slice(1)); } } } if (Object.keys(data).length > 1) { return data; } return null; } function extractLink(body) { const res = body.match(regexes.link); if (res && res.length) { return res[0].match(/http[s]?:\/\/[^"']*/i)[0].replace(/&amp;/g, '&'); } return null; } async function fetchData(url: string): Promise<Embed> { const body = await fetch(url).then(res => res.text()).then(text => text.replace(/(\r\n|\n|\r)/g, '')); const dataUrl = extractLink(body); let data; if (dataUrl) { data = await (await fetch(dataUrl)).json(); } else { data = parseHTML(body); } if (data) { oEmbedStorage.set(url, data); return data; } else { throw new Error('Failed to get data from HTML'); } } export default async function(url: string): Promise<Embed> { if (typeof url !== 'string') { throw new TypeError('URL must be a string'); } if (!/^https?:\/\//i.test(url)) { throw new Error("URL must start with 'http://' or 'https://'"); } const json = await oEmbedStorage.get(url); if (json) { return json; } let endpoint; for (let i = 0, l = providers.length; i < l; i++) { const provider = providers[i]; if (provider[0].test(url)) { endpoint = provider[1] + '?format=json&maxheight=240&url=' + encodeURIComponent(url); } } if (endpoint) { const data = await fetch(endpoint).then(res => res.json()); oEmbedStorage.set(url, data); return data; } const contentType = await getContentType(url); if (contentType) { if (contentType.indexOf('image') > -1) { return { type: 'link', thumbnail_url: url, }; } else if (contentType.indexOf('text/html') > -1) { return fetchData(url); } } throw new Error('No oEmbed data found for ' + url); }
(function (factory) { if (typeof define === 'function') { if(define.amd) { define(['common/metastore', 'jslet', 'mock/employee-mock'], factory); } else { define(function(require, exports, module) { module.exports = factory(); }); } } else { factory(); } })(function () { /********************************** 定义数据集 ************************************************/ //datasetMetaStore定义在公共js:common/datasetmetastore.js中 //将数据集定义信息仓库加到datasetFactory中,创建Dataset时会仓库里去定义信息 jslet.data.datasetFactory.addMetaStore(window.datasetMetaStore); //通过工厂方法,可以自动创建主数据集及相关的数据集 jslet.data.datasetFactory.createDataset('employee').done(function() { jslet.ui.install(function() { var dsEmployee = jslet.data.getDataset('employee'); dsEmployee.query(); }); }); //绑定按钮事件 $('#chkShowSeqenceCol').click(function() { var checked = $('#chkShowSeqenceCol')[0].checked; //设置表格是否有序号列 jslet('#tblEmployee').hasSeqCol(checked).renderAll(); }); $('#chkShowSelectCol').click(function() { var checked = $('#chkShowSelectCol')[0].checked; //设置表格是否有选择列 jslet('#tblEmployee').hasSelectCol(checked).renderAll(); }); $('#btnFixedRows').click(function() { var count = parseInt($('#txtFixedRows').val()); //设置表格固定行数 jslet('#tblEmployee').fixedRows(count).renderAll(); }); $('#btnFixedCols').click(function() { var count = parseInt($('#txtFixedCols').val()); //设置表格固定列数 jslet('#tblEmployee').fixedCols(count).renderAll(); }); $('#btnSetRowClick').click(function() { var dsEmployee = jslet.data.getDataset('employee'); //设置表格单击事件 jslet('#tblEmployee').onRowClick(function() { jslet.ui.info('你点击了第:' + (dsEmployee.recno() + 1) + ' 行!', null, null, 1000); }); }); $('#btnClearRowClick').click(function() { //清除表格单击事件 jslet('#tblEmployee').onRowClick(null); }); $('#btnSetRowDblClick').click(function() { var dsEmployee = jslet.data.getDataset('employee'); //设置表格双击事件 jslet('#tblEmployee').onRowClick(null); //先清除单击事件 jslet('#tblEmployee').onRowDblClick(function() { jslet.ui.info('你双击了第:' + (dsEmployee.recno() + 1) + ' 行!', null, null, 1000); }); }); $('#btnClearRowDblClick').click(function() { //清除表格双击事件 jslet('#tblEmployee').onRowDblClick(null); }); $('#btnSetSelect').click(function() { var dsEmployee = jslet.data.getDataset('employee'); //设置表格选择事件, jslet('#tblEmployee').onSelect(function() { jslet.ui.info('你选择了第:' + (dsEmployee.recno() + 1) + ' 行!', null, null, 1000); }); }); $('#btnClearSelect').click(function() { //清除表格选择 jslet('#tblEmployee').onSelect(null); }); $('#btnSelectBy').click(function() { var dsEmployee = jslet.data.getDataset('employee'); var selectBy = $('#txtSelectBy').val(); //设置表格分组选择(相同值一起选择) jslet('#tblEmployee').selectBy(selectBy); }); });
/** * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ CKEDITOR.plugins.setLang( 'a11yhelp', 'gu', { title: 'એક્ક્ષેબિલિટી ની વિગતો', contents: 'હેલ્પ. આ બંધ કરવા ESC દબાવો.', legend: [ { name: 'જનરલ', items: [ { name: 'એડિટર ટૂલબાર', legend: 'Press ${toolbarFocus} to navigate to the toolbar. Move to the next and previous toolbar group with TAB and SHIFT+TAB. Move to the next and previous toolbar button with RIGHT ARROW or LEFT ARROW. Press SPACE or ENTER to activate the toolbar button.' // MISSING }, { name: 'એડિટર ડાયલોગ', legend: 'Inside a dialog, press TAB to navigate to the next dialog element, press SHIFT+TAB to move to the previous dialog element, press ENTER to submit the dialog, press ESC to cancel the dialog. When a dialog has multiple tabs, the tab list can be reached either with ALT+F10 or with TAB as part of the dialog tabbing order. With tab list focused, move to the next and previous tab with RIGHT and LEFT ARROW, respectively.' // MISSING }, { name: 'Editor Context Menu', // MISSING legend: 'Press ${contextMenu} or APPLICATION KEY to open context-menu. Then move to next menu option with TAB or DOWN ARROW. Move to previous option with SHIFT+TAB or UP ARROW. Press SPACE or ENTER to select the menu option. Open sub-menu of current option with SPACE or ENTER or RIGHT ARROW. Go back to parent menu item with ESC or LEFT ARROW. Close context menu with ESC.' // MISSING }, { name: 'Editor List Box', // MISSING legend: 'Inside a list-box, move to next list item with TAB OR DOWN ARROW. Move to previous list item with SHIFT+TAB or UP ARROW. Press SPACE or ENTER to select the list option. Press ESC to close the list-box.' // MISSING }, { name: 'Editor Element Path Bar', // MISSING legend: 'Press ${elementsPathFocus} to navigate to the elements path bar. Move to next element button with TAB or RIGHT ARROW. Move to previous button with SHIFT+TAB or LEFT ARROW. Press SPACE or ENTER to select the element in editor.' // MISSING } ] }, { name: 'કમાંડસ', items: [ { name: 'અન્ડું કમાંડ', legend: '$ દબાવો {undo}' }, { name: 'ફરી કરો કમાંડ', legend: '$ દબાવો {redo}' }, { name: 'બોલ્દનો કમાંડ', legend: '$ દબાવો {bold}' }, { name: ' Italic command', // MISSING legend: 'Press ${italic}' // MISSING }, { name: ' Underline command', // MISSING legend: 'Press ${underline}' // MISSING }, { name: ' Link command', // MISSING legend: 'Press ${link}' // MISSING }, { name: ' Toolbar Collapse command', // MISSING legend: 'Press ${toolbarCollapse}' // MISSING }, { name: ' Access previous focus space command', // MISSING legend: 'Press ${accessPreviousSpace} to access the closest unreachable focus space before the caret, for example: two adjacent HR elements. Repeat the key combination to reach distant focus spaces.' // MISSING }, { name: ' Access next focus space command', // MISSING legend: 'Press ${accessNextSpace} to access the closest unreachable focus space after the caret, for example: two adjacent HR elements. Repeat the key combination to reach distant focus spaces.' // MISSING }, { name: ' Accessibility Help', // MISSING legend: 'Press ${a11yHelp}' // MISSING }, { name: ' Paste as plain text', // MISSING legend: 'Press ${pastetext}', // MISSING legendEdge: 'Press ${pastetext}, followed by ${paste}' // MISSING } ] } ], tab: 'Tab', // MISSING pause: 'Pause', // MISSING capslock: 'Caps Lock', // MISSING escape: 'Escape', // MISSING pageUp: 'Page Up', // MISSING pageDown: 'Page Down', // MISSING leftArrow: 'Left Arrow', // MISSING upArrow: 'Up Arrow', // MISSING rightArrow: 'Right Arrow', // MISSING downArrow: 'Down Arrow', // MISSING insert: 'Insert', // MISSING leftWindowKey: 'Left Windows key', // MISSING rightWindowKey: 'Right Windows key', // MISSING selectKey: 'Select key', // MISSING numpad0: 'Numpad 0', // MISSING numpad1: 'Numpad 1', // MISSING numpad2: 'Numpad 2', // MISSING numpad3: 'Numpad 3', // MISSING numpad4: 'Numpad 4', // MISSING numpad5: 'Numpad 5', // MISSING numpad6: 'Numpad 6', // MISSING numpad7: 'Numpad 7', // MISSING numpad8: 'Numpad 8', // MISSING numpad9: 'Numpad 9', // MISSING multiply: 'Multiply', // MISSING add: 'Add', // MISSING subtract: 'Subtract', // MISSING decimalPoint: 'Decimal Point', // MISSING divide: 'Divide', // MISSING f1: 'F1', // MISSING f2: 'F2', // MISSING f3: 'F3', // MISSING f4: 'F4', // MISSING f5: 'F5', // MISSING f6: 'F6', // MISSING f7: 'F7', // MISSING f8: 'F8', // MISSING f9: 'F9', // MISSING f10: 'F10', // MISSING f11: 'F11', // MISSING f12: 'F12', // MISSING numLock: 'Num Lock', // MISSING scrollLock: 'Scroll Lock', // MISSING semiColon: 'Semicolon', // MISSING equalSign: 'Equal Sign', // MISSING comma: 'Comma', // MISSING dash: 'Dash', // MISSING period: 'Period', // MISSING forwardSlash: 'Forward Slash', // MISSING graveAccent: 'Grave Accent', // MISSING openBracket: 'Open Bracket', // MISSING backSlash: 'Backslash', // MISSING closeBracket: 'Close Bracket', // MISSING singleQuote: 'Single Quote' // MISSING } );