text
stringlengths
2
6.14k
const router = require('express').Router(); const {Forum, Post} = require('../database'); router.get('/', (req, res) => { return Forum.findAll(req.query) .then(forums => { res.json({results: forums}); }) .catch(err => { res.status(500).send(err.message); }); }); router.get('/:forum', (req, res) => { return Forum.read({id: req.params.forum}) .then(forum => { if (forum) { res.json({results: forum.toJSON()}); } else { res.status(400).send('Forum doesn\'t exist'); } }) .catch(err => { res.status(500).send(err.message); }); }); router.get('/:forum/posts/:post', (req, res) => { Post.read({id: req.params.post}) .then(post => { if (post) { res.json(post); } else { res.status(400).send('Post does not exist'); } }); }); router.get('/:forum/posts', (req, res) => { Post.model.findAll({ where: {forumId: req.params.forum} }) .then(forum => { if (forum) { res.json({results: forum}); } else { throw new Error('Forum does not exist'); } }) .catch(err => { console.log(err); res.status(500).send(err.message); }); }); // Validation middleware goes here router.post('/:forum/posts/:post', (req, res) => { Post.update({id: req.params.post}, req.body) .then(post => { if (post) { res.json(post); } else { res.status(400).send('Post does not exist'); } }) .catch(err => { res.status(400).send('Post does not exist'); }); }); router.delete('/:forum/posts/:post', (req, res) => { Post.delete({id: req.params.post}) .then(post => { if (post) { res.json(post); } else { res.status(400).send('Post does not exist'); } }) .catch(err => { res.status(400).send('Post does not exist'); }); }); router.post('/:forum/posts', (req, res) => { Forum.read({id: req.params.forum}) .then( forum => { let forumId = req.params.forum; let userId = req.body.userId; let title = req.body.title; let body = req.body.body; let upvotes = 0; let downvotes = 0; let pinned = false; if (forum) { return Post.create({title, body, upvotes, downvotes, pinned, userId, forumId}); } else { throw new Error('Forum does not exist'); } }) .then( post => { res.status(201).json(post); }) .catch(err => { res.status(500).send(err.message); }); }); router.post('/', (req, res) => { return Forum.create(req.body) .then(forum => { res.status(201).json(forum); }) .catch(err => { res.status(500).send(err.message); }); }); router.post('/:forum', (req, res) => { Forum.update({id: req.params.forum}, req.body) .spread(affected => { if (affected) { res.sendStatus(202); } else { res.status(400).send('Forum doesn\'t exist'); } }) .catch(err => { res.status(500).send(err.message); }); }); router.delete('/:forum', (req, res) => { Forum.delete({id: req.params.forum}) .then(affected => { if (affected) { res.sendStatus(202); } else { res.status(400).send('Forum doesn\'t exist'); } }) .catch(err => { res.status(500).send(err.message); }); }); module.exports = router;
'use strict'; module.exports = function(driver, connectorSpec) { connectorSpec.shouldBehaveLikeMusicSite(driver, { url: 'https://plug.dj/tastycat/' }); };
var ParticleUtils = require('../particles/ParticleUtils'); var Vector3 = require('../math/Vector3'); var Vector4 = require('../math/Vector4'); var MeshData = require('../renderer/MeshData'); var calcVec = new Vector3(); /** * Data object tracking a single particle in a particle component */ function Particle(particleComponent, index) { this.alive = false; this.position = new Vector3(); this.velocity = new Vector3(); this.lifeSpan = 0; this.parent = particleComponent; this.age = 0; this.index = index; this.color = new Vector4(1, 0, 0, 1); this.size = 0.0; this.spin = 0.0; this.mass = 1.0; this.emitter = null; this.uvIndex = 0; this.lastUVIndex = -1; this.bbX = new Vector3(); this.bbY = new Vector3(); this.lastColor = new Vector4(); } /** * Called by the particle system to 'respawn' this particle * @private * @param emitter */ Particle.prototype.respawnParticle = function (emitter) { this.emitter = emitter; this.lifeSpan = emitter.nextParticleLifeSpan(); this.alive = true; this.age = 0; }; var tmpArray = []; /** * Called by the particle system each frame to update the position and other properties of the particle * @private * @param tpf * @param particleEntity */ Particle.prototype.update = function (tpf, particleEntity) { if (!this.alive) { return; } this.age += tpf; if (this.age > this.lifeSpan) { this.kill(); return; } this.position.addDirect(this.velocity.x * tpf, this.velocity.y * tpf, this.velocity.z * tpf); // set values from component timeline ParticleUtils.applyTimeline(this, this.emitter && this.emitter.timeline ? this.emitter.timeline : this.parent.timeline); // apply current color to mesh if (!this.lastColor.equals(this.color)) { var colorBuffer = this.parent.meshData.getAttributeBuffer(MeshData.COLOR); var offset = this.index * 16; colorBuffer[offset + 0 + 0] = this.color.r; colorBuffer[offset + 0 + 1] = this.color.g; colorBuffer[offset + 0 + 2] = this.color.b; colorBuffer[offset + 0 + 3] = this.color.a; colorBuffer[offset + 4 + 0] = this.color.r; colorBuffer[offset + 4 + 1] = this.color.g; colorBuffer[offset + 4 + 2] = this.color.b; colorBuffer[offset + 4 + 3] = this.color.a; colorBuffer[offset + 8 + 0] = this.color.r; colorBuffer[offset + 8 + 1] = this.color.g; colorBuffer[offset + 8 + 2] = this.color.b; colorBuffer[offset + 8 + 3] = this.color.a; colorBuffer[offset + 12 + 0] = this.color.r; colorBuffer[offset + 12 + 1] = this.color.g; colorBuffer[offset + 12 + 2] = this.color.b; colorBuffer[offset + 12 + 3] = this.color.a; this.lastColor.set(this.color); } // determine our particle plane if (this.emitter) { this.emitter.getParticleBillboardVectors(this, particleEntity); } if (this.spin === 0) { this.bbX.scale(this.size); this.bbY.scale(this.size); } else { var cA = Math.cos(this.spin) * this.size; var sA = Math.sin(this.spin) * this.size; var upX = this.bbY.x, upY = this.bbY.y, upZ = this.bbY.z; this.bbY.set(this.bbX); this.bbX.scale(cA).addDirect(upX * sA, upY * sA, upZ * sA); this.bbY.scale(-sA).addDirect(upX * cA, upY * cA, upZ * cA); } // apply billboard vectors to mesh verts var vertexBuffer = this.parent.meshData.getAttributeBuffer(MeshData.POSITION); var offset = this.index * 12; // bottom right point calcVec.set(this.position).sub(this.bbX).sub(this.bbY); vertexBuffer[offset + 0 + 0] = calcVec.x; vertexBuffer[offset + 0 + 1] = calcVec.y; vertexBuffer[offset + 0 + 2] = calcVec.z; // top right point calcVec.set(this.position).sub(this.bbX).add(this.bbY); vertexBuffer[offset + 3 + 0] = calcVec.x; vertexBuffer[offset + 3 + 1] = calcVec.y; vertexBuffer[offset + 3 + 2] = calcVec.z; // top left point calcVec.set(this.position).add(this.bbX).add(this.bbY); vertexBuffer[offset + 6 + 0] = calcVec.x; vertexBuffer[offset + 6 + 1] = calcVec.y; vertexBuffer[offset + 6 + 2] = calcVec.z; // bottom left corner calcVec.set(this.position).add(this.bbX).sub(this.bbY); vertexBuffer[offset + 9 + 0] = calcVec.x; vertexBuffer[offset + 9 + 1] = calcVec.y; vertexBuffer[offset + 9 + 2] = calcVec.z; if (this.lastUVIndex !== this.uvIndex) { var uvBuffer = this.parent.meshData.getAttributeBuffer(MeshData.TEXCOORD0); var uIndex = (this.uvIndex % this.parent.uRange) / this.parent.uRange; var vIndex = 1.0 - (Math.floor(this.uvIndex / this.parent.vRange) / this.parent.vRange); var uDelta = 1.0 / this.parent.uRange; var vDelta = 1.0 / this.parent.vRange; //! AT: why go through this array?! there's only 2 values; what's the point? tmpArray[0] = uIndex + uDelta; tmpArray[1] = vIndex - vDelta; uvBuffer.set(tmpArray, this.index * 8 + 0); tmpArray[0] = uIndex + uDelta; tmpArray[1] = vIndex; uvBuffer.set(tmpArray, this.index * 8 + 2); tmpArray[0] = uIndex; tmpArray[1] = vIndex; uvBuffer.set(tmpArray, this.index * 8 + 4); tmpArray[0] = uIndex; tmpArray[1] = vIndex - vDelta; uvBuffer.set(tmpArray, this.index * 8 + 6); this.lastUVIndex = this.uvIndex; } }; /** * Called by update to mark this particle as dead/reusable * @private */ Particle.prototype.kill = function () { this.alive = false; // collapse particle to a single point, effectively hiding it from view. var vertexBuffer = this.parent.meshData.getAttributeBuffer(MeshData.POSITION); var pointA = vertexBuffer.subarray(this.index * 12, this.index * 12 + 3); vertexBuffer.set(pointA, this.index * 12 + 3); vertexBuffer.set(pointA, this.index * 12 + 6); vertexBuffer.set(pointA, this.index * 12 + 9); }; module.exports = Particle;
import createSvgIcon from './utils/createSvgIcon'; import { jsx as _jsx } from "react/jsx-runtime"; export default createSvgIcon( /*#__PURE__*/_jsx("path", { d: "M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4z" }), 'HelpOutlineSharp');
version https://git-lfs.github.com/spec/v1 oid sha256:0fd9694c7d2a9affe9d3e78b8f392367ba9bd9db66a26cd7ef4f7ab448f26ce2 size 2326
import request from 'supertest' import expect from 'expect' import createServer from 'Server/server' import User from 'Server/models/User' import { USER_TYPE_USER } from 'Server/constants' describe('UserController', () => { describe('GET /api/users', () => { it('should return 401 Unauthorized when an user has not logged in', (done) => { request(createServer()) .get('/api/users') .expect(401, done) }) it('should return 401 Unauthorized when an user is not of admin type', (done) => { const server = createServer([(req, res, next) => { req.user = { // eslint-disable-line no-param-reassign id: 'some-user-id', isAdmin: () => false, } next() }]) request(server) .get('/api/users') .expect(401, done) }) it('should return 200 OK', (done) => { const server = createServer([(req, res, next) => { req.user = { // eslint-disable-line no-param-reassign id: 'some-user-id', isAdmin: () => true, } next() }]) request(server) .get('/api/users') .expect(200, done) }) }) describe('POST /api/users', () => { let serverInstance before(() => { const server = createServer([(req, res, next) => { req.user = { // eslint-disable-line no-param-reassign id: 'some-user-id', isAdmin: () => true, } next() }]) serverInstance = request(server) }) it('should return 400 Bad Request when parameters are missing', (done) => { serverInstance .post('/api/users') .expect(400, done) }) it('should return 400 Bad Request when an user type is invalid', (done) => { serverInstance .post('/api/users') .send({ username: 'username', password: 'password', type: 'invalid-user-type', }) .expect(400, done) }) it('should return 400 Bad Request when an username already exists', (done) => { User.findOne = (query, cb) => { cb(null, true) } serverInstance .post('/api/users') .send({ username: 'username', password: 'password', type: USER_TYPE_USER, }) .expect(400, done) }) it('should return 200 OK after adding a new user', (done) => { User.findOne = (query, cb) => { cb(null, false) } User.prototype.save = (cb) => { cb(null) } serverInstance .post('/api/users') .send({ username: 'username', password: 'password', type: USER_TYPE_USER, }) .expect(200, done) }) }) describe('GET /api/users/:id', () => { let serverInstance before(() => { const server = createServer([(req, res, next) => { req.user = { // eslint-disable-line no-param-reassign id: 'some-user-id', isAdmin: () => true, } next() }]) serverInstance = request(server) }) it('should return 400 Bad Request when there is no user with ID', (done) => { User.findById = (id, cb) => { cb(null, false) } serverInstance .get('/api/users/some-user-id') .expect(400, done) }) it('should return 200 OK with user details', (done) => { const user = { _id: 'some-user-id', username: 'username', type: USER_TYPE_USER, createdAt: 'some-date-time', } User.findById = (id, cb) => { cb(null, user) } serverInstance .get('/api/users/some-user-id') .expect(200) .end((err, response) => { if (err) { return done(err) } expect(response.body).toEqual(user) return done() }) }) }) describe('PUT /api/users/:id', () => { let serverInstance before(() => { const server = createServer([(req, res, next) => { req.user = { // eslint-disable-line no-param-reassign id: 'some-user-id', isAdmin: () => true, } next() }]) serverInstance = request(server) }) it('should return 400 Bad Request when parameters are missing', (done) => { serverInstance .put('/api/users/some-user-id') .expect(400, done) }) it('should return 400 Bad Request when an user type is invalid', (done) => { serverInstance .put('/api/users/some-user-id') .send({ password: 'password', type: 'invalid-user-type', }) .expect(400, done) }) it('should return 200 OK with updated user details', (done) => { const user = { _id: 'some-user-id', username: 'username', type: USER_TYPE_USER, createdAt: 'some-date-time', } User.findOneAndUpdate = (query, payload, options, cb) => { cb(null, user) } serverInstance .put('/api/users/some-user-id') .send({ username: 'username', password: 'password', type: USER_TYPE_USER, }) .expect(200) .end((err, response) => { if (err) { return done(err) } expect(response.body).toEqual(user) return done() }) }) }) describe('DELETE /api/users/:id', () => { let serverInstance before(() => { const server = createServer([(req, res, next) => { req.user = { // eslint-disable-line no-param-reassign id: 'some-user-id', isAdmin: () => true, } next() }]) serverInstance = request(server) }) it('should return 200 OK after deleting user', (done) => { serverInstance .delete('/api/users/some-user-id') .expect(200, done) }) }) })
/** * View * * If we need to render the output to a * different data type, this is how we * tell the server strategy what to user. */ /* Node modules */ /* Third-party modules */ import { Base } from '@steeplejack/core'; /* Files */ class View extends Base { constructor ({ data, headers, statusCode, template } = {}) { super(); this.data = data || {}; this.headers = headers || {}; this.statusCode = statusCode || null; this.template = template || null; } /** * Get Headers * * Returns the headers * * @returns {object} */ getHeaders () { return this.headers; } /** * Get Render Data * * Gets the render data * * @returns {object} */ getRenderData () { return this.data; } /** * Get Status Code * * Gets the status code * * @returns {number} */ getStatusCode () { return this.statusCode; } /** * Get Render Template * * Gets the template to render to * * @returns {string} */ getRenderTemplate () { return this.template; } /** * Render * * Factory to create a View object * * @param {string} template * @param {*} data * @param {number} statusCode * @param {*} headers * @returns {View} */ static render (template, data, statusCode = null, headers = {}) { return new View({ data, headers, statusCode, template, }); } } module.exports = View;
/** * App Error Messages * * React Native Starter App * https://github.com/mcnamee/react-native-starter-app */ export default { // Defaults default: 'Hmm, an unknown error occured', timeout: 'Server Timed Out. Check your internet connection', invalidJson: 'Response returned is not valid JSON', };
// positive integers var numberStart = { start: '0', end: '9' } module.exports.number = function (/* handler */) { var args = this._helper_setArguments([], arguments, 'number') if (!args) return this var handler = args[0] // function numberDone (token, idx, type) { // // If called, token is always a valid number // handler(Number(token), idx, type) // } // return this._helper_word(numberStart, numberDone) var atok = this var resetMarkedOffset = false // First helper to set the markedOffset value? var running = false // Current helper running var result var props = atok.getProps() var isQuiet = props.quiet var isIgnored = props.ignore function number_start () { running = true // Prevent buffer slicing by atok resetMarkedOffset = (atok.markedOffset < 0) if (resetMarkedOffset) atok.markedOffset = atok.offset } function number_check () { result = Number( atok.slice(atok.markedOffset, atok.offset) ) return isFinite(result) ? 0 : -1 } function number_done () { running = false if (!isIgnored) handler( isQuiet ? atok.offset - atok.markedOffset : result , -1 , null ) if (resetMarkedOffset) atok.markedOffset = -1 } function number_end () { if (running && number_check() >= 0) number_done() } if (!isIgnored) atok.once('end', number_end) return atok .groupRule(true) // Match / no match .ignore().quiet(true).break().next() .continue( 0, this._helper_continueFailure(props, 2, 0) ) .addRule(numberStart, number_start) // 123 // ^^^ .continue(-1).ignore(true) .addRule(numberStart, 'number-value') // Number parsed, reset the properties except ignore and quiet .setProps(props).ignore().quiet(true) .continue( this._helper_continueSuccess(props, 0, -2) , this._helper_continueFailure(props, 0, -2) ) .addRule(number_check, !isQuiet && number_done) .addRule(isQuiet && number_done) .setProps(props) .groupRule() }
/** * Module dependencies */ var fs = require('fs'); var path = require('path'); Schema = require('./lib/schema').Schema; exports.Schema = Schema; exports.AbstractClass = require('./lib/abstract-class').AbstractClass; exports.Validatable = require('./lib/validatable').Validatable; exports.__defineGetter__('BaseSQL', function () { return require('./lib/sql'); }); exports.init = function (trinte) { if (global.trinte) { global.trinte.orm = exports; } else { trinte.orm = {Schema: exports.Schema, AbstractClass: exports.AbstractClass}; } // var railway = './lib/railway'; // require(railway)(rw); }; try { if (process.versions.node < '0.6') { exports.version = JSON.parse(fs.readFileSync(__dirname + '/package.json')).version; } else { exports.version = require('./package').version; } } catch (e) {} exports.__defineGetter__('test', function () { return require('./tests/common_test'); });
async function𝐬 f() {}
// 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. 'use strict'; const common = require('../common'); const assert = require('assert'); const fs = require('fs'); const path = require('path'); common.refreshTmpDir(); const filepath = path.join(common.tmpDir, 'large.txt'); const fd = fs.openSync(filepath, 'w+'); const offset = 5 * 1024 * 1024 * 1024; // 5GB const message = 'Large File'; fs.truncateSync(fd, offset); assert.strictEqual(fs.statSync(filepath).size, offset); const writeBuf = Buffer.from(message); fs.writeSync(fd, writeBuf, 0, writeBuf.length, offset); const readBuf = Buffer.allocUnsafe(writeBuf.length); fs.readSync(fd, readBuf, 0, readBuf.length, offset); assert.strictEqual(readBuf.toString(), message); fs.readSync(fd, readBuf, 0, 1, 0); assert.strictEqual(readBuf[0], 0); assert.doesNotThrow( () => { fs.writeSync(fd, writeBuf, 0, writeBuf.length, 42.000001); } ); fs.close(fd); // Normally, we don't clean up tmp files at the end of a test, but we'll make an // exception for a 5 GB file. process.on('exit', function() { fs.unlinkSync(filepath); });
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _defineProperty2 = require('babel-runtime/helpers/defineProperty'); var _defineProperty3 = _interopRequireDefault(_defineProperty2); var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); var _inherits2 = require('babel-runtime/helpers/inherits'); var _inherits3 = _interopRequireDefault(_inherits2); var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _classnames = require('classnames'); var _classnames2 = _interopRequireDefault(_classnames); var _index = require('../util/index'); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } var ROW = 4; var COL = 3; function chooseMonth(month) { var next = this.state.value.clone(); next.month(month); this.setAndSelectValue(next); } function noop() {} var MonthTable = function (_Component) { (0, _inherits3["default"])(MonthTable, _Component); function MonthTable(props) { (0, _classCallCheck3["default"])(this, MonthTable); var _this = (0, _possibleConstructorReturn3["default"])(this, _Component.call(this, props)); _this.state = { value: props.value }; return _this; } MonthTable.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { if ('value' in nextProps) { this.setState({ value: nextProps.value }); } }; MonthTable.prototype.setAndSelectValue = function setAndSelectValue(value) { this.setState({ value: value }); this.props.onSelect(value); }; MonthTable.prototype.months = function months() { var value = this.state.value; var current = value.clone(); var months = []; var localeData = value.localeData(); var index = 0; for (var rowIndex = 0; rowIndex < ROW; rowIndex++) { months[rowIndex] = []; for (var colIndex = 0; colIndex < COL; colIndex++) { current.month(index); var content = localeData.monthsShort(current); months[rowIndex][colIndex] = { value: index, content: content, title: content }; index++; } } return months; }; MonthTable.prototype.render = function render() { var _this2 = this; var props = this.props; var value = this.state.value; var today = (0, _index.getTodayTime)(value); var months = this.months(); var currentMonth = value.month(); var prefixCls = props.prefixCls; var locale = props.locale; var contentRender = props.contentRender; var cellRender = props.cellRender; var monthsEls = months.map(function (month, index) { var tds = month.map(function (monthData) { var _classNameMap; var disabled = false; if (props.disabledDate) { var testValue = value.clone(); testValue.month(monthData.value); disabled = props.disabledDate(testValue); } var classNameMap = (_classNameMap = {}, (0, _defineProperty3["default"])(_classNameMap, prefixCls + '-cell', 1), (0, _defineProperty3["default"])(_classNameMap, prefixCls + '-cell-disabled', disabled), (0, _defineProperty3["default"])(_classNameMap, prefixCls + '-selected-cell', monthData.value === currentMonth), (0, _defineProperty3["default"])(_classNameMap, prefixCls + '-current-cell', today.year() === value.year() && monthData.value === today.month()), _classNameMap); var cellEl = void 0; if (cellRender) { var currentValue = value.clone(); currentValue.month(monthData.value); cellEl = cellRender(currentValue, locale); } else { var content = void 0; if (contentRender) { var _currentValue = value.clone(); _currentValue.month(monthData.value); content = contentRender(_currentValue, locale); } else { content = monthData.content; } cellEl = _react2["default"].createElement( 'div', { className: prefixCls + '-month' }, content ); } return _react2["default"].createElement( 'td', { role: 'gridcell', key: monthData.value, onClick: disabled ? null : chooseMonth.bind(_this2, monthData.value), title: monthData.title, className: (0, _classnames2["default"])(classNameMap) }, cellEl ); }); return _react2["default"].createElement( 'tr', { key: index, role: 'row' }, tds ); }); return _react2["default"].createElement( 'table', { className: prefixCls + '-table', cellSpacing: '0', role: 'grid' }, _react2["default"].createElement( 'tbody', { className: prefixCls + '-tbody' }, monthsEls ) ); }; return MonthTable; }(_react.Component); MonthTable.defaultProps = { onSelect: noop }; MonthTable.propTypes = { onSelect: _react.PropTypes.func, cellRender: _react.PropTypes.func, prefixCls: _react.PropTypes.string, value: _react.PropTypes.object }; exports["default"] = MonthTable; module.exports = exports['default'];
'use strict'; const app = require('../app'); const flowControlBtns = [ $('#btn_pause'), $('#btn_prev'), $('#btn_next') ]; const setFlowControlState = (isDisabled) => { flowControlBtns.forEach($btn => $btn.attr('disabled', isDisabled)); }; const enableFlowControl = () => { setFlowControlState(false); }; const disableFlowControl = () => { setFlowControlState(true); }; const resetTopMenuButtons = () => { $('.top-menu-buttons button').removeClass('active'); disableFlowControl(); app.getEditor().unhighlightLine(); }; const setInterval = (val) => { $('#interval').val(interval); }; const activateBtnPause = () => { $('#btn_pause').addClass('active'); }; const deactivateBtnPause = () => { $('#btn_pause').removeClass('active'); }; module.exports = { enableFlowControl, disableFlowControl, resetTopMenuButtons, setInterval, activateBtnPause, deactivateBtnPause };
(function () { 'use strict'; function suaveButtonIcon () { return { restrict: 'A', templateUrl: 'button.tmpl', replace: true, scope: true, link: function (scope, element, attrs) { scope.value = attrs.value; scope.icon = attrs.suIcon || false; scope.type = attrs.buttonType ? 'su-' + attrs.buttonType : false; } }; } angular.module('su-button', []) .directive('suIcon', suaveButtonIcon); })();
// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /** * @name: S10.2.2_A1.2_T5; * @section: 10.2.2; * @assertion: The scope chain is initialised to contain the same objects, * in the same order, as the calling context's scope chain; * @description: eval within global execution context; */ function f(){ var i; var j; str1 = ''; str2 = ''; var x = 1; for(i in this){ str1+=i; } eval('for(j in this){\nstr2+=j;\n}'); return (str1 === str2); var y = 2; } if(!f()){ $ERROR("#1: scope chain must contain same objects in the same order as the calling context"); }
const assert = require('assert'); const when = require('when'); const Spark = require('../index'); const validator = require('../validator'); describe('Test environment', () => { it('has variable TOKEN defined', () => when(assert.strictEqual(typeof process.env.SPARKY_API_TOKEN, 'string', 'environment variable TOKEN is not defined'))); }); describe('Test token', () => { it('can authenticate to Spark API', () => validator.isToken(process.env.SPARKY_API_TOKEN) .then(token => when(assert((typeof token === 'string' && token.length > 0), 'token invalid')))); }); describe('#Spark() constructor', () => { it('returns a Spark instance', () => { const spark = new Spark({ token: process.env.SPARKY_API_TOKEN }); return when(assert(spark instanceof Spark, 'constructor error')); }); });
'use strict'; /** * Module dependencies. */ var _ = require('lodash'), errorHandler = require('../errors.server.controller.js'), mongoose = require('mongoose'), passport = require('passport'), User = mongoose.model('User'); exports.getUser = function(req, res) { User.findOne( // Query {username: req.params.username}, // Projection {_id : false}, // Callback function(err, user) { if (err) return new Error(err); if (!user) return new Error('Failed to load User'); res.json(user); }); }; /** * Update user details */ exports.update = function(req, res) { var user = req.user; var logout = false; if (req.body.id !== req.user.id) { return res.status(403).send({ message: 'Current user is not the same as the one being edited. Please refresh the page.' }); } if (user.roles === 'user' && req.body.roles === 'admin') { delete req.body.roles; return res.status(403).send({ message: 'Huy bawal \'yan! Hanggang user ka lang.' }); } if (user.roles === 'admin' && req.body.roles === 'user') logout = true; if (user) { user = _.extend(user, req.body); user.updated = Date.now(); // Update the 'updated' field with the current date user.save(function(err) { if (err) { return res.status(400).send({ message: errorHandler.getErrorMessage(err) }); } else { user.password = undefined; user.salt = undefined; if (logout) { req.logout(); return res.status(200).send({ message: 'Refresh' }); } else { req.login(user, function(err) { if (err) { res.status(400).send({ message: errorHandler.getErrorMessage(err) }); } else { res.json(user); } }); } } }); } else { res.status(400).send({ message: 'User is not signed in' }); } }; /** * Send User */ exports.me = function(req, res) { res.json(req.user || null); };
let nonExistent = require('./non-existent'); let otherMissing = require('./other-missing');
import { createAction, handleActions } from 'redux-actions'; import {actions as todoAction} from './todo.js'; import CommonUtil from '../utils/CommonUtil'; import _ from 'lodash'; // ------------------------------------ // Constants // ------------------------------------ export const COUNT_DOWN = 'COUNT_DOWN'; export const COUNT_RESET = 'COUNT_RESET'; export const SET_CLEAR_INTERVAL = 'CLEAR_INTERVAL'; export const SET_RUNNING_TYPE = 'SET_RUNNING_TYPE'; export const UPDATE_CLOCK = 'SET_RUNNING_TYPE'; // ------------------------------------ // Actions // ------------------------------------ export const countDown = createAction(COUNT_DOWN); export const countReset = createAction(COUNT_RESET); export const updateClock = createAction(UPDATE_CLOCK); export const setClearInterval = createAction(SET_CLEAR_INTERVAL, (setclearInterval) => setclearInterval); export const setRunningType = createAction(SET_RUNNING_TYPE, (setRunningType) => setRunningType); export const actions = { countDown, countReset, setClearInterval, runCountDown, updateClock } // ------------------------------------ // thunk // ------------------------------------ export function runCountDown() { return (dispatch, getState) => { let timer = setInterval(() => { // 计算剩余时间 const {clock} = getState(); const allSecond = clock.minute*60 + clock.second; //休息完毕后更改状态 这段代码跟reducer里面重复了 感觉好不爽 o(╯□╰)o if(allSecond == 0 && clock.runningType == 2 ){ dispatch(todoAction.todoDone()); dispatch(todoAction.todoDisable({disable: false})); } dispatch(countDown()) }, 1000) // 设置运行状态 dispatch(setRunningType(1)); //设置清除 dispatch(setClearInterval(timer)); //设置disable dispatch(todoAction.todoDisable({disable: true})); } } // ------------------------------------ // Reducer // ------------------------------------ const initialState = { defaultTaskTime: '20:00', defaultRestTime: '01:00', minute: 20, second: 0, clearInterval: '', runningType: 0 //0: 初始状态 1:正在运行 2:休息状态 }; export default handleActions({ [COUNT_DOWN]: (state, action) => { const commonUtil = new CommonUtil(); let allSecond = state.minute*60 + state.second; let currentSecond = allSecond -1; let minute = Math.floor(currentSecond / 60); let second = currentSecond % 60; let returnState; // 如果运行完成 if(allSecond == 0 && state.runningType == 1){ const {minute,second} = commonUtil.getMinuteAndSecond(state.defaultRestTime); returnState = { ...state, minute: minute, second: second, runningType: 2 } } else if ( allSecond == 0 && state.runningType == 2 ) { const {minute,second} = commonUtil.getMinuteAndSecond(state.defaultTaskTime); clearInterval(state.clearInterval); returnState = { ...state, minute: minute, second: second, clearInterval: '', runningType: 0 } } else { returnState = { ...state, minute: minute, second: second } } return returnState; }, [SET_CLEAR_INTERVAL]: (state, action) => { return { ...state, runningType: 1, clearInterval: action.payload } }, [COUNT_RESET]: (state, action) => { const commonUtil = new CommonUtil(); const {minute,second} = commonUtil.getMinuteAndSecond(state.defaultTaskTime); clearInterval(state.clearInterval); const returnState = { ...state, minute: minute, second: second, clearInterval: '', runningType: 0 } return returnState; }, [SET_RUNNING_TYPE]: (state, action) => { return { ...state, runningType: action.payload } }, [UPDATE_CLOCK]: (state, action) => { return _.merge(state,action.payload);; } }, initialState)
/*jslint browser: true, undef: true, white: false, laxbreak: true *//*global Ext*/ /** * A rawfield for large values of currency with cents stripped */ Ext.define('Jarvus.field.BigMoney', { extend: 'Jarvus.field.Money' ,xtype: 'bigmoneyfield' ,precision: 0 ,maskRe: /[0-9$,]/ });
import getGlobalObject from '../../../helpers/environment/get-global-object'; import Plite from 'plite'; let glob = getGlobalObject(); // shim promises !glob.Promise && (glob.Promise = Plite); export default class AjaxExtension { get resource() { return this._resource; } set resource(res) { this._resource = res; } makeRequestPromise(options) { return new Promise((resolve, reject) => { let xhr = new XMLHttpRequest(options); xhr.open(this.resource.method, this.resource.url); xhr.onload = () => { if (xhr.status >= 200 && xhr.status < 300) { resolve(this.parse(xhr.response)); } else { reject({ status: xhr.status, statusText: xhr.statusText }); } }; xhr.onerror = function () { reject({ status: xhr.status, statusText: xhr.statusText }); }; xhr.send(); }); } fetch(resource) { this.resource = resource || this.resource; if (!this.resource.method) { this.resource.method = 'GET'; } return this.makeRequestPromise(); } parse(rawData) { // override this! return arguments[0]; } save(resource) { this.resource = resource || this.resource; if (!this.resource.method) { this.resource.method = 'POST'; } return this.makeRequestPromise(); } }
'use strict'; var mongoose = require('mongoose'), Schema = mongoose.Schema, passportLocalMongoose = require('passport-local-mongoose'); var Account = new Schema({ username: String, password: String }); Account.plugin(passportLocalMongoose); module.exports = mongoose.model('Account', Account);
var fs = require('fs-extra'); var request = require('supertest'); var connect = require('connect'); var query = require('connect-query'); var join = require('join-path'); var customNotFound = require('../../../lib/middleware/custom-not-found'); var dfs = require('../../../lib/dfs'); var responder = require('../../../lib/responder'); describe('custom not found', function () { var provider = dfs({ root: '.tmp' }); var app; beforeEach(function () { fs.outputFileSync('.tmp/not-found.html', 'custom not found file', 'utf8'); app = connect() .use(function (req, res, next) { responder({ req: req, res: res, provider: provider }); next(); }) }); afterEach(function () { fs.removeSync('.tmp'); }); it('serves the file', function (done) { app .use(customNotFound({ config: { error_page: '/not-found.html' } })); request(app) .get('/anything') .expect(404) .expect('custom not found file') .end(done); }); it('skips middleware on file serve error', function (done) { app .use(customNotFound({ config: { error_page: '/does-not-exist.html' } })) .use(function (req, res, next) { res.__.send('does not exist'); }); request(app) .get('/anything') .expect('does not exist') .end(done); }); it('caches for 6 months', function (done) { app .use(customNotFound({ config: { error_page: '/not-found.html' } })); request(app) .get('/anything') .expect('Cache-Control', 'public, max-age=' + (60 * 60 * 24 * 30 * 6)) .end(done); }); });
var res = { HelloWorld_png: "res/HelloWorld.png", CloseNormal_png: "res/CloseNormal.png", CloseSelected_png: "res/CloseSelected.png", spriteSheet_png: "res/sprites.png", spriteSheet_plist: "res/sprites.plist", title_png: "res/title.png", gameOver_png: "res/gameover.png", track_mp3: "res/track.mp3", }; var g_resources = []; for (var i in res) { g_resources.push(res[i]); }
$(document).ready(function() { /* Activating Best In Place */ jQuery(".best_in_place").best_in_place(); });
var React = require('react'); var request = require('superagent'); var Form = require('./Form.react.js') var Login = React.createClass({ render: function() { return ( <div> <Form createSession={ this._createSession } /> </div> ) } }) module.exports = Login;
import createSvgIcon from './utils/createSvgIcon'; import { jsx as _jsx } from "react/jsx-runtime"; export default createSvgIcon( /*#__PURE__*/_jsx("path", { d: "M7 24h2v-2H7v2zm4 0h2v-2h-2v2zm4 0h2v-2h-2v2zM6 0v20h12V0H6zm10 16H8V4h8v12z" }), 'SettingsCellSharp');
var w3 = document.getElementById ? 1 : 0; var ns = document.layers ? 0 : 0; var ie = document.all ? 1 : 0; var t_out = 0; var t_out2 = 0; var current_layer = 0; function showLayer(thelayer, rol_imagename, rol_imagesrc) { if (t_out) { clearTimeout(t_out); } if (t_out2) { clearTimeout(t_out2); } if (current_layer) { hideLayer(current_layer); } if (w3) { document.getElementById(thelayer).style.visibility = 'visible'; if (document.getElementById('searchselect')) { document.getElementById('searchselect').style.visibility = 'hidden'; } if ((rol_imagename) && (rol_imagesrc)) { document.getElementById(rol_imagename).src = rol_imagesrc; } } else if (ns) { eval("document.layers." + thelayer + ".visibility = 'visible';"); if ((rol_imagename) && (rol_imagesrc) && (document.images)) { eval("document.images." + rol_imagename + ".src = " + rol_imagesrc); } } else if (ie) { eval("document.all." + thelayer + ".style.visibility = 'visible';"); if (document.all.searchselect) { document.all.searchselect.style.visibility = 'hidden'; } if ((rol_imagename) && (rol_imagesrc)) { eval("document.all." + rol_imagename + ".src = " + rol_imagesrc + ";"); } } current_layer = thelayer; } function hideLayer(thelayer, rol_imagename, rol_imagesrc) { if (w3) { if ((rol_imagename) && (rol_imagesrc)) { document.getElementById(rol_imagename).src = rol_imagesrc; } document.getElementById(thelayer).style.visibility = 'hidden'; if (document.getElementById('searchselect')) { document.getElementById('searchselect').style.visibility = 'visible'; } } else if (ns) { if ((rol_imagename) && (rol_imagesrc) && (document.images)) { eval("document.images." + rol_imagename + ".src = " + rol_imagesrc + ";"); } eval("document.layers."+thelayer+".visibility = 'hidden';"); } else if (ie) { if ((rol_imagename) && (rol_imagesrc)) { eval("document.all." + rol_imagename + ".src = " + rol_imagesrc + ";"); } eval("document.all."+thelayer+".style.visibility = 'hidden';"); if (document.all.searchselect) { document.all.searchselect.style.visibility = 'visible'; } } } function hide(thelayer, rol_imagename, rol_imagesrc) { if (rol_imagesrc) { t_out = setTimeout("hideLayer('"+thelayer+"','"+rol_imagename+"','"+rol_imagesrc+"')", 1000); } else { t_out = setTimeout("hideLayer('"+thelayer+"','"+rol_imagename+"','')", 1000); } } function hide2(thelayer, rol_imagename, rol_imagesrc) { if (rol_imagesrc) { t_out = setTimeout("hideLayer('"+thelayer+"','"+rol_imagename+"','"+rol_imagesrc+"')", 500); } else { t_out = setTimeout("hideLayer('"+thelayer+"','"+rol_imagename+"','')", 500); } } function PreloadImages() { if (document.images) { if (!document.preload_images) document.preload_images = new Array(); var i, j = document.preload_images.length, a = PreloadImages.arguments; for (i = 0; i < a.length; i++) { if (a[i].indexOf("#") != 0) { document.preload_images[j] = new Image; document.preload_images[j++].src = a[i]; } } } } function MM_swapImgRestore() { var i, x, a = document.MM_sr; for (i = 0; a && i < a.length && (x = a[i]) && x.oSrc; i++) { x.src = x.oSrc; } } function MM_findObj(n, d) { var p, i, x; if (!d) { d = document; } if ((p = n.indexOf("?")) > 0 && parent.frames.length) { d = parent.frames[n.substring(p+1)].document; n = n.substring(0, p); } if (!(x = d[n]) && d.all) { x = d.all[n]; } for (i = 0; !x && i < d.forms.length; i++) { x = d.forms[i][n]; } for (i = 0; !x && d.layers && i < d.layers.length; i++) { x = MM_findObj(n, d.layers[i].document); } if (!x && d.getElementById) { x = d.getElementById(n); } return x; } function MM_swapImage() { var i, j = 0, x, a = MM_swapImage.arguments; document.MM_sr = new Array; for (i = 0; i < (a.length - 2); i += 3) { if ((x = MM_findObj(a[i])) != null) { document.MM_sr[j++] = x; if (!x.oSrc) { x.oSrc = x.src; } x.src = a[i+2]; } } } function change_image(image_id, image_src) { if (w3) { if ((image_id) && (image_src)) { document.getElementById(image_id).src = image_src; } } else if (ns) { if ((image_id) && (image_src) && (document.images)) { eval("document.images." + image_id + ".src = " + image_src + ";"); } } else if (ie) { if ((image_id) && (image_src)) { eval("document.all." + image_id + ".src = " + image_src + ";"); } } } function set_domain() { var regexp = /[\w\-]+\.com$/i; var domstr = new String(document.domain.substr(document.domain.search(regexp))); if (domstr.indexOf('.com') != -1) { document.domain = domstr; } } // event handler to initialize text in input box and clear onFocus // Usage: // onFocus="initTextInput(this,'clear')" // onBlur="initTextInput(this,'setDefault') function initTextInput(element, action, text, cssname, checkForDefault) { var txt = text; if (text == null || text == "") { txt = "SEARCH" } if(element != null){ switch (action) { case 'clear': cl = cssname; if(cssname == null) { cl = 'searchboxsub-on'; } if (element.value == txt) { element.value = ""; element.className=cl; } break; case 'setDefault': cl = cssname; if(cssname == null) { cl = 'searchboxsub'; } if (element.value == "") { element.value = txt; element.className=cl; } break; default: break; } } } function checkForDefaultInput(fieldId, defaultInput) { var fieldContent; if (w3) { fieldContent = document.getElementById(fieldId).value; } else if (ie) { //this is ie fieldContent = eval("document.all." + fieldId + ".value"); } else { //this is netscape fieldContent = eval("document.layers." + fieldId + ".value"); } return(fieldContent == defaultInput); }
/* */ var $keys = require("./_object-keys-internal"), enumBugKeys = require("./_enum-bug-keys"); module.exports = Object.keys || function keys(O) { return $keys(O, enumBugKeys); };
/* * Globalize Culture en-IE * * http://github.com/jquery/globalize * * Copyright Software Freedom Conservancy, Inc. * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * This file was generated by the Globalize Culture Generator * Translation: bugs found in this file need to be fixed in the generator */ (function( window, undefined ) { var Globalize; if ( typeof require !== "undefined" && typeof exports !== "undefined" && typeof module !== "undefined" ) { // Assume CommonJS Globalize = require( "globalize" ); } else { // Global variable Globalize = window.Globalize; } Globalize.addCultureInfo( "en-IE", "default", { name: "en-IE", englishName: "English (Ireland)", nativeName: "English (Ireland)", numberFormat: { currency: { pattern: ["-$n","$n"], symbol: "€" } }, calendars: { standard: { firstDay: 1, AM: null, PM: null, patterns: { d: "dd/MM/yyyy", D: "dd MMMM yyyy", t: "HH:mm", T: "HH:mm:ss", f: "dd MMMM yyyy HH:mm", F: "dd MMMM yyyy HH:mm:ss", M: "dd MMMM", Y: "MMMM yyyy" } } } }); }( this ));
var npm = require('npm'); var checkcommand = require('checkcommand'); var arrayToString = require('./lib/utils').arrayToString; var spawn = require('child_process').spawn; var Q = require('q'); var fs = require('fs'); var scripts = process.env.npm_config_scripts ? process.env.npm_config_scripts.split(',') : ['./lib/screenshots/index.js']; var urls = process.env.npm_config_urls.split(','); function installCasper() { var deferred = Q.defer(); var spawn = require('child_process').spawn, install; checkcommand.ensure('casperjs', 'CasperJS does not exist in your system but we will install it for you.') .then(function(){ console.log('CasperJS is already installed in your system.'); deferred.resolve(0); }) .catch(function (error){ install = spawn('npm', ['install', '-g', 'casperjs@1.1.0-beta3']); console.log('installing casperjs'); install.stdout.on('data', function (data) { console.log(data.toString()); deferred.notify(data); }); install.stderr.on('data', function (data) { console.log(data.toString()); }); install.on('exit', function (code) { console.log('child process exited with code ' + code); deferred.resolve(code); }); }); return deferred.promise; } function installPhantom() { var deferred = Q.defer(); var spawn = require('child_process').spawn, install; checkcommand.ensure('phantomjs', 'PhantomJS does not exist in your system but we will install it for you.') .then(function(){ console.log('PhantomJS is already installed in your system.'); deferred.resolve(0); }) .catch(function (error){ install = spawn('npm', ['install', '-g', 'phantomjs']); console.log('installing phantomjs'); install.stdout.on('data', function (data) { console.log(data.toString()); deferred.notify(data); }); install.stderr.on('data', function (data) { console.log(data.toString()); }); install.on('exit', function (code) { console.log('child process exited with code ' + code); deferred.resolve(code); }); }); return deferred.promise; } function executeScripts() { var promises = []; scripts.forEach(function (file){ var deferred = Q.defer(), spawn = require('child_process').spawn, install = spawn('casperjs', [file]); console.log('executing script ' + file); install.stdout.on('data', function (data) { console.log(data.toString()); deferred.notify(data); }); install.stderr.on('data', function (data) { console.log(data.toString()); }); install.on('exit', function (code) { console.log('child process exited with code ' + code); deferred.resolve(code); }); promises.push(deferred.promise); }); return Q.all(promises); } fs.writeFile('./lib/urls/index.js', 'module.exports = '+ arrayToString(urls), function () { installPhantom() .then(function () { installCasper() .then(function(){ executeScripts() .then(function (){ console.log('done'); }) .done(); }); }); });
var topUserController = angular.module('topUserController', []); topUserController.controller('getTopUserController', function($scope){ this.users = [ {username: 'Donald J. Trump', rating: 7}, {username: 'Hillary Clinton', rating: 8}, {username: 'Barrack Obama', rating: 9}, {username: 'Vladimir Putin', rating: 6}, {username: 'Jackie Chan', rating: 10}, ]; this.users.sort().reverse(); this.top1 = this.users[0].username; this.top2 = this.users[1].username; this.top3 = this.users[2].username; });
"use strict"; define(["../var/support"], function (support) { support.focusin = "onfocusin" in window; return support; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2NsaWVudC9saWIvanF1ZXJ5L3NyYy9ldmVudC9zdXBwb3J0LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsT0FBUSxDQUNQLGdCQURPLENBQVIsRUFFRyxVQUFVLE9BQVYsRUFBb0I7O0FBRXZCLFNBQVEsT0FBUixHQUFrQixlQUFlLE1BQWpDOztBQUVBLFFBQU8sT0FBUDtBQUVDLENBUkQiLCJmaWxlIjoic3VwcG9ydC5qcyIsInNvdXJjZXNDb250ZW50IjpbImRlZmluZSggW1xuXHRcIi4uL3Zhci9zdXBwb3J0XCJcbl0sIGZ1bmN0aW9uKCBzdXBwb3J0ICkge1xuXG5zdXBwb3J0LmZvY3VzaW4gPSBcIm9uZm9jdXNpblwiIGluIHdpbmRvdztcblxucmV0dXJuIHN1cHBvcnQ7XG5cbn0gKTtcbiJdfQ==
'use strict'; // ## Module Dependencies var _ = require('lodash'); var Like = function (_node) { _.extend(this, _node.data); }; module.exports = Like;
import expect from 'expect'; import execSteps from './execSteps.js'; export default function(history, done) { const steps = [ location => { expect(location).toMatchObject({ pathname: '/' }); expect(window.location.hash).toBe('#!/'); history.push('/home?the=query#the-hash'); }, location => { expect(location).toMatchObject({ pathname: '/home', search: '?the=query', hash: '#the-hash' }); expect(window.location.hash).toBe('#!/home?the=query#the-hash'); history.goBack(); }, location => { expect(location).toMatchObject({ pathname: '/' }); expect(window.location.hash).toBe('#!/'); history.goForward(); }, location => { expect(location).toMatchObject({ pathname: '/home', search: '?the=query', hash: '#the-hash' }); expect(window.location.hash).toBe('#!/home?the=query#the-hash'); } ]; execSteps(steps, history, done); }
(function() { 'use strict;' angular.module('app').service('timeService', ['$rootScope', '$timeout', function($rootScope, $timeout) { var delta = null; function setCurrentTime(time) { delta = moment().diff(time); scheduleNext(); } var timeout = null; function scheduleNext() { if(timeout) { $timeout.cancel(timeout); } var t = now().startOf('minute').add(1, 'minute').diff(now()) + 100; // extra 100ms just in case the browser fires our timer a bit early timeout = $timeout(function() { timeout = null; $rootScope.$broadcast('timeChanged'); scheduleNext(); }, t); } function now() { return moment().add(delta || 0, 'ms'); } scheduleNext(); return { setCurrentTime: setCurrentTime, now: now }; }]) })();
/** * @author Richard Davey <rich@photonstorm.com> * @copyright 2019 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * @namespace Phaser.Math.Easing.Sine */ module.exports = { In: require('./In'), Out: require('./Out'), InOut: require('./InOut') };
'use strict'; function isBMP (buffer) { return ('BM' === buffer.toString('ascii', 0, 2)); } function calculate (buffer) { return { 'width': buffer.readUInt32LE(18), 'height': buffer.readUInt32LE(22) }; } module.exports = { 'detect': isBMP, 'calculate': calculate };
"use strict"; var traverse = require("../../../traverse"); var util = require("../../../util"); var core = require("core-js/library"); var t = require("../../../types"); var has = require("lodash/object/has"); var contains = require("lodash/collection/contains"); var coreHas = function (node) { return node.name !== "_" && has(core, node.name); }; var ALIASABLE_CONSTRUCTORS = [ "Symbol", "Promise", "Map", "WeakMap", "Set", "WeakSet" ]; var astVisitor = { enter: function (node, parent, scope, context, file) { var prop; if (t.isMemberExpression(node) && t.isReferenced(node, parent)) { // Array.from -> _core.Array.from var obj = node.object; prop = node.property; if (!t.isReferenced(obj, node)) return; if (!node.computed && coreHas(obj) && has(core[obj.name], prop.name)) { context.skip(); return t.prependToMemberExpression(node, file.get("coreIdentifier")); } } else if (t.isReferencedIdentifier(node, parent) && !t.isMemberExpression(parent) && contains(ALIASABLE_CONSTRUCTORS, node.name) && !scope.get(node.name, true)) { // Symbol() -> _core.Symbol(); new Promise -> new _core.Promise return t.memberExpression(file.get("coreIdentifier"), node); } else if (t.isCallExpression(node)) { // arr[Symbol.iterator]() -> _core.$for.getIterator(arr) if (node.arguments.length) return; var callee = node.callee; if (!t.isMemberExpression(callee)) return; if (!callee.computed) return; prop = callee.property; if (!t.isIdentifier(prop.object, { name: "Symbol" })) return; if (!t.isIdentifier(prop.property, { name: "iterator" })) return; return util.template("corejs-iterator", { CORE_ID: file.get("coreIdentifier"), VALUE: callee.object }); } } }; exports.optional = true; exports.ast = { enter: function (ast, file) { file.setDynamic("runtimeIdentifier", function () { return file.addImport("6to5-runtime/helpers", "to5Helpers"); }); file.setDynamic("coreIdentifier", function () { return file.addImport("6to5-runtime/core-js", "core"); }); file.setDynamic("regeneratorIdentifier", function () { return file.addImport("6to5-runtime/regenerator", "regeneratorRuntime"); }); }, after: function (ast, file) { traverse(ast, astVisitor, null, file); } }; exports.Identifier = function (node, parent, scope, context, file) { if (node.name === "regeneratorRuntime" && t.isReferenced(node, parent)) { return file.get("regeneratorIdentifier"); } };
'use strict'; const _ = require('lodash'), filename = __filename.split('/').pop().split('.').shift(), schema = require('./' + filename), expect = require('chai').expect, sinon = require('sinon'); describe(_.startCase(filename), function () { let sandbox; beforeEach(function () { sandbox = sinon.sandbox.create(); }); afterEach(function () { sandbox.restore(); }); describe('getSchema', function () { const fn = schema[this.title]; it('read basic schema with .yaml ext', function () { const textSchema = fn('test/fixtures/text'); expect(textSchema).to.deep.equal({ name: { _type: 'text', _required: true }, areas: { body: { _type: 'component-list' } } }); }); it('read basic schema with .yml ext', function () { const textSchema = fn('test/fixtures/text2'); expect(textSchema).to.deep.equal({ name: { _type: 'text', _required: true }, areas: { body: { _type: 'component-list' } } }); }); it('throws error when no schema found', function () { function getSchema() { return fn('test/fixtures/not-found'); } expect(getSchema).to.throw(/not found/); }); }); });
git://github.com/bluekvirus/Stage.js.git
version https://git-lfs.github.com/spec/v1 oid sha256:8a08b30b9895014475ca015be2f701a03abea4a01c96ac5f55acb255a74fc133 size 10254
/** * Created by wungcq on 15/6/29. */ define(function (require, exports, module) { // var $ = require("jquery"); var juicer = require("juicer"); var tmp = require("tmpManager"); function tabPageController() { this.init(); this.num = -1; return this; } tabPageController.prototype = { init: function(){ var me = this; this.baseZIndex = 1000; this.tabWrapper = $(".index-page>.tab-wrapper").eq(0); me.bind(); me.register(); }, bind: function(){ var me = this; me.tabWrapper.on('click',function(e){ var doIt = function(t){ e.preventDefault(); if(t.hasClass("active")){ //do nothing }else { $(".tab-wrapper .tab.active").removeClass("active"); var id = t.addClass("active").attr("id").split("tab-")[1]; me.setTabPageActive(id); } }; var tar = $(e.target); if(tar.hasClass("tab")) { doIt(tar); }else if(tar.hasClass("name")){ doIt(tar.parent()); }else if(tar.hasClass("icon-close")){ var id = tar.parent().attr("id").split("tab-")[1]; me.removeTabPage(id); } }); }, insertTab: function(tabName){ var me = this; var name = tabName||me.tabName; var tmp_tab = tmp("tab"); var id = me.tabNum(); var tab_txt = juicer(tmp_tab,{name:name,id:'tab-'+id}); me.tabWrapper.append(tab_txt); me.insertTabPage(id); return id; }, insertTabPage: function(id){ var tmp_TabPage = tmp("tab-page"); var tabPageId = "tab-page-"+id; var tabPage_txt = juicer(tmp_TabPage,{id:tabPageId}); $(".index-page").append(tabPage_txt); $(".tab-page.active").removeClass("active"); $("#"+tabPageId).addClass("active"); }, active: function(id){ $("#tab-"+id).trigger("click"); }, setTabActive:function(id){ $("#tab-"+id).attr("class","tab active"); }, setTabPageActive: function(id){ var tabPage = $("#tab-page-"+id); $(".tab-page.active").removeClass("active"); tabPage.addClass("active"); }, removeTabPage : function(id){ var me = this; var prevIndex = 0; var num = me.tabWrapper.children(".tab").length; if(parseInt(num)>1){ var sequence = $("#tab-"+id).index(); if(sequence>0){ prevIndex = sequence-1; }else { prevIndex = num - 2; } var lastId = me.tabWrapper.children(".tab").eq(prevIndex).attr("id").split("-")[1]; me.setTabActive(lastId); me.setTabPageActive(lastId); } $("#tab-page-"+id).remove(); $("#tab-"+id).remove(); }, tabNum : function(){ var me = this; var num = $(".tab-wrapper .tab").length; me.num++; return me.num; }, register: function(tab_id){ var me = this; if(tabPageController.prototype.entities==undefined){ tabPageController.prototype.entities = []; } tabPageController.prototype.entities.push({ tab_id : tab_id }); } }; var Entity = new tabPageController(); tabPageController.prototype.entity = function(arg){ if(arg.entity != undefined){ tabPageController.prototype.entities.push({ tab_id : arg.tab_id, entity : arg.entity }); }else if(arg.tab_id !=undefined ) { return tabPageController.prototype.entities[arg.tab_id]; } }; tabPageController.prototype.newTab = function(name, callback) { var tab_id = Entity.insertTab(name); this.active(tab_id); callback && callback(tab_id); }; module.exports = Entity; });
'use strict'; const Observable = require('rxjs/Rx').Observable; const Application = require('./applications/SPAC/SPACApplication.js'); Observable.fromEvent(document, 'DOMContentLoaded') .map(e=> e.target.body.appendChild(document.createElement('div'))) .subscribe(function onDOMLoaded($container) { new Application($container).state.subscribe(function applicationNextState (applicationState) { //debugger }); });
// # Ghost Configuration // Setup your Ghost install for various environments // Documentation can be found at http://support.ghost.org/config/ var path = require('path'), config; config = { // ### Development **(default)** development: { // The url to use when providing links to the site, E.g. in RSS and email. url: 'http://localhost:1337', // Example mail config // Visit http://support.ghost.org/mail for instructions // ``` // mail: { // transport: 'SMTP', // options: { // service: 'Mailgun', // auth: { // user: '', // mailgun username // pass: '' // mailgun password // } // } // }, // ``` database: { client: 'sqlite3', connection: { filename: path.join(__dirname, '/content/data/ghost.db') }, debug: false }, server: { // Host to be passed to node's `net.Server#listen()` host: '0.0.0.0', // Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT` port: '1337' }, paths: { contentPath: path.join(__dirname, '/content/') } }, // ### Production // When running Ghost in the wild, use the production environment // Configure your URL and mail settings here production: { url: 'http://'+process.env.OPENSHIFT_APP_DNS_ALIAS, mail: { transport: 'SMTP', options: { service: 'Mailgun', auth: { user: 'postmaster@sandbox2391.mailgun.org', pass: '6d3lytuzlbc7' } } }, database: { client: 'sqlite3', connection: { filename: path.join(__dirname, '/content/data/ghost.db') }, debug: false }, server: { // Host to be passed to node's `net.Server#listen()` host: process.env.OPENSHIFT_NODEJS_IP, // Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT` port: process.env.OPENSHIFT_NODEJS_PORT } }, // **Developers only need to edit below here** // ### Testing // Used when developing Ghost to run tests and check the health of Ghost // Uses a different port number testing: { url: 'http://127.0.0.1:2369', database: { client: 'sqlite3', connection: { filename: path.join(__dirname, '/content/data/ghost-test.db') } }, server: { host: '127.0.0.1', port: '2369' }, logging: false }, // ### Testing MySQL // Used by Travis - Automated testing run through GitHub 'testing-mysql': { url: 'http://127.0.0.1:2369', database: { client: 'mysql', connection: { host : '127.0.0.1', user : 'root', password : '', database : 'ghost_testing', charset : 'utf8' } }, server: { host: '127.0.0.1', port: '2369' }, logging: false }, // ### Testing pg // Used by Travis - Automated testing run through GitHub 'testing-pg': { url: 'http://127.0.0.1:2369', database: { client: 'pg', connection: { host : '127.0.0.1', user : 'postgres', password : '', database : 'ghost_testing', charset : 'utf8' } }, server: { host: '127.0.0.1', port: '2369' }, logging: false } }; // Export config module.exports = config;
module.exports = function(args){ return args; };
const Parser = Jymfony.Component.Yaml.Parser; const Yaml = Jymfony.Component.Yaml.Yaml; const { expect } = require('chai'); const { readFileSync, chmodSync } = require('fs'); const fixturesDir = __dirname + '/../fixtures/'; function loadTestsFromFixtureFiles(testsFile) { const parser = new Parser(); const tests = []; const files = parser.parseFile(fixturesDir + testsFile); for (const file of files) { const yamls = readFileSync(fixturesDir + file + '.yml').toString('utf-8'); // Split YAMLs documents for (const yaml of yamls.split(/^--- %YAML:1\.0|^---/mg)) { if (! yaml) { continue; } const test = parser.parse(yaml); if (!! test.todo) { tests.push([ null, null, null ]); } else { let expected; eval('expected = ' + __jymfony.trim(test['js']) + ';'); tests.push([ expected, test['yaml'], test['test'] ]); } } } return tests; } describe('[Yaml] Parser', function () { beforeEach(() => { this._parser = new Parser(); }); afterEach(() => { chmodSync(fixturesDir + '/not_readable.yml', 0o644); }); for (const [ index, [ expected, yaml, comment ] ] of __jymfony.getEntries(loadTestsFromFixtureFiles('index.yml'))) { it ('should respect specification #' + index, null !== expected ? () => { expect(this._parser.parse(yaml, Yaml.PARSE_CUSTOM_TAGS)).to.be.deep.equal(expected, comment); } : undefined); } it ('should throw eval ref exception', () => { const yaml = 'foo: { &foo { a: Steve, <<: *foo} }'; expect(() => this._parser.parse(yaml)).to.throw(/Reference "foo" does not exist/); }); const circularReferenceTests = [ [ 'sequence', ` foo: - &foo - &bar bar: foobar baz: *foo ` ], [ 'mapping', ` foo: &foo bar: &bar foobar: baz baz: *foo ` ], [ 'mapping with merge key', ` foo: &foo bar: &bar foobar: baz <<: *foo ` ], ]; for (const [ name, yaml ] of circularReferenceTests) { it ('should detect circular reference: ' + name, () => { expect(() => this._parser.parse(yaml, Yaml.PARSE_CUSTOM_TAGS)) .to.throw(/Circular reference \[foo, bar, foo\] detected/); }); } });
// Copyright (c) 2016 - 2017 Uber Technologies, Inc. // // 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. import React from 'react'; import {AbstractSeries} from 'react-vis'; const predefinedClassName = 'rv-xy-plot__series rv-xy-plot__series--candlestick'; class CandlestickSeries extends AbstractSeries { render() { const {className, data, marginLeft, marginTop} = this.props; if (!data) { return null; } const xFunctor = this._getAttributeFunctor('x'); const yFunctor = this._getAttributeFunctor('y'); const strokeFunctor = this._getAttributeFunctor('stroke') || this._getAttributeFunctor('color'); const fillFunctor = this._getAttributeFunctor('fill') || this._getAttributeFunctor('color'); const opacityFunctor = this._getAttributeFunctor('opacity'); const distance = Math.abs(xFunctor(data[1]) - xFunctor(data[0])) * 0.2; return ( <g className={`${predefinedClassName} ${className}`} transform={`translate(${marginLeft},${marginTop})`} > {data.map((d, i) => { const xTrans = xFunctor(d); // Names of values borrowed from here https://en.wikipedia.org/wiki/Candlestick_chart const yHigh = yFunctor({...d, y: d.yHigh}); const yOpen = yFunctor({...d, y: d.yOpen}); const yClose = yFunctor({...d, y: d.yClose}); const yLow = yFunctor({...d, y: d.yLow}); const lineAttrs = { stroke: strokeFunctor && strokeFunctor(d) }; const xWidth = distance * 2; return ( <g transform={`translate(${xTrans})`} opacity={opacityFunctor ? opacityFunctor(d) : 1} key={i} onClick={e => this._valueClickHandler(d, e)} onMouseOver={e => this._valueMouseOverHandler(d, e)} onMouseOut={e => this._valueMouseOutHandler(d, e)} > <line x1={-xWidth} x2={xWidth} y1={yHigh} y2={yHigh} {...lineAttrs} /> <line x1={0} x2={0} y1={yHigh} y2={yLow} {...lineAttrs} /> <line x1={-xWidth} x2={xWidth} y1={yLow} y2={yLow} {...lineAttrs} /> <rect x={-xWidth} width={Math.max(xWidth * 2, 0)} y={yOpen} height={Math.abs(yOpen - yClose)} fill={fillFunctor && fillFunctor(d)} /> </g> ); })} </g> ); } } CandlestickSeries.displayName = 'CandlestickSeries'; export default CandlestickSeries;
var _containsWith = require('./internal/_containsWith'); var _curry2 = require('./internal/_curry2'); /** * Returns a new list containing only one copy of each element in the original list, based * upon the value returned by applying the supplied predicate to two list elements. Prefers * the first item if two items compare equal based on the predicate. * * @func * @memberOf R * @category List * @sig (a, a -> Boolean) -> [a] -> [a] * @param {Function} pred A predicate used to test whether two items are equal. * @param {Array} list The array to consider. * @return {Array} The list of unique items. * @example * * var strEq = R.eqBy(String); * R.uniqWith(strEq)([1, '1', 2, 1]); //=> [1, 2] * R.uniqWith(strEq)([{}, {}]); //=> [{}] * R.uniqWith(strEq)([1, '1', 1]); //=> [1] * R.uniqWith(strEq)(['1', 1, 1]); //=> ['1'] */ module.exports = _curry2(function uniqWith(pred, list) { var idx = 0, len = list.length; var result = [], item; while (idx < len) { item = list[idx]; if (!_containsWith(pred, item, result)) { result[result.length] = item; } idx += 1; } return result; });
module.exports = { includes: [ 'node_modules/**/aws-sdk/apis/*.json', 'node_modules/**/mime/types/*.types', 'node_modules/**/negotiator/**/*.js', 'node_modules/**/socket.io-client/socket.io.js', ], ignores: [ 'node_modules/**/tessel/**/*', ], // These are used to override all other rules. // // A concrete example of why this is necessary: // // Sometimes `ignores` might conflict with includes, // such as the case with "tessel" and "mime". Since // `includes` always trump `ignores`, 'mime/types/*.types' // gets removed from the `ignores` list and results in // `./node_modules/tessel/node_modules/mime/types/*.*` // being included in the bundle. Since we ABSOLUTELY // know that we do not want users trying to send the // `tessel` module that would exist as a result of // `npm install tessel`, we _must_ have a backup // strategy. In this particular case, it means // `rm -rf` anything in this list. // // This could also be caused by `.tesselinclude` // rules, so those must be overridden as well. // blacklist: [ 'node_modules/tessel', ], binaryPathTranslations: { '*': [{ find: `${process.platform}-${process.arch}`, replace: 'linux-mipsel' }], /* Other module-specific translations could be added in the future. */ }, compressionOptions: { 'extend': { special: { /* The "extend" module uses the following unadvisable pattern: module.exports = function NAME() { ... later calls NAME() }; UglifyJS's compression algorithm wants to remove that unnecessary function expression _name_. That's ok, because we can just as easily use `keep_fnames: true` to avoid that removal. Unfortunately, that's not enough in this case, as mangling produces sometimes requires another pass with `figure_out_scope` to avoid unhygienic mangling. */ rescope_after_mangle: true }, compress: { keep_fnames: true }, mangle: {} }, }, };
/* eslint-disable */ require('eventsource-polyfill'); const hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true'); hotClient.subscribe(function (event) { if (event.action === 'reload') { window.location.reload(); } });
import React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <React.Fragment><path fill="none" d="M0 0h24v24H0V0z" /><g><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.94-.49-7-3.85-7-7.93s3.05-7.44 7-7.93v15.86zm2-15.86c1.03.13 2 .45 2.87.93H13v-.93zM13 7h5.24c.25.31.48.65.68 1H13V7zm0 3h6.74c.08.33.15.66.19 1H13v-1zm0 9.93V19h2.87c-.87.48-1.84.8-2.87.93zM18.24 17H13v-1h5.92c-.2.35-.43.69-.68 1zm1.5-3H13v-1h6.93c-.04.34-.11.67-.19 1z" /></g></React.Fragment> , 'TonalityOutlined');
export const twoFer = (name = 'you') => { return `One for ${name}, one for me.`; };
'use strict'; exports.__esModule = true; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; exports.default = createUncontrollable; var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _invariant = require('invariant'); var _invariant2 = _interopRequireDefault(_invariant); var _utils = require('./utils'); var utils = _interopRequireWildcard(_utils); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function createUncontrollable(mixins, set) { return uncontrollable; function uncontrollable(Component, controlledValues) { var methods = arguments.length <= 2 || arguments[2] === undefined ? [] : arguments[2]; var displayName = Component.displayName || Component.name || 'Component', basePropTypes = utils.getType(Component).propTypes, isCompositeComponent = utils.isReactComponent(Component), controlledProps = Object.keys(controlledValues), propTypes; var OMIT_PROPS = ['valueLink', 'checkedLink'].concat(controlledProps.map(utils.defaultKey)); propTypes = utils.uncontrolledPropTypes(controlledValues, basePropTypes, displayName); (0, _invariant2.default)(isCompositeComponent || !methods.length, '[uncontrollable] stateless function components cannot pass through methods ' + 'because they have no associated instances. Check component: ' + displayName + ', ' + 'attempting to pass through methods: ' + methods.join(', ')); methods = utils.transform(methods, function (obj, method) { obj[method] = function () { var _refs$inner; return (_refs$inner = this.refs.inner)[method].apply(_refs$inner, arguments); }; }, {}); var component = _react2.default.createClass(_extends({ displayName: 'Uncontrolled(' + displayName + ')', mixins: mixins, propTypes: propTypes }, methods, { componentWillMount: function componentWillMount() { var _this = this; var props = this.props; this._values = {}; controlledProps.forEach(function (key) { _this._values[key] = props[utils.defaultKey(key)]; }); }, /** * If a prop switches from controlled to Uncontrolled * reset its value to the defaultValue */ componentWillReceiveProps: function componentWillReceiveProps(nextProps) { var _this2 = this; var props = this.props; controlledProps.forEach(function (key) { if (utils.getValue(nextProps, key) === undefined && utils.getValue(props, key) !== undefined) { _this2._values[key] = nextProps[utils.defaultKey(key)]; } }); }, render: function render() { var _this3 = this; var newProps = {}, props = omitProps(this.props); utils.each(controlledValues, function (handle, propName) { var linkPropName = utils.getLinkName(propName), prop = _this3.props[propName]; if (linkPropName && !isProp(_this3.props, propName) && isProp(_this3.props, linkPropName)) { prop = _this3.props[linkPropName].value; } newProps[propName] = prop !== undefined ? prop : _this3._values[propName]; newProps[handle] = setAndNotify.bind(_this3, propName); }); newProps = _extends({}, props, newProps, { ref: isCompositeComponent ? 'inner' : null }); return _react2.default.createElement(Component, newProps); } })); component.ControlledComponent = Component; /** * useful when wrapping a Component and you want to control * everything */ component.deferControlTo = function (newComponent) { var additions = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; var nextMethods = arguments[2]; return uncontrollable(newComponent, _extends({}, controlledValues, additions), nextMethods); }; return component; function setAndNotify(propName, value) { var linkName = utils.getLinkName(propName), handler = this.props[controlledValues[propName]]; if (linkName && isProp(this.props, linkName) && !handler) { handler = this.props[linkName].requestChange; } for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { args[_key - 2] = arguments[_key]; } set(this, propName, handler, value, args); } function isProp(props, prop) { return props[prop] !== undefined; } function omitProps(props) { var result = {}; utils.each(props, function (value, key) { if (OMIT_PROPS.indexOf(key) === -1) result[key] = value; }); return result; } } } module.exports = exports['default'];
(function($) { $.fn.glanceyear = function(massive, options) { var $_this = $(this); var settings = $.extend({ eventClick: function(e) { alert('Date: ' + e.date + ', Count:' + e.count); }, months: ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"], weeks: ['M','T','W','T','F','S', 'S'], targetQuantity: '.glanceyear-quantity', tagId: 'glanceyear-svgTag', showToday: false, today: new Date() }, options ); var svgElement = createElementSvg('svg', {'width': 54*12+15, 'height': 7*12+15 } ); var gElementContainer = createElementSvg('g', {'transform': 'translate(15, 15)'} ); var $_tag = $('<div>') .addClass('svg-tag') .attr('id', settings.tagId) .appendTo( $('body') ) .hide(); var dayCount = 366; var monthCount; //Weeks for (var i=0; i<54; i++) { var gElement = createElementSvg('g', {'transform': 'translate('+(12*i)+',0)'} ); var firstDate = new Date(); firstDate.setMonth(settings.today.getMonth()); firstDate.setFullYear(settings.today.getFullYear()); firstDate.setDate(settings.today.getDate() - dayCount-1); var daysLeft = daysInMonth(firstDate) - firstDate.getDate(); // Days in week for (var j=firstDate.getDay(); j<7 ; j++) { var rectDate = new Date(); rectDate.setMonth(settings.today.getMonth()); rectDate.setFullYear(settings.today.getFullYear()); rectDate.setDate(settings.today.getDate() - dayCount); if ( rectDate.getMonth() != monthCount && i < 52 && j > 3 && daysLeft > 7) { //new Month var textMonth = createElementSvg('text', {'x': 12*i, 'y':'-6', 'class':'month'} ); textMonth.textContent = getNameMonth(rectDate.getMonth()); gElementContainer.appendChild(textMonth); monthCount = rectDate.getMonth(); } dayCount--; if (dayCount>=0 || (settings.showToday && dayCount>=-1)) { // Day-obj factory var rectElement = createElementSvg('rect', { 'class': 'day', 'width': '10px', 'height': '10px', 'data-date': rectDate.getFullYear()+'-'+(rectDate.getMonth()+1)+'-'+rectDate.getDate(), 'y': 12*j }); rectElement.onmouseover = function() { var dateString = $(this).attr('data-date').split('-'); var date = new Date(dateString[0], dateString[1]-1, dateString[2]); var tagDate = getBeautyDate(date); var tagCount = $(this).attr('data-count'); var tagCountData = $(this).attr('data-count'); if (tagCountData) { if (tagCountData > 1 ) tagCount = $(this).attr('data-count')+' scores'; else tagCount = $(this).attr('data-count')+' score'; } else { tagCount = 'No scores'; } $_tag.html( '<b>' + tagCount + '</b> on ' + tagDate) .show() .css({ 'left': $(this).offset().left - $_tag.outerWidth()/2+5, 'top': $(this).offset().top-33 }); }; rectElement.onmouseleave = function() { $_tag.text('').hide(); } rectElement.onclick = function() { settings.eventClick( { date: $(this).attr('data-date'), count: $(this).attr('data-count') || 0 } ); } gElement.appendChild(rectElement); } } gElementContainer.appendChild(gElement); } var textM = createElementSvg('text', {'x':'-14', 'y':'8'} ); textM.textContent = getNameWeek(0); gElementContainer.appendChild(textM); var textW = createElementSvg('text', {'x':'-14', 'y':'32'} ); textW.textContent = getNameWeek(2); gElementContainer.appendChild(textW); var textF = createElementSvg('text', {'x':'-14', 'y':'56'} ); textF.textContent = getNameWeek(4); gElementContainer.appendChild(textF); var textS = createElementSvg('text', {'x':'-14', 'y':'80'} ); textS.textContent = getNameWeek(6); gElementContainer.appendChild(textS); svgElement.appendChild(gElementContainer); // Append Calendar to document; $_this.append(svgElement); fillData(massive); function createElementSvg(type, prop ) { var e = document.createElementNS('http://www.w3.org/2000/svg', type); for (var p in prop) { e.setAttribute(p, prop[p]); } return e; } function fillData(massive) { var scoreCount = 0; for (var m in massive) { $_this.find('rect.day[data-date="' + massive[m].date + '"]').attr('data-count', massive[m].value); scoreCount += parseInt(massive[m].value); } $(settings.targetQuantity).text(massive.length + ' days, ' + scoreCount + ' scores'); } function getNameMonth(a) { return settings.months[a]; } function getNameWeek(a) { return settings.weeks[a]; } function getBeautyDate(a) { return getNameMonth(a.getMonth()) + ' ' + a.getDate() + ', ' + a.getFullYear(); } function daysInMonth(d) { return 32 - new Date(d.getFullYear(), d.getMonth(), 32).getDate(); } }; })(jQuery);
// @flow function foo() { return { '-': 1, '': 2, '\u{1F60A}': 3, [1]: 4, }; } export const foo_ = foo(); declare var b: { '-': 1, '': 2, '\u{1F60A}': 3, [1]: 4, }; function bar() { return b; } export const bar_ = bar();
import Ember from 'ember'; import TableCell from 'ember-table/views/table-cell'; import d3HorizonUtils from '../utils/horizon'; export default TableCell.extend({ templateName: 'empty-cell', heightBinding: 'controller.rowHeight', horizonContent: Ember.computed(function() { var normal = d3.random.normal(1.5, 3); return _.range(100).map(function(index) { return [index, normal()]; }); }).property(), onWidthDidChange: Ember.observer(function() { this.$('svg').remove(); return this.renderD3View(); }).observes('width'), didInsertElement: function() { return this.onWidthDidChange(); }, renderD3View: function() { var chart, data, height, svg, width; width = this.get('width'); height = this.get('height'); data = this.get('horizonContent'); chart = d3HorizonUtils.d3Horizon().width(width).height(height).bands(2).mode('mirror').interpolate('basis'); svg = d3.select('#' + this.get('elementId')).append('svg').attr('width', width).attr('height', height); return svg.data([data]).call(chart); } });
// Copyright (c) 2012 Ecma International. All rights reserved. // Ecma International makes this code available under the terms and conditions set // forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the // "Use Terms"). Any redistribution of this code must retain the above // copyright and this notice and otherwise comply with the Use Terms. /*--- info: > local vars must not be visible outside with block local functions must not be visible outside with block local function expresssions should not be visible outside with block local vars must shadow outer vars local functions must shadow outer functions local function expresssions must shadow outer function expressions eval should use the appended object to the scope chain es5id: 12.14-8 description: > catch introduces scope - scope removed when exiting catch block (properties) includes: [runTestCase.js] ---*/ function testcase() { var o = {foo: 42}; try { throw o; } catch (e) { var foo = 1; } if (o.foo === 42) { return true; } } runTestCase(testcase);
Ext.define('bet.view.Viewport', { extend: 'Ext.container.Viewport', layout: 'fit', items: [ { xtype: 'panel', tbar: [ {xtype: 'button', text: 'Обновить', itemId: 'btnRefresh'} ], items: [{ xtype: 'allstats' } ] } ] });
import * as React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <React.Fragment><path d="M15.5 5H11l5 7-5 7h4.5l5-7z" /><path d="M8.5 5H4l5 7-5 7h4.5l5-7z" /></React.Fragment> , 'DoubleArrowSharp');
'use strict'; const uniqueRandomArray = require('unique-random-array'); const quotes = require('./quotes.json'); module.exports = uniqueRandomArray(quotes);
version https://git-lfs.github.com/spec/v1 oid sha256:01fc7d8782ea5f3dd1ac81bacbaf42b26d3195a3eebec5b431adbcc9e0f44599 size 403
export const UPDATE_SCORE = 'UPDATE_SCORE'; export const SHOW_RESULT = 'SHOW_RESULT'; export function updateScore(arr) { return { type: UPDATE_SCORE, arr }; } export function showResult(bool) { return { type: SHOW_RESULT, bool }; }
// Generated by CoffeeScript 1.7.1 /* generator-joomla-component index.coffee @author Sean Goresht @note uses Codoc @see https://github.com/mklabs/yeoman/wiki/generators coffeescript with yeoman @see https://github.com/coffeedoc/codo */ (function() { "use strict"; var HelperGenerator, path, yeoman, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; yeoman = require("yeoman-generator"); path = require("path"); /* @class HelperGenerator sub-generator for joomla component controllers */ module.exports = HelperGenerator = (function(_super) { __extends(HelperGenerator, _super); function HelperGenerator(args, options, config) { var pkg, _ref, _ref1, _ref2, _ref3; HelperGenerator.__super__.constructor.call(this, args, options, config); pkg = JSON.parse(this.readFileAsString(path.join(process.cwd(), "./package.json"))); this.componentName = pkg.componentName; this.description = pkg.description; this.requireManageRights = pkg.requireManageRights; this.authorName = (_ref = pkg.author) != null ? _ref.name : void 0; this.authorEmail = (_ref1 = pkg.author) != null ? _ref1.email : void 0; this.authorURL = (_ref2 = pkg.author) != null ? _ref2.url : void 0; this.license = (_ref3 = pkg.licenses[0]) != null ? _ref3.type : void 0; this.currentDate = new Date().getFullYear(); this.helperName = this._.slugify(this.name); this.helperClassName = this._.classify(this.name); console.log("You called the helper subgenerator with the argument " + this.name + ".\nNow let's create that helper as helpers/" + this.helperName + ".php for you..."); } HelperGenerator.prototype.generateHelper = function() { return this.template("_helper.php", "helpers/" + this.helperName + ".php"); }; return HelperGenerator; })(yeoman.generators.NamedBase); }).call(this); //# sourceMappingURL=index.map
var assert = require("assert"); var Kraken = require("../kraken"); suite("metrics", function() { suite("outdegree", function() { test("simple", function() { var network = { nodes: [ "one", "two", "three", "four" ], edges: [ ["one", "one"], ["one", "two"], ["one", "three"], ["two", "one"], ["three", "two"] ] }; var result = Kraken.graph(network).collect("outdegree", true); assert.deepEqual(result, {one: 3, two: 1, three: 1, four: 0}); }) test("weighted", function() { var network = { nodes: [ "one", "two", "three", "four" ], edges: [ ["one", "one", {weight: 5}], ["one", "two", {weight: 3}], ["one", "three", {weight: 4}], ["two", "one", {weight: 0.5}], ["three", "two", {weight: 9}] ] }; var result = Kraken.graph(network).collect("outdegree", true); assert.deepEqual(result, {one: 12, two: 0.5, three: 9, four: 0}); }) }) })
(function() { 'use strict'; angular.module('hotel', []); })();
/* global Raven */ class NcgDashboardPanel extends Polymer.Element { static get is() { return 'ncg-dashboard-panel'; } static get properties() { return { displayTitle: { type: String, reflectToAttribute: true }, bundle: { type: String, reflectToAttribute: true }, panel: { type: String, reflectToAttribute: true }, opened: { type: Boolean, reflectToAttribute: true, observer: '_openedChanged' }, headerColor: { type: String, reflectToAttribute: true, observer: '_headerColorChanged' }, width: { type: Number, reflectToAttribute: true }, transitioning: { type: Boolean, notify: true }, fullbleed: { type: Boolean, reflectToAttribute: true } }; } ready() { super.ready(); const infoDialog = document.createElement('ncg-dashboard-panel-info-dialog'); infoDialog.withBackdrop = true; infoDialog.bundle = this.bundle; document.body.appendChild(infoDialog); this.$.infoBtn.addEventListener('click', () => { infoDialog.open(); }); Polymer.RenderStatus.afterNextRender(this, () => { const distributedNodes = this.$.slot.assignedNodes({flatten: true}); const iframe = distributedNodes.find(el => el.tagName === 'IFRAME'); // If Raven is loaded, use it to report errors in panels to Sentry.io. if (typeof Raven !== 'undefined') { iframe.contentWindow.addEventListener('error', event => { Raven.captureException(event.error); }); iframe.contentWindow.addEventListener('unhandledrejection', err => { Raven.captureException(err.reason); }); } if (!this.fullbleed) { if (iframe.contentWindow.document.readyState === 'complete') { this._attachIframeResize(iframe); } else { iframe.addEventListener('load', () => { this._attachIframeResize(iframe); }); } } // Sometimes, we just need to know when a dang click event occurred. No matter where it happened. // This adds a `panelClick` event to all panels. iframe.contentDocument.addEventListener('click', e => { document.dispatchEvent(new CustomEvent('panelClick', e.target)); }); }); } _attachIframeResize(iframe) { window.iFrameResize({ log: false, resizeFrom: 'child', heightCalculationMethod: 'documentElementOffset', resizedCallback: data => { this.$.collapse.updateSize('auto', false); data.iframe.dispatchEvent(new CustomEvent('iframe-resized')); } }, iframe); } connectedCallback() { super.connectedCallback(); const src = this.querySelector('iframe').src; this.standaloneUrl = `${src}?standalone=true`; } toggleCollapse() { this.$.collapse.toggle(); } initializeDefaultOpened() { this.opened = true; } _openedChanged(newVal) { this.$.expandBtn.icon = newVal ? 'unfold-less' : 'unfold-more'; } _headerColorChanged(newVal) { this.$.header.style.backgroundColor = newVal; this.$.buttons.style.background = this._calcLinearGradient(this._hexToRGB(newVal)); } computeLocalStorageName(bundle, panel) { return [bundle, panel, 'opened'].join('.'); } _calcLinearGradient(rgb) { const rgbStr = `${rgb.r}, ${rgb.g}, ${rgb.b}`; return `linear-gradient(to right, rgba(${rgbStr}, 0) 0px,rgba(${rgbStr}, 1) 10px)`; } _hexToRGB(hex) { // Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF") const shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; hex = hex.replace(shorthandRegex, (m, r, g, b) => { return r + r + g + g + b + b; }); const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); return result ? { r: parseInt(result[1], 16), g: parseInt(result[2], 16), b: parseInt(result[3], 16) } : null; } } customElements.define('ncg-dashboard-panel', NcgDashboardPanel);
Template.contacts.helpers({ contacts: function () { return Contacts.find({},{sort:{'name.first': 1,'name.last': 1}}); } });
(function() { window.smoothtocer = function($toc_container, $content) { var $headingLevel, $link, $menuItem, $newSubmenu, $stepsUp, $targetNode, $thisHeadingLevel, $toc, heading, k$, _i, _len, _ref; k$ = new Object(); k$.$$ = function(el) { return document.querySelectorAll(el); }; k$.$ = function(el) { return k$.$$(el)[0]; }; k$.slugify = function(str) { return str.toLowerCase().replace(/ /g,'-').replace(/[^\w-]+/g,''); }; if ($toc_container) { $toc = document.createElement('ul'); $link = document.createElement('li'); $link.innerHTML = '<a></a>'; $headingLevel = 1; $targetNode = $toc; _ref = $content.querySelectorAll('h1, h2, h3, h4, h5, h6'); for (_i = 0, _len = _ref.length; _i < _len; _i++) { heading = _ref[_i]; if (!heading.classList.contains('toc-exempt')) { heading.id = k$.slugify(heading.innerHTML); $thisHeadingLevel = parseInt(heading.tagName.substr(1, 2)); if ($thisHeadingLevel > $headingLevel) { $newSubmenu = document.createElement('ul'); $targetNode.children[$targetNode.children.length - 1].appendChild($newSubmenu); $targetNode = $newSubmenu; $headingLevel = $thisHeadingLevel; } if ($thisHeadingLevel < $headingLevel) { $stepsUp = $headingLevel - $thisHeadingLevel; while ($stepsUp > 0) { $targetNode = $targetNode.parentNode.parentNode; $stepsUp--; } $headingLevel = $thisHeadingLevel; } $menuItem = $link.cloneNode(true); $menuItem.querySelector('a').href = "#" + heading.id; $menuItem.querySelector('a').innerHTML = heading.innerHTML; $targetNode.appendChild($menuItem); } } return $toc_container.appendChild($toc); } else { return console.error('Did not find a Table of Contents container. Found: ' + $toc_container); } }; }).call(this);
/** * @author Richard Davey <rich@photonstorm.com> * @copyright 2022 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * Center a line on the given coordinates. * * @function Phaser.Geom.Line.CenterOn * @since 3.0.0 * * @param {Phaser.Geom.Line} line - The line to center. * @param {number} x - The horizontal coordinate to center the line on. * @param {number} y - The vertical coordinate to center the line on. * * @return {Phaser.Geom.Line} The centered line. */ var CenterOn = function (line, x, y) { var tx = x - ((line.x1 + line.x2) / 2); var ty = y - ((line.y1 + line.y2) / 2); line.x1 += tx; line.y1 += ty; line.x2 += tx; line.y2 += ty; return line; }; module.exports = CenterOn;
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = undefined; var _extends2 = require('babel-runtime/helpers/extends'); var _extends3 = _interopRequireDefault(_extends2); var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _createClass2 = require('babel-runtime/helpers/createClass'); var _createClass3 = _interopRequireDefault(_createClass2); var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); var _inherits2 = require('babel-runtime/helpers/inherits'); var _inherits3 = _interopRequireDefault(_inherits2); var _react = require('react'); var _react2 = _interopRequireDefault(_react); var _classnames = require('classnames'); var _classnames2 = _interopRequireDefault(_classnames); var _Table = require('react-bootstrap/lib/Table'); var _Table2 = _interopRequireDefault(_Table); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var Table = function (_React$Component) { (0, _inherits3.default)(Table, _React$Component); function Table() { (0, _classCallCheck3.default)(this, Table); return (0, _possibleConstructorReturn3.default)(this, (0, _getPrototypeOf2.default)(Table).apply(this, arguments)); } (0, _createClass3.default)(Table, [{ key: 'render', value: function render() { var props = (0, _extends3.default)({}, this.props, { className: (0, _classnames2.default)(this.props.className, { 'table-collapsed': this.props.collapsed, 'table-middle-align': this.props.alignMiddle }) }); delete props.collapsed; delete props.alignMiddle; return _react2.default.createElement(_Table2.default, props); } }]); return Table; }(_react2.default.Component); exports.default = Table;
'use strict'; /* global eme */ /* global Promise */ (function(exports) { const mozSettings = navigator.mozSettings; const DEBUG = true; var initPromise = null; var slice = Function.call.bind(Array.prototype.slice); exports.eme = { config: { apiUrl: null }, init: function init() { if (initPromise) { return initPromise; } initPromise = this.readSettings() .then( function success(settings) { // config overrides if (settings['everythingme.api.url']) { this.config.apiUrl = settings['everythingme.api.url']; } // wait for device init return this.device.init(settings); }.bind(this), function error(e) { eme.log('fatal error accessing device settings', e); } ).catch(function(e) { eme.log('init failed', e); }); // avoid multiple init calls this.init = function noop() { eme.log('init: noop'); return initPromise; }; return initPromise; }, readSettings: function readSettings() { return new Promise(function ready(resolve, reject) { var lock = mozSettings.createLock(); var request = lock.get('*'); request.onsuccess = function onsuccess() { resolve(request.result); }; request.onerror = function onerror() { reject(request.error); }; }.bind(this)); }, log: function log() { if (DEBUG) { var args = slice(arguments); args.unshift('evme'); console.log.apply(console, args); } }, warn: function warn() { var args = slice(arguments); args.unshift('evme', 'WARNING'); console.warn.apply(console, args); }, error: function error() { var args = slice(arguments); args.unshift('evme', 'ERROR'); console.error.apply(console, args); } }; })(window);
//used to decline delete and edit when form is being completed var isDirty = 0; //delete function function deleteTeacher(teacherID) { //if form is being completed it does not let you delete if (isDirty==1) { alert(teacherStrings.deleteForbidden); return false; } //ajax data var data = { action: 'utt_delete_teacher', teacher_id: teacherID }; //confirm deletion if (confirm(teacherStrings.deleteRecord)) { //ajax call jQuery.get('admin-ajax.php' , data, function(data){ //success if (data == 1) { jQuery('#'+teacherID).remove(); jQuery('#messages').html("<div id='message' class='updated'>"+teacherStrings.teacherDeleted+"</div>"); //fail }else{ jQuery('#messages').html("<div id='message' class='error'>"+teacherStrings.teacherNotDeleted+"</div>"); } }); } return false; } //edit function function editTeacher(teacherID, teacherSurName, teacherName) { //if form is being completed it does not let you edit if (isDirty==1) { alert(teacherStrings.editForbidden); return false; } //complete form document.getElementById('firstname').value=teacherName; document.getElementById('lastname').value=teacherSurName; document.getElementById('teacherid').value=teacherID; document.getElementById('teacherTitle').innerHTML=teacherStrings.editTeacher; document.getElementById('clearTeacherForm').innerHTML=teacherStrings.cancel; jQuery('#message').remove(); isDirty = 1; return false; } jQuery(function ($) { //submit form $('#insert-updateTeacher').click(function(){ //data var teacherID = $('#teacherid').val(); var teacherName = $('#firstname').val(); var teacherSurName = $('#lastname').val(); var regexName = /^[α-ωΑ-ΩA-Za-zΆ-Ώά-ώ0-9_\s-.\/]{0,35}$/; var regexSurName = /^[α-ωΑ-ΩA-Za-zΆ-Ώά-ώ0-9_\s-.\/]{3,35}$/; var success = 0; //validation if (!regexSurName.test(teacherSurName)) { alert(teacherStrings.surnameVal); return false; } if (!regexName.test(teacherName)) { alert(teacherStrings.nameVal); return false; } //ajax data var data = { action: 'utt_insert_update_teacher', teacher_id: teacherID, teacher_name: teacherName, teacher_surname: teacherSurName }; //ajax call $.get('admin-ajax.php' , data, function(data){ success = data; //success if (success == 1) { //insert if (teacherID == 0) { jQuery('#messages').html("<div id='message' class='updated'>"+teacherStrings.successAdd+"</div>"); //edit }else{ jQuery('#messages').html("<div id='message' class='updated'>"+teacherStrings.successEdit+"</div>"); } //clear form jQuery('#teacherid').val(0); jQuery('#firstname').val(""); jQuery('#lastname').val(""); jQuery('#teacherTitle').html(teacherStrings.insertTeacher); jQuery('#clearTeacherForm').html(teacherStrings.reset); isDirty = 0; //fail }else{ //insert if (teacherID == 0) { jQuery('#messages').html("<div id='message' class='error'>"+teacherStrings.failAdd+"</div>"); //edit }else{ jQuery('#messages').html("<div id='message' class='error'>"+teacherStrings.failEdit+"</div>"); } } //ajax data data = { action: 'utt_view_teachers' }; //ajax call jQuery.get('admin-ajax.php' , data, function(data){ //load new data jQuery('#teachersResults').html(data); }); }); return false; }) //clear form $('#clearTeacherForm').click(function(){ $('#teacherTitle').html(teacherStrings.insertTeacher); $('#firstname').val(""); $('#lastname').val(""); $('#teacherid').val(0); $('#clearTeacherForm').html(teacherStrings.reset); $('#message').remove(); isDirty = 0; return false; }) //form is dirty $('.dirty').change(function(){ isDirty = 1; }) });
// // // // Responsive Menu // // // // Create the dropdown base jQuery('<select />').appendTo('.primary-menu .nav-holder'); // Create default option 'Menu' jQuery('<option />', { 'selected': 'selected', 'value' : '', 'text' : '<span class="t4p-icon-menu"></span>' }).appendTo('.primary-menu .nav-holder select'); // Populate dropdown with menu items jQuery('.primary-menu .nav-holder a').each(function() { var el = jQuery(this); if(jQuery(el).parents('.sub-menu .sub-menu').length >= 1) { jQuery('<option />', { 'value' : el.attr('href'), 'text' : '-- ' + el.text() }).appendTo('.primary-menu .nav-holder select'); } else if(jQuery(el).parents('.sub-menu').length >= 1) { jQuery('<option />', { 'value' : el.attr('href'), 'text' : '- ' + el.text() }).appendTo('.primary-menu .nav-holder select'); } else { jQuery('<option />', { 'value' : el.attr('href'), 'text' : el.text() }).appendTo('.primary-menu .nav-holder select'); } }); jQuery('.primary-menu .nav-holder select').ddslick({ width: '100%', onSelected: function(selectedData){ if(selectedData.selectedData.value != '') { window.location = selectedData.selectedData.value; } } }); // // // // Responsive Images // // // var $addmenueffect = jQuery.noConflict(); $addmenueffect("#primary img").addClass("img-responsive"); // // // // Carousel Slider Arrows // // // var $jx = jQuery.noConflict(); $jx(document).ready(function() { $jx('div#slide_holder').hover(function() { $jx(this).find('.arrow span').stop(true, true).fadeIn(200).show(10); }, function () { $jx(this).find('.arrow span').stop(true, true).fadeOut(200).hide(10); }); }); // // // // Tipsy // // // var $j = jQuery.noConflict(); $j(document).ready(function(){ $j('.tipsytext').tipsy({gravity:'n',fade:true,offset:0,opacity:1}); });
describe("", function() { var rootEl; beforeEach(function() { rootEl = browser.rootEl; browser.get("examples/example-example106/index-jquery.html"); }); describe('SCE doc demo', function() { it('should sanitize untrusted values', function() { expect(element.all(by.css('.htmlComment')).first().getInnerHtml()) .toBe('<span>Is <i>anyone</i> reading this?</span>'); }); it('should NOT sanitize explicitly trusted values', function() { expect(element(by.id('explicitlyTrustedHtml')).getInnerHtml()).toBe( '<span onmouseover="this.textContent=&quot;Explicitly trusted HTML bypasses ' + 'sanitization.&quot;">Hover over this text.</span>'); }); }); });
/** * @package Joomla.Administrator * @subpackage com_akquickicons * @copyright Copyright (C) 2014 Asikart. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ var Akquickicons = {};
define(['appSettings'], function (appSettings) { function loadForm(page, user) { page.querySelector('#txtSyncPath').value = appSettings.syncPath() || ''; page.querySelector('#chkWifi').checked = appSettings.syncOnlyOnWifi(); var uploadServers = appSettings.cameraUploadServers(); page.querySelector('.uploadServerList').innerHTML = ConnectionManager.getSavedServers().map(function (s) { var checkedHtml = uploadServers.indexOf(s.Id) == -1 ? '' : ' checked'; var html = '<label><input type="checkbox" is="emby-checkbox"' + checkedHtml + ' class="chkUploadServer" data-id="' + s.Id + '"/><span>' + s.Name + '</span></label>'; return html; }).join(''); Dashboard.hideLoadingMsg(); } function saveUser(page, user) { var syncPath = page.querySelector('#txtSyncPath').value; appSettings.syncPath(syncPath); appSettings.syncOnlyOnWifi(page.querySelector('#chkWifi').checked); var chkUploadServer = page.querySelectorAll('.chkUploadServer'); var cameraUploadServers = []; for (var i = 0, length = chkUploadServer.length; i < length; i++) { if (chkUploadServer[i].checked) { cameraUploadServers.push(chkUploadServer[i].getAttribute('data-id')); } } appSettings.cameraUploadServers(cameraUploadServers); Dashboard.hideLoadingMsg(); require(['toast'], function (toast) { toast(Globalize.translate('SettingsSaved')); }); if (cameraUploadServers.length || syncPath) { if (window.MainActivity) { MainActivity.authorizeStorage(); } } } return function (view, params) { view.querySelector('form').addEventListener('submit', function (e) { Dashboard.showLoadingMsg(); var userId = getParameterByName('userId') || Dashboard.getCurrentUserId(); ApiClient.getUser(userId).then(function (user) { saveUser(view, user); }); // Disable default form submission e.preventDefault(); return false; }); view.querySelector('#btnSelectSyncPath').addEventListener('click', function () { require(['nativedirectorychooser'], function () { NativeDirectoryChooser.chooseDirectory().then(function (path) { if (path) { view.querySelector('#txtSyncPath').value = path; } }); }); }); view.addEventListener('viewshow', function () { var page = this; Dashboard.showLoadingMsg(); var userId = getParameterByName('userId') || Dashboard.getCurrentUserId(); ApiClient.getUser(userId).then(function (user) { loadForm(page, user); }); if (AppInfo.supportsSyncPathSetting) { page.querySelector('.fldSyncPath').classList.remove('hide'); } else { page.querySelector('.fldSyncPath').classList.add('hide'); } }); }; });
scheduler.locale={ date:{ month_full:["Janvier", "Fevrier", "Mars", "April", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"], month_short:["Jan", "Fev", "Mar", "Apr", "Mai", "Juin", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], day_full:["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"], day_short:["Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"] }, labels:{ dhx_cal_today_button:"Aujourd'hui", day_tab:"Jour", week_tab:"Semaine", month_tab:"Mois", new_event:"Nouvel événement", icon_save:"Enregistrer", icon_cancel:"Annuler", icon_details:"Détails", icon_edit:"Modifier", icon_delete:"Effacer", confirm_closing:"",//Vos modifications seront perdus, êtes-vous sûr ? confirm_deleting:"L'événement sera effacé sans appel, êtes-vous sûr ?", section_description:"Description", section_time:"Période de temps", confirm_recurring:"Voulez-vous éditer toute une série d'évènements répétés?", section_recurring:"Répéter l'évènement", button_recurring:"Désactivé", button_recurring_open:"Activé", /*agenda view extension*/ agenda_tab:"Jour", date:"Date", description:"Description", /*year view extension*/ year_tab:"Ans" } }
/** * @file * Used to load CSS via JS so css doesn't block the browser. */ /* @codingStandardsIgnoreFile */ /*! loadCSS: load a CSS file asynchronously. [c]2016 @scottjehl, Filament Group, Inc. Licensed MIT */ (function(w){ "use strict"; /* exported loadCSS */ var loadCSS = function( href, before, media ){ // Arguments explained: // `href` [REQUIRED] is the URL for your CSS file. // `before` [OPTIONAL] is the element the script should use as a reference for injecting our stylesheet <link> before // By default, loadCSS attempts to inject the link after the last stylesheet or script in the DOM. However, you might desire a more specific location in your document. // `media` [OPTIONAL] is the media type or query of the stylesheet. By default it will be 'all' var doc = w.document; var ss = doc.createElement( "link" ); var newMedia = media || "all"; var ref; if( before ){ ref = before; } else { var refs = ( doc.body || doc.getElementsByTagName( "head" )[ 0 ] ).childNodes; ref = refs[ refs.length - 1]; } var sheets = doc.styleSheets; ss.rel = "stylesheet"; ss.href = href; // temporarily set media to something inapplicable to ensure it'll fetch without blocking render ss.media = "only x"; // wait until body is defined before injecting link. This ensures a non-blocking load in IE11. function ready( cb ){ if( doc.body ){ return cb(); } setTimeout(function(){ ready( cb ); }); } // Inject link // Note: the ternary preserves the existing behavior of "before" argument, but we could choose to change the argument to "after" in a later release and standardize on ref.nextSibling for all refs // Note: `insertBefore` is used instead of `appendChild`, for safety re: http://www.paulirish.com/2011/surefire-dom-element-insertion/ ready( function(){ ref.parentNode.insertBefore( ss, ( before ? ref : ref.nextSibling ) ); }); // A method (exposed on return object for external use) that mimics onload by polling until document.styleSheets until it includes the new sheet. var onloadcssdefined = function( cb ){ var resolvedHref = ss.href; var i = sheets.length; while( i-- ){ if( sheets[ i ].href === resolvedHref ){ return cb(); } } setTimeout(function() { onloadcssdefined( cb ); }); }; // once loaded, set link's media back to `all` so that the stylesheet applies once it loads if( ss.addEventListener ){ ss.addEventListener( "load", function(){ this.media = newMedia; }); } ss.onloadcssdefined = onloadcssdefined; onloadcssdefined(function() { if( ss.media !== newMedia ){ ss.media = newMedia; } }); return ss; }; // commonjs if( typeof exports !== "undefined" ){ exports.loadCSS = loadCSS; } else { w.loadCSS = loadCSS; } }( typeof global !== "undefined" ? global : this ));
//////////////////////////// // http://www.adipalaz.com/experiments/jquery/accordion.html /////////////////////////// (function($) { //http://www.mail-archive.com/jquery-en@googlegroups.com/msg43851.html $.fn.orphans = function(){ var txt = []; this.each(function(){$.each(this.childNodes, function() { if (this.nodeType == 3 && $.trim(this.nodeValue)) txt.push(this) })}); return $(txt); }; //http://www.learningjquery.com/2008/02/simple-effects-plugins: $.fn.fadeToggle = function(speed, easing, callback) { return this.animate({opacity: 'toggle'}, speed, easing, callback); }; $.fn.slideFadeToggle = function(speed, easing, callback) { return this.animate({opacity: 'toggle', height: 'toggle'}, speed, easing, callback); }; })(jQuery); //////////////////////////// $(function() { $('#content div.demo .collapse').hide(); $('#content div.demo .expand').orphans().wrap('<a href="#" title="expand/collapse"></a>'); //demo 1 - div.demo:eq(0) - show/hide effects: $('div.demo:eq(0) .expand').click(function() { $(this).toggleClass('open').siblings().removeClass('open').end() .next('.collapse').toggle().siblings('.collapse:visible').toggle(); return false; }); //demo 2 - div.demo:eq(1) - show/hide (slow) effects: $('div.demo:eq(1) .expand').click(function() { $(this).toggleClass('open').siblings().removeClass('open').end() .next('.collapse').toggle('slow').siblings('.collapse:visible').toggle('slow'); return false; }); //demo 3 - div.demo:eq(2) - slide effects: $('div.demo:eq(2) .expand').click(function() { $(this).toggleClass('open').siblings().removeClass('open').end() .next('.collapse').slideToggle().siblings('.collapse:visible').slideUp(); return false; }); //demo 4 - div.demo:eq(3) - queued slide effects: $('div.demo:eq(3) .expand').click(function() { var $thisCllps = $(this).next('ul.collapse'); var $cllpsVisible = $(this).siblings('.expand').next('ul.collapse:visible'); ($cllpsVisible.length) ? $(this).toggleClass('open').siblings('.expand').removeClass('open') .next('ul.collapse:visible').slideUp(400, function() { $thisCllps.slideDown(); }) : $thisCllps.slideToggle().prev('.expand').toggleClass('open'); return false; }); //demo 5 - div.demo:eq(4) - fadeToggle-slideFadeToggle effects: $('div.demo:eq(4) .expand').click(function() { $(this).toggleClass('open').siblings().removeClass('open').end() .next('.collapse').fadeToggle(800,'linear').siblings('.collapse:visible').slideFadeToggle('slow'); return false; }); //demo 6 - div.demo:eq(5) - slide-fade effects: $('div.demo:eq(5) .expand').click(function() { $(this).toggleClass('open').siblings().removeClass('open').end() .next('.collapse').slideFadeToggle('slow','linear').siblings('.collapse:visible').slideFadeToggle('slow','linear'); return false; }); //demo 7 - div.demo:eq(6) - nested lists - slide effects effects: $('div.demo:eq(6) .expand').click(function() { $(this).toggleClass('open').siblings().removeClass('open').end() .find('ul.collapse').slideToggle().parent().siblings('li').find('ul.collapse:visible').slideToggle(); return false; }); });
module.exports = function(grunt) { grunt.initConfig({ qunit: { files: ['tests/qunit/*.html'] }, jasmine: { alice: { src: ['src/alice.core.js'], options: { specs: 'tests/jasmine/*.js', version: '1.3.1' } } } }); grunt.loadNpmTasks('grunt-contrib-qunit'); grunt.loadNpmTasks('grunt-contrib-jasmine'); // A convenient task alias. grunt.registerTask('test', 'qunit', 'jasmine'); };
import Xml from "./Xml"; import App from "../Components/App"; import Binder from "./Binder"; class Renderer { constructor(xmlTree) { this.binder = null; this.xmlTree = xmlTree; this.tree = []; } scan() { this.tree = Xml.toJSON(this.xmlTree); // Make sure we bind all the {} to our data this.bind(); } bind() { this.binder = new Binder(this.tree); } render() { let app = new App(this.tree['Attributes'], this.tree); app.setup(); } } export default Renderer;
jQuery(document).ready(function() { jQuery(function() { var zIndexNumber = 50; jQuery('ul').each(function() { jQuery(this).css('zIndex', zIndexNumber); zIndexNumber -= 10; });}); jQuery("#front_menu ul").css('opacity', 0.9); jQuery("#front_menu ul").css({display: "none"}); // Opera Fix jQuery("#front_menu li").hover(function(){ jQuery(this).find('ul:first').css({visibility: "visible",display: "none"}).show(); },function(){ jQuery(this).find('ul:first').css({visibility: "hidden"}); }); });
dojo._xdResourceLoaded(function(dojo, dijit, dojox){ return {depends: [["provide", "dojox.dtl.tests.module"], ["require", "dojox.dtl.tests.text.filter"], ["require", "dojox.dtl.tests.text.tag"], ["require", "dojox.dtl.tests.html.tag"], ["require", "dojox.dtl.tests.html.buffer"], ["require", "dojox.dtl.tests.context"]], defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.dtl.tests.module"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. dojo._hasResource["dojox.dtl.tests.module"] = true; dojo.provide("dojox.dtl.tests.module"); try{ dojo.require("dojox.dtl.tests.text.filter"); dojo.require("dojox.dtl.tests.text.tag"); dojo.require("dojox.dtl.tests.html.tag"); dojo.require("dojox.dtl.tests.html.buffer"); dojo.require("dojox.dtl.tests.context"); }catch(e){ doh.debug(e); } } }};});
$(document).ready(function($) { $(".antispam").each(function(){ var el = $(this); el.val("2"); el.parent().css('display', 'none'); }); });
const format = require('ethjs-format'); const EthRPC = require('ethjs-rpc'); module.exports = Eth; function Eth(provider, options) { const self = this; const optionsObject = options || {}; if (!(this instanceof Eth)) { throw new Error('[ethjs-query] the Eth object requires the "new" flag in order to function normally (i.e. `const eth = new Eth(provider);`).'); } if (typeof provider !== 'object') { throw new Error(`[ethjs-query] the Eth object requires that the first input 'provider' must be an object, got '${typeof provider}' (i.e. 'const eth = new Eth(provider);')`); } self.options = Object.assign({ debug: optionsObject.debug || false, logger: optionsObject.logger || console, jsonSpace: optionsObject.jsonSpace || 0, }); self.rpc = new EthRPC(provider); self.setProvider = self.rpc.setProvider; } Eth.prototype.log = function log(message) { const self = this; if (self.options.debug) self.options.logger.log(`[ethjs-query log] ${message}`); }; Object.keys(format.schema.methods).forEach((rpcMethodName) => { Object.defineProperty(Eth.prototype, rpcMethodName.replace('eth_', ''), { enumerable: true, value: generateFnFor(rpcMethodName, format.schema.methods[rpcMethodName]), }); }); function generateFnFor(method, methodObject) { return function outputMethod() { var protoCallback = () => {}; // eslint-disable-line var inputs = null; // eslint-disable-line var inputError = null; // eslint-disable-line const self = this; const args = [].slice.call(arguments); // eslint-disable-line const protoMethod = method.replace('eth_', ''); // eslint-disable-line if (args.length > 0 && typeof args[args.length - 1] === 'function') { protoCallback = args.pop(); } return new Promise((resolve, reject) => { const cb = (callbackError, callbackResult) => { if (callbackError) { reject(callbackError); protoCallback(callbackError, null); } else { try { self.log(`attempting method formatting for '${protoMethod}' with raw outputs: ${JSON.stringify(callbackResult, null, self.options.jsonSpace)}`); const methodOutputs = format.formatOutputs(method, callbackResult); self.log(`method formatting success for '${protoMethod}' formatted result: ${JSON.stringify(methodOutputs, null, self.options.jsonSpace)}`); resolve(methodOutputs); protoCallback(null, methodOutputs); } catch (outputFormattingError) { const outputError = new Error(`[ethjs-query] while formatting outputs from RPC '${JSON.stringify(callbackResult, null, self.options.jsonSpace)}' for method '${protoMethod}' ${outputFormattingError}`); reject(outputError); protoCallback(outputError, null); } } }; if (args.length < methodObject[2]) { return cb(new Error(`[ethjs-query] method '${protoMethod}' requires at least ${methodObject[2]} input (format type ${methodObject[0][0]}), ${args.length} provided. For more information visit: https://github.com/ethereum/wiki/wiki/JSON-RPC#${method.toLowerCase()}`)); } if (args.length > methodObject[0].length) { return cb(new Error(`[ethjs-query] method '${protoMethod}' requires at most ${methodObject[0].length} params, ${args.length} provided '${JSON.stringify(args, null, self.options.jsonSpace)}'. For more information visit: https://github.com/ethereum/wiki/wiki/JSON-RPC#${method.toLowerCase()}`)); } if (methodObject[3] && args.length < methodObject[3]) { args.push('latest'); } self.log(`attempting method formatting for '${protoMethod}' with inputs ${JSON.stringify(args, null, self.options.jsonSpace)}`); try { inputs = format.formatInputs(method, args); self.log(`method formatting success for '${protoMethod}' with formatted result: ${JSON.stringify(inputs, null, self.options.jsonSpace)}`); } catch (formattingError) { return cb(new Error(`[ethjs-query] while formatting inputs '${JSON.stringify(args, null, self.options.jsonSpace)}' for method '${protoMethod}' error: ${formattingError}`)); } return self.rpc.sendAsync({ method, params: inputs }, cb); }); }; }
/** * Copyright 2015 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ "use strict"; /* jshint maxlen: false */ const apirequest_1 = require("../../lib/apirequest"); /** * Groups Settings API * * Lets you manage permission levels and related settings of a group. * * @example * const google = require('googleapis'); * const groupssettings = google.groupssettings('v1'); * * @namespace groupssettings * @type {Function} * @version v1 * @variation v1 * @param {object=} options Options for Groupssettings */ function Groupssettings(options) { const self = this; self._options = options || {}; self.groups = { /** * groupsSettings.groups.get * * @desc Gets one resource by id. * * @alias groupsSettings.groups.get * @memberOf! groupssettings(v1) * * @param {object} params Parameters for request * @param {string} params.groupUniqueId The resource ID * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ get: function (params, options, callback) { if (typeof options === 'function') { callback = options; options = {}; } options || (options = {}); const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign({ url: (rootUrl + '/groups/v1/groups/{groupUniqueId}').replace(/([^:]\/)\/+/g, '$1'), method: 'GET' }, options), params: params, requiredParams: ['groupUniqueId'], pathParams: ['groupUniqueId'], context: self }; return apirequest_1.default(parameters, callback); }, /** * groupsSettings.groups.patch * * @desc Updates an existing resource. This method supports patch semantics. * * @alias groupsSettings.groups.patch * @memberOf! groupssettings(v1) * * @param {object} params Parameters for request * @param {string} params.groupUniqueId The resource ID * @param {groupssettings(v1).Groups} params.resource Request body data * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ patch: function (params, options, callback) { if (typeof options === 'function') { callback = options; options = {}; } options || (options = {}); const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign({ url: (rootUrl + '/groups/v1/groups/{groupUniqueId}').replace(/([^:]\/)\/+/g, '$1'), method: 'PATCH' }, options), params: params, requiredParams: ['groupUniqueId'], pathParams: ['groupUniqueId'], context: self }; return apirequest_1.default(parameters, callback); }, /** * groupsSettings.groups.update * * @desc Updates an existing resource. * * @alias groupsSettings.groups.update * @memberOf! groupssettings(v1) * * @param {object} params Parameters for request * @param {string} params.groupUniqueId The resource ID * @param {groupssettings(v1).Groups} params.resource Request body data * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object */ update: function (params, options, callback) { if (typeof options === 'function') { callback = options; options = {}; } options || (options = {}); const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = { options: Object.assign({ url: (rootUrl + '/groups/v1/groups/{groupUniqueId}').replace(/([^:]\/)\/+/g, '$1'), method: 'PUT' }, options), params: params, requiredParams: ['groupUniqueId'], pathParams: ['groupUniqueId'], context: self }; return apirequest_1.default(parameters, callback); } }; } module.exports = Groupssettings; //# sourceMappingURL=v1.js.map
var searchData= [ ['bimap_2ehpp',['bimap.hpp',['../de/d8f/bimap_8hpp.html',1,'']]] ];
function findSolution(target) { function find(start, history) { // base case if (start == target) { return history; } // failed case else if (start > target) { return null; } // recursive step else { return find(start + 5, "(" + history + " + 5)") || find (start * 3, "(" + history + " * 3)"); } } return find(1, "1"); } // function attempts to create a target number out of multiplications by 5 and 3 console.log(findSolution(24));
RoseGuardenApp.factory('OpeningRequest', function(Restangular) { var OpeningRequest; OpeningRequest = { create: function(data,destination) { return Restangular.withConfig(function(RestangularConfigurer) { RestangularConfigurer.setBaseUrl(destination + ':5000')}) .one('request') .one('opening') .customPOST(data); } }; return OpeningRequest; })
import { connect } from "react-redux"; import Component from "../components/MilestoneDetailEditable"; import * as actions from "../actions/milestoneActions"; const mapStateToProps = () => ({}); const mapDispatchToProps = dispatch => ({ save: (data) => { dispatch(actions.saveMilestone(data)); }, remove: (milestoneTrackerAddress, id) => { dispatch(actions.removeMilestone(milestoneTrackerAddress, id)); }, }); const MilestoneDetailEditable = connect( mapStateToProps, mapDispatchToProps, )(Component); export default MilestoneDetailEditable;
'use strict'; const fs = require('fs'); const path = require('path'); const mkdirp = require('mkdirp'); const winston = require('winston'); const filePath = path.join(__dirname, '../../build/cache-buster'); let cached; // cache buster is an 11-character, lowercase, alphanumeric string function generate() { return (Math.random() * 1e18).toString(32).slice(0, 11); } exports.write = async function write() { await mkdirp(path.dirname(filePath)); await fs.promises.writeFile(filePath, generate()); }; exports.read = async function read() { if (cached) { return cached; } try { const buster = await fs.promises.readFile(filePath, 'utf8'); if (!buster || buster.length !== 11) { winston.warn('[cache-buster] cache buster string invalid: expected /[a-z0-9]{11}/, got `' + buster + '`'); return generate(); } cached = buster; return cached; } catch (err) { winston.warn('[cache-buster] could not read cache buster', err); return generate(); } }; require('../promisify')(exports);
'use strict'; define('forum/header', [ 'forum/header/unread', 'forum/header/notifications', 'forum/header/chat', 'alerts', ], function (unread, notifications, chat, alerts) { const module = {}; module.prepareDOM = function () { if (app.user.uid > 0) { unread.initUnreadTopics(); } notifications.prepareDOM(); chat.prepareDOM(); handleStatusChange(); createHeaderTooltips(); handleLogout(); }; function handleStatusChange() { $('[component="header/usercontrol"] [data-status]').off('click').on('click', function (e) { const status = $(this).attr('data-status'); socket.emit('user.setStatus', status, function (err) { if (err) { return alerts.error(err); } $('[data-uid="' + app.user.uid + '"] [component="user/status"], [component="header/profilelink"] [component="user/status"]') .removeClass('away online dnd offline') .addClass(status); $('[component="header/usercontrol"] [data-status]').each(function () { $(this).find('span').toggleClass('bold', $(this).attr('data-status') === status); }); app.user.status = status; }); e.preventDefault(); }); } function createHeaderTooltips() { const env = utils.findBootstrapEnvironment(); if (env === 'xs' || env === 'sm' || utils.isTouchDevice()) { return; } $('#header-menu li a[title]').each(function () { $(this).tooltip({ placement: 'bottom', trigger: 'hover', title: $(this).attr('title'), }); }); $('#search-form').tooltip({ placement: 'bottom', trigger: 'hover', title: $('#search-button i').attr('title'), }); $('#user_dropdown').tooltip({ placement: 'bottom', trigger: 'hover', title: $('#user_dropdown').attr('title'), }); } function handleLogout() { $('#header-menu .container').on('click', '[component="user/logout"]', function () { require(['logout'], function (logout) { logout(); }); return false; }); } return module; });
angular.module('MyApp') .factory('SelectionModel', function(GENRES) { function SelectionModel() { this.userName = undefined; this.userAge = 18; this.explictDisabled = false; this.genres = GENRES; this.selectedGenre = this.genres[0]; this.selectedSongs = []; } SelectionModel.prototype.updateAge = function(age) { if (age >= 18) { this.explictDisabled = false; } else { this.explictDisabled = true; this.explicit = false; } }; SelectionModel.prototype.songClicked = function(song) { if (song.selected) { this.selectedSongs.push(song); } else { for(var i = 0; i < this.selectedSongs.length; ++i) { if (this.selectedSongs[i].name === song.name) { this.selectedSongs.splice(i , 1); break; } } } }; return SelectionModel; }) .value('GENRES', [{ name: 'Rock', songs: [{ name: 'Rock 1', artist: 'Rocker 1' }, { name: 'Rock 2', artist: 'Rocker 2' }, { name: 'Rock 3', artist: 'Rocker 3' }] }, { name: 'Pop', songs: [{ name: 'Pop 1', artist: 'Poper 1' }, { name: 'Pop 2', artist: 'Poper 2' }, { name: 'Pop 3', artist: 'Rocker 3' }] }, { name: 'Rap', songs: [{ name: 'Rap 1', artist: 'Raper 1' }, { name: 'Rap 2', artist: 'Raper 2' }, { name: 'Rap 3', artist: 'Rocker 3' }] }]);
import Reflux from 'reflux'; const IndicesConfigurationActions = Reflux.createActions({ loadRotationStrategies: { asyncResult: true }, loadRetentionStrategies: { asyncResult: true }, }); export default IndicesConfigurationActions;
/* * File: app/view/OrderWinViewModel.js * * This file was generated by Sencha Architect version 3.1.0. * http://www.sencha.com/products/architect/ * * This file requires use of the Ext JS 5.0.x library, under independent license. * License of Sencha Architect does not include license for Ext JS 5.0.x. For more * details see http://www.sencha.com/license or contact license@sencha.com. * * This file will be auto-generated each and everytime you save your project. * * Do NOT hand edit this file. */ Ext.define('W5D5_Project.view.OrderWinViewModel', { extend: 'Ext.app.ViewModel', alias: 'viewmodel.orderwin' });
/*! * Ajax Bootstrap Select * * Extends existing [Bootstrap Select] implementations by adding the ability to search via AJAX requests as you type. Originally for CROSCON. * * @version 1.4.5 * @author Adam Heim - https://github.com/truckingsim * @link https://github.com/truckingsim/Ajax-Bootstrap-Select * @copyright 2019 Adam Heim * @license Released under the MIT license. * * Contributors: * Mark Carver - https://github.com/markcarver * * Last build: 2019-09-24 9:36:53 AM CDT */ !(function ($) { /*! * Dutch translation for the "nl-NL" and "nl" language codes. * Arjen Ruiterkamp <arjenruiterkamp@gmail.com> */ $.fn.ajaxSelectPicker.locale['nl-NL'] = { /** * @member $.fn.ajaxSelectPicker.locale * @cfg {String} currentlySelected = 'Currently Selected' * @markdown * The text to use for the label of the option group when currently selected options are preserved. */ currentlySelected: 'Momenteel geselecteerd', /** * @member $.fn.ajaxSelectPicker.locale * @cfg {String} emptyTitle = 'Select and begin typing' * @markdown * The text to use as the title for the select element when there are no items to display. */ emptyTitle: 'Selecteer en begin met typen', /** * @member $.fn.ajaxSelectPicker.locale * @cfg {String} errorText = ''Unable to retrieve results' * @markdown * The text to use in the status container when a request returns with an error. */ errorText: 'Kon geen resultaten ophalen', /** * @member $.fn.ajaxSelectPicker.locale * @cfg {String} searchPlaceholder = 'Search...' * @markdown * The text to use for the search input placeholder attribute. */ searchPlaceholder: 'Zoeken...', /** * @member $.fn.ajaxSelectPicker.locale * @cfg {String} statusInitialized = 'Start typing a search query' * @markdown * The text used in the status container when it is initialized. */ statusInitialized: 'Begin met typen om te zoeken', /** * @member $.fn.ajaxSelectPicker.locale * @cfg {String} statusNoResults = 'No Results' * @markdown * The text used in the status container when the request returns no results. */ statusNoResults: 'Geen resultaten', /** * @member $.fn.ajaxSelectPicker.locale * @cfg {String} statusSearching = 'Searching...' * @markdown * The text to use in the status container when a request is being initiated. */ statusSearching: 'Zoeken...', /** * @member $.fn.ajaxSelectPicker.locale * @cfg {String} statusTooShort = 'Please enter more characters' * @markdown * The text used in the status container when the request returns no results. */ statusTooShort: 'U dient meer karakters in te voeren' }; $.fn.ajaxSelectPicker.locale.nl = $.fn.ajaxSelectPicker.locale['nl-NL']; })(jQuery);
/* eslint-disable quotes */ exports.controller = function(req, res, next) { console.log('call to project GET', req.params) var projectId = req.params.id var project if (projectId === '000-stackstate-projectId') { project = { "identifier": `${projectId}`, "projectConfigurationIdentifier": "000-stackstate-projectConfigId", "name": "jpascal", "snapshotDate": "May 16, 2016 1:31:26 PM", "stacks": [ { "name": "build-A", "stackType": "BUILD", "brickStates": [ { "projectConfigurationIdentifier": "1e25e0ca2fc382f332be16f1342d152eacedb434", "brickType": "CI", "stackName": "build-A", "brickName": "jenkins", "state": "UNKNOWN", "version": "1.651", "url": "https://ci-jpascal.kodokojo.io" }, { "projectConfigurationIdentifier": "1e25e0ca2fc382f332be16f1342d152eacedb434", "brickType": "REPOSITORY", "stackName": "build-A", "brickName": "nexus", "state": "UNKNOWN", "version": "2", "url": "https://repository-jpascal.kodokojo.io" }, { "projectConfigurationIdentifier": "1e25e0ca2fc382f332be16f1342d152eacedb434", "brickType": "SCM", "stackName": "build-A", "brickName": "gitlab", "state": "UNKNOWN", "version": "8.5.2-ce", "url": "https://scm-jpascal.kodokojo.io" } ] } ] } } else { project = { "identifier": `${projectId}`, "projectConfigurationIdentifier": "1e25e0ca2fc382f332be16f1342d152eacedb434", "name": "jpascal", "snapshotDate": "May 16, 2016 1:31:26 PM", "stacks": [ { "name": "build-A", "stackType": "BUILD", "brickStates": [ { "projectConfigurationIdentifier": "1e25e0ca2fc382f332be16f1342d152eacedb434", "brickType": "CI", "stackName": "build-A", "brickName": "jenkins", "state": "RUNNING", "version": "1.651", "url": "https://ci-jpascal.kodokojo.io" }, { "projectConfigurationIdentifier": "1e25e0ca2fc382f332be16f1342d152eacedb434", "brickType": "REPOSITORY", "stackName": "build-A", "brickName": "nexus", "state": "RUNNING", "version": "2", "url": "https://repository-jpascal.kodokojo.io" }, { "projectConfigurationIdentifier": "1e25e0ca2fc382f332be16f1342d152eacedb434", "brickType": "SCM", "stackName": "build-A", "brickName": "gitlab", "state": "RUNNING", "version": "8.5.2-ce", "url": "https://scm-jpascal.kodokojo.io" } ] } ] } } res.contentType = 'application/json' res.send(200, JSON.stringify(project)) next() }
/** * @class Ext.chart.grid.HorizontalGrid3D * @extends Ext.chart.grid.HorizontalGrid * * Horizontal 3D Grid sprite. Used in 3D Cartesian Charts. */ Ext.define('Ext.chart.grid.HorizontalGrid3D', { extend: 'Ext.chart.grid.HorizontalGrid', alias: 'grid.horizontal3d', inheritableStatics: { def: { processors: { depth: 'number' }, defaults: { depth: 0 } } }, render: function (surface, ctx, clipRect) { var attr = this.attr, x = surface.roundPixel(attr.x), y = surface.roundPixel(attr.y), dx = surface.matrix.getDX(), halfLineWidth = ctx.lineWidth * 0.5, height = attr.height, depth = attr.depth, left, top; if (y <= clipRect[1]) { return; } // Horizontal stripe. left = clipRect[0] + depth - dx; top = y + halfLineWidth - depth; ctx.beginPath(); ctx.rect(left, top, clipRect[2], height); ctx.fill(); // Horizontal line. ctx.beginPath(); ctx.moveTo(left, top); ctx.lineTo(left + clipRect[2], top); ctx.stroke(); // Diagonal stripe. left = clipRect[0] + x - dx; top = y + halfLineWidth; ctx.beginPath(); ctx.moveTo(left, top); ctx.lineTo(left + depth, top - depth); ctx.lineTo(left + depth, top - depth + height); ctx.lineTo(left, top + height); ctx.closePath(); ctx.fill(); // Diagonal line. ctx.beginPath(); ctx.moveTo(left, top); ctx.lineTo(left + depth, top - depth); ctx.stroke(); } });