code
stringlengths
2
1.05M
import Component from '@ember/component'; import layout from '../../templates/components/nypr-story/share-buttons'; import { shareUrl } from 'nypr-ui/helpers/share-url'; export default Component.extend({ layout, classNames: ['btn-group'], actions: { popupShareWindow(destination) { let shareText = this.get('story.title'); let url = this.get('story.url'); let via = this.get('story.twitterHandle') || this.get('via'); let twitterHeadline = this.get('story.twitterHeadline') || shareText; let href = shareUrl([destination, url, shareText, via, twitterHeadline]); const heights = { 'Twitter': 443, 'Facebook': 620 }; if (href) { let features = `titlebar=no,close=no,width=600,height=${heights[destination]}`; window.open(href, '_blank', features); } } } });
define(['angular'], function(angular) { angular.module('kap-hal', []) .factory('HalClient', function($http, $q) { function HalClient(baseUrl) { function encodeQuery(obj, prefix) { var str = []; for(var p in obj) { var k = prefix ? prefix + "[" + p + "]" : p, v = obj[p]; str.push(typeof v == "object" ? encodeQuery(v, k) : encodeURIComponent(k) + "=" + encodeURIComponent(v)); } return str.join("&"); } this.fetchAll = function(service, query) { var deferred = $q.defer(); var url = baseUrl + service; var queryObj = { page: 1 }; if(query) { angular.extend(queryObj, query); } url += '?' + encodeQuery(queryObj); $http.get(url).success(function(data) { deferred.resolve(data); }).error(function(data, status, headers) { console.error("HTTP GET", data, status, headers); deferred.reject(status); }); return deferred.promise; } this.fetch = function(service, id) { var deferred = $q.defer(); $http.get(baseUrl + service + '/' + id).success(function(data) { deferred.resolve(data); }).error(function(data, status, headers) { console.error("HTTP GET", data, status, headers); deferred.reject(status); }); return deferred.promise; } this.create = function(service, data) { var deferred = $q.defer(); $http.post(baseUrl + service, data).success(function(data) { deferred.resolve(data); }).error(function(data, status, headers) { console.error("HTTP POST", data, status, headers); deferred.reject(status); }); return deferred.promise; } this.update = function(service, id, data) { var deferred = $q.defer(); $http.put(baseUrl + service + '/' + id, data).success(function(data) { deferred.resolve(data); }).error(function(data, status, headers) { console.error("HTTP PUT", data, status, headers); deferred.reject(status); }); return deferred.promise; } this.partialUpdate = function(service, id, data) { var deferred = $q.defer(); $http.put(baseUrl + service + '/' + id, data).success(function(data) { deferred.resolve(data); }).error(function(data, status, headers) { console.error("HTTP PATCH", data, status, headers); deferred.reject(status); }); return deferred.promise; } this.remove = function(service, id) { var deferred = $q.defer(); $http.delete(baseUrl + service + '/' + id).success(function(data) { deferred.resolve(data); }).error(function(data, status, headers) { console.error("HTTP DELETE", data, status, headers); }); return deferred.promise; } } HalClient.default = null; return HalClient; }) .constant('HalCollectionConfig', { defaultQuery: { page: 1, //query: null, //order_by: null, page_size: 25 } }) .factory('HalCollection', function($q, HalClient, HalCollectionConfig) { function HalCollection(service, halClient) { var self = this; if(!halClient) { halClient = HalCollection.defaultHalClient } if(!halClient) { halClient = HalClient.default; } if(!halClient) { throw "No HalClient injected"; } this.halClient = halClient; this.service = service; this.loading = false; this.items = []; this.links = {}; this.pageCount = 0; this.totalItems = 0; this.indexProperty = 'index'; this.query = null; this.fetch = function(query) { query = query || {}; self.query = angular.copy(query, angular.copy(HalCollectionConfig.defaultQuery)); return self.fetchCurrent(); } this.fetchCurrent = function() { if(!self.query) { throw "Run fetch() first"; } self.loading = true; return self.halClient.fetchAll(self.service, self.query).then(function(data) { self.links = data._links; self.items = data._embedded[self.service]; self.totalItems = parseInt(data.total_items); self.query.page_size = parseInt(data.page_size); self.pageCount = parseInt(data.page_count); self.loading = false; return self; }); } this.fetchNext = function() { if(!self.query) { throw "Run fetch() first"; } if(self.pageCount < self.query.page + 1) { throw "There is no next page"; } self.query.page++; return self.fetchCurrent(); } this.fetchPrevious = function() { if(!self.query) { throw "Run fetch() first"; } if(self.query.page <= 1) { throw "There is no previous page"; } self.query.page--; return self.fetchCurrent(); } this.updateIndex = function(item1, item2) { var sourceIndex = item1[self.indexProperty]; item1[self.indexProperty] = item2[self.indexProperty]; item2[self.indexProperty] = sourceIndex; var update = {}; update[self.indexProperty] = item1[self.indexProperty]; self.halClient.partialUpdate(self.service, item1.id, update); var update2 = {}; update2[self.indexProperty] = item2[self.indexProperty]; self.halClient.partialUpdate(self.service, item2.id, update2); }; this.createAfter = function(relItem, item, api) { var relItemArrayIndex = self.items.indexOf(relItem); if(relItemArrayIndex === -1) { throw "Not existing relItem"; } var itemArrayIndex = relItemArrayIndex + 1; if(api) { var index = 0; if(itemArrayIndex < self.items.length) { var insertBeforeItem = self.items[itemArrayIndex]; index = parseInt(insertBeforeItem[self.indexProperty]); } item.index = index; return self.halClient.create(service, item).then(function(data) { angular.extend(item, data); self.items.splice(itemArrayIndex, 0, item); return item; }); } self.items.splice(itemArrayIndex, 0, item); return resolvePromise(item); } this.createFirst = function(item, api) { item.index = 1; if(api) { return self.halClient.create(service, item).then(function(data) { angular.extend(item, data); self.items.unshift(item); return item; }); } self.items.unshift(item); return resolvePromise(item); } this.remove = function(item, api) { var arrayIndex = self.items.indexOf(item); if(arrayIndex === -1) { throw "Not existing relItem"; } if(api) { return self.halClient.remove(service, item.id).then(function(data) { self.items.splice(arrayIndex, 1); return item; }); } self.items.splice(arrayIndex, 1); return resolvePromise(item); } function resolvePromise(data) { var def = $q.defer(); def.resolve(data); return def.promise; } } HalCollection.createAndFetch = function(service, query, apiClient) { var ins = new HalCollection(service, apiClient); ins.fetch(query); return ins; } HalCollection.defaultHalClient = null; return HalCollection; }) });
import React from 'react'; import classNames from 'classnames'; export default class Base extends React.Component { _bind(...methods) { methods.forEach( (method) => this[method] = this[method].bind(this) ); } getDom() { return React.findDOMNode(this.refs.DOM); } componentWillUnmount() { this.props.onDestroy(); } }
var express = require('express'); var router = express.Router(); var passport = require('passport'); var GoogleStrategy = require('passport-google-oauth').OAuth2Strategy; var knex = require('../db/knex'); var jwt = require('jsonwebtoken'); var env = { clientID: process.env.CLIENT_ID, clientSecret: process.env.CLIENT_SECRET, callbackURL: process.env.CALLBACK_URL, passReqToCallback: true } function Users() { return knex('users'); } passport.use(new GoogleStrategy( { clientID: process.env.CLIENT_ID, clientSecret: process.env.CLIENT_SECRET, callbackURL: process.env.CALLBACK_URL // passReqToCallback: true }, function(token, tokenSecret, profile, done) { var user = profile.emails[0].value; Users().where('email', user).select().first().then(function(hasUser) { console.log(user); if (!hasUser) { console.log("no user"); Users().insert({ pi_id: null, email: user }).then(function() { done(null,user); }) } else { done(null,user); } }) } )); router.get('/google/callback', function(req, res, next) { passport.authenticate('google', function(err, user, info) { if (err) { next(err); } else if (user) { console.log('User = '+user); // res.setHeader('x-token',token); var token = jwt.sign(user, process.env.JWT_SECRET, { expiresIn:15778463 }); var authUrl = 'https://brewsbrotherschillerfrontend.firebaseapp.com/#/authenticate/'+token; res.redirect(authUrl); } else if (info) { next(info); } })(req, res, next); }); router.get('/google', passport.authenticate('google', { // scope: 'profile' scope: 'email' }), function(req, res) { // The request will be redirected to Facebook for authentication, so this // function will not be called. res.end('success') }); router.get('/logout', function(req, res, next){ req.logout(); res.send('logged out') }) function setToken(user, res) { var token = jwt.sign(user, process.env.JWT_SECRET, { expiresIn:15778463 }) // res.setHeader('x-token',token); var authUrl = 'http://localhost:8080/#/authenticate/'+token; } module.exports = { router: router, passport: passport }
define(['../core'],function(Fsy){ var class2type = {}; var serialize = class2type.toString; var rword = /[^, ]+/g; 'String Number Boolean RegExp Function Array Object Date Error'.replace(rword,function(name){ class2type['[object ' + name + ']'] = name.toLowerCase(); }); function type(obj){ if(obj == null){ return String(obj); } return typeof obj === 'object' || typeof obj === 'function' ? class2type[serialize.call(obj)] || 'object' : typeof obj } /*IE 678 typeof alert object */ Fsy.fn.isFunction = typeof alert === 'object' ? function(fn){ try{ return /^\s*\bfunction\b/.test(fn + ''); }catch(e){ return false; } } : function(fn){ return serialize.call(fn) === '[object Function]' }; ['String','Number','Array','Date','Object'] })
'use strict'; /** * Module dependencies. */ var mongoose = require('mongoose'), Schema = mongoose.Schema; /** * Organization Schema */ var OrganizationSchema = new Schema({ name: { type: String, default: '', required: 'Please fill Organization name', trim: true }, numOfPeople:{ type: Number, required: false }, billableHeadCount:{ type: Number, required: false }, benchCount:{ type: Number, required: false }, owner:{ type:Schema.ObjectId, ref:'Employee' }, projects:[ { type:Schema.ObjectId, ref:'Project' } ], created: { type: Date, default: Date.now }, user: { type: Schema.ObjectId, ref: 'User' } }); mongoose.model('Organization', OrganizationSchema);
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */ /*! * Next JS * Copyright (c)2011 Xenophy.CO.,LTD All rights Reserved. * http://www.xenophy.com */ // {{{ NX.app.action.Abstract.$execute module.exports = function() { }; // }}} /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * c-hanging-comment-ender-p: nil * End: */
version https://git-lfs.github.com/spec/v1 oid sha256:c00a0d6f26909d8d0d7fd09e51000bf2b68f1c8c721aef82416f6bd1100ed7ef size 3645
/* Original version taken form https://github.com/tadruj/s3upload-coffee-javascript * License * Copyright 2013 tadruj * * 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. * * Modified by Dale Karp <dale@dale.io> */ (function() { window.S3Upload = (function() { S3Upload.prototype.s3_object_name = 'default_name'; S3Upload.prototype.s3_sign_put_url = '/signS3put'; S3Upload.prototype.file_dom_selector = 'file_upload'; S3Upload.prototype.onFinishS3Put = function(public_url) { return console.log('base.onFinishS3Put()', public_url); }; S3Upload.prototype.onProgress = function(percent, status) { return console.log('base.onProgress()', percent, status); }; S3Upload.prototype.onError = function(status) { return console.log('base.onError()', status); }; function S3Upload(options) { if (options == null) options = {}; for (option in options) { this[option] = options[option]; } if (options.blobMode) { this.handleBlob(options.blob); } else { this.handleFileSelect(document.getElementById(this.file_dom_selector)); } } S3Upload.prototype.handleBlob = function(blob) { var f, files, output, _i, _len, _results; this.onProgress(0, 'Upload started.'); output = []; _results = []; console.log(blob); _results.push(this.uploadFile(blob)); return _results; }; S3Upload.prototype.handleFileSelect = function(file_element) { var f, files, output, _i, _len, _results; this.onProgress(0, 'Upload started.'); files = file_element.files; output = []; _results = []; for (_i = 0, _len = files.length; _i < _len; _i++) { f = files[_i]; _results.push(this.uploadFile(f)); } return _results; }; S3Upload.prototype.createCORSRequest = function(method, url) { var xhr; xhr = new XMLHttpRequest(); if (xhr.withCredentials != null) { xhr.open(method, url, true); } else if (typeof XDomainRequest !== "undefined") { xhr = new XDomainRequest(); xhr.open(method, url); } else { xhr = null; } return xhr; }; S3Upload.prototype.executeOnSignedUrl = function(file, callback) { var this_s3upload, xhr; this_s3upload = this; xhr = new XMLHttpRequest(); xhr.open('GET', this.s3_sign_put_url + '?s3_object_type=' + file.type + '&s3_object_name=' + file.name, true); xhr.overrideMimeType('text/plain; charset=x-user-defined'); xhr.onreadystatechange = function(e) { var result; if (this.readyState === 4 && this.status === 200) { try { result = JSON.parse(this.responseText); } catch (error) { this_s3upload.onError('Signing server returned some ugly/empty JSON: "' + this.responseText + '"'); return false; } return callback(decodeURIComponent(result.signed_request), result.url, result.name); } else if (this.readyState === 4 && this.status !== 200) { return this_s3upload.onError('Could not contact request signing server. Status = ' + this.status); } }; return xhr.send(); }; S3Upload.prototype.uploadToS3 = function(file, url, public_url, name) { var this_s3upload, xhr; this_s3upload = this; xhr = this.createCORSRequest('PUT', url); if (!xhr) { this.onError('CORS not supported'); } else { xhr.onload = function() { if (xhr.status === 200) { this_s3upload.onProgress(100, 'Upload completed.'); return this_s3upload.onFinishS3Put(public_url, name); } else { return this_s3upload.onError('Upload error: ' + xhr.status); } }; xhr.onerror = function() { return this_s3upload.onError('XHR error.'); }; xhr.upload.onprogress = function(e) { var percentLoaded; if (e.lengthComputable) { percentLoaded = Math.round((e.loaded / e.total) * 100); return this_s3upload.onProgress(percentLoaded, percentLoaded === 100 ? 'Finalizing.' : 'Uploading.'); } }; } xhr.setRequestHeader('Content-Type', file.type); xhr.setRequestHeader('x-amz-acl', 'public-read'); return xhr.send(file); }; S3Upload.prototype.uploadFile = function(file) { var this_s3upload; this_s3upload = this; return this.executeOnSignedUrl(file, function(signedURL, publicURL, name) { return this_s3upload.uploadToS3(file, signedURL, publicURL, name); }); }; return S3Upload; })(); }).call(this);
module.exports = function(config){ config.set({ basePath : './', files : [ 'app/bower_components/angular/angular.js', 'app/bower_components/angular-route/angular-route.js', 'app/bower_components/angular-mocks/angular-mocks.js', 'app/bower_components/lodash/dist/lodash.js', 'app/components/**/*.js', 'app/view*/**/*.js' ], autoWatch : true, frameworks: ['jasmine'], browsers : ['Chrome'], plugins : [ 'karma-chrome-launcher', 'karma-firefox-launcher', 'karma-jasmine', 'karma-junit-reporter' ], junitReporter : { outputFile: 'test_out/unit.xml', suite: 'unit' } }); };
var slaying = true; var youHit = Math.floor(Math.random() * 2); var damageThisRound = Math.floor(Math.random()*5 + 1); var totalDamage = 0; while(slaying) { if (youHit) { console.log("You hit the dragon!"); totalDamage += damageThisRound; if (totalDamage >=4) { console.log("Your efforts have paid off; your last hit slays the dragon and it falls at your feet with an earth-shaking rumble."); slaying = false; } else { youHit = Math.floor(Math.random() * 2); } } else { console.log("You swing at the dragon and miss. Your momentum carries you right in to the path of it's claws and you are no more."); slaying = false; } }
/** * A convenient table-based frontend for displaying Heartbeat data to the user * * Copyright (c) 2017 Harry Burt <http://www.harryburt.co.uk>. * @module heartbeat/table * @license MIT */ (function($) { var tableData = {}, id = false, $parent = false, monthShown = '', monthsLoaded = []; /** * Sets a series of relevant global variables * @param {jQuery} $newParent * @param newId */ $.initTable = function( $newParent, newId ) { $parent = $newParent; id = newId; monthShown = $.dateToMonth( new Date() ); monthsLoaded.push( monthShown ); }; /** * Get the data model underpinning the current table view * @returns {Object} */ $.getTableData = function () { return tableData; }; /** * Sets the data model underpinning the current table view and refreshes the display * @param data */ $.setTableData = function ( data ) { tableData = data; $.updateTable(); }; /** * Get the month currently shown (YYYYMM format) * @returns {string} */ $.getMonthShown = function () { return monthShown; }; /** * Show a different month (YYYYMM format) * @param {string} month */ $.setMonthShown = function ( month ) { monthShown = month; $.updateTable(); }; /** * Convert the current data model into a DOM representation and insert it, overwriting any existing table. */ $.updateTable = function () { var doAdjust = function ( $this, value, rowKey, columnKey) { var urlParams = { 'id': id, 'value': value, 'date': rowKey, 'target': columnKey }; $this.removeClass().addClass( 'fa fa-spin fa-circle-o-notch' ); $.adjust( urlParams, function ( data ) { tableData[data.date]['adj_' + columnKey] = parseInt( data.value ); $.updateTable(); }, function () { $this.removeClass( 'fa-spin fa-circle-o-notch' ) .addClass( 'fa-exclamation-triangle' ) .css( 'color', 'red' ); } ); }, getIcon = function ( name ) { return $( '<i>' ).addClass( 'fa fa-' + name ); }, getAddIcon = function ( rowKey ) { return getIcon( 'plus' ).click( function () { var $this = $( this ), urlParams = { 'id': id, 'date': rowKey }; $this.removeClass( 'fa-undo' ).addClass( 'fa-spin fa-circle-o-notch' ); $.create( urlParams, function ( data ) { var newRow = {}; newRow.start = newRow.end = newRow.adj_start = newRow.adj_end = newRow.adj_gaps = newRow.counter = newRow.validated = 0; tableData[data.date] = newRow; $.updateTable(); }, function () { $this.removeClass( 'fa-spin fa-circle-o-notch' ) .addClass( 'fa-exclamation-triangle' ) .css( 'color', 'red' ); } ); } ) }, getEditIcon = function ( rowKey, columnKey ) { return getIcon( 'pencil' ).click( function () { var $cell = $( this ).parent(), $input = $( '<input type="text"/>' ) .val( $cell.text() ) .attr( 'pattern', '([01]?[0-9]|2[0123])(:|\.)[0-5][0-9]' ) .keyup( function ( e ) { if ( e.which !== 13 ) return; // the enter key code $cell.find( 'i.fa-check' ).click(); return false; } ) .focusout( function () { $cell.find( 'i.fa-check' ).click(); return false; } ); $cell.html( '' ).append( $input ).append( getIcon( 'check' ).click( function () { // @todo: why do you sometimes need to click twice? if ( !$input.get( 0 ).validity.valid ) { return; } $input.val( $input.val().replace( '.', ':' ) ); var value = ( columnKey === 'gaps' ) ? $.hoursToSeconds( $input.val() ) : $.toEpochSeconds( rowKey + ' ' + $input.val() ); doAdjust( $( this ), value, rowKey, columnKey ); } ) ); } ) }, getUndoIcon = function( rowKey, columnKey ) { return getIcon( 'undo' ).click( function () { doAdjust( $( this ), 0, rowKey, columnKey ); } ) }, getValidateIcon = function( rowKey, columnKey, currentState ) { var classes = ['square-o unvalidated', 'check-square-o']; return getIcon( classes[currentState] ).click( function () { var $this = $( this ), urlParams = { 'id': id, 'date': rowKey, 'value': ( 1 - currentState ) }; $this.removeClass( classes[currentState] ).addClass( 'fa-spin fa-circle-o-notch' ); $.validate( urlParams, function ( data ) { tableData[data.date].validated = parseInt( data.value ); $.updateTable(); }, function () { $this.removeClass( 'fa-spin fa-circle-o-notch' ) .addClass( 'fa-exclamation-triangle' ) .css( 'color', 'red' ); } ); } ); }, getRowKeys = function() { var startDate = $.getPreviousMonday( $.toDate( monthShown + '01' ) ), stopDate = $.getNextSunday( new Date() ), rowKeys = []; if ( monthShown !== monthsLoaded[0] ) { // stopDate should be last date of month stopDate = $.toDate( $.getNextMonth( monthShown ) + '01' ); stopDate.setDate( stopDate.getDate() - 1 ); stopDate = $.getNextSunday( stopDate ); } while ( startDate <= stopDate ) { var str = startDate.toLocaleDateString( 'en-GB' ), key = str.substr( 6, 4 ) + str.substr( 3, 2 ) + str.substr( 0, 2 ); if ( tableData[key] === undefined ) { tableData[key] = {}; } rowKeys.push( key ); startDate.setDate( startDate.getDate() + 1 ); } return rowKeys; }; // Set up all the variables we're going to need. var i, j, subtotal = 0, rowKeys = getRowKeys(), rowNames = rowKeys.map( $.toPrettyName ), columnNames = { 'start': 'Logged in', 'end': 'Logged off', 'adj_gaps': 'Gaps', 'total': 'Total', 'counter': 'Of which tracked' }, columnKeys = Object.keys( columnNames ), month = $.toDate( monthShown + '01' ), previousMonth = $.getPreviousMonth( monthShown ), nextMonth = $.getNextMonth( monthShown ); // Delete any table already present $parent.find( '#query-data' ).remove(); // Insert new skeleton table var $table = $( '<table>' ).attr( 'id', 'query-data' ).addClass( 'pure-table' ).appendTo( $parent ), $caption = $( '<caption>' ).text( month.toLocaleDateString( 'en-US', { 'month': 'long', 'year': 'numeric' } ) ).appendTo( $table ), $headerRow = $( '<tr>' ).appendTo( $('<thead>').appendTo( $table ) ), $tbody = $( '<tbody>' ).appendTo( $table ); // Add forward/back buttons to the caption $caption.prepend( getIcon( 'backward' ).click( function() { // We lazy load previous months' data: so we need to check if it's cached if ( monthsLoaded.indexOf( previousMonth ) > -1 ) { // Already in cache $.setMonthShown( previousMonth ); } else { // Not in the cache. Let's add it now (asynchronously) $.query( {'id': id, 'month': previousMonth}, function ( data ) { $.extend( tableData, data ); monthsLoaded.push( previousMonth ); $.setMonthShown( previousMonth ); } ); } } ) ); if( monthsLoaded.indexOf( nextMonth ) > -1 ) { $caption.append( getIcon( 'forward' ).click( function () { // Since we don't let people scroll forward until they scroll back, this must already be cached $.setMonthShown( nextMonth ); } ) ); } // Now do header row, starting with a blank cell $headerRow.append( $( "<th>" ) ); for ( i = 0; i < columnKeys.length; i++ ) { $headerRow.append( $( "<th>" ).text( columnNames[columnKeys[i]] ) ); } // And finally fill in the remaining rows for ( j = 0; j < rowKeys.length; j++ ) { var $row = $( "<tr>" ).append( $( "<th>" ).text( rowNames[j] ) ).appendTo( $tbody ), rowData = tableData[rowKeys[j]]; for ( i = 0; i < columnKeys.length; i++ ) { var $cell = $( "<td>" ).appendTo( $row ); if( $.isEmptyObject( rowData ) ) { // Doesn't exist yet $cell.attr( 'colspan', columnKeys.length ).append( getAddIcon( rowKeys[j] ) ); break; } var value = $.secondsToHours( rowData[columnKeys[i]] ); $cell.text( value ); switch( columnKeys[i] ) { case 'start': case 'end': var adj = rowData['adj_' + columnKeys[i]]; if( adj !== 0 ) { $cell.text( $.secondsToHours( adj ) ); $cell.addClass( 'adjusted' ); } $cell.append( getEditIcon( rowKeys[j], columnKeys[i] ) ); if( adj !== 0 ) { $cell.append( getUndoIcon( rowKeys[j], columnKeys[i] ) ); } break; case 'total': var start = rowData['start'], end = rowData['end']; if( rowData['adj_start'] > 0 ) start = rowData['adj_start']; if( rowData['adj_end'] > 0 ) end = rowData['adj_end']; var diff = end - start - rowData['adj_gaps']; $cell.text( $.secondsToHours( diff ) ); $cell.append( getValidateIcon( rowKeys[j], columnKeys[i], rowData['validated'] ) ); subtotal += diff; break; case 'adj_gaps': $cell.append( getEditIcon( rowKeys[j], 'gaps' ) ); if( value !== '00:00' ) { $cell.append( getUndoIcon( rowKeys[j], 'gaps' ) ); } break; } } // Weekly totals if( j % 7 === 6 ) { // Finalise previous row $row.addClass( 'sunday' ); // Create new total row $row = $( "<tr>" ).addClass( 'total' ) .append( $( '<th>' ).text( 'w/c ' + $.toDate( rowKeys[j-6] ).toLocaleDateString( 'en-GB', { day: "numeric", month: "short" } ) ) ) .appendTo( $tbody ); for ( i = 0; i < columnKeys.length; i++ ) { var $td = $( '<td>' ).appendTo( $row ); if( columnKeys[i] === 'total' ) { $td.text( $.secondsToHours( subtotal ) ); subtotal = 0; } } } } }; }(jQuery));
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _createSvgIcon = _interopRequireDefault(require("./utils/createSvgIcon")); var _jsxRuntime = require("react/jsx-runtime"); var _default = (0, _createSvgIcon.default)( /*#__PURE__*/(0, _jsxRuntime.jsx)("path", { d: "M16.5 3c-.96 0-1.9.25-2.73.69L12 9h3l-3 10 1-9h-3l1.54-5.39C10.47 3.61 9.01 3 7.5 3 4.42 3 2 5.42 2 8.5c0 4.13 4.16 7.18 10 12.5 5.47-4.94 10-8.26 10-12.5C22 5.42 19.58 3 16.5 3z" }), 'HeartBroken'); exports.default = _default;
(function(){ 'use strict'; angular .module('social.layout.controllers') .controller('NavbarController', NavbarController); NavbarController.$inject = ['$scope', 'Authentication']; function NavbarController($scope, Authentication){ $scope.logout = function(){ Authentication.logout(); }; } })();
var Server = require('..').Server var config = require('../config') var multilevel = require('multilevel') var fancy = new Server() var server = fancy.start(config) var client = multilevel.client(require(config.manifest)) server.pipe(client.createRpcStream()).pipe(server) server.on('error',console.log) client.put('test','test',function(err){ console.log(err) client.get('test',function(err,data){ console.log(err,data) }) }) client.auth({name:'write',pass:'etirw'},function(err,data){ console.log(err,data) client.put('test','test',function(err){ console.log(err) client.get('test',function(err,data){ console.log(err,data) }) }) })
var essb_subscribe_opened = {}; var essb_subscribe_popup_close = function(key) { jQuery('.essb-subscribe-form-' + key).fadeOut(400); jQuery('.essb-subscribe-form-overlay-' + key).fadeOut(400); } var essb_toggle_subscribe = function(key) { // subsribe container do not exist if (!jQuery('.essb-subscribe-form-' + key).length) return; jQuery.fn.extend({ center: function () { return this.each(function() { var top = (jQuery(window).height() - jQuery(this).outerHeight()) / 2; var left = (jQuery(window).width() - jQuery(this).outerWidth()) / 2; jQuery(this).css({position:'fixed', margin:0, top: (top > 0 ? top : 0)+'px', left: (left > 0 ? left : 0)+'px'}); }); } }); var asPopup = jQuery('.essb-subscribe-form-' + key).attr("data-popup") || ""; // it is not popup (in content methods is asPopup == "") if (asPopup != '1') { if (jQuery('.essb-subscribe-form-' + key).hasClass("essb-subscribe-opened")) { jQuery('.essb-subscribe-form-' + key).slideUp('fast'); jQuery('.essb-subscribe-form-' + key).removeClass("essb-subscribe-opened"); } else { jQuery('.essb-subscribe-form-' + key).slideDown('fast'); jQuery('.essb-subscribe-form-' + key).addClass("essb-subscribe-opened"); if (!essb_subscribe_opened[key]) { essb_subscribe_opened[key] = key; essb_tracking_only('', 'subscribe', key, true); } } } else { var win_width = jQuery( window ).width(); var doc_height = jQuery('document').height(); var base_width = 600; if (win_width < base_width) { base_width = win_width - 40; } jQuery('.essb-subscribe-form-' + key).css( { width: base_width+'px'}); jQuery('.essb-subscribe-form-' + key).center(); jQuery('.essb-subscribe-form-' + key).fadeIn(400); jQuery('.essb-subscribe-form-overlay-' + key).fadeIn(200); } } var essb_ajax_subscribe = function(key, event) { event.preventDefault(); var formContainer = jQuery('.essb-subscribe-form-' + key + ' #essb-subscribe-from-content-form-mailchimp'); if (formContainer.length) { var user_mail = jQuery(formContainer).find('.essb-subscribe-form-content-email-field').val(); var user_name = jQuery(formContainer).find('.essb-subscribe-form-content-name-field').length ? jQuery(formContainer).find('.essb-subscribe-form-content-name-field').val() : ''; jQuery(formContainer).find('.submit').prop('disabled', true); jQuery(formContainer).hide(); jQuery('.essb-subscribe-form-' + key).find('.essb-subscribe-loader').show(); var submitapi_call = formContainer.attr('action') + '&mailchimp_email='+user_mail+'&mailchimp_name='+user_name; jQuery.post(submitapi_call, { mailchimp_email1: user_mail, mailchimp_name1: user_name}, function (data) { if (data) { console.log(data); if (data['code'] == '1') { jQuery('.essb-subscribe-form-' + key).find('.essb-subscribe-form-content-success').show(); } else { jQuery('.essb-subscribe-form-' + key).find('.essb-subscribe-form-content-error').append(': <span>' + data['message']+'</span>'); jQuery('.essb-subscribe-form-' + key).find('.essb-subscribe-form-content-error').show(); } jQuery('.essb-subscribe-form-' + key).find('.essb-subscribe-loader').hide(); jQuery(formContainer).hide(); }}, 'json'); } }
/*eslint-env node, jasmine*//*global module, inject*/ /*eslint-disable max-statements, max-params*/ import angular from 'angular'; import 'angular-mocks'; import 'luxyflux/ng-luxyflux'; import { Store, PaginationState, PaginatableStore, PaginatableStoreBehavior, TransformableCollection, Transformer, Annotations } from 'anglue/anglue'; describe('Paginatable', () => { // Clear the AnnotationCache for unit tests to ensure we create new annotations for each class. beforeEach(() => { Annotations.clear(); }); describe('PaginatableStoreBehavior', () => { let mockInstance, behavior, refreshSpy, addSpy, removeSpy; beforeEach(() => { refreshSpy = jasmine.createSpy(); addSpy = jasmine.createSpy(); removeSpy = jasmine.createSpy(); class MockStore { transformables = { items: { refresh: refreshSpy, addTransformer: addSpy, removeTransformer: removeSpy, transformers: [] }, foo: { refresh: refreshSpy, addTransformer: addSpy, removeTransformer: removeSpy, transformers: [] } } } mockInstance = new MockStore(); behavior = new PaginatableStoreBehavior(mockInstance); spyOn(behavior, 'refresh').and.callThrough(); }); it('should create a PaginationState', () => { expect(behavior.state).toEqual(jasmine.any(PaginationState)); }); it('should set default values for its config', () => { behavior = new PaginatableStoreBehavior(mockInstance); expect(behavior.collection).toEqual('items'); expect(behavior.state.page).toEqual(1); expect(behavior.state.limit).toEqual(null); }); it('should read the passed config', () => { behavior = new PaginatableStoreBehavior(mockInstance, { collection: 'foo', initialPage: 2, initialLimit: 100 }); expect(behavior.collection).toEqual('foo'); expect(behavior.state.page).toEqual(2); expect(behavior.state.limit).toEqual(100); }); describe('#transformer', () => { it('should define a Transformer instance as the transformers property', () => { expect(behavior.transformer).toEqual(jasmine.any(Transformer)); }); it('should name the transformer paginatableStore', () => { expect(behavior.transformer.name).toEqual('paginatableStore'); }); it('should properly slice the passed in items', () => { behavior.state.limit = 2; behavior.state.page = 1; expect(behavior.transformer.exec(['foo', 'bar', 'zzz'])) .toEqual(['foo', 'bar']); }); it('should store the total on the behavior before the slice', () => { behavior.transformer.exec(['foo', 'bar', 'zzz']); expect(behavior.state.total).toEqual(3); }); it('should not break when the slice end is bigger then the pass array', () => { behavior.state.limit = 2; behavior.state.page = 2; expect(behavior.transformer.exec(['foo', 'bar', 'zzz'])) .toEqual(['zzz']); }); it('should change to page 1 when number of items is different the previous time', () => { behavior.state.limit = 2; behavior.state.page = 2; behavior.transformer.exec(['foo', 'bar', 'zzz']); expect(behavior.state.page).toEqual(2); behavior.transformer.exec(['foo', 'bar']); expect(behavior.state.page).toEqual(1); }); }); describe('refresh()', () => { it('should add the paginatable transformer if it was not active yet', () => { behavior.state.limit = 10; behavior.refresh(); expect(addSpy).toHaveBeenCalled(); expect(refreshSpy).not.toHaveBeenCalled(); }); it('should just refresh if there is an active paginatable transformer', () => { behavior.transformableCollection.transformers.push(behavior.transformer); behavior.state.limit = 10; behavior.refresh(); expect(addSpy).not.toHaveBeenCalled(); expect(refreshSpy).toHaveBeenCalled(); }); it('should remove the transformer if the limit is null', () => { behavior.transformableCollection.transformers.push(behavior.transformer); behavior.state.limit = null; behavior.refresh(); expect(removeSpy).toHaveBeenCalled(); expect(refreshSpy).not.toHaveBeenCalled(); }); it('should not remove an inactive transformer if the limit is null', () => { behavior.state.limit = null; behavior.refresh(); expect(addSpy).not.toHaveBeenCalled(); expect(removeSpy).not.toHaveBeenCalled(); expect(refreshSpy).not.toHaveBeenCalled(); }); }); describe('onChangePage()', () => { it('should update the internal page property', () => { behavior.onChangePage(2); expect(behavior.state.page).toEqual(2); }); it('should call the internal refresh method if the page is changed', () => { behavior.onChangePage(2); expect(behavior.refresh).toHaveBeenCalled(); }); it('should not do anything if the page is the same as it was', () => { behavior.state.page = 2; behavior.onChangePage(2); expect(behavior.refresh).not.toHaveBeenCalled(); }); }); describe('onChangeLimit()', () => { it('should update the internal limit property', () => { behavior.onChangeLimit(2); expect(behavior.state.limit).toEqual(2); }); it('should call the internal refresh method if the limit is changed', () => { behavior.onChangeLimit(2); expect(behavior.refresh).toHaveBeenCalled(); }); it('should not do anything if the limit is the same as it was', () => { behavior.state.limit = 2; behavior.onChangeLimit(2); expect(behavior.refresh).not.toHaveBeenCalled(); }); }); }); describe('@PaginatableStore() decorator', () => { @Store() @PaginatableStore() class PaginatableFooStore {} @Store() @PaginatableStore({entity: 'custom'}) class CustomPaginatableStore {} @Store() @PaginatableStore('custom') class CustomPaginatableStringStore {} @Store() @PaginatableStore({collection: 'foo'}) class CollectionPaginatableStore {} @Store() @PaginatableStore({initialPage: 2, initialLimit: 5}) class InitialPaginatableStore {} let paginatableStore; let customPaginatableStore; let customPaginatableStringStore; let collectionPaginatableStore; let initialPaginatableStore; beforeEach(() => { angular.module('test', [ 'luxyflux', PaginatableFooStore.annotation.module.name, CustomPaginatableStore.annotation.module.name, CustomPaginatableStringStore.annotation.module.name, CollectionPaginatableStore.annotation.module.name, InitialPaginatableStore.annotation.module.name ]).service('ApplicationDispatcher', () => { return { register() {}, dispatch() {} }; }); module('test'); inject(( _PaginatableFooStore_, _CustomPaginatableStore_, _CustomPaginatableStringStore_, _CollectionPaginatableStore_, _InitialPaginatableStore_ ) => { paginatableStore = _PaginatableFooStore_; customPaginatableStore = _CustomPaginatableStore_; customPaginatableStringStore = _CustomPaginatableStringStore_; collectionPaginatableStore = _CollectionPaginatableStore_; initialPaginatableStore = _InitialPaginatableStore_; }); }); it('should define the EntityStore API methods on the paginatableStore', () => { [ 'paginatableStore', 'onPaginatableFooChangePage', 'onPaginatableFooChangeLimit', 'paginationState' ].forEach(api => expect(paginatableStore[api]).toBeDefined()); }); it('should make the collection transformable', () => { expect(paginatableStore.transformables.items).toEqual(jasmine.any(TransformableCollection)); }); it('should have an instance of PaginatableStoreBehavior as the behavior property', () => { expect(paginatableStore.paginatableStore).toEqual(jasmine.any(PaginatableStoreBehavior)); }); it('should use the class name to determine the crud entity by default', () => { expect(paginatableStore.paginatableStore.config.entity).toEqual('PaginatableFoo'); }); it('should be possible to configure the entity to manage', () => { expect(customPaginatableStore.paginatableStore.config.entity).toEqual('custom'); }); it('should be possible to pass the entity property as a string', () => { expect(customPaginatableStringStore.paginatableStore.config.entity).toEqual('custom'); }); it('should create properly named handlers when configuring the entity', () => { expect(customPaginatableStore.onCustomChangePage).toBeDefined(); expect(customPaginatableStore.onCustomChangeLimit).toBeDefined(); }); it('should pass on initial state', () => { expect(initialPaginatableStore.paginationState.page).toEqual(2); expect(initialPaginatableStore.paginationState.limit).toEqual(5); }); it('should use the item property as the collection by default', () => { expect(paginatableStore.paginatableStore.collection).toEqual('items'); }); it('should be possible to configure the collection property the entities are paginatableStored in', () => { expect(collectionPaginatableStore.paginatableStore.collection).toEqual('foo'); }); it('should add handlers for actions', () => { expect(PaginatableFooStore.handlers) .toEqual(jasmine.objectContaining({ PAGINATABLE_FOO_CHANGE_PAGE: 'onPaginatableFooChangePage', PAGINATABLE_FOO_CHANGE_LIMIT: 'onPaginatableFooChangeLimit' })); }); }); });
// var express = require('express'); // var router = express.Router(); // // /* GET home page. */ // router.get('/', function(req, res, next) { // res.render('index', { title: 'Express' }); // }); // router.post('/index',function(req,res){ // console.log(req.body.username); // }); // module.exports = router; var r = require('../my_modules/var'); //new module.exports = function(app, dirname) { app.get('/', function(req, res) { res.sendFile(dirname+'/views/index.html'); }); // app.get('/Chat', function(req, res) { // res.sendFile(dirname+'/views/index.html'); // });//nginx设置了反向代理 app.post('/login/:roomID', function(req, res) { req.session.username = req.body.username; req.session.roomID = req.params.roomID; // console.log(req.session.usern); // res.cookie('username', req.body.username, {maxAge: 1000*60*60,signed:true}); var roomID = req.params.roomID; // res.cookie('roomID', roomID, {maxAge: 1000*60*5,signed:true}); // console.log(req.body.username+"登录了"+roomID+" by index.js"); var status = 1; if(!r.roomInfo[roomID]){} else{ var i = r.roomInfo[roomID].length; // console.log("I:"+i); while(i--) { if(r.roomInfo[roomID][i]==req.body.username) { status = 0; } // console.log(r.roomInfo[roomID][i]); } } // console.log(r.roomInfo[roomID]+" index.js"); var tmp={status : status,roomID:roomID}; res.send(tmp); res.end(); }); app.post('/get', function(req, res) { var username = req.session.username;//从session中读取 // console.log(username); // var usr1 = req.signedCookies.username; var roomID = req.session.roomID; // console.log(usr1); var tmp={status : 1,username:username,roomID:roomID}; res.send(tmp); res.end(); }); app.get('/show', function(req, res) { // req.session.username = req.body.username; //res.cookie('username', req.body.username, {maxAge: 1000*60*60}); //console.log(req.body.username+"登录了"); // var tmp={status : 1}; // res.send(tmp); // res.end(); res.sendFile(dirname+'/views/index_show.html'); }); app.get('/room/:roomID', function (req, res) { var roomID = req.params.roomID; res.sendFile(dirname+'/views/index.html'); }); };
import React, { Component, PropTypes } from 'react'; import { View, Dimensions } from 'react-native'; export default class Stage extends Component { static propTypes = { children: PropTypes.any, height: PropTypes.number, style: PropTypes.object, width: PropTypes.number, }; static defaultProps = { width: 1024, height: 576, }; static contextTypes = { loop: PropTypes.object, } static childContextTypes = { loop: PropTypes.object, scale: PropTypes.number, }; constructor(props) { super(props); const { height, width } = Dimensions.get('window'); this.state = { dimensions: [height, width ], }; } getChildContext() { return { scale: this.getScale().scale, loop: this.context.loop, }; } getScale() { const [vheight, vwidth] = this.state.dimensions; const { height, width } = this.props; let targetWidth; let targetHeight; let targetScale; if (height / width > vheight / vwidth) { targetHeight = vheight; targetWidth = targetHeight * width / height; targetScale = vheight / height; } else { targetWidth = vwidth; targetHeight = targetWidth * height / width; targetScale = vwidth / width; } return { height: targetHeight, width: targetWidth, scale: targetScale, }; } getWrapperStyles() { return { flex: 1 }; } getInnerStyles() { const scale = this.getScale(); const xOffset = Math.floor((this.state.dimensions[1] - scale.width) / 2); const yOffset = Math.floor((this.state.dimensions[0] - scale.height) / 2); return { height: Math.floor(scale.height), width: Math.floor(scale.width), position: 'absolute', overflow: 'hidden', left: xOffset, top: yOffset, }; } render() { return ( <View style={this.getWrapperStyles()}> <View style={{ ...this.getInnerStyles(), ...this.props.style }}> {this.props.children} </View> </View> ); } }
'use strict'; describe('Utilities', function () { beforeEach(module('septWebRadioFactories')); var utilities, scope; beforeEach(inject(function ($rootScope, _utilities_) { scope = $rootScope.$new(); utilities = _utilities_; })); describe('removeObjectById', function () { it('should return the same object than provided', inject(function () { var listSource = [ {id: 0}, {id: 1}, {id: 2}, {id: 3} ]; var listDest = utilities.removeObjectById(listSource, 0); expect(listDest).toBe(listSource); })); it('should have a returned size to 3', inject(function () { var listSource = [ {id: 0}, {id: 1}, {id: 2}, {id: 3} ]; var listDest = []; expect(listSource.length).toBe(4); expect(listDest.length).toBe(0); listDest = utilities.removeObjectById(listSource, 0); expect(listSource.length).toBe(3); expect(listDest.length).toBe(3); expect(listDest).toEqual([{id: 1}, {id: 2}, {id: 3}]); })); it('should remove the first item', inject(function () { var listSource = [ {id: 0}, {id: 1}, {id: 2}, {id: 3} ]; var listDest = utilities.removeObjectById(listSource, 0); expect(listDest).toEqual([{id: 1}, {id: 2}, {id: 3}]); })); it('should remove the last item', inject(function () { var listSource = [ {id: 0}, {id: 1}, {id: 2}, {id: 3} ]; var listDest = utilities.removeObjectById(listSource, 3); expect(listDest).toEqual([{id: 0}, {id: 1}, {id: 2}]); })); it('should not remove items', inject(function () { var listSource = [ {id: 0}, {id: 1}, {id: 2}, {id: 3} ]; var listDest = utilities.removeObjectById(listSource, 5); expect(listDest).toEqual([{id: 0}, {id: 1}, {id: 2}, {id: 3}]); })); }); describe('removeObjectByAttribute', function () { it('should return the same object than provided', inject(function () { var listSource = [ {attributeName: 0}, {attributeName: 1}, {attributeName: 2}, {attributeName: 3} ]; var listDest = utilities.removeObjectByAttribute(listSource, 0, 'attributeName'); expect(listDest).toBe(listSource); })); it('should have a returned size to 3', inject(function () { var listSource = [ {attributeName: 0}, {attributeName: 1}, {attributeName: 2}, {attributeName: 3} ]; var listDest = []; expect(listSource.length).toBe(4); expect(listDest.length).toBe(0); listDest = utilities.removeObjectByAttribute(listSource, 0, 'attributeName'); expect(listSource.length).toBe(3); expect(listDest.length).toBe(3); expect(listDest).toEqual([{attributeName: 1}, {attributeName: 2}, {attributeName: 3}]); })); it('should remove the first item', inject(function () { var listSource = [ {attributeName: 0}, {attributeName: 1}, {attributeName: 2}, {attributeName: 3} ]; var listDest = utilities.removeObjectByAttribute(listSource, 0, 'attributeName'); expect(listDest).toEqual([{attributeName: 1}, {attributeName: 2}, {attributeName: 3}]); })); it('should remove the last item', inject(function () { var listSource = [ {attributeName: 0}, {attributeName: 1}, {attributeName: 2}, {attributeName: 3} ]; var listDest = utilities.removeObjectByAttribute(listSource, 3, 'attributeName'); expect(listDest).toEqual([{attributeName: 0}, {attributeName: 1}, {attributeName: 2}]); })); it('should not remove items', inject(function () { var listSource = [ {attributeName: 0}, {attributeName: 1}, {attributeName: 2}, {attributeName: 3} ]; var listDest = utilities.removeObjectByAttribute(listSource, 5, 'attributeName'); expect(listDest).toEqual([{attributeName: 0}, {attributeName: 1}, {attributeName: 2}, {attributeName: 3}]); })); }); describe('listContainsAttribute', function () { it('should return the first object', inject(function () { var listSource = [ {attributeName: 0}, {attributeName: 1}, {attributeName: 2}, {attributeName: 3} ]; var item = utilities.listContainsAttribute(listSource, 0, 'attributeName'); expect(item).toEqual({attributeName: 0}); })); it('should return the last object', inject(function () { var listSource = [ {attributeName: 0}, {attributeName: 1}, {attributeName: 2}, {attributeName: 3} ]; var item = utilities.listContainsAttribute(listSource, 3, 'attributeName'); expect(item).toEqual({attributeName: 3}); })); it('should return undefined', inject(function () { var listSource = [ {attributeName: 0}, {attributeName: 1}, {attributeName: 2}, {attributeName: 3} ]; var item = utilities.listContainsAttribute(listSource, 5, 'attributeName'); expect(item).toBeUndefined() })); }); describe('listContainsId', function () { it('should return the first object', inject(function () { var listSource = [ {id: 0}, {id: 1}, {id: 2}, {id: 3} ]; var item = utilities.listContainsId(listSource, 0); expect(item).toEqual({id: 0}); })); it('should return the last object', inject(function () { var listSource = [ {id: 0}, {id: 1}, {id: 2}, {id: 3} ]; var item = utilities.listContainsId(listSource, 3); expect(item).toEqual({id: 3}); })); it('should return undefined', inject(function () { var listSource = [ {id: 0}, {id: 1}, {id: 2}, {id: 3} ]; var item = utilities.listContainsId(listSource, 5); expect(item).toBeUndefined() })); }); describe('unionWithAttribute', function () { it('should union the two lists', inject(function () { var listFrom = [ {attributeName: 0}, {attributeName: 1}, {attributeName: 2}, {attributeName: 3} ]; var listTo = [ {attributeName: 4}, {attributeName: 1}, {attributeName: 5}, {attributeName: 6} ]; var newList = utilities.unionWithAttribute(listFrom, listTo, 'attributeName'); expect(newList).toEqual([{attributeName: 1}, {attributeName: 4}, {attributeName: 5}, {attributeName: 6}]); })); it('should not merge the two lists', inject(function () { var listFrom = [ ]; var listTo = [ {attributeName: 4}, {attributeName: 1}, {attributeName: 5}, {attributeName: 6} ]; var newList = utilities.unionWithAttribute(listFrom, listTo, 'attributeName'); expect(newList).toEqual([{attributeName: 4}, {attributeName: 1}, {attributeName: 5}, {attributeName: 6}]); })); }); describe('unionWithId', function () { it('should union the two lists', inject(function () { var listFrom = [ {id: 0}, {id: 1}, {id: 2}, {id: 3} ]; var listTo = [ {id: 4}, {id: 1}, {id: 5}, {id: 6} ]; var newList = utilities.unionWithId(listFrom, listTo, 'id'); expect(newList).toEqual([{id: 1}, {id: 4}, {id: 5}, {id: 6}]); })); it('should not merge the two lists', inject(function () { var listFrom = [ ]; var listTo = [ {id: 4}, {id: 1}, {id: 5}, {id: 6} ]; var newList = utilities.unionWithId(listFrom, listTo); expect(newList).toEqual([{id: 4}, {id: 1}, {id: 5}, {id: 6}]); })); }); describe('addOrRemoveItem', function () { it('should add the item', inject(function () { var listFrom = ['abc', 'def', 'ghi']; utilities.addOrRemoveItem(listFrom, 'jkl'); expect(listFrom).toEqual(['abc', 'def', 'ghi', 'jkl']); })); it('should remove the item', inject(function () { var listFrom = ['abc', 'def', 'ghi']; utilities.addOrRemoveItem(listFrom, 'def'); expect(listFrom).toEqual(['abc', 'ghi']); })); }); describe('removeItem', function () { it('should remove the item', inject(function () { var listFrom = ['abc', 'def', 'ghi']; utilities.removeItem(listFrom, 'def'); expect(listFrom).toEqual(['abc', 'ghi']); })); it('should not remove the item', inject(function () { var listFrom = ['abc', 'def', 'ghi']; utilities.removeItem(listFrom, 'jkl'); expect(listFrom).toEqual(['abc', 'def', 'ghi']); })); }); describe('isItemNotPresents', function () { it('should return false', inject(function () { var listFrom = ['abc', 'def', 'ghi']; var isPresents = utilities.isItemNotPresents(listFrom, 'def'); expect(isPresents).toBeFalsy(); })); it('should return true', inject(function () { var listFrom = ['abc', 'def', 'ghi']; var isPresents = utilities.isItemNotPresents(listFrom, 'jkl'); expect(isPresents).toBeTruthy(); })); }); describe('isItemPresents', function () { it('should return true', inject(function () { var listFrom = ['abc', 'def', 'ghi']; var isPresents = utilities.isItemPresents(listFrom, 'def'); expect(isPresents).toBeTruthy(); })); it('should return false', inject(function () { var listFrom = ['abc', 'def', 'ghi']; var isPresents = utilities.isItemPresents(listFrom, 'jkl'); expect(isPresents).toBeFalsy(); })); }); });
/** * @file 配置文件 * @author yanhaijing.com * @date 2015年12月26日 17:26:48 */ var dist = 'dist' var gulp = require('gulp') var browserSync = require('browser-sync') var del = require('del') var babel = require('gulp-babel') var sass = require('gulp-ruby-sass') var concat = require('gulp-concat') var cache = require('gulp-cache') var runSequence = require('run-sequence') var minifycss = require('gulp-minify-css') var uglify = require('gulp-uglify') // hello gulp.task('hello', function() { console.log('Hello World!'); }); // clean gulp.task('clean', function() { return del(dist); }); // html gulp.task('html', function() { return gulp.src('app/**.html') .pipe(gulp.dest(dist)) }); // image gulp.task('image', function() { return gulp.src('app/**/*.+(png|jpg|jpeg|gif|svg)') .pipe(gulp.dest(dist)) }); // scss gulp.task('sass', function() { return sass('app/css/**.scss') .on('error', sass.logError) .pipe(gulp.dest(dist + '/css')) }); gulp.task('sass:build', function() { return sass('app/css/**.scss') .on('error', sass.logError) .pipe(minifycss()) .pipe(gulp.dest(dist + '/css')) }); // css gulp.task('css', function() { return gulp.src('app/css/**.css') .pipe(gulp.dest(dist + '/css')) }); gulp.task('css:build', function() { return gulp.src('app/css/**.css') .pipe(minifycss()) .pipe(gulp.dest(dist + '/css')) }); // style gulp.task('style', function (cb){ runSequence(['sass', 'css'], cb) }); gulp.task('style:build', function (cb){ runSequence(['sass:build', 'css:build'], cb) }); // js gulp.task('js', function() { return gulp.src('app/js/**.js') .pipe(gulp.dest(dist + '/js')) }); gulp.task('js:build', function() { return gulp.src('app/js/**.js') .pipe(uglify()) .pipe(gulp.dest(dist + '/js')) }); // es gulp.task('es', function() { return gulp.src('app/js/**.es') .pipe(babel({ presets: ['es2015'] })) .pipe(gulp.dest(dist + '/js')) }); gulp.task('es:build', function() { return gulp.src('app/js/**.es') .pipe(babel({ presets: ['es2015'] })) .pipe(uglify()) .pipe(gulp.dest(dist + '/js')) }); //script gulp.task('script', function (cb){ runSequence(['es', 'js'], cb) }); gulp.task('script:build', function (cb){ runSequence(['es:build', 'js:build'], cb) }); // browserSync gulp.task('browserSync', function() { browserSync({ server: { baseDir: dist }, }) }); // dev gulp.task('dev', ['clean'], function (cb){ runSequence(['html', 'image', 'style', 'script'], cb) }); // build gulp.task('build', ['clean'], function (cb){ runSequence(['html', 'image', 'style:build', 'script:build'], cb) }); // default gulp.task('default', function(cb) { runSequence('dev', cb) }); // watch gulp.task('watch', ['browserSync'], function() { gulp.watch('app/**', ['dev']) gulp.watch(dist + '/**', browserSync.reload) });
$(document).on('feedPushed', function () { showNumberOfFeeds(); }); function showNumberOfFeeds(){ feedManager.queue.then(function (snapshot) { if (snapshot.val()) { console.log('render snapshot') feedManager.inbox.then(function (result) { $("#divCounter").show().text(result); }) } else { console.log('false') $("#divCounter").hide(); } }) } function showFeed(){ feedManager.queue.then(function (snapshot) { var entitiesArray = snapshot.val(); //show header renderTemplate("#feedHeaderTitle-tmpl",{},"#headerTitle"); $("#headerBreadCrumbs").html(""); $("#headerMenu").html(""); //show footer renderTemplate("#feedFooter-tmpl",{},"footer"); // console.log("Hai: "+entitiesArray) //show var preContext = new Array(); for (var key in entitiesArray) { preContext.push({type: entitiesArray[key].entityType, uid: entitiesArray[key].entityUid, title: entitiesArray[key].title ,symbol: symbols[entitiesArray[key].entityType]}); } var context = {feeds: preContext}; renderTemplate("#feedWrapper-tmpl", context, "wrapper"); var turnOff = function () { feedManager.queue = "popAll"; feedManager.inbox = 0; feedManager.lastFeedAccess = firebase.database.ServerValue.TIMESTAMP; }; setActiveEntity("feed", undefined, undefined, undefined, turnOff) }); }
'use strict'; var crmService = '/XRMServices/2011/Organization.svc'; exports.authUrl = 'https://login.microsoftonline.com/RST2.srf'; exports.getOrganizationEndpoint = function(organizationUrl) { return organizationUrl + crmService; };
{ return doc.readyState === "complete" || doc.readyState === requiredReadyState; }
/* Return an object with the following members: * - n: the number of vertices * - hasEdge(i, j): function which returns true iff. ij is an edge * - canvas: an HTML 5 canvas element * - position(i): determine the position of vertex i on the canvas * - timeInterval: the amount of time it takes to draw a vertex or edge * - showVertices: if true, display the vertices as dots * - draw(): start drawing the graph * - stop(): stop drawing the graph * - reset(): start over from the beginning next time a vertex/edge would be drawn */ var graphDrawer = function(n, hasEdge, canvas, position, timeInterval, showVertices) { var drawer = { n: n, hasEdge: hasEdge, canvas: canvas, position: position, timeInterval: timeInterval, showVertices: showVertices, }; var verticesDrawn = false; var i = 0; var j = 1; var drawNext = function() { var ctx = drawer.canvas.getContext("2d"); // First draw the vertices if(!verticesDrawn && drawer.showVertices) { ctx.beginPath(); var point = drawer.position(i); ctx.arc(point.x, point.y, 4, 0, 2 * Math.PI); ctx.fill(); if(++i >= drawer.n) { i = 0; verticesDrawn = true; } } else { var edgeDrawn = false; while(!edgeDrawn) { if(drawer.hasEdge(i, j)) { ctx.beginPath(); iCoords = drawer.position(i); jCoords = drawer.position(j); ctx.moveTo(iCoords.x, iCoords.y); ctx.lineTo(jCoords.x, jCoords.y); ctx.stroke(); edgeDrawn = true; } // Increment i and j if(++j >= drawer.n) { j = ++i + 1; if(i >= drawer.n - 1) { // No more vertices to draw drawer.stop() } } } } }; var timer = null; drawer.draw = function() { timer = setInterval(drawNext, drawer.timeInterval); }; drawer.reset = function() { i = j = 0; verticesDrawn = false; }; drawer.stop = function() { clearInterval(timer); }; return drawer; };
var bcrypt = require('bcrypt'); var redisHelper = require('./redis'); var db = redisHelper.getConnection(); function findByUsername(username, next) { db.hget('users', username, function(err, hashedpw) { if (hashedpw != null) { var user = { username: username, hashedpw: hashedpw, admin: false }; return next(null, user); } return next(null, null); }); } function verifyUser(username, password, next) { findByUsername(username, function(err, user) { if (err) { return next(err); } if (!user) { return next(null, false, { message: 'Unknown user: ' + username }); } bcrypt.compare(password, user.hashedpw, function(err, res) { if (err) { return next(err); } if (res === false) { return next(null, false, { message: 'Invalid password.' }); } return next(null, user); }); }); } function createUser(username, password, next) { bcrypt.hash(password, 11, function(err, hashedpw) { if (err) { return next(err); } db.hset('users', username, hashedpw, function(err) { next(err); }); }); } function setupPassport(passport) { passport.serializeUser(function(user, next) { next(null, user.username); }); passport.deserializeUser(function(username, next) { findByUsername(username, next); }); var LocalStrategy = require('passport-local').Strategy; var strategy = new LocalStrategy(verifyUser); passport.use(strategy); } function ensureAuthenticated(req, res, next) { if (req.isAuthenticated()) { return next(); } // save desired URL for later redirect req.session.redirect = req.url; return res.redirect("/login"); } function ensureAdmin(req, res, next) { ensureAuthenticated(req, res, function(req, res, next) { if(!req.user.admin) { res.set('Content-Type', 'text/plain'); res.send(403, 'You can\'t do that!'); } return next(); }); } exports.verifyUser = verifyUser; exports.createUser = createUser; exports.setupPassport = setupPassport; exports.ensureAuthenticated = ensureAuthenticated; exports.ensureAdmin = ensureAdmin;
'use strict'; module.exports = function (grunt) { // Load grunt tasks automatically, when needed require('jit-grunt')(grunt, { express: 'grunt-express-server', useminPrepare: 'grunt-usemin', ngtemplates: 'grunt-angular-templates', cdnify: 'grunt-google-cdn', protractor: 'grunt-protractor-runner', injector: 'grunt-asset-injector' }); // Time how long tasks take. Can help when optimizing build times require('time-grunt')(grunt); // Define the configuration for all the tasks grunt.initConfig({ // Project settings yeoman: { // configurable paths client: require('./bower.json').appPath || 'client', dist: 'dist' }, express: { options: { port: process.env.PORT || 9000 }, dev: { options: { script: 'server/app.js', debug: true } }, prod: { options: { script: 'dist/server/app.js' } } }, open: { server: { url: 'http://localhost:<%= express.options.port %>' } }, watch: { injectJS: { files: [ '<%= yeoman.client %>/{app,components}/**/*.js', '!<%= yeoman.client %>/{app,components}/**/*.spec.js', '!<%= yeoman.client %>/{app,components}/**/*.mock.js', '!<%= yeoman.client %>/app/app.js'], tasks: ['injector:scripts'] }, injectCss: { files: [ '<%= yeoman.client %>/{app,components}/**/*.css' ], tasks: ['injector:css'] }, mochaTest: { files: ['server/**/*.spec.js'], tasks: ['env:test', 'mochaTest'] }, jsTest: { files: [ '<%= yeoman.client %>/{app,components}/**/*.spec.js', '<%= yeoman.client %>/{app,components}/**/*.mock.js' ], tasks: ['newer:jshint:all', 'karma'] }, gruntfile: { files: ['Gruntfile.js'] }, livereload: { files: [ '{.tmp,<%= yeoman.client %>}/{app,components}/**/*.css', '{.tmp,<%= yeoman.client %>}/{app,components}/**/*.html', '{.tmp,<%= yeoman.client %>}/{app,components}/**/*.js', '!{.tmp,<%= yeoman.client %>}{app,components}/**/*.spec.js', '!{.tmp,<%= yeoman.client %>}/{app,components}/**/*.mock.js', '<%= yeoman.client %>/assets/images/{,*//*}*.{png,jpg,jpeg,gif,webp,svg}' ], options: { livereload: true } }, express: { files: [ 'server/**/*.{js,json}' ], tasks: ['express:dev', 'wait'], options: { livereload: true, nospawn: true //Without this option specified express won't be reloaded } } }, // Make sure code styles are up to par and there are no obvious mistakes jshint: { options: { jshintrc: '<%= yeoman.client %>/.jshintrc', reporter: require('jshint-stylish') }, server: { options: { jshintrc: 'server/.jshintrc' }, src: [ 'server/{,*/}*.js'] }, all: [ '<%= yeoman.client %>/{app,components}/**/*.js', '!<%= yeoman.client %>/{app,components}/**/*.spec.js', '!<%= yeoman.client %>/{app,components}/**/*.mock.js' ], test: { src: [ '<%= yeoman.client %>/{app,components}/**/*.spec.js', '<%= yeoman.client %>/{app,components}/**/*.mock.js' ] } }, // Empties folders to start fresh clean: { dist: { files: [{ dot: true, src: [ '.tmp', '<%= yeoman.dist %>/*', '!<%= yeoman.dist %>/.git*', '!<%= yeoman.dist %>/.openshift', '!<%= yeoman.dist %>/Procfile' ] }] }, server: '.tmp' }, // Add vendor prefixed styles autoprefixer: { options: { browsers: ['last 1 version'] }, dist: { files: [{ expand: true, cwd: '.tmp/', src: '{,*/}*.css', dest: '.tmp/' }] } }, // Debugging with node inspector 'node-inspector': { custom: { options: { 'web-host': 'localhost' } } }, // Use nodemon to run server in debug mode with an initial breakpoint nodemon: { debug: { script: 'server/app.js', options: { nodeArgs: ['--debug-brk'], env: { PORT: process.env.PORT || 9000 }, callback: function (nodemon) { nodemon.on('log', function (event) { console.log(event.colour); }); // opens browser on initial server start nodemon.on('config:update', function () { setTimeout(function () { require('open')('http://localhost:8080/debug?port=5858'); }, 500); }); } } } }, // Automatically inject Bower components into the app bowerInstall: { target: { src: '<%= yeoman.client %>/index.html', ignorePath: '<%= yeoman.client %>/', exclude: [/bootstrap-sass-official/, /bootstrap.js/, '/json3/', '/es5-shim/'] } }, // Renames files for browser caching purposes rev: { dist: { files: { src: [ '<%= yeoman.dist %>/public/{,*/}*.js', '<%= yeoman.dist %>/public/{,*/}*.css', '<%= yeoman.dist %>/public/assets/fonts/*' ] } } }, // Reads HTML for usemin blocks to enable smart builds that automatically // concat, minify and revision files. Creates configurations in memory so // additional tasks can operate on them useminPrepare: { html: ['<%= yeoman.client %>/index.html'], options: { dest: '<%= yeoman.dist %>/public' } }, // Performs rewrites based on rev and the useminPrepare configuration usemin: { html: ['<%= yeoman.dist %>/public/{,*/}*.html'], css: ['<%= yeoman.dist %>/public/{,*/}*.css'], js: ['<%= yeoman.dist %>/public/{,*/}*.js'], options: { assetsDirs: [ '<%= yeoman.dist %>/public', '<%= yeoman.dist %>/public/assets/images' ], // This is so we update image references in our ng-templates patterns: { js: [ [/(assets\/images\/.*?\.(?:gif|jpeg|jpg|png|webp|svg))/gm, 'Update the JS to reference our revved images'] ] } } }, // The following *-min tasks produce minified files in the dist folder imagemin: { dist: { files: [{ expand: true, cwd: '<%= yeoman.client %>/assets/images', src: '{,*/}*.{png,jpg,jpeg,gif}', dest: '<%= yeoman.dist %>/public/assets/images' }] } }, svgmin: { dist: { files: [{ expand: true, cwd: '<%= yeoman.client %>/assets/images', src: '{,*/}*.svg', dest: '<%= yeoman.dist %>/public/assets/images' }] } }, // Allow the use of non-minsafe AngularJS files. Automatically makes it // minsafe compatible so Uglify does not destroy the ng references ngmin: { dist: { files: [{ expand: true, cwd: '.tmp/concat', src: '*/**.js', dest: '.tmp/concat' }] } }, // Package all the html partials into a single javascript payload ngtemplates: { options: { // This should be the name of your apps angular module module: 'blogApp', htmlmin: { collapseBooleanAttributes: true, collapseWhitespace: true, removeAttributeQuotes: true, removeEmptyAttributes: true, removeRedundantAttributes: true, removeScriptTypeAttributes: true, removeStyleLinkTypeAttributes: true }, usemin: 'app/app.js' }, main: { cwd: '<%= yeoman.client %>', src: ['{app,components}/**/*.html'], dest: '.tmp/templates.js' }, tmp: { cwd: '.tmp', src: ['{app,components}/**/*.html'], dest: '.tmp/tmp-templates.js' } }, // Replace Google CDN references cdnify: { dist: { html: ['<%= yeoman.dist %>/*.html'] } }, // Copies remaining files to places other tasks can use copy: { dist: { files: [{ expand: true, dot: true, cwd: '<%= yeoman.client %>', dest: '<%= yeoman.dist %>/public', src: [ '*.{ico,png,txt}', '.htaccess', 'bower_components/**/*', 'assets/images/{,*/}*.{webp}', 'assets/fonts/**/*', 'index.html', 'assets/videos/{,*/}*.mp4' ] }, { expand: true, cwd: '.tmp/images', dest: '<%= yeoman.dist %>/public/assets/images', src: ['generated/*'] }, { expand: true, dest: '<%= yeoman.dist %>', src: [ 'package.json', 'server/**/*' ] }] }, styles: { expand: true, cwd: '<%= yeoman.client %>', dest: '.tmp/', src: ['{app,components}/**/*.css'] } }, // Run some tasks in parallel to speed up the build process concurrent: { server: [ ], test: [ ], debug: { tasks: [ 'nodemon', 'node-inspector' ], options: { logConcurrentOutput: true } }, dist: [ 'imagemin', 'svgmin' ] }, // Test settings karma: { unit: { configFile: 'karma.conf.js', singleRun: true } }, mochaTest: { options: { reporter: 'spec' }, src: ['server/**/*.spec.js'] }, protractor: { options: { configFile: 'protractor.conf.js' }, chrome: { options: { args: { browser: 'chrome' } } } }, env: { test: { NODE_ENV: 'test' }, prod: { NODE_ENV: 'production' }, all: require('./server/config/local.env') }, injector: { options: { }, // Inject application script files into index.html (doesn't include bower) scripts: { options: { transform: function(filePath) { filePath = filePath.replace('/client/', ''); filePath = filePath.replace('/.tmp/', ''); return '<script src="' + filePath + '"></script>'; }, starttag: '<!-- injector:js -->', endtag: '<!-- endinjector -->' }, files: { '<%= yeoman.client %>/index.html': [ ['{.tmp,<%= yeoman.client %>}/{app,components}/**/*.js', '!{.tmp,<%= yeoman.client %>}/app/app.js', '!{.tmp,<%= yeoman.client %>}/{app,components}/**/*.spec.js', '!{.tmp,<%= yeoman.client %>}/{app,components}/**/*.mock.js'] ] } }, // Inject component css into index.html css: { options: { transform: function(filePath) { filePath = filePath.replace('/client/', ''); filePath = filePath.replace('/.tmp/', ''); return '<link rel="stylesheet" href="' + filePath + '">'; }, starttag: '<!-- injector:css -->', endtag: '<!-- endinjector -->' }, files: { '<%= yeoman.client %>/index.html': [ '<%= yeoman.client %>/{app,components}/**/*.css' ] } } } }); // Used for delaying livereload until after server has restarted grunt.registerTask('wait', function () { grunt.log.ok('Waiting for server reload...'); var done = this.async(); setTimeout(function () { grunt.log.writeln('Done waiting!'); done(); }, 500); }); grunt.registerTask('express-keepalive', 'Keep grunt running', function() { this.async(); }); grunt.registerTask('serve', function (target) { if (target === 'dist') { return grunt.task.run(['build', 'env:all', 'env:prod', 'express:prod', 'open', 'express-keepalive']); } if (target === 'debug') { return grunt.task.run([ 'clean:server', 'env:all', 'concurrent:server', 'injector', 'bowerInstall', 'autoprefixer', 'concurrent:debug' ]); } grunt.task.run([ 'clean:server', 'env:all', 'concurrent:server', 'injector', 'bowerInstall', 'autoprefixer', 'express:dev', 'wait', 'open', 'watch' ]); }); grunt.registerTask('server', function () { grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.'); grunt.task.run(['serve']); }); grunt.registerTask('test', function(target) { if (target === 'server') { return grunt.task.run([ 'env:all', 'env:test', 'mochaTest' ]); } else if (target === 'client') { return grunt.task.run([ 'clean:server', 'env:all', 'concurrent:test', 'injector', 'autoprefixer', 'karma' ]); } else if (target === 'e2e') { return grunt.task.run([ 'clean:server', 'env:all', 'env:test', 'concurrent:test', 'injector', 'bowerInstall', 'autoprefixer', 'express:dev', 'protractor' ]); } else grunt.task.run([ 'test:server', 'test:client' ]); }); grunt.registerTask('build', [ 'clean:dist', 'concurrent:dist', 'injector', 'bowerInstall', 'useminPrepare', 'autoprefixer', 'ngtemplates', 'concat', 'ngmin', 'copy:dist', 'cdnify', 'cssmin', 'uglify', 'rev', 'usemin' ]); grunt.registerTask('default', [ 'newer:jshint', 'test', 'build' ]); };
const initialState = { user: null, showLoginForm: false, loginError: '' }; const login = (state = initialState, action) => { switch (action.type) { case 'SHOW_LOGIN_FORM': return {...state, showLoginForm: true}; case 'CLOSE_LOGIN_FORM': return {...state, showLoginForm: false, loginError: ''}; case 'LOGIN_SUCCESS': return {...state, user: action.user, showLoginForm: false, loginError: ''}; case 'LOGIN_FAIL': return {...state, loginError: 'Login attempt failed.'}; case 'LOGOUT': return {...state, user: null}; default: return state; } }; export default login;
import React, { Component } from 'react'; import { Text, View, TouchableOpacity, } from 'react-native'; import SearchBar from 'react-native-searchbar'; export default class SearchContainer extends Component { constructor(props) { super(props); this.state = { items, results: [] }; this._handleResults = this._handleResults.bind(this); } _handleResults(results) { this.setState({ results }); } render() { return ( <View> <View style={{ marginTop: 110 }}> { this.state.results.map((result, i) => { return ( <Text key={i}> {typeof result === 'object' && !(result instanceof Array) ? 'gold object!' : result.toString()} </Text> ); }) } <TouchableOpacity onPress={() => this.searchBar.show()}> <View style={{ backgroundColor: 'green', height: 100, marginTop: 50 }}/> </TouchableOpacity> <TouchableOpacity onPress={() => this.searchBar.hide()}> <View style={{ backgroundColor: 'red', height: 100 }}/> </TouchableOpacity> </View> <SearchBar ref={(ref) => this.searchBar = ref} data={items} handleResults={this._handleResults} showOnLoad /> </View> ); } }
'use strict'; var app = angular.module('notifications', []); angular.module('notifications').filter('displayFilter', function() { return function(dateString) { if(dateString === null){ dateString = '(no due date)'; return dateString; } else{ return moment(dateString).calendar(); } }; }); angular.module('notifications').controller('NotificationsController', ['$scope', 'Notifications', function($scope, Notifications) { $scope.widget = { title: 'My Notifications' }; $scope.getAllNotifications = function (){ Notifications.getAllNotifications().then( function(event){ $scope.notificationbox = event; }); }; $scope.dismissNotification = function (NotificationId){ Notifications.dismissNotification(NotificationId).then( function(event){ console.log('entered'); }); $scope.getAllNotifications(); }; $scope.getAllNotifications(); // $scope.updateNotification = function (){ // Notifications.updateNotification().then( // function(event){ // console.log('entered'); // }); // }; }]); app.directive('ngConfirmClick', [ function(){ return { link: function (scope, element, attr) { var msg = attr.ngConfirmClick || 'Are you sure?'; var clickAction = attr.confirmedClick; element.bind('click',function (event) { if ( window.confirm(msg) ) { scope.$eval(clickAction); } }); } }; }]); // var d = new Date(); // var day = d.getDate() < 10 ? '0' + (d.getDate()+1) : (d.getDate()+1) ; // var month = d.getMonth() < 9 ? '0' + (d.getMonth() + 1) : d.getMonth() + 1; // var year = d.getFullYear(); // $scope.dateToday = date.parse(year + '-' + month + '-' + day);
$(document).ready(function() { $('#submit_profile_post').click(function(){ $.ajax({ type: "POST", url: "includes/handlers/ajax_submit_profile_post.php", data: $('form.profile_post').serialize(), success: function(msg){ $('#post_form').modal('hide'); location.reload(); }, error: function(){ alert('Failure'); } }); }); });
import { h, Component } from 'preact'; import osmAuth from 'osm-auth'; import OsmEditHelper from 'helper/osmEdit'; export default class TagForm extends Component { constructor(props) { super(props); const state = {}; Object.keys(props.diffObject.tags).forEach( key => (state[key] = props.diffObject.tags[key].modified) ); this.state = state; this._osmEdit = new OsmEditHelper( osmAuth({ url: this.props.oauthEndPoint, oauth_consumer_key: this.props.oauthConsumerKey, oauth_secret: this.props.oauthSecret, oauth_token: this.props.user.get('token'), oauth_token_secret: this.props.user.get('tokenSecret') }) ); this._osmEdit.setType(this.props.feature.properties.type); this._osmEdit.setId(this.props.feature.properties.id); } render() { const { l10n, layer, osmId, diffObject, feature } = this.props; const layerName = layer.get('name'); const Empty = <em>{l10n.getSync('empty')}</em>; return ( <form> <div class="container-fluid content sticky"> <div class="row sticky-header"> <div class="col-xs-12"> <button type="button" class="btn btn-primary btn-block zoom_btn"> {l10n.getSync('overPassCacheModifications_zoomOnElement')} </button> </div> </div> <div class="row sticky-inner"> <div class="col-xs-12"> <h4>{l10n.getSync('layer')}</h4> <p class="append-xs-2">{layerName}</p> <h4>{l10n.getSync('osmId')}</h4> <p> <a target="_blank" rel="noopener noreferrer" href={`https://www.openstreetmap.org/${osmId}`} > {osmId} </a>{' '} ( <a target="_blank" rel="noopener noreferrer" href={`http://osmlab.github.io/osm-deep-history/#/${osmId}`} > OSM Deep History </a> ) </p> <p class="append-xs-2"> {l10n.getSync('version').ucfirst()}{' '} {feature.properties.meta.version} {l10n.getSync('by')}{' '} {feature.properties.meta.user} </p> <h4>{l10n.getSync('overPassCacheModifications_dates')}</h4> <p> {l10n.getSync('overPassCacheModifications_cacheDate')}:{' '} {diffObject.timestamp.cached} </p> <p class="append-xs-2"> {l10n.getSync('overPassCacheModifications_modificationDate')}:{' '} {diffObject.timestamp.modified} </p> <h4>{l10n.getSync('tags')}</h4> {Object.keys(diffObject.tags).map(key => { const { cached, modified } = diffObject.tags[key]; if (cached === modified) { return ( <div class="append-xs-2"> <h5>{key}</h5> <p>{cached}</p> </div> ); } const cachedRadioId = `${key}_cached`; const modifiedRadioId = `${key}_modified`; return ( <div class="append-xs-2"> <h5>{key}</h5> <div class="radio"> <input type="radio" id={cachedRadioId} name={key} value="cached" onChange={() => this.onChangeRadio(key, cached)} checked={this.state[key] === cached} /> <label for={cachedRadioId}>{cached || Empty}</label> </div> <div class="radio"> <input type="radio" id={modifiedRadioId} name={key} value="modified" onChange={() => this.onChangeRadio(key, modified)} checked={this.state[key] === modified} /> <label for={modifiedRadioId}>{modified || Empty}</label> </div> </div> ); })} </div> </div> <div class="row sticky-footer"> <div class="col-xs-12"> <button type="button" class="btn btn-block btn-primary" onClick={this.onClickValidate} > {l10n.getSync('validateAndCache')} </button> <button type="button" class="btn btn-block btn-default" onClick={this.onClickRefuse} > {l10n.getSync('refuseAndArchive')} </button> <button type="button" class="btn btn-block btn-default" onClick={() => this.onClickSend(this.state)} > {l10n.getSync('sendNewVersionToOsm')} </button> </div> </div> </div> </form> ); } onChangeRadio(key, value) { this.setState({ [key]: value }); } onClickValidate = () => { this.props.layer.mergeModifiedFeature( this.props.fragment, this.props.feature, true ); this.props.close(); }; onClickRefuse = () => { this.props.layer.archiveFeatureFromModifiedCache( this.props.fragment, this.props.feature ); this.props.close(); }; onClickSend = tags => { const cleanedTags = {}; Object.keys(tags).forEach(key => { if (typeof tags[key] !== 'undefined') { cleanedTags[key] = tags[key]; } }); this._osmEdit.setChangesetCreatedBy(this.props.createdBy); this._osmEdit.setChangesetComment(this.props.changesetComment); this._osmEdit.setTimestamp(); this._osmEdit.setTags(cleanedTags); this._osmEdit.setUid(this.props.user.get('osmId')); this._osmEdit.setDisplayName(this.props.user.get('displayName')); this._osmEdit.send().then(() => { this.props.layer.mergeModifiedFeature( this.props.fragment, this.props.feature, true ); }); this.props.close(); }; }
( function() { 'use strict'; app.controller('SupCategoriasIncidentesCtrl', SupCategoriasIncidentesCtrl); /** @ngInject */ function SupCategoriasIncidentesCtrl($scope, $rootScope, SuporteCategoriasService) { var TIPO_INCIDENTES = 32; var mes = moment($rootScope.mes); $scope.chartOptions = { value: "quantidade", label: "categoria" }; chamadosPorCategoria(); function chamadosPorCategoria() { var dataInicial = mes.startOf('month').format('DD/MM/YYYY'); var dataFinal = mes.add(1, 'month').startOf('month').format('DD/MM/YYYY'); SuporteCategoriasService.getChamadosPorCategoria(dataInicial, dataFinal, TIPO_INCIDENTES).then( function (response) { $scope.dadosChamadosPorCategoria = response.data; } ); } } })();
const fs = require('fs') , Log = require('log') , logFile = new Log('file', fs.createWriteStream('log/production.log')) , logPrint = new Log('print'); function info(string) { logPrint.info(string); logFile.info(string); } function debug(string) { logPrint.debug(string); logFile.debug(string); } function logErr(string) { logPrint.error(string); logFile.error(string); } function error(err) { if (typeof err === 'object') { if (err.message) { logErr('\nMessage: ' + err.message); } if (err.stack) { logErr('\nStacktrace:'); logErr('===================='); logErr(err.stack); } } else { logErr('dumpError :: argument is not an object'); } } module.exports = { debug: debug, info: info, error: error };
// The Vue build version to load with the `import` command // (runtime-only or standalone) has been set in webpack.base.conf with an alias. import Vue from 'vue' import App from './App' import router from './router' import store from './store' import ElementUI from 'element-ui' import axios from 'axios' import 'element-ui/lib/theme-default/index.css' // init Vue.prototype.$http = axios Vue.use(ElementUI) Vue.config.productionTip = false /* eslint-disable no-new */ new Vue({ el: '#app', router, store, template: '<App/>', components: { App } })
'use strict'; const assert = require('assert'); const poll = require('io/poll'); var res = poll.poll([], 0); assert.equal(res.nevents, 0); assert.equal(res.fds.length, 0);
// Copyright (c) 2014, 2015 Adobe Systems Incorporated. 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. /* Help write the SVG */ (function () { "use strict"; var Utils = require("./utils.js"), Matrix = require("./matrix.js"), inch = 1 / 72, mm = inch * 25.4, cm = inch * 2.54, pica = inch * 6; function SVGWriterUtils() { var self = this; self.shiftBoundsX = function (bounds, delta) { bounds.left += delta; bounds.right += delta; }; self.shiftBoundsY = function (bounds, delta) { bounds.top += delta; bounds.bottom += delta; }; self.rectToBounds = function (rect) { if (rect.left) { return rect; } return { left: rect.x, top: rect.y, right: rect.x + rect.width, bottom: rect.y + rect.height }; }; self.write = function (ctx, sOut) { if (!ctx.stream) { ctx.sOut += sOut; return; } ctx.stream.write(sOut); }; self.writeln = function (ctx, sOut) { sOut = sOut == null ? "" : sOut; self.write(ctx, sOut + ctx.terminator); }; self.indent = function (ctx) { ctx.currentIndent += ctx.indent; }; self.undent = function (ctx) { ctx.currentIndent = ctx.currentIndent.substr(0, ctx.currentIndent.length - ctx.indent.length); }; self.componentToHex = function (c) { var rnd = Math.round(c), hex = rnd.toString(16); return hex.length == 1 ? "0" + hex : hex; }; self.rgbToHex = function (r, g, b) { return "#" + self.componentToHex(r) + self.componentToHex(g) + self.componentToHex(b); }; var colorNames = { "#fa8072": "salmon", "#ff0000": "red", "#ffc0cb": "pink", "#ff7f50": "coral", "#ff6347": "tomato", "#ffa500": "orange", "#ffd700": "gold", "#f0e68c": "khaki", "#dda0dd": "plum", "#ee82ee": "violet", "#da70d6": "orchid", "#800080": "purple", "#4b0082": "indigo", "#00ff00": "lime", "#008000": "green", "#808000": "olive", "#008080": "teal", "#00ffff": "aqua", "#0000ff": "blue", "#000080": "navy", "#ffe4c4": "bisque", "#f5deb3": "wheat", "#d2b48c": "tan", "#cd853f": "peru", "#a0522d": "sienna", "#a52a2a": "brown", "#800000": "maroon", "#fffafa": "snow", "#f0ffff": "azure", "#f5f5dc": "beige", "#fffff0": "ivory", "#faf0e6": "linen", "#c0c0c0": "silver", "#808080": "gray" }; self.writeColor = function (val, ctx) { var color; val = val || "transparent"; if (typeof val == "string") { color = val; } if (typeof val == "object") { if (val.ref && ctx && ctx.svgOM.resources && ctx.svgOM.resources.colors && ctx.svgOM.resources.colors[val.ref]) { val = ctx.svgOM.resources.colors[val.ref]; } if (!ctx) { ctx = { eq: function (v1, v2) { return v1 == v2; } }; } var rgb = val.value ? val.value : val; if (isFinite(val.alpha) && !ctx.eq(val.alpha, 1)) { return "rgba(" + Utils.roundUp(rgb.r) + "," + Utils.roundUp(rgb.g) + "," + Utils.roundUp(rgb.b) + "," + Utils.round2(val.alpha) + ")"; } else if (isFinite(val.a) && !ctx.eq(val.a, 1)) { return "rgba(" + Utils.roundUp(rgb.r) + "," + Utils.roundUp(rgb.g) + "," + Utils.roundUp(rgb.b) + "," + Utils.round2(val.a) + ")"; } else { color = self.rgbToHex(rgb.r, rgb.g, rgb.b); } } if (colorNames[color.toLowerCase()]) { color = colorNames[color.toLowerCase()]; } else { color = color.replace(/^#(.)\1(.)\2(.)\3$/, "#$1$2$3"); } return color; }; self.escapeCSS = function (className) { className += ""; className = className.replace(/\s+/g, "-"); var len = className.length, i = 0, isDash = className.charAt() == "-", out = ""; for (; i < len; i++) { var code = className.charCodeAt(i), char = className.charAt(i), isNum = char == +char; if (code >= 1 && code <= 31 || code == 127 || !i && isNum || i == 1 && isDash && isNum) { out += "\\" + code.toString(16) + " "; } else { if (code > 127 || char == "-" || char == "_" || isNum || /[a-z]/i.test(char)) { out += char; } else { out += "\\" + char; } } } return self.encodedText(out); }; self.getTransform = function (val, tX, tY, precision, keepTranslation) { if (!val) { // So far paths, masks and clipPaths are the only consumers of getTransform with keepTranslation. // Elsewhere we are able to bake in tX and tY otherwise. if (keepTranslation && (tX || tY)) { return !tY ? "translate(" + Utils.roundP(tX, precision) + ")" : "translate(" + Utils.roundP(tX || 0, precision) + " " + Utils.roundP(tY || 0, precision) + ")"; } return ""; } return Matrix.writeTransform( val, isFinite(tX) ? tX : 0, isFinite(tY) ? tY : 0, precision); }; self.round2 = Utils.round2; self.round1k = Utils.round1k; self.round10k = Utils.round10k; self.roundUp = Utils.roundUp; self.roundDown = Utils.roundDown; self.toDocumentUnits = function (ctx, length) { if (!ctx.config || !ctx.config.documentUnits) { return length; } switch (ctx.config.documentUnits) { case "mm": length *= mm; break; case "cm": length *= cm; break; case "in": length *= inch; break; case "pc": length *= pica; break; default: return length; } return length + ctx.config.documentUnits; }; self.toString = function (ctx) { return ctx.sOut; }; self.encodedText = function (txt) { return txt.replace(/&/g, "&amp;") .replace(/</g, "&lt;") .replace(/>/g, "&gt;") .replace(/"/g, "&quot;") .replace(/'/g, "&apos;") // XML char: #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] .replace(/[^\u0009\u000A\u000D\u0020-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]/g, ""); }; self.extend = Utils.extend; self.hasFx = function (ctx) { return ctx.currentOMNode.style && ctx.currentOMNode.style.filters; }; } module.exports = new SVGWriterUtils(); }());
import hypothenuse from './util/hypothenuse'; // [0, 2*PI] -> [-PI/2, PI/2] const signedAngle = angle => angle > Math.PI ? 1.5 * Math.PI - angle : 0.5 * Math.PI - angle; /** * angles are stored in radians from in [0, 2*PI], where 0 in 12 o'clock. * However, one can only select lines from 0 to PI, so we compute the * 'signed' angle, where 0 is the horizontal line (3 o'clock), and +/- PI/2 * are 12 and 6 o'clock respectively. */ const containmentTest = arc => a => { let startAngle = signedAngle(arc.startAngle); let endAngle = signedAngle(arc.endAngle); if (startAngle > endAngle) { const tmp = startAngle; startAngle = endAngle; endAngle = tmp; } // test if segment angle is contained in angle interval return a >= startAngle && a <= endAngle; }; const crossesStrum = (state, config) => (d, id) => { const arc = state.arcs[id], test = containmentTest(arc), d1 = arc.dims.left, d2 = arc.dims.right, y1 = config.dimensions[d1].yscale, y2 = config.dimensions[d2].yscale, a = state.arcs.width(id), b = y1(d[d1]) - y2(d[d2]), c = hypothenuse(a, b), angle = Math.asin(b / c); // rad in [-PI/2, PI/2] return test(angle); }; const selected = (brushGroup, state, config) => { const ids = Object.getOwnPropertyNames(state.arcs).filter(d => !isNaN(d)); const brushed = config.data; if (ids.length === 0) { return brushed; } const crossTest = crossesStrum(state, config); return brushed.filter(d => { switch (brushGroup.predicate) { case 'AND': return ids.every(id => crossTest(d, id)); case 'OR': return ids.some(id => crossTest(d, id)); default: throw new Error('Unknown brush predicate ' + config.brushPredicate); } }); }; export default selected;
/** * Main JS file for Casper behaviours */ /*globals jQuery, document */ (function ($) { "use strict"; $(document).ready(function(){ $('.ui.post.fadedown') .transition({ animation : 'fade down', duration : '1s' }) ; $('.ui.post.fadeup') .transition({ animation : 'fade down', duration : '1s' }) ; // On the home page, move the blog icon inside the header // for better relative/absolute positioning. //$("#blog-logo").prependTo("#site-head-content"); }); }(jQuery));
version https://git-lfs.github.com/spec/v1 oid sha256:e9a114f09610412c8fac54fda708b90c6d17ea5bd01ab7dad7947f02a1806c8b size 24073
import Entity from 'entity'; import Seller from 'seller'; import InvoiceRow from 'invoiceRow'; export default class Invoice { constructor(number, dateOfIssue, dateTaxEvent, sellerIdNumber, buyer, invoiceRows, transactionLocation, //payment, //explanation, issuer, recipient ) { this._number = number; this._dateOfIssue = dateOfIssue; this._dateTaxEvent = dateTaxEvent; this._sellerIdNumber = sellerIdNumber; this._buyer = buyer; if (invoiceRows) { this._invoiceRows = invoiceRows; } else { this._invoiceRows = []; } this._transactionLocation = transactionLocation; // this._payment = payment; // this._explanation = explanation; // this._totalVAT = this.invoiceRows.reduce((x, y) => x.rowVAT + y.rowVAT, 0); // this._totalNoVAT = this.invoiceRows.reduce((x, y) => x.rowPriceNoVAT + y.rowPriceNoVAT); // this._totalWithVAT = this.totalVAT + this.totalNoVAT; // this._totalInWords = numberToWords(this.totalWithVAT); this._issuer = issuer; this._recipient = recipient; } get number() { return this._number; } get dateOfIssue() { return this._dateOfIssue; } get dateTaxEvent() { return this._dateTaxEvent; } get sellerIdNumber() { return this._sellerIdNumber; } get buyer() { return this._buyer; } get invoiceRows() { return this._invoiceRows; } get transactionLocation() { return this._transactionLocation; } // get payment() { // return this._payment; // } // get explanation() { // return this._explanation; // } // get totalVAT() { // return this._totalVAT; // } // get totalNoVAT() { // return this._totalNoVAT; // } // get totalWithVAT() { // return this._totalWithVAT; // } // get totalInWords() { // return this._totalInWords; // } get issuer() { return this._issuer; } get recipient() { return this._recipient; } }
/* * This file is part of the Spludo Framework. * Copyright (c) 2009-2010 DracoBlue, http://dracoblue.net/ * * Licensed under the terms of MIT License. For the full copyright and license * information, please see the LICENSE file in the root folder. */ /** * @class A toolkit for convenient functions to work on the context. */ ContextToolkit = { /** * Set a cookie. * * @param {Context} * context Specifies the context to set this cookie for. * @param {String} * key Set the key for the cookie. Must be a string. * @param {String|Object|Array|Number} * value Set value of the cookie. May even be an Object. Will be * encoded to JSON. * @param {Number} * [life_time=null] Set the amount of seconds this cookie is * meant to be alive. Can be 0 to indicate that this is set for * the lifetime of the browser session only. * @param {String} * [path=null] Set the path for the cookie. */ setCookie: function(context, key, value, life_time, path) { context.cookies = context.cookies || {}; context.cookies_path = context.cookies_path || {}; context.cookies_life_time = context.cookies_life_time || {}; context.cookies[key] = value; /* * If this is a clean cookie, we have to remove it from clean cookies, * so we don't forget to send it! */ if (context.clean_cookies && context.clean_cookies[key]) { delete context.clean_cookies[key]; } if (typeof life_time !== "undefined") { if (life_time !== null) { if (life_time === 0) { /* * This is not a browser session cookie */ context.cookies_life_time[key] = "0"; } else { if (life_time < 0) { /* * That cookie expired already! */ context.cookies_life_time[key] = "Tue, 23-May-1985 17:05:20 GMT"; } else { /* * That cookie expired already! */ var life_time_date = new Date(); /* * Now let's calculate the difference to the current * date. */ life_time_date.setTime(life_time_date.getTime() + life_time); /* * This is not 100% "%a, %d-%b-%Y %T GMT" because it has * GMT-600 for instance, but it seems to work. */ context.cookies_life_time[key] = life_time_date.toString(); } } } if (typeof path !== "undefined") { context.cookies_path[key] = path; } } }, /** * Remove a cookie. This is achieved by setting the lifetime to -1. * * @param {Context} * context Specifies the context to remove this cookie from. * @param {String} * key Set the key for the cookie. Must be a string. * @param {String} * [path=null] Set the path for the cookie. */ removeCookie: function(context, key, path) { this.setCookie(context, key, "", -1, path); }, /** * Apply the request-headers to a context. This will for instance set the * Context#clean_cookies and Context#cookies property. * * @param {Context} * context The context for the operation. * @param {Object} * headers The request headers (usually taken from * http.ServerRequest.headers) */ applyRequestHeaders: function(context, headers) { context.request_headers = headers; /* * If we have no request cookie, we don't need this stuff. */ if (typeof headers["cookie"] === "undefined") { return; } context.clean_cookies = context.clean_cookies || {}; context.cookies = context.cookies || {}; var raw = headers["cookie"].split("; "); var cookie_key = null; var cookie_value = null; for (var i in raw) { /* * Transform (raw_line): test1=%7B%22key%22%3A%22value%22%7D To * (cookie_key: cookie_value): "test1": { "key": "value" } */ var raw_line = raw[i].split("="); try { cookie_key = decodeURIComponent(raw_line[0]); cookie_value = raw_line[1] || ""; cookie_value = decodeURIComponent(raw_line.splice(1).join("=")); context.clean_cookies[cookie_key] = JSON.parse(cookie_value, true); context.cookies[cookie_key] = context.clean_cookies[cookie_key]; } catch (e) { /* * If there is an exception with an item -> ignore. */ } } }, /** * Apply the cookies, which are currently available on the context, to the * correct headers. This is usually triggered by the application, which * delivers the response for the context. * * @param {Context} * context The context for the operation. */ applyCookiesToHeaders: function(context) { if (!context || !context.cookies) { /* * Ok, we have nothing in the cookies, let's remove the * headers['Set-Cookie'] (if it exists) */ if (context && context.headers) { delete context.headers["Set-Cookie"]; } return; } context = context || {}; context.headers = context.headers || {}; context.headers["Set-Cookie"] = []; var cookies = context.cookies; var set_cookie_headers = []; for (var key in cookies) { /* * We did not received that cookie as request cookie, or at least * changed it afterwards. */ if (!context.clean_cookies || typeof context.clean_cookies[key] === "undefined") { var set_cookie_string = encodeURIComponent(key) + "="; set_cookie_string = set_cookie_string + encodeURIComponent(JSON.stringify(cookies[key])); if (typeof context.cookies_life_time[key] !== "undefined") { set_cookie_string = set_cookie_string + "; expires=" + context.cookies_life_time[key]; } if (typeof context.cookies_path[key] !== "undefined") { set_cookie_string = set_cookie_string + "; path=" + context.cookies_path[key]; } set_cookie_headers.push(set_cookie_string); } } /* * Even though http://tools.ietf.org/html/rfc2109#page-4 says that it's * possible to seperate SetCookie with ',' it does not work. So we are * doing this evil evil hack. * * Yes I am serious. This: .join("\nSet-Cookie: ") is just for that * hack! :( */ context.headers["Set-Cookie"] = set_cookie_headers.join("\nSet-Cookie: "); }, /** * Redirect to a different url. * * @param {Context} * context The context for the operation. * @param {String} * path The path where to redirect to. */ applyRedirect: function(context, path) { context.status = 302; context.headers["Location"] = path; } };
angular.module('auth', []).factory( 'auth', function($rootScope, $http, $location) { enter = function() { if ($location.path() != auth.loginPath) { auth.path = $location.path(); if (!auth.authenticated) { $location.path(auth.loginPath); } } } var auth = { authenticated : false, loginPath : '/login', logoutPath : '/logout', homePath : '/', path : $location.path(), authenticate : function(credentials, callback) { var headers = credentials && credentials.username ? { authorization : "Basic " + btoa(credentials.username + ":" + credentials.password) } : {}; $http.get('user', { headers : headers }).success(function(data) { if (data.name) { auth.authenticated = true; } else { auth.authenticated = false; } callback && callback(auth.authenticated); $location.path(auth.path==auth.loginPath ? auth.homePath : auth.path); }).error(function() { auth.authenticated = false; callback && callback(false); }); }, clear : function() { $location.path(auth.loginPath); auth.authenticated = false; $http.post(auth.logoutPath, {}).success(function() { console.log("Logout succeeded"); }).error(function(data) { console.log("Logout failed"); }); }, init : function(homePath, loginPath, logoutPath) { auth.homePath = homePath; auth.loginPath = loginPath; auth.logoutPath = logoutPath; auth.authenticate({}, function(authenticated) { if (authenticated) { $location.path(auth.path); } }) // Guard route changes and switch to login page if unauthenticated $rootScope.$on('$routeChangeStart', function() { enter(); }); } }; return auth; });
'use strict'; exports.up = (db) => { return db.addColumn('tip', 'isApproved', { type: 'boolean', notNull: true, defaultValue: false }) .then(() => db.runSql('UPDATE tip SET "isApproved" = true')); }; exports.down = (db) => { return db.removeColumn('tip', 'isApproved'); };
const i_common = require('./common'); const common_left_bracket = ['(', '{', '[']; const common_right_bracket = [')', '}', ']']; const common_left_right_bracket_map = { '(': ')', '{': '}', '[': ']', '<': '>' }; /* env = { tokens, cursor, ...} */ function decorate_skip_current_line(env) { let st = env.cursor; let ed = i_common.search_next(env.tokens, st+1, (x) => x.token !== '\n'); return ed - st + 1; } function decorate_bracket(env) { let stack = []; let i, n, ch, token; for (i = 0, n = env.tokens.length; i < n; i++) { token = env.tokens[i]; ch = token.token; if (common_left_bracket.indexOf(ch) >= 0) { stack.push({i: i, ch: common_left_right_bracket_map[ch]}); token.startIndex = i; token.tag = i_common.TAG_BRACKET[ch]; } else if (common_right_bracket.indexOf(ch) >= 0) { let pair = stack.pop(); if (pair.ch !== ch) { /* bracket not match; should not be here */ } env.tokens[pair.i].endIndex = i+1; } } return env.tokens.length; } function decorate_keywords(env, keywords) { env.tokens.forEach((token) => { if (keywords.indexOf(token.token) >= 0) { token.tag = i_common.TAG_KEYWORD; } }); return env.tokens.length; } function decorate_feature(env, features) { if (!features) return 0; let i, n, r; for (i = 0, n = features.length; i < n; i++) { r = features[i](env); if (r > 0) return r; } return 0; } function decorate_scope(env, feature_map, feature_default_fn) { let decorate_others = feature_default_fn; let n, r; n = env.tokens.length; while (env.cursor < n) { let name = env.tokens[env.cursor].token; let features = feature_map[name]; if (Array.isArray(features)) { // dict['constructor'] may cause error r = decorate_feature(env, features); } else { r = 0; } if (!r) r = decorate_others && decorate_others(env) || 1; env.cursor += r; } return env.tokens; } module.exports = { decorate_skip_current_line, decorate_bracket, decorate_keywords, decorate_scope };
// Given a linked list, determine if it has a cycle in it. // // Follow up: // Can you solve it without using extra space? /** * Definition for singly-linked list. * function ListNode(val) { * this.val = val; * this.next = null; * } */ /** * @param {ListNode} head * @return {boolean} */ var hasCycle = function(head) { if (!head) { return false; } if (!head.next) { return false; } let nodeA = head.next; let nodeB = head.next.next; while (nodeB) { if (nodeA === nodeB) { return true; } nodeA = nodeA.next; if (nodeB.next && nodeB.next.next) { nodeB = nodeB.next.next; } else { nodeB = null; } } return false; };
import * as Q from 'q' import { BaseModelRDMS } from './BaseModel.RDMS' // // Main // export class Main extends BaseModelRDMS { /** * Constructor */ constructor() { super('EMPTY') } /** * Run a system healthcheck * * @return {promise} */ doHealthcheck() { let deferred = Q.defer() let response = { ping: 'pong', environment: process.env.NODE_ENV, timestamp: Date.now() } // Check database this.Knex.raw('SELECT 1+1 AS result') .then(() => { // There is a valid connection in the pool response.uptime = process.uptime() + ' seconds' response.database = { healthy: true, dbname: this.Knex.client.connectionSettings.database } deferred.resolve(response) }) .catch(() => { response.database = { healthy: false, dbname: this.Knex.client.connectionSettings.database } deferred.resolve(response) }) return deferred.promise } }
import Ember from 'ember'; const { Controller } = Ember; export default Controller.extend({ tabs: [ { name: 'Pictures', route: 'media.pictures', icon: 'fa fa-image' }, { name: 'Music', route: 'media.music', icon: 'fa fa-music' } ] });
import createSvgIcon from './utils/createSvgIcon'; import { jsx as _jsx } from "react/jsx-runtime"; export default createSvgIcon([/*#__PURE__*/_jsx("path", { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM7.68 14.98H6V9h1.71c1.28 0 1.71 1.03 1.71 1.71v2.56c0 .68-.42 1.71-1.74 1.71zm4.7-3.52v1.07H11.2v1.39h1.93v1.07h-2.25c-.4.01-.74-.31-.75-.71V9.75c-.01-.4.31-.74.71-.75h2.28v1.07H11.2v1.39h1.18zm4.5 2.77c-.48 1.11-1.33.89-1.71 0L13.77 9h1.18l1.07 4.11L17.09 9h1.18l-1.39 5.23z" }, "0"), /*#__PURE__*/_jsx("path", { d: "M7.77 10.12h-.63v3.77h.63c.14 0 .28-.05.42-.16.14-.1.21-.26.21-.47v-2.52c0-.21-.07-.37-.21-.47-.14-.1-.28-.15-.42-.15z" }, "1")], 'LogoDevRounded');
import { Meteor } from 'meteor/meteor'; import { createContainer } from 'meteor/react-meteor-data'; import { ReactiveVar } from 'meteor/reactive-var'; import FilesPage from '../pages/FilesPage'; import filesCollection from '../../api/files/collection'; const selectedUid = new ReactiveVar(null); const FilesContainer = createContainer(({ metadataSchema, }) => { let file; const selectedFileId = selectedUid.get(); if (selectedFileId) { const fileHandle = Meteor.subscribe('files.single', selectedFileId); if (fileHandle.ready()) { file = filesCollection.findOne({ uid: selectedFileId }); } } return { metadataSchema, file, selectedUid, }; }, FilesPage); export default FilesContainer;
/* */ define(['exports', 'i18next', './utils'], function (exports, _i18next, _utils) { 'use strict'; exports.__esModule = true; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } var _i18n = _interopRequireDefault(_i18next); var I18N = (function () { function I18N(ea, loader) { _classCallCheck(this, I18N); this.globalVars = {}; this.i18next = _i18n['default']; this.ea = ea; this.Intl = window.Intl; var i18nName = loader.normalizeSync('aurelia-i18n'); var intlName = loader.normalizeSync('Intl.js', i18nName); if (window.Intl === undefined) { loader.loadModule(intlName).then(function (poly) { window.Intl = poly; }); } } I18N.prototype.setup = function setup(options) { var defaultOptions = { resGetPath: 'locale/__lng__/__ns__.json', lng: 'en', getAsync: false, sendMissing: false, attributes: ['t', 'i18n'], fallbackLng: 'en', debug: false }; _i18n['default'].init(options || defaultOptions); if (_i18n['default'].options.attributes instanceof String) { _i18n['default'].options.attributes = [_i18n['default'].options.attributes]; } }; I18N.prototype.setLocale = function setLocale(locale) { var _this = this; return new Promise(function (resolve) { var oldLocale = _this.getLocale(); _this.i18next.setLng(locale, function (tr) { _this.ea.publish('i18n:locale:changed', { oldValue: oldLocale, newValue: locale }); resolve(tr); }); }); }; I18N.prototype.getLocale = function getLocale() { return this.i18next.lng(); }; I18N.prototype.nf = function nf(options, locales) { return new this.Intl.NumberFormat(locales || this.getLocale(), options || {}); }; I18N.prototype.df = function df(options, locales) { return new this.Intl.DateTimeFormat(locales || this.getLocale(), options); }; I18N.prototype.tr = function tr(key, options) { var fullOptions = this.globalVars; if (options !== undefined) { fullOptions = Object.assign(Object.assign({}, this.globalVars), options); } return this.i18next.t(key, _utils.assignObjectToKeys('', fullOptions)); }; I18N.prototype.registerGlobalVariable = function registerGlobalVariable(key, value) { this.globalVars[key] = value; }; I18N.prototype.unregisterGlobalVariable = function unregisterGlobalVariable(key) { delete this.globalVars[key]; }; I18N.prototype.updateTranslations = function updateTranslations(el) { var i = undefined; var l = undefined; var selector = [].concat(this.i18next.options.attributes); for (i = 0, l = selector.length; i < l; i++) selector[i] = '[' + selector[i] + ']'; selector = selector.join(','); var nodes = el.querySelectorAll(selector); for (i = 0, l = nodes.length; i < l; i++) { var node = nodes[i]; var keys = undefined; for (var i2 = 0, l2 = this.i18next.options.attributes.length; i2 < l2; i2++) { keys = node.getAttribute(this.i18next.options.attributes[i2]); if (keys) break; } if (!keys) continue; this.updateValue(node, keys); } }; I18N.prototype.updateValue = function updateValue(node, value, params) { if (value === null || value === undefined) { return; } var keys = value.split(';'); for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var key = _ref; var re = /\[([a-z]*)\]/g; var m = undefined; var attr = 'text'; if (node.nodeName === 'IMG') attr = 'src'; while ((m = re.exec(key)) !== null) { if (m.index === re.lastIndex) { re.lastIndex++; } if (m) { key = key.replace(m[0], ''); attr = m[1]; } } if (!node._textContent) node._textContent = node.textContent; if (!node._innerHTML) node._innerHTML = node.innerHTML; switch (attr) { case 'text': node.textContent = this.tr(key, params); break; case 'prepend': node.innerHTML = this.tr(key, params) + node._innerHTML.trim(); break; case 'append': node.innerHTML = node._innerHTML.trim() + this.tr(key, params); break; case 'html': node.innerHTML = this.tr(key, params); break; default: node.setAttribute(attr, this.tr(key, params)); break; } } }; return I18N; })(); exports.I18N = I18N; });
/** * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ CKEDITOR.plugins.setLang( 'a11yhelp', 'id', { title: 'Instruksi Accessibility', contents: 'Bantuan. Tekan ESC untuk menutup dialog ini.', legend: [ { name: 'Umum', items: [ { name: 'Toolbar Editor', legend: 'Tekan ${toolbarFocus} untuk berpindah ke toolbar. Untuk berpindah ke group toolbar selanjutnya dan sebelumnya gunakan TAB dan SHIFT+TAB. Untuk berpindah ke tombol toolbar selanjutnya dan sebelumnya gunakan RIGHT ARROW atau LEFT ARROW. Tekan SPASI atau ENTER untuk mengaktifkan tombol toolbar.' }, { name: 'Dialog Editor', legend: 'Pada jendela dialog, tekan TAB untuk berpindah pada elemen dialog selanjutnya, tekan SHIFT+TAB untuk berpindah pada elemen dialog sebelumnya, tekan ENTER untuk submit dialog, tekan ESC untuk membatalkan dialog. Pada dialog dengan multi tab, daftar tab dapat diakses dengan ALT+F10 ataupun dengan tombol TAB sesuai urutan tab pada dialog. Jika daftar tab aktif terpilih, untuk berpindah tab dapat menggunakan RIGHT dan LEFT ARROW.' }, { name: 'Context Menu Editor', legend: 'Press ${contextMenu} or APPLICATION KEY to open context-menu. Then move to next menu option with TAB or DOWN ARROW. Move to previous option with SHIFT+TAB or UP ARROW. Press SPACE or ENTER to select the menu option. Open sub-menu of current option with SPACE or ENTER or RIGHT ARROW. Go back to parent menu item with ESC or LEFT ARROW. Close context menu with ESC.' // MISSING }, { name: 'List Box Editor', legend: 'Inside a list-box, move to next list item with TAB OR DOWN ARROW. Move to previous list item with SHIFT+TAB or UP ARROW. Press SPACE or ENTER to select the list option. Press ESC to close the list-box.' // MISSING }, { name: 'Editor Element Path Bar', // MISSING legend: 'Press ${elementsPathFocus} to navigate to the elements path bar. Move to next element button with TAB or RIGHT ARROW. Move to previous button with SHIFT+TAB or LEFT ARROW. Press SPACE or ENTER to select the element in editor.' // MISSING } ] }, { name: 'Commands', // MISSING items: [ { name: ' Undo command', // MISSING legend: 'Press ${undo}' // MISSING }, { name: ' Redo command', // MISSING legend: 'Press ${redo}' // MISSING }, { name: ' Bold command', // MISSING legend: 'Press ${bold}' // MISSING }, { name: ' Italic command', // MISSING legend: 'Press ${italic}' // MISSING }, { name: ' Underline command', // MISSING legend: 'Press ${underline}' // MISSING }, { name: ' Link command', // MISSING legend: 'Press ${link}' // MISSING }, { name: ' Toolbar Collapse command', // MISSING legend: 'Press ${toolbarCollapse}' // MISSING }, { name: ' Access previous focus space command', // MISSING legend: 'Press ${accessPreviousSpace} to access the closest unreachable focus space before the caret, for example: two adjacent HR elements. Repeat the key combination to reach distant focus spaces.' // MISSING }, { name: ' Access next focus space command', // MISSING legend: 'Press ${accessNextSpace} to access the closest unreachable focus space after the caret, for example: two adjacent HR elements. Repeat the key combination to reach distant focus spaces.' // MISSING }, { name: ' Accessibility Help', // MISSING legend: 'Press ${a11yHelp}' // MISSING }, { name: ' Paste as plain text', // MISSING legend: 'Press ${pastetext}', // MISSING legendEdge: 'Press ${pastetext}, followed by ${paste}' // MISSING } ] } ], tab: 'Tab', // MISSING pause: 'Pause', // MISSING capslock: 'Caps Lock', // MISSING escape: 'Escape', // MISSING pageUp: 'Page Up', // MISSING pageDown: 'Page Down', // MISSING leftArrow: 'Left Arrow', // MISSING upArrow: 'Up Arrow', // MISSING rightArrow: 'Right Arrow', // MISSING downArrow: 'Down Arrow', // MISSING insert: 'Insert', // MISSING leftWindowKey: 'Left Windows key', // MISSING rightWindowKey: 'Right Windows key', // MISSING selectKey: 'Select key', // MISSING numpad0: 'Numpad 0', // MISSING numpad1: 'Numpad 1', // MISSING numpad2: 'Numpad 2', // MISSING numpad3: 'Numpad 3', // MISSING numpad4: 'Numpad 4', // MISSING numpad5: 'Numpad 5', // MISSING numpad6: 'Numpad 6', // MISSING numpad7: 'Numpad 7', // MISSING numpad8: 'Numpad 8', // MISSING numpad9: 'Numpad 9', // MISSING multiply: 'Multiply', // MISSING add: 'Add', // MISSING subtract: 'Subtract', // MISSING decimalPoint: 'Decimal Point', // MISSING divide: 'Divide', // MISSING f1: 'F1', // MISSING f2: 'F2', // MISSING f3: 'F3', // MISSING f4: 'F4', // MISSING f5: 'F5', // MISSING f6: 'F6', // MISSING f7: 'F7', // MISSING f8: 'F8', // MISSING f9: 'F9', // MISSING f10: 'F10', // MISSING f11: 'F11', // MISSING f12: 'F12', // MISSING numLock: 'Num Lock', // MISSING scrollLock: 'Scroll Lock', // MISSING semiColon: 'Semicolon', // MISSING equalSign: 'Equal Sign', // MISSING comma: 'Comma', // MISSING dash: 'Dash', // MISSING period: 'Period', // MISSING forwardSlash: 'Forward Slash', // MISSING graveAccent: 'Grave Accent', // MISSING openBracket: 'Open Bracket', // MISSING backSlash: 'Backslash', // MISSING closeBracket: 'Close Bracket', // MISSING singleQuote: 'Single Quote' // MISSING } );
import Ember from 'ember'; export default Ember.Component.extend({ tagName: 'nav', classNames: ['navbar', 'navbar-default', 'navbar-static-top'] });
/* global console*/ var async = require('async'); var fs = require('fs'); var getModule = require('module-details'); var pack = require('./package.json'); var moduleList = pack.modules; // sort module list and re-write it to package.json moduleList.sort(); pack.modules = moduleList; fs.writeFileSync('package.json', JSON.stringify(pack, null, 2), 'utf8'); var results = []; async.forEach(moduleList, function (moduleName, cb) { console.log('fetching', moduleName); getModule(moduleName, function (err, data) { console.log('got', moduleName); results.push(data); cb(); }); }, function () { var info = results.map(function (m) { console.log('processing', m.name); var latest = m.versions[m['dist-tags'].latest]; var license = latest.license || (latest.licenses && latest.licenses[0] && latest.licenses[0].type); return { id: m.name, author: latest.maintainers[0].name, tags: latest.keywords, description: latest.description, homepage: latest.homepage || m.homepage, license: license || m.license || (m.licenses && m.licenses[0] && m.licenses[0].type) }; }); fs.writeFileSync('./clientapp/fixtures/repos.json', JSON.stringify(info, null, 2), 'utf8'); });
import angular from 'angular'; import {Annotation} from './annotation'; import {Annotations} from './annotations'; import {addStaticGetterObjectMember, addStaticGetter} from './utils'; export class ActionsAnnotation extends Annotation { get serviceName() { const name = this.name; return `${name[0].toUpperCase()}${name.slice(1)}Actions`; } getInjectionTokens() { return [ 'LuxyFlux', 'LuxyFluxActionCreators', 'ApplicationDispatcher' ].concat(super.getInjectionTokens()); } get factoryFn() { const TargetCls = this.targetCls; const annotation = this; return function(LuxyFlux, LuxyFluxActionCreators, ApplicationDispatcher) { const injected = Array.from(arguments).slice(3); const instance = new TargetCls(...injected); annotation.applyInjectionBindings(instance, injected); annotation.applyBehaviors(instance); annotation.applyDecorators(instance); return LuxyFlux.createActions({ dispatcher: ApplicationDispatcher, serviceActions: TargetCls.serviceActions, decorate: instance }, LuxyFluxActionCreators); }; } get module() { if (!this._module) { this._module = angular.module( `actions.${this.name}`, this.dependencies ); this._module.factory( this.serviceName, this.getInjectionTokens().concat([this.factoryFn]) ); this.configure(this._module); } return this._module; } } // Decorators export function Actions(config) { return cls => { let actionsName; const isConfigObject = angular.isObject(config); if (isConfigObject && config.name) { actionsName = config.name; } else if (angular.isString(config)) { actionsName = config; } else { const clsName = cls.name.replace(/actions$/i, ''); actionsName = `${clsName[0].toLowerCase()}${clsName.slice(1)}`; } const namespace = isConfigObject && config.namespace !== undefined ? config.namespace : actionsName; cls.actionNamespace = angular.isString(namespace) && namespace.length ? namespace .replace(/([A-Z])/g, '_$1') .toUpperCase() : null; addStaticGetter(cls, 'annotation', () => Annotations.getActions(actionsName, cls)); }; } export function AsyncAction(actionName) { return (cls, methodName) => { addStaticGetterObjectMember(cls.constructor, 'serviceActions', () => prepareActionName(cls, actionName, methodName), methodName); }; } export function Action(actionName) { return (cls, methodName, descriptor) => { if (descriptor) { const originalMethod = descriptor.value; descriptor.value = function(...payload) { const action = prepareActionName(cls, actionName, methodName); const originalReturn = Reflect.apply(originalMethod, this, payload); const dispatchPromise = this.dispatch(action, ...payload); return angular.isDefined(originalReturn) ? originalReturn : dispatchPromise; }; } else { cls[methodName] = function(...payload) { const action = prepareActionName(cls, actionName, methodName); return this.dispatch(action, ...payload); }; } }; } export default ActionsAnnotation; function prepareActionName(cls, actionName, methodName) { let preparedActionName = actionName; if (!preparedActionName) { preparedActionName = methodName.replace(/([A-Z])/g, '_$1'); } const actionNamespace = cls.constructor.actionNamespace; if (actionNamespace) { preparedActionName = `${actionNamespace}_${preparedActionName}`; } return preparedActionName.toUpperCase(); }
/* * examples/streaming.js: outline streaming interface */ var util = require('util'); var skinner = require('../lib/skinner'); var datapoints, bucketizers, stream; /* * See the "basic" example first. */ bucketizers = {}; datapoints = [ { 'fields': { 'city': 'Springfield', 'state': 'MA' }, 'value': 153000 }, { 'fields': { 'city': 'Boston', 'state': 'MA' }, 'value': 636000 }, { 'fields': { 'city': 'Worcestor', 'state': 'MA' }, 'value': 183000 }, { 'fields': { 'city': 'Fresno', 'state': 'CA' }, 'value': 505000 }, { 'fields': { 'city': 'Springfield', 'state': 'OR' }, 'value': 60000 }, { 'fields': { 'city': 'Portland', 'state': 'OR' }, 'value': 600000 } ]; stream = skinner.createAggregator({ 'bucketizers': bucketizers, 'decomps': [ 'city' ] }); datapoints.forEach(function (pt) { stream.write(pt); }); stream.end(); /* These two print the same thing. */ console.log(stream.result()); stream.on('data', function (result) { console.log(result); });
'use strict'; var nodemailer = require('nodemailer'); // Create a SMTP transporter object var transporter = nodemailer.createTransport( { host: 'smtpout.secureserver.net', port: 465, auth: { user: 'mail@pcaso.io', pass: 'lego2020.Gulch' }, secure: true } ); console.log('SMTP Configured'); // Message object var message = { // sender info from: 'Pcaso Authentication Service <mail@pcaso.io>', // Comma separated list of recipients //to: '"Clayton Smith" <clayton_smith@student.uml.edu>, "Nathaniel Pearson" <nathaniel.pearson@gmail.com>', to: '"Clayton Smith" <clayton_smith@student.uml.edu>',// "Nathaniel Pearson" <nathaniel.pearson@gmail.com>', // Subject of the message subject: "First automated email", // headers: { 'X-Laziness-level': 1000 }, // plaintext body text: 'Hello to myself!', // HTML body html: '<p><b>YES!!</b></p>' + '<p>If you can read this email, then pcaso.io is now able to send automated emails.</p>'+ '<p>Css Test:</p>' + '<p><h1>Heading 1</h1><p>' + '<p><h2>Heading 2</h2><p>' + '<p><h3>Heading 3</h3><p>' + '<p><h4>Heading 4</h4><p>' + '<p><h5>Heading 5</h5><p>', // An array of attachments attachments: [ ] }; console.log('Sending Mail'); transporter.sendMail(message, function(error, info) { if (error) { console.log(error.message); return; } console.log('Server responded with "%s"', info.response); });
(function () { 'use strict'; angular.module('yoga24') .factory('BeginnerLessons', ['DataSource', '$firebaseArray', function(DataSource, $firebaseArray) { return $firebaseArray(DataSource.child('/beginners')); }]) .controller('BeginnerCtrl', ['$scope','BeginnerLessons', 'Auth', 'Route', 'Notify', function($scope, BeginnerLessons, Auth, Route, Notify) { var authData = Auth.isUserLogged(); if (!authData){ Route.toLogInView(); } else { $scope.Beginner = {} $scope.Beginner.lessons = BeginnerLessons; Notify.showDataLoading(); $scope.Beginner.selectLesson = function(iLesson){ Route.toBeginnerView(iLesson); } } }]) .controller('BeginnerLessonCtrl', ['$scope', '$routeParams', 'BeginnerLessons', 'Auth', 'Route', 'Notify', function($scope, $routeParams, BeginnerLessons, Auth, Route, Notify) { var authData = Auth.isUserLogged(); if (!authData){ Route.toLogInView(); } else { $scope.Beginner = {}; $scope.Beginner.SelectedLesson = {}; $scope.Beginner.lessons = BeginnerLessons; Notify.showDataLoading(); $scope.Beginner.lessons.$loaded(function() { $scope.Beginner.SelectedLesson = $scope.Beginner.lessons[parseInt($routeParams.id)]; }); } }]); })();
/*! * DevExtreme (dx.messages.vi.js) * Version: 20.1.10 (build 21027-0322) * Build date: Wed Jan 27 2021 * * Copyright (c) 2012 - 2021 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/ */ "use strict"; ! function(root, factory) { if ("function" === typeof define && define.amd) { define(function(require) { factory(require("devextreme/localization")) }) } else { if ("object" === typeof module && module.exports) { factory(require("devextreme/localization")) } else { factory(DevExpress.localization) } } }(this, function(localization) { localization.loadMessages({ vi: { Yes: "C\xf3", No: "Kh\xf4ng", Cancel: "H\u1ee7y", Clear: "L\xe0m s\u1ea1ch", Done: "Ho\xe0n t\u1ea5t", Loading: "\u0110ang t\u1ea3i...", Select: "L\u1ef1a ch\u1ecdn...", Search: "T\xecm ki\u1ebfm", Back: "Quay l\u1ea1i", OK: "OK", "dxCollectionWidget-noDataText": "Kh\xf4ng c\xf3 d\u1eef li\u1ec7u \u0111\u1ec3 hi\u1ec3n th\u1ecb", "dxDropDownEditor-selectLabel": "L\u1ef1a ch\u1ecdn", "validation-required": "B\u1eaft bu\u1ed9c", "validation-required-formatted": "{0} l\xe0 b\u1eaft bu\u1ed9c", "validation-numeric": "Gi\xe1 tr\u1ecb ph\u1ea3i l\xe0 m\u1ed9t s\u1ed1", "validation-numeric-formatted": "{0} ph\u1ea3i l\xe0 m\u1ed9t s\u1ed1", "validation-range": "Gi\xe1 tr\u1ecb ngo\xe0i kho\u1ea3ng", "validation-range-formatted": "{0} ngo\xe0i kho\u1ea3ng", "validation-stringLength": "\u0110\u1ed9 d\xe0i c\u1ee7a gi\xe1 tr\u1ecb kh\xf4ng \u0111\xfang", "validation-stringLength-formatted": "\u0110\u1ed9 d\xe0i c\u1ee7a {0} kh\xf4ng \u0111\xfang", "validation-custom": "Gi\xe1 tr\u1ecb kh\xf4ng h\u1ee3p l\u1ec7", "validation-custom-formatted": "{0} kh\xf4ng h\u1ee3p l\u1ec7", "validation-async": "Gi\xe1 tr\u1ecb kh\xf4ng h\u1ee3p l\u1ec7", "validation-async-formatted": "{0} kh\xf4ng h\u1ee3p l\u1ec7", "validation-compare": "C\xe1c gi\xe1 tr\u1ecb kh\xf4ng kh\u1edbp", "validation-compare-formatted": "{0} kh\xf4ng kh\u1edbp", "validation-pattern": "Gi\xe1 tr\u1ecb kh\xf4ng kh\u1edbp v\u1edbi khu\xf4n m\u1eabu", "validation-pattern-formatted": "{0} kh\xf4ng kh\u1edbp v\u1edbi khu\xf4n m\u1eabu", "validation-email": "Email kh\xf4ng h\u1ee3p l\u1ec7", "validation-email-formatted": "{0} kh\xf4ng h\u1ee3p l\u1ec7", "validation-mask": "Gi\xe1 tr\u1ecb kh\xf4ng h\u1ee3p l\u1ec7", "dxLookup-searchPlaceholder": "S\u1ed1 k\xfd t\u1ef1 t\u1ed1i thi\u1ec3u: {0}", "dxList-pullingDownText": "K\xe9o xu\u1ed1ng \u0111\u1ec3 l\xe0m t\u01b0\u01a1i...", "dxList-pulledDownText": "Nh\u1ea3 ra \u0111\u1ec3 l\xe0m t\u01b0\u01a1i...", "dxList-refreshingText": "\u0110ang l\xe0m t\u01b0\u01a1i...", "dxList-pageLoadingText": "\u0110ang t\u1ea3i...", "dxList-nextButtonText": "Th\xeam", "dxList-selectAll": "Ch\u1ecdn T\u1ea5t c\u1ea3", "dxListEditDecorator-delete": "X\xf3a", "dxListEditDecorator-more": "Th\xeam", "dxScrollView-pullingDownText": "K\xe9o xu\u1ed1ng \u0111\u1ec3 l\xe0m t\u01b0\u01a1i...", "dxScrollView-pulledDownText": "Nh\u1ea3 ra \u0111\u1ec3 l\xe0m t\u01b0\u01a1i...", "dxScrollView-refreshingText": "L\xe0m t\u01b0\u01a1i...", "dxScrollView-reachBottomText": "\u0110ang t\u1ea3i...", "dxDateBox-simulatedDataPickerTitleTime": "L\u1ef1a ch\u1ecdn th\u1eddi gian", "dxDateBox-simulatedDataPickerTitleDate": "L\u1ef1a ch\u1ecdn ng\xe0y", "dxDateBox-simulatedDataPickerTitleDateTime": "Ch\u1ecdn ng\xe0y v\xe0 gi\u1edd", "dxDateBox-validation-datetime": "Gi\xe1 tr\u1ecb ph\u1ea3i l\xe0 ng\xe0y ho\u1eb7c gi\u1edd", "dxFileUploader-selectFile": "Ch\u1ecdn t\u1eadp tin", "dxFileUploader-dropFile": "ho\u1eb7c Th\u1ea3 t\u1eadp tin v\xe0o \u0111\xe2y", "dxFileUploader-bytes": "byte", "dxFileUploader-kb": "kb", "dxFileUploader-Mb": "Mb", "dxFileUploader-Gb": "Gb", "dxFileUploader-upload": "Upload", "dxFileUploader-uploaded": "\u0110\xe3 upload", "dxFileUploader-readyToUpload": "S\u1eb5n s\xe0ng \u0111\u1ec3 upload", "dxFileUploader-uploadFailedMessage": "Upload th\u1ea5t b\u1ea1i", "dxFileUploader-invalidFileExtension": "Ki\u1ec3u t\u1eadp tin kh\xf4ng cho ph\xe9p", "dxFileUploader-invalidMaxFileSize": "T\u1eadp tin qu\xe1 l\u1edbn", "dxFileUploader-invalidMinFileSize": "T\u1eadp tin qu\xe1 nh\u1ecf", "dxRangeSlider-ariaFrom": "T\u1eeb", "dxRangeSlider-ariaTill": "V\u1eabn", "dxSwitch-switchedOnText": "ON", "dxSwitch-switchedOffText": "OFF", "dxForm-optionalMark": "t\xf9y ch\u1ecdn", "dxForm-requiredMessage": "{0} l\xe0 b\u1eaft bu\u1ed9c", "dxNumberBox-invalidValueMessage": "Gi\xe1 tr\u1ecb ph\u1ea3i l\xe0 m\u1ed9t s\u1ed1", "dxNumberBox-noDataText": "Kh\xf4ng c\xf3 d\u1eef li\u1ec7u", "dxDataGrid-columnChooserTitle": "Tr\xecnh ch\u1ecdn c\u1ed9t", "dxDataGrid-columnChooserEmptyText": "K\xe9o m\u1ed9t c\u1ed9t v\xe0o \u0111\xe2y \u0111\u1ec3 \u1ea9n n\xf3 \u0111i", "dxDataGrid-groupContinuesMessage": "Ti\u1ebfp t\u1ee5c \u1edf trang ti\u1ebfp theo", "dxDataGrid-groupContinuedMessage": "\u0110\u01b0\u1ee3c ti\u1ebfp t\u1ee5c t\u1eeb trang tr\u01b0\u1edbc", "dxDataGrid-groupHeaderText": "Nh\xf3m theo C\u1ed9t n\xe0y", "dxDataGrid-ungroupHeaderText": "B\u1ecf Nh\xf3m", "dxDataGrid-ungroupAllText": "B\u1ecf Nh\xf3m t\u1ea5t c\u1ea3", "dxDataGrid-editingEditRow": "S\u1eeda", "dxDataGrid-editingSaveRowChanges": "L\u01b0u", "dxDataGrid-editingCancelRowChanges": "H\u1ee7y", "dxDataGrid-editingDeleteRow": "X\xf3a", "dxDataGrid-editingUndeleteRow": "Kh\xf4ng x\xf3a", "dxDataGrid-editingConfirmDeleteMessage": "B\u1ea1n c\xf3 th\u1eadt s\u1ef1 mu\u1ed1n x\xf3a b\u1ea3n ghi n\xe0y kh\xf4ng?", "dxDataGrid-validationCancelChanges": "H\u1ee7y b\u1ecf c\xe1c thay \u0111\u1ed5i", "dxDataGrid-groupPanelEmptyText": "K\xe9o ti\xeau \u0111\u1ec1 m\u1ed9t c\u1ed9t v\xe0o \u0111\xe2y \u0111\u1ec3 \u0111\u1ec3 nh\xf3m c\u1ed9t \u0111\xf3", "dxDataGrid-noDataText": "Kh\xf4ng c\xf3 d\u1eef li\u1ec7u", "dxDataGrid-searchPanelPlaceholder": "T\xecm ki\u1ebfm...", "dxDataGrid-filterRowShowAllText": "(T\u1ea5t c\u1ea3)", "dxDataGrid-filterRowResetOperationText": "L\xe0m l\u1ea1i", "dxDataGrid-filterRowOperationEquals": "B\u1eb1ng", "dxDataGrid-filterRowOperationNotEquals": "Kh\xf4ng b\u1eb1ng", "dxDataGrid-filterRowOperationLess": "Nh\u1ecf h\u01a1n", "dxDataGrid-filterRowOperationLessOrEquals": "Nh\u1ecf h\u01a1n ho\u1eb7c b\u1eb1ng", "dxDataGrid-filterRowOperationGreater": "L\u1edbn h\u01a1n", "dxDataGrid-filterRowOperationGreaterOrEquals": "L\u1edbn h\u01a1n ho\u1eb7c b\u1eb1ng", "dxDataGrid-filterRowOperationStartsWith": "B\u1eaft \u0111\u1ea7u b\u1edfi", "dxDataGrid-filterRowOperationContains": "Ch\u1ee9a", "dxDataGrid-filterRowOperationNotContains": "Kh\xf4ng ch\u1ee9a", "dxDataGrid-filterRowOperationEndsWith": "K\u1ebft th\xfac b\u1edfi", "dxDataGrid-filterRowOperationBetween": "Gi\u1eefa", "dxDataGrid-filterRowOperationBetweenStartText": "B\u1eaft \u0111\u1ea7u", "dxDataGrid-filterRowOperationBetweenEndText": "K\u1ebft th\xfac", "dxDataGrid-applyFilterText": "\xc1p d\u1ee5ng b\u1ed9 l\u1ecdc", "dxDataGrid-trueText": "\u0111\xfang", "dxDataGrid-falseText": "sai", "dxDataGrid-sortingAscendingText": "S\u1eafp x\u1ebfp T\u0103ng d\u1ea7n", "dxDataGrid-sortingDescendingText": "S\u1eafp x\u1ebfp Gi\u1ea3m d\u1ea7n", "dxDataGrid-sortingClearText": "Lo\u1ea1i b\u1ecf vi\u1ec7c s\u1eafp x\u1ebfp", "dxDataGrid-editingSaveAllChanges": "L\u01b0u l\u1ea1i c\xe1c thay \u0111\u1ed5i", "dxDataGrid-editingCancelAllChanges": "Lo\u1ea1i b\u1ecf c\xe1c thay \u0111\u1ed5i", "dxDataGrid-editingAddRow": "Th\xeam m\u1ed9t h\xe0ng", "dxDataGrid-summaryMin": "Nh\u1ecf nh\u1ea5t: {0}", "dxDataGrid-summaryMinOtherColumn": "Nh\u1ecf nh\u1ea5t c\u1ee7a {1} l\xe0 {0}", "dxDataGrid-summaryMax": "L\u1edbn nh\u1ea5t: {0}", "dxDataGrid-summaryMaxOtherColumn": "L\u1edbn nh\u1ea5t c\u1ee7a {1} l\xe0 {0}", "dxDataGrid-summaryAvg": "Trung b\xecnh: {0}", "dxDataGrid-summaryAvgOtherColumn": "Trung b\xecnh c\u1ee7a {1} l\xe0 {0}", "dxDataGrid-summarySum": "T\u1ed5ng: {0}", "dxDataGrid-summarySumOtherColumn": "T\u1ed5ng c\u1ee7a {1} l\xe0 {0}", "dxDataGrid-summaryCount": "S\u1ed1 l\u01b0\u1ee3ng: {0}", "dxDataGrid-columnFixingFix": "C\u1ed1 \u0111\u1ecbnh", "dxDataGrid-columnFixingUnfix": "Kh\xf4ng c\u1ed1 \u0111\u1ecbnh", "dxDataGrid-columnFixingLeftPosition": "\u0110\u1ebfn b\xean tr\xe1i", "dxDataGrid-columnFixingRightPosition": "\u0110\u1ebfn b\xean ph\u1ea3i", "dxDataGrid-exportTo": "Xu\u1ea5t ra", "dxDataGrid-exportToExcel": "Xu\u1ea5t ra T\u1eadp tin Excel", "dxDataGrid-exporting": "Xu\u1ea5t kh\u1ea9u...", "dxDataGrid-excelFormat": "T\u1eadp tin Excel", "dxDataGrid-selectedRows": "C\xe1c h\xe0ng \u0111\u01b0\u1ee3c ch\u1ecdn", "dxDataGrid-exportSelectedRows": "Xu\u1ea5t ra c\xe1c h\xe0ng \u0111\u01b0\u1ee3c ch\u1ecdn", "dxDataGrid-exportAll": "Xu\u1ea5t ra t\u1ea5t c\u1ea3 d\u1eef li\u1ec7u", "dxDataGrid-headerFilterEmptyValue": "(Tr\u1ed1ng)", "dxDataGrid-headerFilterOK": "OK", "dxDataGrid-headerFilterCancel": "H\u1ee7y", "dxDataGrid-ariaColumn": "C\u1ed9t", "dxDataGrid-ariaValue": "Gi\xe1 tr\u1ecb", "dxDataGrid-ariaFilterCell": "L\u1ecdc \xf4", "dxDataGrid-ariaCollapse": "Thu l\u1ea1i", "dxDataGrid-ariaExpand": "M\u1edf ra", "dxDataGrid-ariaDataGrid": "L\u01b0\u1edbi d\u1eef li\u1ec7u", "dxDataGrid-ariaSearchInGrid": "T\xecm ki\u1ebfm trong l\u01b0\u1edbi d\u1eef li\u1ec7u", "dxDataGrid-ariaSelectAll": "Ch\u1ecdn t\u1ea5t c\u1ea3", "dxDataGrid-ariaSelectRow": "Ch\u1ecdn h\xe0ng", "dxDataGrid-filterBuilderPopupTitle": "Tr\xecnh d\u1ef1ng B\u1ed9 l\u1ecdc", "dxDataGrid-filterPanelCreateFilter": "T\u1ea1o B\u1ed9 l\u1ecdc", "dxDataGrid-filterPanelClearFilter": "Lo\u1ea1i b\u1ecf", "dxDataGrid-filterPanelFilterEnabledHint": "K\xedch ho\u1ea1t B\u1ed9 l\u1ecdc", "dxTreeList-ariaTreeList": "Danh s\xe1ch c\xe2y", "dxTreeList-editingAddRowToNode": "Th\xeam", "dxPager-infoText": "Trang {0} c\u1ee7a {1} ({2} m\u1ee5c)", "dxPager-pagesCountText": "c\u1ee7a", "dxPivotGrid-grandTotal": "T\u1ed5ng t\u1ea5t c\u1ea3", "dxPivotGrid-total": "{0} T\u1ed5ng", "dxPivotGrid-fieldChooserTitle": "Tr\xecnh l\u1ef1a ch\u1ecdn Tr\u01b0\u1eddng", "dxPivotGrid-showFieldChooser": "Hi\u1ec3n th\u1ecb Tr\xecnh l\u1ef1a ch\u1ecdn Tr\u01b0\u1eddng", "dxPivotGrid-expandAll": "M\u1edf r\u1ed9ng t\u1ea5t c\u1ea3", "dxPivotGrid-collapseAll": "Thu l\u1ea1i t\u1ea5t c\u1ea3", "dxPivotGrid-sortColumnBySummary": 'S\u1eafp x\u1ebfp "{0}" theo C\u1ed9t n\xe0y', "dxPivotGrid-sortRowBySummary": 'S\u1eafp x\u1ebfp "{0}" theo H\xe0ng n\xe0y', "dxPivotGrid-removeAllSorting": "Lo\u1ea1i b\u1ecf t\u1ea5t c\u1ea3 vi\u1ec7c s\u1eafp x\u1ebfp", "dxPivotGrid-dataNotAvailable": "Kh\xf4ng c\xf3 s\u1eb5n", "dxPivotGrid-rowFields": "C\xe1c tr\u01b0\u1eddng c\u1ee7a h\xe0ng", "dxPivotGrid-columnFields": "C\xe1c tr\u01b0\u1eddng c\u1ee7a c\u1ed9t", "dxPivotGrid-dataFields": "C\xe1c tr\u01b0\u1eddng D\u1eef li\u1ec7u", "dxPivotGrid-filterFields": "L\u1ecdc c\xe1c tr\u01b0\u1eddng", "dxPivotGrid-allFields": "T\u1ea5t c\u1ea3 c\xe1c tr\u01b0\u1eddng", "dxPivotGrid-columnFieldArea": "Th\u1ea3 c\xe1c tr\u01b0\u1eddng c\u1ee7a c\u1ed9t v\xe0o \u0111\xe2y", "dxPivotGrid-dataFieldArea": "Th\u1ea3 c\xe1c tr\u01b0\u1eddng d\u1eef li\u1ec7u v\xe0o \u0111\xe2y", "dxPivotGrid-rowFieldArea": "Th\u1ea3 c\xe1c tr\u01b0\u1eddng c\u1ee7a h\xe0ng v\xe0o \u0111\xe2y", "dxPivotGrid-filterFieldArea": "Th\u1ea3 b\u1ed9 l\u1ecdc c\xe1c tr\u01b0\u1eddng v\xe0o \u0111\xe2y", "dxScheduler-editorLabelTitle": "Ch\u1ee7 \u0111\u1ec1", "dxScheduler-editorLabelStartDate": "Ng\xe0y b\u1eaft \u0111\u1ea7u", "dxScheduler-editorLabelEndDate": "Ng\xe0y k\u1ebft th\xfac", "dxScheduler-editorLabelDescription": "M\xf4 t\u1ea3", "dxScheduler-editorLabelRecurrence": "L\u1eb7p l\u1ea1i", "dxScheduler-openAppointment": "M\u1edf l\u1ecbch h\u1eb9n", "dxScheduler-recurrenceNever": "Kh\xf4ng bao gi\u1edd", "dxScheduler-recurrenceMinutely": "Minutely", "dxScheduler-recurrenceHourly": "Hourly", "dxScheduler-recurrenceDaily": "H\xe0ng ng\xe0y", "dxScheduler-recurrenceWeekly": "H\xe0ng tu\u1ea7n", "dxScheduler-recurrenceMonthly": "H\xe0ng th\xe1ng", "dxScheduler-recurrenceYearly": "H\xe0ng n\u0103m", "dxScheduler-recurrenceRepeatEvery": "L\u1eb7p l\u1ea1i m\xe3i", "dxScheduler-recurrenceRepeatOn": "B\u1eadt ch\u1ebf \u0111\u1ed9 L\u1eb7p l\u1ea1i", "dxScheduler-recurrenceEnd": "K\u1ebft th\xfac vi\u1ec7c l\u1eb7p l\u1ea1i", "dxScheduler-recurrenceAfter": "Sau", "dxScheduler-recurrenceOn": "V\xe0o", "dxScheduler-recurrenceRepeatMinutely": "minute(s)", "dxScheduler-recurrenceRepeatHourly": "hour(s)", "dxScheduler-recurrenceRepeatDaily": "ng\xe0y", "dxScheduler-recurrenceRepeatWeekly": "tu\u1ea7n", "dxScheduler-recurrenceRepeatMonthly": "th\xe1ng", "dxScheduler-recurrenceRepeatYearly": "n\u0103m", "dxScheduler-switcherDay": "Ng\xe0y", "dxScheduler-switcherWeek": "Tu\u1ea7n", "dxScheduler-switcherWorkWeek": "Tu\u1ea7n L\xe0m vi\u1ec7c", "dxScheduler-switcherMonth": "Th\xe1ng", "dxScheduler-switcherAgenda": "L\u1ecbch tr\xecnh", "dxScheduler-switcherTimelineDay": "D\xf2ng th\u1eddi gian Ng\xe0y", "dxScheduler-switcherTimelineWeek": "D\xf2ng th\u1eddi gian Tu\u1ea7n", "dxScheduler-switcherTimelineWorkWeek": "D\xf2ng th\u1eddi gian Tu\u1ea7n l\xe0m vi\u1ec7c", "dxScheduler-switcherTimelineMonth": "D\xf2ng th\u1eddi gian Th\xe1ng", "dxScheduler-recurrenceRepeatOnDate": "v\xe0o ng\xe0y", "dxScheduler-recurrenceRepeatCount": "s\u1ed1 l\u1ea7n di\u1ec5n ra", "dxScheduler-allDay": "C\u1ea3 ng\xe0y", "dxScheduler-confirmRecurrenceEditMessage": "B\u1ea1n c\xf3 mu\u1ed1n s\u1eeda ch\u1ec9 L\u1ecbch h\u1eb9n n\xe0y ho\u1eb7c To\xe0n b\u1ed9 chu\u1ed7i?", "dxScheduler-confirmRecurrenceDeleteMessage": "B\u1ea1n c\xf3 mu\u1ed1n x\xf3a ch\u1ec9 L\u1ecbch h\u1eb9n n\xe0y ho\u1eb7c To\xe0n b\u1ed9 chu\u1ed7i?", "dxScheduler-confirmRecurrenceEditSeries": "S\u1eeda chu\u1ed7i", "dxScheduler-confirmRecurrenceDeleteSeries": "X\xf3a chu\u1ed7i", "dxScheduler-confirmRecurrenceEditOccurrence": "S\u1eeda L\u1ecbch h\u1eb9n", "dxScheduler-confirmRecurrenceDeleteOccurrence": "X\xf3a L\u1ecbch h\u1eb9n", "dxScheduler-noTimezoneTitle": "Kh\xf4ng c\xf3 m\xfai gi\u1edd", "dxScheduler-moreAppointments": "{0} th\xeam", "dxCalendar-todayButtonText": "H\xf4m nay", "dxCalendar-ariaWidgetName": "L\u1ecbch", "dxColorView-ariaRed": "\u0110\u1ecf", "dxColorView-ariaGreen": "Xanh l\xe1", "dxColorView-ariaBlue": "Xanh n\u01b0\u1edbc bi\u1ec3n", "dxColorView-ariaAlpha": "Trong su\u1ed1t", "dxColorView-ariaHex": "M\xe3 m\xe0u", "dxTagBox-selected": "{0} \u0111\xe3 \u0111\u01b0\u1ee3c ch\u1ecdn", "dxTagBox-allSelected": "T\u1ea5t c\u1ea3 \u0111\xe3 \u0111\u01b0\u1ee3c ch\u1ecdn ({0})", "dxTagBox-moreSelected": "{0} th\xeam", "vizExport-printingButtonText": "In", "vizExport-titleMenuText": "Xu\u1ea5t ra/In", "vizExport-exportButtonText": "{0} t\u1eadp tin", "dxFilterBuilder-and": "V\xe0", "dxFilterBuilder-or": "Ho\u1eb7c", "dxFilterBuilder-notAnd": "Kh\xf4ng V\xe0", "dxFilterBuilder-notOr": "Kh\xf4ng ho\u1eb7c", "dxFilterBuilder-addCondition": "Th\xeam \u0110i\u1ec1u ki\u1ec7n", "dxFilterBuilder-addGroup": "Th\xeam nh\xf3m", "dxFilterBuilder-enterValueText": "<nh\u1eadp gi\xe1 tr\u1ecb>", "dxFilterBuilder-filterOperationEquals": "B\u1eb1ng", "dxFilterBuilder-filterOperationNotEquals": "Kh\xf4ng b\u1eb1ng", "dxFilterBuilder-filterOperationLess": "Nh\u1ecf h\u01a1n", "dxFilterBuilder-filterOperationLessOrEquals": "Nh\u1ecf h\u01a1n ho\u1eb7c b\u1eb1ng", "dxFilterBuilder-filterOperationGreater": "L\xe0 l\u1edbn h\u01a1n", "dxFilterBuilder-filterOperationGreaterOrEquals": "L\xe0 l\u1edbn h\u01a1n ho\u1eb7c b\u1eb1ng", "dxFilterBuilder-filterOperationStartsWith": "B\u1eaft \u0111\u1ea7u v\u1edbi", "dxFilterBuilder-filterOperationContains": "Ch\u1ee9a", "dxFilterBuilder-filterOperationNotContains": "Kh\xf4ng ch\u1ee9a", "dxFilterBuilder-filterOperationEndsWith": "K\u1ebft th\xfac b\u1edfi", "dxFilterBuilder-filterOperationIsBlank": "L\xe0 tr\u1ed1ng", "dxFilterBuilder-filterOperationIsNotBlank": "L\xe0 kh\xf4ng tr\u1ed1ng", "dxFilterBuilder-filterOperationBetween": "L\xe0 gi\u1eefa", "dxFilterBuilder-filterOperationAnyOf": "L\xe0 b\u1ea5t k\u1ef3 c\u1ee7a", "dxFilterBuilder-filterOperationNoneOf": "Kh\xf4ng kh\xf4ng c\xf3 c\u1ee7a", "dxHtmlEditor-dialogColorCaption": "\u0110\u1ed5i m\xe0u ph\xf4ng ch\u1eef", "dxHtmlEditor-dialogBackgroundCaption": "\u0110\u1ed5i m\xe0u n\u1ec1n", "dxHtmlEditor-dialogLinkCaption": "Th\xeam Li\xean k\u1ebft", "dxHtmlEditor-dialogLinkUrlField": "\u0110\u01b0\u1eddng d\u1eabn", "dxHtmlEditor-dialogLinkTextField": "V\u0103n b\u1ea3n", "dxHtmlEditor-dialogLinkTargetField": "M\u1edf li\xean k\u1ebft \u1edf c\u1eeda s\u1ed5 m\u1edbi", "dxHtmlEditor-dialogImageCaption": "Th\xeam h\xecnh \u1ea3nh", "dxHtmlEditor-dialogImageUrlField": "\u0110\u01b0\u1eddng d\u1eabn", "dxHtmlEditor-dialogImageAltField": "V\u0103n b\u1ea3n thay th\u1ebf", "dxHtmlEditor-dialogImageWidthField": "R\u1ed9ng (px)", "dxHtmlEditor-dialogImageHeightField": "Cao (px)", "dxHtmlEditor-heading": "Ti\xeau \u0111\u1ec1", "dxHtmlEditor-normalText": "Ch\u1eef b\xecnh th\u01b0\u1eddng", "dxFileManager-newDirectoryName": "Th\u01b0 m\u1ee5c kh\xf4ng t\xean", "dxFileManager-rootDirectoryName": "C\xe1c t\u1eadp tin", "dxFileManager-errorNoAccess": "T\u1eeb ch\u1ed1i truy c\u1eadp. Thao t\xe1c kh\xf4ng th\u1ec3 ho\xe0n t\u1ea5t.", "dxFileManager-errorDirectoryExistsFormat": "Th\u01b0 m\u1ee5c '{0}' \u0111\xe3 t\u1ed3n t\u1ea1i.", "dxFileManager-errorFileExistsFormat": "T\u1eadp tin '{0}' \u0111\xe3 t\u1ed3n t\u1ea1i.", "dxFileManager-errorFileNotFoundFormat": "T\u1eadp tin '{0}' kh\xf4ng t\xecm th\u1ea5y", "dxFileManager-errorDirectoryNotFoundFormat": "Th\u01b0 m\u1ee5c '{0}' kh\xf4ng t\xecm th\u1ea5y", "dxFileManager-errorWrongFileExtension": "Ph\u1ea7n m\u1edf r\u1ed9ng c\u1ee7a t\u1eadp tin kh\xf4ng cho ph\xe9p", "dxFileManager-errorMaxFileSizeExceeded": "K\xedch th\u01b0\u1edbc c\u1ee7a t\u1eadp tin v\u01b0\u1ee3t qu\xe1 k\xedch th\u01b0\u1edbc t\u1ed1i \u0111a cho ph\xe9p", "dxFileManager-errorInvalidSymbols": "TODO", "dxFileManager-errorDefault": "L\u1ed7i kh\xf4ng x\xe1c \u0111\u1ecbnh.", "dxFileManager-errorDirectoryOpenFailed": "TODO", "dxDiagram-categoryGeneral": "Chung", "dxDiagram-categoryFlowchart": "L\u01b0u \u0111\u1ed3", "dxDiagram-categoryOrgChart": "S\u01a1 \u0111\u1ed3 t\u1ed5 ch\u1ee9c", "dxDiagram-categoryContainers": "Tr\xecnh ch\u1ee9a", "dxDiagram-categoryCustom": "T\xf9y ch\u1ec9nh", "dxDiagram-commandExportToSvg": "Xu\u1ea5t ra SVG", "dxDiagram-commandExportToPng": "Xu\u1ea5t ra PNG", "dxDiagram-commandExportToJpg": "Xu\u1ea5t ra JPEG", "dxDiagram-commandUndo": "H\u1ee7y thao t\xe1c", "dxDiagram-commandRedo": "L\xe0m l\u1ea1i thao t\xe1c", "dxDiagram-commandFontName": "T\xean ph\xf4ng ch\u1eef", "dxDiagram-commandFontSize": "K\xedch th\u01b0\u1edbc ph\xf4ng ch\u1eef", "dxDiagram-commandBold": "\u0110\u1eadm", "dxDiagram-commandItalic": "Nghi\xeang", "dxDiagram-commandUnderline": "G\u1ea1ch d\u01b0\u1edbi", "dxDiagram-commandTextColor": "M\xe0u ch\u1eef", "dxDiagram-commandLineColor": "M\xe0u \u0111\u01b0\u1eddng", "dxDiagram-commandLineWidth": "TODO", "dxDiagram-commandLineStyle": "TODO", "dxDiagram-commandLineStyleSolid": "TODO", "dxDiagram-commandLineStyleDotted": "TODO", "dxDiagram-commandLineStyleDashed": "TODO", "dxDiagram-commandFillColor": "\u0110\u1ed5 m\xe0u", "dxDiagram-commandAlignLeft": "Canh tr\xe1i", "dxDiagram-commandAlignCenter": "Canh gi\u1eefa", "dxDiagram-commandAlignRight": "Canh ph\u1ea3i", "dxDiagram-commandConnectorLineType": "Lo\u1ea1i \u0111\u01b0\u1eddng n\u1ed1i", "dxDiagram-commandConnectorLineStraight": "Th\u1eb3ng", "dxDiagram-commandConnectorLineOrthogonal": "Tr\u1ef1c giao", "dxDiagram-commandConnectorLineStart": "B\u1eaft \u0111\u1ea7u \u0111\u01b0\u1eddng n\u1ed1i", "dxDiagram-commandConnectorLineEnd": "K\u1ebft th\xfac \u0111\u01b0\u1eddng n\u1ed1i", "dxDiagram-commandConnectorLineNone": "Kh\xf4ng", "dxDiagram-commandConnectorLineArrow": "M\u0169i t\xean", "dxDiagram-commandFullscreen": "To\xe0n m\xe0n h\xecnh", "dxDiagram-commandUnits": "\u0110\u01a1n v\u1ecb", "dxDiagram-commandPageSize": "K\xedch th\u01b0\u1edbc trang", "dxDiagram-commandPageOrientation": "Chi\u1ec1u c\u1ee7a trang", "dxDiagram-commandPageOrientationLandscape": "Trang ngang", "dxDiagram-commandPageOrientationPortrait": "Trang d\u1ecdc", "dxDiagram-commandPageColor": "M\xe0u trang", "dxDiagram-commandShowGrid": "Hi\u1ec3n th\u1ecb l\u01b0\u1edbi", "dxDiagram-commandSnapToGrid": "Neo v\xe0o l\u01b0\u1edbi", "dxDiagram-commandGridSize": "K\xedch th\u01b0\u1edbc l\u01b0\u1edbi", "dxDiagram-commandZoomLevel": "M\u1ee9c ph\xf3ng \u0111\u1ea1i", "dxDiagram-commandAutoZoom": "Ph\xf3ng \u0111\u1ea1i t\u1ef1 \u0111\u1ed9ng", "dxDiagram-commandFitToContent": "TODO", "dxDiagram-commandFitToWidth": "TODO", "dxDiagram-commandAutoZoomByContent": "TODO", "dxDiagram-commandAutoZoomByWidth": "TODO", "dxDiagram-commandSimpleView": "Ki\u1ec3u xem \u0111\u01a1n gi\u1ea3n", "dxDiagram-commandCut": "C\u1eaft", "dxDiagram-commandCopy": "Sao ch\xe9p", "dxDiagram-commandPaste": "D\xe1n", "dxDiagram-commandSelectAll": "Ch\u1ecdn t\u1ea5t c\u1ea3", "dxDiagram-commandDelete": "X\xf3a", "dxDiagram-commandBringToFront": "Mang \u0111\u1ebfn ph\xeda tr\u01b0\u1edbc", "dxDiagram-commandSendToBack": "Mang \u0111\u1ebfn ph\xeda sau", "dxDiagram-commandLock": "Kh\xf3a", "dxDiagram-commandUnlock": "M\u1edf kh\xf3a", "dxDiagram-commandInsertShapeImage": "Ch\xe8n \u1ea3nh...", "dxDiagram-commandEditShapeImage": "\u0110\u1ed5i \u1ea3nh...", "dxDiagram-commandDeleteShapeImage": "X\xf3a \u1ea3nh", "dxDiagram-commandLayoutLeftToRight": "TODO", "dxDiagram-commandLayoutRightToLeft": "TODO", "dxDiagram-commandLayoutTopToBottom": "TODO", "dxDiagram-commandLayoutBottomToTop": "TODO", "dxDiagram-unitIn": "in", "dxDiagram-unitCm": "cm", "dxDiagram-unitPx": "px", "dxDiagram-dialogButtonOK": "OK", "dxDiagram-dialogButtonCancel": "H\u1ee7y", "dxDiagram-dialogInsertShapeImageTitle": "Ch\xe8n \u1ea3nh", "dxDiagram-dialogEditShapeImageTitle": "\u0110\u1ed5i \u1ea3nh", "dxDiagram-dialogEditShapeImageSelectButton": "Ch\u1ecdn \u1ea3nh", "dxDiagram-dialogEditShapeImageLabelText": "ho\u1eb7c th\u1ea3 t\u1eadp tin v\xe0o \u0111\xe2y", "dxDiagram-uiExport": "Xu\u1ea5t ra", "dxDiagram-uiProperties": "Thu\u1ed9c t\xednh", "dxDiagram-uiSettings": "TODO", "dxDiagram-uiShowToolbox": "TODO", "dxDiagram-uiSearch": "TODO", "dxDiagram-uiStyle": "TODO", "dxDiagram-uiLayout": "TODO", "dxDiagram-uiLayoutTree": "C\xe2y", "dxDiagram-uiLayoutLayered": "\u0110\u01b0\u1ee3c x\u1ebfp t\u1ea7ng", "dxDiagram-uiDiagram": "TODO", "dxDiagram-uiText": "TODO", "dxDiagram-uiObject": "TODO", "dxDiagram-uiConnector": "TODO", "dxDiagram-uiPage": "TODO", "dxDiagram-shapeText": "TODO", "dxDiagram-shapeRectangle": "TODO", "dxDiagram-shapeEllipse": "TODO", "dxDiagram-shapeCross": "TODO", "dxDiagram-shapeTriangle": "TODO", "dxDiagram-shapeDiamond": "TODO", "dxDiagram-shapeHeart": "TODO", "dxDiagram-shapePentagon": "TODO", "dxDiagram-shapeHexagon": "TODO", "dxDiagram-shapeOctagon": "TODO", "dxDiagram-shapeStar": "TODO", "dxDiagram-shapeArrowLeft": "TODO", "dxDiagram-shapeArrowUp": "TODO", "dxDiagram-shapeArrowRight": "TODO", "dxDiagram-shapeArrowDown": "TODO", "dxDiagram-shapeArrowUpDown": "TODO", "dxDiagram-shapeArrowLeftRight": "TODO", "dxDiagram-shapeProcess": "TODO", "dxDiagram-shapeDecision": "TODO", "dxDiagram-shapeTerminator": "TODO", "dxDiagram-shapePredefinedProcess": "TODO", "dxDiagram-shapeDocument": "TODO", "dxDiagram-shapeMultipleDocuments": "TODO", "dxDiagram-shapeManualInput": "TODO", "dxDiagram-shapePreparation": "TODO", "dxDiagram-shapeData": "TODO", "dxDiagram-shapeDatabase": "TODO", "dxDiagram-shapeHardDisk": "TODO", "dxDiagram-shapeInternalStorage": "TODO", "dxDiagram-shapePaperTape": "TODO", "dxDiagram-shapeManualOperation": "TODO", "dxDiagram-shapeDelay": "TODO", "dxDiagram-shapeStoredData": "TODO", "dxDiagram-shapeDisplay": "TODO", "dxDiagram-shapeMerge": "TODO", "dxDiagram-shapeConnector": "TODO", "dxDiagram-shapeOr": "TODO", "dxDiagram-shapeSummingJunction": "TODO", "dxDiagram-shapeContainerDefaultText": "TODO", "dxDiagram-shapeVerticalContainer": "TODO", "dxDiagram-shapeHorizontalContainer": "TODO", "dxDiagram-shapeCardDefaultText": "TODO", "dxDiagram-shapeCardWithImageOnLeft": "TODO", "dxDiagram-shapeCardWithImageOnTop": "TODO", "dxDiagram-shapeCardWithImageOnRight": "TODO", "dxGantt-dialogTitle": "TODO", "dxGantt-dialogStartTitle": "TODO", "dxGantt-dialogEndTitle": "TODO", "dxGantt-dialogProgressTitle": "TODO", "dxGantt-dialogResourcesTitle": "TODO", "dxGantt-dialogResourceManagerTitle": "TODO", "dxGantt-dialogTaskDetailsTitle": "TODO", "dxGantt-dialogEditResourceListHint": "TODO", "dxGantt-dialogEditNoResources": "TODO", "dxGantt-dialogButtonAdd": "TODO", "dxGantt-contextMenuNewTask": "TODO", "dxGantt-contextMenuNewSubtask": "TODO", "dxGantt-contextMenuDeleteTask": "TODO", "dxGantt-contextMenuDeleteDependency": "TODO", "dxGantt-dialogTaskDeleteConfirmation": "TODO", "dxGantt-dialogDependencyDeleteConfirmation": "TODO", "dxGantt-dialogResourcesDeleteConfirmation": "TODO", "dxGantt-dialogConstraintCriticalViolationMessage": "TODO", "dxGantt-dialogConstraintViolationMessage": "TODO", "dxGantt-dialogCancelOperationMessage": "TODO", "dxGantt-dialogDeleteDependencyMessage": "TODO", "dxGantt-dialogMoveTaskAndKeepDependencyMessage": "TODO", "dxGantt-undo": "TODO", "dxGantt-redo": "TODO", "dxGantt-expandAll": "TODO", "dxGantt-collapseAll": "TODO", "dxGantt-addNewTask": "TODO", "dxGantt-deleteSelectedTask": "TODO", "dxGantt-zoomIn": "TODO", "dxGantt-zoomOut": "TODO", "dxGantt-fullScreen": "TODO" } }) });
/** * This file contains all necessary Angular controller definitions for 'frontend.admin.login-history' module. * * Note that this file should only contain controllers and nothing else. */ (function() { 'use strict'; angular.module('frontend.snapshots') .controller('SnapshotsController', [ '_','$scope', function controller(_,$scope) { $scope.activeSection = 0; $scope.sections = [ { name : 'List', icon : 'mdi mdi-format-list-bulleted', isVisible : true }, { name : 'Scheduled tasks', icon : 'mdi mdi-calendar', isVisible : true } ]; $scope.showSection = function(index) { $scope.activeSection = index; }; } ]) ; }());
/* Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ CKEDITOR.plugins.setLang("codesnippet","tt",{button:"Код өзеген өстәү",codeContents:"Код эчтәлеге",emptySnippetError:"Код өзеге буш булмаска тиеш.",language:"Тел",title:"Код өзеге",pathName:"код өзеге"});
let MetricsCard = { bindings: { title: '@', test: '@', maintainability: '@', security: '@', workmanship: '@' }, controllerAs: 'MetricsCardCtrl', templateUrl: 'templates/dashboard/components/metrics-card.html' }; export default MetricsCard;
module.exports = function (grunt) { grunt.initConfig({ slingImport: { options: { replace: true }, all: { src: "src/*", dest: "/" } } }); grunt.loadTasks("../../tasks"); grunt.registerTask("default", ["slingImport"]); };
// https://leetcode.com/problems/permutations/description/ /** * @param {number[]} nums * @return {number[][]} */ var permute = function (nums) { let dfs = (nums, pos) => { let tempRes = []; if (pos === nums.length - 1) { tempRes.push([].concat(nums)); } else { for (let i = pos; i < nums.length; i++) { [nums[pos], nums[i]] = [nums[i], nums[pos]]; tempRes = tempRes.concat(dfs(nums, pos + 1)); [nums[i], nums[pos]] = [nums[pos], nums[i]]; } } return tempRes; } let result = dfs(nums, 0); return result; }; console.log(permute([1, 2, 3]));
'use strict'; var constant = function(_) { return function(){return _;}; }; var _config = {}; var config = { get: function(key) { var args = (arguments.length === 1? [arguments[0]]: Array.apply(null, arguments)); if (_config[key] !== void 0) { return _config[key].apply(this, args.slice(1)); } return void 0; }, set: function(key, _) { if (typeof _ === 'function') { _config[key] = _; } else { if (_ == null) { delete _config[key]; } else { _config[key] = constant(_); } } return this; } }; config.set('token', process.env.SLACK_API_TOKEN || function() { throw new Error('Slack token is not set!'); }); try { var f = require('./.config.json'); Object.keys(f).forEach(function(d) { config.set(d, f[d]); }); config.file = '.config.json'; } catch (e) { delete config.file; } module.exports = config;
({ afterLeafletLoaded : function(component, event, helper) { setTimeout(function(){ var sanFranciscoCoordinates = [37.784173, -122.401557]; var map = L.map('map', {zoomControl: false}) .setView(sanFranciscoCoordinates, 14); var argisUrl = 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}'; L.tileLayer(argisUrl, {attribution: 'Tiles © Esri'}) .addTo(map); component.set('v.map', map); }); }, accountsLoaded : function(component, event, helper) { var map = component.get('v.map'); var accounts = event.getParam('accounts'); accounts.forEach(function(account){ var latLng = [account.Location__Latitude__s, account.Location__Longitude__s]; L.marker(latLng, {account: account}).addTo(map).on('click', function(event) { helper.navigateToDetailsView(event.target.options.account.Id); }); }); }, accountSelected: function(component, event, helper){ var map = component.get('v.map'); var account = event.getParam('account'); map.panTo([account.Location__Latitude__s, account.Location__Longitude__s]); } })
/* * GET users page. */ exports.index = function(req, res){ res.render('users/users', { title: 'Users' }); }; /* */
var t = require('tcomb'); module.exports = t.refinement(t.Number, function(n) { return n % 1 === 0; }, 'code');
'use strict'; var reload = require('mod-reload'); (function () { var root = this; // ES6 polyfills Number.isInteger = Number.isInteger || function(value) { return typeof value === 'number' && isFinite(value) && Math.floor(value) === value; }; Number.isNaN = Number.isNaN || function(value) { return typeof value === 'number' && value !== value; }; Number.isFinite = Number.isFinite || function(value) { return typeof value === 'number' && isFinite(value); }; // http://stackoverflow.com/questions/18082/validate-decimal-numbers-in-javascript-isnumeric function isNumber(n) { return !isNaN(parseFloat(n)) && isFinite(n); } /** * Large */ function Large(input) { input = typeof input === 'undefined' ? 0 : input; var val; if (input instanceof Large) { this.val = input.val; } if (Number.isInteger(input)) { val = input.toString(); } if (typeof input === 'string' || input instanceof String) { if (isNumber(input) && parseInt(input) === parseFloat(input)) { val = input; } } if (val !== undefined) { val = val.split('') .reverse() .map(function (digit) { return parseInt(digit); }); this.val = val; } } Large.prototype.size = function () { return this.val.length; }; Object.defineProperty(Large.prototype, 'size', { get: function () { return this.val.length; } }); Large.prototype.times = function (multiplier) { if (!(multiplier instanceof Large)) { multiplier = new Large(multiplier); } var result = Array.apply(null, Array(this.size + multiplier.size)) .map(function () { return 0; }); for (var i = 0; i < multiplier.size; i++) { var d = multiplier.val[i]; var carry = 0; for (var j = 0; j < this.size; j++) { var product = d * this.val[j] + carry + result[i + j]; var lsd = product % 10; carry = (product - lsd) / 10; result[j + i] = lsd; } if (carry !== 0) { result[i + j] = carry; } } while (result[result.length - 1] === 0) { result.pop(); } this.val = result; return this; }; Large.reload = reload; // export as a Node module if we're in that environment // otherwise set it as a global object (function, whatever) if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') { module.exports = Large; } else { root.foo = Large; } }).call(this); /* 23 x 42 ----- 126 84 */
var config = require('../config'); var pathLib = require('path') var env = process.env.NODE_ENV || "development" var log4js = require('log4js'); log4js.configure({ appenders: [ { type: 'console' }, { type: 'file', filename: pathLib.join(config.log_dir, 'cheese.log'), category: 'cheese' } ] }); var logger = log4js.getLogger('cheese'); logger.setLevel(config.debug && env !== 'test' ? 'DEBUG' : 'ERROR') module.exports = logger;
var fs = require('fs'); var cache = require('./cache'); var nunjucks = require('nunjucks'); nunjucks.configure('views', { autoescape: true }); module.exports = function (user, repositories) { var stats = { hasEmptyRepos: false, count: repositories.length, withLicense: 0, licenses: {}, files: { 'package.json': { repos: [] } }, mixed: [] }; var reposWithLicenses = repositories.map(function (repo) { var licenses = []; if (repo.hasLicense) { stats.withLicense += 1; if (repo.packageJson && repo.packageJson.name) { licenses.push({ name: repo.packageJson.name, file: 'package.json' }); stats.files['package.json'].repos.push(repo.repo); if (!stats.licenses[repo.packageJson.name]) { stats.licenses[repo.packageJson.name] = { repos: [] }; } if (stats.licenses[repo.packageJson.name].repos.indexOf(repo.repo) === -1) { stats.licenses[repo.packageJson.name].repos.push(repo.repo); } } repo.files.forEach(function (file) { licenses.push({ name: file.name, file: file.path }); if (!stats.licenses[file.name]) { stats.licenses[file.name] = { repos: [] }; } if (stats.licenses[file.name].repos.indexOf(repo.repo) === -1) { stats.licenses[file.name].repos.push(repo.repo); } if (!stats.files[file.path]) { stats.files[file.path] = { repos: [] }; } stats.files[file.path].repos.push(repo.repo); }); } if (licenses.length > 0) { var uniqueLicenses = licenses.reduce(function (result, license) { if (result.indexOf(license.name) === -1) { result.push(license.name); } return result; }, []); if (uniqueLicenses.length > 1) { stats.mixed.push({ repo: repo.repo, licenses: uniqueLicenses }); } } if (repo.empty) { stats.hasEmptyRepos = true; } return Object.assign({ licenses: licenses, unique: uniqueLicenses || [] }, repo); }); stats.licenses = sortObject(stats.licenses); stats.files = sortObject(stats.files); var result = { user: user, statistics: stats, repositories: reposWithLicenses }; cache.writeTmp('out.json', JSON.stringify(result, null, '\t')) .then(function () { console.log('JSON report created in tmp/out.json'); }) .catch(function (err) { console.error('Unable to write output JSON', err); }); fs.writeFile('report.html', nunjucks.render('index.html', result), function (err) { if (err) { console.error('Unable to write output HTML', err); } else { console.log('HTML report created in report.html'); } }); }; function sortObject(object) { return Object.keys(object).map(function (key) { return Object.assign({ name: key }, object[key]); }).sort(function (a, b) { return b.repos.length - a.repos.length; }); }
function normalizeValue(value, options) { if (value == null) return value; if (!options) return value; if (options.trimmed) value = value.trim(); return value; } function normalizeValueFromString(value) { if (value == null) return value; if (typeof value !== 'string') return value; value = value.replace(/&lt;/g, "<"); value = value.replace(/&gt;/g, ">"); return value; } function normalizeValueToString(value) { if (value == null) return value; if (typeof value !== 'string') return value; value = value.replace(/</g, "&lt;"); value = value.replace(/>/g, "&gt;"); return value; } function normalizeName(name, options) { if (!options) return name; if (options.camelize) name = camelize(name); if (options.capitalize) name = capitalize(name); if (options.nons) name = removeNamespace(name); return name; } function camelize(text) { var p = text.indexOf(':'); if (p >= 0) return text = text.substring(0, p) + ':' + text[p + 1].toLowerCase() + text.substring(p + 2); return text[0].toLowerCase() + text.substring(1); } function capitalize(text) { var p = text.indexOf(':'); if (p >= 0) return text = text.substring(0, p) + ':' + text[p + 1].toUpperCase() + text.substring(p + 2); return text[0].toUpperCase() + text.substring(1); } function removeNamespace(text) { var p = text.indexOf(':'); if (p < 0) return text; return text.substring(p + 1); } module.exports = { name: normalizeName, value: normalizeValue, valueFromString: normalizeValueFromString, valueToString: normalizeValueToString }
// MAIN.JS - Angular's app bootstrap module module.exports = (function(angular){ var somemodule = require('./ng-some-module'); var app = angular.module('app', [somemodule.name]) .config(['$compileProvider', function ($compileProvider) { $compileProvider.debugInfoEnabled(false); }]) .factory('$runBlock', ['$someService', '$log', function($someService, $log){ $someService.refreshData(); return { init : _ => $log.log('$someService loaded...') }; }]) .run(['$runBlock', function($runBlock){ $runBlock.init(); }]); // manually bootstrap angular app to have better // control for testing. angular.element(document).ready(function() { angular.bootstrap(document, [app.name]); }); return app; })(require('./bootstrap-ui').angular);
// This is a manifest file that'll be compiled into application.js, which will include all the files // listed below. // // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. // // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the // compiled file. // // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details // about supported directives. // //= require jquery //= require jquery_ujs //= require ddlevelsmenu //= require filter //= require html5shiv //= require jquery.carouFredSel-6.2.1-packed //= require jquery.countdown.min //= require jquery.navgoco.min //= require jquery.themepunch.plugins.min //= require jquery.themepunch.revolution.min //= require respond.min //= require twitter/typeahead.min //= require bootstrap //= require line_items //= require product //= require user
var winston = require('winston'); var express = require('express'); var router = express.Router(); var Contact = require('mongoose').model('Contact'); var ObjectId = require('mongoose').Types.ObjectId; router.get('/', function(req, res, next){ }); router.get('/:id', function (req, res, next) { }); router.post('/', function(req, res, next) { }); router.delete('/:id', function(req, res, next) { }); router.patch('/:id', function(req, res, next) { }); module.exports = router; //When calling require('tasks'), we get the router.
Package.describe({ summary:'client side authentication using Firebase', version:'0.0.1', name:'mstn:firebase-accounts' }); Package.onUse(function(api){ api.versionsFrom('1.2'); api.use('ecmascript', 'client'); api.use([ 'mstn:firebase-core', 'mongo', 'templating' ], 'client'); api.addFiles([ 'firebase_accounts_client.js' ], 'client'); });
var AppModule = global.autodafe.AppModule; var Model = global.autodafe.Model; var ModelConstructorProxyHandler = require('./model_constructor_proxy_handler'); var path = require('path'); var fs = require('fs'); module.exports = ModelsManager.inherits( AppModule ); function ModelsManager( params ) { this._init( params ); } ModelsManager.prototype._init = function( params ){ ModelsManager.parent._init.call( this, params ); this._models = {}; }; ModelsManager.prototype.get_model = function( model_name ){ return this._models[ model_name ] || null; }; ModelsManager.prototype.load_models = function ( callback ) { var self = this; var models_path = this.app.path_to_models; this.log( 'Loading models from path: ' + models_path, 'trace' ); try { var files = fs.readdirSync( models_path ); } catch ( e ) { this.log( 'Cannot find models folder. Skip loading models', 'warning' ); return process.nextTick( callback ); } var listener = new global.autodafe.lib.Listener; listener.success( function(){ self.log( 'Models are loaded', 'info' ); callback(); }); for ( var f = 0, f_ln = files.length; f < f_ln; f++ ) { try { var file = files[f]; var file_path = path.join( models_path, file ); var stat = fs.statSync( file_path ); if ( !stat.isFile() ) continue; var model_constructor = require( file_path ); } catch( e ) { this.log( 'Can\'t load model from file: %s'.format( file_path ), 'error' ); return callback( e ); } if (model_constructor.prototype instanceof Model == false) { this.log( 'File in path `%s` is not a model'.format( file_path ), 'warning' ); continue; } var name = path.basename( file_path, '.js' ); try { var model = this._get_model_proxy( model_constructor ); } catch (e) { this.log( 'Model "%s" is not loaded'.format( name ), 'error' ); return callback( e ); } if ( !model.is_inited ) { model.on('ready', model.emit.bind( model, 'success')) listener.handle_emitter( model ); } this._models[ name ] = model; this.log( 'Model "%s" is loaded'.format( name ), 'trace' ); } if ( !listener.count ) { self.log( 'Models are loaded', 'info' ); process.nextTick( callback ); } }; ModelsManager.prototype._get_model_proxy = function ( constructor, params ) { var model_handler = new ModelConstructorProxyHandler({ instance : this._get_instance( constructor, params ) }); return model_handler.get_proxy(); }; ModelsManager.prototype._get_instance = function ( constructor, params ) { params = params || {}; params.app = this.app; return new constructor( params ); }; ModelsManager.prototype.is_model_exist = function( model_name ){ return !!this.get_model( model_name ); }; ModelsManager.prototype.for_each_model = function ( callback, context ) { for( var name in this._models ) { callback.call( context || null, this._models[ name ], name ); } };
var controllerDir; // Get js-controller directory to load libs function getControllerDir() { var fs = require('fs'); // Find the js-controller location var controllerDir = __dirname.replace(/\\/g, '/'); controllerDir = controllerDir.split('/'); if (controllerDir[controllerDir.length - 3] == 'adapter') { controllerDir.splice(controllerDir.length - 3, 3); controllerDir = controllerDir.join('/'); } else if (controllerDir[controllerDir.length - 3] == 'node_modules') { controllerDir.splice(controllerDir.length - 3, 3); controllerDir = controllerDir.join('/'); if (fs.existsSync(controllerDir + '/node_modules/iobroker.js-controller')) { controllerDir += '/node_modules/iobroker.js-controller'; } else if (fs.existsSync(controllerDir + '/node_modules/ioBroker.js-controller')) { controllerDir += '/node_modules/ioBroker.js-controller'; } else if (!fs.existsSync(controllerDir + '/controller.js')) { console.log('Cannot find js-controller'); process.exit(10); } } else { console.log('Cannot find js-controller'); process.exit(10); } return controllerDir; } // Read controller configuration file function getConfig() { var fs = require('fs'); var configFile = controllerDir.splice('/'); // If installed with npm if (fs.existsSync(controllerDir + '/../../node_modules/iobroker.js-controller') || fs.existsSync(controllerDir + '/../../node_modules/ioBroker.js-controller')) { // remove /node_modules/ioBroker.js-controller configFile.splice(configFile.length - 2, 2); configFile = configFile.join('/'); return configFile + '/iobroker-data/iobroker.json'; } else { if (fs.existsSync(controllerDir + '/conf/iobroker.json')) { configFile = controllerDir + '/conf/iobroker.json'; } else { configFile = controllerDir + '/data/iobroker.json'; } } return JSON.parse(fs.readFileSync(configFile)); } // Cache controller dir controllerDir = getControllerDir(); exports.controllerDir = controllerDir; exports.getConfig = getConfig; exports.adapter = require(controllerDir + '/lib/adapter.js');
'use strict'; module.exports = function(app) { var users = require('../../app/controllers/users.server.controller'); var accessoriesPurchaseOrders = require('../../app/controllers/accessories-purchase-orders.server.controller'); // Accessories purchase orders Routes app.route('/accessories-purchase-orders') .get(accessoriesPurchaseOrders.list) .post(users.requiresLogin, accessoriesPurchaseOrders.create); app.route('/accessories-purchase-orders/:accessoriesPurchaseOrderId') .get(accessoriesPurchaseOrders.read) .put(users.requiresLogin, accessoriesPurchaseOrders.hasAuthorization, accessoriesPurchaseOrders.update) .delete(users.requiresLogin, accessoriesPurchaseOrders.hasAuthorization, accessoriesPurchaseOrders.delete); // Finish by binding the Accessories purchase order middleware app.param('accessoriesPurchaseOrderId', accessoriesPurchaseOrders.accessoriesPurchaseOrderByID); };
var http = require('http'); var fs = require('fs'); function listener(request, response) { function send(err, contents) { if (err) { console.error(err); // DON'T DO THIS IN PRODUCTION } else { } } fs.readFile(require.main.filename, send); } var server = http.createServer(listener); server.listen(1337);
// All material copyright ESRI, All Rights Reserved, unless otherwise specified. // See http://js.arcgis.com/3.17/esri/copyright.txt for details. //>>built define("esri/dijit/editing/nls/Editor_az",{"dijit/_editor/nls/commands":{bold:"Qal\u0131n",copy:"K\u00f6\u00e7\u00fcr",cut:"K\u0259s","delete":"Sil",indent:"Girinti",insertHorizontalRule:"\u00dcf\u00fcqi qayda",insertOrderedList:"N\u00f6mr\u0259li siyah\u0131",insertUnorderedList:"\u0130\u015far\u0259l\u0259nmi\u015f siyah\u0131",italic:"\u0130talik",justifyCenter:"Ortaya do\u011frult",justifyFull:"Do\u011frult",justifyLeft:"Sol t\u0259r\u0259f\u0259 Do\u011frult",justifyRight:"Sa\u011fa do\u011frult", outdent:"\u00c7\u0131x\u0131nt\u0131",paste:"Yap\u0131\u015fd\u0131r",redo:"Yenil\u0259",removeFormat:"Format\u0131 Sil",selectAll:"Ham\u0131s\u0131n\u0131 se\u00e7",strikethrough:"\u00dcst\u00fcnd\u0259n x\u0259tt \u00e7\u0259kilmi\u015f",subscript:"Alt i\u015far\u0259",superscript:"\u00dcst i\u015far\u0259",underline:"Alt\u0131x\u0259tli",undo:"Geriy\u0259 al",unlink:"K\u00f6rp\u00fcn\u00fc sil",createLink:"K\u00f6rp\u00fc yarat",toggleDir:"\u0130stiqam\u0259ti d\u0259yi\u015fdir",insertImage:"\u015e\u0259kil \u0259lav\u0259 et", insertTable:"C\u0259dv\u0259l \u0259lav\u0259 et",toggleTableBorder:"C\u0259dv\u0259l k\u0259narlar\u0131n\u0131 g\u00f6st\u0259r/Gizl\u0259t",deleteTable:"C\u0259dv\u0259li sil",tableProp:"C\u0259dv\u0259l x\u00fcsusiyy\u0259tl\u0259ri",htmlToggle:"HTML kodu",foreColor:"\u00d6n plan r\u0259ngi",hiliteColor:"Arxa plan r\u0259ngi",plainFormatBlock:"Abzas stili",formatBlock:"Abzas stili",fontSize:"Yaz\u0131 tipi b\u00f6y\u00fckl\u00fc\u011f\u00fc",fontName:"Yaz\u0131 tipi",tabIndent:"Qulp girintisi", fullScreen:"Tam ekran a\u00e7",viewSource:"HTML qaynaq kodunu g\u00f6st\u0259r",print:"Yazd\u0131r",newPage:"Yeni s\u0259hif\u0259",systemShortcut:'"${0}" prosesi yaln\u0131z printerinizd\u0259 klaviatura q\u0131sayolu il\u0259 istifad\u0259 oluna bil\u0259r. Bundan istifad\u0259 edin',ctrlKey:"ctrl+${0}",appleKey:"\u2318${0}",_localized:{}},"dijit/form/nls/ComboBox":{previousMessage:"\u018fvv\u0259lki variantlar",nextMessage:"Ba\u015fqa variantlar",_localized:{}},"dojo/cldr/nls/islamic":{"dateFormatItem-Ehm":"E h:mm a", "days-standAlone-short":"Sun Mon Tue Wed Thu Fri Sat".split(" "),"months-format-narrow":"1 2 3 4 5 6 7 8 9 10 11 12".split(" "),"field-second-relative+0":"now","quarters-standAlone-narrow":["1","2","3","4"],"field-weekday":"Day of the Week","field-wed-relative+0":"this Wednesday","field-wed-relative+1":"next Wednesday","dateFormatItem-GyMMMEd":"G y MMM d, E","dateFormatItem-MMMEd":"MMM d, E",eraNarrow:["AH"],"field-tue-relative+-1":"last Tuesday","days-format-short":"Sun Mon Tue Wed Thu Fri Sat".split(" "), "dateTimeFormats-appendItem-Day-Of-Week":"{0} {1}","dateFormat-long":"G y MMMM d","field-fri-relative+-1":"last Friday","field-wed-relative+-1":"last Wednesday","months-format-wide":"Muharram;Safar;Rabi\u02bb I;Rabi\u02bb II;Jumada I;Jumada II;Rajab;Sha\u02bbban;Ramadan;Shawwal;Dhu\u02bbl-Qi\u02bbdah;Dhu\u02bbl-Hijjah".split(";"),"dateFormatItem-yyyyQQQ":"G y QQQ","dateTimeFormat-medium":"{1} {0}","dayPeriods-format-wide-pm":"PM","dateFormat-full":"G y MMMM d, EEEE","dateFormatItem-yyyyMEd":"GGGGG y-MM-dd, E", "field-thu-relative+-1":"last Thursday","dateFormatItem-Md":"MM-dd","dayPeriods-format-abbr-am":"AM","dateTimeFormats-appendItem-Second":"{0} ({2}: {1})","dayPeriods-format-wide-noon":"noon","field-era":"Era","months-standAlone-wide":"Muharram;Safar;Rabi\u02bb I;Rabi\u02bb II;Jumada I;Jumada II;Rajab;Sha\u02bbban;Ramadan;Shawwal;Dhu\u02bbl-Qi\u02bbdah;Dhu\u02bbl-Hijjah".split(";"),"timeFormat-short":"HH:mm","quarters-format-wide":["Q1","Q2","Q3","Q4"],"timeFormat-long":"HH:mm:ss z","field-year":"Year", "dateTimeFormats-appendItem-Era":"{1} {0}","field-hour":"Hour","months-format-abbr":"Muh.;Saf.;Rab. I;Rab. II;Jum. I;Jum. II;Raj.;Sha.;Ram.;Shaw.;Dhu\u02bbl-Q.;Dhu\u02bbl-H.".split(";"),"field-sat-relative+0":"this Saturday","field-sat-relative+1":"next Saturday","timeFormat-full":"HH:mm:ss zzzz","dateTimeFormats-appendItem-Week":"{0} ({2}: {1})","field-day-relative+0":"today","field-thu-relative+0":"this Thursday","field-day-relative+1":"tomorrow","field-thu-relative+1":"next Thursday","dateFormatItem-GyMMMd":"G y MMM d", "dateFormatItem-H":"HH","months-standAlone-abbr":"Muh.;Saf.;Rab. I;Rab. II;Jum. I;Jum. II;Raj.;Sha.;Ram.;Shaw.;Dhu\u02bbl-Q.;Dhu\u02bbl-H.".split(";"),"quarters-format-abbr":["Q1","Q2","Q3","Q4"],"quarters-standAlone-wide":["Q1","Q2","Q3","Q4"],"dateFormatItem-Gy":"G y","dateFormatItem-yyyyMMMEd":"G y MMM d, E","dateFormatItem-M":"L","days-standAlone-wide":"Sun Mon Tue Wed Thu Fri Sat".split(" "),"dateFormatItem-yyyyMMM":"G y MMM","dateFormatItem-yyyyMMMd":"G y MMM d","dayPeriods-format-abbr-noon":"noon", "timeFormat-medium":"HH:mm:ss","field-sun-relative+0":"this Sunday","dateFormatItem-Hm":"HH:mm","field-sun-relative+1":"next Sunday","quarters-standAlone-abbr":["Q1","Q2","Q3","Q4"],eraAbbr:["AH"],"field-minute":"Minute","field-dayperiod":"Dayperiod","days-standAlone-abbr":"Sun Mon Tue Wed Thu Fri Sat".split(" "),"dateFormatItem-d":"d","dateFormatItem-ms":"mm:ss","quarters-format-narrow":["1","2","3","4"],"field-day-relative+-1":"yesterday","dateTimeFormat-long":"{1} {0}","dayPeriods-format-narrow-am":"a", "dateFormatItem-h":"h a","dateFormatItem-MMMd":"MMM d","dateFormatItem-MEd":"MM-dd, E","dateTimeFormat-full":"{1} {0}","field-fri-relative+0":"this Friday","field-fri-relative+1":"next Friday","field-day":"Day","days-format-wide":"Sun Mon Tue Wed Thu Fri Sat".split(" "),"field-zone":"Zone","months-standAlone-narrow":"1 2 3 4 5 6 7 8 9 10 11 12".split(" "),"dateFormatItem-y":"G y","dateTimeFormats-appendItem-Day":"{0} ({2}: {1})","field-year-relative+-1":"last year","field-month-relative+-1":"last month", "dateTimeFormats-appendItem-Year":"{1} {0}","dateFormatItem-hm":"h:mm a","dateTimeFormats-appendItem-Hour":"{0} ({2}: {1})","dayPeriods-format-abbr-pm":"PM","days-format-abbr":"Sun Mon Tue Wed Thu Fri Sat".split(" "),eraNames:["AH"],"days-format-narrow":"SMTWTFS".split(""),"dateFormatItem-yyyyMd":"GGGGG y-MM-dd","field-month":"Month","days-standAlone-narrow":"SMTWTFS".split(""),"dateFormatItem-MMM":"LLL","field-tue-relative+0":"this Tuesday","field-tue-relative+1":"next Tuesday","dateTimeFormats-appendItem-Quarter":"{0} ({2}: {1})", "dayPeriods-format-wide-am":"AM","dateTimeFormats-appendItem-Month":"{0} ({2}: {1})","dateTimeFormats-appendItem-Minute":"{0} ({2}: {1})","dateFormatItem-EHm":"E HH:mm","field-mon-relative+0":"this Monday","field-mon-relative+1":"next Monday","dateFormat-short":"GGGGG y-MM-dd","dateFormatItem-EHms":"E HH:mm:ss","dateFormatItem-Ehms":"E h:mm:ss a","dayPeriods-format-narrow-noon":"n","field-second":"Second","field-sat-relative+-1":"last Saturday","field-sun-relative+-1":"last Sunday","field-month-relative+0":"this month", "field-month-relative+1":"next month","dateTimeFormats-appendItem-Timezone":"{0} {1}","dateFormatItem-Ed":"d, E","field-week":"Week","dateFormat-medium":"G y MMM d","field-week-relative+-1":"last week","field-year-relative+0":"this year","dateFormatItem-yyyyM":"GGGGG y-MM","field-year-relative+1":"next year","dayPeriods-format-narrow-pm":"p","dateFormatItem-yyyyQQQQ":"G y QQQQ","dateTimeFormat-short":"{1} {0}","dateFormatItem-Hms":"HH:mm:ss","dateFormatItem-hms":"h:mm:ss a","dateFormatItem-GyMMM":"G y MMM", "field-mon-relative+-1":"last Monday","dateFormatItem-yyyy":"G y","field-week-relative+0":"this week","field-week-relative+1":"next week",_localized:{}}});
Package.describe({ name: 'colinligertwood:backbone-events', version: '1.2.3', summary: 'A module that can be mixed in to *any object* in order to provide it with a custom event channel.', git: 'https://github.com/colinligertwood/meteor-backbone-events.git', documentation: 'README.md' }); Package.onUse(function(api) { api.versionsFrom('1.0.3.1'); api.addFiles('backbone.events.js'); api.export('Events', ['server','client']); });
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _stylePropable = require('../mixins/style-propable'); var _stylePropable2 = _interopRequireDefault(_stylePropable); var _windowListenable = require('../mixins/window-listenable'); var _windowListenable2 = _interopRequireDefault(_windowListenable); var _dateTime = require('../utils/date-time'); var _dateTime2 = _interopRequireDefault(_dateTime); var _keyCode = require('../utils/key-code'); var _keyCode2 = _interopRequireDefault(_keyCode); var _transitions = require('../styles/transitions'); var _transitions2 = _interopRequireDefault(_transitions); var _calendarMonth = require('./calendar-month'); var _calendarMonth2 = _interopRequireDefault(_calendarMonth); var _calendarYear = require('./calendar-year'); var _calendarYear2 = _interopRequireDefault(_calendarYear); var _calendarToolbar = require('./calendar-toolbar'); var _calendarToolbar2 = _interopRequireDefault(_calendarToolbar); var _dateDisplay = require('./date-display'); var _dateDisplay2 = _interopRequireDefault(_dateDisplay); var _slideIn = require('../transition-groups/slide-in'); var _slideIn2 = _interopRequireDefault(_slideIn); var _clearfix = require('../clearfix'); var _clearfix2 = _interopRequireDefault(_clearfix); var _themeManager = require('../styles/theme-manager'); var _themeManager2 = _interopRequireDefault(_themeManager); var _lightRawTheme = require('../styles/raw-themes/light-raw-theme'); var _lightRawTheme2 = _interopRequireDefault(_lightRawTheme); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var Calendar = _react2.default.createClass({ displayName: 'Calendar', propTypes: { DateTimeFormat: _react2.default.PropTypes.func.isRequired, disableYearSelection: _react2.default.PropTypes.bool, initialDate: _react2.default.PropTypes.object, locale: _react2.default.PropTypes.string.isRequired, maxDate: _react2.default.PropTypes.object, minDate: _react2.default.PropTypes.object, mode: _react2.default.PropTypes.oneOf(['portrait', 'landscape']), onDayTouchTap: _react2.default.PropTypes.func, open: _react2.default.PropTypes.bool, shouldDisableDate: _react2.default.PropTypes.func }, contextTypes: { muiTheme: _react2.default.PropTypes.object }, //for passing default theme context to children childContextTypes: { muiTheme: _react2.default.PropTypes.object }, mixins: [_stylePropable2.default, _windowListenable2.default], getDefaultProps: function getDefaultProps() { return { disableYearSelection: false, initialDate: new Date(), minDate: _dateTime2.default.addYears(new Date(), -100), maxDate: _dateTime2.default.addYears(new Date(), 100) }; }, getInitialState: function getInitialState() { return { muiTheme: this.context.muiTheme ? this.context.muiTheme : _themeManager2.default.getMuiTheme(_lightRawTheme2.default), displayDate: _dateTime2.default.getFirstDayOfMonth(this.props.initialDate), displayMonthDay: true, selectedDate: this.props.initialDate, transitionDirection: 'left', transitionEnter: true }; }, getChildContext: function getChildContext() { return { muiTheme: this.state.muiTheme }; }, //to update theme inside state whenever a new theme is passed down //from the parent / owner using context componentWillReceiveProps: function componentWillReceiveProps(nextProps, nextContext) { var newMuiTheme = nextContext.muiTheme ? nextContext.muiTheme : this.state.muiTheme; this.setState({ muiTheme: newMuiTheme }); if (nextProps.initialDate !== this.props.initialDate) { var d = nextProps.initialDate || new Date(); this.setState({ displayDate: _dateTime2.default.getFirstDayOfMonth(d), selectedDate: d }); } }, windowListeners: { keydown: '_handleWindowKeyDown' }, _yearSelector: function _yearSelector() { if (this.props.disableYearSelection) return; return _react2.default.createElement(_calendarYear2.default, { key: 'years', displayDate: this.state.displayDate, onYearTouchTap: this._handleYearTouchTap, selectedDate: this.state.selectedDate, minDate: this.props.minDate, maxDate: this.props.maxDate }); }, getSelectedDate: function getSelectedDate() { return this.state.selectedDate; }, isSelectedDateDisabled: function isSelectedDateDisabled() { if (!this.state.displayMonthDay) { return false; } return this.refs.calendar.isSelectedDateDisabled(); }, _addSelectedDays: function _addSelectedDays(days) { this._setSelectedDate(_dateTime2.default.addDays(this.state.selectedDate, days)); }, _addSelectedMonths: function _addSelectedMonths(months) { this._setSelectedDate(_dateTime2.default.addMonths(this.state.selectedDate, months)); }, _addSelectedYears: function _addSelectedYears(years) { this._setSelectedDate(_dateTime2.default.addYears(this.state.selectedDate, years)); }, _setDisplayDate: function _setDisplayDate(d, newSelectedDate) { var newDisplayDate = _dateTime2.default.getFirstDayOfMonth(d); var direction = newDisplayDate > this.state.displayDate ? 'left' : 'right'; if (newDisplayDate !== this.state.displayDate) { this.setState({ displayDate: newDisplayDate, transitionDirection: direction, selectedDate: newSelectedDate || this.state.selectedDate }); } }, _setSelectedDate: function _setSelectedDate(date) { var adjustedDate = date; if (_dateTime2.default.isBeforeDate(date, this.props.minDate)) { adjustedDate = this.props.minDate; } else if (_dateTime2.default.isAfterDate(date, this.props.maxDate)) { adjustedDate = this.props.maxDate; } var newDisplayDate = _dateTime2.default.getFirstDayOfMonth(adjustedDate); if (newDisplayDate !== this.state.displayDate) { this._setDisplayDate(newDisplayDate, adjustedDate); } else { this.setState({ selectedDate: adjustedDate }); } }, _handleDayTouchTap: function _handleDayTouchTap(e, date) { this._setSelectedDate(date); if (this.props.onDayTouchTap) this.props.onDayTouchTap(e, date); }, _handleMonthChange: function _handleMonthChange(months) { this.setState({ transitionDirection: months >= 0 ? 'left' : 'right', displayDate: _dateTime2.default.addMonths(this.state.displayDate, months) }); }, _handleYearTouchTap: function _handleYearTouchTap(e, year) { var date = _dateTime2.default.clone(this.state.selectedDate); date.setFullYear(year); this._setSelectedDate(date, e); }, _getToolbarInteractions: function _getToolbarInteractions() { return { prevMonth: _dateTime2.default.monthDiff(this.state.displayDate, this.props.minDate) > 0, nextMonth: _dateTime2.default.monthDiff(this.state.displayDate, this.props.maxDate) < 0 }; }, _handleMonthDayClick: function _handleMonthDayClick() { this.setState({ displayMonthDay: true }); }, _handleYearClick: function _handleYearClick() { this.setState({ displayMonthDay: false }); }, _handleWindowKeyDown: function _handleWindowKeyDown(e) { if (this.props.open) { switch (e.keyCode) { case _keyCode2.default.UP: if (e.altKey && e.shiftKey) { this._addSelectedYears(-1); } else if (e.shiftKey) { this._addSelectedMonths(-1); } else { this._addSelectedDays(-7); } break; case _keyCode2.default.DOWN: if (e.altKey && e.shiftKey) { this._addSelectedYears(1); } else if (e.shiftKey) { this._addSelectedMonths(1); } else { this._addSelectedDays(7); } break; case _keyCode2.default.RIGHT: if (e.altKey && e.shiftKey) { this._addSelectedYears(1); } else if (e.shiftKey) { this._addSelectedMonths(1); } else { this._addSelectedDays(1); } break; case _keyCode2.default.LEFT: if (e.altKey && e.shiftKey) { this._addSelectedYears(-1); } else if (e.shiftKey) { this._addSelectedMonths(-1); } else { this._addSelectedDays(-1); } break; } } }, render: function render() { var yearCount = _dateTime2.default.yearDiff(this.props.maxDate, this.props.minDate) + 1; var weekCount = _dateTime2.default.getWeekArray(this.state.displayDate).length; var toolbarInteractions = this._getToolbarInteractions(); var isLandscape = this.props.mode === 'landscape'; var styles = { root: { fontSize: 12 }, calendarContainer: { width: isLandscape ? 320 : '100%', height: weekCount === 5 ? 284 : weekCount === 6 ? 324 : 244, float: isLandscape ? 'right' : 'none', transition: _transitions2.default.easeOut('150ms', 'height'), overflow: 'hidden' }, yearContainer: { width: 280, overflow: 'hidden', height: yearCount < 6 ? yearCount * 56 + 10 : weekCount === 5 ? 284 : weekCount === 6 ? 324 : 244, float: isLandscape ? 'right' : 'none' }, dateDisplay: { width: isLandscape ? 120 : '', height: isLandscape ? weekCount === 5 ? 238 : weekCount === 6 ? 278 : 198 : 'auto', float: isLandscape ? 'left' : 'none' }, weekTitle: { padding: '0 14px', lineHeight: '12px', opacity: '0.5', height: 12, fontWeight: '500', margin: 0 }, weekTitleDay: { listStyle: 'none', float: 'left', width: 37, textAlign: 'center', margin: '0 2px' } }; var weekTitleDayStyle = this.prepareStyles(styles.weekTitleDay); var _props = this.props; var DateTimeFormat = _props.DateTimeFormat; var locale = _props.locale; return _react2.default.createElement( _clearfix2.default, { style: this.mergeStyles(styles.root) }, _react2.default.createElement(_dateDisplay2.default, { DateTimeFormat: DateTimeFormat, locale: locale, disableYearSelection: this.props.disableYearSelection, style: styles.dateDisplay, selectedDate: this.state.selectedDate, handleMonthDayClick: this._handleMonthDayClick, handleYearClick: this._handleYearClick, monthDaySelected: this.state.displayMonthDay, mode: this.props.mode, weekCount: weekCount }), this.state.displayMonthDay && _react2.default.createElement( 'div', { style: this.prepareStyles(styles.calendarContainer) }, _react2.default.createElement(_calendarToolbar2.default, { DateTimeFormat: DateTimeFormat, locale: locale, displayDate: this.state.displayDate, onMonthChange: this._handleMonthChange, prevMonth: toolbarInteractions.prevMonth, nextMonth: toolbarInteractions.nextMonth }), _react2.default.createElement( _clearfix2.default, { elementType: 'ul', style: styles.weekTitle }, _react2.default.createElement( 'li', { style: weekTitleDayStyle }, 'S' ), _react2.default.createElement( 'li', { style: weekTitleDayStyle }, 'M' ), _react2.default.createElement( 'li', { style: weekTitleDayStyle }, 'T' ), _react2.default.createElement( 'li', { style: weekTitleDayStyle }, 'W' ), _react2.default.createElement( 'li', { style: weekTitleDayStyle }, 'T' ), _react2.default.createElement( 'li', { style: weekTitleDayStyle }, 'F' ), _react2.default.createElement( 'li', { style: weekTitleDayStyle }, 'S' ) ), _react2.default.createElement( _slideIn2.default, { direction: this.state.transitionDirection }, _react2.default.createElement(_calendarMonth2.default, { key: this.state.displayDate.toDateString(), ref: 'calendar', displayDate: this.state.displayDate, onDayTouchTap: this._handleDayTouchTap, selectedDate: this.state.selectedDate, minDate: this.props.minDate, maxDate: this.props.maxDate, shouldDisableDate: this.props.shouldDisableDate }) ) ), !this.state.displayMonthDay && _react2.default.createElement( 'div', { style: this.prepareStyles(styles.yearContainer) }, this._yearSelector() ) ); } }); exports.default = Calendar; module.exports = exports['default'];
define(['backbone', 'd3', 'js/utils'], function(Backbone, d3, utils) { "use strict"; var Views = {}; Views.TimerView = Backbone.View.extend({ initialize: function() { this.model = null; this._interval = null; this._renderTitle = false; this.render(); _.bindAll(this, 'render', 'startTicking'); }, /** * Starts ticking the timer, updating it every second. */ startRunning: function(pomodoro) { this.model = pomodoro; setTimeout(this.startTicking, 50); }, /** * Accurate timer hack. * * If we start the setInterval at the exact same time * we start the pomodoro, the lack of accuracy of * the setTimeout function will create an irregularity * in the timer rendering. * * Hence, we wait a short time before starting the loop, * so every time the `render` method is called, we are sure * a different timer value will be displayed. */ startTicking: function() { this.render(); clearInterval(this._interval); this._interval = setInterval(this.render, 1000); }, /** * Stops the timer ticks. */ stopRunning: function() { clearInterval(this._interval); this.model = null; this.render(); }, render: function() { var time; if (this.model) { var remainingTime = this.model.remainingTime(); time = utils.prettifyTime(remainingTime); } else { time = '00:00'; } this.$el.text(time); if (this._renderTitle) { $('title').text(time); } else { $('title').text('Pomodoro'); } return this; } }); Views.ControlView = Backbone.View.extend({ events: { 'click button': 'onClick' }, initialize: function() { this.render(); }, renderForPomodoro: function(pomodoro) { this.model = pomodoro; this.render(); }, resetView: function() { this.model = null; this.render(); }, /** * Disable the control buttons depending of the state of the * current pomodoro. */ render: function() { var startButtons = this.$el.find('button.start-control'); var stopButton = this.$el.find('button.stop-control'); if (this.model) { startButtons.prop('disabled', true); stopButton.prop('disabled', false); } else { startButtons.prop('disabled', false); stopButton.prop('disabled', true); } return this; }, /** * Trigger events depending on clicked buttons. */ onClick: function(event) { var target = event.target; var action = target.getAttribute('data-action'); var type = target.getAttribute('data-type'); if (action === 'stop') { this.trigger('timerInterrupted'); } else { var duration = target.getAttribute('data-duration'); this.trigger('timerStarted', { duration: duration, type: type }); } } }); /** * Updates the app configuration when the form is modified. */ Views.ConfigurationView = Backbone.View.extend({ events: { 'change': 'onConfigurationChange', 'click input[type=checkbox]': 'toggleTitle' }, buttons: [ { field: '#pomodoro-duration', button: '#start-pomodoro-btn', option: 'pomodoroDuration' }, { field: '#break-duration', button: '#start-break-btn', option: 'breakDuration' }, { field: '#lbreak-duration', button: '#start-lbreak-btn', option: 'lbreakDuration' }, ], initialize: function() { this.dynamicTitleCb = this.$el.find('#dynamicTitleCb'); this.updateConfigurationForm(); this.updateTimerButtons(); }, /** * Set configuration form default values to current * configuration values. */ updateConfigurationForm: function() { this.dynamicTitleCb.prop('checked', this.model.get('dynamicTitleEnabled')); var model = this.model; _.each(this.buttons, function(data) { var field = $(data.field); var value = model.get(data.option) / 60000; field.val(value); }); }, /** * Set the data-duration attributes on timer buttons. */ updateTimerButtons: function() { var model = this.model; _.each(this.buttons, function(data) { var button = $(data.button); var value = model.get(data.option); button.attr('data-duration', value); }); }, /** * Updates the configuration model object with data from the * configuration form. */ onConfigurationChange: function() { this.model.set('dynamicTitleEnabled', this.isTitleDynamic()); var model = this.model; _.each(this.buttons, function(data) { var field = $(data.field); var value = field.val() * 60000; model.set(data.option, value); }); this.updateTimerButtons(); this.trigger('configurationChanged'); }, toggleTitle: function() { this.trigger('dynamicTitleToggled'); }, isTitleDynamic: function() { return this.dynamicTitleCb.prop('checked'); } }); /** * Display a wonderful chart of pomodoro counts. */ Views.ChartView = Backbone.View.extend({ initialize: function(options) { this.initializeChart(); // Required options for this view var chartOptions = ['interval', 'dateFormat', 'dataProvider']; _.extend(this, _.pick(options, chartOptions)); _.bindAll(this, 'render'); this.listenTo(this.collection, 'add', this.render); this.listenTo(this.collection, 'change', this.render); }, /** * Creates the initial svg structure for the chart. */ initializeChart: function() { this.margin = {top: 20, right: 20, bottom: 100, left: 80}; this.width = this.$el.width() - this.margin.left - this.margin.right; this.height = 200; this.barHeight = 25; this.rootSvg = d3.select(this.el).append("svg") .attr('class', 'chart') .attr("width", this.$el.width()) .attr("height", 300); this.svg = this.rootSvg .append("g") .attr("transform", "translate(" + this.margin.left + "," + this.margin.top + ")"); this.xAxis = this.svg.append("g") .attr("class", "x axis"); this.yAxis = this.svg.append("g") .attr("class", "y axis"); }, /** * Generates the chart svg structure. */ getScales: function(data) { var xDomain = [0, d3.max(data, function(d) { return d.pomodoros; })]; var x = d3.scale.linear() .domain(xDomain) .range([0, this.width]); var yDomain = data.map(function(d) { return d.date; }); var y = d3.scale.ordinal() .domain(yDomain) .rangeRoundBands([this.height, 0]); return {x: x, y: y}; }, /** * Get X and Y axis. */ getAxes: function(data, scales) { var maxPomodoros = (d3.max(data, function(d) { return d.pomodoros; })); var xTicks = d3.min(20, maxPomodoros); var xAxis = d3.svg.axis() .scale(scales.x) .tickFormat(d3.format("d")) .ticks(xTicks) .orient("top"); var format = d3.time.format(this.dateFormat); var yAxis = d3.svg.axis() .scale(scales.y) .tickFormat(function(d) { return format(d); }) .orient("left"); return {x: xAxis, y: yAxis}; }, /** * Render the axes on the chart. */ renderAxes: function(axes) { //this.xAxis // .transition() // .duration(1000) // .call(axes.x); this.yAxis .transition() .duration(1000) .call(axes.y); //this.yAxis.selectAll("text") // .style("text-anchor", "end") // .attr("dx", "-.8em") // .attr("dy", ".15em") // .attr("transform", function(d) { // return "rotate(-30)"; // }); }, /** * Display data on the chart. */ renderData: function(data, scales) { var that = this; var bars = this.svg.selectAll('g.bar') .data(data, function(d) { return d.date; }); bars.enter().append('g') .attr("class", "bar") .attr("transform", function(d, i) { return "translate(2," + scales.y(d.date) + ")"; }) .each(function(d) { d3.select(this).append("rect") .attr("height", that.barHeight - 2) .attr("width", 0); d3.select(this).append("text") .attr("x", function(d) { return 0; }) .attr("y", function(d) { return that.barHeight / 2; }) .attr("dy", ".35em"); }); bars.select('rect').transition() .duration(1000) .attr("width", function(d) { return scales.x(d.pomodoros); }); bars.select('text') .text(function(d) { return d.pomodoros > 0 ? d.pomodoros : ''; }) .transition() .duration(1000) .attr("x", function(d) { return scales.x(d.pomodoros) + 3; }); }, updateHeight: function(data) { this.height = this.barHeight * data.length; this.$el.css("height", this.height); this.rootSvg.attr("height", this.height); }, render: function() { var data = this.dataProvider.getData(); this.updateHeight(data); var scales = this.getScales(data); var axes = this.getAxes(data, scales); this.renderAxes(axes); this.renderData(data, scales); return this; } }); /** * Display a wonderful pie with pomodoros data */ Views.PieView = Backbone.View.extend({ initialize: function(options) { this.initializePie(); // Required options for this view var pieOptions = ['interval', 'dateFormat', 'dataProvider']; _.extend(this, _.pick(options, pieOptions)); _.bindAll(this, 'render'); this.listenTo(this.collection, 'add', this.render); this.listenTo(this.collection, 'change', this.render); }, /** * Creates the initial svg structure for the chart. */ initializePie: function() { this.margin = {top: 20, right: 20, bottom: 100, left: 20}; var width = this.$el.width() - this.margin.left - this.margin.right; var height = this.$el.height() - this.margin.top - this.margin.bottom; this.radius = Math.min(width, height)/ 2; this.color = d3.scale.category20(); this.pie = d3.layout.pie() .value(function(d) { return d.count; }) .sort(null); this.arc = d3.svg.arc() .outerRadius(this.radius) .innerRadius(this.radius - 40); this.svg = d3.select(this.el).append("svg") .attr('class', 'chart') .attr("width", this.$el.width()) .attr("height", this.$el.height()) .append("g") .attr("transform", "translate(" + this.margin.left + "," + this.margin.top + ")"); this.piesvg = this.svg.append("g") .attr('class', 'pie') .attr("transform", "translate(" + this.$el.width() / 2 + "," + this.$el.height() / 2 + ")"); this.piesvg.append("text") .attr("dy", ".35em") .style("text-anchor", "middle") .text('Projects'); }, /** * Display data on the chart. */ renderData: function(data) { var that = this; var path = this.piesvg.datum(data).selectAll('path') .data(this.pie); path.enter() .append('path') .attr("fill", function(d, i) { return that.color(i); }) .attr("d", that.arc) .each(function(d) { this._current = d; }); path.exit() .remove(); var arcTween = function(a) { var i = d3.interpolate(this._current, a); this._current = i(0); return function(t) { return that.arc(i(t)); }; }; path.transition() .duration(1000) .attrTween("d", arcTween); }, renderLegend: function(data) { var that = this; var legendArc = d3.svg.arc() .innerRadius(this.radius + 35) .outerRadius(this.radius + 35); var legend = this.piesvg.datum(data).selectAll('text.legend') .data(this.pie); legend.enter() .append('text') .attr("dy", ".35em") .attr("text-anchor", "middle") .attr('class', 'legend') .attr("transform", function(d) { return "translate(" + legendArc.centroid(d) + ")"; }); legend.exit() .remove(); legend .text(function(d) { return d.data.project; }) .transition() .duration(1000) .attr("transform", function(d) { return "translate(" + legendArc.centroid(d) + ")"; }); }, render: function() { var data = this.dataProvider.getProjectsData(); this.renderLegend(data); this.renderData(data); return this; } }); Views.AnnotationView = Backbone.View.extend({ events: { 'submit': 'annotatePomodoro' }, initialize: function() { this.input = this.$el.find('input[type="text"]'); }, annotatePomodoro: function(event) { event.preventDefault(); var pomodoro = this.collection.last(); var annotation = this.input.val(); if (pomodoro && annotation) { var project = utils.extractProject(annotation); pomodoro.set('project', project); var tags = utils.extractTags(annotation); pomodoro.set('tags', tags); pomodoro.save(); } this.hide(); }, show: function() { this.$el.slideDown(); }, hide: function() { this.input.val(''); this.$el.slideUp(); } }); return Views; });
angular.module('option', [ 'filter.i18n', 'service.storage', 'service.setting' ]) .config(function() { }) .controller('optionController', function($rootScope, $scope, appSetting) { appSetting.bind('ready', function() { $scope.setting = $.extend(true, {}, appSetting.data); switch(window.navigator.platform) { case 'MacIntel': $scope.setting.ctrlKey = 'Command'; break; default: $scope.setting.ctrlKey = 'Alt'; break; } $scope.saveAndClose = function() { appSetting.set($scope.setting) .then(function() { window.close(); }); }; $scope.setDefault = function() { $scope.setting = $.extend(true, {}, appSetting.default); }; $scope.$watch('setting', function(newValue, oldValue) { //if(newValue === oldValue) return; if(newValue.hotKeySimple == newValue.hotKeyEntire || newValue.hotKeySimple == newValue.hotKeySmart || newValue.hotKeySmart == newValue.hotKeyEntire) { //$scope.error = 'Duplicate Hot Key.' $scope.error = chrome.i18n.getMessage('errorDuplicate'); } else { $scope.error = ''; } }, true); $scope.error = ''; }); }) .run(function() { });
import Component from '../timeseries-legend-line-icon'; import TestFunctions from './__test-functions__'; describe('TimeseriesLegendLineIcon', () => { TestFunctions.isOfExpectedType(Component, 'g', 'timeseries-legend-line-icon'); TestFunctions.hasExpectedDefaultProps(Component, { height: 0, style: {}, width: 0, }); TestFunctions.hasExpectedInitialState(Component, { centerX: 0, centerY: 0, radius: 0, }); });
(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = global || self, factory(global.window = global.window || {})); }(this, (function (exports) { 'use strict'; /*! * ScrollToPlugin 3.0.3 * https://greensock.com * * @license Copyright 2008-2019, GreenSock. All rights reserved. * Subject to the terms at https://greensock.com/standard-license or for * Club GreenSock members, the agreement issued with that membership. * @author: Jack Doyle, jack@greensock.com */ var gsap, _coreInitted, _window, _docEl, _body, _toArray, _config, _windowExists = function _windowExists() { return typeof window !== "undefined"; }, _getGSAP = function _getGSAP() { return gsap || _windowExists() && (gsap = window.gsap) && gsap.registerPlugin && gsap; }, _isString = function _isString(value) { return typeof value === "string"; }, _max = function _max(element, axis) { var dim = axis === "x" ? "Width" : "Height", scroll = "scroll" + dim, client = "client" + dim; return element === _window || element === _docEl || element === _body ? Math.max(_docEl[scroll], _body[scroll]) - (_window["inner" + dim] || _docEl[client] || _body[client]) : element[scroll] - element["offset" + dim]; }, _buildGetter = function _buildGetter(e, axis) { var p = "scroll" + (axis === "x" ? "Left" : "Top"); if (e === _window) { if (e.pageXOffset != null) { p = "page" + axis.toUpperCase() + "Offset"; } else { e = _docEl[p] != null ? _docEl : _body; } } return function () { return e[p]; }; }, _getOffset = function _getOffset(element, container) { var rect = _toArray(element)[0].getBoundingClientRect(), isRoot = !container || container === _window || container === _body, cRect = isRoot ? { top: _docEl.clientTop - (_window.pageYOffset || _docEl.scrollTop || _body.scrollTop || 0), left: _docEl.clientLeft - (_window.pageXOffset || _docEl.scrollLeft || _body.scrollLeft || 0) } : container.getBoundingClientRect(), offsets = { x: rect.left - cRect.left, y: rect.top - cRect.top }; if (!isRoot && container) { offsets.x += _buildGetter(container, "x")(); offsets.y += _buildGetter(container, "y")(); } return offsets; }, _parseVal = function _parseVal(value, target, axis, currentVal) { return !isNaN(value) ? parseFloat(value) : _isString(value) && value.charAt(1) === "=" ? parseFloat(value.substr(2)) * (value.charAt(0) === "-" ? -1 : 1) + currentVal : value === "max" ? _max(target, axis) : Math.min(_max(target, axis), _getOffset(value, target)[axis]); }, _initCore = function _initCore() { gsap = _getGSAP(); if (_windowExists() && gsap && document.body) { _window = window; _body = document.body; _docEl = document.documentElement; _toArray = gsap.utils.toArray; gsap.config({ autoKillThreshold: 7 }); _config = gsap.config(); _coreInitted = 1; } }; var ScrollToPlugin = { version: "3.0.3", name: "scrollTo", rawVars: 1, register: function register(core) { gsap = core; _initCore(); }, init: function init(target, value, tween, index, targets) { if (!_coreInitted) { _initCore(); } var data = this; data.isWin = target === _window; data.target = target; data.tween = tween; if (typeof value !== "object") { value = { y: value }; if (_isString(value.y) && value.y !== "max" && value.y.charAt(1) !== "=") { value.x = value.y; } } else if (value.nodeType) { value = { y: value, x: value }; } data.vars = value; data.autoKill = !!value.autoKill; data.getX = _buildGetter(target, "x"); data.getY = _buildGetter(target, "y"); data.x = data.xPrev = data.getX(); data.y = data.yPrev = data.getY(); if (value.x != null) { data.add(data, "x", data.x, _parseVal(value.x, target, "x", data.x) - (value.offsetX || 0), index, targets, Math.round); data._props.push("scrollTo_x"); } else { data.skipX = 1; } if (value.y != null) { data.add(data, "y", data.y, _parseVal(value.y, target, "y", data.y) - (value.offsetY || 0), index, targets, Math.round); data._props.push("scrollTo_y"); } else { data.skipY = 1; } }, render: function render(ratio, data) { var pt = data._pt, target = data.target, tween = data.tween, autoKill = data.autoKill, xPrev = data.xPrev, yPrev = data.yPrev, isWin = data.isWin, x, y, yDif, xDif, threshold; while (pt) { pt.r(ratio, pt.d); pt = pt._next; } x = isWin || !data.skipX ? data.getX() : xPrev; y = isWin || !data.skipY ? data.getY() : yPrev; yDif = y - yPrev; xDif = x - xPrev; threshold = _config.autoKillThreshold; if (data.x < 0) { data.x = 0; } if (data.y < 0) { data.y = 0; } if (autoKill) { if (!data.skipX && (xDif > threshold || xDif < -threshold) && x < _max(target, "x")) { data.skipX = 1; } if (!data.skipY && (yDif > threshold || yDif < -threshold) && y < _max(target, "y")) { data.skipY = 1; } if (data.skipX && data.skipY) { tween.kill(); if (data.vars.onAutoKill) { data.vars.onAutoKill.apply(tween, data.vars.onAutoKillParams || []); } } } if (isWin) { _window.scrollTo(!data.skipX ? data.x : x, !data.skipY ? data.y : y); } else { if (!data.skipY) { target.scrollTop = data.y; } if (!data.skipX) { target.scrollLeft = data.x; } } data.xPrev = data.x; data.yPrev = data.y; }, kill: function kill(property) { var both = property === "scrollTo"; if (both || property === "scrollTo_x") { this.skipX = 1; } if (both || property === "scrollTo_y") { this.skipY = 1; } } }; ScrollToPlugin.max = _max; ScrollToPlugin.getOffset = _getOffset; ScrollToPlugin.buildGetter = _buildGetter; _getGSAP() && gsap.registerPlugin(ScrollToPlugin); exports.ScrollToPlugin = ScrollToPlugin; exports.default = ScrollToPlugin; Object.defineProperty(exports, '__esModule', { value: true }); })));
// It works. const assert = require('assert'); const fs = require('../'); fs.readFile(__filename, 'utf8').then( function (data) { var text = data.slice(3, 12); assert(text === 'It works.'); console.info(colorGreenPass(), `promise resolved: '${text}'`); } ); fs.readFile(__filename + 'n/a', 'utf8').then( null, function (err) { assert(err); assert(err.code === 'ENOENT'); console.info(colorGreenPass(), `promise rejected: '${err.code}'`); } ); ~function() { assert(fs.constants.R_OK !== 0); console.info(colorGreenPass(), 'prop type recongnition (defined)'); }(); ~function() { assert(fs.NA === undefined); console.info(colorGreenPass(), 'prop type recongnition (undefined)'); }(); function colorGreenPass() { return colorGreen('pass'); } function colorGreen(text) { return `\x1b[42m\x1b[30m ${text} \x1b[0m`; }
"use strict"; var Generator = require("yeoman-generator"); var common = require("../app/base.js"); var deployment = require("./base.js"); module.exports = class extends Generator { constructor(args, opts) { super(args, opts); } initializing() { common.initializing(this); } prompting() { var prompts = common.getPrompts() .concat(deployment.getPrompts()); return this.prompt(prompts).then((answers) => { this.answers = answers; }); } configuring() {} default () {} writing() { deployment.write(this.fs, this.answers); } conflicts() {} install() {} end() {} };
define(['react','underscore'], function(React,_) { var Image = React.createClass({displayName: "Image", getInitialState: function() { return { loaded: false }; }, onImageLoad: function(e) { if (this.isMounted()) { this.setState({loaded: true}); } }, componentDidMount: function() { var imgTag = this.refs.img.getDOMNode(); var imgSrc = imgTag.getAttribute('src'); var img = new window.Image(); img.onload = this.onImageLoad; img.src = imgSrc; }, render: function() { var className = 'Animation_LoaderImage'; if (this.state.loaded) { className = ' Animation_LoaderImage--Load'; } return ( React.createElement("img", {ref: "img", src: this.props.img, className: className, alt: this.props.titulo}) ); } }); //**Componente Principal - Item de las noticias var FeedNoticia = React.createClass({displayName: "FeedNoticia", getInitialState: function() { return { visible:false }; }, render: function() { return React.createElement("article", {className: "Componente_Article"}, React.createElement("div", {className: "Loader_Noticias"}, React.createElement("figure", null, React.createElement(Image, {img: this.props.img, alt: this.props.titulo})), React.createElement("div", {className: "Loader_Noticias-Cont"}, React.createElement("h1", null, this.props.titulo) ) ) ) } }); //**Componente Principal - Recibe datos del ajax var AppNoticiasCA = React.createClass({displayName: 'AppNoticiasCA', getInitialState: function() { return { Noticias:this.props.Noticias, }; }, render: function() { var Items = _.map(this.state.Noticias, function(item,key){ if (key==1) { return React.createElement(FeedNoticia, {key: item.clave, id_noticia: item.clave, img: item.grande, sumario: item.sumario, titulo: item.titulo, fecha: item.fecha}) } }); return React.createElement("div", {className: "ThoyCA_ContMain-MoPrincipal--React"}, Items ) } }); window.React = React; return AppNoticiasCA; });
import React from 'react' import ReactDOM from 'react-dom' import Menu from './components/Menu' import data from '!json!./data/recipes.json' window.React = React; ReactDOM.render(<Menu recipes={data} />, document.getElementById("react-container"));
(function() { /*! * @overview Ember - JavaScript Application Framework * @copyright Copyright 2011-2019 Tilde Inc. and contributors * Portions Copyright 2006-2011 Strobe Inc. * Portions Copyright 2008-2011 Apple Inc. All rights reserved. * @license Licensed under MIT license * See https://raw.github.com/emberjs/ember.js/master/LICENSE * @version 3.14.0-beta.1 */ /*globals process */ let define, require, Ember; // Used in @ember/-internals/environment/lib/global.js mainContext = this; // eslint-disable-line no-undef (function() { let registry; let seen; function missingModule(name, referrerName) { if (referrerName) { throw new Error('Could not find module ' + name + ' required by: ' + referrerName); } else { throw new Error('Could not find module ' + name); } } function internalRequire(_name, referrerName) { let name = _name; let mod = registry[name]; if (!mod) { name = name + '/index'; mod = registry[name]; } let exports = seen[name]; if (exports !== undefined) { return exports; } exports = seen[name] = {}; if (!mod) { missingModule(_name, referrerName); } let deps = mod.deps; let callback = mod.callback; let reified = new Array(deps.length); for (let i = 0; i < deps.length; i++) { if (deps[i] === 'exports') { reified[i] = exports; } else if (deps[i] === 'require') { reified[i] = require; } else { reified[i] = internalRequire(deps[i], name); } } callback.apply(this, reified); return exports; } let isNode = typeof window === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]'; if (!isNode) { Ember = this.Ember = this.Ember || {}; } if (typeof Ember === 'undefined') { Ember = {}; } if (typeof Ember.__loader === 'undefined') { registry = Object.create(null); seen = Object.create(null); define = function(name, deps, callback) { let value = {}; if (!callback) { value.deps = []; value.callback = deps; } else { value.deps = deps; value.callback = callback; } registry[name] = value; }; require = function(name) { return internalRequire(name, null); }; // setup `require` module require['default'] = require; require.has = function registryHas(moduleName) { return Boolean(registry[moduleName]) || Boolean(registry[moduleName + '/index']); }; require._eak_seen = registry; Ember.__loader = { define: define, require: require, registry: registry, }; } else { define = Ember.__loader.define; require = Ember.__loader.require; } })(); define("@ember/debug/index", ["exports", "@ember/-internals/browser-environment", "@ember/error", "@ember/debug/lib/deprecate", "@ember/debug/lib/testing", "@ember/debug/lib/warn", "@ember/debug/lib/capture-render-tree"], function (_exports, _browserEnvironment, _error, _deprecate2, _testing, _warn2, _captureRenderTree) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); Object.defineProperty(_exports, "registerDeprecationHandler", { enumerable: true, get: function () { return _deprecate2.registerHandler; } }); Object.defineProperty(_exports, "isTesting", { enumerable: true, get: function () { return _testing.isTesting; } }); Object.defineProperty(_exports, "setTesting", { enumerable: true, get: function () { return _testing.setTesting; } }); Object.defineProperty(_exports, "registerWarnHandler", { enumerable: true, get: function () { return _warn2.registerHandler; } }); Object.defineProperty(_exports, "captureRenderTree", { enumerable: true, get: function () { return _captureRenderTree.default; } }); _exports._warnIfUsingStrippedFeatureFlags = _exports.getDebugFunction = _exports.setDebugFunction = _exports.deprecateFunc = _exports.runInDebug = _exports.debugFreeze = _exports.debugSeal = _exports.deprecate = _exports.debug = _exports.warn = _exports.info = _exports.assert = void 0; // These are the default production build versions: var noop = () => {}; var assert = noop; _exports.assert = assert; var info = noop; _exports.info = info; var warn = noop; _exports.warn = warn; var debug = noop; _exports.debug = debug; var deprecate = noop; _exports.deprecate = deprecate; var debugSeal = noop; _exports.debugSeal = debugSeal; var debugFreeze = noop; _exports.debugFreeze = debugFreeze; var runInDebug = noop; _exports.runInDebug = runInDebug; var setDebugFunction = noop; _exports.setDebugFunction = setDebugFunction; var getDebugFunction = noop; _exports.getDebugFunction = getDebugFunction; var deprecateFunc = function () { return arguments[arguments.length - 1]; }; _exports.deprecateFunc = deprecateFunc; if (true /* DEBUG */ ) { _exports.setDebugFunction = setDebugFunction = function (type, callback) { switch (type) { case 'assert': return _exports.assert = assert = callback; case 'info': return _exports.info = info = callback; case 'warn': return _exports.warn = warn = callback; case 'debug': return _exports.debug = debug = callback; case 'deprecate': return _exports.deprecate = deprecate = callback; case 'debugSeal': return _exports.debugSeal = debugSeal = callback; case 'debugFreeze': return _exports.debugFreeze = debugFreeze = callback; case 'runInDebug': return _exports.runInDebug = runInDebug = callback; case 'deprecateFunc': return _exports.deprecateFunc = deprecateFunc = callback; } }; _exports.getDebugFunction = getDebugFunction = function (type) { switch (type) { case 'assert': return assert; case 'info': return info; case 'warn': return warn; case 'debug': return debug; case 'deprecate': return deprecate; case 'debugSeal': return debugSeal; case 'debugFreeze': return debugFreeze; case 'runInDebug': return runInDebug; case 'deprecateFunc': return deprecateFunc; } }; } /** @module @ember/debug */ if (true /* DEBUG */ ) { /** Verify that a certain expectation is met, or throw a exception otherwise. This is useful for communicating assumptions in the code to other human readers as well as catching bugs that accidentally violates these expectations. Assertions are removed from production builds, so they can be freely added for documentation and debugging purposes without worries of incuring any performance penalty. However, because of that, they should not be used for checks that could reasonably fail during normal usage. Furthermore, care should be taken to avoid accidentally relying on side-effects produced from evaluating the condition itself, since the code will not run in production. ```javascript import { assert } from '@ember/debug'; // Test for truthiness assert('Must pass a string', typeof str === 'string'); // Fail unconditionally assert('This code path should never be run'); ``` @method assert @static @for @ember/debug @param {String} description Describes the expectation. This will become the text of the Error thrown if the assertion fails. @param {Boolean} condition Must be truthy for the assertion to pass. If falsy, an exception will be thrown. @public @since 1.0.0 */ setDebugFunction('assert', function assert(desc, test) { if (!test) { throw new _error.default("Assertion Failed: " + desc); } }); /** Display a debug notice. Calls to this function are removed from production builds, so they can be freely added for documentation and debugging purposes without worries of incuring any performance penalty. ```javascript import { debug } from '@ember/debug'; debug('I\'m a debug notice!'); ``` @method debug @for @ember/debug @static @param {String} message A debug message to display. @public */ setDebugFunction('debug', function debug(message) { /* eslint-disable no-console */ if (console.debug) { console.debug("DEBUG: " + message); } else { console.log("DEBUG: " + message); } /* eslint-ensable no-console */ }); /** Display an info notice. Calls to this function are removed from production builds, so they can be freely added for documentation and debugging purposes without worries of incuring any performance penalty. @method info @private */ setDebugFunction('info', function info() { console.info(...arguments); /* eslint-disable-line no-console */ }); /** @module @ember/debug @public */ /** Alias an old, deprecated method with its new counterpart. Display a deprecation warning with the provided message and a stack trace (Chrome and Firefox only) when the assigned method is called. Calls to this function are removed from production builds, so they can be freely added for documentation and debugging purposes without worries of incuring any performance penalty. ```javascript import { deprecateFunc } from '@ember/debug'; Ember.oldMethod = deprecateFunc('Please use the new, updated method', options, Ember.newMethod); ``` @method deprecateFunc @static @for @ember/debug @param {String} message A description of the deprecation. @param {Object} [options] The options object for `deprecate`. @param {Function} func The new function called to replace its deprecated counterpart. @return {Function} A new function that wraps the original function with a deprecation warning @private */ setDebugFunction('deprecateFunc', function deprecateFunc(...args) { if (args.length === 3) { var [message, options, func] = args; return function (...args) { deprecate(message, false, options); return func.apply(this, args); }; } else { var [_message, _func] = args; return function () { deprecate(_message); return _func.apply(this, arguments); }; } }); /** @module @ember/debug @public */ /** Run a function meant for debugging. Calls to this function are removed from production builds, so they can be freely added for documentation and debugging purposes without worries of incuring any performance penalty. ```javascript import Component from '@ember/component'; import { runInDebug } from '@ember/debug'; runInDebug(() => { Component.reopen({ didInsertElement() { console.log("I'm happy"); } }); }); ``` @method runInDebug @for @ember/debug @static @param {Function} func The function to be executed. @since 1.5.0 @public */ setDebugFunction('runInDebug', function runInDebug(func) { func(); }); setDebugFunction('debugSeal', function debugSeal(obj) { Object.seal(obj); }); setDebugFunction('debugFreeze', function debugFreeze(obj) { // re-freezing an already frozen object introduces a significant // performance penalty on Chrome (tested through 59). // // See: https://bugs.chromium.org/p/v8/issues/detail?id=6450 if (!Object.isFrozen(obj)) { Object.freeze(obj); } }); setDebugFunction('deprecate', _deprecate2.default); setDebugFunction('warn', _warn2.default); } var _warnIfUsingStrippedFeatureFlags; _exports._warnIfUsingStrippedFeatureFlags = _warnIfUsingStrippedFeatureFlags; if (true /* DEBUG */ && !(0, _testing.isTesting)()) { if (typeof window !== 'undefined' && (_browserEnvironment.isFirefox || _browserEnvironment.isChrome) && window.addEventListener) { window.addEventListener('load', () => { if (document.documentElement && document.documentElement.dataset && !document.documentElement.dataset.emberExtension) { var downloadURL; if (_browserEnvironment.isChrome) { downloadURL = 'https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi'; } else if (_browserEnvironment.isFirefox) { downloadURL = 'https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/'; } debug("For more advanced debugging, install the Ember Inspector from " + downloadURL); } }, false); } } }); define("@ember/debug/lib/capture-render-tree", ["exports", "@glimmer/util"], function (_exports, _util) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = captureRenderTree; /** @module @ember/debug */ /** Ember Inspector calls this function to capture the current render tree. In production mode, this requires turning on `ENV._DEBUG_RENDER_TREE` before loading Ember. @private @static @method captureRenderTree @for @ember/debug @param app {ApplicationInstance} An `ApplicationInstance`. @since 3.14.0 */ function captureRenderTree(app) { var env = (0, _util.expect)(app.lookup('service:-glimmer-environment'), 'BUG: owner is missing service:-glimmer-environment'); return env.debugRenderTree.capture(); } }); define("@ember/debug/lib/deprecate", ["exports", "@ember/-internals/environment", "@ember/debug/index", "@ember/debug/lib/handlers"], function (_exports, _environment, _index, _handlers) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.missingOptionsUntilDeprecation = _exports.missingOptionsIdDeprecation = _exports.missingOptionsDeprecation = _exports.registerHandler = _exports.default = void 0; /** @module @ember/debug @public */ /** Allows for runtime registration of handler functions that override the default deprecation behavior. Deprecations are invoked by calls to [@ember/debug/deprecate](/ember/release/classes/@ember%2Fdebug/methods/deprecate?anchor=deprecate). The following example demonstrates its usage by registering a handler that throws an error if the message contains the word "should", otherwise defers to the default handler. ```javascript import { registerDeprecationHandler } from '@ember/debug'; registerDeprecationHandler((message, options, next) => { if (message.indexOf('should') !== -1) { throw new Error(`Deprecation message with should: ${message}`); } else { // defer to whatever handler was registered before this one next(message, options); } }); ``` The handler function takes the following arguments: <ul> <li> <code>message</code> - The message received from the deprecation call.</li> <li> <code>options</code> - An object passed in with the deprecation call containing additional information including:</li> <ul> <li> <code>id</code> - An id of the deprecation in the form of <code>package-name.specific-deprecation</code>.</li> <li> <code>until</code> - The Ember version number the feature and deprecation will be removed in.</li> </ul> <li> <code>next</code> - A function that calls into the previously registered handler.</li> </ul> @public @static @method registerDeprecationHandler @for @ember/debug @param handler {Function} A function to handle deprecation calls. @since 2.1.0 */ var registerHandler = () => {}; _exports.registerHandler = registerHandler; var missingOptionsDeprecation; _exports.missingOptionsDeprecation = missingOptionsDeprecation; var missingOptionsIdDeprecation; _exports.missingOptionsIdDeprecation = missingOptionsIdDeprecation; var missingOptionsUntilDeprecation; _exports.missingOptionsUntilDeprecation = missingOptionsUntilDeprecation; var deprecate = () => {}; if (true /* DEBUG */ ) { _exports.registerHandler = registerHandler = function registerHandler(handler) { (0, _handlers.registerHandler)('deprecate', handler); }; var formatMessage = function formatMessage(_message, options) { var message = _message; if (options && options.id) { message = message + (" [deprecation id: " + options.id + "]"); } if (options && options.url) { message += " See " + options.url + " for more details."; } return message; }; registerHandler(function logDeprecationToConsole(message, options) { var updatedMessage = formatMessage(message, options); console.warn("DEPRECATION: " + updatedMessage); // eslint-disable-line no-console }); var captureErrorForStack; if (new Error().stack) { captureErrorForStack = () => new Error(); } else { captureErrorForStack = () => { try { __fail__.fail(); } catch (e) { return e; } }; } registerHandler(function logDeprecationStackTrace(message, options, next) { if (_environment.ENV.LOG_STACKTRACE_ON_DEPRECATION) { var stackStr = ''; var error = captureErrorForStack(); var stack; if (error.stack) { if (error['arguments']) { // Chrome stack = error.stack.replace(/^\s+at\s+/gm, '').replace(/^([^\(]+?)([\n$])/gm, '{anonymous}($1)$2').replace(/^Object.<anonymous>\s*\(([^\)]+)\)/gm, '{anonymous}($1)').split('\n'); stack.shift(); } else { // Firefox stack = error.stack.replace(/(?:\n@:0)?\s+$/m, '').replace(/^\(/gm, '{anonymous}(').split('\n'); } stackStr = "\n " + stack.slice(2).join('\n '); } var updatedMessage = formatMessage(message, options); console.warn("DEPRECATION: " + updatedMessage + stackStr); // eslint-disable-line no-console } else { next(message, options); } }); registerHandler(function raiseOnDeprecation(message, options, next) { if (_environment.ENV.RAISE_ON_DEPRECATION) { var updatedMessage = formatMessage(message); throw new Error(updatedMessage); } else { next(message, options); } }); _exports.missingOptionsDeprecation = missingOptionsDeprecation = 'When calling `deprecate` you ' + 'must provide an `options` hash as the third parameter. ' + '`options` should include `id` and `until` properties.'; _exports.missingOptionsIdDeprecation = missingOptionsIdDeprecation = 'When calling `deprecate` you must provide `id` in options.'; _exports.missingOptionsUntilDeprecation = missingOptionsUntilDeprecation = 'When calling `deprecate` you must provide `until` in options.'; /** @module @ember/debug @public */ /** Display a deprecation warning with the provided message and a stack trace (Chrome and Firefox only). * In a production build, this method is defined as an empty function (NOP). Uses of this method in Ember itself are stripped from the ember.prod.js build. @method deprecate @for @ember/debug @param {String} message A description of the deprecation. @param {Boolean} test A boolean. If falsy, the deprecation will be displayed. @param {Object} options @param {String} options.id A unique id for this deprecation. The id can be used by Ember debugging tools to change the behavior (raise, log or silence) for that specific deprecation. The id should be namespaced by dots, e.g. "view.helper.select". @param {string} options.until The version of Ember when this deprecation warning will be removed. @param {String} [options.url] An optional url to the transition guide on the emberjs.com website. @static @public @since 1.0.0 */ deprecate = function deprecate(message, test, options) { (0, _index.assert)(missingOptionsDeprecation, Boolean(options && (options.id || options.until))); (0, _index.assert)(missingOptionsIdDeprecation, Boolean(options.id)); (0, _index.assert)(missingOptionsUntilDeprecation, Boolean(options.until)); (0, _handlers.invoke)('deprecate', message, test, options); }; } var _default = deprecate; _exports.default = _default; }); define("@ember/debug/lib/handlers", ["exports"], function (_exports) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.invoke = _exports.registerHandler = _exports.HANDLERS = void 0; var HANDLERS = {}; _exports.HANDLERS = HANDLERS; var registerHandler = () => {}; _exports.registerHandler = registerHandler; var invoke = () => {}; _exports.invoke = invoke; if (true /* DEBUG */ ) { _exports.registerHandler = registerHandler = function registerHandler(type, callback) { var nextHandler = HANDLERS[type] || (() => {}); HANDLERS[type] = (message, options) => { callback(message, options, nextHandler); }; }; _exports.invoke = invoke = function invoke(type, message, test, options) { if (test) { return; } var handlerForType = HANDLERS[type]; if (handlerForType) { handlerForType(message, options); } }; } }); define("@ember/debug/lib/testing", ["exports"], function (_exports) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.isTesting = isTesting; _exports.setTesting = setTesting; var testing = false; function isTesting() { return testing; } function setTesting(value) { testing = Boolean(value); } }); define("@ember/debug/lib/warn", ["exports", "@ember/debug/index", "@ember/debug/lib/handlers"], function (_exports, _index, _handlers) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.missingOptionsDeprecation = _exports.missingOptionsIdDeprecation = _exports.registerHandler = _exports.default = void 0; var registerHandler = () => {}; _exports.registerHandler = registerHandler; var warn = () => {}; var missingOptionsDeprecation; _exports.missingOptionsDeprecation = missingOptionsDeprecation; var missingOptionsIdDeprecation; /** @module @ember/debug */ _exports.missingOptionsIdDeprecation = missingOptionsIdDeprecation; if (true /* DEBUG */ ) { /** Allows for runtime registration of handler functions that override the default warning behavior. Warnings are invoked by calls made to [@ember/debug/warn](/ember/release/classes/@ember%2Fdebug/methods/warn?anchor=warn). The following example demonstrates its usage by registering a handler that does nothing overriding Ember's default warning behavior. ```javascript import { registerWarnHandler } from '@ember/debug'; // next is not called, so no warnings get the default behavior registerWarnHandler(() => {}); ``` The handler function takes the following arguments: <ul> <li> <code>message</code> - The message received from the warn call. </li> <li> <code>options</code> - An object passed in with the warn call containing additional information including:</li> <ul> <li> <code>id</code> - An id of the warning in the form of <code>package-name.specific-warning</code>.</li> </ul> <li> <code>next</code> - A function that calls into the previously registered handler.</li> </ul> @public @static @method registerWarnHandler @for @ember/debug @param handler {Function} A function to handle warnings. @since 2.1.0 */ _exports.registerHandler = registerHandler = function registerHandler(handler) { (0, _handlers.registerHandler)('warn', handler); }; registerHandler(function logWarning(message) { /* eslint-disable no-console */ console.warn("WARNING: " + message); /* eslint-enable no-console */ }); _exports.missingOptionsDeprecation = missingOptionsDeprecation = 'When calling `warn` you ' + 'must provide an `options` hash as the third parameter. ' + '`options` should include an `id` property.'; _exports.missingOptionsIdDeprecation = missingOptionsIdDeprecation = 'When calling `warn` you must provide `id` in options.'; /** Display a warning with the provided message. * In a production build, this method is defined as an empty function (NOP). Uses of this method in Ember itself are stripped from the ember.prod.js build. ```javascript import { warn } from '@ember/debug'; import tomsterCount from './tomster-counter'; // a module in my project // Log a warning if we have more than 3 tomsters warn('Too many tomsters!', tomsterCount <= 3, { id: 'ember-debug.too-many-tomsters' }); ``` @method warn @for @ember/debug @static @param {String} message A warning to display. @param {Boolean} test An optional boolean. If falsy, the warning will be displayed. @param {Object} options An object that can be used to pass a unique `id` for this warning. The `id` can be used by Ember debugging tools to change the behavior (raise, log, or silence) for that specific warning. The `id` should be namespaced by dots, e.g. "ember-debug.feature-flag-with-features-stripped" @public @since 1.0.0 */ warn = function warn(message, test, options) { if (arguments.length === 2 && typeof test === 'object') { options = test; test = false; } (0, _index.assert)(missingOptionsDeprecation, Boolean(options)); (0, _index.assert)(missingOptionsIdDeprecation, Boolean(options && options.id)); (0, _handlers.invoke)('warn', message, test, options); }; } var _default = warn; _exports.default = _default; }); define("ember-testing/index", ["exports", "ember-testing/lib/test", "ember-testing/lib/adapters/adapter", "ember-testing/lib/setup_for_testing", "ember-testing/lib/adapters/qunit", "ember-testing/lib/support", "ember-testing/lib/ext/application", "ember-testing/lib/ext/rsvp", "ember-testing/lib/helpers", "ember-testing/lib/initializers"], function (_exports, _test, _adapter, _setup_for_testing, _qunit, _support, _application, _rsvp, _helpers, _initializers) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); Object.defineProperty(_exports, "Test", { enumerable: true, get: function () { return _test.default; } }); Object.defineProperty(_exports, "Adapter", { enumerable: true, get: function () { return _adapter.default; } }); Object.defineProperty(_exports, "setupForTesting", { enumerable: true, get: function () { return _setup_for_testing.default; } }); Object.defineProperty(_exports, "QUnitAdapter", { enumerable: true, get: function () { return _qunit.default; } }); }); define("ember-testing/lib/adapters/adapter", ["exports", "@ember/-internals/runtime"], function (_exports, _runtime) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; function K() { return this; } /** @module @ember/test */ /** The primary purpose of this class is to create hooks that can be implemented by an adapter for various test frameworks. @class TestAdapter @public */ var _default = _runtime.Object.extend({ /** This callback will be called whenever an async operation is about to start. Override this to call your framework's methods that handle async operations. @public @method asyncStart */ asyncStart: K, /** This callback will be called whenever an async operation has completed. @public @method asyncEnd */ asyncEnd: K, /** Override this method with your testing framework's false assertion. This function is called whenever an exception occurs causing the testing promise to fail. QUnit example: ```javascript exception: function(error) { ok(false, error); }; ``` @public @method exception @param {String} error The exception to be raised. */ exception(error) { throw error; } }); _exports.default = _default; }); define("ember-testing/lib/adapters/qunit", ["exports", "@ember/-internals/utils", "ember-testing/lib/adapters/adapter"], function (_exports, _utils, _adapter) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; /* globals QUnit */ /** @module ember */ /** This class implements the methods defined by TestAdapter for the QUnit testing framework. @class QUnitAdapter @namespace Ember.Test @extends TestAdapter @public */ var _default = _adapter.default.extend({ init() { this.doneCallbacks = []; }, asyncStart() { if (typeof QUnit.stop === 'function') { // very old QUnit version QUnit.stop(); } else { this.doneCallbacks.push(QUnit.config.current ? QUnit.config.current.assert.async() : null); } }, asyncEnd() { // checking for QUnit.stop here (even though we _need_ QUnit.start) because // QUnit.start() still exists in QUnit 2.x (it just throws an error when calling // inside a test context) if (typeof QUnit.stop === 'function') { QUnit.start(); } else { var done = this.doneCallbacks.pop(); // This can be null if asyncStart() was called outside of a test if (done) { done(); } } }, exception(error) { QUnit.config.current.assert.ok(false, (0, _utils.inspect)(error)); } }); _exports.default = _default; }); define("ember-testing/lib/events", ["exports", "@ember/runloop", "@ember/polyfills", "ember-testing/lib/helpers/-is-form-control"], function (_exports, _runloop, _polyfills, _isFormControl) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.focus = focus; _exports.fireEvent = fireEvent; var DEFAULT_EVENT_OPTIONS = { canBubble: true, cancelable: true }; var KEYBOARD_EVENT_TYPES = ['keydown', 'keypress', 'keyup']; var MOUSE_EVENT_TYPES = ['click', 'mousedown', 'mouseup', 'dblclick', 'mouseenter', 'mouseleave', 'mousemove', 'mouseout', 'mouseover']; function focus(el) { if (!el) { return; } if (el.isContentEditable || (0, _isFormControl.default)(el)) { var type = el.getAttribute('type'); if (type !== 'checkbox' && type !== 'radio' && type !== 'hidden') { (0, _runloop.run)(null, function () { var browserIsNotFocused = document.hasFocus && !document.hasFocus(); // makes `document.activeElement` be `element`. If the browser is focused, it also fires a focus event el.focus(); // Firefox does not trigger the `focusin` event if the window // does not have focus. If the document does not have focus then // fire `focusin` event as well. if (browserIsNotFocused) { // if the browser is not focused the previous `el.focus()` didn't fire an event, so we simulate it fireEvent(el, 'focus', { bubbles: false }); fireEvent(el, 'focusin'); } }); } } } function fireEvent(element, type, options = {}) { if (!element) { return; } var event; if (KEYBOARD_EVENT_TYPES.indexOf(type) > -1) { event = buildKeyboardEvent(type, options); } else if (MOUSE_EVENT_TYPES.indexOf(type) > -1) { var rect = element.getBoundingClientRect(); var x = rect.left + 1; var y = rect.top + 1; var simulatedCoordinates = { screenX: x + 5, screenY: y + 95, clientX: x, clientY: y }; event = buildMouseEvent(type, (0, _polyfills.assign)(simulatedCoordinates, options)); } else { event = buildBasicEvent(type, options); } element.dispatchEvent(event); } function buildBasicEvent(type, options = {}) { var event = document.createEvent('Events'); // Event.bubbles is read only var bubbles = options.bubbles !== undefined ? options.bubbles : true; var cancelable = options.cancelable !== undefined ? options.cancelable : true; delete options.bubbles; delete options.cancelable; event.initEvent(type, bubbles, cancelable); (0, _polyfills.assign)(event, options); return event; } function buildMouseEvent(type, options = {}) { var event; try { event = document.createEvent('MouseEvents'); var eventOpts = (0, _polyfills.assign)({}, DEFAULT_EVENT_OPTIONS, options); event.initMouseEvent(type, eventOpts.canBubble, eventOpts.cancelable, window, eventOpts.detail, eventOpts.screenX, eventOpts.screenY, eventOpts.clientX, eventOpts.clientY, eventOpts.ctrlKey, eventOpts.altKey, eventOpts.shiftKey, eventOpts.metaKey, eventOpts.button, eventOpts.relatedTarget); } catch (e) { event = buildBasicEvent(type, options); } return event; } function buildKeyboardEvent(type, options = {}) { var event; try { event = document.createEvent('KeyEvents'); var eventOpts = (0, _polyfills.assign)({}, DEFAULT_EVENT_OPTIONS, options); event.initKeyEvent(type, eventOpts.canBubble, eventOpts.cancelable, window, eventOpts.ctrlKey, eventOpts.altKey, eventOpts.shiftKey, eventOpts.metaKey, eventOpts.keyCode, eventOpts.charCode); } catch (e) { event = buildBasicEvent(type, options); } return event; } }); define("ember-testing/lib/ext/application", ["@ember/application", "ember-testing/lib/setup_for_testing", "ember-testing/lib/test/helpers", "ember-testing/lib/test/promise", "ember-testing/lib/test/run", "ember-testing/lib/test/on_inject_helpers", "ember-testing/lib/test/adapter"], function (_application, _setup_for_testing, _helpers, _promise, _run, _on_inject_helpers, _adapter) { "use strict"; _application.default.reopen({ /** This property contains the testing helpers for the current application. These are created once you call `injectTestHelpers` on your `Application` instance. The included helpers are also available on the `window` object by default, but can be used from this object on the individual application also. @property testHelpers @type {Object} @default {} @public */ testHelpers: {}, /** This property will contain the original methods that were registered on the `helperContainer` before `injectTestHelpers` is called. When `removeTestHelpers` is called, these methods are restored to the `helperContainer`. @property originalMethods @type {Object} @default {} @private @since 1.3.0 */ originalMethods: {}, /** This property indicates whether or not this application is currently in testing mode. This is set when `setupForTesting` is called on the current application. @property testing @type {Boolean} @default false @since 1.3.0 @public */ testing: false, /** This hook defers the readiness of the application, so that you can start the app when your tests are ready to run. It also sets the router's location to 'none', so that the window's location will not be modified (preventing both accidental leaking of state between tests and interference with your testing framework). `setupForTesting` should only be called after setting a custom `router` class (for example `App.Router = Router.extend(`). Example: ``` App.setupForTesting(); ``` @method setupForTesting @public */ setupForTesting() { (0, _setup_for_testing.default)(); this.testing = true; this.resolveRegistration('router:main').reopen({ location: 'none' }); }, /** This will be used as the container to inject the test helpers into. By default the helpers are injected into `window`. @property helperContainer @type {Object} The object to be used for test helpers. @default window @since 1.2.0 @private */ helperContainer: null, /** This injects the test helpers into the `helperContainer` object. If an object is provided it will be used as the helperContainer. If `helperContainer` is not set it will default to `window`. If a function of the same name has already been defined it will be cached (so that it can be reset if the helper is removed with `unregisterHelper` or `removeTestHelpers`). Any callbacks registered with `onInjectHelpers` will be called once the helpers have been injected. Example: ``` App.injectTestHelpers(); ``` @method injectTestHelpers @public */ injectTestHelpers(helperContainer) { if (helperContainer) { this.helperContainer = helperContainer; } else { this.helperContainer = window; } this.reopen({ willDestroy() { this._super(...arguments); this.removeTestHelpers(); } }); this.testHelpers = {}; for (var name in _helpers.helpers) { this.originalMethods[name] = this.helperContainer[name]; this.testHelpers[name] = this.helperContainer[name] = helper(this, name); protoWrap(_promise.default.prototype, name, helper(this, name), _helpers.helpers[name].meta.wait); } (0, _on_inject_helpers.invokeInjectHelpersCallbacks)(this); }, /** This removes all helpers that have been registered, and resets and functions that were overridden by the helpers. Example: ```javascript App.removeTestHelpers(); ``` @public @method removeTestHelpers */ removeTestHelpers() { if (!this.helperContainer) { return; } for (var name in _helpers.helpers) { this.helperContainer[name] = this.originalMethods[name]; delete _promise.default.prototype[name]; delete this.testHelpers[name]; delete this.originalMethods[name]; } } }); // This method is no longer needed // But still here for backwards compatibility // of helper chaining function protoWrap(proto, name, callback, isAsync) { proto[name] = function (...args) { if (isAsync) { return callback.apply(this, args); } else { return this.then(function () { return callback.apply(this, args); }); } }; } function helper(app, name) { var fn = _helpers.helpers[name].method; var meta = _helpers.helpers[name].meta; if (!meta.wait) { return (...args) => fn.apply(app, [app, ...args]); } return (...args) => { var lastPromise = (0, _run.default)(() => (0, _promise.resolve)((0, _promise.getLastPromise)())); // wait for last helper's promise to resolve and then // execute. To be safe, we need to tell the adapter we're going // asynchronous here, because fn may not be invoked before we // return. (0, _adapter.asyncStart)(); return lastPromise.then(() => fn.apply(app, [app, ...args])).finally(_adapter.asyncEnd); }; } }); define("ember-testing/lib/ext/rsvp", ["exports", "@ember/-internals/runtime", "@ember/runloop", "@ember/debug", "ember-testing/lib/test/adapter"], function (_exports, _runtime, _runloop, _debug, _adapter) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; _runtime.RSVP.configure('async', function (callback, promise) { // if schedule will cause autorun, we need to inform adapter if ((0, _debug.isTesting)() && !_runloop.backburner.currentInstance) { (0, _adapter.asyncStart)(); _runloop.backburner.schedule('actions', () => { (0, _adapter.asyncEnd)(); callback(promise); }); } else { _runloop.backburner.schedule('actions', () => callback(promise)); } }); var _default = _runtime.RSVP; _exports.default = _default; }); define("ember-testing/lib/helpers", ["ember-testing/lib/test/helpers", "ember-testing/lib/helpers/and_then", "ember-testing/lib/helpers/click", "ember-testing/lib/helpers/current_path", "ember-testing/lib/helpers/current_route_name", "ember-testing/lib/helpers/current_url", "ember-testing/lib/helpers/fill_in", "ember-testing/lib/helpers/find", "ember-testing/lib/helpers/find_with_assert", "ember-testing/lib/helpers/key_event", "ember-testing/lib/helpers/pause_test", "ember-testing/lib/helpers/trigger_event", "ember-testing/lib/helpers/visit", "ember-testing/lib/helpers/wait"], function (_helpers, _and_then, _click, _current_path, _current_route_name, _current_url, _fill_in, _find, _find_with_assert, _key_event, _pause_test, _trigger_event, _visit, _wait) { "use strict"; (0, _helpers.registerAsyncHelper)('visit', _visit.default); (0, _helpers.registerAsyncHelper)('click', _click.default); (0, _helpers.registerAsyncHelper)('keyEvent', _key_event.default); (0, _helpers.registerAsyncHelper)('fillIn', _fill_in.default); (0, _helpers.registerAsyncHelper)('wait', _wait.default); (0, _helpers.registerAsyncHelper)('andThen', _and_then.default); (0, _helpers.registerAsyncHelper)('pauseTest', _pause_test.pauseTest); (0, _helpers.registerAsyncHelper)('triggerEvent', _trigger_event.default); (0, _helpers.registerHelper)('find', _find.default); (0, _helpers.registerHelper)('findWithAssert', _find_with_assert.default); (0, _helpers.registerHelper)('currentRouteName', _current_route_name.default); (0, _helpers.registerHelper)('currentPath', _current_path.default); (0, _helpers.registerHelper)('currentURL', _current_url.default); (0, _helpers.registerHelper)('resumeTest', _pause_test.resumeTest); }); define("ember-testing/lib/helpers/-is-form-control", ["exports"], function (_exports) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = isFormControl; var FORM_CONTROL_TAGS = ['INPUT', 'BUTTON', 'SELECT', 'TEXTAREA']; /** @private @param {Element} element the element to check @returns {boolean} `true` when the element is a form control, `false` otherwise */ function isFormControl(element) { var { tagName, type } = element; if (type === 'hidden') { return false; } return FORM_CONTROL_TAGS.indexOf(tagName) > -1; } }); define("ember-testing/lib/helpers/and_then", ["exports"], function (_exports) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = andThen; function andThen(app, callback) { return app.testHelpers.wait(callback(app)); } }); define("ember-testing/lib/helpers/click", ["exports", "ember-testing/lib/events"], function (_exports, _events) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = click; /** @module ember */ /** Clicks an element and triggers any actions triggered by the element's `click` event. Example: ```javascript click('.some-jQuery-selector').then(function() { // assert something }); ``` @method click @param {String} selector jQuery selector for finding element on the DOM @param {Object} context A DOM Element, Document, or jQuery to use as context @return {RSVP.Promise<undefined>} @public */ function click(app, selector, context) { var $el = app.testHelpers.findWithAssert(selector, context); var el = $el[0]; (0, _events.fireEvent)(el, 'mousedown'); (0, _events.focus)(el); (0, _events.fireEvent)(el, 'mouseup'); (0, _events.fireEvent)(el, 'click'); return app.testHelpers.wait(); } }); define("ember-testing/lib/helpers/current_path", ["exports", "@ember/-internals/metal"], function (_exports, _metal) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = currentPath; /** @module ember */ /** Returns the current path. Example: ```javascript function validateURL() { equal(currentPath(), 'some.path.index', "correct path was transitioned into."); } click('#some-link-id').then(validateURL); ``` @method currentPath @return {Object} The currently active path. @since 1.5.0 @public */ function currentPath(app) { var routingService = app.__container__.lookup('service:-routing'); return (0, _metal.get)(routingService, 'currentPath'); } }); define("ember-testing/lib/helpers/current_route_name", ["exports", "@ember/-internals/metal"], function (_exports, _metal) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = currentRouteName; /** @module ember */ /** Returns the currently active route name. Example: ```javascript function validateRouteName() { equal(currentRouteName(), 'some.path', "correct route was transitioned into."); } visit('/some/path').then(validateRouteName) ``` @method currentRouteName @return {Object} The name of the currently active route. @since 1.5.0 @public */ function currentRouteName(app) { var routingService = app.__container__.lookup('service:-routing'); return (0, _metal.get)(routingService, 'currentRouteName'); } }); define("ember-testing/lib/helpers/current_url", ["exports", "@ember/-internals/metal"], function (_exports, _metal) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = currentURL; /** @module ember */ /** Returns the current URL. Example: ```javascript function validateURL() { equal(currentURL(), '/some/path', "correct URL was transitioned into."); } click('#some-link-id').then(validateURL); ``` @method currentURL @return {Object} The currently active URL. @since 1.5.0 @public */ function currentURL(app) { var router = app.__container__.lookup('router:main'); return (0, _metal.get)(router, 'location').getURL(); } }); define("ember-testing/lib/helpers/fill_in", ["exports", "ember-testing/lib/events", "ember-testing/lib/helpers/-is-form-control"], function (_exports, _events, _isFormControl) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = fillIn; /** @module ember */ /** Fills in an input element with some text. Example: ```javascript fillIn('#email', 'you@example.com').then(function() { // assert something }); ``` @method fillIn @param {String} selector jQuery selector finding an input element on the DOM to fill text with @param {String} text text to place inside the input element @return {RSVP.Promise<undefined>} @public */ function fillIn(app, selector, contextOrText, text) { var $el, el, context; if (text === undefined) { text = contextOrText; } else { context = contextOrText; } $el = app.testHelpers.findWithAssert(selector, context); el = $el[0]; (0, _events.focus)(el); if ((0, _isFormControl.default)(el)) { el.value = text; } else { el.innerHTML = text; } (0, _events.fireEvent)(el, 'input'); (0, _events.fireEvent)(el, 'change'); return app.testHelpers.wait(); } }); define("ember-testing/lib/helpers/find", ["exports", "@ember/-internals/metal", "@ember/debug", "@ember/-internals/views"], function (_exports, _metal, _debug, _views) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = find; /** @module ember */ /** Finds an element in the context of the app's container element. A simple alias for `app.$(selector)`. Example: ```javascript var $el = find('.my-selector'); ``` With the `context` param: ```javascript var $el = find('.my-selector', '.parent-element-class'); ``` @method find @param {String} selector jQuery selector for element lookup @param {String} [context] (optional) jQuery selector that will limit the selector argument to find only within the context's children @return {Object} DOM element representing the results of the query @public */ function find(app, selector, context) { if (_views.jQueryDisabled) { (true && !(false) && (0, _debug.assert)('If jQuery is disabled, please import and use helpers from @ember/test-helpers [https://github.com/emberjs/ember-test-helpers]. Note: `find` is not an available helper.')); } var $el; context = context || (0, _metal.get)(app, 'rootElement'); $el = app.$(selector, context); return $el; } }); define("ember-testing/lib/helpers/find_with_assert", ["exports"], function (_exports) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = findWithAssert; /** @module ember */ /** Like `find`, but throws an error if the element selector returns no results. Example: ```javascript var $el = findWithAssert('.doesnt-exist'); // throws error ``` With the `context` param: ```javascript var $el = findWithAssert('.selector-id', '.parent-element-class'); // assert will pass ``` @method findWithAssert @param {String} selector jQuery selector string for finding an element within the DOM @param {String} [context] (optional) jQuery selector that will limit the selector argument to find only within the context's children @return {Object} jQuery object representing the results of the query @throws {Error} throws error if object returned has a length of 0 @public */ function findWithAssert(app, selector, context) { var $el = app.testHelpers.find(selector, context); if ($el.length === 0) { throw new Error('Element ' + selector + ' not found.'); } return $el; } }); define("ember-testing/lib/helpers/key_event", ["exports"], function (_exports) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = keyEvent; /** @module ember */ /** Simulates a key event, e.g. `keypress`, `keydown`, `keyup` with the desired keyCode Example: ```javascript keyEvent('.some-jQuery-selector', 'keypress', 13).then(function() { // assert something }); ``` @method keyEvent @param {String} selector jQuery selector for finding element on the DOM @param {String} type the type of key event, e.g. `keypress`, `keydown`, `keyup` @param {Number} keyCode the keyCode of the simulated key event @return {RSVP.Promise<undefined>} @since 1.5.0 @public */ function keyEvent(app, selector, contextOrType, typeOrKeyCode, keyCode) { var context, type; if (keyCode === undefined) { context = null; keyCode = typeOrKeyCode; type = contextOrType; } else { context = contextOrType; type = typeOrKeyCode; } return app.testHelpers.triggerEvent(selector, context, type, { keyCode, which: keyCode }); } }); define("ember-testing/lib/helpers/pause_test", ["exports", "@ember/-internals/runtime", "@ember/debug"], function (_exports, _runtime, _debug) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.resumeTest = resumeTest; _exports.pauseTest = pauseTest; /** @module ember */ var resume; /** Resumes a test paused by `pauseTest`. @method resumeTest @return {void} @public */ function resumeTest() { (true && !(resume) && (0, _debug.assert)('Testing has not been paused. There is nothing to resume.', resume)); resume(); resume = undefined; } /** Pauses the current test - this is useful for debugging while testing or for test-driving. It allows you to inspect the state of your application at any point. Example (The test will pause before clicking the button): ```javascript visit('/') return pauseTest(); click('.btn'); ``` You may want to turn off the timeout before pausing. qunit (timeout available to use as of 2.4.0): ``` visit('/'); assert.timeout(0); return pauseTest(); click('.btn'); ``` mocha (timeout happens automatically as of ember-mocha v0.14.0): ``` visit('/'); this.timeout(0); return pauseTest(); click('.btn'); ``` @since 1.9.0 @method pauseTest @return {Object} A promise that will never resolve @public */ function pauseTest() { (0, _debug.info)('Testing paused. Use `resumeTest()` to continue.'); return new _runtime.RSVP.Promise(resolve => { resume = resolve; }, 'TestAdapter paused promise'); } }); define("ember-testing/lib/helpers/trigger_event", ["exports", "ember-testing/lib/events"], function (_exports, _events) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = triggerEvent; /** @module ember */ /** Triggers the given DOM event on the element identified by the provided selector. Example: ```javascript triggerEvent('#some-elem-id', 'blur'); ``` This is actually used internally by the `keyEvent` helper like so: ```javascript triggerEvent('#some-elem-id', 'keypress', { keyCode: 13 }); ``` @method triggerEvent @param {String} selector jQuery selector for finding element on the DOM @param {String} [context] jQuery selector that will limit the selector argument to find only within the context's children @param {String} type The event type to be triggered. @param {Object} [options] The options to be passed to jQuery.Event. @return {RSVP.Promise<undefined>} @since 1.5.0 @public */ function triggerEvent(app, selector, contextOrType, typeOrOptions, possibleOptions) { var arity = arguments.length; var context, type, options; if (arity === 3) { // context and options are optional, so this is // app, selector, type context = null; type = contextOrType; options = {}; } else if (arity === 4) { // context and options are optional, so this is if (typeof typeOrOptions === 'object') { // either // app, selector, type, options context = null; type = contextOrType; options = typeOrOptions; } else { // or // app, selector, context, type context = contextOrType; type = typeOrOptions; options = {}; } } else { context = contextOrType; type = typeOrOptions; options = possibleOptions; } var $el = app.testHelpers.findWithAssert(selector, context); var el = $el[0]; (0, _events.fireEvent)(el, type, options); return app.testHelpers.wait(); } }); define("ember-testing/lib/helpers/visit", ["exports", "@ember/runloop"], function (_exports, _runloop) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = visit; /** Loads a route, sets up any controllers, and renders any templates associated with the route as though a real user had triggered the route change while using your app. Example: ```javascript visit('posts/index').then(function() { // assert something }); ``` @method visit @param {String} url the name of the route @return {RSVP.Promise<undefined>} @public */ function visit(app, url) { var router = app.__container__.lookup('router:main'); var shouldHandleURL = false; app.boot().then(() => { router.location.setURL(url); if (shouldHandleURL) { (0, _runloop.run)(app.__deprecatedInstance__, 'handleURL', url); } }); if (app._readinessDeferrals > 0) { router.initialURL = url; (0, _runloop.run)(app, 'advanceReadiness'); delete router.initialURL; } else { shouldHandleURL = true; } return app.testHelpers.wait(); } }); define("ember-testing/lib/helpers/wait", ["exports", "ember-testing/lib/test/waiters", "@ember/-internals/runtime", "@ember/runloop", "ember-testing/lib/test/pending_requests"], function (_exports, _waiters, _runtime, _runloop, _pending_requests) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = wait; /** @module ember */ /** Causes the run loop to process any pending events. This is used to ensure that any async operations from other helpers (or your assertions) have been processed. This is most often used as the return value for the helper functions (see 'click', 'fillIn','visit',etc). However, there is a method to register a test helper which utilizes this method without the need to actually call `wait()` in your helpers. The `wait` helper is built into `registerAsyncHelper` by default. You will not need to `return app.testHelpers.wait();` - the wait behavior is provided for you. Example: ```javascript import { registerAsyncHelper } from '@ember/test'; registerAsyncHelper('loginUser', function(app, username, password) { visit('secured/path/here') .fillIn('#username', username) .fillIn('#password', password) .click('.submit'); }); ``` @method wait @param {Object} value The value to be returned. @return {RSVP.Promise<any>} Promise that resolves to the passed value. @public @since 1.0.0 */ function wait(app, value) { return new _runtime.RSVP.Promise(function (resolve) { var router = app.__container__.lookup('router:main'); // Every 10ms, poll for the async thing to have finished var watcher = setInterval(() => { // 1. If the router is loading, keep polling var routerIsLoading = router._routerMicrolib && Boolean(router._routerMicrolib.activeTransition); if (routerIsLoading) { return; } // 2. If there are pending Ajax requests, keep polling if ((0, _pending_requests.pendingRequests)()) { return; } // 3. If there are scheduled timers or we are inside of a run loop, keep polling if ((0, _runloop.hasScheduledTimers)() || (0, _runloop.getCurrentRunLoop)()) { return; } if ((0, _waiters.checkWaiters)()) { return; } // Stop polling clearInterval(watcher); // Synchronously resolve the promise (0, _runloop.run)(null, resolve, value); }, 10); }); } }); define("ember-testing/lib/initializers", ["@ember/application"], function (_application) { "use strict"; var name = 'deferReadiness in `testing` mode'; (0, _application.onLoad)('Ember.Application', function (Application) { if (!Application.initializers[name]) { Application.initializer({ name: name, initialize(application) { if (application.testing) { application.deferReadiness(); } } }); } }); }); define("ember-testing/lib/setup_for_testing", ["exports", "@ember/debug", "@ember/-internals/views", "ember-testing/lib/test/adapter", "ember-testing/lib/test/pending_requests", "ember-testing/lib/adapters/adapter", "ember-testing/lib/adapters/qunit"], function (_exports, _debug, _views, _adapter, _pending_requests, _adapter2, _qunit) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = setupForTesting; /* global self */ /** Sets Ember up for testing. This is useful to perform basic setup steps in order to unit test. Use `App.setupForTesting` to perform integration tests (full application testing). @method setupForTesting @namespace Ember @since 1.5.0 @private */ function setupForTesting() { (0, _debug.setTesting)(true); var adapter = (0, _adapter.getAdapter)(); // if adapter is not manually set default to QUnit if (!adapter) { (0, _adapter.setAdapter)(typeof self.QUnit === 'undefined' ? _adapter2.default.create() : _qunit.default.create()); } if (!_views.jQueryDisabled) { (0, _views.jQuery)(document).off('ajaxSend', _pending_requests.incrementPendingRequests); (0, _views.jQuery)(document).off('ajaxComplete', _pending_requests.decrementPendingRequests); (0, _pending_requests.clearPendingRequests)(); (0, _views.jQuery)(document).on('ajaxSend', _pending_requests.incrementPendingRequests); (0, _views.jQuery)(document).on('ajaxComplete', _pending_requests.decrementPendingRequests); } } }); define("ember-testing/lib/support", ["@ember/debug", "@ember/-internals/views", "@ember/-internals/browser-environment"], function (_debug, _views, _browserEnvironment) { "use strict"; /** @module ember */ var $ = _views.jQuery; /** This method creates a checkbox and triggers the click event to fire the passed in handler. It is used to correct for a bug in older versions of jQuery (e.g 1.8.3). @private @method testCheckboxClick */ function testCheckboxClick(handler) { var input = document.createElement('input'); $(input).attr('type', 'checkbox').css({ position: 'absolute', left: '-1000px', top: '-1000px' }).appendTo('body').on('click', handler).trigger('click').remove(); } if (_browserEnvironment.hasDOM && !_views.jQueryDisabled) { $(function () { /* Determine whether a checkbox checked using jQuery's "click" method will have the correct value for its checked property. If we determine that the current jQuery version exhibits this behavior, patch it to work correctly as in the commit for the actual fix: https://github.com/jquery/jquery/commit/1fb2f92. */ testCheckboxClick(function () { if (!this.checked && !$.event.special.click) { $.event.special.click = { // For checkbox, fire native event so checked state will be right trigger() { if (this.nodeName === 'INPUT' && this.type === 'checkbox' && this.click) { this.click(); return false; } } }; } }); // Try again to verify that the patch took effect or blow up. testCheckboxClick(function () { (true && (0, _debug.warn)("clicked checkboxes should be checked! the jQuery patch didn't work", this.checked, { id: 'ember-testing.test-checkbox-click' })); }); }); } }); define("ember-testing/lib/test", ["exports", "ember-testing/lib/test/helpers", "ember-testing/lib/test/on_inject_helpers", "ember-testing/lib/test/promise", "ember-testing/lib/test/waiters", "ember-testing/lib/test/adapter"], function (_exports, _helpers, _on_inject_helpers, _promise, _waiters, _adapter) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = void 0; /** @module ember */ /** This is a container for an assortment of testing related functionality: * Choose your default test adapter (for your framework of choice). * Register/Unregister additional test helpers. * Setup callbacks to be fired when the test helpers are injected into your application. @class Test @namespace Ember @public */ var Test = { /** Hash containing all known test helpers. @property _helpers @private @since 1.7.0 */ _helpers: _helpers.helpers, registerHelper: _helpers.registerHelper, registerAsyncHelper: _helpers.registerAsyncHelper, unregisterHelper: _helpers.unregisterHelper, onInjectHelpers: _on_inject_helpers.onInjectHelpers, Promise: _promise.default, promise: _promise.promise, resolve: _promise.resolve, registerWaiter: _waiters.registerWaiter, unregisterWaiter: _waiters.unregisterWaiter, checkWaiters: _waiters.checkWaiters }; /** Used to allow ember-testing to communicate with a specific testing framework. You can manually set it before calling `App.setupForTesting()`. Example: ```javascript Ember.Test.adapter = MyCustomAdapter.create() ``` If you do not set it, ember-testing will default to `Ember.Test.QUnitAdapter`. @public @for Ember.Test @property adapter @type {Class} The adapter to be used. @default Ember.Test.QUnitAdapter */ Object.defineProperty(Test, 'adapter', { get: _adapter.getAdapter, set: _adapter.setAdapter }); var _default = Test; _exports.default = _default; }); define("ember-testing/lib/test/adapter", ["exports", "@ember/-internals/error-handling"], function (_exports, _errorHandling) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.getAdapter = getAdapter; _exports.setAdapter = setAdapter; _exports.asyncStart = asyncStart; _exports.asyncEnd = asyncEnd; var adapter; function getAdapter() { return adapter; } function setAdapter(value) { adapter = value; if (value && typeof value.exception === 'function') { (0, _errorHandling.setDispatchOverride)(adapterDispatch); } else { (0, _errorHandling.setDispatchOverride)(null); } } function asyncStart() { if (adapter) { adapter.asyncStart(); } } function asyncEnd() { if (adapter) { adapter.asyncEnd(); } } function adapterDispatch(error) { adapter.exception(error); console.error(error.stack); // eslint-disable-line no-console } }); define("ember-testing/lib/test/helpers", ["exports", "ember-testing/lib/test/promise"], function (_exports, _promise) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.registerHelper = registerHelper; _exports.registerAsyncHelper = registerAsyncHelper; _exports.unregisterHelper = unregisterHelper; _exports.helpers = void 0; var helpers = {}; /** @module @ember/test */ /** `registerHelper` is used to register a test helper that will be injected when `App.injectTestHelpers` is called. The helper method will always be called with the current Application as the first parameter. For example: ```javascript import { registerHelper } from '@ember/test'; import { run } from '@ember/runloop'; registerHelper('boot', function(app) { run(app, app.advanceReadiness); }); ``` This helper can later be called without arguments because it will be called with `app` as the first parameter. ```javascript import Application from '@ember/application'; App = Application.create(); App.injectTestHelpers(); boot(); ``` @public @for @ember/test @static @method registerHelper @param {String} name The name of the helper method to add. @param {Function} helperMethod @param options {Object} */ _exports.helpers = helpers; function registerHelper(name, helperMethod) { helpers[name] = { method: helperMethod, meta: { wait: false } }; } /** `registerAsyncHelper` is used to register an async test helper that will be injected when `App.injectTestHelpers` is called. The helper method will always be called with the current Application as the first parameter. For example: ```javascript import { registerAsyncHelper } from '@ember/test'; import { run } from '@ember/runloop'; registerAsyncHelper('boot', function(app) { run(app, app.advanceReadiness); }); ``` The advantage of an async helper is that it will not run until the last async helper has completed. All async helpers after it will wait for it complete before running. For example: ```javascript import { registerAsyncHelper } from '@ember/test'; registerAsyncHelper('deletePost', function(app, postId) { click('.delete-' + postId); }); // ... in your test visit('/post/2'); deletePost(2); visit('/post/3'); deletePost(3); ``` @public @for @ember/test @method registerAsyncHelper @param {String} name The name of the helper method to add. @param {Function} helperMethod @since 1.2.0 */ function registerAsyncHelper(name, helperMethod) { helpers[name] = { method: helperMethod, meta: { wait: true } }; } /** Remove a previously added helper method. Example: ```javascript import { unregisterHelper } from '@ember/test'; unregisterHelper('wait'); ``` @public @method unregisterHelper @static @for @ember/test @param {String} name The helper to remove. */ function unregisterHelper(name) { delete helpers[name]; delete _promise.default.prototype[name]; } }); define("ember-testing/lib/test/on_inject_helpers", ["exports"], function (_exports) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.onInjectHelpers = onInjectHelpers; _exports.invokeInjectHelpersCallbacks = invokeInjectHelpersCallbacks; _exports.callbacks = void 0; var callbacks = []; /** Used to register callbacks to be fired whenever `App.injectTestHelpers` is called. The callback will receive the current application as an argument. Example: ```javascript import $ from 'jquery'; Ember.Test.onInjectHelpers(function() { $(document).ajaxSend(function() { Test.pendingRequests++; }); $(document).ajaxComplete(function() { Test.pendingRequests--; }); }); ``` @public @for Ember.Test @method onInjectHelpers @param {Function} callback The function to be called. */ _exports.callbacks = callbacks; function onInjectHelpers(callback) { callbacks.push(callback); } function invokeInjectHelpersCallbacks(app) { for (var i = 0; i < callbacks.length; i++) { callbacks[i](app); } } }); define("ember-testing/lib/test/pending_requests", ["exports"], function (_exports) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.pendingRequests = pendingRequests; _exports.clearPendingRequests = clearPendingRequests; _exports.incrementPendingRequests = incrementPendingRequests; _exports.decrementPendingRequests = decrementPendingRequests; var requests = []; function pendingRequests() { return requests.length; } function clearPendingRequests() { requests.length = 0; } function incrementPendingRequests(_, xhr) { requests.push(xhr); } function decrementPendingRequests(_, xhr) { setTimeout(function () { for (var i = 0; i < requests.length; i++) { if (xhr === requests[i]) { requests.splice(i, 1); break; } } }, 0); } }); define("ember-testing/lib/test/promise", ["exports", "@ember/-internals/runtime", "ember-testing/lib/test/run"], function (_exports, _runtime, _run) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.promise = promise; _exports.resolve = resolve; _exports.getLastPromise = getLastPromise; _exports.default = void 0; var lastPromise; class TestPromise extends _runtime.RSVP.Promise { constructor() { super(...arguments); lastPromise = this; } then(_onFulfillment, ...args) { var onFulfillment = typeof _onFulfillment === 'function' ? result => isolate(_onFulfillment, result) : undefined; return super.then(onFulfillment, ...args); } } /** This returns a thenable tailored for testing. It catches failed `onSuccess` callbacks and invokes the `Ember.Test.adapter.exception` callback in the last chained then. This method should be returned by async helpers such as `wait`. @public @for Ember.Test @method promise @param {Function} resolver The function used to resolve the promise. @param {String} label An optional string for identifying the promise. */ _exports.default = TestPromise; function promise(resolver, label) { var fullLabel = "Ember.Test.promise: " + (label || '<Unknown Promise>'); return new TestPromise(resolver, fullLabel); } /** Replacement for `Ember.RSVP.resolve` The only difference is this uses an instance of `Ember.Test.Promise` @public @for Ember.Test @method resolve @param {Mixed} The value to resolve @since 1.2.0 */ function resolve(result, label) { return TestPromise.resolve(result, label); } function getLastPromise() { return lastPromise; } // This method isolates nested async methods // so that they don't conflict with other last promises. // // 1. Set `Ember.Test.lastPromise` to null // 2. Invoke method // 3. Return the last promise created during method function isolate(onFulfillment, result) { // Reset lastPromise for nested helpers lastPromise = null; var value = onFulfillment(result); var promise = lastPromise; lastPromise = null; // If the method returned a promise // return that promise. If not, // return the last async helper's promise if (value && value instanceof TestPromise || !promise) { return value; } else { return (0, _run.default)(() => resolve(promise).then(() => value)); } } }); define("ember-testing/lib/test/run", ["exports", "@ember/runloop"], function (_exports, _runloop) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.default = run; function run(fn) { if (!(0, _runloop.getCurrentRunLoop)()) { return (0, _runloop.run)(fn); } else { return fn(); } } }); define("ember-testing/lib/test/waiters", ["exports"], function (_exports) { "use strict"; Object.defineProperty(_exports, "__esModule", { value: true }); _exports.registerWaiter = registerWaiter; _exports.unregisterWaiter = unregisterWaiter; _exports.checkWaiters = checkWaiters; /** @module @ember/test */ var contexts = []; var callbacks = []; /** This allows ember-testing to play nicely with other asynchronous events, such as an application that is waiting for a CSS3 transition or an IndexDB transaction. The waiter runs periodically after each async helper (i.e. `click`, `andThen`, `visit`, etc) has executed, until the returning result is truthy. After the waiters finish, the next async helper is executed and the process repeats. For example: ```javascript import { registerWaiter } from '@ember/test'; registerWaiter(function() { return myPendingTransactions() === 0; }); ``` The `context` argument allows you to optionally specify the `this` with which your callback will be invoked. For example: ```javascript import { registerWaiter } from '@ember/test'; registerWaiter(MyDB, MyDB.hasPendingTransactions); ``` @public @for @ember/test @static @method registerWaiter @param {Object} context (optional) @param {Function} callback @since 1.2.0 */ function registerWaiter(context, callback) { if (arguments.length === 1) { callback = context; context = null; } if (indexOf(context, callback) > -1) { return; } contexts.push(context); callbacks.push(callback); } /** `unregisterWaiter` is used to unregister a callback that was registered with `registerWaiter`. @public @for @ember/test @static @method unregisterWaiter @param {Object} context (optional) @param {Function} callback @since 1.2.0 */ function unregisterWaiter(context, callback) { if (!callbacks.length) { return; } if (arguments.length === 1) { callback = context; context = null; } var i = indexOf(context, callback); if (i === -1) { return; } contexts.splice(i, 1); callbacks.splice(i, 1); } /** Iterates through each registered test waiter, and invokes its callback. If any waiter returns false, this method will return true indicating that the waiters have not settled yet. This is generally used internally from the acceptance/integration test infrastructure. @public @for @ember/test @static @method checkWaiters */ function checkWaiters() { if (!callbacks.length) { return false; } for (var i = 0; i < callbacks.length; i++) { var context = contexts[i]; var callback = callbacks[i]; if (!callback.call(context)) { return true; } } return false; } function indexOf(context, callback) { for (var i = 0; i < callbacks.length; i++) { if (callbacks[i] === callback && contexts[i] === context) { return i; } } return -1; } }); var testing = require('ember-testing'); Ember.Test = testing.Test; Ember.Test.Adapter = testing.Adapter; Ember.Test.QUnitAdapter = testing.QUnitAdapter; Ember.setupForTesting = testing.setupForTesting; }()); //# sourceMappingURL=ember-testing.map
#!/usr/bin/env node const fs = require('fs'); const path = require('path'); const spawn = require('cross-spawn'); const which = require('which'); const args = process.argv.slice(2); // copied from https://github.com/kentcdodds/kcd-scripts/blob/master/src/utils.js function resolveBin(modName, { executable = modName, cwd = process.cwd() } = {}) { let pathFromWhich; try { pathFromWhich = fs.realpathSync(which.sync(executable)); } catch (_error) { // ignore _error } try { const modPkgPath = require.resolve(`${modName}/package.json`); const modPkgDir = path.dirname(modPkgPath); /* eslint-disable import/no-dynamic-require */ /* eslint-disable global-require */ const { bin } = require(modPkgPath); /* eslint-enable */ const binPath = typeof bin === 'string' ? bin : bin[executable]; const fullPathToBin = path.join(modPkgDir, binPath); if (fullPathToBin === pathFromWhich) { return executable; } return fullPathToBin.replace(cwd, '.'); } catch (error) { if (pathFromWhich) { return executable; } throw error; } } const result = spawn.sync(resolveBin('eslint'), args, { stdio: 'inherit' }); process.exit(result.status);
/*! Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License.txt in the project root for license information. Build: 4.4.2.winjs.2017.3.14 Version: WinJS.4.4 */ (function () { var globalObject = typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : typeof global !== 'undefined' ? global : {}; globalObject.strings = globalObject.strings || {}; function addStrings(keyPrefix, strings) { Object.keys(strings).forEach(function (key) { globalObject.strings[keyPrefix + key] = strings[key]; }); } addStrings("ms-resource:///Microsoft.WinJS/", { "tv/scrollViewerPageDown": "Page Down", "tv/scrollViewerPageUp": "Page Up", "ui/appBarAriaLabel": "App Bar", "ui/appBarCommandAriaLabel": "App Bar Item", "ui/appBarOverflowButtonAriaLabel": "View more", "ui/autoSuggestBoxAriaLabel": "Autosuggestbox", "ui/autoSuggestBoxAriaLabelInputNoPlaceHolder": "Autosuggestbox, enter to submit query, esc to clear text", "ui/autoSuggestBoxAriaLabelInputPlaceHolder": "Autosuggestbox, {0}, enter to submit query, esc to clear text", "ui/autoSuggestBoxAriaLabelQuery": "Suggestion: {0}", "_ui/autoSuggestBoxAriaLabelQuery.comment": "Suggestion: query text (example: Suggestion: contoso)", "ui/autoSuggestBoxAriaLabelSeparator": "Separator: {0}", "_ui/autoSuggestBoxAriaLabelSeparator.comment": "Separator: separator text (example: Separator: People or Separator: Apps)", "ui/autoSuggestBoxAriaLabelResult": "Result: {0}, {1}", "_ui/autoSuggestBoxAriaLabelResult.comment": "Result: text, detailed text (example: Result: contoso, www.contoso.com)", "ui/averageRating": "Average Rating", "ui/backbuttonarialabel": "Back", "ui/chapterSkipBackMediaCommandDisplayText": "Chapter back", "ui/chapterSkipForwardMediaCommandDisplayText": "Chapter forward", "ui/clearYourRating": "Clear your rating", "ui/closedCaptionsLabelNone": "Off", "ui/closedCaptionsMediaCommandDisplayText": "Closed captioning", "ui/closeOverlay": "Close", "ui/commandingSurfaceAriaLabel": "CommandingSurface", "ui/commandingSurfaceOverflowButtonAriaLabel": "View more", "ui/datePicker": "Date Picker", "ui/fastForwardMediaCommandDisplayText": "Fast forward", "ui/fastForwardFeedbackDisplayText": " {0}X", "ui/fastForwardFeedbackSlowMotionDisplayText": "0.5X", "ui/flipViewPanningContainerAriaLabel": "Scrolling Container", "ui/flyoutAriaLabel": "Flyout", "ui/goToFullScreenButtonLabel": "Go full screen", "ui/goToLiveMediaCommandDisplayText": "LIVE", "ui/hubViewportAriaLabel": "Scrolling Container", "ui/listViewViewportAriaLabel": "Scrolling Container", "ui/mediaErrorAborted": "Playback was interrupted. Please try again.", "ui/mediaErrorNetwork": "There was a network connection error.", "ui/mediaErrorDecode": "The content could not be decoded", "ui/mediaErrorSourceNotSupported": "This content type is not supported.", "ui/mediaErrorUnknown": "There was an unknown error.", "ui/mediaPlayerAudioTracksButtonLabel": "Audio tracks", "ui/mediaPlayerCastButtonLabel": "Cast", "ui/mediaPlayerChapterSkipBackButtonLabel": "Previous", "ui/mediaPlayerChapterSkipForwardButtonLabel": "Next", "ui/mediaPlayerClosedCaptionsButtonLabel": "Closed captions", "ui/mediaPlayerFastForwardButtonLabel": "Fast forward", "ui/mediaPlayerFullscreenButtonLabel": "Fullscreen", "ui/mediaPlayerLiveButtonLabel": "LIVE", "ui/mediaPlayerNextTrackButtonLabel": "Next", "ui/mediaPlayerOverlayActiveOptionIndicator": "(On)", "ui/mediaPlayerPauseButtonLabel": "Pause", "ui/mediaPlayerPlayButtonLabel": "Play", "ui/mediaPlayerPlayFromBeginningButtonLabel": "Replay", "ui/mediaPlayerPlayRateButtonLabel": "Playback rate", "ui/mediaPlayerPreviousTrackButtonLabel": "Previous", "ui/mediaPlayerRewindButtonLabel": "Rewind", "ui/mediaPlayerStopButtonLabel": "Stop", "ui/mediaPlayerTimeSkipBackButtonLabel": "8 second replay", "ui/mediaPlayerTimeSkipForwardButtonLabel": "30 second skip", "ui/mediaPlayerToggleSnapButtonLabel": "Snap", "ui/mediaPlayerVolumeButtonLabel": "Volume", "ui/mediaPlayerZoomButtonLabel": "Zoom", "ui/menuCommandAriaLabel": "Menu Item", "ui/menuAriaLabel": "Menu", "ui/navBarContainerViewportAriaLabel": "Scrolling Container", "ui/nextTrackMediaCommandDisplayText": "Next track", "ui/off": "Off", "ui/on": "On", "ui/pauseMediaCommandDisplayText": "Pause", "ui/playFromBeginningMediaCommandDisplayText": "Play again", "ui/playbackRateHalfSpeedLabel": "0.5x", "ui/playbackRateNormalSpeedLabel": "Normal", "ui/playbackRateOneAndHalfSpeedLabel": "1.5x", "ui/playbackRateDoubleSpeedLabel": "2x", "ui/playMediaCommandDisplayText": "Play", "ui/pivotAriaLabel": "Pivot", "ui/pivotViewportAriaLabel": "Scrolling Container", "ui/replayMediaCommandDisplayText": "Play again", "ui/rewindMediaCommandDisplayText": "Rewind", "ui/rewindFeedbackDisplayText": " {0}X", "ui/rewindFeedbackSlowMotionDisplayText": "0.5X", "ui/searchBoxAriaLabel": "Searchbox", "ui/searchBoxAriaLabelInputNoPlaceHolder": "Searchbox, enter to submit query, esc to clear text", "ui/searchBoxAriaLabelInputPlaceHolder": "Searchbox, {0}, enter to submit query, esc to clear text", "ui/searchBoxAriaLabelButton": "Click to submit query", "ui/seeMore": "See more", "ui/selectAMPM": "Select A.M P.M", "ui/selectDay": "Select Day", "ui/selectHour": "Select Hour", "ui/selectMinute": "Select Minute", "ui/selectMonth": "Select Month", "ui/selectYear": "Select Year", "ui/settingsFlyoutAriaLabel": "Settings Flyout", "ui/stopMediaCommandDisplayText": "Stop", "ui/tentativeRating": "Tentative Rating", "ui/timePicker": "Time Picker", "ui/timeSeparator": ":", "ui/timeSkipBackMediaCommandDisplayText": "Skip back", "ui/timeSkipForwardMediaCommandDisplayText": "Skip forward", "ui/toolbarAriaLabel": "ToolBar", "ui/toolbarOverflowButtonAriaLabel": "View more", "ui/unrated": "Unrated", "ui/userRating": "User Rating", "ui/zoomMediaCommandDisplayText": "Zoom", // AppBar Icons follow, the format of the ui.js and ui.resjson differ for // the AppBarIcon namespace. The remainder of the file therefore differs. // Code point comments are the icon glyphs in the 'Segoe UI Symbol' font. "ui/appBarIcons/previous": "\uE100", // group:Media "_ui/appBarIcons/previous.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/next": "\uE101", // group:Media "_ui/appBarIcons/next.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/play": "\uE102", // group:Media "_ui/appBarIcons/play.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/pause": "\uE103", // group:Media "_ui/appBarIcons/pause.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/edit": "\uE104", // group:File "_ui/appBarIcons/edit.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/save": "\uE105", // group:File "_ui/appBarIcons/save.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/clear": "\uE106", // group:File "_ui/appBarIcons/clear.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/delete": "\uE107", // group:File "_ui/appBarIcons/delete.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/remove": "\uE108", // group:File "_ui/appBarIcons/remove.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/add": "\uE109", // group:File "_ui/appBarIcons/add.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/cancel": "\uE10A", // group:Editing "_ui/appBarIcons/cancel.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/accept": "\uE10B", // group:General "_ui/appBarIcons/accept.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/more": "\uE10C", // group:General "_ui/appBarIcons/more.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/redo": "\uE10D", // group:Editing "_ui/appBarIcons/redo.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/undo": "\uE10E", // group:Editing "_ui/appBarIcons/undo.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/home": "\uE10F", // group:General "_ui/appBarIcons/home.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/up": "\uE110", // group:General "_ui/appBarIcons/up.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/forward": "\uE111", // group:General "_ui/appBarIcons/forward.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/right": "\uE111", // group:General "_ui/appBarIcons/right.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/back": "\uE112", // group:General "_ui/appBarIcons/back.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/left": "\uE112", // group:General "_ui/appBarIcons/left.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/favorite": "\uE113", // group:Media "_ui/appBarIcons/favorite.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/camera": "\uE114", // group:System "_ui/appBarIcons/camera.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/settings": "\uE115", // group:System "_ui/appBarIcons/settings.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/video": "\uE116", // group:Media "_ui/appBarIcons/video.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/sync": "\uE117", // group:Media "_ui/appBarIcons/sync.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/download": "\uE118", // group:Media "_ui/appBarIcons/download.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/mail": "\uE119", // group:Mail and calendar "_ui/appBarIcons/mail.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/find": "\uE11A", // group:Data "_ui/appBarIcons/find.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/help": "\uE11B", // group:General "_ui/appBarIcons/help.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/upload": "\uE11C", // group:Media "_ui/appBarIcons/upload.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/emoji": "\uE11D", // group:Communications "_ui/appBarIcons/emoji.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/twopage": "\uE11E", // group:Layout "_ui/appBarIcons/twopage.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/leavechat": "\uE11F", // group:Communications "_ui/appBarIcons/leavechat.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/mailforward": "\uE120", // group:Mail and calendar "_ui/appBarIcons/mailforward.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/clock": "\uE121", // group:General "_ui/appBarIcons/clock.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/send": "\uE122", // group:Mail and calendar "_ui/appBarIcons/send.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/crop": "\uE123", // group:Editing "_ui/appBarIcons/crop.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/rotatecamera": "\uE124", // group:System "_ui/appBarIcons/rotatecamera.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/people": "\uE125", // group:Communications "_ui/appBarIcons/people.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/closepane": "\uE126", // group:Layout "_ui/appBarIcons/closepane.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/openpane": "\uE127", // group:Layout "_ui/appBarIcons/openpane.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/world": "\uE128", // group:General "_ui/appBarIcons/world.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/flag": "\uE129", // group:Mail and calendar "_ui/appBarIcons/flag.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/previewlink": "\uE12A", // group:General "_ui/appBarIcons/previewlink.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/globe": "\uE12B", // group:Communications "_ui/appBarIcons/globe.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/trim": "\uE12C", // group:Editing "_ui/appBarIcons/trim.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/attachcamera": "\uE12D", // group:System "_ui/appBarIcons/attachcamera.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/zoomin": "\uE12E", // group:Layout "_ui/appBarIcons/zoomin.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/bookmarks": "\uE12F", // group:Editing "_ui/appBarIcons/bookmarks.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/document": "\uE130", // group:File "_ui/appBarIcons/document.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/protecteddocument": "\uE131", // group:File "_ui/appBarIcons/protecteddocument.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/page": "\uE132", // group:Layout "_ui/appBarIcons/page.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/bullets": "\uE133", // group:Editing "_ui/appBarIcons/bullets.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/comment": "\uE134", // group:Communications "_ui/appBarIcons/comment.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/mail2": "\uE135", // group:Mail and calendar "_ui/appBarIcons/mail2.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/contactinfo": "\uE136", // group:Communications "_ui/appBarIcons/contactinfo.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/hangup": "\uE137", // group:Communications "_ui/appBarIcons/hangup.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/viewall": "\uE138", // group:Data "_ui/appBarIcons/viewall.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/mappin": "\uE139", // group:General "_ui/appBarIcons/mappin.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/phone": "\uE13A", // group:Communications "_ui/appBarIcons/phone.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/videochat": "\uE13B", // group:Communications "_ui/appBarIcons/videochat.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/switch": "\uE13C", // group:Communications "_ui/appBarIcons/switch.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/contact": "\uE13D", // group:Communications "_ui/appBarIcons/contact.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/rename": "\uE13E", // group:File "_ui/appBarIcons/rename.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/pin": "\uE141", // group:System "_ui/appBarIcons/pin.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/musicinfo": "\uE142", // group:Media "_ui/appBarIcons/musicinfo.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/go": "\uE143", // group:General "_ui/appBarIcons/go.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/keyboard": "\uE144", // group:System "_ui/appBarIcons/keyboard.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/dockleft": "\uE145", // group:Layout "_ui/appBarIcons/dockleft.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/dockright": "\uE146", // group:Layout "_ui/appBarIcons/dockright.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/dockbottom": "\uE147", // group:Layout "_ui/appBarIcons/dockbottom.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/remote": "\uE148", // group:System "_ui/appBarIcons/remote.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/refresh": "\uE149", // group:Data "_ui/appBarIcons/refresh.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/rotate": "\uE14A", // group:Layout "_ui/appBarIcons/rotate.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/shuffle": "\uE14B", // group:Media "_ui/appBarIcons/shuffle.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/list": "\uE14C", // group:Editing "_ui/appBarIcons/list.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/shop": "\uE14D", // group:General "_ui/appBarIcons/shop.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/selectall": "\uE14E", // group:Data "_ui/appBarIcons/selectall.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/orientation": "\uE14F", // group:Layout "_ui/appBarIcons/orientation.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/import": "\uE150", // group:Data "_ui/appBarIcons/import.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/importall": "\uE151", // group:Data "_ui/appBarIcons/importall.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/browsephotos": "\uE155", // group:Media "_ui/appBarIcons/browsephotos.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/webcam": "\uE156", // group:System "_ui/appBarIcons/webcam.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/pictures": "\uE158", // group:Media "_ui/appBarIcons/pictures.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/savelocal": "\uE159", // group:File "_ui/appBarIcons/savelocal.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/caption": "\uE15A", // group:Media "_ui/appBarIcons/caption.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/stop": "\uE15B", // group:Media "_ui/appBarIcons/stop.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/showresults": "\uE15C", // group:Data "_ui/appBarIcons/showresults.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/volume": "\uE15D", // group:Media "_ui/appBarIcons/volume.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/repair": "\uE15E", // group:System "_ui/appBarIcons/repair.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/message": "\uE15F", // group:Communications "_ui/appBarIcons/message.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/page2": "\uE160", // group:Layout "_ui/appBarIcons/page2.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/calendarday": "\uE161", // group:Mail and calendar "_ui/appBarIcons/calendarday.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/calendarweek": "\uE162", // group:Mail and calendar "_ui/appBarIcons/calendarweek.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/calendar": "\uE163", // group:Mail and calendar "_ui/appBarIcons/calendar.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/characters": "\uE164", // group:Editing "_ui/appBarIcons/characters.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/mailreplyall": "\uE165", // group:Mail and calendar "_ui/appBarIcons/mailreplyall.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/read": "\uE166", // group:Mail and calendar "_ui/appBarIcons/read.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/link": "\uE167", // group:Communications "_ui/appBarIcons/link.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/accounts": "\uE168", // group:Communications "_ui/appBarIcons/accounts.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/showbcc": "\uE169", // group:Mail and calendar "_ui/appBarIcons/showbcc.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/hidebcc": "\uE16A", // group:Mail and calendar "_ui/appBarIcons/hidebcc.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/cut": "\uE16B", // group:Editing "_ui/appBarIcons/cut.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/attach": "\uE16C", // group:Mail and calendar "_ui/appBarIcons/attach.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/paste": "\uE16D", // group:Editing "_ui/appBarIcons/paste.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/filter": "\uE16E", // group:Data "_ui/appBarIcons/filter.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/copy": "\uE16F", // group:Editing "_ui/appBarIcons/copy.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/emoji2": "\uE170", // group:Mail and calendar "_ui/appBarIcons/emoji2.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/important": "\uE171", // group:Mail and calendar "_ui/appBarIcons/important.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/mailreply": "\uE172", // group:Mail and calendar "_ui/appBarIcons/mailreply.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/slideshow": "\uE173", // group:Media "_ui/appBarIcons/slideshow.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/sort": "\uE174", // group:Data "_ui/appBarIcons/sort.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/manage": "\uE178", // group:System "_ui/appBarIcons/manage.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/allapps": "\uE179", // group:System "_ui/appBarIcons/allapps.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/disconnectdrive": "\uE17A", // group:System "_ui/appBarIcons/disconnectdrive.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/mapdrive": "\uE17B", // group:System "_ui/appBarIcons/mapdrive.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/newwindow": "\uE17C", // group:System "_ui/appBarIcons/newwindow.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/openwith": "\uE17D", // group:System "_ui/appBarIcons/openwith.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/contactpresence": "\uE181", // group:Communications "_ui/appBarIcons/contactpresence.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/priority": "\uE182", // group:Mail and calendar "_ui/appBarIcons/priority.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/uploadskydrive": "\uE183", // group:File "_ui/appBarIcons/uploadskydrive.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/gototoday": "\uE184", // group:Mail and calendar "_ui/appBarIcons/gototoday.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/font": "\uE185", // group:Editing "_ui/appBarIcons/font.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/fontcolor": "\uE186", // group:Editing "_ui/appBarIcons/fontcolor.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/contact2": "\uE187", // group:Communications "_ui/appBarIcons/contact2.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/folder": "\uE188", // group:File "_ui/appBarIcons/folder.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/audio": "\uE189", // group:Media "_ui/appBarIcons/audio.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/placeholder": "\uE18A", // group:General "_ui/appBarIcons/placeholder.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/view": "\uE18B", // group:Layout "_ui/appBarIcons/view.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/setlockscreen": "\uE18C", // group:System "_ui/appBarIcons/setlockscreen.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/settile": "\uE18D", // group:System "_ui/appBarIcons/settile.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/cc": "\uE190", // group:Media "_ui/appBarIcons/cc.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/stopslideshow": "\uE191", // group:Media "_ui/appBarIcons/stopslideshow.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/permissions": "\uE192", // group:System "_ui/appBarIcons/permissions.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/highlight": "\uE193", // group:Editing "_ui/appBarIcons/highlight.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/disableupdates": "\uE194", // group:System "_ui/appBarIcons/disableupdates.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/unfavorite": "\uE195", // group:Media "_ui/appBarIcons/unfavorite.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/unpin": "\uE196", // group:System "_ui/appBarIcons/unpin.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/openlocal": "\uE197", // group:File "_ui/appBarIcons/openlocal.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/mute": "\uE198", // group:Media "_ui/appBarIcons/mute.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/italic": "\uE199", // group:Editing "_ui/appBarIcons/italic.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/underline": "\uE19A", // group:Editing "_ui/appBarIcons/underline.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/bold": "\uE19B", // group:Editing "_ui/appBarIcons/bold.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/movetofolder": "\uE19C", // group:File "_ui/appBarIcons/movetofolder.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/likedislike": "\uE19D", // group:Data "_ui/appBarIcons/likedislike.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/dislike": "\uE19E", // group:Data "_ui/appBarIcons/dislike.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/like": "\uE19F", // group:Data "_ui/appBarIcons/like.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/alignright": "\uE1A0", // group:Editing "_ui/appBarIcons/alignright.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/aligncenter": "\uE1A1", // group:Editing "_ui/appBarIcons/aligncenter.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/alignleft": "\uE1A2", // group:Editing "_ui/appBarIcons/alignleft.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/zoom": "\uE1A3", // group:Layout "_ui/appBarIcons/zoom.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/zoomout": "\uE1A4", // group:Layout "_ui/appBarIcons/zoomout.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/openfile": "\uE1A5", // group:File "_ui/appBarIcons/openfile.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/otheruser": "\uE1A6", // group:System "_ui/appBarIcons/otheruser.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/admin": "\uE1A7", // group:System "_ui/appBarIcons/admin.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/street": "\uE1C3", // group:General "_ui/appBarIcons/street.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/map": "\uE1C4", // group:General "_ui/appBarIcons/map.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/clearselection": "\uE1C5", // group:Data "_ui/appBarIcons/clearselection.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/fontdecrease": "\uE1C6", // group:Editing "_ui/appBarIcons/fontdecrease.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/fontincrease": "\uE1C7", // group:Editing "_ui/appBarIcons/fontincrease.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/fontsize": "\uE1C8", // group:Editing "_ui/appBarIcons/fontsize.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/cellphone": "\uE1C9", // group:Communications "_ui/appBarIcons/cellphone.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/print": "\uE749", // group:Communications "_ui/appBarIcons/print.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/share": "\uE72D", // group:Communications "_ui/appBarIcons/share.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/reshare": "\uE1CA", // group:Communications "_ui/appBarIcons/reshare.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/tag": "\uE1CB", // group:Data "_ui/appBarIcons/tag.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/repeatone": "\uE1CC", // group:Media "_ui/appBarIcons/repeatone.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/repeatall": "\uE1CD", // group:Media "_ui/appBarIcons/repeatall.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/outlinestar": "\uE1CE", // group:Data "_ui/appBarIcons/outlinestar.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/solidstar": "\uE1CF", // group:Data "_ui/appBarIcons/solidstar.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/calculator": "\uE1D0", // group:General "_ui/appBarIcons/calculator.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/directions": "\uE1D1", // group:General "_ui/appBarIcons/directions.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/target": "\uE1D2", // group:General "_ui/appBarIcons/target.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/library": "\uE1D3", // group:Media "_ui/appBarIcons/library.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/phonebook": "\uE1D4", // group:Communications "_ui/appBarIcons/phonebook.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/memo": "\uE1D5", // group:Communications "_ui/appBarIcons/memo.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/microphone": "\uE1D6", // group:System "_ui/appBarIcons/microphone.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/postupdate": "\uE1D7", // group:Communications "_ui/appBarIcons/postupdate.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/backtowindow": "\uE1D8", // group:Layout "_ui/appBarIcons/backtowindow.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/fullscreen": "\uE1D9", // group:Layout "_ui/appBarIcons/fullscreen.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/newfolder": "\uE1DA", // group:File "_ui/appBarIcons/newfolder.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/calendarreply": "\uE1DB", // group:Mail and calendar "_ui/appBarIcons/calendarreply.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/unsyncfolder": "\uE1DD", // group:File "_ui/appBarIcons/unsyncfolder.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/reporthacked": "\uE1DE", // group:Communications "_ui/appBarIcons/reporthacked.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/syncfolder": "\uE1DF", // group:File "_ui/appBarIcons/syncfolder.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/blockcontact": "\uE1E0", // group:Communications "_ui/appBarIcons/blockcontact.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/switchapps": "\uE1E1", // group:System "_ui/appBarIcons/switchapps.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/addfriend": "\uE1E2", // group:Communications "_ui/appBarIcons/addfriend.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/touchpointer": "\uE1E3", // group:System "_ui/appBarIcons/touchpointer.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/gotostart": "\uE1E4", // group:System "_ui/appBarIcons/gotostart.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/zerobars": "\uE1E5", // group:System "_ui/appBarIcons/zerobars.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/onebar": "\uE1E6", // group:System "_ui/appBarIcons/onebar.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/twobars": "\uE1E7", // group:System "_ui/appBarIcons/twobars.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/threebars": "\uE1E8", // group:System "_ui/appBarIcons/threebars.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/fourbars": "\uE1E9", // group:System "_ui/appBarIcons/fourbars.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/scan": "\uE294", // group:General "_ui/appBarIcons/scan.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/preview": "\uE295", // group:General "_ui/appBarIcons/preview.comment": "{Locked=qps-ploc,qps-plocm}", "ui/appBarIcons/hamburger": "\uE700", // group:General "_ui/appBarIcons/hamburger.comment": "{Locked=qps-ploc,qps-plocm}" } ); }());
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.association = association; var _ormMetadata = require('../orm-metadata'); function association(associationData) { return function (target, propertyName) { if (!associationData) { associationData = { entity: propertyName }; } else if (typeof associationData === 'string') { associationData = { entity: associationData }; } _ormMetadata.OrmMetadata.forTarget(target.constructor).put('associations', propertyName, { type: associationData.entity ? 'entity' : 'collection', entity: associationData.entity || associationData.collection }); }; }
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * * @format */ 'use strict'; function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } import * as React from 'react'; import { useCallback, useMemo, useState, useRef } from 'react'; import usePressEvents from '../../modules/usePressEvents'; import setAndForwardRef from '../../modules/setAndForwardRef'; import StyleSheet from '../StyleSheet'; import View from '../View'; function createExtraStyles(activeOpacity, underlayColor) { return { child: { opacity: activeOpacity !== null && activeOpacity !== void 0 ? activeOpacity : 0.85 }, underlay: { backgroundColor: underlayColor === undefined ? 'black' : underlayColor } }; } function hasPressHandler(props) { return props.onPress != null || props.onPressIn != null || props.onPressOut != null || props.onLongPress != null; } /** * A wrapper for making views respond properly to touches. * On press down, the opacity of the wrapped view is decreased, which allows * the underlay color to show through, darkening or tinting the view. * * The underlay comes from wrapping the child in a new View, which can affect * layout, and sometimes cause unwanted visual artifacts if not used correctly, * for example if the backgroundColor of the wrapped view isn't explicitly set * to an opaque color. * * TouchableHighlight must have one child (not zero or more than one). * If you wish to have several child components, wrap them in a View. */ function TouchableHighlight(props, forwardedRef) { var accessible = props.accessible, activeOpacity = props.activeOpacity, children = props.children, delayPressIn = props.delayPressIn, delayPressOut = props.delayPressOut, delayLongPress = props.delayLongPress, disabled = props.disabled, focusable = props.focusable, onHideUnderlay = props.onHideUnderlay, onLongPress = props.onLongPress, onPress = props.onPress, onPressIn = props.onPressIn, onPressOut = props.onPressOut, onShowUnderlay = props.onShowUnderlay, rejectResponderTermination = props.rejectResponderTermination, style = props.style, testOnly_pressed = props.testOnly_pressed, underlayColor = props.underlayColor, rest = _objectWithoutPropertiesLoose(props, ["accessible", "activeOpacity", "children", "delayPressIn", "delayPressOut", "delayLongPress", "disabled", "focusable", "onHideUnderlay", "onLongPress", "onPress", "onPressIn", "onPressOut", "onShowUnderlay", "rejectResponderTermination", "style", "testOnly_pressed", "underlayColor"]); var hostRef = useRef(null); var setRef = setAndForwardRef({ getForwardedRef: function getForwardedRef() { return forwardedRef; }, setLocalRef: function setLocalRef(hostNode) { hostRef.current = hostNode; } }); var _useState = useState(testOnly_pressed === true ? createExtraStyles(activeOpacity, underlayColor) : null), extraStyles = _useState[0], setExtraStyles = _useState[1]; var showUnderlay = useCallback(function () { if (!hasPressHandler(props)) { return; } setExtraStyles(createExtraStyles(activeOpacity, underlayColor)); if (onShowUnderlay != null) { onShowUnderlay(); } }, [activeOpacity, onShowUnderlay, props, underlayColor]); var hideUnderlay = useCallback(function () { if (testOnly_pressed === true) { return; } if (hasPressHandler(props)) { setExtraStyles(null); if (onHideUnderlay != null) { onHideUnderlay(); } } }, [onHideUnderlay, props, testOnly_pressed]); var pressConfig = useMemo(function () { return { cancelable: !rejectResponderTermination, disabled: disabled, delayLongPress: delayLongPress, delayPressStart: delayPressIn, delayPressEnd: delayPressOut, onLongPress: onLongPress, onPress: onPress, onPressStart: function onPressStart(event) { showUnderlay(); if (onPressIn != null) { onPressIn(event); } }, onPressEnd: function onPressEnd(event) { hideUnderlay(); if (onPressOut != null) { onPressOut(event); } } }; }, [delayLongPress, delayPressIn, delayPressOut, disabled, onLongPress, onPress, onPressIn, onPressOut, rejectResponderTermination, showUnderlay, hideUnderlay]); var pressEventHandlers = usePressEvents(hostRef, pressConfig); var child = React.Children.only(children); return React.createElement(View, _extends({}, rest, pressEventHandlers, { accessibilityState: _objectSpread({ disabled: disabled }, props.accessibilityState), accessible: accessible !== false, focusable: focusable !== false && onPress !== undefined, ref: setRef, style: [styles.root, style, !disabled && styles.actionable, extraStyles && extraStyles.underlay] }), React.cloneElement(child, { style: StyleSheet.compose(child.props.style, extraStyles && extraStyles.child) })); } var styles = StyleSheet.create({ root: { userSelect: 'none' }, actionable: { cursor: 'pointer', touchAction: 'manipulation' } }); var MemoedTouchableHighlight = React.memo(React.forwardRef(TouchableHighlight)); MemoedTouchableHighlight.displayName = 'TouchableHighlight'; export default MemoedTouchableHighlight;
import { W as WidgetBehavior, i as isEqual } from './index-f49b3280.js'; class OptionBehavior extends WidgetBehavior { static get params() { return { // contextValue: true, provideValue: false, }; } init() { this.props.disabled = (val) => { const bool = val != null; if (bool) { this.unlinkListBox(); } else { this.linkListBox(); } return bool; }; this.forceLinkValue(); this.host.nuOption = this; super.init(); this.linkContext('listbox', (listbox) => { if (this.listbox) { this.removeOption(); } this.listbox = listbox; if (listbox && this.hasValue) { this.addOption(listbox); this.setCurrent(); } }, false); this.on('click', () => { if (this.disabled) return; this.doAction('input', this.value); // this.doAction('close'); }); } disconnected() { super.disconnected(); const listbox = this.listbox; if (listbox && this.hasValue) { this.removeOption(); } } fromContextValue(value) { this.log('link context value', value); if (this.listbox) { this.addOption(); this.setCurrent(); } } setValue(value, silent) { this.unlinkListBox(); super.setValue(value, silent); this.linkListBox(); } linkListBox() { if (this.listbox && this.hasValue && !this.disabled) { this.addOption(); this.setCurrent(); } } unlinkListBox() { if (this.listbox && this.hasValue) { this.removeOption(); } } addOption(listbox = this.listbox) { listbox.addOption(this); } setCurrent() { const isSelected = this.listbox ? ( !this.listbox.multiple ? isEqual(this.value, this.listbox.value) : (this.listbox.value || []).includes(this.value) ) : false; const isCurrent = this.listbox ? this.listbox.current === this.value : false; this.setMod('current', isCurrent); this.setMod('pressed', isSelected); // synonym to "selected" this.setAria('selected', isSelected); if (this.listbox && isCurrent) { this.listbox.setAria('activedescendant', this.uniqId); } } removeOption() { if (this.listbox) { this.listbox.removeOption(this); } } } export default OptionBehavior;
import * as PIXI from 'pixi.js'; import BaseWidget from './BaseWidget'; /** * A simple text label * @memberof ST.Widgets * @extends ST.Widgets.BaseWidget * * @example * let widget = new ST.Widgets.Label(myApp.root, {text: 'My Text'}); */ export default class Label extends BaseWidget { /** * @param {ST.BaseWidget} parent Widgets parent * @param {Object} [options = Object] See {@link ST.Widgets.BaseWidget} * @param {String} [options.text] The text presented on the label */ constructor(parent, options = {}) { super(parent, options); // default options const defaults = { text: '', }; options = Object.assign(defaults, options); // this is mostly un-needed for labels this.interactive = false; /** * Internal PIXI.Text object * @member {PIXI.Text} * @private */ this._textObj = new PIXI.Text(); this.addChild(this._textObj); this._textObj.mask = null; this._clipGraphic.renderable = false; this.paintDefault(); this.text = options.text; /** * Fires when the text is changed * @event ST.Widgets.Label#textChanged */ } /** @inheritdoc */ paintDefault() { if(this._textObj) { this._textObj.style = this.theme.fontStyles.enabled; } } /** @inheritdoc */ paintDown() { if(this._textObj) { this._textObj.style = this.theme.fontStyles.click; } } /** @inheritdoc */ paintHover() { if(this._textObj) { this._textObj.style = this.theme.fontStyles.hover; } } /** @inheritdoc */ paintDisabled() { if(this._textObj) { this._textObj.style = this.theme.fontStyles.disabled; } } /** * The text presented by the label * @member {String} */ get text() { return this._textObj.text; } set text(val) { // eslint-disable-line require-jsdoc this._textObj.text = val; this.width = this._textObj.width; this.height = this._textObj.height; this._updateClipGraphic(); this.emit('textChanged', val); } }
import _ from 'lodash'; import { t } from '../util/locale'; import { presetCollection } from './collection'; export function presetCategory(id, category, all) { category = _.clone(category); category.id = id; category.members = presetCollection(category.members.map(function(id) { return all.item(id); })); category.matchGeometry = function(geometry) { return category.geometry.indexOf(geometry) >= 0; }; category.matchScore = function() { return -1; }; category.name = function() { return t('presets.categories.' + id + '.name', {'default': id}); }; category.terms = function() { return []; }; return category; }
/*! * ws: a node.js websocket client * Copyright(c) 2011 Einar Otto Stangvik <einaros@gmail.com> * MIT Licensed */ var util = require('util'); /** * State constants */ var EMPTY = 0 , BODY = 1; var BINARYLENGTH = 2 , BINARYBODY = 3; /** * Hixie Receiver implementation */ function Receiver () { if (this instanceof Receiver === false) { throw new TypeError("Classes can't be function-called"); } this.state = EMPTY; this.buffers = []; this.messageEnd = -1; this.spanLength = 0; this.dead = false; this.onerror = function() {}; this.ontext = function() {}; this.onbinary = function() {}; this.onclose = function() {}; this.onping = function() {}; this.onpong = function() {}; } module.exports = Receiver; /** * Add new data to the parser. * * @api public */ Receiver.prototype.add = function(data) { var self = this; function doAdd () { if (self.state === EMPTY) { if (data.length == 2 && data[0] == 0xFF && data[1] == 0x00) { self.reset(); self.onclose(); return; } if (data[0] === 0x80) { self.messageEnd = 0; self.state = BINARYLENGTH; data = data.slice(1); } else { if (data[0] !== 0x00) { self.error('payload must start with 0x00 byte', true); return; } data = data.slice(1); self.state = BODY; } } if (self.state === BINARYLENGTH) { var i = 0; while ((i < data.length) && (data[i] & 0x80)) { self.messageEnd = 128 * self.messageEnd + (data[i] & 0x7f); ++i; } if (i < data.length) { self.messageEnd = 128 * self.messageEnd + (data[i] & 0x7f); self.state = BINARYBODY; ++i; } if (i > 0) { data = data.slice(i); } } if (self.state === BINARYBODY) { var dataleft = self.messageEnd - self.spanLength; if (data.length >= dataleft) { // consume the whole buffer to finish the frame self.buffers.push(data); self.spanLength += dataleft; self.messageEnd = dataleft; return self.parse(); } // frame's not done even if we consume it all self.buffers.push(data); self.spanLength += data.length; return; } self.buffers.push(data); if ((self.messageEnd = bufferIndex(data, 0xFF)) != -1) { self.spanLength += self.messageEnd; return self.parse(); } else { self.spanLength += data.length; } } while (data) { data = doAdd(); } }; /** * Releases all resources used by the receiver. * * @api public */ Receiver.prototype.cleanup = function() { this.dead = true; this.state = EMPTY; this.buffers = []; }; /** * Process buffered data. * * @api public */ Receiver.prototype.parse = function() { var output = new Buffer(this.spanLength); var outputIndex = 0; for (var bi = 0, bl = this.buffers.length; bi < bl - 1; ++bi) { var buffer = this.buffers[bi]; buffer.copy(output, outputIndex); outputIndex += buffer.length; } var lastBuffer = this.buffers[this.buffers.length - 1]; if (this.messageEnd > 0) { lastBuffer.copy(output, outputIndex, 0, this.messageEnd); } if (this.state !== BODY) { --this.messageEnd; } var tail = null; if (this.messageEnd < lastBuffer.length - 1) { tail = lastBuffer.slice(this.messageEnd + 1); } this.reset(); this.ontext(output.toString('utf8')); return tail; }; /** * Handles an error * * @api private */ Receiver.prototype.error = function(reason, terminate) { this.reset(); this.onerror(reason, terminate); return this; }; /** * Reset parser state * * @api private */ Receiver.prototype.reset = function(reason) { if (this.dead) { return; } this.state = EMPTY; this.buffers = []; this.messageEnd = -1; this.spanLength = 0; }; /** * Internal api */ function bufferIndex (buffer, byte) { for (var i = 0, l = buffer.length; i < l; ++i) { if (buffer[i] === byte) { return i; } } return -1; }