code
stringlengths
2
1.05M
export default Example; function Example(headers, data) { this.headers = headers; this.data = data; // this.test = { // passed: true, // status: 'passed', // assertions: [], // log: [], // error: null // }; }
/** * Imports */ import {component, element} from 'vdux' import Grid from 'components/Grid' import {Block} from 'vdux-ui' /** * <Edit Grid/> */ export default component({ render ({props, actions, children}) { const { clickHandler, color = 'black', size = '500px', hideAnimal, my = '1em', paintMode, painted, grid, game, id, ...restProps } = props return ( <Block my={my} textAlign='center'> {children} <Grid mode='edit' paintMode={paintMode} grid={grid} id={id} animals={hideAnimal ? [] : game.animals} painted={painted} levelSize={size} w='auto' h='auto' clickHandler={actions.handleClick} numRows={game.levelSize[0]} numColumns={game.levelSize[1]} {...restProps} /> </Block> ) }, controller: { * handleClick ({props}, coord) { const {grid, color} = props yield props.clickHandler({grid, coord, color}) } } })
define([ 'jquery', '../utils', '../keys' ], function ($, Utils, KEYS) { function BaseSelection ($element, options) { this.$element = $element; this.options = options; BaseSelection.__super__.constructor.call(this); } Utils.Extend(BaseSelection, Utils.Observable); BaseSelection.prototype.render = function () { var $selection = $( '<span class="select2-selection" role="combobox" ' + ' aria-haspopup="true" aria-expanded="false">' + '</span>' ); this._tabindex = 0; if (Utils.GetData(this.$element[0], 'old-tabindex') != null) { this._tabindex = Utils.GetData(this.$element[0], 'old-tabindex'); } else if (this.$element.attr('tabindex') != null) { this._tabindex = this.$element.attr('tabindex'); } $selection.attr('title', this.$element.attr('title')); $selection.attr('tabindex', this._tabindex); this.$selection = $selection; return $selection; }; BaseSelection.prototype.bind = function (container, $container) { var self = this; var id = container.id + '-container'; var resultsId = container.id + '-results'; this.container = container; this.$selection.on('focus', function (evt) { self.trigger('focus', evt); }); this.$selection.on('blur', function (evt) { self._handleBlur(evt); }); this.$selection.on('keydown', function (evt) { self.trigger('keypress', evt); if (evt.which === KEYS.SPACE) { evt.preventDefault(); } }); container.on('results:focus', function (params) { self.$selection.attr('aria-activedescendant', params.data._resultId); }); container.on('selection:update', function (params) { self.update(params.data); }); container.on('open', function () { // When the dropdown is open, aria-expanded="true" self.$selection.attr('aria-expanded', 'true'); self.$selection.attr('aria-owns', resultsId); self._attachCloseHandler(container); }); container.on('close', function () { // When the dropdown is closed, aria-expanded="false" self.$selection.attr('aria-expanded', 'false'); self.$selection.removeAttr('aria-activedescendant'); self.$selection.removeAttr('aria-owns'); self.$selection.trigger('focus'); self._detachCloseHandler(container); }); container.on('enable', function () { self.$selection.attr('tabindex', self._tabindex); }); container.on('disable', function () { self.$selection.attr('tabindex', '-1'); }); }; BaseSelection.prototype._handleBlur = function (evt) { var self = this; // This needs to be delayed as the active element is the body when the tab // key is pressed, possibly along with others. window.setTimeout(function () { // Don't trigger `blur` if the focus is still in the selection if ( (document.activeElement == self.$selection[0]) || ($.contains(self.$selection[0], document.activeElement)) ) { return; } self.trigger('blur', evt); }, 1); }; BaseSelection.prototype._attachCloseHandler = function (container) { var self = this; $(document.body).on('mousedown.select2.' + container.id, function (e) { var $target = $(e.target); var $select = $target.closest('.select2'); var $all = $('.select2.select2-container--open'); $all.each(function () { var $this = $(this); if (this == $select[0]) { return; } var $element = Utils.GetData(this, 'element'); $element.select2('close'); }); }); }; BaseSelection.prototype._detachCloseHandler = function (container) { $(document.body).off('mousedown.select2.' + container.id); }; BaseSelection.prototype.position = function ($selection, $container) { var $selectionContainer = $container.find('.selection'); $selectionContainer.append($selection); }; BaseSelection.prototype.destroy = function () { this._detachCloseHandler(this.container); }; BaseSelection.prototype.update = function (data) { throw new Error('The `update` method must be defined in child classes.'); }; return BaseSelection; });
/* global define */ define(['jquery', 'orotranslation/js/translator', 'orolocale/js/locale-settings', 'jquery-ui-timepicker'], function($, __, localeSettings) { 'use strict'; var locale = localeSettings.locale; $.timepicker.regional[locale] = { // Default regional settings currentText: __('Now'), closeText: __('Done'), amNames: [__('AM'), __('A')], pmNames: [__('PM'), __('P')], timeFormat: localeSettings.getVendorDateTimeFormat('jquery_ui', 'time', 'HH:mm'), timeSuffix: '', timeOnlyTitle: __('Choose Time'), timeText: __('Time'), hourText: __('Hour'), minuteText: __('Minute'), secondText: __('Second'), millisecText: __('Millisecond'), microsecText: __('Microsecond'), timezoneText: __('Time Zone'), timezone: localeSettings.getTimeZoneOffset().replace(':', ''), separator: localeSettings.getDateTimeFormatSeparator() }; $.timepicker.setDefaults($.timepicker.regional[locale]); $.datepicker._orig_gotoToday = $.datepicker._gotoToday; $.datepicker._gotoToday = function(id) { var inst = this._getInst($(id)[0]); this._base_gotoToday(id); this._setTime(inst, inst.today); }; });
function panel(){ ctx.fillStyle = 'rgb(0,0,0)'; ctx.font = "10px serif"; ctx.fillText("y-Velocity: " + charictar.vY, scrWidth - 100, 10); ctx.fillText("y position: " + charictar.y, scrWidth - 100, 20); ctx.fillText("scrHeight: " + scrHeight/2, scrWidth - 100, 30); ctx.fillText("up key: " + keyPress[38], scrWidth - 100, 40); ctx.fillText("slimy y-boundry: " + yBoundryActive[3], scrWidth - 100, 50); ctx.fillText("rainbow y-boundry: " + yBoundryActive[4], scrWidth - 100, 60); }
// Hungarian jQuery.extend(jQuery.fn.pickadate.defaults, { monthsFull: [ 'január', 'február', 'március', 'aprilis', 'május', 'június', 'július', 'augusztus', 'szeptember', 'október', 'november', 'december' ], monthsShort: [ 'jan', 'febr', 'márc', 'apr', 'máj', 'jún', 'júl', 'aug', 'szept', 'okt', 'nov', 'dec' ], weekdaysFull: [ 'vasámap', 'hétfö', 'kedd', 'szerda', 'csütörtök', 'péntek', 'szombat' ], weekdaysShort: [ 'V', 'H', 'K', 'SZ', 'CS', 'P', 'SZ' ], today: 'ma', clear: 'töröl', firstDay: 1, format: 'yyyy. mmmm dd.', formatSubmit: 'yyyy/mm/dd' });
/* * Copyright 2013 Palantir Technologies, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var Rule = (function (_super) { __extends(Rule, _super); function Rule() { _super.apply(this, arguments); } Rule.prototype.apply = function (sourceFile) { return this.applyWithWalker(new UnreachableWalker(sourceFile, this.getOptions())); }; Rule.FAILURE_STRING = "unreachable code"; return Rule; })(Lint.Rules.AbstractRule); exports.Rule = Rule; var UnreachableWalker = (function (_super) { __extends(UnreachableWalker, _super); function UnreachableWalker(sourceFile, options) { _super.call(this, sourceFile, options); this.hasReturned = false; } UnreachableWalker.prototype.visitNode = function (node) { var previousReturned = this.hasReturned; if (node.kind === 211) { this.hasReturned = false; } if (this.hasReturned) { this.hasReturned = false; this.addFailure(this.createFailure(node.getStart(), node.getWidth(), Rule.FAILURE_STRING)); } _super.prototype.visitNode.call(this, node); if (node.kind === 211) { this.hasReturned = previousReturned; } }; UnreachableWalker.prototype.visitBlock = function (node) { _super.prototype.visitBlock.call(this, node); this.hasReturned = false; }; UnreachableWalker.prototype.visitCaseClause = function (node) { _super.prototype.visitCaseClause.call(this, node); this.hasReturned = false; }; UnreachableWalker.prototype.visitDefaultClause = function (node) { _super.prototype.visitDefaultClause.call(this, node); this.hasReturned = false; }; UnreachableWalker.prototype.visitIfStatement = function (node) { this.visitNode(node.expression); this.visitNode(node.thenStatement); this.hasReturned = false; if (node.elseStatement != null) { this.visitNode(node.elseStatement); this.hasReturned = false; } }; UnreachableWalker.prototype.visitBreakStatement = function (node) { _super.prototype.visitBreakStatement.call(this, node); this.hasReturned = true; }; UnreachableWalker.prototype.visitContinueStatement = function (node) { _super.prototype.visitContinueStatement.call(this, node); this.hasReturned = true; }; UnreachableWalker.prototype.visitReturnStatement = function (node) { _super.prototype.visitReturnStatement.call(this, node); this.hasReturned = true; }; UnreachableWalker.prototype.visitThrowStatement = function (node) { _super.prototype.visitThrowStatement.call(this, node); this.hasReturned = true; }; return UnreachableWalker; })(Lint.RuleWalker);
import Ember from 'ember'; import PropertyUpdater from '../../mixins/d3-property-updater'; const { on, observer } = Ember; export default Ember.Object.extend(PropertyUpdater, { init() { this.set('layout', d3.layout.pie()); }, valueChanged: on('init', observer('value', function() { this.updateProperty('layout', 'value'); })), sortChanged: on('init', observer('sort', function() { this.updateProperty('layout', 'sort'); })), startAngleChanged: on('init', observer('startAngle', function() { this.updateProperty('layout', 'startAngle'); })), endAngleChanged: on('init', observer('endAngle', function() { this.updateProperty('layout', 'endAngle'); })), padAngleChanged: on('init', observer('padAngle', function() { this.updateProperty('layout', 'padAngle'); })), });
var env = require('minimist')(process.argv.slice(2)), gulp = require('gulp'), plumber = require('gulp-plumber'), browserSync = require('browser-sync'), stylus = require('gulp-stylus'), uglify = require('gulp-uglify'), concat = require('gulp-concat'), jeet = require('jeet'), rupture = require('rupture'), koutoSwiss = require('kouto-swiss'), prefixer = require('autoprefixer-stylus'), imagemin = require('gulp-imagemin'), cp = require('child_process'); var messages = { jekyllBuild: '<span style="color: grey">Running:</span> $ jekyll build' }; /** * Build the Jekyll Site */ gulp.task('jekyll-build', function (done) { browserSync.notify(messages.jekyllBuild); return cp.spawn('jekyll.bat', ['build']) .on('close', done); }); /** * Rebuild Jekyll & do page reload */ gulp.task('jekyll-rebuild', ['jekyll-build'], function () { browserSync.reload(); }); /** * Wait for jekyll-build, then launch the Server */ gulp.task('browser-sync', ['jekyll-build'], function() { browserSync({ server: { baseDir: '_site' } }); }); /** * Stylus task */ gulp.task('stylus', function(){ gulp.src('src/styl/main.styl') .pipe(plumber()) .pipe(stylus({ use:[koutoSwiss(), prefixer(), jeet(), rupture()], compress: true })) .pipe(gulp.dest('_site/assets/css/')) .pipe(browserSync.reload({stream:true})) .pipe(gulp.dest('assets/css')); }); /** * Javascript Task */ gulp.task('js', function(){ return gulp.src((env.p) ? 'src/js/**/*.js' : ['src/js/**/*.js', '!src/js/analytics.js']) .pipe(plumber()) .pipe(concat('main.js')) .pipe(uglify()) .pipe(gulp.dest('assets/js/')); }); /** * Imagemin Task */ gulp.task('imagemin', function() { return gulp.src('src/img/**/*.{jpg,png,gif}') .pipe(plumber()) .pipe(imagemin({ optimizationLevel: 5, progressive: true, interlaced: true })) .pipe(gulp.dest('assets/img/')); }); /** * Watch stylus files for changes & recompile * Watch html/md files, run jekyll & reload BrowserSync */ gulp.task('watch', function () { gulp.watch('src/styl/**/*.styl', ['stylus']); gulp.watch('src/js/**/*.js', ['js']); gulp.watch('src/img/**/*.{jpg,png,gif}', ['imagemin']); gulp.watch(['**/*.html','index.html', '_includes/*.html', '_layouts/*.html', '_posts/*'], ['jekyll-rebuild']); }); /** * Default task, running just `gulp` will compile the stylus, * compile the jekyll site, launch BrowserSync & watch files. */ gulp.task('default', ['js', 'stylus', 'browser-sync', 'watch']);
import React from 'react' import Icon from 'react-icon-base' const MdLoyalty = props => ( <Icon viewBox="0 0 40 40" {...props}> <g><path d="m28.8 25.5c0.7-0.8 1.2-1.8 1.2-3 0-2.3-1.9-4.1-4.1-4.1-1.2 0-2.2 0.4-3 1.1l-1.3 1.3-1.1-1.3c-0.8-0.8-1.8-1.1-3-1.1-2.3 0-4.1 1.8-4.1 4.1 0 1.2 0.4 2.2 1.1 3l7.1 7.1z m-19.7-13.9c1.4 0 2.5-1.1 2.5-2.5s-1.1-2.5-2.5-2.5-2.5 1.1-2.5 2.5 1.1 2.5 2.5 2.5z m26.6 7.7c0.6 0.6 0.9 1.4 0.9 2.3s-0.3 1.8-0.9 2.4l-11.7 11.7c-0.6 0.6-1.4 0.9-2.4 0.9s-1.7-0.3-2.3-0.9l-15-15c-0.6-0.6-0.9-1.4-0.9-2.3v-11.8c0-1.8 1.4-3.2 3.2-3.2h11.8c0.9 0 1.7 0.3 2.3 0.9z"/></g> </Icon> ) export default MdLoyalty
import fs from "node:fs"; import readline from "node:readline"; import chalk from "chalk"; import { execa } from "execa"; import stringWidth from "string-width"; import fetch from "node-fetch"; import outdent from "outdent"; import getFormattedDate from "./get-formatted-date.js"; readline.emitKeypressEvents(process.stdin); const OK = chalk.bgGreen.black(" DONE "); const FAIL = chalk.bgRed.black(" FAIL "); function fitTerminal(input) { const columns = Math.min(process.stdout.columns, 80); const WIDTH = columns - stringWidth(OK) + 1; if (input.length < WIDTH) { input += chalk.dim(".").repeat(WIDTH - input.length - 1); } return input; } async function logPromise(name, promiseOrAsyncFunction) { const promise = typeof promiseOrAsyncFunction === "function" ? promiseOrAsyncFunction() : promiseOrAsyncFunction; process.stdout.write(fitTerminal(name)); try { const result = await promise; process.stdout.write(`${OK}\n`); return result; } catch (error) { process.stdout.write(`${FAIL}\n`); throw error; } } async function runYarn(args, options) { args = Array.isArray(args) ? args : [args]; try { return await execa("yarn", ["--silent", ...args], options); } catch (error) { throw new Error(`\`yarn ${args.join(" ")}\` failed\n${error.stdout}`); } } function runGit(args, options) { args = Array.isArray(args) ? args : [args]; return execa("git", args, options); } function waitForEnter() { process.stdin.setRawMode(true); return new Promise((resolve, reject) => { process.stdin.on("keypress", listener); process.stdin.resume(); function listener(ch, key) { if (key.name === "return") { process.stdin.setRawMode(false); process.stdin.removeListener("keypress", listener); process.stdin.pause(); resolve(); } else if (key.ctrl && key.name === "c") { reject(new Error("Process terminated by the user")); } } }); } function readJson(filename) { return JSON.parse(fs.readFileSync(filename)); } function writeJson(filename, content) { fs.writeFileSync(filename, JSON.stringify(content, null, 2) + "\n"); } function processFile(filename, fn) { const content = fs.readFileSync(filename, "utf-8"); fs.writeFileSync(filename, fn(content)); } async function fetchText(url) { const response = await fetch(url); return response.text(); } function getBlogPostInfo(version) { const { year, month, day } = getFormattedDate(); return { file: `website/blog/${year}-${month}-${day}-${version}.md`, path: `blog/${year}/${month}/${day}/${version}.html`, }; } function getChangelogContent({ version, previousVersion, body }) { return outdent` [diff](https://github.com/prettier/prettier/compare/${previousVersion}...${version}) ${body} `; } export { runYarn, runGit, fetchText, logPromise, processFile, readJson, writeJson, waitForEnter, getBlogPostInfo, getChangelogContent, };
hljs.registerLanguage("actionscript",(()=>{"use strict";return e=>({ name:"ActionScript",aliases:["as"],keywords:{ keyword:"as break case catch class const continue default delete do dynamic each else extends final finally for function get if implements import in include instanceof interface internal is namespace native new override package private protected public return set static super switch this throw try typeof use var void while with", literal:"true false null undefined"}, contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,{ className:"class",beginKeywords:"package",end:/\{/,contains:[e.TITLE_MODE]},{ className:"class",beginKeywords:"class interface",end:/\{/,excludeEnd:!0, contains:[{beginKeywords:"extends implements"},e.TITLE_MODE]},{className:"meta", beginKeywords:"import include",end:";",keywords:{"meta-keyword":"import include" }},{className:"function",beginKeywords:"function",end:"[{;]",excludeEnd:!0, illegal:"\\S",contains:[e.TITLE_MODE,{className:"params",begin:"\\(",end:"\\)", contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{ className:"rest_arg",begin:"[.]{3}",end:"[a-zA-Z_$][a-zA-Z0-9_$]*",relevance:10 }]},{begin:":\\s*([*]|[a-zA-Z_$][a-zA-Z0-9_$]*)"}]},e.METHOD_GUARD],illegal:/#/ })})());
// Copyright IBM Corp. 2013,2016. All Rights Reserved. // Node module: loopback-datasource-juggler // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT "use strict"; var g = require("strong-globalize")(); var util = require("util"); var extend = util._extend; /*! * Module exports */ exports.ValidationError = ValidationError; exports.Validatable = Validatable; /** * This class provides methods that add validation cababilities to models. * Each of the validations runs when the `obj.isValid()` method is called. * * All of the methods have an options object parameter that has a * `message` property. When there is only a single error message, this property is just a string; * for example: `Post.validatesPresenceOf('title', { message: 'can not be blank' });` * * In more complicated cases it can be a set of messages, for each possible error condition; for example: * `User.validatesLengthOf('password', { min: 6, max: 20, message: {min: 'too short', max: 'too long'}});` * @class Validatable */ function Validatable() {} /** * Validate presence of one or more specified properties. * Requires a model to include a property to be considered valid; fails when validated field is blank. * * For example, validate presence of title * ``` * Post.validatesPresenceOf('title'); * ``` * Validate that model has first, last, and age properties: * ``` * User.validatesPresenceOf('first', 'last', 'age'); * ``` * Example with custom message * ``` * Post.validatesPresenceOf('title', {message: 'Cannot be blank'}); * ``` * * @param {String} propertyName One or more property names. * @options {Object} errMsg Optional custom error message. Default is "can't be blank" * @property {String} message Error message to use instead of default. */ Validatable.validatesPresenceOf = getConfigurator("presence"); /** * Validate absence of one or more specified properties. * A model should not include a property to be considered valid; fails when validated field not blank. * * For example, validate absence of reserved * ``` * Post.validatesAbsenceOf('reserved', { unless: 'special' }); * ``` * @param {String} propertyName One or more property names. * @options {Object} errMsg Optional custom error message. Default is "can't be set" * @property {String} message Error message to use instead of default. */ Validatable.validatesAbsenceOf = getConfigurator("absence"); /** * Validate length. Require a property length to be within a specified range. * Three kinds of validations: min, max, is. * * Default error messages: * * - min: too short * - max: too long * - is: length is wrong * * Example: length validations * ``` * User.validatesLengthOf('password', {min: 7}); * User.validatesLengthOf('email', {max: 100}); * User.validatesLengthOf('state', {is: 2}); * User.validatesLengthOf('nick', {min: 3, max: 15}); * ``` * Example: length validations with custom error messages * ``` * User.validatesLengthOf('password', {min: 7, message: {min: 'too weak'}}); * User.validatesLengthOf('state', {is: 2, message: {is: 'is not valid state name'}}); * ``` * @param {String} propertyName Property name to validate. * @options {Object} Options See below. * @property {Number} is Value that property must equal to validate. * @property {Number} min Value that property must be less than to be valid. * @property {Number} max Value that property must be less than to be valid. * @property {Object} message Optional Object with string properties for custom error message for each validation: is, min, or max */ Validatable.validatesLengthOf = getConfigurator("length"); /** * Validate numericality. Requires a value for property to be either an integer or number. * * Example * ``` * User.validatesNumericalityOf('age', { message: { number: '...' }}); * User.validatesNumericalityOf('age', {int: true, message: { int: '...' }}); * ``` * * @param {String} propertyName Property name to validate. * @options {Object} Options See below. * @property {Boolean} int If true, then property must be an integer to be valid. * @property {Object} message Optional object with string properties for 'int' for integer validation. Default error messages: * * - number: is not a number * - int: is not an integer */ Validatable.validatesNumericalityOf = getConfigurator("numericality"); /** * Validate inclusion in set. Require a value for property to be in the specified array. * * Example: * ``` * User.validatesInclusionOf('gender', {in: ['male', 'female']}); * User.validatesInclusionOf('role', { * in: ['admin', 'moderator', 'user'], message: 'is not allowed' * }); * ``` * * @param {String} propertyName Property name to validate. * @options {Object} Options See below * @property {Array} inArray Property must match one of the values in the array to be valid. * @property {String} message Optional error message if property is not valid. * Default error message: "is not included in the list". * @property {Boolean} allowNull Whether null values are allowed. */ Validatable.validatesInclusionOf = getConfigurator("inclusion"); /** * Validate exclusion. Require a property value not be in the specified array. * * Example: `Company.validatesExclusionOf('domain', {in: ['www', 'admin']});` * * @param {String} propertyName Property name to validate. * @options {Object} Options * @property {Array} inArray Property must match one of the values in the array to be valid. * @property {String} message Optional error message if property is not valid. Default error message: "is reserved". * @property {Boolean} allowNull Whether null values are allowed. */ Validatable.validatesExclusionOf = getConfigurator("exclusion"); /** * Validate format. Require a model to include a property that matches the given format. * * Require a model to include a property that matches the given format. Example: * `User.validatesFormatOf('name', {with: /\w+/});` * * @param {String} propertyName Property name to validate. * @options {Object} Options * @property {RegExp} with Regular expression to validate format. * @property {String} message Optional error message if property is not valid. Default error message: " is invalid". * @property {Boolean} allowNull Whether null values are allowed. */ Validatable.validatesFormatOf = getConfigurator("format"); /** * Validate using custom validation function. * * Example: * * User.validate('name', customValidator, {message: 'Bad name'}); * function customValidator(err) { * if (this.name === 'bad') err(); * }); * var user = new User({name: 'Peter'}); * user.isValid(); // true * user.name = 'bad'; * user.isValid(); // false * * @param {String} propertyName Property name to validate. * @param {Function} validatorFn Custom validation function. * @options {Object} Options See below. * @property {String} message Optional error message if property is not valid. Default error message: " is invalid". * @property {Boolean} allowNull Whether null values are allowed. */ Validatable.validate = getConfigurator("custom"); /** * Validate using custom asynchronous validation function. * * * Example: *```js * User.validateAsync('name', customValidator, {message: 'Bad name'}); * function customValidator(err, done) { * process.nextTick(function () { * if (this.name === 'bad') err(); * done(); * }); * }); * var user = new User({name: 'Peter'}); * user.isValid(); // false (because async validation setup) * user.isValid(function (isValid) { * isValid; // true * }) * user.name = 'bad'; * user.isValid(); // false * user.isValid(function (isValid) { * isValid; // false * }) *``` * @param {String} propertyName Property name to validate. * @param {Function} validatorFn Custom validation function. * @options {Object} Options See below * @property {String} message Optional error message if property is not valid. Default error message: " is invalid". * @property {Boolean} allowNull Whether null values are allowed. */ Validatable.validateAsync = getConfigurator("custom", { async: true }); /** * Validate uniqueness. Ensure the value for property is unique in the collection of models. * Not available for all connectors. Currently supported with these connectors: * - In Memory * - Oracle * - MongoDB * * ``` * // The login must be unique across all User instances. * User.validatesUniquenessOf('login'); * * // Assuming SiteUser.belongsTo(Site) * // The login must be unique within each Site. * SiteUser.validateUniquenessOf('login', { scopedTo: ['siteId'] }); * ``` * @param {String} propertyName Property name to validate. * @options {Object} Options See below. * @property {RegExp} with Regular expression to validate format. * @property {Array.<String>} scopedTo List of properties defining the scope. * @property {String} message Optional error message if property is not valid. Default error message: "is not unique". * @property {Boolean} allowNull Whether null values are allowed. */ Validatable.validatesUniquenessOf = getConfigurator("uniqueness", { async: true }); // implementation of validators /*! * Presence validator */ function validatePresence(attr, conf, err, options) { if (blank(this[attr])) { err(); } } /*! * Absence validator */ function validateAbsence(attr, conf, err, options) { if (!blank(this[attr])) { err(); } } /*! * Length validator */ function validateLength(attr, conf, err, options) { if (nullCheck.call(this, attr, conf, err)) return; var len = this[attr].length; if (conf.min && len < conf.min) { err("min"); } if (conf.max && len > conf.max) { err("max"); } if (conf.is && len !== conf.is) { err("is"); } } /*! * Numericality validator */ function validateNumericality(attr, conf, err, options) { if (nullCheck.call(this, attr, conf, err)) return; if (typeof this[attr] !== "number" || isNaN(this[attr])) { return err("number"); } if (conf.int && this[attr] !== Math.round(this[attr])) { return err("int"); } } /*! * Inclusion validator */ function validateInclusion(attr, conf, err, options) { if (nullCheck.call(this, attr, conf, err)) return; if (!~conf.in.indexOf(this[attr])) { err(); } } /*! * Exclusion validator */ function validateExclusion(attr, conf, err, options) { if (nullCheck.call(this, attr, conf, err)) return; if (~conf.in.indexOf(this[attr])) { err(); } } /*! * Format validator */ function validateFormat(attr, conf, err, options) { if (nullCheck.call(this, attr, conf, err)) return; if (typeof this[attr] === "string") { if (!this[attr].match(conf["with"])) { err(); } } else { err(); } } /*! * Custom validator */ function validateCustom(attr, conf, err, options, done) { if (typeof options === "function") { done = options; options = {}; } conf.customValidator.call(this, err, done); } /*! * Uniqueness validator */ function validateUniqueness(attr, conf, err, options, done) { if (typeof options === "function") { done = options; options = {}; } if (blank(this[attr])) { return process.nextTick(done); } var cond = { where: {} }; cond.where[attr] = this[attr]; if (conf && conf.scopedTo) { conf.scopedTo.forEach(function (k) { var val = this[k]; if (val !== undefined) cond.where[k] = this[k]; }, this); } var idName = this.constructor.definition.idName(); var isNewRecord = this.isNewRecord(); this.constructor.find(cond, options, function (error, found) { if (error) { err(error); } else if (found.length > 1) { err(); } else if (found.length === 1 && idName === attr && isNewRecord) { err(); } else if (found.length === 1 && (!this.id || !found[0].id || found[0].id.toString() != this.id.toString())) { err(); } done(); }.bind(this)); } var validators = { presence: validatePresence, absence: validateAbsence, length: validateLength, numericality: validateNumericality, inclusion: validateInclusion, exclusion: validateExclusion, format: validateFormat, custom: validateCustom, uniqueness: validateUniqueness, }; function getConfigurator(name, opts) { return function () { var args = Array.prototype.slice.call(arguments); args[1] = args[1] || {}; configure(this, name, args, opts); }; } /** * This method performs validation and triggers validation hooks. * Before validation the `obj.errors` collection is cleaned. * Each validation can add errors to `obj.errors` collection. * If collection is not blank, validation failed. * * NOTE: This method can be called as synchronous only when no asynchronous validation is * configured. It's strongly recommended to run all validations as asyncronous. * * Example: ExpressJS controller: render user if valid, show flash otherwise * ``` * user.isValid(function (valid) { * if (valid) res.render({user: user}); * else res.flash('error', 'User is not valid'), console.log(user.errors), res.redirect('/users'); * }); * ``` * Another example: * ``` * user.isValid(function (valid) { * if (!valid) { * console.log(user.errors); * // => hash of errors * // => { * // => username: [errmessage, errmessage, ...], * // => email: ... * // => } * } * }); * ``` * @param {Function} callback called with (valid) * @returns {Boolean} True if no asynchronous validation is configured and all properties pass validation. */ Validatable.prototype.isValid = function (callback, data, options) { options = options || {}; var valid = true, inst = this, wait = 0, async = false; var validations = this.constructor.validations; var reportDiscardedProperties = this.__strict && this.__unknownProperties && this.__unknownProperties.length; // exit with success when no errors if (typeof validations !== "object" && !reportDiscardedProperties) { cleanErrors(this); if (callback) { this.trigger("validate", function (validationsDone) { validationsDone.call(inst, function () { callback(valid); }); }, data, callback); } return valid; } Object.defineProperty(this, "errors", { enumerable: false, configurable: true, value: new Errors, }); this.trigger("validate", function (validationsDone) { var inst = this, asyncFail = false; var attrs = Object.keys(validations || {}); attrs.forEach(function (attr) { var attrValidations = validations[attr] || []; attrValidations.forEach(function (v) { if (v.options && v.options.async) { async = true; wait += 1; process.nextTick(function () { validationFailed(inst, attr, v, options, done); }); } else { if (validationFailed(inst, attr, v)) { valid = false; } } }); }); if (reportDiscardedProperties) { for (var ix in inst.__unknownProperties) { var key = inst.__unknownProperties[ix]; var code = "unknown-property"; var msg = defaultMessages[code]; inst.errors.add(key, msg, code); valid = false; } } if (!async) { validationsDone.call(inst, function () { if (valid) cleanErrors(inst); if (callback) { callback(valid); } }); } function done(fail) { asyncFail = asyncFail || fail; if (--wait === 0) { validationsDone.call(inst, function () { if (valid && !asyncFail) cleanErrors(inst); if (callback) { callback(valid && !asyncFail); } }); } } }, data, callback); if (async) { // in case of async validation we should return undefined here, // because not all validations are finished yet return; } else { return valid; } }; function cleanErrors(inst) { Object.defineProperty(inst, "errors", { enumerable: false, configurable: true, value: false, }); } function validationFailed(inst, attr, conf, options, cb) { var opts = conf.options || {}; if (typeof options === "function") { cb = options; options = {}; } if (typeof attr !== "string") return false; // here we should check skip validation conditions (if, unless) // that can be specified in conf if (skipValidation(inst, conf, "if") || skipValidation(inst, conf, "unless")) { if (cb) cb(false); return false; } var fail = false; var validator = validators[conf.validation]; var validatorArguments = []; validatorArguments.push(attr); validatorArguments.push(conf); validatorArguments.push(function onerror(kind) { var message, code = conf.code || conf.validation; if (conf.message) { message = conf.message; } if (!message && defaultMessages[conf.validation]) { message = defaultMessages[conf.validation]; } if (!message) { message = "is invalid"; } if (kind) { code += "." + kind; if (message[kind]) { // get deeper message = message[kind]; } else if (defaultMessages.common[kind]) { message = defaultMessages.common[kind]; } else { message = "is invalid"; } } if (kind !== false) inst.errors.add(attr, message, code); fail = true; }); validatorArguments.push(options); if (cb) { validatorArguments.push(function () { cb(fail); }); } validator.apply(inst, validatorArguments); return fail; } function skipValidation(inst, conf, kind) { var doValidate = true; if (typeof conf[kind] === "function") { doValidate = conf[kind].call(inst); if (kind === "unless") doValidate = !doValidate; } else if (typeof conf[kind] === "string") { if (typeof inst[conf[kind]] === "function") { doValidate = inst[conf[kind]].call(inst); if (kind === "unless") doValidate = !doValidate; } else if (inst.__data.hasOwnProperty(conf[kind])) { doValidate = inst[conf[kind]]; if (kind === "unless") doValidate = !doValidate; } else { doValidate = kind === "if"; } } return !doValidate; } var defaultMessages = { presence: "can't be blank", absence: "can't be set", "unknown-property": "is not defined in the model", length: { min: "too short", max: "too long", is: "length is wrong", }, common: { blank: "is blank", "null": "is null", }, numericality: { "int": "is not an integer", "number": "is not a number", }, inclusion: "is not included in the list", exclusion: "is reserved", uniqueness: "is not unique", }; /** * Checks if attribute is undefined or null. Calls err function with 'blank' or 'null'. * See defaultMessages. You can affect this behaviour with conf.allowBlank and conf.allowNull. * @param {String} attr Property name of attribute * @param {Object} conf conf object for validator * @param {Function} err * @return {Boolean} returns true if attribute is null or blank */ function nullCheck(attr, conf, err) { // First determine if attribute is defined if (typeof this[attr] === "undefined") { if (!conf.allowBlank) { err("blank"); } return true; } else { // Now check if attribute is null if (this[attr] === null) { if (!conf.allowNull) { err("null"); } return true; } } return false; } /*! * Return true when v is undefined, blank array, null or empty string * otherwise returns false * * @param {Mix} v * Returns true if `v` is blank. */ function blank(v) { if (typeof v === "undefined") return true; if (v instanceof Array && v.length === 0) return true; if (v === null) return true; if (typeof v === "number" && isNaN(v)) return true; if (typeof v == "string" && v === "") return true; return false; } function configure(cls, validation, args, opts) { if (!cls.validations) { Object.defineProperty(cls, "validations", { writable: true, configurable: true, enumerable: false, value: {}, }); } args = [].slice.call(args); var conf; if (typeof args[args.length - 1] === "object") { conf = args.pop(); } else { conf = {}; } if (validation === "custom" && typeof args[args.length - 1] === "function") { conf.customValidator = args.pop(); } conf.validation = validation; args.forEach(function (attr) { if (typeof attr === "string") { var validation = extend({}, conf); validation.options = opts || {}; cls.validations[attr] = cls.validations[attr] || []; cls.validations[attr].push(validation); } }); } function Errors() { Object.defineProperty(this, "codes", { enumerable: false, configurable: true, value: {}, }); } Errors.prototype.add = function (field, message, code) { code = code || "invalid"; if (!this[field]) { this[field] = []; this.codes[field] = []; } this[field].push(message); this.codes[field].push(code); }; function ErrorCodes(messages) { var c = this; Object.keys(messages).forEach(function (field) { c[field] = messages[field].codes; }); } /** * ValidationError is raised when the application attempts to save an invalid model instance. * Example: * ``` * { * "name": "ValidationError", * "status": 422, * "message": "The Model instance is not valid. \ * See `details` property of the error object for more info.", * "statusCode": 422, * "details": { * "context": "user", * "codes": { * "password": [ * "presence" * ], * "email": [ * "uniqueness" * ] * }, * "messages": { * "password": [ * "can't be blank" * ], * "email": [ * "Email already exists" * ] * } * }, * } * ``` * You might run into situations where you need to raise a validation error yourself, for example in a "before" hook or a * custom model method. * ``` * MyModel.prototype.preflight = function(changes, callback) { * // Update properties, do not save to db * for (var key in changes) { * model[key] = changes[key]; * } * * if (model.isValid()) { * return callback(null, { success: true }); * } * * // This line shows how to create a ValidationError * var err = new MyModel.ValidationError(model); * callback(err); * } * ``` */ function ValidationError(obj) { if (!(this instanceof ValidationError)) return new ValidationError(obj); this.name = "ValidationError"; var context = obj && obj.constructor && obj.constructor.modelName; this.message = g.f( "The %s instance is not valid. Details: %s.", context ? "`" + context + "`" : "model", formatErrors(obj.errors, obj.toJSON()) || "(unknown)" ); this.statusCode = 422; this.details = { context: context, codes: obj.errors && obj.errors.codes, messages: obj.errors, }; if (Error.captureStackTrace) { // V8 (Chrome, Opera, Node) Error.captureStackTrace(this, this.constructor); } else if (errorHasStackProperty) { // Firefox this.stack = (new Error).stack; } // Safari and PhantomJS initializes `error.stack` on throw // Internet Explorer does not support `error.stack` } util.inherits(ValidationError, Error); var errorHasStackProperty = !!(new Error).stack; ValidationError.maxPropertyStringLength = 32; function formatErrors(errors, propertyValues) { var DELIM = "; "; errors = errors || {}; return Object.getOwnPropertyNames(errors) .filter(function (propertyName) { return Array.isArray(errors[propertyName]); }) .map(function (propertyName) { var messages = errors[propertyName]; var propertyValue = propertyValues[propertyName]; return messages.map(function (msg) { return formatPropertyError(propertyName, propertyValue, msg); }).join(DELIM); }) .join(DELIM); } function formatPropertyError(propertyName, propertyValue, errorMessage) { var formattedValue; var valueType = typeof propertyValue; if (valueType === "string") { formattedValue = JSON.stringify(truncatePropertyString(propertyValue)); } else if (propertyValue instanceof Date) { formattedValue = propertyValue.toISOString(); } else if (valueType === "object") { // objects and arrays formattedValue = util.inspect(propertyValue, { showHidden: false, color: false, // show top-level object properties only depth: Array.isArray(propertyValue) ? 1 : 0, }); formattedValue = truncatePropertyString(formattedValue); } else { formattedValue = truncatePropertyString("" + propertyValue); } return "`" + propertyName + "` " + errorMessage + " (value: " + formattedValue + ")"; } function truncatePropertyString(value) { var len = ValidationError.maxPropertyStringLength; if (value.length <= len) return value; // preserve few last characters like `}` or `]`, but no more than 3 // this way the last `} ]` in the array of objects is included in the message var tail; var m = value.match(/([ \t})\]]+)$/); if (m) { tail = m[1].slice(-3); len -= tail.length; } else { tail = value.slice(-3); len -= 3; } return value.slice(0, len - 4) + "..." + tail; }
'use strict'; let path = require('path'); let assert = require('yeoman-assert'); let helpers = require('yeoman-test'); describe('react-webpack:component', () => { const generatorComponent = path.join(__dirname, '../../../generators/component'); describe('when using version 3 of the generator', () => { // List of available style types. Please add a line that says // testComponentWithStyle(styleTypes.KEY); to the bottom of the file // to run all unit tests for this filetype. const styleTypes = { css: { type: 'css', fileName: 'src/styles/Mycomponent.css', expandedFileName: 'src/styles/my/littleSpecial/Test.css', assertions: { componentImport: 'require(\'styles/Mycomponent.css\');', styleContent: '.mycomponent-component' } }, sass: { type: 'sass', fileName: 'src/styles/Mycomponent.sass', expandedFileName: 'src/styles/my/littleSpecial/Test.sass', assertions: { componentImport: 'require(\'styles/Mycomponent.sass\');', styleContent: '.mycomponent-component' } }, scss: { type: 'scss', fileName: 'src/styles/Mycomponent.scss', expandedFileName: 'src/styles/my/littleSpecial/Test.scss', assertions: { componentImport: 'require(\'styles/Mycomponent.scss\');', styleContent: '.mycomponent-component' } }, less: { type: 'less', fileName: 'src/styles/Mycomponent.less', expandedFileName: 'src/styles/my/littleSpecial/Test.less', assertions: { componentImport: 'require(\'styles/Mycomponent.less\');', styleContent: '.mycomponent-component' } }, stylus: { type: 'stylus', fileName: 'src/styles/Mycomponent.styl', expandedFileName: 'src/styles/my/littleSpecial/Test.styl', assertions: { componentImport: 'require(\'styles/Mycomponent.styl\');', styleContent: '.mycomponent-component' } } }; /** * Return a newly generated component with given name and style * @param {String} name Name of the component * @param {String} styleType Styling language to use * @param {Object} options Options to use for the generator * @param {Function} callback Test callback to run */ function createGeneratedComponent(name, styleType, options, callback) { helpers.run(generatorComponent) .withArguments([name]) .withOptions(options) .on('ready', (instance) => { instance.config.set('style', styleType); instance.config.set('generatedWithVersion', 3); }) .on('end', callback); } /** * Test a component with styling applied * @param {Object} style The style to apply (see styleTypes above) * @param {Object} options Options to use [optional] */ function testComponentWithStyle(style, options) { // Make sure we always have options if(!options) { options = {}; } describe(`when using style type "${style.type}"`, () => { describe('when writing is called', () => { it(`should create the react component, its ${style.type}-stylesheet and test file`, (done) => { createGeneratedComponent('mycomponent', style.type, options, () => { assert.file([ 'src/components/MycomponentComponent.js', style.fileName, 'test/components/MycomponentComponentTest.js' ]); done(); }); }); }); describe('when creating a component', () => { it('should always import REACT', (done) => { createGeneratedComponent('mycomponent', style.type, options, () => { assert.fileContent('src/components/MycomponentComponent.js', 'import React from \'react\';'); done(); }); }); it(`should require the created ${style.type} file`, (done) => { createGeneratedComponent('mycomponent', style.type, options, () => { assert.fileContent('src/components/MycomponentComponent.js', style.assertions.componentImport); done(); }); }); it('should have its displayName set per default', (done) => { createGeneratedComponent('mycomponent', style.type, options, () => { assert.fileContent('src/components/MycomponentComponent.js', 'displayName = \'MycomponentComponent\';'); done(); }); }); it('should export the created component', (done) => { createGeneratedComponent('mycomponent', style.type, options, () => { assert.fileContent('src/components/MycomponentComponent.js', 'export default MycomponentComponent'); done(); }); }); it('should be possible to create components in a subfolder', (done) => { createGeneratedComponent('my/little !special/test', style.type, options, () => { assert.file([ 'src/components/my/littleSpecial/TestComponent.js', style.expandedFileName, 'test/components/my/littleSpecial/TestComponentTest.js' ]); done(); }); }); it(`should add the components ${style.type} class to the created stylesheet`, (done) => { createGeneratedComponent('mycomponent', style.type, options, () => { assert.fileContent(style.fileName, style.assertions.styleContent); done(); }); }); it('should create a unit test that imports the generated component', (done) => { createGeneratedComponent('mycomponent', style.type, options, () => { assert.fileContent('test/components/MycomponentComponentTest.js', 'import MycomponentComponent from \'components/MycomponentComponent.js\';'); done(); }); }); }); }); } // Run all tests for all available style types. // Stateless components will also be tested! for(const style in styleTypes) { testComponentWithStyle(styleTypes[style]); testComponentWithStyle(styleTypes[style], { stateless: true }); } }); describe('when using version 4 of the generator', () => { const cssModSuffix = (useCssModules) => useCssModules ? '.cssmodule' : ''; const importAssertion = (useCssModules, ext) => useCssModules ? `import styles from './mycomponent.cssmodule.${ext}';` : `import './mycomponent.${ext}';` ; // List of available style types. Please add a line that says // testComponentWithStyle(styleTypes.KEY); to the bottom of the file // to run all unit tests for this filetype. const styleTypes = (useCssModules) => ({ css: { type: 'css', fileName: `src/components/mycomponent${cssModSuffix(useCssModules)}.css`, expandedFileName: `src/components/my/littleSpecial/test${cssModSuffix(useCssModules)}.css`, assertions: { componentImport: importAssertion(useCssModules, 'css'), styleContent: '.mycomponent-component' } }, sass: { type: 'sass', fileName: `src/components/mycomponent${cssModSuffix(useCssModules)}.sass`, expandedFileName: `src/components/my/littleSpecial/test${cssModSuffix(useCssModules)}.sass`, assertions: { componentImport: importAssertion(useCssModules, 'sass'), styleContent: '.mycomponent-component' } }, scss: { type: 'scss', fileName: `src/components/mycomponent${cssModSuffix(useCssModules)}.scss`, expandedFileName: `src/components/my/littleSpecial/test${cssModSuffix(useCssModules)}.scss`, assertions: { componentImport: importAssertion(useCssModules, 'scss'), styleContent: '.mycomponent-component' } }, less: { type: 'less', fileName: `src/components/mycomponent${cssModSuffix(useCssModules)}.less`, expandedFileName: `src/components/my/littleSpecial/test${cssModSuffix(useCssModules)}.less`, assertions: { componentImport: importAssertion(useCssModules, 'less'), styleContent: '.mycomponent-component' } }, stylus: { type: 'stylus', fileName: `src/components/mycomponent${cssModSuffix(useCssModules)}.styl`, expandedFileName: `src/components/my/littleSpecial/test${cssModSuffix(useCssModules)}.styl`, assertions: { componentImport: importAssertion(useCssModules, 'styl'), styleContent: '.mycomponent-component' } } }); /** * Return a newly generated component with given name and style * @param {String} name Name of the component * @param {String} styleType Styling language to use * @param {Object} options Options to use for the generator * @param {boolean} useCssModules useCssModules indicate whether to test with cssmodules enabled * @param {Function} callback Test callback to run */ function createGeneratedComponent(name, styleType, options, useCssModules, callback) { helpers.run(generatorComponent) .withArguments([name]) .withOptions(options) .on('ready', (instance) => { instance.config.set('style', styleType); instance.config.set('cssmodules', useCssModules); instance.config.set('generatedWithVersion', 4); }) .on('end', callback); } /** * Test a component with styling applied * @param {Object} style The style to apply (see styleTypes above) * @param {Object} options Options to use [optional] * @param {boolean} useCssModules indicate whether to test with cssmodules enabled */ function testComponentWithStyle(style, options, useCssModules) { // Make sure we always have options if(!options) { options = {}; } const isStateless = options.stateless || false; const isPure = options.pure || false; const componentBase = isPure ? 'React.PureComponent' : 'React.Component'; describe(`when using style type "${style.type}" with nostyle = false, pure rendering = ${isPure} and cssmodules = ${useCssModules}`, () => { describe('when writing is called', () => { it(`should create the react component, its ${style.type}-stylesheet and test file`, (done) => { createGeneratedComponent('mycomponent', style.type, options, useCssModules, () => { assert.file([ 'src/components/Mycomponent.js', style.fileName, 'test/components/MycomponentTest.js' ]); done(); }); }); }); describe('when creating a component', () => { it('should always import REACT', (done) => { createGeneratedComponent('mycomponent', style.type, options, useCssModules, () => { assert.fileContent('src/components/Mycomponent.js', 'import React from \'react\';'); done(); }); }); it(`should require the created ${style.type} file`, (done) => { createGeneratedComponent('mycomponent', style.type, options, useCssModules, () => { assert.fileContent('src/components/Mycomponent.js', style.assertions.componentImport); done(); }); }); // Only run this if we are not in stateless mode if(!isStateless) { it(`should extend ${componentBase}`, (done) => { createGeneratedComponent('mycomponent', style.type, options, useCssModules, () => { assert.fileContent( 'src/components/Mycomponent.js', `class Mycomponent extends ${componentBase}` ); done(); }); }); } it('should have its displayName set per default', (done) => { createGeneratedComponent('mycomponent', style.type, options, useCssModules, () => { assert.fileContent('src/components/Mycomponent.js', 'Mycomponent.displayName = \'Mycomponent\';'); done(); }); }); it('should export the created component', (done) => { createGeneratedComponent('mycomponent', style.type, options, useCssModules, () => { let exportAssertion; if(useCssModules) { exportAssertion = 'export default cssmodules(Mycomponent, styles);'; } else { exportAssertion = 'export default Mycomponent;'; } assert.fileContent('src/components/Mycomponent.js', exportAssertion); done(); }); }); it('should be possible to create components in a subfolder', (done) => { createGeneratedComponent('my/little !special/test', style.type, options, useCssModules, () => { assert.file([ 'src/components/my/littleSpecial/Test.js', style.expandedFileName, 'test/components/my/littleSpecial/TestTest.js' ]); done(); }); }); it(`should add the components ${style.type} class to the created stylesheet`, (done) => { createGeneratedComponent('mycomponent', style.type, options, useCssModules, () => { assert.fileContent(style.fileName, style.assertions.styleContent); done(); }); }); it('should create a unit test that imports the generated component', (done) => { createGeneratedComponent('mycomponent', style.type, options, useCssModules, () => { assert.fileContent('test/components/MycomponentTest.js', 'import Mycomponent from \'components/Mycomponent.js\';'); done(); }); }); }); }); } /** * Test a component with styling applied * @param {Object} style The style to apply (see styleTypes above) * @param {Object} options Options to use [optional] * @param {boolean} useCssModules indicate whether to test with cssmodules enabled */ function testComponentWithoutStyle(style, options, useCssModules) { // Make sure we always have options if(!options) { options = {}; } describe(`when using style type "${style.type}" with nostyle = true and cssmodules = ${useCssModules}`, () => { describe('when writing is called', () => { it('should create the react component and test file', (done) => { createGeneratedComponent('mycomponent', style.type, options, useCssModules, () => { assert.file([ 'src/components/Mycomponent.js', 'test/components/MycomponentTest.js' ]); done(); }); }); }); describe('when creating a component', () => { it('should always import REACT', (done) => { createGeneratedComponent('mycomponent', style.type, options, useCssModules, () => { assert.fileContent('src/components/Mycomponent.js', 'import React from \'react\';'); done(); }); }); it('should have its displayName set per default', (done) => { createGeneratedComponent('mycomponent', style.type, options, useCssModules, () => { assert.fileContent('src/components/Mycomponent.js', 'Mycomponent.displayName = \'Mycomponent\';'); done(); }); }); it('should export the created component', (done) => { createGeneratedComponent('mycomponent', style.type, options, useCssModules, () => { assert.fileContent('src/components/Mycomponent.js', 'export default Mycomponent'); done(); }); }); it('should be possible to create components in a subfolder', (done) => { createGeneratedComponent('my/little !special/test', style.type, options, useCssModules, () => { assert.file([ 'src/components/my/littleSpecial/Test.js', 'test/components/my/littleSpecial/TestTest.js' ]); done(); }); }); it('should create a unit test that imports the generated component', (done) => { createGeneratedComponent('mycomponent', style.type, options, useCssModules, () => { assert.fileContent('test/components/MycomponentTest.js', 'import Mycomponent from \'components/Mycomponent.js\';'); done(); }); }); }); }); } // Run all tests for all available style types. // Stateless components will also be tested! for(const style in styleTypes(true)) { testComponentWithStyle(styleTypes(true)[style], {}, true); testComponentWithStyle(styleTypes(true)[style], { pure: true }, true); testComponentWithStyle(styleTypes(true)[style], { pure: false }, true); testComponentWithStyle(styleTypes(true)[style], { stateless: true }, true); testComponentWithoutStyle(styleTypes(true)[style], { nostyle: true }, true); } for(const style in styleTypes(false)) { testComponentWithStyle(styleTypes(false)[style], {}, false); testComponentWithStyle(styleTypes(false)[style], { pure: true }, false); testComponentWithStyle(styleTypes(false)[style], { pure: false }, false); testComponentWithStyle(styleTypes(false)[style], { stateless: true }, false); testComponentWithoutStyle(styleTypes(false)[style], { nostyle: true }, false); } }); });
(function() { 'use strict'; describe('user.client.service.user.js', function () { var $rootScope, User; beforeEach(module('users')); beforeEach(inject(function(_$rootScope_, _User_) { $rootScope = _$rootScope_; User = new _User_(); })); describe('UserAdmin resource', function () { it('should have an update method', function () { expect(User.$update).to.be.a('function'); }); it('should have an get method', function () { expect(User.$get).to.be.a('function'); }); }); }); })();
/*! * Jade - utils * Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca> * MIT Licensed */ /** * Convert interpolation in the given string to JavaScript. * * @param {String} str * @return {String} * @api private */ var interpolate = exports.interpolate = function(str){ return str.replace(/(\\)?([#!]){(.*?)}/g, function(str, escape, flag, code){ return escape ? str.slice(1) : "' + " + ('!' == flag ? '' : 'escape') + "((interp = " + code.replace(/\\'/g, "'") + ") == null ? '' : interp) + '"; }); }; /** * Escape single quotes in `str`. * * @param {String} str * @return {String} * @api private */ var escape = exports.escape = function(str) { return str.replace(/'/g, "\\'"); }; /** * Interpolate, and escape the given `str`. * * @param {String} str * @return {String} * @api private */ exports.text = function(str){ return interpolate(escape(str)); }; /** * Merge `b` into `a`. * * @param {Object} a * @param {Object} b * @return {Object} * @api public */ exports.merge = function(a, b) { for (var key in b) a[key] = b[key]; return a; };
'use strict'; var _ = require('lodash'); var del = require('del'); var gulp = require('gulp'); var argv = require('minimist')(process.argv.slice(2)); var webpack = require('webpack'); var browserSync = require('browser-sync'); var htmlcompress = require('gulp-minify-html'); var gutil = require('gulp-util'); var gif = require('gulp-if'); // var filelog = require('gulp-filelog'); // NOTE: Used for debug var runSequence = require('run-sequence'); var zip = require('gulp-zip'); var settings = { index: __dirname + '/src/index.html', entry: __dirname + '/src/index.js', output: __dirname + '/dist', server: __dirname + '/dist', assets: __dirname + '/assets/**/*' }; var WATCH = !!argv.watch; var RELEASE = !!argv.release; var DEBUG = !!argv.debug; function getBundleConfig() { var config = _.defaultsDeep({}, require('./webpack.config')); config.entry = settings.entry; config.output.path = settings.output; if (WATCH) { // config.chunkModules = false; config.watch = true; } if (RELEASE) { config.plugins = config.plugins.concat( new webpack.optimize.UglifyJsPlugin(), new webpack.optimize.OccurenceOrderPlugin() ); } else { config.output.pathinfo = true; } if (!RELEASE || DEBUG) { config.devtool = '#inline-source-map'; } return config; } gulp.task('bundle', function (cb) { var started = false; var config = getBundleConfig(); function processResult(err, stats) { gutil.log('Webpack\n' + stats.toString(config.log)); if (config.watch) { browserSync.reload(settings.entry); } if (!started) { started = true; cb(); } } var compiler = webpack(config); if (config.watch) { compiler.watch(200, processResult); } else { compiler.run(processResult); } }); gulp.task('pages', function () { return gulp.src(settings.index) .pipe(gif(RELEASE, htmlcompress())) .pipe(gulp.dest(settings.output)) .pipe(gif(WATCH, browserSync.reload({ stream: true }))); }); gulp.task('assets', function () { return gulp.src(settings.assets) .pipe(gulp.dest(settings.output + '/assets')) .pipe(gif(WATCH, browserSync.reload({ stream: true }))); }); gulp.task('clean', function () { return del(settings.server + '/**'); }); // NOTE: was running in parallel but don't like the output //gulp.task('build', ['pages', 'bundle']); gulp.task('build', function (cb) { runSequence('pages', 'assets', 'bundle', cb); }); gulp.task('build-dev', function (cb) { RELEASE = false; runSequence('build', cb); }); gulp.task('build-prod', function (cb) { RELEASE = true; runSequence('build', cb); }); gulp.task('build-ci', ['clean'], function (cb) { RELEASE = false; runSequence('build', cb); }); gulp.task('server', function (cb) { browserSync({ server: { baseDir: [settings.server] } }); cb(); }); gulp.task('dev', function (cb) { WATCH = true; runSequence('build-dev', 'server', cb); }); gulp.task('prod', function (cb) { WATCH = true; runSequence('build-prod', 'server', cb); }); gulp.task('ci', ['build-ci'], function () { return gulp.src(['dist/**', '!dist/hud.zip']) .pipe(zip('hud.zip')) .pipe(gulp.dest('dist')); }); gulp.task('default', ['dev']);
WithDiscovery = function WithDiscovery(newDiscovery, fn) { var oldDiscovery = Cluster.discovery; Cluster.discovery = newDiscovery; fn(); Cluster.discovery = oldDiscovery; }; WithCluster = function WithCluster(newFields, fn) { var original = _.clone(Cluster); Cluster = _.extend(Cluster, newFields); fn(); Cluster = original; }; WithNew = function WithNew(original, newMethods, fn) { var originalMethods = _.clone(original); var newKeys = _.difference(_.keys(newMethods), _.keys(original)); _.extend(original, newMethods); fn(); _.extend(original, originalMethods); newKeys.forEach(function(key) { delete original[key]; }); }
// 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/metadata/types/gemini/base/DataDocumentType","dojo/_base/declare dojo/_base/lang dojo/has ./GeminiDocumentType ./DataRoot dojo/i18n!../../../nls/i18nGemini ../../../../../kernel".split(" "),function(a,c,d,e,f,b,g){a=a(e,{caption:b.documentTypes.data.caption,description:b.documentTypes.data.description,key:"gemini-iso-19115",isService:!1,metadataStandardName:"UK GEMINI",metadataStandardVersion:"2.2",newRootDescriptor:function(){return new f}});d("extend-esri")&&c.setObject("dijit.metadata.types.gemini.base.DataDocumentType", a,g);return a});
/* * Gritter for jQuery * http://www.boedesign.com/ * * Copyright (c) 2009 Jordan Boesch * Dual licensed under the MIT and GPL licenses. * * Date: June 26, 2009 * Version: 1.0 */ jQuery(document).ready(function($){ /******************************************** * First, we'll define our object */ Gritter = { // PUBLIC - touch all you want fade_speed: 2000, // how fast the notices fade out timer_stay: 6000, // how long you want the message to hang on screen for // PRIVATE - no touchy the private parts _custom_timer: 0, _item_count: 0, _tpl_close: '<div class="gritter-close"></div>', _tpl_item: '<div id="gritter-item-[[number]]" class="gritter-item-wrapper" style="display:none"><div class="gritter-top"></div><div class="gritter-item">[[image]]<div class="[[class_name]]"><span class="gritter-title">[[username]]</span><p>[[text]]</p></div><div style="clear:both"></div></div><div class="gritter-bottom"></div></div>', _tpl_wrap: '<div id="gritter-notice-wrapper"></div>', // Add a notification to the screen add: function(user, text, image, sticky, time_alive){ // This is also called from init, we just added it here because // some people might just call the "add" method this.verifyWrapper(); var tmp = this._tpl_item; this._item_count++; // reset this._custom_timer = 0; // a custom fade time set if(time_alive){ this._custom_timer = time_alive; } var image_str = (image != '') ? '<img src="' + image + '" class="gritter-image" />' : ''; var class_name = (image != '') ? 'gritter-with-image' : 'gritter-without-image'; tmp = this.str_replace( ['[[username]]', '[[text]]', '[[image]]', '[[number]]', '[[class_name]]'], [user, text, image_str, this._item_count, class_name], tmp ); $('#gritter-notice-wrapper').append(tmp); var item = $('#gritter-item-' + this._item_count); var number = this._item_count; item.fadeIn(); if(!sticky){ this.setFadeTimer(item, number); } $(item).hover(function(){ if(!sticky){ Gritter.restoreItemIfFading(this, number); } Gritter.hoveringItem(this); }, function(){ if(!sticky){ Gritter.setFadeTimer(this, number); } Gritter.unhoveringItem(this); }); return number; }, // If we don't have any more gritter notifications, get rid of the wrapper countRemoveWrapper: function(){ if($('.gritter-item-wrapper').length == 0){ $('#gritter-notice-wrapper').remove(); } }, // Fade the item and slide it up nicely... once its completely faded, remove it fade: function(e){ $(e).animate({ opacity:0 }, Gritter.fade_speed, function(){ $(e).animate({ height: 0 }, 300, function(){ $(e).remove(); Gritter.countRemoveWrapper(); }) }) }, // Change the border styles and add the (X) close button when you hover hoveringItem: function(e){ $(e).addClass('hover'); if($(e).find('img').length){ $(e).find('img').before(this._tpl_close); } else { $(e).find('span').before(this._tpl_close); } $(e).find('.gritter-close').click(function(){ Gritter.remove(this); }); }, // Remove a notification, this is called from the inline "onclick" event remove: function(e){ $(e).parents('.gritter-item-wrapper').fadeOut('medium', function(){ $(this).remove(); }); this.countRemoveWrapper(); }, // Remove a specific notification based on an id (int) removeSpecific: function(id, params){ var e = $('#gritter-item-' + id); if(typeof(params) === 'object'){ if(params.fade){ var speed = this.fade_speed; if(params.speed){ speed = params.speed; } e.fadeOut(speed); } } else { e.remove(); } this.countRemoveWrapper(); }, // If the item is fading out and we hover over it, restore it! restoreItemIfFading: function(e, number){ window.clearTimeout(Gritter['_int_id_' + number]); $(e).stop().css({ opacity: 1 }); }, // Set the notification to fade out after a certain amount of time setFadeTimer: function(item, number){ var timer_str = (this._custom_timer) ? this._custom_timer : this.timer_stay; Gritter['_int_id_' + number] = window.setTimeout(function(){ Gritter.fade(item); }, timer_str); }, // Bring everything to a halt! stop: function(){ $('#gritter-notice-wrapper').fadeOut(function(){ $(this).remove(); }); }, // A handy PHP function ported to js! str_replace: function(search, replace, subject, count) { var i = 0, j = 0, temp = '', repl = '', sl = 0, fl = 0, f = [].concat(search), r = [].concat(replace), s = subject, ra = r instanceof Array, sa = s instanceof Array; s = [].concat(s); if (count) { this.window[count] = 0; } for (i=0, sl=s.length; i < sl; i++) { if (s[i] === '') { continue; } for (j=0, fl=f.length; j < fl; j++) { temp = s[i]+''; repl = ra ? (r[j] !== undefined ? r[j] : '') : r[0]; s[i] = (temp).split(f[j]).join(repl); if (count && s[i] !== temp) { this.window[count] += (temp.length-s[i].length)/f[j].length;} } } return sa ? s : s[0]; }, // Remove the border styles and (X) close button when you mouse out unhoveringItem: function(e){ $(e).removeClass('hover'); $(e).find('.gritter-close').remove(); }, // Make sure we have something to wrap our notices with verifyWrapper: function(){ if($('#gritter-notice-wrapper').length == 0){ $('body').append(this._tpl_wrap); } } } /******************************************** * Now lets turn it into some jQuery Magic! */ // Set it up as an object $.gritter = {}; // Add a gritter notification $.gritter.add = function(params){ try { if(!params.title || !params.text){ throw "Missing_Fields"; } } catch(e) { if(e == "Missing_Fields"){ alert('Gritter Error: You need to fill out the first 2 params: "title" and "text"'); } } var id = Gritter.add( params.title, params.text, params.image || '', params.sticky || false, params.time || '' ); return id; } // Remove a specific notification $.gritter.remove = function(id, params){ Gritter.removeSpecific(id, params || ''); } // Remove all gritter notifications $.gritter.removeAll = function(){ Gritter.stop(); } });
var fs = require("fs"); // Asynchronous read fs.readFile('data/input.txt', function (err, data) { if (err) { return console.error(err); } console.log("Asynchronous read1: " + data.toString()); }); // Synchronous read var data = fs.readFileSync('data/input.txt'); console.log("Synchronous read: " + data.toString()); console.log("Program Ended"); // Asynchronous - Opening File console.log("Going to open file!"); fs.open('data/input.txt', 'r+', function(err, fd) { if (err) { return console.error(err); } console.log("File opened successfully!"); }); //Get File information console.log("Going to get file info!"); fs.stat('data/input.txt', function (err, stats) { if (err) { return console.error(err); } console.log(stats); console.log("Got file info successfully!"); // Check file type console.log("isFile ? " + stats.isFile()); console.log("isDirectory ? " + stats.isDirectory()); }); //Writing File console.log("Going to write into existing file"); fs.writeFile('data/input.txt', 'Simply Easy Learning!', function(err) { if (err) { return console.error(err); } console.log("Data written successfully!"); console.log("Let's read newly written data"); fs.readFile('data/input.txt', function (err, data) { if (err) { return console.error(err); } console.log("Asynchronous read2: " + data.toString()); }); }); //Reading & Close File var fs = require("fs"); var buf = new Buffer(1024); console.log("Going to open an existing file"); fs.open('data/input.txt', 'r+', function(err, fd) { if (err) { return console.error(err); } console.log("File opened successfully!"); console.log("Going to read the file"); fs.read(fd, buf, 0, buf.length, 0, function(err, bytes){ if (err){ console.log(err); } // Print only read bytes to avoid junk. if(bytes > 0){ console.log(buf.slice(0, bytes).toString()); } // Close the opened file. fs.close(fd, function(err){ if (err){ console.log(err); } console.log("File closed successfully."); }); }); }); //Read directory console.log("Going to read directory /app"); fs.readdir("../app/",function(err, files){ if (err) { return console.error(err); } files.forEach( function (file){ console.log( file ); }); });
angular.module('app.admin.add-version-asset-modal', []) .controller('AddVersionAssetModalController', ['$scope', 'DataService', '$uibModalInstance', 'versionName', function($scope, DataService, $uibModalInstance, versionName) { $scope.DataService = DataService; $scope.versionName = versionName; $scope.asset = { platform: '', file: null }; $scope.addAsset = function() { DataService.createAsset($scope.asset, versionName) .then(function success(response) { $uibModalInstance.close(); }, function error(response) { $uibModalInstance.dismiss(); }); }; $scope.closeModal = function() { $uibModalInstance.dismiss(); }; } ]);
var five = require("../lib/johnny-five.js"); var board = new five.Board(); board.on("ready", function() { var range = [0, 170]; var slider = new five.Sensor("A0"); var tilt = new five.Servo({ pin: 10, range: range }); slider.scale(range).on("slide", function() { // The slider's value will be scaled to match the tilt servo range tilt.to(this.value); }); });
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; import * as React from 'react'; import PropTypes from 'prop-types'; import * as ReactDOM from 'react-dom'; import clsx from 'clsx'; import { elementTypeAcceptingRef, refType } from '@material-ui/utils'; import useForkRef from '../utils/useForkRef'; import useEventCallback from '../utils/useEventCallback'; import deprecatedPropType from '../utils/deprecatedPropType'; import withStyles from '../styles/withStyles'; import useIsFocusVisible from '../utils/useIsFocusVisible'; import TouchRipple from './TouchRipple'; export const styles = { /* Styles applied to the root element. */ root: { display: 'inline-flex', alignItems: 'center', justifyContent: 'center', position: 'relative', WebkitTapHighlightColor: 'transparent', backgroundColor: 'transparent', // Reset default value // We disable the focus ring for mouse, touch and keyboard users. outline: 0, border: 0, margin: 0, // Remove the margin in Safari borderRadius: 0, padding: 0, // Remove the padding in Firefox cursor: 'pointer', userSelect: 'none', verticalAlign: 'middle', '-moz-appearance': 'none', // Reset '-webkit-appearance': 'none', // Reset textDecoration: 'none', // So we take precedent over the style of a native <a /> element. color: 'inherit', '&::-moz-focus-inner': { borderStyle: 'none' // Remove Firefox dotted outline. }, '&$disabled': { pointerEvents: 'none', // Disable link interactions cursor: 'default' }, '@media print': { colorAdjust: 'exact' } }, /* Pseudo-class applied to the root element if `disabled={true}`. */ disabled: {}, /* Pseudo-class applied to the root element if keyboard focused. */ focusVisible: {} }; /** * `ButtonBase` contains as few styles as possible. * It aims to be a simple building block for creating a button. * It contains a load of style reset and some focus/ripple logic. */ const ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) { const { action, buttonRef: buttonRefProp, centerRipple = false, children, classes, className, component = 'button', disabled = false, disableRipple = false, disableTouchRipple = false, focusRipple = false, focusVisibleClassName, onBlur, onClick, onFocus, onFocusVisible, onKeyDown, onKeyUp, onMouseDown, onMouseLeave, onMouseUp, onTouchEnd, onTouchMove, onTouchStart, onDragLeave, tabIndex = 0, TouchRippleProps, type = 'button' } = props, other = _objectWithoutPropertiesLoose(props, ["action", "buttonRef", "centerRipple", "children", "classes", "className", "component", "disabled", "disableRipple", "disableTouchRipple", "focusRipple", "focusVisibleClassName", "onBlur", "onClick", "onFocus", "onFocusVisible", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseLeave", "onMouseUp", "onTouchEnd", "onTouchMove", "onTouchStart", "onDragLeave", "tabIndex", "TouchRippleProps", "type"]); const buttonRef = React.useRef(null); function getButtonNode() { // #StrictMode ready return ReactDOM.findDOMNode(buttonRef.current); } const rippleRef = React.useRef(null); const [focusVisible, setFocusVisible] = React.useState(false); if (disabled && focusVisible) { setFocusVisible(false); } const { isFocusVisible, onBlurVisible, ref: focusVisibleRef } = useIsFocusVisible(); React.useImperativeHandle(action, () => ({ focusVisible: () => { setFocusVisible(true); buttonRef.current.focus(); } }), []); React.useEffect(() => { if (focusVisible && focusRipple && !disableRipple) { rippleRef.current.pulsate(); } }, [disableRipple, focusRipple, focusVisible]); function useRippleHandler(rippleAction, eventCallback, skipRippleAction = disableTouchRipple) { return useEventCallback(event => { if (eventCallback) { eventCallback(event); } const ignore = skipRippleAction; if (!ignore && rippleRef.current) { rippleRef.current[rippleAction](event); } return true; }); } const handleMouseDown = useRippleHandler('start', onMouseDown); const handleDragLeave = useRippleHandler('stop', onDragLeave); const handleMouseUp = useRippleHandler('stop', onMouseUp); const handleMouseLeave = useRippleHandler('stop', event => { if (focusVisible) { event.preventDefault(); } if (onMouseLeave) { onMouseLeave(event); } }); const handleTouchStart = useRippleHandler('start', onTouchStart); const handleTouchEnd = useRippleHandler('stop', onTouchEnd); const handleTouchMove = useRippleHandler('stop', onTouchMove); const handleBlur = useRippleHandler('stop', event => { if (focusVisible) { onBlurVisible(event); setFocusVisible(false); } if (onBlur) { onBlur(event); } }, false); const handleFocus = useEventCallback(event => { // Fix for https://github.com/facebook/react/issues/7769 if (!buttonRef.current) { buttonRef.current = event.currentTarget; } if (isFocusVisible(event)) { setFocusVisible(true); if (onFocusVisible) { onFocusVisible(event); } } if (onFocus) { onFocus(event); } }); const isNonNativeButton = () => { const button = getButtonNode(); return component && component !== 'button' && !(button.tagName === 'A' && button.href); }; /** * IE 11 shim for https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/repeat */ const keydownRef = React.useRef(false); const handleKeyDown = useEventCallback(event => { // Check if key is already down to avoid repeats being counted as multiple activations if (focusRipple && !keydownRef.current && focusVisible && rippleRef.current && event.key === ' ') { keydownRef.current = true; event.persist(); rippleRef.current.stop(event, () => { rippleRef.current.start(event); }); } if (event.target === event.currentTarget && isNonNativeButton() && event.key === ' ') { event.preventDefault(); } if (onKeyDown) { onKeyDown(event); } // Keyboard accessibility for non interactive elements if (event.target === event.currentTarget && isNonNativeButton() && event.key === 'Enter' && !disabled) { event.preventDefault(); if (onClick) { onClick(event); } } }); const handleKeyUp = useEventCallback(event => { // calling preventDefault in keyUp on a <button> will not dispatch a click event if Space is pressed // https://codesandbox.io/s/button-keyup-preventdefault-dn7f0 if (focusRipple && event.key === ' ' && rippleRef.current && focusVisible && !event.defaultPrevented) { keydownRef.current = false; event.persist(); rippleRef.current.stop(event, () => { rippleRef.current.pulsate(event); }); } if (onKeyUp) { onKeyUp(event); } // Keyboard accessibility for non interactive elements if (onClick && event.target === event.currentTarget && isNonNativeButton() && event.key === ' ' && !event.defaultPrevented) { onClick(event); } }); let ComponentProp = component; if (ComponentProp === 'button' && other.href) { ComponentProp = 'a'; } const buttonProps = {}; if (ComponentProp === 'button') { buttonProps.type = type; buttonProps.disabled = disabled; } else { if (ComponentProp !== 'a' || !other.href) { buttonProps.role = 'button'; } buttonProps['aria-disabled'] = disabled; } const handleUserRef = useForkRef(buttonRefProp, ref); const handleOwnRef = useForkRef(focusVisibleRef, buttonRef); const handleRef = useForkRef(handleUserRef, handleOwnRef); const [mountedState, setMountedState] = React.useState(false); React.useEffect(() => { setMountedState(true); }, []); const enableTouchRipple = mountedState && !disableRipple && !disabled; if (process.env.NODE_ENV !== 'production') { // eslint-disable-next-line react-hooks/rules-of-hooks React.useEffect(() => { if (enableTouchRipple && !rippleRef.current) { console.error(['Material-UI: The `component` prop provided to ButtonBase is invalid.', 'Please make sure the children prop is rendered in this custom component.'].join('\n')); } }, [enableTouchRipple]); } return /*#__PURE__*/React.createElement(ComponentProp, _extends({ className: clsx(classes.root, className, focusVisible && [classes.focusVisible, focusVisibleClassName], disabled && classes.disabled), onBlur: handleBlur, onClick: onClick, onFocus: handleFocus, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, onMouseDown: handleMouseDown, onMouseLeave: handleMouseLeave, onMouseUp: handleMouseUp, onDragLeave: handleDragLeave, onTouchEnd: handleTouchEnd, onTouchMove: handleTouchMove, onTouchStart: handleTouchStart, ref: handleRef, tabIndex: disabled ? -1 : tabIndex }, buttonProps, other), children, enableTouchRipple ? /*#__PURE__*/ /* TouchRipple is only needed client-side, x2 boost on the server. */ React.createElement(TouchRipple, _extends({ ref: rippleRef, center: centerRipple }, TouchRippleProps)) : null); }); process.env.NODE_ENV !== "production" ? ButtonBase.propTypes = { // ----------------------------- Warning -------------------------------- // | These PropTypes are generated from the TypeScript type definitions | // | To update them edit the d.ts file and run "yarn proptypes" | // ---------------------------------------------------------------------- /** * A ref for imperative actions. * It currently only supports `focusVisible()` action. */ action: refType, /** * @ignore * * Use that prop to pass a ref to the native button component. * @deprecated Use `ref` instead. */ buttonRef: deprecatedPropType(refType, 'Use `ref` instead.'), /** * If `true`, the ripples will be centered. * They won't start at the cursor interaction position. */ centerRipple: PropTypes.bool, /** * The content of the component. */ children: PropTypes.node, /** * Override or extend the styles applied to the component. * See [CSS API](#css) below for more details. */ classes: PropTypes.object, /** * @ignore */ className: PropTypes.string, /** * The component used for the root node. * Either a string to use a HTML element or a component. */ component: elementTypeAcceptingRef, /** * If `true`, the base button will be disabled. */ disabled: PropTypes.bool, /** * If `true`, the ripple effect will be disabled. * * ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure * to highlight the element by applying separate styles with the `focusVisibleClassName`. */ disableRipple: PropTypes.bool, /** * If `true`, the touch ripple effect will be disabled. */ disableTouchRipple: PropTypes.bool, /** * If `true`, the base button will have a keyboard focus ripple. */ focusRipple: PropTypes.bool, /** * This prop can help identify which element has keyboard focus. * The class name will be applied when the element gains the focus through keyboard interaction. * It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo). * The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/master/explainer.md). * A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components * if needed. */ focusVisibleClassName: PropTypes.string, /** * @ignore */ href: PropTypes.string, /** * @ignore */ onBlur: PropTypes.func, /** * @ignore */ onClick: PropTypes.func, /** * @ignore */ onDragLeave: PropTypes.func, /** * @ignore */ onFocus: PropTypes.func, /** * Callback fired when the component is focused with a keyboard. * We trigger a `onFocus` callback too. */ onFocusVisible: PropTypes.func, /** * @ignore */ onKeyDown: PropTypes.func, /** * @ignore */ onKeyUp: PropTypes.func, /** * @ignore */ onMouseDown: PropTypes.func, /** * @ignore */ onMouseLeave: PropTypes.func, /** * @ignore */ onMouseUp: PropTypes.func, /** * @ignore */ onTouchEnd: PropTypes.func, /** * @ignore */ onTouchMove: PropTypes.func, /** * @ignore */ onTouchStart: PropTypes.func, /** * @ignore */ tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), /** * Props applied to the `TouchRipple` element. */ TouchRippleProps: PropTypes.object, /** * @ignore */ type: PropTypes.oneOfType([PropTypes.oneOf(['button', 'reset', 'submit']), PropTypes.string]) } : void 0; export default withStyles(styles, { name: 'MuiButtonBase' })(ButtonBase);
// Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. var common = require('../common'); var assert = require('assert'); var Readable = require('_stream_readable'); var Writable = require('_stream_writable'); var EE = require('events').EventEmitter; var testRuns = 0, completedRuns = 0; function runTest(highWaterMark, objectMode, produce) { testRuns++; var old = new EE; var r = new Readable({ highWaterMark: highWaterMark, objectMode: objectMode }); assert.equal(r, r.wrap(old)); var ended = false; r.on('end', function() { ended = true; }); old.pause = function() { console.error('old.pause()'); old.emit('pause'); flowing = false; }; old.resume = function() { console.error('old.resume()'); old.emit('resume'); flow(); }; var flowing; var chunks = 10; var oldEnded = false; var expected = []; function flow() { flowing = true; while (flowing && chunks-- > 0) { var item = produce(); expected.push(item); console.log('old.emit', chunks, flowing); old.emit('data', item); console.log('after emit', chunks, flowing); } if (chunks <= 0) { oldEnded = true; console.log('old end', chunks, flowing); old.emit('end'); } } var w = new Writable({ highWaterMark: highWaterMark * 2, objectMode: objectMode }); var written = []; w._write = function(chunk, encoding, cb) { console.log('_write', chunk); written.push(chunk); setTimeout(cb); }; w.on('finish', function() { completedRuns++; performAsserts(); }); r.pipe(w); flow(); function performAsserts() { assert(ended); assert(oldEnded); assert.deepEqual(written, expected); } } runTest(100, false, function(){ return new Buffer(100); }); runTest(10, false, function(){ return new Buffer('xxxxxxxxxx'); }); runTest(1, true, function(){ return { foo: 'bar' }; }); process.on('exit', function() { assert.equal(testRuns, completedRuns); console.log('ok'); });
'use strict'; // Runs `npm install` in cwd const path = require('path'); const fs = require('fs'); const NpmTask = require('./npm-task'); const formatPackageList = require('../utilities/format-package-list'); class NpmInstallTask extends NpmTask { constructor(options) { super(options); this.command = 'install'; } run(options) { let ui = this.ui; let packageJson = path.join(this.project.root, 'package.json'); if (!fs.existsSync(packageJson)) { ui.writeWarnLine('Skipping npm install: package.json not found'); return Promise.resolve(); } else { return super.run(options); } } formatStartMessage(packages) { return `${this.useYarn ? 'Yarn' : 'npm'}: Installing ${formatPackageList(packages)} ...`; } formatCompleteMessage(packages) { return `${this.useYarn ? 'Yarn' : 'npm'}: Installed ${formatPackageList(packages)}`; } } module.exports = NpmInstallTask;
JCSDL.Loader.addComponent(function($, undefined) { this.GUILogic = function(gui, logic) { var self = this; // reference some useful or required elements of the GUI this.gui = gui; this.config = gui.config; this.parser = gui.parser; // reference some functions that we'd want to reuse this.getTemplate = gui.getTemplate; // note: it will lose scope, so if this function is using 'this' keyword, better create a proxy function /* * SETUP */ this.$logicOptions = gui.$mainView.find('.jcsdl-filters-logic .jcsdl-filters-logic-option:not(.jcsdl-advanced-option)'); this.$advancedOptions = gui.$mainView.find('.jcsdl-filters-logic .jcsdl-filters-logic-option.jcsdl-advanced-option'); this.$insertBracketsButton = this.$advancedOptions.filter('.jcsdl-advanced-add-brackets'); this.$insertNotOperatorButton = this.$advancedOptions.filter('.jcsdl-advanced-add-not'); this.$editor = gui.$mainView.find('.jcsdl-advanced-container'); this.$guiContainer = this.initGui(this.$editor.find('.jcsdl-advanced-gui-container')); this.$gui = this.$guiContainer.find('.jcsdl-advanced-gui'); this.$manual = this.$editor.find('.jcsdl-advanced-manual'); this.$manualInput = this.initManualInput(this.$manual.find('input')); /* * REGISTER LISTENERS */ /** * Set the logic upon selection. * * @param {Event} ev */ this.$logicOptions.click(function(ev) { ev.preventDefault(); ev.target.blur(); var $el = $(this); // ignore when disabled or already active if ($el.is('.disabled') || $el.is('.active')) return false; var old = self.logic; self.logic = $el.data('logic'); self.didSetLogic(old, false); }); /** * Initiate Tipsy on the advanced logic help icon and trigger it on click. */ this.$logicOptions.filter('.jcsdl-advanced').find('.jcsdl-logic-help').tipsy({ gravity : 's', trigger : 'manual', title : function() { if (self.$editor.is(':visible')) { return $(this).data(self.$manual.is(':visible') ? 'textManual' : 'textGui'); } else { return $(this).data('textGeneral'); } } }).click(function(ev) { ev.preventDefault(); ev.target.blur(); ev.stopPropagation(); var $el = $(this); $el.tipsy('show'); $('body').one('click', function(ev) { $el.tipsy('hide'); }); }); /** * Toggle switch between manual and graphical advanced edit. * * @param {Event} ev Click Event. */ this.$advancedOptions.filter('.jcsdl-advanced-manual-edit').click(function(ev) { ev.preventDefault(); ev.target.blur(); var $el = $(this); if ($el.is('.on')) { // cannot switch until given expression is valid try { self.validate(self.getManualString()); } catch(e) { self.showError(e); return; } $el.removeClass('on'); $el.html($el.data('textGui')); self.$manualInput.blur(); self.$manual.hide(); self.$guiContainer.fadeIn(self.config.animate); // activate brackets inserting button self.$insertBracketsButton.removeClass('disabled'); self.$insertNotOperatorButton.removeClass('disabled'); // update the GUI self.setGuiString(); self.trigger('graphicalLogic'); } else { // cannot switch until given expression is valid try { self.validate(self.getGuiString()); } catch(e) { self.showError(e); return; } $el.addClass('on'); $el.html($el.data('textManual')); // update the manual input self.setManualString(); self.$guiContainer.hide(); self.$manual.fadeIn(self.config.animate); self.$manualInput.focus(); // deactivate brackets inserting button self.$insertBracketsButton.addClass('disabled'); self.$insertNotOperatorButton.addClass('disabled'); self.trigger('manualLogic'); } }); // final setup try { this.setLogic(logic, true); } catch(e) { this.showError(e, true); } // TODO: potentially make the editor sticky on scrolling }; this.GUILogic.prototype = { // constants ADVANCED : 'ADVANCED', AND : 'AND', OR : 'OR', /** * Parses the logical string into an array of tokens. * * @param {String} logicString[optional] Logical string. If none set it will use the global logicalString. * @return {Array} */ tokenize : function(logicString) { logicString = logicString || this.logicString; return this.parser.tokenizeLogicString(logicString); }, /** * Validates the given logical string if it's properly built. * Throws {JCSDL.LogicValidationException} in cases of invalid elements. * * @param {mixed} logicString[optional] Logical string. If none set it will use the global logicalString. Can also be already tokenized string. * @param {Array} availableFilters[optional] Array of available filters in the editor. If provided, it will also validate that all filters are used. If not provided it will fetch them from the GUI itself. * @return {Boolean} */ validate : function(logicString, availableFilters) { logicString = logicString || this.logicString; availableFilters = availableFilters || this.gui.filters; return this.parser.validateLogic(logicString, availableFilters); }, /** * Shows the advanced logic editor. */ showEditor : function() { this.$editor.show(); this.adjustGui(); this.$editor.hide().slideDown(this.config.animate); this.gui.$mainView.addClass('jcsdl-advanced-on'); }, /** * Hides the advanced logic editor. */ hideEditor : function() { this.$editor.slideUp(this.config.animate); this.gui.$mainView.removeClass('jcsdl-advanced-on'); }, /** * Activates (or disables) the logic option buttons. * @param {Boolean} on[optional] True for activate, false for disable. Default: true. */ toggleButtons : function(on) { on = (on === undefined) ? true : on; // if disabling then also select 'AND' to hide the advanced logic editor (no longer needed and shouldnt stay visible) if (!on) { this.setLogic(this.AND); } this.$logicOptions[on ? 'removeClass' : 'addClass']('disabled'); }, /** * Shows an error. * * @param {mixed} error Error message to be displayed. Can also be a JCSDL.LogicValidationException instance. * @param {Boolean} silent[optional] Don't print the error to the console? Default: false. */ showError : function(error, silent) { silent = silent || false; // clear all previous errors this.clearErrors(); var message = (error instanceof JCSDL.LogicValidationException) ? error.message : error, $error = this.getTemplate('error'); $error.find('span').html(message); $error.insertAfter(this.$editor) .show(); if (!silent) { this.trigger('logicError', [error]); } if (!silent) { this.trigger('logicError', [error]); if (console !== undefined) { console.error(error, arguments); } } // if validation exception then also highlight invalid token in the gui (if it's active) if (error instanceof JCSDL.LogicValidationException && this.$gui.is(':visible')) { if (error.index >= 0) { var $token = this.$gui.children(). not('.jcsdl-token-ph') .eq(error.index) .find('.jcsdl-logic-token') .addClass('jcsdl-logic-error'); this.scrollGuiToToken($token); } } $error.animateIntoView(this.config.animate); }, /** * Trigger an event handler defined in the config. * * @param {String} name Name of the event handler. * @param {Array} data[optional] Arguments to pass to the handler. * @return {mixed} Whatever the handler returns. */ trigger : function(name, data) { this.gui.trigger(name, data); }, /** * Clears all errors. */ clearErrors : function() { this.gui.clearErrors(); this.$gui.find('.jcsdl-logic-error').removeClass('jcsdl-logic-error'); }, /* ########################## * GUI EDITOR * ########################## */ /** * Initializes the GUI editor of the logical expression. * * @param {jQuery} $view GUI editor element. * @return {jQuery} */ initGui : function($view) { var self = this, $gui = $view.find('.jcsdl-advanced-gui'), // helper vars for scrolling scrollInterval = null, scrollSpeed = 50; // link up left and right arrows for scrolling this.$guiLeft = $view.find('.jcsdl-advanced-gui-arrow.left'); this.$guiRight = $view.find('.jcsdl-advanced-gui-arrow.right'); // make the tokens sortable $gui.sortable({ cursor : 'move', placeholder : 'jcsdl-token-ph', containment : $view, appendTo : $view, helper : 'clone', tolerance : 'intersect', start : function(ev, ui) { if (ui.item.find('.jcsdl-logic-token').is('.bracket')) { $gui.find('.jcsdl-token-ph').addClass('bracket'); } }, stop : function(ev, ui) { // turn off highlighting of the related filter var $token = ui.item.find('.jcsdl-logic-token'); if ($token.is('.filter')) { self.gui.highlightFilter($token.data('token'), false); } }, // make scrolling possible based on absolute position of the helper (ie. if it's above one of the arrows then scroll the GUI) sort : function(ev, ui) { // turn off any previous scrolling for safety clearInterval(scrollInterval); // NOTE: the arrows need to be visible to allow scrolling // are we scrolling to the right? if (self.$guiRight.is(':visible') && (ui.offset.left + ui.helper.width() / 2) >= self.$guiRight.offset().left) { scrollInterval = setInterval(function() { self.scrollGui('right', scrollSpeed); }, scrollSpeed); } // are we scrolling to the left? if (self.$guiLeft.is(':visible') && ui.offset.left <= (self.$guiLeft.offset().left + ui.helper.width() / 2)) { scrollInterval = setInterval(function() { self.scrollGui('left', scrollSpeed); }, scrollSpeed); } // highlight the related filter that's being dragged var $token = ui.helper.find('.jcsdl-logic-token'); if ($token.is('.filter')) { self.gui.highlightFilter($token.html()); // use .html() because .data() apparently isn't cloned properly } }, // update (and validate first) the internal logic string upon done sorting update : function(ev, ui) { // make sure scrolling has stopped clearInterval(scrollInterval); setTimeout(function() { self.updateFromGui(); // trigger a change var str = self.getGuiString(); self.trigger('graphicalLogicTokenMove', [str]); self.trigger('graphicalLogicChange', [str]); self.trigger('advancedLogicChange', [str]); }, 100); } }); // hack to make horizontal sortable working smoothly (with a fix for older jQuery UI version) ($gui.data('sortable') || {}).floating = true; ($gui.data('uiSortable') || {}).floating = true; /* * REGISTER LISTENERS */ /** * Insert brackets to the GUI editor * * @param {Event} ev Click event. */ this.$insertBracketsButton.click(function(ev) { ev.preventDefault(); ev.target.blur(); // ignore when disabled if ($(this).is('.disabled')) return false; self.addGuiToken(')', true, true); self.updateFromGui(); var str = self.getGuiString(); self.trigger('parenthesisAdd', [str]); self.trigger('graphicalLogicChange', [str]); self.trigger('advancedLogicChange', [str]); }); /** * Insert NOT operator to the GUI editor. */ this.$insertNotOperatorButton.click(function(ev) { ev.preventDefault(); ev.target.blur(); // ignore when disabled if ($(this).is('.disabled')) return false; self.addGuiToken('!', true, true); self.updateFromGui(); var str = self.getGuiString(); self.trigger('notOperatorAdd', [str]); self.trigger('graphicalLogicChange', [str]); self.trigger('advancedLogicChange', [str]); }); /** * Start scrolling on mousedown or touchstart events. */ this.$guiRight.add(this.$guiLeft).bind('mousedown touchstart', function(ev) { var dir = $(this).is('.right') ? 'right' : 'left'; scrollInterval = setInterval(function() { self.scrollGui(dir, scrollSpeed); }, scrollSpeed); // mouse up will remove the interval (mouseleave as well) }).bind('mouseup mouseleave touchend', function(ev) { clearInterval(scrollInterval); // and prevent default behavior on click() }).click(function(ev) { ev.preventDefault(); ev.target.blur(); }); /** * Adjust the GUI on window resizes. */ $(window).resize(function(ev) { self.adjustGui(); }); return $view; }, /** * Updates the internal logic string from the GUI editor. */ updateFromGui : function() { var tokens = this.getGuiTokens(); try { if (this.validate(tokens)) { this.clearErrors(); this.logicString = tokens.join(''); } } catch(e) { this.showError(e, true); } }, /** * Sets the given string inside the GUI editor of the logical expression. * * @param {mixed} logicString[optional] Logical string. If none set it will use the global logicalString. Can also be already tokenized string. */ setGuiString : function(logicString) { logicString = logicString || this.logicString; var self = this, // automatically tokenize the logic string if a string indeed supplied tokens = (typeof logicString === 'string' || typeof logicString === 'number') ? this.tokenize(logicString) : logicString; this.clearGui(); $.each(tokens, function(i, token) { self.addGuiToken(token, false); }); }, /** * Reads the logic string from the GUI editor. * * @param {jQuery} $gui[optional] GUI editor DOM element. If ommitted it will use the global one. * @return {String} */ getGuiString : function($gui) { $gui = $gui || this.$gui; var str = ''; $gui.find('.jcsdl-logic-token').each(function() { str += '' + $(this).data('token'); // ensure string }); return str; }, /** * Reads the logic string in the form of tokens from the GUI editor. * * @param {jQuery} $gui[optional] GUI editor DOM element. If ommitted it will use the global one. * @return {Array} */ getGuiTokens : function($gui) { $gui = $gui || this.$gui; var tokens = []; $gui.find('.jcsdl-logic-token').each(function() { tokens.push($(this).data('token')); }); return tokens; }, /** * Clears all tokens from the GUI editor. */ clearGui : function() { this.$gui.width(0) .children().remove(); }, tokensMap : { '(' : 'bracketOpen', ')' : 'bracketClose', '&' : 'operatorAnd', '|' : 'operatorOr', '!' : 'operatorNot', 'filter' : 'filter' }, /** * Adds a GUI token to the GUI editor of logic. * * @param {String} token Logic token. * @param {Boolean} scroll[optional] Should the new token be scrolled into view? Default: true. * @param {Boolean} manual[optional] Is it a manual trigger? For internal use. Default: false. */ addGuiToken : function(token, scroll, manual) { scroll = (scroll === undefined) ? true : scroll; manual = (manual === undefined) ? false : manual; var self = this, t = (typeof token == 'number') ? 'filter' : token; if (this.tokensMap[t] === undefined) { throw 'Invalid character "' + token + '" in the logic!'; } var $token = this.getTemplate('logicToken_' + this.tokensMap[t]) .data('token', token), $open = $(); // if a filter then set content to filter ID if (t == 'filter') { $token.html(token); } // add ! operator to the front, otherwise to the end of expression var $li = $('<li class="jcsdl-logic-token-wrap" />').html($token)[token === '!' && manual ? 'prependTo' : 'appendTo'](this.$gui); this.$gui.width(this.$gui.width() + $li.outerWidth(true)); // if adding a parenthesis (closing one) also add the opening one in appropriate place if (token == ')' && manual) { $open = this.getTemplate('logicToken_bracketOpen') .data('token', '('); // find position where to insert it var tokens = this.getGuiTokens().reverse(), pos = tokens.length, level = -1, // take into account that there is the new parenthesis at the end already logic = null; // lowest level logic (level 0 logic) $.each(tokens, function(i, token) { if (token == ')') level++; else if (token == '(') level--; if (level == 0 && $.inArray(token, ['&', '|']) >= 0) { if (logic !== null && token !== logic) { // if there is a change of logic at level 0 then this is where we insert the opening bracket! pos = i; return false; // break } logic = token; } }); var $before = this.$gui.children().eq(tokens.length - pos), $openLi = $('<li class="jcsdl-logic-token-wrap" />').html($open).insertBefore($before); this.$gui.width(this.$gui.width() + $openLi.outerWidth(true)); } this.updateFromGui(); this.adjustGui(); if (scroll) { this.scrollGuiToToken($token); } /** * Prevent any clicks on the token. * * @param {Event} ev Click event. */ $token.click(function(ev) { ev.preventDefault(); ev.target.blur(); // toggle logical operator if ($token.data('token') == '&') { $token.data('token', '|').html('OR'); self.trigger('logicOperatorSwitch', ['OR']); var str = self.getGuiString(); self.trigger('graphicalLogicChange', [str]); self.trigger('advancedLogicChange', [str]); } else if ($token.data('token') == '|') { $token.data('token', '&').html('AND'); self.trigger('logicOperatorSwitch', ['AND']); var str = self.getGuiString(); self.trigger('graphicalLogicChange', [str]); self.trigger('advancedLogicChange', [str]); } self.updateFromGui(); }); // delete token $token.add($open).find('.jcsdl-delete-token').click(function(ev) { ev.preventDefault(); ev.target.blur(); ev.stopPropagation(true); self.deleteGuiToken($token); var str = self.getGuiString(), eventName = ($token.data('token') === '!') ? 'notOperatorDelete' : 'parenthesisDelete'; self.trigger(eventName, [str]); self.trigger('graphicalLogicChange', [str]); self.trigger('advancedLogicChange', [str]); }); /** * Highlight related filter in the filter's list on hover over a filter tile. */ $token.filter('.filter').hover(function(ev) { self.gui.highlightFilter($(this).data('token')); }, function(ev) { self.gui.highlightFilter($(this).data('token'), false); }); }, /** * Removes the given filter ID from the GUI editor as well as its' corresponding logical operator. * @param {Number} filterId ID of the filter to be removed. */ deleteGuiFilterToken : function(filterId) { filterId = parseInt(filterId); // ensure {Number} var self = this, $filter = $(), $operator = $(); // find this filter's token this.$gui.children().each(function() { var $li = $(this); if (parseInt($li.find('.jcsdl-logic-token').data('token')) === filterId) { $filter = $li; return false; // break } }); if (!$filter.length) return false; // for some reason couldnt find it // remove any brackets that this filter id could be wrapped in (e.g. ((((2)))) ) while( $filter.prev().find('.jcsdl-logic-token').data('token') == '(' && $filter.next().find('.jcsdl-logic-token').data('token') == ')' ) { $filter.prev().remove(); $filter.next().remove(); } // now remove the operator in front (if indeed an operator) if ($filter.prev().find('.jcsdl-logic-token.operator').length) { $operator = $filter.prev(); } else if ($filter.next().find('.jcsdl-logic-token.operator').length) { $operator = $filter.next(); } // remove the filter and the operator $filter.remove(); $operator.remove(); // update the logic string this.updateFromGui(); var str = self.getGuiString(); self.trigger('graphicalLogicChange', [str]); self.trigger('advancedLogicChange', [str]); }, /** * Deletes the given token from the GUI editor. * * @param {jQuery} $token Can be either <li> element with the token or the token itself. */ deleteGuiToken : function($token) { var $li = ($token.is('.jcsdl-logic-token')) ? $token.closest('li.jcsdl-logic-token-wrap') : $token; if (!$li.is('li.jcsdl-logic-token-wrap')) return false; // make sure that $token is the token itself var $token = $li.find('.jcsdl-logic-token'); // cannot delete AND and OR operators (but can NOT operator) if ($token.is('.operator') && $token.data('token') !== '!') return false; // if this is a filter then check if this filter exists and if so block deleting of it if ($token.is('.filter')) { var filterId = $token.data('token'), exists = false; $.each(this.gui.filters, function(i, filter) { if (parseInt(filter.id) == parseInt(filterId)) { exists = true; return false; // break } }); // if the filter exists then don't allow to delete it if (exists) return false; } else if ($token.is('.bracket')) { // if deleting a parenthesis then find its pair and also delete it var tokens = this.getGuiTokens(), pos = this.$gui.children().index($li), found = null, level = 0, // current nesting level in the foreach below onLevel = 0, // on which level to search for pair searching = ')', // searching for the closing parenthesis lvlIncr = '(', // increase level on this token lvlDecr = ')'; // decrease level on this token if ($token.data('token') == ')') { // if closing parenthesis then search in reverse tokens = tokens.reverse(); pos = tokens.length - 1 - pos; // adjust the position as well searching = '('; // searching for the opening parenthesis lvlIncr = ')'; // increase level on this token lvlDecr = '('; // decrease level on this token } $.each(tokens, function(i, t) { // if we reached the parenthesis that is being deleted then on this level we should search for a match as well if (i == pos) { onLevel = level; return true; } // if we passed past the token that is being deleted, then start proper search if (onLevel !== null && level == onLevel && i > pos && t == searching) { // if search is reversed then also reverse the result found = (searching == '(') ? tokens.length - 1 - i : i; return false; // break when found } if (t == lvlIncr) level++; else if (t == lvlDecr) level--; }); if (found !== null) { // make sure to filter the children to exclude any possible sortable placeholder var $found = this.$gui.children().filter('.jcsdl-logic-token-wrap').eq(found); this.$gui.width(this.$gui.width() - $found.outerWidth(true)); $found.remove(); } } this.$gui.width(this.$gui.width() - $li.outerWidth(true)); $li.remove(); this.updateFromGui(); this.adjustGui(); }, /** * Helper variable to throttle adjusting the GUI. * @type {mixed} */ _adjustGuiTimeout : null, /** * Adjusts GUI arrows, positioning and sizing. * Throttled by a timeout. */ adjustGui : function() { var self = this, width = 0; this.$gui.children().each(function() { width += parseInt($(this).outerWidth(true)); }); this.$gui.width(width).css('minWidth', parseInt(this.$gui.parent().width() * 0.9, 10)); clearTimeout(this._adjustGuiTimeout); this._adjustGuiTimeout = setTimeout(function() { var width = self.$gui.width(), containerWidth = self.$guiContainer.width(); if (width > containerWidth) { self.$guiRight.removeClass('off'); } else { // if gui width is smaller than container width then there's no need for scrolling self.$guiLeft.add(self.$guiRight).addClass('off'); // make sure it's scrolled to beginning tho self.scrollGuiToStart(); } }, 50); }, /** * Scrolls the GUI left or right. * * @param {mixed} dir Direction {String} left/right in which to scroll or position {Number} in pixels. * @param {Number} speed[optional] Animation duration. Default: 50. */ scrollGui : function(dir, speed) { speed = (speed == undefined) ? 50 : speed; // if gui width is smaller than the container's then min offset is 0 var boundary = -1 * Math.max(0, this.$gui.width() - this.$guiContainer.width()), pos = 0, self = this; if (typeof dir === 'number') { pos = dir; } else { // offset difference to apply to scroll var offset = (dir == 'right') ? -30 : 30; pos = parseInt(this.$gui.css('left')) + offset; } // make sure the new position is not outside scroll boundaries pos = Math.max(Math.min(0, pos), boundary); // scroll the GUI to the new position this.$gui.stop(true, true).animate({ left : pos }, speed, function() { // adjust visibility of left and right arrows self.$guiLeft[pos == 0 ? 'addClass' : 'removeClass']('off'); self.$guiRight[pos == boundary ? 'addClass' : 'removeClass']('off'); }); }, /** * Scrolls the GUI editor to the beginning. */ scrollGuiToStart : function() { this.scrollGui(0); }, /** * Scrolls the GUI editor to the end. */ scrollGuiToEnd : function() { this.scrollGuiToToken(this.$gui.children().last()); }, /** * Scrolls the GUI editor to make the given token visible. * * @param {jQuery} $token Can be either <li> element with the token or the token itself. */ scrollGuiToToken : function($token) { $token = ($token.is('.jcsdl-logic-token')) ? $token.closest('li.jcsdl-logic-token-wrap') : $token; if (!$token.is('li.jcsdl-logic-token-wrap')) return false; var offset = -1 * $token.position().left, pos = (parseInt(this.$gui.css('left')) < offset) ? offset - 60 : offset + 60; this.scrollGui(offset + 140); }, /* ########################## * MANUAL EDITOR * ########################## */ /** * Initializes the manual editor of the logic. * * @param {jQuery} $input Input on which to initialize the editor. * @return {jQuery} */ initManualInput : function($input) { var self = this; /* * REGISTER LISTENERS */ var updateTimeout = null; /** * Update the internal logic string (and validate it) when user stopped typing. * @param {Event} ev Keyup event. */ $input.keyup(function(ev) { clearTimeout(updateTimeout); updateTimeout = setTimeout(function() { var str = $input.val(); if (self.logicString !== str) { self.trigger('manualLogicChange', [str]); self.trigger('advancedLogicChange', [str]); } try { if (self.validate(str)) { self.clearErrors(); self.logicString = str; } } catch(e) { self.showError(e, true); } }, 500); }); /** * Mask input so that only allowed chars are allowed to be entered. * * @param {Event} ev Keydown event. */ $input.keydown(function(ev) { var k = ev.which, s = ev.shiftKey; if ( // allow BACKSPACE k == 8 // allow arrows || (k >= 37 && k <= 40) // allow DELETE || k == 46 // allow numbers (without SHIFT pressed) || (k >= 48 && k <= 57 && !s) // allow numpad numbers || (k >= 96 && k <= 105) // allow open bracket from numbers || (k == 57 && s) // allow close bracket from numbers || (k == 48 && s) // allow SPACE || k == 32 // allow & || (k == 55 && s) // allow | || (k == 220 && s) // allow ! || (k == 49 && s) ) { return; } else { // disallow anything else ev.preventDefault(); return; } }); /** * Block ENTER. * * @param {Event} ev Keypress Event. */ $input.keypress(function(ev) { if (ev.which == 13) { ev.preventDefault(); } }); return $input; }, /** * Sets the given string inside the manual editor. * * @param {mixed} logicString[optional] Logical string. If none set it will use the global logicalString. Can also be already tokenized string. */ setManualString : function(logicString) { logicString = logicString || this.logicString; // automatically tokenize the logic string if a string indeed supplied var tokens = (typeof logicString === 'string' || typeof logicString === 'number') ? this.tokenize(logicString) : logicString; // join all tokens with a space for readability this.$manualInput.val(tokens.join(' ')); }, /** * Reads the logic string from the manual editor. * * @return {String} */ getManualString : function() { return this.$manualInput.val(); }, /* ########################## * SETTERS AND GETTERS * ########################## */ /** * Sets the logic. * * @param {String} logic * @param {Boolean} silent[optional] Should this not trigger an event? For internal use. Default: false. */ setLogic : function(logic, silent) { silent = silent || false; var oldLogic = this.logic; this.logic = ($.inArray(logic, [this.AND, this.OR]) > -1) ? logic : this.ADVANCED; // set the logic string var logicString = ''; if (this.logic == this.ADVANCED) { // if the logic is ADVANCED then it's enough to just copy the string logicString = logic; } else { // if "normal" logic then join all filter ID's with that logic operator var ids = []; $.each(this.gui.filters, function(i, filter) { ids.push(filter.id); }); logicString = ids.join(this.logic == this.OR ? '|' : '&'); } // finally set the logic string this.setLogicString(logicString); // delegate the rest somewhere else this.didSetLogic(oldLogic, silent); }, /** * Returns the current logic type (AND/OR/ADVANCED). * * @return {String} */ getLogic : function() { return this.logic; }, /** * Set logic string. * * @param {String} logicString Logic string to be set. */ setLogicString : function(logicString) { this.logicString = '' + logicString; // ensure string // load into views this.setGuiString(logicString); this.setManualString(logicString); }, /** * Appends filter ID to the logic string, optionally using the specified logic. * * @param {Number} filterId Filter ID. * @param {String} logic[optional] Logic name. If none given it will use OR if OR is marked */ appendFilterToLogicString : function(filterId, logic) { logic = logic || this.logic; logic = (logic == this.OR) ? '|' : '&'; // if there wasn't any previous string logic then only append add filter ID var logicString = (this.logicString.length) ? this.logicString + logic + filterId : filterId; this.trigger('manualLogicChange', [logicString]); this.trigger('graphicalLogicChange', [logicString]); this.trigger('advancedLogicChange', [logicString]); this.setLogicString(logicString); }, /** * Returns the current logic string. * * @return {String} */ getLogicString : function() { return (this.logic == this.ADVANCED) ? this.logicString : this.logic; }, /* ########################## * INTERNAL EVENT HANDLERS * ########################## */ /** * Called when logic was set either programattically or via clicking on logic option button. * * @param {String} old Logic name that was before. * @param {Boolean} silent[optional] Should this not trigger an event? For internal use. Default: false. */ didSetLogic : function(old, silent) { old = old || ''; silent = silent || false; // mark the appropriate logic option button this.$logicOptions.removeClass('active') .filter('[data-logic="' + this.logic + '"]').addClass('active'); if (this.logic == this.ADVANCED) { this.showEditor(); // display short text on the other logic options this.$logicOptions.not('.jcsdl-advanced').each(function() { var $el = $(this); $el.html($el.data('textShort')); }); // display advanced options this.$advancedOptions.fadeIn(this.config.animate); } else { this.clearErrors(); this.hideEditor(); // display long text on the other logic options this.$logicOptions.not('.jcsdl-advanced').each(function() { var $el = $(this); $el.html($el.data('textLong')); }); // hide advanced options this.$advancedOptions.hide(); } // if not silent and if actually changed then trigger logic event if (!silent && this.logic !== old) { this.trigger('logicChange', [this.logic]); } } }; });
/* Charon Index log documents by doc. Value: timestamp. */ function(doc) { if (doc.charon_doctype !== 'log') return; emit(doc.doc, doc.timestamp); }
import React from 'react'; import SvgIcon from '../../SvgIcon'; const AvArtTrack = (props) => ( <SvgIcon {...props}> <path d="M22 13h-8v-2h8v2zm0-6h-8v2h8V7zm-8 10h8v-2h-8v2zm-2-8v6c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V9c0-1.1.9-2 2-2h6c1.1 0 2 .9 2 2zm-1.5 6l-2.25-3-1.75 2.26-1.25-1.51L3.5 15h7z"/> </SvgIcon> ); AvArtTrack.displayName = 'AvArtTrack'; AvArtTrack.muiName = 'SvgIcon'; export default AvArtTrack;
/* Copyright 2011-2016 Adobe Systems Incorporated. All Rights Reserved. */ (function(c){"function"===typeof define&&define.amd&&define.amd.jQuery?define(["jquery"],c):c(jQuery)})(function(c){var b=c;if(typeof Muse=="undefined")window.Muse={};Muse.Assert={};Muse.Assert.fail=function(a){alert("JavaScript exception: "+a)};Muse.Assert.assert=function(a,b){if(!a)throw Error(b);};c.extend(c.browser,{SafariMobile:navigator.userAgent.toLowerCase().match(/iP(hone|ad|od)/i)});if(!Array.indexOf)Array.prototype.indexOf=function(a){for(var b=0;b<this.length;++b)if(this[b]==a)return b; return-1};Muse.Plugins={};Muse.Utils={};Muse.Utils.getCssVendorPrefix=function(){if(!Muse.Utils.isDefined(Muse.Utils.getCssVendorPrefix.flag))Muse.Utils.getCssVendorPrefix.flag=/webkit/i.test(navigator.appVersion)?"-webkit":/firefox/i.test(navigator.userAgent)?"-moz":/trident/i.test(navigator.userAgent)?"-ms":"opera"in window?"-o":"";return Muse.Utils.getCssVendorPrefix.flag};Muse.Utils.marginLeftForMovingElementsOutSideViewPort="-10000px";Muse.Utils.wrapElement=function(a,b){a.parentNode.replaceChild(b, a);b.appendChild(a)};Muse.Utils.firstChild=function(a,b){for(var c=0;c<a.childNodes.length;c++){var d=a.childNodes[c];if(d.nodeType==1&&(!b||b.matches(d)))return d}return null};Muse.Utils.firstDescendant=function(a,b,c){for(var d=0;d<a.childNodes.length;d++){var i=a.childNodes[d];if(i.nodeType==1){if(!b||b.matches(i))return i;if(!c||!c.matches(i))if(i=Muse.Utils.firstDescendant(i,b,c))return i}}return null};Muse.Utils.descendants=function(a,b,c,d){if(!d)d=[],d.forEach=function(a){for(var b=0;b<this.length;b++)if(a(this[b]))break}, d.forEachTry=function(a){for(var b=0;b<this.length;b++)try{if(a(this[b]))break}catch(f){}};for(var i=0;i<a.childNodes.length;i++){var l=a.childNodes[i];l.nodeType==1&&((!b||b.matches(l))&&d.push(l),(!c||!c.matches(l))&&Muse.Utils.descendants(l,b,c,d))}return d};Muse.Utils.children=function(a,b){return Muse.Utils.descendants(a,b,Muse.Utils.Match.always)};Muse.Utils.Match={};Muse.Utils.Match.ByClass=function(a){this.cl=a};Muse.Utils.Match.ByClass.prototype.matches=function(a){return c(a).hasClass(this.cl)}; Muse.Utils.Match.ByNodeName=function(a){this.nm=a.toLowerCase()};Muse.Utils.Match.ByNodeName.prototype.matches=function(a){return this.nm==a.nodeName.toLowerCase()};Muse.Utils.Match.ByFixed=function(a){this.matchResult=a};Muse.Utils.Match.ByFixed.prototype.matches=function(){return this.matchResult};Muse.Utils.Match.byClass=function(a){return new Muse.Utils.Match.ByClass(a)};Muse.Utils.Match.byNodeName=function(a){return new Muse.Utils.Match.ByNodeName(a)};Muse.Utils.Match.byFixed=function(a){return new Muse.Utils.Match.ByFixed(a)}; Muse.Utils.Match.always=Muse.Utils.Match.byFixed(!0);Muse.Utils.Match.never=Muse.Utils.Match.byFixed(!1);Muse.Utils.appendChildren=function(a,b){if(a.length&&b.length&&b.find(".fld-grp[data-type = 'recaptcha2']").length)for(var c=0;c<a.length;c++)for(var d=0;d<b.length;d++)a[c].appendChild(b[d]);else a.append(b)};Muse.Utils.moveChildren=function(a,b){for(;a.childNodes.length>0;)b.appendChild(a.childNodes[0])};Muse.Utils.copyChildren=function(a,b){for(var c=0;c<a.childNodes.length;c++)b.appendChild(a.childNodes[c].cloneNode(!0))}; Muse.Utils.copyChildrenBefore=function(a,b){for(var c=0;c<a.childNodes.length;c++)b.parentNode.insertBefore(a.childNodes[c].cloneNode(!0),b)};Muse.Utils.pixelRound=function(a){return Math.floor((a*100+0.5)/100)};Muse.Utils.getCurrentHTMLFileName=function(a){var b=document.location.href;b.charAt(b.length-1)=="/"?b="index":(b=b.substring(b.lastIndexOf("/")+1),b=b.indexOf("#")==0?"index":b.substring(0,b.lastIndexOf(".")));a&&(b+=".html");return b};Muse.Utils.getPageStyleSheets=function(){for(var a=[], b=0;b<document.styleSheets.length;++b){var c=document.styleSheets[b],d=c.ownerNode?c.ownerNode:c.owningElement;d&&(d.id=="pagesheet"||d.id=="nomq_pagesheet")&&a.push(c)}return a};Muse.Utils.getStyleSheetRulesById=function(a,b){if(b){var c="#"+b.toLowerCase();return Muse.Utils.allStyleSheetRules(a,function(a){return a.toLowerCase()==c})}return""};Muse.Utils.allStyleSheetRules=function(a,b){for(var c=[],d=0;d<a.length;d++){var i=Muse.Utils.allStyleSheetRulesFromOneSheet(a[d],b);i&&(c=c.concat(i))}return c.length? c:null};Muse.Utils.allStyleSheetRulesFromOneSheet=function(a,b){var d=!1,g;try{g=a.cssRules}catch(i){}if(!g){d=!0;try{g=a.rules}catch(l){}}if(!g)return null;for(var k=[],j=c(window),m=function(a){if(4!=a.type)return!1;if(1!=a.media.length){for(var b=0,c=0;c<a.media.length;c++){var f=null,f="function"==typeof a.media.item?a.media.item(c):a.media[c];"print"!=f&&b++}if(1<b)return!1}b=j.data("muse-mq");if(!b)return!1;for(c=0;c<a.media.length;c++)if(a.media[c]==b)return!0;if(a.media.mediaText&&0<=a.media.mediaText.indexOf(b.replace(/\s/g, "")))return!0;if(a.media.mediaText&&(a=a.media.mediaText.replace(/\sand\s/g,"__and__").replace(/\s/g,"").split("__and__"),c=b.replace(/\sand\s/g,"__and__").replace(/\s/g,"").split("__and__"),a&&a.sort&&c&&c.sort)){"all"==a[0]&&a.splice(0,1);a.sort();c.sort();if(a.length!=c.length)return!1;for(b=0;b<a.length;b++)if(a[b]!=c[b])return!1;return!0}return!1},n=0;n<g.length;++n){var p=g[n];if(m(p)){if(p=Muse.Utils.allStyleSheetRulesFromOneSheet(p,b),null!=p)for(var o=0;o<p.length;o++)k.push(p[o])}else if(Muse.Utils.isDefined(p.selectorText))if(d)b(p.selectorText)&& k.push(p);else for(var o=p.selectorText.split(/\s*,\s*/),q=0;q<o.length;q++)b(o[q])&&k.push(p)}return k.length?k:null};Muse.Utils.getRuleProperty=function(a,b){if(a&&a.length){for(var c=a.length-1;c>=0;c--){var d=Muse.Utils.getRuleProperty(a[c],b);if(d)return d}return""}if(a.style.getPropertyValue)return a.style.getPropertyValue(b);return a.style.getAttribute(b)};Muse.Utils.toCamelCase=function(a){for(var b=Muse.Utils.toCamelCase.exp;b.test(a);a=a.replace(b,RegExp.$1.toUpperCase()));return a};Muse.Utils.toCamelCase.exp= /-([a-z])/;Muse.Utils.getStyleValue=function(a,b){var c=a.style[Muse.Utils.toCamelCase(b)];c||(document.defaultView?c=document.defaultView.getComputedStyle(a,"").getPropertyValue(b):a.currentStyle&&(c=a.currentStyle[Muse.Utils.toCamelCase(b)]));c&&c.match(/(\d+)px/)&&(c=parseInt(c.substring(0,c.length-2)));return c};Muse.Utils.getCanvasDirection=function(a,b){var c=a.closest("*[data-rotate]"),c=c.length>0?parseFloat(c.data("rotate"))%360:0;return{dir:c>=0&&c<=45||c>=135&&c<=225||c>=315&&c<360?b:b=== "horizontal"?"vertical":"horizontal",reverse:b==="horizontal"?c>=135&&c<=315:c>=45&&c<=225}};Muse.Utils.updateSlideshow_fstpOffsetSize=function(a){var b=c(window),d=c(document.body),g=a.options,i=a.$clip?a.$clip:a._findWidgetElements("."+g.clipClassName);Muse.Utils.moveElementsOutsideViewport(i.parents());a._fstpOffsetSize=g.transitionStyle==="horizontal"?g.elastic==="fullWidth"?Math.max(b.width(),parseInt(d.css("min-width"))):i.width():i.height();Muse.Utils.moveElementsInsideViewport(i.parents())}; Muse.Utils.urlParam=function(a,b){var c=RegExp("[\\?&]"+b+"=([^&#]*)").exec(a);return c?c[1]:null};Muse.Utils.processHyperlink=function(a){var f=a.href,d=c(window),a=c(a),g=a.attr("target");if(!g||g=="_self"){var i=f.lastIndexOf("/"),g=f.lastIndexOf("#"),l=a.attr("class").match(/anim_(\w+)/);if(l&&g>i){var a=d.data("scrollWrapper"),k=f.substring(g),j=Muse.Utils.getAnchorWithDestination(k);if(j.length==0)return!1;var g=j.offset(),f=l[1],m=a||window,i=document.documentElement||document.body,l=(a?a.scrollHeight(): i.scrollHeight)-d.height(),i=(a?a.scrollWidth():i.scrollWidth)-d.width(),n=Math.min(l,g.top+(a&&!a.isStandard()?a.scrollTop():0)),p=Math.min(i,g.left+(a&&!a.isStandard()?a.scrollLeft():0)),o=c(j).parents(".AccordionPanelContentClip").length,q=function(){var a=c(j).closest(".AccordionPanelContent").prev();a&&a.length&&!a.hasClass("AccordionPanelTabOpen")&&(a.trigger("mousedown"),a.trigger("mouseup"))};if(o){var i=c(j).closest(".AccordionPanelContent"),l=d.scrollTop(),r=d.scrollTop()+d.height(),s=d.scrollLeft()+ d.width(),d=d.scrollLeft(),r=g.top>=l&&g.top+i.height()<=r,g=g.left>=d&&g.left+i.width()<=s;if(r&&g)return q(),!1;n=r?l:Math.min(n,c(j).parents(".AccordionWidget").offset().top);p=g?d:Math.min(p,c(j).parents(".AccordionWidget").offset().left)}d=function(){m.scrollTo(p,n);o&&q();try{history.replaceState({})}catch(a){if(!b.browser.msie||b.browser.version>7)window.location.hash=k}};try{history.pushState({},null,k)}catch(w){}if(window.scrollTo||void 0!==a){var a=a||c(document),y=a.scrollLeft(),u=a.scrollTop(), t=y,x=u;c({scrollDistance:0}).animate({scrollDistance:1},{duration:1E3,easing:f,step:function(a){a!=0&&(x=a*(n-u),t=a*(p-y),m.scrollTo(y+t,u+x))},complete:d})}else c("html,body").animate({scrollTop:n,scrollLeft:p},1E3,f,d);return!1}}(d=Muse.Utils.urlParam(f,"devicelock"))&&Muse.Utils.createCookie("devicelock",d,0);return!0};Muse.Utils.navigateToAnchor=function(a){var b=function(){var b=Muse.Utils.getAnchorWithDestination(a);if(b.length!==0){var f=b.offset(),d=c(window),l=d.data("scrollWrapper"),b= l||window,k=document.documentElement||document.body,j=(l?l.scrollHeight():k.scrollHeight)-d.height(),d=(l?l.scrollWidth():k.scrollWidth)-d.width(),j=Math.min(j,f.top+(l&&!l.isStandard()?l.scrollTop():0)),f=Math.min(d,f.left+(l&&!l.isStandard()?l.scrollLeft():0));b.scrollTo(f,j)}};if(c("body").hasClass("awaiting_bp_activate_scroll"))$window.one("scroll",function(){b()});else b()};var d=[];Muse.Utils.redirectCancelled=!1;Muse.Utils.redirectHyperlink=function(a){if(Muse.Utils.redirectCancelled)setTimeout(function(){Muse.Utils.redirectCancelled= !1},0);else if(d=[],Muse.Utils.processHyperlink(a)&&!Muse.Utils.isIBE()){var b=c(a).attr("target");b||(b="_self");window.open(a.href,b)}};Muse.Utils.redirectHyperlinkInNewTab=function(a,b){if(Muse.Utils.redirectCancelled)setTimeout(function(){Muse.Utils.redirectCancelled=!1},0);else{d=[];thisWindow=window.self;var c=window.open(a);b?c.focus():thisWindow.focus()}};Muse.Utils.isMouseLeftClick=function(a){return a.which==1};Muse.Utils.isMouseMiddleClick=function(a){return a.which==2};Muse.Utils.isRedirectLinkKeyboardAction= function(a){return a.which==13};Muse.Utils.addHyperlinkAnchor=function(a){a=c(a);a.bind("mousedown",function(a){(Muse.Utils.isMouseLeftClick(a)||Muse.Utils.isMouseMiddleClick(a))&&d.push(this)});a.bind("mouseup keyup",function(a){if(Muse.Utils.isMouseLeftClick(a)&&d.indexOf(this)!=-1)a.ctrlKey||a.metaKey?Muse.Utils.redirectHyperlinkInNewTab(this.href,a.shiftKey):Muse.Utils.redirectHyperlink(this);else if(Muse.Utils.isMouseMiddleClick(a)&&d.indexOf(this)!=-1)if(b.browser.webkit||!a.target.href&&b.browser.msie)Muse.Utils.redirectHyperlinkInNewTab(this.href, a.shiftKey);else return d=[],!0;else Muse.Utils.isRedirectLinkKeyboardAction(a)&&Muse.Utils.redirectHyperlink(this);return!1});Muse.Utils.isIBE()||a.bind("click",function(){return!1})};Muse.Utils.addHyperlinkBlock=function(a){var b=c(a.parentNode);b.bind("mousedown",function(a){(Muse.Utils.isMouseLeftClick(a)||Muse.Utils.isMouseMiddleClick(a))&&d.push(this);return!1});b.bind("mouseup keyup",function(b){Muse.Utils.isMouseLeftClick(b)&&d.indexOf(this)!=-1?b.ctrlKey||b.metaKey?Muse.Utils.redirectHyperlinkInNewTab(a.href, b.shiftKey):Muse.Utils.redirectHyperlink(a):Muse.Utils.isMouseMiddleClick(b)&&d.indexOf(this)!=-1?Muse.Utils.redirectHyperlinkInNewTab(a.href,b.shiftKey):Muse.Utils.isRedirectLinkKeyboardAction(b)&&Muse.Utils.redirectHyperlink(a);return!1});Muse.Utils.isIBE()||b.bind("click",function(){return!1})};Muse.Utils.prepHyperlinks=function(a){c("a.block").each(function(){var a=c(this.parentNode);Muse.Utils.addHyperlinkBlock(this);a.find("a.nonblock").each(function(){var a=c(this);if(a.data("registeredNonBlockLink")=== !0)return!1;Muse.Utils.addHyperlinkAnchor(this);a.data("registeredNonBlockLink",!0)})});c("a.nonblock").each(function(){var a=c(this);a.data("registeredNonBlockLink")!==!0&&(a.parent('[class~="sbg"]').length>0?Muse.Utils.addHyperlinkAnchor(this):(a.attr("class").match(/anim_(\w+)/)||this.href.indexOf("devicelock=")!=-1)&&c(this).bind("click",function(){return Muse.Utils.processHyperlink(this)}))});a&&Muse.Utils.enableAnchorLinksActiveState()};Muse.Utils.pathOnly=function(a){if(!a)return a;return a.replace(/#(?:[^#]+)$/, "").replace(/\?(?:[^\?]+)$/,"")};Muse.Utils.enableAnchorLinksActiveState=function(){var a=!1,b=[],d=c(window),g=Muse.Utils.getPageStyleSheets(),i=function(a){var b=a.parent('[class~="sbg"]');if(a.hasClass("MenuItem")||b.hasClass("MenuItem"))return"MuseMenuActive";if(a.hasClass("Button")||b.hasClass("Button"))return"ButtonSelected";return"MuseLinkActive"},l=!1,k=function(d){b.splice(0,b.length);c("a.nonblock,a.block",d).each(function(){Muse.Utils.saveHyperlinkInfo(c(this),i(c(this)),g,a,b)});b.sort(function(a, b){if(a.from<b.from)return-1;if(a.from>b.from)return 1;return 0});l=!0},j=!1,m=d.data("scrollWrapper"),n=m||d,p=null,o=function(){j=!1;if(!l){var d=c("#page");a=d.outerWidth()/d.outerHeight()>2;k(p)}var d=a?n.scrollLeft():n.scrollTop(),g;a:{var h=0;g=b.length;for(var o;h<g;h++)if(o=b[h],o.from<=d&&d<=o.to){g=h;break a}g=-1}var q,t,h=Math.max(0,g);for(g=Math.min(g+2,b.length);h<g;h++)if(q=b[h],o=q.$elem.offset().left+(m&&!m.isStandard()?m.scrollLeft():0),t=q.$elem.offset().top+(m&&!m.isStandard()? m.scrollTop():0),q.from!=(a?o:t)){k(p);break}h=0;for(g=b.length;h<g;h++){q=b[h];o=q.from<=d&&d<=q.to;q=q.hyperLinks;t=void 0;for(var x=0;x<q.length;x++)t=i(q[x]),o&&!q[x].hasClass(t)?q[x].addClass(t):!o&&q[x].hasClass(t)&&q[x].removeClass(t)}},q=function(){j||(j=!0,Muse.Utils.requestAnimationFrame(o))};(m=d.data("scrollWrapper"))?m.registerUpdateCallback(q):d.scroll(q);c("body").on("muse_bp_activate",function(a,b,c){l=!1;p=c;q()});0==c(".breakpoint").length&&o()};Muse.Utils.getAnchorWithDestination= function(a){if(!a||!a.replace)return c(a);if(a.match(/\//g))return c();return c(a.replace(/([\.\:])/gi,"\\$1"))};Muse.Utils.saveHyperlinkInfo=function(a,b,d,g,i){var l=a.attr("href"),k=Muse.Utils.pathOnly(l),j=-1,m=a.attr("target"),n=window.location.href.replace(/#.*$/i,"");if(l&&-1!=l.indexOf("#")&&!(m&&m!="_self")&&!(0<=k.indexOf("/"))&&(n.charAt(n.length-1)=="/"&&(n+="index.html"),-1!=n.indexOf("/"+k,n.length-k.length-1))){var k=c(window).data("scrollWrapper"),p=l.substring(l.lastIndexOf("#")), a=a.parent('[class~="sbg"]').length>0||a.hasClass("block")?a.parent():a,o="#"+a.attr("id"),b="."+b;if(null!==Muse.Utils.allStyleSheetRules(d,function(a){return 0<=a.indexOf(o+b)||0<=a.indexOf(b+o)})){m=0;for(n=i.length;m<n;m++)if(i[m].href==l){j=m;break}if(-1==j){d=Muse.Utils.getAnchorWithDestination(p);if(d.length===0)return;m=k&&!k.isStandard();g=Math.floor(g?d.offset().left+(m?k.scrollLeft():0):d.offset().top+(m?k.scrollTop():0));k=Number.MAX_VALUE;m=0;for(n=i.length;m<n;m++)if(i[m].href!=l&&i[m].from== g){j=m;break}if(-1==j){m=0;for(n=i.length;m<n;m++){j=i[m];if(j.from<g&&g<j.to){k=j.to;j.to=g-1;break}j.from<=k&&(k=j.from-1)}i.push({hyperLinks:[],from:g,to:k,$elem:d,href:l});j=i.length-1}}i[j].hyperLinks.push(a)}}};Muse.Utils.isIBE=function(){return Muse.Utils.readCookie("inbrowserediting")=="true"};Muse.Utils.includeMEditableTags=function(a){if(!a||a.length==0||!Muse.Utils.isIBE())return a;return a.map(function(){var a=c(this).parent("div[contenteditable][region-id][template][data-ice-editableid][data-ice-editable]"); return a&&a.length?a.get():this})};Muse.Utils.getNaturalWidth=function(a){var b=-1;a.naturalWidth!=null?b=a.naturalWidth:a.runtimeStyle?(a.runtimeStyle.width="auto",a.runtimeStyle.height="auto",a.runtimeStyle.borderWidth="0",a.runtimeStyle.padding="0",b=a.offsetWidth,a.runtimeStyle.width="",a.runtimeStyle.height="",a.runtimeStyle.borderWidth="",a.runtimeStyle.padding=""):(a=a.cloneNode(!0),a.className="",a.style.width="auto !important",a.style.height="auto !important",a.style.borderWidth="0 !important", a.style.padding="0 !important",b=a.width);return b};Muse.Utils.getNaturalHeight=function(a){var b=-1;a.naturalHeight!=null?b=a.naturalHeight:a.runtimeStyle?(a.runtimeStyle.width="auto",a.runtimeStyle.height="auto",a.runtimeStyle.borderWidth="0",a.runtimeStyle.padding="0",b=a.offsetHeight,a.runtimeStyle.width="",a.runtimeStyle.height="",a.runtimeStyle.borderWidth="",a.runtimeStyle.padding=""):(a=a.cloneNode(!0),a.className="",a.style.width="auto !important",a.style.height="auto !important",a.style.borderWidth= "0 !important",a.style.padding="0 !important",b=a.height);return b};Muse.Utils.pieLoading=!1;Muse.Utils.pieFunctionQueue=[];Muse.Utils.needPIE=function(a){if(Muse.Utils.havePIE)a();else if(Muse.Utils.pieFunctionQueue.push(a),!Muse.Utils.pieLoading)Muse.Utils.pieLoading=!0,a="scripts/pie.js",a[0]=="/"&&(a=location.pathname.indexOf(".html")!=-1?location.pathname.substring(0,location.pathname.lastIndexOf("/"))+a:location.pathname+a,a=a.replace(/\/+/g,"/")),c.ajax({url:a,dataType:"script",complete:function(){if(Muse.Utils.isDefined(window.PIE)){Muse.Utils.havePIE= !0;Muse.Utils.pieLoading=!1;for(var a=0;a<Muse.Utils.pieFunctionQueue.length;++a)Muse.Utils.pieFunctionQueue[a]()}}})};Muse.Utils.transformMarkupToFixBrowserProblemsPreInit=function(){Muse.Utils.fixSVGImages();Muse.Utils.maintainFluidSVGsAspectRatio();Muse.Utils.addProtocolToVimeoYoutubeIfNeeded();b.browser.msie?(b("html").addClass("ie"),b.browser.version<8&&Muse.Utils.changeLItoDIVs(),b.browser.version<9&&(Muse.Utils.monitorCheckboxes(),Muse.Utils.addRoundedCorners())):b.browser.SafariMobile&&b("body").css("-webkit-text-size-adjust", "none")};Muse.Utils.monitorCheckboxes=function(){var a=function(a){"checked"==a.attr("checked")?a.removeClass("not_checked").addClass("checked"):a.removeClass("checked").addClass("not_checked")};c(".fld-checkbox input[type=checkbox]").each(function(){a(c(this))}).click(function(){a(c(this))});c(".fld-radiobutton input[type=radio]").each(function(){a(c(this))}).click(function(){c(".fld-radiobutton input[type=radio]",c(this).closest("form")).each(function(){a(c(this))})})};Muse.Utils.transformMarkupToFixBrowserProblems= function(){Muse.Utils.havePIE=!1;b.browser.msie&&b.browser.version<=9&&(b.browser.version<=9&&(Muse.Utils.addGradientFill(),Muse.Utils.addShadows()),b.browser.version<9&&(Muse.Utils.applyIEFilterToPNGImages(),Muse.Utils.addRGBA(),Muse.Utils.removeEdgeAnimationBorderForIE78()));(b.browser.msie&&b.browser.version<9||b.browser.webkit)&&Muse.Utils.insertEmptyDivAfterPinnedColumnElements();Muse.Utils.fixTransformRotations();Muse.Utils.fixImageFramesWithRoundedCorners();typeof window.matchMedia==="undefined"&& typeof window.msMatchMedia==="undefined"&&c("html").addClass("nomediaqueries");var a=c(window).data("musePolyfill.bgSize");null!=a&&a.initialize(c(".museBGSize"));window.location.hash&&Muse.Utils.navigateToAnchor(window.location.hash)};Muse.Utils.fixSVGImages=function(){var a=document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1"),b=c("html");a||(b.addClass("nosvg"),c("body img").each(function(){var a=c(this),b=a.data("mu-svgfallback");b&&(a.data("src",b),a.attr("src", b))}))};Muse.Utils.maintainFluidSVGsAspectRatio=function(){var a=c(".svg_mar");if(0!=a.length){var b=function(){a.each(function(){var a=c(this),b=a.data("image-width"),f=a.data("image-height");0<b&&0<f&&a.css("height",a.width()*f/b)})},d=function(b){a=c(".svg_mar",b.length?b:null)};c(window).resize(b);c("body").on("muse_bp_activate",function(a,c,l){d(l);b()});d(c(".breakpoint.active"));b()}};Muse.Utils.addProtocolToVimeoYoutubeIfNeeded=function(){var a=/^\/\/(?:player\.vimeo\.com|www\.youtube\.com)/gi; window&&window.location&&window.location.protocol&&window.location.protocol.indexOf&&0<=window.location.protocol.indexOf("file")&&c("iframe").each(function(){var b=c(this),d=b.attr("src"),g=b.attr("data-src");d&&g&&"about:blank"==d&&g.match&&g.match(a)&&b.attr("data-src","https:"+g);!g&&d&&"about:blank"!=d&&d.match&&d.match(a)&&b.attr("src","https:"+d)})};Muse.Utils.applyIEFilterToPNGImages=function(){b.browser.msie&&b.browser.version<9&&c("body *").not(".museBgSizePolyfill img,.f3s_top,.f3s_mid,.f3s_bot").each(function(){var a= c(this);if(!a.data("mu-ie-matrix")&&(a.css("background-image").match(/\b.png/i)||this.nodeName&&this.nodeName.toLowerCase()=="img"&&a.attr("src").match(/\b.png/i))){var b=a.css("filter");a.css("filter",b?b+" progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF)":"progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF)")}})};Muse.Utils.insertEmptyDivAfterPinnedColumnElements=function(){c(".pinned-colelem").each(function(){c("<div class='colelem'/>").insertAfter(c(this))})}; Muse.Utils.addGradientFill=function(){c(".gradient").each(function(){var a=this;Muse.Utils.needPIE(function(){PIE.attach(a)})})};Muse.Utils.addShadows=function(){c(".shadow").each(function(){var a=this,b=c(a);Muse.Utils.needPIE(function(){b.data("mu-ie-matrix")||PIE.attach(a)})})};Muse.Utils.fixImageFramesWithRoundedCorners=function(){Muse.Browser.Features.checkCSSFeature("border-radius")&&Muse.Browser.Features.checkCSSFeature("-webkit-border-radius")&&c(".rounded-corners").each(function(){if(c(this).hasClass("clip_frame")){var a= Muse.Utils.firstDescendant(this,Muse.Utils.Match.byNodeName("img"));a&&c(a).wrap('<div class="clip_frame"></div>')}})};Muse.Utils.addRoundedCorners=function(){c(".rounded-corners").each(function(){var a=this;Muse.Utils.needPIE(function(){var b=c(a);if(!b.data("mu-ie-matrix")){var d=b.css("filter");if(!d||!(d.toLowerCase().indexOf("opacity")>0&&d.indexOf("=100")<0)){if(a.childNodes.length&&!Muse.Browser.Features.checkCSSFeature("border-radius")&&(d=Muse.Utils.firstChild(a,Muse.Utils.Match.byNodeName("img")))&& d.nodeName.toLowerCase()=="img"){var d=c(d),g=d.attr("src"),i=b.css("background-color")+" ",l=d.css("margin-left");if(l=="0px"||l=="auto")l=d.css("padding-left");var k=d.css("margin-top");if(k=="0px"||k=="auto")k=d.css("padding-top");if((l=="0px"||l=="auto")&&(k=="0px"||k=="auto"))b.addClass("museBGSize"),b.css("background-size","cover");d.css("visibility","hidden");b.css("background",i+"url("+g+") no-repeat "+l+" "+k)}PIE.attach(a)}}})})};Muse.Utils.addRGBA=function(){c(".rgba-background").each(function(){var a= this;Muse.Utils.needPIE(function(){PIE.attach(a)})})};Muse.Utils.resizeHeight=function(a){var b={},d=function(d){var h=d.parent().hasClass("sbg")?d.parent():d,d=c(d.children()[0]);h.attr("data-lightbox")!="true"&&"fixed"!=d.css("position")&&h.height(d.outerHeight());h=d.attr("id")||"always_watch";b[h]||(b[h]=!0,d.watch("height",function(){var b=c(this);"fixed"!=b.css("position")&&!b.hasClass("fullscreen")&&b.closest(a).children().length&&b.closest(a).height(c(b.closest(a).children()[0]).outerHeight())}))}; if(0<c(".breakpoint").length)c("body").on("muse_bp_activate",function(g,i,l){b={};c(a,l).each(function(){c(this).attr("data-lightbox")!="true"&&c(this).css("height","auto");d(c(this))})});else c(a).each(function(){d(c(this))})};Muse.Utils.moveElementsOutsideViewport=function(a){var b;a.each(function(){b=c(this);b.css("display")==="none"&&(b.attr("data-margin-left",b.css("margin-left")),b.css("margin-left",Muse.Utils.marginLeftForMovingElementsOutSideViewPort),b.css("display","block"),b.attr("data-display-attr-change", "true"))})};Muse.Utils.moveElementsInsideViewport=function(a){var b;a.each(function(){b=c(this);b.attr("data-display-attr-change")==="true"&&(b.css("display",""),b.css("display")!="none"&&b.css("display","none"),b.css("margin-left",""),b.css("margin-left")!=b.attr("data-margin-left")&&b.css("margin-left",b.attr("data-margin-left")),b.removeAttr("data-display-attr-change"),b.removeAttr("data-margin-left"))})};Muse.Utils.adjustTargetAndSlideHeights=function(a,b){var d=0,g=0,i=0;a.children().each(function(){c(this).is("img")|| c(this).css("height","")});a.css("height","");b!="loose"&&(a.children().each(function(){c(this).children().length!=0&&(d=Math.max(d,c(this).innerHeight()));g=Math.max(g,c(this).innerHeight())}),i=d==0?g:d,a.children().each(function(){if(!c(this).is("img"))if(c(this).hasClass("borderbox")){var a=c(this).outerHeight()-c(this).innerHeight();c(this).css("height",i+a+"px")}else a=c(this).innerHeight()-c(this).height(),c(this).css("height",i-a+"px")}));b==="lightbox"?a.css("height",i+"px"):a.css("height", a.outerHeight()+"px")};Muse.Utils.addWidgetIDToImages=function(a,b){a.find("img").each(function(){c(this);c(this).attr("data-widget-id")===void 0&&c(this).attr("data-widget-id",b)})};Muse.Utils.resizeImages=function(a,b){a.find("img").each(function(){var a=c(this);if(a.attr("data-heightwidthratio")!==void 0&&a.attr("data-widget-id")===b){var d=a.width()*a.attr("data-heightwidthratio");a.css("height","");a.css("height",d+"px")}})};Muse.Utils.isElementBrowserPinned=function(a){return a.css("position")=== "fixed"};Muse.Utils.applyPinningToLightboxParts=function(a,b){for(var d=0;d<b.children().length;d++){var g=c(b.children()[d]),i=g.parent(),l=g.attr("data-pintopage");if(l!=void 0){var k=!1;switch(l){case "page_fixedLeft":var j=g.offset().left-a.offset().left,m=a.offset().left-i.parent().offset().left,k=!0;break;case "page_fixedCenter":j=g.offset().left-(a.offset().left+a.width()/2);m=a.offset().left+a.width()/2-i.parent().offset().left;k=!0;break;case "page_fixedRight":j=g.offset().left-(a.offset().left+ a.width()),m=a.offset().left+a.width()-i.parent().offset().left,k=!0}k&&Muse.Utils.isLeftInPercentForLightbox(i.parent())&&(l=m*100/i.parent().width(),i.css("margin-left",l+"%"),i.css("left","0px"),g.css("left",j+"px"),g.css("margin-left","0px"))}}};Muse.Utils.isLeftInPercentForLightbox=function(a){var b=Muse.Utils.isPropertyInPercent(a,"margin-left")||Muse.Utils.isPropertyInPercent(a,"left");if(!b&&a.hasClass("clearfix"))for(var d=0;d<a.children().length;d++){var g=c(a.children()[d]);if(Muse.Utils.isLeftInPercentForLightbox(g))return!0}return b}; Muse.Utils.isPropertyInPercent=function(a,b){if(a.parent()===void 0)return!1;var c=a.parent().css("display"),d=a.parent().css("margin-left");a.parent().css("margin-left","-10000px");a.parent().css("display","none");var i=window.getComputedStyle(a[0]).getPropertyValue(b);a.parent().css("display","");a.parent().css("display")!==c&&a.parent().css("display",c);a.parent().css("margin-left","");a.parent().css("margin-left")!==d&&a.parent().css("margin-left",d);return i.indexOf("%")>-1};Muse.Utils.isStackedOrScatteredLayout= function(a){return a==="stack"||a==="loose"};Muse.Utils.removeEdgeAnimationBorderForIE78=function(){c(".animationContainer").each(function(){c(this).parent().html(function(a,b){return b.replace(/><\/iframe>$/gi,' frameBorder="0"></iframe>')})})};Muse.Utils.initializeAnimations=function(a){var b=function(b){if(!Muse.Utils.isIBE()&&!0===a){var f=b.contents();c("#report-abuse",f).remove();c("#report-abuse-spacer",f).remove()}b.removeClass("an_invi")};c(".animationContainer").each(function(){var a=c(this); Muse.Utils.isIBE()||this.contentDocument&&"complete"==this.contentDocument.readyState?b(a):a.load(function(){b(a)})})};Muse.Utils.fixTransformRotations=function(){Muse.Browser.Features.checkCSSFeature("transform")||c("*[data-mu-ie-matrix]").each(function(){var a=c(this),b=a.parent(),d=Math.round(a.data("mu-ie-matrix-dx")),g=Math.round(a.data("mu-ie-matrix-dy")),i=b.innerHeight(),l=b.innerWidth();a.css({filter:function(b,c){if(c)return c+" "+a.data("mu-ie-matrix");return a.data("mu-ie-matrix")},"margin-bottom":"-="+ g}).removeClass("shadow");b.css({"margin-bottom":"-="+(b.innerHeight()-i),"margin-right":"-="+(b.innerWidth()-l)});a.hasClass("actAsDiv")?(a.wrap('<span class="actAsDiv rotateWrapper"></span>'),a.parent().css("float",a.css("float"))):a.hasClass("actAsInlineDiv")?a.wrap('<span class="actAsInlineDiv rotateWrapper"></span>'):a.wrap('<div class="rotateWrapper"></div>');a.parent().css({top:g,left:d,position:"relative","margin-bottom":g})})};Muse.Utils.fullPage=function(a){var b=c(window).data("stickyFooter"); if(0==c(a).closest(".breakpoint").length)Muse.Assert.assert(0==c(".breakpoint").length,"Page is outside a breakpoint node."),b.init(c(a));else{var d=function(d){Muse.Assert.assert(1==d.length,"Cannot initialize sticky footer - invalid breakpoint node.");b.init(c(a,d))};d(c(".breakpoint.active"));c("body").on("muse_bp_activate",function(a,b,c){Muse.Utils.requestAnimationFrame(function(){d(c)})})}};Muse.Utils.widgetInsideLightbox=function(a){for(var b=0;b<a.length;b++)if(c(a[b]).attr("data-islightbox")== "true")return!0;return!1};Muse.Utils.endsWith=function(a,b){if(!a||!b)return!1;Muse.Assert.assert("string"==typeof a,'Invalid type for "str" argument - expected string.');Muse.Assert.assert("string"==typeof b,'Invalid type for "ending" argument - expected string.');return a.substring(a.length-b.length)==b};Muse.Utils.firstDefined=function(){for(var a=0;a<arguments.length;a++)if(Muse.Utils.isDefined(arguments[a]))return arguments[a]};Muse.Utils.isDefined=function(a){return"undefined"!=typeof a};Muse.Utils.getCSSIntValue= function(a,b){return Muse.Utils.tryParse(a.css(b),parseInt,0)};Muse.Utils.tryParse=function(a,b,c){if(!Muse.Utils.isDefined(a))return c;a=b(a);return!isNaN(a)?a:c};Muse.Utils.changeLItoDIVs=function(){var a=function(){var a=c(this),b=c("<div/>");b.addClass(a.attr("class"));b.attr("id",a.attr("id"));b.append(a.contents());a.replaceWith(b)};c("ul").each(function(){c(this).find("li").each(a)});c("ul").each(a)};Muse.Utils._initWidgetQueue=null;Muse.Utils._hasBPListener=!1;Muse.Utils.initWidget=function(a, b,d){if(0==c(".breakpoint").length)c(a).each(function(){d(c(this))});else{for(var g=0;g<b.length;g++){var i=b[g];if(!Muse.Utils._initWidgetQueue)Muse.Utils._initWidgetQueue={};Muse.Utils._initWidgetQueue[i]||(Muse.Utils._initWidgetQueue[i]=[]);Muse.Utils._initWidgetQueue[i].push({id:a,fn:d})}if(Muse.Utils._initWidgetQueue&&!Muse.Utils._hasBPListener){var l=function(a,b,f,d){a=f.attr("id");Muse.Assert.assert(a,"Invalid breakpoint node - missing the ID attribute");a="#"+a;if(Muse.Utils._initWidgetQueue[a]){for(;Muse.Utils._initWidgetQueue[a].length;)if(b= Muse.Utils._initWidgetQueue[a].shift(),b=b.fn(c(b.id,f)))b.$bp=f,b.breakpoint=d;Muse.Utils.showWidgetsWhenReady(f);delete Muse.Utils._initWidgetQueue[a];var f=!0,g;for(g in Muse.Utils._initWidgetQueue){f=!1;break}if(f)c("body").off("muse_bp_activate",l),Muse.Utils._hasBPListener=!1}};c("body").on("muse_bp_activate",l);Muse.Utils._hasBPListener=!0}}};Muse.Utils.showWidgetsWhenReady=function(a){b(".disn",a).removeClass("disn");b(".invi",a).removeClass("invi");b(".widget_invisible",a).removeClass("widget_invisible")}; Muse.Utils.detachIframesAndObjectsToPauseMedia=function(a){var f=[],d=[];c("iframe, object",a).each(function(){var a=c(this);if(!a.is("object")||!(b.browser.msie&&b.browser.version<9)){if(a.is("iframe")){var i=a.prop("src");if(""==i||!i||!i.indexOf)return;if(a.attr("title")==="recaptcha widget")return;if(0<=i.indexOf("vimeo.com")){Muse.Utils.VimeoVideoHelper.pause(a);d.push({$node:a,playFn:function(a){Muse.Utils.VimeoVideoHelper.seekTo(a,0);Muse.Utils.VimeoVideoHelper.isAutoPlay(a)&&Muse.Utils.VimeoVideoHelper.play(a)}}); return}}i={};i.$next=a.next();i.$parent=a.parent();b.browser.msie?(i.html=a.wrap('<div id="deleteMeWrapper"/>').parent().html(),a.remove(),i.$parent.children("div #deleteMeWrapper").remove()):(i.$node=a.clone(),a.remove());f.push(i)}});f.length&&a.data("detached",f);d.length&&a.data("paused",d);c("video",a).each(function(){if(b.browser.msie&&b.browser.version==9&&this.pause&&this.getAttribute("autoplay")&&this.readyState!=4)c(this).one("play",function(){this.pause()});else this.pause&&!this.paused&& this.pause()})};Muse.Utils.setPageToMaxWidth=function(){var a=c("#page");a!==void 0&&a.css("max-width")!=="none"&&(a.css("width",a.css("max-width")),c(window).trigger("pageWidthChanged"))};Muse.Utils.resetPageWidth=function(){var a=c("#page");a!==void 0&&(a.css("width",""),c(window).trigger("pageWidthChanged"))};Muse.Utils.getMinWidthOfElem=function(a){var b=parseFloat(a.css("min-width")?a.css("min-width"):0);b===0&&(b=parseFloat(a.attr("data-min-width")?a.attr("data-min-width"):0));return b};Muse.Utils.dropInOneBucketOfSizeAndPinPolicy= function(a,b,d,g){if(a!==void 0&&b!==void 0){var i={};if(b==="fixed")i=d.fixed;else if(b==="fluidWidth"||b==="fluidWidthHeight")i=d.responsive;if(!c.isEmptyObject(i))switch(a){case "page_fluidx":i.ChildFluidPin.push(g);break;case "page_fixedLeft":i.ChildFixedLeft.push(g);break;case "page_fixedRight":i.ChildFixedRight.push(g);break;case "page_fixedCenter":i.ChildFixedCenter.push(g)}}};Muse.Utils.removeSizeAndPiningAttributes=function(){};Muse.Utils.getMarginLeft=function(a){if(a&&!c.isEmptyObject(a))return a.attr("data-margin-left")&& a.attr("data-display-attr-change")===!0?a.attr("data-margin-left"):window.getComputedStyle(a[0])["margin-left"]};Muse.Utils.classifyChildrens=function(a,b,d){function g(a){var c=a.attr("data-pintopage"),d=a.attr("data-sizePolicy"),g=parseFloat(a.css("min-width")),h=parseFloat(a.attr("data-min-width")),n=!0;Muse.Utils.isTopLevelWidget(a)||a.is("form")||Muse.Utils.isMenuWidget(a)||Muse.Utils.isParameterizedHtmlWidget(a)?b.ChildWidgets.push(a):(g>0||h>0)&&!Muse.Utils.isParameterizedHtmlWidget(a)?b.ChildWithMinWidth.push(a): c!==void 0&&d!==void 0?(Muse.Utils.dropInOneBucketOfSizeAndPinPolicy(c,d,b,a),Muse.Utils.removeSizeAndPiningAttributes(a)):n=!1;return n}d?a&&b&&g(a):a.children().each(function(){var a=c(this);g(a)||Muse.Utils.classifyChildrens(a,b,d)})};Muse.Utils.isElementFixedSize=function(a){return a&&a.attr("data-sizePolicy")==="fixed"};Muse.Utils.isInPercentage=function(a){return a&&a.indexOf("%")===a.length-1};Muse.Utils.isInPixel=function(a){return a&&a.indexOf("px")===a.length-2};Muse.Utils.getPropInPixel= function(a,b){var c;a&&b&&a.css("display")!=="none"&&(c=b==="margin-left"?Muse.Utils.getMarginLeft(a):window.getComputedStyle(a[0]).getPropertyValue(b),Muse.Utils.isInPercentage(c)&&(b==="left"?(c=a.offsetParent().width()*parseFloat(c)/100,c=c.toString()+"px"):b==="margin-left"?(c=a.parent().width()*parseFloat(c)/100,c=c.toString()+"px"):c=a.css(b)));return c};Muse.Utils.getWidths=function(a){var b={};Muse.Utils.moveElementsOutsideViewport(a);Muse.Utils.moveElementsOutsideViewport(a.parents());b.offsetWidth= 0;b.elemWidth=0;b.offsetWidth=a[0].offsetWidth;b.elemWidth=parseFloat(Muse.Utils.getPropInPixel(a,"width"));Muse.Utils.moveElementsInsideViewport(a);Muse.Utils.moveElementsInsideViewport(a.parents());return b};Muse.Utils.getOffsetWidth=function(a){var b=a[0].offsetWidth;if(b===0)b=Muse.Utils.getWidths(a).offsetWidth;return b};Muse.Utils.getChildWidth=function(a,b,c){return b===!0?(b=parseFloat(a.css("min-width"))?parseFloat(a.css("min-width")):parseFloat(a.attr("data-min-width")),a.css("box-sizing")!== "border-box"&&(b+=Math.round(a.outerWidth()-a.innerWidth())),b):c?window.getComputedStyle(a[0]).width:Muse.Utils.getOffsetWidth(a)};Muse.Utils.setMinWidthInformation=function(a,b,d){if(!c.isEmptyObject(a)&&a.chosenMinWidth&&a.$element&&d>0&&a.chosenMinWidth<d)a.$element=b,a.chosenMinWidth=d;return a};Muse.Utils.isParameterizedHtmlWidget=function(a){return a.hasClass("size_fixed")||a.hasClass("size_fluid_width")||a.hasClass("size_fluid_width_height")};Muse.Utils.getLeft=function(a,b){function c(a, d){if(a&&d)return b?Muse.Utils.getPropInPixel(a,d):d==="margin-left"?Muse.Utils.getMarginLeft(a):window.getComputedStyle(a[0]).getPropertyValue(d)}var d={$element:a,left:c(a,"left")};if(a.css("position")==="absolute"){var i=a.parent();if(i&&i.hasClass("popup_anchor")&&i.css("position")==="relative")d.$element=i,d.left=c(i,"left"),consultMarginLeft=!0}i=c(d.$element,"margin-left");if(i!==Muse.Utils.marginLeftForMovingElementsOutSideViewPort)if(d.$element.css("position")==="static"||d.left==="auto")d.left= i;else if((d.left==="0px"||d.left==="0%")&&i!=="auto")d.left=i;if((d.$element.css("position")==="static"||d.left==="0px"||d.left==="0%"||d.left==="auto")&&i!==Muse.Utils.marginLeftForMovingElementsOutSideViewPort)d.left=i;return d};Muse.Utils.getLeftAdjustmentAmountDoneByParents=function(a,b){var d=a.attr("data-leftAdjustmentDoneBy"),g=0;d!==void 0&&(d=d.split(","),d=d.filter(function(a,b,c){return c.indexOf(a)==b}),c.each(d,function(a,d){var h=c("#"+d);if(h[0]!==void 0&&b.closest(h).length){var j= Muse.Utils.getMarginLeft(h);if(Muse.Utils.isInPixel(j))g+=parseFloat(j);else if(Muse.Utils.isInPercentage(j)||j==="auto")Muse.Utils.moveElementsOutsideViewport(h),Muse.Utils.moveElementsOutsideViewport(h.parents()),j=Muse.Utils.getPropInPixel(h,"margin-left"),Muse.Utils.isInPixel(j)&&j!==Muse.Utils.marginLeftForMovingElementsOutSideViewPort&&(g+=parseFloat(j)),Muse.Utils.moveElementsInsideViewport(h),Muse.Utils.moveElementsInsideViewport(h.parents())}return!0}));return g};Muse.Utils.computeMinWidthForResponsiveChilds= function(a,b,c){var d={$element:{},chosenMinWidth:-1};if(a&&a.length>0)switch(b){case "page_fixedLeft":a.forEach(function(a){var b=Muse.Utils.getChildWidth(a,c,!0),f=a[0].offsetWidth,j=0,m=window.getComputedStyle(a[0]).left,m=m?parseFloat(m):0,n=0,p=0;Muse.Utils.isInPercentage(b)?(j=parseFloat(b)/100,b=Muse.Utils.getWidths(a),p=b.elemWidth,f=b.offsetWidth):Muse.Utils.isInPixel(b)&&(j=a.offsetParent().width(),p=parseFloat(b),j=j>0?p/j:0);j>0&&(f>Math.round(p)&&(n=f-Math.round(p)),b=Math.abs(Muse.Utils.isValueWithinTolerance(j, 1,1.0E-4)?a.outerWidth():(m+n)/(1-j)),Muse.Utils.setMinWidthInformation(d,a,b))});break;case "page_fixedRight":a.forEach(function(a){var b=Muse.Utils.getChildWidth(a,c,!0),f=0,j=window.getComputedStyle(a[0]).left,j=Math.abs(j?parseFloat(j):0);Muse.Utils.isInPercentage(b)?f=parseFloat(b)/100:Muse.Utils.isInPixel(b)&&(f=a.offsetParent().width(),b=parseFloat(b),f=f>0?b/f:0);if(f>0&&f<1&&!Muse.Utils.isValueWithinTolerance(f,1,1.0E-4))var m=Math.abs(j/(1-f));Muse.Utils.setMinWidthInformation(d,a,m)}); break;case "page_fixedCenter":a.forEach(function(a){var b=window.getComputedStyle(a[0]).left,b=b?parseFloat(b):0,f=Math.abs(b),j=Muse.Utils.getMarginLeft(a),m=0,n=Muse.Utils.getChildWidth(a,c,!0),p=a[0].offsetWidth,o=0,q=0;if(b!==0)Muse.Utils.isInPercentage(j)?m=parseFloat(j)/100:Muse.Utils.isInPixel(j)&&(m=a.parent().width(),j=parseFloat(j),m=m>0?j/m:0),Muse.Utils.isInPercentage(n)?(n=Muse.Utils.getWidths(a),q=n.elemWidth,p=n.offsetWidth):Muse.Utils.isInPixel(n)&&(q=parseFloat(n)),m>0&&(b>0&&p>Math.round(q)&& (o=p-Math.round(q)),Muse.Utils.setMinWidthInformation(d,a,Math.abs((f+o)/m)))})}return d};Muse.Utils.computeMinWidthForFixedChilds=function(a,b,d,g){function i(a,b){var d=0,f=0,f=Muse.Utils.getLeft(a),h=f.$element,i=f.left,l=Muse.Utils.isInPixel(i),f=Muse.Utils.isInPercentage(i)||i==="auto";Muse.Utils.moveElementsOutsideViewport(a);Muse.Utils.moveElementsOutsideViewport(a.parents());if(f)f=Muse.Utils.getLeft(a,!0),h=f.$element,i=f.left,l=Muse.Utils.isInPixel(i);var r=h.is(g)||g.closest(h).length, f=parseFloat(g.width());l&&(d=parseFloat(i),r||(i=h.parents(),c.each(i,function(a,b){var f=c(b);if(f.is(g))return!1;f=Muse.Utils.getMarginLeft(f);Muse.Utils.isInPixel(f)&&f!==Muse.Utils.marginLeftForMovingElementsOutSideViewPort&&(d+=parseFloat(f));return!0})));b&&r&&(f=parseFloat(h.parent().width()));Muse.Utils.moveElementsInsideViewport(a);Muse.Utils.moveElementsInsideViewport(a.parents());return{containerWidth:f,left:d}}var l={$element:{},chosenMinWidth:-1};if(a&&a.length>0)switch(b){case "page_fluidx":a.forEach(function(a){var b= Muse.Utils.getChildWidth(a,d,!1),c=i(a,!0),f=c.left,c=c.containerWidth,g=0,o=-1;c<f+b&&(c=f+b);g=c>0?f/c:0;g<1&&!Muse.Utils.isValueWithinTolerance(g,1,1.0E-4)&&(o=Math.abs(b/(1-g)));Muse.Utils.setMinWidthInformation(l,a,o>b?o:b)});break;case "page_fixedLeft":a.forEach(function(a){var b=Muse.Utils.getChildWidth(a,d,!1),c=i(a).left,c=Math.abs(c+b);Muse.Utils.setMinWidthInformation(l,a,c>b?c:b)});break;case "page_fixedRight":a.forEach(function(a){var b=Muse.Utils.getChildWidth(a,d,!1),c=window.getComputedStyle(a[0]).left, c=Math.abs(c?parseFloat(c):0),f=-1,i=Muse.Utils.getLeftAdjustmentAmountDoneByParents(a,g);i>=0&&(c-=i);c>0&&(f=Muse.Utils.isElementFixedSize(a)?c:c+b);Muse.Utils.setMinWidthInformation(l,a,f>b?f:b)});break;case "page_fixedCenter":a.forEach(function(a){var b=Muse.Utils.getChildWidth(a,d,!1),c=parseFloat(window.getComputedStyle(a[0]).left),f=0,i=0,f=Muse.Utils.getMarginLeft(a),o=0,q=-1;Muse.Utils.isInPercentage(f)?o=parseFloat(f)/100:Muse.Utils.isInPixel(f)&&(o=a.parent().width(),f=parseFloat(f),o= o>0?f/o:0);o>0&&(q=Muse.Utils.getLeftAdjustmentAmountDoneByParents(a,g),q=q<0?0:q,f=(Math.abs(c)-q)/o,c<0?c+=q:c>0&&(c-=q),Muse.Utils.isValueWithinTolerance(o,1,1.0E-4)||(i=(b+c)/(1-o)),q=Math.max(f,i,b),Muse.Utils.setMinWidthInformation(l,a,q>b?q:b))})}return l};Muse.Utils.computeMinWidthForChildsWithMinWidth=function(a,b){var c={$element:{},chosenMinWidth:-1};a.forEach(function(a){var d=a.attr("data-pintopage")||"page_fluidx",l=-1;Muse.Utils.removeSizeAndPiningAttributes(a);d!==void 0&&(l=Muse.Utils.computeMinWidthForFixedChilds([a], d,!0,b),Muse.Utils.setMinWidthInformation(c,a,l.chosenMinWidth))});return c};Muse.Utils.isTopLevelWidget=function(a){return a&&(a.hasClass("SlideShowWidget")||a.hasClass("PamphletWidget")||a.hasClass("TabbedPanelsWidget")||a.hasClass("AccordionWidget")||a.hasClass("Button"))};Muse.Utils.isMenuWidget=function(a){return a.is("nav")&&(a.hasClass("MenuBar")||a.hasClass("MenuBarVertical"))};Muse.Utils.computeMinWidthForForms=function(a){function b(a){a.children().each(function(){var a=c(this);if(a.attr("data-sizePolicy")=== "fixed"){d.push(a);var g=a.innerWidth();a.attr("data-min-width",g)}else b(a)})}var d=[],g={$element:{},chosenMinWidth:-1};b(a);d.forEach(function(b){var d=b.parents(),f=b;c.each(d,function(b,d){var h=c(d),k=f.attr("data-pintopage")||"page_fluidx",i={};Muse.Utils.removeSizeAndPiningAttributes(f);if(f.is(a))return!1;i=Muse.Utils.computeMinWidthForFixedChilds([f],k,!0,h);Muse.Utils.setMinWidthInformation(g,i.$element,i.chosenMinWidth);f.attr("data-min-width")&&f.removeAttr("data-min-width");if(k=parseFloat(h.attr("data-min-width")))i.chosenMinWidth= Math.max(i.chosenMinWidth,k);h.attr("data-min-width",i.chosenMinWidth);f=h;if(h.is(a))return!1})});var i=parseFloat(a.attr("data-min-width"));i>0&&(a.css("min-width",i),a.removeAttr("data-min-width"))};Muse.Utils.computeMinWidthForWidgetChilds=function(a,b){var d=[],g={$element:{},chosenMinWidth:-1};a.forEach(function(a){var b=Muse.Utils.getMinWidthOfElem(a);if(!a.hasClass("SlideShowWidget")&&!a.hasClass("PamphletWidget")&&Muse.Utils.isElementFixedSize(a))b=(b=window.getComputedStyle(a[0]).width)? parseFloat(b):0,a.attr("data-min-width",b);else if(a.is("form"))Muse.Utils.computeMinWidthForForms(a);else{var c;a.hasClass("SlideShowWidget")||a.hasClass("PamphletWidget")?c=WebPro.Widget.ContentSlideShow.prototype.defaultPlugins[0]:a.hasClass("TabbedPanelsWidget")?c=WebPro.Widget.TabbedPanels.prototype.defaultPlugins[0]:a.hasClass("AccordionWidget")&&(c=WebPro.Widget.Accordion.prototype.defaultPlugins[0]);c&&c._setMinWidth&&(c._setMinWidth(a,!0),b=Muse.Utils.getMinWidthOfElem(a))}(b>0||a.is("form"))&& d.push(a)});d.forEach(function(a){var d=a.attr("data-pintopage")||"page_fluidx",h={},h=Muse.Utils.computeMinWidthForFixedChilds([a],d,!0,b);Muse.Utils.setMinWidthInformation(g,h.$element,h.chosenMinWidth);h.$element&&!c.isEmptyObject(h.$element)&&h.$element.attr("data-min-width")&&(h.$element.removeAttr("data-min-width"),Muse.Utils.removeSizeAndPiningAttributes(h.$element))});return g};Muse.Utils.adjustMinWidthRespectToAllParents=function(a,b){var d=[];b.forEach(function(b){if(b&&!c.isEmptyObject(b)&& b.$element&&!c.isEmptyObject(b.$element)&&b.chosenMinWidth>0){if(!a.is(b.$element)){var f=b.$element.parents();Muse.Utils.moveElementsOutsideViewport(b.$element);Muse.Utils.moveElementsOutsideViewport(f);c.each(f,function(d,f){var h=c(f);if(h.is(a))return!1;h=Math.round(h.outerWidth()-h.innerWidth());h>0&&(b.chosenMinWidth+=h);return!0});Muse.Utils.moveElementsInsideViewport(b.$element);Muse.Utils.moveElementsInsideViewport(f)}d.push(b.chosenMinWidth)}});return d};Muse.Utils.changeElementsDisplay= function(a){var b;a.each(function(){b=c(this);b.css("display")==="none"&&(b.css("display","block"),b.attr("data-display-attr-change","true"))})};Muse.Utils.resetElementsDisplay=function(a){var b;a.each(function(){b=c(this);b.attr("data-display-attr-change")==="true"&&(b.css("display",""),b.css("display")!=="none"&&b.css("display","none"),b.removeAttr("data-display-attr-change"))})};Muse.Utils.isValueWithinTolerance=function(a,b,c){return a===b?!0:!isNaN(a)&&!isNaN(b)&&Math.abs(a-b)<=c?!0:!1};Muse.Utils.getMinWidthOfParts= function(a,b,d){function g(a){var b=a.outerWidth()-a.innerWidth(),c=a.innerWidth();b>0&&(c+=parseFloat(a.css("border-left-width")));return c}function i(c){var g=c[0].getBoundingClientRect(),c={left:g.left,right:g.right};if(d&&b.attr("data-contentlayout")==="stack"&&b.attr("data-transitionStyle")==="horizontal"){var n=parseFloat(a.css("left"));if(n>0){var j=g.left-n,g=g.right-n;if(j>0)c.left=j;if(g>0)c.right=g}}return c}var l=-1;if(a&&b&&!c.isEmptyObject(a)&&!c.isEmptyObject(b)&&b[0]&&a[0]){Muse.Utils.changeElementsDisplay(a); Muse.Utils.changeElementsDisplay(a.parents());var k=a.attr("data-sizePolicy"),j=a.attr("data-pintopage"),m=parseFloat(a.css("min-width"));parseFloat(a.attr("data-min-width"));var n=!1,p=b.width(),o=b[0].getBoundingClientRect(),q=g(a),r=i(a),s=a.outerWidth()-a.innerWidth();m>0&&(k="fixed",q=m+s,n=!0,j===void 0&&(j="page_fluidx"));if(k==="fixed")switch(j){case "page_fluidx":k=-1;o.left<=r.left?(o=r.left-o.left,o>=0&&(k=o/p)):r.left-o.left<2&&(k=0);k>=0&&(Muse.Utils.isValueWithinTolerance(k,1,1.0E-4)? l=0:k<1&&(l=q/(1-k)));break;case "page_fixedLeft":n||(p=-1,o.left<=r.left?p=r.left-o.left:r.left-o.left<2&&(p=0),p>=0&&(l=q+p));break;case "page_fixedRight":n||(p=-1,o.right>=r.right?p=o.right-r.right:o.right-r.right<2&&(p=0),p>=0&&(l=q+p));break;case "page_fixedCenter":n||(p<=q?l=q:r.left<=o.left||r.right>=o.right?(p=o.left-r.left,k=r.right-o.right,p>=0&&k<=0?l=q+(o.right-r.right):k>=0&&p<=0&&(l=q+(r.left-o.left))):(r=r.left+q/2,o=o.left+p/2,p=-1,p=r===o?0:r<o?o-r:r-o,p>=0&&(l=2*(q/2+p))))}Muse.Utils.resetElementsDisplay(a); Muse.Utils.resetElementsDisplay(a.parents())}return l};Muse.Utils.getMinWidthForElement=function(a,b){var c=a&&a.length>0&&a[0].style.minWidth!==""?parseFloat(a[0].style.minWidth):0,b=b||!1;if(a&&a.length>0&&a[0].style.minWidth===""||b){if(Muse.Utils.isElementFixedSize(a)&&!b)return c;var d={responsive:{},fixed:{}};d.responsive.ChildFluidPin=[];d.responsive.ChildFixedLeft=[];d.responsive.ChildFixedRight=[];d.responsive.ChildFixedCenter=[];d.fixed.ChildFluidPin=[];d.fixed.ChildFixedLeft=[];d.fixed.ChildFixedRight= [];d.fixed.ChildFixedCenter=[];d.ChildWithMinWidth=[];d.ChildWidgets=[];var i=[];Muse.Utils.classifyChildrens(a,d,b);i.push(Muse.Utils.computeMinWidthForFixedChilds(d.fixed.ChildFluidPin,"page_fluidx",!1,a));i.push(Muse.Utils.computeMinWidthForFixedChilds(d.fixed.ChildFixedLeft,"page_fixedLeft",!1,a));i.push(Muse.Utils.computeMinWidthForFixedChilds(d.fixed.ChildFixedRight,"page_fixedRight",!1,a));i.push(Muse.Utils.computeMinWidthForFixedChilds(d.fixed.ChildFixedCenter,"page_fixedCenter",!1,a));i.push(Muse.Utils.computeMinWidthForChildsWithMinWidth(d.ChildWithMinWidth, a));i.push(Muse.Utils.computeMinWidthForWidgetChilds(d.ChildWidgets,a));(d=Muse.Utils.adjustMinWidthRespectToAllParents(a,i))&&d.length>0&&(c=Math.max.apply(null,d))}return c};Muse.Utils.buttonsMinWidthHelper=function(){Muse.Utils.setPageToMaxWidth();c(".Button").each(function(){var a=c(this),b=0;!Muse.Utils.isElementFixedSize(a)&&b===0&&(b=Muse.Utils.getMinWidthForElement(a,!1),b>0&&a.css("min-width",b));a.attr("data-visibility")==="changed"?(a.css("visibility",""),a.removeAttr("data-visibility")): a.children()&&a.children().attr("data-visibility")==="changed"&&(a.children().css("visibility",""),a.children().removeAttr("data-visibility"))});Muse.Utils.resetPageWidth()};Muse.Utils.makeButtonsVisibleAfterSettingMinWidth=function(){if(0==c(".breakpoint").length)Muse.Utils.buttonsMinWidthHelper();else c("body").on("muse_bp_activate",function(){Muse.Utils.buttonsMinWidthHelper()})};Muse.Utils.attachIframesAndObjectsToResumeMedia=function(a){var b=a.data("detached");if(b){for(var d=b.length-1;d>= 0;d--){var g=b[d];!g.$next||g.$next.length==0?g.$parent.append(g.$node?g.$node:g.html):g.$next.before(g.$node?g.$node:g.html);g.$next=g.$parent=g.$node=g.html=void 0}a.data("detached",null)}if(b=a.data("paused"))for(d=0;d<b.length;d++)g=b[d],g.playFn(g.$node);c("iframe",a).each(function(){var a=c(this),b=a.attr("src"),d=a.data("src");"about:blank"==b&&d&&a.attr("src",d)});c("video",a).each(function(){if(this.play&&this.getAttribute("autoplay")&&this.paused)this.currentTime=0,this.play()})};Muse.Utils.VimeoVideoHelper= function(a){var b=[],c=function(a,b){if(!0==a.data("isReady"))b();else{var c=a.data("readyQueue");c||(c=[]);c.push(b);a.data("readyQueue",c)}},d=function(a,c,d,g){var h=a[0].contentWindow;g&&b.push({source:h,method:c,callbackFn:g});c='"method": "'+c+'"';"undefined"!=typeof d&&null!==d&&(c+='"value":"'+d+'"');h.postMessage("{"+c+"}",a.data("origin"))},i=function(b){data=null;try{JSON&&JSON.parse&&(data=JSON.parse(b.data))}catch(c){}var d=null;data&&data.player_id&&(d=a("#"+data.player_id));(!d||!d.length)&& a("iframe").each(function(){if(this.contentWindow==b.source)return d=a(this),!1});return d},l=function(a){var c=null;try{JSON&&JSON.parse&&(c=JSON.parse(a.data))}catch(d){}if(c){if("ready"==c.event){var g=i(a);g.data("isReady",!0);g.data("origin",a.origin);var h=g.data("readyQueue");if(h&&h.length)for(var l=0;l<h.length;l++)h[l]();g.data("readyQueue",null)}for(l=0;l<b.length;)g=b[l],g.source==a.source&&g.method==c.method?(g.callbackFn(c.value),b.splice(l,1)):l++}};window.addEventListener?window.addEventListener("message", l,!1):window.attachEvent("onmessage",l,!1);l=function(){};l.prototype.play=function(a){c(a,function(){d(a,"play")})};l.prototype.pause=function(a){c(a,function(){d(a,"pause")})};l.prototype.isPaused=function(a,b){c(a,function(){d(a,"paused",null,b)})};l.prototype.seekTo=function(a,b){c(a,function(){d(a,"seekTo",b)})};l.prototype.isAutoPlay=function(a){a=a.attr("src").split("?");a.shift();for(var a=a.join("?").split("&"),b=0;b<a.length;b++)if(a[b].match(/autoplay\s*=\s*1/gi))return!0;return!1};return new l}(b); (function(a){a(window);var b=a("html"),c=["src"],d=["hidpi-src","src"],i=a(".hidpi_button"),l=function(){this._mode="standard"};l.swapSources=function(a,b,c){var d=a.attr("data-"+b);d&&!("src"==b&&a.hasClass("ImageInclude")&&a.attr("src").indexOf("images/blank.gif")==a.attr("src").length-16&&a.parents(".SlideShowWidget").length)&&("src"==c&&!a.attr("data-"+c)&&a.attr("data-"+c,a.attr("src")),a.attr("src",d))};l.isRetina=function(){if(1.5<=window.devicePixelRatio)return!0;if(window.matchMedia&&window.matchMedia("(-webkit-min-device-pixel-ratio: 1.5),(min--moz-device-pixel-ratio: 1.5),(-o-min-device-pixel-ratio: 3/2),(min-resolution: 1.5dppx)").matches)return!0; return!1}();l.shouldUseCookie=0<i.length;l.getResolutionPreference=function(){return Muse.Utils.readCookie("museresolution")};l.saveResolutionPreference=function(a){Muse.Utils.createCookie("museresolution",a)};l.prototype.initializeHiDPIButton=function(b){if(l.isRetina){var c=this;i.filter(function(){return!a(this).data("initialized")}).each(function(){a(this).data("initialized",!0)}).removeClass("unavailable").click(function(){switch(c._mode){case "standard":c.hidpiMode(b);break;case "hidpi":c.standardMode(b); break;default:Muse.Assert.assert(!1,"Unknown mode: "+c._mode)}})}};l.prototype.activate=function(a){this.initializeHiDPIButton(a);l.isRetina&&(!l.shouldUseCookie||"hidpi"==l.getResolutionPreference())?this.hidpiMode(a):this.standardMode(a)};l.prototype.getCurrentMode=function(){return this._mode};l.prototype.setCurrentMode=function(a){this._mode=a;if(l.isRetina){switch(a){case "standard":i.removeClass("on").addClass("off");break;case "hidpi":i.removeClass("off").addClass("on");break;default:Muse.Assert.assert(!1, "Unknown mode: "+a)}l.shouldUseCookie&&l.saveResolutionPreference(a)}};l.prototype.standardMode=function(c){this.setCurrentMode("standard");b.removeClass("hidpi");a("img",c).each(function(){l.swapSources(a(this),"src","hidpi-src")})};l.prototype.hidpiMode=function(c){this.setCurrentMode("hidpi");b.addClass("hidpi");a("img",c).each(function(){l.swapSources(a(this),"hidpi-src","src")})};l.prototype.getDataSrcAttrName=function(){return"standard"==this._mode?c:d};a(window).data("ResolutionManager",new l)})(b); Muse.Utils.detectScreenResolution=function(){var a=c(window).data("ResolutionManager");if(0<c(".breakpoint").length){var b={};c("body").on("muse_bp_activate",function(c,d,i){c=i.attr("id");b[c]||(a.activate(i),b[c]=!0)})}else a.activate()};Muse.Utils.createCookie=function(a,b,c){if(c){var d=new Date;d.setTime(d.getTime()+c*864E5);c="; expires="+d.toGMTString()}else c="";document.cookie=a+"="+b+c+"; path=/"};Muse.Utils.readCookie=function(a){a+="=";for(var b=document.cookie.split(";"),c=0;c<b.length;c++){for(var d= b[c];d.charAt(0)==" ";)d=d.substring(1,d.length);if(d.indexOf(a)==0)return d.substring(a.length,d.length)}return null};Muse.Utils.eraseCookie=function(a){createCookie(a,"",-1)};Muse.Browser={};Muse.Browser.domPrefixes=["Webkit","Moz","O","ms","Khtml"];Muse.Browser.Features={};Muse.Browser.Features.Touch=function(){if(navigator.maxTouchPoints>0||window.matchMedia&&window.matchMedia("(-moz-touch-enabled)").matches)return{Start:"pointerDown",End:"pointerUp",Move:"pointerMove",Listener:function(a){return function(b){var c= b.originalEvent||b;if(c.pointerType!=c.POINTER_TYPE_MOUSE)return a.apply(this,arguments)}}};else for(var a=0,b=Muse.Browser.domPrefixes.length;a<b;a++){var c=Muse.Browser.domPrefixes[a];if(c+"MaxTouchPoints"in navigator&&navigator[c+"MaxTouchPoints"])return c=c.toUpperCase(),{Start:c+"PointerDown",End:c+"PointerUp",Move:c+"PointerMove",Listener:function(a){return function(b){var d=b.originalEvent||b;if(d.pointerType!=d[c+"POINTER_TYPE_MOUSE"])return a.apply(this,arguments)}}}}try{return document.createEvent("TouchEvent"), {Start:"touchstart",End:"touchend",Move:"touchmove",Listener:function(a){return a}}}catch(d){}return!1}();Muse.Browser.Features.checkCSSFeature=function(a,b){var c=Muse.Utils.toCamelCase(a),b=b||document.createElement("div");if(c in b.style)return!0;for(var c=c.charAt(0).toUpperCase()+c.substr(1),d=0,i=Muse.Browser.domPrefixes.length;d<i;d++)if(Muse.Browser.domPrefixes[d]+c in b.style)return Muse.Browser.domPrefixes[d];return!1};Muse.Browser.Features.checkCSSValueCompatibility=function(a,b){var c= document.createElement("div"),a=Muse.Utils.toCamelCase(a),d=Muse.Browser.Features.checkCSSFeature(a,c);if(d)d!==!0&&(a=d+a.charAt(0).toUpperCase()+a.substr(1));else return!1;d=c.style[a];c.style[a]=b;if(c.style[a]!==d||b===d)return!0;for(var i=0;i<Muse.Browser.domPrefixes.length;i++){var l="-"+Muse.Browser.domPrefixes[i].toLowerCase()+"-"+b;c.style[a]=l;if(c.style[a]!==d)return Muse.Browser.domPrefixes[i]}return!1};Muse.Browser.Bugs={};Muse.Browser.Bugs.ClearNeedsOuterWidth=function(){var a=document.createElement("div"); a.id="mbbcnow00";a.innerHTML='<div>a</div><style type="text/css">#mbbcnow00{position:absolute;top:-9999px;left:-9999px;visibility:hidden;} #mbbcnow01{width:1px;margin-right:-9999px;float:left} #mbbcnow02{clear:left;}</style>';var b=document.createElement("div"),c=document.createElement("div");document.body.appendChild(a);a.appendChild(b);a.appendChild(c);b.innerHTML="a";b.id="mbbcnow01";c.innerHTML="b";c.id="mbbcnow02";b=c.getBoundingClientRect().top-b.getBoundingClientRect().top;document.body.removeChild(a); return b<1}();Muse.Browser.Bugs.CannotHandleClearBoth=b.browser.msie&&7==b.browser.version;Muse.Browser.Bugs.ScrollWidthHeightIncludesBorder=function(){var a=!1,b=c("<div>").css({border:"1px solid #000000;",width:100,height:100,position:"absolute",top:-99999,left:-99999,padding:0,margin:0,overflow:"auto"}).appendTo(document.body)[0];b.scrollHeight!==b.clientHeight&&(a=!0);c(b).remove();return a}();(function(a){var b=a(window),c=a("body"),d=function(){this.$verticalSpacer=null;this.enabled=!1;this.contentBelowSpacer= this.contentAboveSpacer=this.minHeight=0};d.prototype.init=function(d){this.$verticalSpacer=a(".verticalspacer",d);if(0!=this.$verticalSpacer.length){this.enabled=!0;var g=Muse.Utils.getCSSIntValue(this.$verticalSpacer,"min-height");this.$verticalSpacer.css("min-height","");this.minHeight=Muse.Utils.getCSSIntValue(this.$verticalSpacer,"min-height");this.$verticalSpacer.css("min-height",g);this.pageMinHeight=Muse.Utils.getCSSIntValue(d,"padding-top")+Muse.Utils.getCSSIntValue(d,"min-height")+Muse.Utils.getCSSIntValue(d, "padding-bottom");this.contentAboveSpacer=parseInt(this.$verticalSpacer.data("content-above-spacer"));this.contentBelowSpacer=parseInt(this.$verticalSpacer.data("content-below-spacer"));var j=this,k=!0,i=[],l=!0;b.resize(function(){if(k){var a=b.width();l?(i.splice(0,i.length),i.push(a),l=!1,setTimeout(function(){l=!0},200)):i[i.length-1]!=a&&(i.push(a),3<i.length&&i[i.length-3]==i[i.length-1]&&(c.addClass("always_vert_scroll"),k=!1))}j.doUpdate()});this.doUpdate()}};d.prototype.doUpdate=function(){if(this.enabled&& 0!=this.$verticalSpacer.length){var d=Math.round(this.contentAboveSpacer-this.$verticalSpacer.offset().top),g=this.$verticalSpacer.offset().top+this.contentBelowSpacer<this.pageMinHeight;this.$verticalSpacer.css({height:"calc("+(a.browser.SafariMobile?b.height()+"px":"100vh")+" - "+(this.contentAboveSpacer+this.contentBelowSpacer)+"px "+(0<d?" + ":" - ")+Math.abs(d)+"px)","min-height":g?d+this.minHeight+"px":""});d=(g?d+this.minHeight:Muse.Utils.getCSSIntValue(this.$verticalSpacer,"min-height"))< this.$verticalSpacer.height();g=!1;d&&!c.hasClass("no_vert_scroll")?(c.addClass("no_vert_scroll"),g=!0,a(window).trigger("resize")):!d&&c.hasClass("no_vert_scroll")&&(c.removeClass("no_vert_scroll"),g=!0);g&&this.$verticalSpacer.css("height")}};var i=function(){this.pendingRequest=void 0;this.enabled=!0};i.prototype.init=function(d){this.$spacer=a(".verticalspacer",d);this.$page=d;this.spacerMinHeight=Muse.Utils.getCSSIntValue(this.$spacer,"min-height");this.originalOffsetTop=Muse.Utils.tryParse(this.$spacer.attr("data-offset-top"), parseInt,0);c.removeClass("no_vert_scroll");this.$spacer.removeAttr("style");this.$spacer.height()<this.spacerMinHeight&&this.$spacer.height(Math.floor(this.spacerMinHeight+1));this.spacerHeight=this.$spacer.height();this.pageMarginTop=Muse.Utils.getCSSIntValue(c,"padding-top")+Muse.Utils.getCSSIntValue(c,"margin-top");this.pageMarginBottom=Muse.Utils.getCSSIntValue(c,"padding-bottom")+Muse.Utils.getCSSIntValue(c,"margin-bottom");this.pageResizeWatchEnabled=!0;this.alwaysVertScroll=c.hasClass("always_vert_scroll"); var g=this;this.calculateInitialSpacerHeight();this.$page.watch("height",function(){g.onPageHeightChanged()});b.resize(function(){g.doUpdate()});this.initialized=!0;this.doUpdate(this.pendingRequest)};i.prototype.updateScrollClass=function(a){if(!this.alwaysVertScroll){var a=this.spacerMinHeight<Math.floor(a*100)/100,b=!1;a&&!c.hasClass("no_vert_scroll")?(c.addClass("no_vert_scroll"),b=!0):!a&&c.hasClass("no_vert_scroll")&&(c.removeClass("no_vert_scroll"),b=!0);b&&this.$spacer.css("height")}};i.prototype.doUpdate= function(a){if(this.enabled)if(this.initialized){parseInt(a)||(a=0);var c=this.$page.outerHeight(!0),d=c-this.spacerHeight,a=Math.max(0,b.height()-this.pageMarginTop-this.pageMarginBottom-d-a);a<this.spacerMinHeight&&(a=this.spacerMinHeight+this.originalOffsetTop-this.$spacer.offset().top);if(a!=this.spacerHeight){this.pageResizeWatchEnabled=!1;this.updateScrollClass(a);this.$spacer.css("height",a);if(a<this.spacerHeight&&c==this.$page.outerHeight(!0))a=this.spacerHeight,this.updateScrollClass(a), this.$spacer.css("height",a);this.pageResizeWatchEnabled=!0}return this.spacerHeight=a}else this.pendingRequest=a};i.prototype.calculateInitialSpacerHeight=function(){for(var a=0,b=0;b++<20;){var c=this.doUpdate();if(c<=a)break;a=c}};i.prototype.onPageHeightChanged=function(a){this.pageResizeWatchEnabled&&this.doUpdate(a)};i.prototype.enable=function(){this.enabled=!0};i.prototype.disable=function(){this.enabled=!1};a("body").append('<div class="muse_check_css"></div>');var l=null,l=a(".muse_check_css"), k=l.css("height","100vh").height(),j=l.css("height","calc(100vh + 300px)").height();0<k&&0<j&&300==j-k?(l.remove(),l=new d):(a("html").removeClass("css_verticalspacer"),l=new i);b.data("stickyFooter",l)})(b);Muse.Utils.requestAnimationFrame=function(){return window.mozRequestAnimationFrame&&window.mozRequestAnimationFrame.bind(window)||window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.webkitRequestAnimationFrame&&window.webkitRequestAnimationFrame.bind(window)||function(a){window.setTimeout(a, 20)}}();Muse.Utils.animationFrameFx=function(a){var b=a.fx;a.extend(b,a.fx);var c,d=a(window).data("stickyFooter"),i=function(){c&&(Muse.Utils.requestAnimationFrame(i),b.tick(),d.doUpdate())};b.timer=function(b){b()&&a.timers.push(b)&&!c&&(c=!0,i())};b.stop=function(){c=!1};a.fn.animationFrameFx=b}(b)}); ;(function(){if(!("undefined"==typeof Muse||"undefined"==typeof Muse.assets)){var c=function(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]==b)return c;return-1}(Muse.assets.required,"museutils.js");if(-1!=c){Muse.assets.required.splice(c,1);for(var c=document.getElementsByTagName("meta"),b=0,d=c.length;b<d;b++){var a=c[b];if("generator"==a.getAttribute("name")){"2018.1.0.386"!=a.getAttribute("content")&&Muse.assets.outOfDate.push("museutils.js");break}}}}})();
/** * model/core/async.js */ var asyncModel = models.async = boundModel.extend({ _update: function asyncUpdate() { var self = this; // Allow updates that are as new or newer than the last *update* generation. // This allows rolling updates, where the model may have one or more requests // in flight for newer data, yet it will still accept earlier-generation // data that arrives as long as it is newer than what it had before. var reqGeneration = self.reqGeneration = (self.reqGeneration || 0) + 1; var callbackCalledImmediately = false; var opts = self.state(function asyncUpdateStateCallback(value) { callbackCalledImmediately = true; if (reqGeneration >= (self.updateGeneration || 0)) { self.updateGeneration = reqGeneration; self.abortCallback = null; self.query('', value); return true; } return undefined; }); if (!callbackCalledImmediately) { self.abortCallback = opts && opts.onAbort; } }, abortPrevious: function asyncAbortPrevious() { if (this.abortCallback) { this.abortCallback(); } }, priority: BASE_PRIORITY_MODEL_ASYNC });
window.awesomeLib = window.awesomeLib || { doSomethingCrazy : function(){ return 'mad'; } };
define({ "drsUrl": "Adatellenőrző szerver URL-címe", "includeReportedBy": "Ellenőrzést végző szakértő", "label": "Réteg", "show": "Foglald bele", "alias": "Aliasnév", "warning": "Helytelen adatbevitel", "defaultSessionId": "Alapértelmezett munkamenet", "setSource": "Beállítás", "getCurrentUser": "Bejelentkezett felhasználónév", "getDefaultUser": "Alapértelmezett érték megadása", "getUser": "Felhasználói bevitel engedélyezése", "userName": "Felhasználónév megadása", "noUserName": "Adja meg az alapértelmezett felhasználónevet.", "noLayers": "Nincsenek operatív rétegek a webes térképen.", "noSessionName": "Válasszon ki egy munkamenetet", "revTechName": "Ellenőrzést végző szakértő neve" });
angular.module('IntrepidJS').config( [ '$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider) { $urlRouterProvider.otherwise('/'); $stateProvider. state('signup', { url: '/accounts/signup', views: { "main_content": { templateUrl: "/accounts/signup", controller: 'SignupController' } } }). state('login', { url: "/accounts/login", views: { "main_content": { templateUrl: "/accounts/login", controller: 'HeaderController' } } }); } ] );
var erbium = require('./build/Release/erbium'); //var pkt = new erbium.Erbium(new Buffer([0x60,0x45,0x04,0xd2,0xc2,0x00,0x00,0xff,0x68,0x65,0x6c,0x6c,0x6f])); var pkt = new erbium.Erbium(new Buffer([0x50,0x01,0xe0,0xd6,0x33,0x6d,0x62,0x6b,0x85,0x68,0x65,0x6c,0x6c,0x6f])); console.log(pkt.getHeaderUriPath().toString()); console.log(pkt.getPayload().toString()); console.log(pkt.getHeaderContentType()); console.log(pkt.getHeaderContentType()); console.log(pkt.getHeaderMID()); process.exit(0); var obj = new erbium.Erbium(erbium.COAP_TYPE_CON, erbium.COAP_GET, 0); /* obj.setHeaderContentType(erbium.APPLICATION_LINK_FORMAT); console.log(obj.getHeaderContentType(), erbium.APPLICATION_LINK_FORMAT); obj.setHeaderAccept(erbium.TEXT_PLAIN); obj.setHeaderAccept(erbium.APPLICATION_LINK_FORMAT); console.log(obj.getHeaderAccept()); console.log("maxage", obj.getHeaderMaxAge()); obj.setHeaderMaxAge(10); console.log("maxage", obj.getHeaderMaxAge()); console.log("etag", obj.getHeaderETag()); obj.setHeaderETag(new Buffer("AAA")); console.log("etag", obj.getHeaderETag()); console.log("ifmatch", obj.getHeaderIfMatch()); obj.setHeaderIfMatch(new Buffer("AAA")); console.log("ifmatch", obj.getHeaderIfMatch()); console.log("ifnonematch", obj.getHeaderIfNoneMatch()); obj.setHeaderIfNoneMatch(); console.log("ifnonematch", obj.getHeaderIfNoneMatch()); console.log("token", obj.getHeaderToken()); obj.setHeaderToken(new Buffer("BBB")); console.log("token", obj.getHeaderToken()); console.log("proxyuri", obj.getHeaderProxyUri()); //obj.setHeaderProxyUri("coap://www.proxy.com"); //console.log("proxyuri", obj.getHeaderProxyUri()); console.log("urihost", obj.getHeaderUriHost()); obj.setHeaderUriHost("server.com"); console.log("urihost", obj.getHeaderUriHost()); console.log("uripath", obj.getHeaderUriPath()); console.log(obj.setHeaderUriPath("/bob")); console.log("uripath", obj.getHeaderUriPath()); */ console.log("uriquery", obj.getHeaderUriQuery()); obj.setHeaderUriQuery("?a=b"); console.log("uriquery", obj.getHeaderUriQuery()); console.log("locationpath", obj.getHeaderLocationPath()); obj.setHeaderLocationPath("xyz"); console.log("locationpath", obj.getHeaderLocationPath()); console.log("locationquery", obj.getHeaderLocationQuery()); obj.setHeaderLocationQuery("abc"); console.log("locationquery", obj.getHeaderLocationQuery()); console.log("observe", obj.getHeaderObserve()); obj.setHeaderObserve(10); console.log("observe", obj.getHeaderObserve()); console.log("size", obj.getHeaderSize()); obj.setHeaderSize(10); console.log("size", obj.getHeaderSize()); obj.setPayload(new Buffer("HHHHH")); var buf; console.log(buf = obj.serialize()); var o2 = new erbium.Erbium(buf); console.log("uriquery", o2.getHeaderUriQuery()); console.log(o2.serialize());
StartTest(function (t) { t.expectGlobals('0', '1') t.getHarness([ 'testfiles/601_siesta_ui_failing.t.js', 'testfiles/601_siesta_ui_passing.t.js' ]); t.it('Should not crash when starting recorder without a test', function (t) { t.chain( { waitFor : 'harnessReady' }, { click : '>> [action=show-recorder]' }, function(next) { var recPanel = t.cq1('[slot=recorderPanel]'); t.wontFire(recPanel, 'startrecord') next(); }, { click : '>> [action=recorder-start]' }, function(next) { var recPanel = t.cq1('[slot=recorderPanel]'); t.messageBoxIsVisible(); t.notOk(recPanel.test, 'Should not be bound to anything'); Ext.Msg.hide(); next() }, { click : '>> recorderpanel [text=Close]' } ); }) t.it('Should be bound to a test after running it', function (t) { t.chain( function(next) { var recPanel = t.cq1('[slot=recorderPanel]'); t.wontFire('startrecord') t.waitForHarnessEvent('testsuiteend', next); t.runFirstTest(); }, function() { var recPanel = t.cq1('[slot=recorderPanel]'); t.is(recPanel.test.url, 'testfiles/601_siesta_ui_failing.t.js'); t.messageBoxIsHidden(); Ext.Msg.hide(); } ); }) t.it('Should stop any ongoing recording when running another test', function (t) { t.chain( { doubleclick : 'testgrid => .x-grid-row:last-child' }, function(next) { var recPanel = t.cq1('[slot=recorderPanel]'); t.isnt(t.cq1('[slot=cardContainer]').layout.getActiveItem(), recPanel); t.is(recPanel.test.url, 'testfiles/601_siesta_ui_passing.t.js'); t.messageBoxIsHidden(); } ); }) t.it('Should attach to the test after starting recorder again', function (t) { t.chain( function(next) { var recPanel = t.cq1('[slot=recorderPanel]'); t.firesOnce(recPanel, 'startrecord') t.firesOnce(recPanel, 'stoprecord') next(); }, { click : '>> [action=show-recorder]' }, { click : '>> [action=recorder-start]' }, function(next) { var recPanel = t.cq1('[slot=recorderPanel]'); t.is(recPanel.test.url, 'testfiles/601_siesta_ui_passing.t.js'); next(); }, { click : '>> [action=recorder-stop]' } ); }) })
import Ember from "ember-metal/core"; // for Ember.ORDER_DEFINITION import {typeOf} from "ember-metal/utils"; import Comparable from "ember-runtime/mixins/comparable"; // Used by Ember.compare Ember.ORDER_DEFINITION = Ember.ENV.ORDER_DEFINITION || [ 'undefined', 'null', 'boolean', 'number', 'string', 'array', 'object', 'instance', 'function', 'class', 'date' ]; /** This will compare two javascript values of possibly different types. It will tell you which one is greater than the other by returning: - -1 if the first is smaller than the second, - 0 if both are equal, - 1 if the first is greater than the second. The order is calculated based on `Ember.ORDER_DEFINITION`, if types are different. In case they have the same type an appropriate comparison for this type is made. ```javascript Ember.compare('hello', 'hello'); // 0 Ember.compare('abc', 'dfg'); // -1 Ember.compare(2, 1); // 1 ``` @method compare @for Ember @param {Object} v First value to compare @param {Object} w Second value to compare @return {Number} -1 if v < w, 0 if v = w and 1 if v > w. */ function compare(v, w) { if (v === w) { return 0; } var type1 = typeOf(v); var type2 = typeOf(w); if (Comparable) { if (type1==='instance' && Comparable.detect(v.constructor)) { return v.constructor.compare(v, w); } if (type2 === 'instance' && Comparable.detect(w.constructor)) { return 1-w.constructor.compare(w, v); } } // If we haven't yet generated a reverse-mapping of Ember.ORDER_DEFINITION, // do so now. var mapping = Ember.ORDER_DEFINITION_MAPPING; if (!mapping) { var order = Ember.ORDER_DEFINITION; mapping = Ember.ORDER_DEFINITION_MAPPING = {}; var idx, len; for (idx = 0, len = order.length; idx < len; ++idx) { mapping[order[idx]] = idx; } // We no longer need Ember.ORDER_DEFINITION. delete Ember.ORDER_DEFINITION; } var type1Index = mapping[type1]; var type2Index = mapping[type2]; if (type1Index < type2Index) { return -1; } if (type1Index > type2Index) { return 1; } // types are equal - so we have to check values now switch (type1) { case 'boolean': case 'number': if (v < w) { return -1; } if (v > w) { return 1; } return 0; case 'string': var comp = v.localeCompare(w); if (comp < 0) { return -1; } if (comp > 0) { return 1; } return 0; case 'array': var vLen = v.length; var wLen = w.length; var l = Math.min(vLen, wLen); var r = 0; var i = 0; while (r === 0 && i < l) { r = compare(v[i],w[i]); i++; } if (r !== 0) { return r; } // all elements are equal now // shorter array should be ordered first if (vLen < wLen) { return -1; } if (vLen > wLen) { return 1; } // arrays are equal now return 0; case 'instance': if (Comparable && Comparable.detect(v)) { return v.compare(v, w); } return 0; case 'date': var vNum = v.getTime(); var wNum = w.getTime(); if (vNum < wNum) { return -1; } if (vNum > wNum) { return 1; } return 0; default: return 0; } }; export default compare;
module.exports = function(req, res, render) { req.models.{{x-singular-underscore}} .findAll() .then(function({{x-plural-camelcase}}) { render({{x-plural-camelcase}}); }) .catch(function(err) { render(err); }); };
"use strict"; const fs = require('fs'); const path = require('path'); module.exports = { solutionOnly(opts, runCode) { const entry = path.join(opts.dir, 'main.R'); if (opts.setup) fs.writeFileSync(path.join(opts.dir, 'setup.R'), opts.setup); fs.writeFileSync(entry, opts.solution); runCode({ name: 'Rscript', args: ['--no-save', entry], options: { cwd: opts.dir, } }); }, testIntegration(opts, runCode) { const entry = path.join(opts.dir, 'run-tests.R'); if (opts.setup) fs.writeFileSync(path.join(opts.dir, 'setup.R'), opts.setup); fs.writeFileSync(path.join(opts.dir, 'solution.R'), opts.solution); fs.writeFileSync(path.join(opts.dir, 'tests.R'), opts.fixture); fs.writeFileSync(entry, [ `library(testthat)`, `source("/runner/frameworks/r/codewars-reporter.R")`, `source("solution.R")`, `test_file("tests.R", reporter=CodewarsReporter$new())`, ].join('\n')); runCode({ name: 'Rscript', args: ['--no-save', entry], options: { cwd: opts.dir, }, }); } };
/** * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ 'use strict'; /*eslint no-console-disallow: "off"*/ const spawn = require('child_process').spawn; const fs = require('fs'); const path = require('path'); const http = require('http'); const urlLib = require('url'); const SourceMapConsumer = require('source-map').SourceMapConsumer; // url: string // onSuccess: function (SourceMapConsumer) // onFailure: function (string) function getSourceMapForUrl(url, onFailure, onSuccess) { if (!url) { onFailure('must provide a URL'); return; } if (url === 'assets://default_bundle') { onFailure('Don\'t know how to symbolicate in-app bundle, please load from server'); return; } const parsedUrl = urlLib.parse(url); const options = { host: 'localhost', port: parsedUrl.port, path: parsedUrl.pathname.replace(/\.bundle$/, '.map') + parsedUrl.search, }; http.get(options, (res) => { res.setEncoding('utf8'); let sawEnd = false; let resBody = ''; res.on('data', (chunk) => { resBody += chunk; }).on('end', () => { sawEnd = true; onSuccess(new SourceMapConsumer(resBody)); }).on('close', (err) => { if (!sawEnd) { onFailure('Connection terminated prematurely because of: ' + err.code + ' for url: ' + url); } }); }).on('error', (err) => { onFailure('Could not get response from: ' + url + ', error: ' + err.message); }); } // capture: capture object // onSuccess: function (Map of url -> SourceMapConsumer) // onFailure: function (string) function getSourceMapsForCapture(capture, onFailure, onSuccess) { const urls = new Set(); const sourcemaps = new Map(); for (const id in capture.refs) { const ref = capture.refs[id]; if ((ref.type === 'ScriptExecutable' || ref.type === 'EvalExecutable' || ref.type === 'ProgramExecutable' || ref.type === 'FunctionExecutable') && ref.value.url) { urls.add(ref.value.url); } } urls.forEach((url) => { getSourceMapForUrl(url, onFailure, (sourcemap) => { sourcemaps.set(url, sourcemap); urls.delete(url); if (urls.size === 0) { onSuccess(sourcemaps); } }); }); if (urls.size === 0) { console.warn('No source information found in capture'); onSuccess(sourcemaps); } } // capture: capture object // onSuccess: function (capture object) // onFailure: function (string) function symbolicateHeapCaptureFunctions(capture, onFailure, onSuccess) { getSourceMapsForCapture(capture, onFailure, (sourcemaps) => { for (const id in capture.refs) { const ref = capture.refs[id]; if (ref.type === 'ScriptExecutable' || ref.type === 'EvalExecutable' || ref.type === 'ProgramExecutable' || ref.type === 'FunctionExecutable') { const sourcemap = sourcemaps.get(ref.value.url); if (sourcemap) { const original = sourcemap.originalPositionFor({ line: ref.value.line, column: ref.value.col, }); if (original.name) { ref.value.name = original.name; } else if (!ref.value.name) { ref.value.name = path.posix.basename(original.source) + ':' + original.line; } ref.value.url = original.source; ref.value.line = original.line; ref.value.col = original.column; } } } onSuccess(capture); }); } module.exports = function(req, res, next) { if (req.url !== '/jscheapcaptureupload') { next(); return; } console.log('symbolicating Heap Capture'); symbolicateHeapCaptureFunctions(JSON.parse(req.rawBody), (err) => { console.error('Error when symbolicating: ' + err); }, (capture) => { res.end(); const preload = path.join(__dirname, 'heapCapture/preLoadedCapture.js'); fs.writeFileSync(preload, 'var preLoadedCapture = '); fs.appendFileSync(preload, JSON.stringify(capture)); fs.appendFileSync(preload, ';'); const captureDir = path.join(__dirname, 'heapCapture/captures'); if (!fs.existsSync(captureDir)) { fs.mkdirSync(captureDir); } console.log('Packaging Trace'); var captureHtml = captureDir + '/capture_' + Date.now() + '.html'; var capture = fs.createWriteStream(captureHtml); var inliner = spawn( 'inliner', ['--nocompress', 'heapCapture.html'], { cwd: path.join(__dirname, '/heapCapture/'), stdio: [ process.stdin, 'pipe', process.stderr ], }); inliner.stdout.pipe(capture); inliner.on('error', (err) => { console.error('Error processing heap capture: ' + err.message); console.error('make sure you have installed inliner with \'npm install inliner -g\''); }); inliner.on('exit', (code, signal) => { if (code === 0) { console.log('Heap capture written to: ' + captureHtml); } else { console.error('Error processing heap capture, inliner returned code: ' + code); } }); } ); };
import { createStorageRef, noop as noReturnValue } from './helpers' import { FirebaseProviderError } from './errors' export default function deleteFile(path, filename) { const ref = createStorageRef(path).child(filename) return ref.delete().then(noReturnValue).catch(error => { throw new FirebaseProviderError(error) }) }
/* global app, angular */ 'use strict'; app.factory('identity', function ($window, UsersResource) { var user; if ($window.bootstrappedUserObject) { user = new UsersResource(); angular.extend(user, $window.bootstrappedUserObject); } return { currentUser: user, isAuthenticated: function () { return !!this.currentUser; }, isAuthorizedForRole: function (role) { return !!this.currentUser && this.currentUser.roles.indexOf(role) > -1; } }; });
/*global qs, qsa, $on, $parent, $delegate */ (function (window) { 'use strict'; /** * View that abstracts away the browser's DOM completely. * It has two simple entry points: * * - bind(eventName, handler) * Takes a todo application event and registers the handler * - render(command, parameterObject) * Renders the given command with the options */ function View(template) { this.template = template; this.ENTER_KEY = 13; this.ESCAPE_KEY = 27; this.$todoList = qs('.todo-list'); this.$todoItemCounter = qs('.todo-count'); this.$clearCompleted = qs('.clear-completed'); this.$main = qs('.main'); this.$footer = qs('.footer'); this.$toggleAll = qs('.toggle-all'); this.$newTodo = qs('.new-todo'); } View.prototype._removeItem = function (id) { var elem = qs('[data-id="' + id + '"]'); if (elem) { this.$todoList.removeChild(elem); } }; View.prototype._clearCompletedButton = function (completedCount, visible) { this.$clearCompleted.innerHTML = this.template.clearCompletedButton(completedCount); this.$clearCompleted.style.display = visible ? 'block' : 'none'; }; View.prototype._setFilter = function (currentPage) { qs('.filters .selected').className = ''; qs('.filters [href="#/' + currentPage + '"]').className = 'selected'; }; View.prototype._elementComplete = function (id, completed) { var listItem = qs('[data-id="' + id + '"]'); if (!listItem) { return; } listItem.className = completed ? 'completed' : ''; // In case it was toggled from an event and not by clicking the checkbox qs('input', listItem).checked = completed; }; View.prototype._editItem = function (id, title) { var listItem = qs('[data-id="' + id + '"]'); if (!listItem) { return; } listItem.className = listItem.className + ' editing'; var input = document.createElement('input'); input.className = 'edit'; listItem.appendChild(input); input.focus(); input.value = title; }; View.prototype._editItemDone = function (id, title) { var listItem = qs('[data-id="' + id + '"]'); if (!listItem) { return; } var input = qs('input.edit', listItem); listItem.removeChild(input); listItem.className = listItem.className.replace('editing', ''); qsa('label', listItem).forEach(function (label) { label.textContent = title; }); }; View.prototype.render = function (viewCmd, parameter) { var self = this; var viewCommands = { showEntries: function () { self.$todoList.innerHTML = self.template.show(parameter); }, removeItem: function () { self._removeItem(parameter); }, updateElementCount: function () { self.$todoItemCounter.innerHTML = self.template.itemCounter(parameter); }, clearCompletedButton: function () { self._clearCompletedButton(parameter.completed, parameter.visible); }, contentBlockVisibility: function () { self.$main.style.display = self.$footer.style.display = parameter.visible ? 'block' : 'none'; }, toggleAll: function () { self.$toggleAll.checked = parameter.checked; }, setFilter: function () { self._setFilter(parameter); }, clearNewTodo: function () { self.$newTodo.value = ''; }, elementComplete: function () { self._elementComplete(parameter.id, parameter.completed); }, editItem: function () { self._editItem(parameter.id, parameter.title); }, editItemDone: function () { self._editItemDone(parameter.id, parameter.title); } }; viewCommands[viewCmd](); }; View.prototype._itemId = function (element) { var li = $parent(element, 'li'); return parseInt(li.dataset.id, 10); }; View.prototype._bindItemEditDone = function (handler) { var self = this; $delegate(self.$todoList, 'li .edit', 'blur', function () { if (!this.dataset.iscanceled) { handler({ id: self._itemId(this), title: this.value }); } }); $delegate(self.$todoList, 'li .edit', 'keypress', function (event) { if (event.keyCode === self.ENTER_KEY) { // Remove the cursor from the input when you hit enter just like if it // were a real form this.blur(); } }); }; View.prototype._bindItemEditCancel = function (handler) { var self = this; $delegate(self.$todoList, 'li .edit', 'keyup', function (event) { if (event.keyCode === self.ESCAPE_KEY) { this.dataset.iscanceled = true; this.blur(); handler({id: self._itemId(this)}); } }); }; View.prototype.bind = function (event, handler) { var self = this; if (event === 'newTodo') { $on(self.$newTodo, 'change', function () { handler(self.$newTodo.value); }); } else if (event === 'removeCompleted') { $on(self.$clearCompleted, 'click', function () { handler(); }); } else if (event === 'toggleAll') { $on(self.$toggleAll, 'click', function () { handler({completed: this.checked}); }); } else if (event === 'itemEdit') { $delegate(self.$todoList, 'li label', 'dblclick', function () { handler({id: self._itemId(this)}); }); } else if (event === 'itemRemove') { $delegate(self.$todoList, '.destroy', 'click', function () { handler({id: self._itemId(this)}); }); } else if (event === 'itemToggle') { $delegate(self.$todoList, '.toggle', 'click', function () { handler({ id: self._itemId(this), completed: this.checked }); }); } else if (event === 'itemEditDone') { self._bindItemEditDone(handler); } else if (event === 'itemEditCancel') { self._bindItemEditCancel(handler); } }; // Export to window window.app = window.app || {}; window.app.View = View; }(window));
var WS = require('../') var tape = require('tape') var pull = require('pull-stream') var JSONDL = require('pull-json-doubleline') tape('simple echo server', function (t) { var server = WS.createServer(function (stream) { pull(stream, stream) }).listen(5678, function () { pull( pull.values([1,2,3]), //need a delay, because otherwise ws hangs up wrong. //otherwise use pull-goodbye. function (read) { return function (err, cb) { setTimeout(function () { read(null, cb) }, 10) } }, JSONDL.stringify(), WS.connect('ws://localhost:5678'), JSONDL.parse(), pull.collect(function (err, ary) { if(err) throw err t.deepEqual(ary, [1,2,3]) server.close(function () { t.end() }) }) ) }) })
/*! * Bootstrap-select v1.13.14 (https://developer.snapappointments.com/bootstrap-select) * * Copyright 2012-2020 SnapAppointments, LLC * Licensed under MIT (https://github.com/snapappointments/bootstrap-select/blob/master/LICENSE) */ (function (root, factory) { if (root === undefined && window !== undefined) root = window; if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module unless amdModuleId is set define(["jquery"], function (a0) { return (factory(a0)); }); } else if (typeof module === 'object' && module.exports) { // Node. Does not work with strict CommonJS, but // only CommonJS-like environments that support module.exports, // like Node. module.exports = factory(require("jquery")); } else { factory(root["jQuery"]); } }(this, function (jQuery) { (function ($) { $.fn.selectpicker.defaults = { noneSelectedText: 'Нищо избрано', noneResultsText: 'Няма резултат за {0}', countSelectedText: function (numSelected, numTotal) { return (numSelected == 1) ? '{0} избран елемент' : '{0} избрани елемента'; }, maxOptionsText: function (numAll, numGroup) { return [ (numAll == 1) ? 'Лимита е достигнат ({n} елемент максимум)' : 'Лимита е достигнат ({n} елемента максимум)', (numGroup == 1) ? 'Груповия лимит е достигнат ({n} елемент максимум)' : 'Груповия лимит е достигнат ({n} елемента максимум)' ]; }, selectAllText: 'Избери всички', deselectAllText: 'Размаркирай всички', multipleSeparator: ', ' }; })(jQuery); })); //# sourceMappingURL=defaults-bg_BG.js.map
/** * Layout controller. * * @author Martin Micunda {@link http://martinmicunda.com} * @copyright Copyright (c) 2015, Martin Micunda * @license The MIT License {@link http://opensource.org/licenses/MIT} */ (function () { 'use strict'; /** * @ngdoc controller * @name LayoutCtrl * @module app.gallery * @requires $state * @requires Authentication * @description * Controller for the layout page. * * @ngInject */ function LayoutCtrl($state, Authentication) { var vm = this; vm.signOut = function() { Authentication.signout().then(function () { $state.go('signin'); }, function (err) { console.log('error ' + err); $state.go('signin'); }); }; vm.launchMartinMicundaPage = function(){ window.open("http://martinmicunda.com", "_blank", "closebuttoncaption=Done,location=no"); }; } angular .module('app.layout') .controller('LayoutCtrl', LayoutCtrl); })();
/*global require:true*/ (function( exports ){ "use strict"; var fs = require( 'fs' ); var Pfile = require( '..' + fs.separator + '..' + fs.separator + 'lib' + fs.separator + 'processing-file' ); var bearSVG = '<svg xmlns="http://www.w3.org/2000/svg" width="100" height="62.905px">\n' + '<path d="M11.068,34.558c-1.585-2.365-2.595-5.098-2.939-8.106c-0.344,0.092-0.666,0.161-1.033,0.161\n' + '\tc-2.342,0-4.248-1.906-4.248-4.248c0-1.47,0.758-2.756,1.883-3.514l12.147-8.45c2.549-1.562,5.534-2.526,8.749-2.641l30.149,0.092\n' + '\tL77.819,4.34c0-0.115,0-0.229,0-0.345C77.819,1.791,79.586,0,81.791,0c2.205,0,3.996,1.791,3.996,3.995\n' + '\tc0,0.345-0.046,0.712-0.138,1.034l2.043,0.275c2.365,0.459,4.156,2.549,4.156,5.052c0,0.161,0,0.298-0.022,0.436l6.544,3.536\n' + '\tc0.941,0.368,1.63,1.309,1.63,2.388c0,0.367-0.068,0.689-0.206,1.01l-1.631,3.697c-0.804,1.309-2.181,2.228-3.788,2.411\n' + '\tl-15.041,1.791L65.787,41.527l7.738,13.363l5.098,2.365c0.803,0.552,1.354,1.493,1.354,2.549c0,1.699-1.378,3.078-3.101,3.078\n' + '\tl-9.805,0.022c-2.525,0-4.707-1.424-5.809-3.49l-8.382-15.155l-18.92,0.023l6.682,10.287l4.937,2.25\n' + '\tc0.919,0.551,1.516,1.538,1.516,2.664c0,1.699-1.378,3.076-3.077,3.076l-9.828,0.023c-2.388,0-4.5-1.286-5.649-3.215l-9.208-14.627\n' + '\tl-6.429,6.246l-0.528,4.087l2.158,1.423c0.368,0.184,0.689,0.438,0.965,0.758c1.056,1.332,0.872,3.284-0.459,4.34\n' + '\tc-0.574,0.482-1.286,0.713-1.975,0.689l-4.317,0.023c-1.194-0.139-2.273-0.758-2.962-1.677l-5.029-8.68C0.275,51.033,0,50,0,48.898\n' + '\tc0-1.676,0.62-3.215,1.676-4.387L11.068,34.558z"/>\n' + '</svg>\n'; exports.constructor = { setup: function(){ this.pfile = new Pfile( fs.workingDirectory + fs.separator + "test" + fs.separator + "files" + fs.separator + "bear.svg" ); }, teardown: function( done ){ done(); }, 'constructor': function( test ){ test.equal( this.pfile.filename, "bear.svg", "The file should be named bear.svg" ); test.equal( this.pfile.pathdir, fs.workingDirectory + fs.separator + "test" + fs.separator + "files", "The pathdir isn't correct" ); test.equal( this.pfile.filenamenoext, "bear", "The filenamenoext should be bear" ); }, 'setImageData': function( test ){ this.pfile.setImageData(); test.equal( this.pfile.imagedata, bearSVG ); } }; }(typeof exports === 'object' && exports || this));
var expect = require('expect.js'), fs = require('fs'), path = require('path'), ladder = require('../'); describe('ladder', function() { describe('first.json', function() { it('should be 2 spaces', function() { var result = ladder(fs.readFileSync(path.resolve('test/first.json')).toString()); expect(result).to.equal(2); }); }); describe('second.json', function() { it('should be 3 spaces', function() { var result = ladder(fs.readFileSync(path.resolve('test/second.json')).toString()); expect(result).to.equal(3); }); }); describe('third.json', function() { it('should have 1 tab', function() { var result = ladder(fs.readFileSync(path.resolve('test/third.json')).toString()); expect(result).to.equal('\t'); }); }); });
module.exports = require('regenerate')(0xAD, 0x34F, 0x61C, 0x3164, 0xFEFF, 0xFFA0).addRange(0x115F, 0x1160).addRange(0x17B4, 0x17B5).addRange(0x180B, 0x180E).addRange(0x200B, 0x200F).addRange(0x202A, 0x202E).addRange(0x2060, 0x206F).addRange(0xFE00, 0xFE0F).addRange(0xFFF0, 0xFFF8).addRange(0x1BCA0, 0x1BCA3).addRange(0x1D173, 0x1D17A).addRange(0xE0000, 0xE0FFF);
/** * Convert Chinese to Pinyin * 未知作者 * 不能识别多音字 */ var PinYin = (function () { var py = { "a": "\u554a\u963f\u9515", "ai": "\u57c3\u6328\u54ce\u5509\u54c0\u7691\u764c\u853c\u77ee\u827e\u788d\u7231\u9698\u8bf6\u6371\u55f3\u55cc\u5ad2\u7477\u66a7\u7839\u953f\u972d", "an": "\u978d\u6c28\u5b89\u4ffa\u6309\u6697\u5cb8\u80fa\u6848\u8c19\u57ef\u63de\u72b4\u5eb5\u6849\u94f5\u9e4c\u9878\u9eef", "ang": "\u80ae\u6602\u76ce", "ao": "\u51f9\u6556\u71ac\u7ff1\u8884\u50b2\u5965\u61ca\u6fb3\u5773\u62d7\u55f7\u5662\u5c99\u5ed2\u9068\u5aaa\u9a9c\u8071\u87af\u93ca\u9ccc\u93d6", "ba": "\u82ad\u634c\u6252\u53ed\u5427\u7b06\u516b\u75a4\u5df4\u62d4\u8dcb\u9776\u628a\u8019\u575d\u9738\u7f62\u7238\u8307\u83dd\u8406\u636d\u5c9c\u705e\u6777\u94af\u7c91\u9c85\u9b43", "bai": "\u767d\u67cf\u767e\u6446\u4f70\u8d25\u62dc\u7a17\u859c\u63b0\u97b4", "ban": "\u6591\u73ed\u642c\u6273\u822c\u9881\u677f\u7248\u626e\u62cc\u4f34\u74e3\u534a\u529e\u7eca\u962a\u5742\u8c73\u94a3\u7622\u764d\u8228", "bang": "\u90a6\u5e2e\u6886\u699c\u8180\u7ed1\u68d2\u78c5\u868c\u9551\u508d\u8c24\u84a1\u8783", "bao": "\u82de\u80de\u5305\u8912\u96f9\u4fdd\u5821\u9971\u5b9d\u62b1\u62a5\u66b4\u8c79\u9c8d\u7206\u52f9\u8446\u5b80\u5b62\u7172\u9e28\u8913\u8db5\u9f85", "bo": "\u5265\u8584\u73bb\u83e0\u64ad\u62e8\u94b5\u6ce2\u535a\u52c3\u640f\u94c2\u7b94\u4f2f\u5e1b\u8236\u8116\u818a\u6e24\u6cca\u9a73\u4eb3\u8543\u5575\u997d\u6a97\u64d8\u7934\u94b9\u9e41\u7c38\u8ddb", "bei": "\u676f\u7891\u60b2\u5351\u5317\u8f88\u80cc\u8d1d\u94a1\u500d\u72c8\u5907\u60eb\u7119\u88ab\u5b5b\u9642\u90b6\u57e4\u84d3\u5457\u602b\u6096\u789a\u9e4e\u8919\u943e", "ben": "\u5954\u82ef\u672c\u7b28\u755a\u574c\u951b", "beng": "\u5d29\u7ef7\u752d\u6cf5\u8e66\u8ff8\u552a\u5623\u750f", "bi": "\u903c\u9f3b\u6bd4\u9119\u7b14\u5f7c\u78a7\u84d6\u853d\u6bd5\u6bd9\u6bd6\u5e01\u5e87\u75f9\u95ed\u655d\u5f0a\u5fc5\u8f9f\u58c1\u81c2\u907f\u965b\u5315\u4ef3\u4ffe\u8298\u835c\u8378\u5421\u54d4\u72f4\u5eb3\u610e\u6ed7\u6fde\u5f3c\u59a3\u5a62\u5b16\u74a7\u8d32\u7540\u94cb\u79d5\u88e8\u7b5a\u7b85\u7be6\u822d\u895e\u8df8\u9ac0", "bian": "\u97ad\u8fb9\u7f16\u8d2c\u6241\u4fbf\u53d8\u535e\u8fa8\u8fa9\u8fab\u904d\u533e\u5f01\u82c4\u5fed\u6c74\u7f0f\u7178\u782d\u78a5\u7a39\u7a86\u8759\u7b3e\u9cca", "biao": "\u6807\u5f6a\u8198\u8868\u5a4a\u9aa0\u98d1\u98d9\u98da\u706c\u9556\u9573\u762d\u88f1\u9cd4", "bie": "\u9cd6\u618b\u522b\u762a\u8e69\u9cd8", "bin": "\u5f6c\u658c\u6fd2\u6ee8\u5bbe\u6448\u50a7\u6d5c\u7f24\u73a2\u6ba1\u8191\u9554\u9acc\u9b13", "bing": "\u5175\u51b0\u67c4\u4e19\u79c9\u997c\u70b3\u75c5\u5e76\u7980\u90b4\u6452\u7ee0\u678b\u69df\u71f9", "bu": "\u6355\u535c\u54fa\u8865\u57e0\u4e0d\u5e03\u6b65\u7c3f\u90e8\u6016\u62ca\u535f\u900b\u74ff\u6661\u949a\u91ad", "ca": "\u64e6\u5693\u7924", "cai": "\u731c\u88c1\u6750\u624d\u8d22\u776c\u8e29\u91c7\u5f69\u83dc\u8521", "can": "\u9910\u53c2\u8695\u6b8b\u60ed\u60e8\u707f\u9a96\u74a8\u7cb2\u9eea", "cang": "\u82cd\u8231\u4ed3\u6ca7\u85cf\u4f27", "cao": "\u64cd\u7cd9\u69fd\u66f9\u8349\u8279\u5608\u6f15\u87ac\u825a", "ce": "\u5395\u7b56\u4fa7\u518c\u6d4b\u5202\u5e3b\u607b", "ceng": "\u5c42\u8e6d\u564c", "cha": "\u63d2\u53c9\u832c\u8336\u67e5\u78b4\u643d\u5bdf\u5c94\u5dee\u8be7\u7339\u9987\u6c4a\u59f9\u6748\u6942\u69ce\u6aab\u9497\u9538\u9572\u8869", "chai": "\u62c6\u67f4\u8c7a\u4faa\u8308\u7625\u867f\u9f87", "chan": "\u6400\u63ba\u8749\u998b\u8c17\u7f20\u94f2\u4ea7\u9610\u98a4\u5181\u8c04\u8c36\u8487\u5edb\u5fcf\u6f7a\u6fb6\u5b71\u7fbc\u5a75\u5b17\u9aa3\u89c7\u7985\u9561\u88e3\u87fe\u8e94", "chang": "\u660c\u7316\u573a\u5c1d\u5e38\u957f\u507f\u80a0\u5382\u655e\u7545\u5531\u5021\u4f25\u9b2f\u82cc\u83d6\u5f9c\u6005\u60dd\u960a\u5a3c\u5ae6\u6636\u6c05\u9cb3", "chao": "\u8d85\u6284\u949e\u671d\u5632\u6f6e\u5de2\u5435\u7092\u600a\u7ec9\u6641\u8016", "che": "\u8f66\u626f\u64a4\u63a3\u5f7b\u6f88\u577c\u5c6e\u7817", "chen": "\u90f4\u81e3\u8fb0\u5c18\u6668\u5ff1\u6c89\u9648\u8d81\u886c\u79f0\u8c0c\u62bb\u55d4\u5bb8\u741b\u6987\u809c\u80c2\u789c\u9f80", "cheng": "\u6491\u57ce\u6a59\u6210\u5448\u4e58\u7a0b\u60e9\u6f84\u8bda\u627f\u901e\u9a8b\u79e4\u57d5\u5d4a\u5fb5\u6d48\u67a8\u67fd\u6a18\u665f\u584d\u77a0\u94d6\u88ce\u86cf\u9172", "chi": "\u5403\u75f4\u6301\u5319\u6c60\u8fdf\u5f1b\u9a70\u803b\u9f7f\u4f88\u5c3a\u8d64\u7fc5\u65a5\u70bd\u50ba\u5880\u82aa\u830c\u640b\u53f1\u54e7\u557b\u55e4\u5f73\u996c\u6cb2\u5ab8\u6555\u80dd\u7719\u7735\u9e31\u761b\u892b\u86a9\u87ad\u7b1e\u7bea\u8c49\u8e05\u8e1f\u9b51", "chong": "\u5145\u51b2\u866b\u5d07\u5ba0\u833a\u5fe1\u61a7\u94f3\u825f", "chou": "\u62bd\u916c\u7574\u8e0c\u7a20\u6101\u7b79\u4ec7\u7ef8\u7785\u4e11\u4fe6\u5733\u5e31\u60c6\u6eb4\u59af\u7633\u96e0\u9c8b", "chu": "\u81ed\u521d\u51fa\u6a71\u53a8\u8e87\u9504\u96cf\u6ec1\u9664\u695a\u7840\u50a8\u77d7\u6410\u89e6\u5904\u4e8d\u520d\u61b7\u7ecc\u6775\u696e\u6a17\u870d\u8e70\u9edc", "chuan": "\u63e3\u5ddd\u7a7f\u693d\u4f20\u8239\u5598\u4e32\u63be\u821b\u60f4\u9044\u5ddb\u6c1a\u948f\u9569\u8221", "chuang": "\u75ae\u7a97\u5e62\u5e8a\u95ef\u521b\u6006", "chui": "\u5439\u708a\u6376\u9524\u5782\u9672\u68f0\u69cc", "chun": "\u6625\u693f\u9187\u5507\u6df3\u7eaf\u8822\u4fc3\u83bc\u6c8c\u80ab\u6710\u9e51\u877d", "chuo": "\u6233\u7ef0\u851f\u8fb6\u8f8d\u955e\u8e14\u9f8a", "ci": "\u75b5\u8328\u78c1\u96cc\u8f9e\u6148\u74f7\u8bcd\u6b64\u523a\u8d50\u6b21\u8360\u5472\u5d6f\u9e5a\u8785\u7ccd\u8d91", "cong": "\u806a\u8471\u56f1\u5306\u4ece\u4e1b\u506c\u82c1\u6dd9\u9aa2\u742e\u7481\u679e", "cu": "\u51d1\u7c97\u918b\u7c07\u731d\u6b82\u8e59", "cuan": "\u8e7f\u7be1\u7a9c\u6c46\u64ba\u6615\u7228", "cui": "\u6467\u5d14\u50ac\u8106\u7601\u7cb9\u6dec\u7fe0\u8403\u60b4\u7480\u69b1\u96b9", "cun": "\u6751\u5b58\u5bf8\u78cb\u5fd6\u76b4", "cuo": "\u64ae\u6413\u63aa\u632b\u9519\u539d\u811e\u9509\u77ec\u75e4\u9e7e\u8e49\u8e9c", "da": "\u642d\u8fbe\u7b54\u7629\u6253\u5927\u8037\u54d2\u55d2\u601b\u59b2\u75b8\u8921\u7b2a\u977c\u9791", "dai": "\u5446\u6b79\u50a3\u6234\u5e26\u6b86\u4ee3\u8d37\u888b\u5f85\u902e\u6020\u57ed\u7519\u5454\u5cb1\u8fe8\u902f\u9a80\u7ed0\u73b3\u9edb", "dan": "\u803d\u62c5\u4e39\u5355\u90f8\u63b8\u80c6\u65e6\u6c2e\u4f46\u60ee\u6de1\u8bde\u5f39\u86cb\u4ebb\u510b\u5369\u840f\u5556\u6fb9\u6a90\u6b9a\u8d55\u7708\u7605\u8043\u7baa", "dang": "\u5f53\u6321\u515a\u8361\u6863\u8c20\u51fc\u83ea\u5b95\u7800\u94db\u88c6", "dao": "\u5200\u6363\u8e48\u5012\u5c9b\u7977\u5bfc\u5230\u7a3b\u60bc\u9053\u76d7\u53e8\u5541\u5fc9\u6d2e\u6c18\u7118\u5fd1\u7e9b", "de": "\u5fb7\u5f97\u7684\u951d", "deng": "\u8e6c\u706f\u767b\u7b49\u77aa\u51f3\u9093\u5654\u5d9d\u6225\u78f4\u956b\u7c26", "di": "\u5824\u4f4e\u6ef4\u8fea\u654c\u7b1b\u72c4\u6da4\u7fdf\u5ae1\u62b5\u5e95\u5730\u8482\u7b2c\u5e1d\u5f1f\u9012\u7f14\u6c10\u7c74\u8bcb\u8c1b\u90b8\u577b\u839c\u837b\u5600\u5a23\u67e2\u68e3\u89cc\u7825\u78b2\u7747\u955d\u7f9d\u9ab6", "dian": "\u98a0\u6382\u6ec7\u7898\u70b9\u5178\u975b\u57ab\u7535\u4f43\u7538\u5e97\u60e6\u5960\u6dc0\u6bbf\u4e36\u963d\u576b\u57dd\u5dc5\u73b7\u765c\u766b\u7c1f\u8e2e", "diao": "\u7889\u53fc\u96d5\u51cb\u5201\u6389\u540a\u9493\u8c03\u8f7a\u94de\u8729\u7c9c\u8c82", "die": "\u8dcc\u7239\u789f\u8776\u8fed\u8c0d\u53e0\u4f5a\u57a4\u581e\u63f2\u558b\u6e2b\u8f76\u7252\u74de\u8936\u800b\u8e40\u9cbd\u9cce", "ding": "\u4e01\u76ef\u53ee\u9489\u9876\u9f0e\u952d\u5b9a\u8ba2\u4e22\u4ec3\u5576\u738e\u815a\u7887\u753a\u94e4\u7594\u8035\u914a", "dong": "\u4e1c\u51ac\u8463\u61c2\u52a8\u680b\u4f97\u606b\u51bb\u6d1e\u578c\u549a\u5cbd\u5cd2\u5902\u6c21\u80e8\u80f4\u7850\u9e2b", "dou": "\u515c\u6296\u6597\u9661\u8c46\u9017\u75d8\u8538\u94ad\u7aa6\u7aac\u86aa\u7bfc\u9161", "du": "\u90fd\u7763\u6bd2\u728a\u72ec\u8bfb\u5835\u7779\u8d4c\u675c\u9540\u809a\u5ea6\u6e21\u5992\u828f\u561f\u6e0e\u691f\u6a50\u724d\u8839\u7b03\u9ad1\u9ee9", "duan": "\u7aef\u77ed\u953b\u6bb5\u65ad\u7f0e\u5f56\u6934\u7145\u7c16", "dui": "\u5806\u5151\u961f\u5bf9\u603c\u619d\u7893", "dun": "\u58a9\u5428\u8e72\u6566\u987f\u56e4\u949d\u76fe\u9041\u7096\u7818\u7905\u76f9\u9566\u8db8", "duo": "\u6387\u54c6\u591a\u593a\u579b\u8eb2\u6735\u8dfa\u8235\u5241\u60f0\u5815\u5484\u54da\u7f0d\u67c1\u94ce\u88f0\u8e31", "e": "\u86fe\u5ce8\u9e45\u4fc4\u989d\u8bb9\u5a25\u6076\u5384\u627c\u904f\u9102\u997f\u5669\u8c14\u57a9\u57ad\u82ca\u83aa\u843c\u5443\u6115\u5c59\u5a40\u8f6d\u66f7\u816d\u786a\u9507\u9537\u9e57\u989a\u9cc4", "en": "\u6069\u84bd\u6441\u5514\u55ef", "er": "\u800c\u513f\u8033\u5c14\u9975\u6d31\u4e8c\u8d30\u8fe9\u73e5\u94d2\u9e38\u9c95", "fa": "\u53d1\u7f5a\u7b4f\u4f10\u4e4f\u9600\u6cd5\u73d0\u57a1\u781d", "fan": "\u85e9\u5e06\u756a\u7ffb\u6a0a\u77fe\u9492\u7e41\u51e1\u70e6\u53cd\u8fd4\u8303\u8d29\u72af\u996d\u6cdb\u8629\u5e61\u72ad\u68b5\u6535\u71d4\u7548\u8e6f", "fang": "\u574a\u82b3\u65b9\u80aa\u623f\u9632\u59a8\u4eff\u8bbf\u7eba\u653e\u531a\u90a1\u5f77\u94ab\u822b\u9c82", "fei": "\u83f2\u975e\u5561\u98de\u80a5\u532a\u8bfd\u5420\u80ba\u5e9f\u6cb8\u8d39\u82be\u72d2\u60b1\u6ddd\u5983\u7ecb\u7eef\u69a7\u8153\u6590\u6249\u7953\u7829\u9544\u75f1\u871a\u7bda\u7fe1\u970f\u9cb1", "fen": "\u82ac\u915a\u5429\u6c1b\u5206\u7eb7\u575f\u711a\u6c7e\u7c89\u594b\u4efd\u5fff\u6124\u7caa\u507e\u7035\u68fc\u610d\u9cbc\u9f22", "feng": "\u4e30\u5c01\u67ab\u8702\u5cf0\u950b\u98ce\u75af\u70fd\u9022\u51af\u7f1d\u8bbd\u5949\u51e4\u4ff8\u9146\u8451\u6ca3\u781c", "fu": "\u4f5b\u5426\u592b\u6577\u80a4\u5b75\u6276\u62c2\u8f90\u5e45\u6c1f\u7b26\u4f0f\u4fd8\u670d\u6d6e\u6daa\u798f\u88b1\u5f17\u752b\u629a\u8f85\u4fef\u91dc\u65a7\u812f\u8151\u5e9c\u8150\u8d74\u526f\u8986\u8d4b\u590d\u5085\u4ed8\u961c\u7236\u8179\u8d1f\u5bcc\u8ba3\u9644\u5987\u7f1a\u5490\u5310\u51eb\u90db\u8299\u82fb\u832f\u83a9\u83d4\u544b\u5e5e\u6ecf\u8274\u5b5a\u9a78\u7ec2\u6874\u8d59\u9efb\u9efc\u7f58\u7a03\u99a5\u864d\u86a8\u8709\u8760\u876e\u9eb8\u8dba\u8dd7\u9cc6", "ga": "\u5676\u560e\u86e4\u5c2c\u5477\u5c15\u5c1c\u65ee\u9486", "gai": "\u8be5\u6539\u6982\u9499\u76d6\u6e89\u4e10\u9654\u5793\u6224\u8d45\u80f2", "gan": "\u5e72\u7518\u6746\u67d1\u7aff\u809d\u8d76\u611f\u79c6\u6562\u8d63\u5769\u82f7\u5c34\u64c0\u6cd4\u6de6\u6f89\u7ec0\u6a44\u65f0\u77f8\u75b3\u9150", "gang": "\u5188\u521a\u94a2\u7f38\u809b\u7eb2\u5c97\u6e2f\u6206\u7f61\u9883\u7b7b", "gong": "\u6760\u5de5\u653b\u529f\u606d\u9f9a\u4f9b\u8eac\u516c\u5bab\u5f13\u5de9\u6c5e\u62f1\u8d21\u5171\u857b\u5efe\u54a3\u73d9\u80b1\u86a3\u86e9\u89e5", "gao": "\u7bd9\u768b\u9ad8\u818f\u7f94\u7cd5\u641e\u9550\u7a3f\u544a\u777e\u8bf0\u90dc\u84bf\u85c1\u7f1f\u69d4\u69c1\u6772\u9506", "ge": "\u54e5\u6b4c\u6401\u6208\u9e3d\u80f3\u7599\u5272\u9769\u845b\u683c\u9601\u9694\u94ec\u4e2a\u5404\u9b32\u4ee1\u54ff\u5865\u55dd\u7ea5\u643f\u8188\u784c\u94ea\u9549\u88bc\u988c\u867c\u8238\u9abc\u9ac2", "gei": "\u7ed9", "gen": "\u6839\u8ddf\u4e98\u831b\u54cf\u826e", "geng": "\u8015\u66f4\u5e9a\u7fb9\u57c2\u803f\u6897\u54fd\u8d53\u9ca0", "gou": "\u94a9\u52fe\u6c9f\u82df\u72d7\u57a2\u6784\u8d2d\u591f\u4f5d\u8bdf\u5ca3\u9058\u5abe\u7f11\u89cf\u5f40\u9e32\u7b31\u7bdd\u97b2", "gu": "\u8f9c\u83c7\u5495\u7b8d\u4f30\u6cbd\u5b64\u59d1\u9f13\u53e4\u86ca\u9aa8\u8c37\u80a1\u6545\u987e\u56fa\u96c7\u560f\u8bc2\u83f0\u54cc\u5d2e\u6c69\u688f\u8f71\u726f\u727f\u80cd\u81cc\u6bc2\u77bd\u7f5f\u94b4\u9522\u74e0\u9e2a\u9e44\u75fc\u86c4\u9164\u89da\u9cb4\u9ab0\u9e58", "gua": "\u522e\u74dc\u5250\u5be1\u6302\u8902\u5366\u8bd6\u5471\u681d\u9e39", "guai": "\u4e56\u62d0\u602a\u54d9", "guan": "\u68fa\u5173\u5b98\u51a0\u89c2\u7ba1\u9986\u7f50\u60ef\u704c\u8d2f\u500c\u839e\u63bc\u6dab\u76e5\u9e73\u9ccf", "guang": "\u5149\u5e7f\u901b\u72b7\u6844\u80f1\u7592", "gui": "\u7470\u89c4\u572d\u7845\u5f52\u9f9f\u95fa\u8f68\u9b3c\u8be1\u7678\u6842\u67dc\u8dea\u8d35\u523d\u5326\u523f\u5e8b\u5b84\u59ab\u6867\u7085\u6677\u7688\u7c0b\u9c91\u9cdc", "gun": "\u8f8a\u6eda\u68cd\u4e28\u886e\u7ef2\u78d9\u9ca7", "guo": "\u9505\u90ed\u56fd\u679c\u88f9\u8fc7\u9998\u8803\u57da\u63b4\u5459\u56d7\u5e3c\u5d1e\u7313\u6901\u8662\u951e\u8052\u872e\u873e\u8748", "ha": "\u54c8", "hai": "\u9ab8\u5b69\u6d77\u6c26\u4ea5\u5bb3\u9a87\u54b4\u55e8\u988f\u91a2", "han": "\u9163\u61a8\u90af\u97e9\u542b\u6db5\u5bd2\u51fd\u558a\u7f55\u7ff0\u64bc\u634d\u65f1\u61be\u608d\u710a\u6c57\u6c49\u9097\u83e1\u6496\u961a\u701a\u6657\u7113\u9894\u86b6\u9f3e", "hen": "\u592f\u75d5\u5f88\u72e0\u6068", "hang": "\u676d\u822a\u6c86\u7ed7\u73e9\u6841", "hao": "\u58d5\u568e\u8c6a\u6beb\u90dd\u597d\u8017\u53f7\u6d69\u8585\u55e5\u5686\u6fe0\u704f\u660a\u7693\u98a2\u869d", "he": "\u5475\u559d\u8377\u83cf\u6838\u79be\u548c\u4f55\u5408\u76d2\u8c89\u9602\u6cb3\u6db8\u8d6b\u8910\u9e64\u8d3a\u8bc3\u52be\u58d1\u85ff\u55d1\u55ec\u9616\u76cd\u86b5\u7fee", "hei": "\u563f\u9ed1", "heng": "\u54fc\u4ea8\u6a2a\u8861\u6052\u8a07\u8605", "hong": "\u8f70\u54c4\u70d8\u8679\u9e3f\u6d2a\u5b8f\u5f18\u7ea2\u9ec9\u8ba7\u836d\u85a8\u95f3\u6cd3", "hou": "\u5589\u4faf\u7334\u543c\u539a\u5019\u540e\u5820\u5f8c\u9005\u760a\u7bcc\u7cc7\u9c8e\u9aba", "hu": "\u547c\u4e4e\u5ffd\u745a\u58f6\u846b\u80e1\u8774\u72d0\u7cca\u6e56\u5f27\u864e\u552c\u62a4\u4e92\u6caa\u6237\u51b1\u553f\u56eb\u5cb5\u7322\u6019\u60da\u6d52\u6ef9\u7425\u69f2\u8f77\u89f3\u70c0\u7173\u623d\u6248\u795c\u9e55\u9e71\u7b0f\u9190\u659b", "hua": "\u82b1\u54d7\u534e\u733e\u6ed1\u753b\u5212\u5316\u8bdd\u5290\u6d4d\u9a85\u6866\u94e7\u7a1e", "huai": "\u69d0\u5f8a\u6000\u6dee\u574f\u8fd8\u8e1d", "huan": "\u6b22\u73af\u6853\u7f13\u6362\u60a3\u5524\u75ea\u8c62\u7115\u6da3\u5ba6\u5e7b\u90c7\u5942\u57b8\u64d0\u571c\u6d39\u6d63\u6f36\u5bf0\u902d\u7f33\u953e\u9ca9\u9b1f", "huang": "\u8352\u614c\u9ec4\u78fa\u8757\u7c27\u7687\u51f0\u60f6\u714c\u6643\u5e4c\u604d\u8c0e\u968d\u5fa8\u6e5f\u6f62\u9051\u749c\u8093\u7640\u87e5\u7bc1\u9cc7", "hui": "\u7070\u6325\u8f89\u5fbd\u6062\u86d4\u56de\u6bc1\u6094\u6167\u5349\u60e0\u6666\u8d3f\u79fd\u4f1a\u70e9\u6c47\u8bb3\u8bf2\u7ed8\u8bd9\u8334\u835f\u8559\u54d5\u5599\u96b3\u6d04\u5f57\u7f0b\u73f2\u6656\u605a\u867a\u87ea\u9ebe", "hun": "\u8364\u660f\u5a5a\u9b42\u6d51\u6df7\u8be8\u9984\u960d\u6eb7\u7f17", "huo": "\u8c41\u6d3b\u4f19\u706b\u83b7\u6216\u60d1\u970d\u8d27\u7978\u6509\u56af\u5925\u94ac\u952a\u956c\u8020\u8816", "ji": "\u51fb\u573e\u57fa\u673a\u7578\u7a3d\u79ef\u7b95\u808c\u9965\u8ff9\u6fc0\u8ba5\u9e21\u59ec\u7ee9\u7f09\u5409\u6781\u68d8\u8f91\u7c4d\u96c6\u53ca\u6025\u75be\u6c72\u5373\u5ac9\u7ea7\u6324\u51e0\u810a\u5df1\u84df\u6280\u5180\u5b63\u4f0e\u796d\u5242\u60b8\u6d4e\u5bc4\u5bc2\u8ba1\u8bb0\u65e2\u5fcc\u9645\u5993\u7ee7\u7eaa\u5c45\u4e0c\u4e69\u525e\u4f76\u4f74\u8114\u58bc\u82a8\u82b0\u8401\u84ba\u857a\u638e\u53fd\u54ad\u54dc\u5527\u5c8c\u5d74\u6d0e\u5f50\u5c50\u9aa5\u757f\u7391\u696b\u6b9b\u621f\u6222\u8d4d\u89ca\u7284\u9f51\u77f6\u7f81\u5d47\u7a37\u7620\u7635\u866e\u7b08\u7b04\u66a8\u8dfb\u8dfd\u9701\u9c9a\u9cab\u9afb\u9e82", "jia": "\u5609\u67b7\u5939\u4f73\u5bb6\u52a0\u835a\u988a\u8d3e\u7532\u94be\u5047\u7a3c\u4ef7\u67b6\u9a7e\u5ac1\u4f3d\u90cf\u62ee\u5cac\u6d43\u8fe6\u73c8\u621b\u80db\u605d\u94d7\u9553\u75c2\u86f1\u7b33\u8888\u8dcf", "jian": "\u6b7c\u76d1\u575a\u5c16\u7b3a\u95f4\u714e\u517c\u80a9\u8270\u5978\u7f04\u8327\u68c0\u67ec\u78b1\u7877\u62e3\u6361\u7b80\u4fed\u526a\u51cf\u8350\u69db\u9274\u8df5\u8d31\u89c1\u952e\u7bad\u4ef6\u5065\u8230\u5251\u996f\u6e10\u6e85\u6da7\u5efa\u50ed\u8c0f\u8c2b\u83c5\u84b9\u641b\u56dd\u6e54\u8e47\u8b07\u7f23\u67a7\u67d9\u6957\u620b\u622c\u726e\u728d\u6bfd\u8171\u7751\u950f\u9e63\u88e5\u7b15\u7bb4\u7fe6\u8dbc\u8e3a\u9ca3\u97af", "jiang": "\u50f5\u59dc\u5c06\u6d46\u6c5f\u7586\u848b\u6868\u5956\u8bb2\u5320\u9171\u964d\u8333\u6d1a\u7edb\u7f30\u729f\u7913\u8029\u7ce8\u8c47", "jiao": "\u8549\u6912\u7901\u7126\u80f6\u4ea4\u90ca\u6d47\u9a84\u5a07\u56bc\u6405\u94f0\u77eb\u4fa5\u811a\u72e1\u89d2\u997a\u7f34\u7ede\u527f\u6559\u9175\u8f7f\u8f83\u53eb\u4f7c\u50ec\u832d\u6322\u564d\u5ce4\u5fbc\u59e3\u7e9f\u656b\u768e\u9e6a\u86df\u91ae\u8de4\u9c9b", "jie": "\u7a96\u63ed\u63a5\u7686\u79f8\u8857\u9636\u622a\u52ab\u8282\u6854\u6770\u6377\u776b\u7aed\u6d01\u7ed3\u89e3\u59d0\u6212\u85c9\u82a5\u754c\u501f\u4ecb\u75a5\u8beb\u5c4a\u5048\u8ba6\u8bd8\u5588\u55df\u736c\u5a55\u5b51\u6840\u7352\u78a3\u9534\u7596\u88b7\u9889\u86a7\u7faf\u9c92\u9ab1\u9aeb", "jin": "\u5dfe\u7b4b\u65a4\u91d1\u4eca\u6d25\u895f\u7d27\u9526\u4ec5\u8c28\u8fdb\u9773\u664b\u7981\u8fd1\u70ec\u6d78\u5c3d\u537a\u8369\u5807\u5664\u9991\u5ed1\u5997\u7f19\u747e\u69ff\u8d46\u89d0\u9485\u9513\u887f\u77dc", "jing": "\u52b2\u8346\u5162\u830e\u775b\u6676\u9cb8\u4eac\u60ca\u7cbe\u7cb3\u7ecf\u4e95\u8b66\u666f\u9888\u9759\u5883\u656c\u955c\u5f84\u75c9\u9756\u7adf\u7ade\u51c0\u522d\u5106\u9631\u83c1\u734d\u61ac\u6cfe\u8ff3\u5f2a\u5a67\u80bc\u80eb\u8148\u65cc", "jiong": "\u70af\u7a98\u5182\u8fe5\u6243", "jiu": "\u63ea\u7a76\u7ea0\u7396\u97ed\u4e45\u7078\u4e5d\u9152\u53a9\u6551\u65e7\u81fc\u8205\u548e\u5c31\u759a\u50e6\u557e\u9604\u67e9\u6855\u9e6b\u8d73\u9b0f", "ju": "\u97a0\u62d8\u72d9\u75bd\u9a79\u83ca\u5c40\u5480\u77e9\u4e3e\u6cae\u805a\u62d2\u636e\u5de8\u5177\u8ddd\u8e1e\u952f\u4ff1\u53e5\u60e7\u70ac\u5267\u5028\u8bb5\u82e3\u82f4\u8392\u63ac\u907d\u5c66\u741a\u67b8\u6910\u6998\u6989\u6a58\u728b\u98d3\u949c\u9514\u7aad\u88fe\u8d84\u91b5\u8e3d\u9f83\u96ce\u97ab", "juan": "\u6350\u9e43\u5a1f\u5026\u7737\u5377\u7ee2\u9104\u72f7\u6d93\u684a\u8832\u9529\u954c\u96bd", "jue": "\u6485\u652b\u6289\u6398\u5014\u7235\u89c9\u51b3\u8bc0\u7edd\u53a5\u5282\u8c32\u77cd\u8568\u5658\u5d1b\u7357\u5b53\u73cf\u6877\u6a5b\u721d\u9562\u8e76\u89d6", "jun": "\u5747\u83cc\u94a7\u519b\u541b\u5cfb\u4fca\u7ae3\u6d5a\u90e1\u9a8f\u6343\u72fb\u76b2\u7b60\u9e87", "ka": "\u5580\u5496\u5361\u4f67\u5494\u80e9", "ke": "\u54af\u5777\u82db\u67ef\u68f5\u78d5\u9897\u79d1\u58f3\u54b3\u53ef\u6e34\u514b\u523b\u5ba2\u8bfe\u5ca2\u606a\u6e98\u9a92\u7f02\u73c2\u8f72\u6c2a\u778c\u94b6\u75b4\u7aa0\u874c\u9ac1", "kai": "\u5f00\u63e9\u6977\u51ef\u6168\u5240\u57b2\u8488\u5ffe\u607a\u94e0\u950e", "kan": "\u520a\u582a\u52d8\u574e\u780d\u770b\u4f83\u51f5\u83b0\u83b6\u6221\u9f9b\u77b0", "kang": "\u5eb7\u6177\u7ce0\u625b\u6297\u4ea2\u7095\u5751\u4f09\u95f6\u94aa", "kao": "\u8003\u62f7\u70e4\u9760\u5c3b\u6832\u7292\u94d0", "ken": "\u80af\u5543\u57a6\u6073\u57a0\u88c9\u9880", "keng": "\u542d\u5fd0\u94ff", "kong": "\u7a7a\u6050\u5b54\u63a7\u5025\u5d06\u7b9c", "kou": "\u62a0\u53e3\u6263\u5bc7\u82a4\u853b\u53e9\u770d\u7b58", "ku": "\u67af\u54ed\u7a9f\u82e6\u9177\u5e93\u88e4\u5233\u5800\u55be\u7ed4\u9ab7", "kua": "\u5938\u57ae\u630e\u8de8\u80ef\u4f89", "kuai": "\u5757\u7b77\u4fa9\u5feb\u84af\u90d0\u8489\u72ef\u810d", "kuan": "\u5bbd\u6b3e\u9acb", "kuang": "\u5321\u7b50\u72c2\u6846\u77ff\u7736\u65f7\u51b5\u8bd3\u8bf3\u909d\u5739\u593c\u54d0\u7ea9\u8d36", "kui": "\u4e8f\u76d4\u5cbf\u7aa5\u8475\u594e\u9b41\u5080\u9988\u6127\u6e83\u9997\u532e\u5914\u9697\u63c6\u55b9\u559f\u609d\u6126\u9615\u9035\u668c\u777d\u8069\u8770\u7bd1\u81fe\u8dec", "kun": "\u5764\u6606\u6346\u56f0\u6083\u9603\u7428\u951f\u918c\u9cb2\u9ae1", "kuo": "\u62ec\u6269\u5ed3\u9614\u86de", "la": "\u5783\u62c9\u5587\u8721\u814a\u8fa3\u5566\u524c\u647a\u908b\u65ef\u782c\u760c", "lai": "\u83b1\u6765\u8d56\u5d03\u5f95\u6d9e\u6fd1\u8d49\u7750\u94fc\u765e\u7c41", "lan": "\u84dd\u5a6a\u680f\u62e6\u7bee\u9611\u5170\u6f9c\u8c30\u63fd\u89c8\u61d2\u7f06\u70c2\u6ee5\u5549\u5c9a\u61d4\u6f24\u6984\u6593\u7f71\u9567\u8934", "lang": "\u7405\u6994\u72fc\u5eca\u90ce\u6717\u6d6a\u83a8\u8497\u5577\u9606\u9512\u7a02\u8782", "lao": "\u635e\u52b3\u7262\u8001\u4f6c\u59e5\u916a\u70d9\u6d9d\u5520\u5d02\u6833\u94d1\u94f9\u75e8\u91aa", "le": "\u52d2\u4e50\u808b\u4ec2\u53fb\u561e\u6cd0\u9cd3", "lei": "\u96f7\u956d\u857e\u78ca\u7d2f\u5121\u5792\u64c2\u7c7b\u6cea\u7fb8\u8bd4\u837d\u54a7\u6f2f\u5ad8\u7f27\u6a91\u8012\u9179", "ling": "\u68f1\u51b7\u62ce\u73b2\u83f1\u96f6\u9f84\u94c3\u4f36\u7f9a\u51cc\u7075\u9675\u5cad\u9886\u53e6\u4ee4\u9143\u5844\u82d3\u5464\u56f9\u6ce0\u7eeb\u67c3\u68c2\u74f4\u8046\u86c9\u7fce\u9cae", "leng": "\u695e\u6123", "li": "\u5398\u68a8\u7281\u9ece\u7bf1\u72f8\u79bb\u6f13\u7406\u674e\u91cc\u9ca4\u793c\u8389\u8354\u540f\u6817\u4e3d\u5389\u52b1\u783e\u5386\u5229\u5088\u4f8b\u4fd0\u75e2\u7acb\u7c92\u6ca5\u96b6\u529b\u7483\u54e9\u4fea\u4fda\u90e6\u575c\u82c8\u8385\u84e0\u85dc\u6369\u5456\u5533\u55b1\u7301\u6ea7\u6fa7\u9026\u5a0c\u5ae0\u9a8a\u7f21\u73de\u67a5\u680e\u8f79\u623e\u783a\u8a48\u7f79\u9502\u9e42\u75a0\u75ac\u86ce\u870a\u8821\u7b20\u7be5\u7c9d\u91b4\u8dde\u96f3\u9ca1\u9ce2\u9ee7", "lian": "\u4fe9\u8054\u83b2\u8fde\u9570\u5ec9\u601c\u6d9f\u5e18\u655b\u8138\u94fe\u604b\u70bc\u7ec3\u631b\u8539\u5941\u6f4b\u6fc2\u5a08\u740f\u695d\u6b93\u81c1\u81a6\u88e2\u880a\u9ca2", "liang": "\u7cae\u51c9\u6881\u7cb1\u826f\u4e24\u8f86\u91cf\u667e\u4eae\u8c05\u589a\u690b\u8e09\u9753\u9b49", "liao": "\u64a9\u804a\u50da\u7597\u71ce\u5be5\u8fbd\u6f66\u4e86\u6482\u9563\u5ed6\u6599\u84fc\u5c25\u5639\u7360\u5bee\u7f2d\u948c\u9e69\u8022", "lie": "\u5217\u88c2\u70c8\u52a3\u730e\u51bd\u57d2\u6d0c\u8d94\u8e90\u9b23", "lin": "\u7433\u6797\u78f7\u9716\u4e34\u90bb\u9cde\u6dcb\u51db\u8d41\u541d\u853a\u5d99\u5eea\u9074\u6aa9\u8f9a\u77b5\u7cbc\u8e8f\u9e9f", "liu": "\u6e9c\u7409\u69b4\u786b\u998f\u7559\u5218\u7624\u6d41\u67f3\u516d\u62a1\u507b\u848c\u6cd6\u6d4f\u905b\u9a9d\u7efa\u65d2\u7198\u950d\u954f\u9e68\u938f", "long": "\u9f99\u804b\u5499\u7b3c\u7abf\u9686\u5784\u62e2\u9647\u5f04\u5785\u830f\u6cf7\u73d1\u680a\u80e7\u783b\u7643", "lou": "\u697c\u5a04\u6402\u7bd3\u6f0f\u964b\u55bd\u5d5d\u9542\u7618\u8027\u877c\u9ac5", "lu": "\u82a6\u5362\u9885\u5e90\u7089\u63b3\u5364\u864f\u9c81\u9e93\u788c\u9732\u8def\u8d42\u9e7f\u6f5e\u7984\u5f55\u9646\u622e\u5786\u6445\u64b8\u565c\u6cf8\u6e0c\u6f09\u7490\u680c\u6a79\u8f73\u8f82\u8f98\u6c07\u80ea\u9565\u9e2c\u9e6d\u7c0f\u823b\u9c88", "lv": "\u9a74\u5415\u94dd\u4fa3\u65c5\u5c65\u5c61\u7f15\u8651\u6c2f\u5f8b\u7387\u6ee4\u7eff\u634b\u95fe\u6988\u8182\u7a06\u891b", "luan": "\u5ce6\u5b6a\u6ee6\u5375\u4e71\u683e\u9e3e\u92ae", "lue": "\u63a0\u7565\u950a", "lun": "\u8f6e\u4f26\u4ed1\u6ca6\u7eb6\u8bba\u56f5", "luo": "\u841d\u87ba\u7f57\u903b\u9523\u7ba9\u9aa1\u88f8\u843d\u6d1b\u9a86\u7edc\u502e\u8366\u645e\u7321\u6cfa\u6924\u8136\u9559\u7630\u96d2", "ma": "\u5988\u9ebb\u739b\u7801\u8682\u9a6c\u9a82\u561b\u5417\u551b\u72b8\u5b37\u6769\u9ebd", "mai": "\u57cb\u4e70\u9ea6\u5356\u8fc8\u8109\u52a2\u836c\u54aa\u973e", "man": "\u7792\u9992\u86ee\u6ee1\u8513\u66fc\u6162\u6f2b\u8c29\u5881\u5e54\u7f26\u71b3\u9558\u989f\u87a8\u9cd7\u9794", "mang": "\u8292\u832b\u76f2\u5fd9\u83bd\u9099\u6f2d\u6726\u786d\u87d2", "meng": "\u6c13\u840c\u8499\u6aac\u76df\u9530\u731b\u68a6\u5b5f\u52d0\u750d\u77a2\u61f5\u791e\u867b\u8722\u8813\u824b\u8268\u9efe", "miao": "\u732b\u82d7\u63cf\u7784\u85d0\u79d2\u6e3a\u5e99\u5999\u55b5\u9088\u7f08\u7f2a\u676a\u6dfc\u7707\u9e4b\u8731", "mao": "\u8305\u951a\u6bdb\u77db\u94c6\u536f\u8302\u5192\u5e3d\u8c8c\u8d38\u4f94\u88a4\u52d6\u8306\u5cc1\u7441\u6634\u7266\u8004\u65c4\u61cb\u7780\u86d1\u8765\u87ca\u9ae6", "me": "\u4e48", "mei": "\u73ab\u679a\u6885\u9176\u9709\u7164\u6ca1\u7709\u5a92\u9541\u6bcf\u7f8e\u6627\u5bd0\u59b9\u5a9a\u5776\u8393\u5d4b\u7338\u6d7c\u6e44\u6963\u9545\u9e5b\u8882\u9b45", "men": "\u95e8\u95f7\u4eec\u626a\u739f\u7116\u61d1\u9494", "mi": "\u772f\u919a\u9761\u7cdc\u8ff7\u8c1c\u5f25\u7c73\u79d8\u89c5\u6ccc\u871c\u5bc6\u5e42\u8288\u5196\u8c27\u863c\u5627\u7315\u736f\u6c68\u5b93\u5f2d\u8112\u6549\u7cf8\u7e3b\u9e8b", "mian": "\u68c9\u7720\u7ef5\u5195\u514d\u52c9\u5a29\u7f05\u9762\u6c94\u6e4e\u817c\u7704", "mie": "\u8511\u706d\u54a9\u881b\u7bfe", "min": "\u6c11\u62bf\u76bf\u654f\u60af\u95fd\u82e0\u5cb7\u95f5\u6cef\u73c9", "ming": "\u660e\u879f\u9e23\u94ed\u540d\u547d\u51a5\u8317\u6e9f\u669d\u7791\u9169", "miu": "\u8c2c", "mo": "\u6478\u6479\u8611\u6a21\u819c\u78e8\u6469\u9b54\u62b9\u672b\u83ab\u58a8\u9ed8\u6cab\u6f20\u5bde\u964c\u8c1f\u8309\u84e6\u998d\u5aeb\u9546\u79e3\u763c\u8031\u87c6\u8c8a\u8c98", "mou": "\u8c0b\u725f\u67d0\u53b6\u54de\u5a7a\u7738\u936a", "mu": "\u62c7\u7261\u4ea9\u59c6\u6bcd\u5893\u66ae\u5e55\u52df\u6155\u6728\u76ee\u7766\u7267\u7a46\u4eeb\u82dc\u5452\u6c90\u6bea\u94bc", "na": "\u62ff\u54ea\u5450\u94a0\u90a3\u5a1c\u7eb3\u5185\u637a\u80ad\u954e\u8872\u7bac", "nai": "\u6c16\u4e43\u5976\u8010\u5948\u9f10\u827f\u8418\u67f0", "nan": "\u5357\u7537\u96be\u56ca\u5583\u56e1\u6960\u8169\u877b\u8d67", "nao": "\u6320\u8111\u607c\u95f9\u5b6c\u57b4\u7331\u7459\u7847\u94d9\u86f2", "ne": "\u6dd6\u5462\u8bb7", "nei": "\u9981", "nen": "\u5ae9\u80fd\u6798\u6041", "ni": "\u59ae\u9713\u502a\u6ce5\u5c3c\u62df\u4f60\u533f\u817b\u9006\u6eba\u4f32\u576d\u730a\u6029\u6ee0\u6635\u65ce\u7962\u615d\u7768\u94cc\u9cb5", "nian": "\u852b\u62c8\u5e74\u78be\u64b5\u637b\u5ff5\u5eff\u8f87\u9ecf\u9c87\u9cb6", "niang": "\u5a18\u917f", "niao": "\u9e1f\u5c3f\u8311\u5b32\u8132\u8885", "nie": "\u634f\u8042\u5b7d\u556e\u954a\u954d\u6d85\u4e5c\u9667\u8616\u55eb\u8080\u989e\u81ec\u8e51", "nin": "\u60a8\u67e0", "ning": "\u72de\u51dd\u5b81\u62e7\u6cde\u4f5e\u84e5\u549b\u752f\u804d", "niu": "\u725b\u626d\u94ae\u7ebd\u72c3\u5ff8\u599e\u86b4", "nong": "\u8113\u6d53\u519c\u4fac", "nu": "\u5974\u52aa\u6012\u5476\u5e11\u5f29\u80ec\u5b65\u9a7d", "nv": "\u5973\u6067\u9495\u8844", "nuan": "\u6696", "nuenue": "\u8650", "nue": "\u759f\u8c11", "nuo": "\u632a\u61e6\u7cef\u8bfa\u50a9\u6426\u558f\u9518", "ou": "\u54e6\u6b27\u9e25\u6bb4\u85d5\u5455\u5076\u6ca4\u6004\u74ef\u8026", "pa": "\u556a\u8db4\u722c\u5e15\u6015\u7436\u8469\u7b62", "pai": "\u62cd\u6392\u724c\u5f98\u6e43\u6d3e\u4ff3\u848e", "pan": "\u6500\u6f58\u76d8\u78d0\u76fc\u7554\u5224\u53db\u723f\u6cee\u88a2\u897b\u87e0\u8e52", "pang": "\u4e53\u5e9e\u65c1\u802a\u80d6\u6ec2\u9004", "pao": "\u629b\u5486\u5228\u70ae\u888d\u8dd1\u6ce1\u530f\u72cd\u5e96\u812c\u75b1", "pei": "\u5478\u80da\u57f9\u88f4\u8d54\u966a\u914d\u4f69\u6c9b\u638a\u8f94\u5e14\u6de0\u65c6\u952b\u9185\u9708", "pen": "\u55b7\u76c6\u6e53", "peng": "\u7830\u62a8\u70f9\u6f8e\u5f6d\u84ec\u68da\u787c\u7bf7\u81a8\u670b\u9e4f\u6367\u78b0\u576f\u580b\u562d\u6026\u87db", "pi": "\u7812\u9739\u6279\u62ab\u5288\u7435\u6bd7\u5564\u813e\u75b2\u76ae\u5339\u75de\u50fb\u5c41\u8b6c\u4e15\u9674\u90b3\u90eb\u572e\u9f19\u64d7\u567c\u5e80\u5ab2\u7eb0\u6787\u7513\u7765\u7f74\u94cd\u75e6\u7656\u758b\u868d\u8c94", "pian": "\u7bc7\u504f\u7247\u9a97\u8c1d\u9a88\u728f\u80fc\u890a\u7fe9\u8e41", "piao": "\u98d8\u6f02\u74e2\u7968\u527d\u560c\u5ad6\u7f25\u6b8d\u779f\u87b5", "pie": "\u6487\u77a5\u4e3f\u82e4\u6c15", "pin": "\u62fc\u9891\u8d2b\u54c1\u8058\u62da\u59d8\u5ad4\u6980\u725d\u98a6", "ping": "\u4e52\u576a\u82f9\u840d\u5e73\u51ed\u74f6\u8bc4\u5c4f\u4fdc\u5a09\u67b0\u9c86", "po": "\u5761\u6cfc\u9887\u5a46\u7834\u9b44\u8feb\u7c95\u53f5\u9131\u6ea5\u73c0\u948b\u94b7\u76a4\u7b38", "pou": "\u5256\u88d2\u8e23", "pu": "\u6251\u94fa\u4ec6\u8386\u8461\u83e9\u84b2\u57d4\u6734\u5703\u666e\u6d66\u8c31\u66dd\u7011\u530d\u5657\u6fee\u749e\u6c06\u9564\u9568\u8e7c", "qi": "\u671f\u6b3a\u6816\u621a\u59bb\u4e03\u51c4\u6f06\u67d2\u6c8f\u5176\u68cb\u5947\u6b67\u7566\u5d0e\u8110\u9f50\u65d7\u7948\u7941\u9a91\u8d77\u5c82\u4e5e\u4f01\u542f\u5951\u780c\u5668\u6c14\u8fc4\u5f03\u6c7d\u6ce3\u8bab\u4e9f\u4e93\u573b\u8291\u840b\u847a\u5601\u5c7a\u5c90\u6c54\u6dc7\u9a90\u7eee\u742a\u7426\u675e\u6864\u69ed\u6b39\u797a\u61a9\u789b\u86f4\u871e\u7da6\u7dae\u8dbf\u8e4a\u9ccd\u9e92", "qia": "\u6390\u6070\u6d3d\u845c", "qian": "\u7275\u6266\u948e\u94c5\u5343\u8fc1\u7b7e\u4edf\u8c26\u4e7e\u9ed4\u94b1\u94b3\u524d\u6f5c\u9063\u6d45\u8c34\u5811\u5d4c\u6b20\u6b49\u4f65\u9621\u828a\u82a1\u8368\u63ae\u5c8d\u60ad\u614a\u9a9e\u6434\u8930\u7f31\u6920\u80b7\u6106\u94a4\u8654\u7b9d", "qiang": "\u67aa\u545b\u8154\u7f8c\u5899\u8537\u5f3a\u62a2\u5af1\u6a2f\u6217\u709d\u9516\u9535\u956a\u8941\u8723\u7f9f\u8deb\u8dc4", "qiao": "\u6a47\u9539\u6572\u6084\u6865\u77a7\u4e54\u4fa8\u5de7\u9798\u64ac\u7fd8\u5ced\u4fcf\u7a8d\u5281\u8bee\u8c2f\u835e\u6100\u6194\u7f32\u6a35\u6bf3\u7857\u8df7\u9792", "qie": "\u5207\u8304\u4e14\u602f\u7a83\u90c4\u553c\u60ec\u59be\u6308\u9532\u7ba7", "qin": "\u94a6\u4fb5\u4eb2\u79e6\u7434\u52e4\u82b9\u64d2\u79bd\u5bdd\u6c81\u82a9\u84c1\u8572\u63ff\u5423\u55ea\u5659\u6eb1\u6a8e\u8793\u887e", "qing": "\u9752\u8f7b\u6c22\u503e\u537f\u6e05\u64ce\u6674\u6c30\u60c5\u9877\u8bf7\u5e86\u5029\u82d8\u570a\u6aa0\u78ec\u873b\u7f44\u7b90\u8b26\u9cad\u9ee5", "qiong": "\u743c\u7a77\u909b\u8315\u7a79\u7b47\u928e", "qiu": "\u79cb\u4e18\u90b1\u7403\u6c42\u56da\u914b\u6cc5\u4fc5\u6c3d\u5def\u827d\u72b0\u6e6b\u9011\u9052\u6978\u8d47\u9e20\u866c\u86af\u8764\u88d8\u7cd7\u9cc5\u9f3d", "qu": "\u8d8b\u533a\u86c6\u66f2\u8eaf\u5c48\u9a71\u6e20\u53d6\u5a36\u9f8b\u8da3\u53bb\u8bce\u52ac\u8556\u8627\u5c96\u8862\u9612\u74a9\u89d1\u6c0d\u795b\u78f2\u766f\u86d0\u883c\u9eb4\u77bf\u9ee2", "quan": "\u5708\u98a7\u6743\u919b\u6cc9\u5168\u75ca\u62f3\u72ac\u5238\u529d\u8be0\u8343\u737e\u609b\u7efb\u8f81\u754e\u94e8\u8737\u7b4c\u9b08", "que": "\u7f3a\u7094\u7638\u5374\u9e4a\u69b7\u786e\u96c0\u9619\u60ab", "qun": "\u88d9\u7fa4\u9021", "ran": "\u7136\u71c3\u5189\u67d3\u82d2\u9aef", "rang": "\u74e4\u58e4\u6518\u56b7\u8ba9\u79b3\u7a70", "rao": "\u9976\u6270\u7ed5\u835b\u5a06\u6861", "ruo": "\u60f9\u82e5\u5f31", "re": "\u70ed\u504c", "ren": "\u58ec\u4ec1\u4eba\u5fcd\u97e7\u4efb\u8ba4\u5203\u598a\u7eab\u4ede\u834f\u845a\u996a\u8f6b\u7a14\u887d", "reng": "\u6254\u4ecd", "ri": "\u65e5", "rong": "\u620e\u8338\u84c9\u8363\u878d\u7194\u6eb6\u5bb9\u7ed2\u5197\u5d58\u72e8\u7f1b\u6995\u877e", "rou": "\u63c9\u67d4\u8089\u7cc5\u8e42\u97a3", "ru": "\u8339\u8815\u5112\u5b7a\u5982\u8fb1\u4e73\u6c5d\u5165\u8925\u84d0\u85b7\u5685\u6d33\u6ebd\u6fe1\u94f7\u8966\u98a5", "ruan": "\u8f6f\u962e\u670a", "rui": "\u854a\u745e\u9510\u82ae\u8564\u777f\u868b", "run": "\u95f0\u6da6", "sa": "\u6492\u6d12\u8428\u5345\u4ee8\u6332\u98d2", "sai": "\u816e\u9cc3\u585e\u8d5b\u567b", "san": "\u4e09\u53c1\u4f1e\u6563\u5f61\u9993\u6c35\u6bf5\u7cc1\u9730", "sang": "\u6851\u55d3\u4e27\u6421\u78c9\u98a1", "sao": "\u6414\u9a9a\u626b\u5ac2\u57fd\u81ca\u7619\u9ccb", "se": "\u745f\u8272\u6da9\u556c\u94e9\u94ef\u7a51", "sen": "\u68ee", "seng": "\u50e7", "sha": "\u838e\u7802\u6740\u5239\u6c99\u7eb1\u50bb\u5565\u715e\u810e\u6b43\u75e7\u88df\u970e\u9ca8", "shai": "\u7b5b\u6652\u917e", "shan": "\u73ca\u82eb\u6749\u5c71\u5220\u717d\u886b\u95ea\u9655\u64c5\u8d61\u81b3\u5584\u6c55\u6247\u7f2e\u5261\u8baa\u912f\u57cf\u829f\u6f78\u59d7\u9a9f\u81bb\u9490\u759d\u87ee\u8222\u8dda\u9cdd", "shang": "\u5892\u4f24\u5546\u8d4f\u664c\u4e0a\u5c1a\u88f3\u57a7\u7ef1\u6b87\u71b5\u89de", "shao": "\u68a2\u634e\u7a0d\u70e7\u828d\u52fa\u97f6\u5c11\u54e8\u90b5\u7ecd\u52ad\u82d5\u6f72\u86f8\u7b24\u7b72\u8244", "she": "\u5962\u8d4a\u86c7\u820c\u820d\u8d66\u6444\u5c04\u6151\u6d89\u793e\u8bbe\u538d\u4f58\u731e\u7572\u9e9d", "shen": "\u7837\u7533\u547b\u4f38\u8eab\u6df1\u5a20\u7ec5\u795e\u6c88\u5ba1\u5a76\u751a\u80be\u614e\u6e17\u8bdc\u8c02\u5432\u54c2\u6e16\u6939\u77e7\u8703", "sheng": "\u58f0\u751f\u7525\u7272\u5347\u7ef3\u7701\u76db\u5269\u80dc\u5723\u4e1e\u6e11\u5ab5\u771a\u7b19", "shi": "\u5e08\u5931\u72ee\u65bd\u6e7f\u8bd7\u5c38\u8671\u5341\u77f3\u62fe\u65f6\u4ec0\u98df\u8680\u5b9e\u8bc6\u53f2\u77e2\u4f7f\u5c4e\u9a76\u59cb\u5f0f\u793a\u58eb\u4e16\u67ff\u4e8b\u62ed\u8a93\u901d\u52bf\u662f\u55dc\u566c\u9002\u4ed5\u4f8d\u91ca\u9970\u6c0f\u5e02\u6043\u5ba4\u89c6\u8bd5\u8c25\u57d8\u83b3\u84cd\u5f11\u5511\u9963\u8f7c\u8006\u8d33\u70bb\u793b\u94c8\u94ca\u87ab\u8210\u7b6e\u8c55\u9ca5\u9cba", "shou": "\u6536\u624b\u9996\u5b88\u5bff\u6388\u552e\u53d7\u7626\u517d\u624c\u72e9\u7ef6\u824f", "shu": "\u852c\u67a2\u68b3\u6b8a\u6292\u8f93\u53d4\u8212\u6dd1\u758f\u4e66\u8d4e\u5b70\u719f\u85af\u6691\u66d9\u7f72\u8700\u9ecd\u9f20\u5c5e\u672f\u8ff0\u6811\u675f\u620d\u7ad6\u5885\u5eb6\u6570\u6f31\u6055\u500f\u587e\u83fd\u5fc4\u6cad\u6d91\u6f8d\u59dd\u7ebe\u6bf9\u8167\u6bb3\u956f\u79eb\u9e6c", "shua": "\u5237\u800d\u5530\u6dae", "shuai": "\u6454\u8870\u7529\u5e05\u87c0", "shuan": "\u6813\u62f4\u95e9", "shuang": "\u971c\u53cc\u723d\u5b40", "shui": "\u8c01\u6c34\u7761\u7a0e", "shun": "\u542e\u77ac\u987a\u821c\u6042", "shuo": "\u8bf4\u7855\u6714\u70c1\u84b4\u6420\u55cd\u6fef\u5981\u69ca\u94c4", "si": "\u65af\u6495\u5636\u601d\u79c1\u53f8\u4e1d\u6b7b\u8086\u5bfa\u55e3\u56db\u4f3a\u4f3c\u9972\u5df3\u53ae\u4fdf\u5155\u83e5\u549d\u6c5c\u6cd7\u6f8c\u59d2\u9a77\u7f0c\u7940\u7960\u9536\u9e36\u801c\u86f3\u7b25", "song": "\u677e\u8038\u6002\u9882\u9001\u5b8b\u8bbc\u8bf5\u51c7\u83d8\u5d27\u5d69\u5fea\u609a\u6dde\u7ae6", "sou": "\u641c\u8258\u64de\u55fd\u53df\u55d6\u55fe\u998a\u6eb2\u98d5\u778d\u953c\u878b", "su": "\u82cf\u9165\u4fd7\u7d20\u901f\u7c9f\u50f3\u5851\u6eaf\u5bbf\u8bc9\u8083\u5919\u8c21\u850c\u55c9\u612b\u7c0c\u89eb\u7a23", "suan": "\u9178\u849c\u7b97", "sui": "\u867d\u968b\u968f\u7ee5\u9ad3\u788e\u5c81\u7a57\u9042\u96a7\u795f\u84d1\u51ab\u8c07\u6fc9\u9083\u71e7\u772d\u7762", "sun": "\u5b59\u635f\u7b0b\u836a\u72f2\u98e7\u69ab\u8de3\u96bc", "suo": "\u68ad\u5506\u7f29\u7410\u7d22\u9501\u6240\u5522\u55e6\u5a11\u686b\u7743\u7fa7", "ta": "\u584c\u4ed6\u5b83\u5979\u5854\u736d\u631e\u8e4b\u8e0f\u95fc\u6ebb\u9062\u69bb\u6c93", "tai": "\u80ce\u82d4\u62ac\u53f0\u6cf0\u915e\u592a\u6001\u6c70\u90b0\u85b9\u80bd\u70b1\u949b\u8dc6\u9c90", "tan": "\u574d\u644a\u8d2a\u762b\u6ee9\u575b\u6a80\u75f0\u6f6d\u8c2d\u8c08\u5766\u6bef\u8892\u78b3\u63a2\u53f9\u70ad\u90ef\u8548\u6619\u94bd\u952c\u8983", "tang": "\u6c64\u5858\u642a\u5802\u68e0\u819b\u5510\u7cd6\u50a5\u9967\u6e8f\u746d\u94f4\u9557\u8025\u8797\u87b3\u7fb0\u91a3", "thang": "\u5018\u8eba\u6dcc", "theng": "\u8d9f\u70eb", "tao": "\u638f\u6d9b\u6ed4\u7ee6\u8404\u6843\u9003\u6dd8\u9676\u8ba8\u5957\u6311\u9f17\u5555\u97ec\u9955", "te": "\u7279", "teng": "\u85e4\u817e\u75bc\u8a8a\u6ed5", "ti": "\u68af\u5254\u8e22\u9511\u63d0\u9898\u8e44\u557c\u4f53\u66ff\u568f\u60d5\u6d95\u5243\u5c49\u8351\u608c\u9016\u7ee8\u7f07\u9e48\u88fc\u918d", "tian": "\u5929\u6dfb\u586b\u7530\u751c\u606c\u8214\u8146\u63ad\u5fdd\u9617\u6b84\u754b\u94bf\u86ba", "tiao": "\u6761\u8fe2\u773a\u8df3\u4f7b\u7967\u94eb\u7a95\u9f86\u9ca6", "tie": "\u8d34\u94c1\u5e16\u841c\u992e", "ting": "\u5385\u542c\u70c3\u6c40\u5ef7\u505c\u4ead\u5ead\u633a\u8247\u839b\u8476\u5a77\u6883\u8713\u9706", "tong": "\u901a\u6850\u916e\u77b3\u540c\u94dc\u5f64\u7ae5\u6876\u6345\u7b52\u7edf\u75db\u4f5f\u50ee\u4edd\u833c\u55f5\u6078\u6f7c\u783c", "tou": "\u5077\u6295\u5934\u900f\u4ea0", "tu": "\u51f8\u79c3\u7a81\u56fe\u5f92\u9014\u6d82\u5c60\u571f\u5410\u5154\u580d\u837c\u83df\u948d\u9174", "tuan": "\u6e4d\u56e2\u7583", "tui": "\u63a8\u9893\u817f\u8715\u892a\u9000\u5fd2\u717a", "tun": "\u541e\u5c6f\u81c0\u9968\u66be\u8c5a\u7a80", "tuo": "\u62d6\u6258\u8131\u9e35\u9640\u9a6e\u9a7c\u692d\u59a5\u62d3\u553e\u4e47\u4f57\u5768\u5eb9\u6cb1\u67dd\u7823\u7ba8\u8204\u8dce\u9f0d", "wa": "\u6316\u54c7\u86d9\u6d3c\u5a03\u74e6\u889c\u4f64\u5a32\u817d", "wai": "\u6b6a\u5916", "wan": "\u8c4c\u5f2f\u6e7e\u73a9\u987d\u4e38\u70f7\u5b8c\u7897\u633d\u665a\u7696\u60cb\u5b9b\u5a49\u4e07\u8155\u525c\u8284\u82cb\u83c0\u7ea8\u7efe\u742c\u8118\u7579\u873f\u7ba2", "wang": "\u6c6a\u738b\u4ea1\u6789\u7f51\u5f80\u65fa\u671b\u5fd8\u5984\u7f54\u5c22\u60d8\u8f8b\u9b4d", "wei": "\u5a01\u5dcd\u5fae\u5371\u97e6\u8fdd\u6845\u56f4\u552f\u60df\u4e3a\u6f4d\u7ef4\u82c7\u840e\u59d4\u4f1f\u4f2a\u5c3e\u7eac\u672a\u851a\u5473\u754f\u80c3\u5582\u9b4f\u4f4d\u6e2d\u8c13\u5c09\u6170\u536b\u502d\u504e\u8bff\u9688\u8473\u8587\u5e0f\u5e37\u5d34\u5d6c\u7325\u732c\u95f1\u6ca9\u6d27\u6da0\u9036\u5a13\u73ae\u97ea\u8ece\u709c\u7168\u71a8\u75ff\u8249\u9c94", "wen": "\u761f\u6e29\u868a\u6587\u95fb\u7eb9\u543b\u7a33\u7d0a\u95ee\u520e\u6120\u960c\u6c76\u74ba\u97eb\u6b81\u96ef", "weng": "\u55e1\u7fc1\u74ee\u84ca\u8579", "wo": "\u631d\u8717\u6da1\u7a9d\u6211\u65a1\u5367\u63e1\u6c83\u83b4\u5e44\u6e25\u674c\u809f\u9f8c", "wu": "\u5deb\u545c\u94a8\u4e4c\u6c61\u8bec\u5c4b\u65e0\u829c\u68a7\u543e\u5434\u6bcb\u6b66\u4e94\u6342\u5348\u821e\u4f0d\u4fae\u575e\u620a\u96fe\u6664\u7269\u52ff\u52a1\u609f\u8bef\u5140\u4ef5\u9622\u90ac\u572c\u82b4\u5e91\u6003\u5fe4\u6d6f\u5be4\u8fd5\u59a9\u9a9b\u727e\u7110\u9e49\u9e5c\u8708\u92c8\u9f2f", "xi": "\u6614\u7199\u6790\u897f\u7852\u77fd\u6670\u563b\u5438\u9521\u727a\u7a00\u606f\u5e0c\u6089\u819d\u5915\u60dc\u7184\u70ef\u6eaa\u6c50\u7280\u6a84\u88ad\u5e2d\u4e60\u5ab3\u559c\u94e3\u6d17\u7cfb\u9699\u620f\u7ec6\u50d6\u516e\u96b0\u90d7\u831c\u8478\u84f0\u595a\u550f\u5f99\u9969\u960b\u6d60\u6dc5\u5c63\u5b09\u73ba\u6a28\u66e6\u89cb\u6b37\u71b9\u798a\u79a7\u94b8\u7699\u7a78\u8725\u87cb\u823e\u7fb2\u7c9e\u7fd5\u91af\u9f37", "xia": "\u778e\u867e\u5323\u971e\u8f96\u6687\u5ce1\u4fa0\u72ed\u4e0b\u53a6\u590f\u5413\u6380\u846d\u55c4\u72ce\u9050\u7455\u7856\u7615\u7f45\u9ee0", "xian": "\u9528\u5148\u4ed9\u9c9c\u7ea4\u54b8\u8d24\u8854\u8237\u95f2\u6d8e\u5f26\u5acc\u663e\u9669\u73b0\u732e\u53bf\u817a\u9985\u7fa1\u5baa\u9677\u9650\u7ebf\u51bc\u85d3\u5c98\u7303\u66b9\u5a34\u6c19\u7946\u9e47\u75eb\u86ac\u7b45\u7c7c\u9170\u8df9", "xiang": "\u76f8\u53a2\u9576\u9999\u7bb1\u8944\u6e58\u4e61\u7fd4\u7965\u8be6\u60f3\u54cd\u4eab\u9879\u5df7\u6a61\u50cf\u5411\u8c61\u8297\u8459\u9977\u5ea0\u9aa7\u7f03\u87d3\u9c9e\u98e8", "xiao": "\u8427\u785d\u9704\u524a\u54ee\u56a3\u9500\u6d88\u5bb5\u6dc6\u6653\u5c0f\u5b5d\u6821\u8096\u5578\u7b11\u6548\u54d3\u54bb\u5d24\u6f47\u900d\u9a81\u7ee1\u67ad\u67b5\u7b71\u7bab\u9b48", "xie": "\u6954\u4e9b\u6b47\u874e\u978b\u534f\u631f\u643a\u90aa\u659c\u80c1\u8c10\u5199\u68b0\u5378\u87f9\u61c8\u6cc4\u6cfb\u8c22\u5c51\u5055\u4eb5\u52f0\u71ee\u85a4\u64b7\u5ee8\u7023\u9082\u7ec1\u7f2c\u69ad\u698d\u6b59\u8e9e", "xin": "\u85aa\u82af\u950c\u6b23\u8f9b\u65b0\u5ffb\u5fc3\u4fe1\u8845\u56df\u99a8\u8398\u6b46\u94fd\u946b", "xing": "\u661f\u8165\u7329\u60fa\u5174\u5211\u578b\u5f62\u90a2\u884c\u9192\u5e78\u674f\u6027\u59d3\u9649\u8347\u8365\u64e4\u60bb\u784e", "xiong": "\u5144\u51f6\u80f8\u5308\u6c79\u96c4\u718a\u828e", "xiu": "\u4f11\u4fee\u7f9e\u673d\u55c5\u9508\u79c0\u8896\u7ee3\u83a0\u5cab\u9990\u5ea5\u9e3a\u8c85\u9af9", "xu": "\u589f\u620c\u9700\u865a\u5618\u987b\u5f90\u8bb8\u84c4\u9157\u53d9\u65ed\u5e8f\u755c\u6064\u7d6e\u5a7f\u7eea\u7eed\u8bb4\u8be9\u5729\u84ff\u6035\u6d2b\u6e86\u987c\u6829\u7166\u7809\u76f1\u80e5\u7cc8\u9191", "xuan": "\u8f69\u55a7\u5ba3\u60ac\u65cb\u7384\u9009\u7663\u7729\u7eda\u5107\u8c16\u8431\u63ce\u9994\u6ceb\u6d35\u6e32\u6f29\u7487\u6966\u6684\u70ab\u714a\u78b9\u94c9\u955f\u75c3", "xue": "\u9774\u859b\u5b66\u7a74\u96ea\u8840\u5671\u6cf6\u9cd5", "xun": "\u52cb\u718f\u5faa\u65ec\u8be2\u5bfb\u9a6f\u5de1\u6b89\u6c5b\u8bad\u8baf\u900a\u8fc5\u5dfd\u57d9\u8340\u85b0\u5ccb\u5f87\u6d54\u66db\u7aa8\u91ba\u9c9f", "ya": "\u538b\u62bc\u9e26\u9e2d\u5440\u4e2b\u82bd\u7259\u869c\u5d16\u8859\u6daf\u96c5\u54d1\u4e9a\u8bb6\u4f22\u63e0\u5416\u5c88\u8fd3\u5a05\u740a\u6860\u6c29\u7811\u775a\u75d6", "yan": "\u7109\u54bd\u9609\u70df\u6df9\u76d0\u4e25\u7814\u8712\u5ca9\u5ef6\u8a00\u989c\u960e\u708e\u6cbf\u5944\u63a9\u773c\u884d\u6f14\u8273\u5830\u71d5\u538c\u781a\u96c1\u5501\u5f66\u7130\u5bb4\u8c1a\u9a8c\u53a3\u9765\u8d5d\u4fe8\u5043\u5156\u8ba0\u8c33\u90fe\u9122\u82ab\u83f8\u5d26\u6079\u95eb\u960f\u6d07\u6e6e\u6edf\u598d\u5ae3\u7430\u664f\u80ed\u814c\u7131\u7f68\u7b75\u917d\u9b47\u990d\u9f39", "yang": "\u6b83\u592e\u9e2f\u79e7\u6768\u626c\u4f6f\u75a1\u7f8a\u6d0b\u9633\u6c27\u4ef0\u75d2\u517b\u6837\u6f3e\u5f89\u600f\u6cf1\u7080\u70ca\u6059\u86d8\u9785", "yao": "\u9080\u8170\u5996\u7476\u6447\u5c27\u9065\u7a91\u8c23\u59da\u54ac\u8200\u836f\u8981\u8000\u592d\u723b\u5406\u5d3e\u5fad\u7039\u5e7a\u73e7\u6773\u66dc\u80b4\u9e5e\u7a88\u7e47\u9cd0", "ye": "\u6930\u564e\u8036\u7237\u91ce\u51b6\u4e5f\u9875\u6396\u4e1a\u53f6\u66f3\u814b\u591c\u6db2\u8c12\u90ba\u63f6\u9980\u6654\u70e8\u94d8", "yi": "\u4e00\u58f9\u533b\u63d6\u94f1\u4f9d\u4f0a\u8863\u9890\u5937\u9057\u79fb\u4eea\u80f0\u7591\u6c82\u5b9c\u59e8\u5f5d\u6905\u8681\u501a\u5df2\u4e59\u77e3\u4ee5\u827a\u6291\u6613\u9091\u5c79\u4ebf\u5f79\u81c6\u9038\u8084\u75ab\u4ea6\u88d4\u610f\u6bc5\u5fc6\u4e49\u76ca\u6ea2\u8be3\u8bae\u8c0a\u8bd1\u5f02\u7ffc\u7fcc\u7ece\u5208\u5293\u4f7e\u8bd2\u572a\u572f\u57f8\u61ff\u82e1\u858f\u5f08\u5955\u6339\u5f0b\u5453\u54a6\u54bf\u566b\u5cc4\u5db7\u7317\u9974\u603f\u6021\u6092\u6f2a\u8fe4\u9a7f\u7f22\u6baa\u8d3b\u65d6\u71a0\u9487\u9552\u9571\u75cd\u7617\u7654\u7fca\u8864\u8734\u8223\u7fbf\u7ff3\u914f\u9edf", "yin": "\u8335\u836b\u56e0\u6bb7\u97f3\u9634\u59fb\u541f\u94f6\u6deb\u5bc5\u996e\u5c39\u5f15\u9690\u5370\u80e4\u911e\u5819\u831a\u5591\u72fa\u5924\u6c24\u94df\u763e\u8693\u972a\u9f88", "ying": "\u82f1\u6a31\u5a74\u9e70\u5e94\u7f28\u83b9\u8424\u8425\u8367\u8747\u8fce\u8d62\u76c8\u5f71\u9896\u786c\u6620\u5b34\u90e2\u8314\u83ba\u8426\u6484\u5624\u81ba\u6ee2\u6f46\u701b\u745b\u748e\u6979\u9e66\u763f\u988d\u7f42", "yo": "\u54df\u5537", "yong": "\u62e5\u4f63\u81c3\u75c8\u5eb8\u96cd\u8e0a\u86f9\u548f\u6cf3\u6d8c\u6c38\u607f\u52c7\u7528\u4fd1\u58c5\u5889\u6175\u9095\u955b\u752c\u9cd9\u9954", "you": "\u5e7d\u4f18\u60a0\u5fe7\u5c24\u7531\u90ae\u94c0\u72b9\u6cb9\u6e38\u9149\u6709\u53cb\u53f3\u4f51\u91c9\u8bf1\u53c8\u5e7c\u5363\u6538\u4f91\u83b8\u5466\u56ff\u5ba5\u67da\u7337\u7256\u94d5\u75a3\u8763\u9c7f\u9edd\u9f2c", "yu": "\u8fc2\u6de4\u4e8e\u76c2\u6986\u865e\u611a\u8206\u4f59\u4fde\u903e\u9c7c\u6109\u6e1d\u6e14\u9685\u4e88\u5a31\u96e8\u4e0e\u5c7f\u79b9\u5b87\u8bed\u7fbd\u7389\u57df\u828b\u90c1\u5401\u9047\u55bb\u5cea\u5fa1\u6108\u6b32\u72f1\u80b2\u8a89\u6d74\u5bd3\u88d5\u9884\u8c6b\u9a6d\u79ba\u6bd3\u4f1b\u4fe3\u8c00\u8c15\u8438\u84e3\u63c4\u5581\u5704\u5709\u5d5b\u72f3\u996b\u5ebe\u9608\u59aa\u59a4\u7ea1\u745c\u6631\u89ce\u8174\u6b24\u65bc\u715c\u71e0\u807f\u94b0\u9e46\u7610\u7600\u7ab3\u8753\u7afd\u8201\u96e9\u9f89", "yuan": "\u9e33\u6e0a\u51a4\u5143\u57a3\u8881\u539f\u63f4\u8f95\u56ed\u5458\u5706\u733f\u6e90\u7f18\u8fdc\u82d1\u613f\u6028\u9662\u586c\u6c85\u5a9b\u7457\u6a7c\u7230\u7722\u9e22\u8788\u9f0b", "yue": "\u66f0\u7ea6\u8d8a\u8dc3\u94a5\u5cb3\u7ca4\u6708\u60a6\u9605\u9fa0\u6a3e\u5216\u94ba", "yun": "\u8018\u4e91\u90e7\u5300\u9668\u5141\u8fd0\u8574\u915d\u6655\u97f5\u5b55\u90d3\u82b8\u72c1\u607d\u7ead\u6b92\u6600\u6c32", "za": "\u531d\u7838\u6742\u62f6\u5482", "zai": "\u683d\u54c9\u707e\u5bb0\u8f7d\u518d\u5728\u54b1\u5d3d\u753e", "zan": "\u6512\u6682\u8d5e\u74d2\u661d\u7c2a\u7ccc\u8db1\u933e", "zang": "\u8d43\u810f\u846c\u5958\u6215\u81e7", "zao": "\u906d\u7cdf\u51ff\u85fb\u67a3\u65e9\u6fa1\u86a4\u8e81\u566a\u9020\u7682\u7076\u71e5\u5523\u7f2b", "ze": "\u8d23\u62e9\u5219\u6cfd\u4ec4\u8d5c\u5567\u8fee\u6603\u7b2e\u7ba6\u8234", "zei": "\u8d3c", "zen": "\u600e\u8c2e", "zeng": "\u589e\u618e\u66fe\u8d60\u7f2f\u7511\u7f7e\u9503", "zha": "\u624e\u55b3\u6e23\u672d\u8f67\u94e1\u95f8\u7728\u6805\u69a8\u548b\u4e4d\u70b8\u8bc8\u63f8\u5412\u54a4\u54f3\u600d\u781f\u75c4\u86b1\u9f44", "zhai": "\u6458\u658b\u5b85\u7a84\u503a\u5be8\u7826", "zhan": "\u77bb\u6be1\u8a79\u7c98\u6cbe\u76cf\u65a9\u8f97\u5d2d\u5c55\u8638\u6808\u5360\u6218\u7ad9\u6e5b\u7efd\u8c35\u640c\u65c3", "zhang": "\u6a1f\u7ae0\u5f70\u6f33\u5f20\u638c\u6da8\u6756\u4e08\u5e10\u8d26\u4ed7\u80c0\u7634\u969c\u4ec9\u9123\u5e5b\u5d82\u7350\u5adc\u748b\u87d1", "zhao": "\u62db\u662d\u627e\u6cbc\u8d75\u7167\u7f69\u5146\u8087\u53ec\u722a\u8bcf\u68f9\u948a\u7b0a", "zhe": "\u906e\u6298\u54f2\u86f0\u8f99\u8005\u9517\u8517\u8fd9\u6d59\u8c2a\u966c\u67d8\u8f84\u78d4\u9e67\u891a\u8707\u8d6d", "zhen": "\u73cd\u659f\u771f\u7504\u7827\u81fb\u8d1e\u9488\u4fa6\u6795\u75b9\u8bca\u9707\u632f\u9547\u9635\u7f1c\u6862\u699b\u8f78\u8d48\u80d7\u6715\u796f\u755b\u9e29", "zheng": "\u84b8\u6323\u7741\u5f81\u72f0\u4e89\u6014\u6574\u62ef\u6b63\u653f\u5e27\u75c7\u90d1\u8bc1\u8be4\u5ce5\u94b2\u94ee\u7b5d", "zhi": "\u829d\u679d\u652f\u5431\u8718\u77e5\u80a2\u8102\u6c41\u4e4b\u7ec7\u804c\u76f4\u690d\u6b96\u6267\u503c\u4f84\u5740\u6307\u6b62\u8dbe\u53ea\u65e8\u7eb8\u5fd7\u631a\u63b7\u81f3\u81f4\u7f6e\u5e1c\u5cd9\u5236\u667a\u79e9\u7a1a\u8d28\u7099\u75d4\u6ede\u6cbb\u7a92\u536e\u965f\u90c5\u57f4\u82b7\u646d\u5e19\u5fee\u5f58\u54ab\u9a98\u6809\u67b3\u6800\u684e\u8f75\u8f7e\u6534\u8d3d\u81a3\u7949\u7957\u9ef9\u96c9\u9e37\u75e3\u86ed\u7d77\u916f\u8dd6\u8e2c\u8e2f\u8c78\u89ef", "zhong": "\u4e2d\u76c5\u5fe0\u949f\u8877\u7ec8\u79cd\u80bf\u91cd\u4ef2\u4f17\u51a2\u953a\u87bd\u8202\u822f\u8e35", "zhou": "\u821f\u5468\u5dde\u6d32\u8bcc\u7ca5\u8f74\u8098\u5e1a\u5492\u76b1\u5b99\u663c\u9aa4\u5544\u7740\u501c\u8bf9\u836e\u9b3b\u7ea3\u80c4\u78a1\u7c40\u8233\u914e\u9cb7", "zhu": "\u73e0\u682a\u86db\u6731\u732a\u8bf8\u8bdb\u9010\u7af9\u70db\u716e\u62c4\u77a9\u5631\u4e3b\u8457\u67f1\u52a9\u86c0\u8d2e\u94f8\u7b51\u4f4f\u6ce8\u795d\u9a7b\u4f2b\u4f8f\u90be\u82ce\u8331\u6d19\u6e1a\u6f74\u9a7a\u677c\u69e0\u6a65\u70b7\u94e2\u75b0\u7603\u86b0\u7afa\u7bb8\u7fe5\u8e85\u9e88", "zhua": "\u6293", "zhuai": "\u62fd", "zhuan": "\u4e13\u7816\u8f6c\u64b0\u8d5a\u7bc6\u629f\u556d\u989b", "zhuang": "\u6869\u5e84\u88c5\u5986\u649e\u58ee\u72b6\u4e2c", "zhui": "\u690e\u9525\u8ffd\u8d58\u5760\u7f00\u8411\u9a93\u7f12", "zhun": "\u8c06\u51c6", "zhuo": "\u6349\u62d9\u5353\u684c\u7422\u8301\u914c\u707c\u6d4a\u502c\u8bfc\u5ef4\u855e\u64e2\u555c\u6d5e\u6dbf\u6753\u712f\u799a\u65ab", "zi": "\u5179\u54a8\u8d44\u59ff\u6ecb\u6dc4\u5b5c\u7d2b\u4ed4\u7c7d\u6ed3\u5b50\u81ea\u6e0d\u5b57\u8c18\u5d6b\u59ca\u5b73\u7f01\u6893\u8f8e\u8d40\u6063\u7726\u9531\u79ed\u8014\u7b2b\u7ca2\u89dc\u8a3e\u9cbb\u9aed", "zong": "\u9b03\u68d5\u8e2a\u5b97\u7efc\u603b\u7eb5\u8159\u7cbd", "zou": "\u90b9\u8d70\u594f\u63cd\u9139\u9cb0", "zu": "\u79df\u8db3\u5352\u65cf\u7956\u8bc5\u963b\u7ec4\u4fce\u83f9\u5550\u5f82\u9a75\u8e74", "zuan": "\u94bb\u7e82\u6525\u7f35", "zui": "\u5634\u9189\u6700\u7f6a", "zun": "\u5c0a\u9075\u6499\u6a3d\u9cdf", "zuo": "\u6628\u5de6\u4f50\u67de\u505a\u4f5c\u5750\u5ea7\u961d\u963c\u80d9\u795a\u9162", "cou": "\u85ae\u6971\u8f8f\u8160", "nang": "\u652e\u54dd\u56d4\u9995\u66e9", "o": "\u5594", "dia": "\u55f2", "chuai": "\u562c\u81aa\u8e39", "cen": "\u5c91\u6d94", "diu": "\u94e5", "nou": "\u8028", "fou": "\u7f36", "bia": "\u9adf" }; //在数据中搜索 function search(letter) { for (var name in py) { if (py.hasOwnProperty(name)) { if (py[name].indexOf(letter) != -1) { return toUCFirst(name); } } } return false; } //转换首字母大写 function toUCFirst(name) { var first = name.substr(0, 1).toUpperCase(); var spare = name.substr(1, name.length); return first + spare; // return first; } return { convert: function (words) { var long = words.length; var result = ''; var reg = new RegExp('[a-zA-Z0-9\- ]'); for (var i = 0, letter, name; i < long; i++) { letter = words.substr(i, 1); if (reg.test(letter)) { result += letter; } else { name = search(letter); if (name !== false) { result += name; } } } return result.replace(/[ -]+/g, '-'); } } })(); if (typeof(exports) == 'object') { exports.PinYin = PinYin; }
(function ($) { $.fn.dnnModuleDragDrop = function (options) { var isEditMode = $('body').hasClass('dnnEditState'); if (!isEditMode) { $(function () { $('.DNNEmptyPane').each(function () { $(this).removeClass('DNNEmptyPane').addClass('dnnDropEmptyPanes'); }); $('.contentPane').each(function () { // this special code is for you -- IE8 this.className = this.className; }); }); return this; } //Default settings var settings = { actionMenu: "div.actionMenu", cursor: "move", draggingHintText: "DraggingHintText", dragHintText: "DragHintText", dropOnEmpty: true, dropHintText: "DropHintText", dropTargetText: "DropModuleText" }; settings = $.extend(settings, options || {}); var $self = this; var paneModuleIndex; var modulePaneName; var tabId = settings.tabId; var mid; var $modules = $('.DnnModule'); var $module; var getModuleId = function ($mod) { return $mod.find("a").first().attr("name"); }; var getModuleIndex = function (moduleId, $pane) { var index = -1; var modules = $pane.children(".DnnModule"); for (var i = 0; i < modules.length; i++) { var module = modules[i]; mid = getModuleId($(module)); if (moduleId == parseInt(mid)) { index = i; break; } } return index; }; var updateServer = function (moduleId, $pane, callback) { var order; var paneName = $pane.attr("id").substring(4); var index = getModuleIndex(moduleId, $pane); if (paneName !== modulePaneName) { //Moved to new Pane order = index * 2; } else { //Module moved within Pane if (index > paneModuleIndex) { //Module moved down order = (index + 1) * 2; } else { //Module moved up order = index * 2; } } var dataVar = { TabId: tabId, ModuleId: moduleId, Pane: paneName, ModuleOrder: order }; var service = $.dnnSF(); var serviceUrl = $.dnnSF().getServiceRoot("InternalServices") + "ModuleService/"; $.ajax({ url: serviceUrl + 'MoveModule', type: 'POST', data: dataVar, beforeSend: service.setModuleHeaders, success: function () { if (typeof callback === "function") { callback.call($pane); } else { window.location.reload(); } }, error: function () { } }); }; for (var moduleNo = 0; moduleNo < $modules.length; moduleNo++) { $module = $($modules[moduleNo]); mid = getModuleId($module); //Add a drag handle if ($module.find(".dnnDragHint").length === 0) { $module.prepend("<div class=\"dnnDragHint\"></div>"); } //Add a drag hint $module.find(".dnnDragHint").dnnHelperTip({ helpContent: settings.dragHintText, holderId: "ModuleDragToolTip-" + mid }); } //call jQuery UI Sortable plugin var originalPane = null; var allDnnSortableEmpty = true; $('.dnnSortable').each(function (n, v) { if (!$.trim($(v).html()).length) { return true; } else { allDnnSortableEmpty = false; return false; } }); if (allDnnSortableEmpty) { $(function () { $('.DNNEmptyPane').each(function () { $(this).removeClass('DNNEmptyPane').addClass('dnnDropEmptyPanes'); }); $('.contentPane').each(function () { // this special code is for you -- IE8 this.className = this.className; }); }); $self.droppable({ tolerance: "pointer", /*hoverClass: 'dnnDropTarget',*/ over: function (event, ui) { $(this).append("<div class='dnnDropTarget'><p>" + settings.dropTargetText + "(" + $(this).attr("id").substring(4) + ")" + "</p></div>"); }, out: function (event, ui) { $(this).empty(); }, drop: function (event, ui) { // add module var dropItem = ui.draggable; var pane = $(this).empty(); var order = 0; var paneName = pane.attr("id").substring(4); dropItem.remove(); if (dnn.controlBar) { dnn.controlBar.addModule(dnn.controlBar.dragdropModule + '', dnn.controlBar.dragdropPage, paneName, '-1', order + '', dnn.controlBar.dragdropVisibility + '', dnn.controlBar.dragdropAddExistingModule + '', dnn.controlBar.dragdropCopyModule + ''); } } }); return $self; } $('div.dnnDragHint').mousedown(function () { $('.DNNEmptyPane').each(function () { $(this).removeClass('DNNEmptyPane').addClass('dnnDropEmptyPanes'); }); $('.contentPane').each(function () { // this special code is for you -- IE8 this.className = this.className; }); }).mouseup(function () { $('.dnnDropEmptyPanes').each(function () { $(this).removeClass('dnnDropEmptyPanes').addClass('DNNEmptyPane'); }); $('.contentPane').each(function () { // this special code is for you -- IE8 this.className = this.className; }); }); $self.sortable({ connectWith: ".dnnSortable", dropOnEmpty: settings.dropOnEmpty, cursor: settings.cursor, cursorAt: { left: 10, top: 30 }, handle: "div.dnnDragHint", placeholder: "dnnDropTarget", tolerance: "pointer", helper: function (event, ui) { var dragTip = $('<div class="dnnDragdropTip ControlBar_DragdropModule"></div>'); var title = $('span.Head', ui).html(); if (!title) title = "The Dragging Module"; dragTip.html(title); $('body').append(dragTip); return dragTip; }, start: function (event, ui) { var $pane = ui.item.parent(); originalPane = $pane; modulePaneName = $pane.attr("id").substring(4); mid = getModuleId(ui.item); paneModuleIndex = getModuleIndex(mid, $pane); //Add drop target text var $dropTarget = $(".dnnDropTarget"); $dropTarget.append("<p>" + settings.dropTargetText + "(" + modulePaneName + ")" + "</p>"); $(settings.actionMenu).hide(); }, over: function (event, ui) { //Add drop target text var $dropTarget = $(".dnnDropTarget"); $dropTarget.empty().append("<p>" + settings.dropTargetText + "(" + $(this).attr("id").substring(4) + ")" + "</p>"); }, stop: function (event, ui, callback) { var dropItem = ui.item; if (dnn.controlBar && dropItem.hasClass('ControlBar_ModuleDiv')) { // add module var pane = ui.item.parent(); var order = -1; var paneName = pane.attr("id").substring(4); if ($('div.DnnModule', pane).length > 0) { var modules = $('div.DnnModule, div.ControlBar_ModuleDiv', pane); for (var i = 0; i < modules.length; i++) { var module = modules.get(i); if ($(module).hasClass('ControlBar_ModuleDiv')) { order = i; } } } dropItem.remove(); dnn.controlBar.addModule(dnn.controlBar.dragdropModule + '', dnn.controlBar.dragdropPage, paneName, '-1', order + '', dnn.controlBar.dragdropVisibility + '', dnn.controlBar.dragdropAddExistingModule + '', dnn.controlBar.dragdropCopyModule + ''); } else { // move module mid = getModuleId(dropItem); updateServer(mid, dropItem.parent(), callback); $(settings.actionMenu).show(); //remove the empty pane holder class for current pane dropItem.parent().removeClass("dnnDropEmptyPanes"); // if original pane is empty, add dnnemptypane class if (originalPane && $('div', originalPane).length === 0) originalPane.addClass('dnnDropEmptyPanes'); if (!callback) { // show animation dropItem.css('background-color', '#fffacd'); setTimeout(function() { dropItem.css('background', '#fffff0'); setTimeout(function() { dropItem.css('background', 'transparent'); }, 300); }, 2500); } $("div[data-tipholder=\"" + "ModuleDragToolTip-" + mid + "\"] .dnnHelpText").text(settings.dragHintText); $('.dnnDropEmptyPanes').each(function () { $(this).removeClass('dnnDropEmptyPanes').addClass('DNNEmptyPane'); }); $('.contentPane').each(function () { // this special code is for you -- IE8 this.className = this.className; }); //fire window resize to reposition action menus $(window).resize(); } } }); return $self; }; })(jQuery);
// // AutoLinker is a named function that will replace links on messages // @param {Object} message - The message object // import Autolinker from 'autolinker'; function AutoLinker(message) { if (RocketChat.settings.get('AutoLinker') !== true) { return message; } if (_.trim(message.html)) { const regUrls = new RegExp(RocketChat.settings.get('AutoLinker_UrlsRegExp')); const autolinker = new Autolinker({ stripPrefix: RocketChat.settings.get('AutoLinker_StripPrefix'), urls: { schemeMatches: RocketChat.settings.get('AutoLinker_Urls_Scheme'), wwwMatches: RocketChat.settings.get('AutoLinker_Urls_www'), tldMatches: RocketChat.settings.get('AutoLinker_Urls_TLD') }, email: RocketChat.settings.get('AutoLinker_Email'), phone: RocketChat.settings.get('AutoLinker_Phone'), twitter: false, replaceFn(match) { if (match.getType() === 'url') { if (regUrls.test(match.matchedText)) { if (match.matchedText.indexOf(Meteor.absoluteUrl()) === 0) { // returns an `Autolinker.HtmlTag` instance for an <a> tag const tag = match.buildTag(); // sets target to empty, instead of _blank tag.setAttr('target', ''); return tag; } return true; } } return null; } }); let regNonAutoLink = /(```\w*[\n ]?[\s\S]*?```+?)|(`(?:[^`]+)`)/; if (RocketChat.settings.get('Katex_Enabled')) { regNonAutoLink = /(```\w*[\n ]?[\s\S]*?```+?)|(`(?:[^`]+)`)|(\\\(\w*[\n ]?[\s\S]*?\\\)+?)/; } // Separate text in code blocks and non code blocks const msgParts = message.html.split(regNonAutoLink); msgParts.forEach((part, index) => { if (part && part.length > 0) { // Verify if this part is code const codeMatch = part.match(regNonAutoLink); if (!codeMatch) { msgParts[index] = autolinker.link(part); } } }); // Re-mount message message.html = msgParts.join(''); } return message; } RocketChat.callbacks.add('renderMessage', AutoLinker);
var validator = require('validator'); var _ = require('lodash'); // validators and sanitizers not prefixed with is/to var additionalValidators = ['contains', 'equals', 'matches']; var additionalSanitizers = ['trim', 'ltrim', 'rtrim', 'escape', 'stripLow', 'whitelist', 'blacklist', 'normalizeEmail']; /** * Initalizes a chain of validators * * @class * @param {(string|string[])} param path to property to validate * @param {string} failMsg validation failure message * @param {Request} req request to attach validation errors * @param {string} location request property to find value (body, params, query, etc.) * @param {object} options options containing error formatter */ function ValidatorChain(param, failMsg, req, location, options) { this.errorFormatter = options.errorFormatter; this.param = param; this.value = location ? _.get(req[location], param) : undefined; this.validationErrors = []; this.failMsg = failMsg; this.req = req; return this; } /** * Initializes a sanitizers * * @class * @param {(string|string[])} param path to property to sanitize * @param {[type]} req request to sanitize * @param {[type]} location request property to find value */ function Sanitizer(param, req, locations) { this.values = locations.map(function(location) { return _.get(req[location], param); }); this.req = req; this.param = param; this.locations = locations; return this; } /** * Adds validation methods to request object via express middleware * * @method expressValidator * @param {object} options * @return {function} middleware */ var expressValidator = function(options) { options = options || {}; var defaults = { customValidators: {}, customSanitizers: {}, errorFormatter: function(param, msg, value) { return { param: param, msg: msg, value: value }; } }; _.defaults(options, defaults); // _.set validators and sainitizers as prototype methods on corresponding chains _.forEach(validator, function(method, methodName) { if (methodName.match(/^is/) || _.contains(additionalValidators, methodName)) { ValidatorChain.prototype[methodName] = makeValidator(methodName, validator); } if (methodName.match(/^to/) || _.contains(additionalSanitizers, methodName)) { Sanitizer.prototype[methodName] = makeSanitizer(methodName, validator); } }); ValidatorChain.prototype.notEmpty = function() { return this.isLength(1); }; ValidatorChain.prototype.len = function() { return this.isLength.apply(this, arguments); }; ValidatorChain.prototype.optional = function() { if (this.value === undefined) { this.skipValidating = true; } return this; }; _.forEach(options.customValidators, function(method, customValidatorName) { ValidatorChain.prototype[customValidatorName] = makeValidator(customValidatorName, options.customValidators); }); _.forEach(options.customSanitizers, function(method, customSanitizerName) { Sanitizer.prototype[customSanitizerName] = makeSanitizer(customSanitizerName, options.customSanitizers); }); return function(req, res, next) { var locations = ['body', 'params', 'query']; req._validationErrors = []; req.validationErrors = function(mapped) { if (mapped && req._validationErrors.length > 0) { var errors = {}; req._validationErrors.forEach(function(err) { errors[err.param] = err; }); return errors; } return req._validationErrors.length > 0 ? req._validationErrors : false; }; locations.forEach(function(location) { req['sanitize' + _.capitalize(location)] = function(param) { return new Sanitizer(param, req, [location]); }; }); req.sanitize = function(param) { return new Sanitizer(param, req, locations); }; locations.forEach(function(location) { req['check' + _.capitalize(location)] = function(param, failMsg) { return new ValidatorChain(param, failMsg, req, location, options); }; }); req.checkFiles = function(param, failMsg) { return new ValidatorChain(param, failMsg, req, 'files', options); }; req.checkHeaders = function(param, failMsg) { if (param === 'referrer') { param = 'referer'; } return new ValidatorChain(param, failMsg, req, 'headers', options); }; req.check = function(param, failMsg) { return new ValidatorChain(param, failMsg, req, locate(req, param), options); }; req.filter = req.sanitize; req.assert = req.check; req.validate = req.check; next(); }; }; /** * Validates and handles errors, return instance of itself to allow for chaining * * @method makeValidator * @param {string} methodName * @param {object} container * @return {function} */ function makeValidator(methodName, container) { return function() { var args = []; args.push(this.value); args = args.concat(Array.prototype.slice.call(arguments)); var result = container[methodName].apply(container, args); var isValid = this.skipValidating || result; if (!isValid) { var error = this.errorFormatter(this.param, this.failMsg || 'Invalid value', this.value); this.validationErrors.push(error); this.req._validationErrors.push(error); } return this; }; } /** * Sanitizes and sets sanitized value on the request, then return instance of itself to allow for chaining * * @method makeSanitizer * @param {string} methodName * @param {object} container * @return {function} */ function makeSanitizer(methodName, container) { return function() { var _arguments = arguments; var result; this.values.forEach(function(value, i) { if (value != null) { var args = [value]; args = args.concat(Array.prototype.slice.call(_arguments)); result = container[methodName].apply(container, args); _.set(this.req[this.locations[i]], this.param, result); this.values[i] = result; } }.bind(this)); return result; }; } /** * find location of param * * @method param * @param {Request} req express request object * @param {(string|string[])} name [description] * @return {string} */ function locate(req, name) { if (_.get(req.params, name)) { return 'params'; } else if (_.has(req.query, name)) { return 'query'; } else if (_.has(req.body, name)) { return 'body'; } return undefined; } module.exports = expressValidator; module.exports.validator = validator;
/*! jQuery UI - v1.9.2 - 2014-09-21 * http://jqueryui.com * Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */ jQuery(function(e){e.datepicker.regional.eo={closeText:"Fermi",prevText:"&#x3C;Anta",nextText:"Sekv&#x3E;",currentText:"Nuna",monthNames:["Januaro","Februaro","Marto","Aprilo","Majo","Junio","Julio","Aŭgusto","Septembro","Oktobro","Novembro","Decembro"],monthNamesShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aŭg","Sep","Okt","Nov","Dec"],dayNames:["Dimanĉo","Lundo","Mardo","Merkredo","Ĵaŭdo","Vendredo","Sabato"],dayNamesShort:["Dim","Lun","Mar","Mer","Ĵaŭ","Ven","Sab"],dayNamesMin:["Di","Lu","Ma","Me","Ĵa","Ve","Sa"],weekHeader:"Sb",dateFormat:"dd/mm/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.datepicker.setDefaults(e.datepicker.regional.eo)});
'use strict'; var EventEmitter = require('events').EventEmitter; var TextOperation = require('./text-operation'); var WrappedOperation = require('./wrapped-operation'); var Server = require('./server'); var Selection = require('./selection'); var util = require('util'); var LZString = require('lz-string'); var logger = require('../logger'); function EditorSocketIOServer(document, operations, docId, mayWrite, operationCallback) { EventEmitter.call(this); Server.call(this, document, operations); this.users = {}; this.docId = docId; this.mayWrite = mayWrite || function (_, cb) { cb(true); }; this.operationCallback = operationCallback; } util.inherits(EditorSocketIOServer, Server); extend(EditorSocketIOServer.prototype, EventEmitter.prototype); function extend(target, source) { for (var key in source) { if (source.hasOwnProperty(key)) { target[key] = source[key]; } } } EditorSocketIOServer.prototype.addClient = function (socket) { var self = this; socket.join(this.docId); var docOut = { str: this.document, revision: this.operations.length, clients: this.users }; socket.emit('doc', LZString.compressToUTF16(JSON.stringify(docOut))); socket.on('operation', function (revision, operation, selection) { operation = LZString.decompressFromUTF16(operation); operation = JSON.parse(operation); socket.origin = 'operation'; self.mayWrite(socket, function (mayWrite) { if (!mayWrite) { console.log("User doesn't have the right to edit."); return; } try { self.onOperation(socket, revision, operation, selection); if (typeof self.operationCallback === 'function') self.operationCallback(socket, operation); } catch (err) { socket.disconnect(true); } }); }); socket.on('get_operations', function (base, head) { self.onGetOperations(socket, base, head); }); socket.on('selection', function (obj) { socket.origin = 'selection'; self.mayWrite(socket, function (mayWrite) { if (!mayWrite) { console.log("User doesn't have the right to edit."); return; } self.updateSelection(socket, obj && Selection.fromJSON(obj)); }); }); socket.on('disconnect', function () { //console.log("Disconnect"); socket.leave(self.docId); self.onDisconnect(socket); /* if (socket.manager && socket.manager.sockets.clients(self.docId).length === 0) { self.emit('empty-room'); } */ }); }; EditorSocketIOServer.prototype.onOperation = function (socket, revision, operation, selection) { var wrapped; try { wrapped = new WrappedOperation( TextOperation.fromJSON(operation), selection && Selection.fromJSON(selection) ); } catch (exc) { logger.error("Invalid operation received: "); logger.error(exc); throw new Error(exc); } try { var clientId = socket.id; var wrappedPrime = this.receiveOperation(revision, wrapped); if(!wrappedPrime) return; //console.log("new operation: " + JSON.stringify(wrapped)); this.getClient(clientId).selection = wrappedPrime.meta; revision = this.operations.length; socket.emit('ack', revision); socket.broadcast.in(this.docId).emit( 'operation', clientId, revision, wrappedPrime.wrapped.toJSON(), wrappedPrime.meta ); //set document is dirty this.isDirty = true; } catch (exc) { logger.error(exc); throw new Error(exc); } }; EditorSocketIOServer.prototype.onGetOperations = function (socket, base, head) { var operations = this.operations.slice(base, head).map(function (op) { return op.wrapped.toJSON(); }); operations = LZString.compressToUTF16(JSON.stringify(operations)); socket.emit('operations', head, operations); }; EditorSocketIOServer.prototype.updateSelection = function (socket, selection) { var clientId = socket.id; if (selection) { this.getClient(clientId).selection = selection; } else { delete this.getClient(clientId).selection; } socket.broadcast.to(this.docId).emit('selection', clientId, selection); }; EditorSocketIOServer.prototype.setName = function (socket, name) { var clientId = socket.id; this.getClient(clientId).name = name; socket.broadcast.to(this.docId).emit('set_name', clientId, name); }; EditorSocketIOServer.prototype.setColor = function (socket, color) { var clientId = socket.id; this.getClient(clientId).color = color; socket.broadcast.to(this.docId).emit('set_color', clientId, color); }; EditorSocketIOServer.prototype.getClient = function (clientId) { return this.users[clientId] || (this.users[clientId] = {}); }; EditorSocketIOServer.prototype.onDisconnect = function (socket) { var clientId = socket.id; delete this.users[clientId]; socket.broadcast.to(this.docId).emit('client_left', clientId); }; module.exports = EditorSocketIOServer;
/* * index.js: Top-level plugin exposing HTTP features in flatiron * * (C) 2011, Nodejitsu Inc. * MIT LICENSE * */ var union = exports; // // Expose version information through `pkginfo` // require('pkginfo')(module, 'version') // // Expose core union components // union.BufferedStream = require('./buffered-stream'); union.HttpStream = require('./http-stream'); union.ResponseStream = require('./response-stream'); union.RoutingStream = require('./routing-stream'); union.createServer = require('./core').createServer; union.errorHandler = require('./core').errorHandler;
/* Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'colorbutton', 'ar', { auto: 'تلقائي', bgColorTitle: 'لون الخلفية', colors: { '000': 'أسود', '800000': 'كستنائي', '8B4513': 'بني فاتح', '2F4F4F': 'رمادي أردوازي غامق', '008080': 'أزرق مخضر', '000080': 'أزرق داكن', '4B0082': 'كحلي', '696969': 'رمادي داكن', B22222: 'طوبي', A52A2A: 'بني', DAA520: 'ذهبي داكن', '006400': 'أخضر داكن', '40E0D0': 'فيروزي', '0000CD': 'أزرق متوسط', '800080': 'بنفسجي غامق', '808080': 'رمادي', F00: 'أحمر', FF8C00: 'برتقالي داكن', FFD700: 'ذهبي', '008000': 'أخضر', '0FF': 'تركواز', '00F': 'أزرق', EE82EE: 'بنفسجي', A9A9A9: 'رمادي شاحب', FFA07A: 'برتقالي وردي', FFA500: 'برتقالي', FFFF00: 'أصفر', '00FF00': 'ليموني', AFEEEE: 'فيروزي شاحب', ADD8E6: 'أزرق فاتح', DDA0DD: 'بنفسجي فاتح', D3D3D3: 'رمادي فاتح', FFF0F5: 'وردي فاتح', FAEBD7: 'أبيض عتيق', FFFFE0: 'أصفر فاتح', F0FFF0: 'أبيض مائل للأخضر', F0FFFF: 'سماوي', F0F8FF: 'لبني', E6E6FA: 'أرجواني', FFF: 'أبيض' }, more: 'ألوان إضافية...', panelTitle: 'Colors', textColorTitle: 'لون النص' } );
define([ 'app/config', 'app/GeoSearch', 'app/HelpPopup' ], function ( config, GS, HP ) {});
/* * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is * regenerated. */ 'use strict'; const models = require('./index'); /** * Azure Data Factory top-level resource. * * @extends models['BaseResource'] */ class Resource extends models['BaseResource'] { /** * Create a Resource. * @member {string} [id] The resource identifier. * @member {string} [name] The resource name. * @member {string} [type] The resource type. * @member {string} [location] The resource location. * @member {object} [tags] The resource tags. */ constructor() { super(); } /** * Defines the metadata of Resource * * @returns {object} metadata of Resource * */ mapper() { return { required: false, serializedName: 'Resource', type: { name: 'Composite', className: 'Resource', modelProperties: { id: { required: false, readOnly: true, serializedName: 'id', type: { name: 'String' } }, name: { required: false, readOnly: true, serializedName: 'name', type: { name: 'String' } }, type: { required: false, readOnly: true, serializedName: 'type', type: { name: 'String' } }, location: { required: false, serializedName: 'location', type: { name: 'String' } }, tags: { required: false, serializedName: 'tags', type: { name: 'Dictionary', value: { required: false, serializedName: 'StringElementType', type: { name: 'String' } } } } } } }; } } module.exports = Resource;
var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc); switch (arguments.length) { case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target); case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0); case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc); } }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var di_1 = require('angular2/di'); var lang_1 = require('angular2/src/facade/lang'); var collection_1 = require('angular2/src/facade/collection'); var template_resolver_1 = require('angular2/src/core/compiler/template_resolver'); var view_ref_1 = require('angular2/src/core/compiler/view_ref'); var dynamic_component_loader_1 = require('angular2/src/core/compiler/dynamic_component_loader'); var utils_1 = require('./utils'); var dom_renderer_1 = require('angular2/src/render/dom/dom_renderer'); var dom_adapter_1 = require('angular2/src/dom/dom_adapter'); var debug_element_1 = require('angular2/src/debug/debug_element'); /** * @exportedAs angular2/test */ var RootTestComponent = (function (_super) { __extends(RootTestComponent, _super); function RootTestComponent(componentRef) { _super.call(this, view_ref_1.internalView(componentRef.hostView), 0); this._componentParentView = view_ref_1.internalView(componentRef.hostView); this._componentRef = componentRef; } RootTestComponent.prototype.detectChanges = function () { this._componentParentView.changeDetector.detectChanges(); this._componentParentView.changeDetector.checkNoChanges(); }; RootTestComponent.prototype.destroy = function () { this._componentRef.dispose(); }; return RootTestComponent; })(debug_element_1.DebugElement); exports.RootTestComponent = RootTestComponent; var _nextRootElementId = 0; /** * @exportedAs angular2/test * * Builds a RootTestComponent for use in component level tests. */ var TestComponentBuilder = (function () { function TestComponentBuilder(injector) { this._injector = injector; this._viewOverrides = collection_1.MapWrapper.create(); this._directiveOverrides = collection_1.MapWrapper.create(); this._templateOverrides = collection_1.MapWrapper.create(); } TestComponentBuilder.prototype._clone = function () { var clone = new TestComponentBuilder(this._injector); clone._viewOverrides = collection_1.MapWrapper.clone(this._viewOverrides); clone._directiveOverrides = collection_1.MapWrapper.clone(this._directiveOverrides); clone._templateOverrides = collection_1.MapWrapper.clone(this._templateOverrides); return clone; }; /** * Overrides only the html of a {@link Component}. * All the other propoerties of the component's {@link View} are preserved. * * @param {Type} component * @param {string} html * * @return {TestComponentBuilder} */ TestComponentBuilder.prototype.overrideTemplate = function (componentType, template) { var clone = this._clone(); collection_1.MapWrapper.set(clone._templateOverrides, componentType, template); return clone; }; /** * Overrides a component's {@link View}. * * @param {Type} component * @param {view} View * * @return {TestComponentBuilder} */ TestComponentBuilder.prototype.overrideView = function (componentType, view) { var clone = this._clone(); collection_1.MapWrapper.set(clone._viewOverrides, componentType, view); return clone; }; /** * Overrides the directives from the component {@link View}. * * @param {Type} component * @param {Type} from * @param {Type} to * * @return {TestComponentBuilder} */ TestComponentBuilder.prototype.overrideDirective = function (componentType, from, to) { var clone = this._clone(); var overridesForComponent = collection_1.MapWrapper.get(clone._directiveOverrides, componentType); if (!lang_1.isPresent(overridesForComponent)) { collection_1.MapWrapper.set(clone._directiveOverrides, componentType, collection_1.MapWrapper.create()); overridesForComponent = collection_1.MapWrapper.get(clone._directiveOverrides, componentType); } collection_1.MapWrapper.set(overridesForComponent, from, to); return clone; }; /** * Builds and returns a RootTestComponent. * * @return {Promise<RootTestComponent>} */ TestComponentBuilder.prototype.createAsync = function (rootComponentType) { var mockTemplateResolver = this._injector.get(template_resolver_1.TemplateResolver); collection_1.MapWrapper.forEach(this._viewOverrides, function (view, type) { mockTemplateResolver.setView(type, view); }); collection_1.MapWrapper.forEach(this._templateOverrides, function (template, type) { mockTemplateResolver.setInlineTemplate(type, template); }); collection_1.MapWrapper.forEach(this._directiveOverrides, function (overrides, component) { collection_1.MapWrapper.forEach(overrides, function (to, from) { mockTemplateResolver.overrideViewDirective(component, from, to); }); }); var rootElId = "root" + _nextRootElementId++; var rootEl = utils_1.el("<div id=\"" + rootElId + "\"></div>"); var doc = this._injector.get(dom_renderer_1.DOCUMENT_TOKEN); // TODO(juliemr): can/should this be optional? dom_adapter_1.DOM.appendChild(doc.body, rootEl); return this._injector.get(dynamic_component_loader_1.DynamicComponentLoader) .loadAsRoot(rootComponentType, "#" + rootElId, this._injector) .then(function (componentRef) { return new RootTestComponent(componentRef); }); }; TestComponentBuilder = __decorate([ di_1.Injectable(), __metadata('design:paramtypes', [di_1.Injector]) ], TestComponentBuilder); return TestComponentBuilder; })(); exports.TestComponentBuilder = TestComponentBuilder; exports.__esModule = true; //# sourceMappingURL=test_component_builder.js.map
/** @module ember-data */ import computedPolyfill from "ember-new-computed"; import Model from "ember-data/system/model"; import normalizeModelName from "ember-data/system/normalize-model-name"; /** `DS.hasMany` is used to define One-To-Many and Many-To-Many relationships on a [DS.Model](/api/data/classes/DS.Model.html). `DS.hasMany` takes an optional hash as a second parameter, currently supported options are: - `async`: A boolean value used to explicitly declare this to be an async relationship. - `inverse`: A string used to identify the inverse property on a related model. #### One-To-Many To declare a one-to-many relationship between two models, use `DS.belongsTo` in combination with `DS.hasMany`, like this: ```app/models/post.js import DS from 'ember-data'; export default DS.Model.extend({ comments: DS.hasMany('comment') }); ``` ```app/models/comment.js import DS from 'ember-data'; export default DS.Model.extend({ post: DS.belongsTo('post') }); ``` #### Many-To-Many To declare a many-to-many relationship between two models, use `DS.hasMany`: ```app/models/post.js import DS from 'ember-data'; export default DS.Model.extend({ tags: DS.hasMany('tag') }); ``` ```app/models/tag.js import DS from 'ember-data'; export default DS.Model.extend({ posts: DS.hasMany('post') }); ``` You can avoid passing a string as the first parameter. In that case Ember Data will infer the type from the singularized key name. ```app/models/post.js import DS from 'ember-data'; export default DS.Model.extend({ tags: DS.hasMany() }); ``` will lookup for a Tag type. #### Explicit Inverses Ember Data will do its best to discover which relationships map to one another. In the one-to-many code above, for example, Ember Data can figure out that changing the `comments` relationship should update the `post` relationship on the inverse because post is the only relationship to that model. However, sometimes you may have multiple `belongsTo`/`hasManys` for the same type. You can specify which property on the related model is the inverse using `DS.hasMany`'s `inverse` option: ```app/models/comment.js import DS from 'ember-data'; export default DS.Model.extend({ onePost: DS.belongsTo('post'), twoPost: DS.belongsTo('post'), redPost: DS.belongsTo('post'), bluePost: DS.belongsTo('post') }); ``` ```app/models/post.js import DS from 'ember-data'; export default DS.Model.extend({ comments: DS.hasMany('comment', { inverse: 'redPost' }) }); ``` You can also specify an inverse on a `belongsTo`, which works how you'd expect. @namespace @method hasMany @for DS @param {String} type (optional) type of the relationship @param {Object} options (optional) a hash of options @return {Ember.computed} relationship */ function hasMany(type, options) { if (typeof type === 'object') { options = type; type = undefined; } Ember.assert("The first argument to DS.hasMany must be a string representing a model type key, not an instance of " + Ember.inspect(type) + ". E.g., to define a relation to the Comment model, use DS.hasMany('comment')", typeof type === 'string' || typeof type === 'undefined'); options = options || {}; if (typeof type === 'string') { type = normalizeModelName(type); } // Metadata about relationships is stored on the meta of // the relationship. This is used for introspection and // serialization. Note that `key` is populated lazily // the first time the CP is called. var meta = { type: type, isRelationship: true, options: options, kind: 'hasMany', key: null }; return computedPolyfill({ get: function(key) { var relationship = this._internalModel._relationships.get(key); return relationship.getRecords(); }, set: function(key, records) { var relationship = this._internalModel._relationships.get(key); relationship.clear(); Ember.assert("You must pass an array of records to set a hasMany relationship", Ember.isArray(records)); relationship.addRecords(Ember.A(records).mapBy('_internalModel')); return relationship.getRecords(); } }).meta(meta); } Model.reopen({ notifyHasManyAdded: function(key) { //We need to notifyPropertyChange in the adding case because we need to make sure //we fetch the newly added record in case it is unloaded //TODO(Igor): Consider whether we could do this only if the record state is unloaded //Goes away once hasMany is double promisified this.notifyPropertyChange(key); } }); export default hasMany;
var curSong = curLine = isPlaying = curTime = curStartT = curT = null var height = 500 var width = 750 var baseCharPerSec = 6 var lastCharPerSec = baseCharPerSec var minCharPerSec = 3 var player = d3.select('#player') var red = '#d2130a', blue = '#3b4274', grey = '#ccc' function onYouTubeIframeAPIReady(){ d3.select('#buttons').dataAppend(songs, 'img.button') .attr('src', function(d){ return '/images/thumbnails/lyrics/' + d.slug + '.jpg' }) .on('click', playSong) playSong(songs[2]) } function playSong(song){ //style buttons d3.selectAll('.button').classed('selected', function(d){ return d === song }) isPlaying = false curSong = null //break lines into characters for graphing song.lines.forEach(function(d, i){ d.i = i var s = d3.scale.linear() .domain([0, d.text.length - 1]) .range([d.start, d.start + d.dur]) d.chars = d.text.split('').map(function(c, j){ return { line: d, c: c, sTime: s(i), rTime: Math.round(s(i))/100, j: j } }) }) chars = _.flatten(song.lines.map(ƒ('chars'))) //set up DOM player.html('') var lineContainer = player.append('div#lineContainer') var lineEls = lineContainer.dataAppend(song.lines, 'div.line') .each(function(d){ d.sel = d3.select(this) }) lineEls.append('div.frontline').html(ƒ('text', toText)) lineEls.append('div.backline') .each(function(d){ d.backSel = d3.select(this) }) //embed youtube video var ytContainer = player.append('div#ytContainer') playerYT = new YT.Player('ytContainer', { width: width, height: height, videoId: song.id, startSeconds: 40, endSeconds: 10, events: { onReady: function(e){ e.target.playVideo() curSong = song drawGraph() }, onStateChange: function(e){ isPlaying = e.data == 1}, } }) } //animate lyrics d3.timer(function(t){ if (!isPlaying || !curSong) return curTime = playerYT.getCurrentTime() curT = t //check if curLine is still active if (!(curLine && curLine.start <= curTime && curTime <= curLine.start + curLine.actualDur)) { var activeLine = null curSong.lines.forEach(function(d){ d.isActive = d.start <= curTime && curTime <= d.start + d.dur if (d.isActive) activeLine = d }) d3.selectAll('div.line').style('opacity', function(d){ return d.isActive ? 1 : 0 }) if (!activeLine) return //calculate target speed if (curLine){ var typed = curLine.chars.filter(ƒ('typed')) if (typed.length > 3){ lastCharPerSec = 1/3*lastCharPerSec + 2/3*typed.length/(_.last(typed).time - typed[0].time) lastCharPerSec = Math.max(lastCharPerSec, minCharPerSec) } } curLine = activeLine curStartT = t //calculate number of lines to skip curLine.actualDur = curLine.dur; i = curLine.i while (curLine.chars.length/curLine.actualDur > lastCharPerSec && i < curSong.lines.length - 1){ curLine.actualDur += curSong.lines[++i].dur } curLine.chars.forEach(function(d, i){ d.sel.transition().delay(i*50) .attr({fill: red, r: 5}) .transition().duration(500) .attr('r', 2) }) } if (curLine){ var offset = (t - curStartT)/curLine.actualDur*(height - 50*Math.ceil(curLine.text.length/30))/1000 curLine.sel.style('transform', 'translateY(' + offset + 'px)') } }) //listen for keypresses d3.select(window).on('keypress', function(){ d3.event.preventDefault() if (!isPlaying || !curSong || !curLine) return //redo with slice? var nextChar = curLine.chars.filter(function(d){ return !d.typed })[0] if (!nextChar) return var k = String.fromCharCode(d3.event.charCode) if (nextChar.c == k){ nextChar.typed = true nextChar.time = curTime nextChar.tTime = (curLine.start + (curT - curStartT)/1000)/100 curLine.backSel.html(toText(curLine.chars.filter(ƒ('typed')).map(ƒ('c')).join(''))) typedChars = chars.filter(ƒ('typed')) if (typedChars.length - 1){ nextChar.tDif = nextChar.tTime - typedChars[typedChars.length - 2].tTime console.log(nextChar.tDif) nextChar.tDif = Math.max(nextChar.tDif, .00001) nextChar.cps = 1/nextChar.tDif console.log(nextChar.tDif, nextChar.cps) updateLine() } nextChar.sel.attr('fill', blue) .transition() .attr('r', 15) .style('stroke', 'white') .transition().duration(1000) .attr('r', 3) } }) var c, chars function drawGraph(){ var byTime = d3.nest().key(ƒ('rTime')).entries(chars) byTime.forEach(function(sec){ sec.values.forEach(function(d, i){ d.i = i }) }) c = d3.conventions({ parentSel: player.append('div#graphCont'), width: width, height: 300, margin: {left: 10, right: 10, top: 10, bottom: 10} }) c.path = c.svg.append('path') .style({stroke: 'black', fill: 'none', 'stroke-width': .5}) c.x.domain([0, playerYT.getDuration()/100]) c.y.domain(d3.extent(chars, ƒ('i')).reverse()) var secs = c.svg.dataAppend(byTime, 'g') .translate(function(d){ return [c.x(d.key), 0] }) secs.dataAppend(ƒ('values'), 'circle') .attr('r', 1) .attr('cy', function(d){ return d.i*7 }) .attr('fill', grey) .each(function(d){ d.sel = d3.select(this) }) c.y.domain([0, 3000]).range([c.height, c.height - 100]).clamp(true) c.line = d3.svg.line() .x(ƒ('tTime', c.x)) .y(ƒ('cps', c.y)) .interpolate('step') } function updateLine(){ c.path.attr('d', c.line(typedChars.slice(1))) } function toText(chars){ var rv = '' chars.split('').forEach(function(c, i){ if (i && !(i % 30)) rv += '<br>' rv += c }) return rv }
var cucumberSteps = function() { var Given = When = Then = this.defineStep; var World = require('./cucumber_world').World; this.World = World; Given(/^a scenario with:$/, function(steps, callback) { this.addScenario("A scenario", steps); callback(); }); Given(/^the step "([^"]*)" has a passing mapping$/, function(stepName, callback) { this.addPassingStepDefinitionWithName(stepName, callback); }); Given(/^a passing (before|after|around) hook$/, function(hookType, callback) { if (hookType == "before") this.addBeforeHook(callback); else if (hookType == "after") this.addAfterHook(callback); else this.addAroundHook(callback); }); Given(/^the step "([^"]*)" has a failing mapping$/, function(stepName, callback) { this.addFailingMapping(stepName, {}, callback); }); Given(/^the step "([^"]*)" has a mapping failing with the message "([^"]*)"$/, function(stepName, message, callback) { this.addFailingMapping(stepName, { message: message }, callback); }); Given(/^the step "([^"]*)" has a mapping asynchronously failing with the message "([^"]*)"$/, function(stepName, message, callback) { this.stepDefinitions += "Given(/^" + stepName + "$/, function(callback) {\ world.touchStep(\"" + stepName + "\");\ setTimeout(function() {callback.fail(new Error('" + message + "'));}, 10);\ });\n"; callback(); }); Given(/^the step "([^"]*)" has a mapping failing via a Node-like error construct$/, function(stepName, callback) { this.stepDefinitions += "Given(/^" + stepName + "$/, function(callback) {\ world.touchStep(\"" + stepName + "\");\ callback(new Error('#fail'));\ });\n"; callback(); }); Given(/^the step "([^"]*)" has a pending mapping$/, function(stepName, callback) { this.stepDefinitions += "Given(/^" + stepName + "$/, function(callback) {\ world.touchStep(\"" + stepName + "\");\ callback.pending('I am pending.');\ });\n"; callback(); }); Given(/^the step "([^"]*)" has an asynchronous pending mapping$/, function(stepName, callback) { this.stepDefinitions += "Given(/^" + stepName + "$/, function(callback) {\ world.touchStep(\"" + stepName + "\");\ setTimeout(callback.pending, 10);\ });\n"; callback(); }); Given(/^a mapping with a string-based pattern$/, function(callback) { this.addStringBasedPatternMapping(); callback(); }); Given(/^a mapping with a string-based pattern and parameters$/, function(callback) { this.addStringBasedPatternMappingWithParameters(); callback(); }); Given(/^the following feature:$/, function(feature, callback) { this.featureSource = feature; callback(); }); Given(/^the step "([^"]*)" has a passing mapping that receives a data table$/, function(stepName, callback) { this.stepDefinitions += "Given(/^" + stepName + "$/, function(dataTable, callback) {\ world.dataTableLog = dataTable.raw();\ callback();\ });"; callback(); }); Given(/^the step "([^"]*)" has a passing mapping that receives a doc string$/, function(stepName, callback) { this.stepDefinitions += "Given(/^" + stepName + "$/, function(docString, callback) {\ world.docString = docString;\ callback();\ });"; callback(); }); Given(/^the following data table in a step:$/, function(dataTable, callback) { this.featureSource += "Feature:\n"; this.featureSource += " Scenario:\n"; this.featureSource += " When a step with data table:\n"; this.featureSource += dataTable.replace(/^/gm, ' '); callback(); }); Given(/a custom World constructor calling back with an explicit object$/, function(callback) { this.stepDefinitions += "this.World = function CustomWorldConstructor(callback) {\n\ callback({someFunction: function () {world.explicitWorldFunctionCalled = true; }});\n\ };\n"; callback(); }); Given(/^several features$/, function(callback) { this.features = [ ["feature1", "Feature: One\n\n Scenario:\n"], ["feature2", "Feature: Two\n\n Scenario:\n"], ["feature3", "Feature: Three\n\n Scenario:\n"], ]; callback(); }); When(/^Cucumber executes the scenario$/, function(callback) { this.runFeature({}, callback); }); this.When(/^Cucumber executes a scenario using that mapping$/, function(callback) { this.runAScenarioCallingMapping(callback); }); this.When(/^Cucumber executes a scenario that passes arguments to that mapping$/, function(callback) { this.runAScenarioCallingMappingWithParameters(callback); }); When(/^Cucumber executes a scenario that calls a function on the explicit World object$/, function(callback) { this.runAScenarioCallingWorldFunction(callback); }); When(/^Cucumber runs the feature$/, function(callback) { this.runFeature({}, callback); }); When(/^Cucumber runs the features$/, function(callback) { this.runFeatures({}, callback); }); When(/^Cucumber runs the scenario with steps for a calculator$/, function(callback) { RpnCalculator = require('../support/rpn_calculator'); var supportCode = function() { require('./calculator_steps').initialize.call(this, RpnCalculator) }; this.runFeatureWithSupportCodeSource(supportCode, {}, callback); }); When(/^the data table is passed to a step mapping that converts it to key\/value pairs$/, function(callback) { this.stepDefinitions += "When(/^a step with data table:$/, function(dataTable, callback) {\ world.dataTableLog = dataTable.hashes();\ callback();\ });\n"; this.runFeature({}, callback); }); When(/^the data table is passed to a step mapping that gets the row arrays without the header$/, function(callback) { this.stepDefinitions += "When(/^a step with data table:$/, function(dataTable, callback) {\ world.dataTableLog = dataTable.rows();\ callback();\ });\n"; this.runFeature({}, callback); }); Then(/^the scenario passes$/, function(callback) { this.assertPassedScenario(); callback(); }); Then(/^the scenario fails$/, function(callback) { this.assertFailedScenario(); callback(); }); Then(/^the scenario is pending$/, function(callback) { this.assertPendingScenario(); callback(); }); Then(/^the scenario is undefined$/, function(callback) { this.assertUndefinedScenario(); callback(); }); Then(/^the scenario called "([^"]*)" is reported as failing$/, function(scenarioName, callback) { this.assertScenarioReportedAsFailing(scenarioName); callback(); }); Then(/^the scenario called "([^"]*)" is not reported as failing$/, function(scenarioName, callback) { this.assertScenarioNotReportedAsFailing(scenarioName); callback(); }); Then(/^the step "([^"]*)" passes$/, function(stepName, callback) { this.assertPassedStep(stepName); callback(); }); Then(/^the step "([^"]*)" is skipped$/, function(stepName, callback) { this.assertSkippedStep(stepName); callback(); }); Then(/^the mapping is run$/, function(callback) { this.assertPassedMapping(); callback(); }); Then(/^the mapping receives the arguments$/, function(callback) { this.assertPassedMappingWithArguments(); callback(); }); Then(/^the feature passes$/, function(callback) { this.assertPassedFeature(); callback(); }); Then(/^all features are run$/, function(callback) { this.assertPassedFeatures(); callback(); }); Then(/^the failure message "([^"]*)" is output$/, function(message, callback) { this.assertFailureMessage(message); callback(); }); Then(/^the received data table array equals the following:$/, function(expectedDataTableJSON, callback) { var expectedDataTable = JSON.parse(expectedDataTableJSON); this.assertEqual(expectedDataTable, World.mostRecentInstance.dataTableLog); callback(); }); Then(/^the data table is converted to the following:$/, function(expectedDataTableJSON, callback) { var expectedDataTable = JSON.parse(expectedDataTableJSON); this.assertEqual(expectedDataTable, World.mostRecentInstance.dataTableLog); callback(); }); Then(/^the received doc string equals the following:$/, function(docString, callback) { this.assertEqual(docString, World.mostRecentInstance.docString); callback(); }); this.Then(/^the explicit World object function should have been called$/, function(callback) { this.assertTrue(this.explicitWorldFunctionCalled); callback(); }); Then(/^the (before|after) hook is fired (?:before|after) the scenario$/, function(hookType, callback) { if (hookType == 'before') this.assertCycleSequence(hookType, 'step 1'); else this.assertCycleSequence('step 1', hookType); callback(); }); Then(/^the around hook fires around the scenario$/, function(callback) { this.assertCycleSequence('around-pre', 'step 1', 'around-post'); callback(); }); Then(/^the around hook is fired around the other hooks$/, function(callback) { this.assertCycleSequence('around-pre', 'before', 'step 1', 'after', 'around-post'); callback(); }); Then(/^the hook is fired$/, function(callback) { this.assertCycleSequence('hook'); callback(); }); Then(/^the hook is not fired$/, function(callback) { this.assertCycleSequenceExcluding('hook'); callback(); }); }; module.exports = cucumberSteps;
window.initUserList = () => { initUserSelections(); initUserDeleteBtn(); initUserMergeBtn(); }; const initUserSelections = () => { $('input[name=user_db]').each(function() { userSelectRow($(this)); }); $('#select-all').change(function() { $('input[name=user_db]').prop('checked', $(this).is(':checked')); $('input[name=user_db]').each(function() { userSelectRow($(this)); }); }); $('input[name=user_db]').change(function() { userSelectRow($(this)); }); }; const userSelectRow = $element => { updateUserSelections(); $('input[name=user_db]').each(() => { const id = $element.val(); $(`#${id}`).toggleClass('warning', $element.is(':checked')); }); }; const updateUserSelections = () => { const selected = $('input[name=user_db]:checked').length; $('#user-actions').toggleClass('hidden', selected === 0); $('#user-merge').toggleClass('hidden', selected < 2); if (selected === 0) { $('#select-all').prop('indeterminate', false); $('#select-all').prop('checked', false); } else if ($('input[name=user_db]:not(:checked)').length === 0) { $('#select-all').prop('indeterminate', false); $('#select-all').prop('checked', true); } else { $('#select-all').prop('indeterminate', true); } }; const initUserDeleteBtn = () => $('#user-delete').click(function(event) { clearNotifications(); event.preventDefault(); const confirmMessage = $(this) .data('confirm') .replace('{users}', $('input[name=user_db]:checked').length); if (confirm(confirmMessage)) { const user_keys = []; $('input[name=user_db]:checked').each(function() { $(this).attr('disabled', true); user_keys.push($(this).val()); }); const deleteUrl = $(this).data('api-url'); const successMessage = $(this).data('success'); const errorMessage = $(this).data('error'); apiCall( 'DELETE', deleteUrl, { user_keys: user_keys.join(','), }, (err, result) => { if (err) { $('input[name=user_db]:disabled').removeAttr('disabled'); showNotification( errorMessage.replace('{users}', user_keys.length), 'danger', ); return; } $(`#${result.join(', #')}`).fadeOut(function() { $(this).remove(); updateUserSelections(); showNotification( successMessage.replace('{users}', user_keys.length), 'success', ); }); }, ); } }); window.initUserMerge = () => { const user_keys = $('#user_keys').val(); const api_url = $('.api-url').data('api-url'); apiCall( 'GET', api_url, { user_keys, }, (error, result) => { if (error) { LOG('Something went terribly wrong'); return; } window.user_dbs = result; $('input[name=user_db]').removeAttr('disabled'); }, ); $('input[name=user_db]').change(event => { const user_key = $(event.currentTarget).val(); selectDefaultUser(user_key); }); }; const selectDefaultUser = user_key => { $('.user-row') .removeClass('success') .addClass('danger'); $(`#${user_key}`) .removeClass('danger') .addClass('success'); for (const user_db of user_dbs) { if (user_key === user_db.key) { $('input[name=user_key]').val(user_db.key); $('input[name=username]').val(user_db.username); $('input[name=name]').val(user_db.name); $('input[name=email]').val(user_db.email); break; } } }; const initUserMergeBtn = () => $('#user-merge').click(function(event) { event.preventDefault(); const user_keys = []; $('input[name=user_db]:checked').each(function() { user_keys.push($(this).val()); }); const user_merge_url = $(this).data('user-merge-url'); window.location.href = `${user_merge_url}?user_keys=${user_keys.join(',')}`; });
(function () { requirejs.config({ paths: { 'breeze': '../Scripts/breeze.debug', 'breeze.savequeuing': '../Scripts/breeze.savequeuing', 'jquery': '../Scripts/jquery-1.8.3.min', 'ko': '../Scripts/knockout-2.2.0', 'Q': '../Scripts/q.min', 'text': '../Scripts/text', 'toastr': '../Scripts/toastr', } }); // Launch the app // Start by requiring the 3rd party libraries that Breeze should find define(['require', 'ko', 'jquery', 'logger', 'Q'], function (require, ko, $, logger) { logger.info('Breeze Todo is booting'); // require the 'viewModel' shell // require '../text' which is an html-loader require plugin; // see http://requirejs.org/docs/api.html#text require(['viewModel', 'text!view.html'], function (viewModel, viewHtml) { var $view = $(viewHtml); ko.applyBindings(viewModel, $view.get(0)); $("#applicationHost").append($view); }); }); })();
module.exports = function (grunt) { 'use strict'; // Project configuration. var saucekey = process.env.saucekey; if (!saucekey) { console.warn('Unable to load Saucelabs key'); } grunt.initConfig({ jade: { release: { files: { 'tests/index.html': ['tests/views/index.jade'] } } }, clean: ['tests/index.html'], connect: { server: { options: { base: '.', port: 9999 } } }, 'saucelabs-mocha': { all: { options: { username: process.env.sauceuser, key: saucekey, testname: 'db.js', tags: ['master'], urls: ['http://127.0.0.1:9999/tests/index.html'], public: !!process.env.TRAVIS_JOB_ID, build: process.env.TRAVIS_JOB_ID, browsers: [/* { browserName: 'firefox', platform: 'Windows 2012', version: '17' }, { browserName: 'internet explorer', platform: 'Windows 2012', version: '10' }, */ { browserName: 'chrome', platform: 'Windows 2008' }] }, onTestComplete: function (result, callback) { console.dir(result); } } }, karma: { options: { configFile: 'karma.conf.js' }, ci: { singleRun: true, browsers: ['PhantomJS'] }, dev: { singleRun: false, browsers: ['PhantomJS'] }, 'dev-single': { singleRun: true, browsers: ['PhantomJS'] } }, eslint: { target: ['src/db.js', 'src/test-worker.js'] }, babel: { options: { sourceMap: true }, dist: { files: { 'dist/db.js': 'src/db.js', 'tests/test-worker.js': 'src/test-worker.js' } } }, browserify: { dist: { files: { 'dist/db.js': 'dist/db.js' }, options: { browserifyOptions: { standalone: 'db' } } } }, uglify: { options: { sourceMap: true, sourceMapIncludeSources: true }, dbjs: { options: { sourceMapIn: 'dist/db.js.map' // input sourcemap from a previous compilation }, files: { 'dist/db.min.js': ['dist/db.js'] } }, testworker: { options: { sourceMapIn: 'tests/test-worker.js.map' // input sourcemap from a previous compilation }, files: { 'tests/test-worker.js': ['tests/test-worker.js'] } } } }); // load all grunt tasks require('matchdep').filterDev(['grunt-*', '!grunt-cli']).forEach(grunt.loadNpmTasks); grunt.registerTask('forever', function () { this.async(); }); var devJobs = ['eslint', 'babel', 'browserify', 'uglify', 'clean', 'jade']; var karmaJobs = devJobs.slice(); if (process.env.TRAVIS_JOB_ID) { karmaJobs.push('karma:ci'); } else { karmaJobs.push('karma:dev-single'); } grunt.registerTask('dev', devJobs); grunt.registerTask('phantom', karmaJobs); grunt.registerTask('test', function () { var testJobs = karmaJobs.concat('connect'); if (saucekey && !process.env.TRAVIS_PULL_REQUEST) { console.info('adding Saucelabs integration'); testJobs.push('saucelabs-mocha'); } grunt.task.run(testJobs); }); grunt.registerTask('default', 'test'); grunt.registerTask('test:local', function () { grunt.task.run(devJobs); grunt.task.run('connect:server:keepalive'); }); };
var oembedUtils = require('./oembedUtils'); module.exports = { provides: ['oembedLinks', '__noOembedLinks'], getData: function(url) { var oembedLinks = oembedUtils.findOembedLinks(url); return { oembedLinks: oembedLinks, __noOembedLinks: !oembedLinks || !oembedLinks.length || null // null - means value not in context. }; } };
import React from 'react'; import ReactDOM from 'react-dom'; import JqxRangeSelector from '../../../jqwidgets-react/react_jqxrangeselector.js'; import JqxButton from '../../../jqwidgets-react/react_jqxbuttons.js'; class App extends React.Component { componentDidMount() { this.refs.setSelection.on('click', () => { this.refs.myRangeSelector.setRange(30, 70); }); this.refs.getSelection.on('click', () => { let range = this.refs.myRangeSelector.getRange(); alert('The selected range is from ' + range.from + ' to ' + range.to); }); } render () { return ( <div> <JqxRangeSelector ref='myRangeSelector' width={750} height={100} min={0} max={200} range={{ from: 10, to: 50 }} majorTicksInterval={10} minorTicksInterval={1} /> <div style={{ marginLeft: 30, marginTop: 50 }}> <JqxButton ref='setSelection' value='Set range' style={{ float: 'left', marginRight: 10}} width={100} height={25} /> <JqxButton ref='getSelection' value='Get range' width={100} height={25} /> </div> </div> ) } } ReactDOM.render(<App />, document.getElementById('app'));
'use strict'; var _jsxAstUtils = require('jsx-ast-utils'); var _schemas = require('../util/schemas'); var _isHiddenFromScreenReader = require('../util/isHiddenFromScreenReader'); var _isHiddenFromScreenReader2 = _interopRequireDefault(_isHiddenFromScreenReader); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var errorMessage = 'Anchors must have content and the content must be accessible by a screen reader.'; /** * @fileoverview Enforce anchor elements to contain accessible content. * @author Lisa Ring & Niklas Holmberg */ // ---------------------------------------------------------------------------- // Rule Definition // ---------------------------------------------------------------------------- var schema = (0, _schemas.generateObjSchema)({ components: _schemas.arraySchema }); module.exports = { meta: { docs: {}, schema: [schema] }, create: function create(context) { return { JSXOpeningElement: function JSXOpeningElement(node) { var options = context.options[0] || {}; var componentOptions = options.components || []; var typeCheck = ['a'].concat(componentOptions); var nodeType = (0, _jsxAstUtils.elementType)(node); // Only check anchor elements and custom types. if (typeCheck.indexOf(nodeType) === -1) { return; } var isAccessible = node.parent.children.some(function (child) { switch (child.type) { case 'Literal': return Boolean(child.value); case 'JSXElement': return !(0, _isHiddenFromScreenReader2.default)((0, _jsxAstUtils.elementType)(child.openingElement), child.openingElement.attributes); case 'JSXExpressionContainer': if (child.expression.type === 'Identifier') { return child.expression.name !== 'undefined'; } return true; default: return false; } }) || (0, _jsxAstUtils.hasAnyProp)(node.attributes, ['dangerouslySetInnerHTML', 'children']); if (isAccessible) { return; } context.report({ node: node, message: errorMessage }); } }; } };
var crypto = require('crypto'); var keystone = require('../'); var scmp = require('scmp'); var utils = require('keystone-utils'); /** * Creates a hash of str with Keystone's cookie secret. * Only hashes the first half of the string. */ function hash(str) { // force type str = '' + str; // get the first half str = str.substr(0, Math.round(str.length / 2)); // hash using sha256 return crypto .createHmac('sha256', keystone.get('cookie secret')) .update(str) .digest('base64') .replace(/\=+$/, ''); } /** * Signs in a user using user obejct * * @param {Object} user - user object * @param {Object} req - express request object * @param {Object} res - express response object * @param {function()} onSuccess callback, is passed the User instance */ function signinWithUser(user, req, res, onSuccess) { if (arguments.length < 4) { throw new Error('keystone.session.signinWithUser requires user, req and res objects, and an onSuccess callback.'); } if ('object' !== typeof user) { throw new Error('keystone.session.signinWithUser requires user to be an object.'); } if ('object' !== typeof req) { throw new Error('keystone.session.signinWithUser requires req to be an object.'); } if ('object' !== typeof res) { throw new Error('keystone.session.signinWithUser requires res to be an object.'); } if ('function' !== typeof onSuccess) { throw new Error('keystone.session.signinWithUser requires onSuccess to be a function.'); } req.session.regenerate(function() { req.user = user; req.session.userId = user.id; // if the user has a password set, store a persistence cookie to resume sessions if (keystone.get('cookie signin') && user.password) { var userToken = user.id + ':' + hash(user.password); res.cookie('keystone.uid', userToken, { signed: true, httpOnly: true }); } onSuccess(user); }); } exports.signinWithUser = signinWithUser; var postHookedSigninWithUser = function(user, req, res, onSuccess, onFail) { keystone.callHook(user, 'post:signin', function(err) { if (err) { return onFail(err); } exports.signinWithUser(user, req, res, onSuccess, onFail); }); }; /** * Signs in a user user matching the lookup filters * * @param {Object} lookup - must contain email and password * @param {Object} req - express request object * @param {Object} res - express response object * @param {function()} onSuccess callback, is passed the User instance * @param {function()} onFail callback */ var doSignin = function(lookup, req, res, onSuccess, onFail) { if (!lookup) { return onFail(new Error('session.signin requires a User ID or Object as the first argument')); } var User = keystone.list(keystone.get('user model')); if ('string' === typeof lookup.email && 'string' === typeof lookup.password) { // create regex for email lookup with special characters escaped var emailRegExp = new RegExp('^' + utils.escapeRegExp(lookup.email) + '$', 'i'); // match email address and password User.model.findOne({ email: emailRegExp }).exec(function(err, user) { if (user) { user._.password.compare(lookup.password, function(err, isMatch) { if (!err && isMatch) { postHookedSigninWithUser(user, req, res, onSuccess, onFail); } else { onFail(err || new Error('Incorrect email or password')); } }); } else { onFail(err); } }); } else { lookup = '' + lookup; // match the userId, with optional password check var userId = (lookup.indexOf(':') > 0) ? lookup.substr(0, lookup.indexOf(':')) : lookup; var passwordCheck = (lookup.indexOf(':') > 0) ? lookup.substr(lookup.indexOf(':') + 1) : false; User.model.findById(userId).exec(function(err, user) { if (user && (!passwordCheck || scmp(passwordCheck, hash(user.password)))) { postHookedSigninWithUser(user, req, res, onSuccess, onFail); } else { onFail(err || new Error('Incorrect user or password')); } }); } }; exports.signin = function(lookup, req, res, onSuccess, onFail) { keystone.callHook({}, 'pre:signin', function(err) { if (err) { return onFail(err); } doSignin(lookup, req, res, onSuccess, onFail); }); }; /** * Signs the current user out and resets the session * * @param {Object} req - express request object * @param {Object} res - express response object * @param {function()} next callback */ exports.signout = function(req, res, next) { keystone.callHook(req.user, 'pre:signout', function(err) { if (err) { console.log("An error occurred in signout 'pre' middleware", err); } res.clearCookie('keystone.uid'); req.user = null; req.session.regenerate(function(err) { if (err) { return next(err); } keystone.callHook({}, 'post:signout', function(err) { if (err) { console.log("An error occurred in signout 'post' middleware", err); } next(); }); }); }); }; /** * Middleware to ensure session persistence across server restarts * * Looks for a userId cookie, and if present, and there is no user signed in, * automatically signs the user in. * * @param {Object} req - express request object * @param {Object} res - express response object * @param {function()} next callback */ exports.persist = function(req, res, next) { var User = keystone.list(keystone.get('user model')); if (!req.session) { console.error('\nKeystoneJS Runtime Error:\n\napp must have session middleware installed. Try adding "express-session" to your express instance.\n'); process.exit(1); } if (keystone.get('cookie signin') && !req.session.userId && req.signedCookies['keystone.uid'] && req.signedCookies['keystone.uid'].indexOf(':') > 0) { exports.signin(req.signedCookies['keystone.uid'], req, res, function() { next(); }, function(err) { next(err); }); } else if (req.session.userId) { User.model.findById(req.session.userId).exec(function(err, user) { if (err) return next(err); req.user = user; next(); }); } else { next(); } }; /** * Middleware to enable access to Keystone * * Bounces the user to the signin screen if they are not signed in or do not have permission. * * req.user is the user returned by the database. It's type is Keystone.List. * * req.user.canAccessKeystone denotes whether the user has access to the admin panel. * If you're having issues double check your user model. Setting `canAccessKeystone` to true in * the database will not be reflected here if it is virtual. * See http://mongoosejs.com/docs/guide.html#virtuals * * @param {Object} req - express request object * @param req.user - The user object Keystone.List * @param req.user.canAccessKeystone {Boolean|Function} * @param {Object} res - express response object * @param {function()} next callback */ exports.keystoneAuth = function(req, res, next) { if (!req.user || !req.user.canAccessKeystone) { var from = new RegExp('^\/keystone\/?$', 'i').test(req.url) ? '' : '?from=' + req.url; return res.redirect(keystone.get('signin url') + from); } next(); };
var alias = Ember.computed.alias, not = Ember.computed.not; App.ProjectIndexController = Ember.ObjectController.extend({ // Track the project budget and billing details hoursBudgeted: alias('hourBudget'), clientName: alias('client.name'), isInternal: not('client'), // Sum up the hours logged for the project by looping over // all of the time entries that have been entered towards it. hoursLogged: function () { return this.get('timeEntries').reduce(function (previous, timeEntry) { return timeEntry.get('hours') + (previous ? previous : 0); }) || 0; }.property('timeEntries.@each.hours'), });
// Masonry var Masonry = function() { 'use strict'; // Handle Masonry var handleMasonry = function() { var $container = $('.js__masonry'); // initialize Masonry after all images have loaded $container.imagesLoaded( function() { $container.masonry({ itemSelector: '.js__masonry-item', // use a separate class for itemSelector, other than .col- columnWidth: '.js__masonry-sizer', percentPosition: true }); }); $.fn.masonryImagesReveal = function( $items ) { var msnry = this.data('masonry'); var itemSelector = msnry.options.itemSelector; // hide by default $items.hide(); // append to container this.append( $items ); $items.imagesLoaded().progress( function( imgLoad, image ) { // get item // image is imagesLoaded class, not <img>, <img> is image.img var $item = $( image.img ).parents( itemSelector ); // un-hide item $item.show(); // masonry does its thing msnry.appended( $item ); }); return this; }; } return { init: function() { handleMasonry(); // initial setup for Masonry } } }(); $(document).ready(function() { Masonry.init(); });
var loadState={ preload:function(){ //add a loading label on screen var loadingLabel = game.add.text(game.width/2, 150, 'loading...', { font:'30px Arial', fill:'#ffffff'}); loadingLabel.anchor.setTo(0.5,0.5); //display progress bar var progressBar= game.add.sprite(game.width/2,200,'progressBar'); progressBar.anchor.setTo(0.5,0.5); game.load.setPreloadSprite(progressBar); //load all assest game.load.spritesheet('player','assets/player2.png',20,20); game.load.image('wallV', 'assets/wallVertical.png'); game.load.image('wallH', 'assets/wallHorizontal.png'); game.load.image('coin', 'assets/coin.png'); game.load.image('enemy', 'assets/enemy.png'); //load new assets for use in menu state game.load.image('background','assets/background.png'); //jump sound game.load.audio('jump',['assets/jump.ogg','assets/jump.mp3']); //take coin sound game.load.audio('coin',['assets/coin.ogg','assets/coin.mp3']); //player die sound game.load.audio('dead',['assets/dead.ogg','assets/dead.mp3']); game.load.image('pixel','assets/pixel.png'); game.load.spritesheet('mute', 'assets/muteButton.png', 28, 22); game.load.image('jumpButton', 'assets/jumpButton.png'); game.load.image('rightButton', 'assets/rightButton.png'); game.load.image('leftButton', 'assets/leftButton.png'); }, create:function(){ //go to menu state game.state.start('menu'); } };
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. 'use strict'; var should = require('should'); var http = require('http'); var util = require('util'); var assert = require('assert'); var _ = require('underscore') var msRest = require('ms-rest'); var msRestAzure = require('ms-rest-azure'); var reportClient = require('../Expected/AcceptanceTests/AzureReport/AutoRestReportServiceForAzure'); var dummySubscriptionId = 'a878ae02-6106-429z-9397-58091ee45g98'; var dummyToken = 'dummy12321343423'; var credentials = new msRestAzure.TokenCredentials(dummyToken); var clientOptions = {}; var baseUri = 'http://localhost:3000'; describe('nodejs', function () { describe('Swagger BAT coverage report', function () { var testClient = new reportClient(credentials, baseUri, clientOptions); it('should have 100% coverage for Azure', function (done) { testClient.getReport(function (error, result) { should.not.exist(error); //console.log('The test coverage for azure is ' + util.inspect(result.body)); var total = _.keys(result.body).length; var passed = 0; _.keys(result.body).forEach(function(item) { if (result.body[item] > 0) { passed++; } else { console.log('No coverage for scenario: ' + item + '\n'); } }); var result = Math.floor((passed / total) * 100); console.log('Passed: ' + passed + ', Total: ' + total + ', coverage: ' + result + '% .'); result.should.equal(100); done(); }); }); }); });
"use strict"; // Replace `#!` with `//` so `typescript`, `flow`, and `espree` can parse it as line comment // Inspired by ESLint parse function https://github.com/eslint/eslint/blob/9d6063add931f0803cae1676d5df307baf114360/lib/linter/linter.js#L635 function replaceHashbang(text) { if (text.charAt(0) === "#" && text.charAt(1) === "!") { return "//" + text.slice(2); } return text; } module.exports = replaceHashbang;
(function (define) { 'use strict'; define(function (require) { var interceptor; interceptor = require('rest/interceptor'); /** * Authenticates the request using JWT Authentication * * @param {Client} [client] client to wrap * @param {Object} config * * @returns {Client} */ return interceptor({ request: function (request, config) { var token, headers; token = localStorage.getItem('jwt-token'); headers = request.headers || (request.headers = {}); if ( token !== null && token !== 'undefined') { headers.Authorization = token; } return request; }, response: function (response) { if (response.status && response.status.code == 401) { localStorage.removeItem('jwt-token'); } if (response.headers && response.headers.Authorization) { localStorage.setItem('jwt-token', response.headers.Authorization) } if (response.entity && response.entity.token && response.entity.token.length > 10) { localStorage.setItem('jwt-token', 'Bearer ' + response.entity.token); } return response; } }); }); }( typeof define === 'function' && define.amd ? define : function (factory) { module.exports = factory(require); } // Boilerplate for AMD and Node ));
/*! * jQuery JavaScript Library v1.11.1 -effects,-effects/Tween,-effects/animatedSelector,-effects/support * http://jquery.com/ * * Includes Sizzle.js * http://sizzlejs.com/ * * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2014-09-27T21:50Z */ (function( global, factory ) { if ( typeof module === "object" && typeof module.exports === "object" ) { // For CommonJS and CommonJS-like environments where a proper window is present, // execute the factory and get jQuery // For environments that do not inherently posses a window with a document // (such as Node.js), expose a jQuery-making factory as module.exports // This accentuates the need for the creation of a real window // e.g. var jQuery = require("jquery")(window); // See ticket #14549 for more info module.exports = global.document ? factory( global, true ) : function( w ) { if ( !w.document ) { throw new Error( "jQuery requires a window with a document" ); } return factory( w ); }; } else { factory( global ); } // Pass this if window is not defined yet }(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { // Can't do this because several apps including ASP.NET trace // the stack via arguments.caller.callee and Firefox dies if // you try to trace through "use strict" call chains. (#13335) // Support: Firefox 18+ // var deletedIds = []; var slice = deletedIds.slice; var concat = deletedIds.concat; var push = deletedIds.push; var indexOf = deletedIds.indexOf; var class2type = {}; var toString = class2type.toString; var hasOwn = class2type.hasOwnProperty; var support = {}; var version = "1.11.1 -effects,-effects/Tween,-effects/animatedSelector,-effects/support", // Define a local copy of jQuery jQuery = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' // Need init if jQuery is called (just allow error to be thrown if not included) return new jQuery.fn.init( selector, context ); }, // Support: Android<4.1, IE<9 // Make sure we trim BOM and NBSP rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, // Matches dashed string for camelizing rmsPrefix = /^-ms-/, rdashAlpha = /-([\da-z])/gi, // Used by jQuery.camelCase as callback to replace() fcamelCase = function( all, letter ) { return letter.toUpperCase(); }; jQuery.fn = jQuery.prototype = { // The current version of jQuery being used jquery: version, constructor: jQuery, // Start with an empty selector selector: "", // The default length of a jQuery object is 0 length: 0, toArray: function() { return slice.call( this ); }, // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function( num ) { return num != null ? // Return just the one element from the set ( num < 0 ? this[ num + this.length ] : this[ num ] ) : // Return all the elements in a clean array slice.call( this ); }, // Take an array of elements and push it onto the stack // (returning the new matched element set) pushStack: function( elems ) { // Build a new jQuery matched element set var ret = jQuery.merge( this.constructor(), elems ); // Add the old object onto the stack (as a reference) ret.prevObject = this; ret.context = this.context; // Return the newly-formed element set return ret; }, // Execute a callback for every element in the matched set. // (You can seed the arguments with an array of args, but this is // only used internally.) each: function( callback, args ) { return jQuery.each( this, callback, args ); }, map: function( callback ) { return this.pushStack( jQuery.map(this, function( elem, i ) { return callback.call( elem, i, elem ); })); }, slice: function() { return this.pushStack( slice.apply( this, arguments ) ); }, first: function() { return this.eq( 0 ); }, last: function() { return this.eq( -1 ); }, eq: function( i ) { var len = this.length, j = +i + ( i < 0 ? len : 0 ); return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); }, end: function() { return this.prevObject || this.constructor(null); }, // For internal use only. // Behaves like an Array's method, not like a jQuery method. push: push, sort: deletedIds.sort, splice: deletedIds.splice }; jQuery.extend = jQuery.fn.extend = function() { var src, copyIsArray, copy, name, options, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false; // Handle a deep copy situation if ( typeof target === "boolean" ) { deep = target; // skip the boolean and the target target = arguments[ i ] || {}; i++; } // Handle case when target is a string or something (possible in deep copy) if ( typeof target !== "object" && !jQuery.isFunction(target) ) { target = {}; } // extend jQuery itself if only one argument is passed if ( i === length ) { target = this; i--; } for ( ; i < length; i++ ) { // Only deal with non-null/undefined values if ( (options = arguments[ i ]) != null ) { // Extend the base object for ( name in options ) { src = target[ name ]; copy = options[ name ]; // Prevent never-ending loop if ( target === copy ) { continue; } // Recurse if we're merging plain objects or arrays if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { if ( copyIsArray ) { copyIsArray = false; clone = src && jQuery.isArray(src) ? src : []; } else { clone = src && jQuery.isPlainObject(src) ? src : {}; } // Never move original objects, clone them target[ name ] = jQuery.extend( deep, clone, copy ); // Don't bring in undefined values } else if ( copy !== undefined ) { target[ name ] = copy; } } } } // Return the modified object return target; }; jQuery.extend({ // Unique for each copy of jQuery on the page expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), // Assume jQuery is ready without the ready module isReady: true, error: function( msg ) { throw new Error( msg ); }, noop: function() {}, // See test/unit/core.js for details concerning isFunction. // Since version 1.3, DOM methods and functions like alert // aren't supported. They return false on IE (#2968). isFunction: function( obj ) { return jQuery.type(obj) === "function"; }, isArray: Array.isArray || function( obj ) { return jQuery.type(obj) === "array"; }, isWindow: function( obj ) { /* jshint eqeqeq: false */ return obj != null && obj == obj.window; }, isNumeric: function( obj ) { // parseFloat NaNs numeric-cast false positives (null|true|false|"") // ...but misinterprets leading-number strings, particularly hex literals ("0x...") // subtraction forces infinities to NaN return !jQuery.isArray( obj ) && obj - parseFloat( obj ) >= 0; }, isEmptyObject: function( obj ) { var name; for ( name in obj ) { return false; } return true; }, isPlainObject: function( obj ) { var key; // Must be an Object. // Because of IE, we also have to check the presence of the constructor property. // Make sure that DOM nodes and window objects don't pass through, as well if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { return false; } try { // Not own constructor property must be Object if ( obj.constructor && !hasOwn.call(obj, "constructor") && !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { return false; } } catch ( e ) { // IE8,9 Will throw exceptions on certain host objects #9897 return false; } // Support: IE<9 // Handle iteration over inherited properties before own properties. if ( support.ownLast ) { for ( key in obj ) { return hasOwn.call( obj, key ); } } // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. for ( key in obj ) {} return key === undefined || hasOwn.call( obj, key ); }, type: function( obj ) { if ( obj == null ) { return obj + ""; } return typeof obj === "object" || typeof obj === "function" ? class2type[ toString.call(obj) ] || "object" : typeof obj; }, // Evaluates a script in a global context // Workarounds based on findings by Jim Driscoll // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context globalEval: function( data ) { if ( data && jQuery.trim( data ) ) { // We use execScript on Internet Explorer // We use an anonymous function so that context is window // rather than jQuery in Firefox ( window.execScript || function( data ) { window[ "eval" ].call( window, data ); } )( data ); } }, // Convert dashed to camelCase; used by the css and data modules // Microsoft forgot to hump their vendor prefix (#9572) camelCase: function( string ) { return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); }, nodeName: function( elem, name ) { return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); }, // args is for internal usage only each: function( obj, callback, args ) { var value, i = 0, length = obj.length, isArray = isArraylike( obj ); if ( args ) { if ( isArray ) { for ( ; i < length; i++ ) { value = callback.apply( obj[ i ], args ); if ( value === false ) { break; } } } else { for ( i in obj ) { value = callback.apply( obj[ i ], args ); if ( value === false ) { break; } } } // A special, fast, case for the most common use of each } else { if ( isArray ) { for ( ; i < length; i++ ) { value = callback.call( obj[ i ], i, obj[ i ] ); if ( value === false ) { break; } } } else { for ( i in obj ) { value = callback.call( obj[ i ], i, obj[ i ] ); if ( value === false ) { break; } } } } return obj; }, // Support: Android<4.1, IE<9 trim: function( text ) { return text == null ? "" : ( text + "" ).replace( rtrim, "" ); }, // results is for internal usage only makeArray: function( arr, results ) { var ret = results || []; if ( arr != null ) { if ( isArraylike( Object(arr) ) ) { jQuery.merge( ret, typeof arr === "string" ? [ arr ] : arr ); } else { push.call( ret, arr ); } } return ret; }, inArray: function( elem, arr, i ) { var len; if ( arr ) { if ( indexOf ) { return indexOf.call( arr, elem, i ); } len = arr.length; i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; for ( ; i < len; i++ ) { // Skip accessing in sparse arrays if ( i in arr && arr[ i ] === elem ) { return i; } } } return -1; }, merge: function( first, second ) { var len = +second.length, j = 0, i = first.length; while ( j < len ) { first[ i++ ] = second[ j++ ]; } // Support: IE<9 // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists) if ( len !== len ) { while ( second[j] !== undefined ) { first[ i++ ] = second[ j++ ]; } } first.length = i; return first; }, grep: function( elems, callback, invert ) { var callbackInverse, matches = [], i = 0, length = elems.length, callbackExpect = !invert; // Go through the array, only saving the items // that pass the validator function for ( ; i < length; i++ ) { callbackInverse = !callback( elems[ i ], i ); if ( callbackInverse !== callbackExpect ) { matches.push( elems[ i ] ); } } return matches; }, // arg is for internal usage only map: function( elems, callback, arg ) { var value, i = 0, length = elems.length, isArray = isArraylike( elems ), ret = []; // Go through the array, translating each of the items to their new values if ( isArray ) { for ( ; i < length; i++ ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret.push( value ); } } // Go through every key on the object, } else { for ( i in elems ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret.push( value ); } } } // Flatten any nested arrays return concat.apply( [], ret ); }, // A global GUID counter for objects guid: 1, // Bind a function to a context, optionally partially applying any // arguments. proxy: function( fn, context ) { var args, proxy, tmp; if ( typeof context === "string" ) { tmp = fn[ context ]; context = fn; fn = tmp; } // Quick check to determine if target is callable, in the spec // this throws a TypeError, but we will just return undefined. if ( !jQuery.isFunction( fn ) ) { return undefined; } // Simulated bind args = slice.call( arguments, 2 ); proxy = function() { return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); }; // Set the guid of unique handler to the same of original handler, so it can be removed proxy.guid = fn.guid = fn.guid || jQuery.guid++; return proxy; }, now: function() { return +( new Date() ); }, // jQuery.support is not used in Core but other projects attach their // properties to it so it needs to exist. support: support }); // Populate the class2type map jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); }); function isArraylike( obj ) { var length = obj.length, type = jQuery.type( obj ); if ( type === "function" || jQuery.isWindow( obj ) ) { return false; } if ( obj.nodeType === 1 && length ) { return true; } return type === "array" || length === 0 || typeof length === "number" && length > 0 && ( length - 1 ) in obj; } var Sizzle = /*! * Sizzle CSS Selector Engine v1.10.19 * http://sizzlejs.com/ * * Copyright 2013 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2014-04-18 */ (function( window ) { var i, support, Expr, getText, isXML, tokenize, compile, select, outermostContext, sortInput, hasDuplicate, // Local document vars setDocument, document, docElem, documentIsHTML, rbuggyQSA, rbuggyMatches, matches, contains, // Instance-specific data expando = "sizzle" + -(new Date()), preferredDoc = window.document, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), sortOrder = function( a, b ) { if ( a === b ) { hasDuplicate = true; } return 0; }, // General-purpose constants strundefined = typeof undefined, MAX_NEGATIVE = 1 << 31, // Instance methods hasOwn = ({}).hasOwnProperty, arr = [], pop = arr.pop, push_native = arr.push, push = arr.push, slice = arr.slice, // Use a stripped-down indexOf if we can't use a native one indexOf = arr.indexOf || function( elem ) { var i = 0, len = this.length; for ( ; i < len; i++ ) { if ( this[i] === elem ) { return i; } } return -1; }, booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", // Regular expressions // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace whitespace = "[\\x20\\t\\r\\n\\f]", // http://www.w3.org/TR/css3-syntax/#characters characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", // Loosely modeled on CSS identifier characters // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier identifier = characterEncoding.replace( "w", "w#" ), // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace + // Operator (capture 2) "*([*^$|!~]?=)" + whitespace + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + "*\\]", pseudos = ":(" + characterEncoding + ")(?:\\((" + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: // 1. quoted (capture 3; capture 4 or capture 5) "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + // 2. simple (capture 6) "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + // 3. anything else (capture 2) ".*" + ")\\)|)", // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), rpseudo = new RegExp( pseudos ), ridentifier = new RegExp( "^" + identifier + "$" ), matchExpr = { "ID": new RegExp( "^#(" + characterEncoding + ")" ), "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), "ATTR": new RegExp( "^" + attributes ), "PSEUDO": new RegExp( "^" + pseudos ), "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), // For use in libraries implementing .is() // We use this for POS matching in `select` "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) }, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rnative = /^[^{]+\{\s*\[native \w/, // Easily-parseable/retrievable ID or TAG or CLASS selectors rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rsibling = /[+~]/, rescape = /'|\\/g, // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), funescape = function( _, escaped, escapedWhitespace ) { var high = "0x" + escaped - 0x10000; // NaN means non-codepoint // Support: Firefox<24 // Workaround erroneous numeric interpretation of +"0x" return high !== high || escapedWhitespace ? escaped : high < 0 ? // BMP codepoint String.fromCharCode( high + 0x10000 ) : // Supplemental Plane codepoint (surrogate pair) String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); }; // Optimize for push.apply( _, NodeList ) try { push.apply( (arr = slice.call( preferredDoc.childNodes )), preferredDoc.childNodes ); // Support: Android<4.0 // Detect silently failing push.apply arr[ preferredDoc.childNodes.length ].nodeType; } catch ( e ) { push = { apply: arr.length ? // Leverage slice if possible function( target, els ) { push_native.apply( target, slice.call(els) ); } : // Support: IE<9 // Otherwise append directly function( target, els ) { var j = target.length, i = 0; // Can't trust NodeList.length while ( (target[j++] = els[i++]) ) {} target.length = j - 1; } }; } function Sizzle( selector, context, results, seed ) { var match, elem, m, nodeType, // QSA vars i, groups, old, nid, newContext, newSelector; if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { setDocument( context ); } context = context || document; results = results || []; if ( !selector || typeof selector !== "string" ) { return results; } if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { return []; } if ( documentIsHTML && !seed ) { // Shortcuts if ( (match = rquickExpr.exec( selector )) ) { // Speed-up: Sizzle("#ID") if ( (m = match[1]) ) { if ( nodeType === 9 ) { elem = context.getElementById( m ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document (jQuery #6963) if ( elem && elem.parentNode ) { // Handle the case where IE, Opera, and Webkit return items // by name instead of ID if ( elem.id === m ) { results.push( elem ); return results; } } else { return results; } } else { // Context is not a document if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && contains( context, elem ) && elem.id === m ) { results.push( elem ); return results; } } // Speed-up: Sizzle("TAG") } else if ( match[2] ) { push.apply( results, context.getElementsByTagName( selector ) ); return results; // Speed-up: Sizzle(".CLASS") } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { push.apply( results, context.getElementsByClassName( m ) ); return results; } } // QSA path if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { nid = old = expando; newContext = context; newSelector = nodeType === 9 && selector; // qSA works strangely on Element-rooted queries // We can work around this by specifying an extra ID on the root // and working up from there (Thanks to Andrew Dupont for the technique) // IE 8 doesn't work on object elements if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { groups = tokenize( selector ); if ( (old = context.getAttribute("id")) ) { nid = old.replace( rescape, "\\$&" ); } else { context.setAttribute( "id", nid ); } nid = "[id='" + nid + "'] "; i = groups.length; while ( i-- ) { groups[i] = nid + toSelector( groups[i] ); } newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context; newSelector = groups.join(","); } if ( newSelector ) { try { push.apply( results, newContext.querySelectorAll( newSelector ) ); return results; } catch(qsaError) { } finally { if ( !old ) { context.removeAttribute("id"); } } } } } // All others return select( selector.replace( rtrim, "$1" ), context, results, seed ); } /** * Create key-value caches of limited size * @returns {Function(string, Object)} Returns the Object data after storing it on itself with * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) * deleting the oldest entry */ function createCache() { var keys = []; function cache( key, value ) { // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) if ( keys.push( key + " " ) > Expr.cacheLength ) { // Only keep the most recent entries delete cache[ keys.shift() ]; } return (cache[ key + " " ] = value); } return cache; } /** * Mark a function for special use by Sizzle * @param {Function} fn The function to mark */ function markFunction( fn ) { fn[ expando ] = true; return fn; } /** * Support testing using an element * @param {Function} fn Passed the created div and expects a boolean result */ function assert( fn ) { var div = document.createElement("div"); try { return !!fn( div ); } catch (e) { return false; } finally { // Remove from its parent by default if ( div.parentNode ) { div.parentNode.removeChild( div ); } // release memory in IE div = null; } } /** * Adds the same handler for all of the specified attrs * @param {String} attrs Pipe-separated list of attributes * @param {Function} handler The method that will be applied */ function addHandle( attrs, handler ) { var arr = attrs.split("|"), i = attrs.length; while ( i-- ) { Expr.attrHandle[ arr[i] ] = handler; } } /** * Checks document order of two siblings * @param {Element} a * @param {Element} b * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b */ function siblingCheck( a, b ) { var cur = b && a, diff = cur && a.nodeType === 1 && b.nodeType === 1 && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE ); // Use IE sourceIndex if available on both nodes if ( diff ) { return diff; } // Check if b follows a if ( cur ) { while ( (cur = cur.nextSibling) ) { if ( cur === b ) { return -1; } } } return a ? 1 : -1; } /** * Returns a function to use in pseudos for input types * @param {String} type */ function createInputPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === type; }; } /** * Returns a function to use in pseudos for buttons * @param {String} type */ function createButtonPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return (name === "input" || name === "button") && elem.type === type; }; } /** * Returns a function to use in pseudos for positionals * @param {Function} fn */ function createPositionalPseudo( fn ) { return markFunction(function( argument ) { argument = +argument; return markFunction(function( seed, matches ) { var j, matchIndexes = fn( [], seed.length, argument ), i = matchIndexes.length; // Match elements found at the specified indexes while ( i-- ) { if ( seed[ (j = matchIndexes[i]) ] ) { seed[j] = !(matches[j] = seed[j]); } } }); }); } /** * Checks a node for validity as a Sizzle context * @param {Element|Object=} context * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value */ function testContext( context ) { return context && typeof context.getElementsByTagName !== strundefined && context; } // Expose support vars for convenience support = Sizzle.support = {}; /** * Detects XML nodes * @param {Element|Object} elem An element or a document * @returns {Boolean} True iff elem is a non-HTML XML node */ isXML = Sizzle.isXML = function( elem ) { // documentElement is verified for cases where it doesn't yet exist // (such as loading iframes in IE - #4833) var documentElement = elem && (elem.ownerDocument || elem).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : false; }; /** * Sets document-related variables once based on the current document * @param {Element|Object} [doc] An element or document object to use to set the document * @returns {Object} Returns the current document */ setDocument = Sizzle.setDocument = function( node ) { var hasCompare, doc = node ? node.ownerDocument || node : preferredDoc, parent = doc.defaultView; // If no document and documentElement is available, return if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { return document; } // Set our document document = doc; docElem = doc.documentElement; // Support tests documentIsHTML = !isXML( doc ); // Support: IE>8 // If iframe document is assigned to "document" variable and if iframe has been reloaded, // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 // IE6-8 do not support the defaultView property so parent will be undefined if ( parent && parent !== parent.top ) { // IE11 does not have attachEvent, so all must suffer if ( parent.addEventListener ) { parent.addEventListener( "unload", function() { setDocument(); }, false ); } else if ( parent.attachEvent ) { parent.attachEvent( "onunload", function() { setDocument(); }); } } /* Attributes ---------------------------------------------------------------------- */ // Support: IE<8 // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans) support.attributes = assert(function( div ) { div.className = "i"; return !div.getAttribute("className"); }); /* getElement(s)By* ---------------------------------------------------------------------- */ // Check if getElementsByTagName("*") returns only elements support.getElementsByTagName = assert(function( div ) { div.appendChild( doc.createComment("") ); return !div.getElementsByTagName("*").length; }); // Check if getElementsByClassName can be trusted support.getElementsByClassName = rnative.test( doc.getElementsByClassName ) && assert(function( div ) { div.innerHTML = "<div class='a'></div><div class='a i'></div>"; // Support: Safari<4 // Catch class over-caching div.firstChild.className = "i"; // Support: Opera<10 // Catch gEBCN failure to find non-leading classes return div.getElementsByClassName("i").length === 2; }); // Support: IE<10 // Check if getElementById returns elements by name // The broken getElementById methods don't pick up programatically-set names, // so use a roundabout getElementsByName test support.getById = assert(function( div ) { docElem.appendChild( div ).id = expando; return !doc.getElementsByName || !doc.getElementsByName( expando ).length; }); // ID find and filter if ( support.getById ) { Expr.find["ID"] = function( id, context ) { if ( typeof context.getElementById !== strundefined && documentIsHTML ) { var m = context.getElementById( id ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 return m && m.parentNode ? [ m ] : []; } }; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { return elem.getAttribute("id") === attrId; }; }; } else { // Support: IE6/7 // getElementById is not reliable as a find shortcut delete Expr.find["ID"]; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); return node && node.value === attrId; }; }; } // Tag Expr.find["TAG"] = support.getElementsByTagName ? function( tag, context ) { if ( typeof context.getElementsByTagName !== strundefined ) { return context.getElementsByTagName( tag ); } } : function( tag, context ) { var elem, tmp = [], i = 0, results = context.getElementsByTagName( tag ); // Filter out possible comments if ( tag === "*" ) { while ( (elem = results[i++]) ) { if ( elem.nodeType === 1 ) { tmp.push( elem ); } } return tmp; } return results; }; // Class Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) { return context.getElementsByClassName( className ); } }; /* QSA/matchesSelector ---------------------------------------------------------------------- */ // QSA and matchesSelector support // matchesSelector(:active) reports false when true (IE9/Opera 11.5) rbuggyMatches = []; // qSa(:focus) reports false when true (Chrome 21) // We allow this because of a bug in IE8/9 that throws an error // whenever `document.activeElement` is accessed on an iframe // So, we allow :focus to pass through QSA all the time to avoid the IE error // See http://bugs.jquery.com/ticket/13378 rbuggyQSA = []; if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { // Build QSA regex // Regex strategy adopted from Diego Perini assert(function( div ) { // Select is set to empty string on purpose // This is to test IE's treatment of not explicitly // setting a boolean content attribute, // since its presence should be enough // http://bugs.jquery.com/ticket/12359 div.innerHTML = "<select msallowclip=''><option selected=''></option></select>"; // Support: IE8, Opera 11-12.16 // Nothing should be selected when empty strings follow ^= or $= or *= // The test attribute must be unknown in Opera but "safe" for WinRT // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section if ( div.querySelectorAll("[msallowclip^='']").length ) { rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); } // Support: IE8 // Boolean attributes and "value" are not treated correctly if ( !div.querySelectorAll("[selected]").length ) { rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); } // Webkit/Opera - :checked should return selected option elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":checked").length ) { rbuggyQSA.push(":checked"); } }); assert(function( div ) { // Support: Windows 8 Native Apps // The type and name attributes are restricted during .innerHTML assignment var input = doc.createElement("input"); input.setAttribute( "type", "hidden" ); div.appendChild( input ).setAttribute( "name", "D" ); // Support: IE8 // Enforce case-sensitivity of name attribute if ( div.querySelectorAll("[name=d]").length ) { rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); } // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":enabled").length ) { rbuggyQSA.push( ":enabled", ":disabled" ); } // Opera 10-11 does not throw on post-comma invalid pseudos div.querySelectorAll("*,:x"); rbuggyQSA.push(",.*:"); }); } if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector) )) ) { assert(function( div ) { // Check to see if it's possible to do matchesSelector // on a disconnected node (IE 9) support.disconnectedMatch = matches.call( div, "div" ); // This should fail with an exception // Gecko does not error, returns false instead matches.call( div, "[s!='']:x" ); rbuggyMatches.push( "!=", pseudos ); }); } rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); /* Contains ---------------------------------------------------------------------- */ hasCompare = rnative.test( docElem.compareDocumentPosition ); // Element contains another // Purposefully does not implement inclusive descendent // As in, an element does not contain itself contains = hasCompare || rnative.test( docElem.contains ) ? function( a, b ) { var adown = a.nodeType === 9 ? a.documentElement : a, bup = b && b.parentNode; return a === bup || !!( bup && bup.nodeType === 1 && ( adown.contains ? adown.contains( bup ) : a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 )); } : function( a, b ) { if ( b ) { while ( (b = b.parentNode) ) { if ( b === a ) { return true; } } } return false; }; /* Sorting ---------------------------------------------------------------------- */ // Document order sorting sortOrder = hasCompare ? function( a, b ) { // Flag for duplicate removal if ( a === b ) { hasDuplicate = true; return 0; } // Sort on method existence if only one input has compareDocumentPosition var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; if ( compare ) { return compare; } // Calculate position if both inputs belong to the same document compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? a.compareDocumentPosition( b ) : // Otherwise we know they are disconnected 1; // Disconnected nodes if ( compare & 1 || (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { // Choose the first element that is related to our preferred document if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { return -1; } if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { return 1; } // Maintain original order return sortInput ? ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : 0; } return compare & 4 ? -1 : 1; } : function( a, b ) { // Exit early if the nodes are identical if ( a === b ) { hasDuplicate = true; return 0; } var cur, i = 0, aup = a.parentNode, bup = b.parentNode, ap = [ a ], bp = [ b ]; // Parentless nodes are either documents or disconnected if ( !aup || !bup ) { return a === doc ? -1 : b === doc ? 1 : aup ? -1 : bup ? 1 : sortInput ? ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : 0; // If the nodes are siblings, we can do a quick check } else if ( aup === bup ) { return siblingCheck( a, b ); } // Otherwise we need full lists of their ancestors for comparison cur = a; while ( (cur = cur.parentNode) ) { ap.unshift( cur ); } cur = b; while ( (cur = cur.parentNode) ) { bp.unshift( cur ); } // Walk down the tree looking for a discrepancy while ( ap[i] === bp[i] ) { i++; } return i ? // Do a sibling check if the nodes have a common ancestor siblingCheck( ap[i], bp[i] ) : // Otherwise nodes in our document sort first ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0; }; return doc; }; Sizzle.matches = function( expr, elements ) { return Sizzle( expr, null, null, elements ); }; Sizzle.matchesSelector = function( elem, expr ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } // Make sure that attribute selectors are quoted expr = expr.replace( rattributeQuotes, "='$1']" ); if ( support.matchesSelector && documentIsHTML && ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { try { var ret = matches.call( elem, expr ); // IE 9's matchesSelector returns false on disconnected nodes if ( ret || support.disconnectedMatch || // As well, disconnected nodes are said to be in a document // fragment in IE 9 elem.document && elem.document.nodeType !== 11 ) { return ret; } } catch(e) {} } return Sizzle( expr, document, null, [ elem ] ).length > 0; }; Sizzle.contains = function( context, elem ) { // Set document vars if needed if ( ( context.ownerDocument || context ) !== document ) { setDocument( context ); } return contains( context, elem ); }; Sizzle.attr = function( elem, name ) { // Set document vars if needed if ( ( elem.ownerDocument || elem ) !== document ) { setDocument( elem ); } var fn = Expr.attrHandle[ name.toLowerCase() ], // Don't get fooled by Object.prototype properties (jQuery #13807) val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? fn( elem, name, !documentIsHTML ) : undefined; return val !== undefined ? val : support.attributes || !documentIsHTML ? elem.getAttribute( name ) : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null; }; Sizzle.error = function( msg ) { throw new Error( "Syntax error, unrecognized expression: " + msg ); }; /** * Document sorting and removing duplicates * @param {ArrayLike} results */ Sizzle.uniqueSort = function( results ) { var elem, duplicates = [], j = 0, i = 0; // Unless we *know* we can detect duplicates, assume their presence hasDuplicate = !support.detectDuplicates; sortInput = !support.sortStable && results.slice( 0 ); results.sort( sortOrder ); if ( hasDuplicate ) { while ( (elem = results[i++]) ) { if ( elem === results[ i ] ) { j = duplicates.push( i ); } } while ( j-- ) { results.splice( duplicates[ j ], 1 ); } } // Clear input after sorting to release objects // See https://github.com/jquery/sizzle/pull/225 sortInput = null; return results; }; /** * Utility function for retrieving the text value of an array of DOM nodes * @param {Array|Element} elem */ getText = Sizzle.getText = function( elem ) { var node, ret = "", i = 0, nodeType = elem.nodeType; if ( !nodeType ) { // If no nodeType, this is expected to be an array while ( (node = elem[i++]) ) { // Do not traverse comment nodes ret += getText( node ); } } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { // Use textContent for elements // innerText usage removed for consistency of new lines (jQuery #11153) if ( typeof elem.textContent === "string" ) { return elem.textContent; } else { // Traverse its children for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { ret += getText( elem ); } } } else if ( nodeType === 3 || nodeType === 4 ) { return elem.nodeValue; } // Do not include comment or processing instruction nodes return ret; }; Expr = Sizzle.selectors = { // Can be adjusted by the user cacheLength: 50, createPseudo: markFunction, match: matchExpr, attrHandle: {}, find: {}, relative: { ">": { dir: "parentNode", first: true }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: true }, "~": { dir: "previousSibling" } }, preFilter: { "ATTR": function( match ) { match[1] = match[1].replace( runescape, funescape ); // Move the given value to match[3] whether quoted or unquoted match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); if ( match[2] === "~=" ) { match[3] = " " + match[3] + " "; } return match.slice( 0, 4 ); }, "CHILD": function( match ) { /* matches from matchExpr["CHILD"] 1 type (only|nth|...) 2 what (child|of-type) 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 4 xn-component of xn+y argument ([+-]?\d*n|) 5 sign of xn-component 6 x of xn-component 7 sign of y-component 8 y of y-component */ match[1] = match[1].toLowerCase(); if ( match[1].slice( 0, 3 ) === "nth" ) { // nth-* requires argument if ( !match[3] ) { Sizzle.error( match[0] ); } // numeric x and y parameters for Expr.filter.CHILD // remember that false/true cast respectively to 0/1 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); // other types prohibit arguments } else if ( match[3] ) { Sizzle.error( match[0] ); } return match; }, "PSEUDO": function( match ) { var excess, unquoted = !match[6] && match[2]; if ( matchExpr["CHILD"].test( match[0] ) ) { return null; } // Accept quoted arguments as-is if ( match[3] ) { match[2] = match[4] || match[5] || ""; // Strip excess characters from unquoted arguments } else if ( unquoted && rpseudo.test( unquoted ) && // Get excess from tokenize (recursively) (excess = tokenize( unquoted, true )) && // advance to the next closing parenthesis (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { // excess is a negative index match[0] = match[0].slice( 0, excess ); match[2] = unquoted.slice( 0, excess ); } // Return only captures needed by the pseudo filter method (type and argument) return match.slice( 0, 3 ); } }, filter: { "TAG": function( nodeNameSelector ) { var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); return nodeNameSelector === "*" ? function() { return true; } : function( elem ) { return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; }; }, "CLASS": function( className ) { var pattern = classCache[ className + " " ]; return pattern || (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && classCache( className, function( elem ) { return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" ); }); }, "ATTR": function( name, operator, check ) { return function( elem ) { var result = Sizzle.attr( elem, name ); if ( result == null ) { return operator === "!="; } if ( !operator ) { return true; } result += ""; return operator === "=" ? result === check : operator === "!=" ? result !== check : operator === "^=" ? check && result.indexOf( check ) === 0 : operator === "*=" ? check && result.indexOf( check ) > -1 : operator === "$=" ? check && result.slice( -check.length ) === check : operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : false; }; }, "CHILD": function( type, what, argument, first, last ) { var simple = type.slice( 0, 3 ) !== "nth", forward = type.slice( -4 ) !== "last", ofType = what === "of-type"; return first === 1 && last === 0 ? // Shortcut for :nth-*(n) function( elem ) { return !!elem.parentNode; } : function( elem, context, xml ) { var cache, outerCache, node, diff, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType; if ( parent ) { // :(first|last|only)-(child|of-type) if ( simple ) { while ( dir ) { node = elem; while ( (node = node[ dir ]) ) { if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { return false; } } // Reverse direction for :only-* (if we haven't yet done so) start = dir = type === "only" && !start && "nextSibling"; } return true; } start = [ forward ? parent.firstChild : parent.lastChild ]; // non-xml :nth-child(...) stores cache data on `parent` if ( forward && useCache ) { // Seek `elem` from a previously-cached index outerCache = parent[ expando ] || (parent[ expando ] = {}); cache = outerCache[ type ] || []; nodeIndex = cache[0] === dirruns && cache[1]; diff = cache[0] === dirruns && cache[2]; node = nodeIndex && parent.childNodes[ nodeIndex ]; while ( (node = ++nodeIndex && node && node[ dir ] || // Fallback to seeking `elem` from the start (diff = nodeIndex = 0) || start.pop()) ) { // When found, cache indexes on `parent` and break if ( node.nodeType === 1 && ++diff && node === elem ) { outerCache[ type ] = [ dirruns, nodeIndex, diff ]; break; } } // Use previously-cached element index if available } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { diff = cache[1]; // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) } else { // Use the same loop as above to seek `elem` from the start while ( (node = ++nodeIndex && node && node[ dir ] || (diff = nodeIndex = 0) || start.pop()) ) { if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { // Cache the index of each encountered element if ( useCache ) { (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; } if ( node === elem ) { break; } } } } // Incorporate the offset, then check against cycle size diff -= last; return diff === first || ( diff % first === 0 && diff / first >= 0 ); } }; }, "PSEUDO": function( pseudo, argument ) { // pseudo-class names are case-insensitive // http://www.w3.org/TR/selectors/#pseudo-classes // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters // Remember that setFilters inherits from pseudos var args, fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || Sizzle.error( "unsupported pseudo: " + pseudo ); // The user may use createPseudo to indicate that // arguments are needed to create the filter function // just as Sizzle does if ( fn[ expando ] ) { return fn( argument ); } // But maintain support for old signatures if ( fn.length > 1 ) { args = [ pseudo, pseudo, "", argument ]; return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? markFunction(function( seed, matches ) { var idx, matched = fn( seed, argument ), i = matched.length; while ( i-- ) { idx = indexOf.call( seed, matched[i] ); seed[ idx ] = !( matches[ idx ] = matched[i] ); } }) : function( elem ) { return fn( elem, 0, args ); }; } return fn; } }, pseudos: { // Potentially complex pseudos "not": markFunction(function( selector ) { // Trim the selector passed to compile // to avoid treating leading and trailing // spaces as combinators var input = [], results = [], matcher = compile( selector.replace( rtrim, "$1" ) ); return matcher[ expando ] ? markFunction(function( seed, matches, context, xml ) { var elem, unmatched = matcher( seed, null, xml, [] ), i = seed.length; // Match elements unmatched by `matcher` while ( i-- ) { if ( (elem = unmatched[i]) ) { seed[i] = !(matches[i] = elem); } } }) : function( elem, context, xml ) { input[0] = elem; matcher( input, null, xml, results ); return !results.pop(); }; }), "has": markFunction(function( selector ) { return function( elem ) { return Sizzle( selector, elem ).length > 0; }; }), "contains": markFunction(function( text ) { return function( elem ) { return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; }; }), // "Whether an element is represented by a :lang() selector // is based solely on the element's language value // being equal to the identifier C, // or beginning with the identifier C immediately followed by "-". // The matching of C against the element's language value is performed case-insensitively. // The identifier C does not have to be a valid language name." // http://www.w3.org/TR/selectors/#lang-pseudo "lang": markFunction( function( lang ) { // lang value must be a valid identifier if ( !ridentifier.test(lang || "") ) { Sizzle.error( "unsupported lang: " + lang ); } lang = lang.replace( runescape, funescape ).toLowerCase(); return function( elem ) { var elemLang; do { if ( (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { elemLang = elemLang.toLowerCase(); return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; } } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); return false; }; }), // Miscellaneous "target": function( elem ) { var hash = window.location && window.location.hash; return hash && hash.slice( 1 ) === elem.id; }, "root": function( elem ) { return elem === docElem; }, "focus": function( elem ) { return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); }, // Boolean properties "enabled": function( elem ) { return elem.disabled === false; }, "disabled": function( elem ) { return elem.disabled === true; }, "checked": function( elem ) { // In CSS3, :checked should return both checked and selected elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked var nodeName = elem.nodeName.toLowerCase(); return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); }, "selected": function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly if ( elem.parentNode ) { elem.parentNode.selectedIndex; } return elem.selected === true; }, // Contents "empty": function( elem ) { // http://www.w3.org/TR/selectors/#empty-pseudo // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), // but not by others (comment: 8; processing instruction: 7; etc.) // nodeType < 6 works because attributes (2) do not appear as children for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { if ( elem.nodeType < 6 ) { return false; } } return true; }, "parent": function( elem ) { return !Expr.pseudos["empty"]( elem ); }, // Element/input types "header": function( elem ) { return rheader.test( elem.nodeName ); }, "input": function( elem ) { return rinputs.test( elem.nodeName ); }, "button": function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === "button" || name === "button"; }, "text": function( elem ) { var attr; return elem.nodeName.toLowerCase() === "input" && elem.type === "text" && // Support: IE<8 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); }, // Position-in-collection "first": createPositionalPseudo(function() { return [ 0 ]; }), "last": createPositionalPseudo(function( matchIndexes, length ) { return [ length - 1 ]; }), "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { return [ argument < 0 ? argument + length : argument ]; }), "even": createPositionalPseudo(function( matchIndexes, length ) { var i = 0; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "odd": createPositionalPseudo(function( matchIndexes, length ) { var i = 1; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; }), "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; --i >= 0; ) { matchIndexes.push( i ); } return matchIndexes; }), "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; ++i < length; ) { matchIndexes.push( i ); } return matchIndexes; }) } }; Expr.pseudos["nth"] = Expr.pseudos["eq"]; // Add button/input type pseudos for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { Expr.pseudos[ i ] = createInputPseudo( i ); } for ( i in { submit: true, reset: true } ) { Expr.pseudos[ i ] = createButtonPseudo( i ); } // Easy API for creating new setFilters function setFilters() {} setFilters.prototype = Expr.filters = Expr.pseudos; Expr.setFilters = new setFilters(); tokenize = Sizzle.tokenize = function( selector, parseOnly ) { var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[ selector + " " ]; if ( cached ) { return parseOnly ? 0 : cached.slice( 0 ); } soFar = selector; groups = []; preFilters = Expr.preFilter; while ( soFar ) { // Comma and first run if ( !matched || (match = rcomma.exec( soFar )) ) { if ( match ) { // Don't consume trailing commas as valid soFar = soFar.slice( match[0].length ) || soFar; } groups.push( (tokens = []) ); } matched = false; // Combinators if ( (match = rcombinators.exec( soFar )) ) { matched = match.shift(); tokens.push({ value: matched, // Cast descendant combinators to space type: match[0].replace( rtrim, " " ) }); soFar = soFar.slice( matched.length ); } // Filters for ( type in Expr.filter ) { if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || (match = preFilters[ type ]( match ))) ) { matched = match.shift(); tokens.push({ value: matched, type: type, matches: match }); soFar = soFar.slice( matched.length ); } } if ( !matched ) { break; } } // Return the length of the invalid excess // if we're just parsing // Otherwise, throw an error or return tokens return parseOnly ? soFar.length : soFar ? Sizzle.error( selector ) : // Cache the tokens tokenCache( selector, groups ).slice( 0 ); }; function toSelector( tokens ) { var i = 0, len = tokens.length, selector = ""; for ( ; i < len; i++ ) { selector += tokens[i].value; } return selector; } function addCombinator( matcher, combinator, base ) { var dir = combinator.dir, checkNonElements = base && dir === "parentNode", doneName = done++; return combinator.first ? // Check against closest ancestor/preceding element function( elem, context, xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { return matcher( elem, context, xml ); } } } : // Check against all ancestor/preceding elements function( elem, context, xml ) { var oldCache, outerCache, newCache = [ dirruns, doneName ]; // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching if ( xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { if ( matcher( elem, context, xml ) ) { return true; } } } } else { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { outerCache = elem[ expando ] || (elem[ expando ] = {}); if ( (oldCache = outerCache[ dir ]) && oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { // Assign to newCache so results back-propagate to previous elements return (newCache[ 2 ] = oldCache[ 2 ]); } else { // Reuse newcache so results back-propagate to previous elements outerCache[ dir ] = newCache; // A match means we're done; a fail means we have to keep checking if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { return true; } } } } } }; } function elementMatcher( matchers ) { return matchers.length > 1 ? function( elem, context, xml ) { var i = matchers.length; while ( i-- ) { if ( !matchers[i]( elem, context, xml ) ) { return false; } } return true; } : matchers[0]; } function multipleContexts( selector, contexts, results ) { var i = 0, len = contexts.length; for ( ; i < len; i++ ) { Sizzle( selector, contexts[i], results ); } return results; } function condense( unmatched, map, filter, context, xml ) { var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = map != null; for ( ; i < len; i++ ) { if ( (elem = unmatched[i]) ) { if ( !filter || filter( elem, context, xml ) ) { newUnmatched.push( elem ); if ( mapped ) { map.push( i ); } } } } return newUnmatched; } function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { if ( postFilter && !postFilter[ expando ] ) { postFilter = setMatcher( postFilter ); } if ( postFinder && !postFinder[ expando ] ) { postFinder = setMatcher( postFinder, postSelector ); } return markFunction(function( seed, results, context, xml ) { var temp, i, elem, preMap = [], postMap = [], preexisting = results.length, // Get initial elements from seed or context elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), // Prefilter to get matcher input, preserving a map for seed-results synchronization matcherIn = preFilter && ( seed || !selector ) ? condense( elems, preMap, preFilter, context, xml ) : elems, matcherOut = matcher ? // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, postFinder || ( seed ? preFilter : preexisting || postFilter ) ? // ...intermediate processing is necessary [] : // ...otherwise use results directly results : matcherIn; // Find primary matches if ( matcher ) { matcher( matcherIn, matcherOut, context, xml ); } // Apply postFilter if ( postFilter ) { temp = condense( matcherOut, postMap ); postFilter( temp, [], context, xml ); // Un-match failing elements by moving them back to matcherIn i = temp.length; while ( i-- ) { if ( (elem = temp[i]) ) { matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); } } } if ( seed ) { if ( postFinder || preFilter ) { if ( postFinder ) { // Get the final matcherOut by condensing this intermediate into postFinder contexts temp = []; i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) ) { // Restore matcherIn since elem is not yet a final match temp.push( (matcherIn[i] = elem) ); } } postFinder( null, (matcherOut = []), temp, xml ); } // Move matched elements from seed to results to keep them synchronized i = matcherOut.length; while ( i-- ) { if ( (elem = matcherOut[i]) && (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { seed[temp] = !(results[temp] = elem); } } } // Add elements to results, through postFinder if defined } else { matcherOut = condense( matcherOut === results ? matcherOut.splice( preexisting, matcherOut.length ) : matcherOut ); if ( postFinder ) { postFinder( null, results, matcherOut, xml ); } else { push.apply( results, matcherOut ); } } }); } function matcherFromTokens( tokens ) { var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[ tokens[0].type ], implicitRelative = leadingRelative || Expr.relative[" "], i = leadingRelative ? 1 : 0, // The foundational matcher ensures that elements are reachable from top-level context(s) matchContext = addCombinator( function( elem ) { return elem === checkContext; }, implicitRelative, true ), matchAnyContext = addCombinator( function( elem ) { return indexOf.call( checkContext, elem ) > -1; }, implicitRelative, true ), matchers = [ function( elem, context, xml ) { return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( (checkContext = context).nodeType ? matchContext( elem, context, xml ) : matchAnyContext( elem, context, xml ) ); } ]; for ( ; i < len; i++ ) { if ( (matcher = Expr.relative[ tokens[i].type ]) ) { matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; } else { matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); // Return special upon seeing a positional matcher if ( matcher[ expando ] ) { // Find the next relative operator (if any) for proper handling j = ++i; for ( ; j < len; j++ ) { if ( Expr.relative[ tokens[j].type ] ) { break; } } return setMatcher( i > 1 && elementMatcher( matchers ), i > 1 && toSelector( // If the preceding token was a descendant combinator, insert an implicit any-element `*` tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) ).replace( rtrim, "$1" ), matcher, i < j && matcherFromTokens( tokens.slice( i, j ) ), j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), j < len && toSelector( tokens ) ); } matchers.push( matcher ); } } return elementMatcher( matchers ); } function matcherFromGroupMatchers( elementMatchers, setMatchers ) { var bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function( seed, context, xml, results, outermost ) { var elem, j, matcher, matchedCount = 0, i = "0", unmatched = seed && [], setMatched = [], contextBackup = outermostContext, // We must always have either seed elements or outermost context elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), // Use integer dirruns iff this is the outermost matcher dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), len = elems.length; if ( outermost ) { outermostContext = context !== document && context; } // Add elements passing elementMatchers directly to results // Keep `i` a string if there are no elements so `matchedCount` will be "00" below // Support: IE<9, Safari // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id for ( ; i !== len && (elem = elems[i]) != null; i++ ) { if ( byElement && elem ) { j = 0; while ( (matcher = elementMatchers[j++]) ) { if ( matcher( elem, context, xml ) ) { results.push( elem ); break; } } if ( outermost ) { dirruns = dirrunsUnique; } } // Track unmatched elements for set filters if ( bySet ) { // They will have gone through all possible matchers if ( (elem = !matcher && elem) ) { matchedCount--; } // Lengthen the array for every element, matched or not if ( seed ) { unmatched.push( elem ); } } } // Apply set filters to unmatched elements matchedCount += i; if ( bySet && i !== matchedCount ) { j = 0; while ( (matcher = setMatchers[j++]) ) { matcher( unmatched, setMatched, context, xml ); } if ( seed ) { // Reintegrate element matches to eliminate the need for sorting if ( matchedCount > 0 ) { while ( i-- ) { if ( !(unmatched[i] || setMatched[i]) ) { setMatched[i] = pop.call( results ); } } } // Discard index placeholder values to get only actual matches setMatched = condense( setMatched ); } // Add matches to results push.apply( results, setMatched ); // Seedless set matches succeeding multiple successful matchers stipulate sorting if ( outermost && !seed && setMatched.length > 0 && ( matchedCount + setMatchers.length ) > 1 ) { Sizzle.uniqueSort( results ); } } // Override manipulation of globals by nested matchers if ( outermost ) { dirruns = dirrunsUnique; outermostContext = contextBackup; } return unmatched; }; return bySet ? markFunction( superMatcher ) : superMatcher; } compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { var i, setMatchers = [], elementMatchers = [], cached = compilerCache[ selector + " " ]; if ( !cached ) { // Generate a function of recursive functions that can be used to check each element if ( !match ) { match = tokenize( selector ); } i = match.length; while ( i-- ) { cached = matcherFromTokens( match[i] ); if ( cached[ expando ] ) { setMatchers.push( cached ); } else { elementMatchers.push( cached ); } } // Cache the compiled function cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); // Save selector and tokenization cached.selector = selector; } return cached; }; /** * A low-level selection function that works with Sizzle's compiled * selector functions * @param {String|Function} selector A selector or a pre-compiled * selector function built with Sizzle.compile * @param {Element} context * @param {Array} [results] * @param {Array} [seed] A set of elements to match against */ select = Sizzle.select = function( selector, context, results, seed ) { var i, tokens, token, type, find, compiled = typeof selector === "function" && selector, match = !seed && tokenize( (selector = compiled.selector || selector) ); results = results || []; // Try to minimize operations if there is no seed and only one group if ( match.length === 1 ) { // Take a shortcut and set the context if the root selector is an ID tokens = match[0] = match[0].slice( 0 ); if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && support.getById && context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) { context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; if ( !context ) { return results; // Precompiled matchers will still verify ancestry, so step up a level } else if ( compiled ) { context = context.parentNode; } selector = selector.slice( tokens.shift().value.length ); } // Fetch a seed set for right-to-left matching i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; while ( i-- ) { token = tokens[i]; // Abort if we hit a combinator if ( Expr.relative[ (type = token.type) ] ) { break; } if ( (find = Expr.find[ type ]) ) { // Search, expanding context for leading sibling combinators if ( (seed = find( token.matches[0].replace( runescape, funescape ), rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context )) ) { // If seed is empty or no tokens remain, we can return early tokens.splice( i, 1 ); selector = seed.length && toSelector( tokens ); if ( !selector ) { push.apply( results, seed ); return results; } break; } } } } // Compile and execute a filtering function if one is not provided // Provide `match` to avoid retokenization if we modified the selector above ( compiled || compile( selector, match ) )( seed, context, !documentIsHTML, results, rsibling.test( selector ) && testContext( context.parentNode ) || context ); return results; }; // One-time assignments // Sort stability support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; // Support: Chrome<14 // Always assume duplicates if they aren't passed to the comparison function support.detectDuplicates = !!hasDuplicate; // Initialize against the default document setDocument(); // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) // Detached nodes confoundingly follow *each other* support.sortDetached = assert(function( div1 ) { // Should return 1, but returns 4 (following) return div1.compareDocumentPosition( document.createElement("div") ) & 1; }); // Support: IE<8 // Prevent attribute/property "interpolation" // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !assert(function( div ) { div.innerHTML = "<a href='#'></a>"; return div.firstChild.getAttribute("href") === "#" ; }) ) { addHandle( "type|href|height|width", function( elem, name, isXML ) { if ( !isXML ) { return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); } }); } // Support: IE<9 // Use defaultValue in place of getAttribute("value") if ( !support.attributes || !assert(function( div ) { div.innerHTML = "<input/>"; div.firstChild.setAttribute( "value", "" ); return div.firstChild.getAttribute( "value" ) === ""; }) ) { addHandle( "value", function( elem, name, isXML ) { if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { return elem.defaultValue; } }); } // Support: IE<9 // Use getAttributeNode to fetch booleans when getAttribute lies if ( !assert(function( div ) { return div.getAttribute("disabled") == null; }) ) { addHandle( booleans, function( elem, name, isXML ) { var val; if ( !isXML ) { return elem[ name ] === true ? name.toLowerCase() : (val = elem.getAttributeNode( name )) && val.specified ? val.value : null; } }); } return Sizzle; })( window ); jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; jQuery.expr[":"] = jQuery.expr.pseudos; jQuery.unique = Sizzle.uniqueSort; jQuery.text = Sizzle.getText; jQuery.isXMLDoc = Sizzle.isXML; jQuery.contains = Sizzle.contains; var rneedsContext = jQuery.expr.match.needsContext; var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/); var risSimple = /^.[^:#\[\.,]*$/; // Implement the identical functionality for filter and not function winnow( elements, qualifier, not ) { if ( jQuery.isFunction( qualifier ) ) { return jQuery.grep( elements, function( elem, i ) { /* jshint -W018 */ return !!qualifier.call( elem, i, elem ) !== not; }); } if ( qualifier.nodeType ) { return jQuery.grep( elements, function( elem ) { return ( elem === qualifier ) !== not; }); } if ( typeof qualifier === "string" ) { if ( risSimple.test( qualifier ) ) { return jQuery.filter( qualifier, elements, not ); } qualifier = jQuery.filter( qualifier, elements ); } return jQuery.grep( elements, function( elem ) { return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not; }); } jQuery.filter = function( expr, elems, not ) { var elem = elems[ 0 ]; if ( not ) { expr = ":not(" + expr + ")"; } return elems.length === 1 && elem.nodeType === 1 ? jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { return elem.nodeType === 1; })); }; jQuery.fn.extend({ find: function( selector ) { var i, ret = [], self = this, len = self.length; if ( typeof selector !== "string" ) { return this.pushStack( jQuery( selector ).filter(function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( self[ i ], this ) ) { return true; } } }) ); } for ( i = 0; i < len; i++ ) { jQuery.find( selector, self[ i ], ret ); } // Needed because $( selector, context ) becomes $( context ).find( selector ) ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); ret.selector = this.selector ? this.selector + " " + selector : selector; return ret; }, filter: function( selector ) { return this.pushStack( winnow(this, selector || [], false) ); }, not: function( selector ) { return this.pushStack( winnow(this, selector || [], true) ); }, is: function( selector ) { return !!winnow( this, // If this is a positional/relative selector, check membership in the returned set // so $("p:first").is("p:last") won't return true for a doc with two "p". typeof selector === "string" && rneedsContext.test( selector ) ? jQuery( selector ) : selector || [], false ).length; } }); // Initialize a jQuery object // A central reference to the root jQuery(document) var rootjQuery, // Use the correct document accordingly with window argument (sandbox) document = window.document, // A simple way to check for HTML strings // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) // Strict HTML recognition (#11290: must start with <) rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, init = jQuery.fn.init = function( selector, context ) { var match, elem; // HANDLE: $(""), $(null), $(undefined), $(false) if ( !selector ) { return this; } // Handle HTML strings if ( typeof selector === "string" ) { if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { // Assume that strings that start and end with <> are HTML and skip the regex check match = [ null, selector, null ]; } else { match = rquickExpr.exec( selector ); } // Match html or make sure no context is specified for #id if ( match && (match[1] || !context) ) { // HANDLE: $(html) -> $(array) if ( match[1] ) { context = context instanceof jQuery ? context[0] : context; // scripts is true for back-compat // Intentionally let the error be thrown if parseHTML is not present jQuery.merge( this, jQuery.parseHTML( match[1], context && context.nodeType ? context.ownerDocument || context : document, true ) ); // HANDLE: $(html, props) if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { for ( match in context ) { // Properties of context are called as methods if possible if ( jQuery.isFunction( this[ match ] ) ) { this[ match ]( context[ match ] ); // ...and otherwise set as attributes } else { this.attr( match, context[ match ] ); } } } return this; // HANDLE: $(#id) } else { elem = document.getElementById( match[2] ); // Check parentNode to catch when Blackberry 4.6 returns // nodes that are no longer in the document #6963 if ( elem && elem.parentNode ) { // Handle the case where IE and Opera return items // by name instead of ID if ( elem.id !== match[2] ) { return rootjQuery.find( selector ); } // Otherwise, we inject the element directly into the jQuery object this.length = 1; this[0] = elem; } this.context = document; this.selector = selector; return this; } // HANDLE: $(expr, $(...)) } else if ( !context || context.jquery ) { return ( context || rootjQuery ).find( selector ); // HANDLE: $(expr, context) // (which is just equivalent to: $(context).find(expr) } else { return this.constructor( context ).find( selector ); } // HANDLE: $(DOMElement) } else if ( selector.nodeType ) { this.context = this[0] = selector; this.length = 1; return this; // HANDLE: $(function) // Shortcut for document ready } else if ( jQuery.isFunction( selector ) ) { return typeof rootjQuery.ready !== "undefined" ? rootjQuery.ready( selector ) : // Execute immediately if ready is not present selector( jQuery ); } if ( selector.selector !== undefined ) { this.selector = selector.selector; this.context = selector.context; } return jQuery.makeArray( selector, this ); }; // Give the init function the jQuery prototype for later instantiation init.prototype = jQuery.fn; // Initialize central reference rootjQuery = jQuery( document ); var rparentsprev = /^(?:parents|prev(?:Until|All))/, // methods guaranteed to produce a unique set when starting from a unique set guaranteedUnique = { children: true, contents: true, next: true, prev: true }; jQuery.extend({ dir: function( elem, dir, until ) { var matched = [], cur = elem[ dir ]; while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { if ( cur.nodeType === 1 ) { matched.push( cur ); } cur = cur[dir]; } return matched; }, sibling: function( n, elem ) { var r = []; for ( ; n; n = n.nextSibling ) { if ( n.nodeType === 1 && n !== elem ) { r.push( n ); } } return r; } }); jQuery.fn.extend({ has: function( target ) { var i, targets = jQuery( target, this ), len = targets.length; return this.filter(function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( this, targets[i] ) ) { return true; } } }); }, closest: function( selectors, context ) { var cur, i = 0, l = this.length, matched = [], pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? jQuery( selectors, context || this.context ) : 0; for ( ; i < l; i++ ) { for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { // Always skip document fragments if ( cur.nodeType < 11 && (pos ? pos.index(cur) > -1 : // Don't pass non-elements to Sizzle cur.nodeType === 1 && jQuery.find.matchesSelector(cur, selectors)) ) { matched.push( cur ); break; } } } return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched ); }, // Determine the position of an element within // the matched set of elements index: function( elem ) { // No argument, return index in parent if ( !elem ) { return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; } // index in selector if ( typeof elem === "string" ) { return jQuery.inArray( this[0], jQuery( elem ) ); } // Locate the position of the desired element return jQuery.inArray( // If it receives a jQuery object, the first element is used elem.jquery ? elem[0] : elem, this ); }, add: function( selector, context ) { return this.pushStack( jQuery.unique( jQuery.merge( this.get(), jQuery( selector, context ) ) ) ); }, addBack: function( selector ) { return this.add( selector == null ? this.prevObject : this.prevObject.filter(selector) ); } }); function sibling( cur, dir ) { do { cur = cur[ dir ]; } while ( cur && cur.nodeType !== 1 ); return cur; } jQuery.each({ parent: function( elem ) { var parent = elem.parentNode; return parent && parent.nodeType !== 11 ? parent : null; }, parents: function( elem ) { return jQuery.dir( elem, "parentNode" ); }, parentsUntil: function( elem, i, until ) { return jQuery.dir( elem, "parentNode", until ); }, next: function( elem ) { return sibling( elem, "nextSibling" ); }, prev: function( elem ) { return sibling( elem, "previousSibling" ); }, nextAll: function( elem ) { return jQuery.dir( elem, "nextSibling" ); }, prevAll: function( elem ) { return jQuery.dir( elem, "previousSibling" ); }, nextUntil: function( elem, i, until ) { return jQuery.dir( elem, "nextSibling", until ); }, prevUntil: function( elem, i, until ) { return jQuery.dir( elem, "previousSibling", until ); }, siblings: function( elem ) { return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); }, children: function( elem ) { return jQuery.sibling( elem.firstChild ); }, contents: function( elem ) { return jQuery.nodeName( elem, "iframe" ) ? elem.contentDocument || elem.contentWindow.document : jQuery.merge( [], elem.childNodes ); } }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { var ret = jQuery.map( this, fn, until ); if ( name.slice( -5 ) !== "Until" ) { selector = until; } if ( selector && typeof selector === "string" ) { ret = jQuery.filter( selector, ret ); } if ( this.length > 1 ) { // Remove duplicates if ( !guaranteedUnique[ name ] ) { ret = jQuery.unique( ret ); } // Reverse order for parents* and prev-derivatives if ( rparentsprev.test( name ) ) { ret = ret.reverse(); } } return this.pushStack( ret ); }; }); var rnotwhite = (/\S+/g); // String to Object options format cache var optionsCache = {}; // Convert String-formatted options into Object-formatted ones and store in cache function createOptions( options ) { var object = optionsCache[ options ] = {}; jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { object[ flag ] = true; }); return object; } /* * Create a callback list using the following parameters: * * options: an optional list of space-separated options that will change how * the callback list behaves or a more traditional option object * * By default a callback list will act like an event callback list and can be * "fired" multiple times. * * Possible options: * * once: will ensure the callback list can only be fired once (like a Deferred) * * memory: will keep track of previous values and will call any callback added * after the list has been fired right away with the latest "memorized" * values (like a Deferred) * * unique: will ensure a callback can only be added once (no duplicate in the list) * * stopOnFalse: interrupt callings when a callback returns false * */ jQuery.Callbacks = function( options ) { // Convert options from String-formatted to Object-formatted if needed // (we check in cache first) options = typeof options === "string" ? ( optionsCache[ options ] || createOptions( options ) ) : jQuery.extend( {}, options ); var // Flag to know if list is currently firing firing, // Last fire value (for non-forgettable lists) memory, // Flag to know if list was already fired fired, // End of the loop when firing firingLength, // Index of currently firing callback (modified by remove if needed) firingIndex, // First callback to fire (used internally by add and fireWith) firingStart, // Actual callback list list = [], // Stack of fire calls for repeatable lists stack = !options.once && [], // Fire callbacks fire = function( data ) { memory = options.memory && data; fired = true; firingIndex = firingStart || 0; firingStart = 0; firingLength = list.length; firing = true; for ( ; list && firingIndex < firingLength; firingIndex++ ) { if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { memory = false; // To prevent further calls using add break; } } firing = false; if ( list ) { if ( stack ) { if ( stack.length ) { fire( stack.shift() ); } } else if ( memory ) { list = []; } else { self.disable(); } } }, // Actual Callbacks object self = { // Add a callback or a collection of callbacks to the list add: function() { if ( list ) { // First, we save the current length var start = list.length; (function add( args ) { jQuery.each( args, function( _, arg ) { var type = jQuery.type( arg ); if ( type === "function" ) { if ( !options.unique || !self.has( arg ) ) { list.push( arg ); } } else if ( arg && arg.length && type !== "string" ) { // Inspect recursively add( arg ); } }); })( arguments ); // Do we need to add the callbacks to the // current firing batch? if ( firing ) { firingLength = list.length; // With memory, if we're not firing then // we should call right away } else if ( memory ) { firingStart = start; fire( memory ); } } return this; }, // Remove a callback from the list remove: function() { if ( list ) { jQuery.each( arguments, function( _, arg ) { var index; while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { list.splice( index, 1 ); // Handle firing indexes if ( firing ) { if ( index <= firingLength ) { firingLength--; } if ( index <= firingIndex ) { firingIndex--; } } } }); } return this; }, // Check if a given callback is in the list. // If no argument is given, return whether or not list has callbacks attached. has: function( fn ) { return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); }, // Remove all callbacks from the list empty: function() { list = []; firingLength = 0; return this; }, // Have the list do nothing anymore disable: function() { list = stack = memory = undefined; return this; }, // Is it disabled? disabled: function() { return !list; }, // Lock the list in its current state lock: function() { stack = undefined; if ( !memory ) { self.disable(); } return this; }, // Is it locked? locked: function() { return !stack; }, // Call all callbacks with the given context and arguments fireWith: function( context, args ) { if ( list && ( !fired || stack ) ) { args = args || []; args = [ context, args.slice ? args.slice() : args ]; if ( firing ) { stack.push( args ); } else { fire( args ); } } return this; }, // Call all the callbacks with the given arguments fire: function() { self.fireWith( this, arguments ); return this; }, // To know if the callbacks have already been called at least once fired: function() { return !!fired; } }; return self; }; jQuery.extend({ Deferred: function( func ) { var tuples = [ // action, add listener, listener list, final state [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], [ "notify", "progress", jQuery.Callbacks("memory") ] ], state = "pending", promise = { state: function() { return state; }, always: function() { deferred.done( arguments ).fail( arguments ); return this; }, then: function( /* fnDone, fnFail, fnProgress */ ) { var fns = arguments; return jQuery.Deferred(function( newDefer ) { jQuery.each( tuples, function( i, tuple ) { var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; // deferred[ done | fail | progress ] for forwarding actions to newDefer deferred[ tuple[1] ](function() { var returned = fn && fn.apply( this, arguments ); if ( returned && jQuery.isFunction( returned.promise ) ) { returned.promise() .done( newDefer.resolve ) .fail( newDefer.reject ) .progress( newDefer.notify ); } else { newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); } }); }); fns = null; }).promise(); }, // Get a promise for this deferred // If obj is provided, the promise aspect is added to the object promise: function( obj ) { return obj != null ? jQuery.extend( obj, promise ) : promise; } }, deferred = {}; // Keep pipe for back-compat promise.pipe = promise.then; // Add list-specific methods jQuery.each( tuples, function( i, tuple ) { var list = tuple[ 2 ], stateString = tuple[ 3 ]; // promise[ done | fail | progress ] = list.add promise[ tuple[1] ] = list.add; // Handle state if ( stateString ) { list.add(function() { // state = [ resolved | rejected ] state = stateString; // [ reject_list | resolve_list ].disable; progress_list.lock }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); } // deferred[ resolve | reject | notify ] deferred[ tuple[0] ] = function() { deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); return this; }; deferred[ tuple[0] + "With" ] = list.fireWith; }); // Make the deferred a promise promise.promise( deferred ); // Call given func if any if ( func ) { func.call( deferred, deferred ); } // All done! return deferred; }, // Deferred helper when: function( subordinate /* , ..., subordinateN */ ) { var i = 0, resolveValues = slice.call( arguments ), length = resolveValues.length, // the count of uncompleted subordinates remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, // the master Deferred. If resolveValues consist of only a single Deferred, just use that. deferred = remaining === 1 ? subordinate : jQuery.Deferred(), // Update function for both resolve and progress values updateFunc = function( i, contexts, values ) { return function( value ) { contexts[ i ] = this; values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; if ( values === progressValues ) { deferred.notifyWith( contexts, values ); } else if ( !(--remaining) ) { deferred.resolveWith( contexts, values ); } }; }, progressValues, progressContexts, resolveContexts; // add listeners to Deferred subordinates; treat others as resolved if ( length > 1 ) { progressValues = new Array( length ); progressContexts = new Array( length ); resolveContexts = new Array( length ); for ( ; i < length; i++ ) { if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { resolveValues[ i ].promise() .done( updateFunc( i, resolveContexts, resolveValues ) ) .fail( deferred.reject ) .progress( updateFunc( i, progressContexts, progressValues ) ); } else { --remaining; } } } // if we're not waiting on anything, resolve the master if ( !remaining ) { deferred.resolveWith( resolveContexts, resolveValues ); } return deferred.promise(); } }); // The deferred used on DOM ready var readyList; jQuery.fn.ready = function( fn ) { // Add the callback jQuery.ready.promise().done( fn ); return this; }; jQuery.extend({ // Is the DOM ready to be used? Set to true once it occurs. isReady: false, // A counter to track how many items to wait for before // the ready event fires. See #6781 readyWait: 1, // Hold (or release) the ready event holdReady: function( hold ) { if ( hold ) { jQuery.readyWait++; } else { jQuery.ready( true ); } }, // Handle when the DOM is ready ready: function( wait ) { // Abort if there are pending holds or we're already ready if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { return; } // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). if ( !document.body ) { return setTimeout( jQuery.ready ); } // Remember that the DOM is ready jQuery.isReady = true; // If a normal DOM Ready event fired, decrement, and wait if need be if ( wait !== true && --jQuery.readyWait > 0 ) { return; } // If there are functions bound, to execute readyList.resolveWith( document, [ jQuery ] ); // Trigger any bound ready events if ( jQuery.fn.triggerHandler ) { jQuery( document ).triggerHandler( "ready" ); jQuery( document ).off( "ready" ); } } }); /** * Clean-up method for dom ready events */ function detach() { if ( document.addEventListener ) { document.removeEventListener( "DOMContentLoaded", completed, false ); window.removeEventListener( "load", completed, false ); } else { document.detachEvent( "onreadystatechange", completed ); window.detachEvent( "onload", completed ); } } /** * The ready event handler and self cleanup method */ function completed() { // readyState === "complete" is good enough for us to call the dom ready in oldIE if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { detach(); jQuery.ready(); } } jQuery.ready.promise = function( obj ) { if ( !readyList ) { readyList = jQuery.Deferred(); // Catch cases where $(document).ready() is called after the browser event has already occurred. // we once tried to use readyState "interactive" here, but it caused issues like the one // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 if ( document.readyState === "complete" ) { // Handle it asynchronously to allow scripts the opportunity to delay ready setTimeout( jQuery.ready ); // Standards-based browsers support DOMContentLoaded } else if ( document.addEventListener ) { // Use the handy event callback document.addEventListener( "DOMContentLoaded", completed, false ); // A fallback to window.onload, that will always work window.addEventListener( "load", completed, false ); // If IE event model is used } else { // Ensure firing before onload, maybe late but safe also for iframes document.attachEvent( "onreadystatechange", completed ); // A fallback to window.onload, that will always work window.attachEvent( "onload", completed ); // If IE and not a frame // continually check to see if the document is ready var top = false; try { top = window.frameElement == null && document.documentElement; } catch(e) {} if ( top && top.doScroll ) { (function doScrollCheck() { if ( !jQuery.isReady ) { try { // Use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/ top.doScroll("left"); } catch(e) { return setTimeout( doScrollCheck, 50 ); } // detach all dom ready events detach(); // and execute any waiting functions jQuery.ready(); } })(); } } } return readyList.promise( obj ); }; var strundefined = typeof undefined; // Support: IE<9 // Iteration over object's inherited properties before its own var i; for ( i in jQuery( support ) ) { break; } support.ownLast = i !== "0"; // Note: most support tests are defined in their respective modules. // false until the test is run support.inlineBlockNeedsLayout = false; // Execute ASAP in case we need to set body.style.zoom jQuery(function() { // Minified: var a,b,c,d var val, div, body, container; body = document.getElementsByTagName( "body" )[ 0 ]; if ( !body || !body.style ) { // Return for frameset docs that don't have a body return; } // Setup div = document.createElement( "div" ); container = document.createElement( "div" ); container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; body.appendChild( container ).appendChild( div ); if ( typeof div.style.zoom !== strundefined ) { // Support: IE<8 // Check if natively block-level elements act like inline-block // elements when setting their display to 'inline' and giving // them layout div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1"; support.inlineBlockNeedsLayout = val = div.offsetWidth === 3; if ( val ) { // Prevent IE 6 from affecting layout for positioned elements #11048 // Prevent IE from shrinking the body in IE 7 mode #12869 // Support: IE<8 body.style.zoom = 1; } } body.removeChild( container ); }); (function() { var div = document.createElement( "div" ); // Execute the test only if not already executed in another module. if (support.deleteExpando == null) { // Support: IE<9 support.deleteExpando = true; try { delete div.test; } catch( e ) { support.deleteExpando = false; } } // Null elements to avoid leaks in IE. div = null; })(); /** * Determines whether an object can have data */ jQuery.acceptData = function( elem ) { var noData = jQuery.noData[ (elem.nodeName + " ").toLowerCase() ], nodeType = +elem.nodeType || 1; // Do not set data on non-element DOM nodes because it will not be cleared (#8335). return nodeType !== 1 && nodeType !== 9 ? false : // Nodes accept data unless otherwise specified; rejection can be conditional !noData || noData !== true && elem.getAttribute("classid") === noData; }; var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, rmultiDash = /([A-Z])/g; function dataAttr( elem, key, data ) { // If nothing was found internally, try to fetch any // data from the HTML5 data-* attribute if ( data === undefined && elem.nodeType === 1 ) { var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); data = elem.getAttribute( name ); if ( typeof data === "string" ) { try { data = data === "true" ? true : data === "false" ? false : data === "null" ? null : // Only convert to a number if it doesn't change the string +data + "" === data ? +data : rbrace.test( data ) ? jQuery.parseJSON( data ) : data; } catch( e ) {} // Make sure we set the data so it isn't changed later jQuery.data( elem, key, data ); } else { data = undefined; } } return data; } // checks a cache object for emptiness function isEmptyDataObject( obj ) { var name; for ( name in obj ) { // if the public data object is empty, the private is still empty if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { continue; } if ( name !== "toJSON" ) { return false; } } return true; } function internalData( elem, name, data, pvt /* Internal Use Only */ ) { if ( !jQuery.acceptData( elem ) ) { return; } var ret, thisCache, internalKey = jQuery.expando, // We have to handle DOM nodes and JS objects differently because IE6-7 // can't GC object references properly across the DOM-JS boundary isNode = elem.nodeType, // Only DOM nodes need the global jQuery cache; JS object data is // attached directly to the object so GC can occur automatically cache = isNode ? jQuery.cache : elem, // Only defining an ID for JS objects if its cache already exists allows // the code to shortcut on the same path as a DOM node with no cache id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; // Avoid doing any more work than we need to when trying to get data on an // object that has no data at all if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) { return; } if ( !id ) { // Only DOM nodes need a new unique ID for each element since their data // ends up in the global cache if ( isNode ) { id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++; } else { id = internalKey; } } if ( !cache[ id ] ) { // Avoid exposing jQuery metadata on plain JS objects when the object // is serialized using JSON.stringify cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; } // An object can be passed to jQuery.data instead of a key/value pair; this gets // shallow copied over onto the existing cache if ( typeof name === "object" || typeof name === "function" ) { if ( pvt ) { cache[ id ] = jQuery.extend( cache[ id ], name ); } else { cache[ id ].data = jQuery.extend( cache[ id ].data, name ); } } thisCache = cache[ id ]; // jQuery data() is stored in a separate object inside the object's internal data // cache in order to avoid key collisions between internal data and user-defined // data. if ( !pvt ) { if ( !thisCache.data ) { thisCache.data = {}; } thisCache = thisCache.data; } if ( data !== undefined ) { thisCache[ jQuery.camelCase( name ) ] = data; } // Check for both converted-to-camel and non-converted data property names // If a data property was specified if ( typeof name === "string" ) { // First Try to find as-is property data ret = thisCache[ name ]; // Test for null|undefined property data if ( ret == null ) { // Try to find the camelCased property ret = thisCache[ jQuery.camelCase( name ) ]; } } else { ret = thisCache; } return ret; } function internalRemoveData( elem, name, pvt ) { if ( !jQuery.acceptData( elem ) ) { return; } var thisCache, i, isNode = elem.nodeType, // See jQuery.data for more information cache = isNode ? jQuery.cache : elem, id = isNode ? elem[ jQuery.expando ] : jQuery.expando; // If there is already no cache entry for this object, there is no // purpose in continuing if ( !cache[ id ] ) { return; } if ( name ) { thisCache = pvt ? cache[ id ] : cache[ id ].data; if ( thisCache ) { // Support array or space separated string names for data keys if ( !jQuery.isArray( name ) ) { // try the string as a key before any manipulation if ( name in thisCache ) { name = [ name ]; } else { // split the camel cased version by spaces unless a key with the spaces exists name = jQuery.camelCase( name ); if ( name in thisCache ) { name = [ name ]; } else { name = name.split(" "); } } } else { // If "name" is an array of keys... // When data is initially created, via ("key", "val") signature, // keys will be converted to camelCase. // Since there is no way to tell _how_ a key was added, remove // both plain key and camelCase key. #12786 // This will only penalize the array argument path. name = name.concat( jQuery.map( name, jQuery.camelCase ) ); } i = name.length; while ( i-- ) { delete thisCache[ name[i] ]; } // If there is no data left in the cache, we want to continue // and let the cache object itself get destroyed if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) { return; } } } // See jQuery.data for more information if ( !pvt ) { delete cache[ id ].data; // Don't destroy the parent cache unless the internal data object // had been the only thing left in it if ( !isEmptyDataObject( cache[ id ] ) ) { return; } } // Destroy the cache if ( isNode ) { jQuery.cleanData( [ elem ], true ); // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) /* jshint eqeqeq: false */ } else if ( support.deleteExpando || cache != cache.window ) { /* jshint eqeqeq: true */ delete cache[ id ]; // When all else fails, null } else { cache[ id ] = null; } } jQuery.extend({ cache: {}, // The following elements (space-suffixed to avoid Object.prototype collisions) // throw uncatchable exceptions if you attempt to set expando properties noData: { "applet ": true, "embed ": true, // ...but Flash objects (which have this classid) *can* handle expandos "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" }, hasData: function( elem ) { elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; return !!elem && !isEmptyDataObject( elem ); }, data: function( elem, name, data ) { return internalData( elem, name, data ); }, removeData: function( elem, name ) { return internalRemoveData( elem, name ); }, // For internal use only. _data: function( elem, name, data ) { return internalData( elem, name, data, true ); }, _removeData: function( elem, name ) { return internalRemoveData( elem, name, true ); } }); jQuery.fn.extend({ data: function( key, value ) { var i, name, data, elem = this[0], attrs = elem && elem.attributes; // Special expections of .data basically thwart jQuery.access, // so implement the relevant behavior ourselves // Gets all values if ( key === undefined ) { if ( this.length ) { data = jQuery.data( elem ); if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { i = attrs.length; while ( i-- ) { // Support: IE11+ // The attrs elements can be null (#14894) if ( attrs[ i ] ) { name = attrs[ i ].name; if ( name.indexOf( "data-" ) === 0 ) { name = jQuery.camelCase( name.slice(5) ); dataAttr( elem, name, data[ name ] ); } } } jQuery._data( elem, "parsedAttrs", true ); } } return data; } // Sets multiple values if ( typeof key === "object" ) { return this.each(function() { jQuery.data( this, key ); }); } return arguments.length > 1 ? // Sets one value this.each(function() { jQuery.data( this, key, value ); }) : // Gets one value // Try to fetch any internally stored data first elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined; }, removeData: function( key ) { return this.each(function() { jQuery.removeData( this, key ); }); } }); jQuery.extend({ queue: function( elem, type, data ) { var queue; if ( elem ) { type = ( type || "fx" ) + "queue"; queue = jQuery._data( elem, type ); // Speed up dequeue by getting out quickly if this is just a lookup if ( data ) { if ( !queue || jQuery.isArray(data) ) { queue = jQuery._data( elem, type, jQuery.makeArray(data) ); } else { queue.push( data ); } } return queue || []; } }, dequeue: function( elem, type ) { type = type || "fx"; var queue = jQuery.queue( elem, type ), startLength = queue.length, fn = queue.shift(), hooks = jQuery._queueHooks( elem, type ), next = function() { jQuery.dequeue( elem, type ); }; // If the fx queue is dequeued, always remove the progress sentinel if ( fn === "inprogress" ) { fn = queue.shift(); startLength--; } if ( fn ) { // Add a progress sentinel to prevent the fx queue from being // automatically dequeued if ( type === "fx" ) { queue.unshift( "inprogress" ); } // clear up the last queue stop function delete hooks.stop; fn.call( elem, next, hooks ); } if ( !startLength && hooks ) { hooks.empty.fire(); } }, // not intended for public consumption - generates a queueHooks object, or returns the current one _queueHooks: function( elem, type ) { var key = type + "queueHooks"; return jQuery._data( elem, key ) || jQuery._data( elem, key, { empty: jQuery.Callbacks("once memory").add(function() { jQuery._removeData( elem, type + "queue" ); jQuery._removeData( elem, key ); }) }); } }); jQuery.fn.extend({ queue: function( type, data ) { var setter = 2; if ( typeof type !== "string" ) { data = type; type = "fx"; setter--; } if ( arguments.length < setter ) { return jQuery.queue( this[0], type ); } return data === undefined ? this : this.each(function() { var queue = jQuery.queue( this, type, data ); // ensure a hooks for this queue jQuery._queueHooks( this, type ); if ( type === "fx" && queue[0] !== "inprogress" ) { jQuery.dequeue( this, type ); } }); }, dequeue: function( type ) { return this.each(function() { jQuery.dequeue( this, type ); }); }, clearQueue: function( type ) { return this.queue( type || "fx", [] ); }, // Get a promise resolved when queues of a certain type // are emptied (fx is the type by default) promise: function( type, obj ) { var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i = this.length, resolve = function() { if ( !( --count ) ) { defer.resolveWith( elements, [ elements ] ); } }; if ( typeof type !== "string" ) { obj = type; type = undefined; } type = type || "fx"; while ( i-- ) { tmp = jQuery._data( elements[ i ], type + "queueHooks" ); if ( tmp && tmp.empty ) { count++; tmp.empty.add( resolve ); } } resolve(); return defer.promise( obj ); } }); var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source; var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; var isHidden = function( elem, el ) { // isHidden might be called from jQuery#filter function; // in that case, element will be second argument elem = el || elem; return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); }; // Multifunctional method to get and set values of a collection // The value/s can optionally be executed if it's a function var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) { var i = 0, length = elems.length, bulk = key == null; // Sets many values if ( jQuery.type( key ) === "object" ) { chainable = true; for ( i in key ) { jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); } // Sets one value } else if ( value !== undefined ) { chainable = true; if ( !jQuery.isFunction( value ) ) { raw = true; } if ( bulk ) { // Bulk operations run against the entire set if ( raw ) { fn.call( elems, value ); fn = null; // ...except when executing function values } else { bulk = fn; fn = function( elem, key, value ) { return bulk.call( jQuery( elem ), value ); }; } } if ( fn ) { for ( ; i < length; i++ ) { fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); } } } return chainable ? elems : // Gets bulk ? fn.call( elems ) : length ? fn( elems[0], key ) : emptyGet; }; var rcheckableType = (/^(?:checkbox|radio)$/i); (function() { // Minified: var a,b,c var input = document.createElement( "input" ), div = document.createElement( "div" ), fragment = document.createDocumentFragment(); // Setup div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; // IE strips leading whitespace when .innerHTML is used support.leadingWhitespace = div.firstChild.nodeType === 3; // Make sure that tbody elements aren't automatically inserted // IE will insert them into empty tables support.tbody = !div.getElementsByTagName( "tbody" ).length; // Make sure that link elements get serialized correctly by innerHTML // This requires a wrapper element in IE support.htmlSerialize = !!div.getElementsByTagName( "link" ).length; // Makes sure cloning an html5 element does not cause problems // Where outerHTML is undefined, this still works support.html5Clone = document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav></:nav>"; // Check if a disconnected checkbox will retain its checked // value of true after appended to the DOM (IE6/7) input.type = "checkbox"; input.checked = true; fragment.appendChild( input ); support.appendChecked = input.checked; // Make sure textarea (and checkbox) defaultValue is properly cloned // Support: IE6-IE11+ div.innerHTML = "<textarea>x</textarea>"; support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; // #11217 - WebKit loses check when the name is after the checked attribute fragment.appendChild( div ); div.innerHTML = "<input type='radio' checked='checked' name='t'/>"; // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3 // old WebKit doesn't clone checked state correctly in fragments support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; // Support: IE<9 // Opera does not clone events (and typeof div.attachEvent === undefined). // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() support.noCloneEvent = true; if ( div.attachEvent ) { div.attachEvent( "onclick", function() { support.noCloneEvent = false; }); div.cloneNode( true ).click(); } // Execute the test only if not already executed in another module. if (support.deleteExpando == null) { // Support: IE<9 support.deleteExpando = true; try { delete div.test; } catch( e ) { support.deleteExpando = false; } } })(); (function() { var i, eventName, div = document.createElement( "div" ); // Support: IE<9 (lack submit/change bubble), Firefox 23+ (lack focusin event) for ( i in { submit: true, change: true, focusin: true }) { eventName = "on" + i; if ( !(support[ i + "Bubbles" ] = eventName in window) ) { // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) div.setAttribute( eventName, "t" ); support[ i + "Bubbles" ] = div.attributes[ eventName ].expando === false; } } // Null elements to avoid leaks in IE. div = null; })(); var rformElems = /^(?:input|select|textarea)$/i, rkeyEvent = /^key/, rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/, rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; function returnTrue() { return true; } function returnFalse() { return false; } function safeActiveElement() { try { return document.activeElement; } catch ( err ) { } } /* * Helper functions for managing events -- not part of the public interface. * Props to Dean Edwards' addEvent library for many of the ideas. */ jQuery.event = { global: {}, add: function( elem, types, handler, data, selector ) { var tmp, events, t, handleObjIn, special, eventHandle, handleObj, handlers, type, namespaces, origType, elemData = jQuery._data( elem ); // Don't attach events to noData or text/comment nodes (but allow plain objects) if ( !elemData ) { return; } // Caller can pass in an object of custom data in lieu of the handler if ( handler.handler ) { handleObjIn = handler; handler = handleObjIn.handler; selector = handleObjIn.selector; } // Make sure that the handler has a unique ID, used to find/remove it later if ( !handler.guid ) { handler.guid = jQuery.guid++; } // Init the element's event structure and main handler, if this is the first if ( !(events = elemData.events) ) { events = elemData.events = {}; } if ( !(eventHandle = elemData.handle) ) { eventHandle = elemData.handle = function( e ) { // Discard the second event of a jQuery.event.trigger() and // when an event is called after a page has unloaded return typeof jQuery !== strundefined && (!e || jQuery.event.triggered !== e.type) ? jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : undefined; }; // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events eventHandle.elem = elem; } // Handle multiple events separated by a space types = ( types || "" ).match( rnotwhite ) || [ "" ]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); // There *must* be a type, no attaching namespace-only handlers if ( !type ) { continue; } // If event changes its type, use the special event handlers for the changed type special = jQuery.event.special[ type ] || {}; // If selector defined, determine special event api type, otherwise given type type = ( selector ? special.delegateType : special.bindType ) || type; // Update special based on newly reset type special = jQuery.event.special[ type ] || {}; // handleObj is passed to all event handlers handleObj = jQuery.extend({ type: type, origType: origType, data: data, handler: handler, guid: handler.guid, selector: selector, needsContext: selector && jQuery.expr.match.needsContext.test( selector ), namespace: namespaces.join(".") }, handleObjIn ); // Init the event handler queue if we're the first if ( !(handlers = events[ type ]) ) { handlers = events[ type ] = []; handlers.delegateCount = 0; // Only use addEventListener/attachEvent if the special events handler returns false if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { // Bind the global event handler to the element if ( elem.addEventListener ) { elem.addEventListener( type, eventHandle, false ); } else if ( elem.attachEvent ) { elem.attachEvent( "on" + type, eventHandle ); } } } if ( special.add ) { special.add.call( elem, handleObj ); if ( !handleObj.handler.guid ) { handleObj.handler.guid = handler.guid; } } // Add to the element's handler list, delegates in front if ( selector ) { handlers.splice( handlers.delegateCount++, 0, handleObj ); } else { handlers.push( handleObj ); } // Keep track of which events have ever been used, for event optimization jQuery.event.global[ type ] = true; } // Nullify elem to prevent memory leaks in IE elem = null; }, // Detach an event or set of events from an element remove: function( elem, types, handler, selector, mappedTypes ) { var j, handleObj, tmp, origCount, t, events, special, handlers, type, namespaces, origType, elemData = jQuery.hasData( elem ) && jQuery._data( elem ); if ( !elemData || !(events = elemData.events) ) { return; } // Once for each type.namespace in types; type may be omitted types = ( types || "" ).match( rnotwhite ) || [ "" ]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[t] ) || []; type = origType = tmp[1]; namespaces = ( tmp[2] || "" ).split( "." ).sort(); // Unbind all events (on this namespace, if provided) for the element if ( !type ) { for ( type in events ) { jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); } continue; } special = jQuery.event.special[ type ] || {}; type = ( selector ? special.delegateType : special.bindType ) || type; handlers = events[ type ] || []; tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); // Remove matching events origCount = j = handlers.length; while ( j-- ) { handleObj = handlers[ j ]; if ( ( mappedTypes || origType === handleObj.origType ) && ( !handler || handler.guid === handleObj.guid ) && ( !tmp || tmp.test( handleObj.namespace ) ) && ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { handlers.splice( j, 1 ); if ( handleObj.selector ) { handlers.delegateCount--; } if ( special.remove ) { special.remove.call( elem, handleObj ); } } } // Remove generic event handler if we removed something and no more handlers exist // (avoids potential for endless recursion during removal of special event handlers) if ( origCount && !handlers.length ) { if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { jQuery.removeEvent( elem, type, elemData.handle ); } delete events[ type ]; } } // Remove the expando if it's no longer used if ( jQuery.isEmptyObject( events ) ) { delete elemData.handle; // removeData also checks for emptiness and clears the expando if empty // so use it instead of delete jQuery._removeData( elem, "events" ); } }, trigger: function( event, data, elem, onlyHandlers ) { var handle, ontype, cur, bubbleType, special, tmp, i, eventPath = [ elem || document ], type = hasOwn.call( event, "type" ) ? event.type : event, namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; cur = tmp = elem = elem || document; // Don't do events on text and comment nodes if ( elem.nodeType === 3 || elem.nodeType === 8 ) { return; } // focus/blur morphs to focusin/out; ensure we're not firing them right now if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { return; } if ( type.indexOf(".") >= 0 ) { // Namespaced trigger; create a regexp to match event type in handle() namespaces = type.split("."); type = namespaces.shift(); namespaces.sort(); } ontype = type.indexOf(":") < 0 && "on" + type; // Caller can pass in a jQuery.Event object, Object, or just an event type string event = event[ jQuery.expando ] ? event : new jQuery.Event( type, typeof event === "object" && event ); // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) event.isTrigger = onlyHandlers ? 2 : 3; event.namespace = namespaces.join("."); event.namespace_re = event.namespace ? new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : null; // Clean up the event in case it is being reused event.result = undefined; if ( !event.target ) { event.target = elem; } // Clone any incoming data and prepend the event, creating the handler arg list data = data == null ? [ event ] : jQuery.makeArray( data, [ event ] ); // Allow special events to draw outside the lines special = jQuery.event.special[ type ] || {}; if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { return; } // Determine event propagation path in advance, per W3C events spec (#9951) // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { bubbleType = special.delegateType || type; if ( !rfocusMorph.test( bubbleType + type ) ) { cur = cur.parentNode; } for ( ; cur; cur = cur.parentNode ) { eventPath.push( cur ); tmp = cur; } // Only add window if we got to document (e.g., not plain obj or detached DOM) if ( tmp === (elem.ownerDocument || document) ) { eventPath.push( tmp.defaultView || tmp.parentWindow || window ); } } // Fire handlers on the event path i = 0; while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { event.type = i > 1 ? bubbleType : special.bindType || type; // jQuery handler handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); if ( handle ) { handle.apply( cur, data ); } // Native handler handle = ontype && cur[ ontype ]; if ( handle && handle.apply && jQuery.acceptData( cur ) ) { event.result = handle.apply( cur, data ); if ( event.result === false ) { event.preventDefault(); } } } event.type = type; // If nobody prevented the default action, do it now if ( !onlyHandlers && !event.isDefaultPrevented() ) { if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && jQuery.acceptData( elem ) ) { // Call a native DOM method on the target with the same name name as the event. // Can't use an .isFunction() check here because IE6/7 fails that test. // Don't do default actions on window, that's where global variables be (#6170) if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { // Don't re-trigger an onFOO event when we call its FOO() method tmp = elem[ ontype ]; if ( tmp ) { elem[ ontype ] = null; } // Prevent re-triggering of the same event, since we already bubbled it above jQuery.event.triggered = type; try { elem[ type ](); } catch ( e ) { // IE<9 dies on focus/blur to hidden element (#1486,#12518) // only reproducible on winXP IE8 native, not IE9 in IE8 mode } jQuery.event.triggered = undefined; if ( tmp ) { elem[ ontype ] = tmp; } } } } return event.result; }, dispatch: function( event ) { // Make a writable jQuery.Event from the native event object event = jQuery.event.fix( event ); var i, ret, handleObj, matched, j, handlerQueue = [], args = slice.call( arguments ), handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], special = jQuery.event.special[ event.type ] || {}; // Use the fix-ed jQuery.Event rather than the (read-only) native event args[0] = event; event.delegateTarget = this; // Call the preDispatch hook for the mapped type, and let it bail if desired if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { return; } // Determine handlers handlerQueue = jQuery.event.handlers.call( this, event, handlers ); // Run delegates first; they may want to stop propagation beneath us i = 0; while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { event.currentTarget = matched.elem; j = 0; while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { // Triggered event must either 1) have no namespace, or // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { event.handleObj = handleObj; event.data = handleObj.data; ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) .apply( matched.elem, args ); if ( ret !== undefined ) { if ( (event.result = ret) === false ) { event.preventDefault(); event.stopPropagation(); } } } } } // Call the postDispatch hook for the mapped type if ( special.postDispatch ) { special.postDispatch.call( this, event ); } return event.result; }, handlers: function( event, handlers ) { var sel, handleObj, matches, i, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target; // Find delegate handlers // Black-hole SVG <use> instance trees (#13180) // Avoid non-left-click bubbling in Firefox (#3861) if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { /* jshint eqeqeq: false */ for ( ; cur != this; cur = cur.parentNode || this ) { /* jshint eqeqeq: true */ // Don't check non-elements (#13208) // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { matches = []; for ( i = 0; i < delegateCount; i++ ) { handleObj = handlers[ i ]; // Don't conflict with Object.prototype properties (#13203) sel = handleObj.selector + " "; if ( matches[ sel ] === undefined ) { matches[ sel ] = handleObj.needsContext ? jQuery( sel, this ).index( cur ) >= 0 : jQuery.find( sel, this, null, [ cur ] ).length; } if ( matches[ sel ] ) { matches.push( handleObj ); } } if ( matches.length ) { handlerQueue.push({ elem: cur, handlers: matches }); } } } } // Add the remaining (directly-bound) handlers if ( delegateCount < handlers.length ) { handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); } return handlerQueue; }, fix: function( event ) { if ( event[ jQuery.expando ] ) { return event; } // Create a writable copy of the event object and normalize some properties var i, prop, copy, type = event.type, originalEvent = event, fixHook = this.fixHooks[ type ]; if ( !fixHook ) { this.fixHooks[ type ] = fixHook = rmouseEvent.test( type ) ? this.mouseHooks : rkeyEvent.test( type ) ? this.keyHooks : {}; } copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; event = new jQuery.Event( originalEvent ); i = copy.length; while ( i-- ) { prop = copy[ i ]; event[ prop ] = originalEvent[ prop ]; } // Support: IE<9 // Fix target property (#1925) if ( !event.target ) { event.target = originalEvent.srcElement || document; } // Support: Chrome 23+, Safari? // Target should not be a text node (#504, #13143) if ( event.target.nodeType === 3 ) { event.target = event.target.parentNode; } // Support: IE<9 // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) event.metaKey = !!event.metaKey; return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; }, // Includes some event props shared by KeyEvent and MouseEvent props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function( event, original ) { // Add which for key events if ( event.which == null ) { event.which = original.charCode != null ? original.charCode : original.keyCode; } return event; } }, mouseHooks: { props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function( event, original ) { var body, eventDoc, doc, button = original.button, fromElement = original.fromElement; // Calculate pageX/Y if missing and clientX/Y available if ( event.pageX == null && original.clientX != null ) { eventDoc = event.target.ownerDocument || document; doc = eventDoc.documentElement; body = eventDoc.body; event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); } // Add relatedTarget, if necessary if ( !event.relatedTarget && fromElement ) { event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; } // Add which for click: 1 === left; 2 === middle; 3 === right // Note: button is not normalized, so don't use it if ( !event.which && button !== undefined ) { event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); } return event; } }, special: { load: { // Prevent triggered image.load events from bubbling to window.load noBubble: true }, focus: { // Fire native event if possible so blur/focus sequence is correct trigger: function() { if ( this !== safeActiveElement() && this.focus ) { try { this.focus(); return false; } catch ( e ) { // Support: IE<9 // If we error on focus to hidden element (#1486, #12518), // let .trigger() run the handlers } } }, delegateType: "focusin" }, blur: { trigger: function() { if ( this === safeActiveElement() && this.blur ) { this.blur(); return false; } }, delegateType: "focusout" }, click: { // For checkbox, fire native event so checked state will be right trigger: function() { if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { this.click(); return false; } }, // For cross-browser consistency, don't fire native .click() on links _default: function( event ) { return jQuery.nodeName( event.target, "a" ); } }, beforeunload: { postDispatch: function( event ) { // Support: Firefox 20+ // Firefox doesn't alert if the returnValue field is not set. if ( event.result !== undefined && event.originalEvent ) { event.originalEvent.returnValue = event.result; } } } }, simulate: function( type, elem, event, bubble ) { // Piggyback on a donor event to simulate a different one. // Fake originalEvent to avoid donor's stopPropagation, but if the // simulated event prevents default then we do the same on the donor. var e = jQuery.extend( new jQuery.Event(), event, { type: type, isSimulated: true, originalEvent: {} } ); if ( bubble ) { jQuery.event.trigger( e, null, elem ); } else { jQuery.event.dispatch.call( elem, e ); } if ( e.isDefaultPrevented() ) { event.preventDefault(); } } }; jQuery.removeEvent = document.removeEventListener ? function( elem, type, handle ) { if ( elem.removeEventListener ) { elem.removeEventListener( type, handle, false ); } } : function( elem, type, handle ) { var name = "on" + type; if ( elem.detachEvent ) { // #8545, #7054, preventing memory leaks for custom events in IE6-8 // detachEvent needed property on element, by name of that event, to properly expose it to GC if ( typeof elem[ name ] === strundefined ) { elem[ name ] = null; } elem.detachEvent( name, handle ); } }; jQuery.Event = function( src, props ) { // Allow instantiation without the 'new' keyword if ( !(this instanceof jQuery.Event) ) { return new jQuery.Event( src, props ); } // Event object if ( src && src.type ) { this.originalEvent = src; this.type = src.type; // Events bubbling up the document may have been marked as prevented // by a handler lower down the tree; reflect the correct value. this.isDefaultPrevented = src.defaultPrevented || src.defaultPrevented === undefined && // Support: IE < 9, Android < 4.0 src.returnValue === false ? returnTrue : returnFalse; // Event type } else { this.type = src; } // Put explicitly provided properties onto the event object if ( props ) { jQuery.extend( this, props ); } // Create a timestamp if incoming event doesn't have one this.timeStamp = src && src.timeStamp || jQuery.now(); // Mark it as fixed this[ jQuery.expando ] = true; }; // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html jQuery.Event.prototype = { isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse, preventDefault: function() { var e = this.originalEvent; this.isDefaultPrevented = returnTrue; if ( !e ) { return; } // If preventDefault exists, run it on the original event if ( e.preventDefault ) { e.preventDefault(); // Support: IE // Otherwise set the returnValue property of the original event to false } else { e.returnValue = false; } }, stopPropagation: function() { var e = this.originalEvent; this.isPropagationStopped = returnTrue; if ( !e ) { return; } // If stopPropagation exists, run it on the original event if ( e.stopPropagation ) { e.stopPropagation(); } // Support: IE // Set the cancelBubble property of the original event to true e.cancelBubble = true; }, stopImmediatePropagation: function() { var e = this.originalEvent; this.isImmediatePropagationStopped = returnTrue; if ( e && e.stopImmediatePropagation ) { e.stopImmediatePropagation(); } this.stopPropagation(); } }; // Create mouseenter/leave events using mouseover/out and event-time checks jQuery.each({ mouseenter: "mouseover", mouseleave: "mouseout", pointerenter: "pointerover", pointerleave: "pointerout" }, function( orig, fix ) { jQuery.event.special[ orig ] = { delegateType: fix, bindType: fix, handle: function( event ) { var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj; // For mousenter/leave call the handler if related is outside the target. // NB: No relatedTarget if the mouse left/entered the browser window if ( !related || (related !== target && !jQuery.contains( target, related )) ) { event.type = handleObj.origType; ret = handleObj.handler.apply( this, arguments ); event.type = fix; } return ret; } }; }); // IE submit delegation if ( !support.submitBubbles ) { jQuery.event.special.submit = { setup: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Lazy-add a submit handler when a descendant form may potentially be submitted jQuery.event.add( this, "click._submit keypress._submit", function( e ) { // Node name check avoids a VML-related crash in IE (#9807) var elem = e.target, form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; if ( form && !jQuery._data( form, "submitBubbles" ) ) { jQuery.event.add( form, "submit._submit", function( event ) { event._submit_bubble = true; }); jQuery._data( form, "submitBubbles", true ); } }); // return undefined since we don't need an event listener }, postDispatch: function( event ) { // If form was submitted by the user, bubble the event up the tree if ( event._submit_bubble ) { delete event._submit_bubble; if ( this.parentNode && !event.isTrigger ) { jQuery.event.simulate( "submit", this.parentNode, event, true ); } } }, teardown: function() { // Only need this for delegated form submit events if ( jQuery.nodeName( this, "form" ) ) { return false; } // Remove delegated handlers; cleanData eventually reaps submit handlers attached above jQuery.event.remove( this, "._submit" ); } }; } // IE change delegation and checkbox/radio fix if ( !support.changeBubbles ) { jQuery.event.special.change = { setup: function() { if ( rformElems.test( this.nodeName ) ) { // IE doesn't fire change on a check/radio until blur; trigger it on click // after a propertychange. Eat the blur-change in special.change.handle. // This still fires onchange a second time for check/radio after blur. if ( this.type === "checkbox" || this.type === "radio" ) { jQuery.event.add( this, "propertychange._change", function( event ) { if ( event.originalEvent.propertyName === "checked" ) { this._just_changed = true; } }); jQuery.event.add( this, "click._change", function( event ) { if ( this._just_changed && !event.isTrigger ) { this._just_changed = false; } // Allow triggered, simulated change events (#11500) jQuery.event.simulate( "change", this, event, true ); }); } return false; } // Delegated event; lazy-add a change handler on descendant inputs jQuery.event.add( this, "beforeactivate._change", function( e ) { var elem = e.target; if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { jQuery.event.add( elem, "change._change", function( event ) { if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { jQuery.event.simulate( "change", this.parentNode, event, true ); } }); jQuery._data( elem, "changeBubbles", true ); } }); }, handle: function( event ) { var elem = event.target; // Swallow native change events from checkbox/radio, we already triggered them above if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { return event.handleObj.handler.apply( this, arguments ); } }, teardown: function() { jQuery.event.remove( this, "._change" ); return !rformElems.test( this.nodeName ); } }; } // Create "bubbling" focus and blur events if ( !support.focusinBubbles ) { jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { // Attach a single capturing handler on the document while someone wants focusin/focusout var handler = function( event ) { jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); }; jQuery.event.special[ fix ] = { setup: function() { var doc = this.ownerDocument || this, attaches = jQuery._data( doc, fix ); if ( !attaches ) { doc.addEventListener( orig, handler, true ); } jQuery._data( doc, fix, ( attaches || 0 ) + 1 ); }, teardown: function() { var doc = this.ownerDocument || this, attaches = jQuery._data( doc, fix ) - 1; if ( !attaches ) { doc.removeEventListener( orig, handler, true ); jQuery._removeData( doc, fix ); } else { jQuery._data( doc, fix, attaches ); } } }; }); } jQuery.fn.extend({ on: function( types, selector, data, fn, /*INTERNAL*/ one ) { var type, origFn; // Types can be a map of types/handlers if ( typeof types === "object" ) { // ( types-Object, selector, data ) if ( typeof selector !== "string" ) { // ( types-Object, data ) data = data || selector; selector = undefined; } for ( type in types ) { this.on( type, selector, data, types[ type ], one ); } return this; } if ( data == null && fn == null ) { // ( types, fn ) fn = selector; data = selector = undefined; } else if ( fn == null ) { if ( typeof selector === "string" ) { // ( types, selector, fn ) fn = data; data = undefined; } else { // ( types, data, fn ) fn = data; data = selector; selector = undefined; } } if ( fn === false ) { fn = returnFalse; } else if ( !fn ) { return this; } if ( one === 1 ) { origFn = fn; fn = function( event ) { // Can use an empty set, since event contains the info jQuery().off( event ); return origFn.apply( this, arguments ); }; // Use same guid so caller can remove using origFn fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); } return this.each( function() { jQuery.event.add( this, types, fn, data, selector ); }); }, one: function( types, selector, data, fn ) { return this.on( types, selector, data, fn, 1 ); }, off: function( types, selector, fn ) { var handleObj, type; if ( types && types.preventDefault && types.handleObj ) { // ( event ) dispatched jQuery.Event handleObj = types.handleObj; jQuery( types.delegateTarget ).off( handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler ); return this; } if ( typeof types === "object" ) { // ( types-object [, selector] ) for ( type in types ) { this.off( type, selector, types[ type ] ); } return this; } if ( selector === false || typeof selector === "function" ) { // ( types [, fn] ) fn = selector; selector = undefined; } if ( fn === false ) { fn = returnFalse; } return this.each(function() { jQuery.event.remove( this, types, fn, selector ); }); }, trigger: function( type, data ) { return this.each(function() { jQuery.event.trigger( type, data, this ); }); }, triggerHandler: function( type, data ) { var elem = this[0]; if ( elem ) { return jQuery.event.trigger( type, data, elem, true ); } } }); function createSafeFragment( document ) { var list = nodeNames.split( "|" ), safeFrag = document.createDocumentFragment(); if ( safeFrag.createElement ) { while ( list.length ) { safeFrag.createElement( list.pop() ); } } return safeFrag; } var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), rleadingWhitespace = /^\s+/, rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, rtagName = /<([\w:]+)/, rtbody = /<tbody/i, rhtml = /<|&#?\w+;/, rnoInnerhtml = /<(?:script|style|link)/i, // checked="checked" or checked rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, rscriptType = /^$|\/(?:java|ecma)script/i, rscriptTypeMasked = /^true\/(.*)/, rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, // We have to close these tags to support XHTML (#13200) wrapMap = { option: [ 1, "<select multiple='multiple'>", "</select>" ], legend: [ 1, "<fieldset>", "</fieldset>" ], area: [ 1, "<map>", "</map>" ], param: [ 1, "<object>", "</object>" ], thead: [ 1, "<table>", "</table>" ], tr: [ 2, "<table><tbody>", "</tbody></table>" ], col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, // unless wrapped in a div with non-breaking characters in front of it. _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ] }, safeFragment = createSafeFragment( document ), fragmentDiv = safeFragment.appendChild( document.createElement("div") ); wrapMap.optgroup = wrapMap.option; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; function getAll( context, tag ) { var elems, elem, i = 0, found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName( tag || "*" ) : typeof context.querySelectorAll !== strundefined ? context.querySelectorAll( tag || "*" ) : undefined; if ( !found ) { for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { if ( !tag || jQuery.nodeName( elem, tag ) ) { found.push( elem ); } else { jQuery.merge( found, getAll( elem, tag ) ); } } } return tag === undefined || tag && jQuery.nodeName( context, tag ) ? jQuery.merge( [ context ], found ) : found; } // Used in buildFragment, fixes the defaultChecked property function fixDefaultChecked( elem ) { if ( rcheckableType.test( elem.type ) ) { elem.defaultChecked = elem.checked; } } // Support: IE<8 // Manipulating tables requires a tbody function manipulationTarget( elem, content ) { return jQuery.nodeName( elem, "table" ) && jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? elem.getElementsByTagName("tbody")[0] || elem.appendChild( elem.ownerDocument.createElement("tbody") ) : elem; } // Replace/restore the type attribute of script elements for safe DOM manipulation function disableScript( elem ) { elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type; return elem; } function restoreScript( elem ) { var match = rscriptTypeMasked.exec( elem.type ); if ( match ) { elem.type = match[1]; } else { elem.removeAttribute("type"); } return elem; } // Mark scripts as having already been evaluated function setGlobalEval( elems, refElements ) { var elem, i = 0; for ( ; (elem = elems[i]) != null; i++ ) { jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); } } function cloneCopyEvent( src, dest ) { if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { return; } var type, i, l, oldData = jQuery._data( src ), curData = jQuery._data( dest, oldData ), events = oldData.events; if ( events ) { delete curData.handle; curData.events = {}; for ( type in events ) { for ( i = 0, l = events[ type ].length; i < l; i++ ) { jQuery.event.add( dest, type, events[ type ][ i ] ); } } } // make the cloned public data object a copy from the original if ( curData.data ) { curData.data = jQuery.extend( {}, curData.data ); } } function fixCloneNodeIssues( src, dest ) { var nodeName, e, data; // We do not need to do anything for non-Elements if ( dest.nodeType !== 1 ) { return; } nodeName = dest.nodeName.toLowerCase(); // IE6-8 copies events bound via attachEvent when using cloneNode. if ( !support.noCloneEvent && dest[ jQuery.expando ] ) { data = jQuery._data( dest ); for ( e in data.events ) { jQuery.removeEvent( dest, e, data.handle ); } // Event data gets referenced instead of copied if the expando gets copied too dest.removeAttribute( jQuery.expando ); } // IE blanks contents when cloning scripts, and tries to evaluate newly-set text if ( nodeName === "script" && dest.text !== src.text ) { disableScript( dest ).text = src.text; restoreScript( dest ); // IE6-10 improperly clones children of object elements using classid. // IE10 throws NoModificationAllowedError if parent is null, #12132. } else if ( nodeName === "object" ) { if ( dest.parentNode ) { dest.outerHTML = src.outerHTML; } // This path appears unavoidable for IE9. When cloning an object // element in IE9, the outerHTML strategy above is not sufficient. // If the src has innerHTML and the destination does not, // copy the src.innerHTML into the dest.innerHTML. #10324 if ( support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { dest.innerHTML = src.innerHTML; } } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) { // IE6-8 fails to persist the checked state of a cloned checkbox // or radio button. Worse, IE6-7 fail to give the cloned element // a checked appearance if the defaultChecked value isn't also set dest.defaultChecked = dest.checked = src.checked; // IE6-7 get confused and end up setting the value of a cloned // checkbox/radio button to an empty string instead of "on" if ( dest.value !== src.value ) { dest.value = src.value; } // IE6-8 fails to return the selected option to the default selected // state when cloning options } else if ( nodeName === "option" ) { dest.defaultSelected = dest.selected = src.defaultSelected; // IE6-8 fails to set the defaultValue to the correct value when // cloning other types of input fields } else if ( nodeName === "input" || nodeName === "textarea" ) { dest.defaultValue = src.defaultValue; } } jQuery.extend({ clone: function( elem, dataAndEvents, deepDataAndEvents ) { var destElements, node, clone, i, srcElements, inPage = jQuery.contains( elem.ownerDocument, elem ); if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { clone = elem.cloneNode( true ); // IE<=8 does not properly clone detached, unknown element nodes } else { fragmentDiv.innerHTML = elem.outerHTML; fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); } if ( (!support.noCloneEvent || !support.noCloneChecked) && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 destElements = getAll( clone ); srcElements = getAll( elem ); // Fix all IE cloning issues for ( i = 0; (node = srcElements[i]) != null; ++i ) { // Ensure that the destination node is not null; Fixes #9587 if ( destElements[i] ) { fixCloneNodeIssues( node, destElements[i] ); } } } // Copy the events from the original to the clone if ( dataAndEvents ) { if ( deepDataAndEvents ) { srcElements = srcElements || getAll( elem ); destElements = destElements || getAll( clone ); for ( i = 0; (node = srcElements[i]) != null; i++ ) { cloneCopyEvent( node, destElements[i] ); } } else { cloneCopyEvent( elem, clone ); } } // Preserve script evaluation history destElements = getAll( clone, "script" ); if ( destElements.length > 0 ) { setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); } destElements = srcElements = node = null; // Return the cloned set return clone; }, buildFragment: function( elems, context, scripts, selection ) { var j, elem, contains, tmp, tag, tbody, wrap, l = elems.length, // Ensure a safe fragment safe = createSafeFragment( context ), nodes = [], i = 0; for ( ; i < l; i++ ) { elem = elems[ i ]; if ( elem || elem === 0 ) { // Add nodes directly if ( jQuery.type( elem ) === "object" ) { jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); // Convert non-html into a text node } else if ( !rhtml.test( elem ) ) { nodes.push( context.createTextNode( elem ) ); // Convert html into DOM nodes } else { tmp = tmp || safe.appendChild( context.createElement("div") ); // Deserialize a standard representation tag = (rtagName.exec( elem ) || [ "", "" ])[ 1 ].toLowerCase(); wrap = wrapMap[ tag ] || wrapMap._default; tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2]; // Descend through wrappers to the right content j = wrap[0]; while ( j-- ) { tmp = tmp.lastChild; } // Manually add leading whitespace removed by IE if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); } // Remove IE's autoinserted <tbody> from table fragments if ( !support.tbody ) { // String was a <table>, *may* have spurious <tbody> elem = tag === "table" && !rtbody.test( elem ) ? tmp.firstChild : // String was a bare <thead> or <tfoot> wrap[1] === "<table>" && !rtbody.test( elem ) ? tmp : 0; j = elem && elem.childNodes.length; while ( j-- ) { if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { elem.removeChild( tbody ); } } } jQuery.merge( nodes, tmp.childNodes ); // Fix #12392 for WebKit and IE > 9 tmp.textContent = ""; // Fix #12392 for oldIE while ( tmp.firstChild ) { tmp.removeChild( tmp.firstChild ); } // Remember the top-level container for proper cleanup tmp = safe.lastChild; } } } // Fix #11356: Clear elements from fragment if ( tmp ) { safe.removeChild( tmp ); } // Reset defaultChecked for any radios and checkboxes // about to be appended to the DOM in IE 6/7 (#8060) if ( !support.appendChecked ) { jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); } i = 0; while ( (elem = nodes[ i++ ]) ) { // #4087 - If origin and destination elements are the same, and this is // that element, do not do anything if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { continue; } contains = jQuery.contains( elem.ownerDocument, elem ); // Append to fragment tmp = getAll( safe.appendChild( elem ), "script" ); // Preserve script evaluation history if ( contains ) { setGlobalEval( tmp ); } // Capture executables if ( scripts ) { j = 0; while ( (elem = tmp[ j++ ]) ) { if ( rscriptType.test( elem.type || "" ) ) { scripts.push( elem ); } } } } tmp = null; return safe; }, cleanData: function( elems, /* internal */ acceptData ) { var elem, type, id, data, i = 0, internalKey = jQuery.expando, cache = jQuery.cache, deleteExpando = support.deleteExpando, special = jQuery.event.special; for ( ; (elem = elems[i]) != null; i++ ) { if ( acceptData || jQuery.acceptData( elem ) ) { id = elem[ internalKey ]; data = id && cache[ id ]; if ( data ) { if ( data.events ) { for ( type in data.events ) { if ( special[ type ] ) { jQuery.event.remove( elem, type ); // This is a shortcut to avoid jQuery.event.remove's overhead } else { jQuery.removeEvent( elem, type, data.handle ); } } } // Remove cache only if it was not already removed by jQuery.event.remove if ( cache[ id ] ) { delete cache[ id ]; // IE does not allow us to delete expando properties from nodes, // nor does it have a removeAttribute function on Document nodes; // we must handle all of these cases if ( deleteExpando ) { delete elem[ internalKey ]; } else if ( typeof elem.removeAttribute !== strundefined ) { elem.removeAttribute( internalKey ); } else { elem[ internalKey ] = null; } deletedIds.push( id ); } } } } } }); jQuery.fn.extend({ text: function( value ) { return access( this, function( value ) { return value === undefined ? jQuery.text( this ) : this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); }, null, value, arguments.length ); }, append: function() { return this.domManip( arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.appendChild( elem ); } }); }, prepend: function() { return this.domManip( arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.insertBefore( elem, target.firstChild ); } }); }, before: function() { return this.domManip( arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this ); } }); }, after: function() { return this.domManip( arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this.nextSibling ); } }); }, remove: function( selector, keepData /* Internal Use Only */ ) { var elem, elems = selector ? jQuery.filter( selector, this ) : this, i = 0; for ( ; (elem = elems[i]) != null; i++ ) { if ( !keepData && elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem ) ); } if ( elem.parentNode ) { if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { setGlobalEval( getAll( elem, "script" ) ); } elem.parentNode.removeChild( elem ); } } return this; }, empty: function() { var elem, i = 0; for ( ; (elem = this[i]) != null; i++ ) { // Remove element nodes and prevent memory leaks if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); } // Remove any remaining nodes while ( elem.firstChild ) { elem.removeChild( elem.firstChild ); } // If this is a select, ensure that it displays empty (#12336) // Support: IE<9 if ( elem.options && jQuery.nodeName( elem, "select" ) ) { elem.options.length = 0; } } return this; }, clone: function( dataAndEvents, deepDataAndEvents ) { dataAndEvents = dataAndEvents == null ? false : dataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; return this.map(function() { return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); }); }, html: function( value ) { return access( this, function( value ) { var elem = this[ 0 ] || {}, i = 0, l = this.length; if ( value === undefined ) { return elem.nodeType === 1 ? elem.innerHTML.replace( rinlinejQuery, "" ) : undefined; } // See if we can take a shortcut and just use innerHTML if ( typeof value === "string" && !rnoInnerhtml.test( value ) && ( support.htmlSerialize || !rnoshimcache.test( value ) ) && ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) { value = value.replace( rxhtmlTag, "<$1></$2>" ); try { for (; i < l; i++ ) { // Remove element nodes and prevent memory leaks elem = this[i] || {}; if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); elem.innerHTML = value; } } elem = 0; // If using innerHTML throws an exception, use the fallback method } catch(e) {} } if ( elem ) { this.empty().append( value ); } }, null, value, arguments.length ); }, replaceWith: function() { var arg = arguments[ 0 ]; // Make the changes, replacing each context element with the new content this.domManip( arguments, function( elem ) { arg = this.parentNode; jQuery.cleanData( getAll( this ) ); if ( arg ) { arg.replaceChild( elem, this ); } }); // Force removal if there was no new content (e.g., from empty arguments) return arg && (arg.length || arg.nodeType) ? this : this.remove(); }, detach: function( selector ) { return this.remove( selector, true ); }, domManip: function( args, callback ) { // Flatten any nested arrays args = concat.apply( [], args ); var first, node, hasScripts, scripts, doc, fragment, i = 0, l = this.length, set = this, iNoClone = l - 1, value = args[0], isFunction = jQuery.isFunction( value ); // We can't cloneNode fragments that contain checked, in WebKit if ( isFunction || ( l > 1 && typeof value === "string" && !support.checkClone && rchecked.test( value ) ) ) { return this.each(function( index ) { var self = set.eq( index ); if ( isFunction ) { args[0] = value.call( this, index, self.html() ); } self.domManip( args, callback ); }); } if ( l ) { fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); first = fragment.firstChild; if ( fragment.childNodes.length === 1 ) { fragment = first; } if ( first ) { scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); hasScripts = scripts.length; // Use the original fragment for the last item instead of the first because it can end up // being emptied incorrectly in certain situations (#8070). for ( ; i < l; i++ ) { node = fragment; if ( i !== iNoClone ) { node = jQuery.clone( node, true, true ); // Keep references to cloned scripts for later restoration if ( hasScripts ) { jQuery.merge( scripts, getAll( node, "script" ) ); } } callback.call( this[i], node, i ); } if ( hasScripts ) { doc = scripts[ scripts.length - 1 ].ownerDocument; // Reenable scripts jQuery.map( scripts, restoreScript ); // Evaluate executable scripts on first document insertion for ( i = 0; i < hasScripts; i++ ) { node = scripts[ i ]; if ( rscriptType.test( node.type || "" ) && !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { if ( node.src ) { // Optional AJAX dependency, but won't run scripts if not present if ( jQuery._evalUrl ) { jQuery._evalUrl( node.src ); } } else { jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); } } } } // Fix #11809: Avoid leaking memory fragment = first = null; } } return this; } }); jQuery.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function( name, original ) { jQuery.fn[ name ] = function( selector ) { var elems, i = 0, ret = [], insert = jQuery( selector ), last = insert.length - 1; for ( ; i <= last; i++ ) { elems = i === last ? this : this.clone(true); jQuery( insert[i] )[ original ]( elems ); // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() push.apply( ret, elems.get() ); } return this.pushStack( ret ); }; }); var iframe, elemdisplay = {}; /** * Retrieve the actual display of a element * @param {String} name nodeName of the element * @param {Object} doc Document object */ // Called only from within defaultDisplay function actualDisplay( name, doc ) { var style, elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), // getDefaultComputedStyle might be reliably used only on attached element display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ? // Use of this method is a temporary fix (more like optmization) until something better comes along, // since it was removed from specification and supported only in FF style.display : jQuery.css( elem[ 0 ], "display" ); // We don't have any data stored on the element, // so use "detach" method as fast way to get rid of the element elem.detach(); return display; } /** * Try to determine the default display value of an element * @param {String} nodeName */ function defaultDisplay( nodeName ) { var doc = document, display = elemdisplay[ nodeName ]; if ( !display ) { display = actualDisplay( nodeName, doc ); // If the simple way fails, read from inside an iframe if ( display === "none" || !display ) { // Use the already-created iframe if possible iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement ); // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document; // Support: IE doc.write(); doc.close(); display = actualDisplay( nodeName, doc ); iframe.detach(); } // Store the correct default display elemdisplay[ nodeName ] = display; } return display; } var rmargin = (/^margin/); var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); var getStyles, curCSS, rposition = /^(top|right|bottom|left)$/; if ( window.getComputedStyle ) { getStyles = function( elem ) { return elem.ownerDocument.defaultView.getComputedStyle( elem, null ); }; curCSS = function( elem, name, computed ) { var width, minWidth, maxWidth, ret, style = elem.style; computed = computed || getStyles( elem ); // getPropertyValue is only needed for .css('filter') in IE9, see #12537 ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined; if ( computed ) { if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { ret = jQuery.style( elem, name ); } // A tribute to the "awesome hack by Dean Edwards" // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { // Remember the original values width = style.width; minWidth = style.minWidth; maxWidth = style.maxWidth; // Put in the new values to get a computed value out style.minWidth = style.maxWidth = style.width = ret; ret = computed.width; // Revert the changed values style.width = width; style.minWidth = minWidth; style.maxWidth = maxWidth; } } // Support: IE // IE returns zIndex value as an integer. return ret === undefined ? ret : ret + ""; }; } else if ( document.documentElement.currentStyle ) { getStyles = function( elem ) { return elem.currentStyle; }; curCSS = function( elem, name, computed ) { var left, rs, rsLeft, ret, style = elem.style; computed = computed || getStyles( elem ); ret = computed ? computed[ name ] : undefined; // Avoid setting ret to empty string here // so we don't default to auto if ( ret == null && style && style[ name ] ) { ret = style[ name ]; } // From the awesome hack by Dean Edwards // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 // If we're not dealing with a regular pixel number // but a number that has a weird ending, we need to convert it to pixels // but not position css attributes, as those are proportional to the parent element instead // and we can't measure the parent instead because it might trigger a "stacking dolls" problem if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { // Remember the original values left = style.left; rs = elem.runtimeStyle; rsLeft = rs && rs.left; // Put in the new values to get a computed value out if ( rsLeft ) { rs.left = elem.currentStyle.left; } style.left = name === "fontSize" ? "1em" : ret; ret = style.pixelLeft + "px"; // Revert the changed values style.left = left; if ( rsLeft ) { rs.left = rsLeft; } } // Support: IE // IE returns zIndex value as an integer. return ret === undefined ? ret : ret + "" || "auto"; }; } function addGetHookIf( conditionFn, hookFn ) { // Define the hook, we'll check on the first run if it's really needed. return { get: function() { var condition = conditionFn(); if ( condition == null ) { // The test was not ready at this point; screw the hook this time // but check again when needed next time. return; } if ( condition ) { // Hook not needed (or it's not possible to use it due to missing dependency), // remove it. // Since there are no other hooks for marginRight, remove the whole object. delete this.get; return; } // Hook needed; redefine it so that the support test is not executed again. return (this.get = hookFn).apply( this, arguments ); } }; } (function() { // Minified: var b,c,d,e,f,g, h,i var div, style, a, pixelPositionVal, boxSizingReliableVal, reliableHiddenOffsetsVal, reliableMarginRightVal; // Setup div = document.createElement( "div" ); div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; a = div.getElementsByTagName( "a" )[ 0 ]; style = a && a.style; // Finish early in limited (non-browser) environments if ( !style ) { return; } style.cssText = "float:left;opacity:.5"; // Support: IE<9 // Make sure that element opacity exists (as opposed to filter) support.opacity = style.opacity === "0.5"; // Verify style float existence // (IE uses styleFloat instead of cssFloat) support.cssFloat = !!style.cssFloat; div.style.backgroundClip = "content-box"; div.cloneNode( true ).style.backgroundClip = ""; support.clearCloneStyle = div.style.backgroundClip === "content-box"; // Support: Firefox<29, Android 2.3 // Vendor-prefix box-sizing support.boxSizing = style.boxSizing === "" || style.MozBoxSizing === "" || style.WebkitBoxSizing === ""; jQuery.extend(support, { reliableHiddenOffsets: function() { if ( reliableHiddenOffsetsVal == null ) { computeStyleTests(); } return reliableHiddenOffsetsVal; }, boxSizingReliable: function() { if ( boxSizingReliableVal == null ) { computeStyleTests(); } return boxSizingReliableVal; }, pixelPosition: function() { if ( pixelPositionVal == null ) { computeStyleTests(); } return pixelPositionVal; }, // Support: Android 2.3 reliableMarginRight: function() { if ( reliableMarginRightVal == null ) { computeStyleTests(); } return reliableMarginRightVal; } }); function computeStyleTests() { // Minified: var b,c,d,j var div, body, container, contents; body = document.getElementsByTagName( "body" )[ 0 ]; if ( !body || !body.style ) { // Test fired too early or in an unsupported environment, exit. return; } // Setup div = document.createElement( "div" ); container = document.createElement( "div" ); container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; body.appendChild( container ).appendChild( div ); div.style.cssText = // Support: Firefox<29, Android 2.3 // Vendor-prefix box-sizing "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" + "box-sizing:border-box;display:block;margin-top:1%;top:1%;" + "border:1px;padding:1px;width:4px;position:absolute"; // Support: IE<9 // Assume reasonable values in the absence of getComputedStyle pixelPositionVal = boxSizingReliableVal = false; reliableMarginRightVal = true; // Check for getComputedStyle so that this code is not run in IE<9. if ( window.getComputedStyle ) { pixelPositionVal = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; boxSizingReliableVal = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; // Support: Android 2.3 // Div with explicit width and no margin-right incorrectly // gets computed margin-right based on width of container (#3333) // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right contents = div.appendChild( document.createElement( "div" ) ); // Reset CSS: box-sizing; display; margin; border; padding contents.style.cssText = div.style.cssText = // Support: Firefox<29, Android 2.3 // Vendor-prefix box-sizing "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + "box-sizing:content-box;display:block;margin:0;border:0;padding:0"; contents.style.marginRight = contents.style.width = "0"; div.style.width = "1px"; reliableMarginRightVal = !parseFloat( ( window.getComputedStyle( contents, null ) || {} ).marginRight ); } // Support: IE8 // Check if table cells still have offsetWidth/Height when they are set // to display:none and there are still other visible table cells in a // table row; if so, offsetWidth/Height are not reliable for use when // determining if an element has been hidden directly using // display:none (it is still safe to use offsets if a parent element is // hidden; don safety goggles and see bug #4512 for more information). div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>"; contents = div.getElementsByTagName( "td" ); contents[ 0 ].style.cssText = "margin:0;border:0;padding:0;display:none"; reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0; if ( reliableHiddenOffsetsVal ) { contents[ 0 ].style.display = ""; contents[ 1 ].style.display = "none"; reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0; } body.removeChild( container ); } })(); // A method for quickly swapping in/out CSS properties to get correct calculations. jQuery.swap = function( elem, options, callback, args ) { var ret, name, old = {}; // Remember the old values, and insert the new ones for ( name in options ) { old[ name ] = elem.style[ name ]; elem.style[ name ] = options[ name ]; } ret = callback.apply( elem, args || [] ); // Revert the old values for ( name in options ) { elem.style[ name ] = old[ name ]; } return ret; }; var ralpha = /alpha\([^)]*\)/i, ropacity = /opacity\s*=\s*([^)]*)/, // swappable if display is none or starts with table except "table", "table-cell", or "table-caption" // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display rdisplayswap = /^(none|table(?!-c[ea]).+)/, rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ), rrelNum = new RegExp( "^([+-])=(" + pnum + ")", "i" ), cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssNormalTransform = { letterSpacing: "0", fontWeight: "400" }, cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; // return a css property mapped to a potentially vendor prefixed property function vendorPropName( style, name ) { // shortcut for names that are not vendor prefixed if ( name in style ) { return name; } // check for vendor prefixed names var capName = name.charAt(0).toUpperCase() + name.slice(1), origName = name, i = cssPrefixes.length; while ( i-- ) { name = cssPrefixes[ i ] + capName; if ( name in style ) { return name; } } return origName; } function showHide( elements, show ) { var display, elem, hidden, values = [], index = 0, length = elements.length; for ( ; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } values[ index ] = jQuery._data( elem, "olddisplay" ); display = elem.style.display; if ( show ) { // Reset the inline display of this element to learn if it is // being hidden by cascaded rules or not if ( !values[ index ] && display === "none" ) { elem.style.display = ""; } // Set elements which have been overridden with display: none // in a stylesheet to whatever the default browser style is // for such an element if ( elem.style.display === "" && isHidden( elem ) ) { values[ index ] = jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) ); } } else { hidden = isHidden( elem ); if ( display && display !== "none" || !hidden ) { jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); } } } // Set the display of most of the elements in a second loop // to avoid the constant reflow for ( index = 0; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } if ( !show || elem.style.display === "none" || elem.style.display === "" ) { elem.style.display = show ? values[ index ] || "" : "none"; } } return elements; } function setPositiveNumber( elem, value, subtract ) { var matches = rnumsplit.exec( value ); return matches ? // Guard against undefined "subtract", e.g., when used as in cssHooks Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : value; } function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { var i = extra === ( isBorderBox ? "border" : "content" ) ? // If we already have the right measurement, avoid augmentation 4 : // Otherwise initialize for horizontal or vertical properties name === "width" ? 1 : 0, val = 0; for ( ; i < 4; i += 2 ) { // both box models exclude margin, so add it if we want it if ( extra === "margin" ) { val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); } if ( isBorderBox ) { // border-box includes padding, so remove it if we want content if ( extra === "content" ) { val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); } // at this point, extra isn't border nor margin, so remove border if ( extra !== "margin" ) { val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } else { // at this point, extra isn't content, so add padding val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); // at this point, extra isn't content nor padding, so add border if ( extra !== "padding" ) { val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } } return val; } function getWidthOrHeight( elem, name, extra ) { // Start with offset property, which is equivalent to the border-box value var valueIsBorderBox = true, val = name === "width" ? elem.offsetWidth : elem.offsetHeight, styles = getStyles( elem ), isBorderBox = support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; // some non-html elements return undefined for offsetWidth, so check for null/undefined // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 if ( val <= 0 || val == null ) { // Fall back to computed then uncomputed css if necessary val = curCSS( elem, name, styles ); if ( val < 0 || val == null ) { val = elem.style[ name ]; } // Computed unit is not pixels. Stop here and return. if ( rnumnonpx.test(val) ) { return val; } // we need the check for style in case a browser which returns unreliable values // for getComputedStyle silently falls back to the reliable elem.style valueIsBorderBox = isBorderBox && ( support.boxSizingReliable() || val === elem.style[ name ] ); // Normalize "", auto, and prepare for extra val = parseFloat( val ) || 0; } // use the active box-sizing model to add/subtract irrelevant styles return ( val + augmentWidthOrHeight( elem, name, extra || ( isBorderBox ? "border" : "content" ), valueIsBorderBox, styles ) ) + "px"; } jQuery.extend({ // Add in style property hooks for overriding the default // behavior of getting and setting a style property cssHooks: { opacity: { get: function( elem, computed ) { if ( computed ) { // We should always get a number back from opacity var ret = curCSS( elem, "opacity" ); return ret === "" ? "1" : ret; } } } }, // Don't automatically add "px" to these possibly-unitless properties cssNumber: { "columnCount": true, "fillOpacity": true, "flexGrow": true, "flexShrink": true, "fontWeight": true, "lineHeight": true, "opacity": true, "order": true, "orphans": true, "widows": true, "zIndex": true, "zoom": true }, // Add in properties whose names you wish to fix before // setting or getting the value cssProps: { // normalize float css property "float": support.cssFloat ? "cssFloat" : "styleFloat" }, // Get and set the style property on a DOM Node style: function( elem, name, value, extra ) { // Don't set styles on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { return; } // Make sure that we're working with the right name var ret, type, hooks, origName = jQuery.camelCase( name ), style = elem.style; name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // Check if we're setting a value if ( value !== undefined ) { type = typeof value; // convert relative number strings (+= or -=) to relative numbers. #7345 if ( type === "string" && (ret = rrelNum.exec( value )) ) { value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); // Fixes bug #9237 type = "number"; } // Make sure that null and NaN values aren't set. See: #7116 if ( value == null || value !== value ) { return; } // If a number was passed in, add 'px' to the (except for certain CSS properties) if ( type === "number" && !jQuery.cssNumber[ origName ] ) { value += "px"; } // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, // but it would mean to define eight (for every problematic property) identical functions if ( !support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) { style[ name ] = "inherit"; } // If a hook was provided, use that value, otherwise just set the specified value if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { // Support: IE // Swallow errors from 'invalid' CSS values (#5509) try { style[ name ] = value; } catch(e) {} } } else { // If a hook was provided get the non-computed value from there if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { return ret; } // Otherwise just get the value from the style object return style[ name ]; } }, css: function( elem, name, extra, styles ) { var num, val, hooks, origName = jQuery.camelCase( name ); // Make sure that we're working with the right name name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); // gets hook for the prefixed version // followed by the unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // If a hook was provided get the computed value from there if ( hooks && "get" in hooks ) { val = hooks.get( elem, true, extra ); } // Otherwise, if a way to get the computed value exists, use that if ( val === undefined ) { val = curCSS( elem, name, styles ); } //convert "normal" to computed value if ( val === "normal" && name in cssNormalTransform ) { val = cssNormalTransform[ name ]; } // Return, converting to number if forced or a qualifier was provided and val looks numeric if ( extra === "" || extra ) { num = parseFloat( val ); return extra === true || jQuery.isNumeric( num ) ? num || 0 : val; } return val; } }); jQuery.each([ "height", "width" ], function( i, name ) { jQuery.cssHooks[ name ] = { get: function( elem, computed, extra ) { if ( computed ) { // certain elements can have dimension info if we invisibly show them // however, it must have a current display style that would benefit from this return rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ? jQuery.swap( elem, cssShow, function() { return getWidthOrHeight( elem, name, extra ); }) : getWidthOrHeight( elem, name, extra ); } }, set: function( elem, value, extra ) { var styles = extra && getStyles( elem ); return setPositiveNumber( elem, value, extra ? augmentWidthOrHeight( elem, name, extra, support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box", styles ) : 0 ); } }; }); if ( !support.opacity ) { jQuery.cssHooks.opacity = { get: function( elem, computed ) { // IE uses filters for opacity return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ? ( 0.01 * parseFloat( RegExp.$1 ) ) + "" : computed ? "1" : ""; }, set: function( elem, value ) { var style = elem.style, currentStyle = elem.currentStyle, opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "", filter = currentStyle && currentStyle.filter || style.filter || ""; // IE has trouble with opacity if it does not have layout // Force it by setting the zoom level style.zoom = 1; // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652 // if value === "", then remove inline opacity #12685 if ( ( value >= 1 || value === "" ) && jQuery.trim( filter.replace( ralpha, "" ) ) === "" && style.removeAttribute ) { // Setting style.filter to null, "" & " " still leave "filter:" in the cssText // if "filter:" is present at all, clearType is disabled, we want to avoid this // style.removeAttribute is IE Only, but so apparently is this code path... style.removeAttribute( "filter" ); // if there is no filter style applied in a css rule or unset inline opacity, we are done if ( value === "" || currentStyle && !currentStyle.filter ) { return; } } // otherwise, set new filter values style.filter = ralpha.test( filter ) ? filter.replace( ralpha, opacity ) : filter + " " + opacity; } }; } jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight, function( elem, computed ) { if ( computed ) { // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right // Work around by temporarily setting element display to inline-block return jQuery.swap( elem, { "display": "inline-block" }, curCSS, [ elem, "marginRight" ] ); } } ); // These hooks are used by animate to expand properties jQuery.each({ margin: "", padding: "", border: "Width" }, function( prefix, suffix ) { jQuery.cssHooks[ prefix + suffix ] = { expand: function( value ) { var i = 0, expanded = {}, // assumes a single number if not a string parts = typeof value === "string" ? value.split(" ") : [ value ]; for ( ; i < 4; i++ ) { expanded[ prefix + cssExpand[ i ] + suffix ] = parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; } return expanded; } }; if ( !rmargin.test( prefix ) ) { jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; } }); jQuery.fn.extend({ css: function( name, value ) { return access( this, function( elem, name, value ) { var styles, len, map = {}, i = 0; if ( jQuery.isArray( name ) ) { styles = getStyles( elem ); len = name.length; for ( ; i < len; i++ ) { map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); } return map; } return value !== undefined ? jQuery.style( elem, name, value ) : jQuery.css( elem, name ); }, name, value, arguments.length > 1 ); }, show: function() { return showHide( this, true ); }, hide: function() { return showHide( this ); }, toggle: function( state ) { if ( typeof state === "boolean" ) { return state ? this.show() : this.hide(); } return this.each(function() { if ( isHidden( this ) ) { jQuery( this ).show(); } else { jQuery( this ).hide(); } }); } }); // Based off of the plugin by Clint Helfers, with permission. // http://blindsignals.com/index.php/2009/07/jquery-delay/ jQuery.fn.delay = function( time, type ) { time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; type = type || "fx"; return this.queue( type, function( next, hooks ) { var timeout = setTimeout( next, time ); hooks.stop = function() { clearTimeout( timeout ); }; }); }; (function() { // Minified: var a,b,c,d,e var input, div, select, a, opt; // Setup div = document.createElement( "div" ); div.setAttribute( "className", "t" ); div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; a = div.getElementsByTagName("a")[ 0 ]; // First batch of tests. select = document.createElement("select"); opt = select.appendChild( document.createElement("option") ); input = div.getElementsByTagName("input")[ 0 ]; a.style.cssText = "top:1px"; // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) support.getSetAttribute = div.className !== "t"; // Get the style information from getAttribute // (IE uses .cssText instead) support.style = /top/.test( a.getAttribute("style") ); // Make sure that URLs aren't manipulated // (IE normalizes it by default) support.hrefNormalized = a.getAttribute("href") === "/a"; // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) support.checkOn = !!input.value; // Make sure that a selected-by-default option has a working selected property. // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) support.optSelected = opt.selected; // Tests for enctype support on a form (#6743) support.enctype = !!document.createElement("form").enctype; // Make sure that the options inside disabled selects aren't marked as disabled // (WebKit marks them as disabled) select.disabled = true; support.optDisabled = !opt.disabled; // Support: IE8 only // Check if we can trust getAttribute("value") input = document.createElement( "input" ); input.setAttribute( "value", "" ); support.input = input.getAttribute( "value" ) === ""; // Check if an input maintains its value after becoming a radio input.value = "t"; input.setAttribute( "type", "radio" ); support.radioValue = input.value === "t"; })(); var rreturn = /\r/g; jQuery.fn.extend({ val: function( value ) { var hooks, ret, isFunction, elem = this[0]; if ( !arguments.length ) { if ( elem ) { hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { return ret; } ret = elem.value; return typeof ret === "string" ? // handle most common string cases ret.replace(rreturn, "") : // handle cases where value is null/undef or number ret == null ? "" : ret; } return; } isFunction = jQuery.isFunction( value ); return this.each(function( i ) { var val; if ( this.nodeType !== 1 ) { return; } if ( isFunction ) { val = value.call( this, i, jQuery( this ).val() ); } else { val = value; } // Treat null/undefined as ""; convert numbers to string if ( val == null ) { val = ""; } else if ( typeof val === "number" ) { val += ""; } else if ( jQuery.isArray( val ) ) { val = jQuery.map( val, function( value ) { return value == null ? "" : value + ""; }); } hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; // If set returns undefined, fall back to normal setting if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { this.value = val; } }); } }); jQuery.extend({ valHooks: { option: { get: function( elem ) { var val = jQuery.find.attr( elem, "value" ); return val != null ? val : // Support: IE10-11+ // option.text throws exceptions (#14686, #14858) jQuery.trim( jQuery.text( elem ) ); } }, select: { get: function( elem ) { var value, option, options = elem.options, index = elem.selectedIndex, one = elem.type === "select-one" || index < 0, values = one ? null : [], max = one ? index + 1 : options.length, i = index < 0 ? max : one ? index : 0; // Loop through all the selected options for ( ; i < max; i++ ) { option = options[ i ]; // oldIE doesn't update selected after form reset (#2551) if ( ( option.selected || i === index ) && // Don't return options that are disabled or in a disabled optgroup ( support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) && ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { // Get the specific value for the option value = jQuery( option ).val(); // We don't need an array for one selects if ( one ) { return value; } // Multi-Selects return an array values.push( value ); } } return values; }, set: function( elem, value ) { var optionSet, option, options = elem.options, values = jQuery.makeArray( value ), i = options.length; while ( i-- ) { option = options[ i ]; if ( jQuery.inArray( jQuery.valHooks.option.get( option ), values ) >= 0 ) { // Support: IE6 // When new option element is added to select box we need to // force reflow of newly added node in order to workaround delay // of initialization properties try { option.selected = optionSet = true; } catch ( _ ) { // Will be executed only in IE6 option.scrollHeight; } } else { option.selected = false; } } // Force browsers to behave consistently when non-matching value is set if ( !optionSet ) { elem.selectedIndex = -1; } return options; } } } }); // Radios and checkboxes getter/setter jQuery.each([ "radio", "checkbox" ], function() { jQuery.valHooks[ this ] = { set: function( elem, value ) { if ( jQuery.isArray( value ) ) { return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); } } }; if ( !support.checkOn ) { jQuery.valHooks[ this ].get = function( elem ) { // Support: Webkit // "" is returned instead of "on" if a value isn't specified return elem.getAttribute("value") === null ? "on" : elem.value; }; } }); var nodeHook, boolHook, attrHandle = jQuery.expr.attrHandle, ruseDefault = /^(?:checked|selected)$/i, getSetAttribute = support.getSetAttribute, getSetInput = support.input; jQuery.fn.extend({ attr: function( name, value ) { return access( this, jQuery.attr, name, value, arguments.length > 1 ); }, removeAttr: function( name ) { return this.each(function() { jQuery.removeAttr( this, name ); }); } }); jQuery.extend({ attr: function( elem, name, value ) { var hooks, ret, nType = elem.nodeType; // don't get/set attributes on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } // Fallback to prop when attributes are not supported if ( typeof elem.getAttribute === strundefined ) { return jQuery.prop( elem, name, value ); } // All attributes are lowercase // Grab necessary hook if one is defined if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { name = name.toLowerCase(); hooks = jQuery.attrHooks[ name ] || ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook ); } if ( value !== undefined ) { if ( value === null ) { jQuery.removeAttr( elem, name ); } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { return ret; } else { elem.setAttribute( name, value + "" ); return value; } } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { return ret; } else { ret = jQuery.find.attr( elem, name ); // Non-existent attributes return null, we normalize to undefined return ret == null ? undefined : ret; } }, removeAttr: function( elem, value ) { var name, propName, i = 0, attrNames = value && value.match( rnotwhite ); if ( attrNames && elem.nodeType === 1 ) { while ( (name = attrNames[i++]) ) { propName = jQuery.propFix[ name ] || name; // Boolean attributes get special treatment (#10870) if ( jQuery.expr.match.bool.test( name ) ) { // Set corresponding property to false if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { elem[ propName ] = false; // Support: IE<9 // Also clear defaultChecked/defaultSelected (if appropriate) } else { elem[ jQuery.camelCase( "default-" + name ) ] = elem[ propName ] = false; } // See #9699 for explanation of this approach (setting first, then removal) } else { jQuery.attr( elem, name, "" ); } elem.removeAttribute( getSetAttribute ? name : propName ); } } }, attrHooks: { type: { set: function( elem, value ) { if ( !support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { // Setting the type on a radio button after the value resets the value in IE6-9 // Reset value to default in case type is set after value during creation var val = elem.value; elem.setAttribute( "type", value ); if ( val ) { elem.value = val; } return value; } } } } }); // Hook for boolean attributes boolHook = { set: function( elem, value, name ) { if ( value === false ) { // Remove boolean attributes when set to false jQuery.removeAttr( elem, name ); } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { // IE<8 needs the *property* name elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name ); // Use defaultChecked and defaultSelected for oldIE } else { elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true; } return name; } }; // Retrieve booleans specially jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { var getter = attrHandle[ name ] || jQuery.find.attr; attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ? function( elem, name, isXML ) { var ret, handle; if ( !isXML ) { // Avoid an infinite loop by temporarily removing this function from the getter handle = attrHandle[ name ]; attrHandle[ name ] = ret; ret = getter( elem, name, isXML ) != null ? name.toLowerCase() : null; attrHandle[ name ] = handle; } return ret; } : function( elem, name, isXML ) { if ( !isXML ) { return elem[ jQuery.camelCase( "default-" + name ) ] ? name.toLowerCase() : null; } }; }); // fix oldIE attroperties if ( !getSetInput || !getSetAttribute ) { jQuery.attrHooks.value = { set: function( elem, value, name ) { if ( jQuery.nodeName( elem, "input" ) ) { // Does not return so that setAttribute is also used elem.defaultValue = value; } else { // Use nodeHook if defined (#1954); otherwise setAttribute is fine return nodeHook && nodeHook.set( elem, value, name ); } } }; } // IE6/7 do not support getting/setting some attributes with get/setAttribute if ( !getSetAttribute ) { // Use this for any attribute in IE6/7 // This fixes almost every IE6/7 issue nodeHook = { set: function( elem, value, name ) { // Set the existing or create a new attribute node var ret = elem.getAttributeNode( name ); if ( !ret ) { elem.setAttributeNode( (ret = elem.ownerDocument.createAttribute( name )) ); } ret.value = value += ""; // Break association with cloned elements by also using setAttribute (#9646) if ( name === "value" || value === elem.getAttribute( name ) ) { return value; } } }; // Some attributes are constructed with empty-string values when not defined attrHandle.id = attrHandle.name = attrHandle.coords = function( elem, name, isXML ) { var ret; if ( !isXML ) { return (ret = elem.getAttributeNode( name )) && ret.value !== "" ? ret.value : null; } }; // Fixing value retrieval on a button requires this module jQuery.valHooks.button = { get: function( elem, name ) { var ret = elem.getAttributeNode( name ); if ( ret && ret.specified ) { return ret.value; } }, set: nodeHook.set }; // Set contenteditable to false on removals(#10429) // Setting to empty string throws an error as an invalid value jQuery.attrHooks.contenteditable = { set: function( elem, value, name ) { nodeHook.set( elem, value === "" ? false : value, name ); } }; // Set width and height to auto instead of 0 on empty string( Bug #8150 ) // This is for removals jQuery.each([ "width", "height" ], function( i, name ) { jQuery.attrHooks[ name ] = { set: function( elem, value ) { if ( value === "" ) { elem.setAttribute( name, "auto" ); return value; } } }; }); } if ( !support.style ) { jQuery.attrHooks.style = { get: function( elem ) { // Return undefined in the case of empty string // Note: IE uppercases css property names, but if we were to .toLowerCase() // .cssText, that would destroy case senstitivity in URL's, like in "background" return elem.style.cssText || undefined; }, set: function( elem, value ) { return ( elem.style.cssText = value + "" ); } }; } var rfocusable = /^(?:input|select|textarea|button|object)$/i, rclickable = /^(?:a|area)$/i; jQuery.fn.extend({ prop: function( name, value ) { return access( this, jQuery.prop, name, value, arguments.length > 1 ); }, removeProp: function( name ) { name = jQuery.propFix[ name ] || name; return this.each(function() { // try/catch handles cases where IE balks (such as removing a property on window) try { this[ name ] = undefined; delete this[ name ]; } catch( e ) {} }); } }); jQuery.extend({ propFix: { "for": "htmlFor", "class": "className" }, prop: function( elem, name, value ) { var ret, hooks, notxml, nType = elem.nodeType; // don't get/set properties on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); if ( notxml ) { // Fix name and attach hooks name = jQuery.propFix[ name ] || name; hooks = jQuery.propHooks[ name ]; } if ( value !== undefined ) { return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ? ret : ( elem[ name ] = value ); } else { return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ? ret : elem[ name ]; } }, propHooks: { tabIndex: { get: function( elem ) { // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ // Use proper attribute retrieval(#12072) var tabindex = jQuery.find.attr( elem, "tabindex" ); return tabindex ? parseInt( tabindex, 10 ) : rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? 0 : -1; } } } }); // Some attributes require a special call on IE // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !support.hrefNormalized ) { // href/src property should get the full normalized URL (#10299/#12915) jQuery.each([ "href", "src" ], function( i, name ) { jQuery.propHooks[ name ] = { get: function( elem ) { return elem.getAttribute( name, 4 ); } }; }); } // Support: Safari, IE9+ // mis-reports the default selected property of an option // Accessing the parent's selectedIndex property fixes it if ( !support.optSelected ) { jQuery.propHooks.selected = { get: function( elem ) { var parent = elem.parentNode; if ( parent ) { parent.selectedIndex; // Make sure that it also works with optgroups, see #5701 if ( parent.parentNode ) { parent.parentNode.selectedIndex; } } return null; } }; } jQuery.each([ "tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable" ], function() { jQuery.propFix[ this.toLowerCase() ] = this; }); // IE6/7 call enctype encoding if ( !support.enctype ) { jQuery.propFix.enctype = "encoding"; } var rclass = /[\t\r\n\f]/g; jQuery.fn.extend({ addClass: function( value ) { var classes, elem, cur, clazz, j, finalValue, i = 0, len = this.length, proceed = typeof value === "string" && value; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).addClass( value.call( this, j, this.className ) ); }); } if ( proceed ) { // The disjunction here is for better compressibility (see removeClass) classes = ( value || "" ).match( rnotwhite ) || []; for ( ; i < len; i++ ) { elem = this[ i ]; cur = elem.nodeType === 1 && ( elem.className ? ( " " + elem.className + " " ).replace( rclass, " " ) : " " ); if ( cur ) { j = 0; while ( (clazz = classes[j++]) ) { if ( cur.indexOf( " " + clazz + " " ) < 0 ) { cur += clazz + " "; } } // only assign if different to avoid unneeded rendering. finalValue = jQuery.trim( cur ); if ( elem.className !== finalValue ) { elem.className = finalValue; } } } } return this; }, removeClass: function( value ) { var classes, elem, cur, clazz, j, finalValue, i = 0, len = this.length, proceed = arguments.length === 0 || typeof value === "string" && value; if ( jQuery.isFunction( value ) ) { return this.each(function( j ) { jQuery( this ).removeClass( value.call( this, j, this.className ) ); }); } if ( proceed ) { classes = ( value || "" ).match( rnotwhite ) || []; for ( ; i < len; i++ ) { elem = this[ i ]; // This expression is here for better compressibility (see addClass) cur = elem.nodeType === 1 && ( elem.className ? ( " " + elem.className + " " ).replace( rclass, " " ) : "" ); if ( cur ) { j = 0; while ( (clazz = classes[j++]) ) { // Remove *all* instances while ( cur.indexOf( " " + clazz + " " ) >= 0 ) { cur = cur.replace( " " + clazz + " ", " " ); } } // only assign if different to avoid unneeded rendering. finalValue = value ? jQuery.trim( cur ) : ""; if ( elem.className !== finalValue ) { elem.className = finalValue; } } } } return this; }, toggleClass: function( value, stateVal ) { var type = typeof value; if ( typeof stateVal === "boolean" && type === "string" ) { return stateVal ? this.addClass( value ) : this.removeClass( value ); } if ( jQuery.isFunction( value ) ) { return this.each(function( i ) { jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); }); } return this.each(function() { if ( type === "string" ) { // toggle individual class names var className, i = 0, self = jQuery( this ), classNames = value.match( rnotwhite ) || []; while ( (className = classNames[ i++ ]) ) { // check each className given, space separated list if ( self.hasClass( className ) ) { self.removeClass( className ); } else { self.addClass( className ); } } // Toggle whole class name } else if ( type === strundefined || type === "boolean" ) { if ( this.className ) { // store className if set jQuery._data( this, "__className__", this.className ); } // If the element has a class name or if we're passed "false", // then remove the whole classname (if there was one, the above saved it). // Otherwise bring back whatever was previously saved (if anything), // falling back to the empty string if nothing was stored. this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; } }); }, hasClass: function( selector ) { var className = " " + selector + " ", i = 0, l = this.length; for ( ; i < l; i++ ) { if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { return true; } } return false; } }); // Return jQuery for attributes-only inclusion jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { // Handle event binding jQuery.fn[ name ] = function( data, fn ) { return arguments.length > 0 ? this.on( name, null, data, fn ) : this.trigger( name ); }; }); jQuery.fn.extend({ hover: function( fnOver, fnOut ) { return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); }, bind: function( types, data, fn ) { return this.on( types, null, data, fn ); }, unbind: function( types, fn ) { return this.off( types, null, fn ); }, delegate: function( selector, types, data, fn ) { return this.on( types, selector, data, fn ); }, undelegate: function( selector, types, fn ) { // ( namespace ) or ( selector, types [, fn] ) return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); } }); var nonce = jQuery.now(); var rquery = (/\?/); var rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g; jQuery.parseJSON = function( data ) { // Attempt to parse using the native JSON parser first if ( window.JSON && window.JSON.parse ) { // Support: Android 2.3 // Workaround failure to string-cast null input return window.JSON.parse( data + "" ); } var requireNonComma, depth = null, str = jQuery.trim( data + "" ); // Guard against invalid (and possibly dangerous) input by ensuring that nothing remains // after removing valid tokens return str && !jQuery.trim( str.replace( rvalidtokens, function( token, comma, open, close ) { // Force termination if we see a misplaced comma if ( requireNonComma && comma ) { depth = 0; } // Perform no more replacements after returning to outermost depth if ( depth === 0 ) { return token; } // Commas must not follow "[", "{", or "," requireNonComma = open || comma; // Determine new depth // array/object open ("[" or "{"): depth += true - false (increment) // array/object close ("]" or "}"): depth += false - true (decrement) // other cases ("," or primitive): depth += true - true (numeric cast) depth += !close - !open; // Remove this token return ""; }) ) ? ( Function( "return " + str ) )() : jQuery.error( "Invalid JSON: " + data ); }; // Cross-browser xml parsing jQuery.parseXML = function( data ) { var xml, tmp; if ( !data || typeof data !== "string" ) { return null; } try { if ( window.DOMParser ) { // Standard tmp = new DOMParser(); xml = tmp.parseFromString( data, "text/xml" ); } else { // IE xml = new ActiveXObject( "Microsoft.XMLDOM" ); xml.async = "false"; xml.loadXML( data ); } } catch( e ) { xml = undefined; } if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { jQuery.error( "Invalid XML: " + data ); } return xml; }; var // Document location ajaxLocParts, ajaxLocation, rhash = /#.*$/, rts = /([?&])_=[^&]*/, rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL // #7653, #8125, #8152: local protocol detection rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/, /* Prefilters * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) * 2) These are called: * - BEFORE asking for a transport * - AFTER param serialization (s.data is a string if s.processData is true) * 3) key is the dataType * 4) the catchall symbol "*" can be used * 5) execution will start with transport dataType and THEN continue down to "*" if needed */ prefilters = {}, /* Transports bindings * 1) key is the dataType * 2) the catchall symbol "*" can be used * 3) selection will start with transport dataType and THEN go to "*" if needed */ transports = {}, // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression allTypes = "*/".concat("*"); // #8138, IE may throw an exception when accessing // a field from window.location if document.domain has been set try { ajaxLocation = location.href; } catch( e ) { // Use the href attribute of an A element // since IE will modify it given document.location ajaxLocation = document.createElement( "a" ); ajaxLocation.href = ""; ajaxLocation = ajaxLocation.href; } // Segment location into parts ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport function addToPrefiltersOrTransports( structure ) { // dataTypeExpression is optional and defaults to "*" return function( dataTypeExpression, func ) { if ( typeof dataTypeExpression !== "string" ) { func = dataTypeExpression; dataTypeExpression = "*"; } var dataType, i = 0, dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || []; if ( jQuery.isFunction( func ) ) { // For each dataType in the dataTypeExpression while ( (dataType = dataTypes[i++]) ) { // Prepend if requested if ( dataType.charAt( 0 ) === "+" ) { dataType = dataType.slice( 1 ) || "*"; (structure[ dataType ] = structure[ dataType ] || []).unshift( func ); // Otherwise append } else { (structure[ dataType ] = structure[ dataType ] || []).push( func ); } } } }; } // Base inspection function for prefilters and transports function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { var inspected = {}, seekingTransport = ( structure === transports ); function inspect( dataType ) { var selected; inspected[ dataType ] = true; jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) { options.dataTypes.unshift( dataTypeOrTransport ); inspect( dataTypeOrTransport ); return false; } else if ( seekingTransport ) { return !( selected = dataTypeOrTransport ); } }); return selected; } return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); } // A special extend for ajax options // that takes "flat" options (not to be deep extended) // Fixes #9887 function ajaxExtend( target, src ) { var deep, key, flatOptions = jQuery.ajaxSettings.flatOptions || {}; for ( key in src ) { if ( src[ key ] !== undefined ) { ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ]; } } if ( deep ) { jQuery.extend( true, target, deep ); } return target; } /* Handles responses to an ajax request: * - finds the right dataType (mediates between content-type and expected dataType) * - returns the corresponding response */ function ajaxHandleResponses( s, jqXHR, responses ) { var firstDataType, ct, finalDataType, type, contents = s.contents, dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process while ( dataTypes[ 0 ] === "*" ) { dataTypes.shift(); if ( ct === undefined ) { ct = s.mimeType || jqXHR.getResponseHeader("Content-Type"); } } // Check if we're dealing with a known content-type if ( ct ) { for ( type in contents ) { if ( contents[ type ] && contents[ type ].test( ct ) ) { dataTypes.unshift( type ); break; } } } // Check to see if we have a response for the expected dataType if ( dataTypes[ 0 ] in responses ) { finalDataType = dataTypes[ 0 ]; } else { // Try convertible dataTypes for ( type in responses ) { if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) { finalDataType = type; break; } if ( !firstDataType ) { firstDataType = type; } } // Or just use first one finalDataType = finalDataType || firstDataType; } // If we found a dataType // We add the dataType to the list if needed // and return the corresponding response if ( finalDataType ) { if ( finalDataType !== dataTypes[ 0 ] ) { dataTypes.unshift( finalDataType ); } return responses[ finalDataType ]; } } /* Chain conversions given the request and the original response * Also sets the responseXXX fields on the jqXHR instance */ function ajaxConvert( s, response, jqXHR, isSuccess ) { var conv2, current, conv, tmp, prev, converters = {}, // Work with a copy of dataTypes in case we need to modify it for conversion dataTypes = s.dataTypes.slice(); // Create converters map with lowercased keys if ( dataTypes[ 1 ] ) { for ( conv in s.converters ) { converters[ conv.toLowerCase() ] = s.converters[ conv ]; } } current = dataTypes.shift(); // Convert to each sequential dataType while ( current ) { if ( s.responseFields[ current ] ) { jqXHR[ s.responseFields[ current ] ] = response; } // Apply the dataFilter if provided if ( !prev && isSuccess && s.dataFilter ) { response = s.dataFilter( response, s.dataType ); } prev = current; current = dataTypes.shift(); if ( current ) { // There's only work to do if current dataType is non-auto if ( current === "*" ) { current = prev; // Convert response if prev dataType is non-auto and differs from current } else if ( prev !== "*" && prev !== current ) { // Seek a direct converter conv = converters[ prev + " " + current ] || converters[ "* " + current ]; // If none found, seek a pair if ( !conv ) { for ( conv2 in converters ) { // If conv2 outputs current tmp = conv2.split( " " ); if ( tmp[ 1 ] === current ) { // If prev can be converted to accepted input conv = converters[ prev + " " + tmp[ 0 ] ] || converters[ "* " + tmp[ 0 ] ]; if ( conv ) { // Condense equivalence converters if ( conv === true ) { conv = converters[ conv2 ]; // Otherwise, insert the intermediate dataType } else if ( converters[ conv2 ] !== true ) { current = tmp[ 0 ]; dataTypes.unshift( tmp[ 1 ] ); } break; } } } } // Apply converter (if not an equivalence) if ( conv !== true ) { // Unless errors are allowed to bubble, catch and return them if ( conv && s[ "throws" ] ) { response = conv( response ); } else { try { response = conv( response ); } catch ( e ) { return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; } } } } } } return { state: "success", data: response }; } jQuery.extend({ // Counter for holding the number of active queries active: 0, // Last-Modified header cache for next request lastModified: {}, etag: {}, ajaxSettings: { url: ajaxLocation, type: "GET", isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), global: true, processData: true, async: true, contentType: "application/x-www-form-urlencoded; charset=UTF-8", /* timeout: 0, data: null, dataType: null, username: null, password: null, cache: null, throws: false, traditional: false, headers: {}, */ accepts: { "*": allTypes, text: "text/plain", html: "text/html", xml: "application/xml, text/xml", json: "application/json, text/javascript" }, contents: { xml: /xml/, html: /html/, json: /json/ }, responseFields: { xml: "responseXML", text: "responseText", json: "responseJSON" }, // Data converters // Keys separate source (or catchall "*") and destination types with a single space converters: { // Convert anything to text "* text": String, // Text to html (true = no transformation) "text html": true, // Evaluate text as a json expression "text json": jQuery.parseJSON, // Parse text as xml "text xml": jQuery.parseXML }, // For options that shouldn't be deep extended: // you can add your own custom options here if // and when you create one that shouldn't be // deep extended (see ajaxExtend) flatOptions: { url: true, context: true } }, // Creates a full fledged settings object into target // with both ajaxSettings and settings fields. // If target is omitted, writes into ajaxSettings. ajaxSetup: function( target, settings ) { return settings ? // Building a settings object ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : // Extending ajaxSettings ajaxExtend( jQuery.ajaxSettings, target ); }, ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), ajaxTransport: addToPrefiltersOrTransports( transports ), // Main method ajax: function( url, options ) { // If url is an object, simulate pre-1.5 signature if ( typeof url === "object" ) { options = url; url = undefined; } // Force options to be an object options = options || {}; var // Cross-domain detection vars parts, // Loop variable i, // URL without anti-cache param cacheURL, // Response headers as string responseHeadersString, // timeout handle timeoutTimer, // To know if global events are to be dispatched fireGlobals, transport, // Response headers responseHeaders, // Create the final options object s = jQuery.ajaxSetup( {}, options ), // Callbacks context callbackContext = s.context || s, // Context for global events is callbackContext if it is a DOM node or jQuery collection globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ? jQuery( callbackContext ) : jQuery.event, // Deferreds deferred = jQuery.Deferred(), completeDeferred = jQuery.Callbacks("once memory"), // Status-dependent callbacks statusCode = s.statusCode || {}, // Headers (they are sent all at once) requestHeaders = {}, requestHeadersNames = {}, // The jqXHR state state = 0, // Default abort message strAbort = "canceled", // Fake xhr jqXHR = { readyState: 0, // Builds headers hashtable if needed getResponseHeader: function( key ) { var match; if ( state === 2 ) { if ( !responseHeaders ) { responseHeaders = {}; while ( (match = rheaders.exec( responseHeadersString )) ) { responseHeaders[ match[1].toLowerCase() ] = match[ 2 ]; } } match = responseHeaders[ key.toLowerCase() ]; } return match == null ? null : match; }, // Raw string getAllResponseHeaders: function() { return state === 2 ? responseHeadersString : null; }, // Caches the header setRequestHeader: function( name, value ) { var lname = name.toLowerCase(); if ( !state ) { name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; requestHeaders[ name ] = value; } return this; }, // Overrides response content-type header overrideMimeType: function( type ) { if ( !state ) { s.mimeType = type; } return this; }, // Status-dependent callbacks statusCode: function( map ) { var code; if ( map ) { if ( state < 2 ) { for ( code in map ) { // Lazy-add the new callback in a way that preserves old ones statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; } } else { // Execute the appropriate callbacks jqXHR.always( map[ jqXHR.status ] ); } } return this; }, // Cancel the request abort: function( statusText ) { var finalText = statusText || strAbort; if ( transport ) { transport.abort( finalText ); } done( 0, finalText ); return this; } }; // Attach deferreds deferred.promise( jqXHR ).complete = completeDeferred.add; jqXHR.success = jqXHR.done; jqXHR.error = jqXHR.fail; // Remove hash character (#7531: and string promotion) // Add protocol if not provided (#5866: IE7 issue with protocol-less urls) // Handle falsy url in the settings object (#10093: consistency with old signature) // We also use the url parameter if available s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); // Alias method option to type as per ticket #12004 s.type = options.method || options.type || s.method || s.type; // Extract dataTypes list s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ]; // A cross-domain request is in order when we have a protocol:host:port mismatch if ( s.crossDomain == null ) { parts = rurl.exec( s.url.toLowerCase() ); s.crossDomain = !!( parts && ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] || ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !== ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) ) ); } // Convert data if not already a string if ( s.data && s.processData && typeof s.data !== "string" ) { s.data = jQuery.param( s.data, s.traditional ); } // Apply prefilters inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); // If request was aborted inside a prefilter, stop there if ( state === 2 ) { return jqXHR; } // We can fire global events as of now if asked to fireGlobals = s.global; // Watch for a new set of requests if ( fireGlobals && jQuery.active++ === 0 ) { jQuery.event.trigger("ajaxStart"); } // Uppercase the type s.type = s.type.toUpperCase(); // Determine if request has content s.hasContent = !rnoContent.test( s.type ); // Save the URL in case we're toying with the If-Modified-Since // and/or If-None-Match header later on cacheURL = s.url; // More options handling for requests with no content if ( !s.hasContent ) { // If data is available, append data to url if ( s.data ) { cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data ); // #9682: remove data so that it's not used in an eventual retry delete s.data; } // Add anti-cache in url if needed if ( s.cache === false ) { s.url = rts.test( cacheURL ) ? // If there is already a '_' parameter, set its value cacheURL.replace( rts, "$1_=" + nonce++ ) : // Otherwise add one to the end cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++; } } // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { if ( jQuery.lastModified[ cacheURL ] ) { jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); } if ( jQuery.etag[ cacheURL ] ) { jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); } } // Set the correct header, if data is being sent if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { jqXHR.setRequestHeader( "Content-Type", s.contentType ); } // Set the Accepts header for the server, depending on the dataType jqXHR.setRequestHeader( "Accept", s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ? s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : s.accepts[ "*" ] ); // Check for headers option for ( i in s.headers ) { jqXHR.setRequestHeader( i, s.headers[ i ] ); } // Allow custom headers/mimetypes and early abort if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { // Abort if not done already and return return jqXHR.abort(); } // aborting is no longer a cancellation strAbort = "abort"; // Install callbacks on deferreds for ( i in { success: 1, error: 1, complete: 1 } ) { jqXHR[ i ]( s[ i ] ); } // Get transport transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); // If no transport, we auto-abort if ( !transport ) { done( -1, "No Transport" ); } else { jqXHR.readyState = 1; // Send global event if ( fireGlobals ) { globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); } // Timeout if ( s.async && s.timeout > 0 ) { timeoutTimer = setTimeout(function() { jqXHR.abort("timeout"); }, s.timeout ); } try { state = 1; transport.send( requestHeaders, done ); } catch ( e ) { // Propagate exception as error if not done if ( state < 2 ) { done( -1, e ); // Simply rethrow otherwise } else { throw e; } } } // Callback for when everything is done function done( status, nativeStatusText, responses, headers ) { var isSuccess, success, error, response, modified, statusText = nativeStatusText; // Called once if ( state === 2 ) { return; } // State is "done" now state = 2; // Clear timeout if it exists if ( timeoutTimer ) { clearTimeout( timeoutTimer ); } // Dereference transport for early garbage collection // (no matter how long the jqXHR object will be used) transport = undefined; // Cache response headers responseHeadersString = headers || ""; // Set readyState jqXHR.readyState = status > 0 ? 4 : 0; // Determine if successful isSuccess = status >= 200 && status < 300 || status === 304; // Get response data if ( responses ) { response = ajaxHandleResponses( s, jqXHR, responses ); } // Convert no matter what (that way responseXXX fields are always set) response = ajaxConvert( s, response, jqXHR, isSuccess ); // If successful, handle type chaining if ( isSuccess ) { // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { modified = jqXHR.getResponseHeader("Last-Modified"); if ( modified ) { jQuery.lastModified[ cacheURL ] = modified; } modified = jqXHR.getResponseHeader("etag"); if ( modified ) { jQuery.etag[ cacheURL ] = modified; } } // if no content if ( status === 204 || s.type === "HEAD" ) { statusText = "nocontent"; // if not modified } else if ( status === 304 ) { statusText = "notmodified"; // If we have data, let's convert it } else { statusText = response.state; success = response.data; error = response.error; isSuccess = !error; } } else { // We extract error from statusText // then normalize statusText and status for non-aborts error = statusText; if ( status || !statusText ) { statusText = "error"; if ( status < 0 ) { status = 0; } } } // Set data for the fake xhr object jqXHR.status = status; jqXHR.statusText = ( nativeStatusText || statusText ) + ""; // Success/Error if ( isSuccess ) { deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); } else { deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); } // Status-dependent callbacks jqXHR.statusCode( statusCode ); statusCode = undefined; if ( fireGlobals ) { globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", [ jqXHR, s, isSuccess ? success : error ] ); } // Complete completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); if ( fireGlobals ) { globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); // Handle the global AJAX counter if ( !( --jQuery.active ) ) { jQuery.event.trigger("ajaxStop"); } } } return jqXHR; }, getJSON: function( url, data, callback ) { return jQuery.get( url, data, callback, "json" ); }, getScript: function( url, callback ) { return jQuery.get( url, undefined, callback, "script" ); } }); jQuery.each( [ "get", "post" ], function( i, method ) { jQuery[ method ] = function( url, data, callback, type ) { // shift arguments if data argument was omitted if ( jQuery.isFunction( data ) ) { type = type || callback; callback = data; data = undefined; } return jQuery.ajax({ url: url, type: method, dataType: type, data: data, success: callback }); }; }); // Attach a bunch of functions for handling common AJAX events jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) { jQuery.fn[ type ] = function( fn ) { return this.on( type, fn ); }; }); jQuery._evalUrl = function( url ) { return jQuery.ajax({ url: url, type: "GET", dataType: "script", async: false, global: false, "throws": true }); }; jQuery.fn.extend({ wrapAll: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapAll( html.call(this, i) ); }); } if ( this[0] ) { // The elements to wrap the target around var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); if ( this[0].parentNode ) { wrap.insertBefore( this[0] ); } wrap.map(function() { var elem = this; while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { elem = elem.firstChild; } return elem; }).append( this ); } return this; }, wrapInner: function( html ) { if ( jQuery.isFunction( html ) ) { return this.each(function(i) { jQuery(this).wrapInner( html.call(this, i) ); }); } return this.each(function() { var self = jQuery( this ), contents = self.contents(); if ( contents.length ) { contents.wrapAll( html ); } else { self.append( html ); } }); }, wrap: function( html ) { var isFunction = jQuery.isFunction( html ); return this.each(function(i) { jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); }); }, unwrap: function() { return this.parent().each(function() { if ( !jQuery.nodeName( this, "body" ) ) { jQuery( this ).replaceWith( this.childNodes ); } }).end(); } }); jQuery.expr.filters.hidden = function( elem ) { // Support: Opera <= 12.12 // Opera reports offsetWidths and offsetHeights less than zero on some elements return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 || (!support.reliableHiddenOffsets() && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none"); }; jQuery.expr.filters.visible = function( elem ) { return !jQuery.expr.filters.hidden( elem ); }; var r20 = /%20/g, rbracket = /\[\]$/, rCRLF = /\r?\n/g, rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, rsubmittable = /^(?:input|select|textarea|keygen)/i; function buildParams( prefix, obj, traditional, add ) { var name; if ( jQuery.isArray( obj ) ) { // Serialize array item. jQuery.each( obj, function( i, v ) { if ( traditional || rbracket.test( prefix ) ) { // Treat each array item as a scalar. add( prefix, v ); } else { // Item is non-scalar (array or object), encode its numeric index. buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); } }); } else if ( !traditional && jQuery.type( obj ) === "object" ) { // Serialize object item. for ( name in obj ) { buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); } } else { // Serialize scalar item. add( prefix, obj ); } } // Serialize an array of form elements or a set of // key/values into a query string jQuery.param = function( a, traditional ) { var prefix, s = [], add = function( key, value ) { // If value is a function, invoke it and return its value value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); }; // Set traditional to true for jQuery <= 1.3.2 behavior. if ( traditional === undefined ) { traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; } // If an array was passed in, assume that it is an array of form elements. if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { // Serialize the form elements jQuery.each( a, function() { add( this.name, this.value ); }); } else { // If traditional, encode the "old" way (the way 1.3.2 or older // did it), otherwise encode params recursively. for ( prefix in a ) { buildParams( prefix, a[ prefix ], traditional, add ); } } // Return the resulting serialization return s.join( "&" ).replace( r20, "+" ); }; jQuery.fn.extend({ serialize: function() { return jQuery.param( this.serializeArray() ); }, serializeArray: function() { return this.map(function() { // Can add propHook for "elements" to filter or add form elements var elements = jQuery.prop( this, "elements" ); return elements ? jQuery.makeArray( elements ) : this; }) .filter(function() { var type = this.type; // Use .is(":disabled") so that fieldset[disabled] works return this.name && !jQuery( this ).is( ":disabled" ) && rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && ( this.checked || !rcheckableType.test( type ) ); }) .map(function( i, elem ) { var val = jQuery( this ).val(); return val == null ? null : jQuery.isArray( val ) ? jQuery.map( val, function( val ) { return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; }) : { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; }).get(); } }); // Create the request object // (This is still attached to ajaxSettings for backward compatibility) jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ? // Support: IE6+ function() { // XHR cannot access local files, always use ActiveX for that case return !this.isLocal && // Support: IE7-8 // oldIE XHR does not support non-RFC2616 methods (#13240) // See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx // and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9 // Although this check for six methods instead of eight // since IE also does not support "trace" and "connect" /^(get|post|head|put|delete|options)$/i.test( this.type ) && createStandardXHR() || createActiveXHR(); } : // For all other browsers, use the standard XMLHttpRequest object createStandardXHR; var xhrId = 0, xhrCallbacks = {}, xhrSupported = jQuery.ajaxSettings.xhr(); // Support: IE<10 // Open requests must be manually aborted on unload (#5280) if ( window.ActiveXObject ) { jQuery( window ).on( "unload", function() { for ( var key in xhrCallbacks ) { xhrCallbacks[ key ]( undefined, true ); } }); } // Determine support properties support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); xhrSupported = support.ajax = !!xhrSupported; // Create transport if the browser can provide an xhr if ( xhrSupported ) { jQuery.ajaxTransport(function( options ) { // Cross domain only allowed if supported through XMLHttpRequest if ( !options.crossDomain || support.cors ) { var callback; return { send: function( headers, complete ) { var i, xhr = options.xhr(), id = ++xhrId; // Open the socket xhr.open( options.type, options.url, options.async, options.username, options.password ); // Apply custom fields if provided if ( options.xhrFields ) { for ( i in options.xhrFields ) { xhr[ i ] = options.xhrFields[ i ]; } } // Override mime type if needed if ( options.mimeType && xhr.overrideMimeType ) { xhr.overrideMimeType( options.mimeType ); } // X-Requested-With header // For cross-domain requests, seeing as conditions for a preflight are // akin to a jigsaw puzzle, we simply never set it to be sure. // (it can always be set on a per-request basis or even using ajaxSetup) // For same-domain requests, won't change header if already provided. if ( !options.crossDomain && !headers["X-Requested-With"] ) { headers["X-Requested-With"] = "XMLHttpRequest"; } // Set headers for ( i in headers ) { // Support: IE<9 // IE's ActiveXObject throws a 'Type Mismatch' exception when setting // request header to a null-value. // // To keep consistent with other XHR implementations, cast the value // to string and ignore `undefined`. if ( headers[ i ] !== undefined ) { xhr.setRequestHeader( i, headers[ i ] + "" ); } } // Do send the request // This may raise an exception which is actually // handled in jQuery.ajax (so no try/catch here) xhr.send( ( options.hasContent && options.data ) || null ); // Listener callback = function( _, isAbort ) { var status, statusText, responses; // Was never called and is aborted or complete if ( callback && ( isAbort || xhr.readyState === 4 ) ) { // Clean up delete xhrCallbacks[ id ]; callback = undefined; xhr.onreadystatechange = jQuery.noop; // Abort manually if needed if ( isAbort ) { if ( xhr.readyState !== 4 ) { xhr.abort(); } } else { responses = {}; status = xhr.status; // Support: IE<10 // Accessing binary-data responseText throws an exception // (#11426) if ( typeof xhr.responseText === "string" ) { responses.text = xhr.responseText; } // Firefox throws an exception when accessing // statusText for faulty cross-domain requests try { statusText = xhr.statusText; } catch( e ) { // We normalize with Webkit giving an empty statusText statusText = ""; } // Filter status for non standard behaviors // If the request is local and we have data: assume a success // (success with no data won't get notified, that's the best we // can do given current implementations) if ( !status && options.isLocal && !options.crossDomain ) { status = responses.text ? 200 : 404; // IE - #1450: sometimes returns 1223 when it should be 204 } else if ( status === 1223 ) { status = 204; } } } // Call complete if needed if ( responses ) { complete( status, statusText, responses, xhr.getAllResponseHeaders() ); } }; if ( !options.async ) { // if we're in sync mode we fire the callback callback(); } else if ( xhr.readyState === 4 ) { // (IE6 & IE7) if it's in cache and has been // retrieved directly we need to fire the callback setTimeout( callback ); } else { // Add to the list of active xhr callbacks xhr.onreadystatechange = xhrCallbacks[ id ] = callback; } }, abort: function() { if ( callback ) { callback( undefined, true ); } } }; } }); } // Functions to create xhrs function createStandardXHR() { try { return new window.XMLHttpRequest(); } catch( e ) {} } function createActiveXHR() { try { return new window.ActiveXObject( "Microsoft.XMLHTTP" ); } catch( e ) {} } // Install script dataType jQuery.ajaxSetup({ accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, contents: { script: /(?:java|ecma)script/ }, converters: { "text script": function( text ) { jQuery.globalEval( text ); return text; } } }); // Handle cache's special case and global jQuery.ajaxPrefilter( "script", function( s ) { if ( s.cache === undefined ) { s.cache = false; } if ( s.crossDomain ) { s.type = "GET"; s.global = false; } }); // Bind script tag hack transport jQuery.ajaxTransport( "script", function(s) { // This transport only deals with cross domain requests if ( s.crossDomain ) { var script, head = document.head || jQuery("head")[0] || document.documentElement; return { send: function( _, callback ) { script = document.createElement("script"); script.async = true; if ( s.scriptCharset ) { script.charset = s.scriptCharset; } script.src = s.url; // Attach handlers for all browsers script.onload = script.onreadystatechange = function( _, isAbort ) { if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) { // Handle memory leak in IE script.onload = script.onreadystatechange = null; // Remove the script if ( script.parentNode ) { script.parentNode.removeChild( script ); } // Dereference the script script = null; // Callback if not abort if ( !isAbort ) { callback( 200, "success" ); } } }; // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending // Use native DOM manipulation to avoid our domManip AJAX trickery head.insertBefore( script, head.firstChild ); }, abort: function() { if ( script ) { script.onload( undefined, true ); } } }; } }); var oldCallbacks = [], rjsonp = /(=)\?(?=&|$)|\?\?/; // Default jsonp settings jQuery.ajaxSetup({ jsonp: "callback", jsonpCallback: function() { var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) ); this[ callback ] = true; return callback; } }); // Detect, normalize options and install callbacks for jsonp requests jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { var callbackName, overwritten, responseContainer, jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? "url" : typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data" ); // Handle iff the expected data type is "jsonp" or we have a parameter to set if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { // Get callback name, remembering preexisting value associated with it callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback; // Insert callback into url or form data if ( jsonProp ) { s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); } else if ( s.jsonp !== false ) { s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; } // Use data converter to retrieve json after script execution s.converters["script json"] = function() { if ( !responseContainer ) { jQuery.error( callbackName + " was not called" ); } return responseContainer[ 0 ]; }; // force json dataType s.dataTypes[ 0 ] = "json"; // Install callback overwritten = window[ callbackName ]; window[ callbackName ] = function() { responseContainer = arguments; }; // Clean-up function (fires after converters) jqXHR.always(function() { // Restore preexisting value window[ callbackName ] = overwritten; // Save back as free if ( s[ callbackName ] ) { // make sure that re-using the options doesn't screw things around s.jsonpCallback = originalSettings.jsonpCallback; // save the callback name for future use oldCallbacks.push( callbackName ); } // Call if it was a function and we have a response if ( responseContainer && jQuery.isFunction( overwritten ) ) { overwritten( responseContainer[ 0 ] ); } responseContainer = overwritten = undefined; }); // Delegate to script return "script"; } }); // data: string of html // context (optional): If specified, the fragment will be created in this context, defaults to document // keepScripts (optional): If true, will include scripts passed in the html string jQuery.parseHTML = function( data, context, keepScripts ) { if ( !data || typeof data !== "string" ) { return null; } if ( typeof context === "boolean" ) { keepScripts = context; context = false; } context = context || document; var parsed = rsingleTag.exec( data ), scripts = !keepScripts && []; // Single tag if ( parsed ) { return [ context.createElement( parsed[1] ) ]; } parsed = jQuery.buildFragment( [ data ], context, scripts ); if ( scripts && scripts.length ) { jQuery( scripts ).remove(); } return jQuery.merge( [], parsed.childNodes ); }; // Keep a copy of the old load method var _load = jQuery.fn.load; /** * Load a url into a page */ jQuery.fn.load = function( url, params, callback ) { if ( typeof url !== "string" && _load ) { return _load.apply( this, arguments ); } var selector, response, type, self = this, off = url.indexOf(" "); if ( off >= 0 ) { selector = jQuery.trim( url.slice( off, url.length ) ); url = url.slice( 0, off ); } // If it's a function if ( jQuery.isFunction( params ) ) { // We assume that it's the callback callback = params; params = undefined; // Otherwise, build a param string } else if ( params && typeof params === "object" ) { type = "POST"; } // If we have elements to modify, make the request if ( self.length > 0 ) { jQuery.ajax({ url: url, // if "type" variable is undefined, then "GET" method will be used type: type, dataType: "html", data: params }).done(function( responseText ) { // Save response for use in complete callback response = arguments; self.html( selector ? // If a selector was specified, locate the right elements in a dummy div // Exclude scripts to avoid IE 'Permission Denied' errors jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) : // Otherwise use the full result responseText ); }).complete( callback && function( jqXHR, status ) { self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] ); }); } return this; }; var docElem = window.document.documentElement; /** * Gets a window from an element */ function getWindow( elem ) { return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 ? elem.defaultView || elem.parentWindow : false; } jQuery.offset = { setOffset: function( elem, options, i ) { var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, position = jQuery.css( elem, "position" ), curElem = jQuery( elem ), props = {}; // set position first, in-case top/left are set even on static elem if ( position === "static" ) { elem.style.position = "relative"; } curOffset = curElem.offset(); curCSSTop = jQuery.css( elem, "top" ); curCSSLeft = jQuery.css( elem, "left" ); calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [ curCSSTop, curCSSLeft ] ) > -1; // need to be able to calculate position if either top or left is auto and position is either absolute or fixed if ( calculatePosition ) { curPosition = curElem.position(); curTop = curPosition.top; curLeft = curPosition.left; } else { curTop = parseFloat( curCSSTop ) || 0; curLeft = parseFloat( curCSSLeft ) || 0; } if ( jQuery.isFunction( options ) ) { options = options.call( elem, i, curOffset ); } if ( options.top != null ) { props.top = ( options.top - curOffset.top ) + curTop; } if ( options.left != null ) { props.left = ( options.left - curOffset.left ) + curLeft; } if ( "using" in options ) { options.using.call( elem, props ); } else { curElem.css( props ); } } }; jQuery.fn.extend({ offset: function( options ) { if ( arguments.length ) { return options === undefined ? this : this.each(function( i ) { jQuery.offset.setOffset( this, options, i ); }); } var docElem, win, box = { top: 0, left: 0 }, elem = this[ 0 ], doc = elem && elem.ownerDocument; if ( !doc ) { return; } docElem = doc.documentElement; // Make sure it's not a disconnected DOM node if ( !jQuery.contains( docElem, elem ) ) { return box; } // If we don't have gBCR, just use 0,0 rather than error // BlackBerry 5, iOS 3 (original iPhone) if ( typeof elem.getBoundingClientRect !== strundefined ) { box = elem.getBoundingClientRect(); } win = getWindow( doc ); return { top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ), left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 ) }; }, position: function() { if ( !this[ 0 ] ) { return; } var offsetParent, offset, parentOffset = { top: 0, left: 0 }, elem = this[ 0 ]; // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent if ( jQuery.css( elem, "position" ) === "fixed" ) { // we assume that getBoundingClientRect is available when computed position is fixed offset = elem.getBoundingClientRect(); } else { // Get *real* offsetParent offsetParent = this.offsetParent(); // Get correct offsets offset = this.offset(); if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) { parentOffset = offsetParent.offset(); } // Add offsetParent borders parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ); parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ); } // Subtract parent offsets and element margins // note: when an element has margin: auto the offsetLeft and marginLeft // are the same in Safari causing offset.left to incorrectly be 0 return { top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true) }; }, offsetParent: function() { return this.map(function() { var offsetParent = this.offsetParent || docElem; while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) { offsetParent = offsetParent.offsetParent; } return offsetParent || docElem; }); } }); // Create scrollLeft and scrollTop methods jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { var top = /Y/.test( prop ); jQuery.fn[ method ] = function( val ) { return access( this, function( elem, method, val ) { var win = getWindow( elem ); if ( val === undefined ) { return win ? (prop in win) ? win[ prop ] : win.document.documentElement[ method ] : elem[ method ]; } if ( win ) { win.scrollTo( !top ? val : jQuery( win ).scrollLeft(), top ? val : jQuery( win ).scrollTop() ); } else { elem[ method ] = val; } }, method, val, arguments.length, null ); }; }); // Add the top/left cssHooks using jQuery.fn.position // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 // getComputedStyle returns percent when specified for top/left/bottom/right // rather than make the css module depend on the offset module, we just check for it here jQuery.each( [ "top", "left" ], function( i, prop ) { jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, function( elem, computed ) { if ( computed ) { computed = curCSS( elem, prop ); // if curCSS returns percentage, fallback to offset return rnumnonpx.test( computed ) ? jQuery( elem ).position()[ prop ] + "px" : computed; } } ); }); // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { // margin is only for outerHeight, outerWidth jQuery.fn[ funcName ] = function( margin, value ) { var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); return access( this, function( elem, type, value ) { var doc; if ( jQuery.isWindow( elem ) ) { // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there // isn't a whole lot we can do. See pull request at this URL for discussion: // https://github.com/jquery/jquery/pull/764 return elem.document.documentElement[ "client" + name ]; } // Get document width or height if ( elem.nodeType === 9 ) { doc = elem.documentElement; // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it. return Math.max( elem.body[ "scroll" + name ], doc[ "scroll" + name ], elem.body[ "offset" + name ], doc[ "offset" + name ], doc[ "client" + name ] ); } return value === undefined ? // Get width or height on the element, requesting but not forcing parseFloat jQuery.css( elem, type, extra ) : // Set width or height on the element jQuery.style( elem, type, value, extra ); }, type, chainable ? margin : undefined, chainable, null ); }; }); }); // The number of elements contained in the matched element set jQuery.fn.size = function() { return this.length; }; jQuery.fn.andSelf = jQuery.fn.addBack; // Register as a named AMD module, since jQuery can be concatenated with other // files that may use define, but not via a proper concatenation script that // understands anonymous AMD modules. A named AMD is safest and most robust // way to register. Lowercase jquery is used because AMD module names are // derived from file names, and jQuery is normally delivered in a lowercase // file name. Do this after creating the global so that if an AMD module wants // to call noConflict to hide this version of jQuery, it will work. // Note that for maximum portability, libraries that are not jQuery should // declare themselves as anonymous modules, and avoid setting a global if an // AMD loader is present. jQuery is a special case. For more information, see // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon if ( typeof define === "function" && define.amd ) { define( "jquery", [], function() { return jQuery; }); } var // Map over jQuery in case of overwrite _jQuery = window.jQuery, // Map over the $ in case of overwrite _$ = window.$; jQuery.noConflict = function( deep ) { if ( window.$ === jQuery ) { window.$ = _$; } if ( deep && window.jQuery === jQuery ) { window.jQuery = _jQuery; } return jQuery; }; // Expose jQuery and $ identifiers, even in // AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557) // and CommonJS for browser emulators (#13566) if ( typeof noGlobal === strundefined ) { window.jQuery = window.$ = jQuery; } return jQuery; }));
import Immutable from "immutable"; const UserRecord = Immutable.Record({ id: "", karma: 0, created: null }); export default class User extends UserRecord {}
/* global define, require */ /* Blur Adapted from v002 by Anton Marini and Tom Butterworth * Copyright vade - Anton Marini * Creative Commons, Attribution - Non Commercial - Share Alike 3.0 http://v002.info/plugins/v002-blurs/ */ (function (root, factory) { 'use strict'; if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['seriously'], factory); } else if (typeof exports === 'object') { // Node/CommonJS factory(require('seriously')); } else { if (!root.Seriously) { root.Seriously = { plugin: function (name, opt) { this[name] = opt; } }; } factory(root.Seriously); } }(this, function (Seriously) { 'use strict'; var passes = [0.2, 0.3, 0.5, 0.8, 1], finalPass = passes.length - 1, horizontal = [1, 0], vertical = [0, 1], identity = new Float32Array([ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ]); Seriously.plugin('blur', function (options) { var fbHorizontal, fbVertical, baseShader, loopUniforms = { amount: 0, inputScale: 1, resolution: [this.width, this.height], transform: identity, direction: null }; return { initialize: function (parent) { var gl; parent(); gl = this.gl; if (!gl) { return; } baseShader = this.baseShader; fbHorizontal = new Seriously.util.FrameBuffer(gl, this.width, this.height); fbVertical = new Seriously.util.FrameBuffer(gl, this.width, this.height); }, commonShader: true, shader: function (inputs, shaderSource) { var gl = this.gl, /* Some devices or browsers (e.g. IE11 preview) don't support enough varying vectors, so we need to fallback to a less efficient method */ maxVaryings = gl.getParameter(gl.MAX_VARYING_VECTORS), defineVaryings = (maxVaryings >= 10 ? '#define USE_VARYINGS' : ''); shaderSource.vertex = [ defineVaryings, 'precision mediump float;', 'attribute vec4 position;', 'attribute vec2 texCoord;', 'uniform vec2 resolution;', 'uniform mat4 transform;', 'uniform vec2 direction;', 'uniform float amount;', 'uniform float inputScale;', 'const vec2 zero = vec2(0.0, 0.0);', 'varying vec2 vTexCoord;', '#ifdef USE_VARYINGS', 'vec2 one;', 'vec2 amount1;', 'varying vec2 vTexCoord1;', 'varying vec2 vTexCoord2;', 'varying vec2 vTexCoord3;', 'varying vec2 vTexCoord4;', 'varying vec2 vTexCoord5;', 'varying vec2 vTexCoord6;', 'varying vec2 vTexCoord7;', 'varying vec2 vTexCoord8;', '#else', 'varying vec2 one;', 'varying vec2 amount1;', '#endif', 'void main(void) {', // first convert to screen space ' vec4 screenPosition = vec4(position.xy * resolution / 2.0, position.z, position.w);', ' screenPosition = transform * screenPosition;', // convert back to OpenGL coords ' gl_Position = screenPosition;', ' gl_Position.xy = screenPosition.xy * 2.0 / resolution;', ' gl_Position.z = screenPosition.z * 2.0 / (resolution.x / resolution.y);', ' vTexCoord = texCoord;', ' one = vec2(1.0, 1.0) * inputScale;', ' if (inputScale < 1.0) {', ' one -= 1.0 / resolution;', ' }', ' vTexCoord = max(zero, min(one, texCoord.st * inputScale));', ' amount1 = direction * (inputScale * amount * 5.0 / resolution);', '#ifdef USE_VARYINGS', ' vec2 amount2 = amount1 * 3.0;', ' vec2 amount3 = amount1 * 6.0;', ' vec2 amount4 = amount1 * 9.0;', ' vec2 amount5 = -amount1;', ' vec2 amount6 = amount5 * 3.0;', ' vec2 amount7 = amount5 * 6.0;', ' vec2 amount8 = amount5 * 9.0;', ' vTexCoord1 = max(zero, min(one, vTexCoord + amount1));', ' vTexCoord2 = max(zero, min(one, vTexCoord + amount2));', ' vTexCoord3 = max(zero, min(one, vTexCoord + amount3));', ' vTexCoord4 = max(zero, min(one, vTexCoord + amount4));', ' vTexCoord5 = max(zero, min(one, vTexCoord + amount5));', ' vTexCoord6 = max(zero, min(one, vTexCoord + amount6));', ' vTexCoord7 = max(zero, min(one, vTexCoord + amount7));', ' vTexCoord8 = max(zero, min(one, vTexCoord + amount8));', '#endif', '}' ].join('\n'); shaderSource.fragment = [ defineVaryings, 'precision mediump float;\n', 'varying vec2 vTexCoord;', 'uniform sampler2D source;', '#ifdef USE_VARYINGS', 'varying vec2 vTexCoord1;', 'varying vec2 vTexCoord2;', 'varying vec2 vTexCoord3;', 'varying vec2 vTexCoord4;', 'varying vec2 vTexCoord5;', 'varying vec2 vTexCoord6;', 'varying vec2 vTexCoord7;', 'varying vec2 vTexCoord8;', '#else', 'varying vec2 amount1;', 'varying vec2 one;', 'const vec2 zero = vec2(0.0, 0.0);', '#endif', 'void main(void) {', '#ifndef USE_VARYINGS', ' vec2 vTexCoord1 = max(zero, min(one, vTexCoord + amount1));', ' vec2 vTexCoord2 = max(zero, min(one, vTexCoord + amount1 * 3.0));', ' vec2 vTexCoord3 = max(zero, min(one, vTexCoord + amount1 * 6.0));', ' vec2 vTexCoord4 = max(zero, min(one, vTexCoord + amount1 * 9.0));', ' vec2 vTexCoord5 = max(zero, min(one, vTexCoord - amount1));', ' vec2 vTexCoord6 = max(zero, min(one, vTexCoord - amount1 * 3.0));', ' vec2 vTexCoord7 = max(zero, min(one, vTexCoord - amount1 * 6.0));', ' vec2 vTexCoord8 = max(zero, min(one, vTexCoord - amount1 * 9.0));', '#endif', ' gl_FragColor = texture2D(source, vTexCoord) / 9.0;', ' gl_FragColor += texture2D(source, vTexCoord1) / 9.0;', ' gl_FragColor += texture2D(source, vTexCoord2) / 9.0;', ' gl_FragColor += texture2D(source, vTexCoord3) / 9.0;', ' gl_FragColor += texture2D(source, vTexCoord4) / 9.0;', ' gl_FragColor += texture2D(source, vTexCoord5) / 9.0;', ' gl_FragColor += texture2D(source, vTexCoord6) / 9.0;', ' gl_FragColor += texture2D(source, vTexCoord7) / 9.0;', ' gl_FragColor += texture2D(source, vTexCoord8) / 9.0;', '}' ].join('\n'); return shaderSource; }, draw: function (shader, model, uniforms, frameBuffer, parent) { var i, pass, amount, width, height, opts = { width: 0, height: 0, blend: false }, previousPass = 1; amount = this.inputs.amount; if (!amount) { uniforms.source = this.inputs.source.texture; parent(baseShader, model, uniforms, frameBuffer); return; } if (amount <= 0.01) { //horizontal pass uniforms.inputScale = 1; uniforms.direction = horizontal; uniforms.source = this.inputs.source.texture; parent(shader, model, uniforms, fbHorizontal.frameBuffer); //vertical pass uniforms.direction = vertical; uniforms.source = fbHorizontal.texture; parent(shader, model, uniforms, frameBuffer); return; } loopUniforms.amount = amount; loopUniforms.source = this.inputs.source.texture; for (i = 0; i < passes.length; i++) { pass = Math.min(1, passes[i] / amount); width = Math.floor(pass * this.width); height = Math.floor(pass * this.height); loopUniforms.resolution[0] = width; loopUniforms.resolution[1] = height; loopUniforms.inputScale = previousPass; previousPass = pass; opts.width = width; opts.height = height; //horizontal pass loopUniforms.direction = horizontal; parent(shader, model, loopUniforms, fbHorizontal.frameBuffer, null, opts); //vertical pass loopUniforms.inputScale = pass; loopUniforms.source = fbHorizontal.texture; loopUniforms.direction = vertical; parent(shader, model, loopUniforms, i === finalPass ? frameBuffer : fbVertical.frameBuffer, null, opts); loopUniforms.source = fbVertical.texture; } }, resize: function () { loopUniforms.resolution[0] = this.width; loopUniforms.resolution[1] = this.height; if (fbHorizontal) { fbHorizontal.resize(this.width, this.height); fbVertical.resize(this.width, this.height); } }, destroy: function () { if (fbHorizontal) { fbHorizontal.destroy(); fbVertical.destroy(); fbHorizontal = null; fbVertical = null; } loopUniforms = null; } }; }, { inputs: { source: { type: 'image', shaderDirty: false }, amount: { type: 'number', uniform: 'amount', defaultValue: 0.2, min: 0, max: 1 } }, title: 'Gaussian Blur' }); }));
/* --- name: Mouse description: Maps mouse events to their touch counterparts authors: Christoph Pojer (@cpojer) license: MIT-style license. requires: [Custom-Event/Element.defineCustomEvent, Browser.Features.Touch] provides: Mouse ... */ if (!Browser.Features.Touch) (function(){ var down = false; var condition = function(event, type){ if (type == 'touchstart') down = true; else if (type == 'touchend') down = false; else if (type == 'touchmove' && !down) return false; event.targetTouches = []; event.changedTouches = event.touches = [{ pageX: event.page.x, pageY: event.page.y, clientX: event.client.x, clientY: event.client.y }]; return true; }; Element.defineCustomEvent('touchstart', { base: 'mousedown', condition: condition }).defineCustomEvent('touchmove', { base: 'mousemove', condition: condition }).defineCustomEvent('touchend', { base: 'mouseup', condition: condition }); document.addEvent('mouseup', function() { down = false; }); })();
/* * @name Figuras simples * @description Este ejemplo incluye una elipse, un rectángulo, un triángulo y una flor. */ function setup() { // crear el lienzo createCanvas(720, 400); background(200); // Definir colores fill(204, 101, 192, 127); stroke(127, 63, 120); // Un rectángulo rect(40, 120, 120, 40); // Una elipse ellipse(240, 240, 80, 80); // Un triángulo triangle(300, 100, 320, 100, 310, 80); // Un diseño de una flor simple translate(580, 200); noStroke(); for (let i = 0; i < 10; i ++) { ellipse(0, 30, 20, 80); rotate(PI/5); } }
import Coordinate from './geom/Coordinate' import CoordinateList from './geom/CoordinateList' import Envelope from './geom/Envelope' import LineSegment from './geom/LineSegment' import GeometryFactory from './geom/GeometryFactory' import Geometry from './geom/Geometry' import Point from './geom/Point' import LineString from './geom/LineString' import LinearRing from './geom/LinearRing' import Polygon from './geom/Polygon' import GeometryCollection from './geom/GeometryCollection' import MultiPoint from './geom/MultiPoint' import MultiLineString from './geom/MultiLineString' import MultiPolygon from './geom/MultiPolygon' import Dimension from './geom/Dimension' import IntersectionMatrix from './geom/IntersectionMatrix' export { Coordinate, CoordinateList, Envelope, LineSegment, GeometryFactory, Geometry, Point, LineString, LinearRing, Polygon, GeometryCollection, MultiPoint, MultiLineString, MultiPolygon, Dimension, IntersectionMatrix }
var Promise = require('rsvp').Promise; var merge = require('ember-cli-lodash-subset').merge; var inflection = require('inflection'); module.exports = { description: 'Generates a model and route.', install: function(options) { return this._process('install', options); }, uninstall: function(options) { return this._process('uninstall', options); }, _processBlueprint: function(type, name, options) { var mainBlueprint = this.lookupBlueprint(name); var that = this; return Promise.resolve() .then(function() { return mainBlueprint[type](options); }) .then(function() { var testBlueprint = mainBlueprint.lookupBlueprint(name + '-test', { ui: this.ui, analytics: this.analytics, project: this.project, ignoreMissing: true }); if (!testBlueprint) { return; } var Blueprint = that._findBlueprintBaseClass(testBlueprint); if (Blueprint && testBlueprint.locals === Blueprint.prototype.locals) { testBlueprint.locals = function(options) { return mainBlueprint.locals(options); }; } return testBlueprint[type](options); }); }, _findBlueprintBaseClass: function(cls) { if (cls.constructor && cls.constructor.name === 'Blueprint') { return cls.constructor; } if (cls._super) { return this._findBlueprintBaseClass(cls._super); } return null; }, _process: function(type, options) { this.ui = options.ui; this.project = options.project; var entityName = options.entity.name; var modelOptions = merge({}, options, { entity: { name: entityName ? inflection.singularize(entityName) : '' } }); var routeOptions = merge({}, options); return this._processBlueprint(type, 'model', modelOptions) .then(function() { return this._processBlueprint(type, 'route', routeOptions); }.bind(this)); } };
(function (tree) { tree.mixin = {}; tree.mixin.Call = function (elements, args, index) { this.selector = new(tree.Selector)(elements); this.arguments = args; this.index = index; }; tree.mixin.Call.prototype = { eval: function (env) { var mixins, args, rules = [], match = false; for (var i = 0; i < env.frames.length; i++) { if ((mixins = env.frames[i].find(this.selector)).length > 0) { args = this.arguments && this.arguments.map(function (a) { return a.eval(env) }); for (var m = 0; m < mixins.length; m++) { if (mixins[m].match(args, env)) { try { Array.prototype.push.apply( rules, mixins[m].eval(env, this.arguments).rules); match = true; } catch (e) { throw { message: e.message, index: e.index, stack: e.stack, call: this.index }; } } } if (match) { return rules; } else { throw { message: 'No matching definition was found for `' + this.selector.toCSS().trim() + '(' + this.arguments.map(function (a) { return a.toCSS(); }).join(', ') + ")`", index: this.index }; } } } throw { message: this.selector.toCSS().trim() + " is undefined", index: this.index }; } }; tree.mixin.Definition = function (name, params, rules) { this.name = name; this.selectors = [new(tree.Selector)([new(tree.Element)(null, name)])]; this.params = params; this.arity = params.length; this.rules = rules; this._lookups = {}; this.required = params.reduce(function (count, p) { if (!p.name || (p.name && !p.value)) { return count + 1 } else { return count } }, 0); this.parent = tree.Ruleset.prototype; this.frames = []; }; tree.mixin.Definition.prototype = { toCSS: function () { return "" }, variable: function (name) { return this.parent.variable.call(this, name) }, variables: function () { return this.parent.variables.call(this) }, find: function () { return this.parent.find.apply(this, arguments) }, rulesets: function () { return this.parent.rulesets.apply(this) }, eval: function (env, args) { var frame = new(tree.Ruleset)(null, []), context, _arguments = []; for (var i = 0, val; i < this.params.length; i++) { if (this.params[i].name) { if (val = (args && args[i]) || this.params[i].value) { frame.rules.unshift(new(tree.Rule)(this.params[i].name, val.eval(env))); } else { throw { message: "wrong number of arguments for " + this.name + ' (' + args.length + ' for ' + this.arity + ')' }; } } } for (var i = 0; i < Math.max(this.params.length, args && args.length); i++) { _arguments.push(args[i] || this.params[i].value); } frame.rules.unshift(new(tree.Rule)('@arguments', new(tree.Expression)(_arguments).eval(env))); return new(tree.Ruleset)(null, this.rules.slice(0)).eval({ frames: [this, frame].concat(this.frames, env.frames) }); }, match: function (args, env) { var argsLength = (args && args.length) || 0, len; if (argsLength < this.required) { return false } if ((this.required > 0) && (argsLength > this.params.length)) { return false } len = Math.min(argsLength, this.arity); for (var i = 0; i < len; i++) { if (!this.params[i].name) { if (args[i].eval(env).toCSS() != this.params[i].value.eval(env).toCSS()) { return false; } } } return true; } }; })(require('../tree'));
import { BoxGeometry, Vector3 } from '../../../build/three.module.js'; const _tempNormal = new Vector3(); function getUv( faceDirVector, normal, uvAxis, projectionAxis, radius, sideLength ) { const totArcLength = 2 * Math.PI * radius / 4; // length of the planes between the arcs on each axis const centerLength = Math.max( sideLength - 2 * radius, 0 ); const halfArc = Math.PI / 4; // Get the vector projected onto the Y plane _tempNormal.copy( normal ); _tempNormal[ projectionAxis ] = 0; _tempNormal.normalize(); // total amount of UV space alloted to a single arc const arcUvRatio = 0.5 * totArcLength / ( totArcLength + centerLength ); // the distance along one arc the point is at const arcAngleRatio = 1.0 - ( _tempNormal.angleTo( faceDirVector ) / halfArc ); if ( Math.sign( _tempNormal[ uvAxis ] ) === 1 ) { return arcAngleRatio * arcUvRatio; } else { // total amount of UV space alloted to the plane between the arcs const lenUv = centerLength / ( totArcLength + centerLength ); return lenUv + arcUvRatio + arcUvRatio * ( 1.0 - arcAngleRatio ); } } class RoundedBoxGeometry extends BoxGeometry { constructor( width = 1, height = 1, depth = 1, segments = 2, radius = 0.1 ) { // ensure segments is odd so we have a plane connecting the rounded corners segments = segments * 2 + 1; // ensure radius isn't bigger than shortest side radius = Math.min( width / 2, height / 2, depth / 2, radius ); super( 1, 1, 1, segments, segments, segments ); // if we just have one segment we're the same as a regular box if ( segments === 1 ) return; const geometry2 = this.toNonIndexed(); this.index = null; this.attributes.position = geometry2.attributes.position; this.attributes.normal = geometry2.attributes.normal; this.attributes.uv = geometry2.attributes.uv; // const position = new Vector3(); const normal = new Vector3(); const box = new Vector3( width, height, depth ).divideScalar( 2 ).subScalar( radius ); const positions = this.attributes.position.array; const normals = this.attributes.normal.array; const uvs = this.attributes.uv.array; const faceTris = positions.length / 6; const faceDirVector = new Vector3(); const halfSegmentSize = 0.5 / segments; for ( let i = 0, j = 0; i < positions.length; i += 3, j += 2 ) { position.fromArray( positions, i ); normal.copy( position ); normal.x -= Math.sign( normal.x ) * halfSegmentSize; normal.y -= Math.sign( normal.y ) * halfSegmentSize; normal.z -= Math.sign( normal.z ) * halfSegmentSize; normal.normalize(); positions[ i + 0 ] = box.x * Math.sign( position.x ) + normal.x * radius; positions[ i + 1 ] = box.y * Math.sign( position.y ) + normal.y * radius; positions[ i + 2 ] = box.z * Math.sign( position.z ) + normal.z * radius; normals[ i + 0 ] = normal.x; normals[ i + 1 ] = normal.y; normals[ i + 2 ] = normal.z; const side = Math.floor( i / faceTris ); switch ( side ) { case 0: // right // generate UVs along Z then Y faceDirVector.set( 1, 0, 0 ); uvs[ j + 0 ] = getUv( faceDirVector, normal, 'z', 'y', radius, depth ); uvs[ j + 1 ] = 1.0 - getUv( faceDirVector, normal, 'y', 'z', radius, height ); break; case 1: // left // generate UVs along Z then Y faceDirVector.set( - 1, 0, 0 ); uvs[ j + 0 ] = 1.0 - getUv( faceDirVector, normal, 'z', 'y', radius, depth ); uvs[ j + 1 ] = 1.0 - getUv( faceDirVector, normal, 'y', 'z', radius, height ); break; case 2: // top // generate UVs along X then Z faceDirVector.set( 0, 1, 0 ); uvs[ j + 0 ] = 1.0 - getUv( faceDirVector, normal, 'x', 'z', radius, width ); uvs[ j + 1 ] = getUv( faceDirVector, normal, 'z', 'x', radius, depth ); break; case 3: // bottom // generate UVs along X then Z faceDirVector.set( 0, - 1, 0 ); uvs[ j + 0 ] = 1.0 - getUv( faceDirVector, normal, 'x', 'z', radius, width ); uvs[ j + 1 ] = 1.0 - getUv( faceDirVector, normal, 'z', 'x', radius, depth ); break; case 4: // front // generate UVs along X then Y faceDirVector.set( 0, 0, 1 ); uvs[ j + 0 ] = 1.0 - getUv( faceDirVector, normal, 'x', 'y', radius, width ); uvs[ j + 1 ] = 1.0 - getUv( faceDirVector, normal, 'y', 'x', radius, height ); break; case 5: // back // generate UVs along X then Y faceDirVector.set( 0, 0, - 1 ); uvs[ j + 0 ] = getUv( faceDirVector, normal, 'x', 'y', radius, width ); uvs[ j + 1 ] = 1.0 - getUv( faceDirVector, normal, 'y', 'x', radius, height ); break; } } } } export { RoundedBoxGeometry };
var x = function (foo) { for (var _len = arguments.length, bar = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { bar[_key - 1] = arguments[_key]; } console.log(bar); }; var y = function (foo) { for (var _len2 = arguments.length, bar = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { bar[_key2 - 1] = arguments[_key2]; } var x = function z(bar) { bar[1] = 5; }; }; var b = function (x, y) { for (var _len3 = arguments.length, args = Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) { args[_key3 - 2] = arguments[_key3]; } console.log(args[0]); args.pop(); console.log(args[1]); }; var z = function (foo) { for (var _len4 = arguments.length, bar = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) { bar[_key4 - 1] = arguments[_key4]; } var x = function () { bar[1] = 5; }; }; var a = function (foo) { for (var _len5 = arguments.length, bar = Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) { bar[_key5 - 1] = arguments[_key5]; } return bar.join(","); }; var b = function (foo) { var join = "join"; for (var _len6 = arguments.length, bar = Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) { bar[_key6 - 1] = arguments[_key6]; } return bar[join]; }; var b = function () { for (var _len7 = arguments.length, bar = Array(_len7), _key7 = 0; _key7 < _len7; _key7++) { bar[_key7] = arguments[_key7]; } return bar.len; }; var b = function (foo) { return (arguments.length - 1) * 2; }; var b = function (foo, baz) { return arguments.length - 2; }; function x() { for (var _len8 = arguments.length, rest = Array(_len8), _key8 = 0; _key8 < _len8; _key8++) { rest[_key8] = arguments[_key8]; } rest[0] = 0; } function swap() { for (var _len9 = arguments.length, rest = Array(_len9), _key9 = 0; _key9 < _len9; _key9++) { rest[_key9] = arguments[_key9]; } var _ref = [rest[1], rest[0]]; rest[0] = _ref[0]; rest[1] = _ref[1]; } function forIn() { for (var _len10 = arguments.length, rest = Array(_len10), _key10 = 0; _key10 < _len10; _key10++) { rest[_key10] = arguments[_key10]; } for (rest[0] in this) { foo(rest[0]); } } function inc() { for (var _len11 = arguments.length, rest = Array(_len11), _key11 = 0; _key11 < _len11; _key11++) { rest[_key11] = arguments[_key11]; } ++rest[0]; } function dec() { for (var _len12 = arguments.length, rest = Array(_len12), _key12 = 0; _key12 < _len12; _key12++) { rest[_key12] = arguments[_key12]; } --rest[0]; } function del() { for (var _len13 = arguments.length, rest = Array(_len13), _key13 = 0; _key13 < _len13; _key13++) { rest[_key13] = arguments[_key13]; } delete rest[0]; } function method() { for (var _len14 = arguments.length, rest = Array(_len14), _key14 = 0; _key14 < _len14; _key14++) { rest[_key14] = arguments[_key14]; } rest[0](); } function newExp() { for (var _len15 = arguments.length, rest = Array(_len15), _key15 = 0; _key15 < _len15; _key15++) { rest[_key15] = arguments[_key15]; } new rest[0](); } // In addition to swap() above because at some point someone tried checking // grandparent path for isArrayExpression() to deopt. function arrayDestructure() { for (var _len16 = arguments.length, rest = Array(_len16), _key16 = 0; _key16 < _len16; _key16++) { rest[_key16] = arguments[_key16]; } var _x = babelHelpers.slicedToArray(x, 1); rest[0] = _x[0]; } function forOf() { for (var _len17 = arguments.length, rest = Array(_len17), _key17 = 0; _key17 < _len17; _key17++) { rest[_key17] = arguments[_key17]; } var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError = undefined; try { for (var _iterator = this[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { rest[0] = _step.value; } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (!_iteratorNormalCompletion && _iterator.return) { _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } } function postfixIncrement() { for (var _len18 = arguments.length, rest = Array(_len18), _key18 = 0; _key18 < _len18; _key18++) { rest[_key18] = arguments[_key18]; } rest[0]++; } function postfixDecrement() { for (var _len19 = arguments.length, rest = Array(_len19), _key19 = 0; _key19 < _len19; _key19++) { rest[_key19] = arguments[_key19]; } rest[0]--; }
describe( 'MainController', function() { var MainCtrl, $location, $httpBackend, $scope, MapService, state, queryService; beforeEach( module( 'SolrHeatmapApp' ) ); beforeEach( inject( function( $controller, _$location_, $rootScope, _$httpBackend_, _Map_, _$state_, _queryService_) { $location = _$location_; $httpBackend = _$httpBackend_; $scope = $rootScope.$new(); MapService = _Map_; state = _$state_; queryService = _queryService_; MainCtrl = $controller( 'MainController', { $scope: $scope }); })); describe('#response', function() { describe('without a config', function() { it( 'throws error', function() { expect(MainCtrl.response).toThrowError('Could not find the mapConfig'); }); }); describe('with a config', function() { var mapServiceSpy, setupSpy; beforeEach(function() { mapServiceSpy = spyOn(MapService, 'init'); setupSpy = spyOn(MainCtrl, 'setupEvents'); }); it( 'calls MapService init', function() { MainCtrl.response({data: {mapConfig: { view: { projection: 'EPSG:4326'}}}}); expect(mapServiceSpy).toHaveBeenCalled(); }); describe('with a geo state', function() { var serviceSpy; beforeEach(function() { serviceSpy = spyOn(queryService, 'getExtentForProjectionFromQuery'); spyOn(MapService, 'calculateFullScreenExtentFromBoundingBox'); MainCtrl.$state = { geo: '[1,1 TO 1,1]'}; }); it( 'calls MapService getExtentForProjectionFromQuery', function() { MainCtrl.response({data: {mapConfig: { view: { projection: 'EPSG:4326'}}}}); expect(serviceSpy).toHaveBeenCalled(); }); }); }); }); describe('#badResponse', function() { it( 'throws error', function() { expect(MainCtrl.badResponse).toThrowError('Error while loading the config.json'); }); }); });
var searchData= [ ['radians',['radians',['../interface_t_l_m_angle.html#a1cdfede1c67bfae83ac622da174501b8',1,'TLMAngle']]], ['rawdata',['rawData',['../interface_t_l_m_emg_event.html#a7fac6bdf3f8ea4009a71ae1fdaa9fcc9',1,'TLMEmgEvent']]], ['roll',['roll',['../interface_t_l_m_euler_angles.html#a70dea082d7777b03958ad221216201e7',1,'TLMEulerAngles']]] ];
/* YUI 3.8.0pr2 (build 154) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ if (typeof _yuitest_coverage == "undefined"){ _yuitest_coverage = {}; _yuitest_coverline = function(src, line){ var coverage = _yuitest_coverage[src]; if (!coverage.lines[line]){ coverage.calledLines++; } coverage.lines[line]++; }; _yuitest_coverfunc = function(src, name, line){ var coverage = _yuitest_coverage[src], funcId = name + ":" + line; if (!coverage.functions[funcId]){ coverage.calledFunctions++; } coverage.functions[funcId]++; }; } _yuitest_coverage["build/datatype-date-parse/datatype-date-parse.js"] = { lines: {}, functions: {}, coveredLines: 0, calledLines: 0, coveredFunctions: 0, calledFunctions: 0, path: "build/datatype-date-parse/datatype-date-parse.js", code: [] }; _yuitest_coverage["build/datatype-date-parse/datatype-date-parse.js"].code=["YUI.add('datatype-date-parse', function (Y, NAME) {","","/**"," * Parse number submodule."," *"," * @module datatype-date"," * @submodule datatype-date-parse"," * @for Date"," */","Y.mix(Y.namespace(\"Date\"), {"," /**"," * Converts data to type Date."," *"," * @method parse"," * @param data {Date|Number|String} date object, timestamp (string or number), or string parsable by Date.parse"," * @return {Date} a Date object or null if unable to parse"," */"," parse: function(data) {"," var val = new Date(+data || data);"," if (Y.Lang.isDate(val)) {"," return val;"," } else {"," return null;"," }"," }","});","","// Add Parsers shortcut","Y.namespace(\"Parsers\").date = Y.Date.parse;","","Y.namespace(\"DataType\");","Y.DataType.Date = Y.Date;","","","}, '3.8.0pr2');"]; _yuitest_coverage["build/datatype-date-parse/datatype-date-parse.js"].lines = {"1":0,"10":0,"19":0,"20":0,"21":0,"23":0,"29":0,"31":0,"32":0}; _yuitest_coverage["build/datatype-date-parse/datatype-date-parse.js"].functions = {"parse:18":0,"(anonymous 1):1":0}; _yuitest_coverage["build/datatype-date-parse/datatype-date-parse.js"].coveredLines = 9; _yuitest_coverage["build/datatype-date-parse/datatype-date-parse.js"].coveredFunctions = 2; _yuitest_coverline("build/datatype-date-parse/datatype-date-parse.js", 1); YUI.add('datatype-date-parse', function (Y, NAME) { /** * Parse number submodule. * * @module datatype-date * @submodule datatype-date-parse * @for Date */ _yuitest_coverfunc("build/datatype-date-parse/datatype-date-parse.js", "(anonymous 1)", 1); _yuitest_coverline("build/datatype-date-parse/datatype-date-parse.js", 10); Y.mix(Y.namespace("Date"), { /** * Converts data to type Date. * * @method parse * @param data {Date|Number|String} date object, timestamp (string or number), or string parsable by Date.parse * @return {Date} a Date object or null if unable to parse */ parse: function(data) { _yuitest_coverfunc("build/datatype-date-parse/datatype-date-parse.js", "parse", 18); _yuitest_coverline("build/datatype-date-parse/datatype-date-parse.js", 19); var val = new Date(+data || data); _yuitest_coverline("build/datatype-date-parse/datatype-date-parse.js", 20); if (Y.Lang.isDate(val)) { _yuitest_coverline("build/datatype-date-parse/datatype-date-parse.js", 21); return val; } else { _yuitest_coverline("build/datatype-date-parse/datatype-date-parse.js", 23); return null; } } }); // Add Parsers shortcut _yuitest_coverline("build/datatype-date-parse/datatype-date-parse.js", 29); Y.namespace("Parsers").date = Y.Date.parse; _yuitest_coverline("build/datatype-date-parse/datatype-date-parse.js", 31); Y.namespace("DataType"); _yuitest_coverline("build/datatype-date-parse/datatype-date-parse.js", 32); Y.DataType.Date = Y.Date; }, '3.8.0pr2');
const Question = Jymfony.Component.Console.Question.Question; const PasswordRenderer = Jymfony.Component.Console.Question.Renderer.PasswordRenderer; const SttyPasswordRenderer = Jymfony.Component.Console.Question.Renderer.SttyPasswordRenderer; const Terminal = Jymfony.Component.Console.Terminal; /** * Represents a question with choices * It is strongly recommended to create a question with the help of a * QuestionBuilder object * * @memberOf Jymfony.Component.Console.Question */ export default class PasswordQuestion extends Question { /** * @inheritdoc */ __construct(input, output) { super.__construct(input, output); /** * If the input should be hidden. * * @type {boolean} */ this.hidden = true; /** * Mask character if input is not hidden. * * @type {string} */ this.mask = '*'; } /** * @inheritdoc */ _getRenderer() { if (! this.hidden || ! this._output.stream.isTTY || ! Terminal.hasSttyAvailable()) { return new PasswordRenderer(this); } return new SttyPasswordRenderer(this); } }
/** * @module gestures */ /** * Single tap and a double tap on a place * * @class Tap * @static */ /** * @event tap * @param {Object} ev */ /** * @event doubletap * @param {Object} ev */ /** * @param {String} name */ (function(name) { var hasMoved = false; function tapGesture(ev, inst) { var options = inst.options, current = Detection.current, prev = Detection.previous, sincePrev, didDoubleTap; switch(ev.eventType) { case EVENT_START: hasMoved = false; break; case EVENT_MOVE: hasMoved = hasMoved || (ev.distance > options.tapMaxDistance); break; case EVENT_END: if(!Utils.inStr(ev.srcEvent.type, 'cancel') && ev.deltaTime < options.tapMaxTime && !hasMoved) { // previous gesture, for the double tap since these are two different gesture detections sincePrev = prev && prev.lastEvent && ev.timeStamp - prev.lastEvent.timeStamp; didDoubleTap = false; // check if double tap if(prev && prev.name == name && (sincePrev && sincePrev < options.doubleTapInterval) && ev.distance < options.doubleTapDistance) { inst.trigger('doubletap', ev); didDoubleTap = true; } // do a single tap if(!didDoubleTap || options.tapAlways) { current.name = name; inst.trigger(current.name, ev); } } break; } } Hammer.gestures.Tap = { name: name, index: 100, handler: tapGesture, defaults: { /** * max time of a tap, this is for the slow tappers * @property tapMaxTime * @type {Number} * @default 250 */ tapMaxTime: 250, /** * max distance of movement of a tap, this is for the slow tappers * @property tapMaxDistance * @type {Number} * @default 10 */ tapMaxDistance: 10, /** * always trigger the `tap` event, even while double-tapping * @property tapAlways * @type {Boolean} * @default true */ tapAlways: true, /** * max distance between two taps * @property doubleTapDistance * @type {Number} * @default 20 */ doubleTapDistance: 20, /** * max time between two taps * @property doubleTapInterval * @type {Number} * @default 300 */ doubleTapInterval: 300 } }; })('tap');
// The MIT License // Copyright (c) 2010 Atsuya Takagi // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. var fs = require("fs"); var path = require("path"); var sys = null; try { sys = require("util"); } catch(ex) { sys = require("sys"); } Handler = module.exports = function(rootPath) { this.rootPath = rootPath; this.defaultContentType = 'application/octet-stream'; this.contentTypes = { '.json': 'application/json', '.js': 'application/javascript', '.gif': 'image/gif', '.jpg': 'image/jpeg', '.jpeg': 'image/jpeg', '.png': 'image/png', '.svg': 'image/svg+xml', '.css': 'text/css', '.html': 'text/html', '.txt': 'text/plain', '.xml': 'text/xml' }; }; Handler.prototype.handle = function(requestPath, request, response) { var handled = false; var resourcePath = this._normalizePath(this.rootPath+requestPath); try { var stat = fs.statSync(resourcePath); if(stat.isFile()) { var contentType = this._getContentType(resourcePath); response.writeHead(200, {'Content-Type': contentType}); this._streamFile(resourcePath, request, response); response.end(); handled = true; } } catch(error) { //console.log(sys.inspect(error)); } return handled; }; Handler.prototype.addContentType = function(extension, contentType) { var key = extension.toLowerCase(); if(!(key in this.contentTypes)) { this.contentTypes[key] = contentType; } } Handler.prototype.removeContentType = function(extension) { var key = extension.toLowerCase(); if(key in this.contentTypes) { delete this.contentTypes[key]; } } Handler.prototype._streamFile = function(resourcePath, request, response) { // todo: do streaming instead of reading in entire file contents at once response.write(fs.readFileSync(resourcePath)); /* var buffer = new Buffer(1024); //console.log(sys.inspect(buffer)); var bytesRead = 0; var position = 0; var fd = fs.openSync(resourcePath, 'r'); if(fd) { while((bytesRead = fs.readSync(fd, buffer, 0, 1024, position)) > 0) { console.log('bytesRead: '+bytesRead+', position: '+position); response.write(buffer.toString('binary', 0, bytesRead)); //response.write(buffer.toString('binary', 0, bytesRead)); //response.write(buffer); position += bytesRead; } fs.closeSync(fd); } */ }; Handler.prototype._getContentType = function(resourcePath) { var contentType = null; var extension = path.extname(resourcePath).toLowerCase(); for(var key in this.contentTypes) { if(extension == key) { contentType = this.contentTypes[key]; break; } } if(contentType == null) { contentType = this.defaultContentType; } return contentType; }; Handler.prototype._normalizePath = function(resourcePath) { segments = resourcePath.split('/'); newSegments = []; for(var i = 0; i < segments.length; i++) { if(segments[i] != '..') { newSegments.push(segments[i]); } } newResourcePath = newSegments.join('/'); return path.normalize(newResourcePath); };
import TTFGlyph from './TTFGlyph'; /** * Represents a TrueType glyph in the WOFF2 format, which compresses glyphs differently. */ export default class WOFF2Glyph extends TTFGlyph { _decode() { // We have to decode in advance (in WOFF2Font), so just return the pre-decoded data. return this._font._transformedGlyphs[this.id]; } _getCBox() { return this.path.bbox; } }
'use strict'; const sinon = require('sinon'); require('sinon-as-promised'); const lruCache = module.exports = sinon.stub(); lruCache.set = sinon.stub(); lruCache.get = sinon.stub(); lruCache.instance = { set: lruCache.set, get: lruCache.get }; lruCache.returns(lruCache.instance);
/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @generated SignedSource<<08d477ab88c659b4aab42c5c9ba5517b>> * @flow * @lightSyntaxTransform * @nogrep */ /* eslint-disable */ 'use strict'; /*:: import type { ConcreteRequest, Query } from 'relay-runtime'; export type RelayModernEnvironmentWithOperationTrackerTest1Query$variables = {| id?: ?string, |}; export type RelayModernEnvironmentWithOperationTrackerTest1Query$data = {| +node: ?{| +id?: string, +body?: ?{| +text: ?string, |}, +comments?: ?{| +edges: ?$ReadOnlyArray<?{| +node: ?{| +id: string, +message: ?{| +text: ?string, |}, |}, |}>, |}, |}, |}; export type RelayModernEnvironmentWithOperationTrackerTest1Query = {| variables: RelayModernEnvironmentWithOperationTrackerTest1Query$variables, response: RelayModernEnvironmentWithOperationTrackerTest1Query$data, |}; */ var node/*: ConcreteRequest*/ = (function(){ var v0 = [ { "defaultValue": null, "kind": "LocalArgument", "name": "id" } ], v1 = [ { "kind": "Variable", "name": "id", "variableName": "id" } ], v2 = { "alias": null, "args": null, "kind": "ScalarField", "name": "id", "storageKey": null }, v3 = [ { "alias": null, "args": null, "kind": "ScalarField", "name": "text", "storageKey": null } ], v4 = { "alias": null, "args": null, "concreteType": "Text", "kind": "LinkedField", "name": "body", "plural": false, "selections": (v3/*: any*/), "storageKey": null }, v5 = { "alias": null, "args": null, "concreteType": "CommentsConnection", "kind": "LinkedField", "name": "comments", "plural": false, "selections": [ { "alias": null, "args": null, "concreteType": "CommentsEdge", "kind": "LinkedField", "name": "edges", "plural": true, "selections": [ { "alias": null, "args": null, "concreteType": "Comment", "kind": "LinkedField", "name": "node", "plural": false, "selections": [ (v2/*: any*/), { "alias": null, "args": null, "concreteType": "Text", "kind": "LinkedField", "name": "message", "plural": false, "selections": (v3/*: any*/), "storageKey": null } ], "storageKey": null } ], "storageKey": null } ], "storageKey": null }, v6 = { "enumValues": null, "nullable": true, "plural": false, "type": "Text" }, v7 = { "enumValues": null, "nullable": true, "plural": false, "type": "String" }, v8 = { "enumValues": null, "nullable": false, "plural": false, "type": "ID" }; return { "fragment": { "argumentDefinitions": (v0/*: any*/), "kind": "Fragment", "metadata": null, "name": "RelayModernEnvironmentWithOperationTrackerTest1Query", "selections": [ { "alias": null, "args": (v1/*: any*/), "concreteType": null, "kind": "LinkedField", "name": "node", "plural": false, "selections": [ { "kind": "InlineFragment", "selections": [ (v2/*: any*/), (v4/*: any*/), (v5/*: any*/) ], "type": "Feedback", "abstractKey": null } ], "storageKey": null } ], "type": "Query", "abstractKey": null }, "kind": "Request", "operation": { "argumentDefinitions": (v0/*: any*/), "kind": "Operation", "name": "RelayModernEnvironmentWithOperationTrackerTest1Query", "selections": [ { "alias": null, "args": (v1/*: any*/), "concreteType": null, "kind": "LinkedField", "name": "node", "plural": false, "selections": [ { "alias": null, "args": null, "kind": "ScalarField", "name": "__typename", "storageKey": null }, (v2/*: any*/), { "kind": "InlineFragment", "selections": [ (v4/*: any*/), (v5/*: any*/) ], "type": "Feedback", "abstractKey": null } ], "storageKey": null } ] }, "params": { "cacheID": "c19e7aa70c9a3d52e213ac58b2caf17f", "id": null, "metadata": { "relayTestingSelectionTypeInfo": { "node": { "enumValues": null, "nullable": true, "plural": false, "type": "Node" }, "node.__typename": { "enumValues": null, "nullable": false, "plural": false, "type": "String" }, "node.body": (v6/*: any*/), "node.body.text": (v7/*: any*/), "node.comments": { "enumValues": null, "nullable": true, "plural": false, "type": "CommentsConnection" }, "node.comments.edges": { "enumValues": null, "nullable": true, "plural": true, "type": "CommentsEdge" }, "node.comments.edges.node": { "enumValues": null, "nullable": true, "plural": false, "type": "Comment" }, "node.comments.edges.node.id": (v8/*: any*/), "node.comments.edges.node.message": (v6/*: any*/), "node.comments.edges.node.message.text": (v7/*: any*/), "node.id": (v8/*: any*/) } }, "name": "RelayModernEnvironmentWithOperationTrackerTest1Query", "operationKind": "query", "text": "query RelayModernEnvironmentWithOperationTrackerTest1Query(\n $id: ID\n) {\n node(id: $id) {\n __typename\n ... on Feedback {\n id\n body {\n text\n }\n comments {\n edges {\n node {\n id\n message {\n text\n }\n }\n }\n }\n }\n id\n }\n}\n" } }; })(); if (__DEV__) { (node/*: any*/).hash = "1b496533e1c1dd63b5800177b6a2c5f4"; } module.exports = ((node/*: any*/)/*: Query< RelayModernEnvironmentWithOperationTrackerTest1Query$variables, RelayModernEnvironmentWithOperationTrackerTest1Query$data, >*/);
"use strict"; /* exported Properties */ var Properties = module.exports = { __proto__: null, //A "align-items" : "flex-start | flex-end | center | baseline | stretch", "align-content" : "flex-start | flex-end | center | space-between | space-around | stretch", "align-self" : "auto | flex-start | flex-end | center | baseline | stretch", "-webkit-align-items" : "flex-start | flex-end | center | baseline | stretch", "-webkit-align-content" : "flex-start | flex-end | center | space-between | space-around | stretch", "-webkit-align-self" : "auto | flex-start | flex-end | center | baseline | stretch", "alignment-adjust" : "auto | baseline | before-edge | text-before-edge | middle | central | after-edge | text-after-edge | ideographic | alphabetic | hanging | mathematical | <percentage> | <length>", "alignment-baseline" : "auto | baseline | use-script | before-edge | text-before-edge | after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | mathematical", "animation" : 1, "animation-delay" : "<time>#", "animation-direction" : "<single-animation-direction>#", "animation-duration" : "<time>#", "animation-fill-mode" : "[ none | forwards | backwards | both ]#", "animation-iteration-count" : "[ <number> | infinite ]#", "animation-name" : "[ none | <single-animation-name> ]#", "animation-play-state" : "[ running | paused ]#", "animation-timing-function" : 1, //vendor prefixed "-moz-animation-delay" : "<time>#", "-moz-animation-direction" : "[ normal | alternate ]#", "-moz-animation-duration" : "<time>#", "-moz-animation-iteration-count" : "[ <number> | infinite ]#", "-moz-animation-name" : "[ none | <single-animation-name> ]#", "-moz-animation-play-state" : "[ running | paused ]#", "-ms-animation-delay" : "<time>#", "-ms-animation-direction" : "[ normal | alternate ]#", "-ms-animation-duration" : "<time>#", "-ms-animation-iteration-count" : "[ <number> | infinite ]#", "-ms-animation-name" : "[ none | <single-animation-name> ]#", "-ms-animation-play-state" : "[ running | paused ]#", "-webkit-animation-delay" : "<time>#", "-webkit-animation-direction" : "[ normal | alternate ]#", "-webkit-animation-duration" : "<time>#", "-webkit-animation-fill-mode" : "[ none | forwards | backwards | both ]#", "-webkit-animation-iteration-count" : "[ <number> | infinite ]#", "-webkit-animation-name" : "[ none | <single-animation-name> ]#", "-webkit-animation-play-state" : "[ running | paused ]#", "-o-animation-delay" : "<time>#", "-o-animation-direction" : "[ normal | alternate ]#", "-o-animation-duration" : "<time>#", "-o-animation-iteration-count" : "[ <number> | infinite ]#", "-o-animation-name" : "[ none | <single-animation-name> ]#", "-o-animation-play-state" : "[ running | paused ]#", "appearance" : "icon | window | desktop | workspace | document | tooltip | dialog | button | push-button | hyperlink | radio | radio-button | checkbox | menu-item | tab | menu | menubar | pull-down-menu | pop-up-menu | list-menu | radio-group | checkbox-group | outline-tree | range | field | combo-box | signature | password | normal | none", "azimuth" : "<azimuth>", //B "backface-visibility" : "visible | hidden", "background" : 1, "background-attachment" : "<attachment>#", "background-clip" : "<box>#", "background-color" : "<color>", "background-image" : "<bg-image>#", "background-origin" : "<box>#", "background-position" : "<bg-position>", "background-repeat" : "<repeat-style>#", "background-size" : "<bg-size>#", "baseline-shift" : "baseline | sub | super | <percentage> | <length>", "behavior" : 1, "binding" : 1, "bleed" : "<length>", "bookmark-label" : "<content> | <attr> | <string>", "bookmark-level" : "none | <integer>", "bookmark-state" : "open | closed", "bookmark-target" : "none | <uri> | <attr>", "border" : "<border-width> || <border-style> || <color>", "border-bottom" : "<border-width> || <border-style> || <color>", "border-bottom-color" : "<color>", "border-bottom-left-radius" : "<x-one-radius>", "border-bottom-right-radius" : "<x-one-radius>", "border-bottom-style" : "<border-style>", "border-bottom-width" : "<border-width>", "border-collapse" : "collapse | separate", "border-color" : "<color>{1,4}", "border-image" : 1, "border-image-outset" : "[ <length> | <number> ]{1,4}", "border-image-repeat" : "[ stretch | repeat | round ]{1,2}", "border-image-slice" : "<border-image-slice>", "border-image-source" : "<image> | none", "border-image-width" : "[ <length> | <percentage> | <number> | auto ]{1,4}", "border-left" : "<border-width> || <border-style> || <color>", "border-left-color" : "<color>", "border-left-style" : "<border-style>", "border-left-width" : "<border-width>", "border-radius" : "<border-radius>", "border-right" : "<border-width> || <border-style> || <color>", "border-right-color" : "<color>", "border-right-style" : "<border-style>", "border-right-width" : "<border-width>", "border-spacing" : "<length>{1,2}", "border-style" : "<border-style>{1,4}", "border-top" : "<border-width> || <border-style> || <color>", "border-top-color" : "<color>", "border-top-left-radius" : "<x-one-radius>", "border-top-right-radius" : "<x-one-radius>", "border-top-style" : "<border-style>", "border-top-width" : "<border-width>", "border-width" : "<border-width>{1,4}", "bottom" : "<margin-width>", "-moz-box-align" : "start | end | center | baseline | stretch", "-moz-box-decoration-break" : "slice | clone", "-moz-box-direction" : "normal | reverse", "-moz-box-flex" : "<number>", "-moz-box-flex-group" : "<integer>", "-moz-box-lines" : "single | multiple", "-moz-box-ordinal-group" : "<integer>", "-moz-box-orient" : "horizontal | vertical | inline-axis | block-axis", "-moz-box-pack" : "start | end | center | justify", "-o-box-decoration-break" : "slice | clone", "-webkit-box-align" : "start | end | center | baseline | stretch", "-webkit-box-decoration-break" : "slice | clone", "-webkit-box-direction" : "normal | reverse", "-webkit-box-flex" : "<number>", "-webkit-box-flex-group" : "<integer>", "-webkit-box-lines" : "single | multiple", "-webkit-box-ordinal-group" : "<integer>", "-webkit-box-orient" : "horizontal | vertical | inline-axis | block-axis", "-webkit-box-pack" : "start | end | center | justify", "box-decoration-break" : "slice | clone", "box-shadow" : "<box-shadow>", "box-sizing" : "content-box | border-box", "break-after" : "auto | always | avoid | left | right | page | column | avoid-page | avoid-column", "break-before" : "auto | always | avoid | left | right | page | column | avoid-page | avoid-column", "break-inside" : "auto | avoid | avoid-page | avoid-column", //C "caption-side" : "top | bottom", "clear" : "none | right | left | both", "clip" : "<shape> | auto", "-webkit-clip-path" : "<clip-source> | <clip-path> | none", "clip-path" : "<clip-source> | <clip-path> | none", "clip-rule" : "nonzero | evenodd", "color" : "<color>", "color-interpolation" : "auto | sRGB | linearRGB", "color-interpolation-filters" : "auto | sRGB | linearRGB", "color-profile" : 1, "color-rendering" : "auto | optimizeSpeed | optimizeQuality", "column-count" : "<integer> | auto", //https://www.w3.org/TR/css3-multicol/ "column-fill" : "auto | balance", "column-gap" : "<length> | normal", "column-rule" : "<border-width> || <border-style> || <color>", "column-rule-color" : "<color>", "column-rule-style" : "<border-style>", "column-rule-width" : "<border-width>", "column-span" : "none | all", "column-width" : "<length> | auto", "columns" : 1, "content" : 1, "counter-increment" : 1, "counter-reset" : 1, "crop" : "<shape> | auto", "cue" : "cue-after | cue-before", "cue-after" : 1, "cue-before" : 1, "cursor" : 1, //D "direction" : "ltr | rtl", "display" : "inline | block | list-item | inline-block | table | inline-table | table-row-group | table-header-group | table-footer-group | table-row | table-column-group | table-column | table-cell | table-caption | grid | inline-grid | run-in | ruby | ruby-base | ruby-text | ruby-base-container | ruby-text-container | contents | none | -moz-box | -moz-inline-block | -moz-inline-box | -moz-inline-grid | -moz-inline-stack | -moz-inline-table | -moz-grid | -moz-grid-group | -moz-grid-line | -moz-groupbox | -moz-deck | -moz-popup | -moz-stack | -moz-marker | -webkit-box | -webkit-inline-box | -ms-flexbox | -ms-inline-flexbox | flex | -webkit-flex | inline-flex | -webkit-inline-flex", "dominant-baseline" : "auto | use-script | no-change | reset-size | ideographic | alphabetic | hanging | mathematical | central | middle | text-after-edge | text-before-edge", "drop-initial-after-adjust" : "central | middle | after-edge | text-after-edge | ideographic | alphabetic | mathematical | <percentage> | <length>", "drop-initial-after-align" : "baseline | use-script | before-edge | text-before-edge | after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | mathematical", "drop-initial-before-adjust" : "before-edge | text-before-edge | central | middle | hanging | mathematical | <percentage> | <length>", "drop-initial-before-align" : "caps-height | baseline | use-script | before-edge | text-before-edge | after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | mathematical", "drop-initial-size" : "auto | line | <length> | <percentage>", "drop-initial-value" : "<integer>", //E "elevation" : "<angle> | below | level | above | higher | lower", "empty-cells" : "show | hide", "enable-background" : 1, //F "fill" : "<paint>", "fill-opacity" : "<opacity-value>", "fill-rule" : "nonzero | evenodd", "filter" : "<filter-function-list> | none", "fit" : "fill | hidden | meet | slice", "fit-position" : 1, "flex" : "<flex>", "flex-basis" : "<width>", "flex-direction" : "row | row-reverse | column | column-reverse", "flex-flow" : "<flex-direction> || <flex-wrap>", "flex-grow" : "<number>", "flex-shrink" : "<number>", "flex-wrap" : "nowrap | wrap | wrap-reverse", "-webkit-flex" : "<flex>", "-webkit-flex-basis" : "<width>", "-webkit-flex-direction" : "row | row-reverse | column | column-reverse", "-webkit-flex-flow" : "<flex-direction> || <flex-wrap>", "-webkit-flex-grow" : "<number>", "-webkit-flex-shrink" : "<number>", "-webkit-flex-wrap" : "nowrap | wrap | wrap-reverse", "-ms-flex" : "<flex>", "-ms-flex-align" : "start | end | center | stretch | baseline", "-ms-flex-direction" : "row | row-reverse | column | column-reverse", "-ms-flex-order" : "<number>", "-ms-flex-pack" : "start | end | center | justify", "-ms-flex-wrap" : "nowrap | wrap | wrap-reverse", "float" : "left | right | none", "float-offset" : 1, "flood-color" : 1, "flood-opacity" : "<opacity-value>", "font" : "<font-shorthand> | caption | icon | menu | message-box | small-caption | status-bar", "font-family" : "<font-family>", "font-feature-settings" : "<feature-tag-value> | normal", "font-kerning" : "auto | normal | none", "font-size" : "<font-size>", "font-size-adjust" : "<number> | none", "font-stretch" : "<font-stretch>", "font-style" : "<font-style>", "font-variant" : "<font-variant> | normal | none", "font-variant-alternates" : "<font-variant-alternates> | normal", "font-variant-caps" : "<font-variant-caps> | normal", "font-variant-east-asian" : "<font-variant-east-asian> | normal", "font-variant-ligatures" : "<font-variant-ligatures> | normal | none", "font-variant-numeric" : "<font-variant-numeric> | normal", "font-variant-position" : "normal | sub | super", "font-weight" : "<font-weight>", //G "glyph-orientation-horizontal" : "<glyph-angle>", "glyph-orientation-vertical" : "auto | <glyph-angle>", "grid" : 1, "grid-area" : 1, "grid-auto-columns" : 1, "grid-auto-flow" : 1, "grid-auto-position" : 1, "grid-auto-rows" : 1, "grid-cell-stacking" : "columns | rows | layer", "grid-column" : 1, "grid-columns" : 1, "grid-column-align" : "start | end | center | stretch", "grid-column-sizing" : 1, "grid-column-start" : 1, "grid-column-end" : 1, "grid-column-span" : "<integer>", "grid-flow" : "none | rows | columns", "grid-layer" : "<integer>", "grid-row" : 1, "grid-rows" : 1, "grid-row-align" : "start | end | center | stretch", "grid-row-start" : 1, "grid-row-end" : 1, "grid-row-span" : "<integer>", "grid-row-sizing" : 1, "grid-template" : 1, "grid-template-areas" : 1, "grid-template-columns" : 1, "grid-template-rows" : 1, //H "hanging-punctuation" : 1, "height" : "<margin-width> | <content-sizing>", "hyphenate-after" : "<integer> | auto", "hyphenate-before" : "<integer> | auto", "hyphenate-character" : "<string> | auto", "hyphenate-lines" : "no-limit | <integer>", "hyphenate-resource" : 1, "hyphens" : "none | manual | auto", //I "icon" : 1, "image-orientation" : "angle | auto", "image-rendering" : "auto | optimizeSpeed | optimizeQuality", "image-resolution" : 1, "ime-mode" : "auto | normal | active | inactive | disabled", "inline-box-align" : "last | <integer>", //J "justify-content" : "flex-start | flex-end | center | space-between | space-around", "-webkit-justify-content" : "flex-start | flex-end | center | space-between | space-around", //K "kerning" : "auto | <length>", //L "left" : "<margin-width>", "letter-spacing" : "<length> | normal", "line-height" : "<line-height>", "line-break" : "auto | loose | normal | strict", "line-stacking" : 1, "line-stacking-ruby" : "exclude-ruby | include-ruby", "line-stacking-shift" : "consider-shifts | disregard-shifts", "line-stacking-strategy" : "inline-line-height | block-line-height | max-height | grid-height", "list-style" : 1, "list-style-image" : "<uri> | none", "list-style-position" : "inside | outside", "list-style-type" : "disc | circle | square | decimal | decimal-leading-zero | lower-roman | upper-roman | lower-greek | lower-latin | upper-latin | armenian | georgian | lower-alpha | upper-alpha | none", //M "margin" : "<margin-width>{1,4}", "margin-bottom" : "<margin-width>", "margin-left" : "<margin-width>", "margin-right" : "<margin-width>", "margin-top" : "<margin-width>", "mark" : 1, "mark-after" : 1, "mark-before" : 1, "marker" : 1, "marker-end" : 1, "marker-mid" : 1, "marker-start" : 1, "marks" : 1, "marquee-direction" : 1, "marquee-play-count" : 1, "marquee-speed" : 1, "marquee-style" : 1, "mask" : 1, "max-height" : "<length> | <percentage> | <content-sizing> | none", "max-width" : "<length> | <percentage> | <content-sizing> | none", "min-height" : "<length> | <percentage> | <content-sizing> | contain-floats | -moz-contain-floats | -webkit-contain-floats", "min-width" : "<length> | <percentage> | <content-sizing> | contain-floats | -moz-contain-floats | -webkit-contain-floats", "move-to" : 1, //N "nav-down" : 1, "nav-index" : 1, "nav-left" : 1, "nav-right" : 1, "nav-up" : 1, //O "object-fit" : "fill | contain | cover | none | scale-down", "object-position" : "<position>", "opacity" : "<opacity-value>", "order" : "<integer>", "-webkit-order" : "<integer>", "orphans" : "<integer>", "outline" : 1, "outline-color" : "<color> | invert", "outline-offset" : 1, "outline-style" : "<border-style>", "outline-width" : "<border-width>", "overflow" : "visible | hidden | scroll | auto", "overflow-style" : 1, "overflow-wrap" : "normal | break-word", "overflow-x" : 1, "overflow-y" : 1, //P "padding" : "<padding-width>{1,4}", "padding-bottom" : "<padding-width>", "padding-left" : "<padding-width>", "padding-right" : "<padding-width>", "padding-top" : "<padding-width>", "page" : 1, "page-break-after" : "auto | always | avoid | left | right", "page-break-before" : "auto | always | avoid | left | right", "page-break-inside" : "auto | avoid", "page-policy" : 1, "pause" : 1, "pause-after" : 1, "pause-before" : 1, "perspective" : 1, "perspective-origin" : 1, "phonemes" : 1, "pitch" : 1, "pitch-range" : 1, "play-during" : 1, "pointer-events" : "auto | none | visiblePainted | visibleFill | visibleStroke | visible | painted | fill | stroke | all", "position" : "static | relative | absolute | fixed", "presentation-level" : 1, "punctuation-trim" : 1, //Q "quotes" : 1, //R "rendering-intent" : 1, "resize" : 1, "rest" : 1, "rest-after" : 1, "rest-before" : 1, "richness" : 1, "right" : "<margin-width>", "rotation" : 1, "rotation-point" : 1, "ruby-align" : 1, "ruby-overhang" : 1, "ruby-position" : 1, "ruby-span" : 1, //S "shape-rendering" : "auto | optimizeSpeed | crispEdges | geometricPrecision", "size" : 1, "speak" : "normal | none | spell-out", "speak-header" : "once | always", "speak-numeral" : "digits | continuous", "speak-punctuation" : "code | none", "speech-rate" : 1, "src" : 1, "stop-color" : 1, "stop-opacity" : "<opacity-value>", "stress" : 1, "string-set" : 1, "stroke" : "<paint>", "stroke-dasharray" : "none | <dasharray>", "stroke-dashoffset" : "<percentage> | <length>", "stroke-linecap" : "butt | round | square", "stroke-linejoin" : "miter | round | bevel", "stroke-miterlimit" : "<miterlimit>", "stroke-opacity" : "<opacity-value>", "stroke-width" : "<percentage> | <length>", "table-layout" : "auto | fixed", "tab-size" : "<integer> | <length>", "target" : 1, "target-name" : 1, "target-new" : 1, "target-position" : 1, "text-align" : "left | right | center | justify | match-parent | start | end", "text-align-last" : 1, "text-anchor" : "start | middle | end", "text-decoration" : "<text-decoration>", "text-emphasis" : 1, "text-height" : 1, "text-indent" : "<length> | <percentage>", "text-justify" : "auto | none | inter-word | inter-ideograph | inter-cluster | distribute | kashida", "text-outline" : 1, "text-overflow" : 1, "text-rendering" : "auto | optimizeSpeed | optimizeLegibility | geometricPrecision", "text-shadow" : 1, "text-transform" : "capitalize | uppercase | lowercase | none", "text-wrap" : "normal | none | avoid", "top" : "<margin-width>", "-ms-touch-action" : "auto | none | pan-x | pan-y | pan-left | pan-right | pan-up | pan-down | manipulation", "touch-action" : "auto | none | pan-x | pan-y | pan-left | pan-right | pan-up | pan-down | manipulation", "transform" : 1, "transform-origin" : 1, "transform-style" : 1, "transition" : 1, "transition-delay" : 1, "transition-duration" : 1, "transition-property" : 1, "transition-timing-function" : 1, //U "unicode-bidi" : "normal | embed | isolate | bidi-override | isolate-override | plaintext", "user-modify" : "read-only | read-write | write-only", "user-select" : "none | text | toggle | element | elements | all", //V "vertical-align" : "auto | use-script | baseline | sub | super | top | text-top | central | middle | bottom | text-bottom | <percentage> | <length>", "visibility" : "visible | hidden | collapse", "voice-balance" : 1, "voice-duration" : 1, "voice-family" : 1, "voice-pitch" : 1, "voice-pitch-range" : 1, "voice-rate" : 1, "voice-stress" : 1, "voice-volume" : 1, "volume" : 1, //W "white-space" : "normal | pre | nowrap | pre-wrap | pre-line | -pre-wrap | -o-pre-wrap | -moz-pre-wrap | -hp-pre-wrap", // https://perishablepress.com/wrapping-content/ "white-space-collapse" : 1, "widows" : "<integer>", "width" : "<length> | <percentage> | <content-sizing> | auto", "will-change" : "<will-change>", "word-break" : "normal | keep-all | break-all", "word-spacing" : "<length> | normal", "word-wrap" : "normal | break-word", "writing-mode" : "horizontal-tb | vertical-rl | vertical-lr | lr-tb | rl-tb | tb-rl | bt-rl | tb-lr | bt-lr | lr-bt | rl-bt | lr | rl | tb", //Z "z-index" : "<integer> | auto", "zoom" : "<number> | <percentage> | normal" };
var assert = require('assert'); var sodium = require('../build/Release/sodium'); var assert = require('assert'); describe("AEAD", function () { it("aes256gcm should encrypt and decrypt to the same string", function (done) { var message = Buffer.from("This is a plain text message"); var additionalData = Buffer.from("this is metadata"); var nonce = Buffer.allocUnsafe(sodium.crypto_aead_aes256gcm_NPUBBYTES); sodium.randombytes_buf(nonce); var key = Buffer.allocUnsafe(sodium.crypto_aead_aes256gcm_KEYBYTES); sodium.randombytes_buf(key); // If CPU does not support AES256gcm don't test if( !sodium.crypto_aead_aes256gcm_is_available() ) { console.log('AES 256 gcm not supported by CPU'); done(); return; } // Encrypt data var cipherText = sodium.crypto_aead_aes256gcm_encrypt(message, additionalData, nonce, key); // Decrypt Data var plainText = sodium.crypto_aead_aes256gcm_decrypt(cipherText, additionalData, nonce, key); // Test equality assert(sodium.compare(plainText, message)==0); done(); }); it("aes256gcm should encrypt and decrypt to the same string with null additional data", function (done) { var message = Buffer.from("This is a plain text message"); var additionalData = Buffer.from("this is metadata"); var nonce = Buffer.allocUnsafe(sodium.crypto_aead_aes256gcm_NPUBBYTES); sodium.randombytes_buf(nonce); var key = Buffer.allocUnsafe(sodium.crypto_aead_aes256gcm_KEYBYTES); sodium.randombytes_buf(key); // If CPU does not support AES256gcm don't test if( !sodium.crypto_aead_aes256gcm_is_available() ) { console.log('AES 256 gcm not supported by CPU'); done(); return; } // Encrypt data var cipherText = sodium.crypto_aead_aes256gcm_encrypt(message, null, nonce, key); // Decrypt Data var plainText = sodium.crypto_aead_aes256gcm_decrypt(cipherText, null, nonce, key); // Test equality assert(sodium.compare(plainText, message)==0); done(); }); it("chacha20poly1305 should encrypt and decrypt to the same string", function (done) { var message = Buffer.from("This is a plain text message"); var additionalData = Buffer.from("this is metadata"); var nonce = Buffer.allocUnsafe(sodium.crypto_aead_chacha20poly1305_NPUBBYTES); sodium.randombytes_buf(nonce); var key = Buffer.allocUnsafe(sodium.crypto_aead_chacha20poly1305_KEYBYTES); sodium.randombytes_buf(key); // Encrypt data var cipherText = sodium.crypto_aead_chacha20poly1305_encrypt(message, additionalData, nonce, key); // Decrypt Data var plainText = sodium.crypto_aead_chacha20poly1305_decrypt(cipherText, additionalData, nonce, key); // Test equality assert(sodium.compare(plainText, message)==0); done(); }); it("chacha20poly1305 should encrypt and decrypt to the same string with null additional data", function (done) { var message = Buffer.from("This is a plain text message"); var nonce = Buffer.allocUnsafe(sodium.crypto_aead_chacha20poly1305_NPUBBYTES); sodium.randombytes_buf(nonce); var key = Buffer.allocUnsafe(sodium.crypto_aead_chacha20poly1305_KEYBYTES); sodium.randombytes_buf(key); // Encrypt data var cipherText = sodium.crypto_aead_chacha20poly1305_encrypt(message, null, nonce, key); // Decrypt Data var plainText = sodium.crypto_aead_chacha20poly1305_decrypt(cipherText, null, nonce, key); // Test equality assert(sodium.compare(plainText, message)==0); done(); }); it("chacha20poly1305_ietf should encrypt and decrypt to the same string", function (done) { var message = Buffer.from("This is a plain text message"); var additionalData = Buffer.from("this is metadata"); var nonce = Buffer.allocUnsafe(sodium.crypto_aead_chacha20poly1305_ietf_NPUBBYTES); sodium.randombytes_buf(nonce); var key = Buffer.allocUnsafe(sodium.crypto_aead_chacha20poly1305_ietf_KEYBYTES); sodium.randombytes_buf(key); // Encrypt data var cipherText = sodium.crypto_aead_chacha20poly1305_ietf_encrypt(message, additionalData, nonce, key); // Decrypt Data var plainText = sodium.crypto_aead_chacha20poly1305_ietf_decrypt(cipherText, additionalData, nonce, key); // Test equality assert(sodium.compare(plainText, message)==0); done(); }); it("chacha20poly1305_ietf should encrypt and decrypt to the same string with null additional data", function (done) { var message = Buffer.from("This is a plain text message"); var nonce = Buffer.allocUnsafe(sodium.crypto_aead_chacha20poly1305_ietf_NPUBBYTES); sodium.randombytes_buf(nonce); var key = Buffer.allocUnsafe(sodium.crypto_aead_chacha20poly1305_ietf_KEYBYTES); sodium.randombytes_buf(key); // Encrypt data var cipherText = sodium.crypto_aead_chacha20poly1305_ietf_encrypt(message, null, nonce, key); // Decrypt Data var plainText = sodium.crypto_aead_chacha20poly1305_ietf_decrypt(cipherText, null, nonce, key); // Test equality assert(sodium.compare(plainText, message)==0); done(); }); it("aes256gcm should encrypt and decrypt to the same string detached", function (done) { var message = Buffer.from("This is a plain text message"); var additionalData = Buffer.from("this is metadata"); var nonce = Buffer.allocUnsafe(sodium.crypto_aead_aes256gcm_NPUBBYTES); sodium.randombytes_buf(nonce); var key = Buffer.allocUnsafe(sodium.crypto_aead_aes256gcm_KEYBYTES); sodium.randombytes_buf(key); // If CPU does not support AES256gcm don't test if( !sodium.crypto_aead_aes256gcm_is_available() ) { console.log('AES 256 gcm not supported by CPU'); done(); return; } // Encrypt data var c = sodium.crypto_aead_aes256gcm_encrypt_detached(message, additionalData, nonce, key); // Decrypt Data var plainText = sodium.crypto_aead_aes256gcm_decrypt_detached(c.cipherText, c.mac, additionalData, nonce, key); // Test equality assert(sodium.compare(plainText, message)==0); done(); }); it("chacha20poly1305 should encrypt and decrypt to the same string detached", function (done) { var message = Buffer.from("This is a plain text message"); var additionalData = Buffer.from("this is metadata"); var nonce = Buffer.allocUnsafe(sodium.crypto_aead_chacha20poly1305_NPUBBYTES); sodium.randombytes_buf(nonce); var key = Buffer.allocUnsafe(sodium.crypto_aead_chacha20poly1305_KEYBYTES); sodium.randombytes_buf(key); // Encrypt data var c = sodium.crypto_aead_chacha20poly1305_encrypt_detached(message, additionalData, nonce, key); // Decrypt Data var plainText = sodium.crypto_aead_chacha20poly1305_decrypt_detached(c.cipherText, c.mac, additionalData, nonce, key); // Test equality assert(sodium.compare(plainText, message)==0); done(); }); it("chacha20poly1305_ietf should encrypt and decrypt to the same string detached", function (done) { var message = Buffer.from("This is a plain text message"); var additionalData = Buffer.from("this is metadata"); var nonce = Buffer.allocUnsafe(sodium.crypto_aead_chacha20poly1305_ietf_NPUBBYTES); sodium.randombytes_buf(nonce); var key = Buffer.allocUnsafe(sodium.crypto_aead_chacha20poly1305_ietf_KEYBYTES); sodium.randombytes_buf(key); // Encrypt data var c = sodium.crypto_aead_chacha20poly1305_ietf_encrypt_detached(message, additionalData, nonce, key); // Decrypt Data var plainText = sodium.crypto_aead_chacha20poly1305_ietf_decrypt_detached(c.cipherText, c.mac, additionalData, nonce, key); // Test equality assert(sodium.compare(plainText, message)==0); done(); }); }); describe("AEAD Precompute Interface", function () { it("aes256gcm should encrypt and decrypt to the same string", function (done) { var message = Buffer.from("This is a plain text message"); var additionalData = Buffer.from("this is metadata"); var nonce = Buffer.allocUnsafe(sodium.crypto_aead_aes256gcm_NPUBBYTES); sodium.randombytes_buf(nonce); var key = Buffer.allocUnsafe(sodium.crypto_aead_aes256gcm_KEYBYTES); sodium.randombytes_buf(key); var ctx = sodium.crypto_aead_aes256gcm_beforenm(key); // If CPU does not support AES256gcm don't test if( !sodium.crypto_aead_aes256gcm_is_available() ) { console.log('AES 256 gcm not supported by CPU'); done(); return; } // Encrypt data var cipherText = sodium.crypto_aead_aes256gcm_encrypt_afternm(message, additionalData, nonce, ctx); // Decrypt Data var plainText = sodium.crypto_aead_aes256gcm_decrypt_afternm(cipherText, additionalData, nonce, ctx); // Test equality assert(sodium.compare(plainText, message)==0); done(); }); it("aes256gcm should encrypt and decrypt to the same string with null additional data", function (done) { var message = Buffer.from("This is a plain text message"); var additionalData = Buffer.from("this is metadata"); var nonce = Buffer.allocUnsafe(sodium.crypto_aead_aes256gcm_NPUBBYTES); sodium.randombytes_buf(nonce); var key = Buffer.allocUnsafe(sodium.crypto_aead_aes256gcm_KEYBYTES); sodium.randombytes_buf(key); var ctx = sodium.crypto_aead_aes256gcm_beforenm(key); // If CPU does not support AES256gcm don't test if( !sodium.crypto_aead_aes256gcm_is_available() ) { console.log('AES 256 gcm not supported by CPU'); done(); return; } // Encrypt data var cipherText = sodium.crypto_aead_aes256gcm_encrypt_afternm(message, null, nonce, ctx); // Decrypt Data var plainText = sodium.crypto_aead_aes256gcm_decrypt_afternm(cipherText, null, nonce, ctx); // Test equality assert(sodium.compare(plainText, message)==0); done(); }); it("aes256gcm should encrypt and decrypt to the same string detached", function (done) { var message = Buffer.from("This is a plain text message"); var additionalData = Buffer.from("this is metadata"); var nonce = Buffer.allocUnsafe(sodium.crypto_aead_aes256gcm_NPUBBYTES); sodium.randombytes_buf(nonce); var key = Buffer.allocUnsafe(sodium.crypto_aead_aes256gcm_KEYBYTES); sodium.randombytes_buf(key); var ctx = sodium.crypto_aead_aes256gcm_beforenm(key); // If CPU does not support AES256gcm don't test if( !sodium.crypto_aead_aes256gcm_is_available() ) { console.log('AES 256 gcm not supported by CPU'); done(); return; } // Encrypt data var c = sodium.crypto_aead_aes256gcm_encrypt_detached_afternm(message, additionalData, nonce, ctx); // Decrypt Data var plainText = sodium.crypto_aead_aes256gcm_decrypt_detached_afternm(c.cipherText, c.mac, additionalData, nonce, ctx); // Test equality assert(sodium.compare(plainText, message)==0); done(); }); });
(function($, undefined) { $.KBWidget({ name: 'kbaseNarrativeCellMenu', parent: 'kbaseWidget', options: {cell: null}, init: function(options) { this._super(options); // console.log(['cell menu', this.options.cell]); var $deleteBtn = $('<button type="button" class="btn btn-default btn-xs" data-toggle="tooltip" data-placement="left" Title="Delete Cell">') .css({"background-color": "transparent"}) .append($('<span class="fa fa-trash-o" style="font-size:14pt; padding-left: 5px;">')) .click($.proxy(function() { this.trigger('deleteCell.Narrative', IPython.notebook.get_selected_index()); }, this)); var $btn = $('<button type="button" data-toggle="dropdown" aria-haspopup="true" class="btn btn-default btn-xs">') .css({"background-color": "transparent"}) .append($('<span class="fa fa-cog" style="font-size:14pt">')); this.$menu = $('<ul>') .addClass('dropdown-menu') .css({ 'right' : '0', 'left' : 'auto', 'margin' : '0' }); if (window.kbconfig && window.kbconfig.mode === "debug") { this.addMenuItem({ icon: 'fa fa-code', text: 'View Job Submission', action: function() { var metadata = IPython.notebook.get_selected_cell().metadata; var stackTrace = []; if (metadata['kb-cell'] && metadata['kb-cell']['stackTrace']) stackTrace = metadata['kb-cell']['stackTrace']; console.log(stackTrace); var cell = IPython.notebook.insert_cell_below('code'); if (stackTrace instanceof Array) { cell.set_text('job_info=' + stackTrace[stackTrace.length - 1] + '\njob_info'); IPython.notebook.get_selected_cell().execute(); } else { cell.set_text('job_info=' + stackTrace); } } }); } this.addMenuItem({ icon: 'fa fa-arrow-up', text: 'Move Cell Up', action: function() { IPython.notebook.move_cell_up(); } }); this.addMenuItem({ icon: 'fa fa-arrow-down', text: 'Move Cell Down', action: function() { IPython.notebook.move_cell_down(); } }); this.addMenuItem({ icon: 'fa fa-caret-square-o-up', text: 'Insert Cell Above', action: function() { var cell = IPython.notebook.insert_cell_above('markdown'); } }); this.addMenuItem({ icon: 'fa fa-caret-square-o-down', text: 'Insert Cell Below', action: function() { var cell = IPython.notebook.insert_cell_below('markdown'); } }); // if (this.options.cell && this.options.cell.metadata['kb-cell'] === undefined) { // this.addMenuItem({ // icon: 'fa fa-terminal', // text: 'Toggle Cell Type', // action: function() { // if (this.options.cell.cell_type === "markdown") { // IPython.notebook.to_code(); // } // else { // } // }, // disable: true // }); // } this.addMenuItem({ icon: 'fa fa-trash-o', text: 'Delete Cell', action: $.proxy(function() { this.trigger('deleteCell.Narrative', IPython.notebook.get_selected_index()); }, this) }); // this shows whether the app is running this.$runningIcon = $("<span>").addClass("fa fa-circle-o-notch fa-spin") .css({"color": "rgb(42,121,191)"}) .hide(); // this shows on error this.$errorIcon = $("<span>").addClass("fa fa-exclamation-triangle") .css({"color": "red"}) .hide(); this.$elem.append( $('<span>') .append(this.$runningIcon) .append(this.$errorIcon) .append($deleteBtn) .append($('<span class="dropdown">') .append($btn) .append(this.$menu))); $deleteBtn.tooltip(); return this; }, addMenuItem: function(item) { var label = ''; if (item.icon) label += '<span class="' + item.icon +'"></span> '; if (item.text) label += ' ' + item.text; var $item = $('<a>') .append(label) .click($.proxy(function(event) { event.preventDefault(); event.stopPropagation(); if (!item.disable) { if (item.action) item.action(); this.$menu.dropdown('toggle'); } }, this)); var $itemElem = $('<li>').append($item); if (item.disable) $itemElem.addClass('disabled'); this.$menu.append($itemElem); }, }); })( jQuery );
var Deferred = require("promised-io/promise").Deferred; module.exports = function(conf, log4js) { var logger = log4js.getLogger("prepare"); var deferred = new Deferred(); return function preServerStart() { logger.info('Any setup before server start here'); deferred.resolve(); // do this in the callback of any async operation, like a file read. // deferred.reject(); in case of error return deferred.promise; }; };
// flow-typed signature: 5934458d8287c23337a0363563a548f9 // flow-typed version: b77688cf5d/@babel/register_v7.x.x/flow_>=v0.30.x declare module '@babel/register' { declare type Ignore = boolean | string | RegExp | (filename: string) => boolean; declare type Options = {| ast?: boolean, auxiliaryCommentAfter?: ?string, auxiliaryCommentBefore?: ?string, babelrc?: boolean, code?: boolean, comments?: boolean, compact?: 'auto' | boolean, configFile?: string | boolean, env?: Object, extends?: ?string, extensions?: Array<string>, filename?: string, filenameRelative?: string, generatorOpts?: Object, getModuleId?: void | null | (moduleName: string) => string, highlightCode?: boolean, ignore?: Ignore | Array<Ignore>, inputSourceMap?: Object, minified?: boolean, moduleId?: string, moduleIds?: boolean, moduleRoot?: string, only?: RegExp, parserOpts?: Object, plugins?: Array<[string, Object] | string>, presets?: Array<string>, retainLines?: boolean, resolveModuleSource?: null | (source: string, filename: string) => boolean, shouldPrintComment?: null | (commentContents: string) => string, sourceFileName?: string, sourceMaps?: boolean | 'inline' | 'both', sourceMapTarget?: string, sourceRoot?: string, sourceType?: 'script' | 'module', wrapPluginVisitorMethod?: null | (pluginAlias: string, visitorType: string, callback: Function) => boolean, extensions?: Array<string>, cache?: boolean, |}; declare module.exports: (options?: Options) => void; }