text
stringlengths
2
6.14k
showWord(["n. ","Fo cheve. Madan Benwa mete perik.<br>"])
'use strict'; var express = require('express'); var passport = require('passport'); var config = require('../config/environment'); var User = require('../api/user/user.model'); // Passport Configuration require('./local/passport').setup(User, config); require('./facebook/passport').setup(User, config); require('./twitter/passport').setup(User, config); require('./basic/passport').setup(User, config); var router = express.Router(); router.use('/local', require('./local')); router.use('/facebook', require('./facebook')); router.use('/twitter', require('./twitter')); router.use('/oauth', require('./basic')); module.exports = router;
$(window).scroll(function (e) { var $w = $(window).width(); var $h = $(window).height(); if ($w > 980 && $h > 400) { if ($(this).scrollTop() >= 268) { $("#index_nav.index_nav, #compatible").addClass("index_nav_fixed"); } else { $("#index_nav.index_nav, #compatible").removeClass("index_nav_fixed"); } $("#slides").css("height", 300 - ($(this).scrollTop()) + "px"); $("#slides img").css("opacity", (((250 - ($(this).scrollTop())) * 100) / 250) / 100); $(".si-ctitle-c").css("opacity", (((250 - ($(this).scrollTop())) * 100) / 250) / 100); } });
describe("Portal.filter.combiner.DataDownloadCqlBuilder", function() { var builder; beforeEach(function() { var filters =[ { constructor: Portal.filter.GeometryFilter, // Is Geometry filter isVisualised: returns(true), hasValue: returns(true), getCql: returns('cql1') }, { isVisualised: returns(false), // Not visualised hasValue: returns(true), getCql: returns('cql2') }, { isVisualised: returns(true), hasValue: returns(false), // No value getCql: returns('cql3') }, { isVisualised: returns(true), hasValue: returns(true), getCql: returns('cql4') } ]; builder = new Portal.filter.combiner.DataDownloadCqlBuilder({ filters: filters }); }); describe('buildCql', function() { it('returns correct CQL', function() { expect(builder.buildCql()).toBe('cql1 AND cql2 AND cql4'); }); }); });
/* ======================================================================== * Pure Mask JS: puremask.js v0.1 * http://romulobrasil.com * Copyright (c) 2014 Rômulo Brasil * ======================================================================== */ 'use strict'; var PureMask = function() { return { format : function(element, placeholder) { var el = document.querySelector(element); var maskForm = el.dataset.mask; el.maxLength = maskForm.length; var e = el.value.length; if(placeholder === true) { el.placeholder = maskForm; } el.addEventListener('keydown', function (e){ if (e.keyCode === 8 || e.keyCode === 46) { } else { formato(maskForm); } }); function formato(mask) { var text = ''; var data = el.value; var c, m, i, x; for (i = 0, x = 1; x && i < mask.length; ++i) { c = data.charAt(i); m = mask.charAt(i); switch (mask.charAt(i)) { case '#' : if (/\d/.test(c)) {text += c;} else {x = 0;} break; case 'A' : if (/[a-z]/i.test(c)) {text += c;} else {x = 0;} break; case 'N' : if (/[a-z0-9]/i.test(c)) {text += c;} else {x = 0;} break; case 'X' : text += c; break; default : text += m; break; } } el.value = text; } } }; }();
"use strict"; var SimpleBot = function () { this.name = 'SimpleBot'; }; SimpleBot.prototype.getMove = function (game) { var nMaxConsequentFails = 1000, nMaxCleverTryFails = 900; for (var consequentFails = 0; consequentFails < nMaxConsequentFails; ++consequentFails) { var tryCoord = { x: _.random(game.size - 1), y: _.random(game.size - 1) }; var squareCoord = game.squareCoordByCell(tryCoord); var isStupidMove = !game.getSquare(squareCoord).empty(); if (game.isAllowedMove(tryCoord) && (!isStupidMove || consequentFails > nMaxCleverTryFails)) { return tryCoord; } } throw 'No moves detected'; };
var __v=[ { "Id": 945, "Chapter": 310, "Name": "wxWizard", "Sort": 0 } ]
// Copyright 2015, 2016 Ethcore (UK) Ltd. // This file is part of Parity. // Parity 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. // Parity 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 Parity. If not, see <http://www.gnu.org/licenses/>. import React, { Component, PropTypes } from 'react'; import getMuiTheme from 'material-ui/styles/getMuiTheme'; import Loading from '../Loading'; import Status from '../Status'; import Tokens from '../Tokens'; import Actions from '../Actions'; import styles from './application.css'; const muiTheme = getMuiTheme({ palette: { primary1Color: '#27ae60' } }); export default class Application extends Component { static childContextTypes = { muiTheme: PropTypes.object } static propTypes = { isLoading: PropTypes.bool.isRequired, contract: PropTypes.object }; render () { const { isLoading, contract } = this.props; if (isLoading) { return ( <Loading /> ); } return ( <div className={ styles.application }> <Status address={ contract.address } fee={ contract.fee } /> <Actions /> <Tokens /> </div> ); } getChildContext () { return { muiTheme }; } }
var class_resa___pro_1_1_formularios_1_1_agregar_solicitud = [ [ "AgregarSolicitud", "class_resa___pro_1_1_formularios_1_1_agregar_solicitud.html#a412476c1dcd5f6c8d56fe23a6ffdf7f0", null ], [ "Dispose", "class_resa___pro_1_1_formularios_1_1_agregar_solicitud.html#a0bb7825df5bd3bfaf1ff574ffaf92297", null ], [ "VEmail", "class_resa___pro_1_1_formularios_1_1_agregar_solicitud.html#a82942b118e0a793b872442f768279496", null ], [ "VerificacionFechas", "class_resa___pro_1_1_formularios_1_1_agregar_solicitud.html#a8e655cd96c4fcb124ff84095c56e0e55", null ] ];
/* @flow */ import { Case } from '../Case'; export class PostTitle extends Case { static text = 'Post title'; static parseCriterion(input: *) { return { patt: input }; } static defaultConditions = { patt: '' }; static fields = ['post\'s title contains ', { type: 'text', id: 'patt' }]; static reconcilable = true; static pattern = 'RegEx'; trueText = `title contains ${this.conditions.patt}`; value = Case.buildRegex(this.conditions.patt, { fullMatch: false }); evaluate(thing: *, values: * = [this.value]) { const title = thing.getTitle(); return values.some(v => v.test(title)); } }
/** * @module main application controller * @description Runs socket.io and static http server, listens for client connections and directs user/room instances. * * @author cemckinley <cemckinley@gmail.com> * @copyright Copyright (c) 2013 Author, contributors * @license GPL v3 */ var fs = require('fs'), https = require('https'), socketio = require('socket.io'), config = require('./config/env'), db = require('./controllers/db'), SessionHandler = require('./controllers/session-handler'), globalEvents = require('./controllers/global-events'), User = require('./controllers/user'); var nodeMud = (function(){ /** properties **/ var httpsOptions = { key: fs.readFileSync(config.ssl.keyPath), cert: fs.readFileSync(config.ssl.certPath), passphrase: config.ssl.passphrase }, httpsServer = https.createServer(httpsOptions, _httpsHandler).listen(config.socket.port), // server for socket.io socket io = socketio.listen(httpsServer); // websocket /** functions **/ function init(){ db.connect(); // event listeners io.sockets.on('connection', _onClientConnect); globalEvents.on('userAuth', _onClientAuth); } function _httpsHandler(req, res){ res.writeHead(200); res.end(); } function _onClientConnect(socket){ var client = new SessionHandler(socket); } function _onClientAuth(userData, clientSocket){ var user = new User(clientSocket, userData); clientSocket.emit('message', userData.name + 'successful user auth'); } /** PUBLIC API **/ return { init: init }; }()); nodeMud.init();
/** * Piwik - free/libre analytics platform * * Series Picker control addition for DataTable visualizations. * * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ (function ($, require) { /** * This class creates and manages the Series Picker for certain DataTable visualizations. * * To add the series picker to your DataTable visualization, create a SeriesPicker instance * and after your visualization has been rendered, call the 'init' method. * * To customize SeriesPicker placement and behavior, you can bind callbacks to the following * events before calling 'init': * * 'placeSeriesPicker': Triggered after the DOM element for the series picker link is created. * You must use this event to add the link to the dataTable. YOu can also * use this event to position the link however you want. * * Callback Signature: function () {} * * 'seriesPicked': Triggered when the user selects one or more columns/rows. * * Callback Signature: function (eventInfo, columns, rows) {} * * Events are triggered via jQuery, so you bind callbacks to them like this: * * var picker = new SeriesPicker(dataTable); * $(picker).bind('placeSeriesPicker', function () { * $(this.domElem).doSomething(...); * }); * * @param {dataTable} dataTable The dataTable instance to add a series picker to. * @constructor * @deprecated use the piwik-series-picker directive instead */ var SeriesPicker = function (dataTable) { this.domElem = null; this.dataTableId = dataTable.workingDivId; // the columns that can be selected this.selectableColumns = dataTable.props.selectable_columns; // the rows that can be selected this.selectableRows = dataTable.props.selectable_rows; // render the picker? this.show = !! dataTable.props.show_series_picker && (this.selectableColumns || this.selectableRows); // can multiple rows we selected? this.multiSelect = !! dataTable.props.allow_multi_select_series_picker; }; SeriesPicker.prototype = { /** * Initializes the series picker by creating the element. Must be called when * the datatable the picker is being attached to is ready for it to be drawn. */ init: function () { if (!this.show) { return; } var self = this; var selectedColumns = this.selectableColumns .filter(isItemDisplayed) .map(function (columnConfig) { return columnConfig.column; }); var selectedRows = this.selectableRows .filter(isItemDisplayed) .map(function (rowConfig) { return rowConfig.matcher; }); // initialize dom element var seriesPicker = '<piwik-series-picker' + ' multiselect="' + (this.multiSelect ? 'true' : 'false') + '"' + ' selectable-columns="selectableColumns"' + ' selectable-rows="selectableRows"' + ' selected-columns="selectedColumns"' + ' selected-rows="selectedRows"' + ' on-select="selectionChanged(columns, rows)"/>'; this.domElem = $(seriesPicker); // TODO: don't know if this will work without a root scope $(this).trigger('placeSeriesPicker'); piwikHelper.compileAngularComponents(this.domElem, { scope: { selectableColumns: this.selectableColumns, selectableRows: this.selectableRows, selectedColumns: selectedColumns, selectedRows: selectedRows, selectionChanged: function selectionChanged(columns, rows) { if (columns.length === 0 && rows.length === 0) { return; } $(self).trigger('seriesPicked', [columns, rows]); // inform dashboard widget about changed parameters (to be restored on reload) var UI = require('piwik/UI'); var params = { columns: columns, columns_to_display: columns, rows: rows, rows_to_display: rows }; var tableNode = $('#' + this.dataTableId); UI.DataTable.prototype.notifyWidgetParametersChange(tableNode, params); } } }); function isItemDisplayed(columnOrRowConfig) { return columnOrRowConfig.displayed; } }, /** * Returns the translation of a metric that can be selected. * * @param {String} metric The name of the metric, ie, 'nb_visits' or 'nb_actions'. * @return {String} The metric translation. If one cannot be found, the metric itself * is returned. */ getMetricTranslation: function (metric) { for (var i = 0; i !== this.selectableColumns.length; ++i) { if (this.selectableColumns[i].column === metric) { return this.selectableColumns[i].translation; } } return metric; } }; var exports = require('piwik/DataTableVisualizations/Widgets'); exports.SeriesPicker = SeriesPicker; })(jQuery, require);
//Scroll View function scrollHandler(view, hscrollbar, vscrollbar){ this.view= view; this.view.addEventListener('DOMMouseScroll', this, false); this.view.addEventListener('mousewheel', this, false); this.hListeners= []; this.vListeners= []; if (hscrollbar != undefined){ this.hscrollbar= hscrollbar; this.hscrollbar.addEventListener('scroll', this, false); } if (vscrollbar != undefined){ this.vscrollbar= vscrollbar; this.vscrollbar.addEventListener('scroll', this, false); } }; scrollHandler.prototype.addListener= function(axis, listener){ if (axis == 1 || axis == 'x' || axis == 'h') this.hListeners.push(listener); if (axis == 2 || axis == 'y' || axis == 'v') this.vListeners.push(listener); }; scrollHandler.prototype.handleEvent= function(event){ switch(event.type) { case 'scroll': if (this.hscrollbar != undefined) { view.style.left= -this.hscrollbar.scrollLeft + "px"; for(var listener=0; listener < this.hListeners.length; listener++){ this.hListeners[listener].OnHScroll(event.target.id); } } if (this.vscrollbar != undefined) { view.style.top= -this.vscrollbar.scrollTop + "px"; for(var listener=0; listener < this.vListeners.length; listener++){ this.vListeners[listener].OnVScroll(event.target.id); } } break; case 'DOMMouseScroll': // Firefox: event.axis= 1-x,2-y; event.detail= ticks. this.scrollWheel(event.axis, event.detail*4); event.preventDefault(); break; case 'mousewheel': // event.wheelDelta= ticks*(-120); event.wheelDeltaX= ticksX*(-120); event.wheelDeltaY= ticksY*(-120); this.scrollWheel(event.wheelDeltaX != 0? 1 : 2, -event.wheelDelta/15); event.preventDefault(); break; } }; scrollHandler.prototype.scrollWheel= function(axis, delta){ switch (axis){ case 1: // X axis if (this.hscrollbar != undefined) { this.hscrollbar.scrollLeft= this.hscrollbar.scrollLeft + delta; //TODO: Test for limits. 0 < scrollLeft < scrollsizewidth } break; case 2: // Y axis if (this.vscrollbar != undefined) { this.vscrollbar.scrollTop= this.vscrollbar.scrollTop + delta; //TODO: Test for limits. 0 < scrollTop < scrollsizeheight } break; } }; // Resize function resizeHandler(handgrip, listener){ this.dragging= false; this.dragginId= ''; this.listener= listener; this.initialPoint= {x:0, y:0}; handgrip.addEventListener('mousedown', this, false); handgrip.addEventListener('dragstart', this, false); handgrip.addEventListener('selectstart', this, false); window.addEventListener('mouseup', this, false); }; resizeHandler.prototype.handleEvent= function(event){ switch(event.type) { case 'dragstart': case 'selectstart': event.preventDefault(); break; case 'mousedown': this.dragging= true; this.initialPoint.x= event.clientX; this.initialPoint.y= event.clientY; this.draggingId= event.target.id; document.getElementsByTagName('body')[0].style.cursor= 'ew-resize'; //document.childNodes[0].style.cursor= 'ew-resize'; //'se-resize'; event.preventDefault(); break; case 'mouseup': if (this.dragging) { document.getElementsByTagName('body')[0].style.cursor= 'auto'; //document.childNodes[0].style.cursor= 'auto'; this.dragging= false; //TODO: En lugar de lanzar un evento, puede redimensionar la división padre. this.listener.OnResize(this.draggingId , event.clientX - this.initialPoint.x , event.clientY - this.initialPoint.y); event.preventDefault(); } break; } }; function bas_copyAttributes(src, dst){ for (var attr in src) dst[attr]= src[attr]; };
import { createGlobalStyle } from 'styled-components'; const GlobalStyle = createGlobalStyle` .ant-breadcrumb { display: flex; align-items: center; font-size: 10px; color: #818181; border-bottom: 1px solid #ccc; } `; export default GlobalStyle;
import React from 'react'; const Contact = () => ({ contactNext(){ var data = $("#questionInput").val(); if(data){ Session.set('contact', data); FlowRouter.go("/register/6"); }else{ alert("Please enter your email."); } }, contactEnter(event){ if(event.key == 'Enter') { var data = $("#questionInput").val(); if(data){ Session.set('contact', data); FlowRouter.go("/register/6"); }else{ alert("Please enter your email."); } } }, render() { return ( <div id="jiyuu"> <h2 className="question">What's your email?</h2> <div id="question-card" className="form-group"> <div id="questionInputContain"> <input id="questionInput" type="text" onKeyPress={this.contactEnter.bind(this)} className="form-control"/> </div> <div className="qnext" onClick={this.contactNext.bind(this)}> <i className="fa fa-caret-right" aria-hidden="true"/> </div> </div> </div> ); } }); export default Contact;
/** * Swift-Cardinal Object Notation * https://github.com/norstone-tech/scon * * Copyright (c) BlueStone Technological Enterprises Inc., 2016-2019 * Copyright (c) Norstone Technologies 2021 * Licensed under the GNU GPLv3 license. */ /* eslint-disable no-magic-numbers, no-mixed-operators, sort-keys */ "use strict"; const MAGIC_NUMBER = Buffer.from([7, 83, 67, 51]); const BASE_TYPES = { EOF: 0, NULL: 1 << 5, BOOLEAN: 2 << 5, FLOAT_FIXED: 3 << 5, INT_VAR: 4 << 5, STRING_ZERO_TERM: 5 << 5, STRING_LENGTH_PREFIXED: 6 << 5, OBJECT: 7 << 5 }; const HEADER_BYTE = { BASE_TYPES: 0b11100000, BASE_TYPE_VARIANT: 0b00010000, HAS_EXTENDED_TYPE: 0b00001000, IS_REFERENCE_DEFINITION: 0b00000100, KEY_IS_REFERENCE: 0b00000010, KEY_IS_REFERENCE_SLOT: 0b00000010, // only relevent when IS_REFERENCE_DEFINITION // Both of the above means parse the key as a varint instead of a null-terminated string VALUE_IS_REFERENCE: 0b00000001 }; const EXTENDED_TYPES = { INT_VAR: { FLOAT_64_SAFE_INT: 0, UINT8: 2, SINT8: 3, UINT16: 4, SINT16: 5, UINT32: 6, SINT32: 7, UINT64: 8, SINT64: 9, UINT128: 10, SINT128: 11, UINT256: 12, SINT256: 13, INF_INT: 16, // Default DATE_S: 32, DATE_MS: 33 }, OBJECT: { // Parsing variant 0 OBJECT: 0, STRING_KEY_MAP_ALT: 1, STRING_KEY_MAP: 2, // Parsing variant 1 ARRAY: 0, SET: 1, ANY_KEY_MAP: 2 } }; const VARINT_RAGES = { FLOAT_64_SAFE_INT: { MIN_VALUE: BigInt(Number.MIN_SAFE_INTEGER), MAX_VALUE: BigInt(Number.MAX_SAFE_INTEGER) }, UINT8: { MIN_VALUE: 0n, MAX_VALUE: 2n ** 8n - 1n }, SINT8: { MIN_VALUE: (-2n) ** 7n, MAX_VALUE: 2n ** 7n - 1n }, UINT16: { MIN_VALUE: 0n, MAX_VALUE: 2n ** 16n - 1n }, SINT16: { MIN_VALUE: (-2n) ** 15n, MAX_VALUE: 2n ** 15n - 1n }, UINT32: { MIN_VALUE: 0n, MAX_VALUE: 2n ** 32n - 1n }, SINT32: { MIN_VALUE: (-2n) ** 31n, MAX_VALUE: 2n ** 31n - 1n }, UINT64: { MIN_VALUE: 0n, MAX_VALUE: 2n ** 64n - 1n }, SINT64: { MIN_VALUE: (-2n) ** 63n, MAX_VALUE: 2n ** 63n - 1n }, UINT128: { MIN_VALUE: 0n, MAX_VALUE: 2n ** 128n - 1n }, SINT128: { MIN_VALUE: (-2n) ** 127n, MAX_VALUE: 2n ** 127n - 1n }, UINT256: { MIN_VALUE: 0n, MAX_VALUE: 2n ** 256n - 1n }, SINT256: { MIN_VALUE: (-2n) ** 255n, MAX_VALUE: 2n ** 255n - 1n } }; module.exports = { MAGIC_NUMBER, BASE_TYPES, HEADER_BYTE, EXTENDED_TYPES, EXTENDED_TYPE_USER: 0b10000000, VARINT_EXTEND: 0b10000000, VARINT_VALUE: 0b01111111, VARINT_RAGES };
import store from "@/store"; import { modV } from "@/modv"; import Vue from "vue"; const state = { width: 200, height: 200, previewX: 0, previewY: 0, previewWidth: 0, previewHeight: 0 }; // getters const getters = { width: state => state.width, height: state => state.height, area: state => state.width * state.height, dimensions: state => ({ width: state.width, height: state.height }), previewValues: state => ({ width: state.previewWidth, height: state.previewHeight, x: state.previewX, y: state.previewY }) }; // actions const actions = { updateSize({ state }) { store.dispatch("size/setDimensions", { width: state.width, height: state.height }); }, setDimensions({ commit, state }, { width, height }) { let widthShadow = width; let heightShadow = height; const largestWindowReference = store.getters[ "windows/largestWindowReference" ](); if ( widthShadow >= largestWindowReference.innerWidth && heightShadow >= largestWindowReference.innerHeight ) { if (store.getters["user/constrainToOneOne"]) { if (widthShadow > heightShadow) { widthShadow = heightShadow; } else { heightShadow = widthShadow; } } commit("setDimensions", { width: widthShadow, height: heightShadow }); let dpr = window.devicePixelRatio || 1; if (!store.getters["user/useRetina"]) dpr = 1; modV.resize(state.width, state.height, dpr); store.dispatch("modVModules/resizeActive"); store.dispatch("layers/resize", { width: state.width, height: state.height, dpr }); store.dispatch("windows/resize", { width: state.width, height: state.height, dpr }); store.dispatch("size/calculatePreviewCanvasValues"); } }, resizePreviewCanvas() { modV.previewCanvas.width = modV.previewCanvas.clientWidth; modV.previewCanvas.height = modV.previewCanvas.clientHeight; store.dispatch("size/calculatePreviewCanvasValues"); }, calculatePreviewCanvasValues({ commit, state }) { // thanks to http://ninolopezweb.com/2016/05/18/how-to-preserve-html5-canvas-aspect-ratio/ // for great aspect ratio advice! const widthToHeight = state.width / state.height; let newWidth = modV.previewCanvas.width; let newHeight = modV.previewCanvas.height; const newWidthToHeight = newWidth / newHeight; if (newWidthToHeight > widthToHeight) { newWidth = Math.round(newHeight * widthToHeight); } else { newHeight = Math.round(newWidth / widthToHeight); } commit("setPreviewValues", { x: Math.round(modV.previewCanvas.width / 2 - newWidth / 2), y: Math.round(modV.previewCanvas.height / 2 - newHeight / 2), width: newWidth, height: newHeight }); } }; // mutations const mutations = { setWidth(state, { width }) { Vue.set(state, "width", width); }, setHeight(state, { height }) { Vue.set(state, "height", height); }, setDimensions(state, { width, height }) { Vue.set(state, "width", width); Vue.set(state, "height", height); }, setPreviewValues(state, { width, height, x, y }) { Vue.set(state, "previewWidth", width); Vue.set(state, "previewHeight", height); Vue.set(state, "previewX", x); Vue.set(state, "previewY", y); } }; export default { namespaced: true, state, getters, actions, mutations };
(function($, _){ /** * @summary A reference to the jQuery object the plugin is registered with. * @memberof FooGallery * @function $ * @type {jQuery} * @description This is used internally for all jQuery operations to help work around issues where multiple jQuery libraries have been included in a single page. * @example {@caption The following shows the issue when multiple jQuery's are included in a single page.}{@lang xml} * <script src="jquery-1.12.4.js"></script> * <script src="foogallery.js"></script> * <script src="jquery-2.2.4.js"></script> * <script> * jQuery(function($){ * $(".selector").foogallery(); // => This would throw a TypeError: $(...).foogallery is not a function * }); * </script> * @example {@caption The reason the above throws an error is that the `$.fn.foogallery` function is registered to the first instance of jQuery in the page however the instance used to create the ready callback and actually try to execute `$(...).foogallery()` is the second. To resolve this issue ideally you would remove the second instance of jQuery however you can use the `FooGallery.$` member to ensure you are always working with the instance of jQuery the plugin was registered with.}{@lang xml} * <script src="jquery-1.12.4.js"></script> * <script src="foogallery.js"></script> * <script src="jquery-2.2.4.js"></script> * <script> * FooGallery.$(function($){ * $(".selector").foogallery(); // => It works! * }); * </script> */ _.$ = $; /** * @summary The jQuery plugin namespace. * @external "jQuery.fn" * @see {@link http://learn.jquery.com/plugins/basic-plugin-creation/|How to Create a Basic Plugin | jQuery Learning Center} */ })( // dependencies jQuery, /** * @summary The core namespace for the plugin containing all its code. * @namespace FooGallery * @description This plugin houses all it's code within a single `FooGallery` global variable to prevent polluting the global namespace and to make accessing its various members simpler. * @example {@caption As this namespace is registered as a global on the `window` object, it can be accessed using the `window.` prefix.} * var fg = window.FooGallery; * @example {@caption Or without it.} * var fg = FooGallery; * @example {@caption When using this namespace I would recommend aliasing it to a short variable name such as `fg` or as used internally `_`.} * // alias the FooGallery namespace * var _ = FooGallery; * @example {@caption This is not required but lets us write less code and allows the alias to be minified by compressors like UglifyJS. How you choose to alias the namespace is up to you. You can use the simple `var` method as seen above or supply the namespace as a parameter when creating a new scope as seen below.} * // create a new scope to work in passing the namespace as a parameter * (function(_){ * * // use `_.` to access members and methods * * })(FooGallery); */ window.FooGallery = window.FooGallery || {} );
/* * Geoide Composer, configuration tool for Geoide Viewer * Copyright (C) 2016 IDgis * See license: * https://github.com/IDgis/geoide-admin/blob/master/LICENSE */ import './startup.js'; import './jsonapi.js'; import './json_gv_api.js'; import './json_map_api.js'; import './parse_capabilities.js';
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt frappe.query_reports["GSTR-1"] = { "filters": [ { "fieldname":"company", "label": __("Company"), "fieldtype": "Link", "options": "Company", "reqd": 1, "default": frappe.defaults.get_user_default("Company") }, { "fieldname":"from_date", "label": __("From Date"), "fieldtype": "Date", "reqd": 1, "default": frappe.datetime.add_months(frappe.datetime.get_today(), -3), "width": "80" }, { "fieldname":"to_date", "label": __("To Date"), "fieldtype": "Date", "reqd": 1, "default": frappe.datetime.get_today() }, { "fieldname":"type_of_business", "label": __("Type of Business"), "fieldtype": "Select", "reqd": 1, "options": ["B2B", "B2C Large", "B2C Small"], "default": "B2B" } ] }
module.exports = { root: true, env: { node: true, }, extends: ['plugin:vue/essential', '@vue/prettier', '@vue/typescript'], rules: { 'vue/max-attributes-per-line': 'off', 'vue/html-self-closing': 'off', }, parserOptions: { parser: '@typescript-eslint/parser', }, }
/* * File: app/view/createBucketWindow.js * * This file was generated by Sencha Architect version 3.0.4. * http://www.sencha.com/products/architect/ * * This file requires use of the Ext JS 4.2.x library, under independent license. * License of Sencha Architect does not include license for Ext JS 4.2.x. For more * details see http://www.sencha.com/license or contact license@sencha.com. * * This file will be auto-generated each and everytime you save your project. * * Do NOT hand edit this file. */ Ext.define('MyApp.view.createBucketWindow', { extend: 'Ext.window.Window', alias: 'widget.createBucketWindow', requires: [ 'Ext.form.Panel', 'Ext.form.FieldSet', 'Ext.form.field.Text', 'Ext.toolbar.Toolbar', 'Ext.button.Button' ], height: 172, width: 400, resizable: false, layout: 'border', title: 'Create Bucket', modal: true, initComponent: function() { var me = this; Ext.applyIf(me, { items: [ { xtype: 'panel', region: 'center', id: 'createBucketTopPanel', itemId: 'createBucketTopPanel', items: [ { xtype: 'form', height: 156, id: 'createBucketFormPanel', itemId: 'createBucketFormPanel', bodyPadding: 10, items: [ { xtype: 'fieldset', padding: 10, title: 'Bucket Data ', items: [ { xtype: 'textfield', anchor: '100%', id: 'createBucketName', itemId: 'createBucketName', fieldLabel: 'Name', labelAlign: 'right', labelWidth: 54, name: 'bucketName', allowBlank: false, allowOnlyWhitespace: false, enforceMaxLength: true, maskRe: /[a-z0-9\-]/, maxLength: 32, regex: /[a-z0-9\-]/ } ] } ] } ], dockedItems: [ { xtype: 'toolbar', dock: 'bottom', id: 'createBucketToolbar', itemId: 'createBucketToolbar', layout: { type: 'hbox', pack: 'center' }, items: [ { xtype: 'button', handler: function(button, e) { objectConstants.me.createObjectBucket(); }, padding: '2 20 2 20', text: 'Ok' }, { xtype: 'button', handler: function(button, e) { var myForm = Ext.getCmp("createBucketFormPanel"); myForm.getForm().findField("createBucketName").setValue(''); }, padding: '2 12 2 12', text: 'Clear' } ] } ] } ] }); me.callParent(arguments); } });
var subdomain = require('express-subdomain'); var express = require('express'); var app = express(); var router = express.Router(); var moment = require('moment'); var time = moment(); var timeFormat = time.format('HH:mm:ss'); app.get('/', function(req, res) { res.sendFile(__dirname + '/index.html'); }); app.listen(3000); console.log(`SMWeb up at ${timeFormat}`);
'use strict'; module.exports = function() { // Occupy the global variable of Chart, and create a simple base class var Chart = function(item, config) { this.construct(item, config); return this; }; // Globally expose the defaults to allow for user updating/changing Chart.defaults = { global: { responsive: true, responsiveAnimationDuration: 0, maintainAspectRatio: true, events: ['mousemove', 'mouseout', 'click', 'touchstart', 'touchmove'], hover: { onHover: null, mode: 'nearest', intersect: true, animationDuration: 400 }, onClick: null, defaultColor: 'rgba(0,0,0,0.1)', defaultFontColor: '#666', defaultFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", defaultFontSize: 12, defaultFontStyle: 'normal', showLines: true, // Element defaults defined in element extensions elements: {}, // Layout options such as padding layout: { padding: { top: 0, right: 0, bottom: 0, left: 0 } }, // Legend callback string legendCallback: function(chart) { var text = []; text.push('<ul class="' + chart.id + '-legend">'); for (var i = 0; i < chart.data.datasets.length; i++) { text.push('<li><span style="background-color:' + chart.data.datasets[i].backgroundColor + '"></span>'); if (chart.data.datasets[i].label) { text.push(chart.data.datasets[i].label); } text.push('</li>'); } text.push('</ul>'); return text.join(''); } } }; Chart.Chart = Chart; return Chart; };
(function(){ var getDataBtn = document.getElementById('btn-getdata'); var content = document.getElementById('content'); getDataBtn.addEventListener('click',getCourseData); function getCourseData(){ datacontext().getCourseSessions(function(courseSessions){ renderView(courseSessions); }); } function renderView(sessions){ content.innerHTML = JSON.stringify(sessions); } })();
$(function () { var setupNavbar = function () { $('a').each(function(){ if ($(this).prop('href') == window.location.href) { $(this).parents('li').addClass('active'); } }); var login = $('ul.nav a[href="login"]').parent(); var alert = $('#alerts'); var alertList = alert.children('div.dropdown-menu'); var profile = $('#profile'); if (typeof(Storage) !== "undefined" && localStorage.getItem("authorization")) { console.log("We have authorization"); $('#bubbles').show(); $('#register-panel').hide(); $('.nav-link').show(); login.hide(); alert.show(); alertList.empty(); profile.show(); } else { console.log("We do not have authorization"); $('#bubbles').hide(); $('#register-panel').show(); $('.nav-link').hide(); login.show(); alert.hide(); alertList.empty(); profile.hide(); } $('#logout').click(function () { localStorage.clear(); var rawWords = window.location.href.split("/"); window.location = rawWords[0] + "//" + rawWords[2] + "/"; }); }; setupNavbar(); });
/** * Plugin: "disable_options" (selectize.js) * Copyright (c) 2013 Mondo Robot & contributors * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at: * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF * ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. * * @authors Jake Myers <jmyers0022@gmail.com>, Vaughn Draughon <vaughn@rocksolidwebdesign.com> */ Selectize.define('disable_options', function(options) { var self = this; options = $.extend({ 'disableField': '', 'disableOptions': [] }, options); self.refreshOptions = (function() { var original = self.refreshOptions; return function() { original.apply(this, arguments); $.each(options.disableOptions, function(index, option) { self.$dropdown_content.find('[data-' + options.disableField + '="' + String(option) + '"]').addClass('option-disabled'); }); }; })(); self.onOptionSelect = (function() { var original = self.onOptionSelect; return function(e) { var value, $target, $option; if (e.preventDefault) { e.preventDefault(); e.stopPropagation(); } $target = $(e.currentTarget); if ($target.hasClass('option-disabled')) { return; } return original.apply(this, arguments); }; })(); self.disabledOptions = function() { return options.disableOptions; } self.setDisabledOptions = function( values ) { options.disableOptions = values } self.disableOptions = function( values ) { if ( ! ( values instanceof Array ) ) { values = [ values ] } values.forEach( function( val ) { if ( options.disableOptions.indexOf( val ) == -1 ) { options.disableOptions.push( val ) } } ); } self.enableOptions = function( values ) { if ( ! ( values instanceof Array ) ) { values = [ values ] } values.forEach( function( val ) { var remove = options.disableOptions.indexOf( val ); if ( remove + 1 ) { options.disableOptions.splice( remove, 1 ); } } ); } });
var gulp = require('gulp'); var sass = require('gulp-sass'); var auto = require('gulp-autoprefixer'); var sourcemaps = require('gulp-sourcemaps'); var browserSync = require('browser-sync').create(); var plumber = require('gulp-plumber'); gulp.task('scss', function() { return gulp.src('src/scss/*.scss') .pipe(plumber()) .pipe(sass()) .pipe(sourcemaps.init()) .pipe(auto()) .pipe(sourcemaps.write('.')) .pipe(gulp.dest('pub/css')) .pipe(browserSync.reload({ stream: true })) });
'use strict' const Q = require(`q`) const readFile = Q.denodeify(require(`fs`).readFile) const resolve = require(`path`).resolve module.exports = Q.all([ readFile(resolve(__dirname, './templates/template.hbs'), 'utf-8'), readFile(resolve(__dirname, './templates/header.hbs'), 'utf-8'), readFile(resolve(__dirname, './templates/commit.hbs'), 'utf-8') ]) .spread((template, header, commit) => { const writerOpts = getWriterOpts() writerOpts.mainTemplate = template writerOpts.headerPartial = header writerOpts.commitPartial = commit return writerOpts }) function getWriterOpts () { return { transform: (commit) => { if (!commit.language) { return } if (typeof commit.hash === `string`) { commit.hash = commit.hash.substring(0, 7) } return commit }, groupBy: `language`, commitGroupsSort: `title`, commitsSort: [`language`, `type`, `message`] } }
/* global Converter, probandDatav2 */ describe('Converter', function() { describe('load', function() { it('should load proband data', function() { var converter = new Converter(); converter.load(probandDatav2); expect(converter.data).to.deep.equal(probandDatav2); }); it('sould create empty comments object', function() { var converter = new Converter(); converter.load(probandDatav2); expect(converter.comments).to.deep.equal({}); }); it('sould create empty diary array', function() { var converter = new Converter(); converter.load(probandDatav2); expect(converter.diary).to.deep.equal([]); }); it('sould create empty interactions array', function() { var converter = new Converter(); converter.load(probandDatav2); expect(converter.interactions).to.deep.equal([]); }); }); describe('convertComments', function() { it('sould convert v2 diary format to v1 diary format', function() { var commentsDatav1 = { "3c92a4df": "1389823488 ~ ein Freund von mir hat ein Scherz über Bundeswehr gepostet, ich fand es sehr witzig ", "0a81f271": "1389823819 ~ ich habe ein Link von einer Kommilitonin kommentiert, es ging um \"52 Places to go in 2014\" von NY-Times, obwohl München und Berlin nicht dabei sind, ist Frankfurt dabei, naja ich persönlich finde es gibt schönere Plätze in Deutschland ", "7bcddf87": "1389911628 ~ es geht um eine online Umfrage bezüglich unserer Kantine im Niederrad, gepostet hat ein Mitlied des Studentenrates", "13901343": "1390134335 ~ Ich kommentiere einen Zeitungsartikel, den ich selbst geteilt habe. Es wurde in der Rhein-Neckar-Zeitung veröffentlicht und geht darum, dass das Kino in der Altstadt schleißt. Ich finde es sehr traurig, viele Erinnerungen hängen daran, deswegen habe ich mich entschieden es mit meinen Freunden zu teilen. ", "75019456": "1390134527 ~ Es handelt sich dabei um eine bezahlte Werbung von Watchever, einen \"online video stream\" Anbieter. Es geht um ein Gewinnspiel. Mich nerven diese Werbeanzeigen...", "70e816cf": "1390328184 ~ ", "ba5dfbdb": "1390341915 ~ Ich kommentiere einen Videoclip, welches von einer Gruppe gepostet wurde. Es handelt sich dabei um ein Musikvideo von David Guetta, sehr cool, gefällt mir." }; var converter = new Converter(); converter.load(probandDatav2); converter.convertComments(); expect(converter.comments).to.deep.equal(commentsDatav1); }); }); describe('convertInteractions', function() { it('should convert v2 interactions format to v1 interactions format', function() { var interactionsDatav1 = [{ "nr": 0, "interaction_type": "openFacebook", "time": "2014-01-15T19:45:49.374Z", "network": "Facebook" }, { "nr": 1, "interaction_type": "closeFacebook", "time": "2014-01-15T21:24:14.670Z", "network": "Facebook" }, { "nr": 2, "interaction_type": "openFacebook", "time": "2014-01-15T21:24:14.761Z", "network": "Facebook" }, { "nr": 3, "interaction_type": "like", "time": "2014-01-15T21:45:57.751Z", "network": "Facebook", "object_id": "3e799b96", "object_owner": "9cb2fda2", "object_type": "status" }, { "nr": 4, "interaction_type": "like", "time": "2014-01-15T21:58:48.983Z", "network": "Facebook", "object_id": "3c92a4df", "object_owner": "1abcc45b", "object_type": "status" }]; var converter = new Converter(); converter.load(probandDatav2); converter.convertInteractions(); var convertedInteractions = converter.interactions.splice(0, 5); expect(convertedInteractions).to.deep.equal(interactionsDatav1); }); }); describe('convertDiary', function() { it('sould convert v2 diary format to v1 diary format', function() { var diaryDatav1 = [ ["2014-01-15T22:02:33.565Z", "habe eine Freundschaftsanfrage geschickt"], ["2014-01-16T22:13:34.870Z", "Ein guter Freund von mir ist wieder bei Facebook. Anfang September hat er sein Facebook-Account deaktiviert wegen Staatsexamen, jetzt ist er wieder da. "], ["2014-01-19T12:33:18.834Z", "gestern wurde ich wieder in eine Gruppe der \"Studenten Karlsruhe\" eingeladen, obwohl ich schon mal eingeladen wurde und ich ausgetreten bin...\nwas ich nicht verstehe, dass obwohl ich nirgendswo zugestimmt habe, war ich automatisch ein Mitglied der Gruppe und konnte alles sehen...\njetzt bin ich wieder ausgetreten, und so eingestellt, dass mich Leute nicht wieder einladen können!"], ["2014-01-21T22:37:24.245Z", "was mich zur Zeit nervt, ist das Häkchen bei einer gelesener Nachricht, leider klicke ich manchmal auf eine neue Nachricht und der Absender weißt sofort, dass ich es gesehen habe...\ngenau das wollte ich heute in den Einstellungen ändern, leider fand ich nichts... "], ["2014-01-22T22:35:26.653Z", "Eine Freundin wollte heute in Facebook wissen, wie man es so einstellen kann, dass z. B. Google deine Facebook-Seite nicht als Ergebnis anzeigt, wenn man den Namen eingetippt..."] ]; var converter = new Converter(); converter.load(probandDatav2); converter.convertDiary(); expect(converter.diary).to.deep.equal(diaryDatav1); }); }); });
import React from 'react'; import ReactDOMServer from 'react-dom/server'; import Menu from '../Menu'; describe('Pure', () => { describe('Menu.ItemLabel', () => { it('should be: <span>OK</span>', () => { const h = ReactDOMServer.renderToStaticMarkup(<Menu.ItemLabel label='OK' />); h.should.be.equal('<span>OK</span>'); }); it('should be: <span>OK</span>', () => { const h = ReactDOMServer.renderToStaticMarkup(<Menu.ItemLabel label={{text: 'OK'}} />); h.should.be.equal('<span>OK</span>'); }); it('should be: <a href="#" class="pure-menu-link">OK</a>', () => { const h = ReactDOMServer.renderToStaticMarkup(<Menu.ItemLabel label={{text: 'OK', url: '#'}} />); h.should.be.equal('<a href="#" class="pure-menu-link">OK</a>'); }); it('should be: <span class="pure-menu-heading">OK</span>', () => { const h = ReactDOMServer.renderToStaticMarkup(<Menu.ItemLabel label={{text: 'OK', heading: true}} />); h.should.be.equal('<span class="pure-menu-heading">OK</span>'); }); it('should be: <a href="#" class="pure-menu-link pure-menu-heading">OK</a>', () => { var label = {text: 'OK', url: '#', heading: true}; const h = ReactDOMServer.renderToStaticMarkup(<Menu.ItemLabel label={label} />); h.should.be.equal('<a href="#" class="pure-menu-link pure-menu-heading">OK</a>'); }); }); describe('Menu.Item', () => { it('should be: <li class="pure-menu-item"><span>OK</span></li>', () => { const h = ReactDOMServer.renderToStaticMarkup(<Menu.Item label='OK' />); h.should.be.equal('<li class="pure-menu-item"><span>OK</span></li>'); }); it('should be: <li class="pure-menu-item pure-menu-allow-hover"><span>OK</span></li>', () => { const h = ReactDOMServer.renderToStaticMarkup(<Menu.Item allowHover={true} label='OK' />); h.should.be.equal('<li class="pure-menu-item pure-menu-allow-hover"><span>OK</span></li>'); }); it('should be: <li class="pure-menu-item pure-menu-disabled"><span>OK</span></li>', () => { const h = ReactDOMServer.renderToStaticMarkup(<Menu.Item disabled={true} label="OK" />); h.should.be.equal('<li class="pure-menu-item pure-menu-disabled"><span>OK</span></li>'); }); it('should be: <ul class="pure-menu-children"></ul>', () => { const h = ReactDOMServer.renderToStaticMarkup(<Menu.Item items={[]} label="OK" />); h.should.be.equal([ '<li class="pure-menu-item pure-menu-has-children"><span>OK</span>', '<ul class="pure-menu-children"></ul></li>' ].join('')); }); it('should has: <li class="pure-menu-item"><span>Sub1</span></li><li class="pure-menu-item"><span>Sub2</span></li>', () => { const h = ReactDOMServer.renderToStaticMarkup(<Menu.Item items={[{label: 'Sub1'}, {label: 'Sub2'}]} label="OK" />); h.should.be.equal([ '<li class="pure-menu-item pure-menu-has-children"><span>OK</span>', '<ul class="pure-menu-children">', '<li class="pure-menu-item"><span>Sub1</span></li>', '<li class="pure-menu-item"><span>Sub2</span></li>', '</ul></li>' ].join('')); }); it('should be: <li class="pure-menu-item pure-menu-selected"><span>OK</span></li>', () => { const h = ReactDOMServer.renderToStaticMarkup(<Menu.Item selected={true} label="OK" />); h.should.be.equal('<li class="pure-menu-item pure-menu-selected"><span>OK</span></li>'); }); }); describe('Menu', () => { it('should be: <div class="pure-menu"><ul class="pure-menu-list"></ul></div>', () => { const h = ReactDOMServer.renderToStaticMarkup(<Menu items={[]} />); h.should.be.equal('<div class="pure-menu"><ul class="pure-menu-list"></ul></div>'); }); it('should has: <li class="pure-menu-item"><span>Sub1</span></li><li class="pure-menu-item"><span>Sub2</span></li>', () => { const h = ReactDOMServer.renderToStaticMarkup(<Menu items={[{label: 'Sub1'}, {label: 'Sub2'}]} />); h.should.be.equal([ '<div class="pure-menu">', '<ul class="pure-menu-list">', '<li class="pure-menu-item"><span>Sub1</span></li>', '<li class="pure-menu-item"><span>Sub2</span></li>', '</ul></div>' ].join('')); }); it('should be: <div class="pure-menu"><span>Main</span><ul class="pure-menu-list"></ul></div>', () => { const h = ReactDOMServer.renderToStaticMarkup(<Menu label="Main" items={[]} />); h.should.be.equal('<div class="pure-menu"><span>Main</span><ul class="pure-menu-list"></ul></div>'); }); it('should be: <div class="pure-menu pure-menu-horizontal"><ul class="pure-menu-list"></ul></div>', () => { const h = ReactDOMServer.renderToStaticMarkup(<Menu horizontal={true} items={[]} />); h.should.be.equal('<div class="pure-menu pure-menu-horizontal"><ul class="pure-menu-list"></ul></div>'); }); it('should be: <div class="pure-menu pure-menu-scrollable"><ul class="pure-menu-list"></ul></div>', () => { const h = ReactDOMServer.renderToStaticMarkup(<Menu scrollable={true} items={[]} />); h.should.be.equal('<div class="pure-menu pure-menu-scrollable"><ul class="pure-menu-list"></ul></div>'); }); }); });
/* Copyright (c) 2004-2006, The Dojo Foundation All Rights Reserved. Licensed under the Academic Free License version 2.1 or above OR the modified BSD license. For more information on Dojo licensing, see: http://dojotoolkit.org/community/licensing.shtml */ { hello: "Aloha" }
var app = app || {}; $(function(){ "use-strict"; var ShiftGridApplication = Backbone.Marionette.Application.extend({ initialize: function(options) { this.shiftData = new app.GridRows(options.rows); this.shiftLayout = this.initializeLayout(options.el); // Shift Grid var gridView = new app.GridView({ collection: this.shiftData }); this.shiftLayout.grid.show(gridView); this.listenTo(gridView, "cell:click", this.initializeModal); // Pagination var paginationView = new app.GridPaginationView({ model: new app.GridPageInfo(this.shiftData.getPageInfo()) }); this.shiftLayout.pagination.show(paginationView); gridView.listenTo(paginationView.model, "change:selectedDate", gridView.changeDate); }, initializeModal: function(cellView) { /* * The cell click event is bubbled all the way up to here, where * we show the modal window where they can claim the shift. */ var cellModal = new app.ModalCellView({ model: cellView.model, collection: cellView.model.get("roles"), }); cellView.listenToOnce(cellModal, "dismiss", cellView.render); cellModal.once("show", function() { this.$el.parents(".modal").modal("show"); }); this.shiftLayout.cell_modal.show(cellModal); }, initializeLayout: function(el) { return new app.ShiftGridLayout({ application: this, el: el }); }, }); app.ShiftGridApplication = ShiftGridApplication; });
// Expects to be preceeded by javascript that creates a variable called selectRange that // defines the segment to be wrapped and replaced. // create custom range object for wrapSelection var replaceRange = $.fn.range; replaceRange.ClearVariables(); replaceRange.startContainer = selectRange.startContainer; replaceRange.startOffset = selectRange.startOffset; replaceRange.endContainer = selectRange.endContainer; replaceRange.endOffset = selectRange.endOffset; replaceRange.collapsed = selectRange.collapsed; // Wrap the text to be replaced in a set of custom spans. // This is done so we can operate on this text even if it extends over different // inline tags. var selectMarker = 'SigilReplace_' + new Date().getTime(); $().wrapSelection({fitToWord: false, selectClass: selectMarker, wrapRange: replaceRange}); // First, store the old contents so they can be undone, and then // insert the new text in the first element of the wrapped range and clear the rest. $('.'+selectMarker).each(function(n) { if(n==0){ $(this).data('undo', $(this).html()); $(this).html("$ESCAPED_TEXT_HERE"); } else { $(this).data('undo', $(this).html()); // Assign an id so that this element isn't automatically deleted. $(this).attr("id",selectMarker+n); $(this).html(''); } }); // We need to normalize the text nodes since they're screwed up now selectRange.startContainer.parentNode.normalize(); // Set the cursor to point to the end of the replaced text. selectRange.collapse( false ); var selection = window.getSelection(); selection.removeAllRanges(); selection.addRange(selectRange); //Scroll to the cursor var from_top = window.innerHeight / 2; $.scrollTo( selectRange.startContainer, 0, {offset: {top:-from_top, left:0 } } ); // Return the unique class name used to identify these elements so the change can be undone. selectMarker.valueOf();
(function () { angular .module('mainModule') .controller('mainVagasController', mainVagasController); function mainVagasController($state, $http, BASE_URL_API) { var vm = this; vm.vagas = []; vm.abrirVaga = abrirVaga; ativar(); function ativar() { $http .get(BASE_URL_API+"Vagas") .then( function (result) { vm.vagas = result.data; }, function (error) { } ) .finally(function () { vm.mostraLoad = false; }); } function abrirVaga(id) { $state.go('vagaDetalhe', { id: id }); } } })();
Router.map(function() { this.route('index.view', { path: '/', onBeforeAction: function () { if (Meteor.isClient) { Session.set('siteTitle', 'Vazco SlideDeck!'); }; this.next(); } }); this.route('slideshow.view', { path: '/slideshow', onBeforeAction: function () { if (Meteor.isClient) { Session.set('siteTitle', 'Vazco SlideDeck! - Slideshow!'); }; this.next(); } }); this.route('priv.slideshow.view', { path: '/priv-slideshow', onBeforeAction: function () { var settings = App.SlidesSettings.findOne(); if (settings && settings.isPrivViewEnabled) { if (Meteor.isClient) { Session.set('siteTitle', 'Vazco SlideDeck! - Private Slideshow!'); }; this.next(); } else { Router.go('/'); } } }); this.route('login.view', { path: '/login', onBeforeAction: function () { if (Meteor.isClient) { Session.set('siteTitle', 'Vazco SlideDeck! - Admin Login!'); }; this.next(); } }); });
$(document).ready(function() { $('.fancybox').fancybox(); $(".fancybox-effects-a").fancybox({ helpers: { title : { type : 'outside' }, overlay : { speedOut : 0 } } }); $(".fancybox-effects-b").fancybox({ openEffect : 'none', closeEffect : 'none', helpers : { title : { type : 'over' } } }); $(".fancybox-effects-c").fancybox({ wrapCSS : 'fancybox-custom', closeClick : true, openEffect : 'none', helpers : { title : { type : 'inside' }, overlay : { css : { 'background' : 'rgba(238,238,238,0.85)' } } } }); $(".fancybox-effects-d").fancybox({ padding: 0, openEffect : 'elastic', openSpeed : 150, closeEffect : 'elastic', closeSpeed : 150, closeClick : true, helpers : { overlay : null } }); $('.fancybox-buttons').fancybox({ openEffect : 'none', closeEffect : 'none', prevEffect : 'none', nextEffect : 'none', closeBtn : false, helpers : { title : { type : 'inside' }, buttons : {} }, afterLoad : function() { this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : ''); } }); $('.fancybox-thumbs').fancybox({ prevEffect : 'none', nextEffect : 'none', closeBtn : false, arrows : false, nextClick : true, helpers : { thumbs : { width : 50, height : 50 } } }); $('.fancybox-media') .attr('rel', 'media-gallery') .fancybox({ openEffect : 'none', closeEffect : 'none', prevEffect : 'none', nextEffect : 'none', arrows : false, helpers : { media : {}, buttons : {} } }); $("#fancybox-manual-a").click(function() { $.fancybox.open('1_b.jpg'); }); $("#fancybox-manual-b").click(function() { $.fancybox.open({ href : 'iframe.html', type : 'iframe', padding : 5 }); }); $("#fancybox-manual-c").click(function() { $.fancybox.open([ { href : '1_b.jpg', title : 'My title' }, { href : '2_b.jpg', title : '2nd title' }, { href : '3_b.jpg' } ], { helpers : { thumbs : { width: 75, height: 50 } } }); }); });
/* Copyright 2012-2013, Polyvi Inc. (http://www.xface3.com) This program is distributed under the terms of the GNU General Public License. This file is part of xFace. xFace 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. xFace 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 xFace. If not, see <http://www.gnu.org/licenses/>. */ /** * @module zip */ /** * 该类定义一些常量,用于标识压缩和解压失败的错误信息(Android, iOS, WP8)<br/> * 相关参考: {{#crossLink "Zip"}}{{/crossLink}} * @class ZipError * @static * @platform Android, iOS, WP8 * @since 3.0.0 */ var ZipError = function() { }; /** * 待压缩的文件或文件夹不存在(Android, iOS, WP8) * @property FILE_NOT_EXIST * @type Number * @static * @final * @platform Android, iOS, WP8 * @since 3.0.0 */ ZipError.FILE_NOT_EXIST = 1; /** * 压缩文件出错.(Android, iOS, WP8) * @property COMPRESS_FILE_ERROR * @type Number * @static * @final * @platform Android, iOS, WP8 * @since 3.0.0 */ ZipError.COMPRESS_FILE_ERROR = 2; /** * 解压文件出错.(Android, iOS, WP8) * @property UNZIP_FILE_ERROR * @type Number * @static * @final * @platform Android, iOS, WP8 * @since 3.0.0 */ ZipError.UNZIP_FILE_ERROR = 3; /** * 文件类型错误,不支持的文件类型(Android, iOS, WP8) * @property FILE_TYPE_ERROR * @type Number * @static * @final * @platform Android, iOS, WP8 * @since 3.0.0 */ ZipError.FILE_TYPE_ERROR = 4; /** * 位置错误(Android, iOS, WP8) * @property UNKNOWN_ERR * @type Number * @static * @final * @platform Android, iOS, WP8 * @since 3.0.0 */ ZipError.UNKNOWN_ERR = 5; module.exports = ZipError;
/* Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ CKEDITOR.plugins.setLang( 'print', 'et', { toolbar: 'Printimine' } );
/** * Macchiato : Mobile and Web application offloading Copyright (C) 2013 Nicolas * Petitprez * * 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/>. */ // include FutureJS require('../../../src/main/javascript/websocket-node-adapter.js'); require('../../main/javascript/futuresjs/future.js'); require('../../main/javascript/futuresjs/sequence.js'); require('../../main/javascript/futuresjs/chainify.js'); require('../../main/javascript/futuresjs/join.js'); // macchiato EB libraries require('../../main/javascript/macchiato-commons.js'); require('../../main/javascript/macchiato-eb.js'); // test require('./qunit-server.js'); require('../javascript/eventbus.js'); run();
/** * Copyright 2017–2019, LaborX PTY * Licensed under the AGPL Version 3 license. */ export const TX_ASSET_CREATED = 'AssetCreated'
/************************************************************************ * This file is part of EspoCRM. * * EspoCRM - Open Source CRM application. * Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko * Website: http://www.espocrm.com * * EspoCRM is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * EspoCRM is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with EspoCRM. If not, see http://www.gnu.org/licenses/. * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU General Public License version 3. * * In accordance with Section 7(b) of the GNU General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ Espo.define('views/admin/layouts/modals/edit-attributes', ['views/modal', 'model'], function (Dep, Model) { return Dep.extend({ _template: '<div class="edit-container">{{{edit}}}</div>', setup: function () { this.buttonList = [ { name: 'save', text: this.translate('Apply'), style: 'primary' }, { name: 'cancel', text: 'Cancel' } ]; var model = new Model(); model.name = 'LayoutManager'; model.set(this.options.attributes || {}); this.header = this.translate(this.options.name, 'fields', this.options.scope); var attributeList = Espo.Utils.clone(this.options.attributeList || []); var index = attributeList.indexOf('name'); if (~index) { attributeList.splice(index, 1); } this.createView('edit', 'Admin.Layouts.Record.EditAttributes', { el: this.options.el + ' .edit-container', attributeList: attributeList, attributeDefs: this.options.attributeDefs, model: model }); }, actionSave: function () { var editView = this.getView('edit'); var attrs = editView.fetch(); editView.model.set(attrs, {silent: true}); if (editView.validate()) { return; } var attributes = {}; attributes = editView.model.attributes; this.trigger('after:save', attributes); return true; }, }); });
/* Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ CKEDITOR.plugins.setLang( 'basicstyles', 'sr-latn', { bold: 'Podebljano', italic: 'Kurziv', strike: 'Precrtano', subscript: 'Indeks', superscript: 'Stepen', underline: 'Podvučeno' } );
/* Copyright 2013 Northern Arizona University This file is part of Sweet Jumps. Sweet Jumps 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. Sweet Jumps 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 Sweet Jumps. If not, see <http://www.gnu.org/licenses/>. */ 'use strict' var logger = require('log4js').getLogger('[ctrl] {%= name %}') /** * {%= name %} controller initialization function. * @param {express} app The global express app. Preferably mount a subapp or router for all of this controller's routes. * @param {object} options Configuration if it exists * @param {[type]} context The instance of the SweetJumps class. Preferably you would not use this unless necessary (to getModule for instance). */ module.exports = function (app, options, context) { logger.info('{%= name %} controller init') app.get('/', function (req, res) { res.render('{%= filename %}/index', { 'message': 'Controller: {%= name %}' }) }) }
Ext.define('Zenws.zenws.shared.com.zen.viewmodel.location.LanguageViewModel', { "extend": "Ext.app.ViewModel", "alias": "viewmodel.LanguageViewModel", "model": "LanguageModel", "data": {} });
MODX Evolution 1.1 = 6c5e02783a79b572e09102b05854077e
"use strict"; /*global define, templates, socket, ajaxify, app, admin, bootbox, utils, config */ define('admin/manage/groups', [ 'translator', 'components' ], function(translator, components) { var Groups = {}; var intervalId = 0; Groups.init = function() { var createModal = $('#create-modal'), createGroupName = $('#create-group-name'), createModalGo = $('#create-modal-go'), createModalError = $('#create-modal-error'); handleSearch(); createModal.on('keypress', function(e) { if (e.keyCode === 13) { createModalGo.click(); } }); $('#create').on('click', function() { createModal.modal('show'); setTimeout(function() { createGroupName.focus(); }, 250); }); createModalGo.on('click', function() { var submitObj = { name: createGroupName.val(), description: $('#create-group-desc').val() }, errorText; socket.emit('admin.groups.create', submitObj, function(err) { if (err) { if (err.hasOwnProperty('message') && utils.hasLanguageKey(err.message)) { translator.translate(err.message, config.defaultLang, function(translated) { createModalError.html(translated).removeClass('hide'); }); } else { createModalError.html('<strong>Uh-Oh</strong><p>There was a problem creating your group. Please try again later!</p>').removeClass('hide'); } } else { createModalError.addClass('hide'); createGroupName.val(''); createModal.on('hidden.bs.modal', function() { ajaxify.refresh(); }); createModal.modal('hide'); } }); }); $('.groups-list').on('click', 'button[data-action]', function() { var el = $(this), action = el.attr('data-action'), groupName = el.parents('tr[data-groupname]').attr('data-groupname'); switch (action) { case 'delete': bootbox.confirm('Are you sure you wish to delete this group?', function(confirm) { if (confirm) { socket.emit('groups.delete', { groupName: groupName }, function(err, data) { if(err) { return app.alertError(err.message); } ajaxify.refresh(); }); } }); break; } }); }; function handleSearch() { function doSearch() { if (!queryEl.val()) { return ajaxify.refresh(); } $('.pagination').addClass('hide'); var groupsEl = $('.groups-list'); socket.emit('groups.search', { query: queryEl.val(), options: { sort: 'date' } }, function(err, groups) { if (err) { return app.alertError(err.message); } templates.parse('admin/manage/groups', 'groups', { groups: groups }, function(html) { groupsEl.find('[data-groupname]').remove(); groupsEl.find('tr').after(html); }); }); } var queryEl = $('#group-search'); queryEl.on('keyup', function() { if (intervalId) { clearTimeout(intervalId); intervalId = 0; } intervalId = setTimeout(doSearch, 200); }); } return Groups; });
/** * @fileoverview Rule to forbid control charactes from regular expressions. * @author Nicholas C. Zakas */ "use strict"; //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ module.exports = { meta: { docs: { description: "disallow control characters in regular expressions", category: "Possible Errors", recommended: true }, schema: [] }, create: function(context) { /** * Get the regex expression * @param {ASTNode} node node to evaluate * @returns {*} Regex if found else null * @private */ function getRegExp(node) { if (node.value instanceof RegExp) { return node.value; } else if (typeof node.value === "string") { var parent = context.getAncestors().pop(); if ((parent.type === "NewExpression" || parent.type === "CallExpression") && parent.callee.type === "Identifier" && parent.callee.name === "RegExp" ) { // there could be an invalid regular expression string try { return new RegExp(node.value); } catch (ex) { return null; } } } return null; } /** * Check if given regex string has control characters in it * @param {string} regexStr regex as string to check * @returns {boolean} returns true if finds control characters on given string * @private */ function hasControlCharacters(regexStr) { // check control characters, if RegExp object used var hasControlChars = /[\x00-\x1f]/.test(regexStr); // eslint-disable-line no-control-regex // check substr, if regex literal used var subStrIndex = regexStr.search(/\\x[01][0-9a-f]/i); if (!hasControlChars && subStrIndex > -1) { // is it escaped, check backslash count var possibleEscapeCharacters = regexStr.substr(0, subStrIndex).match(/\\+$/gi); hasControlChars = possibleEscapeCharacters === null || !(possibleEscapeCharacters[0].length % 2); } return hasControlChars; } return { Literal: function(node) { var computedValue, regex = getRegExp(node); if (regex) { computedValue = regex.toString(); if (hasControlCharacters(computedValue)) { context.report(node, "Unexpected control character in regular expression."); } } } }; } };
L.mapbox.accessToken = 'pk.eyJ1IjoibHVkby1hdXJnIiwiYSI6IjE0QzlVekkifQ.FK86sgWfTNbDC-Z-O-hTww'; var osm = L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'); var ggl = L.tileLayer('http://{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}',{ maxZoom: 20, subdomains:['mt0','mt1','mt2','mt3'] }); var currenturl = location.href; var url = currenturl.replace('/create',''); var featureLayer = L.mapbox.featureLayer(); var map = L.mapbox.map('editmap').setView([47.2172500,-1.5533600], 12); featureLayer.addTo(map); osm.addTo(map); var drawControl = new L.Control.Draw({ draw: { rectangle: false, circle: false, marker: true }, edit: { featureGroup: featureLayer } }).addTo(map); map.on('draw:created', function(e) { var layer = e.layer; featureLayer.addLayer(layer); var shape = JSON.stringify(featureLayer.toGeoJSON()); var ajax = $.ajax({ type: "POST", url: url+'/creategeom', data: 'shape='+shape, dataType: "json", encode: true }) ajax.done(function(data) { var typegeoms = ["Point","Polygon","LineString"]; $("#geom").empty(); $.each(typegeoms, function(key, val) { if (typeof data[val] !== 'undefined') { $("#geom").append('<input type="hidden" name="'+val.toLowerCase()+'" value="'+data[val].geom+'" />'); } }); }); }); map.on('draw:edited', function(e) { var layers = e.layers; layers.eachLayer(function (layer) { var shape = JSON.stringify(layers.toGeoJSON()); var ajax = $.ajax({ type: "POST", url: url+'/creategeom', data: 'shape='+shape, dataType: "json", encode: true }) ajax.done(function(data) { var typegeoms = ["Point","Polygon","LineString"]; $("#geom").empty(); $.each(typegeoms, function(key, val) { if (typeof data[val] !== 'undefined') { $("#geom").append('<input type="hidden" name="'+val.toLowerCase()+'" value="'+data[val].geom+'" />'); } }); }); }); }); map.on('draw:deleted', function(e) { var layer = e.layer; featureLayer.removeLayer(layer); var shape = JSON.stringify(featureLayer.toGeoJSON()); var ajax = $.ajax({ type: "POST", url: url+'/creategeom', data: 'shape='+shape, dataType: "json", encode: true }) ajax.done(function(data) { var typegeoms = ["Point","Polygon","LineString"]; $("#geom").empty(); $.each(typegeoms, function(key, val) { if (typeof data[val] !== 'undefined') { $("#geom").append('<input type="hidden" name="'+val.toLowerCase()+'" value="'+data[val].geom+'" />'); }else{ $("#geom").append('<input type="hidden" name="'+val.toLowerCase()+'" value="empty" />'); } }); }); }); map.addControl(new L.Control.Layers( {'OSM':osm, 'Google':ggl}, {}));
var NAVTREE = [ [ "MLX90621", "index.html", [ [ "MLX90621-Lite", "md__e_1__dropbox__projects__m_l_x90621-_lite__r_e_a_d_m_e.html", null ], [ "Classes", "annotated.html", [ [ "Class List", "annotated.html", "annotated_dup" ], [ "Class Index", "classes.html", null ], [ "Class Members", "functions.html", [ [ "All", "functions.html", null ], [ "Functions", "functions_func.html", null ], [ "Variables", "functions_vars.html", null ] ] ] ] ], [ "Files", null, [ [ "File List", "files.html", "files" ], [ "File Members", "globals.html", [ [ "All", "globals.html", null ], [ "Variables", "globals_vars.html", null ], [ "Macros", "globals_defs.html", null ] ] ] ] ] ] ] ]; var NAVTREEINDEX = [ "_m_l_x90621_8cpp.html" ]; var SYNCONMSG = 'click to disable panel synchronisation'; var SYNCOFFMSG = 'click to enable panel synchronisation';
$(function() { $( "#save" ).click(function(){ bval = true; bval = bval && $( "#nombres" ).required(); bval = bval && $( "#apellidop" ).required(); bval = bval && $( "#apellidom" ).required(); bval = bval && $( "#dni" ).required(); bval = bval && $( "#sexo" ).required(); bval = bval && $( "#direccion" ).required(); bval = bval && $( "#telefono" ).required(); if ( bval ) { $("#frm").submit(); alert("DATOS GUARDADOS"); window.close(); } else{alert("LLENAR TODOS LOS CAMPOS!!!");} return false; }); });
/* (c) 2014, Vladimir Agafonkin simpleheat, a tiny JavaScript library for drawing heatmaps with Canvas https://github.com/mourner/simpleheat */ (function () { 'use strict'; function simpleheat(canvas) { // jshint newcap: false, validthis: true if (!(this instanceof simpleheat)) { return new simpleheat(canvas); } this._canvas = canvas = typeof canvas === 'string' ? document.getElementById(canvas) : canvas; this._ctx = canvas.getContext('2d'); this._width = canvas.width; this._height = canvas.height; this._max = 1; this._data = []; } simpleheat.prototype = { defaultRadius: 25, defaultGradient: { 0.4: 'blue', 0.6: 'cyan', 0.7: 'lime', 0.8: 'yellow', 1.0: 'red' }, data: function (data) { this._data = data; return this; }, max: function (max) { this._max = max; return this; }, add: function (point) { this._data.push(point); return this; }, clear: function () { this._data = []; return this; }, radius: function (r, blur) { var c, sh = this, radiusCache = {}; blur = blur || 15; // Allow setting a function for the radius, called with the _data point if ( typeof r === 'function' ) { this._circle = function ( data ) { var radius = r( data ); if ( radiusCache[radius] ) { this._r = radiusCache[radius] + blur; return radiusCache[radius]; } else { return this._circleFromRadius( radius, blur ); } } return; } else { c = this._circleFromRadius( r, blur ); this._circle = function () { return c; } } return this; }, _circleFromRadius: function ( r, blur ) { // create a grayscale blurred circle image that we'll use for drawing points var circle = document.createElement('canvas'), ctx = circle.getContext('2d'), r2 = this._r = r + blur; circle.width = circle.height = r2 * 2; ctx.shadowOffsetX = ctx.shadowOffsetY = 200; ctx.shadowBlur = blur; ctx.shadowColor = 'black'; ctx.beginPath(); ctx.arc(r2 - 200, r2 - 200, r, 0, Math.PI * 2, true); ctx.closePath(); ctx.fill(); return circle; }, gradient: function (grad) { // create a 256x1 gradient that we'll use to turn a grayscale heatmap into a colored one var canvas = document.createElement('canvas'), ctx = canvas.getContext('2d'), gradient = ctx.createLinearGradient(0, 0, 0, 256); canvas.width = 1; canvas.height = 256; for (var i in grad) { gradient.addColorStop(i, grad[i]); } ctx.fillStyle = gradient; ctx.fillRect(0, 0, 1, 256); this._grad = ctx.getImageData(0, 0, 1, 256).data; return this; }, draw: function (minOpacity) { if (!this._circle) { this.radius(this.defaultRadius); } if (!this._grad) { this.gradient(this.defaultGradient); } var ctx = this._ctx; ctx.clearRect(0, 0, this._width, this._height); // draw a grayscale heatmap by putting a blurred circle at each data point for (var i = 0, len = this._data.length, p; i < len; i++) { p = this._data[i]; ctx.globalAlpha = Math.max(p[2] / this._max, minOpacity === undefined ? 0.05 : minOpacity); ctx.drawImage( typeof this._circle === 'function' ? this._circle(this._data[i]) : this._circle, p[0] - this._r, p[1] - this._r); } // colorize the heatmap, using opacity value of each pixel to get the right color from our gradient var colored = ctx.getImageData(0, 0, this._width, this._height); this._colorize(colored.data, this._grad); ctx.putImageData(colored, 0, 0); return this; }, _colorize: function (pixels, gradient) { for (var i = 3, len = pixels.length, j; i < len; i += 4) { j = pixels[i] * 4; // get gradient color from opacity value if (j) { pixels[i - 3] = gradient[j]; pixels[i - 2] = gradient[j + 1]; pixels[i - 1] = gradient[j + 2]; } } } }; window.simpleheat = simpleheat; })();
import React from "react"; import { storiesOf, fixtures } from "helpers/storybook/exports"; import ThumbnailGrid from ".."; import EntityThumbnail from "global/components/atomic/EntityThumbnail"; import shuffle from "lodash/shuffle"; const issues = fixtures .collectionFactory("issue", 3) .map(issue => issue.data) .map(issue => { return { ...issue, attributes: { ...issue.attributes, avatarColor: "quinary" } }; }); const projects = fixtures.collectionFactory("project", 3).map(issue => { return { ...issue, attributes: { ...issue.attributes, avatarColor: "tertiary" } }; }); const journals = fixtures.collectionFactory("journal", 3); const entities = shuffle(projects.concat(journals).concat(issues)); storiesOf("Global/ThumbnailGrid", module) .add("Grid", () => { return ( <div className="container bg-white"> <ThumbnailGrid> {({ stack }) => entities.map(item => ( <EntityThumbnail key={item.id} entity={item} onUncollect={() => console.log("clicked uncollect")} stack={stack} /> )) } </ThumbnailGrid> </div> ); }) .add("List", () => { return ( <div className="container bg-white" style={{ maxWidth: "500px" }}> <ThumbnailGrid> {({ stack }) => entities.map(item => ( <EntityThumbnail key={item.id} entity={item} onUncollect={() => console.log("clicked uncollect")} stack={stack} /> )) } </ThumbnailGrid> </div> ); }) .add("Empty", () => { return ( <div className="container bg-white"> <ThumbnailGrid /> </div> ); });
var browser = chrome; var activetabs = []; //alert("launchfacebook"); document.addEventListener('DOMContentLoaded', function () { var css_lastcouche ='.lastcouche {background-image:'+chrome.extension.getURL('src/css/internet.gif')+';}'; chrome.tabs.insertCSS(null, { code: css_lastcouche }); chrome.tabs.insertCSS(null, { file: "/src/css/stylefacebook.css" }); chrome.tabs.executeScript(null, { file: "/src/fabric.min.js" }); chrome.tabs.executeScript(null, { file: "/src/jquery-3.2.1.min.js" }); chrome.tabs.executeScript(null, { file: "/src/jquery-ui.min.js" }); document.getElementById("go").addEventListener("click", function () { window.close(); browser.tabs.executeScript(null, {file : "/src/generalfacebook.js"}); browser.tabs.executeScript(null, {file : "/src/couchefacebook.js"}); }); });
"use strict"; var to_ascii = typeof atob == "undefined" ? function(b64) { return new Buffer(b64, "base64").toString(); } : atob; var to_base64 = typeof btoa == "undefined" ? function(str) { return new Buffer(str).toString("base64"); } : btoa; function read_source_map(code) { var match = /\n\/\/# sourceMappingURL=data:application\/json(;.*?)?;base64,(.*)/.exec(code); if (!match) { AST_Node.warn("inline source map not found"); return null; } return to_ascii(match[2]); } function set_shorthand(name, options, keys) { if (options[name]) { keys.forEach(function(key) { if (options[key]) { if (typeof options[key] != "object") options[key] = {}; if (!(name in options[key])) options[key][name] = options[name]; } }); } } function minify(files, options) { var warn_function = AST_Node.warn_function; try { if (typeof files == "string") { files = [ files ]; } options = defaults(options, { compress: {}, ie8: false, keep_fnames: false, mangle: {}, output: {}, parse: {}, sourceMap: false, toplevel: false, warnings: false, wrap: false, }, true); set_shorthand("ie8", options, [ "compress", "mangle", "output" ]); set_shorthand("keep_fnames", options, [ "compress", "mangle" ]); set_shorthand("toplevel", options, [ "compress", "mangle" ]); set_shorthand("warnings", options, [ "compress" ]); if (options.mangle) { options.mangle = defaults(options.mangle, { cache: null, eval: false, ie8: false, keep_classnames: false, keep_fnames: false, properties: false, reserved: [], safari10: false, toplevel: false, }, true); } if (options.sourceMap) { options.sourceMap = defaults(options.sourceMap, { content: null, filename: null, includeSources: false, root: null, url: null, }, true); } var warnings = []; if (options.warnings && !AST_Node.warn_function) { AST_Node.warn_function = function(warning) { warnings.push(warning); }; } var toplevel; if (files instanceof AST_Toplevel) { toplevel = files; } else { options.parse = options.parse || {}; options.parse.toplevel = null; for (var name in files) { options.parse.filename = name; options.parse.toplevel = parse(files[name], options.parse); if (options.sourceMap && options.sourceMap.content == "inline") { if (Object.keys(files).length > 1) throw new Error("inline source map only works with singular input"); options.sourceMap.content = read_source_map(files[name]); } } toplevel = options.parse.toplevel; } if (options.wrap) { toplevel = toplevel.wrap_commonjs(options.wrap); } if (options.compress) { toplevel.figure_out_scope(options.mangle); toplevel = new Compressor(options.compress).compress(toplevel); } if (options.mangle) { toplevel.figure_out_scope(options.mangle); base54.reset(); toplevel.compute_char_frequency(options.mangle); toplevel.mangle_names(options.mangle); if (options.mangle.properties) { toplevel = mangle_properties(toplevel, options.mangle.properties); } } var result = {}; if (options.output.ast) { result.ast = toplevel; } if (!HOP(options.output, "code") || options.output.code) { if (options.sourceMap) { if (typeof options.sourceMap.content == "string") { options.sourceMap.content = JSON.parse(options.sourceMap.content); } options.output.source_map = SourceMap({ file: options.sourceMap.filename, orig: options.sourceMap.content, root: options.sourceMap.root }); if (options.sourceMap.includeSources) { for (var name in files) { options.output.source_map.get().setSourceContent(name, files[name]); } } } delete options.output.ast; delete options.output.code; var stream = OutputStream(options.output); toplevel.print(stream); result.code = stream.get(); if (options.sourceMap) { result.map = options.output.source_map.toString(); if (options.sourceMap.url == "inline") { result.code += "\n//# sourceMappingURL=data:application/json;charset=utf-8;base64," + to_base64(result.map); } else if (options.sourceMap.url) { result.code += "\n//# sourceMappingURL=" + options.sourceMap.url; } } } if (warnings.length) { result.warnings = warnings; } return result; } catch (ex) { return { error: ex }; } finally { AST_Node.warn_function = warn_function; } }
var searchData= [ ['udp',['Udp',['../class_cool_time.html#a4e23216a8121ca79d0fb019f30884b92',1,'CoolTime']]], ['unsubscribe',['unsubscribe',['../class_cool_pub_sub_client.html#a850554280e314d6b5c33c73fd9e809fc',1,'CoolPubSubClient']]], ['update',['update',['../class_cool_board.html#a8612756d3f73198cdde857a66f0fe690',1,'CoolBoard::update()'],['../class_cool_time.html#aae601f795452cfa48d9fb337aed483a8',1,'CoolTime::update()']]], ['updateconfigfiles',['updateConfigFiles',['../class_cool_file_system.html#adfa8e2e80641ae6f0cceabd348a9b841',1,'CoolFileSystem']]], ['user',['user',['../class_cool_m_q_t_t.html#a8cd47e45d457f908d4b4390b35aaee83',1,'CoolMQTT']]], ['useractive',['userActive',['../class_cool_board.html#a6395459131d6889a3005f79c7a35e964',1,'CoolBoard']]], ['userdata',['userData',['../class_cool_board.html#ae7358fb6e623cfc81b775f5f1734909b',1,'CoolBoard']]], ['uv',['uv',['../struct_cool_board_sensors_1_1light_active.html#a0e6cfc311425a31f32c32fc3b834ffb8',1,'CoolBoardSensors::lightActive']]] ];
// namespaces var dwv = dwv || {}; dwv.image = dwv.image || {}; /** * {@link dwv.image.View} factory. * * @class */ dwv.image.ViewFactory = function () {}; /** * {@link dwv.image.View} factory. Defaults to local one. * * @see dwv.image.ViewFactory */ dwv.ViewFactory = dwv.image.ViewFactory; /** * Get an View object from the read DICOM file. * * @param {object} dicomElements The DICOM tags. * @param {dwv.image.Image} image The associated image. * @returns {dwv.image.View} The new View. */ dwv.image.ViewFactory.prototype.create = function (dicomElements, image) { // view var view = new dwv.image.View(image); // default color map if (image.getPhotometricInterpretation() === 'MONOCHROME1') { view.setDefaultColourMap(dwv.image.lut.invPlain); } else if (image.getPhotometricInterpretation() === 'PALETTE COLOR') { var paletteLut = image.getMeta().paletteLut; if (typeof (paletteLut) !== 'undefined') { view.setDefaultColourMap(paletteLut); } } // window level presets var windowPresets = {}; // image presets if (typeof image.getMeta().windowPresets !== 'undefined') { windowPresets = image.getMeta().windowPresets; } // min/max // Not filled yet since it is stil too costly to calculate min/max // for each slice... It will be filled at first use // (see view.setWindowLevelPreset). // Order is important, if no wl from DICOM, this will be the default. windowPresets.minmax = {name: 'minmax'}; // optional modality presets if (typeof dwv.tool !== 'undefined' && typeof dwv.tool.defaultpresets !== 'undefined') { var modality = image.getMeta().Modality; for (var key in dwv.tool.defaultpresets[modality]) { var preset = dwv.tool.defaultpresets[modality][key]; windowPresets[key] = { wl: new dwv.image.WindowLevel(preset.center, preset.width), name: key }; } } // store view.setWindowPresets(windowPresets); // set the initial position view.setInitialPosition(); return view; };
"use strict"; var path = require("path"); var assert = require("chai").assert; var request = require("supertest"); var fork = require("child_process").fork; var index = path.resolve(__dirname + "/../../../index.js"); describe.skip("E2E CLI Snippet test", function () { // use `mocha --timeout` option instead //this.timeout(5000); var bs, options; before(function (done) { bs = fork(index, ["start", "--logLevel=silent"]); bs.on("message", function (data) { options = data.options; done(); }); bs.send({send: "options"}); }); after(function (done) { bs.kill("SIGINT"); setTimeout(done, 200); // Allow server to close successfully }); it("can serve the client JS", function (done) { request(options.urls.local) .get(options.scriptPaths.versioned) .expect(200) .end(function (err, res) { assert.include(res.text, "Connected to BrowserSync"); done(); }); }); });
#!/usr/bin/env node 'use strict'; var colors = require('ansicolors') var table = require('text-table') if (process.argv.length < 3) { fromStdin(); } else { var steps= require(process.argv[2]).steps print(steps); } function fromStdin() { var data = []; function onerror(err) { console.error('gai-pring-js ', err) } process.stdin .on('data', ondata) .on('end', onend) .on('error', onerror) function ondata(d) { data.push(d); } function onend() { var json = Buffer.concat(data).toString(); try { print(JSON.parse(json).steps); } catch(err) { console.error(json); console.error(err); } } } function tableize(step) { var first = true; function toString(acc, k) { if (k === 'eip') return acc; // instruction pointer always changes and isn't important here var d = step.diff[k]; var s = acc; s += first ? ';' : ','; s += ' ' + k + ': ' + d.prev.hex + ' -> ' + d.curr.hex; if (k === 'eflags') s += ' ' + d.curr.flagsString; first = false; return s; } var diffString = step.diff ? Object.keys(step.diff).reduce(toString, '') : '' var m = step.instruction.match(/^([a-f0-9]{2} )+/); var opcodes = m[0].trim() , inst = step.instruction.replace(opcodes, '').trim(); return [ colors.brightBlack(step.address), colors.brightBlue(opcodes), colors.green(inst), colors.brightBlack(diffString) ]; } function print(steps) { var tableized = steps.map(tableize); console.log(table(tableized)); }
/* Copyright (C) 2014 PencilBlue, LLC 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/>. */ /** * Interface for managing pages */ function ManagePages(){} //dependencies var Pages = require('../pages'); //inheritance util.inherits(ManagePages, pb.BaseController); //statics var SUB_NAV_KEY = 'manage_pages'; ManagePages.prototype.render = function(cb) { var self = this; var dao = new pb.DAO(); dao.query('page', pb.DAO.ANYWHERE, pb.DAO.PROJECT_ALL, {headline: pb.DAO.ASC}).then(function(pages) { if(pages.length === 0) { self.redirect('/admin/content/pages/new_page', cb); return; } pb.users.getAuthors(pages, function(err, pagesWithAuthor) { var angularData = pb.js.getAngularController( { navigation: pb.AdminNavigation.get(self.session, ['content', 'pages'], self.ls), pills: pb.AdminSubnavService.get(SUB_NAV_KEY, self.ls, 'manage_pages'), pages: self.getPageStatuses(pagesWithAuthor) }, [], 'initPagesPagination()'); var title = self.ls.get('MANAGE_PAGES'); self.setPageName(title); self.ts.registerLocal('angular_script', angularData); self.ts.load('admin/content/pages/manage_pages', function(err, data) { var result = '' + data; cb({content: result}); }); }); }); }; ManagePages.prototype.getPageStatuses = function(pages) { var now = new Date(); for(var i = 0; i < pages.length; i++) { if(pages[i].draft) { pages[i].status = this.ls.get('DRAFT'); } else if(pages[i].publish_date > now) { pages[i].status = this.ls.get('UNPUBLISHED'); } else { pages[i].status = this.ls.get('PUBLISHED'); } } return pages; }; ManagePages.getSubNavItems = function(key, ls, data) { var pills = Pages.getPillNavOptions(); pills.unshift( { name: 'manage_pages', title: ls.get('MANAGE_PAGES'), icon: 'refresh', href: '/admin/content/pages/manage_pages' }); return pills; }; //register admin sub-nav pb.AdminSubnavService.registerFor(SUB_NAV_KEY, ManagePages.getSubNavItems); //exports module.exports = ManagePages;
module.exports = function(grunt) { grunt.initConfig({ // !! This is the name of the task 'requirejs' (grunt-contrib-requirejs module) requirejs: { dist: { // !! You can drop your app.build.js config wholesale into 'options' options: { appDir: "bl_scoreboard/static", baseUrl: "js", dir: "bl_scoreboard/dist", keepBuildDir: true, // cleanup of 'dist' is supposed to be done by 'purge:dist' task mainConfigFile: "bl_scoreboard/static/js/main.js", name: "main", // points to 'static/js/main.js' optimize: 'uglify2', uglify2: { compress: {} }, skipDirOptimize: true, preserveLicenseComments: false, findNestedDependencies: false, removeCombined: true, inlineText: true, optimizeCss: 'standard', logLevel: 0, fileExclusionRegExp: /^\./ } } }, compress: { dist: { options: { mode: 'gzip', level: 9 }, files: [ {expand: true, src: [ 'bl_scoreboard/dist/js/**/*.js', 'bl_scoreboard/dist/lib/requirejs/require.js' ], ext: '.js.gz'} ] } }, uglify: { rjs_dist: { options: { }, files: { 'bl_scoreboard/dist/lib/requirejs/require.js': ['bl_scoreboard/dist/lib/requirejs/require.js'] } } }, // !! This is the name of the task 'clean' (grunt-contrib-clean module) after renaming to 'purge' purge: { dist: { src: [ 'bl_scoreboard/dist/*', '!bl_scoreboard/dist/.gitignore' ] }, dev: { src: [ 'bl_scoreboard/static/lib/*', '!bl_scoreboard/static/lib/.gitignore', ] } }, // !! Bower's 'install' task bower: { dev: { options: { // targetDir: "bl_scoreboard/static/lib", // layout: "byComponent", verbose: true } } }, bower_rjs: { all: { rjsConfig: "bl_scoreboard/static/js/main.js" } } }); // This loads the requirejs plugin into grunt grunt.loadNpmTasks('grunt-contrib-requirejs'); grunt.loadNpmTasks('grunt-contrib-compress'); grunt.loadNpmTasks('grunt-contrib-uglify'); // Must be renamed because 'clean' is very common name grunt.loadNpmTasks('grunt-contrib-clean'); grunt.renameTask('clean', 'purge'); // because 'clean' is very common name // Must be renamed because of task name conflict between 'grunt-bower-requirejs' and 'grunt-bower-task'. // They both are use 'bower' task name. // Also, 'bower-requirejs' npm module can be used. See '.bowerrc.inactive' at the root directory for some details. grunt.loadNpmTasks('grunt-bower-requirejs'); grunt.renameTask('bower', 'bower_rjs'); grunt.loadNpmTasks('grunt-bower-task'); // Register tasks grunt.registerTask('clean', ['purge:dist', 'purge:dev']); grunt.registerTask('clean-dist', ['purge:dist']); grunt.registerTask('clean-dev', ['purge:dev']); grunt.registerTask('build-dev', ['clean-dev', 'bower:dev', 'bower_rjs']); grunt.registerTask('build-dist', ['clean-dist', 'requirejs:dist', 'uglify:rjs_dist', 'compress:dist']); };
/** * [remove: removes an object from the DOM tree] */ Element.prototype.remove = function () { this.parentNode.removeChild(this) } /** * [remove: removes a series of objects from the DOM tree] */ NodeList.prototype.remove = HTMLCollection.prototype.remove = function () { for (var i = this.length - 1; i >= 0; i--) { if (this[i] && this[i].parentNode) { this[i].parentNode.removeChild(this[i]) } } } document.querySelectorAll('h1').remove() // This can't be done quicker.. write a function DRY let instruction = document.createTextNode('Toss the images around; if you see one you like, click on it!') let header = document.createElement('h2') header.appendChild(instruction) let listItem = document.createElement('li') listItem.appendChild(header) document.querySelector('main section ul').appendChild(listItem) // Hook the drag functions on the li elements document.querySelectorAll('main section li').forEach(function (image) { image.addEventListener('dragstart', function (event) { console.log('start dragging..') // Closure! }) image.addEventListener('dragend', function (event) { console.log('stop dragging..') // Closure! }) }) // TODO: functionality to move the dragged item to the new location when dragged // Stop the default action when clicking a link document.querySelectorAll('main section li a').forEach(function (link) { link.addEventListener('click', function (event) { event.preventDefault() }) }) // Randomly place all images document.querySelectorAll('main section li').forEach(function (image) { let left = (window.innerWidth / 2 - image.offsetWidth / 2) let top = (window.innerHeight / 2 - image.offsetHeight / 2) image.style.position = 'absolute' image.style.left = left + (-200 + Math.random() * 400) + 'px' image.style.top = top + (-200 + Math.random() * 400) + 'px' })
/* * Kendo UI Web v2013.1.319 (http://kendoui.com) * Copyright 2013 Telerik AD. All rights reserved. * * Kendo UI Web commercial licenses may be obtained at * https://www.kendoui.com/purchase/license-agreement/kendo-ui-web-commercial.aspx * If you do not own a commercial license, this file shall be governed by the * GNU General Public License (GPL) version 3. * For GPL requirements, please review: http://www.gnu.org/copyleft/gpl.html */ (function( window, undefined ) { kendo.cultures["yo-NG"] = { name: "yo-NG", numberFormat: { pattern: ["-n"], decimals: 2, ",": ",", ".": ".", groupSize: [3], percent: { pattern: ["-n %","n %"], decimals: 2, ",": ",", ".": ".", groupSize: [3], symbol: "%" }, currency: { pattern: ["$-n","$ n"], decimals: 2, ",": ",", ".": ".", groupSize: [3], symbol: "N" } }, calendars: { standard: { days: { names: ["Aiku","Aje","Isegun","Ojo\u0027ru","Ojo\u0027bo","Eti","Abameta"], namesAbbr: ["Aik","Aje","Ise","Ojo","Ojo","Eti","Aba"], namesShort: ["A","A","I","O","O","E","A"] }, months: { names: ["Osu kinni","Osu keji","Osu keta","Osu kerin","Osu karun","Osu kefa","Osu keje","Osu kejo","Osu kesan","Osu kewa","Osu kokanla","Osu keresi",""], namesAbbr: ["kin.","kej.","ket.","ker.","kar.","kef.","kej.","kej.","kes.","kew.","kok.","ker.",""] }, AM: ["Owuro","owuro","OWURO"], PM: ["Ale","ale","ALE"], patterns: { d: "d/M/yyyy", D: "dddd, MMMM dd, yyyy", F: "dddd, MMMM dd, yyyy h:mm:ss tt", g: "d/M/yyyy h:mm tt", G: "d/M/yyyy h:mm:ss tt", m: "MMMM dd", M: "MMMM dd", s: "yyyy'-'MM'-'dd'T'HH':'mm':'ss", t: "h:mm tt", T: "h:mm:ss tt", u: "yyyy'-'MM'-'dd HH':'mm':'ss'Z'", y: "MMMM, yyyy", Y: "MMMM, yyyy" }, "/": "/", ":": ":", firstDay: 0 } } } })(this);
/* GCompris - tangram.js * * Copyright (C) 2016 Bruno Coudoin <bruno.coudoin@gcompris.net> * * Authors: * Yves Combe / Philippe Banwarth (GTK+ version) * Bruno Coudoin <bruno.coudoin@gcompris.net> (Qt Quick port) * * 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 <https://www.gnu.org/licenses/>. */ .pragma library .import QtQuick 2.6 as Quick var currentLevel = 0 var items function start(items_) { items = items_ currentLevel = 0 initLevel() } function stop() { } function initLevel() { items.bar.level = currentLevel + 1 } function nextLevel() { if(items.numberOfLevel <= ++currentLevel ) { currentLevel = 0 } initLevel(); } function previousLevel() { if(--currentLevel < 0) { currentLevel = items.numberOfLevel - 1 } initLevel(); } function getRandomInt(min, max) { return Math.floor(Math.random() * (max - min + 1) + min); } // Determines the angle of a straight line drawn between point one and two. // The number returned, which is a float in radian, // tells us how much we have to rotate a horizontal line clockwise // for it to match the line between the two points. function getAngleOfLineBetweenTwoPoints(x1, y1, x2, y2) { var xDiff = x2 - x1; var yDiff = y2 - y1; return Math.atan2(yDiff, xDiff); } function getDistance(ix, iy, jx, jy) { return Math.sqrt(Math.pow((ix - jx), 2) + Math.pow((iy - jy), 2)) } function dumpTans(tans) { console.log("== tans ==") for(var i = 0; i < tans.length; i++) { console.log(tans[i].img, tans[i].x, tans[i].y, tans[i].rotation, tans[i].flipping) } } /* Returns the [x, y] coordinate of the closest point */ function getClosest(point) { var nbpiece = items.currentTans.pieces.length var closestItem var closestDist = 1 for(var i = 0; i < nbpiece; i++) { var p1 = items.currentTans.pieces[i] var dist = getDistance(p1.x, p1.y, point[0], point[1]) if(dist < closestDist) { closestDist = dist closestItem = p1 } } if(closestDist < 0.1) return [closestItem.x, closestItem.y] return } function check() { var nbpiece = items.currentTans.pieces.length var userTans = items.userList.asTans() for(var i = 0; i < nbpiece; i++) { var p1 = items.currentTans.pieces[i] var ok = false for(var j = 0; j < nbpiece; j++) { var p2 = userTans[j] // Check type distance and rotation are close enough if(p1.img === p2.img && p1.flipping == p2.flipping && getDistance(p1.x, p1.y, p2.x, p2.y) < 0.01 && p1.rotation === p2.rotation ) { ok = true break } } if(!ok) return false } return true } function toDataset() { var nbpiece = items.currentTans.pieces.length var userTans = items.userList.asTans() var tanss = ' {\n' + " 'bg': '',\n" + " 'name': '" + items.currentTans.name + "',\n" + " 'colorMask': '#999',\n" + " 'pieces': [\n" for(var i = 0; i < nbpiece; i++) { var p1 = items.currentTans.pieces[i] var p2 = userTans[i] tanss += ' {' + '\n' + " 'img': '" + p1.img + "',\n" + " 'flippable': " + p1.flippable + ',\n' + " 'flipping': " + p2.flipping + ',\n' + " 'height': " + p1.height + ',\n' + " 'initFlipping': " + p1.initFlipping + ',\n' + " 'initRotation': " + p1.initRotation + ',\n' + " 'initX': " + p1.initX + ',\n' + " 'initY': " + p1.initY + ',\n' + " 'moduloRotation': " + p1.moduloRotation + ',\n' + " 'rotation': " + p2.rotation + ',\n' + " 'width': " + p1.width + ',\n' + " 'x': " + p2.x + ',\n' + " 'y': " + p2.y + '\n' + " },\n"; } tanss += ' ]\n' + ' },\n' return(tanss) } /* In edition mode arrow keys allow the move by 1 pixels in any direction */ function processPressedKey(event) { if ( items.editionMode && items.selectedItem && items.selectedItem.selected) { /* Move the player */ switch (event.key) { case Qt.Key_Right: items.selectedItem.x += 1 event.accepted = true break case Qt.Key_Left: items.selectedItem.x -= 1 event.accepted = true break case Qt.Key_Up: items.selectedItem.y -= 1 event.accepted = true break case Qt.Key_Down: items.selectedItem.y += 1 event.accepted = true break } } }
"use strict"; //Singleton pattern for things context exports.emitter = (function () { // Instance stores a reference to the Singleton var instance; function init() { // Singleton // Private methods and variables var EventEmitter = require('events').EventEmitter; var eventEmitter = new EventEmitter(); return { // Public methods and variables getEmitter: function(){ return eventEmitter; } }; }; return { // Get the Singleton instance if one exists // or create one if it doesn't getInstance: function () { if ( !instance ) { instance = init(); } return instance; } }; })();
Parkings = new Meteor.Collection("parkings");
'use strict'; const BaseController = require('../controllers/base'); const UploadModel = require('../models/file-upload'); const config = require('../../../config'); const uuid = require('uuid'); const path = require('path'); module.exports = class UploadController extends BaseController { get(req, res, next) { const docs = req.sessionModel.get('existing-authority-documents') || []; if (docs.length) { this.emit('complete', req, res); } super.get(req, res, next); } process(req, res, next) { const file = req.files['existing-authority-upload']; if (file && file.truncated) { const err = new this.ValidationError('existing-authority-upload', { type: 'filesize', arguments: [config.upload.maxfilesize] }, req, res); return next({ 'existing-authority-upload': err }); } if (file && file.data && file.data.length) { req.form.values['existing-authority-filename'] = file.name; const model = new UploadModel(file); return model.save() .then(result => { req.form.values['existing-authority-upload'] = result.url; req.form.values['existing-authority-type'] = file.mimetype; }) .then(() => next()) .catch(e => { if (e.code === 'FileExtensionNotAllowed') { const err = new this.ValidationError('existing-authority-upload', { type: 'filetype', arguments: [path.extname(file.name)] }, req, res); return next({ 'existing-authority-upload': err }); } return next(e); }); } return next(); } saveValues(req, res, next) { const files = req.sessionModel.get('existing-authority-documents') || []; files.push({ id: uuid.v1(), url: req.form.values['existing-authority-upload'], description: req.form.values['existing-authority-description'] || req.form.values['existing-authority-filename'], type: req.form.values['existing-authority-type'] }); req.sessionModel.set('existing-authority-documents', files); const existingAuthorityAttrs = [ 'existing-authority-add-another', 'existing-authority-description', 'existing-authority-filename', 'existing-authority-upload', 'existing-authority-type' ]; super.saveValues(req, res, err => { req.sessionModel.unset(existingAuthorityAttrs); next(err); }); } };
import { useEffect, useRef } from "react"; import { PropTypes } from "prop-types"; import { useCodeMirror } from "./hook/useCodeMirror"; export function Code({ whenReady, ...props }) { const editorRef = useRef(null); const editor = useCodeMirror({ target: editorRef, ...props }); useEffect(() => { if (editor) { if (whenReady) { whenReady(editor); } } }, [editor]); return ( <div ref={editorRef} style={{ height: "100%", minHeight: props.autoHeight && props.minHeight, }} ></div> ); } Code.propTypes = { lang: PropTypes.string, value: PropTypes.string, readOnly: PropTypes.bool, fold: PropTypes.bool, autoHeight: PropTypes.bool, minHeight: PropTypes.string, maxHeight: PropTypes.string, lineNumbers: PropTypes.bool, whenReady: PropTypes.func, };
var mongoose = require('mongoose'); var Schema = mongoose.Schema; var StationsSchema = new Schema({ Station_No: { type: String, required: true }, Longitude: { type: String, required: false }, Latitude: { type: String, required: false }, Catchment_Area: { type: Number, required: false }, Place: { type: String, required: false }, Data_Available: { type: String, required: false } }); var model = mongoose.model('Stations', StationsSchema); module.exports = model;
//Charge les élements du jeu1 var a = 5; require('Sprite.js', function() { require('cssFunction.js', function() { require('Ligne.js', function() { require('Tableau.js', function() { require('Cadre.js', function() { require('Bouton.js', function() { require('donneesServeur.js', function(){ require('Message.js', function(){ require('client.js', function() { alert(donnees + "jeu1"); document.body.style.backgroundColor = '#D1D12C'; // Cadre message reçu var ligneRecuEnTete = new Ligne(13); var ligneRecuBits= new Ligne(13); var tableauMessageRecu = new Tableau("Message recu()"); tableauMessageRecu.addLigne(ligneRecuEnTete.Element); tableauMessageRecu.addLigne(ligneRecuBits.Element); var cadreMessageRecu = new Cadre(null, null, null, "20px","20px"); cadreMessageRecu.addTableau(tableauMessageRecu.Element); var rec_bouton_envoyer_s = new Bouton("Envoyer au suivant", "-170px", "0px", "bas-droite", "160px", "27px"); var rec_bouton_envoyer_p = new Bouton("Envoyer au précédent", "10px", "0px", "bas-gauche", "160px", "27px"); cadreMessageRecu.addBouton(rec_bouton_envoyer_s); cadreMessageRecu.addBouton(rec_bouton_envoyer_p); // Cadre créer un message var ligneCreerEnTete = new Ligne(13); var ligneCreerBits = new Ligne(13); var creer_message = new Tableau("Créer un message()"); creer_message.addLigne(ligneCreerEnTete.Element); creer_message.addLigne(ligneCreerBits.Element); var cadreMessageCree = new Cadre(null, null, null, "20px","200px"); cadreMessageCree.addTableau(creer_message.Element); var creer_bouton_envoyer_s = new Bouton("Envoyer au suivant", "-170px", "0px", "bas-droite", "160px", "27px"); var creer_bouton_envoyer_p = new Bouton("Envoyer au précédent", "10px", "0px", "bas-gauche", "160px", "27px"); cadreMessageCree.addBouton(creer_bouton_envoyer_s); cadreMessageCree.addBouton(creer_bouton_envoyer_p); // Créer sablier animé var sablier = new Sprite('sablier_sprite.png', 13, 1000, 30, 40, null, 500, 50); sablier.jouer(); var eventMessageRecuSuivant = function(){ donnees.recus.destinataire[0] = "suivant"; envoyerR(); ligneRecuEnTete.fill_0(); //la ligne à 0 ligneRecuBits.fill_0(); //la ligne à 0 ligneRecuEnTete.afficherMessage(donnees.recus.enTete[0]); ligneRecuBits.afficherMessage(donnees.recus.Bits[0]); };//end function eventMessageRecuSuivant var eventMessageRecuPrecedent = function(){ donnees.recus.destinataire[0] = "precedent"; envoyerR(); ligneRecuEnTete.fill_0(); //la ligne à 0 ligneRecuBits.fill_0(); //la ligne à 0 ligneRecuEnTete.afficherMessage(donnees.recus.enTete[0]); ligneRecuBits.afficherMessage(donnees.recus.Bits[0]); };//end function eventMessageRecuSuivant var eventMessageCreeSuivant = function(){ donnees.creer.destinataire = "suivant"; envoyerC(); ligneCreerEnTete.fill_0(); //la ligne à 0 ligneCreerBits.fill_0(); //la ligne à 0 };//end function eventMessageRecuSuivant var eventMessageCreePrecedent = function(){ donnees.recus.destinataire = "precedent"; envoyerC(); ligneRecuEnTete.fill_0(); //la ligne à 0 ligneCreerBits.fill_0(); //la ligne à 0 };//end function eventMessageRecuSuivant // Envoyer un message reçu var envoyerR = function(){ MessagePourServeur.remove(); MessagePourServeur.type = "jeu1"; MessagePourServeur.enTete = donnees.recus.enTete[0]; MessagePourServeur.bits = donnees.recus.bits[0]; MessagePourServeur.identifiant = donnees.recus.identifiant[0]; MessagePourServeur.destinataire = donnees.recus.destinataire[0]; var myJSON = MessagePourServeur.stringify(MessagePourServeur); ws.send(myJSON); donnees.recus.enTete.splice(0,1); //on supprime le message envoyé donnees.recus.bits.splice(0,1); //on supprime le message envoyé donnees.recus.identifiant.splice(0,1); //on supprime le message envoyé donnees.recus.destinataire.splice(0,1); //on supprime le message envoyé //maSocket.nombreMessages -= 1; //Message_recu.changerTitre("Message reçus("+maSocket.nombreMessages+")"); }; // Envoyer un message cree var envoyerC = function(){ alert('8'); MessagePourServeur.remove(); MessagePourServeur.type = "jeu1"; MessagePourServeur.enTete = ligneCreerEnTete.stringEtats; MessagePourServeur.bits = ligneCreerBits.stringEtats; MessagePourServeur.destinataire = donnees.recus.destinataire[0]; var myJSON = MessagePourServeur.stringify(MessagePourServeur); alert('ws.send(myJSON);'); ws.send(myJSON); //maSocket.nombreMessages -= 1; //Message_recu.changerTitre("Message reçus("+maSocket.nombreMessages+")"); }; creer_bouton_envoyer_s.addFunctionOnclick(eventMessageCreeSuivant); creer_bouton_envoyer_p.addFunctionOnclick(eventMessageCreePrecedent); rec_bouton_envoyer_s.addFunctionOnclick(eventMessageRecuSuivant); rec_bouton_envoyer_p.addFunctionOnclick(eventMessageRecuPrecedent); });// donneesServeur.js });// Message.js }); //cssFunction.js }); //Nsocket.js }); //Ligne.js }); //Tableau.js }); //Cadre.js }); //Bouton.js }); //client.js
function newId(){ return '-' + Math.random().toString(36).substr(2, 9); }
/** * AvaTax Brazil * The Avatax-Brazil API exposes the most commonly services available for interacting with the AvaTax-Brazil services, allowing calculation of taxes, issuing electronic invoice documents and modifying existing transactions when allowed by tax authorities. This API is exclusively for use by business with a physical presence in Brazil. * * OpenAPI spec version: 1.0 * * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. * */ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['ApiClient'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. module.exports = factory(require('../ApiClient')); } else { // Browser globals (root is window) if (!root.AvaTaxBrazil) { root.AvaTaxBrazil = {}; } root.AvaTaxBrazil.InlineResponse200 = factory(root.AvaTaxBrazil.ApiClient); } }(this, function(ApiClient) { 'use strict'; /** * The InlineResponse200 model module. * @module model/InlineResponse200 * @version 1.0 */ /** * Constructs a new <code>InlineResponse200</code>. * @alias module:model/InlineResponse200 * @class */ var exports = function() { var _this = this; }; /** * Constructs a <code>InlineResponse200</code> from a plain JavaScript object, optionally creating a new instance. * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not. * @param {Object} data The plain JavaScript object bearing properties of interest. * @param {module:model/InlineResponse200} obj Optional instance to populate. * @return {module:model/InlineResponse200} The populated <code>InlineResponse200</code> instance. */ exports.constructFromObject = function(data, obj) { if (data) { obj = obj || new exports(); if (data.hasOwnProperty('token')) { obj['token'] = ApiClient.convertToType(data['token'], 'String'); } if (data.hasOwnProperty('expired')) { obj['expired'] = ApiClient.convertToType(data['expired'], 'Date'); } } return obj; } /** * @member {String} token */ exports.prototype['token'] = undefined; /** * @member {Date} expired */ exports.prototype['expired'] = undefined; return exports; }));
(function () { 'use strict'; angular.module('app.admin.survey', [ 'app.core', 'app.widgets' ]); })();
(function() { 'use strict'; angular .module('gatewayApp') .factory('LoginService', LoginService); LoginService.$inject = ['$uibModal']; function LoginService ($uibModal) { var service = { open: open }; var modalInstance = null; var resetModal = function () { modalInstance = null; }; return service; function open () { if (modalInstance !== null) return; modalInstance = $uibModal.open({ animation: true, templateUrl: 'app/components/login/login.html', controller: 'LoginController', controllerAs: 'vm' }); modalInstance.result.then( resetModal, resetModal ); } } })();
/* Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ CKEDITOR.plugins.setLang( 'maximize', 'lv', { maximize: 'Maksimizēt', minimize: 'Minimizēt' } );
"use strict"; tutao.provide('tutao.entity.tutanota.FileDataDataGet'); /** * @constructor * @param {Object=} data The json data to store in this entity. */ tutao.entity.tutanota.FileDataDataGet = function(data) { if (data) { this.updateData(data); } else { this.__format = "0"; this._base64 = null; this._file = null; } this._entityHelper = new tutao.entity.EntityHelper(this); this.prototype = tutao.entity.tutanota.FileDataDataGet.prototype; }; /** * Updates the data of this entity. * @param {Object=} data The json data to store in this entity. */ tutao.entity.tutanota.FileDataDataGet.prototype.updateData = function(data) { this.__format = data._format; this._base64 = data.base64; this._file = data.file; }; /** * The version of the model this type belongs to. * @const */ tutao.entity.tutanota.FileDataDataGet.MODEL_VERSION = '8'; /** * The encrypted flag. * @const */ tutao.entity.tutanota.FileDataDataGet.prototype.ENCRYPTED = true; /** * Provides the data of this instances as an object that can be converted to json. * @return {Object} The json object. */ tutao.entity.tutanota.FileDataDataGet.prototype.toJsonData = function() { return { _format: this.__format, base64: this._base64, file: this._file }; }; /** * The id of the FileDataDataGet type. */ tutao.entity.tutanota.FileDataDataGet.prototype.TYPE_ID = 331; /** * The id of the base64 attribute. */ tutao.entity.tutanota.FileDataDataGet.prototype.BASE64_ATTRIBUTE_ID = 333; /** * The id of the file attribute. */ tutao.entity.tutanota.FileDataDataGet.prototype.FILE_ATTRIBUTE_ID = 334; /** * Sets the format of this FileDataDataGet. * @param {string} format The format of this FileDataDataGet. */ tutao.entity.tutanota.FileDataDataGet.prototype.setFormat = function(format) { this.__format = format; return this; }; /** * Provides the format of this FileDataDataGet. * @return {string} The format of this FileDataDataGet. */ tutao.entity.tutanota.FileDataDataGet.prototype.getFormat = function() { return this.__format; }; /** * Sets the base64 of this FileDataDataGet. * @param {boolean} base64 The base64 of this FileDataDataGet. */ tutao.entity.tutanota.FileDataDataGet.prototype.setBase64 = function(base64) { this._base64 = base64 ? '1' : '0'; return this; }; /** * Provides the base64 of this FileDataDataGet. * @return {boolean} The base64 of this FileDataDataGet. */ tutao.entity.tutanota.FileDataDataGet.prototype.getBase64 = function() { return this._base64 != '0'; }; /** * Sets the file of this FileDataDataGet. * @param {Array.<string>} file The file of this FileDataDataGet. */ tutao.entity.tutanota.FileDataDataGet.prototype.setFile = function(file) { this._file = file; return this; }; /** * Provides the file of this FileDataDataGet. * @return {Array.<string>} The file of this FileDataDataGet. */ tutao.entity.tutanota.FileDataDataGet.prototype.getFile = function() { return this._file; }; /** * Loads the file of this FileDataDataGet. * @return {Promise.<tutao.entity.tutanota.File>} Resolves to the loaded file of this FileDataDataGet or an exception if the loading failed. */ tutao.entity.tutanota.FileDataDataGet.prototype.loadFile = function() { return tutao.entity.tutanota.File.load(this._file); }; /** * Provides the entity helper of this entity. * @return {tutao.entity.EntityHelper} The entity helper. */ tutao.entity.tutanota.FileDataDataGet.prototype.getEntityHelper = function() { return this._entityHelper; };
namespace("automata.games.robot", function (exports) { "use strict"; exports.RightAndAhead = { key: "automata.games.robot.RightAndAhead", view: exports.WorldView, world: exports.World.create({ width: 600, height: 400, walls: [], startX: 300, startY: 50, goalX: 300, goalY: 350, goalRadius: 15 }) }; });
'use strict'; var gulp = require('gulp'); var gutil = require('gulp-util'); var rename = require('gulp-rename'); var concat = require('gulp-concat'); // Style Dependencies var sass = require('gulp-sass'); var autoprefixer = require('gulp-autoprefixer'); var minify = require('gulp-minify-css'); // Js Dependencies var uglify = require('gulp-uglify'); var jquery = './node_modules/jquery/dist/jquery.js'; var typedJs = './node_modules/typed.js/lib/typed.js'; //ASSETS var sassFiles = './assets/sass/**/*.scss'; var jsFiles = './assets/js/**/*.js'; //TASKS gulp.task('css', function() { var scss = gulp.src(sassFiles) .pipe(sass({ includePaths: require('node-normalize-scss').includePaths }).on('error', sass.logError)) .pipe(autoprefixer()) .pipe(concat('main.css')) .pipe(minify()) .pipe(gulp.dest('./css')); }); gulp.task('js', function() { return gulp.src([jquery, typedJs, jsFiles]) .pipe(concat('main.js')) .pipe(gulp.dest('./js')) .pipe(rename('main.min.js')) .pipe(uglify()) .pipe(gulp.dest('./js')); }); gulp.task('watch', function() { gulp.watch(sassFiles, ['css']); gulp.watch(jsFiles, ['js']); }); gulp.task('default', ['css', 'js', 'watch']);
/************************************************************************ * This file is part of EspoCRM. * * EspoCRM - Open Source CRM application. * Copyright (C) 2014 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko * Website: http://www.espocrm.com * * EspoCRM is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * EspoCRM is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with EspoCRM. If not, see http://www.gnu.org/licenses/. ************************************************************************/ Espo.define('Views.ScheduledJob.List', 'Views.List', function (Dep) { return Dep.extend({ searchPanel: false, setup: function () { Dep.prototype.setup.call(this); this.createView('search', 'Base', { el: '#main > .search-container', template: 'scheduled-job.cronjob' }); }, afterRender: function () { Dep.prototype.afterRender.call(this); $.ajax({ type: 'GET', url: 'Admin/action/cronMessage', error: function (x) { }.bind(this) }).done(function (data) { this.$el.find('.cronjob .message').html(data.message); this.$el.find('.cronjob .command').html('<strong>' + data.command + '</strong>'); }.bind(this)); }, }); });
import { LOCATION_SUCCESS } from '../actions/location' // login reducer export default function location(state = null, action) { if (action.type == LOCATION_SUCCESS) { return action.response; } return state; }
/*! * Ext JS Library 3.4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ Ext.onReady(function(){ var tabs = new Ext.TabPanel({ renderTo:'tabs', resizeTabs:true, // turn on tab resizing minTabWidth: 115, tabWidth:135, enableTabScroll:true, width:600, height:250, defaults: {autoScroll:true}, plugins: new Ext.ux.TabCloseMenu() }); // tab generation code var index = 0; while(index < 7){ addTab(); } function addTab(){ tabs.add({ title: 'New Tab 测试 ' + (++index), iconCls: 'tabs', html: 'Tab Body ' + (index) + '<br/><br/>' + Ext.example.bogusMarkup, closable:true }).show(); } new Ext.Button({ text: 'Add Tab', handler: addTab, iconCls:'new-tab' }).render(document.body, 'tabs'); });
function removerreserva(id) { $.get("/reservaja/removerreserva?", { 'id' : id }, function() { $("#res" + id).remove(); }); }
define( "dojo/cldr/nls/bs/chinese", //begin v1.x content { "field-second-relative+0": "sada", "field-quarter-relative+-1": "posljednji kvartal", "field-weekday": "dan u sedmici", "field-mon-narrow-relative+0": "ovaj pon.", "field-mon-narrow-relative+1": "sljedeći pon.", "field-weekOfMonth-short": "sed. u mj.", "field-weekday-short": "dan u sed.", "field-wed-relative+0": "ova srijeda", "field-wed-relative+1": "sljedeća srijeda", "field-dayperiod-short": "prijepodne/poslijepodne", "field-week-short": "sed.", "field-tue-relative+-1": "prošli utorak", "field-year-short": "god.", "field-era-narrow": "era", "field-thu-narrow-relative+-1": "prošli čet.", "field-hour-relative+0": "ovaj sat", "field-quarter-narrow": "kv.", "field-fri-relative+-1": "prošli petak", "field-hour-short": "h", "field-wed-relative+-1": "prošla srijeda", "field-dayOfYear": "dan u godini", "field-mon-short-relative+-1": "prošli pon.", "field-thu-relative+-1": "prošli četvrtak", "field-era": "era", "field-sat-narrow-relative+0": "ova sub.", "field-sat-narrow-relative+1": "sljedeća sub.", "field-year": "godina", "field-hour": "sat", "field-sat-relative+0": "ova subota", "field-sat-relative+1": "sljedeća subota", "field-sat-short-relative+-1": "prošla sub.", "field-weekOfMonth-narrow": "s. u mj.", "field-minute-narrow": "min.", "field-day-relative+0": "danas", "field-day-relative+1": "sutra", "field-thu-relative+0": "ovaj četvrtak", "field-mon-narrow-relative+-1": "prošli pon.", "field-day-relative+2": "prekosutra", "field-wed-narrow-relative+0": "ova sri.", "field-thu-relative+1": "sljedeći četvrtak", "field-wed-narrow-relative+1": "sljedeća sri.", "field-mon-short-relative+0": "ovaj pon.", "field-mon-short-relative+1": "sljedeći pon", "field-weekdayOfMonth-short": "dan u mj.", "field-wed-short-relative+-1": "prošla sri.", "field-fri-narrow-relative+-1": "prošli pet.", "field-hour-narrow": "h", "field-tue-short-relative+0": "ovaj uto.", "field-year-narrow": "g.", "field-tue-short-relative+1": "sljedeći uto.", "field-minute-short": "min.", "field-day-narrow": "dan", "field-wed-short-relative+0": "ova sri.", "field-wed-short-relative+1": "sljedeća sri.", "field-sun-relative+0": "ova nedjelja", "field-sun-relative+1": "sljedeća nedjelja", "field-minute": "minuta", "field-month-short": "mj.", "field-dayperiod": "prijepodne/poslijepodne", "field-weekdayOfMonth-narrow": "d. u mj.", "field-day-relative+-1": "jučer", "field-day-relative+-2": "prekjučer", "field-minute-relative+0": "ova minuta", "field-week-narrow": "sed.", "field-wed-narrow-relative+-1": "prošla sri.", "field-day-short": "dan", "field-quarter-relative+0": "ovaj kvartal", "field-dayperiod-narrow": "prijepodne/poslijepodne", "field-quarter-relative+1": "sljedeći kvartal", "field-zone-short": "zona", "field-fri-relative+0": "ovaj petak", "field-fri-relative+1": "sljedeći petak", "field-day": "dan", "field-second-narrow": "s", "field-zone": "vremenska zona", "field-year-relative+-1": "prošle godine", "field-month-relative+-1": "prošli mjesec", "field-thu-short-relative+0": "ovaj čet.", "field-thu-short-relative+1": "sljedeći čet.", "field-weekday-narrow": "dan u sed.", "field-quarter": "kvartal", "field-zone-narrow": "zona", "field-month": "mjesec", "field-weekOfMonth": "sedmica u mjesecu", "field-tue-relative+0": "ovaj utorak", "field-tue-relative+1": "sljedeći utorak", "field-fri-narrow-relative+0": "ovaj pet.", "field-fri-narrow-relative+1": "sljedeći pet.", "field-fri-short-relative+-1": "prošli pet.", "field-sun-narrow-relative+-1": "prošla ned.", "field-dayOfYear-short": "dan u god.", "field-sun-narrow-relative+0": "ova ned.", "field-thu-narrow-relative+0": "ovaj čet.", "field-sun-narrow-relative+1": "sljedeća ned.", "field-thu-narrow-relative+1": "sljedeći čet.", "field-tue-narrow-relative+0": "ovaj uto.", "field-mon-relative+0": "ovaj ponedjeljak", "field-tue-narrow-relative+1": "sljedeći uto.", "field-mon-relative+1": "sljedeći ponedjeljak", "field-tue-narrow-relative+-1": "prošli uto.", "field-second-short": "sek.", "field-second": "sekunda", "field-fri-short-relative+0": "ovaj pet.", "field-sat-relative+-1": "prošla subota", "field-fri-short-relative+1": "sljedeći pet.", "field-sun-relative+-1": "prošla nedjelja", "field-month-relative+0": "ovaj mjesec", "field-weekdayOfMonth": "dan u mjesecu", "field-month-relative+1": "sljedeći mjesec", "field-week": "sedmica", "field-sat-short-relative+0": "ova sub.", "field-sat-short-relative+1": "sljedeća sub.", "field-year-relative+0": "ove godine", "field-week-relative+-1": "prošle sedmice", "field-year-relative+1": "sljedeće godine", "field-era-short": "era", "field-quarter-short": "kv.", "field-dayOfYear-narrow": "dan u g.", "field-sun-short-relative+-1": "prošla ned.", "field-thu-short-relative+-1": "prošli čet.", "field-tue-short-relative+-1": "prošli uto.", "field-mon-relative+-1": "prošli ponedjeljak", "field-sat-narrow-relative+-1": "prošla sub.", "field-month-narrow": "mj.", "field-week-relative+0": "ove sedmice", "field-sun-short-relative+0": "ova ned.", "field-week-relative+1": "sljedeće sedmice", "field-sun-short-relative+1": "sljedeća ned." } //end v1.x content );
/** * @author mpm1 * * Requires jQuery */ function CwrcAnnotion(url, jq){ if (!jq) { jq = $; } // Public Functions this.searchAnnotion = function(searchObject){ // TODO: Should we search on annotations? } this.getAnnotaion = function(pid){ var result = result; jq.ajax({ url : url + '/annotation/' + pid, type : 'GET', async : false, success : function(data) { result = data; }, error : function(error) { result = error; } }); return result; } this.newAnnotation = function(data) { var result = result; jq.ajax({ url : url + '/annotation', type : 'POST', data : { method : 'post', data: data }, async : false, success : function(data) { result = data; }, error : function(error) { result = error; } }); return jq.parseJSON(result); } this.modifyAnnotation = function(pid, data) { var result = result; jq.ajax({ url : url + '/annotation/' + pid, type : 'POST', data : { method : 'put', data: data }, async : false, success : function(data) { result = data; }, error : function(error) { result = error; } }); return jq.parseJSON(result); } this.deleteAnnotation = function(pid) { var result = result; jq.ajax({ url : url + '/annotation/' + pid, type : 'POST', async : false, data: { method: 'delete' }, success : function(data) { result = data; }, error : function(error) { result = error; } }); return jq.parseJSON(result); } } function CwrcEntity(type, url, jq) { if (!jq) { jq = $; } // Public Functions this.searchEntity = function(searchObject){ var limit = searchObject.limit !== undefined ? searchObject.limit : 100; var page = searchObject.page !== undefined ? searchObject.page : 0; var restrictions = searchObject.restrictions !== undefined ? searchObject.restrictions : []; return jq.ajax({ url : url + '/' + type + "/search", type : 'GET', async : true, data: { query: searchObject.query, limit: limit, page: page, restrictions: restrictions }, success : function(data) { result = data === "" ? {} : JSON.parse(data); searchObject.success(result); }, error : function(error) { searchObject.error(error); } }); } this.getEntity = function(pid) { var result = result; jq.ajax({ url : url + '/' + type + "/" + pid, type : 'GET', async : false, success : function(data) { result = data; }, error : function(error) { result = error; } }); return result; } this.newEntity = function(data) { var result = result; jq.ajax({ url : url + '/' + type, type : 'POST', data : { method : 'post', data: data }, async : false, success : function(data) { result = data; }, error : function(error) { result = error; } }); return jq.parseJSON(result); } this.modifyEntity = function(pid, data) { var result = result; jq.ajax({ url : url + '/' + type + '/' + pid, type : 'POST', data : { method : 'put', data: data }, async : false, success : function(data) { result = data; }, error : function(error) { result = error; } }); return jq.parseJSON(result); } this.deleteEntity = function(pid) { var result = result; jq.ajax({ url : url + '/' + type + "/" + pid, type : 'POST', async : false, data: { method: 'delete' }, success : function(data) { result = data; }, error : function(error) { result = error; } }); return jq.parseJSON(result); } this.listEntity = function(totalPerPage, page){ alert("Page " + page); } } function CwrcApi(url, jq) { if (!jq) { jq = $; } // Class creation if (!url.indexOf("/", this.length - 1) !== -1) { url = url + "/"; } // Private variables var _this = this; // Public variables this.person = new CwrcEntity('person', url, jq); this.organization = new CwrcEntity('organization', url, jq); this.title = new CwrcEntity('title', url, jq); //this.event = new CwrcEntity('event', url, jq); <- Can we use event or is that a javascript keyword? this.place = new CwrcEntity('place', url, jq); this.annotation = new CwrcAnnotion(url, jq); this.isInitialized = false; // Private functions this.updateIsInitialized = function(){ jq.ajax({ url : url + "is_initialized", type : 'POST', data : { name : name }, success : function(data) { _this.isInitialized = JSON.parse(data).result; }, error : function(error) { result = error; _this.isInitialized = false; } }); } // Public functions /** * Initialize the data using a set of existing cookies. * var name The cookie to obtaine the information from */ this.initializeWithCookieData = function(data) { var result = result; jq.ajax({ url : url + "initialize_cookie", type : 'POST', async : false, data : { data: data }, success : function(data) { result = data; _this.isInitialized = true; }, error : function(error) { result = error; } }); return result; } this.initializeWithLogin = function(username, password) { var result = result; jq.ajax({ url : url + "initialize_user", type : 'POST', async : false, data : { username : username, password : password }, success : function(data) { result = data; _this.isInitialized = true; }, error : function(error) { result = error; } }); return result; } this.logout = function() { var result = result; if (!_this.isInitialized()) { jq.ajax({ url : url + "logout", type : 'POST', async : false, success : function(data) { result = data; }, error : function(error) { result = error; } }); } _this.isInitialized = false; return result; } this.updateIsInitialized(); return this; }
angular.module('resource', ['ngResource', 'app']) // service for Items .factory('Item', ['$http', '$resource', 'HostSvc', function($http, $resource, HostSvc) { /* Item is an Object in IPFS terms For a context, the Item stores the following { "Data": ...name of context, "Links": [ {"Name": ...page name, "Hash": ...hash of page} ] } For a page, the Item stores the following { "Data": ...content of page in markdown, "Links": [ {"Name": ...datestamp of previous version, "Hash": ...hash of previous context} ] } */ var Item = $resource(HostSvc.getHostUrl() + 'get/:hash', {hash:'@hash'}, { get: { method: 'POST', cache: true }, save: { method: 'POST', headers: { 'Content-Type': 'multipart/form-data; boundary=a831rwxi1a3gzaorw1w2z49dlsor' }, transformRequest: function (data) { return '--a831rwxi1a3gzaorw1w2z49dlsor\nContent-Type: application/json\n\n' + angular.toJson(data) + '\n\n--a831rwxi1a3gzaorw1w2z49dlsor--'; }, url: HostSvc.getHostUrl() + 'put/' } }); return Item; }]) .config(['$resourceProvider', function($resourceProvider) { $resourceProvider.defaults.stripTrailingSlashes = false; }]) ;
function remoteMathService(cb) { var one, two; //queue our promises to resolve after they actually execute Promise.all([callOneService,callTwoService]).then(responses => { one = responses[0]; two = responses[1]; //maintained the existing logic with the callback return cb(undefined, one + two); }, function(err){ console.log("error happened"); }); } //make our service calls promises, so they can resolve asynchronously //uncomment the console.logs to see the order in which these Promises //get executed const callOneService = new Promise(resolve => { setTimeout(function() { //console.log("in func 1"); resolve(1); }, 1000); } ) const callTwoService = new Promise(resolve => { setTimeout(function() { //console.log("in func 2"); resolve(2); }, 1500); }) //returns a promise that we can tie into either as a service return or for testing remoteMathService(function(err, answer) { if (err) console.log("error ", err); if (answer !== 3) { console.log("wrong answer", answer); return new Promise(resolve =>{ resolve("wrong answer"); }); } else { console.log("correct"); return new Promise(resolve =>{ resolve("correct"); }); } });
var FitoTab = Class.create(); FitoTab.prototype = { element: null, options: {}, trs: [], bgcolors: [], choosed_colors: [], allchecked: false, initialize: function(element) { var element = $(element); try { var options = { element: element, hoverColor: '#FFFFCC', selectedColor: '#FFFFCC', trIDPrefix: 'tr' }; if (arguments[1]) Object.extend(options, arguments[1] || {}); this.options = options; } catch(err){ }; if (element && element.tagName == "TABLE") { this.trs = element.getElementsByTagName("tr"); } }, create: function() { if (!this.options.element) return false; callerObj = this; for (var i=0; i < this.trs.length; i++) { var tr = this.trs[i]; if (tr.id.indexOf(this.options.trIDPrefix) == 0) { var id = parseInt(tr.id.replace(this.options.trIDPrefix + '_', '')); this.bgcolors[id] = tr.style.backgroundColor; // // Over table row // tr.onmouseover = function(e) { var id = parseInt(this.id.replace(callerObj.options.trIDPrefix + '_', '')); if (!callerObj.choosed_colors[id]) { this.style.backgroundColor = callerObj.options.hoverColor; } }; // // Out table row // tr.onmouseout = function(e) { var id = parseInt(this.id.replace(callerObj.options.trIDPrefix + '_', '')); if (!callerObj.choosed_colors[id]) { this.style.backgroundColor = callerObj.bgcolors[id]; } }; // // Click check box // tr.onclick = function(e) { var event = (e || window.event); var element = (event.originalTarget || event.srcElement); if (element.tagName == "INPUT" && element.type == "checkbox") { var id = parseInt(this.id.replace(callerObj.options.trIDPrefix + '_', '')); this.style.backgroundColor = (element.checked) ? callerObj.options.selectedColor : callerObj.bgcolors[id]; callerObj.choosed_colors[id] = (element.checked) ? callerObj.options.selectedColor : null; } }; } } }, checkall: function() { if (!this.options.element) return false; var checked = (this.allchecked) ? false : true; this.allchecked = checked; for (var i=0; i < this.trs.length; i++) { var tr = this.trs[i]; if (tr.id.indexOf(this.options.trIDPrefix) == 0) { var inputs = tr.getElementsByTagName('input'); if (inputs[0].type == "checkbox" && inputs[0].disabled == true) continue; var id = parseInt(tr.id.replace(this.options.trIDPrefix + '_', '')); tr.style.backgroundColor = (checked) ? this.options.selectedColor : this.bgcolors[id]; this.choosed_colors[id] = (checked) ? this.options.selectedColor : null; } } }, SetColor: function(id) { try { $(this.trIDPrefix + '_' + id).style.backgroundColor = this.bgcolors[id]; } catch (err) { } }, setup: function() { this.options.prototype = { alternative: '_Webta_Settings' }; if (arguments[0]) Object.extend(this.options, arguments[0] || {}); if (!this.options.element) { this.options.element = $(this.options.alternative); var settings = true; } if (!this.options.element) return false; try { var tab = this.options.element; var rowHeight = 20; var Head = tab.getElementsByTagName("thead")[0]; var Body = tab.getElementsByTagName("tbody")[0]; var _tempPos = Position.cumulativeOffset(tab); var tabOffsetLeft = _tempPos[0]; var tabOffsetTop = _tempPos[1]; var tabHeight = this.GetWindowHeight() - tabOffsetTop - 55; // // set cells height // var cmlt = 0; for (var i = 0; i < tab.rows.length - 1; i++) { if (!i) { tab.rows[0].style.height = "10px"; tab.rows[0].style.padding = 0; } else { tab.rows[i].style.height = rowHeight + "px"; } cmlt += tab.rows[i].offsetHeight; } try { tab.rows[tab.rows.length - 1].style.height = tabHeight - cmlt + "px"; } catch (err2) { } finally { var wHead = (!settings) ? Head.offsetHeight : tab.rows[0].offsetHeight; var lastRow = tab.rows[tab.rows.length - 2]; var firstRow = tab.rows[1]; var w = 0; var lastNum = lastRow.cells.length - 1; for (var i = 0; i < firstRow.cells.length; i++) { firstRow.cells[i].style.borderTop = '1px solid #A2BBDD'; } for (var i = 1; i < tab.rows.length; i++) { if ((i % 2 == 0) && !settings && tab.rows[i].style.backgroundColor == "") { tab.rows[i].style.backgroundColor = '#F9FAFF'; } if (tab.rows[i].cells[0].className.indexOf("Part") == -1) tab.rows[i].cells[0].style.borderLeft = '1px solid #A2BBDD'; } if (settings) return false; for (var i = 0; i < lastRow.cells.length; i++) { w += lastRow.cells[i].offsetWidth; if ((lastNum > i && lastRow.cells[i+1].className == "Item") || (settings && !i)) { try { if ($("separator_" + i)) { $("separator_" + i).parentNode.removeChild($("separator_" + i)); } } catch (err) {} var div = document.createElement("div"); div.id = "separator_" + i; div.className = "vrule gutter"; div.style.left = tabOffsetLeft + w - 3 + 'px'; div.style.top = tabOffsetTop + wHead + 'px'; div.style.height = tab.offsetHeight - wHead - 1 + 'px'; document.body.appendChild(div); } } } } catch (err) {} }, GetWindowHeight: function() { return (window.innerHeight != undefined) ? window.innerHeight : document.documentElement.clientHeight; } }
/* Copyright Jesus Perez <jesusprubio gmail com> 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/>. */ 'use strict'; // Private stuff var credentialsJson = require('../artifacts/voipCredentials'), HELP = { description: 'Show common VoIP system default credentials', options: null }; // Public stuff module.exports.help = HELP; module.exports.run = function (options, callback) { callback(null, credentialsJson); };
$(document).ready(function(){ $("#slidetopcontentShower").click(function() { $("#slidetopcontent").slideToggle(); $(this).toggleClass("showed"); }); });
// Called each time there's new content window.tweak_content=function() { $('a:not(.internal-link, .anchor-link)').attr('target','_blank'); } // The "OnLoad" $(function() { $.manageAjax.create('flocks',{queue:true}); $('.flashes li').each(function() { $(this).prepend($('<a/>').attr('href','#').click(function() { $(this).parent().remove(); return false;}).addClass( 'internal-link important').append('<b/>').text('X')).css('opacity',.9)}); $('body').append($('<a/>').attr('id','top-link').attr('href','#').addClass('internal-link').click(function() { $('html,body').animate({scrollTop:0},'slow'); return false; }).html('&#11014; Top')); $('#feed-url, #flockshare').click(function() {$(this).select()}); $('.focusme:first').focus(); window.tweak_content(); if (window.SCROLLTO!=undefined && window.SCROLLTO) { $('html,body').animate({scrollTop: $("#"+window.SCROLLTO).offset().top-60},'slow'); } }); window.populate_from_feed=function(ul,data) { for (e in data['entries']) { if (e>=window.MAX_FEED_ENTRIES) { break; } entry=data['entries'][e]; feed_dir=entry['feed_rtl']?'rtl':'ltr'; var item_header=$('<div/>').addClass('toggler-label').addClass(feed_dir); item_header.append($('<div/>').addClass('item-time').text(entry['friendly_time'])); item_header.append($('<span/>').addClass('feed-reference').text(entry['feed_title']).append( window.BUTTON_HTML[entry['feed_url']])); item_header.append($('<a/>').addClass('entry-title').attr( 'href',entry['link']).html(entry['title'])); var toggler = $('<input/>').addClass('toggler').attr('type','checkbox'); if (window.EXPAND_ALL_ENTRIES) {toggler.attr('checked','checked');} var li=$('<li/>').attr('id',entry['id']).addClass('feed-entry').append(item_header).append(toggler); li.append($('<div/>').addClass('entry-description').addClass(feed_dir).html(entry['description'])); li.data('modified',entry['modified']); var sameold=ul.find('#'+li.attr('id')); if (sameold.length) { // if it's hard to find out whether a checkbox is checked, might as well take the whole element :) li.find('input.toggler').replaceWith(sameold.find('input.toggler')); sameold.replaceWith(li); } else { var older=ul.find('li').filter(function() { return $(this).data('modified')<li.data('modified'); }); if (older.length) { older.eq(0).before(li); } else { ul.append(li); } }; ul.children(':gt('+(window.MAX_PAGE_ENTRIES-1)+')').remove(); } } window.fetch_from_feed=function(ul_id,feed_title,feed_url) { var ul=$('#'+ul_id); var loading=$('<li/>').addClass('fetching-ajax').html(AJAX_LOADER_HTML).append(feed_title).data('modified',''); $('#loading-list').append(loading); $.manageAjax.add('flocks',{ url:window.AJAX_FEED_URL, type:'POST', data:{url:feed_url}, ul:ul, refresh:"window.fetch_from_feed('"+ul_id+"','"+feed_title+"','"+feed_url+"')", refresh_seconds:1000*window.FEED_REFRESH_SECONDS, loading:loading, success:function(data,textStatus,xhr,options){ options['loading'].slideUp(500).remove(); populate_from_feed(options['ul'],data); window.tweak_content(); setTimeout(options['refresh'],options['refresh_seconds']); }, error:function(data,textStatus,xhr,options){ options['loading'].find('img').replaceWith('Failed! '); options['loading'].prependTo($('#loading-list')).addClass( 'hilite').click(function() {$(this).slideUp(1000).remove();}); setTimeout(options['refresh'],options['refresh_seconds']); }, abort:function(data,textStatus,xhr,options){ options['loading'].find('img').replaceWith('Aborted! '); options['loading'].prependTo($('#loading-list')).addClass( 'hilite').click(function() {$(this).slideUp(1000).remove();}); setTimeout(options['refresh'],options['refresh_seconds']); } }); } window.abort_all_fetches = function() { $.manageAjax.clear('flocks'); $('.fetching-ajax').slideUp(500).remove(); }
import React, { Component } from 'react'; import BottomPart from '../../planting/BottomPart'; import Article from '../../planting/customPlantPage/Article'; import ArticleDesc from '../../planting/customPlantPage/ArticleDesc'; import ButtonBar from './ButtonBar'; export default class PlantCustom extends Component { constructor() { super(); this.state = { overallPrice: 0 }; this.updatePrice = this.updatePrice.bind(this); } updatePlantBag() { var projectItems = {}; for (var article in this.props.articles) { if (this.refs['article_' + article].getAmount() != null && this.refs['article_' + article].getAmount() > 0) { projectItems[this.props.articles[article].treeType.name] = { amount: parseInt(this.refs['article_' + article].getAmount()), price: parseInt(this.props.articles[article].price.priceAsLong), imageFile: this.props.articles[article].treeType.imageFile }; } } this.props.updatePlantBag(this.state.overallPrice, projectItems, this.props.projectName); } updatePrice() { var price = 0; for (var article in this.props.articles) { if (this.refs['article_' + article].getAmount() != null && this.refs['article_' + article].getAmount() > 0) { price = price + parseInt(this.refs['article_' + article].getAmount()) * parseInt(this.props.articles[article].price.priceAsLong); } } this.state.overallPrice = price; this.forceUpdate(); } render() { var that = this; return ( <div className="plantCustom"> <ButtonBar chosen={this.props.amount} setAmount={this.props.setAmount.bind(this)} /> <ArticleDesc /> <div className={'plantItems align-center'}> {this.props.articles.filter(article => (article.amount - article.alreadyPlanted) > 0).map(function(article, i) { return <Article key={i} article={article} ref={'article_' + i} updatePrice={that.updatePrice.bind(this)} />; })} </div> <BottomPart updatePlantBag={this.updatePlantBag.bind(this)} overallPrice={this.state.overallPrice} /> </div> ); } } /* vim: set softtabstop=2:shiftwidth=2:expandtab */
/** * Implementa el método fecha() que devuelva una fecha válida. Lanzará una excepción en caso contrario. * @author Jesús Mejías Leiva */ { function init() { try { date(); } catch (e) { console.log(e.message); } } // creo mi exception personalizada let dateNotValid = function(msg, name) { this.message = msg; this.name = name; }; let date = function() { let date = new Date("Diciembre 17, 1995 03:24:00"); if (date == "Invalid Date") { // creo mi un objeto con mi exception personalizada let dNotValid = new dateNotValid( "Fecha introducida, no válida", "Fecha no válida" ); // lanzo la exception throw dNotValid; } else { return date; } }; window.addEventListener("load", init); }
/* -*- 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/. */ var gTestfile = 'regress-435345-01.js'; //----------------------------------------------------------------------------- var BUGNUMBER = 435345; var summary = 'Watch the length property of arrays'; var actual = ''; var expect = ''; // see http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Object:watch //----------------------------------------------------------------------------- test(); //----------------------------------------------------------------------------- function test() { enterFunc ('test'); printBugNumber(BUGNUMBER); printStatus (summary); var arr; try { expect = 'watcher: propname=length, oldval=0, newval=1; '; actual = ''; arr = []; arr.watch('length', watcher); arr[0] = '0'; } catch(ex) { actual = ex + ''; } reportCompare(expect, actual, summary + ': 1'); try { expect = 'watcher: propname=length, oldval=1, newval=2; ' + 'watcher: propname=length, oldval=2, newval=2; '; actual = ''; arr.push(5); } catch(ex) { actual = ex + ''; } reportCompare(expect, actual, summary + ': 2'); try { expect = 'watcher: propname=length, oldval=2, newval=1; '; actual = ''; arr.pop(); } catch(ex) { actual = ex + ''; } reportCompare(expect, actual, summary + ': 3'); try { expect = 'watcher: propname=length, oldval=1, newval=2; '; actual = ''; arr.length++; } catch(ex) { actual = ex + ''; } reportCompare(expect, actual, summary + ': 4'); try { expect = 'watcher: propname=length, oldval=2, newval=5; '; actual = ''; arr.length = 5; } catch(ex) { actual = ex + ''; } reportCompare(expect, actual, summary + ': 5'); exitFunc ('test'); } function watcher(propname, oldval, newval) { actual += 'watcher: propname=' + propname + ', oldval=' + oldval + ', newval=' + newval + '; '; return newval; }
dojo.provide("dojox.layout.ContentPane"); dojo.require("dijit.layout.ContentPane"); dojo.require("dojox.html._base"); dojo.declare("dojox.layout.ContentPane", dijit.layout.ContentPane, { // summary: // An extended version of dijit.layout.ContentPane. // Supports infile scripts and external ones declared by <script src='' // relative path adjustments (content fetched from a different folder) // <style> and <link rel='stylesheet' href='..'> tags, // css paths inside cssText is adjusted (if you set adjustPaths = true) // // NOTE that dojo.require in script in the fetched file isn't recommended // Many widgets need to be required at page load to work properly // adjustPaths: Boolean // Adjust relative paths in html string content to point to this page. // Only useful if you grab content from a another folder then the current one adjustPaths: false, // cleanContent: Boolean // summary: // cleans content to make it less likely to generate DOM/JS errors. // description: // useful if you send ContentPane a complete page, instead of a html fragment // scans for // // * title Node, remove // * DOCTYPE tag, remove cleanContent: false, // renderStyles: Boolean // trigger/load styles in the content renderStyles: false, // executeScripts: Boolean // Execute (eval) scripts that is found in the content executeScripts: true, // scriptHasHooks: Boolean // replace keyword '_container_' in scripts with 'dijit.byId(this.id)' // NOTE this name might change in the near future scriptHasHooks: false, /*====== // ioMethod: dojo.xhrGet|dojo.xhrPost // reference to the method that should grab the content ioMethod: dojo.xhrGet, // ioArgs: Object // makes it possible to add custom args to xhrGet, like ioArgs.headers['X-myHeader'] = 'true' ioArgs: {}, ======*/ constructor: function(){ // init per instance properties, initializer doesn't work here because how things is hooked up in dijit._Widget this.ioArgs = {}; this.ioMethod = dojo.xhrGet; }, onExecError: function(e){ // summary: // event callback, called on script error or on java handler error // overide and return your own html string if you want a some text // displayed within the ContentPane }, _setContent: function(cont){ // override dijit.layout.ContentPane._setContent, to enable path adjustments var setter = this._contentSetter; if(! (setter && setter instanceof dojox.html._ContentSetter)) { setter = this._contentSetter = new dojox.html._ContentSetter({ node: this.containerNode, _onError: dojo.hitch(this, this._onError), onContentError: dojo.hitch(this, function(e){ // fires if a domfault occurs when we are appending this.errorMessage // like for instance if domNode is a UL and we try append a DIV var errMess = this.onContentError(e); try{ this.containerNode.innerHTML = errMess; }catch(e){ console.error('Fatal '+this.id+' could not change content due to '+e.message, e); } })/*, _onError */ }); }; // stash the params for the contentSetter to allow inheritance to work for _setContent this._contentSetterParams = { adjustPaths: Boolean(this.adjustPaths && (this.href||this.referencePath)), referencePath: this.href || this.referencePath, renderStyles: this.renderStyles, executeScripts: this.executeScripts, scriptHasHooks: this.scriptHasHooks, scriptHookReplacement: "dijit.byId('"+this.id+"')" }; this.inherited("_setContent", arguments); } // could put back _renderStyles by wrapping/aliasing dojox.html._ContentSetter.prototype._renderStyles });
const path = require('path'); const webpack = require('webpack'); const fs = require('fs'); const merge = require('webpack-merge'); const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); const base = require('./base.config'); module.exports = merge(base, { cache: true, entry: { index: ['whatwg-fetch'], }, module: { rules: [ { test: /\.jsx?$/, use: [ { loader: 'babel-loader', options: { cacheDirectory: true, }, }, 'if-loader', ], include: [path.join(__dirname, 'app')], }, ], }, plugins: [ new webpack.LoaderOptionsPlugin({ options: { 'if-loader': 'prod', // TODO: deprecated option, https://webpack.js.org/guides/migrating/#uglifyjsplugin-minimize-loadersminimize: true, minimize: true, }, }), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify('production'), TESTING_FONT: false, }, }), new UglifyJsPlugin({ sourceMap: true, include: __dirname, extractComments: true, }), /* new webpack.DllReferencePlugin({ context: __dirname, manifest: require('./dist/dll/libs-manifest'), sourceType: 'this', }), */ ], output: merge(base.output, { filename: '[name].bundle.js', chunkFilename: '[name].bundle.js', path: path.resolve(__dirname, 'dist'), }), });
/* @flow */ import {Writable as WritableStream} from 'stream'; import bunyan from 'bunyan'; import sinon from 'sinon'; import {it, describe} from 'mocha'; import {assert} from 'chai'; import {createLogger, ConsoleStream} from '../../../src/util/logger'; describe('logger', () => { describe('createLogger', () => { it('makes file names less redundant', () => { const createBunyanLog = sinon.spy(() => {}); createLogger('src/some-file.js', {createBunyanLog}); sinon.assert.calledWithMatch( createBunyanLog, {name: 'some-file.js'} ); }); }); describe('ConsoleStream', () => { function packet(overrides) { return { name: 'some name', msg: 'some messge', level: bunyan.INFO, ...overrides, }; } // NOTE: create a fake process that makes flow happy. function fakeProcess() { class FakeWritableStream extends WritableStream { write(): boolean { return true; } } const fakeWritableStream = new FakeWritableStream(); sinon.spy(fakeWritableStream, 'write'); return { stdout: fakeWritableStream, }; } it('lets you turn on verbose logging', () => { const log = new ConsoleStream({verbose: false}); log.makeVerbose(); assert.equal(log.verbose, true); }); it('logs names in verbose mode', () => { const log = new ConsoleStream({verbose: true}); assert.equal( log.format(packet({ name: 'foo', msg: 'some message', level: bunyan.DEBUG, })), '[foo][debug] some message\n'); }); it('does not log names in non-verbose mode', () => { const log = new ConsoleStream({verbose: false}); assert.equal( log.format(packet({name: 'foo', msg: 'some message'})), 'some message\n'); }); it('does not log debug packets unless verbose', () => { const log = new ConsoleStream({verbose: false}); const localProcess = fakeProcess(); // $FlowIgnore: fake process for testing reasons. log.write(packet({level: bunyan.DEBUG}), {localProcess}); sinon.assert.notCalled(localProcess.stdout.write); }); it('does not log trace packets unless verbose', () => { const log = new ConsoleStream({verbose: false}); const localProcess = fakeProcess(); // $FlowIgnore: fake process for testing reasons. log.write(packet({level: bunyan.TRACE}), {localProcess}); sinon.assert.notCalled(localProcess.stdout.write); }); it('logs debug packets when verbose', () => { const log = new ConsoleStream({verbose: true}); const localProcess = fakeProcess(); // $FlowIgnore: fake process for testing reasons. log.write(packet({level: bunyan.DEBUG}), {localProcess}); sinon.assert.called(localProcess.stdout.write); }); it('logs trace packets when verbose', () => { const log = new ConsoleStream({verbose: true}); const localProcess = fakeProcess(); // $FlowIgnore: fake process for testing reasons. log.write(packet({level: bunyan.TRACE}), {localProcess}); sinon.assert.called(localProcess.stdout.write); }); it('logs info packets when verbose or not', () => { const log = new ConsoleStream({verbose: false}); const localProcess = fakeProcess(); // $FlowIgnore: fake process for testing reasons. log.write(packet({level: bunyan.INFO}), {localProcess}); log.makeVerbose(); // $FlowIgnore: fake process for testing reasons. log.write(packet({level: bunyan.INFO}), {localProcess}); sinon.assert.callCount(localProcess.stdout.write, 2); }); it('lets you capture logging', () => { const log = new ConsoleStream(); const localProcess = fakeProcess(); log.startCapturing(); // $FlowIgnore: fake process for testing reasons. log.write(packet({msg: 'message'}), {localProcess}); sinon.assert.notCalled(localProcess.stdout.write); // $FlowIgnore: fake process for testing reasons. log.flushCapturedLogs({localProcess}); sinon.assert.calledWith(localProcess.stdout.write, 'message\n'); }); it('only flushes captured messages once', () => { const log = new ConsoleStream(); let localProcess = fakeProcess(); log.startCapturing(); // $FlowIgnore: fake process for testing reasons. log.write(packet(), {localProcess}); // $FlowIgnore: fake process for testing reasons. log.flushCapturedLogs({localProcess}); // Make sure there is nothing more to flush. localProcess = fakeProcess(); // $FlowIgnore: fake process for testing reasons. log.flushCapturedLogs({localProcess}); sinon.assert.notCalled(localProcess.stdout.write); }); it('lets you start and stop capturing', () => { const log = new ConsoleStream(); let localProcess = fakeProcess(); log.startCapturing(); // $FlowIgnore: fake process for testing reasons. log.write(packet(), {localProcess}); sinon.assert.notCalled(localProcess.stdout.write); log.stopCapturing(); // $FlowIgnore: fake process for testing reasons. log.write(packet(), {localProcess}); sinon.assert.callCount(localProcess.stdout.write, 1); // Make sure that when we start capturing again, // the queue gets reset. log.startCapturing(); log.write(packet()); localProcess = fakeProcess(); // $FlowIgnore: fake process for testing reasons. log.flushCapturedLogs({localProcess}); sinon.assert.callCount(localProcess.stdout.write, 1); }); }); });
var searchData= [ ['initialise_2eh',['initialise.h',['../initialise_8h.html',1,'']]], ['items',['items',['../structsxbp__co__ord__array__t.html#a32095c91b499cfcbaacdb250f45862b1',1,'sxbp_co_ord_array_t']]] ];
describe('aria.requiredOwned', function() { 'use strict'; afterEach(function() { axe.reset(); }); it('should returned the context property for the proper role', function() { axe.configure({ standards: { ariaRoles: { cats: { requiredOwned: ['yes'] } } } }); assert.deepEqual(axe.commons.aria.requiredOwned('cats'), ['yes']); }); it('should returned null if the required context is not an array', function() { axe.configure({ standards: { ariaRoles: { cats: { requiredOwned: 'yes' } } } }); assert.isNull(axe.commons.aria.requiredOwned('cats')); }); it('should return null if there are no required context nodes', function() { var result = axe.commons.aria.requiredOwned('cats'); assert.isNull(result); }); it('should return a unique copy of the context', function() { var context = ['yes', 'no']; axe.configure({ standards: { ariaRoles: { cats: { requiredOwned: context } } } }); var result = axe.commons.aria.requiredOwned('cats'); assert.notEqual(result, context); }); });
/*global sinon, assert, suite, setup, teardown, test */ suite('test-utils', function() { 'use strict'; var utils = window['test-utils']; setup(function() { this.sinon = sinon.sandbox.create(); this.dom = document.createElement('div'); document.body.appendChild(this.dom); }); teardown(function() { this.sinon.restore(); }); test('accessibility', function(done) { var accessibility = utils.accessibility; assert.ok(accessibility); assert.ok(accessibility.check); accessibility.check(this.dom).then(done, done); }); test('afterNext', function(done) { var obj = { test: function() { assert.ok(true, 'obj.test is called'); return true; } }; utils.afterNext(obj, 'test') .then(result => assert.ok(result)) .then(done, done); setTimeout(() => obj.test(), 1); }); test('touch', function(done) { var type = 'touchstart', x = 1, y = 2; this.dom.addEventListener('touchstart', event => { assert.equal(event.type, type); assert.ok(event.timeStamp); assert.isTrue(event.bubbles); assert.isTrue(event.cancelable); assert.equal(event.touches.length, 1); var touch = event.touches[0]; assert.equal(touch.pageX, x); assert.equal(touch.pageY, y); done(); }); utils.touch(this.dom, type, x, y); }); });
let _ = function (type, props, children) { let elem = null; if (type === "text") { return document.createTextNode(props); } else { elem = document.createElement(type); } for (let n in props) { if (n === "style") { for (let x in props.style) { elem.style[x] = props.style[x]; } } else if (n === "className") { elem.className = props[n]; } else if (n === "event") { for (let x in props.event) { elem.addEventListener(x, props.event[x]); } } else { elem.setAttribute(n, props[n]); } } if (children) { for (let i = 0; i < children.length; i++) { if (children[i] != null) elem.appendChild(children[i]); } } return elem; }; let isChrome = /chrome/i.test(navigator.userAgent); let _t = function (s) { return chrome.i18n.getMessage(s) }; let firefoxVer = 0; if (!isChrome) { firefoxVer = (navigator.userAgent.match(/Firefox\/(\d+)/) || [, 0])[1]; } function readStorage(name, cb) { if (!isChrome && firefoxVer < 53) //ff52-无sync chrome.storage.local.get(name, cb) else chrome.storage.sync.get(name, cb) } function saveStorage(save) { if (!isChrome && firefoxVer < 53) chrome.storage.local.set(save); else chrome.storage.sync.set(save); } function getCookie(name) { let cookies = {}; document.cookie.split('; ').forEach(function (i) { let [key, ...val] = i.split('='); cookies[key] = val.join('='); }); return cookies[name] || ''; }