text
stringlengths
2
6.14k
$( loadCy = function(){ //<demo> // initialise cytoscape.js on a html dom element with some options: cy = cytoscape( options = { container: document.getElementById('cy'), minZoom: 0.5, maxZoom: 2, // style can be specified as plain JSON, a stylesheet string (probably a CSS-like // file pulled from the server), or in a functional format style: [ { selector: 'node', css: { 'content': 'data(name)', 'font-family': 'helvetica', 'font-size': 14, 'text-outline-width': 3, 'text-outline-color': '#999', 'text-valign': 'center', 'color': '#fff', 'width': 'mapData(weight, 30, 80, 20, 50)', 'height': 'mapData(height, 0, 200, 10, 45)', 'border-color': '#fff' } }, { selector: ':selected', css: { 'background-color': '#000', 'line-color': '#000', 'target-arrow-color': '#000', 'text-outline-color': '#000' } }, { selector: 'edge', css: { 'width': 2, 'curve-style': 'bezier', 'target-arrow-shape': 'triangle' } }, { selector: '.foo', css: { 'border-width': 4, 'border-color': 'red' } } ], // specify the elements in the graph elements: { nodes: [ { data: { id: 'j', name: 'Jerry', weight: 65, height: 174 } }, { data: { id: 'e', name: 'Elaine', weight: 48, height: 160 } }, { data: { id: 'k', name: 'Kramer', weight: 75, height: 185 } }, { data: { id: 'g', name: 'George', weight: 70, height: 150 } } ], edges: [ { data: { source: 'j', target: 'e', id: 'je' } }, { data: { source: 'j', target: 'k', id: 'jk' } }, { data: { source: 'j', target: 'g', id: 'jg' } }, { data: { source: 'e', target: 'j', id: 'ej' } }, { data: { source: 'e', target: 'k', id: 'ek' } }, { data: { source: 'k', target: 'j', id: 'kj' } }, { data: { source: 'k', target: 'e', id: 'ke' } }, { data: { source: 'k', target: 'g', id: 'kg' } }, { data: { source: 'g', target: 'j', id: 'gj' } } ], }, ready: function(){ // when layout has set initial node positions etc } } ); //</demo> } );
Ext.define('RedmineApp.model.RedmineConfig', { extend: 'Ext.data.Model', config: { fields: [ 'redmine_url', 'redmine_access_key' ] } });
// ========================================================================== // Project: Ember Runtime // Copyright: ©2006-2011 Strobe Inc. and contributors. // ©2008-2011 Apple Inc. All rights reserved. // License: Licensed under MIT license (see license.js) // ========================================================================== module('Ember.String.w'); test("'one two three'.w() => ['one','two','three']", function() { deepEqual(Ember.String.w('one two three'), ['one','two','three']); if (Ember.EXTEND_PROTOTYPES) { deepEqual('one two three'.w(), ['one','two','three']); } }); test("'one two three'.w() with extra spaces between words => ['one','two','three']", function() { deepEqual(Ember.String.w('one two three'), ['one','two','three']); if (Ember.EXTEND_PROTOTYPES) { deepEqual('one two three'.w(), ['one','two','three']); } }); test("'one two three'.w() with tabs", function() { deepEqual(Ember.String.w('one\ttwo three'), ['one','two','three']); if (Ember.EXTEND_PROTOTYPES) { deepEqual('one\ttwo three'.w(), ['one','two','three']); } });
define({ "searchTabTitle": "स्रोत सेटिंग खोजें", "routeTabTitle": "रूट सेटिंग", "add": "खोज स्रोत जोड़ें", "addGeocoder": "geocoder जोड़ें", "geocoder": "Geocoding", "setLayerSource": "लेयर स्रोत को सेट करें", "setGeocoderURL": "geocoder का URL सेट करें", "searchableLayer": "फ़ीचर लेयर", "name": "नाम", "countryCode": "देश या क्षेत्र कोड", "countryCodeEg": "जैसे ", "countryCodeHint": "इस मान को खाली छोड़ने से सभी देशों और क्षेत्रों की खोज होगी", "showInfoWindowOnSelect": "पाई गई फीचर या स्थान के लिए पॉप-अप दिखाएं", "showInfoWindowOnSelect2": "फ़ीचर या स्थान मिलने पर पॉप-अप दिखाएँ।", "searchInCurrentMapExtent": "केवल वर्तमान मानचित्र सीमा में खोज करता है", "setSearchFields": "खोज फ़ील्ड को सेट करें", "set": "सेट करें", "fieldSearchable": "खोज योग्य", "zoomScale": "स्केल को ज़ूम करें", "locatorUrl": "जियोकोडर URL", "locatorName": "जियोकोडर का नाम", "locatorExample": "उदाहरण", "locatorWarning": "जियोकोडिंग सेवा का यह संस्करण समर्थित नहीं है। विजेट जियोकोडिंग सेवा 10.1 और उससे ऊपर के संस्करण का समर्थन करता है।", "locatorTips": "सुझाव उपलब्ध नहीं हैं क्योंकि Geocoding सेवा सुझाव क्षमता का का समर्थन नहीं करता है।", "layerSource": "लेयर स्रोत को सेट करें", "searchLayerTips": "सुझाव उपलब्ध नहीं हैं क्योंकि सुविधा सेवा पृष्ठ अंकन क्षमता का समर्थन नहीं करती है।", "placeholderText": "प्लेसहोल्डर टेक्स्ट", "searchFields": "फ़ील्ड खोजें", "displayField": "डिस्प्ले फील्ड्स", "exactMatch": "सटीक मिलान", "maxSuggestions": "अधिकतम सुझाव", "maxResults": "अधिकतम परिणाम", "enableLocalSearch": "स्थानीय खोज को सक्षम करें", "minScale": "न्यूनतम स्केल", "minScaleHint": "जब मानचित्र स्केल इस स्केल से बड़ा होता है, तो स्थानीय खोज को लागू किया जाएगा", "radius": "त्रिज्या", "radiusHint": "मौजूदा मानचित्र केंद्र के चारों ओर एक क्षेत्रफल की त्रिज्या निर्दिष्ट करें जिसे Geocoding उम्मीदवारों के रैंक को बढ़ावा देने के लिए प्रयोग किया जाता है ताकि स्थान के निकटतम उम्मीदवार पहले प्राप्त हों", "invalidUrlTip": "URL ${URL} अवैध या दुर्गम है।", "routeUrl": "मार्ग का URL", "geocoderOptions": "Geocoder विकल्प", "autoComplete": "स्वत:पूर्ण", "maximumSuggestions": "अधिकतम सुझाव", "minCharacters": "न्यूनतम वर्ण", "searchDelay": "खोज में देरी", "placeholder": "प्लेसहोल्डर", "routeOptions": "मार्ग विकल्प", "directionsLanguage": "दिशाओं की भाषा", "directionsLengthUnits": "दिशाओं की लंबाई की इकाइयाँ", "directionsOutputType": "दिशाओं की आउटपुट का प्रकार", "impedanceAttribute": "प्रतिक्रिया विशेषता", "kilometers": "किलोमीटर", "miles": "मील", "meters": "मीटर", "feet": "फ़ीट", "yards": "गज", "nauticalMiles": "समुद्री मील", "parametersTip": "कृपया सही ढंग से पैरामीटर सेट करें!", "complete": "पूर्ण हुआ", "completeNoEvents": "कोई इवेंट नहीं को पूर्ण करें", "instructionsOnly": "केवल निर्देश", "standard": "मानक", "summaryOnly": "केवल सारांश", "travelModesUrl": "यात्रा साधन का URL", "searchPlaceholder": "पता या स्थान खोजें", "trafficLayerUrl": "ट्रैफिक लेयर का URL", "barrierLayerUrl": "बैरियर लेयर URL", "presetDestinations": "वतर्मान स्टॉप", "startPoint": "प्रारंभ बिंदु", "endPoint": "समाप्ति बिंदु", "destinationHolder": "पता या निर्देशांक", "optional": "वैकल्पिक.", "barrierLayers": "बैरियर लेयर्स", "pointBarrier": "पॉइंट बैरियर", "lineBarrier": "रेखा बैरियर", "polygonBarrier": "बहुभुज बैरियर", "noPointBarrier": "बिंदु बाधाएं चुनें", "noLineBarrier": "रेखीय बाधाएं चुनें", "noPolygonBarrier": "बहुभुज बाधाएं चुनें" });
import angular from 'angular'; import uiRouter from 'angular-ui-router'; import {home} from './home/home'; import {approach} from './approach/approach'; import {details} from './details/details'; import {contacts} from './contacts/contacts'; import {drilldown} from '../drilldown/drilldown'; import {tabsDirective} from './tabs.directive.js'; import ngAnimate from 'angular-animate'; import ngAria from 'angular-aria'; import ngMaterial from 'angular-material'; export const tabs = angular.module('main', [ uiRouter, ngAnimate, ngAria, ngMaterial, home.name, approach.name, details.name, contacts.name, drilldown.name ]) .config( ($stateProvider, $urlRouterProvider) => { $urlRouterProvider .when('/', '/tabs/home') .otherwise('/tabs/home'); $stateProvider. state('main', { abstract: 'true', url: '/tabs', template: '<tabs></tabs>' }); }) .directive('tabs', tabsDirective);
const styleLintPlugin = require('stylelint-webpack-plugin'); var htmlWebpackPlugin = require('html-webpack-plugin'); const validate = require('webpack-validator'); const path = require('path'); // plugins // Lint Css const cssStyleLint = new styleLintPlugin({files: '**/*.css'}); // htmlPlugin const htmlPlugin = new htmlWebpackPlugin({ template: './index.html' }); const config = { entry: { app: './src/main.js' }, output: { filename: './dist/[name].js' }, devtool: 'eval-source-map', module: { preLoaders: [ { test: /\.js$/, include: /src/, loaders: ['eslint'] } ], loaders: [ { test: /\.js$/, // ← Test for ".js" file, if it passes, use the loader include: /src/, loader: 'babel' // ← Use babel (short for ‘babel-loader’) loads collection of ES6 transforms, JSX for react etc.. from .babelrc file }, { test: /\.css$/, // ← Test for ".css" file, if it passes, use the loader include: /src/, loaders: [ 'style', 'css?modules&localIdentName=[name]__[local]____[hash:base64:5]', 'postcss' ] // ← loaders working bottom to top }, { test: /\.(gif|png|jpe?g|svg)$/i, include: [ path.resolve(__dirname, 'src/images') ], loaders: [ 'file?name=./dist/[name].[hash].[ext]', 'image-webpack?{progressive:true, optimizationLevel: 7, interlaced: false, pngquant:{quality: "65-90", speed: 4}}' ] } ] }, postcss: [ require('postcss-easy-import')(), require('postcss-cssnext')(), require('postcss-reporter')() ], resolve: { extensions: ['', '.js'] }, plugins: [ cssStyleLint, htmlPlugin ], externals: { 'react/addons': true, 'react/lib/ExecutionEnvironment': true, 'react/lib/ReactContext': true } }; module.exports = validate(config);
'use strict'; var context = require('../context'); describe('ctx.append(name, val)', function(){ it('should append multiple headers', function(){ var ctx = context(); ctx.append('x-foo', 'bar1'); ctx.append('x-foo', 'bar2'); ctx.response.header['x-foo'].should.eql(['bar1', 'bar2']); }) it('should accept array of values', function (){ var ctx = context(); ctx.append('Set-Cookie', ['foo=bar', 'fizz=buzz']); ctx.append('Set-Cookie', 'hi=again'); ctx.response.header['set-cookie'].should.eql(['foo=bar', 'fizz=buzz', 'hi=again']); }) it('should get reset by res.set(field, val)', function (){ var ctx = context(); ctx.append('Link', '<http://localhost/>'); ctx.append('Link', '<http://localhost:80/>'); ctx.set('Link', '<http://127.0.0.1/>'); ctx.response.header.link.should.equal('<http://127.0.0.1/>'); }) it('should work with res.set(field, val) first', function (){ var ctx = context(); ctx.set('Link', '<http://localhost/>'); ctx.append('Link', '<http://localhost:80/>'); ctx.response.header.link.should.eql(['<http://localhost/>', '<http://localhost:80/>']); }) })
//@module shortjsdoc.html //@class SourcesView @extends AbstractView var SourcesView = AbstractView.extend({ className: 'sources' , template: 'sources' , events: { 'click [data-type="goto-source"]': 'gotoSource' } , initialize: function(application, jsdoc) { this.application = application; this.jsdoc = jsdoc; this.allSource = this.application.maker.data.source; var rangeRatio = 400; var rangeMin = Math.max(0, this.jsdoc.commentRange[0] - rangeRatio); var rangeMax = Math.min(this.allSource.length - 1, this.jsdoc.commentRange[1] + rangeRatio); this.sourceSubset = this.allSource.substring(rangeMin, rangeMax); var jsdocSource = this.allSource.substring(this.jsdoc.commentRange[0], this.jsdoc.commentRange[1]); var previusSource = this.sourceSubset.substring(0, this.sourceSubset.indexOf(jsdocSource)); var previusSourceLineCount = previusSource.split('\n').length; this.jsdocLineNumber = previusSourceLineCount - 1; this.lineCount = jsdocSource.split('\n').length; //TODO: count the lines of the comment and show all the lines - not only the first one } , afterRender: function() { if(typeof prettyPrint !== 'undefined') { prettyPrint(); } } , gotoSource: function() { var selector = 'ol.linenums>li' , $target = jQuery(jQuery(selector).get(this.jsdocLineNumber)); if($target.size()) { jQuery(window).scrollTop($target.position().top); $target.addClass('selectedJsDocLine'); } for (var i = 0; i < this.lineCount; i++) { $target = jQuery(jQuery(selector).get(this.jsdocLineNumber+i)); $target.addClass('selectedJsDocLine'); } } });
var CalcCtrl = function($timeout, $scope) { $scope.memory = []; $scope.latest = 0; $scope.operators = { ADDITION: '+', SUBTRACTION: '-', MULTIPLICATION: '*', DIVISION: '/', MODULO: '%' }; $scope.operator = $scope.operators.ADDITION; $scope.doAddition = function() { var times = 5; $scope.latest = '. '; $timeout(function tickslowly() { if (times == 0) { var latestResult; var first = parseInt($scope.first); var second = parseInt($scope.second); switch ($scope.operator) { case '+': latestResult = first + second; break; case '-': latestResult = first - second; break; case '*': latestResult = first * second; break; case '/': latestResult = first / second; break; case '%': latestResult = first % second; break; } $scope.memory.unshift({ timestamp: new Date(), first: $scope.first, operator: $scope.operator, second: $scope.second, value: latestResult }); $scope.first = $scope.second = ''; $scope.latest = latestResult; } else { $scope.latest += '. '; times--; $timeout(tickslowly, 300); } }, 300) }; }; var calculator = angular.module('calculator', []);
const React = require('react') const PropTypes = require('prop-types') const CodeMirror = require('./codemirror') function Editor(props) { return ( <form className="editor pure-form"> <CodeMirror mode="markdown" theme="monokai" value={props.value} onChange={props.onChange} /> </form> ) } Editor.propTypes = { onChange: PropTypes.func.isRequired, value: PropTypes.string } Editor.defaultProps = { value: '' } module.exports = Editor
'use strict'; const config = require('./config.json'); const exec = require('child_process').exec; exec('./node_modules/.bin/_mocha ' + config.testDir, (error, stdout, stderr) => { if (stdout || stderr) { console.log(stdout + stderr); } });
import { isMatch } from '../util' import Command from './Command' export default class SwitchTextTypeCommand extends Command { constructor (config) { super(config) if (!config.spec) { throw new Error("'config.spec' is mandatory") } if (!config.spec.type) { throw new Error("'config.spec.type' is mandatory") } } getType () { return this.config.spec.type } getCommandState (params) { const editorSession = params.editorSession const doc = editorSession.getDocument() const sel = params.selection const isBlurred = editorSession.isBlurred() const commandState = { disabled: false } if (sel.isPropertySelection() && !isBlurred) { const path = sel.getPath() const node = doc.get(path[0]) if (node && node.isText()) { commandState.active = isMatch(node, this.config.spec) } else { commandState.disabled = true } } else { // TODO: Allow Container Selections too, to switch multiple paragraphs commandState.disabled = true } return commandState } /** Perform a switchTextType transformation based on the current selection */ execute (params) { const editorSession = params.editorSession editorSession.transaction((tx) => { return tx.switchTextType(this.config.spec) }) } isSwitchTypeCommand () { return true } }
title = 'My Pagen' exports.index = function(req, res){ res.render('index', { title: title }); }; exports.about = function(req, res){ res.render('about', { title: title }); }; exports.contact = function(req, res){ res.render('contact', { title: title }); };
// @flow import { describe, it } from 'flow-typed-test'; import createDOMPurify from 'dompurify'; const DOMPurify = createDOMPurify(); const dirty = ` <div> <h1> Hello, <a href="#" name="world">World</a> </h1> <img src="hello.png" alt="world" /> </div>`; describe('#createDOMPurify', () => { it('should add/remove hook', () => { DOMPurify.addHook('beforeSanitizeElements', (currentNode, data, config) => { return currentNode; }); // $ExpectError DOMPurify.addHook('invalidHookName', (currentNode, data, config) => { return currentNode; }); DOMPurify.removeHook('beforeSanitizeElements'); DOMPurify.removeHooks('beforeSanitizeElements'); DOMPurify.removeAllHooks(); }); it('should sanitize', () => { const clean: string = DOMPurify.sanitize(dirty); }); it('should sanitize to string', () => { // $ExpectError DOMPurify.sanitize(dirty, { ALLOWED_TAGS: ['invalid'], }); // $ExpectError DOMPurify.sanitize(dirty, { INVALID_ARG: 42, }); const clean: string = DOMPurify.sanitize(dirty, { ALLOWED_ATTR: ['href', 'src'], ALLOWED_TAGS: ['a', 'img', 'h1'], }); }); it('should sanitize to HTMLBodyElement', () => { const clean: HTMLBodyElement = DOMPurify.sanitize(dirty, { RETURN_DOM: true }); }); it('should sanitize to DocumentFragment', () => { const clean: DocumentFragment = DOMPurify.sanitize(dirty, { RETURN_DOM_FRAGMENT: true }); }); });
/*! * AdminLE v0.0.1 (https://github.com/Dennis14e/AdminLE) * Copyright (c) 2015-2015 Dennis14e * Licensed under MIT (https://github.com/Dennis14e/AdminLE/blob/master/LICENSE) */ if (typeof jQuery === 'undefined') { throw new Error('AdminLE\'s JavaScript requires jQuery') }
jQuery.expr[':'].Contains = function(a, i, m) { return jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase()) >= 0; }; $(function() { $("#sidebar-nav").accordion({ autoHeight: false, navigation: true, collapsible: true }).accordion("activate", false) .find('a.link').unbind('click').click( function(ev) { ev.cancelBubble = true; // IE if (ev.stopPropagation) { ev.stopPropagation(); // the rest } return true; }).prev().prev().remove(); $("#sidebar-nav>h3").click(function() { if ($(this).attr('initialized') == 'true') return; $(this).next().find(".sidebar-nav-tree").treeview({ collapsed: true, persist: "cookie" }); $(this).attr('initialized', true); }); }); function tree_search(input) { treeview = $(input).parent().parent().next(); // Expand all items treeview.find('.expandable-hitarea').click(); // make all items visible again treeview.find('li:hidden').show(); // hide all items that do not match the given search criteria if ($(input).val()) { treeview.find('li').not(':has(a:Contains(' + $(input).val() + '))').hide(); } }
var style = { "font": { "family": "" } }
( function( M, $ ) { var View = M.require( 'View' ), Section; /** * @class * @extends View * @name Section */ Section = View.extend( { template: mw.template.get( 'section' ), defaults: { line: '', text: '', editLabel: mw.msg( 'mobile-frontend-editor-edit' ) }, initialize: function( options ) { var self = this; this.line = options.line; this.text = options.text; this.hasReferences = options.hasReferences || false; this.id = options.id || null; this.anchor = options.anchor; this.children = []; $.each( options.children || [], function() { self.children.push( new Section( this ) ); } ); this._super( options ); } } ); M.define( 'Section', Section ); }( mw.mobileFrontend, jQuery ) );
/** * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.editorConfig = function( config ) { // Define changes to default configuration here. For example: // config.language = 'fr'; // config.uiColor = '#AADC6E'; };
'use strict'; var express = require('express'), path = require('path'), config = require('./config'); /** * Express configuration */ module.exports = function (app) { app.configure('development', function () { app.use(require('connect-livereload')()); // Disable caching of scripts for easier testing app.use(function noCache(req, res, next) { if (req.url.indexOf('/scripts/') === 0) { res.header('Cache-Control', 'no-cache, no-store, must-revalidate'); res.header('Pragma', 'no-cache'); res.header('Expires', 0); } next(); }); app.use(express.static(path.join(config.root, '.tmp'))); app.use(express.static(path.join(config.root, 'app'))); app.use(express.errorHandler()); app.set('views', config.root + '/app/views'); }); app.configure('production', function () { app.use(express.favicon(path.join(config.root, 'public', 'favicon.ico'))); app.use(express.static(path.join(config.root, 'public'))); app.set('views', config.root + '/views'); }); app.configure(function () { app.engine('html', require('ejs').renderFile); app.set('view engine', 'html'); app.use(express.logger('dev')); app.use(express.bodyParser()); app.use(express.methodOverride()); // Router needs to be last app.use(app.router); }); };
// Load all the modules from package.json var gulp = require( 'gulp' ), plumber = require( 'gulp-plumber' ), autoprefixer = require('gulp-autoprefixer'), watch = require( 'gulp-watch' ), livereload = require( 'gulp-livereload' ), jshint = require( 'gulp-jshint' ), stylish = require( 'jshint-stylish' ), uglify = require( 'gulp-uglify' ), rename = require( 'gulp-rename' ), notify = require( 'gulp-notify' ), include = require( 'gulp-include' ), sass = require( 'gulp-sass' ), imagemin = require('gulp-imagemin'), bower = require('gulp-bower'), zip = require('gulp-zip'); var config = { 
 bowerDir: './bower_components'
 } // Default error handler var onError = function( err ) { console.log( 'An error occured:', err.message ); this.emit('end'); } gulp.task('zip', function () { return gulp.src([ '*', './inc/*', './js/**/*', './languages/*', './sass/**/*', './template-parts/*', './templates/*', '!bower_components', '!node_modules', ], {base: "."}) .pipe(zip('mdlwp.zip')) .pipe(gulp.dest('.')); }); // Install all Bower components gulp.task('bower', function() { return bower() .pipe(gulp.dest(config.bowerDir)) }); // Jshint outputs any kind of javascript problems you might have // Only checks javascript files inside /src directory gulp.task( 'jshint', function() { return gulp.src( './js/src/*.js' ) .pipe( jshint() ) .pipe( jshint.reporter( stylish ) ) .pipe( jshint.reporter( 'fail' ) ); }) // Concatenates all files that it finds in the manifest // and creates two versions: normal and minified. // It's dependent on the jshint task to succeed. gulp.task( 'scripts', ['jshint'], function() { return gulp.src( './js/manifest.js' ) .pipe( include() ) .pipe( rename( { basename: 'scripts' } ) ) .pipe( gulp.dest( './js/dist' ) ) // Normal done, time to create the minified javascript (scripts.min.js) // remove the following 3 lines if you don't want it .pipe( uglify() ) .pipe( rename( { suffix: '.min' } ) ) .pipe( gulp.dest( './js/dist' ) ) .pipe(notify({ message: 'scripts task complete' })) .pipe( livereload() ); } ); // Different options for the Sass tasks var options = {}; options.sass = { errLogToConsole: true, precision: 8, noCache: true, //imagePath: 'assets/img', }; options.sassmin = { errLogToConsole: true, precision: 8, noCache: true, outputStyle: 'compressed', //imagePath: 'assets/img', }; // Sass gulp.task('sass', function() { return gulp.src('./sass/style.scss') .pipe(plumber()) .pipe(sass(options.sass)) .pipe(autoprefixer()) .pipe(gulp.dest('.')) .pipe(notify({ title: 'Sass', message: 'sass task complete' })); }); // Sass-min - Release build minifies CSS after compiling Sass gulp.task('sass-min', function() { return gulp.src('./sass/style.scss') .pipe(plumber()) .pipe(sass(options.sassmin)) .pipe(autoprefixer()) .pipe( rename( { suffix: '.min' } ) ) .pipe(gulp.dest('.')) .pipe(notify({ title: 'Sass', message: 'sass-min task complete' })); }); // Optimize Images gulp.task('images', function() { return gulp.src('./images/**/*') .pipe(imagemin({ progressive: true, svgoPlugins: [{removeViewBox: false}]})) .pipe(gulp.dest('./images')) .pipe(notify({ message: 'Images task complete' })); }); // Start the livereload server and watch files for change gulp.task( 'watch', function() { livereload.listen(); // don't listen to whole js folder, it'll create an infinite loop gulp.watch( [ './js/**/*.js', '!./js/dist/*.js' ], [ 'scripts' ] ) gulp.watch( './sass/**/*.scss', ['sass', 'sass-min'] ); gulp.watch('./images/**/*', ['images']); gulp.watch( './**/*.php' ).on( 'change', function( file ) { // reload browser whenever any PHP file changes livereload.changed( file ); } ); } ); gulp.task( 'default', ['watch'], function() { // Does nothing in this task, just triggers the dependent 'watch' } );
angular.module('bhima.controllers') .controller('income_expense_by_yearController', IncomeExpenseByYearConfigController); IncomeExpenseByYearConfigController.$inject = [ '$sce', 'NotifyService', 'BaseReportService', 'AppCache', 'reportData', '$state', ]; function IncomeExpenseByYearConfigController($sce, Notify, SavedReports, AppCache, reportData, $state) { const vm = this; const cache = new AppCache('configure_income_expense_by_year'); const reportUrl = 'reports/finance/income_expense_by_year'; vm.reportDetails = {}; vm.previewGenerated = false; checkCachedConfiguration(); vm.onSelectFiscal = function onSelectFiscal(fiscal) { vm.reportDetails.fiscalYearId = fiscal.id; }; vm.OnRemoveUnusedAccounts = (val) => { vm.reportDetails.removeUnusedAccounts = val; }; vm.preview = function preview(form) { if (form.$invalid) { return 0; } // update cached configuration cache.reportDetails = angular.copy(vm.reportDetails); return SavedReports.requestPreview(reportUrl, reportData.id, angular.copy(vm.reportDetails)) .then((result) => { vm.previewGenerated = true; vm.previewResult = $sce.trustAsHtml(result); }) .catch(Notify.handleError); }; vm.clearPreview = function clearPreview() { vm.previewGenerated = false; vm.previewResult = null; }; vm.requestSaveAs = function requestSaveAs() { const options = { url : reportUrl, report : reportData, reportOptions : angular.copy(vm.reportDetails), }; return SavedReports.saveAsModal(options) .then(() => { $state.go('reportsBase.reportsArchive', { key : options.report.report_key }); }) .catch(Notify.handleError); }; // load cache if defined function checkCachedConfiguration() { if (cache.reportDetails) { vm.reportDetails = angular.copy(cache.reportDetails); } } }
kryptos.hash.MD5 = function(str) { inherit(this, new kryptos.hash.baseHash(str)); } kryptos.hash.MD5.digest_size = 16; kryptos.hash.MD5.prototype = { type : 'md5' };
function getBufferSize () { return 0; } function onIntervalClose (periods) { return [{ overlay: false, value: VOLUME, type: "column", tooltip: { valueDecimals: 0 } }]; }
var files = [ [ "moogli", "dir_c0d33ac664c512c30cbb9566aa8a63a9.html", "dir_c0d33ac664c512c30cbb9566aa8a63a9" ] ];
function(doc) { // IMPORTANT: in order to retrieve remove events, you should add "doc._deleted" to the filter // only send notifications for message docs if (doc.collection == "messages" || doc._deleted) return true; else return false; };
jQuery( document ).ready( function() { $( '#id' ).focus(); $( '#login' ).submit( function( e ) { e.preventDefault(); if ( $( '#id' ).val() != '' ) io.emit( 'login', $( '#id' ).val() ); } ); } );
/* Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'templates', 'si', { button: 'අච්චුව', emptyListMsg: 'කිසිම අච්චුවක් කලින් තීරණය කර ', insertOption: 'සත්‍ය අන්තර්ගතයන් ප්‍රතිස්ථාපනය කරන්න', options: 'අච්චු ', selectPromptMsg: 'කරුණාකර සංස්කරණය සදහා අච්චුවක් ', title: 'අන්තර්ගත් අච්චුන්' } );
/* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2008 1&1 Internet AG, Germany, http://www.1und1.de License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL: http://www.eclipse.org/org/documents/epl-v10.php See the LICENSE file in the project's top-level directory for details. Authors: * Sebastian Werner (wpbasti) * Fabian Jakobs (fjakobs) ************************************************************************ */ /* ************************************************************************ #use(qx.event.handler.Input) ************************************************************************ */ /** * Native mouse events * @tag noPlayground */ qx.Class.define("demobrowser.demo.event.MouseEvent", { extend : demobrowser.demo.event.EventDemo, members : { main : function() { this.base(arguments); this._initLogger( ["Target", "Event", "button", "pageX", "pageY", "clientX", "clientY", "screenX", "screenY", "relatedTarget"], document.getElementById("logger"), 50 ); var mouseDiv = document.getElementById("mouse"); var events = ["mousedown", "mouseup", "click", "dblclick", "contextmenu", "mousemove", "mouseover", "mouseout"]; for (var i=0; i<events.length; i++) { var elem = document.getElementById("check_" + events[i]) if (elem.checked) { qx.bom.Element.addListener( mouseDiv, events[i], this.logMouseEvent, this ) } qx.bom.Element.addListener(elem, "change", this.__changeCheckbox, this); } var captureDiv = document.getElementById("capture"); captureDiv.checked = false; qx.bom.Element.addListener(captureDiv, "change", function(e) { var checked = e.getTarget().checked; if (checked) { qx.bom.Element.capture(mouseDiv); } else { qx.bom.Element.releaseCapture(mouseDiv); } }, this); qx.bom.Element.addListener( mouseDiv, "losecapture", function(e) { captureDiv.checked = false; }, this ); }, __changeCheckbox : function(e) { var type = e.getTarget().id.split("_")[1]; var checked = e.getTarget().checked; var mouseDiv = document.getElementById("mouse"); if (checked) { qx.bom.Element.addListener( mouseDiv, type, this.logMouseEvent, this ) } else { qx.bom.Element.removeListener( mouseDiv, type, this.logMouseEvent, this ) } }, logMouseEvent: function(mouseEvent) { mouseEvent.preventDefault(); this._log([ mouseEvent.getTarget().id, mouseEvent.getType(), mouseEvent.getButton(), mouseEvent.getDocumentLeft(), mouseEvent.getDocumentTop(), mouseEvent.getScreenLeft(), mouseEvent.getScreenTop(), mouseEvent.getViewportLeft(), mouseEvent.getViewportTop(), mouseEvent.getRelatedTarget() ? mouseEvent.getRelatedTarget().id : "" ]); } } });
'use strict'; define([], function() { var dependencies = ['$scope', '$stateParams', 'AnalysisService']; var NetworkGraphController = function($scope, $stateParams, AnalysisService) { $scope.networkGraph = {}; $scope.analysis.$promise.then(function(analysis) { $scope.networkGraph.network = AnalysisService.transformProblemToNetwork(analysis.problem); }); }; return dependencies.concat(NetworkGraphController); });
/* eslint-disable prefer-rest-params */ /* global dijit, define */ define(["dojo/_base/declare", "dijit/form/DropDownButton"], function (declare) { return declare("fox.form.DropDownButton", dijit.form.DropDownButton, { startup: function() { this.inherited(arguments); this.dropDown.autoFocus = true; // Allow dropdown menu to be focused on click }, focus: function() { return; // Stop dijit.form.DropDownButton from keeping focus after closing the menu }, }); });
/*! * web-SplayChat v0.4.0 - messaging web application for MTProto * http://SplayChat.com/ * Copyright (C) 2014 SplayChat Messenger <igor.beatle@gmail.com> * http://SplayChat.com//blob/master/LICENSE */ importScripts( 'polyfill.js', 'bin_utils.js', '../../vendor/jsbn/jsbn_combined.js', '../../vendor/leemon_bigint/bigint.js', '../../vendor/closure/long.js', '../../vendor/cryptoJS/crypto.js', '../../vendor/rusha/rusha.js' ); onmessage = function (e) { var taskID = e.data.taskID, result; switch (e.data.task) { case 'factorize': result = pqPrimeFactorization(e.data.bytes); break; case 'mod-pow': result = bytesModPow(e.data.x, e.data.y, e.data.m); break; case 'sha1-hash': result = sha1HashSync(e.data.bytes); break; case 'aes-encrypt': result = aesEncryptSync(e.data.bytes, e.data.keyBytes, e.data.ivBytes); break; case 'aes-decrypt': result = aesDecryptSync(e.data.encryptedBytes, e.data.keyBytes, e.data.ivBytes); break; default: throw new Error('Unknown task: ' + e.data.task); } postMessage({taskID: taskID, result: result}); } postMessage('ready');
var i18n=require("i18n"); var path=require("path"); var AbstractPlugin=require("./AbstractPlugin"); var LOG=require("../lib/Logger"); function WindowsShortcutPlugin(params){ LOG.trace("WindowsShortcutPlugin"); params=params || {}; this.exe=params.exe; } WindowsShortcutPlugin.prototype=Object.create(AbstractPlugin.prototype); WindowsShortcutPlugin.prototype.constructor=WindowsShortcutPlugin; WindowsShortcutPlugin.prototype.before=function(callback){ var self=this; ws.query(this.exe,function(err,shortcut){ self.shortcut=shortcut; callback(err); }); }; var VARIABLE_PATTERN=/%(.*?)%/g; WindowsShortcutPlugin.prototype.getExe=function(params,callback){ var exe=null; var target=this.shortcut.target.replace(VARIABLE_PATTERN,function(_,variable){ return process.env[variable]; }); var args=this.shortcut.args.replace(VARIABLE_PATTERN,function(_,variable){ return process.env[variable]; }); if(target || args){ exe=('"'+target+'" '+args).trim(); } callback(null,exe); }; WindowsShortcutPlugin.prototype.getStartDir=function(params,callback){ var StartDir=this.shortcut.workingDir; callback(null,StartDir) }; WindowsShortcutPlugin.prototype.getIcon=function(params,callback){ var icon=this.shortcut.icon.replace(VARIABLE_PATTERN,function(_,variable){ return process.env[variable]; }); var extension=path.extname(icon).toLowerCase(); if(!(!extension || extension===".exe" || extension===".png" || extension===".tga")){ //TODO make copy of icon and change extension to .tga LOG.warn(i18n.__("The extension of the icon '%s' is not exe/png/tga. Steam only supports these extension for icons.",icon)); } callback(null,icon); }; try{ var ws=require("windows-shortcuts"); }catch(e){ LOG.error(e); } if(!ws){ WindowsShortcutPlugin.prototype.before=null; WindowsShortcutPlugin.prototype.getExe=null; WindowsShortcutPlugin.prototype.getStartDir=null; WindowsShortcutPlugin.prototype.getIcon=null; } module.exports=WindowsShortcutPlugin;
module.exports = function(app) { var utils = require('../sinergis/controller/utils.js')(app) , admin = require('../sinergis/controller/admin.js')(app) , adminSimaya = require('../simaya/controller/admin.js')(app) , announcement = require('../simaya/controller/announcement.js')(app) app.all('/admin*', utils.requireAdmin); app.get('/admin', utils.requireLogin, admin.index); app.get('/admin/user', utils.requireLogin, adminSimaya.user); app.get('/admin/admin', utils.requireLogin, adminSimaya.admin); app.get('/admin/admin-structure', utils.requireLogin, adminSimaya.adminStructure); app.get('/admin/admin-in-org', utils.requireLogin, adminSimaya.adminListInOrgJSON); app.get('/admin/role', utils.requireLogin, admin.role); app.get('/admin/new-role', utils.requireLogin, admin.newRole); app.post('/admin/new-role', utils.requireLogin, admin.newRole); app.get('/admin/edit-role/:id', utils.requireLogin, admin.editRole); app.get('/admin/edit-role', utils.requireLogin, admin.role); app.post('/admin/edit-role', utils.requireLogin, admin.editRole); app.get('/admin/user-category', utils.requireLogin, adminSimaya.userCategory); app.get('/admin/new-user-category', utils.requireLogin, adminSimaya.newUserCategory); app.post('/admin/new-user-category', utils.requireLogin, adminSimaya.newUserCategory); app.get('/admin/edit-user-category/:id', utils.requireLogin, adminSimaya.editUserCategory); app.post('/admin/edit-user-category', utils.requireLogin, adminSimaya.editUserCategory); app.get('/admin/new-user', utils.requireLogin, adminSimaya.newUser); app.post('/admin/new-user', utils.requireLogin, adminSimaya.newUser); app.get('/admin/edit-user/:id', utils.requireLogin, adminSimaya.editUser); app.get('/admin/edit-user', utils.requireLogin, admin.user); app.post('/admin/edit-user', utils.requireLogin, adminSimaya.editUser); app.get('/admin/user-in-org', utils.requireLogin, adminSimaya.userListInOrgJSON); app.post('/admin/head-in-org', utils.requireLogin, adminSimaya.headInOrgJSON); app.del('/admin/head-in-org', utils.requireLogin, adminSimaya.removeHeadInOrg); app.post('/admin/remove-users', utils.requireLogin, admin.removeUsers); app.get('/admin/change-password/:id', utils.requireLogin, admin.changePassword); app.get('/admin/change-password', utils.requireLogin, admin.user); app.post('/admin/change-password', utils.requireLogin, admin.changePassword); app.get('/admin/email-list/:id', utils.requireLogin, admin.emailList); app.get('/admin/email-list', utils.requireLogin, admin.user); app.post('/admin/email-list', utils.requireLogin, admin.emailList); app.get('/admin/associate-role/:id', utils.requireLogin, admin.associateRole); app.get('/admin/associate-role', utils.requireLogin, admin.user); app.post('/admin/associate-role', utils.requireLogin, admin.associateRole); app.get('/admin/disk-status', utils.requireLogin, adminSimaya.diskStatus); app.get('/admin/phones/:id', admin.phones); app.post('/admin/phones/:id', admin.phones); app.all('/admin/announcement', utils.requireLogin, announcement.showAndUpdate); app.all('/admin/audit', utils.requireLogin, adminSimaya.auditList); app.get('/admin/audit/:id', utils.requireLogin, adminSimaya.auditDetail); app.get('/admin/nodes', utils.requireLogin, adminSimaya.getNodes); app.get('/admin/nodes/requests', utils.requireLogin, adminSimaya.getNodeRequests); app.post('/l/nodes', adminSimaya.createNode); // simaya-l local admin app.get('/admin/nodes', utils.requireLogin, adminSimaya.getNodes); app.post('/admin/nodes/:id', utils.requireLogin, adminSimaya.putNodeJSON); app.get('/admin/nodes/:id/cert', utils.requireLogin, adminSimaya.getNodeCert); app.del('/admin/nodes/:id', utils.requireLogin, adminSimaya.removeNodeJSON); app.get("/admin/nodes/:id/check", adminSimaya.checkLocalNode); app.get("/admin/nodes/:id/syncCheck", adminSimaya.checkSync); app.get("/admin/nodes/:id/sync", adminSimaya.syncLocalNode); app.get('/admin/node/requests', utils.requireLogin, adminSimaya.getNodeRequests); app.post('/admin/node/requests', utils.requireLogin, adminSimaya.putNodeRequests); }
'use strict'; /** * Manages the search page and its search results. */ angular.module('PartyCrasherApp') .controller('SearchController', function ( $scope, $location, $routeParams, PartyCrasher, CrashReport, PROJECT_NAMES, DEFAULT_THRESHOLD ) { var q = $routeParams.q; var project = $routeParams.project || null; var from = $routeParams.from || 0; var size = $routeParams.size || 10; var since = $routeParams.since || null; var until = $routeParams.until || null; $scope.projects = PROJECT_NAMES; $scope.search = search; $scope.search.query = q; $scope.search.project = project; $scope.search.from = from | 0; // | 0 coerces to numeric type $scope.search.size = size | 0; $scope.search.since = since; $scope.search.until = until; $scope.searchBucketsUrl = '/ui' + PartyCrasher.searchTopBucketsUrl({ project, threshold: DEFAULT_THRESHOLD, q, since, until, from, size}); $scope.loading = true; PartyCrasher.searchQuery({ project, q, since, until, from, size }) .then(results => { var hits = results; var reports = _.map(hits, (c) => {return new CrashReport(c);}); $scope.hasResults = hits.length > 0; $scope.reports = reports; $scope.errorMessage = null; $scope.loading = false; }).catch(error => { $scope.hasResults = false; $scope.reports = null; $scope.errorMessage = error.data.message; $scope.loading = false; }); function search() { var query = $scope.search.query; var project = $scope.search.project; var from = $scope.search.from; var size = $scope.search.size; var since = $scope.search.since; var until = $scope.search.until; $location .search('q', query) .search('since', since) .search('until', until) .search('from', from) .search('size', size) .path(`/${project}/search`); } function prevPage() { $location.search('from', ($scope.search.from | 0) - ($scope.search.size | 0)); } function nextPage() { $location.search('from', ($scope.search.from | 0) + ($scope.search.size | 0)); } $scope.prevPage = prevPage; $scope.nextPage = nextPage; });
/** * Rule the words! KKuTu Online * Copyright (C) 2017 JJoriping(op@jjo.kr) * * 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/>. */ delete window.WebSocket; delete window.setInterval; delete window.setTimeout;
define(function(require) { var Backbone = require('backbone'); var Adapt = require('coreJS/adapt'); var ResourcesView = Backbone.View.extend({ className: "resources", initialize: function() { this.listenTo(Adapt, 'remove', this.remove); this.render(); }, events: { 'click .resources-filter a': 'onFilterClicked' }, render: function() { var collectionData = this.collection.toJSON(); var modelData = this.model.toJSON(); var template = Handlebars.templates["resources"]; this.$el.html(template({model: modelData, resources:collectionData, _globals: Adapt.course.get('_globals')})); _.defer(_.bind(this.postRender, this)); return this; }, postRender: function() { this.listenTo(Adapt, 'drawer:triggerCustomView', this.remove); }, onFilterClicked: function(event) { event.preventDefault(); var $currentTarget = $(event.currentTarget); this.$('.resources-filter a').removeClass('selected'); var filter = $currentTarget.addClass('selected').attr('data-filter'); var items = []; if (filter === 'all') { items = this.$('.resources-item').removeClass('display-none'); } else { this.$('.resources-item').removeClass('display-none').not("." + filter).addClass('display-none'); items = this.$('.resources-item.' + filter); } if (items.length === 0) return; $(items[0]).a11y_focus(); } }); return ResourcesView; })
/* =========================================================== Resonance NPC Name: Minister of Magic Map(s): Mushroom Castle: Corner of Mushroom Forest(106020000) Description: Quest - Exploring Mushroom Forest(3) ============================================================= Version 1.0 - Script Done.(18/7/2010) ============================================================= */ importPackage(Packages.client); var status = -1; function start(mode, type, selection) { status++; if (mode != 1) { if(type == 1 && mode == 0) status -= 2; else{ qm.sendOk("Why did you even ask if you were going to say no to this?#"); qm.dispose(); return; } } if (status == 0) qm.sendAcceptDecline("I think i've heard of a potion that breaks these kinds of barriers. I think it's called #bKiller Mushroom Spores#k? Hmmm... outside, you'll find the Mushroom Scholar #bScarrs#k waiting outside. #bScarrs#k is an expert on mushrooms, so go talk to him."); if (status == 1){ qm.forceStartQuest(); qm.sendOk("I am confident #kScarrs#k will do everything to help you."); qm.dispose(); } } function end(mode, type, selection) { status++; if (mode != 1) { if(type == 1 && mode == 0) status -= 2; else{ qm.dispose(); return; } } if (status == 0) qm.sendOk("Ah, so you're the explorer people were talking about. I'm #bScarrs, the Royal Mushroom Scholar#k representing the Kingdom of Mushroom. So you need some #kKiller Mushroom Spores#k?"); if (status == 1){ qm.gainExp(4200); qm.sendOk("#kKiller Mushroom Spores#k... I think i've heard of them before..."); qm.forceCompleteQuest(); qm.dispose(); } }
var searchData= [ ['norm',['norm',['../class_complex.html#a5e83adc6e5407e1173c915e43d4c0e58',1,'Complex']]] ];
paella.addPlugin(function() { return class ElasticsearchSaverPlugin extends paella.userTracking.SaverPlugIn { getName() { return "es.upv.paella.usertracking.elasticsearchSaverPlugin"; } checkEnabled(onSuccess) { this._url = this.config.url; this._index = this.config.index || "paellaplayer"; this._type = this.config.type || "usertracking"; var enabled = true; if (this._url == undefined){ enabled = false; paella.log.debug("No ElasticSearch URL found in config file. Disabling ElasticSearch PlugIn"); } onSuccess(enabled); } log(event, params) { var p = params; if (typeof(p) != "object") { p = {value: p}; } let currentTime = 0; paella.player.videoContainer.currentTime() .then((t) => { currentTime = t; return paella.player.videoContainer.paused(); }) .then((paused) => { var log = { date: new Date(), video: paella.initDelegate.getId(), playing: !paused, time: parseInt(currentTime + paella.player.videoContainer.trimStart()), event: event, params: p }; paella.utils.ajax.post({url:this._url+ "/"+ this._index + "/" + this._type + "/", params:JSON.stringify(log) }); }); } } });
var Base = require("./../plugin"); module.exports = class extends Base { getAffectedDefOnIdle() { return 3; } }
/** * Produces a jQuery dialog box, used for * creating an image annotations in the * image annotation module and the critical * edition module. * @returns DialogBox(jQuery) */ function annotation_dialog() { var img_base_path = Drupal.settings.islandora_image_annotation.images_path; var html_text = ''+ '<div id="create_annotation_box">'+ '<div id="hidden_annotation_type" type="hidden"></div>'+ '<div style="display:inline; margin-top: 3px; padding-left: 5px;">'+ '<img id="annoShape_rect" class="annoShape" src="' + img_base_path + '/draw_rect.png" style="padding-left: 2px; padding-top: 1px;"/>'+ '<img id="annoShape_circ" class="annoShape" src="' + img_base_path + '/draw_circ.png" style="padding-left: 1px;"/>'+ '<img id="annoShape_poly" class="annoShape" src="' + img_base_path + '/draw_poly.png" style="padding: 2px;"/>'+ '<hr style="margin: 0px; padding: 0px; height: 1px;"/>'+ '</div>'+ '<div id="create_annos_block" class="dragBlock">'+ '<div class="element-wrap">'+ '<label for="anno_title">Title:</label>'+ '<input id="anno_title" type="text" size="28"></input>'+ '</div>'+ '<div id ="islandora_classification" class="element-wrap">'+ '<div id="type_wrapper" class="element-wrap">'+ '<label for="anno_type">Type:</label>'+ '<input id="anno_classification" type="text" size="28"></input>'+ '</div>'+ '</div>'+ '<div id ="color-picker-wrapper" class="element-wrap">'+ '<label for="anno_color">Color:</label>'+ '<input id ="anno_color" type="hidden" name="color4" value="#91843c" class="color-picker" size="7" />'+ '<input id ="anno_color_activated" type="hidden" value ="" size="7" />'+ '</div>'+ '<div id ="stroke-width-wrapper" class="element-wrap">'+ '<label for="stroke_width">Stroke Width:</label>'+ '<input id="stroke_width" type="text" size="5" value=".3"></input>'+ '</div>'+ '<div class="element-wrap">'+ '<label for="anno_text">Annotation:</label>'+ '<textarea id="anno_text" cols="40" rows="5"></textarea>'+ '</div>'+ '<span style="width:200px;margin:0px;padding:0px;float:left">'+ '<ul id="create_body" style="width: 200px; list-style:none;font-size:10pt;margin:0;padding:0;">'+ '</ul>'+ '</span>'+ '</div>'+ '</div>'; var entity_combobox = ''+ '<div id="entity_wrapper" class="element-wrap">'+ '<label for="cboAddEntity">Entity</label>'+ '<select id="cboAddEntity" class="easyui-combobox" name="Add Entity" style="width:100px;">'+ '<option>Tag Person</option>'+ '<option>Tag Event</option>'+ '<option>Tag Place</option>'+ '<option>Tag Organization</option>'+ '</select>'+ '<input id="cboEntityLookup"></input>'+ '<div id="hidden_entity" type="hidden" data-entity=""></div>' '</div>'; $(document.body).append(html_text); $('#islandora_classification').addClass("dialog-entity-group"); // Optionally allow/disallow users from tagging entities. if (Drupal.settings.islandora_image_annotation.allow_entity_linking) { $('#islandora_classification').append(entity_combobox); $('#cboEntityLookup').autocomplete({ source: function(request,response){ // lookup_entity is shared by image annotation and critical editions, // so it has been exposed to both via 'lookup_entity() function in // entity_search.js. var result = lookup_entity($('#cboAddEntity').find('option:selected').text() + '/' + '?entities_query=' + request.term); response($.map(result, function(item){ return { label: item.identifier, value: item.identifier, data: item.Object, }; })); }, select: function(event, ui) { // Add the selected entity data to the hidden // 'hidden_entity' field. $('#hidden_entity').data('entity',ui.item); }, }); } var annotation_dialog = $('#create_annotation_box'); return annotation_dialog.dialog({ modal: true, open: function(event,ui) { // Fix to paint random colors. if(Drupal.settings.islandora_image_annotation.can_choose == 1) { var rcol = get_random_color(); $('#anno_color').attr('value',rcol); $('.miniColors-trigger').css('background-color',rcol); $('#color-picker-wrapper').hide(); } }, title: 'Annotate', resizable: false, closeOnEscape: false, height: 470, width: 380, buttons: { 'Save': function() { saveAndEndAnnotating(); closeAndEndAnnotating(); // Reset hidden data for the next time this // dialog is used. if($('#hidden_entity')) { $('#hidden_entity').data('entity',''); } $('#hidden_annotation_type').attr('anno_type',''); $('#hidden_annotation_type').attr('urn',''); annotation_dialog.dialog('close'); }, 'Cancel': function() { closeAndEndAnnotating(); annotation_dialog.dialog('close'); $('#hidden_annotation_type').text(''); } } }); };
'use strict'; module.exports = function(timestamp) { var wasWindowIdled = timestamp - this.previousTimeStamp > 100; var isLoop = this.states[this.activeState].loop !== undefined ? this.states[this.activeState].loop : true; var progressPercent, isLooping, nextGradient; // If tab was inactive then resumed, reset the previous timestamp if (this.previousTimeStamp === null || wasWindowIdled) { this.previousTimeStamp = timestamp; } // Compute progress and save the timestamp this.progress = this.progress + (timestamp - this.previousTimeStamp); progressPercent = (this.progress / this.activetransitionSpeed * 100).toFixed(2); this.previousTimeStamp = timestamp; // Set the new gradient colors in a property this.refreshColors(progressPercent); // Continue the animation or prepare for the next one if (progressPercent < 100) { this.animation = requestAnimationFrame(this.animateColors.bind(this)); } else { // if the current animation index is inferior to the penultimate gradient // or to the last gradient with the loop mode activated if (this.channelsIndex < this.states[this.activeState].gradients.length - 2 || isLoop) { // Set the active transition speed to the active state one after changing state if (this.isChangingState) { this.activetransitionSpeed = this.states[this.activeState].transitionSpeed || 5000; } // Resetting properties this.previousTimeStamp = null; this.progress = 0; this.channelsIndex++; isLooping = false; // If it's going to loop or if it's the transition after the loop if (this.channelsIndex === this.states[this.activeState].gradients.length - 1) { isLooping = true; } else if (this.channelsIndex === this.states[this.activeState].gradients.length) { this.channelsIndex = 0; } // Checking the next gradient to send in args of an event and a callback nextGradient = this.states[this.activeState].gradients[this.channelsIndex + 1] === undefined ? this.states[this.activeState].gradients[0] : this.states[this.activeState].gradients[this.channelsIndex + 1]; // Compute the colors for the transition and render a new frame this.setColors(); this.animation = requestAnimationFrame(this.animateColors.bind(this)); // Callback and Event if (this.callbacks.onGradientChange) this.callbacks.onGradientChange({ isLooping: isLooping, colorsFrom: this.states[this.activeState].gradients[this.channelsIndex], colorsTo: nextGradient, activeState: this.activeState }); this.canvas.dispatchEvent(this.events.gradientChange({ isLooping: isLooping, colorsFrom: this.states[this.activeState].gradients[this.channelsIndex], colorsTo: nextGradient, activeState: this.activeState }) ); // Else if it was the last gradient on the list and the loop mode is off } else { cancelAnimationFrame(this.animation); // Callback and Event if (this.callbacks.onEnd) this.callbacks.onEnd(); this.canvas.dispatchEvent(new CustomEvent('granim:end')); } } };
/** * @author Richard Davey <rich@photonstorm.com> * @copyright 2016 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ /** * A InversePointProxy is an internal class that allows for direct getter/setter style property access to Arrays and TypedArrays but inverses the values on set. * * @class Phaser.Physics.P2.InversePointProxy * @constructor * @param {Phaser.Physics.P2} world - A reference to the P2 World. * @param {any} destination - The object to bind to. */ Phaser.Physics.P2.InversePointProxy = function (world, destination) { this.world = world; this.destination = destination; }; Phaser.Physics.P2.InversePointProxy.prototype.constructor = Phaser.Physics.P2.InversePointProxy; /** * @name Phaser.Physics.P2.InversePointProxy#x * @property {number} x - The x property of this InversePointProxy get and set in pixels. */ Object.defineProperty(Phaser.Physics.P2.InversePointProxy.prototype, "x", { get: function () { return this.world.mpxi(this.destination[0]); }, set: function (value) { this.destination[0] = this.world.pxmi(value); } }); /** * @name Phaser.Physics.P2.InversePointProxy#y * @property {number} y - The y property of this InversePointProxy get and set in pixels. */ Object.defineProperty(Phaser.Physics.P2.InversePointProxy.prototype, "y", { get: function () { return this.world.mpxi(this.destination[1]); }, set: function (value) { this.destination[1] = this.world.pxmi(value); } }); /** * @name Phaser.Physics.P2.InversePointProxy#mx * @property {number} mx - The x property of this InversePointProxy get and set in meters. */ Object.defineProperty(Phaser.Physics.P2.InversePointProxy.prototype, "mx", { get: function () { return this.destination[0]; }, set: function (value) { this.destination[0] = -value; } }); /** * @name Phaser.Physics.P2.InversePointProxy#my * @property {number} my - The y property of this InversePointProxy get and set in meters. */ Object.defineProperty(Phaser.Physics.P2.InversePointProxy.prototype, "my", { get: function () { return this.destination[1]; }, set: function (value) { this.destination[1] = -value; } });
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.Twitter = undefined; var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _reactcss = require('reactcss'); var _reactcss2 = _interopRequireDefault(_reactcss); var _map = require('lodash/map'); var _map2 = _interopRequireDefault(_map); var _color = require('../../helpers/color'); var _color2 = _interopRequireDefault(_color); var _common = require('../common'); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var Twitter = exports.Twitter = function Twitter(_ref) { var onChange = _ref.onChange, colors = _ref.colors, width = _ref.width, triangle = _ref.triangle; var styles = (0, _reactcss2.default)({ 'default': { card: { width: width, background: '#fff', border: '0 solid rgba(0,0,0,0.25)', boxShadow: '0 1px 4px rgba(0,0,0,0.25)', borderRadius: '4px', position: 'relative' }, body: { padding: '15px 9px 9px 15px' }, label: { fontSize: '18px', color: '#fff' }, triangle: { width: '0px', height: '0px', borderStyle: 'solid', borderWidth: '0 9px 10px 9px', borderColor: 'transparent transparent #fff transparent', position: 'absolute' }, triangleShadow: { width: '0px', height: '0px', borderStyle: 'solid', borderWidth: '0 9px 10px 9px', borderColor: 'transparent transparent rgba(0,0,0,.1) transparent', position: 'absolute' }, hash: { background: '#F0F0F0', height: '30px', width: '30px', borderRadius: '4px 0 0 4px', float: 'left', color: '#98A1A4', display: 'flex', alignItems: 'center', justifyContent: 'center' }, input: { width: '100px', fontSize: '14px', color: '#666', border: '0px', outline: 'none', height: '28px', boxShadow: 'inset 0 0 0 1px #F0F0F0', borderRadius: '0 4px 4px 0', float: 'left', paddingLeft: '8px' }, swatch: { width: '30px', height: '30px', float: 'left', borderRadius: '4px', margin: '0 6px 6px 0' }, clear: { clear: 'both' } }, 'hide-triangle': { triangle: { display: 'none' }, triangleShadow: { display: 'none' } }, 'top-left-triangle': { triangle: { top: '-10px', left: '12px' }, triangleShadow: { top: '-11px', left: '12px' } }, 'top-right-triangle': { triangle: { top: '-10px', right: '12px' }, triangleShadow: { top: '-11px', right: '12px' } } }, { 'hide-triangle': triangle === 'hide', 'top-left-triangle': triangle === 'top-left', 'top-right-triangle': triangle === 'top-right' }); var handleChange = function handleChange(hex, e) { _color2.default.isValidHex(hex) && onChange({ hex: hex, source: 'hex' }, e); }; return _react2.default.createElement( 'div', { style: styles.card, className: 'twitter-picker' }, _react2.default.createElement('div', { style: styles.triangleShadow }), _react2.default.createElement('div', { style: styles.triangle }), _react2.default.createElement( 'div', { style: styles.body }, (0, _map2.default)(colors, function (c, i) { return _react2.default.createElement(_common.Swatch, { key: i, color: c, hex: c, style: styles.swatch, onClick: handleChange }); }), _react2.default.createElement( 'div', { style: styles.hash }, '#' ), _react2.default.createElement(_common.EditableInput, { placeholder: 'ff691f', style: { input: styles.input }, value: '', onChange: handleChange }), _react2.default.createElement('div', { style: styles.clear }) ) ); }; Twitter.defaultProps = { width: '276px', colors: ['#FF6900', '#FCB900', '#7BDCB5', '#00D084', '#8ED1FC', '#0693E3', '#ABB8C3', '#EB144C', '#F78DA7', '#9900EF'], triangle: 'top-left' }; exports.default = (0, _common.ColorWrap)(Twitter);
Ext.define('EnergyApp.controller.Main', { extend: 'Ext.app.Controller', stores: ['ChartStore', 'YearStore', 'NavigationStore'], config: { refs: { main: "#main", nav: '#navigation', navButton: '#navigationButton', chartView: '#chartView', viewport: '#ext-viewport' }, control: { nav: { leafitemtap: 'onNavTap' }, navButton: { tap: 'showNav' }, viewport: { orientationchange: 'onOrientationChange' }, "#prevButton": { tap: "prev" }, "#nextButton": { tap: "next" } } }, prev: function () { this.getChartView().previous(); }, next: function () { this.getChartView().next(); }, launch: function () { this.onOrientationChange(Ext.Viewport, Ext.Viewport.getOrientation()); }, showNav: function () { this.getMain().getSheet().show(); }, onNavTap: function (buttonx, list, index, item) { var me = this, record = list.getStore().getAt(index), mainView = me.getMain(), mainRegion = mainView.getMainRegion(), mainViewDocked = mainView.getNavigationDocked(), chartView = me.getChartView(), type = record.parentNode.data.key, state = record.data.key; mainRegion.setActiveItem(chartView, 'slide'); mainView.setTitle(record.get('label')); Ext.getCmp('prevButton').setDisabled(true); Ext.getCmp('nextButton').setDisabled(true); if (!mainViewDocked) { this.getMain().getSheet().hide(); } Ext.Ajax.request({ url: 'resources/data/' + type + "_" + state + ".json", success: function (response, opts) { // decode responseText in order to create json object var data = Ext.decode(response.responseText); // load it into the charts store: this will update the area series Ext.getStore('ChartStore').setData(data.items); // reset chart's legend and axes when category changes if (this.oldType !== type) { var areaChart = chartView.down('area chart'), areaChartAxes = Ext.ComponentQuery.query('axis', areaChart); for (var i = 0; i < areaChartAxes.length; i++) { areaChartAxes[i].setVisibleRange([0, 1]); } areaChart.redraw(); areaChart.resetLegendStore(); } EnergyApp.app.loadPieAtYear(); Ext.getCmp('prevButton').setDisabled(chartView.getActiveIndex() === 0); Ext.getCmp('nextButton').setDisabled(chartView.getActiveIndex() === chartView.getMaxItemIndex()); this.oldType = type; }, failure: function (response) { mainView.setMasked({ msg: 'Failed loading!' }); }, scope: this }); }, onOrientationChange: function (viewport, orientation) { this.getMain().orientate(orientation); } });
import clearKeyword from './clearKeyword' import findCampaign from './findCampaign' import findGroup from './findGroup' import openFile from './openFile' import parseCSV from './parseCSV' import utmMark from './utmMark' import writeCSV from './writeCSV' import thankNotify from './thankNotify' export { clearKeyword, findCampaign, findGroup, openFile, parseCSV, utmMark, writeCSV, thankNotify, }
/** * 2007-2016 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/osl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@prestashop.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA <contact@prestashop.com> * @copyright 2007-2016 PrestaShop SA * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ $(document).ready(function() { if ($('input[name=PS_MAIL_METHOD]:checked').val() == 2) $('#mail_fieldset_smtp').show(); else $('#mail_fieldset_smtp').hide(); $('input[name=PS_MAIL_METHOD]').on('click', function() { if ($(this).val() == 2) $('#mail_fieldset_smtp').slideDown(); else $('#mail_fieldset_smtp').slideUp(); }); });
'use strict' var Bluebird = require('bluebird') var fs = require('graceful-fs') var path = require('path') var mkdirp = require('mkdirp') var rimraf = require('rimraf') var test = require('tap').test var common = require('../common-tap.js') var dir = path.resolve(__dirname, path.basename(__filename, '.js')) var pkg = path.resolve(dir, 'pkg-with-bundled') var dep = path.resolve(dir, 'a-bundled-dep') var pj = JSON.stringify({ name: 'pkg-with-bundled', version: '1.0.0', dependencies: { 'a-bundled-dep': 'file:../a-bundled-dep-2.0.0.tgz' }, bundledDependencies: { 'a-bundled-dep': 'file:../a-bundled-dep-2.0.0.tgz' } }, null, 2) + '\n' var pjDep = JSON.stringify({ name: 'a-bundled-dep', version: '2.0.0' }, null, 2) + '\n' test('setup', function (t) { bootstrap() t.end() }) test('handles non-array bundleddependencies', function (t) { return Bluebird.try(() => { return common.npm(['pack', 'a-bundled-dep/'], {cwd: dir, stdio: [0, 1, 2]}) }).spread((code) => { t.is(code, 0, 'built a-bundled-dep') return common.npm(['install'], {cwd: pkg, stdio: [0, 1, 2]}) }).spread((code) => { t.is(code, 0, 'prepared pkg-with-bundled') return common.npm(['pack', 'pkg-with-bundled/'], {cwd: dir, stdio: [0, 1, 'pipe']}) }).spread((code, _, stderr) => { t.equal(code, 0, 'exited with a error code') t.equal(stderr, '') }) }) test('cleanup', function (t) { cleanup() t.end() }) function bootstrap () { cleanup() mkdirp.sync(dir) mkdirp.sync(path.join(dir, 'node_modules')) mkdirp.sync(pkg) fs.writeFileSync(path.resolve(pkg, 'package.json'), pj) mkdirp.sync(dep) fs.writeFileSync(path.resolve(dep, 'package.json'), pjDep) } function cleanup () { rimraf.sync(dir) }
/* Copyright 2009 Pieter Iserbyt This file is part of Pamela. Pamela 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. Pamela 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 Pamela. If not, see <http://www.gnu.org/licenses/>. */ // Class IFace button function IFaceButton(x, y, width, height) { this.width = width; this.height = height; this.moveTo(x, y); } IFaceButton.prototype.moveTo = function(x, y) { this.x = x; this.y = y; }; IFaceButton.prototype.execute = function() { }; IFaceButton.prototype.draw = function() { }; IFaceButton.prototype.isHovered = function(x, y) { return (this.x <= x) && (this.y <= y) && (this.x + this.width >= x) && (this.y + this.height >= y); }; // Class fullscreen button jQuery.extend(FullScreenButton.prototype, IFaceButton.prototype); function FullScreenButton(x, y) { this.width = 64; this.height = 64; this.isFullScreen = false; this.isHover = false; this.minCol = new Image(); this.minCol.src = "img/min-col.png"; this.maxCol = new Image(); this.maxCol.src = "img/max-col.png"; this.min = new Image(); this.min.src = "img/min.png"; this.max = new Image(); this.max.src = "img/max.png"; }; FullScreenButton.prototype.draw = function() { if (this.isFullScreen) { if (this.isHover) { context.drawImage(this.minCol, this.x, this.y); } else { context.drawImage(this.min, this.x, this.y); } } else { if (this.isHover) { context.drawImage(this.maxCol, this.x, this.y); } else { context.drawImage(this.max, this.x, this.y); } } }; FullScreenButton.prototype.execute = function() { this.isFullScreen = !this.isFullScreen; //TODO: do somth }; // Class DownloadScriptButton jQuery.extend(DownloadScriptButton.prototype, IFaceButton.prototype); function DownloadScriptButton(x, y) { this.width = 64; this.height = 64; this.isHover = false; this.dlCol = new Image(); this.dlCol.src = "img/dl-col.png"; this.dl = new Image(); this.dl.src = "img/dl.png"; }; DownloadScriptButton.prototype.draw = function() { if (this.isHover) { context.fillStyle = config.buttonColor; context.font = "18pt sans-serif"; context.fillText("Download pamela scanner script", this.x, this.y - 10); context.drawImage(this.dlCol, this.x, this.y); } else { context.drawImage(this.dl, this.x, this.y); } }; DownloadScriptButton.prototype.execute = function() { location.href = config.scannerDownloadLink; }; // Class IFace buttons function IFaceButtons() { this.buttons = []; }; IFaceButtons.prototype.add = function(button) { this.buttons[this.buttons.length] = button; this.reposition(); }; IFaceButtons.prototype.reposition = function() { var x = 20; var y = height - 64; for (var i = 0; i < this.buttons.length; i++) { this.buttons[i].moveTo(x, y); x += 64; } }; IFaceButtons.prototype.draw = function() { for (var i = 0; i < this.buttons.length; i++) this.buttons[i].draw(); }; IFaceButtons.prototype.mousemove = function(event) { for (var i =0; i < this.buttons.length; i++) { var b = this.buttons[i]; b.isHover = b.isHovered(event.clientX, event.clientY); } }; IFaceButtons.prototype.mouseclick = function(event) { for (var i =0; i < this.buttons.length; i++) { var b = this.buttons[i]; if (b.isHovered(event.clientX, event.clientY)) b.execute(); } };
/* Pasta apps... - pensada para possuir módulos (entry_points) independentes que se reflitam estruturalmente os apps do backend. */
// Copyright © 2013 BlackJet Software Ltd (http://www.blackjetsoftware.com/) // Source code distributed under the terms of the GNU General Public License v3 (http://www.gnu.org/licenses/gpl.txt) if (typeof window.taskTimer === 'undefined') { window.taskTimer = {}; } window.taskTimer.utils = (function () { var getDateWithoutTime = function(date) { var year = date.getFullYear(); var month = date.getMonth(); var day = date.getDate(); return new Date(year, month, day); }; var getDayDifference = function (date1, date2) { var datePart1 = getDateWithoutTime(date1); var datePart2 = getDateWithoutTime(date2); var timeDiffMs = datePart1.getTime() - datePart2.getTime(); var dayDiffDays = timeDiffMs / (1000 * 60 * 60 * 24); return dayDiffDays; }; var pad = function (num) { var s = "0" + num; return s.substr(s.length - 2); }; var secondsToHMS = function(totalSeconds) { var hours = Math.floor(totalSeconds / 60 / 60); var minutes = Math.floor(totalSeconds / 60) - (hours * 60); var seconds = Math.floor(totalSeconds) - (minutes * 60); return { hours: pad(hours), minutes: pad(minutes), seconds: pad(seconds) }; }; var wrapInSpan = function (val, cssClass) { return '<span class="' + cssClass + '">' + val + '</span>'; }; var hmsToHtml = function(h, m, s) { return h == 0 ? wrapInSpan(pad(m), 'minutes') + ':' + wrapInSpan(pad(s), 'seconds') : wrapInSpan(pad(h), 'hours') + ':' + wrapInSpan(pad(m), 'minutes') + ':' + wrapInSpan(pad(s), 'seconds'); }; var dateToHtml = function(date, today) { if (today == null) { today = new Date(); } // Returns a fairly unambiguous date format of the specified date (in local time) that should be recognisable to a large proportion of users var dayNamesShort = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; var dayNames = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; var monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; var dayDiffFromToday = getDayDifference(today, date); var timeHtml = timeToHtml(date); if (dayDiffFromToday == 0) return timeHtml; if (dayDiffFromToday < 7) return dayNames[date.getDay()] + ' ' + timeHtml; var dayNumber = date.getDate(); var shortDayName = dayNamesShort[date.getDay()]; var monthName = monthNames[date.getMonth()]; var year = date.getFullYear(); return shortDayName + ' ' + dayNumber + ' ' + monthName + ' ' + year + ' ' + timeHtml; }; var timeToHtml = function(date) { return hmsToHtml(date.getHours(), date.getMinutes(), date.getSeconds()); }; var periodToHtml = function(startDate, endDate) { var withinSameDay = function() { return startDate.getFullYear() == endDate.getFullYear() && startDate.getMonth() == endDate.getMonth() && startDate.getDate() == endDate.getDate(); }; var startDateHtml = dateToHtml(startDate); var endDateHtml = endDate == null ? 'now' : withinSameDay() ? timeToHtml(endDate) : dateToHtml(endDate); return '<span class="periodRange">' + '<span class="startDate" title="' + startDate + '">' + startDateHtml + '</span>' + ' to ' + '<span class="endDate" title="' + endDate + '">' + endDateHtml + '</span>' + '</span>'; }; return { getDateWithoutTime: getDateWithoutTime, secondsToHMS: secondsToHMS, secondsToHMSHtml: function(totalSeconds) { var hms = secondsToHMS(totalSeconds); return hmsToHtml(hms.hours, hms.minutes, hms.seconds); }, getDayDifference: getDayDifference, dateToHtml: dateToHtml, timeToHtml: timeToHtml, periodToHtml: periodToHtml }; })();
'use strict'; /* global require, module */ var _ = require('lodash'); var View = require('./view'); var BUDDY_UP_ORIGIN = require('../buddyup').ORIGIN; function Question() { View.apply(this, arguments); } module.exports = Question; Question.prototype = { __proto__: View.prototype, _SELECTORS: _.merge({ MAIN: 'iframe[src="' + BUDDY_UP_ORIGIN + '/question.html"]', }, View.prototype._SELECTORS) };
function TestCase(n, d, e, a) this.expect = e; function reportCompare(expected, actual, description) { typeof actual } expect = 1; var summary = 'Do not assert: top < ss->printer->script->depth'; var actual = 'No Crash'; var expect = 'No Crash'; test(); function notInlined(f) { // prevent inlining this function, as a consequence, it prevent inlining // Array.prototype.some (Bug 1087468) with ({}) {} return f; } function test(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z) { try { p = [1].some(notInlined(function (y) test())) ? 4 : 0x0041; } catch (ex) {} reportCompare(expect, actual, summary) } test(); TestCase(); test()
/** * Elastic search query builder service */ angular.module('superdesk.elastic').service('es', [ function() { var SIZE_DEFAULT = 25; /** * Set from/size for given query and params * * @param {Object} query * @param {Object} params * @returns {Object} */ function paginate(query, params) { var page = params.page || 1; query.size = params.size || SIZE_DEFAULT; query.from = (page - 1) * query.size; return query; } /** * Build query using elastic query dsl * * @param {Object} params * @param {Array} filters * @returns {Object} */ function buildQuery(params, filters) { var query = {filtered: {}}; if (filters && filters.length) { query.filtered.filter = {and: filters}; } if (params.q) { query.filtered.query = {query_string: {query: params.q}}; } return paginate({query: query}, params); } return buildQuery; }]);
/* * Spreed WebRTC. * Copyright (C) 2013-2014 struktur AG * * This file is part of Spreed WebRTC. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ "use strict"; define(['angular', 'underscore'], function(angular, _) { // localStatus return ["mediaStream", "$window", function(mediaStream, $window) { var current = null; var commit = false; var localStatus = { update: function(status) { // Put into current. if (current && _.isEqual(status, current)) { return; } //console.log("Status update", status); current = angular.copy(status); if (!commit) { commit = true; $window.setTimeout(localStatus.commit, 1000) } }, commit: function() { // TODO(longsleep): Delay the commit until connection has been established for a while and authentication is complete. if (commit) { commit = false; //console.log("Status update commit", current); mediaStream.api.updateStatus(current); } }, clear: function() { current = null; }, get: function() { return current; } }; return localStatus; }]; });
/** * This file is part of Shoop. * * Copyright (c) 2012-2015, Shoop Ltd. All rights reserved. * * This source code is licensed under the AGPLv3 license found in the * LICENSE file in the root directory of this source tree. */ const functions = {}; /** * @return Array */ function maybeSplit(strOrArray) { if (Array.isArray(strOrArray)) { return strOrArray; } return ("" + strOrArray).split(/,\s*/); } functions.on = function on(events, fn) { events = maybeSplit(events); this.each((el) => { events.forEach((event) => el.addEventListener(event, fn)); }); return this; }; functions.off = function off(events, fn) { events = maybeSplit(events); this.each((el) => { events.forEach((event) => el.removeEventListener(event, fn)); }); return this; }; functions.each = function(fn) { this.elements.forEach(fn); return this; }; export default function init(selector, context=document) { const rv = { context: context, // querySelectorAll returns a non-live collection anyway, so it's not a bad idea // to array-fy it right here. elements: [].slice.call(context.querySelectorAll(selector)) }; for (var key in functions) { if (functions.hasOwnProperty(key)) { rv[key] = functions[key].bind(rv); } } return rv; }
/** * jQuery plugin for micro templates * * Strings are automatically escaped, but that can be disabled by setting escapeFunction to null. * * Usage examples: * * var htmlStr = '<p>Bake, uncovered, until the {greasystuff} is melted and the {pasta} is heated through, about {min} minutes.</p>' * $(htmlStr).octemplate({greasystuff: 'cheese', pasta: 'macaroni', min: 10}); * * var htmlStr = '<p>Welcome back {user}</p>'; * $(htmlStr).octemplate({user: 'John Q. Public'}, {escapeFunction: null}); * * Be aware that the target string must be wrapped in an HTML element for the plugin to work. The following won't work: * * var textStr = 'Welcome back {user}'; * $(textStr).octemplate({user: 'John Q. Public'}); * * For anything larger than one-liners, you can use a simple $.get() ajax request to get the template, * or you can embed them it the page using the text/template type: * * <script id="contactListItemTemplate" type="text/template"> * <tr class="contact" data-id="{id}"> * <td class="name"> * <input type="checkbox" name="id" value="{id}" /><span class="nametext">{name}</span> * </td> * <td class="email"> * <a href="mailto:{email}">{email}</a> * </td> * <td class="phone">{phone}</td> * </tr> * </script> * * var $tmpl = $('#contactListItemTemplate'); * var contacts = // fetched in some ajax call * * $.each(contacts, function(idx, contact) { * $contactList.append( * $tmpl.octemplate({ * id: contact.getId(), * name: contact.getDisplayName(), * email: contact.getPreferredEmail(), * phone: contact.getPreferredPhone(), * }); * ); * }); */ (function( $ ) { /** * Object Template * Inspired by micro templating done by e.g. underscore.js */ var Template = { init: function(vars, options, elem) { // Mix in the passed in options with the default options this.vars = vars; this.options = $.extend({},this.options,options); this.elem = elem; var self = this; if(typeof this.options.escapeFunction === 'function') { var keys = Object.keys(this.vars); for (var key = 0; key < keys.length; key++) { if(typeof this.vars[keys[key]] === 'string') { this.vars[keys[key]] = self.options.escapeFunction(this.vars[keys[key]]); } } } var _html = this._build(this.vars); return $(_html); }, // From stackoverflow.com/questions/1408289/best-way-to-do-variable-interpolation-in-javascript _build: function(o){ var data = this.elem.attr('type') === 'text/template' ? this.elem.html() : outerHTML(this.elem.get(0)); try { return data.replace(/{([^{}]*)}/g, function (a, b) { var r = o[b]; return typeof r === 'string' || typeof r === 'number' ? r : a; } ); } catch(e) { console.error(e, 'data:', data); } }, options: { escapeFunction: escapeHTML } }; $.fn.octemplate = function(vars, options) { var vars = vars ? vars : {}; if(this.length) { var _template = Object.create(Template); return _template.init(vars, options, this); } }; })( jQuery );
odoo.define('web.planner', function (require) { "use strict"; var core = require('web.core'); var Model = require('web.Model'); var SystrayMenu = require('web.SystrayMenu'); var Widget = require('web.Widget'); var planner = require('web.planner.common'); var webclient = require('web.web_client'); var PlannerDialog = planner.PlannerDialog; var PlannerLauncher = Widget.extend({ template: "PlannerLauncher", init: function(parent) { this._super(parent); this.planner_by_menu = {}; this.need_reflow = false; }, start: function() { var self = this; core.bus.on("change_menu_section", self, self.on_menu_clicked); var res = self._super.apply(this, arguments).then(function() { self.$el.filter('.o_planner_systray').on('click', self, self.toggle_dialog.bind(self)); return self.fetch_application_planner(); }).then(function(apps) { self.do_hide(); // hidden by default self.planner_apps = apps; return apps; }); return res; }, fetch_application_planner: function() { var self = this; var def = $.Deferred(); if (!_.isEmpty(this.planner_by_menu)) { def.resolve(self.planner_by_menu); }else{ (new Model('web.planner')).query().all().then(function(res) { _.each(res, function(planner){ self.planner_by_menu[planner.menu_id[0]] = planner; self.planner_by_menu[planner.menu_id[0]].data = $.parseJSON(self.planner_by_menu[planner.menu_id[0]].data) || {}; }); def.resolve(self.planner_by_menu); }).fail(function() {def.reject();}); } return def; }, on_menu_clicked: function(menu_id) { if (_.contains(_.keys(this.planner_apps), menu_id.toString())) { this.setup(this.planner_apps[menu_id]); this.need_reflow = true; } else { this.do_hide(); this.hide_dialog(); this.need_reflow = true; } if (this.need_reflow) { core.bus.trigger('resize'); this.need_reflow = false; } }, setup: function(planner){ var self = this; this.planner = planner; if (this.dialog) { this.dialog.destroy(); } this.dialog = new PlannerDialog(this, planner); this.dialog.$el.remove(); this.dialog.appendTo(webclient.$el); this.$(".o_planner_progress").tooltip({html: true, title: this.planner.tooltip_planner, placement: 'bottom', delay: {'show': 500}}); this.dialog.on("planner_progress_changed", this, function(percent){ self.update_parent_progress_bar(percent); }); }, update_parent_progress_bar: function(percent) { if (percent == 100) { this.$(".progress").hide(); } else { this.$(".progress").show(); } this.do_show(); this.$(".progress-bar").css('width', percent+"%"); }, hide_dialog: function() { if (this.dialog) { this.dialog.do_hide(); } }, toggle_dialog: function() { this.dialog.do_toggle(); } }); SystrayMenu.Items.push(PlannerLauncher); return { PlannerLauncher: PlannerLauncher, }; });
ItemRepo.$inject = []; export function ItemRepo() { return { scope: { repo: '=', context: '=', toggleRepo: '=', }, template: require('../views/item-repo.html'), }; }
/* global SpeechSynthesisUtterance */ 'use strict'; /*@ngInject*/ module.exports = function ($scope, _, $timeout, Question, TypingSpeed) { function setMessage(msg) { $scope.responseMessage = msg; } var CheckButtonText = { DEFAULT: 'Check Work', TRY_AGAIN: 'Recheck Work' }; // Default values. function resetSubmitPanel() { setMessage(''); $scope.checkAnswerText = CheckButtonText.DEFAULT; $scope.questionClass = 'default'; $scope.showCheckAnswerButton = true; $scope.showCheckOrContinueButton = false; $scope.showNextQuestion = false; $timeout.cancel($scope.shortAnswerPromise); } function submitAnswer() { $scope.showCheckAnswerButton = false; $scope.showCheckOrContinueButton = false; $scope.showNextQuestion = true; $scope.submit(); } resetSubmitPanel(); $scope.resetWPM = function () { TypingSpeed.reset(); }; $scope.startEditing = function () { $scope.attempting = true; }; $scope.checkAnswer = function () { var rq = $scope.question; if (rq) { rq.checkAnswer(); setMessage(rq.getResponseMessage()); $timeout.cancel($scope.shortAnswerPromise); switch (rq.status) { case Question.ResponseStatus.NO_ANSWER: { $scope.questionClass = 'try_again'; $scope.checkAnswerText = CheckButtonText.TRY_AGAIN; $scope.shortAnswerPromise = $timeout(function () { setMessage(''); $scope.questionClass = 'default'; }, 3000); break; } case Question.ResponseStatus.CORRECT: { $scope.checkAnswerText = CheckButtonText.DEFAULT; $scope.questionClass = 'correct'; submitAnswer(); break; } case Question.ResponseStatus.TYPING_ERROR_NON_STRICT: { $scope.checkAnswerText = CheckButtonText.TRY_AGAIN; $scope.questionClass = 'try_again'; // submitAnswer(); break; } case Question.ResponseStatus.TYPING_ERROR_NON_STRICT_UNFIXED: { $scope.checkAnswerText = CheckButtonText.DEFAULT; $scope.questionClass = 'try_again'; $scope.attempting = false; submitAnswer(); break; } case Question.ResponseStatus.TOO_MANY_ATTEMPTS: { $scope.questionClass = 'incorrect'; $scope.checkAnswerText = CheckButtonText.DEFAULT; $scope.$emit('showModal'); submitAnswer(); break; } default: { $scope.questionClass = 'try_again'; $scope.checkAnswerText = CheckButtonText.TRY_AGAIN; } } } }; $scope.nextProblem = function () { $scope.showNextQuestion = false; $scope.showConfirmation = false; $scope.errorReport = ''; resetSubmitPanel(); $scope.$emit('hideModal'); $scope.next(); // Defined on the directive. }; $scope.checkOrContinue = function () { if ($scope.attempting) { $scope.checkAnswer(); } else { $scope.submit(); $scope.nextProblem(); } }; /* * Event handler for input paste. This is to * prevent students from pasting into this field */ $scope.capturePasteEvent = function (event) { event.preventDefault(); }; /* * Event handler for pressing enter while focuesed * in the textarea to check answer or progress to * the next problem */ $scope.capturePressEnterEvent = function () { if ($scope.showNextQuestion) { $scope.nextProblem(); } else if ($scope.showCheckOrContinueButton) { $scope.checkOrContinue(); } else { $scope.checkAnswer(); } }; $scope.sendErrorReport = function () { $scope.report(); $scope.showReport = false; $scope.showConfirmation = true; }; $scope.speak = function (text) { if ('speechSynthesis' in window) { if (window.speechSynthesis.speaking) { window.speechSynthesis.cancel(); } else { var timer = setInterval(function () { var voices = window.speechSynthesis.getVoices(); if (voices.length !== 0) { var msg = new SpeechSynthesisUtterance(text.replace(/<[^>]*>/gi, '')); msg.voice = _.where(voices, {name: 'Samantha'})[0]; window.speechSynthesis.speak(msg); clearInterval(timer); } }, 200); } } }; };
import { openModal } from './modal'; import { changeSetting, saveSettings } from './settings'; import { openTutorial } from './tutorial'; import { isMobile } from '../is_mobile'; import { getLocale } from '../locales'; export function showOnboardingOnce() { return (dispatch, getState) => { const alreadySeen = getState().getIn(['settings', 'onboarded']); const isJa = getLocale().localeData[0].locale === 'ja'; if (!alreadySeen) { if (!isMobile(window.innerWidth) && isJa) { dispatch(openTutorial()); } else { dispatch(openModal('ONBOARDING')); } dispatch(changeSetting(['onboarded'], true)); dispatch(saveSettings()); } }; };
import { selectChoose } from "ember-power-select/test-support"; export default async function(selector = "") { await selectChoose( `${selector} .user-select`, ".ember-power-select-option", 0 ); }
jest.dontMock(appFile('actions/bounty_actions')); describe('BountyActionCreators', function() { var BountyActionCreators, Dispatcher; beforeEach(function() { $.ajax = jest.genMockFunction(); analytics.track = jest.genMockFunction(); Dispatcher = require(appFile('dispatcher')); BountyActionCreators = require(appFile('actions/bounty_actions')); Dispatcher.dispatch.mockClear(); }); describe('call()', function() { it('prevents the default action, tracks the event, and makes an AJAX request to the supplied url', function(){ BountyActionCreators.call('event.name', '/path/to/resource'); expect(analytics.track.mock.calls.length).toEqual(1); expect($.ajax.mock.calls[0][0].url).toEqual('/path/to/resource'); }); }); describe('requestBounties()', function() { it('grabs a list of filtered bounties for a product', function() { BountyActionCreators.requestBounties('helpful', { tags: ['design'], sort: 'priority', page: 1 }) request = $.ajax.mock.calls[0][0] expect(request.url).toEqual('/helpful/bounties.json') expect(request.data).toEqual({ tags: ['design'], sort: 'priority', page: 1 }) }) }) });
/*! * Ext JS Library 4.0 * Copyright(c) 2006-2011 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ Ext.define('Ext.ux.desktop.Module', { mixins: { observable: 'Ext.util.Observable' }, constructor: function (config) { this.mixins.observable.constructor.call(this, config); this.init(); }, control: function(win, events) { var p = [] for(var i in events) { p = win.query(i); if(!!p) { for(var j=0;j<p.length;j++) { p[j].on(events[i]) } } } }, init: Ext.emptyFn });
const Assign = (state, obj) => { return Object.assign({}, state, obj); } const initialState = {} const main = (state = initialState, action) => { switch (action.type) { default: return state; } } export default main
// // Password form edit user actions // // To add a new Action : // 1) Import you constant // 2) Add a function like this: // export function yourAction(var) { // return { type: YOUR_ACTION_CONSTANT, var: var } // } // import { EDIT_USER_PASSWORD_CHANGE, EDIT_USER_RESET_STATE_PASSWORD, EDIT_USER_PASSWORD_ERROR, } from './constants'; export function resetStatePassword() { return { type: EDIT_USER_RESET_STATE_PASSWORD, }; } export function passwordChange(password) { return { type: EDIT_USER_PASSWORD_CHANGE, password, }; } export function passwordErrorMsg(passwordError) { return { type: EDIT_USER_PASSWORD_ERROR, passwordError, }; }
/** * @license Highcharts Gantt JS v9.1.2 (2021-06-16) * @module highcharts/modules/gantt * @requires highcharts * * Gantt series * * (c) 2016-2021 Lars A. V. Cabrera * * License: www.highcharts.com/license */ 'use strict'; import Highcharts from '../../Core/Globals.js'; import '../../Series/XRange/XRangeSeries.js'; import '../../Series/Gantt/GanttSeries.js'; import GanttChart from '../../Core/Chart/GanttChart.js'; import '../../Core/Scrollbar.js'; import '../../Extensions/RangeSelector.js'; import '../../Core/Navigator.js'; Highcharts.GanttChart = GanttChart; Highcharts.ganttChart = GanttChart.ganttChart;
define('directives/index', [ "angular", "directives/appHeader", "directives/appHomepage" ], function(angular, appHeader, appHomepage) { var directives = angular.module("directives", []); directives.directive("appHeader", appHeader); directives.directive("appHomepage", appHomepage); return directives; } );
import template from './tag-editor-modal.html'; /** @ngInject */ export function TagEditorFactory ($uibModal) { var modalService = { showModal: showModal } return modalService function showModal (services, tags) { var modalOptions = { template, controller: TagEditorModalController, controllerAs: 'vm', size: 'md', resolve: { services: resolveServices, tags: resolveTags } } var modal = $uibModal.open(modalOptions) return modal.result function resolveServices () { return services } function resolveTags () { return tags } } } /** @ngInject */ function TagEditorModalController (services, tags, $controller, $uibModalInstance, $state, TaggingService, EventNotifications) { const vm = this var base = $controller('BaseModalController', { $uibModalInstance: $uibModalInstance }) angular.extend(vm, base) vm.save = save vm.services = angular.isArray(services) ? services : [services] vm.modalData = { tags: angular.copy(tags) } // Override function save () { return TaggingService.assignTags('services', vm.services, tags, vm.modalData.tags) .then(saveSuccess) .catch(saveFailure) function saveSuccess () { $uibModalInstance.close() EventNotifications.success(__('Tagging successful.')) $state.go($state.current, {}, {reload: true}) } function saveFailure () { EventNotifications.error(__('There was an error tagging this service.')) } } }
// Copyright 2018, Dell EMC, Inc. 'use strict'; var uuid = require('node-uuid'); describe('ssh-catalog-job', function() { var waterline = { ibms: {}, catalogs: {} }, mockParser = {}, SshCatalogJob, sshCatalogJob; var commandUtil = {}; function CommandUtil() { return commandUtil; } before(function() { helper.setupInjector([ helper.require('/lib/jobs/ssh-catalog.js'), helper.require('/lib/jobs/base-job.js'), helper.di.simpleWrapper(CommandUtil, 'JobUtils.Commands'), helper.di.simpleWrapper(mockParser, 'JobUtils.CommandParser'), helper.di.simpleWrapper({Client:function(){}}, 'ssh'), helper.di.simpleWrapper(waterline, 'Services.Waterline') ]); this.sandbox = sinon.sandbox.create(); SshCatalogJob = helper.injector.get('Job.Ssh.Catalog'); }); describe('_run', function() { var sshSettings, testCommands; before(function() { testCommands = [ {cmd: 'aCommand', source: 'test'}, {cmd: 'testCommand'} ]; commandUtil.buildCommands = this.sandbox.stub().returns(testCommands); sshCatalogJob = new SshCatalogJob({}, { target: 'someNodeId' }, uuid.v4()); waterline.ibms.findByNode = this.sandbox.stub(); commandUtil.sshExec = this.sandbox.stub().resolves(); mockParser.parseTasks = this.sandbox.stub().resolves(); sshSettings = { config: { host: 'the remote host', port: 22, username: 'someUsername', password: 'somePassword', privateKey: 'a pretty long string' } }; expect(sshCatalogJob).to.have.property('commandUtil'); }); afterEach(function() { this.sandbox.restore(); }); it('should execute the given remote commands using credentials'+ ' from a node and handle the responses', function() { mockParser.parseTasks = this.sandbox.stub().resolves([ {data:'data', source: 'aCommand'}, {data:'more data', source: 'testCommand'} ]); commandUtil.catalogParsedTasks = this.sandbox.stub().resolves( [{data:'data', source: 'test'}] ); commandUtil.updateLookups = this.sandbox.stub().resolves(); waterline.ibms.findByNode.resolves(sshSettings); commandUtil.sshExec.onCall(0).resolves({stdout: 'data', cmd: 'aCommand'}); commandUtil.sshExec.onCall(1).resolves({stdout: 'more data', cmd: 'testCommand'}); sshCatalogJob.commands = testCommands; return sshCatalogJob._run() .then(function() { expect(commandUtil.sshExec).to.have.been.calledTwice .and.calledWith(sshCatalogJob.commands[0], sshSettings.config) .and.calledWith(sshCatalogJob.commands[1], sshSettings.config); expect(mockParser.parseTasks).to.have.been.calledOnce .and.calledWith([ {stdout: 'data', cmd: 'aCommand'}, {stdout: 'more data', cmd: 'testCommand'} ]); expect(commandUtil.catalogParsedTasks).to.have.been.calledOnce .and.calledWith( {data: 'data', source: 'aCommand'}, {data: 'more data', source: 'testCommand'} ); }); }); }); });
Montric.Store = DS.Store.extend({ adapter: "Montric.Adapter" });
module.exports = function(grunt) { grunt.initConfig({ /** * @property pkg * @type {Object} */ pkg: grunt.file.readJSON('package.json'), /** * @property jshint * @type {Object} */ jshint: { all: 'module/*.js', options: { jshintrc: '.jshintrc', reporterOutput: '' } }, /** * @property uglify * @type {Object} */ uglify: { options: { banner: '/*! <%= pkg.name %> by <%= pkg.author %> created on <%= grunt.template.today("yyyy-mm-dd") %> */\n' }, build: { src: ['dist/<%= pkg.name %>.js'], dest: 'dist/<%= pkg.name %>.min.js' } }, /** * @property compress * @type {Object} */ compress: { main: { options: { archive: 'releases/<%= pkg.version %>.zip' }, files: [ { flatten: true, src: 'dist/<%= pkg.name %>.js', dest: './', filter: 'isFile' } ] } }, /** * @property concat * @type {Object} */ concat: { options: { separator: '\n\n' }, dist: { src: ['module/*.js'], dest: 'dist/<%= pkg.name %>.js' } }, /** * @property copy * @type {Object} */ copy: { vendor: { expand: true, flatten: true, src: ['module/*'], dest: 'example/js/vendor/ng-contextmenu', filter: 'isFile' }, release: { src: 'releases/<%= pkg.version %>.zip', dest: 'releases/master.zip' } }, /** * @property jasmine * @type {Object} */ jasmine: { pivotal: { src: ['module/*.js'], options: { specs: 'tests/spec.js', helpers: [ 'example/js/vendor/angular/angular.js', 'example/js/vendor/angular-mocks/angular-mocks.js' ] } } }, /** * @property watch * @type {Object} */ watch: { scripts: { files: ['module/*.js'], tasks: ['build'], options: { spawn: false } } } }); grunt.loadNpmTasks('grunt-contrib-jasmine'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-compress'); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-copy'); grunt.registerTask('build', ['concat', 'uglify', 'copy', 'compress']); //grunt.registerTask('test', ['jshint', 'jasmine']); grunt.registerTask('test', ['jshint']); grunt.registerTask('default', ['test', 'build']); };
import $ from 'jquery'; import _ from 'underscore'; import React from 'react'; import Router from 'react-router'; import containerStore from '../stores/ContainerStore'; import ContainerList from './ContainerList.react'; import Header from './Header.react'; import metrics from '../utils/MetricsUtil'; import {shell} from 'electron'; import machine from '../utils/DockerMachineUtil'; var Containers = React.createClass({ contextTypes: { router: React.PropTypes.func }, getInitialState: function () { return { sidebarOffset: 0, containers: containerStore.getState().containers, sorted: this.sorted(containerStore.getState().containers) }; }, componentDidMount: function () { containerStore.listen(this.update); }, componentWillUnmount: function () { containerStore.unlisten(this.update); }, sorted: function (containers) { return _.values(containers).sort(function (a, b) { if (a.Favorite && !b.Favorite) { return -1; } else if (!a.Favorite && b.Favorite) { return 1; } else { if (a.State.Downloading && !b.State.Downloading) { return -1; } else if (!a.State.Downloading && b.State.Downloading) { return 1; } else { if (a.State.Running && !b.State.Running) { return -1; } else if (!a.State.Running && b.State.Running) { return 1; } else { return a.Name.localeCompare(b.Name); } } } }); }, update: function () { let containers = containerStore.getState().containers; let sorted = this.sorted(containerStore.getState().containers); let name = this.context.router.getCurrentParams().name; if (containerStore.getState().pending) { this.context.router.transitionTo('pull'); } else if (name && !containers[name]) { if (sorted.length) { this.context.router.transitionTo('containerHome', {name: sorted[0].Name}); } else { this.context.router.transitionTo('search'); } } this.setState({ containers: containers, sorted: sorted, pending: containerStore.getState().pending }); }, handleScroll: function (e) { if (e.target.scrollTop > 0 && !this.state.sidebarOffset) { this.setState({ sidebarOffset: e.target.scrollTop }); } else if (e.target.scrollTop === 0 && this.state.sidebarOffset) { this.setState({ sidebarOffset: 0 }); } }, handleNewContainer: function () { $(this.getDOMNode()).find('.new-container-item').parent().fadeIn(); this.context.router.transitionTo('search'); metrics.track('Pressed New Container'); }, handleClickPreferences: function () { metrics.track('Opened Preferences', { from: 'app' }); this.context.router.transitionTo('preferences'); }, handleClickDockerTerminal: function () { metrics.track('Opened Docker Terminal', { from: 'app' }); machine.dockerTerminal(); }, handleClickReportIssue: function () { metrics.track('Opened Issue Reporter', { from: 'app' }); shell.openExternal('https://github.com/docker/kitematic'); }, render: function () { var sidebarHeaderClass = 'sidebar-header'; if (this.state.sidebarOffset) { sidebarHeaderClass += ' sep'; } var container = this.context.router.getCurrentParams().name ? this.state.containers[this.context.router.getCurrentParams().name] : {}; return ( <div className="containers"> <Header /> <div className="containers-body"> <div className="sidebar"> <section className={sidebarHeaderClass}> <h4>Containers</h4> <div className="create"> <Router.Link to="search"> <span className="btn btn-new btn-action has-icon btn-hollow"><span className="icon icon-add"></span>New</span> </Router.Link> </div> </section> <section className="sidebar-containers" onScroll={this.handleScroll}> <ContainerList containers={this.state.sorted} newContainer={this.state.newContainer} /> </section> <section className="sidebar-buttons"> <span className="btn-sidebar btn-terminal" onClick={this.handleClickDockerTerminal} ><span className="icon icon-docker-cli"></span><span className="text">DOCKER CLI</span></span> <span className="btn-sidebar btn-feedback" onClick={this.handleClickReportIssue} ><span className="icon icon-feedback"></span></span> <span className="btn-sidebar btn-preferences" onClick={this.handleClickPreferences} ><span className="icon icon-preferences"></span></span> </section> </div> <Router.RouteHandler pending={this.state.pending} containers={this.state.containers} container={container}/> </div> </div> ); } }); module.exports = Containers;
// Copyright 2017 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. load("test/mjsunit/wasm/wasm-constants.js"); load("test/mjsunit/wasm/wasm-module-builder.js"); (function exportImmutableGlobal() { var builder = new WasmModuleBuilder(); let globals = [ [kWasmI32, 'i32_noinit'], // - [kWasmI32, 'i32', 4711], // - [kWasmF32, 'f32_noinit'], // - [kWasmF32, 'f32', Math.fround(3.14)], // - [kWasmF64, 'f64_noinit'], // - [kWasmF64, 'f64', 1 / 7] // - ]; for (let g of globals) { let global_builder = builder.addGlobal(g[0], false).exportAs(g[1]); if (g[2]) global_builder.init = g[2]; } var module = builder.instantiate(); for (let g of globals) { assertEquals("number", typeof module.exports[g[1]], g[1]); assertEquals(g[2] || 0, module.exports[g[1]], g[1]); } })(); (function cannotExportMutableGlobal() { var builder = new WasmModuleBuilder(); builder.addGlobal(kWasmI32, true).exportAs('g'); assertThrows(() => builder.instantiate(), WebAssembly.CompileError); })(); (function cannotExportI64Global() { var builder = new WasmModuleBuilder(); builder.addGlobal(kWasmI64, false).exportAs('g'); assertThrows(() => builder.instantiate(), WebAssembly.LinkError); })(); (function duplicateGlobalExportName() { var builder = new WasmModuleBuilder(); builder.addGlobal(kWasmI64, false).exportAs('g'); builder.addGlobal(kWasmI64, false).exportAs('g'); assertThrows( () => builder.instantiate(), WebAssembly.CompileError, /Duplicate export name 'g' for global 0 and global 1/); })(); (function exportNameClashWithFunction() { var builder = new WasmModuleBuilder(); builder.addGlobal(kWasmI64, false).exportAs('foo'); builder.addFunction('f', kSig_v_v).addBody([]).exportAs('foo'); assertThrows( () => builder.instantiate(), WebAssembly.CompileError, /Duplicate export name 'foo' for global 0 and function 0/); })(); (function veryLongExportName() { // Regression test for crbug.com/740023. var export_name = 'abc'; while (export_name.length < 8192) { export_name = export_name.concat(export_name); } var builder = new WasmModuleBuilder(); var global = builder.addGlobal(kWasmI64, false); global.exportAs(export_name); global.exportAs(export_name); var error_msg = 'Duplicate export name \'(abc){10,20}ab?c?\.\.\.\' for global 0 and global 0'; assertThrows( () => builder.instantiate(), WebAssembly.CompileError, new RegExp(error_msg)); })();
module.exports = { makeHeader: function () { return "<!DOCTYPE html><html lang=\"en\"><head><meta charset=\"utf-8\"><title>NodePress</title><link rel=\"stylesheet\" href=\"/inc/bootstrap.min.css\"><link rel=\"stylesheet\" type=\"text/css\" href=\"/inc/slick.css\"/><link rel=\"stylesheet\" type=\"text/css\" href=\"/inc/slick-theme.css\"/><link rel=\"stylesheet\" href=\"/style.css\"></head><body><header><div class=\"container\"><div class=\"row\"><div class=\"col-sm-6\"><a href=\"/\"><img src=\"/img/logo@2x.png\" class=\"logo img-responsive\" id=\"header-logo\" /></a></div><div class=\"col-sm-6 text-right\"><nav><ul><li><a href=\"/\">Home</a></li><li><a href=\"/blog\">Blog</a></li></ul></nav></div></div></div></header>" }, makeFooter: function () { return "<footer><script src=\"/inc/js/bootstrap.min.js\"></script><script type=\"text/javascript\" src=\"/inc/jquery-1.11.0.min.js\"></script><script type=\"text/javascript\" src=\"/inc/jquery-migrate-1.2.1.min.js\"></script><script type=\"text/javascript\" src=\"/inc/slick.min.js\"></script><script src=\"/inc/dynamics.min.js\"></script><script src=\"/inc/animations.js\"></script></footer></body></html>" }, makeJSON: function () { var dict = {} for(i = 1; i < 11; i++) { var randomNumber = Math.floor(Math.random() * 1000); var testNum = "Test Number " + i; dict[testNum] = randomNumber; } return dict } };
/* * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is * regenerated. */ 'use strict'; /** * Values returned by the List Clusters operation. */ class ClusterListResult extends Array { /** * Create a ClusterListResult. * @member {string} [nextLink] The continuation token. */ constructor() { super(); } /** * Defines the metadata of ClusterListResult * * @returns {object} metadata of ClusterListResult * */ mapper() { return { required: false, serializedName: 'ClusterListResult', type: { name: 'Composite', className: 'ClusterListResult', modelProperties: { value: { required: false, readOnly: true, serializedName: '', type: { name: 'Sequence', element: { required: false, serializedName: 'ClusterElementType', type: { name: 'Composite', className: 'Cluster' } } } }, nextLink: { required: false, readOnly: true, serializedName: 'nextLink', type: { name: 'String' } } } } }; } } module.exports = ClusterListResult;
// Copyright 2022 The LUCI Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License.
/** * Copyright 2016 ReSys OÜ * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import {connect} from 'react-redux'; import {answerQuestion} from '../actions/Actions'; // // Find questionnaire as a root object // Assuming there is always a 'questionnaire' present, and there is always one of them per form. // function findQuestionnaire(data) { if (!data) { return null; } var questionnaire = data.get('questionnaire'); if (questionnaire) { return [questionnaire.id, questionnaire]; } return null; } // // Find item by ID from state // function findItemById(data, id) { let itemData = data.getIn(['items',id]); if (itemData) { return [id,itemData]; } return null; } // // Find valueset by ID from state // function findValuesetById(data, id) { let valueSet = data.getIn(['valueSets', id, 'entries']); return valueSet ? valueSet : null; } function connectToAnswer(component) { return connect(null,{ answerQuestion })(component); } export { findQuestionnaire, findItemById, findValuesetById, connectToAnswer }
// @flow import { StyleSheet } from 'react-native'; import { ColorPalette } from '../../../styles'; const DEFAULT_SIZE = 65; /** * The styles of the feature base/participants. */ export default { avatarContainer: (size: number = DEFAULT_SIZE) => { return { alignItems: 'center', borderRadius: size / 2, height: size, justifyContent: 'center', overflow: 'hidden', width: size }; }, avatarContent: (size: number = DEFAULT_SIZE) => { return { height: size, width: size }; }, badge: (size: number = DEFAULT_SIZE, status: string) => { let color; switch (status) { case 'available': color = 'rgb(110, 176, 5)'; break; case 'away': color = 'rgb(250, 201, 20)'; break; case 'busy': color = 'rgb(233, 0, 27)'; break; case 'idle': color = 'rgb(172, 172, 172)'; break; } return { backgroundColor: color, borderRadius: size / 2, bottom: 0, height: size * 0.3, position: 'absolute', width: size * 0.3 }; }, badgeContainer: { ...StyleSheet.absoluteFillObject }, initialsContainer: { alignItems: 'center', alignSelf: 'stretch', flex: 1, justifyContent: 'center' }, initialsText: (size: number = DEFAULT_SIZE) => { return { color: 'white', fontSize: size * 0.45, fontWeight: '100' }; }, staticAvatar: { backgroundColor: ColorPalette.lightGrey, opacity: 0.4 } };
let mongoose = require('mongoose'); mongoose.Promise = global.Promise; let schema = new mongoose.Schema({ name: String, cuisines: String, address: String, img: String, ratings: Number, comments: { type: String, default: 'Enter comments' } }); let Restaurant = mongoose.model('restaurant', schema); module.exports = Restaurant;
require('./Nette')(); require('./Navbar')(); require('./GoogleAnalytics')(); require('./KeyboardShortcuts')(); require('./Autocomplete')(); require('./AvatarPicker')(); require('./Global')(); require('./AddQuote')(); require('./Comments')(); require('./Share')(); require('./Login')(); require('./Logout');
/** * @license Apache-2.0 * * Copyright (c) 2018 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ 'use strict'; // MODULES // var stdout = require( './stdout' ); var browser = require( './browser' ); var electron = require( './electron' ); // MAIN // /** * Generates a plot view. * * @private * @param {Plot} plot - plot context * @param {string} viewer - plot viewer * @param {VTree} vtree - virtual * @returns {void} */ function view( plot, viewer, vtree ) { if ( viewer === 'none' ) { return; } if ( viewer === 'stdout' ) { return stdout( vtree ); } if ( viewer === 'browser' ) { return browser( vtree ); } if ( viewer === 'terminal' ) { // TODO: ASCII return; } // viewer === 'window' electron( plot, vtree ); } // EXPORTS // module.exports = view;
// window.addEventListener("load" function(e){ // alert("hahahha"); // }); // // function btntest_onclick() // // { // // window.location.href = "push/index.html"; // // } document.getElementById("myButton").addEventListener("click", myFunction); function myFunction() { //window.location.href = "push/index.html"; (function (d, s, id) { var js, sdkjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) { return; } js = d.createElement(s); js.id = id; js.src = "MFPPushSDK.js"; sdkjs.parentNode.insertBefore(js, sdkjs); }(document, 'script', 'pushsdk')); window.sdkAsyncInit = function () { var res = new MFPPush(); //create an instance of MFFPush res.isDebugEnable(true) // for debugging function callback(response) { console.log(response.response) console.log("hahahah") } var params = { "appGUID": "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX", "appRegion": ".ng.bluemix.net", "clientSecret": "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" } res.initializeApp(params, function (response) { console.log(response.response) console.log("hahahah") // initialize Push Service console.log("l") res.registerApp("ananth123", function (response) { // register device in push service console.log("reeeeeeeeee") console.log(response.response) // res.retrieveAvailableTags(function(response) { //Retrieve available tags // alert(response.response) // alert("here you go") // var json = JSON.parse(response.response); // var tagsA = [] // for (i in json.tags){ // tagsA.push(json.tags[i].name) // alert(json.tags[i].name) // } // alert(tagsA) // res.subscribe(tagsA,function(response) { // subscribe to available tags // alert(response.response) // tagsA.shift(); // res.unSubscribe(tagsA,function(response) { // unsubscribe from tags // alert(response.response) // res.unRegisterDevice(function(response) { // unregister device // alert(response.response) // }) // }) // }) // }) }) }) }; }
'use strict'; module.exports = function (treeChooser) { treeChooser .directive('treeChooserItem', require('./treeChooserItem.directive')) .controller('treeChooserItemController', require('./treeChooserItem.controller')) .factory('TreeChooserItem', require('./treeChooserItem.factory')); };
app.factory('preferenceService', [ '$http', 'notify', function ($http, notify) { var currentScript; return { setCurrentScript: function (script) { currentScript = script; }, importSettings: function ($scope) { var actor = window.currActor; var script = currentScript; $http.get("api/preference?id=" + actor.Id + "+" + script.ScriptId) .success(function (data) { if (data == null) { $scope.notifyFail('No settings for this script!'); } else { $scope.stop(); $scope.changeSpeed(data.ReadingSpeed); $scope.textSizeInput = data.FontSize; $scope.changeTextSize(); $scope.changeScreenResolusion(data.ScreenWidth, data.ScreenHeight); $scope.scrollToCurrent(data.LastSectionId - 1); $scope.notifySuccess('Settings loaded!'); } }) .error(function (data) { $scope.notifyFail('Can not load settings!'); }); }, exportSettings: function ($scope, width, height) { var actor = window.currActor; var script = currentScript; var preference = { ReaderId: 0, ScriptId: 0, LastSectionId: 0, ReadingSpeed: 0, FontSize: 0, ScreenWidth: 0, ScreenHeight: 0 } preference.ReaderId = actor.Id; preference.ScriptId = script.ScriptId; preference.LastSectionId = $scope.getCurrentSection(); preference.ReadingSpeed = $scope.velocity; preference.FontSize = $scope.textSize; preference.ScreenWidth = width; preference.ScreenHeight = height; $http.put("api/preference/", preference) .success(function (response) { $scope.notifySuccess('Settings saved!'); return response; }) .error(function (error) { $scope.notifyFail('Can not save settings!'); return response; }); } } } ]);
'use strict'; angular.module('friendflixApp') .config(function ($stateProvider) { $stateProvider .state('activate', { parent: 'account', url: '/activate?key', data: { authorities: [], pageTitle: 'Activation' }, views: { 'content@': { templateUrl: 'scripts/app/account/activate/activate.html', controller: 'ActivationController' } }, resolve: { } }); });
/** * Copyright 2015 Kitware Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ var path = require('path'); module.exports = { node_modules: path.resolve('node_modules'), web_src: path.resolve('src'), plugins: path.resolve(__dirname, 'plugins'), static: path.resolve('static') };
/*global define */ (function() { 'use strict'; define(['lodash'], function(_) { var storageTypes = [ { id:1, type:'Block' }, { id:2, type:'File' }, { id:3, type:'Object' } ]; var clusterTypes = [ { id:1, type:'Gluster', deploymentTypes: [ { id:1, type:'Demo (2 hosts)', nodeCount:2 }, { id:2, type:'Minimum (3 hosts)', nodeCount:3 }, { id:3, type:'Standard (6 hosts)', nodeCount:6 } ] }, { id:2, type:'Ceph', deploymentTypes: [ { id:1, type:'Demo (2 hosts)', nodeCount:2 }, { id:2, type:'Minimum (3 hosts)', nodeCount:3 }, { id:3, type:'Standard (10 hosts)', nodeCount:10 } ] } ]; var clusterStates = [ { id:1, state:'Inactive'}, { id:2, state:'Not Available'}, { id:3, state:'Active'} ]; return { getClusterTypes: function() { return clusterTypes; }, getClusterType: function(id){ return _.find(clusterTypes, function(type) { return type.id === id; }); }, getStorageTypes: function() { return storageTypes; }, getStorageType: function(id) { return _.find(storageTypes, function(type) { return type.id === id; }); }, getClusterStatus: function(id) { return _.find(clusterStates, function(type) { return type.id === id; }); } }; }); })();
export function valuesOfObject (obj) { return Object.keys(obj).map(key => obj[key]) }
import { Meteor } from 'meteor/meteor'; import { Profiles } from '/imports/api/profile/ProfileCollection'; import { Interests } from '/imports/api/interest/InterestCollection'; import { _ } from 'meteor/underscore'; /* global Assets */ /* eslint-disable no-console */ /** * Returns the definition array associated with collectionName in the restoreJSON structure. * @param restoreJSON The restore file contents. * @param collection The collection of interest. */ function getDefinitions(restoreJSON, collection) { return _.find(restoreJSON.collections, obj => obj.name === collection).contents; } /** * Given a collection and the restoreJSON structure, looks up the definitions and invokes define() on them. * @param collection The collection to be restored. * @param restoreJSON The structure containing all of the definitions. */ function restoreCollection(collection, restoreJSON) { const definitions = getDefinitions(restoreJSON, collection._collectionName); console.log(`Defining ${definitions.length} ${collection._collectionName} documents.`); _.each(definitions, definition => collection.define(definition)); } Meteor.startup(() => { /** Only initialize database if it's empty. */ const collectionList = [Interests, Profiles]; const totalDocuments = _.reduce(collectionList, function reducer(memo, collection) { return memo + collection.count(); }, 0); if (totalDocuments === 0) { const fileName = Meteor.settings.public.initialDatabaseFileName; console.log(`Restoring database from file ${fileName}.`); const restoreJSON = JSON.parse(Assets.getText(fileName)); _.each(collectionList, collection => { restoreCollection(collection, restoreJSON); }); } });
// Copyright 2015 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. /** Name of the state. Can be used in, e.g., $state.go method. */ export const stateName = 'pod.detail';
//@line 44 "e:\builds\moz2_slave\rel-2.0-xr-w32-bld\build\toolkit\content\debug.js" var EXPORTED_SYMBOLS = ["NS_ASSERT"]; var gTraceOnAssert = true; /** * This function provides a simple assertion function for JavaScript. * If the condition is true, this function will do nothing. If the * condition is false, then the message will be printed to the console * and an alert will appear showing a stack trace, so that the (alpha * or nightly) user can file a bug containing it. For future enhancements, * see bugs 330077 and 330078. * * To suppress the dialogs, you can run with the environment variable * XUL_ASSERT_PROMPT set to 0 (if unset, this defaults to 1). * * @param condition represents the condition that we're asserting to be * true when we call this function--should be * something that can be evaluated as a boolean. * @param message a string to be displayed upon failure of the assertion */ function NS_ASSERT(condition, message) { if (condition) return; var releaseBuild = true; var defB = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefService) .getDefaultBranch(null); try { switch (defB.getCharPref("app.update.channel")) { case "nightly": case "beta": case "default": releaseBuild = false; } } catch(ex) {} var caller = arguments.callee.caller; var assertionText = "ASSERT: " + message + "\n"; if (releaseBuild) { // Just report the error to the console Components.utils.reportError(assertionText); return; } // Otherwise, dump to stdout and launch an assertion failure dialog dump(assertionText); var stackText = ""; if (gTraceOnAssert) { stackText = "Stack Trace: \n"; var count = 0; while (caller) { stackText += count++ + ":" + caller.name + "("; for (var i = 0; i < caller.arguments.length; ++i) { var arg = caller.arguments[i]; stackText += arg; if (i < caller.arguments.length - 1) stackText += ","; } stackText += ")\n"; caller = caller.arguments.callee.caller; } } var environment = Components.classes["@mozilla.org/process/environment;1"]. getService(Components.interfaces.nsIEnvironment); if (environment.exists("XUL_ASSERT_PROMPT") && !parseInt(environment.get("XUL_ASSERT_PROMPT"))) return; var source = null; if (this.window) source = this.window; var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]. getService(Components.interfaces.nsIPromptService); ps.alert(source, "Assertion Failed", assertionText + stackText); }
require('enyo'); var utils = require('./utils'); var Component = require('./Component'), Signals = require('./Signals'); /** * Default owner assigned to ownerless [UiComponents]{@link module:enyo/UiComponent~UiComponent}, * to allow such UiComponents to be notified of important system events like window resize. * * NOTE: Ownerless [UiComponents]{@link module:enyo/UiComponent~UiComponent} will not be garbage collected unless * explicitly destroyed, as they will be referenced by `master`. * * @module enyo/master * @private */ var master = module.exports = new Component({ name: 'master', notInstanceOwner: true, eventFlags: {showingOnly: true}, // don't waterfall these events into hidden controls getId: function () { return ''; }, isDescendantOf: utils.nop, bubble: function (nom, event) { //enyo.log('master event: ' + nom); if (nom == 'onresize') { // Resize is special; waterfall this message. // This works because master is a Component, so it waterfalls // to its owned Components (i.e., master has no children). master.waterfallDown('onresize', this.eventFlags); master.waterfallDown('onpostresize', this.eventFlags); } else { // All other top-level events are sent only to interested Signal // receivers. Signals.send(nom, event); } } });
/* * Copyright (c) 2017 Martin Donath <martin.donath@squidfunk.com> * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy * of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, SOFTWARE * DISTRIBUTED UNDER THE LICENSE IS DISTRIBUTED ON AN "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. * SEE THE LICENSE FOR THE SPECIFIC LANGUAGE GOVERNING PERMISSIONS AND * LIMITATIONS UNDER THE LICENSE. */ import _ from "./context" import * as pseudo from "./pseudo" import inspect from "../util/inspect" /* ---------------------------------------------------------------------------- * Functions * ------------------------------------------------------------------------- */ /** * Retrieve the tag name of an element * * @param {Element} el - Element * * @return {string} Tag name */ export const tag = el => { if (!(el instanceof _.window.Element)) throw new TypeError(`Invalid element: ${inspect(el)}`) return el.getAttribute("data-gs-tag") || el.tagName } /** * Retrieve the computed properties of an element * * This function uses the implementation for pseudo elements, only omitting the * pseudo element type because it's the same for elements and pseudo elements. * * @param {Element} el - Element * * @return {Object} Style rules */ export const style = el => { return pseudo.style(el, null) } /** * Retrieve the attributes of an element * * @param {Element} el - Element * * @return {Object<string,string>} Attributes */ export const attrs = el => { if (!(el instanceof _.window.Element)) throw new TypeError(`Invalid element: ${inspect(el)}`) /* Retrieve everything except the style attribute */ return [].reduce.call(el.attributes, (attributes, attribute) => { if (attribute.name !== "style" && attribute.name.indexOf("data-gs") === -1) attributes[attribute.name] = attribute.value return attributes }, {}) } /** * Retrieve the size of an element * * Using the bounding rectangle to obtain the width and height of an element * may result in values that differ slightly among browsers, even if the same * dimensions are set. This is due to sub-pixel rounding issues and different * browsers handling the same values differently. * * See http://cruft.io/posts/percentage-calculations-in-ie/ * * @param {Element} el - Element * * @return {Object} Element size */ export const size = el => { if (!(el instanceof _.window.Element)) throw new TypeError(`Invalid element: ${inspect(el)}`) /* Retrieve actual width and height */ const bound = el.getBoundingClientRect() return { width: bound.width, height: bound.height } } /** * Retrieve the relative offset of an element * * @param {Element} el - Element * * @return {Object} Element offset */ export const offset = el => { if (!(el instanceof _.window.Element)) throw new TypeError(`Invalid element: ${inspect(el)}`) /* Retrieve bounding boxes for element and parent */ const inner = el.getBoundingClientRect() const outer = typeof el.parentNode.getBoundingClientRect === "function" ? el.parentNode.getBoundingClientRect() : inner /* Calculate relative offset to all sides */ return { top: inner.top - outer.top, right: outer.right - inner.right, bottom: outer.bottom - inner.bottom, left: inner.left - outer.left } }
'use strict'; var ApiAuthRequestError = require('../error/ApiAuthRequestError'); var JwtAuthenticator = require('../jwt/jwt-authenticator'); var OAuthPasswordGrantRequestAuthenticator = require('../oauth/password-grant').authenticator; var OAuthRefreshTokenGrantRequestAuthenticator = require('../oauth/refresh-grant').authenticator; function OAuthAuthenticator(application) { if (!(this instanceof OAuthAuthenticator)) { return new OAuthAuthenticator(application); }else{ this.application = application; return this; } } OAuthAuthenticator.prototype.localValidation = false; OAuthAuthenticator.prototype.withLocalValidation = function withLocalValidation() { this.localValidation = true; return this; }; OAuthAuthenticator.prototype.authenticate = function authenticate(req,callback){ var self = this; var done; if(typeof req==='object' && typeof callback === 'function'){ done = callback; }else{ throw new Error('authenticate must be called with a request object and callback function'); } var authHeader = req && req.headers && req.headers.authorization; if (authHeader){ if(authHeader.match(/Bearer/i)){ var parts = authHeader.split(' '); var token = parts[parts.length-1]; new JwtAuthenticator(self.application).authenticate(token,done); }else{ done(self.unauthenticated()); } }else if (req.body && req.body.grant_type==='password'){ new OAuthPasswordGrantRequestAuthenticator(self.application).authenticate(req.body,callback); }else if (req.body && req.body.grant_type==='refresh_token'){ new OAuthRefreshTokenGrantRequestAuthenticator(self.application).authenticate(req.body,callback); }else{ done(self.unauthenticated()); } return this; }; OAuthAuthenticator.prototype.unauthenticated = function unauthenticated(){ return new ApiAuthRequestError('Unauthorized', 401); }; module.exports = OAuthAuthenticator;
import styled from 'styled-components'; const StyledFlexContainer = styled.div` display: flex; flex-direction: row; `; export default StyledFlexContainer;
module.exports = { presets: [ [ "@babel/preset-env", { useBuiltIns: "usage", corejs: 3, targets: { browsers: ["defaults", "IE >= 11"] } } ] ] }
// Copyright 2012 Twitter, Inc // http://www.apache.org/licenses/LICENSE-2.0 var TwitterCldr = require('../../../../lib/assets/javascripts/twitter_cldr/core.js'); describe("IntegerHelper", function() { describe("#apply", function() { var token; describe("with the ### format", function() { beforeEach(function() { token = "###"; }); it("test: interpolates a number", function() { expect(new TwitterCldr.NumberFormatter.IntegerHelper(token).apply(123)).toEqual('123'); }); it("test: does not include a fraction for a float", function() { expect(new TwitterCldr.NumberFormatter.IntegerHelper(token).apply(123.45)).toEqual('123'); }); it("test: does not round when given a float", function() { expect(new TwitterCldr.NumberFormatter.IntegerHelper(token).apply(123.55)).toEqual('123'); }); it("test: does not round with :precision => 1", function() { expect(new TwitterCldr.NumberFormatter.IntegerHelper(token).apply(123.55, {precision: 1})).toEqual('123'); }); }); describe("with the #,## format", function() { beforeEach(function() { token = "#,##"; }); it("test: single group", function() { expect(new TwitterCldr.NumberFormatter.IntegerHelper(token).apply(123)).toEqual('1,23'); }); it("test: multiple groups with a primary group size", function() { expect(new TwitterCldr.NumberFormatter.IntegerHelper(token).apply(123456789)).toEqual('1,23,45,67,89'); }); }); describe("with the #,##0.## format", function() { beforeEach(function() { token = "#,##0.##"; }); it("test: ignores a fraction part given in the format string", function() { expect(new TwitterCldr.NumberFormatter.IntegerHelper(token).apply(1234.567)).toEqual('1,234'); }); it("test: cldr example #,##0.## => 1 234", function() { expect(new TwitterCldr.NumberFormatter.IntegerHelper(token).apply(1234.567)).toEqual('1,234'); }); }); describe("miscellaneous formats", function() { it("test: interpolates a number on the right side", function () { token = "0###"; expect(new TwitterCldr.NumberFormatter.IntegerHelper(token).apply(123)).toEqual('0123'); }); it("test: strips optional digits", function() { token = "######"; expect(new TwitterCldr.NumberFormatter.IntegerHelper(token).apply(123)).toEqual('123'); }); it("test: multiple groups with a primary and secondary group size", function() { token = "#,##,##0"; expect(new TwitterCldr.NumberFormatter.IntegerHelper(token).apply(123456789)).toEqual('12,34,56,789'); }); it("test: does not group when no digits left of the grouping position", function() { token = "#,###"; expect(new TwitterCldr.NumberFormatter.IntegerHelper(token).apply(123)).toEqual('123'); }); it("test: cldr example #,##0.### => 1 234", function() { token = "#,##0.###"; expect(new TwitterCldr.NumberFormatter.IntegerHelper(token, {group: ' '}).apply(1234.567)).toEqual('1 234'); }); it("test: cldr example ###0.##### => 1234", function() { token = "###0.#####"; expect(new TwitterCldr.NumberFormatter.IntegerHelper(token, {group: ' '}).apply(1234.567)).toEqual('1234'); }); it("test: cldr example ###0.0000# => 1234", function() { token = "###0.0000#"; expect(new TwitterCldr.NumberFormatter.IntegerHelper(token, {group: ' '}).apply(1234.567)).toEqual('1234'); }); it("test: cldr example 00000.0000 => 01234", function() { token = "00000.0000"; expect(new TwitterCldr.NumberFormatter.IntegerHelper(token, {group: ' '}).apply(1234.567)).toEqual('01234'); }); }); }); });
(function() { 'use strict'; angular.module('Editors').directive('simpleQuestion', ['Answer', function(Answer) { return { restrict: 'EA', scope: { question: '=', survey: '=' }, templateUrl: 'resources/editors/partials/modules/simple-question.html', link: function(scope) { scope.$watch('question', function(question) { if (question && question.answers) { // Initialize displayOrder property _.each(question.answers, function(answer, index) { answer.displayOrder = index + 1; }); } }); scope.answerTypes = [ { name: 'Other', value: 'other' }, { name: 'None', value: 'none' } ]; scope.sortableAnswerOptions = { handle: '.glyphicon-align-justify', 'ui-floating': false, cancel: '.unsortable', items: 'li:not(.unsortable)', stop: function(e, ui) { var answers = ui.item.scope().$parent.question.answers; _.each(answers, function(answer, index) { answer.displayOrder = index + 1; }); } }; scope.addAnswer = function addAnswer() { scope.question.answers.push(Answer.extend({displayOrder: scope.question.answers.length + 1})); }; scope.deleteAnswer = function deleteAnswer(index) { scope.question.answers.splice(index, 1); }; } }; }]); })();