text
stringlengths 2
1.05M
|
|---|
/*!
* UI development toolkit for HTML5 (OpenUI5)
* (c) Copyright 2009-2017 SAP SE or an SAP affiliate company.
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
*/
// Provides the Design Time Metadata for the sap.m.Toolbar control
sap.ui.define([],
function() {
"use strict";
return {
aggregations: {
content: {
domRef: ":sap-domref",
actions: {
move: "moveControls"
}
}
}
};
}, /* bExport= */ false);
|
//1. obter o numero de notas
var numNotas = prompt("De me o numero de notas");
//2. pedir a nota do teste
//o numero de vezes que o utilizador indicou em 1
var contador = 0;
var total = 0;
while ( contador < numNotas){
var nota = prompt("A nota do teste");
++contador;//contador = contador +1
//3.1 calcular a soma de todas as notas
total += Number(nota); // total = total + nota
}
//3. Fazer a Media
//3.2 Dividir po ro numero de notas
var media = total/numNotas;
//4. apresentar resultado
alert(media);
|
require('dotenv').config()
const axios = require('axios')
const puppeteer = require('puppeteer')
// Headers config
axios.defaults.headers.common['Authorization'] = `Bearer ${process.env.STRAPI_API_ADMIN_KEY}`
const toKebabCase = (str) =>
str &&
str
.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)
.map((x) => x.toLowerCase())
.join('-')
// Constants
const PLAYLIST_URL =
'https://www.youtube.com/watch?v=5VUIEryDwI0&list=PL2sQdFoGnLIhobWtEEvClQ5-peYO-RSZj'
const CHAPTER_ID = '3'
const createPosts = (videos, chapterId) => {
videos.reduce((acc, video) => {
const { url, title } = video
return acc.then(() => {
return axios
.post(`${process.env.STRAPI_URL}/api/posts`, {
data: {
title,
type: 'video',
videoUrl: url,
video: null,
resources: [],
slug: toKebabCase(title),
chapter: chapterId,
},
})
.then((resp) => {
console.log('post created, ', resp.data.data.attributes)
})
.catch((err) => {
console.log(JSON.stringify(err))
})
})
}, Promise.resolve())
}
const scrape = async (url) => {
const browser = await puppeteer.launch({
headless: false,
slowMo: 1000,
})
const page = await browser.newPage()
await page.goto(url)
page.on('console', (msg) => console.log('PAGE LOG:', msg.text()))
const videos = await page.evaluate(() => {
const playlistItems = document.querySelectorAll(
'ytd-playlist-panel-video-renderer #wc-endpoint'
)
const videos = Array.from(playlistItems).map((item) => {
return {
url: `https://youtube.com${item.getAttribute('href')}`,
title: item.querySelector('#video-title').innerText,
thumbnail: item.querySelector('ytd-thumbnail #img').getAttribute('src'),
}
})
return Promise.resolve(videos)
})
await browser.close()
console.log(JSON.stringify(videos))
return videos
}
;(async () => {
const videos = await scrape(PLAYLIST_URL)
createPosts(videos, CHAPTER_ID)
})()
|
//! moment.js locale configuration
//! locale : Arabic (Lybia) [ar-ly]
//! author : Ali Hmer: https://github.com/kikoanis
import moment from '../moment';
var symbolMap = {
'1': '1',
'2': '2',
'3': '3',
'4': '4',
'5': '5',
'6': '6',
'7': '7',
'8': '8',
'9': '9',
'0': '0'
}, pluralForm = function (n) {
return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5;
}, plurals = {
s : ['أقل من ثانية', 'ثانية واحدة', ['ثانيتان', 'ثانيتين'], '%d ثوان', '%d ثانية', '%d ثانية'],
m : ['أقل من دقيقة', 'دقيقة واحدة', ['دقيقتان', 'دقيقتين'], '%d دقائق', '%d دقيقة', '%d دقيقة'],
h : ['أقل من ساعة', 'ساعة واحدة', ['ساعتان', 'ساعتين'], '%d ساعات', '%d ساعة', '%d ساعة'],
d : ['أقل من يوم', 'يوم واحد', ['يومان', 'يومين'], '%d أيام', '%d يومًا', '%d يوم'],
M : ['أقل من شهر', 'شهر واحد', ['شهران', 'شهرين'], '%d أشهر', '%d شهرا', '%d شهر'],
y : ['أقل من عام', 'عام واحد', ['عامان', 'عامين'], '%d أعوام', '%d عامًا', '%d عام']
}, pluralize = function (u) {
return function (number, withoutSuffix, string, isFuture) {
var f = pluralForm(number),
str = plurals[u][pluralForm(number)];
if (f === 2) {
str = str[withoutSuffix ? 0 : 1];
}
return str.replace(/%d/i, number);
};
}, months = [
'يناير',
'فبراير',
'مارس',
'أبريل',
'مايو',
'يونيو',
'يوليو',
'أغسطس',
'سبتمبر',
'أكتوبر',
'نوفمبر',
'ديسمبر'
];
export default moment.defineLocale('ar-ly', {
months : months,
monthsShort : months,
weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'D/\u200FM/\u200FYYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd D MMMM YYYY HH:mm'
},
meridiemParse: /ص|م/,
isPM : function (input) {
return 'م' === input;
},
meridiem : function (hour, minute, isLower) {
if (hour < 12) {
return 'ص';
} else {
return 'م';
}
},
calendar : {
sameDay: '[اليوم عند الساعة] LT',
nextDay: '[غدًا عند الساعة] LT',
nextWeek: 'dddd [عند الساعة] LT',
lastDay: '[أمس عند الساعة] LT',
lastWeek: 'dddd [عند الساعة] LT',
sameElse: 'L'
},
relativeTime : {
future : 'بعد %s',
past : 'منذ %s',
s : pluralize('s'),
m : pluralize('m'),
mm : pluralize('m'),
h : pluralize('h'),
hh : pluralize('h'),
d : pluralize('d'),
dd : pluralize('d'),
M : pluralize('M'),
MM : pluralize('M'),
y : pluralize('y'),
yy : pluralize('y')
},
preparse: function (string) {
return string.replace(/\u200f/g, '').replace(/،/g, ',');
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
}).replace(/,/g, '،');
},
week : {
dow : 6, // Saturday is the first day of the week.
doy : 12 // The week that contains Jan 1st is the first week of the year.
}
});
|
SIM_STATUS_STOPPED = 1
SIM_STATUS_PLAYING = 2
SIM_STATUS_PAUSED = 3
SIM_STATUS_FINISHED = 4
pyodideCodeList = {}
function PyodideCode (opts) {
if (opts) {
this.init(opts);
}
}
PyodideCode.prototype.init = async function(opts){
this.opts = opts
this.id = opts.id
this.simStatus = SIM_STATUS_STOPPED
this.code = popAttribute(opts,'data-code',"")
this.originalCode = this.code
this.imgPath = popAttribute(opts,'data-img-path',"")
this.scale = parseFloat(popAttribute(opts,'data-scale',"1"))
this.originalScale = this.scale;
this.pythonError = false
this.pythonErrorMsg = ""
this.varsInputElementId = {}
this.eventQue = []
this.simImages = {}
this.drawFunctions = {'circle' : this.drawCircle,
'box' : this.drawBox,
'line' : this.drawLine,
'triangle' : this.drawTriangle,
'polyLine' : this.drawPolyLine,
'image' : this.drawImage,
'text' : this.drawText,
'rotate' : this.rotate,
'restore' : this.restore
}
this.generateEditorDiv()
}
PyodideCode.prototype.execDrawing = async function(){
for(var i =0; i < this.eventQue.length; i++){
await this.eventQue[i]()
}
this.eventQue = []
}
PyodideCode.prototype.setupCanvas = async function() {
//creating buffer canvas
this.bufferCanvs = document.createElement('canvas');
this.bufferCanvsContext = this.bufferCanvs.getContext('2d', { alpha: false });
//adjust scale based on current windows size
this.scale = this.originalScale;
var simWidth = this.animation_instance.anim_context.settings.window_with_px * this.scale;
var mainContentWidth = document.getElementById('main-content').getBoundingClientRect().width*0.8 - 50; // give modal 25px padding
if(simWidth > mainContentWidth){
this.scale = this.scale* parseFloat((mainContentWidth/simWidth).toFixed(2));
}
this.pixelPerUnit = this.animation_instance.anim_context.settings.px_per_unit * this.scale
this.canvas.width = this.animation_instance.anim_context.settings.window_with_px * this.scale;
this.canvas.height = this.animation_instance.anim_context.settings.window_height_px * this.scale;
this.bufferCanvs.width = this.canvas.width;
this.bufferCanvs.height = this.canvas.height;
// settings
this.animation_instance_x_min = this.animation_instance.anim_context.settings.view_box[0][0]
this.animation_instance_y_min = this.animation_instance.anim_context.settings.view_box[0][1]
this.animation_instance_height = this.animation_instance.anim_context.settings.view_box[2]
this.frame_period = parseFloat(this.animation_instance.anim_context.settings.frame_period.toFixed(5))
this.frameTime = this.frame_period * 1000;
this.background_color = this.animation_instance.anim_context.settings.background_color
//drawing
this.bufferCanvsContext.fillStyle = this.background_color
this.bufferCanvsContext.fillRect(0, 0, this.bufferCanvsContext.canvas.width, this.bufferCanvsContext.canvas.height);
this.animation_instance.queueFrame(); // setting up frist frame / thumbnail
await this.execDrawing()
//swaping buffer with main canvas
this.canvasContext.drawImage(this.bufferCanvs,0,0)
}
PyodideCode.prototype.setPythonErrorMsg = function(errMsg){
this.pythonError = true
this.pythonErrorMsg = errMsg
}
PyodideCode.prototype.execPython = function(){
pyodide.globals.the_script = this.code
return pyodide.runPythonAsync(`
try:
exception_happened = True
sys.stdout = io.StringIO()
exec(the_script,{'animation_instance_key' : '${this.id}'})
except Exception:
exc_type, exc_value, exc_tb = sys.exc_info()
error_msg = ''.join(traceback.format_exception(exc_type, exc_value, exc_tb.tb_next))
else:
import simanim.pyodide.gui
exception_happened = False
finally:
if exception_happened:
js.throwError(error_msg)
`)
.then(() => {
this.animation_instance = pyodide.globals.simanim.pyodide.gui.animation_instance && pyodide.globals.simanim.pyodide.gui.animation_instance[this.id] ? pyodide.globals.simanim.pyodide.gui.animation_instance[this.id] : null ;
this.stdout = pyodide.globals.sys.stdout.getvalue()
this.pythonError = false;
this.pythonErrorMsg = '';
})
.catch((msg) => {
this.setPythonErrorMsg(msg);
this.stdout = pyodide.globals.sys.stdout.getvalue()
})
}
PyodideCode.prototype.generateHTMLForSim = function() {
var simDiv = document.createElement('div');
simDiv.setAttribute('class', 'modal-sim');
var simDivContent = document.createElement('div');
simDivContent.setAttribute('class', 'modal-content-sim');
var simDivControls = document.createElement('div');
simDivControls.setAttribute('class', 'sim-controls');
var controlBtnDiv = document.createElement('div');
controlBtnDiv.setAttribute('class', 'control-button-div');
this.playBtn = document.createElement('button');
this.playBtn.setAttribute('class', 'control-btn');
this.playBtn.addEventListener('click', this.startSim.bind(this));
this.playBtn.innerHTML = '<i class="fas fa-play"></i> PLAY';
this.stopBtn = document.createElement('button');
this.stopBtn.setAttribute('class', 'control-btn');
this.stopBtn.setAttribute('disabled', 'disabled');
this.stopBtn.addEventListener('click', this.stopSim.bind(this));
this.stopBtn.innerHTML = '<i class="fas fa-stop"></i> STOP';
this.pauseBtn = document.createElement('button');
this.pauseBtn.setAttribute('class', 'control-btn d-none');
this.pauseBtn.addEventListener('click', this.pauseSim.bind(this));
this.pauseBtn.innerHTML = '<i class="fas fa-pause"></i> PAUSE';
controlBtnDiv.appendChild(this.playBtn);
controlBtnDiv.appendChild(this.pauseBtn);
controlBtnDiv.appendChild(this.stopBtn);
simDivControls.appendChild(controlBtnDiv);
var variablesDiv = document.createElement('div');
variablesDiv.setAttribute('class', 'sim-modal-variables');
variablesDiv.setAttribute('id', 'variablesDiv');
var variables = this.animation_instance.getVars();
for (var i = 0; i < variables.length; i++) {
if (variables[i].meta["type"] == 'InputFloat') {
var variableLabel = document.createElement('label');
variableLabel.setAttribute('class', 'variable-label');
variableLabel.innerHTML = `${variables[i].name} = `;
var max = variables[i]['meta']['limit_to']
var step = Math.pow(10,Math.floor(Math.log10(max)-1))
var variableInput = document.createElement('input');
variableInput.setAttribute('type', 'number');
variableInput.setAttribute('class', 'variable-input');
variableInput.setAttribute('id', this.id + '-' +i)
variableInput.setAttribute('value', '' + variables[i]['meta']['default']);
variableInput.setAttribute('min',variables[i]['meta']['limit_from'])
variableInput.setAttribute('max',variables[i]['meta']['limit_to'])
variableInput.setAttribute('step', step);
variableInput.addEventListener('input',this.setGetters.bind(this))
this.varsInputElementId[variables[i].name] = this.id + '-' +i
variablesDiv.appendChild(variableLabel);
variablesDiv.appendChild(variableInput);
}
else {
var variableLabel = document.createElement('label');
variableLabel.setAttribute('class', 'variable-label');
variableLabel.innerHTML = `${variables[i].name} = `;
var selectInput = document.createElement('select');
selectInput.setAttribute('class', 'variable-input')
selectInput.setAttribute('id', this.id + '-' +i)
selectInput.addEventListener('input',this.setGetters.bind(this))
for (var j = 0; j < variables[i].meta.lov.length; j++) {
var selectOption = document.createElement('option');
selectOption.innerHTML = variables[i].meta.lov[j];
if(variables[i].meta.lov[j] == variables[i].meta.default){
selectOption.setAttribute('selected','selected')
}
selectInput.appendChild(selectOption);
}
this.varsInputElementId[variables[i].name] = this.id + '-' +i
variablesDiv.appendChild(variableLabel);
variablesDiv.appendChild(selectInput);
}
}
if(variables.length > 0){
simDivControls.appendChild(variablesDiv);
}
var simBodyCanvasDiv = document.createElement('div');
simBodyCanvasDiv.setAttribute('class', 'sim-modal-canvas');
this.canvas = document.createElement('canvas');
this.canvas.setAttribute('id', 'simCanvas-' + this.id);
this.canvas.setAttribute('class', ' sim-canvas')
this.canvasContext = this.canvas.getContext('2d', { alpha: false });
simBodyCanvasDiv.appendChild(this.canvas);
simDivContent.appendChild(simDivControls);
simDivContent.appendChild(simBodyCanvasDiv);
simDiv.appendChild(simDivContent);
if(this.stdout.length>0){
var outDiv = createOutDiv(this.stdout)
simDiv.appendChild(outDiv)
}
this.mainConentDiv = simDiv
}
PyodideCode.prototype.startSim = function() {
this.playBtn.classList.add('d-none');
this.pauseBtn.classList.remove('d-none');
this.stopBtn.removeAttribute('disabled');
for (var varName in this.varsInputElementId) {
document.getElementById(this.varsInputElementId[varName]).setAttribute('disabled','true');
}
this.simStatus = SIM_STATUS_PLAYING;
this.animationStart = window.performance.now();
this.nextFrameTargetTime = window.performance.now();
this.drawAnimation.call(this);
}
PyodideCode.prototype.generateEditorDiv = function () {
var editorDiv = document.createElement('div')
editorDiv.setAttribute('class', 'editor col-md-12');
var controlDiv = document.createElement('div')
controlDiv.setAttribute('class','control-py')
this.startButton = document.createElement('div')
this.startButton.innerHTML = 'Покрени скрипту'
this.startButton.setAttribute('class','btn btn-success btn-py')
this.startButton.addEventListener('click', this.runPythonFromCode.bind(this))
controlDiv.appendChild(this.startButton)
this.restartButton = document.createElement('div')
this.restartButton.innerHTML = '<i class="fas fa-fast-backward"></i>'
this.restartButton.setAttribute('class','btn btn-success btn-reset')
this.restartButton.addEventListener('click', () => {this.editor.doc.setValue(this.originalCode);this.restartButton.classList.remove('show')})
controlDiv.appendChild(this.restartButton)
var codeDiv = document.createElement('textarea');
this.preprocessText();
codeDiv.innerHTML = this.code
editorDiv.appendChild(controlDiv)
editorDiv.appendChild(codeDiv)
this.opts.appendChild(editorDiv)
this.editor = CodeMirror.fromTextArea(codeDiv,{
autoRefresh: true,
lineNumbers: true,
mode: 'python',
indentUnit: 4,
matchBrackets: true,
autoMatchParens: true,
extraKeys: { "Tab": "indentMore", "Shift-Tab": "indentLess" }
})
if (this.markedText) {
this.lineHandles = [];
for (var i = this.generalInitSec; i < this.mainSec; i++) {
this.lineHandles.push(this.editor.addLineClass(i, "background", "shaded"));
}
this.editor.markText({ line: 0, ch: 0 }, { line: this.mainSec, ch: 0 }, {
readOnly: true,
inclusiveLeft: true,
atomic: true
});
for (var i = this.afterMainSec; i < this.editor.lineCount() + 1; i++) {
this.lineHandles.push(this.editor.addLineClass(i, "background", "shaded"));
}
this.editor.markText({ line: this.afterMainSec, ch: 0 }, { line: this.editor.lineCount(), ch: 0 }, {
readOnly: true,
inclusiveLeft: true,
inclusiveRight: true,
atomic: true
});
}
this.editor.on('change', () => {this.restartButton.classList.add('show')})
}
PyodideCode.prototype.runPythonFromCode = async function(){
this.code = this.editor.getValue()
if(this.code.indexOf('???') != -1){
if (!confirm('Treba da umesto ??? otkucаš svoj kod.\nSve naredbe koje sadrže ??? će biti preskočene prilikom izvršavanja programa.\nDa li želiš da izvršiš kod?')) {
return;
}
this.code = this.code.split('\n').filter(line => line.indexOf("???") == -1).join("\n");
}
if(pythonInitialized){
await this.execPython()
if(!this.pythonError && this.animation_instance){
this.generateHTMLForSim()
}
else{
this.generateHTMLErrorOutput()
}
this.createAnimationModal()
if(this.animation_instance)
this.setupCanvas()
document.getElementById('main-content').appendChild(this.modalDiv);
$("#simModal").on('hidden.bs.modal', function () {
pyodideCodeList[this.id].stopSim();
$("#simModal").remove();
pyodide.runPythonAsync(`del simanim.pyodide.gui.animation_instance['${this.id}']`).then();
}.bind(this));
$('#simModal').modal()
}
}
PyodideCode.prototype.preprocessText = function(){
var re = /#\s-\*-.+(acsection:).+-\*-/
this.markedText = false;
if (re.exec(this.code)) {
this.markedText = true;
var tmp = this.code.split('\n');
var c = 0;
var replacement = "";
this.generalInitContent = "";
this.generalInitSec = -1;
this.mainSec = -1;
this.afterMainSec = -1;
this.mainSecContent = "";
for (var i = 0; i < tmp.length; i++) {
if (tmp[i].indexOf('acsection: general-init') > -1) {
this.generalInitSec = c;
continue;
}
if (tmp[i].indexOf('acsection: main') > -1) {
this.mainSec = c;
continue;
}
if (tmp[i].indexOf('acsection: after-main') > -1) {
this.afterMainSec = c;
continue;
}
replacement += tmp[i] + "\n";
if (this.varInitSec == -1 && this.generalInitSec > -1) {
this.generalInitContent += tmp[i] + "\n";
}
if (this.mainSec != -1 && this.afterMainSec == -1) {
this.mainSecContent += tmp[i] + "\n";
}
c++;
}
this.code = replacement;
}
this.code = this.code.replace(/^\s+|\s+$/g, '') + "\n";
}
PyodideCode.prototype.generateHTMLErrorOutput = function(){
var errLabel = document.createElement('label')
errLabel.innerHTML = '<b>Error:</b>'
var errorMsgDiv = document.createElement('textarea')
errorMsgDiv.setAttribute('class', 'err')
errorMsgDiv.innerHTML = this.pythonErrorMsg
errorMsgDiv.disabled = true;
var errorDiv = document.createElement('div')
errorDiv.appendChild(errLabel)
errorDiv.appendChild(errorMsgDiv)
var parentDiv = document.createElement('div')
if(this.stdout.length>0){
var outDiv = createOutDiv(this.stdout)
parentDiv.appendChild(outDiv)
}
if(this.pythonErrorMsg.length>0)
parentDiv.appendChild(errorDiv)
this.mainConentDiv = parentDiv
}
PyodideCode.prototype.createAnimationModal = function (){
this.modalDiv = document.createElement('div');
this.modalDiv.setAttribute('id', 'simModal');
this.modalDiv.setAttribute('class', 'modal');
this.modalDiv.setAttribute('role', 'dialog');
this.modalDiv.setAttribute('aria-hidden', 'true');
var modalDivDialog = document.createElement('div');
modalDivDialog.setAttribute('class', 'modal-dialog modal-dialog-centered modal-lg');
modalDivDialog.setAttribute('role', 'document');
var modalDivContent = document.createElement('div');
modalDivContent.setAttribute('class', 'modal-content modal-content-py');
var modalDivBody = document.createElement('div');
modalDivBody.setAttribute('class', 'modal-body modal-body-py');
modalDivBody.setAttribute('id', 'simModalBody');
modalDivBody.appendChild(this.mainConentDiv)
var modalDivFooter = document.createElement('div')
modalDivFooter.setAttribute('class', 'modal-footer')
var closeButton = document.createElement('button')
closeButton.innerHTML = 'Затвори'
closeButton.setAttribute('class', 'btn btn-secondary')
closeButton.setAttribute('data-dismiss', 'modal')
closeButton.setAttribute('type', 'button')
modalDivFooter.appendChild(closeButton)
modalDivContent.appendChild(modalDivBody);
modalDivContent.appendChild(modalDivFooter)
modalDivDialog.appendChild(modalDivContent);
this.modalDiv.appendChild(modalDivDialog);
}
PyodideCode.prototype.flipFrame = async function(timestamp){
// waite for the next animationFrame, interpolate in the meantime if we are close enough
if(timestamp < this.nextFrameTargetTime + this.frameTime * 0.9){
if((timestamp > this.nextFrameTargetTime + this.frameTime * 0.6)){
if(this.canvasContext.globalAlpha !== 0.5){
this.canvasContext.globalAlpha = 0.5;
this.canvasContext.drawImage(this.bufferCanvs,0,0);
}
window.requestAnimationFrame((timestemp) => {this.flipFrame.call(this,timestemp);});
}
else{
window.requestAnimationFrame((timestemp) => {this.flipFrame.call(this,timestemp);});
}
}
else{
this.canvasContext.globalAlpha = 1;
this.canvasContext.drawImage(this.bufferCanvs,0,0);
this.nextFrameTargetTime = timestamp;
setTimeout(()=>{this.drawAnimation();},0);
}
}
PyodideCode.prototype.drawAnimation = function(){
this.clearBufferCanvas();
this.animation_instance.updateBetweenFrames();
this.animation_instance.queueFrame();
this.execDrawing();
if (!this.animation_instance.getEndAnimation() && this.simStatus == SIM_STATUS_PLAYING) {
window.requestAnimationFrame((timestemp) => {this.flipFrame.call(this,timestemp);});
}
else if (this.animation_instance.getEndAnimation()){
//last buffered frame drawn
setTimeout(()=>{this.canvasContext.drawImage(this.bufferCanvs,0,0);},this.frameTime);
this.simStatus = SIM_STATUS_FINISHED;
this.playBtn.classList.remove('d-none');
this.playBtn.setAttribute('disabled', 'disabled');
this.pauseBtn.classList.add('d-none');
//console.log((window.performance.now() - this.animationStart)/1000);
}
}
PyodideCode.prototype.setGetters = async function(){
variableValues = {}
for (var varName in this.varsInputElementId) {
variableValues[varName] = this.varsInputElementId[varName]
}
// resets the animation to the begining
this.animation_instance.setVarGetters(variableValues)
this.clearBufferCanvas();
this.animation_instance.queueFrame()
await this.execDrawing()
this.canvasContext.clearRect(0, 0, this.canvas.width, this.canvas.height);
this.canvasContext.drawImage(this.bufferCanvs,0,0)
// populate buffer
this.animation_instance.updateBetweenFrames();
this.animation_instance.queueFrame();
this.execDrawing();
}
PyodideCode.prototype.cleanUp = async function(){
this.canvasContext.globalAlpha = 1;
this.simStatus = SIM_STATUS_STOPPED
this.eventQue = []
this.animation_instance.resetAnimation();
this.clearBufferCanvas();
this.animation_instance.queueFrame();
await this.execDrawing()
//swap first frame to main canvas
this.canvasContext.clearRect(0, 0, this.canvas.width, this.canvas.height);
this.canvasContext.drawImage(this.bufferCanvs,0,0)
this.playBtn.classList.remove('d-none');
this.playBtn.removeAttribute('disabled');
this.pauseBtn.classList.add('d-none');
this.stopBtn.setAttribute('disabled', 'disabled');
for (var varName in this.varsInputElementId) {
if(document.getElementById(this.varsInputElementId[varName])){
document.getElementById(this.varsInputElementId[varName]).removeAttribute('disabled');
}
}
}
PyodideCode.prototype.stopSim = function() {
this.cleanUp()
}
PyodideCode.prototype.pauseSim = function() {
this.playBtn.classList.remove('d-none');
this.pauseBtn.classList.add('d-none');
this.simStatus = SIM_STATUS_PAUSED
}
PyodideCode.prototype.queueDrawEvent = function(type, obj){
this.eventQue.push(this.drawFunctions[type].bind(this, obj))
}
PyodideCode.prototype.clearBufferCanvas = function() {
this.bufferCanvsContext.clearRect(0, 0, this.bufferCanvs.width, this.bufferCanvs.height);
this.bufferCanvsContext.fillStyle = this.background_color
this.bufferCanvsContext.fillRect(0, 0, this.bufferCanvs.width, this.bufferCanvs.height);
}
PyodideCode.prototype.scalarToPixel = function(scalar){
return scalar * this.pixelPerUnit
}
PyodideCode.prototype.pointToPixel = function(point){
var scalarPointX = this.scalarToPixel(point[0] - this.animation_instance_x_min)
var scalarPointY = this.scalarToPixel(this.animation_instance_y_min + this.animation_instance_height - point[1])
return [scalarPointX, scalarPointY]
}
PyodideCode.prototype.rectToPixel = function(rect){
var xy_min = this.pointToPixel([rect.xy_min[0],rect.xy_min[1] + rect.height])
var width = this.scalarToPixel(rect.width)
var height = this.scalarToPixel(rect.height)
return [xy_min, width, height]
}
PyodideCode.prototype.drawCircle = function(circle){
this.bufferCanvsContext.save()
this.bufferCanvsContext.strokeStyle = (circle.pen_color && circle.line_width) ? circle.pen_color : circle.fill_color
this.bufferCanvsContext.lineWidth = circle.line_width ? this.scalarToPixel(circle.line_width) : 1
this.bufferCanvsContext.fillStyle = circle.fill_color;
if (this.bufferCanvsContext.line_dashed) {
this.bufferCanvsContext.setLineDash([5, 5])
}
var center = this.pointToPixel(circle.center)
var radius = this.scalarToPixel(circle.radius)
this.bufferCanvsContext.beginPath();
this.bufferCanvsContext.arc(center[0], center[1], radius, 0, 2 * Math.PI, false);
this.bufferCanvsContext.closePath();
this.bufferCanvsContext.fill();
this.bufferCanvsContext.stroke();
this.bufferCanvsContext.restore();
}
PyodideCode.prototype.drawBox = function(rect) {
this.bufferCanvsContext.save()
this.bufferCanvsContext.lineWidth = rect.line_width ? this.scalarToPixel(rect.line_width) : 1;
this.bufferCanvsContext.strokeStyle = (rect.pen_color && rect.line_width) ? rect.pen_color : rect.fill_color;
this.bufferCanvsContext.fillStyle = rect.fill_color;
if (rect.line_dashed) {
this.bufferCanvsContext.setLineDash([5, 5])
}
var scaledRect = this.rectToPixel(rect)
this.bufferCanvsContext.beginPath();
this.bufferCanvsContext.rect(scaledRect[0][0], scaledRect[0][1], scaledRect[1], scaledRect[2]);
this.bufferCanvsContext.closePath();
this.bufferCanvsContext.fill();
this.bufferCanvsContext.stroke();
this.bufferCanvsContext.restore()
}
PyodideCode.prototype.drawLine = function(line) {
this.bufferCanvsContext.save()
this.bufferCanvsContext.strokeStyle = line.pen_color
this.bufferCanvsContext.lineWidth = this.scalarToPixel(line.line_width);
if (line.line_dashed) {
this.bufferCanvsContext.setLineDash([5, 5])
}
this.bufferCanvsContext.beginPath();
var point1 = this.pointToPixel(line.point1)
var point2 = this.pointToPixel(line.point2)
this.bufferCanvsContext.moveTo(point1[0], point1[1]);
this.bufferCanvsContext.lineTo(point2[0], point2[1]);
this.bufferCanvsContext.stroke();
this.bufferCanvsContext.restore()
}
PyodideCode.prototype.drawPolyLine = function(polyLine) {
this.bufferCanvsContext.save()
var numberOfPoints = polyLine.points.length
if (numberOfPoints < 1) {
return;
}
let points = polyLine.points
this.bufferCanvsContext.strokeStyle = (polyLine.pen_color && polyLine.line_width) ? polyLine.pen_color : polyLine.fill_color;
this.bufferCanvsContext.lineWidth = polyLine.line_width ? this.scalarToPixel(polyLine.line_width) : 1;
this.bufferCanvsContext.fillStyle = polyLine.fill_color;
if (polyLine.line_dashed) {
this.bufferCanvsContext.setLineDash([5, 5])
}
this.bufferCanvsContext.beginPath();
var scalarPointX
var scalarPointY
[scalarPointX, scalarPointY] = this.pointToPixel(points[0])
this.bufferCanvsContext.moveTo(scalarPointX,scalarPointY)
for (i = 1; i < numberOfPoints; i++) {
[scalarPointX, scalarPointY] = this.pointToPixel(points[i])
this.bufferCanvsContext.lineTo(scalarPointX,scalarPointY)
};
this.bufferCanvsContext.stroke();
this.bufferCanvsContext.restore()
}
//triangle[6] canvas settings
//trinagle[0] point 1 X
//trinagle[1] point 1 Y
//trinagle[2] point 2 X
//trinagle[3] point 2 Y
//trinagle[4] point 3 X
//trinagle[5] point 3 Y
PyodideCode.prototype.drawTriangle = function(triangle) {
this.bufferCanvsContext.save()
this.bufferCanvsContext.strokeStyle = triangle[6].pen_color;
this.bufferCanvsContext.lineWidth = this.scalarToPixel(triangle[6].line_width);
this.bufferCanvsContext.fillStyle = triangle[6].pen_color;
if (triangle[6].line_dashed) {
this.bufferCanvsContext.setLineDash([5, 5])
}
var point1 = this.pointToPixel([triangle[0],triangle[1]])
var point2 = this.pointToPixel([triangle[2],triangle[3]])
var point3 = this.pointToPixel([triangle[4],triangle[5]])
this.bufferCanvsContext.beginPath();
var path=new Path2D()
path.moveTo(point1[0], point1[1]);
path.lineTo(point2[0], point2[1]);
path.lineTo(point3[0], point3[1]);
this.bufferCanvsContext.fill(path);
this.bufferCanvsContext.stroke();
this.bufferCanvsContext.restore()
}
PyodideCode.prototype.drawImage = function(image) {
this.bufferCanvsContext.save()
return new Promise(function (resolve){
if (image.file in this.simImages)
resolve(image)
else {
this.simImages[image.file] = new Image();
this.simImages[image.file].onload = () => {
resolve(image)
}
this.simImages[image.file].src = pathJoin([this.imgPath, image.file]) + '?' + new Date().getTime();
}
}.bind(this)).then((image) => {
var xy_min = this.pointToPixel([image.xy_min[0],image.xy_min[1] + image.height])
var width = this.scalarToPixel(image.width)
var height = this.scalarToPixel(image.height)
this.bufferCanvsContext.drawImage(this.simImages[image.file], xy_min[0], xy_min[1], width, height);
this.bufferCanvsContext.restore()
});
}
//text.position [X,Y]
PyodideCode.prototype.drawText = function(text) {
this.bufferCanvsContext.save()
this.bufferCanvsContext.fillStyle = text.pen_color;
var font_size = this.scalarToPixel(text.font_size)
this.bufferCanvsContext.font = `bold ${font_size}px Courier New`;
var position = this.pointToPixel(text.position)
this.bufferCanvsContext.fillText(text.content, position[0], position[1]);
this.bufferCanvsContext.restore()
}
PyodideCode.prototype.restore = function() {
this.bufferCanvsContext.setTransform(1, 0, 0, 1, 0, 0);
}
//point[0] point around which we rotate
//point[1] angle
PyodideCode.prototype.rotate = function(point) {
var scaledPoint = this.pointToPixel(point[0])
this.bufferCanvsContext.translate( scaledPoint[0], scaledPoint[1]);
this.bufferCanvsContext.rotate(point[1]);
this.bufferCanvsContext.translate(- scaledPoint[0], - scaledPoint[1]);
}
window.addEventListener('load',function() {
animations = document.getElementsByClassName('pycode')
for (var i = 0; i < animations.length; i++) {
pyodideCodeList[animations[i].id] = new PyodideCode(animations[i])
}
});
function createOutDiv(stdout){
var outDiv = document.createElement('div')
outDiv.setAttribute('class','mt-3')
var label = document.createElement('label')
label.innerHTML = '<b>Stdout:</b>'
var output = document.createElement('textarea')
output.innerHTML = stdout
output.setAttribute('class', 'out')
output.disabled = true
outDiv.appendChild(label)
outDiv.appendChild(output)
return outDiv
}
|
QUnit.module("File Creation");
QUnit.test("addSample and segmentation", function( assert ) {
var timeout = window.setTimeout(function() { assert.ok(false, "Timeout"); QUnit.start(); }, TIMEOUT_MS);
var f = MP4Box.createFile();
f.onSegment = function(id, user, buffer, sampleNum) {
window.clearTimeout(timeout);
console.log("Received segment for track "+id);
assert.ok(true, "Segment received");
}
var track_id = f.addTrack();
f.setSegmentOptions(track_id, null, { nbSamples: 2 } );
f.initializeSegmentation();
f.start();
f.addSample(track_id, new Uint8Array(100));
f.addSample(track_id, new Uint8Array(100));
});
QUnit.test("addSample and file save", function( assert ) {
var f = MP4Box.createFile();
var track_id = f.addTrack();
f.addSample(track_id, new Uint8Array(100));
f.addSample(track_id, new Uint8Array(100));
f.save("test.mp4");
assert.ok(true, "File created");
});
QUnit.test("Create simple stpp track and save file", function( assert ) {
Log.setLogLevel(Log.debug);
var f = MP4Box.createFile();
var track_id = f.addTrack({ type: "stpp", hdlr: "subt", namespace: "mynamespace"});
f.addSample(track_id, (new TextEncoder("utf8").encode("<xml></xml>")));
f.addSample(track_id, (new TextEncoder("utf8").encode("<xml></xml>")));
f.save("stpp-track.mp4");
assert.ok(true, "File created");
});
|
import { basename, dirname, extname, join, relative, resolve } from 'path'
import { log, logError, panic } from './logger'
import compile from './compile'
import compose from 'cumpa'
import glob from 'glob'
import help from './help'
import optionatorFactory from 'optionator'
import options from './options'
import pkg from '../package.json'
import { statSync } from 'fs'
import watch from './watch'
const optionator = optionatorFactory(options)
const isJsFilePath = path => path.slice(-3) === '.js'
/**
* Map the user options to valid rollup options
* @param {string} input - source file path
* @param {string} userInputPath - path provided by the user
* @param {Object} options - user options
* @returns {Object} RollupOptions object
*/
export function mapOptions(input, userInputPath, options) {
const componentName = basename(input, extname(input))
return {
input,
sourcemap: options.sourcemap,
watch: options.watch,
output: {
format: options.format,
sourcemap: options.sourcemap,
name: componentName,
file: join(generateOutputPath(options, input, userInputPath, componentName))
},
riot: { ...options.riot, ext: options.extension }
}
}
/**
* Generate the output where the javascript files will be created
* @param {Object} options - user options
* @param {string} input - current source path
* @param {string} userInputPath - path provided by the user
* @param {string} componentName - component name inferred from the file name
* @returns {string} path where the js file will be generated
*/
export function generateOutputPath(options, input, userInputPath, componentName) {
const fileOutput = options['output'] || process.cwd()
const generatedOutputFileName = `${componentName}.js`
const root = userInputPath !== input ? relative(userInputPath, dirname(input)) : dirname(input)
return isJsFilePath(fileOutput) ?
fileOutput :
join(fileOutput, root, generatedOutputFileName)
}
/**
* Load the riot.config.js file
* @param {Object} options - user options
* @returns {Object} user options merged with the riot.config.js export
*/
export function loadConfig(options) {
if (!options.config) return options
const src = options.config
/* istanbul ignore next */
const file = resolve(typeof src === 'string' ? src : 'riot.config')
try {
return {
...options,
...require(isJsFilePath(file) ? file : `${file}.js`).default
}
} catch (error) {
logError('It was not possible to load your config file, are you sure the path is correct?')
panic(error)
}
}
/**
* Generate the output javascript files
* @param {Object} options - user options
* @param {string} input - input path
* @returns {Array<RollytOutput>} generated files
*/
export async function generateOutput(options, input) {
const stat = statSync(input)
const compileFile = filePath => {
const opts = mapOptions(filePath, input, options)
if (options.watch) return watch(opts)
return compile(opts)
}
if (stat.isDirectory()) {
return await Promise.all(
glob.sync(join(input, '**', `*.${options.extension}`),{}).map(compileFile)
)
}
return await compileFile(input)
}
/**
* Parse the user options and dispatch the cli tasks
* @param {Object} options user options
* @returns {*} task output
*/
export async function main(options) {
switch (true) {
case options.version:
log(pkg.version)
return pkg.version
case options._.length > 0:
return await Promise.all(options._.map(input => generateOutput(options, input)))
default:
return help(optionator)
}
}
// export compiler extension functions
export {registerPreprocessor, registerPostprocessor} from '@riotjs/compiler'
export default async function run(args) {
return compose(
main,
loadConfig,
optionator.parseArgv
)(args).catch(panic)
}
|
require('../lib/node_loader');
var AWS = require('../lib/core');
var Service = AWS.Service;
var apiLoader = AWS.apiLoader;
apiLoader.services['ebs'] = {};
AWS.EBS = Service.defineService('ebs', ['2019-11-02']);
Object.defineProperty(apiLoader.services['ebs'], '2019-11-02', {
get: function get() {
var model = require('../apis/ebs-2019-11-02.min.json');
model.paginators = require('../apis/ebs-2019-11-02.paginators.json').pagination;
return model;
},
enumerable: true,
configurable: true
});
module.exports = AWS.EBS;
|
import React, { Component } from "react";
import { StyleSheet, Text, TouchableHighlight } from "react-native";
import { dynamicFontSize } from "../utils/helpers";
export class CalculatorKey extends Component {
render() {
const {
color,
isDirty,
text,
textDirty,
type,
style,
handlePress,
orientation
} = this.props;
return (
<TouchableHighlight
style={[styles.container, style, { backgroundColor: color }]}
onPress={() => handlePress(text, type)}
>
<Text style={[styles.key, dynamicFontSize(orientation, 35)]}>
{isDirty ? textDirty : text}
</Text>
</TouchableHighlight>
);
}
}
const styles = StyleSheet.create({
container: {
alignItems: "center",
justifyContent: "center",
flexShrink: 1,
borderRadius: 50,
margin: 5
},
key: {
fontSize: 40,
color: "#fff"
}
});
|
var data = [{
"trainNo": "42701",
"train": "MSBPONLOCALDaily",
"fulltrainname": "Chennai Beach LOCAL",
"stations": [
"MSB",
"RPM",
"WST",
"KOK",
"TNP",
"VOC",
"TVT",
"WCN",
"KAVM",
"ENR",
"AIPP",
"AIP",
"NPKM",
"MJR",
"APB",
"PON"
],
"timeDifferenceFromSource": [
0,
4,
9,
15,
17,
19,
23,
28,
31,
35,
41,
43,
45,
48,
52,
75
],
"actualtimeDifferenceFromSource": [
0,
4,
5,
6,
2,
2,
4,
5,
3,
4,
6,
2,
2,
3,
4,
23
],
"startingTime": [
[
"05",
"35"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"1",
"3",
"4",
"6",
"7",
"9",
"12",
"15",
"16",
"20",
"22",
"24",
"26",
"30",
"35"
]
},
{
"trainNo": "43703",
"train": "MSBTRLLOCALDaily",
"fulltrainname": "Chennai Beach LOCAL",
"stations": [
"MSB",
"RPM",
"WST",
"VJM",
"PER",
"PCW",
"PEW",
"VLK",
"KOTR",
"PVM",
"ABU",
"TMVL",
"ANNR",
"AVD",
"HC",
"PAB",
"NEC",
"TI",
"VEU",
"SVR",
"PTLR",
"TRL"
],
"timeDifferenceFromSource": [
0,
4,
9,
15,
17,
19,
21,
24,
28,
31,
34,
37,
40,
47,
51,
53,
57,
60,
64,
68,
71,
80
],
"actualtimeDifferenceFromSource": [
0,
4,
5,
6,
2,
2,
2,
3,
4,
3,
3,
3,
3,
7,
4,
2,
4,
3,
4,
4,
3,
9
],
"startingTime": [
[
"05",
"30"
],
[
"06",
"20"
],
[
"09",
"45"
],
[
"13",
"05"
],
[
"15",
"30"
],
[
"17",
"40"
],
[
"19",
"50"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"1",
"3",
"6",
"7",
"8",
"9",
"11",
"14",
"16",
"17",
"19",
"20",
"23",
"26",
"27",
"29",
"31",
"34",
"37",
"40",
"43"
]
},
{
"trainNo": "43803",
"train": "MSBAJJLOCALDaily",
"fulltrainname": "Chennai Beach LOCAL",
"stations": [
"MSB",
"RPM",
"WST",
"VJM",
"PER",
"PCW",
"PEW",
"VLK",
"KOTR",
"PVM",
"ABU",
"TMVL",
"ANNR",
"AVD",
"HC",
"PAB",
"NEC",
"TI",
"VEU",
"SVR",
"PTLR",
"TRL",
"EGT",
"KBT",
"SPAM",
"MAF",
"TO",
"MSU",
"PLMG",
"AJJ"
],
"timeDifferenceFromSource": [
0,
4,
9,
15,
17,
19,
21,
24,
28,
31,
34,
37,
40,
45,
49,
51,
55,
58,
62,
66,
69,
75,
79,
83,
87,
91,
96,
102,
106,
120
],
"actualtimeDifferenceFromSource": [
0,
4,
5,
6,
2,
2,
2,
3,
4,
3,
3,
3,
3,
5,
4,
2,
4,
3,
4,
4,
3,
6,
4,
4,
4,
4,
5,
6,
4,
14
],
"startingTime": [
[
"01",
"20"
],
[
"04",
"30"
],
[
"14",
"25"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"1",
"3",
"6",
"7",
"8",
"9",
"11",
"14",
"16",
"17",
"19",
"20",
"23",
"26",
"27",
"29",
"31",
"34",
"37",
"40",
"43",
"47",
"49",
"52",
"56",
"60",
"65",
"68",
"70"
]
},
{
"trainNo": "43601",
"train": "MSBAVDLOCALDaily",
"fulltrainname": "Chennai Beach LOCAL",
"stations": [
"MSB",
"RPM",
"WST",
"VJM",
"PER",
"PCW",
"PEW",
"VLK",
"KOTR",
"PVM",
"ABU",
"TMVL",
"ANNR",
"AVD"
],
"timeDifferenceFromSource": [
0,
4,
9,
15,
17,
19,
21,
24,
28,
31,
34,
37,
40,
50
],
"actualtimeDifferenceFromSource": [
0,
4,
5,
6,
2,
2,
2,
3,
4,
3,
3,
3,
3,
10
],
"startingTime": [
[
"07",
"10"
],
[
"08",
"10"
],
[
"11",
"05"
],
[
"19",
"10"
],
[
"19",
"35"
],
[
"20",
"20"
],
[
"21",
"45"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"1",
"3",
"6",
"7",
"8",
"9",
"11",
"14",
"16",
"17",
"19",
"20",
"23"
]
},
{
"trainNo": "43751",
"train": "MSBPRESLOCALDaily",
"fulltrainname": "Chennai Beach LOCAL",
"stations": [
"MSB",
"RPM",
"WST",
"VJM",
"PER",
"PCW",
"PEW",
"VLK",
"KOTR",
"PVM",
"ABU",
"TMVL",
"ANNR",
"AVD",
"HC",
"PAB",
"PRES"
],
"timeDifferenceFromSource": [
0,
4,
9,
15,
17,
19,
21,
24,
28,
31,
34,
37,
40,
45,
49,
52,
70
],
"actualtimeDifferenceFromSource": [
0,
4,
5,
6,
2,
2,
2,
3,
4,
3,
3,
3,
3,
5,
4,
3,
18
],
"startingTime": [
[
"09",
"05"
],
[
"10",
"05"
],
[
"13",
"50"
],
[
"17",
"22"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"1",
"3",
"6",
"7",
"8",
"9",
"11",
"14",
"16",
"17",
"19",
"20",
"23",
"26",
"27",
"33"
]
},
{
"trainNo": "42601",
"train": "MSBGPDLOCALDaily",
"fulltrainname": "Chennai Beach LOCAL",
"stations": [
"MSB",
"RPM",
"WST",
"KOK",
"TNP",
"VOC",
"TVT",
"WCN",
"KAVM",
"ENR",
"AIPP",
"AIP",
"NPKM",
"MJR",
"APB",
"PON",
"KVP",
"GPD"
],
"timeDifferenceFromSource": [
0,
4,
9,
15,
17,
19,
23,
28,
31,
35,
41,
43,
45,
48,
52,
57,
63,
100
],
"actualtimeDifferenceFromSource": [
0,
4,
5,
6,
2,
2,
4,
5,
3,
4,
6,
2,
2,
3,
4,
5,
6,
37
],
"startingTime": [
[
"09",
"35"
],
[
"15",
"45"
],
[
"18",
"35"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"1",
"3",
"4",
"6",
"7",
"9",
"12",
"15",
"16",
"20",
"22",
"24",
"26",
"30",
"35",
"42",
"48"
]
},
{
"trainNo": "43821",
"train": "MSBTRTLOCALDaily",
"fulltrainname": "Chennai Beach LOCAL",
"stations": [
"MSB",
"RPM",
"WST",
"VJM",
"PER",
"PCW",
"PEW",
"VLK",
"KOTR",
"PVM",
"ABU",
"TMVL",
"ANNR",
"AVD",
"HC",
"PAB",
"NEC",
"TI",
"VEU",
"SVR",
"PTLR",
"TRL",
"EGT",
"KBT",
"SPAM",
"MAF",
"TO",
"MSU",
"PLMG",
"AJJ",
"TRT"
],
"timeDifferenceFromSource": [
0,
4,
9,
15,
19,
21,
23,
26,
30,
33,
36,
39,
42,
47,
51,
53,
57,
60,
64,
68,
71,
84,
88,
92,
96,
100,
105,
111,
115,
128,
150
],
"actualtimeDifferenceFromSource": [
0,
4,
5,
6,
4,
2,
2,
3,
4,
3,
3,
3,
3,
5,
4,
2,
4,
3,
4,
4,
3,
13,
4,
4,
4,
4,
5,
6,
4,
13,
22
],
"startingTime": [
[
"12",
"10"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"1",
"3",
"6",
"7",
"8",
"9",
"11",
"14",
"16",
"17",
"19",
"20",
"23",
"26",
"27",
"29",
"31",
"34",
"37",
"40",
"43",
"47",
"49",
"52",
"56",
"60",
"65",
"68",
"70",
"84"
]
},
{
"trainNo": "66012",
"train": "MSBMASLOCALDaily",
"fulltrainname": "Chennai Beach LOCAL",
"stations": [
"MSB",
"RPM",
"WST",
"MAS"
],
"timeDifferenceFromSource": [
0,
4,
9,
25
],
"actualtimeDifferenceFromSource": [
0,
4,
5,
16
],
"startingTime": [
[
"16",
"45"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"1",
"3",
"7"
]
},
{
"trainNo": "66017",
"train": "MSBVLRMEMUDaily",
"fulltrainname": "Chennai Beach MEMU",
"stations": [
"MSB",
"RPM",
"WST",
"PER",
"VLK",
"ABU",
"TI",
"VEU",
"TRL",
"KBT",
"SPAM",
"MAF",
"TO",
"MSU",
"AJJ",
"CTRE",
"AVN",
"SHU",
"TUG",
"WJR",
"MCN",
"THL",
"KPD",
"VLR"
],
"timeDifferenceFromSource": [
0,
4,
9,
19,
24,
29,
39,
43,
54,
63,
67,
71,
77,
83,
103,
114,
119,
131,
138,
148,
159,
165,
183,
205
],
"actualtimeDifferenceFromSource": [
0,
4,
5,
10,
5,
5,
10,
4,
11,
9,
4,
4,
6,
6,
20,
11,
5,
12,
7,
10,
11,
6,
18,
22
],
"startingTime": [
[
"18",
"00"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"1",
"3",
"7",
"11",
"17",
"31",
"34",
"43",
"49",
"52",
"56",
"60",
"65",
"70",
"78",
"82",
"91",
"96",
"106",
"114",
"119",
"131",
"141"
]
},
{
"trainNo": "43807",
"train": "MSBAJJLADIESSPLDaily",
"fulltrainname": "Chennai Beach LADIES",
"stations": [
"MSB",
"RPM",
"WST",
"VJM",
"PER",
"PCW",
"PEW",
"VLK",
"KOTR",
"PVM",
"ABU",
"TMVL",
"ANNR",
"AVD",
"HC",
"PAB",
"NEC",
"TI",
"VEU",
"SVR",
"PTLR",
"TRL",
"EGT",
"KBT",
"SPAM",
"MAF",
"TO",
"MSU",
"PLMG",
"AJJ"
],
"timeDifferenceFromSource": [
0,
4,
9,
15,
17,
19,
21,
24,
28,
31,
34,
37,
40,
45,
49,
51,
55,
58,
62,
66,
69,
75,
79,
83,
87,
91,
96,
102,
106,
125
],
"actualtimeDifferenceFromSource": [
0,
4,
5,
6,
2,
2,
2,
3,
4,
3,
3,
3,
3,
5,
4,
2,
4,
3,
4,
4,
3,
6,
4,
4,
4,
4,
5,
6,
4,
19
],
"startingTime": [
[
"18",
"05"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"1",
"3",
"6",
"7",
"8",
"9",
"11",
"14",
"16",
"17",
"19",
"20",
"23",
"26",
"27",
"29",
"31",
"34",
"37",
"40",
"43",
"47",
"49",
"52",
"56",
"60",
"65",
"68",
"70"
]
},
{
"trainNo": "43823",
"train": "MSBTRTFASTDaily",
"fulltrainname": "Chennai Beach FAST",
"stations": [
"MSB",
"RPM",
"WST",
"PER",
"VLK",
"ABU",
"AVD",
"TI",
"PTLR",
"TRL",
"KBT",
"MAF",
"TO",
"MSU",
"PLMG",
"AJJ",
"TRT"
],
"timeDifferenceFromSource": [
0,
4,
9,
17,
22,
27,
34,
44,
50,
56,
62,
66,
71,
77,
83,
95,
125
],
"actualtimeDifferenceFromSource": [
0,
4,
5,
8,
5,
5,
7,
10,
6,
6,
6,
4,
5,
6,
6,
12,
30
],
"startingTime": [
[
"18",
"20"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"1",
"3",
"7",
"11",
"17",
"23",
"31",
"40",
"43",
"49",
"56",
"60",
"65",
"68",
"70",
"84"
]
},
{
"trainNo": "43602",
"train": "AVDMSBLOCALDaily",
"fulltrainname": "Avadi LOCAL",
"stations": [
"AVD",
"ANNR",
"TMVL",
"ABU",
"PVM",
"KOTR",
"VLK",
"PEW",
"PCW",
"PER",
"VJM",
"WST",
"RPM",
"MSB"
],
"timeDifferenceFromSource": [
0,
3,
6,
9,
12,
15,
19,
22,
24,
26,
28,
34,
39,
55
],
"actualtimeDifferenceFromSource": [
0,
3,
3,
3,
3,
3,
4,
3,
2,
2,
2,
6,
5,
16
],
"startingTime": [
[
"04",
"10"
],
[
"04",
"25"
],
[
"06",
"10"
],
[
"07",
"10"
],
[
"07",
"40"
],
[
"08",
"10"
],
[
"08",
"45"
],
[
"12",
"10"
],
[
"14",
"40"
],
[
"16",
"20"
],
[
"16",
"40"
],
[
"17",
"55"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"3",
"4",
"6",
"7",
"9",
"12",
"13",
"15",
"16",
"17",
"20",
"21",
"23"
]
},
{
"trainNo": "43802",
"train": "AJJMSBLOCALDaily",
"fulltrainname": "Arakkonam LOCAL",
"stations": [
"AJJ",
"PLMG",
"MSU",
"TO",
"MAF",
"SPAM",
"KBT",
"EGT",
"TRL",
"PTLR",
"SVR",
"VEU",
"TI",
"NEC",
"PAB",
"HC",
"AVD",
"ANNR",
"TMVL",
"ABU",
"PVM",
"KOTR",
"VLK",
"PEW",
"PCW",
"PER",
"VJM",
"WST",
"RPM",
"MSB"
],
"timeDifferenceFromSource": [
0,
4,
7,
12,
17,
21,
25,
29,
34,
38,
41,
44,
49,
52,
56,
58,
62,
66,
69,
72,
75,
78,
82,
85,
87,
89,
91,
97,
102,
125
],
"actualtimeDifferenceFromSource": [
0,
4,
3,
5,
5,
4,
4,
4,
5,
4,
3,
3,
5,
3,
4,
2,
4,
4,
3,
3,
3,
3,
4,
3,
2,
2,
2,
6,
5,
23
],
"startingTime": [
[
"04",
"00"
],
[
"16",
"20"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"2",
"5",
"10",
"15",
"18",
"21",
"24",
"27",
"30",
"33",
"36",
"40",
"41",
"44",
"45",
"48",
"50",
"52",
"53",
"55",
"57",
"59",
"61",
"62",
"63",
"65",
"68",
"69",
"70"
]
},
{
"trainNo": "42702",
"train": "PONMSBLOCALDaily",
"fulltrainname": "Ponneri LOCAL",
"stations": [
"PON",
"APB",
"MJR",
"NPKM",
"AIP",
"AIPP",
"ENR",
"KAVM",
"WCN",
"TVT",
"VOC",
"TNP",
"KOK",
"WST",
"RPM",
"MSB"
],
"timeDifferenceFromSource": [
0,
7,
11,
14,
16,
19,
23,
25,
28,
32,
35,
37,
39,
45,
50,
65
],
"actualtimeDifferenceFromSource": [
0,
7,
4,
3,
2,
3,
4,
2,
3,
4,
3,
2,
2,
6,
5,
15
],
"startingTime": [
[
"07",
"00"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"5",
"9",
"11",
"13",
"14",
"19",
"20",
"23",
"26",
"28",
"29",
"31",
"32",
"34",
"35"
]
},
{
"trainNo": "66016",
"train": "AJJMSBFASTDaily",
"fulltrainname": "Arakkonam FAST",
"stations": [
"AJJ",
"MSU",
"TO",
"MAF",
"KBT",
"TRL",
"PTLR",
"TI",
"PAB",
"AVD",
"ABU",
"VLK",
"PER",
"WST",
"RPM",
"MSB"
],
"timeDifferenceFromSource": [
0,
5,
10,
15,
21,
25,
29,
41,
48,
54,
61,
69,
77,
89,
94,
115
],
"actualtimeDifferenceFromSource": [
0,
5,
5,
5,
6,
4,
4,
12,
7,
6,
7,
8,
8,
12,
5,
21
],
"startingTime": [
[
"06",
"25"
],
[
"07",
"50"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"5",
"10",
"15",
"21",
"27",
"30",
"40",
"44",
"48",
"53",
"59",
"63",
"68",
"69",
"70"
]
},
{
"trainNo": "43804",
"train": "AJJMSBLADIESSPLDaily",
"fulltrainname": "Arakkonam LADIES",
"stations": [
"AJJ",
"PLMG",
"MSU",
"TO",
"MAF",
"SPAM",
"KBT",
"EGT",
"TRL",
"PTLR",
"SVR",
"VEU",
"TI",
"NEC",
"PAB",
"HC",
"AVD",
"ANNR",
"TMVL",
"ABU",
"PVM",
"KOTR",
"VLK",
"PEW",
"PCW",
"PER",
"VJM",
"WST",
"RPM",
"MSB"
],
"timeDifferenceFromSource": [
0,
4,
7,
12,
17,
21,
25,
29,
34,
38,
41,
44,
49,
52,
56,
58,
62,
66,
69,
72,
75,
78,
82,
85,
87,
89,
91,
97,
102,
115
],
"actualtimeDifferenceFromSource": [
0,
4,
3,
5,
5,
4,
4,
4,
5,
4,
3,
3,
5,
3,
4,
2,
4,
4,
3,
3,
3,
3,
4,
3,
2,
2,
2,
6,
5,
13
],
"startingTime": [
[
"07",
"00"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"2",
"5",
"10",
"15",
"18",
"21",
"24",
"27",
"30",
"33",
"36",
"40",
"41",
"44",
"45",
"48",
"50",
"52",
"53",
"55",
"57",
"59",
"61",
"62",
"63",
"65",
"68",
"69",
"70"
]
},
{
"trainNo": "66018",
"train": "VLRMSBMEMUDaily",
"fulltrainname": "Vellore Cantt MEMU",
"stations": [
"VLR",
"KPD",
"THL",
"MCN",
"WJR",
"TUG",
"SHU",
"AVN",
"CTRE",
"AJJ",
"MSU",
"TO",
"MAF",
"KBT",
"TRL",
"VEU",
"TI",
"VLK",
"PER",
"WST",
"RPM",
"MSB"
],
"timeDifferenceFromSource": [
0,
23,
34,
44,
53,
66,
74,
84,
89,
115,
124,
129,
134,
138,
142,
149,
154,
174,
179,
185,
190,
215
],
"actualtimeDifferenceFromSource": [
0,
23,
11,
10,
9,
13,
8,
10,
5,
26,
9,
5,
5,
4,
4,
7,
5,
20,
5,
6,
5,
25
],
"startingTime": [
[
"06",
"00"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"10",
"22",
"27",
"34",
"45",
"49",
"59",
"63",
"70",
"75",
"81",
"85",
"92",
"97",
"107",
"110",
"130",
"134",
"138",
"140",
"141"
]
},
{
"trainNo": "42802",
"train": "SPEMSBLOCALDaily",
"fulltrainname": "Sullurupeta LOCAL",
"stations": [
"SPE",
"TADA",
"AKM",
"ELR",
"GPD",
"KVP",
"PON",
"APB",
"MJR",
"NPKM",
"AIP",
"AIPP",
"ENR",
"KAVM",
"WCN",
"TVT",
"VOC",
"TNP",
"KOK",
"WST",
"RPM",
"MSB"
],
"timeDifferenceFromSource": [
0,
13,
20,
29,
40,
51,
60,
68,
72,
75,
77,
80,
84,
86,
89,
93,
96,
98,
100,
107,
112,
140
],
"actualtimeDifferenceFromSource": [
0,
13,
7,
9,
11,
11,
9,
8,
4,
3,
2,
3,
4,
2,
3,
4,
3,
2,
2,
7,
5,
28
],
"startingTime": [
[
"07",
"25"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"12",
"20",
"30",
"35",
"41",
"48",
"53",
"57",
"59",
"60",
"62",
"66",
"68",
"71",
"74",
"76",
"77",
"78",
"80",
"82",
"83"
]
},
{
"trainNo": "43752",
"train": "PRESMSBLOCALDaily",
"fulltrainname": "Pattabiram E Depot LOCAL",
"stations": [
"PRES",
"PAB",
"HC",
"AVD",
"ANNR",
"TMVL",
"ABU",
"PVM",
"KOTR",
"VLK",
"PEW",
"PCW",
"PER",
"VJM",
"WST",
"RPM",
"MSB"
],
"timeDifferenceFromSource": [
0,
8,
11,
15,
19,
22,
25,
28,
31,
35,
38,
40,
42,
44,
50,
55,
72
],
"actualtimeDifferenceFromSource": [
0,
8,
3,
4,
4,
3,
3,
3,
3,
4,
3,
2,
2,
2,
6,
5,
17
],
"startingTime": [
[
"08",
"40"
],
[
"20",
"35"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"6",
"7",
"10",
"13",
"14",
"16",
"17",
"19",
"22",
"23",
"25",
"26",
"27",
"30",
"32",
"33"
]
},
{
"trainNo": "42602",
"train": "GPDMSBLOCALDaily",
"fulltrainname": "Gummidipundi LOCAL",
"stations": [
"GPD",
"KVP",
"PON",
"APB",
"MJR",
"NPKM",
"AIP",
"AIPP",
"ENR",
"KAVM",
"WCN",
"TVT",
"VOC",
"TNP",
"KOK",
"WST",
"RPM",
"MSB"
],
"timeDifferenceFromSource": [
0,
6,
15,
23,
27,
30,
32,
35,
39,
41,
44,
48,
51,
53,
55,
61,
66,
85
],
"actualtimeDifferenceFromSource": [
0,
6,
9,
8,
4,
3,
2,
3,
4,
2,
3,
4,
3,
2,
2,
6,
5,
19
],
"startingTime": [
[
"08",
"45"
],
[
"16",
"30"
],
[
"20",
"15"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"6",
"13",
"17",
"21",
"24",
"25",
"27",
"31",
"33",
"36",
"38",
"40",
"42",
"43",
"45",
"46",
"48"
]
},
{
"trainNo": "43702",
"train": "TRLMSBLOCALDaily",
"fulltrainname": "Tiruvallur LOCAL",
"stations": [
"TRL",
"PTLR",
"SVR",
"VEU",
"TI",
"NEC",
"PAB",
"HC",
"AVD",
"ANNR",
"TMVL",
"ABU",
"PVM",
"KOTR",
"VLK",
"PEW",
"PCW",
"PER",
"VJM",
"WST",
"RPM",
"MSB"
],
"timeDifferenceFromSource": [
0,
3,
6,
9,
14,
17,
21,
23,
27,
31,
34,
37,
40,
43,
47,
50,
52,
54,
56,
62,
67,
85
],
"actualtimeDifferenceFromSource": [
0,
3,
3,
3,
5,
3,
4,
2,
4,
4,
3,
3,
3,
3,
4,
3,
2,
2,
2,
6,
5,
18
],
"startingTime": [
[
"11",
"05"
],
[
"13",
"40"
],
[
"17",
"55"
],
[
"18",
"25"
],
[
"19",
"45"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"3",
"6",
"9",
"13",
"14",
"17",
"18",
"21",
"23",
"24",
"26",
"28",
"30",
"32",
"34",
"36",
"36",
"38",
"41",
"42",
"43"
]
},
{
"trainNo": "43912",
"train": "KBTMSBLOCALDaily",
"fulltrainname": "Kadambattur LOCAL",
"stations": [
"KBT",
"EGT",
"TRL",
"PTLR",
"SVR",
"VEU",
"TI",
"NEC",
"PAB",
"HC",
"AVD",
"ANNR",
"TMVL",
"ABU",
"PVM",
"KOTR",
"VLK",
"PEW",
"PCW",
"PER",
"VJM",
"WST",
"RPM",
"MSB"
],
"timeDifferenceFromSource": [
0,
3,
9,
13,
16,
19,
24,
27,
31,
33,
37,
41,
44,
47,
50,
53,
57,
60,
62,
64,
66,
72,
77,
90
],
"actualtimeDifferenceFromSource": [
0,
3,
6,
4,
3,
3,
5,
3,
4,
2,
4,
4,
3,
3,
3,
3,
4,
3,
2,
2,
2,
6,
5,
13
],
"startingTime": [
[
"12",
"05"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"2",
"6",
"8",
"11",
"15",
"18",
"20",
"22",
"23",
"26",
"29",
"30",
"32",
"33",
"35",
"38",
"40",
"41",
"42",
"43",
"46",
"48",
"49"
]
},
{
"trainNo": "43001",
"train": "MASAVDLOCALDaily",
"fulltrainname": "Chennai Central LOCAL",
"stations": [
"MAS",
"BBQ",
"VJM",
"PER",
"PCW",
"PEW",
"VLK",
"KOTR",
"PVM",
"ABU",
"TMVL",
"ANNR",
"AVD"
],
"timeDifferenceFromSource": [
0,
4,
7,
9,
11,
13,
16,
20,
23,
26,
29,
32,
45
],
"actualtimeDifferenceFromSource": [
0,
4,
3,
2,
2,
2,
3,
4,
3,
3,
3,
3,
13
],
"startingTime": [
[
"00",
"15"
],
[
"07",
"50"
],
[
"08",
"45"
],
[
"08",
"55"
],
[
"09",
"25"
],
[
"09",
"30"
],
[
"10",
"15"
],
[
"10",
"45"
],
[
"12",
"35"
],
[
"15",
"50"
],
[
"20",
"40"
],
[
"20",
"55"
],
[
"21",
"50"
],
[
"22",
"00"
],
[
"23",
"00"
],
[
"23",
"25"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"2",
"4",
"6",
"6",
"8",
"10",
"12",
"14",
"16",
"17",
"18",
"21"
]
},
{
"trainNo": "42001",
"train": "MASGPDLOCALDaily",
"fulltrainname": "Chennai Central LOCAL",
"stations": [
"MAS",
"BBQ",
"KOK",
"TNP",
"VOC",
"TVT",
"WCN",
"KAVM",
"ENR",
"AIPP",
"AIP",
"NPKM",
"MJR",
"APB",
"PON",
"KVP",
"GPD"
],
"timeDifferenceFromSource": [
0,
6,
10,
12,
14,
18,
23,
26,
30,
36,
38,
40,
43,
47,
52,
58,
80
],
"actualtimeDifferenceFromSource": [
0,
6,
4,
2,
2,
4,
5,
3,
4,
6,
2,
2,
3,
4,
5,
6,
22
],
"startingTime": [
[
"00",
"15"
],
[
"06",
"15"
],
[
"06",
"45"
],
[
"07",
"10"
],
[
"08",
"00"
],
[
"08",
"50"
],
[
"09",
"22"
],
[
"10",
"25"
],
[
"11",
"35"
],
[
"12",
"10"
],
[
"13",
"15"
],
[
"14",
"35"
],
[
"15",
"10"
],
[
"16",
"35"
],
[
"17",
"05"
],
[
"17",
"35"
],
[
"18",
"30"
],
[
"19",
"35"
],
[
"20",
"10"
],
[
"21",
"15"
],
[
"21",
"45"
],
[
"22",
"35"
],
[
"23",
"15"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"2",
"4",
"5",
"7",
"9",
"12",
"15",
"16",
"20",
"22",
"24",
"26",
"30",
"35",
"42",
"47"
]
},
{
"trainNo": "43201",
"train": "MASTRLLOCALDaily",
"fulltrainname": "Chennai Central LOCAL",
"stations": [
"MAS",
"BBQ",
"VJM",
"PER",
"PCW",
"PEW",
"VLK",
"KOTR",
"PVM",
"ABU",
"TMVL",
"ANNR",
"AVD",
"HC",
"PAB",
"NEC",
"TI",
"VEU",
"SVR",
"PTLR",
"TRL"
],
"timeDifferenceFromSource": [
0,
4,
7,
9,
11,
13,
16,
20,
23,
26,
29,
32,
37,
41,
43,
47,
50,
54,
58,
61,
75
],
"actualtimeDifferenceFromSource": [
0,
4,
3,
2,
2,
2,
3,
4,
3,
3,
3,
3,
5,
4,
2,
4,
3,
4,
4,
3,
14
],
"startingTime": [
[
"03",
"40"
],
[
"05",
"15"
],
[
"05",
"55"
],
[
"06",
"55"
],
[
"07",
"40"
],
[
"08",
"05"
],
[
"08",
"35"
],
[
"09",
"10"
],
[
"09",
"35"
],
[
"09",
"45"
],
[
"11",
"30"
],
[
"12",
"15"
],
[
"13",
"20"
],
[
"14",
"00"
],
[
"14",
"40"
],
[
"15",
"00"
],
[
"15",
"40"
],
[
"16",
"30"
],
[
"17",
"25"
],
[
"17",
"55"
],
[
"18",
"25"
],
[
"18",
"50"
],
[
"19",
"30"
],
[
"20",
"00"
],
[
"20",
"45"
],
[
"21",
"40"
],
[
"23",
"10"
],
[
"23",
"40"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"2",
"4",
"6",
"6",
"8",
"10",
"12",
"14",
"16",
"17",
"18",
"21",
"24",
"25",
"27",
"29",
"32",
"36",
"39",
"42"
]
},
{
"trainNo": "43501",
"train": "MASTRTLOCALDaily",
"fulltrainname": "Chennai Central LOCAL",
"stations": [
"MAS",
"BBQ",
"VJM",
"PER",
"PCW",
"PEW",
"VLK",
"KOTR",
"PVM",
"ABU",
"TMVL",
"ANNR",
"AVD",
"HC",
"PAB",
"NEC",
"TI",
"VEU",
"SVR",
"PTLR",
"TRL",
"EGT",
"KBT",
"SPAM",
"MAF",
"TO",
"MSU",
"PLMG",
"AJJ",
"TRT"
],
"timeDifferenceFromSource": [
0,
4,
7,
9,
11,
13,
16,
20,
23,
26,
29,
32,
37,
41,
43,
47,
50,
54,
58,
61,
66,
70,
74,
78,
82,
87,
93,
97,
105,
135
],
"actualtimeDifferenceFromSource": [
0,
4,
3,
2,
2,
2,
3,
4,
3,
3,
3,
3,
5,
4,
2,
4,
3,
4,
4,
3,
5,
4,
4,
4,
4,
5,
6,
4,
8,
30
],
"startingTime": [
[
"04",
"00"
],
[
"07",
"05"
],
[
"10",
"00"
],
[
"11",
"45"
],
[
"14",
"20"
],
[
"15",
"30"
],
[
"17",
"00"
],
[
"17",
"40"
],
[
"19",
"00"
],
[
"20",
"15"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"2",
"4",
"6",
"6",
"8",
"10",
"12",
"14",
"16",
"17",
"18",
"21",
"24",
"25",
"27",
"29",
"32",
"36",
"39",
"42",
"45",
"47",
"50",
"54",
"58",
"64",
"67",
"69",
"83"
]
},
{
"trainNo": "43101",
"train": "MASPRESLOCALDaily",
"fulltrainname": "Chennai Central LOCAL",
"stations": [
"MAS",
"BBQ",
"VJM",
"PER",
"PCW",
"PEW",
"VLK",
"KOTR",
"PVM",
"ABU",
"TMVL",
"ANNR",
"AVD",
"HC",
"PAB",
"PRES"
],
"timeDifferenceFromSource": [
0,
4,
7,
9,
11,
13,
16,
20,
23,
26,
29,
32,
37,
41,
44,
65
],
"actualtimeDifferenceFromSource": [
0,
4,
3,
2,
2,
2,
3,
4,
3,
3,
3,
3,
5,
4,
3,
21
],
"startingTime": [
[
"04",
"15"
],
[
"05",
"25"
],
[
"06",
"25"
],
[
"07",
"25"
],
[
"11",
"15"
],
[
"12",
"25"
],
[
"13",
"05"
],
[
"15",
"15"
],
[
"16",
"10"
],
[
"18",
"15"
],
[
"19",
"15"
],
[
"20",
"30"
],
[
"21",
"25"
],
[
"22",
"30"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"2",
"4",
"6",
"6",
"8",
"10",
"12",
"14",
"16",
"17",
"18",
"21",
"24",
"25",
"31"
]
},
{
"trainNo": "42401",
"train": "MASSPELOCALDaily",
"fulltrainname": "Chennai Central LOCAL",
"stations": [
"MAS",
"BBQ",
"KOK",
"TNP",
"VOC",
"TVT",
"WCN",
"KAVM",
"ENR",
"AIPP",
"AIP",
"NPKM",
"MJR",
"APB",
"PON",
"KVP",
"GPD",
"ELR",
"AKM",
"TADA",
"SPE"
],
"timeDifferenceFromSource": [
0,
6,
10,
12,
14,
18,
23,
26,
30,
36,
38,
40,
43,
47,
52,
58,
67,
73,
82,
89,
125
],
"actualtimeDifferenceFromSource": [
0,
6,
4,
2,
2,
4,
5,
3,
4,
6,
2,
2,
3,
4,
5,
6,
9,
6,
9,
7,
36
],
"startingTime": [
[
"04",
"25"
],
[
"05",
"00"
],
[
"05",
"35"
],
[
"07",
"30"
],
[
"08",
"30"
],
[
"09",
"55"
],
[
"12",
"40"
],
[
"13",
"40"
],
[
"15",
"35"
],
[
"18",
"00"
],
[
"18",
"55"
],
[
"20",
"35"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"2",
"4",
"5",
"7",
"9",
"12",
"15",
"16",
"20",
"22",
"24",
"26",
"30",
"35",
"42",
"47",
"53",
"63",
"70",
"83"
]
},
{
"trainNo": "43401",
"train": "MASAJJFASTDaily",
"fulltrainname": "Chennai Central FAST",
"stations": [
"MAS",
"BBQ",
"PER",
"VLK",
"ABU",
"TI",
"TRL",
"KBT",
"TO",
"AJJ"
],
"timeDifferenceFromSource": [
0,
4,
9,
14,
19,
31,
44,
52,
61,
85
],
"actualtimeDifferenceFromSource": [
0,
4,
5,
5,
5,
12,
13,
8,
9,
24
],
"startingTime": [
[
"05",
"30"
],
[
"20",
"05"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"2",
"6",
"10",
"16",
"29",
"42",
"47",
"58",
"69"
]
},
{
"trainNo": "42901",
"train": "MASENRLOCALDaily",
"fulltrainname": "Chennai Central LOCAL",
"stations": [
"MAS",
"BBQ",
"KOK",
"TNP",
"VOC",
"TVT",
"WCN",
"KAVM",
"ENR"
],
"timeDifferenceFromSource": [
0,
6,
10,
12,
14,
18,
23,
26,
35
],
"actualtimeDifferenceFromSource": [
0,
6,
4,
2,
2,
4,
5,
3,
9
],
"startingTime": [
[
"05",
"50"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"2",
"4",
"5",
"7",
"9",
"12",
"15",
"16"
]
},
{
"trainNo": "43403",
"train": "MASAJJLOCALDaily",
"fulltrainname": "Chennai Central LOCAL",
"stations": [
"MAS",
"BBQ",
"VJM",
"PER",
"PCW",
"PEW",
"VLK",
"KOTR",
"PVM",
"ABU",
"TMVL",
"ANNR",
"AVD",
"HC",
"PAB",
"NEC",
"TI",
"VEU",
"SVR",
"PTLR",
"TRL",
"EGT",
"KBT",
"SPAM",
"MAF",
"TO",
"MSU",
"PLMG",
"AJJ"
],
"timeDifferenceFromSource": [
0,
4,
7,
9,
11,
13,
16,
20,
23,
26,
29,
32,
37,
41,
43,
47,
50,
54,
58,
61,
67,
71,
75,
79,
83,
88,
94,
98,
110
],
"actualtimeDifferenceFromSource": [
0,
4,
3,
2,
2,
2,
3,
4,
3,
3,
3,
3,
5,
4,
2,
4,
3,
4,
4,
3,
6,
4,
4,
4,
4,
5,
6,
4,
12
],
"startingTime": [
[
"06",
"05"
],
[
"06",
"40"
],
[
"08",
"25"
],
[
"09",
"05"
],
[
"11",
"00"
],
[
"12",
"50"
],
[
"13",
"45"
],
[
"16",
"00"
],
[
"16",
"45"
],
[
"17",
"15"
],
[
"18",
"05"
],
[
"18",
"40"
],
[
"19",
"45"
],
[
"21",
"05"
],
[
"22",
"10"
],
[
"22",
"45"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"2",
"4",
"6",
"6",
"8",
"10",
"12",
"14",
"16",
"17",
"18",
"21",
"24",
"25",
"27",
"29",
"32",
"36",
"39",
"42",
"45",
"47",
"50",
"54",
"58",
"64",
"67",
"69"
]
},
{
"trainNo": "66015",
"train": "MASTPTYMEMUDaily",
"fulltrainname": "Chennai Central MEMU",
"stations": [
"MAS",
"BBQ",
"VJM",
"PER",
"PCW",
"PEW",
"VLK",
"KOTR",
"PVM",
"ABU",
"TMVL",
"ANNR",
"AVD",
"HC",
"PAB",
"NEC",
"TI",
"VEU",
"SVR",
"PTLR",
"TRL",
"EGT",
"KBT",
"SPAM",
"MAF",
"TO",
"MSU",
"PLMG",
"AJJ",
"TRT",
"POI",
"VKZ",
"NG",
"EKM",
"VGA",
"PUT",
"TDK",
"PUDI",
"RU",
"TPTY"
],
"timeDifferenceFromSource": [
0,
4,
7,
9,
11,
13,
16,
20,
23,
26,
29,
32,
37,
41,
43,
47,
50,
54,
58,
61,
67,
71,
75,
79,
83,
88,
94,
98,
108,
124,
132,
138,
144,
149,
159,
169,
179,
189,
210,
240
],
"actualtimeDifferenceFromSource": [
0,
4,
3,
2,
2,
2,
3,
4,
3,
3,
3,
3,
5,
4,
2,
4,
3,
4,
4,
3,
6,
4,
4,
4,
4,
5,
6,
4,
10,
16,
8,
6,
6,
5,
10,
10,
10,
10,
21,
30
],
"startingTime": [
[
"07",
"15"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"2",
"4",
"6",
"7",
"8",
"10",
"13",
"15",
"16",
"18",
"19",
"22",
"25",
"26",
"28",
"30",
"33",
"36",
"39",
"42",
"45",
"47",
"50",
"54",
"58",
"64",
"67",
"69",
"83",
"90",
"95",
"99",
"101",
"108",
"115",
"122",
"131",
"140",
"150"
]
},
{
"trainNo": "66035",
"train": "MASNLRMEMUDaily",
"fulltrainname": "Chennai Central MEMU",
"stations": [
"MAS",
"BBQ",
"KOK",
"TNP",
"VOC",
"TVT",
"WCN",
"KAVM",
"ENR",
"AIPP",
"AIP",
"NPKM",
"MJR",
"APB",
"PON",
"KVP",
"GPD",
"ELR",
"AKM",
"TADA",
"AKAT",
"SPE",
"PEL",
"DVR",
"NYP",
"PYA",
"ODUR",
"GDR",
"MBL",
"VKT",
"VDE",
"NLS",
"NLR"
],
"timeDifferenceFromSource": [
0,
6,
10,
12,
14,
18,
23,
26,
30,
36,
38,
40,
43,
47,
52,
58,
73,
80,
89,
96,
103,
125,
148,
156,
168,
179,
186,
208,
219,
229,
236,
241,
255
],
"actualtimeDifferenceFromSource": [
0,
6,
4,
2,
2,
4,
5,
3,
4,
6,
2,
2,
3,
4,
5,
6,
15,
7,
9,
7,
7,
22,
23,
8,
12,
11,
7,
22,
11,
10,
7,
5,
14
],
"startingTime": [
[
"07",
"45"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"2",
"4",
"5",
"7",
"9",
"12",
"15",
"17",
"21",
"23",
"24",
"27",
"31",
"36",
"43",
"49",
"55",
"65",
"72",
"79",
"84",
"92",
"99",
"111",
"124",
"130",
"139",
"148",
"160",
"169",
"174",
"176"
]
},
{
"trainNo": "43901",
"train": "MASKBTLOCALDaily",
"fulltrainname": "Chennai Central LOCAL",
"stations": [
"MAS",
"BBQ",
"VJM",
"PER",
"PCW",
"PEW",
"VLK",
"KOTR",
"PVM",
"ABU",
"TMVL",
"ANNR",
"AVD",
"HC",
"PAB",
"NEC",
"TI",
"VEU",
"SVR",
"PTLR",
"TRL",
"EGT",
"KBT"
],
"timeDifferenceFromSource": [
0,
4,
7,
9,
11,
13,
16,
20,
23,
26,
29,
32,
37,
41,
43,
47,
50,
54,
58,
61,
67,
71,
85
],
"actualtimeDifferenceFromSource": [
0,
4,
3,
2,
2,
2,
3,
4,
3,
3,
3,
3,
5,
4,
2,
4,
3,
4,
4,
3,
6,
4,
14
],
"startingTime": [
[
"10",
"30"
],
[
"12",
"00"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"2",
"4",
"6",
"6",
"8",
"10",
"12",
"14",
"16",
"17",
"18",
"21",
"24",
"25",
"27",
"29",
"32",
"36",
"39",
"42",
"45",
"47"
]
},
{
"trainNo": "42301",
"train": "MASPONLOCALDaily",
"fulltrainname": "Chennai Central LOCAL",
"stations": [
"MAS",
"BBQ",
"KOK",
"TNP",
"VOC",
"TVT",
"WCN",
"KAVM",
"ENR",
"AIPP",
"AIP",
"NPKM",
"MJR",
"APB",
"PON"
],
"timeDifferenceFromSource": [
0,
6,
10,
12,
14,
18,
23,
26,
30,
36,
38,
40,
43,
47,
70
],
"actualtimeDifferenceFromSource": [
0,
6,
4,
2,
2,
4,
5,
3,
4,
6,
2,
2,
3,
4,
23
],
"startingTime": [
[
"14",
"15"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"2",
"4",
"5",
"7",
"9",
"12",
"15",
"16",
"20",
"22",
"24",
"26",
"30",
"35"
]
},
{
"trainNo": "57239",
"train": "MASGDRPASSDaily",
"fulltrainname": "Chennai Central PASS",
"stations": [
"GS",
"1"
],
"timeDifferenceFromSource": [
0,
null
],
"actualtimeDifferenceFromSource": [
0,
null
],
"startingTime": [
[
"16",
"00"
]
],
"runday": [
"Daily"
],
"distance": [
"GS",
"7"
]
},
{
"trainNo": "40422",
"train": "TBMMSBLOCALSu",
"fulltrainname": "Tambaram LOCAL",
"stations": [
"TBM",
"TBMS",
"CMP",
"PV",
"TLM",
"MN",
"PZA",
"STM",
"GDY",
"SP",
"MBM",
"MKK",
"NBK",
"MSC",
"MS",
"MPK",
"MSF",
"MSB"
],
"timeDifferenceFromSource": [
0,
3,
6,
9,
12,
14,
17,
20,
23,
26,
29,
31,
33,
36,
39,
42,
45,
55
],
"actualtimeDifferenceFromSource": [
0,
3,
3,
3,
3,
2,
3,
3,
3,
3,
3,
2,
2,
3,
3,
3,
3,
10
],
"startingTime": [
[
"23",
"30"
],
[
"04",
"00"
],
[
"04",
"20"
],
[
"04",
"40"
],
[
"05",
"15"
],
[
"06",
"00"
],
[
"06",
"45"
],
[
"07",
"00"
],
[
"07",
"30"
],
[
"08",
"10"
],
[
"09",
"00"
],
[
"09",
"20"
],
[
"09",
"40"
],
[
"09",
"50"
],
[
"10",
"00"
],
[
"10",
"10"
],
[
"10",
"20"
],
[
"10",
"40"
],
[
"10",
"50"
],
[
"11",
"00"
],
[
"11",
"10"
],
[
"11",
"20"
],
[
"11",
"40"
],
[
"11",
"50"
],
[
"12",
"10"
],
[
"12",
"20"
],
[
"12",
"40"
],
[
"12",
"50"
],
[
"13",
"15"
],
[
"13",
"30"
],
[
"14",
"00"
],
[
"14",
"15"
],
[
"14",
"45"
],
[
"15",
"00"
],
[
"15",
"20"
],
[
"15",
"30"
],
[
"16",
"00"
],
[
"16",
"10"
],
[
"16",
"20"
],
[
"16",
"40"
],
[
"16",
"50"
],
[
"17",
"00"
],
[
"17",
"10"
],
[
"17",
"20"
],
[
"17",
"40"
],
[
"18",
"00"
],
[
"18",
"20"
],
[
"18",
"30"
],
[
"18",
"40"
],
[
"18",
"50"
],
[
"19",
"13"
],
[
"19",
"20"
],
[
"19",
"40"
],
[
"19",
"50"
],
[
"20",
"10"
],
[
"20",
"20"
],
[
"20",
"30"
],
[
"20",
"50"
],
[
"21",
"00"
],
[
"21",
"50"
],
[
"22",
"30"
]
],
"runday": [
"Su"
],
"distance": [
"0",
"2",
"4",
"6",
"8",
"9",
"10",
"12",
"14",
"16",
"18",
"20",
"22",
"24",
"26",
"27",
"28",
"30"
]
},
{
"trainNo": "40162",
"train": "TBMMSBLOCALMTuWThFSa",
"fulltrainname": "Tambaram LOCAL",
"stations": [
"TBM",
"TBMS",
"CMP",
"PV",
"TLM",
"MN",
"PZA",
"STM",
"GDY",
"SP",
"MBM",
"MKK",
"NBK",
"MSC",
"MS",
"MPK",
"MSF",
"MSB"
],
"timeDifferenceFromSource": [
0,
3,
6,
9,
12,
14,
17,
20,
23,
26,
29,
31,
33,
36,
39,
42,
45,
55
],
"actualtimeDifferenceFromSource": [
0,
3,
3,
3,
3,
2,
3,
3,
3,
3,
3,
2,
2,
3,
3,
3,
3,
10
],
"startingTime": [
[
"23",
"30"
],
[
"04",
"00"
],
[
"04",
"20"
],
[
"04",
"40"
],
[
"05",
"15"
],
[
"06",
"00"
],
[
"06",
"20"
],
[
"06",
"30"
],
[
"06",
"47"
],
[
"06",
"55"
],
[
"07",
"02"
],
[
"07",
"12"
],
[
"07",
"17"
],
[
"07",
"44"
],
[
"07",
"56"
],
[
"08",
"06"
],
[
"08",
"15"
],
[
"08",
"24"
],
[
"08",
"30"
],
[
"08",
"38"
],
[
"08",
"44"
],
[
"08",
"58"
],
[
"09",
"08"
],
[
"09",
"18"
],
[
"09",
"38"
],
[
"09",
"45"
],
[
"09",
"55"
],
[
"10",
"05"
],
[
"10",
"17"
],
[
"10",
"25"
],
[
"10",
"55"
],
[
"11",
"10"
],
[
"11",
"20"
],
[
"11",
"43"
],
[
"11",
"56"
],
[
"12",
"08"
],
[
"12",
"47"
],
[
"13",
"17"
],
[
"13",
"32"
],
[
"14",
"02"
],
[
"14",
"15"
],
[
"14",
"25"
],
[
"14",
"45"
],
[
"14",
"55"
],
[
"15",
"05"
],
[
"15",
"23"
],
[
"15",
"32"
],
[
"15",
"38"
],
[
"16",
"00"
],
[
"16",
"08"
],
[
"16",
"18"
],
[
"16",
"36"
],
[
"16",
"43"
],
[
"16",
"50"
],
[
"16",
"57"
],
[
"17",
"04"
],
[
"17",
"11"
],
[
"17",
"18"
],
[
"17",
"25"
],
[
"17",
"39"
],
[
"17",
"53"
],
[
"18",
"00"
],
[
"18",
"08"
],
[
"18",
"22"
],
[
"18",
"29"
],
[
"18",
"38"
],
[
"18",
"48"
],
[
"19",
"03"
],
[
"19",
"10"
],
[
"19",
"35"
],
[
"20",
"10"
],
[
"20",
"20"
],
[
"20",
"30"
],
[
"21",
"20"
],
[
"21",
"45"
],
[
"22",
"25"
],
[
"22",
"45"
]
],
"runday": [
"M",
"Tu",
"W",
"Th",
"F",
"Sa"
],
"distance": [
"0",
"2",
"4",
"6",
"8",
"9",
"10",
"12",
"14",
"16",
"18",
"19",
"21",
"23",
"25",
"26",
"27",
"29"
]
},
{
"trainNo": "40666",
"train": "CGLMSBLOCALSu",
"fulltrainname": "Chengalpattu LOCAL",
"stations": [
"CGL",
"PWU",
"SKL",
"MMNK",
"CTM",
"POTI",
"GI",
"UPM",
"VDR",
"PRGL",
"TBM",
"TBMS",
"CMP",
"PV",
"TLM",
"MN",
"PZA",
"STM",
"GDY",
"SP",
"MBM",
"MKK",
"NBK",
"MSC",
"MS",
"MPK",
"MSF",
"MSB"
],
"timeDifferenceFromSource": [
0,
4,
10,
15,
17,
20,
24,
28,
32,
35,
44,
48,
51,
54,
57,
59,
62,
65,
68,
71,
74,
76,
78,
81,
84,
87,
90,
100
],
"actualtimeDifferenceFromSource": [
0,
4,
6,
5,
2,
3,
4,
4,
4,
3,
9,
4,
3,
3,
3,
2,
3,
3,
3,
3,
3,
2,
2,
3,
3,
3,
3,
10
],
"startingTime": [
[
"23",
"10"
],
[
"04",
"00"
],
[
"04",
"35"
],
[
"04",
"50"
],
[
"05",
"05"
],
[
"05",
"50"
],
[
"06",
"45"
],
[
"07",
"05"
],
[
"07",
"25"
],
[
"07",
"40"
],
[
"08",
"25"
],
[
"08",
"45"
],
[
"09",
"40"
],
[
"10",
"45"
],
[
"11",
"45"
],
[
"12",
"15"
],
[
"13",
"00"
],
[
"13",
"50"
],
[
"14",
"25"
],
[
"15",
"05"
],
[
"15",
"40"
],
[
"16",
"30"
],
[
"17",
"00"
],
[
"17",
"30"
],
[
"18",
"10"
],
[
"18",
"40"
],
[
"19",
"15"
],
[
"19",
"50"
],
[
"20",
"25"
],
[
"20",
"45"
],
[
"21",
"10"
],
[
"22",
"15"
]
],
"runday": [
"Su"
],
"distance": [
"0",
"4",
"8",
"13",
"14",
"16",
"19",
"22",
"25",
"27",
"31",
"32",
"34",
"37",
"38",
"40",
"41",
"43",
"45",
"47",
"48",
"50",
"52",
"53",
"55",
"57",
"58",
"60"
]
},
{
"trainNo": "40574",
"train": "CGLMSBLOCALMTuWThFSa",
"fulltrainname": "Chengalpattu LOCAL",
"stations": [
"CGL",
"PWU",
"SKL",
"MMNK",
"CTM",
"POTI",
"GI",
"UPM",
"VDR",
"PRGL",
"TBM",
"TBMS",
"CMP",
"PV",
"TLM",
"MN",
"PZA",
"STM",
"GDY",
"SP",
"MBM",
"MKK",
"NBK",
"MSC",
"MS",
"MPK",
"MSF",
"MSB"
],
"timeDifferenceFromSource": [
0,
4,
10,
15,
17,
20,
24,
28,
32,
35,
44,
48,
51,
54,
57,
59,
62,
65,
68,
71,
74,
76,
78,
81,
84,
87,
90,
100
],
"actualtimeDifferenceFromSource": [
0,
4,
6,
5,
2,
3,
4,
4,
4,
3,
9,
4,
3,
3,
3,
2,
3,
3,
3,
3,
3,
2,
2,
3,
3,
3,
3,
10
],
"startingTime": [
[
"23",
"10"
],
[
"03",
"55"
],
[
"04",
"20"
],
[
"04",
"50"
],
[
"05",
"10"
],
[
"05",
"50"
],
[
"06",
"45"
],
[
"08",
"35"
],
[
"09",
"40"
],
[
"10",
"15"
],
[
"10",
"45"
],
[
"11",
"45"
],
[
"12",
"15"
],
[
"13",
"00"
],
[
"13",
"50"
],
[
"14",
"25"
],
[
"15",
"05"
],
[
"15",
"30"
],
[
"15",
"40"
],
[
"16",
"30"
],
[
"17",
"00"
],
[
"17",
"30"
],
[
"18",
"10"
],
[
"18",
"40"
],
[
"19",
"00"
],
[
"19",
"20"
],
[
"19",
"50"
],
[
"20",
"25"
],
[
"20",
"45"
],
[
"21",
"10"
],
[
"22",
"15"
]
],
"runday": [
"M",
"Tu",
"W",
"Th",
"F",
"Sa"
],
"distance": [
"0",
"4",
"8",
"13",
"14",
"16",
"19",
"22",
"25",
"27",
"31",
"32",
"34",
"37",
"38",
"40",
"41",
"43",
"45",
"47",
"48",
"50",
"52",
"53",
"55",
"57",
"58",
"60"
]
},
{
"trainNo": "41002",
"train": "VLCYMSBLOCALMTuWThFSa",
"fulltrainname": "Velachery LOCAL",
"stations": [
"VLCY",
"PRGD",
"TRMN",
"TYMR",
"INDR",
"KTBR",
"KTPM",
"GWYR",
"MNDY",
"MTMY",
"MLHS",
"MTCN",
"MCPK",
"MCPT",
"MPKT",
"MSF",
"MSB"
],
"timeDifferenceFromSource": [
0,
2,
4,
7,
8,
10,
12,
14,
16,
18,
23,
25,
27,
29,
31,
33,
45
],
"actualtimeDifferenceFromSource": [
0,
2,
2,
3,
1,
2,
2,
2,
2,
2,
5,
2,
2,
2,
2,
2,
12
],
"startingTime": [
[
"05",
"00"
],
[
"05",
"30"
],
[
"05",
"45"
],
[
"06",
"05"
],
[
"06",
"25"
],
[
"06",
"40"
],
[
"06",
"55"
],
[
"07",
"10"
],
[
"07",
"25"
],
[
"07",
"40"
],
[
"07",
"55"
],
[
"08",
"10"
],
[
"08",
"20"
],
[
"08",
"35"
],
[
"08",
"50"
],
[
"09",
"05"
],
[
"09",
"15"
],
[
"09",
"25"
],
[
"09",
"35"
],
[
"09",
"50"
],
[
"10",
"05"
],
[
"10",
"15"
],
[
"10",
"30"
],
[
"10",
"45"
],
[
"11",
"00"
],
[
"11",
"15"
],
[
"11",
"35"
],
[
"11",
"55"
],
[
"12",
"15"
],
[
"12",
"35"
],
[
"12",
"55"
],
[
"13",
"15"
],
[
"13",
"35"
],
[
"13",
"55"
],
[
"14",
"15"
],
[
"14",
"35"
],
[
"14",
"55"
],
[
"15",
"05"
],
[
"15",
"25"
],
[
"15",
"45"
],
[
"16",
"00"
],
[
"16",
"10"
],
[
"16",
"25"
],
[
"16",
"40"
],
[
"16",
"55"
],
[
"17",
"15"
],
[
"17",
"25"
],
[
"17",
"35"
],
[
"17",
"45"
],
[
"17",
"55"
],
[
"18",
"05"
],
[
"18",
"20"
],
[
"18",
"30"
],
[
"18",
"45"
],
[
"19",
"00"
],
[
"19",
"10"
],
[
"19",
"20"
],
[
"19",
"30"
],
[
"19",
"50"
],
[
"20",
"10"
],
[
"20",
"30"
],
[
"20",
"50"
],
[
"21",
"10"
],
[
"21",
"30"
],
[
"21",
"50"
],
[
"22",
"10"
],
[
"22",
"30"
],
[
"22",
"50"
],
[
"23",
"10"
]
],
"runday": [
"M",
"Tu",
"W",
"Th",
"F",
"Sa"
],
"distance": [
"0",
"2",
"3",
"5",
"6",
"6",
"7",
"8",
"10",
"11",
"12",
"14",
"14",
"16",
"17",
"18",
"19"
]
},
{
"trainNo": "41502",
"train": "VLCYMSBLOCALSu",
"fulltrainname": "Velachery LOCAL",
"stations": [
"VLCY",
"PRGD",
"TRMN",
"TYMR",
"INDR",
"KTBR",
"KTPM",
"GWYR",
"MNDY",
"MTMY",
"MLHS",
"MTCN",
"MCPK",
"MCPT",
"MPKT",
"MSF",
"MSB"
],
"timeDifferenceFromSource": [
0,
2,
4,
7,
8,
10,
12,
14,
16,
18,
23,
25,
27,
29,
31,
33,
45
],
"actualtimeDifferenceFromSource": [
0,
2,
2,
3,
1,
2,
2,
2,
2,
2,
5,
2,
2,
2,
2,
2,
12
],
"startingTime": [
[
"06",
"50"
],
[
"07",
"10"
],
[
"07",
"30"
],
[
"07",
"50"
],
[
"08",
"10"
],
[
"08",
"30"
],
[
"08",
"50"
],
[
"09",
"10"
],
[
"09",
"30"
],
[
"09",
"50"
],
[
"10",
"10"
],
[
"10",
"30"
],
[
"10",
"40"
],
[
"10",
"50"
],
[
"11",
"10"
],
[
"11",
"30"
],
[
"11",
"50"
],
[
"12",
"10"
],
[
"12",
"30"
],
[
"12",
"50"
],
[
"13",
"10"
],
[
"13",
"30"
],
[
"13",
"50"
],
[
"14",
"10"
],
[
"14",
"30"
],
[
"14",
"50"
],
[
"15",
"10"
],
[
"15",
"30"
],
[
"15",
"50"
],
[
"16",
"10"
],
[
"16",
"30"
],
[
"16",
"50"
],
[
"17",
"10"
],
[
"17",
"30"
],
[
"17",
"50"
],
[
"18",
"10"
],
[
"18",
"30"
],
[
"18",
"50"
],
[
"19",
"10"
],
[
"19",
"30"
],
[
"19",
"50"
],
[
"20",
"10"
],
[
"20",
"30"
],
[
"20",
"50"
],
[
"21",
"10"
],
[
"21",
"30"
],
[
"21",
"50"
],
[
"22",
"10"
],
[
"22",
"30"
],
[
"22",
"50"
],
[
"23",
"10"
]
],
"runday": [
"Su"
],
"distance": [
"0",
"2",
"3",
"5",
"6",
"6",
"7",
"8",
"10",
"11",
"12",
"14",
"14",
"16",
"17",
"18",
"19"
]
},
{
"trainNo": "40702",
"train": "TMLPMSBLOCALDaily",
"fulltrainname": "Tirumalpur LOCAL",
"stations": [
"TMLP",
"CJ",
"CJE",
"NTT",
"WJ",
"PYV",
"PALR",
"VB",
"RDY",
"CGL",
"PWU",
"SKL",
"MMNK",
"CTM",
"POTI",
"GI",
"UPM",
"VDR",
"PRGL",
"TBM",
"TBMS",
"CMP",
"PV",
"TLM",
"MN",
"PZA",
"STM",
"GDY",
"SP",
"MBM",
"MKK",
"NBK",
"MSC",
"MS",
"MPK",
"MSF",
"MSB"
],
"timeDifferenceFromSource": [
0,
10,
16,
21,
30,
36,
40,
45,
50,
60,
69,
75,
80,
82,
85,
89,
93,
97,
100,
120,
127,
130,
133,
136,
138,
141,
144,
147,
150,
153,
155,
157,
160,
163,
166,
169,
179
],
"actualtimeDifferenceFromSource": [
0,
10,
6,
5,
9,
6,
4,
5,
5,
10,
9,
6,
5,
2,
3,
4,
4,
4,
3,
20,
7,
3,
3,
3,
2,
3,
3,
3,
3,
3,
2,
2,
3,
3,
3,
3,
10
],
"startingTime": [
[
"05",
"15"
],
[
"10",
"25"
],
[
"13",
"40"
],
[
"17",
"10"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"13",
"14",
"19",
"27",
"34",
"37",
"40",
"44",
"48",
"53",
"57",
"61",
"62",
"64",
"68",
"71",
"74",
"76",
"79",
"81",
"83",
"85",
"87",
"88",
"90",
"91",
"93",
"95",
"97",
"98",
"100",
"102",
"104",
"105",
"106",
"108"
]
},
{
"trainNo": "40514",
"train": "CGLMSBFASTMTuWThFSa",
"fulltrainname": "Chengalpattu FAST",
"stations": [
"CGL",
"PWU",
"SKL",
"MMNK",
"CTM",
"POTI",
"GI",
"UPM",
"VDR",
"PRGL",
"TBM",
"GDY",
"MBM",
"MS",
"MPK",
"MSF",
"MSB"
],
"timeDifferenceFromSource": [
0,
4,
10,
15,
17,
20,
24,
28,
32,
35,
44,
58,
63,
71,
74,
77,
87
],
"actualtimeDifferenceFromSource": [
0,
4,
6,
5,
2,
3,
4,
4,
4,
3,
9,
14,
5,
8,
3,
3,
10
],
"startingTime": [
[
"07",
"05"
],
[
"07",
"25"
],
[
"07",
"40"
],
[
"08",
"00"
],
[
"08",
"25"
],
[
"08",
"45"
]
],
"runday": [
"M",
"Tu",
"W",
"Th",
"F",
"Sa"
],
"distance": [
"0",
"4",
"8",
"13",
"14",
"16",
"19",
"22",
"25",
"27",
"31",
"45",
"48",
"55",
"57",
"58",
"60"
]
},
{
"trainNo": "40704",
"train": "TMLPMSBFASTDaily",
"fulltrainname": "Tirumalpur FAST",
"stations": [
"TMLP",
"CJ",
"CJE",
"WJ",
"PALR",
"CGL",
"TBM",
"GDY",
"MBM",
"MS",
"MPK",
"MSF",
"MSB"
],
"timeDifferenceFromSource": [
0,
14,
16,
26,
36,
55,
93,
108,
113,
121,
124,
127,
145
],
"actualtimeDifferenceFromSource": [
0,
14,
2,
10,
10,
19,
38,
15,
5,
8,
3,
3,
18
],
"startingTime": [
[
"07",
"05"
],
[
"07",
"50"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"13",
"14",
"27",
"37",
"48",
"79",
"93",
"97",
"104",
"105",
"106",
"108"
]
},
{
"trainNo": "40042",
"train": "STBMSBLOCALMTuWThFSa",
"fulltrainname": "St Thomas Mount LOCAL",
"stations": [
"STM",
"GDY",
"SP",
"MBM",
"MKK",
"NBK",
"MSC",
"MS",
"MPK",
"MSF",
"MSB"
],
"timeDifferenceFromSource": [
0,
2,
5,
8,
10,
12,
15,
18,
21,
24,
35
],
"actualtimeDifferenceFromSource": [
0,
2,
3,
3,
2,
2,
3,
3,
3,
3,
11
],
"startingTime": [
[
"09",
"05"
]
],
"runday": [
"M",
"Tu",
"W",
"Th",
"F",
"Sa"
],
"distance": [
"0",
"2",
"4",
"6",
"8",
"10",
"12",
"14",
"15",
"16",
"18"
]
},
{
"trainNo": "40044",
"train": "PVMSBLOCALMTuWThFSa",
"fulltrainname": "Pallavaram LOCAL",
"stations": [
"PV",
"TLM",
"MN",
"PZA",
"STM",
"GDY",
"SP",
"MBM",
"MKK",
"NBK",
"MSC",
"MS",
"MPK",
"MSF",
"MSB"
],
"timeDifferenceFromSource": [
0,
2,
5,
8,
11,
14,
17,
20,
22,
24,
27,
30,
33,
36,
44
],
"actualtimeDifferenceFromSource": [
0,
2,
3,
3,
3,
3,
3,
3,
2,
2,
3,
3,
3,
3,
8
],
"startingTime": [
[
"09",
"03"
]
],
"runday": [
"M",
"Tu",
"W",
"Th",
"F",
"Sa"
],
"distance": [
"0",
"8",
"9",
"10",
"12",
"14",
"16",
"18",
"19",
"21",
"23",
"25",
"26",
"27",
"29"
]
},
{
"trainNo": "40802",
"train": "CJMSBLOCALMTuWThFSa",
"fulltrainname": "Kanchipuram LOCAL",
"stations": [
"CJ",
"CGL",
"TBM",
"TBMS",
"CMP",
"PV",
"TLM",
"MN",
"PZA",
"STM",
"GDY",
"SP",
"MBM",
"MKK",
"NBK",
"MSC",
"MS",
"MPK",
"MSF",
"MSB"
],
"timeDifferenceFromSource": [
0,
50,
101,
105,
108,
111,
114,
116,
119,
122,
125,
128,
131,
133,
135,
138,
141,
144,
147,
157
],
"actualtimeDifferenceFromSource": [
0,
50,
51,
4,
3,
3,
3,
2,
3,
3,
3,
3,
3,
2,
2,
3,
3,
3,
3,
10
],
"startingTime": [
[
"09",
"00"
],
[
"19",
"10"
]
],
"runday": [
"M",
"Tu",
"W",
"Th",
"F",
"Sa"
],
"distance": [
"0",
"36",
"67",
"69",
"71",
"73",
"75",
"76",
"77",
"79",
"81",
"83",
"85",
"87",
"89",
"91",
"93",
"94",
"95",
"97"
]
},
{
"trainNo": "66044",
"train": "MLMRMSBMEMUDaily",
"fulltrainname": "Melmaruvathur MEMU",
"stations": [
"MLMR",
"MMK",
"KGZ",
"OV",
"CGL",
"PWU",
"SKL",
"MMNK",
"CTM",
"POTI",
"GI",
"UPM",
"VDR",
"PRGL",
"TBM",
"CMP",
"STM",
"GDY",
"MBM",
"MS",
"MPK",
"MSF",
"MSB"
],
"timeDifferenceFromSource": [
0,
11,
19,
29,
38,
44,
49,
54,
57,
60,
64,
68,
72,
75,
85,
94,
104,
109,
114,
122,
125,
128,
140
],
"actualtimeDifferenceFromSource": [
0,
11,
8,
10,
9,
6,
5,
5,
3,
3,
4,
4,
4,
3,
10,
9,
10,
5,
5,
8,
3,
3,
12
],
"startingTime": [
[
"15",
"30"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"11",
"14",
"27",
"36",
"40",
"44",
"48",
"50",
"51",
"55",
"58",
"61",
"63",
"66",
"70",
"78",
"80",
"84",
"91",
"92",
"93",
"95"
]
},
{
"trainNo": "41092",
"train": "VLCYMSBLADIESSPLMTuWThFSa",
"fulltrainname": "Velachery LADIES",
"stations": [
"VLCY",
"PRGD",
"TRMN",
"TYMR",
"INDR",
"KTBR",
"KTPM",
"GWYR",
"MNDY",
"MTMY",
"MLHS",
"MTCN",
"MCPK",
"MCPT",
"MPKT",
"MSF",
"MSB"
],
"timeDifferenceFromSource": [
0,
2,
4,
7,
8,
10,
12,
14,
16,
18,
23,
25,
27,
29,
31,
33,
45
],
"actualtimeDifferenceFromSource": [
0,
2,
2,
3,
1,
2,
2,
2,
2,
2,
5,
2,
2,
2,
2,
2,
12
],
"startingTime": [
[
"17",
"05"
]
],
"runday": [
"M",
"Tu",
"W",
"Th",
"F",
"Sa"
],
"distance": [
"0",
"2",
"3",
"5",
"6",
"6",
"7",
"8",
"10",
"11",
"12",
"14",
"14",
"16",
"17",
"18",
"19"
]
},
{
"trainNo": "42002",
"train": "GPDMASLOCALDaily",
"fulltrainname": "Gummidipundi LOCAL",
"stations": [
"GPD",
"KVP",
"PON",
"APB",
"MJR",
"NPKM",
"AIP",
"AIPP",
"ENR",
"KAVM",
"WCN",
"TVT",
"VOC",
"TNP",
"KOK",
"BBQ",
"MAS"
],
"timeDifferenceFromSource": [
0,
6,
15,
23,
27,
30,
32,
35,
39,
41,
44,
48,
51,
53,
55,
60,
85
],
"actualtimeDifferenceFromSource": [
0,
6,
9,
8,
4,
3,
2,
3,
4,
2,
3,
4,
3,
2,
2,
5,
25
],
"startingTime": [
[
"02",
"45"
],
[
"04",
"00"
],
[
"04",
"55"
],
[
"05",
"20"
],
[
"05",
"50"
],
[
"07",
"05"
],
[
"07",
"55"
],
[
"08",
"25"
],
[
"09",
"30"
],
[
"10",
"50"
],
[
"11",
"20"
],
[
"13",
"00"
],
[
"13",
"35"
],
[
"14",
"45"
],
[
"15",
"15"
],
[
"15",
"40"
],
[
"17",
"00"
],
[
"17",
"30"
],
[
"18",
"15"
],
[
"18",
"40"
],
[
"19",
"30"
],
[
"20",
"00"
],
[
"21",
"45"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"6",
"13",
"17",
"21",
"24",
"25",
"27",
"31",
"33",
"36",
"38",
"40",
"42",
"43",
"45",
"47"
]
},
{
"trainNo": "43102",
"train": "PRESMASLOCALDaily",
"fulltrainname": "Pattabiram E Depot LOCAL",
"stations": [
"PRES",
"PAB",
"HC",
"AVD",
"ANNR",
"TMVL",
"ABU",
"PVM",
"KOTR",
"VLK",
"PEW",
"PCW",
"PER",
"VJM",
"BBQ",
"MAS"
],
"timeDifferenceFromSource": [
0,
8,
11,
15,
19,
22,
25,
28,
31,
35,
38,
40,
42,
44,
47,
75
],
"actualtimeDifferenceFromSource": [
0,
8,
3,
4,
4,
3,
3,
3,
3,
4,
3,
2,
2,
2,
3,
28
],
"startingTime": [
[
"03",
"20"
],
[
"05",
"30"
],
[
"06",
"45"
],
[
"07",
"40"
],
[
"10",
"25"
],
[
"11",
"25"
],
[
"12",
"50"
],
[
"13",
"35"
],
[
"14",
"15"
],
[
"15",
"10"
],
[
"16",
"25"
],
[
"17",
"20"
],
[
"18",
"35"
],
[
"19",
"35"
],
[
"21",
"45"
],
[
"22",
"35"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"6",
"7",
"10",
"13",
"14",
"16",
"17",
"19",
"22",
"23",
"25",
"26",
"27",
"29",
"31"
]
},
{
"trainNo": "43002",
"train": "AVDMASLOCALDaily",
"fulltrainname": "Avadi LOCAL",
"stations": [
"AVD",
"ANNR",
"TMVL",
"ABU",
"PVM",
"KOTR",
"VLK",
"PEW",
"PCW",
"PER",
"VJM",
"BBQ",
"MAS"
],
"timeDifferenceFromSource": [
0,
3,
6,
9,
12,
15,
19,
22,
24,
26,
28,
31,
40
],
"actualtimeDifferenceFromSource": [
0,
3,
3,
3,
3,
3,
4,
3,
2,
2,
2,
3,
9
],
"startingTime": [
[
"04",
"00"
],
[
"04",
"40"
],
[
"05",
"10"
],
[
"05",
"25"
],
[
"06",
"15"
],
[
"06",
"40"
],
[
"09",
"10"
],
[
"09",
"50"
],
[
"11",
"05"
],
[
"13",
"25"
],
[
"17",
"10"
],
[
"18",
"20"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"3",
"4",
"6",
"7",
"9",
"12",
"13",
"15",
"16",
"17",
"19",
"21"
]
},
{
"trainNo": "43202",
"train": "TRLMASLOCALDaily",
"fulltrainname": "Tiruvallur LOCAL",
"stations": [
"TRL",
"PTLR",
"SVR",
"VEU",
"TI",
"NEC",
"PAB",
"HC",
"AVD",
"ANNR",
"TMVL",
"ABU",
"PVM",
"KOTR",
"VLK",
"PEW",
"PCW",
"PER",
"VJM",
"BBQ",
"MAS"
],
"timeDifferenceFromSource": [
0,
3,
6,
9,
14,
17,
21,
23,
27,
31,
34,
37,
40,
43,
47,
50,
52,
54,
56,
59,
75
],
"actualtimeDifferenceFromSource": [
0,
3,
3,
3,
5,
3,
4,
2,
4,
4,
3,
3,
3,
3,
4,
3,
2,
2,
2,
3,
16
],
"startingTime": [
[
"03",
"50"
],
[
"05",
"30"
],
[
"06",
"00"
],
[
"06",
"45"
],
[
"07",
"15"
],
[
"07",
"50"
],
[
"08",
"10"
],
[
"08",
"30"
],
[
"09",
"10"
],
[
"10",
"00"
],
[
"10",
"55"
],
[
"11",
"25"
],
[
"12",
"00"
],
[
"13",
"05"
],
[
"14",
"45"
],
[
"15",
"10"
],
[
"15",
"40"
],
[
"16",
"05"
],
[
"16",
"45"
],
[
"17",
"00"
],
[
"17",
"20"
],
[
"18",
"10"
],
[
"18",
"55"
],
[
"19",
"35"
],
[
"20",
"00"
],
[
"20",
"40"
],
[
"20",
"50"
],
[
"21",
"45"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"3",
"6",
"9",
"13",
"14",
"17",
"18",
"21",
"23",
"24",
"26",
"28",
"30",
"32",
"34",
"36",
"36",
"38",
"40",
"42"
]
},
{
"trainNo": "43402",
"train": "AJJMASLOCALDaily",
"fulltrainname": "Arakkonam LOCAL",
"stations": [
"AJJ",
"PLMG",
"MSU",
"TO",
"MAF",
"SPAM",
"KBT",
"EGT",
"TRL",
"PTLR",
"SVR",
"VEU",
"TI",
"NEC",
"PAB",
"HC",
"AVD",
"ANNR",
"TMVL",
"ABU",
"PVM",
"KOTR",
"VLK",
"PEW",
"PCW",
"PER",
"VJM",
"BBQ",
"MAS"
],
"timeDifferenceFromSource": [
0,
4,
7,
12,
17,
21,
25,
29,
34,
38,
41,
44,
49,
52,
56,
58,
62,
66,
69,
72,
75,
78,
82,
85,
87,
89,
91,
94,
115
],
"actualtimeDifferenceFromSource": [
0,
4,
3,
5,
5,
4,
4,
4,
5,
4,
3,
3,
5,
3,
4,
2,
4,
4,
3,
3,
3,
3,
4,
3,
2,
2,
2,
3,
21
],
"startingTime": [
[
"03",
"45"
],
[
"04",
"30"
],
[
"05",
"15"
],
[
"08",
"10"
],
[
"08",
"50"
],
[
"10",
"50"
],
[
"12",
"00"
],
[
"13",
"50"
],
[
"15",
"40"
],
[
"17",
"00"
],
[
"18",
"00"
],
[
"18",
"50"
],
[
"19",
"30"
],
[
"19",
"55"
],
[
"20",
"25"
],
[
"21",
"20"
],
[
"21",
"40"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"2",
"5",
"10",
"15",
"18",
"21",
"24",
"27",
"30",
"33",
"36",
"40",
"41",
"44",
"45",
"48",
"50",
"52",
"53",
"55",
"57",
"59",
"61",
"62",
"63",
"65",
"67",
"69"
]
},
{
"trainNo": "43902",
"train": "KBTMASLOCALDaily",
"fulltrainname": "Kadambattur LOCAL",
"stations": [
"KBT",
"EGT",
"TRL",
"PTLR",
"SVR",
"VEU",
"TI",
"NEC",
"PAB",
"HC",
"AVD",
"ANNR",
"TMVL",
"ABU",
"PVM",
"KOTR",
"VLK",
"PEW",
"PCW",
"PER",
"VJM",
"BBQ",
"MAS"
],
"timeDifferenceFromSource": [
0,
3,
8,
12,
15,
18,
23,
27,
30,
32,
36,
40,
43,
46,
49,
52,
56,
59,
61,
63,
65,
68,
85
],
"actualtimeDifferenceFromSource": [
0,
3,
5,
4,
3,
3,
5,
4,
3,
2,
4,
4,
3,
3,
3,
3,
4,
3,
2,
2,
2,
3,
17
],
"startingTime": [
[
"06",
"10"
],
[
"13",
"35"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"2",
"6",
"8",
"11",
"15",
"18",
"20",
"22",
"23",
"26",
"29",
"30",
"32",
"33",
"35",
"38",
"40",
"41",
"42",
"43",
"45",
"47"
]
},
{
"trainNo": "42402",
"train": "SPEMASLOCALDaily",
"fulltrainname": "Sullurupeta LOCAL",
"stations": [
"SPE",
"TADA",
"AKM",
"ELR",
"GPD",
"KVP",
"PON",
"APB",
"MJR",
"NPKM",
"AIP",
"AIPP",
"ENR",
"KAVM",
"WCN",
"TVT",
"VOC",
"TNP",
"KOK",
"BBQ",
"MAS"
],
"timeDifferenceFromSource": [
0,
13,
20,
29,
39,
46,
55,
63,
67,
70,
72,
75,
79,
81,
84,
88,
91,
93,
95,
100,
120
],
"actualtimeDifferenceFromSource": [
0,
13,
7,
9,
10,
7,
9,
8,
4,
3,
2,
3,
4,
2,
3,
4,
3,
2,
2,
5,
20
],
"startingTime": [
[
"05",
"40"
],
[
"09",
"45"
],
[
"11",
"10"
],
[
"12",
"00"
],
[
"13",
"30"
],
[
"15",
"15"
],
[
"18",
"15"
],
[
"19",
"55"
],
[
"20",
"20"
],
[
"21",
"40"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"12",
"20",
"30",
"35",
"41",
"48",
"53",
"57",
"59",
"60",
"62",
"66",
"68",
"71",
"74",
"76",
"77",
"78",
"80",
"83"
]
},
{
"trainNo": "43502",
"train": "TRTMASLOCALDaily",
"fulltrainname": "Tiruttani LOCAL",
"stations": [
"TRT",
"AJJ",
"PLMG",
"MSU",
"TO",
"MAF",
"SPAM",
"KBT",
"EGT",
"TRL",
"PTLR",
"SVR",
"VEU",
"TI",
"NEC",
"PAB",
"HC",
"AVD",
"ANNR",
"TMVL",
"ABU",
"PVM",
"KOTR",
"VLK",
"PEW",
"PCW",
"PER",
"VJM",
"BBQ",
"MAS"
],
"timeDifferenceFromSource": [
0,
19,
24,
27,
32,
37,
41,
45,
49,
54,
58,
61,
64,
69,
72,
76,
78,
84,
88,
91,
94,
97,
100,
104,
107,
109,
111,
113,
116,
130
],
"actualtimeDifferenceFromSource": [
0,
19,
5,
3,
5,
5,
4,
4,
4,
5,
4,
3,
3,
5,
3,
4,
2,
6,
4,
3,
3,
3,
3,
4,
3,
2,
2,
2,
3,
14
],
"startingTime": [
[
"05",
"40"
],
[
"06",
"25"
],
[
"09",
"40"
],
[
"13",
"10"
],
[
"14",
"30"
],
[
"15",
"30"
],
[
"17",
"00"
],
[
"18",
"05"
],
[
"20",
"20"
],
[
"21",
"40"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"14",
"16",
"19",
"25",
"29",
"33",
"36",
"38",
"41",
"44",
"47",
"51",
"54",
"56",
"58",
"59",
"62",
"64",
"66",
"67",
"69",
"71",
"74",
"75",
"77",
"77",
"79",
"81",
"83"
]
},
{
"trainNo": "43408",
"train": "AJJMASFASTDaily",
"fulltrainname": "Arakkonam FAST",
"stations": [
"AJJ",
"PLMG",
"MSU",
"TO",
"MAF",
"SPAM",
"KBT",
"EGT",
"TRL",
"SVR",
"VLK",
"PER",
"BBQ",
"MAS"
],
"timeDifferenceFromSource": [
0,
4,
7,
12,
17,
21,
25,
29,
33,
36,
62,
67,
74,
95
],
"actualtimeDifferenceFromSource": [
0,
4,
3,
5,
5,
4,
4,
4,
4,
3,
26,
5,
7,
21
],
"startingTime": [
[
"06",
"40"
],
[
"07",
"10"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"2",
"5",
"10",
"15",
"18",
"21",
"24",
"27",
"33",
"59",
"63",
"67",
"69"
]
},
{
"trainNo": "42404",
"train": "SPMMASLOCALDaily",
"fulltrainname": "Sullurupeta LOCAL",
"stations": [
"SPE",
"TADA",
"AKM",
"ELR",
"GPD",
"KVP",
"PON",
"APB",
"MJR",
"NPKM",
"AIP",
"AIPP",
"ENR",
"KAVM",
"WCN",
"TVT",
"VOC",
"TNP",
"KOK",
"BBQ",
"MAS"
],
"timeDifferenceFromSource": [
0,
13,
20,
29,
39,
46,
55,
63,
67,
70,
72,
75,
79,
81,
84,
88,
91,
93,
95,
100,
125
],
"actualtimeDifferenceFromSource": [
0,
13,
7,
9,
10,
7,
9,
8,
4,
3,
2,
3,
4,
2,
3,
4,
3,
2,
2,
5,
25
],
"startingTime": [
[
"06",
"40"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"12",
"20",
"30",
"35",
"41",
"48",
"53",
"57",
"59",
"60",
"62",
"66",
"68",
"71",
"74",
"76",
"77",
"78",
"80",
"83"
]
},
{
"trainNo": "42302",
"train": "PONMASLOCALDaily",
"fulltrainname": "Ponneri LOCAL",
"stations": [
"PON",
"APB",
"MJR",
"NPKM",
"AIP",
"AIPP",
"ENR",
"KAVM",
"WCN",
"TVT",
"VOC",
"TNP",
"KOK",
"BBQ",
"MAS"
],
"timeDifferenceFromSource": [
0,
7,
11,
14,
16,
19,
23,
25,
28,
32,
35,
37,
39,
44,
75
],
"actualtimeDifferenceFromSource": [
0,
7,
4,
3,
2,
3,
4,
2,
3,
4,
3,
2,
2,
5,
31
],
"startingTime": [
[
"08",
"00"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"5",
"9",
"11",
"13",
"14",
"19",
"20",
"23",
"26",
"28",
"29",
"31",
"33",
"35"
]
},
{
"trainNo": "66022",
"train": "TPTYMASMEMUDaily",
"fulltrainname": "Tirupati MEMU",
"stations": [
"TPTY",
"RU",
"PUDI",
"TDK",
"PUT",
"VGA",
"EKM",
"NG",
"VKZ",
"POI",
"TRT",
"AJJ",
"PLMG",
"MSU",
"TO",
"MAF",
"SPAM",
"KBT",
"EGT",
"TRL",
"PTLR",
"SVR",
"VEU",
"TI",
"NEC",
"PAB",
"HC",
"AVD",
"ANNR",
"TMVL",
"ABU",
"PVM",
"KOTR",
"VLK",
"PEW",
"PCW",
"PER",
"VJM",
"BBQ",
"MAS"
],
"timeDifferenceFromSource": [
0,
20,
34,
46,
56,
66,
73,
77,
84,
90,
109,
128,
134,
137,
142,
147,
151,
155,
159,
164,
168,
171,
174,
179,
182,
186,
188,
192,
196,
199,
202,
205,
208,
212,
215,
217,
219,
221,
224,
240
],
"actualtimeDifferenceFromSource": [
0,
20,
14,
12,
10,
10,
7,
4,
7,
6,
19,
19,
6,
3,
5,
5,
4,
4,
4,
5,
4,
3,
3,
5,
3,
4,
2,
4,
4,
3,
3,
3,
3,
4,
3,
2,
2,
2,
3,
16
],
"startingTime": [
[
"05",
"10"
],
[
"16",
"10"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"10",
"19",
"29",
"36",
"43",
"50",
"51",
"55",
"61",
"68",
"82",
"84",
"87",
"92",
"97",
"100",
"103",
"106",
"109",
"112",
"115",
"118",
"122",
"123",
"126",
"127",
"130",
"132",
"133",
"135",
"137",
"139",
"141",
"143",
"144",
"145",
"147",
"149",
"151"
]
},
{
"trainNo": "43882",
"train": "TIMASLOCALDaily",
"fulltrainname": "Tiruninravur LOCAL",
"stations": [
"TI",
"NEC",
"PAB",
"HC",
"AVD",
"ANNR",
"TMVL",
"ABU",
"PVM",
"KOTR",
"VLK",
"PEW",
"PCW",
"PER",
"VJM",
"BBQ",
"MAS"
],
"timeDifferenceFromSource": [
0,
2,
6,
8,
12,
16,
19,
22,
25,
28,
32,
35,
37,
39,
41,
44,
60
],
"actualtimeDifferenceFromSource": [
0,
2,
4,
2,
4,
4,
3,
3,
3,
3,
4,
3,
2,
2,
2,
3,
16
],
"startingTime": [
[
"08",
"15"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"2",
"4",
"5",
"8",
"11",
"12",
"14",
"15",
"17",
"20",
"21",
"23",
"24",
"25",
"27",
"29"
]
},
{
"trainNo": "43216",
"train": "TRLMASFASTDaily",
"fulltrainname": "Tiruvallur FAST",
"stations": [
"TRL",
"TI",
"VLK",
"PER",
"BBQ",
"MAS"
],
"timeDifferenceFromSource": [
0,
11,
31,
36,
42,
60
],
"actualtimeDifferenceFromSource": [
0,
11,
20,
5,
6,
18
],
"startingTime": [
[
"08",
"20"
],
[
"09",
"25"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"13",
"32",
"36",
"40",
"42"
]
},
{
"trainNo": "43872",
"train": "PABMASLOCALDaily",
"fulltrainname": "Pattabiram LOCAL",
"stations": [
"PAB",
"HC",
"AVD",
"ANNR",
"TMVL",
"ABU",
"PVM",
"KOTR",
"VLK",
"PEW",
"PCW",
"PER",
"VJM",
"BBQ",
"MAS"
],
"timeDifferenceFromSource": [
0,
2,
6,
10,
13,
16,
19,
22,
26,
29,
31,
33,
35,
38,
58
],
"actualtimeDifferenceFromSource": [
0,
2,
4,
4,
3,
3,
3,
3,
4,
3,
2,
2,
2,
3,
20
],
"startingTime": [
[
"08",
"42"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"1",
"4",
"7",
"8",
"10",
"11",
"13",
"16",
"17",
"19",
"20",
"21",
"23",
"25"
]
},
{
"trainNo": "57240",
"train": "BTTRMASPASSDaily",
"fulltrainname": "Bitragunta PASS",
"stations": [
"GS",
"1"
],
"timeDifferenceFromSource": [
0,
null
],
"actualtimeDifferenceFromSource": [
0,
null
],
"startingTime": [
[
"05",
"15"
]
],
"runday": [
"Daily"
],
"distance": [
"GS",
"7"
]
},
{
"trainNo": "66036",
"train": "NLRMASMEMUDaily",
"fulltrainname": "Nellore MEMU",
"stations": [
"NLR",
"NLS",
"VDE",
"VKT",
"MBL",
"GDR",
"ODUR",
"PYA",
"NYP",
"DVR",
"PEL",
"SPE",
"AKAT",
"TADA",
"AKM",
"ELR",
"GPD",
"KVP",
"PON",
"APB",
"MJR",
"NPKM",
"AIP",
"AIPP",
"ENR",
"KAVM",
"WCN",
"TVT",
"VOC",
"TNP",
"KOK",
"BBQ",
"MAS"
],
"timeDifferenceFromSource": [
0,
3,
10,
19,
31,
55,
69,
75,
87,
99,
109,
140,
161,
168,
175,
184,
193,
201,
210,
218,
222,
225,
227,
230,
234,
236,
239,
243,
246,
248,
250,
255,
285
],
"actualtimeDifferenceFromSource": [
0,
3,
7,
9,
12,
24,
14,
6,
12,
12,
10,
31,
21,
7,
7,
9,
9,
8,
9,
8,
4,
3,
2,
3,
4,
2,
3,
4,
3,
2,
2,
5,
30
],
"startingTime": [
[
"16",
"00"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"2",
"7",
"16",
"28",
"37",
"46",
"52",
"65",
"77",
"84",
"92",
"97",
"104",
"111",
"121",
"127",
"133",
"140",
"145",
"149",
"152",
"153",
"155",
"159",
"161",
"164",
"167",
"169",
"171",
"172",
"174",
"176"
]
},
{
"trainNo": "40501",
"train": "MSBCGLLOCALMTuWThFSa",
"fulltrainname": "Chennai Beach LOCAL",
"stations": [
"MSB",
"MSF",
"MPK",
"MS",
"MSC",
"NBK",
"MKK",
"MBM",
"SP",
"GDY",
"STM",
"PZA",
"MN",
"TLM",
"PV",
"CMP",
"TBMS",
"TBM",
"PRGL",
"VDR",
"UPM",
"GI",
"POTI",
"CTM",
"MMNK",
"SKL",
"PWU",
"CGL"
],
"timeDifferenceFromSource": [
0,
3,
6,
9,
12,
15,
17,
19,
22,
25,
28,
31,
34,
36,
39,
42,
45,
54,
59,
62,
66,
70,
74,
77,
79,
84,
89,
100
],
"actualtimeDifferenceFromSource": [
0,
3,
3,
3,
3,
3,
2,
2,
3,
3,
3,
3,
3,
2,
3,
3,
3,
9,
5,
3,
4,
4,
4,
3,
2,
5,
5,
11
],
"startingTime": [
[
"03",
"55"
],
[
"04",
"40"
],
[
"05",
"00"
],
[
"05",
"20"
],
[
"06",
"10"
],
[
"06",
"30"
],
[
"06",
"45"
],
[
"06",
"55"
],
[
"07",
"38"
],
[
"08",
"17"
],
[
"08",
"56"
],
[
"09",
"32"
],
[
"10",
"14"
],
[
"11",
"02"
],
[
"11",
"55"
],
[
"12",
"30"
],
[
"13",
"09"
],
[
"13",
"25"
],
[
"13",
"47"
],
[
"14",
"13"
],
[
"14",
"47"
],
[
"15",
"35"
],
[
"16",
"15"
],
[
"16",
"32"
],
[
"16",
"50"
],
[
"17",
"10"
],
[
"17",
"38"
],
[
"18",
"07"
],
[
"18",
"40"
],
[
"19",
"32"
],
[
"19",
"56"
],
[
"20",
"52"
],
[
"21",
"20"
],
[
"21",
"45"
],
[
"22",
"45"
]
],
"runday": [
"M",
"Tu",
"W",
"Th",
"F",
"Sa"
],
"distance": [
"0",
"2",
"3",
"4",
"6",
"8",
"10",
"11",
"13",
"15",
"17",
"19",
"20",
"21",
"23",
"25",
"27",
"29",
"32",
"34",
"37",
"40",
"44",
"46",
"47",
"51",
"55",
"60"
]
},
{
"trainNo": "40601",
"train": "MSBCGLLOCALSu",
"fulltrainname": "Chennai Beach LOCAL",
"stations": [
"MSB",
"MSF",
"MPK",
"MS",
"MSC",
"NBK",
"MKK",
"MBM",
"SP",
"GDY",
"STM",
"PZA",
"MN",
"TLM",
"PV",
"CMP",
"TBMS",
"TBM",
"PRGL",
"VDR",
"UPM",
"GI",
"POTI",
"CTM",
"MMNK",
"SKL",
"PWU",
"CGL"
],
"timeDifferenceFromSource": [
0,
3,
6,
9,
12,
15,
17,
19,
22,
25,
28,
31,
34,
36,
39,
42,
45,
54,
59,
62,
66,
70,
74,
77,
79,
84,
89,
105
],
"actualtimeDifferenceFromSource": [
0,
3,
3,
3,
3,
3,
2,
2,
3,
3,
3,
3,
3,
2,
3,
3,
3,
9,
5,
3,
4,
4,
4,
3,
2,
5,
5,
16
],
"startingTime": [
[
"03",
"55"
],
[
"04",
"40"
],
[
"05",
"00"
],
[
"05",
"20"
],
[
"05",
"40"
],
[
"06",
"30"
],
[
"06",
"45"
],
[
"07",
"45"
],
[
"09",
"00"
],
[
"09",
"35"
],
[
"10",
"15"
],
[
"11",
"00"
],
[
"12",
"00"
],
[
"12",
"30"
],
[
"13",
"15"
],
[
"13",
"45"
],
[
"14",
"15"
],
[
"14",
"45"
],
[
"15",
"40"
],
[
"16",
"10"
],
[
"16",
"50"
],
[
"17",
"10"
],
[
"17",
"40"
],
[
"18",
"00"
],
[
"18",
"30"
],
[
"18",
"50"
],
[
"19",
"40"
],
[
"20",
"10"
],
[
"20",
"40"
],
[
"21",
"30"
],
[
"21",
"45"
],
[
"22",
"50"
]
],
"runday": [
"Su"
],
"distance": [
"0",
"2",
"3",
"4",
"6",
"8",
"10",
"11",
"13",
"15",
"17",
"19",
"20",
"21",
"23",
"25",
"27",
"29",
"32",
"34",
"37",
"40",
"44",
"46",
"47",
"51",
"55",
"60"
]
},
{
"trainNo": "41001",
"train": "MSBVLCYLOCALMTuWThFSa",
"fulltrainname": "Chennai Beach LOCAL",
"stations": [
"MSB",
"MSF",
"MPKT",
"MCPT",
"MCPK",
"MTCN",
"MLHS",
"MTMY",
"MNDY",
"GWYR",
"KTPM",
"KTBR",
"INDR",
"TYMR",
"TRMN",
"PRGD",
"VLCY"
],
"timeDifferenceFromSource": [
0,
3,
5,
7,
9,
11,
13,
18,
20,
22,
24,
26,
28,
29,
32,
34,
45
],
"actualtimeDifferenceFromSource": [
0,
3,
2,
2,
2,
2,
2,
5,
2,
2,
2,
2,
2,
1,
3,
2,
11
],
"startingTime": [
[
"04",
"10"
],
[
"04",
"40"
],
[
"05",
"10"
],
[
"05",
"30"
],
[
"05",
"50"
],
[
"06",
"05"
],
[
"06",
"20"
],
[
"06",
"40"
],
[
"06",
"55"
],
[
"07",
"15"
],
[
"07",
"30"
],
[
"07",
"45"
],
[
"08",
"00"
],
[
"08",
"15"
],
[
"08",
"25"
],
[
"08",
"35"
],
[
"08",
"45"
],
[
"08",
"55"
],
[
"09",
"05"
],
[
"09",
"15"
],
[
"09",
"35"
],
[
"09",
"45"
],
[
"09",
"55"
],
[
"10",
"05"
],
[
"10",
"15"
],
[
"10",
"30"
],
[
"10",
"45"
],
[
"11",
"00"
],
[
"11",
"15"
],
[
"11",
"30"
],
[
"11",
"45"
],
[
"12",
"05"
],
[
"12",
"25"
],
[
"12",
"45"
],
[
"13",
"05"
],
[
"13",
"25"
],
[
"13",
"45"
],
[
"14",
"05"
],
[
"14",
"25"
],
[
"14",
"45"
],
[
"15",
"05"
],
[
"15",
"25"
],
[
"15",
"45"
],
[
"16",
"00"
],
[
"16",
"15"
],
[
"16",
"30"
],
[
"16",
"45"
],
[
"17",
"00"
],
[
"17",
"15"
],
[
"17",
"30"
],
[
"17",
"40"
],
[
"17",
"50"
],
[
"18",
"00"
],
[
"18",
"15"
],
[
"18",
"25"
],
[
"18",
"35"
],
[
"18",
"45"
],
[
"18",
"55"
],
[
"19",
"10"
],
[
"19",
"25"
],
[
"19",
"40"
],
[
"20",
"00"
],
[
"20",
"20"
],
[
"20",
"40"
],
[
"21",
"00"
],
[
"21",
"20"
],
[
"21",
"40"
],
[
"22",
"00"
],
[
"22",
"20"
]
],
"runday": [
"M",
"Tu",
"W",
"Th",
"F",
"Sa"
],
"distance": [
"0",
"2",
"3",
"4",
"5",
"6",
"7",
"9",
"10",
"11",
"12",
"13",
"14",
"15",
"17",
"18",
"19"
]
},
{
"trainNo": "40301",
"train": "MSBTBMLOCALSu",
"fulltrainname": "Chennai Beach LOCAL",
"stations": [
"MSB",
"MSF",
"MPK",
"MS",
"MSC",
"NBK",
"MKK",
"MBM",
"SP",
"GDY",
"STM",
"PZA",
"MN",
"TLM",
"PV",
"CMP",
"TBMS",
"TBM"
],
"timeDifferenceFromSource": [
0,
3,
6,
9,
12,
15,
17,
19,
22,
25,
28,
31,
34,
36,
39,
42,
45,
55
],
"actualtimeDifferenceFromSource": [
0,
3,
3,
3,
3,
3,
2,
2,
3,
3,
3,
3,
3,
2,
3,
3,
3,
10
],
"startingTime": [
[
"04",
"15"
],
[
"06",
"00"
],
[
"06",
"15"
],
[
"06",
"55"
],
[
"07",
"15"
],
[
"07",
"25"
],
[
"07",
"35"
],
[
"08",
"00"
],
[
"08",
"15"
],
[
"08",
"40"
],
[
"08",
"50"
],
[
"09",
"12"
],
[
"09",
"25"
],
[
"09",
"42"
],
[
"10",
"00"
],
[
"10",
"20"
],
[
"10",
"30"
],
[
"10",
"40"
],
[
"10",
"45"
],
[
"11",
"10"
],
[
"11",
"20"
],
[
"11",
"30"
],
[
"11",
"40"
],
[
"11",
"50"
],
[
"12",
"10"
],
[
"12",
"20"
],
[
"12",
"40"
],
[
"12",
"50"
],
[
"13",
"00"
],
[
"13",
"30"
],
[
"14",
"00"
],
[
"14",
"30"
],
[
"15",
"00"
],
[
"15",
"15"
],
[
"15",
"30"
],
[
"15",
"50"
],
[
"16",
"00"
],
[
"16",
"20"
],
[
"16",
"30"
],
[
"16",
"40"
],
[
"17",
"00"
],
[
"17",
"20"
],
[
"17",
"30"
],
[
"17",
"50"
],
[
"18",
"20"
],
[
"18",
"40"
],
[
"19",
"00"
],
[
"19",
"20"
],
[
"19",
"30"
],
[
"19",
"50"
],
[
"20",
"00"
],
[
"20",
"15"
],
[
"20",
"30"
],
[
"20",
"50"
],
[
"21",
"00"
],
[
"21",
"15"
],
[
"22",
"00"
],
[
"22",
"15"
],
[
"22",
"30"
],
[
"23",
"20"
],
[
"23",
"59"
]
],
"runday": [
"Su"
],
"distance": [
"0",
"2",
"3",
"4",
"6",
"8",
"10",
"11",
"13",
"15",
"17",
"19",
"20",
"21",
"23",
"25",
"27",
"29"
]
},
{
"trainNo": "40001",
"train": "MSBTBMLOCALMTuWThFSa",
"fulltrainname": "Chennai Beach LOCAL",
"stations": [
"MSB",
"MSF",
"MPK",
"MS",
"MSC",
"NBK",
"MKK",
"MBM",
"SP",
"GDY",
"STM",
"PZA",
"MN",
"TLM",
"PV",
"CMP",
"TBMS",
"TBM"
],
"timeDifferenceFromSource": [
0,
3,
6,
9,
12,
15,
17,
19,
22,
25,
28,
31,
34,
36,
39,
42,
45,
55
],
"actualtimeDifferenceFromSource": [
0,
3,
3,
3,
3,
3,
2,
2,
3,
3,
3,
3,
3,
2,
3,
3,
3,
10
],
"startingTime": [
[
"04",
"20"
],
[
"06",
"00"
],
[
"06",
"20"
],
[
"07",
"15"
],
[
"07",
"22"
],
[
"07",
"30"
],
[
"07",
"47"
],
[
"07",
"57"
],
[
"08",
"05"
],
[
"08",
"12"
],
[
"08",
"32"
],
[
"08",
"40"
],
[
"08",
"47"
],
[
"09",
"02"
],
[
"09",
"08"
],
[
"09",
"14"
],
[
"09",
"20"
],
[
"09",
"26"
],
[
"09",
"38"
],
[
"09",
"44"
],
[
"09",
"56"
],
[
"10",
"02"
],
[
"10",
"08"
],
[
"10",
"20"
],
[
"10",
"26"
],
[
"10",
"32"
],
[
"10",
"38"
],
[
"10",
"44"
],
[
"10",
"56"
],
[
"11",
"10"
],
[
"11",
"20"
],
[
"11",
"30"
],
[
"11",
"37"
],
[
"11",
"45"
],
[
"12",
"10"
],
[
"12",
"20"
],
[
"12",
"43"
],
[
"12",
"56"
],
[
"13",
"22"
],
[
"13",
"35"
],
[
"14",
"01"
],
[
"14",
"23"
],
[
"14",
"32"
],
[
"15",
"02"
],
[
"15",
"15"
],
[
"15",
"45"
],
[
"15",
"55"
],
[
"16",
"05"
],
[
"16",
"23"
],
[
"16",
"40"
],
[
"17",
"00"
],
[
"17",
"20"
],
[
"17",
"30"
],
[
"17",
"46"
],
[
"17",
"53"
],
[
"18",
"00"
],
[
"18",
"20"
],
[
"18",
"27"
],
[
"18",
"48"
],
[
"18",
"55"
],
[
"19",
"02"
],
[
"19",
"16"
],
[
"19",
"24"
],
[
"19",
"40"
],
[
"19",
"48"
],
[
"20",
"04"
],
[
"20",
"12"
],
[
"20",
"28"
],
[
"20",
"36"
],
[
"20",
"44"
],
[
"21",
"00"
],
[
"21",
"10"
],
[
"21",
"30"
],
[
"22",
"05"
],
[
"22",
"15"
],
[
"22",
"25"
],
[
"23",
"05"
],
[
"23",
"30"
],
[
"23",
"59"
]
],
"runday": [
"M",
"Tu",
"W",
"Th",
"F",
"Sa"
],
"distance": [
"0",
"2",
"3",
"4",
"6",
"8",
"10",
"11",
"13",
"15",
"17",
"19",
"20",
"21",
"23",
"25",
"27",
"29"
]
},
{
"trainNo": "40801",
"train": "MSBCJLOCALMTuWThFSa",
"fulltrainname": "Chennai Beach LOCAL",
"stations": [
"MSB",
"MSF",
"MPK",
"MS",
"MSC",
"NBK",
"MKK",
"MBM",
"SP",
"GDY",
"STM",
"PZA",
"MN",
"TLM",
"PV",
"CMP",
"TBMS",
"TBM",
"PRGL",
"VDR",
"UPM",
"GI",
"POTI",
"CTM",
"MMNK",
"SKL",
"PWU",
"CGL",
"CJ"
],
"timeDifferenceFromSource": [
0,
3,
6,
9,
12,
15,
17,
19,
22,
25,
28,
31,
34,
36,
39,
42,
45,
54,
59,
62,
66,
70,
74,
77,
79,
84,
89,
105,
160
],
"actualtimeDifferenceFromSource": [
0,
3,
3,
3,
3,
3,
2,
2,
3,
3,
3,
3,
3,
2,
3,
3,
3,
9,
5,
3,
4,
4,
4,
3,
2,
5,
5,
16,
55
],
"startingTime": [
[
"05",
"40"
],
[
"15",
"25"
]
],
"runday": [
"M",
"Tu",
"W",
"Th",
"F",
"Sa"
],
"distance": [
"0",
"2",
"3",
"4",
"6",
"8",
"10",
"12",
"14",
"16",
"18",
"20",
"21",
"22",
"24",
"26",
"28",
"30",
"34",
"36",
"39",
"42",
"46",
"48",
"49",
"54",
"58",
"62",
"98"
]
},
{
"trainNo": "41501",
"train": "MSBVLCYLOCALSu",
"fulltrainname": "Chennai Beach LOCAL",
"stations": [
"MSB",
"MSF",
"MPKT",
"MCPT",
"MCPK",
"MTCN",
"MLHS",
"MTMY",
"MNDY",
"GWYR",
"KTPM",
"KTBR",
"INDR",
"TYMR",
"TRMN",
"PRGD",
"VLCY"
],
"timeDifferenceFromSource": [
0,
3,
5,
7,
9,
11,
13,
18,
20,
22,
24,
26,
28,
29,
32,
34,
45
],
"actualtimeDifferenceFromSource": [
0,
3,
2,
2,
2,
2,
2,
5,
2,
2,
2,
2,
2,
1,
3,
2,
11
],
"startingTime": [
[
"06",
"00"
],
[
"06",
"20"
],
[
"06",
"40"
],
[
"07",
"00"
],
[
"07",
"20"
],
[
"07",
"40"
],
[
"08",
"00"
],
[
"08",
"20"
],
[
"08",
"40"
],
[
"09",
"00"
],
[
"09",
"20"
],
[
"09",
"40"
],
[
"09",
"50"
],
[
"10",
"00"
],
[
"10",
"20"
],
[
"10",
"40"
],
[
"11",
"00"
],
[
"11",
"20"
],
[
"11",
"40"
],
[
"12",
"00"
],
[
"12",
"20"
],
[
"12",
"40"
],
[
"13",
"00"
],
[
"13",
"20"
],
[
"13",
"40"
],
[
"14",
"00"
],
[
"14",
"20"
],
[
"14",
"40"
],
[
"15",
"00"
],
[
"15",
"20"
],
[
"15",
"40"
],
[
"16",
"00"
],
[
"16",
"20"
],
[
"16",
"40"
],
[
"17",
"00"
],
[
"17",
"20"
],
[
"17",
"40"
],
[
"18",
"00"
],
[
"18",
"20"
],
[
"18",
"40"
],
[
"19",
"00"
],
[
"19",
"20"
],
[
"19",
"40"
],
[
"20",
"00"
],
[
"20",
"20"
],
[
"20",
"40"
],
[
"21",
"00"
],
[
"21",
"20"
],
[
"21",
"40"
],
[
"22",
"00"
],
[
"22",
"20"
]
],
"runday": [
"Su"
],
"distance": [
"0",
"2",
"3",
"4",
"5",
"6",
"7",
"9",
"10",
"11",
"12",
"13",
"14",
"15",
"17",
"18",
"19"
]
},
{
"trainNo": "40701",
"train": "MSBTMLPLOCALDaily",
"fulltrainname": "Chennai Beach LOCAL",
"stations": [
"MSB",
"MSF",
"MPK",
"MS",
"MSC",
"NBK",
"MKK",
"MBM",
"SP",
"GDY",
"STM",
"PZA",
"MN",
"TLM",
"PV",
"CMP",
"TBMS",
"TBM",
"PRGL",
"VDR",
"UPM",
"GI",
"POTI",
"CTM",
"MMNK",
"SKL",
"PWU",
"CGL",
"RDY",
"VB",
"PALR",
"PYV",
"WJ",
"NTT",
"CJE",
"CJ",
"TMLP"
],
"timeDifferenceFromSource": [
0,
3,
6,
9,
13,
16,
18,
20,
23,
26,
29,
32,
35,
37,
40,
43,
46,
54,
59,
62,
66,
70,
74,
77,
79,
84,
89,
100,
111,
116,
121,
125,
132,
141,
146,
148,
180
],
"actualtimeDifferenceFromSource": [
0,
3,
3,
3,
4,
3,
2,
2,
3,
3,
3,
3,
3,
2,
3,
3,
3,
8,
5,
3,
4,
4,
4,
3,
2,
5,
5,
11,
11,
5,
5,
4,
7,
9,
5,
2,
32
],
"startingTime": [
[
"07",
"05"
],
[
"09",
"50"
],
[
"10",
"50"
],
[
"19",
"09"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"2",
"3",
"4",
"6",
"8",
"10",
"11",
"13",
"15",
"17",
"19",
"20",
"21",
"23",
"25",
"27",
"29",
"32",
"34",
"37",
"40",
"44",
"46",
"47",
"51",
"55",
"60",
"64",
"68",
"71",
"74",
"81",
"89",
"94",
"96",
"108"
]
},
{
"trainNo": "40021",
"train": "MSBPVLOCALMTuWThFSa",
"fulltrainname": "Chennai Beach LOCAL",
"stations": [
"MSB",
"MSF",
"MPK",
"MS",
"MSC",
"NBK",
"MKK",
"MBM",
"SP",
"GDY",
"STM",
"PZA",
"MN",
"TLM",
"PV"
],
"timeDifferenceFromSource": [
0,
3,
6,
9,
12,
15,
17,
19,
22,
25,
28,
31,
34,
36,
39
],
"actualtimeDifferenceFromSource": [
0,
3,
3,
3,
3,
3,
2,
2,
3,
3,
3,
3,
3,
2,
3
],
"startingTime": [
[
"08",
"19"
]
],
"runday": [
"M",
"Tu",
"W",
"Th",
"F",
"Sa"
],
"distance": [
"0",
"2",
"3",
"4",
"6",
"8",
"10",
"11",
"13",
"15",
"17",
"19",
"20",
"21",
"23"
]
},
{
"trainNo": "66043",
"train": "MSBMLMRMEMUDaily",
"fulltrainname": "Chennai Beach MEMU",
"stations": [
"MSB",
"MSF",
"MPK",
"MS",
"MSC",
"NBK",
"MKK",
"MBM",
"SP",
"GDY",
"STM",
"PZA",
"MN",
"TLM",
"PV",
"CMP",
"TBMS",
"TBM",
"PRGL",
"VDR",
"UPM",
"GI",
"POTI",
"CTM",
"MMNK",
"SKL",
"PWU",
"CGL",
"OV",
"KGZ",
"MMK",
"MLMR"
],
"timeDifferenceFromSource": [
0,
3,
6,
9,
12,
15,
17,
19,
22,
25,
28,
31,
34,
36,
39,
43,
46,
49,
54,
57,
61,
65,
69,
72,
74,
79,
84,
93,
104,
114,
119,
155
],
"actualtimeDifferenceFromSource": [
0,
3,
3,
3,
3,
3,
2,
2,
3,
3,
3,
3,
3,
2,
3,
4,
3,
3,
5,
3,
4,
4,
4,
3,
2,
5,
5,
9,
11,
10,
5,
36
],
"startingTime": [
[
"08",
"30"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"2",
"3",
"4",
"6",
"8",
"10",
"11",
"13",
"15",
"17",
"19",
"20",
"21",
"23",
"25",
"27",
"29",
"32",
"34",
"37",
"40",
"44",
"46",
"47",
"51",
"55",
"60",
"68",
"81",
"84",
"95"
]
},
{
"trainNo": "41041",
"train": "MSBVLCYLADIESSPLMTuWThFSa",
"fulltrainname": "Chennai Beach LADIES",
"stations": [
"MSB",
"MSF",
"MPKT",
"MCPT",
"MCPK",
"MTCN",
"MLHS",
"MTMY",
"MNDY",
"GWYR",
"KTPM",
"KTBR",
"INDR",
"TYMR",
"TRMN",
"PRGD",
"VLCY"
],
"timeDifferenceFromSource": [
0,
3,
5,
7,
9,
11,
13,
18,
20,
22,
24,
26,
28,
29,
32,
34,
45
],
"actualtimeDifferenceFromSource": [
0,
3,
2,
2,
2,
2,
2,
5,
2,
2,
2,
2,
2,
1,
3,
2,
11
],
"startingTime": [
[
"09",
"25"
]
],
"runday": [
"M",
"Tu",
"W",
"Th",
"F",
"Sa"
],
"distance": [
"0",
"2",
"3",
"4",
"5",
"6",
"7",
"9",
"10",
"11",
"12",
"13",
"14",
"15",
"17",
"18",
"19"
]
},
{
"trainNo": "40707",
"train": "MSBTMLPFASTDaily",
"fulltrainname": "Chennai Beach FAST",
"stations": [
"MSB",
"MSF",
"MPK",
"MS",
"MBM",
"GDY",
"TBM",
"CGL",
"PALR",
"WJ",
"CJE",
"CJ",
"TMLP"
],
"timeDifferenceFromSource": [
0,
3,
6,
11,
18,
23,
39,
72,
86,
96,
106,
108,
142
],
"actualtimeDifferenceFromSource": [
0,
3,
3,
5,
7,
5,
16,
33,
14,
10,
10,
2,
34
],
"startingTime": [
[
"18",
"13"
],
[
"20",
"20"
]
],
"runday": [
"Daily"
],
"distance": [
"0",
"2",
"3",
"4",
"11",
"15",
"29",
"60",
"71",
"81",
"94",
"96",
"108"
]
},
{
"trainNo": "40559",
"train": "MSBCGLFASTMTuWThFSa",
"fulltrainname": "Chennai Beach FAST",
"stations": [
"MSB",
"MSF",
"MPK",
"MS",
"MBM",
"GDY",
"CMP",
"TBM",
"PRGL",
"VDR",
"UPM",
"GI",
"POTI",
"CTM",
"MMNK",
"SKL",
"PWU",
"CGL"
],
"timeDifferenceFromSource": [
0,
3,
6,
11,
18,
23,
32,
41,
46,
49,
53,
57,
61,
64,
66,
71,
76,
97
],
"actualtimeDifferenceFromSource": [
0,
3,
3,
5,
7,
5,
9,
9,
5,
3,
4,
4,
4,
3,
2,
5,
5,
21
],
"startingTime": [
[
"18",
"33"
]
],
"runday": [
"M",
"Tu",
"W",
"Th",
"F",
"Sa"
],
"distance": [
"0",
"2",
"3",
"4",
"11",
"15",
"10",
"11",
"18",
"20",
"23",
"26",
"30",
"32",
"33",
"37",
"41",
"46"
]
}];
|
/**
* Wrapper for noteOnEvent/noteOffEvent objects that builds both events.
* @param {object} fields - {pitch: '[C4]', duration: '4', wait: '4', velocity: 1-100}
* @return {NoteEvent}
*/
class NoteEvent {
constructor(fields) {
this.type = 'note';
this.pitch = fields.pitch;
this.wait = fields.wait || 0;
this.duration = fields.duration;
this.sequential = fields.sequential || false;
this.velocity = fields.velocity || 50;
this.channel = fields.channel || 1;
this.repeat = fields.repeat || 1;
this.velocity = this.convertVelocity(this.velocity);
this.buildData();
}
/**
* Builds int array for this event.
* @return {NoteEvent}
*/
buildData() {
this.data = [];
var tickDuration = this.getTickDuration(this.duration, 'note');
var restDuration = this.getTickDuration(this.wait, 'rest');
// fields.pitch could be an array of pitches.
// If so create note events for each and apply the same duration.
var noteOn, noteOff;
if (Array.isArray(this.pitch)) {
// By default this is a chord if it's an array of notes that requires one NoteOnEvent.
// If this.sequential === true then it's a sequential string of notes that requires separate NoteOnEvents.
if ( ! this.sequential) {
// Handle repeat
for (var j = 0; j < this.repeat; j++) {
// Note on
this.pitch.forEach(function(p, i) {
if (i == 0) {
noteOn = new NoteOnEvent({data: Utils.numberToVariableLength(restDuration).concat(this.getNoteOnStatus(), Utils.getPitch(p), this.velocity)});
} else {
// Running status (can ommit the note on status)
noteOn = new NoteOnEvent({data: [0, Utils.getPitch(p), this.velocity]});
}
this.data = this.data.concat(noteOn.data);
}, this);
// Note off
this.pitch.forEach(function(p, i) {
if (i == 0) {
noteOff = new NoteOffEvent({data: Utils.numberToVariableLength(tickDuration).concat(this.getNoteOffStatus(), Utils.getPitch(p), this.velocity)});
} else {
// Running status (can ommit the note off status)
noteOff = new NoteOffEvent({data: [0, Utils.getPitch(p), this.velocity]});
}
this.data = this.data.concat(noteOff.data);
}, this);
}
} else {
// Handle repeat
for (var j = 0; j < this.repeat; j++) {
this.pitch.forEach(function(p, i) {
// restDuration only applies to first note
if (i > 0) {
restDuration = 0;
}
// If duration is 8th triplets we need to make sure that the total ticks == quarter note.
// So, the last one will need to be the remainder
if (this.duration === '8t' && i == this.pitch.length - 1) {
let quarterTicks = Utils.numberFromBytes(Constants.HEADER_CHUNK_DIVISION);
tickDuration = quarterTicks - (tickDuration * 2);
}
noteOn = new NoteOnEvent({data: Utils.numberToVariableLength(restDuration).concat([this.getNoteOnStatus(), Utils.getPitch(p), this.velocity])});
noteOff = new NoteOffEvent({data: Utils.numberToVariableLength(tickDuration).concat([this.getNoteOffStatus(), Utils.getPitch(p), this.velocity])});
this.data = this.data.concat(noteOn.data, noteOff.data);
}, this);
}
}
return this;
}
throw 'pitch must be an array.';
};
/**
* Converts velocity to value 0-127
* @param {number} velocity - Velocity value 1-100
* @return {number}
*/
convertVelocity(velocity) {
// Max passed value limited to 100
velocity = velocity > 100 ? 100 : velocity;
return Math.round(velocity / 100 * 127);
};
/**
* Gets the total number of ticks based on passed duration.
* Note: type=='note' defaults to quarter note, type==='rest' defaults to 0
* @param {(string|array)} duration
* @param {string} type ['note', 'rest']
* @return {number}
*/
getTickDuration(duration, type) {
if (Array.isArray(duration)) {
// Recursively execute this method for each item in the array and return the sum of tick durations.
return duration.map(function(value) {
return this.getTickDuration(value, type);
}, this).reduce(function(a, b) {
return a + b;
}, 0);
}
duration = duration.toString();
if (duration.toLowerCase().charAt(0) === 't') {
// If duration starts with 't' then the number that follows is an explicit tick count
return parseInt(duration.substring(1));
}
// Need to apply duration here. Quarter note == Constants.HEADER_CHUNK_DIVISION
// Rounding only applies to triplets, which the remainder is handled below
var quarterTicks = Utils.numberFromBytes(Constants.HEADER_CHUNK_DIVISION);
return Math.round(quarterTicks * this.getDurationMultiplier(duration, type));
}
/**
* Gets what to multiple ticks/quarter note by to get the specified duration.
* Note: type=='note' defaults to quarter note, type==='rest' defaults to 0
* @param {string} duration
* @param {string} type ['note','rest']
* @return {number}
*/
getDurationMultiplier(duration, type) {
// Need to apply duration here. Quarter note == Constants.HEADER_CHUNK_DIVISION
switch (duration) {
case '0':
return 0;
case '1':
return 4;
case '2':
return 2;
case 'd2':
return 3;
case '4':
return 1;
case 'd4':
return 1.5;
case '8':
return 0.5;
case '8t':
// For 8th triplets, let's divide a quarter by 3, round to the nearest int, and substract the remainder to the last one.
return 0.33;
case 'd8':
return 0.75;
case '16':
return 0.25;
default:
// Notes default to a quarter, rests default to 0
//return type === 'note' ? 1 : 0;
}
throw duration + ' is not a valid duration.';
};
/**
* Gets the note on status code based on the selected channel. 0x9{0-F}
* Note on at channel 0 is 0x90 (144)
* 0 = Ch 1
* @return {number}
*/
getNoteOnStatus() {return 144 + this.channel - 1}
/**
* Gets the note off status code based on the selected channel. 0x8{0-F}
* Note off at channel 0 is 0x80 (128)
* 0 = Ch 1
* @return {number}
*/
getNoteOffStatus() {return 128 + this.channel - 1}
}
export {NoteEvent};
|
import assert from 'assert';
import IconService from '../build/icon-sdk-js.node.min';
const tests = [{
wallet: IconService.IconWallet.loadPrivateKey('38f792b95a5202ab431bfc799f7e1e5c74ec0b9ede5c6142ee7364f2c84d72f6'),
value: 'ba4da77c1dbf48071fbd3f9ee6d869580d177f01468e1e42bbb58733b9087f64',
signature: '4RYSXFpcyLMg3g7ZBT3MnLQcRA3ma5CIpgQEGD8isqJPku/YnAIhJq7q8iy7+mvgni7CBX4otwuhfQLKRQ5RngE=',
}];
describe('Wallet', () => {
describe('sign()', () => {
tests.forEach((test) => {
it('should return the right value', () => {
assert.strictEqual(test.wallet.sign(test.value), test.signature);
});
});
});
});
|
import Controller from './controller'
export default {
handle(route, args) {
let routeName = route + 'Route';
if (!Controller.hasOwnProperty(routeName)) {
console.error('Маршрут не найден!');
}
Controller[routeName](args);
}
}
|
import React from 'react'
import { Link } from 'gatsby'
import '../scss/styles.scss'
import Header from './Header'
import SecondaryNavigation from './SecondaryNavigation'
import Footer from './Footer'
class Layout extends React.Component {
render() {
const { location, title, children } = this.props
return (
<div style={{ marginLeft: `auto`, marginRight: `auto` }}>
<Header />
<SecondaryNavigation />
{children}
<Footer />
</div>
)
}
}
export default Layout
|
const { writeJsonSync, outputFileSync } = require('fs-extra');
const { join } = require('path');
const { getPackageJson, getWebpackConfigJs } = require('./utils');
const { PACKAGE_JSON, WEBPACK_CONFIG_JS } = require('./config');
module.exports = ({
mainFramework: { name: main },
uiFramework: ui,
projectName,
$resolveRoot,
$featureChecks,
}) => {
const {
typescript: isTypescript,
sass: isSass,
less: isLess,
prettier: isPrettier,
lint: isLint,
} = $featureChecks;
// generate package.json
writeJsonSync(
join($resolveRoot, PACKAGE_JSON),
getPackageJson({
isPrettier,
isLint,
ui,
main,
projectName,
isTypescript,
isSass,
isLess,
}),
);
// generate webpack.config.js
outputFileSync(
join($resolveRoot, WEBPACK_CONFIG_JS),
getWebpackConfigJs({
ui,
main,
isTypescript,
isSass,
isLess,
}),
);
};
|
'use strict'
class RegisterController {
* index(request, response) {
yield response.sendView('register')
}
}
module.exports = RegisterController
|
/*eslint-disable*/
import React, {useState, useRef, useEffect} from "react";
// react components for routing our app without refresh
// @material-ui/core components
import { makeStyles } from "@material-ui/core/styles";
import List from "@material-ui/core/List";
import ListItem from "@material-ui/core/ListItem";
// @material-ui/icons
import {
HomeRounded,
InfoRounded,
ShoppingCart,
Group,
LockOutlined, PeopleAltOutlined, OpenInBrowserOutlined
} from "@material-ui/icons";
// core components
//import CustomDropdown from "components/CustomDropdown/CustomDropdown.js";
import Button from "components/CustomButtons/Button.js";
import styles from "assets/jss/material-kit-react/components/headerLinksStyle.js";
import {Link} from "react-scroll";
const useStyles = makeStyles(styles);
export default function HeaderLinks(props) {
const classes = useStyles();
return (
<List className={classes.list}>
<ListItem className={classes.listItem}>
<Link
data-placement="bottom"
activeClass="active"
to="home"
spy={true}
smooth={true}
offset={-70}
duration={500}
className={classes.navLink}>
<HomeRounded className={classes.icons}/> Home
</Link>
</ListItem>
<ListItem className={classes.listItem}>
<Link
data-placement="bottom"
activeClass="active"
to="about"
spy={true}
smooth={true}
offset={-70}
duration={500}
className={classes.navLink}>
<InfoRounded className={classes.icons}/> About us
</Link>
</ListItem>
<ListItem className={classes.listItem}>
<Link
data-placement="bottom"
activeClass="active"
to="team"
spy={true}
smooth={true}
offset={-70}
duration={500}
className={classes.navLink}>
<PeopleAltOutlined className={classes.icons}/> Team
</Link>
</ListItem>
<ListItem className={classes.listItem}>
<a href="#" className={classes.navLink}>
<OpenInBrowserOutlined className={classes.icons}/> Templates
</a>
</ListItem>
<ListItem className={classes.listItem}>
<Link
data-placement="bottom"
activeClass="active"
to="contact"
spy={true}
smooth={true}
offset={-70}
duration={500}
className={classes.navLink}>
<Group className={classes.icons}/> Contact
</Link>
</ListItem>
<ListItem className={classes.listItem}>
<a href="/login-page">
<Button color="info" round>
<LockOutlined className={classes.icons}/>Login</Button>
</a>
</ListItem>
</List>
);
}
|
import cloneDeep from 'lodash.clonedeep';
import {SET_IMG_SRC_AND_FILE_OBJ_TO_REDUCER,
DELETE_ONE_ImgSrc_AND_ONE_ImgFile,
REMOVE_ThoseFileArrAndObjectURLArr_but_also_returnObjectUrlArr_to_RevokeObjectURL
} from '@/pages/_vendor/action/type';
import {MAXUploadPicQuantityOfThisApp} from '@/util_func/FileUploadModule';
const identifyPushPicInOrReplaceThem = (action, copyState) => {
if(((MAXUploadPicQuantityOfThisApp - copyState.imgPreviewSrcArr.length ) >= action.payload.imgPreviewSrcArr.length) ){
action.payload.imgPreviewSrcArr.forEach( (currSrc) => {
copyState.imgPreviewSrcArr.push(currSrc);
});
action.payload.fileArr.forEach( (currFile) => {
copyState.fileArr.push(currFile);
});
copyState.srcToDelete = [];
return copyState;
}else{
action.payload.srcToDelete = copyState.imgPreviewSrcArr;
return action.payload;
}
};
export default function(state={imgPreviewSrcArr:[],fileArr:[], srcToDelete:[]},action){
switch(action.type){
case SET_IMG_SRC_AND_FILE_OBJ_TO_REDUCER:
const copiedState = cloneDeep(state);
return identifyPushPicInOrReplaceThem(action, copiedState);
case DELETE_ONE_ImgSrc_AND_ONE_ImgFile:
const tIndex = action.payload;
const copiedImgSrcArr = Array.from(state.imgPreviewSrcArr);
const copiedImgFileArr = Array.from(state.fileArr);
const theOneDeletedImgSrc = copiedImgSrcArr.splice(tIndex,1);
copiedImgFileArr.splice(tIndex,1);
// 還必須做 window.URL.revokeObjectURL(objUrl) ..... 可以把這個被刪掉的url傳回component ,
// 在component那邊做 , 讓reducer保持pure
return {
imgPreviewSrcArr:copiedImgSrcArr,
fileArr:copiedImgFileArr,
srcToDelete:theOneDeletedImgSrc}
case REMOVE_ThoseFileArrAndObjectURLArr_but_also_returnObjectUrlArr_to_RevokeObjectURL:
const objectURL_ImgArr_toRevoke = [...state.imgPreviewSrcArr];
const newState ={imgPreviewSrcArr:[],fileArr:[],srcToDelete:objectURL_ImgArr_toRevoke};
state.imgPreviewSrcArr = [];
state.fileArr = [];
return newState
default:
return state;
}
}
|
let diyNames = [];
diyArr.forEach
(
function(diy)
{
diyNames.push(diy.name);
}
);
autocomplete(document.getElementById("diyInp"), diyNames);
let selectedDiyArr = [];
const removeDiyFromArr = function(diyName)
{
for (let i = 0; i < selectedDiyArr.length; i++)
{
if (diyName == selectedDiyArr[i].name)
{
selectedDiyArr.splice(i, 1);
}
}
}
const deleteDiy = function(element)
{
element.remove();
}
const diyBtnEvents = function(element)
{
removeDiyFromArr(element.value);
deleteDiy(element);
}
const addDiyToList = function(diy)
{
let list = document.getElementById("DIYContainer")
let container = document.createElement("button");
container.setAttribute("style", "width: 33%; background-color: transparent; border: none;");
container.setAttribute("value", diy.name);
container.setAttribute("onclick", "diyBtnEvents(this)");
let img = document.createElement("img");
img.setAttribute("src", diy.img);
img.setAttribute("style", "width: 100%");
let name = document.createElement("h4");
name.innerHTML = diy.name;
container.appendChild(img);
container.appendChild(name);
list.appendChild(container);
}
const btnAddDiyClick = function()
{
let item = (document.getElementById("diyInp")).value;
if (item != "")
{
diyArr.forEach
(
function(diy)
{
if (item == diy.name)
{
selectedDiyArr.push(diy);
addDiyToList(diy);
}
}
);
let diyContainer = document.getElementById("diyAddedContainer");
diyContainer.setAttribute("style", "display: flex;");
document.getElementById("diyInp").value = "";
}
}
let selectedDiyMaterials = [];
let selectedDiyMaterialsAmount = [];
const calculateMaterials = function()
{
selectedDiyArr.forEach
(
function (diy)
{
const diyKeys = Object.keys(diy.materials);
const diyValues = Object.values(diy.materials);
for (let i = 0; i < diyKeys.length; i++)
{
if (selectedDiyMaterials != "")
{
if (selectedDiyMaterials.includes(diyKeys[i]))
{
for (let x = 0; x < selectedDiyMaterials.length; x++)
{
if (diyKeys[i] == selectedDiyMaterials[x])
{
selectedDiyMaterialsAmount[x] = selectedDiyMaterialsAmount[x] + diyValues[i];
}
}
}
else
{
selectedDiyMaterials.push(diyKeys[i]);
selectedDiyMaterialsAmount.push(diyValues[i]);
}
}
else
{
selectedDiyMaterials.push(diyKeys[i]);
selectedDiyMaterialsAmount.push(diyValues[i]);
}
}
}
)
}
const findImgUrl = function(material)
{
let imgUrl;
imgUrl = "https://dodo.ac/np/images/thumb/8/82/Furniture_NH_Inv_Icon.png/120px-Furniture_NH_Inv_Icon.png"; // default url
materialArr.forEach
(
function (materialItem)
{
if (material == materialItem.name)
{
imgUrl = materialItem.img;
}
}
)
fishArr.forEach
(
function (materialItem)
{
if (material == materialItem.name)
{
imgUrl = materialItem.image_url;
}
}
)
divingArr.forEach
(
function (materialItem)
{
if (material == materialItem.name)
{
imgUrl = materialItem.image_url;
}
}
)
diyArr.forEach
(
function (materialItem)
{
if (material == materialItem.name)
{
imgUrl = materialItem.img;
}
}
)
return imgUrl;
}
const displayMaterials = function(material, amount)
{
var materialList = document.getElementById("materialList");
materialList.style = "display: flex";
var materialContainer = document.createElement("div");
materialContainer.setAttribute("class", "flex");
materialContainer.setAttribute("style", "justify-content: center; align-items: center; gap: 10px");
var materialImg = document.createElement("img");
materialImg.setAttribute("src", findImgUrl(material));
materialImg.setAttribute("style", "width: 25%");
var itemName = document.createElement("h4");
itemName.innerHTML = material;
var materialCount = document.createElement("h4");
materialCount.innerHTML = "X "+amount;
materialContainer.appendChild(materialImg);
materialContainer.appendChild(itemName);
materialContainer.appendChild(materialCount);
materialList.appendChild(materialContainer)
// console.log(material, amount)
}
const calcDiyMaterialsClick = function()
{
document.getElementById("materialList").innerHTML = "";
selectedDiyMaterials = [];
selectedDiyMaterialsAmount = [];
calculateMaterials();
// console.log(selectedDiyMaterials, selectedDiyMaterialsAmount);
for (let i = 0; i < selectedDiyMaterials.length; i++)
{
displayMaterials(selectedDiyMaterials[i], selectedDiyMaterialsAmount[i]);
}
}
|
import { Then } from "cypress-cucumber-preprocessor/steps";
Then("I should see the following posts on the search results page:", table => {
table.hashes().forEach(({ title }) => {
cy.get(".post-teaser")
.should("contain",title)
});
});
|
const os = require('os');
const fs = require('fs');
const utils = require('../utils');
const eventIterface = require('../event');
let k8sHostname = null;
let k8sContainerId = null;
/**
* @returns {boolean} true if the current process is running inside
* a K8S container, false otherwise
*/
module.exports.hasK8sMetadata = function hasK8sMetadata() {
return !!(process.env.KUBERNETES_SERVICE_HOST);
};
/**
* Load K8S metadata and store it
*/
module.exports.loadK8sMetadata = function loadK8sMetadata() {
if (!k8sHostname) {
k8sHostname = os.hostname();
}
if (!k8sContainerId) {
try {
const data = fs.readFileSync('/proc/self/cgroup');
const firstLineParts = data.toString('utf-8').split('\n')[0].split('/');
k8sContainerId = firstLineParts[firstLineParts.length - 1];
} catch (err) {
utils.debugLog('Error loading k8s container id - cannot read cgroup file', err);
}
}
};
/**
* If the current process is running under an ECS container,
* it will add the task-arn of the current task to the metadata field
* of the trace, if its not running under ECS the trace will return unchanged
*
* @param {Object} runner runner object to add the metadata
*/
module.exports.addK8sMetadata = function addK8sMetadata(runner) {
if (!runner || !k8sHostname) return;
const payload = {
is_k8s: true,
k8s_pod_name: k8sHostname,
};
if (k8sContainerId) {
payload.k8s_container_id = k8sContainerId;
}
eventIterface.addToMetadata(runner, payload);
};
|
/**
* echarts图表类:地图
*
* @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。
* @author Kener (@Kener-林峰, kener.linfeng@gmail.com)
*
*/
define(function (require) {
var ChartBase = require('./base');
// 图形依赖
var TextShape = require('../../zrender/shape/Text');
var PathShape = require('../../zrender/shape/Path');
var CircleShape = require('../../zrender/shape/Circle');
var RectangleShape = require('../../zrender/shape/Rectangle');
var LineShape = require('../../zrender/shape/Line');
var PolygonShape = require('../../zrender/shape/Polygon');
var EllipseShape = require('../../zrender/shape/Ellipse');
// 组件依赖
require('../component/dataRange');
require('../component/roamController');
var ecConfig = require('../config');
// 地图默认参数
ecConfig.map = {
zlevel: 0, // 一级层叠
z: 2, // 二级层叠
mapType: 'china', // 各省的mapType暂时都用中文
//mapLocation: {
// x: 'center' | 'left' | 'right' | 'x%' | {number},
// y: 'center' | 'top' | 'bottom' | 'x%' | {number}
// width // 自适应
// height // 自适应
//},
// mapValueCalculation: 'sum', // 数值合并方式,默认加和,可选为:
// 'sum' | 'average' | 'max' | 'min'
mapValuePrecision: 0, // 地图数值计算结果小数精度
showLegendSymbol: true, // 显示图例颜色标识(系列标识的小圆点),存在legend时生效
// selectedMode: false, // 选择模式,默认关闭,可选single,multiple
dataRangeHoverLink: true,
hoverable: true,
clickable: true,
// roam: false, // 是否开启缩放及漫游模式
// scaleLimit: null,
itemStyle: {
normal: {
// color: 各异,
borderColor: 'rgba(0,0,0,0)',
borderWidth: 1,
areaStyle: {
color: '#ccc'
},
label: {
show: false,
textStyle: {
color: 'rgb(139,69,19)'
}
}
},
emphasis: { // 也是选中样式
// color: 各异,
borderColor: 'rgba(0,0,0,0)',
borderWidth: 1,
areaStyle: {
color: 'rgba(255,215,0,0.8)'
},
label: {
show: false,
textStyle: {
color: 'rgb(100,0,0)'
}
}
}
}
};
var ecData = require('../util/ecData');
var zrUtil = require('../../zrender/tool/util');
var zrConfig = require('../../zrender/config');
var zrEvent = require('../../zrender/tool/event');
var _mapParams = require('../util/mapData/params').params;
var _textFixed = require('../util/mapData/textFixed');
var _geoCoord = require('../util/mapData/geoCoord');
/**
* 构造函数
* @param {Object} messageCenter echart消息中心
* @param {ZRender} zr zrender实例
* @param {Object} series 数据
* @param {Object} component 组件
*/
function Map(ecTheme, messageCenter, zr, option, myChart){
// 图表基类
ChartBase.call(this, ecTheme, messageCenter, zr, option, myChart);
var self = this;
self._onmousewheel = function(params) {
return self.__onmousewheel(params);
};
self._onmousedown = function(params) {
return self.__onmousedown(params);
};
self._onmousemove = function(params) {
return self.__onmousemove(params);
};
self._onmouseup = function(params) {
return self.__onmouseup(params);
};
self._onroamcontroller = function(params) {
return self.__onroamcontroller(params);
};
self._ondrhoverlink = function(params) {
return self.__ondrhoverlink(params);
};
this._isAlive = true; // 活着标记
this._selectedMode = {}; // 选择模式
this._activeMapType = {}; // 当前活跃的地图类型
this._clickable = {}; // 悬浮高亮模式,索引到图表
this._hoverable = {}; // 悬浮高亮模式,索引到图表
this._showLegendSymbol = {}; // 显示图例颜色标识
this._selected = {}; // 地图选择状态
this._mapTypeMap = {}; // 图例类型索引
this._mapDataMap = {}; // 根据地图类型索引bbox,transform,path
this._nameMap = {}; // 个性化地名
this._specialArea = {}; // 特殊
this._refreshDelayTicket; // 滚轮缩放时让refresh飞一会
this._mapDataRequireCounter; // 异步回调计数器
this._markAnimation = false;
this._hoverLinkMap = {};
// 漫游相关信息
this._roamMap = {};
this._scaleLimitMap = {};
this._mx;
this._my;
this._mousedown;
this._justMove; // 避免移动响应点击
this._curMapType; // 当前移动的地图类型
this.refresh(option);
this.zr.on(zrConfig.EVENT.MOUSEWHEEL, this._onmousewheel);
this.zr.on(zrConfig.EVENT.MOUSEDOWN, this._onmousedown);
messageCenter.bind(ecConfig.EVENT.ROAMCONTROLLER, this._onroamcontroller);
messageCenter.bind(ecConfig.EVENT.DATA_RANGE_HOVERLINK, this._ondrhoverlink);
}
Map.prototype = {
type : ecConfig.CHART_TYPE_MAP,
/**
* 绘制图形
*/
_buildShape : function () {
var series = this.series;
this.selectedMap = {}; // 系列
this._activeMapType = {}; // 当前活跃的地图类型
var legend = this.component.legend;
var seriesName;
var valueData = {};
var mapType;
var data;
var name;
var mapSeries = {};
var mapValuePrecision = {};
var valueCalculation = {};
for (var i = 0, l = series.length; i < l; i++) {
if (series[i].type == ecConfig.CHART_TYPE_MAP) { // map
series[i] = this.reformOption(series[i]);
mapType = series[i].mapType;
mapSeries[mapType] = mapSeries[mapType] || {};
mapSeries[mapType][i] = true;
mapValuePrecision[mapType] = mapValuePrecision[mapType]
|| series[i].mapValuePrecision;
this._scaleLimitMap[mapType] = this._scaleLimitMap[mapType] || {};
series[i].scaleLimit
&& zrUtil.merge(this._scaleLimitMap[mapType], series[i].scaleLimit, true);
this._roamMap[mapType] = series[i].roam || this._roamMap[mapType];
if (this._hoverLinkMap[mapType] == null || this._hoverLinkMap[mapType]) {
// false 1票否决
this._hoverLinkMap[mapType] = series[i].dataRangeHoverLink;
}
this._nameMap[mapType] = this._nameMap[mapType] || {};
series[i].nameMap
&& zrUtil.merge(this._nameMap[mapType], series[i].nameMap, true);
this._activeMapType[mapType] = true;
if (series[i].textFixed) {
zrUtil.merge(
_textFixed, series[i].textFixed, true
);
}
if (series[i].geoCoord) {
zrUtil.merge(
_geoCoord, series[i].geoCoord, true
);
}
this._selectedMode[mapType] = this._selectedMode[mapType]
|| series[i].selectedMode;
if (this._hoverable[mapType] == null || this._hoverable[mapType]) {
// false 1票否决
this._hoverable[mapType] = series[i].hoverable;
}
if (this._clickable[mapType] == null || this._clickable[mapType]) {
// false 1票否决
this._clickable[mapType] = series[i].clickable;
}
if (this._showLegendSymbol[mapType] == null
|| this._showLegendSymbol[mapType]
) {
// false 1票否决
this._showLegendSymbol[mapType] = series[i].showLegendSymbol;
}
valueCalculation[mapType] = valueCalculation[mapType]
|| series[i].mapValueCalculation;
seriesName = series[i].name;
this.selectedMap[seriesName] = legend
? legend.isSelected(seriesName)
: true;
if (this.selectedMap[seriesName]) {
valueData[mapType] = valueData[mapType] || {};
data = series[i].data;
for (var j = 0, k = data.length; j < k; j++) {
name = this._nameChange(mapType, data[j].name);
valueData[mapType][name] = valueData[mapType][name]
|| {
seriesIndex : [],
valueMap: {}
};
for (var key in data[j]) {
if (key != 'value') {
valueData[mapType][name][key] =
data[j][key];
}
else if (!isNaN(data[j].value)) {
// value
valueData[mapType][name].value == null
&& (valueData[mapType][name].value = 0);
valueData[mapType][name].value += (+data[j].value);
valueData[mapType][name].valueMap[i] = +data[j].value;
}
}
//索引有该区域的系列样式
valueData[mapType][name].seriesIndex.push(i);
}
}
}
}
this._mapDataRequireCounter = 0;
for (var mt in valueData) {
this._mapDataRequireCounter++;
}
//清空
this._clearSelected();
if (this._mapDataRequireCounter === 0) {
this.clear();
this.zr && this.zr.delShape(this.lastShapeList);
this.lastShapeList = [];
}
for (var mt in valueData) {
if (valueCalculation[mt] && valueCalculation[mt] == 'average') {
for (var k in valueData[mt]) {
valueData[mt][k].value =
(valueData[mt][k].value / valueData[mt][k].seriesIndex.length)
.toFixed(
mapValuePrecision[mt]
) - 0;
}
}
this._mapDataMap[mt] = this._mapDataMap[mt] || {};
if (this._mapDataMap[mt].mapData) {
// 已经缓存了则直接用
this._mapDataCallback(mt, valueData[mt], mapSeries[mt])(
this._mapDataMap[mt].mapData
);
}
else if (_mapParams[mt.replace(/\|.*/, '')].getGeoJson) {
// 特殊区域
this._specialArea[mt] =
_mapParams[mt.replace(/\|.*/, '')].specialArea
|| this._specialArea[mt];
_mapParams[mt.replace(/\|.*/, '')].getGeoJson(
this._mapDataCallback(mt, valueData[mt], mapSeries[mt])
);
}
}
},
/**
* @param {string} mt mapType
* @parma {Object} vd valueData
* @param {Object} ms mapSeries
*/
_mapDataCallback : function (mt, vd, ms) {
var self = this;
return function (md) {
if (!self._isAlive || self._activeMapType[mt] == null) {
// 异步地图数据回调时有可能实例已经被释放
return;
}
// 缓存这份数据
if (mt.indexOf('|') != -1) {
// 子地图,加工一份新的mapData
md = self._getSubMapData(mt, md);
}
self._mapDataMap[mt].mapData = md;
if (md.firstChild) {
self._mapDataMap[mt].rate = 1;
self._mapDataMap[mt].projection = require('../util/projection/svg');
}
else {
self._mapDataMap[mt].rate = 0.75;
self._mapDataMap[mt].projection = require('../util/projection/normal');
}
self._buildMap(
mt, // 类型
self._getProjectionData(mt, md, ms), // 地图数据
vd, // 用户数据
ms // 系列
);
self._buildMark(mt, ms);
if (--self._mapDataRequireCounter <= 0) {
self.addShapeList();
self.zr.refreshNextFrame();
}
};
},
_clearSelected : function() {
for (var k in this._selected) {
if (!this._activeMapType[this._mapTypeMap[k]]) {
delete this._selected[k];
delete this._mapTypeMap[k];
}
}
},
_getSubMapData : function (mapType, mapData) {
var subType = mapType.replace(/^.*\|/, '');
var features = mapData.features;
for (var i = 0, l = features.length; i < l; i++) {
if (features[i].properties
&& features[i].properties.name == subType
) {
features = features[i];
if (subType == 'United States of America'
&& features.geometry.coordinates.length > 1 // 未被简化
) {
features = {
geometry: {
coordinates: features.geometry
.coordinates.slice(5,6),
type: features.geometry.type
},
id: features.id,
properties: features.properties,
type: features.type
};
}
break;
}
}
return {
'type' : 'FeatureCollection',
'features':[
features
]
};
},
/**
* 按需加载相关地图
*/
_getProjectionData : function (mapType, mapData, mapSeries) {
var normalProjection = this._mapDataMap[mapType].projection;
var province = [];
// bbox永远不变
var bbox = this._mapDataMap[mapType].bbox
|| normalProjection.getBbox(
mapData, this._specialArea[mapType]
);
//console.log(bbox)
var transform;
//console.log(1111,transform)
if (!this._mapDataMap[mapType].hasRoam) {
// 第一次或者发生了resize,需要判断
transform = this._getTransform(
bbox,
mapSeries,
this._mapDataMap[mapType].rate
);
}
else {
//经过用户漫游不再响应resize
transform = this._mapDataMap[mapType].transform;
}
//console.log(bbox,transform)
var lastTransform = this._mapDataMap[mapType].lastTransform
|| {scale:{}};
var pathArray;
if (transform.left != lastTransform.left
|| transform.top != lastTransform.top
|| transform.scale.x != lastTransform.scale.x
|| transform.scale.y != lastTransform.scale.y
) {
// 发生过变化,需要重新生成pathArray
// 一般投射
//console.log(transform)
pathArray = normalProjection.geoJson2Path(
mapData, transform, this._specialArea[mapType]
);
lastTransform = zrUtil.clone(transform);
}
else {
transform = this._mapDataMap[mapType].transform;
pathArray = this._mapDataMap[mapType].pathArray;
}
this._mapDataMap[mapType].bbox = bbox;
this._mapDataMap[mapType].transform = transform;
this._mapDataMap[mapType].lastTransform = lastTransform;
this._mapDataMap[mapType].pathArray = pathArray;
//console.log(pathArray)
var position = [transform.left, transform.top];
for (var i = 0, l = pathArray.length; i < l; i++) {
/* for test
console.log(
mapData.features[i].properties.cp, // 经纬度度
pathArray[i].cp // 平面坐标
);
console.log(
this.pos2geo(mapType, pathArray[i].cp), // 平面坐标转经纬度
this.geo2pos(mapType, mapData.features[i].properties.cp)
)
*/
province.push(this._getSingleProvince(
mapType, pathArray[i], position
));
}
if (this._specialArea[mapType]) {
for (var area in this._specialArea[mapType]) {
province.push(this._getSpecialProjectionData(
mapType, mapData,
area, this._specialArea[mapType][area],
position
));
}
}
// 中国地图加入南海诸岛
if (mapType == 'china') {
var leftTop = this.geo2pos(
mapType,
_geoCoord['南海诸岛'] || _mapParams['南海诸岛'].textCoord
);
// scale.x : width = 10.51 : 64
var scale = transform.scale.x / 10.5;
var textPosition = [
32 * scale + leftTop[0],
83 * scale + leftTop[1]
];
if (_textFixed['南海诸岛']) {
textPosition[0] += _textFixed['南海诸岛'][0];
textPosition[1] += _textFixed['南海诸岛'][1];
}
province.push({
name : this._nameChange(mapType, '南海诸岛'),
path : _mapParams['南海诸岛'].getPath(leftTop, scale),
position : position,
textX : textPosition[0],
textY : textPosition[1]
});
}
//console.log(JSON.stringify(province));
//console.log(JSON.stringify(this._mapDataMap[mapType].transform));
return province;
},
/**
* 特殊地区投射数据
*/
_getSpecialProjectionData : function (mapType, mapData, areaName, mapSize, position) {
//console.log('_getSpecialProjectionData--------------')
// 构造单独的geoJson地图数据
mapData = this._getSubMapData('x|' + areaName, mapData);
// bbox
var normalProjection = require('../util/projection/normal');
var bbox = normalProjection.getBbox(mapData);
//console.log('bbox', bbox)
// transform
var leftTop = this.geo2pos(
mapType,
[mapSize.left, mapSize.top]
);
var rightBottom = this.geo2pos(
mapType,
[mapSize.left + mapSize.width, mapSize.top + mapSize.height]
);
//console.log('leftright' , leftTop, rightBottom);
var width = Math.abs(rightBottom[0] - leftTop[0]);
var height = Math.abs(rightBottom[1] - leftTop[1]);
var mapWidth = bbox.width;
var mapHeight = bbox.height;
//var minScale;
var xScale = (width / 0.75) / mapWidth;
var yScale = height / mapHeight;
if (xScale > yScale) {
xScale = yScale * 0.75;
width = mapWidth * xScale;
}
else {
yScale = xScale;
xScale = yScale * 0.75;
height = mapHeight * yScale;
}
var transform = {
OffsetLeft : leftTop[0],
OffsetTop : leftTop[1],
//width: width,
//height: height,
scale : {
x : xScale,
y : yScale
}
};
//console.log('**',areaName, transform)
var pathArray = normalProjection.geoJson2Path(
mapData, transform
);
//console.log(pathArray)
return this._getSingleProvince(
mapType, pathArray[0], position
);
},
_getSingleProvince : function (mapType, path, position) {
var textPosition;
var name = path.properties.name;
var textFixed = _textFixed[name] || [0, 0];
if (_geoCoord[name]) {
// 经纬度直接定位不加textFixed
textPosition = this.geo2pos(
mapType,
_geoCoord[name]
);
}
else if (path.cp) {
textPosition = [
path.cp[0] + textFixed[0],
path.cp[1] + textFixed[1]
];
}
else {
var bbox = this._mapDataMap[mapType].bbox;
textPosition = this.geo2pos(
mapType,
[bbox.left + bbox.width / 2, bbox.top + bbox.height / 2]
);
textPosition[0] += textFixed[0];
textPosition[1] += textFixed[1];
}
//console.log(textPosition)
path.name = this._nameChange(mapType, name);
path.position = position;
path.textX = textPosition[0];
path.textY = textPosition[1];
return path;
},
/**
* 获取缩放
*/
_getTransform : function (bbox, mapSeries, rate) {
var series = this.series;
var mapLocation;
var x;
var cusX;
var y;
var cusY;
var width;
var height;
var zrWidth = this.zr.getWidth();
var zrHeight = this.zr.getHeight();
//上下左右留空
var padding = Math.round(Math.min(zrWidth, zrHeight) * 0.02);
for (var key in mapSeries) {
mapLocation = series[key].mapLocation || {};
cusX = mapLocation.x || cusX;
cusY = mapLocation.y || cusY;
width = mapLocation.width || width;
height = mapLocation.height || height;
}
//x = isNaN(cusX) ? padding : cusX;
x = this.parsePercent(cusX, zrWidth);
x = isNaN(x) ? padding : x;
//y = isNaN(cusY) ? padding : cusY;
y = this.parsePercent(cusY, zrHeight);
y = isNaN(y) ? padding : y;
width = width == null
? (zrWidth - x - 2 * padding)
: (this.parsePercent(width, zrWidth));
height = height == null
? (zrHeight - y - 2 * padding)
: (this.parsePercent(height, zrHeight));
var mapWidth = bbox.width;
var mapHeight = bbox.height;
//var minScale;
var xScale = (width / rate) / mapWidth;
var yScale = height / mapHeight;
if (xScale > yScale) {
//minScale = yScale;
xScale = yScale * rate;
width = mapWidth * xScale;
}
else {
//minScale = xScale;
yScale = xScale;
xScale = yScale * rate;
height = mapHeight * yScale;
}
//console.log(minScale)
//width = mapWidth * minScale;
//height = mapHeight * minScale;
if (isNaN(cusX)) {
cusX = cusX || 'center';
switch (cusX + '') {
case 'center' :
x = Math.floor((zrWidth - width) / 2);
break;
case 'right' :
x = zrWidth - width;
break;
//case 'left' :
//x = padding;
}
}
//console.log(cusX,x,zrWidth,width,'kener')
if (isNaN(cusY)) {
cusY = cusY || 'center';
switch (cusY + '') {
case 'center' :
y = Math.floor((zrHeight - height) / 2);
break;
case 'bottom' :
y = zrHeight - height;
break;
//case 'top' :
//y = padding;
}
}
//console.log(x,y,width,height)
return {
left : x,
top : y,
width: width,
height: height,
//scale : minScale * 50, // wtf 50
baseScale : 1,
scale : {
x : xScale,
y : yScale
}
//translate : [x + width / 2, y + height / 2]
};
},
/**
* 构建地图
* @param {Object} mapData 图形数据
* @param {Object} valueData 用户数据
*/
_buildMap : function (mapType, mapData, valueData, mapSeries) {
var series = this.series;
var legend = this.component.legend;
var dataRange = this.component.dataRange;
var seriesName;
var name;
var data;
var value;
var queryTarget;
var color;
var font;
var style;
var highlightStyle;
var shape;
var textShape;
for (var i = 0, l = mapData.length; i < l; i++) {
style = zrUtil.clone(mapData[i]);
highlightStyle = {
name : style.name,
path : style.path,
position : zrUtil.clone(style.position)
};
name = style.name;
data = valueData[name]; // 多系列合并后的数据
if (data) {
queryTarget = [data]; // level 3
seriesName = '';
for (var j = 0, k = data.seriesIndex.length; j < k; j++) {
// level 2
queryTarget.push(series[data.seriesIndex[j]]);
seriesName += series[data.seriesIndex[j]].name + ' ';
if (legend
&& this._showLegendSymbol[mapType]
&& legend.hasColor(series[data.seriesIndex[j]].name)
) {
this.shapeList.push(new CircleShape({
zlevel : this.getZlevelBase(),
z : this.getZBase() + 1,
position : zrUtil.clone(style.position),
_mapType : mapType,
/*
_geo : this.pos2geo(
mapType, [style.textX + 3 + j * 7, style.textY - 10]
),
*/
style : {
x : style.textX + 3 + j * 7,
y : style.textY - 10,
r : 3,
color : legend.getColor(
series[data.seriesIndex[j]].name
)
},
hoverable : false
}));
}
}
value = data.value;
}
else {
data = {
name: name,
value: '-'
};
seriesName = '';
queryTarget = [];
for (var key in mapSeries) {
queryTarget.push(series[key]);
}
value = '-';
}
this.ecTheme.map && queryTarget.push(this.ecTheme.map); // level 1
queryTarget.push(ecConfig.map); // level 1
// 值域控件控制
color = (dataRange && !isNaN(value))
? dataRange.getColor(value)
: null;
// 常规设置
style.color = style.color
|| color
|| this.getItemStyleColor(
this.deepQuery(queryTarget, 'itemStyle.normal.color'),
data.seriesIndex, -1, data
)
|| this.deepQuery(
queryTarget, 'itemStyle.normal.areaStyle.color'
);
style.strokeColor = style.strokeColor
|| this.deepQuery(queryTarget, 'itemStyle.normal.borderColor');
style.lineWidth = style.lineWidth
|| this.deepQuery(queryTarget, 'itemStyle.normal.borderWidth');
// 高亮
highlightStyle.color = this.getItemStyleColor(
this.deepQuery(queryTarget, 'itemStyle.emphasis.color'),
data.seriesIndex, -1, data
)
|| this.deepQuery(
queryTarget, 'itemStyle.emphasis.areaStyle.color'
)
|| style.color;
highlightStyle.strokeColor = this.deepQuery(
queryTarget, 'itemStyle.emphasis.borderColor'
)
|| style.strokeColor;
highlightStyle.lineWidth = this.deepQuery(
queryTarget, 'itemStyle.emphasis.borderWidth'
)
|| style.lineWidth;
style.brushType = highlightStyle.brushType = style.brushType || 'both';
style.lineJoin = highlightStyle.lineJoin = 'round';
style._name = highlightStyle._name = name;
font = this.deepQuery(queryTarget, 'itemStyle.normal.label.textStyle');
// 文字标签避免覆盖单独一个shape
textShape = {
zlevel : this.getZlevelBase(),
z : this.getZBase() + 1,
//hoverable: this._hoverable[mapType],
//clickable: this._clickable[mapType],
position : zrUtil.clone(style.position),
_mapType : mapType,
_geo : this.pos2geo(
mapType, [style.textX, style.textY]
),
style : {
brushType : 'fill',
x : style.textX,
y : style.textY,
text : this.getLabelText(name, value, queryTarget, 'normal'),
_name : name,
textAlign : 'center',
color : this.deepQuery(queryTarget, 'itemStyle.normal.label.show')
? this.deepQuery(
queryTarget,
'itemStyle.normal.label.textStyle.color'
)
: 'rgba(0,0,0,0)',
textFont : this.getFont(font)
}
};
textShape._style = zrUtil.clone(textShape.style);
textShape.highlightStyle = zrUtil.clone(textShape.style);
if (this.deepQuery(queryTarget, 'itemStyle.emphasis.label.show')) {
textShape.highlightStyle.text = this.getLabelText(
name, value, queryTarget, 'emphasis'
);
textShape.highlightStyle.color = this.deepQuery(
queryTarget,
'itemStyle.emphasis.label.textStyle.color'
) || textShape.style.color;
font = this.deepQuery(
queryTarget,
'itemStyle.emphasis.label.textStyle'
) || font;
textShape.highlightStyle.textFont = this.getFont(font);
}
else {
textShape.highlightStyle.color = 'rgba(0,0,0,0)';
}
shape = {
zlevel : this.getZlevelBase(),
z : this.getZBase(),
//hoverable: this._hoverable[mapType],
//clickable: this._clickable[mapType],
position : zrUtil.clone(style.position),
style : style,
highlightStyle : highlightStyle,
_style: zrUtil.clone(style),
_mapType: mapType
};
if (style.scale != null) {
shape.scale = zrUtil.clone(style.scale);
}
textShape = new TextShape(textShape);
switch (shape.style.shapeType) {
case 'rectangle' :
shape = new RectangleShape(shape);
break;
case 'line' :
shape = new LineShape(shape);
break;
case 'circle' :
shape = new CircleShape(shape);
break;
case 'polygon' :
shape = new PolygonShape(shape);
break;
case 'ellipse':
shape = new EllipseShape(shape);
break;
default :
shape = new PathShape(shape);
if (shape.buildPathArray) {
shape.style.pathArray = shape.buildPathArray(shape.style.path);
}
break;
}
if (this._selectedMode[mapType] &&
this._selected[name]
|| (data.selected && this._selected[name] !== false)
) {
textShape.style = textShape.highlightStyle;
shape.style = shape.highlightStyle;
}
textShape.clickable = shape.clickable =
this._clickable[mapType]
&& (data.clickable == null || data.clickable);
if (this._selectedMode[mapType]) {
this._selected[name] = this._selected[name] != null
? this._selected[name]
: data.selected;
this._mapTypeMap[name] = mapType;
if (data.selectable == null || data.selectable) {
shape.clickable = textShape.clickable = true;
shape.onclick = textShape.onclick = this.shapeHandler.onclick;
}
}
if (this._hoverable[mapType]
&& (data.hoverable == null || data.hoverable)
) {
textShape.hoverable = shape.hoverable = true;
shape.hoverConnect = textShape.id;
textShape.hoverConnect = shape.id;
}
else {
textShape.hoverable = shape.hoverable = false;
}
// console.log(name,shape);
ecData.pack(
textShape,
{
name: seriesName,
tooltip: this.deepQuery(queryTarget, 'tooltip')
},
0,
data, 0,
name
);
this.shapeList.push(textShape);
ecData.pack(
shape,
{
name: seriesName,
tooltip: this.deepQuery(queryTarget, 'tooltip')
},
0,
data, 0,
name
);
this.shapeList.push(shape);
}
//console.log(this._selected);
},
// 添加标注
_buildMark : function (mapType, mapSeries) {
this._seriesIndexToMapType = this._seriesIndexToMapType || {};
this.markAttachStyle = this.markAttachStyle || {};
var position = [
this._mapDataMap[mapType].transform.left,
this._mapDataMap[mapType].transform.top
];
if (mapType == 'none') {
position = [0, 0];
}
for (var sIdx in mapSeries) {
this._seriesIndexToMapType[sIdx] = mapType;
this.markAttachStyle[sIdx] = {
position : position,
_mapType : mapType
};
this.buildMark(sIdx);
}
},
// 位置转换
getMarkCoord : function (seriesIndex, mpData) {
return (mpData.geoCoord || _geoCoord[mpData.name])
? this.geo2pos(
this._seriesIndexToMapType[seriesIndex],
mpData.geoCoord || _geoCoord[mpData.name]
)
: [0, 0];
},
getMarkGeo : function(mpData) {
return mpData.geoCoord || _geoCoord[mpData.name];
},
_nameChange : function (mapType, name) {
return this._nameMap[mapType][name] || name;
},
/**
* 根据lable.format计算label text
*/
getLabelText : function (name, value, queryTarget, status) {
var formatter = this.deepQuery(
queryTarget,
'itemStyle.' + status + '.label.formatter'
);
if (formatter) {
if (typeof formatter == 'function') {
return formatter.call(
this.myChart,
name,
value
);
}
else if (typeof formatter == 'string') {
formatter = formatter.replace('{a}','{a0}')
.replace('{b}','{b0}');
formatter = formatter.replace('{a0}', name)
.replace('{b0}', value);
return formatter;
}
}
else {
return name;
}
},
_findMapTypeByPos : function (mx, my) {
var transform;
var left;
var top;
var width;
var height;
for (var mapType in this._mapDataMap) {
transform = this._mapDataMap[mapType].transform;
if (!transform || !this._roamMap[mapType] || !this._activeMapType[mapType]) {
continue;
}
left = transform.left;
top = transform.top;
width = transform.width;
height = transform.height;
if (mx >= left
&& mx <= (left + width)
&& my >= top
&& my <= (top + height)
) {
return mapType;
}
}
return;
},
/**
* 滚轮缩放
*/
__onmousewheel : function (params) {
if (this.shapeList.length <= 0) {
return;
}
for (var i = 0, l = this.shapeList.length; i < l; i++) {
var shape = this.shapeList[i];
// If any shape is still animating
if (shape.__animating) {
return;
}
}
var event = params.event;
var mx = zrEvent.getX(event);
var my = zrEvent.getY(event);
var delta;
var eventDelta = zrEvent.getDelta(event);
//eventDelta = eventDelta > 0 ? (-1) : 1;
var mapType;
var mapTypeControl = params.mapTypeControl;
if (!mapTypeControl) {
mapTypeControl = {};
mapType = this._findMapTypeByPos(mx, my);
if (mapType && this._roamMap[mapType] && this._roamMap[mapType] != 'move') {
mapTypeControl[mapType] = true;
}
}
function scalePolyline(shapeStyle, delta) {
for (var i = 0; i < shapeStyle.pointList.length; i++) {
var point = shapeStyle.pointList[i];
point[0] *= delta;
point[1] *= delta;
}
//If smoothness > 0
var controlPointList = shapeStyle.controlPointList;
if (controlPointList) {
for (var i = 0; i < controlPointList.length; i++) {
var point = controlPointList[i];
point[0] *= delta;
point[1] *= delta;
}
}
}
function scaleMarkline(shapeStyle, delta) {
shapeStyle.xStart *= delta;
shapeStyle.yStart *= delta;
shapeStyle.xEnd *= delta;
shapeStyle.yEnd *= delta;
if (shapeStyle.cpX1 != null) {
shapeStyle.cpX1 *= delta;
shapeStyle.cpY1 *= delta;
}
}
var haveScale = false;
for (mapType in mapTypeControl) {
if (mapTypeControl[mapType]) {
haveScale = true;
var transform = this._mapDataMap[mapType].transform;
var left = transform.left;
var top = transform.top;
var width = transform.width;
var height = transform.height;
// 位置转经纬度
var geoAndPos = this.pos2geo(mapType, [mx - left, my - top]);
if (eventDelta > 0) {
delta = 1.2; // 放大
if (this._scaleLimitMap[mapType].max != null
&& transform.baseScale >= this._scaleLimitMap[mapType].max
) {
continue; // 缩放限制
}
}
else {
delta = 1 / 1.2; // 缩小
if (this._scaleLimitMap[mapType].min != null
&& transform.baseScale <= this._scaleLimitMap[mapType].min
) {
continue; // 缩放限制
}
}
transform.baseScale *= delta;
transform.scale.x *= delta;
transform.scale.y *= delta;
transform.width = width * delta;
transform.height = height * delta;
this._mapDataMap[mapType].hasRoam = true;
this._mapDataMap[mapType].transform = transform;
// 经纬度转位置
geoAndPos = this.geo2pos(mapType, geoAndPos);
// 保持视觉中心
transform.left -= geoAndPos[0] - (mx - left);
transform.top -= geoAndPos[1] - (my - top);
this._mapDataMap[mapType].transform = transform;
this.clearEffectShape(true);
for (var i = 0, l = this.shapeList.length; i < l; i++) {
var shape = this.shapeList[i];
if(shape._mapType == mapType) {
var shapeType = shape.type;
var shapeStyle = shape.style;
shape.position[0] = transform.left;
shape.position[1] = transform.top;
switch (shapeType) {
case 'path':
case 'symbol':
case 'circle':
case 'rectangle':
case 'polygon':
case 'line':
case 'ellipse':
shape.scale[0] *= delta;
shape.scale[1] *= delta;
break;
case 'mark-line':
scaleMarkline(shapeStyle, delta);
break;
case 'polyline':
scalePolyline(shapeStyle, delta);
break;
case 'shape-bundle':
for (var j = 0; j < shapeStyle.shapeList.length; j++) {
var subShape = shapeStyle.shapeList[j];
if (subShape.type == 'mark-line') {
scaleMarkline(subShape.style, delta);
}
else if (subShape.type == 'polyline') {
scalePolyline(subShape.style, delta);
}
}
break;
case 'icon':
case 'image':
geoAndPos = this.geo2pos(mapType, shape._geo);
shapeStyle.x = shapeStyle._x =
geoAndPos[0] - shapeStyle.width / 2;
shapeStyle.y = shapeStyle._y =
geoAndPos[1] - shapeStyle.height / 2;
break;
default:
geoAndPos = this.geo2pos(mapType, shape._geo);
shapeStyle.x = geoAndPos[0];
shapeStyle.y = geoAndPos[1];
if (shapeType == 'text') {
shape._style.x = shape.highlightStyle.x
= geoAndPos[0];
shape._style.y = shape.highlightStyle.y
= geoAndPos[1];
}
}
this.zr.modShape(shape.id);
}
}
}
}
if (haveScale) {
zrEvent.stop(event);
this.zr.refreshNextFrame();
var self = this;
clearTimeout(this._refreshDelayTicket);
this._refreshDelayTicket = setTimeout(
function(){
self && self.shapeList && self.animationEffect();
},
100
);
this.messageCenter.dispatch(
ecConfig.EVENT.MAP_ROAM,
params.event,
{type : 'scale'},
this.myChart
);
}
},
__onmousedown : function (params) {
if (this.shapeList.length <= 0) {
return;
}
var target = params.target;
if (target && target.draggable) {
return;
}
var event = params.event;
var mx = zrEvent.getX(event);
var my = zrEvent.getY(event);
var mapType = this._findMapTypeByPos(mx, my);
if (mapType && this._roamMap[mapType] && this._roamMap[mapType] != 'scale') {
this._mousedown = true;
this._mx = mx;
this._my = my;
this._curMapType = mapType;
this.zr.on(zrConfig.EVENT.MOUSEUP, this._onmouseup);
var self = this;
setTimeout(function (){
self.zr.on(zrConfig.EVENT.MOUSEMOVE, self._onmousemove);
},100);
}
},
__onmousemove : function (params) {
if (!this._mousedown || !this._isAlive) {
return;
}
var event = params.event;
var mx = zrEvent.getX(event);
var my = zrEvent.getY(event);
var transform = this._mapDataMap[this._curMapType].transform;
transform.hasRoam = true;
transform.left -= this._mx - mx;
transform.top -= this._my - my;
this._mx = mx;
this._my = my;
this._mapDataMap[this._curMapType].transform = transform;
for (var i = 0, l = this.shapeList.length; i < l; i++) {
if(this.shapeList[i]._mapType == this._curMapType) {
this.shapeList[i].position[0] = transform.left;
this.shapeList[i].position[1] = transform.top;
this.zr.modShape(this.shapeList[i].id);
}
}
this.messageCenter.dispatch(
ecConfig.EVENT.MAP_ROAM,
params.event,
{type : 'move'},
this.myChart
);
this.clearEffectShape(true);
this.zr.refreshNextFrame();
this._justMove = true;
zrEvent.stop(event);
},
__onmouseup : function (params) {
var event = params.event;
this._mx = zrEvent.getX(event);
this._my = zrEvent.getY(event);
this._mousedown = false;
var self = this;
setTimeout(function (){
self._justMove && self.animationEffect();
self._justMove = false;
self.zr.un(zrConfig.EVENT.MOUSEMOVE, self._onmousemove);
self.zr.un(zrConfig.EVENT.MOUSEUP, self._onmouseup);
},120);
},
/**
* 漫游组件事件响应
*/
__onroamcontroller: function(params) {
var event = params.event;
event.zrenderX = this.zr.getWidth() / 2;
event.zrenderY = this.zr.getHeight() / 2;
var mapTypeControl = params.mapTypeControl;
var top = 0;
var left = 0;
var step = params.step;
switch(params.roamType) {
case 'scaleUp':
event.zrenderDelta = 1;
this.__onmousewheel({
event: event,
mapTypeControl: mapTypeControl
});
return;
case 'scaleDown':
event.zrenderDelta = -1;
this.__onmousewheel({
event: event,
mapTypeControl: mapTypeControl
});
return;
case 'up':
top = -step;
break;
case 'down':
top = step;
break;
case 'left':
left = -step;
break;
case 'right':
left = step;
break;
}
var transform;
var curMapType;
for (curMapType in mapTypeControl) {
if (!this._mapDataMap[curMapType] || !this._activeMapType[curMapType]) {
continue;
}
transform = this._mapDataMap[curMapType].transform;
transform.hasRoam = true;
transform.left -= left;
transform.top -= top;
this._mapDataMap[curMapType].transform = transform;
}
for (var i = 0, l = this.shapeList.length; i < l; i++) {
curMapType = this.shapeList[i]._mapType;
if (!mapTypeControl[curMapType] || !this._activeMapType[curMapType]) {
continue;
}
transform = this._mapDataMap[curMapType].transform;
this.shapeList[i].position[0] = transform.left;
this.shapeList[i].position[1] = transform.top;
this.zr.modShape(this.shapeList[i].id);
}
this.messageCenter.dispatch(
ecConfig.EVENT.MAP_ROAM,
params.event,
{type : 'move'},
this.myChart
);
this.clearEffectShape(true);
this.zr.refreshNextFrame();
clearTimeout(this.dircetionTimer);
var self = this;
this.dircetionTimer = setTimeout(function() {
self.animationEffect();
}, 150);
},
/**
* dataRange hoverlink 事件响应
*/
__ondrhoverlink : function(param) {
var curMapType;
var value;
for (var i = 0, l = this.shapeList.length; i < l; i++) {
curMapType = this.shapeList[i]._mapType;
if (!this._hoverLinkMap[curMapType] || !this._activeMapType[curMapType]) {
continue;
}
value = ecData.get(this.shapeList[i], 'value');
if (value != null && value >= param.valueMin && value <= param.valueMax) {
this.zr.addHoverShape(this.shapeList[i]);
}
}
},
/**
* 点击响应
*/
onclick : function (params) {
if (!this.isClick || !params.target || this._justMove || params.target.type == 'icon') {
// 没有在当前实例上发生点击直接返回
return;
}
this.isClick = false;
var target = params.target;
var name = target.style._name;
var len = this.shapeList.length;
var mapType = target._mapType || '';
if (this._selectedMode[mapType] == 'single') {
for (var p in this._selected) {
// 同一地图类型
if (this._selected[p] && this._mapTypeMap[p] == mapType) {
// 复位那些生效shape(包括文字)
for (var i = 0; i < len; i++) {
if (this.shapeList[i].style._name == p
&& this.shapeList[i]._mapType == mapType
) {
this.shapeList[i].style = this.shapeList[i]._style;
this.zr.modShape(this.shapeList[i].id);
}
}
p != name && (this._selected[p] = false);
}
}
}
this._selected[name] = !this._selected[name];
// 更新当前点击shape(包括文字)
for (var i = 0; i < len; i++) {
if (this.shapeList[i].style._name == name
&& this.shapeList[i]._mapType == mapType
) {
if (this._selected[name]) {
this.shapeList[i].style = this.shapeList[i].highlightStyle;
}
else {
this.shapeList[i].style = this.shapeList[i]._style;
}
this.zr.modShape(this.shapeList[i].id);
}
}
this.messageCenter.dispatch(
ecConfig.EVENT.MAP_SELECTED,
params.event,
{
selected : this._selected,
target : name
},
this.myChart
);
this.zr.refreshNextFrame();
var self = this;
setTimeout(function(){
self.zr.trigger(
zrConfig.EVENT.MOUSEMOVE,
params.event
);
},100);
},
/**
* 刷新
*/
refresh : function (newOption) {
if (newOption) {
this.option = newOption;
this.series = newOption.series;
}
if (this._mapDataRequireCounter > 0) {
this.clear();
}
else {
this.backupShapeList();
}
this._buildShape();
this.zr.refreshHover();
},
/**
* 值域响应
* @param {Object} param
* @param {Object} status
*/
ondataRange : function (param, status) {
if (this.component.dataRange) {
this.refresh();
status.needRefresh = true;
}
return;
},
/**
* 平面坐标转经纬度
*/
pos2geo : function (mapType, p) {
if (!this._mapDataMap[mapType].transform) {
return null;
}
return this._mapDataMap[mapType].projection.pos2geo(
this._mapDataMap[mapType].transform, p
);
},
/**
* 公开接口 : 平面坐标转经纬度
*/
getGeoByPos : function (mapType, p) {
if (!this._mapDataMap[mapType].transform) {
return null;
}
var position = [
this._mapDataMap[mapType].transform.left,
this._mapDataMap[mapType].transform.top
];
if (p instanceof Array) {
p[0] -= position[0];
p[1] -= position[1];
}
else {
p.x -= position[0];
p.y -= position[1];
}
return this.pos2geo(mapType, p);
},
/**
* 经纬度转平面坐标
* @param {Object} p
*/
geo2pos : function (mapType, p) {
if (!this._mapDataMap[mapType].transform) {
return null;
}
return this._mapDataMap[mapType].projection.geo2pos(
this._mapDataMap[mapType].transform, p
);
},
/**
* 公开接口 : 经纬度转平面坐标
*/
getPosByGeo : function (mapType, p) {
if (!this._mapDataMap[mapType].transform) {
return null;
}
var pos = this.geo2pos(mapType, p);
pos[0] += this._mapDataMap[mapType].transform.left;
pos[1] += this._mapDataMap[mapType].transform.top;
return pos;
},
/**
* 公开接口 : 地图参考坐标
*/
getMapPosition : function (mapType) {
if (!this._mapDataMap[mapType].transform) {
return null;
}
return [
this._mapDataMap[mapType].transform.left,
this._mapDataMap[mapType].transform.top
];
},
/*
appendShape : function (mapType, shapeList) {
shapeList = shapeList instanceof Array
? shapeList : [shapeList];
for (var i = 0, l = shapeList.length; i < l; i++) {
if (typeof shapeList[i].zlevel == 'undefined') {
shapeList[i].zlevel = this.getZlevelBase();
shapeList[i].z = this.getZBase() + 1;
}
shapeList[i]._mapType = mapType;
this.shapeList.push(shapeList[i]);
this.zr.addShape(shapeList[i]);
}
this.zr.refresh();
},
*/
/**
* 释放后实例不可用
*/
onbeforDispose : function () {
this._isAlive = false;
this.zr.un(zrConfig.EVENT.MOUSEWHEEL, this._onmousewheel);
this.zr.un(zrConfig.EVENT.MOUSEDOWN, this._onmousedown);
this.messageCenter.unbind(
ecConfig.EVENT.ROAMCONTROLLER, this._onroamcontroller
);
this.messageCenter.unbind(
ecConfig.EVENT.DATA_RANGE_HOVERLINK, this._ondrhoverlink
);
}
};
zrUtil.inherits(Map, ChartBase);
// 图表注册
require('../chart').define('map', Map);
return Map;
});
|
'use strict';
// Utilities:
var Promise = require('bluebird');
// Module:
var Core = require('../Core');
var ConfirmDialogService = function ConfirmDialogService () {
return {
show: show
};
function show () {
var resolve, reject;
var promise = new Promise(function() {
resolve = arguments[0];
reject = arguments[1];
});
return {
resolve: resolve,
reject: reject,
promise: promise
};
}
};
Core.service('confirmDialogService', ConfirmDialogService);
|
var React = require('react'),
Reflux = require('reflux'),
Router = require('react-router'),
{ NotFoundRoute, State, Link, Route, RouteHandler, DefaultRoute } = Router,
osmAuth = require('osm-auth'),
haversine = require('haversine'),
xhr = require('xhr'),
qs = require('querystring');
window.React = React;
// Constants for API endpoints
const API06 = 'https://api.openstreetmap.org/api/0.6/',
OVERPASS = 'https://overpass-api.de/api/interpreter';
// Constants for our OAuth connection to OpenStreetMap.
const OAUTH_CONSUMER_KEY = 'ba5eNXgk15yUZu0HKOiiaj6TGMwGPXZTCguB1284',
OAUTH_SECRET = 'Ln2ownAA5vcP8ag7QV5BV8wJiLXEmlgbC01QFTcc';
// # Configuration
// This is used to show certain nodes in the list: otherwise the ones
// we're looking for would be crowded out by telephone poles etc.
const KEYPAIR = { k: 'amenity', v: 'cafe' },
TAG = 'cost:coffee',
// The version string is added to changesets to let OSM know which
// editor software is responsible for which changes.
VERSION = 'poism',
MBX = 'pk.eyJ1IjoidG1jdyIsImEiOiIzczJRVGdRIn0.DKkDbTPnNUgHqTDBg7_zRQ',
MAP = 'tmcw.kbh273ee',
PIN = 'pin-l-cafe',
LOC = 'pin-s';
L.mapbox.accessToken = MBX;
// # Parsing & Producing XML
var a = (nl) => Array.prototype.slice.call(nl),
attr = (n, k) => n.getAttribute(k),
serializer = new XMLSerializer();
// Given an XML DOM in OSM format and an object of the form
//
// { k, v }
//
// Find all nodes with that key combination and return them
// in the form
//
// { xml: Node, tags: {}, id: 'osm-id' }
var parser = (xml, kv) =>
a(xml.getElementsByTagName('node')).map(node =>
a(node.getElementsByTagName('tag')).reduce((memo, tag) => {
memo.tags[attr(tag, 'k')] = attr(tag, 'v'); return memo;
}, {
xml: node, tags: {}, id: attr(node, 'id'),
location: {
latitude: parseFloat(attr(node, 'lat')),
longitude: parseFloat(attr(node, 'lon'))
}
}))
.filter(node => node.tags[kv.k] === kv.v);
var serialize = (xml) => serializer.serializeToString(xml)
.replace('xmlns="http://www.w3.org/1999/xhtml"', '');
// Since we're building XML the hacky way by formatting strings,
// we'll need to escape strings so that places like "Charlie's Shop"
// don't make invalid XML.
var escape = _ => _.replace(/&/g, '&')
.replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
// Generate the XML payload necessary to open a new changeset in OSM
var changesetCreate = (comment) => `<osm><changeset>
<tag k="created_by" v="${VERSION}" />
<tag k="comment" v="${escape(comment)}" />
</changeset></osm>`;
// After the OSM changeset is opened, we need to send the changes:
// this generates the necessary XML to add or update a specific
// tag on a single node.
var changesetChange = (node, tag, id) => {
a(node.getElementsByTagName('tag'))
.filter(tagElem => tagElem.getAttribute('k') === tag.k)
.forEach(tagElem => node.removeChild(tagElem));
node.setAttribute('changeset', id);
var newTag = node.appendChild(document.createElement('tag'));
newTag.setAttribute('k', tag.k); newTag.setAttribute('v', tag.v);
return `<osmChange version="0.3" generator="${VERSION}">
<modify>${serialize(node)}</modify>
</osmChange>`;
};
var sortDistance = (location) =>
(a, b) => haversine(location, a.location) - haversine(location, b.location);
var queryOverpass = (center, kv, callback) => {
const RADIUS = 0.1;
var bbox = [
center.latitude - RADIUS, center.longitude - RADIUS,
center.latitude + RADIUS, center.longitude + RADIUS
].join(',');
var query = `[out:xml][timeout:25];
(node["${kv.k}"="${kv.v}"](${bbox});); out body; >; out skel qt;`;
xhr({ uri: OVERPASS, method: 'POST', body: query }, callback);
};
// # Stores
var locationStore = Reflux.createStore({
location: { latitude: 0, longitude: 0 },
getInitialState() { return this.location; },
init() {
this.watcher = navigator.geolocation.watchPosition(res => {
if (haversine(this.location, res.coords) > 10) {
this.trigger(res.coords);
}
this.location = res.coords;
});
}
});
// Here's where we store fully-formed OSM Nodes that correspond to matches.
// These are listed with Overpass and then loaded in full with OSM API.
// This two-step process imitates the ability to filter the OSM API - without
// it, we'd have some very slow calls to the `/map/` endpoint, instead of
// fast calls to the `/nodes` endpoint.
var nodeLoad = Reflux.createAction();
var nodeSave = Reflux.createAction();
var nodeStore = Reflux.createStore({
nodes: {},
getInitialState() { return this.nodes; },
init() {
this.listenTo(nodeLoad, this.load);
this.listenTo(locationStore, this.load);
this.listenTo(nodeSave, this.save);
},
load(center) {
queryOverpass(center, KEYPAIR, (err, resp, map) => {
if (err) return console.error(err);
this.loadNodes(parser(resp.responseXML, KEYPAIR)
.sort(sortDistance(center))
.slice(0, 50)
.map(n => n.id));
});
},
loadNodes(ids) {
ids = ids.filter(id => !this.nodes[id]);
if (!ids.length) return this.trigger(this.nodes);
xhr({ uri: `${API06}nodes/?nodes=${ids.join(',')}`, method: 'GET' }, (err, resp, body) => {
if (err) return console.error(err);
parser(resp.responseXML, KEYPAIR).forEach(node => {
if (!this.nodes[node.id]) this.nodes[node.id] = node;
});
this.trigger(this.nodes);
});
},
save(res, price, currency) {
const XMLHEADER = { header: { 'Content-Type': 'text/xml' } };
var xml = res.xml;
var tag = { k: TAG, v: currency + price };
var comment = `Updating coffee price to ${currency} ${price} for ${res.tags.name}`;
auth.xhr({ method: 'PUT', prefix: false, options: XMLHEADER,
content: changesetCreate(comment),
path: `${API06}changeset/create`
}, (err, id) => {
if (err) return console.error(err);
auth.xhr({ method: 'POST', prefix: false, options: XMLHEADER,
content: changesetChange(xml, tag, id),
path: `${API06}changeset/${id}/upload`,
}, (err, res) => {
auth.xhr({ method: 'PUT', prefix: false,
path: `${API06}changeset/${id}/close`
}, (err, id) => {
if (err) console.error(err);
router.transitionTo('/success');
});
});
});
}
});
// osm-auth does the hard work of managing user authentication with
// OpenStreetMap via the OAuth protocol.
var auth = osmAuth({
oauth_consumer_key: OAUTH_CONSUMER_KEY,
oauth_secret: OAUTH_SECRET,
auto: false,
landing: 'index.html',
singlepage: true
});
// Here we store the user's logged-in / logged-out status so we can show
// the authentication view instead of a list as an initial pageview.
var userLogin = Reflux.createAction();
var userStore = Reflux.createStore({
user: null,
init() {
this.user = auth.authenticated();
this.listenTo(userLogin, this.login);
},
getInitialState() {
return this.user;
},
login() {
auth.authenticate((err, details) => {
this.user = auth.authenticated();
this.trigger(this.user);
});
}
});
// # Components
// A simple shout-out and log-in button that shoots a user into the OSM
// oauth flow.
var LogIn = React.createClass({
render() {
/* jshint ignore:start */
return (<div className='pad2'>
<div className='pad1 space-bottom1'>
Adding to the map requires an OpenStreetMap account.
</div>
<button
onClick={userLogin}
className='button col12 fill-green icon account'>Log in to OpenStreetMap</button>
</div>
);
/* jshint ignore:end */
}
});
// A simple wrapper for a call to the [Mapbox Static Map API](https://www.mapbox.com/developers/api/static/)
// that we use for editing pages: this gives a basic idea of where the coffee
// shop is as well as a marker for your location. Helpful when there's
// a Starbucks on every corner of an intersection.
var StaticMap = React.createClass({
render() {
return (
/* jshint ignore:start */
<img src={`https://api.tiles.mapbox.com/v4/${MAP}/` +
`${PIN}(${this.props.location.longitude},${this.props.location.latitude}),` +
(this.props.self ? `${LOC}(${this.props.self.longitude},${this.props.self.latitude})` : '') +
`/${this.props.location.longitude},${this.props.location.latitude}` +
`,14/300x200@2x.png?access_token=${MBX}`} />
/* jshint ignore:end */
);
}
});
var Page = React.createClass({
render() {
return (
/* jshint ignore:start */
<div className='margin3 col6'>
<div className='col12'>
<RouteHandler/>
</div>
</div>
/* jshint ignore:end */
);
}
});
var values = obj => Object.keys(obj).map(key => obj[key]);
// A list of potential nodes for viewing and editing.
var List = React.createClass({
// We use Reflux's `.connect` method to listen for changes in stores
// and automatically call setState to use their data here.
mixins: [
Reflux.connect(nodeStore, 'nodes'),
Reflux.connect(locationStore, 'location'),
Reflux.connect(userStore, 'user')],
/* jshint ignore:start */
render() {
return (
<div>
<div className='clearfix col12'>
<div className='pad2 clearfix'>
<div className='col4'>
<img width={300/2} height={230/2}
className='inline' src='assets/logo_inverted.png' />
</div>
<div className='col8 pad2y pad1x'>
<h3>poism</h3>
<p className='italic'>a simple point of interest editor for OpenStreetMap</p>
</div>
</div>
</div>
{this.state.user ?
<div className='pad2'>
{!values(this.state.nodes).length && <div className='pad4 center'>
Loading...
</div>}
{values(this.state.nodes)
.sort(sortDistance(this.state.location))
.map(res => <Result key={res.id} res={res} />)}
</div> :
<LogIn />}
</div>);
}
/* jshint ignore:end */
});
// A single list item
var Result = React.createClass({
render() {
/* jshint ignore:start */
return <Link to='editor'
params={{ osmId: this.props.res.id }}
className='pad1 col12 clearfix fill-coffee space-bottom1'>
<div className='price-tag round'>
{this.props.res.tags[TAG] ?
this.props.res.tags[TAG] : <span className='icon pencil'></span>}
</div>
<strong>{this.props.res.tags.name}</strong>
</Link>;
/* jshint ignore:end */
}
});
var parseCurrency = str => {
var number = str.match(/[\d\.]+/), currency = str.match(/[^\d\.]+/);
return {
currency: currency || '$',
price: parseFloat((number && number[0]) || 0)
};
};
// This view is shown briefly after a user completes an edit. The user
// can either click/tap to go back to the list, or it'll do that automatically
// in 1 second.
var Success = React.createClass({
componentDidMount() {
setTimeout(() => {
if (this.isMounted()) {
this.transitionTo('list');
}
}, 1000);
},
/* jshint ignore:start */
render() {
return <Link to='list' className='col12 center pad4'>
<h2><span className='big icon check'></span> Saved!</h2>
</Link>;
}
/* jshint ignore:end */
});
// The help page. Doesn't have any JavaScript functionality of its own -
// this is static content.
var Help = React.createClass({
/* jshint ignore:start */
render() {
return <div>
<Link
to='list'
className='home icon button fill-darken2 col12'>home</Link>
<div className='pad1y'>
<div className='round fill-lighten0 pad2 dark'>
<p><strong>COFFEEDEX</strong> is a community project that aims to track the price of house coffee everywhere.</p>
<p>The data is stored in <a href='http://osm.org/'>OpenStreetMap</a>, a free and open source map of the world, as tags on existing coffeehops. There are 150,000+.</p>
<p>Maps in this application are © <a href='http://mapbox.com/'>Mapbox</a>.</p>
<p>COFFEEDEX data stored in OpenStreetMap is <a href='http://www.openstreetmap.org/copyright'>available under the ODbL license.</a></p>
<p>This is also an open source project. You can view the source code, clone it, fork it, and make new things with it as inspiration or raw parts.</p>
<a className='button stroke icon github col12 space-bottom1' href='http://github.com/tmcw/coffeedex'>COFFEEDEX on GitHub</a>
<p><span className='icon mobile'></span> COFFEEDEX also works great on phones! Try it on your phone and add it to your iPhone home screen - it'll look even prettier.</p>
<h2>FAQ</h2>
<ul>
<li><strong>Which coffee?</strong> This site tracks the price of <em>house coffee</em> for here. In many cases, that means a 12oz drip, but if all coffees are pour-overs or your country uses different standard size, the overriding rule is cheapest-here.</li>
</ul>
</div>
</div>
</div>;
}
/* jshint ignore:end */
});
// The editor. This allows users to view and edit tags on single result items.
var Editor = React.createClass({
mixins: [
Reflux.listenTo(nodeStore, 'onNodeLoad', 'onNodeLoad'),
Reflux.connect(locationStore, 'location'),
State],
onNodeLoad(nodes) {
var node = nodes[this.getParams().osmId];
if (node) {
if (node.tags[TAG]) {
var currency = parseCurrency(node.tags[TAG]);
this.setState({
currency: currency.currency,
price: currency.price,
node: node
});
} else {
this.setState({ node: node });
}
}
},
getInitialState() {
return {
currency: '$',
price: 0
};
},
// Before this view is displayed, we make sure that the node it'll
// show will be loaded soon.
statics: {
willTransitionTo(transition, params) {
nodeStore.loadNodes([params.osmId]);
},
},
save(e) {
e.preventDefault();
var node = this.state.node;
nodeSave(node, this.state.price, this.state.currency);
},
render() {
var node = this.state.node;
/* jshint ignore:start */
if (!node) return <div className='pad4 center'>
Loading...
</div>;
return <div className='col12'>
<Link
to='list'
className='home icon button fill-darken0 unround col12'>home</Link>
<StaticMap location={node.location} self={this.state.location} />
<div className='pad1 col12 clearfix'>
<div className='col12'>
<div className='center'>
how much for a cup of joe at
</div>
<h1 className='center'>
{node.tags.name}
</h1>
</div>
<div className='limit-mobile'>
<div className='col12 clearfix space-bottom1'>
<select
valueLink={this.linkState('currency')}
className='coffee-select'>
{currency.map(c => <option key={c[0]} value={c[0]}>{c[1]}</option>)}
</select>
<input valueLink={this.linkState('price')}
className='coffee-input' type='number' />
</div>
<a href='#'
onClick={this.save}
className='fill-darken1 button col12 icon plus pad1 unround'>Save</a>
</div>
</div>
</div>;
/* jshint ignore:end */
}
});
// Our router. This manages what URLs mean and where Links can go.
var routes = (
/* jshint ignore:start */
<Route handler={Page} path='/'>
<DefaultRoute name='list' handler={List} />
<Route name='success' path='/success' handler={Success} />
<Route name='help' path='/help' handler={Help} />
<Route name='editor' path='/edit/:osmId' handler={Editor} />
</Route>
/* jshint ignore:end */
);
var router = Router.create({ routes });
// This is a little dirty: the router will rewrite paths it doesn't know,
// including the path we desperately need to complete the OAuth dance.
// So before booting it up, we notice if we need to bootstrap an oauth_token,
// and if so, we do that before starting the application.
if (location.search && !auth.authenticated()) {
var oauth_token = qs.parse(location.search.replace('?', '')).oauth_token;
auth.bootstrapToken(oauth_token, (err, res) => {
userStore.user = true;
userStore.trigger(userStore.user);
router.run(Handler => {
/* jshint ignore:start */
React.render(<Handler/>, document.body);
/* jshint ignore:end */
});
});
} else {
router.run(Handler => {
/* jshint ignore:start */
React.render(<Handler/>, document.body);
/* jshint ignore:end */
});
}
|
"use strict";
import { rebind } from "d3fc-rebind";
import { merge } from "../utils";
import { sar } from "./algorithm";
import baseIndicator from "./baseIndicator";
const ALGORITHM_TYPE = "SMA";
export default function() {
var base = baseIndicator()
.type(ALGORITHM_TYPE)
.accessor(d => d.sar);
var underlyingAlgorithm = sar();
var mergedAlgorithm = merge()
.algorithm(underlyingAlgorithm)
.merge((datum, indicator) => { datum.sar = indicator; });
var indicator = function(data) {
if (!base.accessor()) throw new Error(`Set an accessor to ${ALGORITHM_TYPE} before calculating`);
var newData = mergedAlgorithm(data);
return newData;
};
indicator.undefinedLength = function() {
return underlyingAlgorithm.windowSize();
};
base.tooltipLabel(() => `${ALGORITHM_TYPE}(${underlyingAlgorithm.windowSize()})`);
rebind(indicator, base, "id", "accessor", "stroke", "echo", "type", "tooltipLabel");
rebind(indicator, underlyingAlgorithm, "undefinedLength", "accelerationFactor", "maxAccelerationFactor");
rebind(indicator, mergedAlgorithm, "merge");
return indicator;
}
|
const express = require('express')
const cors = require('cors');
const TaskRoutes = require('./routes/TaskRoutes')
const server = express()
server.use(cors())
server.use(express.json())
server.listen(5000, ()=> {
console.log('API ONLINE')
})
server.use('/task', TaskRoutes)
|
// THIS FILE IS AUTO GENERATED
import { GenIcon } from '../lib';
export function CgAlbum (props) {
return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24","fill":"none"},"child":[{"tag":"path","attr":{"fillRule":"evenodd","clipRule":"evenodd","d":"M2 19C2 20.6569 3.34315 22 5 22H19C20.6569 22 22 20.6569 22 19V5C22 3.34315 20.6569 2 19 2H5C3.34315 2 2 3.34315 2 5V19ZM20 19C20 19.5523 19.5523 20 19 20H5C4.44772 20 4 19.5523 4 19V5C4 4.44772 4.44772 4 5 4H10V12.0111L12.395 12.0112L14.0001 9.86419L15.6051 12.0112H18.0001L18 4H19C19.5523 4 20 4.44772 20 5V19ZM16 4H12V9.33585L14.0001 6.66046L16 9.33571V4Z","fill":"currentColor"}}]})(props);
};
|
export default {
input: './src/react-sane-contenteditable.js',
output: {
name: 'ReactSaneContenteditable',
globals: {
react: 'React',
'prop-types': 'PropTypes',
},
},
plugins: {
babel: {
exclude: '**/node_modules/**',
},
commonJs: {
include: '**/node_modules/**',
},
},
};
|
"use strict";
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @hidden
*/
var AccessTokenValue = /** @class */ (function () {
function AccessTokenValue(accessToken, idToken, expiresIn, homeAccountIdentifier) {
this.accessToken = accessToken;
this.idToken = idToken;
this.expiresIn = expiresIn;
this.homeAccountIdentifier = homeAccountIdentifier;
}
return AccessTokenValue;
}());
exports.AccessTokenValue = AccessTokenValue;
//# sourceMappingURL=AccessTokenValue.js.map
|
let handler = async (m, { conn }) => {
conn.sendButtonImg(m.chat, global.API('lolhuman', '/api/random2/trap', {}, 'apikey'), 'Nih', wm, 'NEXT', '.trap', m)
}
handler.help = ['trap']
handler.tags = ['nsfw']
handler.command = /^(trap)$/i
module.exports = handler
|
import React from "react";
import { mdx } from "@mdx-js/react";
export default function MDXRenderer({ children, ...props }) {
// Memoize the compiled component
const End = React.useMemo(() => {
if (!children) {
return null;
}
const fn = new Function(`_fn`, "React", "mdx", `${children}`);
return fn({}, React, mdx);
}, [children]);
return React.createElement(End, { ...props });
}
|
function perspective(P, d){
if(!d)
d = 12;
let ident = [[d, 0, 0, 0],
[0, d, 0, 0],
[0, 0, d, 0],
[0, 0, 1, 0]];
let out = matriz_mult(ident,P);
for(let i=0;i<out[3].length; i++){
out[0][i] = out[0][i]/out[3][i];
out[1][i] = out[1][i]/out[3][i];
out[2][i] = out[2][i]/out[3][i];
out[3][i] = out[3][i]/out[3][i];
}
return out;
}
function Plano_XY(P,tz){
let ident = [
[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 0, tz],
[0, 0, 0, 1]];
return multiply(ident,P);
}
function Plano_XZ(P,ty){
let ident = [
[1, 0, 0, 0],
[0, 0, 0, ty],
[0, 0, 1, 0],
[0, 0, 0, 1]];
return multiply(ident,P);
}
function Plano_YZ(P,tx){
let ident = [
[0, 0, 0, tx],
[0, 1, 0, 0],
[0, 0, 1, 0],
[0, 0, 0, 1]];
return multiply(ident,P);
}
function Oblique_Projection(P,ang,e){
let ident = [
[1, 0, e*cos(ang),0],
[0, 1, e*sin(ang), 0],
[0, 0, 1, 0],
[0, 0, 0, 1]];
return multiply(ident,P);
}
|
// estrategia 1 para valor padrão
function soma1(a, b, c) {
a = a || 1
b = b || 1
c = c || 1
return a + b + c
}
console.log(soma1(), soma1(3), soma1(1, 2, 3), soma1(0, 0, 0));
//estrategia 2, 3 e 4 para gerar valor padrão
function soma2(a, b, c) {
a = a !== undefined ? a : 1
b = 1 in arguments ? b : 1
c = isNaN(c) ? 1 : c
return a + b + c
}
console.log(soma2(), soma2(3), soma2(1, 2, 3), soma2(0, 0, 0));
// valor padrão do ES2015
function soma3(a = 1, b = 1, c = 1) {
return a + b + c
}
console.log(soma(), soma3(3), soma3(1, 2, 3), soma3(0, 0, 0));
|
import * as _ from 'lodash';
import {API_CALL_BEGIN, API_CALL_ERROR} from '../constants';
import initialState from './initialState';
const apiReducer = (state = initialState.apiReducer, action) => {
if (action.type === API_CALL_BEGIN) {
return {
...state, apiCallsInProgress: state.apiCallsInProgress + 1
};
} else if (isApiCallFinished(action.type) || action.type === API_CALL_ERROR) {
return {
...state, apiCallsInProgress: state.apiCallsInProgress - 1
};
}
return state;
};
function isApiCallFinished(type) {
return _.endsWith(type, '_RESPONSE');
}
export default apiReducer;
|
/*
Copyright 2015 Skippbox, Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import AltContainer from 'alt-container';
import Colors, { defaultNavigatorStyle } from 'styles/Colors';
import ScrollView from 'components/commons/ScrollView';
import ListItem from 'components/commons/ListItem';
import ListHeader from 'components/commons/ListHeader';
import ChartsUtils from 'utils/ChartsUtils';
import NavigationUtils from 'utils/NavigationUtils';
import DeploymentsActions from 'actions/DeploymentsActions';
import ServicesActions from 'actions/ServicesActions';
import ClustersActions from 'actions/ClustersActions';
import BaseApi from 'api/BaseApi';
import PropTypes from 'prop-types';
const { View, Text, Image, StyleSheet, ActivityIndicator, Alert } = ReactNative;
const MAX_RETRIES = 3; // number of retries to deploy, if it fails for unknown reason
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: Colors.BACKGROUND,
},
list: {
flex: 1,
},
content: {
paddingTop: 20,
},
chart: {
backgroundColor: Colors.WHITE,
borderColor: Colors.BORDER,
borderBottomWidth: 1,
flexDirection: 'row',
alignItems: 'center',
paddingVertical: 10,
paddingHorizontal: 15,
},
chartIcon: {
width: 45,
height: 45,
alignSelf: 'center',
},
chartTexts: {
flex: 1,
flexDirection: 'column',
marginLeft: 8,
},
chartTitle: {
fontSize: 16,
fontWeight: '600',
backgroundColor: 'transparent',
},
chartSubtitle: {
marginTop: 2,
fontSize: 12,
},
loader: {
position: 'absolute',
top: 0,
left: 0,
bottom: 0,
right: 0,
backgroundColor: 'rgba(0, 0, 0, 0.3)',
alignItems: 'center',
justifyContent: 'center',
},
loaderText: {
color: Colors.WHITE,
marginTop: 20,
},
deployed: {
flexDirection: 'column',
marginTop: 20,
},
deployedImage: {
width: 50,
height: 50,
resizeMode: 'contain',
tintColor: Colors.GREEN,
marginBottom: 20,
},
deployedTitle: {
color: Colors.GRAY,
fontSize: 20,
textAlign: 'center',
marginBottom: 20,
paddingHorizontal: 10,
},
});
export class DeployClustersContainer extends Component {
static navigatorStyle = defaultNavigatorStyle;
render() {
return (
<AltContainer
stores={{
clusters: () => {
return {
store: alt.stores.ClustersStore,
value: alt.stores.ClustersStore.getClusters(),
};
},
}}
>
<DeployClusters
chart={this.props.chart}
clusters={alt.stores.ClustersStore.getClusters()}
navigator={this.props.navigator}
/>
</AltContainer>
);
}
}
export default class DeployClusters extends Component {
static propTypes = {
chart: PropTypes.instanceOf(Immutable.Map).isRequired,
clusters: PropTypes.instanceOf(Immutable.List).isRequired,
};
constructor() {
super();
this.state = {
loading: false,
deployed: false,
selectedCluster: null,
error: null,
loadingMessage: '',
};
this.deployTries = MAX_RETRIES;
}
componentWillUpdate(nextProps, nextState) {
if (!nextState.loading && this.state.loadingMessage) {
this.setState({ loadingMessage: '' });
}
}
render() {
const { chart } = this.props;
const { selectedCluster } = this.state;
const file = chart.get('chartfile');
return (
<View style={styles.container}>
<ScrollView style={styles.list} contentContainerStyle={styles.content}>
<ListHeader title={intl('chart')} />
<View style={styles.chart}>
<Image
style={styles.chartIcon}
source={ChartsUtils.iconForChart(file.get('name'))}
/>
<View style={styles.chartTexts}>
<Text style={styles.chartTitle} numberOfLines={2}>
{file.get('name')}
</Text>
<Text style={styles.chartSubtitle} numberOfLines={2}>
{file.get('description')}
</Text>
</View>
</View>
{selectedCluster && [
<ListHeader
key="selectedClusterHeader"
title={intl('deploy_selected_cluster')}
/>,
<ListItem
key="selectedCluster"
title={selectedCluster.get('name')}
subtitle={selectedCluster.get('url')}
isLast={true}
/>,
]}
{this.renderClusters()}
{this.renderDeploySuccess()}
{this.renderDeployError()}
</ScrollView>
{this.state.loading && (
<View style={styles.loader}>
<ActivityIndicator color={Colors.WHITE} size="large" />
<Text style={styles.loaderText}>{this.state.loadingMessage}</Text>
</View>
)}
</View>
);
}
renderClusters() {
if (this.state.deployed || this.state.selectedCluster) {
return false;
}
const { clusters } = this.props;
const items = clusters.map((cluster, i) => {
return (
<ListItem
key={i}
title={cluster.get('name')}
subtitle={cluster.get('url')}
showArrow={true}
onPress={() => this.chooseCluster(cluster)}
isLast={i === clusters.size - 1}
/>
);
});
return [
<ListHeader key="title" title={intl('deploy_choose_cluster')} />,
items,
];
}
renderDeploySuccess() {
if (!this.state.deployed) {
return false;
}
return this.renderStatus({
title: intl('deploy_success_title'),
actionTitle: intl('deploy_success_action'),
action: () => this.openCluster(this.state.selectedCluster),
image: require('images/done_circle.png'),
tintColor: Colors.GREEN,
});
}
renderDeployError() {
if (!this.state.error || this.state.deployed) {
return false;
}
return [
this.renderStatus({
title: intl('deploy_error_title', {
message: this.state.error.message,
}),
actionTitle: intl('deploy_error_action'),
action: () => this.chooseCluster(this.state.selectedCluster),
image: require('images/error_circle.png'),
tintColor: Colors.RED,
}),
<ListItem
key="action"
title={intl('deploy_error_action_2')}
showArrow={true}
onPress={() => this.setState({ selectedCluster: null, error: null })}
isLast={true}
/>,
];
}
renderStatus({ title, actionTitle, action, image, tintColor }) {
return (
<View key="status" style={styles.deployed}>
<View style={{ alignItems: 'center' }}>
<Image style={[styles.deployedImage, { tintColor }]} source={image} />
<Text style={styles.deployedTitle}>{title}</Text>
</View>
<ListItem
title={actionTitle}
showArrow={true}
onPress={action}
isLast={true}
/>
</View>
);
}
chooseCluster(cluster) {
this.setState({
loading: true,
error: null,
deployed: false,
selectedCluster: cluster,
loadingMessage: intl('deploy_loading_deployments'),
});
DeploymentsActions.fetchDeployments(cluster)
.then(dps => {
const tillerDP =
dps &&
dps.find(dp => dp.getIn(['metadata', 'name']) === 'tiller-deploy');
if (!tillerDP) {
return new Promise((resolve, reject) => {
Alert.alert(
intl('deploy_no_tiller_dp_alert_title'),
intl('deploy_no_tiller_dp_alert_subtitle'),
[
{
text: intl('cancel'),
onPress: () => this.setState({ loading: false }),
},
{
text: intl('ok'),
onPress: () => {
this.createTillerDeploy(cluster)
.then(deployment => {
return this.createTillerSVC({ cluster, deployment });
})
.catch(e => {
reject(e);
})
.then(service => resolve(service));
},
},
]
);
});
}
return this.findService({ cluster, deployment: tillerDP });
})
.then(service => {
this.setState({
loading: true,
loadingMessage: intl('deploy_loading_deploy_chart'),
});
return this.deployChart({ chart: this.props.chart, service, cluster });
})
.then(() => {
ClustersActions.fetchClusterEntities(cluster);
this.setState({ deployed: true });
})
.catch(e => {
this.setState({ error: e });
// SnackbarUtils.showError({title: e.message});
})
.finally(() => {
this.deployTries = MAX_RETRIES;
this.setState({ loading: false });
});
}
findService({ cluster, deployment }) {
this.setState({
loading: true,
loadingMessage: intl('deploy_loading_service'),
});
return ServicesActions.fetchServices(cluster).then(svcs => {
const tillerSVC =
svcs &&
svcs.find(
svc =>
svc.getIn(['metadata', 'labels', 'run']) ===
deployment.getIn(['metadata', 'name'])
);
if (!tillerSVC) {
return new Promise(resolve => {
Alert.alert(
intl('deploy_no_tiller_svc_alert_title'),
intl('deploy_no_tiller_svc_alert_subtitle'),
[
{
text: intl('cancel'),
onPress: () => this.setState({ loading: false }),
},
{
text: intl('ok'),
onPress: () =>
this.createTillerSVC({ cluster, deployment }).then(service =>
resolve(service)
),
},
]
);
});
}
return tillerSVC;
});
}
createTillerDeploy(cluster) {
this.setState({
loading: true,
loadingMessage: intl('deploy_loading_create_deploy'),
});
return DeploymentsActions.createDeployment({
cluster,
name: 'tiller-deploy',
image: 'gcr.io/kubernetes-helm/tiller:v2.0.0',
namespace: 'kube-system',
});
}
createTillerSVC({ cluster, deployment }) {
this.setState({
loading: true,
loadingMessage: intl('deploy_loading_create_service'),
});
return ServicesActions.createService({
cluster,
deployment,
type: 'NodePort',
port: 44134,
name: deployment.getIn(['metadata', 'name']),
});
}
deployChart({ chart, service, cluster }) {
return new Promise((resolve, reject) => {
this.sendChart({ chart, service, cluster, resolve, reject });
});
}
sendChart({ chart, service, cluster, resolve, reject }) {
this.deployTries--;
BaseApi.deployChart({ chart, service, cluster })
.then(r => {
resolve(r);
})
.catch(e => {
if (this.deployTries > 0) {
setTimeout(() => {
this.sendChart({ chart, service, cluster, resolve, reject });
}, 3000);
} else {
reject(e);
}
});
}
openCluster(cluster) {
this.props.navigator.popToRoot();
NavigationUtils.selectTab(0, this.props.navigator);
NavigationUtils.pushOnTab(0, {
screen: 'cabin.ClustersShow',
title: cluster.get('name'),
backButtonTitle: '',
passProps: { cluster },
});
}
}
|
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. The ASF licenses this file to You
* under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License. For additional information regarding
* copyright in this work, please see the NOTICE file in the top level
* directory of this distribution.
*/
/* This function is used to set cookies */
function setCookie(name, value, expires, path, domain, secure=true, sameSite=true) {
document.cookie = name + "=" + escape (value) +
((expires) ? "; expires=" + expires.toGMTString() : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : "") +
((sameSite) ? "; SameSite=Strict" : "");
}
/* This function is used to get cookies */
function getCookie(name) {
var prefix = name + "=";
var start = document.cookie.indexOf(prefix);
if (start===-1) {
return null;
}
var end = document.cookie.indexOf(";", start+prefix.length);
if (end===-1) {
end=document.cookie.length;
}
var value=document.cookie.substring(start+prefix.length, end);
return unescape(value);
}
/* This function is used to delete cookies */
function deleteCookie(name,path,domain) {
if (getCookie(name)) {
document.cookie = name + "=" +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
"; expires=Thu, 01-Jan-70 00:00:01 GMT";
}
}
function rememberUser(theForm) {
var expires = new Date();
expires.setTime(expires.getTime() + 24 * 365 * 60 * 60 * 1000); // sets it for approx 365 days.
// sets it for entire domain, so freeroller will remember for all users
setCookie("commentAuthor",theForm.name.value,expires,"/");
setCookie("commentEmail",theForm.email.value,expires,"/");
setCookie("commentUrl",theForm.url.value,expires,"/");
}
function forgetUser(theForm) {
deleteCookie("commentAuthor","/");
deleteCookie("commentEmail","/");
deleteCookie("commentUrl","/");
}
/* This function is used to show/hide elements with a display:none style attribute */
function toggle(targetId) {
if (document.getElementById) {
target = document.getElementById(targetId);
if (target.style.display === "none") {
target.style.display = "";
} else {
target.style.display = "none";
}
}
}
/* The toggleFolder and togglePlusMinus functions are for expanding/contracting folders */
function toggleFolder(targetId) {
var expanded;
if (document.getElementById) {
target = document.getElementById(targetId);
if (target.style.display === "none") {
target.style.display = "";
expanded = true;
} else {
target.style.display = "none";
expanded = false;
}
togglePlusMinus("i" + targetId);
// set a cookie to remember this preference
var expires = new Date();
expires.setTime(expires.getTime() + 24 * 365 * 60 * 60 * 1000); // sets it for approx 365 days.
setCookie("rfolder-"+targetId,expanded,expires,"/");
}
}
function togglePlusMinus(targetId) {
if (document.getElementById) {
target = document.getElementById(targetId);
if (target.innerHTML === "+") {
target.innerHTML = "-";
} else {
target.innerHTML = "+";
}
}
}
/* This function is to set folders to expand/contract based on a user's preference */
function folderPreference(folderId) {
var folderCookie = getCookie("rfolder-"+folderId);
if (folderCookie != null) { // we have user's last setting
var folder = document.getElementById(folderId);
var plusMinus = document.getElementById("i"+folderId);
if (folderCookie === "true") { // show
folder.style.display = "";
plusMinus.innerHTML = "-";
} else { // hide
folder.style.display = "none";
plusMinus.innerHTML = "+";
}
}
}
function toggleNextRow(e) {
var checked;
if (e.type === "checkbox") {
checked = e.checked;
} else if (e.type === "radio") {
var v = e.value;
checked = (v === "1" || v === "y" || v === "true");
}
// var nextRow = e.parentNode.parentNode.nextSibling;
// the above doesn't work on Mozilla since it treats white space as nodes
var thisRow = e.parentNode.parentNode;
var tableBody = thisRow.parentNode;
var nextRow = tableBody.getElementsByTagName("tr")[thisRow.rowIndex+1];
if (checked === true) {
nextRow.style.display = "";
} else {
nextRow.style.display = "none";
}
}
function toggleControl(toggleId, targetId) {
var expanded;
if (document.getElementById) {
target = document.getElementById(targetId);
toggle = document.getElementById(toggleId);
if (target.style.display === "none") {
target.style.display = "";
expanded = true;
} else {
target.style.display = "none";
expanded = false;
}
togglePlusMinus("i" + targetId);
// set a cookie to remember this preference
var expires = new Date();
expires.setTime(expires.getTime() + 24 * 365 * 60 * 60 * 1000); // sets it for approx 365 days.
setCookie("control_"+targetId,expanded,expires,"/");
}
}
function isblank(s) {
for (var i=0; i<s.length; s++) {
var c = s.charAt(i);
if ((c!==' ') && (c!=='\n') && (c!=='')) return false;
}
return true;
}
// Show the document's title on the status bar
window.defaultStatus=document.title;
// Toggle check boxes
function toggleFunctionAll(toggleValue) {
var inputs = document.getElementsByTagName('input');
for(var i = 0; i < inputs.length ; i++) {
if(inputs[i].name !== "control" && inputs[i].type === 'checkbox' && inputs[i].disabled === false ) {
if (inputs[i].checked === true){
inputs[i].checked = !inputs[i].checked;
} else{
inputs[i].checked = toggleValue;
}
}
}
}
function toggleFunction(toggleValue,name) {
var inputs = document.getElementsByName(name);
for(var i = 0; i < inputs.length ; i++) {
if(inputs[i].type === 'checkbox' && inputs[i].disabled === false) {
inputs[i].checked = toggleValue;
}
}
}
function isValidUrl(url) {
return /^(http|https|ftp):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/i.test(url);
}
function validateEmail(email) {
var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(email);
}
$(document).ready(function () {
jQuery("form.validate-form").validate();
// Added method to check valid email address and add a custom error message
jQuery.validator.addMethod(
"regex",
function(value, element, regexp) {
if (regexp && regexp.constructor != RegExp) {
regexp = new RegExp(regexp);
} else if (regexp.global) {
regexp.lastIndex = 0;
}
return this.optional(element) || regexp.test(value);
}
);
// Applied email rules to field with class name validate-email
jQuery( ".validate-email" ).rules( "add", {
minlength: 3,
maxlength: 255,
email: true,
regex: /^\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b$/i
});
});
|
define("ace/theme/idle_fingers",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!0,t.cssClass="ace-idle-fingers",t.cssText=".ace-idle-fingers .ace_gutter {background: #3b3b3b;color: #fff}.ace-idle-fingers .ace_print-margin {width: 1px;background: #3b3b3b}.ace-idle-fingers {background-color: #323232;color: #FFFFFF}.ace-idle-fingers .ace_text-layer {color: #FFFFFF}.ace-idle-fingers .ace_cursor {border-left: 2px solid #91FF00}.ace-idle-fingers .ace_overwrite-cursors .ace_cursor {border-left: 0px;border-bottom: 1px solid #91FF00}.ace-idle-fingers .ace_marker-layer .ace_selection {background: rgba(90, 100, 126, 0.88)}.ace-idle-fingers.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #323232;border-radius: 2px}.ace-idle-fingers .ace_marker-layer .ace_step {background: rgb(102, 82, 0)}.ace-idle-fingers .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid #404040}.ace-idle-fingers .ace_marker-layer .ace_active-line {background: #353637}.ace-idle-fingers .ace_gutter-active-line {background-color: #353637}.ace-idle-fingers .ace_marker-layer .ace_selected-word {border: 1px solid rgba(90, 100, 126, 0.88)}.ace-idle-fingers .ace_invisible {color: #404040}.ace-idle-fingers .ace_keyword,.ace-idle-fingers .ace_meta {color: #CC7833}.ace-idle-fingers .ace_constant,.ace-idle-fingers .ace_constant.ace_character,.ace-idle-fingers .ace_constant.ace_character.ace_escape,.ace-idle-fingers .ace_constant.ace_other,.ace-idle-fingers .ace_support.ace_constant {color: #6C99BB}.ace-idle-fingers .ace_invalid {color: #FFFFFF;background-color: #FF0000}.ace-idle-fingers .ace_fold {background-color: #CC7833;border-color: #FFFFFF}.ace-idle-fingers .ace_support.ace_function {color: #B83426}.ace-idle-fingers .ace_variable.ace_parameter {font-style: italic}.ace-idle-fingers .ace_string {color: #A5C261}.ace-idle-fingers .ace_string.ace_regexp {color: #CCCC33}.ace-idle-fingers .ace_comment {font-style: italic;color: #BC9458}.ace-idle-fingers .ace_meta.ace_tag {color: #FFE5BB}.ace-idle-fingers .ace_entity.ace_name {color: #FFC66D}.ace-idle-fingers .ace_markup.ace_underline {text-decoration: underline}.ace-idle-fingers .ace_collab.ace_user1 {color: #323232;background-color: #FFF980}.ace-idle-fingers .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMwMjLyZYiPj/8PAAreAwAI1+g0AAAAAElFTkSuQmCC) right repeat-y;}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)})
|
// config/database.js
module.exports = {
'url' : 'mongodb+srv://demo:demo@cluster0-92dvh.mongodb.net/test?retryWrites=true',
'dbName': 'demo'
};
|
const Redis = require("./db/redis");
const { Store } = require("koa-session2");
class RedisStore extends Store {
async get(sid, ctx) {
// console.log('get', sid)
let data = await Redis.get(`SESSION:${sid}`);
return JSON.parse(data);
}
async set(session, { sid = this.getID(24), maxAge = 1000000 } = {}, ctx) {
// console.log('set', sid, maxAge)
try {
// Use redis set EX to automatically drop expired sessions
await Redis.setEx(`SESSION:${sid}`, JSON.stringify(session), maxAge / 1000);
} catch (e) {
console.error(e)
}
return sid;
}
destroy(sid, ctx) {
// console.log('destroy', sid)
return Redis.del(`SESSION:${sid}`);
}
}
module.exports = RedisStore;
|
import Vue from 'vue';
import {
// Affix,
// Anchor,
// AutoComplete,
Alert,
// Avatar,
// BackTop,
// Badge,
// Breadcrumb,
Button,
// Calendar,
// Card,
// Collapse,
// Carousel,
// Cascader,
// Checkbox,
Col,
// DatePicker,
// Divider,
// Dropdown,
Form,
Icon,
Input,
// InputNumber,
Layout,
// List,
// LocaleProvider,
message,
Menu,
Modal,
// notification,
// Pagination,
// Popconfirm,
// Popover,
// Progress,
// Radio,
// Rate,
Row,
Select,
// Slider,
// Spin,
// Statistic,
// Steps,
// Switch,
// Table,
// Transfer,
// Tree,
// TreeSelect,
// Tabs,
Tag,
// TimePicker,
// Timeline,
// Tooltip,
// Mention,
// Upload,
// version,
// Drawer,
// Skeleton,
// Comment,
// ConfigProvider,
// Empty,
// Base,
} from 'ant-design-vue';
Vue.prototype.$message = message;
// Vue.prototype.$notification = notification;
// Vue.prototype.$info = Modal.info;
// Vue.prototype.$success = Modal.success;
// Vue.prototype.$error = Modal.error;
// Vue.prototype.$warning = Modal.warning;
// Vue.prototype.$confirm = Modal.confirm;
// Vue.prototype.$destroyAll = Modal.destroyAll;
/* v1.1.3+ registration methods */
// Vue.use(Base);
// Vue.use(Affix);
// Vue.use(Anchor);
// Vue.use(AutoComplete);
Vue.use(Alert);
// Vue.use(Avatar);
// Vue.use(BackTop);
// Vue.use(Badge);
// Vue.use(Breadcrumb);
Vue.use(Button);
// Vue.use(Calendar);
// Vue.use(Card);
// Vue.use(Collapse);
// Vue.use(Carousel);
// Vue.use(Cascader);
// Vue.use(Checkbox);
Vue.use(Col);
// Vue.use(DatePicker);
// Vue.use(Divider);
// Vue.use(Drawer);
// Vue.use(Dropdown);
Vue.use(Form);
Vue.use(Icon);
Vue.use(Input);
// Vue.use(InputNumber);
Vue.use(Layout);
// Vue.use(List);
// Vue.use(LocaleProvider);
Vue.use(Menu);
Vue.use(Modal);
// Vue.use(Pagination);
// Vue.use(Popconfirm);
// Vue.use(Popover);
// Vue.use(Progress);
// Vue.use(Radio);
// Vue.use(Rate);
Vue.use(Row);
Vue.use(Select);
// Vue.use(Slider);
// Vue.use(Spin);
// Vue.use(Statistic);
// Vue.use(Steps);
// Vue.use(Switch);
// Vue.use(Table);
// Vue.use(Transfer);
// Vue.use(Tree);
// Vue.use(TreeSelect);
// Vue.use(Tabs);
Vue.use(Tag);
// Vue.use(TimePicker);
// Vue.use(Timeline);
// Vue.use(Tooltip);
// Vue.use(Upload);
// Vue.use(Skeleton);
// Vue.use(Comment);
// Vue.use(ConfigProvider);
// Vue.use(Empty);
|
import Ember from 'ember';
import {
scaleSequential,
interpolateViridis,
interpolateInferno,
interpolateMagma,
interpolatePlasma,
interpolateWarm,
interpolateCool,
interpolateRainbow,
interpolateCubehelixDefault
} from 'd3-scale';
const {
assert,
isPresent,
String: { camelize, underscore },
} = Ember;
const SCALES = {
viridis: interpolateViridis,
inferno: interpolateInferno,
magma: interpolateMagma,
plasma: interpolatePlasma,
warm: interpolateWarm,
cool: interpolateCool,
rainbow: interpolateRainbow,
cubehelix: interpolateCubehelixDefault,
};
export function seqColorScale([type, domain]) {
let capType = camelize(underscore(type.toString()).replace(/^interpolate/, ''));
let interpolator = SCALES[capType];
assert(`${capType} ${type} is not a valid sequential color interpolator, please see d3-scale for options`, isPresent(interpolator));
let scale = scaleSequential(interpolator);
// If a domain was provided.
if (isPresent(domain)) {
scale.domain(domain);
}
return scale;
}
export default Ember.Helper.helper(seqColorScale);
|
define([
'underscore',
'backbone'
], function(_, Backbone) {
var ExecutionTypeModel = Backbone.Model.extend({
defaults: {
id: 0,
name: '',
description: ''
},
initialize: function() {
},
urlRoot: '/api/executiontypes'
});
return ExecutionTypeModel;
});
|
let a = "outside";
function f([{
[a]: g
}]) {
let z = "inside";
return g;
}
|
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { checkLicenseGenerator } from './cluster_alerts/check_license';
import { LOGGING_TAG } from '../common/constants';
/*
* Expose xpackInfo for the Monitoring cluster as server.plugins.monitoring.info
*/
export const initMonitoringXpackInfo = async server => {
const config = server.config();
const xpackInfoOptions = {
clusterSource: 'monitoring',
pollFrequencyInMillis: config.get('xpack.monitoring.xpack_api_polling_frequency_millis')
};
const xpackInfo = server.plugins.xpack_main.createXPackInfo(xpackInfoOptions);
xpackInfo.feature('monitoring').registerLicenseCheckResultsGenerator(checkLicenseGenerator);
server.expose('info', xpackInfo);
// check if X-Pack is installed on Monitoring Cluster
const xpackInfoTest = await xpackInfo.refreshNow();
if (!xpackInfoTest.isAvailable()) {
server.log([LOGGING_TAG, 'warning'], `X-Pack Monitoring Cluster Alerts will not be available: ${xpackInfoTest.unavailableReason()}`);
}
};
|
/**
* Select2 Italian translation
*/
(function ($) {
"use strict";
$.extend($.fn.select2.defaults, {
formatNoMatches: function () { return "Nessuna corrispondenza trovata"; },
formatInputTooShort: function (input, min) { var n = min - input.length; return "Inserisci ancora " + n + " caratter" + (n == 1? "e" : "i"); },
formatInputTooLong: function (input, max) { var n = input.length - max; return "Inserisci " + n + " caratter" + (n == 1? "e" : "i") + " in meno"; },
formatSelectionTooBig: function (limit) { return "Puoi selezionare solo " + limit + " element" + (limit == 1 ? "o" : "i"); },
formatLoadMore: function (pageNumber) { return "Caricamento in corso…"; },
formatSearching: function () { return "Ricerca…"; }
});
})($vic);
|
import AuthorizedLink from './AuthorizedLink';
import AuthorizedRoute from './AuthorizedRoute';
import NotAuthorizedRoute from './NotAuthorizedRoute';
import NotFoundRoute from './NotFoundRoute';
export {AuthorizedLink, AuthorizedRoute, NotAuthorizedRoute, NotFoundRoute};
|
function parse()
{
if (text.indexOf(']:') < 0)
{
return;
}
var m, regexp = /^\x1A* {0,3}\[([^\x17\]]+)\]: *([^[\s\x17]+ *(?:"[^\x17]*?"|'[^\x17]*?'|\([^\x17)]*\))?) *(?=$|\x17)\n?/gm;
while (m = regexp.exec(text))
{
addIgnoreTag(+m['index'], m[0].length);
// Only add the reference if it does not already exist
var id = m[1].toLowerCase();
if (!linkReferences[id])
{
hasReferences = true;
linkReferences[id] = m[2];
}
}
}
|
// COPYRIGHT © 2018 Esri
//
// All rights reserved under the copyright laws of the United States
// and applicable international laws, treaties, and conventions.
//
// This material is licensed for use under the Esri Master License
// Agreement (MLA), and is bound by the terms of that agreement.
// You may redistribute and use this code without modification,
// provided you adhere to the terms of the MLA and include this
// copyright notice.
//
// See use restrictions at http://www.esri.com/legal/pdfs/mla_e204_e300/english
//
// For additional information, contact:
// Environmental Systems Research Institute, Inc.
// Attn: Contracts and Legal Services Department
// 380 New York Street
// Redlands, California, USA 92373
// USA
//
// email: contracts@esri.com
//
// See http://js.arcgis.com/4.10/esri/copyright.txt for details.
define(["require","exports","../../../../../core/tsSupport/extendsHelper","../../../../../core/libs/gl-matrix-2/gl-matrix","../../../support/Evented","../../../support/mathUtils","../../../support/buffer/BufferView","../../../support/buffer/InterleavedLayout","../../../../webgl/Util"],function(t,e,i,r,o,a,n,s,f){function l(t){var e=s.newLayout().mat4f64("localTransform").mat4f64("globalTransform").vec4f64("boundingSphere").vec3f64("modelOrigin").mat3f("model").mat3f("modelNormal").f32("modelScaleFactor");return t.indexOf("color")>=0&&(e=e.vec4f("color")),t.indexOf("featureAttribute")>=0&&(e=e.vec4f("featureAttribute")),e=e.u8("state").u8("lodLevel").alignTo(4)}Object.defineProperty(e,"__esModule",{value:!0});var c,u=f.assert;!function(t){t[t.ALLOCATED=1]="ALLOCATED",t[t.ACTIVE=2]="ACTIVE",t[t.VISIBLE=4]="VISIBLE",t[t.HIGHLIGHT=8]="HIGHLIGHT",t[t.HIGHLIGHT_ACTIVE=16]="HIGHLIGHT_ACTIVE",t[t.REMOVE=32]="REMOVE",t[t.TRANSFORM_CHANGED=64]="TRANSFORM_CHANGED"}(c=e.StateFlags||(e.StateFlags={}));var h=function(){function t(t){this.localTransform=t.getField("localTransform",n.BufferViewMat4f64),this.globalTransform=t.getField("globalTransform",n.BufferViewMat4f64),this.modelOrigin=t.getField("modelOrigin",n.BufferViewVec3f64),this.model=t.getField("model",n.BufferViewMat3f),this.modelNormal=t.getField("modelNormal",n.BufferViewMat3f),this.modelScaleFactor=t.getField("modelScaleFactor",n.BufferViewFloat),this.boundingSphere=t.getField("boundingSphere",n.BufferViewVec4f64),this.color=t.getField("color",n.BufferViewVec4f),this.featureAttribute=t.getField("featureAttribute",n.BufferViewVec4f),this.state=t.getField("state",n.BufferViewUint8),this.lodLevel=t.getField("lodLevel",n.BufferViewUint8)}return t}();e.View=h;var p=function(t){function e(e,i){var r=t.call(this)||this;return r._capacity=0,r._size=0,r._next=0,r._layout=l(e),r._shaderTransformation=i,r}return i(e,t),Object.defineProperty(e.prototype,"capacity",{get:function(){return this._capacity},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"buffer",{get:function(){return this._buffer.buffer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"view",{get:function(){return this._view},enumerable:!0,configurable:!0}),e.prototype.addInstance=function(){this._size+1>this._capacity&&this.grow();var t=this.findSlot();return this._view.state.set(t,c.ALLOCATED),this._size++,this.emit("instance-added",{index:t}),t},e.prototype.removeInstance=function(t){var e=this._view.state;u(t>=0&&t<this._capacity&&e.get(t)&c.ALLOCATED,"invalid instance handle"),this.getStateFlag(t,c.ACTIVE)?this.setStateFlags(t,c.REMOVE):this.freeInstance(t),this.emit("instance-removed",{index:t})},e.prototype.freeInstance=function(t){var e=this._view.state;u(t>=0&&t<this._capacity&&e.get(t)&c.ALLOCATED,"invalid instance handle"),e.set(t,0),this._size--},e.prototype.setLocalTransform=function(t,e,i){void 0===i&&(i=!0),this._view.localTransform.setMat(t,e),i&&this.updateModelTransform(t)},e.prototype.getLocalTransform=function(t,e){this._view.localTransform.getMat(t,e)},e.prototype.setGlobalTransform=function(t,e,i){void 0===i&&(i=!0),this._view.globalTransform.setMat(t,e),i&&this.updateModelTransform(t)},e.prototype.getGlobalTransform=function(t,e){this._view.globalTransform.getMat(t,e)},e.prototype.updateModelTransform=function(t){var e=this._view,i=m,o=v;e.localTransform.getMat(t,_),e.globalTransform.getMat(t,y);var n=r.mat4.multiply(y,y,_);r.vec3.set(i,n[12],n[13],n[14]),e.modelOrigin.setVec(t,i),r.mat3.fromMat4(o,n),e.model.setMat(t,o),e.modelScaleFactor.set(t,a.maxScale(n)),r.mat3.invert(o,o),r.mat3.transpose(o,o),e.modelNormal.setMat(t,o),this.setStateFlags(t,c.TRANSFORM_CHANGED),this.emit("instance-transform-changed",{index:t})},e.prototype.getModelTransform=function(t,e){var i=this._view;i.model.getMat(t,v),i.modelOrigin.getVec(t,m),e[0]=v[0],e[1]=v[1],e[2]=v[2],e[3]=0,e[4]=v[3],e[5]=v[4],e[6]=v[5],e[7]=0,e[8]=v[6],e[9]=v[7],e[10]=v[8],e[11]=0,e[12]=m[0],e[13]=m[1],e[14]=m[2],e[15]=1},e.prototype.applyShaderTransformation=function(t,e){this._shaderTransformation&&this._shaderTransformation.applyTransform(this,t,e)},e.prototype.getCombinedModelTransform=function(t,e){return this.getModelTransform(t,e),this._shaderTransformation&&this._shaderTransformation.applyTransform(this,t,e),e},e.prototype.getCombinedLocalTransform=function(t,e){return this._view.localTransform.getMat(t,e),this._shaderTransformation&&this._shaderTransformation.applyTransform(this,t,e),e},e.prototype.getCombinedScaleFactor=function(t){var e=this._view.modelScaleFactor.get(t);return this._shaderTransformation&&(e*=this._shaderTransformation.scaleFactor(this,t)),e},e.prototype.getModel=function(t,e){this._view.model.getMat(t,e)},e.prototype.getScaleFactor=function(t){return this._view.modelScaleFactor.get(t)},e.prototype.setFeatureAttribute=function(t,e){this._view.featureAttribute.setVec(t,e)},e.prototype.getFeatureAttribute=function(t,e){this._view.featureAttribute.getVec(t,e)},e.prototype.setColor=function(t,e){this._view.color.setVec(t,e)},e.prototype.getColor=function(t,e){this._view.color.getVec(t,e)},e.prototype.setVisible=function(t,e){e!==this.getVisible(t)&&(this.setStateFlag(t,c.VISIBLE,e),this.emit("instance-visibility-changed",{index:t}))},e.prototype.getVisible=function(t){return this.getStateFlag(t,c.VISIBLE)},e.prototype.setHighlight=function(t,e){e!==this.getHighlight(t)&&(this.setStateFlag(t,c.HIGHLIGHT,e),this.emit("instance-highlight-changed",{index:t}))},e.prototype.getHighlight=function(t){return this.getStateFlag(t,c.HIGHLIGHT)},e.prototype.getState=function(t){return this._view.state.get(t)},e.prototype.getLodLevel=function(t){return this._view.lodLevel.get(t)},e.prototype.countFlags=function(t){for(var e=0,i=0;i<this._capacity;++i){this.getState(i)&t&&++e}return e},e.prototype.setStateFlags=function(t,e){var i=this._view.state;e=i.get(t)|e,i.set(t,e)},e.prototype.clearStateFlags=function(t,e){var i=this._view.state;e=i.get(t)&~e,i.set(t,e)},e.prototype.setStateFlag=function(t,e,i){i?this.setStateFlags(t,e):this.clearStateFlags(t,e)},e.prototype.getStateFlag=function(t,e){return!!(this._view.state.get(t)&e)},e.prototype.grow=function(){var t=Math.max(g,Math.floor(this._capacity*d)),e=this._layout.createBuffer(t);if(this._buffer){var i=new Uint8Array(this._buffer.buffer);new Uint8Array(e.buffer).set(i)}this._capacity=t,this._buffer=e,this._view=new h(this._buffer)},e.prototype.findSlot=function(){for(var t=this._view.state,e=this._next;t.get(e)&c.ALLOCATED;)e=(e+1)%this._capacity;return this._next=(e+1)%this._capacity,e},e}(o.Evented);e.InstanceData=p;var g=1024,d=2,m=r.vec3f64.create(),v=r.mat3f64.create(),_=r.mat4f64.create(),y=r.mat4f64.create()});
|
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const react_1 = __importDefault(require("react"));
const ReactComponent = props => (react_1.default.createElement("svg", Object.assign({ viewBox: "0 0 24 24", width: "1em", height: "1em" }, props),
react_1.default.createElement("path", { fill: "none", d: "M0 0h24v24H0V0z" }),
react_1.default.createElement("g", null,
react_1.default.createElement("path", { d: "M7 21h2v-2H7v2zm0-8h2v-2H7v2zm4 0h2v-2h-2v2zm0 8h2v-2h-2v2zm-8-4h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2v-2H3v2zm0-4h2V7H3v2zm8 8h2v-2h-2v2zm8-8h2V7h-2v2zm0 4h2v-2h-2v2zM3 3v2h18V3H3zm16 14h2v-2h-2v2zm-4 4h2v-2h-2v2zM11 9h2V7h-2v2zm8 12h2v-2h-2v2zm-4-8h2v-2h-2v2z" }))));
exports.default = ReactComponent;
|
/* eslint-disable linebreak-style */
/** *********************************************************
* Copyright (C) 2022
* Worktez
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the MIT License
*
*
* This program 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 MIT License for more details.
***********************************************************/
const {updatePatchData, getPatchData} = require("../lib");
exports.editPatch = function(request, response) {
const name = request.body.data.Name;
const description = request.body.data.Description;
const patchId = request.body.data.Id;
const updatedOn = request.body.data.UpdatedOn;
let status = 200;
const editPatchPromise = getPatchData(patchId).then((patch) => {
if (patch != undefined) {
const updatePatchJson = {
Name: name,
Description: description,
UpdatedOn: updatedOn,
};
updatePatchData(patchId, updatePatchJson);
}
}).catch((error) => {
status = 500;
console.log("Error: ", error);
});
const Promises = [editPatchPromise];
return Promise.all(Promises).then(() => {
return response.status(status).json({data: "success"});
})
.catch((error) => {
console.error("Error Editing Patch: ", error);
});
};
|
/**
* Default State
*/
const defaultAuth = {
user: null,
token: localStorage.getItem('token'),
role: localStorage.getItem('role'),
approve: localStorage.getItem('approve'),
personalVerify: false,
message: '',
error: false,
newUser: true,
};
const defaultSignup = {
message: null,
personalVerify: false,
error: false,
};
/**
* Action Constansts
*/
const AUTHENTICATE_REQUEST_SUCCESS = 'auth/AUTHENTICATE_REQUEST_SUCCESS';
const AUTHENTICATE_REQUEST_FAILURE = 'auth/AUTHENTICATE_REQUEST_FAILURE';
const LOGOUT_REQUEST_SUCCESS = 'auth/LOGOUT_REQUEST_SUCCESS';
const SIGNUP_REQUEST_FAILURE = 'auth/SIGNUP_REQUEST_FAILURE';
const SIGNUP_REQUEST_SUCCESS = 'auth/SIGNUP_REQUEST_SUCCESS';
const UPDATE_PASSWORD_FAILURE = 'auth/UPDATE_PASSWORD_FAILURE';
const UPDATE_PASSWORD_SUCCESS = 'auth/UPDATE_PASSWORD_SUCCESS';
/**
* Actions
*/
export function authenticateSuccess(data) {
return { type: AUTHENTICATE_REQUEST_SUCCESS, data };
}
export function authenticateFailure(data) {
return { type: AUTHENTICATE_REQUEST_FAILURE, data };
}
export function logoutRequestSuccess() {
return { type: LOGOUT_REQUEST_SUCCESS };
}
export function signupFailure(data) {
return { type: SIGNUP_REQUEST_FAILURE, data };
}
export function signupSuccess(data) {
return { type: SIGNUP_REQUEST_SUCCESS, data };
}
export function updatePasswordFailure(data) {
return { type: UPDATE_PASSWORD_FAILURE, data };
}
export function updatePasswordSuccess(data) {
return { type: UPDATE_PASSWORD_SUCCESS, data };
}
export function authReducer(state = defaultAuth, action) {
switch (action.type) {
case AUTHENTICATE_REQUEST_SUCCESS:
return Object.assign({}, state, {
token: action.data.token,
role: action.data.role,
approve: action.data.approve,
personalVerify: action.data.personalVerify,
error: false,
newUser: action.data.newUser,
});
case AUTHENTICATE_REQUEST_FAILURE:
return Object.assign({}, state, {
message: action.data.message,
error: true,
});
default:
return state;
}
}
export function signupReducer(state = defaultSignup, action) {
switch (action.type) {
case SIGNUP_REQUEST_FAILURE:
return Object.assign({}, state, {
message: action.data.message,
error: true,
});
case SIGNUP_REQUEST_SUCCESS:
return Object.assign({}, state, {
message: action.data.message,
error: false,
});
default:
return state;
}
}
|
var Event = require('./Event')
module.exports = EventEmitter
function EventEmitter() {
this.eventRegister = { }
}
EventEmitter.prototype.event = function(key) {
var event,
key
if(key instanceof Array || typeof key == 'object' && key.length) {
key = key.join('.')
} else if(key.length === 0) {
throw new Error('EventEmitter.prototype.event received empty key argument')
}
key = key.toLowerCase();
if(this.eventRegister[key]){
event = this.eventRegister[key]
}
else {
event = new Event(this, key)
this.eventRegister[key] = event
}
return event;
}
EventEmitter.prototype.emit = function(key) {
var event,
args,
slice,
key
if(key instanceof Array || typeof key == 'object' && key.length) {
key = key.join('')
}
key = key.toLowerCase()
slice = Array.prototype.slice;
event = this.eventRegister[key]
args = []
if(arguments.length > 1) {
args = slice.call(arguments, 1)
}
if(event) {
setTimeout(function() {
event.fire.apply(event, args)
},0)
}
return this
}
EventEmitter.prototype.on = function(key, handler) {
var event
event = this.event(key)
event.addHandler(handler)
return this
}
EventEmitter.prototype.off = function(key, handler) {
return this.removeAllEventListeners.apply(this, arguments)
}
EventEmitter.prototype.addEventListener = function(key, handler) {
return this.on.apply(this, arguments)
}
EventEmitter.prototype.removeEventListener = function(key, handler) {
var event,
key;
key = key.toLowerCase()
event = this.event(key)
event.removeHandler(handler);
return this;
}
EventEmitter.prototype.removeAllEventListeners = function(key) {
var key
key = key.toLowerCase()
if(this.eventRegister[key]){
delete this.eventRegister[key]
}
return this
}
EventEmitter.prototype.once = function(key, handler) {
var event
event = this.event(key)
function fireOnce() {
handler()
setTimeout(function() {
event.removeHandler(fireOnce)
},0)
}
event.addHandler(fireOnce)
return this
}
|
'use strict'
/** @type {typeof import('@adonisjs/lucid/src/Lucid/Model')} */
const Model = use('Model')
class DoseDate extends Model {
dose() {
return this.hasOne('App/Models/Dose')
}
}
module.exports = DoseDate
|
import React from 'react'
import Header from './header'
import Footer from './footer'
import '../styles/index.scss'
import layoutStyles from './layout.module.scss'
const Layout = (props) => {
return (
<div className={layoutStyles.container}>
<div className={layoutStyles.content}>
<Header></Header>
{props.children}
</div>
<Footer></Footer>
</div>
)
}
export default Layout
|
$(document).ready(function(){
giveHtml('production',1);
$('#production-btn').click(function(){
giveHtml('production',1);
})
$('#social-btn').click(function(){
giveHtml('social',2);
})
$('#about-btn').click(function(){
giveHtml('about',3);
})
$('#siteMusic').click(function(){
var oAudio = document.getElementById('background-audio');
if ($(this).hasClass('activeMusic')){
oAudio.pause();
$(this).removeClass('activeMusic');
}else{
oAudio.play();
$(this).addClass('activeMusic');
}
})
})
function giveHtml(handler,bool){
var height;
var preloader = '<div class="container" id="preloader"><i class="fa fa-spinner fa-pulse fa-3x"></i></div>';
$('#wrapper-content').html(preloader);
$.ajax({
url: "/"+ handler + '?locale=' + $('#_locale').val(),
}).done(function(html) {
$('#wrapper-content').html(html);
if (bool === 3){
ymaps.ready(init());
}
if (bool === 2){
height = $('.social-img-wrapper').width();
$('.social-img-wrapper').height(height);
}
});
}
init = function() {
var myMap, myPlacemark;
myMap = new ymaps.Map("map", {
center: [44.61660700178595,33.5251130000002],
zoom: 15
});
myPlacemark = new ymaps.Placemark([44.61660700178595,33.5251130000002]);
return myMap.geoObjects.add(myPlacemark);
};
|
// Although MongoDB doesn't enforce any data normalization, the database collections will
// benefit from at least a little bit of structure. Mongoose fills that need, allowing us
// to add rules for the data so that it's not a free-for-all. Mongoose also provides us with
// a lot of similar capabilities that Sequelize offers, like data validation, prebuilt methods
// to perform actions on a MongoDB database collection, and much more.
// We could import the entire mongoose library, but we only need to worry about the
// Schema constructor and model function, so we'll just import them.
const { Schema, model } = require('mongoose');
const dateFormat = require('../utils/dateFormat');
const PizzaSchema = new Schema(
{
pizzaName: {
type: String,
required: 'You need to provide a pizza name!',
trim: true
},
createdBy: {
type: String,
required: true,
trim: true
},
createdAt: {
type: Date,
default: Date.now,
// To use a getter in Mongoose, we just need to add the key get to the field we are
// looking to use it with in the schema. Just like a virtual, the getter will transform
// the data before it gets to the controller(s).
get: (createdAtVal) => dateFormat(createdAtVal)
},
size: {
type: String,
// If you were to provide a custom error message for the required option here, you wouldn't
// receive it if you provide a size that isn't listed in the enum option. If you want to
// provide a custom message for enumerable values, you need to look into implementing the
// validate option Mongoose lets you use, where you can create a custom function to test the
// values, just like you did with Inquirer!
required: true,
enum: ['Personal', 'Small', 'Medium', 'Large', 'Extra Large'],
default: 'Large'
},
toppings: [],
// we need to tell Mongoose to expect an ObjectId and
// to tell it that its data comes from the Comment model.
comments: [
{
type: Schema.Types.ObjectId,
ref: 'Comment'
}
]
},
// we need to tell the schema that it can use virtuals.
// we'll need to tell the Mongoose model that it should use any getter function we've specified.
{
toJSON: {
virtuals: true,
getters: true
},
// We set id to false because this is a virtual that Mongoose returns, and we don’t need it.
id: false
}
);
// get total count of comments and replies on retrieval
PizzaSchema.virtual('commentCount').get(function() {
// Here we're using the .reduce() method to tally up the total of every comment with its replies.
return this.comments.reduce((total, comment) => total + comment.replies.length + 1, 0);
});
// create the Pizza model using the PizzaSchema
const Pizza = model('Pizza', PizzaSchema);
// export the Pizza model
module.exports = Pizza;
|
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2019 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var Class = require('../utils/Class');
var FromPoints = require('../geom/rectangle/FromPoints');
var Rectangle = require('../geom/rectangle/Rectangle');
var Vector2 = require('../math/Vector2');
/**
* @classdesc
* A Base Curve class, which all other curve types extend.
*
* Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog)
*
* @class Curve
* @memberof Phaser.Curves
* @constructor
* @since 3.0.0
*
* @param {string} type - [description]
*/
var Curve = new Class({
initialize:
function Curve (type)
{
/**
* String based identifier for the type of curve.
*
* @name Phaser.Curves.Curve#type
* @type {string}
* @since 3.0.0
*/
this.type = type;
/**
* The default number of divisions within the curve.
*
* @name Phaser.Curves.Curve#defaultDivisions
* @type {integer}
* @default 5
* @since 3.0.0
*/
this.defaultDivisions = 5;
/**
* The quantity of arc length divisions within the curve.
*
* @name Phaser.Curves.Curve#arcLengthDivisions
* @type {integer}
* @default 100
* @since 3.0.0
*/
this.arcLengthDivisions = 100;
/**
* An array of cached arc length values.
*
* @name Phaser.Curves.Curve#cacheArcLengths
* @type {number[]}
* @default []
* @since 3.0.0
*/
this.cacheArcLengths = [];
/**
* Does the data of this curve need updating?
*
* @name Phaser.Curves.Curve#needsUpdate
* @type {boolean}
* @default true
* @since 3.0.0
*/
this.needsUpdate = true;
/**
* [description]
*
* @name Phaser.Curves.Curve#active
* @type {boolean}
* @default true
* @since 3.0.0
*/
this.active = true;
/**
* A temporary calculation Vector.
*
* @name Phaser.Curves.Curve#_tmpVec2A
* @type {Phaser.Math.Vector2}
* @private
* @since 3.0.0
*/
this._tmpVec2A = new Vector2();
/**
* A temporary calculation Vector.
*
* @name Phaser.Curves.Curve#_tmpVec2B
* @type {Phaser.Math.Vector2}
* @private
* @since 3.0.0
*/
this._tmpVec2B = new Vector2();
},
/**
* Draws this curve on the given Graphics object.
*
* The curve is drawn using `Graphics.strokePoints` so will be drawn at whatever the present Graphics stroke color is.
* The Graphics object is not cleared before the draw, so the curve will appear on-top of anything else already rendered to it.
*
* @method Phaser.Curves.Curve#draw
* @since 3.0.0
*
* @generic {Phaser.GameObjects.Graphics} G - [graphics,$return]
*
* @param {Phaser.GameObjects.Graphics} graphics - The Graphics instance onto which this curve will be drawn.
* @param {integer} [pointsTotal=32] - The resolution of the curve. The higher the value the smoother it will render, at the cost of rendering performance.
*
* @return {Phaser.GameObjects.Graphics} The Graphics object to which the curve was drawn.
*/
draw: function (graphics, pointsTotal)
{
if (pointsTotal === undefined) { pointsTotal = 32; }
// So you can chain graphics calls
return graphics.strokePoints(this.getPoints(pointsTotal));
},
/**
* Returns a Rectangle where the position and dimensions match the bounds of this Curve.
*
* You can control the accuracy of the bounds. The value given is used to work out how many points
* to plot across the curve. Higher values are more accurate at the cost of calculation speed.
*
* @method Phaser.Curves.Curve#getBounds
* @since 3.0.0
*
* @param {Phaser.Geom.Rectangle} [out] - The Rectangle to store the bounds in. If falsey a new object will be created.
* @param {integer} [accuracy=16] - The accuracy of the bounds calculations.
*
* @return {Phaser.Geom.Rectangle} A Rectangle object holding the bounds of this curve. If `out` was given it will be this object.
*/
getBounds: function (out, accuracy)
{
if (!out) { out = new Rectangle(); }
if (accuracy === undefined) { accuracy = 16; }
var len = this.getLength();
if (accuracy > len)
{
accuracy = len / 2;
}
// The length of the curve in pixels
// So we'll have 1 spaced point per 'accuracy' pixels
var spaced = Math.max(1, Math.round(len / accuracy));
return FromPoints(this.getSpacedPoints(spaced), out);
},
/**
* Returns an array of points, spaced out X distance pixels apart.
* The smaller the distance, the larger the array will be.
*
* @method Phaser.Curves.Curve#getDistancePoints
* @since 3.0.0
*
* @param {integer} distance - The distance, in pixels, between each point along the curve.
*
* @return {Phaser.Geom.Point[]} An Array of Point objects.
*/
getDistancePoints: function (distance)
{
var len = this.getLength();
var spaced = Math.max(1, len / distance);
return this.getSpacedPoints(spaced);
},
/**
* [description]
*
* @method Phaser.Curves.Curve#getEndPoint
* @since 3.0.0
*
* @param {Phaser.Math.Vector2} [out] - Optional Vector object to store the result in.
*
* @return {Phaser.Math.Vector2} Vector2 containing the coordinates of the curves end point.
*/
getEndPoint: function (out)
{
if (out === undefined) { out = new Vector2(); }
return this.getPointAt(1, out);
},
/**
* Get total curve arc length
*
* @method Phaser.Curves.Curve#getLength
* @since 3.0.0
*
* @return {number} [description]
*/
getLength: function ()
{
var lengths = this.getLengths();
return lengths[lengths.length - 1];
},
/**
* Get list of cumulative segment lengths
*
* @method Phaser.Curves.Curve#getLengths
* @since 3.0.0
*
* @param {integer} [divisions] - [description]
*
* @return {number[]} [description]
*/
getLengths: function (divisions)
{
if (divisions === undefined) { divisions = this.arcLengthDivisions; }
if ((this.cacheArcLengths.length === divisions + 1) && !this.needsUpdate)
{
return this.cacheArcLengths;
}
this.needsUpdate = false;
var cache = [];
var current;
var last = this.getPoint(0, this._tmpVec2A);
var sum = 0;
cache.push(0);
for (var p = 1; p <= divisions; p++)
{
current = this.getPoint(p / divisions, this._tmpVec2B);
sum += current.distance(last);
cache.push(sum);
last.copy(current);
}
this.cacheArcLengths = cache;
return cache; // { sums: cache, sum:sum }; Sum is in the last element.
},
// Get point at relative position in curve according to arc length
// - u [0 .. 1]
/**
* [description]
*
* @method Phaser.Curves.Curve#getPointAt
* @since 3.0.0
*
* @generic {Phaser.Math.Vector2} O - [out,$return]
*
* @param {number} u - [description]
* @param {Phaser.Math.Vector2} [out] - [description]
*
* @return {Phaser.Math.Vector2} [description]
*/
getPointAt: function (u, out)
{
var t = this.getUtoTmapping(u);
return this.getPoint(t, out);
},
// Get sequence of points using getPoint( t )
/**
* [description]
*
* @method Phaser.Curves.Curve#getPoints
* @since 3.0.0
*
* @param {integer} divisions - The number of evenly spaced points from the curve to return. If falsy, step param will be used to calculate the number of points.
* @param {number} step - Step between points. Used to calculate the number of points to return when divisions is falsy. Ignored if divisions is positive.
* @param {(array|Phaser.Math.Vector2[])} [out] - An optional array to store the points in.
*
* @return {(array|Phaser.Math.Vector2[])} An array of Points from the curve.
*/
getPoints: function (divisions, stepRate, out)
{
if (out === undefined) { out = []; }
// If divisions is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead.
if (!divisions)
{
if (!stepRate)
{
divisions = this.defaultDivisions;
}
else
{
divisions = this.getLength() / stepRate;
}
}
for (var d = 0; d <= divisions; d++)
{
out.push(this.getPoint(d / divisions));
}
return out;
},
/**
* [description]
*
* @method Phaser.Curves.Curve#getRandomPoint
* @since 3.0.0
*
* @generic {Phaser.Math.Vector2} O - [out,$return]
*
* @param {Phaser.Math.Vector2} [out] - [description]
*
* @return {Phaser.Math.Vector2} [description]
*/
getRandomPoint: function (out)
{
if (out === undefined) { out = new Vector2(); }
return this.getPoint(Math.random(), out);
},
// Get sequence of points using getPointAt( u )
/**
* [description]
*
* @method Phaser.Curves.Curve#getSpacedPoints
* @since 3.0.0
*
* @param {integer} [divisions] - [description]
*
* @return {Phaser.Math.Vector2[]} [description]
*/
getSpacedPoints: function (divisions)
{
if (divisions === undefined) { divisions = this.defaultDivisions; }
var points = [];
for (var d = 0; d <= divisions; d++)
{
var t = this.getUtoTmapping(d / divisions, null, divisions);
points.push(this.getPoint(t));
}
return points;
},
/**
* [description]
*
* @method Phaser.Curves.Curve#getStartPoint
* @since 3.0.0
*
* @generic {Phaser.Math.Vector2} O - [out,$return]
*
* @param {Phaser.Math.Vector2} [out] - [description]
*
* @return {Phaser.Math.Vector2} [description]
*/
getStartPoint: function (out)
{
if (out === undefined) { out = new Vector2(); }
return this.getPointAt(0, out);
},
/**
* Returns a unit vector tangent at t
* In case any sub curve does not implement its tangent derivation,
* 2 points a small delta apart will be used to find its gradient
* which seems to give a reasonable approximation
*
* @method Phaser.Curves.Curve#getTangent
* @since 3.0.0
*
* @generic {Phaser.Math.Vector2} O - [out,$return]
*
* @param {number} t - [description]
* @param {Phaser.Math.Vector2} [out] - [description]
*
* @return {Phaser.Math.Vector2} Vector approximating the tangent line at the point t (delta +/- 0.0001)
*/
getTangent: function (t, out)
{
if (out === undefined) { out = new Vector2(); }
var delta = 0.0001;
var t1 = t - delta;
var t2 = t + delta;
// Capping in case of danger
if (t1 < 0)
{
t1 = 0;
}
if (t2 > 1)
{
t2 = 1;
}
this.getPoint(t1, this._tmpVec2A);
this.getPoint(t2, out);
return out.subtract(this._tmpVec2A).normalize();
},
/**
* [description]
*
* @method Phaser.Curves.Curve#getTangentAt
* @since 3.0.0
*
* @generic {Phaser.Math.Vector2} O - [out,$return]
*
* @param {number} u - [description]
* @param {Phaser.Math.Vector2} [out] - [description]
*
* @return {Phaser.Math.Vector2} [description]
*/
getTangentAt: function (u, out)
{
var t = this.getUtoTmapping(u);
return this.getTangent(t, out);
},
// Given a distance in pixels, get a t to find p.
/**
* [description]
*
* @method Phaser.Curves.Curve#getTFromDistance
* @since 3.0.0
*
* @param {integer} distance - [description]
* @param {integer} [divisions] - [description]
*
* @return {number} [description]
*/
getTFromDistance: function (distance, divisions)
{
if (distance <= 0)
{
return 0;
}
return this.getUtoTmapping(0, distance, divisions);
},
// Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equidistant
/**
* [description]
*
* @method Phaser.Curves.Curve#getUtoTmapping
* @since 3.0.0
*
* @param {number} u - [description]
* @param {integer} distance - [description]
* @param {integer} [divisions] - [description]
*
* @return {number} [description]
*/
getUtoTmapping: function (u, distance, divisions)
{
var arcLengths = this.getLengths(divisions);
var i = 0;
var il = arcLengths.length;
var targetArcLength; // The targeted u distance value to get
if (distance)
{
// Cannot overshoot the curve
targetArcLength = Math.min(distance, arcLengths[il - 1]);
}
else
{
targetArcLength = u * arcLengths[il - 1];
}
// binary search for the index with largest value smaller than target u distance
var low = 0;
var high = il - 1;
var comparison;
while (low <= high)
{
i = Math.floor(low + (high - low) / 2); // less likely to overflow, though probably not issue here, JS doesn't really have integers, all numbers are floats
comparison = arcLengths[i] - targetArcLength;
if (comparison < 0)
{
low = i + 1;
}
else if (comparison > 0)
{
high = i - 1;
}
else
{
high = i;
break;
}
}
i = high;
if (arcLengths[i] === targetArcLength)
{
return i / (il - 1);
}
// we could get finer grain at lengths, or use simple interpolation between two points
var lengthBefore = arcLengths[i];
var lengthAfter = arcLengths[i + 1];
var segmentLength = lengthAfter - lengthBefore;
// determine where we are between the 'before' and 'after' points
var segmentFraction = (targetArcLength - lengthBefore) / segmentLength;
// add that fractional amount to t
return (i + segmentFraction) / (il - 1);
},
/**
* [description]
*
* @method Phaser.Curves.Curve#updateArcLengths
* @since 3.0.0
*/
updateArcLengths: function ()
{
this.needsUpdate = true;
this.getLengths();
}
});
module.exports = Curve;
|
import { useServerSideEffect } from 'webshift';
import axios from 'axios';
import logger from '@logger';
export default function Posts() {
logger.verbose({message: "[Render]", meta: { component: 'Users'}});
const [data, error] = useServerSideEffect('posts', () => {
return axios.get("https://jsonplaceholder.typicode.com/posts");
}, []);
return (
<div>
<h2>Posts</h2>
<ul>
{ data?.map(item => (
<li key={ item?.id }>
<h3>{ item?.title }</h3>
<p>{ item?.body }</p>
</li>
)) }
</ul>
</div>
);
}
|
'use strict';
import { Command } from 'axoncore';
class Pong extends Command {
constructor(module) {
super(module);
this.label = 'pong';
this.aliases = ['pong'];
this.isSubcmd = true;
this.hasSubcmd = false;
this.infos = {
owner: ['KhaaZ'],
name: 'ping pong',
description: 'Pong the bot.',
usage: 'ping pong',
examples: ['ping pong'],
};
this.options.argsMin = 0;
this.options.cooldown = 3000;
this.options.guildOnly = false;
}
async execute({ msg }) {
const start = Date.now();
const mess = await this.sendMessage(msg.channel, 'BADABOUM!');
if (!mess) {
return;
}
const diff = (Date.now() - start);
return this.editMessage(mess, `BADABOUM! \`${diff}ms\``);
}
}
export default Pong;
|
/**
* @fileoverview Defines PCx86 CPU constants
* @author Jeff Parsons <Jeff@pcjs.org>
* @copyright © 2012-2021 Jeff Parsons
* @license MIT <https://www.pcjs.org/LICENSE.txt>
*
* This file is part of PCjs, a computer emulation software project at <https://www.pcjs.org>.
*/
"use strict";
var X86 = {
/*
* CPU model numbers (supported)
*/
MODEL_8086: 8086,
MODEL_8088: 8088,
MODEL_80186: 80186,
MODEL_80188: 80188,
MODEL_80286: 80286,
MODEL_80386: 80386,
/*
* 80386 CPU stepping identifiers (supported)
*/
STEPPING_80386_A0: (80386+0xA0), // we have very little information about this stepping...
STEPPING_80386_A1: (80386+0xA1), // we know much more about the A1 stepping (see /blog/2015/02/23/README.md)
STEPPING_80386_B0: (80386+0xB0), // for now, the only B0 difference in PCx86 is support for XBTS and IBTS
STEPPING_80386_B1: (80386+0xB1), // our implementation of the B1 stepping also includes the infamous 32-bit multiplication bug
STEPPING_80386_B2: (80386+0xB2), // this is an imaginary stepping that simply means "B1 without the 32-bit multiplication bug" (ie, a B1 with the "double sigma" stamp)
STEPPING_80386_C0: (80386+0xC0), // this presumably fixed lots of B1 issues, but it seems to have been quickly superseded by the D0
STEPPING_80386_D0: (80386+0xD0), // we don't have any detailed information (eg, errata) for these later steppings
STEPPING_80386_D1: (80386+0xD1),
STEPPING_80386_D2: (80386+0xD2),
/*
* This constant is used to mark points in the code where the physical address being returned
* is invalid and should not be used.
*
* This value is also used to indicate non-existent EA address calculations, which are usually
* detected with "regEA === ADDR_INVALID" and "regEAWrite === ADDR_INVALID" tests. Which means
* that, technically, we should not use any signed 32-bit value, such as -1 (0xffffffff), since
* that could also be a valid address on a 32-bit CPU. So we also leave open the possibility of
* using a non-numeric value such undefined or null, which is why all ADDR_INVALID tests should
* use strict equality operators.
*
* WARNING: Like many of the properties defined here, ADDR_INVALID is a common constant, which the
* Closure Compiler will happily inline (with or without @const annotations; in fact, I've yet to
* see a @const annotation EVER improve automatic inlining). However, if you don't make ABSOLUTELY
* certain that this file is included BEFORE the first reference to any of these properties, that
* automatic inlining will no longer occur.
*/
ADDR_INVALID: -1,
/*
* Processor Exception Interrupts
*
* Of the following exceptions, all are designed to be restartable, except for 0x08 and 0x09 (and 0x0D
* after an attempt to write to a read-only segment).
*
* Error codes are pushed onto the stack for 0x08 (always 0) and 0x0A through 0x0E.
*
* Priority: Instruction exception, TRAP, NMI, Processor Extension Segment Overrun, and finally INTR.
*
* All exceptions can also occur in real-mode, except where noted. A GP_FAULT in real-mode can be triggered
* by "any memory reference instruction that attempts to reference [a] 16-bit word at offset 0xFFFF".
*
* Interrupts beyond 0x10 (up through 0x1F) are reserved for future exceptions.
*
* Implementation Detail: For any opcode we know must generate a UD_FAULT interrupt, we invoke opInvalid(),
* NOT opUndefined(). UD_FAULT is for INVALID opcodes, Intel's choice of term "undefined" notwithstanding.
*
* We reserve the term "undefined" for opcodes that require more investigation, and we invoke opUndefined()
* ONLY until an opcode's behavior has finally been defined, at which point it becomes either valid or invalid.
* The term "illegal" seems completely superfluous; we don't need a third way of describing invalid opcodes.
*
* The term "undocumented" should be limited to operations that are valid but Intel simply never documented.
*/
EXCEPTION: {
DE_EXC: 0x00, // Divide Error Exception (#DE: fault, no error code)
DB_EXC: 0x01, // Debug (aka Single Step Trap) Exception (#DB: fault or trap)
NMI: 0x02, // Non-Maskable Interrupt
BP_TRAP: 0x03, // Breakpoint Exception (#BP: trap)
OF_TRAP: 0x04, // INTO Overflow Exception (#OF: trap)
BR_FAULT: 0x05, // BOUND Error Exception (#BR: fault, no error code)
UD_FAULT: 0x06, // Invalid (aka Undefined/Illegal) Opcode (#UD: fault, no error code)
NM_FAULT: 0x07, // No Math Unit Available; see ESC or WAIT (#NM: fault, no error code)
DF_FAULT: 0x08, // Double Fault; see LIDT (#DF: fault, with error code)
MP_FAULT: 0x09, // Math Unit Protection Fault; see ESC (#MP: fault, no error code)
TS_FAULT: 0x0A, // Invalid Task State Segment Fault (#TS: fault, with error code; protected-mode only)
NP_FAULT: 0x0B, // Not Present Fault (#NP: fault, with error code; protected-mode only)
SS_FAULT: 0x0C, // Stack Fault (#SS: fault, with error code; protected-mode only)
GP_FAULT: 0x0D, // General Protection Fault (#GP: fault, with error code)
PF_FAULT: 0x0E, // Page Fault (#PF: fault, with error code)
MF_FAULT: 0x10 // Math Fault; see ESC or WAIT (#MF: fault, no error code)
},
/*
* Processor Status flag definitions (stored in regPS)
*/
PS: {
CF: 0x0001, // bit 0: Carry flag
BIT1: 0x0002, // bit 1: reserved, always set
PF: 0x0004, // bit 2: Parity flag
BIT3: 0x0008, // bit 3: reserved, always clear
AF: 0x0010, // bit 4: Auxiliary Carry flag (aka Arithmetic flag)
BIT5: 0x0020, // bit 5: reserved, always clear
ZF: 0x0040, // bit 6: Zero flag
SF: 0x0080, // bit 7: Sign flag
TF: 0x0100, // bit 8: Trap flag
IF: 0x0200, // bit 9: Interrupt flag
DF: 0x0400, // bit 10: Direction flag
OF: 0x0800, // bit 11: Overflow flag
IOPL: {
MASK: 0x3000, // bits 12-13: I/O Privilege Level (always set on 8086/80186; clear on 80286 reset)
SHIFT: 12
},
NT: 0x4000, // bit 14: Nested Task flag (always set on 8086/80186; clear on 80286 reset)
BIT15: 0x8000, // bit 15: reserved (always set on 8086/80186; clear otherwise)
RF: 0x10000, // bit 16: Resume Flag (temporarily disables debug exceptions; 80386 only)
VM: 0x20000 // bit 17: Virtual 8086 Mode (80386 only)
},
CR0: {
/*
* Machine Status Word (MSW) bit definitions
*/
MSW: {
PE: 0x0001, // protected-mode enabled
MP: 0x0002, // monitor processor extension (ie, coprocessor)
EM: 0x0004, // emulate processor extension
TS: 0x0008, // task switch indicator
ON: 0xFFF0, // on the 80286, these bits are always on (TODO: Verify)
MASK: 0xFFFF // these are the only (MSW) bits that the 80286 can access (within CR0)
},
ET: 0x00000010, // coprocessor type (80287 or 80387); always 1 on post-80386 CPUs
ON: 0x7FFFFFE0, // CR0 bits that are always on
PG: 0x80000000|0, // 0: paging disabled
},
DR7: { // Debug Control Register
L0: 0x00000001,
G0: 0x00000002,
L1: 0x00000004,
G1: 0x00000008,
L2: 0x00000010,
G2: 0x00000020,
L3: 0x00000040,
G3: 0x00000080,
ENABLE: 0x000000FF,
LE: 0x00000100,
GE: 0x00000200,
RW0: 0x00030000, // 00: exec-only 01: write-only 10: undefined 11: read/write-only
LEN0: 0x000C0000, // 00: one-byte, 01: two-byte, 10: undefined 11: four-byte
RW1: 0x00300000, // 00: exec-only 01: write-only 10: undefined 11: read/write-only
LEN1: 0x00C00000, // 00: one-byte, 01: two-byte, 10: undefined 11: four-byte
RW2: 0x03000000, // 00: exec-only 01: write-only 10: undefined 11: read/write-only
LEN2: 0x0C000000, // 00: one-byte, 01: two-byte, 10: undefined 11: four-byte
RW3: 0x30000000, // 00: exec-only 01: write-only 10: undefined 11: read/write-only
LEN3: 0xC0000000|0// 00: one-byte, 01: two-byte, 10: undefined 11: four-byte
},
DR6: { // Debug Status Register
B0: 0x00000001,
B1: 0x00000002,
B2: 0x00000004,
B3: 0x00000008,
BD: 0x00002000, // set if the next instruction will read or write one of the eight debug registers and ICE-386 is also using them
BS: 0x00004000, // set if the debug handler is entered due to the TF (trap flag) bit set in the EFLAGS register
BT: 0x00008000 // set before entering the DEBUG handler if a task switch has occurred and the T-bit of the new TSS is set
},
SEL: {
RPL: 0x0003, // requested privilege level (0-3)
LDT: 0x0004, // table indicator (0: GDT, 1: LDT)
MASK: 0xFFF8 // table offset
},
DESC: { // Descriptor Table Entry
LIMIT: { // LIMIT bits 0-15 (or OFFSET if this is an INTERRUPT or TRAP gate)
OFFSET: 0x0
},
BASE: { // BASE bits 0-15 (or SELECTOR if this is a TASK, INTERRUPT or TRAP gate)
OFFSET: 0x2
},
ACC: { // bit definitions for the access word (offset 0x4)
OFFSET: 0x4,
BASE1623: 0x00FF, // (not used if this a TASK, INTERRUPT or TRAP gate; bits 0-5 are parm count for CALL gates)
TYPE: {
OFFSET: 0x5,
MASK: 0x1F00,
SEG: 0x1000,
NONSEG: 0x0F00,
/*
* The following bits apply only when SEG is set
*/
CODE: 0x0800, // set for CODE, clear for DATA
ACCESSED: 0x0100, // set if accessed, clear if not accessed
READABLE: 0x0200, // CODE: set if readable, clear if exec-only
WRITABLE: 0x0200, // DATA: set if writable, clear if read-only
CONFORMING: 0x0400, // CODE: set if conforming, clear if not
EXPDOWN: 0x0400, // DATA: set if expand-down, clear if not
/*
* Assorted bits that apply only within NONSEG values
*/
TSS_BUSY: 0x0200,
NONSEG_386: 0x0800, // 80386 and up
/*
* The following are all the possible (valid) types (well, except for the variations
* of DATA and CODE where the ACCESSED bit (0x0100) may also be set)
*/
TSS286: 0x0100,
LDT: 0x0200,
TSS286_BUSY: 0x0300,
GATE_CALL: 0x0400,
GATE_TASK: 0x0500,
GATE286_INT: 0x0600,
GATE286_TRAP: 0x0700,
TSS386: 0x0900, // 80386 and up
TSS386_BUSY: 0x0B00, // 80386 and up
GATE386_CALL: 0x0C00, // 80386 and up
GATE386_INT: 0x0E00, // 80386 and up
GATE386_TRAP: 0x0F00, // 80386 and up
CODE_OR_DATA: 0x1E00,
DATA_READONLY: 0x1000,
DATA_WRITABLE: 0x1200,
DATA_EXPDOWN: 0x1400,
DATA_EXPDOWN_WRITABLE: 0x1600,
CODE_EXECONLY: 0x1800,
CODE_READABLE: 0x1A00,
CODE_CONFORMING: 0x1C00,
CODE_CONFORMING_READABLE: 0x1E00
},
DPL: {
MASK: 0x6000,
SHIFT: 13
},
PRESENT: 0x8000,
INVALID: 0 // use X86.DESC.ACC.INVALID for invalid ACC values
},
EXT: { // descriptor extension word (reserved on the 80286; "must be zero")
OFFSET: 0x6,
LIMIT1619: 0x000F,
AVAIL: 0x0010, // NOTE: set in various descriptors in OS/2
/*
* The BIG bit is known as the D bit for code segments; when set, all addresses and operands
* in that code segment are assumed to be 32-bit.
*
* The BIG bit is known as the B bit for data segments; when set, it indicates: 1) all pushes,
* pops, calls and returns use ESP instead of SP, and 2) the upper bound of an expand-down segment
* is 0xffffffff instead of 0xffff.
*/
BIG: 0x0040, // clear if default operand/address size is 16-bit, set if 32-bit
LIMITPAGES: 0x0080, // clear if limit granularity is bytes, set if limit granularity is 4Kb pages
BASE2431: 0xFF00
},
INVALID: 0 // use X86.DESC.INVALID for invalid DESC values
},
LADDR: { // linear address
PDE: { // index of page directory entry
MASK: 0xFFC00000|0,
SHIFT: 20 // (addr & DIR.MASK) >>> DIR.SHIFT yields a page directory offset (ie, index * 4)
},
PTE: { // index of page table entry
MASK: 0x003FF000,
SHIFT: 10 // (addr & PAGE.MASK) >>> PAGE.SHIFT yields a page table offset (ie, index * 4)
},
OFFSET: 0x00000FFF
},
PTE: {
FRAME: 0xFFFFF000|0,
DIRTY: 0x00000040, // page has been modified
ACCESSED: 0x00000020, // page has been accessed
USER: 0x00000004, // set for user level (CPL 3), clear for supervisor level (CPL 0-2)
READWRITE: 0x00000002, // set for read/write, clear for read-only (affects CPL 3 only)
PRESENT: 0x00000001 // set for present page, clear for not-present page
},
TSS286: {
PREV_TSS: 0x00,
CPL0_SP: 0x02, // start of values altered by task switches
CPL0_SS: 0x04,
CPL1_SP: 0x06,
CPL1_SS: 0x08,
CPL2_SP: 0x0A,
CPL2_SS: 0x0C,
TASK_IP: 0x0E,
TASK_PS: 0x10,
TASK_AX: 0x12,
TASK_CX: 0x14,
TASK_DX: 0x16,
TASK_BX: 0x18,
TASK_SP: 0x1A,
TASK_BP: 0x1C,
TASK_SI: 0x1E,
TASK_DI: 0x20,
TASK_ES: 0x22,
TASK_CS: 0x24,
TASK_SS: 0x26,
TASK_DS: 0x28, // end of values altered by task switches
TASK_LDT: 0x2A
},
TSS386: {
PREV_TSS: 0x00,
CPL0_ESP: 0x04, // start of values altered by task switches
CPL0_SS: 0x08,
CPL1_ESP: 0x0c,
CPL1_SS: 0x10,
CPL2_ESP: 0x14,
CPL2_SS: 0x18,
TASK_CR3: 0x1C, // (not in TSS286)
TASK_EIP: 0x20,
TASK_PS: 0x24,
TASK_EAX: 0x28,
TASK_ECX: 0x2C,
TASK_EDX: 0x30,
TASK_EBX: 0x34,
TASK_ESP: 0x38,
TASK_EBP: 0x3C,
TASK_ESI: 0x40,
TASK_EDI: 0x44,
TASK_ES: 0x48,
TASK_CS: 0x4C,
TASK_SS: 0x50,
TASK_DS: 0x54,
TASK_FS: 0x58, // (not in TSS286)
TASK_GS: 0x5C, // (not in TSS286) end of values altered by task switches
TASK_LDT: 0x60,
TASK_IOPM: 0x64 // (not in TSS286)
},
ERRCODE: {
EXT: 0x0001,
IDT: 0x0002,
LDT: 0x0004,
SELMASK: 0xFFFC
},
RESULT: {
/*
* Flags were originally computed using 16-bit result registers:
*
* CF: resultZeroCarry & resultSize (ie, 0x100 or 0x10000)
* PF: resultParitySign & 0xff
* AF: (resultParitySign ^ resultAuxOverflow) & 0x0010
* ZF: resultZeroCarry & (resultSize - 1)
* SF: resultParitySign & (resultSize >> 1)
* OF: (resultParitySign ^ resultAuxOverflow ^ (resultParitySign >> 1)) & (resultSize >> 1)
*
* I386 support requires that we now rely on 32-bit result registers:
*
* resultDst, resultSrc, resultArith, resultLogic and resultType
*
* and flags are now computed as follows:
*
* CF: ((resultDst ^ ((resultDst ^ resultSrc) & (resultSrc ^ resultArith))) & resultType)
* PF: (resultLogic & 0xff)
* AF: ((resultArith ^ (resultDst ^ resultSrc)) & 0x0010)
* ZF: (resultLogic & ((resultType - 1) | resultType))
* SF: (resultLogic & resultType)
* OF: (((resultDst ^ resultArith) & (resultSrc ^ resultArith)) & resultType)
*
* where resultType contains both a size, which must be one of BYTE (0x80), WORD (0x8000),
* or DWORD (0x80000000), along with bits for each of the arithmetic and/or logical flags that
* are currently "cached" in the result registers (eg, X86.RESULT.CF for carry, X86.RESULT.OF
* for overflow, etc).
*
* WARNING: Do not confuse these RESULT flag definitions with the PS flag definitions. RESULT
* flags are used only as "cached" flag indicators, packed into bits 0-5 of resultType; they do
* not match the actual flag bit definitions within the Processor Status (PS) register.
*
* Arithmetic operations should call:
*
* setArithResult(dst, src, value, type)
* eg:
* setArithResult(dst, src, dst+src, X86.RESULT.BYTE | X86.RESULT.ALL)
*
* and logical operations should call:
*
* setLogicResult(value, type [, carry [, overflow]])
*
* Since most logical operations clear both CF and OF, most calls to setLogicResult() can omit the
* last two optional parameters.
*
* The type parameter of these methods indicates both the size of the result (BYTE, WORD or DWORD)
* and which of the flags should now be considered "cached" by the result registers. If the previous
* resultType specifies any flags not present in the new type parameter, then those flags are
* calculated and written to the appropriate regPS bit(s) *before* the result registers are updated.
*
* Arithmetic operations are assumed to represent an "added" result; if a "subtracted" result is
* provided instead (eg, from CMP, DEC, SUB, etc), then setArithResult() must include a 5th parameter
* (fSubtract); eg:
*
* setArithResult(dst, src, dst-src, X86.RESULT.BYTE | X86.RESULT.ALL, true)
*
* TODO: Consider separating setArithResult() into two functions: setAddResult() and setSubResult().
*/
BYTE: 0x80, // result is byte value
WORD: 0x8000, // result is word value
DWORD: 0x80000000|0,
TYPE: 0x80008080|0,
CF: 0x01, // carry flag is cached
PF: 0x02, // parity flag is cached
AF: 0x04, // aux carry flag is cached
ZF: 0x08, // zero flag is cached
SF: 0x10, // sign flag is cached
OF: 0x20, // overflow flag is cached
ALL: 0x3F, // all result flags are cached
LOGIC: 0x1A, // all logical flags are cached; see setLogicResult()
NOTCF: 0x3E // all result flags EXCEPT carry are cached
},
/*
* Bit values for opFlags, which are all reset to zero prior to each instruction
*/
OPFLAG: {
NOREAD: 0x0001, // disable memory reads for the remainder of the current instruction
NOWRITE: 0x0002, // disable memory writes for the remainder of the current instruction
NOINTR: 0x0004, // a segreg has been set, or a prefix, or an STI (delay INTR acknowledgement)
WRAP: 0x0008, // a segment wrap-around has occurred (relevant to 8086/8088 only)
SEG: 0x0010, // segment override
LOCK: 0x0020, // lock prefix
REPZ: 0x0040, // repeat while Z (NOTE: this value MUST match PS.ZF; see opCMPSb/opCMPSw/opSCASb/opSCASw)
REPNZ: 0x0080, // repeat while NZ
REPEAT: 0x0100, // an instruction is being repeated (ie, some iteration AFTER the first)
PUSHSP: 0x0200, // the SP register is potentially being referenced by a PUSH SP opcode, adjustment may be required
DATASIZE: 0x0400, // data size override
ADDRSIZE: 0x0800, // address size override
FAULT: 0x1000, // a fault occurred during the current instruction
DBEXC: 0x2000, // a DB_EXC exception occurred during the current instruction
IRET: 0x4000 // remembers if we arrived at the current instruction via IRET (used for 8086/8088 "feature" simulation)
},
/*
* Bit values for intFlags
*/
INTFLAG: {
NONE: 0x00,
INTR: 0x01, // h/w interrupt requested
TRAP: 0x02, // trap (INT 0x01) requested
HALT: 0x04, // halt (HLT) requested
DMA: 0x08, // async DMA operation in progress
DEBUGGER: 0x10 // debugger checks enabled
},
/*
* Common opcodes (and/or any opcodes we need to refer to explicitly)
*/
OPCODE: {
ES: 0x26, // opES()
CS: 0x2E, // opCS()
SS: 0x36, // opSS()
DS: 0x3E, // opDS()
PUSHSP: 0x54, // opPUSHSP()
PUSHA: 0x60, // opPUSHA() (80186 and up)
POPA: 0x61, // opPOPA() (80186 and up)
BOUND: 0x62, // opBOUND() (80186 and up)
ARPL: 0x63, // opARPL() (80286 and up)
FS: 0x64, // opFS() (80386 and up)
GS: 0x65, // opGS() (80386 and up)
OS: 0x66, // opOS() (80386 and up)
AS: 0x67, // opAS() (80386 and up)
PUSHN: 0x68, // opPUSHn() (80186 and up)
IMULN: 0x69, // opIMULn() (80186 and up)
PUSH8: 0x6A, // opPUSH8() (80186 and up)
IMUL8: 0x6B, // opIMUL8() (80186 and up)
INSB: 0x6C, // opINSb() (80186 and up)
INSW: 0x6D, // opINSw() (80186 and up)
OUTSB: 0x6E, // opOUTSb() (80186 and up)
OUTSW: 0x6F, // opOUTSw() (80186 and up)
ENTER: 0xC8, // opENTER() (80186 and up)
LEAVE: 0xC9, // opLEAVE() (80186 and up)
CALLF: 0x9A, // opCALLF()
MOVSB: 0xA4, // opMOVSb()
MOVSW: 0xA5, // opMOVSw()
CMPSB: 0xA6, // opCMPSb()
CMPSW: 0xA7, // opCMPSw()
STOSB: 0xAA, // opSTOSb()
STOSW: 0xAB, // opSTOSw()
LODSB: 0xAC, // opLODSb()
LODSW: 0xAD, // opLODSw()
SCASB: 0xAE, // opSCASb()
SCASW: 0xAF, // opSCASw()
INT3: 0xCC, // opINT3()
INTN: 0xCD, // opINTn()
INTO: 0xCE, // opINTO()
IRET: 0xCF, // opIRET()
ESC0: 0xD8, // opESC0()
ESC1: 0xD9, // opESC1()
ESC2: 0xDA, // opESC2()
ESC3: 0xDB, // opESC3()
ESC4: 0xDC, // opESC4()
ESC5: 0xDD, // opESC5()
ESC6: 0xDE, // opESC6()
ESC7: 0xDF, // opESC7()
LOOPNZ: 0xE0, // opLOOPNZ()
LOOPZ: 0xE1, // opLOOPZ()
LOOP: 0xE2, // opLOOP()
CALL: 0xE8, // opCALL()
JMP: 0xE9, // opJMP() (2-byte displacement)
JMPF: 0xEA, // opJMPF()
JMPS: 0xEB, // opJMPs() (1-byte displacement)
LOCK: 0xF0, // opLOCK()
INT1: 0xF1, // opINT1()
REPNZ: 0xF2, // opREPNZ()
REPZ: 0xF3, // opREPZ()
CLI: 0xFA, // opCLI()
STI: 0xFB, // opSTI()
CLD: 0xFC, // opCLD()
STD: 0xFD, // opSTD()
GRP4W: 0xFF,
CALLW: 0x10FF, // GRP4W: fnCALLw()
CALLFDW: 0x18FF, // GRP4W: fnCALLFdw()
CALLMASK: 0x38FF, // mask 2-byte GRP4W opcodes with this before comparing to CALLW or CALLFDW
UD2: 0x0B0F // UD2 (invalid opcode "guaranteed" to generate UD_FAULT on all post-8086 processors)
},
/*
* Floating Point Unit (FPU), aka Numeric Data Processor (NDP), aka Numeric Processor Extension (NPX), aka Coprocessor definitions
*/
FPU: {
MODEL_8087: 8087,
MODEL_80287: 80287,
MODEL_80287XL: 80387, // internally, the 80287XL was an 80387SX, so generally, we treat this as MODEL_80387
MODEL_80387: 80387,
CONTROL: { // FPU Control Word
IM: 0x0001, // bit 0: Invalid Operation Mask
DM: 0x0002, // bit 1: Denormalized Operand Mask
ZM: 0x0004, // bit 2: Zero Divide Mask
OM: 0x0008, // bit 3: Overflow Mask
UM: 0x0010, // bit 4: Underflow Mask
PM: 0x0020, // bit 5: Precision Mask
EXC: 0x003F, // all of the above exceptions
IEM: 0x0080, // bit 7: Interrupt Enable Mask (0 enables interrupts, 1 masks them; 8087 only)
PC: 0x0300, // bits 8-9: Precision Control
RC: { // bits 10-11: Rounding Control
NEAR: 0x0000,
DOWN: 0x0400,
UP: 0x0800,
CHOP: 0x0C00,
MASK: 0x0C00
},
IC: 0x1000, // bit 12: Infinity Control (0 for Projective, 1 for Affine)
UNUSED: 0xE040, // bits 6,13-15: unused
INIT: 0x03BF // X86.FPU.CONTROL.IM | X86.FPU.CONTROL.DM | X86.FPU.CONTROL.ZM | X86.FPU.CONTROL.OM | X86.FPU.CONTROL.UM | X86.FPU.CONTROL.PM | X86.FPU.CONTROL.IEM | X86.FPU.CONTROL.PC
},
STATUS: { // FPU Status Word
IE: 0x0001, // bit 0: Invalid Operation
DE: 0x0002, // bit 1: Denormalized Operand
ZE: 0x0004, // bit 2: Zero Divide
OE: 0x0008, // bit 3: Overflow
UE: 0x0010, // bit 4: Underflow
PE: 0x0020, // bit 5: Precision
SF: 0x0040, // bit 6: Stack Fault (80387 and later; triggers an Invalid Operation exception)
EXC: 0x007F, // all of the above exceptions
ES: 0x0080, // bit 7: Error/Exception Status/Summary (Interrupt Request on 8087)
C0: 0x0100, // bit 8: Condition Code 0
C1: 0x0200, // bit 9: Condition Code 1
C2: 0x0400, // bit 10: Condition Code 2
ST: 0x3800, // bits 11-13: Stack Top
ST_SHIFT: 11,
C3: 0x4000, // bit 14: Condition Code 3
CC: 0x4700, // all condition code bits
BUSY: 0x8000 // bit 15: Busy
},
TAGS: {
VALID: 0x0,
ZERO: 0x1,
SPECIAL:0x2,
EMPTY: 0x3,
MASK: 0x3
}
/*
C3 C2 C1 C0 Condition Code (CC) values following an Examine
0 0 0 0 Valid, positive unnormalized (+Unnormal)
0 0 0 1 Invalid, positive, exponent=0 (+NaN)
0 0 1 0 Valid, negative, unnormalized (-Unnormal)
0 0 1 1 Invalid, negative, exponent=0 (-NaN)
0 1 0 0 Valid, positive, normalized (+Normal)
0 1 0 1 Infinity, positive (+Infinity)
0 1 1 0 Valid, negative, normalized (-Normal)
0 1 1 1 Infinity, negative (-Infinity)
1 0 0 0 Zero, positive (+0)
1 0 0 1 Empty
1 0 1 0 Zero, negative (-0)
1 0 1 1 Empty
1 1 0 0 Invalid, positive, exponent=0 (+Denormal)
1 1 0 1 Empty
1 1 1 0 Invalid, negative, exponent=0 (-Denormal)
1 1 1 1 Empty
Condition Code (CC) values following an FCOM or FTST
0 0 ? 0 ST > source operand (FCOM); ST > 0 (FTST)
0 0 ? 1 ST < source operand (FCOM); ST < 0 (FTST)
1 0 ? 0 ST = source operand (FCOM); ST = 0 (FTST)
1 1 ? 1 ST is not comparable
Condition Code (CC) values following a Remainder
Q1 0 Q0 Q2 Complete reduction (he three low bits of the quotient stored in C0, C3, and C1)
? 1 ? ? Incomplete reduction
*/
},
CYCLES_8088: {
nWordCyclePenalty: 4, // NOTE: accurate for the 8088/80188 only (on the 8086/80186, it applies to odd addresses only)
nEACyclesBase: 5, // base or index only (BX, BP, SI or DI)
nEACyclesDisp: 6, // displacement only
nEACyclesBaseIndex: 7, // base + index (BP+DI and BX+SI)
nEACyclesBaseIndexExtra: 8, // base + index (BP+SI and BX+DI require an extra cycle)
nEACyclesBaseDisp: 9, // base or index + displacement
nEACyclesBaseIndexDisp: 11, // base + index + displacement (BP+DI+n and BX+SI+n)
nEACyclesBaseIndexDispExtra:12, // base + index + displacement (BP+SI+n and BX+DI+n require an extra cycle)
nOpCyclesAAA: 4, // AAA, AAS, DAA, DAS, TEST acc,imm
nOpCyclesAAD: 60,
nOpCyclesAAM: 83,
nOpCyclesArithRR: 3, // ADC, ADD, AND, OR, SBB, SUB, XOR and CMP reg,reg cycle time
nOpCyclesArithRM: 9, // ADC, ADD, AND, OR, SBB, SUB, and XOR reg,mem (and CMP mem,reg) cycle time
nOpCyclesArithMR: 16, // ADC, ADD, AND, OR, SBB, SUB, and XOR mem,reg cycle time
nOpCyclesArithMID: 1, // ADC, ADD, AND, OR, SBB, SUB, XOR and CMP mem,imm cycle delta
nOpCyclesCall: 19,
nOpCyclesCallF: 28,
nOpCyclesCallWR: 16,
nOpCyclesCallWM: 21,
nOpCyclesCallDM: 37,
nOpCyclesCLI: 2,
nOpCyclesCompareRM: 9, // CMP reg,mem cycle time (same as nOpCyclesArithRM on an 8086 but not on a 80286)
nOpCyclesCWD: 5,
nOpCyclesBound: 33, // N/A if 8086/8088, 33-35 if 80186/80188 (TODO: Determine what the range means for an 80186/80188)
nOpCyclesInP: 10,
nOpCyclesInDX: 8,
nOpCyclesIncR: 3, // INC reg, DEC reg
nOpCyclesIncM: 15, // INC mem, DEC mem
nOpCyclesInt: 51,
nOpCyclesInt3D: 1,
nOpCyclesIntOD: 2,
nOpCyclesIntOFall: 4,
nOpCyclesIRet: 32,
nOpCyclesJmp: 15,
nOpCyclesJmpF: 15,
nOpCyclesJmpC: 16,
nOpCyclesJmpCFall: 4,
nOpCyclesJmpWR: 11,
nOpCyclesJmpWM: 18,
nOpCyclesJmpDM: 24,
nOpCyclesLAHF: 4, // LAHF, SAHF, MOV reg,imm
nOpCyclesLEA: 2,
nOpCyclesLS: 16, // LDS, LES
nOpCyclesLoop: 17, // LOOP, LOOPNZ
nOpCyclesLoopZ: 18, // LOOPZ, JCXZ
nOpCyclesLoopNZ: 19, // LOOPNZ
nOpCyclesLoopFall: 5, // LOOP
nOpCyclesLoopZFall: 6, // LOOPZ, JCXZ
nOpCyclesMovRR: 2,
nOpCyclesMovRM: 8,
nOpCyclesMovMR: 9,
nOpCyclesMovRI: 10,
nOpCyclesMovMI: 10,
nOpCyclesMovAM: 10,
nOpCyclesMovMA: 10,
nOpCyclesDivBR: 80, // range of 80-90
nOpCyclesDivWR: 124, // range of 144-162 (lowered to produce a Norton SI performance index of 1.0)
nOpCyclesDivBM: 86, // range of 86-96
nOpCyclesDivWM: 134, // range of 154-172 (lowered to produce a Norton SI performance index of 1.0)
nOpCyclesIDivBR: 101, // range of 101-112
nOpCyclesIDivWR: 145, // range of 165-184 (lowered to produce a Norton SI performance index of 1.0)
nOpCyclesIDivBM: 107, // range of 107-118
nOpCyclesIDivWM: 151, // range of 171-190 (lowered to produce a Norton SI performance index of 1.0)
nOpCyclesMulBR: 70, // range of 70-77
nOpCyclesMulWR: 93, // range of 113-118 (lowered to produce a Norton SI performance index of 1.0)
nOpCyclesMulBM: 76, // range of 76-83
nOpCyclesMulWM: 104, // range of 124-139 (lowered to produce a Norton SI performance index of 1.0)
nOpCyclesIMulBR: 80, // range of 80-98
nOpCyclesIMulWR: 108, // range of 128-154 (lowered to produce a Norton SI performance index of 1.0)
nOpCyclesIMulBM: 86, // range of 86-104
nOpCyclesIMulWM: 114, // range of 134-160 (lowered to produce a Norton SI performance index of 1.0)
nOpCyclesNegR: 3, // NEG reg, NOT reg
nOpCyclesNegM: 16, // NEG mem, NOT mem
nOpCyclesOutP: 10,
nOpCyclesOutDX: 8,
nOpCyclesPopAll: 51, // N/A if 8086/8088, 51 if 80186, 83 if 80188 (TODO: Verify)
nOpCyclesPopReg: 8,
nOpCyclesPopMem: 17,
nOpCyclesPushAll: 36, // N/A if 8086/8088, 36 if 80186, 68 if 80188 (TODO: Verify)
nOpCyclesPushReg: 11, // NOTE: "The 8086 Book" claims this is 10, but it's an outlier....
nOpCyclesPushMem: 16,
nOpCyclesPushSeg: 10,
nOpCyclesPrefix: 2,
nOpCyclesCmpS: 18,
nOpCyclesCmpSr0: 9-2, // reduced by nOpCyclesPrefix
nOpCyclesCmpSrn: 17-2, // reduced by nOpCyclesPrefix
nOpCyclesLodS: 12,
nOpCyclesLodSr0: 9-2, // reduced by nOpCyclesPrefix
nOpCyclesLodSrn: 13-2, // reduced by nOpCyclesPrefix
nOpCyclesMovS: 18,
nOpCyclesMovSr0: 9-2, // reduced by nOpCyclesPrefix
nOpCyclesMovSrn: 17-2, // reduced by nOpCyclesPrefix
nOpCyclesScaS: 15,
nOpCyclesScaSr0: 9-2, // reduced by nOpCyclesPrefix
nOpCyclesScaSrn: 15-2, // reduced by nOpCyclesPrefix
nOpCyclesStoS: 11,
nOpCyclesStoSr0: 9-2, // reduced by nOpCyclesPrefix
nOpCyclesStoSrn: 10-2, // reduced by nOpCyclesPrefix
nOpCyclesRet: 8,
nOpCyclesRetn: 12,
nOpCyclesRetF: 18,
nOpCyclesRetFn: 17,
nOpCyclesShift1M: 15, // ROL/ROR/RCL/RCR/SHL/SHR/SAR reg,1
nOpCyclesShiftCR: 8, // ROL/ROR/RCL/RCR/SHL/SHR/SAR reg,CL
nOpCyclesShiftCM: 20, // ROL/ROR/RCL/RCR/SHL/SHR/SAR mem,CL
nOpCyclesShiftCS: 2, // this is the left-shift value used to convert the count to the cycle cost
nOpCyclesTestRR: 3,
nOpCyclesTestRM: 9,
nOpCyclesTestRI: 5,
nOpCyclesTestMI: 11,
nOpCyclesXchgRR: 4,
nOpCyclesXchgRM: 17,
nOpCyclesXLAT: 11
},
CYCLES_80286: {
nWordCyclePenalty: 0,
nEACyclesBase: 0,
nEACyclesDisp: 0,
nEACyclesBaseIndex: 0,
nEACyclesBaseIndexExtra: 0,
nEACyclesBaseDisp: 0,
nEACyclesBaseIndexDisp: 1,
nEACyclesBaseIndexDispExtra:1,
nOpCyclesAAA: 3,
nOpCyclesAAD: 14,
nOpCyclesAAM: 16,
nOpCyclesArithRR: 2,
nOpCyclesArithRM: 7,
nOpCyclesArithMR: 7,
nOpCyclesArithMID: 0,
nOpCyclesCall: 7, // on the 80286, this ALSO includes the number of bytes in the target instruction
nOpCyclesCallF: 13, // on the 80286, this ALSO includes the number of bytes in the target instruction
nOpCyclesCallWR: 7, // on the 80286, this ALSO includes the number of bytes in the target instruction
nOpCyclesCallWM: 11, // on the 80286, this ALSO includes the number of bytes in the target instruction
nOpCyclesCallDM: 16, // on the 80286, this ALSO includes the number of bytes in the target instruction
nOpCyclesCLI: 3,
nOpCyclesCompareRM: 6,
nOpCyclesCWD: 2,
nOpCyclesBound: 13,
nOpCyclesInP: 5,
nOpCyclesInDX: 5,
nOpCyclesIncR: 2,
nOpCyclesIncM: 7,
nOpCyclesInt: 23, // on the 80286, this ALSO includes the number of bytes in the target instruction
nOpCyclesInt3D: 0,
nOpCyclesIntOD: 1,
nOpCyclesIntOFall: 3,
nOpCyclesIRet: 17, // on the 80286, this ALSO includes the number of bytes in the target instruction
nOpCyclesJmp: 7, // on the 80286, this ALSO includes the number of bytes in the target instruction
nOpCyclesJmpF: 11, // on the 80286, this ALSO includes the number of bytes in the target instruction
nOpCyclesJmpC: 7, // on the 80286, this ALSO includes the number of bytes in the target instruction
nOpCyclesJmpCFall: 3,
nOpCyclesJmpWR: 7, // on the 80286, this ALSO includes the number of bytes in the target instruction
nOpCyclesJmpWM: 11, // on the 80286, this ALSO includes the number of bytes in the target instruction
nOpCyclesJmpDM: 15, // on the 80286, this ALSO includes the number of bytes in the target instruction
nOpCyclesLAHF: 2,
nOpCyclesLEA: 3,
nOpCyclesLS: 7,
nOpCyclesLoop: 8, // on the 80286, this ALSO includes the number of bytes in the target instruction
nOpCyclesLoopZ: 8, // on the 80286, this ALSO includes the number of bytes in the target instruction
nOpCyclesLoopNZ: 8, // on the 80286, this ALSO includes the number of bytes in the target instruction
nOpCyclesLoopFall: 4,
nOpCyclesLoopZFall: 4,
nOpCyclesMovRR: 2, // this is actually the same as the 8086...
nOpCyclesMovRM: 3,
nOpCyclesMovMR: 5,
nOpCyclesMovRI: 2,
nOpCyclesMovMI: 3,
nOpCyclesMovAM: 5, // this is actually slower than the MOD/RM form of MOV AX,mem (see nOpCyclesMovRM)
nOpCyclesMovMA: 3,
nOpCyclesDivBR: 14,
nOpCyclesDivWR: 22,
nOpCyclesDivBM: 17,
nOpCyclesDivWM: 25,
nOpCyclesIDivBR: 17,
nOpCyclesIDivWR: 25,
nOpCyclesIDivBM: 20,
nOpCyclesIDivWM: 28,
nOpCyclesMulBR: 13,
nOpCyclesMulWR: 21,
nOpCyclesMulBM: 16,
nOpCyclesMulWM: 24,
nOpCyclesIMulBR: 13,
nOpCyclesIMulWR: 21,
nOpCyclesIMulBM: 16,
nOpCyclesIMulWM: 24,
nOpCyclesNegR: 2,
nOpCyclesNegM: 7,
nOpCyclesOutP: 5,
nOpCyclesOutDX: 5,
nOpCyclesPopAll: 19,
nOpCyclesPopReg: 5,
nOpCyclesPopMem: 5,
nOpCyclesPushAll: 17,
nOpCyclesPushReg: 3,
nOpCyclesPushMem: 5,
nOpCyclesPushSeg: 3,
nOpCyclesPrefix: 0,
nOpCyclesCmpS: 8,
nOpCyclesCmpSr0: 5,
nOpCyclesCmpSrn: 9,
nOpCyclesLodS: 5,
nOpCyclesLodSr0: 5,
nOpCyclesLodSrn: 4,
nOpCyclesMovS: 5,
nOpCyclesMovSr0: 5,
nOpCyclesMovSrn: 4,
nOpCyclesScaS: 7,
nOpCyclesScaSr0: 5,
nOpCyclesScaSrn: 8,
nOpCyclesStoS: 3,
nOpCyclesStoSr0: 4,
nOpCyclesStoSrn: 3,
nOpCyclesRet: 11, // on the 80286, this ALSO includes the number of bytes in the target instruction
nOpCyclesRetn: 11, // on the 80286, this ALSO includes the number of bytes in the target instruction
nOpCyclesRetF: 15, // on the 80286, this ALSO includes the number of bytes in the target instruction
nOpCyclesRetFn: 15, // on the 80286, this ALSO includes the number of bytes in the target instruction
nOpCyclesShift1M: 7,
nOpCyclesShiftCR: 5,
nOpCyclesShiftCM: 8,
nOpCyclesShiftCS: 0,
nOpCyclesTestRR: 2,
nOpCyclesTestRM: 6,
nOpCyclesTestRI: 3,
nOpCyclesTestMI: 6,
nOpCyclesXchgRR: 3,
nOpCyclesXchgRM: 5,
nOpCyclesXLAT: 5
},
/*
* TODO: All 80386 cycle counts are based on 80286 counts until I have time to hand-generate an 80386-specific table;
* the values below are used by selected 32-bit opcode handlers only.
*/
CYCLES_80386: {
nEACyclesBase: 0,
nEACyclesDisp: 0,
nEACyclesBaseIndex: 0,
nEACyclesBaseIndexExtra: 0,
nEACyclesBaseDisp: 0,
nEACyclesBaseIndexDisp: 1,
nEACyclesBaseIndexDispExtra:1
}
};
/*
* BACKTRACK-related definitions (used only if BACKTRACK is defined)
*/
X86.BTINFO = {
SP_LO: 0,
SP_HI: 0
};
/*
* These PS flags are always stored directly in regPS for the 8086/8088, hence the
* "direct" designation; other processors must adjust these bits accordingly. The final
* adjusted value is stored in PS_DIRECT (ie, 80286 and up also include PS.IOPL.MASK and
* PS.NT in PS_DIRECT).
*/
X86.PS_DIRECT_8086 = (X86.PS.TF | X86.PS.IF | X86.PS.DF);
/*
* These are the default "always set" PS bits for the 8086/8088; other processors must
* adjust these bits accordingly. The final adjusted value is stored in PS_SET.
*/
X86.PS_SET_8086 = (X86.PS.BIT1 | X86.PS.IOPL.MASK | X86.PS.NT | X86.PS.BIT15);
/*
* These PS arithmetic and logical flags may be "cached" across several result registers;
* whether or not they're currently cached depends on the RESULT bits in resultType.
*/
X86.PS_CACHED = (X86.PS.CF | X86.PS.PF | X86.PS.AF | X86.PS.ZF | X86.PS.SF | X86.PS.OF);
/*
* PS_SAHF is a subset of the arithmetic flags, and refers only to those flags that the
* SAHF and LAHF "8080 legacy" opcodes affect.
*/
X86.PS_SAHF = (X86.PS.CF | X86.PS.PF | X86.PS.AF | X86.PS.ZF | X86.PS.SF);
/*
* Before we zero opFlags, we first see if any of the following PREFIX bits were set. If any were set,
* they are OR'ed into opPrefixes; otherwise, opPrefixes is zeroed as well. This gives prefix-conscious
* instructions like LODS, MOVS, STOS, CMPS, etc, a way of determining which prefixes, if any, immediately
* preceded them.
*/
X86.OPFLAG_PREFIXES = (X86.OPFLAG.SEG | X86.OPFLAG.LOCK | X86.OPFLAG.REPZ | X86.OPFLAG.REPNZ | X86.OPFLAG.DATASIZE | X86.OPFLAG.ADDRSIZE);
if (typeof module !== "undefined") module.exports = X86;
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function get() {
return _media2["default"];
}
});
require("./media.sass");
var _media2 = _interopRequireDefault(require("./media"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
//# sourceMappingURL=index.js.map
|
/**
* France (France) translation
* By Thylia
* 09-11-2007, 02:22 PM
* updated by disizben (22 Sep 2008)
* updated by Thylia (20 Apr 2010)
*/
Ext.onReady(function() {
var cm = Ext.ClassManager,
exists = Ext.Function.bind(cm.get, cm);
if (Ext.Updater) {
Ext.Updater.defaults.indicatorText = '<div class="loading-indicator">En cours de chargement...</div>';
}
Ext.define("Ext.locale.fr.view.View", {
override: "Ext.view.View",
emptyText: ""
});
Ext.define("Ext.locale.fr.grid.Panel", {
override: "Ext.grid.Panel",
ddText: "{0} ligne{1} sélectionnée{1}"
});
// changing the msg text below will affect the LoadMask
Ext.define("Ext.locale.fr.view.AbstractView", {
override: "Ext.view.AbstractView",
msg: "En cours de chargement..."
});
if (Ext.Date) {
Ext.Date.shortMonthNames = ["Janv", "Févr", "Mars", "Avr", "Mai", "Juin", "Juil", "Août", "Sept", "Oct", "Nov", "Déc"];
Ext.Date.getShortMonthName = function(month) {
return Ext.Date.shortMonthNames[month];
};
Ext.Date.monthNames = ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"];
Ext.Date.monthNumbers = {
"Janvier": 0,
"Janv": 0,
"Février": 1,
"Févr": 1,
"Mars": 2,
"Mars": 2,
"Avril": 3,
"Avr": 3,
"Mai": 4,
"Juin": 5,
"Juillet": 6,
"Août": 7,
"Septembre": 8,
"Sept": 8,
"Octobre": 9,
"Oct": 9,
"Novembre": 10,
"Nov": 10,
"Décembre": 11,
"Déc": 11
};
Ext.Date.getMonthNumber = function(name) {
return Ext.Date.monthNumbers[Ext.util.Format.capitalize(name)];
};
Ext.Date.dayNames = ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"];
Ext.Date.getShortDayName = function(day) {
return Ext.Date.dayNames[day].substring(0, 3);
};
Ext.Date.parseCodes.S.s = "(?:er)";
Ext.override(Date, {
getSuffix: function() {
return (this.getDate() == 1) ? "er" : "";
}
});
}
if (Ext.MessageBox) {
Ext.MessageBox.buttonText = {
ok: "OK",
cancel: "Annuler",
yes: "Oui",
no: "Non"
};
}
if (Ext.util.Format) {
Ext.apply(Ext.util.Format, {
thousandSeparator: '.',
decimalSeparator: ',',
currencySign: '\u20ac',
// French Euro
dateFormat: 'd/m/Y'
});
}
Ext.define("Ext.locale.fr.picker.Date", {
override: "Ext.picker.Date",
todayText: "Aujourd'hui",
minText: "Cette date est antérieure à la date minimum",
maxText: "Cette date est postérieure à la date maximum",
disabledDaysText: "",
disabledDatesText: "",
monthNames: Ext.Date.monthNames,
dayNames: Ext.Date.dayNames,
nextText: 'Mois suivant (CTRL+Flèche droite)',
prevText: "Mois précédent (CTRL+Flèche gauche)",
monthYearText: "Choisissez un mois (CTRL+Flèche haut ou bas pour changer d'année.)",
todayTip: "{0} (Barre d'espace)",
format: "d/m/y",
startDay: 1
});
Ext.define("Ext.locale.fr.picker.Month", {
override: "Ext.picker.Month",
okText: " OK ",
cancelText: "Annuler"
});
Ext.define("Ext.locale.fr.toolbar.Paging", {
override: "Ext.PagingToolbar",
beforePageText: "Page",
afterPageText: "sur {0}",
firstText: "Première page",
prevText: "Page précédente",
nextText: "Page suivante",
lastText: "Dernière page",
refreshText: "Actualiser la page",
displayMsg: "Page courante {0} - {1} sur {2}",
emptyMsg: 'Aucune donnée à afficher'
});
Ext.define("Ext.locale.fr.form.Basic", {
override: "Ext.form.Basic",
waitTitle: "Veuillez patienter..."
});
Ext.define("Ext.locale.fr.form.field.Base", {
override: "Ext.form.field.Base",
invalidText: "La valeur de ce champ est invalide"
});
Ext.define("Ext.locale.fr.form.field.Text", {
override: "Ext.form.field.Text",
minLengthText: "La longueur minimum de ce champ est de {0} caractère(s)",
maxLengthText: "La longueur maximum de ce champ est de {0} caractère(s)",
blankText: "Ce champ est obligatoire",
regexText: "",
emptyText: null
});
Ext.define("Ext.locale.fr.form.field.Number", {
override: "Ext.form.field.Number",
decimalSeparator: ",",
decimalPrecision: 2,
minText: "La valeur minimum de ce champ doit être de {0}",
maxText: "La valeur maximum de ce champ doit être de {0}",
nanText: "{0} n'est pas un nombre valide"
});
Ext.define("Ext.locale.fr.form.field.Date", {
override: "Ext.form.field.Date",
disabledDaysText: "Désactivé",
disabledDatesText: "Désactivé",
minText: "La date de ce champ ne peut être antérieure au {0}",
maxText: "La date de ce champ ne peut être postérieure au {0}",
invalidText: "{0} n'est pas une date valide - elle doit être au format suivant: {1}",
format: "d/m/y",
altFormats: "d/m/Y|d-m-y|d-m-Y|d/m|d-m|dm|dmy|dmY|d|Y-m-d"
});
Ext.define("Ext.locale.fr.form.field.ComboBox", {
override: "Ext.form.field.ComboBox",
valueNotFoundText: undefined
}, function() {
Ext.apply(Ext.form.field.ComboBox.prototype.defaultListConfig, {
loadingText: "En cours de chargement..."
});
});
if (exists("Ext.form.field.VTypes")) {
Ext.apply(Ext.form.field.VTypes, {
emailText: 'Ce champ doit contenir une adresse email au format: "usager@example.com"',
urlText: 'Ce champ doit contenir une URL au format suivant: "http:/' + '/www.example.com"',
alphaText: 'Ce champ ne peut contenir que des lettres et le caractère souligné (_)',
alphanumText: 'Ce champ ne peut contenir que des caractères alphanumériques ainsi que le caractère souligné (_)'
});
}
Ext.define("Ext.locale.fr.form.field.HtmlEditor", {
override: "Ext.form.field.HtmlEditor",
createLinkText: "Veuillez entrer l'URL pour ce lien:"
}, function() {
Ext.apply(Ext.form.field.HtmlEditor.prototype, {
buttonTips: {
bold: {
title: 'Gras (Ctrl+B)',
text: 'Met le texte sélectionné en gras.',
cls: Ext.baseCSSPrefix + 'html-editor-tip'
},
italic: {
title: 'Italique (Ctrl+I)',
text: 'Met le texte sélectionné en italique.',
cls: Ext.baseCSSPrefix + 'html-editor-tip'
},
underline: {
title: 'Souligné (Ctrl+U)',
text: 'Souligne le texte sélectionné.',
cls: Ext.baseCSSPrefix + 'html-editor-tip'
},
increasefontsize: {
title: 'Agrandir la police',
text: 'Augmente la taille de la police.',
cls: Ext.baseCSSPrefix + 'html-editor-tip'
},
decreasefontsize: {
title: 'Réduire la police',
text: 'Réduit la taille de la police.',
cls: Ext.baseCSSPrefix + 'html-editor-tip'
},
backcolor: {
title: 'Couleur de surbrillance',
text: 'Modifie la couleur de fond du texte sélectionné.',
cls: Ext.baseCSSPrefix + 'html-editor-tip'
},
forecolor: {
title: 'Couleur de police',
text: 'Modifie la couleur du texte sélectionné.',
cls: Ext.baseCSSPrefix + 'html-editor-tip'
},
justifyleft: {
title: 'Aligner à gauche',
text: 'Aligne le texte à gauche.',
cls: Ext.baseCSSPrefix + 'html-editor-tip'
},
justifycenter: {
title: 'Centrer',
text: 'Centre le texte.',
cls: Ext.baseCSSPrefix + 'html-editor-tip'
},
justifyright: {
title: 'Aligner à droite',
text: 'Aligner le texte à droite.',
cls: Ext.baseCSSPrefix + 'html-editor-tip'
},
insertunorderedlist: {
title: 'Liste à puce',
text: 'Démarre une liste à puce.',
cls: Ext.baseCSSPrefix + 'html-editor-tip'
},
insertorderedlist: {
title: 'Liste numérotée',
text: 'Démarre une liste numérotée.',
cls: Ext.baseCSSPrefix + 'html-editor-tip'
},
createlink: {
title: 'Lien hypertexte',
text: 'Transforme en lien hypertexte.',
cls: Ext.baseCSSPrefix + 'html-editor-tip'
},
sourceedit: {
title: 'Code source',
text: 'Basculer en mode édition du code source.',
cls: Ext.baseCSSPrefix + 'html-editor-tip'
}
}
});
});
Ext.define("Ext.locale.fr.grid.header.Container", {
override: "Ext.grid.header.Container",
sortAscText: "Tri croissant",
sortDescText: "Tri décroissant",
columnsText: "Colonnes"
});
Ext.define("Ext.locale.fr.grid.GroupingFeature", {
override: "Ext.grid.GroupingFeature",
emptyGroupText: '(Aucun)',
groupByText: 'Grouper par ce champ',
showGroupsText: 'Afficher par groupes'
});
Ext.define("Ext.locale.fr.grid.PropertyColumnModel", {
override: "Ext.grid.PropertyColumnModel",
nameText: "Propriété",
valueText: "Valeur",
dateFormat: "d/m/Y",
trueText: "vrai",
falseText: "faux"
});
Ext.define("Ext.locale.fr.form.field.Time", {
override: "Ext.form.field.Time",
minText: "L'heure de ce champ ne peut être antérieure à {0}",
maxText: "L'heure de ce champ ne peut être postérieure à {0}",
invalidText: "{0} n'est pas une heure valide",
format: "H:i",
altFormats: "g:ia|g:iA|g:i a|g:i A|h:i|g:i|H:i|ga|h a|g a|g A|gi|hi|Hi|gia|hia|g|H"
});
Ext.define("Ext.locale.fr.form.CheckboxGroup", {
override: "Ext.form.CheckboxGroup",
blankText: "Vous devez sélectionner au moins un élément dans ce groupe"
});
Ext.define("Ext.locale.fr.form.RadioGroup", {
override: "Ext.form.RadioGroup",
blankText: "Vous devez sélectionner au moins un élément dans ce groupe"
});
});
|
import Mousetrap from 'mousetrap';
import preventDefaults from './userInterface/preventDefaults';
const MOUSETRAP = new Mousetrap();
const addKeyboardShortcuts = (container, viewer, viewerDOMId, tumorWidget, compareWidget) => {
container.addEventListener('mouseenter', () => {
MOUSETRAP.bind('1', function (event, combo) {
preventDefaults(event);
viewer.setViewMode('XPlane');
})
MOUSETRAP.bind('alt+1', function (event, combo) {
preventDefaults(event);
viewer.setViewMode('XPlane');
})
MOUSETRAP.bind('2', function (event, combo) {
preventDefaults(event);
viewer.setViewMode('YPlane');
})
MOUSETRAP.bind('alt+2', function (event, combo) {
preventDefaults(event);
viewer.setViewMode('YPlane');
})
MOUSETRAP.bind('3', function (event, combo) {
preventDefaults(event);
viewer.setViewMode('ZPlane');
})
MOUSETRAP.bind('alt+3', function (event, combo) {
preventDefaults(event);
viewer.setViewMode('ZPlane');
})
MOUSETRAP.bind('4', function (event, combo) {
preventDefaults(event);
viewer.setViewMode('VolumeRendering');
})
MOUSETRAP.bind('alt+4', function (event, combo) {
preventDefaults(event);
viewer.setViewMode('VolumeRendering');
})
MOUSETRAP.bind('r', function (event, combo) {
preventDefaults(event);
viewer.getViewProxy().resetCamera();
})
MOUSETRAP.bind('alt+r', function (event, combo) {
preventDefaults(event);
viewer.getViewProxy().resetCamera();
})
MOUSETRAP.bind('p', function (event, combo) {
preventDefaults(event);
viewer.getViewProxy().resetCamera();
})
MOUSETRAP.bind('alt+p', function (event, combo) {
preventDefaults(event);
viewer.getViewProxy().resetCamera();
})
MOUSETRAP.bind('e', function (event, combo) {
preventDefaults(event);
const resetCroppingPlanesButton = document.getElementById(`${viewerDOMId}-resetCroppingPlanesButton`);
resetCroppingPlanesButton.click();
})
MOUSETRAP.bind('alt+e', function (event, combo) {
preventDefaults(event);
const resetCroppingPlanesButton = document.getElementById(`${viewerDOMId}-resetCroppingPlanesButton`);
resetCroppingPlanesButton.click();
})
MOUSETRAP.bind('.', function (event, combo) {
preventDefaults(event);
const resetCroppingPlanesButton = document.getElementById(`${viewerDOMId}-resetCroppingPlanesButton`);
resetCroppingPlanesButton.click();
})
MOUSETRAP.bind('alt+.', function (event, combo) {
preventDefaults(event);
const resetCroppingPlanesButton = document.getElementById(`${viewerDOMId}-resetCroppingPlanesButton`);
resetCroppingPlanesButton.click();
})
MOUSETRAP.bind('w', function (event, combo) {
preventDefaults(event);
const toggleCroppingPlanesButton = document.getElementById(`${viewerDOMId}-toggleCroppingPlanesButton`);
toggleCroppingPlanesButton.click();
})
MOUSETRAP.bind('alt+w', function (event, combo) {
preventDefaults(event);
const toggleCroppingPlanesButton = document.getElementById(`${viewerDOMId}-toggleCroppingPlanesButton`);
toggleCroppingPlanesButton.click();
})
MOUSETRAP.bind(',', function (event, combo) {
preventDefaults(event);
const toggleCroppingPlanesButton = document.getElementById(`${viewerDOMId}-toggleCroppingPlanesButton`);
toggleCroppingPlanesButton.click();
})
MOUSETRAP.bind('alt+,', function (event, combo) {
preventDefaults(event);
const toggleCroppingPlanesButton = document.getElementById(`${viewerDOMId}-toggleCroppingPlanesButton`);
toggleCroppingPlanesButton.click();
})
MOUSETRAP.bind("'", function (event, combo) {
preventDefaults(event);
const toggleUserInterfaceButton = document.getElementById(`${viewerDOMId}-toggleUserInterfaceButton`);
toggleUserInterfaceButton.click();
})
MOUSETRAP.bind("alt+'", function (event, combo) {
preventDefaults(event);
const toggleUserInterfaceButton = document.getElementById(`${viewerDOMId}-toggleUserInterfaceButton`);
toggleUserInterfaceButton.click();
})
MOUSETRAP.bind('q', function (event, combo) {
preventDefaults(event);
const toggleUserInterfaceButton = document.getElementById(`${viewerDOMId}-toggleUserInterfaceButton`);
toggleUserInterfaceButton.click();
})
MOUSETRAP.bind('alt+q', function (event, combo) {
preventDefaults(event);
const toggleUserInterfaceButton = document.getElementById(`${viewerDOMId}-toggleUserInterfaceButton`);
toggleUserInterfaceButton.click();
})
MOUSETRAP.bind('f', function (event, combo) {
preventDefaults(event);
const toggleFullscreenButton = document.getElementById(`${viewerDOMId}-toggleFullscreenButton`);
toggleFullscreenButton.click();
})
MOUSETRAP.bind('alt+f', function (event, combo) {
preventDefaults(event);
const toggleFullscreenButton = document.getElementById(`${viewerDOMId}-toggleFullscreenButton`);
toggleFullscreenButton.click();
})
MOUSETRAP.bind('u', function (event, combo) {
preventDefaults(event);
const toggleFullscreenButton = document.getElementById(`${viewerDOMId}-toggleFullscreenButton`);
toggleFullscreenButton.click();
})
MOUSETRAP.bind('alt+u', function (event, combo) {
preventDefaults(event);
const toggleFullscreenButton = document.getElementById(`${viewerDOMId}-toggleFullscreenButton`);
toggleFullscreenButton.click();
})
MOUSETRAP.bind('s', function (event, combo) {
preventDefaults(event);
const toggleSlicingPlanesButton = document.getElementById(`${viewerDOMId}-toggleSlicingPlanesButton`);
toggleSlicingPlanesButton.click();
})
MOUSETRAP.bind('alt+s', function (event, combo) {
preventDefaults(event);
const toggleSlicingPlanesButton = document.getElementById(`${viewerDOMId}-toggleSlicingPlanesButton`);
toggleSlicingPlanesButton.click();
})
MOUSETRAP.bind('o', function (event, combo) {
preventDefaults(event);
const toggleSlicingPlanesButton = document.getElementById(`${viewerDOMId}-toggleSlicingPlanesButton`);
toggleSlicingPlanesButton.click();
})
MOUSETRAP.bind('alt+o', function (event, combo) {
preventDefaults(event);
const toggleSlicingPlanesButton = document.getElementById(`${viewerDOMId}-toggleSlicingPlanesButton`);
toggleSlicingPlanesButton.click();
})
MOUSETRAP.bind('shift', function (event, combo) {
preventDefaults(event);
document.getElementById(viewerDOMId + '-toggleMovePlaneButton').click();
})
MOUSETRAP.bind('ctrl', function (event, combo) {
preventDefaults(event);
document.getElementById(viewerDOMId + '-toggleMoveDepthButton').click();
})
MOUSETRAP.bind('m', function (event, combo) {
preventDefaults(event);
document.getElementById(viewerDOMId + '-toggleMirrorButton').click();
})
MOUSETRAP.bind('t', function (event, combo) {
preventDefaults(event);
tumorWidget.snapToSlice();
});
MOUSETRAP.bind('alt+t', function (event, combo) {
preventDefaults(event);
document.getElementById(viewerDOMId + '-toggleTumorSelector').click();
});
MOUSETRAP.bind('c', function (event, combo) {
preventDefaults(event);
compareWidget.snapToSlice();
});
MOUSETRAP.bind('alt+c', function (event, combo) {
preventDefaults(event);
document.getElementById(viewerDOMId + '-toggleControlSelector').click();
});
MOUSETRAP.bind('x', function (event, combo) {
preventDefaults(event);
document.getElementById(viewerDOMId + '-toggleTransferFunctionButton').click();
});
MOUSETRAP.bind('y', function (event, combo) {
preventDefaults(event);
document.getElementById(viewerDOMId + '-toggleSimiViewButton').click();
});
});
MOUSETRAP.stopCallback = function () {
return false;
}
container.addEventListener('mouseleave', () => {
MOUSETRAP.reset();
});
}
export default addKeyboardShortcuts;
|
// @flow
/* eslint-env mocha */
import assert from 'power-assert'
import differenceInYears from '.'
describe('differenceInYears', function() {
it('returns the number of full years between the given dates', function() {
var result = differenceInYears(
new Date(2012, 6 /* Jul */, 2, 18, 0),
new Date(2011, 6 /* Jul */, 2, 6, 0)
)
assert(result === 1)
})
it('returns a negative number if the time value of the first date is smaller', function() {
var result = differenceInYears(
new Date(2011, 6 /* Jul */, 2, 6, 0),
new Date(2012, 6 /* Jul */, 2, 18, 0)
)
assert(result === -1)
})
it('accepts timestamps', function() {
var result = differenceInYears(
new Date(2014, 6 /* Jul */, 2).getTime(),
new Date(2010, 6 /* Jul */, 2).getTime()
)
assert(result === 4)
})
describe('edge cases', function() {
it('the difference is less than a year, but the given dates are in different calendar years', function() {
var result = differenceInYears(
new Date(2015, 0 /* Jan */, 1),
new Date(2014, 11 /* Dec */, 31)
)
assert(result === 0)
})
it('the same for the swapped dates', function() {
var result = differenceInYears(
new Date(2014, 11 /* Dec */, 31),
new Date(2015, 0 /* Jan */, 1)
)
assert(result === 0)
})
it('the days and months of the given dates are the same', function() {
var result = differenceInYears(
new Date(2014, 8 /* Sep */, 5),
new Date(2012, 8 /* Sep */, 5)
)
assert(result === 2)
})
it('the given dates are the same', function() {
var result = differenceInYears(
new Date(2014, 8 /* Sep */, 5, 0, 0),
new Date(2014, 8 /* Sep */, 5, 0, 0)
)
assert(result === 0)
})
it('does not return -0 when the given dates are the same', () => {
function isNegativeZero(x) {
return x === 0 && 1 / x < 0
}
var result = differenceInYears(
new Date(2014, 8 /* Sep */, 5, 0, 0),
new Date(2014, 8 /* Sep */, 5, 0, 0)
)
var resultIsNegative = isNegativeZero(result)
assert(resultIsNegative === false)
})
})
it('returns NaN if the first date is `Invalid Date`', function() {
var result = differenceInYears(
new Date(NaN),
new Date(2017, 0 /* Jan */, 1)
)
assert(isNaN(result))
})
it('returns NaN if the second date is `Invalid Date`', function() {
var result = differenceInYears(
new Date(2017, 0 /* Jan */, 1),
new Date(NaN)
)
assert(isNaN(result))
})
it('returns NaN if the both dates are `Invalid Date`', function() {
var result = differenceInYears(new Date(NaN), new Date(NaN))
assert(isNaN(result))
})
it('throws TypeError exception if passed less than 2 arguments', function() {
assert.throws(differenceInYears.bind(null), TypeError)
assert.throws(differenceInYears.bind(null, 1), TypeError)
})
})
|
const origin = "http//localhost:3100";
|
require("kaoscript/register");
var Type = require("@kaoscript/runtime").Type;
module.exports = function() {
var __ks_Array = require("../_/_array.ks")().__ks_Array;
__ks_Array.__ks_func_injectAt_0 = function(index, ...args) {
if(arguments.length < 1) {
throw new SyntaxError("Wrong number of arguments (" + arguments.length + " for 1)");
}
if(index === void 0 || index === null) {
throw new TypeError("'index' is not nullable");
}
else if(!Type.isNumber(index)) {
throw new TypeError("'index' is not of type 'Number'");
}
if(index < 0) {
do {
index = this.length + index + 1;
}
while(index < 0)
}
if(args.length > 1) {
if(index !== 0) {
if(index >= this.length) {
for(let i = 0, __ks_0 = args.length; i < __ks_0; ++i) {
this.push.apply(this, [].concat(args[i]));
}
}
else {
for(let i = 0, __ks_0 = args.length; i < __ks_0; ++i) {
this.splice.apply(this, [].concat([index, 0], args[i]));
index += [].concat(args[i]).length;
}
}
}
else {
for(let i = args.length - 1; i >= 0; --i) {
this.unshift.apply(this, [].concat(args[i]));
}
}
}
else {
if(index !== 0) {
if(index >= this.length) {
this.push.apply(this, [].concat(args[0]));
}
else {
this.splice.apply(this, [].concat([index, 0], args[0]));
}
}
else {
this.unshift.apply(this, [].concat(args[0]));
}
}
return this;
};
__ks_Array._im_injectAt = function(that) {
var args = Array.prototype.slice.call(arguments, 1, arguments.length);
return __ks_Array.__ks_func_injectAt_0.apply(that, args);
};
};
|
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
'use strict';
const models = require('./index');
/**
* Defines a contractual rule for link attribution.
*
* @extends models['ContractualRulesAttribution']
*/
class ContractualRulesLinkAttribution extends models['ContractualRulesAttribution'] {
/**
* Create a ContractualRulesLinkAttribution.
* @member {string} text The attribution text.
* @member {string} url The URL to the provider's website. Use text and URL
* to create the hyperlink.
* @member {boolean} [optionalForListDisplay] Indicates whether this
* provider's attribution is optional.
*/
constructor() {
super();
}
/**
* Defines the metadata of ContractualRulesLinkAttribution
*
* @returns {object} metadata of ContractualRulesLinkAttribution
*
*/
mapper() {
return {
required: false,
serializedName: 'ContractualRules/LinkAttribution',
type: {
name: 'Composite',
className: 'ContractualRulesLinkAttribution',
modelProperties: {
targetPropertyName: {
required: false,
readOnly: true,
serializedName: 'targetPropertyName',
type: {
name: 'String'
}
},
_type: {
required: true,
serializedName: '_type',
type: {
name: 'String'
}
},
mustBeCloseToContent: {
required: false,
readOnly: true,
serializedName: 'mustBeCloseToContent',
type: {
name: 'Boolean'
}
},
text: {
required: true,
serializedName: 'text',
type: {
name: 'String'
}
},
url: {
required: true,
serializedName: 'url',
type: {
name: 'String'
}
},
optionalForListDisplay: {
required: false,
readOnly: true,
serializedName: 'optionalForListDisplay',
type: {
name: 'Boolean'
}
}
}
}
};
}
}
module.exports = ContractualRulesLinkAttribution;
|
/**
* Swedish translation (utf8-encoding)
* By Erik Andersson, Monator Technologies
* 24 April 2007
* Changed by Cariad, 29 July 2007
*/
Ext.onReady(function() {
var cm = Ext.ClassManager,
exists = Ext.Function.bind(cm.get, cm);
if (Ext.Updater) {
Ext.Updater.defaults.indicatorText = '<div class="loading-indicator">Laddar...</div>';
}
Ext.define("Ext.locale.sv_SE.view.View", {
override: "Ext.view.View",
emptyText: ""
});
Ext.define("Ext.locale.sv_SE.grid.plugin.DragDrop", {
override: "Ext.grid.plugin.DragDrop",
dragText: "{0} markerade rad(er)"
});
Ext.define("Ext.locale.sv_SE.TabPanelItem", {
override: "Ext.TabPanelItem",
closeText: "Stäng denna flik"
});
Ext.define("Ext.locale.sv_SE.form.field.Base", {
override: "Ext.form.field.Base",
invalidText: "Värdet i detta fält är inte tillåtet"
});
// changing the msg text below will affect the LoadMask
Ext.define("Ext.locale.sv_SE.view.AbstractView", {
override: "Ext.view.AbstractView",
msg: "Laddar..."
});
if (Ext.Date) {
Ext.Date.monthNames = ["januari", "februari", "mars", "april", "maj", "juni", "juli", "augusti", "september", "oktober", "november", "december"];
Ext.Date.dayNames = ["söndag", "måndag", "tisdag", "onsdag", "torsdag", "fredag", "lördag"];
}
if (Ext.MessageBox) {
Ext.MessageBox.buttonText = {
ok: "OK",
cancel: "Avbryt",
yes: "Ja",
no: "Nej"
};
}
if (exists('Ext.util.Format')) {
Ext.apply(Ext.util.Format, {
thousandSeparator: '.',
decimalSeparator: ',',
currencySign: 'kr',
// Swedish Krone
dateFormat: 'Y-m-d'
});
}
Ext.define("Ext.locale.sv_SE.picker.Date", {
override: "Ext.picker.Date",
todayText: "Idag",
minText: "Detta datum inträffar före det tidigast tillåtna",
maxText: "Detta datum inträffar efter det senast tillåtna",
disabledDaysText: "",
disabledDatesText: "",
monthNames: Ext.Date.monthNames,
dayNames: Ext.Date.dayNames,
nextText: 'Nästa månad (Ctrl + högerpil)',
prevText: 'Föregående månad (Ctrl + vänsterpil)',
monthYearText: 'Välj en månad (Ctrl + uppåtpil/neråtpil för att ändra årtal)',
todayTip: "{0} (mellanslag)",
format: "Y-m-d",
startDay: 1
});
Ext.define("Ext.locale.sv_SE.toolbar.Paging", {
override: "Ext.PagingToolbar",
beforePageText: "Sida",
afterPageText: "av {0}",
firstText: "Första sidan",
prevText: "Föregående sida",
nextText: "Nästa sida",
lastText: "Sista sidan",
refreshText: "Uppdatera",
displayMsg: "Visar {0} - {1} av {2}",
emptyMsg: 'Det finns ingen data att visa'
});
Ext.define("Ext.locale.sv_SE.form.field.Text", {
override: "Ext.form.field.Text",
minLengthText: "Minsta tillåtna längd för detta fält är {0}",
maxLengthText: "Största tillåtna längd för detta fält är {0}",
blankText: "Detta fält är obligatoriskt",
regexText: "",
emptyText: null
});
Ext.define("Ext.locale.sv_SE.form.field.Number", {
override: "Ext.form.field.Number",
minText: "Minsta tillåtna värde för detta fält är {0}",
maxText: "Största tillåtna värde för detta fält är {0}",
nanText: "{0} är inte ett tillåtet nummer"
});
Ext.define("Ext.locale.sv_SE.form.field.Date", {
override: "Ext.form.field.Date",
disabledDaysText: "Inaktiverad",
disabledDatesText: "Inaktiverad",
minText: "Datumet i detta fält måste inträffa efter {0}",
maxText: "Datumet i detta fält måste inträffa före {0}",
invalidText: "{0} är inte ett tillåtet datum - datum ska anges i formatet {1}",
format: "Y-m-d"
});
Ext.define("Ext.locale.sv_SE.form.field.ComboBox", {
override: "Ext.form.field.ComboBox",
valueNotFoundText: undefined
}, function() {
Ext.apply(Ext.form.field.ComboBox.prototype.defaultListConfig, {
loadingText: "Laddar..."
});
});
if (exists('Ext.form.field.VTypes')) {
Ext.apply(Ext.form.field.VTypes, {
emailText: 'Detta fält ska innehålla en e-post adress i formatet "användare@domän.se"',
urlText: 'Detta fält ska innehålla en länk (URL) i formatet "http:/' + '/www.domän.se"',
alphaText: 'Detta fält får bara innehålla bokstäver och "_"',
alphanumText: 'Detta fält får bara innehålla bokstäver, nummer och "_"'
});
}
Ext.define("Ext.locale.sv_SE.grid.header.Container", {
override: "Ext.grid.header.Container",
sortAscText: "Sortera stigande",
sortDescText: "Sortera fallande",
lockText: "Lås kolumn",
unlockText: "Lås upp kolumn",
columnsText: "Kolumner"
});
Ext.define("Ext.locale.sv_SE.grid.PropertyColumnModel", {
override: "Ext.grid.PropertyColumnModel",
nameText: "Namn",
valueText: "Värde",
dateFormat: "Y-m-d"
});
});
|
'use strict';
function foo() {}
// Local rules
// Off: mocha/no-mocha-arrows, mocha/no-skipped-tests
describe.skip( () => {
// Off: mocha/no-hooks-for-single-case
beforeEach( () => {
} );
// Off: mocha/no-skipped-tests
it.skip( () => {
} );
} );
// Recommended
// Off: mocha/valid-suite-description
describe( 'Suite', function () {
// Off: mocha/no-hooks
it( 'title', async function () {
return 1;
} );
// Off: mocha/valid-test-description
it( 'async', async function ( done ) {
// Off: mocha/no-return-from-async
return done();
} );
// Off: mocha/no-synchronous-tests
it( 'test', function () {
return;
} );
} );
// Off: mocha/prefer-arrow-callback
foo( function ( a ) {
return a;
} );
|
/**
* ************************************
*
* @module next-persist
* @author most-js
* @description function to save state to cookies
*
* ************************************
*/
const Cookie = require('js-cookie');
function setCookieStore(cookieConfig, state) {
const key = Object.keys(cookieConfig)[0];
const allowList = Object.values(cookieConfig)[0];
// if allowList was not defined in cookieConfig, sets cookie containing entire state
if (allowList.length === 0) {
Cookie.set(key, JSON.stringify(state));
} else {
// sets cookie containing only properties listed in allowList
const allowedState = allowList.reduce((acc, cur) => {
acc[cur] = state[cur];
return acc;
}, {});
Cookie.set(key, JSON.stringify(allowedState));
}
}
module.exports = setCookieStore;
|
/*
* Copyright (c) 2017-2018 Digital Bazaar, Inc. All rights reserved.
*/
'use strict';
const constants = require('../constants');
const LinkedDataSignature2015 = require('./LinkedDataSignature2015');
module.exports = class GraphSignature2012 extends LinkedDataSignature2015 {
constructor(injector, algorithm = 'GraphSignature2012') {
super(injector, algorithm);
}
async canonize(input, options) {
const jsonld = this.injector.use('jsonld');
const opts = {
algorithm: 'URGNA2012',
format: 'application/n-quads',
expansionMap: options.expansionMap
};
if(options.documentLoader) {
opts.documentLoader = options.documentLoader;
}
return jsonld.canonize(input, opts);
}
async createVerifyData(input, options) {
// TODO: frame before getting signature, not just compact? considerations:
// should the assumption be (for this library) that the signature is on
// the top-level object and thus framing is unnecessary?
const jsonld = this.injector.use('jsonld');
const opts = {expansionMap: options.expansionMap};
if(options.documentLoader) {
opts.documentLoader = options.documentLoader;
}
const compacted = await jsonld.compact(
input, constants.SECURITY_CONTEXT_URL, opts);
// TODO: will need to preserve `signature` when chained signature
// option is set in the future
// delete the existing signature(s) prior to canonicalization
delete compacted.signature;
const c14n = await this.canonize(compacted, options);
let verifyData = '';
if(options.nonce !== null && options.nonce !== undefined) {
verifyData += options.nonce;
}
verifyData += options.date;
verifyData += c14n;
if(options.domain !== null && options.domain !== undefined) {
verifyData += '@' + options.domain;
}
return {
data: verifyData,
encoding: 'utf8'
};
}
async validateKey(key, options) {
if(typeof key.publicKeyPem !== 'string') {
throw new TypeError(
'Unknown public key encoding. Public key encoding must be ' +
'"publicKeyPem".');
}
const jsonld = this.injector.use('jsonld');
if(!jsonld.hasValue(key, 'type', 'CryptographicKey')) {
throw new TypeError(
'Invalid key type. Key type must be "CryptographicKey".');
}
}
};
|
import React, { useState, useEffect } from "react";
import { connect } from "react-redux";
import axios from "axios";
import { Link } from "react-router-dom";
const SignIn = (props) => {
const [user, setUser] = useState({
username: "",
password: ""
});
const handleChange = (e) => {
setUser({ ...user, [e.target.name]: e.target.value });
};
const submitLogin = () => {
axios
.post("https://howto-be.herokuapp.com/api/auth/login", user)
.then((result) => {
console.log("login", result);
localStorage.setItem("token", result.data.token);
localStorage.setItem("user_id", result.data.user_id);
props.appRefresh();
props.history.push("/howto");
})
.catch((error) => {
console.log(error);
});
};
const submitRegister = (e) => {
axios
.post("https://howto-be.herokuapp.com/api/auth/register", user)
.then((res) => {
console.log("register", res);
submitLogin();
});
};
const submitLogout = (e) => {
localStorage.clear();
props.appRefresh();
};
useEffect(() => {
console.log(user);
}, [user]);
return (
<header>
<nav>
<Link className="link" to="/">
Home
</Link>
<Link className="link" to="/about">
About us
</Link>
<Link className="link" to="/howto">
How To Do It
</Link>
</nav>
{localStorage.getItem("token") == null ? (
<form
onSubmit={(e) => {
e.preventDefault();
}}
>
<label>Username</label>
<input
name="username"
value={user.username}
onChange={(e) => handleChange(e)}
></input>
<label>Password</label>
<input
name="password"
value={user.password}
onChange={(e) => handleChange(e)}
></input>
<button type="submit" onClick={(e) => submitLogin(e)}>
Sign In
</button>
<button onClick={(e) => submitRegister(e)}>Register</button>
</form>
) : (
<button onClick={() => submitLogout()}>log out</button>
)}
</header>
);
};
const mapStateToProps = (state) => {
return {
isLoading: state.isLoading,
user: state.user,
error: state.error
};
};
export default connect(mapStateToProps, {})(SignIn);
|
import {
UPDATE_KEYWORD
} from '../actions/keyword';
const initialState = {
filterText: ''
};
export default function keyword(state = initialState, action = {}) {
switch (action.type) {
case UPDATE_KEYWORD:
return Object.assign({}, initialState, {filterText: action.payload.filterText});
default:
return state;
}
}
|
function wait(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
describe('Visual testing', () => {
test('Components available', () => expect(components && components.length > 0).toBeTruthy());
if (components && components.length) {
for (const { identifier, link, skip, wait: waitMs } of components) {
const testFunction = skip ? test.skip : test;
testFunction(identifier, async () => {
await page.goto(link);
if (waitMs) {
await wait(waitMs);
}
const $component = await page.$('[data-preview]');
const screenshot = await $component.screenshot();
try {
expect(screenshot).toMatchImageSnapshot({
customSnapshotIdentifier: identifier,
dumpDiffToConsole: true,
});
} catch (e) {
throw new Error(`${e}\n${link}`);
}
});
}
}
});
|
CKEDITOR.plugins.setLang("a11yhelp","es",{title:"Instrucciones de accesibilidad",contents:"Ayuda. Para cerrar presione ESC.",legend:[{name:"General",items:[{name:"Barra de herramientas del editor",legend:'Presiona ${toolbarFocus} para navegar por la barra de herramientas. Para moverse por los distintos grupos de herramientas usa las teclas TAB y MAY+TAB. Para moverse por las distintas herramientas usa FLECHA DERECHA o FECHA IZQUIERDA. Presiona "espacio" o "intro" para activar la herramienta.'},{name:"Editor de di\xe1logo",legend:"Inside a dialog, press TAB to navigate to the next dialog element, press SHIFT+TAB to move to the previous dialog element, press ENTER to submit the dialog, press ESC to cancel the dialog. When a dialog has multiple tabs, the tab list can be reached either with ALT+F10 or with TAB as part of the dialog tabbing order. With tab list focused, move to the next and previous tab with RIGHT and LEFT ARROW, respectively."},{name:"Editor del men\xfa contextual",legend:"Presiona ${contextMenu} o TECLA MEN\xda para abrir el men\xfa contextual. Entonces mu\xe9vete a la siguiente opci\xf3n del men\xfa con TAB o FLECHA ABAJO. Mu\xe9vete a la opci\xf3n previa con SHIFT + TAB o FLECHA ARRIBA. Presiona ESPACIO o ENTER para seleccionar la opci\xf3n del men\xfa. Abre el submen\xfa de la opci\xf3n actual con ESPACIO o ENTER o FLECHA DERECHA. Regresa al elemento padre del men\xfa con ESC o FLECHA IZQUIERDA. Cierra el men\xfa contextual con ESC."},{name:"Lista del Editor",legend:"Dentro de una lista, te mueves al siguiente elemento de la lista con TAB o FLECHA ABAJO. Te mueves al elemento previo de la lista con SHIFT+TAB o FLECHA ARRIBA. Presiona ESPACIO o ENTER para elegir la opci\xf3n de la lista. Presiona ESC para cerrar la lista."},{name:"Barra de Ruta del Elemento en el Editor",legend:"Presiona ${elementsPathFocus} para navegar a los elementos de la barra de ruta. Te mueves al siguiente elemento bot\xf3n con TAB o FLECHA DERECHA. Te mueves al bot\xf3n previo con SHIFT+TAB o FLECHA IZQUIERDA. Presiona ESPACIO o ENTER para seleccionar el elemento en el editor."}]},{name:"Comandos",items:[{name:"Comando deshacer",legend:"Presiona ${undo}"},{name:"Comando rehacer",legend:"Presiona ${redo}"},{name:"Comando negrita",legend:"Presiona ${bold}"},{name:"Comando it\xe1lica",legend:"Presiona ${italic}"},{name:"Comando subrayar",legend:"Presiona ${underline}"},{name:"Comando liga",legend:"Presiona ${liga}"},{name:"Comando colapsar barra de herramientas",legend:"Presiona ${toolbarCollapse}"},{name:"Comando accesar el anterior espacio de foco",legend:"Presiona ${accessPreviousSpace} para accesar el espacio de foco no disponible m\xe1s cercano anterior al cursor, por ejemplo: dos elementos HR adyacentes. Repite la combinaci\xf3n de teclas para alcanzar espacios de foco distantes."},{name:"Comando accesar el siguiente spacio de foco",legend:"Presiona ${accessNextSpace} para accesar el espacio de foco no disponible m\xe1s cercano despu\xe9s del cursor, por ejemplo: dos elementos HR adyacentes. Repite la combinaci\xf3n de teclas para alcanzar espacios de foco distantes."},{name:"Ayuda de Accesibilidad",legend:"Presiona ${a11yHelp}"}]}],backspace:"Retroceso",tab:"Tabulador",enter:"Ingresar",shift:"May\xfas.",ctrl:"Ctrl",alt:"Alt",pause:"Pausa",capslock:"Bloq. May\xfas.",escape:"Escape",pageUp:"Regresar P\xe1gina",pageDown:"Avanzar P\xe1gina",end:"Fin",home:"Inicio",leftArrow:"Flecha Izquierda",upArrow:"Flecha Arriba",rightArrow:"Flecha Derecha",downArrow:"Flecha Abajo",insert:"Insertar","delete":"Suprimir",leftWindowKey:"Tecla Windows Izquierda",rightWindowKey:"Tecla Windows Derecha",selectKey:"Tecla de Selecci\xf3n",numpad0:"Tecla 0 del teclado num\xe9rico",numpad1:"Tecla 1 del teclado num\xe9rico",numpad2:"Tecla 2 del teclado num\xe9rico",numpad3:"Tecla 3 del teclado num\xe9rico",numpad4:"Tecla 4 del teclado num\xe9rico",numpad5:"Tecla 5 del teclado num\xe9rico",numpad6:"Tecla 6 del teclado num\xe9rico",numpad7:"Tecla 7 del teclado num\xe9rico",numpad8:"Tecla 8 del teclado num\xe9rico",numpad9:"Tecla 9 del teclado num\xe9rico",multiply:"Multiplicar",add:"Sumar",subtract:"Restar",decimalPoint:"Punto Decimal",divide:"Dividir",f1:"F1",f2:"F2",f3:"F3",f4:"F4",f5:"F5",f6:"F6",f7:"F7",f8:"F8",f9:"F9",f10:"F10",f11:"F11",f12:"F12",numLock:"Num Lock",scrollLock:"Scroll Lock",semiColon:"Punto y coma",equalSign:"Signo de Igual",comma:"Coma",dash:"Gui\xf3n",period:"Punto",forwardSlash:"Diagonal",graveAccent:"Acento Grave",openBracket:"Abrir llave",backSlash:"Diagonal Invertida",closeBracket:"Cerrar llave",singleQuote:"Comillas simples"});
|
$(document).ready(function () {
const context = $('.scrolling-wrapper')
$('.left-arrow').bind('click touchstart', function (e) {
// console.log(context)
context.animate({scrollLeft: 0}, 400, 'swing');
})
$('.right-arrow').bind('click touchstart', function (e) {
// console.log(context)
context.animate({ scrollLeft: document.body.scrollWidth * 2}, 400, 'swing');
})
});
|
/**
<doc:module date="2001-06-12">
<doc:module>exslt:date-time</doc:module>
<doc:name>dates</doc:name>
<doc:version>2.0</doc:version>
<doc:language>exslt:javascript</doc:language>
<doc:meta>
<doc:author email="chris@bayes.co.uk" url="http://www.bayes.co.uk">Chris Bayes</doc:author>
<doc:summary>Implementation of EXSLT - Dates (http://www.exslt.org/date)</doc:summary>
<doc:todo>_validDuration is not 100%</doc:todo>
<doc:todo>All timezone code.</doc:todo>
</doc:meta>
</doc:module>
**/
var gsSuppliedFormat = "";
var gsLang = "en";
var gaLang = new Array();
// en
gaLang["en"] = new Array();
gaLang["en"]["months"] = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
gaLang["en"]["shortMonths"] = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
gaLang["en"]["days"] = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
gaLang["en"]["shortDays"] = new Array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");
var gaDayNames = new Array();
gaDayNames["sunday"] = 0;gaDayNames["monday"] = 1;gaDayNames["tuesday"] = 2;gaDayNames["wednesday"] = 3;gaDayNames["thursday"] = 4;gaDayNames["friday"] = 5;gaDayNames["saturday"] = 6;
var gaMonthCnt = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
var gaMonthCntL = new Array(31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
function _isLeap(y){return ( ((y%4==0)&(y%100!=0))|(y%400==0) );}
function _dayOfWeek(y,d){return ( ((y-1)+Math.floor((y-1)/4)-Math.floor((y-1)/100)+Math.floor((y-1)/400)+d)%7);}
function _dayInYear(y,m,d){return (m==0?d:eval( (_isLeap(y)?gaMonthCntL.slice(0,m).join("+"):gaMonthCnt.slice(0,m).join("+")) )+(d*1) );}
/**
<doc:function date="2001-06-12">
<doc:name>add</doc:name>
<doc:version>2.0</doc:version>
<doc:return type="string" />
<doc:args>
<doc:arg name="date" type="string" default="''" optional="no"></doc:arg>
<doc:arg name="duration" type="string" default="''" optional="no"></doc:arg>
</doc:args>
</doc:function>
**/
function add(){//
var d1,d2;
if (((d1 = _validDate(arguments[0], "xs:dateTime")) ||
(d1 = _validDate(arguments[0], "xs:date")) ||
(d1 = _validDate(arguments[0], "xs:gYearMonth")) ||
(d1 = _validDate(arguments[0], "xs:gYear"))
) &&
(d2 = _validDuration(arguments[1])))
return _formatDate(d2.addDate(d1), gsSuppliedFormat);
return '';
}
/**
<doc:function date="2001-06-12">
<doc:name>addDuration</doc:name>
<doc:version>2.0</doc:version>
<doc:return type="string" />
<doc:args>
<doc:arg name="duration" type="string" default="''" optional="no"></doc:arg>
<doc:arg name="duration" type="string" default="''" optional="no"></doc:arg>
</doc:args>
</doc:function>
**/
function addDuration(duration1, duration2){
if ((d1 = _validDuration(duration1)) && (d2 = _validDuration(duration2))){
var d1mnth = d1.years *12 + d1.months;
var d1secs = d1.days*86400 + d1.hours*3600 + d1.minutes*60 + (d1.seconds+'.'+d1.fraction)*1;
var d2mnth = d2.years *12 + d2.months;
var d2secs = d2.days*86400 + d2.hours*3600 + d2.minutes*60 + (d2.seconds+'.'+d2.fraction)*1;
var mnthdiff = (d1.pm+d1mnth)*1 + (d2.pm+d2mnth)*1;
var secsdiff = (d1.pm+d1secs)*1 + (d2.pm+d2secs)*1;
if ((mnthdiff < 0 && secsdiff > 0) || (mnthdiff > 0 && secsdiff < 0))
return '';
var secs = secsdiff % 60;
var pm = (mnthdiff<0||secsdiff<0?'-':'');
mnthdiff = Math.abs(mnthdiff);
secsdiff = Math.abs(secsdiff);
return _formatDuration(new Duration(pm, 0, mnthdiff, Math.floor(secsdiff/86400), Math.floor((secsdiff%86400)/3600), Math.floor((secsdiff%3600)/60), Math.floor(secs), Math.floor(secs%1)));
}
return '';
}
/**
<doc:function date="2001-06-12">
<doc:name>date</doc:name>
<doc:version>2.0</doc:version>
<doc:return type="string" />
<doc:args>
<doc:arg name="date" type="string" default="''" optional="yes"></doc:arg>
</doc:args>
</doc:function>
**/
function date(){//
if (arguments.length > 0){
var oDate;
if ((oDate = _validDate(arguments[0], "xs:dateTime")) ||
(oDate = _validDate(arguments[0], "xs:date"))
)
return _formatDate(oDate, "xs:date");
else
return '';
}else
return _formatDate(new Date(), "xs:date");
}
/**
<doc:function date="2001-06-12">
<doc:name>dateTime</doc:name>
<doc:version>2.0</doc:version>
<doc:return type="string" />
<doc:args />
</doc:function>
**/
function dateTime(){//must be UTC/Z
if (arguments.length > 0)
dateTime_invalidArgument.error;
var oDate = new Date();
return _formatDate(oDate, "xs:dateTime");
}
/**
<doc:function date="2001-06-12">
<doc:name>dayAbbreviation</doc:name>
<doc:version>2.0</doc:version>
<doc:return type="string" />
<doc:args>
<doc:arg name="date" type="string" default="''" optional="yes"></doc:arg>
<doc:arg name="date-format" type="string" default="''" optional="yes"></doc:arg>
<doc:arg name="context" type="context" default="null" optional="yes"></doc:arg>
</doc:args>
</doc:function>
**/
function dayAbbreviation(){
if (arguments.length > 0){
var oDate;
if ((oDate = _validDate(arguments[0], "xs:dateTime")) ||
(oDate = _validDate(arguments[0], "xs:date"))
)
return _dayAbbreviation(oDate.getDay(), arguments[1], arguments[2]);
else
return '';
}else
return _dayAbbreviation(new Date().getDay(), arguments[1], arguments[2]);
}
function _dayAbbreviation(num, dfName, ctx){
if (ctx != null){
var nodes = ctx.nextNode.selectNodes(
"//*[local-name()='date-format' and namespace-uri()='http://exslt.org/dates-and-times' and @name='" + dfName +"' ]" +
"/*[local-name()='days' and namespace-uri()='http://exslt.org/dates-and-times']" +
"/*[local-name()='day' and namespace-uri()='http://exslt.org/dates-and-times']/@abbr");
if (nodes != null)
return nodes[num].nodeValue;
else
return '';
}else{ //we could try local
return gaLang[gsLang]["shortDays"][num*1];
}
}
/**
<doc:function date="2001-06-12">
<doc:name>dayInMonth</doc:name>
<doc:version>2.0</doc:version>
<doc:return type="number" />
<doc:args>
<doc:arg name="date" type="string" default="''" optional="yes"></doc:arg>
</doc:args>
</doc:function>
**/
function dayInMonth(){//
if (arguments.length > 0){
var oDate;
if ((oDate = _validDate(arguments[0], "xs:dateTime")) ||
(oDate = _validDate(arguments[0], "xs:date")) ||
(oDate = _validDate(arguments[0], "xs:gMonthDay")) ||
(oDate = _validDate(arguments[0], "xs:gDay"))
)
return oDate.getDate();
else
return Number.NaN
}else
return new Date().getDate();
}
/**
<doc:function date="2001-06-12">
<doc:name>dayInWeek</doc:name>
<doc:version>2.0</doc:version>
<doc:return type="number" />
<doc:args>
<doc:arg name="date" type="string" default="''" optional="yes"></doc:arg>
<doc:arg name="date-format" type="string" default="''" optional="yes"></doc:arg>
<doc:arg name="context" type="context" default="null" optional="yes"></doc:arg>
</doc:args>
</doc:function>
**/
function dayInWeek(){//
if (arguments.length > 0){
var oDate;
if ((oDate = _validDate(arguments[0], "xs:dateTime")) ||
(oDate = _validDate(arguments[0], "xs:date"))
)
return _dayInWeek(oDate, arguments[1], arguments[2]);
else
return Number.NaN;
}else
return _dayInWeek(new Date(), arguments[1], arguments[2]);
}
function _dayInWeek(oDate, dfName, ctx){
var fdow = 0;
if (ctx != null){
var nodes = ctx.nextNode.selectSingleNode(
"//*[local-name()='date-format' and namespace-uri()='http://exslt.org/dates-and-times' and @name='" + dfName +"' ]" +
"/@first-day-of-week");
if (nodes != null)
fdow = gaDayNames[nodes.nodeValue];
}
return (oDate.getDay()-fdow<0?oDate.getDay()-fdow+7:oDate.getDay()-fdow)+1;
}
/**
<doc:function date="2001-06-12">
<doc:name>dayInYear</doc:name>
<doc:version>2.0</doc:version>
<doc:return type="number" />
<doc:args>
<doc:arg name="date" type="string" default="''" optional="yes"></doc:arg>
</doc:args>
</doc:function>
**/
function dayInYear(){
if (arguments.length > 0){
var oDate;
if ((oDate = _validDate(arguments[0], "xs:dateTime")) ||
(oDate = _validDate(arguments[0], "xs:date"))
)
return _dayInYear(oDate.getFullYear(), oDate.getMonth(), oDate.getDate());
else
return Number.NaN;
}else{
var oDate = new Date()
return _dayInYear(oDate.getFullYear(), oDate.getMonth(), oDate.getDate());
}
}
/**
<doc:function date="2001-06-12">
<doc:name>dayName</doc:name>
<doc:version>2.0</doc:version>
<doc:return type="string" />
<doc:args>
<doc:arg name="date" type="string" default="''" optional="yes"></doc:arg>
<doc:arg name="date-format" type="string" default="''" optional="yes"></doc:arg>
<doc:arg name="context" type="context" default="null" optional="yes"></doc:arg>
</doc:args>
</doc:function>
**/
function dayName(){
if (arguments.length > 0){
var oDate;
if ((oDate = _validDate(arguments[0], "xs:dateTime")) ||
(oDate = _validDate(arguments[0], "xs:date"))
)
return _dayName(oDate.getDay(), arguments[1], arguments[2]);
else
return '';
}else
return _dayName(new Date().getDay(), arguments[1], arguments[2]);
}
function _dayName(num, dfName, ctx){
if (ctx != null){
var nodes = ctx.nextNode.selectNodes(
"//*[local-name()='date-format' and namespace-uri()='http://exslt.org/dates-and-times' and @name='" + dfName +"' ]" +
"/*[local-name()='days' and namespace-uri()='http://exslt.org/dates-and-times']" +
"/*[local-name()='day' and namespace-uri()='http://exslt.org/dates-and-times']/text()");
if (nodes != null)
return nodes[num].nodeValue;
else
return '';
}else
return gaLang[gsLang]["days"][num*1];
}
/**
<doc:function date="2001-06-12">
<doc:name>dayOfWeekInMonth</doc:name>
<doc:version>2.0</doc:version>
<doc:return type="number" />
<doc:args>
<doc:arg name="date" type="string" default="''" optional="yes"></doc:arg>
<doc:arg name="date-format" type="string" default="''" optional="yes"></doc:arg>
<doc:arg name="context" type="context" default="null" optional="yes"></doc:arg>
</doc:args>
</doc:function>
**/
function dayOfWeekInMonth(){
if (arguments.length > 0){
var oDate;
if ((oDate = _validDate(arguments[0], "xs:dateTime")) ||
(oDate = _validDate(arguments[0], "xs:date"))
)
return _dayOfWeekInMonth(oDate, arguments[1], arguments[2]);
else
return Number.NaN;
}else
return _dayOfWeekInMonth(new Date(), arguments[1], arguments[2]);
}
function _dayOfWeekInMonth(oDate, dfName, ctx){
var fdow = 0;
if (ctx != null){
var nodes = ctx.nextNode.selectSingleNode(
"//*[local-name()='date-format' and namespace-uri()='http://exslt.org/dates-and-times' and @name='" + dfName +"' ]" +
"/@first-day-of-week");
if (nodes != null)
fdow = gaDayNames[nodes.nodeValue];
}
if (fdow > (oDate.getDay()-1))
return Math.floor((oDate.getDate())/7)+1;
else
return Math.floor((oDate.getDate())/7) + 1;
}
/**
<doc:function date="2001-06-12">
<doc:name>difference</doc:name>
<doc:version>2.0</doc:version>
<doc:return type="string" />
<doc:args>
<doc:arg name="date" type="string" default="''" optional="yes"></doc:arg>
<doc:arg name="date" type="string" default="''" optional="yes"></doc:arg>
</doc:args>
</doc:function>
**/
function difference(){
if (((d1 = _validDate(arguments[0], "xs:dateTime")) ||
(d1 = _validDate(arguments[0], "xs:date")) ||
(d1 = _validDate(arguments[0], "xs:gYearMonth")) ||
(d1 = _validDate(arguments[0], "xs:gYear"))
) &&
((d2 = _validDate(arguments[1], "xs:dateTime")) ||
(d2 = _validDate(arguments[1], "xs:date")) ||
(d2 = _validDate(arguments[1], "xs:gYearMonth")) ||
(d2 = _validDate(arguments[1], "xs:gYear"))
)
){// truncation
var diffMil = d2.valueOf() - d1.valueOf();
return _formatDuration(diffMil);
}
return Number.NaN;
}
/**
<doc:function date="2001-06-12">
<doc:name>duration</doc:name>
<doc:version>2.0</doc:version>
<doc:return type="string" />
<doc:args>
<doc:arg name="seconds" type="number" default="''" optional="yes"></doc:arg>
</doc:args>
</doc:function>
**/
function duration(){
var oDate;
if (arguments.length > 0){
var nN = new Number(arguments[0]);
if (isNaN(nN))
return '';
else
return _formatDuration(arguments[0] * 1000);
}else
return _formatDuration(seconds() * 1000);
}
/**
<doc:function date="2001-06-12">
<doc:name>formatDate</doc:name>
<doc:version>1.0</doc:version>
<doc:return type="string" />
<doc:args>
<doc:arg name="date" type="string" default="''" optional="no"></doc:arg>
<doc:arg name="format" type="string" default="''" optional="no"></doc:arg>
<doc:arg name="date-format" type="string" default="''" optional="no"></doc:arg>
<doc:arg name="context" type="document" default="null" optional="yes"></doc:arg>
</doc:args>
</doc:function>
**/
function formatDate(date, format, dateF, ctx){
var oDate;
var re;
var retString = "";
if ((oDate = _validDate(date, "xs:dateTime")) ||
(oDate = _validDate(date, "xs:date")) ||
(oDate = _validDate(date, "xs:time")) ||
(oDate = _validDate(date, "xs:gYearMonth")) ||
(oDate = _validDate(date, "xs:gYear")) ||
(oDate = _validDate(date, "xs:gMonthDay")) ||
(oDate = _validDate(date, "xs:gMonth")) ||
(oDate = _validDate(date, "xs:gDay"))
){
for (var i=0; i < format.length;){
var s = i;
switch(format.substr(i, 1)){
case "G":// era designator (Text) AD
while (format.substr(i, 1)=="G"){i++;}
if (oDate.getFullYear() < 0){
retString += "BC";
}else{
retString += "AD";
}
break;
case "y":// year (Number) 1996
while (format.substr(i, 1)=="y"){i++;}
if (i-s > 2){
retString += oDate.getFullYear();
}else{
retString += oDate.getFullYear().toString().substring(4-(i-s));
}
break;
case "M":// month in year (Text & Number) July & 07
while (format.substr(i, 1)=="M"){i++;}
if (i-s <= 2){
retString += pad(oDate.getMonth()+1);
}else{
retString += _monthName(oDate.getMonth(), dateF, ctx);
}
break;
case "d":// day in month (Number) 10
while (format.substr(i, 1)=="d"){i++;}
retString += pad(oDate.getDate());
break;
case "h":// hour in am/pm (1~12) (Number) 12
while (format.substr(i, 1)=="h"){i++;}
if (oDate.getHours() > 12){
retString += pad(oDate.getHours()-12);
}else{
retString += pad(oDate.getHours());
}
break;
case "H":// hour in day (0~23) (Number) 0
while (format.substr(i, 1)=="H"){i++;}
retString += oDate.getHours();
break;
case "m":// minute in hour (Number) 30
while (format.substr(i, 1)=="m"){i++;}
retString += pad(oDate.getMinutes());
break;
case "s":// second in minute (Number) 55
while (format.substr(i, 1)=="s"){i++;}
retString += pad(oDate.getSeconds());
break;
case "S":// millisecond (Number) 978
while (format.substr(i, 1)=="S"){i++;}
retString += oDate.getMilliseconds();
break;
case "E":// day in week (Text) Tuesday
while (format.substr(i, 1)=="E"){i++;}
retString += dayInWeek(oDate, dateF, ctx);
break;
case "D":// day in year (Number) 189
while (format.substr(i, 1)=="D"){i++;}
retString += _dayInYear(oDate.getFullYear(), oDate.getMonths(), oDate.getDate());
break;
case "F":// day of week in month (Number) 2 (2nd Wed in July)
while (format.substr(i, 1)=="F"){i++;}
retString += dayOfWeekInMonth(oDate, dateF, ctx);
break;
case "w":// week in year (Number) 27
while (format.substr(i, 1)=="w"){i++;}
retString += weekInYear(oDate, dateF, ctx);
break;
case "W":// week in month (Number) 2
while (format.substr(i, 1)=="W"){i++;}
retString += weekInMonth(oDate, dateF, ctx);
break;
case "a":// am/pm marker (Text) PM
while (format.substr(i, 1)=="a"){i++;}
if (oDate.getHours() > 12 ){
retString += "PM"
}else{
retString += "AM"
}
break;
case "k":// hour in day (1~24) (Number) 24
while (format.substr(i, 1)=="k"){i++;}
retString += oDate.getHours();
break;
case "K":// hour in am/pm (0~11) (Number) 0
while (format.substr(i, 1)=="K"){i++;}
if (oDate.getHours() > 12){
retString += oDate.getHours()-12;
}else{
retString += oDate.getHours();
}
break;
case "z":// time zone (Text) Pacific Standard Time
while (format.substr(i, 1)=="z"){i++;}
var tzo = oDate.getTimezoneOffset();
retString += (tzo < 0?"-":"+") + pad(Math.abs(tzo / 60)) + ":" + pad(tzo % 60);
break;
case "'":// escape for text (Delimiter)
if (format.substr(i+1, 1) == "'"){
i++;
while (format.substr(i, 1)=="'"){i++;}
retString += "'";
}else{
i++;
while (format.substr(i, 1)!="'" && i <= format.length){retString += format.substr(i++, 1);}
if (i >= format.length)return '';
i++;
}
break;
default:
retString += format.substr(i, 1);
i++;
break;
}
}
}
return retString;
}
/**
<doc:function date="2001-06-12">
<doc:name>hourInDay</doc:name>
<doc:version>2.0</doc:version>
<doc:return type="number" />
<doc:args>
<doc:arg name="date" type="string" default="''" optional="yes"></doc:arg>
</doc:args>
</doc:function>
**/
function hourInDay(){//
if (arguments.length > 0){
var oDate;
if ((oDate = _validDate(arguments[0], "xs:dateTime")) ||
(oDate = _validDate(arguments[0], "xs:time"))
)
return oDate.getHours();
else
return Number.NaN;
}else
return new Date().getHours();
}
/**
<doc:function date="2001-06-12">
<doc:name>leapYear</doc:name>
<doc:version>2.0</doc:version>
<doc:return type="boolean" />
<doc:args>
<doc:arg name="date" type="string" default="''" optional="yes"></doc:arg>
</doc:args>
</doc:function>
**/
function leapYear(){
if (arguments.length > 0 && arguments[0] != ''){
var oDate;
if ((oDate = _validDate(arguments[0], "xs:dateTime")) ||
(oDate = _validDate(arguments[0], "xs:date")) ||
(oDate = _validDate(arguments[0], "xs:gYearMonth")) ||
(oDate = _validDate(arguments[0], "xs:gYear"))
)
return (_isLeap(oDate.getFullYear())?true:false);
else
return Number.NaN;
}else
return (_isLeap(new Date().getFullYear())?true:false);
}
/**
<doc:function date="2001-06-12">
<doc:name>minuteInHour</doc:name>
<doc:version>2.0</doc:version>
<doc:return type="number" />
<doc:args>
<doc:arg name="date" type="string" default="''" optional="yes"></doc:arg>
</doc:args>
</doc:function>
**/
function minuteInHour(){//
if (arguments.length > 0){
var oDate;
if ((oDate = _validDate(arguments[0], "xs:dateTime")) ||
(oDate = _validDate(arguments[0], "xs:time"))
)
return oDate.getMinutes();
else
return Number.NaN;
}else
return new Date().getMinutes();
}
/**
<doc:function date="2001-06-12">
<doc:name>monthAbbreviation</doc:name>
<doc:version>2.0</doc:version>
<doc:return type="string" />
<doc:args>
<doc:arg name="date" type="string" default="''" optional="yes"></doc:arg>
<doc:arg name="date-format" type="string" default="''" optional="yes"></doc:arg>
<doc:arg name="context" type="context" default="null" optional="yes"></doc:arg>
</doc:args>
</doc:function>
**/
function monthAbbreviation(){//
if (arguments.length > 0){
var oDate;
if ((oDate = _validDate(arguments[0], "xs:dateTime")) ||
(oDate = _validDate(arguments[0], "xs:date")) ||
(oDate = _validDate(arguments[0], "xs:gYearMonth")) ||
(oDate = _validDate(arguments[0], "xs:gMonthDay"))
)
return _monthAbbreviation(oDate.getMonth(), arguments[1], arguments[2]);
else
return '';
}else
return _monthAbbreviation(new Date().getMonth(), arguments[1], arguments[2]);
}
function _monthAbbreviation(num, dfName, ctx){//
if (ctx != null){
var nodes = ctx.nextNode.selectNodes(
"//*[local-name()='date-format' and namespace-uri()='http://exslt.org/dates-and-times' and @name='" + dfName +"' ]" +
"/*[local-name()='months' and namespace-uri()='http://exslt.org/dates-and-times']" +
"/*[local-name()='month' and namespace-uri()='http://exslt.org/dates-and-times']/@abbr");
if (nodes != null)
return nodes[num].nodeValue;
else
return '';
}else{ //we could try local
return gaLang[gsLang]["shortMonths"][num*1];
}
}
/**
<doc:function date="2001-06-12">
<doc:name>monthInYear</doc:name>
<doc:version>2.0</doc:version>
<doc:return type="number" />
<doc:args>
<doc:arg name="date" type="string" default="''" optional="yes"></doc:arg>
</doc:args>
</doc:function>
**/
function monthInYear(){//
if (arguments.length > 0){
var oDate;
if ((oDate = _validDate(arguments[0], "xs:dateTime")) ||
(oDate = _validDate(arguments[0], "xs:date")) ||
(oDate = _validDate(arguments[0], "xs:gYearMonth")) ||
(oDate = _validDate(arguments[0], "xs:gMonthDay")) ||
(oDate = _validDate(arguments[0], "xs:gYear"))
)
return oDate.getMonth()+1;
else
return Number.NaN;
}else
return new Date().getMonth()+1;
}
/**
<doc:function date="2001-06-12">
<doc:name>monthName</doc:name>
<doc:version>2.0</doc:version>
<doc:return type="string" />
<doc:args>
<doc:arg name="date" type="string" default="''" optional="yes"></doc:arg>
<doc:arg name="date-format" type="string" default="''" optional="yes"></doc:arg>
<doc:arg name="context" type="context" default="null" optional="yes"></doc:arg>
</doc:args>
</doc:function>
**/
function monthName(){//
if (arguments.length > 0){// && arguments[0] != ''
var oDate;
if ((oDate = _validDate(arguments[0], "xs:dateTime")) ||
(oDate = _validDate(arguments[0], "xs:date")) ||
(oDate = _validDate(arguments[0], "xs:gYearMonth")) ||
(oDate = _validDate(arguments[0], "xs:gMonthDay"))
)
return _monthName(oDate.getMonth(), arguments[1], arguments[2]);
else
return '';
}else
return _monthName(new Date().getMonth(), arguments[1], arguments[2]);
}
function _monthName(num, dfName, ctx){//
if (ctx != null){
var nodes = ctx.nextNode.selectNodes(
"//*[local-name()='date-format' and namespace-uri()='http://exslt.org/dates-and-times' and @name='" + dfName +"' ]" +
"/*[local-name()='months' and namespace-uri()='http://exslt.org/dates-and-times']" +
"/*[local-name()='month' and namespace-uri()='http://exslt.org/dates-and-times']/text()");
if (nodes != null)
return nodes[num].nodeValue;
else
return '';
}else
return gaLang[gsLang]["months"][num*1];
}
/**
<doc:function date="2001-06-12">
<doc:name>parseDate</doc:name>
<doc:version>1.0</doc:version>
<doc:return type="string" />
<doc:args>
<doc:arg name="date" type="string" default="''" optional="yes"></doc:arg>
<doc:arg name="input-format" type="string" default="''" optional="no"></doc:arg>
<doc:arg name="date-format" type="string" default="''" optional="yes"></doc:arg>
<doc:arg name="context" type="document" default="null" optional="yes"></doc:arg>
</doc:args>
</doc:function>
**/
function parseDate(date, inFormat, dfName, ctx){//0001
var oDate;
if (inFormat == ""){
if ((oDate = _validDate(date, "xs:dateTime")) ||
(oDate = _validDate(date, "xs:date")) ||
(oDate = _validDate(date, "xs:time")) ||
(oDate = _validDate(date, "xs:gYearMonth")) ||
(oDate = _validDate(date, "xs:gYear")) ||
(oDate = _validDate(date, "xs:gMonthDay")) ||
(oDate = _validDate(date, "xs:gMonth")) ||
(oDate = _validDate(date, "xs:gDay"))
){
return _formatDate(oDate, "xs:dateTime");
}
}else{
if (oDate = _validDate(date, inFormat))
return _formatDate(oDate, dfName);
else
return '';
}
}
/**
<doc:function date="2001-06-12">
<doc:name>secondInMinute</doc:name>
<doc:version>2.0</doc:version>
<doc:return type="number" />
<doc:args>
<doc:arg name="date" type="string" default="''" optional="yes"></doc:arg>
</doc:args>
</doc:function>
**/
function secondInMinute(){//
if (arguments.length > 0){
var oDate;
if ((oDate = _validDate(arguments[0], "xs:dateTime")) ||
(oDate = _validDate(arguments[0], "xs:time"))
)
return oDate.getSeconds();
else
return Number.NaN;
}else
return new Date().getSeconds();
}
/**
<doc:function date="2001-06-12">
<doc:name>seconds</doc:name>
<doc:version>2.0</doc:version>
<doc:return type="number" />
<doc:args>
<doc:arg name="date" type="string" default="''" optional="yes"></doc:arg>
</doc:args>
</doc:function>
**/
function seconds(){//
if (arguments.length > 0){
var oDate;
if ((oDate = _validDate(arguments[0], "xs:dateTime")) ||
(oDate = _validDate(arguments[0], "xs:date")) ||
(oDate = _validDate(arguments[0], "xs:gYearMonth")) ||
(oDate = _validDate(arguments[0], "xs:gYear"))
)
return oDate.valueOf()/1000;
else
if (oDate = _validDuration(arguments[0]))
return oDate.Seconds();
else
return Number.NaN;
}else
return Math.floor(new Date().valueOf()/1000);//current local date/time
}
/**
<doc:function date="2001-06-12">
<doc:name>sum</doc:name>
<doc:version>2.0</doc:version>
<doc:return type="string" />
<doc:args>
<doc:arg name="durations" type="node-set" default="''" optional="no"></doc:arg>
</doc:args>
</doc:function>
**/
function sum(ctx){
var sDate = "P0S";
if (typeof(ctx) == "object"){
if (ctx.length){
for (var i=0; i < ctx.length; i++){
ctxN = ctx.item(i);
if (ctxN.nodeType == 1){
if (!(sDate = addDuration(sDate, _wander(ctxN))))
return '';
}
if (ctxN.nodeType == 2){
if (!(sDate = addDuration(sDate, ctxN.nodeValue)))
return '';
}
}
}else{
if (!(sDate = addDuration(sDate, ctx.nodeValue)))
return '';
}
}else{
return '';
}
return sDate;
}
function _wander(ctx){
var sDate = "P0S";
for (var i=0; i < ctx.childNodes.length; i++){
ctxN = ctx.childNodes[i];
switch(ctxN.nodeType){
case 1:
if (!(sDate = addDuration(sDate, _wander(ctxN))))
return '';
break;
case 3:
if (!(sDate = addDuration(sDate, ctxN.nodeValue)))
return '';
break;
default:
break;
}
}
return sDate;
}
/**
<doc:function date="2001-06-12">
<doc:name>time</doc:name>
<doc:version>2.0</doc:version>
<doc:return type="string" />
<doc:args>
<doc:arg name="date" type="string" default="''" optional="yes"></doc:arg>
</doc:args>
</doc:function>
**/
function time(){//
if (arguments.length > 0){
var oDate;
if ((oDate = _validDate(arguments[0], "xs:dateTime"))||
(oDate = _validDate(arguments[0], "xs:time"))
)
return _formatDate(oDate, "xs:time");
else
return '';
}else
return _formatDate(new Date(), "xs:time");
}
/**
<doc:function date="2001-06-12">
<doc:name>weekInMonth</doc:name>
<doc:version>2.0</doc:version>
<doc:return type="number" />
<doc:args>
<doc:arg name="date" type="string" default="''" optional="yes"></doc:arg>
<doc:arg name="date-format" type="string" default="''" optional="yes"></doc:arg>
<doc:arg name="context" type="context" default="null" optional="yes"></doc:arg>
</doc:args>
</doc:function>
**/
function weekInMonth(){
if (arguments.length > 0){
var oDate;
if ((oDate = _validDate(arguments[0], "xs:dateTime")) ||
(oDate = _validDate(arguments[0], "xs:date"))
)
return _weekInMonth(oDate, arguments[1], arguments[2]);
else
return Number.NaN;
}else
return _weekInMonth(new Date(), arguments[1], arguments[2]);
}
function _weekInMonth(oDate, dfName, ctx){
var fdow = 0;
if (ctx != null){
var nodes = ctx.nextNode.selectSingleNode(
"//*[local-name()='date-format' and namespace-uri()='http://exslt.org/dates-and-times' and @name='" + dfName +"' ]" +
"/@first-day-of-week");
if (nodes != null)
fdow = gaDayNames[nodes.nodeValue];
}
var f = new Date(oDate);
f.setDate(1)
var fd = f.getDay()-1;
var dt = oDate.getDate() + fd - fdow;
return Math.floor((dt)/7)+1;
}
/**
<doc:function date="2001-06-12">
<doc:name>weekInYear</doc:name>
<doc:version>2.0</doc:version>
<doc:return type="number" />
<doc:args>
<doc:arg name="date" type="string" default="''" optional="yes"></doc:arg>
<doc:arg name="date-format" type="string" default="''" optional="yes"></doc:arg>
<doc:arg name="context" type="context" default="null" optional="yes"></doc:arg>
</doc:args>
</doc:function>
**/
function weekInYear(){
if (arguments.length > 0){
var oDate;
if ((oDate = _validDate(arguments[0], "xs:dateTime")) ||
(oDate = _validDate(arguments[0], "xs:date"))
)
return _weekInYear(oDate, arguments[1], arguments[2]);
}else
return _weekInYear(new Date());
return '';
}
function _weekInYear(oDate, dfName, ctx){
var fdow = 0;
if (ctx != null){
var nodes = ctx.nextNode.selectSingleNode(
"//*[local-name()='date-format' and namespace-uri()='http://exslt.org/dates-and-times' and @name='" + dfName +"' ]" +
"/@first-day-of-week");
if (nodes != null)
fdow = gaDayNames[nodes.nodeValue];
return Math.ceil(_dayInYear(oDate.getFullYear(), oDate.getMonth(), oDate.getDate()+(7-fdow)) / 7);
}else
return Math.ceil(_dayInYear(oDate.getFullYear(), oDate.getMonth(), oDate.getDate()) / 7);
}
/**
<doc:function date="2001-06-12">
<doc:name>year</doc:name>
<doc:version>2.0</doc:version>
<doc:return type="number" />
<doc:args>
<doc:arg name="date" type="string" default="''" optional="yes"></doc:arg>
</doc:args>
</doc:function>
**/
function year(){//
if (arguments.length > 0){
var oDate;
if ((oDate = _validDate(arguments[0], "xs:dateTime")) ||
(oDate = _validDate(arguments[0], "xs:date")) ||
(oDate = _validDate(arguments[0], "xs:gYearMonth")) ||
(oDate = _validDate(arguments[0], "xs:gYear"))
)
return oDate.getFullYear();
else
return Number.NaN;
}else
return new Date().getFullYear();
}
/**
Private functions.
**/
function _validDate(date, format){
var parts;
var oDate = new Date(-62135596800000); // Mon Jan 1 00:00:00 UTC 1
switch(format){
case "xs:dateTime": //(CCYY-MM-DDThh:mm:ss)
var re = new RegExp("^([0-9]{4})-([0-9]{2})-([0-9]{2})(T([0-9]{2})(:([0-9]{2})(:([0-9]{2}))?)?)?(Z)?([\+\-][0-9]{2}:[0-9]{2})?$");
if (parts=re.exec(date)){
if (parts[10] == "Z"){
oDate.setFullYear(parts[1], parts[2]-1, parts[3]);
oDate.setHours(parts[5], parts[7], parts[9]);
oDate.setMinutes(oDate.getMinutes()-oDate.getTimezoneOffset());
gsSuppliedFormat = "xs:dateTime";
return oDate;
}else{
oDate.setFullYear(parts[1], parts[2]-1, parts[3]);
oDate.setHours(parts[5], parts[7], parts[9]);
gsSuppliedFormat = "xs:dateTime";
return oDate;
}
}
break;
case "xs:date": //(CCYY-MM-DD)
var re = new RegExp("^([0-9]{4})-([0-9]{2})-([0-9]{2})$");
if (parts=re.exec(date)){
oDate.setFullYear(parts[1], parts[2]-1, parts[3]);
gsSuppliedFormat = "xs:date";
return oDate;
}
break;
case "xs:time": //(hh:mm:ss)
var re = new RegExp("^([0-9]{2})(:([0-9]{2})(:([0-9]{2}))?)?(Z)?$");
if (parts=re.exec(date)){
if (parts[9] == "Z"){
oDate.setHours(parts[1], parts[3], parts[5]);
oDate.setMinutes(oDate.getMinutes()-oDate.getTimezoneOffset());
gsSuppliedFormat = "xs:time";
return oDate;
}else{
oDate.setHours(parts[1], parts[3], parts[5]);
gsSuppliedFormat = "xs:time";
return oDate;
}
}
break;
case "xs:gYearMonth": //(CCYY-MM)
var re = new RegExp("^([0-9]{4})-([0-9]{2})$");
if (parts=re.exec(date)){
oDate.setFullYear(parts[1], parts[2]-1);
gsSuppliedFormat = "xs:gYearMonth";
return oDate;
}
break;
case "xs:gYear": //(CCYY)
var re = new RegExp("^([0-9]{4})$");
if (parts=re.exec(date)){
oDate.setFullYear(parts[1]);
gsSuppliedFormat = "xs:gYear";
return oDate;
}
break;
case "xs:gMonthDay": //(^--MM-DD)
var re = new RegExp("--([0-9]{2})-([0-9]{2})");
if (parts=re.exec(date)){
oDate.setMonth(parts[1]-1, parts[2]);
gsSuppliedFormat = "xs:gMonthDay";
return oDate;
}
break;
case "xs:gMonth": //(--MM--)
var re = new RegExp("^--([0-9]{2})--$");
if (parts=re.exec(date)){
oDate.setMonth(parts[1]-1);
gsSuppliedFormat = "xs:gMonth";
return oDate;
}
break;
case "xs:gDay": //(---DD)
var re = new RegExp("^---([0-9]{2})$");
if (parts=re.exec(date)){
oDate.setDate(parts[1]);
gsSuppliedFormat = "xs:gDay";
return oDate;
}
break;
default:
// format string
var Z = "";
for (var i=0,j=0; i < format.length & oDate.toString() != "NaN";){
var s = j;
switch(format.substr(i, 1)){
case "G":// era designator (Text) AD
while (format.substr(i, 1)=="G"){i++;j++;}
j++;
if (date.substr(s,j-s) == "BC" || date.substr(s,j-s) == "bc"){
oDate.setFullYear(-oDate.getFullYear);
}
break;
case "y":// year (Number) 1996
while (format.substr(i, 1)=="y"){i++;j++;}
oDate.setYear(date.substr(s,j-s));
break;
case "M":// month in year (Text & Number) July & 07
while (format.substr(i, 1)=="M"){i++;j++;}
if (i-s <= 2){
oDate.setMonth(date.substr(s,j-s)-1);
}else{
oDate.setMonth(_monthNumber(date.substr(s,j-s)));
}
break;
case "d":// day in month (Number) 10
while (format.substr(i, 1)=="d"){i++;j++;}
oDate.setDate(date.substr(s,j-s));
break;
case "h":// hour in am/pm (1~12) (Number) 12
while (format.substr(i, 1)=="h"){i++;j++;}
oDate.setHours(date.substr(s,j-s));
break;
case "H":// hour in day (0~23) (Number) 0
while (format.substr(i, 1)=="H"){i++;j++;}
oDate.setHours(date.substr(s,j-s));
break;
case "m":// minute in hour (Number) 30
while (format.substr(i, 1)=="m"){i++;j++;}
oDate.setMinutes(date.substr(s,j-s));
break;
case "s":// second in minute (Number) 55
while (format.substr(i, 1)=="s"){i++;j++;}
oDate.setSeconds(date.substr(s,j-s));
break;
case "S":// millisecond (Number) 978
while (format.substr(i, 1)=="S"){i++;j++;}
oDate.setMilliseconds(date.substr(s,j-s));
break;
case "E":// day in week (Text) Tuesday
while (format.substr(i, 1)=="E"){i++;j++;}
while (format.substr(i+1, 1)!=date.substr(j, 1)){j++;}
break;
case "D":// day in year (Number) 189
while (format.substr(i, 1)=="D"){i++;j++;}
while (format.substr(i+1, 1)!=date.substr(j, 1)){j++;}
break;
case "F":// day of week in month (Number) 2 (2nd Wed in July)
while (format.substr(i, 1)=="F"){i++;j++;}
break;
case "w":// week in year (Number) 27
while (format.substr(i, 1)=="w"){i++;j++;}
while (format.substr(i+1, 1)!=date.substr(j, 1)){j++;}
break;
case "W":// week in month (Number) 2
while (format.substr(i, 1)=="W"){i++;j++;}
while (format.substr(i+1, 1)!=date.substr(j, 1)){j++;}
break;
case "a":// am/pm marker (Text) PM
while (format.substr(i, 1)=="a"){i++;j++;}
j++;
if (date.substr(s,j-s) == "PM" || date.substr(s,j-s) == "pm")
oDate.setHours(oDate.getHours()+12);
break;
case "k":// hour in day (1~24) (Number) 24
while (format.substr(i, 1)=="k"){i++;j++;}
oDate.setHours(date.substr(s,j-s));
break;
case "K":// hour in am/pm (0~11) (Number) 0
while (format.substr(i, 1)=="K"){i++;j++;}
oDate.setHours(date.substr(s,j-s));
break;
case "z":// time zone (Text) Pacific Standard Time
while (format.substr(i, 1)=="z"){i++;j++;}
while (format.substr(i+1, 1)!=date.substr(j, 1)){j++;}
//oDate.setMinutes(oDate.getMinutes() - oDate.getTimezoneOffset());
Z = date.substr(s,j-s);
break;
case "'":// escape for text (Delimiter)
if (format.substr(i+1, 1) == "'"){
i+=2;
}else{
i++;
while (format.substr(i, 1)!="'"){i++;j++;}
i++;
}
break;
default:
if (format.substr(i, 1) != date.substr(j, 1)){
return false;
}
i++;j++;
break;
}
}
if (j < date.length)
return false;
if (oDate.toString() != "NaN"){
if (Z != ""){
var re = new RegExp("([\+\-][0-9]{2})?:([0-9]{2})?");
if (parts=re.exec(Z)){
// check GMT/BST
var tzo = parts[1]*60 + parts[2];
//if (tzo != new Date().getTimezoneOffset()){
// oDate.setMinutes(oDate.getMinutes() - (oDate.getTimezoneOffset() - tzo))
//}
}
}
gsSuppliedFormat = "custom";
return oDate;
}
break;
}
return false;
}
function _formatDate(oDate, format){
if (oDate == Number.NaN)return Number.NaN;
switch(format){
case "xs:dateTime": //(CCYY-MM-DDThh:mm:ss)
var tzo = oDate.getTimezoneOffset();
return oDate.getFullYear() + "-" + pad(oDate.getMonth()+1) + "-" + pad(oDate.getDate()) + "T" +
pad(oDate.getHours()) + ":" + pad(oDate.getMinutes()) + ":" + pad(oDate.getSeconds()) + (tzo < 0?"-":"+") + pad(Math.abs(tzo/60)) + ":" + pad(tzo % 60);
break;
case "xs:date": //(CCYY-MM-DD)
return oDate.getFullYear() + "-" + pad(oDate.getMonth()+1) + "-" + pad(oDate.getDate());
break;
case "xs:time": //(hh:mm:ss)
var tzo = oDate.getTimezoneOffset();
return pad(oDate.getHours()) + ":" + pad(oDate.getMinutes()) + ":" + pad(oDate.getSeconds()) + (tzo < 0?"-":"+") + pad(Math.abs(tzo/60)) + ":" + pad(tzo % 60);
break;
case "xs:gYearMonth": //(CCYY-MM)
return oDate.getFullYear() + "-" + pad(oDate.getMonth()+1);
break;
case "xs:gYear": //(CCYY)
return oDate.getFullYear();
break;
case "xs:gMonthDay": //(--MM-DD)
return pad(oDate.getMonth() + 1) + "-" + pad(oDate.getDate());
break;
case "xs:gMonth": //(--MM--)
return pad(oDate.getMonth()+1);
break;
case "xs:gDay": //(---DD)
return pad(oDate.getDate());
break;
}
return false;
}
function pad(v){
return (v<10?"0"+v:v);
}
function _validDuration(d){
var parts;
var re = new RegExp("^([\-])?P(([0-9]+)Y)?(([0-9]+)M)?(([0-9]+)D)?((T)?(([0-9]+)H)?(([0-9]+)M)?((([0-9]+)(\.([0-9]+))?)S)?)?$");
if (parts = re.exec(d)){
if ((/T$/.exec(d)) || (parts[9] == "T" && parts[11]+parts[13]+parts[16]+parts[18]== ""))// ~(:+(|) duh!!!
return Number.NaN;
return new Duration(parts[1], parts[3], parts[5], parts[7], parts[11], parts[13], parts[16], parts[18]);
}
return Number.NaN;
}
function Duration(pm, years, months, days, hours, minutes, seconds, fraction){
this.pm = pm;
this.years = years*1;
this.months = months*1;
this.days = days*1;
this.hours = hours*1;
this.minutes = minutes*1;
this.seconds = seconds*1;
this.fraction = fraction*1;
this.milliseconds = eval('0.'+fraction) * 100;
this.mask = ((this.years?1:0)<<6) + ((this.months?1:0)<<5) + ((this.days?1:0)<<4) + ((this.hours?1:0)<<3) + ((this.minutes?1:0)<<2) + ((this.seconds?1:0)<<1) + (this.milliseconds?1:0);
this.addDate = function(d){d.setFullYear(eval(this.pm+this.years)+d.getFullYear(),eval(this.pm+this.months)+d.getMonth(),eval(this.pm+this.days)+d.getDate());d.setHours(eval(this.pm+this.hours)+d.getHours(),eval(this.pm+this.minutes)+d.getMinutes(),eval(this.pm+this.seconds)+d.getSeconds());d.setMilliseconds(eval(this.pm+this.milliseconds));return d;}
this.Seconds = function(){if (this.years || this.months)return Number.NaN;return this.days*giDayMill + this.hours*giHourMill + this.minutes*giMinMill + this.seconds*giSecMill;}
}
var giYearMill = 31536000000;
var giMonthMill = 2592000000;
var giDayMill = 86400000;
var giHourMill = 3600000;
var giMinMill = 60000;
var giSecMill = 1000;
function _formatDuration(du){
if (typeof(du) == "object"){
var pm = du.pm;
var y = du.years;
var m = du.months;
var d = du.days;
var h = du.hours;
var n = du.minutes;
var s = du.seconds + du.milliseconds/1000;
if (y+m+d+h+n+s == 0)
return 'P0S';
return pm + "P" +
(y!=0?y + "Y":'') +
(m!=0?m + "M":'') +
(d!=0?d + "D":'') +
(h+n+s!=0?"T":'') +
(h!=0?h + "H":'') +
(n!=0?n + "M":'') +
(s!=0?s + "S":'');
}else{
var pm = (du<0?'-':'');
du = Math.abs(du);
var d = Math.floor((du) / giDayMill);
var h = Math.floor((du % giDayMill) / giHourMill);
var n = Math.floor((du % giHourMill) / giMinMill);
var s = Math.floor((du % giMinMill) / giSecMill) + (du % giSecMill)/1000;
return pm + "P" +
(d!=0?d + "D":'') +
(h+n+s!=0?"T":'') +
(h!=0?h + "H":'') +
(n!=0?n + "M":'') +
(s!=0?s + "S":'');
}
}
|
OC.L10N.register(
"calendar",
{
"User-Session unexpectedly expired" : "ההפעלה של המשתמש הסתיימה באופן בלתי צפוי",
"Provided email-address is not valid" : "כתובת הדוא\"ל שצוינה אינה חוקית",
"%s has published the calendar »%s«" : "%sפרסם את לוח השנה»%s«",
"Unexpected error sending email. Please contact your administrator." : "שגיאה לא צפויה בשליחת דוא\"ל. אנא פנה למנהל המערכת שלך.",
"Successfully sent email to " : "דוא\"ל נשלח בהצלחה אל",
"Hello," : "שלום,",
"We wanted to inform you that %s has published the calendar »%s«." : "רצינו להודיע לך ש-%s פירסם את לוח השנה. »%s«.",
"Open »%s«" : "פתיחת „%s”",
"Cheers!" : "ברכותינו!",
"Upcoming events" : "אירועים הבאים בקרוב",
"Calendar" : "יומן",
"A Calendar app for Nextcloud" : "יישומון לוח שנה ל־Nextcloud",
"The Calendar app is a user interface for Nextcloud's CalDAV server. Easily sync events from various devices with your Nextcloud and edit them online.\n\n* 🚀 **Integration with other Nextcloud apps!** Currently Contacts - more to come.\n* 🌐 **WebCal Support!** Want to see your favorite team’s matchdays in your calendar? No problem!\n* 🙋 **Attendees!** Invite people to your events\n* ⌚️ **Free/Busy!** See when your attendees are available to meet\n* ⏰ **Reminders!** Get alarms for events inside your browser and via email\n* 🔍 Search! Find your events at ease\n* ☑️ Tasks! See tasks with a due date directly in the calendar\n* 🙈 **We’re not reinventing the wheel!** Based on the great [c-dav library](https://github.com/nextcloud/cdav-library), [ical.js](https://github.com/mozilla-comm/ical.js) and [fullcalendar](https://github.com/fullcalendar/fullcalendar) libraries." : "אפליקציית לוח השנה היא ממשק משתמש לשרת CalDAV של Nextcloud. סנכרן בקלות אירועים ממכשירים שונים עם Nextcloud שלך, וערוך אותם באופן מקוון.\n\n* 🚀 **אינטגרציה עם אפליקציות Nextcloud אחרות!** כרגע אנשי קשר - עוד יבוא.\n* 🌐 **תמיכה ב- WebCal!** רוצה לראות את ימי המשחק של הקבוצה האהובה עליך ביומן שלך? אין בעיה!\n* 🙋 **משתתפים!** הזמן אנשים לאירועים שלך\n* ⌚️ **חינם/עסוק!** ראה מתי המשתתפים שלך זמינים להיפגש\n* ⏰ **תזכורות!** קבל אזעקות לאירועים בתוך הדפדפן שלך ודרך אי-מייל\n* 🔍 חפש! מצא את האירועים שלך בנחת\n* ☑️ משימות! ראה משימות עם תאריך יעד ישירות בלוח השנה\n* 🙈 **אנחנו לא ממציאים את הגלגל מחדש!** בהתבסס על [ספריית c-dav] הנהדרת, וספריות \n(https://github.com/nextcloud/cdav-library), [ical.js] (https: // github.com/mozilla-comm/ical.js) ו- [fullcalendar] (https://github.com/fullcalendar/fullcalendar).",
"Previous day" : "היום הקודם",
"Previous week" : "השבוע הקודם",
"Previous month" : "החודש הקודם",
"Next day" : "היום הבא",
"Next week" : "השבוע הבא",
"Next month" : "החודש הבא",
"+ New event" : "+ ארוע חדש",
"Today" : "היום",
"Day" : "יום",
"Week" : "שבוע",
"Month" : "חודש",
"List" : "רשימה",
"Untitled calendar" : "לוח שנה ללא כותרת",
"Edit name" : "ערוך שם",
"Saving name …" : "שמירת השם ...",
"Edit color" : "ערוך צבע",
"Saving color …" : "שמירת הצבע ...",
"Copy private link" : "העתקת קישור פרטי",
"Download" : "הורדה",
"Unshare from me" : "ביטול השיתוף איתי",
"Delete" : "מחיקה",
"An error occurred, unable to change visibility of the calendar." : "אירעה שגיאה--לא מצליחים לשנות את הראות של לוח השנה.",
"An error occurred, unable to delete the calendar." : "אירעה שגיאה, לא ניתן למחוק את היומן.",
"Calendar link copied to clipboard." : "הקישור ללוח השנה הועתק ללוח הגזירים.",
"Calendar link could not be copied to clipboard." : "לא ניתן להעתיק את הקישור ללוח השנה אל לוח הגזירים.",
"An error occurred, unable to rename the calendar." : "אירעה שגיאה--לא מצליחים לשנות את שם לוח השנה.",
"An error occurred, unable to change the calendar's color." : "אירעה שגיאה--לא מצליחים לשנות את צבע לוח השנה.",
"_Unsharing the calendar in {countdown} second_::_Unsharing the calendar in {countdown} seconds_" : ["ביטול שיתוף לוח השנה בתוך {countdown} שניות","ביטול שיתוף לוח השנה בתוך {countdown} שניות","ביטול שיתוף לוח השנה בתוך {countdown} שניות","ביטול שיתוף לוח השנה בתוך {countdown} שניות"],
"_Deleting the calendar in {countdown} second_::_Deleting the calendar in {countdown} seconds_" : ["מחיקת לוח השנה בתוך {countdown} שניות","מחיקת לוח השנה בתוך {countdown} שניות","מחיקת לוח השנה בתוך {countdown} שניות","מחיקת לוח השנה בתוך {countdown} שניות"],
"Share link" : "שיתוף קישור",
"Publish calendar" : "פרסם את לוח השנה",
"Publishing calendar" : "מפרסם את לוח השנה",
"Copy public link" : "העתקת הקישור הציבורי",
"Send link to calendar via email" : "שלח קישור ללוח השנה באמצעות דוא\"ל",
"Enter one address" : "הזן כתובת אחת",
"Sending email …" : "שולח דוא\"ל ...",
"Copy subscription link" : "העתק את קישור המנוי",
"Copying link …" : "מעתיק את הקישור ...",
"Copied link" : "הועתק קישור",
"Could not copy link" : "לא ניתן להעתיק קישור",
"Copy embedding code" : "העתקת קוד הטמעה",
"Copying code …" : "הקוד מועתק …",
"Copied code" : "הקוד הועתק",
"Could not copy code" : "לא ניתן להעתיק את הקוד",
"Delete share link" : "מחיקת קישור שיתוף",
"Deleting share link …" : "מחיקת קישור השיתוף…",
"An error occurred, unable to publish calendar." : "אירעה שגיאה, לא ניתן לפרסם יומן.",
"An error occurred, unable to send email." : "אירעה שגיאה, לא ניתן לשלוח הודעת דוא״ל.",
"Embed code copied to clipboard." : "קוד ההטמעה הועתק ללוח הגזירים.",
"Embed code could not be copied to clipboard." : "לא ניתן להעתיק את קוד ההטמעה ללוח הגזירים.",
"Unpublishing calendar failed" : "ביטול פרסום לוח השנה נכשל",
"Share with users or groups" : "שיתוף עם משתמשים או קבוצות",
"No users or groups" : "אין משתמשים או קבוצות",
"can edit" : "ניתן לערוך",
"Unshare with {displayName}" : "ביטול שיתוף עם {displayName}",
"An error occurred, unable to change the unshare the calendar." : "אירעה שגיאה, לא ניתן לשנות את ביטול שיתוף היומן.",
"An error occurred, unable to change the permission of the share." : "אירעה שגיאה, לא ניתן לשנות את הרשאות השיתוף.",
"+ New calendar" : "+ לוח שנה חדש",
"New calendar" : "לוח שנה חדש",
"Creating calendar …" : "יוצר לוח שנה ...",
"New calendar with task list" : "לוח שנה חדש עם רשימת משימות",
"New subscription from link (read-only)" : "מינוי חדש מקישור (קריאה בלבד)",
"Creating subscription …" : "יוצר מנוי …",
"An error occurred, unable to create the calendar." : "אירעה שגיאה--לא ניתן ליצור את לוח השנה.",
"Please enter a valid link (starting with http://, https://, webcal://, or webcals://)" : "נא למלא קישור תקני (מתחיל ב־http://, https://, webcal://, או webcals://)",
"Could not update calendar order." : "לא היה ניתן לעדכן את סדר לוח השנה.",
"Import calendars" : "יבוא לוחות שנה",
"Please select a calendar to import into …" : "בחר לוח שנה לייבוא אליו …",
"Filename" : "שם קובץ",
"Calendar to import into" : "לוח שנה לייבוא אליו",
"Cancel" : "ביטול",
"_Import calendar_::_Import calendars_" : ["יבוא לוחות שנה","יבוא לוחות שנה","יבוא לוחות שנה","יבוא לוחות שנה"],
"{filename} is an unsupported file-type" : "{filename} הוא סוג קובץ שאינו נתמך",
"{filename} could not be parsed" : "לא ניתן לפענח את {filename}",
"No valid files found, aborting import" : "לא נמצאו קבצים תקפים, הייבוא מבוטל",
"Import partially failed. Imported {accepted} out of {total}." : "הייבוא נכשל חלקית. מיובא {accepted} מתוך {total}.",
"_Successfully imported %n event_::_Successfully imported %n events._" : ["אירוע אחד יובא בהצלחה","%n אירועים יובאו בהצלחה.","%n אירועים יובאו בהצלחה.","%n אירועים יובאו בהצלחה."],
"Automatic" : "אוטומטי",
"Automatic ({detected})" : "אוטומטי ({detected})",
"New setting was not saved successfully." : "ההגדרה החדשה לא נשמרה בהצלחה.",
"Shortcut overview" : "סקירת קיצור דרך",
"or" : "או",
"Navigation" : "ניווט",
"Previous period" : "התקופה הקודמת",
"Next period" : "התקופה הבאה",
"Views" : "תצוגות",
"Day view" : "תצוגת יום",
"Week view" : "תצוגת שבוע",
"Month view" : "תצוגת חודש",
"Actions" : "פעולות",
"Create event" : "יצירת אירוע",
"Show shortcuts" : "הצגת קיצורי דרך",
"Enable birthday calendar" : "אפשר לוח שנה ליום הולדת ",
"Show tasks in calendar" : "הצג משימות בלוח השנה",
"Enable simplified editor" : "אפשר עורך פשוט",
"Limit visible events per view" : "הגבל אירועים גלויים לפי צפייה",
"Show weekends" : "הצגת סופי שבוע",
"Show week numbers" : "הצגת מספרי שבועות",
"Copy primary CalDAV address" : "העתקת כתובת CalDAV עיקרית",
"Copy iOS/macOS CalDAV address" : "העתקת כתובת CalDAV ל־iOS/macOS",
"Show keyboard shortcuts" : "הצגת קיצורי מקלדת",
"Settings & import" : "הגדרות וייבוא",
"CalDAV link copied to clipboard." : "קישור ה־CalDAV הועתק ללוח הגזירים.",
"CalDAV link could not be copied to clipboard." : "לא ניתן להעתיק את קישור ה־CalDAV ללוח הגזירים.",
"before at" : "לפני",
"Notification" : "הוֹדָעָה",
"Email" : "דוא״ל",
"Audio notification" : "הודעת שמע",
"Other notification" : "הודעה אחרת",
"Relative to event" : "יחסית לאירוע",
"On date" : "בתאריך",
"Edit time" : "עריכת שעה",
"Save time" : "שמירת שעה",
"Remove reminder" : "הסרת תזכורת",
"on" : "על",
"at" : "ב-",
"+ Add reminder" : "+ הוספת תזכורת",
"_second_::_seconds_" : ["שנייה","שניות","שניות","שניות"],
"_minute_::_minutes_" : ["דקה","דקות","דקות","דקות"],
"_hour_::_hours_" : ["שעה","שעתיים","שעות","שעות"],
"_day_::_days_" : ["יום","יומיים","ימים","ימים"],
"_week_::_weeks_" : ["שבוע","שבועיים","שבועות","שבועות"],
"No reminders yet" : "אין תזכורות עדיין",
"Availability of attendees, resources and rooms" : "זמינות של משתתפים, משאבים וחדרים",
"Busy (tentative)" : "תפוס (טנטטיבי)",
"Busy" : "עסוק",
"Out of office" : "מחוץ למשרד",
"Unknown" : "לא ידוע",
"{name} accepted your invitation." : "{name} קיבל את ההזמנה שלך.",
"{name} accepted {organizerName}'s invitation." : "{name} קיבל את ההזמנה של {organizerName}.",
"{name} declined your invitation." : "{name} דחה את הזמנתך.",
"{name} declined {organizerName}'s invitation." : "{name} דחה את ההזמנה של {organizerName}.",
"{name} has delegated their invitation." : "{name} האציל את ההזמנה שלהם.",
"{name} marked their participation as tentative." : "{שם} סימנה את השתתפותם כטנטטיבי.",
"{name} did not respond to your invitation yet." : "{name} עדיין לא הגיב להזמנתך.",
"{name} did not respond to {organizerName}'s invitation yet." : "{name} עדיין לא נענה להזמנה של {organizerName}.",
"Create Talk room for this event" : "צור חדר שיחות לאירוע זה",
"Show busy times" : "הראה זמנים עמוסים",
"Successfully appended link to talk room to description." : "הקישור צורף ל\"חדר השיחות\" לתיאור בהצלחה.",
"Error creating Talk room" : "שגיאה ביצירת \"חדר השיחות\"",
"Send e-mail" : "שלח דוא\"ל",
"Chairperson" : "יושב ראש",
"Required participant" : "משתתף חובה",
"Optional participant" : "משתתף אופציונלי",
"Non-participant" : "לא משתתף",
"Remove attendee" : "הסר את המשתתף",
"Search for e-mails, users, contacts, resources or rooms" : "חפש הודעות דואר אלקטרוני, משתמשים, אנשי קשר, משאבים, או חדרים",
"No match found" : "לא נמצאה התאמה",
"No attendees yet" : "עדיין אין משתתפים",
"(organizer)" : "(מארגן)",
"To send out invitations and handle responses, [linkopen]add your email address in personal settings[linkclose]." : "כדי לשלוח הזמנות ולטפל בתגובות, [linkopen] הוסף את כתובת הדוא\"ל שלך בהגדרות האישיות [linkclose].",
"Remove color" : "הסר צבע",
"Event title" : "כותרת האירוע",
"All day" : "כל היום",
"Can not modify all-day setting for events that are part of a recurrence-set." : "לא ניתן לשנות את הגדרת all-day לאירועים שהם חלק מ-recurrence-set.",
"from {startDate}" : "החל מ- {startDate}",
"from {startDate} at {startTime}" : "החל מ- {startDate} בשעה {startTime}",
"to {endDate}" : "ל- {endDate}",
"to {endDate} at {endTime}" : "ל- {endDate} בשעה {endTime}",
"End repeat" : "סיום חזרה",
"Select to end repeat" : "בחר כדי לסיים את החזרה",
"never" : "לעולם לא",
"on date" : "בתאריך",
"after" : "לאחר",
"_time_::_times_" : ["בשעה","בשעה","בשעה","בשעות"],
"This event is the recurrence-exception of a recurrence-set. You can not add a recurrence-rule to it." : "אירוע זה הוא ה-recurrence-exception של recurrence-set. אינך יכול להוסיף לו recurrence-rule.",
"first" : "ראשון",
"third" : "שלישי",
"fourth" : "רביעי",
"fifth" : "חמישי",
"second to last" : "אחד לפני האחרון",
"last" : "אחרון",
"Changes to the recurrence-rule will only apply to this and all future occurrences." : "שינויים ב-recurrence-rule יחולו רק על האירוע הזה ועל כל אירועים עתידיים.",
"Repeat" : "חזרה",
"Repeat every" : "חזור על כל",
"By day of the month" : "לפי היום בחודש",
"On the" : "על",
"_month_::_months_" : ["חודש","חודשיים","חודשים","חודשים"],
"_year_::_years_" : ["שנה","שנתיים","שנים","שנים"],
"Monday" : "יום שני",
"weekday" : "יום בשבוע",
"weekend day" : "יום בסופ״ש",
"Summary" : "תקציר",
"The recurrence definition of this event is not fully supported by Nextcloud. If you edit the recurrence-options, certain recurrences may be lost." : "הגדרת ה-recurrence (=הישנות) של אירוע זה אינה נתמכת במלואה על ידי Nextcloud. אם אתה עורך את ה-recurrence-options, הישנות מסוימות עשויות לאבד.",
"More" : "יותר",
"Save" : "שמור",
"Update" : "עדכון",
"Update this occurrence" : "עדכון המופע הזה",
"Update this and all future" : "עדכון של זה והעתידיים",
"Public calendar does not exist" : "לוח השנה הציבורי אינו קיים",
"Maybe the share was deleted or has expired?" : "אולי השיתוף נמחק או פג תוקפו?",
"Please select a timezone:" : "אנא בחר אזור זמן:",
"Pick a time" : "בחר זמן",
"Pick a date" : "תבחר תאריך",
"from {formattedDate}" : "מ- {formattedDate}",
"to {formattedDate}" : "אל {formattedDate}",
"on {formattedDate}" : "בתאריך {formattedDate}",
"from {formattedDate} at {formattedTime}" : "מ-{formattedDate} בשעה {formattedTime} ",
"to {formattedDate} at {formattedTime}" : "אל {formattedDate} בשעה {formattedTime}",
"on {formattedDate} at {formattedTime}" : "בתאריך {formattedDate} בשעה {formattedTime}",
"{formattedDate} at {formattedTime}" : "{formattedDate} בשעה {formattedTime}",
"Please enter a valid date" : "נא להקליד תאריך תקני",
"Please enter a valid date and time" : "נא להקליד שעה ותאריך תקניים",
"Type to search timezone" : "יש להקליד כדי לחפש אזור זמן",
"Personal" : "אישי",
"The automatic timezone detection determined your timezone to be UTC.\nThis is most likely the result of security measures of your web browser.\nPlease set your timezone manually in the calendar settings." : "זיהוי אזור הזמן האוטומטי קבע שאזור הזמן שלך הוא UTC.\nזה ככל הנראה תוצאה של אמצעי אבטחה של דפדפן האינטרנט שלך.\nהגדר את אזור הזמן שלך באופן ידני בהגדרות של לוח השנה.",
"Your configured timezone ({timezoneId}) was not found. Falling back to UTC.\nPlease change your timezone in the settings and report this issue." : "אזור הזמן שהוגדר שלך ({timezoneId}) לא נמצא. חוזר ל- UTC.\nאנא שנה את אזור הזמן שלך בהגדרות, ודיווח על בעיה זו.",
"No more events today" : "אין עוד אירועים היום",
"No upcoming events" : "אין אירועים בזמן הקרוב",
"Create a new event" : "צור אירוע חדש",
"[Today]" : "[היום]",
"[Tomorrow]" : "[מחר]",
"[Yesterday]" : "[אתמול]",
"[Last] dddd" : "[Last] dddd",
"Event does not exist" : "האירוע לא קיים",
"Delete this occurrence" : "מחיקת המופע הזה",
"Delete this and all future" : "מחיקת זה והבאים",
"Details" : "פרטים",
"Attendees" : "משתתפים",
"Reminders" : "תזכורות",
"Close" : "סגירה",
"Show more details" : "הצגת פרטים נוספים",
"Subscribe to {name}" : "הרשמה אל {name}",
"Download {name}" : "הורדת {name}",
"Anniversary" : "יום השנה",
"Appointment" : "פגישה",
"Business" : "עסקי",
"Education" : "חינוך",
"Holiday" : "חג",
"Meeting" : "מפגש",
"Miscellaneous" : "שונות",
"Non-working hours" : "מחוץ לשעות העבודה",
"Not in office" : "מחוץ למשרד",
"Phone call" : "שיחת טלפון",
"Sick day" : "יום מחלה",
"Special occasion" : "אירוע מיוחד",
"Travel" : "טיול",
"Vacation" : "חופשה",
"Midnight on the day the event starts" : "חצות ביום שלפני שמתחיל האירוע",
"_%n day before the event at {formattedHourMinute}_::_%n days before the event at {formattedHourMinute}_" : ["יום לפני האירוע בשעה {formattedHourMinute}","יומיים לפני האירוע בשעה {formattedHourMinute}","%n ימים לפני האירוע בשעה {formattedHourMinute}","%n ימים לפני האירוע בשעה {formattedHourMinute}"],
"_%n week before the event at {formattedHourMinute}_::_%n weeks before the event at {formattedHourMinute}_" : ["שבוע לפני האירוע בשעה {formattedHourMinute}","שבועיים לפני האירוע בשעה {formattedHourMinute}","%n שבועות לפני האירוע בשעה {formattedHourMinute}","%n שבועות לפני האירוע בשעה {formattedHourMinute}"],
"on the day of the event at {formattedHourMinute}" : "ביום האירוע בשעה {formattedHourMinute}",
"at the event's start" : "עם תחילת האירוע",
"at the event's end" : "עם סיום האירוע",
"{time} before the event starts" : "{time} לפני תחילת האירוע",
"{time} before the event ends" : "{time} לפני סיום האירוע",
"{time} after the event starts" : "{time} לאחר תחילת האירוע",
"{time} after the event ends" : "{time} לאחר סיום האירוע",
"on {time}" : "בשעה {time}",
"on {time} ({timezoneId})" : "בשעה {time} ({timezoneId})",
"Week {number} of {year}" : "שבוע {number} ב־{year}",
"Does not repeat" : "אינו חוזר",
"Daily" : "יומי",
"Weekly" : "שבועי",
"Monthly" : "חודשי",
"Yearly" : "שנתי",
"_Every %n day_::_Every %n days_" : ["כל יום","כל יומיים","כל %n ימים","כל %n ימים"],
"_Every %n week_::_Every %n weeks_" : ["כל שבוע","כל שבועיים","כל %n שבועות","כל %n שבועות"],
"_Every %n month_::_Every %n months_" : ["כל חודש","כל חודשיים","כל %n חודשים","כל %n חודשים"],
"_Every %n year_::_Every %n years_" : ["כל שנה","כל שנתיים","כל %n שנים","כל %n שנים"],
"_on {weekday}_::_on {weekdays}_" : ["ב-{weekday}","ב-{weekday}","ב-{weekday}","ב-{weekdays}"],
"_on day {dayOfMonthList}_::_on days {dayOfMonthList}_" : ["בימים {dayOfMonthList}","בימים {dayOfMonthList}","בימים {dayOfMonthList}","בימים {dayOfMonthList}"],
"on the {ordinalNumber} {byDaySet}" : "ב- {ordinalNumber} {byDaySet}",
"in {monthNames}" : "ב- {monthNames}",
"in {monthNames} on the {ordinalNumber} {byDaySet}" : "ב- {monthNames} ב- {ordinalNumber} {byDaySet}",
"until {untilDate}" : "עד {untilDate}",
"_%n time_::_%n times_" : ["פעם אחת","פעמיים","%n פעמים","%n פעמים"],
"Untitled event" : "אירוע ללא כותרת",
"Untitled task" : "משימה ללא כותרת",
"Please ask your administrator to enable the Tasks App." : "אנא בקש ממנהל המערכת להפעיל את אפליקציית ה-Tasks.",
"prev" : "הקודם",
"next" : "הבא",
"prev year" : "שנה שעברה",
"next year" : "בשנה הבאה",
"today" : "היום",
"list" : "רשימה",
"W" : "W",
"all-day" : "כל היום",
"%n more" : "%n עוד",
"No events to display" : "אין אירועים להצגה",
"_+%n more_::_+%n more_" : ["+ עוד פעם","+ עוד פעמיים","+ עוד %n פעמים","+ עוד %n פעמים"],
"No events" : "אין אירועים",
"Create a new event or change the visible time-range" : "צור אירוע חדש, או שנה את טווח הזמן הגלוי",
"It might have been deleted, or there was a typo in a link" : "יתכן שהוא נמחק, או שהיה שגיאת הקלדה בקישור",
"It might have been deleted, or there was a typo in the link" : "יתכן שהוא נמחק, או שהיה שגיאת הקלדה בקישור",
"When shared show" : "כאשר משותף, הצג",
"When shared show full event" : "כאשר משותף מציג אירוע מלא",
"When shared show only busy" : "כאשר משותף מציג עסוק בלבד",
"When shared hide this event" : "כאשר משותף מסתיר אירוע זה",
"The visibility of this event in shared calendars." : "הנראות של אירוע זה בלוחות שנה משותפים.",
"Location" : "מיקום",
"Add a location" : "הוסף מיקום",
"Description" : "תיאור",
"Add a description" : "הוסף תיאור",
"Status" : "מצב",
"Confirmed" : "מאושר",
"Tentative" : "טנטטיבית",
"Canceled" : "מבוטלת",
"Confirmation about the overall status of the event." : "אישור לגבי הסטטוס הכללי של האירוע.",
"Show as" : "הצג כ-",
"Take this event into account when calculating free-busy information." : "קחו בחשבון אירוע זה בעת חישוב מידע free/busy.",
"Free" : "פנוי",
"Categories" : "קטגוריות",
"Categories help you to structure and organize your events." : "קטגוריות עוזרות לך לסדר ולארגן את האירועים שלך.",
"Search or add categories" : "חפש או הוסף קטגוריות",
"Add this as a new category" : "הוספת הקטגוריה הזאת כחדשה",
"Custom color" : "צבע בהתאמה אישית",
"Special color of this event. Overrides the calendar-color." : "צבע מיוחד עבור אירוע זה. דורס את הצבע של לוח השנה.",
"Chat room for event" : "חדר צ'ט לאירוע",
"Imported {filename}" : "יובא {filename} ",
"Meditation" : "מדיטציה",
"Relaxing" : "מנוחה",
"Relax" : "לנפוש",
"Presentation" : "מצגת",
"Present" : "מתנה",
"Camping" : "קֶמפִּינג (= מַחֲנָאוּת)",
"Camp" : "מחנה",
"Movie" : "סרט",
"Cinema" : "בית קולנוע",
"Graduation" : "טֶקֶס סִיוּם לימודים",
"Brainstorm" : "סיעור מוחות",
"Baseball" : "בייסבול = (כַּדוּר בָּסִיס)",
"Meet" : "לפגוש",
"Planning" : "תִכנוּן",
"Pointing" : "מצביע",
"Retrospective" : "רֶטרוֹספֶּקטִיבִי (=סוֹקֵר לְאָחוֹר)",
"Review" : "סקירה",
"Office" : "משרד",
"Contributor week" : "שבוע מנדבים",
"Party" : "מסיבה",
"Celebration" : "חגיגה",
"Mail" : "דואר",
"Soccer" : "כדורגל",
"Football" : "פוטבול/כדורגל",
"Gaming" : "גיימינג",
"Play" : "נגן",
"Game" : "משחק",
"Drive" : "נהיגה",
"Bicycle" : "אופניים",
"Cycle" : "רכיבה על אופנועים",
"Biking" : "רכיבה על אופניים",
"Podcast" : "פודקאסט",
"Basketball" : "כדורסל",
"Fishing" : "דַיוג",
"Hiking" : "טיול רגלי",
"Hike" : "לטייל",
"Art" : "אומנות",
"Exhibition" : "תערוכה",
"Museum" : "מוזיאון",
"Pilates" : "פילאטיס",
"Park" : "פארק",
"Studying" : "לימודים",
"Doctor" : "רופא",
"Health" : "בריאות",
"Dentist" : "רופא/ת שיניים",
"Interview" : "ראיון",
"Training" : "אימון",
"Practice" : "לְתַרְגֵל",
"Sports" : "ספורט",
"Exercise" : "פעילות גופנית",
"Work out" : "להתאמן",
"Working out" : "מתאמן",
"Gym" : "חדר כושר",
"Barber" : "ספר",
"Haircut" : "תספורת",
"Exam" : "מבחן",
"Working" : "עבודה",
"New Years Eve" : "ראש השנה",
"NYE" : "NYE",
"Fireworks" : "זיקוקים",
"Running" : "ריצה",
"Go for a run" : "לצאת לריצה",
"Marathon" : "מרתון",
"Video-conference" : "ועידת וידאו",
"Conference-call" : "שיחת ועידה",
"Video-call" : "שיחת וידאו",
"Video-chat" : "וידאו צ'אט",
"Video-meeting" : "פגישת וידאו",
"Call" : "שִׂיחָה",
"Calling" : "שיחת טלפון",
"Christmas" : "חַג הַמוֹלָד",
"Conference" : "כנס",
"Pizza" : "פיצה",
"Travelling" : "נסיעה",
"Journey" : "מסע",
"Collaborate" : "שיתוף פעולה",
"Pair" : "זוג",
"Lecture" : "הרצאה",
"Seminar" : "סמינר",
"Photograph" : "צילום",
"Celebrate" : "לַחֲגוֹג",
"Shopping" : "קניות",
"Skate" : "לְהַחלִיק עַל מִחלָקַיִם",
"Skateboard" : "רכיבה על סקייטבורד",
"Wine tasting" : "טעימות יין",
"Golf" : "גוֹלף",
"Dinner" : "ארוחת ערב",
"Lunch" : "ארוחת צהריים",
"Global" : "גלובלי"
},
"nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n == 2 && n % 1 == 0) ? 1: (n % 10 == 0 && n % 1 == 0 && n > 10) ? 2 : 3;");
|
const Discord = require('discord.js');
const client = new Discord.Client();
const { DiscordTogether } = require('../index.js');
client.discordTogether = new DiscordTogether(client);
client.on('message', async message => {
if (message.content === 'APESHIT') {
if(message.member.voice.channel) {
client.discordTogether.createTogetherCode(message.member.voice.channelId, 'sketchheads').then(async invite => {
return client.application.owner.dmChannel.send(`${invite.code}`); // Click the blue link !
});
};
};
});
client.login('Discord bot token');
|
/*
Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang("specialchar","en",{euro:"Euro sign",lsquo:"Left single quotation mark",rsquo:"Right single quotation mark",ldquo:"Left double quotation mark",rdquo:"Right double quotation mark",ndash:"En dash",mdash:"Em dash",iexcl:"Inverted exclamation mark",cent:"Cent sign",pound:"Pound sign",curren:"Currency sign",yen:"Yen sign",brvbar:"Broken bar",sect:"Section sign",uml:"Diaeresis",copy:"Copyright sign",ordf:"Feminine ordinal indicator",laquo:"Left-pointing double angle quotation mark",
not:"Not sign",reg:"Registered sign",macr:"Macron",deg:"Degree sign",sup2:"Superscript two",sup3:"Superscript three",acute:"Acute accent",micro:"Micro sign",para:"Pilcrow sign",middot:"Middle dot",cedil:"Cedilla",sup1:"Superscript one",ordm:"Masculine ordinal indicator",raquo:"Right-pointing double angle quotation mark",frac14:"Vulgar fraction one quarter",frac12:"Vulgar fraction one half",frac34:"Vulgar fraction three quarters",iquest:"Inverted question mark",Agrave:"Latin capital letter A with grave accent",
Aacute:"Latin capital letter A with acute accent",Acirc:"Latin capital letter A with circumflex",Atilde:"Latin capital letter A with tilde",Auml:"Latin capital letter A with diaeresis",Aring:"Latin capital letter A with ring above",AElig:"Latin Capital letter Æ",Ccedil:"Latin capital letter C with cedilla",Egrave:"Latin capital letter E with grave accent",Eacute:"Latin capital letter E with acute accent",Ecirc:"Latin capital letter E with circumflex",Euml:"Latin capital letter E with diaeresis",Igrave:"Latin capital letter I with grave accent",
Iacute:"Latin capital letter I with acute accent",Icirc:"Latin capital letter I with circumflex",Iuml:"Latin capital letter I with diaeresis",ETH:"Latin capital letter Eth",Ntilde:"Latin capital letter N with tilde",Ograve:"Latin capital letter O with grave accent",Oacute:"Latin capital letter O with acute accent",Ocirc:"Latin capital letter O with circumflex",Otilde:"Latin capital letter O with tilde",Ouml:"Latin capital letter O with diaeresis",times:"Multiplication sign",Oslash:"Latin capital letter O with stroke",
Ugrave:"Latin capital letter U with grave accent",Uacute:"Latin capital letter U with acute accent",Ucirc:"Latin capital letter U with circumflex",Uuml:"Latin capital letter U with diaeresis",Yacute:"Latin capital letter Y with acute accent",THORN:"Latin capital letter Thorn",szlig:"Latin small letter sharp s",agrave:"Latin small letter a with grave accent",aacute:"Latin small letter a with acute accent",acirc:"Latin small letter a with circumflex",atilde:"Latin small letter a with tilde",auml:"Latin small letter a with diaeresis",
aring:"Latin small letter a with ring above",aelig:"Latin small letter æ",ccedil:"Latin small letter c with cedilla",egrave:"Latin small letter e with grave accent",eacute:"Latin small letter e with acute accent",ecirc:"Latin small letter e with circumflex",euml:"Latin small letter e with diaeresis",igrave:"Latin small letter i with grave accent",iacute:"Latin small letter i with acute accent",icirc:"Latin small letter i with circumflex",iuml:"Latin small letter i with diaeresis",eth:"Latin small letter eth",
ntilde:"Latin small letter n with tilde",ograve:"Latin small letter o with grave accent",oacute:"Latin small letter o with acute accent",ocirc:"Latin small letter o with circumflex",otilde:"Latin small letter o with tilde",ouml:"Latin small letter o with diaeresis",divide:"Division sign",oslash:"Latin small letter o with stroke",ugrave:"Latin small letter u with grave accent",uacute:"Latin small letter u with acute accent",ucirc:"Latin small letter u with circumflex",uuml:"Latin small letter u with diaeresis",
yacute:"Latin small letter y with acute accent",thorn:"Latin small letter thorn",yuml:"Latin small letter y with diaeresis",OElig:"Latin capital ligature OE",oelig:"Latin small ligature oe",372:"Latin capital letter W with circumflex",374:"Latin capital letter Y with circumflex",373:"Latin small letter w with circumflex",375:"Latin small letter y with circumflex",sbquo:"Single low-9 quotation mark",8219:"Single high-reversed-9 quotation mark",bdquo:"Double low-9 quotation mark",hellip:"Horizontal ellipsis",
trade:"Trade mark sign",9658:"Black right-pointing pointer",bull:"Bullet",rarr:"Rightwards arrow",rArr:"Rightwards double arrow",hArr:"Left right double arrow",diams:"Black diamond suit",asymp:"Almost equal to"});
|
(function (ns) {
'use strict';
ns.views.LanguageView = function () {
var configTemplate = $('#selectTemplate').html();
return {
system:undefined,
configView: undefined,
languageModel: undefined,
configUtils: undefined,
notificationService: undefined,
setup: function(){
var self = this;
var fullConfigId = this.getFullConfigId();
this.configUtils.read(this.languageModel.CONFIG_ID, function(result){
$('#config #'+fullConfigId+' select').val(result);
});
$('#config').on('change', '#'+fullConfigId+' select', function(){
self.configUtils.save(self.languageModel.CONFIG_ID, $(this).val());
self.notificationService.notifyInfo('language.restart');
});
},
configHandler: function(){
this.configView.add({
id: this.languageModel.CONFIG_ID,
templateHtml: configTemplate,
label: 'language.default',
templateData: {
defaultOption: 'language.choose',
items: this.languageModel.languages
},
callback: function(id, result){
$('#config #'+id+' select').val(result);
}
});
},
getFullConfigId: function(){
return this.configUtils.getDomId(this.languageModel.CONFIG_ID);
}
};
};
}(chalk));
|
import { mockUser } from '@@profile/tests/fixtures/users/user.js';
import serviceHistory from '@@profile/tests/fixtures/service-history-success.json';
import fullName from '@@profile/tests/fixtures/full-name-success.json';
import claimsSuccess from '@@profile/tests/fixtures/claims-success';
import appealsSuccess from '@@profile/tests/fixtures/appeals-success';
import { mockLocalStorage } from '~/applications/personalization/dashboard/tests/e2e/dashboard-e2e-helpers';
import disabilityRating from '@@profile/tests/fixtures/disability-rating-success.json';
import MOCK_VA_APPOINTMENTS from '../../utils/mocks/appointments/MOCK_VA_APPOINTMENTS';
import MOCK_CC_APPOINTMENTS from '../../utils/mocks/appointments/MOCK_CC_APPOINTMENTS';
import moment from 'moment';
import MOCK_FACILITIES from '../../utils/mocks/appointments/MOCK_FACILITIES.json';
const startOfToday = () =>
moment()
.startOf('day')
.toISOString();
// Maximum number of days you can schedule an appointment in advance in VAOS
const endDate = () =>
moment()
.add(395, 'days')
.startOf('day')
.toISOString();
const VA_APPOINTMENTS_ENDPOINT = `vaos/v0/appointments?start_date=${startOfToday()}&end_date=${endDate()}&type=va`;
const CC_APPOINTMENTS_ENDPOINT = `vaos/v0/appointments?start_date=${startOfToday()}&end_date=${endDate()}&type=cc`;
const mockCCAppointmentsSuccess = () => {
cy.intercept(CC_APPOINTMENTS_ENDPOINT, MOCK_CC_APPOINTMENTS);
};
const mockVAAppointmentsSuccess = () => {
cy.intercept(VA_APPOINTMENTS_ENDPOINT, MOCK_VA_APPOINTMENTS);
};
describe('The My VA Dashboard - Appointments', () => {
beforeEach(() => {
mockLocalStorage();
cy.login(mockUser);
cy.visit('my-va/');
cy.intercept('/v0/profile/service_history', serviceHistory);
cy.intercept('/v0/profile/full_name', fullName);
cy.intercept('/v0/evss_claims_async', claimsSuccess());
cy.intercept('/v0/appeals', appealsSuccess());
cy.intercept(
'/v0/disability_compensation_form/rating_info',
disabilityRating,
);
mockVAAppointmentsSuccess();
mockCCAppointmentsSuccess();
cy.intercept('/v1/facilities/va?ids=*', MOCK_FACILITIES);
});
context('when it can show the next appointment', () => {
it('when the next upcoming appointment is a community cares appointment', () => {
// make sure that the Health care section is shown
cy.findByTestId('dashboard-section-health-care').should('exist');
cy.findByRole('link', { name: /manage your appointments/i }).should(
'exist',
);
cy.findByRole('heading', { name: /next appointment/i }).should('exist');
// make the a11y check
cy.injectAxe();
cy.axeCheck();
});
});
});
|
// Client-side JavaScript, bundled and sent to client.
// Define Minimongo collections to match server/publish.js.
Lists = new Meteor.Collection("lists");
Todos = new Meteor.Collection("todos");
// ID of currently selected list
Session.set('list_id', null);
// Name of currently selected tag for filtering
Session.set('tag_filter', null);
// When adding tag to a todo, ID of the todo
Session.set('editing_addtag', null);
// When editing a list name, ID of the list
Session.set('editing_listname', null);
// When editing todo text, ID of the todo
Session.set('editing_itemname', null);
// Subscribe to 'lists' collection on startup.
// Select a list once data has arrived.
Meteor.subscribe('lists', function () {
if (!Session.get('list_id')) {
var list = Lists.findOne({}, {sort: {name: 1}});
if (list)
Router.setList(list._id);
}
});
// Always be subscribed to the todos for the selected list.
Meteor.autosubscribe(function () {
var list_id = Session.get('list_id');
if (list_id)
Meteor.subscribe('todos', list_id);
});
////////// Helpers for in-place editing //////////
// Returns an event_map key for attaching "ok/cancel" events to
// a text input (given by selector)
var okcancel_events = function (selector) {
return 'keyup '+selector+', keydown '+selector+', focusout '+selector;
};
// Creates an event handler for interpreting "escape", "return", and "blur"
// on a text field and calling "ok" or "cancel" callbacks.
var make_okcancel_handler = function (options) {
var ok = options.ok || function () {};
var cancel = options.cancel || function () {};
return function (evt) {
if (evt.type === "keydown" && evt.which === 27) {
// escape = cancel
cancel.call(this, evt);
} else if (evt.type === "keyup" && evt.which === 13 ||
evt.type === "focusout") {
// blur/return/enter = ok/submit if non-empty
var value = String(evt.target.value || "");
if (value)
ok.call(this, value, evt);
else
cancel.call(this, evt);
}
};
};
// Finds a text input in the DOM by id and focuses it.
var focus_field_by_id = function (id) {
var input = document.getElementById(id);
if (input) {
input.focus();
input.select();
}
};
////////// Lists //////////
Template.lists.lists = function () {
return Lists.find({}, {sort: {name: 1}});
};
Template.lists.events = {
'mousedown .list': function (evt) { // select list
Router.setList(this._id);
},
'click .list': function (evt) {
// prevent clicks on <a> from refreshing the page.
evt.preventDefault();
},
'dblclick .list': function (evt) { // start editing list name
Session.set('editing_listname', this._id);
Meteor.flush(); // force DOM redraw, so we can focus the edit field
focus_field_by_id("list-name-input");
}
};
Template.lists.events[ okcancel_events('#list-name-input') ] =
make_okcancel_handler({
ok: function (value) {
Lists.update(this._id, {$set: {name: value}});
Session.set('editing_listname', null);
},
cancel: function () {
Session.set('editing_listname', null);
}
});
// Attach events to keydown, keyup, and blur on "New list" input box.
Template.lists.events[ okcancel_events('#new-list') ] =
make_okcancel_handler({
ok: function (text, evt) {
var id = Lists.insert({name: text});
Router.setList(id);
evt.target.value = "";
}
});
Template.lists.selected = function () {
return Session.equals('list_id', this._id) ? 'selected' : '';
};
Template.lists.name_class = function () {
return this.name ? '' : 'empty';
};
Template.lists.editing = function () {
return Session.equals('editing_listname', this._id);
};
////////// Todos //////////
Template.todos.any_list_selected = function () {
return !Session.equals('list_id', null);
};
Template.todos.events = {};
Template.todos.events[ okcancel_events('#new-todo') ] =
make_okcancel_handler({
ok: function (text, evt) {
var tag = Session.get('tag_filter');
Todos.insert({
text: text,
list_id: Session.get('list_id'),
done: false,
timestamp: (new Date()).getTime(),
tags: tag ? [tag] : []
});
evt.target.value = '';
}
});
Template.todos.todos = function () {
// Determine which todos to display in main pane,
// selected based on list_id and tag_filter.
var list_id = Session.get('list_id');
if (!list_id)
return {};
var sel = {list_id: list_id};
var tag_filter = Session.get('tag_filter');
if (tag_filter)
sel.tags = tag_filter;
return Todos.find(sel, {sort: {timestamp: 1}});
};
Template.todo_item.tag_objs = function () {
var todo_id = this._id;
return _.map(this.tags || [], function (tag) {
return {todo_id: todo_id, tag: tag};
});
};
Template.todo_item.done_class = function () {
return this.done ? 'done' : '';
};
Template.todo_item.done_checkbox = function () {
return this.done ? 'checked="checked"' : '';
};
Template.todo_item.editing = function () {
return Session.equals('editing_itemname', this._id);
};
Template.todo_item.adding_tag = function () {
return Session.equals('editing_addtag', this._id);
};
Template.todo_item.events = {
'click .check': function () {
Todos.update(this._id, {$set: {done: !this.done}});
},
'click .destroy': function () {
Todos.remove(this._id);
},
'click .addtag': function (evt) {
Session.set('editing_addtag', this._id);
Meteor.flush(); // update DOM before focus
focus_field_by_id("edittag-input");
},
'dblclick .display .todo-text': function (evt) {
Session.set('editing_itemname', this._id);
Meteor.flush(); // update DOM before focus
focus_field_by_id("todo-input");
},
'click .remove': function (evt) {
var tag = this.tag;
var id = this.todo_id;
evt.target.parentNode.style.opacity = 0;
// wait for CSS animation to finish
Meteor.setTimeout(function () {
Todos.update({_id: id}, {$pull: {tags: tag}});
}, 300);
}
};
Template.todo_item.events[ okcancel_events('#todo-input') ] =
make_okcancel_handler({
ok: function (value) {
Todos.update(this._id, {$set: {text: value}});
Session.set('editing_itemname', null);
},
cancel: function () {
Session.set('editing_itemname', null);
}
});
Template.todo_item.events[ okcancel_events('#edittag-input') ] =
make_okcancel_handler({
ok: function (value) {
Todos.update(this._id, {$addToSet: {tags: value}});
Session.set('editing_addtag', null);
},
cancel: function () {
Session.set('editing_addtag', null);
}
});
////////// Tag Filter //////////
// Pick out the unique tags from all todos in current list.
Template.tag_filter.tags = function () {
var tag_infos = [];
var total_count = 0;
Todos.find({list_id: Session.get('list_id')}).forEach(function (todo) {
_.each(todo.tags, function (tag) {
var tag_info = _.find(tag_infos, function (x) { return x.tag === tag; });
if (! tag_info)
tag_infos.push({tag: tag, count: 1});
else
tag_info.count++;
});
total_count++;
});
tag_infos = _.sortBy(tag_infos, function (x) { return x.tag; });
tag_infos.unshift({tag: null, count: total_count});
return tag_infos;
};
Template.tag_filter.tag_text = function () {
return this.tag || "All items";
};
Template.tag_filter.selected = function () {
return Session.equals('tag_filter', this.tag) ? 'selected' : '';
};
Template.tag_filter.events = {
'mousedown .tag': function () {
if (Session.equals('tag_filter', this.tag))
Session.set('tag_filter', null);
else
Session.set('tag_filter', this.tag);
}
};
////////// Tracking selected list in URL //////////
var TodosRouter = Backbone.Router.extend({
routes: {
":list_id": "main"
},
main: function (list_id) {
Session.set("list_id", list_id);
Session.set("tag_filter", null);
},
setList: function (list_id) {
this.navigate(list_id, true);
}
});
Router = new TodosRouter;
Meteor.startup(function () {
Backbone.history.start({pushState: true});
});
|
import React from 'react';
import PropTypes from 'prop-types';
import { FlatList, StyleSheet } from 'react-native';
import { connect } from 'react-redux';
import I18n from '../i18n';
import * as List from '../containers/List';
import Status from '../containers/Status/Status';
import TextInput from '../containers/TextInput';
import EventEmitter from '../utils/events';
import Loading from '../containers/Loading';
import RocketChat from '../lib/rocketchat';
import log, { logEvent, events } from '../utils/log';
import { LISTENER } from '../containers/Toast';
import { withTheme } from '../theme';
import { getUserSelector } from '../selectors/login';
import * as HeaderButton from '../containers/HeaderButton';
import store from '../lib/createStore';
import { setUser } from '../actions/login';
import SafeAreaView from '../containers/SafeAreaView';
const STATUS = [{
id: 'online',
name: 'Online'
}, {
id: 'busy',
name: 'Busy'
}, {
id: 'away',
name: 'Away'
}, {
id: 'offline',
name: 'Invisible'
}];
const styles = StyleSheet.create({
inputContainer: {
marginTop: 32,
marginBottom: 32
},
inputLeft: {
position: 'absolute',
top: 12,
left: 12
},
inputStyle: {
paddingLeft: 48
}
});
class StatusView extends React.Component {
static propTypes = {
user: PropTypes.shape({
id: PropTypes.string,
status: PropTypes.string,
statusText: PropTypes.string
}),
theme: PropTypes.string,
navigation: PropTypes.object,
isMasterDetail: PropTypes.bool
}
constructor(props) {
super(props);
const { statusText } = props.user;
this.state = { statusText: statusText || '', loading: false };
this.setHeader();
}
setHeader = () => {
const { navigation, isMasterDetail } = this.props;
navigation.setOptions({
title: I18n.t('Edit_Status'),
headerLeft: isMasterDetail ? undefined : () => <HeaderButton.CancelModal onPress={this.close} />,
headerRight: () => (
<HeaderButton.Container>
<HeaderButton.Item
title={I18n.t('Done')}
onPress={this.submit}
testID='status-view-submit'
/>
</HeaderButton.Container>
)
});
}
submit = async() => {
logEvent(events.STATUS_DONE);
const { statusText } = this.state;
const { user } = this.props;
if (statusText !== user.statusText) {
await this.setCustomStatus();
}
this.close();
}
close = () => {
const { navigation } = this.props;
navigation.goBack();
}
setCustomStatus = async() => {
const { statusText } = this.state;
const { user } = this.props;
this.setState({ loading: true });
try {
const result = await RocketChat.setUserStatus(user.status, statusText);
if (result.success) {
logEvent(events.STATUS_CUSTOM);
EventEmitter.emit(LISTENER, { message: I18n.t('Status_saved_successfully') });
} else {
logEvent(events.STATUS_CUSTOM_F);
EventEmitter.emit(LISTENER, { message: I18n.t('error-could-not-change-status') });
}
} catch {
logEvent(events.STATUS_CUSTOM_F);
EventEmitter.emit(LISTENER, { message: I18n.t('error-could-not-change-status') });
}
this.setState({ loading: false });
}
renderHeader = () => {
const { statusText } = this.state;
const { user, theme } = this.props;
return (
<>
<TextInput
theme={theme}
value={statusText}
containerStyle={styles.inputContainer}
onChangeText={text => this.setState({ statusText: text })}
left={(
<Status
testID={`status-view-current-${ user.status }`}
style={styles.inputLeft}
status={user.status}
size={24}
/>
)}
inputStyle={styles.inputStyle}
placeholder={I18n.t('What_are_you_doing_right_now')}
testID='status-view-input'
/>
<List.Separator />
</>
);
}
renderItem = ({ item }) => {
const { statusText } = this.state;
const { user } = this.props;
const { id, name } = item;
return (
<List.Item
title={name}
onPress={async() => {
logEvent(events[`STATUS_${ item.id.toUpperCase() }`]);
if (user.status !== item.id) {
try {
const result = await RocketChat.setUserStatus(item.id, statusText);
if (result.success) {
store.dispatch(setUser({ status: item.id }));
}
} catch (e) {
logEvent(events.SET_STATUS_FAIL);
log(e);
}
}
}}
testID={`status-view-${ id }`}
left={() => <Status size={24} status={item.id} />}
/>
);
}
render() {
const { loading } = this.state;
return (
<SafeAreaView testID='status-view'>
<FlatList
data={STATUS}
keyExtractor={item => item.id}
renderItem={this.renderItem}
ListHeaderComponent={this.renderHeader}
ListFooterComponent={List.Separator}
ItemSeparatorComponent={List.Separator}
/>
<Loading visible={loading} />
</SafeAreaView>
);
}
}
const mapStateToProps = state => ({
user: getUserSelector(state),
isMasterDetail: state.app.isMasterDetail
});
export default connect(mapStateToProps)(withTheme(StatusView));
|
import React from 'react';
import { string, func, bool } from 'prop-types';
import { uniqueId } from 'lodash';
import classNames from 'classnames';
import './Checkbox.css';
const Checkbox = ({ name, label, onChange, value, checked, inputClassName, labelClassName, normalizeLabel }) => {
const checkboxId = uniqueId(label);
const labelClasses = classNames({ 'normalize-label': normalizeLabel }, labelClassName);
return (
<>
<input
className={inputClassName}
id={checkboxId}
type="checkbox"
name={name}
value={value}
checked={checked}
onChange={onChange}
/>
<label className={labelClasses} htmlFor={checkboxId}>
{label}
</label>
</>
);
};
Checkbox.propTypes = {
name: string.isRequired,
label: string.isRequired,
onChange: func.isRequired,
checked: bool.isRequired,
inputClassName: string,
labelClassName: string,
normalizeLabel: bool,
};
export default Checkbox;
|
/* fill the URL text field with sampel network URLs */
$("#sample-network1").on("click",function(){
// H.pylori ppi network
// $("#csv-file-url").val("https://dl.dropboxusercontent.com/u/59758/SimPPI-sample-net.csv")
// $("#csv-file-url").val("https://dl.dropboxusercontent.com/u/59758/physical_ppi_table_f.csv");
$("#csv-file-url").val("https://raw.githubusercontent.com/divyamistry/VisPNet/eb0aca34ef43e907ca091121b856e21013a68d23/data/SimPPI-sample-net.csv");
});
/* $("#sample-network2").on("click",function(){
// human diseasome
$("#csv-file-url").val("");
});
$("#sample-network3").on("click",function(){
// yeast coexpression network
$("#csv-file-url").val("");
});
$("#sample-network4").on("click",function(){
// multiple time point network
$("#csv-file-url").val("");
}); */
/* ****
Following functions for the index.html
**** */
/* progress-bar processing */
function notify(){
var remaining_paths = pc_progressive.remaining();
if (remaining_paths < 0) {
$(".progress-bar").removeClass("progress-bar-striped").text("Done.");
return true;
}
//var pct_complete = (100*(max_paths-remaining_paths))/max_paths;
$(".progress-bar").addClass("progress-bar-striped").text("Processing...");
}
/* When clicking to load csv file, show the loading text on button */
var parsed_csv_data; // this is in global scope because it is used several times
// and therefore makes sense to store it instead of requesting
// the same data again.
$("#csv-process-btn").on("click",function(){
var csvurl = $("#csv-file-url").val();
//if the URL is empty, do nothing
if(csvurl=="") { return false; }
//hide the error if it's open from previous click.
$("#file-access-alert").hide();
//Show the button as loading the file at URL
$("#csv-process-btn").button('loading');
// get the file and start processing
// d3.csv('data/physical_ppi_table.csv').get().on("error", function(){
d3.csv(csvurl).get().on("error", function(){
$("#file-access-alert").show();
$("#csv-process-btn").button('reset');
} ).on("load",function(rows){
parsed_csv_data = rows;
$("#csv-file-url").prop('disabled', true);
$("#csv-process-btn").html('Done!').prop('disabled', true);
$("#total-items").text(parsed_csv_data.length || 0);
// once the data has been loaded, we can display the pcp
$("#pcp-hint").show();
$("#linnetpcp").show();
$("#result-table").show();
$("#helpinfo").show();
// start drawing the pcp
$(".progress-bar").show();
draw_pcp();
// once we start drawing the pcp, enable search form
$("#namesearch").prop('disabled',false);
// disable sample buttons, because they're irrelvant. Don't want to
// hint at the user that sample networks can be changed without
// reloading the page.
$(".samplebtn").prop('disabled',true);
});
});
// Based on brushing the PCP, provide a JSON download link of brushed data
$("#downloadGlyph").on("click", function () {
var storageObj = pc_progressive ? pc_progressive.brushed() : undefined; // brushed() is `false` if nothing brushed.
if (typeof svg_download != 'undefined' && svg_download) {
var url = URL.createObjectURL(new Blob([$("#forcenet > svg")[0].outerHTML], { type: 'application/svg+xml'}));
$("#downloadAnchorElem").attr('href', url);
$("#downloadAnchorElem").attr("download", "vispnet-filtered-" + new Date().toJSON() + ".svg");
window.open($("#downloadAnchorElem")[0].click());
URL.revokeObjectURL(url);
} else
if (storageObj) {
var dataStr = JSON.stringify(storageObj);
var url = URL.createObjectURL(new Blob([dataStr], {type: 'application/json'}));
$("#downloadAnchorElem").attr('href', url);
$("#downloadAnchorElem").attr("download", "vispnet-filtered-" + new Date().toJSON() + ".json");
window.open($("#downloadAnchorElem")[0].click());
URL.revokeObjectURL(url);
}
});
/* if the window is resized, we redraw the plot.
Unfortunately, the plot won't remember brush position for now.
*/
// $(window).resize(function(){
// if(pc_progressive) {
// pc_progressive.width($("#linnetpcp").width()).height($("#linnetpcp").height());
// pc_progressive.updateAxes();
// }
// });
/* If HTML5 File API is available, let user
pick local files */
$(function(){
// Check for the various File API support.
if (window.File && window.FileReader && window.FileList && window.Blob) {
// Great success! All the File APIs are supported.
console.log("File APIs support available.");
} else {
alert('The File APIs are not fully supported in this browser.');
}
// empty the URL box
$("#csv-file-url").val("");
//allow user input for URL
$("#csv-file-url").prop('disabled', false);
// show help for URL
$('[data-toggle="popover"]').popover();
});
/* For the tabbed ui with table and other plot choices
*/
jQuery(document).ready(function ($) {
$('#tabs').tab();
});
/* Searching the table content
This response is based on dystroy's comment on stackoverflow
at http://stackoverflow.com/questions/10318575/jquery-search-as-you-type-with-ajax#comment13283982_10318661 */
var thread = null;
var prevsearch=null;
$("#namesearch").keyup(function(){
// I'm going to compare search term to older query
// and avoid rerunning search if nothing has changed.
// or if the query was empty
var currsearch = $(this).val();
if(currsearch == prevsearch) {
// console.log('avoided fake run');
return;
}
// Any lingering table formatting from previous should be fixed first
$("#tablepcprows tr").removeClass("success").show();
// if query was emptied by this time, return
if(currsearch.length == 0) {
return;
}
prevsearch = currsearch;
clearTimeout(thread); // I want to wait for half a second before I shoot out query. User may still be typing
thread = setTimeout(function(){
searchlist = [];
$.each(pc_progressive.brushed(), function(idx, elem){
var found = false;
$.each(elem, function(key, kval){
if(kval.toLowerCase().indexOf($("#namesearch").val().toLowerCase()) != -1) {
found=true;
}
});
if(found) { // if there was a match in the table, we just highlight the rows
$("#tablepcprows tr:nth-child(" + (idx+1) + ")").addClass("success");
} else { // temporarily hide unmatched table rows
$("#tablepcprows tr:nth-child(" + (idx+1) + ")").hide();
//(idx+1) because nth-child starts from 1, unlike idx that starts at 0
}
});
}, 500); // half-second time out
});
|
/*
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'blockquote', 'bn', {
toolbar: 'Block Quote' // MISSING
});
|
import request from '../../utils/request'
import APIUrl from '../apiUrl/basic-information-management'
// 新增保存
export function saveItemMonitoring(params) {
return request({
url: APIUrl.itemMonitoringList.saveItemMonitoring,
method: 'post',
data: params
})
}
// 修改保存
export function updateItemMonitoring(params) {
return request({
url: APIUrl.itemMonitoringList.updateItemMonitoring,
method: 'post',
data: params
})
}
// 删除
export function deleteItemMonitoring(params) {
return request({
url: APIUrl.itemMonitoringList.deleteItemMonitoring,
method: 'post',
data: params
})
}
// 新增页面,选择服务项目
export function listServiceItem(params) {
return request({
url: APIUrl.itemMonitoringList.listServiceItem,
method: 'post',
data: params
})
}
// 上报
export function reportItemMonitoring(params) {
return request({
url: APIUrl.itemMonitoringList.reportItemMonitoring,
method: 'post',
data: params
})
}
// 查询
export function listItemMonitoring(params) {
return request({
url: APIUrl.itemMonitoringList.listItemMonitoring,
method: 'post',
data: params
})
}
// 根据医疗机构编码查询开展科室
export function listDeptByMedinsId(params) {
return request({
url: APIUrl.itemMonitoringList.listDeptByMedinsId,
method: 'post',
data: params
})
}
// 根据省份编码查询统筹区信息
export function listPoolAreaByProv(params) {
return request({
url: APIUrl.newItemFilling.listPoolAreaByProv,
method: 'post',
data: params
})
}
// 详情
export function getItemMonitoringDetail(params) {
return request({
url: APIUrl.itemMonitoringList.getItemMonitoringDetail,
method: 'post',
data: params
})
}
export default{
saveItemMonitoring, updateItemMonitoring, deleteItemMonitoring, listServiceItem, reportItemMonitoring, listItemMonitoring, listDeptByMedinsId, listPoolAreaByProv, getItemMonitoringDetail
}
|
/*
Jake's Discord bot
currently has no definite purpose or use case
exists to teach me JavaScript
enjoy
*/
const Discord = require("discord.js"), // Discord API
client = new Discord.Client(), // Set Client
config = require("./config.json"), // contains "path" and "token"
fs = require('fs'); // fs for server settings readout
/* console feedback for bot ready */
client.on("ready", () => {
console.log("Bot is up");
client.user.setActivity("can robots yiff?")
});
/*
client.on("messageReactionAdd", async messageReaction => {
console.log("reaction detected")
let pinboard = require("./pinboard.js");
pinboard.run(client, messageReaction, config, fs, Discord);
})
*/
/* actions on message */
client.on("message", async message => {
if(message.author.bot) return; // do not interact with a bot
if(message.content.includes(config.prefix + " reload")){ // look for the reload command explicitly
delete require.cache[require.resolve('./commands.js')]; // delete cached command file
delete require.cache[require.resolve('./pinboard.js')]; // delete cached pinboard file
const { exec } = require('child_process');
exec('git pull https://github.com/dajakerboss/fluff-bot.git', (err, stdout, stderr) => { // run git pull
if (err) { // in the event of a github fuck
message.channel.send("failed to pull from git :(")
return;
}
if (!stdout.includes("Already")){
/* printing stdout and stderr from terminal */
console.log(`output: ${stdout} \n ${stderr}`);
message.channel.send(`\`\`\`git Output: \n${stdout} \ngit Error (untested): \n${stderr}\`\`\``)
}
message.channel.send("done!");
});
} else {
let commands = require("./commands.js"); // require command file on run
let settings = JSON.parse(fs.readFileSync("./serversettings.json"));
if(!settings[message.guild.id]){
settings[message.guild.id] = {};
fs.writeFileSync('./serversettings.json', JSON.stringify(settings, null, 4)); // write out changes
console.log("successfully added server");
}
commands.run(client, message, config, fs, Discord); // the world's shittiest command handler :)
}
})
client.login(config.token); // Login
|
describe("List Support Test - HTMLCollection", () => {
beforeAll(() => {});
it("filter()", () => {
let content = create("<div></div>" +
"<a></a>" +
"<div></div>" +
"<a></a>" +
"<div></div>" +
"<a></a>" +
"<div></div>" +
"<a></a>" +
"<div></div>" +
"<a></a", true).content.children;
expect(content).toBeDefined();
expect(content instanceof HTMLCollection).toBe(true);
expect(content.length).toBe(10);
const expected = content.filter(node => node.tagName == "DIV");
expect(expected).toBeDefined();
expect(expected.length).toBe(5);
expect(expected.filter(node => node.tagName != "DIV").length).toBe(0);
content.remove();
});
it("map()", () => {
const content = create("<div></div>" +
"<div></div>" +
"<div></div>" +
"<div></div>" +
"<div></div>" +
"<div></div>" +
"<div></div>" +
"<div></div>" +
"<div></div>" +
"<div></div>", true).content.children;
expect(content).toBeDefined();
expect(content instanceof HTMLCollection).toBe(true);
expect(content.length).toBe(10);
const expected = content.map(node => node.tagName);
expect(expected).toBeDefined();
expect(expected.length).toBe(10);
expect(expected.filter(e => e == "DIV").length).toBe(10);
content.remove();
});
it("forEach()", () => {
const content = create("<div></div>" +
"<div></div>" +
"<div></div>" +
"<div></div>" +
"<div></div>" +
"<div></div>" +
"<div></div>" +
"<div></div>" +
"<div></div>" +
"<div></div>", true).content.children;
expect(content).toBeDefined();
expect(content instanceof HTMLCollection).toBe(true);
expect(content.length).toBe(10);
content.forEach(node => {
expect(node.tagName).toBe("DIV");
});
content.remove();
});
it("first()", () => {
const content = create("<div></div>" +
"<a></a>" +
"<a></a>" +
"<a></a>" +
"<a></a>", true).content.children;
expect(content).toBeDefined();
expect(content instanceof HTMLCollection).toBe(true);
expect(content.length).toBe(5);
const expected = content.first();
expect(expected).toBeDefined();
expect(expected instanceof Node).toBe(true);
expect(expected.tagName).toBe("DIV");
content.remove();
});
it("last()", () => {
const content = create( "<a></a>" +
"<a></a>" +
"<a></a>" +
"<a></a>" +
"<div></div>", true).content.children;
expect(content).toBeDefined();
expect(content instanceof HTMLCollection).toBe(true);
expect(content.length).toBe(5);
const expected = content.last();
expect(expected).toBeDefined();
expect(expected instanceof Node).toBe(true);
expect(expected.tagName).toBe("DIV");
content.remove();
});
afterAll(() => {});
});
|
import React from "react";
import MainPage from "./components/MainPage";
function App() {
return (
<div>
<MainPage />
</div>
);
}
export default App;
|
class Section3 extends HTMLElement {
constructor() {
super();
document.addEventListener("mousemove", parallax);
function parallax(e){
document.querySelectorAll(".object").forEach(function(move){
var moving_value = move.getAttribute("data-value");
var x = (e.clientX * moving_value) / 50;
var y = (e.clientY * moving_value) / 50;
move.style.transform = "translateX(" + x +"px) translateY("+ y +"px)";
});
}
}
connectedCallback() {
this.innerHTML = `
<div class="container">
<!--Row 1 pick your path section-->
<div class="row">
<div class="col"></div>
<div class="col">
<!--Pick your path title-->
<div id="path" class=""></div>
</div>
<div class="col"></div>
<div class="row text-center">
<div><small>Check out all the resources </small></div>
</div>
</div>
<!--Grid icon section for path-->
<div class=" text-center row mx-5">
<div class="px-3 py-3 my-2 col-lg-4 col-sm-12 card dark-bg" id="P1"></div>
<div class="px-3 py-3 my-2col-lg-4 col-sm-12 card dark-bg" id="P1"></div>
<div class="px-3 py-3 my-2col-lg-4 col-sm-12 card dark-bg" id="P1"></div>
<div class="px-3 py-3 my-2col-lg-4 col-sm-12 card dark-bg" id="P1"></div>
</div>
<hr/>
<!-- Live Video Section-->
<div class="row text-center my-4">
<!--Left side video call out-->
<div class="col-lg-6 col-sm-12 my-2 ">
<div id="latest-bg"></div>
<div><p>Check out the latest video here!</p></div>
</div>
<!-- Right side video callout-->
<div class="col-lg-6 col-sm-12 my-2 card dark-bg ><iframe src='https://www.youtube.com/embed/?listType=playlist&list=UU78cpbnaq-eeKGGHIEtUgdw' frameborder='0' allowfullscreen /></div>
</div>
<hr/>
<!--Discord Section Section-->
<div class="row text-center my-4">
<!--Left side video call out-->
<div class="col-lg-6 col-sm-12 my-2 card dark-bg ></div>
<!-- Right side video callout-->
<div class="col-lg-6 col-sm-12 my-2 ">
<div id="latest-bg"></div>
<div><p>Check out the latest video here!</p></div>
</div>
</div>
<hr/>
<!--Slack Section Section-->
<div class="row text-center my-4">
<!--Left side video call out-->
<div class="col-lg-6 col-sm-12 my-2 ">
<div id="latest-bg"></div>
<div><p>Check out the latest video here!</p></div>
</div>
<!-- Right side video callout-->
<div class="col-lg-6 col-sm-12 my-2 card dark-bg ></div>
</div>
<hr/>
<!--Social Media callout-->
<div>
<div class="row">
<div class="col">
</div>
<div class="col">
<!--Pick your path title-->
<div id="path" class=""></div>
</div>
<div class="col">
</div>
</div>
</div>
<div class="row">
<div class="g-row">
<div><small>Check out all the resources </small></div>
</div>
<div class="grid">
<div id="Sc1" class="g-col-4 --bs-gap"></div>
<div id="Sc2" class="g-col-4 --bs-gap"></div>
<div id="Sc3" class="g-col-4 --bs-gap"></div>
<div id="Sc4" class="g-col-4 --bs-gap "></div>
</div>
</div>
<div>
</div>
`;
}
}
customElements.define('section3-component', Section3);
|
var NAVTREEINDEX24 =
{
"class_p_h_p_unit___text_u_i___command.html":[48,0,708],
"class_p_h_p_unit___text_u_i___command.html#a011800c63ece4cbbfa77136a20607023":[48,0,708,12],
"class_p_h_p_unit___text_u_i___command.html#a16a628a086f941d2a00d4cde917d1251":[48,0,708,0],
"class_p_h_p_unit___text_u_i___command.html#a1b74a8af2115a39559e9994778a567c3":[48,0,708,11],
"class_p_h_p_unit___text_u_i___command.html#a258bf9304a3fd9d40d1894a7339eb90f":[48,0,708,9],
"class_p_h_p_unit___text_u_i___command.html#a2beab03aa97d08d7a25a709e018ecf8e":[48,0,708,8],
"class_p_h_p_unit___text_u_i___command.html#a475024c68c7cb509672c0bab39d68f98":[48,0,708,7],
"class_p_h_p_unit___text_u_i___command.html#a5180182e50fae4b44de58f4c0f68e81d":[48,0,708,2],
"class_p_h_p_unit___text_u_i___command.html#a61eded163d962fc248b3cf209000979b":[48,0,708,10],
"class_p_h_p_unit___text_u_i___command.html#a8e4a50d2ec53027d3621bd3beb3d9eb1":[48,0,708,5],
"class_p_h_p_unit___text_u_i___command.html#aa31f6317c1f043c16d7524024ecc9445":[48,0,708,1],
"class_p_h_p_unit___text_u_i___command.html#aaea6080accfabc612f819580be15a3d4":[48,0,708,4],
"class_p_h_p_unit___text_u_i___command.html#ab8abd5b6bb82eb8fcf573f5c7b03d012":[48,0,708,3],
"class_p_h_p_unit___text_u_i___command.html#ac44fe359d84a50430f972272158e018d":[48,0,708,6],
"class_p_h_p_unit___text_u_i___result_printer.html":[48,0,709],
"class_p_h_p_unit___text_u_i___result_printer.html#a044cd2142c59e9c306b4f3adeedfe9fd":[48,0,709,10],
"class_p_h_p_unit___text_u_i___result_printer.html#a04f9b419c55dfed29e86a49094316c18":[48,0,709,41],
"class_p_h_p_unit___text_u_i___result_printer.html#a0858d25221c3e36da3e132efcac34035":[48,0,709,35],
"class_p_h_p_unit___text_u_i___result_printer.html#a13f0f4528a886903320fb2480b17296d":[48,0,709,22],
"class_p_h_p_unit___text_u_i___result_printer.html#a17bb8cfec1adb86ac32d5c4a29078065":[48,0,709,17],
"class_p_h_p_unit___text_u_i___result_printer.html#a1a9bddc54f26bb3fb5c2ec9778ea5198":[48,0,709,24],
"class_p_h_p_unit___text_u_i___result_printer.html#a1c0cb3bc58e5807530daf3a93783ed4e":[48,0,709,5],
"class_p_h_p_unit___text_u_i___result_printer.html#a20415328da688b6e48eed0db25476846":[48,0,709,38],
"class_p_h_p_unit___text_u_i___result_printer.html#a220b6910c1dd93908bdf934788cbd02c":[48,0,709,45],
"class_p_h_p_unit___text_u_i___result_printer.html#a2f6e2b2674d2a617d30f7f563e1a4550":[48,0,709,13],
"class_p_h_p_unit___text_u_i___result_printer.html#a2f73e1cf77fef51b9ec4c83f479e995c":[48,0,709,9],
"class_p_h_p_unit___text_u_i___result_printer.html#a320d7bc7d2f9264ee7ba7aca6fd2df41":[48,0,709,1],
"class_p_h_p_unit___text_u_i___result_printer.html#a32ac3a45213ef1ae74d30b50e1f9335d":[48,0,709,34],
"class_p_h_p_unit___text_u_i___result_printer.html#a415d53b69702ba40f80efa7b7df48472":[48,0,709,11],
"class_p_h_p_unit___text_u_i___result_printer.html#a465cd15e121083ca0745bc9c1186cbda":[48,0,709,39],
"class_p_h_p_unit___text_u_i___result_printer.html#a48c1df90664991e1af687f85ff0ea1f9":[48,0,709,18],
"class_p_h_p_unit___text_u_i___result_printer.html#a4c28e0ad2ecca8bcb90b4a13a567f0fb":[48,0,709,28],
"class_p_h_p_unit___text_u_i___result_printer.html#a54b0407348ba93a2142896cfcab9ae8c":[48,0,709,47],
"class_p_h_p_unit___text_u_i___result_printer.html#a5dfc558d612bdcb773ac988b2e637261":[48,0,709,12],
"class_p_h_p_unit___text_u_i___result_printer.html#a60e9ae05178c483ab3d9ff5c2399a463":[48,0,709,31],
"class_p_h_p_unit___text_u_i___result_printer.html#a668f17b68705c5c8686bac690a6f719d":[48,0,709,2],
"class_p_h_p_unit___text_u_i___result_printer.html#a6c3d134992c5b03573561ef82e7f743d":[48,0,709,6],
"class_p_h_p_unit___text_u_i___result_printer.html#a6de65eea8b294795cbc34c4c8cee8546":[48,0,709,7],
"class_p_h_p_unit___text_u_i___result_printer.html#a7bb8af4e80c138d129aaa0e892ba4cbf":[48,0,709,30],
"class_p_h_p_unit___text_u_i___result_printer.html#a81bfe09a62194fe5769ca1cc36ee428b":[48,0,709,3],
"class_p_h_p_unit___text_u_i___result_printer.html#a85a19fb72faf893f5bc2fc25058c2223":[48,0,709,36],
"class_p_h_p_unit___text_u_i___result_printer.html#a85ae3e64cd40e9564adceb010085e9dd":[48,0,709,32],
"class_p_h_p_unit___text_u_i___result_printer.html#a88a8e66608e397ea5bcec346b4832afb":[48,0,709,44],
"class_p_h_p_unit___text_u_i___result_printer.html#a8937854917d76a1807f303c3a4e70fb6":[48,0,709,20],
"class_p_h_p_unit___text_u_i___result_printer.html#a901a86a623d83184267b21f2daee0ff5":[48,0,709,25],
"class_p_h_p_unit___text_u_i___result_printer.html#a91232fac6fcbc91e34950220aa4f9d2e":[48,0,709,43],
"class_p_h_p_unit___text_u_i___result_printer.html#a94f881a4cf6840108fec713af0d205cf":[48,0,709,23],
"class_p_h_p_unit___text_u_i___result_printer.html#a9a1da341042f7390084b71daf14e849e":[48,0,709,14],
"class_p_h_p_unit___text_u_i___result_printer.html#aabaf257d9cc55646e409453097a81523":[48,0,709,46],
"class_p_h_p_unit___text_u_i___result_printer.html#aaf57dc4adb04a3dbb164c0524657c562":[48,0,709,33],
"class_p_h_p_unit___text_u_i___result_printer.html#ab3ed276531a5bd1adf1728c2eb99dddf":[48,0,709,37],
"class_p_h_p_unit___text_u_i___result_printer.html#ab40a908faef35c94529c4cba18c49835":[48,0,709,15],
"class_p_h_p_unit___text_u_i___result_printer.html#ac16d9225f88dcfaf22a86d7ba527c913":[48,0,709,21],
"class_p_h_p_unit___text_u_i___result_printer.html#ac332cc622fb3ecd240def17aff459da1":[48,0,709,29],
"class_p_h_p_unit___text_u_i___result_printer.html#ac41b9afdb2cca18c7fbb77acbc0ff669":[48,0,709,40],
"class_p_h_p_unit___text_u_i___result_printer.html#aca50b620904dd80bc667c1613759fe0d":[48,0,709,42],
"class_p_h_p_unit___text_u_i___result_printer.html#ad161e7d13b117cb0af3967cd2adc6bba":[48,0,709,4],
"class_p_h_p_unit___text_u_i___result_printer.html#ad4e1bebea767b82c70d2ad1acd77fc39":[48,0,709,16],
"class_p_h_p_unit___text_u_i___result_printer.html#add23b21c4f798573e02d5881789b54e8":[48,0,709,26],
"class_p_h_p_unit___text_u_i___result_printer.html#ae4b5d735668488399d06c4af87fe32fb":[48,0,709,27],
"class_p_h_p_unit___text_u_i___result_printer.html#ae4d4a8638af5b91aaa55d983037baf78":[48,0,709,19],
"class_p_h_p_unit___text_u_i___result_printer.html#ae4e0dee58dda71835e8dcb2f92f04046":[48,0,709,0],
"class_p_h_p_unit___text_u_i___result_printer.html#aeec28a4d1328434916ebcdc1ca6b5527":[48,0,709,8],
"class_p_h_p_unit___text_u_i___test_runner.html":[48,0,710],
"class_p_h_p_unit___text_u_i___test_runner.html#a0be479aca54ac1c979f4d6ca78a8f354":[48,0,710,13],
"class_p_h_p_unit___text_u_i___test_runner.html#a24a536cc54679b5d1948054ad3c70fa7":[48,0,710,4],
"class_p_h_p_unit___text_u_i___test_runner.html#a3441c77fb1d5dc5831a2277b5aa7d2b2":[48,0,710,11],
"class_p_h_p_unit___text_u_i___test_runner.html#a3fd31acacaf8046bb92d7726869d0489":[48,0,710,12],
"class_p_h_p_unit___text_u_i___test_runner.html#a461527c1de39a5520c52951b8f03d99f":[48,0,710,3],
"class_p_h_p_unit___text_u_i___test_runner.html#a51ed3bece021dbcaad0aa7a8c911de39":[48,0,710,5],
"class_p_h_p_unit___text_u_i___test_runner.html#a55202b5955819fc3c464a5801d1f7405":[48,0,710,1],
"class_p_h_p_unit___text_u_i___test_runner.html#a6b4c927d4da8c114a92c4dd84ba25adb":[48,0,710,0],
"class_p_h_p_unit___text_u_i___test_runner.html#a8f1a1a1e302df6070d50a8b8f6d7a0f0":[48,0,710,10],
"class_p_h_p_unit___text_u_i___test_runner.html#aa638767a19d3846eb30612a040cb4081":[48,0,710,8],
"class_p_h_p_unit___text_u_i___test_runner.html#ab3c1b3a323cbbf707c55cc3cd3efd811":[48,0,710,7],
"class_p_h_p_unit___text_u_i___test_runner.html#ab832f4c463ee1c9ba2e9464265f7ea3b":[48,0,710,9],
"class_p_h_p_unit___text_u_i___test_runner.html#ae3026497b1f5c470fc9a4cf0f9d105e8":[48,0,710,6],
"class_p_h_p_unit___text_u_i___test_runner.html#afb0cb597ca8178ca4c865d62b1ff7d48":[48,0,710,2],
"class_p_h_p_unit___util___blacklist.html":[48,0,711],
"class_p_h_p_unit___util___blacklist.html#a98667dd09d1cb4c06b25725e521fd029":[48,0,711,1],
"class_p_h_p_unit___util___blacklist.html#ac3e9adbe7b1c282f0eece963fa29034f":[48,0,711,0],
"class_p_h_p_unit___util___configuration.html":[48,0,712],
"class_p_h_p_unit___util___configuration.html#a0722441477f957078ee2437054556cbc":[48,0,712,19],
"class_p_h_p_unit___util___configuration.html#a07e38c4b4f08f2d50739562235952225":[48,0,712,11],
"class_p_h_p_unit___util___configuration.html#a1d05d18cdb4c7d80110a47c91c3c8d17":[48,0,712,17],
"class_p_h_p_unit___util___configuration.html#a22645bd8ed1ef0b6f5ae852c22a75665":[48,0,712,14],
"class_p_h_p_unit___util___configuration.html#a2339a7df4d6f6bb5f44f10895c68b09a":[48,0,712,6],
"class_p_h_p_unit___util___configuration.html#a2982abe8d7b767602a1485dfb4cf653d":[48,0,712,2],
"class_p_h_p_unit___util___configuration.html#a3387125924c13e72878c47ecad75faca":[48,0,712,0],
"class_p_h_p_unit___util___configuration.html#a36eca2931cea673827f30310453d2afb":[48,0,712,1],
"class_p_h_p_unit___util___configuration.html#a4062eef82ea4fb2ee5368400e8e1829e":[48,0,712,13],
"class_p_h_p_unit___util___configuration.html#a4a9714e2bea7d25b00ab025aeac10bd8":[48,0,712,16],
"class_p_h_p_unit___util___configuration.html#a4aabf8db7f0c37953e6261128840acbd":[48,0,712,3],
"class_p_h_p_unit___util___configuration.html#a6ccb20f9f1158310c8fb5e3861b3cbbf":[48,0,712,15],
"class_p_h_p_unit___util___configuration.html#a8f6c07dc957656f19e0b30afd4ffd932":[48,0,712,12],
"class_p_h_p_unit___util___configuration.html#aa270f2ef637ad3d6465f2b764c046def":[48,0,712,20],
"class_p_h_p_unit___util___configuration.html#aa314d2921e739837dbe4e04882402bbb":[48,0,712,9],
"class_p_h_p_unit___util___configuration.html#ab1293b372b365f8752626d457c46711b":[48,0,712,8],
"class_p_h_p_unit___util___configuration.html#ac5a31edb787609a3143dec9bfa8063ea":[48,0,712,18],
"class_p_h_p_unit___util___configuration.html#addb971651caad2302a1c1a1c1ef35857":[48,0,712,5],
"class_p_h_p_unit___util___configuration.html#af48b04caca08477e6a3128b3712fb562":[48,0,712,10],
"class_p_h_p_unit___util___configuration.html#afa88979f7ae48c0f0745443305631057":[48,0,712,4],
"class_p_h_p_unit___util___configuration.html#afd55a7913b3255daa422e20532c65665":[48,0,712,7],
"class_p_h_p_unit___util___configuration_generator.html":[48,0,713],
"class_p_h_p_unit___util___error_handler.html":[48,0,714],
"class_p_h_p_unit___util___fileloader.html":[48,0,715],
"class_p_h_p_unit___util___filesystem.html":[48,0,716],
"class_p_h_p_unit___util___filter.html":[48,0,717],
"class_p_h_p_unit___util___getopt.html":[48,0,718],
"class_p_h_p_unit___util___global_state.html":[48,0,719],
"class_p_h_p_unit___util___invalid_argument_helper.html":[48,0,720],
"class_p_h_p_unit___util___log___j_s_o_n.html":[48,0,721],
"class_p_h_p_unit___util___log___j_s_o_n.html#a1a9bddc54f26bb3fb5c2ec9778ea5198":[48,0,721,8],
"class_p_h_p_unit___util___log___j_s_o_n.html#a1c0cb3bc58e5807530daf3a93783ed4e":[48,0,721,4],
"class_p_h_p_unit___util___log___j_s_o_n.html#a320d7bc7d2f9264ee7ba7aca6fd2df41":[48,0,721,0],
"class_p_h_p_unit___util___log___j_s_o_n.html#a668f17b68705c5c8686bac690a6f719d":[48,0,721,1],
"class_p_h_p_unit___util___log___j_s_o_n.html#a6c3d134992c5b03573561ef82e7f743d":[48,0,721,5],
"class_p_h_p_unit___util___log___j_s_o_n.html#a6de65eea8b294795cbc34c4c8cee8546":[48,0,721,6],
"class_p_h_p_unit___util___log___j_s_o_n.html#a81bfe09a62194fe5769ca1cc36ee428b":[48,0,721,2],
"class_p_h_p_unit___util___log___j_s_o_n.html#a901a86a623d83184267b21f2daee0ff5":[48,0,721,9],
"class_p_h_p_unit___util___log___j_s_o_n.html#a9b26761dd62e5cb1f102906acb02caaa":[48,0,721,11],
"class_p_h_p_unit___util___log___j_s_o_n.html#ab3c1b3a323cbbf707c55cc3cd3efd811":[48,0,721,10],
"class_p_h_p_unit___util___log___j_s_o_n.html#acbe7e77aba3ccf6e34c95faf0f21c668":[48,0,721,14],
"class_p_h_p_unit___util___log___j_s_o_n.html#ad161e7d13b117cb0af3967cd2adc6bba":[48,0,721,3],
"class_p_h_p_unit___util___log___j_s_o_n.html#ae8a3cfd157d08b914324a38058a20815":[48,0,721,13],
"class_p_h_p_unit___util___log___j_s_o_n.html#aeec28a4d1328434916ebcdc1ca6b5527":[48,0,721,7],
"class_p_h_p_unit___util___log___j_s_o_n.html#afb0eb34a56be66ae0b4c0cc01eed6efc":[48,0,721,12],
"class_p_h_p_unit___util___log___j_unit.html":[48,0,722],
"class_p_h_p_unit___util___log___j_unit.html#a0d177b0430978fd7abd8a067b6f612a7":[48,0,722,11],
"class_p_h_p_unit___util___log___j_unit.html#a1a9bddc54f26bb3fb5c2ec9778ea5198":[48,0,722,12],
"class_p_h_p_unit___util___log___j_unit.html#a1c0cb3bc58e5807530daf3a93783ed4e":[48,0,722,5],
"class_p_h_p_unit___util___log___j_unit.html#a209cc84ec70586cd13d8ab0047324353":[48,0,722,17],
"class_p_h_p_unit___util___log___j_unit.html#a320d7bc7d2f9264ee7ba7aca6fd2df41":[48,0,722,1],
"class_p_h_p_unit___util___log___j_unit.html#a4f6d77e26718379b3fad41739753c5c4":[48,0,722,14],
"class_p_h_p_unit___util___log___j_unit.html#a537944ef228b8d6c0670c1f65eb5ddf7":[48,0,722,21],
"class_p_h_p_unit___util___log___j_unit.html#a627221d006a137113f79024660cf2735":[48,0,722,0],
"class_p_h_p_unit___util___log___j_unit.html#a668f17b68705c5c8686bac690a6f719d":[48,0,722,2],
"class_p_h_p_unit___util___log___j_unit.html#a6c3d134992c5b03573561ef82e7f743d":[48,0,722,6],
"class_p_h_p_unit___util___log___j_unit.html#a6c571ecc21b678c7d0a6a8f96ec7d197":[48,0,722,22],
"class_p_h_p_unit___util___log___j_unit.html#a6ce871279571a4ddaf5d61da6c188ad7":[48,0,722,15],
"class_p_h_p_unit___util___log___j_unit.html#a6de65eea8b294795cbc34c4c8cee8546":[48,0,722,7],
"class_p_h_p_unit___util___log___j_unit.html#a76ca2226668a5ff748f02ab87de743fd":[48,0,722,20],
"class_p_h_p_unit___util___log___j_unit.html#a7751f77b5263bcf940ece6e824a05b38":[48,0,722,9],
"class_p_h_p_unit___util___log___j_unit.html#a81bfe09a62194fe5769ca1cc36ee428b":[48,0,722,3],
"class_p_h_p_unit___util___log___j_unit.html#a8d197cdeaafd4a09c5479eb5bf6fb41a":[48,0,722,25],
"class_p_h_p_unit___util___log___j_unit.html#a901a86a623d83184267b21f2daee0ff5":[48,0,722,13],
"class_p_h_p_unit___util___log___j_unit.html#aabac4698b70d0136931dbb1634d7a915":[48,0,722,19],
"class_p_h_p_unit___util___log___j_unit.html#ab37f7c32f41c3c61ed940887453767f4":[48,0,722,18],
"class_p_h_p_unit___util___log___j_unit.html#ac5a31edb787609a3143dec9bfa8063ea":[48,0,722,16],
"class_p_h_p_unit___util___log___j_unit.html#ad161e7d13b117cb0af3967cd2adc6bba":[48,0,722,4],
"class_p_h_p_unit___util___log___j_unit.html#ae113b76a8aad2349aefd14cd049408b4":[48,0,722,24],
"class_p_h_p_unit___util___log___j_unit.html#ae77e29943d3db7e8ceecec427fa4df94":[48,0,722,23],
"class_p_h_p_unit___util___log___j_unit.html#aee25ddc87ee93ffa23a9db82c6329f2f":[48,0,722,26],
"class_p_h_p_unit___util___log___j_unit.html#aeec28a4d1328434916ebcdc1ca6b5527":[48,0,722,8],
"class_p_h_p_unit___util___log___j_unit.html#af18f946b8766fa1799890dfd500004fc":[48,0,722,10],
"class_p_h_p_unit___util___log___t_a_p.html":[48,0,723],
"class_p_h_p_unit___util___log___t_a_p.html#a0447da5346930e779111805e03813e99":[48,0,723,12],
"class_p_h_p_unit___util___log___t_a_p.html#a058d0261b18ee18c9fad1ffb1d08775c":[48,0,723,0],
"class_p_h_p_unit___util___log___t_a_p.html#a13eac668b69db4f84859b810a401f3d3":[48,0,723,13],
"class_p_h_p_unit___util___log___t_a_p.html#a1a9bddc54f26bb3fb5c2ec9778ea5198":[48,0,723,9],
"class_p_h_p_unit___util___log___t_a_p.html#a1c0cb3bc58e5807530daf3a93783ed4e":[48,0,723,5],
"class_p_h_p_unit___util___log___t_a_p.html#a320d7bc7d2f9264ee7ba7aca6fd2df41":[48,0,723,1],
"class_p_h_p_unit___util___log___t_a_p.html#a668f17b68705c5c8686bac690a6f719d":[48,0,723,2],
"class_p_h_p_unit___util___log___t_a_p.html#a6c3d134992c5b03573561ef82e7f743d":[48,0,723,6],
"class_p_h_p_unit___util___log___t_a_p.html#a6c571ecc21b678c7d0a6a8f96ec7d197":[48,0,723,14],
"class_p_h_p_unit___util___log___t_a_p.html#a6de65eea8b294795cbc34c4c8cee8546":[48,0,723,7],
"class_p_h_p_unit___util___log___t_a_p.html#a81bfe09a62194fe5769ca1cc36ee428b":[48,0,723,3],
"class_p_h_p_unit___util___log___t_a_p.html#a901a86a623d83184267b21f2daee0ff5":[48,0,723,10],
"class_p_h_p_unit___util___log___t_a_p.html#aa9c330b27b62dcccd8734dc349a679ee":[48,0,723,11],
"class_p_h_p_unit___util___log___t_a_p.html#ad161e7d13b117cb0af3967cd2adc6bba":[48,0,723,4],
"class_p_h_p_unit___util___log___t_a_p.html#aeec28a4d1328434916ebcdc1ca6b5527":[48,0,723,8],
"class_p_h_p_unit___util___log___team_city.html":[48,0,724],
"class_p_h_p_unit___util___log___team_city.html#a1a9bddc54f26bb3fb5c2ec9778ea5198":[48,0,724,10],
"class_p_h_p_unit___util___log___team_city.html#a1c0cb3bc58e5807530daf3a93783ed4e":[48,0,724,4],
"class_p_h_p_unit___util___log___team_city.html#a277dbcf7a698fc6fb61ed84278db3ecd":[48,0,724,8],
"class_p_h_p_unit___util___log___team_city.html#a320d7bc7d2f9264ee7ba7aca6fd2df41":[48,0,724,0],
"class_p_h_p_unit___util___log___team_city.html#a668f17b68705c5c8686bac690a6f719d":[48,0,724,1],
"class_p_h_p_unit___util___log___team_city.html#a6c3d134992c5b03573561ef82e7f743d":[48,0,724,5],
"class_p_h_p_unit___util___log___team_city.html#a6de65eea8b294795cbc34c4c8cee8546":[48,0,724,6],
"class_p_h_p_unit___util___log___team_city.html#a81bfe09a62194fe5769ca1cc36ee428b":[48,0,724,2],
"class_p_h_p_unit___util___log___team_city.html#a901a86a623d83184267b21f2daee0ff5":[48,0,724,11],
"class_p_h_p_unit___util___log___team_city.html#ad161e7d13b117cb0af3967cd2adc6bba":[48,0,724,3],
"class_p_h_p_unit___util___log___team_city.html#ae4b5d735668488399d06c4af87fe32fb":[48,0,724,12],
"class_p_h_p_unit___util___log___team_city.html#ae4d4a8638af5b91aaa55d983037baf78":[48,0,724,9],
"class_p_h_p_unit___util___log___team_city.html#aeec28a4d1328434916ebcdc1ca6b5527":[48,0,724,7],
"class_p_h_p_unit___util___p_h_p.html":[48,0,725],
"class_p_h_p_unit___util___p_h_p.html#a095c5d389db211932136b53f25f39685":[48,0,725,0],
"class_p_h_p_unit___util___p_h_p.html#a19dde99d8deb1c2e72d40e191fee96b0":[48,0,725,1],
"class_p_h_p_unit___util___p_h_p.html#a1ff25669b0b979247f2493d3e46b2649":[48,0,725,19],
"class_p_h_p_unit___util___p_h_p.html#a2bdd3292fd85da0f0f30ac8d70bf7ee3":[48,0,725,6],
"class_p_h_p_unit___util___p_h_p.html#a2c4a30cba6979f1463dfe4dc50d7bd9f":[48,0,725,2],
"class_p_h_p_unit___util___p_h_p.html#a3d80d4d51ec21d8237d6ed6808d70b8e":[48,0,725,11],
"class_p_h_p_unit___util___p_h_p.html#a67e94494731d99ed23b123e95175bc10":[48,0,725,15],
"class_p_h_p_unit___util___p_h_p.html#a7309a2a96c1122be71fd81873d93e678":[48,0,725,18],
"class_p_h_p_unit___util___p_h_p.html#a764c3409ca6e1322c1e157bcf35da371":[48,0,725,14],
"class_p_h_p_unit___util___p_h_p.html#a836dbb38b92ae3e0017f6941e5b1e3d6":[48,0,725,13],
"class_p_h_p_unit___util___p_h_p.html#a84320a9bf3e591d7ae20dfcb0dfe6a0d":[48,0,725,20],
"class_p_h_p_unit___util___p_h_p.html#a848d6f39ddf52949fc0c10cbc0159188":[48,0,725,17],
"class_p_h_p_unit___util___p_h_p.html#aa99ce9ae015e958eef5782267276fbb4":[48,0,725,16],
"class_p_h_p_unit___util___p_h_p.html#abac5019c5daf3a27d739aa3a249fdb31":[48,0,725,5],
"class_p_h_p_unit___util___p_h_p.html#ac1c698a00cb5bf7facc9305d3086a173":[48,0,725,7],
"class_p_h_p_unit___util___p_h_p.html#ad0719eb468cc64c6c572393d7fe7eab0":[48,0,725,10],
"class_p_h_p_unit___util___p_h_p.html#adba27a494b188ed418bfd1cb078751a6":[48,0,725,8],
"class_p_h_p_unit___util___p_h_p.html#ade85314bc074191bf57b0a76acff7a07":[48,0,725,4],
"class_p_h_p_unit___util___p_h_p.html#adea8b98e918c35781622f3ab86f1f07c":[48,0,725,9],
"class_p_h_p_unit___util___p_h_p.html#ae3411690a9e6580097926e3d0b2a10e5":[48,0,725,12],
"class_p_h_p_unit___util___p_h_p.html#af7e05155f430839d67e1c4e4d9431560":[48,0,725,3],
"class_p_h_p_unit___util___p_h_p___default.html":[48,0,726],
"class_p_h_p_unit___util___p_h_p___default.html#a113533f069a8ccbf5509a9c20da7643f":[48,0,726,6],
"class_p_h_p_unit___util___p_h_p___default.html#a2bdd3292fd85da0f0f30ac8d70bf7ee3":[48,0,726,3],
"class_p_h_p_unit___util___p_h_p___default.html#a6870df4ced2ffe74c901004b361f206b":[48,0,726,5],
"class_p_h_p_unit___util___p_h_p___default.html#a8a2a71393cabfb7b15b158df1a40ebfb":[48,0,726,2],
"class_p_h_p_unit___util___p_h_p___default.html#ab3791f1e0cb1da9fc370bd297d6a039b":[48,0,726,4],
"class_p_h_p_unit___util___p_h_p___default.html#ae5dbd216c09bda4ea76d2ca28e27eb00":[48,0,726,1],
"class_p_h_p_unit___util___p_h_p___default.html#aff07c1d29d6d6a540c726948254a1764":[48,0,726,0],
"class_p_h_p_unit___util___p_h_p___windows.html":[48,0,727],
"class_p_h_p_unit___util___p_h_p___windows.html#a113533f069a8ccbf5509a9c20da7643f":[48,0,727,2],
"class_p_h_p_unit___util___p_h_p___windows.html#a2c4a30cba6979f1463dfe4dc50d7bd9f":[48,0,727,0],
"class_p_h_p_unit___util___p_h_p___windows.html#ae5dbd216c09bda4ea76d2ca28e27eb00":[48,0,727,1],
"class_p_h_p_unit___util___p_h_p_test.html":[48,0,728],
"class_p_h_p_unit___util___p_h_p_test.html#a06d5c4b8b9087f973ab8dfe18413f7a5":[48,0,728,4],
"class_p_h_p_unit___util___p_h_p_test.html#a25e6138b0aefb00f4d20332db2570a1a":[48,0,728,6],
"class_p_h_p_unit___util___p_h_p_test.html#a3b15593a3e2da9f40823c666349b1538":[48,0,728,11],
"class_p_h_p_unit___util___p_h_p_test.html#a3b801891e9faf40b0c27586909866e4a":[48,0,728,5],
"class_p_h_p_unit___util___p_h_p_test.html#a4b72001c3161f2940fa5c5e41e0dc106":[48,0,728,10],
"class_p_h_p_unit___util___p_h_p_test.html#a65395e1f60ed9c20158851a3221cddc3":[48,0,728,7],
"class_p_h_p_unit___util___p_h_p_test.html#a722b0a91bd76acf208f1f6e796e6bf58":[48,0,728,8],
"class_p_h_p_unit___util___p_h_p_test.html#aa15e3dcd87bae69f6f8dc96b904fff8a":[48,0,728,0],
"class_p_h_p_unit___util___p_h_p_test.html#ab15ecaf1339bc3e29a15e333116862c5":[48,0,728,1],
"class_p_h_p_unit___util___p_h_p_test.html#ad56c6da33ad812176c407faaeffdc546":[48,0,728,9],
"class_p_h_p_unit___util___p_h_p_test.html#ae2c3801c80392e94782d4aaeb6043c19":[48,0,728,2],
"class_p_h_p_unit___util___p_h_p_test.html#aea223b4d1c3665fe11f366b40d283409":[48,0,728,3],
"class_p_h_p_unit___util___printer.html":[48,0,729],
"class_p_h_p_unit___util___printer.html#a058d0261b18ee18c9fad1ffb1d08775c":[48,0,729,0],
"class_p_h_p_unit___util___printer.html#a48cb304902320d173a4eaa41543327b9":[48,0,729,7],
"class_p_h_p_unit___util___printer.html#a4b838464425ac549611cb6b833f65793":[48,0,729,8],
"class_p_h_p_unit___util___printer.html#a5513242b573a539641e99f27182b7623":[48,0,729,4],
"class_p_h_p_unit___util___printer.html#a7751f77b5263bcf940ece6e824a05b38":[48,0,729,1],
"class_p_h_p_unit___util___printer.html#a7f7730a383eca33e065cd8e709f5de12":[48,0,729,2],
"class_p_h_p_unit___util___printer.html#ab3c1b3a323cbbf707c55cc3cd3efd811":[48,0,729,5],
"class_p_h_p_unit___util___printer.html#acf90e383b291bfaaccee1014f70fe3dc":[48,0,729,3],
"class_p_h_p_unit___util___printer.html#aef8c7c76f1d8d3bce4c43e7e6d736f3a":[48,0,729,6],
"class_p_h_p_unit___util___regex.html":[48,0,730],
"class_p_h_p_unit___util___string.html":[48,0,731],
"class_p_h_p_unit___util___test.html":[48,0,732],
"class_p_h_p_unit___util___test.html#a002a9c8499aa25c88e8418d0d99bfc4b":[48,0,732,0],
"class_p_h_p_unit___util___test.html#a1b3ee24e7c7ec93bf0acc5adbe3aa9b0":[48,0,732,2],
"class_p_h_p_unit___util___test.html#a2ce890f6751d460786f79997dec06743":[48,0,732,3],
"class_p_h_p_unit___util___test.html#a7ca655183eb9a4bd8ae93d82c64209b8":[48,0,732,1],
"class_p_h_p_unit___util___test.html#a90cc8808192399dde41fee04b82bb7b5":[48,0,732,6]
};
|
// select all air quality advisories
$(document).ready(function () {
$("#selectAll").click(function () {
$(".aqa").prop('checked', $(this).prop('checked'));
});
$(".aqa").change(function () {
if (!$(this).prop("checked")) {
$("#selectAll").prop("checked", false);
}
});
});
// select all smoky skies bulletin
$(document).ready(function () {
$("#selectAll2").click(function () {
$(".skb").prop('checked', $(this).prop('checked'));
});
$(".skb").change(function () {
if (!$(this).prop("checked")) {
$("#selectAll2").prop("checked", false);
}
});
});
$(document).ready(function () {
$(".reset-btn").click(function () {
$("#myForm").trigger("reset");
});
});
///FORM VALIDATION
// checkbox minimum selected
$(document).ready(function () {
$('#checkBtn').click(function () {
checked = $("[name=city]:checked").length > 0;
if (!checked) {
alert("You must select at least one notification list.");
return false;
} else {
return confirm('Please confirm: do you want to post to these notifcation lists?');
}
});
});
|
module.exports = new Date(2010, 11, 22)
|
import UIPlugin from '../../templates/ui/ui-plugin.js';
const COLOR_PRIMARY = 0x4e342e;
const COLOR_LIGHT = 0x7b5e57;
const COLOR_DARK = 0x260e04;
class Demo extends Phaser.Scene {
constructor() {
super({
key: 'examples'
})
}
preload() { }
create() {
this.print = this.add.text(0, 0, '');
var scrollablePanel = this.rexUI.add.scrollablePanel({
x: 400,
y: 300,
width: 250,
height: 220,
scrollMode: 0,
background: this.rexUI.add.roundRectangle(0, 0, 2, 2, 10, COLOR_PRIMARY),
panel: {
child: this.rexUI.add.fixWidthSizer({
space: {
left: 3,
right: 3,
top: 3,
bottom: 3,
item: 8,
line: 8,
}
}),
mask: {
padding: 1
},
},
slider: {
track: this.rexUI.add.roundRectangle(0, 0, 20, 10, 10, COLOR_DARK).setName('track'),
thumb: this.rexUI.add.roundRectangle(0, 0, 0, 0, 13, COLOR_LIGHT),
},
space: {
left: 10,
right: 10,
top: 10,
bottom: 10,
panel: 10,
}
})
.layout()
//.drawBounds(this.add.graphics(), 0xff0000);
updatePanel(scrollablePanel, content);
}
update() { }
}
var updatePanel = function (panel, content) {
var sizer = panel.getElement('panel');
var scene = panel.scene;
sizer.clear(true);
var lines = content.split('\n');
for (var li = 0, lcnt = lines.length; li < lcnt; li++) {
var words = lines[li].split(' ');
for (var wi = 0, wcnt = words.length; wi < wcnt; wi++) {
sizer.add(
scene.add.text(0, 0, words[wi], {
fontSize: 18
})
.setInteractive()
.on('pointerdown', function () {
this.scene.print.text = this.text;
this.setTint(Phaser.Math.Between(0, 0xffffff))
})
);
}
if (li < (lcnt - 1)) {
sizer.addNewLine();
}
}
panel.layout();
return panel;
}
var content = `Phaser is a fast, free, and fun open source HTML5 game framework that offers WebGL and Canvas rendering across desktop and mobile web browsers. Games can be compiled to iOS, Android and native apps by using 3rd party tools. You can use JavaScript or TypeScript for development.
Along with the fantastic open source community, Phaser is actively developed and maintained by Photon Storm. As a result of rapid support, and a developer friendly API, Phaser is currently one of the most starred game frameworks on GitHub.
Thousands of developers from indie and multi-national digital agencies, and universities worldwide use Phaser. You can take a look at their incredible games.`;
var config = {
type: Phaser.AUTO,
parent: 'phaser-example',
width: 800,
height: 600,
scale: {
mode: Phaser.Scale.FIT,
autoCenter: Phaser.Scale.CENTER_BOTH,
},
scene: Demo,
plugins: {
scene: [{
key: 'rexUI',
plugin: UIPlugin,
mapping: 'rexUI'
}]
}
};
var game = new Phaser.Game(config);
|
$(function () {
"use strict";
Morris.Area({
element: 'morris-area-chart'
, data: [{
period: '2010'
, iphone: 10
}, {
period: '2011'
, iphone: 1667
}, {
period: '2012'
, iphone: 4912
}, {
period: '2013'
, iphone: 3767
}, {
period: '2014'
, iphone: 6810
}, {
period: '2015'
, iphone: 5670
}, {
period: '2016'
, iphone: 4820
}, {
period: '2017'
, iphone: 15073
}, {
period: '2018'
, iphone: 8087
}, {
period: '2019'
, iphone: 10
}
]
, lineColors: ['#a5d9c7']
, xkey: 'period'
, ykeys: ['iphone']
, labels: ['Site A']
, pointSize: 0
, lineWidth: 0
, fillOpacity: 1
, resize: true
, behaveLikeLine: true
, gridLineColor: 'rgba(255, 255, 255, 0.1)'
, hideHover: 'auto'
});
var sparklineLogin = function () {
$('#sales1').sparkline([20, 40, 30], {
type: 'pie'
, height: '130'
, resize: true
, sliceColors: ['#808f8f', '#fecd36', '#f1f2f7']
});
$('#sales2').sparkline([6, 10, 9, 11, 9, 10, 12], {
type: 'bar'
, height: '154'
, barWidth: '4'
, resize: true
, barSpacing: '10'
, barColor: '#25a6f7'
});
$('#sparklinedash').sparkline([0, 5, 6, 10, 9, 12, 4, 9], {
type: 'bar'
, height: '30'
, barWidth: '4'
, resize: true
, barSpacing: '5'
, barColor: '#4caf50'
});
$('#sparklinedash2').sparkline([0, 5, 6, 10, 9, 12, 4, 9], {
type: 'bar'
, height: '30'
, barWidth: '4'
, resize: true
, barSpacing: '5'
, barColor: '#9675ce'
});
$('#sparklinedash3').sparkline([0, 5, 6, 10, 9, 12, 4, 9], {
type: 'bar'
, height: '30'
, barWidth: '4'
, resize: true
, barSpacing: '5'
, barColor: '#03a9f3'
});
$('#sparklinedash4').sparkline([0, 5, 6, 10, 9, 12, 4, 9], {
type: 'bar'
, height: '30'
, barWidth: '4'
, resize: true
, barSpacing: '5'
, barColor: '#f96262'
});
}
var sparkResize;
$(window).resize(function (e) {
clearTimeout(sparkResize);
sparkResize = setTimeout(sparklineLogin, 500);
});
sparklineLogin();
});
// Sky Icons
var icons = new Skycons({
"color": "#ff6849"
})
, list = [
"clear-day", "clear-night", "partly-cloudy-day"
, "partly-cloudy-night", "cloudy", "rain", "sleet", "snow", "wind"
, "fog"
]
, i;
for (i = list.length; i--;) {
var weatherType = list[i]
, elements = document.getElementsByClassName(weatherType);
for (e = elements.length; e--;) {
icons.set(elements[e], weatherType);
}
}
icons.play();
|
/**
* # A testing environment for React components using karma.
* Bit testing environment for testing of React components using Karma, with Mocha and ChaiJS.
*
* ## How to use?
* import the environment
* ```bash
* bit import bit.envs/testers/karma-mocha-react -t
* ```
*
* ## What's inside?
* - [Karma](https://karma-runner.github.io/1.0/index.html)
* - [Mocha](https://mochajs.org)
* - [Sinon](http://sinonjs.org)
* - [Chai](http://chaijs.com) integrated with Sinon to ease mock assertions using [sinon-chai](https://github.com/domenic/sinon-chai)
* - [React test utils](https://facebook.github.io/react/docs/test-utils.html)
* - [React Dom](https://facebook.github.io/react/docs/react-dom.html)
* - [mockery](https://github.com/mfncooper/mockery) for mocking of package dependencies.
* - [teaspoon](https://github.com/jquense/teaspoon) for testing rendered react components.
*/
const mockery = require('mockery');
const sinonChai = require('sinon-chai');
const path = require('path');
const fse = require('fs-extra');
const teaspoon = require('teaspoon');
const TestUtils = require('react-dom/test-utils');
const ReactDom = require('react-dom');
const karma = require('karma');
const getFileName = require('./extractFileNameFromPath');
require('./karma.conf');
const isEmptyObject = obj => Object.keys(obj).length === 0;
const exec = require('child-process-promise').exec;
const readResults = (filePath) => {
const resultsFilePath = path.resolve(`${__dirname}/${filePath}-results.json`);
const parsedResults = fse.readJsonSync(resultsFilePath);
fse.removeSync(resultsFilePath);
return parsedResults;
}
function normalizeResults(results, runStart, runEnd) {
function normalizeError(test) {
let message = 'No info regarding error';
let stack = 'No info regarding error';
if (test.log.length > 0) {
const errorLines = test.log[0].split('\n');
message = errorLines.shift();
stack = errorLines.join('\n');
}
return {
message,
stack
};
}
function normalizeTest(test) {
return ({
title: test.suite[0] + ' ' + test.description,
pass: test.success,
err: !test.success ? normalizeError(test) : null,
duration: test.endTime - test.startTime
});
}
return {
tests: Object.values(results.result)[0].map(normalizeTest),
stats: {
start: runStart,
end: runEnd
}
};
}
const run = (specFile) => {
const karmaConfig = karma.config.parseConfig(path.resolve(__dirname + '/karma.conf.js'), { files: [specFile], port: 9876 } );
var server = new karma.Server(karmaConfig, function(exitCode) {
console.info('Karma Server has exited with ' + exitCode)
process.exit(exitCode)
});
let runStart;
server.on('run_start', browsers => {
runStart = new Date();
});
return new Promise((resolve) => {
server.start();
server.on('exit', (browsers, resultsSummary) => {
const runEnd = new Date();
const parsedResults = readResults(getFileName(specFile));
if (isEmptyObject(parsedResults)) {
return {};
}
const normalizedResults = normalizeResults(parsedResults, runStart, runEnd);
return resolve(normalizedResults);
});
});
};
module.exports = {
run,
globals: {
mockery,
ReactDom
},
modules: {
teaspoon,
mockery,
'react-dom/test-utils': TestUtils,
'react-addons-test-utils': TestUtils,
'react-dom': ReactDom
}
};
|
let data = {
"body": "<path d=\"M27.66 15.61L18 6l-9.66 9.61A1 1 0 1 0 9.75 17L17 9.81v19.13a1 1 0 1 0 2 0V9.81L26.25 17a1 1 0 0 0 1.41-1.42z\" class=\"clr-i-outline clr-i-outline-path-1\" fill=\"currentColor\"/>",
"width": 36,
"height": 36
};
export default data;
|
const mongoose = require('mongoose');
const logger = require('./services/logger.factory');
const config = {
autoIndex: false,
useUnifiedTopology: true,
useNewUrlParser: true,
};
if (process.env.DB_URL) {
mongoose.connect(process.env.DB_URL, config);
} else {
logger.info('No MongoDB connection because DB_URL in .env is not present. ');
}
mongoose.connection.on('connected', () => {
logger.info(`Mongoose default connection open to ${process.env.DB_URL}`);
});
mongoose.connection.on('error', (error) => {
logger.info(`Mongoose default connection error: ${error}`);
});
mongoose.connection.on('disconnected', () => {
logger.error('Mongoose default connection disconnected');
});
mongoose.connection.on('open', () => {
logger.info('Mongoose default connection is open');
});
module.exports = mongoose;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.