text
stringlengths
2
6.14k
var gulp = require('gulp'); var config = require('../config'); var gutil = require('gulp-util'); var jsdoc = require("gulp-jsdoc"); var plumber = require('gulp-plumber'); gulp.task('docs', function() { return gulp.src( config.js.src + '/**/*.js' ) .pipe( plumber() ) .pipe( jsdoc( config.docs ) ); });
/* */ var isObject = require('../lang/isObject'); function isStrictComparable(value) { return value === value && !isObject(value); } module.exports = isStrictComparable;
import * as React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <path d="M13 3H6v18h4v-6h3c3.31 0 6-2.69 6-6s-2.69-6-6-6zm.2 8H10V7h3.2c1.1 0 2 .9 2 2s-.9 2-2 2z" /> , 'LocalParkingTwoTone');
import React, {PropTypes} from 'react'; var {RouteHandler} = require('react-router'); var App = React.createClass({ propTypes: { flux: PropTypes.object.isRequired }, render() { return <RouteHandler flux={this.props.flux}/>; } }); module.exports = App;
๏ปฟ/* Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'adv_link', 'he', { acccessKey: 'ืžืงืฉ ื’ื™ืฉื”', advanced: 'ืืคืฉืจื•ื™ื•ืช ืžืชืงื“ืžื•ืช', advisoryContentType: 'Content Type ืžื•ืฆืข', advisoryTitle: 'ื›ื•ืชืจืช ืžื•ืฆืขืช', anchor: { toolbar: 'ื”ื•ืกืคืช/ืขืจื™ื›ืช ื ืงื•ื“ืช ืขื™ื’ื•ืŸ', menu: 'ืžืืคื™ื™ื ื™ ื ืงื•ื“ืช ืขื™ื’ื•ืŸ', title: 'ืžืืคื™ื™ื ื™ ื ืงื•ื“ืช ืขื™ื’ื•ืŸ', name: 'ืฉื ืœื ืงื•ื“ืช ืขื™ื’ื•ืŸ', errorName: 'ื™ืฉ ืœื”ืงืœื™ื“ ืฉื ืœื ืงื•ื“ืช ืขื™ื’ื•ืŸ', remove: 'ืžื—ื™ืงืช ื ืงื•ื“ืช ืขื™ื’ื•ืŸ' }, anchorId: 'ืขืค"ื™ ื–ื™ื”ื•ื™ (ID) ื”ืืœืžื ื˜', anchorName: 'ืขืค"ื™ ืฉื ื”ืขื•ื’ืŸ', charset: 'ืงื™ื“ื•ื“ ื”ืžืฉืื‘ ื”ืžืงื•ืฉืจ', cssClasses: 'ื’ื™ืœื™ื•ื ื•ืช ืขื™ืฆื•ื‘ ืงื‘ื•ืฆื•ืช', emailAddress: 'ื›ืชื•ื‘ืช ื”ื“ื•ื"ืœ', emailBody: 'ื’ื•ืฃ ื”ื”ื•ื“ืขื”', emailSubject: 'ื ื•ืฉื ื”ื”ื•ื“ืขื”', id: 'ื–ื™ื”ื•ื™ (ID)', info: 'ืžื™ื“ืข ืขืœ ื”ืงื™ืฉื•ืจ', langCode: 'ืงื•ื“ ืฉืคื”', langDir: 'ื›ื™ื•ื•ืŸ ืฉืคื”', langDirLTR: 'ืฉืžืืœ ืœื™ืžื™ืŸ (LTR)', langDirRTL: 'ื™ืžื™ืŸ ืœืฉืžืืœ (RTL)', menu: 'ืžืืคื™ื™ื ื™ ืงื™ืฉื•ืจ', name: 'ืฉื', noAnchors: '(ืื™ืŸ ืขื•ื’ื ื™ื ื–ืžื™ื ื™ื ื‘ื“ืฃ)', noEmail: 'ื™ืฉ ืœื”ืงืœื™ื“ ืืช ื›ืชื•ื‘ืช ื”ื“ื•ื"ืœ', noUrl: 'ื™ืฉ ืœื”ืงืœื™ื“ ืืช ื›ืชื•ื‘ืช ื”ืงื™ืฉื•ืจ (URL)', other: '<ืื—ืจ>', popupDependent: 'ืชืœื•ื™ (Netscape)', popupFeatures: 'ืชื›ื•ื ื•ืช ื”ื—ืœื•ืŸ ื”ืงื•ืคืฅ', popupFullScreen: 'ืžืกืš ืžืœื (IE)', popupLeft: 'ืžื™ืงื•ื ืฆื“ ืฉืžืืœ', popupLocationBar: 'ืกืจื’ืœ ื›ืชื•ื‘ืช', popupMenuBar: 'ืกืจื’ืœ ืชืคืจื™ื˜', popupResizable: 'ืฉื™ื ื•ื™ ื’ื•ื“ืœ', popupScrollBars: 'ื ื™ืชืŸ ืœื’ืœื™ืœื”', popupStatusBar: 'ืกืจื’ืœ ื—ื™ื•ื•ื™', popupToolbar: 'ืกืจื’ืœ ื”ื›ืœื™ื', popupTop: 'ืžื™ืงื•ื ืฆื“ ืขืœื™ื•ืŸ', rel: 'ืงืฉืจ ื’ื•ืžืœื™ืŸ', selectAnchor: 'ื‘ื—ื™ืจืช ืขื•ื’ืŸ', styles: 'ืกื’ื ื•ืŸ', tabIndex: 'ืžืกืคืจ ื˜ืื‘', target: 'ืžื˜ืจื”', targetFrame: '<ืžืกื’ืจืช>', targetFrameName: 'ืฉื ืžืกื’ืจืช ื”ื™ืขื“', targetPopup: '<ื—ืœื•ืŸ ืงื•ืคืฅ>', targetPopupName: 'ืฉื ื”ื—ืœื•ืŸ ื”ืงื•ืคืฅ', title: 'ืงื™ืฉื•ืจ', toAnchor: 'ืขื•ื’ืŸ ื‘ืขืžื•ื“ ื–ื”', toEmail: 'ื“ื•ื"ืœ', toUrl: 'ื›ืชื•ื‘ืช (URL)', toolbar: 'ื”ื•ืกืคืช/ืขืจื™ื›ืช ืงื™ืฉื•ืจ', type: 'ืกื•ื’ ืงื™ืฉื•ืจ', unlink: 'ื”ืกืจืช ื”ืงื™ืฉื•ืจ', upload: 'ื”ืขืœืื”' } );
/*! * Bootstrap-select v1.13.12 (https://developer.snapappointments.com/bootstrap-select) * * Copyright 2012-2019 SnapAppointments, LLC * Licensed under MIT (https://github.com/snapappointments/bootstrap-select/blob/master/LICENSE) */ !function(e,t){void 0===e&&void 0!==window&&(e=window),"function"==typeof define&&define.amd?define(["jquery"],function(e){return t(e)}):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(e.jQuery)}(this,function(e){e.fn.selectpicker.defaults={noneSelectedText:"Tidak ada yang dipilih",noneResultsText:"Tidak ada yang cocok {0}",countSelectedText:"{0} terpilih",maxOptionsText:["Mencapai batas (maksimum {n})","Mencapai batas grup (maksimum {n})"],selectAllText:"Pilih Semua",deselectAllText:"Hapus Semua",multipleSeparator:", "}});
var lastTime = null; function updateAnimation() { // Your code here. } function frame(time) { if (lastTime !== null) { updateAnimation(Math.min(100, time - lastTime) / 1000); } lastTime = time; requestAnimationFrame(frame); } requestAnimationFrame(frame);
module.exports = function(grunt) { grunt.loadNpmTasks('grunt-sass'); grunt.loadNpmTasks('grunt-includes'); grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.initConfig({ sass: { options: { sourceMap: true, outputStyle: 'compressed' }, portal: { files: { 'resources/css/glasscityhacks.min.css' : 'src/scss/init.scss' } } }, clean: { css: [ 'resources/css' ], js: [ 'resources/js' ] }, uglify: { options: { sourceMap: true, mangle: { except: ['jQuery'] }, compress: true }, js: { files: { 'resources/js/glasscityhacks.min.js': [ 'src/lib/jquery/jquery-2.1.4.min.js', 'src/lib/scrollspy/jquery.scrollspy.js', 'src/lib/scrollto/jquery.scrollTo.min.js', 'src/js/**/*.js' ] } } }, includes: { views: { cwd: 'src/views', src: ['**/*.html', '!global/*.html' ], dest: '', flatten: true } } }); grunt.registerTask('build-views', ['includes:views']); grunt.registerTask('build-css', ['clean:css','sass:portal']); grunt.registerTask('build-javascript', ['clean:js', 'uglify:js']); };
/* */ var $def = require("./$.def"), toIndex = require("./$").toIndex, fromCharCode = String.fromCharCode; $def($def.S, 'String', {fromCodePoint: function fromCodePoint(x) { var res = [], len = arguments.length, i = 0, code; while (len > i) { code = +arguments[i++]; if (toIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point'); res.push(code < 0x10000 ? fromCharCode(code) : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)); } return res.join(''); }});
import React from 'react'; class ComponentName extends React.Component { render() { return <div data-qa="custom-attribute"> <h1>Hello world</h1> </div>; } } export default ComponentName;
// read dbus adress from window selection const x11 = require('x11'); const fs = require('fs'); const os = require('os'); function getDbusAddress(callback) { // read machine uuid fs.readFile('/var/lib/dbus/machine-id', 'ascii', function(err, uuid) { if (err) return callback(err); var hostname = os.hostname().split('-')[0]; x11.createClient(function(err, display) { var X = display.client; var selectionName = `_DBUS_SESSION_BUS_SELECTION_${ hostname }_${uuid.trim()}`; X.InternAtom(false, selectionName, function(err, id) { if (err) return callback(err); X.GetSelectionOwner(id, function(err, win) { if (err) return callback(err); X.InternAtom(false, '_DBUS_SESSION_BUS_ADDRESS', function( err, propId ) { if (err) return callback(err); win = display.screen[0].root; X.GetProperty(0, win, propId, 0, 0, 10000000, function(err, val) { if (err) return callback(err); callback(null, val.data.toString()); }); }); }); }); }); }); } module.exports = getDbusAddress;
describe('Hand of the King', function () { integration({ isMelee: true }, function () { describe('initiating additional power challenge', function () { beforeEach(function () { const deck = this.buildDeck('stark', [ 'A Noble Cause', 'Bastard in Hiding', 'Shireen Baratheon (Core)' ]); this.player1.selectDeck(deck); this.player2.selectDeck(deck); this.player3.selectDeck(deck); this.startGame(); this.keepStartingHands(); this.player1.clickCard('Bastard in Hiding', 'hand'); this.player1.clickCard('Shireen Baratheon (Core)', 'hand'); this.completeSetup(); this.selectFirstPlayer(this.player1); this.player1.selectTitle('Hand of the King'); this.player2.selectTitle('Master of Coin'); this.player3.selectTitle('Master of Ships'); this.completeMarshalPhase(); // Power challenge vs player2 this.player1.clickPrompt('Power'); this.player1.clickPrompt('player2'); this.player1.clickCard('Bastard in Hiding'); this.player1.clickPrompt('Done'); this.skipActionWindow(); this.player2.clickPrompt('Done'); this.skipActionWindow(); this.player1.clickPrompt('Apply Claim'); // Additional power challenge this.player1.clickPrompt('Power'); }); it('should allow an additional challenge against the other player', function () { expect(this.player1).toHaveDisabledPromptButton('player2'); expect(this.player1).toHavePromptButton('player3'); }); }); describe('when the player already has an additional power challenge', function () { beforeEach(function () { const deck = this.buildDeck('stark', [ 'Sailing the Summer Sea', 'Bastard in Hiding', 'Shireen Baratheon (Core)' ]); this.player1.selectDeck(deck); this.player2.selectDeck(deck); this.player3.selectDeck(deck); this.startGame(); this.keepStartingHands(); this.player1.clickCard('Bastard in Hiding', 'hand'); this.player1.clickCard('Shireen Baratheon (Core)', 'hand'); this.completeSetup(); this.selectFirstPlayer(this.player1); this.player1.selectTitle('Hand of the King'); this.player2.selectTitle('Master of Coin'); this.player3.selectTitle('Master of Ships'); this.completeMarshalPhase(); // Power challenge vs player2 this.player1.clickPrompt('Power'); this.player1.clickPrompt('player2'); this.player1.clickCard('Bastard in Hiding'); this.player1.clickPrompt('Done'); this.skipActionWindow(); this.player2.clickPrompt('Done'); this.skipActionWindow(); this.player1.clickPrompt('Apply Claim'); // Additional power challenge this.player1.clickPrompt('Power'); }); it('should not limit the opponent for the second challenge', function () { expect(this.player1).toHavePromptButton('player2'); }); it('should limit the opponent for the third challenge', function () { // Power challenge #2 vs player 2 this.player1.clickPrompt('player2'); this.player1.clickCard('Shireen Baratheon (Core)'); this.player1.clickPrompt('Done'); this.skipActionWindow(); this.player2.clickPrompt('Done'); this.skipActionWindow(); this.player1.clickPrompt('Apply Claim'); // Power challenge #3 this.player1.clickPrompt('Power'); expect(this.player1).toHaveDisabledPromptButton('player2'); }); it('should not limit the opponent for the third challenge if second challenge opponent was different', function () { // Power challenge vs player 3 this.player1.clickPrompt('player3'); this.player1.clickCard('Shireen Baratheon (Core)'); this.player1.clickPrompt('Done'); this.skipActionWindow(); this.player3.clickPrompt('Done'); this.skipActionWindow(); this.player1.clickPrompt('Apply Claim'); // Power challenge #3 this.player1.clickPrompt('Power'); expect(this.player1).toHavePromptButton('player2'); }); }); }); });
/** * Checkbox renderer * * @private * @renderer CheckboxRenderer * @param {Object} instance Handsontable instance * @param {Element} TD Table cell where to render * @param {Number} row * @param {Number} col * @param {String|Number} prop Row object property name * @param value Value to render (remember to escape unsafe HTML before inserting to DOM!) * @param {Object} cellProperties Cell properties (shared by cell renderer and editor) */ import * as dom from './../dom.js'; import * as helper from './../helpers.js'; import {EventManager} from './../eventManager.js'; import {getRenderer, registerRenderer} from './../renderers.js'; let clonableINPUT = document.createElement('INPUT'); clonableINPUT.className = 'htCheckboxRendererInput'; clonableINPUT.type = 'checkbox'; clonableINPUT.setAttribute('autocomplete', 'off'); const isListeningKeyDownEvent = new WeakMap(); function checkboxRenderer(instance, TD, row, col, prop, value, cellProperties) { const eventManager = new EventManager(instance); // this is faster than createElement const input = clonableINPUT.cloneNode(false); if (typeof cellProperties.checkedTemplate === 'undefined') { cellProperties.checkedTemplate = true; } if (typeof cellProperties.uncheckedTemplate === 'undefined') { cellProperties.uncheckedTemplate = false; } dom.empty(TD); // TODO identify under what circumstances this line can be removed if (value === cellProperties.checkedTemplate || helper.equalsIgnoreCase(value, cellProperties.checkedTemplate)) { input.checked = true; TD.appendChild(input); } else if (value === cellProperties.uncheckedTemplate || helper.equalsIgnoreCase(value, cellProperties.uncheckedTemplate)) { TD.appendChild(input); } else if (value === null) { // default value dom.addClass(input, 'noValue'); TD.appendChild(input); } else { dom.fastInnerText(TD, '#bad value#'); } if (cellProperties.readOnly) { eventManager.addEventListener(input, 'click', preventDefault); } else { eventManager.addEventListener(input, 'mousedown', stopPropagation); eventManager.addEventListener(input, 'mouseup', stopPropagation); eventManager.addEventListener(input, 'change', (event) => { instance.setDataAtRowProp(row, prop, event.target.checked ? cellProperties.checkedTemplate : cellProperties.uncheckedTemplate); }); } if (!isListeningKeyDownEvent.has(instance)) { isListeningKeyDownEvent.set(instance, true); instance.addHook('beforeKeyDown', onBeforeKeyDown); } /** * On before key down DOM listener. * * @private * @param {Event} event */ function onBeforeKeyDown(event) { const allowedKeys = [ helper.keyCode.SPACE, helper.keyCode.ENTER, helper.keyCode.DELETE, helper.keyCode.BACKSPACE ]; dom.enableImmediatePropagation(event); if (allowedKeys.indexOf(event.keyCode) !== -1 && !event.isImmediatePropagationStopped()) { eachSelectedCheckboxCell(function() { event.stopImmediatePropagation(); event.preventDefault(); }); } if (event.keyCode == helper.keyCode.SPACE || event.keyCode == helper.keyCode.ENTER) { toggleSelected(); } if (event.keyCode == helper.keyCode.DELETE || event.keyCode == helper.keyCode.BACKSPACE) { toggleSelected(false); } } /** * Toggle checkbox checked property * * @private * @param {Boolean} [checked=null] */ function toggleSelected(checked = null) { eachSelectedCheckboxCell(function(checkboxes) { for (var i = 0, len = checkboxes.length; i < len; i++) { toggleCheckbox(checkboxes[i], checked); } }); } /** * Toggle checkbox element. * * @private * @param {HTMLInputElement} checkbox * @param {Boolean} [checked=null] */ function toggleCheckbox(checkbox, checked = null) { if (checked === null) { checkbox.checked = !checkbox.checked; } else { checkbox.checked = checked; } eventManager.fireEvent(checkbox, 'change'); } /** * Call callback for each found selected cell with checkbox type. * * @private * @param {Function} callback */ function eachSelectedCheckboxCell(callback) { const selRange = instance.getSelectedRange(); const topLeft = selRange.getTopLeftCorner(); const bottomRight = selRange.getBottomRightCorner(); for (let row = topLeft.row; row <= bottomRight.row; row++) { for (let col = topLeft.col; col <= bottomRight.col; col++) { let cell = instance.getCell(row, col); let cellProperties = instance.getCellMeta(row, col); let checkboxes = cell.querySelectorAll('input[type=checkbox]'); if (checkboxes.length > 0 && !cellProperties.readOnly) { callback(checkboxes); } } } } function preventDefault(event) { event.preventDefault(); } function stopPropagation(event) { helper.stopPropagation(event); } } export {checkboxRenderer}; registerRenderer('checkbox', checkboxRenderer);
/** * @license * Copyright 2014 David Wolverton * Available under MIT license <https://raw.githubusercontent.com/dwolverton/my/master/LICENSE.txt> */ define([ "dojo/store/Memory", "mytime/persistence/LocalStorage", "mytime/model/TimeEntry" ], function( Memory, LocalStorage, TimeEntry ) { describe("mytime/persistence/LocalStorage", function() { it("stores and retrieves an array of objects", function() { LocalStorage.persistStoreData("theKey", [ {id: "A", value: 1}, {id: "B", value: 2} ]); var retrieved = LocalStorage.retrieveStoreData("theKey"); expect(retrieved).to.deep.equal([ {id: "A", value: 1}, {id: "B", value: 2} ]); }); it("stores and retrieves an array of TimeEntries", function() { LocalStorage.persistStoreData("theKey", [ new TimeEntry({id: "A", startHour: 8}), new TimeEntry({id: "B", startHour: 10.5}) ]); var retrieved = LocalStorage.retrieveStoreData("theKey", TimeEntry); expect(retrieved).not.to.deep.equal([ {id: "A", startHour: 8}, {id: "B", startHour: 10.5} ]); expect(retrieved).to.deep.equal([ new TimeEntry({id: "A", startHour: 8}), new TimeEntry({id: "B", startHour: 10.5}) ]); expect(retrieved[0] instanceof TimeEntry).to.be.true; expect(retrieved[0]).to.have.property("id", "A"); expect(retrieved[0]).to.have.property("startHour", 8); expect(retrieved[0]).to.have.property("endHour", null); }); it("stores and retrieves a store", function() { var store = new Memory(); store.add({id: "A", value: 1}); store.add({id: "B", value: 2}); LocalStorage.persistStore("theKey", store); var retrieved = LocalStorage.loadStore("theKey", new Memory()); expect(retrieved.query()).to.have.property("total", 2); expect(retrieved.get("A")).to.deep.equal({id: "A", value: 1}); expect(retrieved.get("B")).to.deep.equal({id: "B", value: 2}); }); it("stores and retrieves a store or TimeEntries", function() { var store = new Memory(); store.add(new TimeEntry({id: "A", startHour: 8})); store.add(new TimeEntry({id: "B", startHour: 10.5})); LocalStorage.persistStore("theKey", store); var retrieved = LocalStorage.loadStore("theKey", new Memory(), TimeEntry); expect(retrieved.query()).to.have.property("total", 2); expect(retrieved.get("A") instanceof TimeEntry).to.be.true; }); }); });
/** * @class Keyboard * @classdesc Mixin which manages the keydown handling for a component * * TODO: Document collective behavior. * TODO: Provide baseline behavior outside of a collective. */ export default (base) => class Keyboard extends base { // Default keydown handler. This will typically be handled by other mixins. keydown(event) { if (super.keydown) { return super.keydown(event); } } /* * If we're now the outermost element of the collective, set up to receive * keyboard events. If we're no longer the outermost element, stop listening. */ collectiveChanged() { if (super.collectiveChanged) { super.collectiveChanged(); } if (this.collective.outermostElement !== this) { // We're no longer the outermost element; stop listening. if (isListeningToKeydown(this)) { stopListeningToKeydown(this); } return; } if (!this.getAttribute('aria-label')) { // Since we're going to handle the keyboard, see if we can adopt an ARIA // label from an inner element of the collective. let label = getCollectiveAriaLabel(this.collective); if (label) { this.setAttribute('aria-label', label); } } if (!isListeningToKeydown(this)) { startListeningToKeydown(this); } } }; function keydown(event) { // Give collective elements a shot at the event, working from innermost to // outermost (this element). let handled; let elements = this.collective.elements; for (let i = elements.length - 1; i >= 0; i--) { let element = elements[i]; handled = element.keydown && element.keydown(event); if (handled) { break; } } if (handled) { event.preventDefault(); event.stopPropagation(); } } // Return the first ARIA label defined by the collective. function getCollectiveAriaLabel(collective) { let labels = collective.elements.map(element => element.getAttribute('aria-label')); // Would prefer to use Array.prototype.find here, but IE 11 doesn't have it. let nonNullLabels = labels.filter(label => label != null); return nonNullLabels[0]; } function isListeningToKeydown(element) { return element._keydownListener != null; } function startListeningToKeydown(element) { element._keydownListener = keydown.bind(element); element.addEventListener('keydown', element._keydownListener); // Set a default tab index of 0 (document order) if no tab index exists. // MS Edge requires we explicitly check for presence of tabindex attribute. if (element.getAttribute('tabindex') == null || element.tabIndex < 0) { element.setAttribute('tabindex', '0'); } } function stopListeningToKeydown(element) { element.removeEventListener('keydown', element._keydownListener); element._keydownListener = null; element.removeAttribute('tabindex'); }
const amino = require('../main.js'); const gfx = new amino.AminoGfx(); gfx.start(function (err) { if (err) { console.log('Start failed: ' + err.message); return; } //size (100x100) this.w(100); this.h(100); //see opacity.js //root const root = this.createGroup(); this.setRoot(root); //rect const rect = this.createRect().fill('#00ff00').opacity(1.0); root.add(rect); rect.opacity.anim().from(1.0).to(0.0).dur(1000).loop(-1).start(); //text const text = this.createText().fill('#ff0000').opacity(1.0).x(100).y(200); text.text('Sample Text'); text.opacity.anim().from(0.0).to(1.0).dur(1000).loop(-1).start(); root.add(text); //circle const circle = this.createCircle().radius(50) .fill('#0000ff').filled(true) .opacity(0.5) .x(200).y(50); root.add(circle); });
import React from 'react'; import ReactDOM from 'react-dom'; import App from './App'; import { Provider } from 'react-redux'; import store from './store' ReactDOM.render( <Provider store={store}> <App /> </Provider>, document.getElementById('root') );
/** * @author Richard Davey <rich@photonstorm.com> * @copyright 2019 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ /** * The Matter Physics Drag Start Event. * * This event is dispatched by a Matter Physics World instance when a Pointer Constraint * starts dragging a body. * * Listen to it from a Scene using: `this.matter.world.on('dragstart', listener)`. * * @event Phaser.Physics.Matter.Events#DRAG_START * @since 3.16.2 * * @param {MatterJS.Body} body - The Body that has started being dragged. This is a Matter Body, not a Phaser Game Object. * @param {MatterJS.Body} part - The part of the body that was clicked on. * @param {Phaser.Physics.Matter.PointerConstraint} constraint - The Pointer Constraint that is dragging the body. */ module.exports = 'dragstart';
'use strict'; var Mongoose = require('mongoose'); /** * Each connection object represents a user connected through a unique socket. * Each connection object composed of {userId + socketId}. Both of them together are unique. * */ var RoomSchema = new Mongoose.Schema({ title: { type: String, required: true }, connections: { type: [{ userId: String, socketId: String }]} }); var roomModel = Mongoose.model('room', RoomSchema); module.exports = roomModel;
๏ปฟ(class (Surface width height) (set! this.canv (document.createElement "canvas")) (set! this.graph (this.canv.getContext "2d")) (when (and width height) (this.setSize width height)) (method (setSize width height) (set! this.width width) (set! this.height height) (set! this.canv.width width) (set! this.canv.style.width (+ width "px")) (set! this.canv.height height) (set! this.canv.style.height (+ height "px")))) (define front (new Surface)) (define back (new Surface)) (document.body.appendChild front.canv) (define g front.graph) (define WIDTH 0) (define HEIGHT 0) (define MID_WIDTH 0) (define MID_HEIGHT 0) (define (setWindowSize) (set! WIDTH (- window.innerWidth 5)) (set! HEIGHT (- window.innerHeight 5)) (set! MID_WIDTH (* 0.5 WIDTH)) (set! MID_HEIGHT (* 0.5 HEIGHT)) (send front setSize WIDTH HEIGHT) undefined) (setWindowSize) (on window:resize setWindowSize) (class (Pattern lineHeight fg text bg) (set! this.lineHeight lineHeight) (set! this.fg fg) (set! this.bg bg) (set! this.text text)) (define (pattern-group lineHeight fg texts...) (texts.map (lambda (text) (new Pattern lineHeight fg text)))) (class (Shape width height patterns) (define surf (new Surface width height)) (when (not (instanceof patterns Array)) (set! patterns [patterns])) (patterns.forEach (lambda (pattern) (when pattern.bg (set! surf.graph.fillStyle pattern.bg) (surf.graph.fillRect 0 0 width height)) (define font (+ pattern.lineHeight "px monospace")) (set! surf.graph.font font) (set! surf.graph.fillStyle pattern.fg) (set! parts (pattern.text.split "\n")) (parts.forEach (lambda (p i) (define y (* pattern.lineHeight (+ 1 i))) (surf.graph.fillText p 0 y))))) (set! this.img surf.canv) (set! this.midX (* -0.5 width)) (set! this.midY (* -0.5 height)) (set! this.width width) (set! this.height height) (method (draw) // (set! g.strokeStyle "#ff00ff") // (g.strokeRect this.midX this.midY this.width this.height) (g.drawImage this.img this.midX this.midY) undefined)) (class (Animation width height duration patternGroup runOnce) (set! this.width width) (set! this.height height) (set! this.shapes (patternGroup.map (lambda (pattern) (new Shape width height pattern)))) (set! this.loop (not runOnce)) (set! this.duration duration) (set! this.frequency (/ 1 duration)) (set! this.current 0) (method (update dt) (set! this.current (+ this.current dt)) (when (and this.loop (> this.current this.duration)) (set! this.current (- this.current this.duration))) undefined) (method (draw) (define i (Math.floor (* this.current this.shapes.length this.frequency))) (if this.loop (set! i (% i this.shapes.length)) (set! i (Math.min i (- this.shapes.length 1)))) (this.shapes[i].draw) undefined)) (class (BoardObject x y animation) (set! this.loc (new Vector x y)) (set! this.spd (new Vector 0 0)) (set! this.animation animation) (method (update dt) (this.animation.update dt) (set! this.loc (this.loc.add (this.spd.mul dt)))) (method (draw) (g.save) (g.translate this.loc.x this.loc.y) (define angle (Math.atan2 this.spd.y this.spd.x)) (when (< this.spd.x 0) (g.scale -1 1) (set! angle (- Math.PI angle))) (g.rotate angle) (this.animation.draw) (g.restore)))
var _ = require( "lodash" ), commonJSHintOptions = require( "../../jshint-options.json" ); module.exports = { nonlib: { options: commonJSHintOptions, files: { src: [] .concat( require( "../../js-example-and-test-files" ) ) .concat( require( "../../js-build-files" ) ) } }, lib: { options: _.extend( {}, commonJSHintOptions, { predef: [ "-console" ] } ), files: { src: require( "../../js-lib-files" ) } } };
import { Component } from '@angular/core'; import { Race } from './race'; import { RaceService } from './race.service'; @Component({ selector: 'my-races', templateUrl: 'app/races.component.html', styleUrls:['app/races.component.css'] }) export class RacesComponent { heading = "Ultra Racing Schedule" cash = 10000; races: Race[]; constructor(private raceService: RaceService) { } ngOnInit() { this.raceService.getRaces().subscribe(races => this.races = races); } totalCost() { let sum = 0; for (let race of this.races) { if (race.isRacing) sum += race.entryFee; } return sum; } cashLeft() { return this.cash - this.totalCost(); } enterRace(race) { if (this.cashLeft() > race.entryFee) { race.isRacing = true; } else { alert("You don't have enough cash"); } } cancelRace(race) { race.isRacing = false; } constructor(private raceService: RaceService) { } }
/* * * HomePage reducer * */ import { fromJS, List, Map } from 'immutable'; import { CANCEL_CHANGES, DELETE_DATA, DELETE_DATA_SUCCEEDED, FETCH_DATA, FETCH_DATA_SUCCEEDED, ON_CHANGE, RESET_PROPS, SET_DATA_TO_EDIT, SET_FORM, SET_FORM_ERRORS, SUBMIT_SUCCEEDED, UNSET_DATA_TO_EDIT, } from './constants'; const initialState = fromJS({ data: fromJS({}), dataToDelete: Map({}), dataToEdit: '', deleteEndPoint: '', didCheckErrors: false, formErrors: List([]), initialData: Map({}), isLoading: true, modifiedData: Map({}), showButtons: false, didDeleteData: false, endPoint: 'roles', }); function homePageReducer(state = initialState, action) { switch (action.type) { case CANCEL_CHANGES: return state .set('formErrors', List([])) .update('modifiedData', () => state.get('initialData')); case DELETE_DATA: return state .set('dataToDelete', Map(action.dataToDelete)) .set('deleteEndPoint', action.deleteEndPoint); case DELETE_DATA_SUCCEEDED: return state .updateIn(['data', state.get('endPoint')], list => list.splice(action.indexDataToDelete, 1)) .set('deleteEndPoint', '') .set('dataToDelete', Map({})) .update('didDeleteData', (v) => !v); case FETCH_DATA: return state .update('endPoint', () => action.endPoint) .update('isLoading', () => true); case FETCH_DATA_SUCCEEDED: return state .updateIn(['data', state.get('endPoint')], () => List(action.data)) .updateIn(['initialData', state.get('endPoint')], () => action.modifiedData) .update('isLoading', () => false) .updateIn(['modifiedData', state.get('endPoint')], () => action.modifiedData); case ON_CHANGE: return state .updateIn(action.keys, () => action.value); case RESET_PROPS: return initialState .update('data', () => state.get('data')) .update('initialData', () => state.get('initialData')) .update('modifiedData', () => state.get('modifiedData')) .update('endPoint', () => 'roles'); case SET_DATA_TO_EDIT: return state.update('dataToEdit', () => action.dataToEdit); case SET_FORM: return state .set('formErrors', List([])) .updateIn(['initialData', state.get('endPoint')], () => action.form) .updateIn(['modifiedData', state.get('endPoint')], () => action.form); case SET_FORM_ERRORS: return state .update('didCheckErrors', (v) => v = !v) .set('formErrors', List(action.formErrors)); case SUBMIT_SUCCEEDED: return state .set('formErrors', List([])) .update('dataToEdit', () => '') .update('initialData', () => state.get('modifiedData')); case UNSET_DATA_TO_EDIT: return state .set('formErrors', List([])) .update('dataToEdit', () => '') .update('modifiedData', () => state.get('initialData')); default: return state; } } export default homePageReducer;
/** * @author Arthur Purnama (arthur@purnama.de) */ oldModule.controller('oldModule.UserController', ['$scope', '$constant', 'UserService', 'ErrorService', '$location', function ($scope, $constant, userService, errorService, $location) { if ($location.path() === '/'+$constant.module.old.path+'/user/application') { $scope.templateUrl = $constant.module.old.templates+'user.application.list.tpl.html'; } else if ($location.path() === '/'+$constant.module.old.path+'/user') { userService.findAll(function (response) { $scope.users = response.data; $scope.templateUrl = $constant.module.old.templates+'user.tpl.html'; }, function (response) { $scope.templateUrl = errorService.manageError(response.status); }); } }]);
(function() { 'use strict'; angular .module('app', ['ngMaterial', 'ui.router', 'uiGmapgoogle-maps', 'firebase', 'color.picker', 'app.services', 'textAngular', 'app.home', 'app.freeTrialForm', 'app.admin', 'mdPickers']) .config(function($mdThemingProvider, $mdIconProvider, $stateProvider, $urlRouterProvider, uiGmapGoogleMapApiProvider) { $mdIconProvider .defaultIconSet("./assets/svg/avatars.svg", 128) .icon("menu" , "./assets/svg/menu.svg" , 24) .icon("share" , "./assets/svg/share.svg" , 24) .icon("google_plus", "./assets/svg/google_plus.svg" , 512) .icon("hangouts" , "./assets/svg/hangouts.svg" , 512) .icon("twitter" , "./assets/svg/twitter.svg" , 512) .icon("phone" , "./assets/svg/phone.svg" , 512); $mdThemingProvider.theme('default') .primaryPalette('blue') .accentPalette('pink') .backgroundPalette('grey'); $urlRouterProvider.otherwise("/"); uiGmapGoogleMapApiProvider.configure({ key: 'AIzaSyCjY6ww8ne3L5JBOpjvyWF4uDEwVBMbSsM', v: '3.23', //defaults to latest 3.X anyhow libraries: 'geometry,drawing' }); }) .run(function($rootScope, $state) { $rootScope.$on("$stateChangeError", function(event, toState, toParams, fromState, fromParams, error) { if (error === "AUTH_REQUIRED") { $state.go("home"); } if (error === "USER_LOGGED_IN") { console.log(error); $state.go('admin.menu'); } }); }); })();
/* global console, LAMBDA */ (function() { "use strict"; var L = LAMBDA; var question = {}; var RP14part2 = { init: function() { var vs = "uvxyz"; var maxDepth = 5; var minDepth = 4; var exp; var numCorrect = 0; var exps = [ ]; var isCorrect; var options = [ 0, 1, 2, 3, 4]; // David: all of these helper functions (except isNew) are // duplicated in RP14part1.js. Because... // When I moved them to a separate JS file that I loaded (with // use-require) in both RP14part1.html and RP14part2.html, // OpenDSA did not like it (error on loading the shared JS file) function pickRndCharacter(c,s) { var list = s.split("") .map(function (e,i) { return (e===c ? i : -1) ; }); list = list.filter(function (x) { return x >= 0; }); return list[L.getRnd(0,list.length-1)]; } function findMatchingParen(s,index) { s = s.split(""); var count = 0; for(var i=index+1; i<s.length; i++) { if (s[i] === ')') { if (count === 0) { return i; } else { count--; } } else { if (s[i] === '(') { count++; } } } throw new Error("Could not find closing paren for the one " + "at position " + index + " in " + s); } function removeParenPair(s) { var openParen = pickRndCharacter('(',s); var closeParen = findMatchingParen(s,openParen); return s.substring(0,openParen) + s.substring(openParen+1,closeParen) + s.substring(closeParen+1); } function removeDot(s) { var dot = pickRndCharacter('.',s); return s.substring(0,dot) + " " + s.substring(dot+1); } function addParens(s) { var n = s.length; var closing = n-1; while (s[closing] === ')') { closing--; } var p1 = L.getRnd(0,closing-1); var p2 = L.getRnd(closing+1,n-1); // do not insert in front of a space or a dot if (s[p1] === " " || s[p1] === ".") { p1++; } // do not insert after a lambda if (p1>0 && s[p1-1] === "\u03BB" ) { p1 += 2; } return s.substring(0,p1) + "(" + s.substring(p1,p2) + ")" + s.substring(p2); } function getSyntaxError(minDepth,maxDepth,vs) { var s = L.printExp( L.getRndExp(1,minDepth,maxDepth,vs,"")); var rnd = L.getRnd(1,3); question.answer = "True"; switch (rnd) { case 1: if (s.indexOf('(') !== -1) { s = removeParenPair(s); question.answer = "False"; } // leave s unchanged if it does not contain any parens break; case 2: if (s.indexOf('.') !== -1) { s = removeDot(s); question.answer = "False"; } // leave s unchanged if it does not contain any dot break; case 3: s = addParens(s); question.answer = "False"; break; } return s; }// getSyntaxError function function isNew(arr) { var exp = arr[arr.length-1]; for(var i=0; i<arr.length-1; i++) { if (arr[i] === exp) { return false; } } return true; } while (exps.length < 4) { if (L.getRnd(0,1) === 0) { // syntactically correct lambda exp exps.push( L.printExp( L.getRndExp(1,minDepth,maxDepth,vs,"")) ); isCorrect = true; } else { exps.push( getSyntaxError(minDepth,maxDepth,vs) ); isCorrect = question.answer === "True"; } if (isNew(exps)) { numCorrect += isCorrect ? 1 : 0; } else { exps.pop(); } } this.expressions = exps.join("<br />"); this.answer = String(numCorrect); options.splice(numCorrect,1); //console.log(numCorrect); this.option1 = options[0]; this.option2 = options[1]; this.option3 = options[2]; this.option4 = options[3]; } //init };// RP14part2 window.RP14part2 = window.RP14part2 || RP14part2; }());
/* * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is * regenerated. */ 'use strict'; /** * @class * Initializes a new instance of the PagingGetMultiplePagesOptions class. * @constructor * Additional parameters for the Paging_getMultiplePages operation. * @member {number} [maxresults] Sets the maximum number of items to return in * the response. * * @member {number} [timeout] Sets the maximum time that the server can spend * processing the request, in seconds. The default is 30 seconds. Default * value: 30 . * */ function PagingGetMultiplePagesOptions() { } /** * Defines the metadata of PagingGetMultiplePagesOptions * * @returns {object} metadata of PagingGetMultiplePagesOptions * */ PagingGetMultiplePagesOptions.prototype.mapper = function () { return { required: false, type: { name: 'Composite', className: 'PagingGetMultiplePagesOptions', modelProperties: { maxresults: { required: false, type: { name: 'Number' } }, timeout: { required: false, defaultValue: 30, type: { name: 'Number' } } } } }; }; module.exports = PagingGetMultiplePagesOptions;
import React, { Component, PropTypes } from 'react'; import { Field } from 'redux-form'; import blockLoading from 'assets/blockLoading.gif'; import styles from 'modules/common/styles'; import { required } from './validations'; class RichTextField extends Component { static propTypes = { input: PropTypes.object.isRequired, meta: PropTypes.object.isRequired, label: PropTypes.string, } constructor(props) { super(props); this.state = { Editor: null }; } componentDidMount() { this.mounted = true; this.loadEditor(); } componentWillUnmount() { this.mounted = false; this.setState({ Editor: null }); } loadEditor = () => { System.import('modules/common/editor').then((module) => { if (this.mounted && !this.state.Editor) { this.setState({ Editor: module.default }); } }); } renderEditor = () => { // todo place holder using textLabel const { input: { value, onChange } } = this.props; // eslint-disable-line const { Editor } = this.state; if (Editor) { return <Editor onChange={onChange} content={value} />; } return <div><img src={blockLoading} role="presentation" /></div>; } render() { const { meta: { error }, label } = this.props; return ( <div className={styles.w100}> <div className={error ? styles.colorError : null}> {label} </div> {this.renderEditor()} { error && <div><small className={styles.colorError}>{error}</small></div>} </div> ); } } export default ({ ...props }) => <Field name="desc" validate={[required]} component={RichTextField} props={{ ...props }} />;
Cursor = function() { this.x = 0; this.y = 0; this.color = WHITE; return this; } Cursor.prototype.move = function(event) { this.x = event.offsetX; this.y = event.offsetY; }; Cursor.prototype.hoverOn = function() { this.color = CURSOR_HOVER; }; Cursor.prototype.hoverOff = function() { this.color = WHITE; }; Cursor.prototype.render = function(context) { context.fillStyle = this.color; var x = this.x; var y = this.y; context.beginPath(); context.moveTo(x, y); context.lineTo(x += 13, y += 13); context.lineTo(x -= 8, y); context.lineTo(this.x, this.y + 19); context.closePath(); context.fill(); context.strokeStyle = BLACK; context.lineWidth = 2; context.stroke(); context.strokeStyle = CURSOR_OUTLINE; context.lineWidth = 1; context.stroke(); };
import webpack from 'webpack'; import WebpackDevServer from 'webpack-dev-server'; import config from './webpack.config.js'; const serverOptions = { publicPath: config.output.publicPath, contentBase: 'src', hot: true, stats: { colors: true, hash: false, timings: true, chunks: false, chunkModules: false, modules: false }, historyApiFallback: true }; const compiler = webpack(config); const webpackDevServer = new WebpackDevServer(compiler, serverOptions); webpackDevServer.listen(config._hotPort, function listen(err) { if (err) { throw err; } console.log('webpack dev server listening on %s', config._hotPort); });
// All the subviews of a TodosAppView will always have // the same model as the TodosAppView has. // maria.ElementView.subclass(checkit, 'TodosAppView', { properties: { getContainerEl: function() { return this.find('.content'); // child views will be appended to this element }, initialize: function() { this.appendChild(new checkit.TodosInputView()); this.appendChild(new checkit.TodosToolbarView()); this.appendChild(new checkit.TodosListView()); this.appendChild(new checkit.TodosStatsView()); }, insertBefore: function(newChild, oldChild) { newChild.setModel(this.getModel()); maria.ElementView.prototype.insertBefore.call(this, newChild, oldChild); }, setModel: function(model) { if (model !== this.getModel()) { maria.ElementView.prototype.setModel.call(this, model); var childViews = this.childNodes; for (var i = 0, ilen = childViews.length; i < ilen; i++) { childViews[i].setModel(model); } } } } });
import {createStore} from 'redux'; import reducer from './reducer'; export default function makeStore() { return createStore(reducer); }
๏ปฟBASE.require([ "jQuery" ], function () { BASE.namespace("components.ui.inputs"); var Future = BASE.async.Future; components.ui.inputs.UIFileInputBehavior = function (elem) { var self = this; var $elem = $(elem); var $fileInput = $('<input type="file">'); $elem.data('fileInput', self); var getFileFromUri = function (uri) { return new Future(function (setValue, setError) { var readerFunction = window.resolveLocalFileSystemURL; if (typeof readerFunction !== "function") { readerFunction = window.resolveLocalFileSystemURI; } readerFunction(uri, function (fileEntry) { fileEntry.file(function (file) { setValue(file); }, function (error) { setError(error); }); }, setError); }).then().ifError(function (error) { console.log(error); }); } $fileInput.css({ position: 'absolute', width: '100%', height: '100%', opacity: 0, overflow: 'hidden', border: 0, top: 0, left: 0 }); $elem.append($fileInput); $fileInput.on('change', function (event) { event.stopPropagation(); // IE fires clears the value of the input when you click "Browse", triggering a change if ($fileInput.val() !== "") { $elem.trigger({ type: 'change', value: $fileInput.val().split('\\').pop(), file: $fileInput[0].files[0] }); } }); $fileInput.on('cordovaChange', function (event) { var uri = event.value; getFileFromUri(uri).then(function(file){ $elem.trigger({ type: 'change', value: file.name, file: file, }); }); }); $fileInput.on('click', function (event) { this.value = null; if (typeof cordova !== 'undefined' && typeof imagePicker !== 'undefined') { event.preventDefault(); window.imagePicker.getPictures( function (results) { $fileInput.trigger({ type: 'cordovaChange', value: results[0] }); }, function (error) { console.log('Error: ' + error); }, { maximumImagesCount: 1, } ); } }); self.getFileInput = function () { return $fileInput[0]; }; self.setFileInputName = function (name) { $fileInput.attr('name', name); }; self.triggerClick = function () { $fileInput.trigger('click'); } }; });
import wretch from 'wretch'; const api = wretch() .url(process.env.API_URL || 'http://localhost:3002/api') .auth(`Bearer ${localStorage.getItem('authToken')}`); /* * Exported methods shouldn't be used directly from a component; use * one of the actual API libs instead. */ export function get(app, path, data = undefined, config = {}) { let request = api.url(`/${app}/${path}`); if (data) { request = request.query(data); } return request.get().res(parseResponse); } export function post(app, path, data = null, config = {}) { return api .url(`/${app}/${path}`) .post(data) .badRequest(parseValidationError) .res(parseResponse); } export function put(app, path, data = null, config = {}) { return api .url(`/${app}/${path}`) .put(data) .badRequest(parseValidationError) .res(parseResponse); } export function delete_(app, path, data = null, config = {}) { return api .url(`/${app}/${path}`) .delete(data) .res(parseResponse); } export class ValidationError extends Error { constructor(message, validationErrors) { super(message); // 'Error' breaks prototype chain here Object.setPrototypeOf(this, new.target.prototype); // restore prototype chain this.validationErrors = validationErrors; this.statusCode = 400; } } const isJSONResponse = response => /application\/json/.test(response.headers.get('content-type')); const parseResponse = response => { if (!response.ok) { throw new Error(response.status + ' ' + response.statusText); } if (isJSONResponse(response)) { return response.json(); } return response.text(); }; const parseValidationError = async ({ response, text }) => { if (isJSONResponse(response)) { const json = JSON.parse(text); throw new ValidationError(json.error, json.message); } throw new Error(error.text); };
const loadData = require('../loadData') jest.mock('fs-extra') jest.mock('../../utils/get-closest-config', () => require('../../../mocks/get-closest-config')) describe('load Plugins', () => { it('should save property into context', async () => { const result = await loadData({ data: '', site: {}, otherKey: true, src: '/path/to/', }) expect(result.otherKey).toBeTruthy() }) it('throws if context is not passed as an object', async () => { try { await loadData() } catch (error) { expect(error.message).toBe('should pass a object to load.') } }) it('throws if context.src is not passed as a string', async () => { try { await loadData({ site: {}, }) } catch (error) { expect(error.message).toBe('context.src must be a string.') } }) it('throws if context.site is not passed as a object', async () => { try { await loadData({ src: '/path/to', }) } catch (error) { expect(error.message).toBe('context.site must be passed as a object.') } }) })
/** * hasClass method * check if element has class * @param {string} cls - class name to check for * @return {boolean} */ hasClass: function(cls) { return this.length ? this[0].classList.contains(cls) : false; },
angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "AM", "PM" ], "DAY": [ "Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu" ], "MONTH": [ "Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember" ], "SHORTDAY": [ "Min", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab" ], "SHORTMONTH": [ "Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Agt", "Sep", "Okt", "Nov", "Des" ], "fullDate": "EEEE, dd MMMM yyyy", "longDate": "d MMMM yyyy", "medium": "d MMM yyyy HH:mm:ss", "mediumDate": "d MMM yyyy", "mediumTime": "HH:mm:ss", "short": "dd/MM/yy HH:mm", "shortDate": "dd/MM/yy", "shortTime": "HH:mm" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "Rp", "DECIMAL_SEP": ",", "GROUP_SEP": ".", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "macFrac": 0, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "macFrac": 0, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "\u00a4-", "negSuf": "", "posPre": "\u00a4", "posSuf": "" } ] }, "id": "id", "pluralCat": function (n) { return PLURAL_CATEGORY.OTHER;} }); }]);
import 'ember'; import Ember from 'ember-metal/core'; import isEnabled from 'ember-metal/features'; import EmberHandlebars from 'ember-htmlbars/compat'; import HandlebarsCompatibleHelper from 'ember-htmlbars/compat/helper'; import Helper from 'ember-htmlbars/helper'; import { registerKeyword, resetKeyword } from 'ember-htmlbars/tests/utils'; import viewKeyword from 'ember-htmlbars/keywords/view'; var compile, helpers, makeBoundHelper; compile = EmberHandlebars.compile; helpers = EmberHandlebars.helpers; makeBoundHelper = EmberHandlebars.makeBoundHelper; var makeViewHelper = EmberHandlebars.makeViewHelper; var App, registry, container, originalViewKeyword; function reverseHelper(value) { return arguments.length > 1 ? value.split('').reverse().join('') : '--'; } QUnit.module('Application Lifecycle - Helper Registration', { setup() { originalViewKeyword = registerKeyword('view', viewKeyword); }, teardown() { Ember.run(function() { if (App) { App.destroy(); } App = null; Ember.TEMPLATES = {}; }); resetKeyword('view', originalViewKeyword); } }); var boot = function(callback) { Ember.run(function() { App = Ember.Application.create({ name: 'App', rootElement: '#qunit-fixture' }); App.deferReadiness(); App.Router = Ember.Router.extend({ location: 'none' }); registry = App.registry; container = App.__container__; if (callback) { callback(); } }); var router = container.lookup('router:main'); Ember.run(App, 'advanceReadiness'); Ember.run(function() { router.handleURL('/'); }); }; QUnit.test('Unbound dashed helpers registered on the container can be late-invoked', function() { Ember.TEMPLATES.application = compile('<div id=\'wrapper\'>{{x-borf}} {{x-borf \'YES\'}}</div>'); let helper = new HandlebarsCompatibleHelper(function(val) { return arguments.length > 1 ? val : 'BORF'; }); boot(() => { registry.register('helper:x-borf', helper); }); equal(Ember.$('#wrapper').text(), 'BORF YES', 'The helper was invoked from the container'); ok(!helpers['x-borf'], 'Container-registered helper doesn\'t wind up on global helpers hash'); }); // need to make `makeBoundHelper` for HTMLBars QUnit.test('Bound helpers registered on the container can be late-invoked', function() { Ember.TEMPLATES.application = compile('<div id=\'wrapper\'>{{x-reverse}} {{x-reverse foo}}</div>'); boot(function() { registry.register('controller:application', Ember.Controller.extend({ foo: 'alex' })); registry.register('helper:x-reverse', makeBoundHelper(reverseHelper)); }); equal(Ember.$('#wrapper').text(), '-- xela', 'The bound helper was invoked from the container'); ok(!helpers['x-reverse'], 'Container-registered helper doesn\'t wind up on global helpers hash'); }); QUnit.test('Bound `makeViewHelper` helpers registered on the container can be used', function() { Ember.TEMPLATES.application = compile('<div id=\'wrapper\'>{{x-foo}} {{x-foo name=foo}}</div>'); boot(function() { registry.register('controller:application', Ember.Controller.extend({ foo: 'alex' })); registry.register('helper:x-foo', makeViewHelper(Ember.Component.extend({ layout: compile('woot!!{{attrs.name}}') }))); }); equal(Ember.$('#wrapper').text(), 'woot!! woot!!alex', 'The helper was invoked from the container'); }); if (isEnabled('ember-htmlbars-dashless-helpers')) { QUnit.test('Undashed helpers registered on the container can be invoked', function() { Ember.TEMPLATES.application = compile('<div id=\'wrapper\'>{{omg}}|{{yorp \'boo\'}}|{{yorp \'ya\'}}</div>'); expectDeprecation(function() { boot(function() { registry.register('helper:omg', function([value]) { return 'OMG'; }); registry.register('helper:yorp', makeBoundHelper(function(value) { return value; })); }, /Please use Ember.Helper.build to wrap helper functions./); }); equal(Ember.$('#wrapper').text(), 'OMG|boo|ya', 'The helper was invoked from the container'); }); } else { QUnit.test('Undashed helpers registered on the container can not (presently) be invoked', function() { // Note: the reason we're not allowing undashed helpers is to avoid // a possible perf hit in hot code paths, i.e. _triageMustache. // We only presently perform container lookups if prop.indexOf('-') >= 0 Ember.TEMPLATES.application = compile('<div id=\'wrapper\'>{{omg}}|{{omg \'GRRR\'}}|{{yorp}}|{{yorp \'ahh\'}}</div>'); expectAssertion(function() { boot(function() { registry.register('helper:omg', function() { return 'OMG'; }); registry.register('helper:yorp', makeBoundHelper(function() { return 'YORP'; })); }); }, /A helper named 'omg' could not be found/); }); } QUnit.test('Helpers can receive injections', function() { Ember.TEMPLATES.application = compile('<div id=\'wrapper\'>{{full-name}}</div>'); var serviceCalled = false; boot(function() { registry.register('service:name-builder', Ember.Service.extend({ build() { serviceCalled = true; } })); registry.register('helper:full-name', Helper.extend({ nameBuilder: Ember.inject.service('name-builder'), compute() { this.get('nameBuilder').build(); } })); }); ok(serviceCalled, 'service was injected, method called'); });
import { computed } from '@ember/object'; import Oauth2 from 'torii/providers/oauth2-code'; import { configurable } from 'torii/configuration'; /** * This class implements authentication against AzureAD * using the OAuth2 authorization flow in a popup window. * @class */ var AzureAdOauth2 = Oauth2.extend({ name: 'azure-ad-oauth2', baseUrl: computed(function() { return 'https://login.windows.net/' + this.get('tennantId') + '/oauth2/authorize'; }), tennantId: configurable('tennantId', 'common'), // additional url params that this provider requires requiredUrlParams: ['api-version', 'client_id'], optionalUrlParams: ['scope', 'nonce', 'response_mode'], responseMode: configurable('responseMode', null), responseParams: computed(function () { return [ this.get('responseType'), 'state' ]; }), apiVersion: '1.0', responseType: configurable('responseType', 'code'), redirectUri: configurable('redirectUri', function azureRedirectUri(){ // A hack that allows redirectUri to be configurable // but default to the superclass return this._super(); }) }); export default AzureAdOauth2;
require('../spec_helper'); import {itPropagatesAttributes} from '../support/shared_examples'; import {mergeProps} from '../../../src/pivotal-ui-react/helpers/helpers'; describe('lists', function() { const UnorderedList = require('../../../src/pivotal-ui-react/lists/lists').UnorderedList; const OrderedList = require('../../../src/pivotal-ui-react/lists/lists').OrderedList; const ListItem = require('../../../src/pivotal-ui-react/lists/lists').ListItem; const BreadcrumbList = require('../../../src/pivotal-ui-react/lists/lists').BreadcrumbList; const StepList = require('../../../src/pivotal-ui-react/lists/lists').StepList; const GroupList = require('../../../src/pivotal-ui-react/lists/lists').GroupList; const GroupListInverse = require('../../../src/pivotal-ui-react/lists/lists').GroupListInverse; const InlineList = require('../../../src/pivotal-ui-react/lists/lists').InlineList; function itRenders(Element, identifier, props = {}) { const testProps = { className: 'test-class', id: 'test-id', style: { opacity: '0.75' } }; beforeEach(function() { React.render( <Element {...mergeProps(props, testProps)}> <ListItem>A</ListItem> <ListItem>B</ListItem> </Element>, root); }); afterEach(function() { React.unmountComponentAtNode(root); }); itPropagatesAttributes(identifier, testProps); it('renders', function() { expect('#root li').toHaveLength(2); }); } describe('UnorderedList', function() { itRenders(UnorderedList, '#root ul'); it('adds list-unordered class', function() { expect('#root ul').toHaveClass('list-unordered'); }); }); describe('OrderedList', function() { itRenders(OrderedList, '#root ol'); }); describe('Checked List', function(){ itRenders(UnorderedList, '#root ul', {'checked': true}); it('adds list-checked class', function() { expect('#root ul').toHaveClass('list-checked'); }); }); describe('Unstyled List', function(){ itRenders(UnorderedList, '#root ul', {'unstyled': true}); it('adds the list-unstyled class', function() { expect('#root ul').toHaveClass('list-unstyled'); }); }); describe('BreadcrumbList', function(){ itRenders(BreadcrumbList, '#root ul'); it('adds the list-breadcrumb class', function() { expect('#root ul').toHaveClass('list-breadcrumb'); }); }); describe('StepList', function(){ itRenders(StepList, '#root ol'); it('adds the list-steps class', function(){ expect('#root ol').toHaveClass('list-steps'); }); }); describe('GroupList', function(){ itRenders(GroupList, '#root ul'); it('adds the list-group class', function(){ expect('#root ul').toHaveClass('list-group'); expect('#root ul li:first').toHaveClass('list-group-item'); }); }); describe('GroupListInverse', function(){ itRenders(GroupListInverse, '#root ul'); it('adds the list-group-inverse class', function(){ expect('#root ul').toHaveClass('list-group-inverse'); expect('#root ul li:first').toHaveClass('list-group-item'); }); }); describe('InlineList without divider', function(){ itRenders(InlineList, '#root ul'); it('adds list-inline classes', function(){ expect('#root ul').toHaveClass('list-inline'); expect('#root ul').not.toHaveClass('list-inline-divider'); }); }); describe('List which is inline with divider', function(){ itRenders(InlineList, '#root ul', {'divider': true}); it('adds list-inline-divider classes', function(){ expect('#root ul').toHaveClass('list-inline-divider'); }); }); describe('List spacing', function(){ ['n', 's', 'm', 'l', 'xl'].forEach(function(size){ describe('vertical spacing', function() { itRenders(UnorderedList, '#root ul', {'spacing': size}); it('adds a' + size + 'vertical spacing class', function(){ expect('#root ul').toHaveClass('lv' + size); }); }); describe('horizontal spacing', function() { itRenders(InlineList, '#root ul', {'spacing': size}); it('adds a' + size + 'horizontal spacing class', function(){ expect('#root ul').toHaveClass('lh' + size); }); }); }); }); describe('ListItem', () => { const testItemProps = { className: 'test-item-class', id: 'test-item-id', style: { opacity: '0.5' } }; beforeEach(function() { React.render( <ul> <ListItem {...testItemProps}>A</ListItem> </ul>, root ); }); itPropagatesAttributes('#root li:first', testItemProps); }); });
var path = require('path'); var webpack = require('webpack'); var AUTOPREFIXER_LOADER = 'autoprefixer-loader?{browsers:[' + '"Android 2.3", "Android >= 4", "Chrome >= 20", "Firefox >= 24", ' + '"Explorer >= 8", "iOS >= 6", "Opera >= 12", "Safari >= 6"]}'; module.exports = { devtool: 'source-map', entry: { subschema: './src/index.jsx' }, devServer: { contentBase: path.join(__dirname, ".build"), info: true, // --no-info option hot: true, inline: true, port: 8084 }, output: { path: path.join(__dirname, "dist"), filename: 'subschema.js', libraryTarget: 'umd', library: 'Subschema' }, externals: [{ 'react/addons': 'react', react: true }], stats: { colors: true, reasons: true }, module: { loaders: [ { test: /\.js(x)?$/, excludes: /node_modules/, //do this to prevent babel fromt tanslating everything. includes: [ '~/node_modules/react', '~/node_modules/react-router', '~/node_modules/react-bootstrap', '~/node_modules/subschema-builder' ], loaders: ['babel-loader?stage=0'] }, {test: /\.(png|woff|woff2|eot|ttf|svg)$/, loader: 'url-loader?limit=100000'}, {test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&minetype=application/font-woff"}, {test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&minetype=application/octet-stream"}, {test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: "file"}, // {test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&minetype=image/svg+xml"}, // Optionally extract less files // or any other compile-to-css language { test: /\.css$/, loader: 'style-loader!css-loader!' + AUTOPREFIXER_LOADER }, { test: /\.less$/, loader: 'style!css!less-loader' } ] }, /* resolve: { alias: { 'subschema': __dirname } },*/ plugins: [ new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development') }), function () { this.plugin("done", function (stats) { stats = stats.toJson(); console.error(JSON.stringify({ assetsByChunkName: stats.assetsByChunkName })); }); } ] };
const path = require('path'); const webpack = require('webpack'); const Copy = require('copy-webpack-plugin'); const nodeEnv = process.env.NODE_ENV || 'development'; const isProd = nodeEnv === 'production'; module.exports = { resolve: { extensions: ['.js', '.jsx'] }, devtool: isProd ? 'hidden-source-map' : 'cheap-module-source-map', entry: './lib/index.js', output: { path: path.join(__dirname, 'app', 'renderer'), filename: 'bundle.js' }, module: { rules: [ { test: /\.(js|jsx)$/, exclude: /node_modules/, loader: 'babel-loader' }, { test: /\.json/, loader: 'json-loader' }, // for xterm.js { test: /\.css$/, loader: 'style-loader!css-loader' } ] }, plugins: [ new webpack.IgnorePlugin(/.*\.js.map$/i), new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify(nodeEnv) } }), new Copy([ { from: './assets', to: './assets' } ]) ], target: 'electron' };
/* * demi * https://github.com/enytc/demi * * Copyright (c) 2014 EnyTC Corporation * Licensed under the BSD license. */ 'use strict'; module.exports = { /* * GET /routes */ /* * GET /routes/index */ index: { method: 'GET', fn: function (req, res) { res.jsonp(200, { message: 'Request received successfully!', method: req.method }); } }, /* * POST /routes */ post: { method: 'POST', fn: function (req, res) { res.jsonp(200, { message: 'Request received successfully!', method: req.method }); } }, /* * PUT /routes */ put: { method: 'PUT', fn: function (req, res) { res.jsonp(200, { message: 'Request received successfully!', method: req.method }); } }, /* * DELETE /routes */ delete: { method: 'DELETE', fn: function (req, res) { res.jsonp(200, { message: 'Request received successfully!', method: req.method }); } } };
import { _ as __vue_normalize__, r as registerComponent, u as use } from './chunk-cca88db8.js'; var script = { name: 'BCollapse', // deprecated, to replace with default 'value' in the next breaking change model: { prop: 'open', event: 'update:open' }, props: { open: { type: Boolean, default: true }, animation: { type: String, default: 'fade' }, ariaId: { type: String, default: '' }, position: { type: String, default: 'is-top', validator: function validator(value) { return ['is-top', 'is-bottom'].indexOf(value) > -1; } } }, data: function data() { return { isOpen: this.open }; }, watch: { open: function open(value) { this.isOpen = value; } }, methods: { /** * Toggle and emit events */ toggle: function toggle() { this.isOpen = !this.isOpen; this.$emit('update:open', this.isOpen); this.$emit(this.isOpen ? 'open' : 'close'); } }, render: function render(createElement) { var trigger = createElement('div', { staticClass: 'collapse-trigger', on: { click: this.toggle } }, this.$scopedSlots.trigger ? [this.$scopedSlots.trigger({ open: this.isOpen })] : [this.$slots.trigger]); var content = createElement('transition', { props: { name: this.animation } }, [createElement('div', { staticClass: 'collapse-content', attrs: { 'id': this.ariaId }, directives: [{ name: 'show', value: this.isOpen }] }, this.$slots.default)]); return createElement('div', { staticClass: 'collapse' }, this.position === 'is-top' ? [trigger, content] : [content, trigger]); } }; /* script */ const __vue_script__ = script; /* template */ /* style */ const __vue_inject_styles__ = undefined; /* scoped */ const __vue_scope_id__ = undefined; /* module identifier */ const __vue_module_identifier__ = undefined; /* functional template */ const __vue_is_functional_template__ = undefined; /* style inject */ /* style inject SSR */ var Collapse = __vue_normalize__( {}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, undefined, undefined ); var Plugin = { install: function install(Vue) { registerComponent(Vue, Collapse); } }; use(Plugin); export default Plugin; export { Collapse as BCollapse };
var mongoose = require('mongoose'); var Schema = mongoose.Schema; var mongoosastic = require('mongoosastic'); var dateUtils = require('../utils/date.js'); /** * ไบงๅ“ๆ‹›ๅ•†ๆ•ฐๆฎ่กจ * :name: ้€š็”จๅ * :name_co: ๅ•†ๅ“ๅ * :abstract: ไป‹็ป(็”จไบŽๅˆ—่กจ้กต้ขๆ˜พ็คบ) * :specification: ่ง„ๆ ผ * :package: ๅŒ…่ฃ… * :wholesale_price: ๆ‰นๅ‘ไปทๆ ผ * :investment_price: ๆ‹›ๅ•†ไปทๆ ผ * :production_company: ็”Ÿไบงไผไธš * :manual: ่ฏดๆ˜Ž * :other: ๅ…ถไป– * :kind: ๅˆ†็ฑป * :date: ๆทปๅŠ ๆ—ฅๆœŸ */ var Merchant = new Schema({ name: { type: String, es_indexed: true, es_type: 'String' }, name_co: { type: String, required: false, es_indexed: true, es_type: 'String' }, abstract: { type: String }, specification: { type: String, }, package: { type: String }, wholesale_price: { type: String, required: false }, investment_price: { type: String, required: false }, production_company: { type: String, required: false }, manual: { type: String }, other: { type: String, required: false }, kind: { type: [String], required: false }, date: { type: Date, default: Date.now } }); // 2016-07-07 ไฟฎๆ”นไบงๅ“ๅˆ†็ฑปไธบ็ฒพ็ฅž็ฑป่ฏ็‰ฉ, ็ป็šฎ็ณป็ปŸ็ป™่ฏ, ๅ„ฟ็ซฅ่ฏ, ไปฟๅˆถ่ฏ Merchant.virtual('kindString').get(function() { var result = "" var mapping = { psychiatric: '็ฒพ็ฅž็ฑป่ฏ็‰ฉ', creative: '็ป็šฎ็ณป็ปŸ็ป™่ฏ', children: 'ๅ„ฟ็ซฅ่ฏ', generics: 'ไปฟๅˆถ่ฏ' }; for (var i = 0; i < this.kind.length; i ++) { result += mapping[this.kind[i]] + ' '; } return result; }); Merchant.virtual('kind_string').get(function() { var result = '["all"' for (var i = 0; i < this.kind.length; i++) { result += ',"' + this.kind[i] + '"' } result += ']'; return result; }); Merchant.virtual('dateString').get(function() { return dateUtils.humanizedDateFormatter(this.date); }); Merchant.plugin(mongoosastic, {index: 'ddld'}); var MerchantModel = mongoose.model('Merchant', Merchant); var stream = MerchantModel.synchronize(); var count = 0; MerchantModel.createMapping(function(err, mapping) { if (err) { console.log('err creating mapping (you can safely ignore this)'); console.log(err); } else { console.log('MerchantModel mapping created!'); console.log(mapping); } }); stream.on('data', function(err, doc) { count ++; }); stream.on('close', function() { console.log('MerchantModel indexed ' + count + ' documents!'); }) stream.on('error', function(err) { console.log(err); }); module.exports = MerchantModel;
define(["./BaseCccComponent","../lib/CCC/pvc"],function(e,c){var n=e.extend({cccType:c.AreaChart}); return n});
/** * list country.js: General Javascript Library for VirtueMart Administration * Note Patrick kohl : Found many bugs, completly brake in case of multiple list! * Now the json cache (optCache) is common for all calls(states are always same for each country) * and not set for each select list anymore. * @package VirtueMart * @subpackage Javascript Library * @author Patrick Kohl * @copyright Copyright (c) 2011VirtueMart Team. All rights reserved. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL */ (function($){ var undefined, optCache = [], ids, methods = { list: function(options) { var self = this ; var dest = options.dest; var ids = options.ids; if (ids.length) methods.update(self,dest,ids); $(self).change( function() { methods.update(self,dest)}); }, update: function(org,dest,ids) { var opt = $(org), optValues = opt.val() || [], byAjax = [] ; if (!$.isArray(optValues)) optValues = jQuery.makeArray(optValues); if ( typeof org.oldValues !== "undefined") { //remove if not in optValues $.each(org.oldValues, function(key, oldValue) { if ( ($.inArray( oldValue, optValues )) < 0 ) $(dest+'group'+oldValue+"").remove(); }); } //push in 'byAjax' values and do it in ajax $.each(optValues, function(optkey, optValue) { if( optCache[ 'd'+optValue ] === undefined ) byAjax.push( optValue ); }); if (byAjax.length >0) { $.getJSON('index.php?option=com_virtuemart&view=state&format=json&virtuemart_country_id=' + byAjax, function(result){ // Max Bitte Testen // NOTE patrick Kohl, does not work with 2 list(id is same var virtuemart_state_id = $(dest); var status = virtuemart_state_id.attr('required'); if(status == 'required') { if( result[byAjax].length > 0 ) { virtuemart_state_id.attr('required','required'); } else { virtuemart_state_id.removeAttr('required'); } } // ENDE $.each(result, function(key, value) { if (value.length >0) { optCache[ 'd'+key ] = value ; } else { optCache[ 'd'+key ] = 0 ; } }); methods.addToList(opt,optValues,dest); if ( typeof ids !== "undefined") { var states = ids.length ? ids.split(',') : [] ; $.each(states, function(k,id) { $(dest).find('[value='+id+']').attr("selected","selected"); }); } $(dest).trigger("liszt:updated"); } ); } else { methods.addToList(opt,optValues,dest); $(dest).trigger("liszt:updated"); } org.oldValues = optValues ; }, addToList: function(opt,values,dest) { var id = $(dest).attr('id'); $.each(values, function(dataKey, dataValue) { var groupId = dest+'group'+dataValue, groupExist = $(groupId).size(); if ( ! groupExist ) { var datas = optCache[ 'd'+dataValue ]; if (datas.length >0) { var label = opt.find("option[value='"+dataValue+"']").text(); var group ='<optgroup id="'+id+'group'+dataValue+'" label="'+label+'">'; $.each( datas , function( key, value) { //if (value) group +='<option value="'+ key +'">'+ value.v +'</option>'; if (value) group +='<option value="'+ value.virtuemart_state_id +'">'+ value.state_name +'</option>'; }); group += '</optgroup>'; $(dest).append(group); } } }); } }; $.fn.vm2front = function( method ) { if ( methods[method] ) { return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 )); } else if ( typeof method === 'object' || ! method ) { return methods.init.apply( this, arguments ); } else { $.error( 'Method ' + method + ' does not exist on Vm2 front jQuery library' ); } }; })(jQuery)
'use strict'; angular.module('owm.person') .controller('PersonContractEditController', function ($timeout, $log, $modalInstance, dialogService, $translate, $scope, alertService, contractService, contract) { var originalContract = contract; $scope.contract = angular.copy(originalContract); $scope.busy = false; function saveContract (newProps) { $scope.busy = true; contractService.alter({ id : $scope.contract.id, newProps: newProps }) .then(function (newContract) { alertService.addSaveSuccess(); angular.extend(contract, newContract); $modalInstance.close(); $scope.busy = false; }) .catch(function (err) { alertService.addError(err); }) .finally(function () { $scope.busy = false; }); } function endContract () { $scope.busy = true; contractService.alter({ id: $scope.contract.id, newProps: { status: 'blocked' } }) .then(function (newContract) { alertService.addSaveSuccess(); angular.extend(contract, newContract); $modalInstance.close(); $scope.busy = false; }) .catch(function (err) { alertService.addError(err); }) .finally(function () { $scope.busy = false; }); } $scope.save = function () { var newProps = {}; if ($scope.contract.ownRiskWaiver !== originalContract.ownRiskWaiver) { newProps.ownRiskWaiver = $scope.contract.ownRiskWaiver; } if (Object.keys(newProps).length) { saveContract(newProps); } }; $scope.endContract = function (contract) { dialogService.showModal(null, { closeButtonText: $translate.instant('CANCEL'), actionButtonText: $translate.instant('CONFIRM'), headerText: $translate.instant('CONTRACT_END_ACTION'), bodyText: $translate.instant('CONTRACT_END_CONFIRM_DESC') }).then(function () { endContract(); }); }; $scope.cancel = function () { $modalInstance.dismiss(); }; }) ;
'use strict'; var Curry = require("../../lib/js/curry.js"); var Caml_js_exceptions = require("../../lib/js/caml_js_exceptions.js"); function f(g, x) { try { return Curry._1(g, x); } catch (raw_exn){ var exn = Caml_js_exceptions.internalToOCamlException(raw_exn); if (exn.RE_EXN_ID === "Not_found") { return 3; } throw exn; } } exports.f = f; /* No side effect */
var EventLauncher = function () { this.keyCodes = { "0": 48, "1": 49, "2": 50, "3": 51, "4": 52, "5": 53, "6": 54, "7": 55, "8": 56, "9": 57, "backspace": 8, "tab": 9, "enter": 13, "shift": 16, "ctrl": 17, "alt": 18, "pause": 19, "break": 19, "caps lock": 20, "escape": 27, "page up": 33, "page down": 34, "end": 35, "home": 36, "left arrow": 37, "up arrow": 38, "right arrow": 39, "down arrow": 40, "insert": 45, "delete": 46, "a": 65, "b": 66, "c": 67, "d": 68, "e": 69, "f": 70, "g": 71, "h": 72, "i": 73, "j": 74, "k": 75, "l": 76, "m": 77, "n": 78, "o": 79, "p": 80, "q": 81, "r": 82, "s": 83, "t": 84, "u": 85, "v": 86, "w": 87, "x": 88, "y": 89, "z": 90, "left window key": 91, "right window key": 92, "select key": 93, "numpad 0": 96, "numpad 1": 97, "numpad 2": 98, "numpad 3": 99, "numpad 4": 100, "numpad 5": 101, "numpad 6": 102, "numpad 7": 103, "numpad 8": 104, "numpad 9": 105, "multiply": 106, "add": 107, "subtract": 109, "decimal point": 110, "divide": 111, "f1": 112, "f2": 113, "f3": 114, "f4": 115, "f5": 116, "f6": 117, "f7": 118, "f8": 119, "f9": 120, "f10": 121, "f11": 122, "f12": 123, "num lock": 144, "scroll lock": 145, "semicolon": 186, "equal sign": 187, "comma": 188, "dash": 189, "period": 190, "forward slash": 191, "grave accent": 192, "open bracket": 219, "back slash": 220, "close bracket": 221, "single quote": 222 }; this.fire = function (selector, eventType) { console.log('Attempting to fire "' + eventType + '" at "' + selector + '"'); var targetObject = document.querySelector(selector); // Don't do anything with non existing or hidden objects if (!targetObject || (targetObject.style && targetObject.style.display === "none")) { console.log('Could not find "' + selector + '"'); return false; } targetObject.value = 'something'; var evt; switch (eventType) { case "keyup": case "keydown": case "keypress": evt = this.createKeyboardEvent(eventType, 'enter'); // allow setting it break; case "click": evt = this.createMouseEvent(eventType); break; } if (!evt) { console.log('No event created, "' + eventType + '" is probably not yet supported'); return false; } targetObject.dispatchEvent ? targetObject.dispatchEvent(evt) : targetObject.fireEvent("on" + eventType, evt); return true; }; this.createKeyboardEvent = function (eventType, keyString) { var keyboardEvent = document.createEventObject ? document.createEventObject() : document.createEvent("Events"); if (keyboardEvent.initEvent) { keyboardEvent.initEvent(eventType, true, true); } var keyCode = this.getKeyCode(keyString); keyboardEvent.keyCode = keyCode; keyboardEvent.which = keyCode; return keyboardEvent; }; this.createMouseEvent = function (eventType) { try { // DOM lvl 3 return new MouseEvent(eventType, { bubbles: true, cancelable: true, view: window }); } catch (err) { if (document.createEvent) { // DOM lvl 2 var evt = document.createEvent('MouseEvents'); evt.initMouseEvent(eventType, true, true, window); return evt; } } } this.getKeyCode = function (keyString) { if (this.keyCodes.hasOwnProperty(keyString)) { return this.keyCodes[keyString]; } return 0; }; }; var eventLauncher = new EventLauncher(); if (window !== undefined) { window.eventLauncher = eventLauncher; }
// Extends jQuery API jQuery.extend({uniqueArray:function(array){ return $.grep(array, function(el, index) { return index === $.inArray(el, array); }); }}); function removeByValue(arr, val) { for(var i=0; i<arr.length; i++) { if(arr[i] == val) { arr.splice(i, 1); break; } } } function paramOfUrl( url, param ) { param = param.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); var regexS = "[\\?&]"+param+"=([^&#]*)"; var regex = new RegExp( regexS ); var results = regex.exec( url ); if( results == null ) { return ""; } else { return results[1]; } } function addBibToContext( bibnum ) { bibnum = parseInt(bibnum, 10); var bibnums = getContextBiblioNumbers(); bibnums.push(bibnum); setContextBiblioNumbers( bibnums ); setContextBiblioNumbers( $.uniqueArray( bibnums ) ); } function delBibToContext( bibnum ) { var bibnums = getContextBiblioNumbers(); removeByValue( bibnums, bibnum ); setContextBiblioNumbers( $.uniqueArray( bibnums ) ); } function setContextBiblioNumbers( bibnums ) { $.cookie('bibs_selected', JSON.stringify( bibnums )); } function getContextBiblioNumbers() { var r = $.cookie('bibs_selected'); if ( r ) { return JSON.parse(r); } r = new Array(); return r; } function resetSearchContext() { setContextBiblioNumbers( new Array() ); } $(document).ready(function(){ // forms with action leading to search $("form[action*='search.pl']").submit(function(){ resetSearchContext(); }); // any link to launch a search except navigation links $("[href*='search.pl?']").not(".nav").not('.searchwithcontext').click(function(){ resetSearchContext(); }); // any link to a detail page from the results page. $("#bookbag_form a[href*='detail.pl?']").click(function(){ resetSearchContext(); }); });
jQuery(document).ready(function($) { function _reiszeImage(){ $('.card-image').each(function() { var maxWidth = $(this).data('maxwidth'); var maxHeight = $(this).data('maxheight'); var _mratio = maxWidth/maxHeight; var _imageContainer = $(this); $(this).find('img').each(function(index) { var ratio = $(this).data('ratio'); var width = $(this).data('width'); var height = $(this).data('height'); if(ratio<_mratio){ // _imageContainer.css('width', maxWidth); // _imageContainer.css({ // 'width': maxWidth // }); $(this).css("min-height", maxHeight); } // Check if current height is larger than max if(ratio>=_mratio){ // _imageContainer.css({ // 'width': maxHeight*ratio // }); // $(this).css("width", maxHeight*ratio); $(this).css("min-width", maxWidth); } }); }); } $('.cq-cards-container').each(function(index) { var _this = $(this); var _imageposition = $(this).data('imageposition'); var _backgroundcolor = $(this).data('backgroundcolor'); var _captioncolor = $(this).data('captioncolor'); var _buttonbg = $(this).data('buttonbg'); var _buttonhoverbg = $(this).data('buttonhoverbg'); var _minheight = $(this).data('minheight') || 160; var _smallheight = $(this).data('smallheight') || 100; var _autoplayspeed = $(this).data('autoplayspeed') || 4000; var _titlesize = $(this).data('titlesize') || '1.2em'; _this.css({ 'background-color': _backgroundcolor, 'color': _captioncolor }); _this.find('h3').css({ 'color': _captioncolor, 'font-size': _titlesize });; $('.card-image-container', _this).css({ 'height': _minheight }); if(_buttonbg!=""){ var _buttons = $('.card-caption-container .cq-button', _this); _buttons.css('background-color', _buttonbg); _buttons.on('mouseover', function(event) { $(this).css('background-color', _buttonhoverbg); }).on('mouseleave', function(event) { $(this).css('background-color', _buttonbg); }); } var _carousel = $('.card-image', _this).slick({ arrow: false, dots: false, slidesToShow: 1, autoplay: true, autoplaySpeed: _autoplayspeed, slidesToScroll: 1, infinite: false, arrows: false }); var _index = index; _this.find('a.cq-thumb-lightbox').each(function(index) { $(this).attr('rel', 'cq-gallery'+_index).boxer({ fixed : true }); }); $(window).on('resize', function(event) { var _w = $(this).width(); if(_w<=480){ // $('.card-image-container, .card-caption-container', _this).css({ // 'height': _smallheight // }); }else{ if(_imageposition!="top"&&_imageposition!="bottom"){ var _containerheight = $('.card-image-container', _this).height(); var _captionheight = $('.card-caption-container', _this).height(); $('.card-caption-container', _this).css('margin-top', (_containerheight - _captionheight)*0.5); } } // var _cwidth = $('.caption-content', _this).outerWidth(); // var _cheight = $('.caption-content', _this).outerHeight(); // var _w = $(this).width(); // if(_w>=768){ // // $('.card-caption-container', _this).css({ // // 'min-height': _cheight // // }); // }else{ // $('.card-caption-container', _this).css({ // 'height': _cheight // }); // $('.card-image-container', _this).css({ // 'height': _cheight // }) // } // $('.card-image').data('maxwidth', _cwidth); // $('.card-image').data('maxheight', _cheight); // $('.card-image-container', _this).css({ // 'height': _cheight // }); // if(!$('.card-image-container', _this).hasClass('top')){ // $('.card-image').css({ // 'width': _cwidth // // 'height': _cheight // });; // $('.cq-link-block').css('height', _cheight) // _reiszeImage(); // } // _reiszeImage(); }); $(window).trigger('resize'); }); });
/* * jQuery File Upload Plugin JS Example * https://github.com/blueimp/jQuery-File-Upload * * Copyright 2010, Sebastian Tschan * https://blueimp.net * * Licensed under the MIT license: * http://www.opensource.org/licenses/MIT */ /* global $, window */ $(function () { 'use strict'; var sub_hv = $('#submission_id_field').val(); var typ_hv = $('#type_field').val(); // Initialize the jQuery File Upload widget: $('#fileupload').fileupload({ // Uncomment the following to send cross-domain cookies: //xhrFields: {withCredentials: true}, url: '/submission/book/' + sub_hv + '/type/' + typ_hv + '/upload/' }); // Enable iframe cross-domain access via redirect option: $('#fileupload').fileupload( 'option', 'redirect', window.location.href.replace( /\/[^\/]*$/, '/cors/result.html?%s' ) ); if (window.location.hostname === 'blueimp.github.io') { // Demo settings: $('#fileupload').fileupload('option', { url: '/submission/book/19/upload/', // Enable image resizing, except for Android and Opera, // which actually support image resizing, but fail to // send Blob objects via XHR requests: disableImageResize: /Android(?!.*Chrome)|Opera/ .test(window.navigator.userAgent), maxFileSize: 999000, acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i }); // Upload server status check for browsers with CORS support: if ($.support.cors) { $.ajax({ url: '//jquery-file-upload.appspot.com/', type: 'HEAD' }).fail(function () { $('<div class="alert alert-danger"/>') .text('Upload server currently unavailable - ' + new Date()) .appendTo('#fileupload'); }); } } else { // Load existing files: $('#fileupload').addClass('fileupload-processing'); $.ajax({ // Uncomment the following to send cross-domain cookies: //xhrFields: {withCredentials: true}, url: $('#fileupload').fileupload('option', 'url'), dataType: 'json', context: $('#fileupload')[0] }).always(function () { $(this).removeClass('fileupload-processing'); }).done(function (result) { $(this).fileupload('option', 'done') .call(this, $.Event('done'), {result: result}); }); } });
/* Quick Pager jQuery plugin Copyright (C) 2011 by Dan Drayne 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. v1.1 18/09/09 * bug fix by John V - http://blog.geekyjohn.com/ v1.2 09/29/2014 Modified for Strong Testimonials WordPress plugin by Chris Dillon chris@wpmission.com */ (function($) { $.fn.quickPager = function(options) { var defaults = { pageSize: 10, currentPage: 1, holder: null, pagerLocation: "after" }; var options = $.extend(defaults, options); return this.each(function() { var selector = $(this); var pageCounter = 1; selector.wrap("<div class='simplePagerContainer'></div>"); selector.children().each(function(i){ if(i < pageCounter*options.pageSize && i >= (pageCounter-1)*options.pageSize) { $(this).addClass("simplePagerPage"+pageCounter); } else { $(this).addClass("simplePagerPage"+(pageCounter+1)); pageCounter ++; } }); // show/hide the appropriate regions selector.children().hide(); selector.children(".simplePagerPage"+options.currentPage).show(); if(pageCounter <= 1) { return; } //Build pager navigation var pageNav = "<ul class='simplePagerNav'>"; for (i=1;i<=pageCounter;i++){ if (i==options.currentPage) { pageNav += "<li class='currentPage simplePageNav"+i+"'><a rel='"+i+"' href='#'>"+i+"</a></li>"; } else { pageNav += "<li class='simplePageNav"+i+"'><a rel='"+i+"' href='#'>"+i+"</a></li>"; } } pageNav += "</ul>"; if(!options.holder) { switch(options.pagerLocation) { case "before": selector.before(pageNav); break; case "both": selector.before(pageNav); selector.after(pageNav); break; default: selector.after(pageNav); } } else { $(options.holder).append(pageNav); } //pager navigation behaviour selector.parent().find(".simplePagerNav a").click(function() { //grab the REL attribute var clickedLink = $(this).attr("rel"); options.currentPage = clickedLink; if(options.holder) { $(this).parent("li").parent("ul").parent(options.holder).find("li.currentPage").removeClass("currentPage"); $(this).parent("li").parent("ul").parent(options.holder).find("a[rel='"+clickedLink+"']").parent("li").addClass("currentPage"); } else { //remove current current (!) page $(this).parent("li").parent("ul").parent(".simplePagerContainer").find("li.currentPage").removeClass("currentPage"); //Add current page highlighting $(this).parent("li").parent("ul").parent(".simplePagerContainer").find("a[rel='"+clickedLink+"']").parent("li").addClass("currentPage"); } //hide and show relevant links selector.children().hide(); selector.find(".simplePagerPage"+clickedLink).show(); // Modified for Strong Testimonials // -------------------------------- // Scroll up for any nav click // // Special cases: // WooCommerce product tabs if(selector.closest(".woocommerce-tabs").length) { var offset = selector.closest(".woocommerce-tabs").offset(); } else { var offset = selector.closest(".simplePagerContainer").offset(); } var scrollto = offset.top; // is WordPress admin bar showing? if($("#wpadminbar").length) { scrollto -= 32; } $("html, body").animate({scrollTop:scrollto}, 800); return false; }); }); } })(jQuery);
var group__os__abstraction__ucosiii = [ [ "event_ucosiii", "group__os__abstraction__ucosiii.html#structevent__ucosiii", [ [ "group", "group__os__abstraction__ucosiii.html#a6157b8869dcfce2c5939443b91599a87", null ], [ "clearMode", "group__os__abstraction__ucosiii.html#abd3a7f9087c7d1e7c1144f387d6919e5", null ] ] ], [ "msgq_struct_ucosiii", "group__os__abstraction__ucosiii.html#structmsgq__struct__ucosiii", [ [ "queue", "group__os__abstraction__ucosiii.html#ad3748bab809bfa3ef15ad89c0f8dfaed", null ], [ "mem", "group__os__abstraction__ucosiii.html#aee806e8e6a6d2898c3e01e59b2414b7a", null ], [ "msgs", "group__os__abstraction__ucosiii.html#a943d2a48099d9d9a3ec0e2f101ebd237", null ], [ "size", "group__os__abstraction__ucosiii.html#a06993f0ae6529cd6ff2ee93193a47245", null ] ] ], [ "OSA_WAIT_FOREVER", "group__os__abstraction__ucosiii.html#ga5c4bbd97efaa670e198fad62038ba771", null ], [ "FSL_OSA_TIME_RANGE", "group__os__abstraction__ucosiii.html#ga0b8cb2e5f9f9863520c4c9e4c3c47e3f", null ], [ "OSA_DEFAULT_INT_HANDLER", "group__os__abstraction__ucosiii.html#ga50f035ff4993767f49ca67b3847bfec4", null ], [ "OSA_TASK_DEFINE", "group__os__abstraction__ucosiii.html#ga37ea523ee533242cf8b8c3706a93d818", null ], [ "PRIORITY_OSA_TO_RTOS", "group__os__abstraction__ucosiii.html#ga115e0f268febab4a227d3c84e74c1d63", null ], [ "MSG_QUEUE_DECLARE", "group__os__abstraction__ucosiii.html#gad27d9381348700acda99a4eedad3a0d7", null ], [ "task_handler_t", "group__os__abstraction__ucosiii.html#gafe4d86b808819d31d5e4039bf86e4848", null ], [ "task_stack_t", "group__os__abstraction__ucosiii.html#ga3371214ce554ec0ea6672060ce6a43b5", null ], [ "task_param_t", "group__os__abstraction__ucosiii.html#ga90774a4d1708f3e210d94c829b44eb86", null ], [ "task_t", "group__os__abstraction__ucosiii.html#gad138ff72ead35c2ed90c90302fb0da1e", null ], [ "semaphore_t", "group__os__abstraction__ucosiii.html#gac69b2f5fc1ee3b41d44af8286405964f", null ], [ "mutex_t", "group__os__abstraction__ucosiii.html#ga256489a6f9314506ab837414135b36d9", null ], [ "event_flags_t", "group__os__abstraction__ucosiii.html#ga4e7a95bf753594c905aaf7f57f435902", null ], [ "event_t", "group__os__abstraction__ucosiii.html#ga4f9b2ac0bc48c96a773251d52230f5d5", null ], [ "msg_queue_t", "group__os__abstraction__ucosiii.html#ga203adf2148ee88a3ac432ec2d8046ce7", null ], [ "msg_queue_handler_t", "group__os__abstraction__ucosiii.html#ga04ee0d756e55f89abf869dcab383535c", null ] ];
var gulp = require('gulp'); var del = require('del'); var mkdirp = require('mkdirp'); gulp.task('reCreateBuildDir', function(){ del.sync('build/'); mkdirp.sync('build/'); })
$(document).ready(function(){ $('.data-table').dataTable({ 'oLanguage':{ 'sSearch':'Pesquisar:', 'sInfo': 'Mostrando _START_ a _END_ de _TOTAL_ registros' }, 'sScrollY':'305px', 'sScrollX':'95%', 'sScrollXInner':'95%', 'bPaginate':false, 'aaSorting':[[0,'asc']] }); $('dataTable_filter label').first().focus(); });
/* * favcount.js v1.4.0 * http://chrishunt.co/favcount * Dynamically updates the favicon with a number. * * Copyright 2013, Chris Hunt * Released under the MIT license */ (function(){ function Favcount(icon) { this.icon = icon; this.opacity = 0.4; this.canvas = document.createElement('canvas'); this.font = "Helvetica, Arial, sans-serif"; } Favcount.prototype.set = function(count) { var self = this, img = document.createElement('img'); if (self.canvas.getContext) { img.onload = function() { drawCanvas(self.canvas, self.opacity, self.font, img, normalize(count)); }; img.src = this.icon; } }; function normalize(count) { count = Math.round(count); if (isNaN(count) || count < 1) { return ''; } else if (count < 10) { return ' ' + count; } else if (count > 99) { return '99'; } else { return count; } } function drawCanvas(canvas, opacity, font, img, count) { var head = document.getElementsByTagName('head')[0], favicon = document.createElement('link'), multiplier, fontSize, context, xOffset, yOffset, border, shadow; favicon.rel = 'icon'; // Scale canvas elements based on favicon size multiplier = img.width / 16; fontSize = multiplier * 11; xOffset = multiplier; yOffset = multiplier * 11; border = multiplier; shadow = multiplier * 2; canvas.height = canvas.width = img.width; context = canvas.getContext('2d'); context.font = 'bold ' + fontSize + 'px ' + font; // Draw faded favicon background if (count) { context.globalAlpha = opacity; } context.drawImage(img, 0, 0); context.globalAlpha = 1.0; // Draw white drop shadow context.shadowColor = '#FFF'; context.shadowBlur = shadow; context.shadowOffsetX = 0; context.shadowOffsetY = 0; // Draw white border context.fillStyle = '#FFF'; context.fillText(count, xOffset, yOffset); context.fillText(count, xOffset + border, yOffset); context.fillText(count, xOffset, yOffset + border); context.fillText(count, xOffset + border, yOffset + border); // Draw black count context.fillStyle = '#000'; context.fillText(count, xOffset + (border / 2.0), yOffset + (border / 2.0) ); // Replace favicon with new favicon favicon.href = canvas.toDataURL('image/png'); head.removeChild(document.querySelector('link[rel=icon]')); head.appendChild(favicon); } this.Favcount = Favcount; }).call(this); (function(){ Favcount.VERSION = '1.4.0'; }).call(this);
(function () { 'use strict'; test('LayoutMode.getSegmentSize', function () { var iso = new Isotope('#get-segment-size', { layoutMode: 'cellsByRow', itemSelector: '.item', cellsByRow: { columnWidth: 17, rowHeight: 23 } }); var cellsByRow = iso.modes.cellsByRow; equal(cellsByRow.columnWidth, 17, 'explicit columnWidth option set'); equal(cellsByRow.rowHeight, 23, 'explicit rowHeight option set'); // set element sizing iso.options.cellsByRow.columnWidth = '.grid-sizer'; iso.options.cellsByRow.rowHeight = '.grid-sizer'; cellsByRow.getColumnWidth(); cellsByRow.getRowHeight(); equal(cellsByRow.columnWidth, 57, 'element sizing columnWidth'); equal(cellsByRow.rowHeight, 47, 'element sizing rowHeight'); // default to first item delete iso.options.cellsByRow.columnWidth; delete iso.options.cellsByRow.rowHeight; cellsByRow.getColumnWidth(); cellsByRow.getRowHeight(); equal(cellsByRow.columnWidth, 60, 'first item columnWidth'); equal(cellsByRow.rowHeight, 30, 'first item rowHeight'); }); })();
/** * Creates a Wget command for a target automagically filling the... * continue, referrer, user-agent, cookies, no-check-cert parameters * * @param {string} tabUrl current URL of tab * @param {string} targetUrl URL to download * @param {Array|Wget2Clipboard.model.NetscapeCookie} cookies array of netscape cookies associated with domain * @return {Wget2Clipboard.model.Command.Wget} Wget command & parameters * @constructor */ Wget2Clipboard.model.Command.Wget = (function (tabUrl, targetUrl, cookies) { /** * @returns {string} path to Win wget default install */ var exec = (function() { return "call \"C:\\Program Files (x86)\\GnuWin32\\" + "bin\\wget.exe\""; }); /** * * @param {string|null} tabUrl url of current tab * @param {string|null} targetUrl url to download * @param {Array|Wget2Clipboard.model.NetscapeCookie} cookies cookies associated with domain * @returns {Array} Wget parameters */ var parameters = (function(tabUrl, targetUrl, cookies) { return ["--continue \"" + targetUrl + "\""] .concat("--user-agent=\"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.3) Gecko/2008092416 Firefox/3.0.3\"") .concat("--referer=\"" + tabUrl + "\"") .concat(cookies.length > 0 ? "--load-cookies cookies.txt" : []) .concat("--no-check-certificate") .concat("-O " + targetUrl.substring(targetUrl.lastIndexOf("/") + 1)); }); /** * call Super() constr */ Wget2Clipboard.model.Command.call( this, exec(), parameters(tabUrl, targetUrl, cookies) ); }); Wget2Clipboard.model.Command.Wget.prototype = new Wget2Clipboard.model.Command(null, null); Wget2Clipboard.model.Command.Wget.prototype.constructor = Wget2Clipboard.model.Command.Wget;
Meteor.publish('store_charges', function() { if (this.userId) { return Charges.find({}, {fields: {amount:1}}) } else { this.ready() } })
/* * This file is part of INSPIRE. * Copyright (C) 2016 CERN. * * INSPIRE is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * INSPIRE is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with INSPIRE; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * * In applying this license, CERN does not * waive the privileges and immunities granted to it by virtue of its status * as an Intergovernmental Organization or submit itself to any jurisdiction. */ (function (angular) { function HoldingPenSelectionCtrl($scope, Hotkeys, HoldingPenRecordService) { $scope.vm.selected_records = []; $scope.vm.selected_record_decisions = {}; $scope.toggleSelection = toggleSelection; $scope.toggleAll = toggleAll; $scope.isChecked = isChecked; $scope.allChecked = allChecked; $scope.setDecision = setDecision; function getItemIdx(id) { return $scope.vm.selected_records.indexOf(+id); } function toggleSelection(record) { var _data_type = record._source._workflow.data_type; if (isChecked(record._id)) { $scope.vm.selected_records.splice(getItemIdx(+record._id), 1); if (_data_type in $scope.vm.selected_record_decisions) { $scope.vm.selected_record_decisions[_data_type] .splice($scope.vm.selected_record_decisions[_data_type] .indexOf(+record._id), 1); } } else { $scope.vm.selected_records.push(+record._id); if (_data_type) { if (!(_data_type in $scope.vm.selected_record_decisions)) { $scope.vm.selected_record_decisions[_data_type] = []; } if(record._source._extra_data === undefined || record._source._extra_data.user_action == undefined) $scope.vm.selected_record_decisions[_data_type].push(+record._id); } } } function setDecision(id, decision) { HoldingPenRecordService.setBatchDecision( $scope.vm.invenioSearchResults.hits.hits, [+id], decision) } function toggleAll() { var remove_all = allChecked(); if (remove_all) { $scope.vm.selected_records = []; $scope.vm.selected_record_decisions = {}; } else { angular.forEach($scope.$parent.vm.invenioSearchResults.hits.hits, function (record) { if (!isChecked(record._id)) { $scope.vm.selected_records.push(+record._id); if (record._source._workflow.data_type) { if (!(record._source._workflow.data_type in $scope.vm.selected_record_decisions)) { $scope.vm.selected_record_decisions[ record._source._workflow.data_type] = []; } if(record._source._extra_data === undefined || record._source._extra_data.user_action == undefined) $scope.vm.selected_record_decisions[record._source._workflow.data_type] .push(record._id); } } }); } } function isChecked(id) { return getItemIdx(+id) !== -1; } function allChecked() { if (!$scope.$parent.vm.invenioSearchResults.hits) { return false; } return $scope.vm.selected_records.length === $scope.$parent.vm.invenioSearchResults.hits.hits.length; } function reset() { $scope.vm.selected_records = []; } var hotkey = Hotkeys.createHotkey({ key: 'ctrl+a', callback: function () { toggleAll(); } }); Hotkeys.registerHotkey(hotkey); $scope.$on('invenio.search.success', reset); } HoldingPenSelectionCtrl.$inject = ['$scope', 'Hotkeys', 'HoldingPenRecordService']; angular.module('holdingpen.controllers', []) .controller('HoldingPenSelectionCtrl', HoldingPenSelectionCtrl); })(angular);
/** * External dependencies */ import { Path, SVG } from '@wordpress/components'; export const StarBlockIcon = () => { return ( <SVG xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"> <Path d="M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4V6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z" /> </SVG> ); }; const getColor = props => ( props && props.color ? props.color : 'currentColor' ); const getClassName = props => ( props && props.className ? props.className : '' ); export const StarIcon = props => { const color = getColor( props ); const className = getClassName( props ); return ( <SVG xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" color={ color } // this is to fix the stroke color in the ".is-style-filled svg:hover .is-rating-unfilled" rule > <Path className={ className } fill={ color } stroke={ color } d="M12,17.3l6.2,3.7l-1.6-7L22,9.2l-7.2-0.6L12,2L9.2,8.6L2,9.2L7.5,14l-1.6,7L12,17.3z" /> </SVG> ); };
/* global padlock */ padlock.rand = (function() { "use strict"; var chars = { numbers: "0123456789", lower: "abcdefghijklmnopqrstuvwxyz", upper: "ABCDEFGHIJKLMNOPQRSTUVWXYZ", other: "/+()%\"=&-!:'*#?;,_.@`~$^[{]}\\|<>" }; var charSets = { full: chars.numbers + chars.upper + chars.lower + chars.other, alphanum: chars.numbers + chars.upper + chars.lower, alpha: chars.lower + chars.upper, num: chars.numbers, hexa: chars.numbers + "abcdef" }; //* Returns a random item from an array of a random char from a string function randomItem(choices) { return choices[Math.floor(Math.random()*choices.length)]; } //* Creates a random string with a given _length_ comprised of given set or characters function randomString(length, charSet) { length = length || 32; charSet = charSet || charSets.full; var rndm = ""; while (rndm.length < length) { rndm += randomItem(charSet); } return rndm; } return { randomString: randomString }; })();
var searchData= [ ['gcm',['GCM',['../d8/d48/classcrypto.html#a88d8ecc273aee729deecbdd7844076d0',1,'crypto']]], ['gd',['GD',['../d5/d5d/classgd.html#a792ac324d596f28e650565f9f5339cb1',1,'gd']]], ['gd2',['GD2',['../d5/d5d/classgd.html#a1f9f4b0a38d344d6131ac4fdde77d4a0',1,'gd']]], ['gif',['GIF',['../d5/d5d/classgd.html#aa03a61a0909f9761082b9bf5b53fb596',1,'gd']]], ['global',['global',['../d8/d28/classRegex.html#a91bef45763139f15c2cab0ab35cebcc8',1,'Regex']]] ];
import AbstractEditController from 'hospitalrun/controllers/abstract-edit-controller'; import Ember from 'ember'; export default AbstractEditController.extend({ needs: ['procedures/edit'], cancelAction: 'closeModal', newPricingItem: false, requestingController: Ember.computed.alias('controllers.procedures/edit'), pricingList: Ember.computed.alias('controllers.procedures/edit.pricingList'), updateCapability: 'add_charge', itemChanged: function() { var selectedItem = this.get('selectedItem'); if (!Ember.isEmpty(selectedItem)) { this.store.find('pricing', selectedItem._id.substr(8)).then(function(item) { this.set('pricingItem', item); }.bind(this)); } }.observes('selectedItem'), pricingItemChanged: function() { var itemName = this.get('itemName'), pricingItem = this.get('pricingItem'); if (!Ember.isEmpty(pricingItem)) { this.set('newPricingItem', false); if (pricingItem.get('name') !== itemName) { this.set('itemName', pricingItem.get('name')); } } else { this.set('newPricingItem', true); } }.observes('pricingItem'), title: function() { var isNew = this.get('isNew'); if (isNew) { return 'Add Charge Item'; } return 'Edit Charge Item'; }.property('isNew'), beforeUpdate: function() { var isNew = this.get('isNew'); if (isNew) { this.set('newCharge', true); } if (this.get('newPricingItem')) { return new Ember.RSVP.Promise(function(resolve, reject) { var newPricing = this.store.createRecord('pricing', { name: this.get('itemName'), category: this.get('pricingCategory') }); newPricing.save().then(function() { this.get('pricingList').addObject({ _id: 'pricing_'+ newPricing.get('id'), name: newPricing.get('name') }); this.set('pricingItem', newPricing); resolve(); }.bind(this), reject); }.bind(this)); } else { return Ember.RSVP.Promise.resolve(); } }, afterUpdate: function(record) { if (this.get('newCharge')) { this.get('requestingController').send('addCharge', record); } else { this.send('closeModal'); } } });
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // noinspection SpellCheckingInspection const ELECTRON_BUILD_SERVICE_LOCAL_CA_CERT = exports.ELECTRON_BUILD_SERVICE_LOCAL_CA_CERT = Buffer.from(`-----BEGIN CERTIFICATE----- MIIBiDCCAS+gAwIBAgIRAPHSzTRLcN2nElhQdaRP47IwCgYIKoZIzj0EAwIwJDEi MCAGA1UEAxMZZWxlY3Ryb24uYnVpbGQubG9jYWwgcm9vdDAeFw0xNzExMTMxNzI4 NDFaFw0yNzExMTExNzI4NDFaMCQxIjAgBgNVBAMTGWVsZWN0cm9uLmJ1aWxkLmxv Y2FsIHJvb3QwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQVyduuCT2acuk2QH06 yal/b6O7eTTpOHk3Ucjc+ZZta2vC2+c1IKcSAwimKbTbK+nRxWWJl9ZYx9RTwbRf QjD6o0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4E FgQUlm08vBe4CUNAOTQN5Z1RNTfJjjYwCgYIKoZIzj0EAwIDRwAwRAIgMXlT6YM8 4pQtnhUjijVMz+NlcYafS1CEbNBMaWhP87YCIGXUmu7ON9hRLanXzBNBlrtTQG+i l/NT6REwZA64/lNy -----END CERTIFICATE----- `); // noinspection SpellCheckingInspection const ELECTRON_BUILD_SERVICE_CA_CERT = exports.ELECTRON_BUILD_SERVICE_CA_CERT = Buffer.from(`-----BEGIN CERTIFICATE----- MIIBfTCCASOgAwIBAgIRAIdieK1+3C4abgOvQ7pVVqAwCgYIKoZIzj0EAwIwHjEc MBoGA1UEAxMTZWxlY3Ryb24uYnVpbGQgcm9vdDAeFw0xNzExMTMxNzI4NDFaFw0x ODExMTMxNzI4NDFaMB4xHDAaBgNVBAMTE2VsZWN0cm9uLmJ1aWxkIHJvb3QwWTAT BgcqhkjOPQIBBggqhkjOPQMBBwNCAAR+4b6twzizN/z27yvwrCV5kinGUrfo+W7n L/l28ErscNe1BDSyh/IYrnMWb1rDMSLGhvkgI9Cfex1whNPHR101o0IwQDAOBgNV HQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU6Dq8kK7tQlrt zkIYrYiTZGpHEp0wCgYIKoZIzj0EAwIDSAAwRQIgKSfjAQbYlY/S1wMLUi84r8QN hhMnUwsOmlDan0xPalICIQDLIAXAIyArVtH38a4aizvhH8YeXrxzpJh3U8RolBZF SA== -----END CERTIFICATE----- `); //# sourceMappingURL=remote-builder-certs.js.map
function loadText() { var txtLang = document.getElementsByName("txtLang"); txtLang[0].innerHTML = "Rij Invoegen"; txtLang[1].innerHTML = "Kolom Invoegen"; txtLang[2].innerHTML = "Rij Samenvoegen"; txtLang[3].innerHTML = "Kolom Samenvoegen"; txtLang[4].innerHTML = "Rij Verwijderen"; txtLang[5].innerHTML = "Kolom Verwijderen"; document.getElementById("btnInsRowAbove").title="Rij Invoegen (Above)"; document.getElementById("btnInsRowBelow").title="Rij Invoegen (Below)"; document.getElementById("btnInsColLeft").title="Kolom Invoegen (Left)"; document.getElementById("btnInsColRight").title="Kolom Invoegen (Right)"; document.getElementById("btnIncRowSpan").title="Increase Rowspan"; document.getElementById("btnDecRowSpan").title="Decrease Rowspan"; document.getElementById("btnIncColSpan").title="Increase Colspan"; document.getElementById("btnDecColSpan").title="Decrease Colspan"; document.getElementById("btnDelRow").title="Rij Verwijderen"; document.getElementById("btnDelCol").title="Kolom Verwijderen"; document.getElementById("btnClose").value = " sluiten "; } function getText(s) { switch(s) { case "Cannot delete column.": return "Cannot delete column. The column contains spanned cells from another column. Please remove the span first."; case "Cannot delete row.": return "Cannot delete row. The row contains spanned cells from another rows. Please remove the span first."; default:return ""; } } function writeTitle() { document.write("<title>Grootte</title>") }
/** * @class Ext.draw.sprite.EllipticalArc * @extends Ext.draw.sprite.Ellipse * * A sprite that represents an elliptical arc. * * @example * Ext.create({ * xtype: 'draw', * renderTo: document.body, * width: 600, * height: 400, * sprites: [{ * type: 'ellipticalArc', * cx: 100, * cy: 100, * rx: 80, * ry: 50, * fillStyle: '#1F6D91', * startAngle: 0, * endAngle: Math.PI, * anticlockwise: true * }] * }); */ Ext.define('Ext.draw.sprite.EllipticalArc', { extend: 'Ext.draw.sprite.Ellipse', alias: 'sprite.ellipticalArc', type: 'ellipticalArc', inheritableStatics: { def: { processors: { /** * @cfg {Number} [startAngle=0] The beginning angle of the arc. */ startAngle: 'number', /** * @cfg {Number} [endAngle=Math.PI*2] The ending angle of the arc. */ endAngle: 'number', /** * @cfg {Boolean} [anticlockwise=false] Determines whether or not the arc is drawn clockwise. */ anticlockwise: 'bool' }, aliases: { from: 'startAngle', to: 'endAngle', start: 'startAngle', end: 'endAngle' }, defaults: { startAngle: 0, endAngle: Math.PI * 2, anticlockwise: false }, triggers: { startAngle: 'path', endAngle: 'path', anticlockwise: 'path' } } }, updatePath: function (path, attr) { path.ellipse(attr.cx, attr.cy, attr.rx, attr.ry, attr.axisRotation, attr.startAngle, attr.endAngle, attr.anticlockwise); } });
'use strict' var test = require('tap').test var split = require('./') var callback = require('callback-stream') var strcb = callback.bind(null, { decodeStrings: false }) var objcb = callback.bind(null, { objectMode: true }) test('split two lines on end', function (t) { t.plan(2) var input = split() input.pipe(strcb(function (err, list) { t.error(err) t.deepEqual(list, ['hello', 'world']) })) input.end('hello\nworld') }) test('split two lines on two writes', function (t) { t.plan(2) var input = split() input.pipe(strcb(function (err, list) { t.error(err) t.deepEqual(list, ['hello', 'world']) })) input.write('hello') input.write('\nworld') input.end() }) test('accumulate multiple writes', function (t) { t.plan(2) var input = split() input.pipe(strcb(function (err, list) { t.error(err) t.deepEqual(list, ['helloworld']) })) input.write('hello') input.write('world') input.end() }) test('split using a custom string matcher', function (t) { t.plan(2) var input = split('~') input.pipe(strcb(function (err, list) { t.error(err) t.deepEqual(list, ['hello', 'world']) })) input.end('hello~world') }) test('split using a custom regexp matcher', function (t) { t.plan(2) var input = split(/~/) input.pipe(strcb(function (err, list) { t.error(err) t.deepEqual(list, ['hello', 'world']) })) input.end('hello~world') }) test('support an option argument', function (t) { t.plan(2) var input = split({ highWaterMark: 2 }) input.pipe(strcb(function (err, list) { t.error(err) t.deepEqual(list, ['hello', 'world']) })) input.end('hello\nworld') }) test('support a mapper function', function (t) { t.plan(2) var a = { a: '42' } var b = { b: '24' } var input = split(JSON.parse) input.pipe(objcb(function (err, list) { t.error(err) t.deepEqual(list, [a, b]) })) input.write(JSON.stringify(a)) input.write('\n') input.end(JSON.stringify(b)) }) test('split lines windows-style', function (t) { t.plan(2) var input = split() input.pipe(strcb(function (err, list) { t.error(err) t.deepEqual(list, ['hello', 'world']) })) input.end('hello\r\nworld') }) test('splits a buffer', function (t) { t.plan(2) var input = split() input.pipe(strcb(function (err, list) { t.error(err) t.deepEqual(list, ['hello', 'world']) })) input.end(new Buffer('hello\nworld')) }) test('do not end on undefined', function (t) { t.plan(2) var input = split(function (line) {}) input.pipe(strcb(function (err, list) { t.error(err) t.deepEqual(list, []) })) input.end(new Buffer('hello\nworld')) }) test('has destroy method', function (t) { t.plan(1) var input = split(function (line) {}) input.on('close', function () { t.ok(true, 'close emitted') t.end() }) input.destroy() }) test('support custom matcher and mapper', function (t) { t.plan(4) var a = { a: '42' } var b = { b: '24' } var input = split('~', JSON.parse) t.equal(input.matcher, '~') t.equal(typeof input.mapper, 'function') input.pipe(objcb(function (err, list) { t.notOk(err, 'no errors') t.deepEqual(list, [a, b]) })) input.write(JSON.stringify(a)) input.write('~') input.end(JSON.stringify(b)) }) test('support custom matcher and options', function (t) { t.plan(6) var input = split('~', { highWaterMark: 1024 }) t.equal(input.matcher, '~') t.equal(typeof input.mapper, 'function') t.equal(input._readableState.highWaterMark, 1024) t.equal(input._writableState.highWaterMark, 1024) input.pipe(strcb(function (err, list) { t.error(err) t.deepEqual(list, ['hello', 'world']) })) input.end('hello~world') }) test('support mapper and options', function (t) { t.plan(6) var a = { a: '42' } var b = { b: '24' } var input = split(JSON.parse, { highWaterMark: 1024 }) t.ok(input.matcher instanceof RegExp, 'matcher is RegExp') t.equal(typeof input.mapper, 'function') t.equal(input._readableState.highWaterMark, 1024) t.equal(input._writableState.highWaterMark, 1024) input.pipe(objcb(function (err, list) { t.error(err) t.deepEqual(list, [a, b]) })) input.write(JSON.stringify(a)) input.write('\n') input.end(JSON.stringify(b)) }) test('split utf8 chars', function (t) { t.plan(2) var input = split() input.pipe(strcb(function (err, list) { t.error(err) t.deepEqual(list, ['็ƒซ็ƒซ็ƒซ', '้”Ÿๆ–คๆ‹ท']) })) var buf = new Buffer('็ƒซ็ƒซ็ƒซ\r\n้”Ÿๆ–คๆ‹ท', 'utf8') for (var i = 0; i < buf.length; ++i) { input.write(buf.slice(i, i + 1)) } input.end() }) test('split utf8 chars 2by2', function (t) { t.plan(2) var input = split() input.pipe(strcb(function (err, list) { t.error(err) t.deepEqual(list, ['็ƒซ็ƒซ็ƒซ', '็ƒซ็ƒซ็ƒซ']) })) var str = '็ƒซ็ƒซ็ƒซ\r\n็ƒซ็ƒซ็ƒซ' var buf = new Buffer(str, 'utf8') for (var i = 0; i < buf.length; i += 2) { input.write(buf.slice(i, i + 2)) } input.end() }) test('split lines when the \n comes at the end of a chunk', function (t) { t.plan(2) var input = split() input.pipe(strcb(function (err, list) { t.error(err) t.deepEqual(list, ['hello', 'world']) })) input.write('hello\n') input.end('world') }) test('truncated utf-8 char', function (t) { t.plan(2) var input = split() input.pipe(strcb(function (err, list) { t.error(err) t.deepEqual(list, ['็ƒซ' + new Buffer('e7', 'hex').toString()]) })) var str = '็ƒซ็ƒซ' var buf = new Buffer(str, 'utf8') input.write(buf.slice(0, 3)) input.end(buf.slice(3, 4)) })
module.exports = ping var url = require('url') var assert = require('assert') function ping (uri, params, cb) { assert(typeof uri === 'string', 'must pass registry URI to ping') assert(params && typeof params === 'object', 'must pass params to ping') assert(typeof cb === 'function', 'must pass callback to ping') var auth = params.auth assert(auth && typeof auth === 'object', 'must pass auth to ping') this.request(url.resolve(uri, '-/ping?write=true'), { auth: auth }, function (er, fullData, data, response) { if (er || fullData) { cb(er, fullData, data, response) } else { cb(new Error('No data received')) } }) }
YUI.add('moodle-local_kaltura-lticontainer', function (Y, NAME) { // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * YUI module used to resize the LTI launch container. * * @package local_kaltura * @author Remote-Learner.net Inc * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @copyright (C) 2014 Remote Learner.net Inc http://www.remote-learner.net */ /** * This method calls the base class constructor * @method LTICONTAINER */ var LTICONTAINER = function() { LTICONTAINER.superclass.constructor.apply(this, arguments); }; Y.extend(LTICONTAINER, Y.Base, { /** * The last known height of the element. * @property lastheight * @type {Integer} * @default null */ lastheight: null, /** * Add padding to make the bottom of the iframe visible. The iframe wasn't visible on some themes. Probably because of border widths, etc. * @property padding * @type {Integer} * @default 15 */ padding: 15, /** * Height of window. * @property viewportheight * @type {Integer} * @default 15 */ viewportheight: null, /** * Height of the entire document. * @property documentheight * @type {Integer} * @default null */ documentheight: null, /** * Height of the body element. * @property documentheight * @type {Integer} * @default null */ clientheight: null, /** * User video width size selection. * @property kalvidwidth * @type {Integer} * @default null */ kalvidwidth: null, /** * The YUI node object for the iframe container. * @property ltiframe * @type {Object} * @default null */ ltiframe: null, /** * The width of the entry * @property width * @type {int} * @default null */ width: null, /** * The height of the entry * @property height * @type {int} * @default null */ height: null, /** * Init function for the checkboxselection module * @property params * @type {Object} */ init : function(params) { var bodynode = Y.one('body[class~='+params.bodyclass+']'); if(params.height && params.width) { this.height = params.height; this.width = params.width; } this.lastheight = params.lastheight; this.padding = params.padding; this.viewportheight = bodynode.get('winHeight'); this.documentheight = bodynode.get('docHeight'); this.clientheight = bodynode.getDOMNode.clientHeight; this.ltiframe = Y.one('#contentframe'); this.kalvidwidth = params.kalvidwidth; this.resize(); this.timer = Y.later(250, this, this.resize); }, /** * This function resizes the iframe height and width. */ resize : function() { if (this.lastheight !== Math.min(this.documentheight, this.viewportheight)) { var newheight = this.viewportheight - this.ltiframe.getY() - this.padding+"px"; this.ltiframe.setStyle('height', newheight); this.lastheight = Math.min(this.documentheight, this.viewportheight); } var kalvidcontent = Y.one('#kalvid_content'); if (kalvidcontent !== null) { var maxwidth = kalvidcontent.get('offsetWidth'); var allowedsize = maxwidth - this.padding; if (this.kalvidwidth !== null) { // Double current user's video width selection as requested by Kaltura. var newsize = this.kalvidwidth * 2; // If "newsize" if over allowed size then set it to the maximum allowed. if (newsize > allowedsize) { this.ltiframe.setStyle('width', allowedsize+'px'); } else { this.ltiframe.setStyle('width', newsize+'px'); } } } // if we have the entry's dimensions - use them to adjust the iframe size. if(this.height && this.width) { this.ltiframe.setStyle('width', this.width+'px'); this.ltiframe.setStyle('height', this.height+'px'); } } }, { NAME : 'moodle-local_kaltura-lticontainer', ATTRS : { bodyclass : { value : null }, lastheight : { value : null }, padding: { value : 15 } } }); M.local_kaltura = M.local_kaltura || {}; /** * Entry point for lticontainer module * @param string params additional parameters. * @return object the lticontainer object */ M.local_kaltura.init = function(params) { return new LTICONTAINER(params); }; }, '@VERSION@', {"requires": ["base", "node"]});
// LICENCE https://github.com/adaptlearning/adapt_authoring/blob/master/LICENSE define(['require', 'jquery', 'polyglot', 'core/origin'], function(require, $, Polyglot, Origin) { var polyglot; // set up global l10n object Origin.l10n = { t: function(string, data) { if(!polyglot || !polyglot.t) { return string; } return polyglot.t.apply(polyglot, arguments); }, has: function() { if(!polyglot || !polyglot.has) { return false; } return polyglot.has.apply(polyglot, arguments); } }; /** * Initialise from language file */ var locale = localStorage.getItem('lang') || 'en'; $.getJSON('lang/' + locale, function(data) { polyglot = new Polyglot({ locale: locale, phrases: data, warn: function(message) { if(Origin.debug) console.warn('l10n:', message); } }); Origin.trigger('l10n:loaded'); }).fail(function(jqXHR, textStatus, error) { Origin.trigger('l10n:loaded'); }); });
'use strict'; define([], function() { var dependencies = [ '$scope', '$modalInstance', 'datasets', 'loggedInUserId', 'datasetUuid', 'graphUuid', 'versionUuid', 'CopyStudyResource', 'UUIDService' ]; var CopyStudyController = function( $scope, $modalInstance, datasets, loggedInUserId, datasetUuid, graphUuid, versionUuid, CopyStudyResource, UUIDService ) { // functions $scope.copyStudy = copyStudy; $scope.cancel = cancel; // init $scope.datasets = datasets; function copyStudy(targetDataset) { $scope.isCopying = true; $scope.targetDatasetUuid = targetDataset.uri.split('/')[targetDataset.uri.split('/').length - 1]; $scope.targetGraphUuid = UUIDService.generate(); $scope.loggedInUserId = loggedInUserId; var copyMessage = { targetDatasetUuid: $scope.targetDatasetUuid, targetGraphUuid: $scope.targetGraphUuid, copyOf: UUIDService.buildGraphUri(datasetUuid, versionUuid, graphUuid) }; CopyStudyResource.copy(copyMessage, function(__, responseHeaders) { var newVersion = responseHeaders('X-EventSource-Version'); newVersion = newVersion.split('/')[4]; $scope.newVersionUuid = newVersion; $scope.copyComplete = true; }, function() { $modalInstance.close(); }); } function cancel() { $modalInstance.close(); } }; return dependencies.concat(CopyStudyController); });
import fetch from 'isomorphic-fetch'; import { application } from '../../config'; import * as Action from './constants'; export function setCerts(data) { return ({ type: Action.SET_SET_OF_CERTS, data, }); } export function setObjectToEdit(data) { return ({ type: Action.SET_CUSTOMCERT_OBJECT_TO_EDIT, data, }); } export function loadCerts() { return (dispatch, getState) => { const eventId = getState().event.id; const config = { method: 'POST', mode: 'cors', credentials: 'include', headers: { Accept: 'application/json', 'Content-Type': 'application/json', }, }; fetch(`${application.url}/api/event/${eventId}/module/cert/cert/act/get_certs`, config) .then(response => response.json()) .then((data) => { if (!data.error) { dispatch(setCerts(data.data)); } }); }; } export function createNew(text) { return (dispatch, getState) => { const eventId = getState().event.id; const config = { method: 'POST', mode: 'cors', credentials: 'include', headers: { Accept: 'application/json', 'Content-Type': 'application/json', }, body: JSON.stringify({ text }), }; fetch(`${application.url}/api/event/${eventId}/module/cert/cert/act/create_certificate`, config) .then(response => response.json()) .then((json) => { if (!json.error) { dispatch(loadCerts()); } }); }; } export function editObject(objectToEdit) { return (dispatch, getState) => { const eventId = getState().event.id; const config = { method: 'POST', mode: 'cors', credentials: 'include', headers: { Accept: 'application/json', 'Content-Type': 'application/json', }, body: JSON.stringify({ objectToEdit }), }; fetch(`${application.url}/api/event/${eventId}/module/cert/cert/act/edit_object`, config) .then(response => response.json()) .then((json) => { if (!json.error) { dispatch(loadCerts()); } }); }; }
/* */ "format cjs"; ; (function(global, factory) { typeof exports === 'object' && typeof module !== 'undefined' && typeof require === 'function' ? factory(require('../moment')) : typeof define === 'function' && define.amd ? define(['moment'], factory) : factory(global.moment); }(this, function(moment) { 'use strict'; var th = moment.defineLocale('th', { months: 'เธกเธเธฃเธฒเธ„เธก_เธเธธเธกเธ เธฒเธžเธฑเธ™เธ˜เนŒ_เธกเธตเธ™เธฒเธ„เธก_เน€เธกเธฉเธฒเธขเธ™_เธžเธคเธฉเธ เธฒเธ„เธก_เธกเธดเธ–เธธเธ™เธฒเธขเธ™_เธเธฃเธเธŽเธฒเธ„เธก_เธชเธดเธ‡เธซเธฒเธ„เธก_เธเธฑเธ™เธขเธฒเธขเธ™_เธ•เธธเธฅเธฒเธ„เธก_เธžเธคเธจเธˆเธดเธเธฒเธขเธ™_เธ˜เธฑเธ™เธงเธฒเธ„เธก'.split('_'), monthsShort: 'เธกเธเธฃเธฒ_เธเธธเธกเธ เธฒ_เธกเธตเธ™เธฒ_เน€เธกเธฉเธฒ_เธžเธคเธฉเธ เธฒ_เธกเธดเธ–เธธเธ™เธฒ_เธเธฃเธเธŽเธฒ_เธชเธดเธ‡เธซเธฒ_เธเธฑเธ™เธขเธฒ_เธ•เธธเธฅเธฒ_เธžเธคเธจเธˆเธดเธเธฒ_เธ˜เธฑเธ™เธงเธฒ'.split('_'), weekdays: 'เธญเธฒเธ—เธดเธ•เธขเนŒ_เธˆเธฑเธ™เธ—เธฃเนŒ_เธญเธฑเธ‡เธ„เธฒเธฃ_เธžเธธเธ˜_เธžเธคเธซเธฑเธชเธšเธ”เธต_เธจเธธเธเธฃเนŒ_เน€เธชเธฒเธฃเนŒ'.split('_'), weekdaysShort: 'เธญเธฒเธ—เธดเธ•เธขเนŒ_เธˆเธฑเธ™เธ—เธฃเนŒ_เธญเธฑเธ‡เธ„เธฒเธฃ_เธžเธธเธ˜_เธžเธคเธซเธฑเธช_เธจเธธเธเธฃเนŒ_เน€เธชเธฒเธฃเนŒ'.split('_'), weekdaysMin: 'เธญเธฒ._เธˆ._เธญ._เธž._เธžเธค._เธจ._เธช.'.split('_'), longDateFormat: { LT: 'H เธ™เธฒเธฌเธดเธเธฒ m เธ™เธฒเธ—เธต', LTS: 'H เธ™เธฒเธฌเธดเธเธฒ m เธ™เธฒเธ—เธต s เธงเธดเธ™เธฒเธ—เธต', L: 'YYYY/MM/DD', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY เน€เธงเธฅเธฒ H เธ™เธฒเธฌเธดเธเธฒ m เธ™เธฒเธ—เธต', LLLL: 'เธงเธฑเธ™ddddเธ—เธตเนˆ D MMMM YYYY เน€เธงเธฅเธฒ H เธ™เธฒเธฌเธดเธเธฒ m เธ™เธฒเธ—เธต' }, meridiemParse: /เธเนˆเธญเธ™เน€เธ—เธตเนˆเธขเธ‡|เธซเธฅเธฑเธ‡เน€เธ—เธตเนˆเธขเธ‡/, isPM: function(input) { return input === 'เธซเธฅเธฑเธ‡เน€เธ—เธตเนˆเธขเธ‡'; }, meridiem: function(hour, minute, isLower) { if (hour < 12) { return 'เธเนˆเธญเธ™เน€เธ—เธตเนˆเธขเธ‡'; } else { return 'เธซเธฅเธฑเธ‡เน€เธ—เธตเนˆเธขเธ‡'; } }, calendar: { sameDay: '[เธงเธฑเธ™เธ™เธตเน‰ เน€เธงเธฅเธฒ] LT', nextDay: '[เธžเธฃเธธเนˆเธ‡เธ™เธตเน‰ เน€เธงเธฅเธฒ] LT', nextWeek: 'dddd[เธซเธ™เน‰เธฒ เน€เธงเธฅเธฒ] LT', lastDay: '[เน€เธกเธทเนˆเธญเธงเธฒเธ™เธ™เธตเน‰ เน€เธงเธฅเธฒ] LT', lastWeek: '[เธงเธฑเธ™]dddd[เธ—เธตเนˆเนเธฅเน‰เธง เน€เธงเธฅเธฒ] LT', sameElse: 'L' }, relativeTime: { future: 'เธญเธตเธ %s', past: '%sเธ—เธตเนˆเนเธฅเน‰เธง', s: 'เน„เธกเนˆเธเธตเนˆเธงเธดเธ™เธฒเธ—เธต', m: '1 เธ™เธฒเธ—เธต', mm: '%d เธ™เธฒเธ—เธต', h: '1 เธŠเธฑเนˆเธงเน‚เธกเธ‡', hh: '%d เธŠเธฑเนˆเธงเน‚เธกเธ‡', d: '1 เธงเธฑเธ™', dd: '%d เธงเธฑเธ™', M: '1 เน€เธ”เธทเธญเธ™', MM: '%d เน€เธ”เธทเธญเธ™', y: '1 เธ›เธต', yy: '%d เธ›เธต' } }); return th; }));
var classgr__file__source = [ [ "gr_file_source", "classgr__file__source.html#ad237a93ac0cdf390d52ecaf5ba47a01a", null ], [ "~gr_file_source", "classgr__file__source.html#a6f48f666cf2ce07f32be02f08561ff24", null ], [ "seek", "classgr__file__source.html#a0a206ac10dccf0e7b8faabd836a20846", null ], [ "work", "classgr__file__source.html#a498f0bb7a704de43e3c1ffb61fed0d1d", null ], [ "gr_make_file_source", "classgr__file__source.html#a36b4dde5a3a25390d460c7e6b4cdd1df", null ] ];
// DO NOT EDIT! This test has been generated by tools/gentest.py. // OffscreenCanvas test in a worker:2d.path.stroke.scale2 // Description:Stroke line widths are scaled by the current transformation matrix // Note: importScripts("/resources/testharness.js"); importScripts("/2dcontext/resources/canvas-tests.js"); var t = async_test("Stroke line widths are scaled by the current transformation matrix"); t.step(function() { var offscreenCanvas = new OffscreenCanvas(100, 50); var ctx = offscreenCanvas.getContext('2d'); ctx.fillStyle = '#f00'; ctx.fillRect(0, 0, 100, 50); ctx.beginPath(); ctx.rect(25, 12.5, 50, 25); ctx.save(); ctx.rotate(Math.PI/2); ctx.scale(25, 50); ctx.strokeStyle = '#0f0'; ctx.stroke(); ctx.restore(); ctx.beginPath(); ctx.rect(-25, -12.5, 150, 75); ctx.save(); ctx.rotate(Math.PI/2); ctx.scale(25, 50); ctx.strokeStyle = '#f00'; ctx.stroke(); ctx.restore(); _assertPixel(offscreenCanvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255"); _assertPixel(offscreenCanvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255"); _assertPixel(offscreenCanvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255"); _assertPixel(offscreenCanvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255"); _assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); _assertPixel(offscreenCanvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255"); _assertPixel(offscreenCanvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255"); _assertPixel(offscreenCanvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255"); _assertPixel(offscreenCanvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255"); t.done(); }); done();
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ // @flow import { findSourceMatches } from "../project-search"; const text = ` function foo() { foo(); } `; describe("project search", () => { const emptyResults = []; it("throws on lack of source", () => { const needle = "test"; const source: any = null; const matches = () => findSourceMatches(source, needle); expect(matches).toThrow(TypeError); }); it("handles empty source object", () => { const needle = "test"; const source: any = {}; const matches = findSourceMatches(source, needle); expect(matches).toEqual(emptyResults); }); it("finds matches", () => { const needle = "foo"; const source: any = { text, loadedState: "loaded", id: "bar.js", url: "http://example.com/foo/bar.js" }; const matches = findSourceMatches(source, needle); expect(matches).toMatchSnapshot(); }); it("finds no matches in source", () => { const needle = "test"; const source: any = { text, loadedState: "loaded", id: "bar.js", url: "http://example.com/foo/bar.js" }; const matches = findSourceMatches(source, needle); expect(matches).toEqual(emptyResults); }); });
import { helper } from '@ember/component/helper'; import { get } from '@ember/object'; const MANAGEMENT_ID = '00000000-0000-0000-0000-000000000001'; export function isManagement(params, hash) { return get(params[0], 'ID') === MANAGEMENT_ID; } export default helper(isManagement);
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 'use strict'; module.exports = function (config) { const STATIC_RESOURCE_URL = config.get('static_resource_url'); return { method: 'get', path: '/502.html', process: (req, res, next) => { res.render('502', { staticResourceUrl: STATIC_RESOURCE_URL }); } }; };
import { Fragment } from 'inferno'; import { act } from '../byond'; import { Section, Box, Button, Table } from '../components'; import { classes } from 'common/react'; export const Vending = props => { const { state } = props; const { config, data } = state; const { ref } = config; let inventory; let custom = false; if (data.vending_machine_input) { inventory = data.vending_machine_input; custom = true; } else if (data.extended_inventory) { inventory = [ ...data.product_records, ...data.coin_records, ...data.hidden_records, ]; } else { inventory = [ ...data.product_records, ...data.coin_records, ]; } return ( <Fragment> {!!data.onstation && ( <Section title="User"> {data.user && ( <Box> Welcome, <b>{data.user.name}</b>, {' '} <b>{data.user.job || "Unemployed"}</b>! <br /> Your balance is <b>{data.user.cash} credits</b>. </Box> ) || ( <Box color="light-gray"> No registered ID card!<br /> Please contact your local HoP! </Box> )} </Section> )} <Section title="Products" > <Table> {inventory.map((product => { const free = ( !data.onstation || product.price === 0 || ( !product.premium && data.department && data.user && data.department === data.user.department ) ); return ( <Table.Row key={product.name}> <Table.Cell> {product.base64 ? ( <img src={`data:image/jpeg;base64,${product.img}`} style={{ 'vertical-align': 'middle', 'horizontal-align': 'middle', }} /> ) : ( <span className={classes(['vending32x32', product.path])} style={{ 'vertical-align': 'middle', 'horizontal-align': 'middle', }} /> )} <b>{product.name}</b> </Table.Cell> <Table.Cell> <Box color={custom ? 'good' : data.stock[product.name] <= 0 ? 'bad' : data.stock[product.name] <= (product.max_amount / 2) ? 'average' : 'good'}> {data.stock[product.name]} in stock </Box> </Table.Cell> <Table.Cell> {custom && ( <Button content={data.access ? 'FREE' : product.price + ' cr'} onClick={() => act(ref, 'dispense', { 'item': product.name, })} /> ) || ( <Button disabled={( data.stock[product.namename] === 0 || ( !free && ( !data.user || product.price > data.user.cash ) ) )} content={free ? 'FREE' : product.price + ' cr'} onClick={() => act(ref, 'vend', { 'ref': product.ref, })} /> )} </Table.Cell> </Table.Row> ); }))} </Table> </Section> </Fragment> ); };
'use strict'; angular.module('linagora.esn.contact.import.twitter', [ 'restangular', 'op.dynamicDirective', 'esn.notification', 'linagora.esn.contact.import' ]) .run(function(ContactImportRegistry, ContactImportMessageRegistry, TwitterContactImporter, dynamicDirectiveService, TWITTER_CONTACT_IMPORT_TYPE, TWITTER_CONTACT_IMPORT_MESSAGES) { ContactImportRegistry.register(TWITTER_CONTACT_IMPORT_TYPE, TwitterContactImporter); ContactImportMessageRegistry.register(TWITTER_CONTACT_IMPORT_TYPE, TWITTER_CONTACT_IMPORT_MESSAGES); dynamicDirectiveService.addInjection('account-options-items', new dynamicDirectiveService.DynamicDirective(function(scope) { return scope.account.provider === 'twitter'; }, 'twitter-contact-import-menu-item')); });
import ko from 'ko'; import { ClientSideKeyName, Notification, Magics } from 'Common/Enums'; import { trim, noop } from 'Common/Utils'; import { getNotification, i18n } from 'Common/Translator'; import { removeFolderFromCacheList } from 'Common/Cache'; import { appSettingsGet } from 'Storage/Settings'; import * as Local from 'Storage/Client'; import FolderStore from 'Stores/User/Folder'; import Promises from 'Promises/User/Ajax'; import Remote from 'Remote/User/Ajax'; import { getApp } from 'Helper/Apps/User'; import { showScreenPopup } from 'Knoin/Knoin'; class FoldersUserSettings { constructor() { this.displaySpecSetting = FolderStore.displaySpecSetting; this.folderList = FolderStore.folderList; this.folderListHelp = ko.observable('').extend({ throttle: Magics.Time100ms }); this.loading = ko.computed(() => { const loading = FolderStore.foldersLoading(), creating = FolderStore.foldersCreating(), deleting = FolderStore.foldersDeleting(), renaming = FolderStore.foldersRenaming(); return loading || creating || deleting || renaming; }); this.folderForDeletion = ko.observable(null).deleteAccessHelper(); this.folderForEdit = ko.observable(null).extend({ toggleSubscribeProperty: [this, 'edited'] }); this.useImapSubscribe = !!appSettingsGet('useImapSubscribe'); } folderEditOnEnter(folder) { const nameToEdit = folder ? trim(folder.nameForEdit()) : ''; if ('' !== nameToEdit && folder.name() !== nameToEdit) { Local.set(ClientSideKeyName.FoldersLashHash, ''); getApp().foldersPromisesActionHelper( Promises.folderRename(folder.fullNameRaw, nameToEdit, FolderStore.foldersRenaming), Notification.CantRenameFolder ); removeFolderFromCacheList(folder.fullNameRaw); folder.name(nameToEdit); } folder.edited(false); } folderEditOnEsc(folder) { if (folder) { folder.edited(false); } } onShow() { FolderStore.folderList.error(''); } onBuild(oDom) { oDom .on('mouseover', '.delete-folder-parent', () => { this.folderListHelp(i18n('SETTINGS_FOLDERS/HELP_DELETE_FOLDER')); }) .on('mouseover', '.subscribe-folder-parent', () => { this.folderListHelp(i18n('SETTINGS_FOLDERS/HELP_SHOW_HIDE_FOLDER')); }) .on('mouseover', '.check-folder-parent', () => { this.folderListHelp(i18n('SETTINGS_FOLDERS/HELP_CHECK_FOR_NEW_MESSAGES')); }) .on('mouseout', '.subscribe-folder-parent, .check-folder-parent, .delete-folder-parent', () => { this.folderListHelp(''); }); } createFolder() { showScreenPopup(require('View/Popup/FolderCreate')); } systemFolder() { showScreenPopup(require('View/Popup/FolderSystem')); } deleteFolder(folderToRemove) { if ( folderToRemove && folderToRemove.canBeDeleted() && folderToRemove.deleteAccess() && 0 === folderToRemove.privateMessageCountAll() ) { this.folderForDeletion(null); if (folderToRemove) { const fRemoveFolder = function(folder) { if (folderToRemove === folder) { return true; } folder.subFolders.remove(fRemoveFolder); return false; }; Local.set(ClientSideKeyName.FoldersLashHash, ''); FolderStore.folderList.remove(fRemoveFolder); getApp().foldersPromisesActionHelper( Promises.folderDelete(folderToRemove.fullNameRaw, FolderStore.foldersDeleting), Notification.CantDeleteFolder ); removeFolderFromCacheList(folderToRemove.fullNameRaw); } } else if (0 < folderToRemove.privateMessageCountAll()) { FolderStore.folderList.error(getNotification(Notification.CantDeleteNonEmptyFolder)); } } subscribeFolder(folder) { Local.set(ClientSideKeyName.FoldersLashHash, ''); Remote.folderSetSubscribe(noop, folder.fullNameRaw, true); folder.subScribed(true); } unSubscribeFolder(folder) { Local.set(ClientSideKeyName.FoldersLashHash, ''); Remote.folderSetSubscribe(noop, folder.fullNameRaw, false); folder.subScribed(false); } checkableTrueFolder(folder) { Remote.folderSetCheckable(noop, folder.fullNameRaw, true); folder.checkable(true); } checkableFalseFolder(folder) { Remote.folderSetCheckable(noop, folder.fullNameRaw, false); folder.checkable(false); } } export { FoldersUserSettings, FoldersUserSettings as default };
var angularFilesort = require('gulp-angular-filesort'), bowerFiles = require('main-bower-files'), concat = require('gulp-concat'), del = require('del'), gulp = require('gulp'), gulpFilter = require('gulp-filter'), less = require('gulp-less'), inject = require('gulp-inject'), merge = require('gulp-merge'), ngAnnotate = require('gulp-ng-annotate'), path = require('path'), rename = require('gulp-rename'), replace = require('gulp-replace'), sourcemaps = require('gulp-sourcemaps'), uglify = require('gulp-uglify'), watch = require('gulp-watch'); gulp.task('clean', function () { return del(['build']); }); // Gathers the main bower files into the build dir // and concats them in the order defined by main-bower-files gulp.task('bower-main', ['clean'], function () { // Exclude JS because angular-bootstrap only needs bootstrap's css var jsFilter = gulpFilter(['**/*.js', '!bootstrap.js'], {restore: true}); var cssFilter = gulpFilter('**/*.css', {restore: true}); return gulp.src(bowerFiles()) .pipe(jsFilter) .pipe(sourcemaps.init()) .pipe(concat('vendor.js')) // Ugh, this replace because dygraphs doesn't make pan overlay configurable .pipe(replace('rgba(240, 240, 240, 0.6)', 'rgba(0, 0, 0, 0.4)')) //.pipe(uglify()) // TODO make conditional because slow .pipe(sourcemaps.write()) .pipe(jsFilter.restore) .pipe(cssFilter) .pipe(sourcemaps.init()) .pipe(concat('vendor.css')) .pipe(sourcemaps.write()) .pipe(cssFilter.restore) .pipe(gulpFilter(['*', '!bootstrap.js', '!bootstrap.less', '!**glyphicons**'])) .pipe(gulp.dest('./build/_site')); }); // Copies the referred map files to prevent 404s with an open // Inspector window (generally not included in bower main files) gulp.task('bower-map', ['clean'], function () { return gulp.src([ './bower_components/bootstrap/dist/css/bootstrap.css.map', './bower_components/dygraphs/dygraph-combined.js.map' ]).pipe(gulp.dest('./build/_site')); }); gulp.task('bower-fonts', ['clean'], function () { return gulp.src([ './bower_components/bootstrap/dist/fonts/**' ]).pipe(gulp.dest('./build/_site/fonts')); }); gulp.task('bower', ['bower-main', 'bower-map', 'bower-fonts']); gulp.task('css', ['clean'], function () { return gulp.src('./src/**/*.css') .pipe(gulp.dest('./build/_site')); }); gulp.task('less', ['clean'], function () { return gulp.src('./src/**/*.less') .pipe(less()) .pipe(gulp.dest('./build/_site')); }); gulp.task('js-uss', ['clean'], function () { // Order is important for these return gulp.src([ '**/lib/uss.js', '**/lib/uss.basic-widgets.js', '**/lib/uss.graph.js', '**/lib/uss.meters.js', '**/lib/jquery.svg.js', '**/lib/sprintf-0.7-beta1.js' //'**/lib/highcharts.src.js' ]) .pipe(concat('uss-lib.js')) .pipe(gulp.dest('./build/_site/uss')); }); gulp.task('js', ['clean', 'js-uss'], function () { return gulp.src(['./src/**/*.js', '!./src/**/uss/lib/*']) .pipe(ngAnnotate()) .pipe(angularFilesort()) .pipe(concat('yamcs-web.js')) .pipe(gulp.dest('./build/_site')); }); gulp.task('html', ['clean'], function () { return gulp.src(['./src/**/*.html', '!./src/*.html']) .pipe(gulp.dest('./build/_site')); }); gulp.task('img', ['clean'], function () { return gulp.src(['./src/**/*.png', './src/**/*.ico']) .pipe(gulp.dest('./build/_site')); }); gulp.task('config', ['clean'], function () { return gulp.src('./src/config.json') .pipe(rename('config.json.sample')) .pipe(gulp.dest('./build')); }); // Updates the CSS and JS references defined in the root html files gulp.task('index', ['clean', 'bower', 'css', 'less', 'js'], function () { return gulp.src('./src/*.html') .pipe(inject(gulp.src(['./build/_site/vendor.js', './build/_site/uss/uss-lib.js'], {read: false}), {ignorePath: '/build', addPrefix: '/_static', name: 'bower'})) .pipe(inject(gulp.src('./build/_site/yamcs-web.js', {}), {ignorePath: '/build', addPrefix: '/_static'})) .pipe(inject(gulp.src('./build/_site/**/*.css',{read: false}), {ignorePath: '/build', addPrefix: '/_static'})) .pipe(gulp.dest('./build/_site')); }); /** * * Default 'gulp' behaviour * */ gulp.task('default', ['css', 'js', 'html', 'img', 'config', 'index']);
var searchData= [ ['info',['INFO',['../classpathpy_1_1Log_1_1Severity.html#a12fb98e4cc0d9e68114e29e8f6758c22',1,'pathpy::Log::Severity']]] ];
'use strict'; module.exports = function (grunt) { // util for grunt.template grunt.toJSON = function(input) { return JSON.stringify(input); }; var config = { pkg: grunt.file.readJSON('./package.json'), appDir: 'app', tmpDir: '.tmp', distDir: 'dist', specDir: 'spec', tasksDir: 'tasks', bowerDir: 'bower', poDir: 'po', livereloadPort: 35729 }; grunt.initConfig(config); require('load-grunt-tasks')(grunt); require('load-grunt-config')(grunt, { config: config, configPath: require('path').join(process.cwd(), 'tasks', 'options') }); grunt.registerTask('style', ['less:dev', 'cssmin']); grunt.registerTask('test', ['karma:unit']); grunt.registerTask('hint', ['jshint', 'jscs', 'eslint:specs', 'eslint:tasks', 'eslint:root']); grunt.registerTask('hint:docs', ['jshint:docs', 'jscs:docs']); grunt.registerTask('ci', ['test', 'hint']); grunt.registerTask('ci:travis', ['karma:travis', 'hint']); grunt.registerTask('bamboo', ['karma:bamboo']); grunt.registerTask('docs', [ 'clean', 'less:docs', 'cssmin', 'template:docs', 'connect:test', 'open:docs', 'ngtemplates', 'watch' ]); grunt.registerTask('server', [ 'clean', 'style', 'template:test', 'connect:test', 'open:test', 'watch' ]); grunt.registerTask('server:e2e', [ 'clean', 'style', 'template:mock', 'connect:mock', 'ngtemplates', 'watch' ]); grunt.registerTask('server:travis', [ 'clean', 'style', 'ngtemplates', 'template:travis', 'connect:travis' ]); grunt.registerTask('bower', [ 'build', 'copy:bower', 'concat:bowerCore', 'uglify:bower', 'clean:bower' ]); grunt.registerTask('build', [ 'clean', 'less:dev', 'ngtemplates', 'useminPrepare', 'concat', 'uglify', 'cssmin', 'copy:assets', 'copy:js', 'copy:docs', 'template:test', 'nggettext_compile', 'filerev', 'usemin' ]); grunt.registerTask('package', ['ci', 'build']); grunt.registerTask('default', ['server']); };
/** * This file is part of Shuup. * * Copyright (c) 2012-2021, Shuup Commerce Inc. All rights reserved. * * This source code is licensed under the OSL-3.0 license found in the * LICENSE file in the root directory of this source tree. */ window.changeLanguage = function changeLanguage() { const form = document.createElement("form"); form.method = "POST"; form.action = "/set-language/"; const input = document.createElement("input"); input.type = "hidden"; input.name = "language"; input.id = "language-field"; input.value = $(this).data("value"); form.appendChild(input); document.body.appendChild(form); form.submit(); }; $(function() { $(".languages li a").click(window.changeLanguage); });
module.exports = AuditAPI; function AuditAPI(hatch){ this.hatch = hatch; } AuditAPI.prototype.track = function track(groupId, eventType, details, cb) { var Event = this.hatch.compound.models.Event; Event.create({ groupId: groupId, type: groupId + '-' + eventType, details: details, }, function(err, event) { if (cb) { cb(err, event); } }); }; AuditAPI.prototype.dailyEventsBreakdown = function(groupId, eventType, date, cb) { var Event = this.hatch.compound.models.Event; if (typeof date === 'function') { cb = date; date = new Date; } if (date instanceof Date) { date = date.getTime(); } var day = Math.floor(date / 86400000); if (typeof eventType === 'string') { eventType = [eventType]; } var wait = eventType.length, breakdown = []; eventType.forEach(function(type) { Event.count({day: groupId + '-' + type + '-' + day}, function(err, count) { breakdown.push({type: type, count: count}); wait -= 1; if (wait === 0) { cb(err, breakdown); } }); }); }; AuditAPI.prototype.eventsBreakdown = function(groupId, eventType, cb) { var Event = this.hatch.compound.models.Event; if (typeof eventType === 'string') { eventType = [eventType]; } var wait = eventType.length, breakdown = []; eventType.forEach(function(type) { Event.count({type: groupId + '-' + type}, function(err, count) { breakdown.push({type: type, count: count}); wait -= 1; if (wait === 0) { cb(err, breakdown); } }); }); };
/* @flow */ import React from 'react'; import { TouchableOpacity, View, Platform, Image } from 'react-native'; import { connectStyle } from '@shoutem/theme'; import mapPropsToStyleNames from '../../Utils/mapPropsToStyleNames'; import NativeBaseComponent from '../Base/NativeBaseComponent'; import computeProps from '../../Utils/computeProps'; class CardItem1 extends NativeBaseComponent { getInitialStyle() { return { listItem: { flexDirection: (this.thumbnailPresent() || this.gravatarPresent() || this.iconPresent() || (this.notePresent() && this.ifShowCase())) ? 'row' : 'column', }, fullImage: { alignSelf: 'stretch', height: this.ifShowCase() ? 120 : 300 }, }; } getRightStyle() { return { right: { flex: 1, paddingLeft: 10, backgroundColor: 'transparent', }, right2: { flex: 1, flexDirection: 'row', paddingLeft: 10, alignItems: 'center', justifyContent: 'space-between', backgroundColor: 'transparent', }, right3: { flex: 1, flexDirection: 'column', paddingLeft: 10, justifyContent: 'flex-start', backgroundColor: 'transparent', }, }; } thumbnailPresent() { let thumbnailComponentPresent = false; React.Children.forEach(this.props.children, (child) => { if (child && child.type.displayName === 'Styled(Thumbnail)') { thumbnailComponentPresent = true; } }); return thumbnailComponentPresent; } gravatarPresent() { let gravatarComponentPresent = false; React.Children.forEach(this.props.children, (child) => { if (child.type.displayName === 'Styled(Gravatar)') { gravatarComponentPresent = true; } }); return gravatarComponentPresent; } imagePresent() { let imagePresent = false; React.Children.forEach(this.props.children, (child) => { if (child && child.type === Image) { imagePresent = true; } }); return imagePresent; } iconPresent() { let iconComponentPresent = false; React.Children.forEach(this.props.children, (child) => { if (child && child.type.displayName === 'Styled(Icon)') { iconComponentPresent = true; } }); return iconComponentPresent; } buttonPresent() { let buttonComponentPresent = false; React.Children.forEach(this.props.children, (child) => { if (child && child.type.displayName === 'Styled(Button)') { buttonComponentPresent = true; } }); return buttonComponentPresent; } ifShowCase() { return !!this.props.cardBody; } notePresent() { let notePresent = false; React.Children.forEach(this.props.children, (child) => { if (child && (child.type.displayName === 'Styled(Text)') && child.props.note) { notePresent = true; } }); return notePresent; } squareThumbs() { let squareThumbs = false; if (this.thumbnailPresent() || this.gravatarPresent()) { React.Children.forEach(this.props.children, (child) => { if (child && child.props.square) { squareThumbs = true; } }); } return squareThumbs; } getChildProps(child) { let defaultProps = {}; if(child.type === Image) defaultProps = { style: this.getInitialStyle().fullImage }; return computeProps(child.props, defaultProps); } renderChildren() { let newChildren = []; let childrenArray = React.Children.toArray(this.props.children); childrenArray = childrenArray.filter(child => !!child); if ((!this.thumbnailPresent()) && !this.iconPresent()) { if (this.imagePresent() && !Array.isArray(this.props.children)) { newChildren.push(<View key="img" style={{ flex: 1, margin: (Platform.OS === 'ios') ? -10 : -12 }}> {childrenArray.map((child, i) => React.cloneElement(child, { ...this.getChildProps(child), key: i }) )} </View> ); } else { newChildren.push( childrenArray.map((child, i) => React.cloneElement(child, { ...this.getChildProps(child), key: i }) ) ); } } else { newChildren = []; if (!Array.isArray(this.props.children)) { newChildren.push( <View key="cardItem1" style={{ justifyContent: 'flex-start' }}> {React.cloneElement(childrenArray)} </View> ); } else { newChildren.push( React.cloneElement(childrenArray[0], this.getChildProps(childrenArray[0]))); newChildren.push( <View key="cardItem1" style={this.notePresent() ? this.getRightStyle().right : this.squareThumbs() ? this.getRightStyle().right3 : this.getRightStyle().right2}> {childrenArray.slice(1).map((child, i) => React.cloneElement(child, { key: i }) )} </View> ); } } return newChildren; } prepareRootProps() { let defaultProps = {}; defaultProps = { style: this.getInitialStyle().listItem }; return computeProps(this.props, defaultProps); } render() { return ( <TouchableOpacity ref={(c) => { this._root = c; }} {...this.prepareRootProps()} activeOpacity={(this.props.button) ? 0.2 : 1} > {this.renderChildren()} </TouchableOpacity> ); } } CardItem1.propTypes = { ...TouchableOpacity.propTypes, style: React.PropTypes.object, header: React.PropTypes.bool, cardBody: React.PropTypes.bool, footer: React.PropTypes.bool, button: React.PropTypes.bool, }; const StyledCardItem1 = connectStyle('NativeBase.CardItem1', {}, mapPropsToStyleNames)(CardItem1); export { StyledCardItem1 as CardItem1, };
// Karma configuration // http://karma-runner.github.io/0.10/config/configuration-file.html module.exports = function(config) { config.set({ // base path, that will be used to resolve files and exclude basePath: '', // testing framework to use (jasmine/mocha/qunit/...) frameworks: ['jasmine'], // list of files / patterns to load in the browser files: [ 'app/bower_components/angular/angular.js', 'app/bower_components/angular-mocks/angular-mocks.js', // 'app/bower_components/jquery/jquery.js', // 'app/bower_components/angular-bootstrap/ui-bootstrap.js', // 'app/bower_components/angular-resource/angular-resource.js', // 'app/bower_components/angular-route/angular-route.js', // 'app/bower_components/angular-animate/angular-animate.js', // 'app/bower_components/ng-table/ng-table.js', // 'app/bower_components/select2/select2.js', // 'app/bower_components/angular-ui-select2/src/select2.js', // 'app/scripts/*.js', // 'app/scripts/**/*.js', 'test/mock/**/*.js', 'test/spec/**/*.js' ], // list of files / patterns to exclude exclude: [], // web server port port: 8080, // level of logging // possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG logLevel: config.LOG_INFO, // enable / disable watching file and executing tests whenever any file changes autoWatch: false, // Start these browsers, currently available: // - Chrome // - ChromeCanary // - Firefox // - Opera // - Safari (only Mac) // - PhantomJS // - IE (only Windows) browsers: ['Chrome'], // Continuous Integration mode // if true, it capture browsers, run tests and exit singleRun: false }); };
const path = require('path'); const merge = require('webpack-merge'); const webpackCommonConfig = require('./webpack.common.js'); // the display name of the war const app = 'task-management'; const config = merge(webpackCommonConfig, { output: { path: path.resolve(__dirname, `./target/${app}/`) } }); module.exports = config;
/* */ var convert = require('./convert'); module.exports = convert('trim', require('../trim'));
#!/usr/bin/env node 'use strict'; console.log('Hello world !'); // https://akdubya.github.io/dustjs/#guide var dust = require('dustjs-linkedin'); var compiled = dust.compile('Hello {name}!', 'intro'); dust.loadSource(compiled); dust.render('intro', {name: 'Fred'}, function(err, out) { console.log(out); });
// Copyright 2007 The Closure Library Authors. 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. /** * @fileoverview Generic queue for writing unit tests. * */ goog.provide('goog.testing.TestQueue'); /** * Generic queue for writing unit tests * @constructor */ goog.testing.TestQueue = function() { /** * Events that have accumulated * @type {Array.<Object>} * @private */ this.events_ = []; }; /** * Adds a new event onto the queue. * @param {Object} event The event to queue. */ goog.testing.TestQueue.prototype.enqueue = function(event) { this.events_.push(event); }; /** * Returns whether the queue is empty. * @return {boolean} Whether the queue is empty. */ goog.testing.TestQueue.prototype.isEmpty = function() { return this.events_.length == 0; }; /** * Gets the next event from the queue. Throws an exception if the queue is * empty. * @param {string=} opt_comment Comment if the queue is empty. * @return {Object} The next event from the queue. */ goog.testing.TestQueue.prototype.dequeue = function(opt_comment) { if (this.isEmpty()) { throw Error('Handler is empty: ' + opt_comment); } return this.events_.shift(); };
'use strict'; function AccessDeniedError(message) { this.name = 'AccessDeniedError'; var detail = message || 'Please check the permissions needed to perform this function.'; this.message = this.name + ': ' + detail; Error.captureStackTrace(this, AccessDeniedError); } AccessDeniedError.prototype = Object.create(Error.prototype); AccessDeniedError.prototype.constructor = AccessDeniedError; function MaxAttemptsExceededError(message) { this.name = 'MaxAttemptsExceededError'; var detail = message || 'INTERNAL ERROR: The maximum number of attempts have been exceeded.'; this.message = [this.name, detail].join(': '); Error.captureStackTrace(this, MaxAttemptsExceededError); } MaxAttemptsExceededError.prototype = Object.create(Error.prototype); MaxAttemptsExceededError.prototype.constructor = MaxAttemptsExceededError; function ResourceAlreadyExistsError(message) { this.name = 'ResourceAlreadyExistsError'; var detail = message || 'The resource already exists.'; this.message = this.name + ': ' + detail; Error.captureStackTrace(this, ResourceAlreadyExistsError); } ResourceAlreadyExistsError.prototype = Object.create(Error.prototype); ResourceAlreadyExistsError.prototype.constructor = ResourceAlreadyExistsError; function ResourceNotFoundError(message) { this.name = 'ResourceNotFoundError'; var detail = message || 'The resource was not found.'; this.message = this.name + ': ' + detail; Error.captureStackTrace(this, ResourceNotFoundError); } ResourceNotFoundError.prototype = Object.create(Error.prototype); ResourceNotFoundError.prototype.constructor = ResourceNotFoundError; function UnknownError(code, message) { this.name = 'UnknownError'; this.code = code; var detail = message || 'An unknown error occurred, please consult the logs for more information.'; this.message = this.name + ': ' + detail; Error.captureStackTrace(this, UnknownError); } UnknownError.prototype = Object.create(Error.prototype); UnknownError.prototype.constructor = UnknownError; module.exports = { AccessDeniedError: AccessDeniedError, MaxAttemptsExceededError: MaxAttemptsExceededError, ResourceAlreadyExistsError: ResourceAlreadyExistsError, ResourceNotFoundError: ResourceNotFoundError, UnknownError: UnknownError };
/* ------------------------------------------------------------------------------ * * # D3.js - multiple nested pie charts * * Demo d3.js multiple pie charts setup with nesting * * Version: 1.0 * Latest update: August 1, 2015 * * ---------------------------------------------------------------------------- */ $(function () { // Initialize chart pieMultipleNested('#d3-pie-nesting', 110, 10); // Chart setup function pieMultipleNested(element, radius, margin) { // Basic setup // ------------------------------ // Main variables var marginTop = 20; // Colors var colors = d3.scale.category20c(); // Load data // ------------------------------ d3.csv("assets/demo_data/d3/pies/pies_nesting.csv", function(flights) { // Nest the flight data by originating airport var airports = d3.nest() .key(function(d) { return d.origin; }) .entries(flights); // Create chart // ------------------------------ // Insert an svg element (with margin) for each row in our dataset var svg = d3.select(element) .selectAll("svg") .data(airports) .enter() .append("svg") .attr("width", (radius + margin) * 2) .attr("height", (radius + margin + marginTop) * 2) .append("g") .attr("transform", "translate(" + (radius + margin) + "," + (radius + margin + marginTop) + ")"); // Construct chart layout // ------------------------------ // Arc var arc = d3.svg.arc() .innerRadius(0) .outerRadius(radius); // Pie var pie = d3.layout.pie() .value(function(d) { return +d.count; }) .sort(function(a, b) { return b.count - a.count; }); // // Append chart elements // // Add a label for the airport svg.append("text") .attr("dy", ".35em") .attr("y", -130) .style("text-anchor", "middle") .style("font-weight", 500) .text(function(d) { return d.key; }); // Pass the nested values to the pie layout var g = svg.selectAll("g") .data(function(d) { return pie(d.values); }) .enter() .append("g") .attr("class", "d3-arc"); // Add a colored arc path, with a mouseover title showing the count g.append("path") .attr("d", arc) .style("stroke", "#fff") .style("fill", function(d) { return colors(d.data.carrier); }) .append("title") .text(function(d) { return d.data.carrier + ": " + d.data.count; }); // Add a label to the larger arcs, translated to the arc centroid and rotated g.filter(function(d) { return d.endAngle - d.startAngle > .2; }).append("text") .attr("dy", ".35em") .attr("transform", function(d) { return "translate(" + arc.centroid(d) + ")rotate(" + angle(d) + ")"; }) .style("fill", "#fff") .style("font-size", 12) .style("text-anchor", "middle") .text(function(d) { return d.data.carrier; }); // Computes the label angle of an arc, converting from radians to degrees function angle(d) { var a = (d.startAngle + d.endAngle) * 90 / Math.PI - 90; return a > 90 ? a - 180 : a; } }); } });
// (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP import React, { Component } from 'react'; import Tip from 'grommet/components/Tip'; import Menu from 'grommet/components/Menu'; import Anchor from 'grommet/components/Anchor'; import DocsArticle from '../../components/DocsArticle'; import Code from '../../components/Code'; Tip.displayName = 'Tip'; export default class TipDoc extends Component { constructor () { super(); this.state = { active: true }; } render () { const { active } = this.state; let tip; if (active) { tip = ( <Tip target='actions' onClose={() => this.setState({ active: false })}> Available actions </Tip> ); } return ( <DocsArticle title='Tip'> <section> <p>An attention getter used to highlight an aspect of the interface that might not be apparent at first glance. This should be used sparingly. Only one Tip should ever be shown on the screen at a time and only when it is referring to an action the user is likely to need or try imminitely.</p> <Menu id='actions' inline={false}> <Anchor href=''>action 1</Anchor> <Anchor href=''>action 2</Anchor> </Menu> {tip} <p>The caller is responsible for determining when to show a Tip. The tip should be removed when the <code> onClose</code> {'function'} is called. Additionally, the Tip should not be re-displayed to the user once it has been dismissed, even across page loads or visits. Tracking which tips a user has seen can be remembered in <Anchor href={'https://developer.mozilla.org/en-US/' + 'docs/Web/API/Window/localStorage'}>local storage</Anchor>. Tips shouldnโ€™t display any rich information including formatted text and should be limit in usage. Prioritize the tip need on user context relevance rather than what is simply โ€œnewโ€ on the interface. To ensure memorability, keep the tip text to under one sentence to support quick skimming of content.</p> </section> <section> <h2>Properties</h2> <dl> <dt><code>colorIndex {'accent-{index}'}</code></dt> <dd>The color identifier to use for the background color. For example: <code>accent-1</code>. Only accent colors are available for Tips. Defaults to <code>accent-1</code></dd> <dt><code>onClose {'{function}'}</code></dt> <dd>Called when the user clicks on the Tip, clicks on the target element, or when the target element loses focus.</dd> <dt><code>target {'{string}'}</code></dt> <dd>The DOM id or class of the element the Tip should be associated with. The id takes priority over class. If multiple classes are found, the first one will be used.</dd> </dl> </section> <section> <h2>Usage</h2> <Code preamble={`import Tip from 'grommet/components/Tip';`}> <Tip target='actions' onClose={() => {}}>Available actions</Tip> </Code> </section> </DocsArticle> ); } };
/** @license * Copyright 2015 - present The AMP HTML Authors. 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. */ import AMPDocument from './components/amp-document/amp-document'; import React from 'react'; import ReactDOM from 'react-dom'; import { Router, Route, browserHistory } from 'react-router'; import Shell from './components/shell'; import 'bootstrap/dist/css/bootstrap.css'; import './bootstrap-theme.css'; // Replace with your own bootstrap theme! ReactDOM.render(( <Router history={browserHistory}> <Route path='/' component={Shell}> <Route path='content/:document' component={ props => <AMPDocument src={'/content/' + props.params.document} /> } /> </Route> </Router> ), document.getElementById('root'));
๏ปฟ/** * AJAX without async */ $.ajax({ url: "", dataType: "JSON", data: { arg1: "val" }, type: "POST", async: true, timeout: 60000, // 1h success: function (data) { // }, error: function (jqXHR, textStatus, error) { var msg = textStatus + ": " + error; } }); /** * A shortthand Ajax function of JSON Ajax */ $.getJSON("", { data: "" }, function (data) { }) .fail(function (jqXHR, textStatus, error) { var msg = textStatus + ": " + error; }); /** * JavaScript create form. */ $("<form>", { "action": "/member/trust.aspx", "method": "POST", html: "<input name=\"content\" type=\"text\" value=\"" + content + "\">" }).appendTo("body").submit(); /** * Convert pixel value to number. */ var pixelValue = "20px"; // Use jQuery get a element's height. var numberValue = parseInt(pixelValue, 10); // 10 ่กจ็คบ่ฝฌๆขไธบๅ่ฟ›ๅˆถๆ•ฐ // ๅฐ†ๅญ—็ฌฆไธฒ่ฝฌๆขไธบ UTF-8 ๅญ—็ฌฆ่กจ็คบๅนถ่ฝฌไน‰็‰นๆฎŠๅญ—็ฌฆ var encodeStr = escape('{"name":"ๆ— ้‚ช"}'); // ๅๅ‘่ฝฌๆข var decodeStr = unescape(encodeStr); // ๅˆคๆ–ญๆŸไธชๅฏน่ฑกๆ˜ฏๅฆๅŒ…ๅซๆŒ‡ๅฎšๆ–นๆณ• if (typeof obj["method"] === "function") { // ... } // ๅŒๆ ทไนŸๅฏไปฅๅˆคๆ–ญๆŸไธชๅฏน่ฑกๆ˜ฏๅฆๅŒ…ๅซๆŒ‡ๅฎšๅฏน่ฑก if (typeof obj["obj"] === "object") { // ... }