code
stringlengths
2
1.05M
$(document).ready(function(){ var modulante = document.getElementById("modulante"); var ctxM= modulante.getContext("2d"); var inicio2 = 0; var inc2 = 0; function set(){ ampMod= $("#ampMod").val(); freqMod = $("#myselect").val(); velAngular2 = 2*Math.PI/freqMod; a = 0; b = 125; } function loop(){ ctxM.fillStyle = "black"; ctxM.fill(); ctxM.fillRect(0,0,700,400); ctxM.strokeStyle = "#33ff77"; ctxM.lineWidth = 1; ampMod = $("#ampMod").val(); inicio2 = inc2; for(var count = 0; count < 700; count++){ ctxM.beginPath(); ctxM.moveTo(a,b); a++; b = -ampMod*Math.sin(inicio2) + 125; inicio2 += velAngular2; ctxM.lineTo(a,b); ctxM.stroke(); } inc2 += velAngular2/2; ctxM.strokeStyle = "#3333ff"; ctxM.lineWidth = 1; //eixo X ctxM.moveTo(0,125); ctxM.lineTo(493,125); ctxM.stroke(); //eixo Y ctxM.moveTo(50,0); ctxM.lineTo(50,250); ctxM.stroke(); } $("#click").click(function(){ setInterval(function(){ set(); loop(); },7); }); });
module.exports.log = function (msg) { console.log(msg); };
'use strict'; angular.module('com.module.sectors',[]);
const typeResult = async (opt = {}, tape, context, appContext) => { let cheerio = appContext.require('cheerio'); let get = appContext.get; let _console = null; let timeout = false; /**/ let htmlRes = null; let htmlLastRes = null; let doc = null; let expectedHtml = null; let counter = 0; let nodeConsole = null; let end = false; let intervalRerender = null; if (appContext.isDev && appContext.isWin && process.stdout && process.stderr) { nodeConsole = nodeConsole || require('console'); _console = new nodeConsole.Console(process.stdout, process.stderr); } else { _console = appContext.logger; } const removeListener = () => { context.renderEvent.removeListener('RENDER', onRender); }; const removeInterval = () => { if (intervalRerender) { clearInterval(intervalRerender); intervalRerender = null; } }; const _end = async () => { timeout = true; removeInterval(); removeListener(); await context.timeout(100); if (!opt.avoidGoBack) await context.goBack(); await tape.end(); _console = null; nodeConsole = null; get = null; cheerio = null; return true; }; if (opt == {} || !tape || !context || !appContext) { tape.ok(false, 'insufficient args'); return await _end(); } const _onRender = async event => { if (!timeout) { const result = context.getLastviewEvent(); if (!result) { await tape.ok(false, 'No result'); return await _end(); } doc = result._document; if (!doc) { await tape.ok(false, 'No document'); return await _end(); } if (cheerio && opt.elHtml) { try { htmlRes = cheerio .load(doc)(opt.elHtml || 'div') .eq(0) .html(); if (htmlRes && htmlRes.length) htmlLastRes = htmlRes; } catch (e) { await tape.ok(false, ['error', e]); if (!appContext.isDev) appContext.logger.warn(e, counter, opt.elHtml, doc); return await _end(); } } if (opt.expectedHtml) { expectedHtml = opt.expectedHtml; if (opt.whitOutSpaces) { if (htmlRes) htmlRes = htmlRes.replace(/\s/g, ''); if (expectedHtml) expectedHtml = expectedHtml.replace(/\s/g, ''); } if (opt.toLowerCase) { if (htmlRes) htmlRes = htmlRes.toLowerCase(); if (expectedHtml) expectedHtml = expectedHtml.toLowerCase(); } if (opt.verbose && opt.expectedHtml && _console.log) _console.log(htmlRes, counter, expectedHtml); if (!end && opt.expectedHtml && (htmlRes || '').indexOf(expectedHtml) !== -1) { end = true; tape.plan(1); await tape.ok(true, 'expectedHtml ok'); return await _end(); } } counter++; } }; const onRender = opt.onRender ? async $event => await opt.onRender($event, _end, { log: _console.log }) : _onRender; context.renderEvent.on('RENDER', onRender); if (opt.typeKeySequence) { if (!opt.avoidGoBack) await context.goBack(); await context.keySequence(context.keyString2array(opt.typeKeySequence)); } else if (opt.setPath) { if (!opt.avoidGoBack) await context.goBack(); appContext.setPath(opt.setPath); } if (opt.timeToForceReRender) { await context.timeout(opt.timeToForceReRender); context.renderEvent.emit('MAIN_FORCE_UPDATE'); } if (opt.intervalTToForceReRender && !intervalRerender) { intervalRerender = setInterval(() => { if (!timeout) context.renderEvent.emit('MAIN_FORCE_UPDATE'); }, opt.intervalTToForceReRender); } await context.timeout(opt.timeout || 5000); if (!timeout) { context.renderEvent.emit('MAIN_FORCE_UPDATE'); tape.comment('mhhh... long wait try re-render'); await context.timeout(1000); } if (!timeout) { //FAIL tape.ok(false, [ 'timeout / not found ', ' / res: ', htmlLastRes, ' / exp: ', expectedHtml, opt.verbose || true ? '/ doc: ' : '', opt.verbose || true ? doc : '', '/ counter: ', counter, ]); return await _end(); } return true; }; module.exports = { typeResult, }; /* EXAMPLE */ /* 'use strict'; const getTapeTests = appContext => { const { typeResult } = appContext.require('@uitests/_aux_tests_short_tapes.js'); return [ { name: 'TEST JSX', options: {}, callBack: async (tape, context) => { return await typeResult( { typeKeySequence: 'T,T,B,0,0,1,J,S,X', expectedHtml: 'test TTB001JSX ok!', elHtml: '#ruleViewerWrapp', timeout: 10000, whitOutSpaces: true, }, tape, context, appContext ); }, }, ]; }; module.exports = appContext => [...getTapeTests(appContext)]; */
var searchData= [ ['g_5fpfnvectors',['g_pfnVectors',['../startup__ccs_8c.html#a28c770c8f2522f11e2a95f7486620c5b',1,'startup_ccs.c']]], ['g_5fpi2cqueue',['g_pI2CQueue',['../freertos__init_8c.html#a55252560d8d07bbe427530279fce48fe',1,'g_pI2CQueue():&#160;i2c_task.c'],['../i2c__task_8c.html#a55252560d8d07bbe427530279fce48fe',1,'g_pI2CQueue():&#160;i2c_task.c']]], ['g_5fpi2csemaphore',['g_pI2CSemaphore',['../freertos__init_8c.html#a1f7d234e6c93b67011a021e6e7925e2a',1,'g_pI2CSemaphore():&#160;freertos_init.c'],['../i2c__task_8c.html#a1f7d234e6c93b67011a021e6e7925e2a',1,'g_pI2CSemaphore():&#160;freertos_init.c']]], ['g_5fpinterpreterqueue',['g_pINTERPRETERQueue',['../interpreter__task_8c.html#a7ba2e9ebf55b27e928ad1ebfeff60ef8',1,'interpreter_task.c']]], ['g_5fpledqueue',['g_pLEDQueue',['../freertos__init_8c.html#a41575dda1eb4126338491ad6f9b43c40',1,'g_pLEDQueue():&#160;led_manager.c'],['../led__manager_8c.html#a41575dda1eb4126338491ad6f9b43c40',1,'g_pLEDQueue():&#160;led_manager.c']]], ['g_5fploggerqueue',['g_pLoggerQueue',['../command__functions_8c.html#a26a32e89f729483765fc577cc51859de',1,'g_pLoggerQueue():&#160;event_logger.c'],['../eee__hal_8c.html#a26a32e89f729483765fc577cc51859de',1,'g_pLoggerQueue():&#160;event_logger.c'],['../event__logger_8c.html#a26a32e89f729483765fc577cc51859de',1,'g_pLoggerQueue():&#160;event_logger.c'],['../freertos__init_8c.html#a26a32e89f729483765fc577cc51859de',1,'g_pLoggerQueue():&#160;event_logger.c'],['../interpreter__task_8c.html#a26a32e89f729483765fc577cc51859de',1,'g_pLoggerQueue():&#160;event_logger.c'],['../startup__ccs_8c.html#a26a32e89f729483765fc577cc51859de',1,'g_pLoggerQueue():&#160;event_logger.c']]], ['g_5fpspi0semaphore',['g_pSPI0Semaphore',['../eee__hal_8c.html#ab602c48669f22ec902c5a42c7d03ed86',1,'g_pSPI0Semaphore():&#160;freertos_init.c'],['../freertos__init_8c.html#ab602c48669f22ec902c5a42c7d03ed86',1,'g_pSPI0Semaphore():&#160;freertos_init.c']]], ['g_5fpspi1semaphore',['g_pSPI1Semaphore',['../eee__hal_8c.html#ad54812d64ec068acb33be0e3f21e8e6e',1,'g_pSPI1Semaphore():&#160;freertos_init.c'],['../freertos__init_8c.html#ad54812d64ec068acb33be0e3f21e8e6e',1,'g_pSPI1Semaphore():&#160;freertos_init.c']]], ['g_5fpuartsemaphore',['g_pUARTSemaphore',['../event__logger_8c.html#ad91863137538f0561cfcbc11d403be16',1,'g_pUARTSemaphore():&#160;freertos_init.c'],['../freertos__init_8c.html#ad91863137538f0561cfcbc11d403be16',1,'g_pUARTSemaphore():&#160;freertos_init.c'],['../interpreter__task_8c.html#ad91863137538f0561cfcbc11d403be16',1,'g_pUARTSemaphore():&#160;freertos_init.c'],['../port__monitor__task_8c.html#ad91863137538f0561cfcbc11d403be16',1,'g_pUARTSemaphore():&#160;freertos_init.c']]], ['global_20control_20register_20definitions',['Global Control Register Definitions',['../group___g_l_c___o_f_f_s_e_t.html',1,'']]], ['global_5fconfig_5fmax_5fmappings',['GLOBAL_CONFIG_MAX_MAPPINGS',['../interpreter__task_8h.html#a5a16c8cefafe97803b092ecdb640b856',1,'interpreter_task.h']]], ['global_5fcontrol_5f0',['GLOBAL_CONTROL_0',['../group___g_l_c___o_f_f_s_e_t.html#ga19250fed5448eb91f32b64610b571711',1,'interpreter_task.h']]], ['global_5fcontrol_5f0_5fhex',['GLOBAL_CONTROL_0_HEX',['../group___g_l_c___o_f_f_s_e_t.html#ga34c218e9c14b4195f6bf6f31fac43c54',1,'interpreter_task.h']]], ['global_5fcontrol_5f1',['GLOBAL_CONTROL_1',['../group___g_l_c___o_f_f_s_e_t.html#ga500f8cdb98febf232dcb88f7c0b84600',1,'interpreter_task.h']]], ['global_5fcontrol_5f1_5fhex',['GLOBAL_CONTROL_1_HEX',['../group___g_l_c___o_f_f_s_e_t.html#gaae76a9f4ba3e2586f494ecd9a994692f',1,'interpreter_task.h']]], ['global_5fcontrol_5f2',['GLOBAL_CONTROL_2',['../group___g_l_c___o_f_f_s_e_t.html#ga9593d550e68f0cb4a87d6676c05d597e',1,'interpreter_task.h']]], ['global_5fcontrol_5f2_5fhex',['GLOBAL_CONTROL_2_HEX',['../group___g_l_c___o_f_f_s_e_t.html#ga4feaf3b52a5c7e631764acd7b1fb6b32',1,'interpreter_task.h']]], ['global_5fcontrol_5f3',['GLOBAL_CONTROL_3',['../group___g_l_c___o_f_f_s_e_t.html#ga432261fb9d4d3d8774f42d00a08a5d00',1,'interpreter_task.h']]], ['global_5fcontrol_5f3_5fhex',['GLOBAL_CONTROL_3_HEX',['../group___g_l_c___o_f_f_s_e_t.html#gaeb703c6b628d86482908596e1a4ae7f8',1,'interpreter_task.h']]], ['global_5fcontrol_5f9',['GLOBAL_CONTROL_9',['../group___g_l_c___o_f_f_s_e_t.html#gabaa6677bb15a55fc662213328abd04dc',1,'interpreter_task.h']]], ['global_5fcontrol_5f9_5fhex',['GLOBAL_CONTROL_9_HEX',['../group___g_l_c___o_f_f_s_e_t.html#ga249633f7c5556e278ec8f1ad951f3e81',1,'interpreter_task.h']]] ];
/** * Module dependencies. */ var request = require('request'); var mongoose = require('mongoose'); var Query = mongoose.model('Query'); var Photo = mongoose.model('Photo'); var https = require('https'); var API_KEY = require('config').flickr_api_key; /** * Searching images in Flickr API * @param {String} searchText searching text * @param {Number} page page * @param {Number} perPage items per page * @param {Date} maxDate max date of upload images * @return {Promise} Promise */ var searchAPI = function (searchText, page, perPage, maxDate) { var apiKey = API_KEY; var promise = new Promise((resolve, reject) => { var url = `\/services\/rest\/?method=flickr.photos.search&text=${searchText}&page=${page}&per_page=${perPage}&max_upload_date=${maxDate}&api_key=${apiKey}&format=json&nojsoncallback=1`; // the rest of the url with parameters if needed var options = { method: 'GET', url: 'https://api.flickr.com' + url, headers: { "Content-Type": "application/json", "Accept": "application/json" } }; var callback = function(error, response, body) { var data; if (error) { console.log('error', error); reject(error) res.send(500, 'something went wrong'); } try { data = JSON.parse(body); data.photos.photo.map(function (obj) { obj.flickrId = obj.id; delete obj.id; return obj; }); } catch(e) { console.log('malformed request', body); reject(e) return res.status(400).send('malformed request: ' + body); } resolve(data); } request(options, callback); }); return promise; }; /** * Searching images in Flickr API and store * returned value in database for a future * cache purpose * @param {String} searchText searching text * @param {Number} page page * @param {Number} perPage items per page * @param {Date} maxDate max date of upload images * @return {Promise} Promise */ var storeSearchQuery = function(searchText, page, perPage, maxDate) { var photosJSON; var refs = []; var promise = new Promise((resolve, reject) => { //Get query from API searchAPI(searchText, page, perPage, maxDate) .then((photosRes) => { photosJSON = photosRes; return Photo.findOrCreate(photosRes.photos.photo); }) .then(function saveQuery(foundedOrCreated) { //Collecting ID's of images if (foundedOrCreated) { foundedOrCreated.forEach((photo) => { if (photo && photo._id) { refs.push(photo._id); } }); } var query = new Query({ searchText: searchText, page: photosJSON.photos.page, pages: photosJSON.photos.pages, perpage: photosJSON.photos.perpage, total: photosJSON.photos.total, maxDate: maxDate, photo: refs // Adding images to query }); return query.save(); }) .then(function getSavedQuery(query) { console.log('jestem tutaj!!'); return Query.findOne(query._id).populate('photo').exec(); }) .then(function returnValues(photos) { resolve({ photos: photos, stat: 'ok' }); }) .catch(reject); }); return promise; }; /** * Searching using database if query was previously cached * if not we are going to use Flickr API and store values * in database for a future * @param {String} searchText searching text * @param {Number} page page * @param {Number} perPage items per page * @param {Date} maxDate max date of upload images * @return {Promise} Promise */ var search = function (searchText, page, perPage, maxDate) { var promise = new Promise((resolve, reject) => { // Check if we already have saved query Query.findOne({ searchText: searchText, page: page, perpage: perPage, maxDate: maxDate }) .populate('photo') .exec() .then(function doWeHaveQueryInDB(query) { if (query) { console.log('HIT! to database!'); resolve({ photos: query, stat: 'ok' }); } else { console.log('Getting images from Flickr'); storeSearchQuery(searchText, page, perPage, maxDate) .then(resolve, reject) } }, reject) }); return promise; }; /** * Expose */ exports.search = search; exports.searchAPI = searchAPI;
'use strict'; var _ = require( './utils' ); var Object3D = require( './object3d' ); var Vector3 = require( './math/vector3' ); var Matrix4 = require( './math/matrix4' ); var DEG_TO_RAD = Math.PI / 180; // Temp Matrix4. var mt = new Matrix4(); function Camera( fov, aspect, near, far ) { Object3D.call( this ); this.fov = fov || 60; this.aspect = aspect || 1; this.near = near || 0.1; this.far = far || 1000; this.matrixWorldInverse = new Matrix4(); this.projectionMatrix = new Matrix4(); this.updateProjectionMatrix(); } _.extends( Camera, Object3D ); Camera.prototype.lookAt = function( vector ) { mt.lookAt( this.position, vector, Vector3.Y ); this.quaternion.setFromRotationMatrix( mt ); }; Camera.prototype.updateProjectionMatrix = function() { var near = this.near, far = this.far; var top = near * Math.tan( this.fov * 0.5 * DEG_TO_RAD ), bottom = -top, left = bottom * this.aspect, right = top * this.aspect; var x = 2 * near / ( right - left ), y = 2 * near / ( top - bottom ); var a = ( right + left ) / ( right - left ), b = ( top + bottom ) / ( top - bottom ), c = -( far + near ) / ( far - near ), d = -2 * far * near / ( far - near ); var m = this.projectionMatrix.elements; m[ 0 ] = x; m[ 1 ] = 0; m[ 2 ] = 0; m[ 3 ] = 0; m[ 4 ] = 0; m[ 5 ] = y; m[ 6 ] = 0; m[ 7 ] = 0; m[ 8 ] = a; m[ 9 ] = b; m[ 10 ] = c; m[ 11 ] = -1; m[ 12 ] = 0; m[ 13 ] = 0; m[ 14 ] = d; m[ 15 ] = 0; return this; }; module.exports = Camera;
const name = {0:'Ace', 1:'2', 2:'3', 3:'4', 4:'5', 5:'6', 6:'7', 7:'8', 8:'9', 9:'10', 10:'Jack', 11:'Queen', 12:'King'}; const points = {0:1, 1:2, 2:3, 3:4, 4:5, 5:6, 6:7, 7:8, 8:9, 9:10, 10:10, 11:10, 12:10}; const suits = {0:'Spade', 1:'Heart', 2:'Club', 3:'Diamond'}; export {name, points, suits}; export function splicer(remainingCards) { let card = remainingCards.splice(parseInt(Math.random() * remainingCards.length, 10), 1)[0] return {card, remainingCards}; }
(function(){ angular .module('<%= appname %>') .run(runner); function runner($ionicPlatform) { $ionicPlatform.ready(function() { // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard // for form inputs) if (window.cordova && window.cordova.plugins.Keyboard) { cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); cordova.plugins.Keyboard.disableScroll(true); } if (window.StatusBar) { // org.apache.cordova.statusbar required StatusBar.styleDefault(); } }); } })();
var inherit = require('./inherit'), Sprite = require('../display/Sprite'), Tilemap = require('../tilemap/Tilemap'), Rectangle = require('../geom/Rectangle'), BitmapText = require('../text/BitmapText'); /** * The object factory makes it simple to create and add objects to a parent. One is added * to a State's world and camera by default, but they can be used for any parent but they * can only belong to a single state. * * @class ObjectFactory * @extends Object * @constructor * @param state {State} The game state this factory belongs to * @param parent {Container} The container to act as the parent for created objects */ var ObjectFactory = function(state, parent) { this.state = state; this.game = state.game; this.parent = parent; }; inherit(ObjectFactory, Object, { /** * Adds a generic object to the world or camera * * @method obj * @param object {mixed} Any game object you want to add to the parent * @return {mixed} Returns the added object */ obj: function(obj) { return this.parent.addChild(obj); }, /** * Creates a new sprite and adds it to the game world * * @method sprite * @param texture {String|Texture} The texture for the sprite, or the key for one in the cache * @param [frame=null] {String|Number} A specific frame of a sprite sheet to use, either the index or string key * depending on the type of the sheet when loaded. * @param [physics=true] {Boolean} Should this sprite be added to the physics simulation? * @return {Sprite} The sprite added */ sprite: function(tx, frame, physics) { var spr, game = this.game; if(typeof tx === 'string') { if(frame || frame === 0) tx = game.cache.getTextures(tx)[frame]; else tx = game.cache.getTexture(tx); } if(!tx) { tx = game.cache.getTexture('__default'); } spr = new Sprite(tx); //if undefined, then default to true if(physics || physics === undefined) { spr.enablePhysics(this.state.physics); //this.state.physics.addSprite(spr); } return this.parent.addChild(spr); }, /** * Creates a new AudioPlayer to play the sound passed in * * @method audio * @param key {String} The unique cache key for the preloaded audio * @param [settings] {Object} All the settings for the audio player (see AudioManager.add for all settings) * @return {AudioPlayer} The player added */ audio: function(key, settings) { return this.state.audio.add(key, settings); }, /** * Creates a new tilemap to add to the world * * @method tilemap * @param key {String} The unique cache key for the preloaded tilemap data * @param [constrain=true] {Boolean} Should the camera be constrained to this tilemap's size? * @return {Tilemap} The tilemap added */ tilemap: function(key, constrain) { var obj = this.game.cache.getTilemap(key) || {}, tilemap = new Tilemap(this.state, obj.data, obj.textures); if(constrain) { this.state.camera.constrain(new Rectangle(0, 0, tilemap.realSize.x, tilemap.realSize.y)); } //force render of tilemap tilemap.render( -this.state.world.position.x, -this.state.world.position.x, this.game.width, this.game.height ); tilemap._cachekey = key; return this.parent.addChild(tilemap); }, /** * Creates a new instance of BitmapText * * @method bitmaptext * @param text {String} The text for the BitmapText to display * @param font {String} The key for the bitmap font loaded into the cache * @param interactive {Boolean} Can the item be interacted with by mouse (clicked, dragged, etc) * @return {BitmapText} The bitmap text object added */ bitmaptext: function(text, font, style) { if(typeof font === 'string') font = this.game.cache.getBitmapFont(font); return this.parent.addChild(new BitmapText(text, font, style)); } }); module.exports = ObjectFactory;
"use strict"; var expect = require('expect.js'); var List = require('../lib/list.js'); var Pair = require('../lib/pair.js'); var Data = require('../lib/data.js'); var PP = require('../lib/pprinter.js'); var Parser = require('../lib/parser.js'); var Dentaku = require('../lib/dentaku.normal.js'); describe('dentaku.normal', () => { it("evaluate", (next) => { expect( Dentaku.evaluate("123") ).to.eql( 123 ); expect( Dentaku.evaluate("1 + 2") ).to.eql( 3 ); expect( Dentaku.evaluate("2 - 1") ).to.eql( 1 ); expect( Dentaku.evaluate("1.2 * 2") ).to.eql( 2.4 ); expect( Dentaku.evaluate("3.9 / 3") ).to.eql( 1.3 ); next(); }); // describe('parser', () => { // it("expr", (next) => { // expect( // PP.print(Parser.parse(Dentaku.expr())(List.fromString("123"))) // // PP.print(Parser.parse(Dentaku.expr())(List.fromString("123"))) // ).to.eql( // '[(123,[]),nil]' // ); // next(); // }); // it("factor", (next) => { // expect( // PP.print(Parser.parse(Dentaku.factor())(List.fromString("123"))) // ).to.eql( // '[(123,[]),nil]' // ); // next(); // }); // it("term", (next) => { // expect( // PP.print(Parser.parse(Dentaku.term())(List.fromString("1 * 2"))) // ).to.eql( // '[(2,[]),nil]' // ); // next(); // }); // }); });
import './APICode'; import './devtools'; import './goToURL'; import './uninstall'; import './updateAvailable'; import './appDetails'; import './lyrics'; import './openPort'; import './onlineStatus'; // Anything that requires the DOM needs to go here as of Electron 0.36.6 document.addEventListener('DOMContentLoaded', () => { require('./webviewLoader'); require('./control-bar'); });
// Initializes the `deals` service on path `/deals` const createService = require('feathers-mongoose'); const createModel = require('../../models/deals.model'); const hooks = require('./deals.hooks'); const filters = require('./deals.filters'); module.exports = function() { const app = this; const Model = createModel(app); const options = { name: 'deals', Model, }; // Initialize our service with any options it requires app.use('/deals', createService(options)); // Get our initialized service so that we can register hooks and filters const service = app.service('deals'); service.hooks(hooks); if (service.filter) { service.filter(filters); } };
require("ember-bootstrap/mixins/focus_support"); var Bootstrap = window.Bootstrap, get = Ember.get; Bootstrap.Forms.Select = Bootstrap.Forms.Field.extend({ optionLabelPath: 'content', optionValuePath: 'content', inputField: Ember.Select.extend(Bootstrap.FocusSupport, { contentBinding: 'parentView.content', optionLabelPathBinding: 'parentView.optionLabelPath', optionValuePathBinding: 'parentView.optionValuePath', valueBinding: 'parentView.value', selectionBinding: 'parentView.selection', promptBinding: 'parentView.prompt', multipleBinding: 'parentView.multiple', autofocusBinding: 'parentView.autofocus', disabledBinding: 'parentView.disabled', classNameBindings: ['parentView.inputClassNames'], name: Ember.computed(function() { return this.get('parentView.name') || this.get('parentView.label'); }).property('parentView.name', 'parentView.label'), _IE10AndLaterHack: function () { //doesn't fill in the selected value when content is loaded after the selection if (('documentMode' in document && 'atob' in window)) {//IE10+ this.rerender(); } }.observes('content.[]') }) });
import createServer from 'rally-point-server' const secret = process.env.SB_RALLY_POINT_SECRET const port = Number(process.env.SB_RALLY_POINT_LOCAL_PORT ?? 14098) const server = createServer('::', port, secret) server.bind().then(() => { console.log('rally-point server running on port ' + port) })
var createBackoff = require('./backoff').createBackoff; var WebSocketImpl = (typeof(WebSocket) !== "undefined") ? WebSocket : require('ws'); class WebSocketClient { /** * @param url DOMString The URL to which to connect; this should be the URL to which the WebSocket server will respond. * @param protocols DOMString|DOMString[] Either a single protocol string or an array of protocol strings. These strings are used to indicate sub-protocols, so that a single server can implement multiple WebSocket sub-protocols (for example, you might want one server to be able to handle different types of interactions depending on the specified protocol). If you don't specify a protocol string, an empty string is assumed. */ constructor (url, protocols, options = {}) { this.url = url; this.protocols = protocols; this.reconnectEnabled = true; this.listeners = {}; this.backoff = createBackoff(options.backoff || 'exponential', options); this.backoff.onReady = this.onBackoffReady.bind(this); if (typeof(options.connect)==="undefined" || options.connect) { this.open(); } } open (reconnect = false) { this.isReconnect = reconnect; // keep binaryType used on previous WebSocket connection let binaryType = this.ws && this.ws.binaryType; this.ws = new WebSocketImpl(this.url, this.protocols); this.ws.onclose = this.onCloseCallback.bind(this); this.ws.onerror = this.onErrorCallback.bind(this); this.ws.onmessage = this.onMessageCallback.bind(this); this.ws.onopen = this.onOpenCallback.bind(this); if (binaryType) { this.ws.binaryType = binaryType; } } /** * @ignore */ onBackoffReady (number, delay) { // console.log("onBackoffReady", number + ' ' + delay + 'ms'); this.open(true); } /** * @ignore */ onCloseCallback (e) { if (!this.isReconnect && this.listeners['onclose']) { this.listeners['onclose'].apply(null, arguments); } if (this.reconnectEnabled && e.code < 3000) { this.backoff.backoff(); } } /** * @ignore */ onErrorCallback () { if (this.listeners['onerror']) { this.listeners['onerror'].apply(null, arguments); } } /** * @ignore */ onMessageCallback () { if (this.listeners['onmessage']) { this.listeners['onmessage'].apply(null, arguments); } } /** * @ignore */ onOpenCallback () { if (this.listeners['onopen']) { this.listeners['onopen'].apply(null, arguments); } if (this.isReconnect && this.listeners['onreconnect']) { this.listeners['onreconnect'].apply(null, arguments); } this.isReconnect = false; } /** * The number of bytes of data that have been queued using calls to send() * but not yet transmitted to the network. This value does not reset to zero * when the connection is closed; if you keep calling send(), this will * continue to climb. * * @type unsigned long * @readonly */ get bufferedAmount () { return this.ws.bufferedAmount; } /** * The current state of the connection; this is one of the Ready state constants. * @type unsigned short * @readonly */ get readyState () { return this.ws.readyState; } /** * A string indicating the type of binary data being transmitted by the * connection. This should be either "blob" if DOM Blob objects are being * used or "arraybuffer" if ArrayBuffer objects are being used. * @type DOMString */ get binaryType () { return this.ws.binaryType; } set binaryType (binaryType) { this.ws.binaryType = binaryType; } /** * The extensions selected by the server. This is currently only the empty * string or a list of extensions as negotiated by the connection. * @type DOMString */ get extensions () { return this.ws.extensions; } set extensions (extensions) { this.ws.extensions = extensions; } /** * A string indicating the name of the sub-protocol the server selected; * this will be one of the strings specified in the protocols parameter when * creating the WebSocket object. * @type DOMString */ get protocol () { return this.ws.protocol; } set protocol (protocol) { this.ws.protocol = protocol; } /** * Closes the WebSocket connection or connection attempt, if any. If the * connection is already CLOSED, this method does nothing. * * @param code A numeric value indicating the status code explaining why the connection is being closed. If this parameter is not specified, a default value of 1000 (indicating a normal "transaction complete" closure) is assumed. See the list of status codes on the CloseEvent page for permitted values. * @param reason A human-readable string explaining why the connection is closing. This string must be no longer than 123 bytes of UTF-8 text (not characters). * * @return void */ close (code, reason) { if (typeof code == 'undefined') { code = 1000; } this.reconnectEnabled = false; this.ws.close(code, reason); } /** * Transmits data to the server over the WebSocket connection. * @param data DOMString|ArrayBuffer|Blob * @return void */ send (data) { this.ws.send(data); } /** * An event listener to be called when the WebSocket connection's readyState changes to CLOSED. The listener receives a CloseEvent named "close". * @param listener EventListener */ set onclose (listener) { this.listeners['onclose'] = listener; } get onclose () { return this.listeners['onclose']; } /** * An event listener to be called when an error occurs. This is a simple event named "error". * @param listener EventListener */ set onerror (listener) { this.listeners['onerror'] = listener; } get onerror () { return this.listeners['onerror']; } /** * An event listener to be called when a message is received from the server. The listener receives a MessageEvent named "message". * @param listener EventListener */ set onmessage (listener) { this.listeners['onmessage'] = listener; } get onmessage () { return this.listeners['onmessage']; } /** * An event listener to be called when the WebSocket connection's readyState changes to OPEN; this indicates that the connection is ready to send and receive data. The event is a simple one with the name "open". * @param listener EventListener */ set onopen (listener) { this.listeners['onopen'] = listener; } get onopen () { return this.listeners['onopen']; } /** * @param listener EventListener */ set onreconnect (listener) { this.listeners['onreconnect'] = listener; } get onreconnect () { return this.listeners['onreconnect']; } } /** * The connection is not yet open. */ WebSocketClient.CONNECTING = WebSocketImpl.CONNECTING /** * The connection is open and ready to communicate. */ WebSocketClient.OPEN = WebSocketImpl.OPEN /** * The connection is in the process of closing. */ WebSocketClient.CLOSING = WebSocketImpl.CLOSING /** * The connection is closed or couldn't be opened. */ WebSocketClient.CLOSED = WebSocketImpl.CLOSED export default WebSocketClient
// alternative tips texts_join_button1_tip = "Sende Dein Foto in nur 3 Klicks"; texts_join_button2_tip = "Wähle einen Bild auf Deinem Rechner"; // error messages texts_error_server = "Entschuldigung, aber etwas stimmt mit Deinem Server nicht. Kannst Du nochmal versuchen?"; texts_error_imagetype = "Wähle eine JPG, GIF, BMP oder PND Datei aus"; texts_error_field = "Bitte dieses Feld ausfüllen"; texts_error_imagesize = "Wähle eine Datei, die weniger als 6 MB hat";
var mongoose=require('mongoose'); var Schema=mongoose.Schema; var postSchema=Schema({ title: { type: String, required: true }, body: { type: String, required: true }, slug: { type: String, required: true, unique: true }, created_at: { type: Date, default: Date.now } }); module.exports=mongoose.model('Post',postSchema);
//Global var var INSPIRO = {}; (function ($) { // USE STRICT "use strict"; //----------------------------------------------------/ // Predefined Variables //----------------------------------------------------/ var $window = $(window), $document = $(document), $body = $('body'), $wrapper = $('.wrapper'), $topbar = $('#topbar'), $header = $('#header'), //Logo logo = $('#logo').find('.logo'), logoImg = logo.find('img').attr('src'), logoDark = logo.attr('data-dark-logo'), //Main menu //mainmenuitems = $("#mainMenu > ul > li"), $mainmenu = $('#mainMenu'), $mainmenuitems = $mainmenu.find('li.dropdown > a'), $mainsubmenuitems = $mainmenu.find('li.dropdown-submenu > a, li.dropdown-submenu > span'), //Vertical Dot Menu navigationItems = $('#vertical-dot-menu a'), //Side panel sidePanel = $('#side-panel'), sidePanellogo = $('#panel-logo').find('.logo'), sidePanellogoImg = sidePanellogo.find('img').attr('src'), sidePanellogoDark = sidePanellogo.attr('data-dark-logo'), //Fullscreen panel fullScreenPanel = $('#fullscreen-panel'), $topSearch = $('#top-search'), $parallax = $('.parallax'), $textRotator = $('.text-rotator'), //Window size control $fullScreen = $('.fullscreen') || $('.section-fullscreen'), $halfScreen = $('.halfscreen'), //Slider $slider = $('#slider'), //Elements dataAnimation = $("[data-animation]"), $counter = $('.counter:not(.counter-instant)'), $countdownTimer = $('.countdown'), $progressBar = $('.progress-bar'), $pieChart = $('.pie-chart'), $map = $('.map'), accordionType = "accordion", toogleType = "toggle", accordionItem = "ac-item", itemActive = "ac-active", itemTitle = "ac-title", itemContent = "ac-content", $lightbox_gallery = $('[data-lightbox-type="gallery"]'), $lightbox_image = $('[data-lightbox-type="image"]'), $lightbox_iframe = $('[data-lightbox-type="iframe"]'), $lightbox_ajax = $('[data-lightbox-type="ajax"]'), //Widgets $widget_twitter = $('.widget-tweeter'), $flickr_widget = $('.flickr-widget'), $ytPlayer = $('.youtube-background'), //Utilites classFinder = "."; //----------------------------------------------------/ // UTILITIES //----------------------------------------------------/ //Check if function exists $.fn.exists = function () { return this.length > 0; }; //----------------------------------------------------/ // MOBILE CHECK //----------------------------------------------------/ var isMobile = { Android: function () { return navigator.userAgent.match(/Android/i); }, BlackBerry: function () { return navigator.userAgent.match(/BlackBerry/i); }, iOS: function () { return navigator.userAgent.match(/iPhone|iPad|iPod/i); }, Opera: function () { return navigator.userAgent.match(/Opera Mini/i); }, Windows: function () { return navigator.userAgent.match(/IEMobile/i); }, any: function () { return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows()); } }; //----------------------------------------------------/ // RESPONSIVE CLASSES //----------------------------------------------------/ INSPIRO.responsiveClasses = function () { var jRes = jRespond([ { label: 'smallest', enter: 0, exit: 479 }, { label: 'handheld', enter: 480, exit: 767 }, { label: 'tablet', enter: 768, exit: 991 }, { label: 'laptop', enter: 992, exit: 1199 }, { label: 'desktop', enter: 1200, exit: 10000 } ]); jRes.addFunc([ { breakpoint: 'desktop', enter: function () { $body.addClass('device-lg'); }, exit: function () { $body.removeClass('device-lg'); } }, { breakpoint: 'laptop', enter: function () { $body.addClass('device-md'); }, exit: function () { $body.removeClass('device-md'); } }, { breakpoint: 'tablet', enter: function () { $body.addClass('device-sm'); }, exit: function () { $body.removeClass('device-sm'); } }, { breakpoint: 'handheld', enter: function () { $body.addClass('device-xs'); }, exit: function () { $body.removeClass('device-xs'); } }, { breakpoint: 'smallest', enter: function () { $body.addClass('device-xxs'); }, exit: function () { $body.removeClass('device-xxs'); } } ]); }; //----------------------------------------------------/ // PAGE LOADER //----------------------------------------------------/ INSPIRO.loader = function () { if (!$body.hasClass('no-page-loader')) { var pageInAnimation = $body.attr('data-animation-in') || "fadeIn", pageOutAnimation = $body.attr('data-animation-out') || "fadeOut", pageLoaderStylePath = $body.attr('data-animation-icon-path') || "/static/media/images/svg-loaders/", pageLoaderStyle = $body.attr('data-animation-icon') || "ring.svg", pageInDuration = $body.attr('data-speed-in') || 1000, pageOutDuration = $body.attr('data-speed-out') || 500; $wrapper.animsition({ inClass: pageInAnimation, outClass: pageOutAnimation, inDuration: pageInDuration, outDuration: pageOutDuration, linkElement: '#mainMenu a:not([target="_blank"]):not([href^=#]), .animsition-link', loading: true, loadingParentElement: 'body', //animsition wrapper element loadingClass: 'animsition-loading', loadingInner: '<img src="' + pageLoaderStylePath + pageLoaderStyle + '">', // e.g '<img src="loading.svg" />' timeout: false, timeoutCountdown: 5000, onLoadEvent: true, browser: ['animation-duration', '-webkit-animation-duration'], // "browser" option allows you to disable the "animsition" in case the css property in the array is not supported by your browser. // The default setting is to disable the "animsition" in a browser that does not support "animation-duration". overlay: false, overlayClass: 'animsition-overlay-slide', overlayParentElement: 'body', transition: function (url) { window.location.href = url; } }); //Skip loader if page has an js error or not loading for more than 5 seconds! setTimeout(function () { if ($(".animsition-loading").length) { $body.addClass("no-page-loader"); $(".animsition-loading").hide(); } }, 5000); } }; //----------------------------------------------------/ // SCREEN SIZE CONTROL //----------------------------------------------------/ INSPIRO.sliderHeighControl = function () { if ($(".inspiro-slider").exists()) { var headerHeight = $header.height(), topbarHeight = $topbar.height(), windowHeight = $(window).height(), screenHeightExtra = headerHeight + topbarHeight, sliderFullscreen = $('#slider').hasClass('slider-fullscreen'), screenRatio = $('#slider').hasClass('slider-fullscreen') ? 1 : 1.28, transparentHeader = $header.hasClass("header-transparent") || $header.hasClass("header-semi-transparent") || $header.hasClass("header-light-transparent") || $header.hasClass("header-dark-transparent"), sliderTargetElements = $(".inspiro-slider, .inspiro-slider .owl-stage-outer, .inspiro-slider .owl-stage, .inspiro-slider .slide"), customHeight = $(".inspiro-slider").data("height"), responsiveHeightxs = $(".inspiro-slider").data("height-xs") || 300; if ($body.hasClass('device-lg') || $body.hasClass('device-md') || $body.hasClass('device-sm')) { if (transparentHeader) { if (sliderFullscreen) { sliderTargetElements.css('height', windowHeight + 'px'); } else { if (!$header.hasClass(".header-transparent")) { $(".inspiro-slider .slide").css('padding-top', screenHeightExtra + 'px'); } if (!customHeight) { sliderTargetElements.css('height', windowHeight / screenRatio + 'px'); } else { sliderTargetElements.css('height', customHeight + 'px'); } } } else { if (sliderFullscreen) { sliderTargetElements.css('height', windowHeight - screenHeightExtra + 'px'); } else { sliderTargetElements.css('height', windowHeight / screenRatio - screenHeightExtra + 'px'); } } } else { sliderTargetElements.css('height', responsiveHeightxs + 'px'); } } }; INSPIRO.screenSizeControl = function () { if ($fullScreen.exists()) { var headerHeight = $header.height(); var topbarHeight = $topbar.height(); $fullScreen.each(function () { var $elem = $(this), elemHeight = $window.height(); $elem.css('height', elemHeight); }); } if ($halfScreen.exists()) { $halfScreen.each(function () { var $elem = $(this), elemHeight = $window.height(); $elem.css('height', elemHeight / 1.5); }); } }; //----------------------------------------------------/ // INSPIRO SLIDER //----------------------------------------------------/ INSPIRO.inspiroSlider = function () { if ($(".inspiro-slider").exists()) { $(".inspiro-slider").each(function () { var elem = $(this); if ($body.hasClass("device-lg") || $body.hasClass("device-md")) { if (elem.find('.slide').length > 1) { elem.owlCarousel({ loop: true, margin: 0, nav: true, navText: ['<i class="fa fa-arrow-left icon-white"></i>', '<i class="fa fa-arrow-right icon-white"></i>'], autoplay: true, dots: true, autoplayHoverPause: true, navigation: true, items: 1, smartSpeed: 1300, singleItem: true, callbacks: true, onInitialize: function (event) { setTimeout(function () { elem.find(".owl-item:not(.active) .slide > video").each(function () { this.pause(); }); }, 100); } }); } var $captions = elem.find('.slide-captions > *'); $captions.each(function () { var $captionElem = $(this); var animationDuration = "1000ms"; if ($(this).data("animation-duration")) { animationDuration = $(this).data("animation-duration") + "ms"; } $(this).css("animation-duration", animationDuration); $captionElem.addClass('slide-caption-hide'); }); $captions.each(function (index) { var $captionElem = $(this), captionDelay = $captionElem.data("caption-delay") || index * 80, captionAnimation = $captionElem.data('caption-animation') || "fadeInUp"; setTimeout(function () { $captionElem.removeClass('slide-caption-hide').addClass(captionAnimation); }, captionDelay); }); elem.on('changed.owl.carousel', function (property) { var current = property.item.index; var currentSlide = $(property.target).find(".owl-item").eq(current); var currentSlideCaptions = currentSlide.find(".slide-captions > *"); var currentSlideDark = currentSlide.find(".slide").hasClass("slide-dark"); currentSlideCaptions.each(function (index) { var $captionElem = $(this), captionDelay = $captionElem.data("caption-delay") || (index * 350 + 1000), captionAnimation = $captionElem.data('caption-animation') || "fadeInUp"; setTimeout(function () { $captionElem.removeClass('slide-caption-hide').addClass(captionAnimation); }, captionDelay); }); if ($(window).width() > 992) { //Dark Header /* if (currentSlideDark && $header.hasClass("header-transparent")) { $header.removeClass("header-dark"); INSPIRO.logoStatus(); } else { $header.addClass("header-dark"); INSPIRO.logoStatus(); } */ //Pause HTML5 Video if (currentSlide.find("video")) { setTimeout(function () { currentSlide.find(".slide video").each(function () { this.play() }); }, 1000) } } }); elem.on('change.owl.carousel', function (property) { var currentSlideCaptions = $(property.target).find(".owl-item:not(.active)").find(".slide-captions > *"); currentSlideCaptions.each(function () { var $captionElem = $(this), captionAnimation = $captionElem.data('caption-animation') || "fadeInUp"; $captionElem.removeClass(captionAnimation).addClass('slide-caption-hide'); }); elem.find(".slide video").each(function () { this.pause() }); }); } else { if (elem.find('.slide').length > 1) { elem.owlCarousel({ margin: 0, loop: true, nav: false, navText: ['<i class="fa fa-arrow-left icon-white"></i>', '<i class="fa fa-arrow-right icon-white"></i>'], autoplay: true, dots: true, navigation: true, items: 1 }); } } }); } }; //----------------------------------------------------/ // CAROUSEL SLIDER //----------------------------------------------------/ INSPIRO.carouselInspiro = function () { var $sliderCarousel = $('.carousel') || $('.owl-carousel'), $postCarousel = $(".post-mini-slider"); if ($sliderCarousel.exists()) { $sliderCarousel.each(function () { var element = $(this), sliderCarouselColumns = element.attr('data-carousel-col') || "4", sliderCarouselColumnsMedium = element.attr('data-carousel-col-md') || "4", sliderCarouselColumnsSmall = element.attr('data-carousel-col-sm') || "3", sliderCarouselColumnsExtraSmall = element.attr('data-carousel-col-xs') || "1", $sliderCarouselMargins = element.attr('data-carousel-margins') || "20", $sliderCarouseDots = element.attr('data-carousel-dots') || false, $sliderCarouseNav = false, $sliderCarouseAutoPlay = element.attr('data-carousel-autoplay') || false, $sliderCarouseVideo = element.attr('data-carousel-video') || false; if ($sliderCarouseDots === false) { $sliderCarouseNav = true; } else { $sliderCarouseDots = true; } if (sliderCarouselColumns == 1) { element.owlCarousel({ margin: Number($sliderCarouselMargins), nav: $sliderCarouseNav, navText: ['<i class="fa fa-arrow-left icon-white"></i>', '<i class="fa fa-arrow-right icon-white"></i>'], autoplay: $sliderCarouseAutoPlay, autoplayHoverPause: true, dots: $sliderCarouseDots, items: 1, autoHeight: false, video: $sliderCarouseVideo, }); } else { element.owlCarousel({ margin: Number($sliderCarouselMargins), nav: $sliderCarouseNav, navText: ['<i class="fa fa-arrow-left icon-white"></i>', '<i class="fa fa-arrow-right icon-white"></i>'], autoplay: $sliderCarouseAutoPlay, autoplayHoverPause: true, dots: $sliderCarouseDots, video: $sliderCarouseVideo, responsive: { 0: { items: sliderCarouselColumnsExtraSmall }, 600: { items: sliderCarouselColumnsSmall }, 1000: { items: sliderCarouselColumnsMedium }, 1200: { items: sliderCarouselColumns } } }); } }); } if ($postCarousel.exists()) { $postCarousel.each(function () { setTimeout(function () { $postCarousel.owlCarousel({ autoplay: true, autoplayHoverPause: true, dots: true, mouseDrag: false, touchDrag: false, items: 1, autoHeight: true, }); }, 100); }); } if ($("#slider-carousel").exists()) { $("#slider-carousel").each(function () { $("#slider-carousel").owlCarousel({ margin: 0, loop: true, nav: true, navText: ['<i class="fa fa-arrow-left icon-white"></i>', '<i class="fa fa-arrow-right icon-white"></i>'], autoplay: true, dots: false, autoplayHoverPause: true, navigation: true, items: 1, animateOut: 'fadeOut' }); var owl = $("#slider-carousel"); $('.owl-item.active .slider-content').addClass("animated fadeIn"); owl.on('changed.owl.carousel', function (event) { $('.owl-item:not(.active)').siblings().find(".slider-content").removeClass("animated fadeIn"); setTimeout(function () { $('.owl-item.active .slider-content').addClass("animated fadeIn"); }, 300); //stop embed videos if they exists if ($("#slider-carousel .owl-item.active .slider-content iframe").length) { var url = $("#slider-carousel .owl-item.active .slider-content iframe").attr("src"); $('iframe').attr('src', ''); $('iframe').attr('src', url); } }); }); } // News ticker if ($('.news-ticker-content').exists()) { $('.news-ticker-content').each(function () { $('.news-ticker-content').owlCarousel({ autoplay: true, autoplayHoverPause: true, dots: false, mouseDrag: true, touchDrag: true, margin: 40, autoWidth: true, autoplayTimeout: "3000", loop: true, }); }); } if ($('.tab-carousel').exists()) { if ($('.tab-carousel').parent().hasClass('active')) { $('.tab-carousel').owlCarousel({ navText: ['<i class="fa fa-arrow-left icon-white"></i>', '<i class="fa fa-arrow-right icon-white"></i>'], margin: 0, nav: true, dots: false, items: 1 }); } else { $('.tabs-navigation li a').click(function () { $('.tab-carousel').owlCarousel({ navText: ['<i class="fa fa-arrow-left icon-white"></i>', '<i class="fa fa-arrow-right icon-white"></i>'], margin: 0, nav: true, dots: false, items: 1 }); }); } } }; /* INSPIRO.carouselInspiro = function () { var $sliderCarousel = $('.carousel') || $('.owl-carousel'), $postCarousel = $(".post-mini-slider"); if ($sliderCarousel.exists()) { $sliderCarousel.each(function () { var element = $(this), sliderCarouselColumns = element.attr('data-carousel-col') || "4", sliderCarouselColumnsMedium = element.attr('data-carousel-col-md') || "4", sliderCarouselColumnsSmall = element.attr('data-carousel-col-sm') || "3", sliderCarouselColumnsExtraSmall = element.attr('data-carousel-col-xs') || "1", $sliderCarouselMargins = element.attr('data-carousel-margins') || "20", $sliderCarouseDots = element.attr('data-carousel-dots') || false, $sliderCarouseNav = false, $sliderCarouseAutoPlay = element.attr('data-carousel-autoplay') || false, $sliderCarouseVideo = element.attr('data-carousel-video') || false; if ($sliderCarouseDots === false) { $sliderCarouseNav = true; } else { $sliderCarouseDots = true; } if (sliderCarouselColumns == 1) { element.owlCarousel({ margin: Number($sliderCarouselMargins), nav: $sliderCarouseNav, navText: ['<i class="fa fa-arrow-left icon-white"></i>', '<i class="fa fa-arrow-right icon-white"></i>'], autoplay: $sliderCarouseAutoPlay, autoplayTimeout: 3000, autoplayHoverPause: true, dots: $sliderCarouseDots, items: 1, autoHeight: false, video: $sliderCarouseVideo, smartSpeed: 1300, }); } else { element.owlCarousel({ margin: Number($sliderCarouselMargins), nav: $sliderCarouseNav, navText: ['<i class="fa fa-arrow-left icon-white"></i>', '<i class="fa fa-arrow-right icon-white"></i>'], autoplay: $sliderCarouseAutoPlay, autoplayTimeout: 3000, autoplayHoverPause: true, dots: $sliderCarouseDots, video: $sliderCarouseVideo, smartSpeed: 1300, loop:true, responsive: { 0: { items: sliderCarouselColumnsExtraSmall }, 600: { items: sliderCarouselColumnsSmall }, 1000: { items: sliderCarouselColumnsMedium }, 1200: { items: sliderCarouselColumns } } }); } }); } if ($postCarousel.exists()) { $postCarousel.each(function () { $postCarousel.owlCarousel({ autoplay: true, autoplayHoverPause: true, dots: true, autoplayTimeout: 3000, mouseDrag: false, touchDrag: false, smartSpeed: 1300, items: 1, loop: true }); }); } if ($("#slider-carousel").exists()) { $("#slider-carousel").each(function () { $("#slider-carousel").owlCarousel({ margin: 0, nav: true, navText: ['<i class="fa fa-arrow-left icon-white"></i>', '<i class="fa fa-arrow-right icon-white"></i>'], autoplay: true, dots: false, autoplayHoverPause: true, navigation: true, items: 1, animateOut: 'fadeOut', smartSpeed: 1300 }); var owl = $("#slider-carousel"); $('.owl-item.active .slider-content').addClass("animated fadeIn"); owl.on('changed.owl.carousel', function (event) { $('.owl-item:not(.active)').siblings().find(".slider-content").removeClass("animated fadeIn"); setTimeout(function () { $('.owl-item.active .slider-content').addClass("animated fadeIn"); }, 300); //stop embed videos if they exists if ($("#slider-carousel .owl-item.active .slider-content iframe").length) { var url = $("#slider-carousel .owl-item.active .slider-content iframe").attr("src"); $('iframe').attr('src', ''); $('iframe').attr('src', url); } }); }); } // News ticker if ($('.news-ticker-content').exists()) { $('.news-ticker-content').each(function () { $('.news-ticker-content').owlCarousel({ autoplay: true, autoplayHoverPause: true, dots: false, mouseDrag: true, touchDrag: true, margin: 40, autoWidth: true, autoplayTimeout: "3000", }); }); } if ($('.tab-carousel').exists()) { if ($('.tab-carousel').parent().hasClass('active')) { $('.tab-carousel').owlCarousel({ navText: ['<i class="fa fa-arrow-left icon-white"></i>', '<i class="fa fa-arrow-right icon-white"></i>'], margin: 0, nav: true, dots: false, items: 1 }); } else { $('.tabs-navigation li a').click(function () { $('.tab-carousel').owlCarousel({ navText: ['<i class="fa fa-arrow-left icon-white"></i>', '<i class="fa fa-arrow-right icon-white"></i>'], margin: 0, nav: true, dots: false, items: 1 }); }); } } };*/ //----------------------------------------------------/ // SMOTH SCROLL NAVIGATION //----------------------------------------------------/ INSPIRO.naTo = function () { $('a.scroll-to, a.nav-to').on('click', function () { var $anchor = $(this); $('html, body').stop(true, false).animate({ scrollTop: $($anchor.attr('href')).offset().top }, 1500, 'easeInOutExpo'); return false; }); }; //----------------------------------------------------/ // GO TO TOP //----------------------------------------------------/ INSPIRO.goToTop = function () { /* if ($('.gototop').length > 0) { var $goToTop = $('.gototop'), scrollOffsetFromTop = 800; if ($window.scrollTop() > scrollOffsetFromTop) { $goToTop.fadeIn("slow"); } else { $goToTop.fadeOut("slow"); } $goToTop.on("click", function () { $('body,html').stop(true).animate({ scrollTop: 0 }, 1500, 'easeInOutExpo'); return false; }); }*/ }; //----------------------------------------------------/ // LOGO STATUS //----------------------------------------------------/ INSPIRO.logoStatus = function () { if ($header.hasClass('header-navigation-light') && $window.width() < 991) { logo.find('img').attr('src', logoImg); } else { if ($header.hasClass('header-dark')) { if (logoDark) { logo.find('img').attr('src', logoDark); } else { logo.find('img').attr('src', logoImg); } } else { logo.find('img').attr('src', logoImg); } } }; //----------------------------------------------------/ // STICKY HEADER //----------------------------------------------------/ INSPIRO.stickyHeaderStatus = function () { if ($header.exists()) { var headerOffset = $header.offset().top; if ($window.scrollTop() > headerOffset) { if ($body.hasClass('device-lg') || $body.hasClass('device-md')) { if (!$header.hasClass("header-no-sticky")) { $header.addClass('header-sticky'); } if ($header.hasClass('header-navigation-light')) { logo.find('img').attr('src', logoImg); } } else { $header.removeClass('header-sticky'); } } else { $header.removeClass('header-sticky'); } } }; INSPIRO.stickyHeader = function () { $window.on('scroll', function () { INSPIRO.logoStatus(); INSPIRO.stickyHeaderStatus(); }); }; //----------------------------------------------------/ // TOP BAR //----------------------------------------------------/ INSPIRO.topBar = function () { if ($topbar.exists()) { $("#topbar .topbar-dropdown .topbar-form").each(function (index, element) { if ($window.width() - ($(element).width() + $(element).offset().left) < 0) { $(element).addClass('dropdown-invert'); } }); } }; //----------------------------------------------------/ // TOP SEARCH //----------------------------------------------------/ $("#top-search-trigger").on("click", function () { $body.toggleClass('top-search-active'); $topSearch.find('input').focus(); return false; }); //----------------------------------------------------/ // MAIN MENU //----------------------------------------------------/ if (!$body.hasClass('device-lg') || !$body.hasClass('device-md')) { if ($mainmenu.hasClass('mega-menu')) { $mainmenuitems.on('click', function () { $(this).parent('ul li').toggleClass("resp-active", 1000, "easeOutSine"); return false; }); $mainsubmenuitems.on('click', function () { $(this).parent('li').toggleClass('resp-active'); return false; }); } } INSPIRO.menuFix = function () { if ($body.hasClass('device-lg') || $body.hasClass('device-md')) { $('ul.main-menu .dropdown:not(.mega-menu-item) ul ul').each(function (index, element) { if ($window.width() - ($(element).width() + $(element).offset().left) < 0) { $(element).addClass('menu-invert'); } }); } }; INSPIRO.mainMenu = function () { if ($mainmenu.hasClass("slide-menu")) { $(".nav-main-menu-responsive").addClass("slide-menu-version"); $(".lines-button").on("click", function () { $(this).toggleClass("tcon-transform"); $(".navigation-wrap").toggleClass("navigation-active"); $mainmenu.toggleClass("items-visible"); }); } else { $(".lines-button").on("click", function () { $(this).toggleClass("tcon-transform"); $(".navigation-wrap").toggleClass("navigation-active"); }); } $(".navigation-wrap").removeClass("navbar-collapse collapse main-menu-collapse"); } //----------------------------------------------------/ // Side panel //----------------------------------------------------/ INSPIRO.sidePanel = function () { if (sidePanel.exists()) { if ($body.hasClass("side-panel-static")) { $body.addClass("side-push-panel side-panel-left side-panel-active"); } else { $(".side-panel-button button").on("click", function () { if ($body.hasClass("side-panel-active")) { $body.removeClass("side-panel-active"); } else { $body.addClass("side-panel-active"); } return false; }); $body.removeClass("side-panel-active"); $body.addClass("side-push-panel side-panel-left"); } } else { $body.removeClass("side-push-panel side-panel-left"); } //Side Panel Dark logo version if (sidePanel.hasClass('side-panel-dark')) { if (sidePanellogoDark) { sidePanellogo.find('img').attr('src', sidePanellogoDark); } else { sidePanellogo.find('img').attr('src', sidePanellogoImg); } } else { sidePanellogo.find('img').attr('src', sidePanellogoImg); } }; //----------------------------------------------------/ // VERTICAL MENU (DOTS) //----------------------------------------------------/ INSPIRO.verticalDotMenu = function () { if (navigationItems.exists()) { navigationItems.on('click', function () { navigationItems.removeClass('active'); $(this).addClass('active'); return false; }); } }; //----------------------------------------------------/ // FULLSCREEN MENU //----------------------------------------------------/ INSPIRO.fullScreenPanel = function () { if (fullScreenPanel.exists()) { $("#fullscreen-panel-button").on("click", function () { $body.toggleClass('fullscreen-panel-active'); return false; }); } }; //----------------------------------------------------/ // TEXT ROTATOR //----------------------------------------------------/ INSPIRO.textRotator = function () { if ($textRotator.exists()) { $textRotator.each(function () { var $elem = $(this), dataTextSeperator = $elem.attr('data-rotate-separator') || ",", dataTextEffect = $elem.attr('data-rotate-effect') || "flipInX", dataTextSpeed = $elem.attr('data-rotate-speed') || 2000; $textRotator.Morphext({ animation: dataTextEffect, separator: dataTextSeperator, speed: Number(dataTextSpeed) }); }); } }; //----------------------------------------------------/ // ACCORDION //----------------------------------------------------/ INSPIRO.accordion = function () { var $accs = $(classFinder + accordionItem); $accs.length && ($accs.each(function () { var $item = $(this); $item.hasClass(itemActive) ? $item.addClass(itemActive) : $item.find(classFinder + itemContent).hide(); }), $(classFinder + itemTitle).on("click", function (e) { var $link = $(this), $item = $link.parents(classFinder + accordionItem), $acc = $item.parents(classFinder + accordionType); $item.hasClass(itemActive) ? $acc.hasClass(toogleType) ? ($item.removeClass(itemActive), $link.next(classFinder + itemContent).slideUp("fast")) : ($acc.find(classFinder + accordionItem).removeClass(itemActive), $acc.find(classFinder + itemContent).slideUp("fast")) : ($acc.hasClass(toogleType) || ($acc.find(classFinder + accordionItem).removeClass(itemActive), $acc.find(classFinder + itemContent).slideUp("fast")), $item.addClass(itemActive), $link.next(classFinder + itemContent).slideToggle("fast") ), e.preventDefault(); return false; })); if ($('.carousel').exists()) { INSPIRO.carouselInspiro(); } }; /* --------------------------------------------------------------------------- * TABS * --------------------------------------------------------------------------- */ INSPIRO.tabs = function () { var $tabNavigation = $(".tabs-navigation a"); if ($tabNavigation.exists()) { $tabNavigation.on("click", function (e) { $(this).tab("show"), e.preventDefault(); return false; }); } }; /* --------------------------------------------------------------------------- * Animations * --------------------------------------------------------------------------- */ INSPIRO.animations = function () { if (dataAnimation.exists() && $body.hasClass('device-lg') || $body.hasClass('device-md')) { dataAnimation.each(function () { $(this).addClass("animated"); var $elem = $(this), animationType = $elem.attr("data-animation") || "fadeIn", animationDelay = $elem.attr("data-animation-delay") || 200, animationDirection = ~animationType.indexOf("Out") ? "back" : "forward"; if (animationDirection == "forward") { $elem.appear(function () { setTimeout(function () { $elem.addClass(animationType + " visible"); }, animationDelay); }, { accX: 0, accY: -120 }, 'easeInCubic'); } else { $elem.addClass("visible"); $elem.on("click", function () { $elem.addClass(animationType); return false; }); } if ($elem.parents('.demo-play-animations').length) { $elem.on("click", function () { $elem.removeClass(animationType); setTimeout(function () { $elem.addClass(animationType); }, 50); return false; }); } }); } }; /* --------------------------------------------------------------------------- * PARALLAX * --------------------------------------------------------------------------- */ INSPIRO.parallax = function () { if ($parallax.exists() || $(".page-title-parallax")) { if ($body.hasClass('device-lg') || $body.hasClass('device-md')) { $.stellar({ horizontalScrolling: false, verticalScrolling: true, horizontalOffset: 0, verticalOffset: 0, }); } else { $parallax.addClass('no-parallax'); } } }; /* --------------------------------------------------------------------------- * RESPONSIVE VIDEOS * --------------------------------------------------------------------------- */ INSPIRO.resposniveVideos = function () { if ($().fitVids) { $("section, .content, .post-content, .ajax-quick-view,#slider:not(.revslider-wrap)").fitVids(); } }; /* --------------------------------------------------------------------------- * COUNTER NUMBERS * --------------------------------------------------------------------------- */ INSPIRO.counters = function () { if ($counter.exists()) { $counter.each(function () { var $elem = $(this); if ($body.hasClass('device-lg') || $body.hasClass('device-md')) { $elem.appear(function () { $elem.find('span').countTo(); }); } else { var countTo = $elem.find('span').attr('data-to'); $elem.find('span').html(countTo); } }); } }; /* --------------------------------------------------------------------------- * COUNTDOWN TIMER * --------------------------------------------------------------------------- */ INSPIRO.countdownTimer = function () { if ($countdownTimer.exists()) { setTimeout(function () { $('[data-countdown]').each(function () { var $this = $(this), finalDate = $(this).data('countdown'); $this.countdown(finalDate, function (event) { $this.html(event.strftime('<div class="countdown-container"><div class="countdown-box"><div class="number">%-D</div><span>Day%!d</span></div>' + '<div class="countdown-box"><div class="number">%H</div><span>Hours</span></div>' + '<div class="countdown-box"><div class="number">%M</div><span>Minutes</span></div>' + '<div class="countdown-box"><div class="number">%S</div><span>Seconds</span></div></div>')); }); }); }, 300); } }; /* --------------------------------------------------------------------------- * PROGRESS BARS * --------------------------------------------------------------------------- */ INSPIRO.progressBar = function () { if ($progressBar.exists()) { $progressBar.each(function (i, elem) { var $elem = $(this), percent = $elem.attr('data-percent') || "100", delay = $elem.attr('data-delay') || "100", type = $elem.attr('data-type') || "%"; if (!$elem.hasClass('progress-animated')) { $elem.css({ 'width': '0%' }); } var progressBarRun = function () { $elem.animate({ 'width': percent + '%' }, 'easeInOutCirc').addClass('progress-animated'); $elem.delay(delay).append('<span class="progress-type animated fadeIn">' + type + '</span><span class="progress-number animated fadeIn">' + percent + '</span>'); }; if ($body.hasClass('device-lg') || $body.hasClass('device-md')) { $(elem).appear(function () { setTimeout(function () { progressBarRun(); }, delay); }); } else { progressBarRun(); } }); } }; /* --------------------------------------------------------------------------- * PRI CHARTS * --------------------------------------------------------------------------- */ INSPIRO.pieChart = function () { if ($pieChart.exists()) { $pieChart.each(function () { var $elem = $(this), pieChartSize = $elem.attr('data-size') || "160", pieChartAnimate = $elem.attr('data-animate') || "2000", pieChartWidth = $elem.attr('data-width') || "6", pieChartColor = $elem.attr('data-color') || "#00c0e9", pieChartTrackColor = $elem.attr('data-trackcolor') || "rgba(0,0,0,0.10)"; $elem.find('span, i').css({ 'width': pieChartSize + 'px', 'height': pieChartSize + 'px', 'line-height': pieChartSize + 'px' }); $elem.appear(function () { $elem.easyPieChart({ size: Number(pieChartSize), animate: Number(pieChartAnimate), trackColor: pieChartTrackColor, lineWidth: Number(pieChartWidth), barColor: pieChartColor, scaleColor: false, lineCap: 'square', onStep: function (from, to, percent) { $elem.find('span.percent').text(Math.round(percent)); } }); }); }); } }; /* --------------------------------------------------------------------------- * GOOGLE MAPS * --------------------------------------------------------------------------- */ INSPIRO.maps = function () { if ($map.exists()) { $map.each(function () { var $elem = $(this), mapAddress = $elem.attr('data-map-address') ? $elem.attr('data-map-address') : "Melbourne, Australia", mapType = $elem.attr('data-map-type') ? $elem.attr('data-map-type') : "ROADMAP", mapZoom = $elem.attr('data-map-zoom') ? $elem.attr('data-map-zoom') : "14", mapIcon = $elem.attr('data-map-icon') ? $elem.attr('data-map-icon') : "/static/media/images/markers/marker2.png"; var markers = [{ address: mapAddress, html: mapAddress, icon: { image: mapIcon, iconsize: [40, 63], iconanchor: [18, 60], }, }]; $elem.gMap({ address: mapAddress, maptype: mapType, markers: markers, zoom: Number(mapZoom), doubleclickzoom: true, controls: { panControl: true, zoomControl: true, mapTypeControl: false, scaleControl: true, streetViewControl: false, overviewMapControl: true }, styles: [{ featureType: "poi", elementType: "labels", stylers: [{ visibility: "off" }] }] }); }); } }; /* --------------------------------------------------------------------------- * MASONRY ISOTOPE * --------------------------------------------------------------------------- */ INSPIRO.masonryIsotope = function () { var $isotops = $(".isotope"); $isotops.each(function () { var isotopeTime, $elem = $(this), defaultFilter = $elem.data("isotopeDefaultFilter") || 0, id = $elem.attr("id"), mode = $elem.attr('data-isotope-mode') || "masonry", columns = $elem.attr('data-isotope-col') || "4", $elemContainer = $elem, itemElement = $elem.attr('data-isotope-item') || ".isotope-item", itemElementSpace = $elem.attr('data-isotope-item-space') || 0; $elem.isotope({ filter: defaultFilter, itemSelector: itemElement, layoutMode: mode, transitionDuration: '0.6s', resizesContainer: true, resizable: true, animationOptions: { duration: 400, queue: !1 } }), $window.resize(function () { $elemContainer.css('margin-right', '-' + itemElementSpace + '%'); if ($body.hasClass('device-sm') || $body.hasClass('device-xs')) { itemWidth(2, $elemContainer, itemElement, itemElementSpace); } else if ($body.hasClass('device-xxs')) { itemWidth(1, $elemContainer, itemElement, itemElementSpace); } else { itemWidth(columns, $elemContainer, itemElement, itemElementSpace); } if (columns == 1 && $body.hasClass('device-sm') || columns == 1 && $body.hasClass('device-xs')) { itemWidth(1, $elemContainer, itemElement, itemElementSpace); } clearTimeout(isotopeTime), isotopeTime = setTimeout(function () { $elem.isotope("layout"); }, 300); }); var $menu = $('[data-isotope-nav="' + id + '"]'); $menu.length && $menu.find("li:not('.link-only')").on("click", function (e) { var $link = $(this); $(".filter-active-title").empty().append($link.text()); if (!$link.hasClass("ptf-active")) { var selector = $link.attr("data-filter"); $link.parents(".portfolio-filter").eq(0).find(".ptf-active").removeClass("ptf-active"), $link.addClass("ptf-active"), $elem.isotope({ filter: selector }); } e.preventDefault(); return false; }), $window.resize(); }); }; // Intellegent Grid var itemWidth = function (columns, $elemContainer, itemElement, itemElementSpace) { var $findElement = $elemContainer.find(itemElement); var $findElementLarge = $elemContainer.find(".large-item"); var itemElementMargins = { "margin-right": itemElementSpace + "%", "margin-bottom": itemElementSpace + "%", }; if (columns == 1) { $findElement.width('100%'); $findElementLarge.width('100%'); } if (columns == 2) { $findElement.width(50 - itemElementSpace + '%').css(itemElementMargins); $findElementLarge.width(50 - itemElementSpace + '%').css(itemElementMargins); } if (columns == 3) { $findElement.width(33.33 - itemElementSpace + '%').css(itemElementMargins); $findElementLarge.width(66.66 - itemElementSpace + '%').css(itemElementMargins); } if (columns == 4) { $findElement.width(25 - itemElementSpace + '%').css(itemElementMargins); $findElementLarge.width(50 - itemElementSpace + '%').css(itemElementMargins); } if (columns == 5) { $findElement.width(20 - itemElementSpace + '%').css(itemElementMargins); $findElementLarge.width(40 - itemElementSpace + '%').css(itemElementMargins); } if (columns == 6) { $findElement.width(16.666666 - itemElementSpace + '%').css(itemElementMargins); $findElementLarge.width(33.333333 - itemElementSpace + '%').css(itemElementMargins); } }; /* --------------------------------------------------------------------------- * TOOLTIPS * --------------------------------------------------------------------------- */ INSPIRO.tooltip = function () { var $tooltip = $('[data-toggle="tooltip"]'); if ($tooltip.exists()) { $('[data-toggle="tooltip"]').tooltip(); } }; /* --------------------------------------------------------------------------- * POPOVER * --------------------------------------------------------------------------- */ INSPIRO.popover = function () { var $popover = $('[data-toggle="popover"]'); if ($popover.exists()) { $('[data-toggle="popover"]').popover({ container: 'body', html: true }); } }; /* --------------------------------------------------------------------------- * LIGHTBOX * --------------------------------------------------------------------------- */ INSPIRO.lightBoxInspiro = function () { if ($lightbox_image.exists()) { $lightbox_image.magnificPopup({ type: 'image' }); } if ($lightbox_gallery.exists()) { $lightbox_gallery.each(function () { $(this).magnificPopup({ delegate: 'a[data-lightbox="gallery-item"]', type: 'image', gallery: { enabled: true } }); }); } if ($lightbox_iframe.exists()) { $lightbox_iframe.each(function () { $(this).magnificPopup({ type: 'iframe' }); }); } if ($lightbox_ajax.exists()) { $lightbox_ajax.each(function () { $(this).magnificPopup({ type: 'ajax', callbacks: { ajaxContentAdded: function (mfpResponse) { INSPIRO.carouselInspiro(); INSPIRO.resposniveVideos(); INSPIRO.accordion(); } } }); }); } }; /* --------------------------------------------------------------------------- * FLICKR WIDGET * --------------------------------------------------------------------------- */ INSPIRO.widget_twitter = function () { }; /* --------------------------------------------------------------------------- * FLICKR WIDGET * --------------------------------------------------------------------------- */ INSPIRO.flickr_widget = function () { if ($flickr_widget.exists()) { $flickr_widget.each(function () { var $elem = $(this), $flickrId = $elem.attr('data-flickr-id') || "52617155@N08", $flickrImages = $elem.attr('data-flickr-images') || "9"; $flickr_widget.jflickrfeed({ limit: $flickrImages, qstrings: { id: $flickrId }, itemTemplate: '<a href="{{image}}" title="{{title}}"><img src="{{image_s}}" alt="{{title}}" /></a>' }, function () { $elem.magnificPopup({ delegate: 'a', type: 'image', gallery: { enabled: true } }); }); }); } }; /* --------------------------------------------------------------------------- * YOUTUBE BACKGROUND PLAYER * --------------------------------------------------------------------------- */ INSPIRO.youTubeBgPlayer = function () { if ($ytPlayer.exists()) { $ytPlayer.each(function () { var elem = $(this), ytPlayerVideo = elem.attr('data-youtube-url') || null, ytPlayerMute = elem.attr('data-youtube-mute') || false, ytPlayerRatio = elem.attr('data-youtube-ratio') || '16/9', ytPlayerQuality = elem.attr('data-youtube-quality') || 'hd720', ytPlayerOpacity = elem.attr('data-youtube-opacity') || 1, ytPlayerContainer = elem.attr('data-youtube-container') || 'self', ytPlayerOptimize = elem.attr('data-youtube-optimize') || true, ytPlayerLoop = elem.attr('data-youtube-loop') || true, ytPlayerVolume = elem.attr('data-youtube-volume') || 1, ytPlayerStart = elem.attr('data-youtube-start') || 0, ytPlayerStop = elem.attr('data-youtube-stop') || 0, ytPlayerAutoPlay = elem.attr('data-youtube-autoplay') || false, ytPlayerFullScreen = elem.attr('data-youtube-fullscreen') || true, ytPlayerControls = elem.attr('data-youtube-controls') || false, ytPlayerLogo = elem.attr('data-youtube-controls') || false, ytPlayerAutoPause = elem.attr('data-youtube-autopause') || false; elem.mb_YTPlayer({ videoURL: ytPlayerVideo, mute: ytPlayerMute, ratio: ytPlayerRatio, quality: ytPlayerQuality, opacity: ytPlayerOpacity, containment: ytPlayerContainer, optimizeDisplay: ytPlayerOptimize, loop: ytPlayerLoop, vol: ytPlayerVolume, startAt: ytPlayerStart, stopAt: ytPlayerStop, autoPlay: ytPlayerAutoPlay, realfullscreen: ytPlayerFullScreen, showYTLogo: ytPlayerLogo, showControls: ytPlayerControls }); if (!ytPlayerAutoPlay) { elem.find("#youtube-background-controls").addClass("video-is-playing"); } elem.on("YTPReady", function () { $("#youtube-background-controls").on("click", function () { if (!$(this).hasClass("video-is-playing")) { $(this).addClass("video-is-playing"); $ytPlayer.YTPPause(); } else { $(this).removeClass("video-is-playing"); $ytPlayer.YTPPlay(); } return false; }); var elemContainerHeight = elem.height(); if (ytPlayerAutoPause) { $window.on('scroll', function () { if ($window.scrollTop() > elemContainerHeight) { $("#youtube-background-controls").addClass("video-is-playing"); $ytPlayer.YTPPause(); } }); } }); }); } } //----------------------------------------------------/ // Mouse Scroll //----------------------------------------------------/ INSPIRO.mouseScroll = function () { if ($body.hasClass('mouse-scroll') && $window.width() > 767) { var $offset = 0; if ($header.hasClass('header-transparent')) { $offset = -$header.height() - 20; } $.scrollify({ section: "section", sectionName: "section-name", scrollSpeed: 1100, offset: $offset, scrollbars: true, }); } } //Window load functions $window.load(function () { INSPIRO.progressBar(), INSPIRO.pieChart(), INSPIRO.carouselInspiro(), INSPIRO.masonryIsotope(), INSPIRO.animations(), INSPIRO.menuFix() }); //Document ready functions $document.ready( INSPIRO.loader(), INSPIRO.responsiveClasses(), INSPIRO.mainMenu(), INSPIRO.stickyHeader(), INSPIRO.logoStatus(), INSPIRO.verticalDotMenu(), INSPIRO.mouseScroll(), INSPIRO.screenSizeControl(), INSPIRO.parallax(), INSPIRO.naTo(), INSPIRO.sidePanel(), INSPIRO.fullScreenPanel(), INSPIRO.textRotator(), INSPIRO.accordion(), INSPIRO.tabs(), INSPIRO.counters(), INSPIRO.countdownTimer(), INSPIRO.youTubeBgPlayer(), INSPIRO.maps(), INSPIRO.lightBoxInspiro(), INSPIRO.resposniveVideos(), INSPIRO.tooltip(), INSPIRO.popover(), INSPIRO.widget_twitter(), INSPIRO.flickr_widget(), INSPIRO.goToTop(), INSPIRO.topBar(), INSPIRO.inspiroSlider(), INSPIRO.sliderHeighControl() ); //Document resize functions $window.resize(function () { INSPIRO.logoStatus(), INSPIRO.screenSizeControl(), INSPIRO.sliderHeighControl(), INSPIRO.menuFix() }); //Document scrool functions $window.scroll(function () { INSPIRO.goToTop() }); })(jQuery);
import React, { Component } from "react"; export default class AdminContainer extends Component { render() { return ( <div> <h1>Admin Page.</h1> </div> ); } }
import { LitElement, html, css } from '../../web_modules/lit-element.js'; import '../components/Link.js'; import '../components/Carousel.js'; import '../components/Social.js'; import '../components/Quote.js'; class About extends LitElement { static get styles () { return css` img { border-radius: 50%; width: 72px; height: 72px; float: left; margin-right: 5px; } `; } render () { return html` <div> <img role="presentation" src="images/me-blur.jpg"> <div> My name is <span title="Ruh-juht Sai-guhl"><strong>Rajat Sehgal</strong></span>, I am a <strong>Software Engineering Manager</strong>, located in the <r-link text="Greater Boston"></r-link> area. I have been working at <r-link text="MathWorks"></r-link> for more than 9 years now. <br> Before that I was at <r-link text="University of Florida"></r-link>, where I completed my <strong>Masters</strong> in <strong>Computer Science</strong> while also working as a Software Developer at the <r-link text="Florida Museum of Natural History"></r-link>. I was born and brought up in <r-link text="New Delhi"></r-link>, India where I also earned my <strong>Bachelors</strong> in <strong>Computer Science</strong>. <br> When I am not at work and my wife is fast asleep, I enjoy working on some side <r-link text="projects"></r-link>. </div> <r-social></r-social> <r-carousel> <r-quote text="Rajat’s deep and growing knowledge of web UI technologies, coupled with his strong design skills make him a powerhouse developer. He is always working to further his knowledge and technique in these areas. As a result he is widely respected and consulted." author="Peter Muellers"></r-quote> <r-quote text="Rajat is a hardworking and detail driven individual who likes to deliver very modular and highly extensible code. He's Efficient in analyzing issues and deriving action items. He continually seeks solutions, not blame." author="Saoli Mitra"></r-quote> <r-quote text="Rajat is meticulous when it comes to starting a new piece of work. He evaluates and understands the problem statement with respect to use cases, before thinking about the design and implementation details." author="Deepak Anand"></r-quote> <r-quote text="I find Rajat to be very easy to work with, very responsive and willing when it comes to answering questions." author="Melissa DeVeau"></r-quote> <r-quote text="Rajat possesses excellent communication skills and has been very helpful in sharing his knowledge." author="Koundinya Surepeddi"></r-quote> <r-quote text="Rajat has a good command over the language and was able to point out a lot of good practices for writing clean code." author="Keerthi Gurijala"></r-quote> </r-carousel> </div> `; } } customElements.define('r-about', About);
import * as M from "@effectful/core"; function a() { var a = M.context(); a.$run = a_1; a.$cont = 4; return M.scope(); } function b() { var b = M.context(); b.$run = b_1; b.$err = b_err; b.$cont = 4; return M.scope(); } function c() { var c = M.context(); c.$run = c_1; c.$err = c_err; c.$fin = c_fin; c.$cont = 4; return M.scope(); } function d() { var d = M.context(); d.$run = d_1; d.$err = d_err; d.$fin = d_fin; d.$cont = 4; return M.scope(); } async function af1() { if (await a) await b; return await c; } function b2() { var b2 = M.context(); b2.$run = b2_1; b2.$err = b2_err; b2.$cont = 4; return M.scope(); } async function af2() { if (await a) await b; return await c; } function a_1(a, p) { switch (a.$cont) { case 4: a.$cont = 5; return M.yldStar(M.yld(1)); case 5: a.$cont = 6; return M.yldStar(M.yld(2)); case 6: return M.pure(); case 0: return M.pure(p); case 2: return M.$redir(p); default: throw new Error("invalid state"); } } function b_err(s) { switch (s) { case 5: return 8; default: return 1; } } function b_1(b, p) { var e; switch (b.$cont) { case 4: b.$cont = 5; return M.yldStar(M.yld(1)); case 5: b.$cont = 7; return M.yldStar(M.yld(2)); case 6: e = b._ex; b.$cont = 7; b._ex = null; return M.yldStar(M.yld(e)); case 7: return M.pure(); case 0: return M.pure(p); case 8: b.$cont = 6; b._ex = p; return M.jump(); case 2: return M.$redir(p); default: throw new Error("invalid state"); } } function c_err(s) { switch (s) { case 5: return 11; case 6: return 13; default: return 1; } } function c_fin(s) { switch (s) { case 5: case 6: return 12; default: return 0; } } function c_1(c, p) { var e; switch (c.$cont) { case 4: c.$cont = 5; return M.yldStar(M.yld(1)); case 5: c.$cont = 7; c._fc = 8; return M.yldStar(M.yld(2)); case 6: e = c._ex; c.$cont = 7; c._fc = 8, c._ex = null; return M.yldStar(M.yld(e)); case 7: c.$cont = c._fc; e = c._fc, c._fc = null; return M.yldStar(M.yld("F")); case 8: return M.pure(); case 0: return M.pure(p); case 9: c.$cont = 0; e = c._r, c._r = null; return M.jump(e); case 10: return M.raise(c._err1); case 11: c.$cont = 6; c._ex = p; return M.jump(); case 12: c.$cont = 7; c._fc = 9, c._r = p; return M.jump(); case 13: c.$cont = 7; c._fc = 10, c._err1 = p; return M.jump(); case 2: return M.$redir(p); default: throw new Error("invalid state"); } } function d_err(s) { switch (s) { case 5: case 6: return 11; default: return 1; } } function d_fin(s) { switch (s) { case 5: case 6: return 12; default: return 0; } } function d_1(d, p) { var a; switch (d.$cont) { case 4: d._loop = M.iterator(s); d.$cont = 5; return M.jump(); case 5: if (!(d._loop = d._loop.step()).done) { d._i = d._loop.value; d.$cont = 6; return M.yldStar(M.yldStar([d._i])); } else { d.$cont = 7; d._fc = 8, d._i = null; return M.jump(); } case 6: d.$cont = 5; return M.yldStar(M.yld(d._i)); case 7: if (d._loop.exit) { d._loop.exit(); } d.$cont = d._fc; a = d._fc, d._loop = null, d._fc = null; return M.jump(); case 8: return M.pure(); case 0: return M.pure(p); case 9: d.$cont = 0; a = d._r, d._r = null; return M.jump(a); case 10: return M.raise(d._err1); case 11: d.$cont = 7; d._fc = 10, d._err1 = p; return M.jump(); case 12: d.$cont = 7; d._fc = 9, d._r = p; return M.jump(); case 2: return M.$redir(p); default: throw new Error("invalid state"); } } function b2_err(s) { switch (s) { case 5: return 8; default: return 1; } } function b2_1(b2, p) { var e; switch (b2.$cont) { case 4: b2.$cont = 5; return M.yldStar(M.yld(1)); case 5: b2.$cont = 7; return M.yldStar(M.yld(2)); case 6: e = b2._ex; b2.$cont = 7; b2._ex = null; return M.yldStar(M.yld(e)); case 7: return M.pure(); case 0: return M.pure(p); case 8: b2.$cont = 6; b2._ex = p; return M.jump(); case 2: return M.$redir(p); default: throw new Error("invalid state"); } }
import React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import formControlState from '../FormControl/formControlState'; import withFormControlContext from '../FormControl/withFormControlContext'; import withStyles from '../styles/withStyles'; import FormLabel from '../FormLabel'; export const styles = theme => ({ /* Styles applied to the root element. */ root: { display: 'block', transformOrigin: 'top left', }, /* Styles applied to the root element if `focused={true}`. */ focused: {}, /* Styles applied to the root element if `disabled={true}`. */ disabled: {}, /* Styles applied to the root element if `error={true}`. */ error: {}, /* Styles applied to the root element if `required={true}`. */ required: {}, /* Styles applied to the asterisk element. */ asterisk: {}, /* Styles applied to the root element if the component is a descendant of `FormControl`. */ formControl: { position: 'absolute', left: 0, top: 0, // slight alteration to spec spacing to match visual spec result transform: 'translate(0, 24px) scale(1)', }, /* Styles applied to the root element if `margin="dense"`. */ marginDense: { // Compensation for the `Input.inputDense` style. transform: 'translate(0, 21px) scale(1)', }, /* Styles applied to the `input` element if `shrink={true}`. */ shrink: { transform: 'translate(0, 1.5px) scale(0.75)', transformOrigin: 'top left', }, /* Styles applied to the `input` element if `disableAnimation={false}`. */ animated: { transition: theme.transitions.create(['color', 'transform'], { duration: theme.transitions.duration.shorter, easing: theme.transitions.easing.easeOut, }), }, /* Styles applied to the root element if `variant="filled"`. */ filled: { // Chrome's autofill feature gives the input field a yellow background. // Since the input field is behind the label in the HTML tree, // the input field is drawn last and hides the label with an opaque background color. // zIndex: 1 will raise the label above opaque background-colors of input. zIndex: 1, pointerEvents: 'none', transform: 'translate(12px, 20px) scale(1)', '&$marginDense': { transform: 'translate(12px, 17px) scale(1)', }, '&$shrink': { transform: 'translate(12px, 10px) scale(0.75)', '&$marginDense': { transform: 'translate(12px, 7px) scale(0.75)', }, }, }, /* Styles applied to the root element if `variant="outlined"`. */ outlined: { // see comment above on filled.zIndex zIndex: 1, pointerEvents: 'none', transform: 'translate(14px, 20px) scale(1)', '&$marginDense': { transform: 'translate(14px, 17px) scale(1)', }, '&$shrink': { transform: 'translate(14px, -6px) scale(0.75)', }, }, }); const InputLabel = React.forwardRef(function InputLabel(props, ref) { const { classes, className, disableAnimation = false, margin, muiFormControl, shrink: shrinkProp, variant, ...other } = props; let shrink = shrinkProp; if (typeof shrink === 'undefined' && muiFormControl) { shrink = muiFormControl.filled || muiFormControl.focused || muiFormControl.adornedStart; } const fcs = formControlState({ props, muiFormControl, states: ['margin', 'variant'], }); return ( <FormLabel data-shrink={shrink} className={clsx( classes.root, { [classes.formControl]: muiFormControl, [classes.animated]: !disableAnimation, [classes.shrink]: shrink, [classes.marginDense]: fcs.margin === 'dense', [classes.filled]: fcs.variant === 'filled', [classes.outlined]: fcs.variant === 'outlined', }, className, )} classes={{ focused: classes.focused, disabled: classes.disabled, error: classes.error, required: classes.required, asterisk: classes.asterisk, }} ref={ref} {...other} /> ); }); InputLabel.propTypes = { /** * The contents of the `InputLabel`. */ children: PropTypes.node, /** * Override or extend the styles applied to the component. * See [CSS API](#css) below for more details. */ classes: PropTypes.object.isRequired, /** * @ignore */ className: PropTypes.string, /** * If `true`, the transition animation is disabled. */ disableAnimation: PropTypes.bool, /** * If `true`, apply disabled class. */ disabled: PropTypes.bool, /** * If `true`, the label will be displayed in an error state. */ error: PropTypes.bool, /** * If `true`, the input of this label is focused. */ focused: PropTypes.bool, /** * If `dense`, will adjust vertical spacing. This is normally obtained via context from * FormControl. */ margin: PropTypes.oneOf(['dense']), /** * @ignore */ muiFormControl: PropTypes.object, /** * if `true`, the label will indicate that the input is required. */ required: PropTypes.bool, /** * If `true`, the label is shrunk. */ shrink: PropTypes.bool, /** * The variant to use. */ variant: PropTypes.oneOf(['standard', 'outlined', 'filled']), }; export default withStyles(styles, { name: 'MuiInputLabel' })(withFormControlContext(InputLabel));
define([ 'jquery', "../utils/constants", '../core/SPServices.utils', //--------------------------- // We don't need local variables for these dependencies // because they are added to the jQuery namespace. '../core/SPServices.core' ], function ( $, constants, utils ) { "use strict"; // Function which provides a link on a Lookup column for the user to follow // which allows them to add a new value to the Lookup list. // Based on http://blog.mastykarz.nl/extending-lookup-fields-add-new-item-option/ // by Waldek Mastykarz $.fn.SPServices.SPLookupAddNew = function (options) { var opt = $.extend({}, { lookupColumn: "", // The display name of the Lookup column promptText: "Add new {0}", // Text to use as prompt + column name newWindow: false, // If true, the link will open in a new window *without* passing the Source. ContentTypeID: "", // [Optional] Pass the ContentTypeID if you'd like to specify it completefunc: null, // Function to call on completion of rendering the change. debug: false // If true, show error messages;if false, run silent }, options); var thisFunction = "SPServices.SPLookupAddNew"; // Find the lookup column's select (dropdown) var lookupSelect = $().SPServices.SPDropdownCtl({ displayName: opt.lookupColumn }); if (lookupSelect.Obj.html() === null && opt.debug) { utils.errBox(thisFunction, "lookupColumn: " + opt.lookupColumn, constants.TXTColumnNotFound); return; } var newUrl = ""; var lookupListUrl = ""; var lookupColumnStaticName = ""; // Use GetList for the current list to determine the details for the Lookup column $().SPServices({ operation: "GetList", async: false, cacheXML: true, listName: $().SPServices.SPListNameFromUrl(), completefunc: function (xData) { $(xData.responseXML).find("Field[DisplayName='" + opt.lookupColumn + "']").each(function () { lookupColumnStaticName = $(this).attr("StaticName"); // Use GetList for the Lookup column's list to determine the list's URL $().SPServices({ operation: "GetList", async: false, cacheXML: true, listName: $(this).attr("List"), completefunc: function (xData) { $(xData.responseXML).find("List").each(function () { lookupListUrl = $(this).attr("WebFullUrl"); // Need to handle when list is in the root site lookupListUrl = lookupListUrl !== constants.SLASH ? lookupListUrl + constants.SLASH : lookupListUrl; }); } }); // Get the NewItem form for the Lookup column's list newUrl = utils.getListFormUrl($(this).attr("List"), "NewForm"); // Stop looking;we're done return false; }); } }); if (lookupListUrl.length === 0 && opt.debug) { utils.errBox(thisFunction, "lookupColumn: " + opt.lookupColumn, "This column does not appear to be a lookup column"); return; } if (newUrl.length > 0) { // Build the link to the Lookup column's list enclosed in a div with the id="SPLookupAddNew_" + lookupColumnStaticName var newHref = lookupListUrl + newUrl; // If requested, open the link in a new window and if requested, pass the ContentTypeID newHref += opt.newWindow ? ((opt.ContentTypeID.length > 0) ? "?ContentTypeID=" + opt.ContentTypeID : "") + "' target='_blank'" : "?" + ((opt.ContentTypeID.length > 0) ? "ContentTypeID=" + opt.ContentTypeID + "&" : "") + "Source=" + utils.escapeUrl(location.href) + "'"; var newLink = "<div id='SPLookupAddNew_" + lookupColumnStaticName + "'>" + "<a href='" + newHref + ">" + opt.promptText.replace(/\{0\}/g, opt.lookupColumn) + "</a></div>"; // Append the link to the Lookup columns's formbody table cell $(lookupSelect.Obj).parents("td.ms-formbody").append(newLink); } else if (opt.debug) { utils.errBox(thisFunction, "lookupColumn: " + opt.lookupColumn, "NewForm cannot be found"); return; } // If present, call completefunc when all else is done if (opt.completefunc !== null) { opt.completefunc(); } }; // End $.fn.SPServices.SPLookupAddNew return $; });
const fs = require('fs'); /** * Thanks to @williammustaffa for this compiler. * Original src: https://github.com/williammustaffa/jGame.js/blob/master/compile.js * */ // Project src const srcDir = './app/assets/javascript' const entryPoint = `${srcDir}/main.js`; // regex to serach @include('file'); declarations const searchRegex = /include\((\'|\")[^\)]*(\'|\")\)/; function jsCompiler() { // Parse entry point let content = parseInclude(entryPoint); // write the parsed/replaced content into a single file fs.writeFileSync('./app/assets/javascript/bundle/mobifycloud.js', content); console.log('JS assets compiled into -> app/assets/javascript/mobifycloud.js'); } /** * Replaces all @include('file') declarations with file content * * @param {String} file src * @returns {String} File content with 'includes' content */ function parseInclude(src) { let content = fs.readFileSync(src, 'utf8'); // verify all include declarations and replace with file content while((searchResult = searchRegex.exec(content))) { content = content.replace(';', ''); let includeDeclaration = searchResult[0]; // get included file path let includePath = getPath(includeDeclaration); // parse include declaration content let includeContent = parseInclude(includePath); // replace include with file content content = content.replace(includeDeclaration, includeContent); } return content; } /** * Retrive the include declaration file path * * @param {String} include declaration like @include('test.js') * @returns {String} path */ function getPath(include) { return `${srcDir}/${include.replace(/include\((\'|\")|(\'|\")\)/g, '')}`; } function insertFileInfo(src, content) { let prefix = `/* >> ${src} START */`, sufix = `/* << ${src} END */`; return prefix + '\n' + content + '\n' + sufix; } module.exports = jsCompiler;
/* Selectator jQuery Plugin A plugin for select elements version 1.0, Dec 10th, 2013 by Ingi P. Jacobsen The MIT License (MIT) Copyright (c) 2013 Faroe Media 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. */ (function($) { $.selectator = function (element, options) { var defaults = { prefix: 'selectator_', height: 'auto', useDimmer: false, showAllOptionsOnFocus: false, selectFirstOptionOnSearch: true, searchCallback: function(){}, labels: { search: 'Search...' } }; var plugin = this; plugin.settings = {}; var multiple = $(element).attr('multiple') !== undefined; var selected_index = multiple ? -1 : 0; var box_element = null; var chosenitems_element = null; var input_element = null; var textlength_element = null; var options_element = null; var key = { backspace: 8, enter: 13, escape: 27, left: 37, up: 38, right: 39, down: 40 }; // INITIALIZE PLUGIN plugin.init = function () { plugin.settings = $.extend({}, defaults, options); //// ================== CREATE ELEMENTS ================== //// // dimmer if (plugin.settings.useDimmer) { if ($('#' + plugin.settings.prefix + 'dimmer').length === 0) { var dimmer_element = document.createElement('div'); $(dimmer_element).attr('id', plugin.settings.prefix + 'dimmer'); $(dimmer_element).hide(); $(document.body).prepend(dimmer_element); } } // box element box_element = document.createElement('div'); if (element.id !== undefined) { $(box_element).attr('id', plugin.settings.prefix + element.id); } $(box_element).addClass('selectator ' + (multiple ? 'multiple ' : 'single ') + 'options-hidden'); $(box_element).css({ width: $(element).css('width'), padding: $(element).css('padding'), position: 'relative' }); if (plugin.settings.height === 'element') { $(box_element).css({ height: $(element).outerHeight() + 'px' }); } $(element).after(box_element); $(element).hide(); // textlength element textlength_element = document.createElement('span'); $(textlength_element).addClass(plugin.settings.prefix + 'textlength'); $(textlength_element).css({ position: 'absolute', visibility: 'hidden' }); $(box_element).append(textlength_element); // chosen items element chosenitems_element = document.createElement('div'); $(chosenitems_element).addClass(plugin.settings.prefix + 'chosen_items'); $(box_element).append(chosenitems_element); // input element input_element = document.createElement('input'); $(input_element).addClass(plugin.settings.prefix + 'input'); if (!multiple) { $(input_element).attr('placeholder', plugin.settings.labels.search); $(input_element).css('width', 'calc(100% - 30px)'); } else { $(input_element).width(20); } $(input_element).attr('autocomplete', 'false'); $(box_element).append(input_element); // options element options_element = document.createElement('ul'); $(options_element).addClass(plugin.settings.prefix + 'options'); $(box_element).append(options_element); //// ================== BIND ELEMENTS EVENTS ================== //// // source element $(element).change(function () { refreshSelectedOptions(); }); // box element $(box_element).bind('focus', function (e) { e.preventDefault(); e.stopPropagation(); showOptions(); $(input_element).focus(); }); $(box_element).bind('mousedown', function (e) { e.preventDefault(); e.stopPropagation(); input_element.focus(); if (input_element.setSelectionRange) { input_element.focus(); input_element.setSelectionRange(input_element.value.length, input_element.value.length); } else if (input_element.createTextRange) { var range = input_element.createTextRange(); range.collapse(true); range.moveEnd('character', input_element.value.length); range.moveStart('character', input_element.value.length); range.select(); } }); $(box_element).bind('mouseup', function (e) { e.preventDefault(); e.stopPropagation(); }); $(box_element).bind('click', function (e) { e.preventDefault(); e.stopPropagation(); if (!multiple || plugin.settings.showAllOptionsOnFocus) { //showOptions(); search(); } input_element.focus(); }); $(box_element).bind('dblclick', function (e) { e.preventDefault(); e.stopPropagation(); input_element.focus(); input_element.select(); }); // input element $(input_element).bind('click', function (e) { e.preventDefault(); e.stopPropagation(); }); $(input_element).bind('dblclick', function (e) { e.preventDefault(); e.stopPropagation(); }); $(input_element).bind('keydown', function (e) { e.stopPropagation(); var keyCode = e.keyCode || e.which; switch (keyCode) { case key.up: e.preventDefault(); if (selected_index > (multiple ? -1 : 0)) { selected_index = selected_index - 1; } else { selected_index = $(options_element).find('.' + plugin.settings.prefix + 'option').length - 1; } refreshActiveOption(); scrollToActiveOption(); break; case key.down: e.preventDefault(); if (selected_index < $(options_element).find('.' + plugin.settings.prefix + 'option').length - 1) { selected_index = selected_index + 1; } else { selected_index = (multiple ? -1 : 0); } refreshActiveOption(); scrollToActiveOption(); break; case key.escape: e.preventDefault(); break; case key.enter: e.preventDefault(); if (selected_index !== -1) { selectOption(); } else { if ($(input_element).val() !== '') { plugin.settings.searchCallback(); } } resizeInput(); break; case key.backspace: if (input_element.value === '') { $(element).find('option:selected').last()[0].selected = false; $(element).trigger('change'); refreshSelectedOptions(); search(); } resizeInput(); break; default: resizeInput(); break; } }); $(input_element).bind('keyup', function (e) { e.preventDefault(); e.stopPropagation(); var keyCode = e.keyCode || e.which; if (keyCode === key.escape || keyCode === key.enter) { hideOptions(); } else if (keyCode < 37 || keyCode > 40) { search(); } if ($(box_element).hasClass('options-hidden') && (keyCode === key.left || keyCode === key.right || keyCode === key.up || keyCode === key.down)) { search(); } resizeInput(); }); $(input_element).bind('focus', function (e) { e.preventDefault(); e.stopPropagation(); if (!$(options_element).is(':empty') || !multiple || plugin.settings.showAllOptionsOnFocus) { search(); showOptions(); } }); $(input_element).bind('blur', function (e) { e.preventDefault(); e.stopPropagation(); hideOptions(); }); refreshSelectedOptions(); }; // RESIZE INPUT var resizeInput = function () { textlength_element.innerHTML = input_element.value; if (multiple) { $(input_element).css({ width: ($(textlength_element).width() + 20) + 'px' }); } }; // REFRESH SELECTED OPTIONS plugin.refresh = function () { refreshSelectedOptions(); }; var refreshSelectedOptions = function () { $(chosenitems_element).empty(); $(element).find('option').each(function () { if (this.selected) { var item_element = document.createElement('div'); $(item_element).addClass(plugin.settings.prefix + 'chosen_item'); //$(item_element).html($(this).html()); // left if ($(this).data('left') !== undefined) { var left_element = document.createElement('div'); $(left_element).addClass(plugin.settings.prefix + 'chosen_item_left').html($(this).attr('data-left')); $(item_element).append(left_element); } // right if ($(this).data('right') !== undefined) { var right_element = document.createElement('div'); $(right_element).addClass(plugin.settings.prefix + 'chosen_item_right').html($(this).attr('data-right')); $(item_element).append(right_element); } // title var title_element = document.createElement('div'); $(title_element).addClass(plugin.settings.prefix + 'chosen_item_title').html($(this).html()); $(item_element).append(title_element); // subtitle if ($(this).data('subtitle') !== undefined) { var subtitle_element = document.createElement('div'); $(subtitle_element).addClass(plugin.settings.prefix + 'chosen_item_subtitle').html($(this).attr('data-subtitle')); $(item_element).append(subtitle_element); } // remove button var button_remove_element = document.createElement('div'); $(button_remove_element).data('element', this); $(button_remove_element).addClass(plugin.settings.prefix + 'chosen_item_remove'); $(button_remove_element).bind('mousedown', function (e) { e.preventDefault(); e.stopPropagation(); }); $(button_remove_element).bind('mouseup', function (e) { e.preventDefault(); e.stopPropagation(); $(this).data('element').selected = false; $(element).trigger('change'); refreshSelectedOptions(); }); $(button_remove_element).html('X'); $(item_element).append(button_remove_element); // clear var clear_element = document.createElement('div'); clear_element.style.clear = 'both'; $(item_element).append(clear_element); $(chosenitems_element).append(item_element); } }); search(); }; // OPTIONS SEARCH METHOD var search = function () { if (multiple) { selected_index = plugin.settings.selectFirstOptionOnSearch ? (input_element.value.replace(/\s/g, '') !== '' ? 0 : -1) : -1; } $(options_element).empty(); if (input_element.value.replace(/\s/g, '') !== '' || !multiple || plugin.settings.showAllOptionsOnFocus) { var optionsArray = []; $(element).children().each(function () { if ($(this).prop('tagName').toLowerCase() === 'optgroup') { var group = this; if ($(group).children('option').length !== 0) { var hasMatches = false; $(group).children('option').each(function () { if ((!this.selected || !multiple) && $(this).html().toLowerCase().indexOf(input_element.value.toLowerCase()) !== -1) { hasMatches = true; } }); if (hasMatches) { var groupOptionsArray = []; $(group).children('option').each(function () { if ((!this.selected || !multiple) && $(this).html().toLowerCase().indexOf(input_element.value.toLowerCase()) !== -1) { groupOptionsArray.push({ type: 'option', text: $(this).html(), element: this }); } }); optionsArray.push({ type: 'group', text: $(group).attr('label'), options: groupOptionsArray, element: group }); } } } else { if ($(this).html().toLowerCase().indexOf(input_element.value.toLowerCase()) !== -1) { if (!this.selected || !multiple) { optionsArray.push({ type: 'option', text: $(this).html(), element: this }); } } } }); generateOptions(optionsArray); } if ($(input_element).is(':focus')) { if (!$(options_element).is(':empty') || !multiple) { showOptions(); } else { hideOptions(); } } else { hideOptions(); } }; // GENERATE OPTIONS var generateOptions = function (optionsArray) { var index = -1; $(optionsArray).each(function () { if (this.type === 'group') { var group_header_element = document.createElement('li'); $(group_header_element).addClass(plugin.settings.prefix + 'group_header'); $(group_header_element).html($(this.element).attr('label')); $(options_element).append(group_header_element); var group = document.createElement('ul'); $(group).addClass(plugin.settings.prefix + 'group'); $(options_element).append(group); $(this.options).each(function () { index++; var option = createOption.call(this.element, index); $(group).append(option); }); $(options_element).append(group); } else { index++; var option = createOption.call(this.element, index); $(options_element).append(option); } }); if (multiple) { refreshActiveOption(); } }; // CREATE RESULT OPTION var createOption = function (index) { // holder li var option = document.createElement('li'); $(option).data('index', index); $(option).data('element', this); $(option).addClass(plugin.settings.prefix + 'option'); if (this.selected) { $(option).addClass('active'); } // left if ($(this).data('left') !== undefined) { var left_element = document.createElement('div'); $(left_element).addClass(plugin.settings.prefix + 'option_left').html($(this).attr('data-left')); $(option).append(left_element); } // right if ($(this).data('right') !== undefined) { var right_element = document.createElement('div'); $(right_element).addClass(plugin.settings.prefix + 'option_right').html($(this).attr('data-right')); $(option).append(right_element); } // title var title_element = document.createElement('div'); $(title_element).addClass(plugin.settings.prefix + 'option_title').html($(this).html()); $(option).append(title_element); // subtitle if ($(this).data('subtitle') !== undefined) { var subtitle_element = document.createElement('div'); $(subtitle_element).addClass(plugin.settings.prefix + 'option_subtitle').html($(this).attr('data-subtitle')); $(option).append(subtitle_element); } // clear var clear_element = document.createElement('div'); clear_element.style.clear = 'both'; $(option).append(clear_element); // BIND EVENTS $(option).bind('mouseover', function (e) { e.stopPropagation(); e.preventDefault(); selected_index = index; refreshActiveOption(); }); $(option).bind('mousedown', function (e) { e.stopPropagation(); e.preventDefault(); }); $(option).bind('click', function (e) { e.preventDefault(); e.stopPropagation(); selectOption(); }); return option; }; // SHOW OPTIONS AND DIMMER var showOptions = function () { $(box_element).removeClass('options-hidden').addClass('options-visible'); if (plugin.settings.useDimmer) { $('#' + plugin.settings.prefix + 'dimmer').show(); } setTimeout(function () { $(options_element).css('top', ($(box_element).outerHeight()-2) + 'px'); }, 1); if ($(box_element).hasClass('single')) { selected_index = $(options_element).find('.' + plugin.settings.prefix + 'option').index($(options_element).find('.' + plugin.settings.prefix + 'option.active')); } scrollToActiveOption(); }; // HIDE OPTIONS AND DIMMER var hideOptions = function () { $(box_element).removeClass('options-visible').addClass('options-hidden'); if (plugin.settings.useDimmer) { $('#' + plugin.settings.prefix + 'dimmer').hide(); } }; // REFRESH ACTIVE IN OPTIONS METHOD var refreshActiveOption = function () { $(options_element).find('.active').removeClass('active'); if (selected_index !== -1) { $(options_element).find('.' + plugin.settings.prefix + 'option').eq(selected_index).addClass('active'); } }; // SCROLL TO ACTIVE OPTION IN OPTIONS LIST var scrollToActiveOption = function () { var $active_element = $(options_element).find('.' + plugin.settings.prefix + 'option.active'); if ($active_element.length > 0) { $(options_element).scrollTop($(options_element).scrollTop() + $active_element.position().top - $(options_element).height()/2 + $active_element.height()/2); } }; // SELECT ACTIVE OPTION var selectOption = function () { $(options_element).find('.' + plugin.settings.prefix + 'option').eq(selected_index).data('element').selected = true; $(element).trigger('change'); refreshSelectedOptions(); $(input_element).val(''); box_element.focus(); hideOptions(); }; // REMOVE PLUGIN AND REVERT SELECT ELEMENT TO ORIGINAL STATE plugin.destroy = function () { $(box_element).remove(); $.removeData(element, 'selectator'); $(element).show(); if ($('.selectator').length === 0) { $('#' + plugin.settings.prefix + 'dimmer').remove(); } }; // Initialize plugin plugin.init(); }; $.fn.selectator = function(options) { options = options !== undefined ? options : {}; return this.each(function () { if (typeof(options) === 'object') { if (undefined === $(this).data('selectator')) { var plugin = new $.selectator(this, options); $(this).data('selectator', plugin); } } else if ($(this).data('selectator')[options]) { $(this).data('selectator')[options].apply(this, Array.prototype.slice.call(arguments, 1)); } else { $.error('Method ' + options + ' does not exist in $.selectator'); } }); }; }(jQuery));
import React from "react"; import Tile from "./tile"; export default class Index extends React.Component { render() { const data = this.props.data, tileNodes = data.map( (data) => { return ( <Tile show={this.props.show} data={data} /> ); }); return ( <div className="container"> <main className="tile-container"> {tileNodes} </main> </div> ); } }
/*! * Accordion v3.1.1 * Simple accordion created in pure Javascript. * https://github.com/michu2k/Accordion * * Copyright (c) Michał Strumpf * Published under MIT License */ (function(window) { 'use strict'; let uniqueId = 0; /** * Core * @param {string|HTMLElement} selectorOrElement = container in which the script will be initialized * @param {object} userOptions = options defined by user */ const Accordion = function(selectorOrElement, userOptions) { const _this = this; let eventsAttached = false; // Break the array with the selectors if (Array.isArray(selectorOrElement)) { if (selectorOrElement.length) { return selectorOrElement.map((single) => new Accordion(single, userOptions)); } return false; } const core = { /** * Init accordion */ init() { const defaults = { duration: 600, // animation duration in ms {number} ariaEnabled: true, // add ARIA elements to the HTML structure {boolean} collapse: true, // allow collapse expanded panel {boolean} showMultiple: false, // show multiple elements at the same time {boolean} openOnInit: [], // show accordion elements during initialization {array} elementClass: 'ac', // element class {string} triggerClass: 'ac-trigger', // trigger class {string} panelClass: 'ac-panel', // panel class {string} activeClass: 'is-active', // active element class {string} beforeOpen: () => {}, // calls before the item is opened {function} onOpen: () => {}, // calls when the item is opened {function} beforeClose: () => {}, // calls before the item is closed {function} onClose: () => {} // calls when the item is closed {function} }; // Extend default options this.options = Object.assign(defaults, userOptions); const { elementClass, openOnInit } = this.options; const isString = (typeof selectorOrElement === 'string'); this.container = isString ? document.querySelector(selectorOrElement) : selectorOrElement; this.elements = Array.from(this.container.childNodes) .filter((el) => el.classList && el.classList.contains(elementClass)); this.firstElement = this.elements[0]; this.lastElement = this.elements[this.elements.length - 1]; this.currFocusedIdx = 0; this.elements.map((element, idx) => { // When JS is enabled, add the class to the element element.classList.add('js-enabled'); this.generateIDs(element); this.setARIA(element); this.setTransition(element); uniqueId++; return openOnInit.includes(idx) ? this.showElement(element, false) : this.closeElement(element, false); }); _this.attachEvents(); }, /** * Set transition * @param {object} element = accordion item * @param {boolean} clear = clear transition duration */ setTransition(element, clear = false) { const { duration, panelClass } = this.options; const el = element.querySelector(`.${panelClass}`); const transition = isWebkit('transitionDuration'); el.style[transition] = clear ? null : `${duration}ms`; }, /** * Generate unique IDs for each element * @param {object} element = accordion item */ generateIDs(element) { const { triggerClass, panelClass } = this.options; const trigger = element.querySelector(`.${triggerClass}`); const panel = element.querySelector(`.${panelClass}`); element.setAttribute('id', `ac-${uniqueId}`); trigger.setAttribute('id', `ac-trigger-${uniqueId}`); panel.setAttribute('id', `ac-panel-${uniqueId}`); }, /** * Remove IDs * @param {object} element = accordion item */ removeIDs(element) { const { triggerClass, panelClass } = this.options; const trigger = element.querySelector(`.${triggerClass}`); const panel = element.querySelector(`.${panelClass}`); element.removeAttribute('id'); trigger.removeAttribute('id'); panel.removeAttribute('id'); }, /** * Create ARIA * @param {object} element = accordion item */ setARIA(element) { const { ariaEnabled, triggerClass, panelClass } = this.options; if (!ariaEnabled) return; const trigger = element.querySelector(`.${triggerClass}`); const panel = element.querySelector(`.${panelClass}`); trigger.setAttribute('role', 'button'); trigger.setAttribute('aria-controls', `ac-panel-${uniqueId}`); trigger.setAttribute('aria-disabled', false); trigger.setAttribute('aria-expanded', false); panel.setAttribute('role', 'region'); panel.setAttribute('aria-labelledby', `ac-trigger-${uniqueId}`); }, /** * Update ARIA * @param {object} element = accordion item * @param {boolean} ariaExpanded = value of the attribute */ updateARIA(element, { ariaExpanded, ariaDisabled }) { const { ariaEnabled, triggerClass } = this.options; if (!ariaEnabled) return; const trigger = element.querySelector(`.${triggerClass}`); trigger.setAttribute('aria-expanded', ariaExpanded); trigger.setAttribute('aria-disabled', ariaDisabled); }, /** * Remove ARIA * @param {object} element = accordion item */ removeARIA(element) { const { ariaEnabled, triggerClass, panelClass } = this.options; if (!ariaEnabled) return; const trigger = element.querySelector(`.${triggerClass}`); const panel = element.querySelector(`.${panelClass}`); trigger.removeAttribute('role'); trigger.removeAttribute('aria-controls'); trigger.removeAttribute('aria-disabled'); trigger.removeAttribute('aria-expanded'); panel.removeAttribute('role'); panel.removeAttribute('aria-labelledby'); }, /** * Focus element * @param {object} e = event * @param {object} element = accordion item */ focus(e, element) { e.preventDefault(); const { triggerClass } = this.options; const trigger = element.querySelector(`.${triggerClass}`); trigger.focus(); }, /** * Focus first element * @param {object} e = event */ focusFirstElement(e) { this.focus(e, this.firstElement); this.currFocusedIdx = 0; }, /** * Focus last element * @param {object} e = event */ focusLastElement(e) { this.focus(e, this.lastElement); this.currFocusedIdx = this.elements.length - 1; }, /** * Focus next element * @param {object} e = event */ focusNextElement(e) { const nextElIdx = this.currFocusedIdx + 1; if (nextElIdx > this.elements.length - 1) return this.focusFirstElement(e); this.focus(e, this.elements[nextElIdx]); this.currFocusedIdx = nextElIdx; }, /** * Focus previous element * @param {object} e = event */ focusPrevElement(e) { const prevElIdx = this.currFocusedIdx - 1; if (prevElIdx < 0) return this.focusLastElement(e); this.focus(e, this.elements[prevElIdx]); this.currFocusedIdx = prevElIdx; }, /** * Show element * @param {object} element = accordion item * @param {boolean} calcHeight = calculate the height of the panel */ showElement(element, calcHeight = true) { const { panelClass, activeClass, collapse, beforeOpen } = this.options; const panel = element.querySelector(`.${panelClass}`); const height = panel.scrollHeight; element.classList.add(activeClass); if (calcHeight) beforeOpen(element); requestAnimationFrame(() => { requestAnimationFrame(() => { panel.style.height = calcHeight ? `${height}px` : 'auto'; }); }); this.updateARIA(element, { ariaExpanded: true, ariaDisabled: collapse ? false : true }); }, /** * Close element * @param {object} element = accordion item * @param {boolean} calcHeight = calculate the height of the panel */ closeElement(element, calcHeight = true) { const { panelClass, activeClass, beforeClose } = this.options; const panel = element.querySelector(`.${panelClass}`); const height = panel.scrollHeight; element.classList.remove(activeClass); if (calcHeight) { beforeClose(element); // Animation [X]px => 0 requestAnimationFrame(() => { panel.style.height = `${height}px`; requestAnimationFrame(() => { panel.style.height = 0; }); }); this.updateARIA(element, { ariaExpanded: false, ariaDisabled: false }); } else { // Hide element without animation 'auto' => 0 panel.style.height = 0; } }, /** * Toggle element * @param {object} element = accordion item */ toggleElement(element) { const { activeClass, collapse } = this.options; const isActive = element.classList.contains(activeClass); if (isActive && !collapse) return; return isActive ? this.closeElement(element) : this.showElement(element); }, /** * Close all elements without the current element */ closeElements() { const { activeClass, showMultiple } = this.options; if (showMultiple) return; this.elements.map((element, idx) => { const isActive = element.classList.contains(activeClass); if (isActive && idx != this.currFocusedIdx) { this.closeElement(element); } }); }, /** * Handle click * @param {object} e = event */ handleClick(e) { const target = e.currentTarget; this.elements.map((element, idx) => { if (element.contains(target) && e.target.nodeName !== 'A') { this.currFocusedIdx = idx; this.closeElements(); this.focus(e, element); this.toggleElement(element); } }); }, /** * Handle keydown * @param {object} e = event */ handleKeydown(e) { const KEYS = { ARROW_UP: 38, ARROW_DOWN: 40, HOME: 36, END: 35 }; switch (e.keyCode) { case KEYS.ARROW_UP: return this.focusPrevElement(e); case KEYS.ARROW_DOWN: return this.focusNextElement(e); case KEYS.HOME: return this.focusFirstElement(e); case KEYS.END: return this.focusLastElement(e); default: return null; } }, /** * Handle transitionend * @param {object} e = event */ handleTransitionEnd(e) { if (e.propertyName !== 'height') return; const { onOpen, onClose } = this.options; const panel = e.currentTarget; const height = parseInt(panel.style.height); const element = this.elements.find((element) => element.contains(panel)); if (height > 0) { panel.style.height = 'auto'; onOpen(element); } else { onClose(element); } } }; /** * Attach events */ this.attachEvents = () => { if (eventsAttached) return; const { triggerClass, panelClass } = core.options; core.handleClick = core.handleClick.bind(core); core.handleKeydown = core.handleKeydown.bind(core); core.handleTransitionEnd = core.handleTransitionEnd.bind(core); core.elements.map((element) => { const trigger = element.querySelector(`.${triggerClass}`); const panel = element.querySelector(`.${panelClass}`); trigger.addEventListener('click', core.handleClick); trigger.addEventListener('keydown', core.handleKeydown); panel.addEventListener('webkitTransitionEnd', core.handleTransitionEnd); panel.addEventListener('transitionend', core.handleTransitionEnd); }); eventsAttached = true; }; /** * Detach events */ this.detachEvents = () => { if (!eventsAttached) return; const { triggerClass, panelClass } = core.options; core.elements.map((element) => { const trigger = element.querySelector(`.${triggerClass}`); const panel = element.querySelector(`.${panelClass}`); trigger.removeEventListener('click', core.handleClick); trigger.removeEventListener('keydown', core.handleKeydown); panel.removeEventListener('webkitTransitionEnd', core.handleTransitionEnd); panel.removeEventListener('transitionend', core.handleTransitionEnd); }); eventsAttached = false; }; /** * Toggle accordion element * @param {number} elIdx = element index */ this.toggle = (elIdx) => { const el = core.elements.find((_, idx) => idx === elIdx); if (el) core.toggleElement(el); }; /** * Open accordion element * @param {number} elIdx = element index */ this.open = (elIdx) => { const el = core.elements.find((_, idx) => idx === elIdx); if (el) core.showElement(el); }; /** * Open all accordion elements */ this.openAll = () => { core.elements.map((element) => core.showElement(element, false)); }; /** * Close accordion element * @param {number} elIdx = element index */ this.close = (elIdx) => { const el = core.elements.find((_, idx) => idx === elIdx); if (el) core.closeElement(el); }; /** * Close all accordion elements */ this.closeAll = () => { core.elements.map((element) => core.closeElement(element, false)); }; /** * Destroy accordion instance */ this.destroy = () => { this.detachEvents(); this.openAll(); core.elements.map((element) => { core.removeIDs(element); core.removeARIA(element); core.setTransition(element, true); }); eventsAttached = true; }; /** * Get supported property and add webkit prefix if needed * @param {string} property = property name * @return {string} property = property with optional webkit prefix */ const isWebkit = (property) => { if (typeof document.documentElement.style[property] === 'string') { return property; } property = capitalizeFirstLetter(property); property = `webkit${property}`; return property; }; /** * Capitalize the first letter in the string * @param {string} string = string * @return {string} string = changed string */ const capitalizeFirstLetter = (string) => string.charAt(0).toUpperCase() + string.slice(1); core.init(); }; if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') { module.exports = Accordion; } else { window.Accordion = Accordion; } })(window);
var test = require('tap').test var Depsify = require('../') var sink = require('sink-transform') var splicer = require('labeled-stream-splicer') test('pack', function(t) { t.plan(1) var stream = splicer.obj(Depsify.prototype.pack()) stream.write({ id: 'a', file: 'a', source: 'a{}', deps: { b: 'b', c: 'c' } }) stream.write({ id: 'b', file: 'b', source: 'b{}', deps: { c: 'c' } }) stream.end({ id: 'c', file: 'c', source: 'c{}', deps: {} }) stream.pipe(sink.str(function (body, done) { t.equal(body, 'c{}b{}a{}') done() })) })
#!/usr/bin/env node 'use strict'; const path = require('path'); const assert = require('assert'); const utils = require('../utils.js'); const fetch = require('pkg-fetch'); assert(!module.parent); assert(__dirname === process.cwd()); const host = 'node' + process.version.match(/^v(\d+)/)[1]; const target = process.argv[2] || host; let right; fetch.need({ nodeRange: target, platform: fetch.system.hostPlatform, arch: fetch.system.hostArch }).then(function (needed) { right = utils.spawn.sync( './' + path.basename(needed), [ '--expose-gc', '-e', 'if (global.gc) console.log("ok");' ], { cwd: path.dirname(needed), env: { PKG_EXECPATH: 'PKG_INVOKE_NODEJS' } } ); assert.equal(right, 'ok\n'); }).catch(function (error) { console.error(`> ${error.message}`); process.exit(2); });
const express = require('express'); const app = express(); const port = 5000; app.use(express.urlencoded({ extended: true })); app.use(express.json()); // Import Routes directory require('./routes')(app); app.get('/', (req, res) => { res.send('PORT 5000'); }); app.listen(port, (err) => { if (err) { console.log(err); }; console.log('Listening on port ' + port); });
/* * decaffeinate suggestions: * DS101: Remove unnecessary use of Array.from * DS102: Remove unnecessary code created because of implicit returns * DS103: Rewrite code to no longer use __guard__, or convert again using --optional-chaining * DS207: Consider shorter variations of null checks * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md */ let _HeadlineView; const _ = require('underscore'); const Backbone = require('backbone'); const _s = require('underscore.string'); export const HeadlineView = (_HeadlineView = class HeadlineView extends Backbone.View { initialize({ collection, params, facets, stuckFacet, stuckParam }) { this.collection = collection; this.params = params; this.facets = facets; this.stuckFacet = stuckFacet; this.stuckParam = stuckParam; this.listenTo(this.collection, "initial:fetch", this.setHeadline, this); if (this.stuckParam === 'fair_id') { this.stuckFacet = null; } for (let facet of Array.from(this.facets)) { this.listenTo(this.params, `change:${facet}`, this.setHeadline, this); } return this.counts = _.clone(this.collection.counts); } setHeadline() { if (this.anyFacetsSelected() || this.stuckFacet) { return this.$el.text(this.paramsToHeading()).show(); } else { return this.$el.text("").hide(); } } facetName(facet){ return __guard__(__guard__(this.counts != null ? this.counts[facet] : undefined, x1 => x1[this.params.get(facet)]), x => x.name); } anyFacetsSelected() { return _.any(this.facets, facet => this.params.has(facet)); } humanizeMedium() { // replace the 'slash' in 'film-slash-video' return _s.humanize(this.params.get('medium')).replace('slash', '/'); } displayMedium() { if (this.stuckFacet) { if (this.params.has('medium')) { return this.humanizeMedium(); } else { return this.stuckFacet.get('name'); } } else { return this.humanizeMedium() || 'Artworks'; } } paramsToHeading() { if (this.anyFacetsSelected() || this.stuckFacet) { return _.compact([ this.facetName('dimension_range'), (this.displayMedium()), this.facetName('price_range') ]).join(' '); } } }); function __guard__(value, transform) { return (typeof value !== 'undefined' && value !== null) ? transform(value) : undefined; }
var $mod$364 = core.VW.Ecma2015.Utils.module(require('../moment')); exports.default = $mod$364.default.defineLocale('cy', { months: 'Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr'.split('_'), monthsShort: 'Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag'.split('_'), weekdays: 'Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn'.split('_'), weekdaysShort: 'Sul_Llun_Maw_Mer_Iau_Gwe_Sad'.split('_'), weekdaysMin: 'Su_Ll_Ma_Me_Ia_Gw_Sa'.split('_'), weekdaysParseExact: true, longDateFormat: { LT: 'HH:mm', LTS: 'HH:mm:ss', L: 'DD/MM/YYYY', LL: 'D MMMM YYYY', LLL: 'D MMMM YYYY HH:mm', LLLL: 'dddd, D MMMM YYYY HH:mm' }, calendar: { sameDay: '[Heddiw am] LT', nextDay: '[Yfory am] LT', nextWeek: 'dddd [am] LT', lastDay: '[Ddoe am] LT', lastWeek: 'dddd [diwethaf am] LT', sameElse: 'L' }, relativeTime: { future: 'mewn %s', past: '%s yn ôl', s: 'ychydig eiliadau', m: 'munud', mm: '%d munud', h: 'awr', hh: '%d awr', d: 'diwrnod', dd: '%d diwrnod', M: 'mis', MM: '%d mis', y: 'blwyddyn', yy: '%d flynedd' }, ordinalParse: /\d{1,2}(fed|ain|af|il|ydd|ed|eg)/, ordinal: function (number) { var b = number, output = '', lookup = [ '', 'af', 'il', 'ydd', 'ydd', 'ed', 'ed', 'ed', 'fed', 'fed', 'fed', 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'fed' ]; if (b > 20) { if (b === 40 || b === 50 || b === 60 || b === 80 || b === 100) { output = 'fed'; } else { output = 'ain'; } } else if (b > 0) { output = lookup[b]; } return number + output; }, week: { dow: 1, doy: 4 } });
$('.returnTopAction').live('click', function() { $('html, body').animate({scrollTop: '0'}, 700); }); $('.link').live('tap', function(event) { url = $(this).attr("rel"); loadURL(url); }); function loadURL(url){ navigator.app.loadUrl(url, { openExternal:true }); return false; }
'use strict'; module.exports = { root: true, parser: 'babel-eslint', parserOptions: { ecmaVersion: 2018, sourceType: 'module', ecmaFeatures: { legacyDecorators: true, }, }, plugins: ['ember'], extends: ['plugin:prettier/recommended', 'eslint:recommended', 'plugin:ember/recommended'], env: { browser: true, }, rules: {}, overrides: [ // node files { files: [ '.eslintrc.js', '.template-lintrc.js', 'ember-cli-build.js', 'testem.js', 'blueprints/*/index.js', 'config/**/*.js', 'lib/*/index.js', 'server/**/*.js', ], parserOptions: { sourceType: 'script', }, env: { browser: false, node: true, }, plugins: ['node'], extends: ['plugin:node/recommended'], rules: { // this can be removed once the following is fixed // https://github.com/mysticatea/eslint-plugin-node/issues/77 'node/no-unpublished-require': 'off', }, }, ], };
'use strict'; // PeopleWorks module.exports = function (sequelize, DataTypes) { let PeopleWorks = sequelize.define('people_works', { id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true }, rol: DataTypes.INTEGER }); PeopleWorks.associate = function (models) { PeopleWorks.belongsTo(models.Works); PeopleWorks.belongsTo(models.People); }; return PeopleWorks; };
var express = require('express'); var router = express.Router(); /* GET home page. */ router.get('/', function(req, res, next) { res.render('formInv', { title: 'Express' }); }); module.exports = router;
require("babel-register"); var unexpected = require('unexpected'); unexpected.use(require('unexpected-sinon')); unexpected.use(require('unexpected-set')); var Bluebird = require('bluebird'); require('sinon-as-promised')(Bluebird); var Sequelize = require('sequelize'); unexpected.addType({ name: 'Sequelize.Instance', identify: /^[45]/.test(Sequelize.version) ? function (value) { return value && value instanceof Sequelize.Model && 'isNewRecord' in value; } : function (value) { return value && value instanceof Sequelize.Instance; }, inspect: function (value, depth, output, inspect) { const name = value.name || value.$modelOptions.name || value._modelOptions.name; // v3 vs v4 output .text(name.singular).text('(') .append(inspect(value.get(), depth)) .text(')'); }, equal: function (a, b) { const aModel = a.Model || a.constructor; // v3 vs v4 const bModel = b.Model || b.constructor; const pk = aModel.primaryKeyAttribute; return aModel.name === bModel.name && a.get(pk) === b.get(pk); } }); unexpected.addType({ name: 'Sequelize.Association', identify: function (value) { return value && value instanceof Sequelize.Association; }, inspect: function (value, depth, output) { output .text(value.associationType).text(': ') .text(value.source.name).text(' -> ').text(value.target.name) .text('(').text(value.as).text(')'); }, equal: function (a, b, equal) { return a.associationType === b.associationType && equal(a.source, b.source) && equal(a.target, b.target) && a.as === b.as; } }); unexpected.addAssertion('<function> [not] to be shimmed', function (expect, subject) { return expect(subject, '[not] to have property', '__wrapped'); });
import route from 'routes/EightBall'; describe('(Route) EightBall', () => { let _component; beforeEach(() => { _component = route.component; }); it('should return a route', () => { expect(typeof route).to.equal('object'); expect(route.path).to.equal('magic-eight-ball'); }); it('should define a component', () => { expect(typeof _component).to.equal('function'); }); });
'use strict'; var utils = require('../integration-utils.js'); var setup = utils.setup; var algoliasearchHelper = require('../../'); var random = require('lodash/random'); test('[INT][FILTERS] Should retrieve different values for multi facetted records', function(done) { var indexName = '_circle-algoliasearch-helper-js-' + (process.env.CIRCLE_BUILD_NUM || 'DEV') + 'helper_refinements' + random(0, 5000); setup(indexName, function(client, index) { return index.addObjects([ {facet: ['f1', 'f2']}, {facet: ['f1', 'f3']}, {facet: ['f2', 'f3']} ]) .then(function() { return index.setSettings({ attributesToIndex: ['facet'], attributesForFaceting: ['facet'] }); }) .then(function(content) { return index.waitTask(content.taskID); }).then(function() { return client; }); }).then(function(client) { var helper = algoliasearchHelper(client, indexName, { facets: ['facet'] }); var calls = 0; helper.on('error', function(event) { done.fail(event.error); }); helper.on('result', function(event) { calls++; var results = event.results; if (calls === 1) { expect(results.hits.length).toBe(2); expect(results.facets[0].data).toEqual({ f1: 2, f2: 1, f3: 1 }); helper.addRefine('facet', 'f2').search(); } if (calls === 2) { expect(results.hits.length).toBe(1); expect(results.facets[0].data).toEqual({ f1: 1, f2: 1 }); helper.toggleRefine('facet', 'f3').search(); } if (calls === 3) { expect(results.hits.length).toBe(0); expect(results.facets[0]).toBe(undefined); helper.removeRefine('facet', 'f2').search(); } if (calls === 4) { expect(results.hits.length).toBe(1); expect(results.facets[0].data).toEqual({ f1: 1, f3: 1 }); client.deleteIndex(indexName); if (!process.browser) { client.destroy(); } done(); } }); helper.addRefine('facet', 'f1').search(); }); });
'use strict'; angular.module('mean.goals').config(['$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider) { $urlRouterProvider.otherwise('/goals'); //================================================ // Check if the user is connected //================================================ var checkLoggedin = function($q, $timeout, $http, $location) { // Initialize a new promise var deferred = $q.defer(); // Make an AJAX call to check if the user is logged in $http.get('/loggedin').success(function(user) { // Authenticated if (user !== '0') $timeout(deferred.resolve, 0); // Not Authenticated else { $timeout(function() { deferred.reject(); }, 0); $location.url('/login'); } }); return deferred.promise; }; //================================================ // Check if the user is not conntect //================================================ var checkLoggedOut = function($q, $timeout, $http, $location) { // Initialize a new promise var deferred = $q.defer(); // Make an AJAX call to check if the user is logged in $http.get('/loggedin').success(function(user) { // Authenticated if (user !== '0') { $timeout(function() { deferred.reject(); }, 0); $location.url('/login'); } // Not Authenticated else { $timeout(deferred.resolve, 0); } }); return deferred.promise; }; //================================================ $stateProvider .state('goals', { url: '/goals', templateUrl: 'public/goals/views/goals.html', controller: 'GoalsCtrl', data: {goals: 'all'} }) .state('my goals', { url: '/goals/my', templateUrl: 'public/goals/views/goals.html', controller: 'GoalsCtrl', data: {goals: 'my'} }) .state('my goals.new', { url: '/new', templateUrl: 'public/goals/views/new_goal.html', controller: 'NewGoalCtrl', resolve: { loggedin: checkLoggedin } }) .state('goals.new', { url: '/new', templateUrl: 'public/goals/views/new_goal.html', controller: 'NewGoalCtrl', resolve: { loggedin: checkLoggedin } }) .state('my goals.detail', { url: '/:id', templateUrl: 'public/goals/views/goal.html', controller: 'GoalCtrl' }) .state('goals.detail', { url: '/:id', templateUrl: 'public/goals/views/goal.html', controller: 'GoalCtrl' }); }]);
/** * @class Oskari.mapping.mapmodule.AbstractMapModule * * Provides map functionality/Wraps actual map implementation (Openlayers). * Currently hardcoded at 13 zoomlevels (0-12) and SRS projection code 'EPSG:3067'. * There are plans to make these more configurable in the future. * * See http://www.oskari.org/trac/wiki/DocumentationBundleMapmodule */ Oskari.AbstractFunc = function () { var name = arguments[0]; return function () { throw "AbstractFuncCalled: " + name; }; }; Oskari.clazz.define('Oskari.mapping.mapmodule.AbstractMapModule', /** * @method create called automatically on construction * @static * * @param {String} id * Unigue ID for this map * @param {String} imageUrl * base url for marker etc images * @param {Array} map options, example data: * { * resolutions : [2000, 1000, 500, 200, 100, 50, 20, 10, 4, 2, 1, 0.5, 0.25], * maxExtent : { * left : 0, * bottom : 10000000, * right : 10000000, * top : 0 * }, srsName : "EPSG:3067" * } */ function (id, imageUrl, options) { var me = this; me._id = id; me._imageUrl = imageUrl; me._options = { resolutions : [2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5], srsName : 'EPSG:3067', units : 'm' }; if(options) { for(var key in options) { me._options[key] = options[key]; } } me._controls = {}; me._layerPlugins = {}; /** @static @property {String} _projectionCode SRS projection code, defaults * to 'EPSG:3067' */ me._projection = null; me._projectionCode = me._options.srsName; me._supportedFormats = {}; me._map = null; // _mapScales are calculated in _calculateScalesImpl based on resolutions in options me._mapScales = []; me._mapResolutions = me._options.resolutions; // arr me._maxExtent = me._options.maxExtent || {}; // props: left,bottom,right, top if(me._maxExtent.left) { me._extent = [me._maxExtent.left, me._maxExtent.bottom, me._maxExtent.right, me._maxExtent.top]; } else { me._extent = []; } // arr me._sandbox = null; me._stealth = false; me._pluginInstances = {}; // mapcontrols assumes this to be present before init or start me._localization = null; /* array of { id: <id>, name: <name>, layer: layer, impl: layerImpl } */ me.layerDefs = []; me.layerDefsById = {}; }, { /** * @method getImageUrl * Returns a base url for plugins to show. Can be set in constructor and * defaults to "/Oskari/resources" if not set. * @return {String} */ getImageUrl: function () { if (!this._imageUrl) { // default if not set return "/Oskari/resources"; } return this._imageUrl; }, /** * @method getControls * Returns map controls - storage for controls by id. See getMapControl for getting single control. * @return {Object} contains control names as keys and control * objects as values */ getControls: function () { return this._controls; }, /** * @method getMapControl * Returns a single map control that matches the given id/name. * See getControls for getting all controls. * @param {String} id name of the map control * @return {OpenLayers.Control} control matching the id or undefined if not found */ getMapControl: function (id) { return this._controls[id]; }, /** * @method addMapControl * Adds a control to the map and saves a reference so the control * can be accessed with getControls/getMapControl. * @param {String} id control id/name * @param {OpenLayers.Control} ctl */ addMapControl: function (id, ctl) { this._controls[id] = ctl; this._addMapControlImpl(ctl); }, /** * @method removeMapControl * Removes a control from the map matching the given id/name and * also removes it from references gotten by getControls() * @param {String} id control id/name */ removeMapControl: function (id) { var ctl = this._controls[id]; this._removeMapControlImpl(ctl); delete this._controls[id]; }, /** * @method setLayerPlugin * Adds a plugin to the map that is responsible for rendering maplayers on the map. Other types of * plugins doesn't need to be registered like this. * Saves a reference so the plugin so it can be accessed with getLayerPlugins/getLayerPlugin. * * The plugin handling rendering a layer is responsible for calling this method and registering * itself as a layersplugin. * * @param {String} id plugin id/name * @param {Oskari.mapframework.ui.module.common.mapmodule.Plugin} plug, set to null if you want to remove the entry */ setLayerPlugin: function (id, plug) { if (id === null || id === undefined || !id.length) { this._sandbox.printWarn("Setting layer plugin", plug, "with a non-existent ID:", id); } if (plug === null || plug === undefined) { delete this._layerPlugins[id]; } else { this._layerPlugins[id] = plug; } }, /** * @method getLayerPlugin * Returns a single map layer plugin that matches the given id * See getLayerPlugins for getting all plugins. * See setLayerPlugin for more about layerplugins. * @return {Oskari.mapframework.ui.module.common.mapmodule.Plugin} plugin matching the id or undefined if not found */ getLayerPlugin: function (id) { return this._layerPlugins[id]; }, /** * @method getControls * Returns plugins that have been registered as layer plugins. See setLayerPlugin for more about layerplugins. * See getLayerPlugin for getting single plugin. * @return {Object} contains plugin ids keys and plugin objects as values */ getLayerPlugins: function () { return this._layerPlugins; }, /** * @method getName * @return {String} the name for the component */ getName: function () { return this._id + "MapModule"; }, /** * @method getSandbox * Returns reference to Oskari sandbox * @return {Oskari.mapframework.sandbox.Sandbox} */ getSandbox: function () { return this._sandbox; }, /** * @method getLocalization * Returns JSON presentation of bundles localization data for current * language. * If key-parameter is not given, returns the whole localization data. * * @param {String} key (optional) if given, returns the value for key * @param {Boolean} force (optional) true to force reload for localization data * @return {String/Object} returns single localization string or * JSON object for complete data depending on localization * structure and if parameter key is given */ getLocalization: function (key, force) { if (!this._localization || force === true) { this._localization = Oskari.getLocalization('MapModule'); } if (key) { return this._localization[key]; } return this._localization; }, /** * @method init * Implements Module protocol init method. Creates the Map. * @param {Oskari.mapframework.sandbox.Sandbox} sandbox * @return {Map} */ init: function (sandbox) { var me = this; sandbox.printDebug("Initializing oskari map module...#############################################"); me._sandbox = sandbox; if (me._options) { if (me._options.resolutions) { me._mapResolutions = me._options.resolutions; } if (me._options.srsName) { me._projectionCode = me._options.srsName; // set srsName to Oskari.mapframework.domain.Map if (me._sandbox) { me._sandbox.getMap().setSrsName(me._projectionCode); } } } me._map = me._createMapImpl(); // changed to resolutions based map zoom levels // -> calculate scales array for backward compatibility me._calculateScalesImpl(me._mapResolutions); return me._initImpl(me._sandbox, me._options, me._map); }, /** * @method _initImpl * Init for implementation specific functionality. * @param {Oskari.mapframework.sandbox.Sandbox} sandbox * @param {Map} map * @return {Map} */ _initImpl: function (sandbox, options, map) { return map; }, /** * @method getPluginInstances * Returns object containing plugins that have been registered to the map. * @return {Object} contains plugin ids as keys and plugin objects as values */ getPluginInstances: function () { return this._pluginInstances; }, /** * @method getPluginInstance * Returns plugin with given name if it registered on the map * @param {String} pluginName name of the plugin to get * @return {Oskari.mapframework.ui.module.common.mapmodule.Plugin} */ getPluginInstance: function (pluginName) { return this._pluginInstances[this.getName() + pluginName]; }, /** * @method isPluginActivated * Checks if a plugin matching the given name is registered to the map * @param {String} pluginName name of the plugin to check * @return {Boolean} true if a plugin with given name is registered to the map */ isPluginActivated: function (pluginName) { var plugin = this._pluginInstances[this.getName() + pluginName]; if (plugin) { return true; } return false; }, /** * @method registerPlugin * Registers the given plugin to this map module. Sets the mapmodule reference to the plugin and * calls plugins register method. Saves a reference to the plugin that can be fetched through * getPluginInstances(). * @param {Oskari.mapframework.ui.module.common.mapmodule.Plugin} plugin */ registerPlugin: function (plugin) { var sandbox = this.getSandbox(); plugin.setMapModule(this); var pluginName = plugin.getName(); sandbox.printDebug('[' + this.getName() + ']' + ' Registering ' + pluginName); plugin.register(); this._pluginInstances[pluginName] = plugin; }, /** * @method unregisterPlugin * Unregisters the given plugin from this map module. Sets the mapmodule reference on the plugin * to <null> and calls plugins unregister method. Removes the reference to the plugin from * getPluginInstances(). * @param {Oskari.mapframework.ui.module.common.mapmodule.Plugin} plugin */ unregisterPlugin: function (plugin) { var sandbox = this.getSandbox(), pluginName = plugin.getName(); sandbox.printDebug('[' + this.getName() + ']' + ' Unregistering ' + pluginName); plugin.unregister(); this._pluginInstances[pluginName] = undefined; plugin.setMapModule(null); delete this._pluginInstances[pluginName]; }, /** * @method startPlugin * Starts the given plugin by calling its startPlugin() method. * @param {Oskari.mapframework.ui.module.common.mapmodule.Plugin} plugin */ startPlugin: function (plugin) { var sandbox = this.getSandbox(), pluginName = plugin.getName(); sandbox.printDebug('[' + this.getName() + ']' + ' Starting ' + pluginName); plugin.startPlugin(sandbox); }, /** * @method stopPlugin * Stops the given plugin by calling its stopPlugin() method. * @param {Oskari.mapframework.ui.module.common.mapmodule.Plugin} plugin */ stopPlugin: function (plugin) { var sandbox = this.getSandbox(), pluginName = plugin.getName(); sandbox.printDebug('[' + this.getName() + ']' + ' Starting ' + pluginName); plugin.stopPlugin(sandbox); }, /** * @method startPlugin * Starts all registered plugins (see getPluginInstances() and registerPlugin()) by * calling its startPlugin() method. * @param {Oskari.mapframework.sandbox.Sandbox} sandbox */ startPlugins: function (sandbox) { var pluginName; for (pluginName in this._pluginInstances) { if (this._pluginInstances.hasOwnProperty(pluginName)) { sandbox.printDebug('[' + this.getName() + ']' + ' Starting ' + pluginName); this._pluginInstances[pluginName].startPlugin(sandbox); } } }, /** * @method stopPlugins * Stops all registered plugins (see getPluginInstances() and registerPlugin()) by * calling its stopPlugin() method. * @param {Oskari.mapframework.sandbox.Sandbox} sandbox */ stopPlugins: function (sandbox) { var pluginName; for (pluginName in this._pluginInstances) { if (this._pluginInstances.hasOwnProperty(pluginName)) { sandbox.printDebug('[' + this.getName() + ']' + ' Starting ' + pluginName); this._pluginInstances[pluginName].stopPlugin(sandbox); } } }, /** * @method getStealth * Returns boolean true if map is in "stealth mode". Stealth mode means that the map doesn't send events * and doesn't update the map domain object in sandbox * @return {Boolean} */ getStealth: function () { return this._stealth; }, /** * @method setStealth * Enables/disables the maps "stealth mode". Stealth mode means that the map doesn't send events * and doesn't update the map domain object in sandbox * @param {Boolean} bln true to enable stealth mode */ setStealth: function (bln) { this._stealth = !!bln; }, /** * @method notifyAll * Calls sandbox.notifyAll with the parameters if stealth mode is not enabled * @param {Oskari.mapframework.event.Event} event - event to send * @param {Boolean} retainEvent true to not send event but only print debug which modules are listening, usually left undefined (optional) */ notifyAll: function (event, retainEvent) { // propably not called anymore? if (this.getStealth()) { return; } this.getSandbox().notifyAll(event, retainEvent); }, /** * @method getMap * Returns a reference to the actual OpenLayers implementation * @return {OpenLayers.Map} */ getMap: function () { return this._map; }, /** * @method getProjection * Returns the SRS projection code for the map. * Currently always 'EPSG:3067' * @return {String} */ getProjection: function () { return this._projectionCode; }, getProjectionObject: function () { return this._projection; }, getResolutionArray: function () { return this._mapResolutions; }, getExtentArray: function () { return this._extent; }, /** * @method zoomIn * Adjusts the zoom level by one */ zoomIn: function () { this.adjustZoomLevel(1); }, /** * @method zoomOut * Adjusts the zoom level by minus one */ zoomOut: function () { this.adjustZoomLevel(-1); }, /** * @method zoomTo * Sets the zoom level to given value * @param {Number} zoomLevel the new zoom level */ zoomTo: function (zoomLevel) { this.setZoomLevel(zoomLevel, false); }, /** * @method moveMapByPixels * Moves the map by given amount of pixels. * @param {Number} pX amount of pixels to move on x axis * @param {Number} pY amount of pixels to move on y axis * @param {Boolean} suppressStart true to NOT send an event about the map starting to move * (other components wont know that the map has started moving, only use when chaining moves and * wanting to notify at end of the chain for performance reasons or similar) (optional) * @param {Boolean} suppressEnd true to NOT send an event about the map move * (other components wont know that the map has moved, only use when chaining moves and * wanting to notify at end of the chain for performance reasons or similar) (optional) */ moveMapByPixels: function (pX, pY, suppressStart, suppressEnd) { return this.panMapByPixels(pX, pY, suppressStart, suppressEnd); }, /** * @method isValidLonLat * Checks that latitude is between 8 200 000 <> 6 250 000 and * that longitude is between 0 <> 1 350 000 * @param {Number} lon longitude to check * @param {Number} lat latitude to check * @return {Boolean} true if coordinates are in said boundaries */ isValidLonLat: function (lon, lat) { // FIXME isn't this projection dependent? var isOk = true; if (lat < 6250000 || lat > 8200000) { isOk = false; return isOk; } if (lon < 0 || lon > 1350000) { isOk = false; } return isOk; }, /** * @method getClosestZoomLevel * Calculate closest zoom level given the given boundaries. * If map is zoomed too close -> returns the closest zoom level level possible within given bounds * If map is zoomed too far out -> returns the furthest zoom level possible within given bounds * If the boundaries are within current zoomlevel or undefined, returns the current zoomLevel * @param {Number} maxScale maximum scale boundary (optional) * @param {Number} minScale minimum scale boundary (optional) * @return {Number} zoomLevel (0-12) */ getClosestZoomLevel: function (maxScale, minScale) { var zoomLevel = this.getZoomLevel(); if (!minScale || !maxScale) { return zoomLevel; } // FIXME: relies on OL2 implementation, refactor to use Impl var scale = this.getMap().getScale(), i; if (scale < minScale) { // zoom out //for(i = this._mapScales.length; i > zoomLevel; i--) { for (i = zoomLevel; i > 0; i--) { if (this._mapScales[i] >= minScale) { return i; } } } else if (scale > maxScale) { // zoom in for (i = zoomLevel; i < this._mapScales.length; i++) { if (this._mapScales[i] <= maxScale) { return i; } } } return zoomLevel; }, /** * Formats the measurement of the geometry. * Returns a string with the measurement and * an appropriate unit (m/km or m²/km²) * or an empty string for point. * * @method formatMeasurementResult * @param {OpenLayers.Geometry} geometry * @param {String} drawMode * @return {String} */ formatMeasurementResult: function(geometry, drawMode) { var measurement, unit; if (drawMode === 'area') { measurement = (Math.round(100 * geometry.getArea())/100); unit = ' m²'; // 1 000 000 m² === 1 km² if (measurement >= 1000000) { measurement = (Math.round(measurement)/1000000); unit = ' km²'; } } else if (drawMode === 'line') { measurement = (Math.round(100 * geometry.getLength())/100); unit = ' m'; // 1 000 m === 1 km if (measurement >= 1000) { measurement = (Math.round(measurement)/1000); unit = ' km'; } } else { return ''; } return (measurement + unit).replace('.', ','); }, /** * @method start * implements BundleInstance protocol start method * Starts the plugins registered on the map and adds * selected layers on the map if layers were selected before * mapmodule was registered to listen to these events. * @param {Oskari.mapframework.sandbox.Sandbox} sandbox */ start: function (sandbox) { if (this.started) { return; } sandbox.printDebug("Starting " + this.getName()); // register events handlers var p; for (p in this.eventHandlers) { if (this.eventHandlers.hasOwnProperty(p)) { sandbox.registerForEventByName(this, p); } } this.startPlugins(sandbox); this.updateCurrentState(); this.started = this._startImpl(); }, _startImpl: function () { return true; }, /** * @method stop * implements BundleInstance protocol stop method * Stops the plugins registered on the map. * @param {Oskari.mapframework.sandbox.Sandbox} sandbox */ stop: function (sandbox) { if (!this.started) { return; } this.stopPlugins(sandbox); this.started = this._stopImpl(); }, _stopImpl: function () { return true; }, /** * @property eventHandlers * @static */ eventHandlers: {}, /** * @method onEvent * @param {Oskari.mapframework.event.Event} event a Oskari event object * Event is handled forwarded to correct #eventHandlers if found or discarded * if not. */ onEvent: function (event) { var handler = this.eventHandlers[event.getName()]; if (!handler) { return; } return handler.apply(this, [event]); }, /** * @method updateCurrentState * Setup layers from selected layers * This is needed if map layers are added before mapmodule/plugins are started. * Should be called only on startup, preferrably not even then * (workaround for timing issues). * If layers are already in map, this adds them twice and they cannot be * removed anymore by removemaplayerrequest (it should be sent twice but ui doesn't * offer that). */ updateCurrentState: function () { var me = this, sandbox = me._sandbox, layers = sandbox.findAllSelectedMapLayers(), lps = this.getLayerPlugins(), layersPlugin, p; for (p in lps) { if (lps.hasOwnProperty(p)) { layersPlugin = lps[p]; sandbox.printDebug('preselecting ' + p); layersPlugin.preselectLayers(layers); } } }, /* * moved here to make generalization easier */ getLayersByName: function (name) { var results = [], layerDefs = this.layerDefs, l, ldef; for (l = 0; l < layerDefs.length; l++) { ldef = layerDefs[l]; if (ldef.name.indexOf(name) != -1) { results.push(ldef.impl); } } return results; }, getLayers: function () { return this.layerDefs; }, getLayerDefs: function () { return this.layerDefs; }, addLayer: function (layerImpl, layer, name, index) { var ldef = { name: name, id: layer.getId(), impl: layerImpl, layer: layer }; this.layerDefs.push(ldef); this.layerDefsById[layer.getId()] = ldef; this._addLayerImpl(layerImpl, index); }, removeLayer: function (layerImpl, layer, name) { this._removeLayerImpl(layerImpl); delete this.layerDefsById[layer.getId()]; var newDefs = [], n; for (n = 0; n < this.layerDefs.length; n++) { if (this.layerDefs[n].layer.getId() !== layer.getId()) { newDefs.push(this.layerDefs[n]); continue; } delete this.layerDefs[n]; } this.layerDefs = newDefs; }, setLayerIndex: function (layerImpl, index) { var layerArr = this.getLayerDefs(), layerIndex = this.getLayerIndex(layerImpl), newLayerArr = [], prevDef = layerArr[layerIndex], n = 0; for (n = 0; n < layerArr.length; n++) { if (n === index && prevDef) { newLayerArr.push(prevDef); prevDef = null; } if (layerArr[n].impl !== layerImpl) { newLayerArr.push(layerArr[n]); } } if (n === index && prevDef) { newLayerArr.push(prevDef); } this.layerDefs = newLayerArr; for (n = 0; n < layerArr.length; n++) { this._setLayerImplIndex(layerArr[n].impl, n); } }, getLayerIndex: function (layerImpl) { var layerArr = this.getLayerDefs(), n; for (n = 0; n < layerArr.length; n++) { if (layerArr[n].impl === layerImpl) { return n; } } return -1; }, getMapScale: function () { var size = this.getMapSize(), extent = this.getMapExtent(), res = (extent[2] - extent[0]) / size[0]; return OpenLayers.Util.getScaleFromResolution(res, 'm'); }, /** * @method calculateLayerScales * Calculate a subset of maps scales array that matches the given boundaries. * If boundaries are not defined, returns all possible scales. * @param {Number} maxScale maximum scale boundary (optional) * @param {Number} minScale minimum scale boundary (optional) * @return {Number[]} calculated mapscales that are within given bounds */ calculateLayerMinMaxResolutions: function (maxScale, minScale) { var minScaleZoom, maxScaleZoom, i; for (i = 0; i < this._mapScales.length; i++) { if ((!minScale || minScale >= this._mapScales[i]) && (!maxScale || maxScale <= this._mapScales[i])) { if (minScaleZoom === undefined) { minScaleZoom = i; } maxScaleZoom = i; } } return { min: minScaleZoom, max: maxScaleZoom }; }, /** * @method getMapScales * @return {Number[]} calculated mapscales */ getMapScales: function () { return this._mapScales; }, /** * @method calculateLayerScales * Calculate a subset of maps scales array that matches the given boundaries. * If boundaries are not defined, returns all possible scales. * @param {Number} maxScale maximum scale boundary (optional) * @param {Number} minScale minimum scale boundary (optional) * @return {Number[]} calculated mapscales that are within given bounds */ calculateLayerScales: function (maxScale, minScale) { var layerScales = [], i; for (i = 0; i < this._mapScales.length; i++) { if ((!minScale || minScale >= this._mapScales[i]) && (!maxScale || maxScale <= this._mapScales[i])) { layerScales.push(this._mapScales[i]); } } return layerScales; }, /** * @method calculateLayerResolutions * Calculate a subset of maps resolutions array that matches the given boundaries. * If boundaries are not defined, returns all possible resolutions. * @param {Number} maxScale maximum scale boundary (optional) * @param {Number} minScale minimum scale boundary (optional) * @return {Number[]} calculated resolutions that are within given bounds */ calculateLayerResolutions: function (maxScale, minScale) { var layerResolutions = [], i; for (i = 0; i < this._mapScales.length; i++) { if ((!minScale || minScale >= this._mapScales[i]) && (!maxScale || maxScale <= this._mapScales[i])) { // resolutions are in the same order as scales so just use them layerResolutions.push(this._options.resolutions[i]); } } return layerResolutions; }, /** * Returns state for mapmodule including plugins that have getState() function * @method getState * @return {Object} properties for each pluginName */ getState : function() { var state = { "plugins": {} }, pluginName; for (pluginName in this._pluginInstances) { if (this._pluginInstances.hasOwnProperty(pluginName) && this._pluginInstances[pluginName].getState) { state.plugins[pluginName] = this._pluginInstances[pluginName].getState(); } } return state; }, /** * Returns state for mapmodule including plugins that have getStateParameters() function * @method getStateParameters * @return {String} link parameters for map state */ getStateParameters: function () { var params = "", pluginName; for (pluginName in this._pluginInstances) { if (this._pluginInstances.hasOwnProperty(pluginName) && this._pluginInstances[pluginName].getStateParameters) { params = params + this._pluginInstances[pluginName].getStateParameters(); } } return params; }, /** * Sets state for mapmodule including plugins that have setState() function * NOTE! Not used for now * @method setState * @param {Object} properties for each pluginName */ setState : function(state) { var pluginName; for (pluginName in this._pluginInstances) { if (this._pluginInstances.hasOwnProperty(pluginName) && state[pluginName] && this._pluginInstances[pluginName].setState) { this._pluginInstances[pluginName].setState(state[pluginName]); } } }, /* IMPL specific */ _crs2MapImpl: Oskari.AbstractFunc("_crs2MapImpl"), _map2CrsImpl: Oskari.AbstractFunc("_map2CrsImpl"), updateSize: Oskari.AbstractFunc("updateSize"), /** * @method _createMapImpl * @private * Creates the Implementation specific Map object * @return {Map} */ _createMapImpl: Oskari.AbstractFunc("_createMapImpl"), /** * @method moveMapToLanLot * Moves the map to the given position. Alias for panMapToLonLat. */ moveMapToLanLot: function () { return this.panMapToLonLat.apply(this, arguments); }, /** * @method panMapToLonLat * Pans the map to the given position. * @param {OpenLayers.LonLat} lonlat coordinates to pan the map to * @param {Boolean} suppressEnd true to NOT send an event about the map move * (other components wont know that the map has moved, only use when chaining moves and * wanting to notify at end of the chain for performance reasons or similar) (optional) */ panMapToLonLat: Oskari.AbstractFunc("moveMapToLanLot"), /** * @method zoomToScale * Pans the map to the given position. * @param {float} scale the new scale * @param {Boolean} closest find the zoom level that most closely fits the specified scale. * Note that this may result in a zoom that does not exactly contain the entire extent. Default is false * @param {Boolean} suppressEnd true to NOT send an event about the map move * (other components wont know that the map has moved, only use when chaining moves and * wanting to notify at end of the chain for performance reasons or similar) (optional) */ zoomToScale: Oskari.AbstractFunc("zoomToScale"), /** * @method centerMap * Moves the map to the given position and zoomlevel. * @param {OpenLayers.LonLat} lonlat coordinates to move the map to * @param {Number} zoomLevel absolute zoomlevel to set the map to * @param {Boolean} suppressEnd true to NOT send an event about the map move * (other components wont know that the map has moved, only use when chaining moves and * wanting to notify at end of the chain for performance reasons or similar) (optional) */ centerMap: Oskari.AbstractFunc("centerMap"), /** * @method panMapByPixels * Pans the map by given amount of pixels. * @param {Number} pX amount of pixels to pan on x axis * @param {Number} pY amount of pixels to pan on y axis * @param {Boolean} suppressStart true to NOT send an event about the map starting to move * (other components wont know that the map has started moving, only use when chaining moves and * wanting to notify at end of the chain for performance reasons or similar) (optional) * @param {Boolean} suppressEnd true to NOT send an event about the map move * (other components wont know that the map has moved, only use when chaining moves and * wanting to notify at end of the chain for performance reasons or similar) (optional) * @param {Boolean} isDrag true if the user is dragging the map to a new location currently (optional) */ panMapByPixels: Oskari.AbstractFunc("panMapByPixels"), /** * @method centerMapByPixels * Moves the map so the given pixel coordinates relative to the viewport is on the center of the view port. * @param {Number} pX pixel coordinates on x axis * @param {Number} pY pixel coordinates on y axis * @param {Boolean} suppressStart true to NOT send an event about the map starting to move * (other components wont know that the map has started moving, only use when chaining moves and * wanting to notify at end of the chain for performance reasons or similar) (optional) * @param {Boolean} suppressEnd true to NOT send an event about the map move * (other components wont know that the map has moved, only use when chaining moves and * wanting to notify at end of the chain for performance reasons or similar) (optional) */ centerMapByPixels: Oskari.AbstractFunc("centerMapByPixels"), /** * @method zoomToExtent * Zooms the map to fit given bounds on the viewport * @param {OpenLayers.Bounds} bounds BoundingBox that should be visible on the viewport * @param {Boolean} suppressStart true to NOT send an event about the map starting to move * (other components wont know that the map has started moving, only use when chaining moves and * wanting to notify at end of the chain for performance reasons or similar) (optional) * @param {Boolean} suppressEnd true to NOT send an event about the map move * (other components wont know that the map has moved, only use when chaining moves and * wanting to notify at end of the chain for performance reasons or similar) (optional) */ zoomToExtent: Oskari.AbstractFunc("zoomToExtent"), /** * @method setZoomLevel * Sets the maps zoom level to given absolute number * @param {Number} newZoomLevel absolute zoom level (0-12) * @param {Boolean} suppressEvent true to NOT send an event about the map move * (other components wont know that the map has moved, only use when chaining moves and * wanting to notify at end of the chain for performance reasons or similar) (optional) */ setZoomLevel: Oskari.AbstractFunc("setZoomLevel"), /** * @method getZoomLevel * gets the maps zoom level to given absolute number * @return {Number} newZoomLevel absolute zoom level (0-12) */ getZoomLevel: function () { return this.getMap().getZoom(); }, /** * @method _updateDomainImpl * @private * Updates the sandbox map domain object with the current map properties. * Ignores the call if map is in stealth mode. */ _updateDomainImpl: Oskari.AbstractFunc("_updateDomainImpl"), _addLayerImpl: Oskari.AbstractFunc("_addLayerImpl(layerImpl, index)"), _setLayerImplIndex: Oskari.AbstractFunc("_setLayerImplIndex(layerImpl,n)"), _removeLayerImpl: Oskari.AbstractFunc("_removeLayerImpl(layerImpl)"), _setLayerImplVisible: Oskari.AbstractFunc("_setLayerImplVisible"), _setLayerImplOpacity: Oskari.AbstractFunc("_setLayerImplOpacity"), adjustZoomLevel: Oskari.AbstractFunc("adjustZoomLevel(amount, suppressEvent)"), notifyMoveEnd: function () {}, _calculateScalesImpl: Oskari.AbstractFunc("_calculateScalesImpl(resolutions)"), _addMapControlImpl: Oskari.AbstractFunc("_addMapControlImpl(ctl)"), _removeMapControlImpl: Oskari.AbstractFunc("_removeMapControlImpl(ctl)"), }, { /** * @property {String[]} protocol * @static */ 'protocol': ['Oskari.mapframework.module.Module'] });
if (typeof T === 'undefined') require('../setup'); T('dividedBy', function () { Decimal.config({ precision: 40, rounding: 4, toExpNeg: -7, toExpPos: 21, minE: -9e15, maxE: 9e15 }); var t = function (expected, dividend, divisor) { var quotient = new Decimal(dividend).div(divisor); T.assertEqual(expected, quotient.isZero() && quotient.isNegative()); } t(false, 1, Infinity); t(true, 1, -Infinity); t(true, -1, Infinity); t(false, -1, -Infinity); t(false, 0, 1); t(true, 0, -1); t(true, -0, 1); t(false, -0, -1); t(false, 0, Infinity); t(true, 0, -Infinity); t(true, -0, Infinity); t(false, -0, -Infinity); t = function (dividend, divisor, expected) { T.assertEqual(expected, new Decimal(dividend).div(divisor).valueOf()); } t(1, 0, 'Infinity'); t(1, -0, '-Infinity'); t(-1, 0, '-Infinity'); t(-1, -0, 'Infinity'); t(1, NaN, 'NaN'); t(-1, NaN, 'NaN'); t(0, 0, 'NaN'); t(0, -0, 'NaN'); t(-0, 0, 'NaN'); t(-0, -0, 'NaN'); t(0, NaN, 'NaN'); t(-0, NaN, 'NaN'); t(NaN, 1, 'NaN'); t(NaN, -1, 'NaN'); t(NaN, 0, 'NaN'); t(NaN, -0, 'NaN'); t(NaN, NaN, 'NaN'); t(NaN, Infinity, 'NaN'); t(NaN, -Infinity, 'NaN'); t(Infinity, 1, 'Infinity'); t(Infinity, -1, '-Infinity'); t(-Infinity, 1, '-Infinity'); t(-Infinity, -1, 'Infinity'); t(Infinity, 0, 'Infinity'); t(Infinity, -0, '-Infinity'); t(-Infinity, 0, '-Infinity'); t(-Infinity, -0, 'Infinity'); t(Infinity, NaN, 'NaN'); t(-Infinity, NaN, 'NaN'); t(Infinity, Infinity, 'NaN'); t(Infinity, -Infinity, 'NaN'); t(-Infinity, Infinity, 'NaN'); t(-Infinity, -Infinity, 'NaN'); t(1, '1', '1'); t(1, '-45', '-0.02222222222222222222222222222222222222222'); t(1, '22', '0.04545454545454545454545454545454545454545'); t(1, 0144, '0.01'); t(1, '0144', '0.006944444444444444444444444444444444444444'); t(1, '6.1915', '0.1615117499798110312525236210934345473633'); t(1, '-1.02', '-0.9803921568627450980392156862745098039216'); t(1, '-0.0001', '-10000'); t(1, '8e5', '0.00000125'); t(1, '1e-14', '100000000000000'); t(1, '-94.12E+0', '-0.01062473438164045898852528686782830429239'); t(1, 'Infinity', '0'); t(1, '-Infinity', '-0'); t(1, Number.POSITIVE_INFINITY, '0'); t(1, Number.NEGATIVE_INFINITY, '-0'); t('0', 0, 'NaN'); t('0', '0', 'NaN'); t(3, -0, '-Infinity'); t(9.654, 0, 'Infinity'); t(0, '0.001', '0'); t(0, '111.1111111110000', '0'); t('NaN', 0, 'NaN'); t(0, 'NaN', 'NaN'); t('NaN', '0', 'NaN'); t(-1, 1, '-1'); t(-0.01, 0.01, '-1'); t(54, -54, '-1'); t(9.99, '-9.99', '-1'); t('0.0000023432495704937', '-0.0000023432495704937', '-1'); t(NaN, 'NaN', 'NaN'); t('NaN', NaN, 'NaN'); t('NaN', 'NaN', 'NaN'); t('NaN', 4, 'NaN'); t('NaN', '4534534.45435435', 'NaN'); t('NaN', 99999.999, 'NaN'); t(Infinity, '354.345341', 'Infinity'); t(3, '-Infinity', '-0'); t(-Infinity, '-Infinity', 'NaN'); t('-Infinity', -Infinity, 'NaN'); t('Infinity', '-999e999', '-Infinity'); t(1.21123e43, '-Infinity', '-0'); t('-999.0', 'Infinity', '-0'); t('657.342e-45', '-Infinity', '-0'); t('Infinity', 123, 'Infinity'); t(-0, 'Infinity', '-0'); t(100, 100, '1'); t(-999.99, '0.01', '-99999'); t('10', 4, '2.5'); t('03.333', -4, '-0.83325'); t(-1, -0.1, '10'); t('99999', '1', '99999'); t = function (dividend, divisor, expected, sd, rm) { Decimal.precision = sd; Decimal.rounding = rm; T.assertEqual(expected, new Decimal(dividend).div(divisor).valueOf()); } t('999.5', 1, '1000', 3, 0); t('-999.5', 1, '-1000', 3, 0); t('999.5', 1, '999', 3, 1); t('-999.5', 1, '-999', 3, 1); t('999.5', 1, '1000', 3, 2); t('-999.5', 1, '-999', 3, 2); t('999.5', 1, '999', 3, 3); t('-999.5', 1, '-1000', 3, 3); t('999.5', 1, '1000', 3, 4); t('-999.5', 1, '-1000', 3, 4); t('999.5', 1, '999', 3, 5); t('-999.5', 1, '-999', 3, 5); t('999.5', 1, '1000', 3, 6); t('-999.5', 1, '-1000', 3, 6); t('999.4', 1, '999', 3, 6); t('-999.4', 1, '-999', 3, 6); t('999.500001', 1, '1000', 3, 6); t('-999.500001', 1, '-1000', 3, 6); t('999.5', 1, '1000', 3, 7); t('-999.5', 1, '-999', 3, 7); t('999.5', 1, '999', 3, 8); t('-999.5', 1, '-1000', 3, 8); t('-2.8', '3', '-1', 1, 3); t('-3', '-0.0047', '638.297872341', 12, 0); t('15', '-3', '-5', 1, 0); t('3', '0.38', '7.894736842106', 13, 2); t('-2.9', '-2.2', '1.3181818181818182', 17, 4); t('-1.20', '0.00035', '-3428.571428571', 13, 4); t('-6', '-1.0', '6', 1, 1); t('1.1', '-1.5', '-0.7333333', 7, 5); t('-1.05', '-2', '0.525', 4, 2); t('-2', '-1', '2', 13, 0); t('-5', '1', '-5', 16, 6); t('0.000033', '-1', '-0.000033', 11, 1); t('6', '-3', '-2', 20, 6); t('-1.20', '1', '-1.2', 13, 2); t('-1', '0.0019', '-526.315', 6, 1); t('-7', '3', '-2.333333333333', 13, 1); t('2', '4', '0.5', 8, 0); t('33', '-2', '-16.5', 14, 3); t('-2', '-1', '2', 4, 1); t('-10.2', '12', '-0.85', 16, 6); t('-1.0', '10', '-0.1', 10, 0); t('1.3', '-3.0', '-0.434', 3, 3); t('1.4', '6', '0.233333333333333333', 18, 5); t('55', '2', '27.5', 4, 4); t('1', '7', '0.14285714285714286', 17, 5); t('-1.4', '2', '-0.7', 12, 5); t('-5', '3', '-2', 1, 4); t('-1', '2', '-0.5', 15, 0); t('-8', '-3', '2.67', 3, 2); t('-16', '7', '-2.285714285714', 13, 4); t('1', '1', '1', 13, 6); Decimal.toExpNeg = Decimal.toExpPos = 0; t('-9.0201582007891419174890e+493625', '-5.50622769083719199346231074389e-8', '1.638173847369118854685833779858335057671769579218908745636679e+493633', 61, 4); t('5.8729543161021068260124718708021832883057695897e+49274', '-8.708403405379587884587853336e+41461', '-6.7440081065538470526693072631940999905631492068918496007e+7812', 56, 3); t('-1.11303135570566757735452613975119540626335099312445395511e+909913', '-4.9428912981238120390359176251627374079558e-50436', '2.25178198057510227e+960348', 18, 1); t('9.34964786072062858037053820543908584e+34427', '-5.5139174707961944758881146494671658725524731327174937382473e+727', '-1.69564523049899134866471123135148425607621655195972485244321739609622142643026524021192529472e+33700', 93, 4); t('-8.95495805776908286477460208890137140530903524050e+3546735', '-514449923650777303707976731752571405.60601209', '1.740686050494577121230344265740919289154954933388084539546267265149437887923633011167e+3546700', 85, 0); t('-112977.156416947803174690696837418982360160807579018', '-6.7793027141628576643753135768314185053384986437525e+32928', '1.666501131169782697443349597254128378095825062301415158287415940806830463694e-32924', 76, 5); t('-7.519050808224891132821326159698e-555', '0.0417050002083', '-1.80291e-553', 6, 1); t('0.0312143762310912553081058912', '-4.08382620086677699331679658629041009e-90', '-7.643414458839e+87', 13, 1); t('4.0891643182290652875211844988576636684270563255557e-173776', '-4.3512242516716750610555570756791193e-72054', '-9.3978e-101723', 5, 0); t('1.6121785095818917662044501035572e+171567', '5.6108971779838795537551844770788131976757e-524750', '2.8732989724e+696316', 11, 3); t('7.5653760375e+30', '8.15774224e+1590', '9.27386011340805e-1561', 15, 4); t('-8.660566651142957641766979855e-18592', '6.487325740700605731241602360168e-47415', '-1.33499796e+28823', 9, 1); t('-4.500945343043809676875681e-43152', '5.940827660904742303158570004409569371251583570495996069e+867097', '-7.57629340548545e-910250', 15, 0); t('8.96986622064415401423819967094260833389514278486115338442e-7572812', '8.4104122599652535974085220853977252989342871715575506e+4831', '1.066519207785090396984112228095053363096953582614945755253738194960648243775759819978376352442801954e-7577643', 100, 2); t('-6.856960316080e-75', '-2e-97', '3.428e+22', 4, 3); t('-7.24821889609458e-116548', '-1.25771065437743895862578613162692675e-296408', '5.7630257570509453279427403558712890904042059962e+179860', 47, 6); t('1.66634161834784366386855049316805612010518245355860875e-1433178', '-1.2323759671622999856410026493670230698834833365211381e-119', '-1.35213738562656649534995020628832773189172872015634e-1433059', 52, 2); t('-9.89858514790913976013855098325866480343405831726e+1326732', '-3.128944043635047374403186608489765604611130599212469197e+459', '3.1635545442383396285744071213319905e+1326273', 36, 0); t('-8.070e-906304', '-1.5055451435372855159976696184756e-124', '5.36018467107502097209360022333300020062468708142031209526934182877919e-906180', 69, 6); t('-9.046986850521113233994088030748718263e+649192', '7.42739066e+75', '-1.2180572242205330874563272306385885272661826030839207264749e+649117', 59, 3); t('-7.0140966397407758056324106e-567327', '53259.7776732322775987808330561104626988', '-1.31695942907887432785089328517373629792e-567331', 39, 1); t('7.40231507068915012684011850565156286998231535809e-895430', '-8.86406984919e-643', '-8.35092141265738645015908443920311470645480941163030158470835428757522e-894788', 69, 2); t('-4.921794410e+414322', '-1.0785013517e-841504', '4.5635495980064982611184983274230976561881299309270026573671840860243587583442e+1255826', 77, 5); t('601866548.752324072028390640262687694145312', '9.1268385395129583279994237e-1284', '6.594469115966654151749202035640916912881336984e+1291', 46, 2); t('2.867568612241923911789069819170160836469e-1906692', '-7.12441896102389693918811169596243150730e+81791', '-4.0249859362984554655443106786916039152860369641143618688585255330551064941359213504322433e-1988484', 89, 1); t('-5.23144143309771e-1367', '-7.6883670574418716341842245776e+81971', '6.804e-83339', 4, 5); t('-1e+46', '9.71058916684636392105974344694162750232811143394e-47', '-1.029803632733401478090931970815421478665673365628839811617483095659275091488624129e+92', 82, 2); t('7.2e-59409', '5.7831139640342802478088151675935006389840e+703', '1.245003996943076834455034433890469750759315904851845063541633723247163682755452146320767e-60112', 88, 1); t('9.5511191557227891017e-976054', '9189124852', '1.0393937735696344962122e-976063', 23, 6); t('4.23712926488581167975667516493342425898064e+57103', '-0.0001397286766', '-3.0323977640004440432499416980332469984e+57107', 38, 2); t('1.2743888136325381752424465340840098569178e-7', '-18573238529588601.01391', '-6.86142490229874847637478954198611190873400267067557244764e-24', 57, 3); t('-1.104892840718228416873e-7', '3.5597797377667191893695e+934', '-3.10382361300645918144338685515593065286843980322155334919919021986707800416857125298e-942', 84, 6); t('-1.55519573186342035670507252118450593339698096309942436625e-817998', '5.0563859624221211468025641352239672653831983e+64587', '-3.075706133632344533175127773502161481034704186956042445418520782007015e-882586', 70, 5); t('-6.202151355028114221575433171095985096e+308', '6.033804697384754103136626236314', '-1.027900581156749571100486532662322045801648336202116385320823112202169619166115945348630645e+308', 91, 3); t('8.024875460866071e-302608', '5.359320147511614393506518038e-445413', '1.497368181035443540224019658376422e+142805', 34, 2); t('3.55055235944317737144206844338561241970e+384', '-0.0022624534102156295443300961', '-1.56933722630990306246023742223862701e+387', 37, 1); t('8.124983863334591032859756583631905836816939039683944086589e+609557', '-1.60542904153166299378981482239854e+559466', '-5.06094237312596070034955736800076847046972453544295277599851337171871887357766954662496371928334e+50091', 96, 6); t('1.2361212094491178193e+83711', '-6.1097447943101726e+77', '-2.023196141678915138239321117934234676090045505345373146119122780711362684355605637208296539355003037e+83633', 100, 3); t('-9.7913464098919312889521180664170915225195748592237470281501e-2442', '-7.117703009727629530310739342559e-531056', '1.3756328968081815297848119554475753176429302386798137109462696314553328545836837194134940777e+528614', 92, 6); t('-1.8008395847460187443885218251028268177940e-181136', '-1.9315535289572721940531408208e+1701436', '9.32327040254577916615185349472487605397250031648341346028e-1882573', 57, 3); t('-1.69914659289020442692747108811266537843629740471379191228e-750409', '1.99579900340005978891346263731685e+87', '-8.5136157999654481886972931e-750497', 26, 0); t('-3.468594080438267571477376858183887124615200e+92', '5.6257641868735912825310409703621015617e+971497', '-6.165551852549068675875315487455698620448242921611056694146328281821305148315378561e-971406', 82, 5); t('-1.8252099405739206816451704100248812959e+1186', '-3.42243088142742109427052805672e-9', '5.333080502746823979506640819479922185269986904173244526721149958304591733214947e+1194', 79, 4); t('-2.26794496381269349400848879905354658898089516910667e+492', '6.9657557700813802540e-7189957', '-3.25584909760078670021134909504190734019544459726e+7190448', 49, 0); t('-0.46804364341836888128551806365696954134445', '7.987261632972183047981868785502422780e+821', '-5.859876199450382023516232392475110813719370468990469393875819714917792471118581757029002014878e-823', 96, 2); t('-9.96705038725844823301661858980473138e+947', '-7.2408733e+507', '1.3765e+440', 6, 4); t('6.4e-65903', '2725.9585677573990738059898886877', '2.347797973050329194430525714895592743169714777546007978234095454030731491e-65906', 73, 4); t('3.248366411826949431866026704463662e+52511', '-9.2033435415451915214110831e+8071781', '-3.5295503174073259785984985357981547e-8019271', 35, 3); t('-9.98470001351862389956296e+451', '3.7474300286329393632461064424e+815', '-2.6644126607378010385763797854701476440577291827637607081033950365026e-364', 68, 0); t('-1.53740039467703159465920401080173826327989263865383e-74', '-1027.743193807096525634910', '1.49589936857864103759617619966197637279298146868e-77', 48, 4); t('-7.1898403140998064976226699627450254188793061616078584e+4075', '3.312101273050083107245022e+70', '-2.170779128223561156107980514002547628515920675156954075597305599528830244568459314942e+4005', 85, 4); t('4.06e+13901', '-5.85611e-50381', '-6.9329298800739740202967498902855308387308298512152264899395673920059561722713541924588165182e+64281', 92, 3); t('3.78987311925956596100530099233127e+533', '-7.7787839e-446', '-4.8720637672677421479793274528827957285199811245559861869925451972e+978', 65, 5); t('5.71355915176845523331889400e+85', '7.9368447699694051170227763009331626968309196669062001362222e+28146', '7.19877900773216182411356396344316798e-28062', 36, 3); t('-7.6300279510508555176447528888582183176281948759413355783e+924643', '-6.525229144297962820139259674034141343420e-98555', '1.1693118789120709003842725006130814665259894299168791890471624080948019031651507617258471260255226e+1023198', 98, 5); t('7.28439100831730318544400863622338e-975118', '-90382941.9311', '-8.05947544158308297233205000580769151550908738308801809853417304107e-975126', 66, 6); t('5.9080280425535882593423530335827988725154144673935e+150783', '-9.7116925492708374913103514832318668414602235998045246e+240', '-6.0834175017e+150542', 11, 5); t('-8.32876439894620965060923423888278658060936060382855e+5391166', '8.04186747558480860e+491', '-1.035675410497925143157313386715336111549526162006770420515223349892e+5390675', 68, 5); t('6.615091161705197007910219512584837928991296e+289223', '3.671292452338065773949802592091439062162827897496531e-514040', '1.8018426065437446911933669148638e+803263', 32, 2); t('4.22074155824438744041754715460773774e-26794', '-0.392620260033033013334236126522330408072615', '-1.075018787336465097611404243630364449447595646694657386098906315606038505272594760203526802864099342e-26793', 100, 0); t('-4.67699736667236482648690536440818e-535947', '-0.000003272760314495064262408864180258266590034864302365641', '1.4290681006971182312140595347675928317716659547290799132515275441516238979e-535941', 74, 6); t('-0.000084398040461600827616061519', '-1.189305971339233178095314502175250728139881670533927588e-451', '7.09641105783428769600139659965663184560402725e+446', 45, 5); t('5.36563080174153764198593156640406584047160058605498e-827949', '-5.117680469211393e+56', '-1.048449748674588988737499894175e-828005', 31, 4); t('85.589843957916002336981173213', '0.0000578255253220352633511490632580338770863578897775', '1.4801394968962e+6', 15, 1); t('-351607.1187872102002591263170005488', '-9.43211176998759831430041388795767495627847463971963992990e+9816897', '3.7277666694536265675007568840266918599145597645718155579541605e-9816893', 62, 1); t('5.54766258186312012212070335772068830425136308583014956e+69623', '6747132.4960288947760609757117734740909355201', '8.222252319971874031e+69616', 19, 3); t('-7.40794403e-1867427', '1.07829970890779e-80', '-6.870023212288082e-1867347', 16, 1); t('2.8138856089460929272361416217404739394197772e-5864', '4.120358854405098750175445168459012485500020673033832e+13388', '6.829224609739396965225736675346830773941251044978533929261416840376667913341292696644e-19253', 85, 2); t('1.25611e-7382', '5.22783672860544552165472229850258202818243975e+561', '2.402733798335500653391738916406216392904413019e-7944', 47, 1); t('-4.298240874909906897e-28', '-4.25064103499e+369', '1.01119827327880178894776703201179105690352e-397', 42, 5); t('-3.3734578706259646249822280062e-9836', '2.04159630139282492575938762375186e+823662', '-1.6523628439e-833498', 11, 0); t('-1.4929903958127657150797046e-31761', '-9.34820994328909660952679308089769623534838087e-504367', '1.597086934151e+472605', 13, 1); t('-6.17416836518150351171259742611706e-97', '-9.88775533288148875e+37187', '6.244256817975114615221762745361996320156750169699731652e-37285', 55, 3); t('-9e-296674', '-9.429077635688888467419778561698443234851940034555559e-7593', '9.54494209056e-289082', 12, 0); t('2.6439727192e+992732', '-2.01160292191790849717605363585281e+3688', '-1.3143611447328658640835497026217432813435045010572027729281904104297711381081829e+989044', 80, 0); t('-4.53845718907359787719378104959276674317e-49650', '5.08475248507297756177418035662893e+69', '-8.9256206715e-49720', 11, 2); t('-5.693328123037558e-50195', '2.7199658e+64302', '-2.09316165778171107886724163958238005e-114497', 36, 3); t('4.978838741243446e+7675146', '-2.79566412024916162230460222172486e-50', '-1.7809144901e+7675196', 11, 2); t('-1.88784650527777086088949271343154160454393e-1404757', '-0.0000502787620604091848652480080339383261497', '3.75475932165861872458913296058527751903692013400759286e-1404753', 54, 5); t('-5658507039746715423.167542720210950494520611683594823141492', '5.7725075471049662533145488840960912984928824220440e+302000', '-9.8025112891962792177142779236158942424695123056e-301983', 47, 5); t('-5.67859887941334558531160e+4269739', '9.0616208329978377544345050634619764178276772330038011031e-903', '-6.266648079927116266831922933734264307785369125e+4270641', 46, 2); t('-5.153438159204456445e+441963', '-3.910302066e-1945068', '1.3179130594573499747116467395693005779160182148444794852838358702900268473e+2387031', 74, 5); t('6.50766000334324292674204104205256939890391290244703e-570636', '-6.13825054376718197194260486288608e-36', '-1.06e-570600', 3, 5); t('0.0003561032581306', '4.77053286770261875972371870e+87', '7.46464321714423724166117282096633e-92', 33, 3); t('423561.59245453820356744150114646992866121611599555557', '-7.96e+8386897', '-5.32112553334846989406333544153856694298010195974316042713567839195979899497e-8386893', 75, 4); t('-5.1558130542057773853e+483', '6.2', '-8.315827506783511911774193548387096774193548387e+482', 46, 6); t('9.80010135321953141397e-9479241', '1.48559844e+2465', '6.59673643250428521853455904275182195264017643960369263715705032646641712951717962224031414573e-9481706', 93, 6); t('2.921469205835105144020568210975511896e+994', '-2.850750914899798e+8528563', '-1.02480689932104883493349188185159896705506939026865209759783571883322480129714412160052799e-8527569', 90, 5); t('6.02475139808495394997772158116702e-21', '2.37617147374471492952579010471604836012667268737402989000675e-7788231', '2.53548679657797536354423e+7788210', 24, 2); t('87513.32883116404188225508498894548197167557912759240052210', '3.7772896063968138047935970431e-5045', '2.3168286774453519584522693858683014239766232911352581157877601882e+5049', 65, 3); t('5.7718214554244629387781323483e-928', '-8.80697537569701968499916566682238518251640403050597553611e+765307', '-6.5536931911401621494952381236078093131919781294446e-766236', 50, 3); t('-7.31783566924948556509724994049448360187e+43', '4.193922413377111528576823606882686875e+132239', '-1.7448667256953e-132196', 15, 2); t('1.5763909385752914105437373419998105285263445570305756313e-939065', '5.2696546007e-743', '2.99145e-938323', 6, 5); t('-7.3695076326257297560e+939', '-7.566e+873913', '9.74029557576755188474755e-872975', 24, 4); t('-7.615009147460135e-2238951', '5.098853922503091887250195828406763584e+2029', '-1.493474663757739247e-2240980', 19, 0); t('4.7118761952579331686862200927113271192e+972298', '-8.1045590739e+3987', '-5.81385878280794397787160794e+968310', 27, 0); t('3.05259816713008214309752e-34', '9.072438477569600795244081994373265659e+3600595', '3.3646942601784797867441e-3600630', 23, 5); t('3.5933388527257947e-69', '7.1641505002922391424671237937068824e+93521', '5.0157221747075465058e-93591', 20, 2); t('9.39168343132314935e+371121', '5.3947954122933792607331297865723793172399569985e-387897', '1.74087851597149903151101989151427616342421252127054094524491742593e+759018', 66, 1); t('6.8421850057907933405544695887211983810452221801e+684439', '9.162088e-434522', '7.46793198863708069662119550556728813458812246738952954829e+1118960', 57, 2); t('2.54275263810343519553437544378832436e-303', '-0.08770599033318', '-2.89917784229e-302', 12, 2); t('31981.165449494238805174660659817376468695645961', '2.23651670491568483146967340797091924533e-989818', '1.429954239966e+989822', 13, 3); t('-4.3304985248849022107e+84598', '721382.36921875', '-6.00305567430874344247379626761969984667e+84592', 39, 3); t('-5.69941467419121688624215027573910521249071692951357140749241e+2238', '1.47308952694108000853902e-188201', '-3.869021244096577970516432071542636232690279162375e+190439', 49, 3); t('-807045896.37201888946402216019903869620386', '-9.08231770105120e+35', '8.88590250788749971057617554208065127368874350003175872528293248627303374010246161422038e-28', 87, 4); t('-3729', '1.0546094247819167974007e+3449', '-4e-3446', 1, 5); t('-5.47050611316e-521048', '1.682277204e+919126', '-3.25184583144360315542859843686e-1440174', 30, 4); t('-4.3283158011e-852855', '8.1631725039603251121269990518659693605483302e-6995', '-5.30224713369726996773806997000061981936102436057537e-845861', 51, 2); t('3.830790634e+338750', '-1972.99790017035104904780622921', '-1.9416090780782102488343413702801e+338747', 32, 6); t('-675363513.402269898572629297102147534327342971037825167', '2.3e+4480635', '-2.936363101748999559011431726531076236205839e-4480627', 44, 6); t('-6.9843101214254330530310114e+875601', '1.78702225591614033015555756095728421e-37748', '-3.9083509443170505610410562761111795229709958845170193696171800343480046642337394354637126600389418e+913349', 98, 2); t('6.16537500715193614011018728455679e-885', '7.872343857695937901e-745', '7.831689162211476312583530674208619972304918867871e-141', 49, 2); t('3.727006137610643885052534419530511e+78', '-1.425386648485847138744055919504080772e-886', '-2.61473344202413429907946769817909664196987836016435350482399200706130745727594349802635891586e+964', 93, 4); t('7.43959327574e+5181', '-7.9074313981397299324949e-52', '-9.4083563943282623716203312085417443848809831081928646668382343690834056267e+5232', 74, 6); t('-3.4490340985404845139552633843307403193543e-6651', '7.2842692393679412330016944012164504254989382282e-426825', '-4.7349074906514005968e+420173', 20, 6); t('-3.12646845651434317784659897194601292447905599816047557896e+83609', '-4.44821508711659247554239e+84531', '7.028591e-923', 8, 1); t('-4.9158931676508508586366306659252842802577412066912290e+6841', '-9.97885279829e-4348', '4.92631093675742970055851625020542497534673412306023848256715519495285e+11188', 69, 6); t('4.5204228951407159990066208e-3745', '-0.004', '-1.1301057237851789997516552e-3742', 69, 0); t('-3.09307e+5347', '-0.8984736838504547635274923785', '3.442582744042642266786782278260624614507789e+5347', 43, 3); t('1.278957083641480297045115728536640377e-882', '-9.1829578959430558e-90519', '-1.3927506780865362298960771170837187909688134215939e+89636', 50, 4); t('-1.280e-30680', '-7.809867371408833685193380117868583027e+33846', '1.638952288339691587843478189801175e-64527', 34, 0); t('-4.796625599778919175150221338154194105391e-3693', '1.0644936863715949e-3575', '-4.5060160160541399e-118', 17, 6); t('-2.338716751466980568104931647443388782971007e-594', '-8.76079791822909184588455192060496995121228203764073135e-7', '2.6695248233048262067724344845187321954535e-588', 41, 5); t('-2.88857445130347e+34', '-4.5727677050043269726429416e+57466', '6.3169061663514715799083365164448167754425592465222489e-57433', 53, 0); t('9.0464589776483057165017421e-30', '6.06745997e+141768', '1.490979589874130758624805908690650990813211743364826847e-141798', 56, 4); t('4.0891e+8682457', '-0.285100211208484985423775082', '-1.43426761511929129076674694508290636841735067147441019762532785721934538893495633683716943287921582e+8682458', 99, 2); t('-8.36533512511e+2210', '-2.2074165483312369355092715221e+9854', '3.7896495482169086724607338870566377482914270703864737066601275861373795191e-7644', 75, 5); t('5.52706150135816541190537725676638784816e-39', '5.506157558676409241502564869727746514208939474698e+18904', '1.00379646649391942543124561396333984453880182681374708614940506997100647153719275030013e-18943', 87, 5); t('-1.288279714202288615454e-596927', '-3.77546319534770573354581697206296e-42949', '3.412242809808778910720913252239877519936414468601131742686648528257078142609085752972025220629296596e-553979', 100, 5); t('-6.153052379002130168510557374994653393268', '1.7358896156255864099559044599825626297210e+3157200', '-3.5446103966608902581464527977e-3157200', 29, 5); t('3.42374045880379367998282136916009048354975475e-459', '-3.71961470952892229383923198866553177381531730879349520967e+9323392', '-9.204556724740449869859132948088048642326875592013709820825989488772e-9323852', 67, 5); t('-8.029527535353e-8923', '-382173906.1', '2.10101406903798029867638836161765885669398400614667187504249129058997259467788e-8931', 78, 3); t('7.54405949614753081e+2945477', '-1.2969572371386e-39', '-5.81673726790834124060476166960328240382299131951266748135316067254764231735799071285353603929078e+2945516', 96, 1); t('-52465', '6.04671115345965326980458938153601846588748169e-44', '-8.67661753116517096859514986859114860862090070653645935252959574e+47', 63, 4); t('1.4633750786e+28385', '6.4e-67', '2.2865235603125e+28451', 20, 4); t('7.4803238e+6937754', '-398287514481567281059186496112.143318', '-1.87812159006209291405314267025131725835563091083703200385262e+6937725', 60, 6); t('-3.99879850022268386238702401202296926182374685e-101020', '4.941987958200394155523261928737367666185011455660081e+1521', '-8.09147762812200559345178485001850079766691e-102542', 42, 1); t('-6803066.78655613559643867402367500170440266090475412341', '-4.35752016541514522894124887798932462e-9', '1.561224395597949169169135e+15', 25, 4); t('4002943.595339596145529525507585154374501889180', '7.48365108818012585828282380463973422306674153125104052e-5682614', '5.3489179923e+5682619', 11, 4); t('3.76872899581827988357416381361938138263757177508e-8', '-1.3878956626098432e-4521', '-2.715426740891632926325292842225052328752037516453023854502281226161793716837461e+4513', 79, 3); t('-1.8143315369896313220192384990961747995084538536e-652154', '-1.64972e+37', '1.099781500490768931709161857221937540618076918264917683000751642703004146158135926096549717527822904e-652191', 100, 0); t('1.077950051217448803307899727500419929851e+67383', '9.63133018252238196604554120627877300948e-5273897', '1.119212020343321654951674321950063587369212979650466228152527216933560442214435806e+5341279', 83, 1); t('-4.9692553578428e+924108', '2.1462368e+32185', '-2.3153341503802376326787426e+891923', 26, 6); t('5.930990738383053010721102273e-97036', '-3.65966511964763315813782962456128293763264222893735645e+500', '-1.6206375568467619650484357428145577548720152013649725255302838490585441e-97536', 73, 0); t('4e-75671', '-1.70839225333645877614084793215132655045157016180043878649e-12843', '-2.3413826609129567713111285198617587201274761608761376874e-62828', 56, 1); t('6.91439488419339340315975001e+5596001', '-5.16903704616137e+77', '-1.33765628345e+5595924', 12, 1); t('-3.7272665275459591457414082845e+890800', '6.572249044180767e+314787', '-5.6712192470036931497313123e+576012', 26, 5); t('-5.7045884550662551247342877917788744897456312e-51697', '-3.44612644750133357600866e+9136468', '1.65536248944157397260819252517234149348139815239687213295268100601194e-9188165', 69, 1); t('-5.798080270240466658842194604602234815273651577331e-604', '0.000005507441779976069848143514575', '-1.05277195871976328938e-598', 21, 1); t('-1.12716558087499949577479980549898647746137202857e-42550', '-3e+6', '3.75721860291666498591599935166328825820457342856666666666666666667e-42557', 66, 6); t('9.029304e-44495', '-3.64145555513779926589009748930107e-983355', '-2.479586490424243225977952663944442587563972524447300319836489006379990970201351934707743567069631277e+938860', 100, 3); t('-4.520055620360621304275037267801651847705e+3563240', '-1.756992768930296764206837935869004010161438300752191e+31082', '2.572609119565443404701767686555306e+3532158', 34, 5); t('-6.511633724726488e-908197', '8.741385376254644142100e+9923', '-7.449201065e-918121', 10, 3); t('-4.727173765422559931e+2550', '-5.0e-7235', '9.454347530845119862e+9784', 87, 6); t('1.70316439e-9459', '-7.8361e+58', '-2.173484756447722719209811002922372098365258227945023672490141779711846454231058817524e-9518', 85, 4); t('-5.406631153924624319629205640970181e+2086152', '3.480623868294410918927077008146482778988703493268074099466e-189433', '-1.55335116878745163354434679883585669329899340343081904982491891350342123010900374959249020654229e+2275585', 96, 1); t('-9.7492472756056798812336104410110379537907097266e+46638', '7.75465e-1490378', '-1.2572130625631949709185599e+1537016', 26, 0); t('-3.1908288340733e-2109630', '-8.088574102565401236091654734238720e-89', '3.9448594939141e-2109542', 14, 5); t('4.73970296075144109211823587827902601864e+995', '9.0e+70025', '5.2663366230571e-69031', 14, 1); t('-1.8152795e-62017', '-0.0000180100506137', '1.007925818164631713535804587054268307128e-62012', 40, 4); t('-2.99866476344257805037744687194745964863e+3924687', '9.10646106540838364998613834e-20', '-3.29289802251858799226153509010269776429660641640999375e+3924706', 54, 3); t('7.18895376979e+443864', '-2.96156741318470092385755745122158310400744307157681974007161e+125453', '-2.4274152051326795744379402883333820009191903153566464579425606259197487511e+318411', 74, 3); t('-7110585455931675754137078581369901739.4931396', '-7.18603961126806198e+4805', '9.894998971035e-4770', 13, 4); t('5.41147077742840731903379861397587833933128736130e+650796', '5.508976354152810651962713290752845896831e-59274', '9.82300599883515369313243246351436879284328663208903699032e+710069', 57, 6); t('-2.36680800333145618131527e+5696847', '-1.291231267094664e-67', '1.83298535564190179e+5696914', 18, 3); t('9.45737237992012431716214361370012434470559418118050763503e-5773252', '-4.821896580749656394283744178082087e-41286', '-1.961338701803885270803274517454726731856417298e-5731966', 46, 2); t('4.3048259706272995008493754e-75086', '8.83757752624666508015471400935746193366955380200151811e-5510566', '4.87104747635019249417585435907066331197959e+5435479', 42, 0); t('6.02391563857731888562808414061253329299057097272948390377', '-0.00000859431905432706316128773457656901972898376', '-7.0091831598274223499618905455260634629806935712003129886689780108271e+5', 68, 1); t('5.155706593542208005e+69', '-3.752836823906004493059531004405347243836788044737e-44000', '-1.37381581866276755530952503327693855569871767143331967690218722410662644294938506519268901862e+44069', 93, 2); t('-9220750598.310382412855687591895656971256794', '6.208189361093807955850040654218e-48438', '-1.4852560162059550267737769309184427579439118150391115871709338604990312946561e+48447', 78, 6); t('-4.566238640798811448714676926894105655e+575', '2.880e+191881', '-1.58549952805514286413704059961600890798611111111111111111111111111111111e-191306', 72, 6); t('8.91604e+170', '-6.264368339072541e-53173', '-1.423294339891905e+53343', 16, 4); t('8.3087090877835785554965e+35979', '1.3611234824345e+2711755', '6.10430221432e-2675776', 12, 2); t('-0.902795617323001343413834248792', '-1.9622832254556375292432978323544368070474621301919288930e-7605547', '4.60074063525347791647263727570223375233476678038450676053498613441846299e+7605546', 72, 5); t('5.130267430039513e+89942', '3.306068983128470569399947418640252356869061293022225007324e+38394', '1.55177265090967277132534306390671014600343477066067674e+51548', 54, 6); t('-5.42709593652831824838271990398766047426230233281511774e+441', '6.060905321454542443148625e-79491', '-8.95426615115954695687550461846409521895630824450275734448571400865841848473595221582490459e+79931', 90, 3); t('-2.67313108587637342e+66', '-4.2978091362412049644038575659830e-8788943', '6.2197529046491139763897883718412103051148839554074761661717609361495199609413826e+8789008', 80, 2); t('-5.062479752314056826234932702569182e+978760', '-9.0280152787587150771', '5.60752235790423930474788883129459576987903407906072606460557140943628831849657297853921988860216893e+978759', 99, 2); t('-9.682208878743727894539541638693047e-8149861', '2.68789960374616143221198636526210862719600140e-805', '-3.602146771125493149886358094423260127318575198065409723915337473739698227e-8149056', 74, 1); t('-7.74270044930678819329480422147363893912745e+46050', '-1e+850', '7.742700449306788193294804221473638939e+45200', 37, 4); t('3.837820335697429248772856e-24', '-9.455691040938667713520206049214946596676072547630808599e+18858', '-4.0587412586573348e-18883', 17, 1); t('-8.9043692e+441', '4.922502215686303689613411049123590850286314e+575', '-1.808911161405853749472468658351477252530084855738408407062362524906222612956452727322923633285164153e-134', 100, 4); t('9.983855174767877564750840e-16', '4.442077176133267221847948159903169825858e+4843459', '2.24756454669673458228e-4843475', 21, 5); t('9.1600446121e+70', '-8.8825588136102715227205181620111211101906144801558076662e-70392', '-1.03123939896e+70462', 12, 0); t('-5.455091346996779943893118119386347518740324439893518e-378', '8.45021012932221140260940220693e+149', '-6.4555688716753023998259305299997301767155121789813739345022368676343759e-528', 71, 6); t('4.92731241140976103504385528e-85', '-7.519758995215778653646e-775817', '-6.5524871402722027658916864184976681654878155377984377065047487e+775731', 62, 6); t('-8.923714924347837557972462364680155791045288887882610e+6873', '9.56049787920712725220195633365229138986759e+45', '-9.333943730855050949857016361651494295053372418814941087257474684725684596833663177979308872e+6827', 91, 0); t('9.120994782870624984584405564109022983116068171157228e+22644', '-3.928918196021315074729587563484036421484733019e+3670', '-2.32150284831767517357787307199788401065025409196970414726140444186928253286397518539667412e+18974', 90, 4); t('5.260714966994821283e+7974', '2.2913553636054275189474093725394183782817319448922e-9815', '2.2958965905302146301937347743405869476376213710869775730184386683339649366593429618e+17789', 83, 3); t('-4.4740423949e-72435', '-1.99011935060167359745521083763866204854294900538e+336309', '2.2481276781452132166604677212513978692998883937953944582350859781573893143723276447e-408744', 83, 0); t('5.92364961196923e+621', '-3.07947537997234899379967457947260721873267015441e+64', '-1.92359050846589954327755584024104053274424702849524072478922488187e+557', 67, 3); t('7.4307644562561968240753606201216532907e+101310', '-3.054126964798505532855206526040009849562e-582', '-2.43302408246359126563744935804440189495732397304842343038283559694e+101892', 66, 6); t('-3.6515736e-67', '4.031148294860998414946968992580399564234775910e+722', '-9.0583956056767024362785126665230736574031747156e-790', 47, 1); t('5.12232095778e+2370495', '-6.760344688038305e-44250', '-7.57701151960992474378716794694436925607132532879604376221126604539e+2414744', 66, 3); t('-2.6171943577487375211769996917725770478183344962847645e+962716', '5.73323562459228e-723128', '-4.5649516767154668110122243660466465821745959913049747153161639490316092433928472494475807769621e+1685843', 95, 2); t('8.821270839203e-679', '5.07429888713154541185707012184700541507e-9249', '1.7e+8570', 2, 1); t('2.29412204114808702060785497978943701643961929542569413e-6510', '-9.622814515785763564752210878e+32', '-2.3840447484307e-6543', 14, 0); t('122852209.33596955', '70.15723957573339050956281378262617021489887806918', '1.7510981058e+6', 11, 1); t('-75049944334321968158467581412161257581486904.997273845949678', '-4.082759261570570772444092418194591442e+74', '1.83821625342297260377506424790352766382547125503984388883015500358689104592368594475582683259678766e-31', 99, 6); t('-4.5117823143987985011645809838922723', '-6.00323433799578982350060902993223313807644382e+4086', '7.515585866509885184268837828897735923269261979645976910830709421410102482169159766563263e-4087', 88, 3); t('-7.4593069795167803409689743730979615453017626076532e-14', '5.5663346748483061802960115581505188409329657206216e-7', '-1.340075186858947079885e-7', 23, 1); t('-5.98823559467477311715849890335487330180e+11528', '-0.003290162508620091707157720499945878173131108817', '1.820042499112381186000767125637133671860118544803644749917362074e+11531', 64, 5); t('-8.26599479873320138912892557999e+28004', '8.900215927286791832913039917332244601e-6874', '-9.2874092789039432437557331596139479758721345609181199154644688864812475e+34877', 71, 0); t('-1.02023863943303515301017615619e+4322', '1.10816762232827920665124979716e+93', '-9.20653716e+4228', 10, 0); t('-2.86670168042560191292495661545255583', '-6.110204394707469252122e+5003425', '4.69166249644394664609668567108779207194760268516395373342e-5003426', 57, 5); t('-3.2754199252801842e+61139', '734417820.90652525258577181729193558978088046760353', '-4.45988622830146565668192617213406602125787940156794498910758882e+61130', 63, 2); t('-4.8114404362823181773e-460582', '7.076937099607761048243002399544008585999255767779024301e+4204', '-6.79876105801334884e-464787', 18, 3); t('-6.55206394837274730440426799270292389479407549e+19106', '-2.8756448116862e+42', '2.278467744606746127818328395006356350085655193447054475691515164242056420749349939129807249261e+19064', 94, 1); t('-3.74215532185692341306475613849903028366059824562097819775e-36588', '-7.799292840730172469140913e-91', '4.799e-36498', 4, 2); t('7.403316510551448450015823234611e+84', '9.427386319491878362336646183983738886083245526967593306113e-959113', '7.8529894285168912383267263952350231825317953199580227385482034e+959196', 62, 2); t('-6.495564848717913850474651218168419900484433726760148327e+9447', '-8.28504059637611534949554557191770292978508196249942660685e+23213', '7.8401123e-13767', 8, 4); t('-2.47788321661263918678937483451126081321445035903756456684e-83587', '0.0000211725639826162452333210075163338973686809659349232', '-1.17032741931827797153160037796004944997696446802029767333159344823471506e-83582', 72, 4); t('9.695e-11', '8.40163469685e-2967682', '1.15394210172395588925455912183e+2967671', 30, 6); t('-132.33407303466944376', '1.466164851817703355310499908522445029294180477755498710e-9277', '-1e+9279', 1, 0); t('8.64e+4', '960.48225415038070623990188582991488335939999902826672627897', '8.99548113738211054297392811171307844646e+1', 39, 1); t('5.76902324039256465315903434891205015e-14', '-2.06583234799685176901e-8', '-2.7925902341429288008595625270227784057263759253579132018454586176243668723938326054166325985390393e-6', 98, 2); t('-8.9822947743878120795004898246535294114e+40578', '-7325362666.571509696', '1.226191136635122599643895425505792565835728664039384330091318557180407984887976e+40569', 79, 2); t('7.411696574592452492944841579170107451491527089716e+302976', '4.60e-64', '1.611238385780967933248878604167414663367723280373043478260869565217391e+303040', 70, 5); t('-6.2805e+17', '-8.14519184598728277263411977061042382499210282e+702', '7.7106839455157577783689155766117434339899018121092010961599488908636077855522951995e-686', 83, 6); t('-2.8398440377370809032542023717780905984097412510e-27869', '-1.93622897192071928506033735794847981683038501244695388206506e+5016185', '1.466688123626197339169243462412413297918925848556589849020950423396516735218e-5044054', 76, 2); t('1.0458363877686671976882334204321e-758448', '19933633.4230586928695660055656', '5.2465918559477054268771147104906644541657992619773953716966e-758456', 59, 0); t('-8.961720064943983913809726185290897467761236027926e-34', '-8.54549052659300653125164e-1656624', '1.0487075068488693931384182600836645475478951778840793459989591994005165139e+1656590', 74, 6); t('4.30e+906951', '40771588.456183336193414605924790075225845780200889', '1.05465599031569513067326760432739256111800229582599411083097e+906944', 60, 1); t('-4.31084416090164708660205e-7129', '4.860738807588668796955241690436591422767347415963e-5582619', '-8.868701511324746031924325113140342087764175889291559606764508669018310708707116574358e+5575489', 85, 4); t('-8.29149114e+780586', '0.00008544744301211095214406291719339499873664232', '-9.7036152841048734444845633309028372074266373e+780590', 44, 0); t('9.77129327906576217122091545215586069348608483973944671214e-7', '1.8079e+28684', '5.404775307852072665092602163922706285461632191901900941501189225068e-28691', 67, 4); t('-8.20793963126552000537116838363086168572853745991121568541006e-98', '9.64641262763382542567710e-51', '-8.508800056668165397129310597666269931308661076836174672419479896e-48', 64, 2); t('-3.6176843981400574677912736582474339026e-48453', '3.02183549648586787061e-5539', '-1.1971811180148985936879986164134867347294384304e-42914', 47, 0); t('-5.968397680044276695651584e+9096', '-4.614517534700289e+64', '1.293e+9032', 4, 6); t('-21', '-3.70850481417723207e-614', '5.662659495470833e+614', 16, 0); t('-9.58661405316543228368760763975257686567373339e-7358831', '-2.313910171251627663e+3318', '4.1430363945286144463766335205684117955699333404499322374415e-7362149', 59, 1); t('9.65292758714380486538411461404177406107749655e+1440', '6.913227056152443861643199181616e-7', '1.3962983580227062849823277930997746828646307420760691273736897836246753675296903744375626149e+1447', 92, 3); t('8.28174704078297432040643187958300524608847208333945719e+62', '-1.6483284829858043084e-818', '-5.02433048161693276182981867844595002e+880', 36, 2); t('8.007467117669440167e+153', '4.898987298575040484146486444e-3508', '1.6345147741041413902344373075023182759224927102422822243087e+3661', 59, 3); t('-1.7319482835320547453650748664417271887834e+76106', '9.07e+8', '-1.90953504248297105332422807766452832280418963616317530319735392e+76097', 63, 0); t('-0.0000071078844445129430615963499634064247374302210295295', '7.5313362575336085260948518769569382108628333091694834619e-8632', '-9.437746770903920413267641328108432493433838e+8625', 43, 5); t('-6.1022385943659518760557754527900393e-3645', '3.03803883650519539927744887222990463938825e-9462604', '-2.00861112143834714e+9458959', 18, 6); t('-6.9559158998e+448800', '-2.83723925006274622872827466006593836684867e+631', '2.45164939814158014559493e+448169', 24, 1); t('-1.86525869429085843675029030328801229562176172716503e+4891', '-2225.25499400768849598889728', '8.38222450601728103256212833080730582971587606623242284309192267e+4887', 63, 4); t('-1.906282980853706848014890041641367947435380267110901137e-3574933', '1.393506253039343502489912911533790314655218002047561960911e+5053282', '-1.36797590731721379975696052094740594e-8628215', 36, 1); t('-7.942417661436444666155e+243', '7.9066254470361738759260423817051935299974117e-718604', '-1.0045268635323667224715069595144811241329305690943480061913796102858899724016410305300273325e+718847', 92, 4); t('-9.4258441909533543e+3824', '7.5311536707110947031690119091143449064693815063e+7969', '-1.25158038238029501255670509975896601916114366217107847634e-4145', 57, 4); t('2.67526716565508e-5542754', '598.5082971777964923719713', '4.4698915257650120185982682961161925623265030562587694578125e-5542757', 59, 3); t('7.357388541446e+903', '-8.70e-80439', '-8.4567684384436781609195402298850574712643678160919e+81341', 50, 2); t('6', '5.069e-636', '1.1836654172420595778260011836654172421e+636', 38, 0); t('-4.5006987760521270831425994465786984664029797647500e-2740', '-5.8530498514e-6525', '7.68949332453677635e+3784', 18, 3); t('5.610359611286545027530565260019970209914123141279299572e+919', '-7.29792650493826357380686644e+915', '-7.68760771637012473609298163803943493633238634644086242284276111447734152268959520000822891579e+3', 94, 0); t('9.00460498005390008542e-158', '-9.8366977177e-2228489', '-9.154093414755599067868670651404132249601089111649809338330929363778511792745276829e+2228330', 82, 3); t('-4.31679605994773674e-200', '-6.2903952146452115088e-1380', '6.8625196234052697e+1179', 17, 0); t('-3.24019021513028894806e-7925', '-9.896685402e-420154', '3.274015575432443101579758592390992120980021832162105136299047126162250822651743416e+412228', 82, 3); t('-8.93283097346249e+596', '-206.523149385868409472', '4.325341251102250290661334596938869666714176248e+594', 47, 1); t('1.706099938516851624077006505602294759546662998e-6526', '8.173763490727923844908558949e-8', '2.08728811452912854602428498444772623223702284906999212887528020533162563531780103382e-6519', 84, 1); t('-9.1420418890725205738446381441692606915744140036041779681e+2049857', '-7028.51299481467620386544270009618145', '1.300707830492326305594803888902470033688553715e+2049854', 46, 4); t('-97844933.5221767675567896378267842185851320254998283854279', '-3.984129207696201e+16493', '2.4558674787245421182755980924171950909759385497886788661291e-16486', 60, 2); t('-9.8085e-422015', '2.753411590324229807865787348169528242e+91', '-3.5623079507866071e-422106', 17, 0); t('-7.2082319041935610025852720095088945984474220489692e+760057', '-6.5127446850e+764', '1.10678865099616000110178923888045744855533547588610868445244449191854e+759293', 70, 5); t('9.4949511094413271181353095e-7', '-1.24729106197516e+6702', '-7.612458229601600865603423417703e-6709', 31, 3); t('5.830e+9', '5.3982762998061964186554130446166827650082856620307e+99', '1.0799743614845e-90', 14, 0); t('2.86615622875847212162366436370915972265965884e-5476172', '-8.40255e-3962269', '-3.41105524960693137395631607513095396357017672016233167312304002951484965873455082e-1513904', 81, 4); t('-3.269001223052524569046431792699991008948195216420357774e-1055', '6.157009595957380488387716880092084e+1410', '-5.30939764199638736845678477540631651720812563006691070214554660430398502501459003e-2466', 81, 2); t('2.0576609123471778786976374890818605197262967111915944874206e-7929618', '3.06513502427732802e+61576', '6.713116701383541863881278061804986519025581619685243593454921929406481357691445292070279e-7991195', 88, 2); t('-6.85006782303648011e+174', '-2.7778230253422225241763545329403653828444e+56', '2.465984247571914613320915578953410428134545546025707559e+118', 58, 3); t('-9.52136e-5293', '5.59831195288791076586059401808341296063420272874517134177e-29', '-1.70075552776017953077524755677982633471486048609444011953018554104509035575938786360609389e-5264', 92, 0); t('-3e+60', '-53399419.8569659', '5.6180385630325402341196339417374033872626693292561486830335778243264266518716597e+52', 80, 4); t('9.39182367043563579687809217392347e+6340', '-4.250798904654189760777762103e-30', '-2.20942e+6370', 6, 2); t('5.231864e-4086', '-3.28882441273043192689015188108526433185e+69', '-1.5908006458929277793631053189e-4155', 29, 6); t('7.940389593197326135731489e-811', '-0.00003654997953972994164737553239538850432513732114022407000', '-2.1724e-806', 5, 1); t('-4.3228e-1116', '8.864865600e+73676', '-4.87632886391419177296946272936162732123090506865665284310683740089641e-74793', 70, 1); t('-7.4069871103057949618107450715592133674212655227878996e-29192', '6.8e+70', '-1.089262810339087494383933098758707848150186e-29262', 43, 4); t('4.0625650056253826300522320976800667101600873578330069374116e-192152', '-2.187469292246038738933083932611541230120e+823', '-1.8571986450397402047180017019e-192975', 29, 4); t('0.398403625460754165392379235799719286513099098812226095', '1.928598171255202747846347676206686401776333632651588679809e+245', '2.06576793133355719719522812910771e-246', 33, 3); t('8.45165895812645331905668372378472054458248243354e+7729', '-1.0808170932433517e-9', '-7.819694017573718633260261936900325520474069230490279124e+7738', 55, 0); t('0.04038302045383689737537715305', '-1.32939446599768226497472436070147847456299779152729975e+7854', '-3.03770035807470430831018e-7856', 24, 2); t('-9.13633591654216316034e+614', '-8.00626', '1.14114904044362325984167389018093341959916365444040038669740927724055926237718984894320194447844562e+614', 99, 4); t('8e+28', '8.703838751073686338701653179112604871e-47614', '9.1913467480232646270448834541777807310648243266524730865928427e+47641', 62, 0); t('-6.434512167015392179622e-5531245', '7.408522842627232539e+6763987', '-8.6852835628614546067092282202348002625881186498390751169432899715675788304629e-12295233', 77, 1); t('6.0902487774260370428642976805816787645545214e-6148964', '7.5854119021155769446167801709686445998651364641091e+4694042', '8.0288965925e-10843007', 11, 1); t('0.831725477620089540637251608898947983', '-7.46450893627041736511113807836155914e-8335', '-1.114240045421735e+8334', 16, 5); t('-4.09008155574639725039819291788738e+13271', '8.9971609112347516886481809085842319543', '-4.5e+13270', 2, 6); t('-3.2120904155341355747476839359766307e-9', '-7.8836687595691879463347598866117461e+1176', '4.07435993760557732e-1186', 18, 1); t('-5.1752466278763480562829198898656891176023042534294070243e-8246', '1.9377683998247856651135e+326222', '-2.67072506e-334468', 9, 6); t('-466866.110860556329593288994009716567594004453227', '-8.853628717569284701e+75', '5.2731611608480896934533923886716855438675844611536944119677243703e-71', 65, 2); t('2.3265655965468872571645946973229428895228525e-5966882', '-6.82123278223710542769086195351367924671468484078e-795', '-3.41076997490160723531099556292e-5966088', 30, 5); t('-6.515253415e-1689939', '-4.9409375880627692779120032067933438865277266139028064942566e-698062', '1.31862694e-991877', 10, 3); t('-305865320.7641477', '7.22301542136e-77', '-4.23459321240874815010765995510689114118693492253208681442304908334041092e+84', 72, 2); t('7.50585975540953514e-58849', '6.529777913039545664460982387159988245322879e+895268', '1.149481629e-954117', 10, 5); t('6.473006748046229360908291331313309523793e-5755841', '8.02336037096096949319672589791582590501057e-964042', '8.0677e-4791800', 6, 3); t('9.54840299023736708149984236017234055477610043557437948e-272', '1e+705', '9.54840299023736708149984236017234055477610043557437948e-977', 88, 1); t('2.3026675461e-906200', '8.43757563441351707e-93124', '2.7290629985091148594510005022879253829661e-813077', 41, 3); t('-95675736706055295.677406551742811040917583753585191172113196', '-1.820098938888938311178e-733', '5.25662284955012491159526249792727745494970648252567199389049386376e+749', 66, 2); t('-0.00000367878882129254076004368914186463', '2.21534e+7414', '-1.6605978410955161555534090215789133947836449484e-7420', 47, 2); t('-8.523221035207e-290', '-9.22950311628931292976250786203698455520043289656e+86478', '9.2347561161382748540585461990341573507302574000703952620656129161e-86769', 65, 4); t('6.1e-558', '5.083820386089577292843972361554693918170842e-8020', '1.199885034626893592002313284596062998690006879533206435358120004976236854862833e+7462', 79, 0); t('5.75437017863019687e+5601793', '-50265686011064078917406015064.05038', '-1.14479093697509492717111975944408926832484246759405446142254875451648396850802376531153446864527813e+5601765', 99, 3); t('-7.02479085615239757380511080902628306127526377163034580709690e-1929109', '5.937151585632715191e+2105098', '-1.18319210059444253820374823475694931242101809142953904771552228077106021985746268e-4034207', 81, 3); t('983326.3529671', '4.94670376809815834641010722044433880038e+1258390', '1.9878415993063518243178667667199833409018125874458e-1258385', 50, 4); t('-4.75992158e-5024', '-5.74257395010042921477085748004249382743005431374588507872780e-74735', '8.28882940186909728377127651680904728016558720061e+69710', 48, 2); t('3.602616015331472560955592560521969863314446783038758114320e-51892', '-0.000009441970853418132', '-3.81553392957919659196739917915e-51887', 30, 1); t('9.1497455227169232552314436076169103347782270651e-219', '8.373249799378905593133718575799e+456533', '1.0927352870083e-456752', 14, 3); t('8.4683622821934687328543351512700150155587470586503736e-78', '5.91343666713537280212039965446622473725e+65', '1.43205427890306135113135547671752046828696421139270728527469421798846833607098329784358305203559283e-143', 99, 6); t('3.189138486227352332426732440e-598458', '-621882029.123105326595384964817058122413466827221502', '-5.1282049277485119126158079163601873401925833903091364654e-598467', 56, 4); t('8.36327002464142378308e-5456846', '-4.1226702772597622341370819150656144937577e+170', '-2.0286051180887267413705307718807271002754666407162366416533614250649191231300041619677e-5457016', 86, 1); t('-8.374182824415045331433178480296e-9', '6.147680930636187947068915894326103429660857246967961753e-897', '-1.36216939670427065891719674e+888', 28, 0); t('-6.1555075166107317522046137450664e+1059243', '-0.00000787', '7.8214835026819971438432194981783989834815756035578144853875476493e+1059248', 65, 4); t('8.878418479987526159e-22', '-4.64013766942433523967e+99058', '-1.913e-99080', 4, 4); t('-1.643833156167073156227836724712230496026e-31390', '1.95796758465874581171150957275752554e-5636', '-8.39560965690643367874396342e-25755', 27, 0); t('-9.109741755526673003743735919690524222898437842e+183', '8.236165559556987020556098725141774367711141832664077433e-9827', '-1.10606588583640304424494579923987e+10010', 33, 6); t('-5.4149584e+8284753', '1.54056e-560104', '-3.514928597393155735576673417458586488030326634470583e+8844857', 52, 3); t('2.690472873319424346621055802539580796027419185779186808860e-24432', '3.268504216190878954310096433055532399962763307309182634339e-72997', '8.231511099150138356502834964202409620452717229808497e+48564', 52, 1); t('5.511122960487624576329342700193361e-4398', '8.2470250190446060067026043384322816060e-86002', '6.6825587987922367549111897380349609664e+81603', 39, 4); t('-7.917e-98', '4.79652886e+27883', '-1.650568615571719920809566441345252324823914433822462188e-27981', 55, 3); t('7.428249642380234695622316151679325106710e-62390', '2.4e-977', '3.09510401765843112317596e-61413', 24, 1); t('604.4744600260950239251801774458251452270154165496606', '3.85136383475361979e-428203', '1.56950754579842125925300989434603040384295630928408984826598160297536279981120155879629e+428205', 87, 3); t('6.67e-284', '-4.72088315743215515882516e-40', '-1.412871231413410813e-244', 19, 3); t('-155151.809518011593063914917713333906645884471601871177', '6.338188022666799058422649809028e+39', '-2.4478890333191995048e-35', 20, 5); t('-2.22820726393277647144506439090068833253219972870532e-46', '5.56841444938689968910723598834822695961194434430534984855e+68617', '-4.00151117375630911580611713636285050732371989524994875555666134152593754919e-68664', 75, 1); t('2.338716212847876184951897169726620037171397775970546724e-9', '6.7256468684977240454503848810066203901786164055e+491', '3.47731044845990282013489394411795073677106e-501', 42, 3); t('-8.230327025182274219825664526246374e-668', '-5.0930940348440986089411798148973918058986185512e-19276', '1.615977825831406902502437049283858159926001981843491735777952747247195e+18608', 70, 4); t('2.3392164138920437971579e+704', '7.31e+13', '3.200022454024683717042271e+690', 25, 0); t('-2.79932318853820678394061e-21', '-9.65201e+795', '2.90024895181232384129379269188490273010492115113846753163330746652769733972509352974147353e-817', 90, 3); t('5.262694813393922563321996504321750944298404865e+575', '-5.27194871272972704640595467498038359604198471206982404550e-6428575', '-9.98244690940664904824180323510480234891254747217390046867982787938145121410706590862433793592286912e+6429149', 99, 1); t('-4.3032495194572e-1791', '4.170871137116609104632427816969e-8', '-1.03173878501365214057079824e-1783', 27, 2); t('-9e+8', '3.2664588981099192225e+355657', '-2.755277e-355649', 7, 1); t('7.9856701729158152160178915270177478260463473296e-98', '-2.15e+219', '-3.7142651967e-317', 11, 5); t('-9.24426980659693e+5552', '-2.360371109184588582050804305650031929948074e-2907835', '3.91644761e+2913387', 9, 3); t('738078.09969552153351935869902827601706320582953', '8.906309895128553028387337269294725851683085877664e-982516', '8.28713696678379691594990928450730337629e+982520', 39, 4); t('9.3107363647475354115363146495992673271e+5571', '4.1390180629e-470', '2.249503680161273502408593378453233066971837302343559192685348743e+6041', 64, 0); t('-4.6488388360919e-9351', '1e-3552626', '-4.6488388360919e+3543275', 37, 4); t('3.502125971589041207828696400973199183170931575e-82', '9.904207204795497308966962641344218578493956925920528420e+3548198', '3.53599828756950296897419759303716701189355473124227765928807732432119654387837196648e-3548281', 84, 6); t('9.626778775512443898886198120e-9711', '7.65144880552399643302293049643e-419330', '1.25816417520330914099639287218543216722553820660528264158268029998306536564450700364e+409619', 84, 4); t('3.6373670222495719639910226014743e-9583639', '-6.07946609592801701149048389895673e-7772448', '-5.9830369391908516894138809710480605955155889487697065431530475e-1811192', 62, 4); t('-5.413414359362491050376993e+974936', '-9.24500668218936221853305801534354e-1217', '5.855500753494869122525762250264453613312731841180143e+976152', 52, 5); t('-3.69528652339681914004592099858729090908267654e-539', '-9.2994862604892540e-1857549', '3.973645876651262374221097377505640866928128627967019046518019594709834308762109480776941e+1857009', 88, 3); t('-5.603651212122744684360301186677920904987516640e+797071', '4.9958064506424300553261469051348812542e+10837', '-1.12167099896397097658540051011786267488651144897649339081833e+786234', 60, 1); t('3.72422571684e-5479', '6e+261', '6.2070428614e-5741', 35, 6); t('-3.16039807859960646663838964073463294295045516614321232e-304', '6.299543644013528164775335365232981750549918232246358e+885967', '-5.01686829585337e-886272', 15, 0); t('9.67423623391707022179457264639757180688635006848e-9402', '495973672.925098457189712686141111899121970990995137558614709', '1.9505543866595648012867e-9410', 23, 0); t('-0.0008581694', '7.820967675296252e+74422', '-1.0972675449237082155925496257359580492418377059710845942002508336411181101106074e-74426', 80, 5); t('1.226198817917201442232008153782416893056584e-1854', '7.189408017858061042470833e-25', '1.705562982197416890856662477715422791996245047064069983970266716961215470414672e-1830', 79, 5); t('-6.35189227314088953150171322959882305313405e+48', '-6.694886542643052998499564284e+473123', '9.487677248423161703764467275166572204266404817544554045922423528094758875270330077509010918430467e-473076', 97, 0); t('7.4616536852330028276844750455006760e-8213273', '-8.2616947301811015785381280075461055528562843038319069159e-89', '-9.032e-8213185', 4, 5); t('-7.2684620847414561029923060748011961389878918997817e+87108', '1.948949090678718996919e-536318', '-3.72942634546202e+623426', 15, 3); t('-5.017576430311015662375160024056601527714e+8326', '3.4813441259481e-48', '-1.441275624811879878e+8374', 19, 6); t('455317007.49227692213377339503163384422094806', '-5.65275506053420792162316654536951391432754e-116', '-8.05478041444179693663347923332141134756382641597760190726596537031004841221031083469960305598910834e+123', 99, 2); t('-9.633607066849e+57758', '9.02343831685532970072242113378955028698e-515', '-1.06762042677832747096251659449918592253561599947896316645079438705808961282465257e+58273', 81, 4); t('-5.53047387401759485491421040802881710250733e-60', '4.832438868686975373399225473898e+6688', '-1.144447767327946138566275743e-6748', 28, 6); t('-8.5517e+999376', '9.6709761353725e-467008', '-8.8426440933106609382861204631117022322680864436317976499429295071253175787715682e+1466383', 80, 1); t('-4.7985931982836001286789522e+3083', '5.8754920117e+84', '-8.16713423952930761956558239736905197909929787063589141361439526438153186264845177340265534379e+2998', 93, 0); t('-0.07439743626604329095911613823765871837095179096615', '-9.567422335725e+374', '7.77612126395229348289773448812196298503460679537357436759941658658788819681845695978744714880971133e-377', 99, 2); t('-9.3513764e+35', '6.3337512065852698115383106285012045646880436155304e+9430729', '-1.4764357005809247057710477075102868262504333e-9430694', 44, 6); t('-6.4526743163882376690571082e-523', '2.67548292599e-9608', '-2.411779291770503887706294874287328174391375e+9085', 43, 3); t('-1.7351679399705858734112711e-7', '-7.700225783512425379281739340851003461459979259249134278e-990', '2.25339878174208077097179e+982', 24, 1); t('-0.0004775444877931838264447996', '-9.45257809685942648262068211096105377974029e-9558', '5.052002563743384263167828462454906927095954922595940600820474e+9553', 61, 5); t('5.61325106751824e+33478', '7.0e+730198', '8.0189300964546285714285714285714285714285714285714285e-696721', 53, 3); t('4.54882500559155710013485527076437069018865104e+9974066', '4.8906436370421086920470075e+952447', '9.301076388265971471355717622194478e+9021618', 34, 0); t('2.93236783716e+32', '-5.663565141e-50', '-5.1776006175541929729523349363379380260226091394399307395553446853e+81', 65, 5); t('-7.30289545768349143493882e-46', '-5.144108787179330100997948996487019772996e+79', '1.4196619394761845879192934848753033761430984e-125', 44, 0); t('-2.472060745e-6363', '-3.7231031996015984083496038307e-2183', '6.6397857176361109727293604341430323063265900296318742853356936680116395513e-4181', 74, 3); t('2.47103852713966506e+686152', '-8.526641704891077560618072669077e-574980', '-2.898020830079233415870600138873590163204027879e+1261131', 46, 3); t('-9.25e-89', '-1.5070207e+9915', '6.137938251279494e-10004', 16, 1); t('1.119365099713806799416359', '-0.00010141064', '-1.103794532520262961969630602863762618991458884393195822450188658704845960936643334466679236e+4', 91, 6); t('0.0070606848678199435435749361053874132790999688086830', '2.814984075612565257476863631e+880049', '2.5e-880052', 2, 4); t('-5.00908986898781781403504e+571', '9.594306468292974628815546812025040297907943190487345e-30529', '-5.22089833751061988567640162835383536040375896870047458122903418260221e+31099', 69, 1); t('6.536235082892238482944e+136255', '-1.50376540589127238953100e+66', '-4.34657896589811005907720591974213630955054958458773945203e+136189', 57, 3); t('-2.59747179123742e+16947', '2.16814390894744105231364264491757e+374', '-1.1980163219416569074208688960981e+16573', 32, 2); t('-7016364441823846934204633960.3246656336726794986082', '6.267890414729140882953463043550540194e+71', '-1.1194140257040614563483e-44', 23, 0); t('3.81096696335100355559824657758339e-27', '-2.66e+499444', '-1.432694347124437426916634051723078e-499471', 34, 2); t('-5.3001546173537375421251306682432058841675552963350451100e+458406', '2.543e-80', '-2.084213376859511420418848080315849738170489695766828592213920566260322453794730633110499e+458486', 88, 2); t('4.9725550366e+208', '4.320790745427404224419192661705787428967725606692482e-3161', '1.150843752815926872292918e+3369', 25, 2); t('3.704010e+554', '2.885131087270377727451557613008319e+39', '1.2838272813123245436918555271613317085199348008316522416757736e+515', 62, 3); t('1.6173538174534536423307034636137041553e+890', '78043.749364184251171298739776580568', '2e+885', 1, 3); t('7785.38926714803', '5.7128906668117937069399910232699277065548249552272e+415034', '1.362775820719992957199284214478469761555796732349660451706183955300180161313835764446e-415031', 85, 4); t('-5.07868461604023e+126062', '8.106710194968426653e-9549', '-6.26479113462376589e+135610', 19, 3); t('9.3112e+31902', '5.802920972045397225171810479e+9962', '1.60457122281264059215138442381891442719754901809875966906068353237e+21940', 66, 5); t('-3.62116210365102980919563849163417520549036635149e-859891', '4e+279430', '-9.05290525912757452e-1139322', 18, 1); t('-29741.72386912651648227429513933355112481075034929319615168', '-1.81254559267e+865246', '1.6408814e-865242', 8, 4); t('5.8020204908101208375565271248827e-8422', '-8.21e-574867', '-7.06701643216823488131123888536260657734470158343483556638246041412911084043848964677222898e+566444', 90, 2); t('4.2249210117868151825850569355007155971e+4443684', '-2.296799414051960498455283054114e+6935', '-1.83948192686679028592157851487994594041898951624008242379071453644286557491435400935466725337e+4436749', 93, 1); t('-5.5683967199378466381245121771765180601322725857e-5782', '7.63989281e+2878', '-7.28857964165317476244082562877805357603213884e-8661', 45, 5); t('4.890056674046618952861254179424762170739416e-981373', '-4.788878637890516129744512240101667588921071707e-41173', '-1.0211277093880732348828801954836327803781607041506663717693804718e-940200', 65, 3); t('-7.5489699907035199753435159498025523e+7333222', '-510.03729222053270862928676321455378034348461', '1.48008196770040397791935767373126144302782359243310019996660175167506e+7333220', 69, 2); t('-7.3270584615286236633654430861733084802309157028492e+351', '-8.84687011420092814735489917e-10', '8.282091142908592656216924750530931007470543029276830203292965428595765458179031126780952065735072164e+360', 100, 5); t('6.083061611465e+8023446', '6.08718592e+880', '9.993224606e+8022565', 10, 0); t('0.0015756454197115404268201989899732397545221953', '-2.2625460695220128276222100052234505e+921527', '-6.964036847410636172915824361955334e-921531', 34, 6); t('3.778140914519654343155865295708356480390693e-4233', '-6.36608e+3186', '-5.934799616906564704112837563631554238072240688147e-7420', 49, 1); t('-1.037059766939040576436457737042171551398340625385e-2015', '9.58872e+581668', '-1.08154140170850809746916975054248278331032778659195387914132438949098524099149834388e-583684', 84, 2); t('-0.0000530084462581851788143636634433353360733168428056102', '-9.612800144197474955e+9901451', '5.5143605883e-9901457', 11, 5); t('-7.5993961461969e+9399', '446.47891237020844546821761352121943801', '-1.70207280470520469485545830180759296578670882013617711034068981979e+9397', 66, 0); t('6.915626408396995959757568961988119758281756464113147402772e+286302', '-3162.5608939936388120318745', '-2.186717233344410689191305768633537907690605443288196266993964591605791604315e+286299', 76, 4); t('-5.5437383828828567108517373e-776', '-2.1140533665e+309', '2.622326602880891233571296555062627365324838406817011636683297512205919991849931381569028144021e-1085', 94, 5); t('-5.613748719378402450137898026316048568184578645980579e-9740', '8.6217788896525220020177465853e-64264', '-6.51112582591949275423601496056334250886183469397e+54523', 49, 6); t('-7.23012652470383234547804544659544027917108007437e+92575', '7.9142419737684090279744728848831732235974822361464930703e-1068', '-9.13558942052560035722583534016743762565074490431624107788163e+93642', 60, 3); t('6.51068003e+842', '-6.64386076662392515945318968640865e+889537', '-9.79954316e-888696', 9, 0); t('-9.4220842814894740355643871550053e+81204', '-351.6319547964917916245896910470732083574798711796107577637', '2.679530160148e+81202', 13, 2); t('-3.0704509983896666335891441257686892358819812695e-87', '-2.92831001734855596829254121942366818e+3082', '1.048540277565902156270373e-3169', 25, 2); t('6.926278921765102227557189450', '-7.812398429709661207988000287030472469e-5915', '-8.865752283e+5914', 10, 1); t('9.53634e+9', '1.965138983505348446115414087092375e+2823774', '4.852756003541998481759701658454e-2823765', 32, 0); t('4.082089070477382148438037008743948177675540493962936e-250', '-3.70981132278431827653065681305312802364964588974562536682743e-150415', '-1.1e+150165', 3, 6); t('3.21546866478602997320941159e-7809804', '2.62951330458537889745968954585764480040058726479e-950855', '1.22283795224722941388512706360049152523621791432774199557610762019505424325062326677e-6858949', 84, 0); t('0.000001127403718694283526088035899517087999169464688', '5040.5820754022433780182', '2.2366538265410857475691712665224191379092605641551473288691761417416e-10', 68, 2); t('6.413972006320308603410995781591590851e-444', '-3.2406899986995856418987390184575532612629808e+462275', '-1.979199494210827954302790460021418282864705538491682126209e-462719', 58, 5); t('-5.2367600337694e+824', '4.7e+5112625', '-1.114204262504127659574468085106382978723404255319148936170212765957446808510638297872340425532e-5111801', 95, 3); t('7.15018163450037e+1043420', '-7.696127791261132765e+2500843', '-9.2906222823110103051626310097830063941749614706048755651973922142971166784633139143550974e-1457424', 89, 3); t('-7.7870434680448997482202649e-701', '4.890909233287873419915520169498642163367953112705806720e+3297', '-1.59214638763805558495114202287446668688246661401731068853250999357151987686894e-3998', 78, 3); t('7.90371913475853302971e-383818', '-4.441915588351562702723111858272999177138721291129e+95233', '-1.779349241909317480964260091333971618643975276275877872610237534154609112143514e-479051', 79, 2); t('5.52588573333732102332213278851769771097086764096e-8724', '2.02383031022516609043346e+50', '2.7304096126134830768336584365822907780869250235184735679058135774495742756972e-8774', 77, 1); t('-7.951110327860274247709e-925', '7.2814109864640187205483337377e+33027', '-1.091973841696507960691114551726008615002680220148021354595019556540182019932304e-33952', 79, 2); t('-8.873697338599954480139605635456864714416268787583e-738803', '-5.91062688993286e+924', '1.50131238256873842251701844999129311191366440778955739978014259056389850612452719811e-739727', 84, 5); t('-9.1436152843889238774692104695050201272912884890200195506754e-1683102', '-5.1803330099891957216255347730391e-164215', '1.765063224074082085292551095234045505e-1518887', 37, 2); t('-7.29640957067304272880720e+5081', '-1.33628370095834306203522543771616626623455384353366e-93', '5.4602249248720717426278865744444652435574141226720132536e+5174', 56, 2); t('2.33133930445796588877032528e+7156', '-9.9677887295e-61', '-2.3388731119e+7216', 11, 4); t('-0.00025785307906304864870180865683793673660493', '-3.0100e-2761', '8.566547477177695970159756041127466332389700996677740863787376e+2756', 61, 0); t('-9.6770193467199039717825616309703958882916034534672395359137e+17688', '4.18979882378258924597780062e+496', '-2.30966205150236810986706968918539917699847241253752508255359e+17192', 60, 1); t('1.86580566344553757970697514420e+6799650', '7.183157009290574082361044470e+8288', '2.5974730345339e+6791361', 14, 4); t('32247647.57900330176', '4.95060627882350112486901533975e-743', '6.513878455037808507585850262360816147927774047594341235776473855525437e+749', 70, 4); t('8.71e-52', '7.03973305194871690612804091405988801409802e+4222', '1.237262824559650740798598369147166862397725876647363701770872319086241898425822176503588167155e-4274', 94, 4); t('7.7259064897661884349401371280937076e-9161', '-3.8203883860072154274824008666988387842750011e-7660594', '-2.1e+7651433', 2, 3); t('-5.9e-23258', '8.5803408660842006874930413872203e-54484', '-6.87618369955572119402196294175433788610487746425290374504322286841107516242783695487400261964372e+31225', 96, 3); t('6.90798422701265445098778106e-24', '4.0360722484987e+722897', '1.7115610924909040265927784803960678188103834405789e-722921', 51, 5); t('-1.6717449184931518514025394010707104237e+51', '-2.6045e-900585', '6.418678896115000389335916302824766456901516605874448070646957189479746592436168170474179305049e+900635', 94, 6); t('-8.08874022564473140199035422086674705e-18474', '7e+60396', '-1.155534317949247343141479174409535292857142857142857142857142857142857142857142857142857142857143e-78870', 97, 6); t('-3.99756e-8744832', '-1.129777112335753948998878000850812586076825723004920940396e+82563', '4e-8827395', 1, 2); t('-2.1986880829005591347235935044e-66', '-5.53128913507041640704954869060137865e+22329', '3.9750011782245561542585386936073468939246936098645050823063861338176931635325497215244e-22396', 88, 4); t('-0.000226930118', '-5822.7730802712548122145', '3.8972859644640046e-8', 17, 2); t('3.5358228603437829467542565252394409759941451716564387844e+5819', '-1.1211285523789752278505749782883138380764249835122752e+654', '-3.153806807293378336299434516590902750456037343818220344010026e+5165', 61, 0); t('1.540945741255801235146421640530441629341e-59', '-0.28959050868264919998', '-5.321119632910562022779265944683536368088159036094e-59', 49, 1); t('5.67465911290e+60', '1.82139318766325427065720e-489', '3.1155596448564028586441404475e+549', 29, 3); t('-0.000073324629052045985374799060767559177945662087945380531962505', '-8.6235020738126851431568817200653038002538e-45105', '8.502882984711473461151286399869019847200978176981996060734467871714834324909852815521082684024201e+45099', 98, 0); t('2.33655464176415788042730153765978361685159812387632344e+966733', '0.000271032054732387189879751975458037143324874109460138147524913', '8.6209531343856555071879118346685369655541121912109514462e+966736', 56, 1); t('-7.3857752173247842104384133616842993670558572216964745352905e+593726', '3.5159864077115843821601402777019512966207959178114659e+86157', '-2.1006267831768699436790676448e+507569', 29, 5); t('2.297954795295988905597e+35', '4146.8211032798097836971', '5.541485243910057160840790548754435007075456066243014035815812282364190103557437813616906558929018991e+31', 100, 6); t('3.01e+69', '-7.42216850812595777997133787752109191066448160807243548474e+555672', '-4.055418570333702329360565078021946914153372178576123824979e-555604', 59, 4); t('-4.412068782529924812219217692595557950834519815e-8', '-5.543105213195272592447854502e+80', '7.95956167677832671851525278405651096717750940224758071101327343e-89', 63, 4); t('6.0399317841e+79092', '-36677.6188495002669617', '-1.64676224181393229943713741633116474956001090019712342463957e+79088', 60, 3); t('-5.0141298538386961519854674556082694550280506139337568380169e-8654417', '7e-7975299', '-7.163042648340994502836382079440384935754358019905366911452714285714285714285714285714285714286e-679119', 94, 3); t('-7.29985014324738862670793202560933158762654831493606e+644533', '-5.742610820531e-7269184', '1.271172707220371224664309552725807599674523039e+7913717', 46, 5); t('-2.356096137810041e-8', '8.51666515563839e-30', '-2.7664538815996615880251302469e+21', 29, 2); t('4.0e-187474', '5.57545409734318035788872379534690e-187', '7.174303527861673281695766646416424586540746909e-187288', 46, 4); t('-8.3408180480517571e+10261', '-4.95082841688375001488467e+93', '1.68473179551267957952978522430716289057086493073281654507483485966953015258527807096102260243e+10168', 93, 5); t('9.485789339622840784590481050e-758233', '-7e+726', '-1e-758959', 1, 1); t('8.129451975131457857e-74', '8.869163209722283113995855593533903424761637e+93582', '9.165974042e-93657', 10, 5); t('115297180.9500040358261890643216883791745981094374599890744', '1.6156778e+59619', '7.1361493578734594128971175021213003715591134220857641959554064554207528e-59612', 71, 1); t('6.57e-9104596', '4.59782738301854050988146364667782520337e+9668429', '1.42893576742e-18773025', 12, 5); t('3.53298148390840216063756828528528731362938e+37569', '-9.693e+1242', '-3.64487927773486243746783068738810204645556587227896420096977200041266894e+36326', 72, 5); t('9.680686421339337e+81140', '-4e+5337866', '-2.420171605335e-5256726', 13, 3); t('-3.1049010007243138532000993279548588709755e+1456', '-5.8689398253118613130602e+73', '5.2903950170580031454614795341541860027427127591621462e+1382', 53, 1); t('-385306.7431768853361651458', '5.299549444959349552757082715023594875873292038137301e-6847426', '-7.270556623325190052068228882650212113848551007603369953259657763300398903e+6847430', 73, 2); t('-5.435380099616010286e-158026', '7.3872183184755192092675802546', '-7.3578170635922066041185497089932822622241189992455124805127369709866132541296736072e-158027', 83, 4); t('-9.8161192725730583900346322467838080325819591676675e+67273', '8921123217228.625485161520374979079834199241555733', '-1.100323247818839811644712336352805812090694235673509811515801464524277016494901066683240684988785e+67261', 97, 4); t('-1.864801574014925385704410998424068774884363551529322918439e+120', '9.92571328569748e-9', '-1.878758251764155965301353804071955e+128', 34, 1); t('2.217008116600306723453013180713380171420e+100835', '1.14660112752e-28', '1.9335478252978045906788601940388402134544588573422e+100863', 50, 2); t('6.20e+34', '-6.426989860828637290655138377524103575311848105114906759462e-1672', '-9.646817770458764510831701666413893777968947562533879503975426e+1705', 61, 2); t('9.727031936826544042916483357e-85', '-1.89632939742514066776200722457594141263447e+9547', '-5.129399960805347109409011815190515409432537267368130140053722143e-9632', 64, 5); t('-8.83141803151495457159535149e-251704', '-4.844900529997879600e+9506665', '1.8228275228426247370397069826926702651387770675304659480581723315579117882554000331882e-9758369', 86, 3); t('-2.7746632190032869089126814262857001229975904e+74', '-3e-3595', '9.248877396677623029708938087619000409991968e+3668', 86, 1); t('-4.8913969468539595739229875634648105516559842059174585002e-7160', '-4.0157e+5', '1.218068318563e-7165', 13, 5); t('-7.8358544722217023164122950825167760865007006130021e+5126', '8.5634284165424837389049497735142038323e+38885', '-9.150370729e-33760', 11, 3); t('-3.339303256823800935989097276894281516540e+4548', '-2.6988482496225472744646183693876133e+407', '1.2373067871788737121967452402266068399668e+4141', 43, 1); t('-548800521893.8564475915153910333667398576296634307', '-2.5e-9087', '2.1952020875754257903660615641334669594305186537228e+9098', 62, 6); t('-3.23665793569776385550085525852436847903310590312e-156', '-9.79026643429840e+8372', '3.3059957636686243240936332506488908316402035527114606879e-8529', 56, 5); t('-9.143e+3159', '9.63305968857275e-8821327', '-9.4912730696000098685765139367599e+8824485', 32, 1); t('-1.3447e+993', '-5.7289053674945975212302570073', '2.3472197806403512398449179483606256965048752905323068e+992', 53, 2); t('4.2e+4697', '6.67283818842789008830786329896620947816689867e-18309', '6.294173305871085754601221156061039486728147858539713818065820568e+23005', 65, 3); t('9.69383851251244836506017776859981387098944e-1119', '-3.82486379521501469397596288e+9198', '-2.534427114669977233684743545593026338923169057834944305720357823361e-10317', 67, 1); t('3.5355491459875958e+83773', '-526916578.223339198631317192353972585023365789985', '-6.70988405395932650363426244693308215766147991508e+83764', 48, 1); t('2.718081113664408632444613291904096612330859388072304159155e+594', '-3.007577482890046655563515677964208993e+306799', '-9.03744335475123100808781769700866206e-306206', 36, 6); t('8.8280996164510722828588026346315877842e+49752', '-2.578833566225900100617160782290e-462', '-3.42329172850457241836122644670733151462648422285155e+50214', 51, 6); t('6.18681765136134904e-7', '3.732459269136594316351364685108041682930269e-3789940', '1.6575713772738652251097576250282215785789005e+3789933', 44, 3); t('-8.323397905126013e+48228', '7.36322886312e+679', '-1.13040054300297319643962874557566832355716223527807796889969229301300843252608254e+47549', 81, 4); t('6.9873812870178255895e+27249', '-7.07149107988029991181662887992194025064562374268e+95', '-9.881057909976324172662205032137680894515657641325e+27153', 49, 0); t('2.1152163290656455693673204267197398831e-61', '-6.456271859817401712122612921625581674711229e+1338571', '-3.276219426617312200927697655913806547948256572e-1338633', 46, 6); t('-1.09183e+7', '9.954814761688306975626749165618904112910970292700419135987e-84', '-1.0967858530145355305021090386646e+90', 32, 1); t('-5487828.385013699423427876683829029974006362', '9.70775568463159251831771571625e-3286', '-5.65303512293939798174704195640977462372739276120496777814221708332632e+3291', 70, 1); t('-8.098437997145103e-7652166', '-8.36676608646337215744959966866e-20', '9.679292947184936412297378769435397836153709746294399932731e-7652147', 58, 5); t('-4.181701311108074144453210348e+84615', '-2.59250909222674097767953708202021830271e-97', '1.61299388443662296483276372047788464624876472791715240051235668441708534365931838065838e+84712', 87, 2); t('-2.1946536e-9244', '-8.491803457524430e-4644213', '2.58443758263782946131100536322795270476575807105843776888003208538e+4634968', 66, 6); t('-6.23973769513358772836843552665264653907865499141648514068563e+87532', '3.5819515125833579189611124225908919919509690960e-881', '-1.7419939028246069095236056731585987829852075e+88413', 44, 4); t('-7.62222718575298084791963989755171157896421922098e-8', '2.700391860215424e-906440', '-2.82263744683e+906432', 12, 3); t('1.58106346989151921e+21462', '7e+349080', '3e-327619', 1, 0); t('-2.429317513732e+172', '-5e-2651', '4.858635027464e+2822', 77, 5); t('0.1236426444791588877989785775274150', '-1.352448944441565231465913465014929481e+8735', '-9.1421302805786670098968277535229542497707635857461e-8737', 50, 6); t('-4.43954145466498120433459608109189970592e+612', '7.4921997112e+361', '-5.92555140785737949234632794113057666075525741786369055e+250', 54, 3); t('7.657832561234625660962641308353880838095e-9', '933670.6227621730949083132641808337450043175977092665', '8.201856601827824492429351726267199805326131202106177177883172191743197722895012036050487e-15', 88, 5); t('-5222835755032571284423392644738827053269141.769044897870', '518814015064458662316010618618424300078235878355386.8098048', '-1.006687484027137161766303e-8', 25, 0); t('7.39473264091755859436653746796717e-5209', '-6.721318739047255408321612e-868447', '-1.1001907405399672166463321e+863238', 26, 4); t('1.270035347e-88', '-3.00179606772863413672234360098596983e-398', '-4.23091815148188e+309', 15, 3); t('5.42341558926388220256812026598127331278996e+3907', '-5.5796791105079578934372876987929350954316723338048e-137', '-9.7199417e+4043', 8, 2); t('2.53e-483213', '-7.966921641312718232192e-2431923', '-3.1756305809267746027072698119990131640262859733199129780927577641050825e+1948709', 72, 5); t('0.000042126661266767803321258525491351033371350260142', '9.72490468370304629953429108483e-42', '4.33183281861502274715200268119738320464373364656108e+36', 51, 2); t('-4.4016804546058e-4158', '6.230344780997698886503234850021581e-128', '-7.0649066935e-4031', 11, 0); t('8.579819712873667561921525458950450385e-173879', '2.3706e-53', '3.6192608254761105044806e-173826', 23, 0); t('3.333e-406', '-9.9074541823186649148847716345401e-3311558', '-3.36413e+3311151', 6, 4); t('-9.6258606127655262116652631e-69532', '-4.13989779428048150120217031932511436148151629840975e-2524647', '2.3251445062397997427574041686374e+2455115', 32, 6); t('-7.628490657079218476257318680041600655852404463308105946e+2329368', '5.693190065891644457394636018303104369077399869e-792', '-1.3399325455129478535630116e+2330160', 26, 2); t('7.671288250098857278422e-5154', '7.65464653550507385129773313472822218277275048177557113679144e-28', '1.002174067021e-5126', 13, 3); t('-6.550', '65.24407556804507818824129951207996', '-1e-1', 1, 2); t('5.16845703096e+864260', '6.38050241889733345267661156e-44', '8.10039193097461926869608786757567756023918792372036351176269746428823309632946149469979405e+864303', 90, 0); t('3.4e+13', '-7.7241638463e-56834', '-4.40177094589811847399159435927409788560015621324767443779903703361451052392857887634475048e+56846', 90, 1); t('7.3261049958962e+1748927', '-6.075938e-837670', '-1.2e+2586597', 3, 2); t('-4.6e-810', '-7647911169041102028645.23085440342151535045257679732464', '6e-832', 2, 3); t('-0.658690924922719154496897934506963532092562393', '3.178280915e-896', '-2.0724754750720930358570835596102855247222928153284399e+895', 53, 1); t('3.9815061582932841373774251441439598018e-8672718', '-8.76586022531041505298742893882824972430228637623734717706e+253352', '-4.542059827508020484292661296321338357331458332746425418203076039e-8926071', 64, 0); t('1.766e+595', '-1.238144981467114374483386903529211573850150543339463709e-376317', '-1.42632730934903495852e+376912', 22, 6); t('4.68799944924864471835382215330057183815440997980', '3.3262e+6', '1.4094159849824558710702369530697407e-6', 35, 3); t('3.6160987687856049722327795342435359628748991066127660711e+154100', '8.15262479979128916e+8083', '4.4355025008365142935437780656007729100441496442755736312484852932e+146016', 65, 6); t('-5.4360264840619213662653828446211298602863088747498635663e+29205', '-6.6302974279241108090102742e-540', '8.19876716415102750498425729926174616102731e+29744', 42, 0); t('9.19375245353160279550786460056093972e+53', '-4.88322873029981e+22', '-1.8827200119637124818277812e+31', 26, 5); t('-0.00068057022162', '7.9525181690146489435304154080285534016552420821019967139466e-72504', '-8.5579209900041707781076145540989e+72499', 32, 5); t('-5.5421150462317965e+33', '4.78372888e-180', '-1.15853e+213', 6, 4); t('5.583964880100101519614006016321350750070309274344588e-723933', '7569375.505649745568210769434496142249054374987677', '7.377048312548712794845656020809478472657797031487486220292017445592517433987514021192812958059720214e-723940', 100, 3); t('-14436.794120156598569472498872714165315278079740318413185', '6.6320636108595148656301315412050918227799049538458e-885011', '-2.1768178001968215908645437787428641555429323464706365786309184838585674671237694e+885014', 82, 6); t('-6.86576762320457954957632017250413494e+805983', '-1.360284335931e-22', '5.0473033040592503577549160627761754571373349303512645242e+806005', 56, 3); t('-7.9411065506146760086723365948809513e-9', '3.42103970887144239704323559099e+8998', '-2.32125529850524486434684044554593567945578602178703876399467113e-9007', 63, 0); t('-3.723639718833818449506469228915776046300483314070e-1778309', '6254.1094835086163039802618367', '-5.953908751761762120004110355669262627859980279687078574792e-1778313', 58, 5); t('9.54488753339e-4675471', '2.28437621186903100394786e+8691', '4.178334323303324720268639443218208362729656466390705136120907341e-4684162', 64, 2); t('3.730e-28', '0.000016603702599326119872662740990573447853384148302520', '2.246486877060413191379069423161442689e-23', 37, 2); t('6.218344456458442779750475e-749114', '2e-564', '3.1091722282292213898752375e-748550', 56, 0); t('2.3965159581727651349084845200811431899626484394e-74696', '-8.7820838878771364433e+87', '-2.728869353526e-74784', 13, 1); t('2.4245195050801974604261387e-164', '-3.90714729460362923730e-63588', '-6.2053445193347e+63423', 14, 5); t('-2.559217707902385701741133457867299301673784025e-780581', '-2.29673750237058112350514e-2402', '1.114283938e-778179', 10, 4); t('0.000096551501836111089013103', '-7e+6', '-1.379307169087301271615757142857143e-11', 34, 3); t('0.000865430942545005171975190659906707039606', '1.6789219995971750975218048456704752992760e-67647', '5.15468224701712532995139975237591506850389520048483e+67643', 51, 1); t('-3.9e-6581', '-6.225081719160733767991800835415465289124308278e+2724', '6.26497799698892699470412280632425399280623762440415468282701539582804690488e-9306', 75, 5); t('885.79618773833589239786405248344813254970337625132353', '-8.36295e+93', '-1.059191060257846683763341945705101827165896455498745693804219802820774965e-91', 73, 1); t('9.65741929292706227426625727019365e-7429', '-2.4677357009003e-3116544', '-3.91e+3109115', 3, 6); t('2.9517e+521', '-7.89119997561653605330960087176194e-3494', '-3.74049575365042621551648678541640064830712526e+4014', 45, 0); t('8.867967317389959920447289565924941031782833389334349e-7', '-2.15597467819795821286944654e-778', '-4.1132056916374029289811136978844562622420666552450392725601270294149736498308822078693437195e+771', 92, 4); t('4.2e+29', '-7.2670916568e+6284', '-5.779478501650594456005788464104569046421e-6256', 40, 0); t('1.81964562441201581939637324335e+8789123', '8.64395135574162716211962342249e+4709', '2.1051085892603282107384e+8784413', 24, 6); t('5.9960913695715898415691301696531290039795025e+14500', '5.89122546044981786106445388225669718e+14319', '1.01780035577076098909745108803e+181', 30, 6); t('7.529782e-546162', '9.85281532358565594289257252593829270736e-713', '7.642264421596554309468762746976449164492474436119157625330483881336e-545450', 67, 4); t('-1.971426891389372279137085743136216e-80', '1.85913479947398602884855788896892386692178840892e-955', '-1.060400188274221747224002264052111973309156283e+875', 46, 5); t('-4.7085518328747609603158779940804238202760068052179512325e-23490', '6.268859274786868560202e+172733', '-7.511018554543712229373369387555499855697154599160758496651837829116552972684558088349015751459e-196224', 94, 0); t('-8.564812358541786440990732054002872056425634845601e+13487', '-1.128288391682675565490143555563496097e-22389', '7.5909779996660546e+35876', 17, 5); t('-3.0219497137492408e+150601', '2.1739338547946078322037258010e-499', '-1.39008356076903410474939025923850508002e+151100', 39, 4); t('-5.077762068268951791099e+477', '1.254827e+657', '-4.04658336828021058e-180', 18, 0); t('-4.414134432648238065705595685568e+731', '-0.000243884827122881795080201216906389363908828868891', '1.8099258099496975844e+735', 20, 5); t('7.57309768842641e-44706', '-7.661786932306425303078887126145321132645923916e+20684', '-9.88424470079420858030371166638081350563339295871236978392607333711323823153613714037685144159702e-65391', 96, 3); t('3.476538981895993084917129e+283', '-4.1578570024018268638582769751912130176633735596389394e+45198', '-8.36137216813309417736884617066e-44916', 30, 0); t('-401.8327781843881003083062634374850727', '9.510854329658366e+43', '-4.224991407252707943141843e-42', 25, 2); t('-4.374988579918127897401853077450179e-35', '-4.460e+991228', '9.80939143479400873856917730369995291479820627802690582959641255605381166e-991264', 72, 5); t('3.050545157e+18842', '5.7857208273730260532973e-666278', '5.272541224e+685119', 10, 6); t('-0.077', '8.9691283285351815216604e-10354', '-8.5850037126824644368703490403211252399744760748e+10351', 47, 4); t('4.75352044791872245587622456495450866485337e+547558', '6.819501344970945426843487713942e+9985', '6.97e+537572', 3, 6); t('2.3794046802606184156e+6383909', '-4e+80', '-5.948e+6383828', 4, 2); t('5e-8242899', '-4.6340333152980603418e-636', '-1.078973684434636123202797262876291457371835514544489323948999413008602919202503930976e-8242263', 85, 2); t('1.081835133966826259588560869304219194277241e-2014217', '-49858578302402487496090.519165915520287193379', '-2.1698074249234998895175679433883336953413728036380998366881518478532879988065637670159030374377e-2014240', 95, 1); t('2.33745385599444758369211913838826364580840764e-94684', '2.173362335414754919677478542441835426383774721030332800e+611330', '1.0755012258682481304453563089276001858000756370506149746287776676100234367527278276983679818e-706014', 92, 5); t('0.00213122587016272668', '-7.58628230959649788913899270117964644350805206960481e-767', '-2.80931526561668800323756802149661289612286702824601498737049316481e+763', 66, 1); t('5.177219e+3007', '7.57376706609665322147622649022190501e+994221', '6.8357251481e-991215', 11, 1); t('-3.438778511509205e-70994', '8.58474724e-923', '-4.0056840526258813882096312016753098953208085366995615819668559047755959324e-70072', 74, 4); t('-930181956746305447242.741079684', '-93.89693731745104693920496861473020555987338050', '9.90641424e+18', 9, 5); t('-0.00065334084295423337281605069932694588215', '-5.74629048655423902711933339780593769504704527e-143475', '1.1369784463263516087085853341189212311146322428223393365e+143471', 56, 0); t('-3.1282343516e-600174', '-0.000015895747997176137898735540296430739374', '1.9679693e-600169', 8, 4); t('6.39686e+277', '-7.906309782490789221065222639304572322378123362273262e-5175', '-8.0908289404070694641756770133509507743717844675986060772277329908781e+5451', 68, 6); t('4.737506677e+978', '-4.0511567005287017e-982388', '-1.16942074257007270673779175e+983366', 27, 4); t('8.03286219355e-5232384', '4.1792100463970e+820005', '1.9221006133624052971313912028817e-6052389', 32, 2); t('-313.15844233122798717550199042645348186125070753543765', '-0.000061647130269359434025223', '5.079854341360600191055751776461384370855844602783223715e+6', 55, 3); t('9.5829954577883112636092276856688120516999010058291560e-827', '-0.37275', '-2.570890800211485248453179794948038109107954662864964721663313212608987256874580818242790073776e-826', 94, 5); t('4.82566933780114581921801210238052742577e-445148', '7.43134277828364e-7599', '6.49367076957213578489282821099579649398500028152598487499724e-437550', 60, 0); t('8.26309973038850379189095093801704159994943776522251606e+61', '-2.9327639943e-41', '-2.81751267624954685972460383394207084287015306024705312238154955447312925980298339071e+102', 84, 4); t('2.16291e+610', '8.3322564625086376096233691073857300e+7181', '2.59582744450091129871829401711146328244665238776950885484738131274826e-6572', 69, 0); t('-7.9706804878661e+2983', '0.000857857628062799904256871927899554790296844936822', '-9.291379160276e+2986', 13, 3); t('-4.52081189107e-61610', '4.599e-99', '-9.829988891215481626440530550119591215482e-61512', 40, 5); t('3.590093370267e-279730', '-7.94338314583262669315278661903164e-4311', '-4.5196024217344810428662626158420120904314161404134544766543981381097224910556952453892e-275420', 86, 4); t('-3.4588464981592976457361749762633608958e+8492172', '-3.521141e-96056', '9.8230843302193739067426580652787289568921e+8588227', 41, 4); t('-3.883052074965960868576743506148856564e+74', '-1.850053967655721709377e+1640', '2.0988858394689606685040972119186668540423783e-1566', 44, 0); t('6.0053221370669650064718306816e+919', '-6.2550557938528524724323975796103534127e+553', '-9.6007492e+365', 8, 3); t('-9.981988992266175326096983489e+785844', '4.9262608738395023e-726', '-2.0262810370588970908199108167273414274913326131390490495456873672336640585632246896659299548241e+786570', 96, 1); t('1.3567442371744515525949659296916525228583601957509939673e+6350', '9.20e-633611', '1.474721996928751687603223836621361437889521951903254312282608695652173913043478261e+639960', 82, 6); t('-925.132495132060664105582168942832170018704128335178427', '2.816905877176005772911736153920553399863448721846484035787e-17', '-3.2e+19', 2, 2); t('4.25802451194307177337299273323929680282896657712757298589e-91', '-5.58385255192431028361423347018637947437431001891313252e+166754', '-7.625603420483710776519206081097236371938875933318402963771462011031121583425021086602836253169576672e-166846', 100, 5); t('-4.624166e-70', '-9.3289351920', '4.9567993611590736410381100222783067652e-71', 39, 2); t('3.095934977386501436397164003e+8543046', '-0.8113213089353323344967667936292695786579663', '-3.8159172491712132469758486541178761750384395407780130776116031191500742554815487e+8543046', 81, 2); t('3.57895373869154219312736490614832144495301e+5024', '4.73762127542716365462398965067586e+5381', '7.5543263815845e-358', 14, 2); t('-9.953070670236959435989542552e+581594', '0.00000233495966134446698866063053490907985902957073882564195531482', '-4.2626306719602998249171628986000174657055786192572518354967928005561185698616724356182389674e+581600', 92, 6); t('-2.280332344157424082436289042722055625046720019119092679414e+2600', '6.70489912007486008818693915571900115e-976566', '-3.40099426303070792419457e+979165', 24, 0); t('-6.398e+53469', '7.98315991521555996711172647379199e+8622698', '-8.014370334490840848235213e-8569230', 25, 1); t('8.5952018097e+828135', '9.74749e-4369017', '8.8178616338154745479e+5197151', 20, 0); t('-6.45481980644574225e-726', '9.84161678749869714232432560603044784e+427640', '-6.558698581563315879188760226492731345323598196072329499159200289768400292595353610439103749518635909e-428367', 100, 5); t('-4.9674477463727121938073542124e-16695', '-582987902987.1962384145646624091245', '8.52067036197457569830597616633680114892907226669e-16707', 49, 6); t('-9.14717211469063496048017806673626480487794e+89', '-1.03e-5696782', '8.880749625913237825708910744404140587260135922330097087378640776699029126213592233009708737864e+5696871', 94, 3); t('-4.8635400322120376778537175147648e+743', '-2.36707469602975260e-75339', '2.054662677257104235075798298889121242810358e+76082', 43, 3); t('-5.63548988694627886787587349987896646686700785196658157584e+40477', '5.77209e-747', '-9.7633437575406462267148875015e+41223', 29, 5); t('6.83695e-558731', '-3.94342139703431498783160018151252988e+637969', '-1.733760943008e-1196700', 14, 5); t('-7.98262e-86673', '5.741118846201109301e+436', '-1.3904293246e-87109', 11, 6); t('-4.26874941731106819593450850675989330588172453740311826632e-20063', '-3.2403577474686503538650654271626333181e+3762', '1.317369793704350008e-23825', 20, 6); t('9.2882326610961883e+27', '-4.30662480016486641955935993893450580735e-32370', '-2.1567313365075628892952376606705082040079243923653220981290489607445066878641885316581063574733e+32397', 96, 0); t('9.666240186989400476881729679425669361845280068784e-81', '-4.92037839801832192380005136e+6049161', '-1.9645319e-6049242', 8, 3); t('9.232486226130084335699618763355315307990627088319426399605e+8844068', '3.9e+63', '2.367304160546175470692209939321876e+8844005', 34, 0); t('8.1743684175973623740577760207067029620194414583e+42788', '-3.020710372345526921392741874806840122036278485855143377e+690828', '-2.706107971301503253744450452957962096033375556282593804502133202e-648040', 64, 4); t('-5.8537208685979961804257724819363504650619833457e-406', '2.70006233530852421326150389e-2810', '-2.167994713325430435716938510175728970929943257751040650986980622372211e+2404', 70, 5); t('3334.78107253269059738584567915642232492818', '-8972180632559.4892', '-3.71680108671795584813762107152084186283616736293492881508957866299771835729380542351661992694e-10', 93, 4); t('-6.242100006184550179391666553480790558550805652e+556', '-9.82836522790083710919500145623437928471e-19562', '6.351107087946253510204772800761927631308542246178465075452e+20117', 58, 4); t('4.66473793450477093405098e-46', '-3.852341070586643781632611090691822273760467745e+70646', '-1.21088394019e-70692', 12, 4); t('-8.162327659811364194903775226733127923186e-5345495', '-3.9499236279e+297', '2.06645202002321078723046548621931342106646203289747408840020929357574427749355e-5345792', 78, 5); t('3.605662873886263663818e-8434', '3.30377906613266298e-124080', '1.091375301347550388541276612640161450663677797598174358554637487080243306482718e+115646', 79, 2); t('2.03535220477482354809298305754935022943376057531e-85928', '-77546278827463270.20383055638116849129227', '-2.624693583690049169943640617270614776575433786581076462305222301986434947657494818191072613273e-85945', 94, 6); t('7.40e-591592', '-7.75e+8851393', '-9.548387096774193548387096774193548e-9442986', 34, 2); t('6.8056650204973653378574186579424614131830798174e-638822', '-46.622459', '-1.4597396118676119888608661027386954028278688212048189049831112511675971445435771631e-638823', 83, 2); t('9.316220168516861881103685684687558948260e+575928', '5.70085284063452695599704573572461275330557667344e+6237', '1.634180083041738465127651313886726776260150759121302582819452585393977e+569691', 70, 6); t('4.6967739383923396529003234520007972819053916837e-552919', '-4.447393368690689980558657011961109601730e+50', '-1.05607342302061019777230189726663e-552969', 33, 4); t('5.450138739805869994519508442987338921445437908601849112045e+518492', '4.06527155698e-80', '1.3406579765743022303223209960814397180422027838872e+518572', 50, 0); t('-1.2681888006403972113682033787e+43558', '1.9862908180410938e-5896128', '-6.38470856896525218528734572580007711248107717486e+5939685', 48, 0); t('1.37781586723665857435505727168797934320870e+99', '-8.818473958990057520654237407084886e+5158617', '-1.56241984003596693849913085767307745854104466211882791063779148459391961491e-5158519', 75, 0); t('-2.237687692624590743731212540513663805303704545e+74', '4.8223370446511479025767805692595965616237395703771e+72474', '-4.6402556932568512262677842519047e-72401', 32, 3); t('1.424005635978500062890684347838676663498465572e-81342', '-1.19460163218743874946880467e+9870178', '-1.1920339e-9951520', 8, 3); t('-3.3537956017922014741624740e-765', '7.7873218541505224509926023073605323645e+44220', '-4.306738137456948875377946472291268131032224e-44986', 43, 2); t('-9e+59210', '-8.835655602951134414622109234388728872915343354967232709e+125', '1.01860013613409446193397447087244985344864095534013e+59085', 51, 5); t('8128823887199812657410247368065460.20360163414228', '0.08378484866', '9.702021328685196e+34', 17, 1); t('-6.00859143064029334973412510864364391574678988749749915712449e-43', '9.59071377531e+3708057', '-6.26500964517218954408196509104673e-3708101', 33, 5); t('-7.9621423782632874685119197214509e+4326', '-6.07930777589e+2675', '1.309712005343839296531734280805951873e+1651', 37, 6); t('-8.3512004035417319093448522511292813852817411e+32516', '-1.790e+45712', '4.665e-13196', 4, 4); t('-6.83e-158', '2.8175895559853748461816585e-27970', '-2.424057821158197187219767074023250518311886226126555993e+27812', 55, 1); t('-4.2410547403160631485383629457023185296339353385e-580201', '2.1918565642234396487048e+1925729', '-1.934914e-2505930', 7, 1); t('-7.02824208339755034174567248094791164180597828587379234335959e+974220', '-4.659990013559070650618250297109844154e-9', '1.5082096877777910744915140833790404573363236163698256319748698307926e+974229', 68, 2); t('-6.464231475077962521236042754690e-560291', '-5.383e-816', '1.200860389202668125810150985452349990711499164e-559475', 47, 6); t('-4.7429026700504370681e+73', '-4.4919439983271391345e-49571', '1.055868610965933312279661988616829847461366643593609978489232372194518375246873e+49644', 79, 1); t('-9.126340058738e-2028530', '-2.2702873716958548283767243705751672333942550136640e-61307', '4.019905221038526202647646276192742677227481870128713776738013527397e-1967223', 67, 4); t('-5.60966468517303883042747184299310307195911155058e-70028', '-3.801205231009667327576458080e-460', '1.475759487914577212164668726373048195407577084818334116296294690839368062e-69568', 73, 0); t('0.0688564910139141584898941610196660443328', '5.429194425261882771686899930228932516786965978e-8425928', '1.26826349584253090908028349363034170653783057416832776839847699116577108526703435844801317155878e+8425926', 96, 6); t('-5.007847896e+61561', '9.1904561e-85', '-5.44896558071802334162719084203013602339061279015303712728686e+61645', 61, 5); t('-120646117.83189454698870016934788021124925395', '5.274802609769103166e-363', '-2.28721578336323102371472756402809367659579855197299786e+370', 54, 6); t('3.561126432513e+516', '1.491357423223653286290089185524875706766793345e+584049', '2.3878423623060286390699561437183025363357073935830038523234525524927636838016362437763979188998006e-583533', 98, 4); t('0.0000428655126657096175785391128804551661098359211821992803', '0.00000793983755664915807204546612311444442002550375501', '5.3987896301243861003330218819639490714046381445221466096e+0', 56, 3); t('2.661588631416e-15850', '8.094740032625594480114127e+56588', '3.2880470783355005090592053672745e-72439', 33, 1); t('1.598566217012987004339943101673162639730215928921906639e-635', '-5.5152130078801634771423297e-35708', '-2.89846686742e+35072', 12, 2); t('2.703209117229891481438995327412080901452327075200757612e-34985', '-1.883761695300124878143165356512865376593709417888891529e+5144', '-1.43e-40129', 3, 2); t('-5.534342773127e+71', '-2.3090e+8498', '2.3968569827314854915547856214811606756171502815071e-8427', 50, 4); t('3.27e+439', '1.11341826878604717185126474711666056503463301846874978e+54', '2.93690169424403294345291e+385', 24, 3); t('5e-240', '3.38821907290638529740171e+74688', '1.4757015093805734438e-74928', 20, 5); t('2.03316186915365377e-630389', '-8146428678.19829265722968550184876355949713211', '-2.495770784312959362699322831209217182948509522379341695956869850581819979308406e-630399', 79, 6); t('-8.80968952319354396523912357e+2456695', '-6.492980183108946861591227042230148725400050615256e+614', '1.357e+2456081', 4, 2); t('6.73e+4224706', '-9.233799954672042747306446103052e+9209532', '-7.288440331215e-4984827', 13, 5); t('-0.000003414722628277670669974879878851201242852897449127509002623', '-7.014149958310288e-8', '4.868334222355689335058624170936971298180118484017358304397577854928e+1', 68, 6); t('0.072', '5.1983683086560884587699109613617418155e-9', '1.385049995016875722967743429414378372439e+7', 40, 1); t('-1.338978994e+8067997', '-3.97070916485840e+5074731', '3.372140689250781509100506146409902491645127e+2993265', 43, 3); t('9.56220432914296527994334833884e-291911', '-1.3300786550684799774706702e+8422272', '-7.1892e-8714183', 5, 2); t('37129207042.34059433', '-3.4143681924e+36210', '-1.087440046008688747354791577515399771213e-36200', 40, 1); t('-3.8252411190396990353e-5554705', '-5.558332697645348325983931729040156241965445418932890464e+1891319', '6.8819938048331811059310395225218740856654538852094678988262914449015997267270979957638614105e-7446025', 92, 6); t('-9.493901598022e-7007008', '7.831756437e+943619', '-1.212231467409971498325848664284757301882369557657887107757613223640141657791e-7950627', 76, 6); t('8e+3736', '415529.64400479270780702', '1.925253737109482425719934804193610266756072568e+3731', 47, 4); t('4.8261982665872253349e+8954', '-5.633701332273250863710377840063314953449559081e-6349328', '-8.5666562388386490227642480002993e+6358281', 32, 0); t('9.758536600372596325785494255136077167427367e+14592', '-3.585215106457210755904915e-7', '-2.7218831536207752639190418827482157555625712612874502608548806056775718717619968e+14599', 81, 1); t('5248.18337176732283137202642608365', '9.0757472991007097541861102207041693219054e+276847', '5.782645989148850083866552505497745692741757445028131910249582e-276845', 61, 3); t('-8.0883700308754e+523', '4.082408241691223176384316789368180e-4525', '-1.981274177401871791343969565861270460864529e+5048', 43, 0); t('-9.4263305836241369821327693986430750344739839184327753e-395', '7.80053e-4202', '-1.208421810264704703671772225559426735680009424799696e+3807', 52, 4); t('827369713437207.8', '5270746.693443841509271', '1.56973909307072872298433504431718708411091593563381731e+8', 55, 3); t('-7.34972710593718317572113e-213', '-9.27768949044257177207565537e+569431', '7.92193693646302513719601435836648594e-569645', 36, 2); t('1.12753491736721481618528e-6356224', '-9.95603226182194995745e-3889', '-1.1325143267071699637599563469e-6352336', 30, 0); t('2.53415295977175651933249676513e-969125', '-5.9177478931779603437e-13', '-4.28229286802358325518944712427e-969113', 30, 2); t('2045768316.447', '8.667e+14375', '2.3604111185496711664935964e-14367', 28, 1); t('1.0745413851003e+670334', '-0.0005812493288670238534450263', '-1.8486754852600092072717422551e+670337', 29, 4); t('1.0342009147082649505352372932771459593766933290995e+11321', '6.06616927193404744763816689964266409963740849048647890693882e-43039', '1.7048665613291329544205259224167695273692375637911853156678814141196410111663047887e+54359', 84, 0); t('9.60056356103035832418236626389542455410e-187', '-6.26348208e+436', '-1.53278375165884697864137040269067466607967049536126396964e-623', 57, 6); t('-6197516404.5727345', '4077346541.2387566306616005827481760152', '-1.5199876541987131942033977753149629852393423205812488857917610969656973883190681815e+0', 83, 1); t('6.163639583583888177274965738338099883087298530097564809998', '4332065.091903051587081610175387143489927575548196714000264', '1.42279477635370347587358751666663337470283118e-6', 45, 4); t('6.6115091139797029905176079494224764948219022e+691017', '7.6055417816055105231823229703355815267288674655065e+4880439', '8.693015308876562683032125349295039508925e-4189423', 40, 5); t('4.081743186005789617453227486530252062883326e+3732', '-9.636212118238603608715858526409473e+53323', '-4.2358378332915823824929359201722e-49592', 32, 4); t('9.996147e-107080', '3.414026574568310e+6122', '2.9279640277152713115961628015455467038358355650992235920418058938069417888e-113202', 74, 0); t('6.077174e+13', '-9e-8468', '-6.75241555555555555555555555555555555555555555555555555555555555555555555555555e+8480', 78, 1); t('-2.691e-91', '1.5631861078143808079652313930129878e+9055', '-1.72148408084467219701462721427665493327930551598941271394e-9146', 57, 1); t('-7.1186912e-554', '-3.3021539378796648848498e+10266', '2.155772060878227621617125677860322420008775232683732837e-10820', 55, 0); t('9.298831373664187864963e-875910', '6.092526889598348072692618e-39198', '1.526268417385223311898121582721796944492167527e-836712', 46, 3); t('-3.959199513713537470721417013508925579431591685403665e-23', '2.177878829998357051791642667058828071220900322e-344', '-1.817915422648432746650098260870105271574e+321', 40, 2); t('-6.260661890e+975', '9.6354947098881745806e+7470091', '-6.497499172e-7469117', 10, 5); t('244.4549960429', '-5.72687888477033537235946280197051727843316295863216378e-6816', '-4.268555367793557970295249887962477722e+6817', 37, 5); t('-6.1423370070253e+74', '-9.5379e+13283', '6.43992598687897755271076442403464074901183698717747093e-13210', 54, 3); t('9.19510650518108750615390751758334209738009e+2057', '6.69005112058700081722e-9', '1.374444879335135370200330960253771661552962647029987667998755566016991577308754896885437262139721e+2066', 97, 6); t('7.3215842477188520866324170442227693187792985524973e+9421', '3.24858883704858393023258050e+326349', '2.253773750688214563968520941574608349783978250431353830408605841e-316928', 64, 2); t('-8.71579276054510e-840725', '-4.5318428404942247115517113500e+4076272', '1.9232336749777029760673710759179490621192e-4916997', 41, 0); t('-1.434965893134070200e+737', '6.56713666493874217451706755585572060113737727797e-1753374', '-2.18507085560622403906384487e+1754110', 27, 4); t('3.0712e-14392', '-7.759710318697827649447486735203e-695', '-3.95787970666846253106476319638807542737616396452358012718290267156312677821860868274851929e-13698', 90, 5); t('4.515454616130906017e+7619844', '9.884728661928585523753677730e-160', '4.5681118527030023482697598985949953012524191993079407720918526810486454082388753e+7620003', 80, 6); t('-2.8110373e-8559', '-4.437402446799e-59', '6.33487120832998204565922852639953595216609541e-8501', 46, 1); t('9.898174463814491001960787200757e-351779', '5.17618853629777668395280867942999428217292400609474171e+9746', '1.912251533035169003660476364567518725666095003821083516178081878907004775e-361525', 73, 6); t('-2.36612760320894668924700844852e-11', '-3.2745317602179171193943683425524684e-5640419', '7.22586e+5640407', 6, 2); t('-6.9596693490802999514161313229487402867972607764597969656', '0.285226683055', '-2.440048481627601891131e+1', 22, 1); t('8213460144.175071054072894126373913199631949943627338', '-6.406146817044620719196002718063148338027967572686073281975e+3322', '-1.282121746308060279295936331964983994097358126750768e-3313', 53, 4); t('-5.003483249812549e-4611', '-7.5567e+11', '6.6212543171126933715e-4623', 20, 0); t('2.449575143613357647196960436154e+202032', '-5.57899958218e-96022', '-4.390706805997256525137717457355e+298053', 31, 6); t('-4.46938143438468080209676025575587201656881822e-9659', '-5.984e+4', '7.468886086872795458049398823121444e-9664', 34, 4); t('5.6387496904523695598823606916050957932186171021418578327e+9365', '-9.544373379e+557', '-5.90793074258706613397501775543759958054195178625341353873704106269332068635953979059e+8807', 85, 5); t('1.974211512831110190393842525e+2159', '-7.5333111e-954', '-2.6206424859197839186461349312920317335626826827847319354699157452823e+3112', 68, 4); t('-2.75661977053791701e+2119', '-7.053741385645802389176689645132526282432285239880e+94', '3.908025003790999946844454749816e+2024', 31, 3); t('5.1342e+9743616', '5.275918495265529345902796796716985476235726904590e-53416', '9.73138611714206009726988993150647502487193836013279e+9797031', 51, 2); t('8.699730749512133925496377234206818932534723e-26', '3.4453652768954455250050574257269430987581619e+18096', '2.52505323828865520349873985458855189292005057179257850602e-18122', 57, 0); t('5.664812257591541352640567193767046909e+5285462', '-4.50890863902081e-98996', '-1.25635995562e+5384458', 12, 0); t('2.48787856672556002496774233785963666018036490e-3933029', '7e+9', '3.55411223817937146423963191122805237168623557142857142857142857142857142857143e-3933039', 78, 2); t('5.9539641341102645550947770478494e+92', '-4.75178622046245861e-353826', '-1.25299494924054185512831751632966705933995697937245501289820563149146969666625336886948648e+353918', 91, 5); t('-6.6467837002751853908074751004e+306', '-4.038815721317747800760251e+9875034', '1.645725915443979128881e-9874728', 22, 6); t('-3.90481922628843248465563624942610858391358568576661024620e-9430363', '6.86298535478499436869820023137287780e+42', '-5.689680254914027591083142859442789256657e-9430406', 40, 4); t('-8.2518803333e-533225', '-9.24020999585292426696466624169357039545383424430979282339e-18', '8.93040346161343297196403649076651682277186476894263236646878545305731717653e-533208', 75, 1); t('-6.41067821e+1929563', '-634707603.4845767020225598693480791090464897823639', '1.01002070477887043351480601517769897426205015629537362848124473191484020741186184361711283e+1929555', 90, 0); t('-5.29769762830211349249371432620016208443703741565651e-50', '-6334138.745141023440', '8.363722111969881402006309448199286039523090527712710816906890818173036e-57', 70, 4); t('-2.3246540870049496042975e+2618120', '1.84626e-2187859', '-1.259115231335212594270308623920791221171449308331437609004148928103300726874871361563376772502248e+4805979', 97, 0); t('589439697404682003466316343821213808907714760264392950296.63', '5.0538982896632129382945e-19414', '1.166307004259006792096343990731e+19470', 31, 0); t('8.26480049309339941034744554426537640559003873e+24071', '1.434717967251003e+3742407', '5.7605750271108703532514803677705634244967e-3718336', 41, 5); t('-5.30821970682964756e-76', '-526439554137776.72963094920296618803361', '1.00832463387437845435615560827809802074792353644794953149743469241120147e-90', 72, 0); t('4.311965340061586939626215684855913788626e-8', '-9.32810863172e+10503', '-4.6225505e-10512', 8, 1); t('2.13266501674148824', '7.37536229399840276277838997115967667e-146', '2.89160712617e+145', 12, 3); t('-4.66156710e-446412', '-6.820532155030260614e-8', '6.8346090804102631685015214277836006333821193730158535e-446405', 53, 6); t('-8.82064291547559016172450119651e+79', '-5.4674580800399448262374442512877928110e-1791', '1.61329e+1870', 6, 1); t('6.3596711367398199051223744060326168881439e+3056', '-8.883549974554361168e+2140706', '-7.158929881586e-2137651', 13, 0); t('8.63344450591553536794379391357748211859613547151595216686882e+631007', '-9.306113242e-9', '-9.2771754237326476839618431043131315880414852483652510521092367339150846752612512428e+631015', 83, 3); t('6.32284303943007431017430713697567343622998485776636892e-18204', '-4.31887792782567090607946548286754406305e-12', '-1.4640013320805515334524558592826803332326816100722554340228220377e-18192', 65, 1); t('1.5815379736946253094296859750535722520523348159337501e-17665', '-4.11605663823501643028e+647', '-3.842362029237760670080940768743697502e-18313', 37, 0); t('-7939.872355277727171649400758601209134330843696485138807139', '-2.91112674291440540550e+1323', '3e-1320', 1, 6); t('-0.00000148115859547900950011238279210334603860165011296461564704918', '-4.4295118395258202244277902683985985624021130912914319919e-7', '3.34384159956905704091232369069871203206530571769674042045243027875e+0', 66, 4); t('266981379708464635528679062258.658592890445', '4.964727712220529955255959094237e+36', '5.37756338683585589150289962166402092299189400317172648438999576e-8', 63, 1); t('-3.187e+919', '10981.102917099818918109034451475537138036009209', '-2.9022586e+915', 8, 6); t('80.135553297053310740901117923616751991741861777471022922438', '-82833381935785564468926997.89', '-9.674306592863288431519859031141859534552449136845119431629912988063819273790784971905634170315096e-25', 97, 4); t('-9.447e-2214870', '-4.02859195e-248', '2.34498805469737385539878269378957578466094090268933789633373e-2214622', 60, 3); t('3.537998468838195685676415551113685395e+48', '9.69335109087128902877435769874994e+97', '3.649922958191522497244e-50', 22, 3); t('-4855720230870.4513269267507827161759675488297126143951243', '-8.978021104558769533582361710462833003030e+3869986', '5.4084526805187196503132422238527776973593807115231502537719311625302164553227775876408569e-3869975', 89, 2); t('7.9073150787460439055865282028109202712084498e-544790', '6.713853057839122093518452955731930140287889480527347558e-575', '1.177761117293657583125510758944553850835483047228170334416596532458195983379713435e-544215', 82, 1); t('-7.0246617720278760567399028884942086203916538845346940146531e-58891', '2183595774.1495622228711848208567', '-3.2170156469385e-58900', 14, 6); t('-4.1554766870736563308759442357139307684550517467617353e+4024363', '4.9462375307766183668878880051431621794434865e+640537', '-8.4012881735204432464215822e+3383825', 26, 4); t('-4.29667656930e-8', '-5e-767928', '8.5933531386e+767919', 65, 5); t('-6.5683068343471e-734', '-2.4572504884364226184e+103947', '2.673031042320227954491762381864192357452574244095247807952231531984e-104681', 67, 5); t('6.21382e-75932', '9.82665802304965078603145627378041998277e-4604600', '6.323431613702960816871350284176133492595459728316355381847081047538451474732340194023040634744e+4528667', 94, 6); t('-0.000009258864551042', '4.990762091803464240668236178624803445974525855403435282722e-9604371', '-1.85520054467196855669308613647928e+9604365', 35, 3); t('3.283065692310497267366594014029117947915679163022009e-4099', '5.0673e+72044', '6.478925053402200910478152100781714025054129739747023069484735460698991573421743334714e-76144', 85, 3); t('-246205519.6160710857', '2.0786429621526408051589737776', '-1.1844531461098103557356950933e+8', 29, 5); t('1.96996176661e-32', '-0.007520124374695263931707081680897322788587342963575305', '-2.61958668295273807174439251980211589593757178491479789069225901928231849254098778e-30', 81, 4); t('85309.282645332177647', '9.0530400989665391896526077147820833230375706618634454476763e-468', '9.42327458099636194382951e+471', 24, 4); t('7.46549264710535489902e-22021', '8.219797516276011666e-6526472', '9.082331568780059900776833452013563141000516755655840228779e+6504450', 58, 1); t('-2e+9408647', '6.792365459e-279427', '-2.9444824e+9688073', 8, 3); t('-1.4869439219432551169022982211734456823791811e-53821', '-4.753962373314970926600160e-174260', '3.127799097211614676184374590345322354170231441e+120438', 46, 0); t('-9842810715.9', '6.60e-1698463', '-1.4913349569545454e+1698472', 17, 1); t('7.4395147817040973452e+40720', '3.84413418436305e-7547520', '1.9352900874184e+7588240', 14, 5); t('0.000332961362352164511623710207423', '3.56408060371164469639468861134271077818745896596463780230e-383', '9.34213895177952784485746495343061820660593602008243425404005852292077e+378', 69, 6); t('9.11885341940473839408575938384012774321e-67661', '-7.9088914133010387e-82', '-1.152987560819055655134282968842532883671228044459732713502144508654141256434344544533783737e-67579', 91, 5); t('-8.5299488303848936302456362584099035594107537410287271e-8718651', '-9.00665e+994', '9.470723110573735662255817932760686e-8719646', 34, 6); t('0.833089432216403153611265477411666667722437374885897542', '8.452416810975134215117323697872422419111482142244267e-3703', '9.8562275245899960143964693715285659594591676668928363960727587189814679235958067247966474e+3701', 89, 4); t('5.267800714111572978525196102401627', '-7.1623611695175815037718380616992824807e-3141', '-7.35483814545809056755308e+3140', 24, 0); t('77089446871073734.20656227941369002814763630781', '8.8360092452637473565059972961820798580628476486164e+369045', '8.724464261102375048586255640858e-369030', 31, 0); t('96.057686032', '-9.7664635750735133301862997579178533878422944783e-153548', '-9.8354624776529678911279137666105749233297209023387053186670156e+153548', 62, 6); t('4.6073647059765138615100569747306494e+460449', '-4.016357979536216937024597732603461e-74', '-1.14714991279451204739420697127464043074572817763e+460523', 48, 3); t('4.350908566861098931216756910746119162724e+35343', '4.2609754978301988244448e+850', '1.0211062159537637329667714295253130817127687109713938473797596231e+34493', 65, 4); t('-9.696817050283784414e+276', '-5.58646555503374552833341e+848', '1.7357696e-572', 8, 4); t('-7.331827097971634879917964286056959941446213902723568401e-304729', '0.00000831207514828107390', '-8.82069395088163e-304724', 15, 0); t('3.93298669402072794114299899887e-1512', '7.72901242e+6084', '5.088601855320511881313549e-7597', 25, 3); t('-2.96069842842096310574354374361594164148796243762076951755e-52360', '9.4498830587855422289076008000990209e+3302491', '-3.13305298065927512091787709367118789213584665501097002376246990602481396197340165632300247435479079e-3354852', 99, 5); t('282915.480593920130121418412422920892712008902242859399312', '-3.354915161e-23', '-8.432865423326874110525932683128164882736624952849572e+27', 52, 2); t('6.140988363085712725567739450374627167244289442639108773e+6386792', '9.1120851642928672190039064249101487287727949738e-1704960', '6.739388682570853684179467563520673598429275815020203947894675160880482100515988907105380019e+8091751', 92, 0); t('7.513800104665443626e-9', '4.351697135827428703651877809027189690e+429', '1.72663672818691570922446114251232631073214343999185786701640482832705308105395741077e-438', 84, 6); t('4.99868913267e-21296', '-1314559598.28304496971968258586544140117578601', '-3.8025580119751292422e-21305', 20, 4); t('3.122011910671616030999170882e-19115', '3.11255681556277824063788823568894500609528e+3240', '1.003037726110431890768655418563117605342573532007920614522264041479690874526694135e-22355', 82, 6); t('-9.19840826446854973629e-95', '-4.0521142148298574429375388605104558951973577402808e-43504', '2.27002689874939221510659964466029590690036233697910568845721348412425768805251323e+43409', 81, 2); t('1.1673464029850883003119121721172557888837420940492827e+957504', '4.71e-592', '2.478442469182777707668603337828568553893295316e+958095', 46, 5); t('0.0003131148567813440028672576', '-6.13903486298707232884630445312e-2634', '-5.1003922240146979403385557685681305352589500148346590588099546742473128356912091213547398e+2629', 89, 2); t('7.45962530480932527632954615098339718750060776e+71', '6.04e+779', '1.2350373021207492179353553230104962230961271125827814569536423841059602649006622516556291390728e-708', 95, 4); t('-8.007e-2746151', '8.2348473447307518277589610315123817900739797596584615055354e-84', '-9.723313213721508799981483924981536944935804447e-2746068', 47, 5); t('5.52206533635738356000288e+42829688', '2.97651439558070354509685445493557826e+333821', '1.85521203746103682221328466556500511430721560358069905849521383076460210798e+42495867', 75, 6); t('-5.088e+875712901', '1.4199149740929254e+2656459117', '-3.584e-1780746216', 4, 3); t('9.2e-326014121238', '-9.07e-76', '-1.0143329658214e-326014121162', 14, 4); t('-7.22327739417772967251812419997120919619633699046547e-6186894660293', '-6.3769027162794938112644712016423387e+15531292765228', '1.1327250415374127268627640555328593529976903962e-21718187425521', 47, 1); t('-9.12342611074207276438290905850859777332891323899289165355751e+23642610836', '6.638794680948338252998590908e-512696438889772', '-1.37425941743973470637312280491167133324e+512720081500608', 40, 0); t('-2.718876507122563373164805019732402755726e+610154533', '4.308847138979439886664436527015146639e-5717273', '-6.309985987960889637562597121517139258568481214838008e+615871805', 52, 6); t('-2.95e-84395067694', '-9.051e-25', '3.25930836371671638492984200640813169815490001104850292785327588111810849629875151916915257983e-84395067670', 93, 6); t('6.12234136045360125959997290809070858536820218876929808e+880', '76.92743310785533857019259359198418220218', '7.9585930702638079165374686911356231401285147e+878', 44, 6); t('6.4140648917e-84014232852473', '-5.510e-848230403796', '-1.16407711283121597096188747731397459165154264972776769509981851179e-83166002448677', 66, 2); t('2.623435946859656088898662e-439110203108669', '-2.59934167915826734419163896376463735432272483690964181443e+22771179081', '-1.009269e-439132974287750', 7, 5); t('3.77771400014986649e-3640965368', '-7.768388036705130880554826e+60288744811328', '-4.862931643347902095997739979134e-60292385776697', 32, 4); t('-3.7190486e-9449640603576', '3.010673196779523061481248096425808318766627214198e+460955994', '-1.23528804254749956038144330221809830464007779452844731e-9450101559570', 55, 5); t('2.62926579885660625e+4862548', '-8.59856524321313877484710204275252176986556420841500574858e+4819840', '-3.0578e+42707', 5, 3); t('-2.524950163943407096544e-866668', '394.90557961', '-6.39380726511130060491271669525652058689584236538105772650417477852e-866671', 66, 2); t('550.4642428428653', '9.1101038960828308023431523605217648626593940842806e+17458828824', '6.0423486836364e-17458828823', 14, 4); t('-6.8e-38', '8.9551e-1822287', '-7.59343837589753324920995e+1822248', 24, 5); t('-5.447540e-28798686244', '-5.345151786051220e-306831268640896', '1.01915534264452015382856476e+306802469954652', 27, 4); t('-5.024994880550e+2137246', '7.895448984359022572465424e-386506976500376', '-6.36441941491177264370878071531473745226066140771862199179510949585079669357392134354992036344e+386506978637621', 93, 3); t('-6.08564742269871323619829704490073949296602829e+19025916382', '-3.6e-43810970160450', '1.69045761741630923227730473469464985915723008055555555555556e+43829996076832', 60, 6); t('-7.3315478778634806938360668122298015018709306244776522955182e-371912096', '8.91746537243695600952885083953e+2702', '-8.22156e-371914799', 7, 4); t('9.73260146343212982991740729169222462263658685696162754956027e-22368507555', '-5.41457945052064335762744916138190772711113115303334672e+2471502', '-1.797480589650648399009368412431136314816546487012269e-22370979057', 52, 3); t('-0.00009077766680012965169574', '-9.864458426424591130875595041492160946022032e+901238013227', '9.202498796787199549471832328e-901238013233', 28, 3); t('9.781679164322202110e+9597', '-8.641207387556310909276425467620158738317e+729052237', '-1.1319806047483846773794769631121259324922385e-729042640', 44, 0); t('-9.8262134872771847603721e-884906848471488', '-8.40191682826069e+27069057754468', '1.16952044255256e-911975906225956', 15, 0); t('9.68468476476931178176001218812114617858e-9042', '-4.351426837802378087e-3922', '-2.22563428635293669783342668520694795499991487062628653382642814248e-5120', 66, 1); t('-6.673881203135270007501032890781676e+197', '-8.6130247e+5574477675', '7.74859173e-5574477479', 9, 1); t('117689.2203859123922039850242', '4.672903266480619296129041823997391978768000422443130e-159602702578', '2.5185460445995839266693837903e+159602702582', 30, 0); t('396858.23797993900145', '-1.1351391313670681683112832752941408479772854e-231501514616', '-3.496119788435058122899220192e+231501514621', 28, 4); t('-2.3747155e-943', '-6.252178142e-495179', '3.798221109612138751500084816e+494235', 28, 6); t('0.00840506301611388376116385269076480', '-1.9099e+8284284716', '-4.4007869606334e-8284284719', 14, 2); t('-4.16692746895958397175358959429449784278165607548e+340931500', '-5.717754287e-87', '7.2876994354822018810434929665498895244528301212045420656951011088455e+340931586', 68, 3); t('-9.28389313299006329424285545887e-3925', '-1.97555681198482273934125909e+5297566071', '4.69938048689302234899586964124151630183496133717869393459635207158684409706031e-5297569996', 78, 4); t('2.59540333821819953654940688e-246897272142', '-4.9195761293882986672634895403121365796657943e+725', '-5.2756645490531572282469478803463890191217367723692684945787639199827846880769858499841263419547e-246897272868', 95, 1); t('6.9395240e+2278489037670', '8.95379929543273201870087684015352822705e+2686557018', '7.7503680516267555657047785558173852295405088184624218108643043e+2275802480651', 62, 1); t('-9.43461909417195191736082247633595980338e-44506', '3147834.7690127', '-2.997177357289012066606108455208457679374102048833411593840812447280717383143e-44512', 76, 3); t('8.0096127e-8067961309810', '-2.4861943641101754193763318966517820013802487677849556e+28737902', '-3.2216357721761189414886402877242567323592454396651199043193694782512026268261382719200753e-8067990047712', 89, 1); t('-3e+47914044916', '7.39032227496857769766000637292224305e+3151003', '-4.059362891603743292519367648173262662931001810631877144424048461001341365751815846570031160429e+47910893912', 94, 6); t('-8.794913236e-82269964025977', '1.99104078230641940199220131540233592723e-4032340415018', '-4.41724414394565158181607764560046776038373016888813781624061504013452734e-78237623610959', 73, 5); t('1.41968105004406037270658e-9756', '-6.45346706e+86374', '-2.19987339649341972887761202890528e-96131', 33, 5); t('2.42668305687527863637722979736247525202724198845375321e+21217079928', '-1e-32283604', '-2.42668305687527863637722979736247525202724198845375321e+21249363532', 75, 2); t('4.5960279e+6886974', '3.384439396e-9878', '1.3579879448962660639115193658500954289210738167403131127008072e+6896852', 62, 1); t('8.20302760909992674523110835076e-3190635561', '-0.00593408148019', '-1.38235843853584542319248668631e-3190635558', 30, 3); t('-1.446056788247471381740e+2539', '5.8746691249772632743e-204100', '-2.461511886855530870086019294051905971145867015553516078749595608714911097966096169396492e+206638', 88, 6); t('8.32020591493941974120926689522320401504559e+824', '-4.13656016816944653681263343833701120610642568125182e+36485506', '-2.0113827859e-36484682', 11, 5); t('-5.887058727145392610657250e-2197', '3.78194900860346014025947378458706e-8294267936', '-1.556620333524611679761108765636991252383460065276994885579337256044375049207119109e+8294265739', 82, 4); t('-7.6723323078147436832774113998379e+59830074', '5.39266e+7420616030062', '-1.422736146505573072153151023768956322111907667088227331224293762262037658595201625913743e-7420556199988', 88, 3); t('-2e+520902', '2.096256902873932e+850706884', '-9.540815332596088537412307660142977619618078320312637700439893846e-850185983', 64, 3); t('-5.91755623713028987336574603543834970e-772733', '-3.396837696660708e-743484', '1.742078004771201e-29249', 16, 4); t('-4.4261203993578076655836e+787568578554', '-1.09996983956065779587019620309266550937270720011352e+59408794921163', '4.0238561460245650861475347988199477648605072309975919369249233277670985289138655590183690383863e-58621226342609', 95, 1); t('-5.461625333592658715783389213939486766866733272971751e-8493558571126', '-7.04460022714407607499e-639442', '7.752924449208716784930185168011748e-8493557931685', 34, 4); t('1.615766164740165668562139888290618789895261e+863655', '-46413982727354151235644606048354659364.730096733328316079589', '-3.4812055975276420840108237250312e+863617', 32, 4); t('3.09253256167906696109040961441832872372394818118267e+73897720', '-2.0e-95602765', '-1.546266280839533480545204807209164361861974090591335e+169500485', 54, 5); t('-9.26915652715987334687941849664813e-6847', '8.76573855902163943304395e-34831559', '-1.05743018283611932638742e+34824712', 24, 4); t('0.428254', '6.08587970298546333861572751514e-437013115144', '7.036846288465372292244370006092052112772901167702223e+437013115142', 52, 1); t('7.690393e+80', '-7.604559818520535e-58509606603', '-1.0112870676972548059475609571154e+58509606683', 32, 1); t('-8.7801511725350736391998727179413695428856e-46359854365', '2.656781732693285651736344541155412284165970972485e-52097919051350', '-3.30480711474716594625752093810676249541657e+52051559196985', 42, 1); t('-1.27344496055459765937e+271188', '-8.32335945788509645225021195304781189636479e+3554126038', '1.52996511444451123611236024918713725931624703340785401601483423e-3553854851', 65, 4); t('-3.65362545705027531865430033750885949341477432262361470e+31405568', '2.255132753727929182126744495e+730457', '-1.620137639795491831777414566302950142374935254948e+30675111', 49, 0); t('3.13885105182978617280583072515316525825875033e+332826699874507', '-9.338570883214e-738313', '-3.361168524695618746504239051218405301858301969629363403151813526982628773e+332826700612819', 73, 5); t('7.916679560335212649839057098992815521111e+719168799789', '-9.3934455354681629e-26112', '-8.4278761509214954487660555758252e+719168825900', 32, 3); t('-7.4050648550717e+50457757', '-6.2446992145755164825827251414468888532118248382938e+41758863714', '1.185816097881514920689222170540626820579389457787832291775344955065933067404e-41708405957', 76, 4); t('-8.929984835073619447381098534882495124442070497803e+58', '-6.587552599082064547988352408462234967908817169753363929e+31478', '1.355584596974293397998024892163270225765679420243e-31420', 49, 0); t('-4.60e+3009732668', '-5.937435922938207873836812582485666474437571935215e+593', '7.7474520309831614048631736455137088e+3009732074', 35, 3); t('-2.115852508924661360352573897314e-83492', '-3.615253334615070879769043191528101492811972e+633', '5.852570520206556541343590796945702040066516674420075510945e-84126', 58, 3); t('-2671969484816629153.223031082473984381206', '-6.958622418800189e-6567179660', '3.839796620661208652769876288190432072799554268055501997751724529e+6567179677', 64, 3); t('-9.80911731960529794611006207152828152873100802686147229842508e+6602461063', '5.3006989098e+8373928', '-1.8505e+6594087135', 5, 5); t('-4e+4572149243', '6e-202556705641', '-6.66666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666667e+207128854883', 96, 0); t('-0.00277841246858389626011775371318910', '1.8029407e-8536873', '-1.5410448433406025279243813804797351349e+8536870', 38, 2); t('4.7366313774491542565994e+38590', '2.406574840920790361677323136428733366735190265835e-255', '1.96820447754570996174179187399056431789444073676092111382443598571041094824984995983407986690911147e+38845', 99, 3); t('-6.8793e-250', '5.6614239616418945369613535047947337585454417557391441e-22075572042', '-1.21511832475533308422685002589067048097909869932735928124654100237696191523886602e+22075571792', 81, 0); t('-7.9691e+5609', '4.7681728586005155851684044977835802380288408393935015223658e-824', '-1.67131105274966347e+6433', 18, 2); t('1.0163534771988257390384167798155678794959252153462087931e-7715', '9.857359701875963927124446349477232948130e-437', '1.031060555703777856579890730713937713166817989375566680949e-7279', 58, 6); t('-9.7119632239e+8914261', '-7.649129054596519809384883678662352318e+253', '1.26968222847068850083141642946053701890587434551e+8914008', 48, 1); t('3.82363000571632324625934315425582292e+9180', '-1.80015752902682364919840204196030449769953e-99958', '-2.12405300317e+109138', 12, 5); t('-9.98558786096530479519949931833477023441119520278653470635367e-9264430688990', '6.171492751155687501557785e-17356584223488', '-1.61801824349471711425087129591403125504623734104116821827862506496897452602816398117264777747324619e+8092153534498', 99, 6); t('-3.12121494951535774296813228065142594e-478824224292', '8.50191771196677938994457457569983125317092894e+3040', '-3.6711893189957913554e-478824227333', 20, 2); t('-3.905945148e-172570', '8.89926102560e-12918480850270', '-4.389066841352320025379703702395017431e+12918480677699', 37, 4); t('-5.836899e-182382713103', '6.38e+19389700249', '-9.14874451410658307210031347962382445141065830721003134796238244514106583073e-201772413353', 75, 3); t('-8.594943581149000619660143727800023854493343961823123e+67054', '7.72e+2366970549', '-1.113334660770595935189137788575132623639034191946000388601036269430051813471502590673575e-2366903495', 88, 5); t('4.422365172768345093341e-2474975', '8.142617173685931298235094554798454571552396073414454172878e+9459870092', '5.431134828565771941340664370852421405016220824937189375783467328373642722704174130143294674583e-9462345068', 94, 4); t('-7.510777732366610825653301072159051623394773695674094995e-3800345125', '-7.54354768818769002580340046770133074466784814214428947940e+5562', '9.9565589598215265433145400278831188933392065e-3800350688', 45, 0); t('6.1671423e+660', '6.873408012860653767381e+81013597436', '8.972466480181041945852762170983402582389595248407929170371790700151282177e-81013596777', 73, 5); t('2.02905811715297381814621675599006739725025165e-51', '8.306267856406390279349177689134436968649054e-88657834', '2.443e+88657782', 4, 2); t('-7.30e-114863902', '-6.58150691865777045498e+8689204889449', '1.10916847618975970006982958021532537105975629156199373295733575150771e-8689319753351', 69, 4); t('-16267894490157915816.761057622507335134', '-2.6263660e-57826799', '6.19406986313328599927087756333555000864312133e+57826817', 45, 1); t('4.4960822e+39834', '7.33025617737765e-5481077978', '6.1335949129249167141534547767142719606447193876923e+5481117811', 50, 2); t('11645961997440560519.2779', '7.61704147340133475340398370e-85', '1.52893509088905360245309042010759347198609170499739373773404875920893e+103', 69, 6); t('-3.200086468434878624724682260146719593251199021453006e+804185673862240', '-3.263005e+866674275403947', '9.80717611047142e-62488601541708', 15, 2); t('-1.195589034688348019231392777232e+387700847749', '1.2e+193718376381', '-9.9632419557e+193982471367', 11, 1); t('-7.7e+1775502', '261635432706832846.96155773903613920484498458287709539496460', '-2.9430264549175137e+1775485', 17, 1); t('0.00000546080760524465654739580663090511882514661697598240953776895', '-6.157849021385171979316104052444661102794551310655966818e+72472889810', '-8.86804399e-72472889817', 9, 2); t('2.8745074607815233067829206777233019531e-3845392237116', '-6.551146743e-662', '-4.3877928148273861780948366061e-3845392236455', 29, 5); t('-5.009861751554417108711752976e-74', '6.4649177022317048296284966530107e-89', '-7.749304758860272920489918385655728441338390550598260504191304956289874399458870815138e+14', 85, 5); t('6.6207966524387094348639971078e+8382394', '6.7558172830535640711220000733714793906928341502e-2246070', '9.80014167796760391792195206447498138446966736663067272302432667301486207936e+10628463', 75, 4); t('4.4513588705101755662795e+635486688804809', '-6.556877492876530213198836587854853e-4323337939', '-6.78883946717959097065518224297035382056172928446181486912391244568509234794436034526869106696e+635491012142747', 93, 4); t('-6.16322132e+994316265', '-4.3969e-2987200797', '1.4017196934203643476085423e+3981517062', 26, 1); t('-8.332e+2033', '-5.24183781e-7534', '1.5895188485429311671129328589432262498789522829589418372332279392e+9567', 65, 2); });
$(document).ready(function () { $('#id_1-alternative-1').focus(); $('form').submit(function() { removeEmptyAlts(); }); }); function removeAlt(altIndex) { if ($('.cloned').length > 2) { doRemoveAlt(altIndex); } else { showMessageInDialogBox('More than two alternatives should exist to perform delete.'); } } function doRemoveAlt(altIndex) { // how many cloned input fields there are currently var num = $('.cloned').length; // the numeric ID after the textbox is deleted var newNum = new Number(num - 1); var delElement = $(this).find('#input' + altIndex); // delete element $('#input' + altIndex).remove(); // update count of alternatives $('#num-alternatives').val(newNum); var i = new Number(altIndex + 1); var j = 0; for (i; i <= num; i++) { j = i - 1; $('#input' + i).attr('id', 'input' + j); $('#id_1-alternative-' + i).attr('name', '1-alternative-' + j); $('#id_1-alternative-' + i).attr('tabindex', j); $('#id_1-alternative-' + i).attr('id', 'id_1-alternative-' + j); $('#btn-del-' + i).attr('onclick', 'removeAlt(' + j + ')'); $('#btn-del-' + i).attr('id', 'btn-del-' + j); } //update tabindexes $('#btn-add').attr('tabindex', newNum); $('#btn-submit').attr('tabindex', newNum + 1); $('#btn-prev-step').attr('tabindex', newNum + 2); } function removeEmptyAlts() { $('.cloned input:text[value=""]').each(function() { var index = parseInt($(this).attr('id').substring("id_1-alternative-".length)); doRemoveAlt(index); }); } $(document).on('focus', '.cloned input[type=text]', function() { var numEmpty = $('.cloned input:text[value=""]').length; var numEmptyRequired = 2; if ($(this).val()) { numEmptyRequired--; } if(numEmpty < numEmptyRequired) { // how many cloned input fields there are currently var num = $('.cloned').length; // the numeric ID of the new input field being added var newNum = new Number(num + 1); // update count of alternatives $('#num-alternatives').val(newNum); // create the new element var divId = 'input'+newNum; var inputName = '1-alternative-' + newNum; var inputId = 'id_1-alternative-' + newNum; //create the new button var buttonId = 'btn-del-' + newNum; var removefun = 'removeAlt('+newNum+')'; var newElem = '<div id="' + divId + '" class="cloned"><input type="text" name="' + inputName + '" id="' + inputId + '" tabindex="' + newNum + '" size="30" /> <input type="button" id="' + buttonId + '" value="X" onclick="' + removefun + '" /></div>'; // insert the new element after the last input field $('#input' + num).after(newElem); // focus on the new element // update the tab indexes of the rest elements $('#btn-add').attr('tabindex', newNum + 1); $('#btn-submit').attr('tabindex', newNum + 2); $('#btn-prev-step').attr('tabindex', newNum + 3); } });
$(function(a){a("button").click(function(){if(a(this).hasClass("active")){a(this).removeClass("btn-warning");a(this).addClass("btn-inverse")}else{a(this).removeClass("btn-inverse");a(this).addClass("btn-warning")}});a("[data-content]").popover({delay:{hide:5000},placement:"left"})}(jQuery));
/*jslint node:true */ 'use strict'; module.exports.map = function () { /* global exp, emit */ var doc = this; function access(obj, prop) { var segs = prop.split('.'); while (segs.length) { var k = segs.shift(); if (obj[k]) { obj = obj[k]; } else { obj = undefined; } } return obj; } var values, fields = exp; if (fields.length === 1) { values = access(doc, fields[0]); if (values !== undefined) { if (!Array.isArray(values)) { values = [values]; } values = values.sort().map(function(value) { var o = {}; o[fields[0]] = value; return o; }); } } else if (fields.length > 1) { values = fields .map(function(field) { var fieldValues = {}; fieldValues[field] = access(doc, field); return fieldValues; }) .reduce(function(previous, current) { var field = Object.keys(current)[0]; if (Array.isArray(current[field])) { current[field].sort().forEach(function (value) { var o = {}; o[field] = value; previous.push(o); }); } else { var o = {}; o[field] = current[field]; previous.push(o); } return previous; }, []); } // var seen = {}; values // .filter(function(item) { // return seen.hasOwnProperty(item) ? false : (seen[item] = true); // }) .forEach(function(v, i) { values.slice(i + 1).forEach(function(w) { emit(JSON.stringify([v,w]), 1); }); }); }; module.exports.reduce = function (key, values) { return Array.sum(values); };
var structtesting_1_1internal_1_1_matcher_tuple_3_01_1_1testing_1_1tuple_3_01_a1_01_4_01_4 = [ [ "type", "structtesting_1_1internal_1_1_matcher_tuple_3_01_1_1testing_1_1tuple_3_01_a1_01_4_01_4.html#a8463ac100366f7e8b6ad1035e42ec4b0", null ] ];
import React from 'react'; import PropTypes from 'prop-types'; const keyCodeEnter = 13; export default class MenuItem extends React.Component { constructor(...args) { super(...args); this.onKeyDown = this.onKeyDown.bind(this); } // Prevent focusing on mousedown onMouseDown(event) { event.preventDefault(); } onKeyDown(e) { if (e.keyCode === keyCodeEnter) { this.props.onClick(e); } } render() { const { children, ...restProps } = this.props; return ( <div role="menuitem" tabIndex="0" onKeyDown={this.onKeyDown} onMouseDown={this.onMouseDown} {...restProps} > {children} </div> ); } } MenuItem.propTypes = { children: PropTypes.node.isRequired, onClick: PropTypes.func.isRequired, };
'use strict'; let gulp = require('gulp'); let runSequence = require('run-sequence'); gulp.task('build-ts', function(cb) { return runSequence('ts-lint', 'ts', cb); });
/** * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.add( 'sourcedialog', { // lang: 'af,ar,bg,bn,bs,ca,cs,cy,da,de,el,en,en-au,en-ca,en-gb,eo,es,et,eu,fa,fi,fo,fr,fr-ca,gl,gu,he,hi,hr,hu,id,is,it,ja,ka,km,ko,ku,lt,lv,mn,ms,nb,nl,no,pl,pt,pt-br,ro,ru,si,sk,sl,sq,sr,sr-latn,sv,th,tr,ug,uk,vi,zh,zh-cn', // %REMOVE_LINE_CORE% lang: 'es', // %REMOVE_LINE_CORE% icons: 'sourcedialog,sourcedialog-rtl', // %REMOVE_LINE_CORE% hidpi: true, // %REMOVE_LINE_CORE% init: function( editor ) { // Register the "source" command, which simply opens the "source" dialog. editor.addCommand( 'sourcedialog', new CKEDITOR.dialogCommand( 'sourcedialog' ) ); // Register the "source" dialog. CKEDITOR.dialog.add( 'sourcedialog', this.path + 'dialogs/sourcedialog.js' ); // If the toolbar is available, create the "Source" button. if ( editor.ui.addButton ) { editor.ui.addButton( 'Sourcedialog', { label: editor.lang.sourcedialog.toolbar, command: 'sourcedialog', toolbar: 'mode,10' }); } } });
(function(){ 'use strict'; 'use strict'; angular.module('gc.statusCodeService', [ ]).factory('StatusCodeService', [ function StatusCodeServiceFactory() { var statuses = { '1': 'info', '2': 'success', '3': 'redirect', '4': 'client-error', '5': 'server-error' }; var EMPTY = ''; function matchStatus(code, status) { var matcher = new RegExp('^' + code + '\\d{2}$'); return status.match(matcher); } function safeString(maybeString) { if (maybeString == null) return ''; return (maybeString).toString(); } var service = { isError: function isError(statusCode) { statusCode = safeString(statusCode); return !!statusCode.match(/^[4-5]\d{2}$/); }, isSuccess: function isSuccess(statusCode) { return !service.isError(statusCode); }, getLabel: function getLabel(statusCode) { statusCode = safeString(statusCode); var prefix = statusCode.substring(0, 1); if ((prefix in statuses) && matchStatus(prefix, statusCode)) { return statuses[prefix]; } else { return EMPTY; } } }; return service; } ]); })();
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _ArrowKeyStepper = require('./ArrowKeyStepper'); Object.defineProperty(exports, 'ArrowKeyStepper', { enumerable: true, get: function get() { return _ArrowKeyStepper.ArrowKeyStepper; } }); var _AutoSizer = require('./AutoSizer'); Object.defineProperty(exports, 'AutoSizer', { enumerable: true, get: function get() { return _AutoSizer.AutoSizer; } }); var _CellMeasurer = require('./CellMeasurer'); Object.defineProperty(exports, 'CellMeasurer', { enumerable: true, get: function get() { return _CellMeasurer.CellMeasurer; } }); Object.defineProperty(exports, 'defaultCellMeasurerCellSizeCache', { enumerable: true, get: function get() { return _CellMeasurer.defaultCellSizeCache; } }); Object.defineProperty(exports, 'uniformSizeCellMeasurerCellSizeCache', { enumerable: true, get: function get() { return _CellMeasurer.defaultCellSizeCache; } }); var _Collection = require('./Collection'); Object.defineProperty(exports, 'Collection', { enumerable: true, get: function get() { return _Collection.Collection; } }); var _ColumnSizer = require('./ColumnSizer'); Object.defineProperty(exports, 'ColumnSizer', { enumerable: true, get: function get() { return _ColumnSizer.ColumnSizer; } }); var _FlexTable = require('./FlexTable'); Object.defineProperty(exports, 'defaultFlexTableCellDataGetter', { enumerable: true, get: function get() { return _FlexTable.defaultCellDataGetter; } }); Object.defineProperty(exports, 'defaultFlexTableCellRenderer', { enumerable: true, get: function get() { return _FlexTable.defaultCellRenderer; } }); Object.defineProperty(exports, 'defaultFlexTableHeaderRenderer', { enumerable: true, get: function get() { return _FlexTable.defaultHeaderRenderer; } }); Object.defineProperty(exports, 'defaultFlexTableRowRenderer', { enumerable: true, get: function get() { return _FlexTable.defaultRowRenderer; } }); Object.defineProperty(exports, 'FlexTable', { enumerable: true, get: function get() { return _FlexTable.FlexTable; } }); Object.defineProperty(exports, 'FlexColumn', { enumerable: true, get: function get() { return _FlexTable.FlexColumn; } }); Object.defineProperty(exports, 'SortDirection', { enumerable: true, get: function get() { return _FlexTable.SortDirection; } }); Object.defineProperty(exports, 'SortIndicator', { enumerable: true, get: function get() { return _FlexTable.SortIndicator; } }); var _Grid = require('./Grid'); Object.defineProperty(exports, 'defaultCellRangeRenderer', { enumerable: true, get: function get() { return _Grid.defaultCellRangeRenderer; } }); Object.defineProperty(exports, 'Grid', { enumerable: true, get: function get() { return _Grid.Grid; } }); var _InfiniteLoader = require('./InfiniteLoader'); Object.defineProperty(exports, 'InfiniteLoader', { enumerable: true, get: function get() { return _InfiniteLoader.InfiniteLoader; } }); var _ScrollSync = require('./ScrollSync'); Object.defineProperty(exports, 'ScrollSync', { enumerable: true, get: function get() { return _ScrollSync.ScrollSync; } }); var _VirtualScroll = require('./VirtualScroll'); Object.defineProperty(exports, 'VirtualScroll', { enumerable: true, get: function get() { return _VirtualScroll.VirtualScroll; } }); var _WindowScroller = require('./WindowScroller'); Object.defineProperty(exports, 'WindowScroller', { enumerable: true, get: function get() { return _WindowScroller.WindowScroller; } });
var searchData= [ ['lambda',['lambda',['../de/df6/namespacebbb_1_1function_1_1lambda__symbol.html#abeec683e4c2770f82c60e84a36c1ec74',1,'bbb::function::lambda_symbol']]], ['land',['land',['../d3/d4d/namespacebbb_1_1function_1_1direct__lambda.html#af078f98db5b749c9eb5c029c409b925a',1,'bbb::function::direct_lambda::land()'],['../de/df6/namespacebbb_1_1function_1_1lambda__symbol.html#a7bdd7b0d741b273dc7189b26749891af',1,'bbb::function::lambda_symbol::land()']]], ['last',['last',['../d2/d64/classbbb_1_1enumeratable_1_1enumeratable__iterator.html#a9646fe8d4d8249128a7e4f29d3bbf2ff',1,'bbb::enumeratable::enumeratable_iterator::last()'],['../d0/dcf/classbbb_1_1range.html#ae85caabb7d2c3608c62ad17e3ca0c048',1,'bbb::range::last()']]], ['level',['level',['../d2/d3b/structbbb_1_1loggers_1_1detail_1_1logger__stream.html#af84cf22e2e4c36aa95b1b101dfa0005e',1,'bbb::loggers::detail::logger_stream::level()'],['../d5/dd4/structbbb_1_1loggers_1_1stream.html#a576a379c446ad23162f09567337845e7',1,'bbb::loggers::stream::level()']]], ['log',['log',['../d1/d48/namespacebbb_1_1loggers.html#a8e73ddf6c6b8435d8a81f0e0fae2aae6',1,'bbb::loggers']]], ['logger_5fstream',['logger_stream',['../d2/dbf/structbbb_1_1loggers_1_1custom__logger.html#a7bae3b3ca57b07124eee320860e534c0',1,'bbb::loggers::custom_logger']]] ];
"use strict"; /** * Ajax error handler */ $.ajaxSetup({ error: function (xhr) { humane.info("We're so sorry, something is wrong on our end."); } });
import { E2EGlobal } from './helpers/E2EGlobal'; import { E2EApp } from './helpers/E2EApp'; import { E2EMeetingSeries } from './helpers/E2EMeetingSeries'; import { E2EMinutes } from './helpers/E2EMinutes'; import { E2ETopics } from './helpers/E2ETopics'; import { formatDateISO8601 } from '../../imports/helpers/date'; describe('MeetingSeries Items list', function () { const aProjectName = "MeetingSeries Topic List"; let aMeetingCounter = 0; let aMeetingNameBase = "Meeting Name #"; let aMeetingName; before("reload page and reset app", function () { E2EApp.resetMyApp(true); E2EApp.launchApp(); }); beforeEach("goto start page and make sure test user is logged in", function () { E2EApp.gotoStartPage(); expect(E2EApp.isLoggedIn()).to.be.true; aMeetingCounter++; aMeetingName = aMeetingNameBase + aMeetingCounter; E2EMeetingSeries.createMeetingSeries(aProjectName, aMeetingName); E2EMinutes.addMinutesToMeetingSeries(aProjectName, aMeetingName); }); it("displays all info- and action-items of all topics", function () { E2ETopics.addTopicToMinutes('some topic'); E2ETopics.addInfoItemToTopic({subject: 'some information'}, 1); E2ETopics.addInfoItemToTopic({subject: 'some action item', itemType: "actionItem"}, 1); E2ETopics.addTopicToMinutes('some other topic'); E2ETopics.addInfoItemToTopic({subject: 'some information of another topic'}, 1); E2ETopics.addInfoItemToTopic({subject: 'some action item of another topic', itemType: "actionItem"}, 1); E2EMinutes.finalizeCurrentMinutes(); E2EMinutes.gotoParentMeetingSeries(); E2EMeetingSeries.gotoTabItems(); expect(E2ETopics.getAllItemsFromItemList().length, "List should have 4 items").to.equal(4); expect(E2ETopics.getNthItemFromItemList(0).value, "First item should have correct subject").to.have.string("some action item of another topic"); expect(E2ETopics.getNthItemFromItemList(1).value, "First item should have correct subject").to.have.string("some information of another topic"); expect(E2ETopics.getNthItemFromItemList(2).value, "First item should have correct subject").to.have.string("some action item"); expect(E2ETopics.getNthItemFromItemList(3).value, "First item should have correct subject").to.have.string("some information"); }); it('can expand an info item to display its details on the item list', function () { E2ETopics.addTopicToMinutes('some topic'); E2ETopics.addInfoItemToTopic({subject: 'some information'}, 1); E2ETopics.addDetailsToActionItem(1, 1, "Amazing details for this information item"); E2EMinutes.finalizeCurrentMinutes(); E2EMinutes.gotoParentMeetingSeries(); E2EMeetingSeries.gotoTabItems(); E2ETopics.expandDetailsForNthInfoItem(1); expect(E2ETopics.getNthItemFromItemList(0).value) .to.have.string(formatDateISO8601(new Date()) + ' New' + '\nAmazing details for this information item'); }); });
// @flow "use strict"; /** * @author dusiyu * @date 4/17/17. */ import type {PluginInvocation} from './plugin'; import type {Node} from './schema'; export type PrimitiveType = | string | number | boolean | null export type Document = | {[string]: Document} | Array<Document> | PrimitiveType export type ResolverInfo = { node: Node, options: Object, args: Object } export type ResolverResult = | Document | Promise<Document> | PluginInvocation export type Resolver = (parentValue: {[string]: Document}, info: ResolverInfo) => ResolverResult; export type Loader<Id, Value> = (ids: Array<Id>) => Promise<{[Id]: Value}>
/* * This file is part of the Mosaic Platform. * * (c) Rommel M. Zamora <rommel.zamora@groupm.com> * (c) Andrew Aculana <andrew.aculana@movent.com> * * Copyright (c) 2017. For the full copyright and license information, please view the LICENSE file that was distributed with this source code. */ function BrueryAjaxBlock(options) { this.settings = options.settings; this.init(); } BrueryAjaxBlock.prototype = { init: function() { if(jQuery('.'+this.settings.id).length > 0) { this.execute(this); } }, execute: function(obj) { jQuery.ajax({ url: obj.settings.ajax.url, type: obj.settings.ajax.type, success: function(json) { if(json.status === "OK") { var elm = jQuery(obj.settings.ajax.target); elm.children().remove(); // fix issue with html comment ... elm.html(jQuery(json.content.replace(/<!--[\s\S]*?-->/g, "")).html()); } else { // jQuery('#'+obj.settings.ajax.target).parent().effect("highlight", {'color' : '#C43C35'}, 2000); } } }); } }
var should = require('should'); var annotationModule = require('../index.js'); var mockPath = './fixtures/emptyMock.js'; describe('empty module', function() { describe('asynchronous', function() { var err; var result; before(function(done){ annotationModule(mockPath, function(e, a){ err = e; result = a; done(); }); }); it('should have gone well', function(){ should.ifError(err); }); it('should have the module name', function(){ result.module.name.should.be.equal('emptyMock'); }); it('module annotations should be empty', function(){ result.module.annotations.should.be.empty; }); it('ref should be the empty module', function(){ result.module.ref.should.be.equal(require(mockPath)); }); it('functions should be empty', function(){ result.functions.should.be.empty; }); }); describe('synchronous', function() { var err; var result; before(function(){ try { result = annotationModule.sync(mockPath); } catch (e) { err = e; } }); it('should have gone well', function(){ should.ifError(err); }); it('should have the module name', function(){ result.module.name.should.be.equal('emptyMock'); }); it('module annotations should be empty', function(){ result.module.annotations.should.be.empty; }); it('ref should be the empty module', function(){ result.module.ref.should.be.equal(require(mockPath)); }); it('functions should be empty', function(){ result.functions.should.be.empty; }); }); });
var apikey = "252044BE3886FE4A8E3BAA4F595114BB"; var inSearch = false; var lastSearchTerm = ''; var filterArray = []; var filterQuery=''; $(document).ready(function () { execSearch(); $('#searchbar').on('keyup', function (event) { if (inSearch != true) execSearch(); }); if(navigator.userAgent.match(/Windows Phone/i)){ $("#backButton").hide(); } // Handle differences of Windows Phone hardware (back button) // if (window.WinJS && window.WinJS.Application) { // window.WinJS.Application.onbackclick = function () { // if (window.location.hash === '#/') { // return false; // } // window.history.back(); // return true; // }; // } }); function execSearch() { inSearch = true; $.mobile.loading("show", { text: "Loading...", textVisible: true, textonly: true, theme: "b" }); lastSearchTerm = $("#searchbar").val(); // Append ~ to each word for fuzzy search if (lastSearchTerm == '') lastSearchTerm = '*'; var fuzzyQ = ""; if (lastSearchTerm.length > 2) { var res = lastSearchTerm.split(" "); for (var item in res) { fuzzyQ += res[item] + '~ '; } } else fuzzyQ = lastSearchTerm; // Get Facet Query RefreshFacets(); // Extract parameters from URL var searchAPI = "https://azs-playground.search.windows.net/indexes/historicsites/docs?api-version=2015-02-28-Preview&$select=NRIS_Refnum,RESNAME,ResType,City,State,ImageCount&facet=ResType,sort:value&facet=State,sort:value&$top=10&scoringProfile=default&queryType=full&search=" + fuzzyQ + filterQuery; $.ajax({ url: searchAPI, beforeSend: function (request) { request.setRequestHeader("api-key", apikey); request.setRequestHeader("Content-Type", "application/json"); request.setRequestHeader("Accept", "application/json; odata.metadata=none"); }, type: "GET", success: function (data) { $("#searchResults").html(''); for (var item in data.value) { var thumbNail = 'https://azsplayground.blob.core.windows.net/historicsites/img/nrhp_thumbnail.png'; if (data.value[item]["ImageCount"] > 0) thumbNail = 'https://azsplayground.blob.core.windows.net/historicsites/img/' + data.value[item]["NRIS_Refnum"] + '_1.jpeg'; htmlString = '<li id="' + data.value[item]["NRIS_Refnum"] + '"><a><img src="' + thumbNail + '" style="padding-top:15px;padding-left:20px;margin-right:60px;">'; htmlString += '<div style="padding-left: 15px;"><font style="white-space:normal; font-size: small;" >' + data.value[item]["RESNAME"]; htmlString += '<br>'; htmlString += data.value[item]["City"] + ', '; htmlString += data.value[item]["State"]; htmlString += '<br>'; htmlString += data.value[item]["ResType"]; htmlString += '</font></div></a></li>'; $("#searchResults").append(htmlString); } $('#searchResults').delegate('li', 'click', function () { changePage('#pageDetails', false, $(this).attr('id')); }); $("#searchResults").listview("refresh"); facets = data["@search.facets"]; updateFacets(); if ((lastSearchTerm != $("#searchbar").val()) && (lastSearchTerm != '*')) { lastSearchTerm = $("#searchbar").val(); execSearch(lastSearchTerm); } else { $.mobile.loading("hide"); inSearch = false; } } }); } function execLookup(q) { // Do a lookup on a specific item to get details var searchAPI = "https://azs-playground.search.windows.net/indexes/historicsites/docs/" + q +"?api-version=2015-02-28&$select=RESNAME,ResType,Address,City,County,State,NumCBldg,NumCSite,NumCStru,CertifiedDate,Edited,ImageCount"; $.ajax({ url: searchAPI, beforeSend: function (request) { request.setRequestHeader("api-key", apikey); request.setRequestHeader("Content-Type", "application/json"); request.setRequestHeader("Accept", "application/json; odata.metadata=none"); }, type: "GET", success: function (data) { $("#detailsResNameAndType").html(data["RESNAME"] + " (" + data["ResType"] + ")"); $("#detailsAddress").html('<label>Address: ' + data["Address"] + ", " + data["City"] + ", " + data["State"] + '</label>'); $("#detailsCertified").html("Certified: " + data["CertifiedDate"].substring(0, 10)); $("#detailsLastEdited").html("Last Edited: " + data["Edited"].substring(0, 10)); var pdfLoc = "http://focus.nps.gov/pdfhost/docs/nrhp/text/" + q + ".pdf"; $("#detailsLastEdited").html("<a href='" + pdfLoc + "'>Learn more...</a>"); $("#detailsImages").html(""); for (var i = 1; i <= data["ImageCount"]; i++) { $("#detailsImages").append("<img style='width: 100%;height: auto;max-width: 100%;' src='https://azsplayground.blob.core.windows.net/historicsites/img/" + q + "_" + i + ".jpeg'>"); } } }); } function changePage(page, reverse, nrisRefnum) { $.mobile.changePage(page, { transition: 'slide', reverse: reverse }); if (page == "#pageDetails") { execLookup(nrisRefnum); } } function getStaticHTML(html) { if(Object.hasOwnProperty.call(window, "ActiveXObject")){ //using IE return window.toStaticHTML(html); } else { return html; } } function checkIfSelected(facet, value) { for (var filter in filterArray) { if ((filterArray[filter].facet == facet) && (filterArray[filter].value == value)) return 'checked'; } return ''; } function updateFacets() { $("#FilterResType").html(''); $("#FilterResType").append('<legend>Type:</legend>').trigger('create');; for (var facet in facets.ResType) { // Check if this is a selected facet var checked = checkIfSelected('ResType', facets.ResType[facet].value); var html = getStaticHTML('<label id="' + facets.ResType[facet].value + '"><input type="checkbox" value = "' + facets.ResType[facet].value + '" ' + checked + ' id="chk' + facets.ResType[facet].value + '">' + facets.ResType[facet].value + ' (' + facets.ResType[facet].count + ')</label>'); $("#FilterResType").append(html).trigger('create'); $('#chk' + facets.ResType[facet].value).change(function () { RefreshfilterArray('ResType', this.value, this.checked); }); } $("#FilterState").html(''); $("#FilterState").append('<legend>State:</legend>').trigger('create');; for (var facet in facets.State) { var checked = checkIfSelected('State', facets.State[facet].value); var html = getStaticHTML('<label id="' + facets.State[facet].value + '"><input type="checkbox" value = "' + facets.State[facet].value + '" ' + checked + ' id="chk' + facets.State[facet].value + '">' + facets.State[facet].value + ' (' + facets.State[facet].count + ')</label>'); $("#FilterState").append(html).trigger('create'); $('#chk' + facets.State[facet].value).change(function () { RefreshfilterArray('State', this.value, this.checked); }); } } function RefreshfilterArray(facet, value, checked) { if (checked) { filterArray.push({ facet: facet, value: value }); if (inSearch != true) execSearch(); } else { filterArray.forEach(function (result, index) { if ((result.facet == facet) && (result.value == value) ){ //Remove from array filterArray.splice(index, 1); if (inSearch != true) execSearch(); } }); } } function RefreshFacets() { var lastFacet = ''; filterQuery = ''; if (filterArray.length > 0 ){ filterQuery = '&$filter='; filterArray = filterArray.sort(compare); for (var filter in filterArray) { if (filterArray[filter].facet != lastFacet) filterQuery += "("; else filterQuery = filterQuery.substring(0, filterQuery.length-6) + " or "; filterQuery += filterArray[filter].facet + " eq '" + filterArray[filter].value + "') and "; lastFacet = filterArray[filter].facet; } filterQuery = filterQuery.substring(0,filterQuery.length - 5); } } // function onDeviceReady() { // // Register the event listener // if (device.platform == "windows") { // // Get the back button working in WP8.1 // WinJS.Application.onbackclick = function () { // onBackKeyDown(); // return true; // This line is important, without it the app closes. // } // } // else { // document.addEventListener("backbutton", onBackKeyDown, false); // } // } // function onBackKeyDown() { // changePage("#homepage", true, false); // } function compare(a, b) { if (a.facet < b.facet) return -1; if (a.facet > b.facet) return 1; return 0; }
module.exports = class ViewController { constructor() { this.views = {}; } callViewMethod(type, methodName, data) { let v = this.getViews(type); if(!v) { setTimeout(() => { this.callViewMethod(type, methodName, data); }, 750); } for(let i in v) { v[i][methodName](data); } } registerView(type, instance) { if(!this.views[type]) { this.views[type] = []; } this.views[type].push(instance); } getViews(type) { return this.views[type]; } }
/*jslint nomen:true*/ /*global define*/ define([ 'underscore', 'backbone', 'backgrid', './header-cell/header-cell' ], function (_, Backbone, Backgrid, HeaderCell) { "use strict"; var Header; /** * Datagrid header widget * * @export orodatagrid/js/datagrid/header * @class orodatagrid.datagrid.Header * @extends Backgrid.Header */ Header = Backgrid.Header.extend({ /** @property */ tagName: "thead", /** @property */ row: Backgrid.HeaderRow, /** @property */ headerCell: HeaderCell, /** * @inheritDoc */ initialize: function (options) { if (!options.collection) { throw new TypeError("'collection' is required"); } if (!options.columns) { throw new TypeError("'columns' is required"); } this.columns = options.columns; if (!(this.columns instanceof Backbone.Collection)) { this.columns = new Backgrid.Columns(this.columns); } this.row = new this.row({ columns: this.columns, collection: this.collection, headerCell: this.headerCell }); this.subviews = [this.row]; }, /** * @inheritDoc */ dispose: function () { if (this.disposed) { return; } _.each(this.row.cells, function (cell) { cell.dispose(); }); delete this.row.cells; delete this.row; delete this.columns; Header.__super__.dispose.apply(this, arguments); } }); return Header; });
(function (w,i,d,g,e,t,s) {w[d] = w[d]||[];t= i.createElement(g); t.async=1;t.src=e;s=i.getElementsByTagName(g)[0];s.parentNode.insertBefore(t, s); })(window, document, '_gscq','script','//widgets.getsitecontrol.com/50978/script.js');
var exports = module.exports = {} , nlp = require("nlp_compromise") , speak = require("speakeasy-nlp") , modules = [ require('./modules/weather'), require('./modules/heather') ] exports.initiate = function() { console.log('[I] There\'s ' + modules.length + ' modules loaded.'); } exports.sendCommand = function(command,callback) { analyseSentence(command); for(var k in modules) { modules[k].initiate(command,function(output){ return callback(output); }); } } /** PRIVATE FUNCTIONS **/ function analyseSentence(sentence) { /**########################## | VARIABLES ##########################**/ var sentence_type = null; var sentence_nlp = nlp.sentence(sentence); /**########################## | PROCEDURES ##########################**/ sentence_type = get_sentence_type(sentence); // Checking the type of the sentence 👀 sentence_geo = get_places(sentence); // Checking if the sentence contains a location 📌 } function get_sentence_type(sentence) { var result = nlp.sentence(sentence.order).sentence_type(); // Initiate the standard NLP analyzer 👍 var sentence_classified = speak.classify(expand_sentence(sentence.order)); // Classify through speak NLP var interrogative_keywords = ["what","where","why"]; // Identifying the interrogative keywords if(interrogative_keywords.indexOf(sentence_classified.action) >= 0) $result = "interrogative"; // Quick check return result; // Return the sentence type } function get_places(sentence) { var places = nlp.place(sentence); var geo = (places.city == null && places.region == null && places.country == null) ? false : true; return geo; } function expand_sentence(sentence) { analysedSentence = nlp.sentence(sentence) analysedSentence.contractions.expand(); analysedSentence = analysedSentence.text(); return analysedSentence; }
import { EventEmitter } from 'events'; class TabManager extends EventEmitter { constructor() { super(); // default tab is home this.tabName = 'home'; this.tabOptions = undefined; } setTab(tabName, tabOptions) { if (tabName === this.tabName && tabOptions === this.tabOptions) { return; } else { this.tabName = tabName; this.tabOptions = tabOptions; this.emit('changed', tabName, tabOptions); } } } module.exports = new TabManager();
/* ========================================================================== Styleguide -- Version: 0.4.1 - Updated: 2/22/2014 ========================================================================== */ // Create Hex color code from color return function hexc(colorval) { var parts = colorval.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/); delete(parts[0]); for (var i = 1; i <= 3; ++i) { parts[i] = parseInt(parts[i]).toString(16); if (parts[i].length == 1) parts[i] = '0' + parts[i]; } color = '#' + parts.join(''); } // Get color value of swatch and print to div var color = ''; $('.swatch').each(function() { var classList = $(this).children('.swatch-color').attr('class').split(' '); for(i=0; i <= classList.length-1; i++){ if(classList[i].match(/color-/g)){ $(this).children('.swatch-info').prepend('<p>$' + classList[i] + '</p>'); break; } } var x = $(this).children('.swatch-color').css('backgroundColor'); hexc(x); $(this).children('.swatch-info').append('<p>' + color + '</p>'); $(this).children('.swatch-info').append('<p>' + x + '</p>'); }); (function($) { $.fn.vs = function() { // View source buttons $('.vs').click(function(){ $(this).parent().next().find('.prettyprint').toggle(); $(this).not('.disabled').toggleClass('js-active'); return false; }); } }(jQuery)); $('.vs').vs(); // Get font-family property and return $('.fonts').each(function(){ var fonts = $(this).css('font-family'); $(this).prepend(fonts); });
var email_client = new Object(); email_client.active_emails = Object(); email_client.timeout = 1000; email_client.deactivate = function( key , object ){ var old_mid = $(object).children('.checkbox_td').children('.mid').html(); emaildash.remove_active_email( old_mid , page_object.user_id , {} ); } email_client.bulk_emails = []; email_client.clean_bulk_emails = function(){ $('.email_item_checkbox').attr('checked' , false); delete email_client.bulk_emails; email_client.bulk_emails = []; } email_client.message_checkbox = function( cb , mid ){ if($(cb).ctl_checked()==true){ email_client.bulk_emails[mid] = mid;} else {delete email_client.bulk_emails[mid];} } email_client.setup_panel = function(){ $('.email_autocomplete').autocomplete( { source: 'email_lookup.php', select: function(event, ui){ $(this).val(ui.item.email); } }); } email_client.compose_email = function( module_name , module_id ){ if( module_name != '' && module_id != '' ){ var options = {'module_name': module_name , 'module_id': module_id}; } else { var options = {}; } casecreation.display_mail_content( page_object.user_id ,'flyout', 'COMPOSE',options, {preloader:'prl', onUpdate: email_client.display_compose } ); } email_client.toggle_comment = function(){ $(this).toggleClass('comment_upper_line_active'); $(this).next('.comment_text').toggle(); } email_client.message_click = function( object , options ){ $('.emaildashboard_compose').hide(); $('.email_item_active').each(email_client.deactivate); $('.email_item').removeClass('email_item_active'); emaildash.set_active_email( options.mid , page_object.user_id , {} ); $(object).parent().parent().addClass('email_item_active'); emaildash.updateUserInfo( options.mid, 'read', '1', {preloader:'prl', onUpdate: function(response,root){ emaildash.displayStatusImage( options.mid, options.group_id, {preloader:'prl', onUpdate: function(response,root){ document.getElementById('message_status_' + options.mid ).innerHTML=response; emaildash.display_mail_content(options.mid,'emaildashboard' , 'flyout' , {onUpdate: function(responce,root){$('#compose_mail_div_flyout').html(responce);}} ); emaildash.display_mail_content(options.mid, 'emaildashboard', 'LEFT PANEL', {preloader:'prl', onUpdate: function(response,root){ document.getElementById('email_content').innerHTML=response; fileAttachment(); tinyMCE.init({ mode : 'specific_textareas', editor_selector : 'mceeditor_500', theme : 'advanced' , width: '500px', theme_advanced_buttons1 : 'bold,italic,underline,justifyleft,justifycenter,justifyright,justifyfull,undo,redo,link,unlink,forecolor', theme_advanced_buttons2 : '', theme_advanced_buttons3 : '' }); $('.comment_upper_line').click(email_client.toggle_comment); }}); } }); casecreation.right_bottom_panel(options.mid, {preloader:'prl', onUpdate: function(response,root){$('#right_bottom_panel').html(response);}}); } } ); } email_client.create_case = function( mid ){ casecreation.create_case( 'EMAIL' , mid ,page_object.user_id ,{preloader:'prl', target:'right_bottom_panel', onUpdate: function(response,root){slimcrm.flash_sidepanel();}}); } email_client.check_server = function( object ){ $.each( email_client.active_emails , function( i ){ email_client.active_emails[i] = "inactive"; }); $(object).each( function(i , val ){ email_client.active_emails[val.mid] = "active"; if($('.email_item_mid_' + val.mid ).hasClass('email_item_user') == false &&$('.email_item_mid_' + val.mid ).hasClass('email_item_active') == false ){ $('.email_item_mid_' + val.mid ).addClass('email_item_user'); } }); $.each( email_client.active_emails , function( i ){ if( email_client.active_emails[i] == "inactive" ){ email_client.active_emails[i] = ''; $('.email_item_mid_' + i ).removeClass('email_item_user'); } }); var current_time = new Date().getTime(); var diff_time = current_time - email_client.last_sent; var tick_overage = email_client.timeout - diff_time; email_client.tick_overage = tick_overage; if( tick_overage < ( email_client.timeout / 2 ) && email_client.timeout < 10000 ){ email_client.up_tick_timeout(); } if( tick_overage > ( email_client.timeout ) && email_client.timeout > 500 ){ email_client.down_tick_timeout(); } email_client.currently_running == false; } email_client.check_server_tick = function(){ if( email_client.currently_running == false ){ email_client.currently_running == true; email_client.last_sent = new Date().getTime(); $.ajax( { type: "GET", url: 'ajax.php?type=active_email&format=json&user_id=' + page_object.user_id , dataType: "json" , timeout: email_client.timeout - 100, success: email_client.check_server, error: function(){email_client.currently_running == false;if( email_client.timeout < 10000 ){email_client.up_tick_timeout();}} }); } } email_client.up_tick_timeout = function( timeout_time ){ if(!timeout_time){ timeout_time = 250; } clearInterval(email_client.tick); email_client.timeout = email_client.timeout + timeout_time; email_client.tick = setInterval ( 'email_client.check_server_tick()', email_client.timeout ); } email_client.down_tick_timeout = function(timeout_time){ if(!timeout_time){ timeout_time = 250; } clearInterval(email_client.tick); email_client.timeout = email_client.timeout - timeout_time; email_client.tick = setInterval ( 'email_client.check_server_tick()', email_client.timeout ); } email_client.start_tick = function(){ email_client.tick = setInterval ( 'email_client.check_server_tick()', email_client.timeout ); } email_client.currently_running = false; email_client.link_to_case = function( module_name , module_id ){ $('#content_area').append('<div id="link_to_case_'+ module_name + module_id + '" class=dialog ><div>'); emaildash.display_link_to_case( module_name , module_id , { onUpdate: function( responce , root ){ $( '#link_to_case_' + module_name + module_id ).html( responce ); $( '#link_to_case_' + module_name + module_id ).dialog( { close: function(event , ui){ $(this).dialog('destroy'); } , resizable: false, height: 140, modal: true, buttons: { 'link to case': function() { emaildash.link_module_to_case( module_name , module_id , $('#link_case_input_' + module_name + module_id ).val() , {} ); $(this).remove();$( this ).dialog( 'destroy' ); }, Cancel: function() {$(this).remove();$( this ).dialog( 'destroy' );}} } ); link_cases_onload(); } } ); } email_client.check_email_flyout = function(){ return $('.emaildashboard_compose').is(':visible'); } email_client.display_email = function(response,root,overide,from_compose){ display = true; if(email_client.check_email_flyout() == true && overide == undefined ){ display=false; if(from_compose==undefined){ slimcrm.confirm({yes: function(){email_client.display_email(response, root, 'yes');} , question: 'Email Currently being composed,<br/>Would you like to delete it' }); } else { slimcrm.confirm({yes: function(){email_client.display_compose(response, root, 'yes');} , question: 'Email Currently being composed,<br/>Would you like to delete it' }); } } if(display==true){ $('.left_panel_flyout').show(); document.getElementById('content_left_panel').innerHTML=response; fileAttachment(); tinyMCE.init({ mode : 'specific_textareas', editor_selector : 'mceeditor_500', theme : 'advanced' , width: '500px', theme_advanced_buttons1 : 'bold,italic,underline,justifyleft,justifycenter,justifyright,justifyfull,undo,redo,link,unlink,forecolor', theme_advanced_buttons2 : '', theme_advanced_buttons3 : '' }); } } email_client.display_compose = function(response,root,overide){ email_client.display_email(response,root,overide,true); slimcrm.setup_tinyMCE(); email_client.setup_panel(); } email_client.open_flyout = function( mid ){ $('.emaildashboard_compose_emaildashboard').show(); emaildash.display_mail_content( mid, 'flyout', 'leftpanel', { preloader:'prl', onUpdate: email_client.display_compose } ); }
var StatusBarView, View; var __hasProp = {}.hasOwnProperty; var __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; View = require('atom').View; module.exports = StatusBarView = (function(_super) { __extends(StatusBarView, _super); function StatusBarView() { return StatusBarView.__super__.constructor.apply(this, arguments); } StatusBarView.content = function() { return this.div({ "class": 'inline-block' }, (function(_this) { return function() { return _this.div({ outlet: "statusText" }); }; })(this)); }; StatusBarView.prototype.updateText = function(text) { return this.statusText.html(text); }; StatusBarView.prototype.initialize = function(statusBar) { this.statusBar = statusBar; return null; }; StatusBarView.prototype.attach = function() { return this.statusBar.appendLeft(this); }; StatusBarView.prototype.destroy = function() { return this.remove(); }; return StatusBarView; })(View);
/* * timecalc.js * * Parses multi line content for times and calculates a total time duration. * * Author: Eric Lambrecht * License: MIT */ ;(function ($, window, undefined) { "use strict"; var TimeCalculator, Time, defaults = { 'time-delimiter': '\n', 'natlang-support': true, 'return-formatted': true, }; /* * Custom jQuery function '$.timecalc()'. * * Example: $('#time-input').timecalc(); * Parsed time can be get with $('#time-input').timecalc('getHours'); * * Example: $('#time-input').timecalc($('time-output-digits')); * Parsed time is stored in the specified DOM element. */ $.fn.timecalc = function ( options ) { var args = arguments; if (options === undefined || typeof options === 'object' ) { return this.each(function () { // Only allow the plugin to be instantiated once, // so we check that the element has no plugin instantiation yet if (!$.data(this, 'plugin_timecalc')) { // if it has no instance, create a new one, // pass options to our plugin constructor, // and store the plugin instance // in the elements jQuery data object. $.data(this, 'plugin_timecalc', new TimeCalculator( this, options )); } }); } else if (typeof options === 'string' && options[0] !== '_' && options !== 'init') { // Cache the method call // to make it possible // to return a value var returns; this.each(function () { var instance = $.data(this, 'plugin_timecalc'); // Tests that there's already a plugin-instance // and checks that the requested public method exists if (instance instanceof TimeCalculator && typeof instance[options] === 'function') { // Call the method of our plugin instance, // and pass it the supplied arguments. returns = instance[options].apply( instance, Array.prototype.slice.call( args, 1 ) ); } // Allow instances to be destroyed via the 'destroy' method if (options === 'destroy') { $.data(this, 'plugin_timecalc', null); } }); // If the earlier cached method // gives a value back return the value, // otherwise return this to preserve chainability. return returns !== undefined ? returns : this; } } $.timecalc = function (customInputString, options) { // "stand-alone" version for parsing custom strings if(customInputString) { // this is not a jQuery collection / DOM-Element but a direct call to timecalc var tempCalc, method, params; if(options !== undefined) { tempCalc = new TimeCalculator(false, options); } else { tempCalc = new TimeCalculator(false); } return tempCalc.parseInput(customInputString); } else { console.error("no input string to parse!"); return false; } } /* * constructor */ TimeCalculator = function (inputElement, options) { this.$input = inputElement ? $(inputElement) : false; this.$output = false; this._settings = defaults; // If we were given a jQuery object, we'll be using it as the output element. if (options instanceof jQuery) { this.$output = options; } // Otherwise some kind of settings must have been given... else { this._settings = $.extend( {}, defaults, options); } this.total = new Time(); this.init(); }; TimeCalculator.prototype = { /* * Init the plugin with a keyup event. */ init : function () { if(this.$input) { // Parse input on key up. this.$input.on("keyup", $.proxy(function () { this.parseInput(); this.update(); }, this)); } }, /* * Sets a value, after initialization. */ option: function (name, value) { if ( value === undefined ) { // getter return this._settings[name]; } else { // setter this._settings[name] = value; return value; } }, /** * This function parses the user's input and adds it to a time object * * Input will be tried to be parsed in the following order: * 1. Values followed by name/description * 2. Decimal representation of hours (e.g. dot- or comma-seperated) * 3. Colon-seperated time representation (hh:mm:ss) * * Accepts a custom input string parameter, which can be parsed instead and independantly. */ parseInput : function ( customInputString ) { var input = customInputString ? customInputString : (this.$input ? this.$input.val() : ""), lines = input.split( this._settings['time-delimiter'] ), hours, mins, secs, i; // reset _all_ previous calculated times. this.total = new Time(); // iterate over lines , @todo: maybe replace with foreach for (i = 0; i < lines.length; i++) { hours = this.total.getHours(), mins = this.total.getMinutes(), secs = this.total.getSeconds(); // if values are followed by description: if (lines[i].indexOf("hour") !== -1 || lines[i].indexOf("minute") !== -1 || lines[i].indexOf("second") !== -1) { if(this._settings['natlang-support']) { var stringHasRightFormat, match, parts, tmpLine = lines[i], partIdx = 0; do { // Search for (first) number match = tmpLine.match(/[0-9]/g); parts = tmpLine.split(' '); stringHasRightFormat = match != null && partIdx + 1 < parts.length; if (stringHasRightFormat) { var currentNumber = parts[partIdx]; var currentTimeUnit = parts[partIdx + 1].toString().toLowerCase(); switch(currentTimeUnit) { case "hour": case "hours": hours = parseInt(currentNumber) + hours; break; case "minute": case "minutes": mins = parseInt(currentNumber) + mins; break; case "second": case "seconds": secs = parseInt(currentNumber) + secs; break; } partIdx += 2; } } while (stringHasRightFormat); } } // if line has comma or dot, we treat it as hours in decimal representation. else if (lines[i].indexOf(",") !== -1 || lines[i].indexOf(".") !== -1) { var inputNumber = parseFloat(lines[i].replace(",", ".")); mins = Math.round(inputNumber*60) + mins; } // try seperating by colon(s) else { var tmpTime = lines[i].split(":"); hours = parseInt(tmpTime[0] ? tmpTime[0] : 0) + hours; mins = parseInt(tmpTime[1] ? tmpTime[1] : 0) + mins ; secs = parseInt(tmpTime[2] ? tmpTime[2] : 0) + secs; } // add/set updated time this.total.setTime(hours, mins, secs); } // return if custom input was given if(typeof customInputString !== 'undefined') { if(this._settings['return-formatted']) { return this.getFormattedTime(); } else { return this.getTotalTime(); } } }, /* * Fires 'timecalcupdate' event and outputs time to output element (if set). */ update : function () { var formattedTime; // switch over different types of (user choses) output-formats. formattedTime = this.getFormattedTime(); if (this.$output) { // write time to output element. if($output.is('input, select, textarea')) { this.$output.val(formattedTime); } else { this.$output.text(formattedTime); } } // fire the 'timecalcupdate' event. this.$input.trigger({ type: 'timecalcupdate', hours: this.total.getHours(), minutes: this.total.getMinutes(), seconds: this.total.getSeconds(), formattedTime: formattedTime, }); }, getFormattedTime : function() { return this.total.getHours() + ':' + this.total.getMinutes() + ':' + this.total.getSeconds(); }, getTotalTime : function() { return this.total; } }; /** * Represents time. * This object can hold hours, minutes and seconds. * It additionaly provides simple arrangement of it's time values. * @constructor */ Time = function () { this.hours = 0; this.minutes = 0; this.seconds = 0; } Time.prototype.getHours = function () { return this.hours; }; Time.prototype.getMinutes = function () { return this.minutes; }; Time.prototype.getSeconds = function () { return this.seconds; }; Time.prototype.setHours = function (hours) { this.hours = hours; }; Time.prototype.setMinutes = function (mins) { this.minutes = mins; this.arrangeTime(); }; Time.prototype.setSeconds = function (secs) { this.seconds = secs; this.arrangeTime(); }; Time.prototype.setTime = function (hours, mins, secs) { this.setHours(hours); this.setMinutes(mins); this.setSeconds(secs); }; /** * this function rearranges time by removing over-/underflow */ Time.prototype.arrangeTime = function () { // arrange minutes. while (this.seconds >= 60) { this.minutes += 1; this.seconds -= 60; } while (this.minutes >= 60) { this.hours += 1; this.minutes -= 60; } // arrange seconds. while (this.seconds <= -60) { this.minutes -= 1; this.seconds += 60; } while (this.minutes <= -60) { this.hours -= 1; this.minutes += 60; } }; }) (jQuery, window);
import fs from './fs'; export default fs;
/*global console, alert, prompt*/ /* Author: Yahia Hegazy Created: 2016-05-12 Updated: 2016-05-19 Final: 2016-05-19 Project: PlayPen Information The purpose of this project started out as a simple need to test my javascript skills. */ //Gloabal Variables var setStatus = document.getElementById('status'), getStatus = localStorage.getItem('status'); function sysinfo() { 'use strict'; window.RTCPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection; //compatibility for firefox and chrome //Declaring variables, grouped by similiarites var sysDate = new Date(), language = "Current language: " + navigator.language, online = "Browser connectivity: " + navigator.onLine, cookies = "Cookies enabled: " + navigator.cookieEnabled, js = "JavaScript enabled: true", monitorResolution = "Monitor resolution: " + window.screen.width + ' x ' + window.screen.height, browserDimension = "Browser dimension: " + window.innerWidth + ' x ' + window.innerHeight, localLocation = "Location: ", localCoordinates = "Coordinates: ", message = document.getElementById("sysinfo"), pc = new window.RTCPeerConnection({iceServers: []}), noop = function () {}; //Looks up IP address pc.createDataChannel(""); //create a bogus data channel pc.createOffer(pc.setLocalDescription.bind(pc), noop); // create offer and set local description pc.onicecandidate = function (ice) { //listen for candidate events var myIP = /([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/.exec(ice.candidate.candidate)[1]; if (!ice || !ice.candidate || !ice.candidate.candidate) { return; } myIP = 'Your IP: ' + myIP; pc.onicecandidate = noop; //Output message message.innerHTML = sysDate + '<br>' + myIP + '<br>' + online + '<br>' + cookies + '<br>' + js + '<br>' + language + '<br>' + monitorResolution + '<br>' + browserDimension; }; } setStatus.onclick = function () { 'use strict'; if (document.getElementById('status').checked === true) { localStorage.setItem('status', "true"); } else { localStorage.setItem('status', "false"); } }; if (getStatus === "true") { sysinfo(); } function load() { 'use strict'; var checked = JSON.parse(localStorage.getItem('status')); document.getElementById('status').checked = checked; } function reset() { 'use strict'; location.reload(); localStorage.clear(); }
// @flow function setStatus(name: string, value: string) : Action { return { type: 'SET_STATUS', name, value }; } module.exports = { setStatus }
define(['model/entity', 'transition', 'lib/pixi', 'enums', 'model/charactermovement'], function (Entity, Transition, PIXI, Enums, CharacterMovement) { class Character extends Entity { constructor(CharIndex, gridX, gridY, Heading, Name, clan, Body, Head, Weapon, Shield, Helmet, FX, FXLoops, NickColor) { super(gridX, gridY); var self = this; if (!Name) // es un bicho o npc { this.moveSpeed = 200; }// bicho (duracion de movimiento en ms, animaciones de mov se setean automaticamnete a esta vel (abajo) ) else { this.moveSpeed = 210; } // PJ TODO: setear bien estos valores, fijarse que en lo posible no haya resetmovements (esto pasa si la animacion es mas lenta que el llamado a cambiar de pos) this.id = CharIndex; this._heading = Heading; this.sprite = null; this.spriteNombre = null; this.texto = null; this.movement = new CharacterMovement(this); this._nombre = Name; this._clan = clan; this._body = Body; this._head = Head; this._weapon = Weapon; this._shield = Shield; this._helmet = Helmet; this._fx = FX; this._fxLoops = FXLoops; this._nickColor = NickColor; } setSpeed(speed){ this.moveSpeed = speed; this.sprite.setSpeed(speed); } update(delta){ this.movement.update(delta); //this.sprite.update(delta); //if (this.spriteNombre){ // this.spriteNombre.update(delta); //} if (this.texto){ this.texto.update(delta); } } mover(dir, movimientoCallback, finMovimientoCallback) { this._animarMovimiento(); let finCb = () => { this._finAnimarMovimiento(); if (finMovimientoCallback) { finMovimientoCallback(); } }; return this.movement.mover(dir, movimientoCallback, finCb); } estaMoviendose(){ return this.movement.estaMoviendose(); } resetMovement() { return this.movement.resetMovement(); } _animarMovimiento() { if (this.sprite) { this.sprite.loop(true); this.sprite.play(); } } _finAnimarMovimiento() { if (this.sprite) { this.sprite.loop(false); } } get muerto(){ return (this.head === Enums.Muerto.cabezaCasper) || (this.body === Enums.Muerto.cuerpoFragataFantasmal); } get heading(){ return this._heading; } set heading(heading){ if (this._heading !== heading){ this._heading = heading; this.emit('headingChanged'); } } get body(){ return this._body; } set body(body){ if (this._body !== body){ this._body = body; this.emit('bodyChanged'); } } get head(){ return this._head; } set head(head){ if (this._head !== head){ this._head = head; this.emit('headChanged'); } } get weapon(){ return this._weapon; } set weapon(weapon){ if (this._weapon !== weapon){ this._weapon = weapon; this.emit('weaponChanged'); } } get shield(){ return this._shield; } set shield(shield){ if (this._shield !== shield){ this._shield = shield; this.emit('shieldChanged'); } } get helmet(){ return this._helmet; } set helmet(helmet){ if (this._helmet !== helmet){ this._helmet = helmet; this.emit('helmetChanged'); } } get fx(){ return this._fx; } set fx(fx){ if (this._fx !== fx){ this._fx = fx; this.emit('fxChanged'); } } get fxLoops(){ return this._fxLoops; } set fxLoops(fxLoops){ if (this._fxLoops !== fxLoops){ this._fxLoops = fxLoops; this.emit('fxLoopsChanged'); } } get nombre(){ return this._nombre; } get clan(){ return this._clan; } get nickColor(){ return this._nickColor; } setName(nombre,clan,color) { if (this._nombre !== nombre || this._clan !== clan || this._nickColor !== color) { this._nombre = nombre; this._clan = clan; this._nickColor = color; this.emit('nameChanged'); } } } return Character; });
/** * @fileoverview Tests for google-camelcase rule. * @author Gregg Tavares (but it's just a modified version of camelcase by Nicholas C. Zakas) */ //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ var linter = require("eslint").linter; var ESLintTester = require("eslint-tester"); var eslintTester = new ESLintTester(linter); //------------------------------------------------------------------------------ // Tests //------------------------------------------------------------------------------ eslintTester.addRuleTest("lib/rules/google-camelcase", { valid: [ "firstName = \"Nicholas\"", "FIRST_NAME = \"Nicholas\"", "__myPrivateVariable = \"Patrick\"", "myPrivateVariable_ = \"Patrick\"", "function doSomething(){}", "do_something()", "foo.do_something()", "var foo = bar.baz_boom;", "var foo = bar.baz_boom.something;", "foo.boom_pow.qux = bar.baz_boom.something;", "if (bar.baz_boom) {}", "var obj = { key: foo.bar_baz };", "var arr = [foo.bar_baz];", "[foo.bar_baz]", "var arr = [foo.bar_baz.qux];", "[foo.bar_baz.nesting]", "if (foo.bar_baz === boom.bam_pow) { [foo.baz_boom] }", "var a = opt_test;", "var args = var_args;" ], invalid: [ { code: "first_name = \"Nicholas\"", errors: [ { message: "Identifier 'first_name' is not in camel case.", type: "Identifier" } ] }, { code: "__private_first_name = \"Patrick\"", errors: [ { message: "Identifier '__private_first_name' is not in camel case.", type: "Identifier" } ] }, { code: "function foo_bar(){}", errors: [ { message: "Identifier 'foo_bar' is not in camel case.", type: "Identifier" } ] }, { code: "obj.foo_bar = function(){};", errors: [ { message: "Identifier 'foo_bar' is not in camel case.", type: "Identifier" } ] }, { code: "bar_baz.foo = function(){};", errors: [ { message: "Identifier 'bar_baz' is not in camel case.", type: "Identifier" } ] }, { code: "[foo_bar.baz]", errors: [ { message: "Identifier 'foo_bar' is not in camel case.", type: "Identifier" } ] }, { code: "if (foo.bar_baz === boom.bam_pow) { [foo_bar.baz] }", errors: [ { message: "Identifier 'foo_bar' is not in camel case.", type: "Identifier" } ] }, { code: "foo.bar_baz = boom.bam_pow", errors: [ { message: "Identifier 'bar_baz' is not in camel case.", type: "Identifier" } ] }, { code: "var foo = { bar_baz: boom.bam_pow }", errors: [ { message: "Identifier 'bar_baz' is not in camel case.", type: "Identifier" } ] }, { code: "foo.qux.boom_pow = { bar: boom.bam_pow }", errors: [ { message: "Identifier 'boom_pow' is not in camel case.", type: "Identifier" } ] } ] });
(function (global, undefined) { var instruments = (function () { var _simpleCashflowList = { cashflows: function () { return [ { amount: 5, paymentDate: new Date(2012, 01, 01) }, { amount: 105, paymentDate: new Date(2012, 07, 07) } ]; } }; return { simpleCashflowList: _simpleCashflowList }; } ()); global.instruments = instruments; } (this));
/*//////////////////////////////////////////////// Script made by: ikefi http://steamcommunity.com/id/ikefi/ ////////////////////////////////////////////////*/ var sendMessage $(document).ready(function(){ // Current message id, used to keep track of what messages we need var currentMessageID = 0 // Wait for the twitch emotes to load, so cache the messages we get during that time var cachedMessages = []; // Twitch emotes var globalEmotesLoaded = false; var subscriberEmotesLoaded = false; var betterttvEmotesLoaded = false; var globalEmoteURL = ''; var subscriberEmoteURL = ''; var globalEmotes = []; var subscriberEmotes = []; var betterttvEmotes = []; // Get twitch global emotes $.ajax({ url: 'https://twitchemotes.com/api_cache/v2/global.json', dataType: 'json', cache: true, success: function( data ){ globalEmoteURL = data.template.small.replace( "//", "https://" ); for( var emote in data.emotes ){ globalEmotes[ emote ] = data.emotes[ emote ].image_id; } globalEmotesLoaded = true; emotesLoaded(); }, error: function(){ globalEmotesLoaded = true; emotesLoaded(); } }); // Get twitch subscriber emotes $.ajax({ url: 'https://twitchemotes.com/api_cache/v2/subscriber.json', dataType: 'json', cache: true, success: function( data ){ subscriberEmoteURL = data.template.small.replace( "//", "https://" ); for( var index in data.channels ){ var channel = data.channels[ index ]; for( var emoteIndex in channel.emotes ){ var emote = channel.emotes[ emoteIndex ]; subscriberEmotes[ emote.code ] = emote.image_id; } } subscriberEmotesLoaded = true; emotesLoaded(); }, error: function(){ subscriberEmotesLoaded = true; emotesLoaded(); } }); // Get betterttv emotes $.ajax({ url: 'https://api.betterttv.net/emotes', dataType: 'json', cache: true, success: function( data ){ for( var index in data.emotes ){ var emote = data.emotes[ index ]; betterttvEmotes[ emote.regex ] = emote.url; } betterttvEmotesLoaded = true; emotesLoaded(); }, error: function(){ betterttvEmotesLoaded = true; emotesLoaded(); } }); function emotesLoaded(){ if( globalEmotesLoaded && subscriberEmotesLoaded && betterttvEmotesLoaded ){ // Remove the loading if( currentMessageID == 0 ){ $( '.chat-lines' ).html( "" ); } // Add all data we gotten during loading the emoticons for( var i=0; i<cachedMessages.length; i++ ){ onMessageReceived( cachedMessages[ i ] ) } } } // Apply emoticions function applyEmoticons( message ){ // Do nothing if they all failed if( !globalEmotesLoaded && !subscriberEmotesLoaded && !betterttvEmotesLoaded ){ return message; } // Split each space var array = message.split( " " ); // Loop through the array, replace it with an image if it's a twitch emote var newMsg = ""; for( var i=0; i<array.length; i++ ){ var msgPiece = array[ i ]; if( globalEmotes[ msgPiece ] ){ msgPiece = "<img class=\"emote\" data-name=\"" + msgPiece + "\" src=\"" + globalEmoteURL.replace( "{image_id}", globalEmotes[ msgPiece ] ) + "\">"; } else if( subscriberEmotes[ msgPiece ] ){ msgPiece = "<img class=\"emote\" data-name=\"" + msgPiece + "\" src=\"" + subscriberEmoteURL.replace( "{image_id}", subscriberEmotes[ msgPiece ] ) + "\">"; } else if( betterttvEmotes[ msgPiece ] ){ msgPiece = "<img class=\"emote\" data-name=\"" + msgPiece + "\" src=\"" + betterttvEmotes[ msgPiece ] + "\">"; } else if( i != 0 ){ msgPiece = " " + msgPiece; } newMsg += msgPiece; } // Return the new message return newMsg; } function onMessageReceived( data ){ var chat_lines = $( '.chat-lines' ); // Remove the loading if( currentMessageID == 0 ){ chat_lines.html( "" ); } // No data or no new data, do nothing if( !data || data.messageid <= currentMessageID ){ return; } // Only scroll if the client was scrolled all the way down var shouldScroll = chat_lines.prop('scrollHeight') - ( chat_lines.scrollTop() + chat_lines.outerHeight() ) == 0; var previousMessageID = currentMessageID; // To check if he gotten messages we already got currentMessageID = data.messageid; // Set the currentMessageID for( var i=0; i<data.chat_log.length; i++ ){ var d = data.chat_log[ i ]; // To prevent double messages if( d.id <= previousMessageID ){ continue; } var time = new Date( d.time*1000 ).toLocaleTimeString(); var message = d.msg; var name = d.name; var color = d.color; var admin = d.admin; var line = ""; if( admin && message.charAt( 0 ) == '!' ){ message = message.substr( 1 ); line = '<div class="chat-line noticable">'; } else{ line = '<div class="chat-line">'; } // Apply twitch emoticons message = applyEmoticons( message ); line += '<span class="time">' + time + ' </span><span class="name" style="color:#' + color + ';">' + name + '</span><span>:&nbsp;</span><span class="text">' + message + '</span></div>'; // Add the line chat_lines.append( line ); } if( shouldScroll ){ // Max amount of messages in the chat var child_length = chat_lines.children().length; if( child_length > 250 ){ $( '.chat-line:lt(' + ( child_length-250 ) + ')' ).remove(); } // Scroll to bottom chat_lines.animate( { scrollTop: chat_lines.prop( 'scrollHeight' ) }, 'fast' ); } } // Get new messages function getMessages(){ $.ajax({ url: 'get_messages.php', type: 'POST', data: {cur_msg_id: currentMessageID}, dataType: 'json', success: function( data ){ if( !globalEmotesLoaded || !subscriberEmotesLoaded || !betterttvEmotesLoaded ){ cachedMessages.push( data ); } else{ onMessageReceived( data ); } } }); } // Send a message sendMessage = function( message ){ // We don't want our messages to be empty if( message == "" ){ return; } // Post the message $.post( 'send_message.php', { message: message }, function(){ getMessages(); // Get the message right away }); } setInterval( getMessages, 1500 ); // Get new chat messages every 1500 ms getMessages(); // Get messages now // More messages below notification var ps = 0 $( '.chat-lines' ).on( 'scroll', function(){ var st = $(this).scrollTop(); var tps = ps; ps = st; var chat_lines = $( '.chat-lines' ); // If scrolling down then if( st > tps ){ if( chat_lines.prop('scrollHeight') - ( chat_lines.scrollTop() + chat_lines.outerHeight() ) <= 1 ){ $( "#more-messages-notify" ).remove(); } } else if( !$( "#more-messages-notify" ).length ){ if( chat_lines.prop('scrollHeight') - ( chat_lines.scrollTop() + chat_lines.outerHeight() ) > 0 ){ var tooltip = $("<div id=\"more-messages-notify\">More messages below</div>") .appendTo( "body" ) .show() .on( 'click', function(){ $( '.chat-lines' ).animate( { scrollTop: $( '.chat-lines' ).prop( 'scrollHeight' ) }, 'fast' ); }); } } }); // Tooltip for the emoticons // credits: http://stackoverflow.com/questions/2011142/how-to-change-the-style-of-title-attribute-inside-the-anchor-tag#answer-16462668 $(document).on( "mouseenter", "*[data-name]", function( e ){ var target = $(e.target); var tooltip = $("<div id=\"tooltip\" />") .appendTo( "body" ) .html( target.data( "name" ) ) .show(); var pos = target.offset(); var x = pos.top-tooltip.outerHeight()-4, y = pos.left-tooltip.outerWidth()+target.outerWidth()*0.5+8; tooltip.css( { top: x, left: y } ); }); $(document).on( "mouseleave", "*[data-name]", function( e ){ $( "#tooltip" ).remove(); }); });
define(['jquery', '//cdn.jsdelivr.net/web-animations/1.0.6/web-animations.min.js'], function($) { 'use strict'; return function(args, ctx) { var i = $.inArray('--waitForEnd', args), waitForEnd = false, dir, duration = 900, keyframes; if (i !== -1 && i + 1 < args.length) { waitForEnd = true; } i = $.inArray('--direction', args); if (i !== -1 && i + 1 < args.length) { dir = args[i + 1]; } i = $.inArray('--duration', args); if (i !== -1 && i + 1 < args.length) { duration = args[i + 1]; } var op = args[1]; var elem = document.querySelector(args[args.length - 1]); if (op === 'in') { elem.style.opacity = 0; elem.style.display = 'block'; elem.style.visibility = 'visible'; if (dir === 'down-left') { keyframes = [ {transform: 'rotate3d(0, 0, 1, -45deg)', opacity: '0', transformOrigin: 'left bottom', offset: 0}, {transform: 'none', opacity: '1', transformOrigin: 'left bottom', offset: 1} ]; } else if (dir === 'down-right') { keyframes = [ {transform: 'rotate3d(0, 0, 1, 45deg)', opacity: '0', transformOrigin: 'right bottom', offset: 0}, {transform: 'none', opacity: '1', transformOrigin: 'right bottom', offset: 1} ]; } else if (dir === 'up-left') { keyframes = [ {transform: 'rotate3d(0, 0, 1, 45deg)', opacity: '0', transformOrigin: 'left bottom', offset: 0}, {transform: 'none', opacity: '1', transformOrigin: 'left bottom', offset: 1} ]; } else if (dir === 'up-right') { keyframes = [ {transform: 'rotate3d(0, 0, 1, -45deg)', opacity: '0', transformOrigin: 'right bottom', offset: 0}, {transform: 'none', opacity: '1', transformOrigin: 'right bottom', offset: 1} ]; } else { keyframes = [ {transform: 'rotate3d(0, 0, 1, -200deg)', opacity: '0', transformOrigin: 'center', offset: 0}, {transform: 'none', opacity: '1', transformOrigin: 'center', offset: 1} ]; } var player = elem.animate(keyframes, {duration: duration, iterations: 1}); player.onfinish = function() { elem.style.opacity = 1; if (waitForEnd) { ctx.done(); } } } else if (op === 'out') { if (dir === 'down-left') { keyframes = [ {transform: 'none', opacity: '1', transformOrigin: 'left bottom', offset: 0}, {transform: 'rotate3d(0, 0, 1, 45deg)', opacity: '0', transformOrigin: 'left bottom', offset: 1} ]; } else if (dir === 'down-right') { keyframes = [ {transform: 'none', opacity: '1', transformOrigin: 'right bottom', offset: 0}, {transform: 'rotate3d(0, 0, 1, -45deg)', opacity: '0', transformOrigin: 'right bottom', offset: 1} ]; } else if (dir === 'up-left') { keyframes = [ {transform: 'none', opacity: '1', transformOrigin: 'left bottom', offset: 0}, {transform: 'rotate3d(0, 0, 1, -45deg)', opacity: '0', transformOrigin: 'left bottom', offset: 1} ]; } else if (dir === 'up-right') { keyframes = [ {transform: 'none', opacity: '1', transformOrigin: 'right bottom', offset: 0}, {transform: 'rotate3d(0, 0, 1, 45deg)', opacity: '0', transformOrigin: 'right bottom', offset: 1} ]; } else { keyframes = [ {transform: 'none', opacity: '1', transformOrigin: 'center', offset: 0}, {transform: 'rotate3d(0, 0, 1, 200deg)', opacity: '0', transformOrigin: 'center', offset: 1} ]; } var player = elem.animate(keyframes, {duration: duration, iterations: 1}); player.onfinish = function() { elem.style.display = 'none'; if (waitForEnd) { ctx.done(); } } } else { return ctx.done; } if (!waitForEnd) { return ctx.done; } }; });
/// <reference path="../../jquery-1.8.3.intellisense.js" /> /// <reference path="../../miniui/miniui.js" /> /// <reference path="../../jquery-bbq/jquery.ba-bbq.js" /> (function (window) { $().ready(function () { $("#selectSkin").change(function () { onSkinChange($(this).val()); }); var skin = getCookie("miniuiSkin"); if (skin) { onSkinChange(skin); $("#selectSkin").val(skin); } else { onSkinChange($("#selectSkin").val()); } }); })(window);
/* * Copyright (C) 2014 Camptocamp * * This file is part of MapFish Print * * MapFish Print 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. * * MapFish Print 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 MapFish Print. If not, see <http://www.gnu.org/licenses/>. */ // Scripts will add the data to this docs variable var docs = {}; var docsApp = angular.module('docsApp', ['ui.bootstrap', 'pascalprecht.translate']); docsApp.config(function($translateProvider) { $translateProvider.useStaticFilesLoader({ prefix: 'strings-', suffix: '.json' }); $translateProvider.preferredLanguage('en'); }); docsApp.controller('DocsCtrl', function ($scope, $rootScope, $sce, $translate, $location, $anchorScroll, $timeout) { $scope.pages = { overview: { order: 0, title: 'tocOverview', html: 'overview-part.html', setRecords: function() {} }, jasperReports: { order: 1, title: 'tocJasperReports', html: 'jaspert-reports-part.html', setRecords: function() {} }, 'API': { order: 10, title: 'tocApiTitle', html: 'user-api-part.html', setRecords: function() {$scope.records = docs.api}, desc: 'tocApiDesc' }, 'configuration': { order: 20, title: 'tocConfigurationTitle', html: 'user-api-part.html', setRecords: function() {$scope.records = docs.config}, desc: 'tocConfigurationDesc' }, 'attributes': { order: 20, title: 'tocAttributesTitle', html: 'user-api-part.html', setRecords: function() {$scope.records = docs.attributes}, desc: 'tocAttributesDesc', inputTitle: 'jsonParamTitle' }, 'processors': { order: 20, title: 'tocProcessorTitle', html: 'user-api-part.html', setRecords: function() {$scope.records = docs.processors} , desc: 'tocProcessorsDesc', inputTitle: 'inputParamTitle', outputTitle: 'outputParamTitle' }, 'mapLayer': { order: 20, title: 'tocMapLayerTitle', html: 'user-api-part.html', setRecords: function() {$scope.records = docs.mapLayers}, desc: 'tocMapLayerDesc', inputTitle: 'jsonParamTitle' }, 'styles': { order: 30, title: 'tocStyleTitle', html: 'user-api-part.html', setRecords: function() {$scope.records = docs.styles}, desc: 'tocStyleDesc' }, 'outputFormats': { order: 30, title: 'tocOutputFormatsTitle', html: 'user-api-part.html', setRecords: function() {$scope.records = docs.outputFormats}, desc: 'tocOutputFormatsDesc' }, 'fileLoaders': { order: 30, title: 'tocFileLoadersTitle', html: 'user-api-part.html', setRecords: function() {$scope.records = docs.fileLoaders}, desc: 'tocFileLoadersDesc' }, downloads: { order: 40, title: 'tocDownloads', html: 'downloads-part.html', setRecords: function() {} } }; $scope.page = 'overview'; $scope.records = docs.api; $scope.select = function (page) { $scope.page = page; $scope.pages[page].setRecords() }; $rootScope.$on('$locationChangeSuccess', function(event){ var page, record, detail; var path = $location.path() || ""; page = path.substr(1); if (!$scope.pages[page]) { for ($scope.page in $scope.pages) break; $location.path('/' + $scope.page); } $scope.select(page); $timeout(function () { // wait until page is rendered then scroll to correct element console.log($location.hash()); $anchorScroll(); }, 500); }); $scope.getTitle = function(record) { if (record.translateTitle) { return $translate.instant(record.title) } else { return record.title } }; $scope.renderHtml = function(html){ return $sce.trustAsHtml($translate.instant(html)); }; var translatePages = function() { var toTranslate = []; angular.forEach($scope.pages, function (p){ toTranslate.push(p.title) }); $translate(toTranslate).then(function (translations) { angular.forEach($scope.pages, function (p){ var titleKey = p.title; p.title = translations[titleKey]; }); }); }; $scope.select($scope.page); translatePages(); }); docsApp.filter('sortTableOfContents', function(){ return function (items) { var p, item, filtered = []; for (p in items) { if (items.hasOwnProperty(p)) { item = items[p]; item.key = p; filtered.push(items[p]) } } filtered.sort(function(a,b) { if (a.order != b.order) { return a.order < b.order ? -1 : 1; } else { return a.title < b.title ? -1 : 1; } }); return filtered; } }); docsApp.filter('sortRecords', function($translate){ return function (items) { items.sort(function(a,b) { return $translate.instant(a.title) < $translate.instant(b.title) ? -1 : 1; }); return items; } }); docsApp.hashPathSeparator = '__'; docsApp.controller('RecordCtrl', function ($scope, $location) { var title = $scope.record.title; $scope.expanded = $location.hash() === title || $location.hash().indexOf(title + docsApp.hashPathSeparator) === 0; $scope.setLocationHash = function() { $location.hash($scope.record.title); }; }); docsApp.controller('DetailCtrl', function ($scope, $location) { $scope.setLocationHash = function(id, $event) { $event.stopPropagation(); $location.hash(id); }; $scope.anchorId = function (detail, type) { var id = $scope.record.title + docsApp.hashPathSeparator + type + docsApp.hashPathSeparator + detail.title; return id.replace(/[:\/\s\[\]\\]/g, '+'); } });
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow */ import type {Fiber} from './ReactInternalTypes'; import type {Lanes} from './ReactFiberLane.old'; import type {UpdateQueue} from './ReactUpdateQueue.old'; import type {Flags} from './ReactFiberFlags'; import * as React from 'react'; import { LayoutStatic, MountLayoutDev, Update, Snapshot, } from './ReactFiberFlags'; import { debugRenderPhaseSideEffectsForStrictMode, disableLegacyContext, enableDebugTracing, enableSchedulingProfiler, warnAboutDeprecatedLifecycles, enableStrictEffects, enableLazyContextPropagation, enableSuspenseLayoutEffectSemantics, } from 'shared/ReactFeatureFlags'; import ReactStrictModeWarnings from './ReactStrictModeWarnings.old'; import {isMounted} from './ReactFiberTreeReflection'; import {get as getInstance, set as setInstance} from 'shared/ReactInstanceMap'; import shallowEqual from 'shared/shallowEqual'; import getComponentNameFromFiber from 'react-reconciler/src/getComponentNameFromFiber'; import getComponentNameFromType from 'shared/getComponentNameFromType'; import isArray from 'shared/isArray'; import {REACT_CONTEXT_TYPE, REACT_PROVIDER_TYPE} from 'shared/ReactSymbols'; import {resolveDefaultProps} from './ReactFiberLazyComponent.old'; import { DebugTracingMode, NoMode, StrictLegacyMode, StrictEffectsMode, } from './ReactTypeOfMode'; import { enqueueUpdate, entangleTransitions, processUpdateQueue, checkHasForceUpdateAfterProcessing, resetHasForceUpdateBeforeProcessing, createUpdate, ReplaceState, ForceUpdate, initializeUpdateQueue, cloneUpdateQueue, } from './ReactUpdateQueue.old'; import {NoLanes} from './ReactFiberLane.old'; import { cacheContext, getMaskedContext, getUnmaskedContext, hasContextChanged, emptyContextObject, } from './ReactFiberContext.old'; import {readContext, checkIfContextChanged} from './ReactFiberNewContext.old'; import { requestEventTime, requestUpdateLane, scheduleUpdateOnFiber, } from './ReactFiberWorkLoop.old'; import {logForceUpdateScheduled, logStateUpdateScheduled} from './DebugTracing'; import { markForceUpdateScheduled, markStateUpdateScheduled, setIsStrictModeForDevtools, } from './ReactFiberDevToolsHook.old'; const fakeInternalInstance = {}; // React.Component uses a shared frozen object by default. // We'll use it to determine whether we need to initialize legacy refs. export const emptyRefsObject = new React.Component().refs; let didWarnAboutStateAssignmentForComponent; let didWarnAboutUninitializedState; let didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate; let didWarnAboutLegacyLifecyclesAndDerivedState; let didWarnAboutUndefinedDerivedState; let warnOnUndefinedDerivedState; let warnOnInvalidCallback; let didWarnAboutDirectlyAssigningPropsToState; let didWarnAboutContextTypeAndContextTypes; let didWarnAboutInvalidateContextType; if (__DEV__) { didWarnAboutStateAssignmentForComponent = new Set(); didWarnAboutUninitializedState = new Set(); didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); didWarnAboutLegacyLifecyclesAndDerivedState = new Set(); didWarnAboutDirectlyAssigningPropsToState = new Set(); didWarnAboutUndefinedDerivedState = new Set(); didWarnAboutContextTypeAndContextTypes = new Set(); didWarnAboutInvalidateContextType = new Set(); const didWarnOnInvalidCallback = new Set(); warnOnInvalidCallback = function(callback: mixed, callerName: string) { if (callback === null || typeof callback === 'function') { return; } const key = callerName + '_' + (callback: any); if (!didWarnOnInvalidCallback.has(key)) { didWarnOnInvalidCallback.add(key); console.error( '%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback, ); } }; warnOnUndefinedDerivedState = function(type, partialState) { if (partialState === undefined) { const componentName = getComponentNameFromType(type) || 'Component'; if (!didWarnAboutUndefinedDerivedState.has(componentName)) { didWarnAboutUndefinedDerivedState.add(componentName); console.error( '%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', componentName, ); } } }; // This is so gross but it's at least non-critical and can be removed if // it causes problems. This is meant to give a nicer error message for // ReactDOM15.unstable_renderSubtreeIntoContainer(reactDOM16Component, // ...)) which otherwise throws a "_processChildContext is not a function" // exception. Object.defineProperty(fakeInternalInstance, '_processChildContext', { enumerable: false, value: function() { throw new Error( '_processChildContext is not available in React 16+. This likely ' + 'means you have multiple copies of React and are attempting to nest ' + 'a React 15 tree inside a React 16 tree using ' + "unstable_renderSubtreeIntoContainer, which isn't supported. Try " + 'to make sure you have only one copy of React (and ideally, switch ' + 'to ReactDOM.createPortal).', ); }, }); Object.freeze(fakeInternalInstance); } function applyDerivedStateFromProps( workInProgress: Fiber, ctor: any, getDerivedStateFromProps: (props: any, state: any) => any, nextProps: any, ) { const prevState = workInProgress.memoizedState; let partialState = getDerivedStateFromProps(nextProps, prevState); if (__DEV__) { if ( debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictLegacyMode ) { setIsStrictModeForDevtools(true); try { // Invoke the function an extra time to help detect side-effects. partialState = getDerivedStateFromProps(nextProps, prevState); } finally { setIsStrictModeForDevtools(false); } } warnOnUndefinedDerivedState(ctor, partialState); } // Merge the partial state and the previous state. const memoizedState = partialState === null || partialState === undefined ? prevState : Object.assign({}, prevState, partialState); workInProgress.memoizedState = memoizedState; // Once the update queue is empty, persist the derived state onto the // base state. if (workInProgress.lanes === NoLanes) { // Queue is always non-null for classes const updateQueue: UpdateQueue<any> = (workInProgress.updateQueue: any); updateQueue.baseState = memoizedState; } } const classComponentUpdater = { isMounted, enqueueSetState(inst, payload, callback) { const fiber = getInstance(inst); const eventTime = requestEventTime(); const lane = requestUpdateLane(fiber); const update = createUpdate(eventTime, lane); update.payload = payload; if (callback !== undefined && callback !== null) { if (__DEV__) { warnOnInvalidCallback(callback, 'setState'); } update.callback = callback; } enqueueUpdate(fiber, update, lane); const root = scheduleUpdateOnFiber(fiber, lane, eventTime); if (root !== null) { entangleTransitions(root, fiber, lane); } if (__DEV__) { if (enableDebugTracing) { if (fiber.mode & DebugTracingMode) { const name = getComponentNameFromFiber(fiber) || 'Unknown'; logStateUpdateScheduled(name, lane, payload); } } } if (enableSchedulingProfiler) { markStateUpdateScheduled(fiber, lane); } }, enqueueReplaceState(inst, payload, callback) { const fiber = getInstance(inst); const eventTime = requestEventTime(); const lane = requestUpdateLane(fiber); const update = createUpdate(eventTime, lane); update.tag = ReplaceState; update.payload = payload; if (callback !== undefined && callback !== null) { if (__DEV__) { warnOnInvalidCallback(callback, 'replaceState'); } update.callback = callback; } enqueueUpdate(fiber, update, lane); const root = scheduleUpdateOnFiber(fiber, lane, eventTime); if (root !== null) { entangleTransitions(root, fiber, lane); } if (__DEV__) { if (enableDebugTracing) { if (fiber.mode & DebugTracingMode) { const name = getComponentNameFromFiber(fiber) || 'Unknown'; logStateUpdateScheduled(name, lane, payload); } } } if (enableSchedulingProfiler) { markStateUpdateScheduled(fiber, lane); } }, enqueueForceUpdate(inst, callback) { const fiber = getInstance(inst); const eventTime = requestEventTime(); const lane = requestUpdateLane(fiber); const update = createUpdate(eventTime, lane); update.tag = ForceUpdate; if (callback !== undefined && callback !== null) { if (__DEV__) { warnOnInvalidCallback(callback, 'forceUpdate'); } update.callback = callback; } enqueueUpdate(fiber, update, lane); const root = scheduleUpdateOnFiber(fiber, lane, eventTime); if (root !== null) { entangleTransitions(root, fiber, lane); } if (__DEV__) { if (enableDebugTracing) { if (fiber.mode & DebugTracingMode) { const name = getComponentNameFromFiber(fiber) || 'Unknown'; logForceUpdateScheduled(name, lane); } } } if (enableSchedulingProfiler) { markForceUpdateScheduled(fiber, lane); } }, }; function checkShouldComponentUpdate( workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext, ) { const instance = workInProgress.stateNode; if (typeof instance.shouldComponentUpdate === 'function') { let shouldUpdate = instance.shouldComponentUpdate( newProps, newState, nextContext, ); if (__DEV__) { if ( debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictLegacyMode ) { setIsStrictModeForDevtools(true); try { // Invoke the function an extra time to help detect side-effects. shouldUpdate = instance.shouldComponentUpdate( newProps, newState, nextContext, ); } finally { setIsStrictModeForDevtools(false); } } if (shouldUpdate === undefined) { console.error( '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentNameFromType(ctor) || 'Component', ); } } return shouldUpdate; } if (ctor.prototype && ctor.prototype.isPureReactComponent) { return ( !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) ); } return true; } function checkClassInstance(workInProgress: Fiber, ctor: any, newProps: any) { const instance = workInProgress.stateNode; if (__DEV__) { const name = getComponentNameFromType(ctor) || 'Component'; const renderPresent = instance.render; if (!renderPresent) { if (ctor.prototype && typeof ctor.prototype.render === 'function') { console.error( '%s(...): No `render` method found on the returned component ' + 'instance: did you accidentally return an object from the constructor?', name, ); } else { console.error( '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', name, ); } } if ( instance.getInitialState && !instance.getInitialState.isReactClassApproved && !instance.state ) { console.error( 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', name, ); } if ( instance.getDefaultProps && !instance.getDefaultProps.isReactClassApproved ) { console.error( 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', name, ); } if (instance.propTypes) { console.error( 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', name, ); } if (instance.contextType) { console.error( 'contextType was defined as an instance property on %s. Use a static ' + 'property to define contextType instead.', name, ); } if (disableLegacyContext) { if (ctor.childContextTypes) { console.error( '%s uses the legacy childContextTypes API which is no longer supported. ' + 'Use React.createContext() instead.', name, ); } if (ctor.contextTypes) { console.error( '%s uses the legacy contextTypes API which is no longer supported. ' + 'Use React.createContext() with static contextType instead.', name, ); } } else { if (instance.contextTypes) { console.error( 'contextTypes was defined as an instance property on %s. Use a static ' + 'property to define contextTypes instead.', name, ); } if ( ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor) ) { didWarnAboutContextTypeAndContextTypes.add(ctor); console.error( '%s declares both contextTypes and contextType static properties. ' + 'The legacy contextTypes property will be ignored.', name, ); } } if (typeof instance.componentShouldUpdate === 'function') { console.error( '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', name, ); } if ( ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== 'undefined' ) { console.error( '%s has a method called shouldComponentUpdate(). ' + 'shouldComponentUpdate should not be used when extending React.PureComponent. ' + 'Please extend React.Component if shouldComponentUpdate is used.', getComponentNameFromType(ctor) || 'A pure component', ); } if (typeof instance.componentDidUnmount === 'function') { console.error( '%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', name, ); } if (typeof instance.componentDidReceiveProps === 'function') { console.error( '%s has a method called ' + 'componentDidReceiveProps(). But there is no such lifecycle method. ' + 'If you meant to update the state in response to changing props, ' + 'use componentWillReceiveProps(). If you meant to fetch data or ' + 'run side-effects or mutations after React has updated the UI, use componentDidUpdate().', name, ); } if (typeof instance.componentWillRecieveProps === 'function') { console.error( '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', name, ); } if (typeof instance.UNSAFE_componentWillRecieveProps === 'function') { console.error( '%s has a method called ' + 'UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?', name, ); } const hasMutatedProps = instance.props !== newProps; if (instance.props !== undefined && hasMutatedProps) { console.error( '%s(...): When calling super() in `%s`, make sure to pass ' + "up the same props that your component's constructor was passed.", name, name, ); } if (instance.defaultProps) { console.error( 'Setting defaultProps as an instance property on %s is not supported and will be ignored.' + ' Instead, define defaultProps as a static property on %s.', name, name, ); } if ( typeof instance.getSnapshotBeforeUpdate === 'function' && typeof instance.componentDidUpdate !== 'function' && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor) ) { didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor); console.error( '%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). ' + 'This component defines getSnapshotBeforeUpdate() only.', getComponentNameFromType(ctor), ); } if (typeof instance.getDerivedStateFromProps === 'function') { console.error( '%s: getDerivedStateFromProps() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name, ); } if (typeof instance.getDerivedStateFromError === 'function') { console.error( '%s: getDerivedStateFromError() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name, ); } if (typeof ctor.getSnapshotBeforeUpdate === 'function') { console.error( '%s: getSnapshotBeforeUpdate() is defined as a static method ' + 'and will be ignored. Instead, declare it as an instance method.', name, ); } const state = instance.state; if (state && (typeof state !== 'object' || isArray(state))) { console.error('%s.state: must be set to an object or null', name); } if ( typeof instance.getChildContext === 'function' && typeof ctor.childContextTypes !== 'object' ) { console.error( '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', name, ); } } } function adoptClassInstance(workInProgress: Fiber, instance: any): void { instance.updater = classComponentUpdater; workInProgress.stateNode = instance; // The instance needs access to the fiber so that it can schedule updates setInstance(instance, workInProgress); if (__DEV__) { instance._reactInternalInstance = fakeInternalInstance; } } function constructClassInstance( workInProgress: Fiber, ctor: any, props: any, ): any { let isLegacyContextConsumer = false; let unmaskedContext = emptyContextObject; let context = emptyContextObject; const contextType = ctor.contextType; if (__DEV__) { if ('contextType' in ctor) { const isValid = // Allow null for conditional declaration contextType === null || (contextType !== undefined && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === undefined); // Not a <Context.Consumer> if (!isValid && !didWarnAboutInvalidateContextType.has(ctor)) { didWarnAboutInvalidateContextType.add(ctor); let addendum = ''; if (contextType === undefined) { addendum = ' However, it is set to undefined. ' + 'This can be caused by a typo or by mixing up named and default imports. ' + 'This can also happen due to a circular dependency, so ' + 'try moving the createContext() call to a separate file.'; } else if (typeof contextType !== 'object') { addendum = ' However, it is set to a ' + typeof contextType + '.'; } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) { addendum = ' Did you accidentally pass the Context.Provider instead?'; } else if (contextType._context !== undefined) { // <Context.Consumer> addendum = ' Did you accidentally pass the Context.Consumer instead?'; } else { addendum = ' However, it is set to an object with keys {' + Object.keys(contextType).join(', ') + '}.'; } console.error( '%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext().%s', getComponentNameFromType(ctor) || 'Component', addendum, ); } } } if (typeof contextType === 'object' && contextType !== null) { context = readContext((contextType: any)); } else if (!disableLegacyContext) { unmaskedContext = getUnmaskedContext(workInProgress, ctor, true); const contextTypes = ctor.contextTypes; isLegacyContextConsumer = contextTypes !== null && contextTypes !== undefined; context = isLegacyContextConsumer ? getMaskedContext(workInProgress, unmaskedContext) : emptyContextObject; } let instance = new ctor(props, context); // Instantiate twice to help detect side-effects. if (__DEV__) { if ( debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictLegacyMode ) { setIsStrictModeForDevtools(true); try { instance = new ctor(props, context); // eslint-disable-line no-new } finally { setIsStrictModeForDevtools(false); } } } const state = (workInProgress.memoizedState = instance.state !== null && instance.state !== undefined ? instance.state : null); adoptClassInstance(workInProgress, instance); if (__DEV__) { if (typeof ctor.getDerivedStateFromProps === 'function' && state === null) { const componentName = getComponentNameFromType(ctor) || 'Component'; if (!didWarnAboutUninitializedState.has(componentName)) { didWarnAboutUninitializedState.add(componentName); console.error( '`%s` uses `getDerivedStateFromProps` but its initial state is ' + '%s. This is not recommended. Instead, define the initial state by ' + 'assigning an object to `this.state` in the constructor of `%s`. ' + 'This ensures that `getDerivedStateFromProps` arguments have a consistent shape.', componentName, instance.state === null ? 'null' : 'undefined', componentName, ); } } // If new component APIs are defined, "unsafe" lifecycles won't be called. // Warn about these lifecycles if they are present. // Don't warn about react-lifecycles-compat polyfilled methods though. if ( typeof ctor.getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function' ) { let foundWillMountName = null; let foundWillReceivePropsName = null; let foundWillUpdateName = null; if ( typeof instance.componentWillMount === 'function' && instance.componentWillMount.__suppressDeprecationWarning !== true ) { foundWillMountName = 'componentWillMount'; } else if (typeof instance.UNSAFE_componentWillMount === 'function') { foundWillMountName = 'UNSAFE_componentWillMount'; } if ( typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true ) { foundWillReceivePropsName = 'componentWillReceiveProps'; } else if ( typeof instance.UNSAFE_componentWillReceiveProps === 'function' ) { foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps'; } if ( typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true ) { foundWillUpdateName = 'componentWillUpdate'; } else if (typeof instance.UNSAFE_componentWillUpdate === 'function') { foundWillUpdateName = 'UNSAFE_componentWillUpdate'; } if ( foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null ) { const componentName = getComponentNameFromType(ctor) || 'Component'; const newApiName = typeof ctor.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()'; if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(componentName)) { didWarnAboutLegacyLifecyclesAndDerivedState.add(componentName); console.error( 'Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' + '%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\n' + 'The above lifecycles should be removed. Learn more about this warning here:\n' + 'https://reactjs.org/link/unsafe-component-lifecycles', componentName, newApiName, foundWillMountName !== null ? `\n ${foundWillMountName}` : '', foundWillReceivePropsName !== null ? `\n ${foundWillReceivePropsName}` : '', foundWillUpdateName !== null ? `\n ${foundWillUpdateName}` : '', ); } } } } // Cache unmasked context so we can avoid recreating masked context unless necessary. // ReactFiberContext usually updates this cache but can't for newly-created instances. if (isLegacyContextConsumer) { cacheContext(workInProgress, unmaskedContext, context); } return instance; } function callComponentWillMount(workInProgress, instance) { const oldState = instance.state; if (typeof instance.componentWillMount === 'function') { instance.componentWillMount(); } if (typeof instance.UNSAFE_componentWillMount === 'function') { instance.UNSAFE_componentWillMount(); } if (oldState !== instance.state) { if (__DEV__) { console.error( '%s.componentWillMount(): Assigning directly to this.state is ' + "deprecated (except inside a component's " + 'constructor). Use setState instead.', getComponentNameFromFiber(workInProgress) || 'Component', ); } classComponentUpdater.enqueueReplaceState(instance, instance.state, null); } } function callComponentWillReceiveProps( workInProgress, instance, newProps, nextContext, ) { const oldState = instance.state; if (typeof instance.componentWillReceiveProps === 'function') { instance.componentWillReceiveProps(newProps, nextContext); } if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') { instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); } if (instance.state !== oldState) { if (__DEV__) { const componentName = getComponentNameFromFiber(workInProgress) || 'Component'; if (!didWarnAboutStateAssignmentForComponent.has(componentName)) { didWarnAboutStateAssignmentForComponent.add(componentName); console.error( '%s.componentWillReceiveProps(): Assigning directly to ' + "this.state is deprecated (except inside a component's " + 'constructor). Use setState instead.', componentName, ); } } classComponentUpdater.enqueueReplaceState(instance, instance.state, null); } } // Invokes the mount life-cycles on a previously never rendered instance. function mountClassInstance( workInProgress: Fiber, ctor: any, newProps: any, renderLanes: Lanes, ): void { if (__DEV__) { checkClassInstance(workInProgress, ctor, newProps); } const instance = workInProgress.stateNode; instance.props = newProps; instance.state = workInProgress.memoizedState; instance.refs = emptyRefsObject; initializeUpdateQueue(workInProgress); const contextType = ctor.contextType; if (typeof contextType === 'object' && contextType !== null) { instance.context = readContext(contextType); } else if (disableLegacyContext) { instance.context = emptyContextObject; } else { const unmaskedContext = getUnmaskedContext(workInProgress, ctor, true); instance.context = getMaskedContext(workInProgress, unmaskedContext); } if (__DEV__) { if (instance.state === newProps) { const componentName = getComponentNameFromType(ctor) || 'Component'; if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) { didWarnAboutDirectlyAssigningPropsToState.add(componentName); console.error( '%s: It is not recommended to assign props directly to state ' + "because updates to props won't be reflected in state. " + 'In most cases, it is better to use props directly.', componentName, ); } } if (workInProgress.mode & StrictLegacyMode) { ReactStrictModeWarnings.recordLegacyContextWarning( workInProgress, instance, ); } if (warnAboutDeprecatedLifecycles) { ReactStrictModeWarnings.recordUnsafeLifecycleWarnings( workInProgress, instance, ); } } instance.state = workInProgress.memoizedState; const getDerivedStateFromProps = ctor.getDerivedStateFromProps; if (typeof getDerivedStateFromProps === 'function') { applyDerivedStateFromProps( workInProgress, ctor, getDerivedStateFromProps, newProps, ); instance.state = workInProgress.memoizedState; } // In order to support react-lifecycles-compat polyfilled components, // Unsafe lifecycles should not be invoked for components using the new APIs. if ( typeof ctor.getDerivedStateFromProps !== 'function' && typeof instance.getSnapshotBeforeUpdate !== 'function' && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function') ) { callComponentWillMount(workInProgress, instance); // If we had additional state updates during this life-cycle, let's // process them now. processUpdateQueue(workInProgress, newProps, instance, renderLanes); instance.state = workInProgress.memoizedState; } if (typeof instance.componentDidMount === 'function') { let fiberFlags: Flags = Update; if (enableSuspenseLayoutEffectSemantics) { fiberFlags |= LayoutStatic; } if ( __DEV__ && enableStrictEffects && (workInProgress.mode & StrictEffectsMode) !== NoMode ) { fiberFlags |= MountLayoutDev; } workInProgress.flags |= fiberFlags; } } function resumeMountClassInstance( workInProgress: Fiber, ctor: any, newProps: any, renderLanes: Lanes, ): boolean { const instance = workInProgress.stateNode; const oldProps = workInProgress.memoizedProps; instance.props = oldProps; const oldContext = instance.context; const contextType = ctor.contextType; let nextContext = emptyContextObject; if (typeof contextType === 'object' && contextType !== null) { nextContext = readContext(contextType); } else if (!disableLegacyContext) { const nextLegacyUnmaskedContext = getUnmaskedContext( workInProgress, ctor, true, ); nextContext = getMaskedContext(workInProgress, nextLegacyUnmaskedContext); } const getDerivedStateFromProps = ctor.getDerivedStateFromProps; const hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; // Note: During these life-cycles, instance.props/instance.state are what // ever the previously attempted to render - not the "current". However, // during componentDidUpdate we pass the "current" props. // In order to support react-lifecycles-compat polyfilled components, // Unsafe lifecycles should not be invoked for components using the new APIs. if ( !hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function') ) { if (oldProps !== newProps || oldContext !== nextContext) { callComponentWillReceiveProps( workInProgress, instance, newProps, nextContext, ); } } resetHasForceUpdateBeforeProcessing(); const oldState = workInProgress.memoizedState; let newState = (instance.state = oldState); processUpdateQueue(workInProgress, newProps, instance, renderLanes); newState = workInProgress.memoizedState; if ( oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing() ) { // If an update was already in progress, we should schedule an Update // effect even though we're bailing out, so that cWU/cDU are called. if (typeof instance.componentDidMount === 'function') { let fiberFlags: Flags = Update; if (enableSuspenseLayoutEffectSemantics) { fiberFlags |= LayoutStatic; } if ( __DEV__ && enableStrictEffects && (workInProgress.mode & StrictEffectsMode) !== NoMode ) { fiberFlags |= MountLayoutDev; } workInProgress.flags |= fiberFlags; } return false; } if (typeof getDerivedStateFromProps === 'function') { applyDerivedStateFromProps( workInProgress, ctor, getDerivedStateFromProps, newProps, ); newState = workInProgress.memoizedState; } const shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate( workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext, ); if (shouldUpdate) { // In order to support react-lifecycles-compat polyfilled components, // Unsafe lifecycles should not be invoked for components using the new APIs. if ( !hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function') ) { if (typeof instance.componentWillMount === 'function') { instance.componentWillMount(); } if (typeof instance.UNSAFE_componentWillMount === 'function') { instance.UNSAFE_componentWillMount(); } } if (typeof instance.componentDidMount === 'function') { let fiberFlags: Flags = Update; if (enableSuspenseLayoutEffectSemantics) { fiberFlags |= LayoutStatic; } if ( __DEV__ && enableStrictEffects && (workInProgress.mode & StrictEffectsMode) !== NoMode ) { fiberFlags |= MountLayoutDev; } workInProgress.flags |= fiberFlags; } } else { // If an update was already in progress, we should schedule an Update // effect even though we're bailing out, so that cWU/cDU are called. if (typeof instance.componentDidMount === 'function') { let fiberFlags: Flags = Update; if (enableSuspenseLayoutEffectSemantics) { fiberFlags |= LayoutStatic; } if ( __DEV__ && enableStrictEffects && (workInProgress.mode & StrictEffectsMode) !== NoMode ) { fiberFlags |= MountLayoutDev; } workInProgress.flags |= fiberFlags; } // If shouldComponentUpdate returned false, we should still update the // memoized state to indicate that this work can be reused. workInProgress.memoizedProps = newProps; workInProgress.memoizedState = newState; } // Update the existing instance's state, props, and context pointers even // if shouldComponentUpdate returns false. instance.props = newProps; instance.state = newState; instance.context = nextContext; return shouldUpdate; } // Invokes the update life-cycles and returns false if it shouldn't rerender. function updateClassInstance( current: Fiber, workInProgress: Fiber, ctor: any, newProps: any, renderLanes: Lanes, ): boolean { const instance = workInProgress.stateNode; cloneUpdateQueue(current, workInProgress); const unresolvedOldProps = workInProgress.memoizedProps; const oldProps = workInProgress.type === workInProgress.elementType ? unresolvedOldProps : resolveDefaultProps(workInProgress.type, unresolvedOldProps); instance.props = oldProps; const unresolvedNewProps = workInProgress.pendingProps; const oldContext = instance.context; const contextType = ctor.contextType; let nextContext = emptyContextObject; if (typeof contextType === 'object' && contextType !== null) { nextContext = readContext(contextType); } else if (!disableLegacyContext) { const nextUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true); nextContext = getMaskedContext(workInProgress, nextUnmaskedContext); } const getDerivedStateFromProps = ctor.getDerivedStateFromProps; const hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; // Note: During these life-cycles, instance.props/instance.state are what // ever the previously attempted to render - not the "current". However, // during componentDidUpdate we pass the "current" props. // In order to support react-lifecycles-compat polyfilled components, // Unsafe lifecycles should not be invoked for components using the new APIs. if ( !hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function') ) { if ( unresolvedOldProps !== unresolvedNewProps || oldContext !== nextContext ) { callComponentWillReceiveProps( workInProgress, instance, newProps, nextContext, ); } } resetHasForceUpdateBeforeProcessing(); const oldState = workInProgress.memoizedState; let newState = (instance.state = oldState); processUpdateQueue(workInProgress, newProps, instance, renderLanes); newState = workInProgress.memoizedState; if ( unresolvedOldProps === unresolvedNewProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing() && !( enableLazyContextPropagation && current !== null && current.dependencies !== null && checkIfContextChanged(current.dependencies) ) ) { // If an update was already in progress, we should schedule an Update // effect even though we're bailing out, so that cWU/cDU are called. if (typeof instance.componentDidUpdate === 'function') { if ( unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState ) { workInProgress.flags |= Update; } } if (typeof instance.getSnapshotBeforeUpdate === 'function') { if ( unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState ) { workInProgress.flags |= Snapshot; } } return false; } if (typeof getDerivedStateFromProps === 'function') { applyDerivedStateFromProps( workInProgress, ctor, getDerivedStateFromProps, newProps, ); newState = workInProgress.memoizedState; } const shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate( workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext, ) || // TODO: In some cases, we'll end up checking if context has changed twice, // both before and after `shouldComponentUpdate` has been called. Not ideal, // but I'm loath to refactor this function. This only happens for memoized // components so it's not that common. (enableLazyContextPropagation && current !== null && current.dependencies !== null && checkIfContextChanged(current.dependencies)); if (shouldUpdate) { // In order to support react-lifecycles-compat polyfilled components, // Unsafe lifecycles should not be invoked for components using the new APIs. if ( !hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === 'function' || typeof instance.componentWillUpdate === 'function') ) { if (typeof instance.componentWillUpdate === 'function') { instance.componentWillUpdate(newProps, newState, nextContext); } if (typeof instance.UNSAFE_componentWillUpdate === 'function') { instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext); } } if (typeof instance.componentDidUpdate === 'function') { workInProgress.flags |= Update; } if (typeof instance.getSnapshotBeforeUpdate === 'function') { workInProgress.flags |= Snapshot; } } else { // If an update was already in progress, we should schedule an Update // effect even though we're bailing out, so that cWU/cDU are called. if (typeof instance.componentDidUpdate === 'function') { if ( unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState ) { workInProgress.flags |= Update; } } if (typeof instance.getSnapshotBeforeUpdate === 'function') { if ( unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState ) { workInProgress.flags |= Snapshot; } } // If shouldComponentUpdate returned false, we should still update the // memoized props/state to indicate that this work can be reused. workInProgress.memoizedProps = newProps; workInProgress.memoizedState = newState; } // Update the existing instance's state, props, and context pointers even // if shouldComponentUpdate returns false. instance.props = newProps; instance.state = newState; instance.context = nextContext; return shouldUpdate; } export { adoptClassInstance, constructClassInstance, mountClassInstance, resumeMountClassInstance, updateClassInstance, };
(function () { 'use strict'; angular .module('webApp') .controller('AccountGamesController', accountGamesController); accountGamesController.$inject = ['TranslationFactory', 'WebAppConstants', 'GamelinkService', 'GamelinksListFactory']; function accountGamesController(TranslationFactory, WebAppConstants, GamelinkService, GamelinksListFactory) { /* jshint validthis: true */ var vm = this; vm.translation = TranslationFactory.messages; vm.supportedgames = WebAppConstants.GAME_LIST; vm.gameslinks = GamelinksListFactory.instance; vm.regionlist = []; vm.creategamelink = {}; vm.fetchUserAccountGames = fetchUserAccountGames; vm.buildRegionList = buildRegionList; vm.createGamelink = createGamelink; activate(); function activate(){ vm.fetchUserAccountGames(); } function fetchUserAccountGames(){ GamelinkService.fetchGamelinks(); } function createGamelink(){ function success(){ fetchUserAccountGames(); } GamelinkService.createGamelink(vm.creategamelink, success); } function buildRegionList(){ vm.creategamelink.region = ''; for (var i = 0; i < vm.supportedgames.length; i++){ if (vm.creategamelink.game == vm.supportedgames[i].ID){ vm.regionlist = vm.supportedgames[i].REGIONS; return; } } vm.regionlist = []; } } })();
var class_wanzyee_studio_1_1_crypto_long = [ [ "CryptoLong", "class_wanzyee_studio_1_1_crypto_long.html#a4b1cd1e431c417c3e55cea9504b4ce6a", null ], [ "ReadObfuscated", "class_wanzyee_studio_1_1_crypto_long.html#af57cdb2e3959435a73f296e10919600e", null ], [ "WriteObfuscated", "class_wanzyee_studio_1_1_crypto_long.html#a008b01dbc9876bed9d4d75aa08c4286c", null ], [ "OnBeforeSerialize", "class_wanzyee_studio_1_1_crypto_long.html#a35f6b52ba995bde7bfc1d9835b5d48b6", null ], [ "OnAfterDeserialize", "class_wanzyee_studio_1_1_crypto_long.html#a7ffb1a862e7beb0c3ffa4e3359387d3a", null ], [ "WriteObfuscated", "class_wanzyee_studio_1_1_crypto_long.html#ad2d11ebb7643d8d31f9727471f10d8d3", null ], [ "RandomValue", "class_wanzyee_studio_1_1_crypto_long.html#a1932bcdccc7515fffb44ff863dec02df", null ], [ "value", "class_wanzyee_studio_1_1_crypto_long.html#abcf64b84c9ecb7087867368699e3d812", null ] ];
'use strict'; let React = require('react'); let Styles = require('../style/'); function keys(obj) { let keys = []; for (let key in obj) keys.push(key); return keys; } let Table = React.createClass({ _header: function() { let items = keys(this.props.items[0]).map(function(item,i) { return (<th key={i} style={Styles.Table.Cell(this.props.style)}>{item}</th>); }.bind(this)); return ( <thead> <tr> {items} </tr> </thead> ); }, _row: function(row) { let items = keys(row); let rowData = items.map(function(item, i) { return (<td key={i} style={Styles.Table.Cell(this.props.style)}>{row[item]}</td>); }.bind(this)); return (<tr>{rowData}</tr>); }, _rows: function() { let self = this; let items = this.props.items.map(function(item) { return self._row(item); }.bind(this)); return ( <tbody> {items} </tbody> ); }, render: function() { return ( <table style={Styles.Table.Table(this.props.style)}> {this._header()} {this._rows()} </table> ); } }); module.exports = Table;
// Karma configuration file, see link for more information // https://karma-runner.github.io/1.0/config/configuration-file.html const { join } = require('path'); const getBaseKarmaConfig = require('../../../karma.conf'); module.exports = function (config) { const baseConfig = getBaseKarmaConfig(); config.set({ ...baseConfig, coverageReporter: { ...baseConfig.coverageReporter, dir: join(__dirname, '../../../coverage/libs/components/phone-field'), }, }); };
'use strict'; var Menu = require('menu'); function setupMenu() { return; var template = [{ label: 'Bieber', submenu: [{ label: 'What do you do?' }, { label: 'Never say never' }] }, { label: 'Electron', submenu: [{ label: 'About Electron', selector: 'orderFrontStandardAboutPanel:' }, { type: 'separator' }, { label: 'Services', submenu: [] }, { type: 'separator' }, { label: 'Hide Electron', accelerator: 'Command+H', selector: 'hide:' }, { label: 'Hide Others', accelerator: 'Command+Shift+H', selector: 'hideOtherApplications:' }, { label: 'Show All', selector: 'unhideAllApplications:' }, { type: 'separator' }, { label: 'Quit', accelerator: 'Command+Q', selector: 'terminate:' }] }, { label: 'Edit', submenu: [{ label: 'Undo', accelerator: 'Command+Z', selector: 'undo:' }, { label: 'Redo', accelerator: 'Shift+Command+Z', selector: 'redo:' }, { type: 'separator' }, { label: 'Cut', accelerator: 'Command+X', selector: 'cut:' }, { label: 'Copy', accelerator: 'Command+C', selector: 'copy:' }, { label: 'Paste', accelerator: 'Command+V', selector: 'paste:' }, { label: 'Select All', accelerator: 'Command+A', selector: 'selectAll:' }] }, { label: 'View', submenu: [{ label: 'Reload', accelerator: 'Command+R', click: function click() { getCurrentWindow().reload(); } }, { label: 'Toggle DevTools', accelerator: 'Alt+Command+I', click: function click() { getCurrentWindow().toggleDevTools(); } }] }, { label: 'Window', submenu: [{ label: 'Minimize', accelerator: 'Command+M', selector: 'performMiniaturize:' }, { label: 'Close', accelerator: 'Command+W', selector: 'performClose:' }, { type: 'separator' }, { label: 'Bring All to Front', selector: 'arrangeInFront:' }] }, { label: 'Help', submenu: [] }]; var menu = Menu.buildFromTemplate(template); Menu.setApplicationMenu(menu); } module.exports = { setupMenu: setupMenu }; //# sourceMappingURL=../sourcemaps/remote/Menu.js.map
const webpack = require('webpack') const marked = require('marked') const renderer = new marked.Renderer() const USE_PREFETCH = process.env.NODE_ENV !== 'test' renderer.heading = (text, level) => { const escapedText = text.toLowerCase().replace(/[^\w]+/g, '-') return `<h${level}><a name="${escapedText}" href="#${escapedText}">${text}</a></h${level}>` } module.exports = { webpack: config => { // Add in prefetch conditionally so we don't break jest snapshot testing config.plugins.push( new webpack.DefinePlugin({ 'process.env.USE_PREFETCH': JSON.stringify(USE_PREFETCH), }) ) // Markdown loader so we can use docs as .md files config.module.rules.push({ test: /\.md$/, use: [ {loader: 'html-loader'}, {loader: 'markdown-loader', options: {pedantic: true, renderer}}, ], }) config.node = config.node || {} Object.assign(config.node, { __dirname: true, __filename: true, }) return config }, } // This is not transpiled /* eslint comma-dangle: [ 2, { arrays: 'always-multiline', objects: 'always-multiline', functions: 'never' } ] */
'use strict'; var rhtml = require('rhtml'); module.exports = can.Control.extend({ defaults: { view: can.stache(rhtml('./main.mustache')) } }, { init: function (element, options) { // validateOptions(options); element.append(options.view()); } });
process.stdin.resume(); process.stdin.setEncoding('ascii'); var input = ""; var input_array = ""; var current_line = 0; process.stdin.on("data", function(data) { input += data; }); process.stdin.on("end", function() { input_array = input.split("\n"); main(); }); var readLine = function() { return input_array[current_line++]; } function main () { var a = parseInt(readLine()), b = parseInt(readLine()); console.log(a+b); }
import AV from 'avoscloud-sdk' const QuestionComment = AV.Object.extend('QuestionComment') /** * Class Methods */ /** * Instance Methods */ export default QuestionComment
(function(module){ 'use strict'; var Pojo = require('../pojo'); function indicadoranaliticahl7(){ this.indicadoranaliticahl7id = ''; this.nombrehl7 = ''; this.nombre = ''; this.idindicador = ''; this.coste = ''; this.categoriahl7 = ''; this.orden = ''; this._metadata = { attrs: { 'indicadoranaliticahl7id' : {type: 'int', PK: 1}, 'nombrehl7' : {type: 'varchar'}, 'nombre' : {type: 'varchar'}, 'idindicador' : {type: 'varchar'}, 'coste' : {type: 'float'}, 'categoriahl7' : {type: 'varchar'}, 'orden' : {type: 'int', nullable: true} }, attrsid: [], sqls: { insert: '', select: '', delete: '', get: '' }, tablename: 'indicadoranaliticahl7' }; Pojo.call(this); } indicadoranaliticahl7.prototype = Object.create(Pojo.prototype); indicadoranaliticahl7.prototype.constructor = indicadoranaliticahl7; module.exports = indicadoranaliticahl7; })(module);
var fs = require('fs'); function Obtenerinfo() { var database = new DataBase(); var list = database.getTable("5000CasosPruebaCCVer7",'',0); console.log(list.length); console.log(list[0].length); }
(function () { 'use strict'; angular.module('ramlEditorApp') .service('newFileService', function newFolderService( ramlRepository, newNameModal, $rootScope, generateName) { var self = this; var specUrl = 'https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md#'; self.files = { '0.8': { '': { label: '', name: 'API Spec', description: 'RAML 0.8 API Spec.', spec: 'https://github.com/raml-org/raml-spec/blob/master/versions/raml-08/raml-08.md' } }, '1.0': { '': { label: '', name: 'API Spec', description: 'RAML 1.0 API Spec.', spec: specUrl + 'the-root-of-the-document' }, 'Trait': { label: 'Trait', name: 'Trait', description: 'Define a single trait with common characteristics for methods.', spec: specUrl + 'resource-types-and-traits' }, 'ResourceType': { label: 'ResourceType', name: 'Resource Type', description: 'Define a single resource type with common characteristics for resources.', spec: specUrl + 'resource-types-and-traits' }, 'Library': { label: 'Library', name: 'Library', description: 'Define a collection of data type declarations, resource type declarations, trait declarations, and security scheme declarations into modular, externalized, reusable groups.', spec: specUrl + 'libraries' }, 'Overlay': { label: 'Overlay', name: 'Overlay', description: 'Define an overlay that adds or overrides nodes of a RAML API definition while preserving its behavioral, functional aspects.', spec: specUrl + 'overlays' }, 'Extension': { label: 'Extension', name: 'Extension', description: 'Define an extension that adds or modifies nodes of a RAML API definition.', spec: specUrl + 'extensions' }, 'DataType': { label: 'DataType', name: 'Type', description: 'Define a single data type declaration.', spec: specUrl + '#raml-data-types' }, 'DocumentationItem': { label: 'DocumentationItem', name: 'User Documentation', description: 'Define a single page documentation item.', spec: specUrl + 'user-documentation' }, 'NamedExample': { label: 'NamedExample', name: 'Example', description: 'Define a single example for a given data type.', spec: specUrl + 'defining-examples-in-raml' }, 'AnnotationTypeDeclaration': { label: 'AnnotationTypeDeclaration', name: 'Annotation', description: 'Define a single annotation type declaration that describes additional metadata that can be applied to any RAML node.', spec: specUrl + 'annotations' }, 'SecurityScheme': { label: 'SecurityScheme', name: 'Security Scheme', description: 'Define a single security scheme that describes the mechanism to secure data access, identify requests, and determine access level and data visibility.', spec: specUrl + 'security-schemes' } } }; function nameSuggestion(target, fragment, fragmentLabel) { var names = target.children.map(function (file) { return file.name; }); var defaultName = (fragment.label !== '' ? fragmentLabel : 'api') + '-'; return generateName(names, defaultName, 'raml'); } self.prompt = function prompt(target, ramlVersion, fragmentLabel) { var parent = target.isDirectory ? target : ramlRepository.getParent(target); var validations = [ { message: 'That file name is already taken.', validate: function (input) { var path = ramlRepository.join(parent.path, input); return !ramlRepository.getByPath(path); } } ]; var label = fragmentLabel ? fragmentLabel : ''; var fragment = self.files[ramlVersion][label]; var suggestedName = nameSuggestion(target, fragment, fragmentLabel); var title = 'Add new ' + fragment.name + ' file'; return newNameModal.open(fragment.description, suggestedName, validations, title, fragment.spec) .then(function (name) { // Need to catch errors from `generateFile`, otherwise // `newNameModel.open` will error random modal close strings. return ramlRepository.generateFile(parent, name, ramlVersion, label) .catch(function (err) { return $rootScope.$broadcast('event:notification', { message: err.message, expires: true, level: 'error' }); }); }); }; self.newFragmentFile = function newFragmentFile(homeDirectory, fragmentType) { if (fragmentType === '') { return self.prompt(homeDirectory, '1.0'); } return self.prompt(homeDirectory, '1.0', fragmentType); }; self.newFile = function newFile(homeDirectory, version) { return self.prompt(homeDirectory, version); }; return self; }) ; })();
/** * @flow */ import ncp from 'ncp'; export function ncpAsync(source: string, dest: string, options: any = {}) { return new Promise((resolve, reject) => { ncp(source, dest, options, err => { if (err) { reject(err); } else { resolve(); } }); }); } export class Semaphore { queue: Array<(v: boolean) => void> = []; available = 1; async acquire(): Promise<boolean> { if (this.available > 0) { this.available -= 1; return Promise.resolve(true); } // If there is no permit available, we return a promise that resolves once the semaphore gets // signaled enough times that "available" is equal to one. return new Promise(resolver => this.queue.push(resolver)); } release() { this.available += 1; if (this.available > 1 && this.queue.length > 0) { throw new Error('this.available should never be > 0 when there is someone waiting.'); } else if (this.available === 1 && this.queue.length > 0) { // If there is someone else waiting, immediately consume the permit that was released // at the beginning of this function and let the waiting function resume. this.available -= 1; const nextResolver = this.queue.shift(); if (nextResolver) { nextResolver(true); } } } }
require('./tasks/babel'); require('./tasks/test'); require('./tasks/cover');
import React from 'react'; import PropTypes from 'prop-types'; import { withStyles } from 'material-ui/styles'; import { GridList, GridListTile, GridListTileBar } from 'material-ui/GridList'; import Subheader from 'material-ui/List/ListSubheader'; import IconButton from 'material-ui/IconButton'; import InfoIcon from 'material-ui-icons/Info'; import Typography from 'material-ui/Typography'; import User from '../User' const styles = theme => ({ container: { display: 'flex', flexWrap: 'wrap', justifyContent: 'center', alignItems: 'center', overflow: 'scroll' }, gridList: { width: '100%', height: 600 }, }); function Grid(props) { const { classes, users, city, onSelectCity } = props; const gridListStyle = { width: city ? '80%' : 0, maxWidth: 1450, height: city ? 750 : 0 } return ( <div className={`${classes.container} fade`}> <GridList cellHeight={180} style={gridListStyle}> <GridListTile key="Subheader" cols={2} style={{ height: 'auto' }}> {users && users.length ? <Typography type="title" className={classes.title} onClick={onSelectCity.bind(this, null)}> {city} </Typography> : null} </GridListTile> {users && users.map((user, i) => <User key={`User_${i}`} {...user} />)} </GridList> </div> ); } Grid.propTypes = { classes: PropTypes.object.isRequired, }; export default withStyles(styles)(Grid);
const passport = require('passport'); const JwtStrategy = require('passport-jwt').Strategy; const { ExtractJwt } = require('passport-jwt'); const LocalStrategy = require('passport-local'); const { JWT_SECRET } = require('./configuration'); const User = require('./models/user') //Se busca al usuraio que tenga el token que se ingresa. passport.use(new JwtStrategy({ jwtFromRequest: ExtractJwt.fromHeader('authorization'), secretOrKey: JWT_SECRET },async (payload, done)=>{ try{ //Se busca al usuario especifico del token. const user= await User.findById(payload.sub); console.log('jwtFromRequest:', payload ); console.log('Se muestra al usuario token :', user); //Si el usuario no existe, lo tomara. if(!user){ return done(null, false,{ "info": 'No tiene autorizacion de admin.' }); } // Retornar el usuario done(null, user); }catch(error){ done(error, false,{ "info": 'No se tiene autorizacion!!!!!' }); } })); // Verificacion de usuario por medio de email and password. //LOCAL STRATEGY passport.use(new LocalStrategy({ usernameField: 'email' }, async(email, password, done)=>{ try{ const user = await User.findOne({ email }); //if not, hndle it if(!user){ return done(null, false, { message: 'Incorrect username.' }); } //check if the password is correct. const isMatch = await user.isValidPassword(password); //if not, handle it if(!isMatch){ return done(null, false,{ message: 'Incorrecto Password.' }); } //otherwise, return the user. done(null, user); }catch(error){ done(error,false); } }));
/** * when steps */ var db = require("../../data/db"); module.exports = function () { this .when(/^I (click|doubleclick) on the (link|button|element) "$string"$/, require('../support/action/clickElement')) .when(/^I (add|set) "$string" to the inputfield "$string"$/, require('../support/action/setInputField')) .when(/^I clear the inputfield "$string"$/, require('../support/action/clearInputField')) .when(/^I drag element "$string" to element "$string"$/, require('../support/action/dragElement')) .when(/^I submit the form "$string"$/, require('../support/action/submitForm')) .when(/^I pause for (\d+)ms$/, require('../support/action/pause')) .when(/^I set a cookie "$string" with the content "$string"$/, require('../support/action/setCookie')) .when(/^I delete the cookie "$string"$/, require('../support/action/readCookie')) .when(/^I press "$string"$/, require('../support/action/pressButton')) .when(/^I (accept|dismiss) the (alertbox|confirmbox|prompt)$/, require('../support/action/handleModal')) .when(/^I enter "$string" into the prompt$/, require('../support/action/setPromptText')) .when(/^I scroll to element "$string"$/, require('../support/action/scroll')) .when(/^I close the last opened (window|tab)$/, require('../support/action/closeLastOpenedWindow')) .when(/^I focus the last opened (window|tab)$/, require('../support/action/focusLastOpenedWindow')) .when(/^I select the (\d+)(st|nd|rd|th) option for element "$string"$/, require('../support/action/selectOptionByIndex')) .when(/^I select the option with the (name|value|text) "$string" for element "$string"$/, require('../support/action/selectOption')) .when(/I open the (url|site) "$string"$/, require('../support/action/openWebsite')) /** * Custom */ .when(/^I upvote the question with ID "$string"$/, require('../support/custom/upvoteQuestion')) .when(/^I downvote the question with ID "$string"$/, require('../support/custom/downvoteQuestion')) .when(/^I upvote the argument with ID "$string"$/, require('../support/custom/upvoteArgument')) .when(/^I downvote the argument with ID "$string"$/, require('../support/custom/downvoteArgument')); };
var mongoose = require('mongoose'); var Schema = mongoose.Schema; var FestivalGoer = new Schema({ festivalGoerId: Number, personnalInformations : String }); module.exports = mongoose.model('FestivalGoer', FestivalGoer);
if (typeof(Class) === 'undefined') { /* Simple Inheritance http://ejohn.org/blog/simple-javascript-inheritance/ */ (function(){ var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/; // The base Class implementation (does nothing) this.Class = function(){}; // Create a new Class that inherits from this class Class.extend = function(prop) { var _super = this.prototype; // Instantiate a base class (but only create the instance, // don't run the init constructor) initializing = true; var prototype = new this(); initializing = false; // Copy the properties over onto the new prototype for (var name in prop) { // Check if we're overwriting an existing function prototype[name] = typeof prop[name] == "function" && typeof _super[name] == "function" && fnTest.test(prop[name]) ? (function(name, fn){ return function() { var tmp = this._super; // Add a new ._super() method that is the same method // but on the super-class this._super = _super[name]; // The method only need to be bound temporarily, so we // remove it when we're done executing var ret = fn.apply(this, arguments); this._super = tmp; return ret; }; })(name, prop[name]) : prop[name]; } // The dummy class constructor function Class() { // All construction is actually done in the init method if ( !initializing && this.init ) this.init.apply(this, arguments); } // Populate our constructed prototype object Class.prototype = prototype; // Enforce the constructor to be what we expect Class.constructor = Class; // And make this class extendable Class.extend = arguments.callee; return Class; }; })(); } /* jQuery delayed observer (c) 2007 - Maxime Haineault (max@centdessin.com) Special thanks to Stephen Goguen & Tane Piper. Slight modifications by Elliot Winkler */ if (typeof(jQuery.fn.delayedObserver) === 'undefined') { (function($){ $.extend($.fn, { delayedObserver: function(callback, delay, options){ return this.each(function(){ var el = $(this); var op = options || {}; el.data('oldval', el.val()) .data('delay', delay === 0 ? delay : (delay || 0.5)) .data('condition', op.condition || function() { return ($(this).data('oldval') == $(this).val()); }) .data('callback', callback) [(op.event||'keyup')](function(){ if (el.data('condition').apply(el)) { return; } else { if (el.data('timer')) { clearTimeout(el.data('timer')); } el.data('timer', setTimeout(function(){ var callback = el.data('callback'); if (callback) callback.apply(el); }, el.data('delay') * 1000)); el.data('oldval', el.val()); } }); }); } }); })(jQuery); } jQuery(document).ready(function() { RecordSelect.document_loaded = true; jQuery(document).on('click', 'div.record-select li.record', function(event) { var link = jQuery(this); if (link.length) { RecordSelect.select_item(link); return false; } return true; }); jQuery(document).on('click', '.record-select-option .remove', function(event) { var line = jQuery(this).parent(), value = line.find(':input:hidden').val(); line.parent().data('recordselect').obj.trigger('recordselect:remove', [value]); line.remove(); return false; }); jQuery(document).on('ajax:beforeSend', '.record-select-container', function(event, xhr) { var rs = jQuery(this).data('recordselect'), cur = rs.current_xhr, found = jQuery(this).find('.found'); jQuery(this).find('.record, .pagination').remove(); found.html(found.data('searching')); rs.current_xhr = xhr; console.log(rs.current_xhr); if (cur) cur.abort(); }); jQuery(document).on('ajax:complete', '.record-select-container', function(event, xhr, status) { var rs = jQuery(this).data('recordselect'); if (status != 'abort' || rs.current_xhr == xhr) { if (rs.is_open()) rs.show(); rs.current_xhr = null; } }); }); var RecordSelect = new Object(); RecordSelect.document_loaded = false; RecordSelect.select_item = function(item) { var rs = item.closest('.record-select-handler').data('recordselect'); if (rs) { try { var label = item.find('label').first().text().trim(), text = item.text().trim(); rs.obj.focus(); rs.onselect(item.attr('id').substr(2), label || text, text, item); } catch(e) { alert(e); } } } RecordSelect.observe = function(form) { if (typeof(form) == 'string') form = '#' + form; form = jQuery(form); var min_length = 0, rs = form.closest('.record-select-container').data('recordselect'); if (rs) min_length = rs.min_length; var callback = function() { if (form.closest('body').length) form.trigger("submit"); }; var delay = parseFloat(rs.obj.data('rsDelay')); if (isNaN(delay)) delay = 0.35; form.find('input.text-input').delayedObserver(callback, delay, { condition: function() { var item = jQuery(this); return item.data('oldval') == item.val() || item.val().length < min_length; } }).on('paste', function() { if (form.closest('body').length) form.trigger("submit"); }); } RecordSelect.render_page = function(record_select_id, page) { jQuery('#' + record_select_id + ' ol').first().replaceWith(page); }; RecordSelect.Abstract = Class.extend({ /** * obj - the id or element that will anchor the recordselect to the page * url - the url to run the recordselect * options - ??? (check concrete classes) */ init: function(obj, url, options) { if (typeof(obj) == 'string') obj = '#' + obj; this.obj = jQuery(obj); this.url = url; this.options = options; this.container; this.min_length = options.min_length || 0; if (this.options.onchange && typeof this.options.onchange != 'function') { this.options.onchange = eval(this.options.onchange); } if (this.options.onselect && typeof this.options.onselect != 'function') { this.options.onselect = eval(this.options.onselect); } if (RecordSelect.document_loaded) { this.onload(); } else { var _this = this; jQuery(document).ready(function() { _this.onload(); }) } }, /** * Finish the setup - IE doesn't like doing certain things before the page loads * --override-- */ onload: function() {}, /** * the onselect event handler - when someone clicks on a record * --override-- */ onselect: function(id, value, text, item) { alert(id + ': ' + value); }, /** * opens the recordselect */ open: function() { if (this.is_open()) return; var _this = this; jQuery.rails.fire(_this.obj, 'recordselect:before'); _this.create_form(); _this.container.show(); var params = _this.obj.data('params'), text = _this.obj.val(); var search_params = jQuery.param({search: text}); params = params ? [params, search_params].join("&") : search_params; this.current_xhr = jQuery.ajax({ url: this.url, data: params, success: function(data, status, xhr) { if (_this.current_xhr != xhr) return; if (status != 'abort') _this.current_xhr = null; _this.container.html(data); if (!_this.container.is(':visible')) _this.close(); else { _this.container.find('.text-input').val(_this.obj.val()); RecordSelect.observe(_this.container.find('form')); _this.container.hide(); // needed to get right document height to position first time if (text.length >= _this.min_length) _this.show(); } } }); }, /** * positions and reveals the recordselect */ show: function() { var offset = this.obj.offset(), scroll = jQuery(window).scrollTop(), window_height = jQuery(window).height(); if (this.fixed) offset.top -= scroll; // get fixed position var top = this.obj.outerHeight() + offset.top, document_height = jQuery(document).height(); this.container.show(); var height = this.container.outerHeight(); this.container.css('left', offset.left); this.container.css('top', ''); this.container.css('bottom', ''); if (this.above || (this.fixed || this.body_static) && top + height > window_height) { this.container.css('bottom', window_height - offset.top); } else { var below_space = window_height-(top-scroll), above_space = offset.top - scroll, position; if (below_space < height) { if (above_space >= height) position = 'bottom'; else position = above_space < below_space ? 'top' : 'bottom'; } else position = 'top'; if (position == 'top') this.container.css('top', top); else { var bottom = document_height - offset.top, body_height = $(document.body).height(); if (body_height < document_height) bottom -= document_height - body_height; this.container.css('bottom', bottom); } } if (this._use_iframe_mask()) { this.container.after('<iframe src="javascript:false;" class="record-select-mask" />'); var mask = this.container.next('iframe'); mask.css('left', this.container.css('left')) .css('top', this.container.css('top')); } if (this._use_iframe_mask()) { var dimensions = this.container.children().first(); mask.css('width', dimensions.css('width')) .css('height', dimensions.css('height')); } }, /** * closes the recordselect by emptying the container */ close: function() { if (this._use_iframe_mask()) { this.container.next('iframe').remove(); } this.container.hide(); // hopefully by using remove() instead of innerHTML we won't leak memory this.container.children().remove(); }, /** * returns true/false for whether the recordselect is open */ is_open: function() { return jQuery.trim(this.container.html()).length != 0; }, /** * when the user clicks outside the dropdown */ onbodyclick: function(event) { if (!this.is_open()) return; if (this.container.has(jQuery(event.target)).length > 0) { return; } else if (!this.obj.is(event.target)) { this.close(); } }, /** * creates and initializes (and returns) the recordselect container */ create_container: function() { var e = jQuery("<div />", {'class': "record-select-container record-select-handler"}), rs = this; e.css('display', 'none'); e.data('recordselect', rs); jQuery(this.obj).add(this.obj.parents()).each(function() { if (jQuery(this).css('position') == 'fixed') { rs.fixed = jQuery(this); e.css('position', 'fixed'); return false; } }); jQuery(this.obj).each(function() { if (jQuery(this).data('rs-above')) { rs.above = true; return false; } }); jQuery(document.body).append(e); jQuery(document.body).mousedown(jQuery.proxy(this, "onbodyclick")); if (!rs.fixed && e.offsetParent().css('position') == 'static') rs.body_static = true; e.get(0).onselect = jQuery.proxy(this, "onselect") return e; }, create_form: function() { var div = jQuery('<div>').addClass('record-select').attr('id', this.options.id); var form = jQuery('<form>').attr('action', this.url).attr('data-remote', true).attr('method', 'get'); form.append(jQuery('<input type="text" name="search" class="text-input">')); form.append(jQuery('<input type="hidden" name="page" value="1">')); form.append(jQuery('<input type="hidden" name="update" value="1">')); div.append(form).append(jQuery('<ol>')); this.container.html(div); RecordSelect.observe(form); }, onkeyup: function(event) { if (!this.is_open()) return; this.container.find('.text-input').val(this.obj.val()).trigger(event); }, onpaste: function(event) { if (!this.is_open()) return; setTimeout(function () { this.container.find('.text-input').val(this.obj.val()).trigger(event); }.bind(this), 0); }, /** * all the behavior to respond to a text field as a search box */ _respond_to_text_field: function(text_field) { // attach the events to start this party text_field.focus(jQuery.proxy(this, 'open')); // the autosearch event - needs to happen slightly late (keyup is later than keypress) text_field.keyup(jQuery.proxy(this, 'onkeyup')); // the autosearch event - needs to happen slightly late (keyup is later than keypress) text_field.on('paste', jQuery.proxy(this, 'onpaste')); // keyboard navigation, if available if (this.onkeydown) { text_field.keydown(jQuery.proxy(this, "onkeydown")); } }, _use_iframe_mask: function() { return this.container.insertAdjacentHTML ? true : false; } }); /** * Adds keyboard navigation to RecordSelect objects */ jQuery.extend(RecordSelect.Abstract.prototype, { current: null, /** * keyboard navigation - where to intercept the keys is up to the concrete class */ onkeydown: function(ev) { var elem; switch (ev.keyCode) { case 38: //Event.KEY_UP if (this.current && this.current.closest('html').length) elem = this.current.prev(); if (!elem) elem = this.container.find('ol li.record').last(); this.highlight(elem); break; case 40: //Event.KEY_DOWN if (this.current && this.current.closest('html').length) elem = this.current.next(); if (!elem) elem = this.container.find('ol li.record').first(); this.highlight(elem); break; case 13: // Event.KEY_RETURN if (this.current) this.current.click(); break; case 39: // Event.KEY_RIGHT elem = this.container.find('li.pagination.next'); if (elem) elem.find('a').click(); break; case 37: // Event.KEY_LEFT elem = this.container.find('li.pagination.previous'); if (elem) elem.find('a').click(); break; case 27: // Event.KEY_ESC case 9: // Event.KEY_TAB this.close(); break; default: return true; } if (ev.keyCode != 9) { // don't prevent tabbing ev.preventDefault(); // so "enter" doesn't submit the form, among other things(?) } }, /** * moves the highlight to a new object */ highlight: function(obj) { if (this.current) this.current.removeClass('current'); this.current = jQuery(obj); obj.addClass('current'); } }); /** * Used by link_to_record_select * The options hash should contain a onselect: key, with a javascript function as value */ RecordSelect.Dialog = RecordSelect.Abstract.extend({ onload: function() { this.container = this.create_container(); this.obj.click(jQuery.proxy(this, "toggle")); if (this.onkeypress) this.obj.keypress(jQuery.proxy(this, 'onkeypress')); }, onselect: function(id, value, text, item) { if (this.options.onselect(id, value, text, item) != false) this.close(); }, toggle: function(e) { e.preventDefault(); if (this.is_open()) this.close(); else this.open(); } }); /** * Used by record_select_field helper * The options hash may contain id: and label: keys, designating the current value * The options hash may also include an onchange: key, where the value is a javascript function (or eval-able string) for an callback routine * and field_name: key, where value will be set as name of the input field. */ RecordSelect.Single = RecordSelect.Abstract.extend({ onload: function() { var rs = this; // initialize the container this.container = this.create_container(); this.container.addClass('record-select-autocomplete'); this.container.submit(function() { rs.hidden_input.val(''); rs.obj.removeClass('selected'); rs.obj.trigger('recordselect:unset', [rs]); }); // create the hidden input this.obj.after('<input type="hidden" name="" value="" />'); this.hidden_input = this.obj.next(); // transfer the input name from the text input to the hidden input this.hidden_input.attr('name', this.obj.attr('name')); this.obj.attr('name', this.options.field_name || ''); // initialize the values if (this.options.label) this.set(this.options.id, this.options.label); this._respond_to_text_field(this.obj); if (this.obj.prop('focused')) this.open(); // if it was focused before we could attach observers }, onselect: function(id, value, text, item) { this.set(id, value); if (this.options.onchange) this.options.onchange.call(this, id, value, text, item); this.obj.trigger("recordselect:change", [id, value, text, item]); this.close(); }, /** * sets the id/label */ set: function(id, label) { // unescaped html missing for label this.obj.val(label); this.hidden_input.val(id); this.obj.addClass('selected'); } }); /** * Used by record_select_autocomplete helper * The options hash may contain label: key, designating the current value * The options hash may also include an onchange: key, where the value is a javascript function (or eval-able string) for an callback routine. */ RecordSelect.Autocomplete = RecordSelect.Abstract.extend({ onload: function() { // initialize the container this.container = this.create_container(); this.container.addClass('record-select-autocomplete'); // initialize the values if (this.options.label) this.set(this.options.label); this._respond_to_text_field(this.obj); if (this.obj.prop('focused')) this.open(); // if it was focused before we could attach observers }, close: function() { // if they close the dialog with the text field empty, then delete the id value if (this.obj.val() == '') this.set(''); RecordSelect.Abstract.prototype.close.call(this); }, onselect: function(id, value, text, item) { this.set(value); if (this.options.onchange) this.options.onchange.call(this, id, value, text, item); this.obj.trigger("recordselect:change", [id, value, text, item]); this.close(); }, /** * sets the id/label */ set: function(label) { // unescaped html missing for label this.obj.val(label); } }); /** * Used by record_multi_select_field helper. * Options: * list - the id (or object) of the <ul> to contain the <li>s of selected entries * current - an array of id:/label: keys designating the currently selected entries */ RecordSelect.Multiple = RecordSelect.Abstract.extend({ onload: function() { // initialize the container this.container = this.create_container(); this.container.addClass('record-select-autocomplete'); // decide where the <li> entries should be placed if (this.options.list) this.list_container = jQuery(this.options.list); else this.list_container = this.obj.siblings('ul'); this.list_container.data('recordselect', this); // take the input name from the text input, and store it for this.add() this.input_name = this.obj.attr('name'); this.obj.attr('name', ''); // initialize the list for(var i = 0, length = this.options.current.length; i < length; i++) { this.add(this.options.current[i].id, this.options.current[i].label); } this._respond_to_text_field(this.obj); if (this.obj.prop('focused')) this.open(); // if it was focused before we could attach observers }, onselect: function(id, value, text, item) { this.add(id, value); this.obj.trigger("recordselect:add", [id, value, text, item]); }, /** * Adds a record to the selected list */ add: function(id, label) { // return silently if this value has already been selected if (this.list_container.has('input[value=' + id + ']').length > 0) return; var entry = '<li class="record-select-option">' + '<a href="#" class="remove">remove</a>' + '<input type="hidden" name="' + this.input_name + '" value="' + id + '" />' + '<label>' + label + '</label>' + '</li>'; this.list_container.prepend(entry) } });
import db from "lib/db" const app1 = {id: "001", slug: "app-1"}, app2 = {id: "002", slug: "app-2"}, appServer1 = {id: "001", appId: "001", name : "server 1"}, appServer2 = {id: "002", appId: "002", name: "server 2"}, user1 = {id: "001", slug: "user-1"}, user2 = {id: "002", slug: "user-2", deleted: true}, appUser1 = {id: "001", appId: "001", userId: "001", role: "development"}, appUser2 = {id: "002", appId: "002", userId: "002", role: "admin"}, appTest1 = {id: "001", appId: "001", testId: "001", name : "test 1", other: "z"}, appTest2 = {id: "002", appId: "001", testId: "002", name : "test 2", other: "a"}, appTest3 = {id: "003", appId: "002", testId: "002", name : "test 3", other: "b"}, test1 = {id: "001", name: "z-test"}, test2 = {id: "002", name: "a-test"} const state = { apps: { "001": app1, "002": app2 }, appServers: { "001": appServer1, "002": appServer2 }, users: { "001": user1, "002": user2 }, appUsers: { "001": appUser1, "002": appUser2 }, emptyItems: {}, appTests: {"001": appTest1, "002": appTest2, "003": appTest3}, tests: {"001": test1, "002": test2} } describe("path", ()=>{ it("should get the element at the specified path", ()=>{ expect(db.path("apps")(state)).toEqual(state.apps) expect(db.path("users", "001", "slug")(state)).toEqual("user-1") expect(db("users").path("001", "slug")(state)).toEqual("user-1") }) }) describe("index", ()=>{ it("should get the element index", ()=>{ expect(db.index("apps")(state)).toEqual(state.apps) expect(db("apps").index()(state)).toEqual(state.apps) }) }) describe("find", ()=>{ it("should get the element", ()=>{ expect(db.find("apps")("001", state)).toEqual(app1) expect(db("apps").find()("001", state)).toEqual(app1) }) it("should work as a partial when only id argument supplied", ()=>{ expect(db("apps").find()("001")(state)).toEqual(app1) }) it("should return undefined when the object isn't found", ()=>{ expect(db("apps").find()("008")(state)).toBeUndefined() expect(db("emptyItems").find()("001")(state)).toBeUndefined() }) }) describe("ids", ()=>{ it("should get all the ids for a type", ()=>{ expect(db("apps").ids()(state)).toEqual([app1.id, app2.id]) }) }) describe("list", ()=>{ it("should get an array of elements", ()=>{ expect(db.list("apps")(state)).toEqual([app1,app2]) expect(db("apps").list()(state)).toEqual([app1,app2]) }) it("should order elements by a prop when specified", ()=>{ expect(db("appUsers").list({sortBy: "role"})(state)).toEqual([appUser2,appUser1]) }) it("should order elements by a function when specified", ()=>{ expect(db("appUsers").list({sortBy: appUser => appUser.role})(state)).toEqual([appUser2,appUser1]) }) it("should order elements in reverse when specified", ()=>{ expect(db("appUsers").list({sortBy: "role", reverse: true})(state)).toEqual([appUser1, appUser2]) }) it("should group elements when specified", ()=>{ expect(db("appUsers").list({groupBy: "role"})(state)).toEqual({ "admin": [appUser2], "development": [appUser1] }) }) it("should group and order elements when specified", ()=>{ expect(db("appTests").list({groupBy: "appId", sortBy: "other"})(state)).toEqual({ "001": [appTest2, appTest1], "002": [appTest3] }) }) it("should filter elements when specified", ()=>{ expect(db("apps").list({where: {slug: "app-1"}})(state)).toEqual([app1]) }) it("should filter, group, and order elements when specified", ()=>{ expect(db("appTests").list({groupBy: "appId", sortBy: "other", where: {other: val => val != "b"}})(state)).toEqual({ "001": [appTest2, appTest1] }) }) }) describe("indexBy", ()=>{ it("should index the element by a prop", ()=>{ expect(db.indexBy("apps", "slug")(state)).toEqual({ "app-1": app1, "app-2": app2}) expect(db("apps").indexBy("slug")(state)).toEqual({ "app-1": app1, "app-2": app2}) }) }) describe("group", ()=>{ it("should group the elements by a prop", ()=>{ expect(db.group("apps", "slug")(state)).toEqual({ "app-1": [app1], "app-2": [app2] }) expect(db("apps").group("slug")(state)).toEqual({ "app-1": [app1], "app-2": [app2] }) }) it("should group the elements by a function", ()=>{ expect(db.group("apps", ({id, slug})=> [id,slug].join("-"))(state)).toEqual({ "001-app-1": [app1], "002-app-2": [app2] }) expect(db("apps").group(({id, slug})=> [id,slug].join("-"))(state)).toEqual({ "001-app-1": [app1], "002-app-2": [app2] }) }) }) describe("where", ()=>{ it("should select by props", ()=>{ expect(db.where("apps", {slug: "app-1", id: "001"})(state)).toEqual([app1]) expect(db.where("apps", {slug: "app-1", id: "002"})(state)).toEqual([]) expect(db("apps").where({slug: "app-1", id: "001"})(state)).toEqual([app1]) }) it("should select by functions", ()=>{ expect(db.where("apps", {slug: slug => slug == "app-1", id: id => id == "001"})(state)).toEqual([app1]) }) it("should select by a mixture of props and functions", ()=>{ expect(db.where("apps", {slug: "app-1", id: id => id == "001"})(state)).toEqual([app1]) }) it("should accept sort options", ()=>{ expect(db("appTests").where({appId: "001"}, {sortBy: "other"})(state)).toEqual([appTest2, appTest1]) }) }) describe("whereIn", ()=>{ it("should select elements where prop is in a list", ()=>{ expect(db.whereIn("apps", "slug", ["app-1", "app-2"])(state)).toEqual([app1, app2]) expect(db.whereIn("apps", "slug", ["app-7", "app-2"])(state)).toEqual([app2]) expect(db.whereIn("apps", "slug", ["app-7", "app-9"])(state)).toEqual([]) expect(db("apps").whereIn("slug", ["app-1", "app-2"])(state)).toEqual([app1, app2]) }) it("should accept sort options", ()=>{ expect(db("apps").whereIn("slug", ["app-1", "app-2"], {sortBy: "name", reverse: true})(state)).toEqual([app2, app1]) }) }) describe("whereNotIn", ()=>{ it("should NOT elements where prop is in a list", ()=>{ expect(db.whereNotIn("apps", "slug", ["app-1", "app-2"])(state)).toEqual([]) expect(db.whereNotIn("apps", "slug", ["app-7", "app-2"])(state)).toEqual([app1]) expect(db.whereNotIn("apps", "slug", ["app-7", "app-9"])(state)).toEqual([app1, app2]) }) it("should accept sort options", ()=>{ expect(db("apps").whereNotIn("slug", ["app-9", "app-12"], {sortBy: "name", reverse: true})(state)).toEqual([app2, app1]) }) }) describe("findBy", ()=>{ it("should get a single element by a prop", ()=>{ expect(db.findBy("apps", "slug")("app-1", state)).toEqual(app1) expect(db("apps").findBy("slug")("app-1", state)).toEqual(app1) }) it("should work as a partial when only val argument supplied", ()=>{ expect(db.findBy("apps", "slug")("app-1")(state)).toEqual(app1) expect(db("apps").findBy("slug")("app-1")(state)).toEqual(app1) }) }) describe("hasMany", ()=>{ it("should list the app's associations", ()=>{ expect(db.hasMany("apps", "appServers")("001", state)).toEqual([appServer1]) expect(db("apps").hasMany("appServers")("001", state)).toEqual([appServer1]) }) it("should work as a partial when only id argument supplied", ()=>{ expect(db.hasMany("apps", "appServers")("001")(state)).toEqual([appServer1]) expect(db("apps").hasMany("appServers")("001")(state)).toEqual([appServer1]) }) it("should order elements by a prop when specified", ()=>{ expect(db("apps").hasMany("appTests", {sortBy: "other"})("001")(state)).toEqual([appTest2, appTest1]) }) it("should order elements by a function when specified", ()=>{ expect(db("apps").hasMany("appTests", {sortBy: o => o.other})("001")(state)).toEqual([appTest2, appTest1]) }) it("should order elements in reverse when specified", ()=>{ expect(db("apps").hasMany("appTests", {sortBy: "other", reverse: true})("001")(state)).toEqual([appTest1, appTest2]) }) }) describe("hasAndBelongsToMany", ()=>{ it("should list the association, and add the join table key", ()=>{ expect(db.hasAndBelongsToMany("apps", "users")("001", state)).toEqual([ {id: "001", slug: "user-1", relation: appUser1} ]) expect(db("apps").hasAndBelongsToMany("users")("001", state)).toEqual([ {id: "001", slug: "user-1", relation: appUser1} ]) }) it("should work as a partial when only id argument supplied", ()=>{ expect(db.hasAndBelongsToMany("apps", "users")("001")(state)).toEqual([ {id: "001", slug: "user-1", relation: appUser1} ]) expect(db("apps").hasAndBelongsToMany("users")("001")(state)).toEqual([ {id: "001", slug: "user-1", relation: appUser1} ]) }) it("should work when specifying the join table", ()=>{ expect(db.hasAndBelongsToMany("apps", "users", {through: "appUsers"})("001", state)).toEqual([ {id: "001", slug: "user-1", relation: appUser1} ]) }) it("should accept sort options", ()=>{ expect(db("apps").hasAndBelongsToMany("tests", {through: "appTests", sortBy: "name"})("001", state)).toEqual([ {id: "002", name: "a-test", relation: appTest2}, {id: "001", name: "z-test", relation: appTest1} ]) }) it("should accept filter and group options", ()=>{ expect(db("apps").hasAndBelongsToMany("tests", {through: "appTests", where: {name: "a-test"}, groupBy: "id"})("001", state)).toEqual({ "002": [{id: "002", name: "a-test", relation: appTest2}] }) }) it("should accept sort and group options", ()=>{ expect(db("apps").hasAndBelongsToMany("tests", {through: "appTests", sortBy: "name", groupBy: ({relation})=> relation.other })("001", state)).toEqual({ "a": [{id: "002", name: "a-test", relation: appTest2}], "z": [{id: "001", name: "z-test", relation: appTest1}] }) }) })
(function(App) { App.Models.SoundCloud.Track = App.Models.SoundCloud.Base.extend({ parse: function(data, options) { return _.pick(data, "id", "stream_url", "title", "permalink_url", "user", "user_favorite", "created_at", "duration" ); }, }); })(App);