Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the callback.
onAny(listener) { this._anyListeners = this._anyListeners || []; this._anyListeners.push(listener); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "on(name, callback) {\n if (listeners[name] === undefined) {\n listeners[name] = [callback];\n } else {\n listeners[name].push(callback);\n }\n }", "addEventListener(name, callback) {\n this.instance.on(name, callback);\n }", "function registerListener(event_name, callback_function) {\n\n var registerable_event;\n\n registerable_event = registerable_events[event_name];\n onlyProceedIf(registerable_event, isDefined);\n\n callback_function = callback_functions_for[registerable_event];\n onlyProceedIf(callback_function, isDefined);\n\n }", "on(eventName, callback) {\n if (this.events[eventName]) {\n this.events[eventName].push(callback);\n } else {\n this.events[eventName] = [callback];\n }\n }", "on(event, callback){\n // Input validation\n if(!this.callbacks[event]) throw \"unknown event: \" + event;\n if(typeof(callback) != \"function\") throw \"invalid or missing callback function\";\n\n // Add event listener to event\n this.callbacks[event].push(callback);\n }", "on(eventName, callback) {\n if(!this.events[eventName]){\n this.events[eventName] = [callback];\n } else {\n this.events[eventName].push(callback);\n }\n }", "function on(event_name, callback) {\n bindCallback = callback.bind(this);\n\n $.forEach(this.elements, function(element){\n element.addEventListener(event_name, bindCallback);\n })\n }", "function Listener(callback) {\n var listener = callback;\n listener.onArr = function (arr,eventName) {\n if (arr.length < 2 ) {throw \"Invalid argument: At least two elements in the Array are expected!\"}\n if(!eventName || !eventName.split) {throw 'Invalid argument: Event name is missing or an invalid type!'}\n var l = arr.length, arr = [].concat(arr);\n while (l--) {\n arr.each_(function (a,b) {\n this.on(a,b,eventName)\n }.bind(this,arr.shift()));\n }\n };\n //\n listener.on = function (a,b,eventName) {\n if(!a || !b) { throw 'Invalid arguments: Both event emitters are required!' }\n if(!eventName || !eventName.split ) {throw 'Invalid argument: Event name is missing or is invalid type.'}\n // TODO: Make sure no duplicates being added\n (a.on || a.addEventListener).call(a,eventName, function () {\n var args = [].slice.call(arguments);\n args.splice(0,0,{origin: a, target: b});\n this.apply(b,args); // call Listener right here\n }.bind(this));\n (b.on || b.addEventListener).call(b,eventName, function () {\n var args = [].slice.call(arguments);\n args.splice(0,0,{origin: b, target: a});\n this.apply(a,args); // call Listener right here\n }.bind(this))\n };\n return listener\n}", "addStreamListener(streamName, callback) {\n let streamHandler = this.getStreamHandler(streamName);\n if (streamHandler.callbackExists(callback)) {\n return;\n }\n streamHandler.addListener(callback);\n }", "function on(event, callback) {\n if(!subscribers[event]) {\n subscribers[event] = [];\n }\n subscribers[event].push(callback);\n }", "on(event, callback) {\n if ( !_.has(this.events, event) )\n {\n this.events[event] = [callback];\n return;\n }\n\n this.events[event].push(callback);\n }", "addListener(event, listener) {\n this.ee.addListener(event, listener);\n }", "on(eventName, cb) {\n if (this.events[eventName]) {\n this.events[eventName].push(cb);\n } else {\n this.events[eventName] = [cb];\n }\n }", "addListener(cb) {\n this.listeners.push(cb)\n }", "on(event, callback) {\n const names = event.split(\",\").map((x) => x.trim());\n for (const name of names) {\n this.listeners[name] = this.listeners[name] || [];\n this.listeners[name].push(callback);\n }\n return () => {\n for (const name of names) {\n this.listeners[name] = this.listeners[name].filter((fn) => {\n return fn !== callback;\n });\n }\n };\n }", "on(event, callback) {\n const names = event.split(\",\").map((x) => x.trim());\n for (const name of names) {\n this.listeners[name] = this.listeners[name] || [];\n this.listeners[name].push(callback);\n }\n return () => {\n for (const name of names) {\n this.listeners[name] = this.listeners[name].filter((fn) => {\n return fn !== callback;\n });\n }\n };\n }", "on(eventName, cb) {\n this._events.on(eventName, cb);\n }", "on(event: string, listener: Function): void {\n if (typeof this.__events[event] !== 'object') {\n this.__events[event] = [];\n }\n\n this.__events[event].push(listener);\n }", "addEventListener(name, callFunction){\n /*if(this.eventNameList.has(name)){\n this.eventNameList.get(name).callFunctionList.add(callFunction);\n }*/\n this.eventNameList.get(name).callFunctionList.add(callFunction);\n }", "on(name, callback){\n // if eventsMap[name] undefined, []\n this.eventsMap[name] = this.eventsMap[name] || [];\n // associates event with callback\n this.eventsMap[name].push(callback);\n //result : on('LIST') => doSomething()\n }", "function _on (event, listener) {\n if (typeof _events[event] !== 'object') {\n _events[event] = [];\n }\n\n _events[event].push(listener);\n }", "addEventListener(evtName, callback, opts) {\n if (eventNames.indexOf(evtName) === -1) {\n throw new Error(`Unsupported event type: ${evtName}`);\n }\n\n super.addEventListener(evtName, callback, opts);\n }", "addListener(eventName, handler) {\r\n if (eventName in this.events === false) this.events[eventName] = [];\r\n\r\n this.events[eventName].push(handler);\r\n }", "on(name, callback, callbackScope) {\n\n this.events.on(name, callback, callbackScope);\n\n }", "addEventListener(event, callback) {\n this.eventProxy.addEventListener(event, callback);\n }", "on(eventName, callback) {\n this.each((node) => {\n node.addEventListener(eventName, callback);\n const eventKey = `jqliteEvents-${eventName}`;\n if (typeof node[eventKey] === \"undefined\") {\n node[eventKey] = [];\n }\n node[eventKey].push(callback);\n });\n }", "on(event, listener, emitter = this._defaultEmitter()) {\n emitter.on(event, listener);\n }", "on(event, callback) {\n const id = this._seq();\n this._subscribers.push({id, event, callback});\n return {\n unsubscribe: this._unsubscribe.bind(this)\n };\n }", "subscribeToEvent(eventName, listener){\n this._eventEmmiter.on(eventName, listener);\n }", "function addListener(evantName, listener) {\n subscription[evantName] = engageModule.addListener(evantName, (beaconInfo) => {\n const info = Platform.OS === 'ios' ? beaconInfo : JSON.parse(beaconInfo)\n listener(info);\n });\n}", "addDataListener(callback) {\n this.addListener( this.dataListeners, callback);\n }", "addListener(listener) {\n this.listeners.push(listener);\n }", "addListener(listener) {\n this.listeners.push(listener);\n }", "addListener(listener) {\n listeners.push(listener);\n }", "addChangeListener (callback) {\n this.on(Constants.CHANGE_EVENT, callback);\n }", "addChangeListener(callback) {\n\t\tthis.on(CHANGE_EVENT, callback)\n\t}", "AddChangeListener(callback){\r\n\t\tthis._callbacks.push(callback);\r\n\t}", "addChangeListener (callback) {\n\t\tthis.on(Constants.CHANGE_EVENT, callback);\n\t}", "function on (event, cb) {\n emitter.on(event, cb)\n }", "function on (event, cb) {\n emitter.on(event, cb)\n }", "function on (event, cb) {\n emitter.on(event, cb)\n }", "_addEventListener(eventName, callback, uuid) {\n\t\tif (uuid) {\n\t\t\teventName = eventName + '.' + uuid;\n\t\t}\n\n\t\t$(document).on(eventName, callback);\n\t}", "addListener(array, callback) {\n if ( typeof callback == 'function') {\n array.push(callback);\n }\n }", "addListener(eventName, listener) {\n return this.on(eventName, listener);\n }", "addChangeListener(callback) {\n Bullet.on(LOCAL_EVENT_NAME, callback)\n }", "function addEventListener(eventName, listener){\n\t\tconsole.log(\"addEventListener: \" + eventName);\n\t\t\n\t\tif(mEventListeners[eventName] === undefined)\n\t\t\tmEventListeners[eventName] = [];\n\t\t\t\n\t\tmEventListeners[eventName].push(listener);\n\t}", "function _add_event_listener(el, eventname, fn){\r\n if (el.addEventListener === undefined){\r\n el.attachEvent('on' + eventname, fn);\r\n }\r\n else {\r\n el.addEventListener(eventname, fn);\r\n }\r\n}", "addNewGameListener(callback) {\n this.newGameListeners.push(callback);\n }", "function eventHandler(event)\n{\n if (event_listeners.length > 0)\n {\n for(var i=0;i<event_listeners.length;++i)\n {\n var obj = event_listeners[i].object;\n event_listeners[i].callback.call(obj,event);\n //event_listeners[i].callback(event);\n }\n }\n}", "subscribe(event, callback) {\n this.bus.addEventListener(event, callback);\n }", "function addOnEvent(eventListener) {\n eventQueue.push(eventListener);\n }", "on(eventName, callback) {\n this.socket.on(eventName, callback);\n }", "static addListener(listener) {\n listeners.push(listener);\n }", "function addEventListener (type, callback) {\n wsEmitter.addListener(type, callback)\n}", "addEventListener(event, callback) {\n const RNAliyunEmitter = Platform.OS === 'ios' ? new NativeEventEmitter(RNAliyunOSS) : DeviceEventEmitter;\n switch (event) {\n case 'uploadProgress':\n subscription = RNAliyunEmitter.addListener(\n 'uploadProgress',\n e => callback(e)\n );\n break;\n case 'downloadProgress':\n subscription = RNAliyunEmitter.addListener(\n 'downloadProgress',\n e => callback(e)\n );\n break;\n default:\n break;\n }\n }", "function _map_addEventListner(map,szEvent,callback,mapUp){\r\n\tif (map){\r\n\t\tGEvent.addListener(map, szEvent, GEvent.callback(map,callback,mapUp) );\r\n\t}\r\n}", "addListener(k, f) {\n if (this.hasListeners(k)) {\n this.listeners[k].add(f);\n } else {\n this.listeners[k] = new Set([f]);\n }\n }", "on( evtName, fn ){ this._emitter.addEventListener( evtName, fn ); return this; }", "on(name, callback) {\r\n this.electronWindow.on(name, callback);\r\n }", "on(event, callback) {\n // split the event\n const events = event.split(/\\W+/);\n events.forEach(eventName => {\n if (isUndef(this._events)) {\n this._events = {};\n }\n if (!this._events.hasOwnProperty(eventName)) {\n this._events[eventName] = [];\n }\n this._events[eventName].push(callback);\n });\n return this;\n }", "on(event, callback) {\n if (isArray(event)) {\n for (const ev of event) {\n this.on(ev, callback)\n }\n } else if (isPlainObject(event)) {\n for (const key in event) {\n this.on(key, event[key])\n }\n } else {\n const listeners = (this.listeners ||= Object.create(null))\n const { callbacks } = (listeners[event] ||= {\n callbacks: [],\n queue: []\n })\n callbacks.push(callback)\n }\n return this\n }", "function emitEvent ( name ) {\n\t\t\tif ( options['on' + name] ) {\n\t\t\t\toptions['on' + name].call(API);\n\t\t\t}\n\t\t}", "addChangeListener(callback) {\n this.on(CHANGE, callback);\n }", "addChangeListener(callback) {\n this.on(CHANGE, callback);\n }", "addChangeListener(callback) {\n this.on(CHANGE, callback);\n }", "onChange(callback) {\n this.listeners.push(callback);\n }", "addWelcomeListener(callback) {\n this.addListener( this.welcomeListeners, callback);\n }", "function listenEvent(event, selector, callback) {\n document.addEventListener(event, (ev) => {\n // only listen to event triggered by selector\n if (ev.target.matches(selector)) {\n // prevent default behaviour\n ev.preventDefault();\n\n // call back function\n callback(ev);\n }\n })\n}", "function content_listenMessage(name, listener) {\n addMessageListener(name, listener);\n\n content_listenShutdown(() => {\n removeMessageListener(name, listener);\n });\n }", "listen(namespace, fn) {\n this._callbacks[namespace].push(fn);\n }", "subscribeTo(event, callback) {\n this.socket.on(event, callback);\n }", "function listen(key, callback) {\n handlers[key] = callback;\n}", "on(name, handler) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this[EVENT_NAME_TO_HANDLER_NAME[name]] = handler;\n }", "function addListener(selector,eventName,cb){\r\n document.querySelector(selector).addEventListener(eventName,cb)\r\n}", "on(event, cb) {\n this.conn.on(event, cb);\n }", "addEventListener(target, type, listener, options) {\n this.log(`Adding \"${type}\" eventlistener`, target);\n \n const boundListener = listener.bind(this);\n target.addEventListener(type, boundListener, options);\n this.eventListeners.push({target, type, listener, boundListener});\n }", "addEventListener (f) {\n this.eventListeners.push(f)\n }", "function eventSubscribe(eventName, functionCallback) {\n // If subscribe is undefined, create and empty array\n if(typeof subscribers[eventName] === 'undefined') {\n subscribers[eventName] = [];\n }\n\n // Subscribe function callback in array\n subscribers[eventName].push(functionCallback);\n }", "addEventListener(target, type, listener, options) {\n this.log(`Adding \"${type}\" eventlistener`, target);\n\n const boundListener = listener.bind(this);\n target.addEventListener(type, boundListener, options);\n this.eventListeners.push({ target, type, listener, boundListener });\n }", "function add(event, callback) {\n\n\t// If the event doesn't exist yet\n\tif(!(event in _callbacks)) {\n\t\t_callbacks[event] = []\n\t}\n\n\t// Add the callback to the list\n\t_callbacks[event].push(callback);\n\treturn true;\n}", "function on(eventName, fn) {\n events[eventName] = events[eventName] || [];\n events[eventName].push(fn);\n }", "function on(eventName, fn) {\n events[eventName] = events[eventName] || [];\n events[eventName].push(fn);\n }", "function addNameInputEventListeners() {\n canvas.addEventListener('click', nameInputClickListener, false);\n}", "addListener(changeListener) {\n this.changeListeners.push(changeListener);\n }", "subscribe(name, fn) {\n this.events.get(name).subscribe(fn);\n }", "on(name, callback) {\n\t\tassert('Cannot register an event with no callback', typeof callback === 'function');\n\n\t\tconst meta = this._wakeUp(name, callback, true);\n\n\t\tthis.get('_cache').pushObject(meta);\n\n\t\treturn get(meta, 'deferred.promise');\n\t}", "on(eventName, handler) {\n this.eventsMap[eventName] = handler;\n }", "function on(eventName, fn) {\n events[eventName] = events[eventName] || [];\n events[eventName].push(fn);\n }", "registerSpanEventListener(listener) {\n this.eventListenersLocal.push(listener);\n }", "subscribe(name, fn) {\r\n this.events.get(name).subscribe(fn);\r\n }", "listen() {\n [\"change\"].forEach(name => {\n this.el_.addEventListener(name, this.handler_, false)\n })\n }", "function registerListener(_listener_, id){\n listeners[id] = _listener_;\n }", "on (event, λ) {\n this.callbacks[event] = λ;\n }", "addListener(listener) {\n if (!activeListeners.includes(listener)) {\n activeListeners.push(listener);\n }\n }", "listenTo(node, event, scope, callback, context) {\n\t var _context5;\n\n\t // scope is optional param\n\t if (typeof node == \"string\") {\n\t context = callback;\n\t callback = scope;\n\t scope = event;\n\t event = node;\n\t node = this.el;\n\t }\n\n\t if (typeof scope != \"string\") {\n\t context = callback;\n\t callback = scope;\n\t scope = false;\n\t }\n\n\t context || (context = this);\n\t var listen = [node, event, bind$1(_context5 = function (e) {\n\t if (!scope || e.target.matches(scope) || e.target.closest(scope)) {\n\t return bind$1(callback).call(callback, context)(...arguments);\n\t }\n\t }).call(_context5, context)];\n\t this.eventListens.push(listen);\n\t node.addEventListener(event, listen[2]);\n\t }", "get event() {\n if (!this._event) {\n this._event = (callback, thisArgs, disposables) => {\n var _a, _b, _c;\n if (!this._listeners) {\n this._listeners = new LinkedList();\n }\n if (this._leakageMon && this._listeners.size > this._leakageMon.threshold * 3) {\n console.warn(`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far`);\n return Disposable.None;\n }\n const firstListener = this._listeners.isEmpty();\n if (firstListener && ((_a = this._options) === null || _a === void 0 ? void 0 : _a.onWillAddFirstListener)) {\n this._options.onWillAddFirstListener(this);\n }\n let removeMonitor;\n let stack;\n if (this._leakageMon && this._listeners.size >= Math.ceil(this._leakageMon.threshold * 0.2)) {\n // check and record this emitter for potential leakage\n stack = Stacktrace.create();\n removeMonitor = this._leakageMon.check(stack, this._listeners.size + 1);\n }\n if (_enableDisposeWithListenerWarning) {\n stack = stack !== null && stack !== void 0 ? stack : Stacktrace.create();\n }\n const listener = new Listener(callback, thisArgs, stack);\n const removeListener = this._listeners.push(listener);\n if (firstListener && ((_b = this._options) === null || _b === void 0 ? void 0 : _b.onDidAddFirstListener)) {\n this._options.onDidAddFirstListener(this);\n }\n if ((_c = this._options) === null || _c === void 0 ? void 0 : _c.onDidAddListener) {\n this._options.onDidAddListener(this, callback, thisArgs);\n }\n const result = listener.subscription.set(() => {\n var _a, _b;\n removeMonitor === null || removeMonitor === void 0 ? void 0 : removeMonitor();\n if (!this._disposed) {\n (_b = (_a = this._options) === null || _a === void 0 ? void 0 : _a.onWillRemoveListener) === null || _b === void 0 ? void 0 : _b.call(_a, this);\n removeListener();\n if (this._options && this._options.onDidRemoveLastListener) {\n const hasListeners = (this._listeners && !this._listeners.isEmpty());\n if (!hasListeners) {\n this._options.onDidRemoveLastListener(this);\n }\n }\n }\n });\n if (disposables instanceof DisposableStore) {\n disposables.add(result);\n }\n else if (Array.isArray(disposables)) {\n disposables.push(result);\n }\n return result;\n };\n }\n return this._event;\n }", "function subscribe(listener) {\n listeners.push(listener);\n }", "function listener(event, done) {\n return function onevent(arg1) {\n var args = new Array(arguments.length);\n var ee = this;\n var err = event === 'error' ? arg1 : null; // copy args to prevent arguments escaping scope\n\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n done(err, ee, event, args);\n };\n}", "function eventName(name) {\n if (name.lastIndexOf(eventPrefix, 0) === 0) return name.substr(eventPrefix.length);\n return name;\n } // $.listen is deprecated. Use Parsley.on instead.", "function eventName(name) {\n if (name.lastIndexOf(eventPrefix, 0) === 0) return name.substr(eventPrefix.length);\n return name;\n } // $.listen is deprecated. Use Parsley.on instead.", "on(sEventName, f) {\n\t\tthis.getEventHandlers(sEventName).push(f);\n\t}" ]
[ "0.7394834", "0.7378805", "0.6941454", "0.69218343", "0.6864508", "0.68165493", "0.67416173", "0.6730367", "0.6729546", "0.6674991", "0.66716504", "0.65797365", "0.6544818", "0.65358967", "0.6531936", "0.6531936", "0.6524538", "0.6522213", "0.6502764", "0.6448572", "0.64227694", "0.6412757", "0.63958126", "0.63816035", "0.6374082", "0.635891", "0.6354543", "0.6324029", "0.6295809", "0.6259996", "0.6251651", "0.6203276", "0.6203276", "0.62017196", "0.6127959", "0.60467994", "0.60435444", "0.60260797", "0.602237", "0.602237", "0.602237", "0.60086256", "0.60010815", "0.5991242", "0.598879", "0.5973995", "0.59686786", "0.59134126", "0.5889456", "0.5889081", "0.5881226", "0.5879565", "0.58604026", "0.5855315", "0.5846141", "0.5837456", "0.583228", "0.58156043", "0.5803432", "0.57954234", "0.5792959", "0.5783235", "0.57665277", "0.5760974", "0.5760974", "0.57599896", "0.57444507", "0.5740937", "0.57405114", "0.5738468", "0.57314897", "0.5722124", "0.571531", "0.57099175", "0.57032037", "0.5698661", "0.56981933", "0.56981546", "0.56548065", "0.5649973", "0.56494415", "0.56494415", "0.56493926", "0.5645386", "0.56390995", "0.5634939", "0.56272817", "0.56176144", "0.56106436", "0.5607011", "0.5605893", "0.5602948", "0.5601988", "0.5601399", "0.55957764", "0.5590713", "0.55862695", "0.55819076", "0.55806714", "0.55806714", "0.5578489" ]
0.0
-1
Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the callback. The listener is added to the beginning of the listeners array.
prependAny(listener) { this._anyListeners = this._anyListeners || []; this._anyListeners.unshift(listener); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "on(name, callback) {\n if (listeners[name] === undefined) {\n listeners[name] = [callback];\n } else {\n listeners[name].push(callback);\n }\n }", "function Listener(callback) {\n var listener = callback;\n listener.onArr = function (arr,eventName) {\n if (arr.length < 2 ) {throw \"Invalid argument: At least two elements in the Array are expected!\"}\n if(!eventName || !eventName.split) {throw 'Invalid argument: Event name is missing or an invalid type!'}\n var l = arr.length, arr = [].concat(arr);\n while (l--) {\n arr.each_(function (a,b) {\n this.on(a,b,eventName)\n }.bind(this,arr.shift()));\n }\n };\n //\n listener.on = function (a,b,eventName) {\n if(!a || !b) { throw 'Invalid arguments: Both event emitters are required!' }\n if(!eventName || !eventName.split ) {throw 'Invalid argument: Event name is missing or is invalid type.'}\n // TODO: Make sure no duplicates being added\n (a.on || a.addEventListener).call(a,eventName, function () {\n var args = [].slice.call(arguments);\n args.splice(0,0,{origin: a, target: b});\n this.apply(b,args); // call Listener right here\n }.bind(this));\n (b.on || b.addEventListener).call(b,eventName, function () {\n var args = [].slice.call(arguments);\n args.splice(0,0,{origin: b, target: a});\n this.apply(a,args); // call Listener right here\n }.bind(this))\n };\n return listener\n}", "addEventListener(name, callback) {\n this.instance.on(name, callback);\n }", "addListener(listener) {\n listeners.push(listener);\n }", "addListener(cb) {\n this.listeners.push(cb)\n }", "addListener(event, listener) {\n this.ee.addListener(event, listener);\n }", "function registerListener(event_name, callback_function) {\n\n var registerable_event;\n\n registerable_event = registerable_events[event_name];\n onlyProceedIf(registerable_event, isDefined);\n\n callback_function = callback_functions_for[registerable_event];\n onlyProceedIf(callback_function, isDefined);\n\n }", "on(eventName, callback) {\n if (this.events[eventName]) {\n this.events[eventName].push(callback);\n } else {\n this.events[eventName] = [callback];\n }\n }", "addListener(listener) {\n this.listeners.push(listener);\n }", "addListener(listener) {\n this.listeners.push(listener);\n }", "function _on (event, listener) {\n if (typeof _events[event] !== 'object') {\n _events[event] = [];\n }\n\n _events[event].push(listener);\n }", "on(event: string, listener: Function): void {\n if (typeof this.__events[event] !== 'object') {\n this.__events[event] = [];\n }\n\n this.__events[event].push(listener);\n }", "on(eventName, callback) {\n if(!this.events[eventName]){\n this.events[eventName] = [callback];\n } else {\n this.events[eventName].push(callback);\n }\n }", "static addListener(listener) {\n listeners.push(listener);\n }", "addStreamListener(streamName, callback) {\n let streamHandler = this.getStreamHandler(streamName);\n if (streamHandler.callbackExists(callback)) {\n return;\n }\n streamHandler.addListener(callback);\n }", "addListener(array, callback) {\n if ( typeof callback == 'function') {\n array.push(callback);\n }\n }", "addEventListener(name, callFunction){\n /*if(this.eventNameList.has(name)){\n this.eventNameList.get(name).callFunctionList.add(callFunction);\n }*/\n this.eventNameList.get(name).callFunctionList.add(callFunction);\n }", "on(event, callback){\n // Input validation\n if(!this.callbacks[event]) throw \"unknown event: \" + event;\n if(typeof(callback) != \"function\") throw \"invalid or missing callback function\";\n\n // Add event listener to event\n this.callbacks[event].push(callback);\n }", "addListener(eventName, listener) {\n return this.on(eventName, listener);\n }", "addDataListener(callback) {\n this.addListener( this.dataListeners, callback);\n }", "function addEventListener(eventName, listener){\n\t\tconsole.log(\"addEventListener: \" + eventName);\n\t\t\n\t\tif(mEventListeners[eventName] === undefined)\n\t\t\tmEventListeners[eventName] = [];\n\t\t\t\n\t\tmEventListeners[eventName].push(listener);\n\t}", "addListener(listener) {\n if (!activeListeners.includes(listener)) {\n activeListeners.push(listener);\n }\n }", "function on(event, callback) {\n if(!subscribers[event]) {\n subscribers[event] = [];\n }\n subscribers[event].push(callback);\n }", "on(eventName, cb) {\n if (this.events[eventName]) {\n this.events[eventName].push(cb);\n } else {\n this.events[eventName] = [cb];\n }\n }", "on(event, callback) {\n const names = event.split(\",\").map((x) => x.trim());\n for (const name of names) {\n this.listeners[name] = this.listeners[name] || [];\n this.listeners[name].push(callback);\n }\n return () => {\n for (const name of names) {\n this.listeners[name] = this.listeners[name].filter((fn) => {\n return fn !== callback;\n });\n }\n };\n }", "on(event, callback) {\n const names = event.split(\",\").map((x) => x.trim());\n for (const name of names) {\n this.listeners[name] = this.listeners[name] || [];\n this.listeners[name].push(callback);\n }\n return () => {\n for (const name of names) {\n this.listeners[name] = this.listeners[name].filter((fn) => {\n return fn !== callback;\n });\n }\n };\n }", "addListener(eventName, handler) {\r\n if (eventName in this.events === false) this.events[eventName] = [];\r\n\r\n this.events[eventName].push(handler);\r\n }", "function addListener(evantName, listener) {\n subscription[evantName] = engageModule.addListener(evantName, (beaconInfo) => {\n const info = Platform.OS === 'ios' ? beaconInfo : JSON.parse(beaconInfo)\n listener(info);\n });\n}", "addEventListener(evtName, callback, opts) {\n if (eventNames.indexOf(evtName) === -1) {\n throw new Error(`Unsupported event type: ${evtName}`);\n }\n\n super.addEventListener(evtName, callback, opts);\n }", "on(event, callback) {\n if ( !_.has(this.events, event) )\n {\n this.events[event] = [callback];\n return;\n }\n\n this.events[event].push(callback);\n }", "on(name, callback){\n // if eventsMap[name] undefined, []\n this.eventsMap[name] = this.eventsMap[name] || [];\n // associates event with callback\n this.eventsMap[name].push(callback);\n //result : on('LIST') => doSomething()\n }", "addListener(k, f) {\n if (this.hasListeners(k)) {\n this.listeners[k].add(f);\n } else {\n this.listeners[k] = new Set([f]);\n }\n }", "registerListeners() {}", "addListener(changeListener) {\n this.changeListeners.push(changeListener);\n }", "addNewGameListener(callback) {\n this.newGameListeners.push(callback);\n }", "AddChangeListener(callback){\r\n\t\tthis._callbacks.push(callback);\r\n\t}", "function on(event_name, callback) {\n bindCallback = callback.bind(this);\n\n $.forEach(this.elements, function(element){\n element.addEventListener(event_name, bindCallback);\n })\n }", "on(eventName, callback) {\n this.each((node) => {\n node.addEventListener(eventName, callback);\n const eventKey = `jqliteEvents-${eventName}`;\n if (typeof node[eventKey] === \"undefined\") {\n node[eventKey] = [];\n }\n node[eventKey].push(callback);\n });\n }", "function addOnEvent(eventListener) {\n eventQueue.push(eventListener);\n }", "function registerListeners() {\n subscribe('name-changed', saveName)\n subscribe('name-changed', displayName)\n\n subscribe('config-changed', saveConfig)\n subscribe('config-changed', displayConfig)\n\n subscribe('language-changed', updateLanguageStrings)\n subscribe('language-changed', calculateGreeting)\n\n subscribe('greeting-changed', displayGreeting)\n}", "addEventListener(target, type, listener, options) {\n this.log(`Adding \"${type}\" eventlistener`, target);\n \n const boundListener = listener.bind(this);\n target.addEventListener(type, boundListener, options);\n this.eventListeners.push({target, type, listener, boundListener});\n }", "on(event, listener, emitter = this._defaultEmitter()) {\n emitter.on(event, listener);\n }", "addEventListener (f) {\n this.eventListeners.push(f)\n }", "addEventListener(target, type, listener, options) {\n this.log(`Adding \"${type}\" eventlistener`, target);\n\n const boundListener = listener.bind(this);\n target.addEventListener(type, boundListener, options);\n this.eventListeners.push({ target, type, listener, boundListener });\n }", "function addListener(listener) {\n listeners.push(listener);\n\n if(!watchId) {\n startWatching();\n }\n else if(cachedGeo) {\n setTimeout(function() {\n handleEvent(cachedGeo);\n }, 0);\n }\n }", "addListener(listener) {\r\n if (IDataListener_1.isDataListener(listener) && this.listeners.indexOf(listener) === -1) {\r\n this.listeners.push(listener);\r\n listener.registerRemover(() => {\r\n const index = this.listeners.indexOf(listener);\r\n if (index !== -1)\r\n this.listeners.splice(index, 1);\r\n });\r\n }\r\n }", "addEventListener(event, callback) {\n this.eventProxy.addEventListener(event, callback);\n }", "function subscribe(listener) {\n listeners.push(listener);\n }", "subscribeToEvent(eventName, listener){\n this._eventEmmiter.on(eventName, listener);\n }", "addChangeListener(callback) {\n\t\tthis.on(CHANGE_EVENT, callback)\n\t}", "function registerListener(_listener_, id){\n listeners[id] = _listener_;\n }", "function addListeners(listeners) {\n config.listeners = __assign({}, listeners);\n window.addEventListener('message', _onParentMessage);\n}", "on(eventName, cb) {\n this._events.on(eventName, cb);\n }", "addChangeListener (callback) {\n this.on(Constants.CHANGE_EVENT, callback);\n }", "registerSpanEventListener(listener) {\n this.eventListenersLocal.push(listener);\n }", "addMultipleEventListener(events, listener) {\n Log.trace({ events }, 'Registering event listeners');\n\n const listeners = [];\n\n events.forEach(eventName => {\n const listenWrapper = _.partial(listener, _, eventName);\n this.on(eventName, listenWrapper);\n listeners.push({ eventName, listenWrapper });\n });\n\n return listeners;\n }", "addChangeListener(callback) {\n Bullet.on(LOCAL_EVENT_NAME, callback)\n }", "function addListener(event, listener) {\n localListeners.push({\n event: event,\n listener: listener\n });\n return _bar.pool.addListener(event, listener);\n }", "function registerChangeListener(newListener) {\n var newPos = changeListeners.length;\n changeListeners[newPos] = newListener;\n}", "hookListeners(dispatchEvents, callback) {\n debug('hookListeners()');\n return this.hookListenersImpl(dispatchEvents, callback);\n }", "function subscribe(listener) {\r\n subscribers.push(listener);\r\n }", "addChangeListener (callback) {\n\t\tthis.on(Constants.CHANGE_EVENT, callback);\n\t}", "on(event, callback) {\n const id = this._seq();\n this._subscribers.push({id, event, callback});\n return {\n unsubscribe: this._unsubscribe.bind(this)\n };\n }", "function onListener(listenerString, callback) {\n if (!callback) return;\n\n var listenerFunctions = listenerString.split(\" \");\n for (var i = 0; i < listenerFunctions.length; i++) {\n var listenerSplit = listenerFunctions[i].split(\".\");\n if (listenerSplit.length === 0) return;\n\n var functionName = listenerSplit[0];\n\n var CMIElement = null;\n if (listenerSplit.length > 1) {\n CMIElement = listenerString.replace(functionName + \".\", \"\");\n }\n\n this.listenerArray.push({\n functionName: functionName,\n CMIElement: CMIElement,\n callback: callback\n });\n }\n }", "on(name, callback, callbackScope) {\n\n this.events.on(name, callback, callbackScope);\n\n }", "function content_listenMessage(name, listener) {\n addMessageListener(name, listener);\n\n content_listenShutdown(() => {\n removeMessageListener(name, listener);\n });\n }", "_setEventListeners(eventListeners) {\n if (!this.currentEventListeners) {\n this.currentEventListeners = eventListeners;\n eventListeners.forEach(listener => {\n if (listener.invoke) {\n this.domElement.addEventListener(listener.event, listener.callBack);\n }\n });\n } else {\n console.warn(\"Setting new event listeners without removing old listeners\");\n }\n }", "function _add_event_listener(el, eventname, fn){\r\n if (el.addEventListener === undefined){\r\n el.attachEvent('on' + eventname, fn);\r\n }\r\n else {\r\n el.addEventListener(eventname, fn);\r\n }\r\n}", "function addNameInputEventListeners() {\n canvas.addEventListener('click', nameInputClickListener, false);\n}", "function addListeners (stream, on, listeners) {\n for (var i = 0; i < listeners.length; i++) {\n on.apply(stream, listeners[i]);\n }\n}", "function addListeners (stream, on, listeners) {\n for (var i = 0; i < listeners.length; i++) {\n on.apply(stream, listeners[i]);\n }\n}", "_addEventListener(eventName, callback, uuid) {\n\t\tif (uuid) {\n\t\t\teventName = eventName + '.' + uuid;\n\t\t}\n\n\t\t$(document).on(eventName, callback);\n\t}", "function on(eventName, fn) {\n events[eventName] = events[eventName] || [];\n events[eventName].push(fn);\n }", "function on(eventName, fn) {\n events[eventName] = events[eventName] || [];\n events[eventName].push(fn);\n }", "function addListeners (stream, on, listeners) {\n for (var i = 0; i < listeners.length; i++) {\n on.apply(stream, listeners[i])\n }\n}", "function addListeners (stream, on, listeners) {\n for (var i = 0; i < listeners.length; i++) {\n on.apply(stream, listeners[i])\n }\n}", "function addListeners (stream, on, listeners) {\n for (var i = 0; i < listeners.length; i++) {\n on.apply(stream, listeners[i])\n }\n}", "function addListeners (stream, on, listeners) {\n for (var i = 0; i < listeners.length; i++) {\n on.apply(stream, listeners[i])\n }\n}", "function addListener(key) {\n\t\t//Create listener for specific key\n\t\tvar l = function(change){\n\t\t\t//Fire it again\n\t\t\tchanged(change,key);\n\t\t};\n\t\t//Add to map\n\t\tlisteners[key] = l;\n\t\t//Return listener callback\n\t\treturn l;\n\t}", "function addEventListener (type, callback) {\n wsEmitter.addListener(type, callback)\n}", "addLoadGameListener(callback) {\n this.loadGameListeners.push(callback);\n }", "function on(eventName, fn) {\n events[eventName] = events[eventName] || [];\n events[eventName].push(fn);\n }", "addChangeListener(callback) {\n this.on(CHANGE, callback);\n }", "addChangeListener(callback) {\n this.on(CHANGE, callback);\n }", "addChangeListener(callback) {\n this.on(CHANGE, callback);\n }", "listen(listener) {\n this._listeners.push(listener);\n\n return () => {\n this._listeners = this._listeners.filter(registered => {\n return listener !== registered;\n });\n };\n }", "createListeners() {\n\n this.listenDeleteAllFiltersOptions();\n\n this.listenMainInputOnType();\n\n this.listenClickFilterOption();\n\n this.listenDeleteFilter();\n\n this.listenMainInputOnFocus();\n\n this.listenMainInputOnBlur();\n\n this.listenClickModalFilter();\n\n this.listenModalFilterOnBlur();\n\n this.listenModalFilterOnType();\n\n }", "addListener(type, callback) {\n if (type == CALLBACKS.WEBSOCKET_CONNECTED) {\n this.websocketConnectedListeners.push(callback);\n } else if (type == CALLBACKS.WEBSOCKET_DISCONNECTED) {\n this.websocketDisconnectListeners.push(callback);\n } else if (type == CALLBACKS.RAW_WEBSOCKET_MESSAGE_RECEIVED) {\n this.rawMessageListeners.push(callback);\n }\n }", "addOnRemove (listener) {\n this.listeners.push(listener)\n }", "function _map_addEventListner(map,szEvent,callback,mapUp){\r\n\tif (map){\r\n\t\tGEvent.addListener(map, szEvent, GEvent.callback(map,callback,mapUp) );\r\n\t}\r\n}", "function EventListeners () {\n Fire._CallbacksHandler.call(this);\n }", "on(event, callback) {\n if (isArray(event)) {\n for (const ev of event) {\n this.on(ev, callback)\n }\n } else if (isPlainObject(event)) {\n for (const key in event) {\n this.on(key, event[key])\n }\n } else {\n const listeners = (this.listeners ||= Object.create(null))\n const { callbacks } = (listeners[event] ||= {\n callbacks: [],\n queue: []\n })\n callbacks.push(callback)\n }\n return this\n }", "function addListener(selector,eventName,cb){\r\n document.querySelector(selector).addEventListener(eventName,cb)\r\n}", "listen(namespace, fn) {\n this._callbacks[namespace].push(fn);\n }", "function listenArrayEvents(array, listener) {\n if (array._chartjs) {\n array._chartjs.listeners.push(listener);\n\n return;\n }\n\n Object.defineProperty(array, '_chartjs', {\n configurable: true,\n enumerable: false,\n value: {\n listeners: [listener]\n }\n });\n arrayEvents.forEach(function (key) {\n var method = 'onData' + key.charAt(0).toUpperCase() + key.slice(1);\n var base = array[key];\n Object.defineProperty(array, key, {\n configurable: true,\n enumerable: false,\n value: function value() {\n var args = Array.prototype.slice.call(arguments);\n var res = base.apply(this, args);\n helpers$1.each(array._chartjs.listeners, function (object) {\n if (typeof object[method] === 'function') {\n object[method].apply(object, args);\n }\n });\n return res;\n }\n });\n });\n }", "function eventSubscribe(eventName, functionCallback) {\n // If subscribe is undefined, create and empty array\n if(typeof subscribers[eventName] === 'undefined') {\n subscribers[eventName] = [];\n }\n\n // Subscribe function callback in array\n subscribers[eventName].push(functionCallback);\n }", "addScopeListener(callback) {\n this._scopeListeners.push(callback);\n }", "function attachDefaultListeners(listenerDiv) {\n listenerDiv.addEventListener('load', moduleDidLoad, true);\n listenerDiv.addEventListener('message', handleMessage, true);\n listenerDiv.addEventListener('error', handleError, true);\n listenerDiv.addEventListener('crash', handleCrash, true);\n }", "onChange(callback) {\n this.listeners.push(callback);\n }", "function listenArrayEvents(array, listener) {\n if (array._chartjs) {\n array._chartjs.listeners.push(listener);\n\n return;\n }\n\n Object.defineProperty(array, '_chartjs', {\n configurable: true,\n enumerable: false,\n value: {\n listeners: [listener]\n }\n });\n arrayEvents.forEach(function (key) {\n var method = 'onData' + key.charAt(0).toUpperCase() + key.slice(1);\n var base = array[key];\n Object.defineProperty(array, key, {\n configurable: true,\n enumerable: false,\n value: function () {\n var args = Array.prototype.slice.call(arguments);\n var res = base.apply(this, args);\n helpers$1.each(array._chartjs.listeners, function (object) {\n if (typeof object[method] === 'function') {\n object[method].apply(object, args);\n }\n });\n return res;\n }\n });\n });\n }", "function addMultipleEvents(el, eventArray, callback){\n eventArray.forEach(function(evt){\n el.addEventListener(evt, callback, false);\n });\n }" ]
[ "0.7697547", "0.7054176", "0.6991829", "0.6964034", "0.6818684", "0.67896086", "0.6768237", "0.67482173", "0.67186064", "0.67186064", "0.66999495", "0.6678827", "0.665461", "0.6624508", "0.66185534", "0.65893745", "0.6537873", "0.65254486", "0.65033334", "0.6449389", "0.6422468", "0.6421704", "0.63904226", "0.63778985", "0.637189", "0.637189", "0.6365658", "0.6357452", "0.629975", "0.62613106", "0.6257245", "0.6244515", "0.6215953", "0.62147534", "0.6203414", "0.6166014", "0.6161608", "0.61461365", "0.61003697", "0.6089341", "0.6085804", "0.60827667", "0.60810995", "0.6041096", "0.6038072", "0.6021952", "0.60045326", "0.59899724", "0.5987797", "0.59812903", "0.59812814", "0.5974059", "0.59501636", "0.59468204", "0.5933901", "0.59277004", "0.59259576", "0.59222615", "0.5914588", "0.5904363", "0.58560354", "0.5854175", "0.58385926", "0.5831202", "0.58267224", "0.58094263", "0.5798832", "0.57955015", "0.57783306", "0.5774806", "0.5774806", "0.5763661", "0.5761967", "0.5761967", "0.5759476", "0.5759476", "0.5759476", "0.5759476", "0.57385886", "0.57272017", "0.57247216", "0.5713628", "0.56897336", "0.568687", "0.568687", "0.56724954", "0.56332624", "0.56276983", "0.56205255", "0.5615334", "0.5613893", "0.5598689", "0.5590059", "0.55891716", "0.5586832", "0.55805385", "0.55553293", "0.55531925", "0.5550251", "0.5547478", "0.553913" ]
0.0
-1
Removes the listener that will be fired when any event is emitted.
offAny(listener) { if (!this._anyListeners) { return this; } if (listener) { const listeners = this._anyListeners; for (let i = 0; i < listeners.length; i++) { if (listener === listeners[i]) { listeners.splice(i, 1); return this; } } } else { this._anyListeners = []; } return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_unlisten() {\n const that = this;\n\n if (that._trackListener) {\n that._trackListener.unlisten();\n }\n\n if (that._fillListener) {\n that._fillListener.unlisten();\n }\n\n if (that._lineListener) {\n that._lineListener.unlisten();\n }\n }", "function removeEventListeners(){\n _.forEach(unlistenCallbacks, function(unlisten){\n unlisten();\n });\n unlistenCallbacks = [];\n }", "unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }", "removeAllEventListeners() {\n this.eventListeners.forEach(({ target, type, boundListener }) => {\n this.log(`Removing \"${type}\" eventlistener`, target);\n target.removeEventListener(type, boundListener);\n });\n this.eventListeners.length = 0;\n }", "removeAllEventListeners() {\n this.eventListeners.forEach(({target, type, boundListener}) => {\n this.log(`Removing \"${type}\" eventlistener`, target);\n target.removeEventListener(type, boundListener);\n });\n this.eventListeners.length = 0;\n }", "unsubscribe(listener){\n let index = this.listeners.indexOf(listener);\n if( index >= 0 )\n this.listeners.splice(index, 1);\n }", "removeListener(listener) {\n const index = activeListeners.findIndex(l => l === listener);\n if (index !== -1) {\n activeListeners.splice(index, 1);\n }\n }", "function unsubscribe(listener) {\r\n var index = subscribers.indexOf(listener);\r\n if (index > -1) {\r\n subscribers.splice(index, 1);\r\n }\r\n }", "removeListener(event, listener) {\n this.ee.removeListener(event, listener);\n }", "removeListener(event, listener, emitter = this._defaultEmitter()) {\n emitter.removeListener(event, listener);\n }", "_removeGlobalListener() {\n if (this._globalSubscription) {\n this._globalSubscription.unsubscribe();\n this._globalSubscription = null;\n }\n }", "_removeGlobalListener() {\n if (this._globalSubscription) {\n this._globalSubscription.unsubscribe();\n this._globalSubscription = null;\n }\n }", "_removeGlobalListener() {\n if (this._globalSubscription) {\n this._globalSubscription.unsubscribe();\n this._globalSubscription = null;\n }\n }", "unlisten() {\n [\"change\"].forEach(name => {\n this.el_.removeEventListener(name, this.handler_, false)\n })\n\n /* Final reset */\n this.reset()\n }", "removeAllListeners() {\n\t\tfor (let i = 0; i < this.eventHandles_.length; i++) {\n\t\t\tthis.eventHandles_[i].removeListener();\n\t\t}\n\n\t\tthis.eventHandles_ = [];\n\t}", "_removeGlobalListener() {\n if (this._globalSubscription) {\n this._globalSubscription.unsubscribe();\n\n this._globalSubscription = null;\n }\n }", "removeListeners() {}", "removeListeners() {}", "removeListeners() {}", "_clearListeners() {\n for (const listener of this._listeners) {\n listener.remove();\n }\n this._listeners = [];\n }", "removeAllListeners() {\n this.listeners = {};\n }", "_removeEventListeners() {\n this.currentEventListeners.forEach(listener => {\n this.domElement.removeEventListener(listener.event, listener.callBack);\n });\n this.currentEventListeners = null;\n }", "unregisterSpanEventListener(listener) {\n const index = this.eventListenersLocal.indexOf(listener, 0);\n if (index > -1) {\n this.eventListeners.splice(index, 1);\n }\n }", "function unsubscribe (id) {\n delete listeners[id];\n }", "removeAll() {\n this.listeners.forEach(listener => listener.destroy());\n this.listeners = [];\n }", "_clearListeners() {\n for (let listener of this._listeners) {\n listener.remove();\n }\n this._listeners = [];\n }", "un(event, listener) {\n\t\tthis.eventemitter.off(event, listener);\n\t\treturn this;\n\t}", "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "function unsubscribe (id) {\n listeners[id] = undefined;\n }", "removeEventListeners() {\n\t\twindow.removeEventListener('resize', this.bindResize);\n\t\tthis.domElement.removeEventListener('click', this.bindClick);\n\t\tTweenMax.ticker.removeEventListener('tick', this.bindRender);\n\t\tEmitter.off('LOADING_COMPLETE', this.bindEnter);\n\t\twindow.removeEventListener('mousemove', this.boundMouseMove);\n\t}", "removeChangeListener(callback) {\n\t\tthis.removeListener(CHANGE_EVENT, callback)\n\t}", "function unsubscribe (id) {\n\t listeners[id] = undefined;\n\t }", "function unsubscribe (id) {\n\t listeners[id] = undefined;\n\t }", "removeListener(type, listener) {\n let removedListener;\n\n const events = this._events;\n if (events === undefined) return this;\n\n const list = events[type];\n if (list === undefined) return this;\n\n for (let i = list.length - 1; i >= 0; i--) {\n if (list[i] === listener) {\n removedListener = list[i];\n list.splice(i, 1);\n this.emit(\"removedListener\", type, removedListener);\n break;\n }\n }\n\n return this;\n }", "function removeEventListener(handle) {\n GEvent.removeListener(handle);\n }", "removeAllListeners() {\n const me = this,\n listeners = me.eventListeners || (me.eventListeners = {});\n\n for (let event in listeners) {\n listeners[event].forEach((cfg) => me.removeListener(event, cfg));\n }\n }", "remove() {\n this.target.removeListener(this.event, this.callback, {\n context: this.context,\n remaining: this.remaining\n });\n }", "removeListeners() {\n var descriptor = this.getDescriptor();\n if (descriptor) {\n descriptor.unlisten(DescriptorEventType.ACTIVATED, this.onActivated, false, this);\n descriptor.unlisten(DescriptorEventType.DEACTIVATED, this.onDeactivated, false, this);\n descriptor.unlisten(DescriptorEventType.DEACTIVATED, this.onActivationError, false, this);\n }\n }", "removeListener(event: string, listener: Function) {\n var idx;\n\n if (typeof this.__events[event] === 'object') {\n idx = indexOf(this.__events[event], listener);\n\n if (idx > -1) {\n this.__events[event].splice(idx, 1);\n }\n }\n }", "function stopListening() {\n element.removeEventListener(listenForEvent, handleKeyEvent);\n }", "unlisten() {\n ipc.removeListener('search-count', this._searchCoundHandler);\n ipc.removeListener('focus-input', this._focusHandler);\n }", "function clearEvents() {\n\t\t\tvar ident;\n\t\t\tfor (ident in listenersByEventId) {\n\t\t\t\tr.removeListener(ident);\n\t\t\t}\n\t\t}", "unlisten() {\n EventManager.off('resize', this.onResize)\n }", "remove() {\n this.target.removeEventListener(this.eventType, this.fn, false);\n }", "function unsubscribe(listener) {\n\t\tlet out = [];\n\t\tfor (let i=0; i<listeners.length; i++) {\n\t\t\tif (listeners[i]===listener) {\n\t\t\t\tlistener = null;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tout.push(listeners[i]);\n\t\t\t}\n\t\t}\n\t\tlisteners = out;\n\t}", "removeEventListeners() {\n this.elementListener.removeEventListener(\"mouseenter\", this.onMouseEnterBind);\n this.elementListener.removeEventListener(\"mouseleave\", this.onMouseLeaveBind);\n this.elementListener.removeEventListener(\"mousemove\", this.onMouseMoveBind);\n\n if (this.gyroscope) {\n window.removeEventListener(\"deviceorientation\", this.onDeviceOrientationBind);\n }\n\n if (this.glare || this.fullPageListening) {\n window.removeEventListener(\"resize\", this.onWindowResizeBind);\n }\n }", "function clearListeners(event) {\n if(event) {\n delete listeners[event];\n } else {\n listeners = {};\n }\n }", "off(eventName, cb) {\n this._events.removeListener(eventName, cb);\n }", "removeAllListeners() {\n this._onOpen.removeAllListeners();\n this._onMessage.removeAllListeners();\n this._onUnpackedMessage.removeAllListeners();\n this._onResponse.removeAllListeners();\n this._onSend.removeAllListeners();\n this._onClose.removeAllListeners();\n this._onError.removeAllListeners();\n }", "function stopListening () {\n if (window.removeEventListener) {\n window.removeEventListener('message', this.handler)\n }\n else {\n window.detachEvent('onmessage', this.handler)\n }\n}", "removeAllEventListeners () {\n this.eventListeners = [];\n }", "function removeListener(w, event, cb) {\n if (w.detachEvent) w.detachEvent('on' + event, cb);else if (w.removeEventListener) w.removeEventListener(event, cb, false);\n }", "remove() {\n window.removeEventListener('vrdisplaypresentchange', this.__onVRDisplayPresentChange);\n if (screenfull.enabled) {\n document.removeEventListener(screenfull.raw.fullscreenchanged, this.__onChangeFullscreen);\n }\n\n this.removeAllListeners();\n }", "removeMetricListener(subscription, listener) {\n this.deviceStore.removeMetricListener(subscription, listener);\n }", "function removeListener(w, event, cb) {\n if(w.detachEvent) w.detachEvent('on' + event, cb);\n else if (w.removeEventListener) w.removeEventListener(event, cb, false);\n }", "function removeListener(w, event, cb) {\n if(w.detachEvent) w.detachEvent('on' + event, cb);\n else if (w.removeEventListener) w.removeEventListener(event, cb, false);\n }", "function removeListener(w, event, cb) {\n if(w.detachEvent) w.detachEvent('on' + event, cb);\n else if (w.removeEventListener) w.removeEventListener(event, cb, false);\n }", "function removeListener(w, event, cb) {\n if(w.detachEvent) w.detachEvent('on' + event, cb);\n else if (w.removeEventListener) w.removeEventListener(event, cb, false);\n }", "function removeListener(w, event, cb) {\n if(w.detachEvent) w.detachEvent('on' + event, cb);\n else if (w.removeEventListener) w.removeEventListener(event, cb, false);\n }", "function removeListener(w, event, cb) {\n if(w.detachEvent) w.detachEvent('on' + event, cb);\n else if (w.removeEventListener) w.removeEventListener(event, cb, false);\n }", "unlisten() {\n this.media_.removeListener(this.handler_)\n }", "function removeListener(w, event, cb) {\n\t if(w.detachEvent) w.detachEvent('on' + event, cb);\n\t else if (w.removeEventListener) w.removeEventListener(event, cb, false);\n\t }", "function removeListener(w, event, cb) {\n\t if(w.detachEvent) w.detachEvent('on' + event, cb);\n\t else if (w.removeEventListener) w.removeEventListener(event, cb, false);\n\t }", "function removeListener(w, event, cb) {\n\t if(w.detachEvent) w.detachEvent('on' + event, cb);\n\t else if (w.removeEventListener) w.removeEventListener(event, cb, false);\n\t }", "function removeListener(w, event, cb) {\n\t if(w.detachEvent) w.detachEvent('on' + event, cb);\n\t else if (w.removeEventListener) w.removeEventListener(event, cb, false);\n\t }", "function removeListener(w, event, cb) {\n\t if(w.detachEvent) w.detachEvent('on' + event, cb);\n\t else if (w.removeEventListener) w.removeEventListener(event, cb, false);\n\t }", "undelegateEvents() {\n this.delegatedEventListeners.forEach(({ type, listener }) => {\n this.el.removeEventListener(type, listener);\n });\n\n this.delegatedEventListeners = [];\n }", "removeChangeListener(callback) {\n this.removeListener(CHANGE, callback);\n }", "removeAllListeners (eventName) {\n // perform default behavior, preserve fn arity\n if (eventName) {\n super.removeAllListeners(eventName)\n } else {\n super.removeAllListeners()\n }\n // re-add internal events\n this._setupInternalEvents()\n // trigger stop check just in case\n this._onRemoveListener()\n }", "__unregisterEventListener() {\n qx.event.Registration.removeListener(\n window,\n \"resize\",\n this._updateSize,\n this\n );\n\n qx.event.Registration.removeListener(\n window,\n \"scroll\",\n this._onScroll,\n this\n );\n\n this.removeListener(\"pointerdown\", qx.bom.Event.preventDefault, this);\n this.removeListener(\"pointerup\", qx.bom.Event.preventDefault, this);\n }", "cancel() {\n\t\tthis.removeAllListeners()\n\t}", "destroy() {\n this.listeners = null;\n }", "offAny(listener) {\n if (!this._anyListeners) {\n return this;\n }\n if (listener) {\n const listeners = this._anyListeners;\n for (let i = 0; i < listeners.length; i++) {\n if (listener === listeners[i]) {\n listeners.splice(i, 1);\n return this;\n }\n }\n }\n else {\n this._anyListeners = [];\n }\n return this;\n }", "offAny(listener) {\n if (!this._anyListeners) {\n return this;\n }\n if (listener) {\n const listeners = this._anyListeners;\n for (let i = 0; i < listeners.length; i++) {\n if (listener === listeners[i]) {\n listeners.splice(i, 1);\n return this;\n }\n }\n }\n else {\n this._anyListeners = [];\n }\n return this;\n }", "removeAllListeners() {\n const listeners = this.eventListeners;\n let i, thisObj;\n\n for (const event in listeners) {\n const bucket = listeners[event]; // We iterate backwards since we call removeListener which will splice out of\n // this array as we go...\n\n for (i = bucket.length; i-- > 0;)\n /* empty */\n {\n const cfg = bucket[i];\n this.removeListener(event, cfg);\n thisObj = cfg.thisObj;\n\n if (thisObj && thisObj.untrackDetachers) {\n thisObj.untrackDetachers(this);\n }\n }\n }\n }", "removeListener(eventName, listener) {\n this.eventEmitter.removeListener(eventName, listener);\n return this;\n }", "onDestroy() {\n this.unlisten()\n }", "static removeEventListener(type, handler) {\n if(Linking.unlisten) {\n Linking.unlisten();\n }\n }" ]
[ "0.78343904", "0.7782837", "0.772481", "0.7594351", "0.758446", "0.7574993", "0.7538692", "0.7506632", "0.7500639", "0.7472067", "0.7417481", "0.7417481", "0.7417481", "0.7391687", "0.7385274", "0.7351547", "0.7295183", "0.7295183", "0.7295183", "0.7262007", "0.7252703", "0.72134614", "0.7197877", "0.7171064", "0.7154941", "0.7131487", "0.71118355", "0.7110935", "0.7110935", "0.7110935", "0.7110935", "0.7110935", "0.7110935", "0.7110935", "0.7110935", "0.7110935", "0.7110935", "0.7110935", "0.7110935", "0.7110935", "0.7110935", "0.7110935", "0.7110935", "0.7110935", "0.7110935", "0.7110935", "0.7110935", "0.7110935", "0.7110935", "0.7110935", "0.7110935", "0.7110935", "0.7103311", "0.7037711", "0.70343965", "0.70343965", "0.7033373", "0.7029198", "0.7025811", "0.70233405", "0.70066", "0.69988286", "0.69901246", "0.6982175", "0.6967074", "0.6961189", "0.6947503", "0.6932405", "0.6893548", "0.6882653", "0.6872117", "0.68645346", "0.6860736", "0.68433386", "0.68426603", "0.68389297", "0.6834023", "0.6807813", "0.6807813", "0.6807813", "0.6807813", "0.6807813", "0.6807813", "0.6803475", "0.6802969", "0.6802969", "0.6802969", "0.6802969", "0.6802969", "0.6776731", "0.67711616", "0.6770458", "0.67701894", "0.6766489", "0.6765004", "0.67643976", "0.67643976", "0.6763932", "0.67622447", "0.67506945", "0.6744449" ]
0.0
-1
Returns an array of listeners that are listening for any event that is specified. This array can be manipulated, e.g. to remove listeners.
listenersAny() { return this._anyListeners || []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "listenersAny() {\n return this._anyListeners || [];\n }", "listenersAny() {\n return this._anyListeners || [];\n }", "listenersAny() {\n return this._anyListeners || [];\n }", "function watchedEvents(obj) {\n var listeners = obj[META_KEY].listeners, ret = [];\n\n if (listeners) {\n for(var eventName in listeners) {\n if (listeners[eventName]) { ret.push(eventName); }\n }\n }\n return ret;\n}", "addMultipleEventListener(events, listener) {\n Log.trace({ events }, 'Registering event listeners');\n\n const listeners = [];\n\n events.forEach(eventName => {\n const listenWrapper = _.partial(listener, _, eventName);\n this.on(eventName, listenWrapper);\n listeners.push({ eventName, listenWrapper });\n });\n\n return listeners;\n }", "listenersAny() {\n return this._anyListeners || [];\n }", "get eventListeners() {\n return this.eventListenersLocal;\n }", "listenersAnyOutgoing() {\n return this._anyOutgoingListeners || [];\n }", "static get listenedEvents() {\n\t\treturn DOM_EVENTS;\n\t}", "get_listeners() { return null; }", "async getSystemEventListeners () {\n const listenerFiles = await this.loadListeners()\n\n return listenerFiles\n .map(listenerFile => {\n const Listener = this.resolve(listenerFile)\n const listener = new Listener()\n this.ensureListener(listener)\n\n return listener\n })\n .filter(listener => {\n return listener.type() === 'system'\n })\n }", "get eventListeners() {\n\t\treturn [\"onOpening\",\"onOpen\",\"onClosing\",\"onClose\",\"onCollapse\",\"onDragEnd\",\"onDragStart\",\"onExpand\",\"onMaximize\",\"onMinimize\",\"onResizeEnd\",\"onResizeStart\",\"onRestore\",\"onCreate\",\"onReady\"];\n\t}", "function getChangeListeners() {\n const store = shareStore.get(this) || createStore(this);\n return store.changeListeners;\n }", "getAllListenersImpl(callback) {\n debug('getAllListenersImpl()');\n return this.pgUtils.getBy('webhook_listeners', [], [], {}, callback);\n }", "listeners(event) {\n return super.listeners(event);\n }", "function getListeners(topic) {\n topic = topic.toLowerCase();\n if (!topics[topic]) return []; // no such topic exists / no one interested\n \n const discoverableListners = [];\n for (const listener of topics[topic]) if (listener[DISCOVERABLE_FLAG]) discoverableListners.push(listener);\n return discoverableListners;\n}", "function getListeners(property){\n return listeners[property] || (listeners[property] = []);\n }", "get eventListeners() {\n\t\treturn [\"onChange\",\"onClose\",\"onClosing\",\"onDragEnd\",\"onDragStart\",\"onReorder\"];\n\t}", "static get listeners() {\n return {\n 'click': '_clickHandler',\n 'keydown': '_keyDownHandler'\n };\n }", "addListener(listener) {\n if (!activeListeners.includes(listener)) {\n activeListeners.push(listener);\n }\n }", "get eventListeners() {\n\t\treturn [\"onBeginUpdate\",\"onEndUpdate\",\"onChange\",\"onItemClick\",\"onItemInsert\",\"onItemRemove\",\"onItemUpdate\",\"onViewChange\",\"onViewChanging\",\"onEventShortcutKey\",\"onDateChange\",\"onDragStart\",\"onDragEnd\",\"onResizeStart\",\"onResizeEnd\",\"onEditDialogOpening\",\"onEditDialogOpen\",\"onEditDialogClose\",\"onEditDialogClosing\",\"onContextMenuOpening\",\"onContextMenuOpen\",\"onContextMenuClose\",\"onContextMenuClosing\",\"onEventMenuOpening\",\"onEventMenuOpen\",\"onEventMenuClose\",\"onEventMenuClosing\",\"onDateMenuOpen\",\"onDateMenuClose\",\"onViewMenuOpen\",\"onViewMenuClose\",\"onNotificationOpen\",\"onNotificationClose\"];\n\t}", "getAttenuatedEventEmitters (eventEmitters) {\n return eventEmitters.map(emitter => {\n return {\n eventNames: emitter.eventNames.bind(emitter),\n on: emitter.on.bind(emitter),\n removeListener: emitter.removeListener.bind(emitter),\n }\n })\n }", "rawListeners(eventName) {\n return this.listeners[eventName];\n }", "static get listeners() {\n return {\n 'resize': '_resizeHandler',\n 'backButton.click': '_backButtonClickHandler',\n 'filterInput.keyup': '_filterInputKeyupHandler',\n 'mainContainer.down': '_mainContainerDownHandler',\n 'mainContainer.move': '_mainContainerMoveHandler',\n 'mainContainer.swipeleft': '_mainContainerSwipeHandler',\n 'mainContainer.swiperight': '_mainContainerSwipeHandler',\n 'view.click': '_viewHandler',\n 'view.mouseout': '_viewHandler',\n 'view.mouseover': '_viewHandler',\n 'view.transitionend': '_viewHandler',\n 'view.wheel': '_wheelHandler'\n };\n }", "static get listeners() {\n return {\n 'keydown': '_keyHandler',\n 'keyup': '_keyHandler',\n 'dragstart': '_dragStartHandler',\n 'button.click': '_buttonClickHandler',\n 'button.mouseenter': '_buttonMouseEnterHandler',\n 'button.mouseleave': '_buttonMouseLeaveHandler',\n 'document.up': '_documentUpHandler'\n };\n }", "function getListeners(context) {\n return (context.$vnode ? context.$vnode.componentOptions.listeners : context.$listeners) || {};\n}", "function getListeners(context) {\n return (context.$vnode ? context.$vnode.componentOptions.listeners : context.$listeners) || {};\n}", "getCallbacksByRegisteredEvent(ev_type) {\n return this.callbacks_by_events[ev_type];\n }", "createListeners() {\n\n this.listenDeleteAllFiltersOptions();\n\n this.listenMainInputOnType();\n\n this.listenClickFilterOption();\n\n this.listenDeleteFilter();\n\n this.listenMainInputOnFocus();\n\n this.listenMainInputOnBlur();\n\n this.listenClickModalFilter();\n\n this.listenModalFilterOnBlur();\n\n this.listenModalFilterOnType();\n\n }", "function getCallbacks(target, delegate, eventType) {\n\tvar callbacks = [];\n\tif (target.delegateGroup && EVENT_CACHE[target.delegateGroup][eventType]) {\n\t\t_.each(EVENT_CACHE[target.delegateGroup][eventType], function (callbacksList, delegateId) {\n\t\t\tif (_.isArray(callbacksList) && (delegateId === delegate.delegateId || delegate.matchesSelector && delegate.matchesSelector(delegateId))) {\n\t\t\t\tcallbacks = callbacks.concat(callbacksList);\n\t\t\t}\n\t\t});\n\t}\n\treturn callbacks;\n}", "static get listeners() {\n return {\n 'mouseenter': '_mouseEnterHandler',\n 'mouseleave': '_mouseLeaveHandler',\n 'container.swipeleft': '_swipeHandler',\n 'container.swiperight': '_swipeHandler',\n 'container.swipetop': '_swipeHandler',\n 'container.swipebottom': '_swipeHandler'\n };\n }", "hookListeners(dispatchEvents, callback) {\n debug('hookListeners()');\n return this.hookListenersImpl(dispatchEvents, callback);\n }", "on(event, callback) {\n const names = event.split(\",\").map((x) => x.trim());\n for (const name of names) {\n this.listeners[name] = this.listeners[name] || [];\n this.listeners[name].push(callback);\n }\n return () => {\n for (const name of names) {\n this.listeners[name] = this.listeners[name].filter((fn) => {\n return fn !== callback;\n });\n }\n };\n }", "on(event, callback) {\n const names = event.split(\",\").map((x) => x.trim());\n for (const name of names) {\n this.listeners[name] = this.listeners[name] || [];\n this.listeners[name].push(callback);\n }\n return () => {\n for (const name of names) {\n this.listeners[name] = this.listeners[name].filter((fn) => {\n return fn !== callback;\n });\n }\n };\n }", "static get listeners() {\n return {\n 'cancelButton.click': 'cancel',\n 'clearButton.click': 'clear',\n 'filterButton.click': 'filter'\n };\n }", "static get listeners() {\n return {\n 'cancelButton.click': 'cancel',\n 'clearButton.click': 'clear',\n 'filterButton.click': 'filter'\n };\n }", "addListeners() {\n return dispatch => {\n Platform.prefs.addEventListener('message', prefs => dispatch(receive(c.RECEIVE_PREFS, prefs)));\n Platform.search.addEventListener('enginechange', event => {\n dispatch(receive(c.RECEIVE_CURRENT_SEARCH_ENGINE, {body: event.engine}));\n });\n Platform.search.addEventListener('visibleenginechange', event => {\n dispatch(receive(c.RECEIVE_VISIBLE_SEARCH_ENGINES, {body: event.engines}));\n });\n };\n }", "function watchedEvents(obj) {\n var meta$$1 = exports.peekMeta(obj);\n return meta$$1 && meta$$1.watchedEvents() || [];\n }", "static get listeners() {\n return {\n 'container.down': '_mouseDownHandler',\n 'document.move': '_drag',\n 'document.up': '_switchThumbDropHandler',\n 'mouseenter': '_switchButtonOnMouseEnter',\n 'mouseleave': '_switchButtonOnMouseLeave',\n 'resize': '_resizeHandler',\n 'container.resize': '_resizeHandler',\n 'document.selectstart': '_selectStartHandler'\n };\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n\n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n}", "function HasListeners() {}", "function searchListenerTree(handlers, type, tree, i) {\n\t if (!tree) {\n\t return [];\n\t }\n\t var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n\t typeLength = type.length, currentType = type[i], nextType = type[i+1];\n\t if (i === typeLength && tree._listeners) {\n\t //\n\t // If at the end of the event(s) list and the tree has listeners\n\t // invoke those listeners.\n\t //\n\t if (typeof tree._listeners === 'function') {\n\t handlers && handlers.push(tree._listeners);\n\t return [tree];\n\t } else {\n\t for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n\t handlers && handlers.push(tree._listeners[leaf]);\n\t }\n\t return [tree];\n\t }\n\t }\n\n\t if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n\t //\n\t // If the event emitted is '*' at this part\n\t // or there is a concrete match at this patch\n\t //\n\t if (currentType === '*') {\n\t for (branch in tree) {\n\t if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n\t listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n\t }\n\t }\n\t return listeners;\n\t } else if(currentType === '**') {\n\t endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n\t if(endReached && tree._listeners) {\n\t // The next element has a _listeners, add it to the handlers.\n\t listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n\t }\n\n\t for (branch in tree) {\n\t if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n\t if(branch === '*' || branch === '**') {\n\t if(tree[branch]._listeners && !endReached) {\n\t listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n\t }\n\t listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n\t } else if(branch === nextType) {\n\t listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n\t } else {\n\t // No match on this one, shift into the tree but not in the type array.\n\t listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n\t }\n\t }\n\t }\n\t return listeners;\n\t }\n\n\t listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n\t }\n\n\t xTree = tree['*'];\n\t if (xTree) {\n\t //\n\t // If the listener tree will allow any match for this part,\n\t // then recursively explore all branches of the tree\n\t //\n\t searchListenerTree(handlers, type, xTree, i+1);\n\t }\n\n\t xxTree = tree['**'];\n\t if(xxTree) {\n\t if(i < typeLength) {\n\t if(xxTree._listeners) {\n\t // If we have a listener on a '**', it will catch all, so add its handler.\n\t searchListenerTree(handlers, type, xxTree, typeLength);\n\t }\n\n\t // Build arrays of matching next branches and others.\n\t for(branch in xxTree) {\n\t if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n\t if(branch === nextType) {\n\t // We know the next element will match, so jump twice.\n\t searchListenerTree(handlers, type, xxTree[branch], i+2);\n\t } else if(branch === currentType) {\n\t // Current node matches, move into the tree.\n\t searchListenerTree(handlers, type, xxTree[branch], i+1);\n\t } else {\n\t isolatedBranch = {};\n\t isolatedBranch[branch] = xxTree[branch];\n\t searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n\t }\n\t }\n\t }\n\t } else if(xxTree._listeners) {\n\t // We have reached the end and still on a '**'\n\t searchListenerTree(handlers, type, xxTree, typeLength);\n\t } else if(xxTree['*'] && xxTree['*']._listeners) {\n\t searchListenerTree(handlers, type, xxTree['*'], typeLength);\n\t }\n\t }\n\n\t return listeners;\n\t }", "function searchListenerTree(handlers, type, tree, i) {\r\n if (!tree) {\r\n return [];\r\n }\r\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\r\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\r\n if (i === typeLength && tree._listeners) {\r\n //\r\n // If at the end of the event(s) list and the tree has listeners\r\n // invoke those listeners.\r\n //\r\n if (typeof tree._listeners === 'function') {\r\n handlers && handlers.push(tree._listeners);\r\n return [tree];\r\n } else {\r\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\r\n handlers && handlers.push(tree._listeners[leaf]);\r\n }\r\n return [tree];\r\n }\r\n }\r\n\r\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\r\n //\r\n // If the event emitted is '*' at this part\r\n // or there is a concrete match at this patch\r\n //\r\n if (currentType === '*') {\r\n for (branch in tree) {\r\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\r\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\r\n }\r\n }\r\n return listeners;\r\n } else if(currentType === '**') {\r\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\r\n if(endReached && tree._listeners) {\r\n // The next element has a _listeners, add it to the handlers.\r\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\r\n }\r\n\r\n for (branch in tree) {\r\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\r\n if(branch === '*' || branch === '**') {\r\n if(tree[branch]._listeners && !endReached) {\r\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\r\n }\r\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\r\n } else if(branch === nextType) {\r\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\r\n } else {\r\n // No match on this one, shift into the tree but not in the type array.\r\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\r\n }\r\n }\r\n }\r\n return listeners;\r\n }\r\n\r\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\r\n }\r\n\r\n xTree = tree['*'];\r\n if (xTree) {\r\n //\r\n // If the listener tree will allow any match for this part,\r\n // then recursively explore all branches of the tree\r\n //\r\n searchListenerTree(handlers, type, xTree, i+1);\r\n }\r\n\r\n xxTree = tree['**'];\r\n if(xxTree) {\r\n if(i < typeLength) {\r\n if(xxTree._listeners) {\r\n // If we have a listener on a '**', it will catch all, so add its handler.\r\n searchListenerTree(handlers, type, xxTree, typeLength);\r\n }\r\n\r\n // Build arrays of matching next branches and others.\r\n for(branch in xxTree) {\r\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\r\n if(branch === nextType) {\r\n // We know the next element will match, so jump twice.\r\n searchListenerTree(handlers, type, xxTree[branch], i+2);\r\n } else if(branch === currentType) {\r\n // Current node matches, move into the tree.\r\n searchListenerTree(handlers, type, xxTree[branch], i+1);\r\n } else {\r\n isolatedBranch = {};\r\n isolatedBranch[branch] = xxTree[branch];\r\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\r\n }\r\n }\r\n }\r\n } else if(xxTree._listeners) {\r\n // We have reached the end and still on a '**'\r\n searchListenerTree(handlers, type, xxTree, typeLength);\r\n } else if(xxTree['*'] && xxTree['*']._listeners) {\r\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\r\n }\r\n }\r\n\r\n return listeners;\r\n }", "function searchListenerTree(handlers, type, tree, i) {\r\n if (!tree) {\r\n return [];\r\n }\r\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\r\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\r\n if (i === typeLength && tree._listeners) {\r\n //\r\n // If at the end of the event(s) list and the tree has listeners\r\n // invoke those listeners.\r\n //\r\n if (typeof tree._listeners === 'function') {\r\n handlers && handlers.push(tree._listeners);\r\n return [tree];\r\n } else {\r\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\r\n handlers && handlers.push(tree._listeners[leaf]);\r\n }\r\n return [tree];\r\n }\r\n }\r\n\r\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\r\n //\r\n // If the event emitted is '*' at this part\r\n // or there is a concrete match at this patch\r\n //\r\n if (currentType === '*') {\r\n for (branch in tree) {\r\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\r\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\r\n }\r\n }\r\n return listeners;\r\n } else if(currentType === '**') {\r\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\r\n if(endReached && tree._listeners) {\r\n // The next element has a _listeners, add it to the handlers.\r\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\r\n }\r\n\r\n for (branch in tree) {\r\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\r\n if(branch === '*' || branch === '**') {\r\n if(tree[branch]._listeners && !endReached) {\r\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\r\n }\r\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\r\n } else if(branch === nextType) {\r\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\r\n } else {\r\n // No match on this one, shift into the tree but not in the type array.\r\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\r\n }\r\n }\r\n }\r\n return listeners;\r\n }\r\n\r\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\r\n }\r\n\r\n xTree = tree['*'];\r\n if (xTree) {\r\n //\r\n // If the listener tree will allow any match for this part,\r\n // then recursively explore all branches of the tree\r\n //\r\n searchListenerTree(handlers, type, xTree, i+1);\r\n }\r\n\r\n xxTree = tree['**'];\r\n if(xxTree) {\r\n if(i < typeLength) {\r\n if(xxTree._listeners) {\r\n // If we have a listener on a '**', it will catch all, so add its handler.\r\n searchListenerTree(handlers, type, xxTree, typeLength);\r\n }\r\n\r\n // Build arrays of matching next branches and others.\r\n for(branch in xxTree) {\r\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\r\n if(branch === nextType) {\r\n // We know the next element will match, so jump twice.\r\n searchListenerTree(handlers, type, xxTree[branch], i+2);\r\n } else if(branch === currentType) {\r\n // Current node matches, move into the tree.\r\n searchListenerTree(handlers, type, xxTree[branch], i+1);\r\n } else {\r\n isolatedBranch = {};\r\n isolatedBranch[branch] = xxTree[branch];\r\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\r\n }\r\n }\r\n }\r\n } else if(xxTree._listeners) {\r\n // We have reached the end and still on a '**'\r\n searchListenerTree(handlers, type, xxTree, typeLength);\r\n } else if(xxTree['*'] && xxTree['*']._listeners) {\r\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\r\n }\r\n }\r\n\r\n return listeners;\r\n }", "function searchListenerTree(handlers, type, tree, i) {\r\n if (!tree) {\r\n return [];\r\n }\r\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\r\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\r\n if (i === typeLength && tree._listeners) {\r\n //\r\n // If at the end of the event(s) list and the tree has listeners\r\n // invoke those listeners.\r\n //\r\n if (typeof tree._listeners === 'function') {\r\n handlers && handlers.push(tree._listeners);\r\n return [tree];\r\n } else {\r\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\r\n handlers && handlers.push(tree._listeners[leaf]);\r\n }\r\n return [tree];\r\n }\r\n }\r\n\r\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\r\n //\r\n // If the event emitted is '*' at this part\r\n // or there is a concrete match at this patch\r\n //\r\n if (currentType === '*') {\r\n for (branch in tree) {\r\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\r\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\r\n }\r\n }\r\n return listeners;\r\n } else if(currentType === '**') {\r\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\r\n if(endReached && tree._listeners) {\r\n // The next element has a _listeners, add it to the handlers.\r\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\r\n }\r\n\r\n for (branch in tree) {\r\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\r\n if(branch === '*' || branch === '**') {\r\n if(tree[branch]._listeners && !endReached) {\r\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\r\n }\r\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\r\n } else if(branch === nextType) {\r\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\r\n } else {\r\n // No match on this one, shift into the tree but not in the type array.\r\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\r\n }\r\n }\r\n }\r\n return listeners;\r\n }\r\n\r\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\r\n }\r\n\r\n xTree = tree['*'];\r\n if (xTree) {\r\n //\r\n // If the listener tree will allow any match for this part,\r\n // then recursively explore all branches of the tree\r\n //\r\n searchListenerTree(handlers, type, xTree, i+1);\r\n }\r\n\r\n xxTree = tree['**'];\r\n if(xxTree) {\r\n if(i < typeLength) {\r\n if(xxTree._listeners) {\r\n // If we have a listener on a '**', it will catch all, so add its handler.\r\n searchListenerTree(handlers, type, xxTree, typeLength);\r\n }\r\n\r\n // Build arrays of matching next branches and others.\r\n for(branch in xxTree) {\r\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\r\n if(branch === nextType) {\r\n // We know the next element will match, so jump twice.\r\n searchListenerTree(handlers, type, xxTree[branch], i+2);\r\n } else if(branch === currentType) {\r\n // Current node matches, move into the tree.\r\n searchListenerTree(handlers, type, xxTree[branch], i+1);\r\n } else {\r\n isolatedBranch = {};\r\n isolatedBranch[branch] = xxTree[branch];\r\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\r\n }\r\n }\r\n }\r\n } else if(xxTree._listeners) {\r\n // We have reached the end and still on a '**'\r\n searchListenerTree(handlers, type, xxTree, typeLength);\r\n } else if(xxTree['*'] && xxTree['*']._listeners) {\r\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\r\n }\r\n }\r\n\r\n return listeners;\r\n }", "function searchListenerTree(handlers, type, tree, i) {\r\n if (!tree) {\r\n return [];\r\n }\r\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\r\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\r\n if (i === typeLength && tree._listeners) {\r\n //\r\n // If at the end of the event(s) list and the tree has listeners\r\n // invoke those listeners.\r\n //\r\n if (typeof tree._listeners === 'function') {\r\n handlers && handlers.push(tree._listeners);\r\n return [tree];\r\n } else {\r\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\r\n handlers && handlers.push(tree._listeners[leaf]);\r\n }\r\n return [tree];\r\n }\r\n }\r\n\r\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\r\n //\r\n // If the event emitted is '*' at this part\r\n // or there is a concrete match at this patch\r\n //\r\n if (currentType === '*') {\r\n for (branch in tree) {\r\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\r\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\r\n }\r\n }\r\n return listeners;\r\n } else if(currentType === '**') {\r\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\r\n if(endReached && tree._listeners) {\r\n // The next element has a _listeners, add it to the handlers.\r\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\r\n }\r\n\r\n for (branch in tree) {\r\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\r\n if(branch === '*' || branch === '**') {\r\n if(tree[branch]._listeners && !endReached) {\r\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\r\n }\r\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\r\n } else if(branch === nextType) {\r\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\r\n } else {\r\n // No match on this one, shift into the tree but not in the type array.\r\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\r\n }\r\n }\r\n }\r\n return listeners;\r\n }\r\n\r\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\r\n }\r\n\r\n xTree = tree['*'];\r\n if (xTree) {\r\n //\r\n // If the listener tree will allow any match for this part,\r\n // then recursively explore all branches of the tree\r\n //\r\n searchListenerTree(handlers, type, xTree, i+1);\r\n }\r\n\r\n xxTree = tree['**'];\r\n if(xxTree) {\r\n if(i < typeLength) {\r\n if(xxTree._listeners) {\r\n // If we have a listener on a '**', it will catch all, so add its handler.\r\n searchListenerTree(handlers, type, xxTree, typeLength);\r\n }\r\n\r\n // Build arrays of matching next branches and others.\r\n for(branch in xxTree) {\r\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\r\n if(branch === nextType) {\r\n // We know the next element will match, so jump twice.\r\n searchListenerTree(handlers, type, xxTree[branch], i+2);\r\n } else if(branch === currentType) {\r\n // Current node matches, move into the tree.\r\n searchListenerTree(handlers, type, xxTree[branch], i+1);\r\n } else {\r\n isolatedBranch = {};\r\n isolatedBranch[branch] = xxTree[branch];\r\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\r\n }\r\n }\r\n }\r\n } else if(xxTree._listeners) {\r\n // We have reached the end and still on a '**'\r\n searchListenerTree(handlers, type, xxTree, typeLength);\r\n } else if(xxTree['*'] && xxTree['*']._listeners) {\r\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\r\n }\r\n }\r\n\r\n return listeners;\r\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n\n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n\n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n\n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n \n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n \n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n \n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n \n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n \n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n \n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n\n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n\n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n\n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n\n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n\n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n\n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n\n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n\n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n\n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n\n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "hasListeners(event) {\n if (isArray(event)) {\n for (const ev of event) {\n if (!this.hasListeners(ev)) {\n return false\n }\n }\n return event.length > 0\n } else {\n return !!this.listeners?.[event]\n }\n }", "function accumulateTwoPhaseListeners(targetFiber, reactName) {\n var captureName = reactName + 'Capture';\n var listeners = [];\n var instance = targetFiber; // Accumulate all instances and listeners via the target -> root path.\n while(instance !== null){\n var _instance3 = instance, stateNode = _instance3.stateNode, tag = _instance3.tag; // Handle listeners that are on HostComponents (i.e. <div>)\n if (tag === HostComponent && stateNode !== null) {\n var currentTarget = stateNode;\n var captureListener = getListener(instance, captureName);\n if (captureListener != null) listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));\n var bubbleListener = getListener(instance, reactName);\n if (bubbleListener != null) listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));\n }\n instance = instance.return;\n }\n return listeners;\n }", "function accumulateTwoPhaseListeners(targetFiber, reactName) {\n var captureName = reactName + 'Capture';\n var listeners = [];\n var instance = targetFiber; // Accumulate all instances and listeners via the target -> root path.\n\n while (instance !== null) {\n var _instance3 = instance,\n stateNode = _instance3.stateNode,\n tag = _instance3.tag; // Handle listeners that are on HostComponents (i.e. <div>)\n\n if (tag === HostComponent && stateNode !== null) {\n var currentTarget = stateNode;\n var captureListener = getListener(instance, captureName);\n\n if (captureListener != null) {\n listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));\n }\n\n var bubbleListener = getListener(instance, reactName);\n\n if (bubbleListener != null) {\n listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));\n }\n }\n\n instance = instance.return;\n }\n\n return listeners;\n}", "function accumulateTwoPhaseListeners(targetFiber, reactName) {\n var captureName = reactName + 'Capture';\n var listeners = [];\n var instance = targetFiber; // Accumulate all instances and listeners via the target -> root path.\n\n while (instance !== null) {\n var _instance3 = instance,\n stateNode = _instance3.stateNode,\n tag = _instance3.tag; // Handle listeners that are on HostComponents (i.e. <div>)\n\n if (tag === HostComponent && stateNode !== null) {\n var currentTarget = stateNode;\n var captureListener = getListener(instance, captureName);\n\n if (captureListener != null) {\n listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));\n }\n\n var bubbleListener = getListener(instance, reactName);\n\n if (bubbleListener != null) {\n listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));\n }\n }\n\n instance = instance.return;\n }\n\n return listeners;\n}", "function accumulateTwoPhaseListeners(targetFiber, reactName) {\n var captureName = reactName + 'Capture';\n var listeners = [];\n var instance = targetFiber; // Accumulate all instances and listeners via the target -> root path.\n\n while (instance !== null) {\n var _instance3 = instance,\n stateNode = _instance3.stateNode,\n tag = _instance3.tag; // Handle listeners that are on HostComponents (i.e. <div>)\n\n if (tag === HostComponent && stateNode !== null) {\n var currentTarget = stateNode;\n var captureListener = getListener(instance, captureName);\n\n if (captureListener != null) {\n listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));\n }\n\n var bubbleListener = getListener(instance, reactName);\n\n if (bubbleListener != null) {\n listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));\n }\n }\n\n instance = instance.return;\n }\n\n return listeners;\n}", "function accumulateTwoPhaseListeners(targetFiber, reactName) {\n var captureName = reactName + 'Capture';\n var listeners = [];\n var instance = targetFiber; // Accumulate all instances and listeners via the target -> root path.\n\n while (instance !== null) {\n var _instance3 = instance,\n stateNode = _instance3.stateNode,\n tag = _instance3.tag; // Handle listeners that are on HostComponents (i.e. <div>)\n\n if (tag === HostComponent && stateNode !== null) {\n var currentTarget = stateNode;\n var captureListener = getListener(instance, captureName);\n\n if (captureListener != null) {\n listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));\n }\n\n var bubbleListener = getListener(instance, reactName);\n\n if (bubbleListener != null) {\n listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));\n }\n }\n\n instance = instance.return;\n }\n\n return listeners;\n}", "function accumulateTwoPhaseListeners(targetFiber, reactName) {\n var captureName = reactName + 'Capture';\n var listeners = [];\n var instance = targetFiber; // Accumulate all instances and listeners via the target -> root path.\n\n while (instance !== null) {\n var _instance3 = instance,\n stateNode = _instance3.stateNode,\n tag = _instance3.tag; // Handle listeners that are on HostComponents (i.e. <div>)\n\n if (tag === HostComponent && stateNode !== null) {\n var currentTarget = stateNode;\n var captureListener = getListener(instance, captureName);\n\n if (captureListener != null) {\n listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));\n }\n\n var bubbleListener = getListener(instance, reactName);\n\n if (bubbleListener != null) {\n listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));\n }\n }\n\n instance = instance.return;\n }\n\n return listeners;\n}", "function accumulateTwoPhaseListeners(targetFiber, reactName) {\n var captureName = reactName + 'Capture';\n var listeners = [];\n var instance = targetFiber; // Accumulate all instances and listeners via the target -> root path.\n\n while (instance !== null) {\n var _instance3 = instance,\n stateNode = _instance3.stateNode,\n tag = _instance3.tag; // Handle listeners that are on HostComponents (i.e. <div>)\n\n if (tag === HostComponent && stateNode !== null) {\n var currentTarget = stateNode;\n var captureListener = getListener(instance, captureName);\n\n if (captureListener != null) {\n listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));\n }\n\n var bubbleListener = getListener(instance, reactName);\n\n if (bubbleListener != null) {\n listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));\n }\n }\n\n instance = instance.return;\n }\n\n return listeners;\n}", "function accumulateTwoPhaseListeners(targetFiber, reactName) {\n var captureName = reactName + 'Capture';\n var listeners = [];\n var instance = targetFiber; // Accumulate all instances and listeners via the target -> root path.\n\n while (instance !== null) {\n var _instance3 = instance,\n stateNode = _instance3.stateNode,\n tag = _instance3.tag; // Handle listeners that are on HostComponents (i.e. <div>)\n\n if (tag === HostComponent && stateNode !== null) {\n var currentTarget = stateNode;\n var captureListener = getListener(instance, captureName);\n\n if (captureListener != null) {\n listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));\n }\n\n var bubbleListener = getListener(instance, reactName);\n\n if (bubbleListener != null) {\n listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));\n }\n }\n\n instance = instance.return;\n }\n\n return listeners;\n}", "function accumulateTwoPhaseListeners(targetFiber, reactName) {\n var captureName = reactName + 'Capture';\n var listeners = [];\n var instance = targetFiber; // Accumulate all instances and listeners via the target -> root path.\n\n while (instance !== null) {\n var _instance3 = instance,\n stateNode = _instance3.stateNode,\n tag = _instance3.tag; // Handle listeners that are on HostComponents (i.e. <div>)\n\n if (tag === HostComponent && stateNode !== null) {\n var currentTarget = stateNode;\n var captureListener = getListener(instance, captureName);\n\n if (captureListener != null) {\n listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));\n }\n\n var bubbleListener = getListener(instance, reactName);\n\n if (bubbleListener != null) {\n listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));\n }\n }\n\n instance = instance.return;\n }\n\n return listeners;\n}", "function accumulateTwoPhaseListeners(targetFiber, reactName) {\n var captureName = reactName + 'Capture';\n var listeners = [];\n var instance = targetFiber; // Accumulate all instances and listeners via the target -> root path.\n\n while (instance !== null) {\n var _instance3 = instance,\n stateNode = _instance3.stateNode,\n tag = _instance3.tag; // Handle listeners that are on HostComponents (i.e. <div>)\n\n if (tag === HostComponent && stateNode !== null) {\n var currentTarget = stateNode;\n var captureListener = getListener(instance, captureName);\n\n if (captureListener != null) {\n listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));\n }\n\n var bubbleListener = getListener(instance, reactName);\n\n if (bubbleListener != null) {\n listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));\n }\n }\n\n instance = instance.return;\n }\n\n return listeners;\n}", "function accumulateTwoPhaseListeners(targetFiber, reactName) {\n var captureName = reactName + 'Capture';\n var listeners = [];\n var instance = targetFiber; // Accumulate all instances and listeners via the target -> root path.\n\n while (instance !== null) {\n var _instance3 = instance,\n stateNode = _instance3.stateNode,\n tag = _instance3.tag; // Handle listeners that are on HostComponents (i.e. <div>)\n\n if (tag === HostComponent && stateNode !== null) {\n var currentTarget = stateNode;\n var captureListener = getListener(instance, captureName);\n\n if (captureListener != null) {\n listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));\n }\n\n var bubbleListener = getListener(instance, reactName);\n\n if (bubbleListener != null) {\n listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));\n }\n }\n\n instance = instance.return;\n }\n\n return listeners;\n}", "function accumulateTwoPhaseListeners(targetFiber, reactName) {\n var captureName = reactName + 'Capture';\n var listeners = [];\n var instance = targetFiber; // Accumulate all instances and listeners via the target -> root path.\n\n while (instance !== null) {\n var _instance3 = instance,\n stateNode = _instance3.stateNode,\n tag = _instance3.tag; // Handle listeners that are on HostComponents (i.e. <div>)\n\n if (tag === HostComponent && stateNode !== null) {\n var currentTarget = stateNode;\n var captureListener = getListener(instance, captureName);\n\n if (captureListener != null) {\n listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));\n }\n\n var bubbleListener = getListener(instance, reactName);\n\n if (bubbleListener != null) {\n listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));\n }\n }\n\n instance = instance.return;\n }\n\n return listeners;\n}", "function accumulateTwoPhaseListeners(targetFiber, reactName) {\n var captureName = reactName + 'Capture';\n var listeners = [];\n var instance = targetFiber; // Accumulate all instances and listeners via the target -> root path.\n\n while (instance !== null) {\n var _instance3 = instance,\n stateNode = _instance3.stateNode,\n tag = _instance3.tag; // Handle listeners that are on HostComponents (i.e. <div>)\n\n if (tag === HostComponent && stateNode !== null) {\n var currentTarget = stateNode;\n var captureListener = getListener(instance, captureName);\n\n if (captureListener != null) {\n listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));\n }\n\n var bubbleListener = getListener(instance, reactName);\n\n if (bubbleListener != null) {\n listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));\n }\n }\n\n instance = instance.return;\n }\n\n return listeners;\n}", "function accumulateTwoPhaseListeners(targetFiber, reactName) {\n var captureName = reactName + 'Capture';\n var listeners = [];\n var instance = targetFiber; // Accumulate all instances and listeners via the target -> root path.\n\n while (instance !== null) {\n var _instance3 = instance,\n stateNode = _instance3.stateNode,\n tag = _instance3.tag; // Handle listeners that are on HostComponents (i.e. <div>)\n\n if (tag === HostComponent && stateNode !== null) {\n var currentTarget = stateNode;\n var captureListener = getListener(instance, captureName);\n\n if (captureListener != null) {\n listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));\n }\n\n var bubbleListener = getListener(instance, reactName);\n\n if (bubbleListener != null) {\n listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));\n }\n }\n\n instance = instance.return;\n }\n\n return listeners;\n}", "function accumulateTwoPhaseListeners(targetFiber, reactName) {\n var captureName = reactName + 'Capture';\n var listeners = [];\n var instance = targetFiber; // Accumulate all instances and listeners via the target -> root path.\n\n while (instance !== null) {\n var _instance3 = instance,\n stateNode = _instance3.stateNode,\n tag = _instance3.tag; // Handle listeners that are on HostComponents (i.e. <div>)\n\n if (tag === HostComponent && stateNode !== null) {\n var currentTarget = stateNode;\n var captureListener = getListener(instance, captureName);\n\n if (captureListener != null) {\n listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));\n }\n\n var bubbleListener = getListener(instance, reactName);\n\n if (bubbleListener != null) {\n listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));\n }\n }\n\n instance = instance.return;\n }\n\n return listeners;\n}", "function accumulateTwoPhaseListeners(targetFiber, reactName) {\n var captureName = reactName + 'Capture';\n var listeners = [];\n var instance = targetFiber; // Accumulate all instances and listeners via the target -> root path.\n\n while (instance !== null) {\n var _instance3 = instance,\n stateNode = _instance3.stateNode,\n tag = _instance3.tag; // Handle listeners that are on HostComponents (i.e. <div>)\n\n if (tag === HostComponent && stateNode !== null) {\n var currentTarget = stateNode;\n var captureListener = getListener(instance, captureName);\n\n if (captureListener != null) {\n listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));\n }\n\n var bubbleListener = getListener(instance, reactName);\n\n if (bubbleListener != null) {\n listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));\n }\n }\n\n instance = instance.return;\n }\n\n return listeners;\n}", "function getListeners(bot, leagueName, sources, event) {\n return Q.fcall(function() {\n sources = _.map(sources, _.toLower);\n // These are names of users, not users. So we have to go get the real\n // user and teams. This is somewhat wasteful - but I'm not sure whether\n // this is the right design or if we should pass in users to this point. \n var _league = league.getLeague(bot, leagueName);\n var teamNames = _(sources).map(function(n) { return _league.getTeamByPlayerName(n); }).filter(_.isObject).map(\"name\").map(_.toLower).value();\n var possibleSources = _.concat(sources, teamNames);\n return db.Subscription.findAll({\n where: {\n league: leagueName.toLowerCase(),\n source: {\n $in: possibleSources\n },\n event: event.toLowerCase()\n }\n }).then(function(subscriptions) {\n return _(subscriptions).map(\"target\").uniq().value();\n });\n });\n}", "function accumulateTwoPhaseListeners(targetFiber, reactName) {\n var captureName = reactName + 'Capture';\n var listeners = [];\n var instance = targetFiber; // Accumulate all instances and listeners via the target -> root path.\n\n while (instance !== null) {\n var _instance3 = instance,\n stateNode = _instance3.stateNode,\n tag = _instance3.tag; // Handle listeners that are on HostComponents (i.e. <div>)\n\n if (tag === HostComponent && stateNode !== null) {\n var currentTarget = stateNode;\n var captureListener = getListener(instance, captureName);\n\n if (captureListener != null) {\n listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));\n }\n\n var bubbleListener = getListener(instance, reactName);\n\n if (bubbleListener != null) {\n listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));\n }\n }\n\n instance = instance.return;\n }\n\n return listeners;\n }", "function accumulateTwoPhaseListeners(targetFiber, reactName) {\n var captureName = reactName + 'Capture';\n var listeners = [];\n var instance = targetFiber; // Accumulate all instances and listeners via the target -> root path.\n\n while (instance !== null) {\n var _instance3 = instance,\n stateNode = _instance3.stateNode,\n tag = _instance3.tag; // Handle listeners that are on HostComponents (i.e. <div>)\n\n if (tag === HostComponent && stateNode !== null) {\n var currentTarget = stateNode;\n var captureListener = getListener(instance, captureName);\n\n if (captureListener != null) {\n listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));\n }\n\n var bubbleListener = getListener(instance, reactName);\n\n if (bubbleListener != null) {\n listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));\n }\n }\n\n instance = instance.return;\n }\n\n return listeners;\n }", "function accumulateTwoPhaseListeners(targetFiber, reactName) {\n var captureName = reactName + 'Capture';\n var listeners = [];\n var instance = targetFiber; // Accumulate all instances and listeners via the target -> root path.\n\n while (instance !== null) {\n var _instance3 = instance,\n stateNode = _instance3.stateNode,\n tag = _instance3.tag; // Handle listeners that are on HostComponents (i.e. <div>)\n\n if (tag === HostComponent && stateNode !== null) {\n var currentTarget = stateNode;\n var captureListener = getListener(instance, captureName);\n\n if (captureListener != null) {\n listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));\n }\n\n var bubbleListener = getListener(instance, reactName);\n\n if (bubbleListener != null) {\n listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));\n }\n }\n\n instance = instance.return;\n }\n\n return listeners;\n }", "function accumulateTwoPhaseListeners(targetFiber, reactName) {\n var captureName = reactName + 'Capture';\n var listeners = [];\n var instance = targetFiber; // Accumulate all instances and listeners via the target -> root path.\n\n while (instance !== null) {\n var _instance3 = instance,\n stateNode = _instance3.stateNode,\n tag = _instance3.tag; // Handle listeners that are on HostComponents (i.e. <div>)\n\n if (tag === HostComponent && stateNode !== null) {\n var currentTarget = stateNode;\n var captureListener = getListener(instance, captureName);\n\n if (captureListener != null) {\n listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));\n }\n\n var bubbleListener = getListener(instance, reactName);\n\n if (bubbleListener != null) {\n listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));\n }\n }\n\n instance = instance.return;\n }\n\n return listeners;\n }", "function accumulateTwoPhaseListeners(targetFiber, reactName) {\n var captureName = reactName + 'Capture';\n var listeners = [];\n var instance = targetFiber;\n // Accumulate all instances and listeners via the target -> root path.\n while (instance !== null) {\n var _instance3 = instance, stateNode = _instance3.stateNode, tag = _instance3.tag;\n // Handle listeners that are on HostComponents (i.e. <div>)\n if (tag === HostComponent && stateNode !== null) {\n var currentTarget = stateNode;\n var captureListener = getListener(instance, captureName);\n if (captureListener != null) {\n listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));\n }\n var bubbleListener = getListener(instance, reactName);\n if (bubbleListener != null) {\n listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));\n }\n }\n instance = instance.return;\n }\n return listeners;\n }", "getTopics() {\n return Object.keys(this.listeners);\n }", "addListener(array, callback) {\n if ( typeof callback == 'function') {\n array.push(callback);\n }\n }", "listen(listener) {\n this._listeners.push(listener);\n\n return () => {\n this._listeners = this._listeners.filter(registered => {\n return listener !== registered;\n });\n };\n }", "function addListenersForRecording() {\n var events = params.events;\n for (var eventType in events) {\n var listOfEvents = events[eventType];\n for (var e in listOfEvents) {\n listOfEvents[e] = true;\n document.addEventListener(e, processEvent, true);\n }\n }\n}", "function listenArrayEvents(array, listener) {\n if (array._chartjs) {\n array._chartjs.listeners.push(listener);\n\n return;\n }\n\n Object.defineProperty(array, '_chartjs', {\n configurable: true,\n enumerable: false,\n value: {\n listeners: [listener]\n }\n });\n arrayEvents.forEach(function (key) {\n var method = 'onData' + key.charAt(0).toUpperCase() + key.slice(1);\n var base = array[key];\n Object.defineProperty(array, key, {\n configurable: true,\n enumerable: false,\n value: function () {\n var args = Array.prototype.slice.call(arguments);\n var res = base.apply(this, args);\n helpers$1.each(array._chartjs.listeners, function (object) {\n if (typeof object[method] === 'function') {\n object[method].apply(object, args);\n }\n });\n return res;\n }\n });\n });\n }", "function listenArrayEvents(array, listener) {\n if (array._chartjs) {\n array._chartjs.listeners.push(listener);\n\n return;\n }\n\n Object.defineProperty(array, '_chartjs', {\n configurable: true,\n enumerable: false,\n value: {\n listeners: [listener]\n }\n });\n arrayEvents.forEach(function (key) {\n var method = 'onData' + key.charAt(0).toUpperCase() + key.slice(1);\n var base = array[key];\n Object.defineProperty(array, key, {\n configurable: true,\n enumerable: false,\n value: function value() {\n var args = Array.prototype.slice.call(arguments);\n var res = base.apply(this, args);\n helpers$1.each(array._chartjs.listeners, function (object) {\n if (typeof object[method] === 'function') {\n object[method].apply(object, args);\n }\n });\n return res;\n }\n });\n });\n }", "function getCallbacksListsForNamespace( source, eventName ) {\n\tconst eventNode = getEvents( source )[ eventName ];\n\n\tif ( !eventNode ) {\n\t\treturn [];\n\t}\n\n\tlet callbacksLists = [ eventNode.callbacks ];\n\n\tfor ( let i = 0; i < eventNode.childEvents.length; i++ ) {\n\t\tconst childCallbacksLists = getCallbacksListsForNamespace( source, eventNode.childEvents[ i ] );\n\n\t\tcallbacksLists = callbacksLists.concat( childCallbacksLists );\n\t}\n\n\treturn callbacksLists;\n}", "static get EventListener() {\n return {\n onSettingsChanged: 'onSettingsChanged', // ...\n onBookmarksChanged: 'onBookmarksChanged', // ...\n onChaptermarksChanged: 'onChaptermarksChanged', // ...\n onMangaStatusChanged: 'onMangaStatusChanged', // ...\n onChapterStatusChanged: 'onChapterStatusChanged', // ...\n onDownloadStatusUpdated: 'onDownloadStatusUpdated', // ...\n onRequestChapterUp: 'onRequestChapterUp', // ...\n onRequestChapterDown: 'onRequestChapterDown' // ...\n };\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n let listeners=[], typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners && tree._listeners.length) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n handlers && Array.prototype.push.apply(handlers, tree._listeners);\n return [tree];\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (const branch in tree) {\n if (branch !== '_listeners' && branch !== '_parent' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n const endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners && tree._listeners.length) {\n // The next element has a _listeners, add it to the listeners.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (const branch in tree) {\n if (branch !== '_listeners' && branch !== '_parent' && tree.hasOwnProperty(branch)) {\n if (branch === '*' || branch === '**') {\n if (tree[branch]._listeners && tree[branch]._listeners.length && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if (branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n const xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n\n const xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners && xxTree._listeners.length) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n for(const branch in xxTree) {\n if(branch !== '_listeners' && branch !== '_parent' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n const isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners && xxTree._listeners.length) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners.length) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function listenArrayEvents(array, listener) {\n\t\t\tif (array._chartjs) {\n\t\t\t\tarray._chartjs.listeners.push(listener);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tObject.defineProperty(array, '_chartjs', {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: false,\n\t\t\t\tvalue: {\n\t\t\t\t\tlisteners: [listener]\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tarrayEvents.forEach(function(key) {\n\t\t\t\tvar method = 'onData' + key.charAt(0).toUpperCase() + key.slice(1);\n\t\t\t\tvar base = array[key];\n\n\t\t\t\tObject.defineProperty(array, key, {\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\tenumerable: false,\n\t\t\t\t\tvalue: function() {\n\t\t\t\t\t\tvar args = Array.prototype.slice.call(arguments);\n\t\t\t\t\t\tvar res = base.apply(this, args);\n\n\t\t\t\t\t\thelpers.each(array._chartjs.listeners, function(object) {\n\t\t\t\t\t\t\tif (typeof object[method] === 'function') {\n\t\t\t\t\t\t\t\tobject[method].apply(object, args);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\treturn res;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}", "getEventsByType(type) {\n var output = [];\n this.events.forEach(function(ev) {\n if(ev.getEvent() instanceof type) {\n output.push(ev);\n }\n });\n return output;\n }", "function getCallbacksForEvent( source, eventName ) {\n\tlet event;\n\n\tif ( !source._events || !( event = source._events[ eventName ] ) || !event.callbacks.length ) {\n\t\t// There are no callbacks registered for specified eventName.\n\t\t// But this could be a specific-type event that is in a namespace.\n\t\tif ( eventName.indexOf( ':' ) > -1 ) {\n\t\t\t// If the eventName is specific, try to find callback lists for more generic event.\n\t\t\treturn getCallbacksForEvent( source, eventName.substr( 0, eventName.lastIndexOf( ':' ) ) );\n\t\t} else {\n\t\t\t// If this is a top-level generic event, return null;\n\t\t\treturn null;\n\t\t}\n\t}\n\n\treturn event.callbacks;\n}", "function listenArrayEvents(array, listener) {\n\tif (array._chartjs) {\n\t\tarray._chartjs.listeners.push(listener);\n\t\treturn;\n\t}\n\n\tObject.defineProperty(array, '_chartjs', {\n\t\tconfigurable: true,\n\t\tenumerable: false,\n\t\tvalue: {\n\t\t\tlisteners: [listener]\n\t\t}\n\t});\n\n\tarrayEvents.forEach(function(key) {\n\t\tvar method = 'onData' + key.charAt(0).toUpperCase() + key.slice(1);\n\t\tvar base = array[key];\n\n\t\tObject.defineProperty(array, key, {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: false,\n\t\t\tvalue: function() {\n\t\t\t\tvar args = Array.prototype.slice.call(arguments);\n\t\t\t\tvar res = base.apply(this, args);\n\n\t\t\t\thelpers$1.each(array._chartjs.listeners, function(object) {\n\t\t\t\t\tif (typeof object[method] === 'function') {\n\t\t\t\t\t\tobject[method].apply(object, args);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\treturn res;\n\t\t\t}\n\t\t});\n\t});\n}", "function listenArrayEvents(array, listener) {\n\tif (array._chartjs) {\n\t\tarray._chartjs.listeners.push(listener);\n\t\treturn;\n\t}\n\n\tObject.defineProperty(array, '_chartjs', {\n\t\tconfigurable: true,\n\t\tenumerable: false,\n\t\tvalue: {\n\t\t\tlisteners: [listener]\n\t\t}\n\t});\n\n\tarrayEvents.forEach(function(key) {\n\t\tvar method = 'onData' + key.charAt(0).toUpperCase() + key.slice(1);\n\t\tvar base = array[key];\n\n\t\tObject.defineProperty(array, key, {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: false,\n\t\t\tvalue: function() {\n\t\t\t\tvar args = Array.prototype.slice.call(arguments);\n\t\t\t\tvar res = base.apply(this, args);\n\n\t\t\t\thelpers$1.each(array._chartjs.listeners, function(object) {\n\t\t\t\t\tif (typeof object[method] === 'function') {\n\t\t\t\t\t\tobject[method].apply(object, args);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\treturn res;\n\t\t\t}\n\t\t});\n\t});\n}", "function listenArrayEvents(array, listener) {\n\tif (array._chartjs) {\n\t\tarray._chartjs.listeners.push(listener);\n\t\treturn;\n\t}\n\n\tObject.defineProperty(array, '_chartjs', {\n\t\tconfigurable: true,\n\t\tenumerable: false,\n\t\tvalue: {\n\t\t\tlisteners: [listener]\n\t\t}\n\t});\n\n\tarrayEvents.forEach(function(key) {\n\t\tvar method = 'onData' + key.charAt(0).toUpperCase() + key.slice(1);\n\t\tvar base = array[key];\n\n\t\tObject.defineProperty(array, key, {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: false,\n\t\t\tvalue: function() {\n\t\t\t\tvar args = Array.prototype.slice.call(arguments);\n\t\t\t\tvar res = base.apply(this, args);\n\n\t\t\t\thelpers$1.each(array._chartjs.listeners, function(object) {\n\t\t\t\t\tif (typeof object[method] === 'function') {\n\t\t\t\t\t\tobject[method].apply(object, args);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\treturn res;\n\t\t\t}\n\t\t});\n\t});\n}" ]
[ "0.71215725", "0.71215725", "0.71215725", "0.68107253", "0.6782971", "0.6774838", "0.6745852", "0.66891485", "0.6687362", "0.6560062", "0.6491802", "0.6485784", "0.6368906", "0.6306218", "0.6273138", "0.6254611", "0.6251891", "0.6233837", "0.61943555", "0.60552526", "0.59999776", "0.59758085", "0.5967908", "0.59102243", "0.59068614", "0.5872292", "0.5872292", "0.585332", "0.58354837", "0.58313334", "0.58220136", "0.580682", "0.5802492", "0.5802492", "0.5792474", "0.5792474", "0.57924396", "0.5783181", "0.57341087", "0.57319087", "0.5700107", "0.569868", "0.5671857", "0.5671857", "0.5671857", "0.5671857", "0.56605405", "0.56605405", "0.56605405", "0.56605405", "0.56605405", "0.56605405", "0.56605405", "0.56605405", "0.56605405", "0.56605405", "0.56605405", "0.56605405", "0.56605405", "0.56605405", "0.56605405", "0.56605405", "0.5642236", "0.5641613", "0.5641547", "0.5641547", "0.5641547", "0.5641547", "0.5641547", "0.5641547", "0.5641547", "0.5641547", "0.5641547", "0.5641547", "0.5641547", "0.5641547", "0.5641547", "0.5641547", "0.5641547", "0.56402445", "0.5633832", "0.5633832", "0.5633832", "0.5633832", "0.5626837", "0.5625148", "0.55822897", "0.55822873", "0.55743825", "0.5572015", "0.55323815", "0.55319905", "0.5518301", "0.55179566", "0.5510251", "0.55101234", "0.5506406", "0.55047256", "0.55047256", "0.55047256" ]
0.6921147
3
Adds the `listener` function as an event listener for `ev`.
on(ev, listener) { super.on(ev, listener); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addListener(event, listener) {\n this.ee.addListener(event, listener);\n }", "function _on (event, listener) {\n if (typeof _events[event] !== 'object') {\n _events[event] = [];\n }\n\n _events[event].push(listener);\n }", "static addListener(listener) {\n listeners.push(listener);\n }", "addListener(eventName, listener) {\n return this.on(eventName, listener);\n }", "addListener(listener) {\n this.listeners.push(listener);\n }", "addListener(listener) {\n this.listeners.push(listener);\n }", "function _add_event_listener(el, eventname, fn){\r\n if (el.addEventListener === undefined){\r\n el.attachEvent('on' + eventname, fn);\r\n }\r\n else {\r\n el.addEventListener(eventname, fn);\r\n }\r\n}", "addListener(listener) {\n listeners.push(listener);\n }", "function addEventListener(eventName, listener){\n\t\tconsole.log(\"addEventListener: \" + eventName);\n\t\t\n\t\tif(mEventListeners[eventName] === undefined)\n\t\t\tmEventListeners[eventName] = [];\n\t\t\t\n\t\tmEventListeners[eventName].push(listener);\n\t}", "on(event: string, listener: Function): void {\n if (typeof this.__events[event] !== 'object') {\n this.__events[event] = [];\n }\n\n this.__events[event].push(listener);\n }", "addEventListener(target, type, listener, options) {\n this.log(`Adding \"${type}\" eventlistener`, target);\n \n const boundListener = listener.bind(this);\n target.addEventListener(type, boundListener, options);\n this.eventListeners.push({target, type, listener, boundListener});\n }", "addEventListener(target, type, listener, options) {\n this.log(`Adding \"${type}\" eventlistener`, target);\n\n const boundListener = listener.bind(this);\n target.addEventListener(type, boundListener, options);\n this.eventListeners.push({ target, type, listener, boundListener });\n }", "registerSpanEventListener(listener) {\n this.eventListenersLocal.push(listener);\n }", "function subscribe(listener) {\n listeners.push(listener);\n }", "function registerListener(_listener_, id){\n listeners[id] = _listener_;\n }", "function addListener(listener) {\n listeners.push(listener);\n\n if(!watchId) {\n startWatching();\n }\n else if(cachedGeo) {\n setTimeout(function() {\n handleEvent(cachedGeo);\n }, 0);\n }\n }", "function addListener(event, listener) {\n localListeners.push({\n event: event,\n listener: listener\n });\n return _bar.pool.addListener(event, listener);\n }", "function addListener(target, eventType, fn) {\n\t\ttarget.attachEvent(eventType, fn);\n\t\tlistenersArr[listenersArr.length] = [target, eventType, fn];\n\t}", "function addListener(target, eventType, fn) {\n\t\ttarget.attachEvent(eventType, fn);\n\t\tlistenersArr[listenersArr.length] = [target, eventType, fn];\n\t}", "function addListener(target, eventType, fn) {\n\t\ttarget.attachEvent(eventType, fn);\n\t\tlistenersArr[listenersArr.length] = [target, eventType, fn];\n\t}", "function addListener(target, eventType, fn) {\n\t\ttarget.attachEvent(eventType, fn);\n\t\tlistenersArr[listenersArr.length] = [target, eventType, fn];\n\t}", "subscribeToEvent(eventName, listener){\n this._eventEmmiter.on(eventName, listener);\n }", "addEventListener (f) {\n this.eventListeners.push(f)\n }", "function subscribe(listener) {\r\n subscribers.push(listener);\r\n }", "addListener(cb) {\n this.listeners.push(cb)\n }", "function addListener(target, eventType, fn) {\n target.attachEvent(eventType, fn);\n listenersArr[listenersArr.length] = [target, eventType, fn];\n }", "function addListener(target, eventType, fn) {\n target.attachEvent(eventType, fn);\n listenersArr[listenersArr.length] = [target, eventType, fn];\n }", "function addListener(target, eventType, fn) {\n target.attachEvent(eventType, fn);\n listenersArr[listenersArr.length] = [target, eventType, fn];\n }", "function addListener(target, eventType, fn) {\n target.attachEvent(eventType, fn);\n listenersArr[listenersArr.length] = [target, eventType, fn];\n }", "on(event, listener, emitter = this._defaultEmitter()) {\n emitter.on(event, listener);\n }", "function addEventListener(event, listener) {\n var list;\n\n if (listener === undefined ||\n typeof listener !== \"function\" ||\n typeof event !== \"string\") {\n\n // error condition\n // return false;\n throw new TypeError(\"EventEmitter: addEventListener requires a string and a function as arguments\");\n }\n\n if (this._listeners === undefined) {\n this._listeners = {};\n this._listeners[event] = [listener];\n return true;\n }\n\n list = this._listeners[event];\n\n if (list === undefined) {\n this._listeners[event] = [listener];\n return true;\n }\n\n if (list.indexOf(listener) < 0) {\n list.push(listener);\n return true;\n }\n\n // The listener already existed\n return false;\n}", "function addEventHandler(target, evtype, listener) {\n if (window.attachEvent) {\n target.attachEvent(\"on\" + evtype, listener); // can return boolean\n } else {\n target.addEventListener(evtype, listener, false); // returns void\n }\n}", "listen(listener) {\n this._listeners.push(listener);\n\n return () => {\n this._listeners = this._listeners.filter(registered => {\n return listener !== registered;\n });\n };\n }", "listen(listener) {\n this._listeners.push(listener);\n return () => {\n this._listeners = this._listeners.filter((registered) => {\n return listener !== registered;\n });\n };\n }", "listen(listener) {\n this._listeners.push(listener);\n return () => {\n this._listeners = this._listeners.filter((registered) => {\n return listener !== registered;\n });\n };\n }", "addListener(eventName, handler) {\r\n if (eventName in this.events === false) this.events[eventName] = [];\r\n\r\n this.events[eventName].push(handler);\r\n }", "function callListener(listener, event) {\n // Following behavior of :\n // func.handleEvent = func2;\n // element.addEventListener(\"type\", func);\n try {\n if (typeof listener === \"function\") return listener(event);\n else if (typeof listener.handleEvent === \"function\") return listener.handleEvent(event);\n } catch (e) {\n try { console.error(e); } catch (ignore) {}\n }\n }", "addListener(listener) {\r\n if (IDataListener_1.isDataListener(listener) && this.listeners.indexOf(listener) === -1) {\r\n this.listeners.push(listener);\r\n listener.registerRemover(() => {\r\n const index = this.listeners.indexOf(listener);\r\n if (index !== -1)\r\n this.listeners.splice(index, 1);\r\n });\r\n }\r\n }", "function addOnEvent(eventListener) {\n eventQueue.push(eventListener);\n }", "function addNativeNodeListener (node, eventName, handler) {\n if (isNullOrUndefined(node.data.on)) {\n node.data.on = {};\n }\n\n mergeVNodeListeners(node.data.on, eventName, handler);\n}", "function addNativeNodeListener (node, eventName, handler) {\n if (isNullOrUndefined(node.data.on)) {\n node.data.on = {};\n }\n\n mergeVNodeListeners(node.data.on, eventName, handler);\n}", "function addNativeNodeListener (node, eventName, handler) {\n if (isNullOrUndefined(node.data.on)) {\n node.data.on = {};\n }\n\n mergeVNodeListeners(node.data.on, eventName, handler);\n}", "function addNativeNodeListener (node, eventName, handler) {\n if (isNullOrUndefined(node.data.on)) {\n node.data.on = {};\n }\n\n mergeVNodeListeners(node.data.on, eventName, handler);\n}", "function addNativeNodeListener (node, eventName, handler) {\n if (isNullOrUndefined(node.data.on)) {\n node.data.on = {};\n }\n\n mergeVNodeListeners(node.data.on, eventName, handler);\n}", "function addNativeNodeListener (node, eventName, handler) {\n if (isNullOrUndefined(node.data.on)) {\n node.data.on = {};\n }\n\n mergeVNodeListeners(node.data.on, eventName, handler);\n}", "function add_ev(node, event, f) {\n var eventHandler = function(e) { change_world(function(w, k) { f(w, e, k); },\n doNothing); };\n attachEvent(node, event, eventHandler);\n eventDetachers.push(function() { detachEvent(node, event, eventHandler); });\n }", "function add_ev(node, event, f) {\n var eventHandler = function(e) { change_world(function(w, k) { f(w, e, k); },\n doNothing); };\n attachEvent(node, event, eventHandler);\n eventDetachers.push(function() { detachEvent(node, event, eventHandler); });\n }", "addListener(listener) {\n if (!activeListeners.includes(listener)) {\n activeListeners.push(listener);\n }\n }", "registerListener(listener) {\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_elasticloadbalancingv2_INetworkListener(listener);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, this.registerListener);\n }\n throw error;\n }\n this.loadBalancerAttachedDependencies.add(listener);\n this.listeners.push(listener);\n }", "on(ev, fn) {\n this.emitter.on(ev, fn);\n }", "on(event, listener) {\n return super.on(event, listener);\n }", "function Listener(callback) {\n var listener = callback;\n listener.onArr = function (arr,eventName) {\n if (arr.length < 2 ) {throw \"Invalid argument: At least two elements in the Array are expected!\"}\n if(!eventName || !eventName.split) {throw 'Invalid argument: Event name is missing or an invalid type!'}\n var l = arr.length, arr = [].concat(arr);\n while (l--) {\n arr.each_(function (a,b) {\n this.on(a,b,eventName)\n }.bind(this,arr.shift()));\n }\n };\n //\n listener.on = function (a,b,eventName) {\n if(!a || !b) { throw 'Invalid arguments: Both event emitters are required!' }\n if(!eventName || !eventName.split ) {throw 'Invalid argument: Event name is missing or is invalid type.'}\n // TODO: Make sure no duplicates being added\n (a.on || a.addEventListener).call(a,eventName, function () {\n var args = [].slice.call(arguments);\n args.splice(0,0,{origin: a, target: b});\n this.apply(b,args); // call Listener right here\n }.bind(this));\n (b.on || b.addEventListener).call(b,eventName, function () {\n var args = [].slice.call(arguments);\n args.splice(0,0,{origin: b, target: a});\n this.apply(a,args); // call Listener right here\n }.bind(this))\n };\n return listener\n}", "function addListener(evnt, func) {\n if (window.addEventListener) {\n window.addEventListener(evnt, func, false); \n } else if (window.attachEvent) window.attachEvent('on' + evnt, func);\n}", "function addNativeNodeListener(node, eventName, handler) {\n /* istanbul ignore next */\n if (!node.data) {\n node.data = {};\n }\n if (isNullOrUndefined(node.data.on)) {\n node.data.on = {};\n }\n mergeVNodeListeners(node.data.on, eventName, handler);\n }", "function addEvent(sEvent, oElement, fListener) {\n try {\n oElement.addEventListener(sEvent, fListener, false);\n } catch (error) {\n\n }\n}", "function addNativeNodeListener(node, eventName, handler) {\n /* istanbul ignore next */\n if (!node.data) {\n node.data = {};\n }\n if (isNullOrUndefined(node.data.on)) {\n node.data.on = {};\n }\n mergeVNodeListeners(node.data.on, eventName, handler);\n}", "function addNativeNodeListener(node, eventName, handler) {\n /* istanbul ignore next */\n if (!node.data) {\n node.data = {};\n }\n if (isNullOrUndefined(node.data.on)) {\n node.data.on = {};\n }\n mergeVNodeListeners(node.data.on, eventName, handler);\n}", "[addDivListener](event, listener) {\n this.htmlDiv.addEventListener(event, listener);\n }", "function addListener(elem, eventName, handler) {\n if(elem) \n elem.addEventListener(eventName, handler, false);\n else if(elem.attachEvent) \n elem.attachEvent('on' + eventName, handler);\n else \n elem['on' + eventName] = handler;\n}", "subscribe(listener) {\n\t\t\tlisteners.push(listener);\n\t\t\treturn () => { unsubscribe(listener); };\n\t\t}", "subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }", "function eventListener(id, eventType, hit, callback)\n{\n \n this.id=id;\t// unique sequential id so people can cancel\n this.eventType=eventType;\n this.hit=hit; // call with x,y to see if they really want it\n this.callback=callback; // pass event to here\n this.toString=function() {\n\treturn 'eventListener('+id+','+eventType+','+hit+','+'callback'+')'; }\n}", "addListener(changeListener) {\n this.changeListeners.push(changeListener);\n }", "registerListener(key, func) {\n if (!this.listeners[key]) {\n this.listeners[key] = []\n }\n this.listeners[key].push(func)\n }", "function addCanvasListener(event, functionObj) {\n canvas.addEventListener(event, functionObj);\n activeListeners.push({event: event, func: functionObj});\n}", "subscribe(listener){\n if( (listener.notify && Util.isFunction(listener.notify)) || Util.isFunction(listener) )\n this.listeners.push(listener);\n else\n throw new Error(\"Listener object must either be a function or an object with a `notify` function.\");\n }", "function _addListener(element, type, listener) {\n if (!element) {\n return false;\n }\n if (typeof window.attachEvent === 'object') {\n element.attachEvent('on' + type, listener);\n } else {\n element.addEventListener(type, listener, false);\n }\n }", "function addComponentNodeListener (node, eventName, handler) {\n /* istanbul ignore next */\n if (!node.componentOptions.listeners) {\n node.componentOptions.listeners = {};\n }\n\n mergeVNodeListeners(node.componentOptions.listeners, eventName, handler);\n}", "function addComponentNodeListener (node, eventName, handler) {\n /* istanbul ignore next */\n if (!node.componentOptions.listeners) {\n node.componentOptions.listeners = {};\n }\n\n mergeVNodeListeners(node.componentOptions.listeners, eventName, handler);\n}", "function addComponentNodeListener (node, eventName, handler) {\n /* istanbul ignore next */\n if (!node.componentOptions.listeners) {\n node.componentOptions.listeners = {};\n }\n\n mergeVNodeListeners(node.componentOptions.listeners, eventName, handler);\n}", "function addComponentNodeListener (node, eventName, handler) {\n /* istanbul ignore next */\n if (!node.componentOptions.listeners) {\n node.componentOptions.listeners = {};\n }\n\n mergeVNodeListeners(node.componentOptions.listeners, eventName, handler);\n}", "function addComponentNodeListener (node, eventName, handler) {\n /* istanbul ignore next */\n if (!node.componentOptions.listeners) {\n node.componentOptions.listeners = {};\n }\n\n mergeVNodeListeners(node.componentOptions.listeners, eventName, handler);\n}", "function addComponentNodeListener (node, eventName, handler) {\n /* istanbul ignore next */\n if (!node.componentOptions.listeners) {\n node.componentOptions.listeners = {};\n }\n\n mergeVNodeListeners(node.componentOptions.listeners, eventName, handler);\n}", "function addListener(el, ename, fn, task, wrap, scope){\n el = Ext.getDom(el);\n var id = getId(el),\n es = Ext.elCache[id].events,\n wfn;\n\n wfn = E.on(el, ename, wrap);\n es[ename] = es[ename] || [];\n\n /* 0 = Original Function,\n 1 = Event Manager Wrapped Function,\n 2 = Scope,\n 3 = Adapter Wrapped Function,\n 4 = Buffered Task\n */\n es[ename].push([fn, wrap, scope, wfn, task]);\n\n // this is a workaround for jQuery and should somehow be removed from Ext Core in the future\n // without breaking ExtJS.\n\n // workaround for jQuery\n if(el.addEventListener && ename == \"mousewheel\"){\n var args = [\"DOMMouseScroll\", wrap, false];\n el.addEventListener.apply(el, args);\n Ext.EventManager.addListener(WINDOW, 'unload', function(){\n el.removeEventListener.apply(el, args);\n });\n }\n\n // fix stopped mousedowns on the document\n if(el == DOC && ename == \"mousedown\"){\n Ext.EventManager.stoppedMouseDownEvent.addListener(wrap);\n }\n }", "addIncomingNotificationListener(listener) {\n this.incomingNotificationListener.push(listener);\n }", "on(event, callback){\n // Input validation\n if(!this.callbacks[event]) throw \"unknown event: \" + event;\n if(typeof(callback) != \"function\") throw \"invalid or missing callback function\";\n\n // Add event listener to event\n this.callbacks[event].push(callback);\n }", "aListener(val) {}", "function addListener(evantName, listener) {\n subscription[evantName] = engageModule.addListener(evantName, (beaconInfo) => {\n const info = Platform.OS === 'ios' ? beaconInfo : JSON.parse(beaconInfo)\n listener(info);\n });\n}", "addEventListener(event, callback) {\n this.eventProxy.addEventListener(event, callback);\n }", "function l(e) {\n var o = d3_v3.event; // Events can be reentrant (e.g., focus).\n d3_v3.event = e;\n try {\n listener.call(node, node.__data__, i);\n } finally {\n d3_v3.event = o;\n }\n }", "static eventListenerHelper(ele, event, func) {\n if (ele.addEventListener) {\n ele.addEventListener(event, func, false);\n } else if (el.attachEvent) {\n ele.attachEvent('on' + event, func);\n }\n }", "function addListener(selector, event, handler)\n\t{\n\t\t_svg.selectAll(selector).on(event, handler);\n\n\t\t// save the listener for future reference\n\t\tif (_listeners[selector] == null)\n\t\t{\n\t\t\t_listeners[selector] = {};\n\t\t}\n\n\t\t_listeners[selector][event] = handler;\n\t}", "function addEventListeners() {\n\n}", "addListener(event, handler) {\n this.on(event, handler);\n return this;\n }", "addListener(event, handler) {\n this.on(event, handler);\n return this;\n }", "function addRenderListener(listener) {\n renderListeners.push(listener);\n}", "function addComponentNodeListener(node, eventName, handler) {\n /* istanbul ignore next */\n if (!node.componentOptions) {\n return;\n }\n /* istanbul ignore next */\n if (!node.componentOptions.listeners) {\n node.componentOptions.listeners = {};\n }\n mergeVNodeListeners(node.componentOptions.listeners, eventName, handler);\n }", "addListener(k, f) {\n if (this.hasListeners(k)) {\n this.listeners[k].add(f);\n } else {\n this.listeners[k] = new Set([f]);\n }\n }", "function addListener(el, eventName, handler) {\n if(typeof(el) == \"string\"){\n el = document.querySelectorAll(el);\n if(el.length == 1){\n el = el[0]; // if only one set it properly\n }\n }\n\n if (el == null || typeof(el) == 'undefined') return;\n\n if(el.length !== undefined && el.length > 1 && el != window){ // it's a NodeListCollection\n for (var i = 0; i < el.length; ++i) {\n attachListener(el[i], eventName, handler);\n }\n }else { // it's a single node\n // console.log(el);\n attachListener(el, eventName, handler);\n }\n }", "function listener(eventName, listenerFn, useCapture) {\n if (useCapture === void 0) {\n useCapture = false;\n }\n var tNode = previousOrParentTNode;\n ngDevMode && assertNodeOfPossibleTypes(tNode, 3 /* Element */, 0 /* Container */, 4 /* ElementContainer */);\n // add native event listener - applicable to elements only\n if (tNode.type === 3 /* Element */) {\n var native = getNativeByTNode(previousOrParentTNode, viewData);\n ngDevMode && ngDevMode.rendererAddEventListener++;\n // In order to match current behavior, native DOM event listeners must be added for all\n // events (including outputs).\n if (isProceduralRenderer(renderer)) {\n var cleanupFn = renderer.listen(native, eventName, listenerFn);\n storeCleanupFn(viewData, cleanupFn);\n }\n else {\n var wrappedListener = wrapListenerWithPreventDefault(listenerFn);\n native.addEventListener(eventName, wrappedListener, useCapture);\n var cleanupInstances = getCleanup(viewData);\n cleanupInstances.push(wrappedListener);\n if (firstTemplatePass) {\n getTViewCleanup(viewData).push(eventName, tNode.index, cleanupInstances.length - 1, useCapture);\n }\n }\n }\n // subscribe to directive outputs\n if (tNode.outputs === undefined) {\n // if we create TNode here, inputs must be undefined so we know they still need to be\n // checked\n tNode.outputs = generatePropertyAliases(tNode.flags, 1 /* Output */);\n }\n var outputs = tNode.outputs;\n var outputData;\n if (outputs && (outputData = outputs[eventName])) {\n createOutput(outputData, listenerFn);\n }\n}", "function useEventListener(eventName, listener, element) {\n if (element === void 0) {\n element = window;\n }\n\n var savedHandler = Object(__WEBPACK_IMPORTED_MODULE_0_react__[\"useRef\"])(listener);\n Object(__WEBPACK_IMPORTED_MODULE_0_react__[\"useEffect\"])(function () {\n savedHandler.current = listener;\n }, [listener]);\n Object(__WEBPACK_IMPORTED_MODULE_0_react__[\"useEffect\"])(function () {\n var isSupported = element && element.addEventListener;\n\n if (!isSupported) {\n if (false) {\n console.warn(\"Event listener not supported on the element provided\");\n }\n\n return;\n }\n\n function eventListener(event) {\n savedHandler.current(event);\n }\n\n element.addEventListener(eventName, eventListener);\n return function () {\n element.removeEventListener(eventName, eventListener);\n };\n }, [eventName, element]);\n}", "function addComponentNodeListener(node, eventName, handler) {\n /* istanbul ignore next */\n if (!node.componentOptions) {\n return;\n }\n /* istanbul ignore next */\n if (!node.componentOptions.listeners) {\n node.componentOptions.listeners = {};\n }\n mergeVNodeListeners(node.componentOptions.listeners, eventName, handler);\n}", "function addComponentNodeListener(node, eventName, handler) {\n /* istanbul ignore next */\n if (!node.componentOptions) {\n return;\n }\n /* istanbul ignore next */\n if (!node.componentOptions.listeners) {\n node.componentOptions.listeners = {};\n }\n mergeVNodeListeners(node.componentOptions.listeners, eventName, handler);\n}", "addEvent(eventListener, func) {\n this.func[eventListener] = func;\n this.addEventToBlob(this.html, eventListener, func);\n }", "function listen(event){\n return obj.elem.addEventListener(event, function(e){return obj[event](e)});\n }", "function Listener(eventName) {\n return listenerFunc.bind(this, eventName);\n}", "function Listener(eventName) {\n return listenerFunc.bind(this, eventName);\n}", "function Listener(eventName) {\n return listenerFunc.bind(this, eventName);\n}", "addOnRemove (listener) {\n this.listeners.push(listener)\n }", "function subscribe (listener) {\n\t\tif (typeof listener !== 'function') {\n\t\t\tthrow 'listener should be a function';\n\t\t}\n\n\t\t// append listener\n\t\tlisteners[length++] = listener;\n\n\t\t// return unsubscribe function\n\t\treturn function unsubscribe () {\n\t\t\t// for each listener\n\t\t\tfor (var i = 0; i < length; i++) {\n\t\t\t\t// if currentListener === listener, remove\n\t\t\t\tif (listeners[i] === listener) {\n\t\t\t\t\tlisteners.splice(i, 1);\n\t\t\t\t\tlength--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.7538891", "0.713268", "0.7111036", "0.7033408", "0.7013971", "0.7013971", "0.70016426", "0.6995966", "0.69426817", "0.69417566", "0.6839801", "0.6804345", "0.6679578", "0.6619077", "0.6616332", "0.6603275", "0.6506358", "0.64776033", "0.64776033", "0.64776033", "0.64776033", "0.64026904", "0.63994586", "0.6379657", "0.6374704", "0.6367162", "0.6367162", "0.6367162", "0.6367162", "0.6365267", "0.63009995", "0.6295891", "0.62882465", "0.6282698", "0.6282698", "0.62809986", "0.62805223", "0.6274782", "0.6215662", "0.6180528", "0.6180528", "0.6180528", "0.6180528", "0.6180528", "0.6180528", "0.61540896", "0.61540896", "0.6149755", "0.6136602", "0.6119737", "0.6100328", "0.60837454", "0.6079819", "0.60721654", "0.6052146", "0.6049288", "0.6049288", "0.604512", "0.60246646", "0.60136944", "0.5988099", "0.5983569", "0.5976836", "0.5976663", "0.5942571", "0.5938812", "0.5921561", "0.5903553", "0.5903553", "0.5903553", "0.5903553", "0.5903553", "0.5903553", "0.58786047", "0.5876749", "0.586693", "0.585727", "0.58556473", "0.58534557", "0.5848766", "0.5846981", "0.5836706", "0.5810759", "0.58089036", "0.58089036", "0.5805531", "0.5804128", "0.58036613", "0.58007115", "0.5800395", "0.580029", "0.57913333", "0.57913333", "0.5784377", "0.57716584", "0.57626927", "0.57626927", "0.57626927", "0.57573676", "0.57499045" ]
0.6254217
38
Adds a onetime `listener` function as an event listener for `ev`.
once(ev, listener) { super.once(ev, listener); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addListener(event, listener) {\n this.ee.addListener(event, listener);\n }", "addEventListener(target, type, listener, options) {\n this.log(`Adding \"${type}\" eventlistener`, target);\n \n const boundListener = listener.bind(this);\n target.addEventListener(type, boundListener, options);\n this.eventListeners.push({target, type, listener, boundListener});\n }", "function addListener(listener) {\n listeners.push(listener);\n\n if(!watchId) {\n startWatching();\n }\n else if(cachedGeo) {\n setTimeout(function() {\n handleEvent(cachedGeo);\n }, 0);\n }\n }", "function _on (event, listener) {\n if (typeof _events[event] !== 'object') {\n _events[event] = [];\n }\n\n _events[event].push(listener);\n }", "addEventListener(target, type, listener, options) {\n this.log(`Adding \"${type}\" eventlistener`, target);\n\n const boundListener = listener.bind(this);\n target.addEventListener(type, boundListener, options);\n this.eventListeners.push({ target, type, listener, boundListener });\n }", "on(event: string, listener: Function): void {\n if (typeof this.__events[event] !== 'object') {\n this.__events[event] = [];\n }\n\n this.__events[event].push(listener);\n }", "static addListener(listener) {\n listeners.push(listener);\n }", "function _add_event_listener(el, eventname, fn){\r\n if (el.addEventListener === undefined){\r\n el.attachEvent('on' + eventname, fn);\r\n }\r\n else {\r\n el.addEventListener(eventname, fn);\r\n }\r\n}", "addListener(listener) {\n listeners.push(listener);\n }", "addListener(listener) {\n this.listeners.push(listener);\n }", "addListener(listener) {\n this.listeners.push(listener);\n }", "on(ev, fn) {\n this.emitter.on(ev, fn);\n }", "on(event, listener, emitter = this._defaultEmitter()) {\n emitter.on(event, listener);\n }", "function addEventListener(eventName, listener){\n\t\tconsole.log(\"addEventListener: \" + eventName);\n\t\t\n\t\tif(mEventListeners[eventName] === undefined)\n\t\t\tmEventListeners[eventName] = [];\n\t\t\t\n\t\tmEventListeners[eventName].push(listener);\n\t}", "function registerListener(_listener_, id){\n listeners[id] = _listener_;\n }", "function addOnEvent(eventListener) {\n eventQueue.push(eventListener);\n }", "registerListener(key, func) {\n if (!this.listeners[key]) {\n this.listeners[key] = []\n }\n this.listeners[key].push(func)\n }", "function addListener(evnt, func) {\n if (window.addEventListener) {\n window.addEventListener(evnt, func, false); \n } else if (window.attachEvent) window.attachEvent('on' + evnt, func);\n}", "function addEventHandler(target, evtype, listener) {\n if (window.attachEvent) {\n target.attachEvent(\"on\" + evtype, listener); // can return boolean\n } else {\n target.addEventListener(evtype, listener, false); // returns void\n }\n}", "aListener(val) {}", "function add_ev(node, event, f) {\n var eventHandler = function(e) { change_world(function(w, k) { f(w, e, k); },\n doNothing); };\n attachEvent(node, event, eventHandler);\n eventDetachers.push(function() { detachEvent(node, event, eventHandler); });\n }", "function add_ev(node, event, f) {\n var eventHandler = function(e) { change_world(function(w, k) { f(w, e, k); },\n doNothing); };\n attachEvent(node, event, eventHandler);\n eventDetachers.push(function() { detachEvent(node, event, eventHandler); });\n }", "function eventListener(id, eventType, hit, callback)\n{\n \n this.id=id;\t// unique sequential id so people can cancel\n this.eventType=eventType;\n this.hit=hit; // call with x,y to see if they really want it\n this.callback=callback; // pass event to here\n this.toString=function() {\n\treturn 'eventListener('+id+','+eventType+','+hit+','+'callback'+')'; }\n}", "addListener(listener) {\n if (!activeListeners.includes(listener)) {\n activeListeners.push(listener);\n }\n }", "addListener(eventName, listener) {\n return this.on(eventName, listener);\n }", "function addListener(target, eventType, fn) {\n\t\ttarget.attachEvent(eventType, fn);\n\t\tlistenersArr[listenersArr.length] = [target, eventType, fn];\n\t}", "function addListener(target, eventType, fn) {\n\t\ttarget.attachEvent(eventType, fn);\n\t\tlistenersArr[listenersArr.length] = [target, eventType, fn];\n\t}", "function addListener(target, eventType, fn) {\n\t\ttarget.attachEvent(eventType, fn);\n\t\tlistenersArr[listenersArr.length] = [target, eventType, fn];\n\t}", "function addListener(target, eventType, fn) {\n\t\ttarget.attachEvent(eventType, fn);\n\t\tlistenersArr[listenersArr.length] = [target, eventType, fn];\n\t}", "addListener(cb) {\n this.listeners.push(cb)\n }", "listen(target, listener, defaults) : Function {\n const emitter = this.getEmitter(listener);\n return (event, options) => {\n target.addEventListener(event, listener[event], { ...defaults, ...options });\n return () => this.forget(target, listener).apply(this, [ event, { ...defaults, ...options } ]);\n };\n }", "addListener(eventName, handler) {\r\n if (eventName in this.events === false) this.events[eventName] = [];\r\n\r\n this.events[eventName].push(handler);\r\n }", "function addCanvasListener(event, functionObj) {\n canvas.addEventListener(event, functionObj);\n activeListeners.push({event: event, func: functionObj});\n}", "trackListener(listener, persistent) {\n this._listeners.push({ listener, persistent });\n }", "addChangeListener(callback) {\n Bullet.on(LOCAL_EVENT_NAME, callback)\n }", "function addNativeNodeListener (node, eventName, handler) {\n if (isNullOrUndefined(node.data.on)) {\n node.data.on = {};\n }\n\n mergeVNodeListeners(node.data.on, eventName, handler);\n}", "function addNativeNodeListener (node, eventName, handler) {\n if (isNullOrUndefined(node.data.on)) {\n node.data.on = {};\n }\n\n mergeVNodeListeners(node.data.on, eventName, handler);\n}", "function addNativeNodeListener (node, eventName, handler) {\n if (isNullOrUndefined(node.data.on)) {\n node.data.on = {};\n }\n\n mergeVNodeListeners(node.data.on, eventName, handler);\n}", "function addNativeNodeListener (node, eventName, handler) {\n if (isNullOrUndefined(node.data.on)) {\n node.data.on = {};\n }\n\n mergeVNodeListeners(node.data.on, eventName, handler);\n}", "function addNativeNodeListener (node, eventName, handler) {\n if (isNullOrUndefined(node.data.on)) {\n node.data.on = {};\n }\n\n mergeVNodeListeners(node.data.on, eventName, handler);\n}", "function addNativeNodeListener (node, eventName, handler) {\n if (isNullOrUndefined(node.data.on)) {\n node.data.on = {};\n }\n\n mergeVNodeListeners(node.data.on, eventName, handler);\n}", "function addListener(el, ename, fn, task, wrap, scope){\n el = Ext.getDom(el);\n var id = getId(el),\n es = Ext.elCache[id].events,\n wfn;\n\n wfn = E.on(el, ename, wrap);\n es[ename] = es[ename] || [];\n\n /* 0 = Original Function,\n 1 = Event Manager Wrapped Function,\n 2 = Scope,\n 3 = Adapter Wrapped Function,\n 4 = Buffered Task\n */\n es[ename].push([fn, wrap, scope, wfn, task]);\n\n // this is a workaround for jQuery and should somehow be removed from Ext Core in the future\n // without breaking ExtJS.\n\n // workaround for jQuery\n if(el.addEventListener && ename == \"mousewheel\"){\n var args = [\"DOMMouseScroll\", wrap, false];\n el.addEventListener.apply(el, args);\n Ext.EventManager.addListener(WINDOW, 'unload', function(){\n el.removeEventListener.apply(el, args);\n });\n }\n\n // fix stopped mousedowns on the document\n if(el == DOC && ename == \"mousedown\"){\n Ext.EventManager.stoppedMouseDownEvent.addListener(wrap);\n }\n }", "function addListener(target, eventType, fn) {\n target.attachEvent(eventType, fn);\n listenersArr[listenersArr.length] = [target, eventType, fn];\n }", "function addListener(target, eventType, fn) {\n target.attachEvent(eventType, fn);\n listenersArr[listenersArr.length] = [target, eventType, fn];\n }", "function addListener(target, eventType, fn) {\n target.attachEvent(eventType, fn);\n listenersArr[listenersArr.length] = [target, eventType, fn];\n }", "function addListener(target, eventType, fn) {\n target.attachEvent(eventType, fn);\n listenersArr[listenersArr.length] = [target, eventType, fn];\n }", "function Listener() {}", "function Listener() {}", "addListener(chatUserKey, listener) {\n listener.configure(this);\n Logger.debug(\"Control::addListener() key: \" + chatUserKey);\n this.pendingListeners[chatUserKey] = listener;\n if(!this.hasResponseTimeoutTimer(chatUserKey)) {\n this.addResponseTimeoutTimer(chatUserKey, listener.msg, listener.question);\n }\n }", "trackListener(listener, persistent) {\n this._listeners.push({ listener, persistent });\n }", "function addEventListener(psEventType, poFunc) {\n\t\taEventFunc[psEventType] = poFunc;\n\t}", "registerSpanEventListener(listener) {\n this.eventListenersLocal.push(listener);\n }", "subscribeToEvent(eventName, listener){\n this._eventEmmiter.on(eventName, listener);\n }", "function subscribe(listener) {\n listeners.push(listener);\n }", "addEventListener (f) {\n this.eventListeners.push(f)\n }", "function addListenMethod(method, implementation) {\n Eventable[method] = function(obj, name, callback) {\n var listeners = this._listeners || (this._listeners = {});\n var id = obj._listenerId || (obj._listenerId = (new Date()).getTime());\n listeners[id] = obj;\n if (typeof name === 'object') callback = this;\n obj[implementation](name, callback, this);\n return this;\n };\n }", "function addNativeNodeListener(node, eventName, handler) {\n /* istanbul ignore next */\n if (!node.data) {\n node.data = {};\n }\n if (isNullOrUndefined(node.data.on)) {\n node.data.on = {};\n }\n mergeVNodeListeners(node.data.on, eventName, handler);\n}", "function addNativeNodeListener(node, eventName, handler) {\n /* istanbul ignore next */\n if (!node.data) {\n node.data = {};\n }\n if (isNullOrUndefined(node.data.on)) {\n node.data.on = {};\n }\n mergeVNodeListeners(node.data.on, eventName, handler);\n}", "listen(listener) {\n this._listeners.push(listener);\n\n return () => {\n this._listeners = this._listeners.filter(registered => {\n return listener !== registered;\n });\n };\n }", "on(ev, listener) {\n super.on(ev, listener);\n return this;\n }", "function listen(target,eventType,handler,capture) {\n\ttarget.addEventListener(eventType,handler,capture);\n}", "function addNativeNodeListener(node, eventName, handler) {\n /* istanbul ignore next */\n if (!node.data) {\n node.data = {};\n }\n if (isNullOrUndefined(node.data.on)) {\n node.data.on = {};\n }\n mergeVNodeListeners(node.data.on, eventName, handler);\n }", "function subscribe(listener) {\r\n subscribers.push(listener);\r\n }", "function addEvent(el, type, handler) {\r\n if (el.attachEvent) el.attachEvent('on' + type, handler);\r\n else el.addEventListener(type, handler);\r\n }", "function Listener(callback) {\n var listener = callback;\n listener.onArr = function (arr,eventName) {\n if (arr.length < 2 ) {throw \"Invalid argument: At least two elements in the Array are expected!\"}\n if(!eventName || !eventName.split) {throw 'Invalid argument: Event name is missing or an invalid type!'}\n var l = arr.length, arr = [].concat(arr);\n while (l--) {\n arr.each_(function (a,b) {\n this.on(a,b,eventName)\n }.bind(this,arr.shift()));\n }\n };\n //\n listener.on = function (a,b,eventName) {\n if(!a || !b) { throw 'Invalid arguments: Both event emitters are required!' }\n if(!eventName || !eventName.split ) {throw 'Invalid argument: Event name is missing or is invalid type.'}\n // TODO: Make sure no duplicates being added\n (a.on || a.addEventListener).call(a,eventName, function () {\n var args = [].slice.call(arguments);\n args.splice(0,0,{origin: a, target: b});\n this.apply(b,args); // call Listener right here\n }.bind(this));\n (b.on || b.addEventListener).call(b,eventName, function () {\n var args = [].slice.call(arguments);\n args.splice(0,0,{origin: b, target: a});\n this.apply(a,args); // call Listener right here\n }.bind(this))\n };\n return listener\n}", "function callListener(listener, event) {\n // Following behavior of :\n // func.handleEvent = func2;\n // element.addEventListener(\"type\", func);\n try {\n if (typeof listener === \"function\") return listener(event);\n else if (typeof listener.handleEvent === \"function\") return listener.handleEvent(event);\n } catch (e) {\n try { console.error(e); } catch (ignore) {}\n }\n }", "addListener(k, f) {\n if (this.hasListeners(k)) {\n this.listeners[k].add(f);\n } else {\n this.listeners[k] = new Set([f]);\n }\n }", "addListener(listener) {\r\n if (IDataListener_1.isDataListener(listener) && this.listeners.indexOf(listener) === -1) {\r\n this.listeners.push(listener);\r\n listener.registerRemover(() => {\r\n const index = this.listeners.indexOf(listener);\r\n if (index !== -1)\r\n this.listeners.splice(index, 1);\r\n });\r\n }\r\n }", "function on(eventType, handler) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n getEventListenersTarget().addEventListener(eventType, handler, options);\n listeners.push({\n eventType: eventType,\n handler: handler,\n options: options\n });\n }", "function _AddEventListener(e, type, fn) {\r\n if (e.addEventListener) {\r\n e.addEventListener(type, fn, false);\r\n }\r\n else {\r\n e.attachEvent('on' + type, function() {\r\n fn(window.event);\r\n });\r\n }\r\n}", "function addListenMethod(method, implementation) {\n\t Eventable[method] = function(obj, name, callback) {\n\t var listeners = this._listeners || (this._listeners = {});\n\t var id = obj._listenerId || (obj._listenerId = (new Date()).getTime());\n\t listeners[id] = obj;\n\t if (typeof name === 'object') callback = this;\n\t obj[implementation](name, callback, this);\n\t return this;\n\t };\n\t }", "static eventListenerHelper(ele, event, func) {\n if (ele.addEventListener) {\n ele.addEventListener(event, func, false);\n } else if (el.attachEvent) {\n ele.attachEvent('on' + event, func);\n }\n }", "function on(type, fn) {\n get_event_storage_by_type(type).push(fn);\n}", "on(ev, cb) {\n this.evm.on(ev, cb);\n }", "function on(eventType, handler) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n getEventListenersTarget().addEventListener(eventType, handler, options);\n listeners.push({\n eventType: eventType,\n handler: handler,\n options: options\n });\n }", "addEventListener(event, callback) {\n this.eventProxy.addEventListener(event, callback);\n }", "function addListener(evantName, listener) {\n subscription[evantName] = engageModule.addListener(evantName, (beaconInfo) => {\n const info = Platform.OS === 'ios' ? beaconInfo : JSON.parse(beaconInfo)\n listener(info);\n });\n}", "function Listener(eventName) {\n return listenerFunc.bind(this, eventName);\n}", "function Listener(eventName) {\n return listenerFunc.bind(this, eventName);\n}", "function Listener(eventName) {\n return listenerFunc.bind(this, eventName);\n}", "function on(event, callback) {\n if(!subscribers[event]) {\n subscribers[event] = [];\n }\n subscribers[event].push(callback);\n }", "function addEventListeners() {\n\n}", "function addListener(selector,eventName,cb){\r\n document.querySelector(selector).addEventListener(eventName,cb)\r\n}", "function addListeners(vm, node) {\n var _a;\n var value = findValue(node);\n // cache the input eventName.\n vm._inputEventName = vm._inputEventName || getInputEventName(node, findModel(node));\n onRenderUpdate(vm, (_a = value) === null || _a === void 0 ? void 0 : _a.value);\n var _b = createCommonHandlers(vm), onInput = _b.onInput, onBlur = _b.onBlur, onValidate = _b.onValidate;\n addVNodeListener(node, vm._inputEventName, onInput);\n addVNodeListener(node, 'blur', onBlur);\n // add the validation listeners.\n vm.normalizedEvents.forEach(function (evt) {\n addVNodeListener(node, evt, onValidate);\n });\n vm.initialized = true;\n}", "function addListeners(vm, node) {\n var _a;\n var value = findValue(node);\n // cache the input eventName.\n vm._inputEventName = vm._inputEventName || getInputEventName(node, findModel(node));\n onRenderUpdate(vm, (_a = value) === null || _a === void 0 ? void 0 : _a.value);\n var _b = createCommonHandlers(vm), onInput = _b.onInput, onBlur = _b.onBlur, onValidate = _b.onValidate;\n addVNodeListener(node, vm._inputEventName, onInput);\n addVNodeListener(node, 'blur', onBlur);\n // add the validation listeners.\n vm.normalizedEvents.forEach(function (evt) {\n addVNodeListener(node, evt, onValidate);\n });\n vm.initialized = true;\n}", "function _addListener(element, type, listener) {\n if (!element) {\n return false;\n }\n if (typeof window.attachEvent === 'object') {\n element.attachEvent('on' + type, listener);\n } else {\n element.addEventListener(type, listener, false);\n }\n }", "function addListener(elem, eventName, handler) {\n if(elem) \n elem.addEventListener(eventName, handler, false);\n else if(elem.attachEvent) \n elem.attachEvent('on' + eventName, handler);\n else \n elem['on' + eventName] = handler;\n}", "function addListener(element, type, handler){\n if (document.addEventListener) {\n element.addEventListener(type, handler, false);\n }\n // IE\n else if (document.attachEvent) {\n element.attachEvent(\"on\"+type, handler);\n }\n else {\n element[\"on\"+type] = handler;\n }\n}", "function addListener(key) {\n\t\t//Create listener for specific key\n\t\tvar l = function(change){\n\t\t\t//Fire it again\n\t\t\tchanged(change,key);\n\t\t};\n\t\t//Add to map\n\t\tlisteners[key] = l;\n\t\t//Return listener callback\n\t\treturn l;\n\t}", "listen(listener) {\n this._listeners.push(listener);\n return () => {\n this._listeners = this._listeners.filter((registered) => {\n return listener !== registered;\n });\n };\n }", "listen(listener) {\n this._listeners.push(listener);\n return () => {\n this._listeners = this._listeners.filter((registered) => {\n return listener !== registered;\n });\n };\n }", "addDataListener(callback) {\n this.addListener( this.dataListeners, callback);\n }", "function addListenersTo(elementToListenTo) {window.addEventListener(\"keydown\",kdown);window.addEventListener(\"keyup\",kup);elementToListenTo.addEventListener(\"mousedown\",mdown);elementToListenTo.addEventListener(\"mouseup\",mup);elementToListenTo.addEventListener(\"mousemove\",mmove);elementToListenTo.addEventListener(\"contextmenu\",cmenu);elementToListenTo.addEventListener(\"wheel\",scrl);}", "function xAddEventListener(e,eT,eL,cap)\n{\n if(!(e=xGetElementById(e)))return;\n eT=eT.toLowerCase();\n if(e.addEventListener)e.addEventListener(eT,eL,cap||false);\n else if(e.attachEvent)e.attachEvent('on'+eT,eL);\n else {\n var o=e['on'+eT];\n e['on'+eT]=typeof o=='function' ? function(v){o(v);eL(v);} : eL;\n }\n}", "function addListeners(vm, node) {\n var _a;\n var value = findValue(node);\n // cache the input eventName.\n vm._inputEventName = vm._inputEventName || getInputEventName(node, findModel(node));\n onRenderUpdate(vm, (_a = value) === null || _a === void 0 ? void 0 : _a.value);\n var _b = createCommonHandlers(vm), onInput = _b.onInput, onBlur = _b.onBlur, onValidate = _b.onValidate;\n addVNodeListener(node, vm._inputEventName, onInput);\n addVNodeListener(node, 'blur', onBlur);\n // add the validation listeners.\n vm.normalizedEvents.forEach(function (evt) {\n addVNodeListener(node, evt, onValidate);\n });\n vm.initialized = true;\n }", "on(event, handler, options) {\n return this.addListener(event, handler, options);\n }", "function addEvent(el, type, handler) {\n if (el.attachEvent) el.attachEvent('on'+type, handler); else el.addEventListener(type, handler);\n}", "addListener(changeListener) {\n this.changeListeners.push(changeListener);\n }", "addEventListener(name, callback) {\n this.instance.on(name, callback);\n }", "addEvent(eventListener, func) {\n this.func[eventListener] = func;\n this.addEventToBlob(this.html, eventListener, func);\n }", "function addListenRule(key, rule, target) {\n Object.keys(rule).forEach(nodeType => {\n target.on(nodeType, timing.enabled\n ? timing.time(key, rule[nodeType])\n : rule[nodeType]);\n });\n}" ]
[ "0.6449999", "0.6242542", "0.62090105", "0.61925524", "0.6187242", "0.61823976", "0.61704934", "0.61413634", "0.59626997", "0.59487814", "0.59487814", "0.5908819", "0.5879635", "0.5875124", "0.582561", "0.5756302", "0.5730138", "0.5689595", "0.56756294", "0.56675404", "0.56409264", "0.56409264", "0.5610451", "0.560842", "0.558584", "0.5582776", "0.5582776", "0.5582776", "0.5582776", "0.5563184", "0.55319446", "0.55272764", "0.54977775", "0.5485198", "0.5483052", "0.54688513", "0.54688513", "0.54688513", "0.54688513", "0.54688513", "0.54688513", "0.54675657", "0.5454577", "0.5454577", "0.5454577", "0.5454577", "0.54439133", "0.54439133", "0.54399073", "0.5426753", "0.5421869", "0.5415069", "0.5399259", "0.53715575", "0.5350178", "0.5343918", "0.53397465", "0.53397465", "0.53378904", "0.53377885", "0.53361475", "0.53169435", "0.5304228", "0.530312", "0.52932405", "0.5293164", "0.52900857", "0.52787757", "0.5272603", "0.52634084", "0.5259595", "0.5257483", "0.52536887", "0.5252593", "0.52522856", "0.52472305", "0.5236441", "0.52272785", "0.52272785", "0.52272785", "0.52272093", "0.52221596", "0.52165127", "0.52150184", "0.52150184", "0.5214739", "0.52145964", "0.52132875", "0.5204249", "0.52011967", "0.52011967", "0.5194631", "0.5189596", "0.51895714", "0.5184342", "0.5183398", "0.5182802", "0.5167772", "0.5166241", "0.5165338", "0.5162648" ]
0.0
-1
Emits a reserved event. This method is `protected`, so that only a class extending `StrictEventEmitter` can emit its own reserved events.
emitReserved(ev, ...args) { super.emit(ev, ...args); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reserved(){}", "function newEmitter() {\n var emitter = new EventEmitter()\n\n function go() {\n emitter.emit('criticalEvent')\n }\n\n go()\n\n return emitter\n}", "function emit(self, eventName) { self.emit(eventName); }", "ignoreEvent(event) { return true; }", "discard(payload) {\n const event = new CustomEvent('discard', { detail: payload });\n this.discardEventEmitter.dispatchEvent(event);\n }", "_reserveMousedown(event) {\n if (event.__reserved__) {\n // console.log('%s: mousedown already reserved by %s', this.id, event.__reserved__.id)\n return\n } else {\n // console.log('%s: taking mousedown ', this.id)\n event.__reserved__ = this\n this._mousedown = true\n }\n }", "function emitSDAMEvent(self, event, description) {\n if (self.listeners(event).length > 0) {\n self.emit(event, description);\n }\n}", "function emitSDAMEvent(self, event, description) {\n if (self.listeners(event).length > 0) {\n self.emit(event, description);\n }\n}", "function emitSDAMEvent(self, event, description) {\n if (self.listeners(event).length > 0) {\n self.emit(event, description);\n }\n}", "function emitSDAMEvent(self, event, description) {\n if (self.listeners(event).length > 0) {\n self.emit(event, description);\n }\n}", "function emitSDAMEvent(self, event, description) {\n if (self.listeners(event).length > 0) {\n self.emit(event, description);\n }\n}", "function emitSDAMEvent(self, event, description) {\n if (self.listeners(event).length > 0) {\n self.emit(event, description);\n }\n}", "function emitSDAMEvent(self, event, description) {\n if (self.listeners(event).length > 0) {\n self.emit(event, description);\n }\n}", "function emitSDAMEvent(self, event, description) {\n if (self.listeners(event).length > 0) {\n self.emit(event, description);\n }\n}", "function emitSDAMEvent(self, event, description) {\n if (self.listeners(event).length > 0) {\n self.emit(event, description);\n }\n}", "onPacket(packet) {\n super.emitReserved(\"packet\", packet);\n }", "onPacket(packet) {\n super.emitReserved(\"packet\", packet);\n }", "function emitSDAMEvent(self, event, description) {\n if(self.listeners(event).length > 0) {\n self.emit(event, description);\n }\n}", "function emitSDAMEvent(self, event, description) {\n if(self.listeners(event).length > 0) {\n self.emit(event, description);\n }\n}", "function emitSDAMEvent(self, event, description) {\n if(self.listeners(event).length > 0) {\n self.emit(event, description);\n }\n}", "oqnEvent () {\n this.skipInfect = 1\n }", "emit(ev, ...args) {\n if (RESERVED_EVENTS.hasOwnProperty(ev)) {\n throw new Error('\"' + ev + '\" is a reserved event name');\n }\n\n args.unshift(ev);\n const packet = {\n type: socket_io_parser_1.PacketType.EVENT,\n data: args\n };\n packet.options = {};\n packet.options.compress = this.flags.compress !== false; // event ack callback\n\n if (\"function\" === typeof args[args.length - 1]) {\n debug(\"emitting packet with ack id %d\", this.ids);\n this.acks[this.ids] = args.pop();\n packet.id = this.ids++;\n }\n\n const isTransportWritable = this.io.engine && this.io.engine.transport && this.io.engine.transport.writable;\n const discardPacket = this.flags.volatile && (!isTransportWritable || !this.connected);\n\n if (discardPacket) {\n debug(\"discard packet as the transport is not currently writable\");\n } else if (this.connected) {\n this.packet(packet);\n } else {\n this.sendBuffer.push(packet);\n }\n\n this.flags = {};\n return this;\n }", "function InternalEvent() {}", "emit(ev, ...args) {\n if (RESERVED_EVENTS.hasOwnProperty(ev)) {\n throw new Error('\"' + ev + '\" is a reserved event name');\n }\n args.unshift(ev);\n const packet = {\n type: dist.PacketType.EVENT,\n data: args,\n };\n packet.options = {};\n packet.options.compress = this.flags.compress !== false;\n // event ack callback\n if (\"function\" === typeof args[args.length - 1]) {\n debug(\"emitting packet with ack id %d\", this.ids);\n this.acks[this.ids] = args.pop();\n packet.id = this.ids++;\n }\n const isTransportWritable = this.io.engine &&\n this.io.engine.transport &&\n this.io.engine.transport.writable;\n const discardPacket = this.flags.volatile && (!isTransportWritable || !this.connected);\n if (discardPacket) {\n debug(\"discard packet as the transport is not currently writable\");\n }\n else if (this.connected) {\n this.packet(packet);\n }\n else {\n this.sendBuffer.push(packet);\n }\n this.flags = {};\n return this;\n }", "onerror(err) {\n this.emitReserved(\"error\", err);\n }", "function InternalEvent() { }", "function InternalEvent() { }", "function InternalEvent() { }", "function InternalEvent() { }", "function InternalEvent() { }", "function Emit(event) {\n return function (target, key, descriptor) {\n key = hyphenate(key);\n var original = descriptor.value;\n descriptor.value = function emitter() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (original.apply(this, args) !== false)\n this.$emit.apply(this, [event || key].concat(args));\n };\n };\n}", "function Emit(event) {\n return function (target, key, descriptor) {\n key = hyphenate(key);\n var original = descriptor.value;\n descriptor.value = function emitter() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (original.apply(this, args) !== false)\n this.$emit.apply(this, [event || key].concat(args));\n };\n };\n}", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "$emit(event, ...args) {\n this.emitter.emit(event, ...args)\n }", "$emit(event, ...args) {\n this.emitter.emit(event, ...args);\n }", "function broadcast(protectedEvent) {\n _.each(subscribers, function(event) {\n protectedEvent != event && _signal(event);\n });\n }", "function broadcast(protectedEvent) {\n _.each(subscribers, function(event) {\n protectedEvent != event && _signal(event);\n });\n }", "function SkipSelfDecorator(){}// WARNING: interface has both a type and a value, skipping emit", "function EventEmitter(){}", "function EventEmitter(){}", "emit(ev, ...args) {\r\n if (socket_1.RESERVED_EVENTS.has(ev)) {\r\n throw new Error(`\"${ev}\" is a reserved event name`);\r\n }\r\n // set up packet object\r\n const data = [ev, ...args];\r\n const packet = {\r\n type: socket_io_parser_1.PacketType.EVENT,\r\n data: data,\r\n };\r\n if (\"function\" == typeof data[data.length - 1]) {\r\n throw new Error(\"Callbacks are not supported when broadcasting\");\r\n }\r\n this.adapter.broadcast(packet, {\r\n rooms: this.rooms,\r\n except: this.exceptRooms,\r\n flags: this.flags,\r\n });\r\n return true;\r\n }", "function broadcastPermissionDeniedEvent() {\n $rootScope.$broadcast(TransitionEventNames.permissionDenies,\n TransitionProperties.toState, TransitionProperties.toParams,\n TransitionProperties.options);\n }", "emit(ev, ...args) {\n if (RESERVED_EVENTS.hasOwnProperty(ev)) {\n throw new Error('\"' + ev + '\" is a reserved event name');\n }\n args.unshift(ev);\n const packet = {\n type: socket_io_parser_1.PacketType.EVENT,\n data: args,\n };\n packet.options = {};\n packet.options.compress = this.flags.compress !== false;\n // event ack callback\n if (\"function\" === typeof args[args.length - 1]) {\n debug(\"emitting packet with ack id %d\", this.ids);\n this.acks[this.ids] = args.pop();\n packet.id = this.ids++;\n }\n const isTransportWritable = this.io.engine &&\n this.io.engine.transport &&\n this.io.engine.transport.writable;\n const discardPacket = this.flags.volatile && (!isTransportWritable || !this.connected);\n if (discardPacket) {\n debug(\"discard packet as the transport is not currently writable\");\n }\n else if (this.connected) {\n this.packet(packet);\n }\n else {\n this.sendBuffer.push(packet);\n }\n this.flags = {};\n return this;\n }", "emit(ev, ...args) {\n if (RESERVED_EVENTS.hasOwnProperty(ev)) {\n throw new Error('\"' + ev + '\" is a reserved event name');\n }\n args.unshift(ev);\n const packet = {\n type: socket_io_parser_1.PacketType.EVENT,\n data: args,\n };\n packet.options = {};\n packet.options.compress = this.flags.compress !== false;\n // event ack callback\n if (\"function\" === typeof args[args.length - 1]) {\n const id = this.ids++;\n debug(\"emitting packet with ack id %d\", id);\n const ack = args.pop();\n this._registerAckCallback(id, ack);\n packet.id = id;\n }\n const isTransportWritable = this.io.engine &&\n this.io.engine.transport &&\n this.io.engine.transport.writable;\n const discardPacket = this.flags.volatile && (!isTransportWritable || !this.connected);\n if (discardPacket) {\n debug(\"discard packet as the transport is not currently writable\");\n }\n else if (this.connected) {\n this.packet(packet);\n }\n else {\n this.sendBuffer.push(packet);\n }\n this.flags = {};\n return this;\n }", "function broadcastPermissionDeniedEvent() {\n $rootScope.$broadcast(TransitionEventNames.permissionDenies,\n TransitionProperties.toState, TransitionProperties.toParams,\n TransitionProperties.options);\n }", "function Event() {\n this.length = 0;\n }", "function Emit(event) {\n\t\t\t\treturn function (target, key, descriptor) {\n\t\t\t\t\tkey = hyphenate(key);\n\t\t\t\t\tvar original = descriptor.value;\n\t\t\t\t\tdescriptor.value = function emitter() {\n\t\t\t\t\t\tvar args = [];\n\t\t\t\t\t\tfor (var _i = 0; _i < arguments.length; _i++) {\n\t\t\t\t\t\t\targs[_i] = arguments[_i];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (original.apply(this, args) !== false) this.$emit.apply(this, [event || key].concat(args));\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t}", "ensureEvent (event) {\n if (Object.getPrototypeOf(event.constructor).name !== 'Event') {\n throw new Error(`Your event \"${event.constructor.name}\" must extend the \"Event\" utility`)\n }\n }", "function noopHandler(event) {\n event.preventDefault();\n}", "function broadcastPermissionDeniedEvent() {\n $rootScope.$broadcast(TransitionEventNames.permissionDenied, TransitionProperties.next);\n }", "function EventEmitter(){this._events=new Events();this._eventsCount=0;}", "function EventEmitter(){this._events=new Events();this._eventsCount=0;}", "function Emit(event) {\n return function (_target, key, descriptor) {\n key = hyphenate(key);\n var original = descriptor.value;\n descriptor.value = function emitter() {\n var _this = this;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var emit = function (returnValue) {\n if (returnValue !== undefined)\n args.unshift(returnValue);\n _this.$emit.apply(_this, [event || key].concat(args));\n };\n var returnValue = original.apply(this, args);\n if (isPromise(returnValue)) {\n returnValue.then(function (returnValue) {\n emit(returnValue);\n });\n }\n else {\n emit(returnValue);\n }\n return returnValue;\n };\n };\n}", "function Emit(event) {\n return function (_target, key, descriptor) {\n key = hyphenate(key);\n var original = descriptor.value;\n descriptor.value = function emitter() {\n var _this = this;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var emit = function (returnValue) {\n if (returnValue !== undefined)\n args.unshift(returnValue);\n _this.$emit.apply(_this, [event || key].concat(args));\n };\n var returnValue = original.apply(this, args);\n if (isPromise(returnValue)) {\n returnValue.then(function (returnValue) {\n emit(returnValue);\n });\n }\n else {\n emit(returnValue);\n }\n return returnValue;\n };\n };\n}", "function Emit(event) {\n return function (_target, key, descriptor) {\n key = hyphenate(key);\n var original = descriptor.value;\n descriptor.value = function emitter() {\n var _this = this;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var emit = function (returnValue) {\n if (returnValue !== undefined)\n args.unshift(returnValue);\n _this.$emit.apply(_this, [event || key].concat(args));\n };\n var returnValue = original.apply(this, args);\n if (isPromise(returnValue)) {\n returnValue.then(function (returnValue) {\n emit(returnValue);\n });\n }\n else {\n emit(returnValue);\n }\n return returnValue;\n };\n };\n}", "function Emit(event) {\n return function (_target, key, descriptor) {\n key = hyphenate(key);\n var original = descriptor.value;\n descriptor.value = function emitter() {\n var _this = this;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var emit = function (returnValue) {\n if (returnValue !== undefined)\n args.unshift(returnValue);\n _this.$emit.apply(_this, [event || key].concat(args));\n };\n var returnValue = original.apply(this, args);\n if (isPromise(returnValue)) {\n returnValue.then(function (returnValue) {\n emit(returnValue);\n });\n }\n else {\n emit(returnValue);\n }\n };\n };\n}", "function Emit(event) {\n return function (_target, key, descriptor) {\n key = hyphenate(key);\n var original = descriptor.value;\n descriptor.value = function emitter() {\n var _this = this;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var emit = function (returnValue) {\n if (returnValue !== undefined)\n args.unshift(returnValue);\n _this.$emit.apply(_this, [event || key].concat(args));\n };\n var returnValue = original.apply(this, args);\n if (isPromise(returnValue)) {\n returnValue.then(function (returnValue) {\n emit(returnValue);\n });\n }\n else {\n emit(returnValue);\n }\n };\n };\n}", "function Emit(event) {\n return function (_target, key, descriptor) {\n key = hyphenate(key);\n var original = descriptor.value;\n descriptor.value = function emitter() {\n var _this = this;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var emit = function (returnValue) {\n if (returnValue !== undefined)\n args.unshift(returnValue);\n _this.$emit.apply(_this, [event || key].concat(args));\n };\n var returnValue = original.apply(this, args);\n if (isPromise(returnValue)) {\n returnValue.then(function (returnValue) {\n emit(returnValue);\n });\n }\n else {\n emit(returnValue);\n }\n };\n };\n}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}" ]
[ "0.61554444", "0.54177517", "0.5299779", "0.5293753", "0.52906513", "0.5269415", "0.52452296", "0.52452296", "0.52452296", "0.52452296", "0.52452296", "0.52452296", "0.52452296", "0.52452296", "0.52452296", "0.5233803", "0.5233803", "0.5231736", "0.5231736", "0.5231736", "0.5208318", "0.5207784", "0.51915336", "0.5185094", "0.5180331", "0.51746935", "0.51746935", "0.51746935", "0.51746935", "0.51746935", "0.51619226", "0.51619226", "0.5118108", "0.5118108", "0.5118108", "0.5118108", "0.5118108", "0.5118108", "0.5118108", "0.5118108", "0.5118108", "0.5118108", "0.5118108", "0.5118108", "0.5118108", "0.5118108", "0.5118108", "0.5118108", "0.5118108", "0.5118108", "0.5118108", "0.5118108", "0.5118108", "0.5118108", "0.5118108", "0.5118108", "0.5118108", "0.5118108", "0.5118108", "0.5118108", "0.5118108", "0.5118108", "0.5118108", "0.5118108", "0.5117931", "0.51027286", "0.509327", "0.509327", "0.50749135", "0.5035288", "0.5035288", "0.5034079", "0.5026921", "0.50218254", "0.50104034", "0.50036824", "0.49860507", "0.49852943", "0.49597988", "0.49437854", "0.4932791", "0.49115354", "0.49115354", "0.49075115", "0.49075115", "0.49075115", "0.4903064", "0.4903064", "0.4903064", "0.49007055", "0.49007055", "0.49007055", "0.49007055", "0.49007055", "0.49007055", "0.49007055", "0.49007055", "0.49007055", "0.49007055", "0.49007055" ]
0.74587727
0
Returns the listeners listening to an event.
listeners(event) { return super.listeners(event); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get eventListeners() {\n return this.eventListenersLocal;\n }", "static get listenedEvents() {\n\t\treturn DOM_EVENTS;\n\t}", "function getChangeListeners() {\n const store = shareStore.get(this) || createStore(this);\n return store.changeListeners;\n }", "get_listeners() { return null; }", "get eventListeners() {\n\t\treturn [\"onOpening\",\"onOpen\",\"onClosing\",\"onClose\",\"onCollapse\",\"onDragEnd\",\"onDragStart\",\"onExpand\",\"onMaximize\",\"onMinimize\",\"onResizeEnd\",\"onResizeStart\",\"onRestore\",\"onCreate\",\"onReady\"];\n\t}", "function watchedEvents(obj) {\n var listeners = obj[META_KEY].listeners, ret = [];\n\n if (listeners) {\n for(var eventName in listeners) {\n if (listeners[eventName]) { ret.push(eventName); }\n }\n }\n return ret;\n}", "listenerCount(event) {\n return this.eventListenersCount(event);\n }", "listenerCount(event) {\n return this.eventListenersCount(event);\n }", "listenersAny() {\n return this._anyListeners || [];\n }", "listenersAny() {\n return this._anyListeners || [];\n }", "listenersAny() {\n return this._anyListeners || [];\n }", "listenersAnyOutgoing() {\n return this._anyOutgoingListeners || [];\n }", "get eventListeners() {\n\t\treturn [\"onChange\",\"onClose\",\"onClosing\",\"onDragEnd\",\"onDragStart\",\"onReorder\"];\n\t}", "static get listeners() {\n return {\n 'click': '_clickHandler',\n 'keydown': '_keyDownHandler'\n };\n }", "getAllListenersImpl(callback) {\n debug('getAllListenersImpl()');\n return this.pgUtils.getBy('webhook_listeners', [], [], {}, callback);\n }", "function getListeners(property){\n return listeners[property] || (listeners[property] = []);\n }", "addMultipleEventListener(events, listener) {\n Log.trace({ events }, 'Registering event listeners');\n\n const listeners = [];\n\n events.forEach(eventName => {\n const listenWrapper = _.partial(listener, _, eventName);\n this.on(eventName, listenWrapper);\n listeners.push({ eventName, listenWrapper });\n });\n\n return listeners;\n }", "async getSystemEventListeners () {\n const listenerFiles = await this.loadListeners()\n\n return listenerFiles\n .map(listenerFile => {\n const Listener = this.resolve(listenerFile)\n const listener = new Listener()\n this.ensureListener(listener)\n\n return listener\n })\n .filter(listener => {\n return listener.type() === 'system'\n })\n }", "get eventListeners() {\n\t\treturn [\"onBeginUpdate\",\"onEndUpdate\",\"onChange\",\"onItemClick\",\"onItemInsert\",\"onItemRemove\",\"onItemUpdate\",\"onViewChange\",\"onViewChanging\",\"onEventShortcutKey\",\"onDateChange\",\"onDragStart\",\"onDragEnd\",\"onResizeStart\",\"onResizeEnd\",\"onEditDialogOpening\",\"onEditDialogOpen\",\"onEditDialogClose\",\"onEditDialogClosing\",\"onContextMenuOpening\",\"onContextMenuOpen\",\"onContextMenuClose\",\"onContextMenuClosing\",\"onEventMenuOpening\",\"onEventMenuOpen\",\"onEventMenuClose\",\"onEventMenuClosing\",\"onDateMenuOpen\",\"onDateMenuClose\",\"onViewMenuOpen\",\"onViewMenuClose\",\"onNotificationOpen\",\"onNotificationClose\"];\n\t}", "listenersAny() {\n return this._anyListeners || [];\n }", "getCallbacksByRegisteredEvent(ev_type) {\n return this.callbacks_by_events[ev_type];\n }", "listenersAny() {\n return this._anyListeners || [];\n }", "static get EventListener() {\n return {\n onSettingsChanged: 'onSettingsChanged', // ...\n onBookmarksChanged: 'onBookmarksChanged', // ...\n onChaptermarksChanged: 'onChaptermarksChanged', // ...\n onMangaStatusChanged: 'onMangaStatusChanged', // ...\n onChapterStatusChanged: 'onChapterStatusChanged', // ...\n onDownloadStatusUpdated: 'onDownloadStatusUpdated', // ...\n onRequestChapterUp: 'onRequestChapterUp', // ...\n onRequestChapterDown: 'onRequestChapterDown' // ...\n };\n }", "function getListeners(topic) {\n topic = topic.toLowerCase();\n if (!topics[topic]) return []; // no such topic exists / no one interested\n \n const discoverableListners = [];\n for (const listener of topics[topic]) if (listener[DISCOVERABLE_FLAG]) discoverableListners.push(listener);\n return discoverableListners;\n}", "static get listeners() {\n return {\n 'resize': '_resizeHandler',\n 'backButton.click': '_backButtonClickHandler',\n 'filterInput.keyup': '_filterInputKeyupHandler',\n 'mainContainer.down': '_mainContainerDownHandler',\n 'mainContainer.move': '_mainContainerMoveHandler',\n 'mainContainer.swipeleft': '_mainContainerSwipeHandler',\n 'mainContainer.swiperight': '_mainContainerSwipeHandler',\n 'view.click': '_viewHandler',\n 'view.mouseout': '_viewHandler',\n 'view.mouseover': '_viewHandler',\n 'view.transitionend': '_viewHandler',\n 'view.wheel': '_wheelHandler'\n };\n }", "function getListeners(context) {\n return (context.$vnode ? context.$vnode.componentOptions.listeners : context.$listeners) || {};\n}", "function getListeners(context) {\n return (context.$vnode ? context.$vnode.componentOptions.listeners : context.$listeners) || {};\n}", "get eventSubscriptions() {\n return this.internal.eventSubscriptions;\n }", "static get listeners() {\n return {\n 'keydown': '_keyHandler',\n 'keyup': '_keyHandler',\n 'dragstart': '_dragStartHandler',\n 'button.click': '_buttonClickHandler',\n 'button.mouseenter': '_buttonMouseEnterHandler',\n 'button.mouseleave': '_buttonMouseLeaveHandler',\n 'document.up': '_documentUpHandler'\n };\n }", "getListeners(k) {\n return this.listeners[k];\n }", "function getCallbacksListsForNamespace( source, eventName ) {\n\tconst eventNode = getEvents( source )[ eventName ];\n\n\tif ( !eventNode ) {\n\t\treturn [];\n\t}\n\n\tlet callbacksLists = [ eventNode.callbacks ];\n\n\tfor ( let i = 0; i < eventNode.childEvents.length; i++ ) {\n\t\tconst childCallbacksLists = getCallbacksListsForNamespace( source, eventNode.childEvents[ i ] );\n\n\t\tcallbacksLists = callbacksLists.concat( childCallbacksLists );\n\t}\n\n\treturn callbacksLists;\n}", "function getCallbacksForEvent( source, eventName ) {\n\tlet event;\n\n\tif ( !source._events || !( event = source._events[ eventName ] ) || !event.callbacks.length ) {\n\t\t// There are no callbacks registered for specified eventName.\n\t\t// But this could be a specific-type event that is in a namespace.\n\t\tif ( eventName.indexOf( ':' ) > -1 ) {\n\t\t\t// If the eventName is specific, try to find callback lists for more generic event.\n\t\t\treturn getCallbacksForEvent( source, eventName.substr( 0, eventName.lastIndexOf( ':' ) ) );\n\t\t} else {\n\t\t\t// If this is a top-level generic event, return null;\n\t\t\treturn null;\n\t\t}\n\t}\n\n\treturn event.callbacks;\n}", "rawListeners(eventName) {\n return this.listeners[eventName];\n }", "function getListeners(bot, leagueName, sources, event) {\n return Q.fcall(function() {\n sources = _.map(sources, _.toLower);\n // These are names of users, not users. So we have to go get the real\n // user and teams. This is somewhat wasteful - but I'm not sure whether\n // this is the right design or if we should pass in users to this point. \n var _league = league.getLeague(bot, leagueName);\n var teamNames = _(sources).map(function(n) { return _league.getTeamByPlayerName(n); }).filter(_.isObject).map(\"name\").map(_.toLower).value();\n var possibleSources = _.concat(sources, teamNames);\n return db.Subscription.findAll({\n where: {\n league: leagueName.toLowerCase(),\n source: {\n $in: possibleSources\n },\n event: event.toLowerCase()\n }\n }).then(function(subscriptions) {\n return _(subscriptions).map(\"target\").uniq().value();\n });\n });\n}", "function getYouTubeListener(event) {\n var ytEvent = \"ytPlayer\" + event + \"player\" + playerId;\n return ytListeners[ytEvent];\n }", "static get listeners() {\n return {\n 'cancelButton.click': 'cancel',\n 'clearButton.click': 'clear',\n 'filterButton.click': 'filter'\n };\n }", "static get listeners() {\n return {\n 'cancelButton.click': 'cancel',\n 'clearButton.click': 'clear',\n 'filterButton.click': 'filter'\n };\n }", "getTopics() {\n return Object.keys(this.listeners);\n }", "function getEvents( source ) {\n\tif ( !source._events ) {\n\t\tObject.defineProperty( source, '_events', {\n\t\t\tvalue: {}\n\t\t} );\n\t}\n\n\treturn source._events;\n}", "on(event, callback) {\n const names = event.split(\",\").map((x) => x.trim());\n for (const name of names) {\n this.listeners[name] = this.listeners[name] || [];\n this.listeners[name].push(callback);\n }\n return () => {\n for (const name of names) {\n this.listeners[name] = this.listeners[name].filter((fn) => {\n return fn !== callback;\n });\n }\n };\n }", "on(event, callback) {\n const names = event.split(\",\").map((x) => x.trim());\n for (const name of names) {\n this.listeners[name] = this.listeners[name] || [];\n this.listeners[name].push(callback);\n }\n return () => {\n for (const name of names) {\n this.listeners[name] = this.listeners[name].filter((fn) => {\n return fn !== callback;\n });\n }\n };\n }", "static get listeners() {\n return {\n 'container.down': '_mouseDownHandler',\n 'document.move': '_drag',\n 'document.up': '_switchThumbDropHandler',\n 'mouseenter': '_switchButtonOnMouseEnter',\n 'mouseleave': '_switchButtonOnMouseLeave',\n 'resize': '_resizeHandler',\n 'container.resize': '_resizeHandler',\n 'document.selectstart': '_selectStartHandler'\n };\n }", "getAttenuatedEventEmitters (eventEmitters) {\n return eventEmitters.map(emitter => {\n return {\n eventNames: emitter.eventNames.bind(emitter),\n on: emitter.on.bind(emitter),\n removeListener: emitter.removeListener.bind(emitter),\n }\n })\n }", "async events() {\n return await this.call({func:\"get_events\", context:\"locals\"})\n }", "function getEvents()\n{\n\tconsole.log( \"getEvents2\" );\n\t\n\t//console.log( events );\n\tif(preloadEvents)\n\t\treturn preloadedEvents;\n\telse\n\t\treturn NULL;\n}", "function watchedEvents(obj) {\n var meta$$1 = exports.peekMeta(obj);\n return meta$$1 && meta$$1.watchedEvents() || [];\n }", "function EventListeners () {\n Fire._CallbacksHandler.call(this);\n }", "static get listeners() {\n return {\n 'mouseenter': '_mouseEnterHandler',\n 'mouseleave': '_mouseLeaveHandler',\n 'container.swipeleft': '_swipeHandler',\n 'container.swiperight': '_swipeHandler',\n 'container.swipetop': '_swipeHandler',\n 'container.swipebottom': '_swipeHandler'\n };\n }", "function currentListeners() {\n let userCount = 0;\n /*\n * Iterate through all our voice connections' channels and count the number of other users.\n */\n client.voiceConnections\n .map(vc => vc.channel)\n .forEach(c => userCount += c.members // eslint-disable-line no-return-assign\n .filter(m => !m.selfDeaf && !m.deaf).size - 1);\n\n listeners = userCount;\n\n return setTimeout(currentListeners, 20000);\n}", "hasListeners(event) {\n if (isArray(event)) {\n for (const ev of event) {\n if (!this.hasListeners(ev)) {\n return false\n }\n }\n return event.length > 0\n } else {\n return !!this.listeners?.[event]\n }\n }", "get event() {\r\n if (!this._event) {\r\n this._event = (listener, thisArgs, disposables) => {\r\n if (!this._callbacks) {\r\n this._callbacks = new CallbackList();\r\n }\r\n if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) {\r\n this._options.onFirstListenerAdd(this);\r\n }\r\n this._callbacks.add(listener, thisArgs);\r\n let result;\r\n result = {\r\n dispose: () => {\r\n this._callbacks.remove(listener, thisArgs);\r\n result.dispose = Emitter._noop;\r\n if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) {\r\n this._options.onLastListenerRemove(this);\r\n }\r\n }\r\n };\r\n if (Array.isArray(disposables)) {\r\n disposables.push(result);\r\n }\r\n return result;\r\n };\r\n }\r\n return this._event;\r\n }", "get event() {\r\n if (!this._event) {\r\n this._event = (listener, thisArgs, disposables) => {\r\n if (!this._callbacks) {\r\n this._callbacks = new CallbackList();\r\n }\r\n if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) {\r\n this._options.onFirstListenerAdd(this);\r\n }\r\n this._callbacks.add(listener, thisArgs);\r\n let result;\r\n result = {\r\n dispose: () => {\r\n this._callbacks.remove(listener, thisArgs);\r\n result.dispose = Emitter._noop;\r\n if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) {\r\n this._options.onLastListenerRemove(this);\r\n }\r\n }\r\n };\r\n if (Array.isArray(disposables)) {\r\n disposables.push(result);\r\n }\r\n return result;\r\n };\r\n }\r\n return this._event;\r\n }", "get event() {\r\n if (!this._event) {\r\n this._event = (listener, thisArgs, disposables) => {\r\n if (!this._callbacks) {\r\n this._callbacks = new CallbackList();\r\n }\r\n if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) {\r\n this._options.onFirstListenerAdd(this);\r\n }\r\n this._callbacks.add(listener, thisArgs);\r\n let result;\r\n result = {\r\n dispose: () => {\r\n this._callbacks.remove(listener, thisArgs);\r\n result.dispose = Emitter._noop;\r\n if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) {\r\n this._options.onLastListenerRemove(this);\r\n }\r\n }\r\n };\r\n if (Array.isArray(disposables)) {\r\n disposables.push(result);\r\n }\r\n return result;\r\n };\r\n }\r\n return this._event;\r\n }", "createListeners() {\n\n this.listenDeleteAllFiltersOptions();\n\n this.listenMainInputOnType();\n\n this.listenClickFilterOption();\n\n this.listenDeleteFilter();\n\n this.listenMainInputOnFocus();\n\n this.listenMainInputOnBlur();\n\n this.listenClickModalFilter();\n\n this.listenModalFilterOnBlur();\n\n this.listenModalFilterOnType();\n\n }", "get events() {\n\t\treturn this.nativeElement ? this.nativeElement.events : undefined;\n\t}", "get eventReceivers() {\r\n return new SharePointQueryableCollection(this, \"EventReceivers\");\r\n }", "get listenerCount() {return this._listeners.size;}", "addListeners() {\n return dispatch => {\n Platform.prefs.addEventListener('message', prefs => dispatch(receive(c.RECEIVE_PREFS, prefs)));\n Platform.search.addEventListener('enginechange', event => {\n dispatch(receive(c.RECEIVE_CURRENT_SEARCH_ENGINE, {body: event.engine}));\n });\n Platform.search.addEventListener('visibleenginechange', event => {\n dispatch(receive(c.RECEIVE_VISIBLE_SEARCH_ENGINES, {body: event.engines}));\n });\n };\n }", "function _on (event, listener) {\n if (typeof _events[event] !== 'object') {\n _events[event] = [];\n }\n\n _events[event].push(listener);\n }", "get listener(){\n\n const comp = this.props.competition\n\n const listeners = {\n main: comp.compScreenListener,\n compState: comp.compStateListener,\n matches: comp.compMatchesListener,\n stats: comp.compStatsListener\n }\n\n return listeners[this.props.what]\n }", "function getCallbacks(target, delegate, eventType) {\n\tvar callbacks = [];\n\tif (target.delegateGroup && EVENT_CACHE[target.delegateGroup][eventType]) {\n\t\t_.each(EVENT_CACHE[target.delegateGroup][eventType], function (callbacksList, delegateId) {\n\t\t\tif (_.isArray(callbacksList) && (delegateId === delegate.delegateId || delegate.matchesSelector && delegate.matchesSelector(delegateId))) {\n\t\t\t\tcallbacks = callbacks.concat(callbacksList);\n\t\t\t}\n\t\t});\n\t}\n\treturn callbacks;\n}", "function listen(event){\n return obj.elem.addEventListener(event, function(e){return obj[event](e)});\n }", "getEvents() {\n\t\treturn this.metadata.events || {};\n\t}", "static get listeners() {\n return {\n 'mouseenter': '_mouseenterMouseleaveHandler',\n 'mouseleave': '_mouseenterMouseleaveHandler',\n 'resize': '_resizeHandler',\n 'downButton.click': '_downButtonClickHandler',\n 'downButton.mouseenter': '_mouseenterMouseleaveHandler',\n 'downButton.mouseleave': '_mouseenterMouseleaveHandler',\n 'dropDown.click': '_dropDownItemClickHandler',\n 'dropDown.mouseout': '_mouseenterMouseleaveHandler',\n 'dropDown.mouseover': '_mouseenterMouseleaveHandler',\n 'input.blur': '_inputBlurHandler',\n 'input.change': '_inputChangeHandler',\n 'input.focus': '_inputFocusHandler',\n 'input.keydown': '_inputKeydownHandler',\n 'input.keyup': '_inputKeyupHandler',\n 'input.paste': '_inputPasteHandler',\n 'input.wheel': '_inputWheelHandler',\n 'radixDisplayButton.click': '_radixDisplayButtonClickHandler',\n 'radixDisplayButton.mouseenter': '_mouseenterMouseleaveHandler',\n 'radixDisplayButton.mouseleave': '_mouseenterMouseleaveHandler',\n 'upButton.click': '_upButtonClickHandler',\n 'upButton.mouseenter': '_mouseenterMouseleaveHandler',\n 'upButton.mouseleave': '_mouseenterMouseleaveHandler',\n 'document.down': '_documentMousedownHandler',\n 'document.up': '_documentMouseupHandler'\n };\n }", "getEventsByType(type) {\n var output = [];\n this.events.forEach(function(ev) {\n if(ev.getEvent() instanceof type) {\n output.push(ev);\n }\n });\n return output;\n }", "function HasListeners() {}", "get event() {\n if (!this._event) {\n this._event = (listener, thisArgs, disposables) => {\n if (!this._callbacks) {\n this._callbacks = new CallbackList();\n }\n if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) {\n this._options.onFirstListenerAdd(this);\n }\n this._callbacks.add(listener, thisArgs);\n const result = {\n dispose: () => {\n if (!this._callbacks) {\n // disposable is disposed after emitter is disposed.\n return;\n }\n this._callbacks.remove(listener, thisArgs);\n result.dispose = Emitter._noop;\n if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) {\n this._options.onLastListenerRemove(this);\n }\n }\n };\n if (Array.isArray(disposables)) {\n disposables.push(result);\n }\n return result;\n };\n }\n return this._event;\n }", "get event() {\n if (!this._event) {\n this._event = (listener, thisArgs, disposables) => {\n if (!this._callbacks) {\n this._callbacks = new CallbackList();\n }\n if (this._options && this._options.onFirstListenerAdd && this._callbacks.isEmpty()) {\n this._options.onFirstListenerAdd(this);\n }\n this._callbacks.add(listener, thisArgs);\n const result = {\n dispose: () => {\n if (!this._callbacks) {\n // disposable is disposed after emitter is disposed.\n return;\n }\n this._callbacks.remove(listener, thisArgs);\n result.dispose = Emitter._noop;\n if (this._options && this._options.onLastListenerRemove && this._callbacks.isEmpty()) {\n this._options.onLastListenerRemove(this);\n }\n }\n };\n if (Array.isArray(disposables)) {\n disposables.push(result);\n }\n return result;\n };\n }\n return this._event;\n }", "listen(name) {\n if (!this._observers[name]) {\n this.set(name, null);\n }\n return this._observers[name];\n }", "function getEvents(){\n self.events = eventsService.getEvents();\n }", "hookListeners(dispatchEvents, callback) {\n debug('hookListeners()');\n return this.hookListenersImpl(dispatchEvents, callback);\n }", "on(event: string, listener: Function): void {\n if (typeof this.__events[event] !== 'object') {\n this.__events[event] = [];\n }\n\n this.__events[event].push(listener);\n }", "addListener(eventName, listener) {\n return this.on(eventName, listener);\n }", "getEvents(){\n return this.events.slice();\n }", "get listenerAddress() {\n return this._listenerAddress;\n }", "addListener(event, listener) {\n this.ee.addListener(event, listener);\n }", "listenerCount(e) {\n return !!this.events.hasOwnProperty(e) && this.events[e].length;\n }", "function eventListenerCount(emitter, type) {\n return emitter.listeners(type).length\n}", "function eventListenerCount(emitter, type) {\n return emitter.listeners(type).length\n}", "hasListeners(event) {\n\t return (this._subscribers[event] !== void 0 &&\n\t this._subscribers[event].length > 0);\n\t }", "function eventListenerCount (emitter, type) {\n return emitter.listeners(type).length\n}", "function eventListenerCount (emitter, type) {\n return emitter.listeners(type).length\n}", "function eventListenerCount (emitter, type) {\n return emitter.listeners(type).length\n}", "function eventListenerCount (emitter, type) {\n return emitter.listeners(type).length\n}", "function eventListenerCount (emitter, type) {\n return emitter.listeners(type).length\n}", "function eventListenerCount (emitter, type) {\n return emitter.listeners(type).length\n}", "function eventListenerCount (emitter, type) {\n return emitter.listeners(type).length\n}", "function eventListenerCount (emitter, type) {\n return emitter.listeners(type).length\n}", "function eventListenerCount (emitter, type) {\n return emitter.listeners(type).length\n}", "function eventListenerCount (emitter, type) {\n return emitter.listeners(type).length\n}", "function eventListenerCount (emitter, type) {\n return emitter.listeners(type).length\n}", "function eventListenerCount (emitter, type) {\n return emitter.listeners(type).length\n}", "function eventListenerCount (emitter, type) {\n return emitter.listeners(type).length\n}", "function eventListenerCount (emitter, type) {\n return emitter.listeners(type).length\n}", "function eventListenerCount (emitter, type) {\n return emitter.listeners(type).length\n}", "function eventListenerCount (emitter, type) {\n return emitter.listeners(type).length\n}", "function eventListenerCount (emitter, type) {\n return emitter.listeners(type).length\n}", "function eventListenerCount (emitter, type) {\n return emitter.listeners(type).length\n}", "function readLocalEvents(bitStream, protocols, config) {\n // number of events\n var length = bitStream[Binary[BinaryType.UInt8].read]();\n\n var events = [];\n for (var i = 0; i < length; i++) {\n var type = bitStream[Binary[config.TYPE_BINARY_TYPE].read]();\n var protocol = protocols.getProtocol(type);\n var event = readMessage(bitStream, protocol, 1, type, config.TYPE_PROPERTY_NAME);\n event.protocol = protocol;\n events.push(event);\n }\n return events;\n}", "function eventListenerCount(emitter, type) {\n return emitter.listeners(type).length;\n}" ]
[ "0.7210599", "0.71057445", "0.67440987", "0.6460909", "0.64533424", "0.62665415", "0.61981416", "0.61981416", "0.6161581", "0.6161581", "0.6161581", "0.61240137", "0.6055426", "0.6002546", "0.5986734", "0.59639084", "0.5944684", "0.59375453", "0.5921217", "0.5907043", "0.5890512", "0.5819987", "0.5803623", "0.5798614", "0.57730925", "0.5767433", "0.5767433", "0.5759885", "0.57275915", "0.5724013", "0.57087433", "0.56988037", "0.5697381", "0.56951576", "0.56737584", "0.56534433", "0.56534433", "0.5575341", "0.5574694", "0.5541776", "0.5541776", "0.551653", "0.54893935", "0.54606396", "0.5459183", "0.5454492", "0.5450637", "0.5432743", "0.5361781", "0.5358082", "0.5347829", "0.5347829", "0.5347829", "0.53463346", "0.5343548", "0.5339751", "0.5327759", "0.5322635", "0.5321996", "0.5318964", "0.5313515", "0.5310793", "0.53068316", "0.5301423", "0.52919096", "0.5288421", "0.52873915", "0.52873915", "0.5279644", "0.5274218", "0.52728516", "0.5241084", "0.52195394", "0.5215149", "0.5210171", "0.52067345", "0.51951355", "0.5168894", "0.5168894", "0.51644254", "0.51539963", "0.51539963", "0.51539963", "0.51539963", "0.51539963", "0.51539963", "0.51539963", "0.51539963", "0.51539963", "0.51539963", "0.51539963", "0.51539963", "0.51539963", "0.51539963", "0.51539963", "0.51539963", "0.51539963", "0.51539963", "0.5116644", "0.5103251" ]
0.65914327
3
Encode packet as string.
encodeAsString(obj) { // first is type let str = "" + obj.type; // attachments if we have them if (obj.type === PacketType.BINARY_EVENT || obj.type === PacketType.BINARY_ACK) { str += obj.attachments + "-"; } // if we have a namespace other than `/` // we append it followed by a comma `,` if (obj.nsp && "/" !== obj.nsp) { str += obj.nsp + ","; } // immediately followed by the id if (null != obj.id) { str += obj.id; } // json data if (null != obj.data) { str += JSON.stringify(obj.data); } debug("encoded %j as %s", obj, str); return str; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "encodeAsString(obj) {\n // first is type\n let str = \"\" + obj.type;\n // attachments if we have them\n if (obj.type === PacketType.BINARY_EVENT ||\n obj.type === PacketType.BINARY_ACK) {\n str += obj.attachments + \"-\";\n }\n // if we have a namespace other than `/`\n // we append it followed by a comma `,`\n if (obj.nsp && \"/\" !== obj.nsp) {\n str += obj.nsp + \",\";\n }\n // immediately followed by the id\n if (null != obj.id) {\n str += obj.id;\n }\n // json data\n if (null != obj.data) {\n str += JSON.stringify(obj.data);\n }\n debug(\"encoded %j as %s\", obj, str);\n return str;\n }", "encodeAsString(obj) {\n // first is type\n let str = \"\" + obj.type;\n // attachments if we have them\n if (obj.type === PacketType.BINARY_EVENT ||\n obj.type === PacketType.BINARY_ACK) {\n str += obj.attachments + \"-\";\n }\n // if we have a namespace other than `/`\n // we append it followed by a comma `,`\n if (obj.nsp && \"/\" !== obj.nsp) {\n str += obj.nsp + \",\";\n }\n // immediately followed by the id\n if (null != obj.id) {\n str += obj.id;\n }\n // json data\n if (null != obj.data) {\n str += JSON.stringify(obj.data);\n }\n debug(\"encoded %j as %s\", obj, str);\n return str;\n }", "encodeAsString(obj) {\n // first is type\n let str = \"\" + obj.type;\n // attachments if we have them\n if (obj.type === PacketType.BINARY_EVENT ||\n obj.type === PacketType.BINARY_ACK) {\n str += obj.attachments + \"-\";\n }\n // if we have a namespace other than `/`\n // we append it followed by a comma `,`\n if (obj.nsp && \"/\" !== obj.nsp) {\n str += obj.nsp + \",\";\n }\n // immediately followed by the id\n if (null != obj.id) {\n str += obj.id;\n }\n // json data\n if (null != obj.data) {\n str += JSON.stringify(obj.data);\n }\n debug(\"encoded %j as %s\", obj, str);\n return str;\n }", "encodeAsString(obj) {\n // first is type\n let str = \"\" + obj.type;\n // attachments if we have them\n if (obj.type === PacketType.BINARY_EVENT ||\n obj.type === PacketType.BINARY_ACK) {\n str += obj.attachments + \"-\";\n }\n // if we have a namespace other than `/`\n // we append it followed by a comma `,`\n if (obj.nsp && \"/\" !== obj.nsp) {\n str += obj.nsp + \",\";\n }\n // immediately followed by the id\n if (null != obj.id) {\n str += obj.id;\n }\n // json data\n if (null != obj.data) {\n str += JSON.stringify(obj.data, this.replacer);\n }\n return str;\n }", "function stringify(sipPacket) {\n return core.toData(sipPacket).toString(\"utf8\");\n}", "function encode(self, to, packet)\n{\n // signed packets are special, everything else gets common things added\n if(!packet.js.sig)\n {\n // if we need a line and it's not added, add it, convenience\n if(to.line || to.opened) addLine(self, to, packet);\n\n // if there's no line, always add extra identifiers\n if(!packet.js.line) {\n if(to.ref) packet.js.ref = to.ref.hashname;\n packet.js.to = to.hashname;\n packet.js.from = self.hashname;\n if(packet.sign) packet.js.x = Date.now() + 10*1000; // add timeout for signed packets\n } \n }\n \n debug(\"ENCODING\", packet.js, packet.body && packet.body.toString(), \"\\n\");\n\n var jsbuf = new Buffer(JSON.stringify(packet.js), \"utf8\");\n if(typeof packet.body === \"string\") packet.body = new Buffer(packet.body, \"utf8\");\n packet.body = packet.body || new Buffer(0);\n var len = new Buffer(2);\n len.writeInt16BE(jsbuf.length, 0);\n return Buffer.concat([len, jsbuf, packet.body]);\n}", "getPacket() {\n return JSON.stringify(this.jsonString)\n }", "toString () {\n return codec.bytesToString(this.bytes)\n }", "sendPacket(packet) {\n var _a;\n try {\n const stringified = JSON.stringify(packet);\n (_a = this.debug) === null || _a === void 0 ? void 0 : _a.call(this, `>> ${stringified}`);\n return this.ws.send(stringified);\n }\n catch (error) {\n this.emit('error', error);\n }\n }", "function encode(s) {\n \t\treqstr(s);\n \t\tvar len = s.length;\n \t\tvar out = [];\n \t\tfor(var i = 0; i < len; i += 3) {\n \t\t\tvar w = x24_r64(c3_x24((s.substring(i,i+3)+\"\\0\\0\").substring(0,3)));\n \t\t\tif(3 > len - i) {\n \t\t\t\tw = (w.substring(0,1 + len - i) + \"==\").substring(0,4);\n \t\t\t}\n \t\t\tout.push(w);\n \t\t}\n \t\treturn out.join('') || '';\n \t}", "function simpleWrite(buf){return buf.toString(this.encoding)}", "function toString(encoding) {\n var value = this.contents || ''\n return buffer(value) ? value.toString(encoding) : String(value)\n}", "function stringEncode(str) {}", "encode(str = '') {\n return this._encoder.encode(str);\n }", "function wddxSerializer_write(str)\n{\n\tthis.wddxPacket[this.wddxPacket.length] = str;\n}", "function encodeToString(bin, s1, s2, pshift) {\n if (s1 === void 0) { s1 = 34; }\n if (s2 === void 0) { s2 = 92; }\n if (pshift === void 0) { pshift = DEFAULT_PSHIFT; }\n return (new TextDecoder(\"utf-8\")).decode(encode(bin, pshift));\n}", "function encodeString(value) {\n return Buffer.from(value).toString(\"base64\");\n}", "function encodeString(value) {\n return Buffer.from(value).toString(\"base64\");\n}", "function encodeString(value) {\n return Buffer.from(value).toString(\"base64\");\n}", "function send(self, to, packet)\n{\n if(!to.ip || !(to.port > 0)) return warn(\"invalid address\", to);\n\n var buf = encode(self, to, packet);\n\n // if this packet is to be signed, wrap it and do that\n if(packet.sign && !packet.js.line)\n {\n var signed = {js:{}};\n signed.body = buf;\n signed.js.sig = crypto.createSign(\"RSA-MD5\").update(buf).sign(self.prikey, \"base64\");\n buf = encode(self, to, signed);\n packet = signed;\n }\n\n if(to.cipher)\n {\n var enc = {js:{}};\n enc.js.line = packet.js.line;\n enc.js.cipher = true;\n var aes = crypto.createCipher(\"AES-128-CBC\", to.openedSecret);\n enc.body = Buffer.concat([aes.update(buf), aes.final()]);\n buf = encode(self, to, enc);\n packet = enc;\n }\n\n // track some stats\n to.sent ? to.sent++ : to.sent = 1;\n to.sentAt = Date.now();\n\n // if there's a hashname, this is the best place to handle clearing the pop'd state on any send\n if(to.hashname && to.popping) delete to.popping;\n\n // special, first packet + nat + via'd, send a pop too\n if(to.via && to.sent === 1 && self.nat)\n {\n to.popping = packet; // cache first packet for possible resend\n send(self, to.via, {js:{pop:[[to.hashname,to.ip,to.port].join(\",\")]}});\n }\n\n self.server.send(buf, 0, buf.length, to.port, to.ip);\n}", "function toString(encoding) {\n var value = this.contents || '';\n return buffer(value) ? value.toString(encoding) : String(value);\n}", "function toString(encoding) {\n var value = this.contents || '';\n return buffer(value) ? value.toString(encoding) : String(value);\n}", "function toString(encoding) {\n var value = this.contents || '';\n return buffer(value) ? value.toString(encoding) : String(value);\n}", "function toString(encoding) {\n var value = this.contents || '';\n return buffer(value) ? value.toString(encoding) : String(value);\n}", "function toString(encoding) {\n var value = this.contents || '';\n return buffer(value) ? value.toString(encoding) : String(value);\n}", "function toString(encoding) {\n var value = this.contents || '';\n return buffer(value) ? value.toString(encoding) : String(value);\n}", "function encode (s) {\n return encodeURIComponent(s);\n}", "toString () {\n\t\tif (! this.isValid) {\n\t\t\treturn (\"\");\n\t\t}\n\t\treturn (this.octets.join (\".\"));\n\t}", "serialize() {\n return ethereumjs_util_1.rlp.encode(this.raw());\n }", "function bytesToString(bytes) {\n var s = '';\n for (var i = 0; i < bytes.length; i += 1) {\n s += String.fromCharCode(bytes[i]);\n }\n\n return s;\n }", "Serialize() {\n const buf = new util_1.default.Writer();\n // Tag (string)\n {\n bytes_1.WriteVarChar(buf, this.tag, 8);\n }\n return buf.buf;\n }", "Serialize() {\n const buf = new util_1.default.Writer();\n // Name (string)\n {\n bytes_1.WriteVarChar(buf, this.name, 8);\n }\n // URL (string)\n {\n bytes_1.WriteVarChar(buf, this.url, 8);\n }\n // PublicKey ([]byte)\n {\n bytes_1.WriteVarBin(buf, this.public_key, 8);\n }\n return buf.buf;\n }", "function bytesToString(bytes) {\r\n\t let s = '';\r\n\t for (let i = 0; i < bytes.length; i += 1) {\r\n\t s += String.fromCharCode(bytes[i]);\r\n\t }\r\n\r\n\t return s;\r\n\t}", "function createPacket(byte1, variable, payload) {\n if (payload === void 0) { payload = ''; }\n var byte2 = remainingLength(variable.length + payload.length);\n return strChr(byte1) + strChr.apply(void 0, byte2) +\n variable +\n payload;\n }", "function bytesToString(bytes) {\n if (typeof bytes === \"string\") {\n return bytes;\n } else {\n var str = \"\";\n for (var i = 0; i < bytes.length; ++i) {\n str += String.fromCharCode(bytes[i]);\n }\n return str;\n }\n}", "function toString$6(encoding) {\n return (this.contents || '').toString(encoding)\n}", "getPublicKeyString () {\n return secUtil.bufferToHex(this.getPublicKey())\n }", "function toString$9(encoding) {\n return (this.contents || '').toString(encoding)\n}", "function toString(encoding) {\n return (this.contents || '').toString(encoding)\n}", "function toString(encoding) {\n return (this.contents || '').toString(encoding)\n}", "Serialize() {\n const buf = new util_1.default.Writer();\n // Name (string)\n {\n bytes_1.WriteVarChar(buf, this.name, 8);\n }\n // Type (string)\n {\n bytes_1.WriteVarChar(buf, this.type, 8);\n }\n // Contents ([]byte)\n {\n bytes_1.WriteVarBin(buf, this.contents, 32);\n }\n return buf.buf;\n }", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n }", "function encode(string){\n\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n }", "static outgoing(packet) {\n let length = packet.replace(/\\s/g, '').length;\n\n return `${length}{${packet}}`;\n }", "function simpleWrite(buf) {\n\t return buf.toString(this.encoding);\n\t}", "function simpleWrite(buf) {\n\t return buf.toString(this.encoding);\n\t}", "function simpleWrite(buf) {\n\t return buf.toString(this.encoding);\n\t}", "function simpleWrite(buf) {\n\t return buf.toString(this.encoding);\n\t}", "function simpleWrite(buf) {\n\t return buf.toString(this.encoding);\n\t}", "function simpleWrite(buf) {\n\t return buf.toString(this.encoding);\n\t}", "function simpleWrite(buf) {\n\t return buf.toString(this.encoding);\n\t}", "function simpleWrite(buf) {\n\t return buf.toString(this.encoding);\n\t}", "function simpleWrite(buf) {\n\t return buf.toString(this.encoding);\n\t}", "function simpleWrite(buf) {\n\t return buf.toString(this.encoding);\n\t}", "function simpleWrite(buf) {\n\t return buf.toString(this.encoding);\n\t}", "function simpleWrite(buf) {\n\t return buf.toString(this.encoding);\n\t}", "function simpleWrite(buf) {\n\t return buf.toString(this.encoding);\n\t}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n }", "encodeAsBinary(obj) {\n const deconstruction = binary_1.deconstructPacket(obj);\n const pack = this.encodeAsString(deconstruction.packet);\n const buffers = deconstruction.buffers;\n buffers.unshift(pack); // add packet info to beginning of data list\n\n return buffers; // write all the buffers\n }", "function cliEncode(any) {\n return Buffer.from(JSON.stringify(any)).toString('base64');\n}", "encodeAsBinary(obj) {\n const deconstruction = binary.deconstructPacket(obj);\n const pack = this.encodeAsString(deconstruction.packet);\n const buffers = deconstruction.buffers;\n buffers.unshift(pack); // add packet info to beginning of data list\n return buffers; // write all the buffers\n }", "toString(encoding = 'hex') {\n return this.toBuffer().toString(encoding);\n }", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}", "function simpleWrite(buf) {\n return buf.toString(this.encoding);\n}" ]
[ "0.68948394", "0.68948394", "0.68729776", "0.67704785", "0.6760609", "0.6566028", "0.6300765", "0.62097317", "0.5991091", "0.58656377", "0.5779245", "0.57125056", "0.56874585", "0.5680321", "0.5679311", "0.566398", "0.55941576", "0.55941576", "0.55941576", "0.55802727", "0.5565036", "0.5565036", "0.5565036", "0.5565036", "0.5565036", "0.5565036", "0.5499251", "0.5493629", "0.54831004", "0.5473665", "0.5439291", "0.5411895", "0.5390024", "0.537954", "0.5372539", "0.5372449", "0.53705436", "0.5364255", "0.5357006", "0.5357006", "0.53180736", "0.530976", "0.5306534", "0.53058326", "0.5303018", "0.52947", "0.52947", "0.52947", "0.52947", "0.52947", "0.52947", "0.52947", "0.52947", "0.52947", "0.52947", "0.52947", "0.52947", "0.52947", "0.5294433", "0.5286364", "0.5286204", "0.52650696", "0.5262764", "0.52584106", "0.52584106", "0.52584106", "0.52584106", "0.52584106", "0.52584106", "0.52584106", "0.52584106", "0.52584106", "0.52584106", "0.52584106", "0.52584106", "0.52584106", "0.52584106", "0.52584106", "0.52584106", "0.52584106", "0.52584106", "0.52584106", "0.52584106", "0.52584106", "0.52584106", "0.52584106", "0.52584106", "0.52584106", "0.52584106", "0.52584106", "0.52584106", "0.52584106", "0.52584106", "0.52584106", "0.52584106", "0.52584106", "0.52584106", "0.52584106", "0.52584106", "0.52584106" ]
0.6650793
5
Encode packet as 'buffer sequence' by removing blobs, and deconstructing packet into object with placeholders and a list of buffers.
encodeAsBinary(obj) { const deconstruction = binary_1.deconstructPacket(obj); const pack = this.encodeAsString(deconstruction.packet); const buffers = deconstruction.buffers; buffers.unshift(pack); // add packet info to beginning of data list return buffers; // write all the buffers }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "encodeAsBinary(obj) {\n const deconstruction = binary.deconstructPacket(obj);\n const pack = this.encodeAsString(deconstruction.packet);\n const buffers = deconstruction.buffers;\n buffers.unshift(pack); // add packet info to beginning of data list\n return buffers; // write all the buffers\n }", "encodeAsBinary(obj) {\n const deconstruction = binary_js_1.deconstructPacket(obj);\n const pack = this.encodeAsString(deconstruction.packet);\n const buffers = deconstruction.buffers;\n buffers.unshift(pack); // add packet info to beginning of data list\n return buffers; // write all the buffers\n }", "encodeAsBinary(obj) {\n const deconstruction = binary_1.deconstructPacket(obj);\n const pack = this.encodeAsString(deconstruction.packet);\n const buffers = deconstruction.buffers;\n buffers.unshift(pack); // add packet info to beginning of data list\n return buffers; // write all the buffers\n }", "encodeAsBinary(obj) {\n const deconstruction = deconstructPacket(obj);\n const pack = this.encodeAsString(deconstruction.packet);\n const buffers = deconstruction.buffers;\n buffers.unshift(pack); // add packet info to beginning of data list\n return buffers; // write all the buffers\n }", "function decodeObjects(buffer) {\n const decodedResult = { decodedObjects: [], rest: buffer };\n return decode(decodedResult);\n}", "function reassembleBuffer(buffer) {\r\n //first thing to do it get the header which contains the buffer size and chunk size\r\n var header = new Uint32Array(buffer, 0, 4);\r\n var dataSize = header[1]; //data size in bytes\r\n var chunkSize = header[2];\r\n \r\n //now we need to work backwards from splitBuffer\r\n var additionalSize = (Math.ceil(dataSize / chunkSize) + 4 * 4) * 4; \r\n\r\n var chunkCount = Math.ceil((dataSize + additionalSize) / chunkSize);\r\n for (var i=chunkCount-1; i>=0; i--) {\r\n var dataDest = new Uint8Array(buffer,i*chunkSize,4*4);\r\n var movedDataArrayOffset = dataSize + i * 4*4;\r\n var dataSource = new Uint8Array(buffer,movedDataArrayOffset,4*4);\r\n dataDest.set(dataSource); \r\n }\r\n}", "function prepareBuffer(buffer, position) {\n var j;\n while (buffer[position] == undefined && buffer.length < getMaskLength()) {\n j = 0;\n while (getActiveBufferTemplate()[j] !== undefined) { //add a new buffer\n buffer.push(getActiveBufferTemplate()[j++]);\n }\n }\n\n return position;\n }", "function prepareBuffer(buffer, position) {\n var j;\n while (buffer[position] == undefined && buffer.length < getMaskLength()) {\n j = 0;\n while (getActiveBufferTemplate()[j] !== undefined) { //add a new buffer\n buffer.push(getActiveBufferTemplate()[j++]);\n }\n }\n\n return position;\n }", "function prepareBuffer(buffer, position) {\n var j;\n while (buffer[position] == undefined && buffer.length < getMaskLength()) {\n j = 0;\n while (getActiveBufferTemplate()[j] !== undefined) { //add a new buffer\n buffer.push(getActiveBufferTemplate()[j++]);\n }\n }\n\n return position;\n }", "function writePayload(frame, buffer, encoders, offset) {\n if (isMetadata(frame.flags)) {\n if (frame.metadata != null) {\n const metaLength = encoders.metadata.byteLength(frame.metadata);\n offset = writeUInt24BE(buffer, metaLength, offset);\n offset = encoders.metadata.encode(\n frame.metadata,\n buffer,\n offset,\n offset + metaLength\n );\n } else {\n offset = writeUInt24BE(buffer, 0, offset);\n }\n }\n if (frame.data != null) {\n encoders.data.encode(frame.data, buffer, offset, buffer.length);\n }\n }", "emitBuffered() {\n this.receiveBuffer.forEach(args => this.emitEvent(args));\n this.receiveBuffer = [];\n this.sendBuffer.forEach(packet => this.packet(packet));\n this.sendBuffer = [];\n }", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(map(tuples, function (tup) {\n const proto = protoFromTuple(tup)\n let buf = new Buffer(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(map(tuples, function (tup) {\n const proto = protoFromTuple(tup)\n let buf = new Buffer(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(tuples.map(tup => {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(tuples.map(tup => {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(tuples.map(tup => {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(tuples.map(tup => {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(tuples.map(tup => {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(map(tuples, function (tup) {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(map(tuples, function (tup) {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(map(tuples, function (tup) {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "emitBuffered() {\n this.receiveBuffer.forEach((args) => this.emitEvent(args));\n this.receiveBuffer = [];\n this.sendBuffer.forEach((packet) => this.packet(packet));\n this.sendBuffer = [];\n }", "converseToBuffer(): Buffer {\n const bign = this._bn.toArrayLike(Buffer);\n if (bign.length === 32) {\n return bign;\n }\n\n const zeroPad = Buffer.alloc(32);\n bign.copy(zeroPad, 32 - bign.length);\n return zeroPad;\n }", "function BufferPack(){var e,r=false,n=this;n._DeArray=function(e,r,n){return[e.slice(r,r+n)]};n._EnArray=function(e,r,n,i){for(var o=0;o<n;e[r+o]=i[o]?i[o]:0,o++);};n._DeChar=function(e,r){return String.fromCharCode(e[r])};n._EnChar=function(e,r,n){e[r]=n.charCodeAt(0)};n._DeInt=function(n,i){var o=r?e.len-1:0,s=r?-1:1,a=o+s*e.len,u,f,l;for(u=0,f=o,l=1;f!=a;u+=n[i+f]*l,f+=s,l*=256);if(e.bSigned&&u&Math.pow(2,e.len*8-1)){u-=Math.pow(2,e.len*8)}return u};n._EnInt=function(n,i,o){var s=r?e.len-1:0,a=r?-1:1,u=s+a*e.len,f;o=o<e.min?e.min:o>e.max?e.max:o;for(f=s;f!=u;n[i+f]=o&255,f+=a,o>>=8);};n._DeString=function(e,r,n){for(var i=new Array(n),o=0;o<n;i[o]=String.fromCharCode(e[r+o]),o++);return i.join(\"\")};n._EnString=function(e,r,n,i){for(var o,s=0;s<n;e[r+s]=(o=i.charCodeAt(s))?o:0,s++);};n._DeNullString=function(e,r,i,o){var s=n._DeString(e,r,i,o);return s.substring(0,s.length-1)};n._De754=function(n,i){var o,s,a,u,f,l,c,h,p,d;c=e.mLen,h=e.len*8-e.mLen-1,d=(1<<h)-1,p=d>>1;u=r?0:e.len-1;f=r?1:-1;o=n[i+u];u+=f;l=-7;for(s=o&(1<<-l)-1,o>>=-l,l+=h;l>0;s=s*256+n[i+u],u+=f,l-=8);for(a=s&(1<<-l)-1,s>>=-l,l+=c;l>0;a=a*256+n[i+u],u+=f,l-=8);switch(s){case 0:s=1-p;break;case d:return a?NaN:(o?-1:1)*Infinity;default:a=a+Math.pow(2,c);s=s-p;break}return(o?-1:1)*a*Math.pow(2,s-c)};n._En754=function(n,i,o){var s,a,u,f,l,c,h,p,d,g;h=e.mLen,p=e.len*8-e.mLen-1,g=(1<<p)-1,d=g>>1;s=o<0?1:0;o=Math.abs(o);if(isNaN(o)||o==Infinity){u=isNaN(o)?1:0;a=g}else{a=Math.floor(Math.log(o)/Math.LN2);if(o*(c=Math.pow(2,-a))<1){a--;c*=2}if(a+d>=1){o+=e.rt/c}else{o+=e.rt*Math.pow(2,1-d)}if(o*c>=2){a++;c/=2}if(a+d>=g){u=0;a=g}else if(a+d>=1){u=(o*c-1)*Math.pow(2,h);a=a+d}else{u=o*Math.pow(2,d-1)*Math.pow(2,h);a=0}}for(f=r?e.len-1:0,l=r?-1:1;h>=8;n[i+f]=u&255,f+=l,u/=256,h-=8);for(a=a<<h|u,p+=h;p>0;n[i+f]=a&255,f+=l,a/=256,p-=8);n[i+f-l]|=s*128};n._sPattern=\"(\\\\d+)?([AxcbBhHsSfdiIlL])(\\\\(([a-zA-Z0-9]+)\\\\))?\";n._lenLut={A:1,x:1,c:1,b:1,B:1,h:2,H:2,s:1,S:1,f:4,d:8,i:4,I:4,l:4,L:4};n._elLut={A:{en:n._EnArray,de:n._DeArray},s:{en:n._EnString,de:n._DeString},S:{en:n._EnString,de:n._DeNullString},c:{en:n._EnChar,de:n._DeChar},b:{en:n._EnInt,de:n._DeInt,len:1,bSigned:true,min:-Math.pow(2,7),max:Math.pow(2,7)-1},B:{en:n._EnInt,de:n._DeInt,len:1,bSigned:false,min:0,max:Math.pow(2,8)-1},h:{en:n._EnInt,de:n._DeInt,len:2,bSigned:true,min:-Math.pow(2,15),max:Math.pow(2,15)-1},H:{en:n._EnInt,de:n._DeInt,len:2,bSigned:false,min:0,max:Math.pow(2,16)-1},i:{en:n._EnInt,de:n._DeInt,len:4,bSigned:true,min:-Math.pow(2,31),max:Math.pow(2,31)-1},I:{en:n._EnInt,de:n._DeInt,len:4,bSigned:false,min:0,max:Math.pow(2,32)-1},l:{en:n._EnInt,de:n._DeInt,len:4,bSigned:true,min:-Math.pow(2,31),max:Math.pow(2,31)-1},L:{en:n._EnInt,de:n._DeInt,len:4,bSigned:false,min:0,max:Math.pow(2,32)-1},f:{en:n._En754,de:n._De754,len:4,mLen:23,rt:Math.pow(2,-24)-Math.pow(2,-77)},d:{en:n._En754,de:n._De754,len:8,mLen:52,rt:0}};n._UnpackSeries=function(r,n,i,o){for(var s=e.de,a=[],u=0;u<r;a.push(s(i,o+u*n)),u++);return a};n._PackSeries=function(r,n,i,o,s,a){for(var u=e.en,f=0;f<r;u(i,o+f*n,s[a+f]),f++);};n._zip=function(e,r){var n={};for(var i=0;i<e.length;i++){n[e[i]]=r[i]}return n};n.unpack=function(n,i,o){r=n.charAt(0)!=\"<\";o=o?o:0;var s=new RegExp(this._sPattern,\"g\");var a;var u;var f;var l=[];var c=[];while(a=s.exec(n)){u=a[1]==undefined||a[1]==\"\"?1:parseInt(a[1]);if(a[2]===\"S\"){u=0;while(i[o+u]!==0){u++}u++}f=this._lenLut[a[2]];if(o+u*f>i.length){return undefined}switch(a[2]){case\"A\":case\"s\":case\"S\":c.push(this._elLut[a[2]].de(i,o,u));break;case\"c\":case\"b\":case\"B\":case\"h\":case\"H\":case\"i\":case\"I\":case\"l\":case\"L\":case\"f\":case\"d\":e=this._elLut[a[2]];c.push(this._UnpackSeries(u,f,i,o));break}l.push(a[4]);o+=u*f}c=Array.prototype.concat.apply([],c);if(l.indexOf(undefined)!==-1){return c}else{return this._zip(l,c)}};n.packTo=function(n,i,o,s){r=n.charAt(0)!=\"<\";var a=new RegExp(this._sPattern,\"g\");var u;var f;var l;var c=0;var h;while(u=a.exec(n)){f=u[1]==undefined||u[1]==\"\"?1:parseInt(u[1]);if(u[2]===\"S\"){f=s[c].length+1}l=this._lenLut[u[2]];if(o+f*l>i.length){return false}switch(u[2]){case\"A\":case\"s\":case\"S\":if(c+1>s.length){return false}this._elLut[u[2]].en(i,o,f,s[c]);c+=1;break;case\"c\":case\"b\":case\"B\":case\"h\":case\"H\":case\"i\":case\"I\":case\"l\":case\"L\":case\"f\":case\"d\":e=this._elLut[u[2]];if(c+f>s.length){return false}this._PackSeries(f,l,i,o,s,c);c+=f;break;case\"x\":for(h=0;h<f;h++){i[o+h]=0}break}o+=f*l}return i};n.pack=function(e,r){return this.packTo(e,new Buffer(this.calcLength(e,r)),0,r)};n.calcLength=function(e,r){var n=new RegExp(this._sPattern,\"g\"),i,o=0,s=0;while(i=n.exec(e)){var a=(i[1]==undefined||i[1]==\"\"?1:parseInt(i[1]))*this._lenLut[i[2]];if(i[2]===\"S\"){a=r[s].length+1}o+=a;s++}return o}}", "function encodeIntoByteBuffer(self, buffer) {\n const initialPosition = buffer.position;\n buffer.putInt32(encodingCookie);\n buffer.putInt32(0); // Placeholder for payload length in bytes.\n buffer.putInt32(1);\n buffer.putInt32(self.numberOfSignificantValueDigits);\n buffer.putInt64(self.lowestDiscernibleValue);\n buffer.putInt64(self.highestTrackableValue);\n buffer.putInt64(1);\n const payloadStartPosition = buffer.position;\n fillBufferFromCountsArray(self, buffer);\n const backupIndex = buffer.position;\n buffer.position = initialPosition + 4;\n buffer.putInt32(backupIndex - payloadStartPosition); // Record the payload length\n buffer.position = backupIndex;\n return backupIndex - initialPosition;\n}", "function deserializeFrames(buffer, encoders) {\n const frames = [];\n let offset = 0;\n while (offset + UINT24_SIZE < buffer.length) {\n const frameLength = readUInt24BE(buffer, offset);\n const frameStart = offset + UINT24_SIZE;\n const frameEnd = frameStart + frameLength;\n if (frameEnd > buffer.length) {\n // not all bytes of next frame received\n break;\n }\n const frameBuffer = buffer.slice(frameStart, frameEnd);\n const frame = deserializeFrame(frameBuffer, encoders);\n frames.push(frame);\n offset = frameEnd;\n }\n return [frames, buffer.slice(offset, buffer.length)];\n }", "addBuffer(buffer)\n {\n // if the buffer array is empty it will start the timer\n\n if(this.buffer.length === 0)\n {\n this.startTimer();\n }\n\n // it pushes all the buffers into an array that are coming from on data event\n\n this.buffer.push(buffer);\n\n // if current packet length is 0 then the current packet as only the current buffer\n\n // if the current packet length is not 0 then it append the latest buffer with the old one\n\n if(this.curPacket.length === 0)\n {\n this.curPacket = Buffer.concat([this.buffer.shift()]);\n }\n else\n {\n this.curPacket = Buffer.concat([this.curPacket, this.buffer.shift()]);\n }\n }", "emitBuffered() {\n this.receiveBuffer.forEach((args) => this.emitEvent(args));\n this.receiveBuffer = [];\n this.sendBuffer.forEach((packet) => this.packet(packet));\n this.sendBuffer = [];\n }", "emitBuffered() {\n this.receiveBuffer.forEach((args) => this.emitEvent(args));\n this.receiveBuffer = [];\n this.sendBuffer.forEach((packet) => this.packet(packet));\n this.sendBuffer = [];\n }", "onReceive( packet)\n{\n let packet_view = new Uint8Array(packet);\n this.rxMsgArrayBuffer = appendArray(this.rxMsgArrayBuffer, packet_view);\n let view = new Uint8Array(this.rxMsgArrayBuffer);\n\n if (this.size_Of_request)\n {\n let data = new Uint8Array(this.size_Of_request);\n let offset = 0;\n for(let index = 0; index < view.byteLength; ++index)\n {\n switch(view[index])\n {\n case ESC:\n data[offset++] = this.xor_20(view[index]);\n break;\n\n case SOP:\n offset = 0;\n break;\n\n case EOP:\n break;\n\n default:\n data[offset++] = view[index];\n break;\n }\n }\n\n if (this.size_Of_request == offset)\n {\n //dumpArray(data);\n if (this.postCallback)\n this.postCallback(data);\n this.rxMsgArrayBuffer = new ArrayBuffer();\n\n }\n \n }\n}", "function encodeIntoByteBuffer(buffer) {\n\t var self = this;\n\t var initialPosition = buffer.position;\n\t buffer.putInt32(encodingCookie);\n\t buffer.putInt32(0); // Placeholder for payload length in bytes.\n\t buffer.putInt32(1);\n\t buffer.putInt32(self.numberOfSignificantValueDigits);\n\t buffer.putInt64(self.lowestDiscernibleValue);\n\t buffer.putInt64(self.highestTrackableValue);\n\t buffer.putInt64(1);\n\t var payloadStartPosition = buffer.position;\n\t fillBufferFromCountsArray(self, buffer);\n\t var backupIndex = buffer.position;\n\t buffer.position = initialPosition + 4;\n\t buffer.putInt32(backupIndex - payloadStartPosition); // Record the payload length\n\t buffer.position = backupIndex;\n\t return backupIndex - initialPosition;\n\t}", "emitBuffered() {\n this.receiveBuffer.forEach((args) => this.emitEvent(args));\n this.receiveBuffer = [];\n this.sendBuffer.forEach((packet) => {\n this.notifyOutgoingListeners(packet);\n this.packet(packet);\n });\n this.sendBuffer = [];\n }", "function detachBuffer(buffer) {\n const channel = new MessageChannel();\n channel.port1.postMessage('', [buffer]);\n}", "async function reduce_packet_size(blob, lba) {\n\t// http://boring.shoutwiki.com/wiki/.IMC\n\tlet abs_off = lba*2048;\n\tlet replacements = [];\n\tlet num_sections = new DataView(await blob.slice(abs_off,abs_off+4).arrayBuffer()).getUint32(0, true);\n\tlet section_dv = new DataView(await blob.slice(abs_off+4, abs_off+4+num_sections*32).arrayBuffer());\n\tfor(let i = 0; i < num_sections; i++) {\n\t\tlet name = \"\";\n\t\tfor(let j = 0; j < 16; j++) {\n\t\t\tlet ch = section_dv.getUint8(i*32 + j);\n\t\t\tif(ch == 0) break;\n\t\t\tname += String.fromCharCode(ch);\n\t\t}\n\t\tif(name.startsWith(\"Win_P\")) {\n\t\t\t//console.log(name);\n\t\t\tlet s_abs_off = abs_off + section_dv.getUint32(i*32+16, true);\n\t\t\tlet header_dv = new DataView(await blob.slice(s_abs_off, s_abs_off+16).arrayBuffer());\n\t\t\tif(header_dv.getUint32(0, true) != 1) throw new Error(\"Wrong number of channels\");\n\t\t\tlet interleave = header_dv.getUint32(8, true);\n\t\t\tlet num_packets = header_dv.getUint32(12, true);\n\t\t\t//console.log(interleave + \", \" + num_packets);\n\t\t\tif((interleave % 3) != 0) throw new Error(\"Packet interlieave of \" + interleave + \" not divisible by 3\");\n\t\t\tinterleave /= 3;\n\t\t\tnum_packets *= 3;\n\t\t\theader_dv.setUint32(8, interleave, true);\n\t\t\theader_dv.setUint32(12, num_packets, true);\n\t\t\treplacements.push([s_abs_off, new Blob([header_dv.buffer])]);\n\t\t}\n\t}\n\treturn replacements;\n}", "write(sequence, offset) {\n offset = typeof offset === 'number' ? offset : this.position;\n // If the buffer is to small let's extend the buffer\n if (this.buffer.length < offset + sequence.length) {\n const buffer$1 = buffer__WEBPACK_IMPORTED_MODULE_0___default.a.Buffer.alloc(this.buffer.length + sequence.length);\n this.buffer.copy(buffer$1, 0, 0, this.buffer.length);\n // Assign the new buffer\n this.buffer = buffer$1;\n }\n if (ArrayBuffer.isView(sequence)) {\n this.buffer.set(ensure_buffer.ensureBuffer(sequence), offset);\n this.position =\n offset + sequence.byteLength > this.position ? offset + sequence.length : this.position;\n }\n else if (typeof sequence === 'string') {\n this.buffer.write(sequence, offset, sequence.length, 'binary');\n this.position =\n offset + sequence.length > this.position ? offset + sequence.length : this.position;\n }\n }", "function wrapBuffer(buffer) {\n return buffer;\n}", "function onDecodingSuccess(buffer) {\n if (buffer) {\n bufferList[bufferIndex] = buffer;\n } else {\n onDecodingError('unknown');\n }\n\n endIfAllURLsResolved();\n }", "function createBuffer() {\n var ptr = exports.hb_buffer_create();\n return {\n ptr: ptr,\n /**\n * Add text to the buffer.\n * @param {string} text Text to be added to the buffer.\n **/\n addText: function (text) {\n const str = createJsString(text);\n exports.hb_buffer_add_utf16(ptr, str.ptr, str.length, 0, str.length);\n str.free();\n },\n /**\n * Set buffer script, language and direction.\n *\n * This needs to be done before shaping.\n **/\n guessSegmentProperties: function () {\n return exports.hb_buffer_guess_segment_properties(ptr);\n },\n /**\n * Set buffer direction explicitly.\n * @param {string} direction: One of \"ltr\", \"rtl\", \"ttb\" or \"btt\"\n */\n setDirection: function (dir) {\n exports.hb_buffer_set_direction(ptr, {\n ltr: 4,\n rtl: 5,\n ttb: 6,\n btt: 7\n }[dir] || 0);\n },\n /**\n * Set buffer flags explicitly.\n * @param {string[]} flags: A list of strings which may be either:\n * \"BOT\"\n * \"EOT\"\n * \"PRESERVE_DEFAULT_IGNORABLES\"\n * \"REMOVE_DEFAULT_IGNORABLES\"\n * \"DO_NOT_INSERT_DOTTED_CIRCLE\"\n * \"PRODUCE_UNSAFE_TO_CONCAT\"\n */\n setFlags: function (flags) {\n var flagValue = 0\n flags.forEach(function (s) {\n flagValue |= _buffer_flag(s);\n })\n\n exports.hb_buffer_set_flags(ptr,flagValue);\n },\n /**\n * Set buffer language explicitly.\n * @param {string} language: The buffer language\n */\n setLanguage: function (language) {\n var str = createAsciiString(language);\n exports.hb_buffer_set_language(ptr, exports.hb_language_from_string(str.ptr,-1));\n str.free();\n },\n /**\n * Set buffer script explicitly.\n * @param {string} script: The buffer script\n */\n setScript: function (script) {\n var str = createAsciiString(script);\n exports.hb_buffer_set_script(ptr, exports.hb_script_from_string(str.ptr,-1));\n str.free();\n },\n\n /**\n * Set the Harfbuzz clustering level.\n *\n * Affects the cluster values returned from shaping.\n * @param {number} level: Clustering level. See the Harfbuzz manual chapter\n * on Clusters.\n **/\n setClusterLevel: function (level) {\n exports.hb_buffer_set_cluster_level(ptr, level)\n },\n /**\n * Return the buffer contents as a JSON object.\n *\n * After shaping, this function will return an array of glyph information\n * objects. Each object will have the following attributes:\n *\n * - g: The glyph ID\n * - cl: The cluster ID\n * - ax: Advance width (width to advance after this glyph is painted)\n * - ay: Advance height (height to advance after this glyph is painted)\n * - dx: X displacement (adjustment in X dimension when painting this glyph)\n * - dy: Y displacement (adjustment in Y dimension when painting this glyph)\n * - flags: Glyph flags like `HB_GLYPH_FLAG_UNSAFE_TO_BREAK` (0x1)\n **/\n json: function () {\n var length = exports.hb_buffer_get_length(ptr);\n var result = [];\n var infosPtr = exports.hb_buffer_get_glyph_infos(ptr, 0);\n var infosPtr32 = infosPtr / 4;\n var positionsPtr32 = exports.hb_buffer_get_glyph_positions(ptr, 0) / 4;\n var infos = heapu32.subarray(infosPtr32, infosPtr32 + 5 * length);\n var positions = heapi32.subarray(positionsPtr32, positionsPtr32 + 5 * length);\n for (var i = 0; i < length; ++i) {\n result.push({\n g: infos[i * 5 + 0],\n cl: infos[i * 5 + 2],\n ax: positions[i * 5 + 0],\n ay: positions[i * 5 + 1],\n dx: positions[i * 5 + 2],\n dy: positions[i * 5 + 3],\n flags: exports.hb_glyph_info_get_glyph_flags(infosPtr + i * 20)\n });\n }\n return result;\n },\n /**\n * Free the object.\n */\n destroy: function () { exports.hb_buffer_destroy(ptr); }\n };\n }", "function encodeArrayBuffer(packet,supportsBinary,callback){if(!supportsBinary){return exports.encodeBase64Packet(packet,callback);}var data=packet.data;var contentArray=new Uint8Array(data);var resultBuffer=new Uint8Array(1 + data.byteLength);resultBuffer[0] = packets[packet.type];for(var i=0;i < contentArray.length;i++) {resultBuffer[i + 1] = contentArray[i];}return callback(resultBuffer.buffer);}", "function serializePayloadFrame(frame, encoders) {\n const payloadLength = getPayloadLength(frame, encoders);\n const buffer = createBuffer(FRAME_HEADER_SIZE + payloadLength);\n const offset = writeHeader(frame, buffer);\n writePayload(frame, buffer, encoders, offset);\n return buffer;\n }", "function createSnapshotBuffer(snapshot, config) {\r\n var bits = 0\r\n bits += 40\r\n\r\n bits += countMessagesBits(snapshot.engineMessages)\r\n bits += countPingBits(snapshot.pingKey)\r\n bits += countTimesyncBits(snapshot.timestamp)\r\n\r\n bits += countMessagesBits(snapshot.createEntities)\r\n bits += countSinglePropsBits(snapshot.updateEntities.partial)\r\n //bits += countBatchesBits(snapshot.updateEntities.optimized)\r\n bits += countDeleteEntitiesBits(snapshot.deleteEntities, config)\r\n\r\n //bits += countMessagesBits(snapshot.createComponents)\r\n //bits += countSinglePropsBits(snapshot.updateComponents.partial)\r\n //bits += countDeleteEntitiesBits(snapshot.deleteComponents, config)\r\n \r\n bits += countMessagesBits(snapshot.localEvents)\r\n bits += countMessagesBits(snapshot.messages)\r\n bits += countJSONsBits(snapshot.jsons)\r\n\r\n //console.log('partials', snapshot.updateEntities.partial)\r\n var bitBuffer = new BitBuffer(bits)\r\n var bitStream = new BitStream(bitBuffer)\r\n\r\n bitStream.writeUInt8(Chunk.ClientTick)\r\n bitStream.writeUInt32(snapshot.clientTick)\r\n\r\n writeEngineMessages(bitStream, snapshot.engineMessages)\r\n writePing(bitStream, snapshot.pingKey)\r\n writeTimesync(bitStream, snapshot.timestamp, snapshot.avgLatency)\r\n\r\n writeCreateEntities(Chunk.CreateEntities, bitStream, snapshot.createEntities)\r\n writeSingleProps(Chunk.UpdateEntitiesPartial, bitStream, snapshot.updateEntities.partial)\r\n //writeBatches(bitStream, snapshot.updateEntities.optimized)\r\n writeDeleteEntities(Chunk.DeleteEntities, bitStream, snapshot.deleteEntities, config)\r\n\r\n //writeCreateEntities(Chunk.CreateComponents, bitStream, snapshot.createComponents)\r\n //writeSingleProps(Chunk.UpdateComponentsPartial, bitStream, snapshot.updateComponents.partial)\r\n //writeDeleteEntities(Chunk.DeleteComponents, bitStream, snapshot.deleteComponents, config)\r\n \r\n writeLocalEvents(bitStream, snapshot.localEvents)\r\n writeMessages(bitStream, snapshot.messages)\r\n writeJSONs(bitStream, snapshot.jsons)\r\n\r\n //console.log('wrote', bits)\r\n\r\n return bitBuffer\r\n}", "function bufferReviver(k, v) {\n if (\n v !== null &&\n typeof v === 'object' &&\n 'type' in v &&\n v.type === 'Buffer' &&\n 'data' in v &&\n Array.isArray(v.data)) {\n return new Buffer(v.data);\n }\n return v;\n}", "splitBuffer( buf ) {\n let chunks = [];\n\n // discard any bytes at the front before the START\n let position = buf.indexOf( MSG_TOKEN_START );\n\n if( position > 0 ) {\n // Clear the bytes before the start\n buf = buf.slice( position );\n }\n else if( position < 0 ) {\n // no START at all... invalid message\n return [];\n }\n\n // we know buf[0] is a start, so look for another START\n let index = 1;\n\n while( (position = buf.indexOf( MSG_TOKEN_START, index )) > -1) {\n \n // If there are no bytes between START bytes, don't put an empty element in the array\n // This shouldn't happen based on the protocol design anyway\n if( index === position ) {\n chunks.push( Buffer.from([]));\n }\n else {\n chunks.push( buf.slice( index-1, position ) );\n }\n\n\n // continue searching at the next byte\n index = position + 1;\n }\n\n if( index <= buf.length ) {\n //console.log('index:', index, 'left: ', buf.slice( index-1 ) );\n chunks.push( buf.slice( index-1 ));\n }\n\n return chunks;\n }", "function compactBuffers(context, node) {\n\tconst out = [node[0]];\n\tlet memo;\n\tfor (let i = 1; i < node.length; i++) {\n\t\tconst res = compiler.filterNode(context, node[i]);\n\t\tif (!res) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (res[0] === 'buffer') {\n\t\t\tif (memo) {\n\t\t\t\tmemo[1] += res[1];\n\t\t\t} else {\n\t\t\t\tmemo = res;\n\t\t\t\tout.push(res);\n\t\t\t}\n\t\t} else {\n\t\t\tmemo = null;\n\t\t\tout.push(res);\n\t\t}\n\t}\n\treturn out;\n}", "function packet( first, binary ) {\n var mbi = encodeMBI(binary.length());\n var pack = new Uint8Array( 1 + mbi.length + binary.length());\n\n pack[0] = first;\n for (var i = 0; i < mbi.length; i++) {\n pack[ 1 + i ] = mbi[i];\n }\n binary.copyInto(pack, 1 + mbi.length);\n return pack;\n}", "function _transform(chunk, encoding, done) {\n if (this._packetInProgress && !this._bytesPending) {\n // If we don't have enough data yet to read the packet length, combine\n // the pendingChunks with this one\n chunk = Buffer.concat(this._pendingChunks.concat(chunk));\n\n // Clear the pending list, we'll re-push the combined chunk if needed\n clearPending.call(this);\n }\n\n while (chunk.length > 0) {\n // If we're waiting for more data, and this chunk has it, combine all the\n // pending chunks and continue. Otherwise, add it to the pending list\n if (this._packetInProgress) {\n if(this._bytesPending - chunk.length <= 0) {\n chunk = Buffer.concat(this._pendingChunks.concat(chunk));\n clearPending.call(this);\n } else {\n this._bytesPending -= chunk.length;\n this._pendingChunks.push(chunk);\n break;\n }\n }\n\n // If we don't have enough data to get the packet length, queue the chunk\n if (chunk.length < PACKET_LENGTH_FIELD_SIZE) {\n this._packetInProgress = true;\n this._bytesPending = 0; // Not enough data to get the packet length\n this._pendingChunks.push(chunk);\n break;\n }\n\n if(this._cipher && this._bytesDecrypted === 0) {\n // Decrypt the packet length part of the buffer, and replace those\n // bytes in the buffer with the plaintext bytes\n this._cipher.update(chunk.slice(0, PACKET_LENGTH_FIELD_SIZE)).copy(\n chunk, 0);\n this._bytesDecrypted = PACKET_LENGTH_FIELD_SIZE;\n }\n\n var packetLength = chunk.readUInt32BE(0);\n var expectedLength = packetLength + this._macLength;\n var encryptedLength = PACKET_LENGTH_FIELD_SIZE + packetLength;\n\n // If the packet length is greater than what's left in the chunk, queue it\n if (expectedLength > (chunk.length - PACKET_LENGTH_FIELD_SIZE)) {\n this._packetInProgress = true;\n this._bytesPending = expectedLength - chunk.length -\n PACKET_LENGTH_FIELD_SIZE;\n this._pendingChunks.push(chunk);\n break;\n }\n\n // We've got the whole packet now, decrypt the rest of it\n if (this._cipher) {\n if (this._bytesDecrypted < encryptedLength) {\n chunk = Buffer.concat([\n chunk.slice(0, this._bytesDecrypted),\n this._cipher.update(chunk.slice(this._bytesDecrypted,\n encryptedLength)),\n // Don't forget to save the MAC if it's there\n chunk.slice(encryptedLength)\n ]);\n }\n\n // Reset _bytesDecrypted for the next packet\n this._bytesDecrypted = 0;\n this._blocksRemaining -= (encryptedLength / this._cipherBlockSize);\n }\n\n // Parse it and push it down the pipe.\n if (this._macAlgorithm) {\n var macIdx = encryptedLength; // MAC starts where crypto ends, macIdx is\n // just to help readability\n var mac = chunk.slice(macIdx, macIdx + this._macLength);\n var packet = chunk.slice(0, macIdx);\n var seqNumBuffer = new Buffer(4);\n seqNumBuffer.writeUInt32BE(this._sequence, 0);\n var hmac = crypto.createHmac(this._macAlgorithm, this._macKey);\n hmac.update(Buffer.concat([seqNumBuffer, packet]));\n this._packetsRemaining -= 1;\n\n if (mac.toString('binary') != hmac.digest().toString('binary')) {\n this.emit('error', new Error('Message Integrity Failure'));\n done();\n return;\n }\n\n chunk = Buffer.concat([\n packet, // current packet\n chunk.slice(macIdx + this._macLength) // whatever's after the MAC\n ]);\n }\n\n var paddingLength = chunk.readUInt8(PACKET_LENGTH_FIELD_SIZE);\n var endOffset = chunk.length - packetLength - PACKET_LENGTH_FIELD_SIZE;\n var payloadEnd = chunk.length - (endOffset + paddingLength);\n var payload = chunk.slice(HEADER_SIZE, payloadEnd);\n\n this.push(payload);\n this._sequence = ++this._sequence % MAX_SEQUENCE_NUMBER;\n\n if (this._packetsRemaining === 0 || this._blocksRemaining <= 0) {\n this.emit('rekey_needed');\n }\n\n // slice of what's left of the chunk, and make another pass\n chunk = chunk.slice(PACKET_LENGTH_FIELD_SIZE + packetLength);\n }\n\n done();\n}", "function concatBufferList(buflist, len) {\n\t\tlet tmp = new Uint8Array(len);\n\t\tlet pos = 0;\n\t\tfor (let i = 0; i < buflist.length; i++) {\n\t\t\ttmp.set(new Uint8Array(buflist[i]), pos);\n\t\t\tpos += buflist[i].byteLength;\n\t\t}\n\t\treturn tmp.buffer;\n\t}", "_transform(chunk, encoding, cb) {\n\n var me = this;\n //console.log('Chunk: ', chunk );\n\n // Concatenate any previous data, and split into an array of\n // encoded PDUs that start with a MSG_START byte\n let encodedPdus = this.splitBuffer( Buffer.concat([this.buffer, chunk]) );\n\n // Now we look through each of the encoded PDUs (which have not\n // yet been validated for length or checksum)\n encodedPdus.forEach( function( encodedPdu, pduIndex ){\n\n // Unstuff the PDU (remove escape codes)\n let pdu = me.decodePdu( encodedPdu );\n\n if( pdu.length >= MIN_MSG_LEN ) {\n\n // it is at least long enough to possibly be complete\n let msgLength = pdu[1]*256 + pdu[2];\n\n // If it's too long, truncate it. This shouldn't really happen\n // under normal circumstances, but no reason to keep extra bytes around.\n if(pdu.length + 3 > msgLength ) {\n pdu = pdu.slice(0, msgLength+3 );\n }\n\n // If it (now) has the expected number of bytes...\n if( msgLength === pdu.length-3 ) {\n\n // check the checksum\n let checksum = me.checksum( pdu, 1, msgLength +1 );\n\n if( checksum === pdu[ msgLength+2 ] ) {\n // Process the received PDU\n me.onReceive( pdu );\n }\n else {\n // report an incorrect checksum\n me.onReceiveError( pdu );\n } \n }\n else if( pduIndex === encodedPdu.length-1 ) {\n // if last PDU is incomplete, save it for later\n me.buffer = Buffer.from( encodedPdu );\n }\n\n }\n else if( pduIndex === encodedPdu.length-1 ) {\n // if last PDU is incomplete, save it for later\n me.buffer = Buffer.from( encodedPdu );\n }\n\n });\n\n // notify the caller that we are done processing the chunk\n cb();\n }", "function encodeArrayBuffer(packet, supportsBinary, callback) {\n if (!supportsBinary) {\n return exports.encodeBase64Packet(packet, callback);\n }\n\n var data = packet.data;\n var contentArray = new Uint8Array(data);\n var resultBuffer = new Uint8Array(1 + data.byteLength);\n\n resultBuffer[0] = packets[packet.type];\n for (var i = 0; i < contentArray.length; i++) {\n resultBuffer[i + 1] = contentArray[i];\n }\n\n return callback(resultBuffer.buffer);\n }", "function encodeArrayBuffer(packet, supportsBinary, callback) {\n if (!supportsBinary) {\n return exports.encodeBase64Packet(packet, callback);\n }\n\n var data = packet.data;\n var contentArray = new Uint8Array(data);\n var resultBuffer = new Uint8Array(1 + data.byteLength);\n\n resultBuffer[0] = packets[packet.type];\n for (var i = 0; i < contentArray.length; i++) {\n resultBuffer[i + 1] = contentArray[i];\n }\n\n return callback(resultBuffer.buffer);\n }", "function onDecodeSuccess (buffer) {\r\n\t\tvar source = context.createBufferSource();\r\n\t\tsource.buffer = buffer;\r\n\t\tsource.connect(context.destination);\r\n\t\tsource.start(0);\r\n\t}", "function unprepare$ArrayBuffer8 (po, position) {\n let i8\n let bytes\n let constructor;\n\n if (typeof po.ctr === 'string' && !po.ctr.match(/^[1-9][0-9]*$/)) {\n constructor = eval(po.ctr) /* pre-validated! */ // eslint-disable-line\n } else {\n constructor = ctors[po.ctr]\n }\n\n if (po.hasOwnProperty('ab8')) {\n bytes = po.ab8.length\n } else {\n bytes = po.len\n }\n i8 = new Int8Array(bytes)\n if (po.hasOwnProperty('ab8')) {\n for (let i = 0; i < po.ab8.length; i++) {\n i8[i] = po.ab8.charCodeAt(i)\n }\n } else {\n for (let j = 0; j < po.isl8.length; j++) {\n for (let i = 0; i < po.isl8[j][0].length; i++) {\n i8[po.isl8[j]['@'] + i] = po.isl8[j][0].charCodeAt(i)\n }\n }\n }\n // If the object is an ArrayBuffer, just return the created buffer.\n if (constructor === ArrayBuffer) {\n return i8.buffer;\n }\n return new constructor(i8.buffer, i8.byteOffset) // eslint-disable-line\n}", "function processBuffer(self) {\n var messages = self.buffer.split('\\n');\n self.buffer = \"\";\n _.each(messages, function(message){\n if (message.length > 0) {\n var parsed = JSON.parse(message);\n processMessage(self, parsed);\n }\n });\n}", "function encodeArrayBuffer(packet, supportsBinary, callback) {\n if (!supportsBinary) {\n return exports.encodeBase64Packet(packet, callback);\n }\n\n var data = packet.data;\n var contentArray = new Uint8Array(data);\n var resultBuffer = new Uint8Array(1 + data.byteLength);\n\n resultBuffer[0] = packets[packet.type];\n for (var i = 0; i < contentArray.length; i++) {\n resultBuffer[i+1] = contentArray[i];\n }\n\n return callback(resultBuffer.buffer);\n }", "function encodeArrayBuffer(packet, supportsBinary, callback) {\n\t if (!supportsBinary) {\n\t return exports.encodeBase64Packet(packet, callback);\n\t }\n\t\n\t var data = packet.data;\n\t var contentArray = new Uint8Array(data);\n\t var resultBuffer = new Uint8Array(1 + data.byteLength);\n\t\n\t resultBuffer[0] = packets[packet.type];\n\t for (var i = 0; i < contentArray.length; i++) {\n\t resultBuffer[i+1] = contentArray[i];\n\t }\n\t\n\t return callback(resultBuffer.buffer);\n\t}", "function encodeArrayBuffer(packet, supportsBinary, callback) {\n\t if (!supportsBinary) {\n\t return exports.encodeBase64Packet(packet, callback);\n\t }\n\t\n\t var data = packet.data;\n\t var contentArray = new Uint8Array(data);\n\t var resultBuffer = new Uint8Array(1 + data.byteLength);\n\t\n\t resultBuffer[0] = packets[packet.type];\n\t for (var i = 0; i < contentArray.length; i++) {\n\t resultBuffer[i+1] = contentArray[i];\n\t }\n\t\n\t return callback(resultBuffer.buffer);\n\t}", "function encodeArrayBuffer(packet, supportsBinary, callback) {\n\t if (!supportsBinary) {\n\t return exports.encodeBase64Packet(packet, callback);\n\t }\n\t\n\t var data = packet.data;\n\t var contentArray = new Uint8Array(data);\n\t var resultBuffer = new Uint8Array(1 + data.byteLength);\n\t\n\t resultBuffer[0] = packets[packet.type];\n\t for (var i = 0; i < contentArray.length; i++) {\n\t resultBuffer[i+1] = contentArray[i];\n\t }\n\t\n\t return callback(resultBuffer.buffer);\n\t}", "function encodeArrayBuffer(packet, supportsBinary, callback) {\n\t if (!supportsBinary) {\n\t return exports.encodeBase64Packet(packet, callback);\n\t }\n\t\n\t var data = packet.data;\n\t var contentArray = new Uint8Array(data);\n\t var resultBuffer = new Uint8Array(1 + data.byteLength);\n\t\n\t resultBuffer[0] = packets[packet.type];\n\t for (var i = 0; i < contentArray.length; i++) {\n\t resultBuffer[i+1] = contentArray[i];\n\t }\n\t\n\t return callback(resultBuffer.buffer);\n\t}", "function encodeArrayBuffer(packet, supportsBinary, callback) {\n\t if (!supportsBinary) {\n\t return exports.encodeBase64Packet(packet, callback);\n\t }\n\t\n\t var data = packet.data;\n\t var contentArray = new Uint8Array(data);\n\t var resultBuffer = new Uint8Array(1 + data.byteLength);\n\t\n\t resultBuffer[0] = packets[packet.type];\n\t for (var i = 0; i < contentArray.length; i++) {\n\t resultBuffer[i+1] = contentArray[i];\n\t }\n\t\n\t return callback(resultBuffer.buffer);\n\t}", "function serializeBinary(msg) {\n var offsets = [];\n var buffers = [];\n var encoder = new TextEncoder('utf8');\n var origBuffers = [];\n if (msg.buffers !== undefined) {\n origBuffers = msg.buffers;\n delete msg['buffers'];\n }\n var jsonUtf8 = encoder.encode(JSON.stringify(msg));\n buffers.push(jsonUtf8.buffer);\n for (var i = 0; i < origBuffers.length; i++) {\n // msg.buffers elements could be either views or ArrayBuffers\n // buffers elements are ArrayBuffers\n var b = origBuffers[i];\n buffers.push(b instanceof ArrayBuffer ? b : b.buffer);\n }\n var nbufs = buffers.length;\n offsets.push(4 * (nbufs + 1));\n for (var i = 0; i + 1 < buffers.length; i++) {\n offsets.push(offsets[offsets.length - 1] + buffers[i].byteLength);\n }\n var msgBuf = new Uint8Array(offsets[offsets.length - 1] + buffers[buffers.length - 1].byteLength);\n // use DataView.setUint32 for network byte-order\n var view = new DataView(msgBuf.buffer);\n // write nbufs to first 4 bytes\n view.setUint32(0, nbufs);\n // write offsets to next 4 * nbufs bytes\n for (var i = 0; i < offsets.length; i++) {\n view.setUint32(4 * (i + 1), offsets[i]);\n }\n // write all the buffers at their respective offsets\n for (var i = 0; i < buffers.length; i++) {\n msgBuf.set(new Uint8Array(buffers[i]), offsets[i]);\n }\n return msgBuf.buffer;\n}", "function BinaryPipe(buffer, initialObject = {}) {\n const generator = bufferGenerator_1.bufferGenerator(buffer);\n return {\n /**\n * Pipes buffer through given parsers.\n * It's up to parser how many bytes it takes from buffer.\n * Each parser should return new literal object, that will be merged to previous object (or initialObject) by pipe.\n *\n * @param parsers - parsers for pipeline\n */\n pipe(...parsers) {\n // Call each parser and merge returned value into one object\n return parsers.reduce((previousValue, parser) => {\n const result = parser[1](generator);\n return Object.assign({}, previousValue, { [parser[0]]: result });\n }, initialObject);\n },\n /**\n * Returns special pipe function, which iterates `count` times over buffer,\n * returning array of results.\n *\n * @param count - number of times to iterate.\n */\n loop(count) {\n // save basePipe reference to avoid returned pipe calling itself\n const basePipe = this.pipe;\n return {\n pipe(...parsers) {\n const entries = [];\n // Call basePipe `count` times\n for (let i = 0; i < count; i += 1) {\n entries.push(basePipe(...parsers));\n }\n return entries;\n },\n };\n },\n /**\n * Returns buffer not parsed by pipe yet.\n * Closes generator, so no piping will be available after calling `finish`.\n */\n finish() {\n const buf = [];\n // Take all bytes and close generator\n let lastResult;\n do {\n lastResult = generator.next();\n buf.push(lastResult.value);\n } while (!lastResult.done);\n return Buffer.from(buf);\n },\n };\n}", "_readPacket() {\n let pos = this._streamPosition;\n const intParams = [];\n let strParam;\n try {\n // Each incoming packet is initially tagged with 7 int32 values, they look like this:\n // 0 = \"Magic\" value that is *always* -2027771214\n // 1 = \"FCType\" that identifies the type of packet this is (FCType being a MyFreeCams defined thing)\n // 2 = nFrom\n // 3 = nTo\n // 4 = nArg1\n // 5 = nArg2\n // 6 = sPayload, the size of the payload\n // 7 = sMessage, the actual payload. This is not an int but is the actual buffer\n // Any read here could throw a RangeError exception for reading beyond the end of the buffer. In theory we could handle this\n // better by checking the length before each read, but that would be a bit ugly. Instead we handle the RangeErrors and just\n // try to read again the next time the buffer grows and we have more data\n // Parse out the first 7 integer parameters (Magic, FCType, nFrom, nTo, nArg1, nArg2, sPayload)\n const countOfIntParams = 7;\n const sizeOfInt32 = 4;\n for (let i = 0; i < countOfIntParams; i++) {\n intParams.push(this._streamBuffer.readInt32BE(pos));\n pos += sizeOfInt32;\n }\n const [magic, fcType, nFrom, nTo, nArg1, nArg2, sPayload] = intParams;\n // If the first integer is MAGIC, we have a valid packet\n if (magic === constants.MAGIC) {\n // If there is a JSON payload to this packet\n if (sPayload > 0) {\n // If we don't have the complete payload in the buffer already, bail out and retry after we get more data from the network\n if (pos + sPayload > this._streamBuffer.length) {\n throw new RangeError(); // This is needed because streamBuffer.toString will not throw a rangeerror when the last param is out of the end of the buffer\n }\n // We have the full packet, store it and move our buffer pointer to the next packet\n strParam = this._streamBuffer.toString(\"utf8\", pos, pos + sPayload);\n pos = pos + sPayload;\n }\n }\n else {\n // Magic value did not match? In that case, all bets are off. We no longer understand the MFC stream and cannot recover...\n // This is usually caused by a mis-alignment error due to incorrect buffer management (bugs in this code or the code that writes the buffer from the network)\n this._disconnected(`Invalid packet received! - ${magic} Length == ${this._streamBuffer.length}`);\n return;\n }\n // At this point we have the full packet in the intParams and strParam values, but intParams is an unstructured array\n // Let's clean it up before we delegate to this.packetReceived. (Leaving off the magic int, because it MUST be there always\n // and doesn't add anything to the understanding)\n let sMessage;\n if (strParam !== undefined && strParam !== \"\") {\n try {\n sMessage = JSON.parse(strParam);\n }\n catch (e) {\n sMessage = strParam;\n }\n }\n this._packetReceived(new Packet_1.Packet(fcType, nFrom, nTo, nArg1, nArg2, sPayload, sMessage));\n // If there's more to read, keep reading (which would be the case if the network sent >1 complete packet in a single transmission)\n if (pos < this._streamBuffer.length) {\n this._streamPosition = pos;\n this._readPacket();\n }\n else {\n // We read the full buffer, clear the buffer cache so that we can\n // read cleanly from the beginning next time (and save memory)\n this._streamBuffer = Buffer.alloc(0);\n this._streamPosition = 0;\n }\n }\n catch (e) {\n // RangeErrors are expected because sometimes the buffer isn't complete. Other errors are not...\n if (!(e instanceof RangeError)) {\n this._disconnected(`Unexpected error while reading socket stream: ${e}`);\n }\n else {\n // this.log(\"Expected exception (?): \" + e);\n }\n }\n }", "encode(bufs, w, h) {\r\n const ps = 0;\r\n const forbidPlte = false;\r\n const dels = undefined;\r\n const data = new Uint8Array(bufs[0].byteLength * bufs.length + 100);\r\n const wr = [0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A];\r\n for (let i = 0; i < 8; i++) {\r\n data[i] = wr[i];\r\n }\r\n let offset = 8;\r\n const nimg = this.compressPNG(bufs, w, h, ps, forbidPlte);\r\n this.writeUint(data, offset, 13);\r\n offset += 4;\r\n this.writeASCII(data, offset, \"IHDR\");\r\n offset += 4;\r\n this.writeUint(data, offset, w);\r\n offset += 4;\r\n this.writeUint(data, offset, h);\r\n offset += 4;\r\n data[offset] = nimg.depth;\r\n offset++;\r\n data[offset] = nimg.ctype;\r\n offset++;\r\n data[offset] = 0; // compress\r\n offset++;\r\n data[offset] = 0; // filter\r\n offset++;\r\n data[offset] = 0; // interlace\r\n offset++;\r\n this.writeUint(data, offset, this.crc(data, offset - 17, 17));\r\n offset += 4; // crc\r\n // 9 bytes to say, that it is sRGB\r\n this.writeUint(data, offset, 1);\r\n offset += 4;\r\n this.writeASCII(data, offset, \"sRGB\");\r\n offset += 4;\r\n data[offset] = 1;\r\n offset++;\r\n this.writeUint(data, offset, this.crc(data, offset - 5, 5));\r\n offset += 4; // crc\r\n const anim = bufs.length > 1;\r\n if (anim) {\r\n this.writeUint(data, offset, 8);\r\n offset += 4;\r\n this.writeASCII(data, offset, \"acTL\");\r\n offset += 4;\r\n this.writeUint(data, offset, bufs.length);\r\n offset += 4;\r\n this.writeUint(data, offset, 0);\r\n offset += 4;\r\n this.writeUint(data, offset, this.crc(data, offset - 12, 12));\r\n offset += 4; // crc\r\n }\r\n if (nimg.ctype === 3) {\r\n const dl = nimg.plte.length;\r\n this.writeUint(data, offset, dl * 3);\r\n offset += 4;\r\n this.writeASCII(data, offset, \"PLTE\");\r\n offset += 4;\r\n for (let i = 0; i < dl; i++) {\r\n const ti = i * 3;\r\n const c = nimg.plte[i];\r\n const r = (c) & 255;\r\n const g = (c >> 8) & 255;\r\n const b = (c >> 16) & 255;\r\n data[offset + ti + 0] = r;\r\n data[offset + ti + 1] = g;\r\n data[offset + ti + 2] = b;\r\n }\r\n offset += dl * 3;\r\n this.writeUint(data, offset, this.crc(data, offset - dl * 3 - 4, dl * 3 + 4));\r\n offset += 4; // crc\r\n if (nimg.gotAlpha) {\r\n this.writeUint(data, offset, dl);\r\n offset += 4;\r\n this.writeASCII(data, offset, \"tRNS\");\r\n offset += 4;\r\n for (let i = 0; i < dl; i++) {\r\n data[offset + i] = (nimg.plte[i] >> 24) & 255;\r\n }\r\n offset += dl;\r\n this.writeUint(data, offset, this.crc(data, offset - dl - 4, dl + 4));\r\n offset += 4; // crc\r\n }\r\n }\r\n let fi = 0;\r\n for (let j = 0; j < nimg.frames.length; j++) {\r\n const fr = nimg.frames[j];\r\n if (anim) {\r\n this.writeUint(data, offset, 26);\r\n offset += 4;\r\n this.writeASCII(data, offset, \"fcTL\");\r\n offset += 4;\r\n this.writeUint(data, offset, fi++);\r\n offset += 4;\r\n this.writeUint(data, offset, fr.rect.width);\r\n offset += 4;\r\n this.writeUint(data, offset, fr.rect.height);\r\n offset += 4;\r\n this.writeUint(data, offset, fr.rect.x);\r\n offset += 4;\r\n this.writeUint(data, offset, fr.rect.y);\r\n offset += 4;\r\n this.writeUshort(data, offset, dels[j]);\r\n offset += 2;\r\n this.writeUshort(data, offset, 1000);\r\n offset += 2;\r\n data[offset] = fr.dispose;\r\n offset++; // dispose\r\n data[offset] = fr.blend;\r\n offset++; // blend\r\n this.writeUint(data, offset, this.crc(data, offset - 30, 30));\r\n offset += 4; // crc\r\n }\r\n const imgd = fr.cimg;\r\n const dl = imgd.length;\r\n this.writeUint(data, offset, dl + (j === 0 ? 0 : 4));\r\n offset += 4;\r\n const ioff = offset;\r\n this.writeASCII(data, offset, (j === 0) ? \"IDAT\" : \"fdAT\");\r\n offset += 4;\r\n if (j !== 0) {\r\n this.writeUint(data, offset, fi++);\r\n offset += 4;\r\n }\r\n for (let i = 0; i < dl; i++) {\r\n data[offset + i] = imgd[i];\r\n }\r\n offset += dl;\r\n this.writeUint(data, offset, this.crc(data, ioff, offset - ioff));\r\n offset += 4; // crc\r\n }\r\n this.writeUint(data, offset, 0);\r\n offset += 4;\r\n this.writeASCII(data, offset, \"IEND\");\r\n offset += 4;\r\n this.writeUint(data, offset, this.crc(data, offset - 4, 4));\r\n offset += 4; // crc\r\n return new Uint8Array(data.buffer.slice(0, offset));\r\n }", "function deserializeKeepAliveFrame(buffer, streamId, flags, encoders) {\n invariant_1(\n streamId === 0,\n 'RSocketBinaryFraming: Invalid KEEPALIVE frame, expected stream id to be 0.'\n );\n\n const length = buffer.length;\n let offset = FRAME_HEADER_SIZE;\n const lastReceivedPosition = readUInt64BE(buffer, offset);\n offset += 8;\n let data = null;\n if (offset < buffer.length) {\n data = encoders.data.decode(buffer, offset, buffer.length);\n }\n\n return {\n data,\n flags,\n lastReceivedPosition,\n length,\n streamId,\n type: FRAME_TYPES.KEEPALIVE,\n };\n }", "function fixBuffer(buffer) {\n var binary = '';\n var bytes = new Uint8Array(buffer);\n var len = bytes.byteLength;\n for (var i = 0; i < len; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return binary;\n}", "start() {\n const that = this;\n this.transport.socket.on('data', (data) => {\n that.bufferQueue = Buffer.concat([that.bufferQueue, Buffer.from(data)]);\n if (that.bufferQueue.length > RTConst.PROTOCOL_HEADER_LEN) { // parse head length\n const packetLen = that.bufferQueue.readUInt32BE(0);\n const totalLen = packetLen + RTConst.PROTOCOL_HEADER_LEN;\n if (that.bufferQueue.length >= totalLen) {\n // it is a full packet, this packet can be parsed as message\n const messageBuffer = Buffer.alloc(packetLen);\n that.bufferQueue.copy(messageBuffer, 0, RTConst.PROTOCOL_HEADER_LEN, totalLen);\n that.incomeMessage(RTRemoteSerializer.fromBuffer(messageBuffer));\n that.bufferQueue = that.bufferQueue.slice(totalLen); // remove parsed message\n }\n }\n });\n }", "recompose(buffer) {\n const values = [];\n let bufferOffset = 0;\n this._registers.forEach(r => {\n const readValue = TypeBufferHelper_1.TypeBufferHelper.read(r.type, buffer, bufferOffset);\n values.push({\n register: r,\n data: r.convertValue(readValue)\n });\n bufferOffset += TypeBufferHelper_1.TypeBufferHelper.getLength(r.type) / 8;\n });\n return values;\n }", "shiftBufferFromUnresolvedDataArray(buffer) {\n if (!buffer) {\n buffer = new PooledBuffer(this.bufferSize, this.unresolvedDataArray, this.unresolvedLength);\n }\n else {\n buffer.fill(this.unresolvedDataArray, this.unresolvedLength);\n }\n this.unresolvedLength -= buffer.size;\n return buffer;\n }", "shiftBufferFromUnresolvedDataArray(buffer) {\n if (!buffer) {\n buffer = new PooledBuffer(this.bufferSize, this.unresolvedDataArray, this.unresolvedLength);\n }\n else {\n buffer.fill(this.unresolvedDataArray, this.unresolvedLength);\n }\n this.unresolvedLength -= buffer.size;\n return buffer;\n }", "bypass(inBuffer, outBuffer){\n for (let i = 0; i < inBuffer.length; i++){\n outBuffer[i] = inBuffer[i];\n }\n }", "function deserializeFrameWithLength(buffer, encoders) {\n const frameLength = readUInt24BE(buffer, 0);\n return deserializeFrame(\n buffer.slice(UINT24_SIZE, UINT24_SIZE + frameLength),\n encoders\n );\n }", "_transform(chunk, encoding, callback) {\n const bg = concatgen([this._tmpbuf, chunk]);\n let recbytes = [];\n while (true) {\n // Get next byte, or save any incomplete record\n const b = bg.next();\n if (b.done) {\n this._tmpbuf = Buffer.from(recbytes);\n return callback();\n }\n recbytes.push(b.value);\n\n // Got enough bytes for a record\n if (recbytes.length === this._reclen) {\n // If last record crossed or ended on a 64KB boundary, output extended address\n if (this._needea) {\n const eabuf = Buffer.allocUnsafe(2);\n eabuf.writeInt16BE(this._ptr >> 16);\n this.push(buildRecord(4, 0, eabuf) + '\\n');\n this._needea = false;\n }\n this.push(buildRecord(0, this._ptr & 0xFFFF, Buffer.from(recbytes)) + '\\n');\n\n // Did that record cross or end on a 64KB boundary?\n if (this._ptr >> 16 !== (this._ptr + this._reclen) >> 16) {\n this._needea = true;\n }\n this._ptr += this._reclen;\n recbytes = [];\n }\n }\n }", "function _makeByteBuffersReadable(parsedObject){\n Object.keys(parsedObject).forEach(function (key) {\n if (key !== 'info'){\n parsedObject[key] = parsedObject[key].toString();\n }\n else if (key === 'info'){\n Object.keys(parsedObject[key]).forEach(function (infoKey) {\n if (infoKey !== 'pieces'){\n parsedObject[key][infoKey] = parsedObject[key][infoKey].toString();\n }\n });\n }\n });\n return parsedObject;\n}", "function encodeArrayBuffer(packet, supportsBinary, callback) {\n\t if (!supportsBinary) {\n\t return exports.encodeBase64Packet(packet, callback);\n\t }\n\n\t var data = packet.data;\n\t var contentArray = new Uint8Array(data);\n\t var resultBuffer = new Uint8Array(1 + data.byteLength);\n\n\t resultBuffer[0] = packets[packet.type];\n\t for (var i = 0; i < contentArray.length; i++) {\n\t resultBuffer[i+1] = contentArray[i];\n\t }\n\n\t return callback(resultBuffer.buffer);\n\t}", "function encodeArrayBuffer(packet, supportsBinary, callback) {\n\t if (!supportsBinary) {\n\t return exports.encodeBase64Packet(packet, callback);\n\t }\n\n\t var data = packet.data;\n\t var contentArray = new Uint8Array(data);\n\t var resultBuffer = new Uint8Array(1 + data.byteLength);\n\n\t resultBuffer[0] = packets[packet.type];\n\t for (var i = 0; i < contentArray.length; i++) {\n\t resultBuffer[i+1] = contentArray[i];\n\t }\n\n\t return callback(resultBuffer.buffer);\n\t}", "function encodeArrayBuffer(packet, supportsBinary, callback) {\n\t if (!supportsBinary) {\n\t return exports.encodeBase64Packet(packet, callback);\n\t }\n\n\t var data = packet.data;\n\t var contentArray = new Uint8Array(data);\n\t var resultBuffer = new Uint8Array(1 + data.byteLength);\n\n\t resultBuffer[0] = packets[packet.type];\n\t for (var i = 0; i < contentArray.length; i++) {\n\t resultBuffer[i+1] = contentArray[i];\n\t }\n\n\t return callback(resultBuffer.buffer);\n\t}", "function encodeArrayBuffer(packet, supportsBinary, callback) {\n\t if (!supportsBinary) {\n\t return exports.encodeBase64Packet(packet, callback);\n\t }\n\n\t var data = packet.data;\n\t var contentArray = new Uint8Array(data);\n\t var resultBuffer = new Uint8Array(1 + data.byteLength);\n\n\t resultBuffer[0] = packets[packet.type];\n\t for (var i = 0; i < contentArray.length; i++) {\n\t resultBuffer[i+1] = contentArray[i];\n\t }\n\n\t return callback(resultBuffer.buffer);\n\t}", "function encodeArrayBuffer(packet, supportsBinary, callback) {\n\t if (!supportsBinary) {\n\t return exports.encodeBase64Packet(packet, callback);\n\t }\n\n\t var data = packet.data;\n\t var contentArray = new Uint8Array(data);\n\t var resultBuffer = new Uint8Array(1 + data.byteLength);\n\n\t resultBuffer[0] = packets[packet.type];\n\t for (var i = 0; i < contentArray.length; i++) {\n\t resultBuffer[i+1] = contentArray[i];\n\t }\n\n\t return callback(resultBuffer.buffer);\n\t}", "function encodeArrayBuffer(packet, supportsBinary, callback) {\n\t if (!supportsBinary) {\n\t return exports.encodeBase64Packet(packet, callback);\n\t }\n\n\t var data = packet.data;\n\t var contentArray = new Uint8Array(data);\n\t var resultBuffer = new Uint8Array(1 + data.byteLength);\n\n\t resultBuffer[0] = packets[packet.type];\n\t for (var i = 0; i < contentArray.length; i++) {\n\t resultBuffer[i+1] = contentArray[i];\n\t }\n\n\t return callback(resultBuffer.buffer);\n\t}", "function encodeArrayBuffer(packet, supportsBinary, callback) {\n\t if (!supportsBinary) {\n\t return exports.encodeBase64Packet(packet, callback);\n\t }\n\n\t var data = packet.data;\n\t var contentArray = new Uint8Array(data);\n\t var resultBuffer = new Uint8Array(1 + data.byteLength);\n\n\t resultBuffer[0] = packets[packet.type];\n\t for (var i = 0; i < contentArray.length; i++) {\n\t resultBuffer[i+1] = contentArray[i];\n\t }\n\n\t return callback(resultBuffer.buffer);\n\t}", "function encodeArrayBuffer(packet, supportsBinary, callback) {\n\t if (!supportsBinary) {\n\t return exports.encodeBase64Packet(packet, callback);\n\t }\n\n\t var data = packet.data;\n\t var contentArray = new Uint8Array(data);\n\t var resultBuffer = new Uint8Array(1 + data.byteLength);\n\n\t resultBuffer[0] = packets[packet.type];\n\t for (var i = 0; i < contentArray.length; i++) {\n\t resultBuffer[i+1] = contentArray[i];\n\t }\n\n\t return callback(resultBuffer.buffer);\n\t}", "function ClientPacket(buffer) {\n this._buffer = buffer;\n this._offset = 0;\n this._data = [];\n}", "function _prepareOutDataBuffer(numberOfExtraBytesNeeded, encodeCtx) {\n if (encodeCtx.outDataCapacity - encodeCtx.outDataSize < numberOfExtraBytesNeeded) {\n // Not enough space - resize buffer.\n const oldOutData = encodeCtx.outData\n encodeCtx.outDataCapacity = Math.max(encodeCtx.outDataCapacity * 2, encodeCtx.outDataCapacity + numberOfExtraBytesNeeded)\n encodeCtx.outData = Buffer.alloc(encodeCtx.outDataCapacity)\n\n oldOutData.copy(encodeCtx.outData, 0, 0, encodeCtx.outDataSize)\n\n if (BJSON_ENCODE_LOGS_LEVEL > 0) {\n K.BJSON._debugLog('resized outData buffer to', encodeCtx.outDataCapacity)\n }\n }\n}", "function $SYhk$var$copyFromBufferString(n, list) {\n var p = list.head;\n var c = 1;\n var ret = p.data;\n n -= ret.length;\n\n while (p = p.next) {\n var str = p.data;\n var nb = n > str.length ? str.length : n;\n if (nb === str.length) ret += str;else ret += str.slice(0, n);\n n -= nb;\n\n if (n === 0) {\n if (nb === str.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = str.slice(nb);\n }\n\n break;\n }\n\n ++c;\n }\n\n list.length -= c;\n return ret;\n} // Copies a specified amount of bytes from the list of buffered data chunks.", "static fromBuffer(buffer) {\r\n return Precord.deserialize(Buffer.from(JSON.parse(buffer)));\r\n }", "function unprepare$ArrayBuffer16 (po, position) {\n let i16, i8, words\n let bytes\n let constructor;\n\n if (typeof po.ctr === 'string' && !po.ctr.match(/^[1-9][0-9]*$/)) {\n constructor = eval(po.ctr) /* pre-validated! */ // eslint-disable-line\n } else {\n constructor = ctors[po.ctr]\n }\n\n if (po.hasOwnProperty('ab16')) {\n bytes = po.ab16.length * 2\n if (po.hasOwnProperty('eb')) {\n bytes++\n }\n } else {\n bytes = po.len\n }\n\n words = Math.floor(bytes / 2) + (bytes % 2)\n i16 = new Int16Array(words)\n if (po.hasOwnProperty('ab16')) {\n for (let i = 0; i < po.ab16.length; i++) {\n i16[i] = po.ab16.charCodeAt(i)\n }\n } else {\n for (let j = 0; j < po.isl16.length; j++) {\n for (let i = 0; i < po.isl16[j][0].length; i++) {\n i16[po.isl16[j]['@'] + i] = po.isl16[j][0].charCodeAt(i)\n }\n }\n }\n i8 = new Int8Array(i16.buffer, i16.byteOffset, bytes)\n if (po.hasOwnProperty('eb')) {\n i8[i8.byteLength - 1] = po.eb.charCodeAt(0)\n }\n\n if (!littleEndian) {\n for (let i = 0; i < i8.length; i += 2) {\n i8[(i * 2) + 0] = i8[(i * 2) + 0] ^ i8[(i * 2) + 1]\n i8[(i * 2) + 1] = i8[(i * 2) + 1] ^ i8[(i * 2) + 0]\n i8[(i * 2) + 0] = i8[(i * 2) + 0] ^ i8[(i * 2) + 1]\n }\n }\n\n // If the object is an ArrayBuffer, just return the created buffer.\n if (constructor === ArrayBuffer) {\n return i8.buffer;\n }\n return new constructor(i8.buffer, i8.byteOffset) // eslint-disable-line\n}", "function copyFromBuffer(n, list) {\n var ret = Buffer.allocUnsafe(n);\n var p = list.head;\n var c = 1;\n p.data.copy(ret);\n n -= p.data.length;\n while (p = p.next) {\n var buf = p.data;\n var nb = n > buf.length ? buf.length : n;\n buf.copy(ret, ret.length - n, 0, nb);\n n -= nb;\n if (n === 0) {\n if (nb === buf.length) {\n ++c;\n if (p.next) list.head = p.next;else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = buf.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n }", "function copyFromBuffer(n, list) {\n var ret = Buffer.allocUnsafe(n);\n var p = list.head;\n var c = 1;\n p.data.copy(ret);\n n -= p.data.length;\n while ((p = p.next)) {\n var buf = p.data;\n var nb = n > buf.length ? buf.length : n;\n buf.copy(ret, ret.length - n, 0, nb);\n n -= nb;\n if (n === 0) {\n if (nb === buf.length) {\n ++c;\n if (p.next) list.head = p.next;\n else list.head = list.tail = null;\n } else {\n list.head = p;\n p.data = buf.slice(nb);\n }\n break;\n }\n ++c;\n }\n list.length -= c;\n return ret;\n }", "toBuffer() {\n const superbuff = super.toBuffer();\n const bsize = this.amount.length + superbuff.length;\n const barr = [this.amount, superbuff];\n return buffer_1.Buffer.concat(barr, bsize);\n }", "function deFramer(onFrame) {\n var buffer;\n var state = 0;\n var length = 0;\n var offset;\n return function parse(chunk) {\n for (var i = 0, l = chunk.length; i < l; i++) {\n switch (state) {\n case 0: length |= chunk[i] << 24; state = 1; break;\n case 1: length |= chunk[i] << 16; state = 2; break;\n case 2: length |= chunk[i] << 8; state = 3; break;\n case 3: length |= chunk[i]; state = 4;\n buffer = bops.create(length);\n offset = 0;\n break;\n case 4:\n var len = l - i;\n var emit = false;\n if (len + offset >= length) {\n emit = true;\n len = length - offset;\n }\n // TODO: optimize for case where a copy isn't needed can a slice can\n // be used instead?\n bops.copy(chunk, buffer, offset, i, i + len);\n offset += len;\n i += len - 1;\n if (emit) {\n state = 0;\n length = 0;\n var _buffer = buffer\n buffer = undefined;\n offset = undefined;\n onFrame(_buffer);\n }\n break;\n }\n }\n };\n}", "function splitPackets(bin) {\n // number of packets\n var num = buf2long(bin.slice(0, 2)),\n j = 2,\n packets = [];\n\n for(var i=0; i<num; i++) {\n // first two bytes is the packet length\n var size = buf2long(bin.slice(j, j+2)),\n packet = bin.slice(j+2, j+2+size);\n\n packets.push(packet);\n\n j += 2 + size;\n }\n\n return packets;\n }", "function encodeArrayBuffer(packet, supportsBinary, callback) {\n if (!supportsBinary) {\n return exports.encodeBase64Packet(packet, callback);\n }\n\n var data = packet.data;\n var contentArray = new Uint8Array(data);\n var resultBuffer = new Uint8Array(1 + data.byteLength);\n resultBuffer[0] = packets[packet.type];\n\n for (var i = 0; i < contentArray.length; i++) {\n resultBuffer[i + 1] = contentArray[i];\n }\n\n return callback(resultBuffer.buffer);\n}", "function RansEncodeStripe(hdr, src, N) {\n if (N == 0)\n\tN = 4; // old default\n\n // Split into multiple streams\n var part = new Array(N)\n var ulen = new Array(N)\n for (var s = 0; s < N; s++) {\n\tulen[s] = Math.floor(src.length / N) + ((src.length % N) > s);\n\tpart[s] = new Array(ulen[s])\n }\n\n for (var x = 0, i = 0; i < src.length; i+=N, x++) {\n\tfor (var j = 0; j < N; j++)\n\t if (x < part[j].length)\n\t\tpart[j][x] = src[i+j]\n }\n\n // Compress each part\n var comp = new Array(N)\n var total = 0\n for (var s = 0; s < N; s++) {\n\t// Example: try O0 and O1 and choose best\n\tvar comp0 = encode(part[s], 0)\n\tvar comp1 = encode(part[s], 1)\n\tcomp[s] = (comp1.length < comp0.length) ? comp1 : comp0\n\ttotal += comp[s].length\n }\n\n // Serialise\n var out = new IOStream(\"\", 0, total+5*N+1)\n out.WriteByte(N)\n for (var s = 0; s < N; s++)\n\tout.WriteUint7(comp[s].length)\n\n for (var s = 0; s < N; s++)\n\tout.WriteData(comp[s], comp[s].length)\n\n return out.buf.slice(0, out.buf.pos)\n}", "function encodeArrayBuffer(packet, supportsBinary, callback) {\n if (!supportsBinary) {\n return exports.encodeBase64Packet(packet, callback);\n }\n\n var data = packet.data;\n var contentArray = new Uint8Array(data);\n var resultBuffer = new Uint8Array(1 + data.byteLength);\n\n resultBuffer[0] = packets[packet.type];\n for (var i = 0; i < contentArray.length; i++) {\n resultBuffer[i+1] = contentArray[i];\n }\n\n return callback(resultBuffer.buffer);\n}", "function encodeArrayBuffer(packet, supportsBinary, callback) {\n if (!supportsBinary) {\n return exports.encodeBase64Packet(packet, callback);\n }\n\n var data = packet.data;\n var contentArray = new Uint8Array(data);\n var resultBuffer = new Uint8Array(1 + data.byteLength);\n\n resultBuffer[0] = packets[packet.type];\n for (var i = 0; i < contentArray.length; i++) {\n resultBuffer[i+1] = contentArray[i];\n }\n\n return callback(resultBuffer.buffer);\n}", "function encodeArrayBuffer(packet, supportsBinary, callback) {\n if (!supportsBinary) {\n return exports.encodeBase64Packet(packet, callback);\n }\n\n var data = packet.data;\n var contentArray = new Uint8Array(data);\n var resultBuffer = new Uint8Array(1 + data.byteLength);\n\n resultBuffer[0] = packets[packet.type];\n for (var i = 0; i < contentArray.length; i++) {\n resultBuffer[i+1] = contentArray[i];\n }\n\n return callback(resultBuffer.buffer);\n}", "function encodeArrayBuffer(packet, supportsBinary, callback) {\n if (!supportsBinary) {\n return exports.encodeBase64Packet(packet, callback);\n }\n\n var data = packet.data;\n var contentArray = new Uint8Array(data);\n var resultBuffer = new Uint8Array(1 + data.byteLength);\n\n resultBuffer[0] = packets[packet.type];\n for (var i = 0; i < contentArray.length; i++) {\n resultBuffer[i+1] = contentArray[i];\n }\n\n return callback(resultBuffer.buffer);\n}", "function encodeArrayBuffer(packet, supportsBinary, callback) {\n if (!supportsBinary) {\n return exports.encodeBase64Packet(packet, callback);\n }\n\n var data = packet.data;\n var contentArray = new Uint8Array(data);\n var resultBuffer = new Uint8Array(1 + data.byteLength);\n\n resultBuffer[0] = packets[packet.type];\n for (var i = 0; i < contentArray.length; i++) {\n resultBuffer[i+1] = contentArray[i];\n }\n\n return callback(resultBuffer.buffer);\n}", "function encodeArrayBuffer(packet, supportsBinary, callback) {\n if (!supportsBinary) {\n return exports.encodeBase64Packet(packet, callback);\n }\n\n var data = packet.data;\n var contentArray = new Uint8Array(data);\n var resultBuffer = new Uint8Array(1 + data.byteLength);\n\n resultBuffer[0] = packets[packet.type];\n for (var i = 0; i < contentArray.length; i++) {\n resultBuffer[i+1] = contentArray[i];\n }\n\n return callback(resultBuffer.buffer);\n}", "function encodeArrayBuffer(packet, supportsBinary, callback) {\n if (!supportsBinary) {\n return exports.encodeBase64Packet(packet, callback);\n }\n\n var data = packet.data;\n var contentArray = new Uint8Array(data);\n var resultBuffer = new Uint8Array(1 + data.byteLength);\n\n resultBuffer[0] = packets[packet.type];\n for (var i = 0; i < contentArray.length; i++) {\n resultBuffer[i+1] = contentArray[i];\n }\n\n return callback(resultBuffer.buffer);\n}" ]
[ "0.6491757", "0.6442412", "0.63879544", "0.6364918", "0.5896878", "0.5847301", "0.54266447", "0.54266447", "0.54266447", "0.5416601", "0.53911227", "0.5325642", "0.5325642", "0.5305685", "0.5305685", "0.5305685", "0.5305685", "0.5305685", "0.53015953", "0.53015953", "0.53015953", "0.52680993", "0.52518636", "0.52456486", "0.5239647", "0.52300864", "0.5205381", "0.5196584", "0.5196584", "0.5129781", "0.5128647", "0.511519", "0.5112122", "0.5090681", "0.5082282", "0.5074443", "0.50606954", "0.504314", "0.50361603", "0.5025207", "0.50083184", "0.4996312", "0.49845296", "0.4974324", "0.4974057", "0.49737442", "0.49703825", "0.49652976", "0.49580798", "0.49580798", "0.49521762", "0.4939174", "0.49378082", "0.49253386", "0.49224707", "0.49224707", "0.49224707", "0.49224707", "0.49224707", "0.49178553", "0.49059346", "0.49026695", "0.4902458", "0.49010664", "0.4899922", "0.48967648", "0.4893942", "0.4886645", "0.4886645", "0.48826692", "0.4875633", "0.48667926", "0.48636347", "0.48630837", "0.48630837", "0.48630837", "0.48630837", "0.48630837", "0.48630837", "0.48630837", "0.48630837", "0.48582792", "0.485058", "0.48464844", "0.4842889", "0.48423323", "0.48278013", "0.48260108", "0.48168418", "0.48164493", "0.48158595", "0.48132974", "0.4812658", "0.48094106", "0.48094106", "0.48094106", "0.48094106", "0.48094106", "0.48094106", "0.48094106" ]
0.65920836
0
Deallocates a parser's resources
destroy() { if (this.reconstructor) { this.reconstructor.finishedReconstruction(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "deinitParser() {\n console.log(\"CaptionsParser :: deinitParser\");\n }", "cleanup() {\n debug(\"cleanup\");\n const subsLength = this.subs.length;\n for (let i = 0; i < subsLength; i++) {\n const sub = this.subs.shift();\n sub.destroy();\n }\n this.decoder.destroy();\n }", "cleanup() {\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }", "destructResources() {\n this.peerComm.removeEventListener(\n PeerCommunicationConstants.PEER_DATA,\n this.onPeerDataReceived.bind(this)\n );\n this.receivedBuffer = null;\n }", "cleanup() {\n debug(\"cleanup\");\n this.subs.forEach(subDestroy => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }", "destroy () {\n\t\tthis.disposables.dispose()\n\t\tthis.classRanges.clear()\n\t\tthis.methodRanges.clear()\n\t\tthis.classMapping.clear()\n\t\tthis.methodMapping.clear()\n\t}", "cleanup() {\n debug(\"cleanup\");\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }", "cleanup() {\n debug(\"cleanup\");\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }", "cleanup() {\n debug(\"cleanup\");\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }", "_destroy() {\n\t this._source = null;\n\t this._offset = null;\n\t this._length = null;\n\t}", "function freeMemory(){\n\t//kill all tweenmax tweens\n\tTweenMax.killTweensOf(\"*\");\n\n\t//kill all timers\n\tfor(var i=0; i<timer.length; i++){\n\t\tclearTimeout(timer[i]);\n\t}\n}", "destroy() {\n this.impl.destroy();\n this.impl = null;\n this.format = null;\n this.defaultUniformBuffer = null;\n }", "cleanParser() {\n this.bnodes = {}\n this.why = null\n }", "detach() {\n _commons__WEBPACK_IMPORTED_MODULE_0__[\"finalizeResources\"].call(this);\n }", "destroy()\n {\n this._textCtx = null;\n this.canvas = null;\n\n this.style = null;\n }", "_clearResources() {\n }", "__$destroy() {\n if (this.isResFree()) {\n //console.log(\"MeshBase::__$destroy()... this.m_attachCount: \"+this.m_attachCount);\n this.m_ivs = null;\n this.m_bufDataList = null;\n this.m_bufDataStepList = null;\n this.m_bufStatusList = null;\n this.trisNumber = 0;\n this.m_transMatrix = null;\n }\n }", "function destroy() {\n\n for (var key in options.cssClasses) {\n if (!options.cssClasses.hasOwnProperty(key)) {\n continue;\n }\n removeClass(scope_Target, options.cssClasses[key]);\n }\n\n while (scope_Target.firstChild) {\n scope_Target.removeChild(scope_Target.firstChild);\n }\n\n delete scope_Target.noUiSlider;\n }", "function free()\n\t{\n\t\tvar i, count = _list.length;\n\n\t\tfor (i = 0; i < count; ++i) {\n\t\t\t_list[i].clean();\n\t\t}\n\n\t\t_list.length = 0;\n\t}", "function destroy() {\n for (var key in options.cssClasses) {\n if (!options.cssClasses.hasOwnProperty(key)) {\n continue;\n }\n removeClass(scope_Target, options.cssClasses[key]);\n }\n\n while (scope_Target.firstChild) {\n scope_Target.removeChild(scope_Target.firstChild);\n }\n\n delete scope_Target.noUiSlider;\n }", "function destroy() {\n for (var key in options.cssClasses) {\n if (!options.cssClasses.hasOwnProperty(key)) {\n continue;\n }\n removeClass(scope_Target, options.cssClasses[key]);\n }\n\n while (scope_Target.firstChild) {\n scope_Target.removeChild(scope_Target.firstChild);\n }\n\n delete scope_Target.noUiSlider;\n }", "function destroy() {\n for (var key in options.cssClasses) {\n if (!options.cssClasses.hasOwnProperty(key)) {\n continue;\n }\n removeClass(scope_Target, options.cssClasses[key]);\n }\n\n while (scope_Target.firstChild) {\n scope_Target.removeChild(scope_Target.firstChild);\n }\n\n delete scope_Target.noUiSlider;\n }", "function destroy() {\n for (var key in options.cssClasses) {\n if (!options.cssClasses.hasOwnProperty(key)) {\n continue;\n }\n removeClass(scope_Target, options.cssClasses[key]);\n }\n\n while (scope_Target.firstChild) {\n scope_Target.removeChild(scope_Target.firstChild);\n }\n\n delete scope_Target.noUiSlider;\n }", "onDestroy() {\n this.rotAnimations.forEach((anim) => {\n anim.complete();\n });\n if (this.timeouts[0]) clearTimeout(this.timeouts[0]);\n if (this.timeouts[1]) clearTimeout(this.timeouts[1]);\n this.rotatable1.destroy();\n this.rotatable2.destroy();\n if (this.followers[0]) this.followers[0].forEach((f) => f.destroy());\n if (this.followers[1]) this.followers[1].forEach((f) => f.destroy());\n this.followers = [];\n if ( this.paths[0]) this.paths[0].destroy();\n if ( this.paths[1]) this.paths[1].destroy();\n this.paths = [];\n this.toprg.destroy();\n this.botrg.destroy();\n if (this.emitters) {\n this.emitters.forEach((emitter) => {\n emitter.killAll();\n emitter.stop();\n });\n }\n\n }", "free() {\n libvosk.vosk_recognizer_free(this.handle);\n }", "function cleanup() {\n res.removeListener('finish', makePoint);\n res.removeListener('error', cleanup);\n res.removeListener('close', cleanup);\n }", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "function destroy ( ) {\n\n\t\tfor ( var key in options.cssClasses ) {\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\n\t\t}\n\n\t\twhile (scope_Target.firstChild) {\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t}\n\n\t\tdelete scope_Target.noUiSlider;\n\t}", "destroy() {\n this._pipeline._onFrameUpdateInternal.unbind(this._frameUpdate);\n this._found = [];\n this._lastDetected = [];\n this._z.barcode_finder_destroy(this._impl);\n }", "dispose() {\n this._rules.forEach(rule => rule.dispose());\n this._rules.length = 0;\n delete this._rules;\n }", "function destroy() {\n cssClasses.forEach(function(cls) {\n if (!cls) {\n return;\n } // Ignore empty classes\n removeClass(scope_Target, cls);\n });\n while (scope_Target.firstChild) {\n scope_Target.removeChild(scope_Target.firstChild);\n }\n delete scope_Target.noUiSlider;\n }", "function destroy() {\n // remove protected internal listeners\n removeEvent(INTERNAL_EVENT_NS.aria);\n removeEvent(INTERNAL_EVENT_NS.tooltips);\n Object.keys(options.cssClasses).forEach(function (key) {\n removeClass(scope_Target, options.cssClasses[key]);\n });\n while (scope_Target.firstChild) {\n scope_Target.removeChild(scope_Target.firstChild);\n }\n delete scope_Target.noUiSlider;\n }", "dispose() {\n this._detachMapMoveHandlers();\n this._options = null;\n this._spyMap = null;\n this._primaryMap = null;\n }", "dispose() {\n this.__array.length = 0;\n delete this.__node;\n delete this.__array;\n }", "function memoryCleanUp(){\n /*to be implemented*/\n}", "destroy() {\n // unbind (texture) asset references\n for (const asset in this._assetReferences) {\n this._assetReferences[asset]._unbind();\n }\n this._assetReferences = null;\n\n super.destroy();\n }", "function destroy ( ) {\r\n\r\n\t\tfor ( var key in options.cssClasses ) {\r\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\r\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\r\n\t\t}\r\n\r\n\t\twhile (scope_Target.firstChild) {\r\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\r\n\t\t}\r\n\r\n\t\tdelete scope_Target.noUiSlider;\r\n\t}", "function destroy ( ) {\r\n\r\n\t\tfor ( var key in options.cssClasses ) {\r\n\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\r\n\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\r\n\t\t}\r\n\r\n\t\twhile (scope_Target.firstChild) {\r\n\t\t\tscope_Target.removeChild(scope_Target.firstChild);\r\n\t\t}\r\n\r\n\t\tdelete scope_Target.noUiSlider;\r\n\t}", "destroy()\n {\n this.div = null;\n\n for (let i = 0; i < this.children.length; i++)\n {\n this.children[i].div = null;\n }\n\n window.document.removeEventListener('mousemove', this._onMouseMove);\n window.removeEventListener('keydown', this._onKeyDown);\n\n this.pool = null;\n this.children = null;\n this.renderer = null;\n }", "destroy() {\n this.container.removeChild(this.inspiredSprite);\n this.container.removeChild(this.sprite);\n this.container.removeChild(this.halo);\n this.container.removeChild(this.highlight);\n delete this.container;\n }", "free() {\n const buf = new Uint8Array(\n this.prelude.memory.buffer,\n this.pointer,\n this.length\n )\n\n const str = new TextDecoder('utf-8').decode(buf)\n\n this.prelude.dealloc(this.pointer, this.length + 1)\n return str\n }", "function unload() {\n // clean up any globals or other cruft before being removed before i get killed.\n }", "function destroy ( ) {\r\n\r\n\t\t\tfor ( var key in options.cssClasses ) {\r\n\t\t\t\tif ( !options.cssClasses.hasOwnProperty(key) ) { continue; }\r\n\t\t\t\tremoveClass(scope_Target, options.cssClasses[key]);\r\n\t\t\t}\r\n\r\n\t\t\twhile (scope_Target.firstChild) {\r\n\t\t\t\tscope_Target.removeChild(scope_Target.firstChild);\r\n\t\t\t}\r\n\r\n\t\t\tdelete scope_Target.noUiSlider;\r\n\t\t}", "deinit() {\n Logger.debug(`Deinitializing renderer...`);\n\n for(let name of Object.keys(this.shaders)) {\n this.shaders[name].deinit();\n }\n\n this.shaders = {};\n\n for(let name of Object.keys(this.meshes)) {\n this.meshes[name].deinit();\n }\n\n this.meshes = {};\n }", "destructor() {\n super.destructor()\n this.inputs.destroy()\n this.output.destroy()\n this.inputs = null\n this.output = null\n }", "function destroy ( ) {\n\t\n\t\t\tcssClasses.forEach(function(cls){\n\t\t\t\tif ( !cls ) { return; } // Ignore empty classes\n\t\t\t\tremoveClass(scope_Target, cls);\n\t\t\t});\n\t\n\t\t\twhile (scope_Target.firstChild) {\n\t\t\t\tscope_Target.removeChild(scope_Target.firstChild);\n\t\t\t}\n\t\n\t\t\tdelete scope_Target.noUiSlider;\n\t\t}", "function destroy () {\n\t\t// TODO\n\t}", "function destroy(){}", "__cleanUp() {\n // Data cursor cleanup\n if (this._dataCursor) {\n this.removeChild(this._dataCursor);\n this._dataCursor = null;\n }\n\n if (this.EventManager) {\n // Tooltip cleanup\n this.EventManager.hideHoverFeedback();\n\n // Event handler cleanup\n this.EventManager.setPanZoomHandler(null);\n this.EventManager.setMarqueeZoomHandler(null);\n this.EventManager.setMarqueeSelectHandler(null);\n\n // Drag button cleanup\n this.EventManager.panButton = null;\n this.EventManager.zoomButton = null;\n this.EventManager.selectButton = null;\n }\n\n // Remove pie center content\n if (this.pieCenterDiv) {\n this.getCtx().getContainer().removeChild(this.pieCenterDiv);\n this.pieCenterDiv = null;\n }\n\n // Clear the list of registered peers\n this.Peers = [];\n\n // Clear scrollbars, buttons\n this.xScrollbar = null;\n this.yScrollbar = null;\n\n if (this.dragButtons) {\n this.removeChild(this.dragButtons);\n this.dragButtons.destroy();\n this.dragButtons = null;\n }\n\n this._plotArea = null;\n this._areaContainer = null;\n this._dataLabels = null;\n\n // Reset cache\n this.getCache().clearCache();\n }", "function destroy(){\n\t\t// TODO\n\t}", "destroy() {\n if (this._dom.tool !== null) {\n\n // Remove event listeners\n $.ignore(\n document,\n {\n 'mousemove touchmove': this._handlers.drag,\n 'mouseout mouseup touchend': this._handlers.endDrag\n }\n )\n\n $.ignore(\n document,\n {\n 'mousemove touchmove': this._handlers.resize,\n 'mouseout mouseup touchend': this._handlers.endResize\n }\n )\n\n // Remove the area, region, frame, image and controls\n this._dom.container.removeChild(this._dom.tool)\n this._dom.controls = null\n this._dom.frame = null\n this._dom.image = null\n }\n }", "destroy() {\n // Try to delete as much about anything that could lead to memory leaks.\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Memory_Management\n this.ytPlayer.destroy();\n this.ytPlayer = undefined;\n this.rootElement.parentNode\n .removeChild(this.rootElement);\n this.rootElement = undefined;\n this.ytPlayerOptions = undefined;\n this.options = undefined;\n }", "dispose() {\n const { _context, _shaders, _textures, _renderTargets, _events } = this;\n\n this._stopAnimation();\n _context.clear(_context.COLOR_BUFFER_BIT);\n\n for (const shader of _shaders.keys()) {\n this.unregisterShader(shader);\n }\n for (const texture of _textures.keys()) {\n this.unregisterTexture(texture);\n }\n for (const renderTarget of _renderTargets.keys()) {\n this.unregisterRenderTarget(renderTarget);\n }\n\n _events.dispose();\n\n this._extensions = null;\n this._lastTimestamp = null;\n this._canvas = null;\n this._context = null;\n this._shaders = null;\n this._textures = null;\n this._renderTargets = null;\n this._renderTargetsStack = null;\n this._events = null;\n this._activeShader = null;\n this._activeRenderTarget = null;\n this._activeViewportSize = null;\n this._clearColor = null;\n this._projectionMatrix = null;\n this._viewMatrix = null;\n this._modelMatrix = null;\n this._blendingConstants = null;\n this._stats = null;\n this._shaderApplierOut = null;\n this._shaderApplierGetValue = null;\n this.__onFrame = null;\n }", "releaseResources() {\n if (this._audioFileStartedSubscriber) {\n this._audioFileStartedSubscriber.remove();\n delete this._audioFileStartedSubscriber;\n }\n if (this._audioFileStoppedSubscriber) {\n this._audioFileStoppedSubscriber.remove();\n delete this._audioFileStoppedSubscriber;\n }\n AudioFileModule.releaseResources(this.fileId);\n }", "function invalidateResources() {\n\tdelete ResBundle.strings;\n\tresBundle = i18n.$L.rb = undefined;\n}", "destroy() {\n\t\tthis.runFinalReadReport()\n\t\tthis.stopObservation()\n\t\tthis.currentlyObservedElements = new Set()\n\t\tthis.visibleElements = new Set()\n\t}", "detachResource (resource) {\n this[kResources].delete(resource)\n }", "function cleanUp() {\n $(\"audio\").remove();\n $(\"img\").remove();\n $(\"h2\").remove();\n audioTags = [];\n h2s = [];\n imgs = [];\n var curRow = 0;\n var curCol = 0;\n }", "dispose() {\n this._observers = null;\n this._cursor = null;\n }", "function templateCollectGarbage(){\n var moduleType = $(\"#template-menu\").attr(\"data-current-module-type\");\n if( moduleType != \"slideshow\" ){\n currentSlide = null;\n if( thumbsList != null ){\n thumbsList.destroy();\n thumbsList = null;\n }\n }\n moduleType = null;\n }", "_cleanup() {\n this.readable = false;\n delete this._current;\n delete this._waiting;\n this._openQueue.die();\n\n this._queue.forEach((data) => {\n data.cleanup();\n });\n this._queue = [];\n }", "dispose() {\n this.trigger('dispose');\n this.decrypter_.terminate();\n this.mainPlaylistLoader_.dispose();\n this.mainSegmentLoader_.dispose();\n\n if (this.loadOnPlay_) {\n this.tech_.off('play', this.loadOnPlay_);\n }\n\n ['AUDIO', 'SUBTITLES'].forEach((type) => {\n const groups = this.mediaTypes_[type].groups;\n\n for (const id in groups) {\n groups[id].forEach((group) => {\n if (group.playlistLoader) {\n group.playlistLoader.dispose();\n }\n });\n }\n });\n\n this.audioSegmentLoader_.dispose();\n this.subtitleSegmentLoader_.dispose();\n this.sourceUpdater_.dispose();\n this.timelineChangeController_.dispose();\n\n this.stopABRTimer_();\n\n if (this.updateDuration_) {\n this.mediaSource.removeEventListener('sourceopen', this.updateDuration_);\n }\n\n this.mediaSource.removeEventListener('durationchange', this.handleDurationChange_);\n\n // load the media source into the player\n this.mediaSource.removeEventListener('sourceopen', this.handleSourceOpen_);\n this.mediaSource.removeEventListener('sourceended', this.handleSourceEnded_);\n this.off();\n }", "_destroy() {}", "function cleanMemory() {\n var elementCache = _pools.pools.elementObject.cache;\n var attributeCache = _pools.pools.attributeObject.cache;\n\n // Empty all element allocations.\n elementCache.allocated.forEach(function (v) {\n if (elementCache.free.length < _pools.count) {\n elementCache.free.push(v);\n }\n });\n\n elementCache.allocated.clear();\n\n // Clean out unused elements.\n _cache.NodeCache.forEach(function (node, descriptor) {\n if (!elementCache.protected.has(descriptor)) {\n _cache.NodeCache.delete(descriptor);\n }\n });\n\n // Empty all attribute allocations.\n attributeCache.allocated.forEach(function (v) {\n if (attributeCache.free.length < _pools.count) {\n attributeCache.free.push(v);\n }\n });\n\n attributeCache.allocated.clear();\n}", "Unload()\n {\n // TODO: Unload buffers\n }", "destroy() {\n this._output = null;\n this._number = null;\n this._octaveOffset = 0;\n this.removeListener();\n }", "destroy() {\n this._output = null;\n this._number = null;\n this._octaveOffset = 0;\n this.removeListener();\n }", "function unload() {\n // clean up any globals or other cruft before being removed before i get killed.\n console.log('unload layout plugin');\n }", "destroy() {\n this.texture = null;\n this.matrix = null;\n }", "destroy() {\n this.element.remove();\n this.subscriptions.dispose();\n this.editorSubs.dispose();\n }", "destroy() {\n this._pipe && this._pipe.destroy();\n this._inbound && this._inbound.destroy();\n this._outbound && this._outbound.destroy();\n this._pipe = null;\n this._inbound = null;\n this._outbound = null;\n this._presets = null;\n this._context = null;\n this._proxyRequest = null;\n }", "dispose() {\n this.masterPlaylistLoader_.dispose();\n this.audioTracks_.forEach((track) => {\n track.dispose();\n });\n this.audioTracks_.length = 0;\n this.mainSegmentLoader_.dispose();\n this.audioSegmentLoader_.dispose();\n }", "destroy() {\n this.a.destroy();\n this.b.destroy();\n if (this.measuring > -1)\n (this.dom.ownerDocument.defaultView || window).cancelAnimationFrame(this.measuring);\n this.dom.remove();\n }", "destroy() {\n this.disposables.dispose();\n this.controlView.destroy();\n this.extensionView.destroy();\n this.fileView.destroy();\n this.contentView.destroy();\n this.element.remove();\n // Do not stop external process.\n this.serverProcess = null;\n }", "destroy() {\n textureAsset.destroy(); // Samplers allocated from `samplerLib` are not required and\n // should not be destroyed.\n // this._sampler.destroy();\n }", "cleanup() {}", "cleanup() {}", "destroy () {\n this._cache = undefined;\n }", "destroy() {\n this.personalInfoCollection = null;\n this.leucineAllowance = null;\n this.calorieGoal = null;\n }", "function clean () {\n const values = Object.values(resources);\n\n if (values.length < conf.CACHE_SIZE) {\n return\n }\n\n values.forEach(resource => {\n if (!resource.clean) {\n if (Object.keys(resource.callbacks).length === 0) {\n resource.clean = true;\n }\n return\n }\n if (resource.plugin.clean && resource.plugin.clean(resource)) {\n return\n }\n clearTimeout(resources[resource.url].timeout);\n delete resources[resource.url];\n });\n}", "_dispose() {\n\n delete window.FlowUI['_loaders'][this.id];\n\n }", "destroy() {\n for (let plugin of this.plugins)\n plugin.destroy(this);\n this.plugins = [];\n this.inputState.destroy();\n this.dom.remove();\n this.observer.destroy();\n if (this.measureScheduled > -1)\n this.win.cancelAnimationFrame(this.measureScheduled);\n this.destroyed = true;\n }", "function dispose() {\n delete filters[dimensionName];\n delete datasets[dimensionName];\n }", "function deep_dispose() {\n if (instrument != undefined && instrument != null) {\n instrument.dispose()\n instrument = null\n }\n }", "unload() {\n controls.dispose();\n renderer.dispose();\n }", "__destroy() {\n this.__removeChildren();\n this.__remove();\n }", "cleanup() {\n\n\t}", "destroy() {\n super.destroy();\n this.destroyDependentModules();\n if (!isNullOrUndefined(this.viewer)) {\n this.viewer.destroy();\n }\n this.viewer = undefined;\n if (!isNullOrUndefined(this.element)) {\n this.element.classList.remove('e-documenteditor');\n this.element.innerHTML = '';\n }\n this.element = undefined;\n this.findResultsList = [];\n this.findResultsList = undefined;\n }", "dispose() {\n\n if (this.popover) {\n this.popover.dispose()\n }\n\n this.$viewport.get(0).remove()\n\n // Null out all properties -- this should not be neccessary, but just in case there is a\n // reference to self somewhere we want to free memory.\n for (let key of Object.keys(this)) {\n this[key] = undefined\n }\n }", "destroy() {\n this.shape = null;\n this.holes.length = 0;\n this.holes = null;\n this.points.length = 0;\n this.points = null;\n this.lineStyle = null;\n this.fillStyle = null;\n }", "unload() {}" ]
[ "0.6598592", "0.62988186", "0.6282632", "0.61542046", "0.6127689", "0.6106722", "0.6092097", "0.6092097", "0.6091555", "0.59782225", "0.5965163", "0.59142655", "0.58554417", "0.58030844", "0.57905257", "0.57028115", "0.56914043", "0.5683034", "0.56631476", "0.5648176", "0.5648176", "0.5648176", "0.5648176", "0.5637568", "0.56132305", "0.5580341", "0.5575249", "0.5575249", "0.5575249", "0.5575249", "0.5575249", "0.5575249", "0.5575249", "0.5575249", "0.5575249", "0.5575249", "0.5575249", "0.5575249", "0.5572006", "0.55678076", "0.55625856", "0.5561981", "0.5549281", "0.5544617", "0.55396086", "0.5538088", "0.55297893", "0.55297893", "0.551553", "0.5507838", "0.550219", "0.54992753", "0.54987556", "0.5498212", "0.54972273", "0.5493156", "0.5483391", "0.54717004", "0.54687595", "0.54622394", "0.54603344", "0.5435045", "0.54265785", "0.5422981", "0.5418973", "0.53884065", "0.53718656", "0.5370004", "0.5364983", "0.5358385", "0.5353104", "0.5352613", "0.53515685", "0.53502804", "0.53494704", "0.53424877", "0.53382635", "0.5334539", "0.5334353", "0.5333672", "0.5328544", "0.53180647", "0.5309503", "0.5289922", "0.5282963", "0.5264288", "0.5264288", "0.5261955", "0.5260268", "0.5257911", "0.5247747", "0.52460593", "0.5242614", "0.523925", "0.5231164", "0.523109", "0.5229994", "0.52297777", "0.5228341", "0.5227924", "0.52277577" ]
0.0
-1
Cleans up binary packet reconstruction variables.
finishedReconstruction() { this.reconPack = null; this.buffers = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "finishedReconstruction() {\n this.reconPack = null;\n this.buffers = [];\n }", "finishedReconstruction() {\n this.reconPack = null;\n this.buffers = [];\n }", "finishedReconstruction() {\n this.reconPack = null;\n this.buffers = [];\n }", "finishedReconstruction() {\n this.reconPack = null;\n this.buffers = [];\n }", "function _removeVariables() {\n underlay = null;\n modal = null;\n yesEl = null;\n noEl = null;\n _yesClicked = null;\n _noClicked = null;\n yes = null;\n no = null;\n }", "reset() {\n // Initial values\n this._data = new WordArray();\n this._nDataBytes = 0;\n }", "cleanup() {\n debug(\"cleanup\");\n const subsLength = this.subs.length;\n for (let i = 0; i < subsLength; i++) {\n const sub = this.subs.shift();\n sub.destroy();\n }\n this.decoder.destroy();\n }", "cleanup() {\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }", "cleanup() {\n debug(\"cleanup\");\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }", "cleanParser() {\n this.bnodes = {}\n this.why = null\n }", "cleanup() {\n debug(\"cleanup\");\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }", "cleanup() {\n debug(\"cleanup\");\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }", "reset() {\n this.length = 0;\n this._subParamsLength = 0;\n this._rejectDigits = false;\n this._rejectSubDigits = false;\n this._digitIsSub = false;\n }", "cleanup() {\n debug(\"cleanup\");\n this.subs.forEach(subDestroy => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }", "reset() {\n this.hasStepped = false;\n this[BARGS] = [].concat(this[OARGS])\n this[SDATA] = []\n }", "function resetVars() {\n\t\tidArrays = [];\n\t\t_3DArrays = [];\n\t\t$scope.dataSetName = \"\";\n\t\tdataName = null;\n\t\tdragZone = {'left':-1, 'top':-1, 'right':-1, 'bottom':-1, 'name':\"\", 'ID':\"\"};\n\t\tsources = 0;\n\t\tNs = [];\n\t\tunique = 0;\n\t\tlocalSelections = [];\n\t}", "function resetMemory(){\n\tRawMemory.set('{}');\n\tMemory.creeps = {};\n\tMemory.rooms = {};\n\tMemory.flags = {};\n\tMemory.spawns = {};\n}", "function CleanTempVariables()\n{\n\tarrDanger = [];\n\t\n\t//cache current targets for next frame\n\tfor(var i = 0; i < NUMBER_OF_TANK; i++)\n\t\tarrOldTargets[i] = arrTargets[i];\n\t\t\n\tarrTargets = [];\n}", "clear() {\n this.packetHandlers = {}\n }", "function cleanup(){\n\t\t\tdelete pending[ serial]\n\t\t}", "_cleanUp() {\n this.removeChildren();\n\n // Remove references to the old shapes to ensure that they're rerendered\n this._q2Box = null;\n this._q3Box = null;\n this._medianLine = null;\n this._outerBorderShape = null;\n this._innerBorderShape = null;\n }", "reset(){\n this.input = '';\n this.output = '';\n this.outputTuples = [];\n }", "function clear(ok) {\n\tok&&ok.done?ok.done():0\n\tlet variableValues, variables;\n\ttrace(\"clear all variables, methods, ...\");\n\tvariables = {};\n\tvariableValues = {};\n\tcontext.testing = true;\n\tthe.variables = {}//.clear();\n\tthe.variableTypes = {}//.clear();\n\tthe.variableValues = {}//.clear();\n\tcontext.in_hash = false;\n\tcontext.in_list = false;\n\tcontext.in_condition = false;\n\tcontext.in_args = false;\n\tcontext.in_params = false;\n\tcontext.in_pipe = false;\n\tif (!context.use_tree) {\n\t\tdo_interpret();\n\t}\n}", "gc() {\n // clear all arrays\n this.animation=null;\n this.keys=null;\n // clear variables\n this.generate=null;\n this.move=null;\n }", "static cleanBin() {\n // TODO:\n }", "resetData() {\n\t\t\tthis.initFlags();\n\t\t\tthis.initMetadata();\n\t\t}", "_destroy() {\n\t this._source = null;\n\t this._offset = null;\n\t this._length = null;\n\t}", "clearHeader_() {\n this.fmt.cbSize = 0;\n this.fmt.validBitsPerSample = 0;\n this.fact.chunkId = '';\n this.ds64.chunkId = '';\n }", "clearHeader_() {\r\n this.fmt.cbSize = 0;\r\n this.fmt.validBitsPerSample = 0;\r\n this.fact.chunkId = '';\r\n this.ds64.chunkId = '';\r\n }", "reset() {\n this.data = {};\n this.type = null;\n }", "reset() {\n this.samples_ = [];\n this.first_ = null;\n this.totalBytes_ = 0;\n }", "_ensureUnpacked() {\n if (this.packedData) {\n this._unpackData();\n }\n }", "function resetCalcValues() {\n memoryStr = null;\n currentOperator = null;\n currentNumStr = null;\n}", "clearData(){\n this.publicoAlvoSim= 0,\n this.publicoAlvoNao= 0,\n this.publicoAlvoALVA= 0,\n this.XER= 0,\n this.COP= 0,\n this.listaPrefixos= [],\n this.operacaoNaoVinculada= 0,\n this.operacaoVinculada= 0,\n this.operacaoVinculadaEmOutroNPJ= 0,\n this.acordoRegPortalSim= 0,\n this.acordoRegPortalNao= 0,\n //this.acordoRegPortalDuplicados= 0,\n this.totaisEstoque = 0,\n this.totaisFluxo = 0,\n this.estoqueNumber= 0,\n this.fluxoNumber= 0,\n this.duplicadoSimNao = 0,\n this.analisadoSimNao = 0\n }", "wipeGeneData() {\n var me = this;\n this.vcfData = null;\n this.fbData = null;\n this.bamData = null;\n }", "clearAllVariables() {\n\t\tfor (const v of this._vars) {\n\t\t\tv.clear();\n\t\t}\n\t}", "resetMultisigData() {\n this.multisigInfoData = undefined;\n // Reset modifications array\n this.formData.modifications = [];\n // Reset relativeChange\n this.formData.relativeChange = null;\n }", "clear() {\n this.lines = [];\n this.cam = 0;\n this.cam2 = 0;\n this.proj = 0;\n this.proj2 = 0;\n this.color = '';\n this.loops = [];\n this.rec = -1;\n this.two = '';\n this.three = '';\n this.four = '';\n this.arr = [];\n this.meta = [];\n this.target = 0; //move to target using CAM # or PROJ #\n this.dist = 0;\n this.variables = {};\n this.output = {};\n }", "function resetVars() {\n\ts.eVar9 = \"\";\n\ts.eVar45 = \"\";\n\ts.eVar46 = \"\";\n\ts.eVar47 = \"\";\n\ts.eVar48 = \"\";\n\ts.eVar49 = \"\";\n\ts.eVar68 = \"\";\n\ts.prop50 = \"\";\n\ts.events = \"event2\";\n\ts.eVar31 = \"\";\n\ts.purchaseID = \"\";\n\ts.products = \"\";\n}", "function resetPackets() {\n\tvar gos : GameObject[];\n\tgos = GameObject.FindGameObjectsWithTag(\"Packet\");\n\tvar packet : GameObject;\n\t\n\tfor(var i=0; i<gos.Length;i++) {\n\t\tpacket = gos[i];\n\t\tpacket.name = \"\";\t\n\t} \n}", "function reset() {\n chain_[0] = 0x67452301;\n chain_[1] = 0xefcdab89;\n chain_[2] = 0x98badcfe;\n chain_[3] = 0x10325476;\n chain_[4] = 0xc3d2e1f0;\n\n inbuf_ = 0;\n total_ = 0;\n }", "function wddxSerializer_initPacketOld()\n{\n\tthis.wddxPacket = \"\";\n}", "destructor() {\n super.destructor()\n this.inputs.destroy()\n this.output.destroy()\n this.inputs = null\n this.output = null\n }", "Unbind()\n {\n this.constantBuffer = null;\n }", "binaryOperationCleaning(extraNodes) {\n\t\tthis.removeEmptyGrayNodes(this._octree);\n\n\t\tthis.simplifyNode(this._octree);\n\t\tthis.simplifyNode(extraNodes[0]);\n\t\tthis.simplifyNode(extraNodes[1]);\n\n\t\t// updates center\n\t\tthis.center = this._octree.boundingBox.center;\n\t}", "clear() {\n const game = this.game;\n const world = game.world;\n const container = game.pixiAdapter.container;\n\n // Remove p2 constraints from the world\n for (let i = 0; i < this.constraints.length; i++) {\n world.removeConstraint(this.constraints[i]);\n }\n\n // Remove p2 bodies from the world and Pixi Containers from the stage\n for (let i = 0; i < this.bodies.length; i++) {\n world.removeBody(this.bodies[i]);\n container.removeChild(this.containers[i]);\n }\n }", "shutdown() {\n\t\tthis.keyboard.destroyKeyboard();\n\n\t\tthis.categories = null;\n\t\tthis.sizes = null;\n\t\tthis.handed = null;\n\n\t\tthis.character = null;\n\t\tthis.characterPieces = null;\n\t\tthis.openColorWheel = null;\n\t\tthis.panelPosition = null;\n\t\tthis.textButtons = null;\n\t\tthis.customObject = null;\n\t\tthis.pieceSide = null;\n\t\tthis.objectAnimations = null;\n\t\tthis.stringObject = null;\n\t\tthis.loadedPieces = null;\n\t\tthis.types = null;\n\t\tthis.optionArrows = null;\n\t\tthis.lHand.destroy();\n\t\tthis.rHand.destroy();\n\t}", "reset() {\n this.bins = [];\n this._currentBinIndex = 0;\n }", "function cleanUp() {\n $(\"audio\").remove();\n $(\"img\").remove();\n $(\"h2\").remove();\n audioTags = [];\n h2s = [];\n imgs = [];\n var curRow = 0;\n var curCol = 0;\n }", "function clearProperties()\n {\n _edges = undefined;\n _edgeVectors = undefined;\n _matrix = undefined;\n }", "clear() {\n this._imgLoaded = {};\n this._imgAlias = {};\n this._audioLoaded = {};\n this._audioAlias = {};\n this._fileLoaded = {};\n this._fileAlias = {};\n }", "function dropResMatrix() {\n res1 = [];\n res2 = [];\n}", "__cleanUp() {\n // Data cursor cleanup\n if (this._dataCursor) {\n this.removeChild(this._dataCursor);\n this._dataCursor = null;\n }\n\n if (this.EventManager) {\n // Tooltip cleanup\n this.EventManager.hideHoverFeedback();\n\n // Event handler cleanup\n this.EventManager.setPanZoomHandler(null);\n this.EventManager.setMarqueeZoomHandler(null);\n this.EventManager.setMarqueeSelectHandler(null);\n\n // Drag button cleanup\n this.EventManager.panButton = null;\n this.EventManager.zoomButton = null;\n this.EventManager.selectButton = null;\n }\n\n // Remove pie center content\n if (this.pieCenterDiv) {\n this.getCtx().getContainer().removeChild(this.pieCenterDiv);\n this.pieCenterDiv = null;\n }\n\n // Clear the list of registered peers\n this.Peers = [];\n\n // Clear scrollbars, buttons\n this.xScrollbar = null;\n this.yScrollbar = null;\n\n if (this.dragButtons) {\n this.removeChild(this.dragButtons);\n this.dragButtons.destroy();\n this.dragButtons = null;\n }\n\n this._plotArea = null;\n this._areaContainer = null;\n this._dataLabels = null;\n\n // Reset cache\n this.getCache().clearCache();\n }", "Unbind()\n {\n this._constantBuffer = null;\n }", "destroy() {\n this._input = null;\n this._number = null;\n this._octaveOffset = 0;\n this._nrpnBuffer = [];\n this.notesState = new Array(128).fill(false);\n this.parameterNumberEventsEnabled = false;\n this.removeListener();\n }", "reset() {\n for (let field in this.originalData) {\n this[field] = '';\n }\n\n this.errors.clear();\n }", "reset() {\n for (let field in this.originalData) {\n this[field] = '';\n }\n\n this.errors.clear();\n }", "reset() {\n for (let field in this.originalData) {\n this[field] = '';\n }\n\n this.errors.clear();\n }", "function clearVars(){\n \tfor (var i=0; i < 75; i++) {\n\t s['prop'+i]='';\n \t s['eVar'+i]='';\n \t if(i<=5){\n \t s['hier'+i]='';\n \t }\n \t}\n \t//var svarArr = ['pageName','channel','products','events','campaign','purchaseID','state','zip','server','linkName'];\n \t//for (var i=0; i < svarArr.length ; i++) {\n \t//\ts[svarArr[i]]=''; \n\t// }\n }", "clearNetwork() {\n\t\tthis._nodes = {};\n\t\tthis._edges = {};\n\t\tthis._network.setData([]);\n\t}", "destroy() {\n this._output = null;\n this._number = null;\n this._octaveOffset = 0;\n this.removeListener();\n }", "function trimPack(pack) {\n var count = 0;\n var i = 0;\n while (i < pack.length) {\n if (pack[i] == 0) break;\n ++count;\n ++i;\n }\n var trimedPack = new Uint16Array(count);\n console.log(trimedPack);\n i = 0;\n while(i < trimedPack.length)\n {\n trimedPack[i]=pack[i];\n ++i;\n }\n return trimedPack;\n }", "reset() {\n for (let field in this.originalData) {\n this[field] = '';\n }\n\n this.errors.clear();\n }", "reset()\n {\n Object.assign(this,this.__.originalData);\n this.errors.clear();\n }", "clear() {\n wipe_1.wipe(this.data);\n }", "function reset() {\n attachSource(null);\n attachView(null);\n protectionData = null;\n protectionController = null;\n }", "cleanup() {\n this.lastRead = {};\n this.defaults = {};\n this.overrides = {};\n }", "clearValues(){\n\t\t\tthis.addedName = '';\n\t\t\tthis.addedPrice = 0;\n\t\t\tthis.commission = 0;\n\t\t\tthis.totalContractValue = 0;\n\t\t\t\n\t\t}", "function clean( node ){\n\tvar l = node.c.length;\n\twhile( l-- ){\n\t\tif( typeof node.c[l] == 'object' )\n\t\t\tclean( node.c[l] );\n\t}\n\tnode.n = node.a = node.c = null;\n}", "_cleanUp() {\n super._cleanUp();\n this.state = RequestSocket.STATUS;\n this._rawHeaders = undefined;\n this.dataReceived = false;\n }", "destroy() {\n this._output = null;\n this._number = null;\n this._octaveOffset = 0;\n this.removeListener();\n }", "function deleteObjects() {\r\n\r\n delete character;\r\n delete board;\r\n delete flag;\r\n\r\n leftFloorBlock=0;\r\n leftObastacleBlock=0;\r\n leftCoinBlock=0;\r\n leftPotionBlock=0;\r\n\r\n while(floor.length)\r\n floor.pop();\r\n\r\n while(obstacle.length)\r\n obstacle.pop();\r\n\r\n while(coin.length)\r\n coin.pop();\r\n\r\n while(potion.length)\r\n \tpotion.pop();\r\n}", "removeAll() {\n\t\tfor (const key of Object.keys(this.cards)) { this.cards[key].df = null; }\n\t\tthis.cards = {}; this.multiple = []; this.ctrlDelete = []; this.tabs = null;\n }", "_clear() {\n\t\t\tthis._style = null;\n\t\t\tthis._color = null;\n\t\t\tthis._rgb = null;\n\t\t\tthis._hsl = null;\n\t\t\tthis._gradType = null;\n\t\t\tthis._gradParams = null;\n\t\t\tthis._gradColors = [];\n\t\t\tthis._gradBsCache = null;\n\t\t}", "__$destroy() {\n if (this.isResFree()) {\n //console.log(\"MeshBase::__$destroy()... this.m_attachCount: \"+this.m_attachCount);\n this.m_ivs = null;\n this.m_bufDataList = null;\n this.m_bufDataStepList = null;\n this.m_bufStatusList = null;\n this.trisNumber = 0;\n this.m_transMatrix = null;\n }\n }", "clear() {\n this.requests = [];\n this.decoders = [];\n this.accountNextNonces = {};\n this.accountUsedNonces = {};\n }", "function clearGlobalsVariables(){\n\tglobalFileName = null;\n\tglobalFileContent = null;\n\tglobalFileMimeType = null;\n\tglobalFilePath = null;\n\tglobalFileExtension = null;\n}", "reset() {\n // Reset all 512 channels of the sender to zero\n for (var i = 0; i < 512; i++) {\n this.values[i] = 0;\n }\n this.transmit();\n }", "reset(){\n this.potentialValues = [];\n this.valuesToSend = [];\n this.phase = \"input\"\n }", "resetOutputs() {\n this.noop = 0;\n this.move = 0;\n this.loadi = 0;\n this.add = 0;\n this.addi = 0;\n this.sub = 0;\n this.subi = 0;\n this.load = 0;\n this.loadf = 0;\n this.store = 0;\n this.storef = 0;\n this.cmp = 0;\n this.jump = 0;\n this.inputc = 0;\n this.inputcf = 0;\n this.inputd = 0;\n this.inputdf = 0;\n this.shiftl = 0;\n this.shiftr = 0;\n this.bre = 0;\n this.brne = 0;\n this.brg = 0;\n this.brge = 0;\n this.rx = 0;\n this.ry = 0;\n }", "cleanup() {\n this.physicsEngine.cleanup(this.toClean);\n const gameInstance = this;\n this.toClean.forEach(function (name) {\n if (typeof gameInstance.objects[name] !== 'undefined') {\n delete gameInstance.objects[name];\n }\n });\n this.physicsEngine.cleanup(this.toClean);\n }", "cleanGarbage() {\n const self = this;\n this.forEveryElement(DOWN_TO_TOP, LEFT_TO_RIGHT, (elm, left, top, right, bottom) => {\n \n if(elm.position.isValid()){\n const {line, column} = elm.position;\n elm.cleanTemporaryData();\n self.data[line][column] = elm;\n } else {\n throw new Error('Cannot clean invalid position');\n }\n \n });\n }", "function instrMaker_cleanUp(){\n instrList = [];\n funcList = [];\n varList = [];\n cmdCount = 1;\n currentScope = \"global\";\n scopeStack = [\"global\"];\n}", "Unload()\n {\n // TODO: Unload buffers\n }", "clearSensitiveData() {\n this.xpriv = undefined;\n this.seed = undefined;\n }", "function cleanUp() {\n delete $scope.searchResultBundle;\n delete $scope.message;\n delete $scope.vs;\n delete $scope.queryUrl;\n delete $scope.queryError;\n }", "static clear() {\n curr_o = \"\";\n prev_o = \"\";\n oppr = \"\";\n res = 0;\n check = 0;\n return;\n }", "clear() {\n // clearing the viewers and setting the operation to undefined\n this.readyToReset = true;\n this.currentOperand = '';\n this.previousOperand = undefined;\n this.operation = undefined;\n this.espSymbol = undefined;\n }", "deconstruct () {\r\n this.removeChild(this.title)\r\n\r\n for (let button of this.buttons) {\r\n this.removeChild(button)\r\n }\r\n\r\n for (let axis of this.axis) {\r\n this.removeChild(axis)\r\n }\r\n }", "function resetJsAttributeVars(){\n\t//Determinamos los valores para realizar la búsqueda\n\tjsCccSubprCcprOidProc = '';\n\tjsCccSubprCodSubp = '';\n\t\n}", "reset() {\n for (let i = 0; i < this.allNodes.length; i++) { this.allNodes[i].reset(); }\n for (let i = 0; i < this.Splitter.length; i++) {\n this.Splitter[i].reset();\n }\n for (let i = 0; i < this.SubCircuit.length; i++) {\n this.SubCircuit[i].reset();\n }\n }", "function stackClear(){this.__data__={'array':[],'map':null};}", "function stackClear(){this.__data__={'array':[],'map':null};}", "function stackClear(){this.__data__={'array':[],'map':null};}", "function resetVars() {\n hasFlipped = false,\n stopEvents = false,\n firstCard = null,\n secondCard = null;\n}", "resetVars() {\r\n this._current = undefined;\r\n this._nextRevisionNr = exports.INITIAL_REVISION_NEXT_NR;\r\n }", "function clean() {\n wrappers.splice(0, wrappers.length);\n plugins.splice(0, plugins.length);\n}", "_unpackData() {\n const buf = new DbObjectPickleBuffer(this.packedData);\n buf.readHeader(this);\n this._unpackDataFromBuf(buf);\n this.packedData = undefined;\n }", "function removeElementsContent() {\n playerResult = 0;\n croupierResult = 0;\n playerCardsTable = [];\n croupierCardsTable = [];\n}", "reset() {\n this.program = null;\n this.shader = null;\n }" ]
[ "0.63718796", "0.63718796", "0.63718796", "0.6353819", "0.6071918", "0.5921566", "0.58615255", "0.5817088", "0.57815003", "0.57543", "0.5753198", "0.5753198", "0.57321244", "0.572426", "0.5679321", "0.562295", "0.5609885", "0.5591577", "0.55859816", "0.5566109", "0.5501618", "0.5495416", "0.5489507", "0.54598695", "0.5456153", "0.54549885", "0.544737", "0.54421604", "0.54407024", "0.5433811", "0.5426886", "0.54089946", "0.540496", "0.53964704", "0.5395185", "0.5390787", "0.5390369", "0.5387374", "0.5368182", "0.53671217", "0.5360023", "0.5348139", "0.5333175", "0.5311716", "0.5308862", "0.5292043", "0.5291953", "0.52827376", "0.52806085", "0.5264188", "0.52391505", "0.5232785", "0.52220404", "0.5215595", "0.52103454", "0.5203555", "0.5203555", "0.5203555", "0.5201297", "0.5200643", "0.51975274", "0.5193618", "0.51935196", "0.5191159", "0.51874584", "0.51871073", "0.51830655", "0.51811063", "0.51809794", "0.51809067", "0.5180177", "0.5169755", "0.51651317", "0.51580995", "0.51571095", "0.51568526", "0.5156703", "0.51527566", "0.51408774", "0.5134266", "0.51315063", "0.51092964", "0.5109199", "0.5092836", "0.5088393", "0.5086635", "0.50861603", "0.5082005", "0.5081522", "0.5070518", "0.5069068", "0.50658107", "0.50658107", "0.50658107", "0.5065358", "0.50607467", "0.5057575", "0.50503814", "0.5045445", "0.5043149" ]
0.6361064
3
Returns true if obj is a Buffer, an ArrayBuffer, a Blob or a File.
function isBinary(obj) { return withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)) || withNativeBlob && obj instanceof Blob || withNativeFile && obj instanceof File; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isBuf(obj) {\n\t return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n\t (global.ArrayBuffer && obj instanceof ArrayBuffer);\n\t}", "function isBuf(obj) {\n\t return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n\t (global.ArrayBuffer && obj instanceof ArrayBuffer);\n\t}", "function isBuf(obj) {\n\t return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n\t (global.ArrayBuffer && obj instanceof ArrayBuffer);\n\t}", "function isBuf(obj) {\n\t return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n\t (global.ArrayBuffer && obj instanceof ArrayBuffer);\n\t}", "function isBuf(obj) {\n\t return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n\t (global.ArrayBuffer && obj instanceof ArrayBuffer);\n\t}", "function isBuf(obj) {\n\t return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n\t (global.ArrayBuffer && obj instanceof ArrayBuffer);\n\t}", "function isBuf(obj) {\n\t return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n\t (global.ArrayBuffer && obj instanceof ArrayBuffer);\n\t}", "function isBuf(obj) {\n\t return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n\t (global.ArrayBuffer && obj instanceof ArrayBuffer);\n\t}", "function isBuf(obj) {\n\t return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n\t (global.ArrayBuffer && obj instanceof ArrayBuffer);\n\t}", "function isBuf(obj) {\n\t return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n\t (global.ArrayBuffer && obj instanceof ArrayBuffer);\n\t}", "function isBuf(obj) {\n\t return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n\t (global.ArrayBuffer && obj instanceof ArrayBuffer);\n\t}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer) ||\n (obj instanceof Uint8Array);\n}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && (obj instanceof ArrayBuffer || ArrayBuffer.isView(obj)));\n}", "function isBuf(obj) {\n return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n (global.ArrayBuffer && (obj instanceof ArrayBuffer || ArrayBuffer.isView(obj)));\n}", "function isBuf(obj){return global.Buffer && global.Buffer.isBuffer(obj) || global.ArrayBuffer && obj instanceof ArrayBuffer;}", "function isBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}", "function isBuf(obj) {\n\t return (withNativeBuffer && global.Buffer.isBuffer(obj)) ||\n\t (withNativeArrayBuffer && (obj instanceof global.ArrayBuffer || isView(obj)));\n\t}", "function isBuf(obj) {\n return (withNativeBuffer && Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)));\n }", "function isBuf(obj) {\n return withNativeBuffer && Buffer.isBuffer(obj) ||\n withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj));\n }", "function isBuf(obj) {\n return withNativeBuffer && Buffer.isBuffer(obj) ||\n withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj));\n }", "function isBuf(obj) {\n return (withNativeBuffer && Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)));\n}", "function isBuf(obj) {\n return (withNativeBuffer && Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)));\n}", "function isBuf(obj) {\n return (withNativeBuffer && Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)));\n}", "function isBuf(obj) {\n return (withNativeBuffer && Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)));\n}", "function isBuf(obj) {\n return (withNativeBuffer && Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)));\n}", "function isBuf(obj) {\n return (withNativeBuffer && Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)));\n}", "function isBuf(obj) {\n return (withNativeBuffer && Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)));\n}", "function isBuf(obj) {\n return (withNativeBuffer && Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)));\n}", "function isBuf(obj) {\n return (withNativeBuffer && Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)));\n}", "function isBuf(obj) {\n return (withNativeBuffer && Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)));\n}", "function isBuf(obj) {\n return (withNativeBuffer && Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)));\n}", "function isBuf(obj) {\n return (withNativeBuffer && Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)));\n}", "function isBuf(obj) {\n return (withNativeBuffer && Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)));\n}", "function isBuf(obj) {\n return (withNativeBuffer && Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)));\n}", "function isBuf(obj) {\n return (withNativeBuffer && Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)));\n}", "function isBuf(obj) {\n return (withNativeBuffer && Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)));\n}", "function isBuf(obj) {\n return (withNativeBuffer && global.Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof global.ArrayBuffer || isView(obj)));\n}", "function isBuf(obj) {\n return (withNativeBuffer && global.Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof global.ArrayBuffer || isView(obj)));\n}", "function isBuf(obj) {\n return (withNativeBuffer && global.Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof global.ArrayBuffer || isView(obj)));\n}", "function isBuf(obj) {\n return (withNativeBuffer && global.Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof global.ArrayBuffer || isView(obj)));\n}", "function isBuf(obj) {\n return (withNativeBuffer && global.Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof global.ArrayBuffer || isView(obj)));\n}", "function isBuf(obj) {\n return (withNativeBuffer && global.Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof global.ArrayBuffer || isView(obj)));\n}", "function isBuf(obj) {\n return (withNativeBuffer && global.Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof global.ArrayBuffer || isView(obj)));\n}", "function isBuf(obj) {\n return (withNativeBuffer && global.Buffer.isBuffer(obj)) ||\n (withNativeArrayBuffer && (obj instanceof global.ArrayBuffer || isView(obj)));\n}", "function isBinary(obj) {\n return ((withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj))) ||\n (withNativeBlob && obj instanceof Blob) ||\n (withNativeFile && obj instanceof File));\n}", "function isBinary(obj) {\n return ((withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj))) ||\n (withNativeBlob && obj instanceof Blob) ||\n (withNativeFile && obj instanceof File));\n}", "function isBinary(obj) {\n return ((withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj))) ||\n (withNativeBlob && obj instanceof Blob) ||\n (withNativeFile && obj instanceof File));\n}", "function isBuf(obj) {\n return withNativeBuffer && Buffer.isBuffer(obj) || withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj));\n}", "function isBinary(obj) {\n return ((withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj))) ||\n (withNativeBlob && obj instanceof Blob) ||\n (withNativeFile && obj instanceof File));\n }", "static isBuffer(obj) {\n return isInstance(obj, Buffer$1);\n }", "function isBuffer(obj) {\n return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj));\n }", "function isBuffer(obj) {\n return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))\n}", "function isBuffer(obj) {\n return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))\n}", "function isBuffer(obj) {\n return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))\n}", "function isBuffer(obj) {\n return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))\n}", "function isBuffer(obj) {\n return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))\n}", "function isBuffer(obj) {\n return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))\n}", "function isBuffer(obj) {\n return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))\n}", "function isBuffer(obj) {\n return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))\n}", "function isBuffer(obj) {\n\t return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj));\n\t}", "function isBuffer(obj) {\n return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))\n }", "function isBuffer(obj) {\n return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))\n }", "function isBuffer(obj) {\n return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))\n }", "function isBuffer(obj) {\n\t return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))\n\t}", "function isBuffer(obj) {\n\t return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))\n\t}", "function isBuffer(obj) {\n\t return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))\n\t}" ]
[ "0.803447", "0.803447", "0.803447", "0.803447", "0.803447", "0.803447", "0.803447", "0.803447", "0.803447", "0.803447", "0.803447", "0.8023567", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0.79832083", "0.79832083", "0.7961886", "0.78675634", "0.78508526", "0.7838748", "0.78160125", "0.78160125", "0.7796436", "0.7796436", "0.7796436", "0.7796436", "0.7796436", "0.7796436", "0.7796436", "0.7796436", "0.7796436", "0.7796436", "0.7796436", "0.7796436", "0.7796436", "0.7796436", "0.7796436", "0.7796436", "0.77953416", "0.77953416", "0.77953416", "0.77953416", "0.77953416", "0.77953416", "0.77953416", "0.77953416", "0.77900237", "0.77900237", "0.77900237", "0.7754467", "0.7754311", "0.7744616", "0.7727283", "0.77164745", "0.77164745", "0.77164745", "0.77164745", "0.77164745", "0.77164745", "0.77164745", "0.77164745", "0.7714516", "0.77063584", "0.77063584", "0.77063584", "0.7690991", "0.7690991", "0.7690991" ]
0.77741295
81
TODO: emstricten & fix the typing here! `createWithBsPrefix...`
function createWithBsPrefix(prefix, _temp) { var _ref = _temp === void 0 ? {} : _temp, _ref$displayName = _ref.displayName, displayName = _ref$displayName === void 0 ? pascalCase(prefix) : _ref$displayName, Component = _ref.Component, defaultProps = _ref.defaultProps; var BsComponent = /*#__PURE__*/react.forwardRef(function (_ref2, ref) { var className = _ref2.className, bsPrefix = _ref2.bsPrefix, _ref2$as = _ref2.as, Tag = _ref2$as === void 0 ? Component || 'div' : _ref2$as, props = (0,objectWithoutPropertiesLoose/* default */.Z)(_ref2, ["className", "bsPrefix", "as"]); var resolvedPrefix = useBootstrapPrefix(bsPrefix, prefix); return /*#__PURE__*/react.createElement(Tag, (0,esm_extends/* default */.Z)({ ref: ref, className: classnames_default()(className, resolvedPrefix) }, props)); }); BsComponent.defaultProps = defaultProps; BsComponent.displayName = displayName; return BsComponent; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createWithBsPrefix(prefix, _temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$displayName = _ref.displayName,\n displayName = _ref$displayName === void 0 ? pascalCase(prefix) : _ref$displayName,\n Component = _ref.Component,\n defaultProps = _ref.defaultProps;\n\n var BsComponent = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4__.forwardRef(function (_ref2, ref) {\n var className = _ref2.className,\n bsPrefix = _ref2.bsPrefix,\n _ref2$as = _ref2.as,\n Tag = _ref2$as === void 0 ? Component || 'div' : _ref2$as,\n props = (0,_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__.default)(_ref2, [\"className\", \"bsPrefix\", \"as\"]);\n\n var resolvedPrefix = (0,_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__.useBootstrapPrefix)(bsPrefix, prefix);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4__.createElement(Tag, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__.default)({\n ref: ref,\n className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, resolvedPrefix)\n }, props));\n });\n BsComponent.defaultProps = defaultProps;\n BsComponent.displayName = displayName;\n return BsComponent;\n}", "function createWithBsPrefix(prefix, _temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$displayName = _ref.displayName,\n displayName = _ref$displayName === void 0 ? pascalCase(prefix) : _ref$displayName,\n Component = _ref.Component,\n defaultProps = _ref.defaultProps;\n\n var BsComponent = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4__.forwardRef(function (_ref2, ref) {\n var className = _ref2.className,\n bsPrefix = _ref2.bsPrefix,\n _ref2$as = _ref2.as,\n Tag = _ref2$as === void 0 ? Component || 'div' : _ref2$as,\n props = (0,_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__.default)(_ref2, [\"className\", \"bsPrefix\", \"as\"]);\n\n var resolvedPrefix = (0,_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__.useBootstrapPrefix)(bsPrefix, prefix);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4__.createElement(Tag, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__.default)({\n ref: ref,\n className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, resolvedPrefix)\n }, props));\n });\n BsComponent.defaultProps = defaultProps;\n BsComponent.displayName = displayName;\n return BsComponent;\n}", "function createWithBsPrefix(prefix, _temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$displayName = _ref.displayName,\n displayName = _ref$displayName === void 0 ? pascalCase(prefix) : _ref$displayName,\n Component = _ref.Component,\n defaultProps = _ref.defaultProps;\n\n var BsComponent = /*#__PURE__*/react.forwardRef(function (_ref2, ref) {\n var className = _ref2.className,\n bsPrefix = _ref2.bsPrefix,\n _ref2$as = _ref2.as,\n Tag = _ref2$as === void 0 ? Component || 'div' : _ref2$as,\n props = _objectWithoutPropertiesLoose(_ref2, [\"className\", \"bsPrefix\", \"as\"]);\n\n var resolvedPrefix = useBootstrapPrefix(bsPrefix, prefix);\n return /*#__PURE__*/react.createElement(Tag, _extends({\n ref: ref,\n className: classnames(className, resolvedPrefix)\n }, props));\n });\n BsComponent.defaultProps = defaultProps;\n BsComponent.displayName = displayName;\n return BsComponent;\n}", "function createWithBsPrefix(prefix, _temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$displayName = _ref.displayName,\n displayName = _ref$displayName === void 0 ? pascalCase(prefix) : _ref$displayName,\n Component = _ref.Component,\n defaultProps = _ref.defaultProps;\n\n var BsComponent = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().forwardRef(function (_ref2, ref) {\n var className = _ref2.className,\n bsPrefix = _ref2.bsPrefix,\n _ref2$as = _ref2.as,\n Tag = _ref2$as === void 0 ? Component || 'div' : _ref2$as,\n props = (0,_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__.default)(_ref2, _excluded);\n\n var resolvedPrefix = (0,_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__.useBootstrapPrefix)(bsPrefix, prefix);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default().createElement(Tag, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__.default)({\n ref: ref,\n className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, resolvedPrefix)\n }, props));\n });\n BsComponent.defaultProps = defaultProps;\n BsComponent.displayName = displayName;\n return BsComponent;\n}", "function createWithBsPrefix(prefix, _temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$displayName = _ref.displayName,\n displayName = _ref$displayName === void 0 ? pascalCase(prefix) : _ref$displayName,\n Component = _ref.Component,\n defaultProps = _ref.defaultProps;\n\n var BsComponent = react__WEBPACK_IMPORTED_MODULE_4___default.a.forwardRef(function (_ref2, ref) {\n var className = _ref2.className,\n bsPrefix = _ref2.bsPrefix,\n _ref2$as = _ref2.as,\n Tag = _ref2$as === void 0 ? Component || 'div' : _ref2$as,\n props = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_ref2, [\"className\", \"bsPrefix\", \"as\"]);\n\n var resolvedPrefix = Object(_ThemeProvider__WEBPACK_IMPORTED_MODULE_5__[\"useBootstrapPrefix\"])(bsPrefix, prefix);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(Tag, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n ref: ref,\n className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, resolvedPrefix)\n }, props));\n });\n BsComponent.defaultProps = defaultProps;\n BsComponent.displayName = displayName;\n return BsComponent;\n}", "function createWithBsPrefix(prefix, _temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$displayName = _ref.displayName,\n displayName = _ref$displayName === void 0 ? pascalCase(prefix) : _ref$displayName,\n Component = _ref.Component,\n defaultProps = _ref.defaultProps;\n\n var BsComponent = _react.default.forwardRef(function (_ref2, ref) {\n var className = _ref2.className,\n bsPrefix = _ref2.bsPrefix,\n _ref2$as = _ref2.as,\n Tag = _ref2$as === void 0 ? Component || 'div' : _ref2$as,\n props = (0, _objectWithoutPropertiesLoose2.default)(_ref2, [\"className\", \"bsPrefix\", \"as\"]);\n var resolvedPrefix = (0, _ThemeProvider.useBootstrapPrefix)(bsPrefix, prefix);\n return /*#__PURE__*/_react.default.createElement(Tag, (0, _extends2.default)({\n ref: ref,\n className: (0, _classnames.default)(className, resolvedPrefix)\n }, props));\n });\n\n BsComponent.defaultProps = defaultProps;\n BsComponent.displayName = displayName;\n return BsComponent;\n}", "constructor(prefix) {\n this.prefix_ = prefix;\n }", "function createPrefixedKey({\n method,\n prefix\n}) {\n return (0, _util.u8aConcat)((0, _utilCrypto.xxhashAsU8a)(prefix, 128), (0, _utilCrypto.xxhashAsU8a)(method, 128));\n}", "function createIdList(prefix, Id){\n this.ButtonsIdArray = {};\n this.tmpId;\n for ( var key in ButtonList ){\n this.ButtonsIdArray[ButtonList[key]]=prefix.concat(ButtonList[key], '_' ,Id);\n }\n return this.ButtonsIdArray\n}", "function prefixer(prefix){\n\tthis.prefix=prefix;\n}", "bcdPrefix() {\n return `${this.bcd.base}${this.trailingSlash(this.bcd.base)}v${this.bcd.version}/`;\n }", "function prefixLabels(object, prefix) {\n var new_obj = {};\n for (var index in object) {\n if (!object.hasOwnProperty(index)) continue;\n new_obj[prefix + index] = object[index];\n }\n object = new_obj;\n return object;\n}", "function buildCreate2Address(creatorAddress, saltHex, byteCode) {\n return `0x${web3.utils.sha3(`0x${[\n 'ff',\n creatorAddress,\n saltHex,\n web3.utils.sha3(byteCode)\n ].map(x => x.replace(/0x/, ''))\n .join('')}`).slice(-40)}`.toLowerCase()\n}", "constructor(prefix, keys = []) {\n this.prefix = prefix;\n this.keys = keys;\n }", "function createBuilderName(name) {\n\t\tvar firstChar = name[0].toUpperCase();\n\t\treturn \"new\" + firstChar + name.slice(1) + \"ParamBuilder\";\n\t}", "addPrefix(prefix) {\n if (!prefix) {\n return this;\n }\n this.input = `${prefix}_${this.input}`;\n return this;\n }", "constructor (address, prefix) {\n super(address);\n this.prefix = this._checkPrefix(prefix);\n }", "constructor(prefix) {\n this.prefix = prefix;\n this.counter = 0;\n this.existing = {};\n }", "constructor(prefix) {\n this.prefix = prefix;\n this.counter = 0;\n this.existing = {};\n }", "function boldPrefix(word, prefix) {\r\n return word.replace(new RegExp('^(' + prefix + ')(.*)','ig'), '<b>$1</b>$2');\r\n}", "function prefix(id, parse) {\n var s = symbol(id);\n s.children = [];\n s.parse = parse || function () {\n this.children[0] = BOGUS();\n return this;\n };\n return s;\n}", "addPrefixes(prefixes, done) {\n // Ignore prefixes if not supported by the serialization\n if (!this._prefixIRIs) return done && done();\n\n // Write all new prefixes\n let hasPrefixes = false;\n for (let prefix in prefixes) {\n let iri = prefixes[prefix];\n if (typeof iri !== 'string') iri = iri.value;\n hasPrefixes = true;\n // Finish a possible pending quad\n if (this._subject !== null) {\n this._write(this._inDefaultGraph ? '.\\n' : '\\n}\\n');\n this._subject = null, this._graph = '';\n }\n // Store and write the prefix\n this._prefixIRIs[iri] = prefix += ':';\n this._write(`@prefix ${prefix} <${iri}>.\\n`);\n }\n // Recreate the prefix matcher\n if (hasPrefixes) {\n let IRIlist = '',\n prefixList = '';\n for (const prefixIRI in this._prefixIRIs) {\n IRIlist += IRIlist ? `|${prefixIRI}` : prefixIRI;\n prefixList += (prefixList ? '|' : '') + this._prefixIRIs[prefixIRI];\n }\n IRIlist = escapeRegex(IRIlist, /[\\]\\/\\(\\)\\*\\+\\?\\.\\\\\\$]/g, '\\\\$&');\n this._prefixRegex = new RegExp(`^(?:${prefixList})[^\\/]*$|` + `^(${IRIlist})([_a-zA-Z][\\\\-_a-zA-Z0-9]*)$`);\n }\n // End a prefix block with a newline\n this._write(hasPrefixes ? '\\n' : '', done);\n }", "static addPrefix(p_prefix, p_elements) {\n let res = [];\n p_elements.forEach(function(p_ele) {\n res.push(p_prefix + p_ele);\n });\n return res;\n }", "function getNewBandNames(suffix, bands) {\n //var seq = ee.List.sequence(1, bands.length());\n //return seq.map(function(b) {\n return bands.map(function(band){\n return ee.String(band).cat(suffix);\n });\n // return ee.String(prefix).cat(ee.Number(b).int());\n //});\n}", "addPrefix(prefix, iri, done) {\n const prefixes = {};\n prefixes[prefix] = iri;\n this.addPrefixes(prefixes, done);\n }", "notePrefix(prefix) {\n this.query['note-prefix'] = lookupAccountTransactions_1.base64StringFunnel(prefix);\n return this;\n }", "constructor(prefix = 'kss') {\n\t\tif ('string' !== typeof prefix) {\n\t\t\tthrow new Error('prefix argument is not a string');\n\t\t}\n\t\tthis.#prefix = prefix;\n\t\tif (new.target === CustomElementsDefiner) {\n\t\t\tObject.freeze(this);\n\t\t}\n\t}", "addPrefix(prefix, iri, done) {\n var prefixes = {};\n prefixes[prefix] = iri;\n this.addPrefixes(prefixes, done);\n }", "function prefix(a, b) {\n let i;\n for (i = 0; a[i] === b[i] && i < a.length; i++);\n return a.substr(0, i);\n}", "set prefix(prefix) {\n this._prefix = prefix;\n }", "static create(params) {\n return {type: `${this.prefix}${this.name}`, _instance: new this(params)}; //eslint-disable-line\n }", "function create(a,b) {\r\n\tvar ret=document.createElement(a);\r\n\tif(b) for(var prop in b) {\r\n\t\tif(prop.indexOf('on')==0) ret.addEventListener(prop.substring(2),b[prop],false);\r\n\t\telse if(prop==\"kids\" && (prop=b[prop])) {\r\n\t\t\tfor(var i=0;i<prop.length;i++) ret.appendChild(prop[i]);\r\n\t\t}\r\n\t\telse if('style,accesskey,id,name,src,href,class'.indexOf(prop)!=-1) ret.setAttribute(prop, b[prop]);\r\n\t\telse ret[prop]=b[prop];\r\n\t} return ret;\r\n}", "function create(a,b) {\r\n\tvar ret=document.createElement(a);\r\n\tif(b) for(var prop in b) {\r\n\t\tif(prop.indexOf('on')==0) ret.addEventListener(prop.substring(2),b[prop],false);\r\n\t\telse if(prop==\"kids\" && (prop=b[prop])) {\r\n\t\t\tfor(var i=0;i<prop.length;i++) ret.appendChild(prop[i]);\r\n\t\t}\r\n\t\telse if('style,accesskey,id,name,src,href,class'.indexOf(prop)!=-1) ret.setAttribute(prop, b[prop]);\r\n\t\telse ret[prop]=b[prop];\r\n\t} return ret;\r\n}", "function create(a,b) {\r\n\tvar ret=document.createElement(a);\r\n\tif(b) for(var prop in b) {\r\n\t\tif(prop.indexOf('on')==0) ret.addEventListener(prop.substring(2),b[prop],false);\r\n\t\telse if(prop==\"kids\" && (prop=b[prop])) {\r\n\t\t\tfor(var i=0;i<prop.length;i++) ret.appendChild(prop[i]);\r\n\t\t}\r\n\t\telse if('style,accesskey,id,name,src,href,class'.indexOf(prop)!=-1) ret.setAttribute(prop, b[prop]);\r\n\t\telse ret[prop]=b[prop];\r\n\t} return ret;\r\n}", "function addOrderPrefix(order, prefix) {\n return order[0] === '-' ? '-' + prefix + order.substring(1) : prefix + order;\n }", "function encodeTagTweak(out, prefix, blockNr) {\n\tout.set(new Uint8Array(12));\n\tnew DataView(out.buffer).setUint32(12 + out.byteOffset, blockNr, false);\n\tout[0] = prefix << prefixShift;\n}", "function addPrefixMapping(prefix, arangoEdges) {\n var namespace = vocabularyMapping[prefix].namespace;\n\n var nameHash = namespace.hashCode().toString();\n var alreadyMappedPrefix = false;\n for(var pref in arangoPrefixes){\n if (pref === nameHash) {\n alreadyMappedPrefix = true;\n }\n }\n\n if (!alreadyMappedPrefix && nameHash !== undefined){\n arangoPrefixes[nameHash] = {\n _key: nameHash, \n namespaceURI: namespace,\n prefix: prefix,\n type: 'Prefix'\n };\n }\n\n}", "function prefix(props, variant) {\n !(props.bsClass != null) ? process.env.NODE_ENV !== 'production' ? (0, _invariant2.default)(false, 'A `bsClass` prop is required for this component') : (0, _invariant2.default)(false) : void 0;\n return props.bsClass + (variant ? '-' + variant : '');\n}", "insert (prefix, item) {\n if (!this.items[prefix]) {\n const index = findIndex(this.prefixes, (e) => {\n if (prefix.length === e.length) {\n return prefix > e\n }\n return prefix.length > e.length\n })\n\n if (index === -1) {\n this.prefixes.push(prefix)\n } else {\n this.prefixes.splice(index, 0, prefix)\n }\n }\n this.items[prefix] = item\n return item\n }", "createButton(symbol, style) {\n\t\tlet b = $('<span>')\n\t\tb.addClass('btn border small m-1 p-1')\n\t\tb.addClass(style)\n\t\tb.html(symbol)\n\t\treturn b\n\t}", "withoutPrefix(prefix) {\n if (this.formatParts.length < prefix.formatParts.length || this.args.length < prefix.args.length) {\n return undefined;\n }\n let prefixArgCount = 0;\n let firstFormatPart;\n // Walk through the formatParts of prefix to confirm that it's a of this.\n for (let index = 0; index < prefix.formatParts.length; index++) {\n const theirPart = prefix.formatParts[index] || '';\n const ourPart = this.formatParts[index] || '';\n if (ourPart !== theirPart) {\n // We've found a format part that doesn't match. If this is the very last format part check\n // for a string prefix match. If that doesn't match, we're done.\n if (index === prefix.formatParts.length - 1 && ourPart.startsWith(theirPart)) {\n firstFormatPart = ourPart.substring(theirPart.length);\n }\n else {\n return undefined;\n }\n }\n // If the matching format part has an argument, check that too.\n if (theirPart.startsWith('%') && !isNoArgPlaceholder(theirPart[1])) {\n if (this.args[prefixArgCount] !== prefix.args[prefixArgCount]) {\n return undefined; // Argument doesn't match.\n }\n prefixArgCount++;\n }\n }\n // We found a prefix. Prepare the suffix as a result.\n const resultFormatParts = [];\n if (firstFormatPart) {\n resultFormatParts.push(firstFormatPart);\n }\n for (let i = prefix.formatParts.length; i < this.formatParts.length; i++) {\n resultFormatParts.push(this.formatParts[i] || '');\n }\n const resultArgs = [];\n for (let i = prefix.args.length; i < this.args.length; i++) {\n resultArgs.push(this.args[i] || '');\n }\n return this.copy({\n formatParts: resultFormatParts,\n args: resultArgs,\n });\n }", "function prefix (a, b) {\n if(a.length > b.length) return false\n var l = a.length - 1\n var lastA = a[l]\n var lastB = b[l]\n\n if(typeof lastA !== typeof lastB)\n return false\n\n if('string' == typeof lastA\n && 0 != lastB.indexOf(lastA))\n return false\n \n //handle cas where there is no key prefix\n //(a hook on an entire sublevel)\n if(a.length == 1 && isArrayLike(lastA)) l ++\n \n while(l--) {\n if(compare(a[l], b[l])) return false\n }\n return true\n}", "static prefixArray(array, prefix){\n return array.map(i => prefix + i);\n }", "function createIdentifier(prefix, name, value) {\n var hashedString = (0, _hash.default)(name + stringifyValueWithProperty(value, name));\n return true ? prefix + \"-\" + name + \"-\" + hashedString : undefined;\n}", "prefixes(func) {\n if (this.prefixFunction) {\n process.emitWarning('Client.prefixes called multiple times');\n }\n this.prefixFunction = func;\n return this;\n }", "function getCosmosAddressCreator(bech32Prefix, HDPath, curve) {\n return async (seedPhrase) => {\n const { getNewWalletFromSeed } = await import(\"@lunie/cosmos-keys\")\n return getNewWalletFromSeed(seedPhrase, bech32Prefix, HDPath, curve)\n }\n}", "function createBucket() {\n metadata\n .buckets.set(bucketName, new BucketInfo(bucketName, ownerID, '', ''));\n metadata.keyMaps.set(bucketName, new Map);\n}", "function prefixNames(prefix) {\n var classNames = [];\n\n for (var _i = 1; _i < arguments.length; _i++) {\n classNames[_i - 1] = arguments[_i];\n }\n\n return classNames.map(function (className) {\n return className.split(\" \").map(function (name) {\n return name ? \"\" + prefix + name : \"\";\n }).join(\" \");\n }).join(\" \");\n }", "function prefix(iri, factory) {\n return prefixes({\n '': iri.value || iri\n }, factory)('');\n}", "create(bo) {\n const { columns, values, valuesVar } = bo.getSqlInsertParts();\n const query = `\n INSERT INTO \"${bo.Bo.tableName}\" ( ${columns} )\n VALUES ( ${valuesVar} )\n RETURNING ${bo.Bo.getSQLSelectClause()};\n `;\n return this.one(query, values);\n }", "addPrefixes(prefixes, done) {\n var prefixIRIs = this._prefixIRIs,\n hasPrefixes = false;\n\n for (var prefix in prefixes) {\n var iri = prefixes[prefix];\n if (typeof iri !== 'string') iri = iri.value;\n hasPrefixes = true; // Finish a possible pending quad\n\n if (this._subject !== null) {\n this._write(this._inDefaultGraph ? '.\\n' : '\\n}\\n');\n\n this._subject = null, this._graph = '';\n } // Store and write the prefix\n\n\n prefixIRIs[iri] = prefix += ':';\n\n this._write('@prefix ' + prefix + ' <' + iri + '>.\\n');\n } // Recreate the prefix matcher\n\n\n if (hasPrefixes) {\n var IRIlist = '',\n prefixList = '';\n\n for (var prefixIRI in prefixIRIs) {\n IRIlist += IRIlist ? '|' + prefixIRI : prefixIRI;\n prefixList += (prefixList ? '|' : '') + prefixIRIs[prefixIRI];\n }\n\n IRIlist = IRIlist.replace(/[\\]\\/\\(\\)\\*\\+\\?\\.\\\\\\$]/g, '\\\\$&');\n this._prefixRegex = new RegExp('^(?:' + prefixList + ')[^\\/]*$|' + '^(' + IRIlist + ')([a-zA-Z][\\\\-_a-zA-Z0-9]*)$');\n } // End a prefix block with a newline\n\n\n this._write(hasPrefixes ? '\\n' : '', done);\n }", "_createBlockGenesis(minerAddress, args){\n\n //validate miner Address\n\n args.unshift ( this.blockchain, minerAddress, undefined, undefined, undefined );\n\n let data = new this.blockDataClass(...args);\n\n return new this.blockClass( this.blockchain, 1, undefined, BlockchainGenesis.hashPrev, undefined, 0, data, 0, this.db );\n }", "function create(label) {\n return { label: label };\n }", "function create(label) {\r\n return { label: label };\r\n }", "function create(label) {\r\n return { label: label };\r\n }", "function create(label) {\r\n return { label: label };\r\n }", "function create(label) {\r\n return { label: label };\r\n }", "function create(label) {\r\n return { label: label };\r\n }", "function create(label) {\r\n return { label: label };\r\n }", "function prefix(pre) {\n\tconst o = this;\n\treturn {\n\t\tget: function(k, cb) { return o.get(pre+k, cb); },\n\t\tput: function(k, v, cb) { return o.put(pre+k, v, cb); },\n\t\tdel: function(k, cb) { return o.del(pre+k, cb); },\n\t\tcrypt: o.crypt,\n\t\tprefix: o.prefix\n\t};\n}", "function BigHippo() {\n this.prefix = 'bighippo_product.';\n}", "startWith(prefix) {\n this.addBefore(`^${Rule(prefix).source}`);\n return this;\n }", "function findNewAnchor(prefix, exclude) {\n for (let i = 1; true; ++i) {\n const name = `${prefix}${i}`;\n if (!exclude.has(name))\n return name;\n }\n }", "static initialize(obj, noncePrefix, macAddress) { \n obj['nonce_prefix'] = noncePrefix;\n obj['mac_address'] = macAddress;\n }", "function AppendPrefix(prefix, feature, isAttribute)\n{\n if (prefix !== undefined)\n {\n if (isAttribute)\n {\n // if a certain feature is an attribute, then it follows a different naming standard\n // where it must be completely capitalized and have words split with an underscore\n return prefix.toUpperCase() + \"_\" + feature.toUpperCase();\n }\n else\n {\n //Vendor prefixing should follow the standard convention: vendorprefixFeature\n //Note that the feature is capitalized after the vendor prefix\n //Therefore if the feature is window.feature, the vendor prefix version is:\n //window.[vp]Feature where vp is the vendor prefix: \n //window.msFeature, window.webkitFeature, window.mozFeature, window.oFeature\n var newFeature = feature[0].toUpperCase() + feature.substr(1, feature.length);\n\n //Build up the new feature name with the vendor prefix\n return prefix + newFeature;\n }\n }\n else\n {\n return feature;\n }\n}", "function create(label) {\n return {\n label: label\n };\n }", "function create(label) {\n return {\n label: label\n };\n }", "function create(label) {\n return {\n label: label\n };\n }", "create() {}", "create() {}", "function setKeyPrefix(obj) {\n if (obj.keyPrefix) return\n for (var s in params) if (params[s] === obj) obj.keyPrefix = s\n}", "function generateBlockID(blockIDPrefix, blockIndex) {\n // To generate a 64 bytes base64 string, source string should be 48\n const maxSourceStringLength = 48;\n // A blob can have a maximum of 100,000 uncommitted blocks at any given time\n const maxBlockIndexLength = 6;\n const maxAllowedBlockIDPrefixLength = maxSourceStringLength - maxBlockIndexLength;\n if (blockIDPrefix.length > maxAllowedBlockIDPrefixLength) {\n blockIDPrefix = blockIDPrefix.slice(0, maxAllowedBlockIDPrefixLength);\n }\n const res = blockIDPrefix +\n padStart(blockIndex.toString(), maxSourceStringLength - blockIDPrefix.length, \"0\");\n return base64encode(res);\n}", "function generateBlockID(blockIDPrefix, blockIndex) {\n // To generate a 64 bytes base64 string, source string should be 48\n const maxSourceStringLength = 48;\n // A blob can have a maximum of 100,000 uncommitted blocks at any given time\n const maxBlockIndexLength = 6;\n const maxAllowedBlockIDPrefixLength = maxSourceStringLength - maxBlockIndexLength;\n if (blockIDPrefix.length > maxAllowedBlockIDPrefixLength) {\n blockIDPrefix = blockIDPrefix.slice(0, maxAllowedBlockIDPrefixLength);\n }\n const res = blockIDPrefix +\n padStart(blockIndex.toString(), maxSourceStringLength - blockIDPrefix.length, \"0\");\n return base64encode(res);\n}", "function makePrefixer(prefijo){\n return function ponerPrefijo (palabra){\n console.log(prefijo + palabra)\n }\n}", "create () {}", "create () {}", "function createBonuses() {\n for(var i=0; i<1; i++) {\n bonuses[i] = new Bonus();\n bonuses[i].init();\n }\n}", "function prepend(prefix, result) {\n return prefix\n + ((result.length > 0 && prefix.length > 0) ? divider : '')\n + result;\n }", "function createBone(bone_spec) {\n var bone = document.createElement(\"li\");\n bone.classList.add(\"bone\");\n var bone_img = document.createElement(\"img\");\n bone_img.classList.add(\"bonepic\");\n bone_img.style.cursor = \"pointer\";\n\n bone_img.onmouseover = function(){iconBig(this);createTT(this.parentElement, bone_spec)};\n bone_img.onmouseout = function(){iconNormal(this);deleteTT()};\n bone_img.onclick = function(){addBone(bone_spec)};\n\n bone_img.src = bone_spec.img_link;\n\n bone.appendChild(bone_img);\n document.getElementById(bone_spec.type).appendChild(bone);\n}", "function create(a,b) {\r\n\tif(!a || a==\"\" || !b) return;\r\n\tvar ret=typeof a=='object'?a:document.createElement(a);\r\n\tfor(var prop in b) if(prop.indexOf(\"on\")==0) ret.addEventListener(prop.substring(2),b[prop],false);\r\n\t\telse if(prop==\"kids\" && (prop=b[prop])) for each(var p in prop) ret.appendChild(p);\r\n\t\telse if(\",style,accesskey,id,name,src,href\".indexOf(\",\"+prop)!=-1) ret.setAttribute(prop, b[prop]);\r\n\t\telse ret[prop]=b[prop];\r\n\treturn ret;\r\n}", "function prefix(prefix, fn){\n\treturn function(input){\n\t\tfn( (prefix||'') + input )\n\t\treturn input\n\t}\n}", "function bkmkCreatedHandler (id, BTN) {\r\n // We need the parent to calculate the real offset of insertion\r\n let parentId = BTN.parentId;\r\n let parentBN = curBNList[parentId];\r\n let index = BTN.index;\r\n//let t1 = (new Date()).getTime();\r\n//trace(t1+\" Create event on: \"+id+\" type: \"+BTN.type+\" parentId: \"+parentId+\" index: \"+index);\r\n\r\n // Create the new BN tree and insert it under its parent + maintain inBSP2Trash and trashDate fields\r\n let inBSP2Trash = options.trashEnabled && parentBN.inBSP2Trash;\r\n let BN = buildTree(BTN, parentBN.level+1, inBSP2Trash);\r\n BN_insert(BN, parentBN, index);\r\n\r\n // Record action\r\n historyListAdd(curHNList, HNACTION_BKMKCREATE,\r\n\t \t\t\t false, undefined, id, BTN.type, BN_aPath(parentId), parentId, index,\r\n\t \t\t\t BTN.title, BN.faviconUri, BTN.url, inBSP2Trash);\r\n // Save new current info\r\n saveBNList();\r\n // Refresh BSP2 toolbar icon in active tabs\r\n refreshActiveTabs(BN, false);\r\n\r\n // If we receive creation of the BSP2 trash folder, then rebuild pointer\r\n // and tell open sidebars before they are notified of its creation, to recognize it\r\n if (id == bsp2TrashFldrBNId) {\r\n\tbsp2TrashFldrBN = BN;\r\n\t// Notify open sidebars of new id\r\n\tsendAddonMsgComplex({\r\n\t source: \"background\",\r\n\t content: \"bsp2TrashFldrBNId\",\r\n\t bnId: bsp2TrashFldrBNId\r\n\t});\r\n }\r\n\r\n // Signal to sidebars to make them display it (must work with Private window sidebars\r\n // also, which have their own separate copy of curBNList).\r\n sendAddonMsgComplex({\r\n\tsource: \"background\",\r\n\tcontent: \"bkmkCreated\",\r\n\tnewtree: BN_serialize(BN),\r\n\tindex: index\r\n });\r\n\r\n // If we receive creation of the Recently bookmarked special folder (typically on restore bookmarks),\r\n // then rebuild pointer\r\n // -> Cannot detect it otherwise since FF does not support bookmarks.onImportBegan and onImportEnded\r\n // (but Chrome does)\r\n // Note on complete bookmark restore = the FF process appears to be as follows:\r\n // - Delete of all bookmark items at level 2, under Bppkùarks Toolbar, Bookkmarks Menu, Other Bookmarks ..\r\n // (no delete of lower ones, they get included by the level 2 deleted folders).\r\n // - Then re-create of all bookmarks one by one. This includes the special folders like Most Visited,\r\n // Recent Tags or Recently Bookmarked.\r\n if (id == recentBkmkBNId) {\r\n\trecentBkmkBN = BN;\r\n\t// Notify open sidebars of (possibly new) id\r\n\tsendAddonMsgComplex({\r\n\t source: \"background\",\r\n\t content: \"recentBkmkBNId\",\r\n\t bnId: recentBkmkBNId\r\n\t});\r\n }\r\n // Refresh list of recent bookmarks (always)\r\n triggerRecentRefreshBkmks();\r\n\r\n // If we receive creation of the Most recent special folder (typically on restore bookmarks),\r\n // then rebuild pointer and refresh its content also\r\n if (id == mostVisitedBNId) {\r\n\tmostVisitedBN = BN;\r\n\ttriggerRefreshMostVisited();\r\n\t// Notify open sidebars of (possibly new) id\r\n\tsendAddonMsgComplex({\r\n\t source: \"background\",\r\n\t content: \"mostVisitedBNId\",\r\n\t bnId: mostVisitedBNId\r\n\t});\r\n }\r\n\r\n // If we receive creation of the Recent tags special folder (typically on restore bookmarks),\r\n // then rebuild pointer\r\n if (id == recentTagBNId) {\r\n\trecentTagBN = BN;\r\n\t// Notify open sidebars of (possibly new) id\r\n\tsendAddonMsgComplex({\r\n\t source: \"background\",\r\n\t content: \"recentTagBNId\",\r\n\t bnId: recentTagBNId\r\n\t});\r\n }\r\n}", "function call_hook_builder(prefix) {\n return function() {\n var args = _.toArray(arguments);\n var hook = args.shift();\n var cb = args.pop();\n\n\n function exec_hook(type, hook, more_args) {\n var hook_name = type + \"_\" + hook;\n\n var exec_args = more_args || args;\n\n if (_main[hook_name]) {\n var ret = _main[hook_name].apply(_main, exec_args);\n return ret;\n }\n }\n\n exec_hook(\"before\", hook);\n\n var ret;\n if (_main[\"insteadof_\" + hook]) {\n ret = exec_hook(\"insteadof\", hook); \n } else {\n // The callback can prevent default installation by returning true;\n ret = exec_hook(prefix, hook);\n\n // default initializer is called if the 'prefix' hook did not return\n if (!ret) {\n cb.apply(null, args);\n }\n }\n\n // after hook\n ret = exec_hook(\"after\", hook, ret);\n\n };\n}", "create() {\n\t}", "async function createLoadBalancer() {\n const subscriptionId = process.env[\"NETWORK_SUBSCRIPTION_ID\"] || \"subid\";\n const resourceGroupName = process.env[\"NETWORK_RESOURCE_GROUP\"] || \"rg1\";\n const loadBalancerName = \"lb\";\n const parameters = {\n backendAddressPools: [{ name: \"be-lb\" }],\n frontendIPConfigurations: [\n {\n name: \"fe-lb\",\n subnet: {\n id: \"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb\",\n },\n },\n ],\n inboundNatPools: [],\n inboundNatRules: [\n {\n name: \"in-nat-rule\",\n backendPort: 3389,\n enableFloatingIP: true,\n enableTcpReset: false,\n frontendIPConfiguration: {\n id: \"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb\",\n },\n frontendPort: 3389,\n idleTimeoutInMinutes: 15,\n protocol: \"Tcp\",\n },\n ],\n loadBalancingRules: [\n {\n name: \"rulelb\",\n backendAddressPool: {\n id: \"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb\",\n },\n backendPort: 80,\n enableFloatingIP: true,\n enableTcpReset: false,\n frontendIPConfiguration: {\n id: \"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb\",\n },\n frontendPort: 80,\n idleTimeoutInMinutes: 15,\n loadDistribution: \"Default\",\n probe: {\n id: \"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb\",\n },\n protocol: \"Tcp\",\n },\n ],\n location: \"eastus\",\n probes: [\n {\n name: \"probe-lb\",\n intervalInSeconds: 15,\n numberOfProbes: 2,\n port: 80,\n probeThreshold: 1,\n requestPath: \"healthcheck.aspx\",\n protocol: \"Http\",\n },\n ],\n };\n const credential = new DefaultAzureCredential();\n const client = new NetworkManagementClient(credential, subscriptionId);\n const result = await client.loadBalancers.beginCreateOrUpdateAndWait(\n resourceGroupName,\n loadBalancerName,\n parameters\n );\n console.log(result);\n}", "static generatePid(prefix) {\n return 'urn:' + (prefix ? prefix : 'ghsts') + ':' + UUID.v4();\n }", "attrs(prefix, args) {\r\n\t\tlet res = '';\r\n\t\tconst len = prefix.length\r\n\t\targs.forEach(v => {\r\n\t\t\tif (v.lhs.startsWith(prefix)) {\r\n\t\t\t\t// remove the prefix\r\n\t\t\t\tres += ` ${v.lhs.substr(prefix.length)}`\r\n\t if (v.rhs.length > 0) res += `=\"${v.rhs.join(' ')}\"`\r\n\t\t\t}\r\n\t\t})\r\n\r\n\t\treturn res;\r\n\t}", "function createBuds(){\n var buds = [];\n var packCount = 5;\n\n for (var i = 0; i < packCount; ++i) {\n buds[i] = {\n strain: state.stats.supply.strains[Math.floor(Math.random()*state.stats.supply.strains.length)],\n xp: 50,\n traits: ['patreon genesis bud'],\n terps: [],\n pollinated: false,\n father: 'sensimilla'\n }\n }\n if(from=='hashkings'){state.users[json.to].buds.push(buds)}\n return buds;\n }", "function processPrefix(prefix, iri) {\n // Create a new prefix if an IRI is specified or the prefix doesn't exist\n if (typeof iri === 'string') {\n // Create a function that expands the prefix\n const cache = Object.create(null);\n prefixes[prefix] = local => {\n return cache[local] || (cache[local] = factory.namedNode(iri + local));\n };\n } else if (!(prefix in prefixes)) {\n throw new Error(`Unknown prefix: ${prefix}`);\n }\n return prefixes[prefix];\n }", "function createBands(cb) {\n async.parallel(\n [\n function (callback) {\n bandCreate(\n \"20-somethins\",\n [artists[1], artists[2]],\n [],\n \"2018\",\n false,\n callback\n );\n },\n function (callback) {\n bandCreate(\n \"dads in the basement drinking beerz\",\n [artists[3], artists[4]],\n [],\n \"2009\",\n false,\n callback\n );\n },\n function (callback) {\n bandCreate(\n \"waterhomies\",\n [artists[5], artists[6]],\n [],\n \"2001\",\n \"2004\",\n callback\n );\n },\n ],\n // Optional callback\n cb\n );\n}", "function insertFF56EndGapSep (parentBN) {\r\n let children = parentBN.children;\r\n let len = children.length;\r\n let BN = children[len-1]; // Is there since we just inserted it\r\n sendAddonMsgComplex({\r\n\tsource: \"background\",\r\n\tcontent: \"bkmkCreated\",\r\n\tnewtree: BN_serialize(BN),\r\n\tindex: len-1\r\n });\r\n}", "function Bg(a,b){this.Nd=a;this.Dg=b;Cg(this);var c=Dg(this)[0];this.Bb=c[1];Bg.$.constructor.call(this,c[0])}", "function createObjectLiteral(name, batch, hobbies) {\n\n}", "function create(idButton, aliasName) {\n if (aliasName == \"\")\n throw \"Alias Name is required\";\n if (idButton == \"\")\n throw \"idButton is required\";\n return Utils_1.default.OSExecute(`apx-onewire-ibutton create ${idButton} ${aliasName}`);\n}", "function _build_turtle_prefixes(){\n\t\t\tvar turtle_prefixes = \"\";\n\t\t\tfor (var i = 0; i < browser_conf_json.prefixes.length; i++) {\n\t\t\t\tvar pref_elem = browser_conf_json.prefixes[i];\n\t\t\t\tturtle_prefixes = turtle_prefixes+\" \"+\"PREFIX \"+pref_elem[\"prefix\"]+\":<\"+pref_elem[\"iri\"]+\"> \";\n\t\t\t}\n\t\t\treturn turtle_prefixes;\n\t\t}", "async function createLoadBalancerWithGatewayLoadBalancerProviderConfiguredWithTwoBackendPool() {\n const subscriptionId = process.env[\"NETWORK_SUBSCRIPTION_ID\"] || \"subid\";\n const resourceGroupName = process.env[\"NETWORK_RESOURCE_GROUP\"] || \"rg1\";\n const loadBalancerName = \"lb\";\n const parameters = {\n backendAddressPools: [{ name: \"be-lb1\" }, { name: \"be-lb2\" }],\n frontendIPConfigurations: [\n {\n name: \"fe-lb\",\n subnet: {\n id: \"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb\",\n },\n },\n ],\n inboundNatPools: [],\n loadBalancingRules: [\n {\n name: \"rulelb\",\n backendAddressPool: {},\n backendAddressPools: [\n {\n id: \"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb1\",\n },\n {\n id: \"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb2\",\n },\n ],\n backendPort: 0,\n enableFloatingIP: true,\n frontendIPConfiguration: {\n id: \"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb\",\n },\n frontendPort: 0,\n idleTimeoutInMinutes: 15,\n loadDistribution: \"Default\",\n probe: {\n id: \"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb\",\n },\n protocol: \"All\",\n },\n ],\n location: \"eastus\",\n outboundRules: [],\n probes: [\n {\n name: \"probe-lb\",\n intervalInSeconds: 15,\n numberOfProbes: 2,\n port: 80,\n probeThreshold: 1,\n requestPath: \"healthcheck.aspx\",\n protocol: \"Http\",\n },\n ],\n sku: { name: \"Premium\" },\n };\n const credential = new DefaultAzureCredential();\n const client = new NetworkManagementClient(credential, subscriptionId);\n const result = await client.loadBalancers.beginCreateOrUpdateAndWait(\n resourceGroupName,\n loadBalancerName,\n parameters\n );\n console.log(result);\n}", "function BN_create (BTN, level, faviconWorker, parentBN = undefined) {\r\n let node;\r\n let BTN_id = BTN.id;\r\n let index = BTN.index;\r\n let type = getType(BTN);\r\n let protect;\r\n if (type == \"folder\") { // Root cannot be created, so do not verify\r\n\tcountFolders++;\r\n\r\n\tlet title = BTN.title;\r\n\tlet uri, fetchedUri, inBSP2Trash;\r\n\tif (BTN_id == PersonalToobar) {\r\n\t uri = \"/icons/toolbarbkmk.png\";\r\n\t protect = true;\r\n\t fetchedUri = true;\r\n\t}\r\n\telse if (BTN_id == BookmarksMenu) {\r\n\t uri = \"/icons/menubkmk.png\";\r\n\t protect = true;\r\n\t fetchedUri = true;\r\n\t}\r\n\telse if (BTN_id == OtherBookmarks) {\r\n\t uri = \"/icons/otherbkmk.png\";\r\n\t protect = true;\r\n\t fetchedUri = true;\r\n\t}\r\n\telse if (BTN_id == MobileBookmarks) {\r\n\t uri = \"/icons/folder.png\";\r\n\t protect = true;\r\n\t fetchedUri = false;\r\n\t}\r\n\telse if (title == BSP2TrashName) {\r\n\t uri = \"/icons/bsp2trash.png\";\r\n\t protect = inBSP2Trash = true;\r\n\t fetchedUri = true;\r\n\t bsp2TrashFldrBNId = BTN_id;\r\n\t}\r\n\telse {\r\n\t uri = \"/icons/folder.png\";\r\n\t protect = false;\r\n\t fetchedUri = false;\r\n\t}\r\n\r\n\t// Pre-create an array of empty children if needed\r\n\tlet children = BTN.children;\r\n\tif (children != undefined) {\r\n\t children = new Array (children.length);\r\n\t}\r\n\r\n\t// Create new node\r\n\tnode = new BookmarkNode (\r\n\t BTN_id, \"folder\", level, BTN.parentId, BTN.dateAdded, protect,\r\n\t BTN.title, uri, fetchedUri, undefined,\r\n\t children, BTN.dateGroupModified, inBSP2Trash\r\n\t);\r\n }\r\n else if (type == \"separator\") {\r\n\tif ((countSeparators++ == 0) || beforeFF57) { // First separator is not draggable,\r\n\t \t\t\t\t\t\t\t\t\t\t\t // or all separators when FF < 57\r\n\t protect = true;\r\n\t}\r\n\telse {\r\n\t protect = false;\r\n\t}\r\n\tnode = new BookmarkNode (\r\n\t BTN_id, type, level, BTN.parentId, BTN.dateAdded, protect\r\n\t);\r\n }\r\n else { // Presumably \"bookmark\" type\r\n let forceProtect; // In case the general protection rule does not apply\r\n\tif (type == \"bookmark\") {\r\n\t if (!BTN_id.startsWith(\"place:\")) { // Do not count special bookmarks under special place: folders\r\n\t\t\t\t\t\t\t\t\t\t // -> tagged with \"place:\" before their id when inserted\r\n\t\tcountBookmarks++;\r\n\t }\r\n\t else {\r\n\t\tforceProtect = true;\r\n\t }\r\n\t}\r\n\telse {\r\n\t trace(\"Odd bookmark type: \"+type);\r\n\t countOddities++;\r\n\t}\r\n\r\n\tlet uri, fetchedUri;\r\n\tlet triggerFetch = false;\r\n\tlet url = BTN.url;\r\n\tlet title = BTN.title;\r\n\tif (url == undefined) {\r\n\t trace(\"Bookmark with undefined URL !\");\r\n\t traceBTN(BTN);\r\n\t url = \"<undefined!>\";\r\n\t uri = \"/icons/nofavicon.png\";\r\n\t fetchedUri = false;\r\n\t protect = false;\r\n\t}\r\n\telse if (url.startsWith(\"place:\")) {\r\n\t type = \"folder\"; // Convert to folder\r\n\t uri = \"/icons/specfavicon.png\";\r\n\t fetchedUri = true;\r\n\t protect = true;\r\n\t if (url.includes(MostVisitedSort)) {\r\n\t\tmostVisitedBNId = BTN_id;\r\n\t }\r\n\t else if (url.includes(RecentTagSort)) {\r\n\t\trecentTagBNId = BTN_id; \r\n\t }\r\n\t else if (url.includes(RecentBkmkSort)) {\r\n\t\trecentBkmkBNId = BTN_id;\r\n\t }\r\n\t else { // Unknown or non supported place: case ...\r\n\t\ttitle = url;\r\n\t }\r\n\t}\r\n\telse if (url.startsWith(\"about:\") || url.startsWith(\"file:\")) { // about: and file: generate a security error when we try to fetch ..\r\n\t uri = \"/icons/nofavicon.png\";\r\n\t fetchedUri = false;\r\n\t // They are draggable, but keep favicon = nofavicon\r\n\t protect = false;\r\n\t}\r\n\telse if (options.disableFavicons) {\r\n\t fetchedUri = false;\r\n\t protect = false;\r\n\t}\r\n\telse {\r\n\t // Retrieve saved uri or set to undefined by default\r\n\t // and trigger favicon retrieval in background\r\n\t uri = undefined;\r\n\t if (savedBkmkUriList != undefined) { // We are migrating to BN list ..\r\n\t\turi = savedBkmkUriList[BTN_id];\r\n\t\tif ((uri == \"/icons/nofavicontmp.png\") // Last time we stopped the sidebar\r\n\t\t\t|| (uri == \"/icons/waiting.gif\") // it didn't have time to fetch that\r\n\t\t ) {\t\t\t\t\t\t\t\t\t// favicon .. so let's do it now.\r\n\t\t uri = undefined;\r\n\t\t}\r\n\t }\r\n\t else if (savedBNList != undefined) { // We are still at initial load ..\r\n\t\tlet BN = savedBNList[BTN_id];\r\n\t\tif (BN != undefined) {\r\n\t\t uri = BN.faviconUri;\r\n\t\t if ((uri == \"/icons/nofavicontmp.png\") // Last time we stopped the sidebar\r\n\t\t\t || (uri == \"/icons/waiting.gif\") // it didn't have time to fetch that\r\n\t\t\t ) { // favicon .. so let's do it now.\r\n\t\t\turi = undefined;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t protect = false;\r\n\r\n\t // Trigger asynchronous favicon retrieval process if favicon uri not found\r\n\t if (uri == undefined) {\r\n\t\t// Set tmp favicon and remember it in case the add-on is stopped before we had\r\n\t\t// a chance to get its image.\r\n\t\turi = \"/icons/nofavicontmp.png\";\r\n\t\tfetchedUri = false;\r\n\t\ttriggerFetch = true;\r\n\t\tif (faviconWorker != undefined) {\r\n\t\t countFetchFav++;\r\n//console.log(\"countFetchFav 1: \"+countFetchFav+\" BTN_id: \"+BTN_id);\r\n\t\t}\r\n\t }\r\n\t else {\r\n\t\tfetchedUri = true;\r\n\t\tif (uri == \"/icons/nofavicon.png\")\r\n\t\t countNoFavicon++;\r\n\t }\r\n\t}\r\n\r\n\tif (forceProtect != undefined) { // General rule does not apply (e.g. BTN_id starting with \"place:\")\r\n\t protect = forceProtect;\r\n\t}\r\n\tnode = new BookmarkNode (\r\n\t BTN_id, type, level, BTN.parentId, BTN.dateAdded, protect,\r\n\t title, uri, fetchedUri, url\r\n\t);\r\n\r\n\tif (triggerFetch && !options.pauseFavicons) { // Trigger favicon fetch, except if paused\r\n\t // This is a bookmark, so here no need for cloneBN(), there is no tree below\r\n\t if (faviconWorker != undefined) {\r\n\t\tfaviconWorker({data: [\"get\", BTN_id, url, options.enableCookies]});\r\n\t }\r\n\t}\r\n }\r\n\r\n // Add child to parentBN if provided, adjusting index of other children as needed\r\n if (parentBN != undefined) {\r\n\tlet children = parentBN.children;\r\n\tif (children == undefined) { // No list of children so far\r\n\t parentBN.children = [node];\r\n\t}\r\n\telse if (index >= children.length) { // Append child at end\r\n\t children.push(node);\r\n\t}\r\n\telse { // Insert child at position\r\n\t children.splice(index, 0, node);\r\n\t}\r\n }\r\n\r\n return(node);\r\n}", "function findNewAnchor(prefix, exclude) {\n for (let i = 1; true; ++i) {\n const name = `${prefix}${i}`;\n if (!exclude.has(name))\n return name;\n }\n}", "function processPrefix(prefix, iri) {\n // Create a new prefix if an IRI is specified or the prefix doesn't exist\n if (typeof iri === 'string') {\n // Create a function that expands the prefix\n var cache = Object.create(null);\n\n prefixes[prefix] = function (local) {\n return cache[local] || (cache[local] = factory.namedNode(iri + local));\n };\n } else if (!(prefix in prefixes)) {\n throw new Error('Unknown prefix: ' + prefix);\n }\n\n return prefixes[prefix];\n }", "static fromValues(...values) {\n const bts = new BTS();\n values.forEach(value => bts.insert(value));\n return bts;\n }" ]
[ "0.72558004", "0.72558004", "0.7241421", "0.72054803", "0.7179913", "0.71568877", "0.5667578", "0.56435794", "0.54514116", "0.5317735", "0.52713424", "0.5159015", "0.5156747", "0.5130988", "0.5121047", "0.51059747", "0.50844276", "0.5081573", "0.5081573", "0.5018943", "0.50016224", "0.4977429", "0.49635762", "0.49342784", "0.4914333", "0.48980987", "0.4884022", "0.48707795", "0.48678702", "0.48647076", "0.48627207", "0.48581675", "0.48581675", "0.48581675", "0.48558375", "0.48540947", "0.48482156", "0.48384473", "0.48340622", "0.48336047", "0.47885054", "0.4787482", "0.47797692", "0.47723234", "0.476485", "0.47595653", "0.4752002", "0.4727507", "0.4725212", "0.47247672", "0.471513", "0.4713623", "0.4688321", "0.46812162", "0.46812162", "0.46812162", "0.46812162", "0.46778402", "0.46778402", "0.46682653", "0.46594557", "0.46485114", "0.4647903", "0.46412146", "0.46383524", "0.46241456", "0.46241456", "0.46241456", "0.46202138", "0.46202138", "0.46179816", "0.46162716", "0.46162716", "0.45983827", "0.45886162", "0.45886162", "0.45782557", "0.45635113", "0.45608324", "0.45599753", "0.45361108", "0.4533374", "0.45224896", "0.45176518", "0.45127425", "0.45096222", "0.4506431", "0.45036927", "0.45029423", "0.44992778", "0.44936353", "0.44921738", "0.4491881", "0.4489809", "0.44850123", "0.4483148", "0.4477545", "0.44754165", "0.44707948", "0.44656125" ]
0.72207934
3
CONCATENATED MODULE: ./app/components/Avatar.js / harmony default export
function Avatar(_ref) { var path = _ref.path, size = _ref.size; //size:.avatar-medium .avatar-sm return /*#__PURE__*/React.createElement("img", { src: path, alt: "Avatar", className: "avatar " + size }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get ImageResolver() {return WebpackModules.getByProps(\"getUserAvatarURL\", \"getGuildIconURL\");}", "function Avatar(props) {\n return (\n <img className=\"Avatar\" src={props.user.avatarUrl} alt={props.user.name} />\n );\n}", "function Avatar(props) {\n return (\n <img className=\"Avatar\"\n src={props.user.avatarUrl}\n alt={props.user.name}\n />\n );\n}", "function Avatar(props) {\n return (\n <img className=\"Avatar\"\n src={props.user.avatarUrl}\n alt={props.user.name}\n />\n\n );\n}", "getMxcAvatarUrl(): string { throw new Error(\"Member class not implemented\"); }", "function NoAvatar() {\n return (\n <img \n src=\"/defaultAvatar.png\"\n title=\"Default Avatar\"\n alt=\"Default Avatar\"\n className=\"usrAvatar\"\n />\n )\n}", "render () {\n let {src, alt, ...props} = this.props;\n src = src?.src || src; // image passed through import will return an object\n return <img {...props} src={addBasePath(src)} alt={alt}/>\n }", "function Image(props) {\n var alt = props.alt,\n avatar = props.avatar,\n bordered = props.bordered,\n centered = props.centered,\n children = props.children,\n circular = props.circular,\n className = props.className,\n content = props.content,\n dimmer = props.dimmer,\n disabled = props.disabled,\n floated = props.floated,\n fluid = props.fluid,\n height = props.height,\n hidden = props.hidden,\n href = props.href,\n inline = props.inline,\n label = props.label,\n rounded = props.rounded,\n size = props.size,\n spaced = props.spaced,\n src = props.src,\n verticalAlign = props.verticalAlign,\n width = props.width,\n wrapped = props.wrapped,\n ui = props.ui;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_2_classnames___default()(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"a\" /* useKeyOnly */])(ui, 'ui'), size, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"a\" /* useKeyOnly */])(avatar, 'avatar'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"a\" /* useKeyOnly */])(bordered, 'bordered'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"a\" /* useKeyOnly */])(circular, 'circular'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"a\" /* useKeyOnly */])(centered, 'centered'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"a\" /* useKeyOnly */])(disabled, 'disabled'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"a\" /* useKeyOnly */])(fluid, 'fluid'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"a\" /* useKeyOnly */])(hidden, 'hidden'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"a\" /* useKeyOnly */])(inline, 'inline'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"a\" /* useKeyOnly */])(rounded, 'rounded'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"k\" /* useKeyOrValueAndKey */])(spaced, 'spaced'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"j\" /* useValueAndKey */])(floated, 'floated'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"l\" /* useVerticalAlignProp */])(verticalAlign, 'aligned'), 'image', className);\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"b\" /* getUnhandledProps */])(Image, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"c\" /* getElementType */])(Image, props, function () {\n if (!__WEBPACK_IMPORTED_MODULE_1_lodash_isNil___default()(dimmer) || !__WEBPACK_IMPORTED_MODULE_1_lodash_isNil___default()(label) || !__WEBPACK_IMPORTED_MODULE_1_lodash_isNil___default()(wrapped) || !__WEBPACK_IMPORTED_MODULE_5__lib__[\"d\" /* childrenUtils */].isNil(children)) return 'div';\n });\n\n if (!__WEBPACK_IMPORTED_MODULE_5__lib__[\"d\" /* childrenUtils */].isNil(children)) {\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n }\n if (!__WEBPACK_IMPORTED_MODULE_5__lib__[\"d\" /* childrenUtils */].isNil(content)) {\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n content\n );\n }\n\n var rootProps = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes });\n var imgTagProps = { alt: alt, src: src, height: height, width: width };\n\n if (ElementType === 'img') return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rootProps, imgTagProps));\n\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rootProps, { href: href }),\n __WEBPACK_IMPORTED_MODULE_6__modules_Dimmer__[\"a\" /* default */].create(dimmer),\n __WEBPACK_IMPORTED_MODULE_7__Label_Label__[\"a\" /* default */].create(label),\n __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('img', imgTagProps)\n );\n}", "function AvatarPacked({ variant, avatar_Url, ...rest }) {\n let background;\n let color; \n let diameter = \"300px\";\n let defaultAvatar = \"https://bit.ly/dan-abramov\";\n \n \n if (variant === 'sm') {\n background = '#E4DDDD';\n color = background;\n diameter = \"78px\";\n \n } else if (variant === 'md') {\n background = '#E4DDDD';\n color = background;\n diameter = \"152px\";\n \n } else if (variant === 'lg') {\n background = '#E4DDDD';\n color = background; \n diameter = \"159px\"; \n } \n \n \n \n if(avatar_Url == null || avatar_Url ==\"\"){\n return ( \n <img src={defaultAvatar} alt=\"Avatar\" style={{color:background,width:diameter,borderRadius:\"50%\"}}></img>\n );\n }\n else{\n return <img src={avatar_Url} alt=\"Avatar\" style={{color:background,width:diameter,borderRadius:\"50%\"}}></img>\n }\n}", "renderAvatar() {\n const avatarId = this.props.currentUser.profile_photo_id;\n if (avatarId && (this.props.photos[avatarId] && this.props.photos[avatarId].avatar)) {\n return (\n <img src={this.props.photos[avatarId].avatar}\n id=\"menu-button\"\n className=\"profile-image nav-bar-avatar\"/>\n );\n } else {\n return (\n <img src=\"https://s3.us-east-2.amazonaws.com/flexpx-dev/avatar.png\"\n id=\"menu-button\"\n className=\"profile-image stock-avatar\"/>\n );\n }\n }", "function Image(props) {\n var avatar = props.avatar,\n bordered = props.bordered,\n centered = props.centered,\n children = props.children,\n circular = props.circular,\n className = props.className,\n content = props.content,\n dimmer = props.dimmer,\n disabled = props.disabled,\n floated = props.floated,\n fluid = props.fluid,\n hidden = props.hidden,\n href = props.href,\n inline = props.inline,\n label = props.label,\n rounded = props.rounded,\n size = props.size,\n spaced = props.spaced,\n verticalAlign = props.verticalAlign,\n wrapped = props.wrapped,\n ui = props.ui;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_3_classnames___default()(Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(ui, 'ui'), size, Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(avatar, 'avatar'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(bordered, 'bordered'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(circular, 'circular'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(centered, 'centered'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(disabled, 'disabled'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(fluid, 'fluid'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(hidden, 'hidden'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(inline, 'inline'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(rounded, 'rounded'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"C\" /* useKeyOrValueAndKey */])(spaced, 'spaced'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"F\" /* useValueAndKey */])(floated, 'floated'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"G\" /* useVerticalAlignProp */])(verticalAlign, 'aligned'), 'image', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"r\" /* getUnhandledProps */])(Image, props);\n\n var _partitionHTMLProps = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"z\" /* partitionHTMLProps */])(rest, { htmlProps: imageProps }),\n _partitionHTMLProps2 = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_slicedToArray___default()(_partitionHTMLProps, 2),\n imgTagProps = _partitionHTMLProps2[0],\n rootProps = _partitionHTMLProps2[1];\n\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"q\" /* getElementType */])(Image, props, function () {\n if (!__WEBPACK_IMPORTED_MODULE_2_lodash_isNil___default()(dimmer) || !__WEBPACK_IMPORTED_MODULE_2_lodash_isNil___default()(label) || !__WEBPACK_IMPORTED_MODULE_2_lodash_isNil___default()(wrapped) || !__WEBPACK_IMPORTED_MODULE_6__lib__[\"d\" /* childrenUtils */].isNil(children)) return 'div';\n });\n\n if (!__WEBPACK_IMPORTED_MODULE_6__lib__[\"d\" /* childrenUtils */].isNil(children)) {\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n }\n if (!__WEBPACK_IMPORTED_MODULE_6__lib__[\"d\" /* childrenUtils */].isNil(content)) {\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n content\n );\n }\n\n if (ElementType === 'img') return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rootProps, imgTagProps, { className: classes }));\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rootProps, { className: classes, href: href }),\n __WEBPACK_IMPORTED_MODULE_7__modules_Dimmer__[\"a\" /* default */].create(dimmer),\n __WEBPACK_IMPORTED_MODULE_8__Label_Label__[\"a\" /* default */].create(label),\n __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement('img', imgTagProps)\n );\n}", "function Image(props) {\n var avatar = props.avatar,\n bordered = props.bordered,\n centered = props.centered,\n children = props.children,\n circular = props.circular,\n className = props.className,\n content = props.content,\n dimmer = props.dimmer,\n disabled = props.disabled,\n floated = props.floated,\n fluid = props.fluid,\n hidden = props.hidden,\n href = props.href,\n inline = props.inline,\n label = props.label,\n rounded = props.rounded,\n size = props.size,\n spaced = props.spaced,\n verticalAlign = props.verticalAlign,\n wrapped = props.wrapped,\n ui = props.ui;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_3_classnames___default()(Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(ui, 'ui'), size, Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(avatar, 'avatar'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(bordered, 'bordered'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(circular, 'circular'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(centered, 'centered'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(disabled, 'disabled'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(fluid, 'fluid'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(hidden, 'hidden'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(inline, 'inline'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(rounded, 'rounded'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"C\" /* useKeyOrValueAndKey */])(spaced, 'spaced'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"F\" /* useValueAndKey */])(floated, 'floated'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"G\" /* useVerticalAlignProp */])(verticalAlign, 'aligned'), 'image', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"r\" /* getUnhandledProps */])(Image, props);\n\n var _partitionHTMLProps = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"z\" /* partitionHTMLProps */])(rest, { htmlProps: imageProps }),\n _partitionHTMLProps2 = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_slicedToArray___default()(_partitionHTMLProps, 2),\n imgTagProps = _partitionHTMLProps2[0],\n rootProps = _partitionHTMLProps2[1];\n\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"q\" /* getElementType */])(Image, props, function () {\n if (!__WEBPACK_IMPORTED_MODULE_2_lodash_isNil___default()(dimmer) || !__WEBPACK_IMPORTED_MODULE_2_lodash_isNil___default()(label) || !__WEBPACK_IMPORTED_MODULE_2_lodash_isNil___default()(wrapped) || !__WEBPACK_IMPORTED_MODULE_6__lib__[\"d\" /* childrenUtils */].isNil(children)) return 'div';\n });\n\n if (!__WEBPACK_IMPORTED_MODULE_6__lib__[\"d\" /* childrenUtils */].isNil(children)) {\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n }\n if (!__WEBPACK_IMPORTED_MODULE_6__lib__[\"d\" /* childrenUtils */].isNil(content)) {\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n content\n );\n }\n\n if (ElementType === 'img') return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rootProps, imgTagProps, { className: classes }));\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rootProps, { className: classes, href: href }),\n __WEBPACK_IMPORTED_MODULE_7__modules_Dimmer__[\"a\" /* default */].create(dimmer),\n __WEBPACK_IMPORTED_MODULE_8__Label_Label__[\"a\" /* default */].create(label),\n __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement('img', imgTagProps)\n );\n}", "function Image(props) {\n var avatar = props.avatar,\n bordered = props.bordered,\n centered = props.centered,\n children = props.children,\n circular = props.circular,\n className = props.className,\n content = props.content,\n dimmer = props.dimmer,\n disabled = props.disabled,\n floated = props.floated,\n fluid = props.fluid,\n hidden = props.hidden,\n href = props.href,\n inline = props.inline,\n label = props.label,\n rounded = props.rounded,\n size = props.size,\n spaced = props.spaced,\n verticalAlign = props.verticalAlign,\n wrapped = props.wrapped,\n ui = props.ui;\n var classes = __WEBPACK_IMPORTED_MODULE_3_classnames___default()(Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"A\" /* useKeyOnly */])(ui, 'ui'), size, Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"A\" /* useKeyOnly */])(avatar, 'avatar'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"A\" /* useKeyOnly */])(bordered, 'bordered'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"A\" /* useKeyOnly */])(circular, 'circular'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"A\" /* useKeyOnly */])(centered, 'centered'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"A\" /* useKeyOnly */])(disabled, 'disabled'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"A\" /* useKeyOnly */])(fluid, 'fluid'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"A\" /* useKeyOnly */])(hidden, 'hidden'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"A\" /* useKeyOnly */])(inline, 'inline'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"A\" /* useKeyOnly */])(rounded, 'rounded'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOrValueAndKey */])(spaced, 'spaced'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"E\" /* useValueAndKey */])(floated, 'floated'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"F\" /* useVerticalAlignProp */])(verticalAlign, 'aligned'), 'image', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"r\" /* getUnhandledProps */])(Image, props);\n\n var _partitionHTMLProps = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"y\" /* partitionHTMLProps */])(rest, {\n htmlProps: imageProps\n }),\n _partitionHTMLProps2 = __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_slicedToArray___default()(_partitionHTMLProps, 2),\n imgTagProps = _partitionHTMLProps2[0],\n rootProps = _partitionHTMLProps2[1];\n\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"q\" /* getElementType */])(Image, props, function () {\n if (!__WEBPACK_IMPORTED_MODULE_2_lodash_isNil___default()(dimmer) || !__WEBPACK_IMPORTED_MODULE_2_lodash_isNil___default()(label) || !__WEBPACK_IMPORTED_MODULE_2_lodash_isNil___default()(wrapped) || !__WEBPACK_IMPORTED_MODULE_6__lib__[\"c\" /* childrenUtils */].isNil(children)) {\n return 'div';\n }\n });\n\n if (!__WEBPACK_IMPORTED_MODULE_6__lib__[\"c\" /* childrenUtils */].isNil(children)) {\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes\n }), children);\n }\n\n if (!__WEBPACK_IMPORTED_MODULE_6__lib__[\"c\" /* childrenUtils */].isNil(content)) {\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes\n }), content);\n }\n\n if (ElementType === 'img') {\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rootProps, imgTagProps, {\n className: classes\n }));\n }\n\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rootProps, {\n className: classes,\n href: href\n }), __WEBPACK_IMPORTED_MODULE_7__modules_Dimmer__[\"a\" /* default */].create(dimmer, {\n autoGenerateKey: false\n }), __WEBPACK_IMPORTED_MODULE_8__Label_Label__[\"a\" /* default */].create(label, {\n autoGenerateKey: false\n }), __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\"img\", imgTagProps));\n}", "function Image(props) {\n var alt = props.alt,\n avatar = props.avatar,\n bordered = props.bordered,\n centered = props.centered,\n children = props.children,\n className = props.className,\n dimmer = props.dimmer,\n disabled = props.disabled,\n floated = props.floated,\n fluid = props.fluid,\n height = props.height,\n hidden = props.hidden,\n href = props.href,\n inline = props.inline,\n label = props.label,\n shape = props.shape,\n size = props.size,\n spaced = props.spaced,\n src = props.src,\n verticalAlign = props.verticalAlign,\n width = props.width,\n wrapped = props.wrapped,\n ui = props.ui;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_2_classnames___default()(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(ui, 'ui'), size, shape, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(avatar, 'avatar'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(bordered, 'bordered'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(centered, 'centered'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(disabled, 'disabled'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(fluid, 'fluid'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(hidden, 'hidden'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(inline, 'inline'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"j\" /* useKeyOrValueAndKey */])(spaced, 'spaced'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"h\" /* useValueAndKey */])(floated, 'floated'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"k\" /* useVerticalAlignProp */])(verticalAlign, 'aligned'), 'image', className);\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"b\" /* getUnhandledProps */])(Image, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"c\" /* getElementType */])(Image, props, function () {\n if (!__WEBPACK_IMPORTED_MODULE_1_lodash_isNil___default()(dimmer) || !__WEBPACK_IMPORTED_MODULE_1_lodash_isNil___default()(label) || !__WEBPACK_IMPORTED_MODULE_1_lodash_isNil___default()(wrapped) || !__WEBPACK_IMPORTED_MODULE_1_lodash_isNil___default()(children)) return 'div';\n });\n\n if (!__WEBPACK_IMPORTED_MODULE_1_lodash_isNil___default()(children)) {\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n }\n\n var rootProps = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes });\n var imgTagProps = { alt: alt, src: src, height: height, width: width };\n\n if (ElementType === 'img') return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rootProps, imgTagProps));\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rootProps, { href: href }),\n __WEBPACK_IMPORTED_MODULE_5__modules_Dimmer__[\"a\" /* default */].create(dimmer),\n __WEBPACK_IMPORTED_MODULE_6__Label_Label__[\"a\" /* default */].create(label),\n __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement('img', imgTagProps)\n );\n}", "renderBox(name, imgSrc){\n return(\n '<img src={require(' + imgSrc + ')} className=\"image\" alt=\"Img\" />'\n );\n }", "function SidebarChat(){\n return <div className=\"sidebarChat\">\n <Avatar src={teacherpic} /> \n <div className=\"sidebarChat__info\">\n <h2>Jessica</h2>\n <p>Of course!</p>\n </div>\n </div>;\n}", "get sourceAvatar() {}", "function Image(props) {\n var avatar = props.avatar,\n bordered = props.bordered,\n centered = props.centered,\n children = props.children,\n circular = props.circular,\n className = props.className,\n content = props.content,\n dimmer = props.dimmer,\n disabled = props.disabled,\n floated = props.floated,\n fluid = props.fluid,\n hidden = props.hidden,\n href = props.href,\n inline = props.inline,\n label = props.label,\n rounded = props.rounded,\n size = props.size,\n spaced = props.spaced,\n verticalAlign = props.verticalAlign,\n wrapped = props.wrapped,\n ui = props.ui;\n var classes = (0,clsx__WEBPACK_IMPORTED_MODULE_1__.default)((0,_lib__WEBPACK_IMPORTED_MODULE_4__.useKeyOnly)(ui, 'ui'), size, (0,_lib__WEBPACK_IMPORTED_MODULE_4__.useKeyOnly)(avatar, 'avatar'), (0,_lib__WEBPACK_IMPORTED_MODULE_4__.useKeyOnly)(bordered, 'bordered'), (0,_lib__WEBPACK_IMPORTED_MODULE_4__.useKeyOnly)(circular, 'circular'), (0,_lib__WEBPACK_IMPORTED_MODULE_4__.useKeyOnly)(centered, 'centered'), (0,_lib__WEBPACK_IMPORTED_MODULE_4__.useKeyOnly)(disabled, 'disabled'), (0,_lib__WEBPACK_IMPORTED_MODULE_4__.useKeyOnly)(fluid, 'fluid'), (0,_lib__WEBPACK_IMPORTED_MODULE_4__.useKeyOnly)(hidden, 'hidden'), (0,_lib__WEBPACK_IMPORTED_MODULE_4__.useKeyOnly)(inline, 'inline'), (0,_lib__WEBPACK_IMPORTED_MODULE_4__.useKeyOnly)(rounded, 'rounded'), (0,_lib__WEBPACK_IMPORTED_MODULE_4__.useKeyOrValueAndKey)(spaced, 'spaced'), (0,_lib__WEBPACK_IMPORTED_MODULE_4__.useValueAndKey)(floated, 'floated'), (0,_lib__WEBPACK_IMPORTED_MODULE_4__.useVerticalAlignProp)(verticalAlign, 'aligned'), 'image', className);\n var rest = (0,_lib__WEBPACK_IMPORTED_MODULE_5__.default)(Image, props);\n\n var _partitionHTMLProps = (0,_lib__WEBPACK_IMPORTED_MODULE_6__.partitionHTMLProps)(rest, {\n htmlProps: _lib__WEBPACK_IMPORTED_MODULE_6__.htmlImageProps\n }),\n imgTagProps = _partitionHTMLProps[0],\n rootProps = _partitionHTMLProps[1];\n\n var ElementType = (0,_lib__WEBPACK_IMPORTED_MODULE_7__.default)(Image, props, function () {\n if (!(0,lodash_es_isNil__WEBPACK_IMPORTED_MODULE_8__.default)(dimmer) || !(0,lodash_es_isNil__WEBPACK_IMPORTED_MODULE_8__.default)(label) || !(0,lodash_es_isNil__WEBPACK_IMPORTED_MODULE_8__.default)(wrapped) || !_lib__WEBPACK_IMPORTED_MODULE_9__.isNil(children)) {\n return 'div';\n }\n });\n\n if (!_lib__WEBPACK_IMPORTED_MODULE_9__.isNil(children)) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(ElementType, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__.default)({}, rest, {\n className: classes\n }), children);\n }\n\n if (!_lib__WEBPACK_IMPORTED_MODULE_9__.isNil(content)) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(ElementType, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__.default)({}, rest, {\n className: classes\n }), content);\n }\n\n if (ElementType === 'img') {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(ElementType, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__.default)({}, rootProps, imgTagProps, {\n className: classes\n }));\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(ElementType, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__.default)({}, rootProps, {\n className: classes,\n href: href\n }), _modules_Dimmer__WEBPACK_IMPORTED_MODULE_10__.default.create(dimmer, {\n autoGenerateKey: false\n }), _Label_Label__WEBPACK_IMPORTED_MODULE_11__.default.create(label, {\n autoGenerateKey: false\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3__.createElement(\"img\", imgTagProps));\n}", "function Image(props) {\n var avatar = props.avatar,\n bordered = props.bordered,\n centered = props.centered,\n children = props.children,\n circular = props.circular,\n className = props.className,\n content = props.content,\n dimmer = props.dimmer,\n disabled = props.disabled,\n floated = props.floated,\n fluid = props.fluid,\n hidden = props.hidden,\n href = props.href,\n inline = props.inline,\n label = props.label,\n rounded = props.rounded,\n size = props.size,\n spaced = props.spaced,\n verticalAlign = props.verticalAlign,\n wrapped = props.wrapped,\n ui = props.ui;\n var classes = Object(clsx__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"useKeyOnly\"])(ui, 'ui'), size, Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"useKeyOnly\"])(avatar, 'avatar'), Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"useKeyOnly\"])(bordered, 'bordered'), Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"useKeyOnly\"])(circular, 'circular'), Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"useKeyOnly\"])(centered, 'centered'), Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"useKeyOnly\"])(disabled, 'disabled'), Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"useKeyOnly\"])(fluid, 'fluid'), Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"useKeyOnly\"])(hidden, 'hidden'), Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"useKeyOnly\"])(inline, 'inline'), Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"useKeyOnly\"])(rounded, 'rounded'), Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"useKeyOrValueAndKey\"])(spaced, 'spaced'), Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"useValueAndKey\"])(floated, 'floated'), Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"useVerticalAlignProp\"])(verticalAlign, 'aligned'), 'image', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"getUnhandledProps\"])(Image, props);\n\n var _partitionHTMLProps = Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"partitionHTMLProps\"])(rest, {\n htmlProps: _lib__WEBPACK_IMPORTED_MODULE_5__[\"htmlImageProps\"]\n }),\n imgTagProps = _partitionHTMLProps[0],\n rootProps = _partitionHTMLProps[1];\n\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"getElementType\"])(Image, props, function () {\n if (!Object(lodash_es_isNil__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(dimmer) || !Object(lodash_es_isNil__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(label) || !Object(lodash_es_isNil__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(wrapped) || !_lib__WEBPACK_IMPORTED_MODULE_5__[\"childrenUtils\"].isNil(children)) {\n return 'div';\n }\n });\n\n if (!_lib__WEBPACK_IMPORTED_MODULE_5__[\"childrenUtils\"].isNil(children)) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(ElementType, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, rest, {\n className: classes\n }), children);\n }\n\n if (!_lib__WEBPACK_IMPORTED_MODULE_5__[\"childrenUtils\"].isNil(content)) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(ElementType, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, rest, {\n className: classes\n }), content);\n }\n\n if (ElementType === 'img') {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(ElementType, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, rootProps, imgTagProps, {\n className: classes\n }));\n }\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(ElementType, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, rootProps, {\n className: classes,\n href: href\n }), _modules_Dimmer__WEBPACK_IMPORTED_MODULE_6__[\"default\"].create(dimmer, {\n autoGenerateKey: false\n }), _Label_Label__WEBPACK_IMPORTED_MODULE_7__[\"default\"].create(label, {\n autoGenerateKey: false\n }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(\"img\", imgTagProps));\n}", "function OjoBot() {\n // Import result is the URL of your image\n return <img src={logo} alt=\"Logo\" />;\n}", "function CommentAvatar(props) {\n var className = props.className,\n src = props.src;\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('avatar', className);\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"b\" /* getUnhandledProps */])(CommentAvatar, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"c\" /* getElementType */])(CommentAvatar, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"n\" /* createHTMLImage */])(src)\n );\n}", "function Image(props) {\n var avatar = props.avatar,\n bordered = props.bordered,\n centered = props.centered,\n children = props.children,\n circular = props.circular,\n className = props.className,\n content = props.content,\n dimmer = props.dimmer,\n disabled = props.disabled,\n floated = props.floated,\n fluid = props.fluid,\n hidden = props.hidden,\n href = props.href,\n inline = props.inline,\n label = props.label,\n rounded = props.rounded,\n size = props.size,\n spaced = props.spaced,\n verticalAlign = props.verticalAlign,\n wrapped = props.wrapped,\n ui = props.ui;\n var classes = classnames__WEBPACK_IMPORTED_MODULE_3___default()(Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(ui, 'ui'), size, Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(avatar, 'avatar'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(bordered, 'bordered'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(circular, 'circular'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(centered, 'centered'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(disabled, 'disabled'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(fluid, 'fluid'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(hidden, 'hidden'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(inline, 'inline'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(rounded, 'rounded'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOrValueAndKey\"])(spaced, 'spaced'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useValueAndKey\"])(floated, 'floated'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useVerticalAlignProp\"])(verticalAlign, 'aligned'), 'image', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"getUnhandledProps\"])(Image, props);\n\n var _partitionHTMLProps = Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"partitionHTMLProps\"])(rest, {\n htmlProps: _lib__WEBPACK_IMPORTED_MODULE_6__[\"htmlImageProps\"]\n }),\n _partitionHTMLProps2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_partitionHTMLProps, 2),\n imgTagProps = _partitionHTMLProps2[0],\n rootProps = _partitionHTMLProps2[1];\n\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"getElementType\"])(Image, props, function () {\n if (!lodash_isNil__WEBPACK_IMPORTED_MODULE_2___default()(dimmer) || !lodash_isNil__WEBPACK_IMPORTED_MODULE_2___default()(label) || !lodash_isNil__WEBPACK_IMPORTED_MODULE_2___default()(wrapped) || !_lib__WEBPACK_IMPORTED_MODULE_6__[\"childrenUtils\"].isNil(children)) {\n return 'div';\n }\n });\n\n if (!_lib__WEBPACK_IMPORTED_MODULE_6__[\"childrenUtils\"].isNil(children)) {\n return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes\n }), children);\n }\n\n if (!_lib__WEBPACK_IMPORTED_MODULE_6__[\"childrenUtils\"].isNil(content)) {\n return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes\n }), content);\n }\n\n if (ElementType === 'img') {\n return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rootProps, imgTagProps, {\n className: classes\n }));\n }\n\n return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rootProps, {\n className: classes,\n href: href\n }), _modules_Dimmer__WEBPACK_IMPORTED_MODULE_7__[\"default\"].create(dimmer, {\n autoGenerateKey: false\n }), _Label_Label__WEBPACK_IMPORTED_MODULE_8__[\"default\"].create(label, {\n autoGenerateKey: false\n }), react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(\"img\", imgTagProps));\n}", "function Image(props) {\n var avatar = props.avatar,\n bordered = props.bordered,\n centered = props.centered,\n children = props.children,\n circular = props.circular,\n className = props.className,\n content = props.content,\n dimmer = props.dimmer,\n disabled = props.disabled,\n floated = props.floated,\n fluid = props.fluid,\n hidden = props.hidden,\n href = props.href,\n inline = props.inline,\n label = props.label,\n rounded = props.rounded,\n size = props.size,\n spaced = props.spaced,\n verticalAlign = props.verticalAlign,\n wrapped = props.wrapped,\n ui = props.ui;\n var classes = classnames__WEBPACK_IMPORTED_MODULE_3___default()(Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(ui, 'ui'), size, Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(avatar, 'avatar'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(bordered, 'bordered'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(circular, 'circular'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(centered, 'centered'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(disabled, 'disabled'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(fluid, 'fluid'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(hidden, 'hidden'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(inline, 'inline'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(rounded, 'rounded'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOrValueAndKey\"])(spaced, 'spaced'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useValueAndKey\"])(floated, 'floated'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useVerticalAlignProp\"])(verticalAlign, 'aligned'), 'image', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"getUnhandledProps\"])(Image, props);\n\n var _partitionHTMLProps = Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"partitionHTMLProps\"])(rest, {\n htmlProps: _lib__WEBPACK_IMPORTED_MODULE_6__[\"htmlImageProps\"]\n }),\n _partitionHTMLProps2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_partitionHTMLProps, 2),\n imgTagProps = _partitionHTMLProps2[0],\n rootProps = _partitionHTMLProps2[1];\n\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"getElementType\"])(Image, props, function () {\n if (!lodash_isNil__WEBPACK_IMPORTED_MODULE_2___default()(dimmer) || !lodash_isNil__WEBPACK_IMPORTED_MODULE_2___default()(label) || !lodash_isNil__WEBPACK_IMPORTED_MODULE_2___default()(wrapped) || !_lib__WEBPACK_IMPORTED_MODULE_6__[\"childrenUtils\"].isNil(children)) {\n return 'div';\n }\n });\n\n if (!_lib__WEBPACK_IMPORTED_MODULE_6__[\"childrenUtils\"].isNil(children)) {\n return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes\n }), children);\n }\n\n if (!_lib__WEBPACK_IMPORTED_MODULE_6__[\"childrenUtils\"].isNil(content)) {\n return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes\n }), content);\n }\n\n if (ElementType === 'img') {\n return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rootProps, imgTagProps, {\n className: classes\n }));\n }\n\n return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rootProps, {\n className: classes,\n href: href\n }), _modules_Dimmer__WEBPACK_IMPORTED_MODULE_7__[\"default\"].create(dimmer, {\n autoGenerateKey: false\n }), _Label_Label__WEBPACK_IMPORTED_MODULE_8__[\"default\"].create(label, {\n autoGenerateKey: false\n }), react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(\"img\", imgTagProps));\n}", "function CommentAvatar(props) {\n var className = props.className,\n src = props.src;\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('avatar', className);\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"b\" /* getUnhandledProps */])(CommentAvatar, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"c\" /* getElementType */])(CommentAvatar, props);\n\n return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__lib__[\"m\" /* createHTMLImage */])(src)\n );\n}", "function Image() {\n return (\n <div className=\"Image\">\n <img src={'/isa.JPG'} className=\"profile-pic\" alt=\"logo\" />\n \n </div>\n );\n }", "function component() {\n const element = document.createElement('div');\n\n // Lodash, now imported by this script\n element.innerHTML = _.join(['Hello', 'webpack'], ' ');\n element.classList.add('hello');\n\n // Add the image to our existing div.\n\n // const myIcon = new Image();\n\n // myIcon.src = Icon;\n // element.appendChild(myIcon);\n return element;\n}", "icons () {\n return require('@packages/icons')\n }", "function renderAvatar(user) {\n\tvar img = document.createElement('img')\n\timg.className = \"avatar\"\n\timg.src = user.avatarURL\n\timg.alt = \"\"\n\treturn img\n}", "function Image(props) {\n var alt = props.alt,\n avatar = props.avatar,\n bordered = props.bordered,\n centered = props.centered,\n children = props.children,\n className = props.className,\n dimmer = props.dimmer,\n disabled = props.disabled,\n floated = props.floated,\n fluid = props.fluid,\n height = props.height,\n hidden = props.hidden,\n href = props.href,\n inline = props.inline,\n label = props.label,\n shape = props.shape,\n size = props.size,\n spaced = props.spaced,\n src = props.src,\n verticalAlign = props.verticalAlign,\n width = props.width,\n wrapped = props.wrapped,\n ui = props.ui;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_2_classnames___default()(Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"z\" /* useKeyOnly */])(ui, 'ui'), size, shape, Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"z\" /* useKeyOnly */])(avatar, 'avatar'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"z\" /* useKeyOnly */])(bordered, 'bordered'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"z\" /* useKeyOnly */])(centered, 'centered'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"z\" /* useKeyOnly */])(disabled, 'disabled'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"z\" /* useKeyOnly */])(fluid, 'fluid'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"z\" /* useKeyOnly */])(hidden, 'hidden'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"z\" /* useKeyOnly */])(inline, 'inline'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"A\" /* useKeyOrValueAndKey */])(spaced, 'spaced'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"D\" /* useValueAndKey */])(floated, 'floated'), Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"E\" /* useVerticalAlignProp */])(verticalAlign, 'aligned'), 'image', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"q\" /* getUnhandledProps */])(Image, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_5__lib__[\"p\" /* getElementType */])(Image, props, function () {\n if (!__WEBPACK_IMPORTED_MODULE_1_lodash_isNil___default()(dimmer) || !__WEBPACK_IMPORTED_MODULE_1_lodash_isNil___default()(label) || !__WEBPACK_IMPORTED_MODULE_1_lodash_isNil___default()(wrapped) || !__WEBPACK_IMPORTED_MODULE_5__lib__[\"d\" /* childrenUtils */].isNil(children)) return 'div';\n });\n\n if (!__WEBPACK_IMPORTED_MODULE_5__lib__[\"d\" /* childrenUtils */].isNil(children)) {\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n }\n\n var rootProps = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes });\n var imgTagProps = { alt: alt, src: src, height: height, width: width };\n\n if (ElementType === 'img') return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rootProps, imgTagProps));\n\n return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rootProps, { href: href }),\n __WEBPACK_IMPORTED_MODULE_6__modules_Dimmer__[\"a\" /* default */].create(dimmer),\n __WEBPACK_IMPORTED_MODULE_7__Label_Label__[\"a\" /* default */].create(label),\n __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('img', imgTagProps)\n );\n}", "if (!this._loadImage) {\n this._loadImage = import('blueimp-load-image');\n }", "extend(config, ctx) {\n const vueLoader = config.module.rules.find(\n rule => rule.loader === \"vue-loader\"\n );\n vueLoader.options.transformToRequire = {\n img: \"src\",\n image: \"xlink:href\",\n \"b-img\": \"src\",\n \"b-img-lazy\": [\"src\", \"blank-src\"],\n \"b-card\": \"img-src\",\n \"b-card-img\": \"img-src\",\n \"b-carousel-slide\": \"img-src\",\n \"b-embed\": \"src\"\n };\n }", "function CommentAvatar(props) {\n var className = props.className,\n src = props.src;\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('avatar', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"r\" /* getUnhandledProps */])(CommentAvatar, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"q\" /* getElementType */])(CommentAvatar, props);\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes\n }), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"f\" /* createHTMLImage */])(src, {\n autoGenerateKey: false\n }));\n}", "function ImageHelper() { }", "set sourceAvatar(value) {}", "function CommentAvatar(props) {\n var className = props.className,\n src = props.src;\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('avatar', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"r\" /* getUnhandledProps */])(CommentAvatar, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"q\" /* getElementType */])(CommentAvatar, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"g\" /* createHTMLImage */])(src)\n );\n}", "function CommentAvatar(props) {\n var className = props.className,\n src = props.src;\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('avatar', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"r\" /* getUnhandledProps */])(CommentAvatar, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"q\" /* getElementType */])(CommentAvatar, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"g\" /* createHTMLImage */])(src)\n );\n}", "function CommentAvatar(props) {\n var className = props.className,\n src = props.src;\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('avatar', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"q\" /* getUnhandledProps */])(CommentAvatar, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"p\" /* getElementType */])(CommentAvatar, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"g\" /* createHTMLImage */])(src)\n );\n}", "function CardImage(props) {\n return <img src={props.src} alt=\"Avatar\" />;\n}", "getAvatarUrl() {\n const { user } = this.state;\n return endpoint + '/core/avatar/' + user.id + '/' + user.avatar;\n }", "component() {\n return import(/* webpackChunkName: \"about\" */ '../views/About.vue');\n }", "function Example() {\n return (\n <div>\n <IMChatHeading avatar=\"H\" headingText=\"Hello World\" />\n </div>\n );\n}", "function CommentAvatar(props) {\n var className = props.className,\n src = props.src;\n var classes = classnames__WEBPACK_IMPORTED_MODULE_2___default()('avatar', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"getUnhandledProps\"])(CommentAvatar, props);\n\n var _partitionHTMLProps = Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"partitionHTMLProps\"])(rest, {\n htmlProps: _lib__WEBPACK_IMPORTED_MODULE_5__[\"htmlImageProps\"]\n }),\n _partitionHTMLProps2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_partitionHTMLProps, 2),\n imageProps = _partitionHTMLProps2[0],\n rootProps = _partitionHTMLProps2[1];\n\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"getElementType\"])(CommentAvatar, props);\n return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rootProps, {\n className: classes\n }), Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"createHTMLImage\"])(src, {\n autoGenerateKey: false,\n defaultProps: imageProps\n }));\n}", "function CommentAvatar(props) {\n var className = props.className,\n src = props.src;\n var classes = classnames__WEBPACK_IMPORTED_MODULE_2___default()('avatar', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"getUnhandledProps\"])(CommentAvatar, props);\n\n var _partitionHTMLProps = Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"partitionHTMLProps\"])(rest, {\n htmlProps: _lib__WEBPACK_IMPORTED_MODULE_5__[\"htmlImageProps\"]\n }),\n _partitionHTMLProps2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_partitionHTMLProps, 2),\n imageProps = _partitionHTMLProps2[0],\n rootProps = _partitionHTMLProps2[1];\n\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"getElementType\"])(CommentAvatar, props);\n return react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rootProps, {\n className: classes\n }), Object(_lib__WEBPACK_IMPORTED_MODULE_5__[\"createHTMLImage\"])(src, {\n autoGenerateKey: false,\n defaultProps: imageProps\n }));\n}", "extends(config) {\n // for using images in folder 'assets' also in data attribute 'data-src'\n // useful for lazy loading\n // https://github.com/nuxt/nuxt.js/issues/2650\n const vueLoader = config.module.rules.find(\n (rule) => rule.loader === 'vue-loader'\n )\n vueLoader.options.transformToRequire.img = ['src', 'data-src']\n }", "function ProfileName() {\n return (\n <React.Fragment>\n <img src={randoCalrissian} alt=\"Billy Dee Williams Impersonator - Jimmie Morgan\" width=\"50%\"/>\n <h3>Rando Calrissian</h3>\n </React.Fragment>\n );\n}", "render() {\n // this.props is the object with the info being sent to the component\n console.log(this.props);\n\n // <User firstName=\"Pablo\" />\n // ↓↓↓↓↓↓↓↓↓↓↓↓\n // this.props = { firstName: \"Pablo\" }\n\n const { firstName, lastName, email, photo } = this.props;\n\n // render() returns the HTML of this component's content\n // (use parenthesis when returning multiple lines of HTML)\n return (\n // use \"className\" instead of \"class\" for styling your HTML\n <div className=\"User\">\n <p>\n Welcome, {firstName} {lastName}! This is your email: {email}.\n </p>\n {/* call a function in {} to display its result */}\n {displayAvatar(photo)}\n </div>\n );\n }", "getName() {\nreturn this.avatarName;\n}", "function Collaborators({collabs}) {\n \n return (\n <div className=\"anim_container\" style={{display:'flex', alignItems:'center', justifyContent:'space-between'}}>\n {collabs.map((friend, i) => {\n return <Avatar className=\"anim_avatar\" isSolid name={friend.name ? friend.name : \"Anonymous Mouse\"} size={36} style={{zIndex:i*-1}} key={friend.name.split(' ')[0]+i} />\n })}\n </div>\n );\n}", "function UpdatedUserView({ displayName, color = 'blue' }) {\n return (\n <Avatar\n style={{ backgroundColor: color, verticalAlign: 'middle' }}\n size=\"large\"\n >\n {displayName}\n </Avatar>\n );\n}", "function Avatar({\n className,\n children,\n imageURL,\n style,\n size = \"\",\n status,\n placeholder,\n icon,\n color = \"\",\n onClick,\n onMouseEnter,\n onMouseLeave,\n onPointerEnter,\n onPointerLeave,\n}: Props): React.Node {\n const classes = cn(\n {\n avatar: true,\n [`avatar-${size}`]: !!size,\n \"avatar-placeholder\": placeholder,\n [`avatar-${color}`]: !!color,\n },\n className\n );\n return (\n <span\n className={classes}\n style={\n imageURL\n ? Object.assign(\n {\n backgroundImage: `url(${imageURL})`,\n },\n style\n )\n : style\n }\n onClick={onClick}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n onPointerEnter={onPointerEnter}\n onPointerLeave={onPointerLeave}\n >\n {icon && <Icon name={icon} />}\n {status && <span className={`avatar-status bg-${status}`} />}\n {children}\n </span>\n );\n}", "function AvatarURL( fn )\n{\n return 'https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/' + fn.substring( 0, 2 ) + '/' + fn + '.jpg';\n}", "function Members(){\n const andrew_img = 'images/Andrew.jpg';\n const jacob_img = 'images/Jacob.jpg'\n const bryce_img = 'images/Bryce.jpg'\n const greg_img = 'images/Greg.jpg'\n const joey_img = 'images/Joey.jpg'\n const vince_img = 'images/Vince.jpg'\n const blum_img = 'images/Dave.jpg'\n const bauer_img = 'images/OLAS.jpg'\n\n return (\n <div>\n <h1>Meet the Band</h1>\n <div className=\"row\">\n <Member name=\"Andrew Alten\" instrument=\"Mandolin\" img_url={andrew_img}/>\n <Member name=\"Jacob Alten\" instrument=\"Vocal and Guitar\" img_url={jacob_img}/>\n <Member name=\"Bryce Clawson\" instrument=\"Vocals and Harmonica \" img_url={bryce_img}/>\n <Member name=\"Greg Stevens\" instrument=\"Banjo and Guitar\" img_url={greg_img}/>\n <Member name=\"Joey Oberholzer\" instrument=\"Vocals\" img_url={joey_img}/>\n <Member name=\"Vince Stevens\" instrument=\"Dobro\" img_url={vince_img}/>\n <Member name=\"Dave Blumberg\" instrument=\"Bass\" img_url={blum_img}/>\n <Member name=\"Dave Bauer\" instrument=\"Sound\" img_url={bauer_img}/>\n </div>\n </div>\n )\n \n}", "function CommentAvatar(props) {\n var className = props.className,\n src = props.src;\n var classes = Object(clsx__WEBPACK_IMPORTED_MODULE_1__[\"default\"])('avatar', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getUnhandledProps\"])(CommentAvatar, props);\n\n var _partitionHTMLProps = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"partitionHTMLProps\"])(rest, {\n htmlProps: _lib__WEBPACK_IMPORTED_MODULE_4__[\"htmlImageProps\"]\n }),\n imageProps = _partitionHTMLProps[0],\n rootProps = _partitionHTMLProps[1];\n\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getElementType\"])(CommentAvatar, props);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(ElementType, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, rootProps, {\n className: classes\n }), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"createHTMLImage\"])(src, {\n autoGenerateKey: false,\n defaultProps: imageProps\n }));\n}", "function Profile() {\n return (\n <div>\n {/* <ProfileTitle/> */}\n <CardWrapper>\n <UsersProfile />\n </CardWrapper>\n </div >\n );\n}", "function Icon(props){\n return <img src={props.name} width=\"auto\" height=\"20px\"/>; \n }", "function component() {\n const element = document.createElement('div');\n const btn = document.createElement('button');\n \n element.innerHTML = _.join(['Hello', 'webpack'], ' ');\n // element.classList.add('hello');\n\n // const myIcon = new Image();\n // myIcon.src = Icon;\n\n // element.appendChild(myIcon);\n\n // console.log(Data);\n\n btn.innerHTML = 'Click me and check the console!';\n // btn.onclick = printMe;\n\n element.appendChild(btn);\n\n btn.onclick = function() {\n import(/* webpackChunkName: \"print\" */ './print')\n .then(function(module) {\n const printMe = module.default;\n\n printMe();\n });\n };\n \n return element;\n\n // return import(/* webpackChunkName: \"lodash\" */ 'lodash').then(function(_) {\n // const element = document.createElement('div');\n // const btn = document.createElement('button');\n\n // element.innerHTML = _.join(['Hello', 'webpack'], ' ');\n\n // btn.innerHTML = 'Click me and check the console!';\n // btn.onclick = printMe;\n\n // element.appendChild(btn);\n\n // return element;\n // }).catch(function(error) {\n // console.log('An error occurred while loading the component')\n // });\n}", "function User({name, description, age, avatar}) {\n const usrName = name || 'Name not available';\n const usrDecription = description || 'Description not available';\n const usrAge = age || 'Age not available';\n const usrAvatar = avatar || <NoAvatar />;\n return (\n <div className=\"userInfoContainer\">\n {usrAvatar}\n <div className=\"usrData\">\n <h2> {usrName} </h2>\n <p> {usrDecription} </p>\n <p> Age: {usrAge} </p>\n </div>\n </div>\n )\n}", "render() {\n // render() returns the HTML of this component's content\n // (use parenthesis when returning multiple lines of HTML)\n return (\n // use \"className\" instead of \"class\" for styling your HTML\n <div className=\"App container\">\n <h2 onClick={() => this.handleClick()}>JSX is Weird</h2>\n\n <p>This is App component.</p>\n <p>\n Welcome, {user.firstName} {user.lastName}! You live at{\" \"}\n {user.address.street1}. This is your email: {user.emails[0]}.\n </p>\n {/* call a function in {} to display its result */}\n {displayAvatar()}\n </div>\n );\n }", "function CardComponent({actor}) {\n\t\n\treturn (\n\t\t<div className=\"col\">\n\t\t\t<img src={actor.myImg}/>\n\t\t\t<h4>{actor.firstName} {actor.lastName}</h4>\n\t\t\t<div>{actor.age}</div>\n</div>\n\t)\n}", "function New({firstName} ) {\n return <p>Hello from another component {firstName}<br/>\n <h1>check this out</h1>\n <img src='../public/rose.jpeg' alt='pic' title='anms pic' />\n <ol>\n <li>new.js</li>\n <li>first try</li>\n <li> second try </li>\n </ol> </p>\n}", "function Userard(props) {\n return (\n <div className=\"UserCard\">\n <img src={require(`../../assets/images/profile/${Math.floor(Math.random() * 3) + 1}.png`)} className=\"UserImg\" alt={props.user.firstName}/>\n <div>\n <p>{props.user.firstName} {props.user.lastName}</p>\n <p style={{fontSize: \"12px\", marginTop:\"10px\"}}>{props.user.email}</p>\n </div>\n </div>\n );\n}", "function setAvatarBo() {\n avatar = 'img/char-boy.png';\n}", "renderAvatarView() {\n return (\n <View\n key=\"avatar\"\n style={styles.avatarViewContainer}\n >\n {this.renderSideItemLeft()}\n {this.renderAvatar()}\n {this.renderSideItemRight()}\n </View>\n );\n }", "function UserComponent(){\n console.log('User component')\n}", "function Card(props){\n const thisCard = `/cards/${props.card}.png`\n return(\n <div className=\"col-sm-2 card\">\n <img src={thisCard} />\n </div>\n )\n}", "render() {\n return (\n <>\n {this.state.loading ? <LoadingSpinner /> :\n <div>\n <Form avatars={this.state.allavatars}\n onUpdate={this.updateAvatar} >\n </Form>\n <AvatarList\n avatars={this.state.allavatars}\n onDelete={this.deleteAvatar}>\n </AvatarList>\n </div>}\n </>\n );\n }", "extend(config) {\n const vueLoader = config.module.rules.find(\n (rule) => rule.loader === 'vue-loader'\n )\n vueLoader.options.transformAssetUrls = {\n video: ['src', 'poster'],\n source: 'src',\n img: 'src',\n image: 'xlink:href',\n 'b-img': 'src',\n 'b-img-lazy': ['src', 'blank-src'],\n 'b-card': 'img-src',\n 'b-card-img': 'img-src',\n 'b-card-img-lazy': ['src', 'blank-src'],\n 'b-carousel-slide': 'img-src',\n 'b-embed': 'src',\n }\n }", "function UploadAvatar(props) {\n const { avatar, setAvatar } = props;\n\n const onDrop = useCallback(\n (acceptedFiles) => {\n const file = acceptedFiles[0];\n //Variable con el tamaño del archivo\n setTamaño(file.size);\n //Variable con el tipo de archivo\n setFormato(file.type);\n setResolucion(file.resolution);\n\n //Variable que almacena la url temporal para pintar la imagen en el canva\n setUrlImg(URL.createObjectURL(file));\n setAvatar({ file, preview: URL.createObjectURL(file) });\n },\n [setAvatar]\n );\n\n const { getRootProps, getInputProps, isDragActive } = useDropzone({\n accept: \"image/jpeg, image/jpg, image/png\",\n noKeyboard: true,\n onDrop,\n });\n\n return (\n <div className=\"upload-avatar\" {...getRootProps()}>\n <input {...getInputProps()} />\n {isDragActive ? (\n <Avatar size={200} src={NoImage} />\n ) : (\n <Avatar size={200} src={avatar ? avatar.preview : NoImage} />\n )}\n </div>\n );\n }", "extend(config, ctx) {\n const vueLoader = config.module.rules.find(\n rule => rule.loader === 'vue-loader'\n )\n vueLoader.options.transformAssetUrls = {\n video: ['src', 'poster'],\n source: 'src',\n img: 'src',\n image: 'xlink:href',\n 'b-img': 'src',\n 'b-img-lazy': ['src', 'blank-src'],\n 'b-card': 'img-src',\n 'b-card-img': 'img-src',\n 'b-carousel-slide': 'img-src',\n 'b-embed': 'src'\n }\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n config.node = {\n fs: 'empty'\n }\n // Add markdown loader\n config.module.rules.push({\n test: /\\.md$/,\n loader: 'frontmatter-markdown-loader'\n })\n }", "function LogoHeaderComponent() {\n }", "function AvatarProp(props: { author: string }) {\n const bgcolor = useRef(getRandomColor()).current;\n return (\n <Avatar aria-label=\"comment\" style={{ backgroundColor: bgcolor }}>\n {props.author[0].toUpperCase()}\n </Avatar>\n );\n}", "function AdminHeader() {\n return (\n <div>\n <header className=\"admin-header\">\n <div className=\"admin-logo\">\n <img \n className=\"admin_bark_logo\"\n src=\"./images/Barktique-and-meow-logo-final-color.png\" \n />\n </div>\n </header>\n </div>\n )\n} // end AdminHeader", "get avatar24() {\n return \"http://www.gravatar.com/avatar/\" + $md5.hex_md5(this.email) +\n \".jpg?d=wavatar&s=24\";\n }", "function Component() { }", "pickLogo () {\n\n\t\t/**\n\t\t * You have to call require in each call otherwise it breaks for some reason\n\t\t */\n\t\t\n\t\tlet url = require('../../images/logo_white.png');\n\n\t\tswitch(this.props.route.toString()){\n\t\t\tcase 'Default':\n\t\t\t\turl = require('../../images/logo_bart.png');\n\t\t\tbreak;\n\t\t\tcase 'Meeting':\n\t\t\t\turl = require('../../images/logo_patrick.png');\n\t\t\tbreak;\n\t\t\tcase 'Delivery':\n\t\t\t\turl = require('../../images/logo_stitch.png');\n\t\t\tbreak;\n\t\t\tcase null:\n\t\t\tcase 'Welcome':\n\t\t\tdefault:\n\t\t\t\turl = require('../../images/logo_white.png');\n\t\t\tbreak; \n\t\t}\n\n\t\treturn (\n\t\t\t<Image source={ url } style={ {\n\t\t\t\twidth: 150,\n\t\t\t\theight: 21,\n\t\t\t\tmarginTop: 1,\n\t\t\t\tmarginRight: 10\n\t\t\t} } />\n\t\t)\n\t}", "getNameAndLogo() {\n return `${this.name} ${this.logo}`;\n }", "getComponent (nextState, cb) {\n if (!store.getState().user.isAdmin) {\n return browserHistory.push('/account')\n }\n\n /* Webpack - use 'require.ensure' to create a split point\n and embed an async module loader (jsonp) when bundling */\n require.ensure([], (require) => {\n /* Webpack - use require callback to define\n dependencies for bundling */\n const PlayerView = require('./views/PlayerViewContainer').default\n const playerReducer = require('./modules/player').default\n const playerVisualizerReducer = require('./modules/playerVisualizer').default\n\n /* Add the reducer to the store on key 'player' */\n injectReducer(store, { key: 'player', reducer: playerReducer })\n injectReducer(store, { key: 'playerVisualizer', reducer: playerVisualizerReducer })\n\n /* Return getComponent */\n cb(null, PlayerView)\n\n /* Webpack named bundle */\n }, 'player')\n }", "get label(){return modules.sprite}", "function createAvatar() {\n var avatar = document.createElement('i');\n avatar.className = \"icon-avatar avatar\";\n\n return avatar;\n }", "function UserInfo(props) {\n return (\n <div className=\"UserInfo\">\n <Avatar user={props.user} />\n <div className=\"UserInfo-name\">\n {props.user.name}\n </div>\n </div>\n );\n}", "function UserInfo(props) {\n return (\n <div className=\"UserInfo\">\n <Avatar user={props.user} />\n <div className=\"UserInfo-name\">\n {props.user.name}\n </div>\n </div>\n );\n}", "buildImageComponentURL(name) {\n if (name === 'Websites') {\n return <WebsitesImage />\n } else if (name === 'Creative') {\n return <CreativeImage getColorFunction={this.getCreativeColor} />\n } else if (name === 'Branding') {\n return (\n <BrandingImage\n rightSwatchBackground={this.state.hexColor}\n rightRgb={this.state.rgbColor}\n />\n )\n } else if (name === 'Marketing') {\n return <MarketingImage />\n }\n }", "render() {\n const {\n alt,\n src,\n srcset,\n sizes,\n width,\n height\n } = this.props;\n return __jsx(\"img\", {\n alt: alt,\n className: \"lazy\",\n \"data-src\": src,\n \"data-srcset\": srcset,\n \"data-sizes\": sizes,\n width: width,\n height: height,\n __source: {\n fileName: _jsxFileName,\n lineNumber: 25\n },\n __self: this\n });\n }", "function SocialAccountLinkModule(){}", "constructor() {\n super({\n key: 'SplashScreen',\n\n // Splash screen and progress bar textures.\n pack: {\n files: [{\n key: 'splash-screen',\n type: 'image'\n }, {\n key: 'progress-bar',\n type: 'image'\n }]\n }\n });\n }", "function CommentAvatar(props) {\n var className = props.className,\n src = props.src;\n\n var classes = (0, _classnames2.default)('avatar', className);\n var rest = (0, _lib.getUnhandledProps)(CommentAvatar, props);\n var ElementType = (0, _lib.getElementType)(CommentAvatar, props);\n\n return _react2.default.createElement(ElementType, (0, _extends3.default)({}, rest, { className: classes }), (0, _lib.createHTMLImage)(src));\n}", "function CommentAvatar(props) {\n var className = props.className,\n src = props.src;\n\n var classes = (0, _classnames2.default)('avatar', className);\n var rest = (0, _lib.getUnhandledProps)(CommentAvatar, props);\n var ElementType = (0, _lib.getElementType)(CommentAvatar, props);\n\n return _react2.default.createElement(ElementType, (0, _extends3.default)({}, rest, { className: classes }), (0, _lib.createHTMLImage)(src));\n}", "getComponent (nextState, cb) {\n /* Webpack - use 'System.import' to create a split point\n and embed an async module loader (jsonp) when bundling */\n Promise.all([\n import(/* webpackChunkName: \"thunk_demo\" */ './containers')\n ]).then(([Containers]) => {\n const modules = require('./modules')\n const reducer = modules.default\n injectReducer(store, { key: 'thunk_demo', reducer })\n /* Return getComponent */\n cb(null, Containers.default)\n })\n }", "function Image(props) {\n var avatar = props.avatar,\n bordered = props.bordered,\n centered = props.centered,\n children = props.children,\n circular = props.circular,\n className = props.className,\n content = props.content,\n dimmer = props.dimmer,\n disabled = props.disabled,\n floated = props.floated,\n fluid = props.fluid,\n hidden = props.hidden,\n href = props.href,\n inline = props.inline,\n label = props.label,\n rounded = props.rounded,\n size = props.size,\n spaced = props.spaced,\n verticalAlign = props.verticalAlign,\n wrapped = props.wrapped,\n ui = props.ui;\n var classes = classnames_default()(useKeyOnly(ui, 'ui'), size, useKeyOnly(avatar, 'avatar'), useKeyOnly(bordered, 'bordered'), useKeyOnly(circular, 'circular'), useKeyOnly(centered, 'centered'), useKeyOnly(disabled, 'disabled'), useKeyOnly(fluid, 'fluid'), useKeyOnly(hidden, 'hidden'), useKeyOnly(inline, 'inline'), useKeyOnly(rounded, 'rounded'), useKeyOrValueAndKey(spaced, 'spaced'), useValueAndKey(floated, 'floated'), useVerticalAlignProp(verticalAlign, 'aligned'), 'image', className);\n var rest = lib_getUnhandledProps(Image, props);\n\n var _partitionHTMLProps = htmlPropsUtils_partitionHTMLProps(rest, {\n htmlProps: htmlImageProps\n }),\n _partitionHTMLProps2 = slicedToArray_default()(_partitionHTMLProps, 2),\n imgTagProps = _partitionHTMLProps2[0],\n rootProps = _partitionHTMLProps2[1];\n\n var ElementType = lib_getElementType(Image, props, function () {\n if (!isNil_default()(dimmer) || !isNil_default()(label) || !isNil_default()(wrapped) || !childrenUtils_namespaceObject.isNil(children)) {\n return 'div';\n }\n });\n\n if (!childrenUtils_namespaceObject.isNil(children)) {\n return react_default.a.createElement(ElementType, extends_default()({}, rest, {\n className: classes\n }), children);\n }\n\n if (!childrenUtils_namespaceObject.isNil(content)) {\n return react_default.a.createElement(ElementType, extends_default()({}, rest, {\n className: classes\n }), content);\n }\n\n if (ElementType === 'img') {\n return react_default.a.createElement(ElementType, extends_default()({}, rootProps, imgTagProps, {\n className: classes\n }));\n }\n\n return react_default.a.createElement(ElementType, extends_default()({}, rootProps, {\n className: classes,\n href: href\n }), Dimmer_Dimmer.create(dimmer, {\n autoGenerateKey: false\n }), Label_Label.create(label, {\n autoGenerateKey: false\n }), react_default.a.createElement(\"img\", imgTagProps));\n}", "function App(){\n return(\n <div>\n <ContactCard name = \"Tarik\" email = \"random@gmail\" number = \"123-321-1231\" url = \"linkedin.com/in/user\" />\n </div>\n )\n}", "renderIcon() { // eslint-disable-line\n if (this.props.withIcon) {\n return <div className=\"uploadIcon\" />;\n }\n }", "function componentsAsUmdModules(){\n const componentsDir = path.join(PROJECT_SRC_DIR, 'components')\n const r = {}\n\n glob.sync(componentsDir + '/**/*.vue').forEach(file => {\n if (!shouldIgnoreFile(file)){\n r[fileToModuleEntryName(file)] = {\n ...defaultBaseEntry, \n\n // the component will be packed into AMD module\n libTarget: 'amd',\n\n // the js template\n js: require('./src/template/component.script'),\n\n // components has no html and css, all will be packed into a .js file\n html: false,\n css: false,\n extractCssFromJs: false,\n }\n }\n })\n\n return r\n}", "function CommentAvatar(props) {\n var className = props.className,\n src = props.src;\n var classes = (0, _classnames[\"default\"])('avatar', className);\n var rest = (0, _lib.getUnhandledProps)(CommentAvatar, props);\n\n var _partitionHTMLProps = (0, _lib.partitionHTMLProps)(rest, {\n htmlProps: _lib.htmlImageProps\n }),\n _partitionHTMLProps2 = (0, _slicedToArray2[\"default\"])(_partitionHTMLProps, 2),\n imageProps = _partitionHTMLProps2[0],\n rootProps = _partitionHTMLProps2[1];\n\n var ElementType = (0, _lib.getElementType)(CommentAvatar, props);\n return _react[\"default\"].createElement(ElementType, (0, _extends2[\"default\"])({}, rootProps, {\n className: classes\n }), (0, _lib.createHTMLImage)(src, {\n autoGenerateKey: false,\n defaultProps: imageProps\n }));\n}", "function HomePagePhoto() {\n return <div className=\"banner my-5\" />\n}", "function Gravatar (props) {\n const email = props.email;\n const hash = md5(email);\n\n return(\n <img className={props.className}\n src={'https://s.gravatar.com/avatar/'||`${hash}`||'?s=80'} //arreglar el Hash \n alt=\"Avatar\" />\n )\n}", "extend(config, ctx) {\n config.module.rules.push({\n test: /\\.(ogg|mp3|wav|mpe?g)$/i,\n loader: \"file-loader\",\n options: {\n name: \"[path][name].[ext]\"\n }\n });\n }", "mapStateToProps(state) {\n // noinspection JSUnresolvedFunction\n let image = state.profile.selectedImage ? {uri: state.profile.selectedImage} :\n state.profile.image ? {uri:state.profile.image} : require(\"../img/default_profile.png\");\n return {\n name: state.profile.name,\n image: image,\n password: state.profile.password,\n confirmPassword: state.profile.confirmPassword,\n errors: state.profile.errors\n }\n }", "render(){\n return (\n <div>\n . <img src=\"./login_images/login_background.jpeg\" id=\"login_background\" />\n <div id=\"login_component\">\n <img src=\"./login_images/cc_logo.png\" id=\"login_image\" />\n <LoginButton />\n </div>\n </div>\n );\n }", "function ListItemAvatar(props, context) {\n var children = props.children,\n classes = props.classes,\n classNameProp = props.className,\n other = (0, _objectWithoutProperties3.default)(props, ['children', 'classes', 'className']);\n\n\n if (context.dense === undefined) {\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(false, 'Material-UI: <ListItemAvatar> is a simple wrapper to apply the dense styles\\n to <Avatar>. You do not need it unless you are controlling the <List> dense property.') : void 0;\n return props.children;\n }\n\n return _react2.default.cloneElement(children, (0, _extends3.default)({\n className: (0, _classnames2.default)((0, _defineProperty3.default)({}, classes.root, context.dense), classNameProp, children.props.className),\n childrenClassName: (0, _classnames2.default)((0, _defineProperty3.default)({}, classes.icon, context.dense), children.props.childrenClassName)\n }, other));\n}", "function ListItemAvatar(props, context) {\n var children = props.children,\n classes = props.classes,\n classNameProp = props.className,\n other = (0, _objectWithoutProperties3.default)(props, ['children', 'classes', 'className']);\n\n\n if (context.dense === undefined) {\n process.env.NODE_ENV !== \"production\" ? (0, _warning2.default)(false, 'Material-UI: <ListItemAvatar> is a simple wrapper to apply the dense styles\\n to <Avatar>. You do not need it unless you are controlling the <List> dense property.') : void 0;\n return props.children;\n }\n\n return _react2.default.cloneElement(children, (0, _extends3.default)({\n className: (0, _classnames2.default)((0, _defineProperty3.default)({}, classes.root, context.dense), classNameProp, children.props.className),\n childrenClassName: (0, _classnames2.default)((0, _defineProperty3.default)({}, classes.icon, context.dense), children.props.childrenClassName)\n }, other));\n}" ]
[ "0.6372429", "0.63032466", "0.6260666", "0.6255008", "0.587173", "0.58440965", "0.5771948", "0.57689273", "0.5758416", "0.5746804", "0.57277787", "0.57277787", "0.5652027", "0.56428885", "0.5584269", "0.55498016", "0.554062", "0.55048263", "0.5494068", "0.54721415", "0.54500955", "0.54353845", "0.54353845", "0.54326457", "0.54208124", "0.5390124", "0.5329917", "0.531714", "0.53105426", "0.53100234", "0.5302879", "0.5273721", "0.5267861", "0.52594674", "0.51938826", "0.51938826", "0.51837796", "0.5167954", "0.5163758", "0.51633644", "0.51616466", "0.51531696", "0.51531696", "0.5142703", "0.5125894", "0.5108717", "0.5099194", "0.5089172", "0.5074971", "0.50736403", "0.5068857", "0.50646013", "0.5057405", "0.5044168", "0.50428104", "0.5037407", "0.50323564", "0.50215024", "0.5016894", "0.50109667", "0.50087494", "0.49778935", "0.49757126", "0.49731845", "0.49612135", "0.49580482", "0.49576718", "0.49479976", "0.49161088", "0.4910228", "0.49074754", "0.49028495", "0.4899645", "0.48895466", "0.48878628", "0.4883592", "0.48828757", "0.48663265", "0.48637176", "0.48603198", "0.48603198", "0.48563707", "0.48537886", "0.4850448", "0.48365122", "0.48356566", "0.48356566", "0.48318246", "0.48276904", "0.48259342", "0.48250574", "0.48235345", "0.48220438", "0.48207304", "0.48202282", "0.4815198", "0.4811862", "0.48108372", "0.4809945", "0.4809945" ]
0.5867863
5
Returns true if the HTML5 history API is supported. Taken from Modernizr. changed to avoid false negatives for Windows Phones:
function supportsHistory() { var ua = window.navigator.userAgent; if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false; return window.history && 'pushState' in window.history; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function supportsHistory() { // 60\n var ua = navigator.userAgent; // 61\n if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n return false; // 63\n } // 64\n return window.history && 'pushState' in window.history; // 65\n} // 66", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\n\t var ua = navigator.userAgent;\n\t if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n\t return false;\n\t }\n\t return window.history && 'pushState' in window.history;\n\t}", "function supportsHistory() {\r\n\t var ua = navigator.userAgent;\r\n\t if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\r\n\t return false;\r\n\t }\r\n\t return window.history && 'pushState' in window.history;\r\n\t}", "function supportsHistory() {\n var ua = navigator.userAgent;\n if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n return false;\n }\n return window.history && 'pushState' in window.history;\n }", "function supportsHistory() {\n var ua = window.navigator.userAgent;\n if (\n (ua.indexOf('Android 2.') !== -1 ||\n ua.indexOf('Android 4.0') !== -1) &&\n ua.indexOf('Mobile Safari') !== -1 &&\n ua.indexOf('Chrome') === -1 &&\n ua.indexOf('Windows Phone') === -1\n )\n return false;\n return window.history && 'pushState' in window.history;\n }", "function supportsHistory() {\n var ua = navigator.userAgent;\n if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n return false;\n }\n return window.history && 'pushState' in window.history;\n}", "function supportsHistory() {\n var ua = navigator.userAgent;\n if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n return false;\n }\n return window.history && 'pushState' in window.history;\n}", "function supportsHistory() {\n var ua = navigator.userAgent;\n if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n return false;\n }\n return window.history && 'pushState' in window.history;\n}", "function supportsHistory() {\n var ua = navigator.userAgent;\n if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n return false;\n }\n return window.history && 'pushState' in window.history;\n}", "function supportsHistory() {\n var ua = navigator.userAgent;\n if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n return false;\n }\n return window.history && 'pushState' in window.history;\n}", "function supportsHistory() {\n var ua = navigator.userAgent;\n if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n return false;\n }\n return window.history && 'pushState' in window.history;\n}", "function supportsHistory() {\n var ua = navigator.userAgent;\n if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n return false;\n }\n return window.history && 'pushState' in window.history;\n}", "function supportsHistory() {\n var ua = navigator.userAgent;\n if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n return false;\n }\n return window.history && 'pushState' in window.history;\n}", "function supportsHistory() {\n var ua = navigator.userAgent;\n if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n return false;\n }\n return window.history && 'pushState' in window.history;\n}", "function supportsHistory() {\n var ua = navigator.userAgent;\n if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n return false;\n }\n return window.history && 'pushState' in window.history;\n}", "function supportsHistory() {\n var ua = navigator.userAgent;\n if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n return false;\n }\n return window.history && 'pushState' in window.history;\n}", "function supportsHistory() {\n var ua = navigator.userAgent;\n if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n return false;\n }\n return window.history && 'pushState' in window.history;\n}", "function supportsHistory() {\n var ua = navigator.userAgent;\n if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) {\n return false;\n }\n return window.history && 'pushState' in window.history;\n}" ]
[ "0.8457442", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.84353054", "0.84091485", "0.83679307", "0.8360791", "0.8360791", "0.8360791", "0.8360791", "0.8360791", "0.8360791", "0.8360791", "0.8360791", "0.8360791", "0.8360791", "0.8360791", "0.8360791", "0.8360791" ]
0.8341028
100
Returns true if browser fires popstate on hash change. IE10 and IE11 do not.
function supportsPopStateOnHashChange() { return window.navigator.userAgent.indexOf('Trident') === -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function supportsPopStateOnHashChange(){return window.navigator.userAgent.indexOf('Trident')===-1;}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n }", "function supportsHashChange(documentMode, global) {\n return 'onhashchange' in global && (documentMode === undefined || documentMode > 7);\n }", "function supportsHashChange(documentMode, global) {\n return 'onhashchange' in global && (documentMode === undefined || documentMode > 7);\n }", "function supportsHashChange(documentMode, global) {\n return 'onhashchange' in global && (documentMode === undefined || documentMode > 7);\n }", "function supportsHashChange(documentMode, global) {\n return 'onhashchange' in global && (documentMode === undefined || documentMode > 7);\n }", "function checkHash() {\r\n if (location.hash && $this.find(location.hash).length) {\r\n toggleState(true);\r\n return true;\r\n }\r\n }", "changed()\n {\n if (window.location.hash !== this.lastHash)\n {\n this.lastHash = window.location.hash;\n return true;\n }\n else\n {\n return false;\n }\n }", "function locationHashChanged() {\n if (location.hash === \"\") {\n closePage();\n }\n}", "function firePopState() { // 630\n var o = document.createEvent ? document.createEvent('Event') : document.createEventObject(); // 631\n if (o.initEvent) { // 632\n o.initEvent('popstate', false, false); // 633\n } else { // 634\n o.type = 'popstate'; // 635\n } // 636\n o.state = historyObject.state; // 637\n // send a newly created events to be processed // 638\n dispatchEvent(o); // 639\n } // 640", "function poll() {\n var hash = get_fragment(),\n history_hash = history_get( last_hash );\n \n if ( hash !== last_hash ) {\n history_set( last_hash = hash, history_hash );\n \n $(window).trigger( str_hashchange );\n \n } else if ( history_hash !== last_hash ) {\n location.href = location.href.replace( /#.*/, '' ) + history_hash;\n }\n \n timeout_id = setTimeout( poll, $.fn[ str_hashchange ].delay );\n }", "function poll() {\n var hash = get_fragment(),\n history_hash = history_get( last_hash );\n \n if ( hash !== last_hash ) {\n history_set( last_hash = hash, history_hash );\n \n $(window).trigger( str_hashchange );\n \n } else if ( history_hash !== last_hash ) {\n location.href = location.href.replace( /#.*/, '' ) + history_hash;\n }\n \n timeout_id = setTimeout( poll, $.fn[ str_hashchange ].delay );\n }", "function poll() {\n var hash = get_fragment(),\n history_hash = history_get( last_hash );\n \n if ( hash !== last_hash ) {\n history_set( last_hash = hash, history_hash );\n \n $(window).trigger( str_hashchange );\n \n } else if ( history_hash !== last_hash ) {\n location.href = location.href.replace( /#.*/, '' ) + history_hash;\n }\n \n timeout_id = setTimeout( poll, $.fn[ str_hashchange ].delay );\n }", "function isExtraneousPopstateEvent(event){event.state===undefined&&navigator.userAgent.indexOf('CriOS')===-1;}", "function poll() {\n var hash = get_fragment(),\n history_hash = history_get( last_hash );\n \n if ( hash !== last_hash ) {\n history_set( last_hash = hash, history_hash );\n \n $(window).trigger( str_hashchange );\n \n } else if ( history_hash !== last_hash ) {\n location.href = location.href.replace( /#.*/, '' ) + history_hash;\n }\n \n timeout_id = window.setTimeout( poll, $.fn[ str_hashchange ].delay );\n}", "function hashChanged(e){\n\t\trespondToState();\n\t}", "function DETECT_history() {\n return window.history && typeof window.history.pushState !== 'undefined';\n }", "function supportsGoWithoutReloadUsingHash(){return window.navigator.userAgent.indexOf('Firefox')===-1;}", "function poll() {\n var hash = get_fragment(),\n history_hash = history_get(last_hash);\n\n if (hash !== last_hash) {\n history_set(last_hash = hash, history_hash);\n\n $(window).trigger(str_hashchange);\n\n } else if (history_hash !== last_hash) {\n location.href = location.href.replace(/#.*/, '') + history_hash;\n }\n\n timeout_id = setTimeout(poll, $.fn[str_hashchange].delay);\n }", "function poll() {\n var hash = get_fragment(),\n history_hash = history_get(last_hash);\n\n if (hash !== last_hash) {\n history_set(last_hash = hash, history_hash);\n\n $(window).trigger(str_hashchange);\n\n } else if (history_hash !== last_hash) {\n location.href = location.href.replace(/#.*/, '') + history_hash;\n }\n\n timeout_id = setTimeout(poll, $.fn[str_hashchange].delay);\n }", "function supportsGoWithoutReloadUsingHash(){var ua=navigator.userAgent;return ua.indexOf('Firefox')===-1;}", "function supportsGoWithoutReloadUsingHash(){var ua=navigator.userAgent;return ua.indexOf('Firefox')===-1;}", "function supportsGoWithoutReloadUsingHash(){var ua=navigator.userAgent;return ua.indexOf('Firefox')===-1;}", "function supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n }", "function checkUrlHash() {\n var hash = window.location.hash;\n\n // Allow deep linking to recover password form\n if (hash === '#recover') {\n toggleRecoverPasswordForm();\n }\n }", "function firePopState() {\n var o = document.createEvent ? document.createEvent('Event') : document.createEventObject();\n if (o.initEvent) {\n o.initEvent('popstate', false, false);\n } else {\n o.type = 'popstate';\n }\n o.state = historyObject.state;\n // send a newly created events to be processed\n dispatchEvent(o);\n }", "listenForHashChanges() {\n //get url on page load.\n finsembleWindow.updateOptions({ url: window.top.location.href }, () => {\n });\n var self = this;\n //There's no pushState event in the browser. This is a monkey patched solution that allows us to catch hash changes. onhashchange doesn't fire when a site is loaded with a hash (e.g., salesforce).\n (function (history) {\n var pushState = history.pushState;\n history.pushState = function (state) {\n if (typeof history.onpushstate === \"function\") {\n history.onpushstate({ state: state });\n }\n pushState.apply(history, arguments);\n finsembleWindow.updateOptions({ url: window.top.location.href }, () => {\n });\n return;\n };\n var replaceState = history.replaceState;\n history.replaceState = function (state) {\n if (typeof history.onreplacestate === \"function\") {\n history.onreplacestate({ state: state });\n }\n replaceState.apply(history, arguments);\n finsembleWindow.updateOptions({ url: window.top.location.toString() });\n // DH 3/6/2019 - This should be handled by the WindowStorageManager.\n storageClient_1.default.save({ topic: constants_1.WORKSPACE.CACHE_STORAGE_TOPIC, key: self.windowHash, value: finsembleWindow.windowOptions });\n return;\n };\n })(window.history);\n window.addEventListener(\"hashchange\", () => {\n finsembleWindow.updateOptions({ url: window.top.location.toString() }, () => {\n });\n });\n }", "function supportsGoWithoutReloadUsingHash() {\r\n\t var ua = navigator.userAgent;\r\n\t return ua.indexOf('Firefox') === -1;\r\n\t}", "function checkHash() {\r\n if (location.hash != \"\") {\r\n let hash = location.hash.match(/^#(.*)$/)[1];\r\n switch (hash) {\r\n case \"refreshed\":\r\n dom.connectWithStrava.click();\r\n break;\r\n }\r\n location.hash = \"\";\r\n }\r\n}", "function supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n}", "function supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n}" ]
[ "0.85082066", "0.84276813", "0.734538", "0.734538", "0.734538", "0.734538", "0.73256963", "0.72438544", "0.7106022", "0.68635136", "0.6817992", "0.6817992", "0.6817992", "0.68016374", "0.67740774", "0.676368", "0.6732663", "0.670574", "0.6660475", "0.66572684", "0.65663636", "0.65663636", "0.65663636", "0.65481514", "0.6530943", "0.65079516", "0.6485964", "0.64794755", "0.6467716", "0.6444314", "0.6444314", "0.6444314", "0.6444314", "0.6444314", "0.6444314", "0.6444314", "0.6444314", "0.6444314", "0.6444314", "0.6444314", "0.6444314" ]
0.82981575
61
Returns false if using go(n) with hash history causes a full page reload.
function supportsGoWithoutReloadUsingHash() { return window.navigator.userAgent.indexOf('Firefox') === -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "changed()\n {\n if (window.location.hash !== this.lastHash)\n {\n this.lastHash = window.location.hash;\n return true;\n }\n else\n {\n return false;\n }\n }", "function checkHash() {\r\n if (location.hash && $this.find(location.hash).length) {\r\n toggleState(true);\r\n return true;\r\n }\r\n }", "function checkURLAgain()\r\n {\r\n url = new String(window.location.href);\r\n if(count++ < 20)\r\n {\r\n if((AreSameStrings(url, lastURL,false) || url.indexOf(\"#\") < 0))\r\n {\r\n if(debug) GM_log(\"checking URL again \" + count);\r\n setTimeout(checkURLAgain, 100);\r\n }\r\n else\r\n {\r\n if(debug)\r\n GM_log('calling again');\r\n DoTestAgain();\r\n }\r\n }\r\n }", "function checkURL(hash)\n{\n if(!hash) hash = window.location.hash;\t//if no parameter is provided, use the hash value from the current address\n if(hash != lasturl)\t// if the hash value has changed\n {\n lasturl = hash;\t//update the current hash\n loadPage(hash);\t// and load the new page\n }\n}", "function supportsGoWithoutReloadUsingHash() { // 72\n var ua = navigator.userAgent; // 73\n return ua.indexOf('Firefox') === -1; // 74\n}", "function checkHash() {\r\n if (location.hash != \"\") {\r\n let hash = location.hash.match(/^#(.*)$/)[1];\r\n switch (hash) {\r\n case \"refreshed\":\r\n dom.connectWithStrava.click();\r\n break;\r\n }\r\n location.hash = \"\";\r\n }\r\n}", "function getPageRefreshed() {\n try {\n if (performance && performance.navigation) {\n return performance.navigation.type === performance.navigation.TYPE_RELOAD;\n }\n } catch (e) { }\n return false;\n}", "function checkURL(hash)\n{\n if(!hash) hash=window.location.hash;\t//if no parameter is provided, use the hash value from the current address\n if(hash != lasturl)\t// if the hash value has changed\n {\n lasturl=hash;\t//update the current hash\n loadPage(hash);\t// and load the new page\n }\n}", "function isLoop() {\n var last = history[history.length - 1];\n for (var i = 0; i < history.length - 1; i++) {\n if (history[i] === last) {\n return true;\n }\n }\n return false;\n }", "function hashChange(entry, url) {\n if (!entry) return false;\n const [aBase, aHash] = url.split('#');\n const [bBase, bHash] = entry.url.split('#');\n return aBase === bBase && aHash !== bHash;\n}", "function supportsGoWithoutReloadUsingHash(){return window.navigator.userAgent.indexOf('Firefox')===-1;}", "function checkUrlHash() {\n var hash = window.location.hash;\n\n // Allow deep linking to recover password form\n if (hash === '#recover') {\n toggleRecoverPasswordForm();\n }\n }", "function supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n }", "function supportsGoWithoutReloadUsingHash() {\r\n\t var ua = navigator.userAgent;\r\n\t return ua.indexOf('Firefox') === -1;\r\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}", "function supportsGoWithoutReloadUsingHash() {\n\t var ua = navigator.userAgent;\n\t return ua.indexOf('Firefox') === -1;\n\t}" ]
[ "0.6853592", "0.6627107", "0.6169394", "0.61218673", "0.61203706", "0.6109625", "0.6105205", "0.6105017", "0.6095695", "0.6089655", "0.6070026", "0.6031158", "0.6027591", "0.6025375", "0.5998307", "0.5998307", "0.5998307", "0.5998307", "0.5998307", "0.5998307", "0.5998307", "0.5998307", "0.5998307", "0.5998307", "0.5998307", "0.5998307", "0.5998307", "0.5998307", "0.5998307", "0.5998307", "0.5998307", "0.5998307", "0.5998307", "0.5998307", "0.5998307", "0.5998307", "0.5998307", "0.5998307", "0.5998307", "0.5998307", "0.5998307", "0.5998307", "0.5998307", "0.5998307", "0.5998307" ]
0.59979945
94
Returns true if a given popstate event is an extraneous WebKit event. Accounts for the fact that Chrome on iOS fires real popstate events containing undefined state when pressing the back button.
function isExtraneousPopstateEvent(event) { return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isExtraneousPopstateEvent(event){event.state===undefined&&navigator.userAgent.indexOf('CriOS')===-1;}", "function isExtraneousPopstateEvent(event) {\n event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n return (\n event.state === undefined &&\n navigator.userAgent.indexOf('CriOS') === -1\n );\n }", "function ignorablePopstateEvent(event) {\r\n return (event.state === undefined && navigator.userAgent.indexOf(\"CriOS\") === -1);\r\n}", "function supportsPopStateOnHashChange(){return window.navigator.userAgent.indexOf('Trident')===-1;}", "function isUnattempted (e) {\n return !e.stateChange\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}" ]
[ "0.8189633", "0.8106464", "0.8106464", "0.8106464", "0.8106464", "0.8106464", "0.8106464", "0.8106464", "0.8106464", "0.8106464", "0.8106464", "0.8106464", "0.8076116", "0.7768142", "0.65637994", "0.65342957", "0.65262496", "0.65262496", "0.65262496", "0.65262496", "0.65262496", "0.65262496", "0.65262496", "0.65262496", "0.65262496", "0.65262496", "0.65262496", "0.65262496", "0.65262496", "0.65262496", "0.65262496", "0.65262496", "0.65262496", "0.65262496", "0.65262496", "0.65262496", "0.65262496", "0.65262496", "0.65262496", "0.65262496", "0.65262496", "0.65262496", "0.65262496", "0.65262496", "0.65262496", "0.65262496", "0.65262496", "0.65262496", "0.65262496", "0.65262496", "0.65262496", "0.65262496" ]
0.8111777
46
Creates a history object that uses the HTML5 history API including pushState, replaceState, and the popstate event.
function createBrowserHistory(props) { if (props === void 0) { props = {}; } !canUseDOM ? false ? 0 : tiny_invariant_esm(false) : void 0; var globalHistory = window.history; var canUseHistory = supportsHistory(); var needsHashChangeListener = !supportsPopStateOnHashChange(); var _props = props, _props$forceRefresh = _props.forceRefresh, forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh, _props$getUserConfirm = _props.getUserConfirmation, getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm, _props$keyLength = _props.keyLength, keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength; var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : ''; function getDOMLocation(historyState) { var _ref = historyState || {}, key = _ref.key, state = _ref.state; var _window$location = window.location, pathname = _window$location.pathname, search = _window$location.search, hash = _window$location.hash; var path = pathname + search + hash; false ? 0 : void 0; if (basename) path = stripBasename(path, basename); return history_createLocation(path, state, key); } function createKey() { return Math.random().toString(36).substr(2, keyLength); } var transitionManager = createTransitionManager(); function setState(nextState) { (0,esm_extends/* default */.Z)(history, nextState); history.length = globalHistory.length; transitionManager.notifyListeners(history.location, history.action); } function handlePopState(event) { // Ignore extraneous popstate events in WebKit. if (isExtraneousPopstateEvent(event)) return; handlePop(getDOMLocation(event.state)); } function handleHashChange() { handlePop(getDOMLocation(getHistoryState())); } var forceNextPop = false; function handlePop(location) { if (forceNextPop) { forceNextPop = false; setState(); } else { var action = 'POP'; transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { if (ok) { setState({ action: action, location: location }); } else { revertPop(location); } }); } } function revertPop(fromLocation) { var toLocation = history.location; // TODO: We could probably make this more reliable by // keeping a list of keys we've seen in sessionStorage. // Instead, we just default to 0 for keys we don't know. var toIndex = allKeys.indexOf(toLocation.key); if (toIndex === -1) toIndex = 0; var fromIndex = allKeys.indexOf(fromLocation.key); if (fromIndex === -1) fromIndex = 0; var delta = toIndex - fromIndex; if (delta) { forceNextPop = true; go(delta); } } var initialLocation = getDOMLocation(getHistoryState()); var allKeys = [initialLocation.key]; // Public interface function createHref(location) { return basename + createPath(location); } function push(path, state) { false ? 0 : void 0; var action = 'PUSH'; var location = history_createLocation(path, state, createKey(), history.location); transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { if (!ok) return; var href = createHref(location); var key = location.key, state = location.state; if (canUseHistory) { globalHistory.pushState({ key: key, state: state }, null, href); if (forceRefresh) { window.location.href = href; } else { var prevIndex = allKeys.indexOf(history.location.key); var nextKeys = allKeys.slice(0, prevIndex + 1); nextKeys.push(location.key); allKeys = nextKeys; setState({ action: action, location: location }); } } else { false ? 0 : void 0; window.location.href = href; } }); } function replace(path, state) { false ? 0 : void 0; var action = 'REPLACE'; var location = history_createLocation(path, state, createKey(), history.location); transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { if (!ok) return; var href = createHref(location); var key = location.key, state = location.state; if (canUseHistory) { globalHistory.replaceState({ key: key, state: state }, null, href); if (forceRefresh) { window.location.replace(href); } else { var prevIndex = allKeys.indexOf(history.location.key); if (prevIndex !== -1) allKeys[prevIndex] = location.key; setState({ action: action, location: location }); } } else { false ? 0 : void 0; window.location.replace(href); } }); } function go(n) { globalHistory.go(n); } function goBack() { go(-1); } function goForward() { go(1); } var listenerCount = 0; function checkDOMListeners(delta) { listenerCount += delta; if (listenerCount === 1 && delta === 1) { window.addEventListener(PopStateEvent, handlePopState); if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange); } else if (listenerCount === 0) { window.removeEventListener(PopStateEvent, handlePopState); if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange); } } var isBlocked = false; function block(prompt) { if (prompt === void 0) { prompt = false; } var unblock = transitionManager.setPrompt(prompt); if (!isBlocked) { checkDOMListeners(1); isBlocked = true; } return function () { if (isBlocked) { isBlocked = false; checkDOMListeners(-1); } return unblock(); }; } function listen(listener) { var unlisten = transitionManager.appendListener(listener); checkDOMListeners(1); return function () { checkDOMListeners(-1); unlisten(); }; } var history = { length: globalHistory.length, action: 'POP', location: initialLocation, createHref: createHref, push: push, replace: replace, go: go, goBack: goBack, goForward: goForward, block: block, listen: listen }; return history; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createBrowserHistory() {\r\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\r\n\t\r\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\r\n\t\r\n\t var forceRefresh = options.forceRefresh;\r\n\t\r\n\t var isSupported = _DOMUtils.supportsHistory();\r\n\t var useRefresh = !isSupported || forceRefresh;\r\n\t\r\n\t function getCurrentLocation(historyState) {\r\n\t try {\r\n\t historyState = historyState || window.history.state || {};\r\n\t } catch (e) {\r\n\t historyState = {};\r\n\t }\r\n\t\r\n\t var path = _DOMUtils.getWindowPath();\r\n\t var _historyState = historyState;\r\n\t var key = _historyState.key;\r\n\t\r\n\t var state = undefined;\r\n\t if (key) {\r\n\t state = _DOMStateStorage.readState(key);\r\n\t } else {\r\n\t state = null;\r\n\t key = history.createKey();\r\n\t\r\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\r\n\t }\r\n\t\r\n\t var location = _PathUtils.parsePath(path);\r\n\t\r\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\r\n\t }\r\n\t\r\n\t function startPopStateListener(_ref) {\r\n\t var transitionTo = _ref.transitionTo;\r\n\t\r\n\t function popStateListener(event) {\r\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\r\n\t\r\n\t transitionTo(getCurrentLocation(event.state));\r\n\t }\r\n\t\r\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\r\n\t\r\n\t return function () {\r\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\r\n\t };\r\n\t }\r\n\t\r\n\t function finishTransition(location) {\r\n\t var basename = location.basename;\r\n\t var pathname = location.pathname;\r\n\t var search = location.search;\r\n\t var hash = location.hash;\r\n\t var state = location.state;\r\n\t var action = location.action;\r\n\t var key = location.key;\r\n\t\r\n\t if (action === _Actions.POP) return; // Nothing to do.\r\n\t\r\n\t _DOMStateStorage.saveState(key, state);\r\n\t\r\n\t var path = (basename || '') + pathname + search + hash;\r\n\t var historyState = {\r\n\t key: key\r\n\t };\r\n\t\r\n\t if (action === _Actions.PUSH) {\r\n\t if (useRefresh) {\r\n\t window.location.href = path;\r\n\t return false; // Prevent location update.\r\n\t } else {\r\n\t window.history.pushState(historyState, null, path);\r\n\t }\r\n\t } else {\r\n\t // REPLACE\r\n\t if (useRefresh) {\r\n\t window.location.replace(path);\r\n\t return false; // Prevent location update.\r\n\t } else {\r\n\t window.history.replaceState(historyState, null, path);\r\n\t }\r\n\t }\r\n\t }\r\n\t\r\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\r\n\t getCurrentLocation: getCurrentLocation,\r\n\t finishTransition: finishTransition,\r\n\t saveState: _DOMStateStorage.saveState\r\n\t }));\r\n\t\r\n\t var listenerCount = 0,\r\n\t stopPopStateListener = undefined;\r\n\t\r\n\t function listenBefore(listener) {\r\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\r\n\t\r\n\t var unlisten = history.listenBefore(listener);\r\n\t\r\n\t return function () {\r\n\t unlisten();\r\n\t\r\n\t if (--listenerCount === 0) stopPopStateListener();\r\n\t };\r\n\t }\r\n\t\r\n\t function listen(listener) {\r\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\r\n\t\r\n\t var unlisten = history.listen(listener);\r\n\t\r\n\t return function () {\r\n\t unlisten();\r\n\t\r\n\t if (--listenerCount === 0) stopPopStateListener();\r\n\t };\r\n\t }\r\n\t\r\n\t // deprecated\r\n\t function registerTransitionHook(hook) {\r\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\r\n\t\r\n\t history.registerTransitionHook(hook);\r\n\t }\r\n\t\r\n\t // deprecated\r\n\t function unregisterTransitionHook(hook) {\r\n\t history.unregisterTransitionHook(hook);\r\n\t\r\n\t if (--listenerCount === 0) stopPopStateListener();\r\n\t }\r\n\t\r\n\t return _extends({}, history, {\r\n\t listenBefore: listenBefore,\r\n\t listen: listen,\r\n\t registerTransitionHook: registerTransitionHook,\r\n\t unregisterTransitionHook: unregisterTransitionHook\r\n\t });\r\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? true ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t historyState = historyState || window.history.state || {};\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? true ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t historyState = historyState || window.history.state || {};\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? false ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? false ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? false ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? false ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? (undefined) !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t historyState = historyState || window.history.state || {};\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? false ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t historyState = historyState || window.history.state || {};\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? false ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t historyState = historyState || window.history.state || {};\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n\t }\n\n\t var location = _parsePath2['default'](path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? true ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t historyState = historyState || window.history.state || {};\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? false ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? true ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t historyState = historyState || window.history.state || {};\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n\t }\n\n\t var location = _parsePath2['default'](path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t historyState = historyState || window.history.state || {};\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n\t }\n\n\t var location = _parsePath2['default'](path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t historyState = historyState || window.history.state || {};\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory(){var options=arguments.length<=0||arguments[0]===undefined?{}:arguments[0];!_ExecutionEnvironment.canUseDOM?process.env.NODE_ENV!=='production'?_invariant2['default'](false,'Browser history needs a DOM'):_invariant2['default'](false):undefined;var forceRefresh=options.forceRefresh;var isSupported=_DOMUtils.supportsHistory();var useRefresh=!isSupported||forceRefresh;function getCurrentLocation(historyState){historyState=historyState||window.history.state||{};var path=_DOMUtils.getWindowPath();var _historyState=historyState;var key=_historyState.key;var state=undefined;if(key){state=_DOMStateStorage.readState(key);}else {state=null;key=history.createKey();if(isSupported)window.history.replaceState(_extends({},historyState,{key:key}),null);}var location=_PathUtils.parsePath(path);return history.createLocation(_extends({},location,{state:state}),undefined,key);}function startPopStateListener(_ref){var transitionTo=_ref.transitionTo;function popStateListener(event){if(event.state===undefined)return; // Ignore extraneous popstate events in WebKit.\n\ttransitionTo(getCurrentLocation(event.state));}_DOMUtils.addEventListener(window,'popstate',popStateListener);return function(){_DOMUtils.removeEventListener(window,'popstate',popStateListener);};}function finishTransition(location){var basename=location.basename;var pathname=location.pathname;var search=location.search;var hash=location.hash;var state=location.state;var action=location.action;var key=location.key;if(action===_Actions.POP)return; // Nothing to do.\n\t_DOMStateStorage.saveState(key,state);var path=(basename||'')+pathname+search+hash;var historyState={key:key};if(action===_Actions.PUSH){if(useRefresh){window.location.href=path;return false; // Prevent location update.\n\t}else {window.history.pushState(historyState,null,path);}}else { // REPLACE\n\tif(useRefresh){window.location.replace(path);return false; // Prevent location update.\n\t}else {window.history.replaceState(historyState,null,path);}}}var history=_createDOMHistory2['default'](_extends({},options,{getCurrentLocation:getCurrentLocation,finishTransition:finishTransition,saveState:_DOMStateStorage.saveState}));var listenerCount=0,stopPopStateListener=undefined;function listenBefore(listener){if(++listenerCount===1)stopPopStateListener=startPopStateListener(history);var unlisten=history.listenBefore(listener);return function(){unlisten();if(--listenerCount===0)stopPopStateListener();};}function listen(listener){if(++listenerCount===1)stopPopStateListener=startPopStateListener(history);var unlisten=history.listen(listener);return function(){unlisten();if(--listenerCount===0)stopPopStateListener();};} // deprecated\n\tfunction registerTransitionHook(hook){if(++listenerCount===1)stopPopStateListener=startPopStateListener(history);history.registerTransitionHook(hook);} // deprecated\n\tfunction unregisterTransitionHook(hook){history.unregisterTransitionHook(hook);if(--listenerCount===0)stopPopStateListener();}return _extends({},history,{listenBefore:listenBefore,listen:listen,registerTransitionHook:registerTransitionHook,unregisterTransitionHook:unregisterTransitionHook});}", "function createBrowserHistory(){var options=arguments.length<=0||arguments[0]===undefined?{}:arguments[0];!_ExecutionEnvironment.canUseDOM?process.env.NODE_ENV!=='production'?_invariant2['default'](false,'Browser history needs a DOM'):_invariant2['default'](false):undefined;var forceRefresh=options.forceRefresh;var isSupported=_DOMUtils.supportsHistory();var useRefresh=!isSupported||forceRefresh;function getCurrentLocation(historyState){historyState=historyState||window.history.state||{};var path=_DOMUtils.getWindowPath();var _historyState=historyState;var key=_historyState.key;var state=undefined;if(key){state=_DOMStateStorage.readState(key);}else {state=null;key=history.createKey();if(isSupported)window.history.replaceState(_extends({},historyState,{key:key}),null);}var location=_PathUtils.parsePath(path);return history.createLocation(_extends({},location,{state:state}),undefined,key);}function startPopStateListener(_ref){var transitionTo=_ref.transitionTo;function popStateListener(event){if(event.state===undefined)return; // Ignore extraneous popstate events in WebKit.\n\ttransitionTo(getCurrentLocation(event.state));}_DOMUtils.addEventListener(window,'popstate',popStateListener);return function(){_DOMUtils.removeEventListener(window,'popstate',popStateListener);};}function finishTransition(location){var basename=location.basename;var pathname=location.pathname;var search=location.search;var hash=location.hash;var state=location.state;var action=location.action;var key=location.key;if(action===_Actions.POP)return; // Nothing to do.\n\t_DOMStateStorage.saveState(key,state);var path=(basename||'')+pathname+search+hash;var historyState={key:key};if(action===_Actions.PUSH){if(useRefresh){window.location.href=path;return false; // Prevent location update.\n\t}else {window.history.pushState(historyState,null,path);}}else { // REPLACE\n\tif(useRefresh){window.location.replace(path);return false; // Prevent location update.\n\t}else {window.history.replaceState(historyState,null,path);}}}var history=_createDOMHistory2['default'](_extends({},options,{getCurrentLocation:getCurrentLocation,finishTransition:finishTransition,saveState:_DOMStateStorage.saveState}));var listenerCount=0,stopPopStateListener=undefined;function listenBefore(listener){if(++listenerCount===1)stopPopStateListener=startPopStateListener(history);var unlisten=history.listenBefore(listener);return function(){unlisten();if(--listenerCount===0)stopPopStateListener();};}function listen(listener){if(++listenerCount===1)stopPopStateListener=startPopStateListener(history);var unlisten=history.listen(listener);return function(){unlisten();if(--listenerCount===0)stopPopStateListener();};} // deprecated\n\tfunction registerTransitionHook(hook){if(++listenerCount===1)stopPopStateListener=startPopStateListener(history);history.registerTransitionHook(hook);} // deprecated\n\tfunction unregisterTransitionHook(hook){history.unregisterTransitionHook(hook);if(--listenerCount===0)stopPopStateListener();}return _extends({},history,{listenBefore:listenBefore,listen:listen,registerTransitionHook:registerTransitionHook,unregisterTransitionHook:unregisterTransitionHook});}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t historyState = historyState || window.history.state || {};\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n\t var forceRefresh = options.forceRefresh;\n\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\n\t function getCurrentLocation(historyState) {\n\t historyState = historyState || window.history.state || {};\n\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\n\t var location = _PathUtils.parsePath(path);\n\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\n\t if (action === _Actions.POP) return; // Nothing to do.\n\n\t _DOMStateStorage.saveState(key, state);\n\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listenBefore(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t var unlisten = history.listen(listener);\n\n\t return function () {\n\t unlisten();\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n\t history.registerTransitionHook(hook);\n\t }\n\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory(){var options=arguments.length<=0||arguments[0]===undefined?{}:arguments[0];!_ExecutionEnvironment.canUseDOM?process.env.NODE_ENV!=='production'?_invariant2['default'](false,'Browser history needs a DOM'):_invariant2['default'](false):undefined;var forceRefresh=options.forceRefresh;var isSupported=_DOMUtils.supportsHistory();var useRefresh=!isSupported||forceRefresh;function getCurrentLocation(historyState){try{historyState=historyState||window.history.state||{};}catch(e){historyState={};}var path=_DOMUtils.getWindowPath();var _historyState=historyState;var key=_historyState.key;var state=undefined;if(key){state=_DOMStateStorage.readState(key);}else {state=null;key=history.createKey();if(isSupported)window.history.replaceState(_extends({},historyState,{key:key}),null);}var location=_PathUtils.parsePath(path);return history.createLocation(_extends({},location,{state:state}),undefined,key);}function startPopStateListener(_ref){var transitionTo=_ref.transitionTo;function popStateListener(event){if(event.state===undefined)return; // Ignore extraneous popstate events in WebKit.\ntransitionTo(getCurrentLocation(event.state));}_DOMUtils.addEventListener(window,'popstate',popStateListener);return function(){_DOMUtils.removeEventListener(window,'popstate',popStateListener);};}function finishTransition(location){var basename=location.basename;var pathname=location.pathname;var search=location.search;var hash=location.hash;var state=location.state;var action=location.action;var key=location.key;if(action===_Actions.POP)return; // Nothing to do.\n_DOMStateStorage.saveState(key,state);var path=(basename||'')+pathname+search+hash;var historyState={key:key};if(action===_Actions.PUSH){if(useRefresh){window.location.href=path;return false; // Prevent location update.\n}else {window.history.pushState(historyState,null,path);}}else { // REPLACE\nif(useRefresh){window.location.replace(path);return false; // Prevent location update.\n}else {window.history.replaceState(historyState,null,path);}}}var history=_createDOMHistory2['default'](_extends({},options,{getCurrentLocation:getCurrentLocation,finishTransition:finishTransition,saveState:_DOMStateStorage.saveState}));var listenerCount=0,stopPopStateListener=undefined;function listenBefore(listener){if(++listenerCount===1)stopPopStateListener=startPopStateListener(history);var unlisten=history.listenBefore(listener);return function(){unlisten();if(--listenerCount===0)stopPopStateListener();};}function listen(listener){if(++listenerCount===1)stopPopStateListener=startPopStateListener(history);var unlisten=history.listen(listener);return function(){unlisten();if(--listenerCount===0)stopPopStateListener();};} // deprecated\nfunction registerTransitionHook(hook){if(++listenerCount===1)stopPopStateListener=startPopStateListener(history);history.registerTransitionHook(hook);} // deprecated\nfunction unregisterTransitionHook(hook){history.unregisterTransitionHook(hook);if(--listenerCount===0)stopPopStateListener();}return _extends({},history,{listenBefore:listenBefore,listen:listen,registerTransitionHook:registerTransitionHook,unregisterTransitionHook:unregisterTransitionHook});}", "function createBrowserHistory(props){if(props===void 0){props={};}!canUseDOM? true?Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false,'Browser history needs a DOM'):undefined:void 0;var globalHistory=window.history;var canUseHistory=supportsHistory();var needsHashChangeListener=!supportsPopStateOnHashChange();var _props=props,_props$forceRefresh=_props.forceRefresh,forceRefresh=_props$forceRefresh===void 0?false:_props$forceRefresh,_props$getUserConfirm=_props.getUserConfirmation,getUserConfirmation=_props$getUserConfirm===void 0?getConfirmation:_props$getUserConfirm,_props$keyLength=_props.keyLength,keyLength=_props$keyLength===void 0?6:_props$keyLength;var basename=props.basename?stripTrailingSlash(addLeadingSlash(props.basename)):'';function getDOMLocation(historyState){var _ref=historyState||{},key=_ref.key,state=_ref.state;var _window$location=window.location,pathname=_window$location.pathname,search=_window$location.search,hash=_window$location.hash;var path=pathname+search+hash; true?Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename||hasBasename(path,basename),'You are attempting to use a basename on a page whose URL path does not begin '+'with the basename. Expected path \"'+path+'\" to begin with \"'+basename+'\".'):undefined;if(basename)path=stripBasename(path,basename);return createLocation(path,state,key);}function createKey(){return Math.random().toString(36).substr(2,keyLength);}var transitionManager=createTransitionManager();function setState(nextState){Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history,nextState);history.length=globalHistory.length;transitionManager.notifyListeners(history.location,history.action);}function handlePopState(event){// Ignore extraneous popstate events in WebKit.\nif(isExtraneousPopstateEvent(event))return;handlePop(getDOMLocation(event.state));}function handleHashChange(){handlePop(getDOMLocation(getHistoryState()));}var forceNextPop=false;function handlePop(location){if(forceNextPop){forceNextPop=false;setState();}else{var action='POP';transitionManager.confirmTransitionTo(location,action,getUserConfirmation,function(ok){if(ok){setState({action:action,location:location});}else{revertPop(location);}});}}function revertPop(fromLocation){var toLocation=history.location;// TODO: We could probably make this more reliable by\n// keeping a list of keys we've seen in sessionStorage.\n// Instead, we just default to 0 for keys we don't know.\nvar toIndex=allKeys.indexOf(toLocation.key);if(toIndex===-1)toIndex=0;var fromIndex=allKeys.indexOf(fromLocation.key);if(fromIndex===-1)fromIndex=0;var delta=toIndex-fromIndex;if(delta){forceNextPop=true;go(delta);}}var initialLocation=getDOMLocation(getHistoryState());var allKeys=[initialLocation.key];// Public interface\nfunction createHref(location){return basename+createPath(location);}function push(path,state){ true?Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(_typeof(path)==='object'&&path.state!==undefined&&state!==undefined),'You should avoid providing a 2nd state argument to push when the 1st '+'argument is a location-like object that already has state; it is ignored'):undefined;var action='PUSH';var location=createLocation(path,state,createKey(),history.location);transitionManager.confirmTransitionTo(location,action,getUserConfirmation,function(ok){if(!ok)return;var href=createHref(location);var key=location.key,state=location.state;if(canUseHistory){globalHistory.pushState({key:key,state:state},null,href);if(forceRefresh){window.location.href=href;}else{var prevIndex=allKeys.indexOf(history.location.key);var nextKeys=allKeys.slice(0,prevIndex===-1?0:prevIndex+1);nextKeys.push(location.key);allKeys=nextKeys;setState({action:action,location:location});}}else{ true?Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state===undefined,'Browser history cannot push state in browsers that do not support HTML5 history'):undefined;window.location.href=href;}});}function replace(path,state){ true?Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(_typeof(path)==='object'&&path.state!==undefined&&state!==undefined),'You should avoid providing a 2nd state argument to replace when the 1st '+'argument is a location-like object that already has state; it is ignored'):undefined;var action='REPLACE';var location=createLocation(path,state,createKey(),history.location);transitionManager.confirmTransitionTo(location,action,getUserConfirmation,function(ok){if(!ok)return;var href=createHref(location);var key=location.key,state=location.state;if(canUseHistory){globalHistory.replaceState({key:key,state:state},null,href);if(forceRefresh){window.location.replace(href);}else{var prevIndex=allKeys.indexOf(history.location.key);if(prevIndex!==-1)allKeys[prevIndex]=location.key;setState({action:action,location:location});}}else{ true?Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state===undefined,'Browser history cannot replace state in browsers that do not support HTML5 history'):undefined;window.location.replace(href);}});}function go(n){globalHistory.go(n);}function goBack(){go(-1);}function goForward(){go(1);}var listenerCount=0;function checkDOMListeners(delta){listenerCount+=delta;if(listenerCount===1&&delta===1){window.addEventListener(PopStateEvent,handlePopState);if(needsHashChangeListener)window.addEventListener(HashChangeEvent,handleHashChange);}else if(listenerCount===0){window.removeEventListener(PopStateEvent,handlePopState);if(needsHashChangeListener)window.removeEventListener(HashChangeEvent,handleHashChange);}}var isBlocked=false;function block(prompt){if(prompt===void 0){prompt=false;}var unblock=transitionManager.setPrompt(prompt);if(!isBlocked){checkDOMListeners(1);isBlocked=true;}return function(){if(isBlocked){isBlocked=false;checkDOMListeners(-1);}return unblock();};}function listen(listener){var unlisten=transitionManager.appendListener(listener);checkDOMListeners(1);return function(){checkDOMListeners(-1);unlisten();};}var history={length:globalHistory.length,action:'POP',location:initialLocation,createHref:createHref,push:push,replace:replace,go:go,goBack:goBack,goForward:goForward,block:block,listen:listen};return history;}", "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n historyState = historyState || window.history.state || {};\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n }\n\n var location = _PathUtils.parsePath(path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? undefined !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n try {\n historyState = historyState || window.history.state || {};\n } catch (e) {\n historyState = {};\n }\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n }\n\n var location = _PathUtils.parsePath(path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n historyState = historyState || window.history.state || {};\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n }\n\n var location = _parsePath2['default'](path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n historyState = historyState || window.history.state || {};\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n }\n\n var location = _parsePath2['default'](path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n historyState = historyState || window.history.state || {};\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n }\n\n var location = _parsePath2['default'](path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n historyState = historyState || window.history.state || {};\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null, path);\n }\n\n var location = _parsePath2['default'](path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? true ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n try {\n historyState = historyState || window.history.state || {};\n } catch (e) {\n historyState = {};\n }\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n }\n\n var location = _PathUtils.parsePath(path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? true ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n try {\n historyState = historyState || window.history.state || {};\n } catch (e) {\n historyState = {};\n }\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n }\n\n var location = _PathUtils.parsePath(path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n historyState = historyState || window.history.state || {};\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n }\n\n var location = _PathUtils.parsePath(path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n try {\n historyState = historyState || window.history.state || {};\n } catch (e) {\n historyState = {};\n }\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n }\n\n var location = _PathUtils.parsePath(path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n try {\n historyState = historyState || window.history.state || {};\n } catch (e) {\n historyState = {};\n }\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n }\n\n var location = _PathUtils.parsePath(path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n try {\n historyState = historyState || window.history.state || {};\n } catch (e) {\n historyState = {};\n }\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n }\n\n var location = _PathUtils.parsePath(path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n try {\n historyState = historyState || window.history.state || {};\n } catch (e) {\n historyState = {};\n }\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n }\n\n var location = _PathUtils.parsePath(path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n try {\n historyState = historyState || window.history.state || {};\n } catch (e) {\n historyState = {};\n }\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n }\n\n var location = _PathUtils.parsePath(path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n try {\n historyState = historyState || window.history.state || {};\n } catch (e) {\n historyState = {};\n }\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n }\n\n var location = _PathUtils.parsePath(path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "function createBrowserHistory() {\n var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\n var forceRefresh = options.forceRefresh;\n\n var isSupported = _DOMUtils.supportsHistory();\n var useRefresh = !isSupported || forceRefresh;\n\n function getCurrentLocation(historyState) {\n try {\n historyState = historyState || window.history.state || {};\n } catch (e) {\n historyState = {};\n }\n\n var path = _DOMUtils.getWindowPath();\n var _historyState = historyState;\n var key = _historyState.key;\n\n var state = undefined;\n if (key) {\n state = _DOMStateStorage.readState(key);\n } else {\n state = null;\n key = history.createKey();\n\n if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n }\n\n var location = _PathUtils.parsePath(path);\n\n return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n }\n\n function startPopStateListener(_ref) {\n var transitionTo = _ref.transitionTo;\n\n function popStateListener(event) {\n if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\n transitionTo(getCurrentLocation(event.state));\n }\n\n _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\n return function () {\n _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n };\n }\n\n function finishTransition(location) {\n var basename = location.basename;\n var pathname = location.pathname;\n var search = location.search;\n var hash = location.hash;\n var state = location.state;\n var action = location.action;\n var key = location.key;\n\n if (action === _Actions.POP) return; // Nothing to do.\n\n _DOMStateStorage.saveState(key, state);\n\n var path = (basename || '') + pathname + search + hash;\n var historyState = {\n key: key\n };\n\n if (action === _Actions.PUSH) {\n if (useRefresh) {\n window.location.href = path;\n return false; // Prevent location update.\n } else {\n window.history.pushState(historyState, null, path);\n }\n } else {\n // REPLACE\n if (useRefresh) {\n window.location.replace(path);\n return false; // Prevent location update.\n } else {\n window.history.replaceState(historyState, null, path);\n }\n }\n }\n\n var history = _createDOMHistory2['default'](_extends({}, options, {\n getCurrentLocation: getCurrentLocation,\n finishTransition: finishTransition,\n saveState: _DOMStateStorage.saveState\n }));\n\n var listenerCount = 0,\n stopPopStateListener = undefined;\n\n function listenBefore(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listenBefore(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n function listen(listener) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n var unlisten = history.listen(listener);\n\n return function () {\n unlisten();\n\n if (--listenerCount === 0) stopPopStateListener();\n };\n }\n\n // deprecated\n function registerTransitionHook(hook) {\n if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\n history.registerTransitionHook(hook);\n }\n\n // deprecated\n function unregisterTransitionHook(hook) {\n history.unregisterTransitionHook(hook);\n\n if (--listenerCount === 0) stopPopStateListener();\n }\n\n return _extends({}, history, {\n listenBefore: listenBefore,\n listen: listen,\n registerTransitionHook: registerTransitionHook,\n unregisterTransitionHook: unregisterTransitionHook\n });\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? false ? undefined : tiny_invariant_esm(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n false ? undefined : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(esm_extends[\"a\" /* default */])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? false ? undefined : tiny_invariant_esm(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n false ? undefined : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n extends_extends(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? false ? undefined : Object(tiny_invariant_esm[\"a\" /* default */])(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n false ? undefined : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(esm_extends[\"a\" /* default */])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? false ? undefined : Object(tiny_invariant_esm[\"a\" /* default */])(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n false ? undefined : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(esm_extends[\"a\" /* default */])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? false ? undefined : tiny_invariant_esm(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n false ? undefined : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? false ? undefined : tiny_invariant_esm(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n false ? undefined : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? false ? 0 : (0,tiny_invariant_esm/* default */.Z)(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n false ? 0 : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0,esm_extends/* default */.Z)(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n false ? 0 : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? 0 : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n false ? 0 : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? 0 : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n !canUseDOM ? false ? 0 : tiny_invariant_invariant(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n false ? 0 : void 0;\n if (basename) path = stripBasename(path, basename);\n return history_createLocation(path, state, key);\n }\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n var transitionManager = createTransitionManager();\n function setState(nextState) {\n (0,esm_extends/* default */.Z)(history, nextState);\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n var forceNextPop = false;\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n function push(path, state) {\n false ? 0 : void 0;\n var action = 'PUSH';\n var location = history_createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? 0 : void 0;\n window.location.href = href;\n }\n });\n }\n function replace(path, state) {\n false ? 0 : void 0;\n var action = 'REPLACE';\n var location = history_createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? 0 : void 0;\n window.location.replace(href);\n }\n });\n }\n function go(n) {\n globalHistory.go(n);\n }\n function goBack() {\n go(-1);\n }\n function goForward() {\n go(1);\n }\n var listenerCount = 0;\n function checkDOMListeners(delta) {\n listenerCount += delta;\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n var isBlocked = false;\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n var unblock = transitionManager.setPrompt(prompt);\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n return unblock();\n };\n }\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function history (cb) {\n assert.equal(typeof cb, 'function', 'sheet-router/history: cb must be a function')\n window.onpopstate = function () {\n cb({\n pathname: document.location.pathname,\n search: document.location.search,\n href: document.location.href,\n hash: document.location.hash\n })\n }\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? invariant(false, 'Browser history needs a DOM') : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".');\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored');\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n warning(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history');\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored');\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n warning(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history');\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(base = '') {\n let listeners = [];\n let queue = [START];\n let position = 0;\n function setLocation(location) {\n position++;\n if (position === queue.length) {\n // we are at the end, we can simply append a new entry\n queue.push(location);\n }\n else {\n // we are in the middle, we remove everything from here in the queue\n queue.splice(position);\n queue.push(location);\n }\n }\n function triggerListeners(to, from, { direction, delta }) {\n const info = {\n direction,\n delta,\n type: NavigationType.pop,\n };\n for (let callback of listeners) {\n callback(to, from, info);\n }\n }\n const routerHistory = {\n // rewritten by Object.defineProperty\n location: START,\n state: {},\n base,\n createHref: createHref.bind(null, base),\n replace(to) {\n // remove current entry and decrement position\n queue.splice(position--, 1);\n setLocation(to);\n },\n push(to, data) {\n setLocation(to);\n },\n listen(callback) {\n listeners.push(callback);\n return () => {\n const index = listeners.indexOf(callback);\n if (index > -1)\n listeners.splice(index, 1);\n };\n },\n destroy() {\n listeners = [];\n },\n go(delta, shouldTrigger = true) {\n const from = this.location;\n const direction = \n // we are considering delta === 0 going forward, but in abstract mode\n // using 0 for the delta doesn't make sense like it does in html5 where\n // it reloads the page\n delta < 0 ? NavigationDirection.back : NavigationDirection.forward;\n position = Math.max(0, Math.min(position + delta, queue.length - 1));\n if (shouldTrigger) {\n triggerListeners(this.location, from, {\n direction,\n delta,\n });\n }\n },\n };\n Object.defineProperty(routerHistory, 'location', {\n get: () => queue[position],\n });\n return routerHistory;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? \"development\" !== \"production\" ? (0, _tinyInvariant.default)(false, 'Browser history needs a DOM') : (0, _tinyInvariant.default)(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0, _extends2.default)(history, nextState);\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? \"development\" !== \"production\" ? (0, _tinyInvariant.default)(false, 'Browser history needs a DOM') : (0, _tinyInvariant.default)(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0, _extends2.default)(history, nextState);\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? \"development\" !== \"production\" ? (0, _tinyInvariant.default)(false, 'Browser history needs a DOM') : (0, _tinyInvariant.default)(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0, _extends2.default)(history, nextState);\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? \"development\" !== \"production\" ? (0, _tinyInvariant.default)(false, 'Browser history needs a DOM') : (0, _tinyInvariant.default)(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0, _extends2.default)(history, nextState);\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? \"development\" !== \"production\" ? (0, _tinyInvariant.default)(false, 'Browser history needs a DOM') : (0, _tinyInvariant.default)(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0, _extends2.default)(history, nextState);\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? \"development\" !== \"production\" ? (0, _tinyInvariant.default)(false, 'Browser history needs a DOM') : (0, _tinyInvariant.default)(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0, _extends2.default)(history, nextState);\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? false ? undefined : Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n false ? undefined : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? false ? undefined : Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n false ? undefined : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n false ? undefined : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(base = '') {\r\n let listeners = [];\r\n let queue = [START];\r\n let position = 0;\r\n function setLocation(location) {\r\n position++;\r\n if (position === queue.length) {\r\n // we are at the end, we can simply append a new entry\r\n queue.push(location);\r\n }\r\n else {\r\n // we are in the middle, we remove everything from here in the queue\r\n queue.splice(position);\r\n queue.push(location);\r\n }\r\n }\r\n function triggerListeners(to, from, { direction, delta }) {\r\n const info = {\r\n direction,\r\n delta,\r\n type: NavigationType.pop,\r\n };\r\n for (const callback of listeners) {\r\n callback(to, from, info);\r\n }\r\n }\r\n const routerHistory = {\r\n // rewritten by Object.defineProperty\r\n location: START,\r\n // TODO: should be kept in queue\r\n state: {},\r\n base,\r\n createHref: createHref.bind(null, base),\r\n replace(to) {\r\n // remove current entry and decrement position\r\n queue.splice(position--, 1);\r\n setLocation(to);\r\n },\r\n push(to, data) {\r\n setLocation(to);\r\n },\r\n listen(callback) {\r\n listeners.push(callback);\r\n return () => {\r\n const index = listeners.indexOf(callback);\r\n if (index > -1)\r\n listeners.splice(index, 1);\r\n };\r\n },\r\n destroy() {\r\n listeners = [];\r\n queue = [START];\r\n position = 0;\r\n },\r\n go(delta, shouldTrigger = true) {\r\n const from = this.location;\r\n const direction = \r\n // we are considering delta === 0 going forward, but in abstract mode\r\n // using 0 for the delta doesn't make sense like it does in html5 where\r\n // it reloads the page\r\n delta < 0 ? NavigationDirection.back : NavigationDirection.forward;\r\n position = Math.max(0, Math.min(position + delta, queue.length - 1));\r\n if (shouldTrigger) {\r\n triggerListeners(this.location, from, {\r\n direction,\r\n delta,\r\n });\r\n }\r\n },\r\n };\r\n Object.defineProperty(routerHistory, 'location', {\r\n enumerable: true,\r\n get: () => queue[position],\r\n });\r\n return routerHistory;\r\n}", "function createBrowserHistory() {\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\t\n\t !_ExecutionEnvironment.canUseDOM ? ({\"AUTH0_CLIENT_ID\":\"vFL9QUjpiy8LmqgykJVXRhk7dYVvdEip\",\"AUTH0_DOMAIN\":\"edcheung.auth0.com\"}).NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : undefined;\n\t\n\t var forceRefresh = options.forceRefresh;\n\t\n\t var isSupported = _DOMUtils.supportsHistory();\n\t var useRefresh = !isSupported || forceRefresh;\n\t\n\t function getCurrentLocation(historyState) {\n\t try {\n\t historyState = historyState || window.history.state || {};\n\t } catch (e) {\n\t historyState = {};\n\t }\n\t\n\t var path = _DOMUtils.getWindowPath();\n\t var _historyState = historyState;\n\t var key = _historyState.key;\n\t\n\t var state = undefined;\n\t if (key) {\n\t state = _DOMStateStorage.readState(key);\n\t } else {\n\t state = null;\n\t key = history.createKey();\n\t\n\t if (isSupported) window.history.replaceState(_extends({}, historyState, { key: key }), null);\n\t }\n\t\n\t var location = _PathUtils.parsePath(path);\n\t\n\t return history.createLocation(_extends({}, location, { state: state }), undefined, key);\n\t }\n\t\n\t function startPopStateListener(_ref) {\n\t var transitionTo = _ref.transitionTo;\n\t\n\t function popStateListener(event) {\n\t if (event.state === undefined) return; // Ignore extraneous popstate events in WebKit.\n\t\n\t transitionTo(getCurrentLocation(event.state));\n\t }\n\t\n\t _DOMUtils.addEventListener(window, 'popstate', popStateListener);\n\t\n\t return function () {\n\t _DOMUtils.removeEventListener(window, 'popstate', popStateListener);\n\t };\n\t }\n\t\n\t function finishTransition(location) {\n\t var basename = location.basename;\n\t var pathname = location.pathname;\n\t var search = location.search;\n\t var hash = location.hash;\n\t var state = location.state;\n\t var action = location.action;\n\t var key = location.key;\n\t\n\t if (action === _Actions.POP) return; // Nothing to do.\n\t\n\t _DOMStateStorage.saveState(key, state);\n\t\n\t var path = (basename || '') + pathname + search + hash;\n\t var historyState = {\n\t key: key\n\t };\n\t\n\t if (action === _Actions.PUSH) {\n\t if (useRefresh) {\n\t window.location.href = path;\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.pushState(historyState, null, path);\n\t }\n\t } else {\n\t // REPLACE\n\t if (useRefresh) {\n\t window.location.replace(path);\n\t return false; // Prevent location update.\n\t } else {\n\t window.history.replaceState(historyState, null, path);\n\t }\n\t }\n\t }\n\t\n\t var history = _createDOMHistory2['default'](_extends({}, options, {\n\t getCurrentLocation: getCurrentLocation,\n\t finishTransition: finishTransition,\n\t saveState: _DOMStateStorage.saveState\n\t }));\n\t\n\t var listenerCount = 0,\n\t stopPopStateListener = undefined;\n\t\n\t function listenBefore(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listenBefore(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t function listen(listener) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t var unlisten = history.listen(listener);\n\t\n\t return function () {\n\t unlisten();\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t };\n\t }\n\t\n\t // deprecated\n\t function registerTransitionHook(hook) {\n\t if (++listenerCount === 1) stopPopStateListener = startPopStateListener(history);\n\t\n\t history.registerTransitionHook(hook);\n\t }\n\t\n\t // deprecated\n\t function unregisterTransitionHook(hook) {\n\t history.unregisterTransitionHook(hook);\n\t\n\t if (--listenerCount === 0) stopPopStateListener();\n\t }\n\t\n\t return _extends({}, history, {\n\t listenBefore: listenBefore,\n\t listen: listen,\n\t registerTransitionHook: registerTransitionHook,\n\t unregisterTransitionHook: unregisterTransitionHook\n\t });\n\t}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Browser history needs a DOM') : invariant(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n process.env.NODE_ENV !== \"production\" ? warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}", "function createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? true ? Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(false, 'Browser history needs a DOM') : undefined : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : undefined;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : undefined;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : undefined;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}" ]
[ "0.7363717", "0.73296857", "0.73296857", "0.7308878", "0.7308878", "0.7308878", "0.7308878", "0.73070294", "0.73040956", "0.730119", "0.729325", "0.7287951", "0.72879344", "0.7282965", "0.72828287", "0.72828287", "0.72828287", "0.72828287", "0.72828287", "0.7254779", "0.7254171", "0.72469246", "0.72469246", "0.72469246", "0.72469246", "0.72469246", "0.72469246", "0.72469246", "0.72454584", "0.72454584", "0.72399354", "0.72399354", "0.7193224", "0.7192471", "0.7152735", "0.7149164", "0.7146954", "0.7146954", "0.7146954", "0.7146954", "0.714062", "0.714062", "0.7135259", "0.712104", "0.712104", "0.712104", "0.712104", "0.712104", "0.712104", "0.712104", "0.7115953", "0.7094626", "0.70783085", "0.70783085", "0.707702", "0.707702", "0.7050784", "0.70080733", "0.6978266", "0.6955796", "0.6944937", "0.6904904", "0.6904904", "0.6904904", "0.6904904", "0.6904904", "0.6904904", "0.68963516", "0.68963516", "0.6876154", "0.6874297", "0.6833496", "0.6787952", "0.6787952", "0.6787952", "0.6787952", "0.6787952", "0.6787952", "0.6787952", "0.6787952", "0.6787952", "0.6787952", "0.6787952", "0.6787952", "0.6787952", "0.6787952", "0.6787952", "0.6787952", "0.6787952", "0.6787952", "0.6787952", "0.6787952", "0.6787952", "0.6787952", "0.6787952", "0.6787952", "0.6787952", "0.6787952", "0.6787952", "0.6787952" ]
0.7078388
52
Creates a history object that stores locations in memory.
function createMemoryHistory(props) { if (props === void 0) { props = {}; } var _props = props, getUserConfirmation = _props.getUserConfirmation, _props$initialEntries = _props.initialEntries, initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries, _props$initialIndex = _props.initialIndex, initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex, _props$keyLength = _props.keyLength, keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength; var transitionManager = createTransitionManager(); function setState(nextState) { (0,esm_extends/* default */.Z)(history, nextState); history.length = history.entries.length; transitionManager.notifyListeners(history.location, history.action); } function createKey() { return Math.random().toString(36).substr(2, keyLength); } var index = clamp(initialIndex, 0, initialEntries.length - 1); var entries = initialEntries.map(function (entry) { return typeof entry === 'string' ? history_createLocation(entry, undefined, createKey()) : history_createLocation(entry, undefined, entry.key || createKey()); }); // Public interface var createHref = createPath; function push(path, state) { false ? 0 : void 0; var action = 'PUSH'; var location = history_createLocation(path, state, createKey(), history.location); transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { if (!ok) return; var prevIndex = history.index; var nextIndex = prevIndex + 1; var nextEntries = history.entries.slice(0); if (nextEntries.length > nextIndex) { nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location); } else { nextEntries.push(location); } setState({ action: action, location: location, index: nextIndex, entries: nextEntries }); }); } function replace(path, state) { false ? 0 : void 0; var action = 'REPLACE'; var location = history_createLocation(path, state, createKey(), history.location); transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { if (!ok) return; history.entries[history.index] = location; setState({ action: action, location: location }); }); } function go(n) { var nextIndex = clamp(history.index + n, 0, history.entries.length - 1); var action = 'POP'; var location = history.entries[nextIndex]; transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { if (ok) { setState({ action: action, location: location, index: nextIndex }); } else { // Mimic the behavior of DOM histories by // causing a render after a cancelled POP. setState(); } }); } function goBack() { go(-1); } function goForward() { go(1); } function canGo(n) { var nextIndex = history.index + n; return nextIndex >= 0 && nextIndex < history.entries.length; } function block(prompt) { if (prompt === void 0) { prompt = false; } return transitionManager.setPrompt(prompt); } function listen(listener) { return transitionManager.appendListener(listener); } var history = { length: entries.length, action: 'POP', location: entries[index], index: index, entries: entries, createHref: createHref, push: push, replace: replace, go: go, goBack: goBack, goForward: goForward, canGo: canGo, block: block, listen: listen }; return history; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createMemoryHistory(base = '') {\n let listeners = [];\n let queue = [START];\n let position = 0;\n function setLocation(location) {\n position++;\n if (position === queue.length) {\n // we are at the end, we can simply append a new entry\n queue.push(location);\n }\n else {\n // we are in the middle, we remove everything from here in the queue\n queue.splice(position);\n queue.push(location);\n }\n }\n function triggerListeners(to, from, { direction, delta }) {\n const info = {\n direction,\n delta,\n type: NavigationType.pop,\n };\n for (let callback of listeners) {\n callback(to, from, info);\n }\n }\n const routerHistory = {\n // rewritten by Object.defineProperty\n location: START,\n state: {},\n base,\n createHref: createHref.bind(null, base),\n replace(to) {\n // remove current entry and decrement position\n queue.splice(position--, 1);\n setLocation(to);\n },\n push(to, data) {\n setLocation(to);\n },\n listen(callback) {\n listeners.push(callback);\n return () => {\n const index = listeners.indexOf(callback);\n if (index > -1)\n listeners.splice(index, 1);\n };\n },\n destroy() {\n listeners = [];\n },\n go(delta, shouldTrigger = true) {\n const from = this.location;\n const direction = \n // we are considering delta === 0 going forward, but in abstract mode\n // using 0 for the delta doesn't make sense like it does in html5 where\n // it reloads the page\n delta < 0 ? NavigationDirection.back : NavigationDirection.forward;\n position = Math.max(0, Math.min(position + delta, queue.length - 1));\n if (shouldTrigger) {\n triggerListeners(this.location, from, {\n direction,\n delta,\n });\n }\n },\n };\n Object.defineProperty(routerHistory, 'location', {\n get: () => queue[position],\n });\n return routerHistory;\n}", "function createMemoryHistory(base = '') {\r\n let listeners = [];\r\n let queue = [START];\r\n let position = 0;\r\n function setLocation(location) {\r\n position++;\r\n if (position === queue.length) {\r\n // we are at the end, we can simply append a new entry\r\n queue.push(location);\r\n }\r\n else {\r\n // we are in the middle, we remove everything from here in the queue\r\n queue.splice(position);\r\n queue.push(location);\r\n }\r\n }\r\n function triggerListeners(to, from, { direction, delta }) {\r\n const info = {\r\n direction,\r\n delta,\r\n type: NavigationType.pop,\r\n };\r\n for (const callback of listeners) {\r\n callback(to, from, info);\r\n }\r\n }\r\n const routerHistory = {\r\n // rewritten by Object.defineProperty\r\n location: START,\r\n // TODO: should be kept in queue\r\n state: {},\r\n base,\r\n createHref: createHref.bind(null, base),\r\n replace(to) {\r\n // remove current entry and decrement position\r\n queue.splice(position--, 1);\r\n setLocation(to);\r\n },\r\n push(to, data) {\r\n setLocation(to);\r\n },\r\n listen(callback) {\r\n listeners.push(callback);\r\n return () => {\r\n const index = listeners.indexOf(callback);\r\n if (index > -1)\r\n listeners.splice(index, 1);\r\n };\r\n },\r\n destroy() {\r\n listeners = [];\r\n queue = [START];\r\n position = 0;\r\n },\r\n go(delta, shouldTrigger = true) {\r\n const from = this.location;\r\n const direction = \r\n // we are considering delta === 0 going forward, but in abstract mode\r\n // using 0 for the delta doesn't make sense like it does in html5 where\r\n // it reloads the page\r\n delta < 0 ? NavigationDirection.back : NavigationDirection.forward;\r\n position = Math.max(0, Math.min(position + delta, queue.length - 1));\r\n if (shouldTrigger) {\r\n triggerListeners(this.location, from, {\r\n direction,\r\n delta,\r\n });\r\n }\r\n },\r\n };\r\n Object.defineProperty(routerHistory, 'location', {\r\n enumerable: true,\r\n get: () => queue[position],\r\n });\r\n return routerHistory;\r\n}", "function createMemoryHistory(base = '') {\r\n let listeners = [];\r\n let queue = [START];\r\n let position = 0;\r\n base = normalizeBase(base);\r\n function setLocation(location) {\r\n position++;\r\n if (position === queue.length) {\r\n // we are at the end, we can simply append a new entry\r\n queue.push(location);\r\n }\r\n else {\r\n // we are in the middle, we remove everything from here in the queue\r\n queue.splice(position);\r\n queue.push(location);\r\n }\r\n }\r\n function triggerListeners(to, from, { direction, delta }) {\r\n const info = {\r\n direction,\r\n delta,\r\n type: NavigationType.pop,\r\n };\r\n for (const callback of listeners) {\r\n callback(to, from, info);\r\n }\r\n }\r\n const routerHistory = {\r\n // rewritten by Object.defineProperty\r\n location: START,\r\n // TODO: should be kept in queue\r\n state: {},\r\n base,\r\n createHref: createHref.bind(null, base),\r\n replace(to) {\r\n // remove current entry and decrement position\r\n queue.splice(position--, 1);\r\n setLocation(to);\r\n },\r\n push(to, data) {\r\n setLocation(to);\r\n },\r\n listen(callback) {\r\n listeners.push(callback);\r\n return () => {\r\n const index = listeners.indexOf(callback);\r\n if (index > -1)\r\n listeners.splice(index, 1);\r\n };\r\n },\r\n destroy() {\r\n listeners = [];\r\n queue = [START];\r\n position = 0;\r\n },\r\n go(delta, shouldTrigger = true) {\r\n const from = this.location;\r\n const direction = \r\n // we are considering delta === 0 going forward, but in abstract mode\r\n // using 0 for the delta doesn't make sense like it does in html5 where\r\n // it reloads the page\r\n delta < 0 ? NavigationDirection.back : NavigationDirection.forward;\r\n position = Math.max(0, Math.min(position + delta, queue.length - 1));\r\n if (shouldTrigger) {\r\n triggerListeners(this.location, from, {\r\n direction,\r\n delta,\r\n });\r\n }\r\n },\r\n };\r\n Object.defineProperty(routerHistory, 'location', {\r\n enumerable: true,\r\n get: () => queue[position],\r\n });\r\n return routerHistory;\r\n}", "function History(){\n\n var self = this;\n this.commands = loadHistory();\n var currIndex = this.commands.length;\n\n this.add = function(command) {\n if(command == _.last(this.commands)) {\n currIndex = this.commands.length;\n return;\n }\n this.commands.push(command);\n var maxHistory = parseInt(env.env('maxHistory')) || $.fn.cli.env.maxHistory;\n if(this.commands.length > maxHistory){\n this.commands = _.last(this.commands, maxHistory);\n }\n currIndex = this.commands.length;\n saveHistory();\n }\n\n this.getPrevious = function() {\n if(currIndex>=0) currIndex--;\n return (this.commands.length && currIndex > -1) ? this.commands[currIndex] : null;\n }\n\n this.getNext = function() {\n if(currIndex<(this.commands.length)) currIndex++;\n return (this.commands.length && currIndex < this.commands.length) ? this.commands[currIndex] : null;\n }\n\n function saveHistory () {\n localStorage.setItem(historyStorageKey, JSON.stringify(self.commands));\n }\n function loadHistory () {\n var history = localStorage.getItem(historyStorageKey);\n return history ? JSON.parse(history) : [];\n }\n }", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries =\n _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex =\n _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(\n _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\n 'default'\n ],\n )(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random()\n .toString(36)\n .substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function(entry) {\n return typeof entry === 'string'\n ? createLocation(entry, undefined, createKey())\n : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true\n ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_4__['default'])(\n !(\n typeof path === 'object' &&\n path.state !== undefined &&\n state !== undefined\n ),\n 'You should avoid providing a 2nd state argument to push when the 1st ' +\n 'argument is a location-like object that already has state; it is ignored',\n )\n : undefined;\n var action = 'PUSH';\n var location = createLocation(\n path,\n state,\n createKey(),\n history.location,\n );\n transitionManager.confirmTransitionTo(\n location,\n action,\n getUserConfirmation,\n function(ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(\n nextIndex,\n nextEntries.length - nextIndex,\n location,\n );\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries,\n });\n },\n );\n }\n\n function replace(path, state) {\n true\n ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_4__['default'])(\n !(\n typeof path === 'object' &&\n path.state !== undefined &&\n state !== undefined\n ),\n 'You should avoid providing a 2nd state argument to replace when the 1st ' +\n 'argument is a location-like object that already has state; it is ignored',\n )\n : undefined;\n var action = 'REPLACE';\n var location = createLocation(\n path,\n state,\n createKey(),\n history.location,\n );\n transitionManager.confirmTransitionTo(\n location,\n action,\n getUserConfirmation,\n function(ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location,\n });\n },\n );\n }\n\n function go(n) {\n var nextIndex = clamp(\n history.index + n,\n 0,\n history.entries.length - 1,\n );\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(\n location,\n action,\n getUserConfirmation,\n function(ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex,\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n },\n );\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen,\n };\n return history;\n }", "function History() {\n // This is the actual buffer where previous commands are kept.\n // 'this._buffer[0]' should always be equal the empty string. This is so\n // that when you try to go in to the \"future\", you will just get an empty\n // command.\n this._buffer = [''];\n\n // This is an index in to the history buffer which points to where we\n // currently are in the history.\n this._current = 0;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored');\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored');\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n function setState(nextState) {\n (0,esm_extends/* default */.Z)(history, nextState);\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? history_createLocation(entry, undefined, createKey()) : history_createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n function push(path, state) {\n false ? 0 : void 0;\n var action = 'PUSH';\n var location = history_createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n function replace(path, state) {\n false ? 0 : void 0;\n var action = 'REPLACE';\n var location = history_createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n function goBack() {\n go(-1);\n }\n function goForward() {\n go(1);\n }\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n return transitionManager.setPrompt(prompt);\n }\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0, _extends2.default)(history, nextState);\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0, _extends2.default)(history, nextState);\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0, _extends2.default)(history, nextState);\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0, _extends2.default)(history, nextState);\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0, _extends2.default)(history, nextState);\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0, _extends2.default)(history, nextState);\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n \"development\" !== \"production\" ? (0, _tinyWarning.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createHistory() {\n var history = {\n 'subject' : string[1],\n 'date' : new Date().toString()\n };\n saveHistory(history);\n }", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0,esm_extends/* default */.Z)(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n false ? 0 : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n false ? 0 : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(esm_extends[\"a\" /* default */])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(esm_extends[\"a\" /* default */])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(esm_extends[\"a\" /* default */])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n extends_extends(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__[\"a\" /* default */])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n false ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n false ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__[\"a\" /* default */])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n false ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n false ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__[\"a\" /* default */])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n false ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n false ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__[\"a\" /* default */])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n false ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n false ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__[\"a\" /* default */])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n false ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n false ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__[\"a\" /* default */])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n false ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n false ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function History() {\n this.time = 0;\n this.done = []; this.undone = [];\n }", "function History() {\n this.time = 0;\n this.done = []; this.undone = [];\n }", "function History() {\n this.time = 0;\n this.done = []; this.undone = [];\n }", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : undefined;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__.default)(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_3__.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_3__.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__.default)(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_3__.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_3__.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__.default)(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_3__.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_3__.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__.default)(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_3__.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_3__.default)(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "_setupHistory() {\n if (!this.history) {\n try{ this.history = createHistory(); }\n catch(e) { \n this.history = this.options.history || createMemoryHistory();\n this._isPhantomHistory = true; \n }\n } \n }", "function HistoryEntry(variables) {\n this.timestamp = Date.now();\n this.variables = variables;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n false ? undefined : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n false ? undefined : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__[\"a\" /* default */])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n Object({\"API_URL\":\"http://localhost:4000/\",\"TIMEOUT\":50000}).NODE_ENV !== \"production\" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__[\"a\" /* default */])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n Object({\"API_URL\":\"http://localhost:4000/\",\"TIMEOUT\":50000}).NODE_ENV !== \"production\" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__[\"a\" /* default */])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__[\"a\" /* default */])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n process.env.NODE_ENV !== \"production\" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__[\"a\" /* default */])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n process.env.NODE_ENV !== \"production\" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__[\"a\" /* default */])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "function createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__[\"a\" /* default */])(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n process.env.NODE_ENV !== \"production\" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__[\"a\" /* default */])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n process.env.NODE_ENV !== \"production\" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__[\"a\" /* default */])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}", "saveInHistory(state) {\n let histName = state.currentHistoryName;\n\n if (histName === null) {\n // New history row\n histName = this.getNewHistoryName(state);\n state.currentHistoryName = histName;\n }\n\n state.history[histName] = {\n name: histName,\n lastModification: Date.now(),\n points: state.points,\n links: state.links,\n tooltips: state.tooltips,\n defaultPointColor: state.defaultPointColor,\n defaultLinkColor: state.defaultLinkColor,\n defaultTooltipColor: state.defaultTooltipColor,\n defaultTooltipFontColor: state.defaultTooltipFontColor\n };\n\n this.storeHistory(state.history);\n }", "function addToHistory(location) {\n var newQueries;\n var maxHistorySize=5;\n var exists=false; //Check if location already exist in history list\n newQueries = getHistory();\n for(var u=0;u<newQueries.queries.length;u++) {\n if(location===newQueries.queries[u]) {\n exists=true;\n }\n }\n if(!exists) { //Location does not exist\n if(newQueries.queries.length>=maxHistorySize) {\n newQueries.queries.shift();\n }\n newQueries.queries.push(location);\n localStorage.setItem(storageItem, JSON.stringify(newQueries));\n }\n }", "function storeHistory() {\n var f = ioFile.open(historyOutFile, \"w\");\n f.write(JSON.stringify(history));\n f.close();\n if (debug)\n console.log(\"Have stored history to \" + historyOutFile);\n }", "serializeHistory(state) {\r\n if (!state)\r\n return null;\r\n // Ensure sure that all entries have url\r\n var entries = state.entries.filter(e => e.url);\r\n if (!entries.length)\r\n return null;\r\n // Ensure the index is in bounds.\r\n var index = (state.index || entries.length) - 1;\r\n index = Math.min(index, entries.length - 1);\r\n index = Math.max(index, 0);\r\n var historyStart = this.enableSaveHistory ? 0 : index;\r\n var historyEnd = this.enableSaveHistory ? entries.length : index + 1;\r\n var history = [];\r\n\r\n var saveScroll = this.prefBranch.getBoolPref(\"save.scrollposition\");\r\n var currentScroll = saveScroll && state.scroll ? JSON.stringify(state.scroll) : \"0,0\";\r\n if (currentScroll != \"0,0\")\r\n entries[index].scroll = currentScroll;\r\n\r\n for (let j = historyStart; j < historyEnd; j++) {\r\n try {\r\n let historyEntry = entries[j];\r\n let entry = {\r\n url: historyEntry.url,\r\n title: historyEntry.title || \"\",\r\n scroll: saveScroll && historyEntry.scroll || \"0,0\",\r\n };\r\n if (historyEntry.triggeringPrincipal_base64) {\r\n entry.triggeringPrincipal_base64 = historyEntry.triggeringPrincipal_base64;\r\n }\r\n history.push(entry);\r\n } catch (ex) {\r\n Tabmix.assert(ex, \"serializeHistory error at index \" + j);\r\n }\r\n }\r\n return {\r\n history: encodeURI(JSON.stringify(history)),\r\n index,\r\n scroll: currentScroll\r\n };\r\n }", "function History() {\n this.time = 0;\n this.done = []; this.undone = [];\n this.compound = 0;\n this.closed = false;\n }", "function History() {\n this.time = 0;\n this.done = []; this.undone = [];\n this.compound = 0;\n this.closed = false;\n }", "function History() {\n this.time = 0;\n this.done = []; this.undone = [];\n this.compound = 0;\n this.closed = false;\n }", "constructor(id) {\n this.id = id;\n this.history = [];\n }", "function LocationLog() {\n this.location = [];\n this.currentId = 0;\n}", "function createLocalHistory(array, storage){\n\tfor (var i = 0; i < array.length; i++)\n\t\tstorage.setItem(array[i],\"0\");\n}", "function History(client) {\n if (!(this instanceof History)) {\n return new History(client);\n }\n this.client = client;\n this.uriPrefix = client.uriPrefix;\n}", "function generateHistoryObject() {\n\n let o = {}\n\n for (let i = 0; i < 28; i++) {\n o[i] = 0\n }\n\n return o\n\n}", "function _createHistoryFrame() {\n\t\t\tvar $historyFrameName = \"unFocusHistoryFrame\";\n\t\t\t_historyFrameObj = document.createElement(\"iframe\");\n\t\t\t_historyFrameObj.setAttribute(\"name\", $historyFrameName);\n\t\t\t_historyFrameObj.setAttribute(\"id\", $historyFrameName);\n\t\t\t// :NOTE: _Very_ experimental\n\t\t\t_historyFrameObj.setAttribute(\"src\", 'javascript:;');\n\t\t\t_historyFrameObj.style.position = \"absolute\";\n\t\t\t_historyFrameObj.style.top = \"-900px\";\n\t\t\tdocument.body.insertBefore(_historyFrameObj,document.body.firstChild);\n\t\t\t// get reference to the frame from frames array (needed for document.open)\n\t\t\t// :NOTE: there might be an issue with this according to quirksmode.org\n\t\t\t// http://www.quirksmode.org/js/iframe.html\n\t\t\t_historyFrameRef = frames[$historyFrameName];\n\t\t\t\n\t\t\t// add base history entry\n\t\t\t_createHistoryHTML(_currentHash, true);\n\t\t}", "function setHistory() {\n // clear undo history\n $('#undoHistoryList')\n .empty();\n\n // load new history list from server\n getHistoryFromServer(addHistList);\n}", "function History() {\n}", "function History(size) {\n if (!(GM_setValue && GM_getValue)) {\n alert('Please upgrade to the latest version of Greasemonkey.');\n return;\n }\n this.index=0;\n this.size=size;\n //oldest items are at the front of the array\n //newest added to end\n this.code_history=new Array();\n}", "function save_history () {\n\tvar ds = currHds();\n\tedit_history [edit_history_index] = JSON.stringify(ds.toJSON());\n}", "function createMemoryHistory(props){if(props===void 0){props={};}var _props=props,getUserConfirmation=_props.getUserConfirmation,_props$initialEntries=_props.initialEntries,initialEntries=_props$initialEntries===void 0?['/']:_props$initialEntries,_props$initialIndex=_props.initialIndex,initialIndex=_props$initialIndex===void 0?0:_props$initialIndex,_props$keyLength=_props.keyLength,keyLength=_props$keyLength===void 0?6:_props$keyLength;var transitionManager=createTransitionManager();function setState(nextState){Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(history,nextState);history.length=history.entries.length;transitionManager.notifyListeners(history.location,history.action);}function createKey(){return Math.random().toString(36).substr(2,keyLength);}var index=clamp(initialIndex,0,initialEntries.length-1);var entries=initialEntries.map(function(entry){return typeof entry==='string'?createLocation(entry,undefined,createKey()):createLocation(entry,undefined,entry.key||createKey());});// Public interface\nvar createHref=createPath;function push(path,state){ true?Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(_typeof(path)==='object'&&path.state!==undefined&&state!==undefined),'You should avoid providing a 2nd state argument to push when the 1st '+'argument is a location-like object that already has state; it is ignored'):undefined;var action='PUSH';var location=createLocation(path,state,createKey(),history.location);transitionManager.confirmTransitionTo(location,action,getUserConfirmation,function(ok){if(!ok)return;var prevIndex=history.index;var nextIndex=prevIndex+1;var nextEntries=history.entries.slice(0);if(nextEntries.length>nextIndex){nextEntries.splice(nextIndex,nextEntries.length-nextIndex,location);}else{nextEntries.push(location);}setState({action:action,location:location,index:nextIndex,entries:nextEntries});});}function replace(path,state){ true?Object(tiny_warning__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(!(_typeof(path)==='object'&&path.state!==undefined&&state!==undefined),'You should avoid providing a 2nd state argument to replace when the 1st '+'argument is a location-like object that already has state; it is ignored'):undefined;var action='REPLACE';var location=createLocation(path,state,createKey(),history.location);transitionManager.confirmTransitionTo(location,action,getUserConfirmation,function(ok){if(!ok)return;history.entries[history.index]=location;setState({action:action,location:location});});}function go(n){var nextIndex=clamp(history.index+n,0,history.entries.length-1);var action='POP';var location=history.entries[nextIndex];transitionManager.confirmTransitionTo(location,action,getUserConfirmation,function(ok){if(ok){setState({action:action,location:location,index:nextIndex});}else{// Mimic the behavior of DOM histories by\n// causing a render after a cancelled POP.\nsetState();}});}function goBack(){go(-1);}function goForward(){go(1);}function canGo(n){var nextIndex=history.index+n;return nextIndex>=0&&nextIndex<history.entries.length;}function block(prompt){if(prompt===void 0){prompt=false;}return transitionManager.setPrompt(prompt);}function listen(listener){return transitionManager.appendListener(listener);}var history={length:entries.length,action:'POP',location:entries[index],index:index,entries:entries,createHref:createHref,push:push,replace:replace,go:go,goBack:goBack,goForward:goForward,canGo:canGo,block:block,listen:listen};return history;}", "function push_history() {\n\tedit_history_index++;\n\tsave_history();\n\tedit_history.length = edit_history_index+1;\n}", "function AddressHistory(args) {\n this.node = args.node;\n this.options = args.options;\n\n if(Array.isArray(args.addresses)) {\n this.addresses = args.addresses;\n } else {\n this.addresses = [args.addresses];\n }\n this.transactionInfo = [];\n this.combinedArray = [];\n this.detailedArray = [];\n}", "function retrieveHistory() {\n if (!localStorage.getItem('cities')) {\n localStorage.setItem('cities', JSON.stringify(searchHistory));\n } else {\n searchHistory = JSON.parse(localStorage.getItem('cities'));\n }\n}", "function History_History()\n{\n\t//call reset\n\tthis.Reset();\n}", "function gnc_getHistory() {\n var fakeHistory = {};\n for (property in history) {\n switch (property) {\n case 'length':\n Object.defineProperty(fakeHistory, property, {\n enumerable: true,\n get: function() { return gncHistoryLength; }\n });\n break;\n\n case 'go':\n fakeHistory[property] = function(delta) {\n if (!delta || delta === 0) {\n gnc_getLocation().reload();\n return;\n }\n\n window.parent.postMessage({ type: 'host-go', delta: delta }, '*');\n };\n break;\n\n case 'back':\n fakeHistory[property] = function() {\n window.parent.postMessage({ type: 'host-go', delta: -1 }, '*');\n };\n break;\n\n case 'forward':\n fakeHistory[property] = function() {\n window.parent.postMessage({ type: 'host-go', delta: 1 }, '*');\n };\n break;\n\n case 'pushState':\n fakeHistory[property] = function(state, title, url) {\n window.parent.postMessage({ type: 'host-pushstate',\n state: state,\n title: title,\n url: url }, '*');\n };\n break;\n\n case 'replaceState':\n fakeHistory[property] = function(state, title, url) {\n window.parent.postMessage({ type: 'host-replacestate',\n state: state,\n title: title,\n url: url }, '*');\n };\n break;\n\n default:\n fakeHistory[property] = history[property];\n }\n }\n\n return fakeHistory;\n}", "history(){\n this._history = true;\n return this;\n }", "getHistory() {\n return this.history;\n }", "getHistory() {\n return this.history;\n }", "function History(container, maxDepth, commitDelay, editor) {\n this.container = container;\n this.maxDepth = maxDepth; this.commitDelay = commitDelay;\n this.editor = editor; this.parent = editor.parent;\n // This line object represents the initial, empty editor.\n var initial = {text: \"\", from: null, to: null};\n // As the borders between lines are represented by BR elements, the\n // start of the first line and the end of the last one are\n // represented by null. Since you can not store any properties\n // (links to line objects) in null, these properties are used in\n // those cases.\n this.first = initial; this.last = initial;\n // Similarly, a 'historyTouched' property is added to the BR in\n // front of lines that have already been touched, and 'firstTouched'\n // is used for the first line.\n this.firstTouched = false;\n // History is the set of committed changes, touched is the set of\n // nodes touched since the last commit.\n this.history = []; this.redoHistory = []; this.touched = [];\n}", "function addHistory( data ) {\n\n if ( typeof(aio.history) != 'object' ) { aio.history = []; } // Change aio.history to array\n if ( typeof(aio.history) == 'object' && aio.history.length > 19 ) { aio.history.pop(); } // Delete oldest record if total exceeds 20\n\n // Add this new record\n aio.history.unshift( data );\n updateHistory();\n\n}", "function History(pn) {\n\t\tthis.queue = [];\n\t\tthis.parentname = pn;\n\t\tthis.currstate = clone(_GP[this.parentname]);\n\t\tthis.initialstate = clone(_GP[this.parentname]);\n\t\tthis.initialdate = new Date().getTime();\n\t}" ]
[ "0.67093724", "0.6660363", "0.66349125", "0.6514125", "0.6496346", "0.6491885", "0.6476713", "0.64495486", "0.6383285", "0.6383285", "0.6383285", "0.6383285", "0.6383285", "0.6383285", "0.6377784", "0.63725656", "0.6372155", "0.63628995", "0.63628995", "0.63628995", "0.634001", "0.63310856", "0.63310856", "0.63310856", "0.63310856", "0.63310856", "0.63310856", "0.6329393", "0.6329393", "0.6329393", "0.6322891", "0.6322891", "0.6322891", "0.6322891", "0.6322891", "0.6322891", "0.6322891", "0.6322891", "0.6322891", "0.6322891", "0.6322891", "0.6322891", "0.6322891", "0.6322891", "0.6322891", "0.6322891", "0.6322891", "0.6322891", "0.6322891", "0.6322891", "0.6322891", "0.6322891", "0.6322891", "0.6322891", "0.6322891", "0.6322891", "0.6322891", "0.6322891", "0.63209414", "0.63209414", "0.62817514", "0.62817514", "0.62817514", "0.62817514", "0.62507075", "0.62264293", "0.62253153", "0.62253153", "0.6211507", "0.6207032", "0.6207032", "0.61745715", "0.6144592", "0.6121789", "0.6047488", "0.60329384", "0.60329384", "0.60329384", "0.59962136", "0.5982917", "0.59756655", "0.5966633", "0.59452456", "0.5930876", "0.5910871", "0.59092414", "0.5863659", "0.5804842", "0.57979834", "0.5774437", "0.57218885", "0.57163554", "0.5700126", "0.5682827", "0.5644461", "0.56408465", "0.56408465", "0.5632388", "0.56025374", "0.55967313" ]
0.6401474
8
The public API for prompting the user before navigating away from a screen.
function Prompt(_ref) { var message = _ref.message, _ref$when = _ref.when, when = _ref$when === void 0 ? true : _ref$when; return React.createElement(context.Consumer, null, function (context) { !context ? false ? 0 : invariant(false) : void 0; if (!when || context.staticContext) return null; var method = context.history.block; return React.createElement(Lifecycle, { onMount: function onMount(self) { self.release = method(message); }, onUpdate: function onUpdate(self, prevProps) { if (prevProps.message !== message) { self.release(); self.release = method(message); } }, onUnmount: function onUnmount(self) { self.release(); }, message: message }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function navigateAway() {\n switch (document.body.id) {\n case 'options':\n chrome.runtime.sendMessage({\n 'name': 'OptionsSave',\n 'excludes': gTplData.options.globalExcludesStr.trim(),\n 'useCodeMirror': gTplData.options.useCodeMirror,\n }, logUnhandledError);\n break;\n case 'user-script-options':\n chrome.runtime.sendMessage({\n 'name': 'UserScriptOptionsSave',\n 'details': gTplData.activeScript,\n }, logUnhandledError);\n break;\n case 'user-script':\n if (gTplData.pendingUninstall > 0) {\n uninstall(gTplData.activeScript.uuid);\n return;\n }\n gTplData.activeScript.updateMessage = '';\n gTplData.activeScript = {};\n break;\n }\n}", "function ExitPage() {\n\t\talert('Are you sure you want navigate away from this App?');\n\t\tgetit()\n\t}", "_backPress(event) {\n this.props.navigator.pop()\n }", "_prevScreenApp() {\n\t\tthis.props.navigation.goBack(null);\n }", "abortPageNavigate() {\n\n this.confirm_navigation_level = 2;\n\n history.back();\n\n setTimeout(function() {\n this.confirm_navigation_level = 1;\n }, 300);\n }", "handleGoBack(){\n this.props.navigator.pop();\n }", "goBackToHairdresserAccount(){\n\t\tvar self=this;\n\t\tself.AuthToken.erase('description');\n\t\tself.$location.path('/hairdresser/account');\n\t}", "_onBack () {\n this.props.navigator.pop();\n }", "_logout() {\n // Ask to confirm\n Alert.alert('Logout', 'Are you sure you want to logout?',\n [\n {\n text: 'Yes',\n onPress: () => {\n this.setState({ loaded: false })\n this.navigator.pop()\n }\n },\n { text: 'No' }\n ]\n )\n }", "function disappear(){\n\tif (document.getElementById(\"prompt\")){\n\t\tvar prompt = document.getElementById(\"prompt\");\n\t\tprompt.parentNode.removeChild(prompt);\n\t}\n}", "_navigateBack(){\n this.props.navigator.pop()\n }", "_onBack () { \n this.props.navigator.pop();\n }", "_closeModal () {\n this.props.navigator.pop()\n }", "onBackButtonClick_() {\n this.userActed('os-trial-back');\n }", "cancel () {\n this.$window.history.back();\n }", "goBack() {\n this.props.navigator.pop({\n animated: false,\n });\n }", "function cancel() {\n window.history.back();\n}", "function onBackKeyDown() {\n if(app.views.main.router.currentRoute.path == \"/login/\" )\n {\n navigator.app.exitApp();\n }\n else\n {\n if(localStorage.user_role == \"Driver\")\n {\n if(app.views.main.router.currentRoute.path == \"/pesanan/\")\n {\n navigator.app.exitApp();\n\n }\n else\n {\n //app.views.main.router.navigate('/pesanan/');\n app.views.main.router.back();\n }\n }\n else\n {\n if(app.views.main.router.currentRoute.path == \"/beranda/\")\n {\n navigator.app.exitApp();\n }\n else\n {\n //app.views.main.router.navigate('/beranda/');\n app.views.main.router.back();\n }\n }\n }\n}", "back() {\n if (!this._initialized || this._popStateInProgress) {\n return;\n }\n const state = window.history.state;\n if (this._isValidState(state) && state.uid > 0) {\n window.history.back();\n }\n }", "function cancel() {\n history.goBack();\n }", "function LeaveStandalone()\n\t{\n\t\tif(m_should_back_out){\n\t\t\tm_should_back_out = false;\n\t\t\thistory.back();\n\t\t}\n\t\telse{\n\t\t\tHide();\n\t\t}\n\t}", "function onGoBack() {\n setFormDataEdit(null);\n setStep('Menu');\n }", "goBack() {\n // signs users out b/c Firebase won't let you create a user without also logging in as them\n // this saves confusion after a team captain creates a player and goes back signed in as a different person\n firebase.auth().signOut();\n window.history.back();\n }", "function be_logout(page) {\n ask({cmd:'be_logout',page:page},_be_logout,'jo?');\n}", "function back() {\n 'use strict';\n\n welcomeScreen.style.display = 'block';\n gameScreen.style.display = 'none';\n endScreen.style.display = 'none';\n reset();\n}", "goBackToHairdresserAccount(){\n\t\tvar self=this;\n\t\tif(self.AuthToken.getObj('hairdresserDetails')){\n\t\t\tself.AuthToken.erase('hairdresserDetails');\n\t\t}\n\t\tself.$state.go('hairdresseraccount');\n\t\t//self.$location.path('/hairdresser/account');\n\t}", "onDonePress() {\n this.props.navigator.pop({ animated: false });\n }", "navigateAway() {\n alert('Please create an account to access Dashboard!');\n this.props.history.push('/');\n }", "function backMenu() {\n inquirer.prompt([\n {\n type: 'list',\n message: 'What would you like to do?',\n name: 'action',\n choices: [\n \"go back to main menu\",\n \"end session\"\n ]\n }\n ]).then(({ action }) => {\n switch (action) {\n case \"go back to main menu\":\n mainMenu();\n break;\n case \"end session\":\n connection.end();\n break;\n }\n });\n}", "onBackButtonClicked_() {\n if (this.uiStep === ENROLLMENT_STEP.SIGNIN) {\n if (this.lastBackMessageValue_) {\n this.lastBackMessageValue_ = false;\n this.$.authView.back();\n } else {\n this.cancel();\n }\n }\n }", "hide() {\n this.backButtonOpen_ = false;\n chrome.accessibilityPrivate.setSwitchAccessMenuState(\n false, SAConstants.EMPTY_LOCATION, 0);\n this.menuPanel_.setFocusRing(SAConstants.BACK_ID, false);\n }", "return() {\n this.location.back();\n }", "function quit() {\n inquirer.prompt([\n {\n type: \"confirm\",\n name: \"menu\",\n message: \"Would you like to go back to the main menu?\"\n }\n ]).then(function (arg) {\n if (arg.menu === false) {\n connection.end();\n process.exit();\n } else {\n userPrompt();\n }\n });\n}", "function onBackClick() {\n\tAlloy.Globals.NAVIGATION_CONTROLLER.closeWindow('welcomeContentScreen');\n}", "closeScreen() {\n this.loading = true;\n this[NavigationMixin.Navigate]({\n type: \"standard__recordPage\",\n attributes: {\n recordId: this.customerRecorId,\n objectApiName: \"Account\", // objectApiName is optional\n actionName: \"view\"\n }\n });\n this.loading = false;\n }", "cancelNavigation() {\n this.clearActiveRegion();\n this.setCurrentFocus();\n this.resetInterractionStates();\n }", "function onUnload() {\n var result = 0;\n if (modalDocument.getElementById('prompt-input')) {\n result = {\n input1: '',\n buttonIndex: 0\n };\n }\n mainWindow.setTimeout(function() {\n callback(result);\n }, 10);\n }", "async logout(){\n Alert.alert(\n 'Are you sure you want to logout?',\n 'I thought we had something special...',\n [\n { text: 'Cancel' },\n { text: \"Yes\", onPress: () => {\n AsyncStorage.multiRemove([\"token\", \"id\"]).then(() => {\n this.props.navigator.resetTo({ name: \"Login\" });\n });\n }\n },\n ],\n )\n }", "back() {\n this._platformStrategy.back();\n }", "function onBackKeyDown() {\n\tif (shouYinEmployee.id) {\n\t\tshowAlert('提示', '请先完成交接班才能退出!');\n\t\treturn;\n\t}\n\tnavigator.notification.confirm('按确定退出程序!', // message\n\tonConfirm, // callback to invoke with index of button pressed\n\t'确定要退出程序吗?', // title\n\t'确定,取消' // buttonLabels\n\t);\n}", "back() {\n this._platformStrategy.back();\n }", "back() {\n this._platformStrategy.back();\n }", "back() {\n this._platformStrategy.back();\n }", "back() {\n this._platformStrategy.back();\n }", "back() {\n this._platformStrategy.back();\n }", "function goBack(){\n\tg_cache.user_history.pop();\n\tfetchUser(g_cache.user_history.pop());\n}", "function quitGame() {\n const choice = confirm(\"Are you sure you want to leave this page?\");\n\n if (choice === true) {\n window.location = \"index.html\";\n }\n }", "function goBack() {\n\t\ttogglePage();\n\t\tdisposeThrownShurikens();\n\t\tupdateThrownShurikenCount();\n\t\tcleanBelt();\n\t}", "function backToGame() {\r\n //Unpause the game\r\n togglePause();\r\n\r\n //Hide the modal\r\n hideModal();\r\n\r\n //Remove the event listeners\r\n removeListeners();\r\n }", "function back() {\n window.history.back();\n //director.navigateTo({ path: 'customer-service-dashboard' });\n }", "navigateBack() {\n this.props.clearSearch(3);\n this.props.dashboardNavigateBack();\n this.props.disableSelectionMode();\n this.props.setDashboardBucketId(null);\n }", "function cancelForgotUsername(){\n\tcloseWindow();\n}", "function returnBack() {\n window.history.back()\n}", "navigationView_viewIsBeingPoppedFrom () {\n const self = this\n // I don't always get popped but when I do I maintain correct state\n self.wizardController.PatchToDifferentWizardTaskMode_withoutPushingScreen(\n self.options.wizardController_current_wizardTaskModeName,\n self.options.wizardController_current_wizardTaskMode_stepIdx - 1\n )\n }", "function logout() {\n updateState('account', null);\n navigate('/login');\n}", "function back(){\r\n\tif(appMenuOpen){\r\n\t\tappMenuOpen = false;\r\n\t\t$(\"#app-menu\").attr(\"style\", \"display: none;\");\r\n\t}\r\n\r\n\tif(recentAppsOpen){\r\n\t\trecentAppsOpen = false;\r\n\r\n\t\t//un-Hides menu bar on bottom of screen\r\n\t\t$(\"#bottom-menu-bar\").attr(\"style\",\"display: block;\");\r\n\t\t$(\"#recent-apps-screen\").attr(\"style\", \"display: none;\");\r\n\t}\r\n\r\n\t// screens to just close\r\n\t$(\"#call-screen\").attr(\"style\",\"display: none;\");\r\n\t$(\"#camera-screen\").attr(\"style\",\"display: none;\");\r\n\r\n\t//Hides notifications-box\r\n\t$(\"#notification-box\").css(\"display\", \"none\");\r\n}", "function goBackTo() {\n window.history.back()\n}", "function goBack() {\n\t\t\t$window.history.back();\n\t\t}", "logOut() {\n AsyncStorage.removeItem('userHash', (err, res) => {\n this.props.navigation.navigate('Login');\n });\n }", "function confirmBack(){\n let youSure = confirm('If you go back to the menu your art will be lost...');\n //if the user is sure, reload the page (bringing you back to the menu)\n if(youSure == true){\n location.reload();\n }\n}", "_backToMainAccount() {\n this._closeMenu();\n AuthActions.backToMainAccount();\n }", "exitGame() {\n // !Maybe solution for AppLogger or similar\n setTimeout(() => {\n window.top.location.href = RealityCheckModel.exit_URL || RealityCheckModel.lobby_URL;\n });\n }", "function goBack() {\n window.history.back();\n }", "function goBack() {\n window.history.back();\n }", "function goBack() {\n window.history.back();\n }", "function goBack(){\nwindow.close();\n}", "handleCancel() {\n this.cancel = true;\n this.changeScreen('screen-input');\n }", "function goBack() {\n PathStore.pop();\n}", "onBackPress() {\n const { history } = this.props;\n this.props.onNavigateToEmailListing();\n history.goBack();\n }", "onBackPress() {\n\t\tconst { history } = this.props;\n\t\tthis.props.onNavigateToEmailListing();\n\t\thistory.goBack();\n\t}", "function goBack() {\n window.history.back();\n }", "function goBack() {\n if (!vm.isModal) {\n $window.history.back();\n }\n else {\n $scope.modalInstance.dismiss('cancel');\n }\n }", "function goBack() {\n if (!vm.isModal) {\n $window.history.back();\n }\n else {\n $scope.modalInstance.dismiss('cancel');\n }\n }", "function goBack(){\n // *Navigating back:\n window.history.back();\n }", "function exit_user(){\n window.location.href='/logout'\n}", "function end(){\n inquirer.prompt({\n name: \"endScreen\",\n type: \"list\",\n message: \"What would you like to do now?\",\n choices: [\n \"continue shopping\",\n \"quit\"\n ]\n }).then(function(answer){\n if(answer.endScreen === \"continue shopping\"){\n storefront();\n } else {\n process.exit();\n };\n });\n}", "function closeLocker()\n {\n if (confirm(\"Are you sure you want to close the locker without locking?\"))\n {\n locker._pin = \"\";\n locker._locked = false;\n locker._contents = document.getElementById('lockerContents').value;\n locker._label = document.getElementById('lockerLabel').value;\n locker._color = document.getElementById('lockerColor').value;\n updateLocalStorage(locker);\n updateLocalStorage(lockers);\n alert(\"Warning: You are closing the locker before locking it! \");\n window.location = \"index.html\";\n }\n }", "function backAction() {\n switch (navigation[navigation.length-1]) {\n case \"list\":\n listAvailableQuizzes();\n break;\n case \"question\":\n showMore(quizNumber);\n break;\n case \"leaderboard\":\n showMore(quizNumber);\n break;\n\n }\n navigation.pop();\n if (navigation.length <= 0) {\n backButton.style.display = \"none\";\n }\n}", "cancelCreate() {\r\n this.props.history.goBack();\r\n }", "function logOut() {\n input = readline.question(\"Are you sure you want to log out? (yes / no)\\n>> \");\n if (input === \"yes\") {\n console.log(\"Logging out, thanks for using MustGet Banking CLI!\");\n // Clear user\n user = {};\n // If user wants to logout, return back to beginning of program\n currentLoc = \"start\";\n } else if (input === \"no\") {\n console.log(\"Ok, returning to menu\");\n // If user doesn't want to logout, return back to menu.\n currentLoc = \"menu\";\n }\n}", "function loginModalCallback(){\n\t\tvar screenName;\n\t\t\n\t\tif(ScreenManager.getCurrentScreen().getDisplayName != null){\n\t\t\tscreenName = ScreenManager.getCurrentScreen().getDisplayName();\n\t\t}else{\n\t\t\tscreenName = ScreenManager.getCurrentScreen().displayName;\n\t\t}\n\t\t\n\t\tif(screenName == WelcomeScreen.displayName){\n\t\t\tModalManager.hideModal();\n\t\t\tScreenManager.changeScreen(new UserIdentityScreen())\n\t\t}else{\n\t\t\tModalManager.hideModal();\n\t\t\tScreenManager.replaceScreen(ScreenManager.getCurrentScreen());\n\t\t}\n\t}", "function backToHome() {\r\n // unsaved warning box \r\n if (!warnUnsavedDialog())\r\n return;\r\n\r\n location.href = '/dbmiannotator/main';\r\n}", "handleBackToLogin() {\n this.props.displayRegister(false);\n }", "function goBackOrGoHome() {\n if(WinJS.Navigation.canGoBack) {\n WinJS.Navigation.back();\n }\n else {\n navigate('home');\n }\n }", "logout() {\n this.setState({\n modalVisible: false\n })\n this.props.navigation.navigate('Home',{});\n }", "function closeMe()\n{\n browser.runtime.sendMessage({\n type: \"app.get\",\n what: \"senderId\"\n }).then(tabId =>\n browser.tabs.remove(tabId).catch(err =>\n {\n // Opera 68 throws a \"Tabs cannot be edited right now (user may be\n // dragging a tab).\" exception when we attempt to close the window\n // using `browser.tabs.remove`.\n window.close();\n })\n );\n}", "function cancelRememberUserAboutUnsavedData(){\n\twindow.onbeforeunload = null;\n}", "logout(){\n AsyncStorage.setItem(\"Email\", '');\n AsyncStorage.setItem(\"Password\", '');\n const resetAction = NavigationActions.reset({\n index: 0,\n actions: [\n NavigationActions.navigate({ routeName: 'Login' }),\n ],\n });\n this.props.navigation.dispatch(resetAction);\n }", "function goBack() {\n window.history.back();\n}", "function goBack() {\n window.history.back();\n}", "navigateBack() {\n this.props.navigator.pop()\n this.setCurrentPageIndex(1)\n }", "function goBack() {\n\t\n\tprevious = window.parent.name;\n\t\n\tif ( isEdited == true ) {\n\t\tif ( ! confirm ( QST_BACK_ )) {\n\t\t\treturn;\n\t\t}\n\t}\t\n\t\n\tself.close();\n\n}", "function OnBtnBack_Click( e )\r\n{\r\n try\r\n {\r\n // On iOS devices, the NavigationWindow will be closed.\r\n // Instead on Android devices, the Window will be close\r\n if( OS_IOS )\r\n {\r\n $.navigationWindowViewUsersLocationsView.close() ;\r\n }\r\n else\r\n {\r\n $.viewUsersLocationsViewWindow.close() ;\r\n }\r\n }\r\n catch( exception )\r\n {\r\n Alloy.Globals.AlertUserAndLogAsync( L( 'generic_exception_msg' ) + exception.message ) ;\r\n }\r\n}", "async redirectToLoginScreen() {\n await removeMnemonicNotSaved();\n this.props.navigation.navigate('LoginScreen');\n }", "function backToMenuFromGame()\r\n\t\t{\r\n\t\t\tresetMatch();\r\n\t\t\tcancelAnimationFrame(requestId);\r\n\t\t\tdocument.getElementById('canvasSpace').style.display = \"none\";\r\n\t\t\tdocument.getElementById('menuInGame').style.display = \"none\";\r\n\t\t\tdocument.getElementById('settings').style.display = \"none\";\r\n\t\t\tdocument.getElementById('menu').style.display = \"initial\";\r\n\t\t}", "function onBackButton() {\r\n\tnavigator.app.exitApp();\r\n}", "function goBack() { $window.history.back(); }", "function goBack() {\n // remove latest from directory arrays\n dirs.pop()\n // browse to our new route\n navigate()\n}", "function back() {\n setMode(history.pop());\n setHistory(history);\n }", "function onBackKeyDown() {\n var backbutton = document.getElementById(\"button-back\");\n\n if (backbutton !== null) {\n backbutton.click();\n } else {\n if (navigator.app) {\n navigator.app.exitApp();\n } else if (navigator.device) {\n navigator.device.exitApp();\n } else {\n window.close();\n }\n }\n}", "function OnBtnBack_Click( e )\r\n{\r\n try\r\n {\r\n controls = null ;\r\n\r\n Alloy.Globals.ProtectedCleanUpEventListener( Ti.App , \"auth:done\" ) ;\r\n Alloy.Globals.ProtectedRemoveEventListener( Ti.App , \"baea_mode:view_features_with_login\" , UpdateAuthenticationInfo ) ;\r\n\r\n // On iOS devices, the NavigationWindow will be closed.\r\n // Instead on Android devices, the Window will be close\r\n if( OS_IOS )\r\n {\r\n $.navigationWindowBAEAModeForms.close() ;\r\n }\r\n else\r\n {\r\n $.baeaModeFormsWindow.close() ;\r\n }\r\n }\r\n catch( exception )\r\n {\r\n Alloy.Globals.AlertUserAndLogAsync( L( 'generic_exception_msg' ) + exception.message ) ;\r\n }\r\n}" ]
[ "0.63582224", "0.6336378", "0.6291143", "0.60359854", "0.6020931", "0.6016651", "0.59726274", "0.5955357", "0.5907807", "0.5901265", "0.59011984", "0.58868617", "0.586042", "0.58596414", "0.5846708", "0.5844033", "0.5826336", "0.5799647", "0.5799465", "0.5793241", "0.5777686", "0.57703286", "0.57680637", "0.5755797", "0.5751282", "0.57453394", "0.57200223", "0.5682492", "0.56684273", "0.5668417", "0.56663704", "0.5657262", "0.56534827", "0.5648345", "0.56387025", "0.5632761", "0.56254107", "0.56155205", "0.5609697", "0.56086564", "0.56015664", "0.56015664", "0.56015664", "0.56015664", "0.56015664", "0.5600169", "0.5552087", "0.5548903", "0.5548521", "0.5535947", "0.55350554", "0.55120724", "0.5504579", "0.55039537", "0.549429", "0.54896235", "0.54863423", "0.5485946", "0.5483531", "0.5479961", "0.54664505", "0.54601014", "0.5454175", "0.5454175", "0.5454175", "0.5452191", "0.5451281", "0.5445884", "0.5421911", "0.54212564", "0.5416384", "0.541427", "0.541427", "0.541281", "0.5407878", "0.5405899", "0.5402692", "0.5394398", "0.5394055", "0.53935933", "0.53890103", "0.5387601", "0.53815866", "0.5377775", "0.5377725", "0.53771937", "0.53731126", "0.53720516", "0.5370657", "0.5370657", "0.5362613", "0.5360323", "0.5358276", "0.5342536", "0.5342129", "0.5337249", "0.53302854", "0.53195", "0.5313775", "0.53115606", "0.53066325" ]
0.0
-1
Public API for generating a URL pathname from a path and parameters.
function generatePath(path, params) { if (path === void 0) { path = "/"; } if (params === void 0) { params = {}; } return path === "/" ? path : compilePath(path)(params, { pretty: true }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makePath(var_args){\n\t var result = join(slice(arguments), '/');\n\t // need to disconsider duplicate '/' after protocol (eg: 'http://')\n\t return result.replace(/([^:\\/]|^)\\/{2,}/g, '$1/');\n\t }", "function makePath(var_args){\n var result = join(slice(arguments), '/');\n // need to disconsider duplicate '/' after protocol (eg: 'http://')\n return result.replace(/([^:\\/]|^)\\/{2,}/g, '$1/');\n }", "function makePath(var_args){\n var result = join(slice(arguments), '/');\n // need to disconsider duplicate '/' after protocol (eg: 'http://')\n return result.replace(/([^:\\/]|^)\\/{2,}/g, '$1/');\n }", "function generatePath(path, params) {\n if (path === void 0) {\n path = '/';\n }\n\n if (params === void 0) {\n params = {};\n }\n\n return path === '/'\n ? path\n : compilePath(path)(params, {\n pretty: true,\n });\n }", "function _createURL()\n { var arr\n\n if(arguments.length === 1) arr=arguments[0]\n else arr = arguments\n\n var url = _transaction.server.location\n\n // arr:['route', 'article', 54 ] => str:\"/route/article/54\"\n for (var i=0; i<arr.length; i++){\n url += '/';\n if (arr[i] in _transaction.server)\n url += _transaction.server[arr[i]];\n else if (arr[i]+'Path' in _transaction.server)\n url += _transaction.server[arr[i]+'Path'];\n else\n url += arr[i]\n }\n\n return url;\n }", "function generatePath(path,params){if(path===void 0){path=\"/\";}if(params===void 0){params={};}return path===\"/\"?path:compilePath(path)(params,{pretty:true});}", "function generatePath(path, params) {\n if (path === void 0) {\n path = \"/\";\n }\n if (params === void 0) {\n params = {};\n }\n return path === \"/\" ? path : compilePath(path)(params, {\n pretty: true\n });\n}", "function react_router_generatePath(path, params) {\n if (path === void 0) {\n path = \"/\";\n }\n\n if (params === void 0) {\n params = {};\n }\n\n return path === \"/\" ? path : react_router_compilePath(path)(params, {\n pretty: true\n });\n}", "function generatePath(path = \"/\", params = {}) {\n return path === \"/\" ? path : compilePath(path)(params, { pretty: true });\n}", "function genUrl(opts, path$$1) {\n\t // If the host already has a path, then we need to have a path delimiter\n\t // Otherwise, the path delimiter is the empty string\n\t var pathDel = !opts.path ? '' : '/';\n\n\t // If the host already has a path, then we need to have a path delimiter\n\t // Otherwise, the path delimiter is the empty string\n\t return opts.protocol + '://' + opts.host +\n\t (opts.port ? (':' + opts.port) : '') +\n\t '/' + opts.path + pathDel + path$$1;\n\t}", "function makePath() {\n var path = [''];\n for (var i=0,l=arguments.length,arg,argType; i<l; i++) {\n arg = arguments[i];\n argType = typeof arg;\n if (argType === 'string' || (argType === 'number' && !isNaN(arg))) {\n arg = String(arg);\n if (arg.length) path.push(arg.replace(/^\\/|\\/$/g, ''));\n }\n }\n return path.join('/').replace(/\\/$/, '');\n}", "makePath(pathname, query) {\n if (query) {\n if (typeof query !== 'string')\n query = this.stringifyQuery(query);\n\n if (query !== '')\n return pathname + '?' + query;\n }\n\n return pathname;\n }", "function buildPath (basePath, queryParams) {\n basePath = basePath.concat('?')\n var url = basePath.concat(queryString.stringify(queryParams))\n return url\n }", "function path() {\n return new Path(join.apply(null, arguments));\n}", "function makeUrl() {\n let args = Array.from(arguments);\n return args.reduce(function (acc, cur) {\n return urljoin(acc, cur);\n });\n}", "function genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host +\n (opts.port ? (':' + opts.port) : '') +\n '/' + opts.path + pathDel + path;\n }", "function genUrl(opts, path) {\n\t // If the host already has a path, then we need to have a path delimiter\n\t // Otherwise, the path delimiter is the empty string\n\t var pathDel = !opts.path ? '' : '/';\n\t\n\t // If the host already has a path, then we need to have a path delimiter\n\t // Otherwise, the path delimiter is the empty string\n\t return opts.protocol + '://' + opts.host +\n\t (opts.port ? (':' + opts.port) : '') +\n\t '/' + opts.path + pathDel + path;\n\t}", "function makeurl(path) {\n if (path.indexOf(\"://\") > 0) {\n return path;\n }\n return url + \"/\" + path;\n }", "function genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host + ':' + opts.port + '/' +\n opts.path + pathDel + path;\n}", "function genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host +\n (opts.port ? (':' + opts.port) : '') +\n '/' + opts.path + pathDel + path;\n}", "function genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host +\n (opts.port ? (':' + opts.port) : '') +\n '/' + opts.path + pathDel + path;\n}", "function genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host +\n (opts.port ? (':' + opts.port) : '') +\n '/' + opts.path + pathDel + path;\n}", "function genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host +\n (opts.port ? (':' + opts.port) : '') +\n '/' + opts.path + pathDel + path;\n}", "function genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host +\n (opts.port ? (':' + opts.port) : '') +\n '/' + opts.path + pathDel + path;\n}", "function genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host +\n (opts.port ? (':' + opts.port) : '') +\n '/' + opts.path + pathDel + path;\n}", "function genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host +\n (opts.port ? (':' + opts.port) : '') +\n '/' + opts.path + pathDel + path;\n}", "function genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host +\n (opts.port ? (':' + opts.port) : '') +\n '/' + opts.path + pathDel + path;\n}", "function genUrl(opts, path) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host +\n (opts.port ? (':' + opts.port) : '') +\n '/' + opts.path + pathDel + path;\n}", "buildUrl() {\n let url = this.hostname;\n\n if (this.port !== 80) {\n url += ':' + this.port;\n }\n\n let path = this.path;\n if (path.substring(0, 1) !== '/') {\n path = '/' + path;\n }\n\n url += path;\n\n url = replaceUrlParams(url, this.givenArgs);\n url = url.replace('//', '/');\n url = 'https://' + url;\n return url;\n }", "function makeurl( path ) {\n if (path.indexOf(\"://\") > 0) return path;\n return url + \"/\" + path;\n }", "function urlResolve(...segments){var _path$default;const joinedPath=(_path$default=_path.default).join.apply(_path$default,segments);if(_os.default.platform()===`win32`){return joinedPath.replace(/\\\\/g,`/`);}return joinedPath;}", "function constructURL(params){\n \n delimiter = '/';\n \n url = new Array(domainName, pathToAPI);\n\n if(params.module){\n \n url.push(params.module);\n\n if(params.id && params.datatype){\n \n url.push(params.datatype + params.id);\n \n }\n\n }else throw {code: 400, message: \"No module name\"};\n url.push(\"\");\n return url.join(delimiter);\n \n}", "function generateGetURL(path, data){\n\tvar i = 0;\n\tvar url = base_url + path;\n\tfor (i=0; i<data.length; i++){\n\t\tif (isNaN(data[i]) && data[i].indexOf(\"/\") > 0){\n\t\t\tstep1 = data[i].replace('/','-');\n\t\t\tstep2 = step1.replace('/','-');\n\t\t\tdata[i] = step2;\t\t\t\n\t\t}\n\t\telse if (data[i]==\"\"){\n\t\t\tdata[i] = '-';\n\t\t}\n\t\turl = url + encodeURIComponent(data[i]) + \"/\";\t\t\n\t}\n\turl = url.substring(0, url.length -1);\n\treturn decodeURIComponent(url);\n}", "function _joinAndCanonicalizePath(parts) {\n var path = parts[_ComponentIndex.Path];\n path = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__[\"b\" /* isBlank */])(path) ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n}", "function makeUrl(params)\n{\n var ret = SGL_JS_FRONT_CONTROLLER != ''\n ? SGL_JS_WEBROOT + '/' + SGL_JS_FRONT_CONTROLLER\n : SGL_JS_WEBROOT;\n var moduleName = params.module ? params.module : '';\n var managerName = params.manager ? params.manager : moduleName;\n\n switch (SGL_JS_URL_STRATEGY) {\n\n // make classic URL\n case 'SGL_UrlParser_ClassicStrategy':\n if (ret.charAt(ret.length - 1) != '?') {\n ret = ret + '?';\n }\n ret = ret + 'moduleName=' + escape(moduleName) + '&managerName=' + escape(managerName);\n for (x in params) {\n if (x == 'module' || x == 'manager') {\n continue;\n }\n // add param\n ret = '&' + ret + escape(x) + '=' + escape(params[x]);\n }\n break;\n\n // make default Seagull SEF URL\n default:\n ret = ret + '/' + escape(moduleName) + '/' + escape(managerName) + '/';\n for (x in params) {\n if (x == 'module' || x == 'manager') {\n continue;\n }\n ret = ret + escape(x) + '/' + escape(params[x]) + '/';\n }\n break;\n }\n return ret;\n}", "function _joinAndCanonicalizePath(parts) {\n\t var path = parts[_ComponentIndex.Path];\n\t path = lang_1.isBlank(path) ? '' : _removeDotSegments(path);\n\t parts[_ComponentIndex.Path] = path;\n\t return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n\t}", "getRoutePath () {\n const slashGroupRegex = /\\/{2,}/g\n const slashTrailRegex = /(^\\/)|(\\/$)/g\n const slashValidRegex = /^(\\/)|((\\/[^\\/]+)+)$/\n\n const segments = _.compact(_.flattenDeep(_.toArray(arguments)))\n const isArgumentsValid = segments.length && _.every(segments, s => _.isArray(s) || _.isString(s))\n\n if (!isArgumentsValid) {\n throw new TypeError([\n 'trailpack-router cannot parse the arguments given to Footprints.getRoutePath:',\n segments, 'Argument types not recognized'\n ].join(' '))\n }\n\n const path = '/' + segments.join('/')\n .replace(slashGroupRegex, '/')\n .replace(slashTrailRegex, '')\n\n if (!slashValidRegex.test(path)) {\n throw new RangeError([\n 'trailpack-router produced an invalid route path: ', path,\n 'arguments given:', segments\n ].join(' '))\n }\n\n return path\n }", "function genUrl(opts, path) {\n if (opts.remote) {\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n var pathDel = !opts.path ? '' : '/';\n\n // If the host already has a path, then we need to have a path delimiter\n // Otherwise, the path delimiter is the empty string\n return opts.protocol + '://' + opts.host + ':' + opts.port + '/' +\n opts.path + pathDel + path;\n }\n\n return '/' + path;\n}", "buildPath(path = '') {\n if (path.indexOf('http') === 0) {\n return path;\n }\n\n return this.baseUrl + path;\n }", "function makeUrl() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return args.reduce(function (acc, cur) { return url_join_1[\"default\"](acc, cur); });\n}", "function _joinAndCanonicalizePath(parts){var path=parts[_ComponentIndex.Path];path=path==null?'':_removeDotSegments(path);parts[_ComponentIndex.Path]=path;return _buildFromEncodedParts(parts[_ComponentIndex.Scheme],parts[_ComponentIndex.UserInfo],parts[_ComponentIndex.Domain],parts[_ComponentIndex.Port],path,parts[_ComponentIndex.QueryData],parts[_ComponentIndex.Fragment]);}", "function genPath(){\n var path = ['1'];\n for(var i = 0; i < arguments.length; i++){\n path.push(arguments[i], '1');\n }\n return path;\n}", "buildURL(){\n var url = this._super(...arguments);\n if (url.lastIndexOf('/') !== url.length - 1) {\n url += '/';\n }\n return url;\n }", "function _joinAndCanonicalizePath(parts) {\n var path = parts[_ComponentIndex.Path];\n path = path == null ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n }", "function _joinAndCanonicalizePath(parts) {\n var path = parts[_ComponentIndex.Path];\n path = path == null ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n}", "function _joinAndCanonicalizePath(parts) {\n var path = parts[_ComponentIndex.Path];\n path = path == null ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n}", "function _joinAndCanonicalizePath(parts) {\n var path = parts[_ComponentIndex.Path];\n path = path == null ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n}", "function _joinAndCanonicalizePath(parts) {\n var path = parts[_ComponentIndex.Path];\n path = path == null ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n}", "static stringURIPath(uriobj) {\nvar res;\nres = uriobj.path;\nif (uriobj.query != null) {\nres += \"?\" + uriobj.query;\n}\nreturn res;\n}", "function formatPath(urlobj)\n{\n\tvar path = urlobj.pathname;\n\t\n\tif (urlobj.search !== null)\n\t{\n\t\tpath += urlobj.search;\n\t}\n\t\n\treturn path;\n}", "function buildRoutePath(mountpath, path) {\n return mountpath + utils.prefix(path.replace(/{([^}]+)}/g, ':$1'), '/');\n}", "function buildRoutePath(mountpath, path) {\n return mountpath + Utils.prefix(path.replace(/{([^}]+)}/g, ':$1'), '/');\n}", "function _joinAndCanonicalizePath(parts) {\n let path = parts[_ComponentIndex.Path];\n path = path == null ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n}", "function _joinAndCanonicalizePath(parts) {\n let path = parts[_ComponentIndex.Path];\n path = path == null ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n}", "function _joinAndCanonicalizePath(parts) {\n let path = parts[_ComponentIndex.Path];\n path = path == null ? '' : _removeDotSegments(path);\n parts[_ComponentIndex.Path] = path;\n return _buildFromEncodedParts(parts[_ComponentIndex.Scheme], parts[_ComponentIndex.UserInfo], parts[_ComponentIndex.Domain], parts[_ComponentIndex.Port], path, parts[_ComponentIndex.QueryData], parts[_ComponentIndex.Fragment]);\n}" ]
[ "0.72512805", "0.7178873", "0.7178873", "0.68712044", "0.68696356", "0.6721023", "0.6654717", "0.65425456", "0.644447", "0.6395405", "0.63352627", "0.63270307", "0.628425", "0.62621105", "0.62249243", "0.61872166", "0.6135351", "0.61011547", "0.609315", "0.6084816", "0.6084816", "0.6084816", "0.6084816", "0.6084816", "0.6084816", "0.6084816", "0.6084816", "0.6084816", "0.60714626", "0.60652274", "0.60292745", "0.60241497", "0.6022738", "0.60018986", "0.59460616", "0.5917354", "0.5891541", "0.58683085", "0.5860721", "0.58569187", "0.58515835", "0.5823484", "0.5820711", "0.5795333", "0.5764963", "0.5754601", "0.5754601", "0.5754601", "0.5749633", "0.573909", "0.57340723", "0.57334346", "0.569503", "0.569503", "0.569503" ]
0.6648755
49
The public API for navigating programmatically with a component.
function Redirect(_ref) { var computedMatch = _ref.computedMatch, to = _ref.to, _ref$push = _ref.push, push = _ref$push === void 0 ? false : _ref$push; return React.createElement(context.Consumer, null, function (context) { !context ? false ? 0 : invariant(false) : void 0; var history = context.history, staticContext = context.staticContext; var method = push ? history.push : history.replace; var location = createLocation(computedMatch ? typeof to === "string" ? generatePath(to, computedMatch.params) : _extends({}, to, { pathname: generatePath(to.pathname, computedMatch.params) }) : to); // When rendering in a static context, // set the new location immediately. if (staticContext) { method(location); return null; } return React.createElement(Lifecycle, { onMount: function onMount() { method(location); }, onUpdate: function onUpdate(self, prevProps) { var prevLocation = createLocation(prevProps.to); if (!locationsAreEqual(prevLocation, _extends({}, location, { key: prevLocation.key }))) { method(location); } }, to: to }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "navigateToComponent(event) {\n let contractCode = event.currentTarget.dataset.item;\n // eslint-disable-next-line no-console\n console.log('contractcode:'+contractCode);\n this[NavigationMixin.Navigate]({\n type: 'standard__component',\n attributes: {\n componentName: 'c__alternateEndingModifyPlan' \n },\n state: {\n c__currentContractCode: contractCode\n }\n });\n }", "moveToElement(componentRef, element) {\n element.appendChild(componentRef.location.nativeElement);\n }", "Navigate(string, Variant, Variant, Variant, Variant) {\n\n }", "navigate( prefix ) {\n const {navigateWithId} = this.props;\n const point = this.point;\n return ( ) => navigateWithId( prefix, point );\n }", "navigateToProperty() {\n this[NavigationMixin.Navigate]({\n type: 'standard__recordPage',\n attributes: {\n recordId: this.property.Id,\n objectApiName: 'Rental_Property__c',\n actionName: 'view'\n }\n });\n }", "_scrollTo (params) {\n let selector\n if (params.nodeId) {\n selector = `[data-id=\"${params.nodeId}\"]`\n } else if (params.section) {\n selector = `[data-section=\"${params.section}\"]`\n } else {\n throw new Error('Illegal argument')\n }\n let comp = this.refs.contentPanel.find(selector)\n if (comp) {\n this._scrollElementIntoView(comp.el, true)\n }\n let router = this.context.router\n // ATTENTION: do not change the route when running tests otherwise the test url get's lost\n if (router && !platform.test) {\n router.writeRoute(Object.assign({ viewName: this.props.viewName }, params))\n }\n }", "gotoDetails(){\n const { navigator } = this.props;\n navigator.push({ name: 'PRODUCT_DETAIL'});\n\n }", "onItemClick() {\n this.navigateTo(this.item.path);\n }", "navigate(url) {\n return this.agent.invoke_navigate({ url });\n }", "navigateCmp(objectNAme, recId) {\n this[NavigationMixin.Navigate]({\n type: \"standard__recordPage\",\n attributes: {\n recordId: recId,\n objectApiName: objectNAme, // objectApiName is optional\n actionName: \"view\"\n }\n });\n this.isSpinnerShow = false;\n }", "NavigateTo(path) {\n this.props.push('/' + path);\n }", "function navigate(name, params) {\n navigationRef.current?.navigate(name, params);\n}", "_navigate(method, hoveredItem, lastOpenedContainer) {\n const that = this;\n\n if (!hoveredItem) {\n if (method === '_getNextEnabledChild') {\n if (that._view) {\n that.$.backButton.setAttribute('hover', '');\n that.$.backButton.$.button.setAttribute('hover', '');\n that._focusedViaKeyboard = that.$.backButton;\n }\n else {\n that._hoverViaKeyboard(that._getFirstEnabledChild(lastOpenedContainer));\n }\n }\n else {\n that._hoverViaKeyboard(that._getLastEnabledChild(lastOpenedContainer));\n }\n\n return;\n }\n\n let navigateToChild;\n\n if (method === '_getNextEnabledChild' && hoveredItem === that.$.backButton) {\n navigateToChild = that._getFirstEnabledChild(lastOpenedContainer);\n\n if (navigateToChild) {\n that.$.backButton.removeAttribute('hover');\n that.$.backButton.$.button.removeAttribute('hover');\n }\n else {\n return;\n }\n }\n else if (method === '_getPreviousEnabledChild' && that._view && hoveredItem === that._getFirstEnabledChild(lastOpenedContainer)) {\n that.$.backButton.setAttribute('hover', '');\n that.$.backButton.$.button.setAttribute('hover', '');\n that._focusedViaKeyboard = that.$.backButton;\n hoveredItem.removeAttribute('focus');\n return;\n }\n else {\n navigateToChild = that[method](hoveredItem);\n }\n\n if (navigateToChild) {\n hoveredItem.removeAttribute('focus');\n that._hoverViaKeyboard(navigateToChild);\n }\n }", "getFromComponent(componentName, funcName, args=undefined){\n return this.#components.get(componentName)[funcName](args);\n }", "function navigatingTo(args) {\n page = args.object;\n}", "function navigatingTo(args) {\n /*\n This gets a reference this page’s <Page> UI component. You can\n view the API reference of the Page to see what’s available at\n https://docs.nativescript.org/api-reference/classes/_ui_page_.page.html\n */\n var page = args.object;\n}", "function navigatingTo(args) {\n // Get the event sender\n var page = args.object;\n}", "createAccount() {\n this.props.nav.navigate(\"Create Student User\");\n }", "goToSignup(){\n this.props.navigator.push({\n component: Signup\n });\n }", "function checkComponent(component, props = null) {\n\t\tswitch (component) {\n\t\t\tcase 'Inbox':\n\t\t\t\tchangeCurrentComponent(goTo(Inbox));\n\t\t\t\tbreak;\n\t\t\tcase 'Contacts':\n\t\t\t\tchangeCurrentComponent(goTo(Contacts));\n\t\t\t\tbreak;\n\t\t\tcase 'NewContact':\n\t\t\t\tchangeCurrentComponent(goTo(NewContact, props));\n\t\t\t\tbreak;\n\t\t\tcase 'Settings':\n\t\t\t\tchangeCurrentComponent(goTo(Settings, props));\n\t\t\t\tbreak;\n\t\t\tcase 'Login':\n\t\t\t\tchangeCurrentComponent(goTo(Login));\n\t\t\t\tbreak;\n\t\t\tcase 'Thread':\n\t\t\t\tchangeCurrentComponent(goTo(Thread, props));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tchangeCurrentComponent(goTo(Login));\n\t\t\t\tbreak;\n\t\t}\n\t}", "goToSignup(){\n this.props.navigator.push({\n component: Signup\n });\n }", "navigateToRoute(route, params, options) {\r\n let path = this.generate(route, params);\r\n return this.navigate(path, options);\r\n }", "_navigate(method, focusedItem, lastOpenedContainer) {\n const that = this;\n\n if (!focusedItem) {\n if (method === '_getNextEnabledChild') {\n that._hoverViaKeyboard(that._getFirstEnabledChild(lastOpenedContainer));\n }\n else {\n that._hoverViaKeyboard(that._getLastEnabledChild(lastOpenedContainer));\n }\n\n return;\n }\n\n const navigateToChild = that[method](focusedItem);\n\n if (navigateToChild) {\n focusedItem.$.removeClass('focus');\n focusedItem.removeAttribute('focus');\n\n that._hoverViaKeyboard(navigateToChild);\n }\n }", "openFromComponent(component, config) {\n return this._attach(component, config);\n }", "_navigate (){\n this.props.navigator.push({title: 'Home Screen', index: 0})\n }", "function onNavigationItemTap(args) {\n console.log('onNavigationItemTap');\n const component = args.object;\n const componentRoute = component.route;\n\n frameModule.topmost().navigate({\n moduleName: componentRoute,\n transition: {\n name: \"fade\"\n }\n });\n}", "_navigate (){\n this.props.navigator.push({title: 'Filter Page', index: 3})\n }", "componentDidMount(){\n\t\tthis.pushComponent();\n\t}", "openFindInPage() {\n this.controller.openFindInPage();\n }", "onElementoPressed(elemento){\n\n this.props.navigator.push({\n name: 'Detalles',\n passProps: {elemento: elemento}\n })\n\n }", "static goTo() {\n // to implement on child\n }", "static goPage(params, page) {\n const navigation = NavigationUtil.navigation;\n /*children level router can't jump to parent level router*/\n //const {navigation} = params;\n if (!navigation) {\n console.log('NavigationUtil.navigation can\\'t be null.')\n }\n navigation.navigate(\n page,\n {\n ...params\n }\n );\n }", "handleClick() {\n let conf = {\n type: \"standard__recordPage\", // type defines what type of PageReference it is, whether it is a record page,an lightning app, or login page or any other thing \n attributes: { // attribute is used to define the properties of the configuration file\n recordId: \"00B5g00000EXixUEAT\",\n objectApiName: \"Lead\",\n actionName: \"view\"\n }\n };\n\n this[NavigationMixin.Navigate](conf);\n }", "function navigatingTo(args) {\n var page = args.object;\n var vm = observable_1.fromObject({ device: new device_view_model_1.Device() });\n page.bindingContext = vm;\n}", "navigate(route){\n let state = null;\n\n switch(route){\n case 'superheroes':\n state = new App.states.SuperHeroes();\n break;\n }\n\n this.container.innerHTML = '';\n this.container.appendChild( state.render() );\n if (route === 'superheroes') {\n document.getElementById('first').onclick = () => state.firstPage()\n document.getElementById('next').onclick = () => state.nextPage()\n document.getElementById('previous').onclick = () => state.previousPage()\n document.getElementById('last').onclick = () => state.lastPage()\n document.getElementById('search').onclick = () => state.findHeroes()\n document.addEventListener('click', (e) => {\n if(e.target.tagName === 'TD') {\n const id = e.target.parentElement.getAttribute('data-ref')\n document.getElementById('modal-'+id).checked = true\n state.loadDetails(id)\n }\n })\n state.load()\n }\n }", "['click .method-container a'](e, $el) {\n\t\tToc.goToHash($el.attr('href'));\n\t}", "handleClick() {\n this[NavigationMixin.Navigate]({\n type: \"standard__recordPage\",\n attributes: {\n recordId: this.record.Id,\n actionName: \"view\"\n }\n });\n }", "navigateTo(pageId) {\r\n window.location.href = `#${pageId}`;\r\n }", "nav_helper_view(data) {\n\t\tp11.nav_helper_view(data);\n\t\tutil.elementClickable(p11.nextBtn)\n\t}", "async gotoMenuPage(testController) {\n await testController.click('#menu-page');\n }", "onDriveClick() {\n this.navigateTo(this.drive.root);\n }", "handleGoToSite(apt){\n // console.log('handleGoToSite: ', this)\n // console.log('handleGoToSite apt: ', apt)\n var url = `https://www.airbnb.com/rooms/${apt}`\n this.props.navigator.push({\n title: 'Web View',\n component: Web,\n passProps: {\n id: apt,\n url: url\n }\n })\n }", "async gotoMyVendorPage(testController) {\n await testController.click('#my-vendor-page');\n }", "navigateHyperlink() {\n let fieldBegin = this.getHyperlinkField();\n if (fieldBegin) {\n this.fireRequestNavigate(fieldBegin);\n }\n }", "async function navigateToCommand() {\r\n const page = agent.parameters.page\r\n\r\n if (page === \"home\") {\r\n await navigateTo('/')\r\n } else if (page === \"cart\") {\r\n if (token === \"\" || typeof token === 'undefined') {\r\n addAgentMessage(\"Sorry I cannot perform that. Please login first!\")\r\n return;\r\n }\r\n await navigateTo('/cart')\r\n }\r\n\r\n addAgentMessage('Okay!')\r\n }", "viewThisInvoice() { FlowRouter.go('invoice', { invoiceId: this.props.invoice._id } ) }", "function navigatingTo(args) {\n var page = args.object;\n page.bindingContext = new main_view_model_1.ViewModel();\n}", "function navigatingTo(args) {\n var page = args.object;\n var vm = new observable_1.Observable();\n var items = new observable_array_1.ObservableArray(observable_1.fromObject({ index: 0, text: \"Option 1\", selected: true }), observable_1.fromObject({ index: 1, text: \"Option 2\", selected: false }), observable_1.fromObject({ index: 2, text: \"Option 3\", selected: false }), observable_1.fromObject({ index: 3, text: \"Option 4\", selected: false }), observable_1.fromObject({ index: 4, text: \"Option 4\", selected: true }), observable_1.fromObject({ index: 5, text: \"Option 4\", selected: false }));\n vm.set(\"items\", items);\n page.bindingContext = vm;\n}", "function navigateTo(activeItem) {\n\n var text = $(activeItem).text();\n var path = $(activeItem).data(\"path\");\n var children = parseInt($(activeItem).data(\"children\"));\n\n if (children > 0) {\n\n path = path + \"\\\\\";\n $(idSearchBoxJQ).val(path);\n populateResults();\n }\n\n }", "async navigateTo() {\n await this.driver.get(this.pageUrl);\n await this.driver.wait(\n until.elementLocated(By.className(this.pageLocator)),\n this.defaultTimeout\n );\n }", "async navigateTo() {\n await this.driver.get(this.pageUrl);\n await this.driver.wait(\n until.elementLocated(By.css(`div[data-pid=${this.pageLocator}]`)),\n this.defaultTimeout\n );\n }", "navigateToLabPage() {\n return this._navigate(this.buttons.lab, 'labPage.js');\n }", "redirct(id)\n{\n this[NavigationMixin.Navigate]({\n type: 'standard__recordPage',\n attributes: {\n recordId: id,\n // objectApiName: 'Opportunity', // objectApiName is optional\n actionName: 'view'\n }\n });\n}", "navigateTo(path) {\n this.props.history.push(path);\n }", "navigateTo(date) {\n if (this.isOpen()) {\n this._cRef.instance.navigateTo(date);\n }\n }", "_navigateNext() {\n this._navigate(this.next.id, 'endpoint');\n }", "redirect() {\n const { navigate } = this.props.navigation\n navigate('MyWorkout')\n }", "static goToHome() {\n browser.refresh();\n new MenuBar().clickHome();\n }", "function NavBar_Item_Click(event)\n{\n\t//get html\n\tvar html = Browser_GetEventSourceElement(event);\n\t//this a sub component?\n\tif (html.Style_Parent)\n\t{\n\t\t//use the parent\n\t\thtml = html.Style_Parent;\n\t}\n\t//valid?\n\tif (html && html.Action_Parent && !html.IsSelected || __DESIGNER_CONTROLLER)\n\t{\n\t\t//get the data\n\t\tvar data = [\"\" + html.Action_Index];\n\t\t//trigger the event\n\t\tvar result = __SIMULATOR.ProcessEvent(new Event_Event(html.Action_Parent, __NEMESIS_EVENT_SELECT, data));\n\t\t//not blocking it?\n\t\tif (!result.Block)\n\t\t{\n\t\t\t//not an action?\n\t\t\tif (!result.AdvanceToStateId)\n\t\t\t{\n\t\t\t\t//notify that we have changed data\n\t\t\t\t__SIMULATOR.NotifyLogEvent({ Type: __LOG_USER_DATA, Name: html.Action_Parent.GetDesignerName(), Data: data });\n\t\t\t}\n\t\t\t//update selection\n\t\t\thtml.Action_Parent.Properties[__NEMESIS_PROPERTY_SELECTION] = html.Action_Index;\n\t\t\t//and update its state\n\t\t\tNavBar_UpdateSelection(html.Action_Parent.HTML, html.Action_Parent);\n\t\t}\n\t}\n}", "navigateToRequestTvShow() {\n console.log('Navegar a solicitar nueva serie');\n this.props.navigator.push({\n name: 'requestTvShow',\n passProps: {\n searchText: this.state.searchText\n }\n });\n }", "visitElementClicked() {\r\n this.props.visitListClick(this.props.index);\r\n }", "_navigate(routeName, props = null){\n\t this.props.navigator.push({\n\t name: routeName,\n\t passProps: { ...props }\n\t })\n\t}", "function Component() {\n return this; // this is needed in Edge !!!\n } // Component is lazily setup because it needs", "_navigateList(){\n this.props.navigator.push({\n name: 'MyListView', // Matches route.name\n })\n }", "showProjectChooser() {\n return navigate(\"/\")\n }", "navigate(fragment, options) {\r\n if (!this.isConfigured && this.parent) {\r\n return this.parent.navigate(fragment, options);\r\n }\r\n this.isExplicitNavigation = true;\r\n return this.history.navigate(_resolveUrl(fragment, this.baseUrl, this.history._hasPushState), options);\r\n }", "navigate(route) {\n return this.props.navigation.dispatch(\n NavigationActions.navigate({ routeName: route })\n );\n }", "async gotoManageVendorPage(testController) {\n await testController.click('#manage-vendor-page');\n }", "function navigatingTo(args) {\n var page = args.object;\n page.bindingContext = new RockModel_1.RockModel(page);\n}", "navigatPageMonCompte() {\n this.props.navigation.navigate('MonCompte');\n }", "clickOnServicesLink() {\n this.servicesLink.click();\n }", "goToView(viewName, options, variable) {\n options = options || {};\n const pageName = options.pageName;\n const transition = options.transition || '';\n const $event = options.$event;\n const activePage = this.app.activePage;\n const prefabName = variable && variable._context && variable._context.prefabName;\n // Check if app is Prefab\n if (this.app.isPrefabType) {\n this.goToElementView($(parentSelector).find('[name=\"' + viewName + '\"]'), viewName, pageName, variable);\n }\n else {\n // checking if the element is present in the page or not, if no show an error toaster\n // if yes check if it is inside a partial/prefab in the page and then highlight the respective element\n // else goto the page in which the element exists and highlight the element\n if (pageName !== activePage.activePageName && !prefabName) {\n if (this.isPartialWithNameExists(pageName)) {\n this.goToElementView($('[partialcontainer][content=\"' + pageName + '\"]').find('[name=\"' + viewName + '\"]'), viewName, pageName, variable);\n }\n else {\n // Todo[Shubham]: Make an API call to get all pages and check if the page name\n // is a page and then do this call else show an error as:\n // this.app.notifyApp(CONSTANTS.WIDGET_DOESNT_EXIST, 'error');\n this.goToPage(pageName, {\n viewName: viewName,\n $event: $event,\n transition: transition,\n urlParams: options.urlParams\n });\n // subscribe to an event named pageReady which notifies this subscriber\n // when all widgets in page are loaded i.e when page is ready\n const pageReadySubscriber = this.app.subscribe('pageReady', (page) => {\n this.goToElementView($(parentSelector).find('[name=\"' + viewName + '\"]'), viewName, pageName, variable);\n pageReadySubscriber();\n });\n }\n }\n else if (prefabName && this.isPrefabWithNameExists(prefabName)) {\n this.goToElementView($('[prefabName=\"' + prefabName + '\"]').find('[name=\"' + viewName + '\"]'), viewName, pageName, variable);\n }\n else if (!pageName || pageName === activePage.activePageName) {\n this.goToElementView($(parentSelector).find('[name=\"' + viewName + '\"]'), viewName, pageName, variable);\n }\n else {\n this.app.notifyApp(CONSTANTS.WIDGET_DOESNT_EXIST, 'error');\n }\n }\n }", "getComponent() {\n return this.querySelector(\"div\");\n }", "scrollIntoViewIfNeeded(params) {\n if (this._isString(params))\n params = { selector: params }\n return this._scrollIntoViewIfNeeded(this.currentTabDebuggeeId, params.selector, params.hrefRegex)\n }", "async gotoAddMenuPage(testController) {\n await testController.click('#add-menu-food-page');\n }", "onRender () {\n console.log(this.component);\n if(undefined !== this.component) {\n this.el.querySelector(`[data-id=\"${this.component}\"]`).classList.add(\"active\");\n }\n\n var Navigation = new NavigationView();\n App.getNavigationContainer().show(Navigation);\n Navigation.setItemAsActive(\"components\");\n this.showComponent(this.component);\n\n }", "navigateToClinicPage() {\n return this._navigate(this.buttons.clinic, 'clinicPage.js');\n }", "function NavNavigate(/**string*/ page, /**string*/ company)\r\n{\r\n\tSeS(\"G_AddressBar\").DoClick();\r\n\tvar addressEdit = SeS(\"G_AddressEdit\");\r\n\tif (!company)\r\n\t{\r\n\t\tvar currentPage = \"\" + addressEdit.GetText();\r\n\t\tcompany = currentPage.split(\"/\")[0];\r\n\t}\r\n\taddressEdit.DoSetText(company + \"/\" + page);\r\n\taddressEdit.DoSendKeys(\"{ENTER}\");\r\n}", "next() {\n const that = this;\n\n that.navigateTo(that.pageIndex + 1);\n }", "_levelOneNavigate(method, focusedItem, lastOpenedContainer) {\n const that = this;\n\n if (!focusedItem) {\n const enabledChild = that[method](lastOpenedContainer);\n\n if (enabledChild) {\n that._hoverViaKeyboard(enabledChild);\n }\n }\n else {\n if (method === '_getLastEnabledChild') {\n that._navigate('_getPreviousEnabledChild', focusedItem, lastOpenedContainer);\n }\n else {\n that._navigate('_getNextEnabledChild', focusedItem, lastOpenedContainer);\n }\n }\n }", "_onSelect(data) { \n this.props.navigator.push({title: 'Details Page', index: 4, \n passProps : { data: data}}) \n }", "navigate() {\n this.props.history.push('/contact');\n }", "homeClicked() {\n this.props.navChanged(\"Home\");\n }", "function goToWidget(id) {\n document.getElementById(id).scrollIntoView({\n behavior: 'smooth'\n });\n }", "goTo(route) {\n this.props.history.replace(`/${route}`)\n }", "@api invoke() {\n console.log(\"Hi, I'm an action. INVOKE HEADLESS\");\n let event = new ShowToastEvent({\n title: 'I am a headless action!',\n message: 'Hi there! Starting...',\n });\n this.dispatchEvent(event);\n // this[NavigationMixin.Navigate]({\n // type: 'standard__objectPage',\n // attributes: {\n // objectApiName: 'Contact',\n // actionName: 'home',\n // },\n // });\n }", "activeComponent(){ \n switch(this.nav.state.activeComponent){\n case \"Enter\":\n return(<Enter/>)\n case \"Login\":\n return(<Login/>)\n default:\n if(typeof this.props.component != 'undefined' && this.props.component.lenght>0){\n Alerts.show(\"Bad component \" + this.props.component)\n }\n if(window.location.hash.length==0){ //to avoid excess mount of the default component\n return (<Enter/>)\n }\n }\n\n }", "static openContactPage() {\n browser.click(HomePage.elements.contactpagelink)\n }", "function MenuItem(props) {\n /*\n * Store our anchorTarget in state\n * We do not set it here, preferring to wait for after the component\n * is mounted to avoid any errors\n */\n\n /*\n * Where all the magic happens -- scrollIntoView on click\n */\n const handleClick = event => {\n event.preventDefault();\n props.target.current.scrollIntoView({\n behavior: \"smooth\",\n block: \"start\"\n });\n };\n\n /*\n * Return the MenuItem as JSX\n * Remember to set your ariaLabel for accessability!\n */\n return (\n <li style={{ color: \"white\" }} className=\"anchors\">\n <a\n href={`#${props.name}`}\n onClick={handleClick}\n ariaLabel={`Scroll to ${props.name}`}\n >\n\n <div className=\"anchors-button\"><img alt=\"\" src={process.env.PUBLIC_URL + \"/assets/navButtonBlack.svg\"} /><span style={{position: 'absolute'}}>{props.name}</span></div>\n </a>\n </li>\n );\n}", "onClick(button) {\n this.setState({\n page: button\n });\n document.getElementById(button).scrollIntoView({\n behavior: \"smooth\",\n block: \"nearest\"\n });\n }", "_renderNewRootComponent(/* instance, ... */) { }", "goToHomePage() {\r\n Actions.jump('selectMethod');\r\n }", "navigateToDocs() {\n this.props.enableDocsList();\n }", "goTo (x, y) {\n\t\tthis.props.changeThatView(x,y)\n\t}", "onNavigate (routeData) {\n this.channel.trigger('before:navigate', routeData.linked)\n\n routeData.linked.show(routeData.params)\n .then(() => {\n this.channel.trigger('navigate', routeData.linked)\n })\n .catch((error) => {\n console.error(error)\n this.channel.trigger('error')\n })\n }", "handleClick() {\n\t\tthis.props.changePage(\"aboutSplunk\");\n\t}", "async gotoAddVendorPage(testController) {\n await testController.click('#add-vendor-page');\n }", "pageScrollTo(){\n let element = document.getElementById( App.current_page );\n \n //scroll to the particular section of the page.\n if( element ){\n element.scrollIntoView({behavior: 'smooth'});\n }\n }", "componentDidMount() {\n this.gotoPage(this.state.currentPage);\n }", "getCurrentComponent(){\n return this.currentComponent;\n }", "function GoToProductDetail(e) {\n Ti.API.info(\"inside GoToProductDetails\");\n Ti.API.info(\"on click\" + e);\n Ti.API.info(\"on click stringify\" + JSON.stringify(e));\n Ti.API.info(e.section.getItemAt(e.itemIndex));\n Ti.API.info(e.section.getItemAt(e.itemIndex).properties.Mid);\n var ProductDetail = Alloy.createController('ProductDetail', e.section.getItemAt(e.itemIndex).properties.Mid, access_token).getView();\n ProductDetail.open();\n\n}" ]
[ "0.61909544", "0.58901256", "0.5834737", "0.5770242", "0.56208116", "0.5563699", "0.55466664", "0.55171984", "0.5478709", "0.54625344", "0.5461492", "0.5452722", "0.54364544", "0.5411622", "0.54054534", "0.5397201", "0.5391978", "0.53629184", "0.5354345", "0.53436154", "0.534234", "0.533602", "0.5330076", "0.532159", "0.5316912", "0.5299056", "0.5293208", "0.528343", "0.52749586", "0.526225", "0.5252324", "0.5244987", "0.52439183", "0.5230936", "0.5227601", "0.5227037", "0.52261096", "0.5217641", "0.52117836", "0.51991177", "0.51901203", "0.51815116", "0.51796746", "0.5164262", "0.51623464", "0.5147075", "0.51467216", "0.51289845", "0.5125727", "0.511222", "0.50846237", "0.508245", "0.50811285", "0.50700635", "0.5069828", "0.5066224", "0.5048878", "0.50360066", "0.5033327", "0.50166255", "0.5015376", "0.5015362", "0.50110775", "0.50041026", "0.49971083", "0.4996851", "0.4996715", "0.49940476", "0.4989705", "0.4980675", "0.49753004", "0.4974242", "0.49708638", "0.49674794", "0.49565142", "0.49442884", "0.49408984", "0.4935282", "0.49269357", "0.49244976", "0.49221638", "0.4921551", "0.49192473", "0.49168673", "0.4905139", "0.49034983", "0.4903083", "0.49030235", "0.48992833", "0.48980623", "0.4888592", "0.48869553", "0.48867783", "0.48854876", "0.48801118", "0.48794448", "0.48696932", "0.4867998", "0.4867062", "0.48574993", "0.48563132" ]
0.0
-1
Public API for matching a URL pathname to a path.
function matchPath(pathname, options) { if (options === void 0) { options = {}; } if (typeof options === "string" || Array.isArray(options)) { options = { path: options }; } var _options = options, path = _options.path, _options$exact = _options.exact, exact = _options$exact === void 0 ? false : _options$exact, _options$strict = _options.strict, strict = _options$strict === void 0 ? false : _options$strict, _options$sensitive = _options.sensitive, sensitive = _options$sensitive === void 0 ? false : _options$sensitive; var paths = [].concat(path); return paths.reduce(function (matched, path) { if (!path && path !== "") return null; if (matched) return matched; var _compilePath = compilePath$1(path, { end: exact, strict: strict, sensitive: sensitive }), regexp = _compilePath.regexp, keys = _compilePath.keys; var match = regexp.exec(pathname); if (!match) return null; var url = match[0], values = match.slice(1); var isExact = pathname === url; if (exact && !isExact) return null; return { path: path, // the path used to match url: path === "/" && url === "" ? "/" : url, // the matched portion of the URL isExact: isExact, // whether or not we matched exactly params: keys.reduce(function (memo, key, index) { memo[key.name] = values[index]; return memo; }, {}) }; }, null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function matchPath(pathname,options){if(options===void 0){options={};}if(typeof options===\"string\")options={path:options};var _options=options,path=_options.path,_options$exact=_options.exact,exact=_options$exact===void 0?false:_options$exact,_options$strict=_options.strict,strict=_options$strict===void 0?false:_options$strict,_options$sensitive=_options.sensitive,sensitive=_options$sensitive===void 0?false:_options$sensitive;var paths=[].concat(path);return paths.reduce(function(matched,path){if(matched)return matched;var _compilePath=compilePath$1(path,{end:exact,strict:strict,sensitive:sensitive}),regexp=_compilePath.regexp,keys=_compilePath.keys;var match=regexp.exec(pathname);if(!match)return null;var url=match[0],values=match.slice(1);var isExact=pathname===url;if(exact&&!isExact)return null;return{path:path,// the path used to match\nurl:path===\"/\"&&url===\"\"?\"/\":url,// the matched portion of the URL\nisExact:isExact,// whether or not we matched exactly\nparams:keys.reduce(function(memo,key,index){memo[key.name]=values[index];return memo;},{})};},null);}", "function matchPath(pathname, options) {\n if (options === void 0) {\n options = {};\n }\n\n if (typeof options === \"string\") options = {\n path: options\n };\n var _options = options,\n path = _options.path,\n _options$exact = _options.exact,\n exact = _options$exact === void 0 ? false : _options$exact,\n _options$strict = _options.strict,\n strict = _options$strict === void 0 ? false : _options$strict,\n _options$sensitive = _options.sensitive,\n sensitive = _options$sensitive === void 0 ? false : _options$sensitive;\n var paths = [].concat(path);\n return paths.reduce(function (matched, path) {\n if (!path) return null;\n if (matched) return matched;\n\n var _compilePath = compilePath$1(path, {\n end: exact,\n strict: strict,\n sensitive: sensitive\n }),\n regexp = _compilePath.regexp,\n keys = _compilePath.keys;\n\n var match = regexp.exec(pathname);\n if (!match) return null;\n var url = match[0],\n values = match.slice(1);\n var isExact = pathname === url;\n if (exact && !isExact) return null;\n return {\n path: path,\n // the path used to match\n url: path === \"/\" && url === \"\" ? \"/\" : url,\n // the matched portion of the URL\n isExact: isExact,\n // whether or not we matched exactly\n params: keys.reduce(function (memo, key, index$$1) {\n memo[key.name] = values[index$$1];\n return memo;\n }, {})\n };\n }, null);\n}", "function matchPath(pathname, options) {\n if (options === void 0) {\n options = {};\n }\n\n if (typeof options === \"string\") options = {\n path: options\n };\n var _options = options,\n path = _options.path,\n _options$exact = _options.exact,\n exact = _options$exact === void 0 ? false : _options$exact,\n _options$strict = _options.strict,\n strict = _options$strict === void 0 ? false : _options$strict,\n _options$sensitive = _options.sensitive,\n sensitive = _options$sensitive === void 0 ? false : _options$sensitive;\n var paths = [].concat(path);\n return paths.reduce(function (matched, path) {\n if (!path) return null;\n if (matched) return matched;\n\n var _compilePath = compilePath$1(path, {\n end: exact,\n strict: strict,\n sensitive: sensitive\n }),\n regexp = _compilePath.regexp,\n keys = _compilePath.keys;\n\n var match = regexp.exec(pathname);\n if (!match) return null;\n var url = match[0],\n values = match.slice(1);\n var isExact = pathname === url;\n if (exact && !isExact) return null;\n return {\n path: path,\n // the path used to match\n url: path === \"/\" && url === \"\" ? \"/\" : url,\n // the matched portion of the URL\n isExact: isExact,\n // whether or not we matched exactly\n params: keys.reduce(function (memo, key, index) {\n memo[key.name] = values[index];\n return memo;\n }, {})\n };\n }, null);\n}", "function matchPath(pathname, options) {\n if (options === void 0) {\n options = {};\n }\n\n if (typeof options === \"string\") options = {\n path: options\n };\n var _options = options,\n path = _options.path,\n _options$exact = _options.exact,\n exact = _options$exact === void 0 ? false : _options$exact,\n _options$strict = _options.strict,\n strict = _options$strict === void 0 ? false : _options$strict,\n _options$sensitive = _options.sensitive,\n sensitive = _options$sensitive === void 0 ? false : _options$sensitive;\n var paths = [].concat(path);\n return paths.reduce(function (matched, path) {\n if (!path) return null;\n if (matched) return matched;\n\n var _compilePath = compilePath$1(path, {\n end: exact,\n strict: strict,\n sensitive: sensitive\n }),\n regexp = _compilePath.regexp,\n keys = _compilePath.keys;\n\n var match = regexp.exec(pathname);\n if (!match) return null;\n var url = match[0],\n values = match.slice(1);\n var isExact = pathname === url;\n if (exact && !isExact) return null;\n return {\n path: path,\n // the path used to match\n url: path === \"/\" && url === \"\" ? \"/\" : url,\n // the matched portion of the URL\n isExact: isExact,\n // whether or not we matched exactly\n params: keys.reduce(function (memo, key, index) {\n memo[key.name] = values[index];\n return memo;\n }, {})\n };\n }, null);\n}", "function matchPath(pathname, options) {\n if (options === void 0) {\n options = {};\n }\n\n if (typeof options === \"string\") options = {\n path: options\n };\n var _options = options,\n path = _options.path,\n _options$exact = _options.exact,\n exact = _options$exact === void 0 ? false : _options$exact,\n _options$strict = _options.strict,\n strict = _options$strict === void 0 ? false : _options$strict,\n _options$sensitive = _options.sensitive,\n sensitive = _options$sensitive === void 0 ? false : _options$sensitive;\n var paths = [].concat(path);\n return paths.reduce(function (matched, path) {\n if (!path) return null;\n if (matched) return matched;\n\n var _compilePath = compilePath$1(path, {\n end: exact,\n strict: strict,\n sensitive: sensitive\n }),\n regexp = _compilePath.regexp,\n keys = _compilePath.keys;\n\n var match = regexp.exec(pathname);\n if (!match) return null;\n var url = match[0],\n values = match.slice(1);\n var isExact = pathname === url;\n if (exact && !isExact) return null;\n return {\n path: path,\n // the path used to match\n url: path === \"/\" && url === \"\" ? \"/\" : url,\n // the matched portion of the URL\n isExact: isExact,\n // whether or not we matched exactly\n params: keys.reduce(function (memo, key, index) {\n memo[key.name] = values[index];\n return memo;\n }, {})\n };\n }, null);\n}", "function matchPath(pathname, options) {\n if (options === void 0) {\n options = {};\n }\n\n if (typeof options === \"string\") options = {\n path: options\n };\n var _options = options,\n path = _options.path,\n _options$exact = _options.exact,\n exact = _options$exact === void 0 ? false : _options$exact,\n _options$strict = _options.strict,\n strict = _options$strict === void 0 ? false : _options$strict,\n _options$sensitive = _options.sensitive,\n sensitive = _options$sensitive === void 0 ? false : _options$sensitive;\n var paths = [].concat(path);\n return paths.reduce(function (matched, path) {\n if (!path) return null;\n if (matched) return matched;\n\n var _compilePath = compilePath$1(path, {\n end: exact,\n strict: strict,\n sensitive: sensitive\n }),\n regexp = _compilePath.regexp,\n keys = _compilePath.keys;\n\n var match = regexp.exec(pathname);\n if (!match) return null;\n var url = match[0],\n values = match.slice(1);\n var isExact = pathname === url;\n if (exact && !isExact) return null;\n return {\n path: path,\n // the path used to match\n url: path === \"/\" && url === \"\" ? \"/\" : url,\n // the matched portion of the URL\n isExact: isExact,\n // whether or not we matched exactly\n params: keys.reduce(function (memo, key, index) {\n memo[key.name] = values[index];\n return memo;\n }, {})\n };\n }, null);\n}", "function matchPath(pathname, options) {\n if (options === void 0) {\n options = {};\n }\n\n if (typeof options === \"string\") options = {\n path: options\n };\n var _options = options,\n path = _options.path,\n _options$exact = _options.exact,\n exact = _options$exact === void 0 ? false : _options$exact,\n _options$strict = _options.strict,\n strict = _options$strict === void 0 ? false : _options$strict,\n _options$sensitive = _options.sensitive,\n sensitive = _options$sensitive === void 0 ? false : _options$sensitive;\n var paths = [].concat(path);\n return paths.reduce(function (matched, path) {\n if (!path) return null;\n if (matched) return matched;\n\n var _compilePath = compilePath$1(path, {\n end: exact,\n strict: strict,\n sensitive: sensitive\n }),\n regexp = _compilePath.regexp,\n keys = _compilePath.keys;\n\n var match = regexp.exec(pathname);\n if (!match) return null;\n var url = match[0],\n values = match.slice(1);\n var isExact = pathname === url;\n if (exact && !isExact) return null;\n return {\n path: path,\n // the path used to match\n url: path === \"/\" && url === \"\" ? \"/\" : url,\n // the matched portion of the URL\n isExact: isExact,\n // whether or not we matched exactly\n params: keys.reduce(function (memo, key, index) {\n memo[key.name] = values[index];\n return memo;\n }, {})\n };\n }, null);\n}", "function matchPath(pathname, options) {\n if (options === void 0) {\n options = {};\n }\n\n if (typeof options === \"string\") options = {\n path: options\n };\n var _options = options,\n path = _options.path,\n _options$exact = _options.exact,\n exact = _options$exact === void 0 ? false : _options$exact,\n _options$strict = _options.strict,\n strict = _options$strict === void 0 ? false : _options$strict,\n _options$sensitive = _options.sensitive,\n sensitive = _options$sensitive === void 0 ? false : _options$sensitive;\n var paths = [].concat(path);\n return paths.reduce(function (matched, path) {\n if (!path) return null;\n if (matched) return matched;\n\n var _compilePath = compilePath$1(path, {\n end: exact,\n strict: strict,\n sensitive: sensitive\n }),\n regexp = _compilePath.regexp,\n keys = _compilePath.keys;\n\n var match = regexp.exec(pathname);\n if (!match) return null;\n var url = match[0],\n values = match.slice(1);\n var isExact = pathname === url;\n if (exact && !isExact) return null;\n return {\n path: path,\n // the path used to match\n url: path === \"/\" && url === \"\" ? \"/\" : url,\n // the matched portion of the URL\n isExact: isExact,\n // whether or not we matched exactly\n params: keys.reduce(function (memo, key, index) {\n memo[key.name] = values[index];\n return memo;\n }, {})\n };\n }, null);\n}", "function matchPath(pathname, options) {\n if (options === void 0) {\n options = {};\n }\n\n if (typeof options === \"string\") options = {\n path: options\n };\n var _options = options,\n path = _options.path,\n _options$exact = _options.exact,\n exact = _options$exact === void 0 ? false : _options$exact,\n _options$strict = _options.strict,\n strict = _options$strict === void 0 ? false : _options$strict,\n _options$sensitive = _options.sensitive,\n sensitive = _options$sensitive === void 0 ? false : _options$sensitive;\n var paths = [].concat(path);\n return paths.reduce(function (matched, path) {\n if (!path) return null;\n if (matched) return matched;\n\n var _compilePath = compilePath$1(path, {\n end: exact,\n strict: strict,\n sensitive: sensitive\n }),\n regexp = _compilePath.regexp,\n keys = _compilePath.keys;\n\n var match = regexp.exec(pathname);\n if (!match) return null;\n var url = match[0],\n values = match.slice(1);\n var isExact = pathname === url;\n if (exact && !isExact) return null;\n return {\n path: path,\n // the path used to match\n url: path === \"/\" && url === \"\" ? \"/\" : url,\n // the matched portion of the URL\n isExact: isExact,\n // whether or not we matched exactly\n params: keys.reduce(function (memo, key, index) {\n memo[key.name] = values[index];\n return memo;\n }, {})\n };\n }, null);\n}", "function matchPath(pathname, options) {\n if (options === void 0) {\n options = {};\n }\n\n if (typeof options === 'string' || Array.isArray(options)) {\n options = {\n path: options,\n };\n }\n\n var _options = options,\n path = _options.path,\n _options$exact = _options.exact,\n exact = _options$exact === void 0 ? false : _options$exact,\n _options$strict = _options.strict,\n strict = _options$strict === void 0 ? false : _options$strict,\n _options$sensitive = _options.sensitive,\n sensitive =\n _options$sensitive === void 0 ? false : _options$sensitive;\n var paths = [].concat(path);\n return paths.reduce(function(matched, path) {\n if (!path && path !== '') return null;\n if (matched) return matched;\n\n var _compilePath = compilePath$1(path, {\n end: exact,\n strict: strict,\n sensitive: sensitive,\n }),\n regexp = _compilePath.regexp,\n keys = _compilePath.keys;\n\n var match = regexp.exec(pathname);\n if (!match) return null;\n var url = match[0],\n values = match.slice(1);\n var isExact = pathname === url;\n if (exact && !isExact) return null;\n return {\n path: path,\n // the path used to match\n url: path === '/' && url === '' ? '/' : url,\n // the matched portion of the URL\n isExact: isExact,\n // whether or not we matched exactly\n params: keys.reduce(function(memo, key, index) {\n memo[key.name] = values[index];\n return memo;\n }, {}),\n };\n }, null);\n }", "function matchPath(pathname, options) {\n if (options === void 0) {\n options = {};\n }\n if (typeof options === \"string\" || Array.isArray(options)) {\n options = {\n path: options\n };\n }\n var _options = options,\n path = _options.path,\n _options$exact = _options.exact,\n exact = _options$exact === void 0 ? false : _options$exact,\n _options$strict = _options.strict,\n strict = _options$strict === void 0 ? false : _options$strict,\n _options$sensitive = _options.sensitive,\n sensitive = _options$sensitive === void 0 ? false : _options$sensitive;\n var paths = [].concat(path);\n return paths.reduce(function (matched, path) {\n if (!path && path !== \"\") return null;\n if (matched) return matched;\n var _compilePath = compilePath$1(path, {\n end: exact,\n strict: strict,\n sensitive: sensitive\n }),\n regexp = _compilePath.regexp,\n keys = _compilePath.keys;\n var match = regexp.exec(pathname);\n if (!match) return null;\n var url = match[0],\n values = match.slice(1);\n var isExact = pathname === url;\n if (exact && !isExact) return null;\n return {\n path: path,\n // the path used to match\n url: path === \"/\" && url === \"\" ? \"/\" : url,\n // the matched portion of the URL\n isExact: isExact,\n // whether or not we matched exactly\n params: keys.reduce(function (memo, key, index) {\n memo[key.name] = values[index];\n return memo;\n }, {})\n };\n }, null);\n}", "function matchPath(pathname, options) {\n if (options === void 0) {\n options = {};\n }\n\n if (typeof options === \"string\") options = {\n path: options\n };\n var _options = options,\n path = _options.path,\n _options$exact = _options.exact,\n exact = _options$exact === void 0 ? false : _options$exact,\n _options$strict = _options.strict,\n strict = _options$strict === void 0 ? false : _options$strict,\n _options$sensitive = _options.sensitive,\n sensitive = _options$sensitive === void 0 ? false : _options$sensitive;\n var paths = [].concat(path);\n return paths.reduce(function (matched, path) {\n if (matched) return matched;\n\n var _compilePath = compilePath$1(path, {\n end: exact,\n strict: strict,\n sensitive: sensitive\n }),\n regexp = _compilePath.regexp,\n keys = _compilePath.keys;\n\n var match = regexp.exec(pathname);\n if (!match) return null;\n var url = match[0],\n values = match.slice(1);\n var isExact = pathname === url;\n if (exact && !isExact) return null;\n return {\n path: path,\n // the path used to match\n url: path === \"/\" && url === \"\" ? \"/\" : url,\n // the matched portion of the URL\n isExact: isExact,\n // whether or not we matched exactly\n params: keys.reduce(function (memo, key, index) {\n memo[key.name] = values[index];\n return memo;\n }, {})\n };\n }, null);\n}", "function matchPath(pathname, options) {\n if (options === void 0) {\n options = {};\n }\n\n if (typeof options === \"string\") options = {\n path: options\n };\n var _options = options,\n path = _options.path,\n _options$exact = _options.exact,\n exact = _options$exact === void 0 ? false : _options$exact,\n _options$strict = _options.strict,\n strict = _options$strict === void 0 ? false : _options$strict,\n _options$sensitive = _options.sensitive,\n sensitive = _options$sensitive === void 0 ? false : _options$sensitive;\n var paths = [].concat(path);\n return paths.reduce(function (matched, path) {\n if (matched) return matched;\n\n var _compilePath = compilePath$1(path, {\n end: exact,\n strict: strict,\n sensitive: sensitive\n }),\n regexp = _compilePath.regexp,\n keys = _compilePath.keys;\n\n var match = regexp.exec(pathname);\n if (!match) return null;\n var url = match[0],\n values = match.slice(1);\n var isExact = pathname === url;\n if (exact && !isExact) return null;\n return {\n path: path,\n // the path used to match\n url: path === \"/\" && url === \"\" ? \"/\" : url,\n // the matched portion of the URL\n isExact: isExact,\n // whether or not we matched exactly\n params: keys.reduce(function (memo, key, index) {\n memo[key.name] = values[index];\n return memo;\n }, {})\n };\n }, null);\n}", "function matchPath(pathname, options) {\n if (options === void 0) {\n options = {};\n }\n\n if (typeof options === \"string\") options = {\n path: options\n };\n var _options = options,\n path = _options.path,\n _options$exact = _options.exact,\n exact = _options$exact === void 0 ? false : _options$exact,\n _options$strict = _options.strict,\n strict = _options$strict === void 0 ? false : _options$strict,\n _options$sensitive = _options.sensitive,\n sensitive = _options$sensitive === void 0 ? false : _options$sensitive;\n var paths = [].concat(path);\n return paths.reduce(function (matched, path) {\n if (matched) return matched;\n\n var _compilePath = compilePath$1(path, {\n end: exact,\n strict: strict,\n sensitive: sensitive\n }),\n regexp = _compilePath.regexp,\n keys = _compilePath.keys;\n\n var match = regexp.exec(pathname);\n if (!match) return null;\n var url = match[0],\n values = match.slice(1);\n var isExact = pathname === url;\n if (exact && !isExact) return null;\n return {\n path: path,\n // the path used to match\n url: path === \"/\" && url === \"\" ? \"/\" : url,\n // the matched portion of the URL\n isExact: isExact,\n // whether or not we matched exactly\n params: keys.reduce(function (memo, key, index) {\n memo[key.name] = values[index];\n return memo;\n }, {})\n };\n }, null);\n}", "function matchPath(path, source) {\r\n const matcher = match(source, { decode: decodeURIComponent });\r\n return matcher(path);\r\n}", "function matchPath(path, source) {\n const matcher = match(source, { decode: decodeURIComponent });\n return matcher(path);\n}", "function react_router_matchPath(pathname, options) {\n if (options === void 0) {\n options = {};\n }\n\n if (typeof options === \"string\") options = {\n path: options\n };\n var _options = options,\n path = _options.path,\n _options$exact = _options.exact,\n exact = _options$exact === void 0 ? false : _options$exact,\n _options$strict = _options.strict,\n strict = _options$strict === void 0 ? false : _options$strict,\n _options$sensitive = _options.sensitive,\n sensitive = _options$sensitive === void 0 ? false : _options$sensitive;\n var paths = [].concat(path);\n return paths.reduce(function (matched, path) {\n if (!path) return null;\n if (matched) return matched;\n\n var _compilePath = react_router_compilePath$1(path, {\n end: exact,\n strict: strict,\n sensitive: sensitive\n }),\n regexp = _compilePath.regexp,\n keys = _compilePath.keys;\n\n var match = regexp.exec(pathname);\n if (!match) return null;\n var url = match[0],\n values = match.slice(1);\n var isExact = pathname === url;\n if (exact && !isExact) return null;\n return {\n path: path,\n // the path used to match\n url: path === \"/\" && url === \"\" ? \"/\" : url,\n // the matched portion of the URL\n isExact: isExact,\n // whether or not we matched exactly\n params: keys.reduce(function (memo, key, index) {\n memo[key.name] = values[index];\n return memo;\n }, {})\n };\n }, null);\n}", "computeMatch(pathname) {\n if (!pathname) {\n const location = this.activeRouter.get('location');\n pathname = location.pathname;\n }\n const match = matchPath(pathname, {\n path: this.urlMatch || this.url,\n exact: this.exact,\n strict: this.strict\n });\n return match;\n }", "function matchPattern(pattern,pathname){ // Ensure pattern starts with leading slash for consistency with pathname.\nif(pattern.charAt(0)!=='/'){pattern='/'+pattern;}var _compilePattern2=compilePattern(pattern);var regexpSource=_compilePattern2.regexpSource;var paramNames=_compilePattern2.paramNames;var tokens=_compilePattern2.tokens;if(pattern.charAt(pattern.length-1)!=='/'){regexpSource+='/?'; // Allow optional path separator at end.\n} // Special-case patterns like '*' for catch-all routes.\nif(tokens[tokens.length-1]==='*'){regexpSource+='$';}var match=pathname.match(new RegExp('^'+regexpSource,'i'));if(match==null){return null;}var matchedPath=match[0];var remainingPathname=pathname.substr(matchedPath.length);if(remainingPathname){ // Require that the match ends at a path separator, if we didn't match\n// the full path, so any remaining pathname is a new path segment.\nif(matchedPath.charAt(matchedPath.length-1)!=='/'){return null;} // If there is a remaining pathname, treat the path separator as part of\n// the remaining pathname for properly continuing the match.\nremainingPathname='/'+remainingPathname;}return {remainingPathname:remainingPathname,paramNames:paramNames,paramValues:match.slice(1).map(function(v){return v&&decodeURIComponent(v);})};}", "function match(_ref, callback) {\n var routes = _ref.routes;\n var location = _ref.location;\n var parseQueryString = _ref.parseQueryString;\n var stringifyQuery = _ref.stringifyQuery;\n var basename = _ref.basename;\n\n !location ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'match needs a location') : _invariant2['default'](false) : undefined;\n\n var history = createHistory({\n routes: _RouteUtils.createRoutes(routes),\n parseQueryString: parseQueryString,\n stringifyQuery: stringifyQuery,\n basename: basename\n });\n\n // Allow match({ location: '/the/path', ... })\n if (typeof location === 'string') location = history.createLocation(location);\n\n history.match(location, function (error, redirectLocation, nextState) {\n callback(error, redirectLocation, nextState && _extends({}, nextState, { history: history }));\n });\n}", "function match(_ref, callback) {\n var routes = _ref.routes;\n var location = _ref.location;\n var parseQueryString = _ref.parseQueryString;\n var stringifyQuery = _ref.stringifyQuery;\n var basename = _ref.basename;\n\n !location ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'match needs a location') : _invariant2['default'](false) : undefined;\n\n var history = createHistory({\n routes: _RouteUtils.createRoutes(routes),\n parseQueryString: parseQueryString,\n stringifyQuery: stringifyQuery,\n basename: basename\n });\n\n // Allow match({ location: '/the/path', ... })\n if (typeof location === 'string') location = history.createLocation(location);\n\n history.match(location, function (error, redirectLocation, nextState) {\n callback(error, redirectLocation, nextState && _extends({}, nextState, { history: history }));\n });\n}", "computeMatch() {\n if (this.location) {\n this.match = matchPath.matchPath(this.location.pathname, {\n path: this.urlMatch || this.url,\n exact: this.exact,\n strict: this.strict\n });\n }\n }", "function match(_ref, callback) {\n\t var routes = _ref.routes;\n\t var location = _ref.location;\n\t var parseQueryString = _ref.parseQueryString;\n\t var stringifyQuery = _ref.stringifyQuery;\n\t var basename = _ref.basename;\n\n\t !location ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'match needs a location') : _invariant2['default'](false) : undefined;\n\n\t var history = createHistory({\n\t routes: _RouteUtils.createRoutes(routes),\n\t parseQueryString: parseQueryString,\n\t stringifyQuery: stringifyQuery,\n\t basename: basename\n\t });\n\n\t // Allow match({ location: '/the/path', ... })\n\t if (typeof location === 'string') location = history.createLocation(location);\n\n\t history.match(location, function (error, redirectLocation, nextState) {\n\t callback(error, redirectLocation, nextState && _extends({}, nextState, { history: history }));\n\t });\n\t}", "function path(path, callback) {\n var m = regexpify(path).exec(document.location.pathname);\n if (m) {\n callback.call(this, m);\n }\n}", "function match(_ref, callback) {\n\t var routes = _ref.routes;\n\t var location = _ref.location;\n\t var parseQueryString = _ref.parseQueryString;\n\t var stringifyQuery = _ref.stringifyQuery;\n\t var basename = _ref.basename;\n\n\t !location ? true ? _invariant2['default'](false, 'match needs a location') : _invariant2['default'](false) : undefined;\n\n\t var history = createHistory({\n\t routes: _RouteUtils.createRoutes(routes),\n\t parseQueryString: parseQueryString,\n\t stringifyQuery: stringifyQuery,\n\t basename: basename\n\t });\n\n\t // Allow match({ location: '/the/path', ... })\n\t if (typeof location === 'string') location = history.createLocation(location);\n\n\t history.match(location, function (error, redirectLocation, nextState) {\n\t callback(error, redirectLocation, nextState && _extends({}, nextState, { history: history }));\n\t });\n\t}", "function match(_ref, callback) {\n\t var routes = _ref.routes;\n\t var location = _ref.location;\n\t var parseQueryString = _ref.parseQueryString;\n\t var stringifyQuery = _ref.stringifyQuery;\n\t var basename = _ref.basename;\n\n\t !location ? true ? _invariant2['default'](false, 'match needs a location') : _invariant2['default'](false) : undefined;\n\n\t var history = createHistory({\n\t routes: _RouteUtils.createRoutes(routes),\n\t parseQueryString: parseQueryString,\n\t stringifyQuery: stringifyQuery,\n\t basename: basename\n\t });\n\n\t // Allow match({ location: '/the/path', ... })\n\t if (typeof location === 'string') location = history.createLocation(location);\n\n\t history.match(location, function (error, redirectLocation, nextState) {\n\t callback(error, redirectLocation, nextState && _extends({}, nextState, { history: history }));\n\t });\n\t}", "function match(_ref, callback) {\n\t var routes = _ref.routes;\n\t var location = _ref.location;\n\t var parseQueryString = _ref.parseQueryString;\n\t var stringifyQuery = _ref.stringifyQuery;\n\t var basename = _ref.basename;\n\n\t !location ? false ? _invariant2['default'](false, 'match needs a location') : _invariant2['default'](false) : undefined;\n\n\t var history = createHistory({\n\t routes: _RouteUtils.createRoutes(routes),\n\t parseQueryString: parseQueryString,\n\t stringifyQuery: stringifyQuery,\n\t basename: basename\n\t });\n\n\t // Allow match({ location: '/the/path', ... })\n\t if (typeof location === 'string') location = history.createLocation(location);\n\n\t history.match(location, function (error, redirectLocation, nextState) {\n\t callback(error, redirectLocation, nextState && _extends({}, nextState, { history: history }));\n\t });\n\t}", "function matchHandler (url)\n{\n request (url, cb);\n}", "match(path, req, res) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tlet {mPath, mRegexp: regexp, mKeys} = this;\n\t\t\tif (!mPath && !path) {return resolve();}\n\t\t\tif (path === mPath) {return resolve();}\n\t\t\tif (!mPath) {return reject();}\n\t\t\tlet match = regexp.exec(path);\n\t\t\tif (!match) {return reject();}\n\t\t\tif (1 === match.length) {\n\t\t\t\t// Totally match.\n\t\t\t\treturn resolve();\n\t\t\t}\n\t\t\t// Here can use async.\n\t\t\tlet i = 1;\n\t\t\tlet t = () => {\n\t\t\t\tif (i >= match.length) {return resolve();}\n\t\t\t\tlet matchi = match[i];\n\t\t\t\t// Set params.\n\t\t\t\tlet name = mKeys[i - 1].name;\n\t\t\t\ti++;\n\t\t\t\tlet value = decode_param(matchi);\n\t\t\t\t// if (val !== undefined || !(hasOwnProperty.call(params, prop))) {\n\t\t\t\tthis.mRouter.onParamParsed(null, req, res, name, value, t);\n\t\t\t\t// }\n\t\t\t};\n\t\t\tt();\n\t\t});\n\t}", "function matchPath(verb, path) {\n for (var i = 0; i < routes[verb].length; i++) {\n var routeObj = routes[verb][i];\n if (path.match(routeObj.rePath)) {\n return routeObj;\n }\n }\n return false;\n }", "function routePath(url) {\n var match = parseUrl(url)\n return match &&\n match.protocol === winLocation.protocol &&\n match.host === winLocation.host &&\n match.pathname + (match.search || '')\n}", "getMatch(pathname) {\n let route = this;\n if (route.data.path instanceof Array) {\n let match=null;\n route.data.path.some((r) => {\n match= this.match(r,pathname);\n return match != null;\n });\n return match;\n }else {\n return this.match(route.data.path,pathname);\n }\n }", "findStringFromRoute(param){\n let existStatus = false\n if(this.props.location.pathname.indexOf(param) != -1){\n existStatus = true\n }else{\n existStatus = false\n }\n return existStatus\n }", "function matchPattern(pattern,pathname){ // Ensure pattern starts with leading slash for consistency with pathname.\n\tif(pattern.charAt(0)!=='/'){pattern='/'+pattern;}var _compilePattern2=compilePattern(pattern);var regexpSource=_compilePattern2.regexpSource;var paramNames=_compilePattern2.paramNames;var tokens=_compilePattern2.tokens;if(pattern.charAt(pattern.length-1)!=='/'){regexpSource+='/?'; // Allow optional path separator at end.\n\t} // Special-case patterns like '*' for catch-all routes.\n\tif(tokens[tokens.length-1]==='*'){regexpSource+='$';}var match=pathname.match(new RegExp('^'+regexpSource,'i'));if(match==null){return null;}var matchedPath=match[0];var remainingPathname=pathname.substr(matchedPath.length);if(remainingPathname){ // Require that the match ends at a path separator, if we didn't match\n\t// the full path, so any remaining pathname is a new path segment.\n\tif(matchedPath.charAt(matchedPath.length-1)!=='/'){return null;} // If there is a remaining pathname, treat the path separator as part of\n\t// the remaining pathname for properly continuing the match.\n\tremainingPathname='/'+remainingPathname;}return {remainingPathname:remainingPathname,paramNames:paramNames,paramValues:match.slice(1).map(function(v){return v&&decodeURIComponent(v);})};}", "function matchPattern(pattern,pathname){ // Ensure pattern starts with leading slash for consistency with pathname.\n\tif(pattern.charAt(0)!=='/'){pattern='/'+pattern;}var _compilePattern2=compilePattern(pattern);var regexpSource=_compilePattern2.regexpSource;var paramNames=_compilePattern2.paramNames;var tokens=_compilePattern2.tokens;if(pattern.charAt(pattern.length-1)!=='/'){regexpSource+='/?'; // Allow optional path separator at end.\n\t} // Special-case patterns like '*' for catch-all routes.\n\tif(tokens[tokens.length-1]==='*'){regexpSource+='$';}var match=pathname.match(new RegExp('^'+regexpSource,'i'));if(match==null){return null;}var matchedPath=match[0];var remainingPathname=pathname.substr(matchedPath.length);if(remainingPathname){ // Require that the match ends at a path separator, if we didn't match\n\t// the full path, so any remaining pathname is a new path segment.\n\tif(matchedPath.charAt(matchedPath.length-1)!=='/'){return null;} // If there is a remaining pathname, treat the path separator as part of\n\t// the remaining pathname for properly continuing the match.\n\tremainingPathname='/'+remainingPathname;}return {remainingPathname:remainingPathname,paramNames:paramNames,paramValues:match.slice(1).map(function(v){return v&&decodeURIComponent(v);})};}", "function match(_ref, callback) { // 38\n var routes = _ref.routes; // 39\n var location = _ref.location; // 40\n var parseQueryString = _ref.parseQueryString; // 41\n var stringifyQuery = _ref.stringifyQuery; // 42\n var basename = _ref.basename; // 43\n // 44\n _invariant2['default'](location, 'match needs a location'); // 45\n // 46\n var history = createHistory({ // 47\n routes: _RouteUtils.createRoutes(routes), // 48\n parseQueryString: parseQueryString, // 49\n stringifyQuery: stringifyQuery, // 50\n basename: basename // 51\n }); // 52\n // 53\n // Allow match({ location: '/the/path', ... }) // 54\n if (typeof location === 'string') location = history.createLocation(location);\n // 56\n history.match(location, function (error, redirectLocation, nextState) {\n callback(error, redirectLocation, nextState && _extends({}, nextState, { history: history }));\n }); // 59\n} // 60", "function pathMatcher(url){\n\t// console.log('pathMatcher', url, routes_tree)\n\tif (! routes_tree) throw new Error('No routes defined.')\n\n\tvar args = [], n = 0\n\n\t// Convert route into array of URL segments, ending with \"$\", the leaf node.\n\tvar route = url.slice(1).replace(/\\/$/g,'').split('?')[0].split('/')\n\troute[route.length] = '$'\n\n\tvar result = route.reduce(treeClimber, routes_tree)\n\tvar ctrl\n\tif (result && result[0]) {\n\t\tctrl = function(req,res){ // leaf node from matching route, or undefined.\n\t\t\tresult[0](req,res,args)\n\t\t}\n\t} else {\n\t\tctrl = null\n\t}\n\treturn ctrl\n\n\n\t// We define this internally so that args and n are within scope.\n\t// Climb the routes tree. Always check first for a matching static route segment before trying regex.\n\tfunction treeClimber(obj, seg){\n\t\tif (! obj) return null\n\n\t\treturn obj[seg] || (function(){\n\t\t\tvar regs = obj['<regex>'] || undefined\n\t\t\tif (regs) {\n\t\t\t\tfor (var i=0; i < regs.patterns.length; i++) {\n\t\t\t\t\tif (regs.patterns[i].test(seg)) {\n\t\t\t\t\t\targs[n++] = seg // Increments n after the value is used for the assignment. More performant than .push().\n\t\t\t\t\t\treturn regs[regs.patterns[i].toString()]\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t})()\n\t}\n\n}", "function matcher(strToMatch) {\n var reg = extReg(strToMatch);\n return function (path) {\n if (path.search(reg) >= 0) {\n return path;\n }\n else {\n return undefined;\n }\n };\n}", "function matchPattern(pattern, pathname) {\r\n\t // Ensure pattern starts with leading slash for consistency with pathname.\r\n\t if (pattern.charAt(0) !== '/') {\r\n\t pattern = '/' + pattern;\r\n\t }\r\n\t\r\n\t var _compilePattern2 = compilePattern(pattern);\r\n\t\r\n\t var regexpSource = _compilePattern2.regexpSource;\r\n\t var paramNames = _compilePattern2.paramNames;\r\n\t var tokens = _compilePattern2.tokens;\r\n\t\r\n\t if (pattern.charAt(pattern.length - 1) !== '/') {\r\n\t regexpSource += '/?'; // Allow optional path separator at end.\r\n\t }\r\n\t\r\n\t // Special-case patterns like '*' for catch-all routes.\r\n\t if (tokens[tokens.length - 1] === '*') {\r\n\t regexpSource += '$';\r\n\t }\r\n\t\r\n\t var match = pathname.match(new RegExp('^' + regexpSource, 'i'));\r\n\t if (match == null) {\r\n\t return null;\r\n\t }\r\n\t\r\n\t var matchedPath = match[0];\r\n\t var remainingPathname = pathname.substr(matchedPath.length);\r\n\t\r\n\t if (remainingPathname) {\r\n\t // Require that the match ends at a path separator, if we didn't match\r\n\t // the full path, so any remaining pathname is a new path segment.\r\n\t if (matchedPath.charAt(matchedPath.length - 1) !== '/') {\r\n\t return null;\r\n\t }\r\n\t\r\n\t // If there is a remaining pathname, treat the path separator as part of\r\n\t // the remaining pathname for properly continuing the match.\r\n\t remainingPathname = '/' + remainingPathname;\r\n\t }\r\n\t\r\n\t return {\r\n\t remainingPathname: remainingPathname,\r\n\t paramNames: paramNames,\r\n\t paramValues: match.slice(1).map(function (v) {\r\n\t return v && decodeURIComponent(v);\r\n\t })\r\n\t };\r\n\t}", "function matchPattern(pattern, pathname) {\n // Ensure pattern starts with leading slash for consistency with pathname.\n if (pattern.charAt(0) !== '/') {\n pattern = '/' + pattern;\n }\n\n var _compilePattern2 = compilePattern(pattern),\n regexpSource = _compilePattern2.regexpSource,\n paramNames = _compilePattern2.paramNames,\n tokens = _compilePattern2.tokens;\n\n if (pattern.charAt(pattern.length - 1) !== '/') {\n regexpSource += '/?'; // Allow optional path separator at end.\n } // Special-case patterns like '*' for catch-all routes.\n\n\n if (tokens[tokens.length - 1] === '*') {\n regexpSource += '$';\n }\n\n var match = pathname.match(new RegExp('^' + regexpSource, 'i'));\n\n if (match == null) {\n return null;\n }\n\n var matchedPath = match[0];\n var remainingPathname = pathname.substr(matchedPath.length);\n\n if (remainingPathname) {\n // Require that the match ends at a path separator, if we didn't match\n // the full path, so any remaining pathname is a new path segment.\n if (matchedPath.charAt(matchedPath.length - 1) !== '/') {\n return null;\n } // If there is a remaining pathname, treat the path separator as part of\n // the remaining pathname for properly continuing the match.\n\n\n remainingPathname = '/' + remainingPathname;\n }\n\n return {\n remainingPathname: remainingPathname,\n paramNames: paramNames,\n paramValues: match.slice(1).map(function (v) {\n return v && decodeURIComponent(v);\n })\n };\n}", "function getParam(regex){\r\n\treturn document.location.pathname.match(regex);\r\n}", "function mountMatchesUrl (mount, url) {\n\n mount = ensureTrailingSlash(mount);\n url = ensureTrailingSlash(removeQuery(url));\n return mount === url.slice(0, mount.length);\n\n function removeQuery (path) {\n var queryPosition = path.indexOf('?'),\n hasQuery = Boolean(queryPosition + 1);\n return hasQuery ? path.slice(0, queryPosition) : path;\n }\n function ensureTrailingSlash (path) {\n var last = path.length - 1;\n return (path[last] !== '/') ? path + '/' : path;\n }\n\n}", "function matchPattern(pattern, pathname) {\n // Ensure pattern starts with leading slash for consistency with pathname.\n if (pattern.charAt(0) !== '/') {\n pattern = '/' + pattern;\n }\n\n var _compilePattern2 = compilePattern(pattern);\n\n var regexpSource = _compilePattern2.regexpSource;\n var paramNames = _compilePattern2.paramNames;\n var tokens = _compilePattern2.tokens;\n\n\n if (pattern.charAt(pattern.length - 1) !== '/') {\n regexpSource += '/?'; // Allow optional path separator at end.\n }\n\n // Special-case patterns like '*' for catch-all routes.\n if (tokens[tokens.length - 1] === '*') {\n regexpSource += '$';\n }\n\n var match = pathname.match(new RegExp('^' + regexpSource, 'i'));\n if (match == null) {\n return null;\n }\n\n var matchedPath = match[0];\n var remainingPathname = pathname.substr(matchedPath.length);\n\n if (remainingPathname) {\n // Require that the match ends at a path separator, if we didn't match\n // the full path, so any remaining pathname is a new path segment.\n if (matchedPath.charAt(matchedPath.length - 1) !== '/') {\n return null;\n }\n\n // If there is a remaining pathname, treat the path separator as part of\n // the remaining pathname for properly continuing the match.\n remainingPathname = '/' + remainingPathname;\n }\n\n return {\n remainingPathname: remainingPathname,\n paramNames: paramNames,\n paramValues: match.slice(1).map(function (v) {\n return v && decodeURIComponent(v);\n })\n };\n}", "function matchPattern(pattern, pathname) {\n // Ensure pattern starts with leading slash for consistency with pathname.\n if (pattern.charAt(0) !== '/') {\n pattern = '/' + pattern;\n }\n\n var _compilePattern2 = compilePattern(pattern);\n\n var regexpSource = _compilePattern2.regexpSource;\n var paramNames = _compilePattern2.paramNames;\n var tokens = _compilePattern2.tokens;\n\n\n if (pattern.charAt(pattern.length - 1) !== '/') {\n regexpSource += '/?'; // Allow optional path separator at end.\n }\n\n // Special-case patterns like '*' for catch-all routes.\n if (tokens[tokens.length - 1] === '*') {\n regexpSource += '$';\n }\n\n var match = pathname.match(new RegExp('^' + regexpSource, 'i'));\n if (match == null) {\n return null;\n }\n\n var matchedPath = match[0];\n var remainingPathname = pathname.substr(matchedPath.length);\n\n if (remainingPathname) {\n // Require that the match ends at a path separator, if we didn't match\n // the full path, so any remaining pathname is a new path segment.\n if (matchedPath.charAt(matchedPath.length - 1) !== '/') {\n return null;\n }\n\n // If there is a remaining pathname, treat the path separator as part of\n // the remaining pathname for properly continuing the match.\n remainingPathname = '/' + remainingPathname;\n }\n\n return {\n remainingPathname: remainingPathname,\n paramNames: paramNames,\n paramValues: match.slice(1).map(function (v) {\n return v && decodeURIComponent(v);\n })\n };\n}", "function matchPattern(pattern, pathname) {\n // Ensure pattern starts with leading slash for consistency with pathname.\n if (pattern.charAt(0) !== '/') {\n pattern = '/' + pattern;\n }\n\n var _compilePattern2 = compilePattern(pattern);\n\n var regexpSource = _compilePattern2.regexpSource;\n var paramNames = _compilePattern2.paramNames;\n var tokens = _compilePattern2.tokens;\n\n\n if (pattern.charAt(pattern.length - 1) !== '/') {\n regexpSource += '/?'; // Allow optional path separator at end.\n }\n\n // Special-case patterns like '*' for catch-all routes.\n if (tokens[tokens.length - 1] === '*') {\n regexpSource += '$';\n }\n\n var match = pathname.match(new RegExp('^' + regexpSource, 'i'));\n if (match == null) {\n return null;\n }\n\n var matchedPath = match[0];\n var remainingPathname = pathname.substr(matchedPath.length);\n\n if (remainingPathname) {\n // Require that the match ends at a path separator, if we didn't match\n // the full path, so any remaining pathname is a new path segment.\n if (matchedPath.charAt(matchedPath.length - 1) !== '/') {\n return null;\n }\n\n // If there is a remaining pathname, treat the path separator as part of\n // the remaining pathname for properly continuing the match.\n remainingPathname = '/' + remainingPathname;\n }\n\n return {\n remainingPathname: remainingPathname,\n paramNames: paramNames,\n paramValues: match.slice(1).map(function (v) {\n return v && decodeURIComponent(v);\n })\n };\n}", "function matchPattern(pattern, pathname) {\n // Ensure pattern starts with leading slash for consistency with pathname.\n if (pattern.charAt(0) !== '/') {\n pattern = '/' + pattern;\n }\n\n var _compilePattern2 = compilePattern(pattern);\n\n var regexpSource = _compilePattern2.regexpSource;\n var paramNames = _compilePattern2.paramNames;\n var tokens = _compilePattern2.tokens;\n\n\n if (pattern.charAt(pattern.length - 1) !== '/') {\n regexpSource += '/?'; // Allow optional path separator at end.\n }\n\n // Special-case patterns like '*' for catch-all routes.\n if (tokens[tokens.length - 1] === '*') {\n regexpSource += '$';\n }\n\n var match = pathname.match(new RegExp('^' + regexpSource, 'i'));\n if (match == null) {\n return null;\n }\n\n var matchedPath = match[0];\n var remainingPathname = pathname.substr(matchedPath.length);\n\n if (remainingPathname) {\n // Require that the match ends at a path separator, if we didn't match\n // the full path, so any remaining pathname is a new path segment.\n if (matchedPath.charAt(matchedPath.length - 1) !== '/') {\n return null;\n }\n\n // If there is a remaining pathname, treat the path separator as part of\n // the remaining pathname for properly continuing the match.\n remainingPathname = '/' + remainingPathname;\n }\n\n return {\n remainingPathname: remainingPathname,\n paramNames: paramNames,\n paramValues: match.slice(1).map(function (v) {\n return v && decodeURIComponent(v);\n })\n };\n}", "function matchPattern(pattern, pathname) {\n // Ensure pattern starts with leading slash for consistency with pathname.\n if (pattern.charAt(0) !== '/') {\n pattern = '/' + pattern;\n }\n\n var _compilePattern2 = compilePattern(pattern);\n\n var regexpSource = _compilePattern2.regexpSource;\n var paramNames = _compilePattern2.paramNames;\n var tokens = _compilePattern2.tokens;\n\n\n if (pattern.charAt(pattern.length - 1) !== '/') {\n regexpSource += '/?'; // Allow optional path separator at end.\n }\n\n // Special-case patterns like '*' for catch-all routes.\n if (tokens[tokens.length - 1] === '*') {\n regexpSource += '$';\n }\n\n var match = pathname.match(new RegExp('^' + regexpSource, 'i'));\n if (match == null) {\n return null;\n }\n\n var matchedPath = match[0];\n var remainingPathname = pathname.substr(matchedPath.length);\n\n if (remainingPathname) {\n // Require that the match ends at a path separator, if we didn't match\n // the full path, so any remaining pathname is a new path segment.\n if (matchedPath.charAt(matchedPath.length - 1) !== '/') {\n return null;\n }\n\n // If there is a remaining pathname, treat the path separator as part of\n // the remaining pathname for properly continuing the match.\n remainingPathname = '/' + remainingPathname;\n }\n\n return {\n remainingPathname: remainingPathname,\n paramNames: paramNames,\n paramValues: match.slice(1).map(function (v) {\n return v && decodeURIComponent(v);\n })\n };\n}", "function matchPattern(pattern, pathname) {\n // Ensure pattern starts with leading slash for consistency with pathname.\n if (pattern.charAt(0) !== '/') {\n pattern = '/' + pattern;\n }\n\n var _compilePattern2 = compilePattern(pattern);\n\n var regexpSource = _compilePattern2.regexpSource;\n var paramNames = _compilePattern2.paramNames;\n var tokens = _compilePattern2.tokens;\n\n\n if (pattern.charAt(pattern.length - 1) !== '/') {\n regexpSource += '/?'; // Allow optional path separator at end.\n }\n\n // Special-case patterns like '*' for catch-all routes.\n if (tokens[tokens.length - 1] === '*') {\n regexpSource += '$';\n }\n\n var match = pathname.match(new RegExp('^' + regexpSource, 'i'));\n if (match == null) {\n return null;\n }\n\n var matchedPath = match[0];\n var remainingPathname = pathname.substr(matchedPath.length);\n\n if (remainingPathname) {\n // Require that the match ends at a path separator, if we didn't match\n // the full path, so any remaining pathname is a new path segment.\n if (matchedPath.charAt(matchedPath.length - 1) !== '/') {\n return null;\n }\n\n // If there is a remaining pathname, treat the path separator as part of\n // the remaining pathname for properly continuing the match.\n remainingPathname = '/' + remainingPathname;\n }\n\n return {\n remainingPathname: remainingPathname,\n paramNames: paramNames,\n paramValues: match.slice(1).map(function (v) {\n return v && decodeURIComponent(v);\n })\n };\n}", "function matchPattern(pattern, pathname) {\n // Ensure pattern starts with leading slash for consistency with pathname.\n if (pattern.charAt(0) !== '/') {\n pattern = '/' + pattern;\n }\n\n var _compilePattern2 = compilePattern(pattern);\n\n var regexpSource = _compilePattern2.regexpSource;\n var paramNames = _compilePattern2.paramNames;\n var tokens = _compilePattern2.tokens;\n\n\n if (pattern.charAt(pattern.length - 1) !== '/') {\n regexpSource += '/?'; // Allow optional path separator at end.\n }\n\n // Special-case patterns like '*' for catch-all routes.\n if (tokens[tokens.length - 1] === '*') {\n regexpSource += '$';\n }\n\n var match = pathname.match(new RegExp('^' + regexpSource, 'i'));\n if (match == null) {\n return null;\n }\n\n var matchedPath = match[0];\n var remainingPathname = pathname.substr(matchedPath.length);\n\n if (remainingPathname) {\n // Require that the match ends at a path separator, if we didn't match\n // the full path, so any remaining pathname is a new path segment.\n if (matchedPath.charAt(matchedPath.length - 1) !== '/') {\n return null;\n }\n\n // If there is a remaining pathname, treat the path separator as part of\n // the remaining pathname for properly continuing the match.\n remainingPathname = '/' + remainingPathname;\n }\n\n return {\n remainingPathname: remainingPathname,\n paramNames: paramNames,\n paramValues: match.slice(1).map(function (v) {\n return v && decodeURIComponent(v);\n })\n };\n}", "function matchPattern(pattern, pathname) {\n // Ensure pattern starts with leading slash for consistency with pathname.\n if (pattern.charAt(0) !== '/') {\n pattern = '/' + pattern;\n }\n\n var _compilePattern2 = compilePattern(pattern);\n\n var regexpSource = _compilePattern2.regexpSource;\n var paramNames = _compilePattern2.paramNames;\n var tokens = _compilePattern2.tokens;\n\n\n if (pattern.charAt(pattern.length - 1) !== '/') {\n regexpSource += '/?'; // Allow optional path separator at end.\n }\n\n // Special-case patterns like '*' for catch-all routes.\n if (tokens[tokens.length - 1] === '*') {\n regexpSource += '$';\n }\n\n var match = pathname.match(new RegExp('^' + regexpSource, 'i'));\n if (match == null) {\n return null;\n }\n\n var matchedPath = match[0];\n var remainingPathname = pathname.substr(matchedPath.length);\n\n if (remainingPathname) {\n // Require that the match ends at a path separator, if we didn't match\n // the full path, so any remaining pathname is a new path segment.\n if (matchedPath.charAt(matchedPath.length - 1) !== '/') {\n return null;\n }\n\n // If there is a remaining pathname, treat the path separator as part of\n // the remaining pathname for properly continuing the match.\n remainingPathname = '/' + remainingPathname;\n }\n\n return {\n remainingPathname: remainingPathname,\n paramNames: paramNames,\n paramValues: match.slice(1).map(function (v) {\n return v && decodeURIComponent(v);\n })\n };\n}", "function matchPattern(pattern, pathname) {\n // Ensure pattern starts with leading slash for consistency with pathname.\n if (pattern.charAt(0) !== '/') {\n pattern = '/' + pattern;\n }\n\n var _compilePattern2 = compilePattern(pattern);\n\n var regexpSource = _compilePattern2.regexpSource;\n var paramNames = _compilePattern2.paramNames;\n var tokens = _compilePattern2.tokens;\n\n if (pattern.charAt(pattern.length - 1) !== '/') {\n regexpSource += '/?'; // Allow optional path separator at end.\n }\n\n // Special-case patterns like '*' for catch-all routes.\n if (tokens[tokens.length - 1] === '*') {\n regexpSource += '$';\n }\n\n var match = pathname.match(new RegExp('^' + regexpSource, 'i'));\n if (match == null) {\n return null;\n }\n\n var matchedPath = match[0];\n var remainingPathname = pathname.substr(matchedPath.length);\n\n if (remainingPathname) {\n // Require that the match ends at a path separator, if we didn't match\n // the full path, so any remaining pathname is a new path segment.\n if (matchedPath.charAt(matchedPath.length - 1) !== '/') {\n return null;\n }\n\n // If there is a remaining pathname, treat the path separator as part of\n // the remaining pathname for properly continuing the match.\n remainingPathname = '/' + remainingPathname;\n }\n\n return {\n remainingPathname: remainingPathname,\n paramNames: paramNames,\n paramValues: match.slice(1).map(function (v) {\n return v && decodeURIComponent(v);\n })\n };\n}", "function matchPattern(pattern, pathname) {\n // Ensure pattern starts with leading slash for consistency with pathname.\n if (pattern.charAt(0) !== '/') {\n pattern = '/' + pattern;\n }\n\n var _compilePattern2 = compilePattern(pattern),\n regexpSource = _compilePattern2.regexpSource,\n paramNames = _compilePattern2.paramNames,\n tokens = _compilePattern2.tokens;\n\n if (pattern.charAt(pattern.length - 1) !== '/') {\n regexpSource += '/?'; // Allow optional path separator at end.\n }\n\n // Special-case patterns like '*' for catch-all routes.\n if (tokens[tokens.length - 1] === '*') {\n regexpSource += '$';\n }\n\n var match = pathname.match(new RegExp('^' + regexpSource, 'i'));\n if (match == null) {\n return null;\n }\n\n var matchedPath = match[0];\n var remainingPathname = pathname.substr(matchedPath.length);\n\n if (remainingPathname) {\n // Require that the match ends at a path separator, if we didn't match\n // the full path, so any remaining pathname is a new path segment.\n if (matchedPath.charAt(matchedPath.length - 1) !== '/') {\n return null;\n }\n\n // If there is a remaining pathname, treat the path separator as part of\n // the remaining pathname for properly continuing the match.\n remainingPathname = '/' + remainingPathname;\n }\n\n return {\n remainingPathname: remainingPathname,\n paramNames: paramNames,\n paramValues: match.slice(1).map(function (v) {\n return v && decodeURIComponent(v);\n })\n };\n}", "function matchPattern(pattern, pathname) {\n // Ensure pattern starts with leading slash for consistency with pathname.\n if (pattern.charAt(0) !== '/') {\n pattern = '/' + pattern;\n }\n\n var _compilePattern2 = compilePattern(pattern),\n regexpSource = _compilePattern2.regexpSource,\n paramNames = _compilePattern2.paramNames,\n tokens = _compilePattern2.tokens;\n\n if (pattern.charAt(pattern.length - 1) !== '/') {\n regexpSource += '/?'; // Allow optional path separator at end.\n }\n\n // Special-case patterns like '*' for catch-all routes.\n if (tokens[tokens.length - 1] === '*') {\n regexpSource += '$';\n }\n\n var match = pathname.match(new RegExp('^' + regexpSource, 'i'));\n if (match == null) {\n return null;\n }\n\n var matchedPath = match[0];\n var remainingPathname = pathname.substr(matchedPath.length);\n\n if (remainingPathname) {\n // Require that the match ends at a path separator, if we didn't match\n // the full path, so any remaining pathname is a new path segment.\n if (matchedPath.charAt(matchedPath.length - 1) !== '/') {\n return null;\n }\n\n // If there is a remaining pathname, treat the path separator as part of\n // the remaining pathname for properly continuing the match.\n remainingPathname = '/' + remainingPathname;\n }\n\n return {\n remainingPathname: remainingPathname,\n paramNames: paramNames,\n paramValues: match.slice(1).map(function (v) {\n return v && decodeURIComponent(v);\n })\n };\n}", "function matchPattern(pattern, pathname) {\n // Ensure pattern starts with leading slash for consistency with pathname.\n if (pattern.charAt(0) !== '/') {\n pattern = '/' + pattern;\n }\n\n var _compilePattern2 = compilePattern(pattern),\n regexpSource = _compilePattern2.regexpSource,\n paramNames = _compilePattern2.paramNames,\n tokens = _compilePattern2.tokens;\n\n if (pattern.charAt(pattern.length - 1) !== '/') {\n regexpSource += '/?'; // Allow optional path separator at end.\n }\n\n // Special-case patterns like '*' for catch-all routes.\n if (tokens[tokens.length - 1] === '*') {\n regexpSource += '$';\n }\n\n var match = pathname.match(new RegExp('^' + regexpSource, 'i'));\n if (match == null) {\n return null;\n }\n\n var matchedPath = match[0];\n var remainingPathname = pathname.substr(matchedPath.length);\n\n if (remainingPathname) {\n // Require that the match ends at a path separator, if we didn't match\n // the full path, so any remaining pathname is a new path segment.\n if (matchedPath.charAt(matchedPath.length - 1) !== '/') {\n return null;\n }\n\n // If there is a remaining pathname, treat the path separator as part of\n // the remaining pathname for properly continuing the match.\n remainingPathname = '/' + remainingPathname;\n }\n\n return {\n remainingPathname: remainingPathname,\n paramNames: paramNames,\n paramValues: match.slice(1).map(function (v) {\n return v && decodeURIComponent(v);\n })\n };\n}", "function matchPattern(pattern, pathname) {\n // Ensure pattern starts with leading slash for consistency with pathname.\n if (pattern.charAt(0) !== '/') {\n pattern = '/' + pattern;\n }\n\n var _compilePattern2 = compilePattern(pattern),\n regexpSource = _compilePattern2.regexpSource,\n paramNames = _compilePattern2.paramNames,\n tokens = _compilePattern2.tokens;\n\n if (pattern.charAt(pattern.length - 1) !== '/') {\n regexpSource += '/?'; // Allow optional path separator at end.\n }\n\n // Special-case patterns like '*' for catch-all routes.\n if (tokens[tokens.length - 1] === '*') {\n regexpSource += '$';\n }\n\n var match = pathname.match(new RegExp('^' + regexpSource, 'i'));\n if (match == null) {\n return null;\n }\n\n var matchedPath = match[0];\n var remainingPathname = pathname.substr(matchedPath.length);\n\n if (remainingPathname) {\n // Require that the match ends at a path separator, if we didn't match\n // the full path, so any remaining pathname is a new path segment.\n if (matchedPath.charAt(matchedPath.length - 1) !== '/') {\n return null;\n }\n\n // If there is a remaining pathname, treat the path separator as part of\n // the remaining pathname for properly continuing the match.\n remainingPathname = '/' + remainingPathname;\n }\n\n return {\n remainingPathname: remainingPathname,\n paramNames: paramNames,\n paramValues: match.slice(1).map(function (v) {\n return v && decodeURIComponent(v);\n })\n };\n}", "function matchPattern(pattern, pathname) {\n // Ensure pattern starts with leading slash for consistency with pathname.\n if (pattern.charAt(0) !== '/') {\n pattern = '/' + pattern;\n }\n\n var _compilePattern2 = compilePattern(pattern),\n regexpSource = _compilePattern2.regexpSource,\n paramNames = _compilePattern2.paramNames,\n tokens = _compilePattern2.tokens;\n\n if (pattern.charAt(pattern.length - 1) !== '/') {\n regexpSource += '/?'; // Allow optional path separator at end.\n }\n\n // Special-case patterns like '*' for catch-all routes.\n if (tokens[tokens.length - 1] === '*') {\n regexpSource += '$';\n }\n\n var match = pathname.match(new RegExp('^' + regexpSource, 'i'));\n if (match == null) {\n return null;\n }\n\n var matchedPath = match[0];\n var remainingPathname = pathname.substr(matchedPath.length);\n\n if (remainingPathname) {\n // Require that the match ends at a path separator, if we didn't match\n // the full path, so any remaining pathname is a new path segment.\n if (matchedPath.charAt(matchedPath.length - 1) !== '/') {\n return null;\n }\n\n // If there is a remaining pathname, treat the path separator as part of\n // the remaining pathname for properly continuing the match.\n remainingPathname = '/' + remainingPathname;\n }\n\n return {\n remainingPathname: remainingPathname,\n paramNames: paramNames,\n paramValues: match.slice(1).map(function (v) {\n return v && decodeURIComponent(v);\n })\n };\n}", "function matchPattern(pattern, pathname) {\n // Ensure pattern starts with leading slash for consistency with pathname.\n if (pattern.charAt(0) !== '/') {\n pattern = '/' + pattern;\n }\n\n var _compilePattern2 = compilePattern(pattern),\n regexpSource = _compilePattern2.regexpSource,\n paramNames = _compilePattern2.paramNames,\n tokens = _compilePattern2.tokens;\n\n if (pattern.charAt(pattern.length - 1) !== '/') {\n regexpSource += '/?'; // Allow optional path separator at end.\n }\n\n // Special-case patterns like '*' for catch-all routes.\n if (tokens[tokens.length - 1] === '*') {\n regexpSource += '$';\n }\n\n var match = pathname.match(new RegExp('^' + regexpSource, 'i'));\n if (match == null) {\n return null;\n }\n\n var matchedPath = match[0];\n var remainingPathname = pathname.substr(matchedPath.length);\n\n if (remainingPathname) {\n // Require that the match ends at a path separator, if we didn't match\n // the full path, so any remaining pathname is a new path segment.\n if (matchedPath.charAt(matchedPath.length - 1) !== '/') {\n return null;\n }\n\n // If there is a remaining pathname, treat the path separator as part of\n // the remaining pathname for properly continuing the match.\n remainingPathname = '/' + remainingPathname;\n }\n\n return {\n remainingPathname: remainingPathname,\n paramNames: paramNames,\n paramValues: match.slice(1).map(function (v) {\n return v && decodeURIComponent(v);\n })\n };\n}", "function matchPattern(pattern, pathname) {\n // Ensure pattern starts with leading slash for consistency with pathname.\n if (pattern.charAt(0) !== '/') {\n pattern = '/' + pattern;\n }\n\n var _compilePattern2 = compilePattern(pattern),\n regexpSource = _compilePattern2.regexpSource,\n paramNames = _compilePattern2.paramNames,\n tokens = _compilePattern2.tokens;\n\n if (pattern.charAt(pattern.length - 1) !== '/') {\n regexpSource += '/?'; // Allow optional path separator at end.\n }\n\n // Special-case patterns like '*' for catch-all routes.\n if (tokens[tokens.length - 1] === '*') {\n regexpSource += '$';\n }\n\n var match = pathname.match(new RegExp('^' + regexpSource, 'i'));\n if (match == null) {\n return null;\n }\n\n var matchedPath = match[0];\n var remainingPathname = pathname.substr(matchedPath.length);\n\n if (remainingPathname) {\n // Require that the match ends at a path separator, if we didn't match\n // the full path, so any remaining pathname is a new path segment.\n if (matchedPath.charAt(matchedPath.length - 1) !== '/') {\n return null;\n }\n\n // If there is a remaining pathname, treat the path separator as part of\n // the remaining pathname for properly continuing the match.\n remainingPathname = '/' + remainingPathname;\n }\n\n return {\n remainingPathname: remainingPathname,\n paramNames: paramNames,\n paramValues: match.slice(1).map(function (v) {\n return v && decodeURIComponent(v);\n })\n };\n}", "function matchPattern(pattern, pathname) {\n // Ensure pattern starts with leading slash for consistency with pathname.\n if (pattern.charAt(0) !== '/') {\n pattern = '/' + pattern;\n }\n\n var _compilePattern2 = compilePattern(pattern),\n regexpSource = _compilePattern2.regexpSource,\n paramNames = _compilePattern2.paramNames,\n tokens = _compilePattern2.tokens;\n\n if (pattern.charAt(pattern.length - 1) !== '/') {\n regexpSource += '/?'; // Allow optional path separator at end.\n }\n\n // Special-case patterns like '*' for catch-all routes.\n if (tokens[tokens.length - 1] === '*') {\n regexpSource += '$';\n }\n\n var match = pathname.match(new RegExp('^' + regexpSource, 'i'));\n if (match == null) {\n return null;\n }\n\n var matchedPath = match[0];\n var remainingPathname = pathname.substr(matchedPath.length);\n\n if (remainingPathname) {\n // Require that the match ends at a path separator, if we didn't match\n // the full path, so any remaining pathname is a new path segment.\n if (matchedPath.charAt(matchedPath.length - 1) !== '/') {\n return null;\n }\n\n // If there is a remaining pathname, treat the path separator as part of\n // the remaining pathname for properly continuing the match.\n remainingPathname = '/' + remainingPathname;\n }\n\n return {\n remainingPathname: remainingPathname,\n paramNames: paramNames,\n paramValues: match.slice(1).map(function (v) {\n return v && decodeURIComponent(v);\n })\n };\n}", "function matchPattern(pattern, pathname) {\n // Ensure pattern starts with leading slash for consistency with pathname.\n if (pattern.charAt(0) !== '/') {\n pattern = '/' + pattern;\n }\n\n var _compilePattern2 = compilePattern(pattern),\n regexpSource = _compilePattern2.regexpSource,\n paramNames = _compilePattern2.paramNames,\n tokens = _compilePattern2.tokens;\n\n if (pattern.charAt(pattern.length - 1) !== '/') {\n regexpSource += '/?'; // Allow optional path separator at end.\n }\n\n // Special-case patterns like '*' for catch-all routes.\n if (tokens[tokens.length - 1] === '*') {\n regexpSource += '$';\n }\n\n var match = pathname.match(new RegExp('^' + regexpSource, 'i'));\n if (match == null) {\n return null;\n }\n\n var matchedPath = match[0];\n var remainingPathname = pathname.substr(matchedPath.length);\n\n if (remainingPathname) {\n // Require that the match ends at a path separator, if we didn't match\n // the full path, so any remaining pathname is a new path segment.\n if (matchedPath.charAt(matchedPath.length - 1) !== '/') {\n return null;\n }\n\n // If there is a remaining pathname, treat the path separator as part of\n // the remaining pathname for properly continuing the match.\n remainingPathname = '/' + remainingPathname;\n }\n\n return {\n remainingPathname: remainingPathname,\n paramNames: paramNames,\n paramValues: match.slice(1).map(function (v) {\n return v && decodeURIComponent(v);\n })\n };\n}", "function matchPattern(pattern, pathname) {\n // Ensure pattern starts with leading slash for consistency with pathname.\n if (pattern.charAt(0) !== '/') {\n pattern = '/' + pattern;\n }\n\n var _compilePattern2 = compilePattern(pattern),\n regexpSource = _compilePattern2.regexpSource,\n paramNames = _compilePattern2.paramNames,\n tokens = _compilePattern2.tokens;\n\n if (pattern.charAt(pattern.length - 1) !== '/') {\n regexpSource += '/?'; // Allow optional path separator at end.\n }\n\n // Special-case patterns like '*' for catch-all routes.\n if (tokens[tokens.length - 1] === '*') {\n regexpSource += '$';\n }\n\n var match = pathname.match(new RegExp('^' + regexpSource, 'i'));\n if (match == null) {\n return null;\n }\n\n var matchedPath = match[0];\n var remainingPathname = pathname.substr(matchedPath.length);\n\n if (remainingPathname) {\n // Require that the match ends at a path separator, if we didn't match\n // the full path, so any remaining pathname is a new path segment.\n if (matchedPath.charAt(matchedPath.length - 1) !== '/') {\n return null;\n }\n\n // If there is a remaining pathname, treat the path separator as part of\n // the remaining pathname for properly continuing the match.\n remainingPathname = '/' + remainingPathname;\n }\n\n return {\n remainingPathname: remainingPathname,\n paramNames: paramNames,\n paramValues: match.slice(1).map(function (v) {\n return v && decodeURIComponent(v);\n })\n };\n}", "function matchPattern(pattern, pathname) {\n // Ensure pattern starts with leading slash for consistency with pathname.\n if (pattern.charAt(0) !== '/') {\n pattern = '/' + pattern;\n }\n\n var _compilePattern2 = compilePattern(pattern),\n regexpSource = _compilePattern2.regexpSource,\n paramNames = _compilePattern2.paramNames,\n tokens = _compilePattern2.tokens;\n\n if (pattern.charAt(pattern.length - 1) !== '/') {\n regexpSource += '/?'; // Allow optional path separator at end.\n }\n\n // Special-case patterns like '*' for catch-all routes.\n if (tokens[tokens.length - 1] === '*') {\n regexpSource += '$';\n }\n\n var match = pathname.match(new RegExp('^' + regexpSource, 'i'));\n if (match == null) {\n return null;\n }\n\n var matchedPath = match[0];\n var remainingPathname = pathname.substr(matchedPath.length);\n\n if (remainingPathname) {\n // Require that the match ends at a path separator, if we didn't match\n // the full path, so any remaining pathname is a new path segment.\n if (matchedPath.charAt(matchedPath.length - 1) !== '/') {\n return null;\n }\n\n // If there is a remaining pathname, treat the path separator as part of\n // the remaining pathname for properly continuing the match.\n remainingPathname = '/' + remainingPathname;\n }\n\n return {\n remainingPathname: remainingPathname,\n paramNames: paramNames,\n paramValues: match.slice(1).map(function (v) {\n return v && decodeURIComponent(v);\n })\n };\n}", "function matchPattern(pattern, pathname) {\n // Ensure pattern starts with leading slash for consistency with pathname.\n if (pattern.charAt(0) !== '/') {\n pattern = '/' + pattern;\n }\n\n var _compilePattern2 = compilePattern(pattern),\n regexpSource = _compilePattern2.regexpSource,\n paramNames = _compilePattern2.paramNames,\n tokens = _compilePattern2.tokens;\n\n if (pattern.charAt(pattern.length - 1) !== '/') {\n regexpSource += '/?'; // Allow optional path separator at end.\n }\n\n // Special-case patterns like '*' for catch-all routes.\n if (tokens[tokens.length - 1] === '*') {\n regexpSource += '$';\n }\n\n var match = pathname.match(new RegExp('^' + regexpSource, 'i'));\n if (match == null) {\n return null;\n }\n\n var matchedPath = match[0];\n var remainingPathname = pathname.substr(matchedPath.length);\n\n if (remainingPathname) {\n // Require that the match ends at a path separator, if we didn't match\n // the full path, so any remaining pathname is a new path segment.\n if (matchedPath.charAt(matchedPath.length - 1) !== '/') {\n return null;\n }\n\n // If there is a remaining pathname, treat the path separator as part of\n // the remaining pathname for properly continuing the match.\n remainingPathname = '/' + remainingPathname;\n }\n\n return {\n remainingPathname: remainingPathname,\n paramNames: paramNames,\n paramValues: match.slice(1).map(function (v) {\n return v && decodeURIComponent(v);\n })\n };\n}", "function matchPattern(pattern, pathname) {\n // Ensure pattern starts with leading slash for consistency with pathname.\n if (pattern.charAt(0) !== '/') {\n pattern = '/' + pattern;\n }\n\n var _compilePattern2 = compilePattern(pattern),\n regexpSource = _compilePattern2.regexpSource,\n paramNames = _compilePattern2.paramNames,\n tokens = _compilePattern2.tokens;\n\n if (pattern.charAt(pattern.length - 1) !== '/') {\n regexpSource += '/?'; // Allow optional path separator at end.\n }\n\n // Special-case patterns like '*' for catch-all routes.\n if (tokens[tokens.length - 1] === '*') {\n regexpSource += '$';\n }\n\n var match = pathname.match(new RegExp('^' + regexpSource, 'i'));\n if (match == null) {\n return null;\n }\n\n var matchedPath = match[0];\n var remainingPathname = pathname.substr(matchedPath.length);\n\n if (remainingPathname) {\n // Require that the match ends at a path separator, if we didn't match\n // the full path, so any remaining pathname is a new path segment.\n if (matchedPath.charAt(matchedPath.length - 1) !== '/') {\n return null;\n }\n\n // If there is a remaining pathname, treat the path separator as part of\n // the remaining pathname for properly continuing the match.\n remainingPathname = '/' + remainingPathname;\n }\n\n return {\n remainingPathname: remainingPathname,\n paramNames: paramNames,\n paramValues: match.slice(1).map(function (v) {\n return v && decodeURIComponent(v);\n })\n };\n}", "function matchPattern(pattern, pathname) {\n // Ensure pattern starts with leading slash for consistency with pathname.\n if (pattern.charAt(0) !== '/') {\n pattern = '/' + pattern;\n }\n\n var _compilePattern2 = compilePattern(pattern),\n regexpSource = _compilePattern2.regexpSource,\n paramNames = _compilePattern2.paramNames,\n tokens = _compilePattern2.tokens;\n\n if (pattern.charAt(pattern.length - 1) !== '/') {\n regexpSource += '/?'; // Allow optional path separator at end.\n }\n\n // Special-case patterns like '*' for catch-all routes.\n if (tokens[tokens.length - 1] === '*') {\n regexpSource += '$';\n }\n\n var match = pathname.match(new RegExp('^' + regexpSource, 'i'));\n if (match == null) {\n return null;\n }\n\n var matchedPath = match[0];\n var remainingPathname = pathname.substr(matchedPath.length);\n\n if (remainingPathname) {\n // Require that the match ends at a path separator, if we didn't match\n // the full path, so any remaining pathname is a new path segment.\n if (matchedPath.charAt(matchedPath.length - 1) !== '/') {\n return null;\n }\n\n // If there is a remaining pathname, treat the path separator as part of\n // the remaining pathname for properly continuing the match.\n remainingPathname = '/' + remainingPathname;\n }\n\n return {\n remainingPathname: remainingPathname,\n paramNames: paramNames,\n paramValues: match.slice(1).map(function (v) {\n return v && decodeURIComponent(v);\n })\n };\n}", "function matchPattern(pattern, pathname) {\n // Ensure pattern starts with leading slash for consistency with pathname.\n if (pattern.charAt(0) !== '/') {\n pattern = '/' + pattern;\n }\n\n var _compilePattern2 = compilePattern(pattern),\n regexpSource = _compilePattern2.regexpSource,\n paramNames = _compilePattern2.paramNames,\n tokens = _compilePattern2.tokens;\n\n if (pattern.charAt(pattern.length - 1) !== '/') {\n regexpSource += '/?'; // Allow optional path separator at end.\n }\n\n // Special-case patterns like '*' for catch-all routes.\n if (tokens[tokens.length - 1] === '*') {\n regexpSource += '$';\n }\n\n var match = pathname.match(new RegExp('^' + regexpSource, 'i'));\n if (match == null) {\n return null;\n }\n\n var matchedPath = match[0];\n var remainingPathname = pathname.substr(matchedPath.length);\n\n if (remainingPathname) {\n // Require that the match ends at a path separator, if we didn't match\n // the full path, so any remaining pathname is a new path segment.\n if (matchedPath.charAt(matchedPath.length - 1) !== '/') {\n return null;\n }\n\n // If there is a remaining pathname, treat the path separator as part of\n // the remaining pathname for properly continuing the match.\n remainingPathname = '/' + remainingPathname;\n }\n\n return {\n remainingPathname: remainingPathname,\n paramNames: paramNames,\n paramValues: match.slice(1).map(function (v) {\n return v && decodeURIComponent(v);\n })\n };\n}" ]
[ "0.7498675", "0.6678324", "0.66614777", "0.66614777", "0.66614777", "0.66614777", "0.66614777", "0.66614777", "0.66614777", "0.66610277", "0.6649874", "0.66393703", "0.66393703", "0.66393703", "0.65095", "0.6471337", "0.6337194", "0.6104091", "0.6070635", "0.6048713", "0.6048713", "0.604849", "0.6039348", "0.59766895", "0.5952217", "0.5952217", "0.5947508", "0.590712", "0.5903901", "0.58732724", "0.5868318", "0.5855852", "0.58065194", "0.5800497", "0.5800497", "0.57440704", "0.57309383", "0.5695564", "0.5573701", "0.55733377", "0.5554585", "0.5545589", "0.55350935", "0.55350935", "0.55350935", "0.55350935", "0.55350935", "0.55350935", "0.55350935", "0.55350935", "0.55340713", "0.55220866", "0.55220866", "0.55220866", "0.55220866", "0.55220866", "0.55220866", "0.55220866", "0.55220866", "0.55220866", "0.55220866", "0.55220866", "0.55220866", "0.55220866", "0.55220866", "0.55220866" ]
0.6640097
42
A public higherorder component to access the imperative API
function withRouter(Component) { var displayName = "withRouter(" + (Component.displayName || Component.name) + ")"; var C = function C(props) { var wrappedComponentRef = props.wrappedComponentRef, remainingProps = _objectWithoutPropertiesLoose(props, ["wrappedComponentRef"]); return React.createElement(context.Consumer, null, function (context) { !context ? false ? 0 : invariant(false) : void 0; return React.createElement(Component, _extends({}, remainingProps, context, { ref: wrappedComponentRef })); }); }; C.displayName = displayName; C.WrappedComponent = Component; if (false) {} return hoistStatics(C, Component); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function FunctionalComponent() {}", "function higherOrder(a) {\n a(); \n}", "function purchaseItem(...fns) => fns.reduce(compose)\n\n{} // so I have to make sure that I have returned in here this property", "_isolatedComputeForWrapper(component) {\n const computations = ReactInterpreter.computations(component);\n return this.optimizer.compute(computations);\n }", "function purchaseItem(...fns) => fns.reduce(compose)\n\n{} // the reduce function which is in itself a higher order function", "get asTraversal() {\n return traversal(this.reduce, this.toArray, this.over)\n }", "_makeIterator() {\n return this.fn.apply(this.context, this.args);\n }", "fmap (_) {\n return this\n }", "function Composition() {}", "function Composition() {}", "function Composition() {}", "function Composition() {}", "ap (aFn) { \n //return this.fmap(aFn.value)\n return aFn.chain(fn => Right.of(fn(this.value)))\n }", "[Symbol.iterator]() {\n return this.inOrder();\n }", "function bind(fn, thisArg, ...outerArgs){\n// rest operator \n return function(...innerArgs) {\n// spread operator\n return fn.apply(thisArg, [...outerArgs, ...innerArgs]);\n }\n}", "function accessM(f) {\n return P.chain_(environment(), f);\n}", "function Component() {\n return this; // this is needed in Edge !!!\n } // Component is lazily setup because it needs", "_precomputeComputeForWrapper(component) {\n const computations = ReactInterpreter.computations(component);\n const computedValues = this.optimizer.compute(computations);\n this.renderer.notifyAboutCompute(component, computations, computedValues);\n return computedValues;\n }", "function\nXATS2JS_lazy_cfr(a1x1)\n{\nlet xtmp1;\nlet xtmp3;\n;\nxtmp3 =\nfunction()\n{\nlet xtmp2;\n{\nxtmp2 = a1x1();\n}\n;\nreturn xtmp2;\n} // lam-function\n;\nxtmp1 = XATS2JS_new_lazy(xtmp3);\nreturn xtmp1;\n} // function // XATS2JS_lazy_cfr(0)", "function i(e){[\"next\",\"throw\",\"return\"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}", "function intermediate() { }", "function e(e){return (0, F[e.operation])(...e.parameters)}", "function z(){// can be called as an API method\nD(),F()}", "static dimap(context) {\n return new Hask(function(f) {\n return new Hask(function(g) {\n return new Hask(function(p) {\n if (p instanceof Pierce) {\n const getter = Hask.compose(context).call(p.getter).call(f);\n\n const setter = Hask.compose(context).call(Hask.compose(context).call(g).call(p.setter)).call(Hask.first(context).call(f));\n\n return new Pierce(getter, setter);\n } else {\n throw new TypeError(\"p\");\n }\n });\n });\n });\n }", "function higherOrder( callbackFn ){\n //call the callback function inside body\n callbackFn() //this is a function call.\n}", "parameterizer() {\n return __awaiter(this, void 0, void 0, function* () {\n const deployed = this.requireDeployed();\n return yield deployed.methods.parameterizer().call();\n });\n }", "*[Symbol.iterator]() {\n let i = 0\n while (i < this.size()) {\n yield this.get(i)\n i++\n }\n }", "function Xb(){return function(v){return v}}", "function\nXATS2JS_lazy_vt_cfr(a1x1)\n{\nlet xtmp10;\nlet xtmp12;\nlet xtmp13;\n;\nxtmp12 =\nfunction()\n{\nlet xtmp11;\n{\nxtmp11 = a1x1();\n}\n;\nreturn xtmp11;\n} // lam-function\n;\nxtmp13 =\nfunction()\n{\nlet xtmp11;\n} // lam-function\n;\nxtmp10 = XATS2JS_new_llazy(xtmp12,xtmp13);\nreturn xtmp10;\n} // function // XATS2JS_lazy_vt_cfr(2)", "function curry(func) {\n // Your code goes here\n}", "get $__ctx__() { return LOBBY.__proto__; }", "[Symbol.iterator]() { return this; }", "[Symbol.iterator]() { return this; }", "[Symbol.iterator]() { return this; }", "[Symbol.iterator]() { return this; }", "[Symbol.iterator]() { return this; }", "value(...args) {\n return [...this][methodName](...args);\n }", "function purchaseItem(...fns) => fns.reduce(compose)\n\n{} // & act over the data that we receive", "function compose(fns) {\n\n\n}", "function __it() {}", "function MyFunctionalComponent() {\n return <input />;\n}", "ap (_) { \n return this\n }", "constructor() {\r\n let useCalled = false;\r\n\r\n this.run = async (...args) => {\r\n if (useCalled) {\r\n const next = args.pop();\r\n\r\n next();\r\n }\r\n return args;\r\n };\r\n\r\n addProp(this, 'use',\r\n /**\r\n * Agrega un middleware al workflow\r\n * @param {Function} fn - función middleware a agregar\r\n *\r\n * @return {this} - Retorna la actual instancia\r\n */\r\n (fn) => {\r\n useCalled = true;\r\n\r\n this.run = ((stack) => (async (...args) => {\r\n const next = args.pop();\r\n\r\n return stack.call(this, ...args, async () => fn.call(this, ...args, next.bind(this, ...args)));\r\n }).bind(this))(this.run);\r\n\r\n return this;\r\n }\r\n );\r\n }", "function getImplementation( cb ){\n\n }", "[Symbol.iterator]() {\n return this.container[Symbol.iterator]();\n }", "function promoterenhancer(){\n\n}", "function accessManaged(f) {\n return core.chain_((0, _environment.environment)(), f);\n}", "[Symbol.iterator]() {\n return this.#array[Symbol.iterator]();\n }", "function modifierFactory(callback) {\n return iteratorFactory(wrapperFactory(callback))\n}", "function justInvoke(fn){\n return fn()\n}//justInvoke", "function FunctionIterable(fn){\n this.fn = fn\n}", "function getMakeActive(){\n /*void -> function*/\n return function(){makeActive(this);}\n}", "function getMakeActive(){\n /*void -> function*/\n return function(){makeActive(this);}\n}", "function invoker() {\n // using a regular function as higher order by passing it other functions\n return greeting(hello, goodbye);\n}", "function compose2 (f, g) {\n\tfunction next(a) {\n\n\t};\n\n}", "function g(a){[\"next\",\"throw\",\"return\"].forEach(function(b){a[b]=function(a){return this._invoke(b,a)}})}", "function l(e){[\"next\",\"throw\",\"return\"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}", "function internals(){\r\n return {a: acc, b: brs, c: cnt, m: m, r: r};\r\n }", "function oi(){}", "*[Symbol.iterator]() {\n const length = this.length;\n for (let i = 0 ; i < length ; i++) {\n yield this.get(i);\n }\n }", "function makeOpComposition () {\n \n var ops = []; \n var domain = makeEmptyMap(); \n var gen = 0; \n \n var func = function (s) {\n return function (i) {\n return evaluate(domain.has(i) ? (ops.length-1) - (gen-domain.get(i)) : -1, i)(i);\n }\n \n // determine selection state of i but only access the elements \n // of ops (staring from ind) that have i in their domain\n function evaluate(ind, i) {\n if (ind < 0) return s; // i defined in the base selection mapping s\n else {\n var op = ops[ind];\n return op(function (j) { return evaluate(ind - op.domain.get(i), j)(i); });\n // the call to evaluate is wrapped to a lambda to make the call lazy.\n // op will only call the lambda if op.f.constant is false\n }\n }\n }\n \n func.domain = domain;\n \n // member functions of func\n func.push = function (op) {\n ops.push(op);\n ++gen\n op.domain.forEach(function(_, i) {\n op.domain.set(i, domain.has(i) ? gen - domain.get(i) : ops.length);\n domain.set(i, gen); \n });\n }\n func.pop = function () {\n var n = ops.length;\n var op = ops.pop();\n --gen;\n // domain updated for those elements that are in op.domain\n op.domain.forEach(function (_, i) {\n if (op.domain.get(i) >= n) domain.delete(i); // no op defines i\n else domain.set(i, domain.get(i) - op.domain.get(i)); \n });\n return op;\n }\n func.top = function () { return ops[ops.length - 1]; }\n func.top2 = function () { return ops[ops.length - 2]; }\n func.shift = function (bmap) {\n var op = ops.shift();\n op.domain.forEach(function(_, i) {\n if (domain.get(i) - gen === ops.length) { domain.delete(i); }\n // if lastOp the only op that defines i, remove i from domain\n });\n return op;\n }\n func.size = function () { return ops.length; }\n func.removeIndex = function (i) {\n if (!domain.has(i)) return;\n \n // find the first op in ops that defines i\n var j = (ops.length - 1) - (gen - domain.get(i));\n \n while (j >= 0) {\n var d = ops[j].domain.get(i);\n ops[j].domain.delete(i);\n j -= d;\n }\n domain.delete(i);\n }\n \n return func;\n }", "obtain(){}", "static second(context) {\n return new Hask(function(p) {\n if (p instanceof Pierce) {\n const getter = Hask.second(context).call(p.getter);\n\n const setter = new Hask(function(__x_s_b__) {\n return __x_s_b__.call(new Hask(function(__x_s__) {\n return new Hask(function(b) {\n return Hask.second(context).call(new Hask(function(s) {\n return p.setter.call(Hask.Tuple(context).call(s).call(b));\n })).call(__x_s__);\n });\n }));\n });\n\n return new Pierce(getter, setter);\n } else {\n throw new TypeError(\"p\");\n }\n });\n }", "[ Symbol.iterator]( ...args){\n\t\t// look at retained state\n\t\tconst iteration= this.state&& this.state[ Symbol.iterator]\n\t\tif( iteration){\n\t\t\t// & iterate through it all\n\t\t\treturn iteration.call( this.state, ...args)\n\t\t}\n\t}", "chain(_) {\n return this\n }", "function liftf(fn){\n return function buffalo(x){ // arrow funcs are anonymous funcs\n return function wings(y){\n return fn(x,y)\n }\n }\n}", "function __func(){}", "function liftg(binary) {\n return function(first) {\n if (first === undefined) {\n return first;\n }\n return function more(next) {\n if (next === undefined) {\n return first;\n }\n first = binary(first, next);\n return more;\n };\n };\n}", "function\nXATS2JS_llazy_cfr(a1x1)\n{\nlet xtmp5;\nlet xtmp7;\nlet xtmp8;\n;\nxtmp7 =\nfunction()\n{\nlet xtmp6;\n{\nxtmp6 = a1x1();\n}\n;\nreturn xtmp6;\n} // lam-function\n;\nxtmp8 =\nfunction()\n{\nlet xtmp6;\n} // lam-function\n;\nxtmp5 = XATS2JS_new_llazy(xtmp7,xtmp8);\nreturn xtmp5;\n} // function // XATS2JS_llazy_cfr(1)", "function I(){return L.apply(null,arguments)}", "consstructor(){\n this.traverseMethod = 'pre-order';\n }", "function xs(t, e, n, r) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__awaiter\"])(this, void 0, void 0, (function() {\n var i, o, s, u, a, c;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__generator\"])(this, (function(h) {\n switch (h.label) {\n case 0:\n // PORTING NOTE: On Web only, we inject the code that registers new Limbo\n // targets based on view changes. This allows us to only depend on Limbo\n // changes when user code includes queries.\n return t.$o = function(e, n, r) {\n return function(t, e, n, r) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__awaiter\"])(this, void 0, void 0, (function() {\n var i, o, s;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__generator\"])(this, (function(u) {\n switch (u.label) {\n case 0:\n return i = e.view._o(n), i.Nn ? [ 4 /*yield*/ , zi(t.localStore, e.query, \n /* usePreviousResults= */ !1).then((function(t) {\n var n = t.documents;\n return e.view._o(n, i);\n })) ] : [ 3 /*break*/ , 2 ];\n\n case 1:\n // The query has a limit and some docs were removed, so we need\n // to re-run the query against the local store to make sure we\n // didn't lose any good docs that had been past the limit.\n i = u.sent(), u.label = 2;\n\n case 2:\n return o = r && r.targetChanges.get(e.targetId), s = e.view.applyChanges(i, \n /* updateLimboDocuments= */ t.isPrimaryClient, o), [ 2 /*return*/ , (Ks(t, e.targetId, s.To), \n s.snapshot) ];\n }\n }));\n }));\n }(t, e, n, r);\n }, [ 4 /*yield*/ , zi(t.localStore, e, \n /* usePreviousResults= */ !0) ];\n\n case 1:\n return i = h.sent(), o = new Ss(e, i.Bn), s = o._o(i.documents), u = un.createSynthesizedTargetChangeForCurrentChange(n, r && \"Offline\" /* Offline */ !== t.onlineState), \n a = o.applyChanges(s, \n /* updateLimboDocuments= */ t.isPrimaryClient, u), Ks(t, n, a.To), c = new Ns(e, n, o), \n [ 2 /*return*/ , (t.Po.set(e, c), t.Vo.has(n) ? t.Vo.get(n).push(e) : t.Vo.set(n, [ e ]), \n a.snapshot) ];\n }\n }));\n }));\n}", "[Symbol.iterator]() {\n return this.items[Symbol.iterator]();\n }", "[Symbol.iterator]() {\n return this.items[Symbol.iterator]();\n }", "function Hoc(WrappedComponent) {\n return (0, _Guac2.default)(WrappedComponent);\n}", "[Symbol.iterator]() {\n return this._items[Symbol.iterator]();\n }", "compute() {\n\n}", "[Symbol.iterator]() {\n return stack[Symbol.iterator]();\n }", "inorderTraversal() {\n\n }", "function compose() {\n \n const args = arguments;\n const start = args.length - 1;\n // console.log('----------------------------------------')\n // console.log('arguments: ',arguments)\n // console.log('args: ',args)\n // console.log('start: ',start)\n\n return function () {\n\n let i = start;\n let result = args[start].apply(this, arguments);\n\n // console.log('i antes del while: ',i)\n // console.log('result antes del while: ',result)\n\n while (i--) {\n\n result = args[i].call(this, result);\n // console.log('Op: args[i].call(this), result: ',args[i].call(this, result))\n // console.log('i en el while: ',i)\n // console.log('result en el while: ',result)\n }\n\n // console.log('result antes de retornar: ',result)\n return result;\n }\n}", "function ApolloWrapper({ children }) {\n return <ApolloProvider client={client}>{children}</ApolloProvider>\n}", "function includeHelpers(func) {\n\n // ## jam.identity()\n\n // Simple function that passes the values it receives to the next function.\n // Useful if you need a `process.nextTick` inserted in-between your call chain.\n func.identity = function(next) {\n function _identity(next) {\n var args = arguments;\n tick(function() {\n next.apply(this, replaceHead(args, null));\n });\n }\n\n // This function can also be passed to jam verbatim.\n return (typeof next === 'function') ?\n _identity.apply(this, arguments) :\n _identity;\n };\n\n // ## jam.nextTick()\n\n // Alias for `.identity`. Use when you need a `process.nextTick` inserted in-between\n // your call chain.\n func.nextTick = func.identity\n\n // ## jam.return( [args...] )\n\n // Returns a set of values to the next function in the chain. Useful when you want to\n // pass in the next function verbatim without wrapping it in a `function() { }` just\n // to pass values into it.\n func.return = function() {\n var args = toArgs(arguments);\n return function(next) {\n args.unshift(null);\n next.apply(this, args);\n };\n };\n\n // ## jam.null()\n\n // Similar to `.identity` but absorbs all arguments that has been passed to it and\n // forward nothing to the next function. Effectively nullifying any arguments passed\n // from previous jam call.\n // \n // Like `jam.identity`, this function can be passed to the jam chain verbatim.\n func.null = function(next) {\n function _null(next) { next(); }\n\n return (typeof next === 'function') ? _null.call(this, next) : _null;\n };\n\n // ## jam.call( function, [args...] )\n\n // Convenience for calling functions that accepts arguments in standard node.js\n // convention. Since jam insert `next` as first argument, most functions cannot be\n // passed directly into the jam chain, thus this helper function.\n // \n // If no `args` is given, this function passes arguments given to `next()` call from\n // previous function directly to the function (with proper callback) placement).\n // \n // Use this in combination with `jam.return` or `jam.null` if you want to control the\n // arguments that are passed to the function.\n func.call = function(func) {\n ensureFunc(func, 'function');\n\n var args = toArgs(arguments);\n args.shift(); // func\n\n if (args.length) { // use provided arguments\n return function(next) {\n args.push(next);\n func.apply(this, args);\n };\n\n } else { // use passed-in arguments during chain resolution\n return function(next) {\n args = toArgs(arguments);\n args.shift(); // move next to last position\n args.push(next);\n\n func.apply(this, args);\n };\n }\n };\n\n // ## jam.each( array, iterator( next, element, index ) )\n\n // Execute the given `iterator` function for each element given in the `array`. The\n // iterator is given a `next` function and the element to act on. The next step in the\n // chain will receive the original array passed verbatim so you can chain multiple\n // `.each` calls to act on the same array.\n // \n // You can also pass `arguments` and `\"strings\"` as an array or you can omit the array\n // entirely, in which case this method will assume that the previous chain step\n // returns something that looks like an array as its first result.\n // \n // Under the hood, a JAM step is added for each element. So the iterator will be\n // called serially, one after another finish. A parallel version maybe added in the\n // future.\n func.each = function(array, iterator) {\n if (typeof array === 'function') {\n iterator = array;\n array = null\n } else {\n ensureArray(array, 'array');\n }\n\n ensureFunc(iterator, 'iterator');\n\n return function(next, array_) {\n var arr = array || array_;\n\n // Builds another JAM chain internally\n var chain = jam(jam.identity)\n , count = arr.length;\n\n for (var i = 0; i < count; i++) (function(element, i) {\n chain = chain(function(next) { iterator(next, element, i); });\n })(arr[i], i);\n\n chain = chain(function(next) { next(null, arr); });\n return chain(next);\n };\n };\n\n // ## jam.map( array, iterator( next, element, index ) )\n\n // Works exactly like the `each` helper but if a value is passed to the iterator's\n // `next` function, it is collected into a new array which will be passed to the next\n // function in the JAM chain after `map`.\n // \n // Like with `each`, you can omit the `array` input, in which case this method will\n // assume that the previous chain step returns something that looks like an array as\n // its first result.\n func.map = function(array, iterator) {\n if (typeof array === 'function') {\n iterator = array;\n array = null;\n } else {\n ensureArray(array, 'array');\n }\n\n ensureFunc(iterator, 'iterator');\n\n return function(next, array_) {\n var arr = array || array_;\n\n // Builds another JAM chain internally and collect results.\n // TODO: Dry with .each?\n var chain = jam(jam.identity)\n , count = arr.length\n , result = [];\n\n for (var i = 0; i < count; i++) (function(element, i) {\n chain = chain(function(next, previous) {\n result.push(previous);\n iterator(next, element, i);\n });\n })(arr[i], i);\n\n chain = chain(function(next, last) {\n result.push(last);\n result.shift(); // discard first undefined element\n next(null, result);\n });\n\n return chain(next);\n };\n };\n\n // ## jam.timeout( timeout )\n\n // Pauses the chain for the specified `timeout` using `setTimeout`. Useful for\n // inserting a delay in-between a long jam chain.\n func.timeout = function(timeout) {\n ensureNum(timeout, 'timeout');\n\n return function(next) {\n var args = replaceHead(arguments, null);\n setTimeout(function() { next.apply(this, args); }, timeout);\n };\n };\n\n // ## jam.promise( [chain] )\n\n // Returns a JAM promise, useful when you are starting an asynchronous call outside of\n // the JAM chain itself but wants the callback to call into the chain. In other words,\n // this allow you to put a 'waiting point' (aka promise?) into existing JAM chain that\n // waits for the initial call to finish and also pass any arguments passed to the\n // callback to the next step in the JAM chain as well.\n //\n // This function will returns a callback that automatically bridges into the JAM\n // chain. You can pass the returned callback to any asynchronous function and the JAM\n // chain (at the point of calling .promise()) will wait for that asynchronous function\n // to finish effectively creating a 'waiting point'.\n //\n // Additionally, any arguments passed to the callback are forwarded to the next call\n // in the JAM chain as well. If errors are passed, then it is fast-forwarded to the\n // last handler normally like normal JAM steps.\n func.promise = function(chain) {\n chain = typeof chain === 'function' ? chain : // chain is supplied\n typeof this === 'function' ? this : // called from the chain variable\n ensureFunc(chain, 'chain'); // fails\n\n if (typeof chain === 'undefined' && typeof this === 'function') {\n chain = this;\n }\n\n var args = null, next = null;\n\n chain(function(next_) {\n if (args) return next_.apply(this, args); // callback already called\n next = next_; // wait for callback\n });\n\n return function() {\n if (next) return next.apply(this, arguments); // chain promise already called\n args = arguments; // wait for chain to call the promise\n };\n };\n\n // TODO: noError() ? or absorbError()\n return func;\n }", "function a(e){return function(t){return i(t,e)}}", "function a(e){return function(t){return i(t,e)}}", "function PipeDecorator(){}// WARNING: interface has both a type and a value, skipping emit", "chain (_) {\n return this \n }", "async execPipeline(operation, scope) {\n scope = await fetch(scope, operation, this.fetcher, this) // eslint-disable-line no-param-reassign\n const ops = operation.operations.slice()\n const firstOp = ops.shift()\n debug('first op', firstOp)\n let current = await this.exec(firstOp, scope)\n debug('first op result:', current)\n while (ops.length > 0) {\n debug('current:', current)\n const nextOp = ops.shift()\n debug('nextOp:', nextOp)\n current = await this.pipe(nextOp, current) // eslint-disable-line no-await-in-loop\n }\n debug('current:', current)\n return current\n }", "function PebbleChain () {}", "mutate() {}", "mutate() {}", "function wrapper() {\r\n this.render = () => {\r\n return element;\r\n };\r\n }", "function zi(){return zi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zi.apply(this,arguments)}", "init(){\n this.initFunctional();\n }", "*[Symbol.iterator]() {\n let node = this.head;\n\n while(node) {\n yield node;\n node = node.next;\n }\n }", "function outer() {\n // Arrow Functionで定義した関数を返す\n return () => {\n // この関数の外側には`outer`関数が存在する\n // `outer`関数に`this`を書いた場合と同じ\n return this;\n };\n}", "function WorkShopModule(teacher) {\n var publicAPI = { ask, }\n return publicAPI;\n\n function ask(question) {\n console.log(teacher, question)\n }\n}", "function IntroToFuncComp() {\n\treturn <Demo></Demo>;\n}", "function Iterable() {}", "async index () {\n return await Operator.all()\n }", "[Symbol.iterator]() {\n this._update();\n return this._list[Symbol.iterator]();\n }", "*[Symbol.iterator]() {\n let pointer = this.head\n while (pointer) {\n yield pointer\n pointer = pointer.next\n }\n }" ]
[ "0.6070405", "0.57829124", "0.57713205", "0.56781846", "0.5601167", "0.53402764", "0.53382486", "0.52356786", "0.5168645", "0.5168645", "0.5168645", "0.5168645", "0.5148882", "0.5085232", "0.50566614", "0.50550544", "0.5034251", "0.50302976", "0.50270486", "0.5023248", "0.502224", "0.5016028", "0.5014526", "0.5014175", "0.50051147", "0.5003476", "0.49979734", "0.49823397", "0.49816474", "0.49727017", "0.49667972", "0.49628374", "0.49628374", "0.49628374", "0.49628374", "0.49628374", "0.49601468", "0.49575025", "0.49443895", "0.49414265", "0.4935344", "0.49250248", "0.49121928", "0.49021038", "0.48954836", "0.48854446", "0.48814353", "0.48802233", "0.4874045", "0.48712453", "0.487087", "0.48653874", "0.48653874", "0.48605233", "0.48603144", "0.4858461", "0.48485994", "0.48343655", "0.48313093", "0.48246416", "0.48242006", "0.4822174", "0.48213613", "0.48201957", "0.48199242", "0.48155484", "0.4805815", "0.48057586", "0.4803029", "0.47947428", "0.47861582", "0.4784024", "0.47799742", "0.47799742", "0.47779304", "0.47721267", "0.47715467", "0.47705394", "0.47664726", "0.47578508", "0.47476286", "0.47335467", "0.4730439", "0.4730439", "0.4730165", "0.47248197", "0.47093597", "0.47075045", "0.47074223", "0.47074223", "0.4701822", "0.46976206", "0.46974647", "0.46968013", "0.4694239", "0.46939474", "0.46898815", "0.4683502", "0.46831843", "0.4680023", "0.46784443" ]
0.0
-1
Reads file as HTML AST
function readHTML(file) { return parse(readFileSync(file, 'utf-8')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadHTML(path,name) {\n html[name] = pug.compile(fs.readFileSync(__dirname+path,\"utf8\"))\n}", "function parseFile(err, contents) {\r\n const output = parse(contents, {\r\n columns: true,\r\n skip_empty_lines: true\r\n });\r\n\r\n // Call build function. Interpret and construct Org Chart\r\n buildOutput(output);\r\n}", "function from_file(page) {\n let str = require('fs').readFileSync('./tests/cache/' + page.toLowerCase() + '.txt', 'utf-8');\n let r = wtf.parse(str);\n console.log(r.citations);\n return r;\n}", "function treeForFile (file) {\n var contents = null\n try {\n contents = fs.readFileSync(file).toString()\n } catch (err) {\n if (err.code === 'ENOENT') {\n logger.error(\"File not found: \"+file)\n process.exit(1)\n }\n throw err\n }\n var name = path.basename(file),\n parser = new Parser()\n\n parser.file = name\n // Parse and type-check the file; catch and report any errors\n try {\n var tree = parser.parse(contents),\n typesystem = new TypeSystem()\n typesystem.walk(tree)\n } catch (err) {\n reportError(err)\n process.exit(1)\n }\n return tree\n}// treeForFile", "function processFileHTML(doc){\n // parse out into blocks\n // re-assemble with new paragraph numbering\n // add style sheet\n // move assets to the assets folder\n return doc;\n}", "function from_file(page) {\n let str = require('fs').readFileSync('./tests/cache/' + page.toLowerCase() + '.txt', 'utf-8');\n // console.log(wtf.plaintext(str));\n let r = wtf.parse(str);\n console.log(r.translations);\n // console.log(JSON.stringify(r.sections, null, 2));\n}", "function compileToReadableHTML() {\n return src(srcFiles.pathPug)\n .pipe(\n pug({\n pretty: true,\n })\n )\n .pipe(dest(destFolders.readable));\n}", "function openHTML(response, filename){\n\tcontent = fs.readFileSync(\"./PUBLIC/\" + filename );\n\tresponse.end(content);\n}", "function parseDocument(file) {\n const inputString = fs.readFileSync(file, 'utf-8');\n return DocumentParser.parse(inputString);\n}", "async parse(options = {}) {\n if (!this.file.path) {\n throw new Error(`Missing underlying file component with a path.`)\n }\n\n const { code, ast, meta } = await require('@skypager/helpers-mdx')(this.content, {\n filePath: this.file.path,\n ...options,\n rehypePlugins: [\n () => tree => {\n this.state.set('rehypeAst', tree)\n return tree\n },\n ],\n babel: false,\n })\n\n this.state.set('parsed', true)\n this.state.set('parsedContent', code)\n\n return { ast, code, meta }\n }", "function getHTMLForFile(fileObj, ignorePrivate) {\n \n var txt = \"\";\n \n txt += \"<a name=\\\"\" + fileObj.shortName + \"\\\"></a><article>\" + le;\n txt += \"<p class=\\\"path\\\">\" + fileObj.path + \"</p>\" + le;\n// txt += \"<p>\" + toHTML(fileObj.desc) + \"</p>\" + le;\n \n var i;\n for (i = 0; i < fileObj.entries.length; i++) {\n \n var entry = fileObj.entries[i];\n \n if (entry.code === null) {\n console.log(\"Ignoring entry for unknown context\", entry);\n totalUnprocessed++;\n continue;\n }\n else if (entry.code.type == \"comment\") {\n console.log(\"Ignoring entry for comment\", entry);\n totalUnprocessed++;\n continue;\n }\n else if (ignorePrivate && entry.comment.access == \"private\") {\n continue; \n }\n else {\n \n var printName = entry.code.string;\n \n if (entry.code.type == \"module\") {\n txt += \"<h1>\" + fileObj.shortName + \" module</h1>\" + le;\n // txt += \"<pre><code><h2>\" + printName + \"</h2></code></pre>\"; \n } \n else {\n if (entry.comment.isClass) {\n printName = entry.code.name + \" Class\";\n entry.comment.returns = entry.code.name;\n }\n \n txt += \"<pre><code><h2>\" + printName + \"</h2></code></pre>\";\n txt += \"<p><strong>type/returns: </strong><code>\" + toHTML(entry.comment.returns) + \"</code></p>\" + le;\n txt += \"<p><strong>access: </strong><code>\" + entry.comment.access + \"</code></p>\" + le; \n }\n \n txt += \"<p>\" + toHTML(entry.comment.body) + \"</p>\" + le;\n txt += \"<hr>\" + le; \n \n } \n }\n \n txt += \"</article>\" + le;\n txt += \"<hr>\" + le;\n txt += \"<hr>\" + le;\n \n return txt;\n \n }", "async function readFile(filePath) {\r\n fs.readFile(filePath, \"utf8\", (err, data) => {\r\n if (err) {\r\n console.error(err);\r\n } else {\r\n // create html file in dist\r\n writeHTML(data, filePath);\r\n }\r\n });\r\n}", "function loadHTML(data) {\n var readmeHTML = marked(data); //Render README from markdown to HTML\n var target = document.getElementById(\"readme\");\n target.innerHTML = readmeHTML;\n}", "function readHtmls(request, response) {\r\n\tvar pathName = url.parse(request.url).pathname;\r\n\r\n\t// get the suffix of files\r\n var suffix = pathName.match(/(\\.[^.]+|)$/)[0];\r\n\r\n // read html(with userName or not), css and js\r\n switch(suffix) {\r\n \tcase\".css\":\r\n \tcase\".js\":\r\n\t \treadCss(request, response, suffix);\r\n \t\tbreak;\r\n\r\n \tdefault:\r\n \t readIsExist(request,response);\r\n }\r\n}", "function processFile(file, jsdom, cb) {\n fs.readFile(file, 'utf8', function(err, body) {\n if(err) return cb(err);\n jsdom.env({\n html: body,\n src: [jquery],\n done: cb\n });\n });\n}", "function readFile() {\n\t\tlet reader = new FileReader();\n\t\treader.addEventListener('loadend', () => {\n\t\t\tparseFile(reader.result);\n\t\t});\n\t\treader.readAsText(this.files[0]);\n\t}", "function html() {\n\treturn gulp.src(paths.pug)\n\t.pipe($.plumber({ errorHandler: $.notify.onError('<%= error.message %>') }))\n\t.pipe($.data(function(file){\n\t\tlet dirname = './json/';\n\t\tlet files = fs.readdirSync(dirname);\n\t\tlet json = {};\n\t\tfiles.forEach(function(filename){\n\t\t\tjson[filename.replace('.json', '')] = require(dirname + filename);\n\t\t});\n\t\treturn { data: json };\n\t}))\n\t.pipe($.pug({\n\t\tpretty: true,\n\t\tbasedir: __dirname + '/src',\n\t}))\n\t.pipe(gulp.dest(paths.htmlDest));\n}", "static process_file(filename)\r\n {\r\n if (fs === null)\r\n {\r\n throw new Error(\"Not in node.js : module fs not defined. Aborting.\");\r\n }\r\n if (DEBUG)\r\n {\r\n console.log('Processing file:', filename);\r\n console.log('--------------------------------------------------------------------------');\r\n }\r\n let data = Hamill.read_file(filename);\r\n let doc = this.process_string(data);\r\n doc.set_name(filename);\r\n return doc;\r\n }", "function html() {\n return src('src/*.html')\n .pipe(changed('build'))\n .pipe(htmlMin({\n collapseWhitespace: true,\n removeComments: true\n }))\n .pipe(dest('build'))\n}", "function getContent(filename) {\n var pageContent = HtmlService.createTemplateFromFile(filename).getRawContent();\n return pageContent;\n}", "function MarkdownToHTML(relpath, markdown_div)\n{\n var callback = function (text) {\n html = Showdown(text);\n fillDiv(html, markdown_div);\n $('.linenums').removeClass('linenums');\n prettyPrint();\n };\n getFile(relpath, callback);\n}", "function generateBodyHtmlForFile(file) {\n var parts = getLinesFromPost(file);\n var body = marked(parts['body']);\n var metadata = parseMetadata(parts['metadata']);\n metadata['relativeLink'] = tools.externalFilenameForFile(file);\n return body;\n }", "function readRepoStructureFile(filename) {\n\n var file = filename.split('/')[3];\n var owner = file.split('_')[0];\n var repoName = file.split('_')[1];\n repoName = repoName.substring(0, repoName.length-5);\n console.log(\"Owner: \"+owner);\n console.log(\"RepoName: \"+repoName);\n fs.readFile(filename, function(err,data) {\n if (err) {\n return console.log(err);\n }\n var items = JSON.parse(data).tree;\n //console.log(\"Tree \"+JSON.stringify(items));\n getEJSFiles(items, owner, repoName);\n });\n\n}", "function compileFile(){\n var fn = jade.compileFile(\"./view/compileFile.jade\", {debug:true,pretty:true});\n return fn();\n}", "function getHtml() {\n jsdom.env(\n options.url,\n parseHtml\n );\n }", "function read_html_filetemplate(err, res, body) {\n\n\tvar query = querystring.stringify({\n\t\tcatalogName: \"dbo.Empleado\",\n\t\tcontrolType: \"fileTemplate\",\n\t\tfilters: \"'id=1'\",\n\t\toutput: \"html\"\n\t})\n\n\tfrisby.create('Read HTML FileTemplate')\n\t .addHeader('Cookie', session_cookie) // Pass session cookie with each request\n\t\t.get(url + '/api/read?' + query)\n\t\t.expectStatus(200)\n\t\t.expectHeaderContains('content-type', 'text/html')\n\t\t.after(logout)\n\t.toss()\n}", "function includeHtml() {\n let contents = fs.readFileSync('header.html').toString();\n let header = document.getElementById('header');\n header.innerHTML = contents;\n}", "async compile(filepath) {\n const siteData = await helper.siteData();\n const currentUrl = path.relative(\n './src',\n _.replace(filepath, '.md', '.html')\n );\n const destination = `./docs/${currentUrl}`;\n\n // Read file, and extract front-matter from raw text\n const rawContent = await helper.readFile(filepath);\n const parsed = frontMatter(rawContent);\n const fileData = parsed.attributes;\n const pageData = _.merge({}, siteData, fileData);\n\n // Update {{config}} placeholders\n let markdownBody = parsed.body;\n _.each(pageData.config, (value, key) => {\n markdownBody = _.replace(\n markdownBody,\n new RegExp(`{{${key}}}`, 'g'),\n value\n );\n });\n\n // Convert markdown to html\n const htmlBody = markdown.render(markdownBody);\n\n // Add the hierarchy of headings to the matching link in the sidebar\n const headings = this.getHeadings(htmlBody);\n const sidebar = _.clone(pageData.sidebar);\n _.each(sidebar, category => {\n _.each(category.pages, page => {\n const linkBasename = path.basename(page.url, '.html');\n if (linkBasename === currentUrl) {\n page.headings = headings; // eslint-disable-line no-param-reassign\n }\n });\n });\n\n // Init layout\n const layoutName = fileData.layout;\n const layoutFile = `./src/_layouts/${layoutName}.pug`;\n const layoutContent = await helper.readFile(layoutFile);\n const pugCompile = pug.compile(layoutContent, { filename: layoutFile });\n\n // Compile layout\n const compileData = {\n ...pageData,\n sidebar,\n current: {\n url: currentUrl,\n content: htmlBody,\n ...fileData,\n },\n };\n const htmlContent = pugCompile(compileData);\n\n // Save to disk\n await helper.writeFile(destination, htmlContent);\n }", "function loadPage(path){\r\n return fetchPath(path).then(parseHtml)\r\n}", "function ngHtml2Js(file, cb) {\n if(file.isStream()) {\n return cb(new Error('html2js: Streaming not supported'));\n }\n\n if(file.isNull()) { return cb(null, file); }\n\n if(file.isBuffer()) {\n var filePath = getFileUrl(file);\n file.contents = new Buffer( generateModuleDeclaration( filePath, String( file.contents ) ) );\n file.path = replaceExtension(file.path, '.js');\n }\n\n return cb(null, file);\n }", "function parse( file ) {\n\t\treturn __awaiter( this, void 0, void 0, function () {\n\t\t\treturn __generator( this, function ( _a ) {\n\t\t\t\treturn [\n\t\t\t\t\t2,\n\t\t\t\t\t/*return*/\n\t\t\t\t\tnew Promise( function ( resolve, reject ) {\n\t\t\t\t\t\tfs.readFile( file, 'utf8', function ( err, data ) {\n\t\t\t\t\t\t\tif ( err ) {\n\t\t\t\t\t\t\t\treject( err );\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tresolve( parseString( data ) );\n\t\t\t\t\t\t} );\n\t\t\t\t\t} ),\n\t\t\t\t];\n\t\t\t} );\n\t\t} );\n\t}", "function load() {\n // Get the file selected by user through file opening dialog\n let file = document.getElementById(\"fileLoader\").files[0];\n // Convert file to stream then put its content in \"editor\" div\n file.text().then(text => {\n editor.innerText = text;\n parse();\n }); \n}", "function BuildHTML(html, file) {\n\tfs.writeFileSync(OutputDir + UpdateFileName(file, \"html\"), html)\n\tconsole.log(\"Built HTML file: \" + UpdateFileName(file, \"html\"));\n}", "function load() {\n \n //writes all the html for the page\n htmlWriter();\n }", "function convert(filename, callback){\n fs.readFile(filename, function(err, data) {\n\n var dir = filename.replace(/page\\.xml$/, '');\n\n data = data + '';\n data = data.replace(/&#160;/g, '&nbsp;'); // clear up bug that was messing up HTML\n\n var doc = new xmldoc.XmlDocument(data);\n var body = doc.firstChild;\n var saveName = \"index.md\";\n var permalink = dir.replace(__dirname, '') + 'index.html';\n\n body.attr = { \"class\": \"article\" };\n body.name = \"section\";\n\n body.eachChild(function(child, index, array){\n recur(child);\n });\n\n // set header attributes for md file\n var OUTPUT = header({ \n 'title': doc.attr.title,\n 'template': 'page.jade'\n });\n \n OUTPUT += body;\n\n // save to md file\n fs.writeFile(dir + saveName, OUTPUT, function(err){\n if (err) throw err;\n console.log(\"Saved: \" + dir + saveName);\n\n if (typeof(callback) === \"function\") callback.apply();\n });\n });\n}", "function templateContent(indexPath) {//\n const html = fs.readFileSync(\n path.resolve(process.cwd(), indexPath)\n ).toString();\n\n return html;\n}", "function serveHTML(file, response) {\n fs.readFile(file, 'utf8', function (errors, contents){\n if (errors) {console.log(errors);}\n response.writeHead(200, {'Content-Type': 'text/html'});\n response.write(contents);\n response.end();\n });\n}", "function mdAstToHtml(ast, lines) {\n if (lines == undefined)\n lines = [];\n\n // Adds each element of the array as markdown \n function addArray(ast) {\n for (let child of ast)\n mdAstToHtml(child, lines);\n return lines;\n }\n\n // Adds tagged content \n function addTag(tag, ast, newLine) {\n lines.push(startTag(tag));\n if (ast instanceof Array)\n addArray(ast); \n else\n mdAstToHtml(ast, lines);\n lines.push(endTag(tag));\n if (newLine)\n lines.push('\\r\\n');\n return lines;\n }\n\n function addLink(url, ast) {\n lines.push(startTag('a', { href:url }));\n addArray(ast.children);\n lines.push(endTag('a')) ;\n return lines;\n }\n\n function addImg(url) {\n lines.push(startTag('img', { src:url }));\n lines.push(endTag('img')) ;\n return lines;\n }\n\n switch (ast.name)\n {\n case \"heading\": \n {\n let headingLevel = ast.children[0];\n let restOfLine = ast.children[1];\n let h = headingLevel.allText.length;\n switch (h)\n {\n case 1: return addTag(\"h1\", restOfLine, true); \n case 2: return addTag(\"h2\", restOfLine, true); \n case 3: return addTag(\"h3\", restOfLine, true); \n case 4: return addTag(\"h4\", restOfLine, true); \n case 5: return addTag(\"h5\", restOfLine, true); \n case 6: return addTag(\"h6\", restOfLine, true); \n default: throw \"Heading level must be from 1 to 6\"\n }\n }\n case \"paragraph\": \n return addTag(\"p\", ast.children, true);\n case \"unorderedList\":\n return addTag(\"ul\", ast.children, true);\n case \"orderedList\":\n return addTag(\"ol\", ast.children, true);\n case \"unorderedListItem\":\n return addTag(\"li\", ast.children, true);\n case \"orderedListItem\":\n return addTag(\"li\", ast.children, true);\n case \"inlineUrl\":\n return addTag(ast.allText, ast.allText);\n case \"bold\":\n return addTag(\"b\", ast.children);\n case \"italic\":\n return addTag(\"i\", ast.children);\n case \"code\":\n return addTag(\"code\", ast.children);\n case \"codeBlock\":\n return addTag(\"pre\", ast.children);\n case \"quote\":\n return addTag(\"blockquote\", ast.children, true);\n case \"link\":\n return addLink(ast.children[1].allText, ast.children[0]);\n case \"image\":\n return addImg(ast.children[0]);\n default:\n if (ast.isLeaf)\n lines.push(ast.allText);\n else \n ast.children.forEach(function(c) { mdAstToHtml(c, lines); });\n }\n return lines;\n}", "function parseContent(file, regex){\n return file.src.map(function(filepath) {\n var html;\n\n // Warn on and return error comment (if nonull was set).\n if (!grunt.file.exists(filepath)) {\n grunt.log.warn('Source file \"' + filepath + '\" not found.');\n return '<!--*** File ' + filepath + ' missing ***-->';\n } else {\n html = grunt.file.read(filepath);\n if (html) {\n return html.match(regex);\n }\n }\n })\n .join( grunt.util.normalizelf(options.separator) );\n }", "function readContributeFile(file, isStyle) {\n if (!fs.existsSync(file))\n return \"\";\n let cmt = `<!-- ${path.basename(file)} -->\\n`;\n if (isStyle)\n return cmt + `<link rel=\"stylesheet\" type=\"text/css\" href=\"${dataUri_1.cssFileToDataUri(file)}\"/>`;\n return cmt + `<script type=\"text/javascript\" src=\"${dataUri_1.fileToDataUri(file)}\"/></script>`;\n}", "openFile() {\n controller.openMarkdown();\n }", "function compil_html() {\n return src(configs.html.in)\n // .pipe(htmlmin({ collapseWhitespace: true }))\n .pipe(dest(configs.html.out))\n .pipe(connect.reload());\n}", "function handleHTMLFileInput(_data){\n\t$ = cheerio.load(_data);\n\tfs.removeSync(htmlFile);\n\tif(fs.existsSync('export/index.html')){\n\t\tfs.removeSync('export/index.html');\n\t}\n\tvar newURL = process.argv[2];\n\tif(newURL != undefined){ \n\t\tif(newURL.slice(0,1) ==\"'\" || newURL.slice(0,1) ==='\"'){\n\t\tnewURL = newURL.slice(1,newURL.length-1);\n\t\t}\n\t} else {\n\t\tconsole.log(\"You must enter a URL after the file location! ex. node script.js www.google.com\");\n\t\tprocess.exit();\n\t}\n\n\tvar bodyContent;\n\tvar mraid = false;\n\tvar scriptExists = false;\n\t//===== Checks to see if script exists on page ======\n\t// ===== if script doesn't exist then prints script =====\n\t// ===== loops through array and removes all matching script tags ===\n\t\t//checkScript(['ebloader.js']);\n\t\tcheckStructure();\n\t\t// insertContent();\n\t\t// insertMRAID();\n\t\t// removeOnclick();\n\t\t// render();\n\n\n\t//======= prints script to page =======\n\tfunction checkScript(arr){\n\t\t\n\t\tvar mraidScript = '\\n' + '<script type=\"text/javascript\">' + '\\n' +\n\t\t' (function(){' + '\\n' +\n\t\t' var wrapper = document.getElementById(\"wrapper\"); ' + '\\n' +\n\t\t' var MRAID = window[\"mraid\"];' + '\\n' +\n\t\t' var url=' +\"'\" + encodeURIComponent(process.argv[2]) + \"';\" + '\\n' +\n\t\t' function init(){' + '\\n' +\n\t\t' if (MRAID){' + '\\n' +\n\t\t' MRAID.removeEventListener(\"ready\", init);' + '\\n' +\n\t\t' } else {' + '\\n' +\n\t\t\" window.removeEventListener('load', init);\" + '\\n' +\n\t\t' }' + '\\n' +\n\t\t\" wrapper.addEventListener('click', function(){\" + '\\n' + \n\t\t' if (MRAID && MRAID.open){' + '\\n' +\n\t\t' MRAID.open( url );' + '\\n' +\n\t\t' } else {' + '\\n' +\n\t\t' window.open( url );' + '\\n' +\n\t\t' }' + '\\n' +\n\t\t' },false);' + '\\n' +\n\t\t' }' + '\\n' +\n\t\t' function checkEnvironment(){' + '\\n' +\n\t\t' if (MRAID){' + '\\n' +\n\t\t\" if (MRAID.getState() == 'loading'){\" + '\\n' +\n\t\t' MRAID.addEventListener(\"ready\", init);' + '\\n' +\n\t\t' } else {' + '\\n' +\n\t\t' init();' + '\\n' +\n\t\t' }' + '\\n' +\n\t\t' } else {' + '\\n' +\n\t\t' if(document.readyState === \"complete\"){' + '\\n' +\n\t\t' init()' + '\\n' +\n\t\t' }else{' + '\\n' +\n\t\t\" window.addEventListener('load', init, false);\" + '\\n' +\n\t\t' }' + '\\n' +\n\t\t' }'+ '\\n' +\n\t\t' }' + '\\n' +\n\t\t' checkEnvironment();' + '\\n' +\n\t\t' })()' + '\\n' +\n\t\t'</script>'\n\n\t\t$('script').each(function(elmt){\n\t\t\t//check to see if MRAID code already exists\n\t\t\tif($(this).text().indexOf('var MRAID = window[\"mraid\"]' != -1)){\n\t\t\t\tscriptExists = true;\n\t\t\t}\n\t\t\tvar loopObj = $(this)\n\t\t\t//====== check to see if ebloader is pulled in and remove it ====\n\t\t\tarr.forEach(function(scrpt){\n\t\t\t\tif(fs.existsSync('export/' + scrpt)){\n\t\t\t\t\tfs.removeSync('export/' + scrpt);\n\t\t\t\t}\n\t\t\t\tif(loopObj.attr('src') != undefined){\n\t\t\t\t\t//console.log(loopObj.attr('src'));\n\t\t\t\t\tif(loopObj.attr('src').toLowerCase().indexOf(scrpt) != -1){\n\t\t\t\t\t\t//console.log(loopObj.attr('src'), \"should have been removed\");\n\t\t\t\t\t\tloopObj.remove();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\t\n\t\t})\n\t\tif(scriptExists && doc_root[doc_root.length-1] != 'root'){\n\t\t\tconsole.log(doc_root[0])\n\t\t\tconsole.log('checkscript done');\n\t\t\t$(doc_root[doc_root.length-1]).append(mraidScript);\n\t\t} else {\n\t\t\t$.root().append(mraidScript);\n\t\t}\t\n\t\tinsertContent();\n\t\tinsertMRAID();\n\t\tremoveOnclick();\n\t\trender();\n\t}\n\n\t//Insert MRAID call\n\tfunction insertMRAID(){\n\t\t$('head').replaceWith(\"\");\n\t\t$.root().prepend('<script src=\"mraid.js\"></script>')\n\t}\n\n\t//========== Replaces all nested filepaths to snippet root directory ========\n\tfunction changeFilePaths(arr, str){\n\t\tvar _str = str;\n\t\tarr.forEach(function(path){\n\t\t\tvar replace = path.replace(base, '').split('/')[path.replace(base, '').split('/').length-1];\n\t\t\tvar search = path.replace(base, '').split('/').join('/').slice(1);\n\t\t\t_str = _str.replace(search, replace);\n\t\t})\n\t\treturn _str;\n\t}\n\n\t//check if a body tag exists on the page. If true then grab all the children of that element\n\t//removes all inline onclick attributes\n\n\tfunction removeOnclick(){\n\t\t$('*').each(function(){\n\t\t\t$(this).removeAttr('onclick');\n\t\t})\n\t}\n\n\tfunction checkStructure(){\n\t\tif($('body').length){\n\t\t\tconsole.log(\"body element exists\");\n\t\t\tbodyContent = $('body').children();\n\t\t\tdoc_root.push('body');\n\t\t\tif($('html').length){\n\t\t\t\tdoc_root.push('html');\n\t\t\t\tconsole.log('checkStructure done');\n\t\t\t}\n\t\t} else {\n\t\t\tconsole.log(\"there is no body\");\n\t\t\tif($('html').length){\n\t\t\t//if body doesn't exist then search for an html tag\n\t\t\t\tbodyContent = $('html').children('div');\n\t\t\t\t$('html').children('div').remove();\n\t\t\t\tconsole.log('html element exists');\n\n\t\t\t} else if($.root().first('div')){\n\t\t\t\tdoc_root.push('root');\n\t\t\t\tconsole.log(\"there's no html element.\")\n\t\t\t\tbodyContent = $('div').get(0);\n\t\t\t\tbodyContent = $.root().children('div');\n\t\t\t\t$.root().children('div').remove();\n\t\t\t}\n\t\t}\n\t\tcheckScript(badScripts);\n\t}\n\n\t//========= remove body,meta, and title tags=======\n\t//====create wrapper div and place body content inside====\n\n\tfunction insertContent(){\n\t\tvar allContent;\n\t\tif(doc_root[doc_root.length-1] != 'root'){\n\t\t\tallContent = $(doc_root[doc_root.length-1]).children();\n\t\t} else {\n\t\t\tallContent = $.root().append(mraidScript);\n\t\t}\t\n\t\tvar style = $('style');\n\t\tvar styles = $('style').html();\n\t\t//console.log(style.html());\n\t\tvar styling = css.parse(styles);\n\n\t\t\tfor(var i = 0; i< styling.stylesheet.rules.length; i++){\n\t\t\t\tcheckProp(styling.stylesheet.rules[i])\n\t\t\t}\n\n\t\t\t//========= remove global div declarations that access elements above stage ======\n\t\t\tfunction checkProp(obj){\n\t\t\t\tif(obj.type == 'rule'){\n\t\t\t\t\tif(obj.selectors.indexOf('div') > -1){\n\t\t\t\t\t\tfor(var j = 0; j < obj.declarations.length; j++){\n\t\t\t\t\t\t\tif(obj.declarations[j].property == 'position' && obj.declarations[j].value == 'absolute'){\n\t\t\t\t\t\t\t\t obj.selectors.splice(obj.selectors.indexOf('div'),1, '#wrapper div :not(script)');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\tstyles = css.stringify(styling);\n\t\t\t//console.log(style);\n\n\n\n\n\t\t$.root().prepend('\\n' + '\\n' + '<div id=\"wrapper\"></div>')\n\t\t$('#wrapper').append('\\n' + '\\t' + bodyContent + '\\n');\n\t\t$('html').replaceWith(allContent);\n\t\t$('body').remove();\n\t\t$('meta').remove();\n\t\t$('title').remove();\n\t\t$('doctype').remove();\n\n\t\t$.root().prepend('\\n' + '<style>' + '\\n' +\n\t\t\t\t' #wrapper {' + '\\n' +\n\t\t\t\t' width: 100%;' + '\\n' +\n\t\t\t\t' height: 100%;' + '\\n' +\n\t\t\t\t' position: relative;' + '\\n' +\n\t\t\t\t' top: 0; left: 0;' + '\\n' +\n\t\t\t\t' z-index: 90;' + '\\n' +\n\t\t\t\t' }' + '\\n' + styles + '\\n' + '</style>');\n\t\tstyle.remove();\n\t\twhile($('head').children().length>0){\n\t\t\tvar headContent = $('head').children().last();\n\t\t\t\t$.root().prepend('\\n' + headContent);\n\t\t\t\t$('head').children().last().remove();\n\t\t}\n\t}\n\n\tfunction render(){\n\t\t//=== convert virtual dom into string=====\n\t\tvar renderedDom = $.html();\n\t\t//==========replace old file paths will flatten paths======\n\t\trenderedDom = changeFilePaths(filePaths, renderedDom);\n\t\t//======= search for doctype and remove========\n\t\tif(renderedDom.toLowerCase().indexOf('<!doctype html>')== -1){\n\t\t\tconsole.log(\"File has been created 'snippet.html'\");\n\t\t\tfs.writeFile('export/snippet.html', renderedDom, function (err) {\n\t\t \t\tif (err) return console.log(err);\n\t\t\t});\n\t\t} else {\n\t\t\trenderedDom = renderedDom.replace(/<!doctype html>/gi,'');\n\t\t\trenderedDom = renderedDom.replace(/<html>/gi,'');\n\t\t\trenderedDom = renderedDom.replace(/<\\/html>/gi,'');\n\t\t\tconsole.log(\"File has been created: 'snippet.html'\");\n\t\t\tfs.writeFile( inputFile.split('/').slice(0, -1).join('/') + '/snippet.html', renderedDom, function (err) {\n\t\t \t\tif (err) return console.log(err);\n\t\t\t});\n\t\t}\n\t}\n}", "function parse(file) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2\n /*return*/\n , new Promise(function (resolve, reject) {\n fs.readFile(file, 'utf8', function (err, data) {\n if (err) {\n reject(err);\n return;\n }\n\n resolve(parseString(data));\n });\n })];\n });\n });\n }", "function parse$a(context, file) {\n var message;\n\n if (stats$5(file).fatal) {\n return\n }\n\n if (context.treeIn) {\n debug$8('Not parsing already parsed document');\n\n try {\n context.tree = json$1(file.toString());\n } catch (error) {\n message = file.message(\n new Error('Cannot read file as JSON\\n' + error.message)\n );\n message.fatal = true;\n }\n\n // Add the preferred extension to ensure the file, when serialized, is\n // correctly recognised.\n // Only add it if there is a path — not if the file is for example stdin.\n if (file.path) {\n file.extname = context.extensions[0];\n }\n\n file.contents = '';\n\n return\n }\n\n debug$8('Parsing `%s`', file.path);\n\n context.tree = context.processor.parse(file);\n\n debug$8('Parsed document');\n}", "function parse(context, file) {\n var message\n\n if (stats(file).fatal) {\n return\n }\n\n if (context.treeIn) {\n debug('Not parsing already parsed document')\n\n try {\n context.tree = json(file.toString())\n } catch (error) {\n message = file.message(\n new Error('Cannot read file as JSON\\n' + error.message)\n )\n message.fatal = true\n }\n\n // Add the preferred extension to ensure the file, when serialized, is\n // correctly recognised.\n // Only add it if there is a path — not if the file is for example stdin.\n if (file.path) {\n file.extname = context.extensions[0]\n }\n\n file.contents = ''\n\n return\n }\n\n debug('Parsing `%s`', file.path)\n\n context.tree = context.processor.parse(file)\n\n debug('Parsed document')\n}", "function html() {\n\treturn src( folder.src + '*.html' )\n\t\t.pipe( htmlclean() )\n\t\t.pipe( dest( folder.build ) )\n}", "function MarkdownFileToBody(filename)\n{\n var callback = function (text) {\n //html = Showdown(text);\n fillDiv(text, gs_body_id);\n }\n getFile(filename, callback, true);\n}", "function readFile(file) {\n return fetch(file).then(function (response) {\n return response.text();\n });\n }", "function allHtmlFn(){\n\tcompileAllPugFiles(pugDocDitectory);\n}", "function loadTest (filename) {\n var content = fs.readFileSync(filename) + '';\n var parts = content.split(/\\n-----*\\n/);\n\n return {\n source: parts[0],\n compiled: parts[1],\n ast: parts[2],\n transformed: parts[3]\n };\n}", "function pugHtml() {\n return src('src/pug/pages/*.pug')\n .pipe(\n pug({\n pretty: true,\n })\n )\n .pipe(dest('dist'));\n}", "compile(htmlFile) {\n return new Promise(async resolve => {\n let htmlOptions = this.htmlFilesList[htmlFile];\n\n await this.compileView(htmlOptions.htmlFile, htmlOptions.selector, htmlOptions.component, htmlOptions.isUnique, true);\n resolve();\n });\n }", "function htmlLoad() {\n}", "async function createDOM (filepath){\n const fileData = await readData(filepath)\n const DomObject = new JSDOM(fileData);\n return (DomObject)\n}", "function getAllPages() {\n var filepath = getCurrentPath();\n console.log('file path: ', filepath);\n htmlFiles = fs.readdirSync(filepath)\n .filter(function (file) {\n return file.includes('.html');\n }).map(function (file) {\n var correctPath = pathLib.resolve(filepath, file);\n if (correctPath == undefined) {\n pagesToImageObjs('current path is undefined', null);\n }\n return {\n file: file,\n contents: fs.readFileSync(correctPath, 'utf8')\n };\n });\n return htmlFiles;\n}", "function _readFile(evt) {\n //Retrieve the uploaded File\n const file = evt.target.files[0],\n fileReader = new FileReader();\n\n //callback once file loaded, the loaded file is in text format\n fileReader.onload = function(content) {\n\n // Step 1: convert the textfile to obtain HTML DOM object to access the info section\n let toHTMLDOM = convertToHTMLDOM(content);\n\n // Step 2: create a map for the bio obtained via DOM acceess\n fetchVCardData(toHTMLDOM);\n\n // branch to reset the page, when a second file is uploaded\n if (properties.container.childNodes.length > 0) {\n resetPage();\n }\n\n //Step 3: create the network\n createNetwork();\n }\n fileReader.readAsText(file);\n }", "renderHTML() {\n fs.readFile('template/main.html', 'utf8', (err, htmlString) => {\n \n htmlString = htmlString.split(\"<script></script>\").join(this.getScript());\n\n fs.writeFile('output/index.html', htmlString, (err) => {\n // throws an error, you could also catch it here\n if (err) throw err;\n // success case, the file was saved\n \n });\n \n });\n\n }", "function TML2HTML() {\n \n /* Constants */\n var startww = \"(^|\\\\s|\\\\()\";\n var endww = \"($|(?=[\\\\s\\\\,\\\\.\\\\;\\\\:\\\\!\\\\?\\\\)]))\";\n var PLINGWW =\n new RegExp(startww+\"!([\\\\w*=])\", \"gm\");\n var TWIKIVAR =\n new RegExp(\"^%(<nop(?:result| *\\\\/)?>)?([A-Z0-9_:]+)({.*})?$\", \"\");\n var MARKER =\n new RegExp(\"\\u0001([0-9]+)\\u0001\", \"\");\n var protocol = \"(file|ftp|gopher|https|http|irc|news|nntp|telnet|mailto)\";\n var ISLINK =\n new RegExp(\"^\"+protocol+\":|/\");\n var HEADINGDA =\n new RegExp('^---+(\\\\++|#+)(.*)$', \"m\");\n var HEADINGHT =\n new RegExp('^<h([1-6])>(.+?)</h\\\\1>', \"i\");\n var HEADINGNOTOC =\n new RegExp('(!!+|%NOTOC%)');\n var wikiword = \"[A-Z]+[a-z0-9]+[A-Z]+[a-zA-Z0-9]*\";\n var WIKIWORD =\n new RegExp(wikiword);\n var webname = \"[A-Z]+[A-Za-z0-9_]*(?:(?:[\\\\./][A-Z]+[A-Za-z0-9_]*)+)*\";\n var WEBNAME =\n new RegExp(webname);\n var anchor = \"#[A-Za-z_]+\";\n var ANCHOR =\n new RegExp(anchor);\n var abbrev = \"[A-Z]{3,}s?\\\\b\";\n var ABBREV =\n new RegExp(abbrev);\n var ISWIKILINK =\n new RegExp( \"^(?:(\"+webname+\")\\\\.)?(\"+wikiword+\")(\"+anchor+\")?\");\n var WW =\n new RegExp(startww+\"((?:(\"+webname+\")\\\\.)?(\"+wikiword+\"))\", \"gm\");\n var ITALICODE =\n new RegExp(startww+\"==(\\\\S+?|\\\\S[^\\\\n]*?\\\\S)==\"+endww, \"gm\");\n var BOLDI =\n new RegExp(startww+\"__(\\\\S+?|\\\\S[^\\\\n]*?\\\\S)__\"+endww, \"gm\");\n var CODE =\n new RegExp(startww+\"\\\\=(\\\\S+?|\\\\S[^\\\\n]*?\\\\S)\\\\=\"+endww, \"gm\");\n var ITALIC =\n new RegExp(startww+\"\\\\_(\\\\S+?|\\\\S[^\\\\n]*?\\\\S)\\\\_\"+endww, \"gm\");\n var BOLD =\n new RegExp(startww+\"\\\\*(\\\\S+?|\\\\S[^\\\\n]*?\\\\S)\\\\*\"+endww, \"gm\");\n var NOPWW =\n new RegExp(\"<nop(?: *\\/)?>(\"+wikiword+\"|\"+abbrev+\")\", \"g\");\n var URI =\n new RegExp(\"(^|[-*\\\\s(])(\"+protocol+\":([^\\\\s<>\\\"]+[^\\s*.,!?;:)<]))\");\n\n /*\n * Main entry point, and only external function. 'options' is an object\n * that must provide the following method:\n * getViewUrl(web,topic) -> url (where topic may include an anchor)\n * and may optionally provide\n * expandVarsInURL(url, options) -> url\n * getViewUrl must generate a URL for the given web and topic.\n * expandVarsinURL gives an opportunity for a caller to expand selected\n * Macros embedded in URLs\n */\n this.convert = function(content, options) {\n this.opts = options;\n\n content = content.replace(/\\\\\\n/g, \" \");\n \n content = content.replace(/\\u0000/g, \"!\");\t\n content = content.replace(/\\u0001/g, \"!\");\t\n content = content.replace(/\\u0002/g, \"!\");\t\n \n this.refs = new Array();\n\n // Render TML constructs to tagged HTML\n return this._getRenderedVersion(content);\n };\n \n this._liftOut = function(text) {\n index = '\\u0001' + this.refs.length + '\\u0001';\n this.refs.push(text);\n return index;\n }\n \n this._dropBack = function(text) {\n var match;\n \n while (match = MARKER.exec(text)) {\n var newtext = this.refs[match[1]];\n if (newtext != match[0]) {\n var i = match.index;\n var l = match[0].length;\n text = text.substr(0, match.index) +\n newtext +\n text.substr(match.index + match[0].length);\n }\n MARKER.lastIndex = 0;\n }\n return text;\n };\n \n // Parse twiki variables.\n //for InlineEdit, would like to not nest them, and to surround entire html entities where needed\n this._processTags = function(text) {\n \n var queue = text.split(/%/);\n var stack = new Array();\n var stackTop = '';\n var prev = '';\n \n while (queue.length) {\n var token = queue.shift();\n if (stackTop.substring(-1) == '}') {\n while (stack.length && !TWIKIVAR.match(stackTop)) {\n stackTop = stack.pop() + stackTop;\n }\n }\n \n var match = TWIKIVAR.exec(stackTop);\n if (match) {\n var nop = match[1];\n var args = match[3];\n if (!args)\n args = '';\n // You can always replace the %'s here with a construct e.g.\n // html spans; however be very careful of variables that are\n // used in the context of parameters to HTML tags e.g.\n // <img src=\"%ATTACHURL%...\">\n var tag = '%' + match[2] + args + '%';\n if (nop) {\n nop = nop.replace(/[<>]/g, '');\n tag = \"<span class='TML'\"+nop+\">\"+tag+\"</span>\";\n }\n stackTop = stack.pop() + this._liftOut(tag) + token;\n } else {\n stack.push(stackTop);\n stackTop = prev + token;\n }\n prev = '%';\n }\n // Run out of input. Gather up everything in the stack.\n while (stack.length) {\n stackTop = stack.pop(stack) + stackTop;\n }\n \n return stackTop;\n };\n \n this._makeLink = function(url, text) {\n if (!text || text == '')\n text = url;\n url = this._liftOut(url);\n return \"<a href='\"+url+\"'>\" + text + \"</a>\";\n };\n \n this._expandRef = function(ref) {\n if (this.opts['expandVarsInURL']) {\n var origtxt = this.refs[ref];\n var newtxt = this.opts['expandVarsInURL'](origtxt, this.opts);\n if (newTxt != origTxt)\n return newtxt;\n }\n return '\\u0001'+ref+'\\u0001';\n };\n \n this._expandURL = function(url) {\n if (this.opts['expandVarsInURL'])\n return this.opts['expandVarsInURL'](url, this.opts);\n return url;\n };\n \n this._makeSquab = function(url, text) {\n url = _sg(MARKER, url, function(match) {\n this._expandRef(match[1]);\n }, this);\n \n if (url.test(/[<>\\\"\\x00-\\x1f]/)) {\n // we didn't manage to expand some variables in the url\n // path. Give up.\n // If we can't completely expand the URL, then don't expand\n // *any* of it (hence save)\n return text ? \"[[save][text]]\" : \"[[save]]\";\n }\n \n if (!text) {\n // forced link [[Word]] or [[url]]\n text = url;\n if (url.test(ISLINK)) {\n var wurl = url;\n wurl.replace(/(^|)(.)/g,$2.toUpperCase());\n var match = wurl.exec(ISWEB);\n if (match) {\n url = this.opts['getViewUrl'](match[1], match[2] + match[3]);\n } else {\n url = this.opts['getViewUrl'](null, wurl);\n }\n }\n } else if (match = url.exec(ISWIKILINK)) {\n // Valid wikiword expression\n url = this.optsgetViewUrl(match[1], match[2]) + match[3];\n }\n \n text.replace(WW, \"$1<nop>$2\");\n \n return this._makeLink(url, text);\n };\n \n // Lifted straight out of DevelopBranch Render.pm\n this._getRenderedVersion = function(text, refs) {\n if (!text)\n return '';\n \n this.LIST = new Array();\n this.refs = new Array();\n \n // Initial cleanup\n text = text.replace(/\\r/g, \"\");\n text = text.replace(/^\\n+/, \"\");\n text = text.replace(/\\n+$/, \"\");\n\n var removed = new BlockSafe();\n \n text = removed.takeOut(text, 'verbatim', true);\n\n // Remove PRE to prevent TML interpretation of text inside it\n text = removed.takeOut(text, 'pre', false);\n \n // change !%XXX to %<nop>XXX\n text = text.replace(/!%([A-Za-z_]+(\\{|%))/g, \"%<nop>$1\");\n\n // change <nop>%XXX to %<nopresult>XXX. A nop before th % indicates\n // that the result of the tag expansion is to be nopped\n text = text.replace(/<nop>%(?=[A-Z]+(\\{|%))/g, \"%<nopresult>\");\n \n // Pull comments\n text = _sg(/(<!--.*?-->)/, text,\n function(match) {\n this._liftOut(match[1]);\n }, this);\n \n // Remove TML pseudo-tags so they don't get protected like HTML tags\n text = text.replace(/<(.?(noautolink|nop|nopresult).*?)>/gi,\n \"\\u0001($1)\\u0001\");\n \n // Expand selected TWiki variables in IMG tags so that images appear in the\n // editor as images\n text = _sg(/(<img [^>]*src=)([\\\"\\'])(.*?)\\2/i, text,\n function(match) {\n return match[1]+match[2]+this._expandURL(match[3])+match[2];\n }, this);\n \n // protect HTML tags by pulling them out\n text = _sg(/(<\\/?[a-z]+(\\s[^>]*)?>)/i, text,\n function(match) {\n return this._liftOut(match[1]);\n }, this);\n \n var pseud = new RegExp(\"\\u0001\\((.*?)\\)\\u0001\", \"g\");\n // Replace TML pseudo-tags\n text = text.replace(pseud, \"<$1>\");\n \n // Convert TWiki tags to spans outside parameters\n text = this._processTags(text);\n \n // Change ' !AnyWord' to ' <nop>AnyWord',\n text = text.replace(PLINGWW, \"$1<nop>$2\");\n \n text = text.replace(/\\\\\\n/g, \"\"); // Join lines ending in '\\'\n \n // Blockquoted email (indented with '> ')\n text = text.replace(/^>(.*?)/gm,\n '&gt;<cite class=TMLcite>$1<br /></cite>');\n \n // locate isolated < and > and translate to entities\n // Protect isolated <!-- and -->\n text = text.replace(/<!--/g, \"\\u0000{!--\");\n text = text.replace(/-->/g, \"--}\\u0000\");\n // SMELL: this next fragment is a frightful hack, to handle the\n // case where simple HTML tags (i.e. without values) are embedded\n // in the values provided to other tags. The only way to do this\n // correctly (i.e. handle HTML tags with values as well) is to\n // parse the HTML (bleagh!)\n text = text.replace(/<(\\/[A-Za-z]+)>/g, \"{\\u0000$1}\\u0000\");\n text = text.replace(/<([A-Za-z]+(\\s+\\/)?)>/g, \"{\\u0000$1}\\u0000\");\n text = text.replace(/<(\\S.*?)>/g, \"{\\u0000$1}\\u0000\");\n // entitify lone < and >, praying that we haven't screwed up :-(\n text = text.replace(/</g, \"&lt;\");\n text = text.replace(/>/g, \"&gt;\");\n text = text.replace(/{\\u0000/g, \"<\");\n text = text.replace(/}\\u0000/g, \">\");\n \n // standard URI\n text = _sg(URI, text,\n function(match) {\n return match[1] + this._makeLink(match[2],match[2]);\n }, this);\n \n // Headings\n // '----+++++++' rule\n text = _sg(HEADINGDA, text, function(match) {\n return this._makeHeading(match[2],match[1].length);\n }, this);\n \n // Horizontal rule\n var hr = \"<hr class='TMLhr' />\";\n text = text.replace(/^---+/gm, hr);\n \n // Now we really _do_ need a line loop, to process TML\n // line-oriented stuff.\n var isList = false;\t\t// True when within a list\n var insideTABLE = false;\n this.result = new Array();\n\n var lines = text.split(/\\n/);\n for (var i in lines) {\n var line = lines[i];\n // Table: | cell | cell |\n // allow trailing white space after the last |\n if (line.match(/^(\\s*\\|.*\\|\\s*)/)) {\n if (!insideTABLE) {\n result.push(\"<table border=1 cellpadding=0 cellspacing=1>\");\n }\n result.push(this._emitTR(match[1]));\n insideTABLE = true;\n continue;\n } else if (insideTABLE) {\n result.push(\"</table>\");\n insideTABLE = false;\n }\n // Lists and paragraphs\n if (line.match(/^\\s*$/)) {\n isList = false;\n line = \"<p />\";\n }\n else if (line.match(/^\\S+?/)) {\n isList = false;\n }\n else if (line.match(/^(\\t| )+\\S/)) {\n var match;\n if (match = line.match(/^((\\t| )+)\\$\\s(([^:]+|:[^\\s]+)+?):\\s(.*)$/)) {\n // Definition list\n line = \"<dt> \"+match[3]+\" </dt><dd> \"+match[5];\n this._addListItem('dl', 'dd', match[1]);\n isList = true;\n }\n else if (match = line.match(/^((\\t| )+)(\\S+?):\\s(.*)$/)) {\n // Definition list\n line = \"<dt> \"+match[3]+\" </dt><dd> \"+match[4];\n this._addListItem('dl', 'dd', match[1]);\n isList = true;\n }\n else if (match = line.match(/^((\\t| )+)\\* (.*)$/)) {\n // Unnumbered list\n line = \"<li> \"+match[3];\n this._addListItem('ul', 'li', match[1]);\n isList = true;\n }\n else if (match = line.match(/^((\\t| )+)([1AaIi]\\.|\\d+\\.?) ?/)) {\n // Numbered list\n var ot = $3;\n ot = ot.replace(/^(.).*/, \"$1\");\n if (!ot.match(/^\\d/)) {\n ot = ' type=\"'+ot+'\"';\n } else {\n ot = '';\n }\n line.replace(/^((\\t| )+)([1AaIi]\\.|\\d+\\.?) ?/,\n \"<li\"+ot+\"> \");\n this._addListItem('ol', 'li', match[1]);\n isList = true;\n }\n } else {\n isList = false;\n }\n \n // Finish the list\n if (!isList) {\n this._addListItem('', '', '');\n }\n \n this.result.push(line);\n }\n \n if (insideTABLE) {\n this.result.push('</table>');\n }\n this._addListItem('', '', '');\n \n text = this.result.join(\"\\n\");\n text = text.replace(ITALICODE, \"$1<b><code>$2</code></b>\")\n text = text.replace(BOLDI, \"$1<b><i>$2</i></b>\");\n text = text.replace(BOLD, \"$1<b>$2</b>\")\n text = text.replace(ITALIC, \"$1<i>$2</i>\")\n text = text.replace(CODE, \"$1<code>$2</code>\");\n \n // Handle [[][] and [[]] links\n text = text.replace(/(^|\\s)\\!\\[\\[/gm, \"$1[<nop>[\");\n \n // We _not_ support [[http://link text]] syntax\n \n // detect and escape nopped [[][]]\n text = text.replace(/\\[<nop(?: *\\/)?>(\\[.*?\\](?:\\[.*?\\])?)\\]/g,\n '[<span class=\"TMLnop\">$1</span>]');\n text.replace(/!\\[(\\[.*?\\])(\\[.*?\\])?\\]/g,\n '[<span class=\"TMLnop\">$1$2</span>]');\n \n // Spaced-out Wiki words with alternative link text\n // i.e. [[1][3]]\n\n text = _sg(/\\[\\[([^\\]]*)\\](?:\\[([^\\]]+)\\])?\\]/, text,\n function(match) {\n return this._makeSquab(match[1],match[2]);\n }, this);\n \n // Handle WikiWords\n text = removed.takeOut(text, 'noautolink', true);\n \n text = text.replace(NOPWW, '<span class=\"TMLnop\">$1</span>');\n \n text = _sg(WW, text,\n function(match) {\n var url = this.opts['getViewUrl'](match[3], match[4]);\n if (match[5])\n url += match[5];\n return match[1]+this._makeLink(url, match[2]);\n }, this);\n\n text = removed.putBack(text, 'noautolink', 'div');\n \n text = removed.putBack(text, 'pre');\n \n // replace verbatim with pre in the final output\n text = removed.putBack(text, 'verbatim', 'pre',\n function(text) {\n // use escape to URL encode, then JS encode\n return HTMLEncode(text);\n });\n \n // There shouldn't be any lingering <nopresult>s, but just\n // in case there are, convert them to <nop>s so they get removed.\n text = text.replace(/<nopresult>/g, \"<nop>\");\n \n return this._dropBack(text);\n }\n \n // Make the html for a heading\n this._makeHeading = function(heading, level) {\n var notoc = '';\n if (heading.match(HEADINGNOTOC)) {\n heading = heading.substring(0, match.index) +\n heading.substring(match.index + match[0].length);\n notoc = ' notoc';\n }\n return \"<h\"+level+\" class='TML\"+notoc+\"'>\"+heading+\"</h\"+level+\">\";\n };\n\n\n this._addListItem = function(type, tag, indent) {\n indent = indent.replace(/\\t/g, \" \");\n var depth = indent.length / 3;\n var size = this.LIST.length;\n\n if (size < depth) {\n var firstTime = true;\n while (size < depth) {\n var obj = new Object();\n obj['type'] = type;\n obj['tag'] = tag;\n this.LIST.push(obj);\n if (!firstTime)\n this.result.push(\"<\"+tag+\">\");\n this.result.push(\"<\"+type+\">\");\n firstTime = false;\n size++;\n }\n } else {\n while (size > depth) {\n var types = this.LIST.pop();\n this.result.push(\"</\"+types['tag']+\">\");\n this.result.push(\"</\"+types['type']+\">\");\n size--;\n }\n if (size) {\n this.result.push(\"</this.{LIST}.[size-1].{element}>\");\n }\n }\n \n if (size) {\n var oldt = this.LIST[size-1];\n if (oldt['type'] != type) {\n this.result.push(\"</\"+oldt['type']+\">\\n<type>\");\n this.LIST.pop();\n var obj = new Object();\n obj['type'] = type;\n obj['tag'] = tag;\n this.LIST.push(obj);\n }\n }\n }\n \n this._emitTR = function(row) {\n \n row.replace(/^(\\s*)\\|/, \"\");\n var pre = 1;\n \n var tr = new Array();\n \n while (match = row.match(/^(.*?)\\|/)) {\n row = row.substring(match[0].length);\n var cell = 1;\n \n if (cell == '') {\n cell = '%SPAN%';\n }\n \n var attr = new Attrs();\n \n my (left, right) = (0, 0);\n if (cell.match(/^(\\s*).*?(\\s*)/)) {\n left = length (1);\n right = length (2);\n }\n \n if (left > right) {\n attr.set('class', 'align-right');\n attr.set('style', 'text-align: right');\n } else if (left < right) {\n attr.set('class', 'align-left');\n attr.set('style', 'text-align: left');\n } else if (left > 1) {\n attr.set('class', 'align-center');\n attr.set('style', 'text-align: center');\n }\n \n // make sure there's something there in empty cells. Otherwise\n // the editor will compress it to (visual) nothing.\n cell.replace(/^\\s*/g, \"&nbsp;\");\n \n // Removed TH to avoid problems with handling table headers. TWiki\n // allows TH anywhere, but Kupu assumes top row only, mostly.\n // See Item1185\n tr.push(\"<td \"+attr+\"> \"+cell+\" </td>\");\n }\n return pre+\"<tr>\" + tr.join('')+\"</tr>\";\n }\n}", "getHTML() {\n return getHTMLFromFragment(this.state.doc.content, this.schema);\n }", "function compileHTML(){\n return gulp.src(config.assetPath + \"/markup/**/*.html\")\n .pipe(mustache(config.meta, {\n extension: \".html\"\n }))\n .pipe(gulp.dest( config.dev ))\n}", "function getHtmlFromFile(url, callback) {\n $$.get(url, undefined, function (data) {\n callback(data);\n });\n}", "function parseFile(file) {\n\n if (window.File && window.FileReader && Window.FileList && window.Blob) {\n alert(\"File Reader APIs not up to date on current browser.\")\n return\n }\n \n //create file reader \n var reader = new FileReader()\n\n\n if(file.files && file.files[0]) {\n reader.onload = function (e) {\n parseInput(e.target.result)\n }\n\n reader.readAsText(file.files[0])\n }\n else {\n alert(\"Error reading file.\")\n }\n\n}", "function html() {\n return gulp.src(path.src.html)\n .pipe(gulp.dest(path.build.html))\n .pipe(reload({stream: true}))\n}", "function parseQML(src, file) {\n loadParser();\n QmlWeb.parse.nowParsingFile = file;\n var parsetree = QmlWeb.parse(src, QmlWeb.parse.QmlDocument);\n return convertToEngine(parsetree);\n}", "function analyse(text, fileName) {\n let lexer = new Lexer(text, fileName);\n return lexer.analyse();\n }", "function parseHtml(input)\n{\n\treturn new Promise( function(resolve, reject)\n\t{\n\t\tif (isStream(input) === true)\n\t\t{\n\t\t\tvar parser = new parse5.ParserStream(options);\n\t\t\t\n\t\t\tparser.on(\"finish\", function()\n\t\t\t{\n\t\t\t\tresolve(parser.document);\n\t\t\t});\n\t\t\t\n\t\t\tinput.pipe(parser);\n\t\t}\n\t\telse if (isString(input) === true)\n\t\t{\n\t\t\tresolve( parse5.parse(input, options) );\n\t\t}\n\t\telse\n\t\t{\n\t\t\treject(\"Invalid input\");\n\t\t}\n\t});\n}", "function processFileTXT(doc){\n content = doc.body;\n // FILTER: remove tabs\n content = content.replace(/\\t/g, ' ');\n // FILTER: fix smart quotes and m dash with unicode\n content = textPretty(content);\n // FILTER replace meta blocks with comments\n content = content.replace(/=================================/, '<!--');\n content = content.replace(/=================================/, '-->');\n // FILTER replace old page markers <p#> and <c:#>\n content = content.replace(/<p([0-9]+)>/g, \"<span id='pg_$1'></span>\");\n // FILTER: markdown\n md.setOptions({\n gfm: false, tables: false, breaks: false, pedantic: false,\n sanitize: false, smartLists: false, smartypants: false\n });\n content = md(content);\n content = content.replace(/<\\/p>/g, \"\\n\\n\");\n // FILTER add consistent header\n doc.header = HTMLHeaderTemplate(doc.meta);\n // FILTER: Number Paragraphs\n content = numberPars(content, doc.meta);\n doc.body = content;\n // FILTER: HTML5 template into HTML document\n doc.html = HTML5Template(doc);\n return doc;\n}", "function loadFile(file){\n\tlet fs = require('fs');\n\tvar data = fs.readFileSync(file);\n\tvar contents = (JSON.parse(data));\n\treturn contents;\n}", "function parse (fileName, text) {\n const reader = Reader.create(fileName, text)\n const fragments = []\n\n // loop through lines, building fragments\n while (true) {\n if (reader.atEnd()) break\n\n // get the first line of the next fragment\n reader.skipEmptyLines()\n\n const line = reader.read()\n if (line == null) break\n\n // push the fragment line back for fragment handler to process\n reader.pushBack()\n\n const fragment = getFragment(line)\n if (fragment.read(reader) == null) break\n\n fragments.push(fragment)\n }\n\n return fragments\n}", "function compileHtml(done) {\n var data = {};\n config.html.twig.dataSrc.forEach(function(filePath) {\n _.merge(data, JSON.parse(fs.readFileSync(filePath)));\n });\n return gulp.src(config.html.sources)\n .pipe(gulpif(config.html.twig.enabled, twig({\n data,\n base: config.html.twig.baseDir,\n })))\n .pipe(gulp.dest(config.html.dest))\n .on('end', () => { done(); });\n }", "function processHtml() {\n return gulp.src(\n [\n srcRoot + \"**/*.html\"\n ]\n ).pipe(\n flatten()\n ).pipe(\n htmlMin(\n config.htmlMin\n )\n ).pipe(\n templatecache(\n config.templateCache.file,\n config.templateCache.options\n )\n ).pipe(\n gulp.dest(destination + \"components/templates/\")\n );\n }", "function generateHtml(){\n const html = `<!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n <link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/bulma@0.9.2/css/bulma.min.css\">\n <link rel=\"stylesheet\" href=\"/assets/css/style.css\">\n <title>Team Profile Generator</title>\n </head>\n <body>\n <nav class=\"navbar is-link\" role=\"navigation\" aria-label=\"main-navigation\">\n <div>\n <p class=\"navbar-item\">\n Team Profile Generator\n </p>\n </div>\n </nav>`;\n\n fs.writeFile('index.html', html, function(err) {\n if(err) {\n console.log(err);\n } \n });\n}", "function htmlLoaded() {\n // Macro\n macroTextVanilla.innerText = `// Loading an html file\n\ndocument.onload = function(){\n console.log(\"HTML file loaded!\");\n};`;\n\n // Output\n runButton.onclick = function () {\n outputVanilla.innerHTML = \"> HTML file loaded!\";\n console.log(\"HTML file loaded!\");\n };\n}", "function html() {\n return src(srcPaths.html)\n .pipe(dest(distPaths.html))\n .pipe(browserSync.stream());\n}", "function importHTML(filename, params) {\n var htmlTemplate = HtmlService.createTemplateFromFile(filename);\n if(params != null)\n htmlTemplate.dataFromServerTemplate = params\n return htmlTemplate.evaluate().getContent();\n}", "function gh_contents(page) {\r\n let p = page || this.page;\r\n let o = gh_opts(p);\r\n var user = o.user;\r\n var name = o.repo;\r\n var path = o.path || 'README.md';\r\n var ref = o.ref || 'master';\r\n\r\n if (name === undefined) {\r\n return '';\r\n }\r\n\r\n var prefix = ['https://github.com', user];\r\n if (name) {\r\n prefix.push(name);\r\n }\r\n\r\n var tpaths = path.split('/');\r\n for (var i = 0; i < tpaths.length - 1; i++) {\r\n prefix.push(tpaths[i]);\r\n }\r\n prefix.push('raw');\r\n prefix.push(ref);\r\n prefix.push('');\r\n p.gh.prefix = prefix.join('/');\r\n\r\n var cache = gh_read_cache(p);\r\n if (cache) {\r\n return cache.toString();\r\n }\r\n\r\n var url = util.format('repos/%s/%s/contents/%s', user, name, path);\r\n hexo.log.info(\"no cache, and try load from : \" + url);\r\n if (useSync) {\r\n var repo = reqSync(url, {\r\n data: {\r\n 'ref': ref\r\n }\r\n });\r\n if (repo && repo.content) {\r\n var md = new Buffer(repo.content, repo.encoding).toString();\r\n md = hexo.render.renderSync({ text: md, engine: 'markdown' });\r\n gh_write_cache(p, md);\r\n return md;\r\n }\r\n } else {\r\n api.get(url, { data: { 'ref': ref } }).then(res => {\r\n var md = new Buffer(res.content, res.encoding).toString();\r\n md = hexo.render.renderSync({ text: md, engine: 'markdown' });\r\n gh_write_cache(p, md);\r\n });\r\n }\r\n return '';\r\n}", "function include(File) {\n return HtmlService.createHtmlOutputFromFile(File).getContent();\n}", "function html() {\n return src(['./src/views/*'])\n .pipe(nunjucks.compile({\n env: new njk.Environment(new njk.FileSystemLoader('./src/views'))\n }))\n .pipe(dest('dist/'))\n}", "function readAndParse() {\n\t\t\tvar sheet = sheets.shift();\n\t\t\tif (sheet) {\n\t\t\t\tw(sheet);\n\t\t\t\tvar isLess = (sheet.slice(-4) == \"less\");\n\t\t\t\tif (isLess && (opt.less !== true)) {\n\t\t\t\t\tsheet = sheet.slice(0, sheet.length-4) + \"css\";\n\t\t\t\t\tisLess = false;\n\t\t\t\t\tw(\" (Substituting CSS: \" + sheet + \")\");\n\t\t\t\t}\n\t\t\t\tvar code = fs.readFileSync(sheet, \"utf8\");\n\t\t\t\tif (isLess) {\n\t\t\t\t\tvar parser = new(less.Parser)({filename:sheet, paths:[path.dirname(sheet)]});\n\t\t\t\t\tparser.parse(code, function (err, tree) {\n\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\tconsole.error(err);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\taddToBlob(sheet, tree.toCSS());\n\t\t\t\t\t\t}\n\t\t\t\t\t\treadAndParse(sheets);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\taddToBlob(sheet, code);\n\t\t\t\t\treadAndParse(sheets);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdoneCB(blob);\n\t\t\t}\n\t\t}", "function readAndParse() {\n\t\t\tvar sheet = sheets.shift();\n\t\t\tif (sheet) {\n\t\t\t\tw(sheet);\n\t\t\t\tvar isLess = (sheet.slice(-4) == \"less\");\n\t\t\t\tif (isLess && (opt.less !== true)) {\n\t\t\t\t\tsheet = sheet.slice(0, sheet.length-4) + \"css\";\n\t\t\t\t\tisLess = false;\n\t\t\t\t\tw(\" (Substituting CSS: \" + sheet + \")\");\n\t\t\t\t}\n\t\t\t\tvar code = fs.readFileSync(sheet, \"utf8\");\n\t\t\t\tif (isLess) {\n\t\t\t\t\tvar parser = new(less.Parser)({filename:sheet, paths:[path.dirname(sheet)], relativeUrls:true});\n\t\t\t\t\tparser.parse(code, function (err, tree) {\n\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\tconsole.error(err);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\taddToBlob(sheet, tree.toCSS());\n\t\t\t\t\t\t}\n\t\t\t\t\t\treadAndParse(sheets);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\taddToBlob(sheet, code);\n\t\t\t\t\treadAndParse(sheets);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdoneCB(blob);\n\t\t\t}\n\t\t}", "function readNewick(file) {\n tree = \"\";\n\n // Code to open file and read tree(s)...\n\n return tree;\n}", "function writeHTML(file, html, callback) {\n\t\tvar add = typeof html === 'string' ? [html] : html,\n\t\tremove = _tags.remove;\n\t\tfs.exists(file, function (exists) {\n\t\t\tif (exists) {\n\t\t\t\tprint('HTML file exists: ' + file);\n\t\t\t\tadd = add.concat(typeof _tags.add === 'string' ? [_tags.add] : _tags.add);\n\t\t\t\tremove = remove.concat(typeof _tags.remove === 'string' ? [_tags.remove] : _tags.remove);\n\t\t\t\tmetaparser({\n\t\t\t\t\tsource : file,\n\t\t\t\t\tadd : add,\n\t\t\t\t\tremove : remove,\n\t\t\t\t\tout : file,\n\t\t\t\t\tcallback : function (error, html) {\n\t\t\t\t\t\tprint('Successfully injected HTML into ' + file);\n\t\t\t\t\t\treturn callback(error, html);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tprint('HTML file does not exist: ' + file);\n\t\t\t\tfs.writeFile(file, html, function (error) {\n\t\t\t\t\tprint('Successfully created HTML file: ' + file);\n\t\t\t\t\treturn callback(error, html);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "function Parser(doc, file) {\n this.file = file;\n this.offset = {};\n this.options = xtend(this.options);\n this.setOptions({});\n\n this.inList = false;\n this.inBlock = false;\n this.inLink = false;\n this.atStart = true;\n\n this.toOffset = vfileLocation(file).toOffset;\n this.unescape = unescape(this, 'escape');\n this.decode = decode(this);\n}", "function convert_wet() {\n\tlet file_reader_content = new FileReader();\n\tlet content_str = document.getElementById(\"html_file\").files[0];\n\tfile_reader_content.onload = function(event) {\n\t\tlet html_doc_str = event.target.result.replaceAll(\"\\r\\n\", \"\\n\");\n // get options\n let check_align_center = document.getElementById(\"align_center\").checked;\n let check_span = document.getElementById(\"span\").checked;\n // convert WET version\n if (document.getElementById(\"wet_conversion\").value === \"to_wet4\") {\n html_doc_str = convert_wet3_to_wet4(html_doc_str, check_align_center, check_span);\n } else {\n html_doc_str = convert_wet4_to_wet3(html_doc_str, check_align_center, check_span);\n }\n\t\tdownload(html_doc_str, \"formatted.html\", \"text/html\");\n\t}\n\tfile_reader_content.readAsText(content_str);\n}", "function mdToHtml(input) {\n let rule = myna.allRules['markdown.document'];\n let ast = myna.parse(rule, input);\n return mdAstToHtml(ast, []).join(\"\");\n}", "function getAndPrintHTML() {\n\n var https = require('https');\n\n var requestOptions = {\n host: 'sytantris.github.io',\n path: '/http-examples/step2.html'\n };\n\n var fullData = \"\";\n\n // console.logs each chunk of data as it is received,\n // concatenated with a newline character ('\\n')\n https.get(requestOptions, function (response) {\n\n // set encoding of received data to UTF-8\n response.setEncoding('utf8');\n\n // the callback is invoked when a `data` chunk is received\n response.on('data', function (data) {\n fullData += (data + \"\\n\");\n });\n\n response.on('end', function () {\n console.log(fullData);\n });\n\n });\n\n}", "function readTextFile(file) {\n //Look into fetch or FileReader\n let rawFile = new XMLHttpRequest();\n let allText;\n rawFile.open(\"GET\", file, false);\n rawFile.onreadystatechange = () => (allText = rawFile.responseText);\n rawFile.send(null);\n getElementData(allText, file);\n}", "parse () {\n const place = [];\n const texts = [];\n const ids = {};\n\n const htmlParser = new htmlparser2.Parser({\n onopentag(tagname, attributes) {\n let id = uuid();\n\n ids[id] = {\n id: id,\n tag: tagname.toLowerCase(),\n attributes: attributes,\n text: null,\n descendants: []\n };\n\n // add it to all ancestors\n place.forEach(anscestorId => {\n ids[anscestorId].descendants.push(id);\n });\n\n place.push(id);\n },\n ontext(text) {\n texts.push(text.trim());\n },\n onclosetag() {\n let id = place.pop();\n\n if (id && (typeof ids[id] !== 'undefined')) {\n ids[id].text = texts.pop();\n }\n }\n });\n\n htmlParser.write(this.html);\n\n this.items = Object.values(ids);\n }", "function parseFile(filePath) {\n return new Promise((resolve, reject) => {\n fs.readFile(filePath, 'utf8', (err, data) => {\n if (err) {\n reject(err.toString());\n return;\n }\n if (!frontMatter.test(data)) {\n resolve();\n return;\n }\n const matter = frontMatter(data);\n matter.attributes.__src = filePath;\n resolve(matter);\n });\n });\n}", "function printFile(fileName) {\n if (!fileName) {\n // tslint:disable-next-line\n console.log('Usage:\\n' + green('drcp run @dr-core/ng-app-builder/dist/utils/ts-ast-query --file <ts file>'));\n return;\n }\n new Selector(fs.readFileSync(fileName, 'utf8'), fileName).printAll();\n}", "function htmlHandler() {\n\treturn gulp.src(\"./app/pug/index.pug\")\n\t.pipe(pug({pretty: true}).on(\"error\", errorHandler))\n\t.pipe(gulp.dest(\"./dist/\"))\n\t.pipe(browserSync.stream());\n}", "function PostToHTML(relpath, markdown_body) {\n var callback = function (text) {\n\n /* circumvent github's auto-meta parsing */\n text = text.replace(\"(((\",'---');\n text = text.replace(\")))\",'---');\n\n /* write some HTML to format the data */\n var body = document.getElementById(markdown_body);\n var post_head = document.createElement('div');\n var post_body = document.createElement('div');\n body.appendChild(post_head);\n body.appendChild(post_body);\n\n if ((isBlank(text)) || (text == null) || (text == 'null') || (typeof text === 'undefined')) {\n post_head.innerHTML = 'Unable to load text for: '+relpath;\n return;\n }\n\n /* parse YAML header */\n var obj = jsyaml.loadFront(text)\n\n /* check for post meta data */\n var date = typeof obj.Date !== 'undefined' ? obj.Date.toDateString() : '';\n var author = typeof obj.Author !== 'undefined' ? obj.Author : '';\n var summary = typeof obj.Summary !== 'undefined' ? obj.Summary : '';\n var title = typeof obj.Title !== 'undefined' ? obj.Title : '';\n\n /* write some HTML to format the data */\n post_head.innerHTML = '<b>'+title+'</b><br> &nbsp; &nbsp; '+author+\n ' | <small>'+date+'</small><br><br>';\n\n /* convert the unparsed content as markdown */\n post_body.innerHTML = Showdown(obj.__content);\n $('.linenums').removeClass('linenums');\n prettyPrint();\n };\n getFile(relpath, callback);\n}", "static async loadPage(url){\n const response = await fetch(url);\n const data = await response.text();\n // fs.writeFileSync(\"debug.html\", data);\n return {\n $: cheerio.load(data),\n html: data\n };\n }", "function renderHTML()\n {\n \n\n fs.writeFile('result/index.html', getTemplate(renderScript()), (err) => {\n \n if (err) throw err;\n \n console.log('HTML generated!');\n });\n \n\n }", "parseToMJML(content) {\n const res = mjml2html(content);\n if (res) {\n return res.html;\n } else {\n console.error(res);\n }\n }", "function parse(){\n let lines = editor.innerText.split(\"\\n\");\n let newText = \"\";\n\n lines.forEach(line => {\n let sub;\n let lineContent = line.split(\" \");\n let markdownTag = lineContent[0];\n \n if (markdownTags.includes(markdownTag)) {\n lineContent.shift();\n sub = lineContent.join(\" \");\n\n switch (markdownTag) {\n case \"#\":\n newText += \"<h1>\" + sub + \"</h2>\";\n break;\n \n case \"##\":\n newText += \"<h2>\" + sub + \"</h2>\";\n break;\n\n case \"###\":\n newText += \"<h3>\" + sub + \"</h3>\";\n break;\n\n case \"####\":\n newText += \"<h4>\" + sub + \"</h5>\";\n break;\n }\n }\n else{\n newText += line + \"<br>\";\n }\n //newText += \"<br>\";\n });\n\n copyAsPlainText(newText);\n}", "function writeHTML() {\n let html = starterCode.getStarterCode();\n fs.writeFile(\"./output/index.html\", html, (err) => {\n if (err) throw err;\n });\n}", "function parseFile(file, successCallback, errorCallback) {\n let r = new FileReader();\n\n r.onload = e => {\n // load the contents of the file into `contents`\n let contents = e.target.result;\n successCallback(contents);\n };\n\n r.onerror = errorCallback;\n\n r.readAsText(file);\n}", "readin () {\n this.content = readFile(this.path);\n }" ]
[ "0.611419", "0.60167515", "0.58644223", "0.5858895", "0.5821196", "0.58199507", "0.5761517", "0.5667549", "0.56016403", "0.5577509", "0.55709463", "0.545141", "0.54437375", "0.54271954", "0.542706", "0.54122686", "0.5377525", "0.5374414", "0.53628474", "0.53308064", "0.53271794", "0.5314439", "0.5312996", "0.5312409", "0.5309697", "0.530496", "0.5286541", "0.52857286", "0.52751625", "0.52689904", "0.52588266", "0.5253758", "0.52524275", "0.5238045", "0.52361214", "0.52296823", "0.5227806", "0.5216387", "0.5204057", "0.5193924", "0.51683754", "0.51600283", "0.5158642", "0.51368016", "0.5123151", "0.5117704", "0.5101477", "0.50632006", "0.5057861", "0.50492966", "0.50461847", "0.5034994", "0.50250673", "0.5024547", "0.502209", "0.50195277", "0.50190383", "0.50145423", "0.49962226", "0.49935213", "0.49894232", "0.4978236", "0.49758726", "0.49624535", "0.49561054", "0.49499807", "0.49455884", "0.49296442", "0.49263152", "0.49258238", "0.49227154", "0.49158514", "0.49040636", "0.49033776", "0.48966533", "0.48957565", "0.48951572", "0.48930627", "0.48739383", "0.4870805", "0.4863686", "0.48574162", "0.4848735", "0.48408914", "0.48407188", "0.48380765", "0.4833212", "0.4830207", "0.4827937", "0.48142317", "0.48059082", "0.48056585", "0.48041654", "0.48036718", "0.48010278", "0.4797404", "0.4796498", "0.47938848", "0.4792884", "0.47879246" ]
0.75782984
0
Disable touch scrolling / document.querySelector(All) returns a NodeList instead of Array
function list(weirdlist) { return Array.prototype.slice.call(weirdlist); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function __(elm) { return document.querySelectorAll(elm) }", "queryAll(selector) {\n return res.concat(Array.prototype.slice.call(document.querySelectorAll(selector)))\n }", "queryAll(target) {\n return document.querySelectorAll(target);\n }", "_preventWebkitOverflowScrollingTouch(element){var result=[];while(element){if(\"touch\"===window.getComputedStyle(element).webkitOverflowScrolling){var oldInlineValue=element.style.webkitOverflowScrolling;element.style.webkitOverflowScrolling=\"auto\";result.push({element:element,oldInlineValue:oldInlineValue})}element=element.parentElement}return result}", "function __( el )\n{\n return document.querySelectorAll( el );\n}", "function qsa(parent, selector){return [].slice.call(parent.querySelectorAll(selector) )}", "function disableScrolling(){\n document.querySelector('body').classList.add('stop-scrolling');\n }", "function querySelectorAll(){\n\t\tvar result = document.querySelectorAll.apply(document, arguments);\n\t\t// opera fails to add the foreach method added to the nodelist prototype\n\t\tif (result.forEach === undefined){\n\t\t\tresult.forEach = Array.prototype.forEach;\n\t\t}\n\t\treturn result;\n\t}", "function disableElementScrollEvents(element){function preventDefault(e){e.preventDefault();}element.on('wheel',preventDefault);element.on('touchmove',preventDefault);return function(){element.off('wheel',preventDefault);element.off('touchmove',preventDefault);};}", "function qAll (selector) {\n return document.querySelectorAll(selector)\n}", "static querySelectorAll(selector) {\n if (selector.indexOf(\"/shadow/\") != -1) {\n return new DomQuery(document)._querySelectorAllDeep(selector);\n }\n else {\n return new DomQuery(document)._querySelectorAll(selector);\n }\n }", "static querySelectorAll(selector) {\n if (selector.indexOf(\"/shadow/\") != -1) {\n return new DomQuery(document)._querySelectorAllDeep(selector);\n }\n else {\n return new DomQuery(document)._querySelectorAll(selector);\n }\n }", "function findElements(){\n\t\tfindingElements = true;\n\n\t\tanimatedElements = document.querySelectorAll(\"*[data-animation]\");\n\t\tscrollElems = [];\n\t\tfor (let elem of animatedElements){\n\t\t\tdecodeStyles(elem);\n\t\t\tif (elem.dataset.animation.includes(\"scroll\")){\n\t\t\t\tscrollElems.push(elem);\n\t\t\t}\n\t\t}\n\n\t\tfindingElements = false;\n\t}", "function qsa(selector) {\n return document.querySelectorAll(selector);\n}", "function preventTouchScroll() {\n log(\"preventTouchScroll\");\n\n if (! document.addEventListener) {\n throwMissingAddEventListenerError(\"Cannot preventTouchScroll; document.addEventListener is not a function\");\n }\n\n document.addEventListener(\"touchmove\", preventDefault);\n }", "function allowTouchScroll() {\n log(\"allowTouchScroll\");\n\n document.removeEventListener(\"touchmove\", preventDefault);\n }", "function _getAllDOMNodes(selector) {\n\t\t\tlet $els = null;\n\t\t\tif (typeof selector === 'string') {\n\t\t\t\tif (document.querySelectorAll(selector) === null) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t$els = document.querySelectorAll(selector);\n\t\t\t\treturn $els ;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "disableAll()\n {\n let targets = document.querySelectorAll('.target');\n\n if(targets.length > 0)\n {\n targets.forEach( t => {\n\n t.classList.remove('target')\n });\n }\n }", "_togglePageScrollability() {\n const pageContainer = document.querySelector('html');\n\n pageContainer.classList.toggle(CLASS_NAME.unscrollable);\n\n if (pageContainer.classList.contains(CLASS_NAME.unscrollable)) {\n disableBodyScroll(this.elementRef);\n } else {\n enableBodyScroll(this.elementRef);\n }\n }", "function disableElementScroll() {\n let zIndex = 50;\n let scrollMask = Ember.$(`<div class=\"md-scroll-mask\" style=\"z-index: ${zIndex}\">\n <div class=\"md-scroll-mask-bar\"></div>\n </div>`);\n body.appendChild(scrollMask[0]);\n\n scrollMask.on('wheel', preventDefault);\n scrollMask.on('touchmove', preventDefault);\n $document.on('keydown', disableKeyNav);\n\n return function restoreScroll() {\n scrollMask.off('wheel');\n scrollMask.off('touchmove');\n scrollMask[0].parentNode.removeChild(scrollMask[0]);\n $document.off('keydown', disableKeyNav);\n delete util.disableScrollAround._enableScrolling;\n };\n\n // Prevent keypresses from elements inside the body\n // used to stop the keypresses that could cause the page to scroll\n // (arrow keys, spacebar, tab, etc).\n function disableKeyNav() {\n // -- temporarily removed this logic, will possibly re-add at a later date\n return;\n /* if (!element[0].contains(e.target)) {\n e.preventDefault();\n e.stopImmediatePropagation();\n } */\n }\n\n function preventDefault(e) {\n e.preventDefault();\n }\n }", "function disableElementScroll() {\n var zIndex = 50;\n var scrollMask = $('<div class=\"md-scroll-mask\" style=\"z-index: ' + zIndex + '\">\\n <div class=\"md-scroll-mask-bar\"></div>\\n </div>');\n body.appendChild(scrollMask[0]);\n\n scrollMask.on('wheel', preventDefault);\n scrollMask.on('touchmove', preventDefault);\n $document.on('keydown', disableKeyNav);\n\n return function restoreScroll() {\n scrollMask.off('wheel');\n scrollMask.off('touchmove');\n scrollMask[0].parentNode.removeChild(scrollMask[0]);\n $document.off('keydown', disableKeyNav);\n delete util.disableScrollAround._enableScrolling;\n };\n\n // Prevent keypresses from elements inside the body\n // used to stop the keypresses that could cause the page to scroll\n // (arrow keys, spacebar, tab, etc).\n function disableKeyNav(e) {\n // -- temporarily removed this logic, will possibly re-add at a later date\n return;\n if (!element[0].contains(e.target)) {\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n }\n\n function preventDefault(e) {\n e.preventDefault();\n }\n }", "function disableElementScroll() {\n var zIndex = 50;\n var scrollMask = $('<div class=\"md-scroll-mask\" style=\"z-index: ' + zIndex + '\">\\n <div class=\"md-scroll-mask-bar\"></div>\\n </div>');\n body.appendChild(scrollMask[0]);\n\n scrollMask.on('wheel', preventDefault);\n scrollMask.on('touchmove', preventDefault);\n $document.on('keydown', disableKeyNav);\n\n return function restoreScroll() {\n scrollMask.off('wheel');\n scrollMask.off('touchmove');\n scrollMask[0].parentNode.removeChild(scrollMask[0]);\n $document.off('keydown', disableKeyNav);\n delete util.disableScrollAround._enableScrolling;\n };\n\n // Prevent keypresses from elements inside the body\n // used to stop the keypresses that could cause the page to scroll\n // (arrow keys, spacebar, tab, etc).\n function disableKeyNav(e) {\n // -- temporarily removed this logic, will possibly re-add at a later date\n return;\n if (!element[0].contains(e.target)) {\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n }\n\n function preventDefault(e) {\n e.preventDefault();\n }\n }", "function disableElementScroll() {\n var zIndex = 50;\n var scrollMask = $('<div class=\"md-scroll-mask\" style=\"z-index: ' + zIndex + '\">\\n <div class=\"md-scroll-mask-bar\"></div>\\n </div>');\n body.appendChild(scrollMask[0]);\n\n scrollMask.on('wheel', preventDefault);\n scrollMask.on('touchmove', preventDefault);\n $document.on('keydown', disableKeyNav);\n\n return function restoreScroll() {\n scrollMask.off('wheel');\n scrollMask.off('touchmove');\n scrollMask[0].parentNode.removeChild(scrollMask[0]);\n $document.off('keydown', disableKeyNav);\n delete util.disableScrollAround._enableScrolling;\n };\n\n // Prevent keypresses from elements inside the body\n // used to stop the keypresses that could cause the page to scroll\n // (arrow keys, spacebar, tab, etc).\n function disableKeyNav(e) {\n // -- temporarily removed this logic, will possibly re-add at a later date\n return;\n if (!element[0].contains(e.target)) {\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n }\n\n function preventDefault(e) {\n e.preventDefault();\n }\n }", "function queryElements(elem, selector) {\n try {\n return Array.prototype.slice.call(elem.querySelectorAll(selector), 0);\n } catch(e) {\n return [];\n }\n }", "querySelectorAll(selectors) {\n if (shouldAlwaysSelectNothing(this)) {\n return NodeList.create(this._globalObject, [], { nodes: [] });\n }\n const matcher = addNwsapi(this);\n const list = matcher.select(selectors, idlUtils.wrapperForImpl(this));\n\n return NodeList.create(this._globalObject, [], { nodes: list.map(n => idlUtils.tryImplForWrapper(n)) });\n }", "_resetCursorStops() {\n Polymer.dom.flush();\n // Polymer2: querySelectorAll returns NodeList instead of Array.\n this._listElements = Array.from(\n Polymer.dom(this.root).querySelectorAll('li'));\n }", "function disableBodyScroll() {\n var doc = Object(__WEBPACK_IMPORTED_MODULE_0__dom__[\"e\" /* getDocument */])();\n if (doc && doc.body && !_bodyScrollDisabledCount) {\n doc.body.classList.add(DisabledScrollClassName);\n }\n _bodyScrollDisabledCount++;\n}", "getScrollEventTarget(element, root = window) {\n let node = element;\n\n while (\n node &&\n node.tagName !== \"HTML\" &&\n node.nodeType === 1 &&\n node !== root\n ) {\n const { overflowY } = window.getComputedStyle(node);\n\n if (overflowScrollReg.test(overflowY)) {\n if (node.tagName !== \"BODY\") {\n return node;\n }\n\n // see: https://github.com/youzan/vant/issues/3823\n const { overflowY: htmlOverflowY } = window.getComputedStyle(\n node.parentNode\n );\n\n if (overflowScrollReg.test(htmlOverflowY)) {\n return node;\n }\n }\n node = node.parentNode;\n }\n\n return root;\n }", "async getAllRawElements(selector) {\n await this.forceStabilize();\n return Array.from(this._options.queryFn(selector, this.rawRootElement));\n }", "function enableBodyScroll() {\n if (_bodyScrollDisabledCount > 0) {\n var doc = Object(__WEBPACK_IMPORTED_MODULE_0__dom__[\"e\" /* getDocument */])();\n if (doc && doc.body && _bodyScrollDisabledCount === 1) {\n doc.body.classList.remove(DisabledScrollClassName);\n }\n _bodyScrollDisabledCount--;\n }\n}", "static getElements(els) {\r\n if (typeof els === 'string') {\r\n let list = document.querySelectorAll(els);\r\n if (!list.length && els[0] !== '.' && els[0] !== '#') {\r\n list = document.querySelectorAll('.' + els);\r\n if (!list.length) {\r\n list = document.querySelectorAll('#' + els);\r\n }\r\n }\r\n return Array.from(list);\r\n }\r\n return [els];\r\n }", "function qa(s) {return document.querySelectorAll(s)}", "function getAllSections(){\n return document.querySelectorAll(\"section\");\n}", "function enableBodyScroll() {\n if (_bodyScrollDisabledCount > 0) {\n var doc = Object(_dom_getDocument__WEBPACK_IMPORTED_MODULE_0__[\"getDocument\"])();\n if (doc && doc.body && _bodyScrollDisabledCount === 1) {\n doc.body.classList.remove(DisabledScrollClassName);\n doc.body.removeEventListener('touchmove', _disableIosBodyScroll);\n }\n _bodyScrollDisabledCount--;\n }\n}", "function $qsa(el) {\n return document.querySelectorAll(el);\n }", "function getAllParagraphs() {\n return document.querySelectorAll(\"#myPage > p\")\n}", "function queryAll(selector){return(protoOrDescriptor,// tslint:disable-next-line:no-any decorator\nname)=>{const descriptor={get(){return this.renderRoot.querySelectorAll(selector)},enumerable:!0,configurable:!0};return name!==void 0?legacyQuery(descriptor,protoOrDescriptor,name):standardQuery(descriptor,protoOrDescriptor)}}", "function qsa(selector) {\n\t\treturn document.querySelectorAll(selector);\n\t}", "function enableBodyScroll() {\n if (_bodyScrollDisabledCount > 0) {\n var doc = (0,_dom_getDocument__WEBPACK_IMPORTED_MODULE_1__.getDocument)();\n if (doc && doc.body && _bodyScrollDisabledCount === 1) {\n doc.body.classList.remove(DisabledScrollClassName);\n doc.body.removeEventListener('touchmove', _disableIosBodyScroll);\n }\n _bodyScrollDisabledCount--;\n }\n}", "function enableBodyScroll() {\n if (_bodyScrollDisabledCount > 0) {\n var doc = (0,_dom_getDocument__WEBPACK_IMPORTED_MODULE_1__.getDocument)();\n if (doc && doc.body && _bodyScrollDisabledCount === 1) {\n doc.body.classList.remove(DisabledScrollClassName);\n doc.body.removeEventListener('touchmove', _disableIosBodyScroll);\n }\n _bodyScrollDisabledCount--;\n }\n}", "function $all(q) {\n\treturn document.querySelectorAll(q);\n}", "function setInspectedElement() {\n return Array.from(document.querySelectorAll('*')).findIndex((el) => el === $0);\n }", "function $qsa(el) {\n return document.querySelectorAll(el);\n }", "function enableBodyScroll() {\r\n if (_bodyScrollDisabledCount > 0) {\r\n var doc = getDocument();\r\n if (doc && doc.body && _bodyScrollDisabledCount === 1) {\r\n doc.body.classList.remove(DisabledScrollClassName);\r\n doc.body.removeEventListener('touchmove', _disableIosBodyScroll);\r\n }\r\n _bodyScrollDisabledCount--;\r\n }\r\n}", "function enableBodyScroll() {\r\n if (_bodyScrollDisabledCount > 0) {\r\n var doc = getDocument();\r\n if (doc && doc.body && _bodyScrollDisabledCount === 1) {\r\n doc.body.classList.remove(DisabledScrollClassName);\r\n doc.body.removeEventListener('touchmove', _disableIosBodyScroll);\r\n }\r\n _bodyScrollDisabledCount--;\r\n }\r\n}", "function disableBodyScroll() {\n var doc = Object(_dom_getDocument__WEBPACK_IMPORTED_MODULE_0__[\"getDocument\"])();\n if (doc && doc.body && !_bodyScrollDisabledCount) {\n doc.body.classList.add(DisabledScrollClassName);\n doc.body.addEventListener('touchmove', _disableIosBodyScroll, { passive: false, capture: false });\n }\n _bodyScrollDisabledCount++;\n}", "disableScroll() {\n window.addEventListener('DOMMouseScroll', preventDefault, false); // older FF\n window.addEventListener(wheelEvent, preventDefault, wheelOpt); // modern desktop\n window.addEventListener('touchmove', preventDefault, wheelOpt); // mobile\n window.addEventListener('keydown', preventDefaultForScrollKeys, false);\n }", "get items() {\n return [...this._el.querySelectorAll(`${this._itemSelector}`)];\n }", "getElements(selector) {\n let elements = Array.from(\n document.querySelectorAll('bolt-image'),\n ).map(elem =>\n elem.renderRoot\n ? elem.renderRoot.querySelector(selector)\n : elem.querySelector(selector),\n );\n elements = elements.filter(function(el) {\n return el != null;\n });\n return elements;\n }", "function disableScroll() {\n window.addEventListener(\"DOMMouseScroll\", preventDefault, false); // older FF\n window.addEventListener(wheelEvent, preventDefault, wheelOpt); // modern desktop\n window.addEventListener(\"touchmove\", preventDefault, wheelOpt); // mobile\n }", "GetTargets(){this.targets = document.querySelectorAll(this.target_selector)}", "get disableAutoScroll() {\n\t\treturn this.nativeElement ? this.nativeElement.disableAutoScroll : undefined;\n\t}", "function disableElementScrollEvents(element) {\n\n function preventDefault(e) {\n e.preventDefault();\n }\n\n element.on('wheel', preventDefault);\n element.on('touchmove', preventDefault);\n\n return function() {\n element.off('wheel', preventDefault);\n element.off('touchmove', preventDefault);\n };\n }", "function disableElementScrollEvents(element) {\n\n function preventDefault(e) {\n e.preventDefault();\n }\n\n element.on('wheel', preventDefault);\n element.on('touchmove', preventDefault);\n\n return function() {\n element.off('wheel', preventDefault);\n element.off('touchmove', preventDefault);\n };\n }", "function polyfill() {\n // return when scrollBehavior interface is supported\n if ('scrollBehavior' in d.documentElement.style) {\n return;\n }\n\n /*\n * globals\n */\n var Element = w.HTMLElement || w.Element;\n var SCROLL_TIME = 468;\n\n /*\n * object gathering original scroll methods\n */\n var original = {\n scroll: w.scroll || w.scrollTo,\n scrollBy: w.scrollBy,\n elScroll: Element.prototype.scroll || scrollElement,\n scrollIntoView: Element.prototype.scrollIntoView\n };\n\n /*\n * define timing method\n */\n var now = w.performance && w.performance.now\n ? w.performance.now.bind(w.performance) : Date.now;\n\n /**\n * changes scroll position inside an element\n * @method scrollElement\n * @param {Number} x\n * @param {Number} y\n */\n function scrollElement(x, y) {\n this.scrollLeft = x;\n this.scrollTop = y;\n }\n\n /**\n * returns result of applying ease math function to a number\n * @method ease\n * @param {Number} k\n * @returns {Number}\n */\n function ease(k) {\n return 0.5 * (1 - Math.cos(Math.PI * k));\n }\n\n /**\n * indicates if a smooth behavior should be applied\n * @method shouldBailOut\n * @param {Number|Object} x\n * @returns {Boolean}\n */\n function shouldBailOut(x) {\n if (typeof x !== 'object'\n || x === null\n || x.behavior === undefined\n || x.behavior === 'auto'\n || x.behavior === 'instant') {\n // first arg not an object/null\n // or behavior is auto, instant or undefined\n return true;\n }\n\n if (typeof x === 'object'\n && x.behavior === 'smooth') {\n // first argument is an object and behavior is smooth\n return false;\n }\n\n // throw error when behavior is not supported\n throw new TypeError('behavior not valid');\n }\n\n /**\n * finds scrollable parent of an element\n * @method findScrollableParent\n * @param {Node} el\n * @returns {Node} el\n */\n function findScrollableParent(el) {\n var isBody;\n var hasScrollableSpace;\n var hasVisibleOverflow;\n\n do {\n el = el.parentNode;\n\n // set condition variables\n isBody = el === d.body;\n hasScrollableSpace =\n el.clientHeight < el.scrollHeight ||\n el.clientWidth < el.scrollWidth;\n hasVisibleOverflow =\n w.getComputedStyle(el, null).overflow === 'visible';\n } while (!isBody && !(hasScrollableSpace && !hasVisibleOverflow));\n\n isBody = hasScrollableSpace = hasVisibleOverflow = null;\n\n return el;\n }\n\n /**\n * self invoked function that, given a context, steps through scrolling\n * @method step\n * @param {Object} context\n */\n function step(context) {\n var time = now();\n var value;\n var currentX;\n var currentY;\n var elapsed = (time - context.startTime) / SCROLL_TIME;\n\n // avoid elapsed times higher than one\n elapsed = elapsed > 1 ? 1 : elapsed;\n\n // apply easing to elapsed time\n value = ease(elapsed);\n\n currentX = context.startX + (context.x - context.startX) * value;\n currentY = context.startY + (context.y - context.startY) * value;\n\n context.method.call(context.scrollable, currentX, currentY);\n\n // scroll more if we have not reached our destination\n if (currentX !== context.x || currentY !== context.y) {\n w.requestAnimationFrame(step.bind(w, context));\n }\n }\n\n /**\n * scrolls window with a smooth behavior\n * @method smoothScroll\n * @param {Object|Node} el\n * @param {Number} x\n * @param {Number} y\n */\n function smoothScroll(el, x, y) {\n var scrollable;\n var startX;\n var startY;\n var method;\n var startTime = now();\n\n // define scroll context\n if (el === d.body) {\n scrollable = w;\n startX = w.scrollX || w.pageXOffset;\n startY = w.scrollY || w.pageYOffset;\n method = original.scroll;\n } else {\n scrollable = el;\n startX = el.scrollLeft;\n startY = el.scrollTop;\n method = scrollElement;\n }\n\n // scroll looping over a frame\n step({\n scrollable: scrollable,\n method: method,\n startTime: startTime,\n startX: startX,\n startY: startY,\n x: x,\n y: y\n });\n }\n\n /*\n * ORIGINAL METHODS OVERRIDES\n */\n\n // w.scroll and w.scrollTo\n w.scroll = w.scrollTo = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.scroll.call(\n w,\n arguments[0].left || arguments[0],\n arguments[0].top || arguments[1]\n );\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n w,\n d.body,\n ~~arguments[0].left,\n ~~arguments[0].top\n );\n };\n\n // w.scrollBy\n w.scrollBy = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.scrollBy.call(\n w,\n arguments[0].left || arguments[0],\n arguments[0].top || arguments[1]\n );\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n w,\n d.body,\n ~~arguments[0].left + (w.scrollX || w.pageXOffset),\n ~~arguments[0].top + (w.scrollY || w.pageYOffset)\n );\n };\n\n // Element.prototype.scroll and Element.prototype.scrollTo\n Element.prototype.scroll = Element.prototype.scrollTo = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.elScroll.call(\n this,\n arguments[0].left || arguments[0],\n arguments[0].top || arguments[1]\n );\n return;\n }\n\n var left = arguments[0].left;\n var top = arguments[0].top;\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n this,\n this,\n typeof left === 'number' ? left : this.scrollLeft,\n typeof top === 'number' ? top : this.scrollTop\n );\n };\n\n // Element.prototype.scrollBy\n Element.prototype.scrollBy = function() {\n var arg0 = arguments[0];\n\n if (typeof arg0 === 'object') {\n this.scroll({\n left: arg0.left + this.scrollLeft,\n top: arg0.top + this.scrollTop,\n behavior: arg0.behavior\n });\n } else {\n this.scroll(\n this.scrollLeft + arg0,\n this.scrollTop + arguments[1]\n );\n }\n };\n\n // Element.prototype.scrollIntoView\n Element.prototype.scrollIntoView = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.scrollIntoView.call(\n this,\n arguments[0] === undefined ? true : arguments[0]\n );\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n var scrollableParent = findScrollableParent(this);\n var parentRects = scrollableParent.getBoundingClientRect();\n var clientRects = this.getBoundingClientRect();\n\n if (scrollableParent !== d.body) {\n // reveal element inside parent\n smoothScroll.call(\n this,\n scrollableParent,\n scrollableParent.scrollLeft + clientRects.left - parentRects.left,\n scrollableParent.scrollTop + clientRects.top - parentRects.top\n );\n // reveal parent in viewport\n w.scrollBy({\n left: parentRects.left,\n top: parentRects.top,\n behavior: 'smooth'\n });\n } else {\n // reveal element in viewport\n w.scrollBy({\n left: clientRects.left,\n top: clientRects.top,\n behavior: 'smooth'\n });\n }\n };\n }", "function polyfill() {\n // return when scrollBehavior interface is supported\n if ('scrollBehavior' in d.documentElement.style) {\n return;\n }\n\n /*\n * globals\n */\n var Element = w.HTMLElement || w.Element;\n var SCROLL_TIME = 468;\n\n /*\n * object gathering original scroll methods\n */\n var original = {\n scroll: w.scroll || w.scrollTo,\n scrollBy: w.scrollBy,\n elScroll: Element.prototype.scroll || scrollElement,\n scrollIntoView: Element.prototype.scrollIntoView\n };\n\n /*\n * define timing method\n */\n var now = w.performance && w.performance.now\n ? w.performance.now.bind(w.performance) : Date.now;\n\n /**\n * changes scroll position inside an element\n * @method scrollElement\n * @param {Number} x\n * @param {Number} y\n */\n function scrollElement(x, y) {\n this.scrollLeft = x;\n this.scrollTop = y;\n }\n\n /**\n * returns result of applying ease math function to a number\n * @method ease\n * @param {Number} k\n * @returns {Number}\n */\n function ease(k) {\n return 0.5 * (1 - Math.cos(Math.PI * k));\n }\n\n /**\n * indicates if a smooth behavior should be applied\n * @method shouldBailOut\n * @param {Number|Object} x\n * @returns {Boolean}\n */\n function shouldBailOut(x) {\n if (typeof x !== 'object'\n || x === null\n || x.behavior === undefined\n || x.behavior === 'auto'\n || x.behavior === 'instant') {\n // first arg not an object/null\n // or behavior is auto, instant or undefined\n return true;\n }\n\n if (typeof x === 'object'\n && x.behavior === 'smooth') {\n // first argument is an object and behavior is smooth\n return false;\n }\n\n // throw error when behavior is not supported\n throw new TypeError('behavior not valid');\n }\n\n /**\n * finds scrollable parent of an element\n * @method findScrollableParent\n * @param {Node} el\n * @returns {Node} el\n */\n function findScrollableParent(el) {\n var isBody;\n var hasScrollableSpace;\n var hasVisibleOverflow;\n\n do {\n el = el.parentNode;\n\n // set condition variables\n isBody = el === d.body;\n hasScrollableSpace =\n el.clientHeight < el.scrollHeight ||\n el.clientWidth < el.scrollWidth;\n hasVisibleOverflow =\n w.getComputedStyle(el, null).overflow === 'visible';\n } while (!isBody && !(hasScrollableSpace && !hasVisibleOverflow));\n\n isBody = hasScrollableSpace = hasVisibleOverflow = null;\n\n return el;\n }\n\n /**\n * self invoked function that, given a context, steps through scrolling\n * @method step\n * @param {Object} context\n */\n function step(context) {\n var time = now();\n var value;\n var currentX;\n var currentY;\n var elapsed = (time - context.startTime) / SCROLL_TIME;\n\n // avoid elapsed times higher than one\n elapsed = elapsed > 1 ? 1 : elapsed;\n\n // apply easing to elapsed time\n value = ease(elapsed);\n\n currentX = context.startX + (context.x - context.startX) * value;\n currentY = context.startY + (context.y - context.startY) * value;\n\n context.method.call(context.scrollable, currentX, currentY);\n\n // scroll more if we have not reached our destination\n if (currentX !== context.x || currentY !== context.y) {\n w.requestAnimationFrame(step.bind(w, context));\n }\n }\n\n /**\n * scrolls window with a smooth behavior\n * @method smoothScroll\n * @param {Object|Node} el\n * @param {Number} x\n * @param {Number} y\n */\n function smoothScroll(el, x, y) {\n var scrollable;\n var startX;\n var startY;\n var method;\n var startTime = now();\n\n // define scroll context\n if (el === d.body) {\n scrollable = w;\n startX = w.scrollX || w.pageXOffset;\n startY = w.scrollY || w.pageYOffset;\n method = original.scroll;\n } else {\n scrollable = el;\n startX = el.scrollLeft;\n startY = el.scrollTop;\n method = scrollElement;\n }\n\n // scroll looping over a frame\n step({\n scrollable: scrollable,\n method: method,\n startTime: startTime,\n startX: startX,\n startY: startY,\n x: x,\n y: y\n });\n }\n\n /*\n * ORIGINAL METHODS OVERRIDES\n */\n\n // w.scroll and w.scrollTo\n w.scroll = w.scrollTo = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.scroll.call(\n w,\n arguments[0].left || arguments[0],\n arguments[0].top || arguments[1]\n );\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n w,\n d.body,\n ~~arguments[0].left,\n ~~arguments[0].top\n );\n };\n\n // w.scrollBy\n w.scrollBy = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.scrollBy.call(\n w,\n arguments[0].left || arguments[0],\n arguments[0].top || arguments[1]\n );\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n w,\n d.body,\n ~~arguments[0].left + (w.scrollX || w.pageXOffset),\n ~~arguments[0].top + (w.scrollY || w.pageYOffset)\n );\n };\n\n // Element.prototype.scroll and Element.prototype.scrollTo\n Element.prototype.scroll = Element.prototype.scrollTo = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.elScroll.call(\n this,\n arguments[0].left || arguments[0],\n arguments[0].top || arguments[1]\n );\n return;\n }\n\n var left = arguments[0].left;\n var top = arguments[0].top;\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n this,\n this,\n typeof left === 'number' ? left : this.scrollLeft,\n typeof top === 'number' ? top : this.scrollTop\n );\n };\n\n // Element.prototype.scrollBy\n Element.prototype.scrollBy = function() {\n var arg0 = arguments[0];\n\n if (typeof arg0 === 'object') {\n this.scroll({\n left: arg0.left + this.scrollLeft,\n top: arg0.top + this.scrollTop,\n behavior: arg0.behavior\n });\n } else {\n this.scroll(\n this.scrollLeft + arg0,\n this.scrollTop + arguments[1]\n );\n }\n };\n\n // Element.prototype.scrollIntoView\n Element.prototype.scrollIntoView = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.scrollIntoView.call(\n this,\n arguments[0] === undefined ? true : arguments[0]\n );\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n var scrollableParent = findScrollableParent(this);\n var parentRects = scrollableParent.getBoundingClientRect();\n var clientRects = this.getBoundingClientRect();\n\n if (scrollableParent !== d.body) {\n // reveal element inside parent\n smoothScroll.call(\n this,\n scrollableParent,\n scrollableParent.scrollLeft + clientRects.left - parentRects.left,\n scrollableParent.scrollTop + clientRects.top - parentRects.top\n );\n // reveal parent in viewport\n w.scrollBy({\n left: parentRects.left,\n top: parentRects.top,\n behavior: 'smooth'\n });\n } else {\n // reveal element in viewport\n w.scrollBy({\n left: clientRects.left,\n top: clientRects.top,\n behavior: 'smooth'\n });\n }\n };\n }", "function polyfill() {\n // return when scrollBehavior interface is supported\n if ('scrollBehavior' in d.documentElement.style) {\n return;\n }\n\n /*\n * globals\n */\n var Element = w.HTMLElement || w.Element;\n var SCROLL_TIME = 468;\n\n /*\n * object gathering original scroll methods\n */\n var original = {\n scroll: w.scroll || w.scrollTo,\n scrollBy: w.scrollBy,\n elScroll: Element.prototype.scroll || scrollElement,\n scrollIntoView: Element.prototype.scrollIntoView\n };\n\n /*\n * define timing method\n */\n var now = w.performance && w.performance.now\n ? w.performance.now.bind(w.performance) : Date.now;\n\n /**\n * changes scroll position inside an element\n * @method scrollElement\n * @param {Number} x\n * @param {Number} y\n */\n function scrollElement(x, y) {\n this.scrollLeft = x;\n this.scrollTop = y;\n }\n\n /**\n * returns result of applying ease math function to a number\n * @method ease\n * @param {Number} k\n * @returns {Number}\n */\n function ease(k) {\n return 0.5 * (1 - Math.cos(Math.PI * k));\n }\n\n /**\n * indicates if a smooth behavior should be applied\n * @method shouldBailOut\n * @param {Number|Object} x\n * @returns {Boolean}\n */\n function shouldBailOut(x) {\n if (typeof x !== 'object'\n || x === null\n || x.behavior === undefined\n || x.behavior === 'auto'\n || x.behavior === 'instant') {\n // first arg not an object/null\n // or behavior is auto, instant or undefined\n return true;\n }\n\n if (typeof x === 'object'\n && x.behavior === 'smooth') {\n // first argument is an object and behavior is smooth\n return false;\n }\n\n // throw error when behavior is not supported\n throw new TypeError('behavior not valid');\n }\n\n /**\n * finds scrollable parent of an element\n * @method findScrollableParent\n * @param {Node} el\n * @returns {Node} el\n */\n function findScrollableParent(el) {\n var isBody;\n var hasScrollableSpace;\n var hasVisibleOverflow;\n\n do {\n el = el.parentNode;\n\n // set condition variables\n isBody = el === d.body;\n hasScrollableSpace =\n el.clientHeight < el.scrollHeight ||\n el.clientWidth < el.scrollWidth;\n hasVisibleOverflow =\n w.getComputedStyle(el, null).overflow === 'visible';\n } while (!isBody && !(hasScrollableSpace && !hasVisibleOverflow));\n\n isBody = hasScrollableSpace = hasVisibleOverflow = null;\n\n return el;\n }\n\n /**\n * self invoked function that, given a context, steps through scrolling\n * @method step\n * @param {Object} context\n */\n function step(context) {\n var time = now();\n var value;\n var currentX;\n var currentY;\n var elapsed = (time - context.startTime) / SCROLL_TIME;\n\n // avoid elapsed times higher than one\n elapsed = elapsed > 1 ? 1 : elapsed;\n\n // apply easing to elapsed time\n value = ease(elapsed);\n\n currentX = context.startX + (context.x - context.startX) * value;\n currentY = context.startY + (context.y - context.startY) * value;\n\n context.method.call(context.scrollable, currentX, currentY);\n\n // scroll more if we have not reached our destination\n if (currentX !== context.x || currentY !== context.y) {\n w.requestAnimationFrame(step.bind(w, context));\n }\n }\n\n /**\n * scrolls window with a smooth behavior\n * @method smoothScroll\n * @param {Object|Node} el\n * @param {Number} x\n * @param {Number} y\n */\n function smoothScroll(el, x, y) {\n var scrollable;\n var startX;\n var startY;\n var method;\n var startTime = now();\n\n // define scroll context\n if (el === d.body) {\n scrollable = w;\n startX = w.scrollX || w.pageXOffset;\n startY = w.scrollY || w.pageYOffset;\n method = original.scroll;\n } else {\n scrollable = el;\n startX = el.scrollLeft;\n startY = el.scrollTop;\n method = scrollElement;\n }\n\n // scroll looping over a frame\n step({\n scrollable: scrollable,\n method: method,\n startTime: startTime,\n startX: startX,\n startY: startY,\n x: x,\n y: y\n });\n }\n\n /*\n * ORIGINAL METHODS OVERRIDES\n */\n\n // w.scroll and w.scrollTo\n w.scroll = w.scrollTo = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.scroll.call(\n w,\n arguments[0].left || arguments[0],\n arguments[0].top || arguments[1]\n );\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n w,\n d.body,\n ~~arguments[0].left,\n ~~arguments[0].top\n );\n };\n\n // w.scrollBy\n w.scrollBy = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.scrollBy.call(\n w,\n arguments[0].left || arguments[0],\n arguments[0].top || arguments[1]\n );\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n w,\n d.body,\n ~~arguments[0].left + (w.scrollX || w.pageXOffset),\n ~~arguments[0].top + (w.scrollY || w.pageYOffset)\n );\n };\n\n // Element.prototype.scroll and Element.prototype.scrollTo\n Element.prototype.scroll = Element.prototype.scrollTo = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.elScroll.call(\n this,\n arguments[0].left || arguments[0],\n arguments[0].top || arguments[1]\n );\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n this,\n this,\n arguments[0].left,\n arguments[0].top\n );\n };\n\n // Element.prototype.scrollBy\n Element.prototype.scrollBy = function() {\n var arg0 = arguments[0];\n\n if (typeof arg0 === 'object') {\n this.scroll({\n left: arg0.left + this.scrollLeft,\n top: arg0.top + this.scrollTop,\n behavior: arg0.behavior\n });\n } else {\n this.scroll(\n this.scrollLeft + arg0,\n this.scrollTop + arguments[1]\n );\n }\n };\n\n // Element.prototype.scrollIntoView\n Element.prototype.scrollIntoView = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.scrollIntoView.call(this, arguments[0] || true);\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n var scrollableParent = findScrollableParent(this);\n var parentRects = scrollableParent.getBoundingClientRect();\n var clientRects = this.getBoundingClientRect();\n\n if (scrollableParent !== d.body) {\n // reveal element inside parent\n smoothScroll.call(\n this,\n scrollableParent,\n scrollableParent.scrollLeft + clientRects.left - parentRects.left,\n scrollableParent.scrollTop + clientRects.top - parentRects.top\n );\n // reveal parent in viewport\n w.scrollBy({\n left: parentRects.left,\n top: parentRects.top,\n behavior: 'smooth'\n });\n } else {\n // reveal element in viewport\n w.scrollBy({\n left: clientRects.left,\n top: clientRects.top,\n behavior: 'smooth'\n });\n }\n };\n }", "getNodes() {\n if (\"subtree\" in this.options) {\n return Array.from(this.target.querySelectorAll(this.options.selector));\n }\n\n return Array.from(this.target.childNodes);\n }", "function disableBodyScroll() {\r\n var doc = getDocument();\r\n if (doc && doc.body && !_bodyScrollDisabledCount) {\r\n doc.body.classList.add(DisabledScrollClassName);\r\n doc.body.addEventListener('touchmove', _disableIosBodyScroll, { passive: false, capture: false });\r\n }\r\n _bodyScrollDisabledCount++;\r\n}", "function disableBodyScroll() {\r\n var doc = getDocument();\r\n if (doc && doc.body && !_bodyScrollDisabledCount) {\r\n doc.body.classList.add(DisabledScrollClassName);\r\n doc.body.addEventListener('touchmove', _disableIosBodyScroll, { passive: false, capture: false });\r\n }\r\n _bodyScrollDisabledCount++;\r\n}", "function qsa(query) {\n return document.querySelectorAll(query);\n }", "function $qsa(q) {\n\treturn Array.from(document.querySelectorAll(q));\n}", "function polyfill() {\n // return when scrollBehavior interface is supported\n if ('scrollBehavior' in d.documentElement.style) {\n return;\n }\n\n /*\n * globals\n */\n var Element = w.HTMLElement || w.Element;\n var SCROLL_TIME = 400;\n\n /*\n * object gathering original scroll methods\n */\n var original = {\n scroll: w.scroll || w.scrollTo,\n scrollBy: w.scrollBy,\n elScroll: Element.prototype.scroll || scrollElement,\n scrollIntoView: Element.prototype.scrollIntoView\n };\n\n /**\n * changes scroll position inside an element\n * @method scrollElement\n * @param {Number} x\n * @param {Number} y\n */\n function scrollElement(x, y) {\n this.scrollLeft = x;\n this.scrollTop = y;\n }\n\n /**\n * returns result of applying ease math function to a number\n * @method ease\n * @param {Number} k\n * @returns {Number}\n */\n function ease(k) {\n return 0.5 * (1 - Math.cos(Math.PI * k));\n }\n\n /**\n * indicates if a smooth behavior should be applied\n * @method shouldBailOut\n * @param {Number|Object} x\n * @returns {Boolean}\n */\n function shouldBailOut(x) {\n if (typeof x !== 'object'\n || x === null\n || x.behavior === undefined\n || x.behavior === 'auto'\n || x.behavior === 'instant') {\n // first arg not an object/null\n // or behavior is auto, instant or undefined\n return true;\n }\n\n if (typeof x === 'object'\n && x.behavior === 'smooth') {\n // first argument is an object and behavior is smooth\n return false;\n }\n\n // throw error when behavior is not supported\n throw new TypeError('behavior not valid');\n }\n\n /**\n * finds scrollable parent of an element\n * @method findScrollableParent\n * @param {Element} el\n * @returns {Element} el\n */\n function findScrollableParent(el) {\n while (el = el.parentElement) {\n if (el === d.body || (el.clientHeight < el.scrollHeight ||\n el.clientWidth < el.scrollWidth) && w.getComputedStyle(el, null).overflow !== 'visible')\n return el;\n }\n return null;\n }\n\n /**\n * scrolls window with a smooth behavior\n * @method smoothScroll\n * @param {Object|Node} el\n * @param {Number} x\n * @param {Number} y\n */\n function smoothScroll(el, x, y) {\n if (\"msZoomTo\" in el)\n return el.msZoomTo({ contentX: x, contentY: y, viewportX: 0, viewportY: 0 });\n w.requestAnimationFrame(time => {\n var scrollable;\n var startX;\n var startY;\n var method;\n var startTime = time;\n\n // define scroll context\n if (el === d.body) {\n scrollable = w;\n startX = w.scrollX || w.pageXOffset;\n startY = w.scrollY || w.pageYOffset;\n method = original.scroll;\n } else {\n scrollable = el;\n startX = el.scrollLeft;\n startY = el.scrollTop;\n method = scrollElement;\n }\n\n // scroll looping over a frame\n w.requestAnimationFrame(function step(time) {\n var value;\n var currentX;\n var currentY;\n var elapsed = (time - startTime) / SCROLL_TIME;\n\n // avoid elapsed times higher than one\n elapsed = elapsed > 1 ? 1 : elapsed;\n\n // apply easing to elapsed time\n value = ease(elapsed);\n\n currentX = startX + (x - startX) * value;\n currentY = startY + (y - startY) * value;\n\n method.call(scrollable, currentX, currentY);\n\n // scroll more if we have not reached our destination\n if (elapsed < 1) {\n w.requestAnimationFrame(step);\n }\n });\n });\n }\n\n /*\n * ORIGINAL METHODS OVERRIDES\n */\n\n // w.scroll and w.scrollTo\n w.scroll = w.scrollTo = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.scroll.call(\n w,\n arguments[0].left || arguments[0],\n arguments[0].top || arguments[1]\n );\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n w,\n d.body,\n ~~arguments[0].left,\n ~~arguments[0].top\n );\n };\n\n // w.scrollBy\n w.scrollBy = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.scrollBy.call(\n w,\n arguments[0].left || arguments[0],\n arguments[0].top || arguments[1]\n );\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n w,\n d.body,\n ~~arguments[0].left + (w.scrollX || w.pageXOffset),\n ~~arguments[0].top + (w.scrollY || w.pageYOffset)\n );\n };\n\n // Element.prototype.scroll and Element.prototype.scrollTo\n Element.prototype.scroll = Element.prototype.scrollTo = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.elScroll.call(\n this,\n arguments[0].left || arguments[0],\n arguments[0].top || arguments[1]\n );\n return;\n }\n\n var left = arguments[0].left;\n var top = arguments[0].top;\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n this,\n this,\n typeof left === 'number' ? left : this.scrollLeft,\n typeof top === 'number' ? top : this.scrollTop\n );\n };\n\n // Element.prototype.scrollBy\n Element.prototype.scrollBy = function() {\n var arg0 = arguments[0];\n\n if (typeof arg0 === 'object') {\n this.scroll({\n left: arg0.left + this.scrollLeft,\n top: arg0.top + this.scrollTop,\n behavior: arg0.behavior\n });\n } else {\n this.scroll(\n this.scrollLeft + arg0,\n this.scrollTop + arguments[1]\n );\n }\n };\n\n // Element.prototype.scrollIntoView\n Element.prototype.scrollIntoView = function scrollIntoView(arg = undefined) {\n // avoid smooth behavior if not required\n if (shouldBailOut(arg))\n return original.scrollIntoView.apply(this, arguments);\n\n // LET THE SMOOTHNESS BEGIN!\n const { block = \"start\", inline = \"nearest\" } = arg;\n var scrollableParent = this;\n var clientRects = this.getBoundingClientRect();\n while (scrollableParent = findScrollableParent(scrollableParent)) {\n var parentRects;\n if (scrollableParent === d.body)\n parentRects = {\n width: d.documentElement.clientWidth,\n height: d.documentElement.clientHeight,\n top: 0,\n right: d.documentElement.clientWidth,\n bottom: d.documentElement.clientHeight,\n left: 0\n };\n else\n parentRects = scrollableParent.getBoundingClientRect();\n\n let left = 0, top = 0;\n switch (inline) {\n case \"start\":\n left = clientRects.left - parentRects.left;\n break;\n case \"end\":\n left = clientRects.right - parentRects.right;\n break;\n case \"center\":\n left = clientRects.left + clientRects.width / 2 - (parentRects.left + parentRects.width / 2);\n break;\n default:\n if (clientRects.left <= parentRects.left && clientRects.right >= parentRects.right)\n ;\n else if (clientRects.left < parentRects.left && clientRects.width <= parentRects.width || clientRects.right > parentRects.right && clientRects.width >= parentRects.width)\n left = clientRects.left - parentRects.left;\n else if (clientRects.left < parentRects.left && clientRects.width >= parentRects.width || clientRects.right > parentRects.right && clientRects.width <= parentRects.width)\n left = clientRects.right - parentRects.right;\n break;\n }\n switch (block) {\n case \"start\":\n top = clientRects.top - parentRects.top;\n break;\n case \"end\":\n top = clientRects.bottom - parentRects.bottom;\n break;\n case \"center\":\n top = clientRects.top + clientRects.height / 2 - (parentRects.top + parentRects.height / 2);\n break;\n default:\n if (clientRects.top <= parentRects.top && clientRects.bottom >= parentRects.bottom)\n ;\n else if (clientRects.top < parentRects.top && clientRects.height <= parentRects.height || clientRects.bottom > parentRects.bottom && clientRects.height >= parentRects.height)\n top = clientRects.top - parentRects.top;\n else if (clientRects.top < parentRects.top && clientRects.height >= parentRects.height || clientRects.bottom > parentRects.bottom && clientRects.height <= parentRects.height)\n top = clientRects.bottom - parentRects.bottom;\n break;\n }\n let clientWidth, clientHeight;\n if (scrollableParent === d.body) {\n scrollableParent = d.scrollingElement;\n clientWidth = d.documentElement.clientWidth;\n clientHeight = d.documentElement.clientHeight;\n } else {\n clientWidth = scrollableParent.clientWidth;\n clientHeight = scrollableParent.clientHeight;\n }\n const scrollLeft = scrollableParent.scrollLeft;\n const scrollTop = scrollableParent.scrollTop;\n const x = Math.max(0, Math.min(scrollLeft + left, scrollableParent.scrollWidth - clientWidth));\n const y = Math.max(0, Math.min(scrollTop + top, scrollableParent.scrollHeight - clientHeight));\n if (x == scrollLeft && y == scrollTop)\n continue;\n\n smoothScroll(scrollableParent, x, y);\n\n clientRects = {\n width: clientRects.width,\n height: clientRects.height,\n top: clientRects.top - (y - scrollTop),\n right: clientRects.right - (x - scrollLeft),\n bottom: clientRects.bottom - (y - scrollTop),\n left: clientRects.left - (x - scrollLeft)\n };\n }\n };\n }", "function disableBodyScroll() {\n var doc = (0,_dom_getDocument__WEBPACK_IMPORTED_MODULE_1__.getDocument)();\n if (doc && doc.body && !_bodyScrollDisabledCount) {\n doc.body.classList.add(DisabledScrollClassName);\n doc.body.addEventListener('touchmove', _disableIosBodyScroll, { passive: false, capture: false });\n }\n _bodyScrollDisabledCount++;\n}", "function disableBodyScroll() {\n var doc = (0,_dom_getDocument__WEBPACK_IMPORTED_MODULE_1__.getDocument)();\n if (doc && doc.body && !_bodyScrollDisabledCount) {\n doc.body.classList.add(DisabledScrollClassName);\n doc.body.addEventListener('touchmove', _disableIosBodyScroll, { passive: false, capture: false });\n }\n _bodyScrollDisabledCount++;\n}", "function select_all(node, selector){\n\treturn node.querySelectorAll(selector);\n }", "function read_dom(){\n google_eles = [\n document.getElementById('viewport'),\n document.getElementById('body'),\n document.getElementById('footer'),\n document.getElementById('fbar')\n ];\n}", "function getElementsFromHTML() {\n toRight = document.querySelectorAll(\".to-right\");\n toLeft = document.querySelectorAll(\".to-left\");\n toTop = document.querySelectorAll(\".to-top\");\n toBottom = document.querySelectorAll(\".to-bottom\");\n }", "function disableScroll() {\n window.addEventListener('DOMMouseScroll', preventDefault, false); // older FF\n window.addEventListener(wheelEvent, preventDefault, wheelOpt); // modern desktop\n window.addEventListener('touchmove', preventDefault, wheelOpt); // mobile\n window.addEventListener('keydown', preventDefaultForScrollKeys, false);\n}", "function disableScroll() {\n window.addEventListener('DOMMouseScroll', preventDefault, false); // older FF\n window.addEventListener(wheelEvent, preventDefault, wheelOpt); // modern desktop\n window.addEventListener('touchmove', preventDefault, wheelOpt); // mobile\n window.addEventListener('keydown', preventDefaultForScrollKeys, false);\n}", "function disableScroll() {\n window.addEventListener('DOMMouseScroll', preventDefault, false); // older FF\n window.addEventListener(wheelEvent, preventDefault, wheelOpt); // modern desktop\n window.addEventListener('touchmove', preventDefault, wheelOpt); // mobile\n window.addEventListener('keydown', preventDefaultForScrollKeys, false);\n}", "disable() {\n if (this._isEnabled) {\n const html = this._document.documentElement;\n const body = this._document.body;\n const htmlStyle = html.style;\n const bodyStyle = body.style;\n const previousHtmlScrollBehavior = htmlStyle.scrollBehavior || '';\n const previousBodyScrollBehavior = bodyStyle.scrollBehavior || '';\n this._isEnabled = false;\n htmlStyle.left = this._previousHTMLStyles.left;\n htmlStyle.top = this._previousHTMLStyles.top;\n html.classList.remove('cdk-global-scrollblock');\n // Disable user-defined smooth scrolling temporarily while we restore the scroll position.\n // See https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-behavior\n htmlStyle.scrollBehavior = bodyStyle.scrollBehavior = 'auto';\n window.scroll(this._previousScrollPosition.left, this._previousScrollPosition.top);\n htmlStyle.scrollBehavior = previousHtmlScrollBehavior;\n bodyStyle.scrollBehavior = previousBodyScrollBehavior;\n }\n }", "requestUpdateScroll() {\n requestAnimationFrame(function() {\n const scrollableElements =\n this.shadowRoot.querySelectorAll('[scrollable]');\n for (let i = 0; i < scrollableElements.length; i++) {\n this.updateScroll_(/** @type {!HTMLElement} */ (scrollableElements[i]));\n }\n }.bind(this));\n }", "function disableScroll() {\n window.addEventListener('DOMMouseScroll', preventDefault, false); // older FF\n window.addEventListener(wheelEvent, preventDefault, wheelOpt); // modern desktop\n window.addEventListener('touchmove', preventDefault, wheelOpt); // mobile\n window.addEventListener('keydown', preventDefaultForScrollKeys, false);\n}", "findElements(host, query, all = false) {\r\n if (all) {\r\n return host.querySelectorAll(query).length ? host.querySelectorAll(query) :\r\n host.querySelectorAll(query).length ? host.querySelectorAll(query) : undefined;\r\n }\r\n return host && host.querySelector(query) ? host.querySelector(query) : host && host && host.querySelector(query);\r\n }", "function resetMobileScroll(element) {\n $(element).css('-webkit-overflow-scrolling', 'inherit');\n setTimeout(function () {\n $(element).css('-webkit-overflow-scrolling', 'touch');\n });\n}", "function selectAll(selector, parent = document) {\n if (typeof selector === 'string') {\n return Array.from(parent.querySelectorAll(selector));\n } else if (selector instanceof Element) {\n return [selector];\n } else if (selector instanceof NodeList) {\n return Array.from(selector);\n } else if (selector instanceof Array) {\n return selector;\n }\n return [];\n }", "_querySelectorAll(selector) {\n var _a, _b;\n if (!((_a = this === null || this === void 0 ? void 0 : this.rootNode) === null || _a === void 0 ? void 0 : _a.length)) {\n return this;\n }\n let nodes = [];\n for (let cnt = 0; cnt < this.rootNode.length; cnt++) {\n if (!((_b = this.rootNode[cnt]) === null || _b === void 0 ? void 0 : _b.querySelectorAll)) {\n continue;\n }\n let res = this.rootNode[cnt].querySelectorAll(selector);\n nodes = nodes.concat(...objToArray(res));\n }\n return new DomQuery(...nodes);\n }", "_querySelectorAll(selector) {\n var _a, _b;\n if (!((_a = this === null || this === void 0 ? void 0 : this.rootNode) === null || _a === void 0 ? void 0 : _a.length)) {\n return this;\n }\n let nodes = [];\n for (let cnt = 0; cnt < this.rootNode.length; cnt++) {\n if (!((_b = this.rootNode[cnt]) === null || _b === void 0 ? void 0 : _b.querySelectorAll)) {\n continue;\n }\n let res = this.rootNode[cnt].querySelectorAll(selector);\n nodes = nodes.concat(...objToArray(res));\n }\n return new DomQuery(...nodes);\n }", "getElementsBySelector(selector) {\n const ele = this.element ? this.element : this.element;\n return ele.querySelectorAll(`.${selector}`);\n }", "function iOSscroll() {\n\n\tvar stopScroll = arguments[0] || 'body';\n\tvar scrollBlock = arguments[1] || '';\n\n\tvar elemEnableScroll = searchElement(scrollBlock);\n\n// disable scroll if it out scroll element\n\tif(elemEnableScroll !== null) {\n\t\telemEnableScroll.addEventListener('touchmove', function(e){\n\t\t\tvar elemToch = e.target; // touch element\n\t\t\tif(!elemToch.closest(scrollBlock)) { // if touch element - children of scroll block\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t\te.stopPropagation();\n\t\t}, false);\n\n\t// remove effect Rubber in no-scroll window on iOS\n\t\tremoveIOSRubberEffect( elemEnableScroll );\n\t}\n\n// if modal window is open - disable scroll page\n\twindow.addEventListener('touchmove', function(e) {\n\t\tif(searchElement(stopScroll)) {\n\t\t\te.preventDefault();\n\t\t}\n\t}, false);\n\n\tfunction searchElement(identifierName) {\n\t\treturn elementSearch = identifierName ? document.querySelector(identifierName) : null;\n\t}\n\n\tfunction removeIOSRubberEffect( elemEnableScroll ) {\n\t\telemEnableScroll.addEventListener( \"touchstart\", function () {\n\t\t\tvar top = elemEnableScroll.scrollTop,\n\t\t\t\ttotalScroll = elemEnableScroll.scrollHeight,\n\t\t\t\tcurrentScroll = top + elemEnableScroll.offsetHeight;\n\t\t\tif ( top === 0 ) {\n\t\t\t\telemEnableScroll.scrollTop = 1;\n\t\t\t} else if ( currentScroll === totalScroll ) {\n\t\t\t\telemEnableScroll.scrollTop = top - 1;\n\t\t\t}\n\t\t} );\n\t}\n\n}", "domChildren() {\n return Array.from(this.children).filter(child => !child.hasAttribute(\"hidden\"));\n }", "function getMonsterMash() {\n return [].slice.call(document.querySelectorAll('[data-image-role=\"monster\"]'))\n}", "disableScrollAround() {\n let util = this;\n let $document = Ember.$(window.document);\n\n util.disableScrollAround._count = util.disableScrollAround._count || 0;\n ++util.disableScrollAround._count;\n if (util.disableScrollAround._enableScrolling) {\n return util.disableScrollAround._enableScrolling;\n }\n\n let { body } = $document.get(0);\n let restoreBody = disableBodyScroll();\n let restoreElement = disableElementScroll();\n\n return util.disableScrollAround._enableScrolling = function () {\n if (! --util.disableScrollAround._count) {\n restoreBody();\n restoreElement();\n delete util.disableScrollAround._enableScrolling;\n }\n };\n\n // Creates a virtual scrolling mask to absorb touchmove, keyboard, scrollbar clicking, and wheel events\n function disableElementScroll() {\n let zIndex = 50;\n let scrollMask = Ember.$(`<div class=\"md-scroll-mask\" style=\"z-index: ${zIndex}\">\n <div class=\"md-scroll-mask-bar\"></div>\n </div>`);\n body.appendChild(scrollMask[0]);\n\n scrollMask.on('wheel', preventDefault);\n scrollMask.on('touchmove', preventDefault);\n $document.on('keydown', disableKeyNav);\n\n return function restoreScroll() {\n scrollMask.off('wheel');\n scrollMask.off('touchmove');\n scrollMask[0].parentNode.removeChild(scrollMask[0]);\n $document.off('keydown', disableKeyNav);\n delete util.disableScrollAround._enableScrolling;\n };\n\n // Prevent keypresses from elements inside the body\n // used to stop the keypresses that could cause the page to scroll\n // (arrow keys, spacebar, tab, etc).\n function disableKeyNav() {\n // -- temporarily removed this logic, will possibly re-add at a later date\n return;\n /* if (!element[0].contains(e.target)) {\n e.preventDefault();\n e.stopImmediatePropagation();\n } */\n }\n\n function preventDefault(e) {\n e.preventDefault();\n }\n }\n\n // Converts the body to a position fixed block and translate it to the proper scroll\n // position\n function disableBodyScroll() {\n let htmlNode = body.parentNode;\n let restoreHtmlStyle = htmlNode.getAttribute('style') || '';\n let restoreBodyStyle = body.getAttribute('style') || '';\n let scrollOffset = body.scrollTop + body.parentElement.scrollTop;\n let { clientWidth } = body;\n\n if (body.scrollHeight > body.clientHeight) {\n applyStyles(body, {\n position: 'fixed',\n width: '100%',\n top: `${-scrollOffset}px`\n });\n\n applyStyles(htmlNode, {\n overflowY: 'scroll'\n });\n }\n\n if (body.clientWidth < clientWidth) {\n applyStyles(body, { overflow: 'hidden' });\n }\n\n return function restoreScroll() {\n body.setAttribute('style', restoreBodyStyle);\n htmlNode.setAttribute('style', restoreHtmlStyle);\n body.scrollTop = scrollOffset;\n };\n }\n\n function applyStyles(el, styles) {\n for (let key in styles) {\n el.style[key] = styles[key];\n }\n }\n }", "function disableScroll() {\n window.addEventListener('DOMMouseScroll', preventDefault, false); // older FF\n window.addEventListener(wheelEvent, preventDefault, wheelOpt); // modern desktop\n window.addEventListener('touchmove', preventDefault, wheelOpt); // mobile\n window.addEventListener('keydown', preventDefaultForScrollKeys, false);\n scrollDisabled = true\n}", "function disableScroll() {\n window.addEventListener('DOMMouseScroll', preventDefault, false); // older FF\n window.addEventListener(wheelEvent, preventDefault, wheelOpt); // modern desktop\n window.addEventListener('touchmove', preventDefault, wheelOpt); // mobile\n window.addEventListener('keydown', preventDefaultForScrollKeys, false);\n }", "findAll(qs) {\n if (!this.element) return false;\n return Array.from(this.element.querySelectorAll(qs)).map((e) => enrich(e));\n }", "function disableElementScroll(element){element=angular.element(element||body);var scrollMask;if(options&&options.disableScrollMask){scrollMask=element;}else{element=element[0];scrollMask=angular.element('<div class=\"md-scroll-mask\">'+' <div class=\"md-scroll-mask-bar\"></div>'+'</div>');element.appendChild(scrollMask[0]);}scrollMask.on('wheel',preventDefault);scrollMask.on('touchmove',preventDefault);return function restoreScroll(){scrollMask.off('wheel');scrollMask.off('touchmove');scrollMask[0].parentNode.removeChild(scrollMask[0]);delete $mdUtil.disableScrollAround._enableScrolling;};function preventDefault(e){e.preventDefault();}}// Converts the body to a position fixed block and translate it to the proper scroll position", "function $$(els) {\n return els instanceof NodeList ? Array.prototype.slice.call(els) :\n els instanceof HTMLElement ? [els] :\n typeof els === 'string' ? Array.prototype.slice.call(document.querySelectorAll(els)) :\n [];\n}", "queryDocument () {\n // Get currently observed elements.\n const observedElements = this._observer.takeRecords().map((entry) => {\n return entry.target\n })\n // Query document of elements to track.\n const queries = ATTRIBUTES.map((attribute) => {\n return '[' + this._options.attributePrefix + attribute + ']'\n })\n const elements = this._options.observedElement.querySelectorAll(queries.join(','))\n\n // If queried before.\n if (observedElements.length > 0) {\n // Compare previous list of elements to new elements.\n Array.prototype.forEach.call(elements, (element) => {\n // Filter elements out that are already being observer.\n if (observedElements.indexOf(element) >= 0) {\n return\n }\n\n // Add element to observer.\n this._observer.observe(element)\n })\n } else {\n // Add elements to observer.\n Array.prototype.forEach.call(elements, (element) => {\n this._observer.observe(element)\n })\n }\n\n if (process.env.NODE_ENV !== 'production') {\n console.log('OnView: queried document for elements, observered elements: ', elements)\n }\n }", "get raceRunnerToggleOFF() {return browser.element(\"//android.widget.ScrollView/android.view.ViewGroup/android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup[1]/android.view.ViewGroup/android.view.ViewGroup[1]\");}", "function imgElements() {\n\t return Array.prototype.slice.call(node.querySelectorAll('img'));\n\t }", "getTouchEvents() {\n this.touchEvents = []; // Clear the touchEvents\n Array.prototype.push.apply(this.touchEvents, this.touchEventsBuffer); // Add the buffer to the touchEvents\n this.touchEventsBuffer = []; // Clear the buffer\n return this.touchEvents;\n }", "selectable() {\n return this.dropdown_content.querySelectorAll('[data-selectable]');\n }", "function elementsFromPoint(x, y) {\n var elements = [];\n var previousPointerEvents = [];\n var current; // TODO: window.getComputedStyle should be used with inferred type (Element)\n var i;\n var d;\n //if (document === undefined) return elements;\n // get all elements via elementFromPoint, and remove them from hit-testing in order\n while ((current = document.elementFromPoint(x, y)) && elements.indexOf(current) === -1 && current != null) {\n // push the element and its current style\n elements.push(current);\n previousPointerEvents.push({\n value: current.style.getPropertyValue('pointer-events'),\n priority: current.style.getPropertyPriority('pointer-events')\n });\n // add \"pointer-events: none\", to get to the underlying element\n current.style.setProperty('pointer-events', 'none', 'important');\n }\n // restore the previous pointer-events values\n for (i = previousPointerEvents.length; d = previousPointerEvents[--i];) {\n elements[i].style.setProperty('pointer-events', d.value ? d.value : '', d.priority);\n }\n // return our results\n return elements;\n}", "function getNodesFromDom(selector) {\n const elementList = document.querySelectorAll(selector);\n const nodesArray = Array.from(elementList);\n return new DomNodeColection(nodesArray);\n}", "function queryElements(container, selector, forEachCallback, scope, range) {\n if (scope === void 0) { scope = 0 /* Body */; }\n if (!container || !selector) {\n return [];\n }\n var elements = [].slice.call(container.querySelectorAll(selector));\n if (scope != 0 /* Body */ && range) {\n elements = elements.filter(function (element) {\n return isIntersectWithNodeRange(element, range, scope == 2 /* InSelection */);\n });\n }\n if (forEachCallback) {\n elements.forEach(forEachCallback);\n }\n return elements;\n}", "function disableElementScroll(element) {\n element = angular.element(element || body);\n var scrollMask;\n if (options && options.disableScrollMask) {\n scrollMask = element;\n } else {\n element = element[0];\n scrollMask = angular.element(\n '<div class=\"md-scroll-mask\">' +\n ' <div class=\"md-scroll-mask-bar\"></div>' +\n '</div>');\n element.appendChild(scrollMask[0]);\n }\n\n scrollMask.on('wheel', preventDefault);\n scrollMask.on('touchmove', preventDefault);\n\n return function restoreScroll() {\n scrollMask.off('wheel');\n scrollMask.off('touchmove');\n scrollMask[0].parentNode.removeChild(scrollMask[0]);\n delete $mdUtil.disableScrollAround._enableScrolling;\n };\n\n function preventDefault(e) {\n e.preventDefault();\n }\n }", "filterSelector(selector) {\n let matched = [];\n this.eachElem(item => {\n if (this._mozMatchesSelector(item, selector)) {\n matched.push(item);\n }\n });\n return new DomQuery(...matched);\n }", "filterSelector(selector) {\n let matched = [];\n this.eachElem(item => {\n if (this._mozMatchesSelector(item, selector)) {\n matched.push(item);\n }\n });\n return new DomQuery(...matched);\n }", "function elementsFromPoint(x, y) {\r\n var elements = [];\r\n var previousPointerEvents = [];\r\n var current; // TODO: window.getComputedStyle should be used with inferred type (Element)\r\n var i;\r\n var d;\r\n //if (document === undefined) return elements;\r\n // get all elements via elementFromPoint, and remove them from hit-testing in order\r\n while ((current = document.elementFromPoint(x, y)) && elements.indexOf(current) === -1 && current != null) {\r\n // push the element and its current style\r\n elements.push(current);\r\n previousPointerEvents.push({\r\n value: current.style.getPropertyValue('pointer-events'),\r\n priority: current.style.getPropertyPriority('pointer-events')\r\n });\r\n // add \"pointer-events: none\", to get to the underlying element\r\n current.style.setProperty('pointer-events', 'none', 'important');\r\n }\r\n // restore the previous pointer-events values\r\n for (i = previousPointerEvents.length; d = previousPointerEvents[--i];) {\r\n elements[i].style.setProperty('pointer-events', d.value ? d.value : '', d.priority);\r\n }\r\n // return our results\r\n return elements;\r\n}" ]
[ "0.6344784", "0.6237541", "0.62322605", "0.62320954", "0.6185808", "0.6096378", "0.606944", "0.6019488", "0.5972995", "0.59676427", "0.5941434", "0.5941434", "0.5920947", "0.58979595", "0.58867496", "0.5871322", "0.5870612", "0.58666664", "0.58216816", "0.57847613", "0.5779553", "0.5779553", "0.5779553", "0.5777832", "0.57412237", "0.5718166", "0.57129854", "0.57026047", "0.5701401", "0.57013124", "0.5684365", "0.566274", "0.56526154", "0.5636495", "0.561902", "0.56049764", "0.56018966", "0.5592907", "0.55835027", "0.55835027", "0.5570753", "0.5563505", "0.55521697", "0.55482996", "0.55482996", "0.5540251", "0.5539813", "0.5537261", "0.55333424", "0.55214375", "0.55137044", "0.5504548", "0.5489035", "0.5489035", "0.5478194", "0.5478194", "0.5478194", "0.54763144", "0.5472685", "0.5472685", "0.5466185", "0.54638857", "0.5463463", "0.546036", "0.546036", "0.54545546", "0.5443421", "0.54371613", "0.54293853", "0.54293853", "0.54293853", "0.5428385", "0.5424606", "0.5422417", "0.5420313", "0.54197186", "0.5418971", "0.5404518", "0.5404518", "0.54039323", "0.5390346", "0.5382305", "0.5372989", "0.5372936", "0.53684443", "0.53680223", "0.5357231", "0.53525406", "0.53474444", "0.53432214", "0.53416574", "0.53242874", "0.5322676", "0.5322615", "0.5321785", "0.53216267", "0.5317263", "0.53059316", "0.52988046", "0.52988046", "0.5298176" ]
0.0
-1
Opens a tab $delta$ away from the current one.
function open(delta) { var num = current+delta; if (num >= element.querySelectorAll(".tabs li").length || num < 0) { return; } var menu = element.querySelector(".tabs li:nth-child("+(num+1)+")"); list(element.querySelectorAll(".tabs li")).map(function (tohide) {tohide.className = "";}) menu.className = "active"; list(element.querySelectorAll("section")).map(function (v) { v.style.marginLeft = parseFloat(v.style.marginLeft)-delta*100+"%"; v.style.opacity = 0.5; }); var id = menu.getAttribute("data-id"); document.getElementById(id).style.opacity = 1; current = num; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openInTab(selected){\r\n openEntryInNewTab(false, selected);\r\n }", "function openTab(tabName) {\n //todo\n}", "switchTab(oldTab, newTab) {\n const tabs = this.getTabs();\n var panel;\n\n newTab.focus();\n // Make the active tab focusable by the user (Tab key)\n newTab.removeAttribute('tabindex');\n // Set the selected state\n newTab.setAttribute('aria-selected', 'true');\n oldTab.removeAttribute('aria-selected');\n oldTab.setAttribute('tabindex', '-1');\n // Get the indices of the new and old tabs to find the correct\n // tab panels to show and hide\n\n var oldPosition = oldTab.id.substring(3);\n var newPosition = newTab.id.substring(3);\n this.getPanel(oldPosition).hidden = true;\n this.getPanel(newPosition).hidden = false;\n this.getPanel(oldPosition).style.display = 'none';\n this.getPanel(newPosition).style.display = 'block';\n }", "function openTabsCloseTabs() {\n tabs.openMany(URLS, SINGLE_OPENING_DELAY);\n scheduler.addFunc(closeTabs, CLOSING_PHASE_DELAY);\n }", "function go(delta) {\n\n history.go(delta);\n }", "function duplicateTabIn(aTab, aWhere, aDelta)\n{\n OpenSessionHistoryIn(aWhere, aDelta, aTab);\n}", "function openInNewTab(inp) {\n window.open(inp, 'rptTab');\n}", "function showNewAuctionTab()\r\n{\r\n\t\tvar open=getTabIndexByTitle('New Auction');\r\n\t\tif (open<0)// if the tab is not open yet\r\n\t\t{\r\n\t\t\tcreateNewTab('tabPanel','New Auction','','createAuctionTable.jsp',true);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tshowTab('tabPanel',open[1]);\r\n\t\t}\r\n\t\r\n}", "function openTab(th) {\n window.open(th.name, '_blank');\n}", "function openTab(th) {\n window.open(th.name, '_blank');\n}", "function openTab(evt, tab) {\n var i, x, tablinks;\n\tx = document.getElementsByClassName(\"beamTabs\");\n\tfor (i = 0; i < x.length; i++) {\n x[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablink\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" w3-indigo\", \"\");\n }\n evt.currentTarget.className += \" w3-indigo\";\n\tdocument.getElementById(tab).style.display = \"block\";\n\tupdateDiagramGeometry();\n}", "function newTab(url) {\n var win = window.open(url, '_blank');\n win.focus();\n}", "function upgrade_link_aioseop_menu_new_tab() {\n $('#toplevel_page_all-in-one-seo-pack-aioseop_class ul li').last().find('a').attr('target','_blank');\n }", "function switchtab(tab, offset) {\n var winid = tab.windowId;\n var tabid = tab.id;\n chrome.tabs.getAllInWindow(winid, function(tabs) {\n for (var j = 0; j < tabs.length; ++j) {\n if (tabs[j].id == tabid) {\n chrome.tabs.update(tabs[(j + tabs.length + offset) % tabs.length].id, {\n 'selected': true\n });\n break;\n }\n }\n });\n}", "openPreviousStep() {\n this.activeStep.toggleStep();\n this.removeActiveStep();\n if (this.previousStep !== null) this.previousStep.toggleStep();\n }", "function recall() {\n tabs.open({\n \"url\" : self.data.url(\"dashboard.html\"),\n });\n}", "function switchToTab(newTabNum) {\n var curTab = document.querySelector(\".features-tab\" + curTabNum);\n var newTab = document.querySelector(\".features-tab\" + newTabNum);\n\n // disable current tab and enable selected tab\n\n curTab.style.transition = \"opacity 0.5s\";\n curTab.style.opacity = 0;\n curTab.style.zIndex = 1;\n\n newTab.style.transition = \"opacity 0.2s\";\n newTab.style.opacity = 1;\n newTab.style.zIndex = 2;\n }", "function openTab() {\n tabName = createNewTab();\n createContent(tabName);\n var tab = {id: tabName}\n tabs.push(tab);\n\n // Simular o evento do click clicando na nova aba aberta\n document.querySelectorAll(\"[href='#\" + tabName + \"']\")[0].click();\n}", "function openTab(evt, pN){\r\n var i, tC, tL;\r\n tC = document.getElementsByClassName(\"tabcontent\");\r\n for (i = 0; i < tC.length; i++) {\r\n tC[i].style.display = \"none\";\r\n }\r\n tL = document.getElementsByClassName(\"tablinks\");\r\n for (i = 0; i < tL.length; i++) {\r\n tL[i].className = tL[i].className.replace(\" active\", \"\");\r\n }\r\n document.getElementById(pN).style.display = \"block\";\r\n evt.currentTarget.className += \" active\";\r\n}", "function openTab(evt, mnemonic) {\n if (document.getElementById(mnemonic).style.display == \"inline-block\") { \n close(evt,mnemonic);\n } \n else {\n open(evt,mnemonic);\n }\n \n}", "function openDiffPage() {\n var diff_url = 'diff.htm#' + btoa(getNotificationUrl(this));\n chrome.tabs.create({url: diff_url, selected: false});\n}", "function openTab(evt, TabName) {\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(TabName).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n}", "function switchTabs(newTabNum, listItems) {\n if (newTabNum !== curTabNum) {\n switchToTab(newTabNum);\n switchHighlight(newTabNum, listItems);\n\n curTabNum = newTabNum;\n }\n\n // Show new tab, hide old tab\n function switchToTab(newTabNum) {\n var curTab = document.querySelector(\".features-tab\" + curTabNum);\n var newTab = document.querySelector(\".features-tab\" + newTabNum);\n\n // disable current tab and enable selected tab\n\n curTab.style.transition = \"opacity 0.5s\";\n curTab.style.opacity = 0;\n curTab.style.zIndex = 1;\n\n newTab.style.transition = \"opacity 0.2s\";\n newTab.style.opacity = 1;\n newTab.style.zIndex = 2;\n }\n\n // Display new highlight and hide old one in the menu list\n function switchHighlight(newTabNum, listItems) {\n if (newTabNum !== curTabNum) {\n // Get current and new HL objects\n var curListItem = listItems[curTabNum-1];\n var curHL = curListItem.children[0];\n var HLWidth = window.getComputedStyle(curHL).width;\n\n var newListItem = listItems[newTabNum-1];\n var newHL = newListItem.children[0];\n\n // Apply transition effect\n curHL.style.width = 0 + \"px\";\n newHL.style.width = HLWidth;\n }\n }\n}", "function switchTab(tab) {\n\tif ($('#toyName'+currentTabNumber).val()!=='') {\n\t\tvar toyName = $('#toyName'+currentTabNumber).val();\n\t\tif (toyName.length >10) {\n\t\t\ttoyName = toyName.substring(0,10) + \"...\";\n\t\t}\n\t\t$('#tab-toy'+currentTabNumber).html('<button type=\"button\" class=\"close\" onClick=\"closeTab(event, this.parentNode.id)\">&times;</button>'\n\t\t\t+ ' <a href=\"#toy\" data-toggle=\"tab\"><strong>'+ toyName + '</strong></a>');\n\t}\n\n\tvar tabID = tab.split(\"-\")[1];\n\tcurrentTabNumber = tabID.substring(3);\n\t\t// Update tab label to toy name\n\t// Remove active state from all tab labels and assign clicked label to be new active tab\n\t$('.tab-label').attr('class', 'tab-label');\n\t$('#tab-'+tabID).attr('class', 'tab-label active');\n\t// Remove active state from all tab pages and assign clicked tab to be new active tab\n\t$('.tab-pane').attr('class', 'tab-pane');\n\t$('#content-'+tabID).attr('class', 'tab-pane active');\n\n\tcheckTabDisplay();\n}", "function nextTab() {\n if (menuIsNotOpening()) {\n var selected = $ionicTabsDelegate.selectedIndex();\n if (selected !== -1 && selected !== 0) {\n $ionicTabsDelegate.select(selected - 1);\n }\n }\n }", "function openInNewTab(url) {\n var win = window.open(url, '_blank');\n win.focus();\n }", "function openTab(evt, tabName) {\n let i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n \n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(tabName).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n}", "function startTab1() {\n document.getElementById(\"default\").click();\n}", "function openInNewTab(url) {\n var win = window.open(url, '_blank');\n win.focus();\n}", "adjust(adjustment) {\n this.prevActiveTabIndex = this.activeTabIndex;\n this.activeTabIndex = wrapInBounds(0, this.tabs.length - 1, this.activeTabIndex + adjustment);\n this.setComponent();\n }", "function openTab(evt, tabCorI) {\n // Declare all variables\n var i, tabcontent, tablinks;\n\n // Get all elements with class=\"tabcontent\" and hide them\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n\n // Get all elements with class=\"tablinks\" and remove the class \"active\"\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n\n // Show the current tab, and add an \"active\" class to the button that opened the tab\n document.getElementById(tabCorI).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n}", "function openInNewTab(url) {\nvar win = window.open(url, '_blank');\nwin.focus();\n}", "function openTab(evt, tabName) {\r\n let i, tabcontent, tablinks;\r\n tabcontent = document.getElementsByClassName(\"tabcontent\");\r\n for (i = 0; i < tabcontent.length; i++) {\r\n tabcontent[i].style.display = \"none\";\r\n }\r\n tablinks = document.getElementsByClassName(\"tablinks\");\r\n for (i = 0; i < tablinks.length; i++) {\r\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\r\n }\r\n document.getElementById(tabName).style.display = \"block\";\r\n evt.currentTarget.className += \" active\";\r\n}", "performAction() {\n const oldValue = this.activeId;\n const oldTab = oldValue !== undefined && oldValue !== null ? this.childItems.filter(i => i.newValue === oldValue)[0] : this.items[0];\n\n if (oldTab && this.activeItem) {\n oldTab.deactivate(this.activeItem.index);\n this.activeItem.activate(oldTab.index);\n }\n }", "function previousTab() {\n if (menuIsNotOpening()) {\n var selected = $ionicTabsDelegate.selectedIndex();\n if (selected !== -1) {\n $ionicTabsDelegate.select(selected + 1);\n }\n }\n }", "function openTabOrigin(tab) {\n const id = tab.id.toString();\n api.storage.local.get(id, function(result) {\n const result_stack = result[id] || [];\n if (last(result_stack)) {\n api.tabs.query({url: last(result_stack)}, function(matches) {\n if (matches.length > 0) {\n api.tabs.update(matches[0].id, {active: true});\n api.windows.update(matches[0].windowId, {focused: true});\n } else {\n const dest = last(result_stack);\n api.tabs.create({url: dest, index: tab.index}, function(newtab) {\n // We don't want to set the last tab to the one we just came\n // from (this one), instead we want to inherit the parent tab\n // stack so we can keep going all the way back.\n api.storage.local.set({[newtab.id.toString()]: result_stack.slice(0, -1)});\n });\n }\n });\n } else {\n console.log(\"Could not find origin for tab\", id);\n api.browserAction.setBadgeText({text: \"N/A\", tabId: tab.id});\n }\n });\n}", "function showMyAuctionTab()\r\n{\r\n\r\n\tvar open=getTabIndexByTitle('My Auction');\r\n\tif (open<0)// if the tab is not open yet\r\n\t{\t\r\n\t\tvar aTab= createMyAuctionTab('tabPanel','My Auction', true);\r\n\t}\r\n\telse\r\n\t{\r\n\t\tshowTab('tabPanel',open[1]);\r\n\t}\r\n}", "function openInTabs(tagId, query, event)\n {\n query= cloneQueryWithTag(query, tagId);\n BookmarkTags.BookmarkCmds.openInTabsWithEvent(query.bmArr, event);\n }", "function openInNewTab(url) {\n var win = window.open(url, '_blank');\n win.focus();\n }", "function openTab(evt, name) {\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(name).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n}", "activateClosestTab(tab) {\n let nextAvailable;\n // When the exited tab's index is higher than all available tabs,\n if (tab.index >= this.tabs.length) {\n // Activate the last tab.\n nextAvailable = this.tabs[this.tabs.length - 1];\n }\n // If that didn't work, try the following cases:\n if (!nextAvailable) {\n if (!this.tabs.find(t => t === tab)) { // When the exited tab no longer exists,\n // Replace it with a tab at the same index.\n nextAvailable = this.tabs[tab.index];\n }\n else { // Or if the exited tab still exists,\n // Go to the tab immediately to the left.\n nextAvailable = this.tabs[Math.max(tab.index - 1, 0)];\n }\n }\n // However, if the chosen tab is disabled,\n if (nextAvailable.isDisabled) {\n // Activate the closest available tab to it.\n return this.activateClosestTab(nextAvailable);\n }\n this.activeTab = nextAvailable;\n }", "function changeTab(num) {\r\n var index;\r\n if (num) {\r\n index = $(opts.indexWrap).find('li').eq(num - 1);\r\n changeTabStatus(index, true);\r\n }\r\n }", "function start(tab)\n{\n\t\n}", "function newTabLink() {\n var originalNewTab = $('#original-new-tab')[0];\n\n function openOriginalNewTab() {\n chrome.tabs.update({\n url: 'chrome-internal://newtab/'\n });\n }\n\n originalNewTab.addEventListener('click', function(){\n openOriginalNewTab();\n return false;\n });\n}", "navigateToTab(tabIndex) {\n this.props.navigator.handleDeepLink({\n link: 'tab/' + tabIndex\n });\n this.props.navigator.dismissModal({animationType: 'slide-down'});\n }", "_openToDate() {\n this._moveToToStep();\n this._open();\n }", "function opentab(num){\n\n\tvar wincur = currentWindow.id;\n\tvar wintab = found[num].windowId;\n\n\tif(wintab != wincur) {\n\n \t// switch tabs in these windows\t \n chrome.extension.getBackgroundPage().switchWindows(wintab,wincur,all,found[num].id);\n \n\n\t}\n\telse {\n\t chrome.tabs.update(Number(found[num].id), {selected: true});\n\t}\n\t\n\tif(localStorage['closechange'] !== undefined && localStorage['closechange'] == 1){\n\t window.close();\n\t}\n}", "_openFromDate() {\n this._moveToFromStep();\n this._open();\n }", "function openTab(e, tabName) {\n // Declare variables\n let i, tabcontent, btnTab;\n // Get all elements with class -tabcontent and hide them\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n\n // Get all elements with class btnTab and remove class active\n btnTab = document.getElementsByClassName(\"btn-tab\");\n for (i = 0; i < btnTab.length; i++) {\n btnTab[i].className = btnTab[i].className.replace(\" active\", \"\");\n }\n // Show the current tab and add active class to the button that opened tab\n document.getElementById(tabName).style.display = \"block\";\n e.currentTarget.className += \" active\";\n}", "function focusLastTab(tabs) {\n tabs[tabs.length - 1].focus();\n }", "viewEditorTabClick() {\n this.projectEditorTab.className = \"HVACApplication_ProjectEditorTab\";\n this.wallEditorTab.className = \"HVACApplication_WallEditorTab\";\n this.roomEditorTab.className = \"HVACApplication_RoomEditorTab\";\n this.viewEditorTab.className = \"HVACApplication_ViewEditorTab selected\";\n this.simulatorTab.className = \"HVACApplication_SimulatorTab\";\n\n if (this.currentEditor != null) {\n this.currentEditor.hide();\n this.currentEditor.getDiv().remove();\n }\n this.currentEditor = this.viewEditor;\n this.mainContentDiv.appendChild(this.currentEditor.getDiv());\n this.currentEditor.show();\n this.showFloorPicker();\n }", "function openTab(tabName) {\r\n var i, x;\r\n x = document.getElementsByClassName(\"containerTab\");\r\n for (i = 0; i < x.length; i++) {\r\n x[i].style.display = \"none\";\r\n }\r\n document.getElementById(tabName).style.display = \"block\";\r\n }", "function backt2() {\n var tabstate = JSON.parse(nsISessionStore.getTabState(tabs.getTab()));\n tabstate.index = Math.max(tabstate.index-1, 0);\n var newtabstate = JSON.stringify(tabstate);\n var newtab = gBrowser.addTab('');\n var newtab_pos = newtab._tPos;\n nsISessionStore.setTabState(tabs.getTab(newtab_pos), newtabstate);\n gBrowser.selectedTab = newtab;\n}", "function openTab(evt, tabName) {\n console.log(evt.currentTarget)\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(tabName).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n}", "function tabSwitch (newTabId, newActiveL) {\n const ct = document.getElementById(activeLink.dataset.sectionTo);\n const nt = document.getElementById(newTabId);\n\n if (ct && nt) {\n ct.classList.remove('editor-tab-active');\n nt.classList.add('editor-tab-active');\n\n if (activeLink && newActiveL) {\n activeLink.classList.remove('active');\n newActiveL.classList.add('active');\n activeLink = newActiveL;\n };\n };\n}", "function opentab(evt, punNum) {\n // Declaring variables \n var i, tabContent, tablink;\n tabContent = document.getElementsByClassName(\"tabContent\");\n for (i = 0; i < tabContent.length; i++) {\n tabContent[i].style.display = \"none\";\n }\n tablink = document.getElementsByClassName(\"tablink\");\n for (i = 0; i < tablink.length; i++) {\n tablink[i].className = tablink[i].className.replace(\"active\", \"\")\n }\n\n document.getElementById(punNum).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n}", "function openTab(tabName) {\n var i;\n var x = document.getElementsByClassName(\"tabPage\");\n for (i = 0; i < x.length; i++) {\n x[i].style.display = \"none\";\n }\n document.getElementById(tabName).style.display = \"block\";\n}", "function editTabs() {\n createAlert (\n \"Edit Tabs\",\n \"Create or Edit Section Tabs\",\n \"editTabUI\",\n \"saveEditTabs()\"\n )\n // Focus Tabs in Preview\n document.getElementById(\"previewElementFocuser\").style.display = \"inline\"\n document.getElementsByClassName(\"headerPillSelector\")[0].classList.add(\"focused\")\n}", "function openTab (builder, map) {\n\n d3_select('#tab_container').style('display', 'block')\n\n d3_select('#reaction_tab_button').style('background-color', 'lightgrey')\n d3_select('#metabolite_tab_button').style('background-color', 'lightgrey')\n d3_select('#both_tab_button').style('background-color', 'lightgrey')\n\n var tabs = document.getElementsByClassName('tab')\n\n for (var i = 0; i < tabs.length; i++) {\n tabs[i].style.display = 'none'\n }\n\n if (builder.type_of_data === 'reaction') {\n d3_select('#reaction_tab_button').style('background-color', 'white')\n update(builder, builder.map)\n } else if (builder.type_of_data === 'gene') {\n d3_select('#reaction_tab_button').style('background-color', 'white')\n update(builder, builder.map)\n } else if (builder.type_of_data === 'metabolite') {\n d3_select('#metabolite_tab_button').style('background-color', 'white')\n update(builder, builder.map)\n }\n\n}", "function tabSetter() {\n $(\"#workStage a\").attr(\"tabindex\", -1);\n $(\"#workStage .opaque a\").attr(\"tabindex\", 0);\n}", "function openTab(evt, tabName) {\n let i, x, tabLinks;\n\n x = document.querySelectorAll('.content-tab');\n for (i = 0; i < x.length; i++) x[i].style.display = \"none\";\n\n tabLinks = document.querySelectorAll('.tab');\n for (i = 0; i < x.length; i++) tabLinks[i].className = tabLinks[i].className.replace(' is-active', '');\n\n document.getElementById(tabName).style.display = \"block\";\n evt.currentTarget.className += ' is-active';\n}", "function prevTab() {\n\tvar query = {\n\t\tcurrentWindow: true,\n\t\thidden: false,\n\t};\n\tif (skiploading) query['status'] = 'complete';\n\tif (skipdiscarded) query['discarded'] = false;\n\tbrowser.tabs.query(query).then(tabs => {\n\t\tlet current = tabs.findIndex(tab => tab.active);\n\t\tlet prev = current - 1;\n\t\twhile (true) {\n\t\t\t// before the first tab?\n\t\t\tif (prev < 0) {\n\t\t\t\tif (!wrap) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\tprev = tabs.length - 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// lapped all the way around\n\t\t\tif (prev == current) return true;\n\t\t\t// skip urls\n\t\t\tif (skipurls.indexOf(tabs[prev].url) > -1) {\n\t\t\t\tprev--;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// if we get here, we have a tab to switch to\n\t\t\tbreak;\n\t\t}\n\t\tbrowser.tabs.sendMessage(tabs[prev].id, {\n\t\t\ttopic: 'scrolledToTab'\n\t\t}).catch (error => {});\n\t\tbrowser.tabs.update(tabs[prev].id, {\n\t\t\tactive: true\n\t\t});\n\t\treturn true;\n\t});\n}", "function openBackupTab() {\n chrome.tabs.create({\n url: 'backup_tab.html',\n active: true\n }, (tab) => {\n if (err(\"create backup tab\", chrome.runtime.lastError)) return;\n\n // Store the tab ID so we recognize it and close it when the user selects\n // a thumb\n chrome.storage.local.set({\"backup_id\": tab.id}, () => {\n err(\"set backup tab id\", chrome.runtime.lastError);\n });\n });\n}", "function jscoverage_selectTab(tab) {\n\t$(tab).tab('show');\n}", "function goto_brush()\n{\n\tcurrent_tab = TAB_BRUSH;\n\t__button_on( $('#button_tab_brush') );\n\t__button_off( $('#button_tab_stencil') );\n\t__button_off( $('#button_tab_sticker') );\n\t$('#tab_stencil').animate( { 'top': {{style.tabStencilY}}+tab_content_visible_height }, 300 );\n\t$('#tab_sticker').animate( { 'top': {{style.tabStickerY}}+tab_content_visible_height }, 300 );\n}", "after() {\n // try to open into the already existing tab\n openBrowser(urls.localUrlForBrowser)\n }", "function showDetailViewTab()\r\n{\r\n\r\n\tvar open=getTabIndexByTitle('View Detail');\r\n\tif (open<0)// if the tab is not open yet\r\n\t{\t\r\n\t\tvar aTab= createDetailViewTab('tabPanel','View Detail' , true);\r\n\t}\r\n\telse\r\n\t{\r\n\t\tshowTab('tabPanel',open[1]);\r\n\t}\r\n}", "function openPage(pageName, elmnt, loc) {\r\n // Hide all elements with class=\"tab-content\" by default\r\n var tabcontent, tablinks;\r\n tabcontent = document.getElementsByClassName(\"tab-content\");\r\n for (var i = 0; i < tabcontent.length; i++) {\r\n tabcontent[i].style.display = \"none\";\r\n }\r\n\r\n // Remove the background color of all tablinks/buttons\r\n tablinks = document.getElementsByClassName(\"tabl\");\r\n for (var i = 0; i < tablinks.length; i++) {\r\n tablinks[i].style.backgroundColor = \"\";\r\n tablinks[i].style.color = \"\";\r\n }\r\n\r\n // Show the desired tab content\r\n document.getElementById(pageName).style.display = \"block\";\r\n\r\n // Add the specific color to the button used to open the tab content\r\n if (elmnt) {\r\n elmnt.style.backgroundColor = \"silver\";\r\n elmnt.style.color = \"#224\";\r\n }\r\n \r\n // Scrolls (up then) down to the content\r\n document.getElementById('KFD').scrollIntoView({block: \"nearest\", inline: \"nearest\", behavior: \"smooth\"})\r\n document.getElementById(loc).scrollIntoView({block: \"center\", inline: \"nearest\", behavior: \"smooth\"})\r\n\r\n if (clicked)\r\n toggleNav();\r\n}", "function tabFocus() {\n startTime = new Date();\n // console.log('Focusing back on ' + host + ' at ' + startTime);\n}", "function openInNewTab(url) {\n const win = window.open(url, '_blank');\n win.focus();\n }", "switchTab(tab) {\n for (let a of document.querySelectorAll('article')) {\n a.setAttribute('aria-hidden', true);\n }\n\n let t = document.getElementById(`t-${tab}`);\n if (t) {\n this.activearticle = t;\n this.activearticle.removeAttribute('aria-hidden');\n }\n this.navigation.select(tab);\n\n if (history.pushState) {\n history.pushState(null, null, `#${tab}`);\n } else {\n location.hash = `#${tab}`;\n }\n window.scrollTo(0,0);\n }", "function previous() {\n $scope.$parent.$parent.$parent.$parent.$parent.$parent.activeTab.value = 0;\n }", "function focusTab(tab) {\n console.log(\"focusTab(\"+ tab.windowId +\", \" + JSON.stringify(tab) + \")\");\n chrome.windows.update(tab.windowId,{focused:true}, function(window) {\n chrome.tabs.highlight({windowId:tab.windowId, tabs:tab.index});\n\n //this is no longer a new tab\n newTabs.delete(tab.id);\n });\n}", "gotoPrevFrame() {\n this.scriptOwner.parentClip.gotoPrevFrame();\n }", "function hit()\n {\n //switches to tab\n switchTab(name, number);\n }", "function nextTab() {\n\tvar query = {\n\t\tcurrentWindow: true,\n\t\thidden: false,\n\t};\n\tif (skiploading) query['status'] = 'complete';\n\tif (skipdiscarded) query['discarded'] = false;\n\tbrowser.tabs.query(query).then(tabs => {\n\t\tlet current = tabs.findIndex(tab => tab.active);\n\t\tlet next = current + 1;\n\t\twhile (true) {\n\t\t\t// past the last tab?\n\t\t\tif (next >= tabs.length) {\n\t\t\t\tif (!wrap) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\tnext = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// lapped all the way around\n\t\t\tif (next == current) return true;\n\t\t\t// skip urls\n\t\t\tif (skipurls.indexOf(tabs[next].url) > -1) {\n\t\t\t\tnext++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// if we get here, we have a tab to switch to\n\t\t\tbreak;\n\t\t}\n\t\tbrowser.tabs.sendMessage(tabs[next].id, {\n\t\t\ttopic: 'scrolledToTab'\n\t\t}).catch (error => {});\n\t\tbrowser.tabs.update(tabs[next].id, {\n\t\t\tactive: true\n\t\t});\n\t\treturn true;\n\t});\n}", "gotoPrevFrame() {\n this.timeline.gotoPrevFrame();\n }", "function refreshCurrentTab()\n{\n jsobj.swap_tabs(XPCNativeWrapper.unwrap($(\"tabs\")).down(\".tabon\").getAttribute(\"val\"));\n}", "activatePreviousTab() {\n const current = this._currentTabBar();\n if (!current) {\n return;\n }\n const ci = current.currentIndex;\n if (ci === -1) {\n return;\n }\n if (ci > 0) {\n current.currentIndex -= 1;\n if (current.currentTitle) {\n current.currentTitle.owner.activate();\n }\n return;\n }\n if (ci === 0) {\n const prevBar = this._adjacentBar('previous');\n if (prevBar) {\n const len = prevBar.titles.length;\n prevBar.currentIndex = len - 1;\n if (prevBar.currentTitle) {\n prevBar.currentTitle.owner.activate();\n }\n }\n }\n }", "switchFocus() {\n browser.switchWindow(this.pageTitle);\n }", "function openUpdateLink(){\n extension.tabs.create({\n \"url\": \"https://addons.mozilla.org/en-US/firefox/addon/stack-counter/?src=search\"\n });\n}", "function tabs(evt, tabName) {\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(tabName).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n document.getElementById(\"defaultOpen\").click();\n}", "activatePreviousTabBar() {\n const nextBar = this._adjacentBar('previous');\n if (nextBar) {\n if (nextBar.currentTitle) {\n nextBar.currentTitle.owner.activate();\n }\n }\n }", "function onTabChange(i) {\n\t\tsetCurrentTab(i)\n\t}", "function open_new_tab(url){\n window.open(url, '_blank');\n}", "function PrevTab() {\r\r\n\t\t\r\r\n\t\t\tif ( $pause == false && $responsive == false ) {\r\r\n\t\t\t\r\r\n\t\t\t\t$pause = true;\r\r\n\t\t\t\t\r\r\n\t\t\t\tmovetab['left'] = $winWidth+'px';\r\r\n\t\t\t\t\r\r\n\t\t\t\t$curTab = $(e).find('.button-holder').find('.tab-active').attr('data-tabindex');\r\r\n\t\t\t\t$curTab = parseInt($curTab);\r\r\n\t\t\t\t\r\r\n\t\t\t\t$(e).find('.content-holder').animate(movetab, 200, 'swing',\r\r\n\t\t\t\tfunction(){\r\r\n\t\t\t\t\tclearTimeout($timer);\r\r\n\t\t\t\t\t\r\r\n\t\t\t\t\t$move=true;\r\r\n\t\t\t\t\t\r\r\n\t\t\t\t\tif ( $curTab > 0 ) {\r\r\n\t\t\t\t\t\t$newTab = $curTab-1;\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t\telse if ( $curTab == 0 ) {\r\r\n\t\t\t\t\t\t$newTab = $lastTab;\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t\t\r\r\n\t\t\t\t\t// Prepare Tab Content Position\r\r\n\t\t\t\t\t$(e).find('.content-holder').css({'left':'-'+$winWidth+'px'});\r\r\n\t\t\t\t\t\r\r\n\t\t\t\t\t// Get Tab ID\r\r\n\t\t\t\t\t$tabid = $(e).find('.button-holder').find('.tabbt').eq($newTab).attr('data-tabid');\r\r\n\t\t\t\t\t\r\r\n\t\t\t\t\t$anim = false;\r\r\n\t\t\t\t\t\r\r\n\t\t\t\t\t// Show New Tab Content\r\r\n\t\t\t\t\tShowNewTab($tabid);\r\r\n\t\t\t\t});\r\r\n\t\t\t}\r\r\n\t\t}", "focusTab(ref) {\n const domNode = ReactDOM.findDOMNode(ref); // eslint-disable-line react/no-find-dom-node\n domNode.focus();\n }", "function ChangeTabs(evt, backSymbol) {\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(backSymbol).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n}", "wallEditorTabClick() {\n this.projectEditorTab.className = \"HVACApplication_ProjectEditorTab\";\n this.wallEditorTab.className = \"HVACApplication_WallEditorTab selected\";\n this.roomEditorTab.className = \"HVACApplication_RoomEditorTab\";\n this.viewEditorTab.className = \"HVACApplication_ViewEditorTab\";\n this.simulatorTab.className = \"HVACApplication_SimulatorTab\";\n\n if (this.currentEditor != null) {\n this.currentEditor.hide();\n this.currentEditor.getDiv().remove();\n }\n this.currentEditor = this.wallEditor;\n this.mainContentDiv.appendChild(this.currentEditor.getDiv());\n this.currentEditor.show();\n this.showFloorPicker();\n }", "function newPreTab(tabName) {\n var NewTab = \"<li id=\\\"\" + tabName + \"\\\" role=\\\"presentation\\\" class=\\\"inactive tabListElement\\\"><a>\" + slashRemover(tabName) + \"</a><button id=\\\"close_\" + tabName + \"\\\" class=\\\"close closeTab\\\" type=\\\"button\\\" >&#215;</button></li>\";\n $(\"#tabList\").prepend(NewTab);\n}", "function open(selector, tab) {\n style += `${selector}`\n if (tab) { style += ' ' };\n style += ` { `;\n }", "function openTab(evt, tabName) {\n // Declare all variables\n var i, tabcontent, tablinks;\n // Get all elements with class=\"tabcontent\" and hide them\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n\n // Get all elements with class=\"tablinks\" and remove the class \"active\"\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n // Show the current tab, and add an \"active\" class to the button that opened the tab\n document.getElementById(tabName).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n\n //if Tab is not by default, call the appropriate tab\n if(tabName===\"schedule\")\n displayByDay(\"26 April\");\n if(tabName===\"Speakers\")\n displaySpeakers();\n }", "function switchToTab (id, options) {\r\n options = options || {}\r\n\r\n tabEditor.hide()\r\n\r\n tabs.setSelected(id)\r\n tabBar.setActiveTab(id)\r\n webviews.setSelected(id, {\r\n focus: options.focusWebview !== false\r\n })\r\n}", "function semTab() {\r\n\tchecatab = false;\r\n}", "openNewTab(url) {\n console.log(url)\n window.open(url, '_blank')\n }", "openLocationsInNewTab()\r\n {\r\n try\r\n {\r\n // Ignore Alt + Enter.\r\n let newFunc = gURLBar.handleCommand.toString().replace(/&&\\n.+altKey &&/, \"&&\");\r\n\r\n // Open in current tab when the uri is same.\r\n newFunc = newFunc.replace(\r\n \"!isTabEmpty(gBrowser.selectedTab);\",\r\n \"!isTabEmpty(gBrowser.selectedTab) && (encodeURI(this.value) !== gBrowser.selectedBrowser.lastURI.spec);\"\r\n );\r\n\r\n eval(\"gURLBar.handleCommand = \" + newFunc);\r\n } catch { }\r\n }", "goToTab(event, index) {\n event.preventDefault();\n let newIndex = index;\n\n if (index < 0) {\n newIndex = this.tabIds.length - 1;\n } else if (index === this.tabIds.length) {\n newIndex = 0;\n }\n const nextTabId = this.tabIds[newIndex];\n const nextRef = this.tabRefs[newIndex];\n this.updateVisibleTab(nextTabId);\n this.focusTab(this[nextRef]);\n }", "function openInfo(evt, tabName) {\n\n\t// Get all elements with class=\"tabcontent\" and hide them\n\ttabcontent = document.getElementsByClassName(\"tabcontent\");\n\tfor (i = 0; i < tabcontent.length; i++) {\n\t\ttabcontent[i].style.display = \"none\";\n\t}\n\n\t// Get all elements with class=\"tablinks\" and remove the class \"active\"\n\ttablinks = document.getElementsByClassName(\"tablinks\");\n\tfor (i = 0; i < tablinks.length; i++) {\n\t\ttablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n\t}\n\n\t// Show the current tab, and add an \"active\" class to the button that opened the tab\n\tdocument.getElementById(tabName).style.display = \"block\";\n\tevt.currentTarget.className += \" active\";\n\n}", "function openInfo(evt, tabName) {\n\n\t// Get all elements with class=\"tabcontent\" and hide them\n\ttabcontent = document.getElementsByClassName(\"tabcontent\");\n\tfor (i = 0; i < tabcontent.length; i++) {\n\t\ttabcontent[i].style.display = \"none\";\n\t}\n\n\t// Get all elements with class=\"tablinks\" and remove the class \"active\"\n\ttablinks = document.getElementsByClassName(\"tablinks\");\n\tfor (i = 0; i < tablinks.length; i++) {\n\t\ttablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n\t}\n\n\t// Show the current tab, and add an \"active\" class to the button that opened the tab\n\tdocument.getElementById(tabName).style.display = \"block\";\n\tevt.currentTarget.className += \" active\";\n\n}", "function MM_openBrWindow(theURL,winName,features) { //v1.2\nnewWin = window.open(theURL,winName,features);\nnewWin.focus()\n}" ]
[ "0.6310745", "0.6231327", "0.61822337", "0.6083347", "0.6080908", "0.60688126", "0.6011768", "0.6010892", "0.5983891", "0.5983891", "0.5978738", "0.5829404", "0.579989", "0.57867485", "0.5771583", "0.5769427", "0.5761883", "0.57603073", "0.571014", "0.57039124", "0.56973237", "0.5687281", "0.568443", "0.56746274", "0.56713563", "0.56557757", "0.56504697", "0.56489754", "0.5645666", "0.5627111", "0.56213903", "0.5621276", "0.5616774", "0.56107765", "0.5610066", "0.56083876", "0.56049937", "0.55989844", "0.55903494", "0.5588217", "0.55840665", "0.55723816", "0.5560176", "0.5550775", "0.5545603", "0.55426884", "0.55268526", "0.5513791", "0.5505948", "0.5502565", "0.54960585", "0.54959834", "0.54905915", "0.54804254", "0.54803014", "0.5475402", "0.54718107", "0.54704976", "0.54657435", "0.5456312", "0.5451132", "0.5445028", "0.5443892", "0.54374003", "0.54359496", "0.5433106", "0.5416427", "0.53960884", "0.53958845", "0.53902596", "0.5381054", "0.5379245", "0.5375018", "0.5371077", "0.5368628", "0.53659105", "0.53647953", "0.53644425", "0.5359269", "0.5339942", "0.5337704", "0.5334435", "0.5333848", "0.5333362", "0.53330386", "0.53320557", "0.53300875", "0.5325266", "0.5323345", "0.532004", "0.5317602", "0.5317008", "0.53118044", "0.531116", "0.53096884", "0.52958536", "0.5290287", "0.5288642", "0.5288642", "0.528693" ]
0.73782057
0
Gets a Date. Accepts anything that a Date() object constructor does.
function inputDate(display, recursive = true) { let input = new Date(inputString(display, persistent)); if(isNaN(input.getTime())) { if(recursive) { console.log("ERROR: Response must be a date! Please try again!"); input = inputDate(display, recursive); } else { throw "ERROR: Response must be a date!"; } } return input; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDate() {\n var date = new Date()\n return date\n}", "function newDate(x) {\n return new Date(x);\n }", "function myDate(){\r\n var date = new Date();\r\n return date;\r\n}", "function date() {\n return struct('Date', value => {\n return value instanceof Date && !isNaN(value.getTime());\n });\n}", "function date() {\n return struct('Date', value => {\n return value instanceof Date && !isNaN(value.getTime());\n });\n}", "function date() {\n // TODO: add format option?\n return {\n serializer: function(value) {\n if (value === null || value === undefined)\n return value\n invariant(value instanceof Date, \"Expected Date object\")\n return value.getTime()\n },\n deserializer: function (jsonValue, done) {\n if (jsonValue === null || jsonValue === undefined)\n return void done(null, jsonValue)\n return void done(null, new Date(jsonValue))\n }\n }\n }", "function createDate(year, month, day) {\n return new Date(year, month, day);\n}", "function getDate(date) {\n return get$1(date, \"date\");\n}", "function getDate(date) {\n return get$1(date, \"date\");\n}", "function getDate(date) {\n return get$1(date, \"date\");\n}", "function getDate(date) {\n return get$1(date, \"date\");\n}", "function getDate(date) {\n return get$1(date, \"date\");\n}", "function getDate(date) {\n return get$1(date, 'date');\n}", "function DateObj(d) {\n\tvar date = d || new Date();\n\treturn {\n\t\t\tday : date.getDate()\n\t\t, month : date.getMonth()\n\t\t,\tyear : date.getFullYear()\n\t\t,\tnow: Date.now()\n\t};\n}", "function date() {\n return new Date(year, ...arguments)\n }", "function date(){\r\n let date = new Date();\r\n return date;\r\n }", "function getDate() {\n\t\tvar ret, month, day;\n\n\t\tret = new Date();\n\n\t\tmonth = ret.getMonth();\n\n\t\tif (month.length < 2) {\n\t\t\tmonth = \"0\" + month;\n\t\t}\n\n\t\tday = ret.getDay();\n\n\t\tif (day.length < 2) {\n\t\t\tday = \"0\" + day;\n\t\t}\n\n\t\treturn ret.getFullYear() + \"-\" + month + \"-\" + day;\n\t}", "function getDate () {\n let date = new Date()\n let month = date.getMonth() + 1 <10 ? '0' + (date.getMonth() + 1): date.getMonth() + 1\n let year = date.getFullYear()\n let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()\n date = month + '/' + day + '/' + year\n return date\n}", "function CandyDate(date) {\n // if (!(this instanceof CandyDate)) {\n // return new CandyDate(date);\n // }\n if (date) {\n if (date instanceof Date) {\n this.nativeDate = date;\n }\n else if (typeof date === 'string') {\n this.nativeDate = new Date(date);\n }\n else {\n throw new Error('The input date type is not supported (\"Date\" and \"string\" is now recommended)');\n }\n }\n else {\n this.nativeDate = new Date();\n }\n }", "function getDate() {\n var now = new Date();\n var day = now.getDate();\n var month = now.getMonth() + 1;\n var year = now.getFullYear();\n\n if (month.toString().length == 1) {\n month = \"0\" + month;\n }\n if (day.toString().length == 1) {\n day = \"0\" + day;\n }\n\n var date = day + \"/\" + month + \"/\" + year;\n return date;\n}", "function createDateObjectFromString(date) {\n let tempMyDate = new myDate(date);\n return new Date(tempMyDate.year, tempMyDate.month, tempMyDate.day);\n}", "function getDate(){\n var d = new Date();\n var day = d.getDate();\n var month = d.getMonth() + 1;\n\n if (day.toString().length < 2) {\n day = '0' + day;\n }\n\n if (month.toString().length < 2) {\n month = '0' + month;\n }\n\n var date = d.getFullYear() + '-' + month + '-' + day;\n return date;\n}", "function dateWriter (year, month, day) {\n return new Date(year, month, day);\n}", "function buildDateFromDate(date){\r\n\tvar year = date.getFullYear();\r\n\tvar month = date.getMonth();\r\n\tvar day = date.getDate();\r\n\tvar hour = date.getHours();\r\n\t\t\r\n\tvar dDate = new Date(year, month, day, hour);\r\n\tvar sDate = Date.parse(dDate);\r\n\treturn sDate;\r\n}", "function buildDateFromDate(date){\r\n\tvar year = date.getFullYear();\r\n\tvar month = date.getMonth();\r\n\tvar day = date.getDate();\r\n\tvar hour = date.getHours();\r\n\t\t\r\n\tvar dDate = new Date(year, month, day, hour);\r\n\tvar sDate = Date.parse(dDate);\r\n\treturn sDate;\r\n}", "function anyToDate(value) {\n if (_utils_Type__WEBPACK_IMPORTED_MODULE_3__[\"isDate\"](value)) {\n // TODO maybe don't create a new Date ?\n return new Date(value);\n }\n else if (_utils_Type__WEBPACK_IMPORTED_MODULE_3__[\"isNumber\"](value)) {\n return new Date(value);\n }\n else {\n // Try converting to number (assuming timestamp)\n var num = Number(value);\n if (!_utils_Type__WEBPACK_IMPORTED_MODULE_3__[\"isNumber\"](num)) {\n return new Date(value);\n }\n else {\n return new Date(num);\n }\n }\n}", "function getDate() {\n var today = new Date();\n var dd = today.getDate();\n var mm = today.getMonth() + 1; //January is 0!\n var yyyy = today.getFullYear();\n\n if (dd < 10) {\n dd = '0' + dd\n }\n\n if (mm < 10) {\n mm = '0' + mm\n }\n\n today = yyyy + '-' + mm + '-' + dd;\n return today;\n}", "get date() {\n const _ = this;\n return new DateTime(new Date(_.year, _.month, _.day), _._kind);\n }", "function dateWriter(year, month, day) {\n return new Date();\n}", "function get_date() {\n var date = new Date();\n\n var year = date.getFullYear();\n\n var month = date.getMonth() + 1;\n month = (month < 10 ? \"0\" : \"\") + month;\n\n var day = date.getDate();\n day = (day < 10 ? \"0\" : \"\") + day;\n\n return year + \"-\" + month + \"-\" + day;\n}", "function date(dateValue){\n\t\treturn (arguments.length ? new Date(dateValue) : new Date()).getTime();\n\t}", "function getDate(string) {\n const [_, month, day, year] = conciseDateTime.exec(string);\n return new Date(year, month - 1, day);\n}", "function getDate(){\n\t//var d = new Date();\t\t\n\treturn d.getDate();\n}", "function fnGetDate() {\n var f = new Date();\n var fillZero = function(n) { return (\"0\" + n.toString()).slice(-2); };\n var fnDate = function() { return (fillZero(f.getDate()) +\"/\"+ fillZero(f.getMonth() + 1) +\"/\"+ f.getFullYear()); };\n var fnTime = function() { return (fillZero(f.getHours()) +\":\"+ fillZero(f.getMinutes()) +\":\"+ fillZero(f.getSeconds())); };\n var fnDateTime = function() { return fnDate() + \" \" + fnTime(); };\n return {\n date: fnDate(),\n time: fnTime(),\n dateTime: fnDateTime()\n };\n }", "function createDateObjectFromDate(date){\n let splitDate=date.split('-');\n return new Date(splitDate[0],splitDate[1]-1,splitDate[2]);\n}", "function buildDate( year, month, day, hours, minutes, seconds ) {\n\n\tif(!year) year = 0;\n\tif(!month) month = 1;\n\tif(!day) day = 1;\n\tif(!hours) hours = 0;\n\tif(!minutes) minutes = 0;\n\tif(!seconds) seconds = 0;\n\n\tvar d = new Date(year, month - 1, day, hours, minutes, seconds);\n\t\n\t_debug('created date with ' +\n\t\t(d.getYear() + 1900) +'-'+\n\t\t(d.getMonth() + 1) +'-'+\n\t\td.getDate()+' '+\n\t\td.getHours()+':'+\n\t\td.getMinutes()+':'+\n\t\td.getSeconds());\n\n\n\tif( \n\t\t(d.getYear() + 1900) == year &&\n\t\td.getMonth()\t== (month - 1) &&\n\t\td.getDate()\t\t== new Number(day) &&\n\t\td.getHours()\t== new Number(hours) &&\n\t\td.getMinutes() == new Number(minutes) &&\n\t\td.getSeconds() == new Number(seconds) ) {\n\t\treturn d;\n\t}\n\n\treturn null;\n}", "function createDate(y) {\n var M = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var d = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var h = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n var m = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;\n var s = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;\n var ms = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 0;\n var date = new Date(y, M, d, h, m, s, ms);\n\n if (y < 100 && y >= 0) {\n date.setFullYear(y);\n }\n\n return date;\n}", "function date (data) {\n return instanceStrict(data, Date) && integer(data.getTime());\n }", "function getNowDate() {\n return new Date()\n}", "function getJavaDate( dt:NotesDateTime) :Date {\r\n\tvar date:Date = null;\r\n\r\n\tif (dt != null) {\r\n\t\ttry {\r\n\t\t\tdate = dt.toJavaDate();\r\n\t\t} catch (e) {\r\n\t\t\t//do nothing\r\n\t\t} finally {\r\n\t\t\trecycleObjects(dt);\r\n\t\t}\r\n\t}\r\n\treturn date;\r\n}", "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n\n if (typeof value === 'string') {\n value = value.trim();\n var parsedNb = parseFloat(value); // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n\n if (/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n var _value$split$map = value.split('-').map(function (val) {\n return +val;\n }),\n _value$split$map2 = Object(C_Users_Abid_Loqmen_Desktop_NGforce_thesis_node_modules_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(_value$split$map, 3),\n y = _value$split$map2[0],\n m = _value$split$map2[1],\n d = _value$split$map2[2];\n\n return new Date(y, m - 1, d);\n }\n\n var match;\n\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n\n var date = new Date(value);\n\n if (!isDate(date)) {\n throw new Error(\"Unable to convert \\\"\".concat(value, \"\\\" into a date\"));\n }\n\n return date;\n}", "_setInitialDate(initialDate){\n const date = this._stringify(initialDate);\n const objectDate = new Date(date);\n return objectDate;\n }", "date() {\n let date = new Date();\n date.setTime(this.u64());\n return date;\n }", "function getDate(string) {\n let [_, month, day, year] =\n /(\\d{1,2})-(\\d{1,2})-(\\d{4})/.exec(string);\n return new Date(year, month - 1, day);\n }", "function DateUtils(value) {\n if (typeof value === 'undefined') {\n this.date = new Date();\n }\n else if (value instanceof Date) {\n this.date = value;\n }\n else {\n this.date = new Date(value);\n }\n\n this.year = this.date.getFullYear();\n this.month = this.date.getMonth() + 1;\n this.day = this.date.getDate();\n this.hour = this.date.getHours();\n this.minute = this.date.getMinutes();\n this.second = this.date.getSeconds();\n }", "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n\n if (typeof value === 'string') {\n value = value.trim();\n\n if (/^(\\d{4}(-\\d{1,2}(-\\d{1,2})?)?)$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n var _value$split$map = value.split('-').map(function (val) {\n return +val;\n }),\n _value$split$map2 = _slicedToArray(_value$split$map, 3),\n y = _value$split$map2[0],\n _value$split$map2$ = _value$split$map2[1],\n m = _value$split$map2$ === void 0 ? 1 : _value$split$map2$,\n _value$split$map2$2 = _value$split$map2[2],\n d = _value$split$map2$2 === void 0 ? 1 : _value$split$map2$2;\n\n return createDate(y, m - 1, d);\n }\n\n var parsedNb = parseFloat(value); // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n\n var match;\n\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n\n var date = new Date(value);\n\n if (!isDate(date)) {\n throw new Error(\"Unable to convert \\\"\".concat(value, \"\\\" into a date\"));\n }\n\n return date;\n }", "function createDate(date) {\n\tif (date)\n\t\treturn new Date(date);\n\telse\n\t\treturn new Date(new Date().toLocaleString(\"en-US\", { timeZone: \"America/Los_Angeles\" }));\n}", "function getDate() {\n var now = new Date();\n var year = now.getFullYear();\n var month = now.getMonth()+1;\n var day = now.getDate();\n var dateTime = day + '-' + month + \"-\" + year;\n return dateTime;\n}", "function getDate( val, format ) {\n if ( typeof val === \"string\" && format !== undefined ) {\n // try parse date from string using dataDateFormat\n return AmCharts.stringToDate( val, format );\n } else {\n // last resort: dump everything into Date constructor\n // and let browser handle it\n return new Date( val );\n }\n }", "getDate() {\n return new Date(1900 + this.year, this.month - 1);\n }", "function GetDate(cday=today.getDate())\n{\n var today = new Date();\n var day = cday;\n var month = today.getMonth() + 1;\n var year = today.getFullYear();\n tDate = day +'-'+ month +'-'+ year;\n return tDate;\n}", "function cloneDate(date) {\n return new Date(date.getTime());\n}", "function cloneDate(date) {\n return new Date(date.getTime());\n}", "function date() {\n let d = new Date()\n /* For testing purposes */\n // d.setDate(d.getDate() + 1)\n return d\n}", "function DateHelper() {}", "function getDate(from) {\n try {\n from = new Date(from);\n } catch (err) {\n from = new Date(0);\n }\n return from;\n}", "function getDate(from) {\n try {\n from = new Date(from);\n } catch (err) {\n from = new Date(0);\n }\n return from;\n}", "function makeDate(matches) {\n\tvar date = new Date(matches[1], matches[2] - 1, matches[3],\n\t\tmatches[4], matches[5], matches[6]);\n\tdate._type = (matches[7] ? 'UTC' : 'float');\n\treturn utcDate(date);\n}", "function getDay(date) {\n return get$1(date, \"day\");\n}", "function getDay(date) {\n return get$1(date, \"day\");\n}", "function getDay(date) {\n return get$1(date, \"day\");\n}", "function getDay(date) {\n return get$1(date, \"day\");\n}", "function getDay(date) {\n return get$1(date, \"day\");\n}", "function fx_Date(data)\n{\n\t//has format?\n\tif (String_IsNullOrWhiteSpace(data))\n\t{\n\t\t//use default\n\t\tdata = \"D/M/Y\";\n\t}\n\t//get current date\n\tvar theDate = new Date();\n\t//Format it\n\treturn VarManager_FormatDate(data, theDate);\n}", "function getCurrentDate() {\n\tvar d = new Date();\n\tvar year = d.getFullYear();\n\tvar month = (\"0\" + (d.getMonth() + 1)).slice(-2);\n\tvar day = (\"0\" + d.getDate()).slice(-2);\n\tvar theDate = year + month + day;\n\treturn theDate;\n}", "function $Date() {\n\t\treturn Field.apply(this, arguments);\n\t}", "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n const parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n if (/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n const [y, m, d] = value.split('-').map((val) => +val);\n return new Date(y, m - 1, d);\n }\n let match;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n const date = new Date(value);\n if (!isDate(date)) {\n throw new Error(`Unable to convert \"${value}\" into a date`);\n }\n return date;\n}", "function getDate() {\n var d = new Date();\n return d.getFullYear() + \"/\" + (d.getMonth() + 1) + \"/\" + d.getDate();\n }", "function _Date(_month, _day, _year) {\n return {\n // Integer month (0...11)\n month: parseInt(_month, 10),\n // Integer day (0...30)\n day: parseInt(_day, 10),\n // Integer year (/\\d{4}/)\n year: parseInt(_year, 10),\n \n // Returns the day of the year that a date is.\n doy: function() {\n var yd = 0;\n for(var m = 1; m < this.month; ++m)\n yd += this.daysInMonth(m, this.year);\n yd += this.day - 1;\n return yd;\n },\n \n // Returns the day of the week that a specified date is. Year\n // must be 2000 or later. Do not confuse with the destinction\n // between weekend and weekday.\n weekday: function() {\n // Works for year >= 2000\n // from http://www.gregmiller.net/astro/dow.html\n var yrnum = ((this.year % 100) / 4 + (this.year % 100)) >> 0;\n var month_conversions = [6, 2, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4];\n var daynum = this.day + yrnum + month_conversions[this.month - 1];\n if ( this.month <= 2 && this.daysInMonth(2, this.year) == 29 )\n --daynum;\n // normalize daynum to 1..7:\n daynum %= 7;\n daynum = daynum >> 0;\n // 0 = sunday, 1 = monday, 2 = tuesday, ... 6 = saturday\n if ( daynum === 0 )\n return Day.Sunday;\n else\n return daynum - 1;\n },\n \n // Walks forward to a new date a certain number of days.\n addDays: function(days) {\n for(var d = 0; d < days; ++d) {\n this.day++;\n if (this.day > this.daysInMonth(this.month, this.year)) {\n this.day = 1;\n this.month++;\n if (this.month > 12) {\n this.month = 1;\n this.year++;\n }\n }\n }\n },\n \n // Returns this date in iCal format.\n toICal: function() {\n return \"\" + this.year\n + (this.month<10?\"0\"+this.month:\"\"+this.month)\n + (this.day<10?\"0\"+this.day:\"\"+this.day);\n },\n \n // Returns a string representation of this date.\n toString: function() {\n return month_names[this.month+1] + \" \"\n + this.day + \", \" + this.year;\n },\n \n // Returns true if this date occurred before some other date.\n lessThan: function(other) {\n if ( this.year < other.year )\n return true;\n else if ( this.year > other.year )\n return false;\n // years equal\n if ( this.month < other.month )\n return true;\n else if ( this.month > other.month )\n return false;\n // months equal\n if ( this.day < other.day )\n return true;\n else if ( this.day > other.day )\n return false;\n // all equal\n return false;\n },\n \n // Returns the number of days in a month.\n daysInMonth: function(m, y) {\n switch (m) {\n case 1:\n case 3:\n case 5:\n case 7:\n case 8:\n case 10:\n case 12:\n return 31;\n case 2:\n if ( y % 4 === 0 && (y % 100 !== 0 || y % 400 === 0) )\n return 29;\n else\n return 28;\n break;\n case 4:\n case 6:\n case 9:\n case 11:\n return 30;\n }\n },\n \n // Returns the number of a month given its short name.\n // See month_names.\n month_num: function(m) {\n var lower_month = m.toLowerCase();\n for(var i = 0; i < 12; i++)\n if ( lower_month == month_names[i] )\n return i + 1;\n }\n };\n}", "getDate(): Date {\n return this.date;\n }", "function Create_Date(Month,Day,Year,Time){\r\n\tvar D_String = Month+\" \"+Day+\" \"+Year+\" \"+Time;\r\n\tvar New_Date = new Date(D_String);\r\n\treturn New_Date;\r\n}", "toNativeDate(date) {\n\t\treturn new Date(date.year, date.month - 1, date.day);\n\t}", "function constructDate(year, month, day) {\n\tconst date = {};\n\tif (year) date.year = year;\n\tif (month) date.month = month;\n\tif (day) date.day = day;\n\treturn date;\n}", "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n\n if (typeof value === 'string') {\n value = value.trim();\n\n if (/^(\\d{4}(-\\d{1,2}(-\\d{1,2})?)?)$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n const [y, m = 1, d = 1] = value.split('-').map(val => +val);\n return createDate(y, m - 1, d);\n }\n\n const parsedNb = parseFloat(value); // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n\n let match;\n\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n\n const date = new Date(value);\n\n if (!isDate(date)) {\n throw new Error(`Unable to convert \"${value}\" into a date`);\n }\n\n return date;\n}", "function createDate(yyyymmdd) {\n const [year, month, day] = parseYearMonthDate(yyyymmdd);\n return new Date(year, month - 1, day); \n }", "function getDay(date) {\n return get$1(date, 'day');\n}", "function get_date(d) {\n var date1 = new Date(d.substr(0, 4), d.substr(5, 2) - 1, d.substr(8, 2), d.substr(11, 2), d.substr(14, 2), d.substr(17, 2));\n return date1;\n }", "function generateFromDate(tDate, tTime) {\n if (!tDate) {\n return new Date(1);\n } else if (!tTime) {\n return new Date(tDate);\n } else {\n return new Date(tDate + \" \" + tTime);\n }\n}", "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n var parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n if (/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__read\"])(value.split('-').map(function (val) { return +val; }), 3), y = _a[0], m = _a[1], d = _a[2];\n return new Date(y, m - 1, d);\n }\n var match = void 0;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n var date = new Date(value);\n if (!isDate(date)) {\n throw new Error(\"Unable to convert \\\"\" + value + \"\\\" into a date\");\n }\n return date;\n}", "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n var parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n if (/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__read\"])(value.split('-').map(function (val) { return +val; }), 3), y = _a[0], m = _a[1], d = _a[2];\n return new Date(y, m - 1, d);\n }\n var match = void 0;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n var date = new Date(value);\n if (!isDate(date)) {\n throw new Error(\"Unable to convert \\\"\" + value + \"\\\" into a date\");\n }\n return date;\n}", "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n var parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n if (/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__read\"])(value.split('-').map(function (val) { return +val; }), 3), y = _a[0], m = _a[1], d = _a[2];\n return new Date(y, m - 1, d);\n }\n var match = void 0;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n var date = new Date(value);\n if (!isDate(date)) {\n throw new Error(\"Unable to convert \\\"\" + value + \"\\\" into a date\");\n }\n return date;\n}", "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n var parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n if (/^(\\d{4}-\\d{1,2}-\\d{1,2})$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n var _a = Object(tslib__WEBPACK_IMPORTED_MODULE_1__[\"__read\"])(value.split('-').map(function (val) { return +val; }), 3), y = _a[0], m = _a[1], d = _a[2];\n return new Date(y, m - 1, d);\n }\n var match = void 0;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n var date = new Date(value);\n if (!isDate(date)) {\n throw new Error(\"Unable to convert \\\"\" + value + \"\\\" into a date\");\n }\n return date;\n}", "function fechaPorDia(agno, dia) {\n\n var date = new Date(agno, 1);\n\n return new Date(date.setDate(dia));\n\n}", "function getDate(milliseconds) {\n\t\n\treturn new Date(milliseconds);\n\n}", "function copy(date) {\n return new Date(date.getTime()); // todo: check if this is ok. new Date(date) used to strip milliseconds on FF in v3\n}", "function DateUtils() {}", "expiryDate(now) {\n const millisec = this.expiryTime(now);\n if (millisec == Infinity) {\n return new Date(MAX_TIME);\n } else if (millisec == -Infinity) {\n return new Date(MIN_TIME);\n } else {\n return new Date(millisec);\n }\n }", "expiryDate(now) {\n const millisec = this.expiryTime(now);\n if (millisec == Infinity) {\n return new Date(MAX_TIME);\n } else if (millisec == -Infinity) {\n return new Date(MIN_TIME);\n } else {\n return new Date(millisec);\n }\n }", "function asDate (value) {\n if (value instanceof Date) {\n return value;\n }\n return _utils_util__WEBPACK_IMPORTED_MODULE_1__[\"msToDate\"](value * 1000);\n}", "function mockDate(date = 1546300800000 /*01/01/2019*/) {\n // const mockDate = Object.create(global.Date);\n Date.now = () => date;\n // global.Date = mockDate;\n return date;\n}", "function get_current_date(){\n var date = new Date();\n var obj_date={\n day : date.getDate(),\n month : date.getMonth()+1,\n year : date.getFullYear(),\n }\n\n return obj_date;\n}", "function mydate() {\n var today = new Date();\n var date = today.getDate();\n console.log(date);\n}", "function getDate(date, time) {\n var dateObj = new Date(date);\n var timeData = getTimeData(time);\n dateObj.setHours(timeData[0]);\n dateObj.setMinutes(timeData[1]);\n return dateObj;\n}", "getCalendarDate() {\n if (this.calendarYear) {\n return new Date(this.calendarYear, this.calendarMonth, 1);\n }\n return this.getTodaysDate();\n }", "static get since() {\n\t\t// The UTC representation of 2016-01-01\n\t\treturn new Date(Date.UTC(2016, 0, 1));\n\t}", "constructor(...args) {\n if (args.length > 0) {\n return super(...args);\n }\n\n return new Date('2020-04-30T04:00:00.000+00:00')\n }", "constructor(date = new Date()) {\n this.date = date;\n }", "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n if (/^(\\d{4}(-\\d{1,2}(-\\d{1,2})?)?)$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n const [y, m = 1, d = 1] = value.split('-').map((val) => +val);\n return createDate(y, m - 1, d);\n }\n const parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n let match;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n const date = new Date(value);\n if (!isDate(date)) {\n throw new Error(`Unable to convert \"${value}\" into a date`);\n }\n return date;\n}", "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n if (/^(\\d{4}(-\\d{1,2}(-\\d{1,2})?)?)$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n const [y, m = 1, d = 1] = value.split('-').map((val) => +val);\n return createDate(y, m - 1, d);\n }\n const parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n let match;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n const date = new Date(value);\n if (!isDate(date)) {\n throw new Error(`Unable to convert \"${value}\" into a date`);\n }\n return date;\n}", "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n if (/^(\\d{4}(-\\d{1,2}(-\\d{1,2})?)?)$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n const [y, m = 1, d = 1] = value.split('-').map((val) => +val);\n return createDate(y, m - 1, d);\n }\n const parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n let match;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n const date = new Date(value);\n if (!isDate(date)) {\n throw new Error(`Unable to convert \"${value}\" into a date`);\n }\n return date;\n}", "function toDate(value) {\n if (isDate(value)) {\n return value;\n }\n if (typeof value === 'number' && !isNaN(value)) {\n return new Date(value);\n }\n if (typeof value === 'string') {\n value = value.trim();\n if (/^(\\d{4}(-\\d{1,2}(-\\d{1,2})?)?)$/.test(value)) {\n /* For ISO Strings without time the day, month and year must be extracted from the ISO String\n before Date creation to avoid time offset and errors in the new Date.\n If we only replace '-' with ',' in the ISO String (\"2015,01,01\"), and try to create a new\n date, some browsers (e.g. IE 9) will throw an invalid Date error.\n If we leave the '-' (\"2015-01-01\") and try to create a new Date(\"2015-01-01\") the timeoffset\n is applied.\n Note: ISO months are 0 for January, 1 for February, ... */\n const [y, m = 1, d = 1] = value.split('-').map((val) => +val);\n return createDate(y, m - 1, d);\n }\n const parsedNb = parseFloat(value);\n // any string that only contains numbers, like \"1234\" but not like \"1234hello\"\n if (!isNaN(value - parsedNb)) {\n return new Date(parsedNb);\n }\n let match;\n if (match = value.match(ISO8601_DATE_REGEX)) {\n return isoStringToDate(match);\n }\n }\n const date = new Date(value);\n if (!isDate(date)) {\n throw new Error(`Unable to convert \"${value}\" into a date`);\n }\n return date;\n}" ]
[ "0.6822436", "0.6761444", "0.6503689", "0.6473593", "0.6473593", "0.63336414", "0.62518233", "0.62503606", "0.62503606", "0.62503606", "0.62503606", "0.62503606", "0.6221738", "0.6219679", "0.62018234", "0.6179714", "0.61550444", "0.60455674", "0.6036279", "0.60172725", "0.5939488", "0.5923108", "0.5922414", "0.58937585", "0.58937585", "0.5876337", "0.58535", "0.58516836", "0.5796129", "0.5775615", "0.57646483", "0.5760151", "0.57553405", "0.5739976", "0.5735905", "0.5731886", "0.5719331", "0.5710733", "0.57003677", "0.56958246", "0.56810224", "0.56789404", "0.567882", "0.5674638", "0.5674235", "0.56688833", "0.56592613", "0.5647927", "0.5636895", "0.5619945", "0.56084645", "0.5604908", "0.5604908", "0.56018645", "0.55868375", "0.55739284", "0.55739284", "0.5538771", "0.55382925", "0.55382925", "0.55382925", "0.55382925", "0.55382925", "0.5519022", "0.55188066", "0.550532", "0.5502552", "0.5479702", "0.54780835", "0.5475768", "0.5473839", "0.54676956", "0.54650253", "0.5461467", "0.545819", "0.5446361", "0.5439471", "0.54281664", "0.5409057", "0.5409057", "0.5409057", "0.5409057", "0.5406923", "0.54039234", "0.540223", "0.54011065", "0.539226", "0.539226", "0.5376491", "0.53693455", "0.5361572", "0.5361493", "0.5356118", "0.5353278", "0.535281", "0.5351218", "0.5340539", "0.5340394", "0.5340394", "0.5340394", "0.5340394" ]
0.0
-1
Get cryptocurrency exchange rates
function fetchCryptoExchangeRates() { $.getJSON(crypto, function(data) { showCryptoExchangeRates(data); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getExchangeRate() {\n const sourceCurrency = document.querySelector('.currency_convert_from').value;\n const destinationCurrency = document.querySelector('.currency_convert_to').value;\n\n const url = buildAPIUrl(sourceCurrency, destinationCurrency);\n fetchCurrencyRate(url);\n }", "async function getCurrency() {\n const response = await fetch(urlEx);\n const data = await response.json();\n\n // Convert to USD base\n const usdRate = data.rates.USD;\n\n for (const c in data.rates) {\n data.rates[c] /= usdRate;\n }\n\n return data.rates; // Object - Each item is a currency code & its exchange rate to USD\n}", "function getAllRates(exchange) {\n return mapping[exchange].getAllRates();\t\n}", "getExchangeRates(cb) {\n $.get({\n url: 'http://api.fixer.io/latest?base=GBP',\n }, function(err, res, body) {\n if (err || !body) return cb(err || 'Something went wrong', null)\n return cb(null, body.rates)\n })\n }", "exchangeRates() {\n return this.getExchangeRatesV1()\n .catch((err) => {\n console.error(\"Error in 'exchangeRates' method of nomics module\\n\" + err);\n throw new Error(err);\n });\n }", "function getExchangeRate(c, callback) {\n api.exchangeRate({\n base: {\n currency: c.currency,\n issuer: c.issuer\n },\n counter: {\n currency: 'XRP'\n }\n }, function(err, rate) {\n if (err) {\n callback(err);\n return;\n }\n\n // cache for future reference\n exchangeRates[c.currency + '.' + c.issuer] = rate;\n\n callback(null, rate);\n });\n }", "function getConverter(getRates){\n var fx = require(\"money\");\n fx.rates = {\n \"AUD\": 1.3,\n \"USD\": 1\n }\n fx.base = \"USD\"\n fx.settings = {\n from: \"USD\",\n to: \"AUD\"\n }\n if(getRates){\n request('https://openexchangerates.org/api/latest.json?app_id=18e01813d9694849a877e30fd1db3284')\n .then(function (resp){\n var data = JSON.parse(resp)\n fx.rates = data.rates\n })\n }\n return fx\n}", "function getPrices() {\n return fetch(\n `https://min-api.cryptocompare.com/data/pricemulti?fsyms=${cryptocurrencies.join(',')}&tsyms=USD,EUR`\n ).then(res => {\n return res.json()\n })\n}", "async getRateByExchange(exchange, currency) {\n let rate;\n try {\n rate = (await ccxtExchanges[exchange].fetchTicker(`${LUNA}/${currency}`)).last;\n } catch (e) {\n rate = null;\n }\n return {\n exchange,\n currency,\n rate,\n };\n }", "function convertCurrencies(cr1, cr2) {\n let url = `https://api.exchangeratesapi.io/latest?base=${cr1}&symbols=${cr2}`;\n let xhr = new XMLHttpRequest();\n xhr.open(\n \"GET\",\n url,\n true\n );\n xhr.onload = function() {\n if(this.status == 200) {\n let result = JSON.parse(this.responseText);\n console.log(result.rates[cr2]);\n outputExchangeRate(cr1, cr2, result.rates[cr2]);\n }\n }\n xhr.send();\n}", "function loadRates() {\n return coinmarketcap.ticker(\"\", \"\").then((input) => {\n var result = {};\n input.forEach((item) => {\n result[item.symbol.replace(/[^\\w\\s]/gi, '_')] = item.percent_change_7d;\n });\n return result;\n }); \n}", "function findRate() {\n\tconst currency_one = currencyElm_1.value;\n\tconst currency_two = currencyElm_2.value;\n\n\tfetch(`https://prime.exchangerate-api.com/v5/fb727a51d43d980961319d46/latest/${currency_one}`)\n\t\t.then((res) => res.json())\n\t\t.then(\n\t\t\t(data) => {\n\t\t\t\tconst rate = data.conversion_rates[currency_two];\n\t\t\t\trateEl.innerText = `1 ${currency_one} = ${rate} ${currency_two}`;\n\t\t\t\tamountEl_2.value = (amountEl_1.value * rate).toFixed(2);\n\t\t\t},\n\t\t\tfunction(error) {\n\t\t\t\tconsole.error(error);\n\t\t\t}\n\t\t);\n\tconsole.log('yeah');\n}", "async getCurrentExchangeRate() {\n // set balance of account\n return new BigNumber(\n ethers.utils.formatUnits(await this.instance.exchangeRateStored(), this.token.decimals),\n )\n }", "function getExchangeRate(request, response){\n\tCurrency.find({countryName:{ $in: [request.query.from,request.query.to]}}, \n\t\t\t\t\t{currencyId:1, _id:0},\n\t\t\t\t\t(error, result) => {\n\t\t\t\t\t\tlet URL = URL_prefix + 'convert?q=' + result[0]['currencyId'] + '_' + result[1]['currencyId'] + ',' + result[1]['currencyId'] + '_' + result[0]['currencyId'] + '&compact=ultra&apiKey=' + APIkey;\n\t\t\t\t\t\trequest_module(URL, (req,res) => {\n\t\t\t\t\t\t\tconsole.log(res.body);\n\t\t\t\t\t\t\tresponse.json(res.body)\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t)\n}", "function calculateRates() {\n const curOne = $currencyOne.value;\n const curTwo = $currencyTwo.value;\n\n fetch(`https://api.exchangerate-api.com/v4/latest/${curOne}`)\n .then(res => res.json())\n .then(data => {\n const rate = data.rates[curTwo];\n $rate.innerText = `1 ${curOne} = ${rate} ${curTwo}`;\n $amountTwo.value = ($amountOne.value * rate).toFixed(2);\n });\n}", "getCurrencies() {\n return Api().get('/currencies');\n }", "function calculateConvertedCurrency() {\n\tlet fromCurr = currFrom.value;\n\tlet toCurr = currTo.value;\n\t\n\tfetch(`https://api.exchangerate-api.com/v4/latest/${fromCurr}`)\n\t\t.then(res => res.json())\n\t\t.then(res => {\n\t\tconst rate = res.rates[toCurr];\n perRate.innerText = `1 ${fromCurr} = ${rate} ${toCurr}`;\n let ans=(amountfrom.value * rate);\n\t\tamountTo.value = ans.toFixed(2);\n\t})\n}", "function updateExchangeRates() {\n var currencies = [];\n var hasNegative = false;\n for (var cur in $scope.balances) {if ($scope.balances.hasOwnProperty(cur)){\n var components = $scope.balances[cur].components;\n for (var issuer in components) {if (components.hasOwnProperty(issuer)){\n // While we're at it, check for negative balances:\n hasNegative || (hasNegative = components[issuer].is_negative());\n currencies.push({\n currency: cur,\n issuer: issuer\n });\n }}\n }}\n $scope.hasNegative = hasNegative;\n var pairs = currencies.map(function(c){\n return {\n base:c,\n counter:{currency:'XRP'}\n };\n });\n if (pairs.length) {\n $scope.exchangeRatesNonempty = false;\n $http.post('https://api.ripplecharts.com/api/exchangeRates', {pairs: pairs, last: true})\n .success(function(response){\n for (var i = 0; i < response.length; i++) {\n var pair = response[i];\n if (pair.last > 0) { // Disregard unmarketable assets\n $scope.exchangeRates[pair.base.currency + ':' + pair.base.issuer] = pair.last;\n }\n }\n\n $scope.exchangeRatesNonempty = true;\n console.log('Exchange Rates: ', $scope.exchangeRates);\n });\n } else {\n $scope.exchangeRatesNonempty = true;\n }\n }", "async updateExchangeRates () {\n if (!this.isActive) {\n return\n }\n const contractExchangeRates = {}\n const nativeCurrency = this.currency ? this.currency.state.nativeCurrency.toLowerCase() : 'eth'\n const pairs = this._tokens.map(token => token.address).join(',')\n const query = `contract_addresses=${pairs}&vs_currencies=${nativeCurrency}`\n if (this._tokens.length > 0) {\n try {\n const response = await fetch(`https://api.coingecko.com/api/v3/simple/token_price/ethereum?${query}`)\n const prices = await response.json()\n this._tokens.forEach(token => {\n const price = prices[token.address.toLowerCase()] || prices[ethUtil.toChecksumAddress(token.address)]\n contractExchangeRates[normalizeAddress(token.address)] = price ? price[nativeCurrency] : 0\n })\n } catch (error) {\n log.warn(`MetaMask - TokenRatesController exchange rate fetch failed.`, error)\n }\n }\n this.store.putState({ contractExchangeRates })\n }", "updateExchangeRates() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.tokenList.length === 0) {\n return;\n }\n const newContractExchangeRates = {};\n const { nativeCurrency } = this.config;\n const pairs = this.tokenList.map((token) => token.address).join(',');\n const query = `contract_addresses=${pairs}&vs_currencies=${nativeCurrency.toLowerCase()}`;\n const prices = yield this.fetchExchangeRate(query);\n this.tokenList.forEach((token) => {\n const address = util_1.toChecksumHexAddress(token.address);\n const price = prices[token.address.toLowerCase()];\n newContractExchangeRates[address] = price\n ? price[nativeCurrency.toLowerCase()]\n : 0;\n });\n this.update({ contractExchangeRates: newContractExchangeRates });\n });\n }", "function getLiveETHRate() {\r\n\tvar result;\r\n\tvar request = new XMLHttpRequest();\r\n\trequest.open('GET',\r\n\t\t'https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=USD&api_key=45419ed9fb65b31861ccb009765d97bb619e9eccedc722044457d066cbfb0a8b', false)\r\n\trequest.send(null);\r\n\tresult = JSON.parse(request.responseText);\r\n\treturn result;\r\n}", "static getRate(currencyFrom, currencyTo, currencyAmount) {\n return new Promise(function(resolve, reject) {\n let request = new XMLHttpRequest();\n const url = `https://v6.exchangerate-api.com/v6/${process.env.API_KEY}/pair/${currencyFrom}/${currencyTo}/${currencyAmount}`;\n request.onload = function() {\n if (this.status === 200) {\n resolve(request.response);\n } else {\n reject(request.response);\n }\n };\n request.open(\"GET\", url, true);\n request.send();\n });\n }", "function updateExchangeRates() {\n\t var currencies = [];\n\t var hasNegative = false;\n\t for (var cur in $scope.balances) {if ($scope.balances.hasOwnProperty(cur)){\n\t var components = $scope.balances[cur].components;\n\t for (var issuer in components) {if (components.hasOwnProperty(issuer)){\n\t // While we're at it, check for negative balances:\n\t hasNegative || (hasNegative = components[issuer].is_negative());\n\t currencies.push({\n\t currency: cur,\n\t issuer: issuer\n\t });\n\t }}\n\t }}\n\t $scope.hasNegative = hasNegative;\n\t var pairs = currencies.map(function(c){\n\t return {\n\t base:c,\n\t counter:{currency:'XRP'}\n\t };\n\t });\n\t if (pairs.length) {\n\t $scope.exchangeRatesNonempty = false;\n\t $http.post('https://api.ripplecharts.com/api/exchangeRates', {pairs: pairs, last: true})\n\t .success(function(response){\n\t for (var i = 0; i < response.length; i++) {\n\t var pair = response[i];\n\t if (pair.last > 0) { // Disregard unmarketable assets\n\t $scope.exchangeRates[pair.base.currency + ':' + pair.base.issuer] = pair.last;\n\t }\n\t }\n\n\t $scope.exchangeRatesNonempty = true;\n\t console.log('Exchange Rates: ', $scope.exchangeRates);\n\t });\n\t } else {\n\t $scope.exchangeRatesNonempty = true;\n\t }\n\t }", "async function getExpectedRate() {\n\n let result = await kyberNetworkProxyContract.methods.getExpectedRate(\n addressToSell,\n addressToBuy,\n srcQuantity\n ).call()\n\n expectedRate = result.expectedRate\n slippageRate = result.slippageRate\n // Display Exchange Rate\n displayExchangeRate();\n}", "static getCurrencies() {\n return new Promise(function(resolve, reject) {\n let request = new XMLHttpRequest();\n const url = `https://v6.exchangerate-api.com/v6/${process.env.API_KEY}/latest/USD`;\n request.onload = function() {\n if (this.status === 200) {\n resolve(request.response);\n } else {\n reject(request.response);\n }\n };\n request.open(\"GET\", url, true);\n request.send();\n });\n }", "function getRates( date, callback ){\n var url = \"http://data.fixer.io/api/\" + date;\n var key = \"e7653bf55ca8eaf257d57861f747dc44\";\n var base_currency = $(\"#base_currency\").val();\n $.getJSON(url, {access_key: key, base: base_currency, symbols: currencies.join(\",\")}, (res) => {\n console.log(res);\n callback(res);\n }).fail(function(){\n $(\"#rates-error\").text('Fixer io API is down.');\n });\n }", "function getSupportedCurrencies (call, callback) {\n logger.info('Getting supported currencies...');\n _getCurrencyData((data) => {\n callback(null, {currency_codes: Object.keys(data)});\n });\n}", "function calculate() {\n const currency_one = currency_El_one.value;\n const currency_two = currency_El_two.value;\n\n fetch(`https://api.exchangerate-api.com/v4/latest/${currency_one}`)\n .then(res => res.json())\n .then(data => {\n const rate = data.rates[currency_two];\n rateEl.innerText = `1 ${currency_one} = ${rate} ${currency_two}`;\n amount_El_two.value = (amount_El_one.value*rate).toFixed(2);\n });\n}", "function getRates() {\n return fetch(ratesUrl, {\n headers: {\n 'Content-Type': 'application/json'\n }\n }).then((response) => response.json())\n .then((responseData) => {\n return responseData;\n });\n}", "function getCurrencyList(){\n let url = \"https://api.exchangeratesapi.io/latest\";\n let xhr = new XMLHttpRequest();\n xhr.open(\n \"GET\",\n url,\n true\n );\n xhr.onload = function() {\n if(this.status == 200) {\n let currency1 = document.querySelector(\".currency1\");\n let currency2 = document.querySelector(\".currency2\");\n let result = JSON.parse(this.responseText);\n let currencyList = Object.keys(result.rates);\n currencyList.push(\"EUR\");\n console.log(currencyList);\n outputCurrencyList(currencyList, currency1, \"USD\");\n outputCurrencyList(currencyList, currency2, \"JPY\");\n }\n }\n xhr.send();\n}", "getBalanceAs(currency, domains, rates) {\r\n let total = 0;\r\n this.getAllStoredCoins(false, true).forEach((coin) => {\r\n coin = typeof coin == \"string\" ? this.Coin(coin) : coin;\r\n if (domains.indexOf(coin.d) == -1) {\r\n return;\r\n }\r\n\r\n let code = coin.c;\r\n code = (code == \"BTC\") ? \"XBT\" : code;\r\n currency = (currency == \"BTC\") ? \"XBT\" : currency;\r\n\r\n if (code == currency) {\r\n total += parseFloat(coin.v);\r\n return;\r\n }\r\n total += parseFloat(coin.v) * parseFloat(rates[`${code}_${currency}`]);\r\n });\r\n return total;\r\n }", "function getRate() { \n // // possible to fetch new data before every inputPay/inputBuy count ( adds extra loading time??? ):\n\n if (results === '') {\n return;\n }\n const asArray = Object.entries(results);\n const rates = asArray.filter(coin => coin[0] === buyCoin);\n const neededTarif = Object.entries(rates[0][1]);\n const veryNeeded = neededTarif.filter(trf => trf[0] === payCoin);\n const rate = veryNeeded[0][1];\n return rate;\n }", "getAllRates() {\r\n axios.get(`https://api.exchangeratesapi.io/latest?base=${this.baseCurrency}`)\r\n .then((resp) => {\r\n this.dispatchBaseRates(resp.data.rates);\r\n })\r\n .catch((error) => console.error(error))\r\n }", "function calculate() {\n\tconst currency1 = currencyOne.value;\n\tconst currency2 = currencyTwo.value;\n\n\tconsole.log(currency1, currency2);\n\n\tfetch(`https://api.exchangerate-api.com/v4/latest/${currency1}`)\n\t\t.then(res => res.json())\n\t\t.then(data => {\n\t\t\t//console.log(data);\n\t\t\tconst rate = data.rates[currency2];\n\n\t\t\trateElement.innerText = `1 ${currency1} = ${rate} ${currency2}`;\n\n\t\t\tamountTwo.value = (amountOne.value * rate).toFixed(2);\n\t\t});\n}", "getSwapCoins(currency, amount, rates) {\r\n let promises = [];\r\n let currencies = this.config[this.config.AVAILABLE_CURRENCIES];\r\n delete currencies[currency];\r\n\r\n Object.keys(currencies).forEach((code) => {\r\n promises.push(this.Balance(code));\r\n });\r\n currency = (currency == \"BTC\") ? \"XBT\" : currency;\r\n let issuerService = null;\r\n const emailVerify = this.getSettingsVariable(this.config.EMAIL_RECOVERY);\r\n\r\n return this.issuer(\"info\", {}, null, \"GET\").then((resp) => {\r\n issuerService = resp.issuer[0];\r\n return Promise.all(promises);\r\n }).then((balances) => {\r\n let result = [];\r\n\r\n Object.keys(currencies).forEach((key, index) => {\r\n key = (key == \"BTC\") ? \"XBT\" : key;\r\n let rate = parseFloat(rates[`${key}_${currency}`]);\r\n result.push({\r\n [key]: {\r\n amount: balances[index],\r\n exchange: parseFloat(balances[index]) * rate,\r\n }\r\n });\r\n });\r\n\r\n return result.sort((a, b) => {\r\n let k1 = Object.keys(a)[0];\r\n let k2 = Object.keys(b)[0];\r\n return b[k2].exchange - a[k1].exchange;\r\n });\r\n }).then((coinList) => {\r\n let result = [];\r\n coinList.forEach((v) => {\r\n if (amount == 0) {\r\n return;\r\n }\r\n\r\n let k = Object.keys(v)[0];\r\n let rate = parseFloat(rates[`${k}_${currency}`]);\r\n\r\n if (parseFloat(v[k].exchange) - amount > 0) {\r\n const needed = amount / rate;\r\n const fee = this.getVerificationFee(needed, issuerService, emailVerify);\r\n\r\n if (fee + needed < v[k].amount) {\r\n result.push({\r\n [k]: {\r\n exchange: amount,\r\n from: needed,\r\n fee,\r\n }\r\n });\r\n amount = 0;\r\n return;\r\n }\r\n }\r\n\r\n // We need all the coins\r\n let fee = this.getVerificationFee(v[k].amount, issuerService, emailVerify);\r\n let exchange = parseFloat(rates[`${k}_${currency}`]) * (v[k].amount - fee)\r\n result.push({\r\n [k]: {\r\n exchange,\r\n from: v[k].amount,\r\n fee,\r\n }\r\n });\r\n amount = amount - exchange;\r\n });\r\n\r\n return {\r\n swapList: result,\r\n issuerService,\r\n emailVerify,\r\n };\r\n });\r\n }", "function initialize(){\n request('https://coinbase.com/api/v1/currencies/exchange_rates/', function (error, response, body) {\n if (!error && response.statusCode == 200) {\n exchange_rates = JSON.parse(body);\n }\n });\n}", "async getCurrencies() {\n let url = this.#endpoints.currencies;\n let payload = {\n accessToken: this.apiKey\n }\n let config = {\n method: \"post\",\n body: JSON.stringify(payload)\n };\n\n return this.#request(url, config)\n .then(response => {\n if (response.success) {\n return response\n } \n throw Error(response.message)\n })\n .catch(err => { throw Error(err.message) });\n }", "currencies() {\n return this.getCurrenciesV1()\n .catch((err) => {\n console.error(\"Error in 'currencies' method of nomics module\\n\" + err);\n throw new Error(err);\n });\n }", "function calculate() {\r\n /**\r\n * firstly take the value of the currency one so we put ${currency_one} after the api link\r\n * in this case preselected value is usd dollar but we can select which we want\r\n * all currency value are in id currency-one.\r\n * we convert the value in json format in res and then extract the data from it \r\n * \r\n */\r\n const currency_one = currencyEl_one.value; // take the currency value \r\n const currency_two = currencyEl_two.value;\r\n\r\n fetch('Currencies_Values.json')\r\n .then(res => res.json())\r\n .then(data => {\r\n //const rate = extract values of the currencies two from rates in api.exchange \r\n const rate = data.rates[currency_two];\r\n const rate1 = data.rates[currency_one];\r\n \r\n \r\n // rateE1 is to display the result of exchange\r\n \r\n \r\n /**\r\n * according the selected currencies the amount_two value is equal\r\n * to the value of input 1 per rate which is value is from api.exchange\r\n * tpFixed(2) means 2 numbers after the comma\r\n * \r\n */\r\n const base = 'XOF'\r\n const cfa = 5/`${rate1}`;\r\n if(currency_one === base){\r\n \r\n rateEl.innerText = `5 ${currency_one} = ${rate.toFixed(5)} ${currency_two} `;\r\n\r\n };\r\n if(currency_one !== base && currency_two=== base){ \r\n rateEl.innerText = `1 ${currency_one} = ${cfa.toFixed(3)} ${currency_two}` ;\r\n };\r\n\r\n //amountEl_two.value = ((amountEl_one.value * rate)).toFixed(2);\r\n if(currency_one === base && currency_two!== base) {\r\n amountEl_two.value = ((amountEl_one.value * rate)/5).toFixed(3); \r\n }else{\r\n amountEl_two.value = ((amountEl_one.value * cfa).toFixed(3)); \r\n };\r\n if(currency_one === base && currency_two=== base){\r\n rateEl.innerText = `5 ${currency_one} = 5 ${currency_two} `;\r\n amountEl_two.value = amountEl_one.value ; \r\n }\r\n })\r\n \r\n }", "async getCurrencies() {\n const promises = this.currencies.map(currency =>\n this.getCurrency(currency.symbol)\n );\n\n const responses = await Promise.all(promises);\n return responses.map((response, index) => {\n return response.map(entry => {\n return {\n price: entry.open.toFixed(2),\n timestamp: entry.time * 1000\n };\n });\n });\n }", "function getLocaleCurrencies(locale){var data=findLocaleData(locale);return data[17/* Currencies */];}", "function calculate() {\n const currency_one = currencyEl_one.value;\n const currency_two = currencyEl_two.value;\n\n fetch(`https://v6.exchangerate-api.com/v6/(API KEY)/${currency_one}`)\n .then(res => res.json())\n .then(data => {\n //console.log(data.conversion_rates));\n const rate = data.conversion_rates[currency_two]\n \n rateEl.innerText = `1 ${currency_one} = ${rate} ${currency_two}`;\n\n amount_currency2.value = (amount_currency1.value * rate).toFixed(2)\n }\n)}", "getCurrencyExchangeRate() {\n fetch(urlCurrency)\n .then(res => res.json())\n .then(\n (result) => {\n this.setState({\n currencyRate: result['Realtime Currency Exchange Rate']['5. Exchange Rate']\n });\n },\n (error) => {\n this.setState({\n currencyRate: 0,\n error\n });\n }\n );\n }", "function calculate(){\n const currency_1 = currency_one.value;\n const currency_2 = currency_two.value;\n\n fetch(`https://api.exchangerate-api.com/v4/latest/${currency_1}`)\n .then(res => res.json())\n .then(data => {\n // console.log(data);\n const rate = data.rates[currency_2];\n\n rateEl.innerText = `1 ${currency_1} = ${rate} ${currency_2}`\n\n amount_two.value = (amount_one.value * rate).toFixed(2);\n })\n\n \n}", "function calculate(){\n const currency_one = currencyElementOne.value;\n const currency_two = currencyElementTwo.value;\n fetch(`https://api.exchangerate-api.com/v4/latest/${currency_one}`,{\n mode: 'no-cors',\n header: {\n 'Access-Control-Allow-Origin':'*',\n }\n }).then(res => res.json())\n .then(data => {\n //console.log(data)\n const rate = data.rates(currency_two);\n console.log(rate);\n });\n console.log(currency_one,currency_two);\n\n}", "function calculate() {\n const currency_one = currencyElOne.value;\n const currency_two = currencyElTwo.value;\n\n fetch(`https://v6.exchangerate-api.com/v6/05571b97af2fc7cf2f6ca10e/latest/${currency_one}`)\n .then(res => res.json())\n .then(data => {\n const rate = data.conversion_rates[currency_two];\n rateEl.innerText = `1 ${currency_one} = ${rate} ${currency_two}`;\n\n amountElTwo.value = (amountElOne.value * rate).toFixed(2) });\n}", "function calculate() {\n /*fetch(\"assets/items.json\")\n .then(res => res.json())\n .then(data => console.log(data));*/\n\n const currency1 = currency_one.value;\n const currency2 = currency_two.value;\n\n fetch(`https://api.exchangerate-api.com/v4/latest/${currency1}`)\n .then(res => res.json())\n .then(data => {\n const rate = data.rates[currency2];\n rateEl.innerText = `1 ${currency1} = ${rate} ${currency2} `;\n amount_two.value = (amount_one.value * rate).toFixed(2);\n });\n}", "function displayExchangeRate() {\n // Calc expected Rate in ETH not Wei\n expectedRateEth = expectedRate / (10 ** 18);\n // Calcualte user Exchange rate\n expectedRateHTML.innerText = `1 ${srcSymbol} = ${expectedRateEth} ${destSymbol}`;\n // expectedRate / (10 ** 18)\n}", "function fetchCurrencyRate(url) {\n if (url === 'undefined') {\n return 'URL cannot be empty.';\n }\n\n fetch(url)\n .then(response => response.json())\n .then(myJson => {\n const inputAmount = getInput();\n const exchangeRate = Object.values(myJson);\n\n calculateExchangeRate(...exchangeRate, inputAmount);\n })\n .catch(err =>\n console.error(\n `The following error occured while getting the conversion rate. ${err}`,\n ),\n );\n }", "function exchange_rate(callback) {\r\n var path = config.version + '/exchange_rate.do';\r\n return publicMethod(path, callback);\r\n }", "exchangeMarketPrices({ nomicsCurrencyID, exchange }) {\n return this.getExchangeMarketPricesV1({ nomicsCurrencyID, exchange })\n .catch((err) => {\n console.error(\"Error in 'exchangeMarketPrices' method of nomics module\\n\" + err);\n throw new Error(err);\n });\n }", "function getExchangeRates(currency) {\n\nvar request = new XMLHttpRequest()\nvar currencySelector= document.getElementById(\"currency\");\nvar currency=currencySelector.options[currencySelector.selectedIndex].value;\n\nif (currency === \"initial\") {\n\treturn;\n}\nrequest.open('GET', 'https://api.exchangeratesapi.io/latest?base='+currency, true)\nrequest.onload = function () {\n // Begin accessing JSON data here\n var data = JSON.parse(this.response)\n\n if (request.status >= 200 && request.status < 400) {\n var currency = document.getElementsByClassName(\"currency_rate\");\n\n for (var i=0; i <= currency.length; i++) {\n var selectedName = document.getElementById(\"nameList_\"+i).value;\n var concated = selectedName.substring(selectedName.length - 3, selectedName.length);\n\n if(data.rates[concated] === undefined){\n currency[i].innerHTML = \"Currency Unavailable\"\n } else {\n currency[i].innerHTML = data.rates[concated];\n }\n\n //for (var j = 0, j)\n //if(concated ===\n console.log(data.rates[concated]);\n }\n //for(var i = 0, i <= clone_count, i++){\n //}\n\n } else {\n console.log('error')\n alert(\"Issue fetching currency rates currently\")\n }\n}\n\nrequest.send();\n}", "function caclulate() {\n const currency_one = currencyEl_one.value;\n const currency_two = currencyEl_two.value;\n\n //https://cors-anywhere.herokuapp.com/\n fetch(`https://api.exchangerate-api.com/v4/latest/${currency_one}`)\n .then(res => res.json())\n .then(data => {\n // console.log(data);\n const rate = data.rates[currency_two];\n rateEl.innerText = `1 ${currency_one} = ${rate} ${currency_two}`;\n amountEl_two.value = (amountEl_one.value * rate).toFixed(2);\n });\n}", "function calculate() {\n const currency_one = currencyEl_one.value;\n const currency_two = currencyEl_two.value;\n\n console.log('one', currency_one, 'dos', currency_two);\n fetch(`https://v6.exchangerate-api.com/v6/APIKEy/latest/${currency_one}`)\n .then((res) => res.json())\n .then((data) => {\n const rate = data.conversion_rates[currency_two];\n console.log('🚀 ~ file: script.js ~ line 22 ~ .then ~ rate', rate);\n\n rateEl.innerText = `1 ${currency_one} = ${rate} ${currency_two}`;\n amount_two.value = (amount_one.value * rate).toFixed(2);\n });\n}", "function getRates(markets) {\n var data = {\n markets: markets,\n rates: {}\n };\n\n data.markets.forEach(function(market) {\n if (market.counter.currency === 'XRP') {\n data.rates[market.base.currency + '.' + market.base.issuer] = market.rate;\n }\n });\n\n return data;\n }", "async function getExchangeRate(market) {\n let price\n try {\n price = await getAsync(`${market}_price`)\n } catch (error) {\n logger.error(`Cannot read ${market} exchange rate from redis`, error)\n }\n\n if (!price) {\n // Cache miss?\n logger.warn(`Exchange rate for ${market} missing in Redis`)\n\n price = await fetchExchangeRate(market)\n\n if (Number.isNaN(Number(price))) {\n // API is also down, send back the fallback values\n // FALLBACK_EXCHANGE_RATE_ETH_USD and FALLBACK_EXCHANGE_RATE_DAI_USD\n return (\n process.env[`FALLBACK_EXCHANGE_RATE_${market.replace('-', '_')}`] || 310\n )\n }\n }\n\n return price\n}", "function calculate() {\n let currency1 = currencyOne.value;\n let currency2 = currencyTwo.value;\n fetch(`https://api.exchangerate-api.com/v4/latest/${currency1}`)\n .then((res) => res.json())\n .then((res) => {\n const rate = res.rates[currency2];\n amountTwo.value = (amountOne.value * rate).toFixed(2);\n currencyText.innerHTML = `1 ${currency1} = ${rate} ${currency2} `;\n });\n}", "function liveCurrencyratesConversion(transactionRecords, base = \"AUD\") {\n\n var currency;\n var currencies = [];\n var multicurrency = true;\n for (var i = 0; i < records.length; i++) {\n var invoice = records[i];\n if (i == 0) {\n currencies.push(currency);\n }\n\n else if (currencies.indexOf(invoice[\"CurrencyCode\"]) == -1) {\n currencies.push(invoice[\"CurrencyCode\"]);\n multicurrency = true;\n }\n\n }\n if (multicurrency) {\n var rates;\n $.ajax({\n \"url\": \"https://api.exchangerate-api.com/v4/latest/\" + base,\n \"method\": \"GET\",\n \"async \": false\n }).done((res) => {\n rates = res[\"rates\"];\n console.log(rates);\n });\n }\n\n\n}", "async getCryptocurrency (){\n const url = await fetch ('https://api.coinmarketcap.com/v1/ticker/');\n\n //Convert url values to JSON\n const cryptocurrency = await url.json();\n\n //return JSON values as object\n return {cryptocurrency}\n }", "function currencyConversion(euros, exchangeRate) {\n const amount = euros * (exchangeRate / 100);\n const twoDecimal = amount.toFixed(2);\n return euros + ' ' + \"euros at an exchange rate of\" + ' ' + exchangeRate + ' ' + \"is\" + ' ' + twoDecimal + ' ' + \"U.S. dollars\";\n}", "async getCurrencyAPI() {\n const url = `https://min-api.cryptocompare.com/data/all/coinlist?api_key=${this.apikey}`\n\n // Fetch to api\n const getUrlCurruency = await fetch(url)\n\n // Response in JSON\n const currencies = await getUrlCurruency.json()\n return {\n currencies\n }\n }", "function getLocaleCurrencies(locale) {\n var data = findLocaleData(locale);\n return data[17 /* Currencies */];\n}", "function getLocaleCurrencies(locale) {\n var data = findLocaleData(locale);\n return data[17 /* Currencies */];\n}", "function getLocaleCurrencies(locale) {\n var data = findLocaleData(locale);\n return data[17 /* Currencies */];\n}", "function convertCurrency(rate, ...amounts){\r\n\t\treturn amounts.map(amount => amount * rate);\r\n\t}", "function getRates() {\n\n\t\tvar url = 'https://api.fixer.io/latest';\n\t\tdom.date.textContent = 'updating';\n\n\t\t// is data in cache?\n\t\tif ('caches' in window) {\n caches.match(url).then(function(response) {\n if (response) {\n response.json().then(function cacheUpdate(json) {\n\t\t\t\t\t\tforex = json;\n\t\t\t\t\t\trefreshRates(0);\n });\n }\n });\n }\n\n\t\tvar req = new XMLHttpRequest();\n\t\treq.open('GET', url);\n\t\treq.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n\n\t\t// 30 second timeout\n\t\treq.timeout = 30000;\n\t\treq.ontimeout = function() {\n\t\t\treq.abort();\n\t\t\tgetRatesAgain(1);\n\t\t};\n\n\t\t// state change\n\t\treq.onreadystatechange = function() {\n\n\t\t\tif (req.readyState != 4) return;\n\t\t\tvar err = (req.status != 200);\n\t\t\tif (!err) {\n\t\t\t\ttry { forex = JSON.parse(req.response); }\n\t\t\t\tcatch(e) { err = true; }\n\t\t\t}\n\n\t\t\tif (err) {\n\t\t\t\t// try refresh in one hour\n\t\t\t\trefreshRates(1);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// got rates - update in six hours\n\t\t\t\trefreshRates(6);\n\t\t\t}\n\n\t\t};\n\n\t\t// start request\n\t\treq.send();\n\n\t}", "function getRates1() {\n let ret = [];\n\n let notRolled = 1;\n for (let i = 0; i < HARD_PITY; i++) {\n let rolledI = rollRate(i, true);\n ret.push(notRolled * rolledI);\n notRolled *= 1 - rolledI;\n }\n\n return ret;\n}", "async function loadCurrency() {\r\n const response = await fetch(currencyURL);\r\n const xmlTest = await response.text();\r\n const parser = new DOMParser();\r\n const currencyData = parser.parseFromString(xmlTest, \"text/xml\");\r\n // <Cube currency=\"USD\" rate=\"1.1321\" />\r\n const rates = currencyData.querySelectorAll(\"Cube[currency][rate]\");\r\n const result = Object.create(null);\r\n for (let i = 0; i < rates.length; i++) {\r\n const rateTag = rates.item(i);\r\n const rate = rateTag.getAttribute(\"rate\");\r\n const currency = rateTag.getAttribute(\"currency\");\r\n result[currency] = rate;\r\n }\r\n result[\"EUR\"] = 1;\r\n // result[\"RANDOM\"] = 1 + Math.random();\r\n return result;\r\n}", "function getTrendingCurrency() {\n let apiURL = 'https://api.coingecko.com/api/v3/search/trending'\n fetch(apiURL)\n .then(response => response.json())\n .then(data => console.log(data));\n }", "getCurrency(symbol) {\n return fetch(\n `https://min-api.cryptocompare.com/data/histominute?fsym=${symbol}&tsym=USD&limit=60`\n )\n .then(response => response.json())\n .then(json => json.Data);\n }", "function currencyConversionGenerator(exchangeRate) {\n return function(amount) {\n return amount * exchangeRate;\n };\n}", "async getExchangeCurrencyMap(excahnges, denoms) {\n const ratePromises = [];\n for (let excahngesIdx = 0; excahngesIdx < excahnges.length; excahngesIdx += 1) {\n const exchange = excahnges[excahngesIdx];\n for (let denomsIdx = 0; denomsIdx < denoms.length; denomsIdx += 1) {\n const denom = denoms[denomsIdx];\n ratePromises.push(InternalFunctions.getRateByExchange(exchange, denom));\n }\n }\n\n // pool together the promises for speedup\n const rateResults = await Promise.all(ratePromises);\n const exchangeCurrencyMap = {};\n\n for (let excahngesIdx = 0; excahngesIdx < excahnges.length; excahngesIdx += 1) {\n const exchange = excahnges[excahngesIdx];\n exchangeCurrencyMap[exchange] = {};\n }\n\n // create crypto-fiat rate matrix (mapping) for all exchanges\n for (let rateResultsIdx = 0; rateResultsIdx < rateResults.length; rateResultsIdx += 1) {\n const rateResult = rateResults[rateResultsIdx];\n exchangeCurrencyMap[rateResult.exchange][rateResult.currency] = rateResult.rate;\n }\n\n return exchangeCurrencyMap;\n }", "async function calculate () {\r\n const currency1 = select1.value;\r\n const currency2 = select2.value;\r\n\r\n const res = await fetch(`https://v6.exchangerate-api.com/v6/234fde1f86a9ac95117b1a87/latest/${currency1}`)\r\n const data = await res.json()\r\n const rates = data.conversion_rates[currency2]\r\n\r\n rate.innerText = (`1 ${currency1} = ${rates} ${currency2}`);\r\n input2.value = (input1.value * rates).toFixed(2);\r\n}", "getETHPrices (date) {\n return axios.get('https://min-api.cryptocompare.com/data/pricehistorical?fsym=ETH&tsyms=USD&ts=' + date);\n }", "function fetchCurrencies() {\n const url = \"https://free.currencyconverterapi.com/api/v5/currencies\";\n const listCurrRequest = new Request(url);\n\n if (!(\"fetch\" in window)) {\n console.log(\"Fetch API not found\");\n return;\n }\n\n return fetch(listCurrRequest)\n .then(response => {\n return respondJson(response);\n })\n .then(resJson => {\n const currencies = formatCurrencies(resJson.results);\n saveCurrencies(currencies);\n return currencies;\n })\n .catch(err => {\n console.log(err);\n });\n}", "function CalcExchangeRate() {\n var newCurr = $('#newCurrency').val();\n var oldCurr = $('#currCurrency').val();\n var exchangeRate = newCurr / oldCurr;\n\n return exchangeRate.toFixed(4);\n}", "function calculate() {\n const currencyOneCode = currOnePicker.value;\n const currencyTwoCode = currTwoPicker.value;\n \n fetch(`http://data.fixer.io/api/latest?access_key=aa9501d58a8b22906cf8423e472d9426/latest/${currencyOneCode}`)\n .then(res => res.json())\n .then( data => {\n //exchange rate \n const exchangerate = data.conversion_rates[currencyTwoCode];\n console.log(exchangeRate);\n\n rate.innerText = `1 ${currencyOneCode} = ${exchangeRate} ${currencyTwoCode}`;\n\n //Apply Conversion Rate \n currOneAmount.value = (currOneAmount.value * exchangeRate).toFixed(2);\n\n });\n }", "function scrapeCurrencies() {\n var leagues;\n connection.query( \"SELECT `LeagueName`, `poeTradeId` FROM `Leagues` WHERE `active` = '1'\", function( err, rows ) {\n if ( err ) {\n logger.log( err, scriptName, \"w\" );\n }\n leagues = rows;\n async.eachLimit( leagues, 1, function( league, leagueCb ) {\n console.log( league );\n var currency = new Currency( league.poeTradeId );\n var currencies = currency.currencies;\n async.eachLimit( currencies, 1, function( cur, currencyCb ) {\n logger.log( \"Checking currency exchange rate for '\" + cur + \"' in '\" + league.LeagueName + \"'\", scriptName );\n currency.getAllRates( cur, function( results ) {\n // console.log( results );\n connection.beginTransaction( function( err ) {\n if ( err ) {\n logger.log( err, scriptName, \"w\" );\n }\n var currencyKey = results.sell + \"_\" + results.timestamp;\n connection.query( \"INSERT INTO `Currencies` (`timestamp`, `league`, `sell`, `currencyKey`) VALUES (?, ?, ?, ?)\" , \n [results.timestamp, league.LeagueName, results.sell, currencyKey], function( err, rows ) {\n if ( err ) {\n logger.log( \"Currencies: \" + err, scriptName, \"w\" );\n }\n async.eachLimit( results.rates, 1, function( rate, rateCb ) {\n connection.query( \"INSERT INTO `CurrencyStats` (`buy`, `mean`, `median`, `mode`, `min`, `max`, `currencyKey`) VALUES (?, ?, ?, ?, ?, ?, ?)\" , [rate.buy, rate.avg, rate.median, rate.mode, rate.min, rate.max, currencyKey], function( err, rows ) {\n if ( err ) {\n logger.log( \"Currency stats: \" + err, scriptName, \"w\" );\n }\n rateCb();\n });\n }, function( err ) {\n if ( err ) {\n logger.log( err, scriptName, \"w\" );\n }\n connection.commit( function( err ) {\n if ( err ) {\n logger.log( err, scriptName, \"w\" );\n }\n // If interrupt signal received\n if ( interrupt ) {\n logger.log( \"Exiting\", scriptName );\n connection.end();\n process.exit( 0 );\n }\n currencyCb();\n });\n });\n });\n });\n });\n }, function( err ) {\n if ( err ) {\n logger.log( err, scriptName, \"e\" );\n }\n leagueCb();\n });\n }, function( err ) {\n if ( err ) {\n logger.log( err, scriptName, \"e\" );\n }\n // Schedule to run 5 min after\n setTimeout( scrapeCurrencies, refreshInterval );\n });\n });\n}", "function getOrderCurrency(entry) {\n if (!entry) return '';\n var first_currency = entry.first.currency().to_json();\n var first_issuer = entry.first.issuer().to_json();\n var second_currency = entry.second.currency().to_json();\n var second_issuer = entry.second.issuer().to_json();\n\n var first = first_currency === 'XRP'\n ? 'XRP'\n : first_currency + '.' + first_issuer;\n\n var second = second_currency === 'XRP'\n ? 'XRP'\n : second_currency + '.' + second_issuer;\n\n var currency_pair = first + '/' + second;\n return currency_pair;\n }", "function loadRates() {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', 'https://wt-fb6aae95fd4ceea28cd307ec9422fdb1-0.sandbox.auth0-extend.com/refreshRate');\n xhr.onload = function() {\n if (xhr.status === 200) {\n var temp = JSON.parse(xhr.responseText);\n // normalize the data\n for(i = 0; i < temp.length; i++) {\n var rate = temp[i];\n switch (rate.id) {\n case 3: // BRH\n allRates.brh.buy = rate.value;\n allRates.brh.sell = rate.value;\n break;\n case 4: // Buy BUH\n allRates.buh.buy = rate.value;\n break;\n case 5: // Sell BUH\n allRates.buh.sell = rate.value;\n break;\n case 6: // Buy Unibank\n allRates.unibank.buy = rate.value;\n break;\n case 7: // Sell Unibank\n allRates.unibank.sell = rate.value;\n break;\n case 8: // Buy Sogebank\n allRates.sogebank.buy = rate.value;\n break;\n case 9: // Sell Sogebank\n allRates.sogebank.sell = rate.value;\n break;\n case 12: // Buy Capital\n allRates.capital.buy = rate.value;\n break;\n case 13: // Sell Capital\n allRates.capital.sell = rate.value;\n break;\n case 14: // Buy BNC\n allRates.bnc.buy = rate.value;\n break;\n case 15: // Sell BNC\n allRates.bnc.sell = rate.value;\n break;\n case 16: // Buy BPH\n allRates.bph.buy = rate.value;\n break;\n case 17: // Sell BPH\n allRates.bph.sell = rate.value;\n break;\n }\n }\n var refreshDate = new Date();\n // Store in a local storage\n store.set({\n rates: allRates,\n refresh: refreshDate,\n });\n // recalculate the display value\n changeRate();\n calculate();\n // Manipulate the DOme\n refreshTimeElement.textContent = formatDate(refreshDate);\n loadingElement.style.opacity = 0;\n }\n else {\n loadingElement.textContent = \"Echec\";\n }\n };\n xhr.send();\n}", "function calculate() {\n const curr_one_val = curr_one.value;\n const curr_two_val = curr_two.value;\n\n fetch(`https://api.exchangerate-api.com/v4/latest/${curr_one_val}`)\n .then(res => res.json())\n .then(data => {\n //console.log(data))\n const rate = data.rates[curr_two_val];\n \n rateEle.innerText = `1 ${curr_one_val} = ${rate} ${curr_two_val}`;\n\n amount_two.value = (amount_one.value * rate).toFixed(2);\n\n\n });\n}", "async function fetchExchangeRate(market) {\n const exchangeURL = `https://api.cryptonator.com/api/ticker/${market}`\n\n return new Promise(async (resolve, reject) => {\n try {\n const response = await request.get(exchangeURL)\n if (!response.body.success) {\n reject(response.body.error)\n return\n }\n\n resolve(response.body.ticker.price)\n } catch (error) {\n reject(error)\n }\n })\n .then(price => {\n if (price) {\n redisClient.set(`${market}_price`, price, 'NX')\n logger.info(`Exchange rate for ${market} set to ${price}`)\n }\n\n return price\n })\n .catch(e => logger.error(`Error getting ${market} exchange rate:`, e))\n}", "function getRate()\r\n {\r\n return rate;\r\n }", "async getEtherPrice() {\n try {\n let provider = new ethers.providers.EtherscanProvider();\n let price = await provider.getEtherPrice();\n return {\n price\n };\n } catch (error) {\n if (error.result) {\n const { result } = JSON.parse(error.result);\n return {\n price: Number(result.ethusd)\n };\n } else {\n throw error;\n }\n }\n }", "function getData (date, baseCurr, baseAmt, convCurr) {\n const url = `https://exchangeratesapi.io/api/${date}?base=${baseCurr}`;\n baseAmt = parseFloat(baseAmt);\n\n return axios\n .get(url)\n .then(response => response.data)\n .then(apiData => {\n const results = convertCurrency(date, baseCurr, baseAmt, convCurr, apiData);\n console.log(results);\n return results;\n })\n .catch(function (error) {\n console.log('API call error', error);\n });\n}", "constructor ( exchangeRate = 0.01 ) {\n\t\tthis.baseExchangeRate = exchangeRate;\n\t\tthis.exchangeRate = exchangeRate;\n\t}", "function calculate() {\n const calculate_One = currency_One.value;\n const calculate_Two = currency_Two.value;\n\n fetch(`${API_LINK}${calculate_One}`)\n .then(res => res.json())\n .then(data => {\n // console.log(data);\n const rate = data.rates[calculate_Two];\n\n rateTotal.innerText = `1 ${calculate_One} = ${rate} ${calculate_Two}`;\n\n amount_Two.value = (amount_One.value * rate).toFixed(2);\n });\n}", "function getLocaleCurrencies(locale) {\n const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵfindLocaleData\"])(locale);\n return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵLocaleDataIndex\"].Currencies];\n}", "async function getAllPrices() {\n let tokensDetailedInfoRequest = await fetch(\n \"https://api.kyber.network/market\"\n );\n let tokensDetailedInfo = await tokensDetailedInfoRequest.json();\n return tokensDetailedInfo;\n }", "async function getPriceQuote(exchangerAddress) {\n let exchangerContract = null\n if (!exchangeUI.readonly)\n exchangerContract = eth.contract(exchangerABI, \"\", { \"from\": myAddress }).at(exchangerAddress)\n else\n exchangerContract = eth.contract(exchangerABI).at(exchangerAddress)\n\n let totalTokens = await exchangerContract.getPurchasePrice(decimalToRaw(window.baseOrderSizeInEth, 18))\n let actualTokens = rawToDecimal(totalTokens[0].toString(10), 18);\n return window.baseOrderSizeInEth / actualTokens; //If 1 eth gets you n tokens, each token is worth 1/n eth. \n}", "function printRates(rates) {\r\n var sum = 0\r\n if(rates.length === 0)\r\n return (0).toFixed(2);\r\n for (var i = 0; i<rates.length; i++) {\r\n sum += rates[i].value;\r\n }\r\n return (sum/rates.length).toFixed(2);\r\n}", "function calculate() {\n const currencyOneCode = currencyOnePicker.value;\n const currencyTwoCode = currencyTwoPicker.value;\n fetch(`https://v6.exchangerate-api.com/v6/9edf55432e8fe53827d04461/latest/${currencyOneCode}`)\n .then(res => res.json())\n .then(data => {\n // Get the exchange Rate from API Data\n const exchangeRate = data.conversion_rates[currencyTwoCode];\n // display the Conversion Rate\n rate.innerText = `1 ${currencyOneCode} = ${exchangeRate} ${currencyTwoCode}`;\n\n // Apply Conversion Rate and Update Amount of Currency Two\n currencyTwoAmount.value = (currencyOneAmount.value * exchangeRate).toFixed(2);\n\n\n });\n\n\n}", "getCoinRate(callback){\n const api_data = {\n api_name:'/get-coin-rate',\n coin:this.coin\n };\n api_call.apiGetCall(api_data,callback);\n }", "function getLocaleCurrencies(locale) {\n var data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵfindLocaleData\"])(locale);\n return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵLocaleDataIndex\"].Currencies];\n }", "exchangeRatesInterval({ startISOString, endISOString }) {\n return this.getExchangeRatesIntervalV1({ startISOString, endISOString })\n .catch((err) => {\n console.error(\"Error in 'exchangeRatesInterval' method of nomics module\\n\" + err);\n throw new Error(err);\n });\n }", "function getLocaleCurrencies(locale) {\n var data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_6__[\"ɵfindLocaleData\"])(locale);\n return data[_angular_core__WEBPACK_IMPORTED_MODULE_6__[\"ɵLocaleDataIndex\"].Currencies];\n}", "async function getTickForOscBot() {\r\n for (const item of currencyPairs) {\r\n try {\r\n const response = await getTickForCurrencyPair(item.pairName);\r\n\r\n if (!item.initialRate()) {\r\n item.initialAsk = parseFloat(response.ask);\r\n item.initialBid = parseFloat(response.bid);\r\n } else {\r\n item.currentAsk = parseFloat(response.ask);\r\n item.currentBid = parseFloat(response.bid);\r\n item.compareRates();\r\n }\r\n } catch (error) {\r\n console.error(error);\r\n }\r\n }\r\n}", "async function getBalances(exch)\n{\n let exchange = new ccxt.gdax (exch)\n let table = {}\n try {\n\n // fetch account balance from the exchange\n let balance = await exchange.fetchBalance ()\n\n // output the result\n log (exchange.name.green, 'balance')\n\n// log(balance)\n await asyncForEach(balance.info, async (el, i, a) => {\n if (parseFloat(el.available) > 0) {\n // log(el.currency, \" => \", el.available)\n table[el.currency] = parseFloat(el.total)\n// log( portfolio[exchange.name.toLowerCase()] )\n portfolio[exchange.name.toLowerCase()].forEach(function (Pel, i, a) {\n if (Pel.symbol.split('/')[0] == el.currency) {\n// log(el.currency, \" \",Pel.symbol, \" \", parseFloat(el.total))\n Pel.amount = el.available\n// log(el.currency, \" \",Pel.symbol, \" \", Pel.amount)\n\n }\n })\n }\n })\n\n /*\n let printNice = asTable(sortBy(table, Object.values(table), 'value'))\n log( printNice )\n log( balance )\n */\n\n } catch (e) {\n\n if (e instanceof ccxt.DDoSProtection || e.message.includes ('ECONNRESET')) {\n log.bright.yellow ('[DDoS Protection] ' + e.message)\n } else if (e instanceof ccxt.RequestTimeout) {\n log.bright.yellow ('[Request Timeout] ' + e.message)\n } else if (e instanceof ccxt.AuthenticationError) {\n log.bright.yellow ('[Authentication Error] ' + e.message)\n } else if (e instanceof ccxt.ExchangeNotAvailable) {\n log.bright.yellow ('[Exchange Not Available Error] ' + e.message)\n } else if (e instanceof ccxt.ExchangeError) {\n log.bright.yellow ('[Exchange Error] ' + e.message)\n } else if (e instanceof ccxt.NetworkError) {\n log.bright.yellow ('[Network Error] ' + e.message)\n } else {\n throw e;\n }\n }\n return table\n}", "@api\n getRates(request, provider) {\n return apexGetRates({ requestJSON: JSON.stringify(request), provider: provider });\n }", "function getLocaleCurrencies(locale) {\n const data = Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵfindLocaleData\"])(locale);\n return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"ɵLocaleDataIndex\"].Currencies];\n}" ]
[ "0.7814988", "0.73062956", "0.7274762", "0.71633637", "0.7146334", "0.71281594", "0.70702064", "0.67513305", "0.67416984", "0.66913635", "0.6688716", "0.66884404", "0.6624526", "0.6608974", "0.6604429", "0.65456337", "0.64787847", "0.64659846", "0.6442459", "0.64053595", "0.6402251", "0.6396759", "0.639415", "0.637064", "0.635824", "0.6339674", "0.63348854", "0.62971425", "0.6293303", "0.6266517", "0.6265146", "0.62641823", "0.6264079", "0.6239529", "0.62246597", "0.6207224", "0.6202324", "0.61917984", "0.61812335", "0.61523277", "0.614967", "0.61491203", "0.61473876", "0.61330736", "0.61313474", "0.61239755", "0.6112422", "0.6110721", "0.60974467", "0.6088711", "0.60459787", "0.6044771", "0.6034182", "0.603411", "0.6032096", "0.60187733", "0.5996972", "0.59946936", "0.5984785", "0.5978413", "0.594692", "0.59366053", "0.59366053", "0.59366053", "0.59093606", "0.5908774", "0.5899275", "0.58990276", "0.5898533", "0.5889292", "0.5831962", "0.5813778", "0.5806283", "0.57913536", "0.5788424", "0.5766344", "0.5760791", "0.5758321", "0.5747811", "0.5741488", "0.573057", "0.57290584", "0.57284737", "0.57097155", "0.5707456", "0.56690055", "0.5658402", "0.5657775", "0.5633305", "0.56308293", "0.5614202", "0.56134963", "0.5610018", "0.5609568", "0.5607395", "0.5601928", "0.5594643", "0.55787337", "0.5571924", "0.5571059" ]
0.623569
34
controllo presenza caratteri speciali
function controllo(nome,cognome){ var nome_pul = nome.replace(/[^A-Za-z0-9]/g, ""); var cognome_pul = cognome.replace(/[^A-Za-z0-9]/g, ""); if(nome==nome_pul && cognome==cognome_pul) return true; else return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function comportement (){\n\t }", "function mostraNotas(){}", "function comprovarEscriu () {\r\n this.validate=1;\r\n index=cerca(this.paraules,this.actual);\r\n this.capa.innerHTML=\"\";\r\n if (index != -1) {\r\n paraula = this.paraules[index];\r\n this.putImg (this.dirImg+\"/\"+paraula.imatge);\r\n this.capa.innerHTML += \"<br>\" + this.paraules[index].paraula.toUpperCase();\r\n this.putSound (paraula.so);\r\n this.ant = this.actual;\r\n this.actual = \"\";\r\n }\r\n else {\r\n this.putImg (\"imatges/error.gif\");\r\n this.putSound (\"so/error.wav\");\r\n this.actual = \"\";\r\n }\r\n}", "function continuaEscriure ()\r\n{\r\n this.borra ();\r\n this.actual=\"\";\r\n this.validate=0;\r\n}", "replacerChangNiveau(){\n this.viderLaFile();\n this.cellule = this.jeu.labyrinthe.cellule(0,0);\n this.direction = 1;\n\t\t\t\tthis.vitesse = 0;\n }", "LiberarPreso(valor){\nthis.liberation=valor;\n }", "function escoltaPregunta ()\r\n{\r\n if(this.validate) {\r\n this.capa.innerHTML=\"\";\r\n this.putImg (this.dirImg+\"/\"+this.paraules[index].imatge);\r\n this.capa.innerHTML+=\"<br>\"+this.paraules[index].paraula.toUpperCase();\r\n this.putSound (this.paraules[index].so);\r\n }\r\n else {\r\n this.capa.innerHTML = \"\"\r\n this.putImg (this.dirImg+\"/\"+this.paraules[index].imatge);\r\n this.putSound (this.paraules[index].so);\r\n this.capa.innerHTML += \"<br>\" + this.actual+this.putCursor ('black');\r\n }\r\n}", "constructor (nombre, apellido,sueldo, cargo){ //solicitio los parametros incluidos los que vincule\n super(nombre,apellido) // con super selecciono los parametros que pide la clase vinculada\n this.sueldo= sueldo;\n this.cargo=cargo;\n }", "kartica1()\n {\n this.karticaForma=true;\n this.karticaRezultati=false;\n }", "function condiçaoVitoria(){}", "function escolta () {\r\n text = this.ant;\r\n if(this.validate) {\r\n \tthis.capa.innerHTML=\"\";\r\n index = cerca (this.paraules, text); \r\n if (index == -1) {\r\n this.capa.innerHTML=this.putCursor(\"black\");\r\n }\r\n else {\r\n this.putImg (this.dirImg+\"/\"+this.paraules[index].imatge);\r\n this.capa.innerHTML += \"<br>\" + this.paraules[index].paraula;\r\n this.putSound (this.paraules[index].so);\r\n }\r\n }\r\n \r\n\r\n}", "function specialClic() {\n if (presenceEnnemi===0){\n dialogBox(\"Tu veux t'amuser à faire de l'esbrouffe sans spectateurs ? T'es quel genre de gars ? Le genre à boire tout seul chez lui ? A faire tourner les serviettes lors d'un dîner en tête à tête avec ton chat ? Garde ton energie pour tes prochaines rencontres.\")\n }else if (presenceEnnemi===1){\n if(specialReboot <3){\n dialogBox(\"Tu dois encore attendre pour relancer un special, t'es fou ou quoi ? T'ES UN CHEATER UN TRUC DU GENRE ? NAN MAIS T'ES QUI POUR VOULOIR ENVOYER DES COUPS SPECIAUX H24, TA MERE ELLE T'A EDUQUé COMMENT AU JUSTE ?\");\n }else if(specialReboot ===3){\n document.getElementById(\"aventure\").innerHTML += (\"</br></br>COUP SPECIAL DE LA MORT QUI TACHE</br>Attend trois actions pour pouvoir relancer le bouzin\");\n switch (classeChoisie){\n \n \n case \"guerrier\":\n \n rndEnnemi.esquive = Number(15);\n degatAssomoir = Number(personnage.force*2);\n rndEnnemi.sante = rndEnnemi.sante - degatAssomoir;\n document.getElementById(\"santeEnnemi\").innerHTML = rndEnnemi.sante;\n document.getElementById(\"aventure\").innerHTML += (\"</br></br>Votre coup était SANS SOMMATION, votre adversaire en est tout étourdi et il semble perdre en agilité, il aura du mal à esquiver vos prochains coups, et vous lui infligez \"+degatAssomoir+\" point de dégats dans sa teuté.</br>\");\n \n break;\n \n case \"moine\":\n \n personnage.esquive = personnage.esquive - 15;\n personnage.sante = personnage.sante + 250;\n document.getElementById(\"santePerso\").innerHTML = personnage.sante;\n document.getElementById(\"esquivePerso\").innerHTML = personnage.esquive;\n document.getElementById(\"aventure\").innerHTML += (\"</br></br>Vous sortez une fiole de votre poche et prenez une lampée, vous vous santez en meilleure forme, mais votre agilité en prend un coup ! Avec modération s'il vous plait !</br>\");\n \n break;\n\n case \"mage\":\n\n //Decide d'une invocation random parmis 3 possibles\n\n var Min= Number(1)\n var Max= Number(3)\n\n function getRndInterger(min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;}\n incantation = getRndInterger(Min, Max);\n document.getElementById(\"aventure\").innerHTML += (\"</br></br>Les incantations d'Akimieumieu sont instables, vous vous concentrez et \");\n \n\n switch (incantation){\n case (1) :\n incantationName=\"BOULE DE SHNECK ULTRA\";\n degatBoule= (rndEnnemi.sante/2)+30;\n rndEnnemi.sante = rndEnnemi.sante - degatBoule;\n document.getElementById(\"santeEnnemi\").innerHTML = rndEnnemi.sante;\n document.getElementById(\"aventure\").innerHTML += (\"lancez le sort '\"+incantationName+\"' qui amoche votre adversaire bien salement, lui ôtant \" + degatBoule + \" Points de vie</br>EN FAIT C'EST LA MOITIE DE SA VIE + 30 SI T'A CAPTé</br>\" ) \n \n break;\n\n case (2) :\n incantationName=\"INVISIBILITÉ BON MARCHÉ\";\n personnage.esquive = Number(88);\n document.getElementById(\"esquivePerso\").innerHTML = personnage.esquive;\n document.getElementById(\"aventure\").innerHTML += (\"lancez le sort '\"+incantationName+\"'. L'adversaire ne vous voit que sous une forme quasiment transparente. Un peu comme si il regardait au travers d'une pinte de bière vide. C'est le moment d'esquiver ses coups !</br>\" ) \n \n break;\n \n case (3) :\n incantationName=\"CARRESSE PSYCHIQUE\";\n degatCarresse= 1;\n rndEnnemi.sante = rndEnnemi.sante + degatCarresse;\n document.getElementById(\"santeEnnemi\").innerHTML = rndEnnemi.sante;\n document.getElementById(\"aventure\").innerHTML += (\"lancez le sort '\"+incantationName+\"' que vous aviez appris à lancer à la Fac pour séduire une jeune mage très douce, qui depuis votre séparation s'est étrangement passionnée pour la démonologie. Ce sort n'est pas vraiment un sort de combat, et votre adversaire semble même un peu plus excité qu'au paravant, vous lui avez rendu \" + degatCarresse + \" Point de vie</br>\" ) \n \n break;\n }\n break;\n case \"david\":\n attaquer();\n document.getElementById(\"aventure\").innerHTML += (\"</br></br>VOTRE ENNEMI A SIMPLEMENT CESSé D'EXISTER.</br>\");\n resetEnnemi();\n \n break;\n \n default :\n dialogBox(\"Interaction cheloue du spécial, merci d'en faire part au MJ il code comme un pied, veuillez l'excuser.\")\n break;\n }\nesquiver();\nspecialReboot=0;\nconsole.log(\"Le spécial s'est exécuté\");\nscrollDown(\"fenetreCentrale\");\n}\n}\n}", "function escoltaDictat () {\r\n this.capa.innerHTML=\"\";\r\n if(!this.validate) {\r\n this.putSound (this.paraules[this.wordActual].so);\r\n this.capa.innerHTML += this.actual+this.putCursor ('black');\r\n }\r\n else {\r\n this.putSound(this.paraules[this.wordActual].so);\r\n this.putImg(this.dirImg + this.paraules[this.wordActual].imatge);\r\n this.capa.innerHTML += \"<br>\" + this.paraules[this.wordActual].paraula.toUpperCase();\r\n this.actual = \"\";\r\n }\r\n}", "function comprovarPregunta () {\r\n this.capa.innerHTML=\"\";\r\n if (this.actual.toUpperCase() != this.correcte.toUpperCase()) {\r\n this.putImg(\"imatges/error.gif\")\r\n this.putSound(this.soMal);\r\n this.actual = \"\";\r\n }\r\n else\r\n {\r\n this.validate=1;\r\n this.putImg(this.dirImg + this.paraules[this.wordActual].imatge)\r\n this.putSound(this.paraules[this.wordActual].so);\r\n this.capa.innerHTML += \"<br>\" + this.paraules[this.wordActual].paraula.toUpperCase();\r\n this.actual = \"\";\r\n }\r\n}", "function ControlliPagamento(contr) {\r\n var PranzoAbbonamento = document.getElementById(\"AbbonamentoPranzo\");\r\n \tvar CenaAbbonamento = document.getElementById(\"AbbonamentoCena\");\r\n\t\t\tif (IsStringNumeric(document.getElementById(\"prezzoCenaFinale\").innerHTML)) {\r\n\t\t\t\tCostoCenaFinale = document.getElementById(\"prezzoCenaFinale\").innerHTML;\r\n\t\t\t} else {\r\n\t\t\t\tCostoCenaFinale = \"10,00\";\r\n\t\t\t}\r\n\t\t\tif (IsStringNumeric(document.getElementById(\"prezzoCena\").innerHTML)) {\r\n\t\t\t\tCostoCena = document.getElementById(\"prezzoCena\").innerHTML;\r\n\t\t\t} else {\r\n\t\t\t\tCostoCena = \"3,00\";\r\n\t\t\t}\r\n\t\t\tif (IsStringNumeric(document.getElementById(\"prezzoPranzo\").innerHTML)) {\r\n\t\t\t\tCostoPranzo = document.getElementById(\"prezzoPranzo\").innerHTML;\r\n\t\t\t} else {\r\n\t\t\t\tCostoPranzo = \"3,00\";\r\n\t\t\t}\r\n\t\t\t//var Pranzo = null;\r\n\t\t\t//var PrezzoPranzo = null;\r\n\t\t\t//var GratisPranzo = null;\r\n\t\t\tvar cella = null;\r\n\t\t\t\r\n\t\t\tswitch (contr.name) {\r\n\t\t\t\tcase \"Pranzo[]\":\r\n\t\t\t\t\t// individuo i tre controlli nella cella\r\n\t\t\t\t\tcella = CercaControlliPranzo(contr)\r\n\t\t\t\t\t// controlla se l'utente ha selezionato il check gratis \r\n\t\t\t\t\tif (!PranzoAbbonamento.checked) {\r\n\t\t\t\t\t\tif (cella.Pranzo.checked) {\r\n\t\t\t\t\t\t\t//if (cella.CostoPranzo.value==\"\" || cella.CostoPranzo.value==\"0\") {\r\n\t\t\t\t\t\t\tcella.CostoPranzo.value = CostoPranzo;\r\n\t\t\t\t\t\t\tcella.CostoPranzo.disabled = false;\r\n\t\t\t\t\t\t\tcampoLocale = cella.CostoPranzo;\t\t\t\t// per fare funzionare la focus su FF\r\n\t\t\t\t\t\t\tsetTimeout(\"campoLocale.focus();\", 1);\t\t\t// per fare funzionare la focus su FF\r\n\t\t\t\t\t\t\tcella.CostoPranzo.select();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t cella.CostoPranzo.disabled=true;\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase \"Cena[]\":\r\n\t\t\t\t\t// individuo i tre controlli nella cella\r\n\t\t\t\t\tcella = CercaControlliCena(contr)\r\n\t\t\t\t\t// controlla se l'utente ha selezionato il check gratis \r\n\t\t\t\t\tif (!CenaAbbonamento.checked) {\r\n\t\t\t\t\t\tif (cella.Cena.checked) {\r\n\t\t\t\t\t\t\t//if (cella.CostoCena.value==\"\" || cella.CostoCena.value==\"0\") {\r\n\t\t\t\t\t\t\tcella.CostoCena.value=CostoCena;\r\n\t\t\t\t\t\t\tcella.CostoCena.disabled=false;\r\n\t\t\t\t\t\t\tcampoLocale = cella.CostoCena;\t\t\t\t\t\t// per fare funzionare la focus su FF\r\n\t\t\t\t\t\t\tsetTimeout(\"campoLocale.focus();\", 1);\t\t\t// per fare funzionare la focus su FF\r\n\t\t\t\t\t\t\tcella.CostoCena.select();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t cella.CostoCena.disabled=true;\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase \"GratisPranzo[]\":\r\n\t\t\t\t\t// individuo i tre controlli nella cella\r\n\t\t\t\t\tcella = CercaControlliPranzo(contr)\r\n\t\t\t\t\t// controlla se l'utente ha selezionato il check gratis \r\n\t\t\t\t\tif (!PranzoAbbonamento.checked) {\r\n\t\t\t\t\t\tif (cella.GratisPranzo.checked) {\r\n\t\t\t\t\t\t\tcella.Pranzo.checked = true;\r\n\t\t\t\t\t\t\tcella.Pranzo.disabled = true;\r\n\t\t\t\t\t\t\tcella.CostoPranzo.value = \"0,00\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tcella.Pranzo.checked = false;\r\n\t\t\t\t\t\t\tcella.Pranzo.disabled = false;\r\n\t\t\t\t\t\t\tcella.CostoPranzo.value=\"\";\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase \"GratisCena[]\":\r\n\t\t\t\t\t// individuo i tre controlli nella cella\r\n\t\t\t\t\tcella = CercaControlliCena(contr)\r\n\t\t\t\t\t// controlla se l'utente ha selezionato il check gratis \r\n\t\t\t\t\tif (!CenaAbbonamento.checked) {\r\n\t\t\t\t\t\tif (cella.GratisCena.checked) {\r\n\t\t\t\t\t\t\tcella.Cena.checked = true;\r\n\t\t\t\t\t\t\tcella.Cena.disabled = true;\r\n\t\t\t\t\t\t\tcella.CostoCena.value = \"0,00\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tcella.Cena.checked = false;\r\n\t\t\t\t\t\t\tcella.Cena.disabled = false;\r\n\t\t\t\t\t\t\tcella.CostoCena.value=\"\";\r\n\t\t\t\t\t\t} \r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tdocument.getElementById(\"CostoTotaleEuroCalcolato\").value = CalcolaCostoTotale().toFixed(2).replace(\".\", \",\");\r\n\t\t\treturn;\r\n\t\t}", "function continuaPregunta () {\r\n this.wordActual = this.getNewWord ();\r\n this.actual = \"\";\r\n this.init ();\r\n}", "function corrExam(){inicializar(); corregirText1(); corregirSelect1(); corregirMulti1(); corregirCheckbox1(); corregirRadio1(); corregirText2(); corregirSelect2(); corregirMulti2(); corregirCheckbox2(); corregirRadio2(); presentarNota();}", "function mostraretro1() {\n retrouno.style.display=\"block\";\n fronte1fronte1.replaceChild(retrouno,fronte1);\n //modifica delle descrizioni con il contenuto della lettera\n testo.style.display=\"block\";\n descrizionedescrizione.replaceChild(testo, descrizione); \n }", "function retourDeMonClic(idClique)\r\n {\r\n \r\n // console.log(idClique)+\" = clic\";\r\n // ex: e1, c1 ...\r\n\r\n // Affiche et garde la première lettre (position 0)\r\n let premiereLettreDeId = idClique.charAt(0); // ex: e\r\n\r\n\r\n// *********** Objectif retirer la première lettre pour avoir le numéro de l'id \r\n \r\n // Remplacer c ou e par rien\r\n let numeroId = idClique.replace(premiereLettreDeId, \"\");\r\n\r\n\r\n // On / off \r\n // (si = e + int et première lettre égal à e)\r\n\r\n if(idClique== (premiereLettreDeId + numeroId) && (premiereLettreDeId == \"e\")){\r\n\r\n x = document.getElementById(idClique).parentNode.nodeName;\r\n // console.log(x +\" lien parent\") // DIV\r\n\r\n let PointageCibleOn=document.getElementById(\"tache\"+numeroId);\r\n // console.log(numeroId + \" : id cliqué !\");\r\n\r\n let cibleIcon=document.getElementById(\"ico\"+numeroId);\r\n\r\n // Ajout du fond vert \"tache\"+numeroId\r\n PointageCibleOn.style.backgroundColor=\"rgba(232, 255, 117, 1)\";\r\n\r\n\r\n // ajout de class pour le design css\r\n\r\n cibleIcon.setAttribute(\"class\",\"far fa-check-circle\");\r\n\r\n// *********** Chercher le key de maListeDesTaches qui contient comme id: x le id cliqué \r\n \r\n for (let a = 0; a < maListeDesTaches.length; a++) {\r\n const element = maListeDesTaches[a];\r\n // console.log(element);\r\n\r\n// *********** Etat à true (pour mémoriser la couleur et ico validé)\r\n\r\n if (maListeDesTaches[a].id==numeroId) {\r\n // alert(\"L'array \"+a+\" à la valeur\"+maListeDesTaches[a].tache);\r\n maListeDesTaches[a].etat=true;\r\n console.log(maListeDesTaches)\r\n\r\n // ****** storage à sauver (mis à jour)\r\n localStorage.setItem(\"donnesSauvegardees\", JSON.stringify(maListeDesTaches));\r\n\r\n // break fonctionne également\r\n return;\r\n }\r\n }\r\n\r\n }\r\n\r\n// *********** Supprimer le Div cliqué\r\n\r\n if(idClique== (premiereLettreDeId + numeroId) && (premiereLettreDeId == \"c\")){\r\n\r\n function supprimerDiv() {\r\n \r\n // pointer le div tache et son numéro\r\n let myobj = document.getElementById(\"tache\"+numeroId);\r\n console.log(numeroId + \" Numéro Id cliqué\")\r\n\r\n // supprime la cible\r\n myobj.remove();\r\n\r\n\r\n// *********** supprimer la clef de id cliqué de l'objet ******************************************************************************\r\n \r\n // Supprimer de mon tableau id correspondant 1 = le nombre entrée(s) à supprimer\r\n maListeDesTaches.splice(numeroId, 1);\r\n\r\n // ****** storage à sauver (mis à jour)\r\n localStorage.setItem(\"donnesSauvegardees\", JSON.stringify(maListeDesTaches));\r\n }\r\n\r\n // Appel fonction\r\n supprimerDiv();\r\n\r\n\r\n } // fin condition if\r\n } // fin retourDeMonClic", "function continuaCopia ()\r\n{\r\n this.wordActual = this.getNewWord ();\r\n this.actual = \"\";\r\n this.init ();\r\n}", "function comprovarDictat () {\r\n this.capa.innerHTML=\"\";\r\n if (this.actual.toLowerCase() !=this.correcte.toLowerCase()) {\r\n this.putImg(\"imatges/error.gif\");\r\n this.putSound(this.soMal);\r\n this.actual = \"\";\r\n }\r\n else\r\n {\r\n this.putImg(this.dirImg + this.paraules[this.wordActual].imatge);\r\n this.putSound(this.paraules[this.wordActual].so);\r\n this.actual = \"\";\r\n this.capa.innerHTML += \"<br>\" + this.paraules[this.wordActual].paraula.toUpperCase();\r\n this.actual = \"\";\r\n this.validate=1;\r\n }\r\n}", "efficacitePompes(){\n\n }", "constructor(ojos, boca, extremidades, duenio) {\n super(ojos, boca, extremidades);\n this.duenio = duenio;\n this.estaDomesticado = true;\n }", "misDatos() { // un metodo es una funcion declarativa sin el function dentro de un objeto, puede acceder al universo del objeto\n return `${this.nombre} ${this.apellido}`; // por medio del \"this\", que es una forma de acceder a las propiedades del objeto en un metodo\n }", "function initCopia ()\r\n{\r\n this.wordActual = this.getNewWord ();\r\n index = this.wordActual;\r\n this.correcte = this.paraules[this.wordActual].paraula;\r\n this.actual = \"\";\r\n tabla =insertTable (this.correcte + \"&nbsp;\",this.actual + this.putCursor ('black'), this.estil);\r\n this.capa.innerHTML = tabla;\r\n this.putSound (this.paraules[index].so);\r\n validate=0;\r\n}", "function caricaElencoScrittureIniziale() {\n caricaElencoScrittureFromAction(\"_ottieniListaContiIniziale\");\n }", "constructor(raza) {\n this.raza = raza;\n\n // METODA 'MISCARE()' (IN INSTANTA OBIECTULUI)\n this.miscare = function() {\n console.log('miscare');\n }\n }", "function desclickear(e){\n movible = false;\n figura = null;\n}", "function compilazione(elm,commessa,name,note){\r\n\t\r\n\tvar ore = \"ore\"+name;\r\n\tvar straordinario = \"straordinario\"+name;\r\n\tvar assenze = \"assenze\"+name;\r\n\tvar tipologiaAssenze = \"tipologiaAssenze\"+name;\r\n\tvar parametri = \"parametri\"+name;\r\n\t\r\n\t\r\n\tdocument.compilaOre.oreOrd.style.border = \"1px solid #CCC\";\r\n\tdocument.compilaOre.oreStrao.style.border = \"1px solid #CCC\";\r\n\tdocument.compilaOre.assenze.style.border = \"1px solid #CCC\";\r\n\t\r\n\t// effettuo questo tipo di controllo per effettuare la modifica o inserimento ore\r\n\tif($(\"#\"+ore).val() > 0.0 || $(\"#\"+assenze).val() > 0.0){\r\n\t\t\r\n\t\t//carico l'azione da compiere\r\n\t\tdocument.compilaOre.azione.value = \"modificaOre\";\r\n\t\t\r\n\t\tdocument.compilaOre.parametro.value = name;\r\n\t\t\r\n\t\t// carico le ore ordinare\r\n\t\tdocument.compilaOre.oreOrd.value = $(\"#\"+ore).val();\r\n\t\t\r\n\t\t//carico le ore straordinarie\r\n\t\tdocument.compilaOre.oreStrao.value = $(\"#\"+straordinario).val();\r\n\t\t\r\n\t\t//carico le ore assenze\r\n\t\tdocument.compilaOre.assenze.value = $(\"#\"+assenze).val();\r\n\t\t\r\n\t\tif($(\"#\"+assenze).val() != 0.0){\r\n\t\t\t$(\"#oreOrdinare select\").css(\"display\",\"inline\");\r\n \t\r\n \tif($(\"#\"+tipologiaAssenze).text() == \"(Fe)\"){\r\n \t\tvar $select = $('#oreOrdinare select');\r\n var $options = $('option', $select);\r\n for(var x = 0; x < $options.length; x++){\r\n\t \t\tif($options[x].value == \"ferie\"){\r\n\t \t\t$options[x].selected = true;\r\n\t \t}\r\n }\r\n \t\t\t}else if($(\"#\"+tipologiaAssenze).text() == \"(Pr)\"){\r\n \t\t\t\tvar $selectPermessi = $('#oreOrdinare select');\r\n \t var $optionsPermessi = $('option', $selectPermessi);\r\n \t for(var xPermessi = 0; xPermessi < $optionsPermessi.length; xPermessi++){\r\n\t \t\t\t\tif($optionsPermessi[xPermessi].value == \"permessi\"){\r\n\t \t\t\t\t\t$optionsPermessi[xPermessi].selected = true;\r\n\t \t}\r\n \t }\r\n \t\t\t}else if($(\"#\"+tipologiaAssenze).text() == \"(M)\"){\r\n \t\t\t\tvar $selectMutua = $('#oreOrdinare select');\r\n \t var $optionsMutua = $('option', $selectMutua);\r\n \t for(var xMutua = 0; xMutua < $optionsMutua.length; xMutua++){\r\n\t \t\t\t\tif($optionsMutua[xMutua].value == \"mutua\"){\r\n\t \t\t\t\t\t$optionsMutua[xMutua].selected = true;\r\n\t \t}\r\n \t }\r\n \t\t\t}else if($(\"#\"+tipologiaAssenze).text() == \"(PNR)\"){\r\n \t\t\t\tvar $selectPeN = $('#oreOrdinare select');\r\n \t var $optionsPeN = $('option', $selectPeN);\r\n \t for(var xPeN = 0; xPeN < $optionsPeN.length; xPeN++){\r\n\t \t\t\t\tif($optionsPeN[xPeN].value == \"permessiNonRetribuiti\"){\r\n\t \t\t$optionsPeN[xPeN].selected = true;\r\n\t \t}\r\n \t }\r\n \t\t\t}\r\n\t\t}else{\r\n\t\t\t$(\"#oreOrdinare select\").css(\"display\",\"none\");\r\n\t\t}\r\n\t\t\r\n\t\t// carico le note\r\n\t\tif(note != \"\" && note != \"null\"){\r\n\t\t\tdocument.compilaOre.note.value = note;\r\n\t\t}else{\r\n\t\t\tdocument.compilaOre.note.value = \"Inserisci qui le Note\";\r\n\t\t}\r\n\t\t\r\n\t\t//carico la voce del bottone\r\n\t\t$(\".save input\").val(\"modifica ore\");\r\n\t\t\r\n\t\t\r\n\t\t$('#compilade').dialog({\r\n\t\t\tmodal: true,\r\n\t\t\tautoOpen: true,\r\n\t\t\theight: 400,\r\n\t\t\twidth: 550,\r\n\t\t\tposition: [350,200],\r\n\t\t\tshow: {\r\n\t\t\t\teffect: \"blind\",\r\n\t\t\t\tduration: 1000\r\n\t\t\t},\r\n\t\t\thide: {\r\n\t\t\t\teffect: \"explode\",\r\n\t\t\t\tduration: 1000\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t}else{\r\n\t\t\r\n\t\tdocument.compilaOre.azione.value = \"salvaBozza\";\r\n\t\t\r\n\t\tdocument.compilaOre.parametro.value = commessa;\r\n\t\t\r\n\t\tdocument.compilaOre.parametri.value = $(\"#parametri\"+name).val();\r\n\t\t\r\n\t\t// carico le ore ordinare\r\n\t\tdocument.compilaOre.oreOrd.value = $(\"#\"+ore).val();\r\n\t\t\r\n\t\t//carico le ore straordinarie\r\n\t\tdocument.compilaOre.oreStrao.value = $(\"#\"+straordinario).val();\r\n\t\t\r\n\t\t//carico le ore assenze\r\n\t\tdocument.compilaOre.assenze.value = $(\"#\"+assenze).val();\r\n\t\t\r\n\t\t$(\"#oreOrdinare select\").css(\"display\",\"none\");\r\n\t\t\r\n\t\t//faccio questo ciclo per resettare il menu di gestione delle assenze.\r\n\t\tvar $selectDefault = $('#oreOrdinare select');\r\n var $optionsDefault = $('option', $selectDefault);\r\n for(var xDefault = 0; xDefault < $optionsDefault.length; xDefault++){\r\n\t\t\tif($optionsDefault[xDefault].value == \"\"){\r\n \t\t$optionsDefault[xDefault].selected = true;\r\n \t}\r\n }\r\n\t\t\r\n\t\t// carico le note\r\n\t\tif(note != \"\" && note != \"null\"){\r\n\t\t\tdocument.compilaOre.note.value = note;\r\n\t\t}else{\r\n\t\t\tdocument.compilaOre.note.value = \"Inserisci qui le Note\";\r\n\t\t}\r\n\t\t\r\n\t\t//carico la voce del bottone\r\n\t\t$(\".save input\").val(\"salva bozza\");\r\n\t\t\r\n\t\t$('#compilade').dialog({\r\n\t\t\tmodal: true,\r\n\t\t\tautoOpen: true,\r\n\t\t\theight: 400,\r\n\t\t\twidth: 550,\r\n\t\t\tposition: [350,200],\r\n\t\t\tshow: {\r\n\t\t\t\teffect: \"blind\",\r\n\t\t\t\tduration: 1000\r\n\t\t\t},\r\n\t\t\thide: {\r\n\t\t\t\teffect: \"explode\",\r\n\t\t\t\tduration: 1000\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\t\r\n\treturn false;\r\n}", "constructor(prix, type, proprietaire, nbALouer, nbAVendre, nbEtage){\n super(prix, type, proprietaire) //appeler le constructor de la class mere\n this.nbALouer = nbALouer\n this.nbAVendre = nbAVendre\n this.nbEtages = nbEtages\n }", "mosaicoSeccion(x, y, wd, ht){\n let colorPromedio = this.colorPromedio(x, y, wd, ht); //Obtenemos el color promedio\n this.colorSeccion(x, y, wd, ht, colorPromedio); //Aplicamos este color a la seccion\n }", "function IndicadorRangoEdad () {}", "function controllaCampiRicercaCapitolo(annoCapitolo, numeroCapitolo,numeroArticolo,tipoCapitolo){\n \tvar erroriArray = []; \n \t// Controllo che i campi siano compilati correttamente\n if(annoCapitolo === \"\") {\n erroriArray.push(\"Il campo Anno deve essere compilato\");\n }\n if(numeroCapitolo === \"\" || !$.isNumeric(numeroCapitolo)) {\n erroriArray.push(\"Il campo Capitolo deve essere compilato\");\n }\n if(numeroArticolo === \"\" || !$.isNumeric(numeroArticolo)) {\n erroriArray.push(\"Il campo Articolo deve essere compilato\");\n }\n if(tipoCapitolo === undefined) {\n erroriArray.push(\"Il tipo di capitolo deve essere selezionato\");\n }\n return erroriArray;\n }", "function Mascota(nombre, especie, raza='')//no importa el orden de los datos\n//se pone comillas en la raza para que no te salga undefined por si no lo sabemos\n\n{\n this.nombre = nombre\n this.especie = especie\n this.raza = raza//los parametros de una funcion constructora son parametros y pueden tener valores por defecto\n\n}", "function actualitza ()\r\n{\r\n this.capa.innerHTML = this.actual + this.putCursor ('black');\r\n}", "auxiliarPredicado(tipo, nombre, valor, objeto) {\n //Verificamos si lo que se buscó en el predicado es un atributo o etiqueta\n if (tipo == \"atributo\") {\n //Recorremos los atributos del objecto en cuestion\n for (let att of objeto.atributos) {\n //Si los nombres de atributos son iguales\n if (att.dameNombre() == nombre) {\n //Si los valores de los atributos son iguales al valor ingresado en el predicado\n if (att.dameValor() == valor) {\n //Guardamos el elemento que contiene el atributo\n this.consolaSalidaXPATH.push(objeto);\n //Esta linea de codigo para para verificar el nuevo punto de inicio de la consola final, para no redundar\n if (!this.controladorPredicadoInicio) {\n this.contadorConsola = this.consolaSalidaXPATH.length - 1;\n this.controladorPredicadoInicio = true;\n }\n } //Cierre comparacion valor\n } //Cierre comparacion nombre\n } //Cierre for para recorrer atributos\n for (let entry of objeto.hijos) {\n for (let att of entry.atributos) {\n //Si los nombres de atributos son iguales\n if (att.dameNombre() == nombre) {\n //Si los valores de los atributos son iguales al valor ingresado en el predicado\n if (att.dameValor() == valor) {\n //Guardamos el elemento que contiene el atributo\n this.consolaSalidaXPATH.push(objeto);\n //Esta linea de codigo para para verificar el nuevo punto de inicio de la consola final, para no redundar\n if (!this.controladorPredicadoInicio) {\n this.contadorConsola = this.consolaSalidaXPATH.length - 1;\n this.controladorPredicadoInicio = true;\n }\n } //Cierre comparacion valor\n } //Cierre comparacion nombre\n } //Ci\n }\n }\n else {\n //Si lo que se busca es una etiqueta en el predicado\n for (let entry of objeto.hijos) {\n //Recorremos cada uno de los hijos y verificamos el nombre de la etiqueta\n if (entry.dameID() == nombre) {\n //Sí hay concidencia, se procede a examinar si el valor es el buscado\n if (entry.dameValor().substring(1) == valor) {\n //Agregamos el objeto a la consola de salida\n this.consolaSalidaXPATH.push(objeto);\n //Al iguar que n fragmento anteriores, se establece el nuevo punto de inicio\n if (!this.controladorPredicadoInicio) {\n this.contadorConsola = this.consolaSalidaXPATH.length - 1;\n this.controladorPredicadoInicio = true;\n } //cierreControladorInicio\n } //CIERRE VALOR\n } //CIERREID\n } //CIERRE RECORRIDO DE HIJOS\n }\n //La siguiente linea comentada es para recursividad, pendiente de uso.\n }", "function comprovarCopia () {\r\n this.capa.innerHTML=\"\";\r\n if (this.actual.toLowerCase()!=this.correcte.toLowerCase())\r\n {\r\n this.putImg(\"imatges/error.gif\");\r\n this.putSound(this.soMal);\r\n this.actual = \"\";\r\n }\r\n else\r\n {\r\n this.putImg(this.dirImg + this.paraules[this.wordActual].imatge)\r\n this.putSound(this.paraules[this.wordActual].so);\r\n this.capa.innerHTML += \"<br>\" + this.actual;\r\n this.actual = \"\";\r\n this.validate=1;\r\n }\r\n}", "constructor(color, velocidad, ruedas, motor, marca) {\n this.tipo = 'auto';\n this.color = color;\n this.velocidad = velocidad;\n this.ruedas = ruedas;\n this.motor = motor;\n this.vendido = true;\n this.marca = marca || 'Honda';\n }", "function mossa(pos)\n{\n//reset in casella statistiche e messaggi a sinistra dello schermo\n\tdocument.getElementById(\"faccia\").innerHTML=\"(• ‿ •)\";\n\tif(colturno=='n')\n\t\tdocument.getElementById(\"messaggi\").innerHTML=\"tocca ai neri\";\n\telse\n\t\tdocument.getElementById(\"messaggi\").innerHTML=\"tocca ai bianchi\";\n\n/*_________________________PRIMO CLICK___________________________________*/\n\n\tif(cont%2==0)\n\t{\n\t\tprimo=document.getElementById(pos).innerHTML;\n\t\tvecchiaPos=pos;\n\t\t//ottengo colore giocatore\n\t\tvar lenstr=primo.length;\n\t\tvar colp=primo.charAt(lenstr-7);\n\t\t//controllo se la selezione corrisponde al colore della mossa\n\t\tif(colp!=colturno)\n\t\t{\n\t\t\tdocument.getElementById(\"messaggi\").innerHTML=\"mossa non valida...\";\n\t\t\tdocument.getElementById('faccia').innerHTML=\"(ಠ╭╮ಠ)\";\n\t\t\t\treturn;//esce dalla funzione in caso di selezione colore sbagliato\n\t\t}\n\n\t\t//cambia colore selezionato\n\t\tdocument.getElementById(pos).className=\"selezionato\";\n\t\t//controllo pedina + selezione mosse possibili\n\t\tSeleziona(primo, colp, colturno, pos);\n\t\t\n\t}\n//_____________________________SECONDO CLICK___________________________//\n\n\telse\n\t{\n\t\t//SE LA MOSSA E' VALIDA\n\t\tif(document.getElementById(pos).className==\"selezionato\"&&pos!=vecchiaPos)\n\t\t{\n\t\t\t//se viene mangiata una pedian avversaria, la faccia si stupisce e viene salvata la pedina mangiata in un array\n\t\t\tif(document.getElementById(pos).innerHTML!='<img src=\"imm/vuota.png\">')\n\t\t\t{\n\t\t\t\tdocument.getElementById('faccia').innerHTML=\"(^ ‿ ^)\";\n\t\t\t\tif(colturno=='b')//se era nera\n\t\t\t\t\tmangiate_n.push(document.getElementById(pos).innerHTML);\n\t\t\t\telse\t//se era bianca\n\t\t\t\t\tmangiate_b.push(document.getElementById(pos).innerHTML);\n\t\t\t}\n\t\t\t//se viene mangiato il re finisce il gioco\n\t\t\tif(document.getElementById(pos).innerHTML=='<img src=\"imm/re_b.png\">')//vincono i neri\t\t\t\n\t\t\t\tfine(true);\n\t\t\telse if(document.getElementById(pos).innerHTML=='<img src=\"imm/re_n.png\">')//vincono i bianchi\t\t\t\n\t\t\t\tfine(false);\n\t\t\t\n\t\t\t/*_____________________CONTROLLO ARROCCO____________________*/\n\t\t\tif(pos==\"13\" && isArrocco==true)//nero sx\n\t\t\t{\n\t\t\t\tdocument.getElementById(\"14\").innerHTML='<img src=\"imm/torre_n.png\">'; //assegna alla nuova casella la pedina\n\t\t\t\tdocument.getElementById(\"11\").innerHTML=\"<img src='imm/vuota.png'>\"; //cancella la pedina nella vecchia casella\n\t\t\t\tarrocco[0]=false;\n\t\t\t}\n\t\t\telse if(pos==\"17\" && isArrocco==true)//nero dx\n\t\t\t{\n\t\t\t\tdocument.getElementById(\"16\").innerHTML='<img src=\"imm/torre_n.png\">'; //assegna alla nuova casella la pedina\n\t\t\t\tdocument.getElementById(\"18\").innerHTML=\"<img src='imm/vuota.png'>\"; //cancella la pedina nella vecchia casella\n\t\t\t\tarrocco[0]=false;\n\t\t\t}\n\t\t\telse if(pos==\"83\" && isArrocco==true)//bianco sx\n\t\t\t{\n\t\t\t\tdocument.getElementById(\"84\").innerHTML='<img src=\"imm/torre_b.png\">'; //assegna alla nuova casella la pedina\n\t\t\t\tdocument.getElementById(\"81\").innerHTML=\"<img src='imm/vuota.png'>\"; //cancella la pedina nella vecchia casella\n\t\t\t\tarrocco[3]=false;\n\t\t\t}\n\t\t\telse if(pos==\"87\" && isArrocco==true)//bianco dx\n\t\t\t{\n\t\t\t\tdocument.getElementById(\"86\").innerHTML='<img src=\"imm/torre_b.png\">'; //assegna alla nuova casella la pedina\n\t\t\t\tdocument.getElementById(\"88\").innerHTML=\"<img src='imm/vuota.png'>\"; //cancella la pedina nella vecchia casella\n\t\t\t\tarrocco[3]=false;\n\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//se è stato mossa una pedina per l'arrocco, ma non è stato fatto (quindi l'arrocco non è più possibile per quelle pedine)\n\t\t\tvar sum=[\"15\", \"11\", \"18\", \"85\", \"81\", \"88\"]\n\t\t\tfor(var i=0; i<6; i++)\n\t\t\t{\n\t\t\t\tif(vecchiaPos==sum[i])\n\t\t\t\t\tarrocco[i]=false;\n\t\t\t\t\t\n\t\t\t}\n\t\t\t//spostamento pedine\n\t\t\tdocument.getElementById(pos).innerHTML=primo; //assegna alla nuova casella la pedina\n\t\t\tdocument.getElementById(vecchiaPos).innerHTML=\"<img src='imm/vuota.png'>\"; //cancella la pedina nella vecchia casella\n\t\t\t//cambiamenti finali\n\t\t\tcontrolloPedoneFinal(pos,primo);//controlla se la pedina spostata era un pedone è arrivato alla parte opposta della scacchiera\n\t\t\tturno++;\n\t\t\ttimersec=300;\n\t\t\tdocument.getElementById(\"mosse\").innerHTML=\"mossa numero: \"+turno;\n\t\t\t//indica a chi tocca il turno successivo\n\t\t\tif(colturno=='b')\n\t\t\t{\n\t\t\t\tdocument.getElementById(\"messaggi\").innerHTML=\"tocca ai neri\";\n\t\t\t\tcolturno='n';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdocument.getElementById(\"messaggi\").innerHTML=\"tocca ai bianchi\";\n\t\t\t\tcolturno='b';\n\t\t\t}\n\t\t}\n\t\t//SE LA MOSSA NON E' VALIDA\n\t\telse\n\t\t\tdocument.getElementById(\"messaggi\").innerHTML=\"mossa non valida!!!\";\n\t\t\n\t\tDeseleziona();//deseleziona tutto\n\t\tvisualEaten();//visualizza le pedine mangiate\t\n\t}\n\tcont++;\n}", "function inicia(){\n controlVisualizacion.iniciaControlVisualizacion();\n controlVisualizacion.creaHTMLGeneral(); \n controlVisualizacion.iniciaElementosDOM();\n\n //iniciamos con la escena 1\n controlVisualizacion.comenzamos();\n}", "function inicia(){\n controlVisualizacion.iniciaControlVisualizacion();\n controlVisualizacion.creaHTMLGeneral(); \n controlVisualizacion.iniciaElementosDOM();\n\n //iniciamos con la escena 1\n controlVisualizacion.comenzamos();\n}", "constructor(nama, tahunLahir, asal, specialty, pengalaman) {\n super(nama, tahunLahir, asal)\n this.specialty = specialty\n this.pengalaman = pengalaman\n }", "modificarContraccionHelices(){\n this.contraer_helices = !this.contraer_helices;\n }", "constructor(nombreObjeto, apellido,altura){\n //Atributos\n this.nombre = nombreObjeto\n this.apellido = apellido\n this.altura = altura\n }", "constructor(\n _aforo = 0,\n _nroMesas = 0,\n _direccion = \"Sin Dirección\",\n _categoria = \"Sin Categoria\",\n _telefonos = [],\n _nombre = \"Sin Nombre\",\n _delivery = false\n ) {\n // this : acceder al scope interno de la clase.\n // this: se usa para acceder a los atributos y métodos de la clase.\n this.aforo = _aforo;\n this.nroMesas = _nroMesas;\n this.direccion = _direccion;\n this.categoria = _categoria;\n this.telefonos = _telefonos;\n this.nombre = _nombre;\n this.delivery = _delivery;\n\n if (this.aforo > 500) {\n this.tipificacion = \"A\";\n } else if (this.aforo > 300) {\n this.tipificacion = \"B\";\n } else {\n this.tipificacion = \"C\";\n }\n }", "function menu1_carte(id,no){\n\t\tc = jeu_me[no];\n\t\tif (c.etat == ETAT_JEU){\n\t\t\taction=prompt(\"A1,A2 pour attaquer | S pour sacrifier\");\n\t\t\tif (action!=null){\n\t\t\t\tc = jeu_me[no];\n\t\t\t\tnoAtt= action.substring(1);\n\t\t\t\t\t\t\n\t\t\t\tswitch(action){\n\t\t\t\t\tcase \"A1\":\n\t\t\t\t\tcase \"A2\":\n\t\t\t\t\t\tif (cim.length<c.cout){\n\t\t\t\t\t\t\talert(\">>pas assez de créatures ds le cimetière !!!\");\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tmy_logger(\"Je place carte:\"+ c.nom+ \" en \" +action);\n\t\t\t\t\t\t\t//récupére no ATT\n\t\t\t\t\t\t\tnoAtt= action.substring(1);\n\t\t\t\t\t\t\t//placer la carte en ATT\n\t\t\t\t\t\t\tmy_logger(\"contenu:\"+att_me[noAtt-1]);\n\t\t\t\t\t\t\tif (att_me[noAtt-1]== 0){\n\t\t\t\t\t\t\t\tjeu_effacerCarte(c);\n\t\t\t\t\t\t\t\tjeu_placerEnAttaque(true, no,c,noAtt);\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\talert(\">>Attaque déjà occupée !\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"S\":\n\t\t\t\t\t\tmy_logger(\"Je sacrifie la carte=>\"+c.nom);\n\t\t\t\t\t\tsacrifierUneCarte(no,c,true,true);\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function mostrafronte1() {\n fronte1.style.display=\"block\";\n fronte1fronte1.replaceChild(fronte1,retrouno);\n //modifica del contenuto della lettera con le descrizioni\n descrizione.style.display=\"block\";\n descrizionedescrizione.replaceChild(descrizione, testo); \n }", "constructor(nombreLugar='Tierra de mordor', tipoDescripcion='Es un lugar rodeado de arboles muertos y arena negra, donde no se puede ver nada por su densa niebla.')\r\n {\r\n this.nombreLugar = nombreLugar;\r\n this.tipoDescripcion = tipoDescripcion;\r\n }", "decrire() {\n return `${this.nom} a ${this.sante} points de vie et ${this.force} en force`; //ATTENTION: \"this\"\n //Une propriété dont la valeur est une fonction est appelée une méthode.\n }", "function limpiarCarrito(e){\r\n\r\n\r\n arrayCarrito = []\r\n\r\n limpiartHtml();\r\n\r\n}", "function achatItem3Lvl1() {\n affichagePrixItem3Lvl1.innerHTML = \"OBTENU\";\n boutonItem3Lvl1.disabled = true;\n boutonItem3Lvl1.style.border = \"inherit\";\n clickRessource3 = 2;\n ressource1.innerHTML = ressource1.innerHTML - prixItem3Lvl1;\n activationItemsShop();\n compteurRessourcePlateau1 = parseInt(ressource1.innerHTML);// mise a jour du compteurRessource\n document.getElementById(\"imgitem3lvl1Vide\").src= \"assets/img/pioche1Obtenu.png\";\n parseInt(nbTotalOutils.innerHTML++);\n verificationOutils1(); \n }", "function _CarregaPericias() {\n for (var chave_pericia in tabelas_pericias) {\n var pericia = tabelas_pericias[chave_pericia];\n var achou = false;\n for (var i = 0; i < pericia.classes.length; ++i) {\n // Aplica as pericias de mago a magos especialistas tambem.\n if (pericia.classes[i] == 'mago') {\n achou = true;\n break;\n }\n }\n if (!achou) {\n continue;\n }\n for (var chave_classe in tabelas_classes) {\n var mago_especialista = chave_classe.search('mago_') != -1;\n if (mago_especialista) {\n pericia.classes.push(chave_classe);\n }\n }\n }\n var span_pericias = Dom('span-lista-pericias');\n // Ordenacao.\n var divs_ordenados = [];\n for (var chave_pericia in tabelas_pericias) {\n var pericia = tabelas_pericias[chave_pericia];\n var habilidade = pericia.habilidade;\n var prefixo_id = 'pericia-' + chave_pericia;\n var div = CriaDiv(prefixo_id);\n var texto_span = Traduz(pericia.nome) + ' (' + Traduz(tabelas_atributos[pericia.habilidade]).toLowerCase() + '): ';\n if (tabelas_pericias[chave_pericia].sem_treinamento) {\n texto_span += 'ϛτ';\n }\n div.appendChild(\n CriaSpan(texto_span, null, 'pericias-nome'));\n\n var input_complemento =\n CriaInputTexto('', prefixo_id + '-complemento', 'input-pericias-complemento',\n {\n chave_pericia: chave_pericia,\n handleEvent: function(evento) {\n AtualizaGeral();\n evento.stopPropagation();\n }\n });\n input_complemento.placeholder = Traduz('complemento');\n div.appendChild(input_complemento);\n\n var input_pontos =\n CriaInputNumerico('0', prefixo_id + '-pontos', 'input-pericias-pontos',\n { chave_pericia: chave_pericia,\n handleEvent: function(evento) {\n ClickPericia(this.chave_pericia);\n evento.stopPropagation(); } });\n input_pontos.min = 0;\n input_pontos.maxlength = input_pontos.size = 2;\n div.appendChild(input_pontos);\n\n div.appendChild(CriaSpan(' ' + Traduz('pontos') + '; '));\n div.appendChild(CriaSpan('0', prefixo_id + '-graduacoes'));\n div.appendChild(CriaSpan('+0', prefixo_id + '-total-bonus'));\n div.appendChild(CriaSpan(' = '));\n div.appendChild(CriaSpan('+0', prefixo_id + '-total'));\n\n // Adiciona as gEntradas\n gEntradas.pericias.push({ chave: chave_pericia, pontos: 0 });\n // Adiciona ao personagem.\n gPersonagem.pericias.lista[chave_pericia] = {\n graduacoes: 0, bonus: new Bonus(),\n };\n // Adiciona aos divs.\n divs_ordenados.push({ traducao: texto_span, div_a_inserir: div});\n }\n divs_ordenados.sort(function(lhs, rhs) {\n return lhs.traducao.localeCompare(rhs.traducao);\n });\n divs_ordenados.forEach(function(trad_div) {\n if (span_pericias != null) {\n span_pericias.appendChild(trad_div.div_a_inserir);\n }\n });\n}", "function posarBoleta(e) {\r\n// console.log(\"has clicat el \"+ e.target.getAttribute('id'));\r\n if (numDeClics==0) {\r\n //si guanya\r\n if (e.target.getAttribute('id')==aleatorio) {\r\n resultat(\"guany\", \"Felicitats :)\");\r\n // resultat(\"Felicitats :)\");\r\n //si perd\r\n }else{\r\n // resultat(\"Torna a provar! :S\");\r\n resultat(\"perd\", \"Torna a provar! :S\");\r\n\r\n }\r\n numDeClics=numDeClics+1;\r\n }\r\n}", "function actualitzaPregunta (color) {\r\n index = this.wordActual;\r\n this.capa.innerHTML=\"\";\r\n this.putImg (this.dirImg+\"/\"+this.paraules[index].imatge);\r\n this.capa.innerHTML += \"<br> \"+this.actual + this.putCursor (color);\r\n}", "function vaLetras(e) {\n key = e.keyCode || e.which;\n tecla = String.fromCharCode(key).toString();\n letras = \" áéíóúabcdefghijklmnñopqrstuvwxyzÁÉÍÓÚABCDEFGHIJKLMNÑOPQRSTUVWXYZ\";//Se define todo el abecedario que se quiere que se muestre.\n especiales = [8, 37, 39, 46, 6]; //Es la validación del KeyCodes, que teclas recibe el campo de texto.\n\n tecla_especial = false\n for (var i in especiales) {\n if (key == especiales[i]) {\n tecla_especial = true;\n break;\n }\n }\n\n if (letras.indexOf(tecla) == -1 && !tecla_especial) {\n //alert('Tecla no aceptada');\n return false;\n }\n}", "get special() {\n return this.makeMap(\"wxxxcode-style,script,style,view,scroll-view,block\")\n }", "function caricaElencoScritture() {\n var selectCausaleEP = $(\"#uidCausaleEP\");\n caricaElencoScrittureFromAction(\"_ottieniListaConti\", {\"causaleEP.uid\": selectCausaleEP.val()});\n }", "function constroiEventos(){}", "procesa() {\n if (!this.setFrase) //Si la frase es variable\n this.frase = prompt(\"Escribe una frase\", \"Hola\").toUpperCase();\n\n this.tempData = this.data.slice(); //Necesitamos una copia, dado que el fondo es blanco.\n this.limpiaCanvas(); // Limpiamos el fondo\n super.procesa((w, h) => {\n this.ctx.font = h+\"px Arial\"; //Asignamos el tamaño de letra a la altura de la seccion.\n });\n }", "function PratoDoDiaComponent() {\n }", "getBiografia(){\n return super.getBiografia()+` Puesto: ${this.puesto}, Salario: ${this.sueldo}`;\n\n }", "init() {\n //paklausiam ar selektorius geras ir paskui ar duomenys yra array ir netuscias\n if (!this.isValidSelector() || this.isValidData()) {\n return false;\n }\n \n //tada klausiam ar geras limitas (jei teisingas palieka, o jei ne tai imeta defoltini limita)\n this.limit = this.isValidLimit() ? this.limit : this.defaultLimit;\n this.render();\n this.Event();\n return true;\n }", "nombreCompleeto(){\n //return this._nombre+ ' '+this._apellido+ ', '+this._departamento;\n //super es par aceder metodo padre\n return super.nombreCompleeto()+ ', '+this._departamento;\n }", "function visualiserAuteurControls(){\n var vControles = [\"lbledNomAuteur\",\"txtedNomAuteur\",\n \"lbledPreAuteur\",\"txtedPreAuteur\",\"lbledSaveAute\",\"btnedSaveAute\"];\n visualiserControls(\"btnedaddAute\" ,vControles,\"cboxedAute\");\n} // end visualiser", "mosaicoSeccion(x, y, wd, ht){\n throw new Error(\"Metodo no implementado en clase abstracta\");\n }", "function achatItem3Lvl3() {\n affichagePrixItem3Lvl3.innerHTML = \"OBTENU\";\n boutonItem3Lvl3.disabled = true;\n boutonItem3Lvl3.style.border = \"inherit\";\n clickRessource3 = 6;\n ressource2.innerHTML = ressource2.innerHTML - prix1Item3Lvl3;\n ressource3.innerHTML = ressource3.innerHTML - prix2Item3Lvl3;\n activationItemsShop();\n compteurRessourcePlateau2 = parseInt(ressource2.innerHTML);// mise a jour du compteurRessource\n compteurRessourcePlateau3 = parseInt(ressource3.innerHTML);// mise a jour du compteurRessource\n document.getElementById(\"imgitem3lvl3Vide\").src= \"assets/img/pioche3Obtenu.png\";\n parseInt(nbTotalOutils.innerHTML++);\n verificationOutils3();\n }", "function graczOberwal() {\r\n\r\n\t\t\t\t//zabieranie rebulla:\r\n\t\t\t\tif (DD_predkoscPocztkowaGracza >= 250) {\r\n\t\t\t\t\tDD_predkoscPocztkowaGracza -= 125;\r\n\t\t\t\t\tgracz.twoway(DD_predkoscPocztkowaGracza); //redukuj predkosc gracza\r\n\t\t\t\t\tDD_obrazeniaPocikskowGracz -= 0.05; //zredukuj obrazenia zadawane przez pociski gracza\r\n\r\n\t\t\t\t\t//dodaj napis o redukcji rebulla:\r\n\t\t\t\t\tvar bonusTekst = Crafty.e(\"2D, Canvas, Text, Delay, Motion\")\r\n\t\t\t\t\t\t.attr({ x: gracz.x - 25, y: gracz.y, z: 98 })\r\n\t\t\t\t\t\t.text('- REBULL')\r\n\t\t\t\t\t\t.textColor('gray')\r\n\t\t\t\t\t\t.textFont({ size: '15px', weight: 'bold' })\r\n\t\t\t\t\t\t.bind('EnterFrame', function (e) {\r\n\t\t\t\t\t\t\tthis.alpha -= 0.01;\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\t.delay(function () {\r\n\t\t\t\t\t\t\tthis.destroy();\r\n\t\t\t\t\t\t}, 1500, 0)\r\n\t\t\t\t\t\t;\r\n\t\t\t\t\tbonusTekst.velocity().y = -50;\r\n\r\n\t\t\t\t}\r\n\t\t\t\tif (DD_buforStrzalu <= 5) {\r\n\t\t\t\t\tDD_buforStrzalu += 1; //redukuj szybkosztrzelnosc\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//czerwona maska przy oberwaniu od przeciwnika:\r\n\t\t\t\tvar boli = Crafty.e('2D, Canvas, Image, Renderable, Delay')\r\n\t\t\t\t\t.attr({ x: 0, y: 0, w: 500, h: 300 })\r\n\t\t\t\t\t.image(\"assets/obrazki/ouch2.png\", \"no-repeat\")\r\n\t\t\t\t\t.delay(function () {\r\n\t\t\t\t\t\tthis.destroy();\r\n\t\t\t\t\t}, 150, 0)\r\n\t\t\t\t\t;\r\n\t\t\t\t// intensywnosc maski zalezy od ilosci pozostalego zycia:\r\n\t\t\t\tboli.alpha = (1 / gracz.zycie) * DD_fala;\r\n\t\t\t\treturn;\r\n\t\t\t}", "metodoAbstrato(){\n throw new Error(\"Este é um método abstrato e portanto não pode ser instanciado pelo objeto Conta\")\n }", "function visualiserEditeurControls(){\n //\"lbledPays\",\"cboxedPays\",\n var vControles = [\n \"lbledNomEditeur\", \"txtedNomEditeur\",\n \"lbledVille\", \"btnedaddVill\", \"cboxedVill\",\n \"lbledSaveEdit\",\"btnedSaveEdit\"//,\n //\"lbledaddVille\" , \"txtedaddVille\"\n ];\n visualiserControls(\"btnedaddEdit\",vControles,\"cboxedEdit\");\n} // end visualiser", "function controlloArrocco(colp)\n{\n\t\n\tif(colp==\"n\" && arrocco[0]==true) //nero\n\t{\n\t\tif(arrocco[1]==true && document.getElementById(\"12\").innerHTML=='<img src=\"imm/vuota.png\">' && document.getElementById(\"13\").innerHTML=='<img src=\"imm/vuota.png\">' && document.getElementById(\"14\").innerHTML=='<img src=\"imm/vuota.png\">')//controllo sinistra libera\n\t\t\tdocument.getElementById(\"13\").className=\"selezionato\"; isArrocco=true;\n\t\tif(arrocco[2]==true && document.getElementById(\"16\").innerHTML=='<img src=\"imm/vuota.png\">' && document.getElementById(\"17\").innerHTML=='<img src=\"imm/vuota.png\">')//controllo destra libera\n\t\t\tdocument.getElementById(\"17\").className=\"selezionato\"; isArrocco=true;\n\t}\n\telse if(colp==\"b\" && arrocco[3]==true) //bianco\n\t{\n\t\tif(arrocco[4]==true && document.getElementById(\"82\").innerHTML=='<img src=\"imm/vuota.png\">' && document.getElementById(\"83\").innerHTML=='<img src=\"imm/vuota.png\">' && document.getElementById(\"84\").innerHTML=='<img src=\"imm/vuota.png\">')//controllo sinistra libera\n\t\t\tdocument.getElementById(\"83\").className=\"selezionato\"; isArrocco=true;\n\t\tif(arrocco[5]==true && document.getElementById(\"86\").innerHTML=='<img src=\"imm/vuota.png\">' && document.getElementById(\"87\").innerHTML=='<img src=\"imm/vuota.png\">')//controllo destra libera\n\t\t\tdocument.getElementById(\"87\").className=\"selezionato\"; isArrocco=true;\n\t}\n}", "function ControladorDeEscenas(){\n //contiene el controlador de elementos visuales\n var controladorHospitales;\n var currentCategoria;\n\n this.iniciaControl = function(_controladorHospitales,_controaldorGrupoHospitales,_controladorLineChart,_controladorC3linechart,_controladorParallelChart){\n controladorHospitales = _controladorHospitales;\n controladorGrupoHospitales = _controaldorGrupoHospitales;\n controladorLineChart = _controladorLineChart;\n controladorC3linechart = _controladorC3linechart;\n controladorParallelChart = _controladorParallelChart;\n }\n\n\n this.setEscena1 = function(){\n \n //esconde line charts\n //controladorGrupoHospitales.hideLineCharts(); \n //controladorGrupoHospitales.resetPosicionDeDOMSGrupos();\n \n //define el diametro de los hexagonos\n //y el radio de los circulos\n controladorHospitales.controladorDeHexCharts.setDiameter(80);\n controladorHospitales.controladorDeHexCharts.setRadius(2);\n //pon las lineas Contadoras de un lado \n controladorHospitales.controladorDeLineasContadoras.movePosicionLineasContadoras(75,90);\n controladorHospitales.controladorDeLineasContadoras.setLargoLinea(50);\n controladorHospitales.controladorDeLineasContadoras.hideLineasContadoras();\n\n \n //inserta los hospitales al wrapper-all-hospitals\n //el contador es para darle tiempo a que los otros \n //g contenedores de hospitales regresen a la posición (0,0)\n //y no se vea un brinco.\n setTimeout(function(){\n controladorHospitales.insertHospitalesToWrapper();\n }, 1000); \n \n\n //pon los hospitales en grid\n controladorHospitales.setPosicionDeDOMSHospitales(definidorDePosiciones.generaPanal(40,300,150,hospitalesids));\n controladorGrupoHospitales.setPosicionToAllDOMSGrupos(0,0);\n controladorHospitales.resetListeners();\n controladorHospitales.resetHospitalUI();\n //controladorHospitales.addTooltipListeners();\n controladorC3linechart.hideDom();\n }\n\n //en la escena dos se ordenan los hospitales por delegacion o por tipo de hospital\n this.setEscena2 = function(categoria,anio){\n currentCategoria = categoria;\n\n var hospitalesPorTipo = categoria==\"Tipo\" ? mapHospitalesPorTipo : mapHospitalesPorZona; \n \n //controladorHospitales.setPosicionDeDOMSHospitales(definidorDePosiciones.generaClustersDePosicionesPorTipo(0,0,800,400,80,150,arregloPorTipo,50));\n var arreglo_hospitalesPorTipo = createObjectToArray(hospitalesPorTipo);\n controladorGrupoHospitales.createGrupoDoms(categoria,arreglo_hospitalesPorTipo,anio);\n controladorGrupoHospitales.insertHospitalesToGroupWrapper(arreglo_hospitalesPorTipo);\n controladorGrupoHospitales.hideLineCharts();\n controladorGrupoHospitales.setPosicionToAllDOMSGrupos(450,0);\n //controladorGrupoHospitales.showLineCharts(categoria);\n \n controladorHospitales.setPosicionDeDOMSHospitales(definidorDePosiciones.generaPanalPorTipo(categoria,hospitalesPorTipo));\n\n controladorHospitales.addChangeOpacityListeners(categoria);\n controladorHospitales.addSelectGroupListeners(categoria);\n\n controladorC3linechart.loadDataAllHospitales(anio,categoria);\n controladorC3linechart.showDom();\n\n controladorParallelChart.hideDOM();\n }\n\n\n //en la escena tres se muestra un parallel chart comparando totales anuales\n this.setEscena3 = function(){\n controladorHospitales.resetListeners();\n controladorHospitales.addChangeOpacityListeners(currentCategoria);\n\n controladorC3linechart.loadParallelLinesAllHospitalsData(currentCategoria);\n }\n}", "function proposer(element){\n\t\t\t\t\t\n\t\t\t\t\t// Si la couleur de fond est lightgreen, c'est qu'on a déja essayé - on quitte la fonction\n\t\t\t\t\tif(element.style.backgroundColor==\"lightGreen\" ||fini) return;\n\t\t\t\t\t\n\t\t\t\t\t// On récupere la lettre du clavier et on met la touche en lightgreen (pour signaler qu'elle est cliqu�e)\n\t\t\t\t\tvar lettre=element.innerHTML;\n\t\t\t\t\tchangeCouleur(element,\"lightGrey\");\n\t\t\t\t\t\n\t\t\t\t\t// On met la variable trouve false;\n\t\t\t\t\tvar trouve=false;\n\t\t\t\t\t\n\t\t\t\t\t// On parcours chaque lettre du mot, on cherche si on trouve la lettre s�l�ectionn�e au clavier\n\t\t\t\t\tfor(var i=0; i<tailleMot; i++) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Si c'est le cas :\n\t\t\t\t\t\tif(tableauMot[i].innerHTML==lettre) {\n\t\t\t\t\t\t\ttableauMot[i].style.visibility='visible';\t// On affiche la lettre\n\t\t\t\t\t\t\ttrouve=true;\n\t\t\t\t\t\t\tlettresTrouvees++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Si la lettre n'est pas présente, trouve vaut toujours false :\n\t\t\t\t\tif(!trouve){\n\t\t\t\t\t\tcoupsManques++;\n\t\t\t\t\t\tdocument.images['pendu'].src=\"asset/image/pendu_\"+coupsManques+\".jpg\"; // On change l'image du pendu\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Si on a rate 9 fois :\n\t\t\t\t\t\tif(coupsManques==8){\n\t\t\t\t\t\t\talert(\"Vous avez perdu !\");\n\t\t\t\t\t\t\tfor(var i=0; i<tailleMot; i++) tableauMot[i].style.visibility='visible';\n\t\t\t\t\t\t\tfini=true;\n\t\t\t\t\t\t\t// on affiche le mot, on fini le jeu\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(lettresTrouvees==tailleMot){\n\t\t\t\t\t\talert(\"Bravo ! Vous avez découvert le mot secret !\");\n\t\t\t\t\t\tfini=true;\n\t\t\t\t\t}\n\t\t\t\t}", "function Guarda_Clics_EPR_Menos()\r\n{\r\n\tGuarda_Clics(0,0);\r\n}", "function Guarda_Clics_EES_Menos()\r\n{\r\n\tGuarda_Clics(1,0);\r\n}", "function achatItem1Lvl3() {\n affichagePrixItem1Lvl3.innerHTML = \"OBTENU\";\n boutonItem1Lvl3.disabled = true;\n boutonItem1Lvl3.style.border = \"inherit\";\n clickRessource1 = 6;\n ressource2.innerHTML = ressource2.innerHTML - prix1Item1Lvl3;\n ressource3.innerHTML = ressource3.innerHTML - prix2Item1Lvl3;\n activationItemsShop();\n compteurRessourcePlateau2 = parseInt(ressource2.innerHTML);// mise a jour du compteurRessource\n compteurRessourcePlateau3 = parseInt(ressource3.innerHTML);// mise a jour du compteurRessource\n document.getElementById(\"imgitem1lvl3Vide\").src= \"assets/img/lance3Obtenu.png\";\n parseInt(nbTotalOutils.innerHTML++);\n verificationOutils3();\n }", "function cambiar(){\n \t var compania;\n \t //Se toma el valor de la \"compañia seleccionarda\"\n \t compania = document.formulariorecargas.compania[document.formulariorecargas.compania.selectedIndex].value;\n \t //se chequea si la \"compañia\" esta definida\n \t \n \t if(compania!=0){\n \t\t //Seleccionamos las cosas correctas\n \t\t \n \t\t mis_tipos=eval(\"tipo_\" + compania);\n \t\t //se calcula el numero de compania\n \t\t num_tipos=mis_tipos.length;\n \t\t //marco el numero de tipos en el select\n \t\t document.formulariorecargas.tipo.length = num_tipos;\n \t\t //para cada tipo del array, la pongo en el select\n \t\t for(i=0; i<num_tipos; i++){\n \t\t\t document.formulariorecargas.tipo.options[i].value=mis_tipos[i];\n \t\t\t document.formulariorecargas.tipo.options[i].text=mis_tipos[i];\n \t\t }\n \t\t \n \t\t }else{\n \t\t\t //sino habia ningun tipo seleccionado,elimino las cosas del select\n \t\t\t document.formulariocompania.tipo.length = 1;\n \t\t\t //ponemos un guion en la unica opcion que he dejado\n \t\t\t document.formulariorecargas.tipo.options[0].value=\"seleccionar\";\n \t\t\t document.formulariorecargas.tipo.options[0].text=\"seleccionar\";\n \t\t\t \n \t\t }\n \t \n \t\n \t \n \t \n \t\t //hacer un reset de los tipos\n \t document.formulariorecargas.tipo.options[0].selected=true;\n\n }", "function dibujarFresado118(modelo,di,pos,document){\n\t\n\t\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\tvar plieguesInf=[pliegueInf1, pliegueInf2, pliegueInf3, pliegueInf4, pliegueInf5]\n\tEAction.handleUserMessage(\"ha entrado 11111111111111111 \");\n\t//sacar el mayor pliegue\n\tpliegueInferior=pliegueInf1\n\tfor (n=0;n<5;n=n+1){ \n\t\tif (pliegueInferior<plieguesInf[n]){\n\t\t\tpliegueInferior=plieguesInf[n]\n\t\t}\n\t}\n\t\n\t\n\t\n\t//Puntos trayectoria \n\t\n\t\n\tvar fresado11 = new RVector(pos.x-anchura1,pos.y+alaInferior+pliegueInferior)\n\tvar fresado12 = new RVector(pos.x-anchura1-anchura2,pos.y+alaInferior+pliegueInferior)\n\tvar fresado13 = new RVector(pos.x-anchura1-anchura2-anchura3,pos.y+alaInferior+pliegueInferior)\n\tvar fresado14 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4,pos.y+alaInferior+pliegueInferior)\n\tvar fresado15 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-anchura5,pos.y+alaInferior+pliegueInferior) //nuevo\n\t\n\t\n\t\n\tvar fresado16 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior) \n\tvar fresado17 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado18 = new RVector(pos.x-anchura1,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado19 = new RVector(pos.x-anchura1-anchura2,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado20 = new RVector(pos.x-anchura1-anchura2-anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado21 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado22 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-anchura5,pos.y+alaInferior+pliegueInferior+alturaPlaca) //muevo\n\t\n\tvar fresado23 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-anchura5,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\n\t\n\t\n\t\n\t\n\tif (anchura5>pliegueInf5){ \n\t\tvar fresado14b = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-anchura5,pos.y+alaInferior+pliegueInferior-pliegueInf5-alaInferior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado14b , fresado23 ));\n\t\top_fresado.addObject(line,false);\n\n\t}else{\n\t\tvar line = new RLineEntity(document, new RLineData( fresado15 , fresado23 ));\n\t\top_fresado.addObject(line,false);\n\t}\n\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado16 , fresado15 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado15 , fresado22 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado21 , fresado14 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado13 , fresado20 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado19 , fresado12 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado11 , fresado18 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado17 , fresado22 ));\n\t\top_fresado.addObject(line,false);\n\n\t\n\t\n\t\n\tEAction.handleUserMessage(\"ha entrado 44444444444444444444444444 \");\n\t\n\t\n\t//anchura1 - Inferior\n\tif (anchura1>pliegueInf1){\n\t\t//var fresado10 = new RVector(pos.x,pos.y+pliegueInferior+alaInferior) \n\t\tvar fresado1 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t//var fresado2 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\tvar fresado3 = new RVector(pos.x-anchura1+pliegueInf1,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t\n\t\t//dibujarFresado_auxiliar(doc,fresado10,fresado1)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado3 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t//dibujarFresado_auxiliar(doc,fresado2,fresado11)\n\t}\n\t\n\t//anchura2 - Inferior\n\tif (anchura2>(pliegueInf2*2)){ \n\t\tvar fresado4 = new RVector(pos.x-anchura1-pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar fresado5 = new RVector(pos.x-anchura1-anchura2+pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado5 ));\n\t\top_fresado.addObject(line,false);\n\n\t}\n\t\n\t//anchura3 - Inferior\n\tif (anchura3>(pliegueInf3*2)){ \n\t\tvar fresado6 = new RVector(pos.x-anchura1-anchura2-pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar fresado7 = new RVector(pos.x-anchura1-anchura2-anchura3+pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado6 , fresado7 ));\n\t\top_fresado.addObject(line,false);\n\t} \n\t\n\t//anchura4 - Inferior\n\tif (anchura4>(pliegueInf4*2)){ \n\t\tvar fresado8 = new RVector(pos.x-anchura1-anchura2-anchura3-pliegueInf4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n\t\tvar fresado9 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4+pliegueInf4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado8 , fresado9 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t} \n\n\t//anchura4 - Inferior\n\tif (anchura5>pliegueInf5){ \n\t\tvar fresado10 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-pliegueInf5,pos.y+alaInferior+pliegueInferior-pliegueInf5)\n\t\tvar fresado11 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-anchura5,pos.y+alaInferior+pliegueInferior-pliegueInf5)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado10 , fresado11 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t} \n\t\n\t\n\t\n\n\tEAction.handleUserMessage(\"ha entrado 555555555555555555555555555555555555555555555555 \");\n\t\n\n\t\n\t//anchura1 - Superior\n\tif (anchura1>(pliegueSuperior*2)){ \n\t\tvar fresado25 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado26 = new RVector(pos.x-anchura1+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ //Esto es para hacer el fresado externo o no\n\t\t\tvar fresado27 = new RVector(pos.x-anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado28 = new RVector(pos.x-anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado27 , fresado28 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t//anchura2 - Superior\n\tif (anchura2>(pliegueSuperior*2)){ \n\t\tvar fresado31 = new RVector(pos.x-anchura1-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado32 = new RVector(pos.x-anchura1-anchura2+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado29 = new RVector(pos.x-anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado30 = new RVector(pos.x-anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado33 = new RVector(pos.x-anchura1-anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado34 = new RVector(pos.x-anchura1-anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado33 , fresado34 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t//anchura3 - Superior\n\tif (anchura3>pliegueSuperior*2){\n\t\tvar fresado37 = new RVector(pos.x-anchura1-anchura2-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado38 = new RVector(pos.x-anchura1-anchura2-anchura3+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado37 , fresado38 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado35 = new RVector(pos.x-anchura1-anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado36 = new RVector(pos.x-anchura1-anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado35 , fresado36 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado39 = new RVector(pos.x-anchura1-anchura2-anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado40 = new RVector(pos.x-anchura1-anchura2-anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado39 , fresado40 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t//anchura4 - Superior\n\tif (anchura4>pliegueSuperior*2){ \n\t\tvar fresado43 = new RVector(pos.x-anchura1-anchura2-anchura3-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado44 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado43 , fresado44 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado41 = new RVector(pos.x-anchura1-anchura2-anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado42 = new RVector(pos.x-anchura1-anchura2-anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado41 , fresado42 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado45 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado46 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado45 , fresado46 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t//anchura5 - Superior\n\tif (anchura5>pliegueSuperior){ \n\t\tvar fresado49 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado50 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-anchura5,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado49 , fresado50 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado47 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado48 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado47 , fresado48 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t\n\treturn op_fresado;\n\t\n\t\n\t\n\t\n\t\n}", "function ustawId(pole) {\r\n aktualnePole = pole.id; \r\n aktualnaWartosc = pole.value;\r\n}", "function Maisons(){\n \n }", "function inicializaContadores(){\n campo.on(\"input\", function(){\n var conteudo = campo.val();\n \n // contador de palavras\n var qtdPalavras = conteudo.split(/\\S+/).length -1; \n $(\"#contador-palavras\").text(qtdPalavras);\n // >> /\\S+/ = expressão regular que busca espço vazio\n \n // contador de letras\n var qtdCaracteres = conteudo.length\n $(\"#contador-caracteres\").text(qtdCaracteres);\n });\n }", "constructor(peso, color){ //propiedades\n this.peso= peso;\n this.color=color;\n }", "function controlloPedoneFinal(pos,primo)\n{\n\ttorre_b=\"torre_b\";torre_n=\"torre_n\";cavallo_b=\"cavallo_b\";cavallo_n=\"cavallo_n\";alfiere_b=\"alfiere_b\";alfiere_n=\"alfiere_n\";//è necessario per passare i parametri alla funzione 'trasforma'\n\t\n\tif(pos>=11 && pos<=18 && primo=='<img src=\"imm/pedone_b.png\">') //se il bianco è arrivato alla fine\n\t\tdocument.getElementById(\"transPedone\").innerHTML='<p>Sostituisci il pedone con una di queste pedine</p><img class=\"transs\" onClick=\"trasforma('+pos+','+torre_b+')\" src=\"imm/torre_b.png\"><br><img class=\"transs\" onClick=\"trasforma('+pos+','+cavallo_b+')\" src=\"imm/cavallo_b.png\"><br><img class=\"transs\" onClick=\"trasforma('+pos+','+alfiere_b+')\" src=\"imm/alfiere_b.png\">';\t\n\tif(pos>=81 && pos<=88 && primo=='<img src=\"imm/pedone_n.png\">') //se il nero è arrivato alla fine\n\t\tdocument.getElementById(\"transPedone\").innerHTML='<p>Sostituisci il pedone con una di queste pedine</p><img class=\"transs\" onClick=\"trasforma('+pos+','+torre_n+')\" src=\"imm/torre_n.png\"><br><img class=\"transs\" onClick=\"trasforma('+pos+','+cavallo_n+')\" src=\"imm/cavallo_n.png\"><br><img class=\"transs\" onClick=\"trasforma('+pos+','+alfiere_n+')\" src=\"imm/alfiere_n.png\">';\n}", "decrire() \n {\n return `${this.nom} a ${this.sante} points de vie, ${\n this.force\n } en force et ${this.xp} points d'expérience`;\n }", "function afficherLegendeCarte() {\n if (couvertureQoS == \"couverture\") {\n if (carteCouverture == \"voix\") afficherLegendeCarteCouvVoix();\n else if (carteCouverture == \"data\") afficherLegendeCarteCouvData();\n } else if (couvertureQoS == \"QoS\") {\n actualiserMenuSelectionOperateurs();\n if (agglosTransports == \"transports\") afficherLegendeCarteQoSTransport();\n else if(agglosTransports == 'agglos') afficherLegendeCarteQoSAgglos();\n else if(driveCrowd == \"crowd\") afficherLegendeCarteQoSAgglos();\n }\n}", "constructor() {\r\n super();\r\n this.addPart.push(new NormalPart(\"j'en ai conclu que la mousse au chocolat n'était mon fort, \"));\r\n this.addPart.push(new NormalPart(\"j'ai appellé les Avengers pour m'aider dans ma quête, \"));\r\n this.addPart.push(new NormalPart(\"j'ai crié après le perroquet \"));\r\n this.addPart.push(new NormalPart(\"j'ai toujours voulu devenir un super-héros \"));\r\n this.addPart.push(new NormalPart(\"mon copain a acheté des champignons hallucinogènes \"));\r\n this.addPart.push(new NormalPart(\"j'ai acheté des nouvelles épées kikoodelamortquitue \"));\r\n this.addPart.push(new NormalPart(\"Nina mon perroquet a crié son mécontentement \"));\r\n this.addPart.push(new NormalPart(\"ma copine m'a dit : Lui c'est un mec facile !, \"));\r\n this.addPart.push(new NormalPart(\"je me suis mise à écouter Rammstein \"));\r\n this.addPart.push(new NormalPart(\"j'ai ressorti ma vieille Nintendo DS \"));\r\n this.addPart.push(new NormalPart(\"le père Noël est sorti de sous la cheminée \"));\r\n this.addPart.push(new NormalPart(\"ma mère m'a dit : Rien ne vaut les gâteaux !, \"));\r\n this.addPart.push(new NormalPart(\"je me suis poussée à me remettre au sport \"));\r\n this.addPart.push(new NormalPart(\"un castor est sorti de la rivière \"));\r\n this.addPart.push(new NormalPart(\"Jean-pierre Pernault à parlé du Coronavirus au 20h çà m'a fait réfléchir, \"));\r\n }", "function crearTermostatoTipo0( id_term)\n{\n\tvar termostato1= new Object();\n\t\n\t\n\ttermostato1.parametros={temperatura:35.5, modo:0,temperaturaAmbiente:30.5,ValvulaAbierta:0};// datos recibidor del termostato\n\ttermostato1.configuracion={temperatura:35.5, modo:0, Caption:\"\"};// parametros que se envian al termostato \n\ttermostato1.configuracion.Caption=\"Termostato \"+id_term;\n\ttermostato1.iluminadoModo=false;\n\ttermostato1.Tipo=0;// tipo de objeto en este caso termostato sistena\n\ttermostato1.Caption=\"Termostato \"+id_term;\n\ttermostato1.visible=1;// se mira si es visible o no \n\ttermostato1.EstaMinimizado=1; // 0 maximizado, 1 minimizado\n\t//termostato1.temperatura=35.5;\n\t//termostato1.temperaturaAmbiente=30.5;\n\ttermostato1.estado=1; // donde 1 es on y 0 off \n\ttermostato1.actualizar=0; // donde 1 es que hay que enviar datos al servicio pass , 0 no hay datos actualizador\n\ttermostato1.dat=0;// ????\n\t//termostato.HayDatosCambiados=HayDatosCambiados_Term;\n\n\ttabla_valores.push(termostato1);\n\n\tvar t = document.querySelector('#termostato_tipo_1');\n\t\n\t\n\tvar clone = document.importNode(t.content, true);\n\t\n\tclone.getElementById(\"termostato\").id=\"termostato\"+id_term;\n\tclone.getElementById(\"marco_superior\").id=\"marco_superior\"+id_term;\n\tclone.getElementById(\"icono_despliegue\").id=\"icono_despliegue\"+id_term;\n\tclone.getElementById(\"caption_temp\").id=\"caption_temp\"+id_term;\n\tclone.getElementById(\"tempAmbiente\").id=\"tempAmbiente\"+id_term;\n\tclone.getElementById(\"icono_OnOffSup\").id=\"icono_OnOffSup\"+id_term;\n\tclone.getElementById(\"marco_inf\").id=\"marco_inf\"+id_term;\n\tclone.getElementById(\"zona_iconos\").id=\"zona_iconos\"+id_term;\n\tclone.getElementById(\"btn_mas\").id=\"btn_mas\"+id_term;\n\tclone.getElementById(\"icono_func_mas\").id=\"icono_func_mas\"+id_term;\n\tclone.getElementById(\"temp_grande\").id=\"temp_grande\"+id_term;\n\tclone.getElementById(\"btn_menos\").id=\"btn_menos\"+id_term;\n\tclone.getElementById(\"icono_func_menos\").id=\"icono_func_menos\"+id_term;\n\tclone.getElementById(\"icono_onoff\").id=\"icono_onoff\"+id_term;\n\tclone.getElementById(\"btn_onoff\").id=\"btn_onoff\"+id_term;\n\tclone.getElementById(\"marco_temp\").id=\"marco_temp\"+id_term;\n\tclone.getElementById(\"btn_conf\").id=\"btn_conf\"+id_term;\n\tclone.getElementById(\"temp_peque\").id=\"temp_peque\"+id_term;\n\tclone.getElementById(\"term_modo\").id=\"term_modo\"+id_term;\n\t\n\t\n\t$(\"#contenedor\").append(clone);\n\tdocument.getElementById(\"icono_despliegue\"+id_term).setAttribute( \"IdTerm\",id_term.toString());\n\tdocument.getElementById(\"icono_OnOffSup\"+id_term).setAttribute(\"IdTerm\",id_term.toString());\n\tdocument.getElementById(\"btn_mas\"+id_term).setAttribute(\"IdTerm\",id_term.toString());\n\tdocument.getElementById(\"btn_menos\"+id_term).setAttribute(\"IdTerm\",id_term.toString());\n\tdocument.getElementById(\"btn_onoff\"+id_term).setAttribute(\"IdTerm\",id_term.toString());\n\tdocument.getElementById(\"btn_conf\"+id_term).setAttribute(\"IdTerm\",id_term.toString());\n\t\n}", "function limpiarCampos(opcion) { \r\n \r\nswitch (opcion.data.parametro){\r\n \r\n //Aereo\r\n case \"aereo\":\r\n $(\"#cantidadPersonasAereo\").val(\"\");\r\n $(\"#pasajeroAereo\").val(\"\");\r\n $(\"#etiquetaReservaAereo\").text(\"Complete los datos y realice su reserva\");\r\n animacionResultado(\"#etiquetaReservaAereo\",2);\r\n break;\r\n //Crucero\r\n case \"crucero\":\r\n $(\"#cantidadPersonasCrucero\").val(\"\");\r\n $(\"#pasajeroCrucero\").val(\"\");\r\n $(\"#etiquetaReservaCrucero\").text(\"Complete los datos y realice su reserva\");\r\n animacionResultado(\"#etiquetaReservaCrucero\",2);\r\n break;\r\n\r\n //Alquiler\r\n case \"auto\":\r\n $(\"#cantidadDiasAuto\").val(\"\");\r\n $(\"#pasajeroAuto\").val(\"\");\r\n $(\"#etiquetaReservaAuto\").text(\"Complete los datos y realice su reserva\");\r\n animacionResultado(\"#etiquetaReservaAuto\",2);\r\n break;\r\n\r\n default:\r\n break;\r\n}\r\n}", "separarCaracteres(){\r\n let cadena = this.objetoExpresion();\r\n for(let i = 0; i <= cadena.length-1; i++){\r\n this._operacion.addObjeto(new Dato(cadena.charAt(i)));\r\n }\r\n //Hace el arbol mediante la lista ya hecha \r\n this._operacion.armarArbol();\r\n //Imprime el orden normal \r\n this.printInfoInOrder();\r\n }", "constructor(dato, sig) {\n this.dato = dato;\n this.sig = sig;\n this.peso = null; // solo se utiliza para cuando el nodo pertenece a la \n //lista de adyacencia del vertice\n this.color = null;\n this.nivel = null;\n this.padre = null;\n this.distancia = null;\n }", "function IndicadorGradoAcademico () {}", "get informations() {\n return this.pseudo + ' (' + this.classe + ') a ' + this.sante + ' points de vie et est au niveau ' + this.niveau + '.'\n }", "constructor(nombre, apellido, altura){\n super(nombre,apellido,altura)\n }", "switchIlumination() {\n if (this.typeBasic)\n //colocamos o material como sendo Basic\n this.material = this.materials[1];\n\n else\n //colocamos o material Basic como sendo Phong\n this.material = this.materials[0];\n\n this.typeBasic = !this.typeBasic;\n }", "function achatItem3Lvl2() {\n affichagePrixItem3Lvl2.innerHTML = \"OBTENU\";\n boutonItem3Lvl2.disabled = true;\n boutonItem3Lvl2.style.border = \"inherit\";\n clickRessource3 = 4;\n ressource1.innerHTML = ressource1.innerHTML - prix1Item3Lvl2;\n ressource2.innerHTML = ressource2.innerHTML - prix2Item3Lvl2;\n activationItemsShop();\n compteurRessourcePlateau1 = parseInt(ressource1.innerHTML);// mise a jour du compteurRessource\n compteurRessourcePlateau2 = parseInt(ressource2.innerHTML);// mise a jour du compteurRessource\n document.getElementById(\"imgitem3lvl2Vide\").src= \"assets/img/pioche2Obtenu.png\";\n parseInt(nbTotalOutils.innerHTML++);\n verificationOutils2();\n }", "function MetodoCruzamento(){\n //Nivel+1 para sabermos que não são os pais, e um o fruto de um cruzamento do nivel 1.\n\tNivel++;\n\tswitch(MetodoCruzamen){\n\t\tcase 1:\n\t\t\tKillError(\"-s [1:Não definido,2]\");\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tconsole.log(\"Cruzamento em andamento!\");\n\t\t\tconsole.log(\"- Crossover PMX\");\n\t\t\tconsole.log(\"- - Geração: \"+Geracao);\n\t\t\tif(Torneio==1){\n\t\t\t\tconsole.log(\"- - - Torneio\");\n\t\t\t}else{\n\t\t\t\tconsole.log(\"- - - Roleta\");\n\t\t\t}\n\t\t\twhile(Geracao>=0){\n\t\t\t\tCrossover_PMX();\n\t\t\t\tGeracao=Geracao-1;\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tKillError(\"-s [1,2]\");\n\t}\n\tQualidadeCheck();\n}", "function escoltaCopia () {\r\n if(this.validate) {\r\n this.capa.innerHTML=\"\";\r\n this.putImg (this.dirImg+\"/\"+this.paraules[index].imatge);\r\n this.capa.innerHTML += \"<br>\" + this.correcte.toUpperCase();\r\n this.putSound (this.paraules[index].so);\r\n }\r\n else {\r\n tabla =insertTable (this.correcte + \"&nbsp;\",this.actual + this.putCursor ('black'), this.estil);\r\n this.capa.innerHTML = tabla;\r\n this.putSound (this.paraules[index].so);\r\n }\r\n}", "function dibujarFresado117(modelo,di,pos,document){\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\tEAction.handleUserMessage(\"ha entrado 11111111111111111 \");\n\tvar plieguesInf=[pliegueInf1, pliegueInf2, pliegueInf3]\n\t\n\t//sacar el mayor pliegue\n\tpliegueInferior=pliegueInf1\n\tfor (var n=0; n<4 ;n=n+1){\n\t\tif (pliegueInferior<plieguesInf[n]){\n\t\t\tpliegueInferior=plieguesInf[n]\n }\n }\n\t\n\t\n\t\n\t//Puntos trayectoria \n\t\n\tvar fresado11 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+pliegueInferior)\n\tvar fresado12 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+pliegueInferior)\n\tvar fresado13 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior)\n\tvar fresado14 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior)\n\t\n\tvar fresado16 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior) \n\tvar fresado17 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado18 = new RVector(pos.x+alaIzquierda+anchura1,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado19 = new RVector(pos.x+alaIzquierda+anchura1+anchura2,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado20 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado21 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado22 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\n\t\n\t\n\tvar fresado2 = new RVector(pos.x+alaIzquierda,pos.y)\n\t\n var line = new RLineEntity(document, new RLineData( fresado16 , fresado14 ));\n\top_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado12 , fresado19 ));\n\top_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado18 , fresado11 ));\n\top_fresado.addObject(line,false);\n var line = new RLineEntity(document, new RLineData( fresado17 , fresado21 ));\n\top_fresado.addObject(line,false);\n\n\t\n\n\t\n\t\n\t//anchura1 - Inferior\n\tif (anchura1>pliegueInf1){\n\t\t//var fresado10 = new RVector(pos.x+alaIzquierda,pos.y+pliegueInferior+alaInferior) \n\t\tvar fresado1 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t//var fresado2 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\tvar fresado3 = new RVector(pos.x+alaIzquierda+anchura1-pliegueInf1,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t\n\t\t//dibujarFresado_auxiliar(doc,fresado10,fresado1)\n var line = new RLineEntity(document, new RLineData( fresado1 , fresado3 ));\n\t op_fresado.addObject(line,false);\n\n\t\t//dibujarFresado_auxiliar(doc,fresado2,fresado11)\n }\n\t\n\t//anchura2 - Inferior\n\tif (anchura2>(pliegueInf2*2)){\n\t\tvar fresado4 = new RVector(pos.x+alaIzquierda+anchura1+pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar fresado5 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n var line = new RLineEntity(document, new RLineData( fresado4 , fresado5 ));\n\t op_fresado.addObject(line,false);\n\n }\n\t\n\t//anchura3 - Inferior\n\tif (anchura3>(pliegueInf3)){\n\t\tvar fresado6 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar fresado7 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueDer,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n var line = new RLineEntity(document, new RLineData( fresado6 , fresado7 ));\n\t op_fresado.addObject(line,false);\n\n }\n\t\n\t\n\t\n\t\n\t\n\t//Puntos extra para esta pieza\n\tvar fresado7 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueDer,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\tvar fresado8 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueDer,pos.y+alaInferior+pliegueInferior-pliegueDer)\n var line = new RLineEntity(document, new RLineData( fresado7 , fresado8 ));\n\top_fresado.addObject(line,false);\n\n\t\n\tvar fresado9 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueDer,pos.y+alaInferior+pliegueInferior+pliegueDer)\n\tvar fresado10 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3+pliegueDer,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n var line = new RLineEntity(document, new RLineData( fresado9 , fresado10 ));\n\top_fresado.addObject(line,false);\n\t\n\n var line = new RLineEntity(document, new RLineData( fresado21 , fresado10 ));\n\top_fresado.addObject(line,false);\n\t\n\tvar fresado11 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3,pos.y+alaInferior)\n var line = new RLineEntity(document, new RLineData( fresado20 , fresado11 ));\n\top_fresado.addObject(line,false);\n\n\t\n\t\n\t\n\t\n\t\n\t\n\n\t\n\t//anchura1 - Superior\n\tif (anchura1>(pliegueSuperior*2)){\n\t\tvar fresado25 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado26 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ //Esto es para hacer el fresado externo o no\n\t\t\tvar fresado27 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado28 = new RVector(pos.x+alaIzquierda+anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado27 , fresado28 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n }\n }\n\t\n\t//anchura2 - Superior\n\tif (anchura2>(pliegueSuperior*2)){\n\t\tvar fresado31 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado32 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1) {\n\t\t\tvar fresado29 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado30 = new RVector(pos.x+alaIzquierda+anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\tvar fresado33 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado34 = new RVector(pos.x+alaIzquierda+anchura1+anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado33 , fresado34 ));\n\t op_fresado.addObject(line,false);\n\t\t\n }\n }\n\t\n\t//anchura3 - Superior\n\tif (anchura3>pliegueSuperior*2){\n\t\tvar fresado37 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado38 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado37 , fresado38 ));\n\t op_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){\n\t\t\tvar fresado35 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado36 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado35 , fresado36 ));\n\t op_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado39 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado40 = new RVector(pos.x+alaIzquierda+anchura1+anchura2+anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n var line = new RLineEntity(document, new RLineData( fresado39 , fresado40 ));\n\t op_fresado.addObject(line,false);\n\t\t\n }\n }\n\t\n\t\n\tvar fresado2 = new RVector(pos.x+alaIzquierda,pos.y)\n\tvar fresado25 = new RVector(pos.x+alaIzquierda,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n var line = new RLineEntity(document, new RLineData( fresado2 , fresado25 ));\n\top_fresado.addObject(line,false);\n\t\n\t\n\t\n\t\n\n\treturn op_fresado; \n}", "function mostrarRelacionTecnicos3(sOpcion, sValor1, sValor2, sValor3){\n var sNumPE;\n try{\n if ($I(\"hndIdPE\").value==\"\"){\n mmoff(\"Inf\", \"Debes seleccionar un proyecto económico\", 270);\n return;\n }\n if (sOpcion==\"N\"){\n sValor1= Utilidades.escape($I(\"txtApe1Pool\").value);\n sValor2= Utilidades.escape($I(\"txtApe2Pool\").value);\n sValor3= Utilidades.escape($I(\"txtNomPool\").value);\n if (sValor1==\"\" && sValor2==\"\" && sValor3==\"\"){\n mmoff(\"Inf\",\"Debes indicar algún criterio para la búsqueda por apellidos/nombre\",410);\n return;\n }\n }\n var js_args = \"tecnicosPool@#@\";\n js_args += sOpcion +\"@#@\"+sValor1+\"@#@\"+sValor2+\"@#@\"+sValor3+\"@#@\"+$I(\"txtCualidad\").value+\"@#@\"+$I(\"hdnCRActual\").value+\"@#@\"+dfn($I(\"hdnT305IdProy\").value);\n \n mostrarProcesando();\n RealizarCallBack(js_args, \"\"); //con argumentos\n return;\n \n\t}catch(e){\n\t\tmostrarErrorAplicacion(\"Error al obtener la relación de profesionales\", e.message);\n }\n}", "setearParams(kv, ma, md, fltr, anod) {\n\n //console.log(\"seteo nuevos parametros\");\n this.kilovolt = kv;\n this.miliamperios = ma;\n this.modo = md;\n this.filtro = fltr;\n this.anodo = anod;\n }", "function actualitzaCopia ()\r\n{\r\n this.capa.innerHTML =insertTable (this.correcte + \"&nbsp;\",this.actual + this.putCursor ('black'), this.estil);\r\n}", "function cargarCgg_res_tipo_sanguineoCtrls(){\n if(inRecordCgg_res_tipo_sanguineo){\n txtCrtsg_codigo.setValue(inRecordCgg_res_tipo_sanguineo.get('CRTSG_CODIGO'));\n txtCrtsg_descrpcion.setValue(inRecordCgg_res_tipo_sanguineo.get('CRTSG_DESCRPCION'));\n isEdit = true;\n habilitarCgg_res_tipo_sanguineoCtrls(true);\n }}" ]
[ "0.6245995", "0.62325907", "0.612506", "0.6084603", "0.6079673", "0.6016612", "0.5992857", "0.593216", "0.592705", "0.5896207", "0.5877942", "0.5850661", "0.5768883", "0.5750453", "0.57502186", "0.5703736", "0.5697608", "0.5693314", "0.5689646", "0.5686873", "0.5686093", "0.56825256", "0.56393564", "0.563926", "0.56355834", "0.5633874", "0.5594995", "0.55915797", "0.55841136", "0.55775404", "0.5576314", "0.5574196", "0.5564285", "0.55632126", "0.55626696", "0.55605406", "0.5557373", "0.55434436", "0.55377275", "0.5533866", "0.5533866", "0.5529932", "0.5529151", "0.5502031", "0.5501352", "0.5492103", "0.5481495", "0.54775345", "0.5475785", "0.5475217", "0.5473367", "0.5449625", "0.5449586", "0.5445958", "0.5445503", "0.54416925", "0.5438467", "0.54373163", "0.5417626", "0.54145956", "0.54107964", "0.54098517", "0.5406275", "0.54056704", "0.54053575", "0.5399797", "0.5395903", "0.53948486", "0.53914255", "0.5388256", "0.5387727", "0.53871137", "0.5384556", "0.53826636", "0.5381119", "0.5379223", "0.5375861", "0.53697723", "0.53655595", "0.5363079", "0.5362773", "0.5361635", "0.5360263", "0.53590363", "0.5356567", "0.5354655", "0.53530675", "0.5352407", "0.5346567", "0.5344873", "0.5344415", "0.53442574", "0.53434163", "0.5342833", "0.53354496", "0.53299475", "0.53284764", "0.53173065", "0.53143567", "0.5313754", "0.5313555" ]
0.0
-1
LOCATING ELEMENTS IN THE DOM / FUNCTIONALITIES
function getEventsSection() { document.getElementById("ex-02-js-btn").addEventListener("click", () => {alert("You just clicked me!")}) $("#ex-02-jquery-btn").on("click", () => {alert("You just clicked me!")}) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findElements(element) {\n\n // var topElements = new Array();\n // var j = 0; \n\n var target_element_coordinates = getPageXY(element);\n var top_target_element = getTop(element);\n\n var xpathTopElements = new Array(); \n\n var all_elements_on_page = element.ownerDocument.getElementsByTagName('*'); \n\n var leaf_elements_on_page = new Array();\n var leafbutone_elements_on_page = new Array();\n var top_elements_on_page = new Array();\n var qualified_elements_on_page = new Array(); \n\n // looping through all elements to find required ones \n\n for(var i = 0; i < all_elements_on_page.length; i++){\n\n // getting current element\n\n var current_element = all_elements_on_page[i];\n\n // getting the coordinates of this element\n\n var xyCoordAllElem = getPageXY(all_elements_on_page[i]); \n var left_current_element = getLeft(current_element);\n var bottom_current_element = getBottom(current_element);\n\n // checking if the element is a leaf node, to see if it has only one child and it is a text node (3).\n\n // if( all_elements_on_page[i].childNodes.length === 1 && all_elements_on_page[i].firstChild.nodeType === 3){\n if(true){\n\n leaf_elements_on_page.push(current_element); \n // leafbutone_elements_on_page.push(current_element.parentNode); \n\n // show the target element in red \n\n if(all_elements_on_page[i] == element){\n\n // current_element.className = current_element.className + \" showinred\";\n }\n\n else { \n\n // checking if the current element is placed above the target element \n\n if(bottom_current_element <= target_element_coordinates[1] && xyCoordAllElem[1] >= 0)\n {\n\n top_elements_on_page.push(current_element);\n\n // checking if the elements quality as visible elements\n\n if((typeof current_element != 'undefined') && current_element.tagName != 'SCRIPT' && current_element.tagName != 'STYLE' && current_element.tagName != 'META' && current_element.tagName != 'NOSCRIPT' && current_element.tagName != 'TITLE' && VISIBILITY.isVisible(current_element) && current_element.tagName != 'OPTION' )\n {\n qualified_elements_on_page.push(current_element); \n // xpathTopElements.push(getPathTo(current_element)); \n\n // checking changes to the current element affects the target element. \n\n // current_element.className = current_element.className +\" increasePadding1\";\n\n\n\n var newtarget_element_coordinates = getPageXY(element); \n\n var current_element_padding = current_element.style[\"paddingTop\"];\n var current_element_margin = current_element.style[\"marginTop\"]; \n\n // changing the padding and margin by 10px\n\n current_element.style[\"paddingTop\"] = change_by_one(element.style[\"paddingTop\"], \"plus\");\n current_element.style[\"paddingTop\"] = change_by_one(element.style[\"paddingTop\"], \"plus\");\n current_element.style[\"paddingTop\"] = change_by_one(element.style[\"paddingTop\"], \"plus\");\n current_element.style[\"paddingTop\"] = change_by_one(element.style[\"paddingTop\"], \"plus\");\n current_element.style[\"paddingTop\"] = change_by_one(element.style[\"paddingTop\"], \"plus\");\n\n current_element.style[\"marginTop\"] = change_by_one(element.style[\"marginTop\"], \"plus\"); \n current_element.style[\"marginTop\"] = change_by_one(element.style[\"marginTop\"], \"plus\"); \n current_element.style[\"marginTop\"] = change_by_one(element.style[\"marginTop\"], \"plus\"); \n current_element.style[\"marginTop\"] = change_by_one(element.style[\"marginTop\"], \"plus\"); \n current_element.style[\"marginTop\"] = change_by_one(element.style[\"marginTop\"], \"plus\"); \n\n var newertarget_element_coordinates = getPageXY(element); \n\n // alert(target_element_coordinates[1]);\n\n // alert(newtarget_element_coordinates[1]); \n \n if(newertarget_element_coordinates[1] != newtarget_element_coordinates[1])\n {\n\n xpathTopElements.push(getPathTo(current_element)); \n\n // Application.console.log('element change for'+all_elements_on_page[i].tagName);*/ \n\n // all_elements_on_page[i].className = all_elements_on_page[i].className.replace(/\\bincreasePadding1\\b/,'');\n }\n\n current_element.style[\"paddingTop\"] = current_element_padding;\n current_element.style[\"marginTop\"] = current_element_margin; \n\n // else\n // {\n // Application.console.log('no change');\n // all_elements_on_page[i].className = 'increasePadding2';\n // var newtarget_element_coordinates2 = getPageXY(element);\n // if( target_element_coordinates != newtarget_element_coordinates2)\n // {\n\n // Application.console.log('element change for'+all_elements_on_page[i].tagName);\n // all_elements_on_page[i].className = all_elements_on_page[i].className.replace(/\\bincreasePadding2\\b/,'');\n // }\n // }\n }\n } \n } \n }\n\n //Application.console.log(all_elements_on_page[i]);\n }\n\n // for (var idx = 0; idx < xpathTopElements.length; idx ++)\n // {\n\n // Application.console.log(xpathTopElements[idx]);\n\n // var element = element.ownerDocument.evaluate(xpathTopElements[idx] ,element.ownerDocument, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null ).singleNodeValue; \n // element.style.border = \"2px solid green\";\n\n // }\n\n Application.console.log(\"All elements on page: \" + all_elements_on_page.length);\n Application.console.log(\"Leaf elements on page: \" + leaf_elements_on_page.length);\n // Application.console.log(\"Leaf But one elements on page: \" + leafbutone_elements_on_page.length);\n Application.console.log(\"Top and Leaf elements on page: \" + top_elements_on_page.length);\n Application.console.log(\"Qualified elements on page: \"+ qualified_elements_on_page.length );\n Application.console.log(\"Qualified and Visible Elements on page: \" + xpathTopElements.length);\n\n return xpathTopElements;\n }", "function activateElements() {\n var locationActivationTargets = scope.querySelectorAll(\"[data-vf-js-location-nearest-activation-target]\");\n if (!locationActivationTargets) {\n // exit: container not found\n return;\n }\n if (locationActivationTargets.length == 0) {\n // exit: content not found\n return;\n }\n locationActivationTargets.forEach(function (element) {\n // console.log(element.getAttribute('data-vf-js-location-nearest-activation-target'));\n if (element.getAttribute(\"data-vf-js-location-nearest-activation-target\") == locationId) {\n element.click();\n }\n });\n }", "getElements(locatorXpath_, friendlyNameOfElement) {\n try {\n var elementsArray = browser.findElements(\"xpath\", locatorXpath_);\n logger.info(\"Elements in \" + friendlyNameOfElement + \" are - \" + elementsArray);\n return elementsArray;\n\n } catch (e) {\n if (e.name !== null) {\n logger.error(friendlyNameOfElement + \" was not found - \" + e);\n assert.fail(\"'\" + friendlyNameOfElement + \"' was not found \\n\" + e);\n }\n }\n }", "function findElements(){\n\t\tfindingElements = true;\n\n\t\tanimatedElements = document.querySelectorAll(\"*[data-animation]\");\n\t\tscrollElems = [];\n\t\tfor (let elem of animatedElements){\n\t\t\tdecodeStyles(elem);\n\t\t\tif (elem.dataset.animation.includes(\"scroll\")){\n\t\t\t\tscrollElems.push(elem);\n\t\t\t}\n\t\t}\n\n\t\tfindingElements = false;\n\t}", "function getElementsFromHTML() {\n toRight = document.querySelectorAll(\".to-right\");\n toLeft = document.querySelectorAll(\".to-left\");\n toTop = document.querySelectorAll(\".to-top\");\n toBottom = document.querySelectorAll(\".to-bottom\");\n }", "function read_dom(){\n google_eles = [\n document.getElementById('viewport'),\n document.getElementById('body'),\n document.getElementById('footer'),\n document.getElementById('fbar')\n ];\n}", "initDOMElements() {\n this.DOMElement = this.app.el.querySelector('#homepage');\n\n this.characterSelector = this.DOMElement.querySelector('#character-selector');\n\n this.charactersList = this.characterSelector.querySelectorAll('.character');\n \n this.buttonStartGame = this.DOMElement.querySelector('#start-game');\n\n this.character_01 = this.characterSelector.querySelectorAll('.character_01'); \n this.character_02 = this.characterSelector.querySelectorAll('.character_02');\n this.character_03 = this.characterSelector.querySelectorAll('.character_03');\n this.character_04 = this.characterSelector.querySelectorAll('.character_04');\n\n this.character_vs_01 = this.DOMElement.querySelector('#character_vs_01');\n this.character_vs_02 = this.DOMElement.querySelector('#character_vs_02');\n }", "function Elements() {\n}", "function finder(s){\n\t\t\tlet e = element.find('[target='+s+']');\n\t\t\treturn e;\n\t\t}", "function finder(s){\n\t\t\tlet e = element.find('[target='+s+']');\n\t\t\treturn e;\n\t\t}", "function search_elements() {\n\tlet poster = elementMaker(\"img\", false, \"poster\");\n\tlet title = elementMaker(\"h3\", false, \"title\");\n\tlet year = elementMaker(\"h4\", false, \"year\");\n\tlet genre = elementMaker(\"div\", false, \"genre\");\n\tlet type = elementMaker(\"div\", false, \"type\");\n\tlet director = elementMaker(\"div\", false, \"director\");\n\tlet actors = elementMaker(\"div\", false, \"actors\");\n\tlet awards = elementMaker(\"div\", false, \"awards\");\n\tlet plot = elementMaker(\"div\", false, \"plot\");\n\tlet info_container = elementMaker(\"div\", false, \"info_container_search\");\n\n\tlet search_element_array = new Array(\n\t\tposter, title, year, genre, \n\t\ttype, director, actors, \n\t\tawards, plot, info_container);\n\treturn search_element_array;\n}", "function __(elm) { return document.querySelectorAll(elm) }", "function getSomeElement(tagName, attribName, attribValue, position){\n\tif (tagName != null){\n\t\telement = document.getElementsByTagName(tagName);\t\n\t} else {\n\t\telement = document.getElementsByTagName(\"*\");\n\t}\t\n\tresultElements = [];\n\tvar count;\n\tif (attribName != null){\n\t\tfor(count = 0; count <= element.length - 1; count++){\n\t\t\tif (element[count].getAttribute(attribName) == attribValue){\n\t\t\t\tresultElements.push(element[count]);\n\t\t\t}\n\t\t}\t\n\t} else {\n\t\tresultElements = element;\n\t};\n\tif (resultElements.length > 0){\n\t\ttry{\n\t\t\tresultElements[position].style.fontSize = \"15px\";\n\t\t\tresultElements[position].style.color = \"red\";\n\t\t} catch(error){\n\t\t\tconsole.log(error.message);\n\t\t}\n\t\treturn resultElements[position];\t\n\t} else {\n\t\treturn null;\n\t}\t\t\n}", "function MyAppGetHTMLElementsAtPoint(x,y) {\n var tags = ',';\n var e = document.elementFromPoint(x,y);\n while (e) {\n if (e.tagName) {\n tags += e.tagName + ',';\n }\n e = e.parentNode;\n }\n return tags;\n}", "function _(elm) { return document.querySelector(elm); }", "function Elements() {\n // [html, head, …]\n this.query();\n // { 'iframe-label': [html, head, …], … }\n this.queryNestedDocuments();\n // NOTE: this.documents may differ from window.nestedDocuments\n // { 'shadow-label': [html, head, …] }\n this.queryShadowHosts();\n // [html, head, … iframe, html, head, … shadowed-element, …]\n this.allElements = this.mergeElements();\n // the set we're actually working with\n this.relevantElements = this.allElements\n .filter(utils.filterLabeledElements)\n .filter(utils.removeIgnoredAttribute);\n // the elements we can actually focus from script\n this.scriptFocusableElements = this.relevantElements\n .filter(utils.filterFocusMethod);\n\n // lookup table for ident -> element,\n // also log duplicate ident use\n this.idents = this.listToMap(this.relevantElements);\n }", "findElement(elementIdentifier)\n {\n return $(elementIdentifier)\n }", "function getDOMElements(){\r\n return {\r\n squares: Array.from(document.querySelectorAll(\".grid div\")),\r\n firstSquare: function(){ return this.squares[30] },\r\n squaresInActiveGameplace: Array.from(grid.querySelectorAll(\".activegameplace\")),\r\n firstSquareInRow: document.querySelectorAll(\".first-in-row\"),\r\n lastSquareInRow: document.querySelectorAll(\".last-in-row\"),\r\n music: document.getElementById(\"myAudio\")\r\n }\r\n}", "function get_place_to_append() {\r\n var canidates = ['crosscol-wrapper','navbar','main-wrapper'];\r\n for (i=0;i<canidates.length;i++) {\r\n var e = document.getElementById(canidates[i]);\r\n if (e) return e;\r\n }\r\n return null;\r\n}//get_place_to_append", "function _selectElements(){\n\t\t//Fill in variables wil selected elements\n\t\t$header = $('#header');\n\t\t$content = $('#main');\n\t\t$areaBegin = $(\"#begin-area\");\n\t\t$areaDisplay = $(\"#display-area\");\n\t\t$dropMore = $(\"#drop-area-more\");\n\t\t$output = $(\"#output\")\n\t\t$parserErrorDisplay = $('#parser-error-display');\n\t\t$donationNag = $(\"#many-songs-please-donate\");\n\t\t$totalSongCountDisplay = $(\"#total-song-count\");\n\t}", "getElem(selector, scope) {\n return this.getElementByXPath(selector, scope);\n }", "getElem(selector, scope) {\n return this.getElementByXPath(selector, scope);\n }", "function insertDom(element){\n\n}", "function __( el )\n{\n return document.querySelectorAll( el );\n}", "function _initDom() {\n _$search = _$navbar.find(_SEL_SEARCH);\n _$clear = _$navbar.find(_SEL_CLEAR);\n _$drpdwn = _$navbar.find(_SEL_DROPDOWN);\n _$head = _$navbar.find(_SEL_HEADING);\n _$btnL = _$navbar.find(_SEL_BUTTON).first();\n _$btnR = _$navbar.find(_SEL_BUTTON).last();\n _$sort = _$drpdwn.find(_SEL_SORT);\n }", "findElement(selector) {\n return document.querySelector(selector);\n }", "function walkElementsLinear(func,node) {\n\t var root = node || window.document;\n\t var nodes = root.getElementsByTagName(\"*\");\n\t for(var i = 0 ; i < nodes.length ; i++) {\n\t func.call(nodes[i]);\n\t }\n\t}", "function searchPage_elementsExtraJS() {\n // screen (searchPage) extra code\n /* useProfileToggle */\n $(\"#searchPage_useProfileToggle\").parent().find(\".ui-flipswitch-on\").attr(\"tabindex\", \"1\");\n /* useLocationToggle */\n $(\"#searchPage_useLocationToggle\").parent().find(\".ui-flipswitch-on\").attr(\"tabindex\", \"4\");\n /* distanceSelect */\n $(\"#searchPage_distanceSelect\").parent().find(\"a.ui-btn\").attr(\"tabindex\", \"9\");\n /* ingredientPopup */\n $(\"#searchPage_ingredientPopup\").popup(\"option\", \"positionTo\", \"window\");\n /* distancePopup */\n $(\"#searchPage_distancePopup\").popup(\"option\", \"positionTo\", \"window\");\n /* ratingPopup */\n $(\"#searchPage_ratingPopup\").popup(\"option\", \"positionTo\", \"window\");\n /* cuisinePopup */\n $(\"#searchPage_cuisinePopup\").popup(\"option\", \"positionTo\", \"window\");\n /* pricePopup */\n $(\"#searchPage_pricePopup\").popup(\"option\", \"positionTo\", \"window\");\n /* dietaryPopup */\n $(\"#searchPage_dietaryPopup\").popup(\"option\", \"positionTo\", \"window\");\n /* loginPopup */\n $(\"#searchPage_loginPopup\").popup(\"option\", \"positionTo\", \"window\");\n }", "function $DOM(elementHint, elementIndex){\n /* // in case non-css selector gets required \n var first_char = elementHint.match(/^./)[0];\n\tvar rest_chars = elementHint.replace(/^./, ''); */\n \t\n var str_nodes = document.querySelectorAll(elementHint);\n if (elementIndex === undefined) {\n elementIndex = 0;\n }\n\treturn str_nodes[elementIndex];\n}", "function gatherElements () {\n elements = {\n main: $element[0],\n scrollContainer: $element[0].getElementsByClassName('md-virtual-repeat-container')[0],\n scroller: $element[0].getElementsByClassName('md-virtual-repeat-scroller')[0],\n ul: $element.find('ul')[0],\n input: $element.find('input')[0],\n wrap: $element.find('md-autocomplete-wrap')[0],\n root: document.body\n };\n elements.li = elements.ul.getElementsByTagName('li');\n elements.snap = getSnapTarget();\n elements.$ = getAngularElements(elements);\n }", "function gatherElements () {\n elements = {\n main: $element[0],\n scrollContainer: $element[0].getElementsByClassName('md-virtual-repeat-container')[0],\n scroller: $element[0].getElementsByClassName('md-virtual-repeat-scroller')[0],\n ul: $element.find('ul')[0],\n input: $element.find('input')[0],\n wrap: $element.find('md-autocomplete-wrap')[0],\n root: document.body\n };\n elements.li = elements.ul.getElementsByTagName('li');\n elements.snap = getSnapTarget();\n elements.$ = getAngularElements(elements);\n }", "function getEl(target, all) { \n return function(fn) { \n if(all === true) {\n return (exists(document.querySelector(target))) ? fn(document.querySelectorAll(target)) : fail('element is not found'+ target); \n } else {\n return (exists(document.querySelector(target))) ? fn(document.querySelector(target)) : fail('element is not found'+ target); \n }\n } \n }", "function search(elements, start) {\n\t var list = [];\n\t pubNubCore.each(elements.split(/\\s+/), function (el) {\n\t pubNubCore.each((start || document).getElementsByTagName(el), function (node) {\n\t list.push(node);\n\t });\n\t });\n\t return list;\n\t}", "function _gatherElements() {\n return jQuery('*[id]')\n .toArray()\n // use jQuery instances\n .map(function(oElement) {\n return jQuery(oElement);\n })\n .filter(function($element) {\n // is at least part of a control\n return $element.control().length > 0 &&\n // is the root of a control\n $element.attr('id') === $element.control()[0].getId();\n });\n }", "findSearchFields(){\n\t\tthis.driver.findElement(By.id('keywords'));\n\t\tthis.driver.findElement(By.id('location'));\n\t\tthis.driver.findElement(By.id('RadialLocation'));\n\t}", "function setInspectedElement() {\n return Array.from(document.querySelectorAll('*')).findIndex((el) => el === $0);\n }", "function findOffers() {\n return document.getElementById('offers');\n}", "getElements(){\n const thisWidget = this; \n \n thisWidget.dom.input = thisWidget.dom.wrapper.querySelector(select.widgets.amount.input);\n thisWidget.dom.linkDecrease = thisWidget.dom.wrapper.querySelector(select.widgets.amount.linkDecrease);\n thisWidget.dom.linkIncrease = thisWidget.dom.wrapper.querySelector(select.widgets.amount.linkIncrease);\n }", "function elem(elemName){var getElem=document.getElementById(elemName); return getElem;}", "function DOMImplementation() {}", "function DOMImplementation() {}", "function DOMImplementation() {}", "function DOMImplementation() {}", "function _( el )\n{\n return document.querySelector( el );\n}", "get elements() {\n return browser.elements(this._selector);\n }", "function find(id){\n var elem = document.getElementById(id);\n return elem;\n}", "function scanDOM() {\n if (!SimpleSVG.isReady) {\n return;\n }\n\n // Find new icons\n findNewIcons();\n }", "loadElements()\n {\n\n this.el = {};\n\n document.querySelectorAll('[id]').forEach(element => \n {\n this.el[Format.getCamelCase(element.id)] = element\n });\n }", "function selector(a,b){var a=a.match(/^(\\W)?(.*)/),b=b||document,c=b[\"getElement\"+(a[1]?\"#\"==a[1]?\"ById\":\"sByClassName\":\"sByTagName\")],d=c.call(b,a[2]),e=[];return null!==d&&(e=d.length||0===d.length?d:[d]),e}", "function selector(a,b){var a=a.match(/^(\\W)?(.*)/),b=b||document,c=b[\"getElement\"+(a[1]?\"#\"==a[1]?\"ById\":\"sByClassName\":\"sByTagName\")],d=c.call(b,a[2]),e=[];return null!==d&&(e=d.length||0===d.length?d:[d]),e}", "function selector(a,b){var a=a.match(/^(\\W)?(.*)/),b=b||document,c=b[\"getElement\"+(a[1]?\"#\"==a[1]?\"ById\":\"sByClassName\":\"sByTagName\")],d=c.call(b,a[2]),e=[];return null!==d&&(e=d.length||0===d.length?d:[d]),e}", "function tx(locator) {\nif (casper.exists(x(locator))) return x(locator);\nif (casper.exists(x('//*[contains(@id,\"'+locator+'\")]'))) return x('//*[contains(@id,\"'+locator+'\")]');\nif (casper.exists(x('//*[contains(@name,\"'+locator+'\")]'))) return x('//*[contains(@name,\"'+locator+'\")]');\nif (casper.exists(x('//*[contains(@class,\"'+locator+'\")]'))) return x('//*[contains(@class,\"'+locator+'\")]');\nif (casper.exists(x('//*[contains(@title,\"'+locator+'\")]'))) return x('//*[contains(@title,\"'+locator+'\")]');\nif (casper.exists(x('//*[contains(text(),\"'+locator+'\")]'))) return x('//*[contains(text(),\"'+locator+'\")]');\nelse return x('/html');}", "function $(identifier, altParent, returnAll)\r\n{\r\n var obj = null, objs = null;\r\n doc = altParent ? altParent : document;\r\n if(identifier.indexOf(\".\") == 0)\r\n {\r\n identifier = identifier.replace(\".\",\"\");\r\n objs = doc.getElementsByClassName(identifier);\r\n }\r\n else if(identifier.indexOf(\"<\") == 0)\r\n {\r\n identifier = identifier.replace(\"<\",\"\").replace(\">\",\"\");\r\n objs = doc.getElementsByTagName(identifier);\r\n }\r\n else\r\n {\r\n obj = doc.getElementById(identifier);\r\n if(!obj)\r\n objs = doc.getElementsByName(identifier);\r\n }\r\n if(objs && objs.length > 0)\r\n {\r\n if(returnAll)\r\n return objs;\r\n else\r\n return objs[0];\r\n } \r\n else\r\n return obj;\r\n}", "function generateHTMLElements() {\n // select page header\n const searchContainer = pageContainer.querySelector('.page-header');\n // create div element for search function\n let searchDiv = document.createElement('div');\n // create search input\n searchInput = document.createElement('input');\n // create info message placeholder\n infoMessage = document.createElement('p');\n // set class for search div\n searchDiv.className = 'student-search';\n // set placeholder value for search input\n searchInput.placeholder = 'Search for students...';\n \n // append info message to page container\n pageContainer.appendChild(infoMessage);\n // append search input to search div\n searchDiv.appendChild(searchInput);\n // append search div to search container\n searchContainer.appendChild(searchDiv);\n}", "function getElement(names) {\n if (typeof names === 'string') {\n names = names.split('.');\n }\n if (names.length === 0) {\n return container;\n }\n const selector = names\n .map((name) => {\n return '[data-element=\"' + name + '\"]';\n })\n .join(' ');\n\n return container.querySelector(selector);\n }", "function search( elements, start) {\n var list = [];\n each( elements.split(/\\s+/), function(el) {\n each( (start || document).getElementsByTagName(el), function(node) {\n list.push(node);\n } );\n });\n return list;\n}", "function eachElement (elements, callback) {\n if (elements.nodeType) {\n elements = [elements];\n } else if (typeof elements === 'string') {\n elements = document.querySelectorAll(selector(elements));\n }\n\n for (var a = 0; a < elements.length; a++) {\n if (elements[a].nodeType === 1) {\n callback(elements[a], a);\n }\n }\n }", "indexOf(elemento){}", "findElements() {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n const es = [];\r\n const ids = yield this.findElementIds();\r\n ids.forEach(id => {\r\n const e = new Element(this.http.newClient(''), id);\r\n es.push(e);\r\n });\r\n return es;\r\n });\r\n }", "function $(elm_id){\r\n \treturn document.getElementById(elm_id);\r\n }", "function $(elm_id){\r\n \treturn document.getElementById(elm_id);\r\n }", "function custInj() {\n // do something with the selected element\n}", "function addElements(tElements, oElements, addHandler) {\n tIndexes = {};\n _.forEach(tElements, function(element) {\n addHandler(element);\n });\n _.forEach(oElements, function(element) {\n var i = tIndexes[element.id];\n // not found, then just push it in\n if (typeof i === \"undefined\")\n addHandler(element);\n // otherwise, 50/50 of using oNode\n else if (Utils.randomBool())\n addHandler(element, i);\n });\n }", "function _findElements(domRoot) {\n\t\tlet items = Array.from(domRoot.querySelectorAll(`[${DOM_SELECTOR}]`));\n\t\tif (domRoot.hasAttribute(DOM_SELECTOR)) {\n\t\t\titems.push(domRoot);\n\t\t}\n\n\t\titems.forEach(function (item) {\n\t\t\tif (!item[DOM_ATTRIBUTE]) {\n\t\t\t\titem[DOM_ATTRIBUTE] = new _constructor(item);\n\t\t\t}\n\t\t});\n\t}", "function findElement(elem, tagName) {\r\n\twhile (elem.parentNode && (!elem.tagName || (elem.tagName.toUpperCase() != tagName.toUpperCase()))){\r\n\t\telem = elem.parentNode;\r\n\t}\r\n\treturn elem;\r\n}", "function getElt () \n{ if (is.nav4)\n {\n var currentLayer = document.layers[getElt.arguments[0]];\n for (var i=1; i<getElt.arguments.length && currentLayer; i++)\n { currentLayer = currentLayer.document.layers[getElt.arguments[i]];\n }\n return currentLayer;\n } \n else if(document.getElementById && document.getElementsByName)\n { \n var name = getElt.arguments[getElt.arguments.length-1];\n if(document.getElementById(name)) //First try to find by id\n return document.getElementById(name);\n else if (document.getElementsByName(name)) //Then if that fails by name\n\t return document.getElementsByName(name)[0];\n }\n else if (is.ie4up) {\n var elt = eval('document.all.' + getElt.arguments[getElt.arguments.length-1]);\n return(elt);\n }\n\n}", "getElements(selector) {\n let elements = Array.from(\n document.querySelectorAll('bolt-image'),\n ).map(elem =>\n elem.renderRoot\n ? elem.renderRoot.querySelector(selector)\n : elem.querySelector(selector),\n );\n elements = elements.filter(function(el) {\n return el != null;\n });\n return elements;\n }", "function identify_elements( init ) {\n that[ init ? 'addClass' : 'removeClass' ]( sphere3d );\n \n function set_id( point, elem, id, id_prop ) {\n if ( init ) {\n if ( !elem.attr( 'id' ) ) {\n point[ id_prop + 'no' ] = true;\n elem.attr( 'id', id );\n }\n point[ id_prop ] = elem.attr( 'id' );\n \n } else if ( point[ id_prop + 'no' ] ) {\n elem.removeAttr( 'id' );\n }\n };\n \n $.each( points, function( i, point ) {\n var elem = point.elem,\n elem_o,\n c = uid + '-' + i;\n \n set_id( point, elem, c, 'e_id' );\n \n if ( elems_opacity ) {\n elem_o = point.elem_o = elems_opacity === true ? elem : elem.find( elems_opacity );\n set_id( point, elem_o, c + '-o', 'o_id' );\n }\n });\n }", "function getDomElement() {\n return getElement();\n } // ========================== Motion End ==========================", "function findPos(elem) {\n var top = 0;\n if (elem.offsetParent) {\n do {\n top += elem.offsetTop;\n } while (elem = elem.offsetParent);\n return [top];\n }\n}", "function returnElementArray($container) {\n var nsp = '[data-' + ns + ']',\n // if an $el was given, then we scope our query to just look within the element\n DOM = $container ? $container.find(nsp) : $(nsp);\n\n return DOM;\n }", "function explore($dom) {\n var methods = [TIME_ELEMENT, ABBR_ELEMENT, TEXT_SEARCH],\n results = recursiveExplore($dom, methods, '', true);\n\n // Filter results, to get a consistent signature.\n results = filterResults(results);\n\n // Add titles to results.\n setMetaInformation(results);\n\n return results;\n }", "function DOMImplementation() {\n}", "function DOMImplementation() {\n}", "function gatherElements(){elements={main:$element[0],scrollContainer:$element[0].querySelector('.md-virtual-repeat-container'),scroller:$element[0].querySelector('.md-virtual-repeat-scroller'),ul:$element.find('ul')[0],input:$element.find('input')[0],wrap:$element.find('md-autocomplete-wrap')[0],root:document.body};elements.li=elements.ul.getElementsByTagName('li');elements.snap=getSnapTarget();elements.$=getAngularElements(elements);inputModelCtrl=elements.$.input.controller('ngModel');}", "function $()\r\n{\r\n var elements = new Array();\r\n\r\n for (var i = 0; i < arguments.length; i++)\r\n {\r\n var element = arguments[i];\r\n if (typeof element == 'string')\r\n {\r\n if (document.getElementById)\r\n {\r\n element = document.getElementById(element);\r\n }\r\n else if (document.all)\r\n {\r\n element = document.all[element];\r\n }\r\n }\r\n\r\n if (arguments.length == 1) \r\n {\r\n return element;\r\n }\r\n\r\n elements.push(element);\r\n }\r\n\r\n return elements;\r\n}", "function prendiElementoDaId(id_elemento) \r\n{\r\n\tvar elemento;\r\n\tif(document.getElementById)\r\n\t{\r\n\t\telemento = document.getElementById(id_elemento);\r\n\t}\r\n\telse\r\n\t{\r\n\t\telemento = document.all[id_elemento];\r\n\t}\r\n\treturn elemento;\r\n}", "onSourceLoad(){\n let elements = RVRreport.queryElements(this.document);\n if(elements != null){\n elements.forEach(el=>RVRreport.elementDetection(el));\n }\n }", "function gatherElements () {\n\n var snapWrap = gatherSnapWrap();\n\n elements = {\n main: $element[0],\n scrollContainer: $element[0].querySelector('.md-virtual-repeat-container, .md-standard-list-container'),\n scroller: $element[0].querySelector('.md-virtual-repeat-scroller, .md-standard-list-scroller'),\n ul: $element.find('ul')[0],\n input: $element.find('input')[0],\n wrap: snapWrap.wrap,\n snap: snapWrap.snap,\n root: document.body,\n };\n\n elements.li = elements.ul.getElementsByTagName('li');\n elements.$ = getAngularElements(elements);\n mode = elements.scrollContainer.classList.contains('md-standard-list-container') ? MODE_STANDARD : MODE_VIRTUAL;\n inputModelCtrl = elements.$.input.controller('ngModel');\n }", "function listDomElements() {\n\t var children = document.body.childNodes;\n\t var i;\n\n\t for (i = 0; i < children.length; i = i + 1) {\n\t console.log(children[i]);\n\t }\n\t}", "function lookupNodes(){\n\t\tif( typeof(arg) == 'string') {\n\t\tvar selector = arg;\n\t\tsatellite.cssQuery(selector, function(matched) {\n\t\t\tnodes = matched;\n\t\t});\n\t\t} else if(Array.isArray(arg) == true){\n\t\t\tnodes = arg;\n\t\t} else if(arg == eam.global || arg == eam.context || arg && arg.parentNode){\n\t\t\tnodes = [arg];\n\t\t} else {\n\t\t\tnodes = [];\n\t\t}\n\t\tnode = nodes[0];\n\t}", "function setAllVisibleElementsInfo(){\n $jQ('body *:visible, ['+vars.actions+'=\"user\"]').each(function() {\n var e = $jQ(this);\n var tag = e.prop(\"tagName\");\n if(tag!=\"BR\" && tag!=\"SCRIPT\" && tag!=\"IFRAME\"){\n setActions(e);\n setColorInfo(e,'');\n setFontInfos(e);\n setSizes(e);\n setPositions(e);\n setBorder(e);\n setTextTransform(e);\n setZIndex(e);\n }\n });\n}", "function getEls() {\n // We're cheating a bit on styles.\n let preStyleEl = document.createElement('style');\n preStyleEl.textContent = preStyles;\n document.head.insertBefore(preStyleEl, document.getElementsByTagName('style')[0]);\n\n // El refs\n style = document.getElementById('style-tag');\n styleEl = document.getElementById('style-text');\n workEl = document.getElementById('work-text');\n pgpEl = document.getElementById('heart');\n skipAnimationEl = document.getElementById('skip-animation');\n pauseEl = document.getElementById('pause-resume');\n}", "function getClassTags() {\n for (var index = 0; index < htmlContentObjects.length; index++) {\n console.log('loading dom for: ' + htmlContentObjects[index][0]);\n var html = htmlContentObjects[index];\n loadHTML(html);\n }\n}", "function get_element(doc_el, name, idx) {\n var element = doc_el.getElementsByTagName(name);\n return element[idx].firstChild.data;\n }", "findSectorLists(){\n\t\tthis.driver.findElement(By.linkText('Banking and finance'));\n\t\tthis.driver.findElement(By.linkText('Business services'));\n\t\tthis.driver.findElement(By.linkText('IT and telecoms'));\n\t\tthis.driver.findElement(By.linkText('Government'));\n\t}", "getElement(){return this.__element}", "function $() {\n var elements = new Array();\n for (var i = 0; i < arguments.length; i++) {\n var element = arguments[i];\n if (typeof element == 'string')\n element = document.getElementById(element);\n if (arguments.length == 1)\n return element;\n elements.push(element);\n }\n return elements;\n}", "get SanJoseButttom () { return $('//*[@id=\"landingPage\"]/div[1]/div[2]/div[2]/div/div[2]/div[1]/div[1]/div[1]/div/div[1]/div[2]/div/div[1]/div') }", "function cashElements() {\n form = global.document.querySelector(\"#todo-form\");\n input = global.document.querySelector(\"#todo-input\");\n todoList = global.document.querySelector(\"#todo-list\");\n allButton = global.document.querySelector(\"#all\");\n pendingButton = global.document.querySelector(\"#pending\");\n doneButton = global.document.querySelector(\"#done\");\n clearButton = global.document.querySelector(\"#clear-all-todos\");\n }", "get listOfCardElements() { return $$(\".card\"); }", "function el(target, parent) {\n return (parent || doc).querySelector(target);\n }", "function eachElemsForPath(elems, path, func) {\n each(elems, function(e){\n var reg = e.getAttribute(\"data-regexp\");\n if (path.match(RegExp(reg))) {\n func(e.parentNode.cloneNode(true));\n }\n })\n }", "function applyToAllElements(fn, type) {\n var c = document.getElementsByTagName(type);\n for (var j = 0; j < c.length; j++) {\n fn(c[j]);\n }\n}", "finisher(clazz){window.customElements.define(tagName,clazz)}", "static getElementPosition(el, parentClass?) {\n\tlet xPos = 0;\n\tlet yPos = 0;\n\twhile (el) {\n\t if (el.classList && this.classCont(el, parentClass)) {\n\t\tbreak;\n\t }\n\t\t// special for body tag (browser compatibility)\n\t if (el.tagName == 'BODY') {\n\t\tlet xScroll = el.scrollLeft || document.documentElement.scrollLeft;\n\t\tlet yScroll = el.scrollTop || document.documentElement.scrollTop;\n\t\txPos += (el.offsetLeft - xScroll + el.clientLeft);\n\t\tyPos += (el.offsetTop - yScroll + el.clientTop);\n\t }\n\t else {\n\t\t// for all other elements\n\t\txPos += (el.offsetLeft - el.scrollLeft + el.clientLeft);\n\t\tyPos += (el.offsetTop - el.scrollTop + el.clientTop);\n\t }\n\t if (\n\t\tel.tagName == 'TD' || el.tagName == 'TH' ||\n\t\tel.tagName == 'TR' ||\n\t\tel.tagName == 'TBODY' || el.tagName == 'THEAD'\n\t ) {\n\t\tel = this.findParents(el, false, 'table');\n\t }\n\t else {\n\t\tel = el.offsetParent;\n\t }\n\t console.log(el);\n\t}\n\tconsole.log(xPos, yPos);\n\treturn {\n\t x: xPos,\n\t y: yPos\n\t};\n }", "function getAnchorTagsFromMarkup () {\n $('a');\n $('.link');\n $('[href=\"#\"]');\n $('#fizz > *');\n $('#foo *:not(div)');\n }", "function getElement(){\n return document.querySelector('.webdoc_expression_wrapper');\n }", "findControls() {\n\t\tthis.hiderElement = this.container.querySelector(this.hiderElementSelector);\n\t\tthis.showerElement = this.container.querySelector(this.showerElementSelector);\n\t}", "function addEl(param1, param2, param3){\n\tvar element, docFrag;\n\tdocFrag = document.createDocumentFragment();\n\n\tfor(var i = 0; i < param2.length; i++){\n\t\tvar div \t= document.createElement('div');\n\t\tdiv.innerHTML = param2[i];\n\t\tdocFrag.appendChild(div);\n\t}\n\tconsole.log(docFrag);\nif()\n\n\tif(param3){\n\n\t\t//dom element\n\t\telement = document.getElementsByTagName(param1)[0];\nconsole.log(element);\n\t\t//element.appendChild(docFrag);\n\n\t} else {\n\t\t//id\n\t\telement = document.getElementById(param1);\n\t\tif(!element){\n\t\t\tconsole.log('No such element');\n\t\t}\n\t\t//element.appendChild(docFrag);\n\t}\n}", "function gatherElements () {\n elements = {\n main: $element[0],\n scrollContainer: $element[0].querySelector('.md-virtual-repeat-container'),\n scroller: $element[0].querySelector('.md-virtual-repeat-scroller'),\n ul: $element.find('ul')[0],\n input: $element.find('input')[0],\n wrap: $element.find('md-autocomplete-wrap')[0],\n root: document.body\n };\n\n elements.li = elements.ul.getElementsByTagName('li');\n elements.snap = getSnapTarget();\n elements.$ = getAngularElements(elements);\n\n inputModelCtrl = elements.$.input.controller('ngModel');\n }" ]
[ "0.6579426", "0.60839546", "0.60611856", "0.59836286", "0.5909414", "0.5905388", "0.5891326", "0.58846474", "0.5829889", "0.5829889", "0.5812836", "0.58108157", "0.5808733", "0.5792669", "0.5791788", "0.5726173", "0.57077944", "0.5702382", "0.5691261", "0.566715", "0.56555957", "0.56555957", "0.5644631", "0.5641373", "0.563796", "0.56374186", "0.5628832", "0.5619044", "0.5603091", "0.5577872", "0.5577872", "0.55769604", "0.55487573", "0.55405986", "0.5530836", "0.5524896", "0.5512748", "0.5510718", "0.5498118", "0.548626", "0.548626", "0.548626", "0.548626", "0.5471276", "0.54577607", "0.5448267", "0.54449356", "0.54446787", "0.5414413", "0.5414413", "0.5414413", "0.5412745", "0.54018295", "0.5399518", "0.53932697", "0.53817713", "0.537464", "0.5350529", "0.53452384", "0.5345112", "0.5345112", "0.5342817", "0.5335071", "0.53332853", "0.5332532", "0.53313595", "0.53197265", "0.53136665", "0.531149", "0.52995056", "0.52979743", "0.5297157", "0.52757794", "0.52757794", "0.52712816", "0.5270511", "0.52703243", "0.52694136", "0.52539027", "0.5247374", "0.52469444", "0.5232968", "0.52303994", "0.5228094", "0.52207917", "0.52184373", "0.520708", "0.5194906", "0.5186091", "0.5184662", "0.5182993", "0.5176529", "0.51712734", "0.51657885", "0.5159387", "0.515925", "0.5158124", "0.5153535", "0.5153214", "0.51524884", "0.5148967" ]
0.0
-1
Constructs the API payload request map based on properties of ApiRequest
function buildMap(apiRequest) { var keyValueMap = {}; keyValueMap["transaction.id"] = apiRequest.transactionId; keyValueMap["order.id"] = apiRequest.orderId; keyValueMap["merchant"] = config.TEST_GATEWAY.MERCHANTID; keyValueMap["sourceOfFunds.type"] = "CARD"; keyValueMap["session.id"] = apiRequest.sessionId; keyValueMap["order.currency"] = apiRequest.orderCurrency; keyValueMap["apiOperation"] = "PAY"; keyValueMap["order.amount"] = apiRequest.orderAmount; return keyValueMap; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "buildArgs() {\n let args = {};\n\n // Skip any url parameters (e.g. items that begin with $)\n for (let key in this.givenArgs) {\n if (key.substring(0, 1) !== '$') {\n args[key] = this.givenArgs[key];\n }\n }\n\n let apiType = u.thisOrThat(this.contextOptions.api_type,\n this._userConfig.apiType);\n\n if (apiType) {\n args.api_type = apiType;\n }\n\n return args;\n }", "toMap() {\n const result = {};\n if (this.headers && Object.keys(this.headers).length > 0) {\n result[HEADERS] = setLowerCase(this.headers);\n }\n if (this.cookies && Object.keys(this.cookies).length > 0) {\n result[COOKIES] = setLowerCase(this.cookies);\n }\n if (this.session && Object.keys(this.session).length > 0) {\n result[SESSION] = setLowerCase(this.session);\n }\n if (this.method) {\n result[METHOD] = this.method;\n }\n if (this.ip) {\n result[IP] = this.ip;\n }\n if (this.url) {\n result[URL_LABEL] = this.url;\n }\n if (this.timeoutSeconds != -1) {\n result[TIMEOUT] = this.timeoutSeconds;\n }\n if (this.filename) {\n result[FILE_NAME] = this.filename;\n }\n if (this.contentLength != -1) {\n result[CONTENT_LENGTH] = this.contentLength;\n }\n if (this.streamRoute) {\n result[STREAM] = this.streamRoute;\n }\n if (this.body) {\n result[BODY] = this.body;\n }\n if (this.queryString) {\n result[QUERY] = this.queryString;\n }\n if (this.upload) {\n result[UPLOAD] = this.upload;\n }\n const hasPathParams = Object.keys(this.pathParams).length > 0;\n const hasQueryParams = Object.keys(this.queryParams).length > 0;\n if (hasPathParams || hasQueryParams) {\n const parameters = {};\n result[PARAMETERS] = parameters;\n if (hasPathParams) {\n parameters[PATH] = setLowerCase(this.pathParams);\n }\n if (hasQueryParams) {\n parameters[QUERY] = setLowerCase(this.queryParams);\n }\n }\n result[HTTPS] = this.https;\n /*\n * Optional HTTP host name in the \"relay\" field\n *\n * This is used by the rest-automation \"async.http.request\" service\n * when forwarding HTTP request to a target HTTP endpoint.\n */\n if (this.targetHost) {\n result[TARGET_HOST] = this.targetHost;\n result[TRUST_ALL_CERT] = this.trustAllCert;\n }\n return result;\n }", "buildRequestDetails() {\n\t\tlet\n\t\t\tpath = this.pathGen(),\n\t\t\toptions = {\n\t\t\t\tmethod: this.request.method,\n\t\t\t\theaders: {\n\t\t\t\t\t...(this.request.files.length ? {} : {\n\t\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t\t\tAccept: 'application/json',\n\t\t\t\t\t}),\n\t\t\t\t\t...this.request.metas,\n\t\t\t\t},\n\t\t\t\tcredentials: 'same-origin'\n\t\t\t};\n\n\t\tif(this.request.method !== 'get' && this.request.method !== 'head') {\n\t\t\tif(this.request.files.length) {\n\t\t\t\tconst formData = new FormData();\n\n\t\t\t\tfor(const file of this.request.files) {\n\t\t\t\t\tformData.append('files', file);\n\t\t\t\t}\n\n\t\t\t\tformData.append('data', JSON.stringify(this.request.data));\n\n\t\t\t\toptions.body = formData;\n\t\t\t}\n\t\t\telse {\n\t\t\t\toptions.body = JSON.stringify(this.request.data);\n\t\t\t}\n\t\t}\n\n\t\tthis.requestDetails = {\n\t\t\tpath,\n\t\t\toptions\n\t\t};\n\t}", "setRequestProperties (req) {\n const uri = this.parseUri(req.url)\n for (const key in uri) {\n req[key] = uri[key]\n }\n }", "function requestSubtypeMapping(uploadRequestParamArr,requestID) {\n\t\t\t\t\n\tvar mapping=\"\",requestMessage,requestButton;\n\tmapping = {\n\t\t\t'{requestMessage}': removeNull(uploadRequestParamArr[\"requestMessage\"]), \n\t\t\t'{requestButton}':removeNull(uploadRequestParamArr[\"requestButton\"]), \n\t\t\t'{requestID}':requestID,\n\t\t\t'{requestClass}':\"js-uploadRequest\" \n\t\t\t};\n return mapping;\n}", "getRequest() {\n return {\n type: this.type,\n payload: {}\n };\n }", "map(mappedFields) {\n this.argv = {};\n for (let i in mappedFields) {\n let path = mappedFields[i].split('.');\n let p1 = path.shift(),\n targetObj;\n if (p1 == \"POST\")\n targetObj = this.configs.HTTPRequest.request.body;\n else if (p1 == \"PATCH\")\n targetObj = this.configs.HTTPRequest.request.body;\n else if (p1 == \"GET\")\n targetObj = this.configs.HTTPRequest.request.query;\n else if (p1 == \"PATH\")\n targetObj = this.configs.HTTPRequest.request.params;\n else if (p1 == \"DELETE\")\n targetObj = this.configs.HTTPRequest.request.body;\n else if (p1 == \"DATA\")\n targetObj = this.data;\n else if (p1 == \"ERROR\")\n targetObj = this.error;\n else if (p1 == \"MODEL\")\n targetObj = this.model;\n else if (p1 == \"USER\")\n targetObj = this.user;\n else\n continue;\n this.argv[i] = Utill.ArrayLib.resolvePath(targetObj, path);\n }\n return this;\n }", "getSupportedAPIs() {\n const apiMap = {};\n Object.keys(apis.APIS).forEach(a => {\n apiMap[a] = Object.keys(apis.APIS[a]);\n });\n return apiMap;\n }", "get_request_kwargs() {\n return {}\n }", "function buildRequestParams(batch) {\n let params = {\n RequestItems: {}\n };\n params.RequestItems['bugatchi'] = batch.map(obj => {\n return obj.map(innerObj => {\n let item = {};\n CSV_KEYS.forEach((keyName) => {\n if (innerObj[keyName] && innerObj[keyName].length > 0) {\n item[keyName] = innerObj[keyName]\n }\n });\n return {\n PutRequest: {\n Item: item\n }\n }\n });\n })[0];\n return params;\n}", "static merge(...requestBodies) {\n const result = new RequestBody();\n return requestBodies.reduce((base, requestBody) => {\n base.stringData = requestBody.stringData || base.stringData;\n Object.assign(base.objectData, requestBody.objectData);\n return base;\n }, result);\n }", "function createApiRequest(apiKey) {\n var apiRequest = request.defaults({\n auth: {\n bearer: apiKey\n }\n });\n\n return apiRequest;\n}", "function extractRequestData(req, keys) {\n if (keys === void 0) { keys = DEFAULT_REQUEST_KEYS; }\n var requestData = {};\n // headers:\n // node, express, nextjs: req.headers\n // koa: req.header\n var headers = (req.headers || req.header || {});\n // method:\n // node, express, koa, nextjs: req.method\n var method = req.method;\n // host:\n // express: req.hostname in > 4 and req.host in < 4\n // koa: req.host\n // node, nextjs: req.headers.host\n var host = req.hostname || req.host || headers.host || '<no host>';\n // protocol:\n // node, nextjs: <n/a>\n // express, koa: req.protocol\n var protocol = req.protocol === 'https' || req.secure || (req.socket || {}).encrypted\n ? 'https'\n : 'http';\n // url (including path and query string):\n // node, express: req.originalUrl\n // koa, nextjs: req.url\n var originalUrl = (req.originalUrl || req.url || '');\n // absolute url\n var absoluteUrl = protocol + \"://\" + host + originalUrl;\n keys.forEach(function (key) {\n switch (key) {\n case 'headers':\n requestData.headers = headers;\n break;\n case 'method':\n requestData.method = method;\n break;\n case 'url':\n requestData.url = absoluteUrl;\n break;\n case 'cookies':\n // cookies:\n // node, express, koa: req.headers.cookie\n // vercel, sails.js, express (w/ cookie middleware), nextjs: req.cookies\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n requestData.cookies = req.cookies || cookie.parse(headers.cookie || '');\n break;\n case 'query_string':\n // query string:\n // node: req.url (raw)\n // express, koa, nextjs: req.query\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n requestData.query_string = req.query || url.parse(originalUrl || '', false).query;\n break;\n case 'data':\n if (method === 'GET' || method === 'HEAD') {\n break;\n }\n // body data:\n // express, koa, nextjs: req.body\n //\n // when using node by itself, you have to read the incoming stream(see\n // https://nodejs.dev/learn/get-http-request-body-data-using-nodejs); if a user is doing that, we can't know\n // where they're going to store the final result, so they'll have to capture this data themselves\n if (req.body !== undefined) {\n requestData.data = utils_1.isString(req.body) ? req.body : JSON.stringify(utils_1.normalize(req.body));\n }\n break;\n default:\n if ({}.hasOwnProperty.call(req, key)) {\n requestData[key] = req[key];\n }\n }\n });\n return requestData;\n}", "async prepareRequest(httpRequest) {\n const requestInit = {};\n // Set the http(s) agent\n requestInit.agent = this.getOrCreateAgent(httpRequest);\n requestInit.compress = httpRequest.decompressResponse;\n return requestInit;\n }", "static initialize(obj, id, integrationRequestUuid, webhookId, url, request, requestTime) { \n obj['id'] = id;\n obj['integrationRequestUuid'] = integrationRequestUuid;\n obj['webhookId'] = webhookId;\n obj['url'] = url;\n obj['request'] = request;\n obj['requestTime'] = requestTime;\n }", "async initializeBaseRequest(authRequest) {\n this.logger.verbose(\"initializeRequestScopes called\", authRequest.correlationId);\n // Default authenticationScheme to Bearer, log that POP isn't supported yet\n if (authRequest.authenticationScheme && authRequest.authenticationScheme === msalCommon.AuthenticationScheme.POP) {\n this.logger.verbose(\"Authentication Scheme 'pop' is not supported yet, setting Authentication Scheme to 'Bearer' for request\", authRequest.correlationId);\n }\n authRequest.authenticationScheme = msalCommon.AuthenticationScheme.BEARER;\n // Set requested claims hash if claims were requested\n if (authRequest.claims && !msalCommon.StringUtils.isEmpty(authRequest.claims)) {\n authRequest.requestedClaimsHash = await this.cryptoProvider.hashString(authRequest.claims);\n }\n return {\n ...authRequest,\n scopes: [...(authRequest && authRequest.scopes || []), ...msalCommon.OIDC_DEFAULT_SCOPES],\n correlationId: authRequest && authRequest.correlationId || this.cryptoProvider.createNewGuid(),\n authority: authRequest.authority || this.config.auth.authority\n };\n }", "fromMap(map) {\n if (map && map.constructor == Object) {\n if (HEADERS in map) {\n this.headers = setLowerCase(map[HEADERS]);\n }\n if (COOKIES in map) {\n this.cookies = setLowerCase(map[COOKIES]);\n }\n if (SESSION in map) {\n this.session = setLowerCase(map[SESSION]);\n }\n if (METHOD in map) {\n this.method = String(map[METHOD]);\n }\n if (IP in map) {\n this.ip = String(map[IP]);\n }\n if (URL_LABEL in map) {\n this.url = String(map[URL_LABEL]);\n }\n if (TIMEOUT in map) {\n this.timeoutSeconds = parseInt(String(map[TIMEOUT]));\n }\n if (FILE_NAME in map) {\n this.filename = String(map[FILE_NAME]);\n }\n if (CONTENT_LENGTH in map) {\n this.contentLength = parseInt(String(map[CONTENT_LENGTH]));\n }\n if (STREAM in map) {\n this.streamRoute = String(map[STREAM]);\n }\n if (BODY in map) {\n this.body = map[BODY];\n }\n if (QUERY in map) {\n this.queryString = String(map[QUERY]);\n }\n if (HTTPS in map) {\n this.https = String(map[HTTPS]) == 'true';\n }\n if (TARGET_HOST in map) {\n this.targetHost = String(map[TARGET_HOST]);\n }\n if (TRUST_ALL_CERT in map) {\n this.trustAllCert = String(map[TRUST_ALL_CERT]) == 'true';\n }\n if (UPLOAD in map) {\n this.upload = String(map[UPLOAD]);\n }\n if (PARAMETERS in map) {\n const parameters = map[PARAMETERS];\n if (PATH in parameters) {\n this.pathParams = setLowerCase(parameters[PATH]);\n }\n if (QUERY in parameters) {\n this.queryParams = setLowerCase(parameters[QUERY]);\n }\n }\n }\n }", "generateSearchObject(query, request) {\n const searchObject = {};\n query.map(key => {\n searchObject[key] = request.query[key];\n })\n return searchObject\n }", "function buildRequest(tapi, data, cb) {\n var options = {\n method: tapi.method,\n uri: 'https://api.trello.com/1' + tapi.url,\n qs: {\n key: keys.key,\n token: keys.token,\n },\n headers: {\n 'User-Agent': 'byatec'\n },\n json: true // Automatically parses the JSON string in the response\n };\n\n // Check the validity of the request and put the data where it belongs\n if (validateData(tapi, data, (err) => console.log(err))) {\n replaceUriFieldsWithData(options, data);\n placeDataIntoRequest(options, data);\n cb(null, options);\n }\n else {\n cb(new Error('Data is missing fields'), options);\n }\n\n }", "function massageCreateIndexRequest(requestDef) {\n\t requestDef = clone$1(requestDef);\n\n\t if (!requestDef.index) {\n\t requestDef.index = {};\n\t }\n\n\t ['type', 'name', 'ddoc'].forEach(function (key) {\n\t if (requestDef.index[key]) {\n\t requestDef[key] = requestDef.index[key];\n\t delete requestDef.index[key];\n\t }\n\t });\n\n\t if (requestDef.fields) {\n\t requestDef.index.fields = requestDef.fields;\n\t delete requestDef.fields;\n\t }\n\n\t if (!requestDef.type) {\n\t requestDef.type = 'json';\n\t }\n\t return requestDef;\n\t}", "function decorate_request(server) {\n server.decorateRequest('input', function (key, def) {\n let all = Object.assign(Object.assign({}, this.query), this.body);\n return key ? lodash_1.get(all, key, def) : all;\n });\n}", "function getApiMap(client, profiles) {\n return Object.keys(profiles).reduce((acc, name) => {\n const profile = profiles[name];\n return Object.assign(Object.assign({}, acc), { [name]: createApi(client, profile) });\n }, {});\n}", "function buildRequest(request) {\n let output = '';\n\n for (const item in request) {\n output += `/${request[item]}`;\n }\n\n return output;\n}", "mapRequest(req) {\n delete req.bookId;\n req.id = this.bookId;\n }", "collectInput () {\n const abtest = {};\n\n // Collect generic attributes\n let fields = this.getFieldsForType('generic');\n fields.forEach(field => {\n abtest[field] = this.input[field].value;\n });\n\n // Collect type specific attributes\n fields = this.getFieldsForType(abtest.type);\n fields.forEach(field => {\n abtest[field] = this.input[`${abtest.type}_${field}`].value;\n });\n\n return abtest;\n }", "getRequestInfoUtils() {\n return {\n createResponse$: this.createResponse$.bind(this),\n findById: this.findById.bind(this),\n isCollectionIdNumeric: this.isCollectionIdNumeric.bind(this),\n getConfig: () => this.config,\n getDb: () => this.db,\n getJsonBody: this.getJsonBody.bind(this),\n getLocation: this.getLocation.bind(this),\n getPassThruBackend: this.getPassThruBackend.bind(this),\n parseRequestUrl: this.parseRequestUrl.bind(this),\n };\n }", "function mapObsFromApiIntoOurDomain(obsFromApi) {\n // BEWARE: these records will be serialised into localStorage so things like\n // Dates will be flattened into something more primitive. For this reason,\n // it's best to keep everything simple. Alternatively, you can fix it by\n // hooking vuex-persistedstate to deserialse objects correctly.\n const directMappingKeys = ['uuid', 'geoprivacy']\n const result = directMappingKeys.reduce((accum, currKey) => {\n const value = obsFromApi[currKey]\n if (!_.isNil(value)) {\n accum[currKey] = value\n }\n return accum\n }, {})\n result.inatId = obsFromApi.id\n // not sure why the API provides .photos AND .observation_photos but the\n // latter has the IDs that we need to be working with.\n const photos = (obsFromApi.observation_photos || []).map((p) => {\n const result2 = {\n url: p.photo.url,\n uuid: p.uuid,\n id: p.id,\n [cc.isRemotePhotoFieldName]: true,\n }\n verifyWowDomainPhoto(result2)\n return result2\n })\n result.updatedAt = obsFromApi.updated_at\n result.observedAt = getObservedAt(obsFromApi)\n result.photos = photos\n result.placeGuess = obsFromApi.place_guess\n result.speciesGuess = obsFromApi.species_guess\n result.notes = obsFromApi.description\n result.geolocationAccuracy = obsFromApi.positional_accuracy\n delete result.positional_accuracy\n const { lat, lng } = mapGeojsonToLatLng(\n obsFromApi.private_geojson || obsFromApi.geojson,\n )\n result.lat = lat\n result.lng = lng\n result.obsFieldValues = obsFromApi.ofvs.map((o) => ({\n relationshipId: o.id,\n fieldId: o.field_id,\n datatype: o.datatype,\n name: processObsFieldName(o.name),\n value: o.value,\n }))\n result.identifications = obsFromApi.identifications.map((i) => ({\n uuid: i.uuid,\n createdAt: i.created_at,\n isCurrent: i.current,\n body: i.body, // we are trusting iNat to sanitise this\n taxonLatinName: i.taxon.name,\n taxonCommonName: i.taxon.preferred_common_name,\n taxonId: i.taxon_id,\n taxonPhotoUrl: (i.taxon.default_photo || {}).square_url,\n userLogin: i.user.login,\n userId: i.user.id,\n category: i.category,\n wowType: 'identification',\n }))\n result.comments = obsFromApi.comments.map((c) =>\n mapCommentFromApiToOurDomain(c),\n )\n updateIdsAndCommentsFor(result)\n return result\n}", "function massageCreateIndexRequest(requestDef) {\n requestDef = Object(__WEBPACK_IMPORTED_MODULE_0_pouchdb_utils__[\"b\" /* clone */])(requestDef);\n\n if (!requestDef.index) {\n requestDef.index = {};\n }\n\n ['type', 'name', 'ddoc'].forEach(function (key) {\n if (requestDef.index[key]) {\n requestDef[key] = requestDef.index[key];\n delete requestDef.index[key];\n }\n });\n\n if (requestDef.fields) {\n requestDef.index.fields = requestDef.fields;\n delete requestDef.fields;\n }\n\n if (!requestDef.type) {\n requestDef.type = 'json';\n }\n return requestDef;\n}", "function buildRequestParams(meta, range, calendar) {\n var dateEnv = calendar.dateEnv;\n var startParam;\n var endParam;\n var timeZoneParam;\n var customRequestParams;\n var params = {};\n if (range) {\n // startParam = meta.startParam\n // if (startParam == null) {\n startParam = calendar.opt('startParam');\n // }\n // endParam = meta.endParam\n // if (endParam == null) {\n endParam = calendar.opt('endParam');\n // }\n // timeZoneParam = meta.timeZoneParam\n // if (timeZoneParam == null) {\n timeZoneParam = calendar.opt('timeZoneParam');\n // }\n params[startParam] = dateEnv.formatIso(range.start);\n params[endParam] = dateEnv.formatIso(range.end);\n if (dateEnv.timeZone !== 'local') {\n params[timeZoneParam] = dateEnv.timeZone;\n }\n }\n // retrieve any outbound GET/POST data from the options\n if (typeof meta.extraParams === 'function') {\n // supplied as a function that returns a key/value object\n customRequestParams = meta.extraParams();\n }\n else {\n // probably supplied as a straight key/value object\n customRequestParams = meta.extraParams || {};\n }\n __assign(params, customRequestParams);\n return params;\n}", "configureRequest(request) {\n const { ignoreUrlPatterns = [] } = this.injector.settings.logger;\n const minimalInfo = this.minimalRequestPicker(request);\n const requestObj = this.requestToObject(request);\n request.log = new mvc_1.RequestLogger(this.injector.logger, {\n id: request.ctx.id,\n startDate: request.ctx.dateStart,\n url: request.originalUrl || request.url,\n ignoreUrlPatterns,\n minimalRequestPicker: (obj) => (Object.assign({}, minimalInfo, obj)),\n completeRequestPicker: (obj) => (Object.assign({}, requestObj, obj))\n });\n }", "generate_prim_attrs(op) {\n var prim_attrs = {};\n for (let ra in this.attrs) {\n switch (ra) {\n // universal\n case 'rn': if(op == 1) prim_attrs['rn'] = this.attrs['rn']; break;\n case 'cr': if(op == 1) prim_attrs['cr'] = this.attrs['cr']; break;\n case 'lbl': prim_attrs['lbl'] = this.attrs['lbl']; break;\n case 'ri':\n case 'pi':\n case 'ct':\n case 'lt':\n case 'ty': break;\n case 'et': prim_attrs['et'] = this.attrs['et']; break;\n // AE-specific\n case 'nu': prim_attrs['nu'] = this.attrs['nu']; break;\n case 'nct': prim_attrs['nct'] = this.attrs['nct']; break; // notificationContentType\n case 'cs': break;\n case 'nec': prim_attrs['nec'] = this.attrs['nec']; break; // notificationEventCat\n case 'su': prim_attrs['su'] = this.attrs['su']; break; // subscriberURI\n }\n }\n return prim_attrs;\n }", "static createMapping () {\n this.patronTypeJSON = this._getPatronTypeJsonLD()['@graph']\n const result = {}\n\n for (const index in this.patronTypeJSON) {\n const accessibleDeliveryLocationTypes = jsonldParseUtils.forcetoFlatArray(this.patronTypeJSON[index]['nypl:deliveryLocationAccess'])\n\n result[this.patronTypeJSON[index]['skos:notation']] = {\n label: this.patronTypeJSON[index]['skos:prefLabel'],\n accessibleDeliveryLocationTypes: accessibleDeliveryLocationTypes\n }\n }\n\n return result\n }", "normalizeCreateRecordResponse(_store, _primaryModelClass, payload, id, _requestType) {\n return { data: { id: id || payload.ref.key, attributes: payload.data, type: _primaryModelClass.modelName } };\n }", "function massageCreateIndexRequest(requestDef) {\n requestDef = clone(requestDef);\n\n if (!requestDef.index) {\n requestDef.index = {};\n }\n\n ['type', 'name', 'ddoc'].forEach(function (key) {\n if (requestDef.index[key]) {\n requestDef[key] = requestDef.index[key];\n delete requestDef.index[key];\n }\n });\n\n if (requestDef.fields) {\n requestDef.index.fields = requestDef.fields;\n delete requestDef.fields;\n }\n\n if (!requestDef.type) {\n requestDef.type = 'json';\n }\n return requestDef;\n}", "getBackendRequestData(hook_ids) {\n return {\n old_values: this.oldValues,\n changes: this.changes,\n operation_state: this.operationState,\n new_values: this.newValues,\n wizard_progress: this.wizardProgress,\n ids: hook_ids\n };\n }", "createResourceKey(requestArgs: Object): string {\n let resourceKey = requestArgs.url;\n\n if (requestArgs.params) {\n resourceKey += `|${requestArgs.params}`;\n }\n\n if (requestArgs.locale) {\n resourceKey += `|${requestArgs.locale}`;\n }\n\n return resourceKey;\n }", "function massageCreateIndexRequest(requestDef) {\n requestDef = clone$1(requestDef);\n\n if (!requestDef.index) {\n requestDef.index = {};\n }\n\n ['type', 'name', 'ddoc'].forEach(function (key) {\n if (requestDef.index[key]) {\n requestDef[key] = requestDef.index[key];\n delete requestDef.index[key];\n }\n });\n\n if (requestDef.fields) {\n requestDef.index.fields = requestDef.fields;\n delete requestDef.fields;\n }\n\n if (!requestDef.type) {\n requestDef.type = 'json';\n }\n return requestDef;\n}", "requestObject(request) {\n return request; \n }", "async function buildReq({ user, ...overrides } = {}) {\n const req = { user, body: {}, params: {}, ...overrides };\n return req;\n}", "static initialize(obj, baseReq, stock, money, initPrice, maxSupply, maxPrice, maxMoney, earliestCancelTime) { \n obj['base_req'] = baseReq;\n obj['stock'] = stock;\n obj['money'] = money;\n obj['init_price'] = initPrice;\n obj['max_supply'] = maxSupply;\n obj['max_price'] = maxPrice;\n obj['max_money'] = maxMoney;\n obj['earliest_cancel_time'] = earliestCancelTime;\n }", "static initialize(obj, baseReq, delegatorAddress, validatorSrcAddress, validatorDstAddress, amount) { \n obj['base_req'] = baseReq;\n obj['delegator_address'] = delegatorAddress;\n obj['validator_src_address'] = validatorSrcAddress;\n obj['validator_dst_address'] = validatorDstAddress;\n obj['amount'] = amount;\n }", "createRequestBody() {\n const requestBody = [];\n this.shippingMethodDetails.deliveryGroup.map((item, index) => {\n requestBody.push({\n deliveryInstruction: this.selectedShippingMethod[index].instructions,\n deliveryMode: {\n code: this.selectedShippingMethod[index].value,\n name: this.selectedShippingMethod[index].label.split(':')[0],\n },\n splitEntries: [],\n });\n item.value.splitEntries.map((entry) => {\n requestBody[index].splitEntries.push({\n code: entry.code,\n });\n });\n });\n return requestBody;\n }", "_params(req, opts) {\n const body = req.body || {};\n\n if (opts.name) body.Name = opts.name;\n if (opts.session) body.Session = opts.session;\n if (opts.token) {\n body.Token = opts.token;\n delete opts.token;\n }\n if (opts.near) body.Near = opts.near;\n if (opts.template) {\n const template = utils.normalizeKeys(opts.template);\n if (template.type || template.regexp) {\n body.Template = {};\n if (template.type) body.Template.Type = template.type;\n if (template.regexp) body.Template.Regexp = template.regexp;\n }\n }\n if (opts.service) {\n const service = utils.normalizeKeys(opts.service);\n body.Service = {};\n if (service.service) body.Service.Service = service.service;\n if (service.failover) {\n const failover = utils.normalizeKeys(service.failover);\n if (typeof failover.nearestn === \"number\" || failover.datacenters) {\n body.Service.Failover = {};\n if (typeof failover.nearestn === \"number\") {\n body.Service.Failover.NearestN = failover.nearestn;\n }\n if (failover.datacenters) {\n body.Service.Failover.Datacenters = failover.datacenters;\n }\n }\n }\n if (typeof service.onlypassing === \"boolean\") {\n body.Service.OnlyPassing = service.onlypassing;\n }\n if (service.tags) body.Service.Tags = service.tags;\n }\n if (opts.dns) {\n const dns = utils.normalizeKeys(opts.dns);\n if (dns.ttl) body.DNS = { TTL: dns.ttl };\n }\n\n req.body = body;\n }", "function responseBuilderSimple(\n parameterMap,\n rootElementName,\n jsonQobj,\n amplitudeEventType,\n mappingJson,\n credsJson\n) {\n // Create a final map to be used for response and populate the static parts first\n var responseMap = new Map();\n // responseMap.set(\"request-format\",\"PARAMS\");\n var requestConfigMap = new Map();\n requestConfigMap.set(\"request-format\", \"PARAMS\");\n requestConfigMap.set(\"request_method\", \"GET\");\n\n responseMap.set(\"request_config\", mapToObj(requestConfigMap));\n\n responseMap.set(\"header\", {});\n\n // User Id for internal routing purpose needs to be set\n responseMap.set(\"user_id\", String(jsonQobj.find(\"rl_anonymous_id\").value()));\n\n // Amplitude HTTP API calls take two parameters\n // First one is a api_key and the second one is a complete JSON\n jsonQobj.find(\"rl_destination\").each((i, p, value) => {\n parameterMap.set(\"api_key\", String(value.Config.apiKey));\n });\n // jsonQ.each(credsJson, function(key,value){\n // \tparameterMap.set(\"api_key\",String(value));\n // });\n\n // We would need to maintain a map of RHS objects in order to\n // be able to add properties to the same without ending up with\n // multiple objects of same type\n var objMap = new Map();\n\n // Add fixed-logic fields to objMap\n var libraryName = jsonQobj.find(\"rl_library\").find(\"rl_name\");\n\n /* libraryName.each(function(index, path, value){\n\t\tobjMap.set(\"platform\",String(value).split(\".\")[2]);\n\t}); */\n\n var moreMappedJson = mappingJson;\n\n // Adding mapping for free flowing rl_properties to amp event_properties\n jsonQobj.find(\"rl_properties\").each(function(index, path, value) {\n console.log(\"=============\");\n console.log(value);\n var mappingJsonQObj = jsonQ(mappingJson);\n jsonQ.each(value, function(key, val) {\n console.log(\"==key==:: \", key);\n if (mappingJsonQObj.find(\"rl_properties.\" + key).length == 0) {\n console.log(\"===adding extra mapping===\");\n moreMappedJson[\"rl_properties.\" + key] = \"event_properties.\" + key;\n }\n });\n });\n\n // Add custom user_props mapping\n jsonQobj.find(\"rl_user_properties\").each(function(index, path, value) {\n console.log(\"====custom user_props===\");\n jsonQ.each(value, function(key, val) {\n console.log(key + \" : \" + val);\n moreMappedJson[\"rl_user_properties.\" + key] = \"user_properties.\" + key;\n });\n });\n\n jsonQ.each(moreMappedJson, function(sourceKey, destinationKey) {\n console.log(destinationKey);\n // Reset reference point to root\n var tempObj = jsonQobj.find(\"rl_context\").parent();\n\n // console.log(tempObj.length)\n\n var pathElements = sourceKey.split(\".\");\n // console.log(loopCounter++);\n\n // Now take each path element and traverse the structure\n for (var i = 0; i < pathElements.length; i++) {\n // console.log(pathElements[i]);\n tempObj = tempObj.find(pathElements[i]);\n }\n\n // Once the entry for the source key has been found, the value needs to be mapped\n // to the destination key\n\n // There might be multiple entries for multiple levels of the same structure\n // or for multiple elements at same level in the structure. Hence the root\n // should be initialized outside\n var rootObj = {};\n\n tempObj.each(function(index, path, value) {\n // Destination key can also be part of a structure\n var destinationPathElements = destinationKey.split(\".\");\n // Construct the object hierarchy, checking for existence at each step\n var parent = {};\n\n // to be directly added to root level\n if (destinationPathElements.length < 2) {\n objMap.set(destinationPathElements[0], value);\n } else {\n // multi-level hierarchy\n\n for (var level = 0; level < destinationPathElements.length; level++) {\n // Now there can be 3 situations - the root, intermediate branch,\n // or leaf. If root, check if the root object exists, else create\n // if branch, check if root object has the branch, else add\n // for leaf - check if penultimate branch has leaf, else add\n\n var tmp;\n var branchObj;\n\n switch (level) {\n case 0: // root\n tmp = objMap.get(destinationPathElements[0]);\n\n if (!tmp) {\n // root itself does not exist\n rootObj = {};\n objMap.set(destinationPathElements[0], rootObj);\n parent = rootObj; // for next calls\n } else {\n // root exits, set parent to root\n parent = tmp;\n }\n break;\n case destinationPathElements.length - 1: // leaf\n // leaf will have value\n parent[destinationPathElements[level]] = value;\n break;\n default:\n // all other cases, i.e. intermediate branches\n // however this needs to be skipped for a.b cases\n if (destinationPathElements.length > 2) {\n tmp = parent[destinationPathElements[level]];\n if (!tmp) {\n // level does not exists\n\n branchObj = {};\n parent[destinationPathElements[level]] = branchObj;\n parent = branchObj;\n } else {\n parent = tmp;\n }\n }\n\n break;\n }\n }\n }\n });\n });\n\n switch (amplitudeEventType) {\n case \"identify\":\n responseMap.set(\"endpoint\", \"https://api.amplitude.com/identify\");\n break;\n default:\n responseMap.set(\"endpoint\", \"https://api.amplitude.com/httpapi\");\n if (amplitudeEventType && amplitudeEventType != null) {\n objMap.set(\"event_type\", amplitudeEventType);\n }\n objMap.set(\n \"time\",\n new Date(jsonQobj.find(\"rl_timestamp\").value()[0]).getTime()\n );\n break;\n }\n\n // Add the user_id to the obj map\n objMap.set(\"user_id\", jsonQobj.find(\"rl_anonymous_id\").value()[0]);\n\n // Also add insert_id, we're using rl_message_id for this (Check if required??)\n // objMap.set(\"insert_id\", (jsonQobj.find(\"rl_message_id\").value()[0]));\n\n // Now add the entire object map to the parameter map against\n // the designated root element name\n parameterMap.set(rootElementName, JSON.stringify(mapToObj(objMap)));\n\n // Assign parameter map against payload key\n responseMap.set(\"payload\", mapToObj(parameterMap));\n\n // Convert response map to JSON\n var responseJson = JSON.stringify(mapToObj(responseMap));\n\n console.log(JSON.parse(responseJson));\n\n var events = [];\n events.push(responseJson);\n return events;\n}", "@wire(getObjectInfo, { objectApiName: '$objectApiName' })\n handleObjectInfo(objectInfo) {\n if(objectInfo.data) {\n for (let field in objectInfo.data.fields) { \n if(objectInfo.data.fields[field].dataType === \"Location\") {\n this.geoLocationFields[objectInfo.data.fields[field].apiName] = {\n label : objectInfo.data.fields[field].label,\n };\n } \n\n if(objectInfo.data.fields[field].dataType === \"Address\") {\n this.addressFields[objectInfo.data.fields[field].apiName] = {\n label : objectInfo.data.fields[field].label,\n }\n } \n } \n for (let geoFields in this.geoLocationFields) {\n for (let field in objectInfo.data.fields) { \n if(objectInfo.data.fields[field].compoundFieldName === geoFields) {\n if(objectInfo.data.fields[field].apiName.includes(\"Latitude\")) {\n this.geoLocationFields[geoFields][\"Latitude\"] = objectInfo.data.fields[field].apiName;\n } else {\n this.geoLocationFields[geoFields][\"Longitude\"] = objectInfo.data.fields[field].apiName;\n }\n }\n }\n\n }\n\n for (let addressField in this.addressFields) {\n for (let field in objectInfo.data.fields) { \n if(objectInfo.data.fields[field].compoundFieldName === addressField) {\n if(objectInfo.data.fields[field].apiName.includes(\"Latitude\")) {\n this.addressFields[addressField][\"Latitude\"] = objectInfo.data.fields[field].apiName;\n } else if (objectInfo.data.fields[field].apiName.includes(\"Longitude\")) {\n this.addressFields[addressField][\"Longitude\"] = objectInfo.data.fields[field].apiName;\n } else if (objectInfo.data.fields[field].apiName.includes(\"City\")) {\n this.addressFields[addressField][\"City\"] = objectInfo.data.fields[field].apiName;\n } else if (objectInfo.data.fields[field].apiName.includes(\"Country\")) {\n this.addressFields[addressField][\"Country\"] = objectInfo.data.fields[field].apiName;\n } else if (objectInfo.data.fields[field].apiName.includes(\"Country\")) {\n this.addressFields[addressField][\"Country\"] = objectInfo.data.fields[field].apiName;\n } else if (objectInfo.data.fields[field].apiName.includes(\"State\")) {\n this.addressFields[addressField][\"State\"] = objectInfo.data.fields[field].apiName;\n }\n }\n }\n\n }\n\n let fieldsToBeQueried = [];\n for(let address in this.addressFields) {\n for(let field in this.addressFields[address]) {\n if(field === \"Latitude\" || field === \"Longitude\") {\n fieldsToBeQueried.push(this.addressFields[address][field]);\n }\n }\n }\n\n if(fieldsToBeQueried.length > 0) {\n this.isFieldsQueryRequired = true;\n getGeolocationsFields({recordId: this.recordId, objectApiName: this.objectApiName, fieldNames: fieldsToBeQueried})\n .then((record) => {\n this.queriedRecord = record;\n this.setObjectDataLoaded();\n }).catch((error) => {\n // No op\n })\n } else {\n this.setObjectDataLoaded();\n } \n } else if (objectInfo.error) {\n this.setObjectDataLoaded();\n }\n }", "function requestHelper(req, payload = null) {\n return {\n type: req,\n payload,\n }\n}", "formatRequest(request) {\n\t\tif (request.Tracers) {\n\t\t\treturn request.Tracers.map(tracer => {\n\t\t\t\treturn {\n\t\t\t\t\tID: tracer.ID,\n\t\t\t\t\tRawRequest: request.RawRequest,\n\t\t\t\t\tRequestMethod: request.RequestMethod,\n\t\t\t\t\tRequestURL: this.parseHost(request.RequestURL),\n\t\t\t\t\tRequestPath: this.parsePath(request.RequestURL),\n\t\t\t\t\tTracerString: tracer.TracerString,\n\t\t\t\t\tTracerPayload: tracer.TracerPayload,\n\t\t\t\t\tTracerLocationIndex: tracer.TracerLocationIndex,\n\t\t\t\t\tTracerLocationType: tracer.TracerLocationType,\n\t\t\t\t\tOverallSeverity: tracer.OverallSeverity,\n\t\t\t\t\tHasTracerEvents: tracer.HasTracerEvents\n\t\t\t\t};\n\t\t\t});\n\t\t}\n\t}", "function makeContext(req) {\n return {\n account: {\n getKey: function() { return req.params['acctId']; }\n },\n pagination: {\n limit: req.params['limit'],\n marker: req.params['marker'] === 'START' ? '' : req.params['marker']\n }\n };\n}", "__parse(requestJson) {\n if (requestJson.hasOwnProperty('collection_key') && requestJson.hasOwnProperty('action')) {\n this.request = {}\n this.request.collection_key = requestJson['collection_key'];\n this.request.subkey = requestJson['subkey'];\n this.request.action = requestJson['action'];\n return true;\n } else return false;\n }", "_request(request) {\n return request\n .set('X-Parse-Application-Id', this.applicationId)\n .set('X-Parse-Master-Key', this.masterKey)\n .set('Accept', 'application/json');\n }", "prepareRequestParams(options) {\n let requestParams;\n const searchKeys = _.split(options.searchKey, ','), matchModes = _.split(options.matchMode, ','), formFields = {};\n _.forEach(searchKeys, (colName, index) => {\n formFields[colName] = {\n value: options.query,\n logicalOp: 'AND',\n matchMode: matchModes[index] || matchModes[0] || 'startignorecase'\n };\n });\n requestParams = {\n filterFields: formFields,\n page: options.page,\n pagesize: options.limit || options.pagesize,\n skipDataSetUpdate: true,\n skipToggleState: true,\n inFlightBehavior: 'executeAll',\n logicalOp: 'OR',\n orderBy: options.orderby ? _.replace(options.orderby, /:/g, ' ') : ''\n };\n if (options.onBeforeservicecall) {\n options.onBeforeservicecall(formFields);\n }\n return requestParams;\n }", "constructor(name, args, opts) {\n let inputs = {};\n opts = opts || {};\n if (!opts.id) {\n if ((!args || args.apiId === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'apiId'\");\n }\n if ((!args || args.description === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'description'\");\n }\n if ((!args || args.resourceGroupName === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'resourceGroupName'\");\n }\n if ((!args || args.serviceName === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'serviceName'\");\n }\n if ((!args || args.title === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'title'\");\n }\n if ((!args || args.userId === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'userId'\");\n }\n inputs[\"apiId\"] = args ? args.apiId : undefined;\n inputs[\"createdDate\"] = args ? args.createdDate : undefined;\n inputs[\"description\"] = args ? args.description : undefined;\n inputs[\"issueId\"] = args ? args.issueId : undefined;\n inputs[\"resourceGroupName\"] = args ? args.resourceGroupName : undefined;\n inputs[\"serviceName\"] = args ? args.serviceName : undefined;\n inputs[\"state\"] = args ? args.state : undefined;\n inputs[\"title\"] = args ? args.title : undefined;\n inputs[\"userId\"] = args ? args.userId : undefined;\n inputs[\"name\"] = undefined /*out*/;\n inputs[\"type\"] = undefined /*out*/;\n }\n else {\n inputs[\"apiId\"] = undefined /*out*/;\n inputs[\"createdDate\"] = undefined /*out*/;\n inputs[\"description\"] = undefined /*out*/;\n inputs[\"name\"] = undefined /*out*/;\n inputs[\"state\"] = undefined /*out*/;\n inputs[\"title\"] = undefined /*out*/;\n inputs[\"type\"] = undefined /*out*/;\n inputs[\"userId\"] = undefined /*out*/;\n }\n if (!opts.version) {\n opts = pulumi.mergeOptions(opts, { version: utilities.getVersion() });\n }\n const aliasOpts = { aliases: [{ type: \"azure-nextgen:apimanagement/v20180601preview:ApiIssue\" }, { type: \"azure-native:apimanagement:ApiIssue\" }, { type: \"azure-nextgen:apimanagement:ApiIssue\" }, { type: \"azure-native:apimanagement/v20170301:ApiIssue\" }, { type: \"azure-nextgen:apimanagement/v20170301:ApiIssue\" }, { type: \"azure-native:apimanagement/v20180101:ApiIssue\" }, { type: \"azure-nextgen:apimanagement/v20180101:ApiIssue\" }, { type: \"azure-native:apimanagement/v20190101:ApiIssue\" }, { type: \"azure-nextgen:apimanagement/v20190101:ApiIssue\" }, { type: \"azure-native:apimanagement/v20191201:ApiIssue\" }, { type: \"azure-nextgen:apimanagement/v20191201:ApiIssue\" }, { type: \"azure-native:apimanagement/v20191201preview:ApiIssue\" }, { type: \"azure-nextgen:apimanagement/v20191201preview:ApiIssue\" }, { type: \"azure-native:apimanagement/v20200601preview:ApiIssue\" }, { type: \"azure-nextgen:apimanagement/v20200601preview:ApiIssue\" }, { type: \"azure-native:apimanagement/v20201201:ApiIssue\" }, { type: \"azure-nextgen:apimanagement/v20201201:ApiIssue\" }, { type: \"azure-native:apimanagement/v20210101preview:ApiIssue\" }, { type: \"azure-nextgen:apimanagement/v20210101preview:ApiIssue\" }] };\n opts = pulumi.mergeOptions(opts, aliasOpts);\n super(ApiIssue.__pulumiType, name, inputs, opts);\n }", "function determinePropertiesToGet (type) {\n const defaultProperties = ['description', 'summary']\n let result = defaultProperties\n switch (type) {\n case 'API':\n result.push('tags', 'info')\n break;\n case 'METHOD':\n result.push('tags')\n break;\n case 'PATH_PARAMETER':\n case 'QUERY_PARAMETER':\n case 'REQUEST_HEADER':\n case 'REQUEST_BODY':\n result.push('required')\n break;\n }\n return result\n}", "function getArgsFrom(request) {\n var r = request || {};\n var args = _.assign({}, r.params, r.query);\n args.body = r.body;\n args.fromto = getDateRangeFrom(r);\n return args;\n}", "static makeAPICall(endpoint, input, options = {}) {\n switch (endpoint) {\n case GET_TOKEN:\n if (options.body === undefined) {\n options.body = {};\n }\n options.body.client_id = process.env.REACT_APP_CLIENT_ID;\n return this._fetchFromAPI(this.authUrlBeginning + \"token/\", options);\n case CREATE_USER:\n return this._fetchFromAPI(this.urlBeginning + \"createUser/\", options);\n case VALIDATE_TOKEN:\n return this._addAuthorization(this.urlBeginning + \"validateToken/\");\n case FORGOT_PASSWORD:\n return this._fetchFromAPI(this.urlBeginning + \"password_reset/\", options);\n case RESET_PASSWORD:\n return this._fetchFromAPI(this.urlBeginning + \"password_reset/confirm\", options);\n case UPLOAD_DOCUMENT:\n return this._addAuthorization(this.urlBeginning + \"uploadDoc/\", options);\n case UPLOAD_ANNOTATIONS:\n return this._addAuthorization(this.urlBeginning + \"uploadAnnot/\", options);\n case GET_ALL_ANNOTE_BY_CURRENT_USER:\n return this._addAuthorization(this.urlBeginning + \"getAllMyAnnots/\" + (input == null ? \"\" : input));\n case GET_ALL_ANNOTE:\n return this._addAuthorization(this.urlBeginning + \"getAllAnnots/\" + (input == null ? \"\" : input));\n case GET_ANNOTATIONS_FILENAME_USER:\n return this._addAuthorization(this.urlBeginning + \"getAnnotationsByFilenameUser/\" + input + this.json);\n case EXPORT_CURRENT_ANNOTATIONS:\n return this._addAuthorization(this.urlBeginning + \"exportAnnotations/\" + input + this.json);\n case DOWNLOAD_ANNOTATIONS_BY_ID:\n return this._addAuthorization(this.urlBeginning + \"downloadAnnotations/\" + input + this.json);\n\n // ICD APIs\n case ANCESTORS:\n return this._addAuthorization(this.urlBeginning + \"ancestors/\" + input + this.json);\n case FAMILY:\n return this._addAuthorization(this.urlBeginning + \"family/\" + input + this.json);\n case CODE_AUTO_SUGGESTIONS:\n return this._addAuthorization(this.urlBeginning + \"codeAutosuggestions/\" + input + this.json);\n case CODE_DESCRIPTION:\n return this._addAuthorization(this.urlBeginning + \"codeDescription/\" + input + this.json);\n default:\n return null;\n }\n }", "function genProperties(){\n var result = {};\n\n // generates this structure\n //\"properties\": {\n // \"user\": {\n // \"type\": \"string\"\n // },\n // \"tweets\": {\n // \"type\": \"string\"\n // }\n //}\n\n for(var prop in body){\n result[prop] = {\n type: body[prop]\n }\n }\n\n return result;\n }", "getBoostReqBody() {\n const data = this.state.data;\n const isEventTriggered = data.offeredCondition === 'EVENT' || data.type === 'WITHDRAWAL'; // by definition withdrawals are event driven\n const isMlDetermined = data.offeredCondition === 'ML_DETERMINED';\n\n let body = assembleRequestBasics(data);\n\n const { statusConditions, initialStatus, gameParams } = assembleStatusConditions(data, isEventTriggered, isMlDetermined);\n body = { ...body, statusConditions, initialStatus };\n\n if (gameParams) {\n body.gameParams = gameParams;\n }\n\n body.messagesToCreate = assembleBoostMessages(data, isEventTriggered, isMlDetermined);\n\n return body;\n }", "static parse(event) {\r\n const request = isLambdaProxyRequest(event) ? JSON.parse(event.body) : event;\r\n return isLambdaProxyRequest(event)\r\n ? {\r\n request: JSON.parse(event.body),\r\n apiGateway: event,\r\n }\r\n : request;\r\n }", "payloadToObject(payload){\n let object = {};\n for(let key in this.model) {\n if(payload[key] !== undefined) object[key] = payload[key];\n }\n return object;\n }", "get paramsMapbox() {\n return {\n // api key configurado en archivo .env configurando el modulo dotenv\n 'access_token': process.env.MAPBOX_KEY,\n 'limit': 5,\n 'language': 'es'\n }\n }", "[actions.TOPOLOGYMGMT_TYPE_REQUEST](state, action) {\n return {\n ...state,\n [action.identify]: {\n ...state[action.identify],\n refreshTopologySuccess: action.refreshTopologySuccess,\n orderBy: action.orderBy\n }\n };\n }", "function extractObject(req, prefix) {\n let obj = {};\n\n Object.keys(req.query).forEach(key => {\n if (key.startsWith(prefix)) {\n let prop = key.substring(prefix.length);\n let value = req.query[key];\n obj[prop] = convertType(value);\n }\n });\n\n return obj;\n}", "toApi() {\n let applicantContacts = [\n {\n \"Type\": \"e\",\n \"IsPrimary\": true,\n \"IsPrivate\": true,\n \"Email\": Url.stripHtml(this.email)\n },\n {\n \"Type\": \"p\",\n \"IsPrimary\": true,\n \"IsPrivate\": true,\n \"Phone\": this.mobile\n },\n {\n \"Type\": \"p\",\n \"IsPrimary\": false,\n \"IsPrivate\": true,\n \"Phone\": this.landline\n },\n {\n \"Type\": \"ad\",\n \"IsPrimary\": false,\n \"IsPrivate\": false,\n \"Address\": Url.stripHtml(this.address),\n \"City\": \"\",\n \"Suburb\": Url.stripHtml(this.suburb),\n \"CountryId\": this.countryId\n }\n ];\n\n if(!this.landline) {\n applicantContacts.splice(2, 1);\n }\n\n return {\n \"JobId\": this.jobId,\n \"ResumeFileStorageId\": this.resumeId,\n \"ApplicantInformation\": {\n \"FirstName\": Url.stripHtml(this.firstname),\n \"SurName\": Url.stripHtml(this.surname),\n \"BirthDay\": null,\n \"Sex\": null,\n \"Salutation\": null\n },\n \"ApplicantContacts\": applicantContacts\n };\n }", "static merge(...requests) {\n return requests.reduce((base, request) => {\n if (!request)\n return base;\n base.url = Request.mergeUrls(base.url, request.url);\n base.method = request.method || base.method;\n Object.assign(base.urlParameters, request.urlParameters);\n base.host = request.host.length ? request.host : base.host;\n Object.assign(base.headers, request.headers);\n base.body = RequestBody.merge(base.body, request.body);\n return base;\n }, new Request());\n }", "function constructQueryParams(req) {\n let queryParams = {};\n for (let queryKey in req.query) {\n if (QUERY.has(queryKey)) {\n if (queryKey.localeCompare('latitude') === 0\n || queryKey.localeCompare('longitude') === 0)\n queryParams[queryKey] = parseFloat(req.query[queryKey])\n else if (queryKey.localeCompare('radius') === 0\n || queryKey.localeCompare('limit') === 0\n || queryKey.localeCompare('offset') === 0\n || queryKey.localeCompare('open_at') === 0)\n queryParams[queryKey] = parseInt(req.query[queryKey])\n else if (queryKey.localeCompare('open_now') === 0)\n queryParams[queryKey] = queryKey.localeCompare('true') === 0\n else {\n if (req.query[queryKey] !== undefined && req.query[queryKey] !== null && req.query[queryKey].length > 0) {\n queryParams[queryKey] = req.query[queryKey]\n }\n }\n }\n else {\n return undefined;\n }\n }\n\n if (queryParams.hasOwnProperty('location') ||\n (queryParams.hasOwnProperty('latitude') && queryParams.hasOwnProperty('longitude'))) {\n return queryParams;\n }\n\n return {\n latitude: 38.6270,\n longitude: -90.1994,\n limit: 10\n };\n}", "constructor(name, args, opts) {\n let inputs = {};\n opts = opts || {};\n if (!opts.id) {\n if ((!args || args.apiId === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'apiId'\");\n }\n if ((!args || args.resourceGroupName === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'resourceGroupName'\");\n }\n if ((!args || args.serviceName === undefined) && !opts.urn) {\n throw new Error(\"Missing required property 'serviceName'\");\n }\n inputs[\"apiId\"] = args ? args.apiId : undefined;\n inputs[\"notes\"] = args ? args.notes : undefined;\n inputs[\"releaseId\"] = args ? args.releaseId : undefined;\n inputs[\"resourceGroupName\"] = args ? args.resourceGroupName : undefined;\n inputs[\"serviceName\"] = args ? args.serviceName : undefined;\n inputs[\"createdDateTime\"] = undefined /*out*/;\n inputs[\"name\"] = undefined /*out*/;\n inputs[\"type\"] = undefined /*out*/;\n inputs[\"updatedDateTime\"] = undefined /*out*/;\n }\n else {\n inputs[\"apiId\"] = undefined /*out*/;\n inputs[\"createdDateTime\"] = undefined /*out*/;\n inputs[\"name\"] = undefined /*out*/;\n inputs[\"notes\"] = undefined /*out*/;\n inputs[\"type\"] = undefined /*out*/;\n inputs[\"updatedDateTime\"] = undefined /*out*/;\n }\n if (!opts.version) {\n opts = pulumi.mergeOptions(opts, { version: utilities.getVersion() });\n }\n const aliasOpts = { aliases: [{ type: \"azure-nextgen:apimanagement/v20190101:ApiRelease\" }, { type: \"azure-native:apimanagement:ApiRelease\" }, { type: \"azure-nextgen:apimanagement:ApiRelease\" }, { type: \"azure-native:apimanagement/v20170301:ApiRelease\" }, { type: \"azure-nextgen:apimanagement/v20170301:ApiRelease\" }, { type: \"azure-native:apimanagement/v20180101:ApiRelease\" }, { type: \"azure-nextgen:apimanagement/v20180101:ApiRelease\" }, { type: \"azure-native:apimanagement/v20180601preview:ApiRelease\" }, { type: \"azure-nextgen:apimanagement/v20180601preview:ApiRelease\" }, { type: \"azure-native:apimanagement/v20191201:ApiRelease\" }, { type: \"azure-nextgen:apimanagement/v20191201:ApiRelease\" }, { type: \"azure-native:apimanagement/v20191201preview:ApiRelease\" }, { type: \"azure-nextgen:apimanagement/v20191201preview:ApiRelease\" }, { type: \"azure-native:apimanagement/v20200601preview:ApiRelease\" }, { type: \"azure-nextgen:apimanagement/v20200601preview:ApiRelease\" }, { type: \"azure-native:apimanagement/v20201201:ApiRelease\" }, { type: \"azure-nextgen:apimanagement/v20201201:ApiRelease\" }, { type: \"azure-native:apimanagement/v20210101preview:ApiRelease\" }, { type: \"azure-nextgen:apimanagement/v20210101preview:ApiRelease\" }] };\n opts = pulumi.mergeOptions(opts, aliasOpts);\n super(ApiRelease.__pulumiType, name, inputs, opts);\n }", "function createRequestOptions(apiURL) {\n\treturn {\n\t\turl: apiURL,\n\t\theaders: {\n\t\t\t'Accept': 'application/vnd.github.v3+json',\n\t\t\t'User-Agent': 'zoton2/Twitch-Team-Hosting-Bot'\n\t\t}\n\t}\n}", "initPayload() {\n return {\n configuration: this.configuration,\n mainState: this.mainState,\n titleService: this.titleService,\n communication: this.communication,\n options: this.config.options || {},\n };\n }", "extract_request(params) {\n if (params.hasOwnProperty('_raw_'))\n var raw = params['_raw_'];\n else\n var raw = { res: null, req: null};\n return [raw.res, raw.req];\n }", "function cfnRuleGroupCustomRequestHandlingPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnRuleGroup_CustomRequestHandlingPropertyValidator(properties).assertSuccess();\n return {\n InsertHeaders: cdk.listMapper(cfnRuleGroupCustomHTTPHeaderPropertyToCloudFormation)(properties.insertHeaders),\n };\n}", "prepareParams() {\n const { filters } = this.props;\n const params = {};\n\n if (filters !== undefined) {\n // Add status filter to param\n if (filters.status !== undefined && filters.status.value !== null) {\n params.status = filters.status.value;\n }\n\n // Add customer filter to params\n if (filters.customers !== undefined && filters.customers !== null) {\n params.ownerName = Array.from(filters.customers, customer => customer.value);\n }\n }\n\n return params;\n }", "function standardizeJsonRpcRequestPayload(payload) {\n var _a, _b, _c;\n if (!isPayloadPreprocessed(payload)) {\n payload.jsonrpc = (_a = payload.jsonrpc) !== null && _a !== void 0 ? _a : '2.0';\n payload.id = (0,_util_get_payload_id__WEBPACK_IMPORTED_MODULE_1__.getPayloadId)();\n payload.method = (_b = payload.method) !== null && _b !== void 0 ? _b : 'noop';\n payload.params = (_c = payload.params) !== null && _c !== void 0 ? _c : [];\n markPayloadAsPreprocessed(payload);\n }\n return payload;\n}", "function createMapsApiRequest({config, credentials}) {\n const encodedApiKey = encodeParameter('api_key', credentials.apiKey);\n const encodedClient = encodeParameter('client', `deck-gl-carto`);\n const parameters = [encodedApiKey, encodedClient];\n const url = generateMapsApiUrl(parameters, credentials);\n\n const getUrl = `${url}&${encodeParameter('config', config)}`;\n if (getUrl.length < REQUEST_GET_MAX_URL_LENGTH) {\n return getRequest(getUrl);\n }\n\n return postRequest(url, config);\n}", "function mapAsyncParams() {\n const asyncFilters = responses.asyncParams || [];\n\n // create a promise to retrieve our filters that rely on ajax\n const asyncQueryProms = asyncFilters.map((item) => {\n let cacheFound = false;\n // check our cache to see if we already have data saved on the filter\n responses.asyncFilterCache.forEach((a) => {\n // check that the ID and source match\n if (a.codeRef === item.codeRef && a.selectionRef === item.selectionRef) {\n cacheFound = a;\n }\n });\n // Is it already cached? if so, return it.\n if (cacheFound) {\n return cacheFound;\n // Else, we'll want to retrieve it.\n // We'll do this for posts and missions.\n }\n if (item.selectionRef === ENDPOINT_PARAMS.post) {\n dispatch(filtersIsLoading(true));\n return api.get(`/orgpost/${item.codeRef}/`)\n .then((response) => {\n const obj = Object.assign(response.data, { type: 'post', selectionRef: item.selectionRef, codeRef: item.codeRef });\n // push the object to cache\n responses.asyncFilterCache.push(obj);\n // and return the object\n return obj;\n })\n .catch((error) => {\n throw error;\n });\n }\n return {};\n });\n\n const asyncData = [];\n\n // actually execute our async calls\n Promise.all(asyncQueryProms)\n // Promise.all returns a single array which matches the order of the originating array\n .then((results) => {\n results.forEach((result) => {\n asyncData.push(result);\n });\n })\n .then(() => {\n asyncFilters.forEach((item, i) => {\n asyncData.forEach((data) => {\n // Do some formatting for post and mission data\n // for when they get put inside Pills/\n if (item.codeRef === data.codeRef) {\n const description = getPostOrMissionDescription(data);\n if (description) {\n asyncFilters[i].description = description;\n }\n }\n });\n });\n // Add our async params to the original mappedParams\n // and remove and any duplicates by the 'description' prop.\n responses.mappedParams.push(...responses.asyncParams);\n responses.mappedParams = removeDuplicates(responses.mappedParams, 'description');\n // Finally, dispatch a success\n dispatch(filtersFetchDataSuccess(responses));\n dispatch(filtersHasErrored(false));\n dispatch(filtersIsLoading(false));\n })\n .catch(() => {\n dispatch(filtersHasErrored(true));\n dispatch(filtersIsLoading(false));\n });\n }", "function createDefaultRequest() {\n // disable ontology\n return {\n solrTestClient: solrClientLib.createClient(SOLR_CLIENT_OPTIONS),\n logger: logger,\n app: {\n config: {\n ontologySuggest: {\n enabled: false,\n baseUrl: 'https://browser-aws-1.ihtsdotools.org',\n url: '/api/snomed',\n database: 'us-edition',\n version: 'v20150901'\n },\n solrClient: {\n core: SOLR_CORE,\n zooKeeperConnection: 'IP '\n },\n }\n },\n query: {\n pid: 'AAAA',\n query: 'pencollin'\n }\n };\n}", "function buildOptions (srcOptions) {\n\n var keys = ['method', 'url', 'params', 'body', 'cache', 'headers'];\n\n var result = {};\n\n keys.map(function (k) {\n\n if (srcOptions[k]) {\n result[k] = srcOptions[k];\n }\n });\n\n if (result.body) {\n if (result.headers && result.headers['Content-Type'] && result.headers['Content-Type'] === 'application/x-www-form-urlencoded') {\n result.body = serialize(result.body);\n }\n }\n\n return result;\n }", "addRequest(key, data) {\n this.requests[key] = {\n query_key: data.query_key,\n timestamp: data.timestamp,\n data_hash: data.data_hash,\n };\n }", "function getApartmentRequestData(data) {\n var newData = {};\n if(\"uid\" in data) {\n newData['user_id'] = data['uid'];\n }\n if(\"hn\" in data) {\n newData['name'] = data['hn'];\n }\n if(\"sk\" in data) {\n newData['secret_ky'] = data['sk'];\n }\n\n return newData;\n}", "function objectToDictionary(input) {\n let output = {};\n if (input.requestId) {\n output.requestId = input.requestId;\n }\n if (input.id) {\n output.id = input.id;\n }\n if (input.rawId && input.rawId.constructor === ArrayBuffer) {\n output.rawId = arrayBufferToBase64(input.rawId);\n }\n if (input.response && (input.response.constructor ===\n AuthenticatorAttestationResponse || input.response.constructor ===\n AuthenticatorAssertionResponse || input.response.constructor === Object\n )) {\n output.response = objectToDictionary(input.response);\n }\n if (input.attestationObject && input.attestationObject.constructor ===\n ArrayBuffer) {\n output.attestationObject = arrayBufferToBase64(input.attestationObject);\n }\n if (input.authenticatorData && input.authenticatorData.constructor ===\n ArrayBuffer) {\n output.authenticatorData = arrayBufferToBase64(input.authenticatorData);\n }\n if (input.authenticatorData && input.authenticatorData.constructor ===\n String) {\n output.authenticatorData = input.authenticatorData;\n }\n if (input.clientDataJSON && input.clientDataJSON.constructor ===\n ArrayBuffer) {\n output.clientDataJSON = arrayBufferToString(input.clientDataJSON);\n }\n if (input.clientDataJSON && input.clientDataJSON.constructor ===\n String) {\n output.clientDataJSON = atob(input.clientDataJSON);\n }\n if (input.info) {\n output.info = objectToDictionary(input.info);\n }\n if (input.signature && input.signature.constructor === ArrayBuffer) {\n output.signature = arrayBufferToBase64(input.signature);\n }\n if (input.signature && input.signature.constructor === String) {\n output.signature = input.signature;\n }\n if (input.userHandle && input.userHandle.constructor === ArrayBuffer) {\n output.userHandle = arrayBufferToBase64(input.userHandle);\n }\n if (input.userHandle && input.userHandle.constructor === String) {\n output.userHandle = input.userHandle;\n }\n if (input.type) {\n output.type = input.type;\n }\n if (input.methodName) {\n output.methodName = input.methodName;\n }\n if (input.details) {\n output.details = objectToDictionary(input.details);\n }\n if (input.appid_extension) {\n output.appid_extension = input.appid_extension;\n }\n if (input.challenge) {\n output.challenge = input.challenge;\n }\n if (input.echo_appid_extension) {\n output.echo_appid_extension = input.echo_appid_extension;\n }\n if (input.echo_prf) {\n output.echo_prf = input.echo_prf;\n }\n if (input.prf_not_evaluated) {\n output.prf_not_evaluated = input.prf_not_evaluated;\n }\n if (input.prf_results) {\n output.prf_results = objectToDictionary(input.prf_results);\n }\n if (input.user_handle) {\n output.user_handle = input.user_handle;\n }\n if (input.authenticator_data) {\n output.authenticator_data = input.authenticator_data;\n }\n if (input.client_data_json) {\n output.client_data_json = atob(input.client_data_json);\n }\n if (input.shippingAddress) {\n output.shippingAddress = input.shippingAddress;\n }\n if (input.shippingOption) {\n output.shippingOption = input.shippingOption;\n }\n if (input.payerName) {\n output.payerName = input.payerName;\n }\n if (input.payerEmail) {\n output.payerEmail = input.payerEmail;\n }\n if (input.payerPhone) {\n output.payerPhone = input.payerPhone;\n }\n return output;\n}", "function convertToOpenAPI(info, data) {\n const builder = new openapi3_ts_1.OpenApiBuilder();\n builder.addInfo(Object.assign(Object.assign({}, info.base), { title: info.base.title || '[untitled]', version: info.base.version || '0.0.0' }));\n info.contact && builder.addContact(info.contact);\n const tags = [];\n const paths = {};\n let typeCount = 1;\n const schemas = {};\n data.forEach(item => {\n [].concat(item.url).forEach(url => {\n if (typeof url !== 'string') {\n // TODO\n return;\n }\n url = url\n .split('/')\n .map((item) => (item.startsWith(':') ? `{${item.substr(1)}}` : item))\n .join('/');\n if (!tags.find(t => t.name === item.typeGlobalName)) {\n const ctrlMeta = controller_1.getControllerMetadata(item.typeClass);\n tags.push({\n name: item.typeGlobalName,\n description: (ctrlMeta && [ctrlMeta.name, ctrlMeta.description].filter(s => s).join(' ')) ||\n undefined,\n });\n }\n if (!paths[url]) {\n paths[url] = {};\n }\n [].concat(item.method).forEach((method) => {\n method = method.toLowerCase();\n function paramFilter(p) {\n if (p.source === 'Any') {\n return ['post', 'put'].every(m => m !== method);\n }\n return p.source !== 'Body';\n }\n function convertValidateToSchema(validateType) {\n if (validateType === 'string') {\n return {\n type: 'string',\n };\n }\n if (validateType === 'int' || validateType === 'number') {\n return {\n type: 'number',\n };\n }\n if (validateType.type === 'object' && validateType.rule) {\n let properties = {};\n const required = [];\n Object.keys(validateType.rule).forEach(key => {\n const rule = validateType.rule[key];\n properties[key] = convertValidateToSchema(rule);\n if (rule.required !== false) {\n required.push(key);\n }\n });\n const typeName = `GenType_${typeCount++}`;\n builder.addSchema(typeName, {\n type: validateType.type,\n required: required,\n properties,\n });\n return {\n $ref: `#/components/schemas/${typeName}`,\n };\n }\n if (validateType.type === 'enum') {\n return {\n type: 'string',\n };\n }\n return {\n type: validateType.type,\n items: validateType.itemType\n ? validateType.itemType === 'object'\n ? convertValidateToSchema({ type: 'object', rule: validateType.rule })\n : { type: validateType.itemType }\n : undefined,\n enum: Array.isArray(validateType.values)\n ? validateType.values.map(v => convertValidateToSchema(v))\n : undefined,\n maximum: validateType.max,\n minimum: validateType.min,\n };\n }\n function getTypeSchema(p) {\n if (p.schema) {\n return p.schema;\n }\n else if (p.validateType && p.validateType.type) {\n return convertValidateToSchema(p.validateType);\n }\n else {\n const type = utils_1.getGlobalType(p.type);\n const isSimpleType = ['array', 'boolean', 'integer', 'number', 'object', 'string'].some(t => t === type.toLowerCase());\n // TODO complex type process\n return {\n type: isSimpleType ? type.toLowerCase() : 'object',\n items: type === 'Array'\n ? {\n type: 'object',\n }\n : undefined,\n };\n }\n }\n // add schema\n const components = item.schemas.components || {};\n Object.keys(components).forEach(typeName => {\n if (schemas[typeName] && schemas[typeName].hashCode !== components[typeName].hashCode) {\n console.warn(`[egg-controller] type: [${typeName}] has multi defined!`);\n return;\n }\n schemas[typeName] = components[typeName];\n });\n // param\n const inParam = item.paramTypes.filter(paramFilter);\n // req body\n const inBody = item.paramTypes.filter(p => !paramFilter(p));\n let requestBody;\n if (inBody.length) {\n const requestBodySchema = {\n type: 'object',\n properties: {},\n };\n inBody.forEach(p => {\n if (p.required || util_1.getValue(() => p.validateType.required)) {\n if (!requestBodySchema.required) {\n requestBodySchema.required = [];\n }\n requestBodySchema.required.push(p.paramName);\n }\n requestBodySchema.properties[p.paramName] = getTypeSchema(p);\n });\n const reqMediaType = 'application/json';\n requestBody = {\n content: {\n [reqMediaType]: {\n schema: requestBodySchema,\n },\n },\n };\n }\n // res\n let responseSchema = item.schemas.response || {};\n const refTypeName = responseSchema.$ref;\n if (refTypeName) {\n const definition = item.schemas.components[refTypeName.replace('#/components/schemas/', '')];\n if (definition) {\n responseSchema = { $ref: refTypeName };\n }\n else {\n console.warn(`[egg-controller] NotFound {${refTypeName}} in components.`);\n responseSchema = { type: 'any' };\n }\n }\n const responses = {\n default: {\n description: 'default',\n content: {\n 'application/json': {\n schema: responseSchema,\n },\n },\n },\n };\n paths[url][method] = {\n operationId: item.functionName,\n tags: [item.typeGlobalName],\n summary: item.name,\n description: item.description,\n parameters: inParam.length\n ? inParam.map(p => {\n const source = p.source === 'Header' ? 'header' : p.source === 'Param' ? 'path' : 'query';\n return {\n name: p.paramName,\n in: source,\n required: source === 'path' || p.required || util_1.getValue(() => p.validateType.required),\n schema: getTypeSchema(p),\n };\n })\n : undefined,\n requestBody,\n responses,\n };\n });\n });\n });\n // add schema\n Object.keys(schemas).forEach(key => {\n delete schemas[key].hashCode;\n builder.addSchema(key, schemas[key]);\n });\n tags.forEach(tag => builder.addTag(tag));\n Object.keys(paths).forEach(path => builder.addPath(path, paths[path]));\n return JSON.parse(builder.getSpecAsJson());\n}", "static fromData(content) {\n const requestBody = new RequestBody();\n requestBody.objectData = content;\n return requestBody;\n }", "requestInfo(props, options = {}) {\n return this.req.requestInfo(props, options);\n }", "function build_url(type, api, req) {\n var url = 'http://' + req.headers.host + '/' + type + '/' + api._id,\n qs = [],\n key,\n arr_i;\n\n for (key in req.query) {\n if (req.query.hasOwnProperty(key)) {\n if (req.query[key] instanceof Array) {\n for (arr_i = 0; arr_i < req.query[key].length; arr_i++) {\n if (req.query[key][arr_i].trim() !== '') {\n qs.push(key + '[]=' + req.query[key][arr_i]);\n }\n }\n } else {\n if (req.query[key].trim() !== '') {\n qs.push(key + '=' + req.query[key]);\n }\n }\n }\n }\n\n if (qs.length > 0) {\n url = url + '?' + qs.join('&');\n }\n\n return url;\n }", "function buildRequest(options, req) {\n var operation = options.operation,\n requestBody = options.requestBody,\n securities = options.securities,\n spec = options.spec,\n attachContentTypeForEmptyPayload = options.attachContentTypeForEmptyPayload;\n var requestContentType = options.requestContentType;\n req = applySecurities({\n request: req,\n securities: securities,\n operation: operation,\n spec: spec\n });\n var requestBodyDef = operation.requestBody || {};\n\n var requestBodyMediaTypes = _babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_2___default()(requestBodyDef.content || {});\n\n var isExplicitContentTypeValid = requestContentType && requestBodyMediaTypes.indexOf(requestContentType) > -1; // for OAS3: set the Content-Type\n\n if (requestBody || attachContentTypeForEmptyPayload) {\n // does the passed requestContentType appear in the requestBody definition?\n if (requestContentType && isExplicitContentTypeValid) {\n req.headers['Content-Type'] = requestContentType;\n } else if (!requestContentType) {\n var firstMediaType = requestBodyMediaTypes[0];\n\n if (firstMediaType) {\n req.headers['Content-Type'] = firstMediaType;\n requestContentType = firstMediaType;\n }\n }\n } else if (requestContentType && isExplicitContentTypeValid) {\n req.headers['Content-Type'] = requestContentType;\n }\n\n if (!options.responseContentType && operation.responses) {\n var _context;\n\n var mediaTypes = _babel_runtime_corejs3_core_js_stable_instance_filter__WEBPACK_IMPORTED_MODULE_3___default()(_context = _babel_runtime_corejs3_core_js_stable_object_entries__WEBPACK_IMPORTED_MODULE_4___default()(operation.responses)).call(_context, function (_ref) {\n var _ref2 = _babel_runtime_corejs3_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_ref, 2),\n key = _ref2[0],\n value = _ref2[1];\n\n var code = parseInt(key, 10);\n return code >= 200 && code < 300 && lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_8___default()(value.content);\n }).reduce(function (acc, _ref3) {\n var _ref4 = _babel_runtime_corejs3_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1___default()(_ref3, 2),\n value = _ref4[1];\n\n return _babel_runtime_corejs3_core_js_stable_instance_concat__WEBPACK_IMPORTED_MODULE_5___default()(acc).call(acc, _babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_2___default()(value.content));\n }, []);\n\n if (mediaTypes.length > 0) {\n req.headers.accept = mediaTypes.join(', ');\n }\n } // for OAS3: add requestBody to request\n\n\n if (requestBody) {\n if (requestContentType) {\n if (requestBodyMediaTypes.indexOf(requestContentType) > -1) {\n // only attach body if the requestBody has a definition for the\n // contentType that has been explicitly set\n if (requestContentType === 'application/x-www-form-urlencoded' || requestContentType === 'multipart/form-data') {\n if (_babel_runtime_corejs3_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(requestBody) === 'object') {\n var encoding = (requestBodyDef.content[requestContentType] || {}).encoding || {};\n req.form = {};\n\n _babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_2___default()(requestBody).forEach(function (k) {\n req.form[k] = {\n value: requestBody[k],\n encoding: encoding[k] || {}\n };\n });\n } else {\n req.form = requestBody;\n }\n } else {\n req.body = requestBody;\n }\n }\n } else {\n req.body = requestBody;\n }\n }\n\n return req;\n} // Add security values, to operations - that declare their need on them", "getInputData() {\n var data = {};\n\n Object.keys(this.elements).forEach(key => {\n let content = this.elements[key];\n data[key] = {};\n\n // * If given section contains only one input dataset\n // * (contains only from & to keys)\n if (Object.keys(content).includes('from')) {\n \n let {from, to} = content;\n\n switch (key) {\n case 'datetime': {\n data[key].from = from.value;\n data[key].to = to.value;\n } break;\n }\n \n } else { // * Contains more datsets splited into own dicts\n Object.keys(content).forEach(section_key => {\n if (content != \"search-flights\") {\n\n data[key][section_key] = {};\n let element = content[section_key];\n\n switch (section_key) {\n\n case 'currency': {\n data[key][section_key].curr = (element.curr).value;\n } break;\n\n case 'price': {\n data[key][section_key].from = Number((element.from).value);\n data[key][section_key].to = Number((element.to).value);\n } break;\n\n case 'iata': {\n data[key][section_key].from = (element.from).value;\n data[key][section_key].to = (element.from).value;\n } break;\n\n // * Checkboxes\n case 'direct_flights': {\n data[key][section_key] = element.checked;\n } break;\n\n case 'lowest_price': {\n data[key][section_key] = element.checked;\n } break;\n\n case 'biggest_price': {\n data[key][section_key] = element.checked;\n } break;\n }\n }\n }); \n }\n });\n\n return data;\n }", "function RouteRequest() {\n return inject_route_data_1.default(route_property_name_1.default.REQUEST);\n}", "function buildRequest(options, req) {\n var operation = options.operation,\n requestBody = options.requestBody,\n securities = options.securities,\n spec = options.spec,\n attachContentTypeForEmptyPayload = options.attachContentTypeForEmptyPayload;\n var requestContentType = options.requestContentType;\n req = applySecurities({\n request: req,\n securities: securities,\n operation: operation,\n spec: spec\n });\n var requestBodyDef = operation.requestBody || {};\n\n var requestBodyMediaTypes = _babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_2___default()(requestBodyDef.content || {});\n\n var isExplicitContentTypeValid = requestContentType && requestBodyMediaTypes.indexOf(requestContentType) > -1; // for OAS3: set the Content-Type\n\n if (requestBody || attachContentTypeForEmptyPayload) {\n // does the passed requestContentType appear in the requestBody definition?\n if (requestContentType && isExplicitContentTypeValid) {\n req.headers['Content-Type'] = requestContentType;\n } else if (!requestContentType) {\n var firstMediaType = requestBodyMediaTypes[0];\n\n if (firstMediaType) {\n req.headers['Content-Type'] = firstMediaType;\n requestContentType = firstMediaType;\n }\n }\n } else if (requestContentType && isExplicitContentTypeValid) {\n req.headers['Content-Type'] = requestContentType;\n }\n\n if (!options.responseContentType && operation.responses) {\n var _context;\n\n var mediaTypes = _babel_runtime_corejs3_core_js_stable_instance_filter__WEBPACK_IMPORTED_MODULE_3___default()(_context = _babel_runtime_corejs3_core_js_stable_object_entries__WEBPACK_IMPORTED_MODULE_4___default()(operation.responses)).call(_context, function (_ref) {\n var _ref2 = (0,_babel_runtime_corejs3_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__.default)(_ref, 2),\n key = _ref2[0],\n value = _ref2[1];\n\n var code = parseInt(key, 10);\n return code >= 200 && code < 300 && lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_8___default()(value.content);\n }).reduce(function (acc, _ref3) {\n var _ref4 = (0,_babel_runtime_corejs3_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_1__.default)(_ref3, 2),\n value = _ref4[1];\n\n return _babel_runtime_corejs3_core_js_stable_instance_concat__WEBPACK_IMPORTED_MODULE_5___default()(acc).call(acc, _babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_2___default()(value.content));\n }, []);\n\n if (mediaTypes.length > 0) {\n req.headers.accept = mediaTypes.join(', ');\n }\n } // for OAS3: add requestBody to request\n\n\n if (requestBody) {\n if (requestContentType) {\n if (requestBodyMediaTypes.indexOf(requestContentType) > -1) {\n // only attach body if the requestBody has a definition for the\n // contentType that has been explicitly set\n if (requestContentType === 'application/x-www-form-urlencoded' || requestContentType === 'multipart/form-data') {\n if ((0,_babel_runtime_corejs3_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__.default)(requestBody) === 'object') {\n var encoding = (requestBodyDef.content[requestContentType] || {}).encoding || {};\n req.form = {};\n\n _babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_2___default()(requestBody).forEach(function (k) {\n req.form[k] = {\n value: requestBody[k],\n encoding: encoding[k] || {}\n };\n });\n } else {\n req.form = requestBody;\n }\n } else {\n req.body = requestBody;\n }\n }\n } else {\n req.body = requestBody;\n }\n }\n\n return req;\n} // Add security values, to operations - that declare their need on them", "function generateOAPIParameters() {\n\n return [\n {\n \"name\": \"id\",\n \"in\": \"path\",\n \"description\": \"ID of the requested object in the database.\",\n \"required\": true,\n \"schema\": {\n \"type\": \"integer\",\n \"format\": \"int32\"\n },\n \"style\": \"simple\"\n }\n ];\n\n}", "function getPostObject(state)\n{\n\nlet measurement_description = { \n type:state.type,\n key:getKey(),\n start_time:formatDate(state.start_time),\n end_time:formatDate(state.end_time),\n count:state.count,\n interval_sec:1,\n priority:state.priority,\n parameters:{\n target:state.target.substring(8),\n server:\"null\",\n direction:state.tcp_speed_test, \n }\n };\nlet job_description = {\n measurement_description,\n node_count:state.node_count,\n job_interval:state.job_interval\n}\n\nlet result={job_description, request_type:\"SCHEDULE_MEASUREMENT\" ,user_id:getKey(), };\n\nreturn result;\n}", "function convert_single_request(data, orig) {\n var obj = {};\n\n var t = orig.type;\n\n if (orig.cached) {\n obj.cached = 1;\n obj.sizecache = orig.size;\n } else {\n obj.size = orig.size;\n }\n\n if (!orig.url.startsWith(\"data:\"))\n obj.url = orig.url;\n\n obj.url_display = sanitize_url(orig.url);\n obj.code = orig.code;\n\n // add the request to one of lists\n if (t != \"Document\" && t != \"Script\" && t != \"Stylesheet\" &&\n t != \"Image\" && t != \"XHR\" && t != \"Font\") {\n obj.type = t;\n t = \"Other\";\n }\n var list = data.sections[t];\n if (!list) {\n data.sections[t] = [];\n list = data.sections[t];\n }\n list.push(obj);\n\n // update counts\n var names = [\"total\", t+\"count\"];\n for (const name of names) {\n var total = get_counters(data, name);\n// total[\"reqtotal\"] += 1;\n// total[\"kbtotal\"] += orig.size;\n if (orig.cached) {\n total[\"reqcached\"] += 1;\n total[\"kbcached\"] += orig.size;\n } else {\n total[\"reqtransf\"] += 1;\n total[\"kbtransf\"] += orig.size;\n }\n }\n\n}", "function dynamicAccountLinkMappings(accountLink, request){\n var objectValue;\n\t\tvar key;\n var value;\n var apiNameList;\n\t\t//var accountLinkMap = new Map();\n\t\tvar accountLinkMap = new Map(Object.entries(accountLink));\n console.log('<--------- INSIDE dynamicAccountLinkMappings ------------>');\n\t\tconsole.log('<--------- INSIDE dynamicAccountLinkMappings account link length ------------>' + accountLinkMap.size);\n\t\tconsole.log('<--------- INSIDE dynamicAccountLinkMappings account link id ------------>' + accountLinkMap.get('id'));\n var responseMap = new Map();\n \n //To handle Date format in response\n //Schema.SObjectType t = Schema.getGlobalDescribe().get('Account_Link__c'); \n //Schema.DescribeSObjectResult r = t.getDescribe();\n \n\t\tvar dateValue;\n \n responseMap.set('messageId', request.messageId);\n responseMap.set('messageStatus', 'Success');\n responseMap.set('errorCode', '');\n responseMap.set('errorMessage', '');\n responseMap.set('errorCategory', '');\n \n console.log('metadataFieldsMap ====>' + metadataFieldsMap);\n\t\t\n if(metadataFieldsMap != null && metadataFieldsMap.size >0){\n //for(String responseTag: metadataFieldsMap.keySet()){\n\t\t\t\t\n\t\t\tfor(let responseTag of metadataFieldsMap.keys()) {\t\n console.log('responseTag ====>' + responseTag);\n if(responseTag == 'salesConsultantFedId' || responseTag == 'workPhone' || responseTag =='homePhone' ){\n if(responseTag == 'salesConsultantFedId'){\n\t\t\t\t\t\tobjectValue = metadataFieldsMap.get(responseTag);\n\t\t\t\t\t\tconsole.log (\"objectValue inside salesConsultantFedId if \" + objectValue);\n\t\t\t\t\t\tif(String(objectValue).equalsIgnoreCase(\"NA\")){\n\t\t\t\t\t\t\tresponseMap.set(responseTag, '');\n\t\t\t\t\t\t}\n else if(salesConsultantSearch != null){\n if(salesConsultantSearch == 'None'){\n responseMap.set(responseTag, salesConsultantFedIdInRequest);\n }else if(salesConsultantSearch == 'Owner'){\n //Code to implemented as per the desin finalized\n responseMap.set(responseTag, salesConsultantFedIdInRequest);\n }else if(salesConsultantSearch == 'Sales Consultant'){\n //Code to implemented as per the desin finalized\n responseMap.set(responseTag, salesConsultantFedIdInRequest);\n } \n }else { // Else part to be removed post final design implementation\n responseMap.set(responseTag, salesConsultantFedIdInRequest);\n }\n }else if(responseTag == 'workPhone'){\n\t\t\t\t\t\tobjectValue = metadataFieldsMap.get(responseTag);\n\t\t\t\t\t\tconsole.log (\"objectValue inside workPhone if \" + objectValue);\n\t\t\t\t\t\tif(String(objectValue).equalsIgnoreCase(\"NA\")){\n\t\t\t\t\t\t\tresponseMap.set(responseTag, '');\n\t\t\t\t\t\t}\n else if(request.recordType =='Company'){\n responseMap.set(responseTag, accountLinkMap.get('Retail_Company_Other_Phone__c'));\n }else {\n responseMap.set(responseTag, accountLinkMap.get('Retail_Work_Phone__c'));\n }\n }else if(responseTag =='homePhone'){\n\t\t\t\t\t\tobjectValue = metadataFieldsMap.get(responseTag);\n\t\t\t\t\t\tconsole.log (\"objectValue inside homePhone if \" + objectValue);\n\t\t\t\t\t\tif(String(objectValue).equalsIgnoreCase(\"NA\")){\n\t\t\t\t\t\t\tresponseMap.set(responseTag, '');\n\t\t\t\t\t\t}\n else if(request.recordType =='Company'){\n responseMap.set(responseTag, accountLinkMap.get('Retail_Company_Phone__c'));\n }else {\n responseMap.set(responseTag, accountLinkMap.get('Retail_Individual_Home_Phone__c'));\n }\n } \n }else if (responseTag =='recordTypeName'){\t\t\t\t\t\t\t\n\t\t\t\t\t\t responseMap.set(responseTag, accountLinkMap.get('rname'));\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse {\n objectValue = metadataFieldsMap.get(responseTag);\n console.log('objectValue ====>' + objectValue);\n\t\t\t\t\t\n if(String(objectValue).equalsIgnoreCase(\"NA\")){\n\t\t\t\t\t\t\n console.log('INSIDE IF ====>');\n responseMap.set(responseTag, ''); \n }\n if(objectValue.includes('-')){\n apiNameList = objectValue.split('-');\n console.log('apiNameList ====>' + apiNameList);\n \n\t\t\t\t\t\t\t//if(null != accountLink.find(apiNameList[0].trim())){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n if(apiNameList != null && apiNameList.length == 2){\n //value = String.valueOf(accountLink.find(apiNameList[0].trim()).get(apiNameList[1].trim()));\n\t\t\t\t\t\t\t\t\t key = (apiNameList[1].toLowerCase()).trim();\n\t\t\t\t\t\t\t\t\t console.log('key ====>' + key);\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t value = accountLinkMap.get(key);\n\t\t\t\t\t\t\t\t\t //value = accountLinkMap.get('id');\n\t\t\t\t\t\t\t\t\t console.log('value ====>' + value);\n responseMap.set(responseTag, (value == null || value.length == 0) ? '' : value);\n\t\t\t\t\t\t\t\t\t\n }else if(apiNameList != null && apiNameList.size() == 3){\n //value = String.valueOf(accountLink.find(apiNameList[0].trim()).find(apiNameList[1].trim()).get(apiNameList[2].trim()));\n //responseMap.set(responseTag, String.isBlank(value)? '' : value);\n\t\t\t\t\t\t\t\t\tkey = (apiNameList[2].toLowerCase()).trim();\n\t\t\t\t\t\t\t\t\t console.log('key ====>' + key);\n\t\t\t\t\t\t\t\t\t value = accountLinkMap.get(key);\n\t\t\t\t\t\t\t\t\t //value = accountLinkMap.get('id');\n\t\t\t\t\t\t\t\t\t console.log('value ====>' + value);\n responseMap.set(responseTag, (value == null || value.length == 0) ? '' : value);\n }else if(apiNameList != null && apiNameList.size() == 4){\n //value = String.valueOf(accountLink.find(apiNameList[0].trim()).find(apiNameList[1].trim()).find(apiNameList[2].trim()).get(apiNameList[3].trim()));\n //responseMap.set(responseTag, String.isBlank(value)? '' : value);\n\t\t\t\t\t\t\t\t\tkey = (apiNameList[3].toLowerCase()).trim();\n\t\t\t\t\t\t\t\t\t console.log('key ====>' + key);\n\t\t\t\t\t\t\t\t\t value = accountLinkMap.get(key);\n\t\t\t\t\t\t\t\t\t //value = accountLinkMap.get('id');\n\t\t\t\t\t\t\t\t\t console.log('value ====>' + value);\n responseMap.set(responseTag, (value == null || value.length == 0) ? '' : value);\n } \n // }\n }\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tconsole.log ('inside else as objectValue does not include -');\n /*Schema.DescribeFieldResult f = r.fields.getMap().get(metadataFieldsMap.get(responseTag)).getDescribe();\n if(f.getType() == Schema.DisplayType.Date){\n dateValue = Date.valueOf(accountLink.get(metadataFieldsMap.get(responseTag))); \n if(null == dateValue){\n responseMap.set(responseTag, ''); \n }else{\n responseMap.set(responseTag, dateValue);\n } \n }else {\n value = String.valueOf(accountLink.get(metadataFieldsMap.get(responseTag)));\n responseMap.set(responseTag, String.isBlank(value)? '' : value);\n }\n\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\tconsole.log ('objectValue ::::::::::: ' + objectValue);\n\t\t\t\t\t\t\tif(objectValue != null)\n\t\t\t\t\t\t\tkey = (objectValue.toLowerCase()).trim();\n\t\t\t\t\t\t\tif(key.includes('date')){\n\t\t\t\t\t\t\t\tvar value = accountLinkMap.get(key);\n\t\t\t\t\t\t\t\tconsole.log ('value ::::::::::: ' + value);\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(value!= null && value.toString()!= null && value.toString().length>0){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tvalue = (value.toISOString()).replace(/\\T.+/, '');\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tconsole.log ('date value in else ::::::::::: ' + value);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t value = accountLinkMap.get(key);\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//console.log ('value in else ::::::::::: ' + value.toString());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tresponseMap.set(responseTag, (value == null || value.length == 0) ? '' : value); \n }\n }\n }\n }\n \n console.log('responseMap ----->' + responseMap);\n\t\tconsole.log('responseMap length ----->' + responseMap.size);\n return responseMap;\n }", "function normalizeInfoUser(request) {\n return {\n _id: request._id,\n nombre: request.nombre,\n correo: request.correo,\n imagen: request.imagen\n }\n}", "function prepPutPartyRequest(data) {\n let putPartyRequest = {\n 'FunctionName': 'party',\n 'Payload': JSON.stringify({\n 'firstName': 'testFirstName',\n 'lastName': 'testLastName'\n })\n };\n putPartyRequest.Payload = JSON.stringify(data);\n\n return putPartyRequest;\n }", "static initialize(obj, type, businessId, apiSecret, mspId) { \n obj['businessId'] = businessId;\n obj['apiSecret'] = apiSecret;\n obj['mspId'] = mspId;\n }", "static async getInitialProps(props) {\n const { address} = props.query; // address variable is like a wildcard defined in the route.js\n const contract = Contract(address); // pass teh address to the arrow function to Contract and get the instance\n const requestCount = await contract.methods.getRequestsCount().call();\n const approversCount = await contract.methods.approversCount().call();\n\n // Array(count).fill.map() runs number of times starting from 0 and more and gets the elements\n const requests = await Promise.all(\n Array(parseInt(requestCount)).fill().map((element, index) => {\n return contract.methods.requests(index).call()\n }) \n );\n\n\n return { address, requests, requestCount, approversCount }; // its read as address: address\n\n }", "function apiSchema(fields, api) {\n const t = new GraphQLObjectType\n ( { name: api.name\n , description: api.description\n , fields: () => _.reduce ( api.fields, R.addField, {} )\n }\n )\n fields[api.name] =\n { type: t\n // TODO: allow custom resolve hook for an API (i.e. means of handling auth)\n , resolve: api.resolve\n ? (__, a, r) => api.resolve(r.e$, a, r)\n : () => ({ api: api.name })\n }\n return fields\n }", "function createInitialLayout(api) {\n let section = document.createElement('section');\n section.setAttribute('id', api.name);\n section.classList.add('hidden');\n section.classList.add('details');\n\n let heading = document.createElement('h2');\n heading.textContent = api.name;\n section.appendChild(heading);\n\n let inputs = [];\n // Add several new input boxes.\n for (let i = 0; i < api.fields.length; i++) {\n let input = document.createElement('input');\n input.setAttribute('type', 'text');\n input.setAttribute('placeholder', api.fields[i]);\n\n section.appendChild(input);\n inputs.push(input);\n }\n\n let submit = document.createElement('button');\n submit.textContent = 'Add new';\n // Submit the data from the current fields. This part's kinda a doozy.\n submit.addEventListener('click', function () {\n // Create an empty object. We'll add properties to it in the loop but the properties we need to add will\n // depend on the values of api.fields.\n let submission = {};\n for (let i = 0; i < api.fields.length; i++) {\n submission[api.fields[i]] = inputs[i].value;\n } // end for loop\n\n // Send the POST request.\n sendAlong(api, submission);\n });\n section.appendChild(submit);\n\n let list = document.createElement('ul');\n\n section.appendChild(list);\n document.querySelector('main').appendChild(section);\n}", "async getWSInitialRequest(operation)\n\t{\n\t\tif (operation === 'FEDummy') {\n\t\t\treturn {};\n\t\t}\n\n\t\tconst { token, sign } = await this.afip.GetServiceTA('wsfe');\n\n\t\treturn {\n\t\t\t'Auth' : { \n\t\t\t\t'Token' : token,\n\t\t\t\t'Sign' \t: sign,\n\t\t\t\t'Cuit' \t: this.afip.CUIT\n\t\t\t\t}\n\t\t};\n\t}", "function prepareAPI(api, method, token) {\n return {\n async: true,\n json: true,\n crossDomain: true,\n url: `https://inthe.am/api/v2/${api}/`,\n method,\n headers: {\n authorization: `Token ${token}`,\n 'cache-control': 'no-cache',\n 'Content-Type': 'application/json',\n Referer: 'https://inthe.am/',\n },\n data: '',\n processData: false,\n }\n}", "function processRequestBody(inputData, params) {\n var requestBody = {},\n missingParams = [],\n paramValue;\n _.forEach(params, function (param) {\n paramValue = _.get(inputData, param.name);\n if (WM.isDefined(paramValue) && (paramValue !== '')) {\n paramValue = Utils.isDateTimeType(param.type) ? Utils.formatDate(paramValue, param.type) : paramValue;\n //Construct ',' separated string if param is not array type but value is an array\n if (WM.isArray(paramValue) && _.toLower(Utils.extractType(param.type)) === 'string') {\n paramValue = _.join(paramValue, ',');\n }\n requestBody[param.name] = paramValue;\n } else if (param.required) {\n missingParams.push(param.name || param.id);\n }\n });\n return {\n 'requestBody' : requestBody,\n 'missingParams' : missingParams\n };\n }" ]
[ "0.56026655", "0.5550744", "0.5280476", "0.5263608", "0.5169081", "0.5135113", "0.50437146", "0.5019758", "0.5007848", "0.50032365", "0.49942538", "0.4980435", "0.4964532", "0.49496245", "0.4940132", "0.49246657", "0.49220482", "0.48945662", "0.4882811", "0.48472273", "0.48463368", "0.4841079", "0.483144", "0.4819095", "0.48182726", "0.4797521", "0.47903404", "0.47747445", "0.4772363", "0.47688314", "0.476184", "0.4743586", "0.47292262", "0.4725218", "0.47208866", "0.4715867", "0.47137558", "0.46863982", "0.46836472", "0.46825927", "0.46666765", "0.4656682", "0.4653692", "0.46536526", "0.4651106", "0.46487105", "0.46468645", "0.464564", "0.46415398", "0.46415082", "0.46308446", "0.4630543", "0.46277562", "0.4623778", "0.46202993", "0.46192294", "0.4611388", "0.46102062", "0.46068695", "0.46038583", "0.46011084", "0.45944276", "0.45858404", "0.45844576", "0.45808655", "0.45801723", "0.45648995", "0.45635787", "0.45604798", "0.45554113", "0.45552766", "0.45533228", "0.45490906", "0.45406407", "0.4539182", "0.4531722", "0.45305908", "0.4525423", "0.45221725", "0.4522154", "0.45046952", "0.450466", "0.44925874", "0.44754794", "0.44640633", "0.44624907", "0.4453822", "0.445352", "0.44530955", "0.44488353", "0.44352293", "0.44284454", "0.4426178", "0.44251198", "0.44205856", "0.44189495", "0.44173837", "0.44146663", "0.4408058", "0.4399863" ]
0.69339496
0
Returns the base URL for the API call (either REST or NVP)
function getApiBaseURL(gatewayHost, apiProtocol) { switch (apiProtocol) { case "REST": return gatewayHost + "/api/rest"; case "NVP": return gatewayHost + "/api/nvp" default: throwUnsupportedProtocolException(); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRequestBaseURL() {\n\n var url;\n\n if (useProxy) {\n url = proxyURL;\n } else if (oauth && oauth.instance_url) {\n url = oauth.instance_url;\n } else {\n url = serverURL;\n }\n\n // dev friendly API: Remove trailing '/' if any so url + path concat always works\n if (url.slice(-1) === '/') {\n url = url.slice(0, -1);\n }\n\n return url;\n }", "function getBaseURL() {\n var baseURL = window.location.protocol + '//' + window.location.hostname + ':' + api_port;\n return baseURL;\n}", "function getAPIBaseURL() {\n let baseURL = window.location.protocol\n + '//' + window.location.hostname\n + ':' + window.location.port\n + '/api';\n return baseURL;\n}", "static get restBaseUrl() {\n return `${BASE_URL}`;\n }", "function getBaseUrl() {\n return window.location.protocol + \"//\" + window.location.host;\n}", "function GetBaseUrl(context) {\n var baseUrl = \"\";\n const FHIRVersion = \"/4_0_0/\";\n var protocol = \"http://\";\n if (context.req.secure) { protocol = \"https://\"; }\n baseUrl = protocol + context.req.headers.host + FHIRVersion;\n return baseUrl;\n}", "get BASE_URL() {\n return this.USE_LOCAL_BACKEND ?\n 'http://' + manifest.debuggerHost.split(`:`).shift() + ':3000/' + this.API_VERSION :\n 'https://mhacks.org/' + this.API_VERSION\n }", "get apiUrl() {\n return `http://${this.host}:${this.tempApiPort}/api`; // setups up the url that the api is located at and used as a shortcut for our fetch api scripts to retrieve data\n }", "function getBaseURL() {\n var protocol = window.location.protocol;\n var hostname = window.location.hostname;\n var port = window.location.port;\n return protocol + \"//\" + hostname + \":\" + port;\n}", "getApiBaseUrl() {\n // eslint-disable-next-line no-undef\n return process.env.API_BASE_URL;\n }", "function getBaseUrl() {\n var baseUrl = getOption('baseUrl');\n if (!baseUrl || baseUrl === '/') {\n baseUrl = (typeof location === 'undefined' ?\n 'http://localhost:8888/' : location.origin + '/');\n }\n return url_1.URLExt.parse(baseUrl).toString();\n }", "baseURL() {\n \n return config.baseURL\n }", "function getPageBaseURL() {\n var baseURL = window.location.protocol + '//' + window.location.hostname + ':' + window.location.port;\n return baseURL;\n}", "function getBaseURL(host) {\n if (g_dropboxApiEndpoint) {\n // Return custom Dropbox API endpoint\n return g_dropboxApiEndpoint\n } else {\n // Default Dropbox behavior\n return 'https://' + host + '.dropboxapi.com/2/';\n }\n}", "function setBaseURL(){\n return baseURL = 'http://' + config.getListenAddress() + ':' + config.getListenPort() + '/api/' + config.getVersion() + '/addressbook/'\n}", "function getBaseUrl() {\n\tvar base;\n\n\tif (getURLParameter($(location).attr('href'), \"base\") != null) {\n\t\tbase = getURLParameter($(location).attr('href'), \"base\");\n\t} else {\n\n\t\tif (window.location.protocol == 'http:' || window.location.protocol == 'https:')\n\t\t\tbase = window.location.protocol + \"//\" + window.location.host;\n\t\telse\n\t\t\tbase = window.location.host;\n\t}\n\n\treturn base;\n}", "get_url() {\n this._authentication.state = crypto.randomBytes(6).toString('hex');\n // Replace 'api' from the api_url to get the top level trakt domain\n const base_url = this._settings.endpoint.replace(/api\\W/, '');\n return `${base_url}/oauth/authorize?response_type=code&client_id=${this._settings.client_id}&redirect_uri=${this._settings.redirect_uri}&state=${this._authentication.state}`;\n }", "function getBaseUrl() {\n return process.env.BASE_URL || defaultBaseUrl;\n}", "function getBaseUrl(){\n return window.location.href.replace(/\\?.*/,'');\n}", "function getBaseUrl() {\r\n\tvar baseurl;\r\n\tif (jQuery('base').length > 0) {\r\n\t\tbaseurl = jQuery('base').prop('href');\r\n\t} else {\r\n\t\tif (window.location.protocol != \"https:\") {\r\n\t\t\tbaseurl = 'http://' + window.location.hostname;\r\n\t\t} else {\r\n\t\t\tbaseurl = 'https://' + window.location.hostname;\r\n\t\t}\r\n\t}\r\n\treturn baseurl;\r\n}", "getTokenRequestUrl() {\r\n return config.oauthTokenRequestBaseUrl;\r\n }", "function apiURL(service) { //Función para formar la ruta completa a la API \n return BaseApiUrl + service;\n}", "function getBaseURL() {\n if (__CLIENT__) {\n return window.location.origin;\n } else if (process.env.DOCKER === 'true') {\n return `http://${config.hosts.django}:${config.ports.django}`;\n }\n\n return `http://localhost:${config.ports.django}`;\n}", "function urlBase(config) {\n if ((0, _ramda.type)(config) === 'Null' || (0, _ramda.type)(config) === 'Object' && !(0, _ramda.has)('url_base_pathname', config) && !(0, _ramda.has)('requests_pathname_prefix', config)) {\n throw new Error('\\n Trying to make an API request but \"url_base_pathname\" and\\n \"requests_pathname_prefix\"\\n is not in `config`. `config` is: ', config);\n } else if ((0, _ramda.has)('url_base_pathname', config) && !(0, _ramda.has)('requests_pathname_prefix', config)) {\n return config.url_base_pathname;\n } else if ((0, _ramda.has)('requests_pathname_prefix', config)) {\n return config.requests_pathname_prefix;\n } else {\n throw new Error('Unhandled case trying to get url_base_pathname or\\n requests_pathname_prefix from config', config);\n }\n}", "function GetBaseUrlPath() {\n var url = window.location.protocol + \"//\" + window.location.host + \"/\";\n return url;\n}", "function GetBaseUrlPath() {\n var url = window.location.protocol + \"//\" + window.location.host + \"/\";\n return url;\n}", "get apiBaseUrl() {\n if (!this.appConfig) {\n throw Error('Config file not loaded!');\n }\n return this.appConfig.apiBaseUrl;\n }", "get BaseURL() {\n return this[sBaseURL];\n }", "function api_url(data){\n\treturn base_url+data;\n}", "static get API_URL(){\n\t\tconst port = 8081;\n\t\treturn `http://localhost:${port}`\n\t}", "static get baseUrl() {\n return 'https://api.opencagedata.com';\n }", "function getBaseURL(network){\n var baseURL;\n if (network === \"testnet\"){\n baseURL = \"https://api.blockcypher.com/v1/btc/test3\";\n } \n else if (network === \"blockcypher-testnet\") {\n baseURL = \"https://api.blockcypher.com/v1/bcy/test\";\n } \n else {\n baseURL = \"https://api.blockcypher.com/v1/btc/main\"; \n }\n return baseURL;\n }", "function getBaseUrl() {\n var baseUrl = getConfigOption('baseUrl');\n if (!baseUrl || baseUrl === '/') {\n baseUrl = (typeof location === 'undefined' ?\n 'http://localhost:8888/' : location.origin + '/');\n }\n return baseUrl;\n}", "getRequestUrl () {\n let url = new URL(this.base);\n\n const newSearchParams = new URLSearchParams(url.searchParams);\n newSearchParams.set('client_id', this.client.clientId);\n newSearchParams.set('redirect_uri', this.redirectUri);\n newSearchParams.set('response_type', 'code');\n newSearchParams.set('scope', 'activity:read_all');\n\n url.search = newSearchParams;\n return url;\n }", "function getBaseApiEndpoint(dsn) {\n\t const protocol = dsn.protocol ? `${dsn.protocol}:` : '';\n\t const port = dsn.port ? `:${dsn.port}` : '';\n\t return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ''}/api/`;\n\t}", "function restBaseUrl() {\n return '/admin';\n }", "function baseUrl() {\n\n var protocol = window.location.protocol\n , host = window.location.host\n , pathName = window.location.pathname.split('/');\n\n return protocol + '//' + host + '/' + pathName[1];\n\n}", "get __effectiveBaseUrl() {\n return this.baseUrl\n ? this.constructor.__createUrl(\n this.baseUrl,\n document.baseURI || document.URL\n ).href.replace(/[^\\/]*$/, '')\n : '';\n }", "get __effectiveBaseUrl() {\n return this.baseUrl\n ? this.constructor\n .__createUrl(this.baseUrl, document.baseURI || document.URL)\n .href.replace(/[^\\/]*$/, \"\")\n : \"\";\n }", "function base_url() {\n return 'http://10.10.0.242/Vales/';\n}", "url() {\n const params = {};\n\n if (this.options.start !== undefined) {\n params.start = this.options.start;\n }\n\n if (this.options.branch !== undefined) {\n params.branch = this.options.branch;\n }\n\n return this.options.urlBase + '?' + $.param(params);\n }", "function getBaseApiEndpoint(dsn) {\n const protocol = dsn.protocol ? `${dsn.protocol}:` : '';\n const port = dsn.port ? `:${dsn.port}` : '';\n return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ''}/api/`;\n }", "getBaseUrl(app) {\n return this.baseUrl||'';\n }", "getServerAPIURL() {\n let result = \"/api\";\n if ((window.ENV) && (window.ENV.serverURL)) {\n result = window.ENV.serverURL;\n }\n return result;\n }", "get __effectiveBaseUrl() {\n return this.baseUrl\n ? this.constructor.__createUrl(\n this.baseUrl,\n document.baseURI || document.URL\n ).href.replace(/[^\\/]*$/, '')\n : '';\n }", "function getapi(){\n\tif (window.location.protocol != \"https:\"){\n\t\treturn \"http://wev.se/etc/api\";\n\t} else{\n\t\treturn \"https://wev.se/etc/api\";\n\t}\n}", "baseURL() {\n return '/vstack/query-builder'\n }", "function getBasePath () {\n\n return (process.env.NODE_ENV === 'production') ?\n 'http://ghanozjson.ap01.aws.af.cm' : 'http://localhost:3000';\n}", "get apiRoot() {\n if (this.config.apiRoot) {\n return this.config.serverUrl + '/' + this.config.apiRoot;\n }\n return this.config.serverUrl;\n }", "function generateEndpointURL () {\n var querystring = $.param({\n advisor_profile_id: this[options.advisorIdAttribute],\n start_at: this[options.startDateAttribute].toISOString(),\n ndays: options.nDays\n });\n return API_ENDPOINT + '?' + querystring;\n }", "function getBaseApiEndpoint(dsn) {\n const protocol = dsn.protocol ? `${dsn.protocol}:` : '';\n const port = dsn.port ? `:${dsn.port}` : '';\n return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ''}/api/`;\n}", "function getBaseApiEndpoint(dsn) {\n const protocol = dsn.protocol ? `${dsn.protocol}:` : '';\n const port = dsn.port ? `:${dsn.port}` : '';\n return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ''}/api/`;\n}", "getFinalUrl() {\n let url = Request.mergeUrls(this.host, this.url);\n const urlParams = this.getUrlParams();\n if (urlParams.length > 0) {\n url += `?${urlParams}`;\n }\n return url;\n }", "function fnBaseURLWeb(url) {\n return window.appURL + url;\n}", "getRestUrl(endPoint, type) {\n let url = '';\n if (endPoint === 'auth') {\n url = BASIC_URL + this.serviceUrls[endPoint];\n } else if (type === 'user') {\n url =\n BASE_URL +\n '/' +\n this.siteId +\n '/users/' +\n this.getUserRole() +\n this.serviceUrls[endPoint];\n } \n else if(type === 'cart'){\n url =\n BASE_URL +\n '/' +\n this.siteId +\n '/users/' +\n this.getUserRole() +\n '/carts/' +\n this.getCartGuid() +\n this.serviceUrls[endPoint];\n } else if (type === 'userid') {\n url = BASE_URL + '/' + this.siteId + '/users/';\n } else if (type === 'subscribe') {\n url =\n BASE_URL +\n '/' +\n this.siteId +\n '/users/' +\n this.getUserRole() +\n '/carts/' +\n this.getSubscribtionCartId() +\n this.serviceUrls[endPoint];\n } else {\n url = BASE_URL + '/' + this.siteId + this.serviceUrls[endPoint];\n }\n if (!this.isMock && this.isMock !== 'true') {\n return url;\n }\n return this.getMockURL(url);\n }", "function getAPI() {\n\treturn \"http://\" + apiUrl + \":\" + apiPort + \"/\" + apiResource;\n}", "function setAPIBaseUrl() {\n\tnew BRequest().setAPIBaseUrl();\n}", "getPublicUrl( endpoint, params ) {\n let qstr = this._ajax.serializeData( Object.assign( {}, params ) );\n return this._apiurl + endpoint + '?' + qstr;\n }", "function makeNormalUrl(urlPart) {\n\t return constants.domainBase + constants.apiBaseUrl + urlPart;\n\t}", "async function get_api_url () {\n const { protocol, host, port } = await get_options();\n return `${protocol}://${host}:${port}/gui`;\n}", "get() {\n // generate the url\n const url = this.base_url ? this.base_url + this.parseQuery() : this.parseQuery();\n // reset the url so the query object can be re-used\n this.reset();\n return url;\n }", "function api_create_url(){\n // Store our API URL parameters in this utility object\n var params = {\n \"method\": \"flickr.photosets.getPhotos\",\n \"api_key\": window.api_key,\n \"photoset_id\": window.photoset_id,\n \"format\": \"json\",\n \"nojsoncallback\": \"1\",\n \"extras\": \"url_m\"\n };\n\n // Construct the URL from the params\n var url = \"https://api.flickr.com/services/rest/?\";\n for (var prop in params){ url += prop+\"=\"+params[prop]+\"&\"; }\n\n return url;\n}", "buildUrl() {\n let url = this.hostname;\n\n if (this.port !== 80) {\n url += ':' + this.port;\n }\n\n let path = this.path;\n if (path.substring(0, 1) !== '/') {\n path = '/' + path;\n }\n\n url += path;\n\n url = replaceUrlParams(url, this.givenArgs);\n url = url.replace('//', '/');\n url = 'https://' + url;\n return url;\n }", "static get API_URL() {\r\n const port = 1337; // Change this to your server port\r\n return `http://localhost:${port}/`;\r\n }", "function makeNormalUrl(urlPart) {\n return domainBase + apiBaseUrl + urlPart;\n}", "function makeNormalUrl(urlPart) {\n return domainBase + apiBaseUrl + urlPart;\n}", "baseUrl() {\n // console.log(\"baseUrl: \" + process.env.REACT_APP_URL);\n\n return (process.env.REACT_APP_URL) ? process.env.REACT_APP_URL : \"/api/\";\n }", "function buildRequestUrl(base, headlines, countryQuery, categoryQuery) {\n return base + headlines + countryQuery + \"&\" + categoryQuery;\n}", "static get DEFAULT_API_BASE_URL() { return 'https://api.todobot.io'; }", "getEndpointUrl() {\n let path = super.getEndpointUrl();\n if (!path.startsWith('/')) {\n path = '/' + path;\n }\n const protocol = getWebsocketProtocol();\n const host = window.location.hostname;\n const port = window.location.port;\n return `${protocol}//${host}:${port}${path}`;\n }", "function makeNormalUrl(urlPart) {\n return constants.domainBase + constants.apiBaseUrl + urlPart;\n}", "function makeNormalUrl(urlPart) {\n return constants.domainBase + constants.apiBaseUrl + urlPart;\n}", "function makeNormalUrl(urlPart) {\n return constants.domainBase + constants.apiBaseUrl + urlPart;\n}", "function makeNormalUrl(urlPart) {\n return constants.domainBase + constants.apiBaseUrl + urlPart;\n}", "function getBaseURL(path){\n return window.location.origin + \"/\" + path;\n}", "uri() {\n let query = this.query || {};\n const schema = this.opts.secure ? \"https\" : \"http\";\n let port = \"\";\n // cache busting is forced\n if (false !== this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast();\n }\n if (!this.supportsBinary && !query.sid) {\n query.b64 = 1;\n }\n // avoid port if default for schema\n if (this.opts.port &&\n ((\"https\" === schema && Number(this.opts.port) !== 443) ||\n (\"http\" === schema && Number(this.opts.port) !== 80))) {\n port = \":\" + this.opts.port;\n }\n const encodedQuery = encode(query);\n const ipv6 = this.opts.hostname.indexOf(\":\") !== -1;\n return (schema +\n \"://\" +\n (ipv6 ? \"[\" + this.opts.hostname + \"]\" : this.opts.hostname) +\n port +\n this.opts.path +\n (encodedQuery.length ? \"?\" + encodedQuery : \"\"));\n }", "uri() {\n let query = this.query || {};\n const schema = this.opts.secure ? \"wss\" : \"ws\";\n let port = \"\";\n // avoid port if default for schema\n if (this.opts.port &&\n ((\"wss\" === schema && Number(this.opts.port) !== 443) ||\n (\"ws\" === schema && Number(this.opts.port) !== 80))) {\n port = \":\" + this.opts.port;\n }\n // append timestamp to URI\n if (this.opts.timestampRequests) {\n query[this.opts.timestampParam] = (0, yeast_1.default)();\n }\n // communicate binary support capabilities\n if (!this.supportsBinary) {\n query.b64 = 1;\n }\n const encodedQuery = parseqs_1.default.encode(query);\n const ipv6 = this.opts.hostname.indexOf(\":\") !== -1;\n return (schema +\n \"://\" +\n (ipv6 ? \"[\" + this.opts.hostname + \"]\" : this.opts.hostname) +\n port +\n this.opts.path +\n (encodedQuery.length ? \"?\" + encodedQuery : \"\"));\n }", "constructor() {\n switch (window.location.hostname) {\n case 'localhost':\n this._baseUrl = 'http://localhost:8080/api';\n break;\n case 'itberries-frontend.herokuapp.com':\n this._baseUrl = 'https://itberries-backend.herokuapp.com/api';\n\n // this._baseUrl = 'https://itberries-frontend.herokuapp.com/api';\n break;\n case 'it-berries.neat.codes':\n this._baseUrl = 'https://it-berries.neat.codes/api';\n break;\n }\n }", "getUrl() {\n throw new Error(\"You must either override getUrl() and supply a base URL value, or \" +\n \"provide your own implementation for find(), findAll() and all crud \" +\n \"operations in this class.\");\n }", "uri() {\n let query = this.query || {};\n const schema = this.opts.secure ? \"https\" : \"http\";\n let port = \"\";\n // cache busting is forced\n if (false !== this.opts.timestampRequests) {\n query[this.opts.timestampParam] = (0, yeast_1.default)();\n }\n if (!this.supportsBinary && !query.sid) {\n query.b64 = 1;\n }\n // avoid port if default for schema\n if (this.opts.port &&\n ((\"https\" === schema && Number(this.opts.port) !== 443) ||\n (\"http\" === schema && Number(this.opts.port) !== 80))) {\n port = \":\" + this.opts.port;\n }\n const encodedQuery = parseqs_1.default.encode(query);\n const ipv6 = this.opts.hostname.indexOf(\":\") !== -1;\n return (schema +\n \"://\" +\n (ipv6 ? \"[\" + this.opts.hostname + \"]\" : this.opts.hostname) +\n port +\n this.opts.path +\n (encodedQuery.length ? \"?\" + encodedQuery : \"\"));\n }", "static get API_URL() {\n const port = 1337; // Change this to your server port\n return `http://localhost:${port}`;\n }", "function _buildApiUrl (datasetname, configkey) {\n\t\tlet url = API_BASE;\n\t\turl += '?key=' + API_KEY;\n\t\turl += datasetname && datasetname !== null ? '&dataset=' + datasetname : '';\n\t\turl += configkey && configkey !== null ? '&configkey=' + configkey : '';\n\t\t//console.log('buildApiUrl: url=' + url);\n\t\t\n\t\treturn url;\n\t}", "function constructUrl(base, endpoint, params = {}) {\n let url = base + endpoint;\n\n let isFirst = true;\n for (let key in params) {\n url += (isFirst ? '?' : '&') + key + '=' + params[key];\n isFirst = false;\n }\n\n return url;\n}", "get baseEndpoint() {\n return this._baseEndpoint;\n }", "uri() {\n let query = this.query || {};\n const schema = this.opts.secure ? \"wss\" : \"ws\";\n let port = \"\";\n // avoid port if default for schema\n if (this.opts.port &&\n ((\"wss\" === schema && Number(this.opts.port) !== 443) ||\n (\"ws\" === schema && Number(this.opts.port) !== 80))) {\n port = \":\" + this.opts.port;\n }\n // append timestamp to URI\n if (this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast();\n }\n // communicate binary support capabilities\n if (!this.supportsBinary) {\n query.b64 = 1;\n }\n const encodedQuery = encode(query);\n const ipv6 = this.opts.hostname.indexOf(\":\") !== -1;\n return (schema +\n \"://\" +\n (ipv6 ? \"[\" + this.opts.hostname + \"]\" : this.opts.hostname) +\n port +\n this.opts.path +\n (encodedQuery.length ? \"?\" + encodedQuery : \"\"));\n }", "function getBaseUrl(url){\n if (url){\n var index = url.indexOf('?');\n if (index !== -1){\n return url.slice(0, index);\n }\n }\n return url;\n}", "getAuthorizationUrl() {\r\n var authorizationUrl = config.oauthAuthorizeBaseUrl;\r\n authorizationUrl += '?client_id=' + this.clientId;\r\n authorizationUrl += '&response_type=code';\r\n authorizationUrl += '&scope=' + this.scope;\r\n\r\n return authorizationUrl;\r\n }", "toRootUrl() { return this.toUrlPath() + this.toUrlQuery(); }", "function create_url(endpoint) {\n // TODO: ここを書き換えてURL作る\n // return '/api/guchi' + endpoint\n return URL_BASE + '/deai/' + endpoint;\n}", "function getPath() {\n\t\tvar basePath = '';\n\t\tvar httpProto = window.location.protocol;\n\t\tvar domains = determineHost();\n\t\tbasePath = httpProto + '//' + domains.secure + domains.environment + domains.topLevel;\n\t\treturn basePath;\n\t}", "get apiEndpoint() {\n return HttpHelper.apiEndpoint;\n }", "function makeNormalUrl(urlPart) {\n return __WEBPACK_IMPORTED_MODULE_0__constants__[\"b\" /* domainBase */] + __WEBPACK_IMPORTED_MODULE_0__constants__[\"c\" /* apiBaseUrl */] + urlPart;\n}", "function makeNormalUrl(urlPart) {\n return __WEBPACK_IMPORTED_MODULE_0__constants__[\"b\" /* domainBase */] + __WEBPACK_IMPORTED_MODULE_0__constants__[\"c\" /* apiBaseUrl */] + urlPart;\n}", "static baseUrl() {\n return '/'\n }", "function makeNormalUrl(urlPart) {\n return __WEBPACK_IMPORTED_MODULE_0__constants__[\"f\" /* domainBase */] + __WEBPACK_IMPORTED_MODULE_0__constants__[\"a\" /* apiBaseUrl */] + urlPart;\n}", "function makeNormalUrl(urlPart) {\n return __WEBPACK_IMPORTED_MODULE_0__constants__[\"f\" /* domainBase */] + __WEBPACK_IMPORTED_MODULE_0__constants__[\"a\" /* apiBaseUrl */] + urlPart;\n}", "function getURL(endpoint, params) {\n if (typeof params === 'object' && Object.keys(params).length > 0) {\n return `${getBaseURL()}/api${endpoint}?${qs.stringify(params)}`;\n }\n\n return `${getBaseURL()}/api${endpoint}`;\n}", "get apiHostname() {\n return url.format({\n protocol: this.apiProtocol,\n host: this.apiHost\n });\n }", "function getBaseServer() {\n return process.env.placeGeneratorGcacheURL ? process.env.placeGeneratorGcacheURL : 'https://maps.googleapis.com';\n}", "function getBaseUrl() {\n var scripts = document.getElementsByTagName(\"script\"),\n script = scripts[scripts.length-1].src,\n slugs = script.split('/');\n\n slugs.pop();\n\n return slugs.join('/') + '/';\n }" ]
[ "0.7850118", "0.78041357", "0.75129306", "0.74798", "0.72589505", "0.7181715", "0.70752907", "0.70319974", "0.69690305", "0.6924421", "0.68996084", "0.68924016", "0.68537605", "0.6821435", "0.6811206", "0.68061227", "0.67507184", "0.67480886", "0.67268217", "0.67123735", "0.6693259", "0.66836387", "0.6679734", "0.66724205", "0.66451716", "0.66451716", "0.66312546", "0.66289306", "0.66148007", "0.6595094", "0.65674967", "0.6561766", "0.6547378", "0.6543994", "0.65333575", "0.65141153", "0.6510326", "0.64941925", "0.64905524", "0.64829063", "0.64475447", "0.64455456", "0.64431393", "0.64182484", "0.6413538", "0.6408272", "0.6406849", "0.6404787", "0.63724756", "0.63618785", "0.6359573", "0.6359573", "0.63270444", "0.6306412", "0.6296394", "0.62788063", "0.62726146", "0.62661195", "0.6188554", "0.61734474", "0.61624134", "0.61581236", "0.6156574", "0.61555594", "0.61544454", "0.61544454", "0.6147927", "0.6143265", "0.61400884", "0.6129495", "0.6120889", "0.6120889", "0.6120889", "0.6120889", "0.61155605", "0.61149675", "0.61133313", "0.6110634", "0.61009085", "0.6085391", "0.6081972", "0.6070088", "0.6069968", "0.60696626", "0.60659504", "0.60618347", "0.6056245", "0.60544616", "0.601995", "0.601856", "0.60119563", "0.6011497", "0.6011497", "0.6008014", "0.60015315", "0.60015315", "0.6000555", "0.5998955", "0.5984642", "0.5975939" ]
0.63862383
48
precondition bitalgined bitlength of coefficients <= 47
function getCoeffsCubicQuad(circle, ps) { let { radius: r, center: [cx, cy] } = circle; let [[a3, a2, a1, a0], [b3, b2, b1, b0]] = get_xy_1.getXY(ps); // exact if bitlength <= 49 // bitlength 48 -> saves 2 bits -> 1-4 summands // bitlength 47 -> saves 4 bits -> 5-16 summands // bitlength 46 -> saves 6 bits -> 17-64 summands // (a3**2 + b3**2)*t**6 + let t6 = qaq(tp(a3, a3), tp(b3, b3)); // exact if bitlength <= 48 - 2 summands // (2*a2*a3 + 2*b2*b3)*t**5 + let t5 = qm2(qaq(tp(a2, a3), tp(b2, b3))); // exact if bitlength <= 48 - 2 summands // (2*a1*a3 + a2*a2 + 2*b1*b3 + b2*b2)*t**4 + let t4 = qaq(qm2(qaq(tp(a1, a3), tp(b1, b3))), qaq(tp(a2, a2), tp(b2, b2))); // exact if bitlength <= 47 - 6 summands // (2*a0*a3 + 2*a1*a2 - 2*a3*cx + 2*b0*b3 + 2*b1*b2 - 2*b3*cy)*t**3 + let t3 = qm2(qdifq(qaq(qaq(tp(a0, a3), tp(a1, a2)), qaq(tp(b0, b3), tp(b1, b2))), (qaq(tp(a3, cx), tp(b3, cy))))); // exact if bitlength <= 47 - 6 summands // (2*a0*a2 + a1**2 - 2*a2*cx + 2*b0*b2 + b1**2 - 2*b2*cy)*t**2 + let t2 = qaq(qm2(qdifq(qaq(tp(a0, a2), tp(b0, b2)), (qaq(tp(a2, cx), tp(b2, cy))))), qaq(tp(a1, a1), tp(b1, b1))); // exact if bitlength <= 47 - 10 summands // (2*a0*a1 - 2*a1*cx + 2*b0*b1 - 2*b1*cy)*t + let t1 = qm2(qdifq(qaq(tp(a0, a1), tp(b0, b1)), (qaq(tp(a1, cx), tp(b1, cy))))); // exact if bitlength <= 48 - 4 summands // a0**2 - 2*a0*cx + b0**2 - 2*b0*cy + cx**2 + cy**2 - r**2 let t0 = qaq(qmn2(qaq(tp(a0, cx), tp(b0, cy))), qdifq(qaq(qaq(tp(a0, a0), tp(b0, b0)), qaq(tp(cx, cx), tp(cy, cy))), tp(r, r))); // exact if bitlength <= 47 - 9 summands return [t6, t5, t4, t3, t2, t1, t0]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "function bnBitLength()\n{\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n}", "function bnBitLength() {\n\t if (this.t <= 0) return 0\n\t return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n\t}", "function bnBitLength() {\n\t if (this.t <= 0) return 0\n\t return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n\t}", "function lowbits(n){return n&width-1;}//", "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n}", "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n}", "function bnBitLength() {\r\n\t if (this.t <= 0) return 0;\r\n\t return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\r\n\t}", "function bnBitLength() {\r\n\t if (this.t <= 0) return 0;\r\n\t return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\r\n\t}", "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM);\n}", "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM);\n }", "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM);\n }", "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM);\n }", "function bnBitLength() {\n\tif(this.t <= 0) return 0;\n\treturn this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n }", "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n }", "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n }", "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n }", "function intakeBits(amt){\r\n\r\n}", "function bnBitLength() {\n\t if(this.t <= 0) return 0;\n\t return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n\t }", "function bnBitLength() {\n\t if(this.t <= 0) return 0;\n\t return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n\t }", "function bnBitLength() {\n\t if(this.t <= 0) return 0;\n\t return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n\t }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n\t if(this.t <= 0) return 0;\n\t return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n\t}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n\t if(this.t <= 0) return 0;\n\t return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM));\n\t}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM));\n}", "function nbits(n, x) {\n return (Math.pow(2, n) - 1) & x;\n}", "function hcEncoder(props){\n if(typeof props.infoBits === 'undefined') {return console.log('Info bits aren\\'t defined!');}\n if(typeof props.l === 'undefined') props.l=1;\n if(typeof props.errCount === 'undefined') props.errCount=0;\n let m, l, k, n, infoBits;\n infoBits = props.infoBits;\n l = props.l;\n m = infoBits.length;\n // calculating control bits number k\n for(let i=3; i<7; i++){\n if(((Math.pow(2, i) - i) >= (m + 1))){\n if(l === 1) k = i;\n else k = i+1;\n break;\n }\n }\n n=m+k;\n let cw= new Array(n).fill(0);\n\n let cBitsIdx=[];\n if(l===1) {\n for(let i=0; i<k; i++) cBitsIdx.push(Math.pow(2, i)-1);\n }\n else{\n cBitsIdx.push(0);\n for(let i=0; i<k-1; i++) cBitsIdx.push(Math.pow(2, i));\n }\n let iBitsIdx=0;\n for(let i=0; i<n; i++){\n if(typeof cBitsIdx.find(el => el===i) !== 'undefined') continue;\n cw[i] = infoBits[iBitsIdx];\n iBitsIdx++;\n }\n\n for(let i=0; i<k; i++){\n if (l===2 && i===0) continue;\n let pow = i;\n if(l === 2) pow -=1;\n let gr = Math.pow(2, pow);\n let res=0;\n for(let j=cBitsIdx[i]; j<n; j+=gr*2){\n for(let t=j; t<j+gr; t++){\n res ^=cw[t];\n }\n }\n cw[cBitsIdx[i]]=res;\n }\n if (l===2){\n let res=0;\n for(let i=1; i<n; i++) res ^=cw[i];\n cw[0]=res;\n }\n\n if(props.errCount > 0 && props.errCount < cw.length){\n let errPos = [];\n let idx=[];\n for(let i=0; i<cw.length; i++) idx.push(i);\n for(let i=0; i<props.errCount; i++){\n let pos = idx[Math.floor(Math.random() * idx.length)];\n errPos.push(pos);\n idx.splice(idx.indexOf(pos),1);\n }\n errPos.forEach(i =>{\n cw[i] = cw[i] === 0 ? 1 : 0;\n });\n };\n\n return cw;\n}", "function bnBitLength() {\n\t if(this.t <= 0) return 0;\n\t return this._DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this._DM));\n\t}" ]
[ "0.6409897", "0.6409897", "0.6409897", "0.6409897", "0.6409897", "0.6409897", "0.6409897", "0.6388867", "0.6366699", "0.6366699", "0.6324955", "0.6322721", "0.6322721", "0.6320649", "0.6320649", "0.627577", "0.6239352", "0.6239352", "0.6239352", "0.6209139", "0.6181426", "0.6181426", "0.6174806", "0.6174806", "0.614765", "0.6131105", "0.6131105", "0.61167353", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6093222", "0.60901415", "0.60901415", "0.60901415", "0.60901415", "0.60901415", "0.60901415", "0.60901415", "0.60864836", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60782325", "0.60782325", "0.60782325", "0.60782325", "0.60782325", "0.60782325", "0.60782325", "0.60782325", "0.60782325", "0.6066401", "0.60372126", "0.60148776" ]
0.0
-1
precondition bitalgined bitlength of coefficients <= 47
function getCoeffsQuadraticQuad(circle, ps) { let { radius: r, center: [cx, cy] } = circle; let [[a2, a1, a0], [b2, b1, b0]] = get_xy_1.getXY(ps); // exact if bitlength <= 49 // (a2*a2 + b2*b2)*t**4 + let t4 = qaq(tp(a2, a2), tp(b2, b2)); // exact if bitlength <= 48 - 2 summands // (2*a1*a2 + 2*b1*b2)*t**3 + let t3 = qm2(qaq(tp(a1, a2), tp(b1, b2))); // exact if bitlength <= 48 - 2 summands // (2*a0*a2 + a1*a1 - 2*a2*cx + 2*b0*b2 + b1*b1 - 2*b2*cy)*t**2 + let t2 = qaq(qm2(qdifq(qaq(tp(a0, a2), tp(b0, b2)), (qaq(tp(a2, cx), tp(b2, cy))))), qaq(tp(a1, a1), tp(b1, b1))); // exact if bitlength <= 47 - 10 summands // (2*a0*a1 - 2*a1*cx + 2*b0*b1 - 2*b1*cy)*t + let t1 = qm2(qdifq(qaq(tp(a0, a1), tp(b0, b1)), (qaq(tp(a1, cx), tp(b1, cy))))); // exact if bitlength <= 48 - 4 summands // a0*a0 - 2*a0*cx + b0*b0 - 2*b0*cy + cx*cx + cy*cy - r*r let t0 = qaq(qmn2(qaq(tp(a0, cx), tp(b0, cy))), qdifq(qaq(qaq(tp(a0, a0), tp(b0, b0)), qaq(tp(cx, cx), tp(cy, cy))), tp(r, r))); // exact if bitlength <= 47 - 9 summands return [t4, t3, t2, t1, t0]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "function bnBitLength()\n{\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n}", "function bnBitLength() {\n\t if (this.t <= 0) return 0\n\t return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n\t}", "function bnBitLength() {\n\t if (this.t <= 0) return 0\n\t return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n\t}", "function lowbits(n){return n&width-1;}//", "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n}", "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n}", "function bnBitLength() {\r\n\t if (this.t <= 0) return 0;\r\n\t return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\r\n\t}", "function bnBitLength() {\r\n\t if (this.t <= 0) return 0;\r\n\t return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\r\n\t}", "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM);\n}", "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM);\n }", "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM);\n }", "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM);\n }", "function bnBitLength() {\n\tif(this.t <= 0) return 0;\n\treturn this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n }", "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n }", "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n }", "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n }", "function intakeBits(amt){\r\n\r\n}", "function bnBitLength() {\n\t if(this.t <= 0) return 0;\n\t return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n\t }", "function bnBitLength() {\n\t if(this.t <= 0) return 0;\n\t return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n\t }", "function bnBitLength() {\n\t if(this.t <= 0) return 0;\n\t return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n\t }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n\t if(this.t <= 0) return 0;\n\t return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n\t}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n\t if(this.t <= 0) return 0;\n\t return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM));\n\t}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM));\n}", "function nbits(n, x) {\n return (Math.pow(2, n) - 1) & x;\n}", "function hcEncoder(props){\n if(typeof props.infoBits === 'undefined') {return console.log('Info bits aren\\'t defined!');}\n if(typeof props.l === 'undefined') props.l=1;\n if(typeof props.errCount === 'undefined') props.errCount=0;\n let m, l, k, n, infoBits;\n infoBits = props.infoBits;\n l = props.l;\n m = infoBits.length;\n // calculating control bits number k\n for(let i=3; i<7; i++){\n if(((Math.pow(2, i) - i) >= (m + 1))){\n if(l === 1) k = i;\n else k = i+1;\n break;\n }\n }\n n=m+k;\n let cw= new Array(n).fill(0);\n\n let cBitsIdx=[];\n if(l===1) {\n for(let i=0; i<k; i++) cBitsIdx.push(Math.pow(2, i)-1);\n }\n else{\n cBitsIdx.push(0);\n for(let i=0; i<k-1; i++) cBitsIdx.push(Math.pow(2, i));\n }\n let iBitsIdx=0;\n for(let i=0; i<n; i++){\n if(typeof cBitsIdx.find(el => el===i) !== 'undefined') continue;\n cw[i] = infoBits[iBitsIdx];\n iBitsIdx++;\n }\n\n for(let i=0; i<k; i++){\n if (l===2 && i===0) continue;\n let pow = i;\n if(l === 2) pow -=1;\n let gr = Math.pow(2, pow);\n let res=0;\n for(let j=cBitsIdx[i]; j<n; j+=gr*2){\n for(let t=j; t<j+gr; t++){\n res ^=cw[t];\n }\n }\n cw[cBitsIdx[i]]=res;\n }\n if (l===2){\n let res=0;\n for(let i=1; i<n; i++) res ^=cw[i];\n cw[0]=res;\n }\n\n if(props.errCount > 0 && props.errCount < cw.length){\n let errPos = [];\n let idx=[];\n for(let i=0; i<cw.length; i++) idx.push(i);\n for(let i=0; i<props.errCount; i++){\n let pos = idx[Math.floor(Math.random() * idx.length)];\n errPos.push(pos);\n idx.splice(idx.indexOf(pos),1);\n }\n errPos.forEach(i =>{\n cw[i] = cw[i] === 0 ? 1 : 0;\n });\n };\n\n return cw;\n}", "function bnBitLength() {\n\t if(this.t <= 0) return 0;\n\t return this._DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this._DM));\n\t}" ]
[ "0.64106387", "0.64106387", "0.64106387", "0.64106387", "0.64106387", "0.64106387", "0.64106387", "0.63895106", "0.63673735", "0.63673735", "0.63246775", "0.6323446", "0.6323446", "0.6321296", "0.6321296", "0.6276508", "0.6240145", "0.6240145", "0.6240145", "0.6210016", "0.6182189", "0.6182189", "0.61755854", "0.61755854", "0.6147558", "0.6131972", "0.6131972", "0.6117586", "0.60990566", "0.60990566", "0.60990566", "0.60990566", "0.60990566", "0.60990566", "0.60990566", "0.60990566", "0.60990566", "0.60990566", "0.60990566", "0.60990566", "0.60990566", "0.60990566", "0.60990566", "0.60990566", "0.60990566", "0.60990566", "0.60990566", "0.60990566", "0.60990566", "0.60990566", "0.60990566", "0.60940176", "0.60910225", "0.60910225", "0.60910225", "0.60910225", "0.60910225", "0.60910225", "0.60910225", "0.60872555", "0.60837567", "0.60837567", "0.60837567", "0.60837567", "0.60837567", "0.60837567", "0.60837567", "0.60837567", "0.60837567", "0.60837567", "0.60837567", "0.60837567", "0.60837567", "0.60837567", "0.60837567", "0.60837567", "0.60837567", "0.60837567", "0.60837567", "0.60837567", "0.60837567", "0.60837567", "0.60837567", "0.60837567", "0.60837567", "0.60837567", "0.60837567", "0.60837567", "0.60837567", "0.60790867", "0.60790867", "0.60790867", "0.60790867", "0.60790867", "0.60790867", "0.60790867", "0.60790867", "0.60790867", "0.606579", "0.60360193", "0.6015671" ]
0.0
-1
precondition bitalgined bitlength of coefficients <= 47
function getCoeffsLinearQuad(circle, ps) { let { radius: r, center: [cx, cy] } = circle; let [[a1, a0], [b1, b0]] = get_xy_1.getXY(ps); // exact if bitlength <= 49 // (a1**2 + b1**2)*t**2 + let t2 = qaq(tp(a1, a1), tp(b1, b1)); // exact if bitlength <= 48 - 2 summands // (2*a0*a1 - 2*a1*cx + 2*b0*b1 - 2*b1*cy)*t + let t1 = qm2(qdifq(qaq(tp(a0, a1), tp(b0, b1)), (qaq(tp(a1, cx), tp(b1, cy))))); // exact if bitlength <= 48 - 4 summands // a0*a0 - 2*a0*cx + b0*b0 - 2*b0*cy + cx*cx + cy*cy - r*r let t0 = qaq(qmn2(qaq(tp(a0, cx), tp(b0, cy))), qdifq(qaq(qaq(tp(a0, a0), tp(b0, b0)), qaq(tp(cx, cx), tp(cy, cy))), tp(r, r))); // exact if bitlength <= 47 - 9 summands return [t2, t1, t0]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "function bnBitLength()\n{\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n}", "function bnBitLength() {\n\t if (this.t <= 0) return 0\n\t return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n\t}", "function bnBitLength() {\n\t if (this.t <= 0) return 0\n\t return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n\t}", "function lowbits(n){return n&width-1;}//", "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n}", "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n}", "function bnBitLength() {\r\n\t if (this.t <= 0) return 0;\r\n\t return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\r\n\t}", "function bnBitLength() {\r\n\t if (this.t <= 0) return 0;\r\n\t return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\r\n\t}", "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM);\n}", "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM);\n }", "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM);\n }", "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM);\n }", "function bnBitLength() {\n\tif(this.t <= 0) return 0;\n\treturn this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n }", "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n }", "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n }", "function bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n }", "function intakeBits(amt){\r\n\r\n}", "function bnBitLength() {\n\t if(this.t <= 0) return 0;\n\t return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n\t }", "function bnBitLength() {\n\t if(this.t <= 0) return 0;\n\t return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n\t }", "function bnBitLength() {\n\t if(this.t <= 0) return 0;\n\t return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n\t }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n\t if(this.t <= 0) return 0;\n\t return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n\t}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n\t if(this.t <= 0) return 0;\n\t return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM));\n\t}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM));\n}", "function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM));\n}", "function nbits(n, x) {\n return (Math.pow(2, n) - 1) & x;\n}", "function hcEncoder(props){\n if(typeof props.infoBits === 'undefined') {return console.log('Info bits aren\\'t defined!');}\n if(typeof props.l === 'undefined') props.l=1;\n if(typeof props.errCount === 'undefined') props.errCount=0;\n let m, l, k, n, infoBits;\n infoBits = props.infoBits;\n l = props.l;\n m = infoBits.length;\n // calculating control bits number k\n for(let i=3; i<7; i++){\n if(((Math.pow(2, i) - i) >= (m + 1))){\n if(l === 1) k = i;\n else k = i+1;\n break;\n }\n }\n n=m+k;\n let cw= new Array(n).fill(0);\n\n let cBitsIdx=[];\n if(l===1) {\n for(let i=0; i<k; i++) cBitsIdx.push(Math.pow(2, i)-1);\n }\n else{\n cBitsIdx.push(0);\n for(let i=0; i<k-1; i++) cBitsIdx.push(Math.pow(2, i));\n }\n let iBitsIdx=0;\n for(let i=0; i<n; i++){\n if(typeof cBitsIdx.find(el => el===i) !== 'undefined') continue;\n cw[i] = infoBits[iBitsIdx];\n iBitsIdx++;\n }\n\n for(let i=0; i<k; i++){\n if (l===2 && i===0) continue;\n let pow = i;\n if(l === 2) pow -=1;\n let gr = Math.pow(2, pow);\n let res=0;\n for(let j=cBitsIdx[i]; j<n; j+=gr*2){\n for(let t=j; t<j+gr; t++){\n res ^=cw[t];\n }\n }\n cw[cBitsIdx[i]]=res;\n }\n if (l===2){\n let res=0;\n for(let i=1; i<n; i++) res ^=cw[i];\n cw[0]=res;\n }\n\n if(props.errCount > 0 && props.errCount < cw.length){\n let errPos = [];\n let idx=[];\n for(let i=0; i<cw.length; i++) idx.push(i);\n for(let i=0; i<props.errCount; i++){\n let pos = idx[Math.floor(Math.random() * idx.length)];\n errPos.push(pos);\n idx.splice(idx.indexOf(pos),1);\n }\n errPos.forEach(i =>{\n cw[i] = cw[i] === 0 ? 1 : 0;\n });\n };\n\n return cw;\n}", "function bnBitLength() {\n\t if(this.t <= 0) return 0;\n\t return this._DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this._DM));\n\t}" ]
[ "0.6409897", "0.6409897", "0.6409897", "0.6409897", "0.6409897", "0.6409897", "0.6409897", "0.6388867", "0.6366699", "0.6366699", "0.6324955", "0.6322721", "0.6322721", "0.6320649", "0.6320649", "0.627577", "0.6239352", "0.6239352", "0.6239352", "0.6209139", "0.6181426", "0.6181426", "0.6174806", "0.6174806", "0.614765", "0.6131105", "0.6131105", "0.61167353", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6098147", "0.6093222", "0.60901415", "0.60901415", "0.60901415", "0.60901415", "0.60901415", "0.60901415", "0.60901415", "0.60864836", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60828346", "0.60782325", "0.60782325", "0.60782325", "0.60782325", "0.60782325", "0.60782325", "0.60782325", "0.60782325", "0.60782325", "0.6066401", "0.60372126", "0.60148776" ]
0.0
-1
These tests rely on some unintuitive cleverness due to WPT's test setup: 'UpgradeInsecureRequests' does not upgrade the port number, so we use URLs in the form ` If the upgrade fails, the load will fail, as we don't serve HTTP over the secure port.
function generateURL(host, protocol, resourceType) { var url = new URL("http://{{host}}:{{ports[https][0]}}/upgrade-insecure-requests/support/"); url.protocol = protocol == Protocol.INSECURE ? "http" : "https"; url.hostname = host == Host.SAME_ORIGIN ? "{{host}}" : "{{domains[天気の良い日]}}"; if (resourceType == ResourceType.IMAGE) { url.pathname += "pass.png"; } else if (resourceType == ResourceType.FRAME) { url.pathname += "post-origin-to-parent.html"; } else if (resourceType == ResourceType.WEBSOCKET) { url.port = {{ports[wss][0]}}; url.protocol = protocol == Protocol.INSECURE ? "ws" : "wss"; url.pathname = "echo"; } return { name: protocol + "/" + host + " " + resourceType, url: url.toString() }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function vertifyHttps(urllink){\n var result = 0;\n if (urllink.indexOf(\"https\") == 0){\n result = 1;\n }\n return result;\n}", "function ensureHttps() {\n if (window.location.protocol != \"https:\" && window.location.protocol != \"file:\" && window.location.hostname != \"localhost\") {\n window.location.href = \"https:\" + window.location.href.substring(window.location.protocol.length);\n }\n}", "function requestPORT2(request, response) {\n response.end(\"Bad request! Path hit: \" + request.url);\n}", "function upgradeRedirectTo(partialPath) {\n return insecureRedirectURL + encodeURIComponent(secureTestURL + partialPath);\n}", "function forceSsl (req, res, next) {\n let isHealthCheck = () => req.url === \"/api\";\n let isForwardedHttp = () => req.headers[\"x-forwarded-proto\"] === \"http\";\n let getHost = () => req.headers.host;\n\n if (isForwardedHttp() && !isHealthCheck()) {\n let newUrl = `https://${getHost()}${req.url}`;\n debug(`Redirect HTTP request => ${newUrl}`);\n res.redirect(newUrl);\n } else {\n next();\n }\n}", "function ensureSecure(req, res, next){\n if(req.secure){\n // OK, continue\n return next();\n };\n // handle port numbers if you need non defaults\n res.redirect('https://' + req.hostname + req.url); \n}", "function ensureHttps() {\n if (window.location.protocol != \"https:\") {\n window.location.href = \"https:\" + window.location.href.substring(window.location.protocol.length);\n }\n}", "function https(ctx, next){\n if (window.location.protocol[4] == 's') return next();\n else window.location.href = format('https://%s', hostname);\n next();\n}", "static onUpgradeNotPtthProtocolError (request, socket, head) {\n\n socket.end('HTTP/1.1 400 Bad Request');\n\n }", "function testHttpClientOnProxyServer(test) {\n\n // TODO - Check the first available port here starting from minPort\n var minPort = 11101,\n maxPort = 11199,\n hostName = \"localhost\",\n router = {},\n proxyManager = new ProxyManager(router, {}),\n options,\n req,\n server;\n\n // test instrument\n\n function onRequest(request, response) {\n var url = require('url');\n if (url.parse(request.url).pathname == '/index.html') {\n response.writeHead(200, {\"Content-Type\": \"text/html\"});\n response.write(\"<head></head><body></body>\");\n\n } else if (url.parse(request.url).pathname == '/index.js') {\n response.writeHead(200, {\"Content-Type\": \"text/javascript\"});\n response.write(\"var a=1;\\n\");\n\n } else if (url.parse(request.url).pathname == '/index2.js') {\n response.writeHead(200, {\"Content-Type\": \"text/javascript\", \"content-encoding\": \"gzip\"});\n response.write(\"\\n\");\n\n } else if (url.parse(request.url).pathname == '/index3.js') {\n response.writeHead(200, {\"Content-Type\": \"text/javascript\", \"content-encoding\": \"deflate\"});\n response.write(\"\\n\");\n\n } else if (url.parse(request.url).pathname == '/index.jpeg') {\n response.writeHead(200, {\"Content-Type\": \"image/jpeg\"});\n response.write(\"abcde\\n\");\n } else {\n response.writeHead(200, {\"Content-Type\": \"text/plain\"});\n response.write(\"Hello js\\n\");\n\n }\n response.end();\n }\n\n portchecker.getFirstAvailable(11300, 11399, \"localhost\", function (p) {\n\n console.log(\"in test http client,tmp server will start at:\" + p);\n\n server = http.createServer(onRequest).listen(p);\n\n console.log(\"in test http client,tmp server started correctly\");\n\n proxyManager.proxyConfig = {\n \"localhost\": {\n \"newHost\": hostName + \":\" + p,\n \"headers\": [\n { \"param\": \"user-agent\",\n \"value\": \"Mozilla5.0\"\n }\n ],\n \"record\": true\n },\n \"coverage\": {\n \"clientSideCoverage\": true,\n \"coverageExclude\": [\"^http://yui.yahooapis.com.*\\\\.js$\"]\n }\n };\n console.log(\"in test http client,proxy server config\");\n console.log(JSON.stringify(proxyManager.proxyConfig));\n\n proxyManager.runRouterProxy(minPort, maxPort, hostName, function (proxyHostMsg) {\n\n console.log(\"in test http client , proxy will started correctly\");\n\n A.areNotEqual(proxyHostMsg, 'localhost:' + minPort, 'Proxy host should not match');\n A.areEqual(proxyHostMsg, localhostip + ':' + minPort, 'Proxy host doesn\\'t match');\n\n options = {\n host: hostName,\n port: minPort,\n method: 'GET'\n };\n var body = '';\n\n function sentToTmpServer(path, data) {\n options.path = path;\n req = http.request(options, function (res) {\n res.setEncoding('utf8');\n res.on('data', function (chunk) {\n body += chunk;\n console.log('BODY: ' + chunk);\n });\n });\n\n req.on('error', function (e) {\n console.log('problem with request: ' + e.message);\n });\n\n // write data to request body\n req.write(data);\n req.end();\n }\n\n sentToTmpServer('/index.html', \"\\n\");\n sentToTmpServer('/index.js', \"\\n\");\n sentToTmpServer('/index2.js', \"\\n\");\n sentToTmpServer('/index3.js', \"\\n\");\n sentToTmpServer('/index.jpeg', \"\\n\");\n\n });\n setTimeout(function () {\n server.close();\n proxyManager.proxyServer.close();\n }, 2000);\n }\n )\n ;\n\n }", "async function httpsWorker (glx) {\n const fastify = Fastify({\n logger: true,\n serverFactory (handler) {\n const tlsOptions = null\n return glx.http2Server(tlsOptions, handler)\n }\n })\n\n await initialize(fastify)\n\n await fastify.listen(443, '::').catch(e => console.error(e))\n\n // Listening to 80 to solve HTTP-01 challenges and redirecting clueless people to HTTPS\n const httpServer = glx.httpServer()\n\n httpServer.listen(80, '::', function () {\n console.info('Listening on ', httpServer.address())\n })\n}", "function proxyHttps() {\n httpServer.on('connect', function (req, socket, upgradeHead) {\n var netClient = net.createConnection(INTERNAL_HTTPS_PORT);\n\n netClient.on('connect', function () {\n\n socket.write(\"HTTP/1.1 200 Connection established\\r\\nProxy-agent: Netscape-Proxy/1.1\\r\\n\\r\\n\");\n });\n\n socket.on('data', function (chunk) {\n netClient.write(chunk);\n });\n socket.on('end', function () {\n netClient.end();\n });\n socket.on('close', function () {\n netClient.end();\n });\n socket.on('error', function (err) {\n log.error('socket error ' + err.message);\n netClient.end();\n });\n\n netClient.on('data', function (chunk) {\n socket.write(chunk);\n });\n netClient.on('end', function () {\n socket.end();\n });\n netClient.on('close', function () {\n socket.end();\n });\n netClient.on('error', function (err) {\n\n socket.end();\n });\n\n });\n}", "function ensureSecure(req, res, next) {\n //Heroku stores the origin protocol in a header variable. The app itself is isolated within the dyno and all request objects have an HTTP protocol.\n if (req.get('X-Forwarded-Proto')=='https' || req.hostname == 'localhost') {\n //Serve Vue App by passing control to the next middleware\n next();\n } else if(req.get('X-Forwarded-Proto')!='https' && req.get('X-Forwarded-Port')!='443'){\n //Redirect if not HTTP with original request URL\n res.redirect('https://' + req.hostname + req.url);\n }\n}", "handleUpgrade(req, socket, head) {\n if (req.headers.host) {\n const { host } = req.headers\n const { id, port } = this.parseHost(host)\n const item = this.find(id)\n\n if (item) {\n let target\n if (port && port !== '80') {\n target = `ws://127.0.0.1:${port}`\n } else if (item.start) {\n target = `ws://127.0.0.1:${item.env.PORT}`\n } else if (item.target) {\n target = item.target.replace('http', 'ws')\n } else {\n const { hostname } = url.parse(item.target)\n target = `ws://${hostname}`\n }\n log(`WebSocket - ${host} → ${target}`)\n this._proxy.ws(req, socket, head, { target }, err => {\n log('WebSocket - Error', err.message)\n })\n } else {\n log(`WebSocket - No server matching ${id}`)\n }\n } else {\n log('WebSocket - No host header found')\n }\n }", "function isSecure(entry) {\n return entry.request.url.indexOf(\"https://\") === 0;\n}", "function ensureSecure(req, res, next) {\n\tif(req.secure) {\n\t\t// OK, continue\n\t\treturn next();\n \t};\n\t\n\t// handle port numbers if you need non defaults\n \t// res.redirect('https://' + req.host + req.url); // express 3.x\n\tres.redirect('https://' + req.hostname + \":5000\" + req.url); // express 4.x\n}", "function test6()\n{\n\tvar request = 'GET /y/../readme.txt HTTP/1.1\\r\\n' +\n 'Host: 127.0.0.1\\r\\n' + \n '\\r\\n';\n\tsendWithSocket(request,'6.start test_cant_access_no_under_root404','HTTP/1.1 404 Not Found',\n\t\t\t'6.test_cant_access_no_under_root404 SUCCEEDED','6.test_cant_access_no_under_root404 failed');\n}", "function startHttpsServer(app) {\n var httpServer;\n var credentials = loadSslCredentials();\n\n if (!credentials) { console.log('SSL issue'); }\n\n try {\n httpServer = https.createServer(credentials, app);\n httpServer.on('error', httpError);\n httpServer.listen(config.httpsPort);\n console.log('Server started on HTTPS: ' + config.httpsPort);\n } catch (e) {\n console.error('Error while starting HTTPS server on ' + config.httpsPort + ':');\n console.error(e);\n throw e;\n }\n}", "function makeInsecure(str) {\n return str.replace('wss://', 'ws://').replace(':1443/websocket', ':1400/websocket');\n }", "function whathost(ssl) {\r\n if (ssl) return \"https://ssl.what.cd/\";\r\n else if (!ssl) return \"http://what.cd/\";\r\n}", "function requestPORT(request, response) {\n response.end(\"Good request! Path hit: \" + request.url);\n}", "function checkHttps(req, res, next){\n if(req.get('X-Forwarded-Proto').indexOf(\"https\")!=-1){\n return next()\n } else {\n res.redirect('https://' + req.hostname + req.url);\n }\n}", "function get (url, cb) {\n if (url.indexOf('https') !== 0) {\n cb(new Error('SSL only!'))\n } else {\n cb(null, 'some data!')\n }\n}", "function get_appliance_url(service, fallback_url, timeout) {\n\n if (window.location.protocol === \"file:\") {\n\n if (fallback_url == null) {\n throw \"Admin UI running from local file and no fallback URL given\";\n }\n\n return fallback_url;\n\n } else {\n\n\n var res = new XMLHttpRequest();\n var svc = (service == \"hub-website\" ? \"hub-websocket\" : service);\n res.open('GET', \"/wsconfig/\" + svc, false);\n res.send(null);\n\n if (res.status == 200) {\n try {\n var _port = JSON.parse(res.responseText);\n //console.log(_port);\n switch (service){\n case \"admin-websocket\":\n case \"hub-website\":\n case \"hub-websocket\":\n var port = \"\";\n if (!((_port[1] && _port[0] == 443) || (!_port[1] && _port[0] == 80))) {\n port = \":\" + _port[0];\n }\n var schema;\n var path;\n if (service == \"hub-website\") {\n schema = _port[1] ? \"https\" : \"http\";\n path = \"/\";\n } else {\n schema = _port[1] ? \"wss\" : \"ws\";\n path = \"/\" + _port[2];\n }\n var uri = schema + \"://\" + window.location.hostname + port + path;\n return uri;\n break;\n case \"admin-web\":\n case \"hub-web\":\n var uri = (_port[1] ? \"https\" : \"http\") + \"://\" + window.location.hostname + \":\" + _port[0];\n return uri;\n break;\n default:\n return (\"service not recognized\", service);\n break;\n\n var uri = (_port[1] ? \"https\" : \"http\") + \"://\" + window.location.hostname + \":\" + _port[0];\n return uri;\n\n }\n\n } catch (e) {\n return null;\n }\n } else {\n return null;\n }\n }\n}", "function initWebServer(port, pagespath) {\n return http.createServer((req, res) => {\n // Parsing the url\n var uri = url.parse(req.url, true);\n var reqpath = uri.pathname;\n \n // Redirecting to index.html if no specific file is requested\n if (!reqpath.includes('.'))\n reqpath += (reqpath.endsWith('/') ? '' : '/') + 'index.html';\n\n // User recognition\n var operating = null;\n var cookies = httpUtils.parseCookies(req);\n if (cookies.auth) {\n for (var c in carts) {\n if (carts[c].authtoken == cookies.auth)\n operating = carts[c];\n }\n }\n\n // Do token handling\n var cookiesout = '';\n if (reqpath == '/index.html'){\n if (uri.query.token !== undefined){\n cookiesout += `auth=${uri.query.token};`\n\n for (var c in carts) {\n if (carts[c].authtoken == uri.query.token) \n operating = carts[c];\n }\n }\n }\n\n // Redirects to about page\n //if (reqpath == '/index.html') httpUtils.redirect(res, '/about');\n\n // Redirects if a not authenticated user tries to use auth-only pages\n /*else*/ if (!operating && !(reqpath.includes('/noauth') || reqpath.includes('/done') || reqpath.includes('/noauth') || reqpath.includes('/about'))) httpUtils.redirect(res, '/noauth');\n \n // Reading the requested file or - if it doesnot exist - 404.html\n else {\n var path = pagespath + reqpath;\n if (!fs.existsSync(path))\n path = `${pagespath}/404.html`;\n var content = fs.readFileSync(path, 'utf8');\n \n // Send out response\n var type = mime.lookup(path);\n res.writeHead(200, {\n 'Set-Cookie': cookiesout,\n 'Content-Type': type\n });\n res.end(content);\n }\n }).listen(port);\n}", "function testPortsNotAvailable(test) {\n\n var\n minPort = 10701,\n maxPort = 10800,\n hostName = \"localhost\",\n server,\n proxyManager = new ProxyManager(null, {});\n\n portchecker.getFirstAvailable(minPort, maxPort, hostName, function (p, host) {\n\n if (p === -1) {\n callback(\"Error : No free ports found for Proxy Server on \" + host + \" between \" + minPort + \" and \" + maxPort);\n } else {\n\n minPort = p;\n maxPort = p;\n\n server = http.createServer(function (request, response) {\n\n }).listen(minPort, hostName, function () {\n test.resume(function () {\n proxyManager.runRouterProxy(minPort, maxPort, hostName, function (proxyHostMsg) {\n\n test.resume(function () {\n A.areEqual(proxyHostMsg, 'Error : No free ports found for Proxy Server on ' + localhostip + ' between ' + minPort + ' and ' + maxPort);\n\n server.close(function () {\n });\n });\n\n });\n test.wait(3000);\n });\n\n });\n }\n });\n test.wait(8000);\n\n }", "function test3()\n{\n\tvar request = 'GET /profile.html HTTP/1.1\\r\\n' +\n 'Host: 127.0.0.1\\r\\n' +\n 'Connection: keep-alive\\r\\n' + \n '\\r\\n';\n\tsendWithSocket(request,'3.start test_FileNotFound404','HTTP/1.1 404 Not Found',\n\t\t\t'3.test_FileNotFound404 SUCCEEDED','3.test_FileNotFound404 failed');\n}", "static get port() {\n return 443;\n }", "static get port() {\n return 443;\n }", "static get port() {\n return 443;\n }", "static get port() {\n return 443;\n }", "static get port() {\n return 443;\n }", "function proxyUpgrade(apiUrl, req, socket, firstPacket) {\n // WebSocket requests must use the `GET` method and must have the\n // `Upgrade: websocket` header.\n if (\n req.method !== \"GET\" ||\n !req.headers.upgrade ||\n req.headers.upgrade.toLowerCase() !== \"websocket\"\n ) {\n writeResponse(400);\n return;\n }\n\n setupSocket(socket);\n\n // If the socket errs then log it instead of crashing the process.\n socket.on(\"error\", error => {\n logError(error);\n });\n\n // The first packet was read from our socket. This “un-reads” the packet by\n // putting it back in the socket’s readable stream.\n if (firstPacket && firstPacket.length) {\n socket.unshift(firstPacket);\n }\n\n // We need access to these variables here but we only get them asynchronously\n // in our callback.\n let accessToken;\n let newAccessToken = false;\n\n getAccessToken(apiUrl, req, (error, _accessToken, _newAccessToken) => {\n // If there was an error while trying to fetch our access token write an\n // error response to our socket...\n if (error) {\n const statusCode = error.statusCode || 500;\n const rawHeaders = [];\n if (error.resetTokens) {\n rawHeaders.push(\n \"Set-Cookie\",\n cookie.serialize(\"access_token\", \"\", cookieExpireSettings),\n );\n rawHeaders.push(\n \"Set-Cookie\",\n cookie.serialize(\"refresh_token\", \"\", cookieExpireSettings),\n );\n }\n writeResponse(statusCode, rawHeaders);\n return;\n }\n\n accessToken = _accessToken;\n newAccessToken = _newAccessToken;\n\n // Construct the HTTP request which should trigger an upgrade...\n const isHTTPS = apiUrl.protocol === \"https:\";\n const apiRequest = (isHTTPS ? https : http).request({\n protocol: apiUrl.protocol,\n hostname: apiUrl.hostname,\n port: apiUrl.port,\n agent: isHTTPS ? apiProxyAgent.https : apiProxyAgent.http,\n method: req.method,\n path:\n // Use the path we were given, minus `/api` plus the access token if we\n // have one.\n req.url.replace(/^\\/api/, \"\") +\n (accessToken ? `?access_token=${accessToken}` : \"\"),\n });\n\n apiRequest.on(\"error\", error => {\n logError(error);\n socket.end();\n });\n\n apiRequest.on(\"response\", handleResponse);\n apiRequest.on(\"upgrade\", handleUpgrade);\n\n // Copy headers we’re ok with proxying to our request options.\n for (let i = 0; i < req.rawHeaders.length; i += 2) {\n const header = req.rawHeaders[i];\n apiRequest.setHeader(header, req.rawHeaders[i + 1]);\n }\n\n // Add the `Forwarded` header to our request so the API server knows who\n // the request was originally from.\n apiRequest.setHeader(\"Forwarded\", getForwardedHeader(req));\n\n // Send the API request!\n apiRequest.end();\n\n /**\n * We only really need to handle the response when we aren’t going to be\n * upgrading to WebSockets. If we aren’t upgrading then we want to send over\n * the HTTP response and the rest of the body.\n */\n function handleResponse(apiResponse) {\n // If upgrade event isn't going to happen, close the socket...\n if (!apiResponse.upgrade) {\n // Write the HTTP headers from our API response to the socket.\n writeHead(apiResponse.statusCode, apiResponse.rawHeaders);\n\n // Pipe the rest of the API response to our socket...\n apiResponse.pipe(socket);\n }\n }\n\n /**\n * If the HTTP request upgrades then we handle it with this function. We\n * respond to our client with an HTTP 101 status code and pipe the API socket\n * to our client’s socket.\n */\n function handleUpgrade(apiResponse, apiSocket, apiFirstPacket) {\n apiSocket.on(\"error\", error => {\n logError(error);\n socket.end();\n });\n\n socket.on(\"error\", error => {\n logError(error);\n apiSocket.end();\n });\n\n setupSocket(apiSocket);\n\n // The first packet was read from our socket. This “un-reads” the packet by\n // putting it back in the socket’s readable stream.\n if (apiFirstPacket && apiFirstPacket.length) {\n apiSocket.unshift(apiFirstPacket);\n }\n\n // Write the HTTP headers from our API response to the socket.\n writeHead(101, apiResponse.rawHeaders);\n\n // Pipe the sockets together! Yay we did it!\n apiSocket.pipe(socket).pipe(apiSocket);\n }\n });\n\n /**\n * Writes an HTTP head to our socket. We ask for the raw headers array\n * format that Node.js provides so that we use the same casing as our request.\n */\n function writeHead(statusCode, rawHeaders) {\n let head = `HTTP/1.1 ${statusCode} ${http.STATUS_CODES[statusCode]}\\r\\n`;\n\n // Add all of our raw headers...\n for (let i = 0; i < rawHeaders.length; i += 2) {\n head += `${rawHeaders[i]}: ${rawHeaders[i + 1]}\\r\\n`;\n }\n\n // When writing the head if we have a new access token let’s add a\n // `Set-Cookie` header...\n if (newAccessToken && accessToken !== undefined) {\n // Set our cookie with the updated access token. This way we won’t\n // need to generate an access token for every request. We can use\n // this one for the next hour or so.\n head += `Set-Cookie: ${cookie.serialize(\n \"access_token\",\n accessToken,\n cookieSettings,\n )}\\r\\n`;\n }\n\n head += \"\\r\\n\";\n\n socket.write(head);\n }\n\n /**\n * Writes an entire plain text response to our socket. We ask for a headers\n * object and convert it to a raw headers array.\n */\n function writeResponse(\n statusCode,\n rawHeaders = [],\n bodyText = http.STATUS_CODES[statusCode],\n ) {\n // Write the head to our socket...\n writeHead(statusCode, [\n \"Connection\",\n \"close\",\n \"Content-Type\",\n \"text/html\",\n \"Content-Length\",\n Buffer.byteLength(bodyText),\n ...rawHeaders,\n ]);\n\n // Write the body to our socket...\n socket.write(bodyText);\n\n // We are done with our socket so end it!\n socket.end();\n }\n}", "function suite(name, app) {return function() {\n\n before(function() {\n this.app = app;\n this.lr = new Server();\n\n this.app\n .use(connect.query())\n .use(connect.bodyParser())\n .use(this.lr.handler.bind(this.lr));\n\n this.server = http.createServer(this.app);\n debug('Start %s suite, listen on %d', name, port);\n this.server.listen(port);\n });\n\n\n after(function(done) {\n this.server.close(done);\n });\n\n describe('GET /', function() {\n it('respond with nothing, but respond', function(done){\n request(this.server)\n .get('/')\n .expect('Content-Type', /json/)\n .expect(/\\{\"tinylr\":\"Welcome\",\"version\":\"0.0.[\\d]+\"\\}/)\n .expect(200, done);\n });\n\n it('unknown route are noop with middlewares, next-ing', function(done){\n request(this.server)\n .get('/whatev')\n .expect('Content-Type', 'text/plain')\n .expect('Cannot GET /whatev')\n .expect(404, done);\n });\n });\n\n\n describe('GET /changed', function() {\n it('with no clients, no files', function(done) {\n request(this.server)\n .get('/changed')\n .expect('Content-Type', /json/)\n .expect(/\"clients\":\\[\\]/)\n .expect(/\"files\":\\[\\]/)\n .expect(200, done);\n });\n\n it('with no clients, some files', function(done) {\n request(this.server)\n .get('/changed?files=gonna.css,test.css,it.css')\n .expect('Content-Type', /json/)\n .expect('{\"clients\":[],\"files\":[\"gonna.css\",\"test.css\",\"it.css\"]}')\n .expect(200, done);\n });\n });\n\n describe('POST /changed', function() {\n it('with no clients, no files', function(done) {\n request(this.server)\n .post('/changed')\n .expect('Content-Type', /json/)\n .expect(/\"clients\":\\[\\]/)\n .expect(/\"files\":\\[\\]/)\n .expect(200, done);\n });\n\n it.skip('with no clients, some files', function(done) {\n var data = { clients: [], files: ['cat.css', 'sed.css', 'ack.js'] };\n\n var r = request(this.server)\n .post('/changed')\n .send({ files: data.files })\n .expect('Content-Type', /json/)\n .expect(JSON.stringify(data))\n .expect(200, done);\n });\n });\n\n describe('GET /livereload.js', function() {\n it('respond with livereload script', function(done) {\n request(this.server)\n .get('/livereload.js')\n .expect(/LiveReload/)\n .expect(200, done);\n });\n });\n\n describe.skip('GET /kill', function() {\n it('shutdown the server', function(done) {\n var server = this.server;\n request(server)\n .get('/kill')\n .expect(200, function(err) {\n if(err) return done(err);\n assert.ok(!server._handle);\n done();\n });\n });\n });\n\n}}", "function check_server_and_reload()\n{\n if (use_advanced_page_reload)\n sm_send_request(\"GET\", window.location.href, \"\", \"replace_document\", false,\n reload_request_timeout, \"server_or_connect_error\", false, \"\", false);\n else\n sm_send_request(\"GET\", base_uri + \"images/spacer.png\", \"\", \"reload_now\", false,\n reload_request_timeout, \"server_or_connect_error\", false, \"\", true);\n}", "upgrade() {}", "function downgradeRedirectTo(partialPath) {\n return secureRedirectURL + encodeURIComponent(insecureTestURL + partialPath);\n}", "function UriTestSuite() {\n\n this.name = \"Uri\";\n this.tag = \"utils\";\n\n // convenience names\n var LOCALHOST = SDUri_FILE_HOSTNAME,\n PAGE_HOSTNAME = SDUri_PAGE_HOSTNAME;\n\n // this function was tested manually\n function randomlyCapitalize(str) {\n return str.replace(/\\w/g, function (letter) {\n return Math.random() < 0.5 ? letter.toUpperCase() : letter.toLowerCase();\n });\n }\n\n function verifyHostname(url, expHostname) {\n var hostname = SDUri_getHostname(url);\n expectTypeof(hostname, \"string\");\n expectEqual(hostname, expHostname || PAGE_HOSTNAME);\n };\n\n this.hostname = function () {\n\n function verify(url, expHostname) {\n verifyHostname(url, expHostname);\n };\n\n // Testing hostname edge cases...\n verify(\"\"); // assuming an empty URL is legal\n verify(\".\");\n verify(\"./\");\n verify(\"..\");\n verify(\"../\");\n verify(\"/\");\n verify(\"/.\");\n verify(\"/..\");\n verify(\"/../.\");\n\n // Testing hostname for relative URLs...\n verify(\"foo.jpg\");\n verify(\"../foo.jpg\");\n verify(\"images/foo.jpg\");\n verify(\"../images/foo.jpg\");\n verify(\"images/foo/../bar/\");\n verify(\"../../images/foo/bar/\");\n verify(\"/images/foo/bar.jpg\");\n verify(\"/images/foo/../bar/image.jpg\");\n verify(\"www.example.com/foo/bar/\"); // examples of incorrectly relative URLs\n verify(\"foo.bar.org/images/../../image.jpg\");\n\n // Testing hostname for absolute URLs...\n verify(\"http://example.com/\", \"example.com\");\n verify(\"http://example.com:80/\", \"example.com\"); // port numbers...\n verify(\"http://example.com:9999/\", \"example.com\"); // shouldn't matter!\n verify(\"http://sub.example.com/\", \"sub.example.com\");\n verify(\"http://foo.bar.baz.example.com/\", \"foo.bar.baz.example.com\");\n verify(\"http://example.com/foo/bar/baz/\", \"example.com\");\n verify(\"http://example.com/foo/bar/baz.jpg\", \"example.com\");\n verify(\"http://foo.bar.example.com/baz/image.jpg\", \"foo.bar.example.com\");\n verify(\"http://t2.tiles.virtualearth.net/tiles/h02123012?g=282\", \"t2.tiles.virtualearth.net\");\n verify(\"http://t0.tiles.virtualearth.net/tiles/r02123010?g=282&shading=hill\", \"t0.tiles.virtualearth.net\");\n\n // Testing hostname for file:// URLs...\n verify(\"file:///C:/\", LOCALHOST);\n verify(\"file:///C:/Windows/\", LOCALHOST);\n verify(\"file:///C:/Windows/System32/mshtml.dll\", LOCALHOST);\n verify(\"file:///Users/\", LOCALHOST);\n verify(\"file:///Users/me/\", LOCALHOST);\n verify(\"file:///Users/me/Sites/index.html\", LOCALHOST);\n\n // Testing hostname for https:// URLs...\n verify(\"https://sub.example.com/\", \"sub.example.com\");\n verify(\"https://foo.bar.baz.example.com/\", \"foo.bar.baz.example.com\");\n verify(\"https://example.com/foo/bar/baz/\", \"example.com\");\n verify(\"https://example.com/foo/bar/baz.jpg\", \"example.com\");\n }\n\n this.hostnameCaps = function () {\n\n function verify(url, expHostname) {\n // hostname should remain all lowercase\n verifyHostname(randomlyCapitalize(url), expHostname);\n };\n\n // Testing hostname random capitalizations...\n // all of these examples are taken from test cases above, but are now being\n // randomly capitalized, letter by letter...\n verify(\"http://foo.bar.example.com/baz/image.jpg\", \"foo.bar.example.com\");\n verify(\"https://t2.tiles.virtualearth.net/tiles/h02123012?g=282\", \"t2.tiles.virtualearth.net\");\n verify(\"images/foo/../bar/\");\n verify(\"/images/foo/../bar/image.jpg\");\n verify(\"www.example.com/foo/bar/\");\n verify(\"file:///C:/Windows/System32/mshtml.dll\", LOCALHOST);\n verify(\"file:///Users/me/Sites/index.html\", LOCALHOST);\n }\n}", "function startWebserver() {\n\n if ( curProtocol === 'https' ) {\n const credentials = {\n key: fs.readFileSync( configs.protocol[ curProtocol ].privateKey ),\n cert: fs.readFileSync( configs.protocol[ curProtocol ].certificate ),\n ca: fs.readFileSync( configs.protocol[ curProtocol ].ca )\n };\n const https_server = https.createServer( credentials, handleRequest );\n\n // start HTTPS webserver\n https_server.listen( configs.protocol[ curProtocol ].port );\n\n console.log( 'HTTPS server started at: https://' + configs.domain + ':' + configs.protocol[ curProtocol ].port );\n\n } else if ( curProtocol === 'http' ) {\n const http_server = http.createServer( handleRequest );\n\n // start HTTP webserver\n http_server.listen( configs.protocol[ curProtocol ].port );\n\n console.log( 'HTTP server started at: http://' + configs.domain + ':' + configs.protocol[ curProtocol ].port);\n\n } else {\n console.error( \"neither 'http' or 'https' configuration specified\" );\n }\n }", "function set_https_secure_check(is_enable) {\n if(!is_enable) {\n console.log(\"[INFO] Turn OFF https security checks\");\n\n // disable https security checks to avoid DEPTH_ZERO_SELF_SIGNED_CERT error\n process.env.NODE_TLS_REJECT_UNAUTHORIZED = \"0\";\n } else if(typeof process.env.NODE_TLS_REJECT_UNAUTHORIZED !== 'undefined') {\n console.log(\"[INFO] Turn ON https security checks\");\n\n // enable https security checks\n delete process.env.NODE_TLS_REJECT_UNAUTHORIZED;\n }\n }", "function prepareRungServer() {\n const server = http.createServer((req, res) => {\n if (req.method !== 'POST') {\n res.writeHead(404);\n return res.end();\n }\n\n const routes = {\n '/login': ~res.writeHead(200),\n '/metaExtensions/drafts': ~res.writeHead(201)\n };\n\n routes[req.url]();\n return res.end();\n });\n\n return new Promise(server.listen(FAKE_SERVER_PORT, _));\n}", "function request7000(request, response) {\n\n // Send the below string to the client when the user visits the PORT URL\n response.end(\"You looking good today!\" + request.url);\n}", "function setURL() {\n var proto;\n var url;\n var port;\n if (window.location.protocol == \"http:\") {\n proto = \"ws://\";\n port = \"8080\";\n } else {\n proto = \"wss://\";\n port = \"8443\";\n }\n\n url = proto + window.location.hostname + \":\" + port;\n return url;\n}", "function httpRequester(url) {\n return url && url.startsWith('https://') ? https : http;\n}", "function mungeURL(url) {\n let rbase = process.env.SOLID_REMOTE_BASE;\n if(!url) return\n if( url.match(/^https:\\/[^/]/) ){\n url = url.replace(/^https:\\//,\"https://\")\n }\n if( url.match(/^\\//) && rbase ){\n return rbase + url;\n }\n else if( url.match(/^\\.\\//) ){\n return lbase + url.replace(/\\./,'');\n }\n else if( !url.match(/^(http|file|app)/) ){\n console.log(url);\n console.log(\"URL must start with https:// or file:// or / or ./\")\n return false\n }\n return url\n}", "function test0()\n{\n\t(server = HTTPmodule.createServer(app)).listen(PORT);\n\tconsole.log('0.start test_no_use');\n\tvar socket0 = NETmodule.connect(options,function() {\n\t\t\t socket0.write('GET /Hello_world.txt HTTP/1.1\\r\\n' +\n\t\t\t 'Host: 127.0.0.1\\r\\n' +\n\t\t\t 'Connection: keep-alive\\r\\n' + \n\t\t\t '\\r\\n');\n\t\t\t});\n\tvar i0 = 0;\n\tsocket0.on('data', function(chunk) {\n\t\tif (i0 === 0) //if it is the header.\n\t\t{\n\t\t\tvar d = chunk.toString();\n\t\t\tif (d.indexOf('HTTP/1.1 404 Not Found') !== -1)\n\t\t\t{\n\t\t\t\tconsole.log('0.test_no_use SUCCEEDED');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tconsole.log('0.test_no_use failed');\n\t\t\t}\n\t\t\ti0++;\n\t\t}\n\t});\n\trunTests();\n\tsocket0.on('error', function(e) {\n\t\tconsole.log('problem with request 0: ' + e.message);\n\t\trunTests();\n\t});\n}", "function assembleHandshake (url, key) {\n//function assembleHandshake (host, origin, key) {\n let urlParts = Url.parse(url);\n return `GET / HTTP/1.1\nHost: ${urlParts.hostname}\nUpgrade: websocket\nConnection: Upgrade\nOrigin: ${url}\nSec-WebSocket-Key: ${key}\nSec-WebSocket-Version: 13\n\n`;\n}", "function usesOldOpenSsl(rubyVersion) {\n return rubyVersion.match(/^2\\.[0123]/);\n}", "function usesOldOpenSsl(rubyVersion) {\n return rubyVersion.match(/^2\\.[0123]/);\n}", "function httpify () {\n var port = getPort();\n return function() {\n var vows = this;\n var cwd = process.cwd().split(\"/\");\n if (\n \"test\" != cwd[cwd.length - 1]\n ) cwd.push(\"test\");\n // the config.path is set to the test dir\n // everything outside shouldn't be served\n // (cli.js sets config.path to your cwd)\n server.serve(port, cwd.join(\"/\"), function (err) {\n vows.callback(err, port);\n });\n };\n}", "function should_upgrade(upgrade_to_version, comp_doc, cb) {\n\t\t\tif (!comp_doc || !comp_doc.version) {\n\t\t\t\tlogger.warn('[fab upgrade] unexpected error, missing comp doc or \"version\" field');\n\t\t\t\treturn cb(null, false);\n\t\t\t} else {\n\t\t\t\t// the version in upgrade_to_version is okay, any lower is not\n\t\t\t\tif (!t.misc.is_version_b_greater_than_a(comp_doc.version, upgrade_to_version)) {\n\t\t\t\t\tlogger.debug('[fab upgrade] version good. comp:', comp_doc._id, 'version:', comp_doc.version);\n\t\t\t\t\treturn cb(null, false);\n\t\t\t\t} else {\n\t\t\t\t\ttls_certs_near_expiration(comp_doc, (errors, is_near_expiration) => {\n\t\t\t\t\t\tif (is_near_expiration) {\n\t\t\t\t\t\t\tlogger.warn('[fab upgrade] tls cert for comp IS near expiration. comp:', comp_doc._id);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlogger.debug('[fab upgrade] tls cert for comp is not near expiration. comp:', comp_doc._id);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn cb(null, is_near_expiration);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// check if the tls certs are near expiration\n\t\t\tfunction tls_certs_near_expiration(component_doc, cert_cb) {\n\t\t\t\t// get the cert from deployer's api response\n\t\t\t\tget_comps_tls_cert_from_deployer(component_doc, (_, tls_cert) => {\n\t\t\t\t\tif (!tls_cert) {\n\t\t\t\t\t\tlogger.error('[fab upgrade] unable to get tls cert for auto fab upgrade check, skipping component');\n\t\t\t\t\t\treturn cert_cb(null, false);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst too_close_to_expiration_ms = ev.AUTO_FAB_UP_EXP_TOO_CLOSE_DAYS * 24 * 60 * 60 * 1000;\n\t\t\t\t\t\tif (t.misc.cert_is_near_expiration(tls_cert, too_close_to_expiration_ms, component_doc._id)) {\n\t\t\t\t\t\t\treturn cert_cb(null, true);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn cert_cb(null, false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}", "function startHttp2({port, key, cert}, app) {\n const spdy = require('spdy');\n\n spdy.createServer({ key, cert }, app)\n .listen(config.SSL.port, err => err ? console.error(err) : console.log('Express Server Listening on port %s with HTTP/2', config.SSL.port));\n}", "function test2()\n{\n\tvar request = 'GETT /profile.html HTTP/1.1\\r\\n' +\n 'Host: 127.0.0.1\\r\\n' +\n 'Connection: keep-alive\\r\\n' + \n '\\r\\n';\n\tsendWithSocket(request,'2.start test_MethodNotExists500','HTTP/1.1 500 Internal Server Error',\n\t\t\t'2.test_MethodNotExists500 SUCCEEDED','2.test_MethodNotExists500 failed');\n}", "async function startWebServer () {\n const shutdownOptions = {\n logger: console,\n forceTimeout: 30000\n }\n\n if (sslEnabled) {\n secureCtx = await createSecureContext()\n // create with `secureCtx` so we can renew certs without restarting the server\n const httpsServer = https.createServer(\n {\n SNICallback: (_, cb) => cb(null, secureCtx)\n },\n app\n )\n // update secureCtx to reassign the new cert files\n app.use(\n '/reload-certs',\n async () => (secureCtx = await createSecureContext())\n )\n // graceful shutdown prevents new clients from connecting & waits for to diconnect\n app.use(graceful(httpsServer, shutdownOptions))\n // websocket uses same fd\n attachWebSocket(httpsServer)\n // callback gets public facing ip\n httpsServer.listen(sslPort, checkPublicIpAddress)\n }\n\n const httpServer = http.createServer(app)\n app.use(graceful(httpServer, shutdownOptions))\n\n if (sslEnabled) {\n // set up a route to redirect http to https\n httpServer.get('*', function (req, res) {\n res.redirect('https://' + req.headers.host + req.url)\n })\n } else {\n attachWebSocket(httpServer)\n }\n httpServer.listen(port, checkPublicIpAddress)\n}", "isVersionProbe(info) {\n return !info.protocolMajorVersion && !info.protocolMinorVersion\n }", "function handleRequests(request, response) {\n\t// the below statement is triggered (client-side) when the user visits the PORT url\n\tresponse.end(goodArray[Math.floor(Math.random() * goodArray.length)] + request.url);\n}", "static get port() {\n return 443;\n }", "static get port() {\n return 443;\n }", "function testUrl(url,request_method,evalJsOnFail) {\r\n\tif (url == null) return false;\r\n\tif (request_method == null) request_method = 'get';\r\n\tvar errorMsg = \"Unfortunately, the REDCap server was not able to reach the web address you provided and thus was not able to verify it as valid.<div style='font-size:13px;padding:20px 0 5px;color:#C00000;'>Not verifiable: &nbsp;<b>\"+url+\"</b></div>\";\r\n\tvar errorTitle = \"<img src='\"+app_path_images+\"cross.png' style='vertical-align:middle;'> <span style='color:#C00000;vertical-align:middle;'>Failed to verify web address</span>\";\r\n\t// Start \"working...\" progress bar\r\n\tshowProgress(1,300);\r\n\t// Do ajax request to test the URL\r\n\tvar thisAjax = $.post(app_path_webroot+'ProjectGeneral/test_http_request.php',{ url: url, request_method: request_method },function(data){\r\n\t\tshowProgress(0,0);\r\n\t\tif (data == '1') {\r\n\t\t\tsimpleDialog(\"The web address is a valid URL and was able to be reached by the REDCap server.<div style='font-size:13px;padding:20px 0 5px;color:green;'>Valid: &nbsp;<b>\"+url+\"</b></div>\",\"<img src='\"+app_path_images+\"tick.png' style='vertical-align:middle;'> <span style='color:green;vertical-align:middle;'>Success!</span>\");\r\n\t\t} else {\r\n\t\t\tsimpleDialog(errorMsg, errorTitle);\r\n\t\t\t// If provided javascript to eval upon failure, the eval it here\r\n\t\t\tif (evalJsOnFail != null) eval(evalJsOnFail);\r\n\t\t}\r\n\t});\r\n\t// If does not finish after X seconds, then throw error msg\r\n\tvar maxAjaxTime = 10; // seconds\r\n\tsetTimeout(function(){\r\n\t\tif (thisAjax.readyState == 1) {\r\n\t\t\tthisAjax.abort();\r\n\t\t\tshowProgress(0,0);\r\n\t\t\tsimpleDialog(errorMsg, errorTitle);\r\n\t\t\t// If provided javascript to eval upon failure, the eval it here\r\n\t\t\tif (evalJsOnFail != null) eval(evalJsOnFail);\r\n\t\t}\r\n\t},maxAjaxTime*1000);\r\n}", "function checkHtml5Route (req, res, next) {\n // 301 redirect www to non-www\n // if ( req.headers.host.match(/www\\.openlegendrpg\\.com/) ) {\n // res.setHeader('Location','http://openlegendrpg.com');\n // res.send(301);\n // }\n\n // requesting a route rather than a file (has no `.` character)\n if ( req.path().split('.').length <= 1 ) {\n req.url = 'index.html';\n req.path = function () { return req.url; };\n var serve = serveStatic(\n config.root+'/client',\n {'index': ['index.html']}\n );\n\n serve(req,res,next);\n } else {\n next();\n }\n}", "fireUpEngines() {\n const httpServer = http.createServer(this.app);\n httpServer.listen(this.configuration.port);\n console.log(`TreeHouse HTTP NodeJS Server listening on port ${this.configuration.port}`);\n\n // HTTPS - Optional\n if (this.configuration.https) {\n const httpsServer = https.createServer(this.getHttpsCredentials(), this.app);\n httpsServer.listen(this.configuration.https.port);\n console.log(`TreeHouse HTTPS NodeJS Server listening on port ${this.configuration.https.port}`);\n }\n }", "function startServer (port) {\n http.createServer(function (req, res) {\n var status\n var query = url.parse(req.url, true).query || {}\n\n console.log(req.url, req.headers, query)\n if (req.headers['x-ua-device']) {\n res.setHeader('Vary', 'x-ua-device')\n }\n\n if (/\\/\\d{3}/.test(req.url)) {\n status = req.url.replace(/\\/(\\d{3})/, '$1')\n status = parseInt(status, 10)\n switch (status) {\n case 301:\n case 302:\n case 303: {\n res.statusCode = status\n res.setHeader('Location', (query.location || '/'))\n break\n }\n case 400:\n case 401:\n case 402:\n case 403:\n case 404: {\n res.statusCode = status\n break\n }\n default: {\n res.statusCode = 500\n break\n }\n }\n res.end()\n return\n }\n\n if (req.headers.cookie) {\n res.write('cookie: ' + req.headers.cookie + '\\n')\n }\n res.end(port + ':' + req.url + ' ' + req.method + ' ' + req.headers['x-ua-device'] + '\\n')\n }).listen(port)\n}", "function handleRequestTwo(request, response) { //whats the request? req to the url.\n//console.log(request.url);\n // Send the below string to the client when the user visits the PORT URL\n response.end(\"I guess javasccript is not your forte! \" + request.url);\n} //creates the strung & sends it back to the browser.", "async function onUpgrade(req, socket, head) {\n const startTime = Date.now()\n const reqURL = getURL(req)\n\n try {\n\n logger.info(logger.cyan(req.method), reqURL)\n\n let hostname = null\n let port = null\n\n if (req.url[0] === '/') {\n\n const [parsedHostname, parsedPort] = req.headers.host.split(' ')\n hostname = parsedHostname\n port = parsedPort || 443\n\n } else {\n\n const parsedURL = url.parse(req.url)\n hostname = parsedURL.hostname\n port = parsedURL.port || 80\n\n }\n\n socket.once('error', error => {\n logger.error(logger.red(`${req.method}:socket`), reqURL, '\\n', error.stack)\n })\n\n let remoteSocket = await upstream.connect(port, hostname, { ua: req.headers['user-agent'] })\n if (req.socket instanceof tls.TLSSocket) {\n remoteSocket = new tls.TLSSocket(remoteSocket)\n }\n\n socket.once('error', error => {\n remoteSocket.destroy()\n })\n\n remoteSocket.once('error', error => {\n logger.error(logger.red(`${req.method}:remote`), reqURL, '\\n', error.stack)\n socket.destroy()\n })\n\n remoteSocket.pipe(socket)\n\n remoteSocket.write(`${req.method} ${req.url} HTTP/${req.httpVersion}\\r\\n`)\n for (let i = 0, ii = req.rawHeaders.length; i < ii; i += 2) {\n remoteSocket.write(`${req.rawHeaders[i]}: ${req.rawHeaders[i + 1]}\\r\\n`)\n }\n remoteSocket.write('\\r\\n')\n remoteSocket.write(head)\n\n socket.pipe(remoteSocket)\n\n logger.info(logger.green(req.method), reqURL, logger.green(`[${Date.now() - startTime}ms]`))\n\n } catch (error) {\n\n logger.error(logger.red(req.method), reqURL, logger.red(`[${Date.now() - startTime}ms]`), '\\n', error.stack)\n socket.destroy()\n }\n }", "function isSamePort(protocol1, port1, protocol2, port2) {\n if (port1 === port2) {\n return true;\n } else if (protocol1 === protocol2) {\n if (protocol1 === 'http') {\n return useDefault(port1, '80') === useDefault(port2, '80');\n } else if (protocol1 === 'https') {\n return useDefault(port1, '443') === useDefault(port2, '443');\n }\n }\n return false;\n }", "function testApp(port) {\n var server = null;\n var app = createExpressApp();\n port = port || DEFAULT_PORT;\n\n return {\n startListening: startListening,\n stopListening: stopListening,\n url: getUrl\n };\n\n function startListening() {\n return new Promise(function(resolve, reject) {\n server = http.createServer(app);\n server.listen(port, function(err) {\n if (err) return reject(err);\n resolve();\n });\n });\n }\n\n function stopListening() {\n return new Promise(function(resolve) {\n server.close(function() {\n resolve();\n });\n });\n }\n\n function getUrl(url) {\n return 'http://localhost:' + port + url;\n }\n}", "function isSupportedProtocol (urlString) {\n let supportedProtocols = ['https:', 'http:']\n let url = document.createElement('a')\n url.href = urlString\n return supportedProtocols.indexOf(url.protocol) !== -1\n}", "function makeURLSecure (url) {\n return url.replace(/^http:/, 'https:')\n}", "function bindServe() {\n return new Promise((resolve, reject) => {\n\n // Logging \"warnings\" but not rejecting test\n webpackServer.stderr.on('data', data => log(data));\n webpackServer.stdout.on('data', data => {\n const dataAsString = log(data);\n if (dataAsString.indexOf('Compiled successfully.') > -1) {\n resolve(spyPort);\n }\n if (dataAsString.indexOf('Failed to compile.') > -1) {\n reject(dataAsString);\n }\n });\n });\n}", "function withHttps() {\n\tconst config = {\n\t\tdomain: 'localhost', // your domain\n\t\thttps: {\n\t\t\tport: 4000, // any port that is open and not already used on your server\n\t\t\toptions: {\n\t\t\t\tpassphrase: 'fabian',\n\t\t\t\tpfx: fs.readFileSync(\n\t\t\t\t\tpath.resolve(process.cwd(), 'cert/CA/testingdomain.pfx')\n\t\t\t\t),\n\t\t\t},\n\t\t},\n\t};\n\n\tconst serverCallback = server.callback();\n\n\ttry {\n\t\tconst httpsServer = https.createServer(\n\t\t\tconfig.https.options,\n\t\t\tserverCallback\n\t\t);\n\n\t\thttpsServer.listen(config.https.port, function (err) {\n\t\t\tif (!!err) {\n\t\t\t\tconsole.error('HTTPS server FAIL: ', err, err && err.stack);\n\t\t\t} else {\n\t\t\t\tconsole.log(\n\t\t\t\t\t`HTTPS server OK: https://${config.domain}:${config.https.port}`\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\t} catch (ex) {\n\t\tconsole.error('Failed to start HTTPS server\\n', ex, ex && ex.stack);\n\t}\n}", "function validateURL(urlToTest) {\n\n const protocolString = \"http://\";\n let charToCheck = [];\n charToCheck = urlToTest.split('');\n\n if(charToCheck[3] === 'p' && charToCheck[4] === ':'){\n return urlToTest;\n }else {\n return protocolString + urlToTest;\n }\n\n}", "function podPress_https_check(url) {\r\n\t\tvar siteurl_without_protocol = podPressBlogURL.match(/^https?:\\/\\//i, url);\r\n\t\tvar url_without_protocol = podPressBlogURL.replace(siteurl_without_protocol, '');\r\n\t\tvar siteurl_regexp = new RegExp( url_without_protocol, 'i' );\r\n\t\tif ( -1 != url.search(siteurl_regexp) ) {\r\n\t\t\treturn url.replace(/^http:/i, window.location.protocol);\r\n\t\t} else {\r\n\t\t\treturn url;\r\n\t \t}\r\n\t}", "function formatUrl(host, port, useHttps, contextPath) {\n var protocol = \"http\";\n if (useHttps) {\n protocol = \"https\";\n }\n\n if (contextPath) {\n if (contextPath.charAt(0) != \"/\"){\n contextPath = \"/\" + contextPath;\n }\n } else {\n contextPath = \"\";\n }\n\n if (port) {\n port = \":\" + port;\n } else {\n port = \"\";\n }\n\n return protocol + \"://\" + host + port + contextPath;\n}", "async function runTestOnAllHtmlUrls() {\n\tconst testUrls = [\n\t\t 'http://example.com',\n\t\t /*\n \t 'https://www.theguardian.com/environment/2016/aug/02/environment-climate-change-records-broken-international-report', // https://github.com/hypothesis/client/issues/73\n\t\t 'https://telegra.ph/whatsapp-backdoor-01-16', // https://github.com/hypothesis/client/issues/558\n\t\t 'https://dashboard.wikiedu.org/training/students/wikipedia-essentials/policies-and-guidelines-basic-overview', // https://github.com/hypothesis/product-backlog/issues/493\n\t\t 'https://www.theatlantic.com/magazine/archive/1945/07/as-we-may-think/303881/',\n\t\t 'https://www.poetryfoundation.org/poems/50364/neutral-tones',\n\t\t 'https://hackernoon.com/why-native-app-developers-should-take-a-serious-look-at-flutter-e97361a1c073',\n\t\t 'https://lincolnmullen.com/projects/spatial-workshop/literacy.html',\n\t\t 'https://www.greenpeace.org/usa/reports/click-clean-virginia/',\n\t\t 'https://www.fastcompany.com/28905/brand-called-you',\n\t\t 'https://www.forbes.com/sites/danschawbel/2011/12/21/reviving-work-ethic-in-america/#67ab8458449a',\n\t\t 'http://mmcr.education/courses/pls206-01-W19/readings/marbury_v_madison.html',\n\t\t 'https://www.si.com/vault/2002/03/25/320766/the-real-new-york-giants',\n\t\t 'https://www.nytimes.com/2018/12/08/opinion/college-gpa-career-success.html',\n\t\t 'https://www.dartmouth.edu/~milton/reading_room/pl/book_3/text.shtml',\n\t\t 'http://mikecosgrave.com/annotation/reclaiming-conversation-social-media/',\n\t\t 'https://english.writingpzimmer.net/about/snow-day-billy-collins/',\n\t\t 'https://www.facinghistory.org/resource-library/video/day-learning-2013-binna-kandola-diffusing-bias',\n\t\t 'http://codylindley.com/frontenddevbooks/es2015enlightenment/'\n\t\t */\n\t]\n\tconst omitted = [\n // embeds client, cannot work. note: no highlights at libretexts, they are missing our css\t\t\n\t\t// 'https://human.libretexts.org/Bookshelves/Composition/Book%3A_Successful_College_Composition_(Crowther_et_al.)/3%3A_Rhetorical_Modes_of_Writing/3.1%3A_Narration', \n\t]\n\tlet results = {}\n\tfor (let testUrlIndex = 0; testUrlIndex < testUrls.length; testUrlIndex++) {\n\t\tlet testUrl = testUrls[testUrlIndex]\n\t\tlet result = await runHtmlTest(testUrl) \n\t\twriteResults(testUrlIndex, result, 'html', '0')\n\t\tresults[testUrl] = result\n\t}\n\twriteResults('all', results, 'html')\n}", "function urlX(url) { if(/^https?:\\/\\//.test(url)) { return url }}", "isSecure() {\n return this.https ? true : false;\n }", "testUpdateAppVersion() {\n if (process.client) {\n this.getApi().post('version/').then((data) => {\n const appVersion = data.app_version;\n const actualVersion = this.getActualVersion();\n if (appVersion !== actualVersion) {\n this.setActualVersion(appVersion);\n window.location.reload();\n }\n });\n }\n }", "function test10()\n{\n\tconsole.log('10.start test_http1.0_with_NO_Connection_keep_alive');\n\n\tvar options10 = {\n\t\t\thost: '127.0.0.1'\n\t};\n\toptions10.port = PORT;\n\tvar socket10 = NETmodule.createConnection(PORT, function() {\n\t\tsocket10.write('GET /y/hello-world-for-test.txt HTTP/1.0\\r\\n' +\n\t 'Host: 127.0.0.1\\r\\n\\r\\n');\n\t});\n\n\tsocket10.on('data', function(chunk) {});\n\tsocket10.on('end',function(){\n\t\ttry\n\t\t{\n\t\t\tsocket10.write('GET /y/hello-world-for-test.txt HTTP/1.0\\r\\n' +\n\t\t 'Host: 127.0.0.1\\r\\n\\r\\n');\n\t\t\tconsole.log('10.test_http1.0_with_NO_Connection_keep_alive failed');\n\t\t}\n\t\tcatch(e)\n\t\t{\n\t\t\tconsole.log('10.test_http1.0_with_NO_Connection_keep_alive SUCCEEDED');\n\t\t}\n\t});\n}", "function isHttp(dependency) {\n return Boolean(dependency.startsWith('http://') || dependency.startsWith('https://'));\n}", "validNetwork(){\n switch(this.injectedWeb3.version.network){\n case '42':\n return true;\n default:\n return false;\n }\n }", "function test7()\n{\n\tconsole.log('7.start test_try_to_send_complete_http_request_after_timeout');\n\tvar options7 = {\n\t\t\thost: '127.0.0.1'\n\t};\n\toptions7.port = PORT;\n\tvar socket7 = NETmodule.connect(options7, function() {\n\t socket7.write('GET /y/style.css HTTP/');\n\t setTimeout(function(){\n\t\t socket7.write('1.1\\r\\nHost: 127.0.0.1\\r\\n' +\n\t\t 'Connection: keep-alive\\r\\n' + \n\t\t \t\t\t '\\r\\n');\n\t },2500);\n\n\t});\n\n\tsocket7.on('data', function(chunk) {\n\t\tif (chunk.toString().indexOf('200 OK') !== -1)\n\t\t{\n\t\t\tconsole.log('7.test_complete_http_request_after_timeout failed');\n\t\t}\n\t});\n\tsocket7.on('error', function(e) {\n\t\tconsole.log('7.test_try_to_send_complete_http_request_after_timeout SUCCEEDED');\n\t});\n}", "function handleRequest1(request, response){\n\n //send the below string to the client when the user visits the PORT1 URL\n response.end(\"You are awesome! This works: \" + request.url);\n}", "function checkUrl(url) {\n\tif( !(/^http:/.test(url)) ) {\n\t\tif( /^((\\/yzz\\/)|(\\/zsy\\/)|(\\/xohu\\/)|(\\/zs\\/)|(\\/zj\\/))/.test(url) ) {\n\t\t\t//url = mockBaseURL + url;\n\t\t} else {\n\n\t\t\t// 徐东个人电脑(临时)\n//\t\t\tif( url.indexOf('/itsm/performance/') != -1 ){\n//\t\t\t\turl = 'http://192.168.3.22:9900' + url;\n//\t\t\t\treturn url;\n//\t\t\t}\n\n\t\t\t// 徐东个人电脑(临时)\n\t\t\tif( url.indexOf('/xd/') != -1 ){\n\t\t\t\turl = url.replace('/xd/', 'http://192.168.3.22:9900/');\n\t\t\t\t//url = url.replace('/xd/', 'http://192.168.3.22:8762/');\n\t\t\t\treturn url;\n\t\t\t};\n\n\t\t\tif( url.indexOf('/xd2/') != -1 ){\n\t\t\t\turl = url.replace('/xd2/', 'http://192.168.3.22:9900/');\n\t\t\t\t//url = url.replace('/xd/', 'http://192.168.3.22:8762/');\n\t\t\t\treturn url;\n\t\t\t};\n\n\n\n\t\t\tif( url.indexOf('/uploadApi') <= -1 && url.indexOf('/licenseApi') <= -1 && url.indexOf('/api/') <= -1){\n\t\t\t\turl = '/api' + url;\n\t\t\t}\n\t\t}\n\t}\n\treturn url;\n}", "function isValidHttpUrl(string) {\n\tlet url;\n\t\n\ttry {\n\t url = new URL(string);\n\t} catch (_) {\n\t return false; \n\t}\n \n\treturn url.protocol === \"http:\" || url.protocol === \"https:\";\n}", "function CheckListenPort(port, func) {\n var s = obj.net.createServer(function (socket) { });\n obj.tcpServer = s.listen(port, function () { s.close(function () { if (func) { func(port); } }); }).on('error', function (err) {\n if (args.exactports) { console.error('ERROR: MeshCentral HTTPS web server port ' + port + ' not available.'); process.exit(); }\n else { if (port < 65535) { CheckListenPort(port + 1, func); } else { if (func) { func(0); } } }\n });\n }", "function handleRequest(request, response){\n\t//below statements are triggered (user side) when the user visits the PORT url\n\tresponse.end(\"It works. Path hit: \" + request.url);\n\n}", "static onClientUpgrade (http, server, response, socket, upgradeHead) {\n\n socket.setKeepAlive(true);\n\n PtthUtils.connectSocketToServer(server, socket);\n\n }", "function badTransition(href, type, transitionType) {\n if (httpsRedirect[href]) {\n httpsRedirect[href] = false;\n return false;\n }\n let maybeGood = (POTENTIALLY_GOOD_TRANSITIONS.indexOf(transitionType) >= 0);\n if (!type && !maybeGood) {\n return true;\n }\n return type == SERVER_REDIRECT;\n}", "function httpURLValidate(url) {\r\n\tlet urlObj = require('url').parse(url);\r\n\tlet protocols = ['http:', 'https:'];\r\n\r\n\treturn (!!~protocols.indexOf(urlObj.protocol) &&\r\n\t\t\t\t\t!!urlObj.slashes &&\r\n\t\t\t\t\t!!urlObj.host.match(/\\w+\\.{1,}\\w+/));\r\n}", "function isSamePort(protocol1, port1, protocol2, port2) {\n if (port1 === port2) {\n return true;\n } else if (protocol1 === protocol2) {\n if (protocol1 === 'http') {\n return useDefault(port1, '80') === useDefault(port2, '80');\n } else if (protocol1 === 'https') {\n return useDefault(port1, '443') === useDefault(port2, '443');\n }\n }\n return false;\n }", "function isSamePort(protocol1, port1, protocol2, port2) {\n if (port1 === port2) {\n return true;\n } else if (protocol1 === protocol2) {\n if (protocol1 === 'http') {\n return useDefault(port1, '80') === useDefault(port2, '80');\n } else if (protocol1 === 'https') {\n return useDefault(port1, '443') === useDefault(port2, '443');\n }\n }\n return false;\n }", "function isSamePort(protocol1, port1, protocol2, port2) {\n if (port1 === port2) {\n return true;\n } else if (protocol1 === protocol2) {\n if (protocol1 === 'http') {\n return useDefault(port1, '80') === useDefault(port2, '80');\n } else if (protocol1 === 'https') {\n return useDefault(port1, '443') === useDefault(port2, '443');\n }\n }\n return false;\n }", "function correctUrl(url) {\n\tvar element;\n\t// we eliminate the prefix so that the url is compatible with the requested apache format\n\tif(url.indexOf(\"https://\") > -1 || url.indexOf(\"http://\") > -1){\t\n\t\tconsole.log(\"If you include https: // or http: // in the url it will be automatically deleted\");\t\n\t\tif (url.indexOf(\"https://\") > -1) {\n\t\t\tvar url = url.replace(\"https://\", \"\");\n\t\t}\n\t\tif (url.indexOf(\"http://\") > -1) {\n\t\t\tvar url = url.replace(\"http://\", \"\");\n\t\t}\n\t}\n\t// add the suffix .local so that the url is friendly in development\n\tif(url.slice(-6) != \".local\") {\n\t\tconsole.log(\"If you do not include .local in the url it is automatically added\");\n\t\telement = url + \".local\";\n\t}else{\n\t\telement = url;\n\t}\n\tproject.url = element;\n}", "function checkHotLoader() {\n return new Promise((resolve, reject) => {\n var server = net.createServer();\n\n server.once(\"error\", (err) => {\n resolve(err.code === \"EADDRINUSE\");\n });\n\n server.once(\"listening\", () => server.close());\n server.once(\"close\", () => resolve(false));\n server.listen(5050);\n });\n}", "function rawUrlParse(strurl)\n{\n\tvar\tep = url.parse(strurl);\n\tif(rawIsSafeEntity(ep) && (null === ep.port || !rawIsSafeEntity(ep.port) || isNaN(ep.port))){\n\t\t// set default port\n\t\tif(rawIsSafeString(ep.protocol) && 'https:' === ep.protocol){\n\t\t\tep.port\t= 443;\n\t\t}else{\n\t\t\tep.port\t= 80;\n\t\t}\n\t}\n\treturn ep;\n}", "onConnectionUpgrade ( request, socket, head ) {\n\t\tthis.wss.handleUpgrade( request, socket, head, this.onConnect.bind( this ) );\n\t}", "function upgradeSocket (socket, url) {\n return new Promise((resolve, reject) => {\n let key = genKey();\n // listen for initial response from server\n socket.once('data', data => {\n console.log(`Received upgrade response:\\r\\n${data.toString()}`);\n validateDigest(key, data.toString());\n resolve();\n });\n\n // send handshake\n let upgradeRequest = assembleHandshake(url, key);\n console.log(`Send upgrade request:\\r\\n${upgradeRequest}`)\n socket.write(upgradeRequest);\n });\n}", "function localVersion() {\n return window.location.protocol == 'file:'\n }", "function url__MISMATCH__ERR_ques_(domException) /* (domException : domException) -> bool */ {\n return (domException === 21);\n}", "function do_test_uri_basic(aTest) {\n var URI;\n\n try {\n URI = gIoService.newURI(aTest.spec);\n } catch (e) {\n var url=aTest.relativeURI ? (aTest.spec +\"<\"+aTest.relativeURI) : aTest.spec;\n //do_info(\"Caught error on parse of\" + aTest.spec + \" Error: \"+e.name+\" \" + e.result);\n dump(\"\\n{\\\"url\\\":\\\"\"+ url+\"\\\", \\\"exception\\\":\\\"\"+e.name+\" \"+e.result+\"\\\"}\");\n if (aTest.fail) {\n Assert.equal(e.result, aTest.result);\n return;\n }\n do_throw(e.result);\n \n }\n\n if (aTest.relativeURI) {\n var relURI;\n\n try {\n relURI = gIoService.newURI(aTest.relativeURI, null, URI);\n } catch (e) {\n /*do_info(\n \"Caught error on Relative parse of \" +\n aTest.spec +\n \" + \" +\n aTest.relativeURI +\n \" Error: \" +\n e.result\n );*/\n var url=aTest.spec +\"<\"+aTest.relativeURI;\n //do_info(\"Caught error on parse of\" + aTest.spec + \" Error: \"+e.name+\" \" + e.result);\n dump(\"\\n{\\\"url\\\":\\\"\"+ url+\"\\\", \\\"exception\\\":\\\"\"+e.name+\" \"+e.result+\"\\\"}\");\n\n if (aTest.relativeFail) {\n Assert.equal(e.result, aTest.relativeFail);\n return;\n }\n \n do_throw(e.result);\n \n }\n URI=relURI;\n }\n\n \n // Check the various components \n try {\n do_check_property(aTest, URI, \"scheme\");\n do_check_property(aTest, URI, \"query\");\n do_check_property(aTest, URI, \"ref\");\n do_check_property(aTest, URI, \"port\");\n do_check_property(aTest, URI, \"username\");\n do_check_property(aTest, URI, \"password\");\n do_check_property(aTest, URI, \"host\");\n do_check_property(aTest, URI, \"specIgnoringRef\");\n do_check_property(aTest, URI, \"hasRef\");\n do_check_property(aTest, URI, \"prePath\");\n do_check_property(aTest, URI, \"pathQueryRef\");\n } catch (e) {\n dump(\"caught exception from components\");\n return;\n }\n}" ]
[ "0.5663019", "0.56533706", "0.5504292", "0.5396829", "0.53193516", "0.5307611", "0.52811784", "0.5259151", "0.52168", "0.519685", "0.51860756", "0.5158868", "0.51378375", "0.5119795", "0.5104709", "0.5101643", "0.5101051", "0.508431", "0.50841606", "0.5074305", "0.5047692", "0.50463104", "0.5045977", "0.5036332", "0.50191045", "0.500887", "0.49944782", "0.49838006", "0.49838006", "0.49838006", "0.49838006", "0.49838006", "0.49643266", "0.49588048", "0.49538326", "0.49381673", "0.49249408", "0.49113554", "0.49113417", "0.4910578", "0.49051026", "0.49010032", "0.4897579", "0.48974362", "0.48863614", "0.48757705", "0.48714858", "0.48684946", "0.48684946", "0.48671833", "0.48585925", "0.48561943", "0.48355675", "0.4834265", "0.48287216", "0.48282054", "0.48279703", "0.48279703", "0.48149842", "0.48057342", "0.4801919", "0.47741732", "0.47714603", "0.47562551", "0.4743236", "0.4739583", "0.47386077", "0.4734616", "0.47221604", "0.47056174", "0.46982992", "0.46931294", "0.4691271", "0.46895123", "0.46883765", "0.46870545", "0.46841326", "0.4674502", "0.46672028", "0.46589357", "0.4657685", "0.46539092", "0.46529958", "0.46410215", "0.4632739", "0.46288666", "0.4628174", "0.46273425", "0.46152088", "0.46082807", "0.46082807", "0.46082807", "0.46018726", "0.45974138", "0.45954162", "0.45890552", "0.45804712", "0.45755342", "0.4574066", "0.4573117" ]
0.507729
19
function close log page division
function closelog(){ document.getElementById("log-page").style.display='none'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cerrar() {\twindow.close(); }", "function logout()\n{\n\twindow.close();\n}", "function closePrint () {\n document.body.removeChild(this.__container__);\n}", "close() {\n\n // Pop the activity from the stack\n utils.popStackActivity();\n\n // Hide the screen\n this._screen.scrollTop(0).hide();\n\n // Hide the content behind the placeholders\n $(\"#page--info .ph-hidden-content\").hide();\n\n // Stop the placeholders animation\n this._placeholders.removeClass(\"ph-animate\").show();\n\n // Hide the delete button\n $(\"#info-delete\").hide();\n\n // Hide the info button\n $(\"#info-edit\").hide();\n\n // Show all the fields\n $(\".info-block\").show();\n\n // Delete the content of each of the fields\n $(\"#info-createdAt .info-content\").html(\"\");\n $(\"#info-updatedAt .info-content\").html(\"\");\n $(\"#info-coordinates .info-content\").html(\"\");\n $(\"#info-coordinatesAccuracy .info-content\").html(\"\");\n $(\"#info-altitude .info-content\").html(\"\");\n $(\"#info-altitudeAccuracy .info-content\").html(\"\");\n $(\"#info-type .info-content\").html(\"\");\n $(\"#info-materialType .info-content\").html(\"\");\n $(\"#info-hillPosition .info-content\").html(\"\");\n $(\"#info-water .info-content\").html(\"\");\n $(\"#info-vegetation .info-content\").html(\"\");\n $(\"#info-mitigation .info-content\").html(\"\");\n $(\"#info-mitigationsList .info-content\").html(\"\");\n $(\"#info-monitoring .info-content\").html(\"\");\n $(\"#info-monitoringList .info-content\").html(\"\");\n $(\"#info-damages .info-content\").html(\"\");\n $(\"#info-damagesList .info-content\").html(\"\");\n $(\"#info-notes .info-content\").html(\"\");\n\n // Show the image placeholder\n $(\"#info-photo-preview\").attr(\"src\", \"img/no-img-placeholder-200.png\");\n\n }", "function Close() {\n } // Close", "function closePage(){\n\tif (!currentPage){\n\t\tlog.warn(\"No curent page defined.\");\n\t\treturn null;\n\t} else {\n\t\tlog.debug(\"Closing page:\"+currentPage.id);\n\t\tif ($.isFunction(currentPage.close)){\n\t\t\treturn currentPage.close();\n\t\t}\n\t}\n}", "'click #tokens-close'(event, instance) {\n Session.set(\"area\", \"main\");\n }", "'click #tokens-close'(event, instance) {\n Session.set(\"area\", \"main\");\n }", "function close(e) {\n\t\tvar url = e.target.url;\n\n\t\tif (url) {\n\t\t\tclearTabData(url);\n\t\t}\n\t}", "function hide() {\n if (isLogOpen === false) {\n return;\n }\n\n $modalContainer.html('');\n $modalContainer.scrollTop();\n $modalContainer.hide();\n scrollBar.load();\n\n isLogOpen = false;\n}", "handleWindowClose() {\n\t\tthis.runFinalReport()\n\t}", "function close() {\n\t\t$('#PortableCSSPad-container').addClass('PortableCSSPad-pad-disabled');\n\t\t$(window).off('beforeunload', windowBeforeUnload);\n\t}", "function CerrarVentana(){\r\n\twindow.close();\r\n}", "function setUnloadStep3Viewer() {\r\n\t$(window).unload( function () { imagePopup.close(); } );\r\n}", "function actCloseDICOM(){\n $('.obj-opendicom').toggle();\n pageScroll('auto');\n\n// $('main').css('overflow', 'auto').css('height', 'auto');\n// toggleFullScreen();\n }", "_cleanup() {\n this._page.close();\n this._phantom.exit();\n }", "function exit(){\n window.close();\n}", "function exit() {\r\n page_reset();\r\n}", "function handleClose() {\n if (currentPage == 1) {\n $.app_config_window.showWarning().done(function() {\n continueClose();\n });\n } else {\n continueClose();\n }\n}", "function closeLpage (event) {\n\t\t\tif (event.target.className == 'background' || event.target.id == 'cancel') {\n\t\t\t\telements.hint.className = 'background hidden';\n\t\t\t}\t\t\n\t\t}", "function welcomeExit() {\n window.close()\n}", "function handleLogOutAction(event) {\n event.preventDefault();\n\n // Remove userId and Email from footer\n // Can't save to session or anything here\n $($pt.landPage.session.id).text(\"\");\n $($pt.landPage.session.user).text(\"\");\n $($pt.landPage.session.email).text(\"\");\n $($pt.landPage.session.notify).removeAttr(\"data-badge\");\n $(document).attr(\"title\", \"PhotoThief\");\n $(\"#favicon\").attr(\"href\", \"favicon.ico\");\n\n // Hide user info\n $($pt.landPage.session.info).addClass(\"hidden\").removeClass(\"show\");\n // Hide Upload button\n $($pt.landPage.action.upload).addClass(\"hidden\").removeClass(\"show\");\n // Hide Demand button\n $($pt.landPage.action.demand).addClass(\"hidden\").removeClass(\"show\");\n // Show signup button\n $($pt.landPage.action.signup).addClass(\"show\").removeClass(\"hidden\");\n // Show slogan\n $($pt.landPage.section.slogan).addClass(\"show\").removeClass(\"hidden\");\n\n // Toggle the login Button to say logout\n $($pt.landPage.action.icon).text(\"person\");\n $($pt.landPage.action.text).text(\"Login\");\n $($pt.landPage.action.logout).addClass(($pt.landPage.action.login).substr(1));\n $($pt.landPage.action.logout).removeClass(($pt.landPage.action.logout).substr(1));\n\n // Remove confirmation\n window.onbeforeunload = null;\n\n // TODO: Anything else that we need to handle go here\n\n // Stop link follow\n return false;\n }", "_close() {\n this.attachmentViewer.close();\n }", "function doClosePage() { /* Close PAGE ABOUT AND CONTACT */\r\n\tdocument.getElementById(\"aboutc\").style.display = 'none';\r\n}", "function navCloseHandler() {\n if (!widthFlg) {\n\n }\n }", "function closeSession() {\n var domainParts = document.location.hostname.split('.');\n var pathParts = document.location.pathname.split('/');\n var domain, path;\n\n for(var d=0; d<domainParts.length; d++) {\n domain = domainParts.slice(d).join('.');\n for(var p=0; p<pathParts.length; p++) {\n path = pathParts.slice(0, pathParts.length - p).join('/');\n customCookies.removeItem(previewCookieKey, path + '/', domain.indexOf('.') > -1 ? domain : '');\n customCookies.removeItem(previewCookieKey, path, domain.indexOf('.') > -1 ? domain : '');\n }\n }\n }", "close() {\r\n if (this.widget_wizard != null) this.widget_wizard.close()\r\n // close all the widget of the page\r\n for (var id in this.widget_objects) {\r\n var widget_object = this.widget_objects[id]\r\n if(typeof widget_object.close === 'function')\r\n widget_object.close()\r\n }\r\n }", "function logOut() {\r\n $('#disp').css('display', 'none')\r\n $('#loggs').css('display', 'block')\r\n $('#logger').css('display', 'none')\r\n $('#myNav').css('width', '0%')\r\n}", "function logout()\n {\n\n }", "function onUnload() {\r\n log('onUnload');\r\n stop();\r\n }", "function CloseMWETB() {\r\n\t\tvar close=document.getElementById(\"final_wrapper\").removeChild(document.getElementById(\"PSMWE_div\"));\r\n}", "function logout() {\n\n }", "function window_close() {\n window.close()\n}", "function exit() {\n window.close();\n}", "w3_close() {\n\t\tthis.mySidenav.style.display = \"none\";\n\t\tthis.overlayBg.style.display = \"none\";\n\t}", "function exitPrinter() {\n\t$('#header').show();\n\t$('#content').show();\n\t$('#footer').show();\n\t$('#printerFriendly').remove();\n}", "function fnClose(){\n\n\twindow.close();\n\n}", "function cerrar(){\n\ttry {\n\t\twindow.close();\n\t} catch(e){\n\t\tjsTrace(\"No se pudo cerrar la ventana\\n\"+e);\n\t}\n}", "function onUnload() {\r\n \tcontrols.log('onUnload');\r\n stop();\r\n }", "function close()\n{\n closeFrame();\n} // function close", "function fVolver(){\n window.close();\n }", "onClose() {\n\t\t}", "function logout() {\n if (!connectionFailure) {\n dialogOff();\n }\n if (popup) {\n $.get(\"/Rhythmyx/logout\", function () {\n window.close();\n });\n } else {\n top.document.location.href = '/Rhythmyx/logout';\n }\n }", "function logout(){\r\n window.location.href = \"../Login Page/login.html\";\r\n ls.kill();\r\n}", "function closeWindow(event) {\n var id = String(current.id);\n var url = \"src/php/index.php?method=remove\";\n current.win.parentNode.removeChild(current.win);\n //current.ajax.post(url, id, closed);\n\n }", "function Cerrar()\n{\n self.close()\n}", "function _close(){\n $.webview.url = \"\";\n $.win.close();\n}", "function panelMetaDataClose(){\n\tpanelView = '';\n\tpanelShow({'height' : '10px'});\n\t$('panelFrame').src='index.php?n';\n}", "function replaceInfo() {\n document.remove(log)\n}", "function iabClose(event) {\n var Session = JSON.parse(localStorage[config.data[0].storage_key+\"_Session\"]);\n var Store = JSON.parse(localStorage[config.data[0].storage_key+\"_STORE\"]);\n var Order = JSON.parse(localStorage[config.data[0].storage_key+\"_Order\"]);\n localStorage.clear();\n localStorage[config.data[0].storage_key+\"_Session\"] = JSON.stringyfy(Session);\n localStorage[config.data[0].storage_key+\"_Order\"] = JSON.stringyfy(Order);\n localStorage[config.data[0].storage_key+\"_STORE\"] = JSON.stringyfy(Store);\n visitHomePage();\n iabRef.removeEventListener('loadstart', iabLoadStart);\n iabRef.removeEventListener('loadstop', iabLoadStop);\n iabRef.removeEventListener('exit', iabClose);\n}", "function exit() {\n stopDownloading();\n setData = {};\n downloadedPhotos = {};\n window.close();\n}", "function closeWindow() {\n\t\t\t\tinfoWin.close();\n\t\t\t}", "function closeCurrentTab(){\n\t//window.close();\n}", "function ForceClose() {\r\n}", "function logout_( proj) {\n\n\tif ( confirm( QST_CLOSE_ ) ) {\n\t\tgetRef();\n\t\tvar xvers\t= \"&v=\" + version_;\n\t\tvar xsess = \"&sess=\" + session_;\n\t\tvar xaction = \"?action=0&ok=0&project=\" + proj + xsess + xvers;\n\n\t\t// Prepare a reload system\n\t\tdocument.getElementById(\"reload_\").value = \"1\";\n\t\tdocument.getElementById(\"reload_\").ref = \"plus.php\" + xaction;\n\t\treload_();\n\t}\n}", "function clearEventSpecificInfo() {\n\twindow.location.hash = '';\n\tdocument.title = 'Events around you - Furlango';\n\tif (currentInfoWindow) { // defined in watodoo.js\n\t\tcurrentInfoWindow.close();\n\t}\n}", "function parClose(){\n if (typeof parent.delSubmitSafe == 'function')\n parent.delSubmitSafe();\n if (typeof top.delSubmitSafe == 'function')\n top.delSubmitSafe();\n if (par!=null)\n par.style.display='none';\n}", "function close() {\n\n let $loadingScreenContainer = $('.loadingScreenContainer');\n\n $loadingScreenContainer.trigger('close');\n\n }", "function endChange()\n{\n window.close();\n}", "function closeSlideOut(){\n\t\t\t\t//$(jqe(lpChatID_lpChatSlideOutContainer)).remove();\n\t\t\t\tsendPostMessage({\"lpEmbChatWiz\": \"LPNVPF\", \"CMD\" : \"CONTROL\", \"value\" : \"UPDATE_DRAG_AREA_HIDE_PCI\"}); //notify parent to increase drag area\n\t\t\t\t$(jqe(lpChatID_lpChatSlideOutContainer)).remove();\n\t\t\t}", "function close() {\n fadeOutEffect(DOMstrings.divCalQ, remove);\n }", "function close_logIn_window() {\n document.getElementsByClassName(\"log\")[0].classList.add('hide');\n document.getElementById(\"register_fieldset\").style.opacity = \"0\";\n document.getElementById(\"register_fieldset\").style.top = \"150%\";\n document.getElementById(\"log_fieldset\").style.opacity = \"1\";\n document.getElementById(\"log_fieldset\").style.top = \"50%\";\n}", "function lemurlog_OnTabRemoved_20(event)\n{\n if(lemurlog_g_enable === false)\n {\n return;\n }\n var time = new Date().getTime();\n var id = event.target.linkedBrowser.parentNode.id;\n lemurlog_DoWriteLogFile(lemurlog_LOG_FILE, \"RmTab\\t\" + time + \"\\t\" + id + \"\\n\");\n}", "function closeInClose() {\n if ($('#header-account2')\n .hasClass('skip-active') != true) {\n animateCloseWindow('login', true, false);\n animateCloseWindow('register', true, false);\n animateCloseWindow('confirmmsg', true, false);\n }\n }", "function closeSched(f) {\n f.submit();\n window.close();\n}", "close() {\n if (phantom_instance != null) {\n phantom_instance.exit();\n phantom_instance = null;\n }\n }", "function closeOutputs() {\r\n payment_output.close();\r\n lag_output.close();\t\r\n HTML_output.close();\r\n patchesOutput.close();\r\n}", "function win_close() {\n if (jQuery(\"#SocialToolbarActiveWindow\").length > 0) { \n jQuery(\"#SocialToolbarActiveWindow\").fadeOut(function(){\n jQuery('#SocialToolbarActiveWindow').remove();\n closeShare();\n });\n \n }\n }", "function close(){\n SplashScreen.hide();\n}", "function Close_Instruction() {\r\n}", "closeUp() {\r\n\t\t$('.report').slideUp(); \r\n\t}", "Close() {\n\n }", "closeWindow() {\r\n\r\n }", "function closeInfographic(obj,e){\n closeBtnClicked = true;\n prevClickedDiv = null;\n removeExpandStyle(obj.parentElement,obj.parentElement.id);\n if(screenMedium.matches)\n document.getElementById('container-sliding-panels').style.height = mediumDeviceInfoDivHeight; \n else\n document.getElementById('container-sliding-panels').style.height = largeDeviceInfoDivHeight; \n removeButtonStyle(document.getElementById('top-menu-sliding-panel'));\n removeButtonStyle(document.getElementById('bottom-menu-sliding-panel'));\n}", "function onClose() {\r\n window.close();\r\n}", "function logOut(){\n checkConnection();\n $(\".popover-backdrop.backdrop-in\").css(\"visibility\",\"hidden\");\n $(\".popover.modal-in\").css(\"display\",\"none\"); \n window.localStorage.removeItem(\"session_uid\"); \n window.localStorage.removeItem(\"session_fname\"); \n window.localStorage.removeItem(\"session_lname\"); \n window.localStorage.removeItem(\"session_uname\");\n window.localStorage.removeItem(\"session_ulevel\");\n window.localStorage.removeItem(\"session_department\");\n window.localStorage.removeItem(\"session_mobile\");\n window.localStorage.removeItem(\"session_email\"); \n window.localStorage.removeItem(\"session_loc\");\n window.localStorage.removeItem(\"session_dp\"); \n mainView.router.navigate('/');\n //app.panel.close();\n //app.panel.destroy(); \n}", "function schedulingClose() {\n $('.scheduling-queue').fadeOut();\n bodyScroll();\n return;\n}", "function cropperClose() {\n\t$('mb_close_link').addEvent('click', function() {\n\t\tif($('yt-CropperFrame')) $('yt-CropperFrame').remove();\n\t\tif($('mb_Title')) $('mb_Title').remove();\n\t\tif ($('mb_Error')) $('mb_Error').remove();\n\t\tif ($('mb_contents')) $('mb_contents').removeClass('mb_contents');\n\t\tif($('mb_header')) $('mb_header').removeClass('yt-Panel-Primary');\n\t});\n}", "function handleClose() {\n setOpen(false)\n }", "close() {\n window.http.xmlHtpRequest.abort();\n }", "function displayDetailClose()\n{\n RMPApplication.debug(\"begin displayDetailClose\");\n c_debug(dbug.detail, \"=> displayDetailClose\");\n id_search_filters.setVisible(true);\n id_search_results.setVisible(true);\n id_ticket_details.setVisible(false);\n $(\"#id_number_detail\").val (\"\");\n $(\"#id_correlation_id_detail\").val (\"\");\n $(\"#id_caller_detail\").val (\"\");\n $(\"#id_contact_detail\").val (\"\"); \n $(\"#id_company_detail\").val (\"\");\n $(\"#id_country_detail\").val (\"\");\n $(\"#id_affiliate_detail\").val (\"\");\n $(\"#id_location_detail\").val (\"\");\n $(\"#id_city_detail\").val (\"\");\n $(\"#id_opened_detail\").val (\"\");\n $(\"#id_priority_detail\").val (\"\");\n $(\"#id_state_detail\").val (\"\");\n $(\"#id_closed_detail\").val (\"\");\n $(\"#id_category_detail\").val (\"\");\n $(\"#id_product_type_detail\").val (\"\");\n $(\"#id_problem_type_detail\").val (\"\");\n $(\"#id_short_description_detail\").val (\"\");\n $(\"#id_description_detail\").val (\"\");\n $(\"#id_attachment\").html (\"\");\n clearTaskDataTable();\n $(\"#id_rowProgression\").hide();\n RMPApplication.debug(\"end displayDetailClose\");\n}", "onExitDOM() {}", "function closeDetails() {\n\n\tif (!Alloy.Globals.detailsWindow) {\n\t\treturn;\n\t}\n\n\t$.tab.closeWindow(Alloy.Globals.detailsWindow);\n\n\tAlloy.Globals.detailsWindow = null;\n}", "function HandleClose()\r\n{\r\n if (window.event.clientX > 500 && window.event.clientY < -108)\r\n {\r\n CallPageMethod()\r\n }\r\n}", "function handleCloseClick(){\n handleClose()\n }", "function closeMapWindows() {\n\t\t\t if (click_infowindow!=undefined) click_infowindow.hide();\n \t\t\tif (delete_infowindow!=undefined) delete_infowindow.hide();\n if (edit_metadata!=undefined) edit_metadata.hide();\n\t\t\t}", "function pageClose() {\n if( $.CurrentDialog){\n BJUI.dialog('closeCurrent');\n }else{\n BJUI.navtab('closeCurrentTab');\n }\n}", "async close() {\n if (!this.browser) return;\n\n this.log.debug('Page closing', this.meta);\n\n /* istanbul ignore next: errors race here when the browser closes */\n await this.browser.send('Target.closeTarget', { targetId: this.targetId })\n .catch(error => this.log.debug(error, this.meta));\n }", "function CloseInfo(){\n // close infoo window if already open\n if (infoWindow) {\n infoWindow.close();\n }\n}", "function lemurlog_OnTabRemoved_15(event)\n{\n if (event.relatedNode !== gBrowser.mPanelContainer)\n {\n return; //Could be anywhere in the DOM (unless bubbling is caught at the interface?)\n }\n if(lemurlog_g_enable === false)\n {\n return;\n }\n if (event.target.localName == \"vbox\")// Firefox\n { \n var time = new Date().getTime();\n\tvar id = browser.parentNode.id;\n lemurlog_DoWriteLogFile(lemurlog_LOG_FILE, \"RmTab\\t\" + time + \"\\t\" + id + \"\\n\");\n }\n}", "function overlayClose() {\t\n\tdocument.getElementById('blocker').style.display = 'none';\n\tdocument.getElementById('overlay').style.display = 'none';\n\t\n\tvar url = document.getElementById('overlay_url')\n\tif (url) {\n\t\turl.style.display = 'none';\n\t}\n\tvar pdf = document.getElementById('report_pdf')\n\tif (pdf) {\n\t\tpdf.style.display = 'none';\n\t}\n\t\n\treturn false;\n}", "function bug_report_stop(){\n if(panel!=null){\n panel.dispose();//CLose this webview.\n panel = null;//Reset the panel.\n let terminal = this.get_terminal(\"bug_report\");//Get or Create a terminal\n terminal.show(true);//Show commands in the terminal\n terminal.dispose();//Dispose this terminal to stop\n }\n}", "function be_logout(page) {\n ask({cmd:'be_logout',page:page},_be_logout,'jo?');\n}", "function closeStore() {\n $('#store').hide();\n IN_STORE = false;\n // go back to level page\n gwhStore.hide();\n gwhStoreItems.hide();\n $('#levelScreen').show();\n createEnemies(ENEMY_SIZE);\n createBunkers();\n if (!PROJECTILES_FALLING) {\n\tcr_prj_id = setInterval(function() {\n createProjectile();\n }, PROJECTILE_SPAWN_RATE[CUR_LEVEL]);\n\t PROJECTILES_FALLING = true;\n }\n setTimeout(function() {\n $('#levelScreen').hide();\n gwhGame.show();\n GAME_PAUSED = false;\n }, 7000)\n}", "close() {\n\t\tthis._killCheckPeriod();\n\t}", "_logout() {\n this._closeMenu();\n AuthActions.logout();\n }", "function shutdown() {\n console.debug(\"Shutdown pano viewer\");\n MasterService.shutdownLiveActivityGroupByName(ActivityGroups.PanoViewer);\n }", "function logoutUser() {\n\tsetLoadImage('mainContainer', '40px', '510px');\n\tsendHTMLAjaxRequest(false, 'getData/logOutUser.html', null, displayLogingPage, null);\n}", "function handleClose() {\n navigate(\"/EscolherCondominio\"); // vai pra tela de condominios\n setDialog(false);\n }", "function otkazivanjeKupovine() {\r\n window.alert(\"Doviđenja\");\r\n window.close();\r\n}" ]
[ "0.65679157", "0.6518292", "0.6301026", "0.6241632", "0.6193293", "0.61474246", "0.6139693", "0.6139693", "0.6129852", "0.6113695", "0.607087", "0.6059503", "0.60426104", "0.6005438", "0.5998574", "0.597252", "0.5968872", "0.5968258", "0.5962123", "0.59604", "0.59448415", "0.5906285", "0.58921814", "0.58828604", "0.58789283", "0.58538985", "0.5845367", "0.58410454", "0.5838193", "0.5837163", "0.5831588", "0.58296734", "0.5828104", "0.5822206", "0.5812682", "0.5804514", "0.58005184", "0.57980037", "0.5795788", "0.57914025", "0.5789565", "0.5786324", "0.57775354", "0.57719517", "0.5769665", "0.57600015", "0.57595325", "0.5751969", "0.57468706", "0.57463485", "0.5745072", "0.57369053", "0.57267106", "0.57243776", "0.57176024", "0.57164836", "0.57145965", "0.57124394", "0.5689775", "0.56879354", "0.5679063", "0.5675468", "0.5668054", "0.56661326", "0.5665997", "0.5663829", "0.5652054", "0.5650024", "0.5640878", "0.5637436", "0.563682", "0.5634136", "0.5632916", "0.56324625", "0.5630491", "0.5630465", "0.56293046", "0.56273645", "0.5622321", "0.5620399", "0.56128854", "0.5607303", "0.5606632", "0.56038857", "0.56008947", "0.5595307", "0.5592598", "0.5588182", "0.558815", "0.55880153", "0.5580914", "0.55759734", "0.5572971", "0.55727977", "0.5571541", "0.55700904", "0.55696744", "0.55673206", "0.55659336", "0.5559386" ]
0.77408665
0
function close register division
function closeRegister(){ document.getElementById("register-page").style.display='none'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "subReg(register) {\n var a = regA[0];\n a -= register[0];\n regA[0] = a;\n // All flags are updated\n regF[0] = F_OP | ((a < 0) ? F_CARRY : 0) | (regA[0] ? 0 : F_ZERO);\n if ((regA[0] ^ register[0] ^ a) & 0x10) {\n regF[0] |= F_HCARRY;\n }\n return 1\n }", "subcReg(register) {\n var sum = regA[0] - register[0] - ((regF[0] & F_CARRY) ? 1 : 0);\n regA[0] = sum;\n var flags = F_OP | (regA[0] ? 0 : F_ZERO) | ((sum < 0) ? F_CARRY : 0);\n if ((regA[0] ^ register[0] ^ sum) & 0x10) regF[0] |= F_HCARRY;\n return 4;\n }", "decReg16(register) {\n register[0]--;\n return 4;\n }", "RES_0_A(){ this.register_A &= ~(0x1 << 0); return 8; }", "incReg16(register) {\n register[0]++;\n return 4;\n }", "resReg(bitmask, register) {\n register[0] &= ~bitmask;\n return 8;\n }", "div(a, b) {\n\t\tthis.registers[a] = Math.trunc(this.get(a) / this.get(b));\n\t}", "return() {\n this.setPc(this.registers[$ra]);\n }", "ldRegVal(register) {\n register[0] = MMU.rb(regPC[0]);\n regPC[0]++;\n return 8;\n }", "slaReg(register) {\n var co = register[0] & 0x80 ? F_CARRY : 0;\n register[0] <<= 1;\n regF[0] = register[0] ? 0 : F_ZERO;\n regF[0] = (regF[0] & ~F_CARRY) + co;\n return 8;\n }", "function PUSHRSP(reg) {\n reg = reg|0\n ebp = ebp|0 - 1;\n HU32[(ebp<<2)>>2] = reg;\n return;\n }", "decReg(register) {\n register[0]--;\n // Set the zero flag if 0, half-carry if decremented to 0b00001111, and\n // the subtract flag to true\n regF[0] = (register[0] ? 0 : F_ZERO) |\n (((register[0] & 0xF) === 0xF) ? F_HCARRY : 0) |\n F_OP;\n return 4;\n }", "function jr() {\r\n src1 = getRegisterVal(\"registerOne\");\r\n incrementPc(src1);\r\n}", "sraReg(register) {\n var ci = register[0] & 0x80;\n var co = register[0] & 1 ? F_CARRY : 0;\n register[0] = (register[0] >> 1) + ci;\n regF[0] = (register[0]) ? 0 : F_ZERO;\n regF[0] = (regF[0] & ~F_CARRY) + co;\n return 8;\n }", "function lw() {\r\n var src1 = getRegisterVal(\"registerOne\");\r\n var src2 = getRegisterVal(\"registerTwo\");\r\n var offset = parseInt($(\"#immediate\").val());\r\n src2 = memory[src1 + offset];\r\n setRegisterVal(\"registerTwo\", src2);\r\n\r\n}", "ldReg(registerTo, registerFrom) {\n registerTo[0] = registerFrom[0];\n return 4;\n }", "function bne() {\r\n var src1 = getRegisterVal(\"registerOne\");\r\n var src2 = getRegisterVal(\"registerTwo\");\r\n var offset = parseInt($(\"#immediate\").val());\r\n if (src1 != src2) {\r\n incrementPc(offset);\r\n }\r\n}", "function clearingDiv() {\n this.register();\n}", "orReg(register) {\n regA[0] |= register[0];\n regF[0] = regA[0] ? 0 : F_ZERO;\n return 4;\n }", "_endRender() {\n this._allowRegisterSegment = false;\n }", "addReg(register) {\n var a = regA[0];\n regA[0] += register[0];\n // TODO: make sure all these '< a' checks actually make sense..\n regF[0] = ((regA[0] < a) ? 0x10 : 0) | (regA[0] ? 0 : F_ZERO);\n if ((regA[0] ^ register[0] ^ a) & 0x10) regF[0] |= F_HCARRY;\n return 4;\n }", "function gen_op_vfp_divd()\n{\n gen_opc_ptr.push({func:op_vfp_divd});\n}", "set register_HL(_v){ this.register_H = _v >> BITS_ADDRESS; this.register_L = _v & ADDRESS_MASK; }", "rrcReg(register) {\n var ci = register[0] & 1 ? 0x80 : 0;\n var co = register[0] & 1 ? F_CARRY : 0;\n register[0] = (register[0] >> 1) + ci;\n regF[0] = (register[0]) ? 0 : F_ZERO;\n regF[0] = (regF[0] & ~F_CARRY) + co;\n return 8;\n }", "function sw() {\r\n var src1 = getRegisterVal(\"registerOne\");\r\n var src2 = getRegisterVal(\"registerTwo\");\r\n var offset = parseInt($(\"#immediate\").val());\r\n var loc = src1 + offset;\r\n memory[loc] = src2;\r\n $(\"#m\" + loc).html(src2);\r\n}", "function gen_op_sdivl_T0_T1()\n{\n gen_opc_ptr.push({func:op_sdivl_T0_T1});\n}", "get _register() { return this.__register; }", "andReg(register) {\n regA[0] &= register[0];\n regF[0] = regA[0] ? 0 : F_ZERO;\n return 4;\n }", "function gen_op_vfp_divs()\n{\n gen_opc_ptr.push({func:op_vfp_divs});\n}", "ldReg16Val(register) {\n register[0] = MMU.rw(regPC[0]);\n regPC[0] += 2;\n return 12;\n }", "ldRegMem(register) {\n register[0] = MMU.rb(regHL[0]);\n return 8;\n }", "function EntryLoRegister() { // ./common/cpu.js:72\n this.PFN = 0; // ./common/cpu.js:73\n this.C = 0; // ./common/cpu.js:74\n this.D = 0; // ./common/cpu.js:75\n this.V = 0; // ./common/cpu.js:76\n this.G = 0; // ./common/cpu.js:77\n // ./common/cpu.js:78\n this.asUInt32 = function() // ./common/cpu.js:79\n { // ./common/cpu.js:80\n return (this.G + (this.V << 1) + (this.D << 2) + (this.C << 3) + (this.PFN << 6)); // ./common/cpu.js:81\n } // ./common/cpu.js:82\n // ./common/cpu.js:83\n this.putUInt32 = function(val) // ./common/cpu.js:84\n { // ./common/cpu.js:85\n this.G = val & 0x1; // ./common/cpu.js:86\n this.V = (val >>> 1) & 0x1; // ./common/cpu.js:87\n this.D = (val >>> 2) & 0x1; // ./common/cpu.js:88\n this.C = (val >>> 3) & 0x7; // ./common/cpu.js:89\n this.PFN = (val >>> 6) & 0xfffff; // ./common/cpu.js:90\n } // ./common/cpu.js:91\n} // ./common/cpu.js:92", "function Close_Instruction() {\r\n}", "function gen_op_udivl_T0_T1()\n{\n gen_opc_ptr.push({func:op_udivl_T0_T1});\n}", "get register_HL(){ return ((this.register_H << 0x8) | this.register_L); }", "function safeRegister() {\n exports.format.register();\n exports.regex.register();\n }", "reset() {\n this.regs = new z80_base_1.RegisterSet();\n }", "function FreeSym() {\r\n}", "function registerClose(subchainaddr) {\n logger.info(\"registerClose\", subchainaddr);\n sendtx(baseaddr, subchainaddr, '0', '0x69f3576f');\n}", "function WiredRegister() { // ./common/cpu.js:163\n this.Wired = 0; // ./common/cpu.js:164\n // ./common/cpu.js:165\n this.asUInt32 = function() // ./common/cpu.js:166\n { // ./common/cpu.js:167\n return this.Wired; // ./common/cpu.js:168\n } // ./common/cpu.js:169\n // ./common/cpu.js:170\n this.putUInt32 = function(val) // ./common/cpu.js:171\n { // ./common/cpu.js:172\n this.Wired = val & 0xf; // ./common/cpu.js:173\n } // ./common/cpu.js:174\n} // ./common/cpu.js:175", "xorReg(register) {\n regA[0] ^= register[0];\n regF[0] = regA[0] ? 0 : F_ZERO;\n return 4;\n }", "compileSingleTokenToRegister(opts, result) {\nlet program = this._program;\nresult.dataSize = 1;\nif (opts.identifier && opts.identifier.getType) {\nthis.setLastRecordType(opts.identifier.getType().type);\n}\nif (opts.expression.tokens[0].cls === t.TOKEN_NUMBER) {\nprogram.addCommand($.CMD_SET, $.T_NUM_L, this._scope.getStackOffset(), $.T_NUM_C, opts.expression.tokens[0].value);\nhelper.setReg(this._program, opts.reg, $.T_NUM_G, $.REG_STACK);\nhelper.addToReg(this._program, opts.reg, $.T_NUM_C, this._scope.getStackOffset());\n} else if (opts.identifier === null) {\nlet token = opts.expression.tokens[0];\nthrow errors.createError(err.UNDEFINED_IDENTIFIER, token, 'Undefined identifier \"' + token.lexeme + '\".');\n} else if (opts.identifier instanceof Proc) {\nthis._compiler.getUseInfo().setUseProc(opts.identifier.getName(), opts.identifier); // Set the proc as used...\nhelper.setReg(this._program, opts.reg, $.T_NUM_C, opts.identifier.getEntryPoint() - 1);\nresult.type = t.LEXEME_PROC;\n} else {\nif (opts.identifier.getWithOffset() !== null) {\nhelper.setReg(this._program, $.REG_PTR, $.T_NUM_L, opts.identifier.getWithOffset());\nif (opts.identifier.getType().type === t.LEXEME_PROC) {\nthis._lastProcField = opts.identifier.getProc();\nif (opts.selfPointerStackOffset !== false) {\n// It's a method to call then save the self pointer on the stack!\nhelper.saveSelfPointerToLocal(program, opts.selfPointerStackOffset, opts.reg);\n}\n}\nif (opts.reg === $.REG_PTR) {\nprogram.addCommand(\n$.CMD_ADD, $.T_NUM_G, $.REG_PTR, $.T_NUM_C, opts.identifier.getOffset()\n);\n} else {\nprogram.addCommand(\n$.CMD_ADD, $.T_NUM_G, $.REG_PTR, $.T_NUM_C, opts.identifier.getOffset(),\n$.CMD_SET, $.T_NUM_G, opts.reg, $.T_NUM_G, $.REG_PTR\n);\n}\n} else if (opts.identifier.getPointer() && (opts.identifier.getType().type === t.LEXEME_STRING)) {\nhelper.setReg(this._program, $.REG_PTR, $.T_NUM_C, opts.identifier.getOffset());\n// If it's a \"with\" field then the offset is relative to the pointer on the stack not to the stack register itself!\nif (!opts.identifier.getGlobal() && (opts.identifier.getWithOffset() === null)) {\nhelper.addToReg(this._program, $.REG_PTR, $.T_NUM_G, $.REG_STACK);\n}\nprogram.addCommand($.CMD_SET, $.T_NUM_G, opts.reg, $.T_NUM_P, 0);\n} else {\nresult.dataSize = opts.identifier.getTotalSize();\nhelper.setReg(this._program, opts.reg, $.T_NUM_C, opts.identifier.getOffset());\nif (opts.identifier.getWithOffset() === null) {\nif (opts.identifier.getPointer() && !opts.forWriting && (opts.identifier.getType().type !== t.LEXEME_NUMBER)) {\nif (!opts.identifier.getGlobal()) {\nhelper.addToReg(this._program, opts.reg, $.T_NUM_G, $.REG_STACK);\n}\nprogram.addCommand(\n$.CMD_SET, $.T_NUM_G, $.REG_PTR, $.T_NUM_G, opts.reg,\n$.CMD_SET, $.T_NUM_G, opts.reg, $.T_NUM_P, 0\n);\n} else if (!opts.identifier.getGlobal()) {\nhelper.addToReg(this._program, opts.reg, $.T_NUM_G, $.REG_STACK);\n}\n}\n}\nresult.type = opts.identifier;\n}\nif (opts.identifier && opts.identifier.getArraySize && opts.identifier.getArraySize()) {\nresult.fullArrayAddress = false;\n}\nreturn result;\n}", "ldMemReg(register) {\n MMU.wb(regHL[0], register[0]);\n return 8;\n }", "function EntryHiRegister() { // ./common/cpu.js:184\n this.VPN2 = 0; // ./common/cpu.js:185\n this.ASID = 0; // ./common/cpu.js:186\n // ./common/cpu.js:187\n this.asUInt32 = function() { // ./common/cpu.js:188\n return (((this.VPN2 << 13) + this.ASID) >>> 0); // ./common/cpu.js:189\n } // ./common/cpu.js:190\n // ./common/cpu.js:191\n this.putUInt32 = function(val) { // ./common/cpu.js:192\n this.ASID = val & 0xff; // ./common/cpu.js:193\n this.VPN2 = (val >>> 13) & 0x7ffff; // ./common/cpu.js:194\n } // ./common/cpu.js:195\n} // ./common/cpu.js:196", "function divevent(){\r\n\tdivision();\r\n\tcounter();\r\n\tcheckForm();\r\n}", "cpReg(register) {\n var i = regA[0];\n i -= register[0];\n // TODO: does this need an op flag?\n regF[0] = F_OP | ((i < 0) ? F_CARRY : 0);\n i &= 0xFF;\n if (!i) regF[0] |= F_ZERO;\n if ((regA[0] ^ register[0] ^ i) & 0x10) regF[0] |= F_HCARRY;\n return 4;\n }", "function sipUnRegister() {\n if (oSipStack) {\n oSipStack.stop(); // shutdown all sessions\n }\n }", "function CauseRegister() // ./common/cpu.js:261\n{ // ./common/cpu.js:262\n this.BD = 0; // ./common/cpu.js:263\n this.CE = 0; // ./common/cpu.js:264\n this.IV = 0; // ./common/cpu.js:265\n this.WP = 0; // ./common/cpu.js:266\n this.IP1 = 0; // ./common/cpu.js:267\n this.IP0 = 0; // ./common/cpu.js:268\n this.EXC = 0; // ./common/cpu.js:269\n // ./common/cpu.js:270\n this.asUInt32 = function() { // ./common/cpu.js:271\n return ((this.EXC << 2) + (this.IP0 << 8) + (this.IP1 << 10) + (this.WP << 22) + (this.IV << 23) + (this.CE << 28) + (this.BD * Math.pow(2,31))); // ./common/cpu.js:272\n } // ./common/cpu.js:273\n // ./common/cpu.js:274\n this.putUInt32 = function(val) { // ./common/cpu.js:275\n this.BD = (val >>> 31); // ./common/cpu.js:276\n this.CE = (val >>> 28) & 0x3; // ./common/cpu.js:277\n this.IV = (val >>> 23) & 0x1; // ./common/cpu.js:278\n this.WP = (val >>> 22) & 0x1; // ./common/cpu.js:279\n this.IP1 = (val >>> 10) & 0x3f; // ./common/cpu.js:280\n this.IP0 = (val >>> 8) & 0x3; // ./common/cpu.js:281\n this.EXC = (val >>> 2) & 0x1f; // ./common/cpu.js:282\n } // ./common/cpu.js:283\n} // ./common/cpu.js:284", "singleCapture(){\n\t\tthis._writeRegisters(REGISTRY.SYSRANGE_START, 0x02);\n\n this._readRegisters(REGISTRY.RESULT_RANGE_STATUS, 16, (err, data) => {\n var _dis = (data.readInt16BE(8) + 10);\n this.emit('distance', _dis);\n });\n\t}", "get register_A(){ return this.register_8bits[this.register_bit_A]; }", "function freeReg(reg, result) {\n if (!Array.isArray(reg)) {\n reg = [reg];\n }\n var i;\n for (i = 0; i < reg.length; i++) {\n if (language.getRegType(reg[i]) === 'p') {\n freePosRegList.push(reg[i]);\n } else {\n freeRegList.push(reg[i]);\n }\n }\n if (result && reg.length) {\n result.epilogue.push('// free ' + reg.join(','));\n }\n }", "LDH_A_C(op){ op.register_A = op.readMemory(0xFF00 | op.register_C); return 8; }", "addRegister(register) {\n if (!this.isMergeable(register)) {\n throw new Error('Can\\'t merge discontinuous registers in one reading operation');\n }\n this._registers.push(register);\n }", "setReg(bitmask, register) {\n register[0] |= bitmask;\n return 8;\n }", "function decodeRegister(val) {\r\n\tif (val >= 0 || val < 32)\r\n\t\treturn reg[val];\r\n\telse\r\n\t\treturn 'invalid';\r\n}", "SUBn() {\n var a = regA[0];\n var m = MMU.rb(regPC[0]);\n a -= m;\n regPC[0]++;\n regA[0] = a;\n regF[0] = F_OP | ((a < 0) ? F_CARRY : 0) | (regA[0] ? 0 : F_ZERO);\n if ((regA[0] ^ m ^ a) & 0x10) regF[0] |= F_HCARRY;\n return 8;\n }", "function POPRSP(reg) {\n reg = reg|0\n reg = HU32[(ebp<<2)>>2]>>>0;\n ebp = ebp|0 + 1;\n return;\n }", "exec() {\n return _map[MMU.rb(regPC[0]++)]();\n }", "function beq() {\r\n var src1 = getRegisterVal(\"registerOne\");\r\n var src2 = getRegisterVal(\"registerTwo\");\r\n var offset = parseInt($(\"#immediate\").val());\r\n if (src1 == src2) {\r\n incrementPc(offset);\r\n }\r\n}", "function sipUnRegister() {\n if (oSipStack) {\n oSipStack.stop(); // shutdown all sessions\n }\n }", "function in_register() {\n\t$('#register-submit').on(\"click\", function () {\n\t\tconsole.log(\"entra register click\");\n\t\tregister();\n\n\t})\n\n\n\t$('#form_register').on(\"keydown\", function (e) {\n\t\tconsole.log(\"clickpass\")\n\t\tif (e.which == 13) {\n\t\t\tconsole.log(\"entra register\");\n\n\t\t\tregister();\n\t\t}\n\t});\n}", "inp(register) {\n\t\tthis.steps.push({ ...this.registers });\n\t\tthis.registers[register] = this.input.shift();\n\t}", "function gen_op_vfp_getreg_F1d(param1)\n{\n //gen_opparam_ptr.push(param1);\n gen_opc_ptr.push({func:op_vfp_getreg_F1d, param: param1});\n}", "function hlf(registers, register, offset) {\n registers[register] = registers[register] / 2;\n return 1;\n}", "set subtraction_flag(v){ this.register_F = change_bit_position(this.register_F, 6, v); }", "addHLReg(register) {\n var sum = regHL[0] + register[0];\n var flags = 0;\n if ((regHL[0] & 0xFFF) > (sum & 0xFFF)) {\n flags += F_HCARRY;\n }\n if (sum > 0xFFFF) {\n flags += F_CARRY;\n }\n regF[0] = (regF[0] & F_OP) + flags;\n regHL[0] = sum;\n return 12;\n }", "function getRegister (idx) {\n\tif (idx < 0 || idx > 15) {\n\t\tSTAT = 'INS';\n\t\tthrow new Error('Invalid register ID: 0x' + idx.toString(16));\n\t}\n\treturn REG[idx];\n}", "get instruction_register(){ return this.memory[this.PC]; }", "function register() {\n safeRegister();\n exports.clone.register();\n exports.copy.register();\n exports.extend.register();\n exports.typeOf.register();\n }", "function gen_op_vfp_getreg_F0d(param1)\n{\n //gen_opparam_ptr.push(param1);\n gen_opc_ptr.push({func:op_vfp_getreg_F0d, param: param1});\n}", "function div(x,y)\r\n{\r\n\r\n}", "LD_A_A(op){ op.register_A = op.register_A; }", "function hide_register(){\n\t\t$(\"#register_div\").hide();\n\t\t$(\"#login_div\").show();\n\t\t$(\"#login_div :input\").attr('disabled',false);\n\t\t$(\"#authorization_box_login\").hide();\n\t\t$(\":button#login\").show();\n\t\t$(\"#user_error\").html(\"\");\n\t\t$(\"#pass_error\").html(\"\");\n\t}", "mod(a, b) {\n\t\tthis.registers[a] %= this.get(b);\n\t}", "function writeRegister(reg, buffer) {\n // console.log(\"reg \"+reg);\n // console.log(buffer);\n csnLow();\n var b = new Buffer(1 + buffer.length);\n b[0] = consts.W_REGISTER | (consts.REGISTER_MASK & reg);\n//console.log(consts.W_REGISTER);\n//console.log(consts.REGISTER_MASK);\n//console.log(\"reg2=\"+b[0]);\n for (var i = 0; i < buffer.length; i++) {\n b[(buffer.length ) -i] = buffer[i];//ecriture inversée des bytes\n }\n//console.log(b);\n spi.write(b);\n csnHigh();\n }", "SET_0_A(){ this.register_A |= (0x1 << 0); return 8; }", "LDSPHL() {\n regSP[0] = regHL[0];\n return 12;\n }", "return() {\n this.setPc(this.registers[_glimmer_vm__WEBPACK_IMPORTED_MODULE_1__[\"$ra\"]]);\n }", "return() {\n this.setPc(this.registers[_glimmer_vm__WEBPACK_IMPORTED_MODULE_1__[\"$ra\"]]);\n }", "unreg(_ctrl) {\n if (!this._ensureValidControl(_ctrl, 'unreg')) {\n return false;\n }\n else if (!this._isreg(_ctrl)) {\n return false;\n }\n else {\n return this._unsetEventOptions(_ctrl, 'unreg');\n }\n }", "unreg(_ctrl) {\n if (!this._ensureValidControl(_ctrl, 'unreg')) {\n return false;\n }\n else if (!this._isreg(_ctrl)) {\n return false;\n }\n else {\n return this._unsetEventOptions(_ctrl, 'unreg');\n }\n }", "function PageMaskRegister() { // ./common/cpu.js:112\n this.Mask = 0; // ./common/cpu.js:113\n // ./common/cpu.js:114\n this.rawUInt32 = function() // ./common/cpu.js:115\n { // ./common/cpu.js:116\n return this.Mask; // ./common/cpu.js:117\n } // ./common/cpu.js:118\n // ./common/cpu.js:119\n this.asUInt32 = function() // ./common/cpu.js:120\n { // ./common/cpu.js:121\n var mask = Math.pow(2,this.Mask*2)-1; // ./common/cpu.js:122\n return ((mask << 13) >>> 0); // ./common/cpu.js:123\n } // ./common/cpu.js:124\n // ./common/cpu.js:125\n this.putUInt32 = function(val) // ./common/cpu.js:126\n { // ./common/cpu.js:127\n var mask = 0; // ./common/cpu.js:128\n // ./common/cpu.js:129\n switch(val) // ./common/cpu.js:130\n { // ./common/cpu.js:131\n case 0: // ./common/cpu.js:132\n mask = 0; // ./common/cpu.js:133\n break; // ./common/cpu.js:134\n case 3: // ./common/cpu.js:135\n mask = 1; // ./common/cpu.js:136\n break; // ./common/cpu.js:137\n case 15: // ./common/cpu.js:138\n mask = 2; // ./common/cpu.js:139\n break; // ./common/cpu.js:140\n case 63: // ./common/cpu.js:141\n mask = 3; // ./common/cpu.js:142\n break; // ./common/cpu.js:143\n case 255: // ./common/cpu.js:144\n mask = 4; // ./common/cpu.js:145\n break; // ./common/cpu.js:146\n case 1023: // ./common/cpu.js:147\n mask = 5; // ./common/cpu.js:148\n break; // ./common/cpu.js:149\n case 4095: // ./common/cpu.js:150\n mask = 6; // ./common/cpu.js:151\n break; // ./common/cpu.js:152\n default: // ./common/cpu.js:153\n ERROR(\"Invalid page mask.\"); // ./common/cpu.js:154\n break; // ./common/cpu.js:155\n } // ./common/cpu.js:156\n // ./common/cpu.js:157\n this.Mask = mask; // ./common/cpu.js:158\n } // ./common/cpu.js:159\n} // ./common/cpu.js:160", "static io_registersound(dir, name, fcn) {\n if (window.Settings.enableLog)\n WebUtils.log(\"Web.io_registersound({0},{1})\".format(dir, name));\n return SoundPlayer.io_registersound(dir, name, fcn);\n }", "function gen_op_vfp_getreg_F1s(param1)\n{\n //gen_opparam_ptr.push(param1);\n gen_opc_ptr.push({func:op_vfp_getreg_F1s, param: param1});\n}", "function gen_op_subl_T0_T1_usaturate()\n{\n gen_opc_ptr.push({func:op_subl_T0_T1_usaturate});\n}", "function divide(x,y) {\n\t//Write your code below this line\n var bye = x/y;\n return bye;\n}", "function deregister() {\n if (RegExp.encode === rexpEncode) {\n RegExp.encode = oencode;\n RegExp.decode = odecode;\n oencode = undefined;\n odecode = undefined;\n }\n }", "function register() {\n if (RegExp.encode !== rexpEncode) {\n oencode = RegExp.encode;\n odecode = RegExp.decode;\n RegExp.encode = rexpEncode;\n RegExp.decode = rexpDecode;\n }\n }", "function is_register(register_name) {\n\treturn register_name.charAt(0) === 'r';\n}", "load(register) {\n let value = this.stack.pop();\n this.loadValue(register, value);\n }", "load(register) {\n let value = this.stack.pop();\n this.loadValue(register, value);\n }", "load(register) {\n let value = this.stack.pop();\n this.loadValue(register, value);\n }", "function CompareRegister(cpu) { // ./common/cpu.js:199\n this.val = 0; // ./common/cpu.js:200\n this.cpu = cpu; // ./common/cpu.js:201\n // ./common/cpu.js:202\n this.asUInt32 = function () { // ./common/cpu.js:203\n return this.val; // ./common/cpu.js:204\n } // ./common/cpu.js:205\n // ./common/cpu.js:206\n this.putUInt32 = function ( val ) { // ./common/cpu.js:207\n this.val = (val & 0xffffffff) >>> 0; // ./common/cpu.js:208\n // clear timer interrupt // ./common/cpu.js:209\n this.cpu.C0Registers[13].IP1 = this.cpu.C0Registers[13].IP1 & 0x1f; // ./common/cpu.js:210\n } // ./common/cpu.js:211\n} // ./common/cpu.js:212", "function gen_op_vfp_setreg_F0d(param1)\n{\n //gen_opparam_ptr.push(param1);\n gen_opc_ptr.push({func:op_vfp_setreg_F0d, param: param1});\n}", "function add() {\r\n var mode = $(\"#filterMode\").val();\r\n var signed = $(\"#filterSigned\").val();\r\n var src1 = getRegisterVal(\"registerTwo\");\r\n var src2;\r\n if (mode == \"i\") {\r\n src2 = parseInt($(\"#immediate\").val());\r\n } else {\r\n src2 = getRegisterVal(\"registerThree\");\r\n }\r\n var result = src1 + src2;\r\n if (result <= maxVal && result >= minVal) {\r\n setRegisterVal(\"registerOne\", result);\r\n } else if (signed == \"u\") {\r\n var compare = result + signVal;\r\n compare = compare % signVal;\r\n compare = compare - signVal;\r\n result = compare;\r\n setRegisterVal(\"registerOne\", result);\r\n } else {\r\n alert(\"overflow error\");\r\n } \r\n}", "function registerFun(req){\n\t\t\tif(req.message[0]==0){\n\t\t\t\talt(req.message[1],5);\n\t\t\t\tlayer.closeAll(index);\n\t\t\t\t$('.layui-layer-loading').remove();\n\t\t\t\treturn false;\n\t\t\t}else if(req.message[0]==1){\n\t\t\t\talt(req.message[1],1);\n\t\t\t\tlayer.close(index);\n\t\t\t\tsetTimeout(\"redirect('login.html');\", 2000);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "ret() {\r\n return 0x00EE;\r\n }", "function gen_op_vfp_getreg_F0s(param1)\n{\n //gen_opparam_ptr.push(param1);\n gen_opc_ptr.push({func:op_vfp_getreg_F0s, param: param1});\n}", "LDH_A_D8(op, d8){ op.register_A = op.readMemory(0xFF00 | d8); return 12; }", "function gen_op_shsub16_T0_T1()\n{\n gen_opc_ptr.push({func:op_shsub16_T0_T1});\n}", "function sipUnRegister() {\n if (oSipStack) {\n /*var session = oSipStack.newSession('register', {\n expires: 0,\n events_listener: { events: '*', listener: unregisterSip },\n sip_caps: [\n { name: '+g.oma.sip-im', value: null },\n { name: '+audio', value: null },\n { name: 'language', value: '\\\"en,fr\\\"' }\n ]\n });\n session.register();*/\n oSipStack.stop(); // shutdown all sessions\n }\n}" ]
[ "0.59951186", "0.59903306", "0.5778063", "0.5775216", "0.5755409", "0.5732962", "0.5662409", "0.56209105", "0.56072074", "0.55883783", "0.5579185", "0.55561465", "0.5506326", "0.5471306", "0.5451275", "0.53904885", "0.53860986", "0.53832304", "0.53694063", "0.53283936", "0.5269068", "0.5242372", "0.5232934", "0.522491", "0.51598364", "0.5159162", "0.5155179", "0.5151888", "0.51496696", "0.51490223", "0.512723", "0.51027596", "0.5100279", "0.50897616", "0.507048", "0.5069982", "0.50649893", "0.5059791", "0.50495833", "0.5047717", "0.50461733", "0.5045408", "0.5022317", "0.5014538", "0.50116843", "0.499694", "0.49915758", "0.4983126", "0.49758974", "0.4962854", "0.49584985", "0.493898", "0.49366686", "0.49274942", "0.4924037", "0.49179998", "0.4909109", "0.49088806", "0.4904464", "0.49011695", "0.48904788", "0.4885885", "0.4878887", "0.48748702", "0.48701587", "0.4866699", "0.48661518", "0.48432162", "0.48407647", "0.48369306", "0.48325187", "0.48270395", "0.4824371", "0.4821097", "0.4815809", "0.4797152", "0.47908485", "0.47808123", "0.47808123", "0.47806156", "0.47806156", "0.47802073", "0.47785172", "0.4767014", "0.4765896", "0.47533774", "0.4750802", "0.47485435", "0.47428453", "0.47409898", "0.47409898", "0.47409898", "0.47403452", "0.47334844", "0.4732786", "0.47320104", "0.47304317", "0.4720904", "0.47196963", "0.47164354", "0.47163382" ]
0.0
-1
If all the input field pass the validation checking, the function will record all answers.
function SucRegister(){ var username=document.getElementById("username").value; var password=document.getElementById("psw").value; var email=document.getElementById("email").value; var birthday=document.getElementById("birthday").value; var phone=document.getElementById("phone").value; var registationJson = { Username: username, Password: password, Email: email, Phone: phone, Birthday: birthday }; //alert(JSON.stringify(registationJson)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkUserInput(){\n\t\t//check if title name is inputted\n\t\tif (!$(element).find('input[id=edit_title_name]').val()){\n\t\t\talert (\"Please input the test's title name\");\t\t\n\t\t\treturn false;\n\t\t}\n\t\t//check if test type is selected\n\t\tif (!$('#edit_test_type').val()){\n\t\t\talert (\"Please choose the test type\");\t\t\n\t\t\treturn false;\n\t\t}\n\t\t//check if total question number is inputted correctly\n\t\tif ( isNaN($(element).find('input[id=edit_total_question]').val()) || !isPositiveInteger($(element).find('input[id=edit_total_question]').val()) ){\n\t\t\talert (\"Please input correct number in total main question number\");\t\t\n\t\t\treturn false;\n\t\t}\n\t\t//check in each question set...\n\t\tnGroups = $(element).find('input[id=edit_total_question]').val();\n\t\tfor (var i=1;i<=nGroups;i++){\n\t\t\t//check if sub question number is inputted correctly\n\t\t\tif (isNaN($(element).find('input[id=edit_total_sub_question_' + i + ']').val()) || !isPositiveInteger($(element).find('input[id=edit_total_sub_question_' + i + ']').val()) ){\n\t\t\t\talert (\"Please input correct number in total sub question number for Q\" + i);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t//check in each question...\n\t\t\tvar total_sub_question = $(element).find('input[id=edit_total_sub_question_' + i + ']').val();\n\t\t\tfor (var j=1;j<=total_sub_question;j++){\n\t\t\t\t//check question content or picture is inputted\n\t\t\t\tif (!$(element).find('input[name=question' + i + '\\\\.'+ j + ']').val() && !$(element).find('input[name=question' + i + '\\\\.'+ j + '_pic]').val()){\n\t\t\t\t\talert (\"Please input a question content or picture on Q\" + i + \".\" + j);\n\t\t\t\t\treturn false;\t\t\t\t\n\t\t\t\t}\n\t\t\t\t//check learning object link and name are inputted.\n\t\t\t\tif (!$(element).find('input[name=lo' + i + '\\\\.' + j + '_link]').val() && $(element).find('input[name=lo' + i + '\\\\.' + j + '_link]').length > 0){\n\t\t\t\t\tif (j==1) {}\n\t\t\t\t\telse {\n\t\t\t\t\t\talert (\"Please input learning object link for Q\" + i + '.' + j);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (!$(element).find('input[name=lo' + i + '\\\\.' + j + '_name]').val() && $(element).find('input[name=lo' + i + '\\\\.' + j + '_name]').length > 0){\n\t\t\t\t\tif (j==1) {}\n\t\t\t\t\telse {\n\t\t\t\t\t\talert (\"Please input learning object name for Q\" + i + '.' + j);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//variable to check for checkbox (correct answer)\n\t\t\t\tvar isChecked = false;\t\n\t\t\t\t//check for each answer...\n\t\t\t\tfor (var k=1;k<=4;k++){\n\t\t\t\t\t//check answer content is inputted\n\t\t\t\t\tif (!$(element).find('input[name=answer' + i + '\\\\.'+ j + '_'+ k + ']').val()){\n\t\t\t\t\t\talert (\"Please input an answer for Q\" + i + \".\" + j);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\t//check if one of checkboxes is selected \n\t\t\t\t\tif ( $(element).find('input[id=answer' + i + '\\\\.'+ j + '_'+ k + '_cb]').is(':checked')){\n\t\t\t\t\t\tisChecked = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//if no checkbox is selected\n\t\t\t\tif (!isChecked){\n\t\t\t\t\talert (\"Please select one correct answer in Q\" + i + \".\" + j);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\t\t\n }\n\t\treturn true;\n\t}", "function CheckInputs(){\n //get values from inputs and gets rid of spaces\n const emailValue = email.value.trim();\n const subjectValue = subject.value.trim();\n const messageValue = message.value.trim();\n\n //used to check if form is valid. if by then end it doesnt equlat three then return false\n var score = 0;\n\n //CHECK EMAIL\n //checks if email is empty\n if(emailValue ===''){\n SetErrorFor(email,'Email can not be blank');\n }\n //checks if email is correct form\n else if(!IsEmail(emailValue)){\n SetErrorFor(email,'Email is not valid');\n }\n\n else{\n SetSuccessFor(email);\n score+=1;\n }\n\n //CHECK SUBJECT\n //checks if subject is empty\n if(subjectValue ===''){\n SetErrorFor(subject,'Subject can not be blank');\n }\n else{\n SetSuccessFor(subject);\n score+=1;\n }\n\n //CHECK MESSAGE\n //checks if subject is empty\n if(messageValue ===''){\n SetErrorFor(message,'Message can not be blank');\n }\n else{\n SetSuccessFor(message);\n score+=1;\n }\n\n if(score===3){\n return true;\n }\n\n else{\n return false;\n }\n\n \n}", "performFullValidation() {\r\n const validateCompleted = this.state.pages[this.state.index].questions.map(\r\n (question, index) => {\r\n if (!question.required || question.questionType === \"Label\") {\r\n return true;\r\n }\r\n const answer = this.state.answerIndexes.find(\r\n ans => ans.page === this.state.index && ans.qIndex === index\r\n );\r\n if (!answer || answer.answer === \"\" || answer.answer === \"null\") {\r\n return false;\r\n }\r\n return true;\r\n }\r\n );\r\n this.setState({\r\n questionsAnswered: validateCompleted\r\n });\r\n }", "function validateform(){\n var contain =[];\n var flag;\n jQuery(\"#all_possible_responses input:text\").each(function(){\n contain.push(jQuery(this).val());\n });\n //~ alert(contain);\n //~ alert(contain.length);\n if (contain.length > 0)\n {\n for (var i = 0; i < contain.length; i++)\n {\n //~ alert(contain[i]);\n if (contain[i]=='')\n {flag =false;}\n else\n {flag=true}\n }\n if (flag == true)\n {return true;}\n else\n {\n //~ alert(\"error\");\n jQuery('.common_valid').text(\"Please enter the answer\");\n jQuery(\".common_valid\").css(\"color\", \"#FF0000\");\n return false;\n }\n }\n else\n {\n //~ alert(\"return\");\n return true;\n }\n }", "function validateInstructionChecks() {\n \n instructionChecks = $('#instr').serializeArray();\n\n var ok = true;\n var allanswers = true;\n if (instructionChecks.length < 2) {\n alert('Please complete all questions.');\n allanswers = false;\n \n \n } else {\n allanswers = true;\n for (var i = 0; i < instructionChecks.length; i++) {\n // check for incorrect responses\n if(instructionChecks[i].value === \"incorrect\") {\n alert('At least one answer was incorrect; please read the instructions and try again.');\n ok = false;\n break;\n }\n }\n }\n \n \n // goes to next section\n if (!allanswers) {\n showInstructionCheck;\n } else if(!ok) {\n showInstructions(); \n } else {\n hideElements();\n showDummyVignette(); \n }\n}", "function validateData() {\n // get the answer from the question textarea\n let multipleChoiceAnswer;\n longAnswer.value;\n\n // loop through all the multiple choice answers and find the selected one\n const array = Array.prototype.slice.call(answersList.querySelectorAll('.form-bottom__item'));\n array.forEach(function(item) {\n\n // get currently selected multiplechoice answeer\n const current = item.querySelector('.form-bottom__item-radio-btn');\n\n // get the element tag\n const currentItemType = item.querySelector('.form-bottom__item-text').tagName;\n\n // if the answer selected in predefined - grab it's text content\n // if the answer is manually entered by the user - grab it's input text value\n if (current.checked && (currentItemType === 'DIV')) {\n multipleChoiceAnswer = current.parentElement.querySelector('.form-bottom__item-text').textContent;\n } else if (current.checked && (currentItemType === 'INPUT')) {\n multipleChoiceAnswer = current.parentElement.querySelector('.form-bottom__item-text').value;\n }\n })\n\n // verify that user has entered an answer into the question box\n if (longAnswer.value === '') {\n const error = document.createElement('span');\n error.textContent = \"Please type an answer to the question!\"\n errors.appendChild(error);\n errorCount += 1;\n }\n\n // verify that at least 1 multiple choice answer was selected or display error\n if (typeof multipleChoiceAnswer === 'undefined') {\n const error = document.createElement('span');\n error.textContent = \"Please select at least 1 answer or type your own!\"\n errors.appendChild(error);\n errorCount += 1;\n }\n\n // return submission data\n return {\n longAnswer: longAnswer,\n multipleChoiceAnswer: multipleChoiceAnswer\n }\n}", "function testData(){\n let result = false;\n for(name in data) {\n if(blankField(data[name])){\n result = true;\n }else{\n result = false;\n }\n }\n if(password.value === \"\" || (password.value !== \"\" && !numExp.test(password.value))){\n password.classList.add(\"invalid\");\n password.insertAdjacentHTML('afterend', \"<p class = 'message'>Password must contain one number, one letter, one capital letter and be at least 8 characters long</p>\");\n result = false;\n }\n \n if(telephone.value === \"\" || (telephone.value !== \"\" && !tele.test(telephone.value))){\n telephone.classList.add(\"invalid\");\n telephone.insertAdjacentHTML('afterend', \"<p class = 'message'>Telephone number format must be for eg 876-555-7896</p>\");\n result = false;\n }\n \n return result;\n }", "function validateAnswer() {\n switch (current_question_number) {\n case 1: {\n return validateQuestion1();\n }\n case 2: {\n return validateQuestion2();\n }\n case 3: {\n return validateQuestion3();\n }\n case 4: {\n return validateQuestion4();\n }\n case 5: {\n return validateQuestion5();\n }\n }\n }", "function validateForm(){\n var title = $('input[name=\"title\"]').val();\n var media = $(\"input[name='mediaType']:checked\").val();\n var checkAnswer = $(\"input[name='answerSheet']\").val();\n var answerQuestion = 1;\n if(title.length == 0){\n $('input[name=\"title\"]').css('border','solid 1px red');\n return false;\n }\n if(media == undefined){\n $('input[name=\"mediaType\"]').css('outline','solid 1px red');\n return false;\n }\n $('input.questionAnswer').each(function() {\n var data = $(this);\n if($(this).val() == ''){\n $('#'+data[0]['id']).css('border','solid 1px red');\n // return false;\n answerQuestion = 2;\n }\n });\n if (answerQuestion == 2) {\n return false;\n }\n if(checkAnswer.length == ''){\n alert('!Oops please select any correct answer.');\n return false;\n }\n // return false;\n }", "function allValid(inputs, ignoreInvalid){\n\tconsole.log('Ignore invalid set to: ' + ignoreInvalid);\n\tif(ignoreInvalid) {\n\t\tconsole.log('allValid: returning [ true ]');\n\t\treturn true;\n\t}\n\tconsole.log('AllValid: Performing Checks');\n let valid = true;\n\tinputs.map(e => {\n\t\t/*\n\t\t* Sweeps the array, if any field is empty, the form is set to invalid.\n\t\t* Also, sets all inputs to valid.\n\t\t*/\n\t\te.invalid = false;\n\t\tif(e.value == \"\"){\n\t\t\te.invalid = true;\n\t\t\tvalid = false;\n\t\t}\n\t});\n \n\t/*\n\t* Name must be: only letters.\n\t*/\n\tlet nameInput = getInput(inputs, \"Name\");\n\tif(nameInput.value.length > 20 || !/^[a-zA-Z-,]+(\\s{0,1}[a-zA-Z-, ])*$/.test(nameInput.value)){\n\t\t//If the name is a string with only characters, and size smaller than 20.\n\n\t\tconsole.log('Invalid Name');\n\t\tnameInput.invalid = true;\n\t\tvalid = false;\n\t}\n \n\t/*\n\t* Age: only numbers ranging from 0 to 60.\n\t*/\n\tlet ageInput = getInput(inputs, \"Age\");\n\tif(ageInput.value <= 0 || ageInput.value >= 60){\n\t\t//If age is a natural integer smaller than 60\n\n\t\tconsole.log('Invalid Age');\n\t\tageInput.invalid = true;\n\t\tvalid = false;\n\t}\n\n\t/*\n\t* Phone: only numbers. String must be 11 chars long.\n\t*/\n\tlet phoneInput = getInput(inputs, \"Phone\");\n\tif(phoneInput.value.length != 11){\n\t\t//If phone number's length is not 11.\n\n\t\tphoneInput.invalid = true;\n\t\tconsole.log('Invalid Phone');\n\t\tvalid = false;\n\t}\n\n\t/*\n\t* Password: Password and Validade Password must be equals.\n\t*/\n\tlet passInput = getInput(inputs, \"Password\");\n\tlet validPassInput = getInput(inputs, \"ValidatePassword\");\n\tif(!passInput.invalid){\n\t\t//If password is not empty\n\n\t\tif(passInput.value != validPassInput.value ){\n\t\t\t//If password and validPassword are not the same.\n\n\t\t\tvalidPassInput.invalid = true;\n\t\t\tconsole.log('Unmatching Passwords');\n\t\t\tvalid = false;\n\t\t}\n\t} else {\n\t\tvalidPassInput.invalid = false;\n\t}\n\tconsole.log('allValid: returning [ '+ valid +' ]');\n\treturn valid;\n}", "function checkIterationFormInfo(objData){\n\t\n\tif (objData.length < 16) {\n\t\talert(\"Please answer all questions before finishing the experiment\");\n\t\treturn false;\n\t}\n\n\tfor (var i = 0; i < objData.length; i++) {\n\t\tif (objData[i].value == \"\"){\n\t\t\talert(\"Please answer question: \" + objData[i].name);\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "function checkAnswers() {\n\n}", "function checkInput(){\n var length_of_array;\n var fields_required = [\n { \"field_id\":\"name\" , \"warning_msg_id\":\"name_msg\", \"warning_msg\":\"请填入姓名\"},\n { \"field_id\":\"condo\" , \"warning_msg_id\":\"condo_msg\", \"warning_msg\":\"请选择是否为condo\" },\n { \"field_id\":\"source\" , \"warning_msg_id\":\"source_msg\", \"warning_msg\":\"请选择来源\" },\n { \"field_id\":\"target_marketing\" , \"warning_msg_id\":\"target_marketing_msg\", \"warning_msg\":\"请选择客户为华人还是西人\" },\n { \"field_id\":\"price_requirement\" , \"warning_msg_id\":\"price_requirement_msg\", \"warning_msg\":\"请选择预期但的价格\" },\n { \"field_id\":\"business\" , \"warning_msg_id\":\"business_msg\", \"warning_msg\":\"请选择是否为商业装修\" },\n { \"field_id\":\"price_range\" , \"warning_msg_id\":\"price_range_msg\", \"warning_msg\":\"请选择价格偏向\" }\n ];\n var boolean_required;\n length_of_array = Object.keys(fields_required).length;\n for (var i = 0; i < length_of_array; i++){\n if (document.getElementById(fields_required[i].field_id).value.trim() == \"\"){\n document.getElementById(fields_required[i].warning_msg_id).innerHTML = fields_required[i].warning_msg;\n boolean_required = false;\n }\n else{\n document.getElementById(fields_required[i].warning_msg_id).innerHTML = \"\";\n boolean_required = true;\n }\n }\n return boolean_required;\n}", "function verify_inputs(){\n if(document.getElementById(\"Split_By\").value == ''){\n return false;\n }\n if(document.getElementById(\"Strength\").value == ''){\n return false;\n }\n if(document.getElementById(\"Venue\").value == ''){\n return false;\n }\n if(document.getElementById(\"season_type\").value == ''){\n return false;\n }\n if(document.getElementById(\"adjustmentButton\").value == ''){\n return false;\n }\n\n return true\n }", "function answerFormValidation(){\n return true;\n var formValues = document.forms[0];\n var isFieldEmpty = false;\n var numberOfInput = 3;\n var i = 0;\n // Check whether there is an empty field in the form\n do {\n if (formValues.elements[i].value.length == 0 || formValues.elements[i].value == null) {\n isFieldEmpty = true;\n } else {\n i++;\n }\n } while (!isFieldEmpty && i<numberOfInput);\n // Check whether email address is valid\n console.log(formValues.elements[\"answer-email\"]);\n var email = formValues.elements[\"answer-email\"].value;\n var regex = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/;\n var isEmailValid = regex.test(email);\n if (isFieldEmpty) {\n alert(\"There are empty fields. Please complete this form.\");\n return false;\n } else if (!isEmailValid) {\n alert(\"Email is not valid.\");\n return false;\n } else {\n return true;\n }\n}", "function checkDoctorFields() {\n var result_1 = Validation.checkInput($(\"#username\"), function (obj) {\n return obj.val() != \"\";\n })\n var result_2 = Validation.checkInput($(\"#password\"), function (obj) {\n return obj.val() != \"\";\n })\n var result_3 = Validation.checkInput($(\"#password_confirmation\"), function (obj) {\n return obj.val() != \"\" && obj.val() == $(\"#password\").val();\n })\n var result_4 = Validation.checkInput($(\"#d_email\"), function (obj) {\n return obj.val() != \"\";\n })\n var result_5 = Validation.checkInput($(\"#i-agree-button\"), function (obj) {\n return $('.button-checkbox').find('input:checkbox').is(':checked');\n })\n var result_6 = Validation.checkInput($(\"#d_first_name\"), function (obj) {\n return obj.val() != \"\";\n })\n var result_7 = Validation.checkInput($(\"#d_last_name\"), function (obj) {\n return obj.val() != \"\";\n })\n var result_8 = Validation.checkInput($(\"#d_license_no\"), function (obj) {\n return obj.val() != \"\";\n })\n var result_9 = Validation.checkInput($(\"#d_date_of_birth\"), function (obj) {\n return obj.val() != \"\";\n })\n var result_10 = Validation.checkInput($(\"#d_phone_no\"), function (obj) {\n return obj.val() != \"\";\n })\n var result_11 = Validation.checkInput($(\"#d_hospital\"), function (obj) {\n return obj.val() != \"\";\n })\n var result_12 = Validation.checkInput($(\"#d_department\"), function (obj) {\n return obj.val() != \"\";\n })\n var result_13 = Validation.checkInput($(\"#d_title\"), function (obj) {\n return obj.val() != \"\";\n })\n\n return result_1 & result_2 & result_3 & result_4 & result_5 & result_6 & result_7& result_8& result_9& result_10& result_11& result_12& result_13;\n}", "function validate(dataValidate) {\n let isCorrect = true,isCorrectAnswerCount = 0;\n //show error answer\n for (let i = 0; i < dataValidate.answer.length; i++) {\n let errorAnswerId = $(\"#\" + dataValidate.error_answer[i]);\n if(dataValidate.answer[i]!=undefined){\n if (dataValidate.answer[i].trim() == \"\") {\n errorAnswerId.attr(\"style\", \"display: block\");\n errorAnswerId.prev().removeClass(\"mb-3\");\n errorAnswerId.addClass('mb-3');\n isCorrect = false;\n } else {\n errorAnswerId.attr(\"style\", \"display: none\");\n errorAnswerId.removeClass('mb-3');\n errorAnswerId.prev().addClass('mb-3');\n isCorrectAnswerCount++;\n }\n }\n }\n if(isCorrectAnswerCount>=2){\n //Clear error\n for (let j = 0; j < dataValidate.answer.length; j++) {\n let errorAnswerId = $(\"#\" + dataValidate.error_answer[j]);\n errorAnswerId.attr(\"style\", \"display: none\");\n errorAnswerId.removeClass('mb-3');\n errorAnswerId.prev().addClass('mb-3');\n }\n isCorrect = true;\n }\n\n //show question error\n if (dataValidate.question.trim() === \"\") {\n $(\"#\" + dataValidate.error_question).attr(\"style\", \"display: block\");\n isCorrect = false;\n } else {\n $(\"#\" + dataValidate.error_question).attr(\"style\", \"display: none\");\n }\n\n //show error when no select true answer\n if (isCorrect) {\n let selectCount = 0;\n for (let i = 0; i < dataValidate.select.length; i++) {\n if (dataValidate.select[i] === true && dataValidate.answer[i].trim() !== \"\") {\n selectCount = selectCount + 1;\n }\n }\n if (selectCount < 1) {\n isCorrect = false;\n warningModal(mustCheckCorrectAnswer);\n }\n }\n return isCorrect;\n}", "function validateOnSubmit() {\n\n var elem;\n\n var errs=0;\n\n // execute all element validations in reverse order, so focus gets\n\n // set to the first one in error.\n\n if (!validateTelnr (document.forms.demo.telnr, 'inf_telnr', true)) errs += 1; \n\n if (!validateAge (document.forms.demo.age, 'inf_age', false)) errs += 1; \n\n if (!validateEmail (document.forms.demo.email, 'inf_email', true)) errs += 1; \n\n if (!validatePresent(document.forms.demo.from, 'inf_from')) errs += 1; \n\n\n\n if (errs>1) alert('There are fields which need correction before sending');\n\n if (errs==1) alert('There is a field which needs correction before sending');\n\n\n\n return (errs==0);\n\n }", "function runValidation() {\n nameVal();\n phoneVal();\n mailVal();\n}", "function validateFields() {\n var validated = false;\n for (var i = 0; i < input_list.length; i++) {\n //loop through array of inputs in input_list defined at top of page.\n if (input_list[i].value.toString().trim() != \"\") {\n validated = true;\n }\n }\n return validated;\n }", "function questionFormValidation(){\n var formValues = document.forms[0];\n var isFieldEmpty = false;\n var numberOfInput = 4;\n var i = 0;\n // Check whether there is an empty field in the form\n do {\n if (formValues.elements[i].value.length==0 || formValues.elements[i].value == null) {\n isFieldEmpty = true;\n } else {\n i++;\n }\n } while (!isFieldEmpty && i<numberOfInput);\n // Check whether email address is valid\n var email = formValues.elements[\"question-email\"].value;\n var regex = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/;\n var isEmailValid = regex.test(email);\n if (isFieldEmpty) {\n alert(\"There are empty fields. Please complete this form.\");\n formValues.elements[i].focus();\n return false;\n } else if (!isEmailValid) {\n alert(\"Email is not valid.\");\n formValues.elements[\"question-email\"].focus();\n return false;\n } else {\n return true;\n }\n}", "function checkPatientFields() {\n var result_1 = Validation.checkInput($(\"#username\"), function (obj) {\n return obj.val() != \"\";\n })\n var result_2 = Validation.checkInput($(\"#password\"), function (obj) {\n return obj.val() != \"\";\n })\n var result_3 = Validation.checkInput($(\"#password_confirmation\"), function (obj) {\n return obj.val() != \"\" && obj.val() == $(\"#password\").val();\n })\n var result_4 = Validation.checkInput($(\"#email\"), function (obj) {\n return obj.val() != \"\";\n })\n var result_5 = Validation.checkInput($(\"#i-agree-button\"), function (obj) {\n return $('.button-checkbox').find('input:checkbox').is(':checked');\n })\n var result_6 = Validation.checkInput($(\"#first_name\"), function (obj) {\n return obj.val() != \"\";\n })\n var result_7 = Validation.checkInput($(\"#last_name\"), function (obj) {\n return obj.val() != \"\";\n })\n var result_8 = Validation.checkInput($(\"#medicare_no\"), function (obj) {\n return obj.val() != \"\";\n })\n var result_9 = Validation.checkInput($(\"#date_of_birth\"), function (obj) {\n return obj.val() != \"\";\n })\n var result_10 = Validation.checkInput($(\"#phone_no\"), function (obj) {\n return obj.val() != \"\";\n })\n\n return result_1 & result_2 & result_3 & result_4 & result_5 & result_6 & result_7& result_8& result_9& result_10;\n}", "function checkForm(){\n //if all outcomes are true, this means all inputs have correct data\n if(name_outcome && email_outcome && tel_outcome && msg_outcome){ //if all inputs filled correctly, allow user to send form\n btn.disabled = false; //enable submit btn\n }else{\n btn.disabled = true;\n }\n }", "function validate() \n{\n var result = validateMemberID() + validateScore() + validateEventID();\n alert(\"result = \" + result); // should be nothing if fields validate\n if ( result == \"\" )\n { \n \talert(\"Data Added successfully\"); \n \treturn true; \n }\n else \n {\n alert(\"Errors in entering the Data\");\n return false;\n }\n \n}", "function checkFormInputs() {\n var nameInputField = document.querySelector('#name');\n var emailInputField = document.querySelector('#mail');\n var numberInputField = document.querySelector('#number');\n var cityInputField = document.querySelector('#city');\n var stateSelect = document.querySelector('#state');\n var zipInputField = document.querySelector('#zip');\n var radios = document.getElementsByName('format');\n var newsLetter = document.getElementsByName('user_interest');\n\n\n var values = [nameInputField, emailInputField, numberInputField, cityInputField, stateSelect, zipInputField];\n var errorFound = false;\n\n // adding the class 'error' to any input without data\n for (var i = 0; i < values.length; i++) {\n var field = values[i];\n if (!field.value || stateSelect.value === 'Choose State') {\n field.classList.add('error');\n field.placeholder = \"Field can't be blank\";\n errorFound = true;\n } else {\n field.classList.remove('error');\n }\n }\n\n // Check if any field had an error, if not, submit data somewhere\n if (!errorFound) {\n // save data to databasae\n }\n}", "function validInputs(){\n\tvar allValidInputs;\n\tvar numOfCoffees = 0;\n\tvar invalidProblems = [];\n\n\n\tfor(var i = 0; i < coffeeLiArray.length; i++)\n\t{\n\t\tif(coffeeLiArray[i].checked)\n\t\t{\n\t\t\tnumOfCoffees += Number(coffeeLiArray[i].quantityElement.value);\n\t\t}\n\t}\n\t//iterates through the coffeeLiArray, if .checked is true then numOfCoffees is incremented by the value of the corresponding quantityElement\n\n\n\tif(nameInput.value && numOfCoffees <= 5 && numOfCoffees >= 1)\n\t{\n\t\tallValidInputs = true;\n\n\t}else{\n\t\tallValidInputs = false;\n\t\tif(!nameInput.value)\n\t\t\tinvalidProblems.splice(0,0, \"*Enter Name\");\n\t\tif(numOfCoffees < 1 || numOfCoffees > 5)\n\t\t\tinvalidProblems.splice(0,0, \"*Can only select between 1 and 5 beverages\");\n\n\t\t//var problemText = \"\";\n\t\tvar problemParagraph = document.createElement(\"p\");\n\t\tproblemParagraph.setAttribute(\"id\", \"problemElement\");\n\t\tfor(i = 0; i < invalidProblems.length; i++)\n\t\t{\n\t\t\t//problemText = problemText.concat(invalidProblems[i], \"\\n\");\n\t\t\tproblemParagraph.appendChild(document.createTextNode(invalidProblems[i]));\n\t\t\tproblemParagraph.appendChild(document.createElement(\"br\"));\n\t\t}\n\n\t\tproblemParagraph.style.fontFamily = \"Nunito\", \"sans-serif\";\n\t\tproblemParagraph.style.position = \"absolute\";\n\t\tproblemParagraph.style.color = \"red\";\n\t\tproblemParagraph.style.left = \"685px\";\n\t\tproblemParagraph.style.top = \"335px\";\n\t\tdocument.body.appendChild(problemParagraph);\n\t\t//outputting problems with input to the user in a p element if any exists\n\t}\n\n\treturn allValidInputs;\n\t//returns boolean value\n}", "function validateAllOptionsToAllowSubmit() {\r\n // if suitable array and criteria conditions align ...\r\n\r\n /*\r\n selectionIndexes: {\r\n ethnicities: [],\r\n ageBands: [],\r\n genders: [],\r\n nationalities: [],\r\n religions: [],\r\n health: [],\r\n qualifications: [],\r\n },\r\n */\r\n\r\n if (\r\n aleph.selectionIndexes.ethnicities &&\r\n aleph.selectionIndexes.ethnicities.length > 0 &&\r\n aleph.selectionIndexes.ageBands &&\r\n aleph.selectionIndexes.ageBands.length > 0 &&\r\n aleph.selectionIndexes.genders &&\r\n aleph.selectionIndexes.genders.length > 0 &&\r\n aleph.selectionIndexes.nationalities &&\r\n aleph.selectionIndexes.nationalities.length > 0 &&\r\n aleph.selectionIndexes.religions &&\r\n aleph.selectionIndexes.religions.length > 0 &&\r\n aleph.selectionIndexes.health &&\r\n aleph.selectionIndexes.health.length > 0 &&\r\n aleph.selectionIndexes.qualifications &&\r\n aleph.selectionIndexes.qualifications.length > 0\r\n ) {\r\n // enable reset and submit buttons\r\n document.getElementById(\"line-submit\").disabled = false;\r\n document.getElementById(\"line-clear\").disabled = false;\r\n } else {\r\n // disable reset and submit buttons\r\n document.getElementById(\"line-submit\").disabled = true;\r\n document.getElementById(\"line-clear\").disabled = true;\r\n }\r\n\r\n return;\r\n}", "function validate() {\n var count = 0;\n var valid = true;\n var radio_groups = {}\n $(\":radio\").each(function(){\n radio_groups[this.name] = true;\n })\n for(group in radio_groups){\n count++;\n if (!$(\":radio[name='\"+group+\"']:checked\").length) {\n var question = count;\n valid = false;\n }\n }\n if (!valid) {\n alert('Please answer question number ' + question);\n return false;\n }\n }", "function validateEditFormInput(){\n //1 collecting data from the updateForm\n const title = document.getElementById('updateTitle');\n const description = document.getElementById('updateDescription');\n const imageUrl = document.getElementById('updateImageUrl');\n \n //2 check input data / display err msg - validation for user\n validateFormTextInput(title, \"title\");\n validateFormTextInput(imageUrl, \"imageUrl\");\n validateFormTextInput(description, \"description\");\n \n inputArr = [title.value, imageUrl.value, description.value]\n return inputArr;\n }", "function submitData() {\r\n let valName = validateFullName();\r\n let valEmail = validateEmail();\r\n let valUsrName = validateUserName();\r\n let valPassword = validatePassword();\r\n let valCPwd = validateCPassword();\r\n let valGender = validateGender();\r\n let valQty = validateQty();\r\n let valAddress = validateAddress();\r\n let valChkAgree = validateAgreement();\r\n let allValidated = valName && valEmail && valUsrName && valPassword && valCPwd && valGender && valQty && valAddress && valChkAgree;\r\n console.log(valName);\r\n if (allValidated) {\r\n alert(\"Game bought\");\r\n document.getElementById(\"regisForm\").reset();\r\n } else {\r\n alert(\"Error detected\");\r\n }\r\n}", "function Analyze() {\n\n // get the value of title input field and textarea field\n let inputField = document.getElementById(\"title-input\").value;\n let textareaField = document.getElementById(\"note-textarea\").value;\n\n // alert paragraph element\n let alert = document.querySelector(\".alert\");\n\n // if both fields are empty\n if (inputField == \"\" || textareaField == \"\") {\n alert.innerText = \"Both Fields are Required!\";\n alert.style.display = \"block\";\n }\n // if length of inputField is greater than 40 char\n else if (inputField.length > 40) {\n alert.innerText = \"Title Field must be less than 40 characters!\";\n alert.style.display = \"block\";\n }\n // if upper both conditions are false then store data and add note\n else {\n alert.innerText = \"\";\n alert.style.display = \"none\";\n CheckAndStoreData(inputField, textareaField);\n }\n\n}", "function checkAnswers(answers){\n var correctAns = model.transition(false);\n var result = []; var sum = 0;\n var allCorrect = 1;\n var error = {errorName:\"none\",badInputs:[]};//[error name, position that error was found]\n \n for (var i = 0; i < answers.length; i++){\n sum += answers[i];\n if(isNaN(answers[i])){\n error.errorName = \"nonnumber_error\";\n error.badInputs.push(i);\n }\n else if(answers[i] <0){\n error.errorName = \"negative_error\";\n error.badInputs.push(i);\n }\n if (round_number(answers[i],3) == round_number(correctAns[i],3)){\n result[i] = \"right\"; \n }\n else {result[i] = \"wrong\"; allCorrect = 0;}\n }\n result[answers.length] = allCorrect;\n if (round_number(sum,3) != round_number(1,3) && error.errorName==\"none\"){ error.errorName = \"sum_error\"; error.badInputs =[]}\n// else {result[answers.length+1] = \"sum_correct\";}\n \n result[answers.length+1] = error;\n return result;\n }", "function validateFormularData() {\n \n \n rows = document.getElementById('formularContent').childElementCount;\n \n for (var i = 0; i <rows; i++) {\n \n \n var str = document.getElementById('lbl ' + (i + 1)).textContent;\n \n if (str.indexOf(\"*\") > 0) {\n if (document.getElementById('text' + (i + 1))) {\n var input = document.getElementById('text' + (i + 1)).value;\n if (input != \"\") {\n return true;\n }\n }\n else if (document.getElementById('radio' + rows + \" 1\")) {\n if (document.getElementById('radio' + rows + \" 1\").hasAttribute('checked')) {\n return true;\n }\n }\n else if (document.getElementById('radio' + rows + \" 2\")) {\n if (document.getElementById('radio' + rows + \" 2\").hasAttribute('checked')) {\n return true;\n }\n }\n else if (document.getElementById('radio' + rows + \" 3\")) {\n if (document.getElementById('radio' + rows + \" 3\").hasAttribute('checked')) {\n return true;\n }\n }\n\n else if (document.getElementById(\"check\" + rows + \" 1\")) {\n \n if (document.getElementById('check' + rows + \" 1\").hasAttribute('checked')) {\n \n return true;\n }\n }\n else if (document.getElementById('check' + rows + \" 2\")) {\n if (document.getElementById('check' + rows + \" 2\").hasAttribute('checked')) {\n \n return true;\n }\n }\n else if (document.getElementById('check' + rows + \" 3\")) {\n if (document.getElementById('check' + rows + \" 3\").hasAttribute('checked')) {\n return true;\n }\n }\n }\n if (str.search('(numeric)') > -1) {\n \n var input = document.getElementById('text' + (i + 1)).value;\n if (numericInputValidation(input)==false ) {\n return false;\n }\n \n\n }\n \n\n }\n \n return false;\n}", "function validateSubmitResults() {\n\tconsole.log(\"Calling from validator\");\n\tvar validated; \n // Select only the inputs that have a parent with a required class\n var required_fields = $('.required');\n // Check if the required fields are filled in\n \trequired_fields.each(function(){\n \t\t// Determite what type of input it is, and display appropriate alert message\n\t\tvar field, msg_string;\n \tif( $(this).hasClass('checkbox_container') || $(this).hasClass('radio_container') ){\n \t\tfield = $(this).find('input:checked');\n \t\tmsg_string = \"Please select an option\";\n \t}else{\n \t\tfield = $(this).find('input:text, textarea');\n \t\tmsg_string = \"Please fill in the field\";\n \t} \n\t\t// For the checkbox/radio check the lenght of selected inputs,\n\t\t// at least 1 needs to be selected for it to validate \n\t\t// And for the text, check that the value is not an empty string\n \t\tif( (field.length <= 0) || !field.val() ){\n \t\t\tconsole.log(\"Field length: \" + field.length);\n \t\t\t$(this).addClass('alert alert-warning');\n \t\t\tvar msg = addParagraph(msg_string, \"validator-msg text-danger\");\n \t\t\t// Check if there is already an alert message class, \n \t\t\t// so that there wouldn't be duplicates\n\t\t\tif( $(this).find('p.validator-msg').length == 0 ){\n \t$(this).find('.section-title').before(msg);\n }\n validated = false;\n \t\t}\n \t\telse{\n \t\t\t// Remove the alert classes and message\n \t\t\t$(this).find('p.validator-msg').detach();\n $(this).removeClass('alert-warning').removeClass('alert'); \n validated = true;\n \t\t}\n \t\t// Sanitize the inputs values\n \t\tif( validated ){\n \t\t\tvar answer = sanitizeString(field.val());\n \t\t\tfield.val(answer);\n \t\t}\n \t});\n\n\treturn validated;\n}", "function validateQuestion() {\n\t\tvar valid_entry = true;\n\t\t$(\"#form_question_label\").css(\"color\", \"black\");\n\t\t$(\"#form_answer_label\").css(\"color\", \"black\");\n\t\t$(\"#form_false_label\").css(\"color\", \"black\");\n\t\t\n\t\tif(($(\"#form_false_input_3\").val() == \"\")) {\n\t\t\tvalid_entry = false;\n\t\t\t$(\"#form_false_label\").css(\"color\", \"red\");\n\t\t\t$(\"#form_false_input_3\").focus();\n\t\t}\n\t\tif(($(\"#form_false_input_2\").val() == \"\")) {\n\t\t\tvalid_entry = false;\n\t\t\t$(\"#form_false_label\").css(\"color\", \"red\");\n\t\t\t$(\"#form_false_input_2\").focus();\n\t\t}\n\t\tif(($(\"#form_false_input_1\").val() == \"\")) {\n\t\t\tvalid_entry = false;\n\t\t\t$(\"#form_false_label\").css(\"color\", \"red\");\n\t\t\t$(\"#form_false_input_1\").focus();\n\t\t}\n\t\tif($(\"#form_answer_input\").val() == \"\") {\n\t\t\tvalid_entry = false;\n\t\t\t$(\"#form_answer_label\").css(\"color\", \"red\");\n\t\t\t$(\"#form_answer_input\").focus();\n\t\t}\n\t\tif($(\"#form_question_input\").val() == \"\") {\n\t\t\tvalid_entry = false;\n\t\t\t$(\"#form_question_label\").css(\"color\", \"red\");\n\t\t\t$(\"#form_question_input\").focus();\n\t\t}\n\t\tif (valid_entry == true) {\n\t\t\t$(\"#thanks_crowd_input\").fadeIn(\"slow\", function() {\n\t\t\t\t$(\"#form_question_input\").val(\"\");\n\t\t\t\t$(\"#form_answer_input\").val(\"\");\n\t\t\t\t$(\"#form_false_input_1\").val(\"\");\n\t\t\t\t$(\"#form_false_input_2\").val(\"\");\n\t\t\t\t$(\"#form_false_input_3\").val(\"\");\n\t\t\t\tsetTimeout(function() {$(\"#thanks_crowd_input\").fadeOut(\"slow\");}, 5000);\n\t\t\t});\n\t\t\t\n\t\t\t$.getJSON('php/back.php', {\n\t\t\t\tcomm: 'input_question',\n\t\t\t\ttrivia_question: $(\"#form_question_input\").val(),\n\t\t\t\ttrivia_answer: $(\"#form_answer_input\").val(),\n\t\t\t\ttrivia_false_1: $(\"#form_false_input_1\").val(),\n\t\t\t\ttrivia_false_2: $(\"#form_false_input_2\").val(),\n\t\t\t\ttrivia_false_3: $(\"#form_false_input_3\").val()\n\t\t\t\t}, function(data) {\n\t\t\t});\n\t\t}\n\t\telse {\n\t\t}\n\t}", "function isAllValid(){\n return (\n BILL_REGEX.test(billInput.value) && \n (NUM_REGEX.test(customPercent.value) || \n document.querySelector('input[name=\"tip-amount\"]:checked')) && \n NUM_REGEX.test(numPeople.value)\n )\n}", "function _recordStepData($step) {\n\t\t\tswitch($step.type) {\n\t\t\t\tcase 'single_choice':\n\t\t\t\t\twizard.find(\".single-choice-button\").each(function(k) {\n\t\t\t\t\t\tif($(this).data('selected')) {\n\t\t\t\t\t\t\tanswer = $(this).data('value');\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\t$step.given_answer = answer;\n\t\t\t\t\tif(CONFIG.debug) console.log($step.given_answer);\n\t\t\t\t\treturn true;\n\t\t\t\tcase 'multiple_choice':\n\t\t\t\t\tvar answers = [];\n\t\t\t\t\tvar alertMessage;\n\n\t\t\t\t\twizard.find(\".multiple-choice-choice\").each(function() {\n\t\t\t\t\t\tif($(this).hasClass('active')) {\n\t\t\t\t\t\t\tanswers.push($(this).data('value'));\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tif(answers.length == 0) {\n\t\t\t\t\t\tconsole.log(wizard.settings.errors.multiple_choice);\n\t\t\t\t\t\talertMessage = $step.errors && $step.errors.required ? $step.errors.required : wizard.settings.errors.multiple_choice.required;\n\t\t\t\t\t\treturn _stepFailed($step, alertMessage);\n\t\t\t\t\t}\n\t\t\t\t\t$step.given_answer = answers;\n\t\t\t\t\tif(CONFIG.debug) console.log($step.given_answer);\n\t\t\t\t\treturn true;\n\t\t\t\tcase 'form':\n\t\t\t\t\tvar inputs = wizard.find(\"input\");\n\t\t\t\t\tvar answers = [];\n\n\t\t\t\t\tvar stepFailed = false;\n\t\t\t\t\tvar alertMessage;\n\n\t\t\t\t\tinputs.each(function(index) {\n\t\t\t\t\t\tif($(this).val() != \"\") {\n\n\t\t\t\t\t\t\tanswers[index] = $(this).val();\n\t\t\t\t\t\t} else if($(this).data('required')) {\n\t\t\t\t\t\t\tstepFailed = true;\n\t\t\t\t\t\t\talertMessage = $step.errors && $step.errors.required ? $step.errors.required : wizard.settings.errors.form.required;\n\t\t\t\t\t\t\t$(this).css('border-color', 'red');\n\t\t\t\t\t\t\treturn true; // Works as a \"continue\" statement in jQuery each loop.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($(this).attr('type') == 'email') {\n\t\t\t\t\t\t\tvar re = /^([\\w-]+(?:\\.[\\w-]+)*)@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,6}(?:\\.[a-z]{2})?)$/i; // E-Mail regex\n\t\t\t\t\t\t\tif(!re.test($(this).val())) {\n\t\t\t\t\t\t\t\tstepFailed = true;\n\t\t\t\t\t\t\t\t$(this).css('border-color', 'red');\n\t\t\t\t\t\t\t\talertMessage = $step.errors && $step.errors.email ? $step.errors.email : wizard.settings.errors.form.email;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn true; // Works as a \"continue\" statement in jQuery each loop.\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t$step.given_answer = answers;\n\t\t\t\t\tif(CONFIG.debug) console.log($step.given_answer);\n\t\t\t\t\treturn stepFailed ? _stepFailed($step, alertMessage) : true;\n\t\t\t\tcase 'multiple_image_choice':\n\t\t\t\t\tvar answers = [];\n\n\t\t\t\t\tvar $konut_tipi_choices = wizard.find(\".multiple-image-choice\");\n\t\t\t\t\t$konut_tipi_choices.each(function(index) {\n\t\t\t\t\t\tif($(this).data('selected')) {\n\t\t\t\t\t\t\tanswers.push($(this).data('slug'));\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tif(answers.length != 0) {\n\t\t\t\t\t\t$step.given_answer = answers;\n\t\t\t\t\t\tif(CONFIG.debug) console.log($step.given_answer);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\talertMessage = $step.errors && $step.errors.required ? $step.errors.required : wizard.settings.errors.multiple_image_choice.required;\n\t\t\t\t\t\treturn _stepFailed($step, alertMessage);\n\t\t\t\t\t}\n\t\t\t\tcase 'textarea':\n\t\t\t\t\tvar answer = $(\"textarea\").val() ;\n\t\t\t\t\tif(answer) {\n\t\t\t\t\t\t$step.given_answer = answer;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$step.given_answer = \"\";\n\t\t\t\t\t}\n\t\t\t\t\tif(CONFIG.debug) console.log($step.given_answer);\n\t\t\t\t\treturn true; // We are not checking answer in details section.\n\t\t\t}\n\t\t}", "function validate()\r\n{\r\n let question1 = document.getElementById(\"cat-software\");\r\n let question2 = document.getElementById(\"same-room-select\");\r\n let question3 = document.getElementById(\"network-select\");\r\n let questionsArray = new Array(question1, question2, question3);\r\n //console.log(questionsArray);\r\n\r\n if (\r\n question1.value !== \"Choose...\" &&\r\n question2.value !== \"Choose...\" &&\r\n question3.value !== \"Choose...\"\r\n )\r\n {\r\n removeErrorMessage();\r\n handleSelections(question1, question2, question3);\r\n } else\r\n {\r\n for (let i = 0; i < questionsArray.length; i++)\r\n {\r\n if (questionsArray[i].value === \"Choose...\")\r\n {\r\n questionsArray[i].style.color = \"red\";\r\n } // end inner if\r\n } // end for\r\n let answerMissing = document.getElementById(\"instructions\");\r\n let h6 = document.createElement(\"h6\");\r\n removeErrorMessage();\r\n answerMissing.appendChild(h6);\r\n h6.innerHTML =\r\n '<h6 id=\"error\" style=\"color:red;\" >Please answer all questions.</h6>';\r\n } // end else\r\n} // end validate", "function checkSubmission(obj)\n{\n\n //list in the array, the object properties that stores required values\n const requiredFields = [\n \"first-name\",\n \"last-name\",\n \"title\",\n \"email\",\n \"phone\", \n \"company-name\",\n \"company-address\",\n \"company-city\",\n \"company-zip-code\",\n \"workshop-choice\",\n \"vegan\"\n ];\n\n // check if the required fields have values\n for (let i = 0; i< requiredFields.length; i++)\n {\n if (obj[requiredFields[i]] == \"none\")\n {\n errorMsg(requiredFields[i], \"Please fill in this field.\", \"required\", false);\n }\n else\n {\n errorMsg(requiredFields[i], \"\", \"required\", true);\n }\n }\n\n // Check if values with specific format are valid. if not : write on the form the errors to check\n\n // check email address\n // regex taken from https://regexlib.com/REDetails.aspx?regexp_id=174\n const validMail = checkValueFormat(obj[\"email\"], \"^.+@[^\\.].*\\.[a-z]{2,}$\");\n\n if(!validMail)\n {\n errorMsg(\"email\", \"Please enter a valid email: example@email.com\", \"format\", false);\n }\n else\n {\n errorMsg(\"email\", \"\", \"format\", true);\n }\n\n // check phone number\n const validPhone = checkValueFormat(obj[\"phone\"], \"[0-9]{3}-[0-9]{3}-[0-9]{4}$\");\n\n if(!validPhone)\n {\n errorMsg(\"phone\", \"Please enter a valid phone number: 000-000-0000\", \"format\", false);\n }\n else\n {\n errorMsg(\"phone\", \"\", \"format\", true);\n }\n\n //check company zip code\n const validZipCode = checkValueFormat(obj[\"company-zip-code\"], \"^\\\\d{5}$\");\n \n if(!validZipCode)\n {\n errorMsg(\"company-zip-code\", \"Please enter a valid ZIP Code: 00000\", \"format\", false);\n }\n else\n {\n errorMsg(\"company-zip-code\", \"\", \"format\", true);\n }\n\n //check if there's any error detected in the form\n let getErrors = document.querySelectorAll(\"p[class^='error-msg']\");\n\n if(getErrors.length == 0)\n {\n return true;\n }\n else\n {\n return false;\n }\n\n}", "function validate(inputArr) {\n inputArr.forEach((input) => {\n if (input.value.trim() === \"\")\n showError(input, `${returnField(input)} is required`);\n else showSucess(input);\n });\n}", "function validForm(...results) {\n let result = true;\n console.log('checking if the form is valid');\n results.forEach((cur) => {\n // console.log(cur.length);\n if (cur.length < 3) {\n console.log(`${cur} is not valid`);\n result = false;\n }\n });\n return result;\n }", "function inputCheck(i, firstQuestion, invalidInput) {\n \n let correction;\n\n while (i < (firstQuestion + 5)) { // Only checks validity of 5 questions\n let input = document.querySelector(\"#answer\" + i).value;\n correction = document.querySelector(\"#answer\" + i +\"correction\");\n correction.innerHTML = \"\"; // Resets text to empty \n\n document.querySelector(\"#answer\" + i).style = \"background-color:#fff;\"; // Resets bgc to white\n\n try {\n if(input == \"\") throw \"Please answer the question\"; // If left empty, tell to answer\n if(isNaN(input) && typeof(ANSWERS[(i-1)]) == 'number') throw \"Please answer with a number\"; // If they answer with words but should have with a number, tell to answer with number\n if(isFinite(input) && typeof(ANSWERS[(i-1)]) != 'number') throw \"Please answer with a letter/word\"; // If they answer with a number but should have with a word, tell to answer with a word\n } catch (error) {\n correction.innerHTML = error;\n document.querySelector(\"#answer\" + i).style = \"background-color:#f8fcb0;\"; // Changes bgc to yellow\n\n invalidInput++; // Increase the number of answers invalid\n }\n i++;\n }\n alert(invalidInput);\n return invalidInput;\n}", "function validateCreationFormInput(){\n // 1 colecting the data from the form input fields\n const gTitle = document.getElementById('gameTitle');\n const gDescription = document.getElementById('gameDescription');\n const gGenre = document.getElementById('gameGenre');\n const gPublisher = document.getElementById('gamePublisher');\n const gImageUrl = document.getElementById('gameImageUrl');\n const gReleaseDate = document.getElementById('gameRelease');\n \n //2 validating input / display error message if error (validation for user)\n validateFormTextInput(gTitle, \"title\");\n validateFormTextInput(gDescription, \"description\");\n validateFormTextInput(gGenre, \"genre\");\n validateFormTextInput(gPublisher, \"publiser\"); \n validateFormTextInput(gImageUrl, \"imageUrl\");\n validateFormDateInput(gReleaseDate, \"release date\");\n \n //3 saving input data in an array and returning it\n inputArr = [gTitle.value, gImageUrl.value, gDescription.value, gGenre.value, gPublisher.value, gReleaseDate.value]\n return inputArr\n }", "function checkAll(){\n //verificam daca toate intrebarile au fost completate\n let ok=1;\n for(let i=0;i<=answersScoreArray.length;i++)\n if(answersScoreArray[i]===\"NULL\") {alert('Toate intrebarile sunt obligatorii! Reintoarce-te si completeaza intrebarea '+ (i+1) + \"!\"); ok=0; break}\n if(ok===1) show(score);\n}", "function validateDemographics() {\n \n demographics = $('#demo').serializeArray();\n var ok = true;\n \n for (var i = 0; i < demographics.length; i++) {\n // validate age\n if ((demographics[i].name == \"age\") && (/[^0-9]/.test(demographics[i].value)) || demographics[i].value < 18 || demographics[i].value > 100) {\n alert('Please only use numbers from 18 to 100 in age.');\n ok = false;\n break;\n }\n \n // test for empty answers\n if (demographics[i].value === \"\") {\n alert('Please fill out all fields.');\n ok = false;\n break;\n } \n \n }\n \n if (!$(\"input[name='gender']:checked\").val()) {\n alert('Please fill out all fields.');\n ok = false;\n }\n \n\n // goes to next section\n if (!ok) {\n showDemographics();\n } else { \n showPlainLanguageStatement();\n }\n}", "function check_input_filled(e){\n\n e.preventDefault();\n\n var error = \"\",\n curriculum_code = document.getElementById(\"select_curriculum_code\").value,\n skill_1_error = false,\n skill_2_error = false,\n title_1_error = false,\n title_2_error = false;\n if (curriculum_code === \"\"){\n error += \"you need curriculum code \\n\";\n }\n\n // check rubric title 1 & 2 are entered\n var rubric_title_1 = document.getElementById(\"assessment_name1\").value;\n var rubric_title_2 = document.getElementById(\"assessment_name2\").value;\n var title_1_filled = false;\n var title_2_filled = false;\n if (rubric_title_1===\"\"){\n title_1_error = true;\n error+=\"you need to set term 1 rubric title. \\n\";\n }\n\n if (rubric_title_2===\"\"){\n title_2_error = true;\n error+=\"you need to set term 2 rubric title. \\n\";\n }\n\n\n //check form 1 skill items\n var skill_items_1 = document.getElementById(\"check-array1\").querySelectorAll(\".skill-checkbox1\");\n var skill_checked_1 = false;\n for (var i = 0; i < skill_items_1.length; i++) {\n if (skill_items_1[i].checked) {\n skill_checked_1 = true;\n break;\n }\n }\n\n if (skill_checked_1 === false){\n skill_1_error = true;\n }\n\n if (skill_1_error === true) {\n error += \"you need to select skills for term 1 \\n\";\n }\n\n //check form 2 skill item\n var skill_items_2 = document.getElementById(\"check-array2\").querySelectorAll(\".skill-checkbox2\");\n var skill_checked_2 = false;\n for(var i=0; i< skill_items_2.length; i++){\n if (skill_items_2[i].checked) {\n skill_checked_2 = true;\n break;\n }\n }\n if (skill_checked_2 === false){\n skill_2_error = true;\n }\n if (skill_2_error === true){\n error += \"you need to select skills for term 2 \\n\";\n }\n\n if((skill_checked_1 === true)&&(skill_checked_2 === true)&&(error === \"\")){\n var form = document.getElementById(\"rubricform\");\n form.submit();\n }\n else {\n alert(error);\n }\n}", "function validateSubscription(){\n\n // validate specific form elements when keyup fires\n // if all of the below are fully validated then the code blocde will execute\n\n /* separate verifiable items for batch logic\n\n * combining this logic into a simple (one && two && three) wont be feasable\n * because two and three wont evaluate unless one is also true. This is why\n * all of the verifications must be evaluated prior to comparison */\n\n var vName, vMail, vPhone;\n\n var _RS = {verify: 'required', msgFailed: ''}; // shorthand so it takes up less memory\n\n vName = TMvalidator.validateField(subName, [\n _RS,\n {verify: 'full-name-display'},\n {verify: 'length', min: 1, max: 50}\n ], subNameMsg);\n\n vMail = TMvalidator.validateField(subEmail, [\n _RS,\n {verify: 'email'}\n ], subEmailMsg);\n\n vPhone = TMvalidator.validateField(subPhone, [\n _RS,\n {verify: 'phone'}\n ], subPhoneMsg);\n\n if (vName && vMail && vPhone){\n // if all of the above are validated then the form will be submittable\n return true;\n } else {\n return false;\n }\n }", "function validateForm() {\r\n var YES_RADIO_VALUE = 0;\r\n var NO_RADIO_VALUE = 1;\r\n\r\n // check if all fences have been checked yes or no\r\n $(\"input[name^=fence_\").each(function() {\r\n fenceIsChecked = $(this).is(\"checked\"); // is the fence radio button checked?\r\n\r\n // fences are mandatory\r\n if (fenceIsChecked == false) {\r\n $(\"#form_field_error\").html(\"<p style='color:red'>Verður að svara Já eða Nei í öllum girðingum!</p>\");\r\n return false;\r\n }\r\n });\r\n\r\n // all evaluation questions have to be answered but only if all fences have been passed\r\n if(passesFences() == true) {\r\n\r\n var evaluationValue;\r\n $(\"input:hidden[name$='_hidden']\").each(function() {\r\n evaluationValue = $(this).attr(\"value\");\r\n if (evaluationValue == null || evaluationValue == \"\" || evaluationValue == \" \") {\r\n $(\"#form_field_error\").html(\"<p style='color:red'>Verður að svara öllum matsspurningum</p>\");\r\n return false;\r\n }\r\n });\r\n\r\n var review = document.forms[\"EvaluationPaper\"][\"review\"].value;\r\n\r\n // review is mandatory\r\n if (review == null || review == \"\" || review == \" \") {\r\n $(\"#form_field_error\").html(\"<p style='color:red'>Það þarf að skrifa texta í reit fyrir mat!</p>\");\r\n return false;\r\n }\r\n\r\n // propose_acceptance is mandatory\r\n var propose_acceptance = document.forms[\"EvaluationPaper\"][\"propose_acceptance\"].value;\r\n if (propose_acceptance == null || propose_acceptance == \"\" || propose_acceptance == \" \"){\r\n $(\"#form_field_error\").html(\"<p style='color:red'>Verður að svara hvort að mælt sé með að umsókn verði styrkt!</p>\");\r\n return false;\r\n }\r\n\r\n // proposal_discussion is mandatory\r\n var proposal_discussion = document.forms[\"EvaluationPaper\"][\"proposal_discussion\"].value;\r\n if (proposal_discussion == null || proposal_discussion == \"\" || proposal_discussion == \" \"){\r\n $(\"#form_field_error\").html(\"<p style='color:red'>Verður að svara hvort að matsmaður vilji að umsóknin verði rædd á matsfundi</p>\");\r\n return false;\r\n }\r\n }\r\n\r\n $(\"#form_field_error\").html(\" \");\r\n return true;\r\n }", "function validateInputs() {\n\n let isValid = true;\n\n if (workoutType === \"resistance\") {\n if (nameInput.value.trim() === \"\") {\n isValid = false;\n }\n\n if (weightInput.value.trim() === \"\") {\n isValid = false;\n }\n\n if (setsInput.value.trim() === \"\") {\n isValid = false;\n }\n\n if (repsInput.value.trim() === \"\") {\n isValid = false;\n }\n\n if (resistanceDurationInput.value.trim() === \"\") {\n isValid = false;\n }\n } else if (workoutType === \"cardio\") {\n if (cardioNameInput.value.trim() === \"\") {\n isValid = false;\n }\n\n if (durationInput.value.trim() === \"\") {\n isValid = false;\n }\n\n if (distanceInput.value.trim() === \"\") {\n isValid = false;\n }\n }\n\n if (isValid) {\n completeButton.removeAttribute(\"disabled\");\n addButton.removeAttribute(\"disabled\");\n } else {\n completeButton.setAttribute(\"disabled\", true);\n addButton.setAttribute(\"disabled\", true);\n }\n }", "function validateFields() {\n var validated = false;\n for (var i = 0; i < input_list.length; i++) {\n //loop through array of inputs in input_list defined at top of page.\n if (input_list[i].value.toString().trim() != \"\") {\n validated = true;\n }\n }\n return validated;\n}", "function validateForm(){\n let errors = {};\n var emptyDuties ={};\n var emptyPosition ={};\n var emptyTotalHours ={};\n var emptyHourlyRate ={}\n \n emptyDuties = checkEmpty('duties',\"Duties\")\n errors ={...errors,...emptyDuties}\n\n emptyPosition = checkEmpty('position',\"Position\")\n errors ={...errors,...emptyPosition}\n\n emptyTotalHours = checkEmpty('totalHours',\"Total Hours\")\n errors ={...errors,...emptyTotalHours}\n\n emptyHourlyRate = checkEmpty('hourlyRate',\"Hourly Rate\")\n errors ={...errors,...emptyHourlyRate}\n\n console.log(errors)\n \n setErrors(errors); \n}", "function submitAnswers() {\n \n q1 = document.forms [\"quizForm\"][\"question-1\"].value;\n q2 = document.forms [\"quizForm\"][\"question-2\"].value;\n q3 = document.forms [\"quizForm\"][\"question-3\"].value;\n q4 = document.forms [\"quizForm\"][\"question-4\"].value;\n q5 = document.forms [\"quizForm\"][\"question-5\"].value;\n q6 = document.forms [\"quizForm\"][\"question-6\"].value;\n q7 = document.forms [\"quizForm\"][\"question-7\"].value;\n q8 = document.forms [\"quizForm\"][\"question-8\"].value;\n q9 = document.forms [\"quizForm\"][\"question-9\"].value;\n q10 = document.forms [\"quizForm\"][\"question-10\"].value;\n q11 = document.forms [\"quizForm\"][\"question-11\"].value;\n q12 = document.forms [\"quizForm\"][\"question-12\"].value;\n\n\n // Remind user if a question is missed\n // If the user misses more than 1 question, it will remind you the first question out of all the questions you missed.\n for (var i = 1; i <= total; i++) {\n if (eval('q'+i) == null || eval('q'+i) == '') {\n alert ('You missed question ' + [i]);\n // When the submit button is clicked, it will not proceed to clear the screen \n // Exit out of the submit button event listener after reminding the user about the missed questions\n return false;\n }\n }\n\n // Total up the number of correct and incorrect answers\n for (var i = 1; i <= total; i++) {\n if (eval('q'+i) == answers[i-1]) {\n correctAnswers++; \n console.log(correctAnswers); \n }\n\n else {\n wrongAnswers++;\n }\n }\n\n // When the submit button is clicked, proceed to clear the screen to show the correct and incorrect answers\n return true;\n\n}", "function submitForm() {\nvar check = document.getElementsByClassName(\"q1\")\n\nvar select = document.getElementsByClassName(\"q2\")\n\nvar radio = document.getElementsByClassName(\"q3\")\n\n//store element by id to display results later\nvar result = document.getElementById(\"result\")\n\n//create array for checkbox answers this will become the value for var answer1\nvar checkboxesArray = []\n//create variables to eventually hold the users answers\nvar answers1, answers2, answers3\n\n//loop through all check boxes\nfor(var i = 0; i < check.length; i++) {\n\n\t//check if the current checkbox has been checked by the user, then do this\n\tif(check[i].checked) {\n\t\t//add item to checkboxesarray\n\t\tcheckboxesArray.push(check[i].value)\n\t}\n\tconsole.log(checkboxesArray)\n\tanswers1 = checkboxesArray\n}\n//stop function if no data for question1\nif(answers1.length == 0) {\n\t//add a class of success/failure to results\n\tresult.className = \"failure\"\n\t//update text content of results\n\tresult.textContent = \"you forgot to answer question 1\"\n\t//stop function if no answer\n\treturn\n}\n\n//confirm answer 1value\nconsole.log(\"answer 1: \" + answers1)\n\n//loop through select options\nfor (var i = 0; i < select.length; i++) {\n\n\t//check which was selected by the user, do this\n\tif(select[i].selected) {\n\t\t//set value of answer 2 to the value in the selected item\n\t\tanswers2 = select[i].value\n\t}\n}\n\n//stop funtion if no data for question 2\n\tif(answers2 == \"\") {\n\t\t//add a class of success/failure to results\n\t\treslut.className = \"failure\"\n\n\t\t//update the text content of results\n\t\tresult.textContent = \"you forgot to answer question 2\"\n\n\t\t//stop function if no answer\n\t\treturn\n\t}\n\n//confirm answer 2 value\nconsole.log(\"answer 2: \" + answers2)\n\n//loop through radio options\nfor (var i = 0; i < radio.length; i++) {\n\n\t//if the radio was selected by the user do this\n\tif(radio[i].checked) {\n\t\t//set value of answer 3 to the value in the radio item\n\t\tanswers3 = radio[i].value\n\t}\n}\n\n\n//stop funtion if no data for question 3\nif(answers3 == undefined) {\n\t\n\t//add a class of success/failure to results\n\tresult.className = \"failure\"\n\t\n\t//update the text content of results\n\tresult.textContent = \"you forgot to answer question 3\"\n\n\t//stop function if no answer\n\treturn\n}\n\n//confirm answer 3 value\nconsole.log(\"answer 3: \" + answers3)\n\n//create an object from user answers\nvar surveyAnswer = {\n\tchecked: answers1,\n\tselect: answers2,\n\tradio: answers3\n}\n\n//add a class of success to results\nresult.className = \"success\"\n\n//update the text content of results upon survey completion\nresult.textContent =\"Thanks for completing the Survey\"\n\n//confirm new objects existence\nconsole.log(\"current survey answers: #1 \" + surveyAnswer.checked + \" #2 \" + surveyAnswer.selected + \" #3 \" + surveyAnswer.radio)\n\n\n//add surveyAnswers to surveyArray\nsurveyArray.push(surveyAnswer)\n\n//check survey array to confirm new object\nconsole.log(surveyArray)\n\n//reset form for next user\nform.reset()\n}", "function submitResults() {\n\tif ( conditionsMet() ) {\n\t\tdisplayForm(\"#form\");\n\t}\n\telse {\n\t\talert(\"One of the sets is empty! Each set must contain at least one number.\");\n\t}\n}", "function checkInputs(){\r\n const fNameValue = fName.value.trim();\r\n const lNameValue = lName.value.trim();\r\n const addressValue =address.value.trim();\r\n const cityValue =city.value.trim();\r\n //const vValue =state.value.trim();\r\n const zipValue = zip.value.trim();\r\n const dobValue = dob.value.trim();\r\n const phoneValue = phone.value.trim();\r\n const emailRValue = emailR.value.trim();\r\n const passwordValue = password.value.trim();\r\n \r\n if(fNameValue === '')\r\n {\r\n setErrorFor(fName)\r\n }else{\r\n setSuccessFor(fName);\r\n }\r\n\r\n if(lNameValue === '')\r\n {\r\n setErrorFor(lName)\r\n }else{\r\n setSuccessFor(lName);\r\n }\r\n\r\n if(addressValue === '')\r\n {\r\n setErrorFor(address)\r\n }else{\r\n \r\n setSuccessFor(address);\r\n }\r\n\r\n if(cityValue === '')\r\n {\r\n setErrorFor(city)\r\n }else{\r\n \r\n setSuccessFor(city);\r\n }\r\n\r\n if(zipValue === '')\r\n {\r\n setErrorFor(zip)\r\n }else{\r\n \r\n setSuccessFor(zip);\r\n }\r\n\r\n if(dobValue === '')\r\n {\r\n setErrorFor(dob)\r\n }else{\r\n \r\n setSuccessFor(dob);\r\n console.log(dobValue)\r\n }\r\n\r\n if(phoneValue === '')\r\n {\r\n setErrorFor(phone)\r\n }else{\r\n \r\n setSuccessFor(phone);\r\n }\r\n\r\n if(emailRValue === '')\r\n {\r\n setErrorFor(emailR)\r\n }else if(!isEmail(emailRValue)){\r\n setErrorFor(emailR)\r\n \r\n }else{\r\n setSuccessFor(emailR);\r\n }\r\n\r\n if(passwordValue === '')\r\n {\r\n setErrorFor(password)\r\n }else{\r\n setSuccessFor(password);\r\n }\r\n}", "validationCheckMethod() {\n const allValid1 = [\n ...this.template.querySelectorAll(\".reqData\")\n ].reduce((validSoFar, inputCmp) => {\n inputCmp.reportValidity();\n return validSoFar && inputCmp.checkValidity();\n }, true);\n return allValid1;\n }", "function validatePostQuestions() {\n\n postQuestionsAnswers = $('#postQuestions').serializeArray();\n\n // test for empty answers \n if (!$(\"input[name='postQuestion1']:checked\").val()) {\n alert('Please answer the first question.');\n showPostQuestions;\n } else { \n saveParticipantData();\n showDebrief();\n }\n \n}", "function userInput(){ \n everythingOk = false; \n while(everythingOk === false){\n // answer = inputLength(); \n upCaseRslt = upCase();\n lcase = lowCase(); \n numAnsr = numOpt();\n symbolAnswer = simbl(); \n if(upCaseRslt === false && lcase === false && numAnsr === false && symbolAnswer === false){\n alert(\"at least one option must be checked in order to create password\"); \n }else{ \n everythingOk = true; \n } \n } \n }", "function validateInputs() {\n if ($(\"input[type='radio']:checked\").val() && $age.val().length > 0 && $weight.val().length > 0 && ($heightInput.val().length > 0 || $heightInputIn.val().length > 0))\n return true;\n else\n return false;\n }", "function validation() {\r\n\t\t\r\n\t}", "function validateFieldsIF(){\n \n console.log(\"ENTRA\");\n var floraName = document.getElementById('txtFlora');\n var abundance = document.getElementById('txtAbundance');\n var floweringPeriod = document.getElementById('txtFloweringPeriod');\n var park = document.getElementById('txtPark');\n var description = document.getElementById('txtDescription');\n var emptyName = false, emptyAbundance = false, emptyFloweringPeriod = false, \n emptyPark = false, emptyDescription = false;\n \n if(floraName.value.length < 2){// está vacio\n document.getElementById('msgErrorName').style.visibility = \"visible\";\n emptyName = true;\n }else{\n document.getElementById('msgErrorName').style.visibility = \"hidden\";\n }//end else \n \n if(abundance.value.length < 2){//está vacia\n document.getElementById('msgErrorAbundance').style.visibility = \"visible\";\n emptyLocation = true;\n }else{\n document.getElementById('msgErrorAbundance').style.visibility = \"hidden\";\n }//end else\n \n if(floweringPeriod.value.length < 2){//está vacia\n document.getElementById('msgErrorFloweringPeriod').style.visibility = \"visible\";\n emptyFloweringPeriod = true;\n }else{\n document.getElementById('msgErrorFloweringPeriod').style.visibility = \"hidden\";\n }//end else\n \n if(park.value.length < 2){//está vacia\n document.getElementById('msgErrorPark').style.visibility = \"visible\";\n emptyPark = true;\n }else{\n document.getElementById('msgErrorPark').style.visibility = \"hidden\";\n }//end else\n \n if(description.value.length < 2){//La locacion está vacia\n document.getElementById('msgErrorDescription').style.visibility = \"visible\";\n emptyDescription = true;\n }else{\n document.getElementById('msgErrorDescription').style.visibility = \"hidden\";\n }//end else\n \n if(emptyAbundance === true || emptyDescription === true || emptyFloweringPeriod === true || \n emptyName === true || emptyPark === true){\n return false;\n }else{\n return true;\n }\n}", "function lawsuitInsertValidation()\n{\n var errors = [];\n\n if ($(\"#datepicker\").val() == '')\n {\n errors.push(\"Morate uneti datum parnice\");\n return errors;\n }\n if ($(\"#lawsuitProcessId\").val() == '')\n {\n errors.push(\"Morate uneti identifikator parnice\");\n return errors;\n }\n if ($(\"#lawsuitCourtroom\").val() == '' || $(\"#lawsuitCourtroom\").val().length > 5)\n {\n errors.push(\"Morate uneti broj sudnice ili broj sudnice ima vise od 5 karaktera\");\n return errors;\n }\n if ($(\".lawsuitLocation\").children(\"option:selected\").html() == \"Izaberite lokaciju\" ||\n $(\".lawsuitJudge\").children(\"option:selected\").html() == \"Izaberite sudiju\")\n {\n errors.push(\"Niste izabrali sve stavke parnice\");\n return errors;\n }\n if ($(\".lawsuitProsecutor\").children(\"option:selected\").html() == \"Izaberite tuzioca\" || $(\".lawsuitDefendant\").children(\"option:selected\").html() == \"Izaberite tuzenika\" ||\n $(\".lawsuitProcessType\").children(\"option:selected\").html() == \"Izaberite postupak\")\n {\n errors.push(\"Niste izabrali sve stavke parnice\");\n return errors;\n }\n if ($(\".lawsuitLawyers\").val().length === 0)\n {\n errors.push(\"Niste izabrali nijednog advokata\");\n return errors;\n }\n}", "function onSubmit(){\n\tvar result = true;\n\tresult = checkFirstName() && result;\n\tresult = checkLastName() && result;\n\tresult = checkHan() && result;\n\tresult = checkEmail() && result;\n\tresult = checkPhone() && result;\n\treturn result;\n}", "function verifyFields(){\n let fieldTexts = document.getElementsByClassName('input-field');\n let hasAllvalues = true;\n for(let i = 0; i < fieldTexts.length; i++){\n if(!fieldTexts[i].value){\n hasAllvalues = false;\n }\n }\n return hasAllvalues;\n}", "function checkInputs(arr, thisButton, answer){\n var counter = 0;\n\n //wildChar shows one other specific Character that the string should have, like . or =\n\n for(var i=0; i< arr.length; i++){\n /*http://stackoverflow.com/questions/17938186/trimming-whitespace-from-the-end-of-a-string-only-with-jquery*/\n var trimmedAns= $(arr[i][0]).val().replace(/\\s*$/,\"\");\n var wrongPhrase = '';\n var falsePos = '';\n\n //check if it contains all key phrases\n for(var j=0; j < arr[i][1].length; j++){\n var activeChar= arr[i][1][j];\n if(trimmedAns.indexOf(activeChar) == -1){\n wrongPhrase = activeChar;\n break;\n }\n }\n\n // this is for the Characters we don't want to see in there\n for(var l=0; l < arr[i][2].length; l++){\n var activeChar= arr[i][2][l];\n if(trimmedAns.indexOf(activeChar) > -1)\n falsePos = activeChar;\n }\n\n // make sure we save original err msg\n var origMsg= $(thisButton).siblings('.warn').text();\n\n // if it has both correct property name and value, and semi and colon are in there\n if(falsePos.length ==0 && wrongPhrase.length ==0)\n counter++\n else if(wrongPhrase.length > 1 && wrongCount == 0){\n $(thisButton).siblings('.warn').text('Did you spell everything correctly in answer '+(i+1)+'? Attempts Remaining: ' +(5-wrongCount)).show('slide');\n $(arr[i][0]).effect('highlight');\n wrongCount++;\n }\n else if(wrongPhrase.length > 1 && wrongCount > 0){\n $(thisButton).siblings('.warn').text('I think you are missing ' + wrongPhrase + ' in answer ' +(i+1)+ '. Attempts Remaining: ' +(5-wrongCount) ).show('slide');\n $(arr[i][0]).effect('highlight');\n wrongCount++;\n }\n else if(wrongPhrase.length == 1 && wrongCount == 0){\n $(thisButton).siblings('.warn').text('Did you remember all the correct syntax? Attempts Remaining: ' +(5-wrongCount)).show('slide');\n $(arr[i][0]).effect('highlight');\n wrongCount++;\n }\n else if(wrongPhrase.length == 1 && wrongCount > 0){\n $(thisButton).siblings('.warn').text('I think you forgot to include '+wrongPhrase + ' in answer ' +(i+1) + '. Attempts Remaining: ' +(5-wrongCount)).show('slide');\n $(arr[i][0]).effect('highlight');\n wrongCount++;\n }\n else if(falsePos.length > 0 && wrongCount == 0){\n $(thisButton).siblings('.warn').text('You included a character that should not be in there in answer ' +(i+1)+'! Attempts Remaining: ' +(5-wrongCount)).show('slide');\n $(arr[i][0]).effect('highlight');\n wrongCount++;\n }\n else if(falsePos.length > 0 && wrongCount > 0){\n $(thisButton).siblings('.warn').text('You included ' +falsePos+ ' in answer '+(i+1)+', which should not be in there. Attempts Remaining: ' +(5-wrongCount) ).show('slide');\n $(arr[i][0]).effect('highlight');\n wrongCount++;\n }\n //this case should never happen but fuck it I am leaving it in there\n else{\n $(thisButton).siblings('.warn').text(origMsg).show('slide');\n $(arr[i][0]).effect('highlight');\n wrongCount++;\n }\n\n //user has gotten it wrong three times or more\n if (wrongCount > 5){\n //put it in a span so the answer looks distinct\n if(answer.length == 1)\n $(thisButton).siblings('.warn').html(\"The answer is- <span>\"+answer[0]+\"</span>\").show('slide');\n else{\n $(thisButton).siblings('.warn').html(\"The answer is- <span>\"+answer[0]+\"</span><span>\"+answer[1]+\"</span>\").show('slide');\n }\n }\n }\n\n if(counter === arr.length){\n wrongCount=0;\n $(thisButton).siblings('.warn').hide()\n\n // enable continue button\n $('.advanceBtn:visible').css('pointer-events', 'auto');\n $('.advanceBtn:visible').css('background-color', 'green');\n $('.advanceBtn:visible').css('opacity', '1');\n\n // this needs to be outside the function below due to setTimeout\n //http://stackoverflow.com/questions/5226285/settimeout-in-for-loop-does-not-print-consecutive-values\n function setTheFields(i){\n var startTime = 2000 * i\n var endTime= 2000 * (i+1);\n setTimeout(function(){\n $('.interactme:visible').find('.userIn').eq(i).parent().siblings('.codeExp').css('opacity', '0')\n $('.interactme:visible').find('.userIn').eq(i).children('span').first().trigger('mouseover')\n }, startTime)\n setTimeout(function(){\n $('.interactme:visible').find('.userIn').eq(i).parents().eq(1).trigger('mouseleave')\n $('.interactme:visible').find('.userIn').eq(i).parent().siblings('.codeExp').css('opacity', '1')\n }, endTime)\n }\n\n // do all animations with delay in between\n for(var i=0; i< arr.length; i++){\n setTheFields(i);\n }\n\n }\n}", "function validateInputs() {\n // setting the isValid variable to true \n let isValid = true;\n\n // if the user chooses resistance \n if (workoutType === \"resistance\") {\n\n // if the name input of exercise form is left blank \n if (nameInput.value.trim() === \"\") {\n // set isValid to false \n isValid = false;\n }\n\n // if the weight input of exercise form is left blank \n if (weightInput.value.trim() === \"\") {\n // set isValid to false \n isValid = false;\n }\n\n // if the sets input of the exercise form is left blank \n if (setsInput.value.trim() === \"\") {\n // set isValid to false \n isValid = false;\n }\n\n // if the reps input of the exercise form is left blank \n if (repsInput.value.trim() === \"\") {\n // set isValid to false \n isValid = false;\n }\n\n // if the resistance input of the exercise form is left blank \n if (resistanceDurationInput.value.trim() === \"\") {\n // set isValid to false \n isValid = false;\n }\n\n // if the user chooses resistance \n } else if (workoutType === \"cardio\") {\n\n // if the name input of the exercise form is left blank \n if (cardioNameInput.value.trim() === \"\") {\n // set isValid to false \n isValid = false;\n }\n\n // if the duration input of the exercise form is left blank \n if (durationInput.value.trim() === \"\") {\n // set isValid to false \n isValid = false;\n }\n\n // if the distance input of the exercise form is left blank \n if (distanceInput.value.trim() === \"\") {\n // set isValid to false \n isValid = false;\n }\n }\n\n // if isValid is true \n if (isValid) {\n // enable the complete and add exercise button \n completeButton.removeAttribute(\"disabled\");\n addButton.removeAttribute(\"disabled\");\n\n // if isValid is false \n } else {\n // disable the complete and add exercise button \n completeButton.setAttribute(\"disabled\", true);\n addButton.setAttribute(\"disabled\", true);\n }\n}", "function validate_form() {\n\t\tvar numbers = new Set();\n\t\tscroll = 0;\n\t\tfor (i = 1; i < 19; i++) {\n\t\t\t$(\"#q\" + i).css(\"border\", \"2px solid white\");\n\t\t\tfor (j = 1; j < 5; j++) {\n\t\t\t\tname = \"q\" + i + \"a\" + j;\n\t\t\t\tif ($(\"input[name='\" + name + \"']:checked\").length == 0) {\n\t\t\t\t\tnumbers.add(i);\n\t\t\t\t\t$(\"#q\" + i).css(\"border\", \"2px solid red\");\n\t\t\t\t\tif (scroll == 0) {\n\t\t\t\t\t\tvar top = $('#q' + i).position().top;\n\t\t\t\t\t\t$(window).scrollTop( top - 75); //Offset because header blocks some of screen\n\t\t\t\t\t\tscroll = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn numbers;\n\t}", "validateAll () {\n for (let fieldID of Object.keys(this.fields)) {\n this.fields[fieldID].validate()\n }\n }", "function validateAgentForm(){\n let messageList= [\"firstname\", \"lastname\", \"email\", \"phonenumber\", \"postalcode\", \"address\", \"city\", \"province\"];\n return validateFieldInput(messageList[0]) && validateFieldInput(messageList[1]) && validateFieldInput(messageList[2]) && validateFieldInput(messageList[3]) && validateFieldInput(messageList[9] && validateFieldInput(messageList[10]));\n}", "function checkInputsValue() {\n if (inputBookTitleEl.value === \"\" && inputBookAuthorEl.value === \"\")\n alert(\"Please fill the 2 fields before submiting!\");\n else {\n setItemInLocalStorage();\n }\n}", "function validateAllInputs() {\n // first, clear out warning box\n clearWarnings();\n\n // username: lowercase letters, numbers, between 4-12 characters\n let userName = document.getElementById('username').value;\n let userNameIsValid = /^[a-z0-9]{4,12}$/.test(userName);\n\n // email: contains @, ends in .net/.org/.com/.edu\n let email = document.getElementById('email').value;\n let emailIsValid = /^.+@.+\\.(net|com|org|edu)$/.test(email);\n\n // phone number: format XXX-XXX-XXXX\n let phoneNumber = document.getElementById('phone').value;\n let phoneNumberIsValid = /^([0-9]{3}-){2}[0-9]{4}$/.test(phoneNumber);\n\n // password: 1 uppercase, 1 lowercase, 1 number, 1 special character\n let password = document.getElementById('password').value;\n let passwordIsValid = (/^.*[A-Z].*$/.test(password) &&\n /^.*[a-z].*$/.test(password) &&\n /^.*[0-9].*$/.test(password) &&\n /^.*[^A-Za-z0-9].*$/.test(password));\n\n // confirm password: must be same as password\n let confirmPassword = document.getElementById('confirm-password').value;\n let confirmPasswordIsValid = (confirmPassword === password);\n\n // gender: one of the three radio buttons must be checked\n let genderButtons = document.getElementsByName('gender');\n let gender = null;\n for (const button of genderButtons) {\n if (button.checked) {\n gender = button.id;\n break;\n }\n }\n let genderIsValid = (gender != null);\n\n // birthday: all three birthdays must not be empty\n let birthdayMonth = document.getElementById('month').value;\n let birthdayDate = document.getElementById('day').value;\n let birthdayYear = document.getElementById('year').value;\n let birthdayIsValid = (birthdayYear !== \"none\" && birthdayMonth !== \"none\" && birthdayDate !== \"none\");\n\n // music: at least one checkbox is checked\n let popChecked = document.getElementById('pop').checked;\n let hiphopChecked = document.getElementById('hiphop').checked;\n let jazzChecked = document.getElementById('jazz').checked;\n let rockChecked = document.getElementById('rock').checked;\n let classicalChecked = document.getElementById('classical').checked;\n let countryChecked = document.getElementById('country').checked;\n let musicIsValid = (popChecked || hiphopChecked || jazzChecked || rockChecked\n || classicalChecked || countryChecked);\n\n // Debug statements, comment out before release\n console.log('Username ' + userName + (userNameIsValid ? \" is valid\" : \" is not valid\"));\n console.log('Email ' + email + (emailIsValid ? \" is valid\" : \" is not valid\"));\n console.log('Phone number ' + phoneNumber + (phoneNumberIsValid ? \" is valid\" : \" is not valid\"));\n console.log('Password ' + password + (passwordIsValid ? \" is valid\" : \" is not valid\"));\n console.log('Confirm password ' + confirmPassword + (confirmPasswordIsValid ? \" is valid\" : \" is not valid\"));\n console.log('Gender ' + gender + (genderIsValid ? \" is valid\" : \" is not valid\"));\n console.log('Birthday' + (birthdayIsValid ? \" is valid\" : \" is not valid\"));\n console.log('Music' + (musicIsValid ? \" is valid\" : \" is not valid\"));\n\n // check confirm password LAST\n let inputsAreValid = userNameIsValid && emailIsValid && phoneNumberIsValid &&\n passwordIsValid && genderIsValid && birthdayIsValid && musicIsValid;\n if (inputsAreValid) {\n if (confirmPasswordIsValid) {\n window.location.replace('index.html');\n } else {\n window.alert(\"Passwords do not match.\");\n }\n } else {\n // else, we need to add messages for everything that's borked\n let redText = \"<span style='color: red; font-weight:bold;'>\";\n let orangeText = \"<span style='color: orange; font-weight:bold;'>\";\n\n if (!userNameIsValid) {\n if (userName === \"\") {\n addWarningMessage(\"Please enter \" + redText + \" a username </span>\");\n } else {\n addWarningMessage(\"Please enter \" + orangeText + \" a valid username </span>\");\n }\n }\n if (!emailIsValid) {\n if (email === \"\") {\n addWarningMessage(\"Please enter \" + redText + \" an email address </span>\");\n } else {\n addWarningMessage(\"Please enter \" + orangeText + \" a valid email address </span>\");\n }\n }\n if (!phoneNumberIsValid) {\n if (phoneNumber === \"\") {\n addWarningMessage(\"Please enter \" + redText + \" a phone number </span>\");\n } else {\n addWarningMessage(\"Please enter \" + orangeText + \" a valid phone number </span>\");\n }\n }\n if (!passwordIsValid) {\n if (password === \"\") {\n addWarningMessage(\"Please enter \" + redText + \" a password </span>\");\n } else {\n addWarningMessage(\"Please enter \" + orangeText + \" a valid password </span>\");\n }\n }\n if (!genderIsValid) {\n addWarningMessage(\"Please select \" + redText + \" a gender </span>\");\n }\n if (!birthdayIsValid) {\n addWarningMessage(\"Please select \" + redText + \" a birthday </span>\");\n }\n if (!musicIsValid) {\n addWarningMessage(\"Please select \" + redText + \" at least one favorite music genre </span>\");\n }\n }\n}", "function f_submit()\n{\n var message = \"\";\n for(var i=0 ; i < this.elements.length ; i++) {\n\tif ( this.elements[i].validationset ) {\n\t var txt = this.elements[i].validationset.run();\n\t if ( txt.length > 0 ) {\n\t\tif ( message.length > 0 ) {\n\t\t message += \"\\n\";\n\t\t}\n\t\tmessage += txt;\n\t }\n\t}\n }\n if(this.uservalidator) {\n\tstr =\" var ret = \"+this.uservalidator+\"()\";\n\teval(str);\n\tif ( ret.length > 0 ) {\n\t if ( message.length > 0 ) {\n\t\tmessage += \"\\n\";\n\t }\n\t message += txt;\n\t}\n }\n if ( message.length > 0 ) {\n\talert(\"Input Validation Errors Occurred:\\n\\n\" + message);\n\treturn false;\n } else {\n\treturn true;\n }\n}", "function verify() {\r\n\tif(nameCheck())\r\n\t{\r\n\t\tconsole.log(\"Name Check Verified!\");\r\n\t\tif(emailCheck())\r\n\t\t{\r\n\t\t\tconsole.log(\"Email Check Verified!\");\r\n\t\t\tif(radioCheck())\r\n\t\t\t{\r\n\t\t\t\tconsole.log(\"Radio Check Verified!\");\r\n\t\t\t\tconsole.log(\"All Data Verified Successfully!\");\r\n\t\t\t\talert(\"Data Verified and Submitted!\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tconsole.log(\"Please Re-enter proper data again!\");\r\n\treturn false;\r\n}", "function validateActivity(){\n var text_es = document.getElementById('text_es').value;\n var text_eu = document.getElementById('text_eu').value;\n var text_en = document.getElementById('text_en').value;\n var title_es = document.getElementById('title_es').value;\n var title_eu = document.getElementById('title_eu').value;\n var title_en = document.getElementById('title_en').value;\n result = true;\n \n //Spanish fields empty\n if (title_es.length < 1){\n result = false;\n alert(\"Introduce un titulo en castellano\");\n return false;\n }\n if (text_es.length < 1){\n result = false;\n alert(\"Introduce un texto en castellano\");\n return false;\n }\n //Titles without texts\n if (title_eu.length > 0 && text_eu.length < 1){\n result = false;\n alert(\"Introduce un texto o borra el titulo en euskera\")\n return false;\n }\n if (title_en.length > 0 && text_en.length < 1){\n result = false;\n alert(\"Introduce un texto o borra el titulo en ingles\")\n return false;\n }\n //Text without titles\n if (text_eu.length > 0 && title_eu.length < 1){\n result = false;\n alert(\"Introduce un titulo o borra el texto en euskera\")\n return false;\n }\n if (text_en.length > 0 && title_en.length < 1){\n result = false;\n alert(\"Introduce un titulo o borra el texto en ingles\")\n return false;\n }\n // TODO: check date\n // TODO: check numeric fields price, people\n return true;\n}", "function validateInput(){\n\n // retrieving input\n var title = document.getElementById('title').value\n var consent = document.getElementById('consent').value\n var emotions = document.getElementById('emotion').value\n var intensity = document.getElementById('intensity').value\n var all_pre = document.getElementsByClassName('preQ')\n var all_post = document.getElementsByClassName('postQ')\n\n // for title\n var title_input = document.getElementById('title')\n var title_label = document.getElementById('title_error') \n if (title.replace(/ /g,'') == \"\"){\n title_label.innerHTML = \"Please Enter a Title for your session!\"\n title_label.style.visibility = 'visible'\n title_input.style.border = \"solid red\"\n test_title = false\n }\n else{\n title_label.style.visibility = 'hidden'\n title_input.style.border = \"none\"\n test_title = true\n }\n\n // for consent\n var consent_input = document.getElementById('consent')\n var consent_label = document.getElementById('consent_error')\n if (consent.replace(/ /g,'') == \"\"){ \n consent_label.innerHTML = \"Please enter the Consent Agreement for your session!\"\n consent_label.style.visibility = 'visible'\n consent_input.style.border = \"solid red\"\n test_consent = false\n }\n else{\n consent_label.style.visibility = 'hidden'\n consent_input.style.border = \"none\"\n test_consent = true\n }\n \n // for prequestion\n if (all_pre.length != 0){\n var temp = []\n for (i = 0; i<all_pre.length; i ++){\n var id = all_pre[i].id.split('t')[1]\n var pre_input = document.getElementById('t' + id)\n var pre_label = document.getElementById('preq_error' + id)\n if(all_pre[i].value.replace(/ /g,'') == \"\"){\n pre_label.innerHTML = \"Please enter the Prequestion for your session!\"\n pre_label.style.visibility = 'visible'\n pre_input.style.border = \"solid red\"\n temp.push(false)\n }\n else{\n pre_label.style.visibility = 'hidden'\n pre_input.style.border = \"none\"\n temp.push(true)\n }\n }\n if (temp.includes(false) == true){\n test_pre = false\n }\n else{\n test_pre = true\n }\n }\n else{\n test_pre = true\n }\n \n // for emotions\n var emotions_input = document.getElementById('emotion')\n var emotions_label = document.getElementById('emotions_error')\n if (emotions.replace(/ /g,'') == \"\"){\n \n emotions_label.innerHTML = \"Please enter the Emotion(s) for your session!\"\n emotions_label.style.visibility = 'visible'\n emotions_input.style.border = \"solid red\"\n test_emotions = false\n }\n else{\n emotions_label.style.visibility = 'hidden'\n emotions_input.style.border = \"none\"\n test_emotions = true\n }\n\n // for intensity\n var intensity_input = document.getElementById('intensity')\n var intensity_label = document.getElementById('intensity_error')\n if (intensity < 3 || intensity > 12){\n intensity_label.innerHTML = \"Please enter a number from 3-12 as the Intensity for your session!\"\n intensity_label.style.visibility = 'visible'\n intensity_input.style.border = \"solid red\"\n test_intensity = false\n }\n else{\n intensity_label.style.visibility = 'hidden'\n intensity_input.style.border = \"none\"\n test_intensity = true\n }\n\n // for postquestion\n if (all_post.length != 0){\n var temp = []\n for (i = 0; i<all_post.length; i ++){\n var id = all_post[i].id.split('t')[1]\n var post_input = document.getElementById('t' + id)\n var post_label = document.getElementById('postq_error' + id)\n if(all_post[i].value.replace(/ /g,'') == \"\"){\n post_label.innerHTML = \"Please enter the Postquestion for your session!\"\n post_label.style.visibility = 'visible'\n post_input.style.border = \"solid red\"\n temp.push(false)\n }\n else{\n post_label.style.visibility = 'hidden'\n post_input.style.border = \"none\"\n temp.push(true)\n }\n }\n if (temp.includes(false) == true){\n test_post = false\n }\n else{\n test_post = true\n }\n }\n else{\n test_post = true\n }\n\n if (test_title != null && test_consent != null && test_emotions != null && test_intensity == true && test_pre == true && test_post == true ){\n return true\n }\n else{\n return false\n }\n\n}", "function validate(){\n\n\t\t//TODO: make this work\n\n\n\t}", "function validateInputs() {\n let isValid = true;\n\n // validation for resistance workouts\n if (workoutType === \"resistance\") {\n // name of workout is required (cannot be empty string)\n if (nameInput.value.trim() === \"\") {\n isValid = false;\n }\n // weights are required\n if (weightInput.value.trim() === \"\") {\n isValid = false;\n }\n // sets are required\n if (setsInput.value.trim() === \"\") {\n isValid = false;\n }\n // reps are required\n if (repsInput.value.trim() === \"\") {\n isValid = false;\n }\n // duration is required\n if (resistanceDurationInput.value.trim() === \"\") {\n isValid = false;\n }\n } // validation for cardio workouts\n else if (workoutType === \"cardio\") {\n // name is required input\n if (cardioNameInput.value.trim() === \"\") {\n isValid = false;\n }\n // duration is required input \n if (durationInput.value.trim() === \"\") {\n isValid = false;\n }\n // distance is required input\n if (distanceInput.value.trim() === \"\") {\n isValid = false;\n }\n }\n // if all inputs for workout are valid,\n // enable buttons to \"complete\" the workout or \"add exercise\"\n if (isValid) {\n completeButton.removeAttribute(\"disabled\");\n addButton.removeAttribute(\"disabled\");\n } else {\n completeButton.setAttribute(\"disabled\", true);\n addButton.setAttribute(\"disabled\", true);\n }\n}", "function validate()\n{\n select = [\"breed\", \"age\"];\n radio = [\"gender\", \"childFriendly\", \"petFriendly\"];\n \n // SELECT \n for(var i = 0; i < select.length; i++)\n if(document.getElementsByName(select[i])[0].value == \"\")\n {\n document.getElementById(select[i]).innerHTML = \"Please select a value\";\n document.getElementById(\"submit\").innerHTML = \"Incorrect Input\";\n return false;\n }\n \n // RADIO\n for(var j = 0; j < radio.length; j++)\n {\n //if no radio buttons are checked\n if(!anyChecked(radio[j]))\n {\n document.getElementById(radio[j]).innerHTML = \"Please select a value\";\n document.getElementById(\"submit\").innerHTML = \"Incorrect Input\";\n return false;\n }\n }\n return true;\n}", "function validateForm(){\n\t\n\tvar boo1 = validateLabPerson();\n\tvar boo2 = validateBioPerson();\n\tvar boo3 = validatePI();\n\tvar boo4 = validateBillTo();\n\tvar boo5 = validateRunType();\n\n\tvar boo6 = validateAllTables();\n//\tvar boo6 = true;\n\n\tvar boo7 = validateDate();\n\tvar boo8 = validateIAccept();\n\n\tvar boo9 = validateConcentrationUnit();\n\tvar boo10 = validateTubesAndLanes();\n\t\n//\talert(\"boo1 = \" + boo1 + \" boo2 = \" + boo2 + \" boo3 = \" + boo3 + \" boo4 = \" + boo4 +\" boo5 = \" + boo5 +\" boo6 = \" + boo6 + \" boo7 = \" + boo7 + \" boo8 = \" + boo8 + \" boo9 = \" + boo9 + \" boo10 = \" + boo10);\n\tif (boo1 && boo2 && boo3 && boo4 && boo5 && boo6 && boo7 && boo8 && boo9 && boo10){\t\n//\tif(validateLabPerson() && validateBioPerson() && validatePI() && validateBillTo() && validateRunType() && validateTable()){\n\t\t//insert fields used to generate csv\n\t\tinsertTableSize();\t\t\t\t\t// insert size of all table - used when generating csv file\n\t\tgenerateOrderNoteID();\t\t\t\t// insert orderNoteID\n\t\taddPI2TubeTag();\t\t\t\t\t// indsæt \"de tre tegn\" (fra PI) i tubetaggen.\n\t\tsetVersion();\t\t\t\t\t\t// insert the version number in the hidden field.\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n\t\n\treturn false;\n}", "function validateFieldsUF(){\n \n\n var floraName = document.getElementById('txtFlora');\n var abundance = document.getElementById('txtAbundance');\n var floweringPeriod = document.getElementById('txtFloweringPeriod');\n var park = document.getElementById('txtPark');\n var description = document.getElementById('txtDescription');\n var emptyName = false, emptyAbundance = false, emptyFloweringPeriod = false, \n emptyPark = false, emptyDescription = false;\n \n if(floraName.value.length < 2){// está vacio\n document.getElementById('msgErrorName').style.visibility = \"visible\";\n emptyName = true;\n }else{\n document.getElementById('msgErrorName').style.visibility = \"hidden\";\n }//end else \n \n if(abundance.value.length < 2){//está vacia\n document.getElementById('msgErrorAbundance').style.visibility = \"visible\";\n emptyLocation = true;\n }else{\n document.getElementById('msgErrorAbundance').style.visibility = \"hidden\";\n }//end else\n \n if(floweringPeriod.value.length < 2){//está vacia\n document.getElementById('msgErrorFloweringPeriod').style.visibility = \"visible\";\n emptyFloweringPeriod = true;\n }else{\n document.getElementById('msgErrorFloweringPeriod').style.visibility = \"hidden\";\n }//end else\n \n if(park.value.length < 2){//está vacia\n document.getElementById('msgErrorPark').style.visibility = \"visible\";\n emptyPark = true;\n }else{\n document.getElementById('msgErrorPark').style.visibility = \"hidden\";\n }//end else\n \n if(description.value.length < 2){//La locacion está vacia\n document.getElementById('msgErrorDescription').style.visibility = \"visible\";\n emptyDescription = true;\n }else{\n document.getElementById('msgErrorDescription').style.visibility = \"hidden\";\n }//end else\n \n if(emptyAbundance === true || emptyDescription === true || emptyFloweringPeriod === true || \n emptyName === true || emptyPark === true){\n return false;\n }else{\n return true;\n }\n}//end validateFieldsUF", "function formValidator() {\n //create object that will save user's input (empty value)\n let feedback = [];\n //create an array that will save error messages (empty)\n let errors = [];\n //check if full name has a value\n if (fn.value !== ``){\n //if it does, save it\n feedback.fname = fn.value; \n }else {\n //if it doesn't, crete the error message and save it\n errors.push(`<p>Invalid Full Name</p>`);\n }\n \n //for email\n if (em.value !== ``){\n feedback.email = em.value;\n //expression.test(String('my-email@test.com').toLowerCase()); \n }else {\n errors.push(`<p>Invalid Email</p>`);\n }\n\n //for message\n if (mes.value !== ``){\n feedback.message = mes.value;\n }else {\n errors.push(`<p>Write a comment</p>`)\n }\n \n //create either feedback or display all errors\n if (errors.length === 0) {\n console.log(feedback);\n }else {\n console.log(errors);\n }\n //close event handler\n}", "validateInputs() {\n let inps = [].concat(\n this.queryAll(\"lightning-combobox\"),\n this.queryAll(\"lightning-input-field\"),\n );\n return inps.filter(inp => !inp.reportValidity()).length === 0;\n }", "function validateReq(){\r\n\t\t//Variables\r\n\t\tvar name = document.survey_form.name;\r\n\t\tvar age = document.survey_form.age;\r\n\t\tvar t = document.survey_form.knittime;\r\n\t\tvar time = document.survey_form.time;\r\n\t\tvar experience = document.survey_form.experience;\r\n\t\tvar informative = document.survey_form.informative;\r\n\t\tvar informPage = document.survey_form.informativePage;\r\n\t\tvar objects = document.survey_form.objects;\r\n\t\tvar selfish = document.survey_form.selfish;\r\n\t\tvar ravelry = document.survey_form.Ravelry;\r\n\t\tvar updates = document.survey_form.updates;\r\n\t\tvar othercrafts = document.survey_form.othercrafts;\r\n\t\tvar suggestions = document.survey_form.suggestions;\r\n\t\t//Makes the Name a required input\r\n\t\tif (name.value ==\"\")\r\n\t\t{window.alert(\"Please enter your name\")\r\n\t\tname.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t//Makes the age range a required input\r\n\t\tif (age.value ==\"\")\r\n\t\t{window.alert(\"Please enter your age range\")\r\n\t\tage.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t//Makes the experience level a required input\r\n\t\tif (experience.value ==\"\")\r\n\t\t{window.alert(\"Please share your experience level.\")\r\n\t\texperience.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t//Makes the time a required input\r\n\t\tif (t.value ==\"\")\r\n\t\t{window.alert(\"Please enter the amount of time\")\r\n\t\ttimeknitting.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t\t//Makes the time radio a required input\r\n\t\tif (time.value == \"\")\r\n\t\t{window.alert(\"Please select an option\")\r\n\t\ttime.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t//Makes the rating a required input\r\n\t\tif (informative.value ==\"\")\r\n\t\t{window.alert(\"Please enter a value\")\r\n\t\tinformative.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t//Makes the dropdown selection a required input\r\n\t\tif (informPage.value ==\"\")\r\n\t\t{window.alert(\"Please select an option\")\r\n\t\tinformPage.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t//Makes the object radio a required input\r\n\t\tif (objects.value ==\"\")\r\n\t\t{window.alert(\"Please select an option\")\r\n\t\tobjects.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t//Makes the who do you knit for question a required input\r\n\t\tif (selfish.value ==\"\")\r\n\t\t{window.alert(\"Please share your thoughts\")\r\n\t\tselfish.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t//Makes the ralvery radio a required input\r\n\t\tif (ravelry.value ==\"\")\r\n\t\t{window.alert(\"Please select an option\")\r\n\t\travelry.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t//Makes the email radio a required input\r\n\t\tif (updates.value ==\"\")\r\n\t\t{window.alert(\"Please select an option\")\r\n\t\tupdates.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t//Makes the ralvery username a required input if the 'yes' radio us check\r\n\t\tif (document.survey_form.yesRav.checked) {\r\n\t\t\tif (username.value ==\"\")\r\n\t\t\t{window.alert(\"Please enter your username\")\r\n\t\t\tusername.focus()\r\n\t\t\treturn false;}\r\n\t\t}\r\n\t\t//Makes the email a required input if the 'yes' radio us checked\r\n\t\tif (document.survey_form.yesEmail.checked) {\r\n\t\t\tif (email.value ==\"\")\r\n\t\t\t{window.alert(\"Please enter your e-mail\")\r\n\t\t\temail.focus()\r\n\t\t\treturn false;}\r\n\t\t}\r\n\t\t//Makes the other crafts reply a required input\r\n\t\tif (othercrafts.value ==\"\")\r\n\t\t{window.alert(\"Please share your thoughts\")\r\n\t\tothercrafts.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t//Makes the general suggestion reply a required input\r\n\t\tif (suggestions.value ==\"\")\r\n\t\t{window.alert(\"Please share your thoughts\")\r\n\t\tsuggestions.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\treturn true;\r\n\t}", "function validateForm(event) {\n // Prevent the browser from reloading the page when the form is submitted\n event.preventDefault();\n\n // Validate that the name has a value\n const name = document.querySelector(\"#name\");\n const nameValue = name.value.trim();\n const nameError = document.querySelector(\"#nameError\");\n let nameIsValid = false;\n\n if (nameValue) {\n nameError.style.display = \"none\";\n nameIsValid = true;\n } else {\n nameError.style.display = \"block\";\n nameIsValid = false;\n }\n\n // Validate that the answer has a value of at least 10 characters\n const answer = document.querySelector(\"#answer\");\n const answerValue = answer.value.trim();\n const answerError = document.querySelector(\"#answerError\");\n let answerIsValid = false;\n\n if (checkInputLength(answerValue, 10) === true) {\n answerError.style.display = \"none\";\n answerIsValid = true;\n } else {\n answerError.style.display = \"block\";\n answerIsValid = false;\n }\n\n // Validate that the email has a value and a valid format\n const email = document.querySelector(\"#email\");\n const emailValue = email.value.trim();\n const emailError = document.querySelector(\"#emailError\");\n const invalidEmailError = document.querySelector(\"#invalidEmailError\");\n let emailIsValid = false;\n\n if (emailValue) {\n emailError.style.display = \"none\";\n emailIsValid = true;\n } else {\n emailError.style.display = \"block\";\n emailIsValid = false;\n }\n\n if (checkEmailFormat(emailValue) === true) {\n invalidEmailError.style.display = \"none\";\n emailIsValid = true;\n } else {\n invalidEmailError.style.display = \"block\";\n emailIsValid = false;\n }\n\n // Validate that the answer has a value of at least 15 characters\n const address = document.querySelector(\"#address\");\n const addressValue = address.value.trim();\n const addressError = document.querySelector(\"#addressError\");\n addressIsValid = false;\n\n if (checkInputLength(addressValue, 15) === true) {\n addressError.style.display = \"none\";\n addressIsValid = true;\n } else {\n addressError.style.display = \"block\";\n addressIsValid = false;\n }\n\n // Display form submitted message if all fields are valid\n if (\n nameIsValid === true &&\n answerIsValid === true &&\n emailIsValid === true &&\n addressIsValid === true\n ) {\n submitMessage.style.display = \"block\";\n } else {\n submitMessage.style.display = \"none\";\n }\n}", "function validateInput()\n{\n /*\n let errorLabel = document.getElementById(\"error-label\");\n let prompt = document.getElementById(\"prompt\");\n let functionName = document.getElementById(\"function-name\");\n let topic = document.getElementById(\"topic\");\n let firstTestCase = document.getElementById(\"first-test-case\");\n let firstOutput = document.getElementById(\"first-output\");\n let secondTestCase = document.getElementById(\"second-test-case\");\n let secondOutput = document.getElementById(\"second-output\");\n \n if(prompt.value.length == 0 || prompt.value.length > 128)\n errorLabel.innerHTML = \"The prompt must be nonempty and less than or equal to 128 characters.\";\n else if(functionName.value.length == 0 || functionName.value.length > 64)\n errorLabel.innerHTML = \"The function name must be nonempty and less than or equal to 64 characters.\";\n else if(topic.value.length == 0 || topic.value.length > 32)\n errorLabel.innerHTML = \"The topic must be nonempty and less than or equal to 32 characters.\";\n else if(firstTestCase == null || firstTestCase.value.length == 0 || firstTestCase.value.length > 64)\n errorLabel.innerHTML = \"The first test case must be nonempty and less than or equal to 64 characters.\";\n else if(firstOutput == null || firstOutput.value.length == 0 || firstOutput.value.length > 64)\n errorLabel.innerHTML = \"The first output must be nonempty and less than or equal to 64 characters.\";\n else if(secondTestCase == null || secondTestCase.value.length == 0 || secondTestCase.value.length > 64)\n errorLabel.innerHTML = \"The second test case must be nonempty and less than or equal to 64 characters.\";\n else if(secondOutput == null || secondOutput.value.length == 0 || secondOutput.value.length > 64)\n errorLabel.innerHTML = \"The second output must be nonempty and less than or equal to 64 characters.\";\n else\n */\n attemptQuestionCreation();\n \n}", "function checkPharmacyFields() {\n var result_1 = Validation.checkInput($(\"#username\"), function (obj) {\n return obj.val() != \"\";\n })\n var result_2 = Validation.checkInput($(\"#password\"), function (obj) {\n return obj.val() != \"\";\n })\n var result_3 = Validation.checkInput($(\"#password_confirmation\"), function (obj) {\n return obj.val() != \"\" && obj.val() == $(\"#password\").val();\n })\n var result_4 = Validation.checkInput($(\"#p_email\"), function (obj) {\n return obj.val() != \"\";\n })\n var result_5 = Validation.checkInput($(\"#i-agree-button\"), function (obj) {\n return $('.button-checkbox').find('input:checkbox').is(':checked');\n })\n var result_6 = Validation.checkInput($(\"#p_name\"), function (obj) {\n return obj.val() != \"\";\n })\n var result_7 = Validation.checkInput($(\"#p_phone_no\"), function (obj) {\n return obj.val() != \"\";\n })\n var result_8 = Validation.checkInput($(\"#p_street\"), function (obj) {\n return obj.val() != \"\";\n })\n var result_9 = Validation.checkInput($(\"#p_postcode\"), function (obj) {\n return obj.val() != \"\";\n })\n var result_10 = Validation.checkInput($(\"#p_suburb\"), function (obj) {\n return obj.val() != \"\";\n })\n\n return result_1 & result_2 & result_3 & result_4 & result_5 & result_6 & result_7& result_8& result_9& result_10;\n}", "function saveSurveyQtns() {\r\n\t// Check if user type selected\r\n\tvar userType = parseInt(document.getElementById(\"userType\").options[document.getElementById(\"userType\").selectedIndex].value);\r\n\tvar userProfile = parseInt(document.getElementById(\"inputUserProfileInpt\").options[document.getElementById(\"inputUserProfileInpt\").selectedIndex].value);\r\n\tif(userType == \"0\") {\r\n\t\talertify.alert(\"Please Select User Type.\");\r\n\t\treturn false;\r\n\t} else if(userProfile == \"0\") {\r\n\t\talertify.alert(\"Please Select User Profile.\");\r\n\t\treturn false;\r\n\t} else {\r\n\t\tif (document.getElementById(\"text\").checked) {\r\n\t\t\tif (validateFormSubmission(\"T\")) {\r\n\t\t\t\tsaveFreeTextData();\r\n\t\t\t}\r\n\t\t} else if (document.getElementById(\"rad\").checked) {\r\n\t\t\tif (validateFormSubmission(\"R\")) {\r\n\t\t\t\tsaveRadioData();\r\n\t\t\t}\r\n\t\t} else if (document.getElementById(\"drop\").checked) {\r\n\t\t\tif (validateFormSubmission(\"D\")) {\r\n\t\t\t\tsaveDropDownData();\r\n\t\t\t}\r\n\t\t} else if (document.getElementById(\"check\").checked) {\r\n\t\t\tif (validateFormSubmission(\"C\")) {\r\n\t\t\t\tsaveCheckboxData();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\talertify.alert(\"Please Choose any one Answer type\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n}", "function validateGeneralInformation(){\n \n $(\".input-has-error\").remove();\n \n //collect passed OR failed\n var validateAll = [];\n \n //check text input if empty\n var textInput = $(\"body\").find(\".validate-input-text\");\n if(textInput.length > 0){\n textInput.each(function(e){\n var lengthStatus = checkLength($(this).val());\n var status = textErrorMessage($(this).parent(), lengthStatus, \"This field is required.\", true);\n \n //add red border\n if(!lengthStatus){\n $(this).attr(\"style\", \"border: 1px solid red !important\");\n }\n \n validateAll.push(status);\n });\n }\n \n //check checkboxes if not checked\n var checkboxesTag = $(\"body\").find(\".validate-checkbox-tag\");\n var checkboxesTagChecked = $(\"body\").find(\".validate-checkbox-tag:checkbox:checked\");\n if(checkboxesTag.length > 0){\n \n if(checkboxesTagChecked.length < 1){\n var status = textErrorMessage($(\"body\").find(\".create-tag-field\").parent(), false, \"Please select at least one tag.\", true);\n } else {\n var status = \"passed\";\n }\n validateAll.push(status);\n }\n \n //check if event date is empty (both start & end)\n var datePicker = $(\"body\").find(\".validate-date-picker\");\n if(datePicker.length > 0){\n datePicker.each(function(e){\n var lengthStatus = checkLength($(this).val());\n var status = textErrorMessage($(this).parent(), lengthStatus, \"This field is required.\", true);\n \n //add red border\n if(!lengthStatus){\n $(this).attr(\"style\", \"border: 1px solid red !important\");\n }\n \n validateAll.push(status);\n });\n }\n \n //compare Event start time & end time\n var startDate = $(\"#event-date-start\").val();\n var endDate = $(\"#event-date-end\").val();\n var checkBothDate = checkStartEndDate(startDate, endDate);\n if(!checkBothDate){\n datePicker.each(function(e){\n var status = textErrorMessage($(this).parent(), false, \"Submitted dates are invalid.\", true);\n \n //add red border\n $(this).attr(\"style\", \"border: 1px solid red !important\");\n \n validateAll.push(status);\n });\n } else {\n datePicker.each(function(e){\n var status = \"passed\";\n \n validateAll.push(status);\n });\n }\n \n //check event time if empty\n var timePickerRow = $(\"body\").find(\".time-picker-row\");\n var timePicker = $(\"body\").find(\".validate-time-picker\");\n if(timePicker.length > 0){\n var timePickerArray = [];\n timePicker.each(function(e){\n var lengthStatus = checkLength($(this).val());\n timePickerArray.push(lengthStatus);\n \n //add red border\n if(!lengthStatus){\n $(this).attr(\"style\", \"border: 1px solid red !important\");\n }\n });\n var timePickerStatuses = timePickerArray.includes(false); //if has has false in the array, it will return true\n if(timePickerStatuses){ \n var status = textErrorMessage(timePickerRow, false, \"These two fields are both required.\", true);\n \n validateAll.push(status);\n }\n }\n \n //compare start time and end time\n var startTime= $(\"#event-time-start\").val();\n var endTime = $(\"#event-time-end\").val();\n var checkBothTime = checkStartEndTime(startTime, endTime);\n if(!checkBothTime){\n var status = textErrorMessage(timePickerRow, false, \"Submitted times are invalid.\", true);\n validateAll.push(status);\n } else {\n var status = \"passed\";\n validateAll.push(status);\n }\n \n //check banner & thumbnail\n var banner = $(\"body\").find(\".upload-banner-src\");\n var bannerSrc = banner.attr(\"src\");\n if(banner.length > 0){\n if(bannerSrc.length < 1){\n var contentBoxRow = banner.parent().parent();\n var status = textErrorMessage(contentBoxRow, false, \"Please upload a banner image.\", true);\n } else {\n var status = \"passed\";\n }\n validateAll.push(status);\n }\n var thumbnail = $(\"body\").find(\".upload-thumbnail-src\");\n var thumbnailSrc = thumbnail.attr(\"src\");\n if(thumbnail.length > 0){\n if(thumbnailSrc.length < 1){\n var contentBoxRow = thumbnail.parent().parent();\n var status = textErrorMessage(contentBoxRow, false, \"Please upload a thumbnail image.\", true);\n } else {\n var status = \"passed\";\n }\n validateAll.push(status);\n }\n \n //check sponsor image & sponsor text\n var sponsorFields = $(\"body\").find(\".sponsor-field\");\n if(sponsorFields.length > 0){\n sponsorFields.each(function(e){\n var sponsorImageLength = $(this).find(\".sponsor-image\").length; //the img element doesn't exist if no image was chosen. \n var sponsorTypeLength = $(this).find(\".sponsor-type\").val().length;\n \n if(sponsorImageLength < 1 && sponsorTypeLength < 1){\n var status = textErrorMessage($(this).append(), false, \"Please upload a sponsor image and input the sponsor type.\", false);\n } else if(sponsorImageLength < 1){\n var status = textErrorMessage($(this).append(), false, \"Please upload a sponsor image.\", false);\n } else if(sponsorTypeLength < 1){\n var status = textErrorMessage($(this).append(), false, \"Please upload a sponsor type.\", false);\n } else {\n var status = \"passed\";\n }\n \n validateAll.push(status);\n });\n }\n \n //console.log(validateAll);\n \n //final validation process\n var finalValidationStatus = validateAll.includes(\"failed\"); //if has has \"failed\" in the array, it will return true\n \n return finalValidationStatus;\n \n}", "function validate(){\r\n validateFirstName();\r\n validateSubnames();\r\n validateDni();\r\n validateTelephone ();\r\n validateDate();\r\n validateEmail();\r\n if(validateFirstName() && validateSubnames() && validateDni() && validateTelephone() &&\r\n validateDate() && validateEmail()){\r\n alert(\"DATOS ENVIADOS CORRECTAMENTE\");\r\n form.submit(); \r\n }\r\n\r\n}", "function validateSteps(){\n var FormErrors = false;\n for(var i = 1; i < fieldsetCount; ++i){\n var error = validateStep(i);\n if(error == -1)\n FormErrors = true;\n }\n $('#surveyForm').data('errors',FormErrors);\n }", "function formValidation(){\n var result;\n\n result = textValidation(firstName,fName);\n result = textValidation(middleName,mName) && result;\n result = textValidation(sirName,lName) && result;\n result = numberValidation(unitNum,unitNumber) && result;\n result = numberValidation(StreetNum,stNumber) && result;\n result = textValidation(streetName,stName) && result;\n result = textValidation(city,cityName) && result;\n result = postCodeValidation(postCode,pCode) && result;\n result = phoneValidation(phoneNumber,phoNumber) && result;\n result = userNameValidation(userName,uName) && result;\n result = password1Validation(password1,pWord) && result;\n result = password2Validation(password2,pWordC,password1) && result;\n if (result == false){\n alert(\"Submission Failed\")\n }\n else {\n alert(\"Submission was Successful\")\n }\n return result;\n}", "function functSubmit(event) {\n var ipValue = document.getElementById(\"myText\").value; /* gets the value of the text being input */\n \n if (getValidIP(ipValue).length >= 2) { /* any array length of 2 valid IP addresses or more */\n document.getElementById('someResult').innerHTML = 'Multi Values: ' + getValidIP(ipValue);\n }\n else if (getValidIP(ipValue).length == 1) { /* array length 1 IP address only */\n document.getElementById('someResult').innerHTML = 'Value is: ' + getValidIP(ipValue);\n }\n else { /* all invalid IP arrays are valued at 0 */\n document.getElementById('someResult').innerHTML = 'Value is: INVALID';\n }\n event.preventDefault() /* prevent the form from default submission so we stay on the page */\n }", "function validateUserResponse() {\n\n console.log('VALIADATION');\n\n // If answer was correct, animate transition to next card\n if (currentcard['french'] === $('#firstField').val()) {\n\n acceptAnswer();\n } else {\n // show solution\n animateShake();\n revealSolution();\n }\n}", "function saveData() {\n var x = document.getElementById(\"last\").value;\n var y = document.getElementById(\"first\").value;\n var z = document.getElementById(\"age\").value;\n\n //document.getElementById(\"error\").innerHTML = \"\";\n document.getElementById(\"error1\").innerHTML = \"\";\n document.getElementById(\"error2\").innerHTML = \"\";\n document.getElementById(\"error3\").innerHTML = \"\";\n\n\n //use switch case???\n //loop?\n //var x = document.forms[\"myForm\"];\n //var errorMsg = \"\";\n //var i;\n //for (i = 0; i < x.length; i++) {\n // errorMsg += x.elements[i].value + \"<br>\";\n //}\n //document.getElementById(\"error\").innerHTML = errorMsg;\n //}\n \n\n //############################# CRAPPY CODE #######################\n if (x.length == 0 || y.length == 0 || z.length == 0 || \n x.match(/[^a-zA-Z-äöüÄÖÜ]+/g) || y.match(/[^a-zA-Z-äöüÄÖÜ]+/g) || !(z.match(/^\\s*(3[01]|[12][0-9]|0?[1-9])\\.(1[012]|0?[1-9])\\.((?:19|20)\\d{2})\\s*$/g)))\n {\n //var errorMsg = \"\";\n //errorMsg += \"ERROR! Name cannot be empty!\\n\";\n //document.getElementById(\"error\").innerHTML = errorMsg;\n if (x.length == 0 && y.length == 0 && z.length == 0)\n {\n document.getElementById(\"error1\").innerHTML = \"ERORR! Name cannot be empty!\";\n document.getElementById(\"error2\").innerHTML = \"ERORR! Firstname cannot be empty!\";\n document.getElementById(\"error3\").innerHTML = \"ERORR! Age should be filled out!\";\n document.getElementById(\"success\").innerHTML = \"\";\n //return false;\n }\n\n else if (x.length == 0)\n {\n document.getElementById(\"success\").innerHTML = \"\";\n document.getElementById(\"error1\").innerHTML = \"ERROR! Name cannot be empty!\";\n if (y.length == 0) {\n document.getElementById(\"success\").innerHTML = \"\";\n document.getElementById(\"error2\").innerHTML = \"ERROR! Firstname cannot be empty!\";\n //return false;\n }\n else if (z.length == 0) {\n document.getElementById(\"success\").innerHTML = \"\";\n document.getElementById(\"error3\").innerHTML = \"ERROR! Age should be filled out!\";\n //return false;\n }\n //return false;\n }\n\n else if (y.length == 0)\n {\n document.getElementById(\"error2\").innerHTML = \"ERROR! Firstname cannot be empty!\";\n document.getElementById(\"success\").innerHTML = \"\";\n if (x.length == 0) {\n document.getElementById(\"success\").innerHTML = \"\";\n document.getElementById(\"error1\").innerHTML = \"ERROR! Name cannot be empty!\";\n //return false;\n }\n else if (z.length == 0) {\n document.getElementById(\"success\").innerHTML = \"\";\n document.getElementById(\"error3\").innerHTML = \"ERROR! Age should be filled out!\";\n //return false;\n }\n //return false;\n }\n\n else if (z.length == 0)\n {\n document.getElementById(\"success\").innerHTML = \"\";\n document.getElementById(\"error3\").innerHTML = \"ERROR! Age should be filled out!\";\n if (x.length == 0) {\n document.getElementById(\"success\").innerHTML = \"\";\n document.getElementById(\"error1\").innerHTML = \"ERROR! Name cannot be empty!\";\n //return false;\n }\n else if (y.length == 0) {\n document.getElementById(\"success\").innerHTML = \"\";\n document.getElementById(\"error2\").innerHTML = \"ERROR! Firstname cannot be empty!\";\n //return false;\n }\n //return false;\n }\n\n else if (x.match(/[^a-zA-Z-äöüÄÖÜ]+/g) && y.match(/[^a-zA-Z-äöüÄÖÜ]+/g) && !z.match(/^\\s*(3[01]|[12][0-9]|0?[1-9])\\.(1[012]|0?[1-9])\\.((?:19|20)\\d{2})\\s*$/g))\n {\n document.getElementById(\"error1\").innerHTML = \"Invalid name format!\";\n document.getElementById(\"error2\").innerHTML = \"Invalid firstname format!\";\n document.getElementById(\"error3\").innerHTML = \"Invalid date format! It should be (dd.mm.yyyy)\";\n document.getElementById(\"success\").innerHTML = \"\";\n //return false;\n }\n\n else if (x.match(/[^a-zA-Z-äöüÄÖÜ]+/g))\n {\n document.getElementById(\"error1\").innerHTML = \"Invalid name format!\";\n document.getElementById(\"success\").innerHTML = \"\";\n if (y.match(/[^a-zA-Z-äöüÄÖÜ]+/g)) {\n document.getElementById(\"error2\").innerHTML = \"Invalid firstname format!\";\n document.getElementById(\"success\").innerHTML = \"\";\n //return false;\n }\n else if (!z.match(/^\\s*(3[01]|[12][0-9]|0?[1-9])\\.(1[012]|0?[1-9])\\.((?:19|20)\\d{2})\\s*$/g)) {\n //else if (!z.match((/\\d{2}\\.\\d{2}\\.\\d{4}/))) {\n document.getElementById(\"error3\").innerHTML = \"Invalid date format! It should be (dd.mm.yyyy)\";\n document.getElementById(\"success\").innerHTML = \"\";\n //return false;\n }\n //return false;\n }\n\n else if (y.match(/[^a-zA-Z-äöüÄÖÜ]+/g))\n {\n document.getElementById(\"error2\").innerHTML = \"Invalid firstname format!\";\n document.getElementById(\"success\").innerHTML = \"\";\n if (x.match(/[^a-zA-Z-äöüÄÖÜ]+/g)) {\n document.getElementById(\"error1\").innerHTML = \"Invalid name format!\";\n document.getElementById(\"success\").innerHTML = \"\";\n //return false;\n }\n else if (!z.match(/^\\s*(3[01]|[12][0-9]|0?[1-9])\\.(1[012]|0?[1-9])\\.((?:19|20)\\d{2})\\s*$/g)) {\n //else if (!z.match((/\\d{2}\\.\\d{2}\\.\\d{4}/))) {\n document.getElementById(\"error3\").innerHTML = \"Invalid date format! It should be (dd.mm.yyyy)\";\n document.getElementById(\"success\").innerHTML = \"\";\n //return false;\n }\n //return false;\n }\n\n else if (!z.match(/^\\s*(3[01]|[12][0-9]|0?[1-9])\\.(1[012]|0?[1-9])\\.((?:19|20)\\d{2})\\s*$/g))\n {\n document.getElementById(\"error3\").innerHTML = \"Invalid date format! It should be (dd.mm.yyyy)\";\n document.getElementById(\"success\").innerHTML = \"\";\n if (x.match(/[^a-zA-Z-äöüÄÖÜ]+/g)) {\n document.getElementById(\"error1\").innerHTML = \"Invalid name format!\";\n document.getElementById(\"success\").innerHTML = \"\";\n //return false;\n }\n else if (y.match(/[^a-zA-Z-äöüÄÖÜ]+/g)) {\n document.getElementById(\"error2\").innerHTML = \"Invalid firstname format!\";\n document.getElementById(\"success\").innerHTML = \"\";\n //return false;\n }\n //return false;\n }\n return false;\n }\n\n else {\n var data = {\n id: CurrentId,\n name: document.getElementById(\"last\").value,\n firstName: document.getElementById(\"first\").value,\n mobile: document.getElementById(\"mobil\").value,\n birthDate: parseDate(document.getElementById(\"age\").value),\n birthPlace: document.getElementById(\"ort\").value,\n motherLanguage: document.getElementById(\"mutter\").value,\n festNummer: document.getElementById(\"fest\").value,\n notfallNummer: document.getElementById(\"notfall\").value,\n email: document.getElementById(\"email\").value,\n emailPrivate: document.getElementById(\"privat\").value,\n street: document.getElementById(\"str\").value,\n city: document.getElementById(\"city\").value,\n cityCode: document.getElementById(\"plz\").value\n };\n\n //webservice(\"/WebService1.asmx/LoadEmployees\");\n\n //check the employee is new or old\n //if (new)-> add new employee\n //else update\n if (CurrentId != null) {\n //call method to over-write the existing employee with input value (data)\n webservice(\"/WebService1.asmx/SaveEmployee\", { test: data })\n .done(function (foo) {\n document.getElementById(\"success\").innerHTML = \"Successfully saved!\";\n });\n }\n else {\n //call method to add a new employee data\n webservice(\"/WebService1.asmx/AddEmployee\", { test: data })\n .done(function (bar) {\n document.getElementById(\"success\").innerHTML = \"Successfully saved as new Employee!\";\n });\n }\n }\n}", "function validationsOk() {\n\n // Validate if in the HTML document exist a form\n if (formExistence.length === 0) {\n infoDiv.style.display = \"block\"\n infoDiv.style.color = \"red\"\n infoDiv.innerText = \"Form tag doesn't exist in the html document\"\n return;\n }\n\n // Validate the quantity of labels tags are in the document\n if (labelsQuantity.length !== 4) {\n infoDiv.style.display = \"block\"\n infoDiv.style.color = \"red\"\n infoDiv.innerText = \"There aren't the enoght quantity of label tags in the document\"\n return;\n }\n\n // Validate the quantity of buttons are in the document\n if (buttonsQuantity.length !== 2) {\n infoDiv.style.display = \"block\"\n infoDiv.style.color = \"red\"\n infoDiv.innerText = \"There aren't the enoght quantity of button tags in the document\"\n return;\n }\n\n // Validate the quantity of inputs tags are in the document\n if (inputsQuantity.length !== 4) {\n infoDiv.style.display = \"block\"\n infoDiv.style.color = \"red\"\n infoDiv.innerText = \"There aren't the enoght quantity of inputs tags in the document\"\n return;\n }\n\n // Validate if the email input contains text \n if (emailInput.value === \"\" || emailInput.value === null || !isEmail(emailInput.value)) {\n return;\n }\n if (nameInput.value === \"\" || nameInput.value === null) {\n return;\n }\n // Validate if the password input contains text\n if (passwordInput.value === \"\" || passwordInput.value === null) {\n return;\n }\n // Validate if the confirm-password input contains text\n if (confirmPasswordInput.value === \"\" || confirmPasswordInput.value === null) {\n return;\n }\n // Validate if the confirm-password match with the password\n if (confirmPasswordInput.value !== passwordInput.value) {\n return;\n }\n // all validations passed\n else {\n infoDiv.style.display = \"block\"\n infoDiv.style.color = \"green\"\n infoDiv.innerText = `Registered Succesfully. Your account data is: ${emailInput.value} ${nameInput.value} ${passwordInput.value.type = \"******\"} ${confirmPasswordInput.value.type = \"******\"}`\n return;\n }\n}", "function CheckPatientInputData(){\t\n\t\t\t\n\t\t\t//alert(\"(DEBUG)CheckPatientInputData() - starting\" );\n\t\t\t\n\t\t\tif(CheckInputField(PatientData.Forename_FieldValue,\"text\")==false){\n\t\t\t\t//alert(\"ERROR - Entrada invalida en Nombre\");\n\t\t\t\treturn false;\n\t\t\t}else if(CheckInputField(PatientData.FirstSurname_FieldValue,\"text\")==false){\n\t\t\t\t//alert(\"ERROR - Entrada invalida en Primer Apellido\");\n\t\t\t\treturn false;\n\t\t\t}else if(CheckInputField(PatientData.SecondSurname_FieldValue,\"text\")==false){\n\t\t\t\t//alert(\"ERROR - Entrada invalida en Segundo Apellido\");\n\t\t\t\treturn false;\n\t\t\t}else if(CheckInputField(PatientData.PatientEmail_FieldValue,\"email\")==false){\n\t\t\t\t//alert(\"ERROR - Entrada invalida en Email\");\n\t\t\t\treturn false;\n\t\t\t}else if(1==10){\n\t\t\t//\t//alert(\"ERROR - Entrada invalida en telefono\");\n\t\t\t//FIXME: script failing when checking the phone number\t\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\t//alert(\"(DEBUG)CheckPatientInputData() - ending. Return TRUE\" );\n\t\t\t\treturn true;\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}", "function validate() {\n if (id1.value == \"\" || id2.value == \"\" || id3.value == \"\" || id4.value == \"\" || id5.value == \"\" || id6.value == \"\") {\n alert(\"all feilds are mandatory_feilds cannot be empty\");\n return false;\n } else {\n return true;\n }\n}", "function validateSubmission(form) {\n var alertMsg = \"\"; // Stores the message to display to user indicating which fields are entered incorrectly\n var checkEntry = true; // Is true if all fields are entered correctly, set to false if a field is entered incorrectly\n if (form.name.value == \"\") {\n //checks to see if Name field contains user input\n window.alert(\"No Name entered.\");\n return false;\n }\n if (form.price.value == \"\") {\n //checks to see if Price field contains user input, if not the validate function returns false\n window.alert(\"No Price entered.\");\n return false;\n }\n if (form.long1.value == \"\") {\n //checks to see if Longittude field contains user input, if not the validate function returns false\n window.alert(\"No Longittude entered.\");\n return false;\n }\n if (form.latt1.value == \"\") {\n //checks to see if Lattitude field contains user input, if not the validate function returns false\n window.alert(\"No Lattitude entered.\");\n return false;\n }\n\n if (!validateSpotName(form.name.value)) {\n //checks to see if Name entry is in the appropriate format\n var el = document.getElementsByName(\"name\")[0]; //if entry is incorrect restyles the input element\n el.style.backgroundColor = \"#f5f5f5\";\n alertMsg += //if entry is incorrect adds an error message for the field to the message that will be displayed to the user\n \"Name must be 5 characters long and cannot begin with a space or have consecutive spaces.\\n\";\n checkEntry = false;\n } else {\n document.getElementsByName(\"name\")[0].style.backgroundColor = \"white\";\n }\n if (\n !validateDescription(form.description.value) &&\n form.description.value != \"\"\n ) {\n //checks to see if Description entry is in the appropriate format\n var el = document.getElementsByName(\"description\")[0]; //if entry is incorrect restyles the input element\n el.style.backgroundColor = \"#f5f5f5\";\n alertMsg += \"Description must be less than 300 characters.\\n\"; //if entry is incorrect adds an error message for the field to the message that will be displayed to the user\n checkEntry = false;\n } else {\n document.getElementsByName(\"description\")[0].style.backgroundColor =\n \"white\";\n }\n if (!validatePrice(form.price.value)) {\n //checks to see if Price entry is in the appropriate format\n var el = document.getElementsByName(\"price\")[0]; //if entry is incorrect restyles the input element\n el.style.backgroundColor = \"#f5f5f5\";\n alertMsg += //if entry is incorrect adds an error message for the field to the message that will be displayed to the user\n \"Price must contain only digits, a single decimal point and up to 2 digits following the decimal point.\\n\";\n checkEntry = false;\n } else {\n document.getElementsByName(\"price\")[0].style.backgroundColor = \"white\";\n }\n if (!validateCoordinate(form.long1.value)) {\n //checks to see if Longittude entry is in the appropriate format\n var el = document.getElementsByName(\"long1\")[0]; //if entry is incorrect restyles the input element\n el.style.backgroundColor = \"#f5f5f5\";\n alertMsg += //if entry is incorrect adds an error message for the field to the message that will be displayed to the user\n \"Longittude must contain at least 1 and up to 3 digits optionally followed by a decimal point and any number of digits.\\n\";\n checkEntry = false;\n } else {\n document.getElementsByName(\"long1\")[0].style.backgroundColor = \"white\";\n }\n if (!validateCoordinate(form.latt1.value)) {\n //checks to see if Lattitude entry is in the appropriate format\n var el = document.getElementsByName(\"latt1\")[0]; //if entry is incorrect restyles the input element\n el.style.backgroundColor = \"#f5f5f5\";\n alertMsg += //if entry is incorrect adds an error message for the field to the message that will be displayed to the user\n \"Lattitude must contain at least 1 and up to 3 digits optionally followed by a decimal point and any number of digits.\\n\";\n checkEntry = false;\n } else {\n document.getElementsByName(\"latt1\")[0].style.backgroundColor = \"white\";\n }\n if (!checkEntry) {\n //if any of the input fields have an entry in an incorrect format\n window.alert(alertMsg); //displays an error message for each incorrect field to user\n return false; //the validate function returns fa;se\n }\n\n return true; //All input fields contain values in the correct format so the validate function returns true\n}", "function checkFields() {\n\t$('#appointmentInput > input').keyup(function() {\n\n var empty = false;\n $('#appointmentInput > input').each(function() {\n if ($(this).val() == '') {\n empty = true;\n }\n });\n \n if (!empty) {\n \t$('#saveAppointment').removeAttr('disabled'); \n }\n });\n}", "function confirmAnswers() {\n\n var radioQ = document.getElementById(\"radioQNum\");\n var checkboxQ = document.getElementById(\"checkboxQNum\");\n var inputQ = document.getElementById(\"inputQNum\");\n var checkFlags = [];\n\n // Check user input\n if (radioQ) {\n\n if ($('input[type=radio]:checked').length != parseInt(radioQ.value)) {\n checkFlags.push(0);\n } else {\n checkFlags.push(1);\n }\n\n }\n\n if (checkboxQ) {\n\n var newFlag = true;\n\n for (var i = 0; i < parseInt(checkboxQ.value); i++) {\n\n var newQName = \"Coptions\" + i;\n if ($('input[name=' + newQName + ']:checked').length == 0) {\n newFlag = false;\n break;\n }\n\n }\n\n if (newFlag) {\n checkFlags.push(1);\n } else {\n checkFlags.push(0);\n }\n\n }\n\n if (inputQ) {\n\n var newFlag = true;\n\n var regex = /^[0-9]+$/;\n\n for (var i = 0; i < parseInt(inputQ.value); i++) {\n\n var numVal = document.getElementById(\"numInput\" + i).value;\n\n if (!numVal || !numVal.length) {\n newFlag = false;\n break;\n }\n\n if (regex.test(numVal)) {\n\n var inputLimit = document.getElementById(\"inputNumLimit\" + i).value.split(',');\n\n if (parseInt(numVal) < parseInt(inputLimit[0]) || parseInt(numVal) > parseInt(inputLimit[1])) {\n newFlag = false;\n break;\n }\n\n } else {\n newFlag = false;\n break;\n }\n\n }\n\n if (newFlag) {\n checkFlags.push(1);\n } else {\n checkFlags.push(0);\n }\n\n\n }\n\n // If all the inputs validated, connect to the jiff client and submit the answers\n var flagLen = checkFlags.length;\n\n if ((checkFlags.reduce((a, b) => a + b, 0)) != flagLen) {\n alert('Please finish all the questions or check your input format');\n } else {\n\n var userInputs = [];\n var radios = $('input[type=radio]');\n var checkboxes = $('input[type=checkbox]');\n var numbers = $('input[type=number]');\n\n for (var i = 0; i < radios.length; i++) {\n userInputs.push(radios[i].checked ? 1 : 0);\n }\n\n for (var i = 0; i < checkboxes.length; i++) {\n userInputs.push(checkboxes[i].checked ? 1 : 0);\n }\n\n for (var i = 0; i < numbers.length; i++) {\n userInputs.push(parseInt(numbers[i].value));\n }\n\n var confirmButton = document.getElementById(\"confirmButton\");\n confirmButton.setAttribute(\"disabled\", true);\n radios.prop('disabled', true);\n checkboxes.prop('disabled', true);\n numbers.prop('disabled', true);\n var computeButton = document.getElementById(\"initiating-finish-button\");\n computeButton.removeAttribute(\"disabled\");\n\n var checkID = parseInt(myID.value);\n var cid = document.getElementById(\"survey_id\");\n\n if (checkID == 1) {\n var newPartyCount = parseInt(partiesNum.value) + 1;\n var newJiffClient = new JIFFClient('http://localhost:8080', cid.value, { party_id: 2, party_count: newPartyCount });\n\n newJiffClient.wait_for([1], function () {\n newJiffClient.share_array(userInputs, userInputs.length, 1, [1], [2]);\n newJiffClient.disconnect(true, true);\n });\n }\n\n }\n\n}", "function IsvalidForm() {\n ///Apply Bootstrap validation with Requird Controls in Input Form\n var result = jQuery('#InputForm').validationEngine('validate', { promptPosition: 'topRight: -20', validateNonVisibleFields: true, autoPositionUpdate: true });\n ///If all requird Information is Given\n if (result) {\n ///If all requird Information is Given then return true\n return true;\n }\n ///If all requird Information is Given then return false\n return false;\n}" ]
[ "0.6791253", "0.6737322", "0.6671197", "0.66696006", "0.6634069", "0.65347576", "0.6465407", "0.6459555", "0.6443187", "0.64375234", "0.642993", "0.64258444", "0.6386198", "0.6372094", "0.6286644", "0.626637", "0.625499", "0.62447333", "0.62384737", "0.6234305", "0.6230528", "0.62272024", "0.62023205", "0.62003803", "0.6189182", "0.61664915", "0.61640173", "0.61588335", "0.61577195", "0.6146904", "0.6137243", "0.6132456", "0.61238503", "0.6121718", "0.6115498", "0.61125576", "0.61080796", "0.61025304", "0.6102403", "0.61015904", "0.60955274", "0.6091588", "0.6089988", "0.6085354", "0.60798603", "0.60506094", "0.6048763", "0.6048535", "0.60402346", "0.6036931", "0.60324466", "0.60299647", "0.6025708", "0.60177714", "0.6012597", "0.60073394", "0.60021657", "0.6000452", "0.59995174", "0.59916234", "0.59899235", "0.59840643", "0.59839857", "0.59830743", "0.5978891", "0.5965667", "0.59621626", "0.59618807", "0.59611714", "0.5955685", "0.5954752", "0.5953583", "0.59519285", "0.59514517", "0.5945007", "0.5944369", "0.59401065", "0.59363157", "0.5935084", "0.59312916", "0.5928782", "0.5922466", "0.5920219", "0.5918619", "0.5915981", "0.5914876", "0.5912455", "0.5911515", "0.59093827", "0.5898862", "0.58963674", "0.58961046", "0.58960724", "0.58944696", "0.5892799", "0.5892495", "0.5891104", "0.5879033", "0.58779836", "0.58756936", "0.58741635" ]
0.0
-1
function check validation of password input
function InvalidPwd(textbox){ /**set regex require character and number with minimum 8 length */ var regular=/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$/; /**update validation textbox content */ if (textbox.value === '') { textbox.setCustomValidity('Entering an password is necessary!'); }else if (!textbox.value.match(regular)) { textbox.setCustomValidity('Please enter password Minimum eight characters, at least one letter and one number'); }else{ textbox.setCustomValidity(''); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isValidPassword(password) {\n\n\n}", "function password() {\n var errors = document.querySelector(\"#errors\");\n var password = document.querySelectorAll(\"#pass\");\n var pass = password.value.trim();\n var patt = /^(?=.*[a-z])(?=.*\\d){8,16}$/ig;\n if(!patt.test(pass)) {\n return false;\n }\n else {\n return true;\n }\n}", "function validatePassword(password) {\n\t// validate password\n}", "function passwordCheck(password){\n\t// Can't have password of length zero\n\tif(password.length == 0){\n\t\treturn true;\n\t}\n\t// Password must be of length 10 and numeric\n\tif(password.length == 10 && numCheck(password)){\n\t\treturn true;\n\t}\n\tatSplit=password.split('-');\n\tif(atSplit.length== 3 && numCheck(atSplit[0]) && numCheck(atSplit[1]) && numCheck(atSplit[2]) && atSplit[0].length==3 && atSplit[1].length== 3 && atSplit[2].length==4)\n\t{\n\t\treturn true;\n\t}\n\tvalCheck=false;\n\treturn false;\n}", "function passPatternValid() {\n var errors = document.querySelector(\"#errors\");\n var pass = document.querySelector(\"#pass\").value;\n var password = document.querySelector(\"#secondPass\").value;\n if(pass !== password) {\n errorMessage(\"<p>Please enter a valid Password with 8 to 16 characters one upper case letter and one number!</p>\");\n return false;\n }\n return true;\n }", "function checkPassword() {\n\t\tvar psw=document.sform.psw.value;\n\t\tvar pattern=/[~`!#$%\\^&*+=\\-\\[\\]\\\\';,/{}|\\\\\":<>\\?]/;\n\t\tif (psw.length<8) {\n\t\t\talert (\"Password should be at least 8 characters.\");\n\t\t\tdocument.sform.psw.value=\"\";\n\t\t\tdocument.sform.psw.focus();\n\t\t\treturn false;\n\t\t}else if (pattern.test(psw)) {\n\t\t\talert (\"No special characters are allowed in password.\");\n\t\t\tdocument.sform.psw.value=\"\";\n\t\t\tdocument.sform.psw.focus();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function validatePassword() {\n var input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n\n var regex = new RegExp(/^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])[0-9a-zA-Z]{8,}$/);\n return regex.test(input);\n}", "function validatePassword(input) {\n const re = /^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\\$%\\^&\\*])(?=.{6,14}$)/;\n if (re.test(String(input.value))) {\n passwordOk = 1\n showSuccess(input)\n } else {\n passwordOk = 0\n showError(input, 'Must include a number, one uppercase, one lowercase and one special character. Length must be 6-14 characters.') \n };\n}", "function uPassword() {\n\t\tvar u_pass = $('#user_pass').val();\n\t\tvar pass_pattern = /^[a-zA-Z0-9]+$/;\n\t\tvar pass_len = u_pass.length;\n\n\t\tif (u_pass == '') {\n\t\t\t$('#alert_pass').text('this field cannot be empty');\n\t\t\tsetTimeout(function () {\n\t\t\t\t$('#alert_pass').text('');\n\t\t\t}, 7000);\n\t\t\treturn false;\n\t\t} else if (pass_len < 8 || pass_len > 15 || !u_pass.match(pass_pattern)) {\n\t\t\t$('#alert_pass').text('please enter password between 8-15 alphanumeric characters');\n\t\t\tsetTimeout(function () {\n\t\t\t\t$('#alert_pass').text('');\n\t\t\t}, 7000);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function passwordValidation(){\n return password.value.match(passwordReg);\n}", "function validatePassword() {\n\n // empty array for the final if statement to check\n var errors = [];\n\n if (confirmLowerCase === true) {\n if (finalPass.search(/[a-z]/) < 0) {\n errors.push(\"lower\");\n }\n }\n if (confirmUpperCase === true) {\n if (finalPass.search(/[A-Z]/) < 0) {\n errors.push(\"upper\");\n }\n }\n if (confirmNumeric === true) {\n if (finalPass.search(/[0-9]/i) < 0) {\n errors.push(\"numeric\");\n }\n }\n if (confirmSpecialChar === true) {\n if (finalPass.search(/[!?@#$%^&*]/i) < 0) {\n errors.push(\"specialchar\");\n }\n }\n // if error array has contents, clear password string and regenerate password\n if (errors.length > 0) {\n finalPass = \"\"\n return passwordGen();\n }\n }", "function checkPassword(input){\n \n const updatedPwd = getInputs(input);\n \n const occurence = (updatedPwd[3].split(updatedPwd[2]).length-1);\n \n /*condition to check if count of character is within the range*/\n if(occurence>=updatedPwd[0] && occurence<=updatedPwd[1]){\n return true;\n }\n return false;\n \n }", "function passwordChecker() {\n password_value = password.value;\n\n if (password_value.length < 8) {\n errorMessage.innerText = \"Password is too short\";\n register.setAttribute(\"disabled\", \"disabled\");\n } else {\n if (password_value.match(/\\d/) === null) {\n errorMessage.innerText = \"Password must contain at least one number.\";\n register.setAttribute(\"disabled\", \"disabled\");\n } else {\n if (password_value.match(/[#%\\-@_&*!]/)) {\n errorMessage.innerText = \"\";\n passwordCompare();\n } else {\n errorMessage.innerText = \"Password must contain at least one special character: #%-@_&*!\";\n register.setAttribute(\"disabled\", \"disabled\");\n }\n\n }\n }\n}", "function checkPassword ( password ) {\n //check for at least 6 characters in password field\n if ( ! ( /.{6}/.test( password ) ) ) {\n error.innerHTML += \"<li class='error' >Password less than 6 characters</li>\";\n result = true;\n }\n \n //checks whether or not password has special characters, which it must contain at least 1\n if ( ! ( /\\W/.test ( password ) ) ) {\n error.innerHTML += \"<li class='error'>Password must contain special character</li>\";\n result = true;\n }\n\n return result;\n }", "function checkPassword() {\n var passw = document.getElementById(\"passw\").value;\n\tvar lowercase = new RegExp(/([a-z])/g);\n\tvar uppercase = new RegExp(/([A-Z])/g);\n\tvar numbers = new RegExp(/([0-9])/g);\n\t\n if (passw == \"\"){\n\t} else {\n\t\tif(passw.length > 8) { \n\t\t\tif(lowercase.test(passw)) {\n\t\t\t\tif(uppercase.test(passw)) {\n\t\t\t\t\tif(numbers.test(passw)) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\talert(\"Must contain a number!\");\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\talert(\"Must contain a uppercase letter!\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\talert(\"Must contain a lowercase letter!\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\talert(\"Must be at least 8 character!\");\n\t\t\treturn false;\n\t\t}\n\t}\n}", "function checkPassword(password, warning) {\n let pattner = \"/^[w_-]{6,16}$/\";\n if (password.value == \"\" || password.value == null) {\n warning.innerHTML = \"Password can not be blank\";\n return false;\n } else {\n if (!pattner.test(password.value)) {\n console.log(password.value);\n // console.log()\n warning.innerHTML = \"Wrong password format\";\n return false;\n } else {\n return false;\n }\n }\n}", "function check_inputPassword() {\n\tvar text_password = $(\"#password\").val();\n\tvar show_err_password = $(\"#err_password\");\n\n\tif (text_password.length < 8 || text_password.length > 30) {\n\t\tshow_err_password.html(\"Pass in 8-30 character\");\n\t\treturn false;\n\t}\n\n\tshow_err_password.css({\"color\": \"green\"});\n\tshow_err_password.html(\"OK\");\n\treturn true;\n}", "function validatePass() {\n\tvar message = \"\";\n\tvar password = document.getElementById(\"tPass\").value;\n\tdocument.getElementById(\"tPass\").style.border = \"1px solid #0000ff\";\n\tmessage = message == \"\" ? isEmpty( password ) : message;\n\tmessage = message == \"\" ? isGTMinlength( password, 8 ) : message;\n\tmessage = message == \"\" ? isLTMaxlength( password, 15 ) : message;\n\tif( message == \"\" ) {\n\t\tif( password.search(/^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{8,15}$/) < 0 ) {\n\t\t\tmessage = \"The password must include at least one upper case letter, one lower case letter and one numeric digit.\";\n\t\t}\n\t}\n\tdocument.getElementById(\"pPass\").innerHTML = message;\n\treturn styleInput(\"tPass\", message);\n}", "function validatePassword() {\n var valid = false;\n var pwdInput = document.getElementById(\"inputPassword\");\n var pwdPattern = /^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*])/; //.{8,20}$/\n var pwdError = document.getElementById(\"msg_pwd\");\n if(pwdInput.value == \"\") {\n pwdError.textContent = \"Password is required\";\n }\n else if(!pwdInput.value.match(pwdPattern)) {\n pwdError.textContent = \"Password must be 8-20 characters and contain at least one lowercase letter, one uppercase letter, one number, and one special character\";\n }\n else if(pwdInput.value.length < 8 || pwdInput.value.length > 20) {\n pwdError.textContent = \"Password must be 8-20 characters\";\n }\n else {\n pwdError.textContent = \"\";\n valid = true;\n }\n return valid;\n}", "function checkPassword() {\n\tvar password = document.getElementById(\"password\").value;\n\tvar retypePassword = document.getElementById(\"retypePassword\").value;\n\tvar hasNumber = /\\d/;\n\tvar hasSpecialCharacter = /\\W/;\n\t//Password must contain at least one number and one special character\n\tif ((password === retypePassword) && (hasNumber.test(password)) && (hasSpecialCharacter.test(password))) {\n\t\tdocument.getElementById(\"passwordError\").innerHTML = \"\";\n\t\tdocument.getElementById(\"retypePasswordError\").innerHTML = \"\";\n\t}\n\telse {\n\t\tdocument.getElementById(\"passwordError\").innerHTML = \"Password must match, have a number and a special character.\";\n\t\tdocument.getElementById(\"retypePasswordError\").innerHTML = \"Retyped password must match, have a number and a special character.\";\n\t}\n}", "static validatePassword(password) {\n let passwordRegex = /^(?=.*\\d)(?=.*[!@#$%^&*])(?=.*[a-z])(?=.*[A-Z]).{8,20}$/;\n\n //password field should not be empty.\n if (password == null || password == \"\") {\n //alert(\"Password field Can,t be Empty!.\");\n return false;\n }\n\n //password should match the given condition.\n if (!(password.match(passwordRegex))) {\n return false;\n }\n return true;\n }", "validatePassword(pw) {\n var upperCaseLetters = /[A-Z]/g;\n var lowerCaseLetters = /[a-z]/g;\n var numbers = /[0-9]/g;\n\n if(pw.length < 6 ) {\n return false;\n } else {\n if(!pw.match(upperCaseLetters)) {\n return false;\n }\n if(!pw.match(lowerCaseLetters)){\n return false;\n }\n if(!pw.match(numbers)) {\n return false;\n }\n }\n\n return true;\n }", "validatePassword(pw) {\n var upperCaseLetters = /[A-Z]/g;\n var lowerCaseLetters = /[a-z]/g;\n var numbers = /[0-9]/g;\n\n if(pw.length < 6 ) {\n return false;\n } else {\n if(!pw.match(upperCaseLetters)) {\n return false;\n }\n if(!pw.match(lowerCaseLetters)){\n return false;\n }\n if(!pw.match(numbers)) {\n return false;\n }\n }\n\n return true;\n }", "function is_password(password) {\n return password.length > 0;\n}", "function validatePassword(pw)\n{\n if(pw == \"********\") // indicates password has not been changed\n {\n return(true);\n }\n else if(pw.length < 6)\n {\n return(\"Password must be at least 6 characters\");\n }\n else if(hasNumbers(pw)==false)\n {\n return(\"Password must contain at least two digits\");\n }\n else\n {\n return(true);\n }\n}", "function checkPassword() {\r\n const pass = password.value.trim();\r\n\r\n if (pass === '') {\r\n isValid &= false;\r\n\r\n setErrorFor(password, 'Password cannot be empty')\r\n return;\r\n }\r\n\r\n isValid &= true;\r\n}", "function validatePassword(field)\n{\n if(field == \"\")\n {\n return \"No Password was entered.\\n\";\n }\n else if(field.length < 6)\n {\n return \"Password must be at least 6 characters.\\n\";\n }\n else if(!/[a-z]/.test(field) || ! /[A-Z]/.test(field) || \n !/[0-9]/.test(field))\n {\n return \"Passwords require one each of a-z, A-Z and 0-9.\\n\";\n }\n return \"\";\n}", "function checkPassword(password){\n //regular expression for password\n var passcheck = /^(?=.*[0-9])(?=.*[!@#$%^&*])(?=.*[A-Z])[a-zA-Z0-9!@#$%^&*]{8,16}$/;\n if(passcheck.test(password)){\n return true;\n }else{\n return false;\n }\n }", "function isPasswordvalid(password) {\n return password.length>= 6 && password.includes(\"1\") && (password.includes(\"#\") || password.includes(\"$\") || password.includes(\"!\"))\n}", "function _checkPass(p) \r{\r\tvar error = \"\";\r\t\r\t// Contraseña con menos de 6 carácteres\r\tif (p.length < 6) \r\t{\r\t\tdocument.getElementById(\"p0label\").className = \"error\";\r\t\terror = \"<b>At least 6 characters</b>\";\r\t}\r\telse \r\t{\r\t\t// Contraseña con mas de 15 carácteres\r\t\tif (p.length > 15) \r\t\t{\r\t\t\tdocument.getElementById(\"p0label\").className = \"error\";\r\t\t\terror = \"<b>Less than 15 characters.</b>\";\r\t\t}\r\t\telse \r\t\t{\r\t\t\t// Contraseña con carácteres inválidos. Se admiten los mismo\r\t\t\t// carácteres que en el usuario\r\t\t\treg = /^[A-Za-z0-9_\\-]*$/;\r\r\t\t\tif (!reg.test(p)) \r\t\t\t{\r\t\t\t\tdocument.getElementById(\"p0label\").className = \"error\";\r\t\t\t\terror = \"<b>Invalid character</b>\";\r\t\t\t}\r\t\t}\r\t}\r\r\treturn error;\r}", "function validar_Password(pass) {\n var reg = /^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])[0-9a-zA-Z]{8,}$/;\n return reg.test(pass) ? true : false;\n}", "function validatePassword(pass){\r\n\tvar regexAlphaNumeric = /^[0-9a-zA-Z]+$/;\r\n\t// A very strong password must\r\n\t\t\t//Contain atleast one uppercase letter\r\n\t\t\t//contain at least one lowercase letter\r\n\t\t\t//contain atleast one number or special character\r\n\t\t\t//be at least 8 characters long\r\n\tvar regexVeryStrongPassword = /(?=^.{8,}$)((?=.*\\d)|(?=.*W+))(?![.\\n])(?=.*[A-Z])(?=.*[a-z]).*$/;\r\n\t// A strong password must\r\n\t\t\t//contain at least one lowercase letter\r\n\t\t\t//contain atleast one number or special character\r\n\t\t\t//be at least 8 characters long\r\n\t\t\t//TODO: Correct regexStrongPassword\r\n\tvar regexStrongPassword = /(?=^.{8,}$)((?=.*\\d)|(?=.*W+))(?![.\\n])(?=.*[a-z]).*$/;\r\n\t\r\n\tif(!regexAlphaNumeric.test(pass) && !regexStrongPassword.test(pass) && !regexVeryStrongPassword.test(pass)){\r\n\t\treturn false;\r\n\t}\r\n\tif(pass.length < 8){\r\n\t\treturn false;\r\n\t}\r\n\tif(pass.length > 40){\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "function checkPass() {\n if (getPass().length > 0) {\n if ((getPass()[0] >= \"a\" && getPass()[0] <= \"z\") || (getPass()[0] >= \"A\" && getPass()[0] <= \"Z\"))/*if the first char letter and not num*/ {\n if (isLetterOrNum(getPass())) {\n if (getPass().length >= 6)/*password at least 6 chars*/ {\n document.ePass.uPass.style.borderColor = \"green\";\n document.getElementById(\"errPass\").style.display = \"none\";\n return true;\n } else {\n document.ePass.uPass.style.borderColor = \"red\";\n document.getElementById(\"errPass\").innerHTML = \"Password have to be at least 6 chars. Left: \" + (6 - getPass().length);\n document.getElementById(\"errPass\").style.display = \"block\";\n return false;\n }\n } else {\n document.ePass.uPass.style.borderColor = \"red\";\n document.getElementById(\"errPass\").innerHTML = \"Only letters or nums\";\n document.getElementById(\"errPass\").style.display = \"block\";\n return false;\n }\n } else {\n document.ePass.uPass.style.borderColor = \"red\";\n document.getElementById(\"errPass\").innerHTML = \"First char have to be letter\";\n document.getElementById(\"errPass\").style.display = \"block\";\n return false;\n }\n } else {\n document.ePass.uPass.style.borderColor = \"grey\";\n document.getElementById(\"errPass\").style.display = \"none\";\n return false;\n }\n}", "function validPassword(){\n // Se declara la variable del password\n var password = $('#password_id').val();\n // comprueba que la extensión del password sea de 8 caracteres\n if (password.length < 8) {\n // si no se cumple la condicion manda el error\n var lenght_error = \"El password debe contener al menos 8 caracteres\"\n $(\"#display_psw_error\").append(lenght_error);\n }\n // comprueba que contenga mayusculas \n if (password.match(/[A-Z]/) == null){\n var caps_error = \"El password debe contener al menos una mayuscula\"\n $(\"#display_caps_error\").append(caps_error);\n }\n // comprueba que contenga al menos un dígito\n if (password.match(/\\d/) == null){\n var num_error = \"El password debe contener al menos un carácter numérico\"\n $(\"#display_num_error\").append(num_error);\n }\n}", "function check_password(){\n\n\t\tvar password_length = $(\"#password\").val().length;\n\t\tvar password_capital_letters_length = $(\"#password\").val().replace(/[^A-Z]/g, \"\").length;\n\t\tvar password_numbers_length = $(\"#password\").val().replace(/[^0-9]/g,\"\").length;\n\n\t\tif(password_length < 5 || password_capital_letters_length <= 0 || password_numbers_length <= 0){\n\t\t\t$(\"#password_error\").html(\"At least 5 letters and must contain numbers, letters, capital letter\");\n\t\t\t$(\"#password_error\").show();\n\t\t\terror_username = true;\n\t\t} else {\n\t\t\t$(\"#password_error\").hide();\n\t\t}\n\n\t}", "function validatePassword() {\r\n var checkVal = document.registration.passid.value;\r\n\r\n // Password not empty\r\n if (checkVal.length == 0) {\r\n strFields += \"- Password cannot be empty!<br>\";\r\n return false;\r\n }\r\n\r\n // Password length: 6-20 (inclusive)\r\n if (checkVal.length < 6 || checkVal.length > 20) {\r\n strFields += \"- Password must be between 6 and 20 characters long!<br>\";\r\n return false;\r\n }\r\n\r\n return true;\r\n}", "function checkPassword(password){\n var upperAlphaChars = /[A-Z]/;\n var lowerAlphaChars = /[a-z]/;\n var numbers = /[0-9]/;\n var nonalphaChars = /\\W|_/;\n\n\t//document.getElementById(\"loginUsernameError\").innerHTML=\"Testing\";\n \n \tif(upperAlphaChars.test(password) && lowerAlphaChars.test(password) && \n\t\tnumbers.test(password) && nonalphaChars.test(password) && password.length >= 6){\n\treturn true;\n }\n else return false;\n}", "function validate(password) {\r\n var upperCaseVal= /[A-Z]/;\r\n var lowerCaseVal =/[a-z]/;\r\n var numVal= /[0-9]/;\r\n if (password.length<=5){\r\n return \"need 6 characters or more\"\r\n }\r\n // uses my uppercase reg ex as a test criterion to scan for at least one uppercase\r\n if (upperCaseVal.test(password)===false){\r\n return \"need one uppercase letter\"\r\n }\r\n //same as above but with lower case\r\n if (lowerCaseVal.test(password)===false){\r\n return \"need one lowercase letter\"\r\n }\r\n if (numVal.test(password)===false){\r\n return \"need one number\"\r\n }\r\n return\"great job you rock\"\r\n }", "function validate(password) {\n return /(?=.*[a-z])(?=.*[A-Z])(?=.*[\\d])(?=.{6,})/.test(password);\n}", "validate(value) {\r\n if (value.toLowerCase().includes('password'))\r\n throw new Error('Password cannot contain password, come on');\r\n }", "function checkPassword() {\n if (this.value.length >= 8) {\n setAccepted('password-validated');\n } else {\n setUnaccepted('password-validated');\n }\n}", "function isPassword() {\r\n\tvar pwd = document.getElementById(\"password\");\r\n\tvar result = document.getElementById(\"pwd-error\");\r\n\tresult.innerHTML = \"\";\r\n\tif(pwd.value === \"\") {\r\n\t\tresult.innerHTML = \"Please input your password\";\r\n\t\treturn false;\r\n\t}\r\n\tif(pwd.value.length< 8) {\r\n\t\tresult.innerHTML = \"Password length min 8 letter\";\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "function validatePassword (string) {\n if (isEmpty(string)) return 1;\n if (isTooLong(string, 30)) return 2;\n return 0;\n}", "function judgePassword()\n{\n var password = document.getElementById(\"Password_Password\").value;\n clearDivText(\"Div_Password\");\n if(password.length < 6)\n {\n setDivText(\"Div_Password\", TYPE_ERROR, \"密码过短\");\n return false;\n }\n if(password.length > 20)\n {\n setDivText(\"Div_Password\", TYPE_ERROR, \"密码过长\");\n return false;\n }\n if(isTextSimple(password))\n {\n setDivText(\"Div_Password\", TYPE_CORRECT, \"\");\n return true;\n }\n else\n {\n setDivText(\"Div_Password\", TYPE_ERROR, \"密码不合法\");\n return false;\n }\n}", "function isValidPassword(input) {\n var lengthIsGood = input.length == 6;\n var hasAtLeastOneLetter = hasLetter(input);\n var hasAtLeastOneNumber = hasNumber(input);\n var hasLowerCaseLetter;\n var hasUpperCaseLetter;\n var alphaNumeric;\n\n return lengthIsGood && hasAtLeastOneLetter && hasAtLeastOneNumber && hasLowerCaseLetter && hasUpperCaseLetter && alphaNumeric;\n}", "validate(value) {\n if (value.toLowerCase().includes(\"password\")) {\n // biar gak asal input password jadi password\n throw Error(\"Your password is invalid!\");\n }\n }", "function validatePassword() {\r\n let pass1 = document.getElementById(\"pass\").value;\r\n let pass2 = document.getElementById(\"confirm-pass\").value;\r\n console.log(pass1);\r\n let regex = \"^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])[a-zA-Z0-9]{8,20}$$\";\r\n if (!pass1.match(regex)) {\r\n alert(\r\n \"Invalid password: 8-20 characters, at least 1 digit, lower and upper case alphabet.\"\r\n );\r\n return false;\r\n }\r\n\r\n if (pass1 != pass2) {\r\n alert(\"Passwords do not match.\");\r\n return false;\r\n }\r\n return true;\r\n}", "function passV() {\n var pass = document.getElementById('pass').value;\n if (pass.length == 0) {\n showWarning(\"Password field empty\");\n return false;\n } else if (pass.length < 2) {\n showWarning(\"Password must be minimum 3 characters long\");\n return false;\n }\n return true;\n\n}", "function checkPassword(){\n var passwordd = document.getElementById(\"passwordtext\");\n var regExp = /^[a-zA-Z0-9!@#$%^&*()_]$/;\n if(regExp.test(\"passwordd\"))\n {\n alert(\"Valid\");\n return true;\n }\n else{\n alert(\"Password must contain atleast one Uppercase,one Lwercase, one number and special characters\");\n return false;\n }\n \n}", "function validatePasswd() {\n var pass = document.getElementById('pass').value;\n var cpass = document.getElementById('cpass').value;\n return (pass === cpass && pass != \"\" && cpass != '');\n}", "isValidPassword(str) {\n\t\tif(str.length>=8)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "function validate_password()\n {\n const icon = DOM.new_password_validation_icon;\n const password = DOM.new_password_input.value;\n\n icon.style.visibility = \"visible\";\n\n if (security.is_valid_password(password))\n {\n icon.src = \"/icons/main/correct_white.svg\";\n return true;\n }\n else\n {\n icon.src = \"/icons/main/incorrect_white.svg\";\n return false;\n }\n }", "function checkpassword()\n{\n var pwd=document.getElementById(\"password\");\n var alp=/^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])[a-zA-Z0-9]{8,}$/;\n if(alp.test(pwd.value))\n {\n if(pwd.value.length>10)\n { pwd.style.border=\"solid green\";\n //alert(\"Strong password and valid format\");\n return true;\n }\n else\n {\n pwd.style.border=\"solid orange\";\n pwd.focus();\n alert(\"Valid format but medium password\");\n return false;\n }\n }\n else\n {\n pwd.style.border=\"solid red\";\n pwd.focus();\n alert(\"Password must be alphanumeric and minimum one uppercase and lower case letter and digit\");\n return false;\n } \n}", "function checkpwd()\n{\n var pwd=document.getElementById(\"password\");\n var alp=/^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])[a-zA-Z0-9]{8,}$/;\n //var a=/^([a-z][A-Z]+)$/;\n if(pwd.value==\"\")\n {\n alert(\"Password cannot be empty\");\n pwd.style.border=\"solid red\";\n pwd.focus();\n return false;\n }\n else{\n if(alp.test(pwd.value))\n {\n if(pwd.value.length>10)\n { pwd.style.border=\"solid green\";\n alert(\"Strong password and valid format\");\n return true;\n }\n else\n {\n pwd.style.border=\"solid orange\";\n pwd.focus();\n alert(\"Valid format but medium password\");\n return false;\n }\n }\n else\n {\n pwd.style.border=\"solid red\";\n pwd.focus();\n alert(\"Password must be alphanumeric and minimum one uppercase and lower case letter and digit\");\n return false;\n }\n }\n}", "validPassword(password) {\n return password.length > 3 &&\n password.search(/\\d/) !== -1 &&\n password.search(/[a-zA-z]/) !== -1;\n }", "function validarPassword(pPassword) {\n return pPassword.trim().length >= 8;\n}", "function pwd_validation(pwd){ \r\n //8-20 Characters, at least one capital letter, at least one number, no spaces\r\n //one lower case letter, one upper case letter, one digit, 6-13 length, and no spaces. \r\n var pwdReg = /^(?=.*\\d)(?=.*[A-Z])(?!.*\\s).{8,20}$/;\r\n return pwdReg.test(pwd); }", "function validatePassword(x) {\n if (\n /* x must contain at least 1 digit, at least one lowercase letter, at least one uppercase letter \n and must be a minimum of 8 characters in total\n */\n !/^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]).{8,}$/.test(x)\n ) {\n return false; //x is not in an appropriate format\n }\n return true;\n}", "function secondPass() {\n var errors = document.querySelector(\"#errors\");\n var password = document.querySelector(\"#secondPass\");\n var pass = password.value.trim();\n var patt = /^(?=.*[a-z])(?=.*\\d){8,16}$/ig;\n if(!patt.test(pass)) {\n return false;\n } \n else {\n return true;\n }\n}", "function valiatePassword(password) {\n var re = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[@$!%*?&])[A-Za-z\\d@$!%*?&]{8,}$/;\n var signupFormPasswordWarning = document.querySelector(\"#signupForm .form-container\").children[10];\n signupFormPasswordWarning.textContent = \"\";\n\n if (re.test(String(password)) == false) {\n signupFormPasswordWarning.textContent = \"Minimum eight characters, at least one uppercase letter, one lowercase letter, one number and one special character\";\n return false;\n } else {\n return true;\n }\n}", "function isValidPassword(password) {\n return checkStraight(password) && checkContainsLetters(password) && checkContainsPairs(password);\n}", "function validPass(password) {\n return password.length > 3 &&\n password.length < 20 &&\n /^(?=\\D*\\d)(?=[^a-z]*[a-z])[a-z\\d]+$/i.test(password)\n ? \"VALID\"\n : \"INVALID\";\n}", "function pwValid () {\n //Bring in Test Driven Development (TDD) \n //add a conditional \n if (isNaN(userLength) === true) {\n //could omit the === true since it already returns a boolean without it\n alert(\"Password length must be provided as a number. Please try again\");\n return;\n pwgenerator();\n }\n // ensures a reasonable length is input for the password\n if (userLength < 8 || userLength > 128) {\n alert(\"Password length may be too long or too short. Please select a number between 8 and 128 for maximum security purposes.\");\n return;\n pwgenerator();\n } \n }", "function validatePassword(p) {\n const passwordFormatRe = /^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[a-zA-Z]).{8,}$/;\n return passwordFormatRe.test(String(p));\n}", "function passwordCheck(form){\r\n var p1=signup.pass.value.trim();\r\n var p2=signup.repass.value.trim();\r\n var errors= document.querySelector(\".errmessage\");\r\n var charstring =\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\r\n var chars= \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\r\n var numstring =\"0123456789\";\r\n var passAlpha=false; \r\n var passNum=false; \r\n var passChar=false; \r\n\r\n\r\n if(p1.length<8){\r\n clear();\r\n errors.innerHTML+= \"<p>* Password must be at least 8 characters long. <p>\";\r\n signup.pass.focus();\r\n return false; \r\n }\r\n\r\n if(chars.indexOf(p1.substr(0,1))>=0){\r\n passChar=true;\r\n }\r\n if(!passChar){\r\n clear();\r\n errors.innerHTML+= \"<p>* Password must begin with a character. <p>\";\r\n signup.pass.focus();\r\n return false; \r\n }\r\n\r\n for(var i=0; i<p1.length; i++){\r\n clear(); \r\n if(charstring.indexOf(p1.substr(i,1))>=0){\r\n passAlpha=true;\r\n }\r\n }\r\n\r\n if(!passAlpha){\r\n errors.innerHTML+= \"<p>* Password must have at least one upper case letter. <p>\";\r\n signup.pass.focus();\r\n return false; \r\n }\r\n\r\n for(var i=0; i<p1.length; i++){\r\n clear(); \r\n if(numstring.indexOf(p1.substr(i,1))>=0){\r\n passNum=true;\r\n }\r\n }\r\n if(!passNum){\r\n errors.innerHTML+= \"<p>* Password must have at least one number. <p>\";\r\n signup.pass.focus();\r\n return false; \r\n }\r\n \r\n if(p2!=\"\" && p1!=p2){\r\n clear(); \r\n errors.innerHTML+= \"<p>* Passwords do not match! <p>\";\r\n signup.repass.focus();\r\n return false; \r\n }\r\n\r\n return true; \r\n}", "function isValidPassword(text)\n{\n//\tvar chardigit='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789/-_/!/@/#/$/%/^/&/*/~/.';\n//\tvar charset='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789/-_/!/@/#/$/%/^/&/*/~/.';\n\tvar chardigit='0123456789';\n\tvar charset='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz/-_/!/@/#/$/%/^/&/*/~/.';\n\tvar i=0;\n\tvar correctDigit='false';\n var correctChar='false';\n\n\tvar ch;\n\n\tif (text.length < 6 || text.length > 20){\n\t\talert('Mat khau phai co do dai tu 6 den 20 ky tu va chua ca chu lan so!');\n\t\treturn false;\n\t}\n i=0;\n //Check ky tu\n\twhile(i<text.length && correctChar=='false')\n\t{\n\t\tch=text.charAt(i);\n\t\tif(charset.indexOf(ch)>-1)//Neu la chua ky tu\n\t\t correctChar='true';\n i++;\n\n\t}//end of while\n\n //Check So\n while(i<text.length && correctDigit=='false' )\n\t{\n \tch=text.charAt(i);\n if(chardigit.indexOf(ch)>-1) //Neu la chua so\n\t\t correctDigit='true';\n\t\ti++;\n\n\t}//end of while\n\n\n\tif (correctChar=='true' && correctDigit=='true')\n\t\treturn true;\n\telse{\n\t\talert('Mat khau phai chua ca chu va so');\n\t\treturn false;\n\n\t}\n}//end of isValidPasswd(text)", "function checkPasswordLength(password) {\n return password.length > 0;\n}", "validate(value) {\n if (value.length < 6) {\n // if password too short or equals password, throw error\n throw new Error('password too short');\n // can use value.includes() can pass in multiple invalid passwords\n } else if (value === 'password') {\n throw new Error('pick a better password');\n }\n }", "validatePassword(password) {\n // at least 8 chars,\n // at least one alpha and one special character\n\n const patty = /[!@#$%&*()_+=|<>?{}\\[\\]~-]/;\n const specialExists = password.match(patty);\n\n const pat = /[A-Z]/;\n const capitalExists = password.match(pat);\n\n if (!specialExists || !capitalExists || !(password.length >= 8))\n throw new ValidationError(\n 'password',\n 'Password must contain at least one special character, one number, and one capital letter, and must be at least 8 characters long.'\n );\n }", "function validatePassword() {\n let oldPass = new Password(dom('#oldPassword').value)\n let newPass = new Password(dom('#newPassword').value)\n let newPassConfirm = new Password(dom('#newPassword2').value)\n let errorPrompt = dom('#passwordError')\n\n if (!newPass.match(newPassConfirm)) {\n errorPrompt.innerText = \"Passwords do not match\"\n return false\n }\n if (newPass.lessEq(7) || newPassConfirm.lessEq(7)) {\n errorPrompt.innerText = \"New password must be at least 8 characters\"\n return false\n }\n if (!oldPass.matchStr(\"test\")) {\n errorPrompt.innerText = \"Incorrect password\"\n return false\n }\n errorPrompt.innerText = \"\"\n return true\n}", "function checkPassword(inputText)\n{\n var regex = /[A-Z]/i;\n if(inputText.match(regex))\n {\n regex = /[0-9/]/i;\n if(inputText.match(regex))\n {\n return true;\n }\n else\n {\n return false;\n }\n }\n else\n {\n return false;\n }\n}", "function validatePass(){\r\n\t\r\n\tvar pass = document.getElementById(\"password\").value;\r\n\tvar pPass = document.getElementById(\"valPass\");\r\n\t\r\n\tif (pass.length < 8 || pass.length > 50)\r\n\t{\r\n \tpPass.innerHTML =\r\n\t\t\"Password length must be between 8 and 50 characters\";\r\n\t\tpPass.classList.remove(\"valid\");\r\n\t\tpPass.classList.add(\"invalid\");\r\n\t\r\n\t\treturn false;\r\n\t}\r\n\t else if(pass.search(/[a-z]/) < 0)\r\n\t{\r\n\t\tpPass.innerHTML = \r\n\t\t\"Password must contain a lowercase letter\";\r\n\t\tpPass.classList.remove(\"valid\");\r\n\t\tpPass.classList.add(\"invalid\");\r\n\t\treturn false;\r\n\t}\r\n\t else if(pass.search(/[A-Z]/) < 0)\r\n\t{\r\n\t\tpPass.innerHTML =\r\n\t\t\"Password must contain an uppercase letter\";\r\n\t\tpPass.classList.remove(\"valid\");\r\n\t\tpPass.classList.add(\"invalid\");\r\n\t\treturn false;\r\n\t}\r\n\telse if(pass.search(/[0-9]/) < 0)\r\n\t{\r\n\t\tpPass.innerHTML =\r\n\t\t\"Password must contain a digit\";\r\n\t\tpPass.classList.remove(\"valid\");\r\n\t\tpPass.classList.add(\"invalid\");\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\telse if(pass.search(/[!#$%&? \"]/) < 0)\r\n\t{\r\n\t\tpPass.innerHTML =\r\n\t\t\"Password must contain a special character\";\r\n\t\tpPass.classList.remove(\"valid\");\r\n\t\tpPass.classList.add(\"invalid\");\r\n\t\treturn false;\r\n\t}\r\n\telse \r\n\t{\r\n\t\r\n\t\tpPass.innerHTML =\r\n\t\t\"Valid Password\";\r\n\t\tpPass.classList.remove(\"invalid\");\r\n\t\tpPass.classList.add(\"valid\");\r\n\t\treturn true;\r\n\t}\r\n }", "function validatePassword(){\r\n\tvar submit = false;\r\n\tvar password = $(\"#password\").val();\r\n\t\tpassword = password.trim();\r\n\t\tif(password ==''){\r\n\t\t\tsubmit = showError('password',\"Please fill Password\");\r\n\t\t}\r\n\t\telse if(!(regPass.test(password)) || password.length < 8){\r\n\t\t\tsubmit = showError('password',\"Password must be alphanumeric and min 8 charaters\");\r\n\t\t}\r\n\t\telse{\r\n\t\t\tsubmit = markFieldCorrect(\"password\");\r\n\t\t}\r\n\t\treturn submit;\r\n}", "function lvalidate() {\n\tvar uid = document.getElementById(\"uid\").value;\n\tvar u = /^[0-9]{10}$/;\n\tvar pass = document.getElementById(\"pass\").value;\n\tvar p = /^[A-Za-z0-9]{6,8}$/;\n\tif (!uid.match(u)) {\n\t\talert('Invalid User id/mobile number');\n\t\treturn false;\n\t}\n\telse if (!pass.match(p)) {\n\t\talert('Enter valid password...password must be 6-8 aplhabets or digits');\n\t\treturn false;\n\t}\n\telse {\n\t\treturn true;\n\t}\n}", "function validatePwd(pwd) {\n var pwdPattern = new RegExp(\n \"^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$\"\n );\n var isValidPwd = pwdPattern.test(pwd);\n var pwdErr = document.getElementById(\"pwdErr\");\n\n if (isValidPwd == false) {\n pwdErr.innerHTML = \"Invalid Password\";\n pwdErr.style.color = \"red\";\n pwdErr.style.display = \"block\";\n } else {\n pwdErr.style.display = \"none\";\n }\n return isValidPwd;\n}", "function passLengthValid() {\n var errors = document.querySelector(\"#errors\");\n var pass = document.querySelector(\"#pass\").value;\n var password = document.querySelector(\"#secondPass\").value;\n if(!(pass.length == password.length)) {\n errorMessage(\"<p>Please make sure your passwords match!</p>\");\n return false;\n }\n return true;\n}", "function checkPassword(password){\n var pattern = /^.*(?=.{8,})(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%&]).*$/;\n if(pattern.test(password)){\n return true;\n }else{\n return false;\n }\n}", "function isPasswordValid(){\n message.textContent =\"\";\n if (isNaN(parseInt(length.value))){\n message.textContent += \"Password Length is not a number! \";\n message.setAttribute(\"style\", \"background-color: red; color: white;\");\n return false;\n }\n else if (parseInt(length.value) < 8 || parseInt(length.value) > 128){\n message.textContent += \"Length should be within 8 - 128! \";\n message.setAttribute(\"style\", \"background-color: red; color: white;\");\n return false;\n }\n \n let x = (lowCaps.checked + uppCaps.checked + numCaps.checked + spcCaps.checked);\n if (x === 0){\n message.textContent += \"You need at least one character type! \";\n message.setAttribute(\"style\", \"background-color: red; color: white;\");\n return false;\n }\n else {\n return true;\n }\n}", "function checkPassword() {\n\n\n\n}", "function checkpwd(){\n var x = $('#txt_password').val();\n console.log(x);\n if (x === \"12345678\"){\n return(true);\n } else {\n var pwdvalidation = false;\n return(false);\n }\n }", "function validate_user_pass(inputtxt)\n{\n\tvar passw= /^[A-Za-z]\\w{7,14}$/;\n\tif(inputtxt.match(passw))\n\t{\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n}", "function validPassword(str){\n\tpass = new RegExp(/^[a-zA-Z0-9\\W]{8,}$/);\n\tif (!pass.test(str)) {\n\t\treturn false;\n\t} \n\treturn true;\n}", "function isPasswordValid(password) {\n\n if(password === null || password === undefined) {\n return \"Enter password.\";\n }\n\n if(password.length <= 4) {\n return \"Password must be at least 5 characters.\";\n }\n\n if(password.indexOf(\" \") !== -1) {\n \n return \"Password must be one word.\";\n }\n return null;\n}", "function validatePassword() {\nlet message= '';\nif (!/.{6,}/.test(passwordInput.value)) {\n message = 'At least eight characters. ';\n}\nif (!/.*[A-Z].*/.test(passwordInput.value)) {\n message += 'At least one uppercase letter. ';\n}\nif (!/.*[!@#$%^&*].*/.test(passwordInput.value)) {\n message += 'At least one special characters.';\n}\nif (!/.*[0-9].*/.test(passwordInput.value)) {\n message += 'At least one number.';\n}\npasswordInput.setCustomValidity(message);\n}", "function checkPassword(p){\n var upper = /[A-Z]/;\n var lower = /[a-z]/; \n var number = /[0-9]/;\n var special = /[#$!%@^`&*()+=\\-\\[\\]\\';,.\\/{}|\":<>?~\\\\\\\\]/;\n\n var iUpper = 0;\n var iLower = 0;\n var iNums = 0;\n var iSpecials = 0;\n for (var i = 0, len = p.length; i < len; i++) {\n if(upper.test(p[i]))\n iUpper++;\n else if(lower.test(p[i]))\n iLower++;\n else if(number.test(p[i]))\n iNums++;\n else if(special.test(p[i]))\n iSpecials++;\n }\n if (iUpper == 0 || iLower == 0 || iNums == 0 || iSpecials == 0) {\n return false;\n }\n return true;\n}", "function isValidPassword(password) {\n return /([a-z])/.test(password) &&\n /[A-Z])/.test(password) &&\n /[0-9])/.test(password);\n}", "isValidPassword(text) {\n // if (text.match(PASSWORD_REGEX)) {\n this.props.isPasswordValid(1); //always valid\n // } else {\n // this.props.isPasswordValid(2);\n // }\n }", "function validatePassword(password) {\n var password_regex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\\$%\\^&\\*])(?=.{6,})/;\n return password_regex.test(String(password));\n}", "function checkPassword(input, value) {\n var result = false;\n \n // Checks if input value length is between 5 and 15 characters\n if (value.length < 5 || value.length > 15) {\n addInputError(input, \"Password must have between 5 and 15 characters!\");\n \n } else {\n result = true;\n }\n \n return result;\n}", "isValidPassword (password) {\n // don't use plaintext passwords in production\n return password === this.password;\n }", "function checkPassword() {\n\tvar password = document.getElementById(\"password\");\n\tvar check_password = document.getElementById(\"check-password\");\n\t\n\tif (isNull(password.value)) {\n\t\tpassword.style.background = \"#FDEDEC\";\n\t\tcheck_password.innerHTML = \"*Password not empty!\"\n\t} else if (!checkLength(password.value)) {\n\t\t\tcheck_password.innerHTML = \"*Password length min 8 letter.\";\n\t} else if (!checkValidate(password.value)) {\n\t\tcheck_password.innerHTML = \"*Password wrong format.\"\n\t} else {\n\t\tflagPassword = true;\n\t\tcheck_password.innerHTML = \"\";\n\t\tpassword.style.background = \"#FFF\";\n\t}\n}", "function ValidatePassword() {\n \n var rules = [{\n Pattern: \"[A-Z]\",\n Target: \"UpperCase\"\n },\n {\n Pattern: \"[a-z]\",\n Target: \"LowerCase\"\n },\n {\n Pattern: \"[0-9]\",\n Target: \"Numbers\"\n },\n {\n Pattern: \"[!@@#$%^&*_]\",\n Target: \"Symbols\"\n }];\n\n \n var password = $(\"#password\").val();\n \n //Checks if the lenght of the password is atleast 7 characters. \n $(\"#passwordLength\").removeClass(password.length > 6 ? \"passwordValidationFalseColor\" : \"passwordValidationTrueColor\");\n $(\"#passwordLength\").addClass(password.length > 6 ? \"passwordValidationTrueColor\" : \"passwordValidationFalseColor\");\n \n\n //Checks for the others rules as states above and displays the color (red for unfulfilled conditons and green for fulfilled) accordingly. \n for (var i = 0; i < rules.length; i++) {\n $(\"#\" + rules[i].Target).removeClass(new RegExp(rules[i].Pattern).test(password) ? \"passwordValidationFalseColor\" : \"passwordValidationTrueColor\"); \n $(\"#\" + rules[i].Target).addClass(new RegExp(rules[i].Pattern).test(password) ? \"passwordValidationTrueColor\" : \"passwordValidationFalseColor\");\n }\n }", "function validate() {\n return okusername && checkPass();\n}", "function passwordOpts(userNumValid) {\n if (isNaN(userNumValid)) {\n alert(\"Please enter a valid number.\");\n return false;\n } else if (parseInt(userNumValid) < 8) {\n alert(\"Password length must be at least 8 characters.\");\n return false;\n } else if (parseInt(userNumValid) >= 128) {\n alert(\"Password must be less than 129 characters.\");\n return false;\n }\n return true;\n}", "function CheckPassword(inputtxt) \n{ \nvar passw= /^[A-Z, a-z, 0-9]/;\nif(inputtxt.value.match(passw)) \n{ \nalert('Correct, try another...')\nreturn true;\n}\nelse\n{ \nalert('Wrong...!')\nreturn false;\n}\n}", "function checkPass(string) {\n let pass1 = /[A-Z]/;\n let pass2 = /\\d\\W/;\n if (pass1.test(password) && pass2.test(password)) {\n return true;\n } else {\n return false;\n }\n}", "function validiraj_pass(){\n\n var pattern = /^(?=.*[A-Za-z])(?=.*\\d)[A-Za-z\\d]{6,}$/;\n var tekst = document.getElementById(\"forma\").pass_input.value;\n var test = tekst.match(pattern);\n\n if (test == null) {\n document.getElementById(\"pass_error\").classList.remove(\"hidden\");\n valid_test = false;\n } else{\n console.log(\"validiran pass\");\n document.getElementById(\"pass_error\").classList.add(\"hidden\");\n }\n }", "testPassword (pwd) {\n // TODO : creer une regex logique pour un password\n var regexpwd = /^\\D+$/\n return regexpwd.test(pwd)\n }", "function isValidPassword(str)\n{\n return /^(?=.*[\\d])(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*])[\\w!@#$%^&*]{8,}$/.test(str);\n}", "function checkPasswordMatch(input1 , input2){\n if(input1.value !== input2.value){\n showError(input2,'Password do not match');\n }\n}" ]
[ "0.8636811", "0.8322139", "0.8284327", "0.821419", "0.8108004", "0.8106444", "0.8081049", "0.8064388", "0.80379236", "0.80311745", "0.80173665", "0.7998091", "0.7988798", "0.7981248", "0.7959785", "0.7926897", "0.7920558", "0.791664", "0.7916487", "0.7901953", "0.7891962", "0.7885628", "0.7885628", "0.7883346", "0.7882909", "0.78780323", "0.7854108", "0.7843289", "0.78261006", "0.78145176", "0.7812671", "0.78092194", "0.7798925", "0.77950364", "0.77863944", "0.7779178", "0.7771104", "0.7767558", "0.7753416", "0.77503407", "0.7743811", "0.774199", "0.77362794", "0.77246594", "0.7723464", "0.7721256", "0.77173156", "0.7710722", "0.7694912", "0.76902986", "0.76891154", "0.768648", "0.7683182", "0.76739717", "0.7668453", "0.76452005", "0.7633578", "0.76297075", "0.7628687", "0.76217574", "0.76215076", "0.7607167", "0.7601427", "0.76003325", "0.7593793", "0.75800437", "0.75603384", "0.7559905", "0.7555342", "0.75546354", "0.75487125", "0.7541819", "0.7541385", "0.75388795", "0.75339663", "0.7527834", "0.75269365", "0.7524601", "0.7520966", "0.7519651", "0.7516667", "0.75139177", "0.7500059", "0.7496727", "0.74937475", "0.74931526", "0.74803025", "0.7474739", "0.7474475", "0.74649405", "0.74634075", "0.74585056", "0.7453622", "0.74519944", "0.74453443", "0.74426126", "0.7435435", "0.7434326", "0.74336624", "0.74328667" ]
0.74818027
86
function check validation of email
function InvalidEmail(textbox){ /**set regex for email. Patter specify string before @ and after @ */ var regular=/^(([^<>()[\]\\.,;:\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,}))$/; /**update validation textbox content */ if (textbox.value === '') { textbox.setCustomValidity('Entering an email is necessary!'); }else if (!textbox.value.match(regular)) { textbox.setCustomValidity('Please enter valid email address'); }else{ textbox.setCustomValidity(''); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkEmail() {}", "function validarEmail(email){expr=/^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;if(!expr.test(email)) return false;else return true;}", "function emailValid(){\n if(/\\S+@\\S+\\.\\S+/g.test(email)){\n setErrors('')\n return true\n }else{\n setErrors('Email is not valid!')\n }\n return false\n }", "function email(){\n var emailReg =/[a-z].*(@)[a-z]*(.)[a-z]{2,}$/;\n var validEmail = document.getElementById('email').value;\n if (emailReg.test(validEmail) === false)\n {\n throw \"invalid email address\";\n }\n }", "function emailValidation(){\n if (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(emailNode.value)){\n return true;\n }\n alert(\"You have entered an invalid email address!\");\n return false;\n }", "function validateEmail() {\r\n 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,}))$/;\r\n return re.test(email.val());\r\n}", "function checkEmail() {\r\n const emailValue = email.value.trim();\r\n\r\n var mailformat = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/;\r\n if (emailValue === '' || !emailValue.match(mailformat)) {\r\n isValid &= false;\r\n setErrorFor(email, 'Email not valid');\r\n return;\r\n }\r\n\r\n isValid &= true;\r\n}", "function validateEmail(email) {\n\tvar valid \n\treturn valid = /\\S+@\\S+\\.\\S+/.test(email);\n}", "function simpleEmailValidation(emailAddress) {\n\n}", "function validateEmail(email) \r\n{\r\n var re = /\\S+@\\S+\\.\\S+/;\r\n return re.test(email);\r\n}", "function emailIsValid(email) {\n return /\\S+@\\S+\\.\\S+/.test(email);\n }", "function checkEmail(email) {\n 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,}))$/;\n if(re.test(email.value.trim())){\n showSuccess(email);\n } else {\n showError(email, 'Email is not valid');\n }\n\n}", "function checkEmail() {\n var pattern = new RegExp(/^[+a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$/i);\n \n if (pattern.test(emailInput.val())) {\n emailInput.removeClass(\"error\");\n $(\"#email_error_message\").hide();\n }\n else {\n $(\"#email_error_message\").html(\"Enter valid email address\");\n $(\"#email_error_message\").show();\n emailInput.addClass(\"error\");\n error_email = true;\n }\n }", "function email() {\n var errors = document.querySelector(\"#errors\");\n var email = document.querySelector(\"#email\");\n var string = email.value.trim();\n var patt = /^[a-z0-9_\\-\\.]+\\@[a-z]+\\.[a-z]{2,4}$/i;\n if(!patt.test(string)) {\n errorMessage(\"<p>Please enter a valid Email address</p>\");\n return false;\n } else {\n return true;\n }\n}", "function check_email() {\n\n\t\tvar pattern = new RegExp(/^[+a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$/i);\n\t\n\t\tif(pattern.test($(\"#email\").val())) {\n\t\t\t$(\"#erroremail\").hide();\n\t\t} else {\n\t\t\t$(\"#erroremail\").html(\"Direccion inválida\");\n\t\t\t$(\"#erroremail\").show();\n\t\t\terror_email = true;\n\t\t}\n\t\n\t}", "function validateEmail(email)\r\n{\r\n var re = /\\S+@\\S+\\.\\S+/;\r\n return re.test(email);\r\n}", "function validateEmail(){\n\tvar re = /^([\\w-]+(?:\\.[\\w-]+)*)@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,6}(?:\\.[a-z]{2})?)$/i;\n var result = re.test($.txtfieldMail.value);\n if(result == 0){\n \t$.txtfieldMail.value = \"\";\n \tutilities.showAlert(Alloy.Globals.selectedLanguage.forgotUsername,Alloy.Globals.selectedLanguage.invalidmail,function(){});\n }\n}", "function validate_email() {\n return email.length > 0 && email.length < 50;\n }", "function checkmail(){\r\n\tif((/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(email.val())))\r\n\t\treturn true;\r\n\treturn false;\r\n}", "function checkEmail(input){\n const 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,}))$/;\n if(re.test(input.value.trim())){\nshowSuccess(input);\n }else{\nshowError(input,\"Email is not valid\");\n }\n}", "function validate_email(field,alerttxt)\r\n{\r\n\tif (/^\\w+([\\+\\.-]?\\w+)*@\\w+([\\+\\.-]?\\w+)*(\\.\\w{2,6})+$/.test(field.value))\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\telse \r\n\t{\r\n\t\tshow_it(field,alerttxt)\r\n\t\treturn false;\r\n\t}\r\n}", "function validateEmail (email) {\n return /\\S+@\\S+\\.\\S+/.test(email)\n}", "function checkEmail(input){\r\n 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,}))$/;\r\n if(re.test(input.value.trim())){\r\n showSuccess(input);\r\n }else{\r\n showError(input, ' email is not valid');\r\n }\r\n}", "function checkEmail(input){\n const 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,}))$/;\n if(re.test(input.value.trim())){\n showSuccess(input);\n }\n else{\n showError(input, \"Email is not valid\");\n }\n}", "function validarEmail(email) {\n\n expr = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\n if ( !expr.test(email) )\n swal(\"Error: Correo Incorrecto\", \"\", \"info\");\n \n\n }//end function validarEmail", "function emailValidation()\n {\n let re = /\\S+@\\S+\\.\\S+/;\n if (re.test(emailText)==false)\n {\n setErrorEmail(\"אנא הזן אימייל תקין\");\n setValidEmail(false);\n }\n else\n {\n setErrorEmail(\"\");\n setValidEmail(true);\n } \n }", "function validateEmail(){\n var regex = /([a-z]*|[A-Z]*)(@)([a-z]*|[A-Z]*)(.com)$/;\n if(regex.test(signUpEmail.value) == true){\n return true;\n }else{\n return false;\n }\n}", "function validateEmail(email) {\r\n var filter = /^[\\w\\-\\.\\+]+\\@[a-zA-Z0-9\\.\\-]+\\.[a-zA-z0-9]{2,4}$/;\r\n if (filter.test(email)) {\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n }", "function ValidateEmail(email)\n{\n var re = /\\S+@\\S+\\.\\S+/;\n return re.test(email);\n}", "validateEmail(mail) {\n if (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(mail)) {\n return (true)\n }\n alert(\"You have entered an invalid email address!\")\n return (false)\n }", "function afficherEmail() {\n return isValidEmail(email.value);\n}", "function emailCheck(email) {\n\tatSplit = email.split('@');\n\tif (atSplit.length == 2 && alphaNumCheck(atSplit[0])) {\n\t\tperiodSplit = atSplit[1].split('.')\n\t\tif (periodSplit.length == 2 && alphaNumCheck(periodSplit[0] + periodSplit[1])) {\n\t\t\treturn true;\n\t\t}\n\t}\n\tvalCheck = false;\n\treturn false;\n}", "function checkEmail() {\n\tvar email = document.getElementById(\"email\").value;\n\tvar emailCheck = new RegExp(/\\S+\\S+\\.([a-z]|[A-Z]){1,5}/g);\n\t\n\tif (email == \"\"){\t\n\t} else {\n\t\tif (emailCheck.test(email)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\talert(\"Not at valid email!\");\n\t\t\treturn false;\n\t\t}\n\t}\n}", "function check_email_req(email){\n var testEmail = /^[A-Z0-9._%+-]+@([A-Z0-9-]+\\.)+[A-Z]{2,4}$/i;\n if (testEmail.test(email)){\n return true;\n }\n\n return false;\n }", "function validar_email(email) {\r\n var patron = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\r\n return patron.test(email) ? true : false;\r\n }", "function isValidationEmail($email) {\n\t\t var emailReg = /^([\\w-\\.]+@([\\w-])+([\\w-]+\\.)+[\\w-]{2,4})?$/;\n\t\t return emailReg.test( $email );\n\t }", "validateEmail(email) {\n if(email.length > 0) {\n const regex = /^([a-zA-Z0-9_\\-.]+)@([a-zA-Z0-9_\\-.]+)\\.([a-zA-Z]{2,5})$/;\n return regex.test(email);\n }\n return false;\n }", "function validateEmail(email) {\n var re = /\\S+@\\S+\\.\\S+/;\n return re.test(email);\n}", "function validate(a) {\n var email = a.value;\n var email_invalid = false;\n if (!validateEmail(email)) {\n return true;\n }\n return false;\n}", "function checkEmail(input){\n const 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,}))$/;\n if( re.test(input.value.trim())) {\n showSuccess(input.value);\n } else {\n showError(input, 'Email is not Valid');\n }\n}", "function validateEmail() {\n $scope.errorEmail = false;\n\t\t\tif(!/^([\\da-z_\\.-]+)@([\\da-z\\.-]+)\\.([a-z\\.]{2,6})$/.test($scope.email)) {\n\t\t\t\t$scope.errorEmail = true;\n $scope.messageEmail = 'E-mail address has a wrong format.';\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvar data = {\n\t\t\t\t\taction: \"validateEmail\",\n\t\t\t\t\temail: $scope.email\n\t\t\t\t};\n\n // Calls the validate e-mail method in the registration factory.\n RegistrationFactory.validateEmail(data)\n .then(function(response) {\n if(typeof(response) == 'string') {\n $scope.errorEmail = true;\n $scope.messageEmail = 'An unexpected error occurred while e-mail address is validated. Please try again.';\n }\n else if (response[0]) {\n $scope.errorEmail = true;\n $scope.messageEmail = 'E-mail address is already registered.';\n }\n });\n\t\t\t}\n }", "function isValidEmail(email){\n if(email==''){\n return false;\n }\n // ....\n return true;\n}", "function checkEmail(n)\r\n{\r\n\treturn n.search(/^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+$/)!=-1?!0:!1\r\n\t\r\n}", "function validateEmail(){\r\n\r\n \t\tvar email=document.getElementById(\"email\").value;\r\n\r\n\r\n \tif(email.length==0){\r\n\r\n \t\t\tprintError(\"email required\",\"emailError\",\"red\");\r\n\t\ttextboxBorder(\"email\");\r\n\t\treturn false;\r\n\r\n \t}\r\n \tif(!email.match(/^[a-z0-9](\\.?[a-z0-9_-]){0,}@[a-z0-9-]+\\.([a-z]{1,6}\\.)?[a-z]{2,6}$/)){\r\n \t\tprintError(\"enter Valid email\",\"emailError\",\"red\");\r\n\t\ttextboxBorder(\"email\");\r\n\t\treturn false;\r\n\r\n \t}\r\n\r\n\r\n\tprintSuccess(\"email\",\"green\",\"emailError\");\r\nreturn true;\r\n\r\n\r\n \t}", "function checkEmail(input){\n const 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,}))$/;\n if (re.test(input.value.trim())) {\n showSuccess(input);\n } else {\n showError(input);\n }\n}", "function validateEmail(emailUT) {\n var filter = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/; \n\n if(!filter.test(emailUT.value)) {\n \tmyApp.alert(\"Invalid email address\", \"Login Failed\");\n \treturn false;\n } else {\n \treturn true;\n }\n}", "function validEmail(check){\n return /^\\w+@\\w+(\\.(\\w)+)$/i.test(check.value);\n}", "function checkEmail() {\n return validator.isEmail(this.email);\n}", "function emailValidator() {\n const divParent = email.parentNode\n const emailReg = new RegExp('^[a-zA-Z0-9.-_]+[@]{1}[a-zA-Z0-9.-_]+[.]{1}[a-z]{2,10}$', 'g') // Expression régulière à respecter\n if (!emailReg.test(email.value)) { // On teste l'email sur la base de la RegExp\n divParent.setAttribute('data-error-visible', 'true')\n divParent.setAttribute('data-error', 'Vous devez entrer votre email')\n return false\n } else {\n divParent.setAttribute('data-error-visible', 'false')\n return true\n }\n}", "function checkEmail(input){\n\n const exp = /^(([^<>()[\\]\\\\.,;:\\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,}))$/; \n\n if(exp.test(input.value)){\n success(input);\n } else{\n error(input, \"Wrong email address!\");\n }\n}", "function checkEmail() {\n\t\tvar email=document.sform.eml.value;\n\t\tif (email==\"\") {\n\t\t\talert (\"Please enter a valid email.\");\n\t\t\tdocument.sform.eml.focus();\n\t\t\treturn false;\n\t\t} \n\t\telse if (!(email.includes(\"@\"))) {\n\t\t\talert (\"Please enter a valid email.\");\n\t\t\tdocument.sform.eml.value=\"\";\n\t\t\tdocument.sform.eml.focus();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function emailTest(email){ // create function emailTest assign email parameter\n var userName = /(^[a-zA-Z])[a-zA-Z0-9_]+@[a-zA-Z0-9]+\\.[a-zA-Z]{1,}$/ // var userName tests the email to verify the input. ^ checks that the first characters are letters. then it tests that the \n \t\t\t\t\t// letters can be capital or lower case, that there is an @ sign, that the next charcters are letters (capital and lower)\n if (check.test(email)){ //next checks that there is a dot, then letters (again capital and lower) the 1 makes sure there is a least letter after the dot\n \talert(\"true\"); \t\t// check.test varifies the email input by user, if it \n } else{\t\t\t\t\t// email address has all of input varified, an alert will \n \talert(\"false\"); \t// display true, if not, the alert will says false\n }\n}", "function checkemail(input){\n const 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,}))$/;\n // return re.test(String(email).toLowerCase());\n if(re.test(input.value)){\n showsuccess(input);\n }else{\n showerror(input,'Email is not valid');\n }\n }", "function checkEmail(input) { \n const 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,}))$/;\n if (re.test(input.value.trim())) {\n showSuccess(input);\n } else {\n showError(input, 'Email is not valid');\n }\n}", "handleEmailCheck(email){\n return /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/.test(email)\n }", "function checkEmail(element) {\n\t\tvar thisRow = element.parent().parent();\n\t\tvar title = thisRow.children().get(0).innerText;\n\t\tvar str = element.val().trim();\n\n\t\tvar regex = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\n\t\tif (!regex.test(str)) {\n\t\t\tif (thisRow.children().get(2) == undefined) {\n\t\t\t\tthisRow.append(\"<td class='validate'>\" + title + \" Wrong email format.</td>\");\n\t\t\t} else {\n\t\t\t\tthisRow.children().get(2).remove();\n\t\t\t\tthisRow.append(\"<td class='validate'>\" + title + \" Wrong email format.</td>\");\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function emailValidation(email){\n const regEx = /\\S+@\\S+\\.\\S+/;\n const patternMatch = regEx.test(email);\n return patternMatch;\n}", "function validateEmail(email) //source: http://form.guide/best-practices/validate-email-address-using-javascript.html\n {\n \t /* Simple Regex that passes for almost every valid email */\n var re = /^(?:[a-z0-9!#$%&amp;'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&amp;'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])$/;\n return re.test(email); //Returns True if Emails Passes Test\n /* Currently not being used, but may be useful in the future */\n }", "function checkmail(){\r\n\tif((/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(compMail.val())))\r\n\t\treturn true;\r\n\treturn false;\r\n}", "function validateEmail(email) {\n\t\tvar re = /\\S+@\\S+\\.\\S+/;\n\t\treturn re.test(email);\n\t}", "function check_field_email(email) {\n var regex = /^([a-zA-Z0-9_\\.\\-\\+])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\n if (!regex.test(email)) {\n set_message('error', 'Invalid email. Please enter a valid email.');\n clear_message();\n return true;\n }\n return false;\n}", "function validateEmail(email) \n{\n var pattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,6}$/;\n if(email.match(pattern))\n {\n return true;\n }\n return false;\n}", "function checkEmail(email) \n{ \n var mailformat = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/; \n if(email.match(mailformat)) \n return true; \n else \n return false;\n}", "function validateEmail() {\n var email = document.getElementById(\"email\").value;\n if (/\\S+@\\S+\\.\\S+/.test(email)) {\n return true;\n }\n alert(\"Email inválido!\")\n return false;\n}", "function validate(email) {\n\n if (validateEmail(email)) {\n return true\n } else {\n return false\n }\n return false;\n}", "function checkEmail(input) {\n const 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,}))$/;\n if (re.test(input.value.trim())) {\n showSuccess(input);\n return true;\n }\n else {\n showError(input, 'Email is not valid');\n return false;\n }\n}", "function validateEmail(email) {\n var re = /\\S+@\\S+\\.\\S+/;\n return re.test(email);\n}", "function validateEmail(email) {\n var re = /\\S+@\\S+\\.\\S+/;\n return re.test(email);\n}", "function validateEmail(email) {\r\n const 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,}))$/;\r\n if(re.test(String(email).toLowerCase())){\r\n //alert(\"Validacija email adrese izvrsena\" + email)\r\n \r\n } else {\r\n alert(\"Niste unijeli validan email, molimo pokušajte ponovo!\");\r\n }\r\n}", "function EmailValidation(getEmail) {\n var regExp = /^[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*@[0-9a-zA-Z]([-_.]?[0-9a-zA-Z])*.[a-zA-Z]{2,3}$/i;\n if (regExp.test(getEmail)) return true;\n else return false;\n}", "function emailValidate(email) {\n let mailFormat = /^([A-Za-z0-9_\\-\\.]+)@([A-Za-z0-9-]+).([A-Za-z]{2,8})(.[A-Za-z]{2,8})?$/; \n if (mailFormat.test(email)) /* (email.value.match(mailFormat)) */ {\n return true;\n }\n else {\n alert('Invalid Email Address');\n return false;\n }\n}", "function validateEmail(email)\n{\n var splitted = email.match(\"^(.+)@(.+)$\");\n if (splitted == null) return false;\n if (splitted[1] != null)\n {\n var regexp_user = /^\\\"?[\\w-_\\.]*\\\"?$/;\n if (splitted[1].match(regexp_user) == null) return false;\n }\n if (splitted[2] != null)\n {\n var regexp_domain = /^[\\w-\\.]*\\.[A-Za-z]{2,4}$/;\n if (splitted[2].match(regexp_domain) == null)\n {\n var regexp_ip = /^\\[\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\]$/;\n if (splitted[2].match(regexp_ip) == null) return false;\n } // if\n return true;\n }\n return false;\n}", "function checkMail()\n {\n email = $('#ftven_formabo_form_email').val();\n var emailPattern = /^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n return (emailPattern.test(email));\n }", "function validate_email(email) {\n if (email.length > 0) {\n var regexp = /^[A-Z0-9._%+-]+@(?:[A-Z0-9-]+.)+[A-Z]{2,4}$/i;\n return regexp.test(email);\n }\n return false;\n}", "function validateEmailField(email) {\n if (email.indexOf(\"@\") > -1) {\n if (email.split(\"@\").length == 2 && email.split(\"@\")[1] != \"\") {\n return true;\n }\n return false;\n }\n return false;\n}", "function validateEmail(mail) \n { \n if (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(mail)) \n { \n return (true);\n } \n return (false); \n}", "function ValidateEmail(mail) \n{\n if (/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/.test(mail))\n {\n return (true)\n }\n // alert(\"You have entered an invalid email address!\")\n return (false)\n}", "function validate_Email(sender_email) {\n var expression = /^[\\w\\-\\.\\+]+\\@[a-zA-Z0-9\\.\\-]+\\.[a-zA-z0-9]{2,4}$/;\n if (expression.test(sender_email)) {\n return true;\n }\n else {\n return false;\n }\n }", "function validate_Email(sender_email) {\n var expression = /^[\\w\\-\\.\\+]+\\@[a-zA-Z0-9\\.\\-]+\\.[a-zA-z0-9]{2,4}$/;\n if (expression.test(sender_email)) {\n return true;\n }\n else {\n return false;\n }\n }", "function validateEmail(anEmail) {\n var mailFormat = /^\\W+([\\.-]?\\W+)*@\\W+([\\.-]?\\W+)*(\\.\\W{2,3})+$/;\n if (anEmail.value.match(mailFormat)) {\n return true;\n } else {\n alert(\"The email format is wrong\");\n anEmail.style.border = \"2px solid red\";\n anEmail.focus();\n return false;\n }\n }", "_emailValidation(emailString) {\n console.log(emailString)\n if (/(.+)@(.+){2,}\\.(.+){2,}/.test(emailString)) {\n return true\n } else {\n return false\n }\n }", "function validateEmail() \n{\n if (/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/.test(testForm.email.value))\n {\n return (true)\n }\n alert(\"You have entered an invalid email address!\")\n return (false)\n}", "function ValidateEmail(mail) {\n if (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(mail)) {\n return (true)\n }\n //alert(\"You have entered an invalid email address!\")\n return (false)\n}", "function validateEmail(email) {\n email.value == null ? email.value = \" \" : email.value\n var atpos = email.value.indexOf(\"@\");\n var dotpos = email.value.lastIndexOf(\".\");\n if (atpos<1 || dotpos<atpos+2 || dotpos+2>=email.value.length) {\n document.querySelector('.email-error').style.display = \"inline\";\n return false;\n }\n document.querySelector('.email-error').style.display = \"none\";\n return true;\n}", "function is_email(email){ \r\n var emailReg = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$/;\r\n return emailReg.test(email); }", "function ValidateEmail(mail) \n{\n if (/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/.test(mail))\n {\n return (true)\n }\n alert(\"You have entered an invalid email address!\")\n return (false)\n}", "function validateEmail(email) {\n const validFormat = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email);\n if (!validFormat) {\n // alert('Please enter a valid email');\n return false;\n }\n return true;\n}", "function validateEmailFormat()\n{\n var status;\n var x = $(\"#email\").val();\n var atpos = x.indexOf(\"@\");\n var dotpos = x.lastIndexOf(\".\");\n if (atpos < 1 || dotpos < atpos + 2 || dotpos + 2 >= x.length)\n {\n status = \"invalid\";\n }\n return status;\n}", "function checkemail(email) { \nre = /^\\w+([.-]?\\w+)@\\w+([.-]?\\w+)(.\\w{2,3})+$/;\n if (!(re.test(email))) {\n\talert(\"Please enter a valid email address\");\n\tjQuery(\"#email\").focus();\n\treturn false; }\n\treturn true; }", "function validateEmail(mail)\n{\n return (/^\\w+([.-]?\\w+)*@\\w+([.-]?\\w+)*(\\.\\w{2,3})+$/.test(mail))\n}", "function validateEmail(){\r\n\t\tvar x = document.survey_form.email.value; //get the value\r\n\t\tvar emailPattern = /^[a-zA-Z._-]{1,25}[@][a-zA-Z]{1,25}[.][a-zA-Z]{3}$/; //variable storing the pattern\r\n\t\tvar emailPattern2 = /^[a-zA-Z._-]{1,25}[@][a-zA-Z]{1,25}[.][a-zA-Z]{1,25}[.][a-zA-Z]{3}$/; //variable storing the pattern\r\n\t\tif(emailPattern.test(x) ||emailPattern2.test(x)){;}\r\n\t\telse{alert(\"Please enter an email address. For example: name@email.com\")}\r\n\t}", "function checkEmail(input) {\n const 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,}))$/;\n if (re.test(input.value.trim())) {\n showSuccess(input);\n } else {\n showError(input, 'Emmail is not valid');\n }\n}", "validateEmail(value) {\n let error;\n if (!value) {\n error = 'Required';\n } else if (!/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$/i.test(value)) {\n error = 'Invalid email address';\n }\n return error;\n }", "function ValidateEmail(email) {\n $('.text-error').remove();\n // Проверка e-mail\n\n let reg = /^\\w+([\\.-]?\\w+)*@(((([a-z0-9]{2,})|([a-z0-9][-][a-z0-9]+))[\\.][a-z0-9])|([a-z0-9]+[-]?))+[a-z0-9]+\\.([a-z]{2}|(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum))$/i;\n let inputEmail = email;\n let valEmail = (inputEmail.val()) ? inputEmail.val() : false;\n\n if (!valEmail) {\n inputEmail.after('<span class=\"text-error for-booking\">Поле должно быть заполненно</span>');\n $('.for-booking').css({ top: inputEmail.position().top + inputEmail.outerHeight() + 2 });\n return valEmail;\n }\n inputEmail.toggleClass('error', valEmail);\n\n if (!reg.test(valEmail)) {\n valEmail = false;\n inputEmail.after('<span class=\"text-error for-email\">Вы указали недопустимый e-mail</span>');\n $('.for-email').css({ top: inputEmail.position().top + inputEmail.outerHeight() + 2 });\n } else valEmail = true;\n inputEmail.toggleClass('error', valEmail);\n\n return valEmail;\n }", "function emailIsValid() {\n\n var myPattern = /^[-a-z0-9~!$%^&*_=+}{\\'?]+(\\.[-a-z0-9~!$%^&*_=+}{\\'?]+)*@([a-z0-9_][-a-z0-9_]*(\\.[-a-z0-9_]+[a-z][a-z])|([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}))(:[0-9]{1,5})?$/i;\n var emailValue = $mail.val();\n\n var isValid = emailValue.search(myPattern) >= 0;\n return (isValid);\n }", "function emailValidate(email){\n const emailCorrect = /\\S+@\\S+\\.\\S+/;\n if((email.charAt(0)===\".\")||(email===\"\")){\n return \"your email is invalid\" \n }\n else if(email.match(emailCorrect)){\n return true\n }\n else{\n return \"your email is invalid\"\n }\n\n}", "function validEmail(value) {\n const addy = /\\S+@\\S+\\.\\S+/;\n if (value.match(addy)) return true;\n else return \"Please enter a valid email address.\";\n}", "function checkEmail(email) {\n //if (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(email)) {\n if (/^([a-zA-Z0-9_\\.\\-\\+])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/.test(email)) {\n return true;\n } else {\n return false;\n }\n}", "function isEmail() {\r\n\tvar email = document.getElementById(\"email\");\r\n\tvar result = document.getElementById(\"email-error\");\r\n\tresult.innerHTML = \"\";\r\n\tvar regexEmail = new RegExp(\"^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\\\.[a-zA-Z]{2,6}$\");\r\n\tif(email.value === \"\") {\r\n\t\tresult.innerHTML = \"Please input your email\";\r\n\t\treturn false;\r\n\t}\r\n\tif(!regexEmail.test(email.value)) {\r\n\t\tresult.innerHTML = \"Email wrong format\";\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "function emailValidate(str){return /\\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}\\b/i.test(str/*email*/)} //@return{boolean} True if str is valid email address //@param{string} str The string to be tested // Should be copy/pasted to client-side JS // function test(){var ar=[\"random@example\",\"random@example.com\",\"randomexample.com\"],i=ar.length,out=[];while(i--){out.push(emailValidate(ar[i]))}Logger.log(out)} // Sample call: if(!LibraryjsUtil.emailValidate(email)){alert(\"Enter valid email address.\");return} // References: http://www.regular-expressions.info/email.html | http://www.regexmagic.com/patterns.html // Note: Since this function is usually called client-side, we might want to copy/paste; a sample call might resemble this: if(!/\\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}\\b/i.test(email)){alert(\"Enter valid email address.\");return}", "function ValidEmail(field)\n{\n\t\t\t\tif(field.value == \"\")\n\t\t\t\t\t return true;\n\t\tif ((field.value.indexOf(\"@\") < 1) || (field.value.indexOf(\".\") < 1))\n\t\t{\n\t\t\t\t\tDspAlert(field,Message[29]);\n\t\t\t\t\treturn false;\n\n\t\t}\n\t\treturn true;\n\n}" ]
[ "0.8688694", "0.8444328", "0.84381914", "0.83712006", "0.834653", "0.8331678", "0.83203065", "0.83201474", "0.8318403", "0.8309891", "0.8304819", "0.82466", "0.8241919", "0.823395", "0.8232771", "0.8232654", "0.8231609", "0.8229886", "0.82072306", "0.81679684", "0.8167925", "0.8162004", "0.81436956", "0.81349325", "0.81308836", "0.81211746", "0.8113202", "0.8111827", "0.8105565", "0.81026876", "0.8096781", "0.8075877", "0.80753636", "0.807459", "0.80604583", "0.80513966", "0.80466694", "0.80442244", "0.803925", "0.80363846", "0.80361706", "0.80358666", "0.8033844", "0.8032862", "0.8032446", "0.802192", "0.8021039", "0.8021004", "0.8020514", "0.8008493", "0.8002252", "0.80014515", "0.79997754", "0.7999532", "0.7995854", "0.79828274", "0.79803693", "0.79799837", "0.79765713", "0.7974382", "0.7969445", "0.7969408", "0.7961363", "0.79581416", "0.79577464", "0.7954845", "0.795467", "0.795467", "0.7948945", "0.794828", "0.79440665", "0.79405403", "0.7938116", "0.7936412", "0.792838", "0.79254633", "0.7922076", "0.79194665", "0.79194665", "0.79177874", "0.79176426", "0.79108596", "0.79042774", "0.790321", "0.79005563", "0.78972936", "0.7892492", "0.7891723", "0.78896266", "0.7889161", "0.788741", "0.7884385", "0.78833973", "0.78807664", "0.7875399", "0.7872773", "0.78713745", "0.7865771", "0.78648216", "0.7863095", "0.7863" ]
0.0
-1
function check the validation of phone input
function InvalidPhone(textbox){ /** Set regex as start with 61 and with 8 digital input*/ var regular=/(?:\+?61)?(?:\(0\)[23478]|\(?0?[23478]\)?)\d{8}/; /**update validation textbox content */ if (textbox.value === '') { textbox.setCustomValidity('Entering an Phone number is necessary!'); }else if (!textbox.value.match(regular)) { textbox.setCustomValidity('Please enter valid AU phone number'); }else{ textbox.setCustomValidity(''); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "processPhone() {\n let input = this.phone\n resetError(input)\n this.changed = true\n\n if (isEmpty(input)) {\n this.valid = false\n } else if (isNumber(input)) {\n this.valid = false\n } else if (exact(input, 11)) {\n this.valid = false\n } else {\n input.success = true\n this.valid = true\n }\n }", "function simplePhoneValidation(phoneNumber) {\n\n}", "function validatePhone(phone){\n return !isNaN(phone)\n\n}", "function validatePhone(){\r\n\r\n\r\n \t\tvar phone=document.getElementById(\"phone\").value;\r\n\r\n\r\n \tif(phone.length==0){\r\n\r\n \t\t\tprintError(\"Phone no required\",\"phoneError\",\"red\");\r\n\t\ttextboxBorder(\"phone\");\r\n\t\treturn false;\r\n\r\n \t}\r\n \tif(!phone.match(/^[+977]?[0-9]{13}$/)){\r\n \t\tprintError(\"enter valid phone no\",\"phoneError\",\"blue\");\r\n\t\ttextboxBorder(\"phone\");\r\n\t\treturn false;\r\n\r\n \t}\r\n\r\n \t\tprintSuccess(\"phone\",\"green\",\"phoneError\");\r\nreturn true;\r\n\r\n\r\n\r\n}", "function validatePhone () {\n\t\t\t$scope.errorPhone = false;\n\n\t\t\tif(isNaN($scope.phone)) {\n\t\t\t\t$scope.errorPhone = true;\n\t\t\t\t$scope.messagePhone = \"The phone number has a wrong format. It must be only numbers.\"\n\t\t\t}\n\t\t}", "function helperValidatePhone() {\r\n //sends the error state to change the background\r\n sendState(on, \"phone\");\r\n //adds the error to the array\r\n addDataAllErrors(allErrorMess[3]);\r\n }", "function phone() {\n var errors = document.querySelector(\"#errors\");\n var num = document.querySelector(\"#phone\");\n var pNum = num.value.trim();\n var patt = /^([0-9]{3}[-]){2}[0-9]{4}$/g;\n if(!patt.test(pNum)) {\n errorMessage(\"<p>Please enter a valid phone number in the format ###-###-####</p>\");\n return false;\n } else {\n return true;\n }\n}", "function validatePhone(val) {\n\n var digits = val.replace(/[^0-9]/g, '');\n var australiaPhoneFormat = /^(\\+\\d{2}[ \\-]{0,1}){0,1}(((\\({0,1}[ \\-]{0,1})0{0,1}\\){0,1}[2|3|7|8]{1}\\){0,1}[ \\-]*(\\d{4}[ \\-]{0,1}\\d{4}))|(1[ \\-]{0,1}(300|800|900|902)[ \\-]{0,1}((\\d{6})|(\\d{3}[ \\-]{0,1}\\d{3})))|(13[ \\-]{0,1}([\\d \\-]{5})|((\\({0,1}[ \\-]{0,1})0{0,1}\\){0,1}4{1}[\\d \\-]{8,10})))$/;\n var phoneFirst6 = digits.substring(0, 6);\n\n var message = null;\n\n //Check if all phone characters are numerals\n if (val != digits) {\n console.log('Contain Numbers only');\n message = 'Phone numbers should contain numbers only.\\n\\nPlease re-enter the phone number without spaces or special characters.';\n return message;\n } else if (digits.length != 10) {\n console.log('10 Numbers only');\n //Check if phone is not blank, need to contains 10 digits\n message = 'Please enter a 10 digit phone number with area code.</br>';\n return message;\n } else if (!(australiaPhoneFormat.test(digits))) {\n console.log('Australian Format Numbers only');\n //Check if valid Australian phone numbers have been entered\n message = 'Please enter a valid Australian phone number.\\n\\nNote: 13 or 12 numbers are not accepted';\n return message;\n } else if (digits.length == 10) {\n //Check if all 10 digits are the same numbers using checkDuplicate function\n if (checkDuplicate(digits)) {\n console.log('Valid 10 Numbers only');\n message = 'Please enter a valid 10 digit phone number.';\n return message;\n }\n }\n\n return message;\n}", "function f_phone(){\n var phone = document.getElementById(\"phone\").value;\n var expresionRegular1=/^\\d{3}-\\d{3}-\\d{3}$/;//<--- con esto vamos a validar el numero\n var expresionRegular2=/\\s/;//<--- con esto vamos a validar que no tenga espacios en blanco\n if(phone === \"\"){\n alert(\"El campo del telefono es obligatorio\");}\n else if(expresionRegular2.test(phone)){\n alert(\"error existen espacios en blanco\");}\n else if(!expresionRegular1.test(phone)){\n alert(\"Telefono incorrecto, separar 3 digitos con guiones\");\n return false;}\n else { return true; }\n}", "function checkPhone() {\n let regPattern =\n /(^07([\\s-]*\\d[\\s-]*){8})$|^(\\+46([\\s-]*\\d[\\s-]*){9})$|^(0046([\\s-]*\\d[\\s-]*){9})$/\n let validDiv = '#validPhone'\n let invalidDiv = '#invalidPhone'\n let phoneNumber = $('#validationCustom05').val()\n let input = document.getElementById('validationCustom05')\n if (phoneNumber == '') {\n $(validDiv).hide()\n $(invalidDiv).text(\n 'Telefon krävs för att leverantören kunna kontakta dig när hen är framme'\n )\n $(validDiv).text('')\n $(invalidDiv).show()\n $(input).addClass('is-invalid').removeClass('is-valid')\n return false\n } else if (!regPattern.test(phoneNumber)) {\n $(validDiv).hide()\n $(invalidDiv).text('Ogiltigt telefonnummer')\n $(invalidDiv).show()\n $(input).addClass('is-invalid').removeClass('is-valid')\n return false\n } else {\n $(invalidDiv).hide()\n $(validDiv).text('Giltig')\n $(validDiv).show()\n $(input).removeClass('is-invalid').addClass('is-valid')\n $(input).val(formatPhoneNumberForDb(phoneNumber))\n return true\n }\n}", "function check_phone() {\n var patternphone = new RegExp();\n patternphone = /^[0-9]{11}$/;\n if (patternphone.test($('#u_phone').val())) {\n $('#phone_error').hide();\n $('#phone_corr').html('valid phone');\n $('#phone_corr').show();\n er_uphone = true;\n }\n else {\n $('#phone_error').html('Invalid Phone-11 digit phone number');\n $('#phone_error').show();\n $('#phone_corr').hide();\n\n }\n }", "function validatePhone() {\r\n //!$.trim(this.value).length - might be used later\r\n\r\n //tests for the length - (ternary exp), fails if 0\r\n //an adds an error message to the array\r\n $(\"#mobile\").val().length > 0\r\n ? checkNaN($(\"#mobile\").val()) // checks for bad values\r\n : helperValidatePhone(); // moves to the function;\r\n }", "function phone_checker() {\n const phone_value = phone.value;\n\n if (phone_value.match(/\\(?([0-9]{3})\\)?([ .-]?)([0-9]{3})\\2([0-9]{4})/)) {\n errorMessagePhone.innerText = \"\";\n register.removeAttribute(\"disabled\");\n\n } else {\n errorMessagePhone.innerText = \"Invalid phone number.\";\n register.setAttribute(\"disabled\", \"disabled\");\n }\n\n}", "function validatePhoneNumber(){\n \n if(state.phoneNumber.match(/^(080|081|070|091|090)/)){\n isError = false;\n console.log(\"we good!\");\n }else{\n isError = true;\n errors.phoneNumberError = \" Phone-Number must start with either 080,081,070,091,090\"\n \n }\n \n }", "function check_phone(){\n\n\t\tvar phone_length = $(\"#phone\").val().length;\n\n\t\tif(isNaN($(\"#phone\").val()) || phone_length < 9){\n\t\t\t$(\"#phone_error\").html(\"Should be number and at least 9 chars long\");\n\t\t\t$(\"#phone_error\").show();\n\t\t\terror_phone = true;\n\t\t} else {\n\t\t\t$(\"#phone_error\").hide();\n\t\t}\n\n\t}", "function phonenumber(inputtxt) {\n let phoneno = /^\\(?([0-9]{3})\\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/;\n if (inputtxt.value.match(phoneno)) {\n console.log(\"Phone number is valid.\");\n return true;\n } else {\n alert(\"Phone number is not valid. It needs to be 10 digits.\");\n return false;\n }\n}", "function isPhone(phone){\n \n}", "function validatePhone(txtPhone) {\n var a = txtPhone;\n var filter = /^((\\+[1-9]{1,4}[ \\-]*)|(\\([0-9]{2,3}\\)[ \\-]*)|([0-9]{2,4})[ \\-]*)*?[0-9]{3,4}?[ \\-]*[0-9]{3,4}?$/;\n if (filter.test(a)) {\n return true;\n }\n else {\n return false;\n }\n}", "function valid_officePhone() {\n if (office_no.value === \"\") {\n document.getElementById(\"alert_officePhone\").innerHTML =\n \"This field cannot be empty\";\n\n return false;\n } else if (!/^[0-9]{10}$/.test(office_no.value)) {\n document.getElementById(\"alert_officePhone\").innerHTML =\n \"please enter 10 digit phone number\";\n return false;\n } else {\n document.getElementById(\"alert_officePhone\").innerHTML = \"\";\n return true;\n }\n}", "function checkPhone() {\n\tvar phone = document.getElementById(\"phone\").value;\n\tvar plusSign = new RegExp(/^\\+/g);\n\tvar numbers = new RegExp(/([0-9])/g);\n\tvar letters = new RegExp(/([a-z]|[A-Z])/g);\n\t\n\tif (phone == \"\"){\n\t} else {\n\t\tif (plusSign.test(phone)) {\n\t\t\tif (numbers.test(phone)) {\n\t\t\t\tif (!letters.test(phone)) {\n\t\t\t\t\tif (phone.length < 9 || phone.length >= 31) {\n\t\t\t\t\t\talert(\"Phone numbers must be between 8 and 30 digits\");\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\talert(\"Phone number can only use numbers!\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\talert(\"Phone number must contain numbers!\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\talert(\"Phone number must start with a \\\"+\\\"\");\n\t\t\treturn false;\n\t\t}\n\t}\n}", "function phoneValidate(number) {\n var phoneno = /^\\d{11}$/;\n if(number.match(phoneno)){\n return true;\n }\n else {\n return false;\n }\n }", "function checkforphone(element)\n{\n\tif(checkRequired(element) && checkPhone(element) && element.length>=8 && element.length<=15)\n\t{\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n}", "function checkPhone(input){\n\n const exp = /^\\d{10}$/;\n if(!exp.test(input.value)){\n error(input, \"Phone number must have 10 characters!\");\n }\n}", "function checkPhone(phone){\n\n \t\t//var dateofbirt=new Date($('#dateofbirth').val());\n var phone_number= $('#phone').val($('#phone').val().replace(/[^\\d].+/,''));\n //regex for the 2nd and 3rd number to not be 0\n \t\tvar regex= /^[0]\\d[1-9]{1}\\d[0-9]{6}$/;\n \t\t//variable to check that the phone starts with 0\n \t\tvar phone1=[]; \t\t\n\n \tfor (var i = 0; i < phone.length; i++) {\n \t\t//saving all the characters of phone as array in check variable\n \t\tphone1[i]=phone[i];\n \t} \n \n \t//test the length\n \t\tif (phone.length != 10) {\n\n \t\t\t$('#phone_results').addClass('text-danger');\n \t\t\treturn 'Phone Number must have exactly 10 numbers';\n\n \t\t}\n \n \t\t//check is it is a number\n \t\tif (!phone_number) {\n\n \t\t\t$('#phone_results').addClass('text-danger');\n \t\t\treturn 'Phone should only be number';\n \t\t}\n \t\t//check if it starts with zero\n \t\tif (phone1[0] != \"0\") {\n\n $('#phone_results').addClass('text-danger');\n return 'Phone Number must starts with zero(0)';\n }\n if (!regex.test(phone)) {\n\n \t\t\t$('#phone_results').addClass('text-danger');\n return '0 is ny allowed to be a second and third';\n \t\t}\n \t\t//everything is ok submit\n \t\tif(phone.length == 10 && phone_number){\n\t\t\t\n\t\t\treturn 'Correct';\n\t\t}\n\t}", "function telponValidation (telephone) {\r\n if (telephone.length < 4) {\r\n return false;\r\n } else {\r\n for (var i = 0; i < telephone.length; i++) {\r\n if (!(telephone[i] >= '0' && telephone[i] <= '9')) {\r\n return false;\r\n }\r\n }\r\n return true; \r\n }\r\n}", "function phvalidate(){\n var mno=document.getElementById(\"mno\");\n//var ph=/^([1-9])([0-9]{9})$/;\nvar ph=/^(\\d{3})(\\.?\\-?\\ ?)(\\d{3})(\\.?\\-?\\ ?)(\\d{4})$/;\nif(ph.test(mno.value)&&mno.value.length>1)\n {\n //alert(\"valid no\");\n mno.style.border=\"solid green\";\n return true;\n }\n else\n {\n mno.style.border=\"solid red\";\n mno.focus();\n alert(\"Mobile no must be numbers and 10 digits and valid formats xxx xxx xxxx or xxx.xxx.xxxx or xxx-xxx-xxxx \");\n return false;\n }}", "function phoneValidation(){\n let $phone = $('#phone').val();\n var phoneRegExp = new RegExp(/^\\d{10}?$/);\n console.log(phoneRegExp.test($phone));\n if (!phoneRegExp.test($phone)){\n alert(`\"${$('#phone').val()}\" is not a valid phone number. Please insert 10 numeric characters only.`);\n $('#phone').focus();\n } else {\n return true;\n console.log($phone);\n }\n }", "function PhoneNumberValidator(inputPhoneNumber){\n if(inputPhoneNumber[0] !== '0'){\n return 'Nomor Harus Diawali Dengan 0'\n } \n\n if(inputPhoneNumber.length >= 9 && inputPhoneNumber.length <= 12){\n for(let i = 0; i < inputPhoneNumber.length; i++){\n if(!(inputPhoneNumber[i] >= 0)){\n return 'Nomor Harus Berupa Angka'\n }else if(inputPhoneNumber[i] === ' '){\n return 'Nomor Tanpa Spasi'\n }\n }\n }else{\n return 'Nomor Harus 9-12 Digit'\n }\n\n return true\n}", "function checkPhoneNumber() {\n\tvar phonenumber = document.getElementById(\"phonenumber\").value;\n\tvar phonenumberFormat = /\\d{3}-\\d{3}-\\d{4}/;\n\tif (phonenumberFormat.test(phonenumber)) {\n\t\tdocument.getElementById(\"phoneNumberError\").innerHTML = \"\";\n\t}\n\telse {\n\t\tdocument.getElementById(\"phoneNumberError\").innerHTML = \"Phone number must be in (XXX) XXX-XXXX format.\";\n\t}\n}", "function checkPhNumber() {\n var pattern = new RegExp(/^[0-9]{3}[0-9]{3}[0-9]{4}$/i);\n \n if (pattern.test(numberInput.val())) {\n $(\"#phonenum_error_message\").hide();\n numberInput.removeClass('error');\n }\n else {\n $(\"#phonenum_error_message\").html(\"Enter valid phone number\");\n $(\"#phonenum_error_message\").show();\n numberInput.addClass('error');\n error_number = true;\n }\n }", "function validatePhone(fld) {\n var valid = true;\n var stripped = fld.value.replace(/[\\(\\)\\.\\-\\ ]/g, '');\n if (isNaN(parseInt(stripped))) {\n valid = false;\n } else if (!(stripped.length == 10)) {\n valid = false;\n }\n return valid;\n}", "validateTelephone(tel) {\n if(tel==='') {\n return 'Telephone required';\n } else if (!/^\\d+$/.test(tel)) {\n return 'Telephone number invalid'\n }\n \n return '';\n }", "function testPhoneNumberSearch(){\n validatePhoneNumber(\"3832720339\"); // invalid entry\n\t validatePhoneNumber(\"2125551235\"); // valid entry\n\t validatePhoneNumber(null); // invalid entry\n\t validatePhoneNumber(1312); // invalid entry\n }", "function validatePhone(fld,type) {\n var error = \"\";\n\t var stripped = fld.value.replace(/[\\(\\)\\.\\ ]/g, '');\n\t if (fld.value == \"\") {\n\t error = \"Please enter \"+type+\"Phone Number.\\n\";\n\t //fld.style.background = 'Yellow';\n\t } else if (isNaN(parseInt(stripped)) || isNaN(fld.value) ) {\n\t error = \"The \"+type+\"phone number contains illegal characters.\\n\";\n\t // fld.style.background = 'Yellow';\n\t } else if (stripped.length <10) {\n\t error = \"The \"+type+\"phone number is the wrong length. Make sure you included an area code.\\n\";\n\t // fld.style.background = 'Yellow';\n\t }\n\t \n\t return error;\n}", "function validatePhone () {\n var text = $('#phone').val(); \n if (!text) return true;\n \n var phoneno = /^\\(?([0-9]{3})\\)?[-]?([0-9]{3})[-]?([0-9]{4})$/;\n if (text.match(phoneno))\n {\n $('#phone').removeClass(\"invalid\");\n formatPhoneNumber();\n return true;\n } else {\n $('#message').html(\"Invalid phone number\");\n $('#phone').addClass(\"invalid\");\n return false;\n }\n}", "function phoneValidation(){\n\t\n var phone = document.getElementById(\"phone\");\n\tvar pos = phone.value.search(/^\\d{3}\\d{3}\\d{4}$/);\n\n \t\t\tif (phone.value === \"\" ){\n\t\t\n\t \t\tdocument.getElementById(\"phone_error\").innerHTML=\"**Please Provide your Phone number .\";\n\t\t\tphone.focus();\t\t\t\t\t\n \t\tphone.select();\n \t\treturn false;\n\t\t\t\t}\n\t\t\telse if(pos != 0)\n \t\t\t\t\t{\n \t\t\t\tdocument.getElementById(\"phone_error\").innerHTML= \"( \" + phone.value +\") is incorrect. The correct form is: ddd-ddd-dddd \";\n \t\t\t\t\tphone.focus();\n\t\t\t\t\tphone.select();\n \t\t\t\treturn false;\n \t\t\t\t\t} \n\n\t\telse{\n\t\t\tdocument.getElementById(\"phone_error\").innerHTML=\"\";\n\t\t\treturn true;\n\t\t\t}\n\t\n}", "function checkPhone( phone ) {\n phoneRegex = /\\d\\d\\d\\-\\d\\d\\d-\\d\\d\\d\\d$/;\n if( !phone.match( phoneRegex ) ) {\n alert( \"Please enter a valid phone number. (FORMAT: xxx-xxx-xxxx)\" );\n return false;\n }\n return true;\n}", "function validatePhoneNumber(el){\n\t\n /* in order for a phone number to be valid, it must have at least 10 digits. \n\tAlso, only digits and spaces are allowed. This means that the sum of the number of digits and the number of spaces\n\tshould be equal to the total number of characters*/\n\t\n\t//get the length of the phone number\n\tvar phoneNumberLength = el.value.length;\n\t//get the number of digits\n\tvar digitsNumber = getNoOfDigits(el);\n\t//get the number of spaces\n\tvar spacesNumber = getNoOfSpaces(el);\n\t\n\t\n\t// if the user has typed a phone number and it is invalid\n if ( (phoneNumberLength>0) && ((phoneNumberLength < 10) || (phoneNumberLength != digitsNumber+spacesNumber)) )\n\t{\n\t\t// set the message, for the invalid phone number\n\t\tel.setCustomValidity('Ο τηλεφωνικός αριθμός δεν είναι έγκυρος. Χρησιμοποιείστε μόνο ψηφία (τουλάχιστον 10) και κενά. ');\n\t\t\n }\n else // the user hasn't typed a phone number or the phone number typed is valid. Reset the validity\n {\n\t\tel.setCustomValidity('');\n }\n}", "function checkPhone (strng) {\n\tvar error = \"\";\n\tif (strng == \"\") {\n\t\terror = \"You didn't enter a phone number.\\n\";\n\t}\n\n\tvar stripped = strng.replace(/[\\(\\)\\.\\-\\ ]/g, ''); //strip out acceptable non-numeric characters\n if (isNaN(parseInt(stripped))) {\n error = \"The phone number contains illegal characters.\";\n }\n if (!(stripped.length == 10)) {\n\t\terror = \"The phone number is the wrong length. Make sure you included an area code.\\n\";\n } \n\treturn error;\n}", "function validateTelephone() {\n var e = /^\\(?([0-9]{3})\\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/;\n var t = document.getElementById(\"Phone\").value;\n if (t.match(e)) {\n return true;\n } else {\n return false;\n }\n}", "function validPhone() {\n if (phone_no.value === \"\") {\n document.getElementById(\"alertPhone\").innerHTML =\n \"this field cannot be empty\";\n\n return false;\n } else if (!/^[0-9]{10}$/.test(phone_no.value)) {\n document.getElementById(\"alertPhone\").innerHTML =\n \"please enter 10 digit phone number\";\n return false;\n }\n document.getElementById(\"alertPhone\").innerHTML = \"\";\n return true;\n}", "function checkNumber(inputtxt) {\n var phoneno = /^\\d{10}$/;\n if(inputtxt.value.match(phoneno)) {\n return true; \n } else {\n alert(\"Not a valid Phone Number\");\n return false; }\n}", "function customPhoneValidation(value){\n if(!checkRegex(value, phoneRegex)){\n throw new Error(\"Phone should be in the format xxx-xxx-xxxx\");\n }\n return true;\n}", "function isPhoneNumberValid() {\n var pattern = /^\\+[0-9\\s\\-\\(\\)]+$/;\n var phoneNumber = getPhoneNumberFromUserInput();\n return phoneNumber.search(pattern) !== -1;\n }", "function phonenumber(inputtxt) \r\n { \r\n var phoneno = /^\\d{10}$/; \r\n if((inputtxt.value.match(phoneno))) \r\n { \r\n return true; \r\n } \r\n else \r\n { \r\n alert(\"it shuld be no and must be 10 digit...\"); \r\n document.reg.phn.value=\"\";\r\n phn.focus();\r\n document.getElementById('submitbtn').disabled = true;\r\n return false; \r\n } \r\n isValidForm = true;\r\n \t document.getElementById('submitbtn').disabled = false;\r\n \t console.log(\"Succes age is validated\");\r\n \r\n }", "function telephoneCheck() {\n let cadena = prompt('Ingrese el número a validar:');\n\n let regex = /^(1\\s?)?(\\(\\d{3}\\)|\\d{3})[\\s\\-]?\\d{3}[\\s\\-]?\\d{4}$/;\n\n if (regex.test(cadena)) {\n alert(`El número: ${cadena} SÍ es válido.`);\n }\n \n else {\n alert(`El número: ${cadena} NO es válido.`);\n }\n \n return regex.test(cadena);\n}", "function checkphone(inputphone){\n if(!inputphone.value.match(/^\\(?([0-9]{3})\\)?[-]?([0-9]{3})[-]?([0-9]{4})$/)){\n document.getElementById(\"Phone\").innerHTML = \"Phone Number should be in pattern like XXX-XXX-XXXX\"+\"<br>\";\n inputphone.value = \"\";\n return false;\n }\n else\n return true;\n}", "function validPhoneNumber() {\r\n let numberValidationRegEx = /(\\+?7|8)(9\\d{2})(\\d{3})(\\d{4})/; // +7XXXXXXXXXX or 8XXXXXXXXXXX format\r\n $(document).ready(function () {\r\n $('#phoneNumberInputField').keyup(function () {\r\n let inputData = $('#phoneNumberInputField').val();\r\n if (!numberValidationRegEx.test(inputData) && inputData !== \"\") {\r\n $('#errMsgPhone').css(\"color\", \"red\");\r\n $('#errMsgPhone').text(\"Invalid input\");\r\n } else {\r\n $(\"#errMsgPhone\").empty();\r\n }\r\n });\r\n });\r\n}", "function isValidPhone(field) {\n\tvar nDigit;\n\t\n\tnDigit = 0;\n\t\n\tfor (i=0;i<field.value.length;i++){\n\t\tvar strTemp = field.value.charAt(i);\n\t\t\n\t\tif (strTemp != ' ' && strTemp != '(' && strTemp != ')' && strTemp != '.' && strTemp != '-' && strTemp != '+' && strTemp != '0' && strTemp != '1' && strTemp != '2' && strTemp != '3' && strTemp != '4' && strTemp != '5' && strTemp != '6' && strTemp != '7' && strTemp != '8' && strTemp != '9') {\t\n\t\t\talert('Phone number must be a minimum of ten digits and may only contain ( ) - + . or spaces. Please re-enter this value and click Submit.');\n\t\t\tfield.focus();\n\t\t\treturn false;\n\t\t} else if (strTemp == '0' || strTemp == '1' || strTemp == '2' || strTemp == '3' || strTemp == '4' || strTemp == '5' || strTemp == '6' || strTemp == '7' || strTemp == '8' || strTemp == '9') {\n\t\t\t++nDigit;\t\n\t\t}\n\t}\n\n\tif (nDigit < 10) {\n\t\talert('Phone number must be a minimum of ten digits and may only contain ( ) - . or spaces. Please re-enter this value and click Submit.');\n\t\tfield.focus();\n\t\treturn false;\n\t}\n\treturn true;\n}", "function phoneCheck() {\r\n\tvar phoneRegex = /^\\+?\\d{0,2}[\\s|-]?\\(?\\d{3}\\)?[\\s|-]?\\d{3}[\\s|-]?\\d{4}[\\s|-]?x?[\\s|-]?\\d{0,5}$/;\r\n\tvar phone = getId('phone');\r\n\t\r\n\tif(!phone.match(phoneRegex)) {\r\n\t\talert('no match');\r\n\t\treturn false;\r\n\t}\r\n\talert('match');\r\n\treturn true;\r\n}", "function validateProfilePhone()\n{ \n var x = document.forms[\"profile\"][\"phone\"].value;\n\n \t if(isNaN(x)|| x.indexOf(\" \")!=-1)\n\t{\n \t\t\talert(\"Please enter a numeric value for the phone number. Ex: 0777123456\");\n\t\t\treturn false;\n }\n \t\t\t if (x.length != 10)\n\t\t\t{\n \t\t\talert(\"Please enter 10 digits for the phone number. Ex: 0777123456\"); \n\t\t\t\treturn false;\n \t\t\t }\n \n}", "function phoneNumber()\n{\n var phoneno = /^\\d{10}$/;\n let phoneError = document.getElementById(\"phone-error\");\n if(phone_number.value.match(phoneno))\n {\n phoneError.style.display = \"none\";\n phone_number.setCustomValidity(\"\");\n\n }\n else\n {\n phoneError.style.display = \"block\";\n phoneError.innerHTML = \"Not a valid Phone Number\";\n phone_number.setCustomValidity(\"Wrong Phonenumber Format.\");\n }\n}", "function telephoneCheck(str) {\n if(str.length > 16 || str.length < 10){\n return false;\n }\n let phoneArr = str.split(\"\");\n let validNum = [];\n for(let i = 0; i < phoneArr.length; i++){\n if(Number.isInteger(parseInt(phoneArr[i])) || phoneArr[i] === \"(\" || phoneArr[i] === \")\" || phoneArr[i] === \" \" || phoneArr[i] === \"-\"){\n validNum.push(phoneArr[i]);\n }\n }\n if(!Number.isInteger(parseInt(validNum[0])) && validNum[0] !== \"(\"){\n return false;\n }\n let paranth = [];\n for(let x = 0; x < validNum.length; x++){\n if(x < 3 && validNum[x] === \"(\"){\n paranth.push(validNum[x]);\n }else if(x >= 3 && x < 7 && validNum[x] === \")\"){\n paranth.push(validNum[x]);\n }\n }\n if(paranth.length === 1){\n return false;\n }\n let onlyNums = validNum.filter(x => parseInt(x) || x === \"0\");\n if(onlyNums.length > 10 && onlyNums[0] !== \"1\"){\n return false;\n }\n return validNum.length === phoneArr.length;\n}", "function validatePhoneNumber(phonenumber){\n var x;\n regEx = /[0-9]{10}/;\n if (phonenumber.match(regEx)) {\n x = true;\n } else {\n x = false;\n } \n callHerokuApi(x,\"phone=\", phonenumber); \n }", "function isValidPhone(phoneNumber) {\n\tvar phoneRegExp = /^((\\+)?[1-9]{1,2})?([-\\s\\.])?((\\(\\d{1,4}\\))|\\d{1,4})(([-\\s\\.])?[0-9]{1,12}){1,2}$/;\n var phoneVal = phoneNumber.val();\n var numbers = phoneVal.split(\"\").length;\n\tif (6 <= numbers && numbers <= 20 && phoneRegExp.test(phoneVal)) {\t\t\n\t\treturn true;\n }\n\telse if (!phoneRegExp.test(phoneVal)) {\n\t\tphoneErrorMsg = 'Phone number contains invalid characters';\n\t\t$(phoneNumber).parent().parent().append('<small class=\"help-block\">' + phoneErrorMsg + '</small>').addClass('has-error');\n\t}\t\n\telse if (numbers >= 20) { \t\n\t\tphoneErrorMsg = 'Phone number can contain maximum 20 characters';\t\n\t\t$(phoneNumber).parent().parent().append('<span class=\"help-block\">' + phoneErrorMsg + '</small>').addClass('has-error');\t\t\t\t\n\t}\n\telse if (numbers < 6) { \n\t\tphoneErrorMsg = 'Phone number is too short';\n\t\t$(phoneNumber).parent().parent().append('<small class=\"help-block\">' + phoneErrorMsg + '</small>').addClass('has-error');\n\t}\n\n}", "isValid() {\r\n return this.phoneNumber.match(/^((0[23489][2356789]|0[57][102345689]\\d|1(2(00|12)|599|70[05]|80[019]|90[012]|919))\\d{6}|\\*\\d{4})$/) !== null;\r\n }", "function validate_phone(field,alerttxt)\r\n{\r\n /* can be used for xx-xxxx-xxxx\r\n * if(field.value.search(/\\d{2}\\-\\d{4}\\-\\d{4}/)==-1) \r\n */\r\n\r\n if(field.value.search(/\\d{2}\\d{4}\\d{4}/)==-1)\r\n {\r\n show_it(field,alerttxt)\r\n return false;\r\n }\r\n}", "function telephoneCheck(str) {\n const validateInput = new RegExp(/[^0-9()-\\s]/, 'gi');\n if (validateInput.test(str)) {\n return false;\n }\n\n if (/\\(/.test(str) || /\\)/.test(str)){\n if (!/\\)/.test(str) || !/\\(/.test(str)) {\n return false;\n }\n if (!/\\((\\d{3})\\)/.test(str)) {\n return false;\n }\n }\n\n let numbers = str.match(/\\d/g);\n if (numbers.length > 11) {\n return false;\n }\n if (numbers.length === 11) {\n if (str[0] !== '1') {\n return false;\n }\n }\n\n const verifyNumber = new RegExp(/1?[\\s-]?\\(?(\\d{3})\\)?[\\s-]?\\d{3}[\\s-]?\\d{4}/);\n \n if (verifyNumber.test(str)) {\n return true;\n }\n return false;\n}", "testPhone (phone) { \n var regexphone = /^(?:\\d{2}|\\+\\d{3})\\d{8}$/;\n return regexphone.test(phone)\n }", "function numCheck() {\n\t// grabs the current user input from the text field\n\tvar input = document.getElementById(\"phoneNum\").value;\n\t\n\t// This pattern will only accept two formats: 111.222.3333 OR 111-222-3333\n\t// Rejects all other patterns. Using this to follow the rubric.\n\tvar pattern = /(^)[0-9]{3}(\\.(?=[0-9]{3}\\.)|-(?=[0-9]{3}-))[0-9]{3}(\\.|-)[0-9]{4}$/;\n\t\n\t// checks to see if the input matches the required pattern\n\t// returns true if input matches valid input, false otherwise\n\tvar result = pattern.test(input);\n\n\t// if user input is invalid, inform the user and reset the field to be empty\n\tif (!result) {\n\t\talert(\"Incorrect format. Valid phone number formats are:\\n\"\n\t\t + \"111.222.3333\\n\"\n\t\t + \"111-222-3333\");\n\t\tdocument.getElementById(\"phoneNum\").value = \"\";\n\t}\n}", "function phoneOnChange() {\n const pattern = \"^((8|\\\\+7)[\\\\- ]?)?(\\\\(?\\\\d{3}\\\\)?[\\\\- ]?)?[\\\\d\\\\- ]{7,10}$\";\n validate(this, pattern);\n}", "function phoneValidation() {\n\n let result = false;\n var phone_regex = /^\\+[0-9]{8,19}$/; //11-15\n var telephone = document.getElementById(\"number\").value\n\n // test the input number based on the RegEx pattern stated\n if (phone_regex.test(telephone) && telephone!=\"\")\n {\n document.getElementById(\"input-error\").innerHTML = \"\";\n document.getElementById(\"number\").style.visibility=\"visible\";\n document.getElementById(\"number\").style.color=\"green\";\n result = true;\n }\n else {\n document.getElementById(\"input-error\").innerHTML = \"Invalid phone number. Do avoid any letters, special characters and spaces. Please try again.\";\n document.getElementById(\"number\").style.visibility=\"visible\";\n document.getElementById(\"number\").style.color=\"red\";\n result = false;\n }\n return result;\n}", "function telephoneCheck(str) {\n let hasTenDigits = false;\n let hasElevenDigits = false;\n let startsWithOne = false;\n let hasPermittedCharsOnly = false;\n let hasCorrectParentheses = false;\n \n // Write regular expressions here so that the Booleans contain the correct values\n hasTenDigits = /\\d{10}/.test(str);\n hasElevenDigits = /\\d{11}/.test(str);\n hasPermittedCharsOnly = /[\\d]*/.test(str);\n hasCorrectParentheses = /^\\(?(\\d{3})\\)?[- ]?(\\d{3})[- ]?(\\d{4})$/.test(str);\n startsWithOne = /^1/.test(str);\n\n\n // [\\s\\(] puede matchea solo uno!!!\n\n\n //Use the Booleans to return true or false, without needing to string together one complex regular expression\n if (!hasTenDigits && !hasElevenDigits) {\n return false;\n } else if (!hasPermittedCharsOnly || !hasCorrectParentheses) {\n return false;\n } else if (hasElevenDigits && !startsWithOne) {\n return false;\n } else {\n return true;\n }\n return /[12]*\\s?\\(?\\d{3}\\)?[\\s-]*\\d{3}[\\s-]*\\d{4}/.test(str);\n}", "function validatePhone(){\r\n\r\n\tvar phone = document.getElementById(\"phoneNum\");\r\n\tvar pPhone = document.getElementById(\"valPhone\");\r\n\t\r\n\t\r\n\tif(phone.value == \"\")\r\n\t{\r\n\t\t\r\n\t\tpPhone.innerHTML = \r\n\t\t\"Phone Number is required\";\r\n\t\tpPhone.classList.remove(\"valid\");\r\n\t\tpPhone.classList.add(\"invalid\");\r\n\t\treturn false;\r\n\t\t\r\n\t}\r\n\telse if (phone.value.length > 12)\r\n\t{\r\n\t\t\r\n\t\tpPhone.innerHTML = \r\n\t\t\"Phone number cannot be longer than 12\";\r\n\t\tpPhone.classList.remove(\"valid\");\r\n\t\tpPhone.classList.add(\"invalid\");\r\n\t\treturn false;\r\n\t\t\r\n\t}\r\n\t\r\n\telse \r\n\t{\n\t\t if(phone.value.length == 3 || phone.value.length == 7)\r\n\t\t{\r\n\t\t\tphone.value = phone.value.concat(\"-\");\r\n\t\t}\r\n\t\tpPhone.innerHTML = \r\n\t\t\"Valid Phone Number\";\r\n\t\tpPhone.classList.remove(\"invalid\");\r\n\t\tpPhone.classList.add(\"valid\");\r\n\t\treturn true;\r\n\t}\r\n\t\r\n\t\r\n}", "function checkContact( text ) {\n\tvar str= text.value.toString();\n\tvar len=str.length;\n\tvar check = true;\n\tvar err=\"\";\n\tfor(var i=0; i<len; i++)\n\t{\n\t\tif( ! (str.charAt(i)>=0 && str.charAt(i)<=9) )\n\t\t{\n\t\t\tcheck = false;\n\t\t}\n\t}\n\tif( check == false) {\n\t\terr=\"Only number Allowed\";\n\t}\n\telse if (len >=1 && len < 10) {\n\t\terr = \"Looks like you missed some digits.\"\n\t}\n\treturn err;\n}", "function validatePhoneNumber(){\r\nvar phoneNumber = document.forms[\"contactInfo\"][\"phone\"].value;\r\n\tif(isNaN(phoneNumber)){\r\n\t\t//used for debugging\r\n\t\t//console.log(\"phone isNaN\");\r\n\t\talert(\"Please enter only numbers for your phone number, do not use +, -, (, or )\");\r\n\t\treturn false;\r\n\t}\r\n\tif(phoneNumber.length != 10){\r\n\t\t//used for debugging\r\n\t\t//console.log(\"phone doesn't have all digits\");\r\n\t\talert(\"Please enter ten digits for your phone number.\");\r\n\t\treturn false;\r\n\t}\r\n\t//used for debugging\r\n\t//console.log(\"mAde it through phone check\");\r\n\treturn true;\r\n}", "function PhoneNumberValidator(input = \"\") {\n if (input[0] !== \"0\") return \"first digit must be 0\";\n if (input.length >= 9 && input.length <= 13) {\n for (var i = 0; i < input.length; i++) {\n if (!(input[i] >= 0)) {\n return \"cannot include characters\";\n }\n if (input[i] === \" \") {\n return \"cannot include white space\";\n }\n }\n } else {\n return \"length must more than 8 digits and less than 14 digits\";\n }\n\n return true;\n}", "function isPhone(obj)\r\n{\r\n\tobj.value=trim(obj.value);\r\n\tvar string=obj.value;\r\n\tvar len =string.length;\r\n\tif (len==0)\r\n\t{\r\n\t\treturn false;\r\n\t}\t\r\n\r\n\t\tfor(i=0;i<len;i++)\r\n\t\t\t{\r\n\t\t\t\tch=string.substring(i,i+1)\r\n\t\t\t\tif(((ch>=\"0\" && ch<=\"9\")) || (ch==\"(\")|| (ch==\")\")|| (ch==\"-\") ||(ch==\"+\"))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\ttrue;\r\n\t\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\talert(\"Please Enter Valid Phone Number!\");\r\n obj.value=\"\";\r\n\t\t\t\t\t\tobj.focus();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\t\r\n}", "function phonePlz() {\n var phone = document.getElementById(\"phone\").value;\n phone = Number(phone);\n if (isNaN(phone)){\n alert(\"Oh no! Plz enter a valid phone info with #'s only. Thank you fren!\")\n }\n}", "function phoneValidate(){\n var phoneVal = document.getElementById(\"phone\").value;\n var err = document.getElementById('phone_error');\n var phoneregex = /\\d{3}-\\d{3}-\\d{4}/;\n\n if(phoneVal.length == 10){\n phoneVal = phoneVal.substr(0,3) + '-' + phoneVal.substr(3,3) + '-' + phoneVal.substr(6);\n document.getElementById(\"phone\").value = phoneVal;\n }\n\n if(phoneregex.test(phoneVal)){\n err.style=\"display:none\"; \n\n return true;\n }else{\n err.style=\"display:block\"; \n return false;\n }\n}", "function telephoneCheck(str) {\n // Good luck!\n valid = [];\n invalid = false;\n str.split('').reduce((prev,curr,idx,arr) => {\n if (!/[0-9|(|)| |-]/.test(curr) || !/[0-9]/.test(arr[arr.length-1])){\n // console.log(\"FAIL!!!\",arr[arr.length-1],/[0-9]/.test(arr[arr.length-1]))\n invalid = true\n return\n }\n if (/[(]/.test(curr) && arr[idx+4] !==')' || /[)]/.test(curr) && arr[idx-4] !=='(' || /[-]/.test(arr[0])){\n invalid = true;\n return\n }\n if(!/[-|| ||(||)]/.test(curr)){\n valid.push(curr);\n return\n }\n },[]);\n\n if (invalid == true){\n // console.log(valid)\n return false\n } else if (valid.length >= 12 || valid.length <10) {\n // console.log(valid.length,valid, \"length >12 or < 10\")\n\n return false\n\n }else if (valid.length == 11 && valid[0] !== '1' ){\n // console.log(valid.length,valid, \"length>=11, valid[0]=\",valid[0])\n\n return false\n }else{\n // console.log(valid.length,valid,\"default to true\");\n return true;\n }\n\n}", "function validatePhone(){\r\n\tvar submit = false;\r\n\tvar phone = $(\"#phone\").val();\r\n\t\r\n\t\tif(phone ==''){\r\n\t\t\tsubmit = showError('phone',\"Please fill Phone number\");\r\n\t\t}\r\n\t\telse if(!(regNumber.test(phone)) || phone.length < 10){\r\n\t\t\tsubmit = showError('phone',\"Please enter a valid 10 digit mobile number\");\r\n\t\t}\r\n\t\telse{\r\n\t\t\tsubmit = markFieldCorrect(\"phone\");\r\n\t\t}\r\n\t\treturn submit;\r\n}", "function ValidatePhone(inputText) {\n var phoneformat = /^(\\()?\\d{3}(\\))?(-|\\s)?\\d{3}(-|\\s)\\d{4}$/;\n if (inputText.match(phoneformat)) {\n return true;\n } else {\n return false;\n }\n}", "function phonenumber() {\n inputtxt = $('#userPhoneRegistration').val();\n var phoneno = /^\\d{10}$/;\n if ((inputtxt.match(phoneno))) {\n return true;\n }\n else {\n return false;\n }\n}", "function checkMobilePhone(phone_code, phone_number)\r\n{\r\n\tif(checkNull($(phone_number).value));\r\n\t{\r\n\t\tif(checkStrToNum($(phone_number).value) == true)\r\n\t\t{\r\n\t\t\tif(($(phone_number).value.length >= 7) && ($(phone_number).value.length <=10)){\r\n\t\t\t\tvar complete_number = $(phone_code).value + $(phone_number).value;\r\n\t\t\t\t//alert(complete_number);\r\n\t\t\t\tajaxRequest('isPhoneNumber', 'phone_number='+complete_number, '', 'isPhoneNumber', 'reportError');\r\n\t\t\t}else\r\n\t\t\t\talert(mobile_alert);\r\n\t\t}else\r\n\t\t\talert(mobile_format);\r\n\t}\r\n}", "verifyPhoneNumber(value) {\n let regex = RegExp('^[0-9-+()]*$');\n return regex.test(value);\n }", "function telephoneCheck(str) {\n // regx to validate us phone number\n var regx = /^((^1(\\s|)|)(\\(\\d{3}\\)|\\d{3}))(-|\\s|)\\d{3}(-|\\s|)\\d{4}$/\n return regx.test(str);\n }", "function CHMisPhone( field )\r\n {\r\n\ttext = field.value;\r\n\tif(isEmpty(field))\r\n\t {\r\n\t\t//alert('Empty Text Box');\r\n\t\treturn true;\r\n\t }\r\n\telse\r\n\t{\r\n\t\tvar i;\r\n\t\tvar oneChar;\r\n\t\tfor( i = 0; i < text.length; i++ )\r\n\t\t{\r\n\t\t oneChar = text.charAt( i );\r\n\t\t if ( ! isCharValid( oneChar, DASH|NUMERICS ) )\r\n\t\t {\r\n\t\t\talert(getErrorMsg(11));\r\n\t\t\tfield.focus();\r\n\t\t\tfield.select();\r\n\t\t\treturn false;\r\n\t\t }\r\n\t\t}\r\n\t\ttext = removeNonDigits( text );\r\n\t\tif( text.length <6 )\r\n\t\t {\r\n\t\t\talert(getErrorMsg(12));\r\n\t\t\tfield.focus();\r\n\t\t\tfield.select();\r\n\t\t\treturn false;\r\n\t\t }\r\n\t\t \r\n\t\t//alert('Valid Phone Number');\r\n\t\treturn true;\r\n\t}\r\n }", "processParentPhone() {\n let input = this.parentPhone\n resetError(input)\n this.changed = true\n\n if (isEmpty(input)) {\n this.valid = false\n } else if (isNumber(input)) {\n this.valid = false\n } else if (exact(input, 11)) {\n this.valid = false\n } else {\n input.success = true\n this.valid = true\n }\n }", "function checkIsPhoneNumber(phoneField)\r\n{\r\n var s = phoneField.value;\r\n rePhoneNumber = new RegExp(/^[0-9]+[0-9]\\d{8}/);\r\n\r\n if (!(rePhoneNumber.test(s)))\r\n {\r\n alert(\"Please Enter valid Phone No\");\r\n phoneField.value = \"\";\r\n return true;\r\n } else\r\n {\r\n return false;\r\n }\r\n}", "function IsPhone(phone)\r\n{\r\n\tvar regex =/^(?:0|94|\\+94)?(?:(11|21|23|24|25|26|27|31|32|33|34|35|36|37|38|41|45|47|51|52|54|55|57|63|65|66|67|81|912)(0|2|3|4|5|7|9)|7(0|1|2|5|6|7|8)\\d)\\d{6}$/;;\r\n\tif(!regex.test(phone))\r\n\t{\r\n\t\treturn false;\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n}", "function phonevalid() {\n if (phoneExp.test(phoneSignUp.value)) {\n phoneSignupMsg.innerHTML = \"Valid Phone Number.\";\n phoneSignupMsg.style.color = \"green\";\n phoneSignupFlag = true;\n // console.log(\"Phone ethi\");\n return true;\n } \n else {\n phoneSignupMsg.innerHTML = \"Invalid Phone Number.\";\n phoneSignupMsg.style.color = \"red\";\n phoneSignupFlag = false\n return false;\n }\n}", "function telephoneCheck(str) {\n \n let regEx = RegExp(/^(1\\s?)?(\\(\\d{3}\\)|\\d{3})[\\s\\-]?\\d{3}[\\s\\-]?\\d{4}$/);\n \n return regEx.test(str);\n \n \n }", "function validatePhoneNumber(phone) {\n var phoneNumberPattern = /^[2-9]{1}[0-9]{2}[0-9]{3}[0-9]{4}/;\n return phoneNumberPattern.test(phone);\n }", "function isValidTelephone(telephone) {\n return /^\\D*\\d{3}\\D*\\d{3}\\D*\\d{4}\\D*$/.test(telephone);\n}", "function telephoneCheck(str) {\r\n if (!parseInt(str[0],10)){\r\n if (str[0] !== '('){\r\n return false;\r\n }\r\n }\r\n var n= /\\d/g;\r\n var p= /\\d|\\(|\\)/g;\r\n var base = str.match(n).join('');\r\n var par = str.match(p).join('');\r\n var p1 = -1;\r\n var p2 = -1;\r\n console.log(base);\r\n if (base.length === 10){\r\n console.log(\"added 1 to beginning\");\r\n base = \"1\"+base;\r\n par = \"1\"+par;\r\n }\r\n else if(base.length === 11){\r\n if (base[0] !== \"1\"){\r\n console.log(\"invalid country code\");\r\n return false;\r\n }\r\n }\r\n else{\r\n console.log(\"invalid number of digits\");\r\n return false;\r\n }\r\n p1 = par.indexOf('(');\r\n p2 = par.lastIndexOf(')');\r\n if (p1 >= 0 || p2 >= 0){\r\n console.log(\"contains parenthases\");\r\n console.log(par);\r\n if (p1 >= 0 && p2 >= 0){\r\n if(p1 !== 1){\r\n return false;\r\n }\r\n else{\r\n if (p2 !== 5){\r\n return false;\r\n }\r\n }\r\n }\r\n else{\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "function isValidphone(phone) {\n return /^((\\(?0\\d{4}\\)?\\s?\\d{3}\\s?\\d{3})|(\\(?0\\d{3}\\)?\\s?\\d{3}\\s?\\d{4})|(\\(?0\\d{2}\\)?\\s?\\d{4}\\s?\\d{4}))(\\s?\\#(\\d{4}|\\d{3}))?$/.test(phone);\n}", "function validatePhone(txtPhone) {\n var a = document.getElementById(txtPhone).value;\n // This filter asks for something like (123) 999-9999, so parentheses with any number (at least 1)\n // of digits\n var filter = /([0-9]{10})|(\\([0-9]{3}\\)\\s+[0-9]{3}\\-[0-9]{4})/;\n if (filter.test(a)) {\n return true;\n }\n else {\n return false;\n }\n}", "function telephoneCheck(str) {\n //Create a regular expression to check our passed phone number\n //(1\\s?) allows for country code 1 if passed\n //(\\d{3}\\)|\\d{3}) checks for zip code with and without parenthesis\n //[\\s\\-]? checks for spaces or dashes in the number\n //$ marks the end of the string\n let regex = /^(1\\s?)?(\\(\\d{3}\\)|\\d{3})[\\s\\-]?\\d{3}[\\s\\-]?\\d{4}$/; \n //test the str with regest.test(str)\n return regex.test(str);\n}", "function verifyFieldValue() {\n\tvar fieldValue = document.getElementById('phone_number').value; \n\tvar check = true;\n\tif (fieldValue != \"\") {\n\t\tif (isNumeric(fieldValue)) {\n\t\t\t/* the value is a number (public number) */\n\t\t} else {\n\t\t\t/* the value is not a number */\n\t\t\t/* check if the value contains '+' */\n\t\t\tvar plusIndex = fieldValue.lastIndexOf('+');\n\t\t\tif (plusIndex > -1) {\n\t\t\t\t/* the value contains '+' */\n\t\t\t\tif (plusIndex > 0) {\n\t\t\t\t\t/* the value contains '+' in another position than the first one */\n\t\t\t\t\tcheck = false;\n\t\t\t\t} else {\n\t\t\t\t\t/* it contains + on the first position */\n\t\t\t\t\t/* the rest of the value must be a number */\n\t\t\t\t\tif (isNumeric(fieldValue.substring(1)) == true) {\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t/* the rest of the value is not a number */\n\t\t\t\t\t\tcheck = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t/* the value dosn't contain '+' and is not a number*/\n\t\t\t\t/* check if the value has just one '*' */\n\t\t\t\tvar starFIndex = fieldValue.indexOf('*');\n\t\t\t\tvar starLIndex = fieldValue.lastIndexOf('*');\n\t\t\t\t\n\t\t\t\tif (starFIndex == starLIndex && starFIndex > 0) {\n\t\t\t\t\t/* the value has just one '*' */\n\t\t\t\t\t/* check if the '*' separates two numbers */\n\t\t\t\t\tvar firstNumber = fieldValue.substring(0, starFIndex -1);\n\t\t\t\t\tvar secondNumber = fieldValue.substring(starFIndex + 1);\n\t\t\t\t\tif (isNumeric(firstNumber) == true && isNumeric(secondNumber) == true) {\n\t\t\t\t\t\t/* the user introduced an extension number */\n\t\t\t\t\t} else {\n\t\t\t\t\t\t/* '*' doesn't separate two numbers */\n\t\t\t\t\t\tcheck = false;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t/* the value has more than one '*' */\n\t\t\t\t\tcheck = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t/* the value is null */\n\t\tcheck = false;\n\t}\n\t if (check == false) {\n\t\t/* display an error message */\n\t\tvar errorDiv = document.getElementById('warn_msg').style.display = \"\";\n\t\tvar errorText = document.getElementById('warn_msg').innerHTML = warnIcon+getLangMsg('err_invalid_phone_number_entered');\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}", "function phoneNum(){\r\n var number = document.getElementById(\"number\").value;\r\n console.log(number);\r\n\r\n if(/^\\D+([0-9]{3})\\D+([0-9]{3})\\D+([0-9]{4})$/.test(number)) { \r\n return true; \r\n } \r\n else { \r\n alert(\"Invalid number of digits/grouped improperly\"); \r\n return false; \r\n }\r\n}", "function validarTelefono() {\n var dni = document.getElementById(\"telefono\").value;\n if (/^[0-9]{8,8}/.test(dni)) {\n return true;\n }\n alert(\"Telefono inválido!\")\n return false;\n}", "function contactNumber(user_phone){\n var user_phone = getInputVal(\"userPhone\");\n if(user_phone.length !== 10){\n document.getElementById(\"phoneNumber\").innerHTML = \"enter the valid number\"; \n } \n else {\n document.getElementById(\"phoneNumber\").innerHTML = \"\";\n }\n }", "function validatePhone(val) {\n var stripped = trim(val).replace(/[\\(\\)\\.\\-\\ ]/g, '');\n //strip out acceptable non-numeric characters\n\n var phone_regex = /^(?:\\+?1\\s*(?:[.-]\\s*)?)?(?:\\(\\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\\s*\\)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\\s*(?:[.-]\\s*)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\\s*(?:[.-]\\s*)?([0-9]{4})$/;\n return phone_regex.test(stripped);\n}", "function telephoneCheck(str) {\n return /^(1\\s?)?(\\d{3}|\\(\\d{3}\\))[\\s-]?\\d{3}[\\s-]?\\d{4}$/.test(str);\n}", "function validatePhone(value) {\n const digits = /^\\d+$/giu;\n\n if (value && !digits.test(value)) {\n return 'Phone number can only contain digits';\n }\n\n if (value.length > 10) {\n return 'Phone number can only contain up to 10 digits';\n }\n\n return '';\n }", "function validatePhone (phoneValue) {\n\n\t\t// Raine: Notice how (phoneValue.charCodeAt(i) > 47 && phoneValue.charCodeAt(i) < 58) is repeated 5\n\t\t// times in this function? Great opportunity to refactor into a separate function. David: done\n\n\t\tfor (i=0; i < 3; i++) { //check that 1st three are digits\n\t\t\t if (!(isDigit(phoneValue.charCodeAt(i)))) {\n\t\t\t \treturn false;\n\t\t\t }\n\t\t\t // continue if first three are digits...\n\t\t}\n\t\tif (isDigit(phoneValue.charCodeAt(3))) {\n\t\t\tconsole.log(phoneValue[3]);\n\t\t\t//if 4th is a digit, check if the next six are digits (haven't yet prevented an 11th)\n\t\t\tfor (i=4; i < 10; i++) {\n\t\t\t\t if (!(isDigit(phoneValue.charCodeAt(i)))) {\n\t\t\t\t \treturn false;\n\t\t\t\t }\n\t\t\t }\t\t\t\n\t\t return true; //no further char testing needed, the entry proven to be 10 digits\n\t\t} \n\t\telse {\n\t\t\t// Raine: Same as (phoneValue[3] === '-')\n\t\t\tif (phoneValue.charCodeAt(3) == 45) {\n\t\t\t\t// if the 4th is a '-', check if the next three are digits\n\t\t\t\tfor (i=4; i < 7; i++) {\n\t\t\t\t \tif (!(isDigit(phoneValue.charCodeAt(i)))) {\n\t\t\t\t \treturn false;\n\t\t\t \t\t}\n\t \t\t\t} \t\t\t \t\n\t\t \t}\n\t \t}\n\t\t if (phoneValue.charCodeAt(7) == 45)\t{\n\t\t \t// if the 7th is a '-', check if the next four are digits\n\t\t \tfor (i=8; i < 11; i++) {\n\t\t\t \tif (!(isDigit(phoneValue.charCodeAt(i)))) {\n\t\t\t\t \treturn false;\n\t\t \t\t}\n\t\t \t}\n\t\t}\n\t\telse {\n\t\t\treturn false;\t\n\t\t}\n\t\treturn true;\t\t\n\t}", "function validPhoneNumber(phoneNumber){\n let splitStr = phoneNumber.split('') \n if (splitStr[0] === '(' && splitStr[4] === ')' && splitStr[9] === '-' && !splitStr[14] )return true\n return false\n}", "function telephoneCheck(str){\n var regex = /[0-9]*/g;\n //Contains ONLY \"0-9\", \"-\", \"(\", \")\"\n if(validCharacters(str)){\n //US Country code?\n if(getCountryCode(str) === \"1\" || getCountryCode(str)=== undefined){\n var nums = str.match(regex).join(\"\");\n //Number has 10 OR 11 digis && country code ?\n if(nums.length === 10 || (getCountryCode(str)=== \"1\" && nums.length === 11)){\n //valid Parenthesis?\n if(validParenthesis(str)){\n return true;\n }\n }\n }\n \n }\n return false;\n}", "function validatePhone(phone){\n $('#user_ph_error').html('');\n var phone = phone;\n var regEx = /\\(?\\d{3}\\)?[-. ]?\\d{3}[-.]?\\d{4}/;\n if (regEx.test(phone)) {\n return true;\n } else {\n var span = $('<span>').attr('id', 'user_age_error')\n .html(\" Phone must be valid (555-555-5555)!\")\n $('#user_ph').after(span);\n return false;\n }\n}" ]
[ "0.82622063", "0.8253023", "0.81372327", "0.8134091", "0.808094", "0.8064818", "0.8056426", "0.804736", "0.8036537", "0.8027282", "0.79202104", "0.79126143", "0.78999907", "0.78970844", "0.788502", "0.78679353", "0.7846669", "0.78421205", "0.7840188", "0.7832785", "0.78261554", "0.77592945", "0.7758239", "0.77564555", "0.77537084", "0.7744982", "0.7732605", "0.77256715", "0.77256393", "0.77242464", "0.77220774", "0.7715475", "0.7703289", "0.7701314", "0.7698135", "0.769006", "0.7686914", "0.7686855", "0.76794803", "0.76749045", "0.7666858", "0.76523054", "0.76341486", "0.76275194", "0.7610294", "0.7590567", "0.7582783", "0.75567347", "0.755173", "0.75480276", "0.7545014", "0.75441694", "0.7536706", "0.75321114", "0.75309575", "0.7513847", "0.7507907", "0.7506299", "0.7502371", "0.7498124", "0.7483064", "0.7470614", "0.74583447", "0.7450777", "0.74500304", "0.7443516", "0.7443177", "0.7439689", "0.74388486", "0.74230105", "0.74157435", "0.7412662", "0.7409927", "0.7392608", "0.73903185", "0.738841", "0.7382711", "0.73816514", "0.73776317", "0.73603654", "0.73585075", "0.7347573", "0.7347318", "0.7341243", "0.733928", "0.7335641", "0.73309755", "0.7322574", "0.73225695", "0.73211277", "0.73211116", "0.732066", "0.732059", "0.73193777", "0.7316538", "0.7314988", "0.7314939", "0.73124295", "0.73025703", "0.72925854" ]
0.75120986
56
function check the validation of birth input
function InvalidBirth(textbox){ /**read user selection input from calendar */ var birth = parseInt(textbox.value.substring(0, 4)); /**Calculate age of user */ var age = 2021 - birth; /**update validation textbox content */ if (textbox.value === '') { textbox.setCustomValidity('Entering an Birthday is necessary!'); }else if (age <= 12) { textbox.setCustomValidity('Test requirs minimum 12 years old'); }else{ textbox.setCustomValidity(''); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkBirthdate (input, error, extra) {\n if (input) {\n console.log(input)\n if (extra.test(input)) {\n return true\n }\n }\n error.classList.remove('hidden')\n return false\n}", "function check_inputBirthday() {\n\tvar text_birthday = $(\"#input_calendar\").val();\n\tvar show_err_birthday = $(\"#err_birthday\");\n\n\tif (!isValidDate(text_birthday)) {\n\t\tshow_err_birthday.html(\"Date not format\");\n\t\treturn false;\n\t}\n\n\tshow_err_birthday.css({\"color\": \"green\"});\n\tshow_err_birthday.html(\"OK\");\n\treturn true;\n}", "function try_birthdate() {\n var birth_date = [ $(\"#selfreg input[name=birth_year]\").val(),\n $(\"#selfreg select[name=birth_month]\").val(),\n $(\"#selfreg input[name=birth_day]\").val() ];\n if ((birth_date[0] == \"\") || (birth_date[2] == \"\")) {\n log(\"birth date fields not filled\");\n return false;\n }\n window.age_range = classify_age(birth_date);\n switch (window.age_range) {\n case 0:\n // couldn't parse. TODO: direct patron to staff\n break;\n case 1:\n show_form(\"#child_form\");\n break;\n case 2:\n show_form(\"#child_form\");\n break;\n case 3:\n show_form(\"#teen_form\");\n break;\n case 4:\n show_form(\"#adult_form\");\n break;\n }\n}", "function dateOfBirthValidation(dateOfBirth) {\n\tconst parts = dateOfBirth.split('-');\n\tconst year = parseInt(parts[0], 10);\n\tconst month = parseInt(parts[1], 10);\n\tconst day = parseInt(parts[2], 10);\n\n\tlet thisYear = new Date();\n\tif (year < 1910 || year > thisYear.getFullYear() || month === 0 || month > 12)\n\t\treturn false;\n\n\tconst monthLength = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n\n\tif (year % 400 === 0 || (year % 100 !== 0 && year % 4 === 0))\n\t\tmonthLength[1] = 29;\n\n\treturn day > 0 && day <= monthLength[month - 1];\n}", "processBirthDay() {\n let input = this.birthDate.day\n resetError(input)\n this.changed = true\n if (isEmpty(input)) {\n this.valid = false\n } else if (smallerThan(input, 1)) {\n this.valid = false\n } else if (biggerThan(input, 31)) {\n this.valid = false\n } else {\n input.success = true\n this.valid = true\n }\n }", "function validateBirthYear(year_of_birth) {\r\n if (year_of_birth < 1950 || year_of_birth > 2020) {\r\n alert(\"year invalid\");\r\n\r\n }\r\n else {\r\n year_of_birth = year_of_birth;\r\n return year_of_birth;\r\n }\r\n }", "function validateBirthdate(date) {\n if(date.value == \"\") {\n setError(date, errorMessages.birthdate);\n return false;\n }\n else {\n let birthdate = new Date(date.value);\n\tlet today = new Date();\n\t\tif (\n\t\t\tbirthdate.getDate() >= today.getDate() &&\n\t\t\tbirthdate.getMonth() == today.getMonth() &&\n\t\t\tbirthdate.getFullYear() == today.getFullYear()\n\t\t) {\n setError(date, errorMessages.birthdateInvalid);\n return false;\n }\n else {\n removeError(date);\n return true;\n }\n }\n}", "function getInput(){\n century = parseInt(document.getElementById(\"century\").value)\n year = parseInt(document.getElementById(\"year\").value)\n month = parseInt(document.getElementById(\"month\").value)\n dayOfMonth = parseInt(document.getElementById(\"monthday\").value)\n\n//check to confirm data is right.\n if(century == \"\"){\n alert(\"Input the correct centrury\")\n return false\n }else if (century < 19 || century > 20){\n alert(\"Kindly enter the correct century of birth\")\n return false\n }else if (year == \"\"){\n alert(\"Input the correct year of birth\")\n return false\n }else if (year < 00 || year > 99){\n alert(\"Kindly enter your correct year of birth (00 -99)\")\n return false \n }else if (month == \"\"){\n alert(\"Input the correct month of birth\")\n return false\n }else if (month < 1 || month > 12){\n alert(\"Kindly enter your correct month of birth in figure (1-12)\")\n return false\n }else if(dayOfMonth == \"\"){\n alert(\"input the correct date of birth\")\n return false\n }else if (dayOfMonth < 01 || dayOfMonth > 31){\n alert(\"Kindly enter your correct date of birth in figure (1-31)\")\n return false\n }\n}", "function validate_date_birth(date_birth) {\n if (date_birth.length > 0) {\n var regexp = /\\d{2}.\\d{2}.\\d{4}$/;\n return regexp.test(date_birth);\n }\n return false;\n}", "function validateDOB(field)\n{\n if(field == \"\")\n {\n return \"No Date of Birth was entered.\\n\";\n }\n else if(/^(0?[1-9]|[12][0-9]|3[01])[\\/\\-](0?[1-9]|1[012])[\\/\\-]\\d{4}$/.test(field))\n {\n return \"Enter correct Date Of Birth.\\n\";\n }\n return \"\";\n}", "function validateBirthdate(day_of_birth) {\r\n if (day_of_birth < 1 || day_of_birth > 31) {\r\n alert(\"date invalid\");\r\n\r\n }\r\n else {\r\n day_of_birth = day_of_birth;\r\n return day_of_birth;\r\n }\r\n\r\n }", "function dob_validate(dob) \r\n{\r\nvar regDOB = /^(\\d{1,2})[-\\/](\\d{1,2})[-\\/](\\d{4})$/;\r\n\r\n if(regDOB.test(dob) == false)\r\n {\r\n document.getElementById(\"statusDOB\").innerHTML\t= \"<span class='warning'>DOB is only used to verify your age.</span>\";\r\n }\r\n else\r\n {\r\n document.getElementById(\"statusDOB\").innerHTML\t= \"<span class='valid'>Thanks, you have entered a valid DOB!</span>\";\t\r\n }\r\n}", "function dob_validate(dob) {\n var regDOB = /^(\\d{1,2})[-\\/](\\d{1,2})[-\\/](\\d{4})$/;\n\n if (regDOB.test(dob) == false) {\n document.getElementById(\"statusDOB\").innerHTML = \"<span class='warning'>DOB is only used to verify your age.</span>\";\n }\n else {\n document.getElementById(\"statusDOB\").innerHTML = \"<span class='valid'>Thanks, you have entered a valid DOB!</span>\";\n }\n}", "function checkLegalBday() {\n\n\tvar bday = document.getElementById(\"bday\");\n\n\tvar dates = bday.value.split('/');\n\tif(dates.length == 2 && isLegalMonth(dates[0]) && isLegalYear(dates[1])) {\n\t\tdocument.getElementById(\"result\").innerHTML = \"\";\n\t}\n\telse {\n\t\tdocument.getElementById(\"result\").innerHTML = \"<p>Please provide your child's birthday in the format specified</p>\";\n\t\tbday.value = \"\";\n\t\n\t}\n}", "function isBirthYearValid(birthyear) {\n\t\"use strict\";\n\tvar date, currentYear, regExp;\n\tregExp = /^[0-9]*$/;\n\tif (!regExp.test(birthyear)) {\n\t\tdocument.getElementById('errorfieldforyear').innerHTML = \"invalid year\";\n\t\treturn false;\n\t}\n\tif (birthyear <= 1870) {\n\t\tdocument.getElementById('errorfieldforyear').innerHTML = \"invalid year\";\n\t\treturn false;\n\t}\n\tdate = new Date();\n\tcurrentYear = date.getFullYear();\n\tif (birthyear >= currentYear + 1) {\n\t\tdocument.getElementById('errorfieldforyear').innerHTML = \"invalid year\";\n\t\treturn false;\n\t}\n\tdocument.getElementById('errorfieldforyear').innerHTML = \"\";\n\treturn true;\n}", "function validateDateOfBirth(){\n\n\tvar dateOfBirth = $(\"#UserDateOfBirth\").val();\n\n\tif (dateOfBirth == null || dateOfBirth == \"\"){\n\t\t$(\"#check_date_of_birth\").html(\"(date of birth is required)\");\n\t\t$(\"#check_date_of_birth\").addClass(\"helper--highlight-text\");\n\t\t$(\"#UserDateOfBirth\").addClass(\"highlight_input\");\n\t\t$(\"#UserDateOfBirthLabel\").addClass(\"helper--highlight-text\");\n\t\t$(\"#UserDateOfBirthFormatLabel\").addClass(\"helper--highlight-text\");\n\n\t\talertString = alertString + \"date of birth is required\\n\";\n\t\tshowAlert = true;\n\t}else if(!isValidDate(dateOfBirth)){\n\t\t$(\"#check_date_of_birth\").html(\"(invalid format, dd/mm/yyyy required)\");\n\t\t$(\"#check_date_of_birth\").addClass(\"helper--highlight-text\");\n\t\t$(\"#UserDateOfBirth\").addClass(\"highlight_input\");\n\t\t$(\"#UserDateOfBirthLabel\").addClass(\"helper--highlight-text\");\n\t\t$(\"#UserDateOfBirthFormatLabel\").addClass(\"helper--highlight-text\");\n\n\t\talertString = alertString + \"date of birth is required in the format dd/mm/yyyy\\n\";\n\t\tshowAlert = true;\n\n\t}else{\n\t\t$(\"#check_date_of_birth\").html(\"\");\n\t\t$(\"#check_date_of_birth\").removeClass(\"helper--highlight-text\");\n\t\t$(\"#UserDateOfBirth\").removeClass(\"highlight_input\");\t\n\t\t$(\"#UserDateOfBirthLabel\").removeClass(\"helper--highlight-text\");\n\t\t$(\"#UserDateOfBirthFormatLabel\").removeClass(\"helper--highlight-text\");\t\n\t}\n}", "function checkDates(element)\n{ \n var birthDate = element.value;\n \n if(birthDate.length > 10){\n alert(\"Invalid Date Format\");\n element.value = \"\";\n element.focus();\n return;\n }\n var split = birthDate.split(/[^\\d]+/);\n var year = parseFloat(split[2]);\n var month = parseFloat(split[0]);\n var day = parseFloat(split[1]);\n if(birthDate != null){\n if (!/\\d{2}\\/\\d{2}\\/\\d{4}/.test(birthDate)) {\n alert(\"Invalid Date Format\");\n element.value = \"\";\n element.focus();\n return;\n }\n if(month > 13 || day > 32){\n alert(\"Invalid Date Format\");\n element.value = \"\";\n element.focus(); \n return;\n }\n }\n}", "function validateBirthmonth(month_of_birth) {\r\n if (month_of_birth < 1 || month_of_birth > 12) {\r\n alert(\"month invalid\");\r\n }\r\n else {\r\n month_of_birth = month_of_birth;\r\n return month_of_birth;\r\n }\r\n\r\n }", "function checkBirthdate(input) {\n if (input.value) {\n input.parentElement.removeAttribute('data-error');\n input.parentElement.removeAttribute('data-error-visible');\n const currentYear = new Date();\n const selectedYear = new Date(document.getElementById(\"birthdate\").value);\n\n // Vérification de la majorité de l'utilisateur\n if (checkAge(currentYear, selectedYear) >= 18) {\n input.parentElement.removeAttribute('data-error');\n input.parentElement.removeAttribute('data-error-visible');\n return true;\n } else {\n input.parentElement.setAttribute('data-error', 'Vous devez être majeur.');\n input.parentElement.setAttribute('data-error-visible', true);\n }\n } else {\n input.parentElement.setAttribute('data-error', 'Vous devez entrer votre date de naissance.');\n input.parentElement.setAttribute('data-error-visible', true);\n return false;\n }\n}", "function getBirthdate() {\n const d = document.querySelector('#n_jour_naissance').value;\n const m = document.querySelector('#n_mois_naissance').value;\n const y = document.querySelector('#n_annee_naissance').value;\n const complete = (!!d && d.length === 2) &&\n (!!m && m.length === 2) &&\n (!!y && y.length === 4);\n if (complete) {\n return y + '-' + m + '-' + d;\n } else {\n return null;\n }\n }", "function isValidDate(bd){\n\t/*checking if the format is corret*/\n\t/*format of YYYY-MM(M)-DD(M) is accepted*/\n\tif(!/^\\d{4}\\-\\d{1,2}\\-\\d{1,2}$/.test(bd)){\n return false;\n\t}\n\n // divide the input into year, month and date to validate\n var split_input = bd.split(\"-\");\n var year = parseInt(split_input[0], 10);\n var month = parseInt(split_input[1], 10);\n var day = parseInt(split_input[2], 10);\n \n \n\n // since it is birthdate, year range is set from 1918 to 2018\n if(year <= 1919 || year > 2019 || month == 0 || month > 12)\n return false;\n /*checks for if day provided is in range*/\n var daysInMonth = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ];\n\n if(day<=0 || day>daysInMonth[month-1])\n \treturn false;\n\n if (!isExpired(year,month,day)){\n\t\treturn false;\n\t}\n\n return true;\n}", "function validateDate(){\r\n\r\n\t\tvar date=document.getElementById(\"date\").value;\r\n\r\n\r\n \tif(date==\"\"){\r\n\r\n \t\tprintError(\"date of birth is required\",\"dateError\",\"red\");\r\n\t\ttextboxBorder(\"date\");\r\n\t\treturn false;\r\n\r\n \t}\r\n\r\n \r\n\r\n\r\n printSuccess(\"date\",\"green\",\"dateError\");\r\n return true;\r\n\r\n\r\n\r\n\r\n\r\n}", "function testDate(dob) {\n var birthdateMessage = document.getElementById('birthdateMessage');\n if (dob.length > 0) {\n var valid = moment().diff(dob, 'years') >= 13;\n //user is not as old as 13 years old\n if (!valid) {\n birthdateMessage.innerHTML = 'You must be 13 years old to sign up';\n birthdateMessage.style.display = 'inline';\n }\n //user is 13 years old or older\n else {\n birthdateMessage.style.display = 'none';\n }\n return valid;\n }\n birthdateMessage.style.display = 'none';\n return false;\n }", "function validateBioPerson(){\n\tvar boo = true;\n\tvar name=$('input[name=BP-name]');\n\tif (name[0].value==null || name[0].value==\"\"){\n\t\tsetErrorOnBox(name);\n\t//\tname.focus();\n\t\tboo = false;\n\t} else{\n\t\tsetValidOnBox(name);\n\t}\n \n\tvar mail=$('input[name=BP-mail]');\n\t\n\tif (!validateEmail(mail)){\n\t\tsetErrorOnBox(mail);\n\t//\tmail.focus();\n\t\tboo = false;\n\t} else{\n\t\tsetValidOnBox(mail);\n\t}\n\t\n\treturn boo;\n}", "function checkerBirth(e) {\n var currentValue = e.target.value;\n var dotLetter = '.';\n var fullBirthMask = []; // started hell DRY... need code review\n\n if (currentValue[0]) {\n fullBirthMask = [currentValue[0]].join('');\n inputBirth.value = fullBirthMask;\n }\n\n if (currentValue[0] && currentValue[1]) {\n fullBirthMask = [currentValue[0], currentValue[1], dotLetter].join('');\n inputBirth.value = fullBirthMask;\n }\n\n if (currentValue[0] && currentValue[1] && currentValue[2] && currentValue[3]) {\n fullBirthMask = [currentValue[0], currentValue[1], dotLetter, currentValue[3]].join('');\n inputBirth.value = fullBirthMask;\n }\n\n if (currentValue[0] && currentValue[1] && currentValue[2] && currentValue[3] && currentValue[4]) {\n fullBirthMask = [currentValue[0], currentValue[1], dotLetter, currentValue[3], currentValue[4], dotLetter].join('');\n inputBirth.value = fullBirthMask;\n }\n\n if (currentValue[0] && currentValue[1] && currentValue[2] && currentValue[3] && currentValue[4] && currentValue[5]) {\n fullBirthMask = [currentValue[0], currentValue[1], dotLetter, currentValue[3], currentValue[4], dotLetter, currentValue[6]].join('');\n inputBirth.value = fullBirthMask;\n }\n\n if (currentValue[0] && currentValue[1] && currentValue[2] && currentValue[3] && currentValue[4] && currentValue[5] && currentValue[6]) {\n fullBirthMask = [currentValue[0], currentValue[1], dotLetter, currentValue[3], currentValue[4], dotLetter, currentValue[6], currentValue[7]].join('');\n inputBirth.value = fullBirthMask;\n }\n\n if (currentValue[0] && currentValue[1] && currentValue[2] && currentValue[3] && currentValue[4] && currentValue[5] && currentValue[6] && currentValue[7] && currentValue[8]) {\n fullBirthMask = [currentValue[0], currentValue[1], dotLetter, currentValue[3], currentValue[4], dotLetter, currentValue[6], currentValue[7], currentValue[8], currentValue[9]].join('');\n inputBirth.value = fullBirthMask;\n }\n\n if (inputBirth.value.length < 10 || currentValue[0] >= 4 || currentValue[0] >= 3 && currentValue[1] >= 2 || currentValue[3] > 1 || currentValue[4] > 2 || currentValue[6] > 3 || currentValue[6] >= 2 && currentValue[7] > 0 || currentValue[6] == 1 && currentValue[7] < 9 || currentValue[6] >= 2 && currentValue[8] > 1 || currentValue[6] >= 2 && currentValue[8] >= 1 && currentValue[9] > 1) {\n inputBirth.classList.remove('form__input_valid');\n inputBirth.classList.add('form__input_not-valid');\n inputBirthValid = false;\n checkerSecondGroup();\n return false;\n }\n\n inputBirth.classList.remove('form__input_not-valid');\n inputBirth.classList.add('form__input_valid');\n inputBirthValid = true;\n checkerSecondGroup();\n} // function checker second group", "function checkBirthDay(element) {\n\t\tvar dob = txtBirthDay.val();\n\t\tvar thisRow = element.parent().parent();\n\t\tvar title = thisRow.children().get(0).innerText;\n\t\tvar toDay = new Date();\n\t\tvar thisDay = getFormatDate(dob);\n\n\t\tif (thisDay > toDay) {\n\t\t\tif (thisRow.children().get(2) == undefined) {\n\t\t\t\tthisRow.append(\"<td class='validate'>\" + title + \" can't be greater than the current date.</td>\");\n\t\t\t} else {\n\t\t\t\tthisRow.children().get(2).remove();\n\t\t\t\tthisRow.append(\"<td class='validate'>\" + title + \" can't be greater than the current date.</td>\");\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function checkBirth(myDay){\n\tlet d = new Date();\n\t// lay dc ngay va thang sinh nhat cua nguoi dung nhap vao, khong tinh nam\n\tlet arrDate = birthDay.split(\"-\");\n\t//lay ra nam hien tai\n\tlet year = d.getFullYear();\n\t//nhap chuoi ngay sinh nhat cua nguoi dung\n\tlet birthDay1 = year + \"-\" + arrDate[1] + \"-\" + arrDate[2];\n\tlet month = d.getMonth()+1;\n\tlet today = year + \"-\" + month + \"-\" + d.getDay();\n\tlet time1 = Date.parse(birthDay1);\n\tlet time2 = Date.parse(today);\n\tif(time1 == time2){\n\t\t// dung la ngay sinh nhat \n\t\treturn true;\n\t}\n\telse if(time1 < time2){\n\t\treturn false;\n\t}else{\n\t\treturn (time1 - time2)/86400000;\n\t}\n}", "function processUserData() {\n var day = parseInt(document.getElementById(\"day\").value);\n\n if (day <= 0 || day > 31 ){\n alert(\"choose a valid day\")\n throw new Error();\n }\n var month = parseInt(document.getElementById(\"month\").value);\n\n if (month <= 0 || month > 12){\n alert(\"choose a valid Month\")\n throw new Error();\n }\n\n var year = document.getElementById(\"year\").value;\n\n if (year.length < 4){\n year = addZerosLeft(year);\n \n }\n\n var century = parseInt(year.slice(0, year.length-2));\n var yearEnd = parseInt(year.slice(year.length-2));\n var dayOfBirth = Math.floor((((century / 4) - 2 * century - 1) + ((5 * yearEnd / 4)) + ((26 * (month + 1) / 10)) + day) % 7); \n return dayOfBirth;\n}", "function checkdate(input){\n\t//alert(input.value);\n\tvar validformat=/^\\d{2}\\/\\d{2}\\/\\d{4}$/ //Basic check for format validity\n\tvar returnval=false;\n\tif (!validformat.test(input.value)){\n\t\talert(\"Invalid Date Format. Please correct and submit again.\")\n\t\tdob.focus();\n\t\treturn_val = false;\n\t\treturn false;\n\t}\n\telse{ //Detailed check for valid date ranges\n\t\tvar monthfield=input.value.split(\"/\")[0]\n\t\tvar dayfield=input.value.split(\"/\")[1]\n\t\tvar yearfield=input.value.split(\"/\")[2]\n\t\tvar dayobj = new Date(yearfield, monthfield-1, dayfield)\n\t\tif ((dayobj.getMonth()+1!=monthfield)||(dayobj.getDate()!=dayfield)||(dayobj.getFullYear()!=yearfield)){\n\t\t\talert(\"Invalid Day, Month, or Year range detected. Please correct and submit again.\");\n\t\t\treturn_val = false;\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn true;\n}", "function validateBirthDayMonth() {\n\tvar flag = false;\n\tvar bd = document.getElementById(\"birthday\").value;\n\tvar pbd = parseInt(bd);\n\tvar bmid = document.getElementById(\"birthmonth\");\n\tvar bm = bmid.options[bmid.selectedIndex].value;\n\t//alert(bd + \" \" + bm);\n\tif (bd.trim() != \"\" && isNaN(pbd)) {\n\t\tdocument.getElementById(\"bd-error\").innerHTML = \"<h5>*&nbsp;Sorry enter a number only.</h5>\";\n\t\tdocument.getElementById(\"err-div-3\").className = \"col-3 sub-col-grad\";\n\t} else if (bd.trim() == \"\" && bm > 0) {\n\t\tdocument.getElementById(\"bm-error\").innerHTML = \"<h5>*&nbsp;Please select a birthday now or deselect month.</h5>\";\n\t\tdocument.getElementById(\"err-div-4\").className = \"col-3 sub-col-grad\";\n\t} else if (bd.trim() == \"\" && bm == 0) {\n\t\tflag = true;\n\t\tdocument.getElementById(\"bd-error\").innerHTML = \"\";\n\t\tdocument.getElementById(\"err-div-3\").className = \"col-3\";\n\t\tdocument.getElementById(\"bm-error\").innerHTML = \"\";\n\t\tdocument.getElementById(\"err-div-4\").className = \"col-3\";\n\t} else {\n\t\t// pbd is a number and needs to be validated.\n\t\tif (pbd > 31 || pbd < 1) {\n\t\t\tdocument.getElementById(\"bd-error\").innerHTML = \"<h5>*&nbsp;Sorry enter a number only between 1 an 31.</h5>\";\n\t\t\tdocument.getElementById(\"err-div-3\").className = \"col-3 sub-col-grad\";\n\t\t} else if ((pbd > 30) && (bm == 2 || bm == 4 || bm == 6 || bm == 9 || bm == 11)) {\n\t\t\tdocument.getElementById(\"bm-error\").innerHTML = \"<h5>*&nbsp;Month and Day combination inconsistent.</h5>\";\n\t\t\tdocument.getElementById(\"err-div-4\").className = \"col-3 sub-col-grad\";\n\t\t} else if ((pbd > 28) && (bm == 2)) {\n\t\t\tdocument.getElementById(\"bm-error\").innerHTML = \"<h5>*&nbsp;This is February we are talking about!</h5>\";\n\t\t\tdocument.getElementById(\"err-div-4\").className = \"col-3 sub-col-grad\";\n\t\t} else if ((pbd > 0 && pbd < 32) && bm == 0) {\n\t\t\tdocument.getElementById(\"bd-error\").innerHTML = \"<h5>*&nbsp;Please select a month now.</h5>\";\n\t\t\tdocument.getElementById(\"err-div-3\").className = \"col-3 sub-col-grad\";\n\t\t} else {\n\t\t\tflag = true;\n\t\t\tdocument.getElementById(\"bd-error\").innerHTML = \"\";\n\t\t\tdocument.getElementById(\"err-div-3\").className = \"col-3\";\n\t\t\tdocument.getElementById(\"bm-error\").innerHTML = \"\";\n\t\t\tdocument.getElementById(\"err-div-4\").className = \"col-3\";\n\t\t}\n\t}\n\treturn flag;\n}", "checkDOB(){\n if(this.state.dateOfBirth.length <= 0){\n return (\n <div>\n <p className=\"warningText\">Please enter your date of birth </p>\n </div>)\n }\n else if(new Date(this.state.dateOfBirth) > Date.now()){\n return (\n <div>\n <p className=\"warningText\">You cannot be born in the future </p>\n </div>)\n }\n }", "function ageCalculator(birth,year){\n var birth = prompt(\"Type your birth...\");\n var year = prompt(\"Type current year...\");\n var age=birth-year;\n var age=age*-1;\n if((birth==\"\")||(year==\"\")){\n alert(\"¡has not found any value!\");\n }else{\n alert(\"¡Ey!, You have \"+age);\n }\n}", "function isAge(value)\n {\n var dateOfBirth = value;\n var arr_dateText = dateOfBirth.split(\"/\");\n month = arr_dateText[0];\n day = arr_dateText[1];\n year = arr_dateText[2];\n var dob = new Date(year, month - 1, day, 0, 0, 0);\n var campDate = new Date(2015, 5, 1, 0, 0, 0);\n var maxDate = new Date(campDate.getFullYear() - 12, campDate.getMonth(), campDate.getDate()+1, 0, 0, 0);\n var minDate = new Date(campDate.getFullYear() - 18, campDate.getMonth(), campDate.getDate()-1, 0, 0, 0);\n if ((dob > minDate)&&(dob < maxDate)) {\n return true;\n }\n return false;\n }", "function check_form_verify () {\n const form = document.getElementById('form_verify');\n const error = document.getElementById('form_verify_error');\n error.style.display = 'none';\n if (form.diplom.value == '') {\n error.innerHTML = 'Please select a diplom.';\n error.style.display = 'block';\n return false;\n } else if (!(2010 <= parseInt(form.awarding_year.value, 10) && parseInt(form.awarding_year.value, 10) <= 2019)) {\n error.innerHTML = 'Please fill in a valid awarding date. (2010 -> 2019)';\n error.style.display = 'block';\n return false;\n } else if (!form.student_name.value.match(/^[A-Za-z ]+$/)) {\n error.innerHTML = 'Please fill in a valid name. What I call a \"valid name\" is a name given with only letters and spaces.<br>\\\n Ex: \"Jean-Pierre Dupont\" should be entered as \"Jean Pierre Dupont\"';\n error.style.display = 'block';\n return false;\n }\n const birthdate = form.student_birthdate.value.split('/');\n if (birthdate.length != 3) {\n error.innerHTML = 'Please fill in a valid birthdate. Ex: 01/01/1995';\n error.style.display = 'block';\n return false;\n } else if (!(1 <= parseInt(birthdate[0], 10) && parseInt(birthdate[0], 10) <= 31)) {\n error.innerHTML = 'Please fill in a valid birthdate. Ex: 01/01/1995';\n error.style.display = 'block';\n return false;\n } else if (!(1 <= parseInt(birthdate[1], 10) && parseInt(birthdate[1], 10) <= 12)) {\n error.innerHTML = 'Please fill in a valid birthdate. Ex: 01/01/1995';\n error.style.display = 'block';\n return false;\n } else if (!(1919 <= parseInt(birthdate[2], 10) && parseInt(birthdate[2], 10) <= 2019)) {\n error.innerHTML = 'Please fill in a valid birthdate. Ex: 01/01/1995 with the 1919 <= year <= 2019';\n error.style.display = 'block';\n return false;\n }\n const txid = form.txid.value;\n if (txid.length != 64) {\n error.innerHTML = 'Please fill in a valid transaction identifier (txid). This is a 64 characters hexadecimal value.';\n error.style.display = 'block';\n return false;\n }\n return true;\n}", "function isValidAge(age) {\n return age\n}", "function validate_age(age) {\n if (age.length > 0) {\n var regexp = /\\d{2}/;\n return regexp.test(age);\n }\n return false;\n}", "function chkYear(these)\n{\n \n \n var date = new Date();\n var yy = date.getYear();\n var year = (yy < 1000) ? yy + 1900 : yy;\n var deg_year=these.value;\n \n var dob=document.forms[0].strDob.value;\n dob=dob.substring(6, 10);\n /* if(document.forms[0].strDob.value==\"\")\n {\n alert(\"Please Select Date of Birth\");\n document.forms[0].strDob.value=\"\";\n these.value=\"\";\n document.forms[0].strDob.focus();\n return false;\n \n } */\n //else\n //{\n \n \n \n \n // if(document.forms[0].strDob.value!=\"\")\n //{ \n \n /* if(deg_year!=\"\")\n {\n \n if(eval(deg_year-dob)<18)\n {\n alert(\"You have entered invalid degree year.\");\n these.value=\"\";\n these.focus();\n return false;\n }\n else \n { */\n \n if(deg_year>year) \n {\n alert(\"Degree year entered should not be greater than current year.\");\n these.value=\"\";\n these.focus();\n return false;\n \n }\n \n \n \n \n //}\n // }\n //}\n \n }", "function validate_birthYear(id)\n{\n\t// Declaring variables and assuring proper access to html elements.\n\tvar birthyear = document.getElementById(id);\n\tif(birthyear === null)\n\t{\n\t\tconsole.error(\"'validate_birthYear' function: Failed to access the element of given id!\\nGiven argument value is: \" + id);\n\t\treturn false;\n\t}\n\t// This variable reserves the id (by the idea) of html element responsible for error message for further usage.\n\tvar attr_val = $(\"#\"+id).attr('error-field');\n\tif(attr_val === undefined || attr_val === \"\" )\n\t{\n\t\tconsole.error(\"'validate_birthYear' function: Wrong 'error-field' attribute value!\");\n\t\treturn false;\n\t}\n\tvar error_field = $(\"#\"+attr_val);\n\tif (error_field.val() === undefined)\n\t{\n\t\tconsole.error(\"'validate_birthYear' function: Failed to access the corresponding error field! Check the'error-field' attribute value.\");\n\t\treturn false;\n\t}\n\t// End of access check\n\t// ----------------------- Main 'if'. Executes logic described above.\n\tif (parseInt(birthyear.value) > new Date().getFullYear()|| parseInt(birthyear.value) < 1920)\n\t{\n\t\terror_field.removeClass(\"d-none\");\n\t\tbirthyear.style.backgroundColor = \"#ffffff\";\n\t\t$([document.documentElement, document.body]).animate(\n\t\t{\n\t\t\tscrollTop: error_field.offset().top - 85\n\t\t}, 1000);\n\t\treturn false;\n\t}\n\telse // ------------------ If validation is successful:\n\t{\n\t\treturn true;\n\t}\n\t// endif\n}", "validateYear(input) {\r\n // Handles an empty input field\r\n if (input === \"\") {\r\n return \"Year field cannot be empty\";\r\n }\r\n\r\n // Prevents users from putting in more than 2 characters\r\n if (input.length > 4) {\r\n // failing = true;\r\n return \"Year length must not exceed 4\";\r\n }\r\n\r\n if (\r\n // Checks for non-numeric characters\r\n isNaN(parseInt(input)) ||\r\n /^\\d+$/.test(input) === false\r\n ) {\r\n // failing = true;\r\n return \"Please enter a number\";\r\n } else if (\r\n parseInt(input) < 1776 ||\r\n parseInt(input) > parseInt(this.props.year)\r\n ) {\r\n // Checks that the month value is within a normal range\r\n return \"Please enter a valid Year\";\r\n }\r\n }", "function ageCheck(age) {\n return /\\D/.test(age);\n }", "function isDate(){\r\n\tvar birthday = document.getElementById(\"output-date\");\r\n\t//case1 YYYY/MM/DD\r\n\tvar case1 = \"(([0-9]{4})[-|/]([1-9]{1}|0[1-9]|1[0-2])[-|/]([1-9]{1}|0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1}))\";\r\n\t//case2 DD/MM/YYYY\r\n\tvar case2 = \"(([1-9]{1}|0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1})[-|/]([1-9]{1}|0[1-9]|1[0-2])[-|/]([0-9]{4}))\";\r\n\t//case3 MM/DD/YYYY\r\n\tvar case3 = \"(([1-9]{1}|0[1-9]|1[0-2])[-|/]([1-9]{1}|0[1-9]{1}|[1-2]{1}[0-9]{1}|3[0-1]{1})[-|/]([0-9]{4}))\";\r\n\tvar regexDate = new RegExp(case3);\r\n\tvar result = document.getElementById(\"date-error\");\r\n\tresult.innerHTML = \"\";\r\n\tconsole.log(regexDate.test(birthday.value));\r\n\tif(birthday.value === \"\") {\r\n\t\tresult.innerHTML = \"Please input your date\";\r\n\t\treturn false;\r\n\t}\r\n\tif(!regexDate.test(birthday.value)) {\r\n\t\tresult.innerHTML = \"Birthday wrong format\";\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "function valDOB(dob) {\n\treDOB = new RegExp(/^\\d{1,2}\\/\\d{1,2}\\/\\d{4}$/);\n\tif (!reDOB.test(dob)) {\n\t\treturn false;\n\t\t}\n\treturn true;\n}", "function age (){ \n var birthyr =$('#birth_year').val(); \n var dateyr = $('#date_year').val();\n var birthmo =$('#birth_month').val(); \n var datemo = $('#date_month').val();\n \n if ((isNaN(birthyr)) || (isNaN(dateyr))){alert(\"Please enter a valid number\");}\n else{\n if((dateyr-birthyr + datemo - birthmo)< 0){//when date year is less than birth year\n $('#date_month').val(birthmo);\n $('#date_year').val(birthyr);\n }\n if (dateyr>birthyr){\n $('#age_month').val(( datemo - birthmo+12)%12); \n if ((datemo-birthmo+12) >=12){\n $('#age_year').val(dateyr-birthyr);\n }\n else{\n $('#age_year').val(dateyr-birthyr-1);\n }\n }\n } \n}", "hasBirthday(first_name, middle_name, last_name) {\n\t for (id in Contacts.findOne(\"Contacts\")[\"contacts\"]) {\n\t\tif((Contacts.findOne(\"Contacts\")[\"contacts\"][id][\"name\"][\"first\"] == first_name) &&\n\t\t (Contacts.findOne(\"Contacts\")[\"contacts\"][id][\"name\"][\"middle\"] == middle_name) &&\n\t\t (Contacts.findOne(\"Contacts\")[\"contacts\"][id][\"name\"][\"last\"] == last_name)) {\n\t\t if(Contacts.findOne(\"Contacts\")[\"contacts\"][id][\"birthday\"]\n\t\t != undefined)\n\t\t\tif(Contacts.findOne(\"Contacts\")[\"contacts\"][id][\"birthday\"] != \"\")\t\t\t\n\t\t\t return true;\n\t\t}\t \n\t }\n\t return false;\n\t}", "function checkAge() { \r\n\r\n var age = document.getElementById(\"age\").value;\r\n if ( isNaN(age) || age < 18 || age > 60 ) \r\n { \r\n return true;\r\n }else\r\n {\r\n return false;\r\n }\r\n}", "function lastnameValidation()\n{\n\t// getting the value of name \n\tvar name = document.getElementById(\"lastname\");\n\t\n\t// searching for any numbers in the user input\n\tvar name_index = name.value.search(/\\d/);\n\t\t\t\n\t// condition if you get any number display this message\n\t\t\tif(name_index >= 0)\n\t\t\t\t{\n\t\t\t\t\tdocument.getElementById(\"lastname_error\").innerHTML=\"**Your name cannot have number\";\n\t\t\t\t\tname.focus();\t\t\t\t\t\n name.select();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t// condition is user didnot input anything display this message\t\n\t\t\telse if(name.value === \"\")\n\t\t\t\t{\n\t\t\t\t\tdocument.getElementById(\"lastname_error\").innerHTML=\"**Please Provide Your last Name.\";\n\t\t\t\t\tname.focus();\t\t\t\t\t\n name.select();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t// condition if everything is validated return true by removing the error message\n\t\telse{\n\t\t\tdocument.getElementById(\"lastname_error\").innerHTML=\"\";\n\t\t\treturn true;\n\t\t}\n\t}", "function ageFromBirthDate(birthDate) {\n const _MS_PER_YEAR = 1000 * 60 * 60 * 24 * 365;\n \n if (birthDate.length != 8 || isNaN(birthDate)) {\n return \"ERROR: birth date must be in the format: 'YYYYMMD'.\";\n }\n \n // only initialize the required objects to use as low memory as possible\n var today = new Date();\n \n // make sure the birth year is valid\n var today_year = today.getFullYear();\n var birth_year = Number(birthDate.substr(0,4));\n \n if (today_year < birth_year) {\n return \"ERROR: invalid birth year!\";\n } else {\n // if the birth month passed, only compare years\n // so, check if the birth month passed\n var today_month\t= today.getMonth()+1;\n var birth_month = Number(birthDate.substr(4,2));\n if (today_month > birth_month) {\n // birth month passed, only compare years\n return today_year - birth_year\n } else {\n // birth month not passed, check if it's his/her birth month\n var today_day = today.getDate();\n var birth_day = Number(birthDate.substr(6,2));\n if (today_month == birth_month) {\n // it's his/her birth month\n if (today_day >= birth_day) {\n // birth day passed\n return today_year - birth_year\n } else {\n // didn't reach his/her birth day\n return today_year - birth_year - 1\n }\n } else {\n // didn't reach his/her birth month\n return today_year - birth_year - 1\n }\n }\n }\n}", "function checkAgeUser() {\n\tvar dd = $(\"#lcom_pop input[name=DNgg]\").val();\n\tvar mm = $(\"#lcom_pop input[name=DNmm]\").val();\n\tvar yy = $(\"#lcom_pop input[name=DNaaaa]\").val();\n\tvar age = 18;\n\tif(dd != \"\" && mm != \"\" && yy !=\"\"){\n\t\tvar mydate = new Date();\n\t\tmydate.setFullYear(yy, mm-1, dd);\n\n\t\tvar currdate = new Date();\n\t\tcurrdate.setFullYear(currdate.getFullYear() - age);\n\t\tif ((currdate - mydate) < 0){\n\t\t\tchk_val = false;\n\t\t\tchk_val_first = false;\n\t\t\t$(\"#lcom_pop .error_date\").remove();\n\t\t\t$(\"#lcom_pop input[name=DNaaaa]\").before('<em class=\"error error_date\">*devi essere maggiorenne</em>');\n\t\t}\n\t\telse {}\n\t }\n}", "function birthdateData(data) {\n var valid = false;\n const regex_date = RegExp(/^\\d{4}\\-(0?[1-9]|1[012])\\-(0?[1-9]|[12][0-9]|3[01])$/);\n const regex_is = regex_date.test(data);\n var error = ('<span id=\"error4\" class=\"msg_error\">Vous devez entrer votre date de naissance valide.</span>');\n var errorData = document.getElementById(\"error4\");\n\n if (regex_is) {\n valid = true;\n formData[3].style.border = \"2px solid #33FF36\";\n }\n else {\n valid = false\n formData[3].style.border = \"2px solid red\";\n formData[3].insertAdjacentHTML(\"afterend\", error);\n } try {\n errorData.remove();\n } catch {}\n return valid;\n}", "validateYear(input) {\n const { year } = this.props;\n\n let returnString;\n // Handles an empty input field\n if (input === \"\") {\n returnString = \"Year field cannot be empty\";\n }\n\n // Prevents users from putting in more than 2 characters\n if (input.length > 4) {\n // failing = true;\n returnString = \"Year length must not exceed 4\";\n }\n\n if (\n // Checks for non-numeric characters\n Number.isNaN(parseInt(input, 10)) ||\n /^\\d+$/.test(input) === false\n ) {\n // failing = true;\n returnString = \"Please enter a number\";\n } else if (\n parseInt(input, 10) < 1776 ||\n parseInt(input, 10) > parseInt(year, 10)\n ) {\n // Checks that the month value is within a normal range\n returnString = \"Please enter a valid Year\";\n }\n return returnString;\n }", "function verifyYear(inputYear, min, max) {\n if (inputYear < min || inputYear > max) {\n showError();\n } else if (inputYear.length < 4 || inputYear.length > 4) {\n showError();\n } else {\n getAnimal(inputYear);\n }\n}", "function is_legal_date(str){\n\n let date_array = get_date_array(str)\n\n if( date_array[2] < birth_year ){\n\n return false\n }\n if( date_array[1] < 1 || months_in_year < date_array[1] ){\n\n return false\n }\n \n if( date_array[0] < 1 || possible_days( date_array[1], date_array[2] ) < date_array[0] ){\n\n return false\n }\n\n return true\n}", "function checkCPR(number) {\n //check at nummeret har den rigtige længde\n if (cpr_number.length === 10) {\n console.log(\"cpr number has the correct length\")\n for (i = 0; i < cpr_number.length - 1; i++) {\n //check for hver character i cpr nummeret om det er et tal\n if (!isNaN(parseInt(cpr_number[i]))) {\n console.log(cpr_number[i]);\n }\n else {\n console.log(\"cpr number contains a letter and is hence invalid\")\n break;\n }\n }\n var day = cpr_number.charAt(0) + cpr_number.charAt(1);\n console.log(\"day = \" + day);\n var month = cpr_number.charAt(2) + cpr_number.charAt(3);\n console.log(\"month = \" + month);\n var year = cpr_number.charAt(4) + cpr_number.charAt(5);\n console.log(\"year = \" + year);\n var cp7 = parseInt(cpr_number[6]);\n console.log(\"cp7 = \" + cp7);\n var gender = cpr_number.charAt(9)%2 == 0 ? 'woman' : 'man';\n //check at dagen har en korrekt værdi\n if (day >= 1 && day <= 31) {\n console.log(\"the day is valid\")\n //check at måneden har en korrekt værdi\n if (month >= 1 && month <= 12) {\n console.log(\"the month is valid\")\n //check at året har en korrekt værdi\n if (year >= 0 && year <= 99) {\n console.log(\"the year is valid\")\n //check at det 7'ende ciffer har en korrekt værdi\n switch (cp7) {\n //cp7 between 0-3 (both inclusive)\n case 0: case 1: case 2: case 3:\n if (year >= 00 && year <= 99) {\n var fullYear = parseInt(\"19\" + year);\n var age = 2017 - fullYear;\n console.log(\"the person's age is = \" + age + \" and the gender is = \" + gender);\n }\n break;\n //cp7 is 4\n case 4:\n if (year >= 00 && year <= 36) {\n var fullYear = parseInt(\"20\" + year);\n var age = new Date().getFullYear() - fullYear;\n console.log(\"the person's age is = \" + age + \" and the gender is = \" + gender);\n }\n else if (year >= 37 && year <= 99) {\n var fullYear = parseInt(\"19\" + year);\n var age = new Date().getFullYear() - fullYear;\n console.log(\"the person's age is = \" + age + \" and the gender is = \" + gender);\n }\n break;\n //cp7 between 5 and 8 (both inclusive)\n case 5: case 6: case 7: case 8:\n if (year >= 00 && year <= 57) {\n var fullYear = parseInt(\"20\" + year);\n var age = new Date().getFullYear() - fullYear;\n console.log(\"the person's age is = \" + age + \" and the gender is = \" + gender);\n }\n else if (year >= 58 && year <= 99) {\n var fullYear = parseInt(\"18\" + year);\n var age = new Date().getFullYear() - fullYear;\n console.log(\"the person's age is = \" + age + \" and the gender is = \" + gender);\n }\n break;\n //cp7 is 9\n case 9:\n if (year >= 00 && year <= 36) {\n var fullYear = parseInt(\"20\" + year);\n var age = 2017 - fullYear;\n console.log(\"the person's age is = \" + age + \" and the gender is = \" + gender);\n }\n else if (year >= 37 && year <= 99) {\n var fullYear = parseInt(\"19\" + year);\n var age = 2017 - fullYear;\n console.log(\"the person's age is = \" + age + \" and the gender is = \" + gender);\n }\n break;\n //cp7 is invalid\n default:\n console.log(\"ERROR ERROR ERROR ERROR\")\n break;\n }\n }\n else {\n console.log(\"the year is invalid\")\n }\n }\n else {\n console.log(\"the month is invalid\")\n }\n }\n else {\n console.log(\"the day is invalid\");\n }\n }\n else {\n console.log(\"the number has the wrong length and is invalid \")\n }\n}", "function ageCalc() {\n\n var birthYear = document.getElementById(\"year\").value;\n\n if (birthYear == \"\" || birthYear.match(/[A-Za-z]/g)) {\n alert(\"Please Enter a Birth Year!\");\n } else {\n var currentdate = new Date(),\n currentYear = currentdate.getFullYear();\n\n var age = currentYear - birthYear;\n\n document.getElementById(\"result\").innerHTML = age;\n\n }\n}", "function validateForm(form) {\n\tvar reqField = []\n\treqField.push(form.elements['firstName']);\n\treqField.push(form.elements['lastName']);\n\treqField.push(form.elements['address1']);\n\treqField.push(form.elements['city']);\n\treqField.push(form.elements['state']);\n\tzip = form.elements['zip']\n\tbirthdate = form.elements['birthdate']\n\n\ttoReturn = true;\n\n\treqField.forEach(function(field) {\n\t\tif (field.value.trim().length == 0) {\n\t\t\tfield.className = field.className + \" invalid-field\";\n\t\t\ttoReturn = false;\n\t\t} else {\n\t\t\tfield.className = 'form-control'\n\t\t}\n\t});\n\n\tif (document.getElementById('occupation').value == 'other') {\n\t\tvar otherBox = document.getElementsByName('occupationOther')[0]\n\t\tif (otherBox.value.trim().length == 0) {\n\t\t\totherBox.className = otherBox.className + ' invalid-field';\n\t\t\ttoReturn = false;\n\t\t} else {\n\t\t\totherBox.className = 'form-control'\n\t\t}\n\t}\n\n\tvar zipRegExp = new RegExp('^\\\\d{5}$');\n\n\tif (!zipRegExp.test(zip.value.trim())) {\n\t\tzip.className = zip.className + ' invalid-field';\n\t\ttoReturn = false;\n\t} else {\n\t\tzip.className = 'form-control';\n\t}\n\n\tif (birthdate.value.trim().length == 0) {\n\t\tbirthdate.className = birthdate.className + ' invalid-field'\n\t} else {\n\t\tvar dob = new Date(birthdate.value);\n\t\tvar today = new Date();\n\t\tif (today.getUTCFullYear() - dob.getUTCFullYear() == 13) {\n\t\t\tif (today.getUTCMonth() - dob.getUTCMonth() == 0) {\n\t\t\t\tif (today.getUTCDate() - dob.getUTCDate() == 0) {\n\t\t\t\t\tcorrectAge(birthdate)\n\t\t\t\t} else if (today.getUTCDate() - dob.getUTCDate() < 0) {\n\t\t\t\t\ttoReturn = tooYoung(birthdate);\n\t\t\t\t} else {\n\t\t\t\t\tcorrectAge(birthdate)\n\t\t\t\t}\n\t\t\t} else if (today.getUTCMonth() - dob.getUTCMonth() < 0) {\n\t\t\t\ttoReturn = tooYoung(birthdate);\n\n\t\t\t} else {\n\t\t\t\tcorrectAge(birthdate)\n\t\t\t}\n\t\t} else if (today.getUTCFullYear() - dob.getUTCFullYear() < 13) {\n\t\t\ttoReturn = tooYoung(birthdate);\n\n\t\t} else {\n\t\t\tcorrectAge(birthdate)\n\t\t}\n\t}\n\n\treturn toReturn;\n}", "function checkinputdate(thisDateField) \n{\n // add by charlie, 21-09-2003. trim the value before validation\n thisDateField.value = trim(thisDateField.value);\n // end add by charlie\n\tvar day = thisDateField.value.charAt(0).concat(thisDateField.value.charAt(1));\n\tvar month = thisDateField.value.charAt(3).concat(thisDateField.value.charAt(4));\n\tvar year = thisDateField.value.charAt(6).concat(thisDateField.value.charAt(7));\n\n\t// check input date is null or not\n\t//if (thisDateField.value.length==0) {\n\t\t//alert(\"Please provide the date\");\n\t\t//return false;\n\t//}\n\n // skip validation if no value is input\n\tif (thisDateField.value.length!=0){\n // check input length \n if (trim(thisDateField.value).length != 8) {\n alert(\"Input Date Format should be dd-mm-yy, ex: 01-04-01 for 1 April 2001\");\n thisDateField.focus(); \n return false;\n } \n\n // validate year input\n if (isNaN(year) || year < 0 || thisDateField.value.charAt(6)==\"-\") {\n alert(\"Year should between 00 to 99\");\n thisDateField.focus();\n return false;\n }\n\t\n // validate month input\n if (isNaN(month) || month <=0 || month > 12) {\n alert(\"Month should between 01 to 12\");\n thisDateField.focus();\n return false;\n }\n\n // validate day input\n if (isNaN(day) || day <= 0 || day > 31) {\n alert(\"Day range should between 01 to 31\");\n thisDateField.focus();\n return false;\n }\n\n // validate max day input allow according to the input month for (April, June, September, November)\n if ((month==4 || month==6 || month==9 || month==11) && day > 30) {\n alert(\"Day range should between 01 to 30\");\n thisDateField.focus(); \n return false;\n }\n\t\n // validate max day input allow for February according to input year (leap year)\n if (month==2) {\n if ( (parseInt(year) % 4 == 0 && parseInt(year) % 100 != 0 ) \n || parseInt(year) % 400 == 0 ){\n if (day > 29) {\n alert(\"Day range should between 0 to 29\");\n thisDateField.focus(); \n return false;\n }\n } else {\n if (day > 28) {\n alert(\"Day range should between 0 to 28\");\n thisDateField.focus();\n return false;\n }\n }\n }\n\t\n // validate is it a proper seperator between day and month, also between month and year\n if (thisDateField.value.charAt(2)!=\"-\" || thisDateField.value.charAt(5)!=\"-\") {\n alert(\"Invalid input for date, use - as a seperator\");\n thisDateField.focus();\n return false;\n }\n\n\n\n }\n\t\n\t// if input date is ok return true\n\treturn true;\n}", "function checkAge(a) {\n if (a.trim() == '') {\n throw new Error('ERROR: The field is empty! Please enter your age');\n } else if (isNaN(a)) {\n throw new Error('ERROR: You did not specify a numeric value');\n } else if (a < 14) {\n throw new Error('ERROR: You are to young');\n } else {\n confirmAge.style.display = 'block';\n }\n}", "function validateAge(){\r\n\tvar age = document.survey_form.age.value; //get the value\r\n\t//make sure the entry is a number\r\n\tvar numPattern = /^[0-9]+$/;\r\n\tif(!numPattern.test(age)){alert(\"Please enter a numerical value.\")}\r\n\tif (age < 10 || age > 90)\r\n\t\t{alert(\"Please enter a value between 10 and 90\")}\r\n\t}", "function pndFormCheck(number){\n var lastName = $('input.lastName');\n var firstName = $('input.firstName');\n if(lastName[number].value == null || lastName[number].value == \"\" || firstName[number].value == null || firstName[number].value == \"\"){\n alert('Füllen Sie bitte zunächst Nach- und Vornamenfelder aus');\n return false;\n }\n return true;\n\n }", "function myBirthYearFunc(birthYearInput){\r\n     console.log(\"I was born in \" + birthYearInput);\r\n }", "function checkDate() {\n const divParent = birthDay.parentNode\n const today = new Date(); // Date d'aujourd'hui au format jj/mm/aaaa\n const birthDate = new Date(birthDay.value);\n \n if ((birthDate > today) || birthDay.value === \"\") {\n \n divParent.setAttribute('data-error-visible', 'true')\n divParent.setAttribute('data-error', 'Vous devez entrer une date de naissance valide')\n return false\n } else {\n divParent.setAttribute('data-error-visible', 'false')\n return true\n }\n}", "function dateValidator(value) {\n // `this` is the mongoose document\n console.log('dateValidator:', this.date_of_birth, value)\n if( this.date_of_birth && value) {\n return this.date_of_birth < value;\n }\n else {\n return this.date_of_birth? true: false; // Only Death Date is invalid.\n }\n}", "function ageValidator() {\n //create patterns\n var findNonDigitPattern = /(\\D|\\s)/g;\n if (this.value) { //if has value\n var str = this.value.match(findNonDigitPattern); //find non-digit symbol and spacing\n if (str) {\n //delete wrong symbols and put only correct symbol (has effect if u paste string in input area)\n alert(\"You put invalid age data\");\n this.value = this.value.replace(findNonDigitPattern, \"\");\n }\n } else {\n alert(\"Age field is empty\");\n }\n return true;\n }", "function validateDate(date){\n\tdob = new Date($(date).val());\n\tvar today = new Date();\n\tvar age = Math.floor((today-dob) / (365.25 * 24 * 60 * 60 * 1000));\n\n\t//check if age is greater than 18 or age did not compute\n\tif ((age < 18) || (isNaN(age))){\n\t\t//if so create change label to red\n\t\t($(date).parent().prev().css('color','#B94A48'));\n\t\t//create error message\n\t\t$('#age_req').show();\n\t\treturn false;\n\n\t}\n\telse {\n\t\t//change label back to black\n\t\t($(date).parent().prev().css('color','#333'));\n\t\t//remove error message\n\t\t$('#age_req').hide();\n\t\treturn true;\n\t}\n}", "function v01() {\n let birthYear = Number(document.getElementById(\"year\").value);\n let present_yr = new Date().getFullYear();\n\n let age = present_yr - birthYear;\n if (age >= 18){\n document.getElementById(\"allow\").innerHTML = \"Welcome!\";\n } else {\n document.getElementById(\"allow\").innerHTML = \"too young\";\n }\n\n}", "function isValidDate1(bd){\n\t/*checking if the format is corret*/\n\t/*format of YYYY-MM(M)-DD(M) is accepted*/\n\tif(!/^\\d{4}\\-\\d{1,2}\\-\\d{1,2}$/.test(bd)){\n return false;\n\t}\n\n // divide the input into year, month and date to validate\n var split_input = bd.split(\"-\");\n var year = parseInt(split_input[0], 10);\n var month = parseInt(split_input[1], 10);\n var day = parseInt(split_input[2], 10);\n \n \n\n // since it is expire date, user can still enter credit card that is expired\n if(month == 0 || month > 12)\n return false;\n /*checks for if day provided is in range*/\n var daysInMonth = [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ];\n\n if(day<=0 || day>daysInMonth[month-1])\n \treturn false;\n\n \n\n\tif (isExpired(year,month,day)){\n\t\treturn false;\n\t}\n\n return true;\n}", "function birthday(bday, bMonth)\r\n{\r\n if (bday == 5 || bMonth == 9)\r\n {\r\n console.log(\"How did you know?\")\r\n }\r\n else \r\n {\r\n console.log(\"Just another day....\")\r\n }\r\n\r\n}", "function birthday(num1, num2) {\n if(typeof num1 != \"number\" || typeof num2 != \"number\") {\n console.log(\"Error: variables must be a number.\");\n return;\n }\n if((Math.floor(num1) == 3 && Math.floor(num2) == 10) || (Math.floor(num1) == 10 && Math.floor(num2) == 3)) {\n console.log(\"How did you know?\");\n }\n else {\n console.log(\"Just another day...\");\n }\n}", "function validate(yr,mo,da){\n if ((yr <=current_year) && (mo<=12) && (da<=31)){\n return true\n }\n else{\n return false\n }\n}", "function validateLabPerson(){\n\tvar boo = true;\n\n\t//validate name\n\tif(!validateLPname()){\n\t\tboo = false;\n\t}\n\t\n\t//validate mail\n\tvar mail=$('input[name=LP-mail]');\n\tif (!validateEmail(mail)){\n\t\tsetErrorOnBox(mail);\n\t\t//mail.focus();\n\t\tboo = false;\n\t} else{\n\t\tsetValidOnBox(mail);\n\t}\n\t\n\t//validate phone\n\tvar phone=$('input[name=LP-phone]');\n\tif (phone[0].value==null || phone[0].value==\"\"){\n\t\tsetErrorOnBox(phone);\n\t\t//phone.focus();\n\t\tboo = false;\n\t} else{\n\t\tif(!phone[0].value.match(/^[0-9+ ]+$/)){\n\t\t\tsetErrorOnBox(phone);\n\t\t\tboo = false;\n\t\t} else {\n\t\t\tsetValidOnBox(phone);\n\t\t}\n\t}\n\t\n\treturn boo;\n}", "validate(value){\n if(value < 0) throw new Error('The age must be a positive number')\n }", "function validarAge(){\n\n let age = document.getElementById(\"age\");\n\n if(age.value === \"\"){\n alert(\"El Age no puede estar vacio\"); \n return false;\n }\n return true;\n}", "function validLastName() {\r\n\r\n var lastName = $lastName.val();\r\n\r\n if (lastName.length < 2 || lastName.length > 30) {\r\n $lastName.addClass('is-invalid');\r\n } else {\r\n $lastName.removeClass('is-invalid');\r\n }\r\n }", "function yearCheck(srcObj){\n if (!srcObj) \n return false;\n if (srcObj.value.length < 4) {\n alert(\"Please enter in 4 digits Format: 2010\");\n srcObj.focus();\n return false;\n }\n return true;\n}", "function validate (input) {\n \t//ver dps..\n \treturn true;\n }", "function validate() {\n\t\t\tvar allOk = true;\n\t\t\tvar ok = $userFullName.val().match(/[\\w -]{3,}/) !== null;\n\t\t\ttooltip.set($userFullName, !ok);\n\t\t\tallOk = allOk && ok;\n\n\t\t\tok = $userEmail.val().match(/^[\\w\\.\\-_]{1,}@([\\w\\-_]+.){1,}\\w{3,5}$/) !== null;\n\t\t\ttooltip.set($userEmail, !ok);\n\t\t\tallOk = allOk && ok;\n\n\t\t\tok = $userPhone.val().match(/^[\\d+\\s\\-]{5,}$/) !== null;\n\t\t\ttooltip.set($userPhone, !ok);\n\t\t\tallOk = allOk && ok;\n\n\t\t\tok = $userCitizenship.val().match(/^[\\w\\s]{2,}$/) !== null;\n\t\t\ttooltip.set($userCitizenship, !ok);\n\t\t\tallOk = allOk && ok;\n\n\t\t\tok = datepicker.isValid();\n\t\t\tallOk = allOk && ok;\n\n\t\t\ttooltip.set($submitBookingButton, !allOk);\n\t\t\treturn allOk;\n\t\t}", "function checkValidLastName() {\n let validDiv = '#validLastName'\n const lastName = $('#validationCustom02').val()\n let input = document.getElementById('validationCustom02')\n let invalidDiv = '#invalidLastName'\n let regPattern = /^(?=.{1,50}$)[a-zZäöåÄÖÅ]+(?:['_.\\s][a-zZäöåÄÖÅ]+)*$/i\n\n if (lastName.trim() == '') {\n $(validDiv).hide()\n $(invalidDiv).text('Efternamn krävs')\n $(validDiv).text('')\n $(invalidDiv).show()\n $(input).addClass('is-invalid').removeClass('is-valid')\n\n return false\n } else if (!regPattern.test(lastName)) {\n $(validDiv).hide()\n $(invalidDiv).css('color', 'red')\n $(invalidDiv).text('Ogiltig! Endast karaktärer tack')\n $(validDiv).text('')\n $(invalidDiv).show()\n $(input).addClass('is-invalid').removeClass('is-valid')\n return false\n } else {\n $(invalidDiv).hide()\n $(validDiv).text('Giltig')\n $(validDiv).show()\n $(input).removeClass('is-invalid').addClass('is-valid')\n return true\n }\n}", "function f_lastname(){\n var lastname = document.getElementById(\"lastname\").value;\n if(lastname === \"\"){\n alert(\"El campo de apellido esta vacio\");\n return false;}\n else{\n return true;\n }\n }", "function check_form_certify() {\n const form = document.getElementById('form_certify');\n const error = document.getElementById('form_certify_error');\n error.style.display = 'none';\n if (form.diplom.value == '') {\n error.innerHTML = 'Please select a diplom.';\n error.style.display = 'block';\n return false;\n } else if (!(2010 <= parseInt(form.awarding_year.value, 10) && parseInt(form.awarding_year.value, 10) <= 2019)) {\n error.innerHTML = 'Please fill in a valid awarding date. (2010 -> 2019)';\n error.style.display = 'block';\n return false;\n } else if (!form.student_name.value.match(/^[A-Za-z ]+$/)) {\n error.innerHTML = 'Please fill in a valid name. What I call a \"valid name\" is a name given with only letters and spaces.<br>\\\n Ex: \"Jean-Pierre Dupont\" should be entered as \"Jean Pierre Dupont\"';\n error.style.display = 'block';\n return false;\n }\n const birthdate = form.birthdate.value.split('/');\n if (birthdate.length != 3) {\n error.innerHTML = 'Please fill in a valid birthdate. Ex: 01/01/1995';\n error.style.display = 'block';\n return false;\n } else if (!(1 <= parseInt(birthdate[0], 10) && parseInt(birthdate[0], 10) <= 31)) {\n error.innerHTML = 'Please fill in a valid birthdate. Ex: 01/01/1995';\n error.style.display = 'block';\n return false;\n } else if (!(1 <= parseInt(birthdate[1], 10) && parseInt(birthdate[1], 10) <= 12)) {\n error.innerHTML = 'Please fill in a valid birthdate. Ex: 01/01/1995';\n error.style.display = 'block';\n return false;\n } else if (!(1919 <= parseInt(birthdate[2], 10) && parseInt(birthdate[2], 10) <= 2019)) {\n error.innerHTML = 'Please fill in a valid birthdate. Ex: 01/01/1995 with the 1919 <= year <= 2019';\n error.style.display = 'block';\n return false;\n }\n return true;\n}", "function checkLastName() {\n\tvar lastname = document.getElementById(\"lastname\").value;\n\tvar hasNumber = /\\d/;\n\tvar onlyLetters = /^[a-zA-Z]+$/;\n\tif(onlyLetters.test(lastname)) {\n\t\tdocument.getElementById(\"name_error\").innerHTML = \"\";\n\t}\n\telse if (hasNumber.test(lastname)){\n\t\tdocument.getElementById(\"name_error\").innerHTML = \"Your name should not be consisting numbers.\";\n\t}\n}", "function checkUserForm() {\n // --Required text inputs shouldn't be blank.\n if (\n [\n $(\"#txtFirstName\").val(),\n $(\"#txtLastName\").val(),\n $(\"#dateBirthday\").val(),\n $(\"#txtNewPIN\").val(),\n ].includes(\"\")\n ) {\n alert(\n \"You must provide a First Name, Last Name, Birthday, and a new PIN number. You may reuse your old PIN number.\"\n );\n return false;\n } else {\n // --Date of birth (if included) should occur before today\n // --For any select menus, ensure a value has been selected\n // We add 1 day to ensure the date isn't today's since\n // it is specifically required by the assignment.\n let birthdate = new Date($(\"#dateBirthday\").val());\n birthdate.setDate(birthdate.getDate() + 1);\n if (birthdate >= Date.now()) {\n alert(\"Birthday must be before today.\");\n return false;\n } else {\n // --Ensure numeric inputs fall within a logical range.\n // We could yet check for the desired screen time per day\n // using the value of sldMaxHoursPerDay as I've demonstrated\n // in previous labs, but since sliders automatically clamp\n // to min and max values, this is unnecessary.\n return true;\n }\n }\n}", "function phonenumber(inputtxt) \r\n { \r\n var phoneno = /^\\d{10}$/; \r\n if((inputtxt.value.match(phoneno))) \r\n { \r\n return true; \r\n } \r\n else \r\n { \r\n alert(\"it shuld be no and must be 10 digit...\"); \r\n document.reg.phn.value=\"\";\r\n phn.focus();\r\n document.getElementById('submitbtn').disabled = true;\r\n return false; \r\n } \r\n isValidForm = true;\r\n \t document.getElementById('submitbtn').disabled = false;\r\n \t console.log(\"Succes age is validated\");\r\n \r\n }", "function checkDOB(element)\n{\n\tif(element==\"Invalid date\")\n\t{\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\treturn true;\n\t}\n}", "function vicdobFunction() {\n var now = new Date(); //Todays Date \n var dob = document.getElementById(\"fir_victimdob\").value;\n\n var today = document.getElementById(\"fir_date\").value;\n today = today.split(' ')[0];\n var date = today.split(\"-\").reverse().join(\"-\");\n var datecheck=date.split(\"-\");\n var datecheckyear = datecheck[0];\n\n\n var dobyearcheck=dob.split(\"-\");\n var dobyearcheckyear = dobyearcheck[0];\n // var date = today.getFullYear()+'-'+((\"0\" + (today.getMonth() + 1)).slice(-2))+'-'+(\"0\" + today.getDate()).slice(-2);\n if ( dob > date )\n{\n document.getElementById(\"fir_victimdob\").focus();\n document.getElementById(\"fir_victimyob\").value = '';\n document.getElementById(\"fir_victimyob\").value = '';\n document.getElementById(\"fir_victimageyear\").value = '';\n document.getElementById(\"fir_victimagemonth\").value = ''; \n document.getElementById(\"fir_victimagefrom\").value = '';\n document.getElementById(\"fir_victimageto\").value = '';\n return false;\n\n}\n else if ( dobyearcheckyear < 1900 )\n{\n document.getElementById(\"fir_victimdob\").focus();\n document.getElementById(\"fir_victimyob\").value = '';\n document.getElementById(\"fir_victimyob\").value = '';\n document.getElementById(\"fir_victimageyear\").value = '';\n document.getElementById(\"fir_victimagemonth\").value = ''; \n document.getElementById(\"fir_victimagefrom\").value = '';\n document.getElementById(\"fir_victimageto\").value = '';\n return false;\n\n}\n else if ( dobyearcheckyear > datecheck[0] )\n{\n document.getElementById(\"fir_victimdob\").focus();\n document.getElementById(\"fir_victimyob\").value = '';\n document.getElementById(\"fir_victimyob\").value = '';\n document.getElementById(\"fir_victimageyear\").value = '';\n document.getElementById(\"fir_victimagemonth\").value = ''; \n document.getElementById(\"fir_victimagefrom\").value = '';\n document.getElementById(\"fir_victimageto\").value = '';\n return false;\n\n}\nelse\n{\n var dobcal = new Date(dob);\n var today = new Date();\n var birthday=dob.split(\"-\");\n var dobYear= birthday[0];\n var dobMonth= birthday[1];\n var dobDay= birthday[2];\n\n var yob = dobcal.getFullYear(dobcal);\n var age = Math.floor((today-dobcal) / (365.25 * 24 * 60 * 60 * 1000));\n\n var today = document.getElementById(\"fir_date\").value;\n today = today.split(' ')[0];\n var date = today.split(\"-\").reverse().join(\"-\");\n var datecheck=date.split(\"-\");\n var datecheckyear = datecheck[0];\n\nvar nowDay= datecheck[2];\nvar nowMonth = datecheck[1]; //jan = 0 so month + 1\nvar nowYear= datecheck[0];\n\nvar ageyear = nowYear - dobYear;\nvar agemonth = nowMonth - dobMonth;\nvar ageday = nowDay- dobDay;\nif (agemonth <= 0) {\n ageyear--;\n agemonth = (12 + agemonth);\n }\nif (agemonth == 12){\n ageyear++;\n agemonth = 0;\n }\n\n document.getElementById(\"fir_victimyob\").value = yob;\n document.getElementById(\"fir_victimageyear\").value = ageyear;\n document.getElementById(\"fir_victimagemonth\").value = agemonth; \n document.getElementById(\"fir_victimagefrom\").value = ageyear;\n document.getElementById(\"fir_victimageto\").value = ageyear; \n}\n}", "function lastNameValidation(){\n let $lastname = $('#lastname').val();\n var lastnameRegExp = new RegExp(\"^[a-zA-Z]+$\");\n if(!lastnameRegExp.test($lastname)){\n alert(`\"${$('#lastname').val()}\" is not a valid last name. Please insert alphabet characters only.`);\n $('#lastname').focus(); \n }\n return true;\n console.log($lastname);\n }", "function verifierAge(age)\n{\n\tif (!isNaN(parseInt(age)))\n\t\tif (parseInt(age)>17)\n\t\t\treturn true;\n\treturn false;\n}", "function dateValidation() {\n if (!leapYear()) {invalidDates.push(\"0229\")}; \n\n for (let i=0; i<invalidDates.length ;i++) {\n if (invalidDates[i].match(pnMd)) {\n return false;\n };\n }\n return true;\n }", "#checkEarlyDates() {\n let theYear1500 = new Date(\"1500-01-01\");\n let theYear1700 = new Date(\"1700-01-01\");\n let today = new Date();\n let year = today.getFullYear();\n let month = today.getMonth();\n let day = today.getDate();\n let earliestMemoryBeforeDeath = new Date(year - BioCheckPerson.TOO_OLD_TO_REMEMBER_DEATH, month, day);\n let earliestMemoryBeforeBirth = new Date(year - BioCheckPerson.TOO_OLD_TO_REMEMBER_BIRTH, month, day);\n\n if (this.#birthDate != null) {\n if (this.#birthDate < theYear1500) {\n this.#isPre1500 = true;\n }\n if (this.#birthDate < theYear1700) {\n this.#isPre1700 = true;\n }\n if (this.#birthDate < earliestMemoryBeforeBirth) {\n this.#tooOldToRemember = true;\n }\n }\n if (this.#deathDate != null) {\n if (this.#deathDate < theYear1500) {\n this.#isPre1500 = true;\n }\n if (this.#deathDate < theYear1700) {\n this.#isPre1700 = true;\n }\n if (this.#deathDate < earliestMemoryBeforeDeath) {\n this.#tooOldToRemember = true;\n }\n }\n if (this.#isPre1500) {\n this.#isPre1700 = true;\n this.#tooOldToRemember = true;\n }\n if (this.#isPre1700) {\n this.#tooOldToRemember = true;\n }\n /*\n * Since you already have today, pick up the date to use for\n * a source will be entered by xxxx tests\n */\n this.#oneYearAgo = new Date(year - 1, month, day);\n }", "function checkdob()\n{\n var dob=document.getElementById(\"dob\");\n if(dob.value==\"\")\n {\n alert(\" Please select your Date Of Birth \");\n dob.style.border=\"solid red\"\n //dob.focus();\n return false;\n }\n else\n {dob.style.border=\"solid green\";\n return true;\n }\n\n}", "function checkBirthday(birthday) {\n // код для задачи №3 писать \n //now = date.setMilliseconds(ms);\n return (Date.now() - (+new Date(birthday))/31557600000 >=18;\n}", "function validateAgeRanges(){\r\n\r\n\tvar status = true;\r\n\tvar lowAgeString = $(\"codesForm:lowAge\").value;\r\n\tvar lowAgeUnit = $(\"codesForm:lowAgeUnit\").value;\r\n\tvar highAgeString = $(\"codesForm:highAge\").value;\r\n\tvar highAgeUnit = $(\"codesForm:highAgeUnit\").value;\r\n\tlowAge = parseInt(lowAgeString);\r\n\thighAge = parseInt(highAgeString);\r\n\t\r\n\tif((highAgeUnit == lowAgeUnit)&&(lowAge >= highAge))\t\r\n\t\tstatus = false;\r\n\t\r\n\telse if(highAgeUnit!=lowAgeUnit){\r\n\t\tif((lowAgeUnit == \"year\")&&(highAgeUnit == \"month\")&&(lowAge*12 >= highAge))\r\n\t\t\tstatus = false;\r\n\t\tif((lowAgeUnit == \"year\")&&(highAgeUnit == \"week\")&&(lowAge*365 >= highAge*7))\r\n\t\t\tstatus = false;\r\n\t\tif((lowAgeUnit == \"year\")&&(highAgeUnit == \"day\")&&(lowAge*365 >= highAge))\r\n\t\t\tstatus = false;\r\n\t\tif((lowAgeUnit == \"month\")&&(highAgeUnit == \"year\")&&(lowAge >= highAge*12))\r\n\t\t\tstatus = false;\r\n\t\tif((lowAgeUnit == \"month\")&&(highAgeUnit == \"week\")&&(lowAge*30 >= highAge*7))\r\n\t\t\tstatus = false;\r\n\t\tif((lowAgeUnit == \"month\")&&(highAgeUnit == \"day\")&&(lowAge*30 >= highAge))\r\n\t\t\tstatus = false;\r\n\t\tif((lowAgeUnit == \"week\")&&(highAgeUnit == \"year\")&&(lowAge*7 >= highAge*365))\r\n\t\t\tstatus = false;\r\n\t\tif((lowAgeUnit == \"week\")&&(highAgeUnit == \"month\")&&(lowAge*7 >= highAge*30))\r\n\t\t\tstatus = false;\r\n\t\tif((lowAgeUnit == \"week\")&&(highAgeUnit == \"day\")&&(lowAge*7 >= highAge))\r\n\t\t\tstatus = false;\r\n\t\tif((lowAgeUnit == \"day\")&&(highAgeUnit == \"year\")&&(lowAge >= highAge*365))\r\n\t\t\tstatus = false;\r\n\t\tif((lowAgeUnit == \"day\")&&(highAgeUnit == \"month\")&&(lowAge >= highAge*30))\r\n\t\t\tstatus = false;\r\n\t\tif((lowAgeUnit == \"day\")&&(highAgeUnit == \"week\")&&(lowAge >= highAge*7))\r\n\t\t\tstatus = false;\r\n\t}\r\n\t\r\n\tif(status == false)\r\n\t\t$('ageRangeErrorBox').innerHTML = \"Enter correct age range.Higher age range should be greater than low age range.\";\r\n\telse\r\n\t\t$('ageRangeErrorBox').innerHTML = \"\";\r\n\treturn status;\r\n}", "function usable(birth_name, imdb_name, person) {\n\tif (!birth_name || !imdb_name) {\n\t\trejects.undefined++;\n\t\treturn false;\n\t}\n\n\tvar bNames = birth_name.split(' ');\n\tvar cNames = imdb_name.split(' ');\n\n\tbNames = cleanNameArray(bNames);\n\tcNames = cleanNameArray(cNames);\n\n\t// It's the exact same!\n\tif (bNames[0] === cNames[0] && bNames[bNames.length-1] === cNames[cNames.length-1])\n\t\treturn false;\n\n\t// Most rigid case where case where either name is not the same.\n\tif (bNames[0] !== cNames[0] || bNames[bNames.length-1] !== cNames[cNames.length-1]) {\n\t\t// Because then it's obvious\n\t\tif (birth_name.includes('Not Found')) { \n\t\t\trejects.notfound.push([birth_name,imdb_name]);\n\t\t\treturn false;\n\t\t}\n\n\t\t// Married\n\t\t// (Her) first name is the same even after the name change. \n\t\tif (bNames[0] === cNames[0]) {\n\t\t\tvar spouse_names = cleanNameArray(person.spouse_name.split(' '));\n\t\t\t// She has the same last name as their spouse.\n\t\t\tif (cNames[cNames.length-1] === spouse_names[spouse_names.length-1]) {\n\t\t\t\t// Just circumventing problem in the data where sometimes the spouse has the exact same name as themself\n\t\t\t\tif (cNames[0] !== spouse_names[0]) {\n\t\t\t\t\t// She just changed her name because she got married.\n\t\t\t\t\trejects.married.push([birth_name,imdb_name,person.spouse_name]);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Initials\n\t\tif ((bNames.length > 2) && (cNames[0] === `${bNames[0][0]}${bNames[1][0]}`)) {\n\t\t\trejects.initials.push([birth_name,imdb_name]);\n\t\t\treturn false;\n\t\t}\n\n\t\t// Nicknames (first names only)\n\t\tif (nicksDictionary[bNames[0]] && nicksDictionary[bNames[0]][cNames[0]]) {\n\t\t\trejects.nicknames.push([birth_name,imdb_name]);\n\t\t\treturn false;\n\t\t}\n\n\t\t// TODO: Count how many people just go by another given name.\n\t\t// Weird dropping of hyphen or something? Only if encounter it...\n\t}\n\n\tapproved.push(person.tmdb_id);\n\treturn true;\n}", "function Validar(Cadena){\n var Fecha= new String(Cadena) // Crea un string\n var RealFecha= new Date() // Para sacar la fecha de hoy\n //Cadena A�o\n var Ano= new String(Fecha.substring(Fecha.lastIndexOf(\"-\")+1,Fecha.length))\n // Cadena Mes\n var Mes= new String(Fecha.substring(Fecha.indexOf(\"-\")+1,Fecha.lastIndexOf(\"-\")))\n // Cadena D�a\n var Dia= new String(Fecha.substring(0,Fecha.indexOf(\"-\")))\n\n // Valido el a�o\n if (isNaN(Ano) || Ano.length<4 || parseFloat(Ano)<1900 || Ano.length>4 || parseFloat(Ano)>2015){\n alert('Gestion invalida')\n return false\n }\n // Valido el Mes\n if (isNaN(Mes) || parseFloat(Mes)<1 || parseFloat(Mes)>12){\n alert('Mes invalido')\n return false\n }\n // Valido el Dia\n if (isNaN(Dia) || parseInt(Dia, 10)<1 || parseInt(Dia, 10)>31){\n alert('Dia invalido')\n return false\n }\n if (Mes==4 || Mes==6 || Mes==9 || Mes==11 || Mes==2) {\n if (Mes==2 && Dia > 28 || Dia>30) {\n alert('Dia invalido')\n return false\n }\n }\n}", "function verifierAge(age) {\n return (/^\\d{1,3}$/.test(age) &&\n parseInt(age) >= 0 &&\n parseInt(age) <= 130);\n}", "function leapYear() {\n rl.question('Enter the year to check leap or not',(year)=>{//user input.\n if(year>=0)\n return utility.leapYear(year);// calling of leapYear method.\n else\n {\n console.log(\"Please enter correct year\");\n rl.close();\n return false;\n }\n });\n}", "function validateDemographics(form) {\n\tvar zipVal = validateZip(form);\n\tif (!zipVal) {\n\t\treturn zipVal;\n\t}\n\tvar emailVal = validateEmail(form);\n\tif (!emailVal) {\n\t\tconsole.log(emailVal);\n\t\treturn emailVal;\n\t}\n\n\tvar age = document.getElementById(\"select_age\").value;\n\tif (age === \"SelectRange\") {\n\t\talert(\"You must enter your age.\");\n\t\treturn false;\n\t}\n}", "function checkForm(n){\n let filled = true;\n let fields;\n\n if(n == 0){\n fields = $(\".pd-item-required\").find(\"select, input\").serializeArray();\n\n let today = new Date();\n let birthDate = fields[3].value.split(\"-\");\n\n let year = birthDate[0];\n let month = birthDate[1] - 1;\n let day =birthDate[2];\n\n let age = today.getFullYear() - year;\n let m = today.getMonth() - month;\n let d = today.getDate() - day;\n if (m < 0 || (m === 0 && d < 0)) {\n --age;\n }\n if(age < 18){\n filled = false;\n $(\"#DOBOver\").css({'color':'red', 'font-weight':'bold'});\n $(\"#DOBOver\").html(\"Please make sure that you are over 18\");\n }\n\n }else {\n fields = $(\".ad-item-required\").find(\"select, input\").serializeArray();\n }\n\n for(let i = 0; i < fields.length; ++i){\n if(fields[i].value === ''){\n filled = false;\n }\n }\n\n let select = document.getElementById(\"gender\");\n if(!select.value){\n filled = false;\n }\n return filled;\n}", "function validFirstName() {\r\n\r\n var firstName = $firstName.val();\r\n\r\n if (firstName.length < 2 || firstName.length > 30) {\r\n $firstName.addClass('is-invalid');\r\n } else {\r\n $firstName.removeClass('is-invalid');\r\n }\r\n }", "function buildBirthDate(strid, strPaxNum)\n{\n\n\n // Set the optional parameter if needed\n if (strPaxNum === undefined ) \n { strPaxNum = ''; }\n\n //Expects form elements: selDOBMonth, selDOBDay, txtDOBYear to be present\n if( document.getElementById('selDOBMonth' + strPaxNum).value != '' && document.getElementById('selDOBDay' + strPaxNum).value != '' && document.getElementById('txtDOBYear' + strPaxNum).value.replace('Year','').replace('YEAR').replace('year') != '' )\n { //have full birthdate! \n //set element\n document.getElementById(strid).value = (document.getElementById('txtDOBYear' + strPaxNum).value + '-' + document.getElementById('selDOBMonth' + strPaxNum).value + '-' + document.getElementById('selDOBDay' + strPaxNum).value);\n }\n else\n {\n //don't have all fields to build full birthdate!\n document.getElementById(strid).value = '';\n }\n //alert( document.getElementById(strid).value);\n}", "function checkdate(input){\t \nvar validformat=/^\\d{2}\\/\\d{2}\\/\\d{4}$/ // Basic check for format validity\n\t var returnval= 0\n\t if (!validformat.test(input.value)){\n\t\t input.select();\n\t\t return -1;\n\t }\n\t else{ // Detailed check for valid date ranges\n\t var monthfield=input.value.split(\"/\")[0]\n\t var dayfield=input.value.split(\"/\")[1]\n\t var yearfield=input.value.split(\"/\")[2]\n\t var dayobj = new Date(yearfield, monthfield-1, dayfield)\n\t if ((dayobj.getMonth()+1!=monthfield)||(dayobj.getDate()!=dayfield)||(dayobj.getFullYear()!=yearfield))\n\t\t return -2\n\t \n\t return 0;\n}\n}" ]
[ "0.77816725", "0.76380193", "0.76249504", "0.75717264", "0.75243115", "0.7523997", "0.75046283", "0.7417215", "0.737609", "0.7364252", "0.73534983", "0.72722703", "0.7199765", "0.71627945", "0.7139314", "0.7089039", "0.70698863", "0.70568466", "0.70498794", "0.7047614", "0.7035813", "0.6869367", "0.6836052", "0.68284184", "0.6824229", "0.68024236", "0.67681444", "0.6751726", "0.6739614", "0.67378384", "0.67128474", "0.6709167", "0.6666118", "0.6652965", "0.6641632", "0.6601956", "0.6595044", "0.6585165", "0.6572771", "0.65650165", "0.65589154", "0.65092534", "0.6477536", "0.6458605", "0.64569575", "0.6455903", "0.6440554", "0.6419908", "0.6415412", "0.64118063", "0.64012754", "0.63982266", "0.6396458", "0.63936925", "0.6384004", "0.63747966", "0.63386446", "0.63168776", "0.63077253", "0.63016707", "0.6298932", "0.62862176", "0.6263176", "0.6254879", "0.62225074", "0.6219185", "0.6219036", "0.6218245", "0.62153053", "0.6212422", "0.62079996", "0.61932343", "0.6180079", "0.61792284", "0.61775386", "0.6168955", "0.6161663", "0.615684", "0.6155458", "0.61546123", "0.6144739", "0.6124791", "0.6124125", "0.61241174", "0.6123173", "0.6117127", "0.61139244", "0.6113856", "0.61132383", "0.6105697", "0.6103908", "0.6100423", "0.6084262", "0.6083401", "0.6076982", "0.6076964", "0.6068244", "0.6063696", "0.60625196", "0.60604084" ]
0.7294675
11
var backUrl = "";
function deal_number(){ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function back(){\n\twindow.history.back();\n}", "function back(){\r\n window.history.back();\r\n}", "function back () {\n\t\n\t window.history.back();\n\t \n}", "function goBack() {\r\n window.location = '/';\r\n}", "function previous(){\n\twindow.location.href = previousurl;\n}", "function goBack(){\n\twindow.history.back();\n}", "goBack() {\n history.push(\"/\");\n }", "function goBack() {\r\n\twindow.history.back();\r\n}", "back()\n {\n\n\n history.back();\n\n\n }", "function getback() {\n\tdocument.location.reload();\n}", "function goBack(){\n window.history.back();\n}", "function goBack() {\n window.history.back();\n} // nu merge, mai este si forward, merge inainte spre urmatorul url din history", "function back_beranda(url) {\n window.location.replace(url);\n}", "function goBack() {\r\n window.history.back();\r\n}", "function goBack() {\r\n window.history.back();\r\n}", "function noBack()\r\n{\r\nwindow.history.forward()\r\n}", "back() {\n window.history.back();\n }", "back() {\n window.history.back();\n }", "back() {\n window.history.back();\n }", "back() {\n window.history.back();\n }", "back() {\n window.history.back();\n }", "back() {\n window.history.back();\n }", "back() {\n window.history.back();\n }", "back() {\n window.history.back();\n }", "back() {\n window.history.back();\n }", "back() {\n window.history.back();\n }", "back() {\n window.history.back();\n }", "back() {\n window.history.back();\n }", "back() {\n window.history.back();\n }", "back() {\n window.history.back();\n }", "back() {\n window.history.back();\n }", "back() {\n window.history.back();\n }", "back() {\n window.history.back();\n }", "function goBack(){\n // *Navigating back:\n window.history.back();\n }", "function onGoBack() {\n // history.goBack();\n history.push(location?.state?.from ?? \"/\");\n }", "function onBack (e) {\n\t// get the previous URL\n chrome.runtime.sendMessage({method: 'get', key: 'currentUrl'}, function (response) {\n\t\t// update server of user's click, and send user back to previous page\n\t\tvar currentUrl = response.currentUrl;\n chrome.runtime.sendMessage({method: 'set', key: 'ignore', value: currentUrl});\n chrome.runtime.sendMessage({method: 'logAction', action: 'image_process_choice', data: 'back', hostname: new URL(currentUrl).hostname});\n\t\twindow.location.assign(currentUrl);\n\t});\n}", "function onBack() {\n resetPageState();\n }", "function goback() \n{\nhistory.go(-1);\n}", "function goBack() {\r\n window.history.go(-1)\r\n}", "function goBack() { // go back function\n history.go(-1);\n}", "function goBack() {\n window.history.back();\n}", "function goBack() {\n window.history.back();\n}", "function goBack() {\n window.history.back();\n}", "function goBack() {\n window.history.back();\n}", "function goBack() {\n window.history.back();\n}", "function goBack() {\n window.history.back();\n}", "function goBackCustomQuery() {\n // console.log(backUrl);\n $location.url(backUrl);\n}", "function atras() {\n history.back();\n}", "function goBack() {\n window.history.go(-1);\n}", "function goBack() {\n window.history.back();\n}", "function goBack() {\n window.history.back();\n}", "function newGoBack(url){\r\n\tgoFrame(url);\r\n}", "function OnBtnBack_Click( e )\r\n{\r\n Back() ;\r\n}", "function OnBtnBack_Click( e )\r\n{\r\n Back() ;\r\n}", "function OnBtnBack_Click( e )\r\n{\r\n Back() ;\r\n}", "function OnBtnBack_Click( e )\r\n{\r\n Back() ;\r\n}", "function OnBtnBack_Click( e )\r\n{\r\n Back() ;\r\n}", "function OnBtnBack_Click( e )\r\n{\r\n Back() ;\r\n}", "back(){\n viewport.replace( _history.pop(), _options.pop() );\n }", "function navigateOnePageBack() {\n window.history.back();\n}", "function GetBack() {\n location.reload(true);\n}", "function setBackButton(date){\n var backButton = document.getElementById(\"backButton\").href = \"/schedule/\" + date.slice(0, 8);\n}", "function goBack() {\n window.history.back();\n }", "function goBack() {\n window.history.back();\n }", "function goBack() {\n window.history.back();\n }", "goback() { this.back = true; }", "function previousPage()\r\n{\r\n\thistory.go(-1);\r\n}", "function goBack() {\n window.history.back();\n }", "function onBackKeyDown() {\n\t//alert(\"Back Pressed\");\n\tgo_back();\n}", "function navigationBack(breadCrumbBack){\n\t\n\tif(!breadCrumbBack){\n\t\tbreadCrumbBack=-1;\n\t} else if(breadCrumbBack>=0){\n\t\tbreadCrumbBack=breadCrumbBack*(-1);\n\t}\n\t\n\tvar currentUrl=document.location.href;\n\tvar questionMarkFound=currentUrl.indexOf(\"?\");\n\tif (questionMarkFound!=-1){\n\t\tcurrentUrl=currentUrl.substring(0, questionMarkFound);\n\t}\n\t\n\tcurrentUrl+=\"?breadCrumbBack=\"+breadCrumbBack;\n\t\n\tdocument.location.href=currentUrl;\t\n}", "function goBack() {\n window.location.href = \"index.html\";\n}", "function backStreamPage() {\n\n}", "function goBack() { $window.history.back(); }", "function onclick_back() {\n var url = baseURL + \"/app/site/hosting/scriptlet.nl?script=925&deploy=1\";\n window.location.href = url;\n}", "function setup(){\r\n document.getElementById('backButton').setAttribute('href', '/home/' + thisUser.id);\r\n\r\n}", "backBtnHref(){\n switch(this.props.match.params.id){\n case 'activity':\n return '/'\n case 'address':\n return '/activity';\n case 'confirm':\n return 'address';\n default:\n return false;\n }\n }", "function goBack(){\n window.location.replace(\"./index.html\");\n}", "function backHome() {\n window.location.href = `https://amdevito.github.io/211/MidTermProposal/`;\n}", "function notGoBack(){\n history.pushState(null, null, location.href);\n window.onpopstate = function () {\n history.go(1);\n };\n}", "function goBack() {\n window.location.reload();\n }", "function lastPage(){\n history.back();\n}", "function OnAndroidBackButton_Click( e )\r\n{\r\n Back() ;\r\n}", "_onBack () { \n this.props.navigator.pop();\n }", "function back(){\r\n window.location.href = \"../html/index.html\";\r\n }", "back() {\n let query = {};\n const url = url_1.parse(this.getReferrerUrl());\n /**\n * Parse query string from the referrer url\n */\n if (this.forwardQueryString) {\n query = qs_1.default.parse(url.query || '');\n }\n /**\n * Append custom query string\n */\n Object.assign(query, this.queryString);\n /**\n * Redirect\n */\n this.sendResponse(url.pathname || '', query);\n }", "_onBack () {\n this.props.navigator.pop();\n }", "goBack() {\n history.back();\n window.scroll(0,0);\n }", "function onback (fn) {\n window.addEventListener('popstate', function (event) {\n fn(event, fmt(document.location))\n })\n}", "function onBackKeyDown() {\n goBack();\n}", "function goBack() {\n $location.url('/course/professor' + '/' + vm.userInfo.userid + \"/\" + vm.semesterId);\n }", "function storePageForBackButton(json){\n var newUrl = location.pathname + buildQueryString({\n mpage: json.page,\n });\n history.replaceState({}, \"\", newUrl);\n }", "function goBack() {\n\t\t\t$window.history.back();\n\t\t}", "function onBackKeyDown() {\n window.location.href = \"index.html\";\n}", "function twiceBack(){\n window.history.back().back();\n}", "back () {\n // realization in Class\n }", "goBack() {\n this.props.history.push(\"/home/subscription\")\n }", "function backButton(){\r\n\tif(count == 0){ \r\n\t\twindow.open('index.html','_self'); \r\n\t}else{\r\n\t\tgoToLastQuestion(); \r\n\t}\r\n}", "function onBackKeyDown() {\r\n}", "function backBtn() {\r\n window.location.reload()\r\n}", "function returnBack() {\n window.history.back()\n}", "function goBack() {\n history.go(-1);\n location.reload();\n}" ]
[ "0.7229205", "0.7160019", "0.71343106", "0.71336424", "0.70909697", "0.70630014", "0.7039348", "0.6987162", "0.69503915", "0.6938129", "0.6937925", "0.6920891", "0.6906681", "0.68984747", "0.6896229", "0.6882824", "0.68809587", "0.68809587", "0.68809587", "0.68809587", "0.68809587", "0.68809587", "0.68809587", "0.68809587", "0.68809587", "0.68809587", "0.68809587", "0.68809587", "0.68809587", "0.68809587", "0.68809587", "0.68809587", "0.68809587", "0.6880897", "0.68757737", "0.6869837", "0.6867422", "0.6862895", "0.68423516", "0.68267083", "0.68208724", "0.68208724", "0.68208724", "0.68208724", "0.68208724", "0.68208724", "0.68178743", "0.67845577", "0.6777612", "0.6774527", "0.6774527", "0.67713815", "0.6764729", "0.6764729", "0.6764729", "0.6764729", "0.6764729", "0.6764729", "0.6763912", "0.67095906", "0.67041487", "0.6702312", "0.6669218", "0.6669218", "0.6669218", "0.66688514", "0.66646624", "0.6661149", "0.6652302", "0.66514415", "0.6645821", "0.6622646", "0.66209954", "0.66168416", "0.6582038", "0.6578492", "0.65754026", "0.65685207", "0.6565253", "0.6553311", "0.6538668", "0.65356255", "0.65313715", "0.6519788", "0.6517563", "0.6511385", "0.64998025", "0.64951444", "0.6482563", "0.6472652", "0.64492196", "0.6448772", "0.6442508", "0.6433093", "0.6425316", "0.64130604", "0.64092535", "0.6401803", "0.6398048", "0.63976467", "0.6391916" ]
0.0
-1
> FIN de todo con respecto a CLIENTES
function load_cliente(page) { var FiltroCliente = $("#FiltroCliente").val(); var parametros = {"accion":"cargar","page":page,"FiltroCliente":FiltroCliente}; //$("#loader").fadeIn('slow'); $.ajax({ url:'../listas/listar_cliente_paginado.php', data: parametros, beforeSend: function(objeto) { //$("#loader").html("<img src='loader.gif'>"); }, success:function(data) { $(".outer_div").html(data).fadeIn('slow'); //$("#loader").html(""); } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function principal() {\n choquecuerpo();\n choquepared();\n dibujar();\n movimiento();\n \n if(cabeza.choque (comida)){\n comida.colocar();\n cabeza.meter();\n } \n}", "function escreveConteudo(){}", "function desbloquearCamposHU(){\n\t\tif(tieneRol(\"cliente\")){//nombre, identificador, prioridad, descripcion y observaciones puede modificar, el boton crear esta activo para el\n\t\t\n\t\t}\n\t\tif(tieneRol(\"programadror\")){// modificar:estimacion de tiempo y unidad dependencia responsables, todos los botones botones \n\t\t\n\t\t}\n\t}", "function carregaOpcoesUnidadeSuporte(){\n\tcarregaTipoGerencia();\t\n\tcarregaTecnicos();\n\tcarregaUnidadesSolicitantes();\t\n\tcarregaEdicaoTipos();//no arquivo tipoSubtipo.js\n\tcarregaComboTipo();//no arquivo tipoSubtipo.js\n}", "function IndicadorRangoEdad () {}", "function comportement (){\n\t }", "function iniciar() {\n \n }", "function inhabilitarOpcionYmostrar(){\n\n let cuadrados = document.querySelectorAll(\"div.fila-buscaminas div.cuadrado\");\n\n cuadrados.forEach( c => {\n c.removeEventListener(\"click\",Juego.buscarMina)\n c.classList.remove(\"sin-descubrir\");\n });\n\n}", "procesarControles(){\n\n }", "function aplicarDescuento(){\n if (numeroDeClases >= 12) {\n console.log(\"El total a abonar con su descuento es de \" + (totalClase - montoDescontar));\n } else if (numeroDeClases <= 11) {\n console.log(\"Aún NO aplica el descuento, el valor total a abonar es de \" + totalClase);\n }\n }", "function limpiarCapas(){\n limpiarCapaRecorridos();\n limpiarCapaParadas();\n limpiarCapaNuevaRuta();\n limpiarCapturaNuevaRuta();\n limpiarCapaEstudiantes();\n}", "function inicia(){\n controlVisualizacion.iniciaControlVisualizacion();\n controlVisualizacion.creaHTMLGeneral(); \n controlVisualizacion.iniciaElementosDOM();\n\n //iniciamos con la escena 1\n controlVisualizacion.comenzamos();\n}", "function inicia(){\n controlVisualizacion.iniciaControlVisualizacion();\n controlVisualizacion.creaHTMLGeneral(); \n controlVisualizacion.iniciaElementosDOM();\n\n //iniciamos con la escena 1\n controlVisualizacion.comenzamos();\n}", "resumen_estado_nave(){\n this.ajuste_potencia();\n if (typeof this._potencia_disponible !== \"undefined\"){\n if (this._potencia_disponible){\n let estado_plasma = \"\";\n for (let i = 0; i < this._injectores.length; i++) {\n estado_plasma += \"Plasma \"+i.toString()+\": \";\n let total = this._injectores[i].get_plasma+this._injectores[i].get_extra_plasma;\n estado_plasma += total+\"mg/s \";\n }\n console.log(estado_plasma);\n\n for (let i = 0; i < this._injectores.length; i++) {\n if (this._injectores[i].get_danio_por<100){\n if (this._injectores[i].get_extra_plasma>0){\n console.log(\"Tiempo de vida: \"+this._injectores[i].tiempo_vuelo().toString()+\" minutos.\");\n } else {\n console.log(\"Tiempo de vida infinito!\");\n break;\n }\n }\n }\n } else {\n console.log(\"Unable to comply.\")\n console.log(\"Tiempo de vida 0 minutos.\")\n }\n } else {\n throw \"_potencia_disponible: NO DEFINIDA\";\n }\n }", "function limpiarControles(){ //REVISAR BIEN ESTO\n clearControls(obtenerInputsIdsProducto());\n clearControls(obtenerInputsIdsTransaccion());\n htmlValue('inputEditar', 'CREACION');\n htmlDisable('txtCodigo', false);\n htmlDisable('btnAgregarNuevo', true);\n}", "function pararDibujar() {\n pintarLinea = false;\n guardarLinea();\n }", "function pararDibujar() {\n pintarLinea = false;\n guardarLinea();\n }", "static queEres() {\n console.log(`esto es un metodo estatico`);\n }", "function inicializarConversacionDiana(){\nprint(\"Inicializa la conversacion\");\nconversacionDiana = new ArbolConversacion(texturaCristina,texturaDiana,texturaCristinaSombreada,texturaDianaSombreada);\n\n/**\n* Nodo Raiz\n* \n*/\nvar dialogos : Array = new Array();\nvar l: LineaDialogo = new LineaDialogo(\"Tal vez usted me entienda, Diana, hay seres que nos vienen acompañando desde que se iniciaron los ataques y ahora sé qué es lo que necesitan, me lo han dicho.\",1);\ndialogos.Push(l);\nl = new LineaDialogo(\"Chica, voy a ser muy sincera contigo, tú no estás bien. Ese brazo necesita curaciones y la falta de droga te puede estar afectando la mente, es preciso que entres en tratamiento inmediatamente, y eso no lo conseguirás aquí adentro.\",2);\ndialogos.Push(l);\nl = new LineaDialogo(\"Nunca me he sentido mejor, lo del brazo no es tan grave y jamás he estado tan lúcida. De verdad Diana, hay seres que nos necesitan, usted podría ayudarlos mucho, no con curaciones, sino con otro tipo de cuidados.\",1);\ndialogos.Push(l);\nl = new LineaDialogo(\"Bueno, si te sientes tan bien ¿Por qué no subes a auxiliar la gente que está atrapada arriba? Seguro que serás de gran ayuda.\",2);\ndialogos.Push(l);\n \nvar nodoRaiz:NodoDialogo = new NodoDialogo(dialogos);\n\nconversacionDiana.setRaiz(nodoRaiz);\n\n/**\n* Nodo Opcion 1\n* \n**/\ndialogos = new Array();\nl = new LineaDialogo(\"Por favor Diana, es verdad lo que le digo, sé que no es fácil entenderlo,\\n pero si me acompaña lo entenderá.\",1);\ndialogos.Push(l);\nl = new LineaDialogo(\"No, he decidido bajar con el anciano y con Fabio. Abajo podemos conseguir ayuda profesional y tú deberías acompañarnos.\",2);\ndialogos.Push(l);\n\nvar nodo1: NodoDialogo = new NodoDialogo(dialogos, NEGACION );\n\nnodoRaiz.setHijo1(nodo1);\n\n\n\n/**\n* Nodo Opcion 2\n* \n*/\n\ndialogos = new Array();\nl = new LineaDialogo(\"Son seres que después compensarán nuestra ayuda, de verdad Diana,\\n son más importantes que los de arriba, son los otros.\",1);\ndialogos.Push(l);\nl = new LineaDialogo(\"No, he decidido subir con el doctor y con el muchacho a auxiliar a los oficinistas de arriba, Tú serías de gran ayuda, acompáñanos.\",2);\ndialogos.Push(l);\n\nvar nodo2: NodoDialogo = new NodoDialogo(dialogos);\n\nnodoRaiz.setHijo2(nodo2);\n}", "reiniciarConteo() {\n this.ultimo = 0;\n this.tickets = [];\n this.grabarArchivo();\n this.ultimos4 = []\n console.log('Se ha inicializado el sistema');\n \n }", "function fnc_child_cargar_valores_iniciales() {\n\n}", "function mostraNotas(){}", "function escolta () {\r\n text = this.ant;\r\n if(this.validate) {\r\n \tthis.capa.innerHTML=\"\";\r\n index = cerca (this.paraules, text); \r\n if (index == -1) {\r\n this.capa.innerHTML=this.putCursor(\"black\");\r\n }\r\n else {\r\n this.putImg (this.dirImg+\"/\"+this.paraules[index].imatge);\r\n this.capa.innerHTML += \"<br>\" + this.paraules[index].paraula;\r\n this.putSound (this.paraules[index].so);\r\n }\r\n }\r\n \r\n\r\n}", "function MetodoCruzamento(){\n //Nivel+1 para sabermos que não são os pais, e um o fruto de um cruzamento do nivel 1.\n\tNivel++;\n\tswitch(MetodoCruzamen){\n\t\tcase 1:\n\t\t\tKillError(\"-s [1:Não definido,2]\");\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tconsole.log(\"Cruzamento em andamento!\");\n\t\t\tconsole.log(\"- Crossover PMX\");\n\t\t\tconsole.log(\"- - Geração: \"+Geracao);\n\t\t\tif(Torneio==1){\n\t\t\t\tconsole.log(\"- - - Torneio\");\n\t\t\t}else{\n\t\t\t\tconsole.log(\"- - - Roleta\");\n\t\t\t}\n\t\t\twhile(Geracao>=0){\n\t\t\t\tCrossover_PMX();\n\t\t\t\tGeracao=Geracao-1;\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tKillError(\"-s [1,2]\");\n\t}\n\tQualidadeCheck();\n}", "function fBuscarEjsPE() {\n hideEverythingBut(\"#ejerciciosBusquedaPE\");\n //la limpieza de búsquedas se hará al terminar sesión, de modo que al volver a la búsqueda, se podrá ver la última búsqueda realiza y sus resultados\n}", "function etapa3() {\n countListaNomeCrianca = 0; //count de quantas vezes passou na lista de crianças\n\n //recebendo H3 e setando nela o texto com o nome do cliente\n var tituloDaEtapa = document.querySelector(\"#tituloDaEtapa\");\n tituloDaEtapa.textContent = \"3º Etapa - Colaborador\";\n\n document.getElementById('selecionarFuncionarios').style.display = ''; //habilita a etapa 3\n document.getElementById('selecionarAniversariantes').style.display = 'none'; //desabilita a etapa 2\n \n //seta a quantidade de criança que foi definida no input de controle \"qtdCrianca\"\n document.getElementById('qtdCrianca').value = quantidadeCrianca2;\n \n //percorre a lista de nomes das crianças e monta o texto de confirmação para as crianças\n var tamanhoListaNomeCrianca = listaNomeCrianca.length; //recebe o tamanho da lista em uma variavel\n\n listaNomeCrianca.forEach((valorAtualLista) => {\n if(countListaNomeCrianca == 0){\n textoConfirmacaoCrianca = \"Aniversariantes: \";\n }\n countListaNomeCrianca++;\n \n if(countListaNomeCrianca == tamanhoListaNomeCrianca){\n textoConfirmacaoCrianca = textoConfirmacaoCrianca + valorAtualLista;\n }else{\n textoConfirmacaoCrianca = textoConfirmacaoCrianca + valorAtualLista + \" / \";\n }\n \n }); \n countListaNomeCrianca = 0;\n \n if(tamanhoListaNomeCrianca == 0){\n textoConfirmacaoCrianca = \"Evento não possui aniversariante.\";\n }\n \n //seta o texto informação da crianças na ultima etapa\n var confirmacaoInfCrianca = document.querySelector(\"#criancasInf\");\n confirmacaoInfCrianca.textContent = textoConfirmacaoCrianca; \n \n }", "function desclickear(e){\n movible = false;\n figura = null;\n}", "function connexionPanierControl(){\n\tconsole.log('tata');\n\tcliendGood();\n\tmdpControl();\n\temailControl();\n}", "function limpiarCapaRecorridos(){\n lienzoRecorridos.destroyFeatures();\n removerMarcas();\n}", "efficacitePompes(){\n\n }", "function finalizarCompra(){\n rl.question(\"Deseja finalizar a compra?\\n 1- Sim\\n 2- Não\\n\", (opcao) => {\n if(opcao === \"1\"){\n console.log(chalk.yellow(`Yeeew! Sua compra foi finalizada! Obrigada pela preferência! ${emoji.get('heart')} \\nVolta sempre tá? Estaremos aqui para você!\\n`));\n rl.close();\n }else{\n console.log(`Tudo bem. Obrigada por procurar nossos produtos. Te vejo na próxima! ${emoji.get('heart')}`)\n rl.close(); \n }\n })\n}", "nuevoCiclo() {\n let suma = 0;\n for (let i = 0; i < this.vecinos.length; i++) {\n if (this.vecinos[i].estado === 1) {\n suma++;\n }\n }\n\n // Aplicamos las normas\n this.estadoProx = this.estado; // Por defecto queda igual\n\n // Vida: tiene 3 vecinos\n if (this.estado === 0 && suma === 3) {\n this.estadoProx = 1;\n }\n\n // Muerte: menos de 2(soledad) o mas de 3 (inanicion)\n if (this.estado == 1 && (suma < 2 || suma > 3)) {\n this.estadoProx = 0;\n }\n }", "function menuBuscar() {\n let opcion = \"\";\n while (opcion !== 1 && opcion !== 2 && opcion !== 3 && opcion !== 4 && opcion !== 5) {\n opcion = rl.question('Introduce la accion a realizar:\\n' +\n '1) Buscar autor\\n' +\n '2) Buscar todo por año de publicación\\n' +\n '3) Buscar por tipo de publicación\\n' +\n '4) Buscar por autor, año de publicación y tipo de publicación\\n' +\n '5) Volver\\n');\n\n if (opcion === '1') {\n buscarAutor();\n }\n else if (opcion === '2') {\n buscarAnyoPubli();\n }\n else if (opcion === '3') {\n buscarTipoPubli();\n }\n else if (opcion === '4') {\n buscarAutorAnyioPubliTipo();\n }\n else if (opcion === '5') {\n return;\n }\n }\n}", "function trocarCliente() {\n\n //seta como vazio os atributos do cliente seleciado\n idCliente = 0;\n nomeCliente = \"\";\n\n //apaga o input criado na \"function selecionarCliente\"\n document.getElementById('idCliente').remove();\n \n document.getElementById('listagemDeCliente').style.display = ''; //habilita a tabela de listagem do cliente\n document.getElementById('confirmacaoCliente').style.display = 'none'; //desabilita a confirmação da etapa 1\n document.getElementById('confirmacaoCliente').style.display = 'none'; //desabilita a confirmação da etapa 1\n\n //como está trocando de cliente , as crianças serão outras , então limpa tudo que é relacionado as crianças (etapa2)\n if(countEtapa2 !== 0){\n document.getElementById(\"tbodyAniversariantes\").innerHTML=\"\";\n document.getElementById('tabelaAniversariante').style.display = 'none'; //desabilita a tabela de listagem de criança\n countEtapa2 = 0;\n } \n \n //apaga os inputs das crianças caso tiver\n for(var i = 0; i < quantidadeCrianca2; i++){\n var existeInputCrianca = document.getElementById('idCrianca'+(i+1)); \n if(existeInputCrianca !== null){\n document.getElementById('idCrianca'+(i+1)).remove(); \n }\n \n }\n \n //limpando/zerando as variaveis relacionadas a criança\n quantidadeCrianca = 0;\n quantidadeCriancaBotaoRemover = 0;\n quantidadeCrianca2 = 0;\n textoConfirmacaoCrianca = \"\";\n listaNomeCrianca = [];\n possuiCrianca = 0;\n }", "function empezarDibujo() {\n pintarLinea = true;\n lineas.push([]);\n }", "function escoltaPregunta ()\r\n{\r\n if(this.validate) {\r\n this.capa.innerHTML=\"\";\r\n this.putImg (this.dirImg+\"/\"+this.paraules[index].imatge);\r\n this.capa.innerHTML+=\"<br>\"+this.paraules[index].paraula.toUpperCase();\r\n this.putSound (this.paraules[index].so);\r\n }\r\n else {\r\n this.capa.innerHTML = \"\"\r\n this.putImg (this.dirImg+\"/\"+this.paraules[index].imatge);\r\n this.putSound (this.paraules[index].so);\r\n this.capa.innerHTML += \"<br>\" + this.actual+this.putCursor ('black');\r\n }\r\n}", "function mostrarServicios(){\n\n //llenado de la tabla\n cajas_hoy();\n cajas_ayer() ;\n}", "function mostrarPlantearEje(){ // Cuando toque el boton \"plantear ejercicios\" voy a ver la seccion (plantear tarea a alumnos)\r\n limpiar(); //limpio campos de texto y mensajes al usuario\r\n document.querySelector(\"#divDevoluciones\").style.display = \"none\"; // oculto redactar devoluciones a tareas\r\n document.querySelector(\"#homeDocente\").style.display = \"block\"; //Habilito division docente\r\n document.querySelector(\"#bodyHome\").style.display = \"none\"; //Oculto body bienvenida\r\n document.querySelector(\"#divAsignarNivel\").style.display = \"none\"; // oculto plantear ejercicios a alumnos\r\n document.querySelector(\"#divPlantearEje\").style.display = \"block\"; // muestro plantear tarea\r\n document.querySelector(\"#divEntregas\").style.display = \"none\"; // oculto redactar devoluciones a tareas\r\n document.querySelector(\"#divEstadisticas\").style.display = \"none\"; // oculto visualizar estadisticas\r\n}", "function empezarDibujo() {\n pintarLinea = true;\n lineas.push([]);\n }", "function asociarCursosCarrera() {\n let codigoCarrera = guardarCarreraAsociar();\n\n let carrera = buscarCarreraPorCodigo(codigoCarrera);\n\n let cursosSeleccionados = guardarCursosAsociar();\n\n\n\n let listaCarrera = [];\n\n let sCodigo = carrera[0];\n let sNombreCarrera = carrera[1];\n let sGradoAcademico = carrera[2];\n let nCreditos = carrera[3];\n let sVersion = carrera[4];\n let bAcreditacion = carrera[5]\n let bEstado = carrera[6];\n let cursosAsociados = cursosSeleccionados;\n let sedesAsociadas = carrera[8];\n\n if (cursosAsociados.length == 0) {\n swal({\n title: \"Asociación inválida\",\n text: \"No se le asignó ningun curso a la carrera.\",\n buttons: {\n confirm: \"Aceptar\",\n },\n });\n } else {\n listaCarrera.push(sCodigo, sNombreCarrera, sGradoAcademico, nCreditos, sVersion, bAcreditacion, bEstado, cursosAsociados, sedesAsociadas);\n actualizarCarrera(listaCarrera);\n\n swal({\n title: \"Asociación registrada\",\n text: \"Se le asignaron cursos a la carrera exitosamente.\",\n buttons: {\n confirm: \"Aceptar\",\n },\n });\n limpiarCheckbox();\n }\n}", "function mostrarDevoluciones(){ // Cuando toque el boton \"devoluciones\" voy a ver la seccion (hacer devoluciones)\r\n limpiar(); //limpio campos de texto y mensajes al usuario\r\n document.querySelector(\"#homeDocente\").style.display = \"block\"; // habilito division docente\r\n document.querySelector(\"#bodyHome\").style.display = \"none\"; // oculto body bienvenida\r\n document.querySelector(\"#divAsignarNivel\").style.display = \"none\"; // oculto plantear ejercicios a alumnos\r\n document.querySelector(\"#divPlantearEje\").style.display = \"none\"; // oculto plantear tarea\r\n document.querySelector(\"#divEntregas\").style.display = \"none\"; // oculto tabla\r\n document.querySelector(\"#divDevoluciones\").style.display = \"block\"; // muestro redactar devoluciones a tareas\r\n document.querySelector(\"#divEstadisticas\").style.display = \"none\"; // oculto visualizar estadisticas\r\n}", "function renderizaMunicoes(){\n\tmunicoes.forEach(desenhaMunicao);\n\tmunicoesAndam();\n}", "function ClickGerarAleatorioComum() {\n GeraAleatorioComum();\n AtualizaGeral();\n}", "recorrerArbolConsulta(nodo) {\n //NODO INICIO \n if (this.tipoNodo('INICIO', nodo)) {\n this.recorrerArbolConsulta(nodo.hijos[0]);\n }\n //NODO L, ES LA LISTA DE CONSULTAS \n if (this.tipoNodo('L', nodo)) {\n //SE RECORREN TODOS LOS NODOS QUE REPRESENTAN UNA CONSULTA \n for (var i = 0; i < nodo.hijos.length; i++) {\n this.recorrerArbolConsulta(nodo.hijos[i]);\n this.reiniciar();\n // this.codigoTemporal += \"xxxxxxxxxxxxxxxxxxxx-\"+this.contadorConsola+\".\"+\"\\n\";\n }\n }\n //PARA RECORRER TODOS LOS ELEMENTOS QUE COMPONEN LA CONSULTA \n if (this.tipoNodo('CONSULTA', nodo)) {\n for (var i = 0; i < nodo.hijos.length; i++) {\n this.pathCompleto = false;\n this.controladorAtributoImpresion = false;\n this.controladorDobleSimple = false;\n this.controladorPredicado = false;\n this.recorrerArbolConsulta(nodo.hijos[i]);\n }\n }\n //PARA RECORRER TODOS LOS ELEMENTOS QUE COMPONEN LA CONSULTA \n if (this.tipoNodo('VAL', nodo)) {\n for (var i = 0; i < nodo.hijos.length; i++) {\n this.pathCompleto = false;\n this.controladorAtributoImpresion = false;\n this.controladorDobleSimple = false;\n this.controladorPredicado = false;\n this.recorrerArbolConsulta(nodo.hijos[i]);\n }\n }\n //PARA VERIFICAR EL TIPO DE ACCESO, EN ESTE CASO // \n if (this.tipoNodo('DOBLE', nodo)) {\n this.controladorDobleSimple = true;\n this.recorrerArbolConsulta(nodo.hijos[0]);\n }\n //PARA VERIFICAR EL TIPO DE ACCESO, EN ESTE CASO: /\n if (this.tipoNodo('SIMPLE', nodo)) {\n //Establecemos que se tiene un acceso de tipo DOBLE BARRA \n this.controladorDobleSimple = false;\n this.recorrerArbolConsulta(nodo.hijos[0]);\n }\n //PARA VERIFICAR SI EL ELEMENTO A BUSCAR ES UN IDENTIFICADOR \n if (this.tipoNodo('identificador', nodo)) {\n const str = nodo.hijos[0];\n this.busquedaElemento(str);\n }\n //PARA VERIFICAR SI LO QUE SE VA A ANALIZAR ES UN PREDICADO \n if (this.tipoNodo('PREDICADO', nodo)) {\n this.controladorPredicado = true;\n const identificadorPredicado = nodo.hijos[0];\n //Primero se procede a la búsqueda del predicado\n this.codigoTemporal += \"//Inicio ejecucion predicado\\n\";\n this.busquedaElemento(identificadorPredicado);\n //Seguidamente se resuelve la expresión\n let resultadoExpresion = this.resolverExpresion(nodo.hijos[1]);\n let anteriorPredicado = this.temporalGlobal.retornarString();\n this.temporalGlobal.aumentar();\n this.codigoTemporal += this.temporalGlobal.retornarString() + \"=\" + anteriorPredicado + \";\\n\";\n let predicadoVariable = this.temporalGlobal.retornarString();\n this.codigoTemporal += \"PXP = \" + predicadoVariable + \";\\n\";\n this.codigoTemporal += \"ubicarPredicado();\\n\";\n //SI EL RESULTADO ES DE TIPO ETIQUETA\n if (resultadoExpresion.tipo == 4) {\n let datos = resultadoExpresion.valor;\n let a = datos[0];\n let b = datos[1];\n let c = datos[2];\n let limite = this.consolaSalidaXPATH.length;\n for (var i = this.contadorConsola; i < limite; i++) {\n // salidaXPATH.getInstance().push(this.consolaSalidaXPATH[i].dameID());\n this.auxiliarPredicado(a, b, c, this.consolaSalidaXPATH[i]);\n }\n }\n //SI EL RESULTADO ES DE TIPO ETIQUETA\n if (resultadoExpresion.tipo == 1) {\n this.consolaSalidaXPATH.push(this.consolaSalidaXPATH[(this.contadorConsola + resultadoExpresion.valor) - 1]);\n this.contadorConsola = this.consolaSalidaXPATH.length - 1;\n }\n this.controladorPredicadoInicio = false;\n }\n //PARA VERIFICAR QUE ES UN PREDICADO DE UN ATRIBUTO\n if (this.tipoNodo('PREDICADO_A', nodo)) {\n //return this.recorrer(nodo.hijos[0]);\n const identificadorPredicadoAtributo = nodo.hijos[0];\n //RECORREMOS LO QUE VA DENTRO DE LLAVES PARA OBTENER EL VALOR\n //AQUI VA EL METODO RESOLVER EXPRESION DE SEBAS PUTO \n return this.recorrerArbolConsulta(nodo.hijos[1]);\n }\n //PARA VERIFICAR SI EL ELEMENTO A BUSCAR ES UN ATRIBUTO \n if (this.tipoNodo('atributo', nodo)) {\n this.controladorAtributoImpresion = true;\n const identificadorAtributo = nodo.hijos[0];\n if (this.inicioRaiz) {\n let limite = this.consolaSalidaXPATH.length;\n for (var i = this.contadorConsola; i < limite; i++) {\n let x = this.consolaSalidaXPATH[i];\n //let nodoBuscarAtributo = this.consolaSalidaXPATH[this.consolaSalidaXPATH.length - 1];\n let nodoBuscarAtributo = x;\n //CODIGO DE 3 DIRECCIONES \n this.codigoTemporal += \"P=\" + nodoBuscarAtributo.posicion + \";\\n\";\n let inicioRaizXML = this.temporalGlobal.retornarString();\n this.temporalGlobal.aumentar();\n //Ubicamos nuestra variabel a buscar en el principio del heap \n this.codigoTemporal += this.temporalGlobal.retornarString() + \"=HXP;\\n\";\n //Escribimos dentro del heap de XPATH el nombre del identificador a buscar \n for (var z = 0; z < identificadorAtributo.length; z++) {\n this.codigoTemporal += `heapXPATH[(int)HXP] = ${identificadorAtributo.charCodeAt(z)};\\n`;\n this.codigoTemporal += `HXP = HXP+1;\\n`;\n }\n this.codigoTemporal += `heapXPATH[(int)HXP] =-1;\\n`;\n this.codigoTemporal += `HXP = HXP+1;\\n`;\n let anteriorGlobal = this.temporalGlobal.retornarString();\n this.codigoTemporal += \"stackXPATH[(int)PXP]=\" + anteriorGlobal + \";\\n\";\n this.temporalGlobal.aumentar();\n this.codigoTemporal += \"busquedaAtributo();\\n\";\n //CODIGO DE 3 DIRECCIONES \n //Se procede a la búsqueda de los atributos en todos los nodos\n for (let entry of nodoBuscarAtributo.atributos) {\n let atributoTemporal = entry;\n let nombreAbributo = atributoTemporal.dameNombre();\n if (nombreAbributo == identificadorAtributo) {\n this.atributoID = identificadorAtributo;\n this.pathCompleto = true;\n // this.contadorConsola = i;\n // this.consolaSalidaXPATH.push(nodoBuscarAtributo);\n }\n }\n /*for (let entry of nodoBuscarAtributo.hijos) {\n this.busquedaAtributo(entry, identificadorAtributo);\n }*/\n if (this.controladorDobleSimple) {\n this.busquedaAtributo(x, identificadorAtributo);\n }\n }\n }\n else {\n this.inicioRaiz = true;\n for (let entry of this.ArrayEtiquetas) {\n let temp = entry;\n //CODIGO DE 3 DIRECCIONES \n this.codigoTemporal += \"P=\" + temp.posicion + \";\\n\";\n let inicioRaizXML = this.temporalGlobal.retornarString();\n this.temporalGlobal.aumentar();\n //Ubicamos nuestra variabel a buscar en el principio del heap \n this.codigoTemporal += this.temporalGlobal.retornarString() + \"=HXP;\\n\";\n //Escribimos dentro del heap de XPATH el nombre del identificador a buscar \n for (var z = 0; z < identificadorAtributo.length; z++) {\n this.codigoTemporal += `heapXPATH[(int)HXP] = ${identificadorAtributo.charCodeAt(z)};\\n`;\n this.codigoTemporal += `HXP = HXP+1;\\n`;\n }\n this.codigoTemporal += `heapXPATH[(int)HXP] =-1;\\n`;\n this.codigoTemporal += `HXP = HXP+1;\\n`;\n let anteriorGlobal = this.temporalGlobal.retornarString();\n this.codigoTemporal += \"stackXPATH[(int)PXP]=\" + anteriorGlobal + \";\\n\";\n this.temporalGlobal.aumentar();\n this.codigoTemporal += \"busquedaAtributo();\\n\";\n //CODIGO DE 3 DIRECCIONES \n for (let entry2 of temp.atributos) {\n let aTemp = entry2;\n let nameAtt = aTemp.dameNombre();\n if (nameAtt == identificadorAtributo) {\n this.atributoID = identificadorAtributo;\n this.pathCompleto = true;\n }\n }\n if (this.controladorDobleSimple) {\n this.busquedaAtributo(entry, identificadorAtributo);\n }\n }\n }\n }\n //PARA VERIFICAR SI EL ELEMENTO A BUSCAR ES CUALQUIER ELEMENTO \n if (this.tipoNodo('any', nodo)) {\n //SIGNIFICA ACCESO DOBLE\n if (this.controladorDobleSimple) {\n let controladorNuevoInicio = -1;\n let limite = this.consolaSalidaXPATH.length;\n for (var i = this.contadorConsola; i < limite; i++) {\n let temporal = this.consolaSalidaXPATH[i];\n for (let entry of temporal.hijos) {\n //insertamos TODOS los hijos\n this.codigoTemporal += \"P =\" + entry.posicion + \";\\n\";\n this.codigoTemporal += \"imprimirContenido();\\n\";\n this.consolaSalidaXPATH.push(entry);\n if (controladorNuevoInicio == -1)\n controladorNuevoInicio = this.consolaSalidaXPATH.length - 1;\n this.complementoAnyElement(entry);\n }\n }\n this.contadorConsola = controladorNuevoInicio;\n this.pathCompleto = true;\n }\n //SIGNIFICA ACCESO SIMPLE \n else {\n //Controlamos el nuevo acceso para cuando coloquemos un nuevo elemento en la lista \n let controladorNuevoInicio = -1;\n let limite = this.consolaSalidaXPATH.length;\n for (var i = this.contadorConsola; i < limite; i++) {\n let temporal = this.consolaSalidaXPATH[i];\n for (let entry of temporal.hijos) {\n //insertamos TODOS los hijos\n this.consolaSalidaXPATH.push(entry);\n if (controladorNuevoInicio == -1)\n controladorNuevoInicio = this.consolaSalidaXPATH.length - 1;\n }\n }\n this.contadorConsola = controladorNuevoInicio;\n this.pathCompleto = true;\n }\n }\n //PARA VERIFICAR SI EL ELEMENTO A BUSCAR ES UNA PALABRA RESERVADA que simplicaria un AXE \n if (this.tipoNodo('reservada', nodo)) {\n //return this.recorrer(nodo.hijos[0]);\n const identificador = nodo.hijos[0];\n this.auxiliarAxe = identificador;\n //VERIFICAMOS EL TIPO DE ACCESO DE AXE \n if (this.controladorDobleSimple)\n this.dobleSimpleAxe = true;\n }\n if (this.tipoNodo('AXE', nodo)) {\n //return this.recorrer(nodo.hijos[0]);\n if (this.dobleSimpleAxe)\n this.controladorDobleSimple = true;\n this.temporalGlobal.aumentar();\n //Ubicamos nuestra variabel a buscar en el principio del heap \n this.codigoTemporal += this.temporalGlobal.retornarString() + \"=HXP;\\n\";\n //Escribimos dentro del heap de XPATH el nombre del identificador a buscar \n for (var i = 0; i < this.auxiliarAxe.length; i++) {\n this.codigoTemporal += `heapXPATH[(int)HXP] = ${this.auxiliarAxe.charCodeAt(i)};\\n`;\n this.codigoTemporal += `HXP = HXP+1;\\n`;\n }\n this.codigoTemporal += `heapXPATH[(int)HXP] =-1;\\n`;\n this.codigoTemporal += `HXP = HXP+1;\\n`;\n this.codigoTemporal += \"PXP =\" + this.temporalGlobal.retornarString() + \";\\n\";\n this.codigoTemporal += \"ejecutarAxe();\\n\";\n //Si Solicita implementar el axe child\n if (this.auxiliarAxe == \"child\") {\n //ESCRIBIMOS LOS IFS RESPECTIVOS \n this.recorrerArbolConsulta(nodo.hijos[0]);\n }\n //Si necesitsa implementar el axe attribute\n if (this.auxiliarAxe == \"attribute\") {\n //Le cambiamos la etiqueta de identificador a atributo para fines de optimizacion de codigo\n nodo.hijos[0].label = \"atributo\";\n //Escribimos el codigo en C3D para la ejecución del axe atributo \n this.recorrerArbolConsulta(nodo.hijos[0]);\n }\n //Si necesitsa implementar el ancestor\n if (this.auxiliarAxe == \"ancestor\") {\n //Va a resolver el predicado o identificador que pudiese venir \n this.recorrerArbolConsulta(nodo.hijos[0]);\n }\n if (this.auxiliarAxe == \"descendant\") {\n this.controladorDobleSimple = true;\n this.recorrerArbolConsulta(nodo.hijos[0]);\n }\n //Reiniciamos la variable cuando ya se acabe el axe\n this.auxiliarAxe = \"\";\n }\n //PARA VERIFICAR SI EL ELEMENTO A BUSCAR ES UN ATRIBUTO \n if (this.tipoNodo('X', nodo)) {\n //return this.recorrer(nodo.hijos[0]);\n //const identificadorAtributo = nodo.hijos[0] as string;\n this.controladorDobleSimple = true;\n this.recorrerArbolConsulta(nodo.hijos[0]);\n /*\n EN ESTA PARTE SE VA A PROCEDER PARA IR A BUSCAR EL ELEMENTO SEGÚN TIPO DE ACCESO\n */\n }\n //PARA VERIFICAR SI SE NECESITAN TODOS LOS ATRIBUTOS DEL NODO ACTUAL \n if (this.tipoNodo('any_att', nodo)) {\n this.controladorText = true;\n const identificadorAtributo = nodo.hijos[0];\n //Verificamos el tipo de acceso\n //Significa acceso con prioridad\n if (this.controladorDobleSimple) {\n //VERIFICAMOS DESDE DONDE INICIAMOS\n if (!this.inicioRaiz) {\n this.inicioRaiz = true;\n for (let entry of this.ArrayEtiquetas) {\n this.codigoTemporal += \"P =\" + entry.posicion + \";\\n\";\n this.codigoTemporal += \"imprimirAtributoAny();\\n\";\n for (let att of entry.atributos) {\n // salidaXPATH.getInstance().push(att.dameNombre()+\"=\"+att.dameValor());\n }\n this.complementoAnnyAtributte(entry);\n }\n }\n else {\n let limite = this.consolaSalidaXPATH.length;\n for (var i = this.contadorConsola; i < limite; i++) {\n let entry = this.consolaSalidaXPATH[i];\n this.codigoTemporal += \"P =\" + entry.posicion + \";\\n\";\n this.codigoTemporal += \"imprimirAtributoAny();\\n\";\n for (let att of entry.atributos) {\n // salidaXPATH.getInstance().push(att.dameNombre()+\"=\"+att.dameValor());\n }\n this.complementoAnnyAtributte(entry);\n }\n }\n }\n //Acceso sin prioridad\n else {\n if (!this.inicioRaiz) {\n for (let entry of this.ArrayEtiquetas) {\n this.codigoTemporal += \"P =\" + entry.posicion + \";\\n\";\n this.codigoTemporal += \"imprimirAtributoAny();\\n\";\n for (let att of entry.atributos) {\n // salidaXPATH.getInstance().push(att.dameNombre()+\"=\"+att.dameValor());\n }\n }\n }\n else {\n let limite = this.consolaSalidaXPATH.length;\n for (var i = this.contadorConsola; i < limite; i++) {\n let entry = this.consolaSalidaXPATH[i];\n this.codigoTemporal += \"P =\" + entry.posicion + \";\\n\";\n this.codigoTemporal += \"imprimirAtributoAny();\\n\";\n for (let att of entry.atributos) {\n // salidaXPATH.getInstance().push(att.dameNombre()+\"=\"+att.dameValor());\n }\n }\n }\n }\n } //FIN ANNY ATT\n //PARA VERIFICAR SI SE ESTÁ INVOCANDO A LA FUNCIÓN TEXT() \n if (this.tipoNodo('text', nodo)) {\n this.controladorText = true;\n const identificadorAtributo = nodo.hijos[0];\n //Si se necesita el texto de el actual y los descendientes\n if (this.controladorDobleSimple) {\n for (var i = this.contadorConsola; i < this.consolaSalidaXPATH.length; i++) {\n /*if (this.consolaSalidaXPATH[i].dameValor() == \"\" || this.consolaSalidaXPATH[i].dameValor() == \" \") {\n \n } else {\n // salidaXPATH.getInstance().push(this.consolaSalidaXPATH[i].dameValor());\n }*/\n this.codigoTemporal += \"P=\" + this.consolaSalidaXPATH[i].posicion + \";\\n\";\n this.codigoTemporal += \"text();\\n\";\n this.complementoText(this.consolaSalidaXPATH[i]);\n }\n }\n else {\n //si necesita solo el texto del actual \n for (var i = this.contadorConsola; i < this.consolaSalidaXPATH.length; i++) {\n /* if (this.consolaSalidaXPATH[i].dameValor() == \"\" || this.consolaSalidaXPATH[i].dameValor() == \" \") {\n \n } else {\n //salidaXPATH.getInstance().push(this.consolaSalidaXPATH[i].dameValor());\n }*/\n this.codigoTemporal += \"P=\" + this.consolaSalidaXPATH[i].posicion + \";\\n\";\n this.codigoTemporal += \"text();\\n\";\n }\n }\n }\n //PARA VERIFICAR SI ES EL TIPO DE ACCESO AL PADRE: \":\" \n if (this.tipoNodo('puntos', nodo)) {\n const cantidad = nodo.hijos[0];\n //DOSPUNTOSSSSSSSSS\n if (cantidad.length == 2) {\n this.pathCompleto = true;\n if (this.auxiliarArrayPosicionPadres == -1) {\n this.auxiliarArrayPosicionPadres = this.arrayPosicionPadres.length - 1;\n }\n for (var i = this.auxiliarArrayPosicionPadres; i >= 0; i--) {\n let contadorHermanos = this.arrayPosicionPadres[i];\n let controladorInicio = 0;\n if (i > 0) {\n while (contadorHermanos != this.arrayPosicionPadres[i - 1]) {\n this.consolaSalidaXPATH.push(this.consolaSalidaXPATH[contadorHermanos]);\n this.codigoTemporal += \"P =\" + this.consolaSalidaXPATH[contadorHermanos].posicion + \";\\n\";\n if (controladorInicio == 0) {\n this.contadorConsola = this.consolaSalidaXPATH.length - 1;\n }\n controladorInicio++;\n contadorHermanos--;\n this.auxiliarArrayPosicionPadres = contadorHermanos;\n }\n }\n else {\n while (contadorHermanos >= 0) {\n this.consolaSalidaXPATH.push(this.consolaSalidaXPATH[contadorHermanos]);\n this.codigoTemporal += \"P =\" + this.consolaSalidaXPATH[contadorHermanos].posicion + \";\\n\";\n if (controladorInicio == 0) {\n this.contadorConsola = this.consolaSalidaXPATH.length - 1;\n }\n controladorInicio++;\n contadorHermanos--;\n this.auxiliarArrayPosicionPadres = contadorHermanos;\n }\n }\n break;\n }\n this.codigoTemporal += \"busquedaSimple();\\n\";\n }\n //SIGNIFICA QUE TIENE SOLO UN PUNTO \n else {\n this.pathCompleto = true;\n }\n ///DOS PUNTOOOOOOOOOOOOOOOOS\n }\n }", "function visualiserEditeurControls(){\n //\"lbledPays\",\"cboxedPays\",\n var vControles = [\n \"lbledNomEditeur\", \"txtedNomEditeur\",\n \"lbledVille\", \"btnedaddVill\", \"cboxedVill\",\n \"lbledSaveEdit\",\"btnedSaveEdit\"//,\n //\"lbledaddVille\" , \"txtedaddVille\"\n ];\n visualiserControls(\"btnedaddEdit\",vControles,\"cboxedEdit\");\n} // end visualiser", "function maisProdutos(){\n rl.question(\"Deseja acrescentar mais produtos a sacola?\\n 1 - Sim\\n 2 - Não\\n\", (opcao) =>{\n if(opcao === \"1\"){\n procurandoPedido();\n }else{\n listarSacola();\n }\n })\n}", "function constroiEventos(){}", "function carritoUI(cursosDisponibles){\n //CAMBIAR INTERIOR DEL INDICADOR DE CANTIDAD DE CURSOS\n $('#carritoCantidad').html (cursosDisponibles.length);\n\n //VACIAR EL INTERIOR DEL CUERPO DEL CARRITO\n $('#carritoCursos').empty();\n\n for(const curso of cursosDisponibles){\n $('#carritoCursos').append(registroCarrito(curso));\n }\n\n //AGREGAR TOTAL\n $(\"#carritoCursos\").append(`<p id=\"totalCarrito\"> TOTAL ${totalCarrito(cursosDisponibles)}</p>`);\n \n //FUNCION PARA OBTENER EL PRECIO TOTAL DEL CARRITO\nfunction totalCarrito(carrito) {\n console.log(carrito);\n let total = 0;\n carrito.forEach(p => total += p.subtotal());\n return total.toFixed(2);\n}\n\n //ASOCIAR EVENTOS A LA INTERFAZ GENERADA\n $(\".btn-add\").click(addCantidad);\n $(\".btn-delete\").click(eliminarCarrito);\n $(\".btn-restar\").click(restarCantidad);\n $(\"#btnConfirmar\").click(confirmarCompra);\n}", "function carterasFunction(){\n console.log(\"SeleccionaCliente\");\n SeleccionaCliente();\n console.log(\"getipoCartera\");\n getipoCartera();\n console.log(\">>>>>>>>>\");\n}", "function inicio() {\n\t\tacao('move_x', sc1_chamada1, 'ida', chamada_1);\n\t\tacao('move_x', sc1_chamada2, 'ida', chamada_2);\n\t\tacao('move_x', sc1_chamada3, 'ida', chamada_3, saiChamadas);\n\t}", "getCommanditaires() {\n\t\tthis.serviceTournois.getCommanditaires(this.tournoi.idtournoi).then(commanditaires => {\n\t\t\tthis.commanditaires = commanditaires;\n\t\t\tfor (let commanditaire of this.commanditaires) {\n\t\t\t\tthis.getContribution(commanditaire);\n\t\t\t}\n\t\t});\n\t}", "function continuaEscriure ()\r\n{\r\n this.borra ();\r\n this.actual=\"\";\r\n this.validate=0;\r\n}", "mostrarPagina(nombrePagina, id_escuderia) {\n this.paginaVacia();\n this.barraNavegacion();\n\n if (nombrePagina == \"CLASIFICACION CONSTRUCTORES\") {\n rellenarTablaClasificacionEscuderias();\n crearTablaClasificacionEscuderias();\n\n } else if (nombrePagina == \"CLASIFICACION PILOTOS\") {\n rellenarTablaClasificacionPilotos();\n crearTablaClasificacionPiloto();\n\n } else if (nombrePagina == \"HOME\") {\n paginaHome();\n\n } else if (nombrePagina == \"ESCUDERIAS\") {\n mostrarEscuderias();\n\n } else if (nombrePagina == \"CIRCUITOS\") {\n mostrarCircuits();\n\n } else if (nombrePagina == \"LOGOUT\") { //Login\n this.logout();\n this.mostrarBarraNavegacion(false);\n paginaLogin();\n\n } else if (nombrePagina == \"Login\") { //Login\n this.mostrarBarraNavegacion(false);\n paginaLogin();\n\n //SUB PAGiNES\n } else if (nombrePagina == \"ESCUDERIA-2\") { //Mostrar els pilotos\n mostrarPilotosDeXEscuderia(id_escuderia);\n \n } else if (nombrePagina == \"NUEVO CIRCUITO\") { //Añadir nou circuit\n formularioCircuito();\n\n } else if (nombrePagina == \"NUEVO PILOTO\") { //Añadir nou piloto\n formularioPiloto();\n \n } else if (nombrePagina == \"SIMULAR CARRERA\") { //Simular carrera\n simularCarrera();\n crearSimulacioClasificacionPiloto();\n }\n\n\n\n this.piePagina();\n\n console.log(nombrePagina);\n }", "function cargarpista1 (){\n \n}", "function Guarda_Clics_EES_Menos()\r\n{\r\n\tGuarda_Clics(1,0);\r\n}", "function zerarTransformacao () {\n botaoT = 0; \n botaoS = 0;\n botaoR = 0;\n}", "function mostrar()\n{\nlet nombre;\nlet cantidad;\nlet marca;\nlet precioUnidad;\nlet precioTotalCompra;\nlet seguir;\nlet descuento;\nlet acumDescuento=0;\nlet precioTotalTotal =0;\nlet contadorF=0;\nlet acumuladorF=0;\nlet contadorA=0;\nlet acumA=0;\nlet contadorI=0;\nlet acumI=0;\nlet promedioF=0;\nlet promedioA=0;\nlet promedioI=0;\nlet marcaMasVentas;\n\n\n\n\ndo{\nnombre = prompt(\"ingrese su nombre\");\ncantidad = prompt( \"ingrese cantidad de lamparas\");\nmarca = prompt(\"ingrese marca, felipelamparas, argentinaluz, illuminatis\")\nwhile(marca != \"felipelamparas\" && marca != \"argentinaluz\" && marca != \"illuminatis\"){\n\tmarca = prompt(\"ingrese marca, felipelamparas, argentinaluz, illuminatis\")\n}\n\nprecioUnidad = parseInt(prompt(\"ingrese el valor de unidad\"));\n\n\n\nprecioTotalCompra = cantidad * precioUnidad\n\nif(marca== \"felipelamparas\" && cantidad > 5){\n\tdescuento = precioTotalCompra * 0.10;\n\tprecioTotalCompra = precioTotalCompra - descuento;\n\tacumDescuento = acumDescuento + descuento;\n}\n\nif (marca == \"argentinaluz\" && cantidad >= 3){\n\tdescuento = precioTotalCompra * 0.15;\n\tprecioTotalCompra = precioTotalCompra - descuento;\n\tacumDescuento = acumDescuento + descuento;\n}\n\n\nprecioTotalTotal = precioTotalTotal + precioTotalCompra;\n\n\nif(marca==\"argentinaluz\"){\n\tcontadorA++;\n\tacumA = acumA + cantidad;\n}else if (marca ==\"felipelamparas\"){\n\tcontadorF++;\n\tacumuladorF = acumuladorF + cantidad;\n}else{\n\tcontadorI++;\n\tacumI = acumI + cantidad;\n}\n\n\n\n\nseguir = prompt(\"desea seguir?, coloque si \")\n}while(seguir== \"si\");\n\n\n\nif(contadorA !=0){\n\tpromedioA = acumA / contadorA;\n}\nif ( contadorF!=0){\n\tpromedioF = acumuladorF / contadorF;\n}\nif (contadorI!=0){\n\tpromedioI = acumI / contadorI;\n}\n\n\n\nconsole.log(\"A- lo recaudado en el total de todas las ventas es de $\" + precioTotalTotal );\n\nif(acumDescuento!=0){\n\tconsole.log(\"B- La empresa perdio un total de \" + acumDescuento + \" en concepto de descuentos\");\n}else{\n\tconsole.log(\"B- La empresa no tuvo que realizar descuento en niguna compra\");\n}\n\nconsole.log(\"C- el promedio de ventas de argentinaluz es de \" + promedioA + \" , el de felipelamparas es de \" + promedioF + \" y el de illuminatis es de \" + promedioI);\n\nif(contadorA > contadorF && contadorA > contadorI){\n\tmarcaMasVentas = \"ARGENTINALUZ\";\n}else if ( contadorF >= contadorA && contadorF > contadorI){\n\tmarcaMasVentas = \"FELIPELAMPARAS\";\n}else{\n\tmarcaMasVentas = \"ILLUMINATIS\"\n}\n \nconsole.log(\"D- La marca on mas ventas sin importar la cantidad de lamparas es \" + marcaMasVentas);\n\n\t\n}", "function iniciarListaBusqueda(){\n var ciclos = selectDatoErasmu();\n for(var aux = 0, help = 0 ; aux < erasmu.length ; aux++){\n if(ciclos.indexOf(erasmu[aux].ciclo) != -1){\n crearListErasmu(erasmu[aux]);\n }\n }\n}", "misDatos() { // un metodo es una funcion declarativa sin el function dentro de un objeto, puede acceder al universo del objeto\n return `${this.nombre} ${this.apellido}`; // por medio del \"this\", que es una forma de acceder a las propiedades del objeto en un metodo\n }", "function verificaClique(verifyClick) {\n if (verifyClick == \"btn btnCronometro\") {\n document.querySelector('.btn.btnPausar').disabled = false;\n document.querySelector('.btn.btnCronometro').disabled = true;\n } else if ((verifyClick == \"btn btnPausar\")) {\n document.querySelector('.btn.btnCronometro').disabled = false;\n document.querySelector('.btn.btnPausar').disabled = true;\n } else if (verifyClick == \"btn btnZerar\") {\n document.querySelector('.btn.btnCronometro').disabled = false;\n document.querySelector('.btn.btnPausar').disabled = false;\n clearInterval(intervalo);\n document.querySelector('.marcaTempo').innerHTML = '';\n hr.style.display = 'none';\n min.style.display = 'none';\n divisao1.style.display = 'none';\n divisao2.style.display = 'none';\n }\n}", "function voltarEtapa3() {\n msgTratamentoEtapa4.innerHTML = \"\";\n //recebendo H3 e setando nela o texto com o nome do cliente\n var tituloDaEtapa = document.querySelector(\"#tituloDaEtapa\");\n tituloDaEtapa.textContent = \"3º Etapa - Colaborador\";\n\n document.getElementById('selecionarPacotes').style.display = 'none'; //desabilita a etapa 4\n document.getElementById('selecionarFuncionarios').style.display = ''; //habilita a etapa 3\n }", "function etapa2() {\n countEtapa2++;\n\n //recebendo H3 e setando nela o texto com o nome do cliente\n var tituloDaEtapa = document.querySelector(\"#tituloDaEtapa\");\n tituloDaEtapa.textContent = \"2º Etapa - Crianças\"; \n\n //recebe o controlador com total e todos os aniversariantes e salva em uma variavel \n var totalCriancas = document.getElementById('totalCriancas').value;\n var listaConcatenadaCrianca = document.getElementById('listaConcatenadaCrianca').value; \n\n document.getElementById('confirmacaoCliente').style.display = 'none'; //desabilita a confirmação da etapa 1\n document.getElementById('selecionarAniversariantes').style.display = ''; //habilita a etapa 2\n\n //pega a lista concatenada das crianças e faz um split e salva o resultado na lista resultado\n var resultado = listaConcatenadaCrianca.split(\"/\");\n\n //percorre essa lista resultado\n resultado.forEach((valorAtual) => {\n\n //variaveis \n var idCrianca = 0;\n var nomeCrianca = \"\";\n var idClienteCrianca = 0;\n var countResultado = 0;\n\n //faz novamente um split em cada objeto da lista \n var resultado2 = valorAtual.split(\",\");\n\n //salva nas variaveis os valores da criança\n resultado2.forEach((valorAtual2) => {\n countResultado++;\n //se é a primeira vez que passa na lista, salva o id\n if (countResultado == 1) {\n idCrianca = valorAtual2;\n } \n if (countResultado == 2){\n nomeCrianca = valorAtual2;\n }\n if(countResultado == 3){\n idClienteCrianca = valorAtual2;\n }\n });\n\n //verifica se a criança atual do laço, tem o mesmo idCliente que foi selecionado\n if(idCliente == idClienteCrianca){\n //condição para verificar se alguma vez já passou pela etapa 2 e criou os elementos \n if(countEtapa2 == 1){\n quantidadeCrianca++;\n quantidadeCrianca2++;\n\n document.getElementById('tabelaAniversariante').style.display = ''; //habilita a tabela de listagem de criança\n \n //COMEÇO DA CRIAÇÃO DA TABELA DAS CRIANÇAS\n //cria um elemento do tipo TR e salva ele em uma variavel\n var aniversariantesTr = document.createElement(\"tr\");\n aniversariantesTr.id = \"tdAniversariante\" + quantidadeCrianca;\n\n //cria elementos do tipo TD e salva eles em uma variavel\n var aniversarianteTd = document.createElement(\"td\");\n var removerAniversarianteTd = document.createElement(\"td\");\n\n //criando elemento button para remover\n var removerAniversarianteBotao = document.createElement(\"button\");\n removerAniversarianteBotao.textContent = \"Remover\";\n removerAniversarianteBotao.type = \"button\";\n removerAniversarianteBotao.classList.add(\"btn\", \"btn-info\");\n removerAniversarianteBotao.id = \"idRemoverAniversarianteBotao\";\n removerAniversarianteBotao.name = \"nameRemoverAniversarianteBotao\" + quantidadeCrianca;\n \n //criando atributo onclick para o botão remover\n removerAniversarianteBotao.onclick = function (){\n quantidadeCrianca--; //remove 1 da quantidade de criança\n \n //remove o elemento tr da table\n document.getElementById(aniversariantesTr.id).remove();\n \n //remove o input \n document.getElementById(inputCrianca.id).remove();\n \n //remove da lista de nome a criança removida\n listaNomeCrianca.splice(listaNomeCrianca.indexOf(nomeCrianca), 1); \n \n //se não ficou nenhuma criança oculta a table\n if(quantidadeCrianca == 0){\n document.getElementById('tabelaAniversariante').style.display = 'none';\n quantidadeCriancaBotaoRemover = 0;\n quantidadeCrianca2 = 0;\n textoConfirmacaoCrianca = \"\";\n \n var subTituloEtapa2 = document.querySelector(\"#subTituloEtapa2\");\n subTituloEtapa2.textContent = \"Nenhuma criança selecionada! Por favor, siga para a 3° Etapa ou clique no botão 'Recarregar crianças' para selecionar novamente.\"; \n }\n };\n \n //colocando o botão de remover dentro do td de remover\n removerAniversarianteTd.appendChild(removerAniversarianteBotao);\n\n //seta o texto das td com o nome da criança\n aniversarianteTd.textContent = nomeCrianca;\n\n //coloca os TDS criados que estão com os valores do form dentro do TR\n aniversariantesTr.appendChild(aniversarianteTd);\n aniversariantesTr.appendChild(removerAniversarianteTd);\n\n //pega o elemento table do html através do id e seta nele o TR criado\n var tabelaTbodyAniversariante = document.querySelector(\"#tbodyAniversariantes\");\n tabelaTbodyAniversariante.appendChild(aniversariantesTr);\n //FIM DA CRIAÇÃO DA TABELA DAS CRIANÇAS\n \n //COMEÇO DA CRIAÇÃO O INPUT DO CADASTRO DE FESTA\n //cria um elemento html input\n var inputCrianca = document.createElement(\"input\");\n \n //seta os atributos do input\n inputCrianca.type = \"hidden\";\n inputCrianca.value = idCrianca;\n inputCrianca.name = \"idCrianca\"+quantidadeCrianca;\n inputCrianca.id = \"idCrianca\"+quantidadeCrianca;\n \n //buscando o form de cadastro e setando nele o input criado\n var formCadastroDeFesta = document.querySelector('#cadastrarFestaForm');\n formCadastroDeFesta.appendChild(inputCrianca);\n //FIM DA CRIAÇÃO O INPUT DO CADASTRO DE FESTA\n \n //adiciona o nome da criança na lista de nome da criança\n listaNomeCrianca.push(nomeCrianca);\n \n }\n \n }\n \n });\n \n quantidadeCriancaBotaoRemover = quantidadeCrianca;\n \n //se o cliente não tiver criança\n if(quantidadeCrianca < 1){\n \n if(possuiCrianca == 1){\n var subTituloEtapa2 = document.querySelector(\"#subTituloEtapa2\");\n subTituloEtapa2.textContent = \"Nenhuma criança selecionada! Por favor, siga para a 3° Etapa ou clique no botão 'Recarregar crianças' para selecionar novamente.\"; \n }else{\n var subTituloEtapa2 = document.querySelector(\"#subTituloEtapa2\");\n subTituloEtapa2.textContent = \"Esse cliente não possui nenhuma criança vinculada ao seu cadastro. Por favor, siga para a 3° Etapa ou atualize as informações no cadastro de cliente.\"; \n }\n \n }else{\n possuiCrianca = 1;\n \n var subTituloEtapa2 = document.querySelector(\"#subTituloEtapa2\");\n subTituloEtapa2.textContent = \"Por favor, clique em remover caso alguma criança não faça parte do cadastro: \";\n }\n \n }", "constructor(ojos, boca, extremidades, duenio) {\n super(ojos, boca, extremidades);\n this.duenio = duenio;\n this.estaDomesticado = true;\n }", "function Copcar(){}", "function_Cargando(elemento){\n if(this.cargando){\n return elemento.innerHTML = \"<span class='cargaterri'>Creando territorio...<i class='fa fa-spinner fa-spin' style='font-size:30px'></i></span>\";\n }\n elemento.innerHTML = \"\";\n }", "function retourDeMonClic(idClique)\r\n {\r\n \r\n // console.log(idClique)+\" = clic\";\r\n // ex: e1, c1 ...\r\n\r\n // Affiche et garde la première lettre (position 0)\r\n let premiereLettreDeId = idClique.charAt(0); // ex: e\r\n\r\n\r\n// *********** Objectif retirer la première lettre pour avoir le numéro de l'id \r\n \r\n // Remplacer c ou e par rien\r\n let numeroId = idClique.replace(premiereLettreDeId, \"\");\r\n\r\n\r\n // On / off \r\n // (si = e + int et première lettre égal à e)\r\n\r\n if(idClique== (premiereLettreDeId + numeroId) && (premiereLettreDeId == \"e\")){\r\n\r\n x = document.getElementById(idClique).parentNode.nodeName;\r\n // console.log(x +\" lien parent\") // DIV\r\n\r\n let PointageCibleOn=document.getElementById(\"tache\"+numeroId);\r\n // console.log(numeroId + \" : id cliqué !\");\r\n\r\n let cibleIcon=document.getElementById(\"ico\"+numeroId);\r\n\r\n // Ajout du fond vert \"tache\"+numeroId\r\n PointageCibleOn.style.backgroundColor=\"rgba(232, 255, 117, 1)\";\r\n\r\n\r\n // ajout de class pour le design css\r\n\r\n cibleIcon.setAttribute(\"class\",\"far fa-check-circle\");\r\n\r\n// *********** Chercher le key de maListeDesTaches qui contient comme id: x le id cliqué \r\n \r\n for (let a = 0; a < maListeDesTaches.length; a++) {\r\n const element = maListeDesTaches[a];\r\n // console.log(element);\r\n\r\n// *********** Etat à true (pour mémoriser la couleur et ico validé)\r\n\r\n if (maListeDesTaches[a].id==numeroId) {\r\n // alert(\"L'array \"+a+\" à la valeur\"+maListeDesTaches[a].tache);\r\n maListeDesTaches[a].etat=true;\r\n console.log(maListeDesTaches)\r\n\r\n // ****** storage à sauver (mis à jour)\r\n localStorage.setItem(\"donnesSauvegardees\", JSON.stringify(maListeDesTaches));\r\n\r\n // break fonctionne également\r\n return;\r\n }\r\n }\r\n\r\n }\r\n\r\n// *********** Supprimer le Div cliqué\r\n\r\n if(idClique== (premiereLettreDeId + numeroId) && (premiereLettreDeId == \"c\")){\r\n\r\n function supprimerDiv() {\r\n \r\n // pointer le div tache et son numéro\r\n let myobj = document.getElementById(\"tache\"+numeroId);\r\n console.log(numeroId + \" Numéro Id cliqué\")\r\n\r\n // supprime la cible\r\n myobj.remove();\r\n\r\n\r\n// *********** supprimer la clef de id cliqué de l'objet ******************************************************************************\r\n \r\n // Supprimer de mon tableau id correspondant 1 = le nombre entrée(s) à supprimer\r\n maListeDesTaches.splice(numeroId, 1);\r\n\r\n // ****** storage à sauver (mis à jour)\r\n localStorage.setItem(\"donnesSauvegardees\", JSON.stringify(maListeDesTaches));\r\n }\r\n\r\n // Appel fonction\r\n supprimerDiv();\r\n\r\n\r\n } // fin condition if\r\n } // fin retourDeMonClic", "function limpiarCapaNuevaRuta(){\n lienzoRutas.destroyFeatures();\n}", "function undo() {\n //verifife que l'on peut defaire un choix\n if (currentPawnCombinaison == 0) {\n\tconsole.log(\"line not started\");\n }\n else {\n\tvar pawn = document.querySelectorAll(\"div.pion-\" + (currentPawnCombinaison -1))[currentLine];\n\tconsole.log(pawn);\n\tpawn.style.backgroundColor = 'transparent';\n\tpawn.style.border = '1px solid #888562';\n\tcurrentPawnCombinaison--;\n\tcombinaison = combinaison.substring(0, combinaison.length -1);\n\tconsole.log(combinaison);\n\tconsole.log(currentPawnCombinaison);\n }\n}", "function finalizaPartida(){\n\nif (intentos==0) {\n alert(\"Te quedaste sin intentos. La palabra secreta era: \"+secreta);\ndesactivaBotones();\ndocument.getElementById(\"reinicia\").removeAttribute(\"style\");\n}else if (muestra==secreta && intentos>0) {\n alert(\"HAS GANADO\");\n desactivaBotones();\n document.getElementById(\"reinicia\").removeAttribute(\"style\");\n}\n\n}", "constructor() {\n this.inicializar();\n this.generarSecuencia();\n this.siguienteNivel(); \n }", "function limpiar() {\n document.getElementById('taConsulta').style.backgroundColor = \"#FFF\";\n document.getElementById('divEjecutaCMD').style.display = 'none';\n document.getElementById('divEjecutaSQL').style.display = 'block';\n document.getElementById('taConsulta').style.color = \"#000\";\n document.getElementById('taConsulta').value = '';\n document.getElementById('resultadoConsulta').innerHTML = '';\n //document.getElementById('msjVentana').innerHTML = '';\n paquete_global = '';\n}", "function reservacion(completo,opciones){\n /* opciones = opciones || {};\n if(completo)\n console.log(opciones.metodoPago);\n else\n console.log('No se pudo completar la operación'); */\n let {metodoPago,cantidad,dias}=opciones\n console.log(metodoPago);\n console.log(cantidad);\n console.log(dias);\n }", "cocina(){}", "function mostrar() {}", "function mostrar() {}", "function saludarArgumentos2(referencia){\n // retorna 1 porque asi se designo el return 1;\n return 1;\n // Algo que va despues de un return jamas se va a ejecutar\n}", "function aviso_CEP(campo, escolha){\r\r\n\r\r\n //TEXTO SIMPLES\r\r\n var label = document.createElement(\"label\")\r\r\n\r\r\n //ESCOLHENDO O TIPO DE AVISO\r\r\n if (escolha == 1 ){ \r\r\n\r\r\n //TEXTO DE AVISO DE OBRIGATORIO\r\r\n var text = document.createTextNode(\"Preenchimento Obrigatório\")\r\r\n\r\r\n //COLOCANDO O ID NA LABEL E BR CRIADAS\r\r\n label.id = \"aviso_cep\"\r\r\n\r\r\n //INSERINDO O TEXTO DE AVISO NO CAMPO QUE SERA COLOCADO\r\r\n label.appendChild(text)\r\r\n }\r\r\n else if (escolha == 2){ \r\r\n\r\r\n //COLOCANDO O ID NA LABEL E BR CRIADAS\r\r\n label.id = \"aviso_cep1\"\r\r\n\r\r\n //TEXTO DE AVISO DE INVÁLIDO\r\r\n var text = document.createTextNode(\"CEP inválido!\")\r\r\n\r\r\n //INSERINDO O TEXTO DE AVISO NO CAMPO QUE SERA COLOCADO\r\r\n label.appendChild(text)\r\r\n }\r\r\n\r\r\n //REFERENCIA DE ONDE SERA COLOCADO O ITEM\r\r\n var lista = document.getElementsByTagName(\"p\")[5]\r\r\n var itens = document.getElementsByTagName(\"/p\") \r\r\n\r\r\n //INSERINDO O AVISO EM VERMELHO\r\r\n lista.insertBefore( label, itens[0]);\r\r\n label.style.color = \"red\";\r\r\n\r\r\n //MUDANDO O BACKGROUND\r\r\n erro(campo)\r\r\n}", "function btnQuitarPublicacion(div) {\n controlesEdit(true, div, \".quitarPublicacionMode\")\n }//-------------------------------", "function Guarda_Clics_EPR_Menos()\r\n{\r\n\tGuarda_Clics(0,0);\r\n}", "function opciones(pag) {\n return new Promise(resolve => {\n\n<<<<<<< HEAD\n for (let btnEliminar of eliminar) {\n //Al hacer click en eliminar\n btnEliminar.onclick = ()=> {\n //Eliminar entrada\n Swal.fire({\n title: '¿Estás seguro?',\n text: \"¡No podrás revertir esto!\",\n type: 'warning',\n showCancelButton: true,\n confirmButtonColor: '#3085d6',\n cancelButtonColor: '#d33',\n confirmButtonText: '¡Si, eliminar!'\n }).then((result) => {\n if (result.value) {\n<<<<<<< HEAD\n //Si no estoy en la primera página y queda solo una\n //entrada me lleva a la anterior despues de borrarla\n if(pag>1 && numEntradasEnPag==1) {pag--}\n=======\n>>>>>>> master\n eliminarEntrada(btnEliminar.id, pag); \n }\n })\n \n };\n }\n=======\n let eliminar = document.getElementsByClassName(\"delete\");\n let editar = document.getElementsByClassName(\"edit\");\n let numEntradasEnPag = eliminar.length;\n \n for (let btnEliminar of eliminar) {\n //Al hacer click en eliminar\n btnEliminar.onclick = ()=> {\n //Eliminar entrada\n Swal.fire({\n title: '¿Estás seguro?',\n text: \"¡No podrás revertir esto!\",\n type: 'warning',\n showCancelButton: true,\n confirmButtonColor: '#3085d6',\n cancelButtonColor: '#d33',\n confirmButtonText: '¡Si, eliminar!'\n }).then((result) => {\n if (result.value) {\n //Si no estoy en la primera página y queda solo una\n //entrada me lleva a la anterior despues de borrarla\n if(pag>1 && numEntradasEnPag==1) {pag--}\n eliminarEntrada(btnEliminar.id, pag); \n }\n })\n \n };\n }\n \n for (let btnEditar of editar) {\n //Al hacer click en editar\n btnEditar.onclick = ()=> {\n //Cambiar fecha del input\n editarEntrada(btnEditar);\n };\n }\n>>>>>>> v2.0.0\n\n resolve();\n }", "function corrExam(){inicializar(); corregirText1(); corregirSelect1(); corregirMulti1(); corregirCheckbox1(); corregirRadio1(); corregirText2(); corregirSelect2(); corregirMulti2(); corregirCheckbox2(); corregirRadio2(); presentarNota();}", "function cerrarPoligono(){\n if(poligono.getTamanio()>=3){\n poligono.cerrar();\n // lo agrego al arreglo de poligonos\n poligonos[poligonos.length-1] = poligono;\n cerrado = true;\n\n\n }\n\n}", "function reestablece(){\n colector = \"0\";\n operacion = \"\";\n operador0 = 0;\n operador1 = 0;\n resultado = 0;\n iteracion = 0;\n }", "function visualiserAuteurControls(){\n var vControles = [\"lbledNomAuteur\",\"txtedNomAuteur\",\n \"lbledPreAuteur\",\"txtedPreAuteur\",\"lbledSaveAute\",\"btnedSaveAute\"];\n visualiserControls(\"btnedaddAute\" ,vControles,\"cboxedAute\");\n} // end visualiser", "function pulaCorda() {\n console.log('Pulei 1x com function')\n console.log('Pulei 2x com function')\n console.log('Pulei 3x com function')\n console.log('Pulei 4x com function')\n console.log('Pulei 5x com function')\n console.log('Pulei 6x com function')\n console.log('Pulei 7x com function')\n console.log('Pulei 8x com function')\n console.log('Pulei 9x com function')\n console.log('Pulei 10x com function')\n}", "function comprueba(letra){\n document.getElementById(letra).setAttribute(\"style\",\"visibility: hidden;\");\n var letraAcertada=false;\n for (var i = 0; i < secreta.length; i++) {\n if (letra==secreta.charAt(i)) {\n letraAcertada=true;\n muestra = muestra.substring(0, i) + secreta.charAt(i) + muestra.substring(i+1, muestra.length);\n document.getElementById(\"secreta\").innerHTML=muestra;\n }\n }\n if (!letraAcertada) {\n intentos--;\n }\n dibujaMuerto();\n finalizaPartida();\n}", "function cargarCgg_res_oficial_seguimientoCtrls(){\n if(inRecordCgg_res_oficial_seguimiento){\n tmpUsuario = inRecordCgg_res_oficial_seguimiento.get('CUSU_CODIGO');\n txtCrosg_codigo.setValue(inRecordCgg_res_oficial_seguimiento.get('CROSG_CODIGO'));\n txtCusu_codigo.setValue(inRecordCgg_res_oficial_seguimiento.get('NOMBRES')+' '+inRecordCgg_res_oficial_seguimiento.get('APELLIDOS'));\n chkcCrosg_tipo_oficial.setValue(inRecordCgg_res_oficial_seguimiento.get('CROSG_TIPO_OFICIAL'));\n isEdit = true;\n habilitarCgg_res_oficial_seguimientoCtrls(true);\n }}", "function dibujarFresado118(modelo,di,pos,document){\n\t\n\t\n\t\n\t//ESTABLECER CAPA\n\tvar op_fresado = new RAddObjectsOperation();\n\tdi.setCurrentLayer(\"Fresado\"); //Seleccionar la capa de fresado\n\t\n\tvar plieguesInf=[pliegueInf1, pliegueInf2, pliegueInf3, pliegueInf4, pliegueInf5]\n\tEAction.handleUserMessage(\"ha entrado 11111111111111111 \");\n\t//sacar el mayor pliegue\n\tpliegueInferior=pliegueInf1\n\tfor (n=0;n<5;n=n+1){ \n\t\tif (pliegueInferior<plieguesInf[n]){\n\t\t\tpliegueInferior=plieguesInf[n]\n\t\t}\n\t}\n\t\n\t\n\t\n\t//Puntos trayectoria \n\t\n\t\n\tvar fresado11 = new RVector(pos.x-anchura1,pos.y+alaInferior+pliegueInferior)\n\tvar fresado12 = new RVector(pos.x-anchura1-anchura2,pos.y+alaInferior+pliegueInferior)\n\tvar fresado13 = new RVector(pos.x-anchura1-anchura2-anchura3,pos.y+alaInferior+pliegueInferior)\n\tvar fresado14 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4,pos.y+alaInferior+pliegueInferior)\n\tvar fresado15 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-anchura5,pos.y+alaInferior+pliegueInferior) //nuevo\n\t\n\t\n\t\n\tvar fresado16 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior) \n\tvar fresado17 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\t\n\tvar fresado18 = new RVector(pos.x-anchura1,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado19 = new RVector(pos.x-anchura1-anchura2,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado20 = new RVector(pos.x-anchura1-anchura2-anchura3,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado21 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4,pos.y+alaInferior+pliegueInferior+alturaPlaca)\n\tvar fresado22 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-anchura5,pos.y+alaInferior+pliegueInferior+alturaPlaca) //muevo\n\t\n\tvar fresado23 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-anchura5,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\n\t\n\t\n\t\n\t\n\tif (anchura5>pliegueInf5){ \n\t\tvar fresado14b = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-anchura5,pos.y+alaInferior+pliegueInferior-pliegueInf5-alaInferior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado14b , fresado23 ));\n\t\top_fresado.addObject(line,false);\n\n\t}else{\n\t\tvar line = new RLineEntity(document, new RLineData( fresado15 , fresado23 ));\n\t\top_fresado.addObject(line,false);\n\t}\n\t\n\t\tvar line = new RLineEntity(document, new RLineData( fresado16 , fresado15 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado15 , fresado22 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado21 , fresado14 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado13 , fresado20 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado19 , fresado12 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado11 , fresado18 ));\n\t\top_fresado.addObject(line,false);\n\t\tvar line = new RLineEntity(document, new RLineData( fresado17 , fresado22 ));\n\t\top_fresado.addObject(line,false);\n\n\t\n\t\n\t\n\tEAction.handleUserMessage(\"ha entrado 44444444444444444444444444 \");\n\t\n\t\n\t//anchura1 - Inferior\n\tif (anchura1>pliegueInf1){\n\t\t//var fresado10 = new RVector(pos.x,pos.y+pliegueInferior+alaInferior) \n\t\tvar fresado1 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t//var fresado2 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\tvar fresado3 = new RVector(pos.x-anchura1+pliegueInf1,pos.y+alaInferior+pliegueInferior-pliegueInf1)\n\t\t\n\t\t//dibujarFresado_auxiliar(doc,fresado10,fresado1)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado1 , fresado3 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t//dibujarFresado_auxiliar(doc,fresado2,fresado11)\n\t}\n\t\n\t//anchura2 - Inferior\n\tif (anchura2>(pliegueInf2*2)){ \n\t\tvar fresado4 = new RVector(pos.x-anchura1-pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar fresado5 = new RVector(pos.x-anchura1-anchura2+pliegueInf2,pos.y+alaInferior+pliegueInferior-pliegueInf2)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado4 , fresado5 ));\n\t\top_fresado.addObject(line,false);\n\n\t}\n\t\n\t//anchura3 - Inferior\n\tif (anchura3>(pliegueInf3*2)){ \n\t\tvar fresado6 = new RVector(pos.x-anchura1-anchura2-pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar fresado7 = new RVector(pos.x-anchura1-anchura2-anchura3+pliegueInf3,pos.y+alaInferior+pliegueInferior-pliegueInf3)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado6 , fresado7 ));\n\t\top_fresado.addObject(line,false);\n\t} \n\t\n\t//anchura4 - Inferior\n\tif (anchura4>(pliegueInf4*2)){ \n\t\tvar fresado8 = new RVector(pos.x-anchura1-anchura2-anchura3-pliegueInf4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n\t\tvar fresado9 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4+pliegueInf4,pos.y+alaInferior+pliegueInferior-pliegueInf4)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado8 , fresado9 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t} \n\n\t//anchura4 - Inferior\n\tif (anchura5>pliegueInf5){ \n\t\tvar fresado10 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-pliegueInf5,pos.y+alaInferior+pliegueInferior-pliegueInf5)\n\t\tvar fresado11 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-anchura5,pos.y+alaInferior+pliegueInferior-pliegueInf5)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado10 , fresado11 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t} \n\t\n\t\n\t\n\n\tEAction.handleUserMessage(\"ha entrado 555555555555555555555555555555555555555555555555 \");\n\t\n\n\t\n\t//anchura1 - Superior\n\tif (anchura1>(pliegueSuperior*2)){ \n\t\tvar fresado25 = new RVector(pos.x,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado26 = new RVector(pos.x-anchura1+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado25 , fresado26 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ //Esto es para hacer el fresado externo o no\n\t\t\tvar fresado27 = new RVector(pos.x-anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado28 = new RVector(pos.x-anchura1+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado27 , fresado28 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t//anchura2 - Superior\n\tif (anchura2>(pliegueSuperior*2)){ \n\t\tvar fresado31 = new RVector(pos.x-anchura1-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado32 = new RVector(pos.x-anchura1-anchura2+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado31 , fresado32 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado29 = new RVector(pos.x-anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado30 = new RVector(pos.x-anchura1-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado29 , fresado30 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado33 = new RVector(pos.x-anchura1-anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado34 = new RVector(pos.x-anchura1-anchura2+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado33 , fresado34 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t//anchura3 - Superior\n\tif (anchura3>pliegueSuperior*2){\n\t\tvar fresado37 = new RVector(pos.x-anchura1-anchura2-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado38 = new RVector(pos.x-anchura1-anchura2-anchura3+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado37 , fresado38 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado35 = new RVector(pos.x-anchura1-anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado36 = new RVector(pos.x-anchura1-anchura2-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado35 , fresado36 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado39 = new RVector(pos.x-anchura1-anchura2-anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado40 = new RVector(pos.x-anchura1-anchura2-anchura3+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado39 , fresado40 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t//anchura4 - Superior\n\tif (anchura4>pliegueSuperior*2){ \n\t\tvar fresado43 = new RVector(pos.x-anchura1-anchura2-anchura3-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado44 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4+pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado43 , fresado44 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado41 = new RVector(pos.x-anchura1-anchura2-anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado42 = new RVector(pos.x-anchura1-anchura2-anchura3-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado41 , fresado42 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t\tvar fresado45 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar fresado46 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4+pliegueSuperior-margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado45 , fresado46 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t//anchura5 - Superior\n\tif (anchura5>pliegueSuperior){ \n\t\tvar fresado49 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-pliegueSuperior,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar fresado50 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-anchura5,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\tvar line = new RLineEntity(document, new RLineData( fresado49 , fresado50 ));\n\t\top_fresado.addObject(line,false);\n\t\t\n\t\t\n\t\tif (crearFresado==1){ \n\t\t\tvar fresado47 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior+alaSuperior)\n\t\t\tvar fresado48 = new RVector(pos.x-anchura1-anchura2-anchura3-anchura4-pliegueSuperior+margenFresado,pos.y+alaInferior+pliegueInferior+alturaPlaca+pliegueSuperior)\n\t\t\tvar line = new RLineEntity(document, new RLineData( fresado47 , fresado48 ));\n\t\t\top_fresado.addObject(line,false);\n\t\t\t\n\t\t}\n\t}\n\t\n\t\n\treturn op_fresado;\n\t\n\t\n\t\n\t\n\t\n}", "function compruebaFin() {\r\n if( oculta.indexOf(\"_\") == -1 ) {\r\n document.getElementById(\"msg-final\").innerHTML = \"Felicidades !!\";\r\n document.getElementById(\"msg-final\").className += \"zoom-in\";\r\n document.getElementById(\"palabra\").className += \" encuadre\";//className obtine y establece el valor del atributo de la clase del elemento especificado\r\n for (var i = 0; i < buttons.length; i++) {\r\n buttons[i].disabled = true;\r\n }\r\n document.getElementById(\"reset\").innerHTML = \"Empezar\";\r\n btnInicio.onclick = function() { location.reload() };\r\n }else if( cont == 0 ) {\r\n document.getElementById(\"msg-final\").innerHTML = \"Juego Finalizado\";\r\n document.getElementById(\"msg-final\").className += \"zoom-in\";\r\n document.getElementById(\"dibujo_ahorcado\").style.display=\"none\";\r\n document.getElementById(\"segundo\").style.display=\"block\";\r\n\r\n for (var i = 0; i < buttons.length; i++) {\r\n buttons[i].disabled = true; //Desactiva el boton despues de precionarlo\r\n }\r\n document.getElementById(\"reset\").innerHTML = \"Empezar\";\r\n btnInicio.onclick = function () { location.reload() }; // el reload me sirve para volver a cargar el juego o una nueva palabra en menos palabra\r\n }\r\n}", "function mostrarResumen(){\n const resumen = document.querySelector('.contenido-resumen');\n //Destructuring al objeto\n const {nombre,fecha,hora,servicios} = cita;\n //Limpiar el contenido de resumen \n while(resumen.firstChild){\n resumen.removeChild(resumen.firstChild);\n } \n if( Object.values(cita).includes('') || cita.servicios.length === 0){ \n mostrarAlerta('Faltan datos de servicios, fecha u hora','error','.contenido-resumen',false);\n return;\n }\n //Creamos el heading\n \n const headingCita = document.createElement('H2');\n headingCita.textContent = 'Resumen cita';\n resumen.appendChild(headingCita); \n //Añadimos en el orden que deseamos que aparezcan los datos.\n const nombreCliente = document.createElement('P');\n nombreCliente.innerHTML = `<span>Nombre : </span>${nombre}`;\n resumen.appendChild(nombreCliente);\n fechaFormateada = formatearFecha(fecha);\n const fechaCita = document.createElement('P');\n fechaCita.innerHTML = `<span>Fecha : </span>${fechaFormateada}`;\n resumen.appendChild(fechaCita);\n const horaCita = document.createElement('P');\n horaCita.innerHTML = `<span>Hora : </span>${hora}`;\n resumen.appendChild(horaCita); \n //Variable para calcular el precio total \n let precioTotal = 0;\n servicios.forEach(servicio =>{ \n //Destructuring al objeto \n const {id, precio, nombre} = servicio;\n //Sumatorio del precio total \n precioTotal += parseInt( precio); \n\n const contenedorServicio = document.createElement('DIV');\n contenedorServicio.classList.add('contenedor-servicio');\n const textoServicio = document.createElement('P');\n textoServicio.textContent = nombre; \n const precioServicio = document.createElement('DIV');\n precioServicio.innerHTML = `<span> Precio: </span> ${precio} €`;\n contenedorServicio.appendChild(textoServicio);\n contenedorServicio.appendChild(precioServicio);\n resumen.appendChild(contenedorServicio);\n });\n \n const totalTexto = document.createElement('H2');\n totalTexto.innerHTML = `<span> Total: </span> ${precioTotal} €`;\n resumen.appendChild(totalTexto); \n\n //Crear boton\n \n const botonReservar = document.createElement('BUTTON');\n botonReservar.classList.add('boton');\n botonReservar.textContent = \"Reservar cita\";\n botonReservar.onclick = reservarCita;\n \n resumen.appendChild(botonReservar); \n}", "function pintarActividades(pListaActividades){ //aqui repintamos la lista completa\n seccionActividades.innerHTML = \"\"; //aqui estoy borrando todas actividades antes pintadas para que se muestren las que pinto ahora\n\n if(pListaActividades.length !=0) {\n pListaActividades.forEach( actividad => { //aqui estamos recorriendo los elementos de la lista para ver cual cumple lo que buscamos\n pintarActividad(actividad); //aqui reutilizamos la funcion pintarActividad que se encuentra en la linea 133\n })\n\n } else{\n seccionActividades.innerHTML = \"<h2>No hay registros con esas condiciones</h2>\" \n }\n}", "function cargarActividad(){\n\n\tmostrarActividad(); \n\n\tcomienzo = getActual();\n\n}", "function outrosVeiculos(){\n\n $('.container-ofertas-secundarias').css({\n 'top': '380px'\n });\n}", "function comprovarEscriu () {\r\n this.validate=1;\r\n index=cerca(this.paraules,this.actual);\r\n this.capa.innerHTML=\"\";\r\n if (index != -1) {\r\n paraula = this.paraules[index];\r\n this.putImg (this.dirImg+\"/\"+paraula.imatge);\r\n this.capa.innerHTML += \"<br>\" + this.paraules[index].paraula.toUpperCase();\r\n this.putSound (paraula.so);\r\n this.ant = this.actual;\r\n this.actual = \"\";\r\n }\r\n else {\r\n this.putImg (\"imatges/error.gif\");\r\n this.putSound (\"so/error.wav\");\r\n this.actual = \"\";\r\n }\r\n}", "function cuadrado() {}", "function mostrar_estilos() {\n document.querySelector(\"#val_tamaño\").classList.remove('valor_tam');\n document.querySelector(\"#val_tamaño\").classList.add('valor_tam_off');\n \n document.querySelector(\"#btn_empezar\").classList.remove('btn_on');\n document.querySelector(\"#btn_empezar\").classList.add('btn_off');\n \n document.querySelector(\"#canvas\").classList.remove('canvas_off');\n document.querySelector(\"#canvas\").classList.add('canvas_on');\n \n document.querySelector(\"#btn_reiniciar\").classList.remove('btn_off');\n document.querySelector(\"#btn_reiniciar\").classList.add('btn_on'); \n\n document.querySelector(\"#img_logo\").classList.remove('btn_on');\n document.querySelector(\"#img_logo\").classList.add('btn_off'); \n\n document.querySelector(\"#titulo_jugador_uno\").classList.remove('btn_on');\n document.querySelector(\"#titulo_jugador_uno\").classList.add('btn_off'); \n\n document.querySelector(\"#titulo_jugador_dos\").classList.remove('btn_on');\n document.querySelector(\"#titulo_jugador_dos\").classList.add('btn_off'); \n\n document.querySelector(\"#nombre_jugador_dos\").classList.remove('btn_on');\n document.querySelector(\"#nombre_jugador_dos\").classList.add('btn_off'); \n\n document.querySelector(\"#nombre_jugador_uno\").classList.remove('btn_on');\n document.querySelector(\"#nombre_jugador_uno\").classList.add('btn_off'); \n\n document.querySelector(\"#j2\").classList.remove('btn_off');\n document.querySelector(\"#j2\").classList.add('btn_on'); \n\n document.querySelector(\"#j1\").classList.remove('btn_off');\n document.querySelector(\"#j1\").classList.add('btn_on'); \n }", "async function mostrarCarrinho() {\n atualizaCarrinho()\n document.querySelector(\".principal-cartoes\").innerHTML=\"\";\n document.getElementById(\"telaCarrinhoCompras\").style.display = \"flex\";\n document.getElementById(\"carrinhoCompras\").style.display = \"none\";\n await mostrarListaProdutosCarrinho(loja)\n}", "function chamarAperto(){\n commandAbortJob();\n commandSelectParameterSet(1);\n commandVehicleIdNumberDownload(\"ASDEDCUHBG34563EDFRCVGFR6\");\n commandDisableTool();\n commandEnableTool();\n}", "function refrescar (){\n changuito.verCompra(grillaCursos)\n changuito.verSubtotal(subtotal)\n $('#grillaContainer').removeClass('d-none') \n}", "function pipotron(texte){\n\tlet pipotron=true;\n\t\twhile(pipotron){\n\t\t// Affichage du menu\n\t\tconsole.log(\"\\n1 : Nombre de citations\");\n\t\tconsole.log(\"0 : Retour\");\n\t\toptionPipotron=prompt(\"Choisissez une option\");\n\t\t\tif (optionPipotron===\"1\"){\n\t\t\t\tnombreCitations=Number(prompt(\"Combien de citations ? (entre 1 et 5)\"));\n\t\t\t\tif (nombreCitations>=1&&nombreCitations<=5){\n\t\t\t\t\tfor (i=1;i<=nombreCitations;i++){\n\t\t\t\t\t\tconsole.log(phraseAleatoire(texte));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tconsole.log(\"Ce choix n'est pas valide\");\n\t\t\t\t};\n\t\t\t}\n\t\t\telse if (optionPipotron===\"0\"){\n\t\t\t\tpipotron=false;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Un autre choix indique de saisir un choix valide\n\t\t\t\tconsole.log(\"\\nMerci de choisir une option valide !\");\n\t\t\t}\n\t\t};\n}", "function calGuiasPostQueryActions(datos){\n\t//Primer comprovamos que hay datos. Si no hay datos lo indicamos, ocultamos las capas,\n\t//que estubiesen visibles, las minimizamos y finalizamos\n\tif(datos.length == 0){\n\t\tdocument.body.style.cursor='default';\n\t\tvisibilidad('calGuiasListLayer', 'O');\n\t\tvisibilidad('calGuiasListButtonsLayer', 'O');\n\t\tif(get('calGuiasFrm.accion') == \"remove\"){\n\t\t\tparent.iconos.set_estado_botonera('btnBarra',4,'inactivo');\n\t\t}\n\t\tresetJsAttributeVars();\n\t\tminimizeLayers();\n\t\tcdos_mostrarAlert(GestionarMensaje('MMGGlobal.query.noresults.message'));\n\t\treturn;\n\t}\n\t\n\t//Guardamos los par?metros de la ?ltima busqueda. (en la variable javascript)\n\tcalGuiasLastQuery = generateQuery();\n\n\t//Antes de cargar los datos en la lista preparamos los datos\n\t//Las columnas que sean de tipo valores predeterminados ponemos la descripci?n en vez del codigo\n\t//Las columnas que tengan widget de tipo checkbox sustituimos el true/false por el texto en idioma\n\tvar datosTmp = new Vector();\n\tdatosTmp.cargar(datos);\n\t\n\t\t\n\t\n\t\n\t//Ponemos en el campo del choice un link para poder visualizar el registro (DESHABILITADO. Existe el modo view.\n\t//A este se accede desde el modo de consulta o desde el modo de eliminaci?n)\n\t/*for(var i=0; i < datosTmp.longitud; i++){\n\t\tdatosTmp.ij2(\"<A HREF=\\'javascript:calGuiasViewDetail(\" + datosTmp.ij(i, 0) + \")\\'>\" + datosTmp.ij(i, calGuiasChoiceColumn) + \"</A>\",\n\t\t\ti, calGuiasChoiceColumn);\n\t}*/\n\n\t//Filtramos el resultado para coger s?lo los datos correspondientes a\n\t//las columnas de la lista Y cargamos los datos en la lista\n\tcalGuiasList.setDatos(datosTmp.filtrar([0,1,2,3,4,5,6],'*'));\n\t\n\t//La ?ltima fila de datos representa a los timestamps que debemos guardarlos\n\tcalGuiasTimeStamps = datosTmp.filtrar([7],'*');\n\t\n\t//SI hay mas paginas reigistramos que es as? e eliminamos el ?ltimo registro\n\tif(datosTmp.longitud > mmgPageSize){\n\t\tcalGuiasMorePagesFlag = true;\n\t\tcalGuiasList.eliminar(mmgPageSize, 1);\n\t}else{\n\t\tcalGuiasMorePagesFlag = false;\n\t}\n\t\n\t//Activamos el bot?n de borrar si estamos en la acci?n\n\tif(get('calGuiasFrm.accion') == \"remove\")\n\t\tparent.iconos.set_estado_botonera('btnBarra',4,'activo');\n\n\t//Estiramos y hacemos visibles las capas que sean necesarias\n\tmaximizeLayers();\n\tvisibilidad('calGuiasListLayer', 'V');\n\tvisibilidad('calGuiasListButtonsLayer', 'V');\n\n\t//Ajustamos la lista de resultados con el margen derecho de la ventana\n\tDrdEnsanchaConMargenDcho('calGuiasList',20);\n\teval(ON_RSZ); \n\n\t//Es necesario realizar un repintado de la tabla debido a que hemos eliminado registro\n\tcalGuiasList.display();\n\t\n\t//Actualizamos el estado de los botones \n\tif(calGuiasMorePagesFlag){\n\t\tset_estado_botonera('calGuiasPaginationButtonBar',\n\t\t\t3,\"activo\");\n\t}else{\n\t\tset_estado_botonera('calGuiasPaginationButtonBar',\n\t\t\t3,\"inactivo\");\n\t}\n\tif(calGuiasPageCount > 1){\n\t\tset_estado_botonera('calGuiasPaginationButtonBar',\n\t\t\t2,\"activo\");\n\t\tset_estado_botonera('calGuiasPaginationButtonBar',\n\t\t\t1,\"activo\");\n\t}else{\n\t\tset_estado_botonera('calGuiasPaginationButtonBar',\n\t\t\t2,\"inactivo\");\n\t\tset_estado_botonera('calGuiasPaginationButtonBar',\n\t\t\t1,\"inactivo\");\n\t}\n\t\n\t//Ponemos el cursor de vuelta a su estado normal\n\tdocument.body.style.cursor='default';\n}" ]
[ "0.6193593", "0.6058605", "0.58932954", "0.5822564", "0.57767314", "0.57481384", "0.57398385", "0.57309264", "0.5720382", "0.571154", "0.5704059", "0.5665257", "0.5665257", "0.56613165", "0.5660063", "0.56396943", "0.5632282", "0.56276846", "0.5619998", "0.56035376", "0.55731386", "0.5567357", "0.55617714", "0.55484563", "0.5544914", "0.55415213", "0.5536679", "0.5532112", "0.55261177", "0.5516871", "0.55105895", "0.55092454", "0.54957813", "0.5482191", "0.546931", "0.5467806", "0.5464361", "0.5461632", "0.54514813", "0.5448418", "0.5439647", "0.5437215", "0.54221725", "0.5421904", "0.5414443", "0.54137224", "0.5404925", "0.5401519", "0.53996575", "0.5388439", "0.5387955", "0.538087", "0.53750116", "0.53713137", "0.53707194", "0.5368111", "0.5366953", "0.536168", "0.53609854", "0.53570116", "0.5355899", "0.5355334", "0.53538936", "0.5350811", "0.5347525", "0.5345092", "0.5340194", "0.5335003", "0.53333724", "0.53331226", "0.5332572", "0.5327239", "0.53235006", "0.5320006", "0.5320006", "0.5319157", "0.5307387", "0.5301709", "0.5300353", "0.529501", "0.52884686", "0.52876514", "0.5285053", "0.52839726", "0.52836424", "0.5281209", "0.52810323", "0.5279444", "0.52766675", "0.5273679", "0.52730304", "0.52724373", "0.5270093", "0.52678734", "0.52669656", "0.5266074", "0.5265142", "0.52635586", "0.5263483", "0.5263432", "0.5256097" ]
0.0
-1
function to return my name
function myName() { return myName.kurt; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_my_name(name){\n return name;\n}", "function returnMyName() {\n return myName;\n}", "function returnMyName() {\n return myName;\n}", "function get_my_name(name){\n return name + \" Ubanell\";\n}", "function getName() {\n return \"Hai Aku Sam\";\n}", "function returnName() {\n return 'Stuart Hamblin';\n}", "function getName() { return name; }", "function myName() {\n return myName.eunice;\n }", "getName() {}", "function returnName(name) {\n console.log(name);\n }", "function myName(name) {\n return name;\n}", "function myName() {\n return myName.juvenal;\n}", "function myFullName() {\n return myFirstName('Srujan');\n }", "function getName() {\n var name = \"Beata\";\n return name;\n}", "function myName(name){\n\treturn \"Hello \" + name + \". \";\n}", "function getName() {\n\treturn name;\n}", "function myName() {\n return myName.josh\n}", "function MyNameReturn(name) {\n return \"Hello \" + name;\n}", "function getName() {\n return \"Hello my name is Arief muhamad\";\n}", "function myName() {\n return myName.darius;\n}", "function returnMyName () {\n return 'jacob'\n}", "function myLastName() {\n return myName.watson;\n}", "function result(name){ \n \treturn(myName)\n}", "function myName() {\n name = \"Jon Spalding\";\n return name;\n}", "function getSummonerName(){\n\n}", "function myName(name) {\n console.log(this);\n return name;\n}", "function getName() {\n return \"Hello, my name is Irvan\";\n}", "function name(name) {\n return name;\n }", "function myName() {\n return myName.serena;\n}", "getDisplayName() {}", "getFirstName() {}", "function myName6(name){\n\treturn name;\n}", "function getName(name) {\n return name\n}", "function myName () {\n return myName.daniel;\n}", "function inName() {\n\tnames = bio.name.split(\" \");\n\tfirstName = names[0].slice(0,1).toUpperCase() + names[0].slice(1).toLowerCase();\n\tlastName = names[1].toUpperCase()\n\tfullName = firstName + \" \" + lastName\n return fullName\n}", "getLastName() {}", "function getGivenName(n){\r\n return(n)\r\n}", "get name() {}", "get name() {}", "get name() {}", "get name() {}", "get name() {}", "get name() {}", "get name() {}", "get name() {}", "function myName() {\n return myName.Lea;\n\n}", "function myName() {\n\t\tvar name = 'Justin Hong';\n\t\tconsole.log(name);\n\t}", "function name(firstName, lastName) {\n var userName = firstName + \" \" + lastName;\n return userName;\n}", "getDisplayName() {\r\n var name = this.auth.currentUser.displayName;\r\n var nameArr = name.split(\" \");\r\n return nameArr[0];\r\n }", "function getName() {\n return \"John\";\n}", "function getPetName() {\n var petName = 'Hal'\n return petName;\n}", "function GetName() {\n return \"Hello, my name is jokosu\";\n}", "function name(name){\n return \"hi, my name is \" + name + \".\";\n}", "function name() {}", "function sayName(name) {\n return name;\n}", "function sayName(name) {\n console.log(this);\n return name;\n }", "function sayName(name) {\n console.log(this);\n return name;\n }", "function sayName(name) {\n console.log(this);\n return name;\n }", "getName() {\n\t\treturn `${this.get('firstName')} ${this.get('lastName')}`;\n\t}", "function sayName(name) {\n console.log(this);\n return name;\n }", "getName() {\n return _name.get(this);\n }", "getName() {\n return this._name || '';\n }", "function MyNameE() {\n return \"Carles\";\n}", "getPersonName() {\n return \"I_AM_DON!!\";\n }", "function getPetName() {\r\n var petName = \"Hal\";\r\n return petName;\r\n}", "function myname() {\n var fname = 'Dev';\n var lname = 'D';\n\n console.log(fname + lname)\n}", "function myName() {\n return myName.mark;\n}", "function getPetName() {\n var petName = 'Meow';\n return petName;\n}", "function myName2(name){\n\treturn \"Hello \" + name + \". \";\n}", "name(userId) {\n if (userId) {\n // find user from user id\n let user = Meteor.users.findOne(userId, {fields: {'username': 1}});\n // return username\n return user ? `@${user.username}`: '';\n }\n }", "function printName(yourName){\n console.log(yourName);\n}", "getName() {\n return `${this.name}`;\n }", "function name() {\n console.info(this.username);\n}", "function myLastName() {\n return myLastName.lim;\n}", "getName () {\n\t\treturn this.name;\n\t}", "function getName (req,res,next) {\n name.getFirstName(req,res,next);\n}", "function myName (name) {\n console.log(`My name is ${name}`);\n}", "function getName() {\n getUseInput(function(name) {\n userName = name;\n deleteAllLines();\n displayString(\"Hello \" + userName, 'main');\n });\n }", "getDisplayName(name) {\n let splitted = name.split(\"__\");\n if (splitted.length == 2) {\n return splitted[1];\n }\n return name;\n }", "function sayName(name) {\n console.log(this);\n return name;\n}", "function sayName(name) {\n console.log(this);\n return name;\n}", "getName() {\n return this.myName;\n }", "get full_name() {\n return `${this.name} (Now ${this.special_price} Gold)`\n }", "function printName() {\n var name = \"Luke Mason\" // hint.. add a parameter on this line :)\n console.log(name)\n}", "function makeFullName () { \n return nameIntro + firstName + \" \" + lastName; \n }", "get name(){\n\t\tconst first = this.firstName;\n\t\tconst last = this.lastName;\n\t\tif(first && last){\n\t\t\treturn `${first} ${last}`;\n\t\t}\n\t\treturn null;\n\t}", "function get_user_name() {\n switch (event_type) {\n case \"user\":\n var nameurl = \"https://api.line.me/v2/bot/profile/\" + user_id;\n break;\n case \"group\":\n var groupid = msg.events[0].source.groupId;\n var nameurl = \"https://api.line.me/v2/bot/group/\" + groupid + \"/member/\" + user_id;\n break;\n }\n\n try {\n // call LINE User Info API, get user name\n var response = UrlFetchApp.fetch(nameurl, {\n \"method\": \"GET\",\n \"headers\": {\n \"Authorization\": \"Bearer \" + CHANNEL_ACCESS_TOKEN,\n \"Content-Type\": \"application/json\"\n },\n });\n var namedata = JSON.parse(response);\n var reserve_name = namedata.displayName;\n }\n catch {\n reserve_name = \"not avaliable\";\n }\n return String(reserve_name)\n }", "getName() {\n return this._executeAfterInitialWait(() => this.currently.getAttribute('name'));\n }", "function getFullName() {\n return firstName + \" \" + lastName;\n }", "getNameAsIt(name, nameIsProper) {\n if(nameIsProper)\n return(name);\n else\n return(\"it\");\n }", "sayName(){\n console.log(`My name is ${this.name}.`)\n return this.name;\n }", "fullName() {\n return `Your full name is ${this.fName} ${this.lName}.`;\n }", "function lastName() {\n return lastName.dinkins;\n}", "function printMyName(name) {\n console.log(name);\n}", "function getpetName(){\n var petName = 'Ha';\n return petName;\n}", "function inName() {\n\tvar str = $('#name')[0].innerText;\n\tvar nameParts = str.split(' ');\n\tvar lastPart = nameParts.length - 1;\n\t// Initial cap for first name\n\tnameParts[0] = str.slice(0,1).toUpperCase() +\n\t\tnameParts[0].slice(1).toLowerCase();\n\t// All caps for last name\n\tnameParts[lastPart] = nameParts[lastPart].toUpperCase();\n\treturn nameParts.join(' ');\n}", "function wellcome (myName){\n\treturn(\"Hello \"+myName);\n}", "function getFirstName(name) {\n fName = name.split(\" \")[0];\n function helloFirstName() {\n console.log(\"Hello \" + fName );\n }\n return(helloFirstName);\n}", "function helloName( name ) {\n console.log('Hello,', name);\n return name;\n}", "getParticipantName(participant) {\n const selfInfo = this.contactManager.getLocalUser();\n let userName = this.contactManager.getDisplayName(participant.regId);\n if (participant.regId === selfInfo.regId) {\n userName = `${userName} (You)`;\n }\n return userName || participant.regId;\n }" ]
[ "0.8551962", "0.8371396", "0.8371396", "0.8235422", "0.81362486", "0.8101663", "0.80422556", "0.80303234", "0.8011707", "0.79279065", "0.78792614", "0.7867598", "0.78362143", "0.7829625", "0.77503145", "0.7733961", "0.76767516", "0.7653938", "0.76387036", "0.7614294", "0.7614072", "0.7606326", "0.7602759", "0.7571408", "0.75528824", "0.75400746", "0.75009245", "0.7497461", "0.7487549", "0.7454113", "0.7447222", "0.74417496", "0.74396056", "0.7411869", "0.7387114", "0.73691094", "0.7357343", "0.7357314", "0.7357314", "0.7357314", "0.7357314", "0.7357314", "0.7357314", "0.7357314", "0.7357314", "0.73454463", "0.73269224", "0.7320896", "0.7310972", "0.73029304", "0.72958183", "0.7282439", "0.72547424", "0.7243901", "0.72311985", "0.72265047", "0.72265047", "0.72265047", "0.72120726", "0.7201728", "0.71932054", "0.7174202", "0.7173625", "0.7163793", "0.7157696", "0.71483666", "0.71296316", "0.7124623", "0.7095022", "0.7094127", "0.7090785", "0.7069643", "0.7069022", "0.7067587", "0.7060396", "0.70540845", "0.70391387", "0.7033153", "0.7029226", "0.7023713", "0.7023713", "0.70130354", "0.70054823", "0.69886076", "0.69774467", "0.69730693", "0.6961021", "0.69594884", "0.6958245", "0.6955803", "0.69527555", "0.6952292", "0.69506985", "0.6948378", "0.69405746", "0.69360435", "0.6932338", "0.69294953", "0.6924826", "0.6924652" ]
0.7490612
28
gets all products from products table and displays to the console.
function displayItems(){ return new Promise(function(resolve, reject) { // do a thing, possibly async, then… //makes the query call var query = 'SELECT item_id, product_name, department_name, price, stock_qty FROM products' connection.query(query, function(err, items){ //display all the details to the page //console.log(items); //cycle through the items and display each item //console.log('id Product department price qty') for (var i =0; i < items.length; i++){ var print = items[i].item_id +' '; print += items[i].product_name +' '; print += items[i].department_name +' '; print += items[i].price +' '; print += items[i].stock_qty; console.log(print); } }); //connection.end(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayProducts(){\n console.log('printing product table... \\n');\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n // Log all results of the SELECT statement\n console.log('Products \\n---------------')\n for(var i = 0; i < res.length; i ++){\n console.log(\n 'ID: ' + res[i].id + '\\n' +\n 'Name: ' + res[i].name + '\\n' +\n 'Department: ' + res[i].department + '\\n' +\n 'Price: ' + (res[i].price/100).toFixed(2) + '\\n' +\n 'Quantity: ' + res[i].quantity + '\\n' +\n '---------------'\n );\n }\n shop();\n })\n}", "function viewProducts() {\n clearConsole();\n connection.query(\"SELECT * FROM products\", function (err, response) {\n if (err) throw err;\n displayInventory(response);\n userOptions();\n })\n}", "function displayProducts() {\n\tconnection.query(\"SELECT * FROM products\", function (err, res) {\n\t\tif (err) throw err;\n\n\t\tfor (var i = 0; i < res.length; i++) {\n\t\t\tconsole.log(\"Product Number: \" + res[i].item_id)\n\t\t\tconsole.log(\"Product: \" + res[i].product_name)\n\t\t\tconsole.log(\"Department: \" + res[i].department_name)\n\t\t\tconsole.log(\"Price: $\" + res[i].price)\n\t\t\tconsole.log(\"In Stock: \" + res[i].stock_quantity)\n\t\t\tconsole.log(\"\\n ---------------------- \\n\")\n\t\t}\n\n\n\n\t\t// callback function\n\t\tfirstPrompt()\n\t});\n}", "function displayProducts() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n console.table(res);\n });\n}", "function viewProducts() {\n connection.query(\"select * from products\", function (err, res) {\n if (err) throw err;\n console.log(\"\\n\");\n console.table(res);\n quit();\n });\n}", "function viewProducts(){\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n displayTable(res);\n promptManager();\n });\n}", "function viewProducts(){\n\n\t// Query: Read information from the products list\n\tconnection.query(\"SELECT * FROM products\", function(viewAllErr, viewAllRes){\n\t\tif (viewAllErr) throw viewAllErr;\n\n\t\tfor (var i = 0; i < viewAllRes.length; i++){\n\t\t\tconsole.log(\"Id: \" + viewAllRes[i].item_id + \" | Name: \" + viewAllRes[i].product_name +\n\t\t\t\t\t\t\" | Price: \" + viewAllRes[i].price + \" | Quantity: \" + viewAllRes[i].stock_quantity);\n\t\t\tconsole.log(\"-------------------------------------------------------------------\");\n\t\t}\n\n\t\t// Prompts user to return to Main Menu or end application\n\t\trestartMenu();\n\t});\n}", "function displayProducts() {\n console.log(\"Selecting all products...\\n\");\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n // Log all results \n for (var i = 0; i < res.length; i++) {\n console.log(\"ID: \" + res[i].id + \" | \" + \"Product: \" + res[i].product_name + \" | \" + \"Department: \" + res[i].department_name + \" | \" + \"Price: \" + res[i].price + \" | \" + \"Quantity: \" + res[i].stock_quantity);\n console.log('------------------------------------------------------------------------------------------------------------')\n };\n selectProducts(res)\n });\n}", "function viewProducts() {\n connection.query(\"SELECT * FROM products\", function(err, rows) {\n if (err) throw err;\n console.log(\"\");\n console.table(rows);\n console.log(\"=====================================================\");\n menu();\n });\n}", "function displayProducts() {\n // display product ID, name and price\n var query = \"SELECT * FROM products\";\n connection.query(query, function(err, res) {\n if (err) throw err;\n for (i = 0; i < res.length; i++) {\n console.log(\"Product ID: \" + res[i].item_id + \"\\nName: \" + res[i].product_name +\n \"\\nPrice: $\" + res[i].price + \"\\n\");\n }\n enterToShop();\n });\n}", "function viewProducts() {\n\tconnection.query(\"SELECT * FROM products\", function(err, res) {\n\t\tif (err) throw err;\n\t\tfor (var i = 0; i < res.length; i++) {\n\t\t\tconsole.log(\"---------------------------------------\" + \n\t\t\t\"\\nItem Id: \" + res[i].item_id + \"\\nProduct: \" + \n\t\t\tres[i].product_name + \"\\nPrice: \" + res[i].price + \n\t\t\t\"\\nQuantity in Stock: \" + res[i].stock_quantity);\n\t\t}\n\t\tstartOver();\n\t});\n}", "function viewProducts() {\n database.query(\"SELECT * FROM products\", function (err, itemData) {\n if (err) throw err;\n for (var i = 0; i < itemData.length; i++) {\n console.log(`\n----------------------------------------------------\nID: ${itemData[i].id} | Product: ${itemData[i].product_name} | Price: $${itemData[i].price} | Stock: ${itemData[i].stock_quantity}\n----------------------------------------------------\n`)\n }\n })\n return start();\n}", "function viewProducts() {\n connection.query(\"SELECT * FROM bamazon.products\", function (err, res) {\n if (err) throw err;\n console.log(\"\\n\")\n for (let i = 0; i < res.length; i++) {\n console.log(\"ID: \" + res[i].item_id + \" ---- Product: \" + res[i].product_name + \" ---- Price: $\" + res[i].price + \" ---- Quantity: \" + res[i].stock_quantity)\n }\n })\n start();\n}", "function viewProducts() {\n\tconnection.query(\"SELECT * FROM products\", function(err, res) {\n\t\tif(err) {\n\t\t\tthrow err\n\t\t};\n\t\tfor (var i =0; i < res.length; i++) {\n\t\t\tconsole.log(\"SKU: \" + res[i].item_id + \" | Product: \" + res[i].product_name \n\t\t\t\t+ \" | Price: \" + \"$\" + res[i].price + \" | Inventory: \" + res[i].stock_quantity)\n\t\t}\n\t\t// connection.end();\n\t\trunQuery();\n\t});\n}", "function displayProducts() {\n console.log(\"\\nShowing current inventory...\\n\".info);\n connection.query(\n \"SELECT * FROM products\", \n (err, res) => {\n if (err) throw err;\n console.table(res);\n promptManager();\n }\n )\n}", "function viewProducts() {\n connection.query(\"SELECT * FROM products\", function(error, results) {\n if (error) throw error;\n console.log(\"AVAILABLE ITEMS:\");\n for (var i = 0; i < results.length; i++) {\n console.log(results[i].id + ' | ' + results[i].product_name + ' | ' + '$'+results[i].price + ' | ' + results[i].stock_quantity);\n }\n });\n connection.end();\n}", "function productsTable() {\n\tdbConnection.query(\"SELECT * FROM products\", function(err, res){\n\t\tconsole.table(res);\n\t\tcustomerPrompt(res);\n\t});\n}", "function viewProducts() {\n connection.query(\"SELECT * FROM products\", function(err, results) {\n if (err) throw err;\n console.log(\"\\n\" + colors.yellow(\"---------------------PRODUCTS FOR SALE---------------------\") + \"\\n\");\n var table = new cliTable({ head: [\"ID\", \"Item\", \"Price\", \"Quantity\"] });\n for (var i = 0; i < results.length; i++) {\n table.push([results[i].id, results[i].productName, results[i].price, results[i].stockQuantity]);\n }\n console.log(table.toString() + \"\\n\");\n actionPrompt();\n });\n}", "function showProducts(){\n\tconnection.query('SELECT * FROM products', function(err, res){\n\t\tif (err) throw err;\n\t\tconsole.log('=================================================');\n\t\tconsole.log('=================Items in Store==================');\n\t\tconsole.log('=================================================');\n\n\t\tfor(i=0; i<res.length; i++){\n\t\t\tconsole.log('Item ID:' + res[i].item_id + ' Product Name: ' + res[i].product_name + ' Price: ' + '$' + res[i].price + '(Quantity left: ' + res[i].stock_quantity + ')')\n\t\t}\n\t\tconsole.log('=================================================');\n\t\tstartOrder();\n\t\t})\n}", "function queryAllProducts (){\n\tconnection.query(\"SELECT * FROM products\", function(err, res){\n\t\tfor (var i = 0; i < res.length; i++) {\n\t\t\tconsole.log(\"Id: \" + res[i].id + \" | \" + res[i].productName + \" | \" + \"$\" + res[i].price);\n\t\t}\n\t\tconsole.log(\"---------------------------------------------------\");\n\t});\n}", "function displayProducts() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n // Log all results of the SELECT statement\n console.table(res);\n takeOrder();\n });\n}", "function viewProducts(){\n connection.query(\"SELECT * FROM products\", function(err, response){\n if(err) throw err;\n printTable(response);\n })\n}", "function viewProducts() {\n\tconnection.query(\"SELECT * FROM products\", function(err, res) {\n\t\tif (err) throw err; \n\t\tconsole.table(res);\n\t\tchooseAction(); \n\t})\n}", "function listProducts(){\r\n\r\n\tconnection.query(\"SELECT * FROM products\", function(err, res) {\r\n\t\tif (err) throw err;\r\n\r\n\t\tconsole.table(res);\r\n\r\n\t});\r\n}", "function displayProducts() {\n connection.query(`\n SELECT item_id, product_name, price \n FROM products \n WHERE stock_quantity > 0`, (err, response) => {\n if(err) console.log(chalk.bgRed(err));\n response.forEach(p => p.price = `$ ${p.price.toFixed(2)}`);\n console.table(response);\n // connection.end();\n start();\n });\n}", "function viewProducts(){\n\n\tvar query = \"SELECT * FROM products\";\n\n\tconnection.query(query, function(err, res){\n\t\tif (err) throw err;\n\t\tconsole.log(\"ALL INVENTORY IN PRODUCTS TABLE\");\n\t\tfor(i=0; i< res.length; i++){\n\t\t\tconsole.log(\"---|| ID \"+ res[i].item_id+\" ---|| NAME: \"+ res[i].product_name+\" ---|| PRICE: $\"+ res[i].price + \" ---|| QUANTITY \" + res[i].stock_quantity);\n\t\t};\n\t\taskAction();\n\t})\n\n}", "function viewProducts() {\n connection.query(\"SELECT item_id, product_name, department_name, price, stock_quantity FROM products\", function (err, res) {\n console.log(\"Products for sale\");\n for (var i = 0; i < res.length; i++) {\n console.log(\"======================\");\n console.log(\"Id: \" + res[i].item_id + \" || Department: \" + res[i].department_name + \" || Product: \" + res[i].product_name + \" || Price($): \" + parseFloat(res[i].price).toFixed(2) + \" || In stock: \" + res[i].stock_quantity);\n }\n });\n displayChoices();\n}", "function viewAllProducts() {\n connection.query('SELECT * FROM products', function(error, res) {\n if (error) throw error;\n var table = new Table({\n head: ['item_Id', 'Product Name', 'Price Per', 'Stock Qty']\n });\n\n for (i = 0; i < res.length; i++) {\n table.push(\n [res[i].item_id, res[i].product_name, \"$\" + res[i].price, res[i].stock_quantity]\n );\n }\n console.log(table.toString());\n connection.end();\n });\n}", "function products(){\n connection.query(\"SELECT * FROM products\", (err,result) =>{\n if (err) throw err;\n\n console.table(result);\n start();\n })\n}", "function viewProducts(){\n console.log(\"\\nView Every Avalailable Product in format:\");\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n console.log(\"'ItemID-->Product Description-->Department Name-->Price-->Product Quantity'\\n\");\n for (var i = 0; i < res.length; i++) {\n console.log(\"Item# \" + res[i].item_id + \"-->\" + res[i].product_name \n + \"-->\" + res[i].department_name + \"-->\" + res[i].price \n + \"-->\" + res[i].stock_quantity);\n }\n // console.table(\"\\nProducts Available:\",[\n // res\n // ])\n })\n setTimeout(function() { startManager(); }, 200);\n}", "function viewProducts() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n\n // create an array to hold our formatted res data and loop through the res data\n var products = [];\n res.forEach(element => {\n products.push(\"ID#: \" + element.item_id + \" | Product Name: \" + element.product_name + \" | Price: $\" + element.price + \" | Quantity: \" + element.stock_quantity);\n }); // end .forEach\n\n // display the items\n console.log('\\n');\n console.log('《 ALL AVAILABLE PRODUCTS 》');\n console.log(\" -------------------------\" + '\\n');\n products.forEach(element => {\n console.log(element);\n }); // end .forEach\n console.log('\\n');\n start();\n }); // end .query\n} // end viewProductsFunction", "function viewProducts() {\n connection.query('SELECT * FROM products', function(err, results){ \n if (err) throw err;\n displayForManager(results);\n promptManager(); \n })\n}", "function showProducts() {\n connection.query(\"SELECT * FROM products ORDER BY 3\", function (err, res) {\n if (err) throw err;\n console.log(\"\\nAll Products:\\n\")\n var table = new Table({\n head: ['ID'.cyan, 'Product Name'.cyan, 'Department'.cyan, 'Price'.cyan, 'Stock'.cyan]\n , colWidths: [5, 25, 15, 10, 7]\n });\n res.forEach(row => {\n table.push(\n [row.item_id, row.product_name, row.department_name, \"$\" + row.price, row.stock_quantity],\n );\n });\n console.log(table.toString());\n console.log(\"\\n~~~~~~~~~~~~~~~~~\\n\\n\");\n start();\n });\n}", "function showProducts() {\n console.log(\"\\nDisplaying All Products....\");\n connection.query(\"SELECT item_id, product_name, price, stock_quantity FROM products \", function (err, res) {\n if (err) throw err;\n // for (var i = 0; i<res.length; i++)\n console.log(JSON.stringify(res) + \"\\n\");\n startMenu();\n });\n}", "function viewProducts(){\n var query = connection.query(\"SELECT ID, Product_Name , Price, Stock_QTY FROM products;\", function(err, res) {\n console.log(\"\");\n console.table(res);\n console.log(\"\");\n \n managerAsk();\n });\n }", "function viewProducts() {\n\tconnection.query('SELECT * FROM Products', function(err, result) {\n\t\tcreateTable(result);\n\t})\n}", "function viewProducts() {\n connection.connect();\n connection.query(\"SELECT * FROM products\", function (err, rows, fields) {\n if (err) throw err;\n console.log(rows)\n });\n connection.end();\n}", "function readProducts() {\n console.log(\"Products Available...\\n\");\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n else { \n // loop through id, product name, price and display \n for (var i = 0; i < res.length; i++) {\n console.log(\"ID: \" + res[i].id);\n console.log(\"NAME: \" + res[i].product_name);\n console.log(\"PRICE: \" + res[i].price);\n console.log(\" \");\n }\n select();\n }\n }); \n }", "function listProducts() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n\n for (var i = 0; i < res.length; i++) {\n var products = res[i];\n\n var productList = [\n \"Product ID: \" + products.id,\n \"Product: \" + products.product_name,\n \"Department: \" + products.department_name,\n \"Price: $\" + products.price,\n \"Stock Quantity: \" + products.stock_quantity\n ].join(\"\\n\");\n\n console.log(\"\\n\");\n console.log(productList);\n }\n });\n promptCustomer()\n }", "function viewProducts() {\n var query = \"SELECT * from products\";\n connection.query(query, function (error, results) {\n if (error) throw error;\n\n //Print updated table everytime initialized\n console.table(results)\n\n //Return to main screen\n initialize()\n })\n}", "function viewAllProducts() {\n //connection/callback function\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n console.log(\"All items currently available in marketplace:\\n\");\n console.log(\"\\n-----------------------------------------\\n\");\n for (var i = 0; i < res.length; i++) {\n console.log(\"Id: \".bold + res[i].item_id + \" | Product: \".bold + res[i].product_name + \" | Department: \".bold + res[i].department_name + \" | Price: \".bold + \"$\".bold +res[i].price + \" | QOH: \".bold + res[i].stock_quantity);\n }\n console.log(\"\\n-----------------------------------------\\n\");\n });\n\n}", "function showProducts() {\n connection.query(\"SELECT * FROM `products`\", function(err, res) {\n var table = new Table({\n head: [\"ID\", \"Product\", \"Department\", \"Price\", \"Stock\"],\n colWidths: [4, 18, 17, 10, 7]\n });\n\n for (var i = 0; i < res.length; i++) {\n table.push([\n res[i].item_id,\n res[i].product_name,\n res[i].department_name,\n res[i].price,\n res[i].stock_quantity\n ]);\n }\n console.log(\"\\n\" + table.toString() + \"\\n\");\n });\n}", "function saleProducts() {\n console.log(\"View Sale Products\");\n connection.query(\"SELECT * FROM `products`\", function(queryError, response) {\n if (queryError)\n throw queryError;\n response.forEach(function(row) {\n console.log(\"id = \", \"'\", row.id, \"'\",\n \"Product Name = \", \"'\", row.product_name, \"'\",\n \"Price \", \"'\", row.price, \"'\",\n \"Quantity \", \"'\", row.stock_quantity, \"'\")\n });\n })\n }", "function displayProducts(){\n connection.query(\"SELECT * FROM products\", function(err, res){\n if (err) throw err;\n tableFormat(res);\n })\n\n}", "function products() {\n var query = connection.query(\"SELECT item_id, department_name, product_name, price, stock_qty, product_sales FROM products ORDER BY item_id\", function(err, results, fields) {\n if(err) throw err;\n console.log(\"\\r\\n\" + \" - - - - - - - - - - - - - - - - - - - - - - - - \" + \"\\r\\n\");\n console.log(\"\\r\\n\" + chalk.yellow(\"-------- \" + chalk.magenta(\"BAMAZON PRODUCTS\") + \" ----------\") + \"\\r\\n\");\n var productsList = [];\n console.table(results);\n for(obj in results) {\n productsList.push(results[obj].products);\n }\n return managerDashboard(productsList);\n })\n}", "function displayProducts() { \n\n connection.query(\"SELECT * FROM products\", function (err, res) {\n console.log(\"=====================================================================\");\n if (err) throw err;\n // Log all results of the SELECT statement\n for (var i = 0; i < res.length; i++) {\n console.log(res[i].item_id + \" | \" + res[i].product_name + \" | \" + res[i].department_name + \" | \" + res[i].price + \"|\" + res[i].stock_quantity);\n }\n console.log(\"=====================================================================\");\n userWants();\n\n\n })\n}", "function showAllProducts() {\n var sql = 'SELECT ?? FROM ??';\n var values = ['*', 'products'];\n sql = mysql.format(sql, values);\n connection.query(sql, function (err, results, fields) {\n if (err) throw err;\n for (let i = 0; i < results.length; i++) {\n console.log(` \\nItem ID: ${results[i].item_id} Name: ${results[i].product_name} Department: ${results[i].department_name} Price: ${results[i].price} Stock Quantity: ${results[i].stock_quantity} \\n-------------------------------------------------------------------------------------- \\n`);\n }\n startingQuestions();\n });\n}", "function listProducts() {\n\n con.query(\"SELECT * FROM products\", (err, result, fields) => {\n if (err) throw err;\n result.forEach(element => {\n table.push(\n [element.item_id, element.product_name, \"$\" + element.price, element.stock_quantity]\n )\n });\n console.log(chalk.green(table.toString()))\n // empty table to be able to push updated stock to it\n table.splice(0, table.length);\n\n startUp();\n })\n}", "function viewProducts () {\n con.query(\"SELECT * from vw_ProductsForSale\", function (err, result) {\n if (err) {\n throw err;\n }\n else {\n var table = new Table({\n\t\t head: ['Product Id', 'Product Name', 'Department','Price','Quantity'],\n\t\t style: {\n\t\t\t head: ['blue'],\n\t\t\t compact: false,\n\t\t\t colAligns: ['center','left','left','right','right']\n\t\t }\n\t });\n\n\t //loops through each item in the mysql database and pushes that information into a new row in the table\n\t for(var i = 0; i < result.length; i++) {\n\t\t table.push(\n\t\t\t [result[i].Product_Id, result[i].Product_Name, result[i].Department, result[i].Price, result[i].Quantity]\n\t\t );\n\t }\n \n console.log(table.toString());\n runManageBamazon();\n }\n });\n }", "function displayAllProducts() {\n connection.query(\"SELECT * FROM PRODUCTS\", function(err, res){\n res.forEach(function(row) {\n console.log(row.id, row.product_name, row.department_name, row.price, row.stock_quantity);\n });\n\n promptUser(res);\n }); \n}", "function viewProducts() {\n connection.query(\"SELECT item_id, product_name, price, stock_quantity FROM products\", function (err, res) {\n if (err) throw err;\n console.log(\"\");\n console.table(res);\n connection.end();\n });\n}", "function viewProducts() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n \n //clear out products array\n tableArray = [products];\n var tempArray = [];\n\n //goes through items and lists products in table array\n for (var i = 0; i < res.length; i++) {\n tempArray = [res[i].id, res[i].product_name, res[i].department_name, res[i].price, res[i].stock_quantity];\n tableArray.push(tempArray);\n }\n console.log(\"\\n\" + table(\n tableArray\n ) + \"\\n\")\n doWhat();\n });\n}", "function viewProducts() {\n console.log('Here is the current inventory: ');\n var table = new Table({\n head: ['Item ID', 'Product Name', 'Price', 'Quantity']\n });\n connection.query(\"SELECT * FROM products\", function (err, res) {\n for (let i = 0; i < res.length; i++) {\n table.push(\n [res[i].item_id, res[i].product_name, res[i].price, res[i].stock_quantity]\n );\n }\n console.log(table.toString());\n console.log('\\n*******************');\n managerOptions();\n })\n}", "function ShowProducts(){ \r\n\tconnection.query('SELECT * FROM product_name', function(err, res){ \r\n\t\tif (err) throw err; \r\n\t\tconsole.log('********************************************************');\r\n\t\tconsole.log('********************************************************');\r\n\t\tconsole.log('** Bamazon Mercantile **');\r\n\t\tconsole.log('** Product list **'); \r\n\t\tconsole.log('********************************************************');\r\n\t\tconsole.log('********************************************************'); \r\n\r\n\t\tfor(i=0;i<res.length;i++){ \r\n\t\t\tconsole.log('Product ID:' + res[i].item_id + ' Product: ' + res[i].product_name + ' Price: ' + '$' + res[i].price + '(Quantity left: ' + res[i].stock_quantity + ')') \r\n\t\t} \r\n\t\tconsole.log('---------------------------------------------------------'); \r\n\t\tPlaceOrder(); \r\n\t\t}) \r\n}", "function viewProducts() {\n connection.query(\"SELECT item_id, product_name, price, stock_quantity FROM products\", function (err, res) {\n //error occurs\n if (err) {\n throw err;\n }\n\n console.table(\"\\nInventory\", res);\n returnToMenu();\n });\n}", "function productItems() {\n\tconnection.connect(function(err) {\n\n\t\tconnection.query(\"SELECT * FROM products\", function(err, res) {\n\t\tif (err) throw err\n\t\telse console.table(res , \"\\n\");\n\t\tproductId();\n\t\t});\n\t});\n}", "function showProducts() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n //If Error Occurs\n if (err) {\n throw err;\n }\n\n console.log(\"Our Products: \");\n console.log(\"-----------------\");\n for (var i = 0; i < res.length; i++) {\n console.log(\"ID - \" + res[i].item_id + \" Product - \" + res[i].product_name + \" Price - \" + res[i].price);\n }\n console.log(\"------------------------\");\n\n mainMenu();\n });\n\n}", "function displayProducts(){\n \n\tconnection.query(sql, function(err, data) {\n\t if (err) {\n\t console.log(err);\n\t }\n\n\t var items = '';\n\t\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\t\titems = '';\n\t\t\t\titems += 'ID: ' + data[i].item_id + ' | ';\n\t\t\t\titems += 'Product: ' + data[i].product_name + ' | ';\n\t\t\t\titems += 'Dept: ' + data[i].department_name + ' | ';\n\t\t\t\titems += '$' + data[i].price + ' | ';\n\t\t\t\titems += 'Quantity: ' + data[i].stock_quantity;\n\t\t console.log(\"------------------------------------------------------------------------\");\n\t console.log(items);\n\t\t\t};\n\n\t\tpurchase();\n\n\t});\n\n}", "function showProducts(){\n connection.query(\"SELECT * FROM products\", function(err, res){\n if(err) throw err;\n console.log(\"\\nCurrent Products: \".title);\n // Stores the item_id of the last product in database\n greatestId = res[res.length - 1].item_id;\n var table = [];\n // Loops through data and creates new row for each product \n for(var i = 0; i < res.length; i++){\n var row = new ConsoleRow(res[i].item_id,res[i].product_name, res[i].price);\n table.push(row);\n }\n console.table(table);\n orderPrompt(greatestId);\n })\n}", "function viewProducts() {\n console.log(\"viewProducts running\");\n connection.query(\n \"SELECT * FROM products\",\n function(error, results, fields) {\n if (error) throw error;\n\n console.log(\"Available Products:\");\n for (var n=0; n < results.length; n++) {\n product = results[n];\n productId = product.item_id;\n productName = product.product_name;\n productPrice = parseInt(product.price);\n productQuantity = parseInt(product.stock_quantity);\n\n string = productId + \" | \" + productName + \" | $\" + productPrice + \" | \" + productQuantity;\n console.log(string);\n }\n } // close callback func\n ); // close SQL query\n // setTimeout(userPrompt,1000 * .1); // doesn't run until displayProducts() finishes printing to console\n} // close viewProducts()", "function viewProducts() {\n connectionDB.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n // Log all results of the SELECT statement\n //console.log(res);\n var tableFormat = new AsciiTable('PRODUCT LIST');\n tableFormat.setHeading('ITEM ID', 'PRODUCT NAME', 'PRICE', 'QUANTITES');\n for (var index in res) {\n\n tableFormat.addRow(res[index].item_id, res[index].product_name, res[index].price, res[index].stock_quantity);\n }\n console.log(tableFormat.toString());\n\n\n });\n}", "function queryAllProducts() {\n\n console.log();\n console.log(\"ALL AVAILABLE ITEMS:\");\n console.log(\"-----------------------------------\");\n connection.query(\"SELECT * FROM products\", function(err, res) {\n for (var i = 0; i < res.length; i++) {\n console.log(res[i].item_id + \" | \" + res[i].product_name + \" | \" + res[i].price);\n }\n console.log(\"-----------------------------------\\n\");\n });\n}", "function displayItems() {\n\tvar query = \"SELECT * FROM products\";\n\tconnection.query(query, (err,res) => {\n\t\tif (err) {console.log(err)};\n\t\tconsole.log(JSON.stringify(res));\n\t})\n}", "function displayProducts() {\n console.log(\"Hello & Thanks for shopping @ Bamazon!\\n\")\n connection.query(\"SELECT * FROM products\", function(err,res) {\n if (err) throw err;\n // callback function that displays the table\n showTable(res);\n console.log(\"\\n\");\n // callback function that prompts the user questions\n promptPurchase();\n });\n}", "function showProducts() {\n connection.query('SELECT * FROM products', function (error, res) {\n for (var i = 0; i < res.length; i++) {\n console.log('\\n Beer brand: ' + res[i].product_name + \" | \" + 'Department: ' + res[i].department_name + \" | \" + 'Price (6-pack): ' + res[i].price.toString() + \" | \" + 'Stock: ' + res[i].stock_quantity.toString());\n } \n console.log(\"----------------\");\n productDetails();\n });\n\n}", "function displayProducts() {\n connection.query(\"select item_id as ID,product_name as Product,price as Price,stock_quantity as Quantity from products; \", function (error, respDB) {\n if (error) throw error;\n console.table(respDB);\n askIfContinuing();\n });\n}", "function displayItems() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) {\n throw err;\n } else {\n console.table(res);\n }\n shopping();\n \n });\n \n}", "function products() {\n console.log(\"\\n----------WELCOME TO BAMAZON!!!----------\");\n \n connection.query('SELECT * FROM products', function (err, res) {\n if (err) throw err;\n\n for (var i = 0; i < res.length; i++) {\n console.log(\n \"Item ID: \" + res[i].item_id +\n \"\\nProduct Name: \" + res[i].product_name +\n \"\\nDepartment Name: \" + res[i].department_name +\n \"\\nPrice: \" + res[i].price +\n \"\\nStock Quantity: \" + res[i].stock_quantity +\n \"\\n------------------------------------------\"\n );\n }\n start();\n });\n}", "function displayAll() {\n connection.query(\"SELECT id, product_name, price FROM products\", function(err, res){\n if (err) throw err;\n console.log(\"\");\n console.log(' WELCOME TO BAMAZON ');\n var table = new Table({\n head: ['Id', 'Product Description', 'Price'],\n colWidths: [5, 50, 7],\n colAligns: ['center', 'left', 'right'],\n style: {\n head: ['cyan'],\n compact: true\n }\n });\n for (var i = 0; i < res.length; i++) {\n table.push([res[i].id, res[i].product_name, res[i].price]);\n }\n console.log(table.toString());\n // productId();\n }); //end connection to products\n}", "function showProd(){\n\n //Sql statement\n var sql = \"select * from products\";\n conn.query(sql, (err, res) => {\n\n //If error throw error\n if (err) throw err;\n\n //If response length is greater than zero\n if (res.length > 0) {\n\n //Show welcome message and products\n console.log(\"\\nHere are all the current products and their associated information:\");\n console.log(\"\\n ID | Name | Department | Price | Quantity In Stock\");\n console.log(\" --------------------------------------------------\");\n for (i = 0; i < res.length; i++) {\n console.log(' ' +\n res[i].item_id +\n \" | \" +\n res[i].product_name +\n \" | \" +\n res[i].department_name +\n \" | \" +\n '$ '+ parseFloat(res[i].price) +\n \" | \" +\n res[i].stock_quantity\n );\n } \n }\n //Back to the menu\n main();\n })\n}", "function loadProducts() {\n connection.query(\"SELECT item_id, product_name, department_name, price FROM products\", function (err, res) {\n if (err) throw err\n\n //display items in a table\n console.table(res);\n\n //then prompt the customer to choice of item\n promptCustomerOrder(res)\n });\n}", "function readProducts() {\n console.log(\"Selecting all products...\\n\");\n connection.query(\"SELECT * FROM products\", function(err, res) {\n console.log(\"Welcome to Bamazon Prime\".blue.bgWhite);\n console.log(\"-----------------------------------------------------------------------------\".blue);\n for (var i = 0; i < res.length; i++) {\n console.log(\"Item ID: \".yellow +res[i].item_id + \" |Product: \".yellow + res[i].product_name + \" |Dept: \".yellow + res[i].department_name + \" |Price: \".yellow + res[i].price + \" |Qty: \".yellow + res[i].stock_quantity);\n console.log(\"-----------------------------------------------------------------------------\".blue);\n }\n if (err) throw err;\n\n connection.end();\n });\n}", "function readProducts() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n \n // instantiate\n var table = new Table({\n head: ['Item ID', 'Product Name', 'Price']\n , colWidths: [10, 20, 20]\n });\n \n // loop through the response and print out each row into the table\n for (var i = 0; i < res.length; i++) { \n table.push(\n [res[i].item_id, res[i].product_name, `$`+res[i].price]\n );\n }; // ENDS for loop\n\n console.log(\"\\n\" + table.toString());\n welcomePurchase();\n\n }); // ENDS response\n}", "function viewAll() {\n connection.query(\"SELECT * FROM products\",\n function (err, res) {\n if (err) throw err;\n console.table(res);\n connection.end();\n }\n );\n}", "function dispAll() {\n\n // create a new formatted cli-table\n var table = new Table({\n head: [\"ID\", \"Name\", \"Department\", \"Price\", \"Qty Available\"],\n colWidths: [8, 40, 22, 12, 12]\n });\n\n // get the data to load the product table, load it and show it\n connection.query(\"SELECT item_id, product_name, department_name, price, stock_quantity FROM products LEFT JOIN departments on products.department_id = departments.department_id ORDER BY department_name, product_name;\", function (err, rows, fields) {\n\n if (err) throw err;\n\n console.log(\"\\n--- Bamazon Product Catalog ---\");\n\n for (var i = 0; i < rows.length; i++) {\n table.push([rows[i].item_id, rows[i].product_name, rows[i].department_name, rows[i].price, rows[i].stock_quantity]);\n }\n\n console.log(table.toString());\n\n // go to the actual purchasing part of the app\n buyProduct();\n\n });\n\n}", "function displayProducts() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n for (var i = 0; i < res.length; i++) {\n console.log(\"ID: \" + res[i].item_id + \" | \" \n + \"Product: \" + res[i].product_name + \" | \" \n + \"Department: \" + res[i].department_name + \" | \" \n + \"price: \" + res[i].price + \" | \" \n + \"QTY: \" + res[i].stock_quantity);\n }\n inquireForPurchase();\n\n });\n}", "function displayItems()\n{\n\t//Select All from (products) table within (bamazon) DB\n\tconnection.query(\"SELECT * FROM products\", function(err, res)\n\t{\n\n\t\tif(err) throw err;\n\n\t\t//Display all products in table by looping through each row inside table\n\t\tfor(var i = 0; i < res.length; i++)\n\t\t{\n\t\t\tconsole.log(\"ID: \" + res[i].item_id + \" | \" +\n\t\t\t\t\t\t\"Product Name: \" + res[i].product_name + \" | \" +\n\t\t\t\t\t\t\"Category: \" + res[i].department_name + \" | \" +\n\t\t\t\t\t\t\"Price: \" + res[i].price );\n\t\t}\n\n\t\tconsole.log(\"-----------------------------------------------------------------\\n\");\n\n\t\t//Allow Customer to make purchase\n\t\tbuy();\n\n\t});\n}", "function listProducts () {\n console.log(\"Here's what we have in stock: \");\n connection.query(\"SELECT * FROM products\", function(err, response) {\n if (err) throw err;\n for (var i = 0; i < response.length; i++) {\n console.log(\"| ID: \" + response[i].item_id + \" | \" + response[i].product_name + \" | $\" + response[i].price)\n }\n promptUser();\n })\n}", "function readProducts() {\n console.log(\"Selecting all products...\\n\");\n connection.query(\"SELECT * FROM products\", function(error, productList){\n if (error) throw error;\n // Log the productList array which contains the data from products table that was queried by using the SELECT SQL statement\n console.log('----------------------------------------------------------');\n console.log(productList);\n console.log('----------------------------------------------------------');\n chooseProduct(productList);\n });\n}", "function displayItems() {\n\n\tconnection.query(\"SELECT * from products\", function(err, res) {\n\t\tif (err) throw err;\n\t\t\n\t\tconsole.log(\"\\n\");\n\t\tconsole.table(res);\n\t\t\n\t\t//This is a recursive call. Using here by intention assuming this code will not be invoked again and again. Other options could've \n\t\t//been used which avoid recursion.\n\t\tdisplayMgrOptions();\n\t});\n}", "function viewProducts(){\n connection.query(\"SELECT * FROM products\", function(err, results){\n if (err) throw err;\n for (var i = 0; i < results.length; i++){\n table.push(\n [\n results[i].item_id,\n results[i].product_name,\n results[i].department_name,\n results[i].price,\n results[i].stock_quantity\n ]);\n }\n console.log(table.toString());\n start();\n })\n}", "function displayProducts() {\n // include ids names prices\n connection.query(selectQuery, function (err, res) {\n if (err) throw (err);\n inquirer.prompt([\n {\n type: 'list',\n message: '',\n choices: function () {\n var choiceArray = [];\n let productLabel = '';\n for (let i = 0; i < res.length; i++) {\n productLabel = res[i].item_id + '. ' + res[i].product_name + ' - $' + res[i].price\n choiceArray.push(productLabel)\n }\n choiceArray.push(new inquirer.Separator(), 'Main Menu')\n return choiceArray;\n },\n name: 'products'\n }\n ]).then(function (answer) {\n if (answer.products === 'Main Menu') return mainMenu()\n let selected = answer.products\n productSelected(selected.slice(0, 1))\n })\n })\n}", "function displayRecords() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n for (var i = 0; i < res.length; i++) {\n console.log(res[i].id + \" | \" + res[i].flavor + \" | \" + res[i].price + \" | \" + res[i].quantity);\n }\n console.log(\"-----------------------------------\");\n });\n}", "function getProducts(){\n\n connection.connect(err => {\n if(err) {\n connection.end();\n throw err\n };\n\n console.log(\"Connection Successful!\");\n\n var query = \"SELECT * FROM PRODUCTS\";\n\n connection.query(query,function(err,data){\n\n if(err) throw err;\n\n for(var i = 0; i < data.length; i++){\n console.log(\"*---------------------------------*\");\n\n console.log(`Item ID: ${data[i].ITEM_ID}`);\n console.log(`Product Name: ${data[i].PRODUCT_NAME}`);\n console.log(`Department Name: ${data[i].DEPARTMENT_NAME}`);\n console.log(`Price: ${data[i].PRICE}`);\n console.log(`Stock Quantity: ${data[i].STOCK_QUANTITY}`);\n\n console.log(\"*---------------------------------*\\n\");\n }\n\n // We ask the customer what product they will like to purchase\n userInput();\n\n })\n \n // connection.end();\n })\n\n }", "function readProducts() {\n console.log(\"Selecting all products...\\n\");\n connection.query(\"SELECT * FROM products\", function (err, res) {\n //displays all the products\n //callback(res);\n if (err) throw err;\n displayAll(res);\n anotherAction();\n });\n}", "function products() {\n connection.query('SELECT * FROM products', function(err, res) {\n console.table(res);\n console.log(chalk.yellow(\"***Enter 'Q' and press enter twice to exit store***\"));\n customerOrder();\n });\n}", "function list() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n let table = new Table({\n head: ['Product ID', 'Product Name', 'Price', 'Stock', 'Department'],\n color: [\"blue\"],\n colAligns: [\"center\"]\n })\n res.forEach(function(row) {\n let newRow = [row.item_id, row.product_name, \"$\" + row.price, row.stock_quantity, row.department_name]\n table.push(newRow)\n })\n console.log(\"Current Bamazon Products\")\n console.log(\"\\n\" + table.toString())\n menu();\n })\n}", "function displayProducts(products) {\n let html = \"\";\n products.forEach((product) => {\n html += renderProduct(product, \"cart\");\n });\n document.querySelector(\"#products\").innerHTML = html;\n}", "function readAllProducts(){\n\tconnection.query(\"SELECT *FROM products \", function (error, result){\n\t\tif(error) throw error;\n\t\tconsole.log(\"\\nCheck out the newest additions to the Bamazon catalogue below:\");\n\t\t//if no error show the products\n\t\tfor(var i = 0; i< result.length; i++){\n\t\t\tconsole.log(\"New product: \" + result[i].product_name + \", Item ID: \" + result[i].item_id, \", Price: $\" + result[i].price \n\t\t\t\t+ \"\\n Department:\" + result[i].department_name + \", Remaining Stock: \" + result[i].stock_quantity);\n\t\t// console.log(result);\n\t\t// connection.end();\n\t\t}\n\t});\n}", "function displayProducts() {\n \n // query/get info from linked sql database/table\n let query = \"SELECT * FROM products\";\n connection.query(query, function (err, res) {\n if (err) throw err;\n\n // map the data response in a format I like, and make it show the info I need it show\n // show the customer the price\n let data = res.map(res => [` ID: ${res.id}\\n`, ` ${res.product_name}\\n`, ` Price: $${res.price} \\n`]);\n console.log(`This is what we have for sale \\n\\n${data}`);\n console.log(\"-----------------\");\n\n userItemChoice();\n quitShopping();\n\n });\n}", "function displayProducts() {\n connection.query(\"SELECT product_name AS 'Product', department_name AS 'Department', price AS 'Sales Price', stock_quantity AS 'In Stock' FROM products\",\n (err, results, fields) => {\n if (err) {\n throw err;\n }\n console.table(results);\n// .map runs a function on every item on the array and returns a new array\n const productArray = results.map(itemInArray => itemInArray.Product);\n promptCustomer(productArray);\n })\n}", "function dispAll() {\n\n // create a new formatted cli-table\n var table = new Table({\n head: [\"ID\", \"Name\", \"Department\", \"Price\", \"Qty Available\"],\n colWidths: [8, 40, 22, 12, 12]\n });\n\n // get the data to load the product table, load it and show it; note that since the database is normalized, we JOIN with the departments table\n // to get the actual department name\n connection.query(\"SELECT item_id, product_name, department_name, price, stock_quantity FROM products LEFT JOIN departments on products.department_id = departments.department_id ORDER BY department_name, product_name;\", function (err, rows, fields) {\n\n if (err) throw err;\n\n console.log(\"\\n--- View All Products for Sale ---\");\n\n for (var i = 0; i < rows.length; i++) {\n table.push([rows[i].item_id, rows[i].product_name, rows[i].department_name, rows[i].price, rows[i].stock_quantity]);\n }\n\n console.log(table.toString());\n\n // ask the user if they want to continue\n doAnother();\n\n });\n\n}", "function displayItems() {\n\tconnection.query(\"SELECT * FROM products\", function(error, response) {\n\t\tif (error) throw error;\n\t\t//create new table to push product info into\n\t\tvar itemsTable = new Table({\n\t\t\thead: [\"Item ID\", \"Product Name\", \"Price\", \"Quantity\"]\n\t\t});\n\t\t//loop through response and push each items info into table\n\t\tfor (var i = 0; i < response.length; i++) {\n\t\t\titemsTable.push([response[i].item_id, response[i].product_name, \"$ \"+response[i].price, response[i].stock_quantity]);\n\t\t}\n\t\t//display table\n\t\tconsole.log(itemsTable.toString());\n\t\t//ask if user would like to return to menu\n\t\treturnToMenu();\n\t});\n}", "function displayProducts() {\n let query = \"SELECT * FROM products\";\n connection.query(query, function (err, res) {\n\n if (err) throw err;\n\n var table = new Table({\n head: [\"Product ID\", \"Product Name\", \"Price\", \"Stock Available\"],\n colWidths: [15, 25, 15, 25]\n });\n\n for (let i = 0; i < res.length; i++) {\n\n table.push(\n [res[i].item_id, res[i].product_name, res[i].price, res[i].stock_quantity]);\n\n }\n\n console.log(table.toString());\n\n //console.log(`Product ID: ${res[i].item_id}`);\n //console.log(`Product Name: ${res[i].product_name}`);\n //console.log(`Price: ${res[i].price}`);\n //console.log(`Stock Quantity: ${res[i].stock_quantity}`);\n\n requestProduct();\n });\n}", "function readProducts() {\n\n connection.query(\"SELECT id, product_name, price FROM products\", function (err, res) {\n if (err) throw err;\n //This is a npm addin to make a better looking table\n console.table(res);\n //Once the table is shown, the function startTransaction is called\n startTransaction();\n\n });\n}", "async function menu_ViewProductsForSale() {\n console.log(`\\n\\tThese are all products for sale.\\n`);\n\n //* Query\n let products;\n try {\n products = (await bamazon.query_ProductsSelectAll(\n ['item_id', 'product_name', 'department_name', 'price', 'stock_quantity']\n )).results;\n } catch(error) {\n if (error.code && error.sqlMessage) {\n // console.log(error);\n return console.log(`Query error: ${error.code}: ${error.sqlMessage}`);\n }\n // else\n throw error;\n }\n // console.log(products);\n\n //* Display Results\n if (Array.isArray(products) && products.length === 0) {\n return console.log(`\\n\\t${colors.red(\"Sorry\")}, there are no such product results.\\n`);\n }\n\n bamazon.displayTable(products, \n [ bamazon.TBL_CONST.PROD_ID, \n bamazon.TBL_CONST.PROD , \n bamazon.TBL_CONST.DEPT , \n bamazon.TBL_CONST.PRICE , \n bamazon.TBL_CONST.STOCK ], \n colors.black.bgGreen, colors.green);\n\n return;\n}", "function showTable() {\n connection.query(\"SELECT * FROM products\", function (err, results) {\n for (var i = 0; i < results.length; i++) {\n console.log(results[i].item_id + \" | \" + \" 'productName': \" + results[i].product_name + \" | \" + \" 'Department': \" + results[i].department_name + \" | \" + \" 'Price': $\" + results[i].price + \" |\" + \"Quantity: \" + results[i].stock_quantity +\"\\n\" );\n }\n console.log(\"-----------------------------------\");\n\n }\n\n );\n}", "function showProducts(query) {\n console.log(\"showProducts\");\n \n console.log(\"Selecting all products...\\n\");\n connection.query(query, function (err, res) {\n if (err) throw err;\n // Log all results of the SELECT statement\n for(var i = 0; i<res.length; i++){\n\n //store response for colum fields in variables for string interpolation\n var id = res[i].item_id;\n var name = res[i].product_name;\n var department = res[i].department_name;\n var price = res[i].customer_price;\n var quantity = res[i].stock_quantity;\n console.log(`ID: ${id} | Item: ${name} | Department: ${department} | Price: $${price} | Quantity: ${quantity}`); // console.log('--------------------------------------------------------------------------------------------------')\n \n }\n //create a new table using a javascript constructor \n var t = new Table;\n res.forEach(element => {\n t.cell(\"productID\", element.item_id)\n t.cell(\"productName\", element.product_name)\n t.cell(\"deptName\", element.department_name)\n t.cell(\"custPrice\", element.customer_price)\n t.cell(\"stockQuantity\", element.stock_quantity)\n\n t.newRow()\n\n });\n console.log(t.toString()); \n });\n \n }", "function showProducts() {\n return db.query(\"SELECT * FROM products\")\n .spread(function(rows) {\n // instantiate \n process.stdout.write('\\033c');\n console.log(\"Welcome to Bamazon!\".bold.magenta);\n\n\n var table = new Table({\n head: ['ID', 'Product Name', 'Price'],\n colWidths: [7, 25, 10]\n });\n rows.forEach(function(value, index) {\n table.push([value.itemID, value.productName, value.price]);\n prodIdArray.push(value.itemID.toString());\n\n // console.log(row.itemID, row.productName, row.price);\n });\n console.log(table.toString());\n // console.log(\"ID ARRAY: \" + prodIdArray);\n startShopping();\n\n\n }).catch(function(err) {\n console.log(err);\n });\n\n}", "function showEverthing() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n console.log(\n \"ID: \" +\n res[i].ITEM_ID +\n \" || \" +\n \" Product: \" +\n res[i].Product_Name +\n \" || \" +\n \" Department Name: \" +\n res[i].Department_Name +\n \" || \" +\n \" Price \" +\n \"$\" +\n res[i].Price +\n \" || \" +\n \" Stock Quantity \" +\n res[i].Stock_Quantity\n );\n console.log(\n \"--------------------------------------------------------------------------------------------------------------------\"\n );\n }\n connection.end();\n });\n}", "function loadProducts() {\n\treturn products.map(product => {\n\t\treturn `\n\t\t\t<div class=\"product\">\n\t\t\t\t<div class=\"img-product\">\n\t\t\t\t\t<img src=\"${product.img}\" alt=\"table one\">\n\t\t\t\t</div>\n\t\t\t\t<h3 class=\"name-product\">${product.name}</h3>\n\t\t\t\t<p class=\"price-product\">${product.price}</p>\n\t\t\t\t\n\t\t\t\t<div class=\"btn-add-to-cart\">\n\t\t\t\t\t<i class=\"fa fa-cart-plus\"></i>\n\t\t\t\t\t<p>add to cart</p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`\n\t}).join('');\n}" ]
[ "0.8360354", "0.82975686", "0.82669085", "0.82498777", "0.8196092", "0.81910586", "0.81650335", "0.81420845", "0.809749", "0.80914646", "0.8086937", "0.80617875", "0.8055362", "0.80471057", "0.79968077", "0.79838383", "0.79642946", "0.7958511", "0.7954268", "0.7940812", "0.79390585", "0.7929164", "0.7927388", "0.7899159", "0.7890346", "0.7873417", "0.78340876", "0.78221107", "0.7818662", "0.78081805", "0.7780662", "0.77601886", "0.7749382", "0.77457654", "0.77349734", "0.7723008", "0.76996005", "0.76995695", "0.7696548", "0.76933366", "0.7681649", "0.7680374", "0.76798207", "0.76764727", "0.7640961", "0.763514", "0.7634926", "0.76329434", "0.76231915", "0.7596314", "0.758714", "0.7584185", "0.75820535", "0.7580327", "0.7555575", "0.75471944", "0.75301045", "0.751943", "0.75145715", "0.75084406", "0.7496127", "0.7481282", "0.747681", "0.747423", "0.74577725", "0.74475837", "0.74444187", "0.74418086", "0.7440469", "0.7415896", "0.74043834", "0.7400595", "0.7396821", "0.738458", "0.7381197", "0.73797417", "0.73790634", "0.73681176", "0.73658645", "0.7359409", "0.73512673", "0.73427075", "0.73375666", "0.73371476", "0.7312844", "0.72796255", "0.7270284", "0.7265503", "0.7261798", "0.7256458", "0.7252101", "0.7248314", "0.72321236", "0.7198213", "0.7194249", "0.71864825", "0.7175614", "0.7170598", "0.71645844", "0.71467423", "0.7105253" ]
0.0
-1
function to sell the items by completing the order
function sellItems(itemID, qtyRequested){ //check qty available by itemID and compare qty requested var query = 'SELECT item_id, product_name, department_name, price, stock_qty FROM products WHERE ?'; connection.query(query, {item_id: itemID}, function(err, items){ //if equal to or less than process order and display cost if (qtyRequested <= items[0].stock_qty){ //run query to update qty //determines the new qty of items var newQTY = items[0].stock_qty - qtyRequested; updateItemQTY(itemID, newQTY); //calculate total cost of items var totalCost = items[0].price * qtyRequested; //display cost console.log('Total amount owed is: $' + totalCost); } else { //if greater than stock qty display error message console.log('There was a problem with your request, you either requested an invalid qty or invalid ID'); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async _sell() {\n\t\tif (this.state.items_to_sell.length < 1) {\n\t\t\tLogging.warn('Nothing to sell?');\n\t\t\treturn;\n\t\t}\n\n\t\tawait movement.pathfind_move('basics');\n\n\t\tfor (let item of this.state.items_to_sell) {\n\t\t\tconst index = Item.find(item);\n\t\t\tif (index !== -1) {\n\t\t\t\twindow.sell(index, item.q ?? 1);\n\t\t\t}\n\t\t}\n\n\t\tthis.state.items_to_sell = [];\n\t}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function placeSellOrder (p) {\n\n}", "function buyItem() {\n\n}", "function sellOrder(price) {\n\tvar amount = BTC - keepBTC;\n\t\n\tmtGoxPost(\"BTC\" + currency + \"/money/order/add\", \n\t\t\t['type=ask','amount_int=' + Math.round(amount*100000000).toString(), 'price_int=' + Math.round((price - 0.001)*100000).toString()], \n\t\t\tfunction(e) {\n\t\t\t\tlog(\"Error sending sell request. Retrying in 5 seconds...\");\n\t\t\t\tsetTimeout(sellOrder(price), 5000); // retry after 5 seconds\n\t\t\t}, onOrderProcessed);\n}", "function saleOrder() {\n \n added_to_cart.forEach(element => {\n id = element.product_id;\n quantity = element.quantity;\n\n data = {\"product_id\":id,\"quantity\":quantity};\n makeSale(data);\n });\n}", "function fulfillOrder(chosenItem, numUnitsInt) {\n let newStock = chosenItem.stock_quantity - numUnitsInt;\n let totalPrice = chosenItem.price * numUnitsInt;\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newStock\n },\n {\n item_id: chosenItem.item_id\n }\n ],\n function(error) {\n if (error) throw err;\n console.log(`You bought ${numUnitsInt} units of the ${chosenItem.product_name}. You spent a total of $${totalPrice}.`);\n connection.end();\n }\n );\n}", "function fulfillOrder (itemID, itemQuantity) {\n //\"SET\" manipulates value, \"UPDATE\" changes quantity, ?'s are placeholders for values to be passed through\n connection.query(\"UPDATE products SET stock_quantity = stock_quantity - ? WHERE item_id = ?\",\n //pass in values, updates quantity if order is successful\n [itemQuantity, itemID],\n //pass in a callback function\n function(err){\n if (err) {\n console.log(err)\n } else {\n console.log(chalk.bold.green(\"Order Successful!\"));\n //show the customer the total cost of their purchase.\n totalCost();\n // //prompt the customer to purchase more items...\n // productsForSale();\n };\n connection.end(); \n })\n\n function totalCost () {\n //in connection.query take the price from the item_id and multiply it by the itemQuantity\n connection.query(\"SELECT * FROM products WHERE item_id = ?\",\n [itemID],\n function (error, response) {\n if (error) {\n console.log(error)\n } else {\n var totalPrice = response[0].price * itemQuantity;\n console.log(chalk.bold.green(\"Your total is: \" + totalPrice))\n //take the price from the item_id and multiply it by the itemQuantity\n }\n }\n )\n }\n }", "function sellItem(pmcData, body, sessionID) {\n item.resetOutput();\n\n let money = 0;\n let prices = json.parse(profile_f.getPurchasesData(body.tid, sessionID));\n let output = item.getOutput();\n\n // find the items to sell\n for (let i in body.items) {\n // print item trying to sell\n logger.logInfo(\"selling item\" + json.stringify(body.items[i]));\n\n // profile inventory, look into it if item exist\n for (let item of pmcData.Inventory.items) {\n let isThereSpace = body.items[i].id.search(\" \");\n let checkID = body.items[i].id;\n\n if (isThereSpace !== -1) {\n checkID = checkID.substr(0, isThereSpace);\n }\n\n // item found\n if (item._id === checkID) {\n logger.logInfo(\"Selling: \" + checkID);\n\n // remove item\n insurance_f.insuranceServer.remove(pmcData, checkID, sessionID);\n output = move_f.removeItem(pmcData, checkID, output, sessionID);\n\n // add money to return to the player\n let price_money = prices.data[item._id][0][0].count;\n\n if (output !== \"BAD\") {\n money += price_money;\n } else {\n return \"\";\n }\n }\n }\n }\n\n // get money the item\n output = itm_hf.getMoney(pmcData, money, body, output, sessionID);\n return output;\n}", "static sellItems(data = null, items) {\n if (data !== null) {\n if (!data.error) {\n swal('Success!', 'Sucessfully sold your Item!', 'success')\n equipment.reload();\n } else {\n swal('Error!', data.error_msg, 'error');\n equipment.reload();\n }\n } else {\n $(\".loading-screen\").show();\n let params = {\n 'ITEMS': items,\n };\n equipment.sendRequest('sellItems', 'sell_items', params);\n }\n }", "function buyThis(){\n inqurier.prompt([\n {\n message: \"What is the ITEM ID of the PRODUCT you would like to buy?\",\n name: \"id\"\n },\n { \n message: \"How many UNITS would you like to buy?\",\n name: \"purchase\",\n },\n ]).then(function(answer){\n //convert to integers\n var id = parseInt(answer.id);\n var quantity = parseInt(answer.purchase)\n\n //purcahse logic\n\n if (isNaN(answer.id) == true || id <=0 || id > resultArray.length) {\n //error message for invalid number entry \n console.log(\"Error: INVALID ITEM ID\")\n }\n else if (isNan(answer.purcahse) == true || quantity <= 0){\n //error for purchasing zero items\n console.log(\"You must order more than one\")\n }\n else if (quantity > resultArray[id -1].stock_quantity){\n //error for not enough stock \n console.log(\"WE ARE OUT OF THAT\")\n }\n else {\n //for a sucessful order\n purchaes.push(resultArray[id - 1].product_name);\n amounts.push(quantity);\n\n //total of curent order and total order\n var orderCost = quantity * resultArray[id-1].price;\n orderCost = parseFloat(orderCost.toFixed(2));\n total += orderCost;\n total = parseFloat(total.toFixed(2))\n\n sales = resultArray[id - 1].product_sales + orderCost;\n\n console.log(\"You have selected ITEM\" + id + \",\" + resultArray[id - 1].product_name + \".\" )\n console.log(\"This item costs $\" + resultArray[id - 1].price + \" per unit. You have ordered \" + quantity + \" units.\");\n console.log(\"This purchase costs $\" + orderCost + \".\");\n \n //display quantites and ordered as well as cost\n console.log(\"YOU HAVE ORDERED\")\n for (var i = 0; i < purchaes.length; i++){\n console.log(amounts[i] + \"|\" + purchaes[i]);\n }\n console.log(\"mYour total cost is \" + total + \".\");\n\n\t\t\t// query to update the database\n\t\t\tupdate = \"UPDATE products SET stock_quantity = \" + (resultArray[id - 1].stock_quantity - quantity) + \", product_sales = \" + sales + \" WHERE item_id = \" + id;\n\n\t\t\t// updates the database\n\t\t\tconnection.query(update, function (error, results, fields) {\n\t\t\t\tif (error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t};\n });\n keepGoing();\n }\n })\n}", "function buy()\n{\n\t//query the databse for all items being sold\n\tconnection.query(\"SELECT * FROM products\", function(err, res)\n\t{\n\t\t\n\t\tif(err) throw err;\n\n\t\t//Prompt the user to input data\n\t\tinquirer.prompt([\n\n\t\t\t{\n\t\t\t\t//Ask for id of the product the user wants to buy\n\t\t\t\tname: \"id\",\n\t\t\t\ttype: \"list\",\n\t\t\t\tchoices: function()\n\t\t\t\t{\n\t\t\t\t\tvar idChoiceArray = [];\n\n\t\t\t\t\tfor(var i = 0; i < res.length; i++)\n\t\t\t\t\t{\n\n\t\t\t\t\t\t//push all items_ids into (idChoiceArray) in order to display all ids to choose from\n\t\t\t\t\t\t//NOTE: For rawlist cannot use type(INT) only (string) hence convert int to string by JSON.stringify\n\t\t\t\t\t\tidChoiceArray.push(JSON.stringify(res[i].item_id));\n\t\t\t\t\t}\n\n\t\t\t\t\t//display all item_id's to choose from\n\t\t\t\t\treturn idChoiceArray;\n\t\t\t\t},\n\t\t\t\tmessage: \"Enter the id of the product you want to purchase\"\n\t\t\t},\n\n\t\t\t{\n\t\t\t\t//Ask customer for how many units they'd like to buy\n\t\t\t\ttype: \"input\",\n\t\t\t\tname: \"quantity\",\n\t\t\t\tmessage: \"How many units would you like to buy?\"\n\t\t\t}\n\n\t\t\t]).then(function(answer)\n\t\t\t{\n\t\t\t\t//get the entire item object & store in variable\n\t\t\t\tvar chosenItem;\n\n\t\t\t\tfor(var i = 0; i < res.length; i++)\n\t\t\t\t{\n\t\t\t\t\t//if id == user id choice then store entire object\n\t\t\t\t\tif(res[i].item_id === parseInt(answer.id) )\n\t\t\t\t\t{\n\t\t\t\t\t\tchosenItem = res[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t\n\n\t\t\t\t//call the checkQuantity function & update the table if the quantity entered is sufficient\n\t\t\t\tcheckQuantity(chosenItem, answer, err);\n\n\t\t\t});\n\n\t});\n}", "async sell(item, quantity) {\n const res = await this.client.action(\"sell\", { itemName: item, quantity: quantity, storeName: this.store });\n if (res.success) {\n this.editCache(item, quantity);\n await this.client.update(res.playerStringified);\n }\n return { success: res.success, msg: res.msg };\n }", "sellShrimp({commit}, order) {\n \n // Sale transaction\n commit('SELL_STOCK', order);\n\n // Adds the quantity sold to market quantity\n commit('ADD_QUANTITY', order);\n \n }", "async function SellItem(receivedMessage, index)\r\n{\r\n\tvar authorID = receivedMessage.author.id; // Get user's id\r\n\tconst AllItems = await Items.findAll({ where: { UID: authorID } }); // Get user's items\r\n\r\n\tif (index >= AllItems.length) // If the item index is out of bounds\r\n\t{\r\n\t\treceivedMessage.channel.send(\"Предмета под таким номером нет в вашем инвентаре!\"); // Say it's out of bounds\r\n\t\treturn;\r\n\t}\r\n\r\n\tif (AllItems[index]) // If the item's ok\r\n\t{\r\n\t\tvar thisItem = AllItems[index]; // Put it in a variable for shits and giggles\r\n\t\tvar itemPrice = Math.floor(thisItem.price / 2); // Get its price\r\n\t\tvar balanceUnits = await GetBalance(authorID); // Get user's balance\r\n\r\n\t\tif (thisItem.place == 1)\r\n\t\t{\r\n\t\t\tif (await GetDataArray(\"defarg1\")[0] < await GetMechEnergy(receivedMessage))\r\n\t\t\t{\r\n\t\t\t\treceivedMessage.channel.send(\"У вашего меха не хватит энергоёмкости, не могу продать!\");\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (await GetDataArray(\"defarg2\")[0] < await GetMechWeight(receivedMessage))\r\n\t\t\t{\r\n\t\t\t\treceivedMessage.channel.send(\"У вашего меха не хватит грузоподъёмности, не могу продать!\");\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Successful sell\r\n\t\tawait thisItem.destroy(); // Remove the item\r\n\t\tawait SetBalance(authorID, balanceUnits + itemPrice); // Add the funds\r\n\t\treceivedMessage.channel.send('Успешно продано за ' + itemPrice + ' Юнитов, новый баланс - ' + (balanceUnits + itemPrice) + 'Ю!'); // Say it was successful\r\n\t}\r\n}", "function processOrder(itemId, quantityOrdered)\n{\n connection.query(\"SELECT * FROM `products` WHERE ?\",{item_id: itemId}, function (err, res)\n {\n if (err) throw err;\n\n if(quantityOrdered < res[0].stock_quantity)\n {\n var dept = res[0].department_name;\n var newQuantity = res[0].stock_quantity - quantityOrdered;\n var totalprice = quantityOrdered * res[0].price;\n var totalsales = res[0].product_sales + totalprice;\n connection.query(\"UPDATE products SET ?, ? WHERE ?\",\n [{\n stock_quantity: newQuantity\n },\n {\n product_sales: totalsales\n },\n {\n item_id: itemId\n }],\n function(err, res) {\n if (err)\n throw err;\n });\n\n connection.query(\"SELECT * FROM `departments` WHERE ?\", {department_name: dept},\n function (err, res2) {\n if (err)\n throw err;\n\n var deptsales = res2[0].total_sales;\n deptsales += totalprice;\n connection.query(\"UPDATE `departments` SET ? WHERE ?\",\n [{\n total_sales: deptsales\n },\n {\n department_name: dept\n }],\n function (err, res3)\n {\n if (err)\n throw err;\n console.log(\"Purchase Successfull. Your total order is $\" + totalprice + \"\\n\");\n askAgain();\n });\n });\n }\n else\n {\n console.log(\"Purchase Unsuccessful. Insufficient quantity.\\n\");\n askAgain();\n }\n });\n}", "function placeBuyOrder (p) {\n\n}", "function purchaseItem() {\n return\n}", "function buy() {\n \n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n \n inquirer.prompt([\n {\n type: \"input\",\n name: \"id\",\n message: \"What is product ID you want to buy?\"\n },\n {\n type: \"input\",\n name: \"qty\",\n message: \"How many units would you like to buy?\"\n }\n ])\n .then(function(answer) {\n \n var custProduct = (answer.id) - 1;\n var orderQuantity = parseInt(answer.qty);\n var total = parseFloat(((res[custProduct].price) * orderQuantity).toFixed(2));\n\n // Check if quantity is sufficient\n if(res[custProduct].stock_quantity >= orderQuantity) {\n \n // After purchase, update the quantity in products & product sales in departments table\n var query = \"UPDATE products INNER JOIN departments ON products.dept_name = departments.dept_name SET ? WHERE ?\"\n \n connection.query(\n query,\n [{\n stock_quantity: (res[custProduct].stock_quantity - orderQuantity),\n product_sales: total\n },{\n item_id: answer.id\n }], \n\n function(err, res){\n if (err) throw err;\n console.log(\"Your total is $\" + total + \". Thanks for your order!\");\n reRun();\n });\n\n } \n else \n {\n console.log(\"There isn't enough in stock!\");\n reRun();\n }\n })\n })\n}", "function buy() {\n // query the database for all items\n connection.query(\"SELECT * FROM products\", function(err, results) {\n if (err) throw err;\n // once you have the items, prompt the user for which they'd like to buy\n inquirer\n .prompt([\n {\n name: \"choice\",\n type: \"input\",\n message: \"Please input the ID# of the product you want to buy?\".bgGreen.white\n },\n {\n name: \"amount\",\n type: \"input\",\n message: \"How many would you like to buy?\".bgGreen.white\n }\n ])\n .then(function(input) {\n // get the information of the chosen item\n var item = input.choice;\n var quantity = input.amount;\n\n // Query db to confirm that the given item ID exists in the desired quantity\n var queryStr = 'SELECT * FROM products WHERE ?';\n\n connection.query(queryStr, {item_id: item}, function(err, data) {\n if (err) throw err;\n\n // If the user has selected an invalid item ID, data attay will be empty\n\n if (data.length === 0) {\n console.log('ERROR: Invalid Item ID. Please select a valid Item ID.'.bgCyan.white);\n buy();\n }\n \n else {\n var productData = data[0];\n\n // If the quantity requested by the user is in stock\n if (quantity <= productData.stock_quantity) {\n console.log(' '.bgGreen.white);\n console.log(' Congratulations, the product you requested is in stock! Placing order! '.bgGreen.white);\n console.log(' '.bgGreen.white);\n // Construct the updating query string\n var updateQueryStr = 'UPDATE products SET stock_quantity = ' + (productData.stock_quantity - quantity) + ' WHERE item_id = ' + item;\n // console.log('updateQueryStr = ' + updateQueryStr);\n\n // Update the inventory\n connection.query(updateQueryStr, function(err, data) {\n if (err) throw err;\n console.log('\\n Your total is: $' + productData.price * quantity);\n console.log(' ');\n console.log(\" \".bgMagenta.white)\n console.log(\" Thanks for shopping with Bamazon. \".bgMagenta.white)\n console.log(\" \".bgMagenta.white)\n // End the database connection\n connection.end();\n })\n } \n\n else {\n console.log(' '.bgRed.white);\n console.log(' That item is out of stock :( '.bgRed.white);\n console.log(' '.bgRed.white);\n console.log(' '.bgGreen.white);\n console.log(' Would you like to buy something else? '.bgGreen.white);\n console.log(' '.bgGreen.white);\n buy();\n }\n }\n })\n })\n\t\t\n });\n}", "function buyPart(item) {\n let protoBotCopy = protoBot\n let shopCopy = shop\n \n if(item.purchased == false){\n \n\n for (let i=0; i < shopCopy.length; i++){\n if(i == item.id - 1){\n \n shopCopy[i].purchased = true\n \n setShop(shopCopy)\n \n } \n }\n \n protoBotCopy.items.push(item)\n if(item.cost < balance){\n let cost = item.cost\n\n setBalance(balance - cost)\n setProtoBot(protoBotCopy)\n \n } else return alert('you do not have enough money')\n } else return alert('Item is already purchased')\n \n}", "function buyItem() {\n\taddArmor();\n\t$('#alerts').append(\"<br />An item has being bought<br />\");\n\tremoveMoneyI();\n}", "processOrders() {\r\n /*\r\n this.orders.forEach(order => {\r\n const isBuy = order.amount > 0;\r\n const amount = Math.abs(order.amount);\r\n const base = order.pair.split('-')[0];\r\n const quote = order.pair.split('-')[1];\r\n const quoteAmount = base * amount;\r\n // check price\r\n const orderBooks = this.cobinhood.orderBooks;\r\n\r\n // execute order\r\n if (isBuy) {\r\n if (this.wallet.withdraw(quote, quoteAmount)) {\r\n this.wallet.deposit(base, amount);\r\n }\r\n }\r\n else {\r\n if (this.wallet.withdraw(base, amount)) {\r\n this.wallet.deposit(quote, quoteAmount);\r\n }\r\n }\r\n console.log(order);\r\n });*/\r\n }", "async sell(quantity, profit) {\n try {\n const symbol = this.symbol.meta;\n const tickSize = symbol.tickSize; //minimum price difference you can trade by\n const priceSigFig = symbol.priceSigFig;\n const quantitySigFig = symbol.quantitySigFig;\n const unconfirmedSell = await binance.order({\n symbol: this.config.tradingPair,\n side: 'SELL',\n quantity: quantity.toFixed(quantitySigFig),\n price: profit.toFixed(priceSigFig)\n });\n this.queue.push(unconfirmedSell);\n console.log('Selling...', unconfirmedSell.symbol);\n } catch(err) {\n console.log('SELL ERROR: ', err.message);\n return false;\n }\n }", "function processUserOrder() {\n\n\tinquirer.prompt([{\n\t\tname: 'itemID',\n\t\ttype: 'input',\n\t\tmessage: 'ID of the product you would like to buy.'\n\t}, {\n\t\tname: 'units',\n\t\ttype: 'input',\n\t\tmessage: 'how many units of the product you would like to buy.',\n\t\tvalidate: function(answer) {\n\t\t\tif(answer > 0 ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}]).then(function(answer) {\n\t\tvar queryResponse;\n\t\tvar query = 'SELECT * FROM products WHERE ?'\n\n\t\tconnection.query(query, {ItemID: answer.itemID}, function(err, res) {\n\t\t\tif (err) throw err;\n\t\t\tqueryResponse = res[0];\n\n\t\t\tif (queryResponse.StockQuantity < answer.units) {\n\t\t\t\tconsole.log('Insufficient quantity!');\n\t\t\t\tconnection.end();\n\n\t\t\t} else {\n\n\t\t\t\tconsole.log('Order placed');\n\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tvar query = 'UPDATE products SET StockQuantity = ? WHERE ItemID = ?'\n\t\t\t\t\tvar stockQuantity = queryResponse.StockQuantity - answer.units;\n\t\t\t\t\tconnection.query(query, [stockQuantity, answer.itemID], function(err, res) {\n\t\t\t\t\t\tif (err) throw err;\n\t\t\t\t\t\tvar totalCost = answer.units * queryResponse.Price;\n\t\t\t\t\t\tconsole.log('-----------------------------------')\n\t\t\t\t\t\tconsole.log('Order Updated')\n\t\t\t\t\t\tconsole.log('Your total cost is ', '\\nTotal cost: ' + totalCost);\n\t\t\t\t\t\tupdateDepartments(totalCost, queryResponse);\n\t\t\t\t\t})\n\t\t\t\t}, 1000);\n\n\t\t\t}\n\t\t})\n\t})\n}", "function orderItems() {\n\n // OPEN: Connect to table\n connection.query(\"SELECT * FROM products\", function(err, results) {\n if (err) throw err;\n\n var choiceArray = [];\n\n for (var i = 0; i < results.length; i++) {\n //needs to be string or wont work in inq\n choiceArray.push( '' + results[i].item_id + '' );\n }\n\n inquirer.prompt([\n\n {\n type: \"list\",\n name: \"choice\",\n message: \"What is the ID of the product that you want to buy?\",\n choices: choiceArray\n },\n {\n name: \"units\",\n type: \"input\",\n message: \"How many units would you like to buy?\"\n }\n\n\n ]).then(function (answers) {\n // get the information of the chosen item\n\n var chosenItem;\n\n for (var i = 0; i < results.length; i++) {\n //needs to be a string or wont work\n var temp = '' + results[i].item_id + '';\n\n if (temp === answers.choice) {\n chosenItem = results[i].item_id;\n }\n }\n\n console.log(\"\");\n console.log(\"\");\n console.log(\"*********\")\n console.log(\"\");\n console.log(\"\");\n\n console.log(\"Item ID: \" + chosenItem);\n\n connection.query(\"SELECT * FROM products WHERE item_id=?\", [chosenItem], function(err, res) {\n if (err) throw err;\n console.log(\"Item Name:\" + res[0].product_name + \" || In Stock Quantity: \" + res[0].stock_quantity);\n\n console.log(\"\");\n console.log(\"\");\n console.log(\"*********\")\n console.log(\"\");\n console.log(\"\");\n\n // if statement that checks if unit input is less than stock quantitiy\n if (answers.units <= res[0].stock_quantity ) {\n console.log(\"You bought: \" + res[0].product_name + \" [\" + answers.units + \" unit(s)]\");\n console.log(\"Your total bill is: \" + (parseInt(answers.units) * res[0].price) );\n\n\n var newStockAmount = res[0].stock_quantity - parseInt(answers.units);\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newStockAmount\n },\n {\n item_id: chosenItem\n }\n ]);\n\n console.log(\"\");\n console.log(\"\");\n console.log(\"*********\")\n console.log(\"\");\n console.log(\"\");\n\n confirmToOrder();\n\n } else {\n console.log(\"Unfortunately, there isn't enough in stock. Please Try Again.\");\n console.log(\"\");\n console.log(\"\");\n console.log(\"*********\")\n console.log(\"\");\n console.log(\"\");\n orderItems();\n }\n\n });\n\n\n });\n\n }); // CLOSE: Connect to table\n\n} // CLOSE: Function to orderItems", "function buyProducts(id, quantity)\n {\n connection.query(\"SELECT * FROM products WHERE item_id = \"+id,\n function(err, res) \n {\n if (err) throw err;\n if(quantity > res[0].stock_quantity)\n {\n console.log(\"Quantity Requested: \"+quantity);\n console.log(\"Quantity In Stock: \"+res[0].stock_quantity);\n console.log(\"SORRY! We don't have enough to fill your order\");\n connection.end();\n }\n else\n {\n var inventory = parseInt(res[0].stock_quantity) - quantity;\n var newid = res[0].item_id;\n var newname = res[0].product_name;\n console.log(\"Product name: \"+newname+ \" , Product ID: \"+newid);\n\n console.log(\"Stock Inventory BEFORE your Purchase: \"+res[0].stock_quantity);\n console.log(\"Units you are purchasing: \"+quantity);\n console.log(\"Stock Inventory AFTER your Purchase: \"+inventory);\n updateQuantity(res[0].stock_quantity, newid, inventory );\n priceIt(quantity, res[0].price);\n } \n });\n }", "function showProducts() {\n // query the database for all items being auctioned\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n\n console.log(\"\");\n console.log(\"\");\n console.log(\"************* PRODUCTS FOR SALE **************\");\n console.log(\"\");\n\n for(i=0;i<res.length;i++){\n console.log(\"Item ID: \" + res[i].item_id + \" || \" + \" Product Name: \" + res[i].product_name + \" || \" + \" Price: $\" + res[i].price)\n }\n console.log(\"\");\n console.log(\"=================================================\");\n console.log(\"\");\n placeOrder();\n })\n\nfunction placeOrder(){\n inquirer.prompt([{\n name: \"selectId\",\n message: \"Enter the ID of the product you wish to purchase.\",\n validate: function(value){\n var valid = value.match(/^[0-9]+$/)\n if(valid){\n return true\n }\n console.log(\"\");\n return \"************* Please enter a valid Product ID *************\";\n console.log(\"\");\n }\n },{\n name:\"selectQuantity\",\n\t\tmessage: \"How many of this product would you like to order?\",\n\t\tvalidate: function(value){\n\t\t\tvar valid = value.match(/^[0-9]+$/)\n\t\t\tif(valid){\n\t\t\t\treturn true\n }\n console.log(\"\");\n return \"************* Please enter a numerical value *************\";\n console.log(\"\");\n\n\t\t}\n\n }]).then(function(answer){\n connection.query(\"SELECT * from products where item_id = ?\", [answer.selectId], function(err, res){\n if(answer.selectQuantity > res[0].stock_quantity){\n console.log(\"\");\n console.log(\"************ Insufficient Quantity *************\");\n console.log(\"************ This order has been cancelled *************\");\n console.log(\"\");\n showProducts();\n }\n else{\n console.log(\"\");\n console.log(\"************* Thanks for your order! **************\");\n console.log(\"\");\n connection.query(\"UPDATE products SET ? Where ?\", [{\n stock_quantity: res[0].stock_quantity - answer.selectQuantity\n },{\n item_id: answer.selectId\n }], function(err, res){});\n showProducts();\n }\n })\n \n }, function(err, res){})\n };\n\n}", "function placeOrder() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n inquirer\n .prompt([\n {\n name: \"id\",\n type: \"input\",\n message: \"What is the ID of the product you would like to buy?\"\n },\n {\n name: \"units\",\n type: \"input\",\n message: \"How many units would you like to buy?\"\n }\n ])\n // Updates database if enough units\n .then(function(answer) {\n for (var i = 0; i < res.length; i++) {\n if (res[i].item_id === parseInt(answer.id)) {\n if (res[i].stock_quantity >= answer.units) {\n connection.query(\n \"UPDATE products SET ?, ? WHERE ?\", \n [\n {\n stock_quantity: (res[i].stock_quantity - answer.units)\n },\n {\n product_sales: res[i].product_sales + (answer.units * res[i].price)\n },\n {\n item_id: parseInt(answer.id)\n }\n ],\n function(err) {\n if (err) throw err;\n }\n );\n console.log(\"Thanks for your purchase! Your total was $\" + answer.units * res[i].price + \".\");\n askToBuyAgain();\n } else {\n console.log(\"Sorry, insufficient quantity! Try again later.\");\n }\n }\n }\n });\n });\n}", "function orderItem() {\n // prompt for info about the item the user wants to purchase and the number of items\n inquirer\n .prompt([\n {\n name: \"item\",\n type: \"input\",\n message: \"What is the id of the item you would like to purchase? [Quit with Q]\"\n },\n {\n name: \"number\",\n type: \"input\",\n message: \"How many would you like? [Quit with Q]\",\n when: function (answers) {\n return answers.item !== \"Q\";\n },\n validate: function (value) {\n if (isNaN(value) === false || value === \"Q\") {\n return true;\n }\n return false;\n }\n }\n ])\n .then(function (answer) {\n // when finished prompting check if the store has enough items to sell \n if (answer.item === \"Q\" || answer.number === \"Q\") {\n console.log(\"Exiting the program...\");\n connection.end();\n process.exit();\n }\n else {\n connection.query(\"SELECT * FROM products WHERE ?\",\n [\n {\n item_id: answer.item\n }\n ]\n ,\n function (err, results) {\n if (err) throw err;\n //if the querying was successfull \n //check if there are enough items to sell to a customer \n var numItems = results[0].stock_quantity;\n var product = results[0].product_name;\n var itemNum = parseInt(answer.item);\n var userNum = parseInt(answer.number);\n if (userNum <= numItems) {\n //if the quantity is sufficient display the message and update the table\n var plural = userNum === 1 ? \"item\" : \"items\";\n console.log(\"Successfully purchased \" + answer.number + \" \" + product + \" \" + plural + \" for the sum of $\" + userNum * results[0].price);\n updateProduct(itemNum, numItems - userNum);\n\n }\n else {\n //display the message if the quantity is insufficient\n console.log(\"Sorry! Insufficient quantity in stock! Please change the order. \");\n //display the table of items on sale...\n displayProducts();\n }\n });\n }\n });\n}", "function getOrder(){\n\n // This function requests order details from the user, using the npm inquirer package \n // variable to hold the item id\n var item_id = 0;\n // update query to update stock when order is placed\n var updateQuery = \"UPDATE products SET stock_quantity = ?, product_sales =? WHERE item_id = ?\";\n // variable to hold the unit price\n var unit_price = 0;\n // variable to hold the stock quantity \n var stock_quantity = 0;\n // variable to hold the no of units that customer is purchasing \n var noOfUnits = 0;\n // variable to hold the product sales amount\n var product_sales = 0;\n\n // prompt user to enter an order\n inquire.prompt([{\n type:\"input\",\n name :\"itemId\",\n message:\"Please enter the id of the item to purchase\"\n }\n ]).then(answer =>{\n \n\n item_id=answer.itemId;\n \n var itemQuery = \"SELECT stock_quantity,unit_price, product_sales FROM products WHERE item_id = \" + item_id;\n\n connection.query(itemQuery,function(err,results){\n if(err) throw err;\n\n unit_price = results[0].unit_price;\n stock_quantity = results[0].stock_quantity;\n product_sales = results[0].product_sales;\n\n // if stock not availabel \n if(stock_quantity === 0 ){ \n \n console.log(\"Insufficient quantity!\");\n getAllProducts();\n\n }\n else{\n inquire.prompt([{\n type:\"input\",\n name :\"noOfUnits\",\n message:\"Please enter the no of units\"\n }\n ]).then(answer =>{\n noOfUnits = parseInt(answer.noOfUnits);\n\n if (noOfUnits > stock_quantity){\n // if availble stocks less than the amount that the customer wants to buy\n console.log(\"Insufficient quantity!\");\n getAllProducts();\n }\n\n var totalCost = parseFloat(answer.noOfUnits * unit_price);\n var newQuantity = stock_quantity - answer.noOfUnits\n var newSales = product_sales + totalCost;\n \n connection.query(updateQuery,[newQuantity,newSales,item_id],\n (err,results)=>{\n if (err) throw err;\n\n console.log(\"\\nTotal cost :\" + totalCost.toFixed(2)+\"\\n\");\n\n getAllProducts();\n });\n\n });\n }\n\n \n\n }\n )\n\n });\n // connection.end();\n}", "function buy(res) {\n // the prompt asking which item they would like to purchase. The user has to provide the item id #\n inquirer.prompt([{\n type: \"input\",\n name: \"productID\",\n message: \"Please enter the item number you would like to purchase:\"\n }]).then(function (answer) {\n // checking if the item id given by the user is correct\n var correct = false;\n for (var i = 0; i < res.length; i++) {\n if (res[i].item_id == answer.productID) {\n correct = true;\n var product = answer.productID;\n var id = i;\n // once it's confirmed that is correct, another prompt asks how many the user would like to buy\n inquirer.prompt({\n type: \"input\",\n name: \"quantity\",\n message: \"How many would you like to buy? \",\n validate: function (value) {\n // checking if the quantity given is a number\n if (isNaN(value) == false) {\n return true;\n } else {\n return false;\n }\n }\n }).then(function (answer) {\n // substracting the quantity purchased from the product database\n var qty = parseInt(answer.quantity);\n if ((res[id].stock_quantity - qty) > 0) {\n connection.query(\"UPDATE products SET stock_quantity ='\" +\n (res[id].stock_quantity - answer.quantity) + \"' WHERE item_id = '\" +\n product + \"'\", function (err, res2) {\n // adding the total from the purchase to the product sales in the department database\n connection.query(\"UPDATE departments SET product_sales= product_sales+\"+\n (answer.quantity*res[id].price)+\", total_sales=product_sales-overheadcosts WHERE department_name='\"+\n res[id].department_name+\"';\", function(err,res3) {\n console.log(\"Sales Added to Department!\");\n });\n console.log(\"Product Purchase Complete!\");\n\n var total = parseFloat(((res[id].price) * qty).toFixed(2));\n console.log('Your order has been placed!');\n console.log('You have ordered ' + qty + ' items of the ' +\n res[id].product_name + '.');\n console.log('Your total is $' + total);\n console.log('Thank you and come again!');\n makeTable();\n })\n } else {\n console.log('Sorry, we do not have enough in stock of this product. Your order could not be be placed.');\n console.log('Please modify your order.');\n buy(res);\n }\n })\n }\n }\n });\n}", "function placeOrder(id, quantity, item){\n\n var currentQuantity = item.quantity - quantity;\n var price = item.price * quantity;\n\n var query = `UPDATE PRODUCTS `+ \n `SET STOCK_QUANTITY = ${currentQuantity}, ` + \n `PRODUCT_SALES = ${price} + COALESCE(PRODUCT_SALES,0), ` +\n `PRODUCT_SOLD = ${quantity} + COALESCE(PRODUCT_SOLD,0) ` +\n `WHERE ITEM_ID = ${id};`;\n\n connection.query(query, function(err,data){\n if(err) {\n connection.end();\n throw err\n };\n\n console.log(`Product Updated to New Quantity ${currentQuantity}`);\n console.log(`Price $${price}`);\n });\n\n connection.end();\n }", "function start() {\n connection.query(\"SELECT * FROM products\", function (err, results) {\n if (err) throw err;\n inquirer\n .prompt([\n {\n name: \"choice\",\n type: \"rawlist\",\n message: \"Which item_id would you like to buy?\",\n choices: function() {\n var choiceArray = [];\n for (var i = 0; i < results.length; i++) {\n choiceArray.push(results[i].product_name);\n }\n return choiceArray;\n },\n },\n {\n name: \"units\",\n type: \"input\",\n message: \"How many would you like to buy?\"\n }\n ])\n .then(function(answer) {\n var chosenItem;\n for (var i = 0; i < results.length; i++) {\n if(results[i].product_name === answer.choice) {\n chosenItem = results[i];\n }\n }\n // determine if enough are in stock\n if (chosenItem.stock_quantity >= parseInt(answer.units)) {\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: chosenItem.stock_quantity -= answer.units\n },\n {\n item_id: chosenItem.item_id\n }\n ],\n function(error) {\n if (error) throw err;\n console.log(\"***********************************************\\n\");\n console.log(\"Order placed successfully, Thanks for shopping with us!\\n\");\n console.log(\"***********************************************\\n\");\n start();\n }\n )\n connection.query (\n \"SELECT price FROM products WHERE ?\",\n {\n item_id : chosenItem.item_id\n },\n function(err, res) {\n if (err) throw err;\n // console.log(res[0].price);\n // console.log(\"answer.units= \" +answer.units+ \".\");\n var unitCost = parseInt(res[0].price);\n // console.log(\"unitCost = \" +unitCost+ \".\");\n var owed = parseInt(answer.units) * unitCost;\n // console.log(owed);\n console.log(\"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\");\n console.log(\"Your total is $\" +owed+ \".\");\n console.log(\"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\\n\");\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n product_sales : chosenItem.product_sales += owed\n },\n {\n item_id : chosenItem.item_id\n }\n ]\n );\n }\n );\n }\n else {\n // If there aren't enough in stock, return this message and don't place order.\n console.log(\"***********************************************\\n\");\n console.log(\"Sorry, there aren't enough in stock. Please choose another item or decrease your order size.\");\n console.log(\"***********************************************\\n\");\n start();\n }\n });\n });\n}", "function buyItem(itemName) {\n let upgrade = items.find((item) => item.name == itemName);\n if(zenny >= upgrade.price) {\n zenny -= upgrade.price;\n upgrade.quantity++;\n upgrade.price = Math.floor(upgrade.price * 1.08);\n console.log(upgrade.price)\n update();\n showButtons();\n }\n}", "function purchase() {\n\n inquirer\n .prompt([\n {\n name: \"itemID\",\n type: \"input\",\n message: \"\\nGreat! What is the Item # of the product you would like to purchase?\\n\"\n },\n {\n name: \"units\",\n type: \"number\",\n message: \"\\nHow many units of the item would you like to purchase?\\n\"\n },\n\n ])\n .then(function (selection) {\n // get the information of the chosen item\n\n // query the database for all items available to purchase\n connection.query(\"SELECT * FROM products WHERE id=?\", selection.itemID, function (err, res) {\n\n for (var i = 0; i < res.length; i++) {\n\n if (selection.units > res[i].stockQuantity) {\n\n console.log(chalk.green.bold(\"===================================================\"));\n console.log(chalk.green.bold(\"Sorry! Not enough of that item in stock.\"));\n console.log(chalk.green.bold(\"===================================================\"));\n newOrder();\n\n } else {\n //list item information for user for confirm prompt\n console.log(chalk.green.bold(\"===================================================\"));\n console.log(chalk.green.bold(\"Awesome! We can fulfull your order.\"));\n console.log(chalk.green.bold(\"===================================================\"));\n console.log(chalk.green.bold(\"You've selected:\"));\n console.log(chalk.green.bold(\"----------------\"));\n console.log(chalk.green.bold(\"Item: \" + res[i].productName));\n console.log(chalk.green.bold(\"Department: \" + res[i].departmentName));\n console.log(chalk.green.bold(\"Price: $\" + res[i].price));\n console.log(chalk.green.bold(\"Quantity: \" + selection.units));\n console.log(chalk.green.bold(\"----------------\"));\n console.log(chalk.green.bold(\"Total: $\" + res[i].price * selection.units));\n console.log(chalk.green.bold(\"===================================================\\n\"));\n\n var newStock = (res[i].stockQuantity - selection.units);\n var purchaseId = (selection.itemID);\n //console.log(newStock);\n confirmPrompt(newStock, purchaseId);\n }\n }\n });\n })\n}", "function orderItem(id, quantNeeded) {\n connection.query('Select * FROM products WHERE item_id = ' + id, function(err,res){\n if(err){\n console.log(err);\n };\n if (quantNeeded <= res[0].stock_quantity)\n {\n var totalCost = res[0].price * quantNeeded;\n console.log(\"Sufficient quantity is available for your order.\");\n console.log(\"Total cost for \" + quantNeeded + \"s \" + res[0].product_name + \" is \" + totalCost);\n connection.query(\"UPDATE products SET stock_quantity = stock_quantity - \" + quantNeeded + \" WHERE item_id = \" + id);\n }\n else\n {\n console.log(\"We don't have that many \"+ res[0].product_name + \"s in stock!\")\n }\n productList();\n });\n}", "function sellProduct(productId) {\n let productsList = loadProducts();\n let productMatch = productsList.find(product => product.id == productId);\n console.log(productMatch);\n productMatch.quantity -= 1;\n saveProductsList(productsList);\n displayProducts(productsList);\n}", "async purchaseItem(itemId) {\n const purchase_result = await this.__request(`https://dragonsofmugloar.com/api/v2/${this.game.gameId}/shop/buy/${itemId}`, \"POST\");\n\n if (purchase_result) {\n const {gold, level, lives, shoppingSuccess, turn} = purchase_result;\n if (!shoppingSuccess) {\n console.log(\"Cannot buy this item!\");\n }\n await this.updateGameState(lives, gold, null, null, turn, level);\n }\n\n }", "function purchase() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n console.table(res);\n inquirer.prompt([{\n name: \"itemId\",\n type: \"number\",\n message: \"Enter the item ID of the item you want to buy.\".brightYellow\n },\n {\n name: \"itemQuantity\",\n type: \"number\",\n message: \"Excellent Choice! How many would you like?\".brightYellow\n }]).then(function (answer) {\n saleItem = answer.itemId - 1;\n saleQuantity = answer.itemQuantity;\n checkInv()\n\n });\n\n });\n\n}", "function bamazonList() {\n inquirer.prompt([{\n name: \"itemId\",\n type: \"input\",\n message: \"What is the itemID for desired purchase?\"\n }, {\n name: \"quantity\",\n type: \"input\",\n message: \"What is the quantity of your desired purchase?\"\n }]).then(function (answer) {\n for (var i = 0; i < results.length; i++) {\n if (results[i].item_id === parseInt(answer.itemId)) {\n //Statement to notify and prompt customer if quantity is out of stock\n if (results[i].stock_quantity < parseInt(answer.quantity)) {\n console.log(\"Out of Stock, Try Again\");\n buyPrompt();\n } else {\n //Variables that calculates the purchase and total quantity\n var totalOrder = parseFloat(answer.quantity * results[i].price).toFixed(2);\n var quan = results[i].stock_quantity - answer.quantity;\n\n //Variable that executes updated quantity\n var newQuan = 'UPDATE `products` SET `stock_quantity` = ' + quan + ' WHERE `item_id` = ' + answer.itemId\n connection.query(newQuan, function (err, result) {\n if (err) {\n console.log(err);\n } else {\n console.log(result.affectedRows + \" product updated\");\n }\n });\n console.log(\"You bought \" + answer.quantity + \" \" + results[i].product_name);\n console.log(\"The total is \" + totalOrder);\n }\n }\n }\n });\n }", "function order() {\n connection.query('SELECT * FROM products', function (err, res) {\n if (err) throw err;\n inquirer\n .prompt([\n {\n name: 'choice',\n type: 'input',\n message: 'Please enter the item id of the product'\n },\n {\n name: 'quantity',\n type: 'input',\n message: 'How many of this item would you like to purchase?'\n\n }\n ])\n\n //function answer will notify user if quantity desired is insufficient or will fulfill the order,\n //subtract the amount purchased from the stock available, and will notify the user that the order\n //has been fulfilled\n .then(function (answer) {\n\n var selectedItem = res[parseInt(answer.choice) - 1];\n\n if (parseInt(selectedItem.stock_quantity) < parseInt(answer.quantity)) {\n console.log('Insufficent quantity for your purchase order');\n another();\n } else {\n\n connection.query(\n 'UPDATE products SET ? WHERE ?',\n [\n {\n stock_quantity: parseInt(selectedItem.stock_quantity) - parseInt(answer.quantity)\n },\n {\n item_id: selectedItem.item_id\n }\n ],\n\n function (error) {\n if (error) throw (error);\n totalPrice += selectedItem.price\n console.log('\\nYour order has been successfully placed' + '\\nYour total is: $' + totalPrice * answer.quantity);\n another();\n });\n }\n })\n })\n}", "static sellItem(data = null, itemID) {\n if (data !== null) {\n if (!data.error) {\n swal('Success!', 'Sucessfully sold your Item!', 'success')\n equipment.reload();\n } else {\n swal('Error!', data.error_msg, 'error');\n equipment.reload();\n }\n } else {\n $(\".loading-screen\").show();\n let params = {\n 'ITEM_ID': itemID,\n };\n equipment.sendRequest('sellItem', 'sell_item', params);\n }\n }", "function itemToBuy() {\n\n inquirer.prompt({\n name: \"id\",\n type: \"input\",\n message: \"Please enter the ID number for the product you would like to buy\",\n\n }).then(function (selected) {\n selected = parseInt(selected.id)\n console.log(\"you selected item #\" + selected)\n // pulling items from sql\n var query = \"SELECT * FROM products WHERE id =\" + selected;\n\n connection.query(query, { id: selected }, function (err, res) {\n if(err) throw err;\n for (var i = 0; i < res.length; i++) {\n // res.push({ id: res[i].id, product: res[i].product_name, department: res[i].department_name })\n var product = res[i].product_name;\n var stock = res[i].stock_quantity;\n var cost = res[i].price;\n var department = res[i].department_name;\n var id = res[i].id;\n // console.log(product)\n console.log({\n id: id,\n product: product,\n department: department,\n stock_quantity: stock\n })\n quantity();\n function quantity() {\n // if for if there is not enough in the stock\n if (stock >= 1) {\n inquirer.prompt({\n name: \"stock_quantity\",\n type: \"input\",\n message: \"Please enter the number of units you would like to buy\"\n }).then(function (data) {\n data = parseInt(data.stock_quantity)\n // console.log(stock)\n // if statement for if the choose to much of an item\n if (data <= stock) {\n // calc total for total price cust owes\n total = data * cost\n console.log(\"You are buying \" + data + \" \" + product + \"s\")\n console.log(\"Your total is $\" + total)\n endStart();\n var query = \"UPDATE products SET stock_quantity = (stock_quantity - \" + data + \") WHERE id =\" + selected;\n // console.log(query)\n \n connection.query(query, function (err, res) {\n if (err) throw err;\n });\n //end program or restart\n \n } else {console.log(\"Sorry there is not enough \" + product + \"s in our inventory please select a lower quantity or try again later\")\n //end program\n endStart();}\n })\n } else{ console.log(\"Sorry we are out of \" + product + \"s\")\n endStart();}\n }\n }\n })\n });\n}", "function wdyw() {\n // query the database for all items being auctioned\n connection.query(\"SELECT * FROM items\", function(err, results) {\n if (err) throw err;\n //prompt user to selct product & qty\n inquirer\n .prompt([\n {\n name: \"productid\",\n type: \"rawlist\",\n choices: function() {\n var idArray = [];\n for (var i = 0; i < results.length; i++) {\n idArray.push(results[i].item_id);\n }\n return idArray;\n },\n message: \"Enter the item id of the product you would like to purchase\"\n },\n {\n name: \"quantity\",\n type: \"input\",\n message: \"How many units of this item would you like?\",\n validate: function(value) {\n if (isNaN(value) === false) {\n return true;\n }\n return false;\n }\n }\n ])\n .then(function(answer) {\n //console.log(answer)\n //console.log(results)\n // get the information of the chosen item\n var chosenItem;\n for (var i = 0; i < results.length; i++) {\n if (results[i].item_id === answer.productid) {\n chosenItem = results[i];\n }\n }\n //console.log(chosenItem)\n // based on their answer check to see if we have enough in stock\n if(chosenItem.stock_quantity >= parseInt(answer.quantity)) {\n //enough stock to fill order so update db by reducting qty on product\n connection.query(\n \"UPDATE items SET ? WHERE ?\",\n [\n {\n stock_quantity: chosenItem.stock_quantity - answer.quantity\n },\n {\n item_id: chosenItem.productid\n }\n ],\n function(error) {\n if (error) throw err;\n let total = answer.quantity*chosenItem.price;\n console.log(\"Your order total is \" + total);\n wdyw();\n }\n );\n }\n else {\n //out of stock\n console.log(\"Insufficient quantity!\"); \n wdyw();\n } \n });\n })}", "function placeOrder() {\n updating = true;\n updateQuantity();\n getProducts();\n }", "function processOrder(user_item_id,user_quantity) {\n \n // Gets the quantity of the user's request item\n connection.query(\"SELECT price, stock_quantity, product_sales FROM products WHERE item_id =\" + user_item_id, function(err, res) {\n if (err) throw err;\n\n // Test for enough quantity\n if (user_quantity <= res[0].stock_quantity) {\n\n // Calculates new quantity, cost, and product sales\n var new_quantity = res[0].stock_quantity - user_quantity;\n var cost = user_quantity * res[0].price;\n var new_product_sales = res[0].product_sales + cost;\n\n // Updates quantity and product sales in the database\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [ {stock_quantity: new_quantity,\n product_sales: new_product_sales},\n {item_id: user_item_id}],\n function(err, res) {\n if (err) throw err;\n\n // Shows the user the cost\n console.log(\"The cost of your order is $\" + cost);\n connection.end();\n })\n }\n else {\n console.log(\"Insufficient quantity in stock\");\n connection.end();\n }\n })\n}", "sellItemtoVendor(x, y, item, client, clientPub, vendorChannel, itemsObj){\n\t\tlet temp = this.findVendor(x, y, client);\n\t\tlet vendorID = null;\n\t\tif(temp.type === \"vendor\" && temp !== false){\n\t\t\tlet vendorID = temp.vendor.vendorID;\n\t\t\tlet found = false;\n\t\t\tfor(let i = 0, j = this.vendors[vendorID].items.length; i<j; i++){\n\t\t\t\tif(item.item === this.vendors[vendorID].items[i].item){\n\t\t\t\t\t//if vendor already has this item, increase quantity\n\t\t\t\t\tthis.vendors[vendorID].items[i].quantity++;\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!found){\n\t\t\t\t//else give quantity 1 and add to vendor items\n\t\t\t\tlet temp = item;\n\t\t\t\ttemp.quantity = 1;\n\t\t\t\tthis.vendors[vendorID].items.push(temp);\n\t\t\t}\n\t\t\t(async () => {\n\t\t\t\tclientPub.publish(vendorChannel, JSON.stringify({\n\t\t\t\t\titems: this.vendors[vendorID].items,\n\t\t\t\t\tvendor: vendorID\n\t\t\t\t}));\n\t\t\t})();\n\t\t\t(async () => {\n\t\t\t\tclient.hset('vendor', vendorID, JSON.stringify(this.vendors[vendorID].items));\n\t\t\t})();\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function isSellOrder(order) {\n return (order.side == \"ask\");\n}", "function purchase(itemId, neededQuant) {\n connection.query(`SELECT * FROM products WHERE id = ${itemId}`, function (err, res) {\n if (err) throw err;\n if(res[0].stock_quantity < neededQuant) {\n console.log(\"Insufficient stock! Sorry. Please check again.\")\n } else {\n connection.query(`UPDATE products SET stock_quantity = ${res[0].stock_quantity} - ${neededQuant} WHERE id = ${itemId}`);\n //sets price to a variable for easy use\n var total = res[0].price * neededQuant;\n console.log(`\nYour total today comes up to ${total}. Thank you for shopping and please come again.\n `)\n }\n connection.end();\n });\n}", "function buyProduct() {\n\n // get the user's purchase request\n inquirer.prompt([\n {\n name: \"id\",\n type: \"input\",\n message: \"What is the ID of the product you want to buy?\",\n default: defId\n },\n {\n name: \"qty\",\n type: \"input\",\n message: \"How many do you want to buy?\",\n default: defQty\n }\n ]).then(function (answers) {\n\n var id = answers.id;\n var qty = answers.qty;\n\n // get the necessary information from the database to actually process the order\n connection.query(\"SELECT product_name, department_id, price, stock_quantity FROM products WHERE item_id = ?;\", [id], function (err, rows, fields) {\n\n if (err) throw err;\n\n // different cases of database results\n switch (rows.length) {\n // One row returned is the normal case as the requested id should be unique\n case 1:\n var namProduct = rows[0].product_name;\n var idDept = rows[0].department_id;\n var prcProduct = rows[0].price;\n var qtyStock = rows[0].stock_quantity;\n // check for sufficient inventory for the order\n if (qtyStock >= qty) {\n // if sufficient inventory then execute the order and update the database\n connection.query(\"UPDATE products SET stock_quantity = ? WHERE item_id = ?;\", [(qtyStock - qty), id], function (err, rows, fields) {\n if (err) throw err;\n // compute the total price to the customer for this order and display it for the customer\n var totSale = qty * prcProduct;\n console.log(\"\\n\\nYour total price for: \" + namProduct + \", Quantity: \" + qty + \" is $\" + totSale.toFixed(2) + \"\\n\\n\");\n // add the total price for this order to the department sales total in the database\n connection.query(\"UPDATE departments SET total_sales = total_sales + ? WHERE department_id = ?;\", [totSale, idDept], function (err, rows, fields) {\n if (err) throw err;\n // ask the customer if they want to continue purchasing more products\n buyMore();\n });\n });\n } else {\n // if there is insufficient inventory for the initial order, ask the customer if they would still like to purchase a smaller amount\n inquirer.prompt([\n {\n name: \"qty\",\n type: \"confirm\",\n message: \"There is insufficient quantity for your order. Do you want still want to buy some?\"\n }\n ]).then(function (answers) {\n // if the user does want to buy a smaller quantity, set the order defaults and go back to the start of the purchase process\n if (answers.qty) {\n defId = id;\n defQty = qtyStock;\n buyProduct();\n // otherwise just ask the customer if they would like to buy any other products\n } else {\n buyMore();\n }\n });\n }\n break;\n // if no rows were returned from the original product query, then let the customer know the product id was invalid and ask if they would like to continue\n case 0:\n console.log(\"Sorry, there is not a product with ID: \" + id);\n buyMore();\n break;\n }\n\n });\n\n });\n\n}", "function purchaseItem(quantity, id) {\n var query = connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: quantity--\n },\n {\n id: id\n }\n ],\n function (err, res) {\n // console.log(res);\n if (err) throw err;\n // console.log(\"Product updated.\");\n buyItem();\n }\n )\n return buyItem();\n\n}", "function purchaseOrder(ID, quantity) {\n connection.query('Select * FROM products WHERE item_id = ' + ID, function (err, res) {\n if (err) {\n console.log(err)\n };\n if (quantity <= res[0].stock_quantity) {\n var totalCost = res[0].price * quantity;\n console.log(\"Still available!\");\n console.log(\"Your total cost for \" + quantity + \" \" + res[0].product_name + \" is \" + totalCost + \" Thank you!\");\n\n connection.query(\"UPDATE products SET stock_quantity = stock_quantity - \" + quantity + \" WHERE item_id = \" + ID);\n } else {\n console.log(\"Sorry, we do not have that many \" + res[0].product_name + \" to complete your order.\");\n };\n displayItems();\n });\n}", "function buyItem() {\n inquirer\n .prompt([\n {\n name: 'itemId',\n type: 'input',\n message: 'Which item would you like to buy? (Please put in the Item ID)',\n validate: function(value) {\n if (isNaN(value) === false && parseInt(value) > 0 && parseInt(value) <= 10) {\n return true;\n }\n return 'Please put in valid Item ID.';\n }\n },\n {\n name: 'quantity',\n type: 'input',\n message: 'How many would you like to buy?',\n validate: function(value) {\n if (isNaN(value) === false && parseInt(value) > 0) {\n return true;\n }\n return \"Please enter valid quantity.\";\n }\n }\n ]).then(function(answer){\n var query = 'SELECT * FROM products WHERE item_id = ?';\n connection.query(query, [answer.itemId], function(err, res){\n \n // Checking if have enough inventory.\n if(answer.quantity > res[0].stock_quantity){\n console.log('Insufficient Quantity');\n console.log('This order has been cancelled');\n console.log('');\n newOrder();\n }\n else{\n totalPrice = res[0].price * answer.quantity;\n console.log('Your Total is $' + totalPrice);\n console.log('Thank you for your order and enjoy!');\n console.log('');\n\n //update products table\n connection.query('UPDATE products SET ? Where ?', [{\n stock_quantity: res[0].stock_quantity - answer.quantity\n },{\n item_id: answer.itemId\n }], function(err, res){});\n newOrder();\n }\n })\n \n }, function(err, res){})\n}", "placeOrder() {\n var cartItems = this.state.itemList.filter((e)=> (e.isChecked == true))\n console.log('cartItems :', JSON.stringify(cartItems));\n\n if(cartItems.length) {\n var numOfPackage = this.findNumOfPackage(cartItems);\n console.log('numOfPackage :', numOfPackage);\n\n if(numOfPackage == 1) {\n this.createCartList(cartItems, numOfPackage);\n } else {\n cartItems.sort((a, b) => parseInt(b.Weight) - parseInt(a.Weight));\n console.log('cartItems :', JSON.stringify(cartItems));\n\n var Package = [];\n cartItems.forEach((val, index) => {\n if(index < numOfPackage) {\n for(var i=0; i<numOfPackage; i++) {\n if(i == index) {\n Package[i] = [];\n Package[i].push(val);\n return;\n }\n }\n } else {\n Package.sort(this.sortFunction);\n for(var i=0; i<numOfPackage; i++) {\n var TPRIZE = 0;\n for(var j=0; j<Package[i].length; j++) {\n TPRIZE += Package[i][j].Price;\n }\n\n if (TPRIZE + val['Price'] <= maxOrderPrice) {\n Package[i].push(val);\n return;\n }\n }\n }\n })\n\n this.createCartList(Package, numOfPackage);\n }\n } else {\n alert(\"choose any item to place order\");\n }\n }", "function purchaseItem(itemName, quantity){\n connection.query( \"UPDATE products SET stock_quantity = stock_quantity - ? WHERE item_id = ?\",\n [quantity, itemName.id],\n function (err, res) {\n console.log(\"You purchased \" + quantity + \" \" + itemName.product_name);\n displayProducts();\n }\n );\n}", "function buy (id, quanityNum, quanity){\n // console.log(\"this is hte BUY function\")\n // console.log(\"this is quanity \"+quanity)\n // console.log(\"this is quanityNum \"+quanityNum)\n quanityNum -= quanity\n // console.log(\"new quanityNum =\"+quanityNum)\n var query = 'UPDATE products SET ? WHERE ?'\n connection.query(query,[{StockQuantity : quanityNum},{itemID:id}], function(err,res){\n if (err)throw err;\n console.log(\"=========================\")\n console.log(\"ORDER PLACED SUCESSFULLY!\")\n console.log(\"=========================\")\n });\n var select = 'SELECT Price FROM products WHERE ?'\n connection.query(select,{itemID : id}, function(err, res){\n if (err) throw err;\n var priceEach = res[0].Price;\n var totalPrice = priceEach * quanity\n console.log(\"Your order total is \"+totalPrice);\n return;\n });\n\n//remove items from the database Stock Quantity based on user choice, message order complete. \n\n\nreturn;\n}", "function onClickActionBuyItem(){\n\t\tconst itemlist = CashShop.cartItem;\n\t\tCashShop.cartItemLen = itemlist.length;\n\n\t\tCashShop.ui.find('#purchase-btn').prop('disabled', true);\n\t\tUIManager.showPromptBox( 'Are you sure you want to buy this items?', 'ok', 'cancel', function(){\n\t\t\tif(CashShop.cartItem.length > 0){\n\t\t\t\tvar pkt \t= new PACKET.CZ.SE_PC_BUY_CASHITEM_LIST();\n\t\t\t\tpkt.kafraPoints \t= 0;\n\t\t\t\tpkt.item_list \t\t= CashShop.cartItem;\n\t\t\t\tNetwork.sendPacket(pkt);\n\t\t\t} else {\n\t\t\t\tUIManager.showMessageBox( 'No item in cart!', 'ok');\n\t\t\t\tChatBox.addText( 'No item in cart!', ChatBox.TYPE.INFO);\n\t\t\t\tCashShop.ui.find('#purchase-btn').prop('disabled', false);\n\t\t\t}\n\t\t}, function(){\n\t\t\tCashShop.ui.find('#purchase-btn').prop('disabled', false);\n\t\t});\n\t}", "function getAndSetSellingPriceforEachItem()\r\n{\r\n\tvar submittedItemRecord = 0;\r\n\r\n\ttry\r\n\t{\r\n\t\t//if items are available\r\n\t\tif(itemRecords != null)\r\n\t\t{\r\n\r\n\r\n\t\t\t//looping through each item record\r\n\t\t\tfor(var itemIndex = 0; itemIndex <= itemRecords.length; itemIndex++)\r\n\t\t\t{\r\n\t\t\t\titemCausedError = false;\r\n\t\t\t\tnlapiLogExecution('audit', 'context.getRemainingUsage()', context.getRemainingUsage());\r\n\r\n\t\t\t\tif(context.getRemainingUsage() <= scriptUsageLimit || (itemIndex == itemRecords.length))\r\n\t\t\t\t{\r\n\t\t\t\t\tnlapiLogExecution('audit', 'rescheduling context.getRemainingUsage()', context.getRemainingUsage());\r\n\r\n\t\t\t\t\t//reschedule this script.\r\n\t\t\t\t\tnlapiScheduleScript(context.getScriptId(), context.getDeploymentId());\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\telse \r\n\t\t\t\t{\r\n\t\t\t\t\titemIntID = itemRecords[itemIndex].getValue(itemColumns[0]);\t\t\t\t//getting Item's internal id\r\n\t\t\t\t\titemType = itemRecords[itemIndex].getRecordType();\t\t\t\t\t\t\t//getting Item's type\r\n\t\t\t\t\tbasePrice = itemRecords[itemIndex].getValue(itemColumns[1]);\t\t\t\t//getting Item's base price\r\n\t\t\t\t\titemName = itemRecords[itemIndex].getValue(itemColumns[2]);\t\t\t\t\t//getting Item's name\r\n\t\t\t\t\tvolumetricWeight = itemRecords[itemIndex].getValue(itemColumns[4]);\t\t\t//getting Item's volumetric weight\r\n\t\t\t\t\tdimension1 = itemRecords[itemIndex].getValue(itemColumns[6]);\t\t\t\t//getting Item's dimension1\r\n\t\t\t\t\tdimension2 = itemRecords[itemIndex].getValue(itemColumns[7]);\t\t\t\t//getting Item's dimension2\r\n\t\t\t\t\tdimension3 = itemRecords[itemIndex].getValue(itemColumns[8]);\t\t\t\t//getting Item's dimension3\r\n\r\n\t\t\t\t\t//if the item is a Kit/package (Reason : kit package has no standard average cost, hence a custom field has been used)\r\n\t\t\t\t\tif(itemType == 'kititem')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\taverageCost = itemRecords[itemIndex].getValue(itemColumns[5]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse //if the item is not a kit/package \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\taverageCost = itemRecords[itemIndex].getValue(itemColumns[3]);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(averageCost == '')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\taverageCost = 0.1;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//The item price calculation is done only for following item types \r\n\t\t\t\t\t//(Reason : the multi - currency,multi - pricing and quantity pricing is affecting the following types of items )\t\t\t\r\n\t\t\t\t\t//switch (itemType) \r\n\t\t\t\t\t//{\r\n\t\t\t\t\t//case 'inventoryitem':\r\n\t\t\t\t\t//case 'kititem':\r\n\t\t\t\t\t//case 'noninventoryitem':\r\n\t\t\t\t\t//\tcase 'otherchargeitem':\r\n\t\t\t\t\t//case 'paymentitem':\r\n\r\n\t\t\t\t\t// NOTE : (basePrice != null) is not working\r\n\t\t\t\t\t//if those records are not empty (NOTE : Without those the SOAP request will not work)\r\n\t\t\t\t\tif(basePrice != '' && (dimension1 != '' && dimension2 != '' && dimension3 != '' && volumetricWeight != '')) \t\t\t\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tbasePrice = convertToFloat(basePrice);\t\t\t\t//converting the base price to float value with two decimal points\r\n\r\n\t\t\t\t\t\titemRecord = nlapiLoadRecord(itemType,itemIntID);\t//loading the particular item record\r\n\r\n\t\t\t\t\t\tgetPriceLevelAndCurrencyRateForEachDestination();\t//calling the getPriceLevelAndCurrencyRateForEachDestination function\r\n\r\n\t\t\t\t\t\t//if no error in creating shipping lookup record\r\n\t\t\t\t\t\tif(submittedShippingLookupRecord >0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t//update the field\r\n\t\t\t\t\t\t\titemRecord.setFieldValue('custitem_itemprice_lastupdated', nsToday);\r\n\t\t\t\t\t\t\titemCausedError = false;\r\n\t\t\t\t\t\t\t//submitting the item record after setting all the item prices for each destination and for particular price levels \r\n\t\t\t\t\t\t\tsubmittedItemRecord = nlapiSubmitRecord(itemRecord);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\titemCausedError = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\titemCausedError = true;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t//calling updateItemErrorFlag function\r\n\t\t\t\t\tupdateItemErrorFlag();\r\n\r\n\t\t\t\t\t//\tbreak;\r\n\t\t\t\t\t//}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\t\t}\r\n\r\n\t}\r\n\tcatch(e)\r\n\t{\r\n\t\terrorHandler(\"getAndSetSellingPriceforEachItem : \" , e);\r\n\t} \r\n\r\n}", "function buyItem(guid) {\n print(\"Trying to buy item \" + guid);\n\n var inventory = getInventory(currentMerchant);\n\n for (var i = 0; i < inventory.length; ++i) {\n var item = inventory[i];\n if (item.id == guid) {\n // Pay for it and only if that succeeds, move it\n if (Party.money.getTotalCopper() < item.worth) {\n print(\"Player doesn't have enough money.\");\n return;\n }\n Party.money.addCopper(- item.worth);\n\n inventory.splice(i, 1); // Remove from container\n\n if (!currentPlayer.content)\n currentPlayer.content = [];\n\n currentPlayer.content.push(item);\n\n // Refresh the UI\n MerchantUi.refresh();\n\n return;\n }\n }\n\n print(\"Unknown item guid: \" + guid);\n }", "function purchaseItem(...fns)\n\n\n{} // & these spreads functions", "function buyMore(qty, id) {\n inquirer.prompt(\n {\n name: \"continue\",\n type: \"confirm\",\n message: \"Would you like to continue shopping?\"\n }\n ).then(function(answer) {\n // if the answer is yes, run customer order\n if (answer.continue === true) {\n updateStock(qty, id);\n products();\n\n }\n else {\n process.exit(0);\n }\n });\n}", "async forceSell(item, quantity) {\n const res = await this.client.action(\"forceSell\", {\n itemName: item,\n quantity: quantity,\n storeName: this.store,\n });\n if (res.success) {\n this.editCache(item, quantity);\n await this.client.update(res.playerStringified);\n }\n return { success: res.success, msg: res.msg };\n }", "processProductSale(name) {\n // we look at the stock of our store and run a function forEach that takes an item in as a parameter\n this.stock.forEach(item => {\n // if the name of the item equals a name\n if (item.name === name) {\n // and if the item count is greater than zero\n if (item.count > 0) {\n // we decrement the item count by one\n item.count--;\n // then we increase the store revenue by the price of the item\n this.revenue += item.price;\n // we then console.log that the item was purchased for its price\n console.log(`Purchased ${item.name} for ${item.price}`);\n } else {\n // if the item is out of stock, we console.log this\n console.log(`Sorry, ${item.name} is out of stock!`);\n }\n }\n });\n }", "function buy() {\n \n //this prompts the user as to which item to buy, the item ID is what is used for the rest of the function to know what it is pulled from the database\n inquirer.prompt({\n name: \"chosenItem\",\n type: \"input\",\n message: \"Which item would you like to buy?\"\n }).then(function (answer) {\n console.log(answer.chosenItem);\n var wantToBuy = answer.chosenItem;\n var query = \"SELECT item_id, product_name, price, stock_quantity FROM products WHERE ?\"\n connection.query(query, { item_id: wantToBuy }, function (err, res) {\n if (err) throw err;\n\n for (var i = 0; i < res.length; i++) {\n console.log(\"\\n Item ID: \" + res[i].item_id + \" | Product Name: \" + res[i].product_name + \" | Price: \" + res[i].price + \"\\n\");\n \n //this prompt asks if the user is sure they want to buy this item\n inquirer.prompt({\n name: \"purchase\",\n type: \"rawlist\",\n message: \"Are you sure you want to buy this item?\",\n choices: [\"Yes\", \"No\"]\n }).then(function (answer) {\n connection.query(query, { item_id: wantToBuy }, function (err, res) {\n \n console.log(answer.purchase);\n console.log(wantToBuy);\n for (var i = 0; i < res.length; i++) {\n \n // if the user selects \"no\", the function will run again so they can select an item they do want\n if (answer.purchase === \"No\"){\n return buy();\n } else {\n console.log(\"We have \" + res[i].product_name + \" in stock. There is \" + res[i].stock_quantity + \" left in stock.\");\n };\n };\n \n // this prompt allows the quantity to be selected \n inquirer.prompt({\n name: \"quantityAmount\",\n type: \"number\",\n message: \"Please enter the how many you want to purchase.\"\n }).then(function (answer) {\n\n connection.query(query, { item_id: wantToBuy }, function (err, res) {\n for (var i = 0; i < res.length; i++) {\n var wantedQuantity = answer.quantityAmount;\n var subtractedQuantity = res[i].stock_quantity - wantedQuantity;\n \n //this will check if the the user's amount is within the amount that Bamazon has.\n if (answer.quantityAmount > res[i].stock_quantity){\n console.log(\"I'm sorry, we do not have that much. Please select another amount\");\n return buy();\n } else \n var originalCost = res[i].price;\n var totalPrice = originalCost * wantedQuantity;\n console.log(\"That will cost: $\" + totalPrice);\n function update() {\n var update = connection.query(\"UPDATE products SET ? WHERE ?\",\n [\n { stock_quantity: subtractedQuantity },\n { item_id: wantToBuy }\n ], function (err, res) {\n \n console.log(\"Products updated! \\n\");\n \n }\n\n );\n console.log(\"Thank you for your purchase!\");\n };\n update();\n connection.end();\n };\n })\n\n })\n });\n });\n };\n console.log(\"\\n\");\n });\n });\n}", "function purchase () {\n // prompting the user what they want and what quantity\n\tinquirer.prompt([\n \t{\n \ttype: \"input\",\n \tname: \"item\",\n \tmessage: \"Which item do you want to purchase? (Please type item ID)\"\n \t}, {\n \tname: \"quantity\",\n \ttype: \"input\",\n \tmessage: \"How many would you like?\"\n // processing customer purchase\n \t}]).then(function(answers) {\n var item = answers.item;\n var quantity = answers.quantity;\n\n // connecting the the database to check for availability and update stock quantity\n connection.query(\"SELECT stock_quantity, price FROM products WHERE id=\" + item, function (err,res) {\n var stockQuantity = res[0].stock_quantity;\n var total = res[0].price * quantity;\n var newStock = stockQuantity - quantity;\n\n // if their quantity exceeds the inventory the order does not go through\n if (newStock < 0){\n console.log(\"Insufficient quantity! Try again.\");\n purchase();\n }\n // if the inventory is available, quantity in the database is updated\n // and the customer is given their total\n else {\n connection.query(\"UPDATE products SET stock_quantity=\" + newStock + \"WHERE item_id=\" + item, function (err,res) {\n });\n console.log(\"Success! Your total is $\" + total);\n }\n\n });\n\t});\n}", "buyItem(item) {\n console.log(\"Buying Item:\", item.name);\n }", "function buyProducts() {\n inquirer.prompt([\n {\n name: \"chosenItem\",\n type: \"input\",\n message: \" Please choose an Item ID to buy a product \",\n\n validate: function (value) {\n if (isNaN(value) === false) {\n return true;\n } else {\n return (\"enter a valid id from the list\");\n }\n\n }\n },\n {\n name: \"chosenQuantity\",\n type: \"input\",\n message: \" Please enter the quantity to buy?\",\n\n validate: function (value) {\n if (isNaN(value) === false) {\n return true;\n } else {\n return (\"Please enter a number\");\n }\n\n }\n }\n ])\n .then(function (answer) {\n\n connection.query(`SELECT * from products WHERE item_id = ${answer.chosenItem}`, function (err, res) {\n\n if (err) throw err;\n\n for (var i = 0; i < res.length; i++) {\n\n console.log(\"Your Product choice is : \" + res[i].product_name);\n console.log(\"We currently have a quantity of: \" + res[i].stock_quantity);\n if (res[i].stock_quantity < answer.chosenQuantity) {\n console.log(\"Sorry! There is not enough quantity of this product in the stock\");\n nextPurchase();\n }\n\n else {\n\n console.log(\"your order has been placed.\");\n //console.log(\"are you sure you want to buy\"+ answer.chosenQuantity);\n console.log(\"Your total purchase for \" + answer.chosenQuantity + \" \" + res[i].product_name + \" \" + \"was: \" + res[i].price * answer.chosenQuantity);\n\n var newQuantity = res[i].stock_quantity - answer.chosenQuantity;\n console.log(\"we have now \" + newQuantity + \" \" + \"in stock\");\n connection.query(\"Update products SET stock_quantity = \" + newQuantity + \"WHERE item_id = \" + res[i].item_id, function (err, res) {\n // if (err) throw err;\n // console.log(\"Thanks for shopping!\")\n nextPurchase();\n\n });\n\n };\n\n\n };\n\n });\n\n });\n}", "function purchaseOrder(ID, stockAmt){\n\tconnection.query('Select * FROM products WHERE item_id = ' + ID, function(err,res){\n\t\tif(err){console.log(err)};\n\t\tif(stockAmt <= res[0].stock_quantity){\n\t\t\tvar totalCost = res[0].price * stockAmt;\n console.log(\"IN STOCK!\");\n //Total cost\n console.log(\"Total cost = \" + stockAmt + \" \" +res[0].product_name+\"s\" + \" is \" + \"$\"+ totalCost);\n console.log(\"THANK YOU FOR YOUR PURSCHASE :)\");\n\t\t\tconnection.query(\"UPDATE products SET stock_quantity = stock_quantity - \" + stockAmt + \"WHERE item_id = \" + ID);\n\t\t} else{\n\t\t\tconsole.log(\"Insufficient quantity!\" + res[0].product_name);\n\t\t};\n\t\tdisplayProducts();\n\t});\n}", "function purchaseItem() {\n\tinquirer.prompt([{\n\t\tname: \"puchaseItemID\",\n\t\ttype: \"input\",\n\t\tmessage: \"What is the ID Number of the item you'd like to purchase?\",\n\t\tvalidate: function(value) {\n\t\t\tif (value >= 1 && value <= 12) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}, \n\n\t{\n\t\tname: \"purchaseQty\",\n\t\ttype: \"input\",\n\t\tmessage: \"How many of this item would you like to purchase?\",\n\t\tvalidate: function(value) {\n\t\t\tif (value) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\t\t\n\t}]).then(function(response) {\n\t\t// connection.query(\"SELECT * FROM products\", function(err, res) {\n\t\t\t// console.log(res);\n\t\t// });\n\t\torderItem(response);\n\t});\n}", "function purchaseItem(){\n inquirer.prompt([\n {\n name: \"id\",\n type: \"input\",\n message: \"Please enter item ID of item you would like to purchase.\",\n filter: Number\n },\n {\n name: \"Quantity\",\n type: \"input\",\n message: \"How many would you like to purchase?\",\n filter: Number\n },\n ]).then(function(response){\n var quantity = response.Quantity;\n var itemId = response.id;\n orderItem(itemId, quantity);\n });\n}", "function purchase(quantityRemaining, quantityRequest, price, id) {\n if (quantityRemaining < quantityRequest) {\n inquirer\n .prompt({\n name: \"editRequest\",\n type: \"rawlist\",\n message:\n \"Insufficient quantity to fullfill order. Would you like to change your request to a smaller value?\",\n choices: [\"Yes\", \"No\"]\n })\n .then(function(data) {\n if (data.confirm === \"No\") {\n console.log(\"Thank you for your business!\");\n connection.end();\n } else {\n runSearch();\n }\n });\n } else {\n total = total + price * quantity;\n connection.query(\n \"UPDATE products SET stock_quantity = stock_quantity - \" +\n quantity +\n \" WHERE ?\",\n [\n {\n item_id: id\n }\n ],\n //alert user of the balance for their current request, if they want to make additional purchases \n //then price and quantity is added to the \"total\" variable.\n function(err, res) {\n if (err) throw err;\n\n inquirer\n .prompt({\n name: \"confirm\",\n type: \"rawlist\",\n message:\n \"\\nYour total for this transaction is: $\" +\n (price * quantity).toString() +\n \". Would you like to make another purchase?\",\n choices: [\"Yes\", \"No\"]\n })\n .then(function(data) {\n if (data.confirm === \"No\") {\n console.log(\"\\nThe total for today is: $\" + total.toString());\n connection.end();\n } else {\n runSearch();\n }\n });\n }\n );\n }\n}", "'BUY_STOCK'(state, {shrimpId, quantity, shrimpPrice}) {\n \n // Checks to see which items are already in the array\n const record = state.shrimpInventoryData.find(element => element.id == shrimpId);\n \n // If item already exists then add to its quantity\n if (record) {\n \n record.quantity += quantity;\n \n }\n \n // If item is not in the array then add it\n else { state.shrimpInventoryData.push({\n \n id: shrimpId,\n \n quantity: quantity\n \n });\n }\n \n // Updates funds when an item is purchased\n state.funds -= shrimpPrice * quantity;\n \n }", "function postOrder(item, prodname, deptname, price, ordered, qoh) {\n\n var saleAmount = (price * ordered);\n var ordTime = moment().format(\"X\");\n \n\n connection.query(\n \"INSERT INTO orders SET ?\",\n {\n item: item,\n product: prodname,\n dept: deptname, \n price: price,\n qty: ordered,\n total_sale: saleAmount,\n processed: ordTime\n },\n function(err) {\n if (err) throw err;\n // console.log(\"order table updated\");\n }\n );\n \n // updates products table qoh after deducting sale qty\n var newboh = (qoh-ordered); \n var query = \"UPDATE products SET qoh = \" + newboh + \" WHERE item_id = \" + item;\n connection.query(query, function(err, res) {\n if (err) throw err;\n console.log(\".........Order Details...........\");\n runOrder();\n });\n}", "function processItem(qty, answer, dbResponse)\n{\n qty = parseInt(qty);\n\n var id = answer.stuff.substring(0,(answer.stuff.indexOf(\".\")));\n\n // console.log(\"ID: \", id);\n \n id = parseInt(id);\n\n // console.log(\"Ordering \", dbResponse[id-1].product_name, \"Quanity in Stock \", dbResponse[id-1].stock_quantity);\n if (qty <= dbResponse[id-1].stock_quantity)\n {\n // update inventory\n updateInventory(dbResponse[id-1], qty);\n }\n else\n { \n console.log(\"Sorry, inventory too low\");\n loopIt();\n }\n}", "function sellItem(itemName, startPrice, userId )\n\t{\t\n\t\titemName = \"electronics\" ;\t//TEST CODE REMOVE\n\t\tstartPrice = 12;\t\t\t//TEST CODE REMOVE\n\t\tuserId = 1;\t\t\t\t//TEST CODE REMOVE\n\n\t\t// object to post (body)\n\t\tvar item = {\n\t\t\t\"item_name\": itemName,\n\t\t\t\"starting_price\": startPrice,\n\t\t\t\"allUserId\": userId\n\t\t};\n\t\t\n\t\t$.ajax({\n \tmethod: \"POST\",\n \turl: \"/api/forsale\",\n \tdata: item\n\t })\n\t .done(function(data) {\n\t \tconsole.log(JSON.stringify(data, null, 2)); //TEST CODE\n\n\t \t//Logic using data here.\n\t \t\n\t });\n\t}", "async function BuyItem(receivedMessage)\r\n{\r\n\tvar authorID = receivedMessage.author.id; // Get user's ID\r\n\tvar balanceUnits = await GetBalance(authorID);\t// Get user's balance\r\n\r\n\t// Get the price the player's willing to pay\r\n\tvar price = receivedMessage.content.slice(6);\r\n\r\n\tif (price < 20)\r\n\t{\r\n\t\treceivedMessage.channel.send('Потратить можно только не менее 20-ти Юнитов!');\r\n\t\treturn;\r\n\t}\r\n\r\n\tif (price <= balanceUnits) // If there's enough money\r\n\t{\r\n\t\tvar item = await AddItem(receivedMessage, Math.floor(price / 2));\r\n\t\tawait SetBalance(authorID, balanceUnits - price); // Deduct money\r\n\t\treceivedMessage.channel.send('Покупка успешна, новый баланс ' + (balanceUnits - price) + ' Юнитов!'); // Show it was successful\r\n\t\treceivedMessage.channel.send(await GetItemString(receivedMessage, item, false, true, true));\r\n\t}\r\n\telse // If not enough funds\r\n\t{\r\n\t\treceivedMessage.channel.send('Недостаточно средств, нужно на ' + (price - balanceUnits) + 'Ю больше!'); // Show there was not enough funds\r\n\t}\r\n}", "sell(type) {\n if (this.game.player.buyCheck(this[type].cost, type)) {\n this.game.player.addClicks(this[type].clicks);\n this[type].cost = Math.ceil(this[type].cost * 1.4);\n }\n this.update();\n }", "function processOrder() {\n let order = \"\";\n if (id(\"bun\").checked) {\n order += \"bun-\";\n }\n if (id(\"protein\").checked) {\n order += \"protein-\";\n }\n if (id(\"cheese\").checked) {\n order += \"cheese-\";\n }\n if (id(\"sauce\").checked) {\n order += \"sauce-\";\n }\n if (id(\"toppings\").checked) {\n order += \"toppings-\";\n }\n if (id(\"sides\").checked) {\n order += \"sides-\";\n }\n fetch(\"/burger/order/\" + order)\n .then(checkStatus)\n .then(resp => resp.json())\n .then(randBurger)\n .catch(console.error);\n }", "function buyItem(id) {\n\titem = items[id];\n\tvar index = game.frat.items.indexOf(item.name);\n\tif (index != -1) {\n\t\talert(\"You already have this item!\");\n\t\treturn false;\n\t}\n\telse if (game.frat.cash < item.price) {\n\t\tconsole.log('you have: '+ game.frat.items);\n\t\talert(\"You don't have enough cash!\");\n\t\treturn false;\n\t}\n\telse {\n\t\tconsole.log('you used to have $' +game.frat.cash);\n\t\t\n\t\tgame.frat.cash -= item.price;\n\t\tgame.frat.items.push(item.name);\n\t\t\n\t\tgame.frat.itemMult.party += item.mult.party;\n\t\tgame.frat.itemMult.cs += item.mult.cs;\n\t\tgame.frat.itemMult.rush += item.mult.rush;\n\t\tgame.frat.itemMult.study += item.mult.study;\n\t\t\n\t\tconsole.log('Item ' + item.name + ' is bought');\n\t\tconsole.log('now you have: '+ game.frat.items);\n\t\tconsole.log('the new itemMult.party is '+ game.frat.itemMult.party);\n\n\t\treturn true;\n\t}\n}", "function sell (item) {\n if (game.fire) {\n if (item === 'sword' && game.sword >=1) {\n game.sword--\n const price = randomInt(settings.swordPriceMin, settings.swordPriceMax)\n game.gold += price\n return `You sold 1 ${item} for ${price} pieces of gold.`\n }else if (item === 'axe' && game.axe >=1) {\n game.axe--\n const price = randomInt(settings.swordPriceMin, settings.swordPriceMax)\n game.gold += price\n return `You sold 1 ${item} for ${price} pieces of gold.`\n } else {\n return `You dont have ${item} to sell.`\n }\n } else {\n return \"You must have to put out the fire.\" \n }\n }", "function takeOrder() {\n inquirer.prompt(\n [\n\n {\n name: \"itemID\",\n type: \"number\",\n message: \"Enter the item number of the product you would like to purchase.\"\n },\n {\n name: \"itemQuantity\",\n type: \"number\",\n message: \"How many would you like?\"\n }\n ]\n )\n .then(function (answer) {\n console.log(\"Okay, you would like to by \" + answer.itemQuantity + \" of item number: \" + answer.itemID);\n var selectedItem = answer.itemID;\n var selectedQuantity = answer.itemQuantity;\n processOrder(selectedItem, selectedQuantity);\n })\n}", "function displayItems() {\n\n// query the database for all items available for purchase\n connection.query(\"SELECT item_id, product_name, price FROM products\", function(err, res) {\n if (err) throw err;\n console.log(\"Items available for sale\");\n for(var i = 0; i < res.length; i++) {\n \tconsole.log(\"Item ID: \" + res[i].item_id + \" | Product Name: \" + res[i].product_name + \" | Price: \" + res[i].price);\n }\n inquirer.prompt([\n\n \t// Here we create a basic text prompt.\n \t{\n type: \"input\",\n name: \"id\",\n message: \"What is the id of the item you would like to buy?\"\n\n \t},\n\n {\n type: \"input\",\n name: \"quantity\",\n message: \"How many units would you like to buy?\"\n\n \t}\n\n //Storing all of the answers into an \"answers\" object that inquirer makes for us.\n ]).then(function (answer) {\n var quantity = answer.quantity;\n var itemId = answer.id;\n connection.query('SELECT * FROM products WHERE item_id=' + itemId, function(err, selectedItem) {\n \tif (err) throw err;\n if (selectedItem[0].stock_quantity - quantity >= 0) {\n var chargedPrice = answer.quantity * selectedItem[0].price;\n console.log('Thank you for your purchase. Your total is $'+ chargedPrice);\n\n connection.query('UPDATE products SET stock_quantity=? WHERE item_id=?', [selectedItem[0].stock_quantity - quantity, itemId],\n function(err, res) {\n \tif (err) throw err;\n // Runs the prompt again, so the user can keep shopping.\n displayItems();\n }); // Ends the code to remove item from inventory.\n\n }\n\n else {\n console.log(\"Insufficient quantity!\");\n displayItems();\n }\n });\n });\n });\n }", "function whatToBuy(){\n\tinquirer.prompt([\n\t\t\t{\n\t\t\t\tname:\"item\",\n\t\t\t\ttype:\"list\",\n\t\t\t\tmessage: \"Select the name of the item you would like to purchase:\", \n\t\t\t\tchoices: [\n\t\t\t\t\"purple wig\",\n\t\t\t\t\"round glasses\",\n\t\t\t\t\"red blazer\",\n\t\t\t\t\"black biker shorts\",\n\t\t\t\t\"red gown\",\n\t\t\t\t\"silver ring\", \n\t\t\t\t\"princess puppet\",\n\t\t\t\t\"pink wig\",\n\t\t\t\t\"stuffed cow\",\n\t\t\t\t\"sports car\"\n\t\t\n\t\t\t]},\n\t\t\t{\n\t\t\t\tname:\"itemNum\",\n\t\t\t\ttype:\"input\",\n\t\t\t\tmessage: \"What is your item's ID?\",\n\t\t\t\tvalidate: function(value){\n\t\t\t\t\tif(isNaN(value) === false){\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t{\n\t\t\t\tname:\"amount\",\n\t\t\t\ttype:\"input\",\n\t\t\t\tmessage: \"How many would you like to buy?\",\n\t\t\t\tvalidate: function(value){\n\t\t\t\t\tif(isNaN(value) === false){\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t// ,\n\t\t\t// // { //optional confirm feature \n\t\t\t// \ttype: \"confirm\",\n\t\t\t// \tmessage: \"Is that your final amount?\",\n\t\t\t// \tname:\"confirm\",\n\t\t\t// \tdefault: true\n\t\t\t// }\n\t\t])\n\t\t.then(function(response){\n\t\t\t//double check to see what the response confirms about the order \n\t\t\t// console.log(response);\n\t\t\t// //name\n\t\t\t// console.log(response.item);\n\t\t\t// //item's id\n\t\t\t// console.log(response.itemNum);\n\t\t\t// //amount ordered\n\t\t\t// console.log(response.amount);\n\t\t\t\n\t\t\t//query to be sure the database has the item in stock \n\t\t\tconnection.query(\"SELECT stock_quantity FROM products WHERE item_id=\" + response.itemNum, function (error, data){\n\t\t\t\t//returns the stock_quantity of the item_id from above as data\n\t\t\t\t// console.log(data);\n\t\t\t\t// console.log(response.amount);\n\t\t\t\t// console.log(data[0].stock_quantity);\n\t\t\t\tif (error) throw error;\n\t\t\t\t//if not an error, then see if the data from the query is greater than the response.amount\n\t\t\t\t\tif(data[0].stock_quantity >= response.amount){\n\t\t\t\t\t\tconsole.log(\"You are in luck; enjoy your item!\");\n\t\t\t\t\t\t//update the amount of product left in the stock_quantity column\n\t\t\t\t\t\t//query to update the database to make sure the amount of stock_quantity goes down by the response.amount\n\t\t\t\t\t\tconnection.query(\"UPDATE products SET stock_quantity = stock_quantity -\" + response.amount +\" WHERE item_id=\" + response.itemNum, function(error, data){\n\t\t\t\t\t\t\tif(error) throw error;\n\t\t\t\t\t\t\t//show the price to the customer for that item data here is an ok packet with affectedRows and messaage\n\t\t\t\t\t\t\t// console.log(data);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t//open another query to reveal the price for the item-- have to multiply by the response.amount to get total price\n\t\t\t\t\t\t\tconnection.query(\"SELECT price FROM products WHERE item_id=\" + response.itemNum, function(error, data){\n\t\t\t\t\t\t\t\t// console.log(JSON.stringify(data));\n\t\t\t\t\t\t\t\t//console.log(JSON.parse(data));\n\t\t\t\t\t\t\t\tif(error) throw error;\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//data come from the rowdatapacket array/objects to give me the price for that response.itemNum \n\t\t\t\t\t\t\t\t\tnewPrice = data[0].price;\n\t\t\t\t\t\t\t\t\ttotalPrice = response.amount * newPrice;\n\t\t\t\t\t\t\t\t\tconsole.log(\"You ordered: \" + response.amount);\n\t\t\t\t\t\t\t\t\tconsole.log(\"Your total is: $\" + totalPrice);\n\t\t\t\t\t\t\t\tconsole.log(\"Thank you for using Bamazon! Make your next purchase below!\");\n\t\t\t\t\t\t\t\twhatToBuy();\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t})\n\t\t\t\t\t}\t\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tconsole.log(\"There was not enough stock; please try your purchase again with another item.\");\n\t\t\t\t\t\twhatToBuy();\n\t\t\t\t\t}\n\n\t\t\t\t})\n\t\t\t\n\t\t});\n}", "function purchase() {\n con.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n inquirer.prompt([\n {\n name: \"choice\",\n type: \"input\",\n message: \"Input ID of item you would like to purchase.\",\n validate: function(value) {\n\n //Validates if input is a number\n var pass = value.match(/\\d/g);\n if (pass) {\n return true;\n }\n return \"Please enter a number ID\" \n }\n },\n {\n name: \"quantity\",\n type: \"input\",\n message: \"How many would you like to purchase?\",\n validate: function(value) {\n\n //Validates if input is a number\n var pass = value.match(/\\d/g);\n if (pass) {\n return true;\n }\n return \"Please enter a number quantity\" \n }\n }\n ])\n .then(function(ans) {\n\n //Traverses the array to locate the item the user selected\n var chosenItem;\n for (var i = 0; i < res.length; i++) {\n if (ans.choice == res[i].item_id) {\n chosenItem = res[i];\n console.log(\"You have chosen \" + ans.quantity + \" of \" + chosenItem.product_name);\n }; \n };\n\n //If in stock, fulfills customer's request\n if (chosenItem.stock_quantity >= ans.quantity) {\n console.log(\"Your order is being processed!\")\n\n //Calculates new stock of product selected\n updatedStock = chosenItem.stock_quantity - ans.quantity;\n\n //Updates MySql with new stock quantity\n con.query(\"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: updatedStock\n },\n {\n item_id: chosenItem.item_id\n }\n ],\n function(err) {\n if (err) throw err;\n console.log(\"Purchase successful!\");\n\n //Shows customer cost of purchase(s)\n console.log(\"Your total comes out to \" + (ans.quantity * chosenItem.price) + \"$.\");\n\n //Prompts the user to continue shopping or not\n inquirer.prompt([\n {\n name: \"continue\",\n type: \"confirm\",\n message: \"Do you want you to continue shopping?\"\n }\n ])\n .then(function(ans) {\n if (ans.continue == true) {\n purchase();\n } else if (ans.continue == false) {\n console.log(\"Come back soon!\");\n con.end();\n }\n })\n })\n\n //If not in stock, notifies customer and ends transaction\n } else if (chosenItem.stock_quantity <= ans.quantity) {\n console.log(\"Sorry, Insufficient Quantity.\")\n\n //Prompts the user to continue shopping or not\n inquirer.prompt([\n {\n name: \"continue\",\n type: \"confirm\",\n message: \"Do you want you to continue shopping?\"\n }\n ])\n .then(function(ans) {\n if (ans.continue == true) {\n purchase();\n } else if (ans.continue == false) {\n console.log(\"Come back soon!\");\n con.end();\n }\n })\n };\n });\n });\n}", "function sellEggStock() {\r\n\tdemand = demand > 1 ? demand - 0.001 : demand;\r\n\teggs--;\r\n\tgold += currentEggPrice;\r\n\r\n\tcheckAllPrices();\r\n\taddEggs();\r\n\taddGold();\r\n}", "buyItems(item){\n let shopSells = new Shop('magic shop', 'sells magic things')\n this.items.push(item);\n shopSells.sellItems(item);\n }", "function start() {\n connection.query(\"SELECT id, product_name, department_name, price, stock_quantity FROM products\",function(err, res){\n for (var i = 0; i < res.length; i++) {\n console.log(\"ID\" + res[i].id + \"\\n Product\" + res[i].product_name + \"\\n Price\" + res[i].price);\n }\n \n inquirer\n .prompt([{\n type: \"input\",\n message: \"What is the ID of the Item?\",\n name: \"id\",\n },{\n type: \"input\",\n message: \"How many would you like to buy\",\n name: \"how\"\n }])\n\n .then(function(answer) {\n var answerId = parseInt(answer.id)\n var answerHow = parseInt(answer.how)\n\n connection.query(\n \"UPDATE products SET ? WHERE ?\"[{\n stock_quantity: res[i].stock_quantity - answerHow\n },{\n id: answerId\n }\n ], function(err,res){ \n }\n );\n if (res[i].id == answerId && res[i].stock_quantity >= answerHow) \n console.log(\"order complete\");\n else if(res[i].id !== answerId || res[i].stock_quantity < answerHow)\n console.log(\"out of stock\"); \n // based on their answer, either call the bid or the post functions\n // if (answer.start.toLowerCase() === \"\") {\n // postAuction();\n // }\n // else {\n // bidAuction();\n // }\n connection.end();\n });\n }); \n}", "function customerBuy(){\n var productInfo = {\n properties: {\n item_id: {description: ' Chose by typing ID'},\n stock_quantity: {description: ' Quantity: How many items? '}\n },\n };\n \n prompt.start();\n prompt.get(productInfo, function (err, res){\n var purchase = {\n item_id: res.item_id,\n stock_quantity: res.stock_quantity\n };\n\n transaction.push(purchase);\n \n // Take a look at the table and see if the quantity ordered is less than the quantity on hand and confirm order\n connection.query('SELECT * FROM products WHERE item_id=?', transaction[0].item_id, function(err, res){\n if (res[0].stock_quantity >= transaction[0].stock_quantity) { \n // Repeat order back customer at console window\n console.log(\"Your order is \" + res[0].product_name); \n console.log(\"TOTAL = $\" + (transaction[0].stock_quantity*res[0].price));\n stock_quantity_left = res[0].stock_quantity - transaction[0].stock_quantity;\n connection.query('UPDATE products SET stock_quantity ='+ stock_quantity_left + ' WHERE item_id ='+ transaction[0].item_id, function(err, res){\n // Give order confirmation message\n console.log(\"Your order has been confirmed. Thank you.\");\n connection.end();\n });\n // If the order exceeds the amount on hand, inform customer it is out of stock\n } else {\n console.log(\"Our apologies but we are currently out of stock in that item....we'll be back soon!\");\n connection.end();\n }\n });\n });\n}", "function buyProduct() {\n connection.query('SELECT * FROM products', function(err, res){\n \n\n // display products and price to user\n for (var i = 0; i < res.length; i++) {\n console.log('Item: ' + res[i].name + ' | Price: ' + res[i].price);\n }\n\n inquirer.prompt([\n\n // Here we give the user a list to choose from.\n {\n name: \"choice\",\n type: \"rawlist\",\n message: \"What do you want to buy?\",\n choices: function(value) {\n var choiceArray = [];\n for (var i = 0; i < res.length; i++) {\n choiceArray.push(res[i].name);\n }\n return choiceArray;\n }\n },\n\n {\n name: \"howMany\",\n type: \"input\",\n message: \"How many units do you want to buy?\",\n choices: [\"1\", \"2\", \"3\", \"4\", \"5\"]\n }\n ])\n\n .then(function(answer) {\n // grabs the entire object for the product the user chose\n for (var i = 0; i < res.length; i++) {\n if (res[i].name == answer.choice) {\n var item = res[i];\n }\n }\n // console.log (item);\n \n \n // Update stock\n\n var updateStock = parseInt(item.quantity) - parseInt(answer.howMany);\n // // Calculate if enough in stock\n if (parseInt (item.quantity) < parseInt (answer.howMany)) {\n console.log (\"Insufficient quantity!\");\n } else {\n connection.query(\"UPDATE products SET ? WHERE ?\", \n [{quantity: updateStock}, {id: item.id}], function(err, res) {\n console.log(\"Purchase successful!\");\n });\n }\n\n}); \n \n}); \n\n}", "function buyScreen() {\n // inquirer prompts (which item to buy and how many of it)\n inquirer\n .prompt([\n {\n name: \"item\",\n type: \"list\",\n choices: productArray,\n message: \"What is the item you would like to submit?\"\n },\n {\n name: \"quantityPurchase\",\n type: \"input\",\n message: \"How many would you like to buy?\"\n }\n ])\n .then(function (answer) {\n var quantityPurchased = answer.quantityPurchase;\n\n var query = \"SELECT * FROM products WHERE ?\";\n\n // doing some splitting to get the item ID# from the choices from the above inquirer list prompt\n var split1 = answer.item.split(\",\", 1);\n var split2 = split1[0].split(\":\", 2);\n var final = split2[1];\n\n console.log(\"Confirming your order..\");\n\n // connection query using mysql select searching in the bamazon product db for the row matching the product name the person wants and checking the quantity\n // if when the test for the current stock minus the customer's desired quantity to purchase is less than 0, display an message saying unable to fulfill order\n // otherwise if the test condition comes out positive, confirm to user that bamazon can fulfill the order then call updateProduct function while passing the product name and desired quantity to purchase as parameters\n connection.query(query, { item_id: final }, function (err, res) {\n if (err) throw err;\n\n var productName = res[0].product_name;\n var stock = res[0].stock_quantity;\n var productPrice = res[0].price;\n var total = productPrice * quantityPurchased;\n\n if ((stock - quantityPurchased) > 0) {\n console.log(\"\\nWe are able to fulfill your order.\\n\");\n\n // New stock quantity after subtracting the user's current order\n var newStockQuantity = stock - quantityPurchased;\n\n console.log(\"Your purchase order:\");\n console.log(productName + \" ($\" + productPrice + \") x \" + quantityPurchased + \" = $\" + total);\n updateProduct(productName, newStockQuantity);\n } else {\n console.log(\"Sorry, we do not have enough stock in our inventory to fulfill your order.\");\n connection.end();\n }\n }\n );\n\n });\n}", "function start() {\n\n \n inquirer.prompt([\n\n {\n\n name : \"productId\",\n type : \"input\",\n message :chalk.inverse.cyan(\"select id of the product that you would like to buy?\"),\n validate: function(value) {\n if (isNaN(value) === false) {\n return true;\n }\n return false;\n }\n },\n \n {\n name : \"quantity\",\n type : \"input\",\n message : chalk.inverse.yellow(\" how many units of the product you would like to buy?\"),\n validate: function(value) {\n if (isNaN(value) === false) {\n return true;\n }\n return false;\n }\n }\n \n\n ])\n\n .then(function(response){\n\n\n const itemId = response.productId;\n const quantityProduct = response.quantity;\n\n const query = \"select * from products where ?\";\n\n connection.query(\n\n query,\n \n { id: itemId },\n \n function (err, res) {\n \n if (err) throw err;\n\n const data = res.map ((products)=> [products.id, products.product_name, products.department_name, products.price, products.stock_quantity])\n\n let chosenItem ;\n\n for (let i = 0; i < res.length; i++ ) {\n\n if ( res[i].id === parseInt(itemId) ) {\n\n chosenItem = res[i];\n \n }\n \n }\n \n \n if (chosenItem.stock_quantity < parseInt(quantityProduct)) {\n\n console.log(`\\n \\n ooppss! so sorry there is not enough quantity of ${chosenItem.product_name}`)\n \n displayItems()\n \n } else {\n\n const query = \"update products set ? where ?\"\n connection.query (\n\n query,\n [\n \n {stock_quantity : (parseInt(chosenItem.stock_quantity) - parseInt(quantityProduct))} ,\n\n {id : itemId}\n ],\n\n function(err) {\n\n if (err) throw err;\n \n let totalPrice = parseInt(chosenItem.price) * parseInt(quantityProduct)\n console.log(chalk.magenta.inverse(`\\n YOUR TOTAL IS : ${totalPrice}\n \\n YOUR PURCHASED : ${chosenItem.product_name}` + `\\n ${quantityProduct}`))\n\n displayItems()\n }\n )\n }\n })\n\n })\n\n}", "function buyItem() {\n // prompt for info about the item being put up for auction\n inquirer.prompt([\n {\n name: \"quitOption\",\n type: \"input\",\n message: \"Would you would like to buy an item or quit?\",\n choices: [\"buy an item\", \"quit\"]\n }])\n .then(function (res) {\n console.log(res.quitOption);\n if (res.quitOption === \"quit\") {\n endBamazon()\n }\n else {\n inquirer.prompt([\n {\n name: \"name\",\n \n type: \"input\",\n message: \"What item would you buy?\"\n },\n {\n name: \"amount\",\n type: \"input\",\n message: \"How many would you like to purchase?\"\n }]).then(function (res) {\n var selection = res.name;\n var amount = parseInt(res.amount)\n connection.query(\"SELECT * FROM products WHERE name = ?\", [selection], function (err, response) {\n if (err) { throw err }\n console.log(response);\n if (amount > response[0].quantity) {\n console.log(\"That is more quantity than we currently have in stock. Please try again later.\")\n buyItem();\n }\n else {\n var newQuantity = response[0].quantity - amount;\n updateProducts(selection, newQuantity);\n buyItem();\n }\n })\n\n })\n }\n })\n\n}", "function checkItem(itemID, numUnits) {\n // console.log(\"Running checkItem! Looking for item #: \"+ itemID);\n connection.query('SELECT * FROM bamazon.products;', function (err, results, fields) {\n // get the information of the chosen item\n var itemIdInt = parseInt(itemID);\n var numUnitsInt = parseInt(numUnits);\n var chosenItem;\n for (var i = 0; i < results.length; i++) {\n // console.log(results[i].item_id);\n // console.log(itemIdInt);\n if (results[i].item_id === itemIdInt) {\n chosenItem = results[i];\n // console.table(chosenItem);\n }\n }\n\n if (chosenItem.stock_quantity < numUnitsInt) {\n console.log(\"Insufficient quantity in stock!\")\n prompt();\n } else {\n fulfillOrder(chosenItem, numUnitsInt);\n } \n\n });\n}", "function itemQty(item, name, stock){\n \n inquirer.prompt({\n type: \"list\",\n name: \"purchase\",\n message: \"would you like to purchse this item?\",\n choices: [\n \"yes\",\n \"no\"\n ]\n }) \n .then(function(answer){\n switch (answer.purchase) {\n case \"yes\":\n getQty(item);\n break;\n \n case \"no\":\n console.log(\"please make another selection\");\n greetings();\n break;\n \n }\n });\n\n function getQty(item, stock, name) {\n \n inquirer.prompt({\n name: \"qty\",\n type: \"input\",\n message: \"please enter the quantity you would like\",\n })\n .then(function(value){ \n\n var qty = $parseInt(value.qty, 10); \n \n // if (qty > stock) {\n // console.log(\"qty: \" + qty + \", stock: \" + stock);\n // console.log(\"sorry, we have insufficient supply of \" + name);\n // } else {\n // function updateStock(item, stock, name) {\n // var query = connection.query(\n // \"UPDATE products SET ? WHERE ?\",\n // [\n // {\n // stock_qty: stock_qty - qty\n // },\n // {\n // item_ID: item\n // }\n // ],\n // function(err, res) {\n \n // console.log(res.affectedRows + \" stock has been update!\\n\");\n \n \n // }\n // );\n // }\n // }; \n purchaseItems(item, qty); \n });\n\n function purchaseItems(item, qty){ \n \n connection.query(\"SELECT item_name, price, stock_qty FROM products WHERE ?\", \n {\n item_ID: item\n }, \n function(err, res) {\n if (err) throw err;\n \n console.log(qty + \" \" + res[0].item_name + \"s will be mailed to the address we have on file.\\n\");\n console.log(\"$\" + ((qty * res[0].price).toFixed(2)) + \" will be billed to your account. \\n\");\n delay(750).then(() => {\n console.log(\"thank you for shopping with Bamazon!\");\n });\n \n\nconnection.end();\n});\n\n\n\n}\n}\n}" ]
[ "0.72672755", "0.6791315", "0.6791315", "0.6791315", "0.6791315", "0.6791315", "0.6791315", "0.67875373", "0.6700555", "0.66958225", "0.6677445", "0.6655415", "0.66389936", "0.6566304", "0.65639794", "0.6449293", "0.64365256", "0.6425523", "0.64189684", "0.6405516", "0.63973737", "0.6392564", "0.6386369", "0.6371971", "0.63498247", "0.6337545", "0.63329446", "0.6332807", "0.6331988", "0.63165253", "0.6308155", "0.6293912", "0.6291255", "0.62776375", "0.62763214", "0.6269797", "0.6260276", "0.6256054", "0.6253479", "0.62521636", "0.62501186", "0.6246747", "0.62315327", "0.6215503", "0.6203156", "0.62007034", "0.618968", "0.6177412", "0.61743116", "0.6163888", "0.6161846", "0.6157764", "0.6153268", "0.61511356", "0.6144656", "0.61432654", "0.61367774", "0.61283076", "0.612732", "0.6125818", "0.612006", "0.61195433", "0.61154824", "0.61105615", "0.61063486", "0.61015064", "0.6096142", "0.6094751", "0.609271", "0.608084", "0.60790366", "0.60768473", "0.6073408", "0.6067769", "0.6055291", "0.60545725", "0.604698", "0.60400516", "0.603735", "0.6034088", "0.6019295", "0.5988383", "0.5987563", "0.59870094", "0.59867376", "0.59835714", "0.59740573", "0.59690255", "0.59688824", "0.5968631", "0.59643024", "0.59604853", "0.59603536", "0.59595865", "0.5948228", "0.5934865", "0.5921621", "0.5920535", "0.5920479", "0.59168094" ]
0.7058993
1
function to update a record with the sale of items
function updateItemQTY(itemID, newQTY){ var query = 'UPDATE products SET stock_qty = '+ newQTY + ' WHERE item_id =' + itemID; connection.query(query); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async updateSale(saleID, storeID) {\n\n}", "function updateProductSale() {\n // select the item in database\n connection.query(\"SELECT price, id FROM products WHERE id =?\", [itemToBuy], function (err, res) {\n if (err) throw err;\n // update sales of item in database\n connection.query(\"UPDATE products SET product_sales=product_sales + ? WHERE id=?\",\n [\n (parseFloat(res[0].price) * quantityToBuy),\n itemToBuy\n ],\n function (err, res) {\n if (err) throw err;\n viewAll();\n })\n }\n )\n}", "function updateSales(count, iid){\n connection.query(\"UPDATE products SET product_sales = product_sales + price * ? WHERE item_id = ?\", [count, iid], function (err, res, fields){\n })\n }", "function updateProducts(id,quantity,product_Sales){\n \n connection.query(\"update products set stock_quantity = ?, product_sales = ? where item_id = ?\",[\n quantity, \n product_Sales,\n id\n ],function(error) {\n if (error) throw err;\n console.log(\"Quantity updated successfully!\");\n })\n \n}", "updateItemQuantity(db, site_id, item_id, new_amount) {\n return db\n .from(\"inventory\")\n .where({\n site_id: site_id,\n id: item_id,\n })\n .update({ current_amount: new_amount });\n }", "function updateQuantity() {\n\n // Query to update the item's quantity based on the item ID\n var queryTerms = \"UPDATE products SET ? WHERE ?\";\n var newQuantityOnHand = quantityOnHand - purchaseQuantity;\n \n connection.query(queryTerms,\n [\n {stock_quantity: newQuantityOnHand},\n {item_id: itemID}\n ], function(err, result) {\n if (err) throw err;\n }); \n\n // After that update is done, we need to update the total sales column\n updateTotalSales();\n} // End updateQuantity function", "function updateProductSales(anItem_id, productSales) {\n\n var sql = \"UPDATE ProductsTable SET product_sales = \" + productSales + \" WHERE item_id = \" + anItem_id;\n console.log(\"UPDATE ProductsTable.product_sales SQL: \" + sql);\n connection.query(sql, function(err, result) {\n if (err) {\n throw err;\n } else { //qtyInStock > qtyToPurchase\n console.log(result.affectedRows + \" record(s) updated\");\n connection.close();\n }\n\n });\n}", "function transact() {\n var newQuantity = stockQuantity - saleQuantity;\n connection.query(\"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newQuantity\n },\n {\n item_id: saleItem + 1\n }\n ], function (err, res) {\n if (err) throw err;\n //console.log(res.affectedRows + \" products updated!\\n\") //for testing\n console.log(\"Thank you! Please come again!\\n\".brightYellow);\n })\n connection.end();\n}", "function updateDatabase(itemName, itemInventory, totalSales) {\n\n connection.query(\"UPDATE products SET ? WHERE ?\", [\n {\n stock_quantity: itemInventory\n },\n {\n product_name: itemName\n }\n ], (err, results, fields) => {\n if (err) {\n throw err;\n }\n return continueShoppingPrompt();\n });\n}", "function updateProducts(stock, id, qty){\n connection.query(\"UPDATE products SET ? WHERE ?;\",\n \n [\n {\n Stock_QTY: (parseInt(stock) + parseInt(qty)),\n },\n {\n ID: id,\n }, \n ],\n function(err) {\n if (err) throw err;\n updatedItem(id);\n \n }\n ); \n \n}", "function updateDB(id, newQuant) {\n return db.query(\"UPDATE products SET ? WHERE ?\", [{ stockQuantity: newQuant }, { itemID: id }])\n .spread(function(rows) {\n // console.log(\"Our inventory has been updated\");\n return startShopping();\n\n }).catch(function(err) {\n console.log(err);\n });\n}", "function updateSales(total, item) {\n\t// finds the name of the department the ordered item belongs to\n\tconn.query('SELECT departmentName FROM products WHERE itemID = ' + conn.escape(item), function(err,res) {\n\t\tif (err) {throw err}\n\n\t\tvar depName = res[0].departmentName\n\n\t\t// based on the department, update that row in table departments with the sale total\n\t\tconn.query('UPDATE departments SET totalSales = totalSales + ' + conn.escape(total) + ' WHERE departmentName = ' + conn.escape(depName), function(err, res) {\n\t\t\tif (err) {throw err}\n\n\t\t\tconsole.log('Total Sales column updated:', depName, '+$' + total)\n\t\t})\n\t})\n}", "updateBoughtItem(transactionID, beerID, adminID, amount, price) {\n for (let i = 0; i < window.Database.DB.bought.length; i++) {\n if (window.Database.DB.bought[i].transaction_id == transactionID) {\n window.Database.DB.bought[i].admin_id = adminID;\n window.Database.DB.bought[i].beer_id = beerID;\n window.Database.DB.bought[i].amount = amount;\n window.Database.DB.bought[i].price = price;\n return true;\n }\n }\n return false;\n }", "function updateStorage(newStock, id, quantity, price, sales){\n var totalCost = quantity * price;\n var newSales = sales + totalCost;\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newStock,\n product_sales: newSales\n },\n {\n item_id: id\n }\n ],\n function(err, res){\n if(err) throw err;\n console.log(colors.magenta(\"The total cost of your order is\",\"$\"+ totalCost + \"\\n\"));\n restartPrompt();\n }\n )\n}", "function updateQuantity() {\n connection.query(\"UPDATE products SET stock_quantity = stock_quantity - ? WHERE id = ?\",\n [\n quantityToBuy,\n itemToBuy\n ],\n function (err, res) {\n if (err) throw err;\n updateProductSale();\n })\n}", "function updateRecord() {\n //connection.query(\"UPDATE products SET quantity = (quantity - 1) Where id = 1\", function(err, res) {\n //connection.query(\"UPDATE products SET quantity = ?, bar = ?, baz = ? WHERE id = ?', ['a', 'b', 'c', userId]\", function(err, res) {\n connection.query(\"UPDATE users SET foo = ? WHERE id = ?', ['(quantity - 1)', '1']\", function(err, res) {\n console.log(\"updateRecord Returned res: \", res);\n // for (var i = 0; i < res.length; i++) {\n // console.log(res[i].id + \" | \" + res[i].flavor + \" | \" + res[i].price + \" | \" + res[i].quantity);\n // }\n console.log(\"-----------------------------------\");\n displayRecords();\n });\n}", "function updateInv() {\n var updatedStock = parseInt(res[0].stock_quantity) - parseInt(quantity);\nconnection.query(\"UPDATE products SET stock_quantity = ? WHERE item_id = ?\",[updatedStock, item_id],function (err, updateRes) {\n if (err) throw err;\n });\n}", "update(req, res) {\n return OrderDetails.find({\n where: {\n OrderId: req.params.orderid,\n ItemId: req.body.itemid\n }\n })\n .then(item => {\n if (!item) {\n return res.status(404).send({\n message: \"Item Not Found\"\n });\n }\n\n return (\n item\n .update(req.body, { fields: Object.keys(req.body) })\n // .update({ quantity: 11 })\n .then(updatedOrderDetail =>\n res.status(200).send(updatedOrderDetail)\n )\n .catch(error => res.status(400).send(error))\n );\n })\n .catch(error => res.status(400).send(error));\n }", "function updateTotalSales() {\n\n // Query to update total sales based on product id\n var queryTerms = \"UPDATE products SET ? WHERE ?\";\n\n // parseFloat is required to make sure the math is handled with decimal values, not string\n var grandTotalSales = parseFloat(newSales) + parseFloat(totalSales);\n\n connection.query(queryTerms,\n [\n {product_sales: grandTotalSales},\n {item_id: itemID}\n ], function(err, result) {\n if (err) throw err;\n });\n\n // Back to the start of the program\n start();\n} // End updateTotalSales function", "function updateDB(answer, stock, price, sales){ \n var newQuantity = stock - parseInt(answer.getUnits);\n var getTotal = price * parseInt(answer.getUnits); \n var newSales = sales + getTotal;\n var query = `UPDATE products SET stock_quantity = ${newQuantity}, product_sales=${newSales} WHERE productID=${answer.getItem}`;\n connection.query(query, (err) => {\n if(err) throw err;\n console.log(`You're purchase is complete. Your total is $${getTotal}.`);\n nextPrompt();\n })\n}", "function updateWarehouseItem(quantity, warehouseID, warehouseName, userID, total) {\n \n \t\n \tvar post = {\n \tquantity: quantity,\n \twarehouseID: warehouseID,\n \twarehouseName: warehouseName,\n \tuserID: userID,\n \ttotal: total\n \t};\n\n \n $.ajax({\n method: \"PUT\",\n url: \"/api/make-purchase\" ,\n data: post\n })\n .done(function(data) {\n \t\n \tif (data.complete === true)\n \t\twindow.location = \"/user-homepage\";\n \n });\n }", "function updateSaleItem(itemId, highestBidder, highestBid)\n\t{\n\t\thighestBidder = \"highestBidderC\";\n\t\thighestBid = 405;\n\n\t\tvar updateData = {\n\t\t\t\"highest_bidder\": highestBidder,\n\t\t\t\"highest_bid\": highestBid\n\t\t};\n\n\t\tvar itemId = 2;\n\n\t\t$.ajax({\n\t \tmethod: \"PUT\",\n\t \turl: \"/api/forsale/\" + itemId,\n\t \tdata: updateData\n\t })\n\t .done(function(data) {\n\t \tconsole.log(JSON.stringify(data, null, 2)); //TEST CODE\n\n\t \t//Logic using data here.\n\t \t\n\t });\n\t}", "function updateProductSales(dept,newOHC, totalProductSales) {\n connection.query(\"UPDATE departments SET ? WHERE ?\",\n [\n { product_sales: totalProductSales },\n { department_name: dept }\n ], function (err, res) {\n if (err) throw err;\n console.log(res.affectedRows + \" The total product sales for \" + dept + \" has been updated in the Departments Table to: \" + totalProductSales + \" !\\n\");\n let totalProfit = parseFloat(totalProductSales - newOHC).toFixed(2);\n updateTotalProfit(dept, totalProfit, newOHC)\n })\n}", "function updateItem(row, data) {\n // Recalculate totals\n var oldTotal = parseFloat(row.children(\".row-total\").text());\n var newTotal = parseFloat(data.price) * parseFloat(data.quantity);\n var sumTotal = parseFloat($(\"#valueSum\").text());\n\n // Update row\n row.children(\".row-product\")\n .children(\"span\")\n .text(data.product);\n\n row.children(\".row-quantity\")\n .text(data.quantity);\n\n row.children(\".row-price\")\n .text(data.price);\n\n row.children(\".row-total\")\n .text(newTotal);\n\n row.data(\"item\", data);\n\n // Update total\n $(\"#valueSum\")\n .text( (sumTotal - oldTotal) + newTotal );\n}", "function add_and_save(id) {\n retrieve_item();\n // console.log(qty);\n qty[id]++;\n //console.log(qty);\n save_item();\n}", "function updateProduct(name, x, y) {\n var newAmt = x +y;\n\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newAmt\n },\n {\n product_name: name\n }\n ],\n function (err, res) {\n console.log(res.affectedRows + \" product(s) updated!\\n\");\n console.log(\"Order Completed for \"+y+\" \"+name+\"(s)\");\n\n mainMenu();\n }\n );\n\n}", "function updateInventory(product, quantity){\n connection.query(\n \n \"UPDATE products SET ? WHERE ?\",\n [{\n stock_quantity: quantity,\n },\n {\n item_id: product\n }\n ],\n function(err, res){\n if(err) throw err;\n // console.log(\"new quantity: \" + res);\n }\n )\n\n}", "function handleUpdate(e) {\n\tfor (let name in updatedQuantity) { // sample updatedQuantity: {usmc fitness book: \"20\", usmc pt shirt 1: \"9\"}\n\t\tcart.updateCart(name, +updatedQuantity[name])\n\t}\n\treRenderTableBody();\n\trenderCartTotal();\n}", "function updateStock(dept, itemQuantity, itemIdToUpdateStock) {\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: itemQuantity\n },\n {\n item_id: itemIdToUpdateStock\n }\n ],\n function(err, res) {\n if (err) throw err;\n console.log(\n res.affectedRows +\n \" Stock Quantity updated to: \" +\n itemQuantity +\n \" !\\n\"\n );\n getTotalPurchasedPrice(dept);\n }\n );\n }", "function updatedItem(id) {\n console.log(\"\");\n var query = connection.query(\"SELECT ID, Product_Name , Price, Stock_QTY FROM products WHERE ID = ?;\",[id],function(err, res) {\n if (err) throw err;\n console.log('Your item has been updated. Please see below:');\n console.table(res);\n console.log(\"\");\n managerAsk();\n \n });\n}", "function updateItemStock(purchaseList){\n var itemDetails = db.collection('itemDetails');\n for(var i= 0; i<purchaseList.length; i++){\n itemDetails.update(\n {\n 'itemName':purchaseList[i].itemName\n },\n {\n \n }\n )\n }\n itemDetails.find().toArray(function(err, docs) {\n var itemArray = [];\n \n for(var i = 0; i< docs.length; i++){\n\n var itemDetail = docs[i];\n itemArray.push(itemDetail);\n }\n res.send(itemArray);\n })\n}", "function purchaseItem(quantity, id) {\n var query = connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: quantity--\n },\n {\n id: id\n }\n ],\n function (err, res) {\n // console.log(res);\n if (err) throw err;\n // console.log(\"Product updated.\");\n buyItem();\n }\n )\n return buyItem();\n\n}", "function updateProduct(itemId, numberLeft) {\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: numberLeft\n },\n {\n item_id: itemId\n }\n ],\n function (error) {\n if (error) throw err;\n displayProducts();\n }\n );\n}", "static async updateItem(item) {\n try {\n await shopdb.poitem.update(item, { where: { id: item.id } });\n } catch (error) {\n throw error;\n }\n }", "function updateInventoryInDB(productID, amountAdded) {\n\n connection.query(\n 'UPDATE products SET stock_quantity = stock_quantity + ' + amountAdded + ' WHERE item_id = ' + productID, (err, results) => {\n if (err) { console.log(err); }\n else { console.log('Inventory successfuly added updated'); }\n }\n );\n}", "function updatepurchase(newQty, id) {\n connection.query(\"UPDATE products SET stock_quantity =? WHERE idproducts =?\", [newQty, id], function (err, res) {\n if (err) throw err;\n });\n}", "function updateStock(itm, newQty) {\n var sql = \"UPDATE product SET ? WHERE ?\";\n connection.query(sql, [{stock_quantity: newQty}, {item_id: itm}],function (err, res) {\n if (err) throw err;\n if (res.affectedRows != 1) {\n console.log(\"\\n\\n\");\n console.log(\"***** There may have been a error *****\");\n console.log(\"***** Report the following error to the administrator: pCO\" + res.affectedRows + \" *****\");\n }\n // connection.end();\n\n displayOrder(customerOrder);\n });\n}", "function updateProducts(chosenItem, answer) {\n //updates products\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: chosenItem.stock_quantity - answer.quantityPurchased\n },\n {\n item_id: chosenItem.item_id\n }\n ],\n function (error) {\n if (error) throw error;\n console.log(\"Transaction Complete\");\n anotherPurchase();\n }\n );\n //updates sales\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n product_sales: chosenItem.product_sales + answer.quantityPurchased * chosenItem.price\n },\n {\n item_id: chosenItem.item_id\n }\n ],\n function (error) {\n if (error) throw error;\n\n }\n );\n}", "async function updateAsync(itemsold, itembought, earning, spending, tendered, duedate, accounttype, account, addToTransaction) {\n itemsold = isNaN(Number(itemsold)) ? null : Number(itemsold);\n itembought = isNaN(Number(itembought)) ? null : Number(itembought);\n earning = isNaN(Number(earning)) ? null : Number(earning);\n spending = isNaN(Number(spending)) ? null : Number(spending);\n\n var today = new Date();\n var data = await mdb.SaleData.findOne({ where: { days: today } });\n var upData;\n if (data) {\n var updateData = {};\n if (itemsold) updateData['itemsold'] = Sequelize.literal('itemsold + ' + itemsold);\n if (itembought) updateData['itembought'] = Sequelize.literal('itembought + ' + itembought);\n if (earning) updateData['earning'] = Sequelize.literal('earning + ' + earning);\n if (spending) updateData['spending'] = Sequelize.literal('spending + ' + spending);\n upData = await mdb.SaleData.update(updateData, { where: { days: today } });\n } else {\n var createData = { days: today };\n createData['itemsold'] = (itemsold ? itemsold : 0);\n createData['itembought'] = (itembought ? itembought : 0);\n createData['earning'] = (earning ? earning : 0);\n createData['spending'] = (spending ? spending : 0);\n upData = await mdb.SaleData.create(createData);\n }\n if (earning && addToTransaction) {\n var tData = await transactionAdd(account, accounttype, 'income', 'short term', earning, tendered, duedate, 'income from ' + account);\n if (Math.abs(Number(earning)) > Math.abs(Number(tendered))) await transactionAdd(account, accounttype, 'asset', 'short term', Number(earning) - Number(tendered), Number(earning) - Number(tendered), null, 'income from ' + account);\n } else if (spending && addToTransaction) {\n var tData = await transactionAdd(account, accounttype, 'expense', 'short term', spending, tendered, duedate, 'expense for ' + account);\n if (Math.abs(Number(spending)) > Math.abs(Number(tendered))) await transactionAdd(account, accounttype, 'liability', 'short term', Number(spending) - Number(tendered), Number(spending) - Number(tendered), duedate, 'expense for ' + account);\n }\n return upData;\n}", "function updateProduct(val, answer) {\n var updateQ = val;\n var query = \"UPDATE products SET ? WHERE ?\"\n connection.query(query, [{ stock_quantity: updateQ }, { id: answer.item }], function (err, res) {\n if (err) throw err;\n connection.end();\n })\n}", "function update(){\n newInventory = currentQuantity + updateQuantity;\n\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newInventory\n },\n {\n item_id: itemNum\n }\n ],\n function(err, res) {\n\n if (err) throw err;\n \n inquirer.prompt([\n {\n type: \"confirm\",\n name: \"doAgain\",\n message: \"Your inventory has been successfully updated. Would you like to do something else?\",\n \n }\n ]).then(function(response){\n if (response.doAgain){\n promptManager();\n } else {\n connection.end();\n };\n \n });\n });\n }", "function updateQuantity(count, iid) {\n connection.query(\"UPDATE products SET stock_quantity = stock_quantity - ? WHERE item_id = ?\", [count, iid], function (err, res, field) {\n promptUserEntry();\n\n });\n }", "function updateQuantity() {\n var query = connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: updatedStock\n },\n {\n item_id: answer.userId\n }\n ],\n );\n }", "function updateRecord(TABLE, itemID, values) {\n log(\"updateRecord\");\n var query = ClearBlade.Query({collectionName:TABLE});\n query.equalTo('item_id', itemID);\n query.update(values, statusCallBack);\n \n values.timestamp=new Date(Date.now()).toISOString();\n createRecord(tblHistorian, values);\n}", "function purchase(product, price, quantity){\n connection.query(\n \"UPDATE products SET ? WHERE ?\",[{\n stock_quantity: currentQuantity - quantity,\n },\n {\n item_id: currentItemId,\n }],\n function(error, results){\n\n if(error) throw error;\n console.log(\"thank you for your purchase!\");\n end();\n }\n )\n\n}", "function finalizePurchase(itemID, qty, stock, price){\n\n let newStock = stock - qty;\n let totalCost = qty * price;\n\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newStock\n },\n {\n id: itemID\n }\n ],\n function(error) {\n if (error) throw err;\n \n console.log(\"Purchase successful! Your total is $\" + totalCost.toFixed(2));\n startPrompt();\n }\n );\n}", "function _recordMoney(rest, item) {\n rest.foodCost += 5\n rest.revenue += floorToCents(item.price)\n}", "function dispatch_details_update_row(items, obj) {\n var item;\n for(i in items) {\n\titem = items[i];\n\tif((order_list_store.getValue(item, 'id')==obj['id'])) {\n\t attrs = order_list_store.getAttributes(item);\n\t for(j in attrs) {\n\t\torder_list_store.setValue(item, attrs[j], obj[attrs[j]]);\n\t }\n\t return true;\n\t}\n }\n return false;\n}", "function updateInventory(dbResponse, orderQty) {\n // console.log(\"Updating inventory ...\\n\");\n // console.log(dbResponse);\n\n // update inventory\n var newqty = dbResponse.stock_quantity - orderQty;\n \n // update sales\n var totSales = dbResponse.product_sales + (orderQty * dbResponse.price);\n\n var query = connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newqty, \n product_sales: totSales\n },\n {\n item_id: dbResponse.item_id\n }\n ],\n function(err, res) {\n // console.log(res.affectedRows + \" offer updated!\\n\");\n showCustomer(orderQty, dbResponse);\n\n loopIt();\n }\n );\n \n // logs the actual query being run\n // console.log(query.sql);\n}", "editHearth(item, newQuantity) {\n for (let i = 0; i < this.inventory.length; i++) {\n if (this.inventory[i].item === item) {\n this.inventory[i].quantity = newQuantity;\n }\n console.log(\"This is the new quantity\", this.inventory[i].quantity);\n }\n }", "updateItem(id, updatedItem) {\n return new Promise((fulfill, reject) => {\n return this.getItemById(id).then((currentItem) => {\n return items().then((itemCollection) => {\n let updatedItemData = {};\n if (updatedItem.nickname) updatedItemData.nickname = updatedItem.nickname;\n if (updatedItem.quantity) updatedItemData.quantity = updatedItem.quantity;\n if (updatedItem.date_of_purchase) updatedItemData.date_of_purchase = updatedItem.date_of_purchase;\n if (updatedItem.date_of_expiration) updatedItemData.date_of_expiration = updatedItem.date_of_expiration;\n let updateCommand = {\n $set: updatedItemData\n };\n return itemCollection.updateOne({\n _id: id\n }, updateCommand).then(() => {\n fulfill(this.getItemById(id));\n });\n });\n });\n });\n }", "async function putItem(req, res) {\n const { id, itemID } = req.params;\n const update = buildObjectFromQuery(req.body, [\n 'quantityDelivered',\n 'quantityToIncrease'\n ]);\n await DatabaseConnector.getInstance()\n .getDatabase()\n .collection('requests')\n .updateOne(\n {\n _id: ObjectID.createFromHexString(id),\n 'items.id': ObjectID.createFromHexString(itemID)\n },\n { $inc: { 'items.$.quantityDelivered': update.quantityToIncrease } }\n );\n\n return res.status(200).send({\n status: 'OK',\n item: {\n ...req.body,\n quantityDelivered: update.quantityDelivered,\n quantity: req.body.quantity + update.quantityToIncrease\n }\n });\n}", "function saveRecord() {\n\n var finalP = finalPrice.toString();\n var op = parseFloat(enteredPrice);\n \n setRecord((record) => [...record, enteredPrice]);\n setRecord((record) => [...record, discount]);\n setRecord((record) => [...record, finalP]);\n setIndex(index + 1);\n //setDisplay();\n }", "static update(request, response) {\r\n\r\n itemsModel.getById(request.body.id)\r\n .then( data => {\r\n if (data.length > 0) {\r\n\r\n //recupera do body os campos que serao atualizados na tabela\r\n const conditions = [\r\n {\r\n field: 'id',\r\n value: request.body.id\r\n },\r\n {\r\n field: 'title',\r\n value: request.body.title\r\n },\r\n {\r\n field: 'descr',\r\n value: request.body.descr\r\n },\r\n {\r\n field: 'photo',\r\n value: request.body.photo\r\n },\r\n {\r\n field: 'category',\r\n value: request.body.category\r\n },\r\n ];\r\n\r\n //chama rotina para atualizacao dos dados\r\n itemsModel.update(conditions) \r\n response.sendStatus(200);\r\n console.log('Item has been updated. ID: ', request.body.id); \r\n } else {\r\n response.sendStatus(404);\r\n console.log('Item not found. ID: ', request.body.id);\r\n }\r\n })\r\n .catch(err => {\r\n response.sendStatus(500);\r\n console.log('Error updating Item by ID: ', request.body.id, err);\r\n });\r\n \r\n }", "function updateProducts(finalTotal) {\n\n var item = cart.shift();\n var itemName = item.item;\n var itemCost = item.itemCost\n var itemPurchase = item.amount;\n\n\n connection.query('SELECT stock_quantity from products WHERE ?', {\n product_name: itemName\n }, function(err, res) {\n var currentStock = res[0].stock_quantity;\n\n //updates the stock_quantity in bamazon_db\n connection.query('UPDATE products SET ? WHERE ?', [{\n stock_quantity: currentStock -= itemPurchase\n }, {\n product_name: itemName\n }], function(err) {\n if (err) throw err;\n\n if (cart.length != 0) {\n updateProducts(finalTotal);\n } else {\n\n finalTotal = finalTotal.toFixed(2);\n console.log('Thank you for your purchase!');\n console.log('Your total is $' + finalTotal);\n connection.end();\n }\n });\n });\n}", "function updateWopoDataRecord(rec) {\r\n\r\n var rec = nlapiLoadRecord(WOPO_API_Constants.Netsuite.WopoDataCustomRecord.CustomRecordInternalId, rec.internalId);\r\n rec.setFieldValue(WOPO_API_Constants.Netsuite.WopoDataCustomRecord.ItemsDataField, rec.itemsList);\r\n rec.setFieldValue(WOPO_API_Constants.Netsuite.WopoDataCustomRecord.CreatedWopoIdsField, rec.wopoIdsList);\r\n nlapiSubmitRecord(rec);\r\n}", "function update(){\r\nCustomer.updateMany({dni:\"32111114-D\"},{note:\"nanai\"}, (err, ret) =>{\r\n\t\r\n\tif(err) {\r\n\t\tconsole.error(err);\r\n\t\t\r\n\t} else {\r\n\t\tconsole.log(\"Los dueños que coinciden con el criterio de busqueda han sido actualizados: \", ret);\r\n\t\tconsole.log(\"Todo correcto!!\");\r\n\t\t\r\n\t}\r\n\t\r\n\t\r\n});\r\n\r\n}", "update(objUpdate) {\n if(!objUpdate.id) return new Error('item missing id property');\n if(this.warehouse[objUpdate.id]) {\n this.warehouse[objUpdate.id] = Object.assign({}, objUpdate);\n return objUpdate;\n }\n else {\n return new Error('id not found');\n }\n }", "function itemUpdate(index, type) {\n var quantity = document.getElementById(`quantity-${index}`).value;\n var newQuantity;\n if (type === \"inc\") {\n newQuantity = parseInt(quantity) + 1;\n } else if (type === \"dec\") {\n newQuantity = parseInt(quantity) - (parseInt(quantity) > 0 ? 1 : 0);\n } else {\n newQuantity = 0;\n }\n currentPrice[index] = basePrice[index] * newQuantity;\n document.getElementById(`price-${index}`).innerText = currentPrice[index];\n document.getElementById(`quantity-${index}`).value = newQuantity;\n quantity = newQuantity;\n totalPriceUpdate();\n}", "function updateProduct(quantityFinal, productID) {\n // console.log(productID);\n // console.log(quantityFinal);\n\n var query = connection.query(\"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: quantityFinal\n },\n {\n item_id: productID\n }\n ], function (err, res) {\n if (err) throw err;\n readDisplay();\n }\n );\n}", "function updateTransaction()\n{\n nlapiLogExecution('DEBUG', 'updateTransaction', 'Begin');\n \n var newRecord = nlapiGetNewRecord();\n var transactionId = newRecord.getFieldValue('custrecord_jobopt_transaction');\n var transactionType = newRecord.getFieldValue('custrecord_jobopt_transtype');\n var lineId = newRecord.getFieldValue('custrecord_jobopt_translineid');\n var updateItemOptions = (newRecord.getFieldValue('custrecord_jobopt_updateitemoptions') == 'T');\n \n if (updateItemOptions && transactionId && transactionType && lineId) {\n var transaction = nlapiLoadRecord(transactionType, transactionId);\n \n // Update the correct line item based on line ID\n var update = false;\n var i = 1, n = transaction.getLineItemCount('item') + 1;\n for (;i < n; i++) {\n if (transaction.getLineItemValue('item', 'custcol_lineid', i) == lineId) {\n transaction.setLineItemValue('item', 'custcol_bo_course', i, newRecord.getFieldValue('custrecord_jobopt_course'));\n transaction.setLineItemValue('item', 'custcol_bo_date', i, newRecord.getFieldValue('custrecord_jobopt_date'));\n transaction.setLineItemValue('item', 'custcol_bo_time', i, newRecord.getFieldValue('custrecord_jobopt_time')); \n update = true;\n }\n }\n if (update) {\n nlapiLogExecution('DEBUG', 'Info', 'Update item options on transaction/lineid: ' + transactionId + '/' + lineId);\n nlapiSubmitRecord(transaction);\n }\n }\n \n nlapiLogExecution('DEBUG', 'updateTransaction', 'Exit Successfully');\n}", "function inventory(item_update, quantity_update) {\n\t//UPDATE [table] SET [column] = '[updated-value]' WHERE [column] = [value];\n\tconnection.query(\n\t\t\"UPDATE products SET ? WHERE ?\",\n\t\t[\n\t\t{\n\t\t\tstock_quantity: quantity_update\n\t\t},\n\t\t{\n\t\t\titem_id: item_update\n\t\t}\n\t\t],\n\t\tfunction(error) {\n\t\t\tif (error) throw err;\n\t\t\tinquirer.prompt([{\n\t\t\t\tname: \"anything_else\",\n\t\t\t\ttype: \"confirm\",\n\t\t\t\tmessage: \"Continue to Purhcase?\",\n\t\t\t\tdefault: true\n\t\t\t}]).then(function(res){\n\t\t\t\tif(res.anything_else){\n\t\t\t\t\trun();\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//if nothing else then end session\n\t\t\t\t\tconsole.log(\"Good Bye! Thanks for coming\");\n\t\t\t\t\tconnection.end();\n\t\t\t\t}\n\t\t\t})\n\t\t})\n}", "function totalProducts(sold,item,id){\n\titem.map(function(e){\n\t\tvar totalSold = Number(e.price) * Number(sold) + e.product_sales;\n\t\tconnection.query(\n\t\t\t\"update products set product_sales=? where item_id =?\",\n\t\t\t[totalSold,id],\n\t\t\tfunction(err){\n\t\t\t\tif(err){\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\t\t});\n\t});\n}", "function updateQuantity () {\n connection.query(`UPDATE products SET ? WHERE ?`,\n [\n {\n stock_quantity: newStockNum\n },\n {\n item_id: itemSelected\n }\n ],\n function (err, results) {\n if (err) {\n throw err;\n };\n // Test\n console.log(`Stock Quantity updated.`);\n }\n );\n}", "function update(req, res) {\n let data = [\n req.body.name,\n req.body.qty,\n req.body.amount,\n req.params.id\n ];\n\n connection.query('UPDATE items SET name = ?, qty = ?, amount = ? WHERE id = ?', data , function(error, results) {\n if (error) {\n res.status(500).send({\n message: `Error occured while updating item with id ${req.params.id}`\n });\n }\n\n apiResult = {\n message: 'Successfully updated',\n data: {\n id: req.params.id,\n name: req.body.name,\n qty: req.body.qty,\n amount: req.body.amount\n }\n };\n\n res.send(apiResult);\n });\n }", "function editData(event) {\n\tvar saleid = document.getElementById(\"saleid\").value;\n\tvar product = document.getElementById(\"editproduct\").value;\n\tvar quantity = document.getElementById(\"editquantity\").value;\n\tvar datetime = document.getElementById(\"editdatetime\").value;\n\tvar json =\n\t{\n\t\"authent\": {\n\t\t\t\"username\": \"feferi\",\n\t\t\t\"password\": \"0413\"\n\t\t},\n\t\t\n\t\t\"requests\": [\n\t\t\t{\n\t\t\t\t\"type\": \"edit\",\n\t\t\t\t\"updateTo\": {\n\t\t\t\t},\n\t\t\t\t\"filter\": {\n\t\t\t\t\t\"type\": \"column\",\n\t\t\t\t\t\"name\": \"id\",\n\t\t\t\t\t\"value\": saleid\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t};\n\t\n\tif(saleid && saleid.match(/^\\d*$/))\n\t{\n\t\tif(product != \"\")\n\t\t{\n\t\t\tjson.requests[0].updateTo.product = Number(product);\n\t\t}\n\t\t\n\t\tif(quantity != \"\")\n\t\t{\n\t\t\tjson.requests[0].updateTo.quantity = Number(quantity);\n\t\t}\n\t\t\n\t\tif(datetime != \"\")\n\t\t{\n\t\t\tjson.requests[0].updateTo.dateTime = getDateAndTime();\n\t\t}\n\t\t\t\t\t\t\n\t\treturn sendAPIRequest(json, event, displaySalesRecords);\n\t}\n\telse\n\t{\n\t\talert(\"Please enter a numerical value for sale id\");\n\t}\n\t\n}", "function placeOrder(id, quantity, item){\n\n var currentQuantity = item.quantity - quantity;\n var price = item.price * quantity;\n\n var query = `UPDATE PRODUCTS `+ \n `SET STOCK_QUANTITY = ${currentQuantity}, ` + \n `PRODUCT_SALES = ${price} + COALESCE(PRODUCT_SALES,0), ` +\n `PRODUCT_SOLD = ${quantity} + COALESCE(PRODUCT_SOLD,0) ` +\n `WHERE ITEM_ID = ${id};`;\n\n connection.query(query, function(err,data){\n if(err) {\n connection.end();\n throw err\n };\n\n console.log(`Product Updated to New Quantity ${currentQuantity}`);\n console.log(`Price $${price}`);\n });\n\n connection.end();\n }", "function updateInventory(itemID, updatedStock) {\n connection.query(\n // update 'products' table in the database\n // first '?' correspond to 'stock_quantity: updatedStock'\n // second '?' correspond to 'id: itemID'\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: updatedStock\n },\n {\n id: itemID\n }\n ],\n function(error) {\n if (error) throw error;\n //console.log(\"\\nInventory updated!\");\n \n }\n );\n}", "function updateSQL(item) {\n\t// build a query url for MYSQL by concatonating the delta of max qty and purchaseqty and the passed variable's property of property_id\n\tvar queryURL = \"UPDATE bamazon_products SET STOCK_QTY = \" + (item.maxQTY - item.purchaseQTY) + \" WHERE item_id = \" + item.item_id;\n\t// run the query through the connection\n\tconnection.query(queryURL, function (error, results) {\n\t\tif (error) {\n\t\t\treturn console.log('error!!')\n\t\t\tconsole.log(results)\n\t\t}\n\t})\n}", "function updateInventory(answer) {\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: chosenItem.stock_quantity + answer.stockAdded\n },\n {\n item_id: chosenItem.item_id\n }\n ],\n function (error) {\n if (error) throw error;\n console.log(\"Stock added.\");\n anotherAction();\n }\n );\n}", "function updateItem(item, itemToUpdate){\n const { \n truck_id = itemToUpdate.truck_id,\n item_name = itemToUpdate.item_name,\n item_description = itemToUpdate.item_description,\n item_photo_url = itemToUpdate.item_photo_url,\n item_price = itemToUpdate.item_price\n } = item.body\n\n const updatedItem = {\n truck_id,\n item_name,\n item_description,\n item_photo_url,\n item_price\n }\n return db('items')\n .where('id', item.id)\n .update(updatedItem)\n}", "function purchase(stock, item) {\n console.log(\"Okay, let's get your order ready. That'll be $\" + price + \". Hope you've got cash...Processing your order now.\");\n let query = \"UPDATE products SET stock_quantity = ? WHERE Item_id = ?\";\n connection.query(query, [stock, item], function(err, results) {\n displayStore();\n });\n\n}", "function updateItems(answer) {\n\n\tvar query = connection.query(\n\t\t\"UPDATE products SET `stock_quantity` = `stock_quantity` - ? WHERE ?\",\n\t\t[\n\t\t\tanswer.requestVol,\n\t\t\t{\n\t\t\t\tid: parseInt(answer.requestID)\n\t\t\t}\n\t\t], (err, res) => {\n\t\t\tconsole.log(res.affectedRows + \" items updated!\\n\")\n\t\t\t\t\n\t\t})\n\tconsole.log(query.sql);\n}", "function updateItem (itemId, itemNew) {\n return Item.findOneAndUpdate({ \"_id\": itemId}, itemNew, {upsert: false})\n}", "markAsSold(product) {\n const queryString = `UPDATE products\n SET is_sold = TRUE\n WHERE products.id = $1`;\n\n const queryParams = [product.productId];\n\n console.log('markAsSold', queryString, queryParams);\n\n return db\n .query(queryString, queryParams)\n .then(result => result)\n .catch(error => error.message);\n }", "function updateInvoice() {\n var total = 0, cells, price, i;\n $(\"#item-details tr\").each( function(index, element) {\n cells = $(element).children().toArray();\n price = parseFloat($(cells[1]).text()) * parseFloat($(cells[2]).text());\n total += price;\n if (!isNaN(price)) {\n $(cells[3]).text(price);\n } else {\n $(cells[3]).text(0);\n }\n });\n if (!isNaN(total)) {\n $(\"#total-price\").text(total);\n }\n }", "function updateDistributionInventory(args, results) {\n\ttry {\n\t\tif(results.setsReturned > 0) {\n\t\t\t// Find ID of updated record\n\t\t\tvar inventoryid = results[0].processed['id'];\n//\t\t\talert(\"Updated inventory item [\" + inventoryid + \"] with [\" + args.distributionref + \"]\");\n\t\t}\n\t\telse {\n\t\t\talert(\"No distribution inventory record updated\");\n\t\t}\n\t}\n\tcatch(err) {\n\t\t// Handle errors\n\t\talert(\"Function 'updateDistributionInventory' failed: \" + err);\n\t}\n}", "function validQuantity(itemId, unitsAmount, results) {\n var query = \"UPDATE products SET stock_quantity=?, product_sales=? WHERE ?\";\n // Calculating the total cost of the order.\n var total = unitsAmount * results.price;\n connection.query(query, [results.stock_quantity - unitsAmount, results.product_sales + total, { item_id: itemId }], function () {\n console.log(\"\\nYOUR TOTAL IS $\" + total + \"\\n\");\n askUser();\n });\n}", "function updateStock (itemID, userQuantity, stockQuantity, product){\n\n // parseInt is used to assure than userQuantity is a number and not a string\n var updateStock = stockQuantity + parseInt(userQuantity);\n\n var query = \"UPDATE products SET ? WHERE ?;\"\n connection.query(query,\n [\n { Stock_Quantity: updateStock}, \n { Item_ID: itemID }\n ],\n function(err, res){\n if (err) throw err;\n }\n );\n\n // Console logs the new amount of the specific item being updated\n // continuePrompt gets called to ask user if they want to do anything else\n console.log(\"\\nStock for \" + product + \" has been increased to \" + updateStock + \"\\n\");\n continuePrompt();\n}", "function sale(item, quantity) {\n\n // Pull the item specified by the user, from the database.\n connection.query (\"SELECT * FROM products WHERE ?\", \n { item_id : item }, function(err, res){\n\n if (err) throw err;\n\n // Compare the specified quantity to the number of items in inventory. If the quantity is\n // greater than the user specified quantity\n if (res[0].stock_quantity >= quantity) {\n\n // Subtract the specified quantity from the stock\n newQuantity = res[0].stock_quantity - quantity;\n var totalPrice = (res[0].price * quantity).toFixed(2);\n\n // update the database with new quantity\n connection.query (\"UPDATE products SET ? WHERE ?\", \n [\n { stock_quantity : newQuantity},\n { item_id: item }\n ], function (err, res){\n\n if (err) throw err;\n\n else {\n\n // Print the total price for the user\n console.log (\"The grand total will be $\" + totalPrice + \".\" + \" Thank you for shopping at Amazone!\");\n \n \n process.exit();\n }\n\n }); // Callback for Update query ends here\n\n }\n\n else {\n\n // Inform the user that there is not enough of the item in stock to fulfill the order\n console.log(\"Sorry! We don't have enough quantity\");\n process.exit();\n\n } \n }); // Initial query for the item ends here\n\n} // Sale function ends here.", "function updateAmount(reduxInvoiceItems) {\n let total = 0.0;\n reduxInvoiceItems.forEach((reduxInvoiceItem) => {\n total += reduxInvoiceItem.itemAmount;\n });\n setTotalAmountError(null);\n setTotalAmount(total);\n setBalance(total);\n if (operation === \"Create\") setBalance(total);\n }", "function updateInv(){\n connection.query(\n \"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: remainingInv\n },\n {\n item_id: purchId\n }\n ],\n function(err) {\n if (err) throw err;\n //if the update is successful, show the user the ourchase is being processed\n console.log(\"***** Processing order... *****\");\n //call the function that displays the current order\n setTimeout(displayOrder, 1 * 2000); \n }\n );\n}", "function updatePrices() {\n}", "handleSave() {\n callBackendAPI('/api/transactions/updateItems', 'post', {\n itemType: 'SHOP',\n updatedItems: this.state.products\n }).then(response => {\n this.setState({\n redirect: '/shop'\n });\n });\n }", "function updateItem(delta) {\n return Item.findOne({\"_id\":delta._id}).then(function(item) {\n let newDescription;\n let newCost;\n let newQuantity;\n if (delta.description) {\n newDescription = delta.description;\n } else {\n newDescription = item.description;\n }\n if (delta.cost) {\n newCost = delta.cost;\n } else {\n newCost = item.cost;\n }\n if (delta.quantity) {\n newQuantity = delta.quantity;\n } else {\n newQuantity = item.quantity;\n }\n return Item.updateOne(item,\n {$set: {\"description\": newDescription,\n \"cost\": newCost,\n \"quantity\": newQuantity}\n })\n })\n}", "function editSucursal(item) {\n this.editing = false;\n item.enterprise = item.enterprise._id;\n for (var i in item.cajas) {\n item.cajas[i] = item.cajas[i]._id;\n };\n item.$update(function() {\n console.log('todo ok');\n }, function(errorResponse) {\n console.log('error');\n });\n }", "function editEntry(entry){\n // making entry the variable that represents the entry id which includes amount, name,type\n let ENTRY = ENTRY_LIST[entry.id];\n // if the entry type is an input, we are going to update the item name and cost in the input section\n if (ENTRY.type == \"inputs\"){\n itemTitle.value = ENTRY.title;\n itemAmount.value = ENTRY.amount;\n }\n deleteEntry(entry);\n \n}", "updateItem (req, res, next) {\n console.log('updateItem request: ', req.body);\n const query = 'UPDATE items SET ' + req.body.set + ' = ' + req.body.newVal + ' WHERE _id = ' + req.body.id + ';';\n \n // alternative (less secure) approach: insert variable parameters into query using template literals ${___}. (Be sure to add columnInfo as the second parameter of db.query.)\n //$1 = location/priority/shared, $2 = updated value, $3 = _id of the item\n /*\n const query = `\n UPDATE items \n SET ${req.body.set} = $1\n WHERE _id = $2;`;\n const columnInfo = [req.body.newVal, req.body.id];\n */\n \n db.query(query, (err, data) => {\n if(err) {\n return next({\n log: `Express error handler caught in updateItem ERROR: ${err}`,\n message: { 'err': 'An error occurred in updateItem' }})\n } \n else {\n // console.log('Result of updateItem query: ', data);\n return next();\n } \n });\n }", "function addToCart(item) {\n console.log(item)\n let cartItem = db.collection('cart-items').doc(item.id);\n\n cartItem.get()\n .then(function (doc) {\n if (doc.exists) {\n cartItem.update({\n quantity: doc.data().quantity + 1,\n })\n }\n else {\n cartItem.set({\n image: item.image,\n make: item.make,\n name: item.name,\n price: item.price,\n rating: item.rating,\n quantity: 1\n })\n }\n })\n\n}", "function postNewItems(itemNum, newQty) {\r\n let query = \"UPDATE bamazon.products SET stock_quantity=? WHERE item_id=? \";\r\n bamazon.query(query, [newQty, itemNum], function (err, res) {\r\n if (err) throw (err);\r\n\r\n console.log(\"\\n Success! New item(s) added to the inventory\\n\");\r\n displayAllInventory();\r\n });\r\n}", "function totalSales(products, lineItems){\n //TODO\n\n}", "function editItem(e, row) {\n e.preventDefault();\n var item = row.data('item');\n\n $(\"#editButtons\").show();\n $(\"#btnUpdate\").data('row', row);\n $(\"#btnAdd\").hide();\n\n $(\"#product\").val(item.product);\n $(\"#quantity\").val(item.quantity);\n $(\"#price\").val(item.price);\n $(\"#datetime\").val(item.datetime);\n}", "updateQuantityInCart(lineItemId, quantity) {\n const state = store.getState().home.cart; // state from redux store\n const checkoutId = state.checkout.id\n const lineItemsToUpdate = [{ id: lineItemId, quantity: parseInt(quantity, 10) }]\n state.client.checkout.updateLineItems(checkoutId, lineItemsToUpdate).then(res => {\n store.dispatch({ type: 'UPDATE_QUANTITY_IN_CART', payload: { checkout: res } });\n });\n }", "function addRow(record, index, allItems) {\n\n // Search for duplicates\n var foundItem = me.opArtGrid.store.findExact('id_art', record.data.id_art);\n // if not found\n if (foundItem == -1) {\n me.opArtGrid.store.add(record);\n // Call a sort dynamically\n me.opArtGrid.store.sort('id_opart', 'DESC');\n //Remove Record from the source\n ddSource.grid.store.remove(record);\n // Recalc new opsumm\n me.opArtGrid.setOpSumm();\n\n }\n }", "function updateQuantity(id, addUnits) {\n connection.query(\"SELECT * FROM products WHERE item_id=?\", [id], function (err, response) {\n if (err) throw err;\n var name = response[0].product_name;\n var currentQuantity = parseInt(response[0].stock_quantity);\n var newQuantity = currentQuantity + addUnits;\n connection.query(\"UPDATE products SET ? WHERE ?\",\n [\n {\n stock_quantity: newQuantity\n },\n {\n item_id: id\n }\n ], function (err, response) {\n if (err) throw err;\n clearConsole();\n consoleMessage(\"Number of \" + name + \" in stock raised from \" +\n currentQuantity + \" to \" + newQuantity);\n userOptions();\n })\n\n })\n}", "replaceModalItem(index, ProductId, CustomerId, StoreId, DataSold) {\n this.setState({\n item_Id: index,\n item_ProductId: ProductId,\n item_CustomerId: CustomerId,\n item_StoreId: StoreId,\n item_DataSold: DataSold \n });\n }", "update(id, receipt) {\n return 1;\n }", "function updateInventoryItem(itemId, quantity)\n\t{\n\t\tquantity = 500;\t\t//TEST CODE REMOVE\n\t\titemId = 3;\t\t\t//TEST CODE REMOVE\n\t\t\n\n\t\tvar updateData = {\n\t\t\t\"quantity\": quantity\n\t\t};\n\n\n\t\t$.ajax({\n\t \tmethod: \"PUT\",\n\t \turl: \"/api/inventory/\" + itemId,\n\t \tdata: updateData\n\t })\n\t .done(function(data) {\n\t \tconsole.log(JSON.stringify(data, null, 2)); //TEST CODE\n\n\t \t//Logic using data here.\n\t \t\n\t });\n\t}", "function updateSulfuras(item) {\n return item;\n}", "updateContentsProduct(row) {\n let self = this;\n let data = row.data;\n let put = {\n quantity: data.quantity || 0,\n country: data.country || '',\n gtd: data.gtd || '',\n total_w_vat: data.total || 0\n };\n\n this.serverApi.updateReceiveOrderContents(this.receiveOrder.id, data.id, put, result => {\n if(!result.data.errors){\n let r = self.receiveOrder.product_order_contents;\n r[row.index] = angular.extend(r[row.index], result.data);\n self.calculateProductOrderContents();\n self.funcFactory.showNotification('Успешно', 'Продукт ' + data.product.name + ' успешно обновлен', true);\n } else {\n self.funcFactory.showNotification('Не удалось обновить продукт ' + data.product.name, result.data.errors);\n }\n })\n }" ]
[ "0.7487715", "0.7419291", "0.7258978", "0.6660814", "0.6657514", "0.663115", "0.65494645", "0.6477898", "0.64133316", "0.6398499", "0.63968354", "0.6353275", "0.63235843", "0.6308567", "0.63012666", "0.6292885", "0.6283933", "0.62696624", "0.62630177", "0.6244582", "0.6232437", "0.6198138", "0.617384", "0.6171891", "0.61299914", "0.61281186", "0.6121508", "0.611937", "0.60981536", "0.60825723", "0.60821396", "0.60736173", "0.6072218", "0.6068592", "0.6060245", "0.60579985", "0.6054141", "0.6043415", "0.60433686", "0.60314494", "0.6028352", "0.6027018", "0.60261357", "0.6017502", "0.6008255", "0.5973401", "0.5969165", "0.596894", "0.59686315", "0.5949863", "0.5934793", "0.59257567", "0.59251785", "0.5924791", "0.5921559", "0.59205574", "0.58967054", "0.58927506", "0.58879775", "0.5885324", "0.5884979", "0.5848534", "0.58434355", "0.58408374", "0.583925", "0.58366084", "0.58358926", "0.58349955", "0.5834691", "0.583307", "0.5828054", "0.58223057", "0.5820926", "0.58116186", "0.5806094", "0.5800131", "0.5780214", "0.5777949", "0.57734984", "0.5766838", "0.5765259", "0.5756781", "0.5743498", "0.5742533", "0.5736158", "0.57351613", "0.57330513", "0.57271165", "0.5718924", "0.571585", "0.57041216", "0.5703032", "0.5701152", "0.5694158", "0.5692861", "0.5692037", "0.569077", "0.56897485", "0.5687603", "0.56874365" ]
0.57738215
78
set your counter to 1
function myLoop () { // create a loop function setTimeout(function () { // call a 3s setTimeout when the loop is called var randomNum = Math.ceil(Math.random()*10); datep = datep+1; gdpp1 = scale*randomNum; gdpp2 = (capacity/randomNum)*10; var dateps = datep.toString(); datap.addRows([[dateps, gdpp1, gdpp2]]); chartp.draw(datap, optionsb); chartp2.draw(datap, optionsb); // your code here i++; // increment the counter if (i < 2030) { // if the counter < 10, call the loop function myLoop(); // .. again which will trigger another } // .. setTimeout() }, 100) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function incrementCounter() {\n setCounter(counter + 1);\n }", "function Increment(){\n setCounter(counter + 1) \n }", "function increment(){\n\t\tsetCount(prevCount=>prevCount+1)\n\t}", "function incrementCounter () {\r\n counter ++;\r\n console.log('counter', counter);\r\n }", "function incrementCounter () {\n counter ++;\n console.log('counter', counter);\n }", "function incrementCounter () {\n counter ++;\n console.log('counter', counter);\n }", "function incrementCounter () {\n counter ++;\n console.log('counter', counter);\n }", "function counterUp() {\n counter += 1;\n }", "function IncrementCount() {\r\n\t\r\n\t++count;\r\n}", "function incrementCounter () {\n\t\tcounter ++;\n\t\tconsole.log('counter', counter);\n\t}", "increment() {\n this.counter += 2;\n this.clicks++;\n }", "function iterateCounter() {\n counter++;\n}", "function incrementCounter() {\n counter++;\n console.log(\"counter\", counter);\n }", "function counter() {\n return counter.count++; // counter++;\n }", "resetCount() {\n this.count = this.initialCount;\n }", "onInc() {\n this.count++;\n }", "addCount() {\n this.count++;\n }", "function count() {\n return counter +=1;\n }", "function increment() {\n return increment.count++;\n }", "function increment() {\n count += 1\n countEl.innerText = count\n}", "function add1Counter() {\n clicks += 1;\n counter.innerHTML = clicks;\n}", "incrementCounter() {\n\t\tmodel.currentCat.clickCount++;\n\t\tcatView.render();\n\t}", "function addCount() {\n count++;\n $('.count').html(count);\n }", "function startCount() {\r\n setCounter(7, \"#WORKS\", 500);\r\n setCounter(70, \"#Visted\", 60);\r\n setCounter(80, \"#clients\", 50);\r\n setCounter(100, \"#freelancing\", 30);\r\n}", "function increment(){\r\n return this.count++;\r\n}", "function doCounter(e) {\n $.label.text = parseInt($.label.text) + 1;\n }", "function increment() {\n i++;\n document.querySelector(\"h1#counter\").textContent = i;\n j = 0;\n}", "function increaseCount(number){\n return number + 1;\n }", "function incrementCounter() {\n logCount += 1;\n $log.log(TAG + 'Iterating log counter', logCount);\n logCount >= logLimit && moveLog();\n }", "function incrementCounter() {\n return counterValue += 1;\n }", "function countPlus(){\n setCount(count+1)\n }", "Increment(){\n this.count += 1;\n console.log(this.count);\n }", "increment() {\n this.referenceCount++;\n }", "function incCounter() {\n counter++;\n console.log(\"Counter:\", counter);\n}", "function countUp () {\n counter.textContent = Number(counter.textContent) + 1;\n}", "function count(){\n var count = document.getElementById('count');\n\n counter++;\n count.innerHTML = counter\n}", "function addOne() {\n counter++;\n console.log(counter);\n}", "set count(value) {}", "function resetCounter() {\n counter = 0;\n // el = <p>{counter}</p>;\n // return el;\n }", "function counter() {\n\n}", "function counterActivator() {\n if ($(\".counter\").length) {\n $(\".counter\").counterUp({\n delay: 70,\n time: 1000,\n });\n }\n }", "increment() {\n this[$referenceCount]++;\n }", "function Counter() {\n // Note that it does not use 'this'!\n }", "function increaseCounter() {\n\tmoveCounter.innerText = counter;\n\tcurrentDisk.classList.toggle('selected');\n\tcounter++;\n}", "increment()\n {\n this.cntr++;\n document.getElementById('label').innerHTML = `${this.cntr}`;\n }", "function inc(count) {\n count.value++;\n return count;\n}", "function setCounter(_counter) {\n\t\tcounter = _counter;\n\t}", "function incrementCount() {\n setCount(prevCount => prevCount+1)\n setTheme(\"red\")\n }", "function plusOne() {\n\tlocalStorage.setItem(\"count\", (Number(localStorage.getItem(\"count\")) + 1));\n\tupdate();\n}", "SetCounterValue() {}", "m_counter_pp(state) {\n state.m_counter = state.m_counter + 1;\n }", "function count() {\r\n\r\n \ttargetCount++\r\n \tscoreBox.text(targetCount);\r\n }", "function resetCounter() {\r\n console.log(`${num} and the counter reset now`);\r\n num = 1;\r\n}", "function counters(){\n counters.count++;\n}", "function counterUpOne(){\n\t\t\t_scrollPrevLimit = _scrollNextLimit;\n\t\t\t_scrollCounter++;\n\t\t\t_scrollNextLimit = _scrollCounter === _scrollCounterMax ? 100000 : $('.article[data-id=\"' + _scrollCounter + '\"]').offset().top;\n}", "function add() {\n counter += 1;\n}", "function add() {\n counter += 1;\n}", "function plusOne() {\n\tlocalStorage.setItem(\"count\",Number(localStorage.getItem(\"count\"))+1);\n\tupdate();\n}", "function moveCounter() {\n counter.innerHTML ++;\n}", "function updateClickCount() {\r\n\tvar counter = 0\r\n\tcounter += 1;\r\n\t// do something with the counter\r\n}", "function increaseCounter(){\n countNbCall++;\n if(debug){logCounter(countNbCall);}\n return countNbCall;\n }", "constructor() {\n super();\n this._count = 1;\n }", "constructor() {\n this.count = 0;\n }", "increment() {\n this.score++;\n }", "increment(state) {\n state.count++\n }", "function plusOne() {\r\n\tlocalStorage.setItem(\"count\", (Number(localStorage.getItem(\"count\")) + 1));\r\n\tupdate();\r\n}", "function start() {\n counter = 0;\n $('#totalScore').text(counter);\n }", "function add() {\n counter += 1;\n}", "@action\n setStartingCount(ev) {\n const count = Number(ev.currentTarget.value);\n this.startingCount = count;\n }", "function incrementCounter(){\n\tnumberOfMoves++;\n\tconsole.log(`total moves ${numberOfMoves}`);\n\tcounterForMoves.innerHTML = numberOfMoves;\n\tif(numberOfMoves == 1){\n\t\tstartTimer();\n\t}\n}", "function moveCount(){\ncounter ++;\ncounterDisplay.innerHTML = counter;\n}", "function count($this) {\n var current = parseInt($this.html(), 10);\n current = current + 1; /* Where 50 is increment */\n $this.html(++current);\n if (current > $this.data('count')) {\n $this.html($this.data('count'));\n } else {\n setTimeout(function() {\n count($this)\n }, 50);\n }\n }", "function incrementCounter()\n\t{\n\t\tmovesCounter ++;\n\t\t$('#moves_id').html(movesCounter + \" Move(s)\");\n\t}", "function tapCounterFunc(tapCounter){\n tapCounter.counter++;\n }", "function setCounter(status) {\n let counter = document.getElementById(`${status}-counter`);\n counter.innerText = (parseInt(counter.innerText) + 1).toString();\n myStorage.setItem(status,(parseInt(myStorage.getItem(status)) + 1).toString());\n }", "function updateCount(guess) {\n\t\tcount += 1;\n\t\t$('#count').text(count);\n }", "increment (state) {\n state.count++;\n }", "function counterGeneracionPoema() {\nif (counter == 0) {\n counter = tiempoParaCambiarTodo/1000;\n} counter--;\n document.getElementById(\"outputTiempo\").innerHTML = counter; \n}", "function incrementIndex()\r\n {\r\n //increment index\r\n counter += 1;\r\n // at end of array start over\r\n if (counter >= currentObjects.length)\r\n {\r\n counter = 0;\r\n }\r\n }", "incrementIndex() {\n this.currentIndex = this.frames.length === this.currentIndex + 1 ? 0 : this.currentIndex + 1;\n }", "function incrementRedCount() {\n setRedCount(redCount + 1)\n }", "increment() {\n this.setState(prevState => ({\n count: prevState.count + 1\n }));\n }", "function delCount() {\n count--;\n $('.count').html(count);\n }", "function sum(){\n setCount(count+1)\n }", "function counterAdv(){\n i++;\n heading.innerText = i ;\n}", "function incrementByOne (counter) {\n\n counter[0] += 1;\n\n for (i = 0; i < counter.length; i++){\n\n if (counter[i] > i){\n counter[i] = 0;\n counter[(i+1)] += 1;\n }\n }\n\n return counter;\n }", "function countUserTrials() {\n //equals to acc += 1\n acc = acc + 1;\n counterEl.innerHTML = acc;\n}", "function updateCounter() {\n $('#cart-counter').first().text($('.cart-item').length);\n }", "function increment() {\n\t// Increment the counter value in server\n\tsocket.emit('incrementCounterValue');\n}", "function count($this){\n var current = parseInt($this.html(), 10);\n current = current + 50;\n $this.html(++current);\n if(current > $this.data('count')){\n $this.html($this.data('count'));\n } \n else { \n setTimeout(function(){count($this)}, 50);\n }\n }", "function cntupdate() {\n var cnt = 0;\n for (cnt; cnt < $('.list-elem').length; cnt++);\n $('.taskcount strong').text(cnt);\n var num = cnt;\n return ++num;\n }", "function reset_counter(){\n $('.selected_items tr').each(function (index) {\n $(this).find('.counter').text($(this).index()+1)\n })\n}", "function updateCount(i) {\n\t// Get the current number\n\tcount = parseInt($('#room_count').text());\n\n\t// Add on the agument\n\t$('#room_count').text(count + i);\n}", "function incrementCounter() {\n for (let i = innerLen - 1; i >= innerLen - 4; i--) {\n inner[i]++;\n if (inner[i] <= 0xff) return;\n inner[i] = 0;\n }\n }", "function incrementCounter() {\n for (let i = innerLen - 1; i >= innerLen - 4; i--) {\n inner[i]++;\n if (inner[i] <= 0xff) return;\n inner[i] = 0;\n }\n }", "function incrementCounter() {\n for (let i = innerLen - 1; i >= innerLen - 4; i--) {\n inner[i]++;\n if (inner[i] <= 0xff) return;\n inner[i] = 0;\n }\n }", "function incrementCount(params) {\n\t// increase count by 1 per each 'next' arrow click\n\tcardCount++;\n\tif (cardCount > energetics.length) {\n\t\tcardCount = 1;\n\t}\n\tcurCard.innerText = cardCount;\n}", "function increment() {\n\tnumber += 1; /*\n\t\t\t\t\t * Function for automatic increment of field's \"Name\"\n\t\t\t\t\t * attribute.\n\t\t\t\t\t */\n}", "function gssCnt(){\n\tcnt++;\n}", "function UpdateCart()\n{\n if (!$(\".count\")[0]){ $(\".sprites-cart\").html(\"<div class='count'>0</div>\"); }\n var count = parseInt($(\".count\").text())\n console.log(count) \n count = count + 1;\n $(\".count\").text(count);\n}", "function increaseCounter()\n{\n\t//increase the global counter in one\n\tcounter++;\n\t//update the screen with the new value\n\tdocument.getElementById('screen').innerHTML = \"The counter value is \"+counter;\n}" ]
[ "0.80675226", "0.78473806", "0.7641305", "0.758745", "0.7501995", "0.7501995", "0.7501995", "0.7497403", "0.7388694", "0.7368814", "0.73529434", "0.7343868", "0.7340014", "0.73354733", "0.72501016", "0.7172979", "0.7142189", "0.7119729", "0.70900935", "0.7061894", "0.7027055", "0.6992326", "0.6977181", "0.6965903", "0.69532067", "0.6941174", "0.6935882", "0.6927663", "0.6891196", "0.6887802", "0.6874287", "0.6870377", "0.6851191", "0.6842871", "0.68370974", "0.68315333", "0.6822119", "0.68144155", "0.67929906", "0.67897415", "0.67781556", "0.6769517", "0.67656857", "0.6761281", "0.67563444", "0.6738267", "0.6735773", "0.6701651", "0.668713", "0.6683819", "0.6646713", "0.66459614", "0.66445524", "0.6639975", "0.66363806", "0.6634415", "0.6634415", "0.6618405", "0.6602877", "0.659115", "0.65725213", "0.65669036", "0.65581477", "0.6546959", "0.6546913", "0.65447307", "0.654464", "0.654278", "0.6540897", "0.65237105", "0.65228665", "0.65208834", "0.65185344", "0.6512649", "0.65108806", "0.6506451", "0.650407", "0.6498571", "0.6495837", "0.6495101", "0.64943886", "0.64905775", "0.64748156", "0.6463862", "0.64593816", "0.64567775", "0.6445123", "0.6443631", "0.6421523", "0.6416078", "0.64105207", "0.6402275", "0.6396247", "0.6389619", "0.6389619", "0.6389619", "0.63895285", "0.63892996", "0.6387546", "0.6386193", "0.6382833" ]
0.0
-1
myAns: pony, undefined trAns: pony, lol explain: deep's val was assigned with 'pony' and sure was assigned as 'lol'
function es6() { var left = 10; var right = 20; if (right > left) { //console.log([left,right]); [left, right] = [right, left]; } // console.log([left,right]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "a(a.a, \"a\", a() { a.a.aAa = a.a.aAa = 0; });N\nN\n a.aAa = {N\n a: a(a) {a (!aAa(a, a)) a_a(a);},N\n a: a(a) {a (!aAa(a, a)) { aAaAa(a, a); a_a(a); }},N\n a: a(a){aAaAa(a, a);},N\n a: a(a, aAa),N\n a: a(a) {a (!aAa(a, a)) { aAaAa(a); }}N\n };N\nN\n a a = a.a.aAa();N\n a(a, \"a\", a(a) { aAaAa.a(a, a); });N\n a(a, \"a\", a(a, aAaAa));N\n a(a, \"a\", a(a, aAaAa));N\n a(a, \"a\", a(aAa, a));N\n a(a, \"a\", a(aAa, a));N\n }N\nN\n a aAaAa(a, a, a) {N\n a aAa = a && a != AaAa.Aa;N\n a (!a != !aAa) {N\n a a = a.a.aAa;N\n a a = a ? a : a;N\n a(a.a.a, \"a\", a.a);N\n a(a.a.a, \"a\", a.a);N\n a(a.a.a, \"a\", a.a);N\n a(a.a.a, \"a\", a.a);N\n a(a.a.a, \"a\", a.a);N\n }N\n }N\nN\n // Aa a a a aN\n a aAa(a) {N\n a a = a.a;N\n a (a.aAaAa == a.a.aAa && a.aAaAa == a.a.aAa)N\n a;N\n // Aa a a a a a, a a a.N\n a.aAaAa = a.aAaAa = a.aAaA = a;N\n a.aAa = a;N\n a.aAa();N\n }N\nN\n // A AN\nN\n // Aa a a a a a a a a a aN\n a aAaAa(a, a) {N\n a (a a = a_a(a); a != a.a; a = a.aAa) {N\n a (!a || (a.aAa == 0 && a.aAa(\"a-a-a\") == \"a\") ||N\n (a.aAa == a.a && a != a.a))N\n a a;N\n }N\n }N\nN\n // Aa a a a, a a a a. Aa aN\n // a a, a a a a a a a a a,N\n // a a a a a a. aAa a a a aN\n // a, a a a a a a a a aN\n // a a a a a a a.N\n a aAaAa(a, a, a, aAa) {N\n a a = a.a;N\n a (!a && a_a(a).aAa(\"a-a-a\") == \"a\") a a;N\nN\n a a, a, a = a.aAa.aAaAaAa();N\n // Aa a a A[0] a a a a a a.N\n a { a = a.aA - a.a; a = a.aA - a.a; }N\n a (a) { a a; }N\n a a = aAa(a, a, a), a;N\n a (aAa && a.aAa == 0 && (a = aAa(a.a, a.a).a).a == a.a) {N\n a aAa = aAa(a, a.a, a.a.aAa) - a.a;N\n a = Aa(a.a, Aa.a(0, Aa.a((a - aA(a.a).a) / aAa(a.a)) - aAa));N\n }", "a (a.a - a < 0 &&N\n (a.a.a > 0 || !(a.a[0] a AaAa))) {N\n a a = [];N\n a.a(a);N\n a.a = [a AaAa(a)];N\n a.a[0].a = a;N\n }", "a (!a.a.a) a = \"a\";N\n a a = aAaAa(a, a);N\n }N\nN\n a aAa = a.a.aAa;N\n a a = aAa(a, a), aAa = aAa(a.a, a, aAa);N\n a (a.aAa) a.aAa = a;N\n a aAaAa = a.a.a(/^\\a*/)[0], a;N\n a (!a && !/\\A/.a(a.a)) {N\n a = 0;N\n a = \"a\";N\n } a a (a == \"a\") {N\n a = a.a.a(a, a.a.a(aAaAa.a), a.a);N\n a (a == Aa || a > 0) {N\n a (!a) a;N\n a = \"a\";N\n }N\n }N\n a (a == \"a\") {N\n a (a > a.a) a = aAa(aAa(a, a-0).a, a, aAa);N\n a a = 0;N\n } a a (a == \"a\") {N\n a = aAa + a.a.aAa;N\n } a a (a == \"a\") {N\n a = aAa - a.a.aAa;N\n } a a (a a == \"a\") {N\n a = aAa + a;N\n }N\n a = Aa.a(0, a);N\nN\n a aAa = \"\", a = 0;N\n a (a.a.aAaAa)N\n a (a a = Aa.a(a / aAa); a; --a) {a += aAa; aAa += \"\\a\";}N\n a (a < a) aAa += aAa(a - a);N\nN\n a (aAa != aAaAa) {N\n aAa(a, aAa, Aa(a, 0), Aa(a, aAaAa.a), \"+a\");N\n a.aAa = a;N\n a a;N\n }", "function dAssign222(result, curr) {\n\t//console.log(arr)\n\tconsole.log(Reflect.ownKeys(curr).length)\n\t/*for (let i=0; i<Object.keys(curr).length; i++) {\n\t\tresult[Object.keys(curr)[i]] = curr[Object.keys(curr)[i]]\n\t}\t*/\t\n\tReflect.ownKeys(curr).forEach()\n\tconsole.log(Reflect.ownKeys(curr))\n\t//console.log(result)\n\treturn result\n}", "a (a a = 0; a < 0; a++) { // Aa a a a 0 a a a a a aN\n a (a && aAaAa(a.a.a.aAa(a.aAa + a))) --a;N\n a (a.aAa + a < a.aAa && aAaAa(a.a.a.aAa(a.aAa + a))) ++a;N\n a (a && a_a < 0 && a == 0 && a == a.aAa - a.aAa) {N\n a = a.aAa.aAaAaAa();N\n } a a (a && a.a.aAa) {N\n a a = a(a, a, a).aAaAa();N\n a (a.a)N\n a = a[a == \"a\" ? a.a - 0 : 0];N\n aN\n a = aAa;N\n } a {N\n a = a(a, a, a).aAaAaAa() || aAa;N\n }N\n a (a.a || a.a || a == 0) a;N\n a = a;N\n a = a - 0;N\n a = \"a\";N\n }", "a (a a = 0; a < a.a; ++a) {N\n a a = a[a];N\n a (a.a != a) a.a += a;N\n a (a.a == a) {N\n a a = aAaAaAa(a, a.a);N\n a (!a) {N\n a.a = a;N\n a (aAa) (a || (a = [])).a(a);N\n }N\n } a {N\n a.a += a;N\n a (aAa) (a || (a = [])).a(a);N\n }N\n }", "function La(n,t){for(var e in t)n[e]=t[e];return n}", "a (a a = 0; a < a.a; ++a) {N\n a a = a[a];N\n a (a.a == a) {N\n a a = aAaAaAa(a, a.a);N\n a (!a) a.a = aAa;N\n a a (aAa) a.a = a.a == a ? a : a.a + a;N\n }N\n }", "function nd(a){this.la={};this.o=a}", "function assumedRelation(x)\n{\n return x;\n}", "function imprimirEdad(persona)\n{\n // var edad = persona.edad\n var { edad } = persona\n console.log(edad)\n}", "function Assign_Lex_Other() {\r\n}", "function a(t, n) {\n return t[0] = n[0], t[1] = n[1], t;\n }", "function doextra(attr, val) {\n\t if(Array.isArray(attr)) {\n\t attr.forEach(function(a) { doextra(a, val); });\n\t return;\n\t }\n\t // quit if explicitly setting this elsewhere\n\t if(attr in aobj) return;\n\t\n\t var p = Lib.nestedProperty(layout, attr);\n\t if(!(attr in undoit)) undoit[attr] = p.get();\n\t if(val !== undefined) p.set(val);\n\t }", "function sd(a){this.ta={};this.o=a}", "function ta(t) {\n var e = t.p_(), n = Bo(t.I_);\n return new $s(t.I_, !!e.ignoreUndefinedProperties, n);\n}", "function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}", "function xx(a,b){return\"method\"!==b.kind||!b.ej||\"value\"in b.ej?(ia(),{kind:\"field\",key:Symbol(),oW:\"own\",ej:{},Dj:function(){\"function\"===typeof b.Dj&&(this[b.key]=b.Dj.call(this))},$l:function(c){c.Ca(b.key,a)}}):Object.assign(Object.assign({},b),{$l:function(c){c.Ca(b.key,a)}})}", "whichRelationIsThis(i) {\n switch(i) {\n case 1:\n return \"Dual (Soulmate). \\nRank: 1\";\n \n case 2:\n return \"Identical (Same type). \\nRank: 2\";\n \n case 3:\n return \"Activity (Chill friends). \\nRank: 3\";\n \n case 4:\n return \"Mirror (The introverted/extrovered versions of each other). \\nRank: 4\";\n \n case 5:\n return \"Kindred (Share 1st function). \\nRank: 5\";\n \n case 6:\n return \"Look-a-like (Share 2nd function). \\nRank: 6\";\n \n case 7: \n return \"Semi-dual (Same as soulmate but with different second function). \\nRank: 7\";\n \n case 8:\n return \"Illusionary (Same as soulmate but with different first function). \\nRank: 8\";\n \n case 9:\n return \"Super-ego (Each type seems most detrimental to society to the other). \\nRank: 9\";\n \n case 10:\n return \"Benefit: \"+this.type.toTypeCode()+\" is Benifactee. \\nRank: 10\";\n \n case 11: \n return \"Benefit: \"+this.type.toTypeCode()+\" is Benefactor. \\nRank: 11\";\n \n case 12:\n return \"Supervision: \"+this.type.toTypeCode()+\" is Supervisor. \\nRank: 12\";\n \n case 13:\n return \"Supervision: \"+this.type.toTypeCode()+\" is Supervisee. \\nRank: 13\";\n \n case 14:\n return \"Quasi-identical (Rival). \\nRank: 14\";\n \n case 15:\n return \"Contrary (Ultimate Rival). \\nRank: 15\";\n \n default:\n return \"Conflict. \\nRank: 16\";\n \n }\n }", "function ng(t,e,n,r,i){if(il()(e))return DA.apply(void 0,Km(uu()(e).call(e,(function(e){return ng(t,e)}))));i=i||function(t,e){return t.get(e)};var o=\"change:\".concat(e),a=eg(t,o,(function(){return i(t,e)})),s=[];return null!=r&&s.push(RA(r)),n&&(Object(ro[\"n\"])(n)||(n=ro[\"l\"]),s.push(qm(n))),s.push(gA((function(t){return{prop:e,value:t}}))),a.pipe.apply(a,s)}", "function Rt(t, e, n, r, i, o, u) {\n return void 0 === e && (e = null), void 0 === n && (n = []), void 0 === r && (r = []), \n void 0 === i && (i = null), void 0 === o && (o = null), void 0 === u && (u = null), \n new Lt(t, e, n, r, i, o, u);\n}", "function sayMyName(human) {\n var _a;\n console.log(\"Hi \" + human.name.first + \" \" + ((_a = human.name.last) !== null && _a !== void 0 ? _a : ''));\n}", "function doextra(attr, val) {\n if(Array.isArray(attr)) {\n attr.forEach(function(a) { doextra(a, val); });\n return;\n }\n\n // if we have another value for this attribute (explicitly or\n // via a parent) do not override with this auto-generated extra\n if(attr in aobj || helpers.hasParent(aobj, attr)) return;\n\n var p = Lib.nestedProperty(layout, attr);\n if(!(attr in undoit)) {\n undoit[attr] = undefinedToNull(p.get());\n }\n if(val !== undefined) p.set(val);\n }", "function a(e){return void 0===e&&(e=null),Object(r[\"p\"])(null!==e?e:i)}", "function a(t, a) {\n return t[0] = a[0], t[1] = a[1], t[2] = a[2], t[3] = a[3], t[4] = a[4], t[5] = a[5], t;\n }", "function foo(_a) {\n var x = _a.x;\n console.log(x); // Refer to x directly\n}", "function i(t){return void 0===t&&(t=null),Object(r[\"l\"])(null!==t?t:o)}", "function a(t, a) {\n return t[0] = a[0], t[1] = a[1], t[2] = a[2], t[3] = a[4], t[4] = a[5], t[5] = a[6], t[6] = a[8], t[7] = a[9], t[8] = a[10], t;\n }", "explain (edge = null, seen = []) {\n if (this[_explanation])\n return this[_explanation]\n\n return this[_explanation] = this[_explain](edge, seen)\n }", "function n(t,a){return t[0]=a[0],t[1]=a[1],t[2]=a[2],t[3]=a[3],t[4]=a[4],t[5]=a[5],t[6]=a[6],t[7]=a[7],t[8]=a[8],t[9]=a[9],t[10]=a[10],t[11]=a[11],t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15],t}", "function doextra(attr, val) {\n\t if(Array.isArray(attr)) {\n\t attr.forEach(function(a) { doextra(a, val); });\n\t return;\n\t }\n\t\n\t // if we have another value for this attribute (explicitly or\n\t // via a parent) do not override with this auto-generated extra\n\t if(attr in aobj || helpers.hasParent(aobj, attr)) return;\n\t\n\t var p = Lib.nestedProperty(layout, attr);\n\t if(!(attr in undoit)) undoit[attr] = p.get();\n\t if(val !== undefined) p.set(val);\n\t }", "function assign(left, right, keepMods) {\n if (left instanceof Array) {\n if (!(right instanceof Array))\n console.log('errrr');\n left.forEach(function(_, prop) {\n assignHelper(left, right, prop, keepMods);\n });\n }\n else {\n for (var prop in left) {\n if (!isPOJS(right))\n console.log('errrr');\n assignHelper(left, right, prop, keepMods);\n }\n }\n return right;\n }", "function AvsAnOverride_(fword) {\n //var exeptionsA_ = /^(?:uis?|co\\w|form|v|data|media)/i;\n var exeptionsA_ = /^(?:uis?|data)/i;\n var exeptionsAn_ = /(?:^[lr]value|a\\b|sql)/i;\n return (exeptionsA_.test(fword) ? article[0] :\n exeptionsAn_.test(fword) ? article[0]+\"n\" : false);\n }", "function purePriority(object) {\n for (var property in object) {\n if (object.hasOwnProperty(property)) {\n if (typeof object[property] == \"object\"){\n\t\t\t\tif(property != 'aa'){\n\t\t\t\t\trunningword += property;\n\t\t\t\t\tpurePriority(object[property]);\n\t\t\t\t\trunningword = runningword.substring(0,runningword.length-1); //back up and erase new addition from running word\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//include original suggestion\n\t\t\t\t\talternatearray = object['aa']\n\t\t\t\t\tfor (var j = 0; j < alternatearray.length; j++){\n\t\t\t\t\t\tbasechoicearray.push([runningword,alternatearray[j][1],'a',alternatearray[j][0]]);\n\t\t\t\t\t}\n\t\t\t\t}\n }else if(property == 'nn'){\n //found a property which is not an object - push base word and check for pure form later\n\t\t\t\tif(object.pp){\n\t\t\t\t\tbasechoicearray.push([runningword,object['nn'],'a',object['pp']]);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tbasechoicearray.push([runningword,object['nn'],'a',runningword]);\n\t\t\t\t}\n }\n }\n }\n}", "function o(t){return i(t)||a(t)||s()}", "function n(t){for(var e in t)i.hasOwnProperty(e)||(i[e]=t[e])}", "function simplifyTwoToOne(whose,who){\n\t\tvar call = \" \";\n for(var i in set){\n\t\t\tif( whose == set[i].name ){\n\t\t\t\tcall = set[i][who];\t\n\t\t\t}\n\t\t}\n\t\tif( call === \"未知\"|| call === \" \") call = \"关系太远了,随便叫叫吧!\";\n\t\tif( call === \"同性\") call = \"暂无同性称呼,但是真爱无敌!\";\n\t\treturn call;\n\t}", "function ae(a){return a&&a.rd?a.uc():a}", "static initialize(obj) { \n obj['rightToLiteral'] = rightToLiteral;\n }", "function doextra(attr, val, i) {\n\t if(Array.isArray(attr)) {\n\t attr.forEach(function(a) { doextra(a, val, i); });\n\t return;\n\t }\n\t // quit if explicitly setting this elsewhere\n\t if(attr in aobj || helpers.hasParent(aobj, attr)) return;\n\t\n\t var extraparam;\n\t if(attr.substr(0, 6) === 'LAYOUT') {\n\t extraparam = Lib.nestedProperty(gd.layout, attr.replace('LAYOUT', ''));\n\t } else {\n\t extraparam = Lib.nestedProperty(data[traces[i]], attr);\n\t }\n\t\n\t if(!(attr in undoit)) {\n\t undoit[attr] = a0();\n\t }\n\t if(undoit[attr][i] === undefined) {\n\t undoit[attr][i] = extraparam.get();\n\t }\n\t if(val !== undefined) {\n\t extraparam.set(val);\n\t }\n\t }", "function walk_tree(ast) {\n var walker = {\n \"assign\" : function() {\n var assign_expr = new assign_expression();\n assign_expr.type = \"assign_expr\";\n assign_expr.left_expr = walk_tree(ast[2]);\n assign_expr.right_expr = walk_tree(ast[3]);\n assign_expr.name = assign_expr.left_expr.name;\n \n return assign_expr;\n },\n \n \"var\" : function() {\n var assign_expr = new assign_expression();\n assign_expr.type = \"assign_expr\";\n \n assign_expr.left_expr = new type_object();\n assign_expr.left_expr.name = ast[1][0][0];\n assign_expr.right_expr = walk_tree(ast[1][0][1]);\n assign_expr.name = assign_expr.left_expr.name;\n \n return assign_expr; \n },\n \n \"stat\" : function() {\n return walk_tree(ast[1]);\n },\n \n \"dot\" : function() {\n var dot_obj = walk_tree(ast[1]);\n dot_obj.child = new type_object();\n dot_obj.child.name = ast[2];\n dot_obj.child.parent = dot_obj;\n return dot_obj;\n },\n \n \"name\" : function() {\n var new_obj = new type_object();\n new_obj.type = \"name\";\n new_obj.name = ast[1];\n return new_obj;\n },\n \n \"new\" : function() {\n var expr = walk_tree(ast[1]);\n expr.type = \"composition\";\n return expr;\n },\n \n \"function\" : function() {\n var func = new type_function(\"function\", ast[1], [\"toplevel\", [ast]], ast[2]);\n return func;\n },\n \n \"defun\" : function() { \n var func = new type_function(\"defun\", ast[1], [\"toplevel\", [ast]], ast[2]);\n return func;\n },\n \n \"return\" : function() {\n var return_expr = new type_expression();\n return_expr.type = \"return_expr\";\n return_expr.expr = walk_tree(ast[1]);\n return return_expr;\n },\n \n \"string\" : function() {\n var obj = new type_object();\n obj.type = \"string\";\n obj.value = ast[1];\n return obj;\n },\n \n \"num\" : function() {\n var obj = new type_object();\n obj.type = \"num\";\n obj.value = ast[1];\n return obj;\n },\n \n \"binary\" : function() {\n var binary_expr = new binary_expression();\n binary_expr.type = \"binary_expr\";\n binary_expr.binary_lhs = walk_tree(ast[2]);\n binary_expr.binary_rhs = walk_tree(ast[3]);\n },\n }\n \n var parent = ast[0];\n \n var func = walker[parent];\n \n return func(ast);\n}", "function finalAbstractionFix(absOrig) {\n var result = {};\n\n for (var abs_key in absOrig) {\n curr_abs_commands = []\n for (var i = 0; i < absOrig[abs_key].length; i++) {\n curr_command = { 'expression': absOrig[abs_key][i]['command'][0], 'type': absOrig[abs_key][i]['command'][1] };\n if (absOrig[abs_key][i]['arguments'] !== undefined && absOrig[abs_key][i]['arguments'] !== null) {\n curr_arguments = { 'expression': absOrig[abs_key][i]['arguments'][0], 'type': absOrig[abs_key][i]['arguments'][1] };\n curr_abs_commands.push({ 'command': curr_command, 'arguments': curr_arguments });\n }\n else {\n curr_abs_commands.push({ 'command': curr_command });\n }\n }\n result[abs_key] = curr_abs_commands;\n }\n return result;\n}", "function doextra(attr, val, i) {\n\t if(Array.isArray(attr)) {\n\t attr.forEach(function(a) { doextra(a, val, i); });\n\t return;\n\t }\n\t // quit if explicitly setting this elsewhere\n\t if(attr in aobj) return;\n\t\n\t var extraparam;\n\t if(attr.substr(0, 6) === 'LAYOUT') {\n\t extraparam = Lib.nestedProperty(gd.layout, attr.replace('LAYOUT', ''));\n\t } else {\n\t extraparam = Lib.nestedProperty(gd.data[traces[i]], attr);\n\t }\n\t\n\t if(!(attr in undoit)) {\n\t undoit[attr] = a0();\n\t }\n\t if(undoit[attr][i] === undefined) {\n\t undoit[attr][i] = extraparam.get();\n\t }\n\t if(val !== undefined) {\n\t extraparam.set(val);\n\t }\n\t }", "function n(a){return!!a&&\"undefined\"!=typeof a.text}", "function doextra(attr, val, i) {\n if(Array.isArray(attr)) {\n attr.forEach(function(a) { doextra(a, val, i); });\n return;\n }\n // quit if explicitly setting this elsewhere\n if(attr in aobj || helpers.hasParent(aobj, attr)) return;\n\n var extraparam;\n if(attr.substr(0, 6) === 'LAYOUT') {\n extraparam = Lib.nestedProperty(gd.layout, attr.replace('LAYOUT', ''));\n } else {\n extraparam = Lib.nestedProperty(data[traces[i]], attr);\n }\n\n if(!(attr in undoit)) {\n undoit[attr] = a0();\n }\n if(undoit[attr][i] === undefined) {\n undoit[attr][i] = undefinedToNull(extraparam.get());\n }\n if(val !== undefined) {\n extraparam.set(val);\n }\n }", "function objElAtr(element, atrObj, parentAtr) {\n Object.keys(atrObj).forEach((atr) => {\n if (typeof atrObj[atr] === 'object') {\n objElAtr(element, atrObj[atr], atr);\n } else if (parentAtr) {\n element[parentAtr][atr] = atrObj[atr];\n } else {\n element[atr] = atrObj[atr];\n }\n });\n }", "disallowLoneExpansion() {\r\n\t\t\t\t\tvar loneObject, objects;\r\n\t\t\t\t\tif (!(this.variable.base instanceof Arr)) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t({objects} = this.variable.base);\r\n\t\t\t\t\tif ((objects != null ? objects.length : void 0) !== 1) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t[loneObject] = objects;\r\n\t\t\t\t\tif (loneObject instanceof Expansion) {\r\n\t\t\t\t\t\treturn loneObject.error('Destructuring assignment has no target');\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "function doextra(attr, val) {\n if(Array.isArray(attr)) {\n attr.forEach(function(a) { doextra(a, val); });\n return;\n }\n\n // if we have another value for this attribute (explicitly or\n // via a parent) do not override with this auto-generated extra\n if(attr in aobj || helpers.hasParent(aobj, attr)) return;\n\n var p = Lib.nestedProperty(layout, attr);\n if(!(attr in undoit)) undoit[attr] = p.get();\n if(val !== undefined) p.set(val);\n }", "function Oa(t,e){for(var n in e)t[n]=e[n];return t}", "function n(t, a) {\n return t[0] = a[0], t[1] = a[1], t[2] = a[2], t[3] = a[3], t[4] = a[4], t[5] = a[5], t[6] = a[6], t[7] = a[7], t[8] = a[8], t[9] = a[9], t[10] = a[10], t[11] = a[11], t[12] = a[12], t[13] = a[13], t[14] = a[14], t[15] = a[15], t;\n }", "function ap(a,b){this.N=[];this.Ga=a;this.K=b||null;this.J=this.B=!1;this.F=void 0;this.ia=this.La=this.S=!1;this.Q=0;this.A=null;this.D=0}", "function uh(){this.b=null;this.a=[]}", "function uh(){this.b=null;this.a=[]}", "function uh(){this.b=null;this.a=[]}", "function uh(){this.b=null;this.a=[]}", "function uh(){this.b=null;this.a=[]}", "function uh(){this.b=null;this.a=[]}", "function T1a(a,b){if(w(a,b))return!0;if(!a||!b||Vp(a)!=Vp(b))return!1;a=a.a.gg();for(var c=0;c<a.length;c++)if(!b.U(a[c]))return!1;return!0}", "function w(){this.a={}}", "function throwCurrAnsToPre(){\n assignCurrtoPre();\n inputStringShowPre = \"Ans = \" + inputStringShowPre;\n}", "undefined(state, n) {\n state.a += n;\n }", "function getNounRelatedToAdj(word) {\n return \"rel_jja=\" + adj;\n}", "function suggest_adverb_phrase(o, rule, results, options){\n var top=results.length;\n for(var i=o+1; i<top; i++){\n if(results[i].pos.parent=='adjective' || results[i].pos.parent=='verb'){\n return results;\n }\n if(results[i].pos.parent=='noun' ){\n results[i].pos=parts_of_speech[\"JJ\"];\n results[i].rule=rule;\n return results;\n }\n if(results[i+1]){\n if(results[i].pos.tag==\"RB\"){\n results[i].pos.parent='adjective';\n results[i].rule=rule;\n }\n }\n else{//last word and still no verb\n if(options.strong){\n results[i].pos=parts_of_speech[\"JJ\"];\n results[i].rule=rule;\n }\n }\n }\n return results;\n }", "function mtTranslateAlias(k, d) { spec[k] = getOwn(d, spec[k], spec[k]); }", "function underlineTypeVars(typeInfo, valuesByPath) {\n // Note: Sorting these keys lexicographically is not \"correct\", but it\n // does the right thing for indexes less than 10.\n var paths = Z.map (JSON.parse, sortedKeys (valuesByPath));\n return underline (\n typeInfo,\n K (K (_)),\n function(index) {\n return function(f) {\n return function(t) {\n return function(propPath) {\n var indexedPropPath = Z.concat ([index], propPath);\n return function(s) {\n if (paths.some (isPrefix (indexedPropPath))) {\n var key = JSON.stringify (indexedPropPath);\n if (!(hasOwnProperty.call (valuesByPath, key))) return s;\n if (!(isEmpty (valuesByPath[key]))) return f (s);\n }\n return _ (s);\n };\n };\n };\n };\n }\n );\n }", "function imprimirNombre(persona) {\r\n var { nombre } = persona;\r\n console.log(nombre.toUpperCase());\r\n}", "function b(a) { od = a }", "function formatAST(node)\n\t\t{\n\t\t\tif(!Array.isArray(node))\n\t\t\t{\n\t\t\t\t// Flatten enum values (object singletons with capital first letter key)\n\t\t\t\tif(node && typeof node === 'object')\n\t\t\t\t{\n\t\t\t\t\tlet keys = Object.keys(node);\n\t\t\t\t\tfor(let key of keys)\n\t\t\t\t\t{\n\t\t\t\t\t\tnode[key] = formatAST(node[key]);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// // TEMP : `Der` case\n\t\t\t\t\t// if(node.rule && node.ctx && node.dir && node.rule)\n\t\t\t\t\t// {\n\t\t\t\t\t// \tlet sub = formatAST(node.rule);\n\t\t\t\t\t// \tnode.rule = sub;\n\t\t\t\t\t// \tsub._type = node;\n\t\t\t\t\t// \treturn sub;\n\t\t\t\t\t// }\n\t\t\t\t\t\n\t\t\t\t\t// let key = keys[0];\n\t\t\t\t\t// if(keys.length === 1 && key.charAt(0) !== key.charAt(0).toLowerCase())\n\t\t\t\t\t// {\n\t\t\t\t\t// \treturn formatAST([key].concat(node[key]));\n\t\t\t\t\t// }\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn node;\n\t\t\t}\n\t\t\telse if(node[0] === 'DebugLabel')\n\t\t\t{\n\t\t\t\tlet sub = formatAST(node[3]);\n\t\t\t\tnode[3] = sub;\n\t\t\t\tsub._debug = node;\n\t\t\t\treturn sub;\n\t\t\t}\n\t\t\telse if(node[0] === 'Der')\n\t\t\t{\n\t\t\t\tlet sub = formatAST(node[1].rule);\n\t\t\t\tnode[1].rule = sub;\n\t\t\t\tsub._type = node[1];\n\t\t\t\treturn sub;\n\t\t\t}\n\t\t\t\n\t\t\tfor(var i = 0; i < node.length; i++)\n\t\t\t{\n\t\t\t\tlet s = formatAST(node[i]);\n\t\t\t\tif(Array.isArray(s))\n\t\t\t\t{\n\t\t\t\t\ts._parent = node;\n\t\t\t\t}\n\t\t\t\tnode[i] = s;\n\t\t\t}\n\t\t\treturn node;\n\t\t}", "function An(t, e) {\n var n;\n return ((null === (n = e.arrayValue) || void 0 === n ? void 0 : n.values) || []).map((function(t) {\n return U.U(t.referenceValue);\n }));\n}", "function main() {\n let a = 1;\n let b = 2;\n let c = -3;\n mystery(a,b,c);\n mystery(c,4,a);\n mystery(a + b, b + c, c + a);\n}", "function level2a() {\n console.log(a);\n }", "function dis(some) {\r\n console.log(some)\r\n }", "function Ag(){this.b=null;this.a=[]}", "function test(param) {\n param.method, param.nested.p;\n}", "function test1() {\n // Single assignments & undefined\n {\n let a1;\n [a1] = [1];\n let [a2] = [1];\n console.log(a1, a2);\n console.log(a1, 1);\n console.log(a2, 1);\n }\n {\n let a1;\n [a1] = [];\n let [a2] = [];\n console.log(a1, a2);\n console.log(a1, undefined);\n console.log(a2, undefined);\n let a3;\n [a3] = [, 1];\n let [a4] = [, 1];\n console.log(a3, a4);\n console.log(a3, undefined);\n console.log(a4, undefined);\n } // Multiple assignments\n\n {\n let a1, b1, c1, d1, e1;\n [a1, b1, c1, d1, e1] = [1, 2, 3, 4, 5];\n let [a2, b2, c2, d2, e2] = [1, 2, 3, 4, 5];\n console.log([a1, b1, c1, d1, e1], [a2, b2, c2, d2, e2]);\n console.log([1, 2, 3, 4, 5], [a1, b1, c1, d1, e1]);\n console.log([1, 2, 3, 4, 5], [a2, b2, c2, d2, e2]);\n }\n {\n let a1, b1, c1, d1, e1;\n [a1, b1, c1, d1, e1] = [1, 2, 3];\n let [a2, b2, c2, d2, e2] = [1, 2, 3];\n console.log([a1, b1, c1, d1, e1], [a2, b2, c2, d2, e2]);\n console.log([1, 2, 3, undefined, undefined], [a1, b1, c1, d1, e1]);\n console.log([1, 2, 3, undefined, undefined], [a2, b2, c2, d2, e2]);\n }\n {\n let a1, b1, c1, d1, e1;\n [a1, b1, c1, d1, e1] = [1,, 3,, 5];\n let [a2, b2, c2, d2, e2] = [1,, 3,, 5];\n console.log([a1, b1, c1, d1, e1], [a2, b2, c2, d2, e2]);\n console.log([1, undefined, 3, undefined, 5], [a1, b1, c1, d1, e1]);\n console.log([1, undefined, 3, undefined, 5], [a2, b2, c2, d2, e2]);\n } // Rest\n\n {\n let rest1;\n [...rest1] = [1, 2, 3, 4, 5];\n let [...rest2] = [1, 2, 3, 4, 5];\n console.log(rest1, rest2);\n console.log([1, 2, 3, 4, 5], rest1);\n console.log([1, 2, 3, 4, 5], rest2);\n }\n {\n let a1, b1, c1, d1, e1;\n [a1, b1, c1, ...rest1] = [1, 2, 3, 4, 5];\n let [a2, b2, c2, ...rest2] = [1, 2, 3, 4, 5];\n console.log([a1, b1, c1, rest1], [a2, b2, c2, rest2]);\n console.log([1, 2, 3, [4, 5]], [a1, b1, c1, rest1]);\n console.log([1, 2, 3, [4, 5]], [a2, b2, c2, rest2]);\n let a3, b3, c3, d3, e3;\n [a3, b3, c3, ...rest3] = [1, 2, 3];\n let [a4, b4, c4, ...rest4] = [1, 2, 3];\n console.log([a3, b3, c3, rest3], [a4, b4, c4, rest4]);\n console.log([1, 2, 3, []], [a3, b3, c3, rest3]);\n console.log([1, 2, 3, []], [a4, b4, c4, rest4]);\n }\n {\n let a1, b1;\n [[...a1], ...b1] = [[1, 2, 3, 4], 5, 6, 7, 8];\n let [[...a2], ...b2] = [[1, 2, 3, 4], 5, 6, 7, 8];\n console.log([a1, b1], [a2, b2]);\n console.log([a1, b1], [[1, 2, 3, 4], [5, 6, 7, 8]]);\n console.log([a2, b2], [[1, 2, 3, 4], [5, 6, 7, 8]]);\n } // Default values\n\n {\n let a1, b1, c1, d1, e1;\n [a1 = 1, b1 = 2, c1 = 3, d1 = 4, e1 = 5] = [];\n let [a2 = 1, b2 = 2, c2 = 3, d2 = 4, e2 = 5] = [];\n console.log([a1, b1, c1, d1, e1], [a2, b2, c2, d2, e2]);\n console.log([1, 2, 3, 4, 5], [a1, b1, c1, d1, e1]);\n console.log([1, 2, 3, 4, 5], [a2, b2, c2, d2, e2]);\n }\n {\n let a1, b1, c1, d1, e1;\n [a1 = 1, b1 = 2, c1 = 3, d1 = 4, e1 = 5] = [5,, 3, 2];\n let [a2 = 1, b2 = 2, c2 = 3, d2 = 4, e2 = 5] = [5,, 3, 2];\n console.log([a1, b1, c1, d1, e1], [a2, b2, c2, d2, e2]);\n console.log([5, 2, 3, 2, 5], [a1, b1, c1, d1, e1]);\n console.log([5, 2, 3, 2, 5], [a2, b2, c2, d2, e2]);\n } // Identifier references\n\n {\n let a = {};\n [a.x] = [10];\n console.log(10, a.x);\n [a[\"x\"]] = [20];\n console.log(20, a[\"x\"]);\n var obj = {\n x: 10\n };\n\n function foo() {\n return obj;\n }\n\n ;\n [foo().x] = [20];\n console.log(20, foo().x);\n [foo()[\"x\"]] = [30];\n console.log(30, foo()[\"x\"]);\n [...foo().x] = [20];\n console.log([20], foo().x);\n [...foo()[\"x\"]] = [30];\n console.log([30], foo()[\"x\"]);\n\n class base {\n methodProp() {\n return {};\n }\n\n methodIndex() {\n return {};\n }\n\n methodRestProp() {\n return {};\n }\n\n methodRestIndex() {\n return {};\n }\n\n get x() {\n return this._x;\n }\n\n set x(v) {\n this._x = v;\n }\n\n }\n\n ;\n\n class extended extends base {\n methodProp() {\n return [super.x] = [10, 20, 30];\n }\n\n methodIndex() {\n return [super[\"x\"]] = [40, 50, 60];\n }\n\n methodRestProp() {\n return [...super.x] = [10, 20, 30];\n }\n\n methodRestIndex() {\n return [...super.x] = [40, 50, 60];\n }\n\n getValue() {\n return super.x;\n }\n\n }\n\n ;\n let c = new extended();\n console.log(undefined, c.getValue());\n c.methodProp();\n console.log(10, c.getValue());\n c.methodIndex();\n console.log(40, c.getValue());\n c.methodRestProp();\n console.log([10, 20, 30], c.getValue());\n c.methodRestIndex();\n console.log([40, 50, 60], c.getValue());\n } // Nesting\n\n {\n let a1;\n [[a1]] = [[1]];\n let [[a2]] = [[1]];\n console.log(a1, a2);\n console.log(a1, 1);\n console.log(a2, 1);\n }\n {\n let a1, b1, c1, d1, e1;\n [[a1, b1], c1, [d1, [e1]]] = [[1, 2], 3, [4, [5]]];\n let [[a2, b2], c2, [d2, [e2]]] = [[1, 2], 3, [4, [5]]];\n console.log([a1, b1, c1, d1, e1], [a2, b2, c2, d2, e2]);\n console.log([1, 2, 3, 4, 5], [a1, b1, c1, d1, e1]);\n console.log([1, 2, 3, 4, 5], [a2, b2, c2, d2, e2]);\n }\n {\n let a1;\n [[a1, b1] = [1, 2]] = [];\n let [[a2, b2] = [1, 2]] = [];\n console.log([a1, b1], [a2, b2]);\n console.log([1, 2], [a1, b1]);\n console.log([1, 2], [a2, b2]);\n }\n {\n let a1;\n [[[a1] = [1], [[b1]] = [[2]]] = [, undefined]] = [undefined];\n let [[[a2] = [1], [[b2]] = [[2]]] = [, undefined]] = [undefined];\n console.log([a1, b1], [a2, b2]);\n console.log([1, 2], [a1, b1]);\n console.log([1, 2], [a2, b2]);\n } // Other iterators\n\n {\n let a1;\n [a1, b1, c1, d1, ...rest1] = \"testing\";\n let [a2, b2, c2, d2, ...rest2] = \"testing\";\n console.log([a1, b1, c1, d1, rest1], [a2, b2, c2, d2, rest2]);\n console.log([\"t\", \"e\", \"s\", \"t\", [\"i\", \"n\", \"g\"]], [a1, b1, c1, d1, rest1]);\n console.log([\"t\", \"e\", \"s\", \"t\", [\"i\", \"n\", \"g\"]], [a2, b2, c2, d2, rest2]);\n }\n {\n let map = new Map();\n map.set(1, 6);\n map.set(2, 7);\n map.set(3, 8);\n map.set(4, 9);\n map.set(5, 10);\n let a1;\n [a1, b1, c1, d1, ...rest1] = map.entries();\n let [a2, b2, c2, d2, ...rest2] = map.entries();\n console.log([a1, b1, c1, d1, rest1], [a2, b2, c2, d2, rest2]);\n console.log([[1, 6], [2, 7], [3, 8], [4, 9], [[5, 10]]], [a1, b1, c1, d1, rest1]);\n console.log([[1, 6], [2, 7], [3, 8], [4, 9], [[5, 10]]], [a2, b2, c2, d2, rest2]);\n }\n {\n let getIteratorCalledCount = 0;\n let nextCalledCount = 0;\n let doneCalledCount = 0;\n let valueCalledCount = 0;\n let simpleIterator = {\n [Symbol.iterator]: function () {\n ++getIteratorCalledCount;\n return {\n i: 0,\n next: function () {\n ++nextCalledCount;\n var that = this;\n return {\n get done() {\n ++doneCalledCount;\n return that.i == 1;\n },\n\n get value() {\n ++valueCalledCount;\n return that.i++;\n }\n\n };\n }\n };\n }\n };\n let [a, b, c] = simpleIterator;\n console.log(1, getIteratorCalledCount);\n console.log(3, nextCalledCount);\n console.log(3, doneCalledCount);\n console.log(1, valueCalledCount);\n [getIteratorCalledCount, nextCalledCount, doneCalledCount, valueCalledCount] = [0, 0, 0, 0];\n let [...rest] = simpleIterator;\n console.log(1, getIteratorCalledCount);\n console.log(2, nextCalledCount);\n console.log(2, doneCalledCount);\n console.log(1, valueCalledCount);\n [getIteratorCalledCount, nextCalledCount, doneCalledCount, valueCalledCount] = [0, 0, 0, 0];\n [a, b, c, ...rest] = simpleIterator;\n console.log(1, getIteratorCalledCount);\n console.log(4, nextCalledCount);\n console.log(4, doneCalledCount);\n console.log(1, valueCalledCount);\n } // Array destructuring in various contexts\n\n {\n let a, b, c;\n\n function foo(x = [a, b = 2, ...c] = [1,, 3, 4, 5, 6, 7]) {\n console.log([1, 2, [3, 4, 5, 6, 7]], [a, b, c]);\n console.log([1,, 3, 4, 5, 6, 7], x);\n }\n\n foo();\n `${[a = 5, b, ...c] = [, 1, 3, 5, 7, 9]}`;\n console.log([5, 1, [3, 5, 7, 9]], [a, b, c]);\n\n (() => [a,, b, c] = [1, 2, 3])();\n\n console.log([1, 3, undefined], [a, b, c]);\n } // nested destructuring\n\n {\n let [[a] = [1]] = [[2]];\n console.log(a, 2);\n [[a] = [1]] = [[]];\n console.log(a, undefined);\n [[a] = [1]] = [];\n console.log(a, 1);\n [[a] = 1] = [[]];\n console.log(a, undefined);\n } // Bug OSG : 4533495\n\n {\n function foo() {\n for (var [i, j, k] in {\n qux: 1\n }) {\n return i === \"q\" && j === \"u\" && k === \"x\";\n }\n }\n\n console.log(foo());\n }\n {\n let obj1 = {};\n\n obj1[Symbol.iterator] = function () {\n return {\n next: function () {\n ;\n }\n };\n }; // Empty slot should not call next on the iterator.\n\n\n var [] = obj1;\n }\n {\n let obj1 = {};\n\n obj1[Symbol.iterator] = function () {\n return {\n next: function () {\n this.counter++;\n\n if (this.counter > 1) {\n ;\n }\n\n return {\n value: undefined,\n done: false\n };\n },\n counter: 0\n };\n }; // Second empty slot should not call next on the iterator.\n\n\n var [,] = obj1;\n }\n}", "set normal(value) {}", "set normal(value) {}", "function printAST(a)\n{\n\n\n\t//\t<outer> ::= (OUTERTEXT |<templateinvocation>|<templatedef>)*\n\n\t// case for \"OUTER object\"\n\tif(a.name == \"outer\") // We go in the inverse way by checking all the fields of an \"outer\" object\n\t{\n\t\tif(a.OUTERTEXT) //Check if it has an outertext VALUE\n\t\t{\n\t\t\tif(a.templateinvocation) // then a tepmlete invoaction \n\t\t\t{\n\t\t\t\tif(a.next) // next is the recursive part if it is also present , format print outer Text then in TSTART and TEND\n\t\t\t\t{ \n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\treturn a.OUTERTEXT + \"{{\" + printAST(a.templateinvocation) + \"}}\" + printAST(a.next) // we make recursive call to printAST to go back\n\t\t\t\t}\n\t\t\telse // if no next value : \n\t\t\t\treturn a.OUTERTEXT + \"{{\" + printAST(a.templateinvocation) + \"}}\"\n\t\t\t}\n\n\t\t if(a.templatedef) // now if template definition has a vlaue \n\t\t\t{\n\t\t\t\tif(a.next)\n {\n return a.OUTERTEXT + \"{:\" + printAST(a.templatedef) + \":}\" + printAST(a.next)\n }\n else // if no next value\n return a.OUTERTEXT +\"{:\" + printAST(a.templatedef) + \":}\"\n\t\t\t}\n\n\t\t if(a.next) // if only a a.next in an object having an outer text value \n\t\t\t{\n\t\t\t\treturn a.OUTERTEXT + printAST(a.next)\n\t\t\t}\n\t\t\telse\n\t\t\t return a.OUTERTEXT // ultimate case, only return OUTERTEXT\n\t\t} // End of if outertext has a value \n\n\t\t// --------------\n\n\t\telse if(a.templateinvocation){ // NOW CASE when the outer has null in a.OUTERTEXT and has a value in template invocaiton\n\n\t\t\tif(a.next) // check if there is a next value\n \t\treturn \"{{\" + printAST(a.templateinvocation) + \"}}\" + printAST(a.next) \n \t\telse \n \t\t\treturn \"{{\" + printAST(a.templateinvocation) + \"}}\"\n\t\t}\n\n\t if(a.templatedef) //NOW CASE when the outer has null in a.OUTERTEXT and has a value in Template definition\n {\n if(a.next)\n return \"{:\" + printAST(a.templatedef) + \":}\" + printAST(a.next)\n else \n \treturn \"{:\" + printAST(a.templatedef) + \":}\"\n }\n\n\tif(a.next) // LAST CASW WHERE all the object fields are empty except a.next \n \treturn printAST(a.next) // go to a.next \n\t\telse\n\t\t return \"\" // if there is no a.next it's an empty object so return empty string\n\t} // \n\n\n\t/* \n\n\t\t\tobject grammar type : template invocation \n\t\t\t<templateinvocation> ::= TSTART <itext> <targs> TEND\n\t\t\t--> We follow the logic used in the previous example to go over each object fields\n\n\t*/\n\nif(a.name == \"templateinvocation\") // if the object field is template invocation\n\t{\n\t\t\n\t\t// IF THE OBJECT has an ITEXT value\n\t\tif(a.itext)\n\t\t{\n\t\t\tif(a.targs) // if it also has a targs value\n\t\t\t return printAST(a.itext) + printAST(a.targs) // print both of just print ITEXT\n\n\t\t\telse \n\t\t\t return printAST(a.itext) // else just return to print AST\n\t\t}\n\t\telse \n\t\t\treturn \"\" // else this is an empty object \n\t}\n\n\n\n\t/* FOR OBJECT name Itex----------------------------\n\t<itext> ::= (INNERTEXT |<templateinvocation>|<templatedef>|<tparam>)*\n\n\t*/\n\n\n\n\t if(a.name == \"itext\") // check if theo oject has an Itext value\n\t{\n\t\tif(a.innerText) // check if itext has an INNERTEXT value\n\t\t{\n\t\t\tif(a.templateinvocation) // AND template invocation vlaue\n\t\t\t{\n\t\t\t\tif(a.next) // AND next \n\t\t\t\t\treturn a.innerText + \"{{\" + printAST(a.templateinvocation) + \"}}\" + printAST(a.next) \n\t\t\t\telse \n\t\t\t\t\treturn a.innerText+ \"{{\" + printAST(a.templateinvocation) + \"}}\" \n\t\t\t}\n\n\n\t\tif(a.templatedef) // if has template definition value \n\t\t\t{\n\t\t\t\tif(a.next) // ANd a next field\n {\n return a.innerText + \"{:\" + printAST(a.templatedef) + \":}\" + printAST(a.next) \n }\n else \n \treturn a.innerText +\"{:\" + printAST(a.templatedef)\n\t\t\t}\n\n\n\t\tif(a.tparam) // If tparam has a value \n\t\t\t{\n\t\t\t\tif(a.next) // AND next value\n {\n return a.innerText + \"{{{\" + printAST(a.tparam) + \"}}}\" + printAST(a.next) \n }\n else // else juste return tparam value and go back to print AST\n return a.innerText +\"{{{\" + printAST(a.tparam) + \"}}}\"\n\t\t\t}\n\n\t\tif(a.next) // if a next has a relue simply return to printAST with it's value\n\t\t\t{\n\t\t\t\treturn a.innerText + printAST(a.next) \n\t\t\t}\t\t\t\n\t\t\telse // else just return \n\t\t\t\treturn a.innerText\n\t\t}\n\n\n\t\tif(a.templateinvocation) // now it just a template invocation \n {\n if(a.next) // AND a.next ?\n return \"{{\" + printAST(a.templateinvocation) + \"}}\" + printAST(a.next)\n else // just return to parstAT \n \treturn \"{{\" + printAST(a.templateinvocation) + \"}}\"\n }\n\n if(a.templatedef) // if template def\n {\n if(a.next)\n return \"{:\" + printAST(a.templatedef) + \":}\" + printAST(a.next)\n else return \"{:\" + printAST(a.templatedef) + \":}\"\n }\n\n\tif(a.tparam) // if tparam has a vaue\n\t\t{\n\t\t\tif(a.next)\n return \"{{{\" + printAST(a.tparam) + \"}}}\" + printAST(a.next)\n else \n return \"{{{\" + printAST(a.tparam) + \"}}}\"\n\t\t}\n\n else return \"\"\n\t} //----- END onf ITEXT---- \n\n\n\t/*\n\t\tObject type of grammar used : TEMPLATE DEF\n\t\t<templatedef> ::= DSTART <dtext> (PIPE <dtext>)+ DEND\n\t*/\n\n if(a.name == \"templatedef\") // for template definition we gotta chekc for dtext value and pipe values\n\t{\n\n\t\t\n\t\tif(a.dtext) // if the object has a dtext value\n\t\t{\n\t\t\tif(a.dargs) // AND if it has a dargs value as well\n\t\t\t\treturn printAST(a.dtext) + printAST(a.dargs) \n\t\t\telse // Else just return dtext\n\t\t\t\treturn printAST(a.dtext)\n\t\t}\n\t\telse return \"\" // just return empty string\n\t}\n\t\n/*\n\nObject of type DTEXT \n\n============> This is basically the same thing as Itext but with Dtext and InnerDtext\n\ndtext> ::= (INNERDTEXT |<templateinvocation>|<templatedef>|<tparam>)*\n\n*/\n\n\nif(a.name == \"dtext\") \n\t{\n\n\n\t\tif(a.innerDtext)\n {\n if(a.templateinvocation)\n {\n if(a.next)\n return a.innerDtext + \"{{\" + printAST(a.templateinvocation) + \"}}\" + printAST(a.next)\n else\n return a.innerDtext+ \"{{\" + printAST(a.templateinvocation) + \"}}\"\n }\n\n if(a.templatedef)\n {\n if(a.next)\n {\n return a.innerDtext + \"{:\" + printAST(a.templatedef) + \":}\" + printAST(a.next)\n }\n else\n return a.innerDtext+\"{:\" + printAST(a.templatedef) + \":}\"\n }\n\n if(a.tparam)\n {\n if(a.next)\n {\n return a.innerDtext + \"{{{\" + printAST(a.tparam) + \"}}}\" + printAST(a.next)\n }\n else \n return a.innerDtext +\"{{{\" + printAST(a.tparam) + \"}}}\"\n }\n\n\t\t\t \tif(a.next) \n\t\t\t \t\treturn a.innerDtext + printAST(a.next)\n else \n \treturn a.innerDtext\n\n }\n\n\n\n if(a.templateinvocation)\n {\n \t\tif(a.next)\n return \"{{\" + printAST(a.templateinvocation) + \"}}\" + printAST(a.next)\n else \n \treturn \"{{\" + printAST(a.templateinvocation) + \"}}\"\n }\n if(a.templatedef)\n {\n if(a.next)\n \treturn \"{:\" + printAST(a.templatedef) + \":}\" + printAST(a.next)\n else \n \treturn \"{:\" + printAST(a.templatedef) + \":}\"\n }\n if(a.tparam)\n {\n if(a.next)\n return \"{{{\" + printAST(a.tparam) + \"}}}\" + printAST(a.next)\n else \n \t\treturn \"{{{\" + printAST(a.tparam) + \"}}}\"\n }\n else return \"\" // just return empty string \n\n\t}\n\n\n/*\n \t\tParse AST for targs objects \n \t\t<targs> ::= (PIPE <itext>)*\n*/\n\n\nif(a.name == \"targs\") // check if the name is targs\n\t{\n\t\tif(a.itext) // if it has an Itext value\n\t\t{\n\t\t\tif(a.next) // AND A NEXT so return both\n\t\t\t\treturn \"|\" + printAST(a.itext) + printAST(a.next)\n\t\t\telse // or else return only the pipe\n\t\t\t\treturn \"|\" + printAST(a.itext)\n\t\t}\n\t}\n\n\n/*\n Check if the object type is pipeDtext : \n This is a non terminale element that I defined to simplify the work in template def for \" (PIPE <dtext>)+\"\n\tI asked the prof he said it's allowed\n\n\tPARSEPIPEDTEXT(s)\n\n*/\n\nif(a.name == \"pipeDtext\") // check the name of the element\n {\n if(a.dtext) // check if dtext has a value \n {\n if(a.next) //AND next \n return \"|\" + printAST(a.dtext) + printAST(a.next)\n else // If not return the pipe and recursively call print AST9 a.ditext)\n \treturn \"|\" + printAST(a.dtext)\n }\n }\n\n\n/*\n\t\tObject of kind of \"tparam\"\n*/\n\n if(a.name == \"tparam\") // check the name toaram\n\t{\n\t\treturn \"{{{\" + a.name + \"}}}\" // directly return the value of pname\n\t}\n\n}", "function doextra(attr, val, i) {\n if(Array.isArray(attr)) {\n attr.forEach(function(a) { doextra(a, val, i); });\n return;\n }\n // quit if explicitly setting this elsewhere\n if(attr in aobj || helpers.hasParent(aobj, attr)) return;\n\n var extraparam;\n if(attr.substr(0, 6) === 'LAYOUT') {\n extraparam = Lib.nestedProperty(gd.layout, attr.replace('LAYOUT', ''));\n } else {\n extraparam = Lib.nestedProperty(data[traces[i]], attr);\n }\n\n if(!(attr in undoit)) {\n undoit[attr] = a0();\n }\n if(undoit[attr][i] === undefined) {\n undoit[attr][i] = extraparam.get();\n }\n if(val !== undefined) {\n extraparam.set(val);\n }\n }", "visitLiteralArrayExpr(ast, ctx) {\n if (ast.entries.length === 0) {\n ctx.print(ast, '(');\n }\n const result = super.visitLiteralArrayExpr(ast, ctx);\n if (ast.entries.length === 0) {\n ctx.print(ast, ' as any[])');\n }\n return result;\n }", "visitLiteralArrayExpr(ast, ctx) {\n if (ast.entries.length === 0) {\n ctx.print(ast, '(');\n }\n const result = super.visitLiteralArrayExpr(ast, ctx);\n if (ast.entries.length === 0) {\n ctx.print(ast, ' as any[])');\n }\n return result;\n }", "visitLiteralArrayExpr(ast, ctx) {\n if (ast.entries.length === 0) {\n ctx.print(ast, '(');\n }\n const result = super.visitLiteralArrayExpr(ast, ctx);\n if (ast.entries.length === 0) {\n ctx.print(ast, ' as any[])');\n }\n return result;\n }", "visitLiteralArrayExpr(ast, ctx) {\n if (ast.entries.length === 0) {\n ctx.print(ast, '(');\n }\n const result = super.visitLiteralArrayExpr(ast, ctx);\n if (ast.entries.length === 0) {\n ctx.print(ast, ' as any[])');\n }\n return result;\n }", "function an(){}", "function doextra(attr, val) {\n if (Array.isArray(attr)) {\n attr.forEach(function (a) {\n doextra(a, val);\n });\n return;\n }\n\n // if we have another value for this attribute (explicitly or\n // via a parent) do not override with this auto-generated extra\n if (attr in aobj || helpers.hasParent(aobj, attr)) return;\n var p = layoutNP(layout, attr);\n if (!(attr in undoit)) {\n undoit[attr] = undefinedToNull(p.get());\n }\n if (val !== undefined) p.set(val);\n }", "function assignArticle(invar){\n\n if(invar != undefined && invar != \"undefined\"){\n let ch = invar.charAt(0);\n if(ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' || ch == 'y'){\n let outvar = \"an \" + invar;\n return outvar;\n } else {\n let outvar = \"a \" + invar;\n return outvar;\n }\n } else {\n console.log(\"OOPS can't assign article to undefined input\");\n let outvar = \"a \" + invar; //TODO fix this becuase this will (rarely) cause grammatical error\n return outvar;\n }\n}", "function vt(t) {\n return !!t && \"referenceValue\" in t;\n}", "function reverseAssignment() {\n utilitymanager_1.um.utilityManager({\n utilType: utilitymanager_1.um.TIXUtilityType.utInTransform,\n sp: utilitymanager_1.um.TIXSelPolicy.Sentence,\n pat: /(\\${0,1})\\b(.+)(\\s+)([=<>]=*|[!:]=+)(\\s+)([^;]+)/,\n repl: \"$6$3$4$5$1$2\",\n });\n }", "function Ar(t) {\n for (var e = \"\", n = 0; n < t.length; n++) e.length > 0 && (e = Sr(e)), e = Dr(t.get(n), e);\n return Sr(e);\n}", "function l(){t={},u=\"\",w=\"\"}", "function qwe(){\n // \"this\" is different here too! --- but we don't care!\n console.log(abc); // it is the right object here too!\n }", "function andTheMysteryIs(mystery) {\n //for (var i = 0, i < mystery.length; i += 1){ }\n console.log(mystery[0].name + \" killed with a(n) \" + mystery[1].name + \" in the \" + mystery[2].name + \".\");\n}", "function n(a){return a.type=(null!==a.getAttribute(\"type\"))+\"/\"+a.type,a}", "function ReceptionCurrentValueOf(This, ReceptionA) {\n act[This] = act[A] || preact[This];\n if (act[A] === true) {\n val[This] = val[A];} else \n {\n val[This] = preval[This];}\n\n return true;}", "function Wo(t,n){for(var r in n)t[r]=n[r];return t}", "function i(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}", "function a(t,e,a,u,c,l){r=r||n(5);const f=(u?u+\".\":\"\")+t;u=u||\"\",e?Object.defineProperty(a,t,{enumerable:!0,configurable:!0,get:function(){const t=this;if(this.$__.getters||(this.$__.getters={}),!this.$__.getters[f]){const n=Object.create(r.prototype,function(t){const e={};return Object.getOwnPropertyNames(t).forEach(function(n){e[n]=Object.getOwnPropertyDescriptor(t,n),e[n].get?delete e[n]:e[n].enumerable=-1===[\"isNew\",\"$__\",\"errors\",\"_doc\"].indexOf(n)}),e}(this));u||(n.$__.scope=this),n.$__.nestedPath=f,Object.defineProperty(n,\"schema\",{enumerable:!1,configurable:!0,writable:!1,value:a.schema}),Object.defineProperty(n,\"toObject\",{enumerable:!1,configurable:!0,writable:!1,value:function(){return o.clone(t.get(f,null,{virtuals:i(this,\"schema.options.toObject.virtuals\",null)}))}}),Object.defineProperty(n,\"toJSON\",{enumerable:!1,configurable:!0,writable:!1,value:function(){return t.get(f,null,{virtuals:i(t,\"schema.options.toJSON.virtuals\",null)})}}),Object.defineProperty(n,\"$__isNested\",{enumerable:!1,configurable:!0,writable:!1,value:!0}),s(e,n,f,l),this.$__.getters[f]=n}return this.$__.getters[f]},set:function(t){return t instanceof r&&(t=t.toObject({transform:!1})),(this.$__.scope||this).$set(f,t)}}):Object.defineProperty(a,t,{enumerable:!0,configurable:!0,get:function(){return this.get.call(this.$__.scope||this,f)},set:function(t){return this.$set.call(this.$__.scope||this,f,t)}})}", "function i(t){return void 0===t&&(t=null),Object(r[\"k\"])(null!==t?t:o)}", "function o(e){return void 0===e&&(e=null),Object(r[\"r\"])(null!==e?e:a)}", "attr(prop, args) {\r\n\t\tres = args.find(v => v.lhs == prop);\r\n\r\n\t\treturn res && res.rhs.join(' ');\r\n\t}", "function doSomething(p) { //p รับค่าจาก per2\n //p=per2 (memory address of per2 to p)\n p.name = 'Mary'; //pers2.name='Mary'\n\n}" ]
[ "0.552228", "0.5452805", "0.5270812", "0.5246687", "0.52386415", "0.5216386", "0.5136943", "0.50710064", "0.50216526", "0.50078857", "0.49928764", "0.4989059", "0.4935105", "0.4809827", "0.47849518", "0.47778845", "0.4770162", "0.4735433", "0.4712699", "0.4676829", "0.46527004", "0.46445504", "0.4615789", "0.4614315", "0.46070665", "0.46040386", "0.45986488", "0.45985976", "0.4596946", "0.45959237", "0.45938113", "0.4585562", "0.4574642", "0.4567789", "0.45632154", "0.45544234", "0.454802", "0.4547402", "0.45473582", "0.45417294", "0.45370117", "0.4516838", "0.45145097", "0.45129463", "0.45077437", "0.45034572", "0.45031005", "0.4499175", "0.4483571", "0.44778782", "0.4475832", "0.44641793", "0.44641793", "0.44641793", "0.44641793", "0.44641793", "0.44641793", "0.44634145", "0.44606432", "0.4453568", "0.44475016", "0.44458666", "0.4445287", "0.444039", "0.4427221", "0.44261575", "0.44224268", "0.44210395", "0.4418532", "0.44020674", "0.44006425", "0.43992785", "0.4398909", "0.4392607", "0.4389779", "0.4382796", "0.4382796", "0.43801245", "0.437818", "0.43725303", "0.43725303", "0.43725303", "0.43725303", "0.43661344", "0.4365974", "0.43627644", "0.4358841", "0.4357868", "0.43511266", "0.43479994", "0.43474633", "0.43470386", "0.4346938", "0.43464038", "0.43457922", "0.434266", "0.4341646", "0.43389767", "0.43352884", "0.43349436", "0.43344447" ]
0.0
-1
myAns: undefined, undefined, undefined trAns: undefined, 10, 10 explain: b,c assign at global? immutable and reference?
function getCoords() { return { x: 10, y: 22 }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function exaqmple5() {\n var b = 1;\n // b = 10 // * Error:e b is read-only\n}", "function a(t, a) {\n return t[0] = a[0], t[1] = a[1], t[2] = a[2], t[3] = a[4], t[4] = a[5], t[5] = a[6], t[6] = a[8], t[7] = a[9], t[8] = a[10], t;\n }", "function a(t, a) {\n return t[0] = a[0], t[1] = a[1], t[2] = a[2], t[3] = a[3], t[4] = a[4], t[5] = a[5], t;\n }", "function a(t, n) {\n return t[0] = n[0], t[1] = n[1], t;\n }", "function example6() {\n var o = { a: 1 };\n o.a = 2; //allowed: change ref object\n o.b = 1; //allowed: change ref object\n\n // o = {a: 1} //not allowed: change referece itself\n}", "function w(){this.a={}}", "function uh(){this.b=null;this.a=[]}", "function uh(){this.b=null;this.a=[]}", "function uh(){this.b=null;this.a=[]}", "function uh(){this.b=null;this.a=[]}", "function uh(){this.b=null;this.a=[]}", "function uh(){this.b=null;this.a=[]}", "function b(a) { od = a }", "function foo() {\n var a = b = 0;\n}", "function foo() {\n var a = b = 0;\n}", "a (a a = 0; a < a.a; ++a) {N\n a a = a[a];N\n a (a.a != a) a.a += a;N\n a (a.a == a) {N\n a a = aAaAaAa(a, a.a);N\n a (!a) {N\n a.a = a;N\n a (aAa) (a || (a = [])).a(a);N\n }N\n } a {N\n a.a += a;N\n a (aAa) (a || (a = [])).a(a);N\n }N\n }", "a(a.a, \"a\", a() { a.a.aAa = a.a.aAa = 0; });N\nN\n a.aAa = {N\n a: a(a) {a (!aAa(a, a)) a_a(a);},N\n a: a(a) {a (!aAa(a, a)) { aAaAa(a, a); a_a(a); }},N\n a: a(a){aAaAa(a, a);},N\n a: a(a, aAa),N\n a: a(a) {a (!aAa(a, a)) { aAaAa(a); }}N\n };N\nN\n a a = a.a.aAa();N\n a(a, \"a\", a(a) { aAaAa.a(a, a); });N\n a(a, \"a\", a(a, aAaAa));N\n a(a, \"a\", a(a, aAaAa));N\n a(a, \"a\", a(aAa, a));N\n a(a, \"a\", a(aAa, a));N\n }N\nN\n a aAaAa(a, a, a) {N\n a aAa = a && a != AaAa.Aa;N\n a (!a != !aAa) {N\n a a = a.a.aAa;N\n a a = a ? a : a;N\n a(a.a.a, \"a\", a.a);N\n a(a.a.a, \"a\", a.a);N\n a(a.a.a, \"a\", a.a);N\n a(a.a.a, \"a\", a.a);N\n a(a.a.a, \"a\", a.a);N\n }N\n }N\nN\n // Aa a a a aN\n a aAa(a) {N\n a a = a.a;N\n a (a.aAaAa == a.a.aAa && a.aAaAa == a.a.aAa)N\n a;N\n // Aa a a a a a, a a a.N\n a.aAaAa = a.aAaAa = a.aAaA = a;N\n a.aAa = a;N\n a.aAa();N\n }N\nN\n // A AN\nN\n // Aa a a a a a a a a a aN\n a aAaAa(a, a) {N\n a (a a = a_a(a); a != a.a; a = a.aAa) {N\n a (!a || (a.aAa == 0 && a.aAa(\"a-a-a\") == \"a\") ||N\n (a.aAa == a.a && a != a.a))N\n a a;N\n }N\n }N\nN\n // Aa a a a, a a a a. Aa aN\n // a a, a a a a a a a a a,N\n // a a a a a a. aAa a a a aN\n // a, a a a a a a a a aN\n // a a a a a a a.N\n a aAaAa(a, a, a, aAa) {N\n a a = a.a;N\n a (!a && a_a(a).aAa(\"a-a-a\") == \"a\") a a;N\nN\n a a, a, a = a.aAa.aAaAaAa();N\n // Aa a a A[0] a a a a a a.N\n a { a = a.aA - a.a; a = a.aA - a.a; }N\n a (a) { a a; }N\n a a = aAa(a, a, a), a;N\n a (aAa && a.aAa == 0 && (a = aAa(a.a, a.a).a).a == a.a) {N\n a aAa = aAa(a, a.a, a.a.aAa) - a.a;N\n a = Aa(a.a, Aa.a(0, Aa.a((a - aA(a.a).a) / aAa(a.a)) - aAa));N\n }", "function bar() {\n b = a;\n}", "function fun () {\n let a = b = 0;\n console.log(a);\n}", "function main() {\n let a = 1;\n let b = 2;\n let c = -3;\n mystery(a,b,c);\n mystery(c,4,a);\n mystery(a + b, b + c, c + a);\n}", "function b(a){le=a}", "function b(a){le=a}", "function b(a){le=a}", "function b(a){le=a}", "function b(a){od=a}", "function b(a){od=a}", "function b(a){od=a}", "function b(a){od=a}", "function b(a){od=a}", "function b(a){od=a}", "function b(a){od=a}", "function b(a){od=a}", "function b(a){od=a}", "function b(a){od=a}", "function b(a){od=a}", "function b(a){od=a}", "function M(){this.a={}}", "function test1() {\n // Single assignments & undefined\n {\n let a1;\n [a1] = [1];\n let [a2] = [1];\n console.log(a1, a2);\n console.log(a1, 1);\n console.log(a2, 1);\n }\n {\n let a1;\n [a1] = [];\n let [a2] = [];\n console.log(a1, a2);\n console.log(a1, undefined);\n console.log(a2, undefined);\n let a3;\n [a3] = [, 1];\n let [a4] = [, 1];\n console.log(a3, a4);\n console.log(a3, undefined);\n console.log(a4, undefined);\n } // Multiple assignments\n\n {\n let a1, b1, c1, d1, e1;\n [a1, b1, c1, d1, e1] = [1, 2, 3, 4, 5];\n let [a2, b2, c2, d2, e2] = [1, 2, 3, 4, 5];\n console.log([a1, b1, c1, d1, e1], [a2, b2, c2, d2, e2]);\n console.log([1, 2, 3, 4, 5], [a1, b1, c1, d1, e1]);\n console.log([1, 2, 3, 4, 5], [a2, b2, c2, d2, e2]);\n }\n {\n let a1, b1, c1, d1, e1;\n [a1, b1, c1, d1, e1] = [1, 2, 3];\n let [a2, b2, c2, d2, e2] = [1, 2, 3];\n console.log([a1, b1, c1, d1, e1], [a2, b2, c2, d2, e2]);\n console.log([1, 2, 3, undefined, undefined], [a1, b1, c1, d1, e1]);\n console.log([1, 2, 3, undefined, undefined], [a2, b2, c2, d2, e2]);\n }\n {\n let a1, b1, c1, d1, e1;\n [a1, b1, c1, d1, e1] = [1,, 3,, 5];\n let [a2, b2, c2, d2, e2] = [1,, 3,, 5];\n console.log([a1, b1, c1, d1, e1], [a2, b2, c2, d2, e2]);\n console.log([1, undefined, 3, undefined, 5], [a1, b1, c1, d1, e1]);\n console.log([1, undefined, 3, undefined, 5], [a2, b2, c2, d2, e2]);\n } // Rest\n\n {\n let rest1;\n [...rest1] = [1, 2, 3, 4, 5];\n let [...rest2] = [1, 2, 3, 4, 5];\n console.log(rest1, rest2);\n console.log([1, 2, 3, 4, 5], rest1);\n console.log([1, 2, 3, 4, 5], rest2);\n }\n {\n let a1, b1, c1, d1, e1;\n [a1, b1, c1, ...rest1] = [1, 2, 3, 4, 5];\n let [a2, b2, c2, ...rest2] = [1, 2, 3, 4, 5];\n console.log([a1, b1, c1, rest1], [a2, b2, c2, rest2]);\n console.log([1, 2, 3, [4, 5]], [a1, b1, c1, rest1]);\n console.log([1, 2, 3, [4, 5]], [a2, b2, c2, rest2]);\n let a3, b3, c3, d3, e3;\n [a3, b3, c3, ...rest3] = [1, 2, 3];\n let [a4, b4, c4, ...rest4] = [1, 2, 3];\n console.log([a3, b3, c3, rest3], [a4, b4, c4, rest4]);\n console.log([1, 2, 3, []], [a3, b3, c3, rest3]);\n console.log([1, 2, 3, []], [a4, b4, c4, rest4]);\n }\n {\n let a1, b1;\n [[...a1], ...b1] = [[1, 2, 3, 4], 5, 6, 7, 8];\n let [[...a2], ...b2] = [[1, 2, 3, 4], 5, 6, 7, 8];\n console.log([a1, b1], [a2, b2]);\n console.log([a1, b1], [[1, 2, 3, 4], [5, 6, 7, 8]]);\n console.log([a2, b2], [[1, 2, 3, 4], [5, 6, 7, 8]]);\n } // Default values\n\n {\n let a1, b1, c1, d1, e1;\n [a1 = 1, b1 = 2, c1 = 3, d1 = 4, e1 = 5] = [];\n let [a2 = 1, b2 = 2, c2 = 3, d2 = 4, e2 = 5] = [];\n console.log([a1, b1, c1, d1, e1], [a2, b2, c2, d2, e2]);\n console.log([1, 2, 3, 4, 5], [a1, b1, c1, d1, e1]);\n console.log([1, 2, 3, 4, 5], [a2, b2, c2, d2, e2]);\n }\n {\n let a1, b1, c1, d1, e1;\n [a1 = 1, b1 = 2, c1 = 3, d1 = 4, e1 = 5] = [5,, 3, 2];\n let [a2 = 1, b2 = 2, c2 = 3, d2 = 4, e2 = 5] = [5,, 3, 2];\n console.log([a1, b1, c1, d1, e1], [a2, b2, c2, d2, e2]);\n console.log([5, 2, 3, 2, 5], [a1, b1, c1, d1, e1]);\n console.log([5, 2, 3, 2, 5], [a2, b2, c2, d2, e2]);\n } // Identifier references\n\n {\n let a = {};\n [a.x] = [10];\n console.log(10, a.x);\n [a[\"x\"]] = [20];\n console.log(20, a[\"x\"]);\n var obj = {\n x: 10\n };\n\n function foo() {\n return obj;\n }\n\n ;\n [foo().x] = [20];\n console.log(20, foo().x);\n [foo()[\"x\"]] = [30];\n console.log(30, foo()[\"x\"]);\n [...foo().x] = [20];\n console.log([20], foo().x);\n [...foo()[\"x\"]] = [30];\n console.log([30], foo()[\"x\"]);\n\n class base {\n methodProp() {\n return {};\n }\n\n methodIndex() {\n return {};\n }\n\n methodRestProp() {\n return {};\n }\n\n methodRestIndex() {\n return {};\n }\n\n get x() {\n return this._x;\n }\n\n set x(v) {\n this._x = v;\n }\n\n }\n\n ;\n\n class extended extends base {\n methodProp() {\n return [super.x] = [10, 20, 30];\n }\n\n methodIndex() {\n return [super[\"x\"]] = [40, 50, 60];\n }\n\n methodRestProp() {\n return [...super.x] = [10, 20, 30];\n }\n\n methodRestIndex() {\n return [...super.x] = [40, 50, 60];\n }\n\n getValue() {\n return super.x;\n }\n\n }\n\n ;\n let c = new extended();\n console.log(undefined, c.getValue());\n c.methodProp();\n console.log(10, c.getValue());\n c.methodIndex();\n console.log(40, c.getValue());\n c.methodRestProp();\n console.log([10, 20, 30], c.getValue());\n c.methodRestIndex();\n console.log([40, 50, 60], c.getValue());\n } // Nesting\n\n {\n let a1;\n [[a1]] = [[1]];\n let [[a2]] = [[1]];\n console.log(a1, a2);\n console.log(a1, 1);\n console.log(a2, 1);\n }\n {\n let a1, b1, c1, d1, e1;\n [[a1, b1], c1, [d1, [e1]]] = [[1, 2], 3, [4, [5]]];\n let [[a2, b2], c2, [d2, [e2]]] = [[1, 2], 3, [4, [5]]];\n console.log([a1, b1, c1, d1, e1], [a2, b2, c2, d2, e2]);\n console.log([1, 2, 3, 4, 5], [a1, b1, c1, d1, e1]);\n console.log([1, 2, 3, 4, 5], [a2, b2, c2, d2, e2]);\n }\n {\n let a1;\n [[a1, b1] = [1, 2]] = [];\n let [[a2, b2] = [1, 2]] = [];\n console.log([a1, b1], [a2, b2]);\n console.log([1, 2], [a1, b1]);\n console.log([1, 2], [a2, b2]);\n }\n {\n let a1;\n [[[a1] = [1], [[b1]] = [[2]]] = [, undefined]] = [undefined];\n let [[[a2] = [1], [[b2]] = [[2]]] = [, undefined]] = [undefined];\n console.log([a1, b1], [a2, b2]);\n console.log([1, 2], [a1, b1]);\n console.log([1, 2], [a2, b2]);\n } // Other iterators\n\n {\n let a1;\n [a1, b1, c1, d1, ...rest1] = \"testing\";\n let [a2, b2, c2, d2, ...rest2] = \"testing\";\n console.log([a1, b1, c1, d1, rest1], [a2, b2, c2, d2, rest2]);\n console.log([\"t\", \"e\", \"s\", \"t\", [\"i\", \"n\", \"g\"]], [a1, b1, c1, d1, rest1]);\n console.log([\"t\", \"e\", \"s\", \"t\", [\"i\", \"n\", \"g\"]], [a2, b2, c2, d2, rest2]);\n }\n {\n let map = new Map();\n map.set(1, 6);\n map.set(2, 7);\n map.set(3, 8);\n map.set(4, 9);\n map.set(5, 10);\n let a1;\n [a1, b1, c1, d1, ...rest1] = map.entries();\n let [a2, b2, c2, d2, ...rest2] = map.entries();\n console.log([a1, b1, c1, d1, rest1], [a2, b2, c2, d2, rest2]);\n console.log([[1, 6], [2, 7], [3, 8], [4, 9], [[5, 10]]], [a1, b1, c1, d1, rest1]);\n console.log([[1, 6], [2, 7], [3, 8], [4, 9], [[5, 10]]], [a2, b2, c2, d2, rest2]);\n }\n {\n let getIteratorCalledCount = 0;\n let nextCalledCount = 0;\n let doneCalledCount = 0;\n let valueCalledCount = 0;\n let simpleIterator = {\n [Symbol.iterator]: function () {\n ++getIteratorCalledCount;\n return {\n i: 0,\n next: function () {\n ++nextCalledCount;\n var that = this;\n return {\n get done() {\n ++doneCalledCount;\n return that.i == 1;\n },\n\n get value() {\n ++valueCalledCount;\n return that.i++;\n }\n\n };\n }\n };\n }\n };\n let [a, b, c] = simpleIterator;\n console.log(1, getIteratorCalledCount);\n console.log(3, nextCalledCount);\n console.log(3, doneCalledCount);\n console.log(1, valueCalledCount);\n [getIteratorCalledCount, nextCalledCount, doneCalledCount, valueCalledCount] = [0, 0, 0, 0];\n let [...rest] = simpleIterator;\n console.log(1, getIteratorCalledCount);\n console.log(2, nextCalledCount);\n console.log(2, doneCalledCount);\n console.log(1, valueCalledCount);\n [getIteratorCalledCount, nextCalledCount, doneCalledCount, valueCalledCount] = [0, 0, 0, 0];\n [a, b, c, ...rest] = simpleIterator;\n console.log(1, getIteratorCalledCount);\n console.log(4, nextCalledCount);\n console.log(4, doneCalledCount);\n console.log(1, valueCalledCount);\n } // Array destructuring in various contexts\n\n {\n let a, b, c;\n\n function foo(x = [a, b = 2, ...c] = [1,, 3, 4, 5, 6, 7]) {\n console.log([1, 2, [3, 4, 5, 6, 7]], [a, b, c]);\n console.log([1,, 3, 4, 5, 6, 7], x);\n }\n\n foo();\n `${[a = 5, b, ...c] = [, 1, 3, 5, 7, 9]}`;\n console.log([5, 1, [3, 5, 7, 9]], [a, b, c]);\n\n (() => [a,, b, c] = [1, 2, 3])();\n\n console.log([1, 3, undefined], [a, b, c]);\n } // nested destructuring\n\n {\n let [[a] = [1]] = [[2]];\n console.log(a, 2);\n [[a] = [1]] = [[]];\n console.log(a, undefined);\n [[a] = [1]] = [];\n console.log(a, 1);\n [[a] = 1] = [[]];\n console.log(a, undefined);\n } // Bug OSG : 4533495\n\n {\n function foo() {\n for (var [i, j, k] in {\n qux: 1\n }) {\n return i === \"q\" && j === \"u\" && k === \"x\";\n }\n }\n\n console.log(foo());\n }\n {\n let obj1 = {};\n\n obj1[Symbol.iterator] = function () {\n return {\n next: function () {\n ;\n }\n };\n }; // Empty slot should not call next on the iterator.\n\n\n var [] = obj1;\n }\n {\n let obj1 = {};\n\n obj1[Symbol.iterator] = function () {\n return {\n next: function () {\n this.counter++;\n\n if (this.counter > 1) {\n ;\n }\n\n return {\n value: undefined,\n done: false\n };\n },\n counter: 0\n };\n }; // Second empty slot should not call next on the iterator.\n\n\n var [,] = obj1;\n }\n}", "undefined(state, n) {\n state.a += n;\n }", "a (a a = 0; a < a.a; ++a) {N\n a a = a[a];N\n a (a.a == a) {N\n a a = aAaAaAa(a, a.a);N\n a (!a) a.a = aAa;N\n a a (aAa) a.a = a.a == a ? a : a.a + a;N\n }N\n }", "function re(a,b){this.O=[];this.za=a;this.la=b||null;this.J=this.D=!1;this.H=void 0;this.ha=this.Fa=this.S=!1;this.R=0;this.Ef=null;this.N=0}", "function foo() {\n a = a + 1;\n}", "function ap(a,b){this.N=[];this.Ga=a;this.K=b||null;this.J=this.B=!1;this.F=void 0;this.ia=this.La=this.S=!1;this.Q=0;this.A=null;this.D=0}", "function qw(a,b){this.o=[];this.O=a;this.I=b||null;this.l=this.g=!1;this.j=void 0;this.N=this.Ta=this.v=!1;this.F=0;this.i=null;this.s=0}", "function x(){this.a={}}", "function x(){this.a={}}", "function x(){this.a={}}", "function Ua(){return Ua=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ua.apply(this,arguments)}", "function sd(a){this.ta={};this.o=a}", "function b(a){je=a}", "function b(a){je=a}", "function internals(){\r\n return {a: acc, b: brs, c: cnt, m: m, r: r};\r\n }", "function $g(){this.b=null;this.a=[]}", "function Ai(a,b){this.wc=[];this.je=a;this.Qd=b||null;this.Bb=this.$a=!1;this.X=void 0;this.sd=this.gf=this.Fc=!1;this.Ac=0;this.v=null;this.Hc=0}", "function o0()\n{\n var o1 = o21[o22] !== o21[o23];\n\n let o2 = 0;\n try {\nfor (var o3 = 0; o3 < 3; o4.o5++)\n {\n try {\no580 += o340[o335++] = 0;\n}catch(e){} // hoisted field load\n try {\nObject.defineProperty(o1, e, { o756: function (o31, o518, o486) {\n try {\nif (typeof (o486) === 'undefined') {\n try {\no486 = o518;\n}catch(e){}\n try {\no518 = 438 /* 0666 */ ;\n}catch(e){}\n }\n}catch(e){}\n try {\no518 |= 8192;\n}catch(e){}\n try {\nreturn o489.o526(o31, o518, o486);\n}catch(e){}\n }, configurable: true });\n}catch(e){}\n try {\no479.o508 += o16.push(\",\");\n}catch(e){} // implicit call bailout\n }\n}catch(e){}\n}", "function A(t){return void 0===t||null===t}", "function Ut(a,b){this.sm=[];this.nV=a;this.qQ=b||null;this.Au=this.Rf=!1;this.Ie=void 0;this.IM=this.s0=this.yE=!1;this.yD=0;this.Fa=null;this.ty=0}", "function miscAssignTest() {\n var x = 10;\n var y = 20;\n var z = 30;\n var w;\n var obj = { foo: 0 };\n\n // On the top level these should not use a temporary, and e.g.\n // x = y + z should compile to a single ADD.\n x = y + z; print(x);\n x += y; print(x);\n x += y + z; print(x);\n\n // Outside of top level a temporary must be used.\n w = x = y + z; print(x);\n w = x += y; print(x);\n w = x += y + z; print(x);\n\n // Same tests for a non-reg-bound variable.\n glob = y + z; print(glob);\n glob += y; print(glob);\n glob += y + z; print(glob);\n w = glob = y + z; print(glob);\n w = glob += y; print(glob);\n w = glob += y + z; print(glob);\n\n // And for a property LHS.\n obj.foo = y + z; print(obj.foo);\n obj.foo += y; print(obj.foo);\n obj.foo += y + z; print(obj.foo);\n w = obj.foo = y + z; print(obj.foo);\n w = obj.foo += y; print(obj.foo);\n w = obj.foo += y + z; print(obj.foo);\n\n // Bytecode tests (inspect manually)\n x = 10;\n x += 3;\n x += 3.1;\n x += true;\n print(x);\n\n x = 10; y = 20;\n glob = +(x + y); print(glob);\n glob = 123; print(glob);\n glob = 123.1; print(glob);\n w = glob = +(x + y); print(glob);\n w = glob = 123; print(glob);\n w = glob = 123.1; print(glob);\n print(glob = +(x + y), glob = 123, glob = 123.1);\n}", "function kI(){this.aa={}}", "a (a.a - a < 0 &&N\n (a.a.a > 0 || !(a.a[0] a AaAa))) {N\n a a = [];N\n a.a(a);N\n a.a = [a AaAa(a)];N\n a.a[0].a = a;N\n }", "function Ag(){this.b=null;this.a=[]}", "function n(t,a){return t[0]=a[0],t[1]=a[1],t[2]=a[2],t[3]=a[3],t[4]=a[4],t[5]=a[5],t[6]=a[6],t[7]=a[7],t[8]=a[8],t[9]=a[9],t[10]=a[10],t[11]=a[11],t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15],t}", "function a(e,t){\"use strict\";if(!t||!e)return!1;if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]instanceof Array&&t[n]instanceof Array){if(!a(e[n],t[n]))return!1}else if(e[n]!==t[n])return!1;return!0}", "function z(){var t=s();return this.copyTo(t),t}", "function aA(t,e){this.C=[],this.O=t,this.K=e||null,this.B=this.j=!1,this.A=void 0,this.H=this.P=this.F=!1,this.D=0,this.o=null,this.G=0}", "function gc(a,b){this.re=[];this.tg=a;this.cg=b||null;this.bd=this.Wb=!1;this.Pb=void 0;this.Cf=this.Rg=this.Ie=!1;this.ve=0;this.eb=null;this.Je=0}", "function o(a){let b=A,c=F,d=H,e=I,f=C,g=D,h=new Uint8Array(z.slice(0,A)),i=B,j=B.slice(0,B.length),k=G,l=N,m=a();return A=b,F=c,H=d,I=e,C=f,D=g,z=h,N=l,B=i,B.splice(0,B.length,...j),G=k,E=new DataView(z.buffer,z.byteOffset,z.byteLength),m}", "function func1(){\n var hey = 10;\n var hey = 20; // BAD PRACTICE!\n console.log(hey);\n }", "a (!a.a.a) a = \"a\";N\n a a = aAaAa(a, a);N\n }N\nN\n a aAa = a.a.aAa;N\n a a = aAa(a, a), aAa = aAa(a.a, a, aAa);N\n a (a.aAa) a.aAa = a;N\n a aAaAa = a.a.a(/^\\a*/)[0], a;N\n a (!a && !/\\A/.a(a.a)) {N\n a = 0;N\n a = \"a\";N\n } a a (a == \"a\") {N\n a = a.a.a(a, a.a.a(aAaAa.a), a.a);N\n a (a == Aa || a > 0) {N\n a (!a) a;N\n a = \"a\";N\n }N\n }N\n a (a == \"a\") {N\n a (a > a.a) a = aAa(aAa(a, a-0).a, a, aAa);N\n a a = 0;N\n } a a (a == \"a\") {N\n a = aAa + a.a.aAa;N\n } a a (a == \"a\") {N\n a = aAa - a.a.aAa;N\n } a a (a a == \"a\") {N\n a = aAa + a;N\n }N\n a = Aa.a(0, a);N\nN\n a aAa = \"\", a = 0;N\n a (a.a.aAaAa)N\n a (a a = Aa.a(a / aAa); a; --a) {a += aAa; aAa += \"\\a\";}N\n a (a < a) aAa += aAa(a - a);N\nN\n a (aAa != aAaAa) {N\n aAa(a, aAa, Aa(a, 0), Aa(a, aAaAa.a), \"+a\");N\n a.aAa = a;N\n a a;N\n }", "a (a a = 0; a < 0; a++) { // Aa a a a 0 a a a a a aN\n a (a && aAaAa(a.a.a.aAa(a.aAa + a))) --a;N\n a (a.aAa + a < a.aAa && aAaAa(a.a.a.aAa(a.aAa + a))) ++a;N\n a (a && a_a < 0 && a == 0 && a == a.aAa - a.aAa) {N\n a = a.aAa.aAaAaAa();N\n } a a (a && a.a.aAa) {N\n a a = a(a, a, a).aAaAa();N\n a (a.a)N\n a = a[a == \"a\" ? a.a - 0 : 0];N\n aN\n a = aAa;N\n } a {N\n a = a(a, a, a).aAaAaAa() || aAa;N\n }N\n a (a.a || a.a || a == 0) a;N\n a = a;N\n a = a - 0;N\n a = \"a\";N\n }", "function n(t, a) {\n return t[0] = a[0], t[1] = a[1], t[2] = a[2], t[3] = a[3], t[4] = a[4], t[5] = a[5], t[6] = a[6], t[7] = a[7], t[8] = a[8], t[9] = a[9], t[10] = a[10], t[11] = a[11], t[12] = a[12], t[13] = a[13], t[14] = a[14], t[15] = a[15], t;\n }", "function Rn(){return Rn=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Rn.apply(this,arguments)}", "function an(){}", "function i(t){return void 0===t&&(t=null),Object(r[\"l\"])(null!==t?t:o)}", "function le(a,b){this.R=[];this.Ea=a;this.ma=b||null;this.J=this.D=!1;this.H=void 0;this.la=this.Ia=this.V=!1;this.S=0;this.Tf=null;this.O=0}", "function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}", "function o(t){return i(t)||a(t)||s()}", "function ia(){return(ia=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}", "function a(e){return void 0===e&&(e=null),Object(r[\"p\"])(null!==e?e:i)}", "function o(e){return void 0===e&&(e=null),Object(r[\"r\"])(null!==e?e:a)}", "function nd(a){this.la={};this.o=a}", "function a(e){return void 0===e&&(e=null),Object(r[\"m\"])(null!==e?e:o)}", "function Y(){var e=a();return this.copyTo(e),e}", "function Rt(t, e, n, r, i, o, u) {\n return void 0 === e && (e = null), void 0 === n && (n = []), void 0 === r && (r = []), \n void 0 === i && (i = null), void 0 === o && (o = null), void 0 === u && (u = null), \n new Lt(t, e, n, r, i, o, u);\n}", "function pr(a,b){this.e=[];this.q=a;this.o=b||null;this.c=this.a=!1;this.b=void 0;this.k=this.p=this.i=!1;this.f=0;this.d=null;this.g=0}", "function ie(a){this.ra=a}", "function AssignmentOperator(){\nequalAssOP();\naddAssigOp();\nsubAssigOp();\n}", "function dAssign222(result, curr) {\n\t//console.log(arr)\n\tconsole.log(Reflect.ownKeys(curr).length)\n\t/*for (let i=0; i<Object.keys(curr).length; i++) {\n\t\tresult[Object.keys(curr)[i]] = curr[Object.keys(curr)[i]]\n\t}\t*/\t\n\tReflect.ownKeys(curr).forEach()\n\tconsole.log(Reflect.ownKeys(curr))\n\t//console.log(result)\n\treturn result\n}", "function Nc(a,b){this.b=[];this.v=b||r;this.a=this.e=w;this.ea=n;this.h=this.d=w;this.c=0;this.f=r;this.k=0}", "function La(n,t){for(var e in t)n[e]=t[e];return n}", "function a(e){return void 0===e&&(e=null),Object(i[\"q\"])(null!==e?e:o)}", "function a(e,t){var n=i.length?i.pop():[],a=o.length?o.pop():[],s=r(e,t,n,a);return n.length=0,a.length=0,i.push(n),o.push(a),s}", "function withUnknowAssignementEffect(s) {\n var ch;\n //ch = s as string; //syntaxe 1 via as\n ch = s; //syntaxe alternative 2 via <...>\n console.log(\"string(or not) ch=\" + ch);\n}", "function rtrn11(){\n return let /*a*/ + b;\n}", "function Tr(a,b){this.v=[];this.O=a;this.G=b||null;this.g=this.a=!1;this.j=void 0;this.J=this.I=this.B=!1;this.F=0;this.f=null;this.o=0}", "function e(A){return void 0===A||null===A}", "function t(a){return void 0===a||null===a}", "function r(A,e){0}", "function o0(stdlib,o1,buffer) {\n try {\no8[4294967294];\n}catch(e){}\n function o104(o49, o50, o73) {\n try {\no95(o49, o50, o73, this);\n}catch(e){}\n\n try {\no489.o767++;\n}catch(e){}\n\n try {\nif (o97 === o49) {\n try {\nreturn true;\n}catch(e){}\n }\n}catch(e){}\n\n try {\nreturn false;\n}catch(e){}\n };\n //views\n var o3 =this;\n\n function o4(){\n var o30\n var o6 = o2(1.5);\n try {\no3[1] = o6;\n}catch(e){}\n try {\nreturn +(o3[1])\n}catch(e){}\n }\n try {\nreturn o4;\n}catch(e){}\n}", "function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}", "function T1a(a,b){if(w(a,b))return!0;if(!a||!b||Vp(a)!=Vp(b))return!1;a=a.a.gg();for(var c=0;c<a.length;c++)if(!b.U(a[c]))return!1;return!0}" ]
[ "0.6171213", "0.61678195", "0.6150296", "0.6122829", "0.6065563", "0.5919837", "0.5915318", "0.5915318", "0.5915318", "0.5915318", "0.5915318", "0.5915318", "0.58492327", "0.58413357", "0.58413357", "0.5799543", "0.5774466", "0.5754179", "0.5753245", "0.5726523", "0.5724349", "0.5724349", "0.5724349", "0.5724349", "0.56847924", "0.56847924", "0.56847924", "0.56847924", "0.56847924", "0.56847924", "0.56847924", "0.56847924", "0.56847924", "0.56847924", "0.56847924", "0.56847924", "0.5676549", "0.5671044", "0.5629029", "0.5589392", "0.5581963", "0.5572578", "0.5564461", "0.55564326", "0.5549295", "0.5549295", "0.5549295", "0.5530328", "0.55296403", "0.5520282", "0.5520282", "0.5517983", "0.5513468", "0.55096346", "0.5504722", "0.5495762", "0.5481876", "0.547821", "0.54733706", "0.54623836", "0.54559344", "0.5447707", "0.54460096", "0.54408723", "0.5431576", "0.5429199", "0.542896", "0.5428701", "0.5425874", "0.54228795", "0.54207385", "0.5413914", "0.5413488", "0.53992337", "0.5397456", "0.5396847", "0.5392374", "0.53882056", "0.5380829", "0.5372044", "0.536713", "0.5366925", "0.5366192", "0.5360038", "0.53569245", "0.53534734", "0.5349884", "0.5344745", "0.53379846", "0.5322283", "0.53199905", "0.53159297", "0.5308384", "0.53018546", "0.52963746", "0.5295207", "0.529389", "0.5288008", "0.52716047", "0.52667606", "0.52616477" ]
0.0
-1
renders router and navbar
render() { const Map = ReactMapboxGl({ accessToken: "pk.eyJ1IjoiaGlkZS0iLCJhIjoiY2plZ2JxYjk2MDJ5NTJ3cGl5bnFobXkxaiJ9.ia8SLIYusJpY5XT9_wjvIA" }); return ( <div> <div> <Router> <div> { /* <nav className="navbar fixed-top navbar-expand-md navbar-toggleable-md navbar-light bg-light"> <button type="button" className="navbar-toggler" data-toggle="collapse" data-target="#navbarNav"> <span className="navbar-toggler-icon"></span> </button> <div className='collapse navbar-collapse' id='navbarNav'> <ul className='navbar-nav mr-auto'> <Link style={{display: 'inline-block'}} to="/" className="brand"> <Animation /> </Link> </ul> <ul className='navbar-nav mr-right'> <Icon type="picture" className="mr-2 mt-1"/><Link style={{display: 'inline-block'}} to="/Portfolio" className="brand mr-3">Portfolio</Link> <Icon type="user" className="mr-2 mt-1"/><Link style={{display: 'inline-block'}} to="/About" className="brand mr-3">About</Link> <Icon type="form" className="mr-2 mt-1"/><Link style={{display: 'inline-block'}}to="/Contact" className="brand mr-3">Contact</Link> </ul> </div> </nav> */ } {<Menu // Navbar onClick={this.handleClick} selectedKeys={[this.state.current]} mode="horizontal" > <Menu.Item key="home"> <Link style={{display: 'inline-block'}} to="/" className="brand"> <Animation /> </Link> </Menu.Item> <Menu.Item style={{float: 'right'}} key="contact"> <Icon type="form" /><Link style={{display: 'inline-block'}}to="/Contact" className="brand">Contact</Link> </Menu.Item> <Menu.Item style={{float: 'right', display: 'inline-block'}}key="about"> <Icon type="user" /><Link style={{display: 'inline-block'}} to="/About" className="brand">About</Link> </Menu.Item> <Menu.Item style={{float: 'right'}} key="portfolio"> <Icon type="picture" /><Link style={{display: 'inline-block'}} to="/Portfolio" className="brand">Portfolio</Link> </Menu.Item> </Menu>} <div className='container-fluid' style={{padding:0}}> <Switch> <Route exact path="/" component={Homepage} /> <Route path="/Profile" component={Portfolio} /> <Route path="/Upload" component={About} /> <Route path="/Contact" render={(props) => this.renderContact(props)} /> <Route path="/Admin" component={Admin} /> <Route path="/Portfolio" component={Portfolio} /> <Route path="/About" component={About} /> <Route path="/Contact" component={Contact} /> </Switch> </div> </div> </Router> </div> </div> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _render() {\n _$navbar.setMod(_B_BAR, _M_WEBAPP, _isWebapp);\n _renderBtn(_$btnL);\n _renderBtn(_$btnR);\n _renderDropdown();\n _renderSearch();\n _renderHead();\n }", "render() {\n return( \n <nav className=\"navbar navbar-default\">\n <div className=\"navbar-header\">\n </div>\n <ul className=\"nav navbar-nav navbar-right\">\n <li> <a href=\"/home\"> HOME </a> </li>\n <li> <a href=\"/submit\"> SUBMIT </a> </li>\n </ul>\n </nav>\n )\n }", "render() {\r\n return (\r\n <Navbar brand='Tinda' className=\"pink\" right>\r\n <NavItem>\r\n {this.props.children}\r\n </NavItem>\r\n <NavItem>\r\n <Link to=\"/user\">Viewer</Link>\r\n </NavItem>\r\n <NavItem>\r\n <Link to=\"/\">Admin</Link>\r\n </NavItem>\r\n </Navbar>\r\n );\r\n }", "render() {\n\t\treturn (\n\t\t\t<Navbar fixedTop >\n\t\t <Navbar.Header>\n\t\t\t\t <Navbar.Brand> \n\t\t\t\t\t\t<a href=\"/\">Romcal</a>\n\t\t\t\t </Navbar.Brand>\n\t\t\t\t</Navbar.Header>\n\t\t\t\t<Nav>\n\t\t\t\t\t<LinkContainer exact to=\"/\">\n\t\t\t\t <NavItem eventKey={1}>Home</NavItem>\n\t\t\t\t </LinkContainer>\n\t\t\t\t\t<LinkContainer exact to=\"/calendar\">\n\t\t\t\t <NavItem eventKey={2}>Calendar</NavItem>\n\t\t\t\t </LinkContainer>\n\t\t\t\t</Nav>\n\t\t\t</Navbar>\n\t\t);\n\t}", "render() {\n return (\n <nav className=\"navbar navbarstyle navbar-static-top\">\n <div className=\"navbar-inner\">\n <div className=\"container\">\n <div className=\"navbar-header\">\n <div className=\"navbar-brand\">\n <Link to=\"/\">\n <img alt=\"uGate Icon\" src=\"./images/ugatelogo.png\"/>\n\n uGate &reg;</Link>\n </div>\n </div>\n\n <ul className=\"nav navbar-nav navbar-right\">\n <li>\n\n\n <p className=\"navbar-text\">New to uGate?</p>\n </li>\n <li>\n <Link to=\"/SignUp\">\n <span className=\"glyphicon glyphicon-user\"></span> Sign Up\n </Link>\n </li>\n </ul>\n\n </div>\n </div>\n </nav>\n );\n }", "render(){\n return (\n <div>\n {/*Page header used by bootstrap to name the app */}\n <PageHeader>Title <small>Words to live by</small></PageHeader>\n {/*\n Nav/NavItem used by bootstrap to create links to different routes.\n React-router v4 uses \"Link\" imported from 'react-router-dom' rather\n than simple hrefs. Since bootstrap NavItems use hrefs, we need to\n use LinkContainer to make them play nice.\n */}\n <Nav bsStyle=\"tabs\">\n <LinkContainer exact={true} to =\"/\">\n <NavItem eventKey={1}>\n Home\n </NavItem>\n </LinkContainer>\n <LinkContainer to =\"/route1\">\n <NavItem eventKey={2}>\n Route 1\n </NavItem>\n </LinkContainer>\n <LinkContainer to =\"/route2\">\n <NavItem eventKey={3}>\n Route 2\n </NavItem>\n </LinkContainer>\n </Nav>\n </div>\n )\n }", "render() {\n\n return(\n\n <div>\n <div className='navBar'>\n <div className='navBar-left'>\n PRT Customers App\n </div>\n\n <div className='navBar-right'>\n <NavLink \n to='/addCustomer'\n className='nav-link'\n activeClassName='nav-link-active'\n >\n <Icon.UserPlus size={ 18.5 } /> &nbsp; Add Customer\n </NavLink>\n <NavLink \n to='/customerList'\n className='nav-link'\n activeClassName='nav-link-active'\n >\n <Icon.List size={ 18.5 } /> &nbsp; Customers List\n </NavLink>\n </div>\n </div> \n </div>\n );\n }", "function renderNavigationMenu() {\n\n }", "render() {\n \t\treturn(\n \t\t\t<nav className=\"navbar navbar-inverse\">\n \t\t\t\t<div className=\"container\">\n \t\t\t\t\t<Link className=\"navbar-brand\" to=\"/\">Quotes</Link>\n \t\t\t\t\t<ul className=\"nav navbar-nav\">\n \t\t\t\t\t<li><Link to=\"/\">Home</Link></li>\n \t\t\t\t\t<li><Link to=\"/favorites\">Favorites</Link></li> \t\t\t\t\t\n \t\t\t\t\t</ul> \t\t\t\t\t \n \t\t\t\t</div>\n \t\t\t</nav>\n \t\t\t)\n }", "render() {\n\t\t// preserve context\n\t\tconst _this = this;\n\t\t\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<AppHeader links={_this.state.links} />\n\n\t\t\t\t<Switch>\n\t\t\t\t\t<Route exact path=\"/\" component={Home} />\n\t\t\t\t\t<Route path=\"/datagrid\" component={DataGrid} />\n\t\t\t\t\t<Route path=\"/form\" component={Form} />\n\t\t\t\t\t<Route component={NoRoute} />\n\t\t\t\t</Switch>\n\t\t\t</div>\n\t\t);\n\t}", "render() {\n return(\n <HashRouter>\n <div id='container'>\n\n <div id='navbar'>\n <button> <Link to ='/'> Home </Link> </button>\n <button> <Link to ='/dogs'> Dogs </Link> </button>\n <button> <Link to='/dogs/create'> Add Dog </Link> </button>\n </div>\n\n <div id='nav-helper'>\n <Route path='/dogs' component = {AllDogs}/>\n <Route path='/dogs/create' component = {Form} />\n <Route path='/dogs/edit/:id' component = {Edit} />\n <Route exact path='/' />\n </div>\n </div>\n </HashRouter>\n )\n }", "render() {\n let appContainer = document.querySelector('#tabsBoxApp');\n let template = require('./views/TabsBoxComponent.hbs');\n let navigationLinks = this.navigation.getNavigationLinks();\n\n appContainer.innerHTML = template({'links': navigationLinks});\n\n this.navigation.addNavigationClickActions();\n\n }", "render() {\n return (\n <React.Fragment>\n <NavBar />\n <ApplicationViews />\n </React.Fragment>\n );\n }", "render() {\n return (\n <BrowserRouter> {/** BrowserRouter for browsing */}\n <nav className=\"navbar navbar-inverse\">\n <div className=\"container-fluid\">\n <div className=\"navbar-header\">\n <button type=\"button\" className=\"navbar-toggle\"\n data-toggle=\"collapse\" data-target=\"#myNavbar\">\n <span className=\"icon-bar\"></span>\n <span className=\"icon-bar\"></span>\n <span className=\"icon-bar\"></span>\n </button>\n\n </div>\n <div className=\"collapse navbar-collapse\" id=\"myNavbar\">{/** Links for Navigation */}\n <ul className=\"nav navbar-nav\">\n <li><Link to=\"/\">Home</Link></li>\n <li><Link to=\"/truckDriversList\"> Job Portal </Link></li>\n <li><Link to=\"/driver\">All TruckDrivers</Link></li>\n <li><Link to=\"/jobdetails\">Job Details</Link></li>\n \n </ul>\n </div>\n </div>\n </nav>\n <div>{/** Routes for all componets */}\n <Route exact path=\"/\" component={Home}></Route>\n <Route exact path=\"/driver\" component={Drivers}></Route>\n <Route exact path=\"/jobdetails\" component={JobDetails} />\n <Route exact path={\"/truckDriversList\"} component={TruckDriversList} />\n\n </div>\n </BrowserRouter>\n )\n }", "function renderNavigation() {\n // CREATE NAVBAR IN DOM from MAIN_LINKS in data.js\n $('#header').append(componentNavbar());\n $('.sidebar-wrapper').append(componentSidebar());\n for (let link of MAIN_LINKS) {\n $('#navbar-list').append(componentNavbarList(link));\n }\n $('#navbar-list').append(\n '<li> <button type=\"button\" id=\"side-bar-button\" class=\"btn btn\"><i class=\"bi bi-cart-fill text-light\"></i></button></li>'\n );\n //SHOW SIDEBAR HANDLER\n $('#side-bar-button').click(function (e) {\n generateTotal();\n $('.sidebar-wrapper').css('display', 'block');\n });\n\n //HIDE SIDEBAR HANDLERS\n // BUTTON\n $('#side-bar-close').click(function (e) {\n //PREVENT CHILD EVENT PROPAGATION HANDLER\n $('.sidebar-wrapper').css('display', 'none');\n });\n // MODAL\n $('.sidebar-wrapper').click(function (e) {\n //PREVENT CHILD EVENT PROPAGATION HANDLER\n $('.sidebar').click(function (e) {\n e.stopPropagation();\n });\n $('.sidebar-wrapper').css('display', 'none');\n });\n // CREATE FOOTER IN DOM\n $('.footer-container').append(componentFooter());\n}", "function render(st = state.Home) {\n document.querySelector(\"#root\").innerHTML = `\n ${Header(st)}\n ${Nav(state.Links)}\n ${Main(st)}\n ${Footer()}\n `;\n\n router.updatePageLinks();\n addEventListeners(st);\n\n}", "render() {\n const { classes } = this.props;\n if (this.props.store.loadingRoutes) {\n return (\n <div className=\"scroll-vert\">\n {this.renderLoading()}\n </div>\n );\n }\n else {\n return (\n <List component=\"nav\" className={classes.root}>\n {this.renderRoutes()}\n </List>\n );\n }\n }", "render() {\n return (\n <div>\n <nav className=\"navBar\">\n {TokenServices.hasAuthToken()\n ? this.renderHomeLinks()\n : this.renderLoginLinks()}\n </nav>\n </div>\n )\n }", "function Navbar() {\n return (\n <nav>\n <Link to=\"/\">Home</Link>\n <Link to=\"/beers\">See all beers</Link>\n <Link to=\"/randombeer\">Randomize beer</Link>\n <Link to=\"/newbeer\">Add a new beer</Link>\n </nav>\n );\n}", "render() {\n return (\n <div className=\"app\">\n <Sidebar>\n <Navbar />\n <main>\n <PageTitle>Employees</PageTitle>\n <Grid>\n <Routes />\n </Grid>\n </main>\n </Sidebar>\n </div>\n );\n }", "onRender () {\n let Navigation = new NavigationView();\n App.navigationRegion.show(Navigation);\n Navigation.setItemAsActive(\"home\");\n }", "render(){\n\t\treturn(\n\t\t\t<div>\n\t\t\t\t<h2> Our Current Clients Page </h2>\n\t\t\t\t<ClientLogos/>\n\t\t\t\t<ClientDescription/> \n\t\t\t</div>\n\t\t)\n\t}", "function DisplayNav() {\n switch (userInfo.accountType) {\n case 'E':\n return (<EmpNav />)\n\n case 'U':\n return (<UserNav />)\n\n default:\n return (<VisitNav />)\n }\n }", "render(){\n return (\n <nav>\n <ul className=\"navbar\">\n <Link to='/' style={{textDecoration: \"none\"}}>\n <li className=\"title\">Tick-it</li>\n </Link>\n {this.linkButton()}\n </ul>\n </nav>\n )\n }", "render() {\n const {route} = this.props;\n return (\n <div className=\"app route-container\">\n <h1>Layout!</h1>\n <p>Just s demo page!!</p>\n <ul>\n <li><NavLink activeClassName='active' exact to=\"/\">Home</NavLink></li>\n <li><NavLink activeClassName='active' to=\"/test\">Test</NavLink></li>\n </ul>\n {renderRoutes(route.routes)}\n </div>\n );\n }", "function Nav() {\n return (\n <div>\n Nav<br/>\n <Link to='/dashboard'><button>Home</button></Link><br/>\n <Link to='/new'><button>New Post</button></Link><br/>\n <Link to='/'><button>Logout</button></Link><br/>\n </div>\n )\n}", "function Navbar(){\n return(\n <nav>\n <a href='www.google.com'>Google</a> |\n <a href='www.facebook.com'>Facebook</a> |\n <a href='www.amazon.com'>Amazon</a> |\n <a href='www.netflix.com'>Netflix</a>\n </nav>\n );\n}", "render(){\n return (\n\n <div>\n\n {/*Page header used by bootstrap to name the app */}\n <img className=\"floatLeft\" width=\"10%\" height=\"10%\" src={require('../images/starsdatabase5.png')} alt=\"Image of STARS Emblem\"/>\n <img className=\"floatRight\" width=\"15%\" height=\"15%\" src={require('../images/starsdatabase3.png')} alt=\"Image of STARS Emblem 2\"/>\n <img className=\"floatRight\" width=\"15%\" height=\"15%\" src={require('../images/starsdatabase.jpg')} alt=\"Image of STARS Emblem 2\"/>\n \n <div ><PageHeader >SSU STARS <small>Sustainability Tracking, Assessment, & Rating System</small></PageHeader> </div>\n\n {/*\n Nav/NavItem used by bootstrap to create links to different routes.\n React-router v4 uses \"Link\" imported from 'react-router-dom' rather\n than simple hrefs. Since bootstrap NavItems use hrefs, we need to\n use LinkContainer to make them play nice.\n */}\n <Nav bsStyle=\"tabs\">\n <LinkContainer exact={true} to =\"/\">\n <NavItem eventKey={1}>\n Home\n </NavItem>\n </LinkContainer>\n \n\n <LinkContainer to =\"/filter\">\n <NavItem eventKey={2}>\n Queries\n </NavItem>\n </LinkContainer>\n\n <LinkContainer to =\"/reportingFieldsRoute\">\n <NavItem eventKey={3}>\n Credits\n </NavItem>\n </LinkContainer>\n\n \n\n\n\n </Nav>\n \n\n </div>\n )\n }", "render() {\n const { auth } = this.props;\n return (\n <nav>\n <div className=\"nav-wrapper\">\n <Link to={auth ? \"/surveys\" : \"/\"} className=\"left brand-logo\">\n Feedback\n </Link>\n <ul id=\"nav-mobile\" className=\"right \">\n {this.renderContent()}\n </ul>\n </div>\n </nav>\n );\n }", "function leftNav() {\n\tapp.getView().render('content/folder/customerserviceaboutusleftnav');\n}", "function Header (){\n return (\n <nav>\n {/* <Link to=\"/todos\">Todos</Link> \n <Link to=\"/register\">Register</Link> */}\n <NavLink activeClassName=\"activado\" to=\"/todos\" exact>Todos</NavLink>\n <NavLink activeClassName=\"activado\" to=\"/register\" exact>Register</NavLink>\n <NavLink activeClassName=\"activado\" to=\"/login\" exact>Login</NavLink>\n </nav>\n )\n}", "render(){\n return(\n <div>\n <Router>\n <React.Fragment>\n <NavBar />\n <Route exact path = \"/\" render = {()=> <Redirect to=\"/news\" />}/>\n <Route exact path = \"/news\" render = {()=> <NewsPage/>}/>\n <Route exact path = \"/login\" render = {()=> <Landing/>}/>\n <Route exact path = \"/charts\" render = {()=> <ChartPage/>}/>\n <Route exact path = \"/trade\" render = {()=> <TradePage/>}/>\n <Route exact path = \"/portfolio\" render = {()=> <PortfolioPage/>}/>\n <Route exact path = \"/leaderboard\" render = {()=> <LeaderboardPage/>}/>\n </React.Fragment>\n </Router>\n </div>\n )\n }", "render() {\n return (\n <Router>\n <div className=\"App\">\n {/* Adding navigation bar from bootstrap */}\n <Navbar bg=\"primary\" variant=\"dark\">\n <Navbar.Brand href=\"/\">Navbar</Navbar.Brand>\n <Nav className=\"me-auto\">\n {/* Creating sections within the navbar for each component */}\n <Nav.Link href=\"/\">Home</Nav.Link>\n <Nav.Link href=\"/header\">Header</Nav.Link>\n <Nav.Link href=\"/footer\">Footer</Nav.Link>\n <Nav.Link href=\"/read\">Movies</Nav.Link>\n <Nav.Link href=\"/create\">Create</Nav.Link>\n </Nav>\n </Navbar>\n <br />\n\n {/* Switch statment to control routing for the navbar */}\n <Switch>\n {/* Routing each href path with the appropriate component */}\n <Route path='/' component={Content} exact />\n <Route path='/header' component={Header}/>\n <Route path='/footer' component={Footer}/>\n <Route path='/read' component={Read}/>\n <Route path='/create' component={Create}/>\n </Switch>\n </div>\n </Router>\n );\n }", "onRender () {\n\t\tthis.registerComponent(App.Compontents, \"app-controls\", TopBarControls, this.$el.find(\"#topbar-container\"), { title: \"Home\" });\n }", "render() {\n return (\n <NavCol>\n <NavCol.Link to=\"/registrering/kunde\">\n <ion-icon name=\"person-add\" />\n Registrer kunde\n </NavCol.Link>\n\n <NavCol.Link to=\"/registrering/sykkel\">\n <ion-icon name=\"bicycle\" />\n Registrer sykkel\n </NavCol.Link>\n\n <NavCol.Link to=\"/registrering/utstyr\">\n <ion-icon name=\"cube\" />\n Registrer utstyr\n </NavCol.Link>\n\n <NavCol.Link to=\"/registrering/ansatt\">\n <ion-icon name=\"contact\" />\n Registrer ansatt\n </NavCol.Link>\n\n <NavCol.Link to=\"/registrering/lokasjon\">\n <ion-icon name=\"business\" />\n Registrer lokasjon\n </NavCol.Link>\n </NavCol>\n );\n }", "render() {\n return (\n <Router>\n <div className=\"container\">\n <nav class=\"col-sm-12\" className=\"navbar navbar-expand navbar-light navbar-center\">\n <a className=\"navbar-item\">\n <img className=\"Logo-spin\" src={Logo} width=\"40\" height=\"40\" alt=\"Logo\" />\n </a>\n <div className=\"collpase navbar-collapse\">\n <ul className=\"navbar-nav mr-auto\">\n <li className=\"navbar-item\">\n <Link to=\"/\" className=\"nav-link\">Home</Link>\n </li>\n <li className=\"navbar-item mr-auto\">\n <Link to=\"/search\" className=\"nav-link\">Search</Link>\n </li>\n <li className=\"navbar-item mr-auto\">\n <Link to=\"/recommendations\" className=\"nav-link\">Recommendations</Link>\n </li>\n <li className=\"navbar-item mr-auto\">\n <Link to=\"/favourites\" className=\"nav-link\">Liked</Link>\n </li>\n <li className=\"navbar-item mr-auto\">\n <Link to=\"/dislikes\" className=\"nav-link\">Disliked</Link>\n </li>\n </ul>\n </div>\n </nav>\n <br />\n <br />\n {/* This sets up the routes. These routes tell the website, what component to load when they are on a specific route.\n For example, if i was on the route \"/\" the Home component would be loaded onto the screen for the user to use */}\n <Route path=\"/\" exact component={Home} />\n <Route path=\"/recommendations\" component={recommendations} />\n <Route path=\"/favourites\" component={favourites} />\n <Route path=\"/dislikes\" component={dislikes} />\n <Route path=\"/results\" component={results} />\n <Route path=\"/artist/:id\" component={artist} />\n <Route path=\"/searchedArtist\" component={searchedArtist} />\n <Route path=\"/search\" component={Search} />\n\n </div>\n </Router>\n );\n }", "function App() {\n return (\n\n\n <Router>\n <div className=\"App\">\n <CustomNavBar/>\n <div>\n <main role=\"main\" className=\"container\">\n <Route exact path=\"/\" component={MainPage}/>\n <Route exact path=\"/about\" component={About}/>\n\n </main>\n\n\n </div>\n </div>\n </Router>\n )\n}", "render() {\n return (\n <Router>\n <div className=\"App\">\n {/* navbar is a bootstrap component which has been imported */}\n <Navbar bg=\"dark\" variant=\"dark\">\n <Navbar.Brand href=\"#home\">Music</Navbar.Brand>\n <Nav className=\"mr-auto\">\n <Nav.Link href=\"/\">Home</Nav.Link>\n <Nav.Link href=\"/list\">Albums</Nav.Link>\n <Nav.Link href=\"/add\">Add</Nav.Link>\n </Nav>\n </Navbar>\n <br />\n <Switch>\n {/* these links just display a different component */}\n <Route path=\"/\" component={Home} exact />\n <Route path=\"/add\" component={Add} />\n <Route path=\"/list\" component={List} />\n <Route path=\"/alter/:id\" component={Alter} />\n </Switch>\n </div>\n </Router>\n );\n }", "render() {\n return (\n <>\n <Nav>\n <List>\n <Item>\n <StyledLink to=\"/\">\n <code>react-spring</code>\n </StyledLink>\n </Item>\n <Item>\n <StyledLink to=\"/scrollama\">\n <code>scrollama</code>\n </StyledLink>\n </Item>\n <Item>\n <StyledLink to=\"/d3-geo\">\n <code>d3-geo</code>\n </StyledLink>\n </Item>\n </List>\n </Nav>\n <Router>\n <SpringDemo path=\"/\" />\n <ScrollamaDemo path=\"/scrollama\" />\n <MapDemo path=\"/d3-geo\" />\n </Router>\n <GlobalStyles />\n </>\n );\n }", "render() {\n const { isAuthenticated, user } = this.props.auth;\n\n //taking these out because trying to make navbar clean - colin\n // <NavItem>\n // <div className=\"welcome\">\n // <span className=\"navbar-text mr-4\">\n // <strong>{user ? `Welcome, ${user.name}` : \"\"}</strong>\n // </span>\n // </div>\n // </NavItem>\n\n const authLinks = (\n <Fragment>\n <NavItem className=\"icons\">\n <NavLink href=\"/ProfilePage\">\n <FaUsers size=\"1.5em\" />\n </NavLink>\n </NavItem>\n <NavItem className=\"icons\">\n <NavLink href=\"/MainProfilePage\">\n <FaUser size=\"1.2em\" />\n </NavLink>\n </NavItem>\n <NavItem className=\"icons\">\n <NavLink href=\"/SearchPage\">\n <FaSearch size=\"1.5em\" />\n </NavLink>\n </NavItem>\n <NavItem className=\"icons\">\n <NavLink href=\"/StopwatchPage\">\n <BsStopwatch size=\"1.5em\" />\n </NavLink>\n </NavItem>\n {/*\n <NavItem className=\"icons\">\n <Logout />\n </NavItem>\n <NavItem className=\"icons\">\n <NavLink href=\"https://github.com/44cjohnson/CS35lFinalProj\">\n <FaGithub size=\"1.2em\" />\n </NavLink>\n </NavItem>\n <NavItem className=\"icons\">\n <NavLink>KEY:</NavLink>\n </NavItem>\n */}\n <NavItem>\n <NavbarDrop />\n </NavItem>\n </Fragment>\n );\n\n const guestLinks = (\n <Fragment>\n <NavItem\n className=\"font-link3\"\n style={\n {\n /*fontWeight: \"bold\"*/\n }\n }\n >\n <RegisterModal />\n </NavItem>\n <NavItem\n className=\"font-link3\"\n style={\n {\n /*fontWeight: \"bold\"*/\n }\n }\n >\n <LoginModal />\n </NavItem>\n </Fragment>\n );\n\n return (\n <div>\n <Navbar\n style={{ backgroundColor: \"black\" }}\n dark\n expand=\"sm\"\n className=\"mb-5\"\n fixed=\"top\"\n >\n <Container>\n <div className=\"navbarBrand\">\n <NavbarBrand\n className=\"font-link\"\n href=\"/ProfilePage\"\n style={{ color: \"#fffff0\", fontSize: 36 }}\n >\n <FaShoePrints className=\"logo\" size=\"1em\" />\n milestone\n </NavbarBrand>\n </div>\n <NavbarToggler onClick={this.toggle} />\n <Collapse isOpen={this.state.isOpen} navbar>\n <Nav className=\"ms-auto\" navbar>\n {isAuthenticated ? authLinks : guestLinks}\n </Nav>\n </Collapse>\n </Container>\n </Navbar>\n </div>\n );\n }", "render(){\n return (\n <div className=\"App\">\n <Navbar>\n <Route path=\"/\" exact component={HomeContainer} />\n <Route exact path=\"/tools/new\" component={AddToolContainer} />\n <Route exact path=\"/tools\" component={SavedTools} />\n <HangForm />\n <HangBoardSession />\n </Navbar>\n </div>\n )\n }", "render() {\n return (\n // Navabar component and formatting is following the template from BootStrap 4.4.x\n <div className=\"Navbar\">\n <header className=\"Navbar-header\">\n <nav className=\"navbar navbar-expand-lg navbar-dark bg-dark\">\n <a className=\"navbar-brand\" href=\"/\">\n <img src={Logo} width=\"80\" height=\"70\" alt=\"\"></img>\n </a>\n <button className=\"navbar-toggler\" type=\"button\" data-toggle=\"collapse\" data-target=\"#navbarSupportedContent\" aria-controls=\"navbarSupportedContent\" aria-expanded=\"false\" aria-label=\"Toggle navigation\">\n <span className=\"navbar-toggler-icon\"></span>\n </button>\n\n <div className=\"collapse navbar-collapse\" id=\"navbarSupportedContent\">\n <ul className=\"navbar-nav mr-auto\">\n <li className=\"nav-item\">\n <a className=\"nav-link\" href=\"/\">Instructions <span className=\"sr-only\">(current)</span></a>\n </li>\n <li className=\"nav-item\">\n <a className=\"nav-link\" href=\"/analysis\">Analysis <span className=\"sr-only\">(current)</span></a>\n </li>\n <li className=\"nav-item\">\n <a className=\"nav-link\" href=\"/about\">About Twitter Lens <span className=\"sr-only\">(current)</span></a>\n </li>\n <li className=\"nav-item\">\n <a className=\"nav-link\" href=\"/team\">Dev Team <span className=\"sr-only\">(current)</span></a>\n </li>\n </ul>\n </div>\n </nav>\n </header>\n </div>\n );\n }", "render() {\n return (\n <div className=\"Menu\">\n <nav>\n <ul>\n <li><a href=\"#home\">Home</a></li>\n <li><a href=\"#services\">Services</a></li>\n <li><a href=\"#innovation\">Innovation</a></li>\n <li><a href=\"#guestbook\">Guestbook</a></li>\n </ul>\n </nav>\n </div>\n );\n }", "render() {\n return (\n <div>\n <ul className=\"navbar-nav mr-auto\">\n <li className=\"navbar-item\">\n <Button variant=\"contained\" color=\"primary\" href=\"/register\">Register</Button>\n </li>\n <br></br>\n <li className=\"navbar-item\">\n <Button variant=\"contained\" color=\"secondary\" href=\"/login\">Login</Button>\n </li> \n </ul>\n \n </div>\n )\n }", "render(){\n if(this.state.status===0){\n return null\n } else if(this.state.status===200){\nreturn (\n <div>\n <nav id=\"adminNavBar\">\n <NavLink to='/admin/users'>Users</NavLink>\n <NavLink to='/admin/orders'>Orders</NavLink>\n <NavLink to='/admin/products'>Products</NavLink>\n </nav>\n <Switch>\n <Route path='/admin/users' component = {UserManagement} />\n <Route path='/admin/orders' component = {OrderManagement} />\n <Route path='/admin/products' component = {ProductManagement} />\n </Switch>\n </div>\n)\n } else return <Redirect to =\"/\" />\n}", "function renderNavBar() {\n\t //if navBar, delete\n\t var oldNav = document.querySelector('.cat-nav-bar');\n\n\t if (oldNav) {\n\t oldNav.parentNode.removeChild(oldNav);\n\t }\n\n\t var newNavBar = createNavBar(cats);\n\n\t catHolderMaster.appendChild(newNavBar);\n\n\t}", "render() {\n return (\n <div className=\"App\">\n <header className=\"App-header\">\n <Header />\n </header>\n <Shelves/>\n {routes}\n </div>\n );\n }", "render() {\n return (\n <div id=\"navMenu\" className=\"o-navbar\">\n <NavList />\n\n <Search />\n </div>\n )\n }", "render() {\n return (\n <Router onExitApp={this.onExitApp}>\n <Stack key=\"root\">\n <Scene key=\"splash\" component={Splash} hideNavBar={true} initial />\n <Scene key=\"login\" component={Login} hideNavBar={true} />\n <Scene\n drawer\n overlay\n hideNavBar\n key=\"drawer\"\n contentComponent={SideMenu}\n drawerWidth={300}>\n <Scene overlay hideNavBar panHandlers={null}>\n <Scene overlay key=\"home\" component={Home} hideNavBar={true} />\n </Scene>\n </Scene>\n </Stack>\n </Router>\n );\n }", "render() {\n return (\n <div>\n <div>\n <nav className=\"navbar navbar-custom\">\n <div className=\"container-fluid\">\n <div className=\"navbar-header\">\n <a className=\"navbar-brand\" href=\"#\">\n SpringBoard LearningHub - one stop hub for all the learning paths\n </a>\n </div>\n </div>\n </nav>\n </div>\n <SearchBar />\n <div className=\"row\">\n <CourseList />\n <CourseDetail />\n </div>\n </div>\n );\n }", "function App() {\n return (\n <div className=\"App\">\n <Header/>\n {/* <Menu/> */}\n {routers}\n </div>\n );\n}", "render() {\n \n console.log(\"Navbar component - > render\");\n console.log(this.state);\n \n\n return (\n \n <React.Fragment>\n\n <nav className=\"nav flex-column\">\n\n {/* -------------- Go Home -------------- */}\n\n <NavLink \n to=\"/\"\n className={this.state.homePageSelected ? \n \"nav-link navbar-brand text-dark border-left border-danger cLeftRedBorder\" : \n \"nav-link navbar-brand text-secondary border-left border-white cLeftWhiteBorder\" \n }\n onClick={ () => this.handleNavigationSelection(\"home\") }\n >\n HOME\n </NavLink>\n\n\n {/* -------------- Go To Questions Page -------------- */}\n <NavLink \n to={{\n pathname: \"/questions\", \n state: { originPage: \"Navbar\" }\n }} \n className={this.state.questionPageSelected ? \n \"nav-link navbar-brand text-dark border-left border-danger cLeftRedBorder\" : \n \"nav-link navbar-brand text-secondary border-left border-white cLeftWhiteBorder\" \n }\n onClick={ () => this.handleNavigationSelection(\"questions\") }\n >\n Questions\n </NavLink>\n\n\n {/* -------------- Go To All Tags Page -------------- */}\n <NavLink \n to=\"/tags\" \n className={this.state.tagPageSelected ? \n \"nav-link navbar-brand text-dark border-left border-danger cLeftRedBorder\" : \n \"nav-link navbar-brand text-secondary border-left border-white cLeftWhiteBorder\" \n }\n onClick={ () => this.handleNavigationSelection(\"tags\") }\n >\n Tags\n </NavLink>\n\n\n {/* Go To All Users Page */}\n <NavLink \n to=\"/allusers\" \n className={this.state.userPageSelected ? \n \"nav-link navbar-brand text-dark border-left border-danger cLeftRedBorder\" : \n \"nav-link navbar-brand text-secondary border-left border-white cLeftWhiteBorder\" \n }\n onClick={ () => this.handleNavigationSelection(\"allusers\") }\n >\n Users\n </NavLink>\n\n\n {/* -------------- Go To Jobs Page -------------- */}\n <NavLink \n to={{\n pathname: \"/jobs\", \n state: { originPage: \"Navbar\" }\n }} \n className={this.state.jobsPageSelected ? \n \"nav-link navbar-brand text-dark border-left border-danger cLeftRedBorder\" : \n \"nav-link navbar-brand text-secondary border-left border-white cLeftWhiteBorder\" \n }\n onClick={ () => this.handleNavigationSelection(\"jobs\") }\n >\n Jobs\n </NavLink>\n\n\n </nav>\n\n </React.Fragment>\n )\n }", "render() {\n this.configPage();\n history.pushState({ href: '/first-entrance' }, null, '/first-entrance');\n this.wrapper.append(this.main);\n\n this.main.innerHTML = firstTemplate();\n\n document.querySelector('.icon-list').classList.add('active');\n\n this.attachListeners(this.main);\n }", "render() {\n console.log('rendering App');\n return (\n <div className=\"height-100 container-fluid no-padding\">\n <div className=\"row\">\n <Navbar userData={this.state} onLogout={this.onLogout} />\n </div>\n <div className=\"row height-100\">\n <Routes userData={this.state} logged_in={this.state.logged_in} onLogin={this.onLogin}/>\n </div>\n </div>\n );\n }", "render() {\n\t\treturn (\n\t\t\t<Collapse className=\"text-center\" navbar>\n\t\t\t\t<Nav navbar>\n\t\t\t\t\t<NavItem>\n\t\t\t\t\t\t<Button onClick = {this.handleLogOut} className=\"btn-nav mx-3\">\n\t\t\t\t\t\t\tLog Out\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</NavItem>\n\t\t\t\t</Nav>\n\t\t\t</Collapse>\n\t\t);\n\t}", "function NavBar () {\n return(\n <div>\n <nav id=\"navbar\" >\n <ul className=\"navbar-links\" >\n <Link to='/home' id=\"title\" style={{ textDecoration: 'none', color: 'black' }}>\n <li>PokeMars-Mart</li>\n </Link>\n <Link to='/items' style={{ textDecoration: 'none', color: 'black' }}>\n <li>Shop</li>\n </Link>\n <Link to='/users' style={{ textDecoration: 'none', color: 'black' }}>\n <li>Sign Up</li>\n </Link>\n <Link to='/users' style={{ textDecoration: 'none', color: 'black' }}>\n <li>Log In</li>\n </Link>\n <Link to='/items' style={{ textDecoration: 'none', color: 'black' }}>\n <li>Cart (0) <span class=\"fas fa-shopping-cart\"></span></li>\n </Link>\n </ul>\n </nav>\n </div>\n ) \n}", "render() {\n return (\n <div className=\"App\">\n\n <nav className=\"Navbar\">\n <h2>btf</h2>\n <ul>\n <li>\n <Link to=\"/about\">about</Link>\n </li>\n <li>\n <Link to=\"/projects\">projects</Link>\n </li>\n <li>\n <Link to=\"/contacts\">contacts</Link>\n </li>\n </ul>\n </nav>\n\n <Switch>\n <Route exact path=\"/\">\n <h1>Home</h1>\n </Route>\n <Route path=\"/about\">\n <h1>About</h1>\n </Route>\n <Route path=\"/projects\">\n <h1>Projects</h1>\n </Route>\n <Route path=\"/contacts\">\n <h1>Contacts</h1>\n </Route>\n\n </Switch>\n\n </div>\n );\n }", "function NavBar () {\n\n return ( \n <nav className=\"navigation-items\">\n <div>\n <h1 id=\"header\">Forager's Recipe Book</h1>\n </div>\n <Link to=\"/home\"><h2>Home🏡</h2></Link>\n <Link to=\"/addform\"><h3>Add to the Collection!</h3></Link>\n <Link to=\"/about\"><h3>About</h3></Link> \n </nav>\n );\n}", "function NewNavBar() {\n return (\n <div className='Navbar'>\n <div className='leftside'>\n <div className='links'>\n <a href='/'> Home </a>\n <a> About </a>\n <a> Feedback </a>\n <a> Contact </a>\n </div>\n </div>\n <div className='rightside'>\n <Button exact href='/login'> Login </Button>\n <Button exact href='/food-search'> Food Search </Button>\n </div>\n </div>\n );\n}", "function render() {\n // set routes with history\n const history = createBrowserHistory();\n let routes = getRoutes(history);\n\n // Render routes\n ReactDOM.render(routes, appContainer);\n}", "function App() {\n return (\n <div className=\"App container\">\n <BrowserRouter>\n <NavBar />\n <Routes />\n </BrowserRouter>\n </div>\n );\n}", "render() {\n return (\n <div>\n <header> \n <Navbar bg=\"dark\" variant=\"dark\"> \n <Nav className=\"mr-auto\">\n <Navbar.Brand href=\"/\">Xtra-Vision</Navbar.Brand> \n <Nav.Link href=\"/\"><Button variant=\"primary\">Home</Button></Nav.Link> \n </Nav> \n </Navbar> \n </header>\n </div>\n );\n }", "render() {\n if(this.props.user!=null){\n return (\n <div>\n <nav className=\"navbar navbar-default\">\n <ul className=\"NavBar\">\n <li className=\"Nav\"><Link to={'/home'}><img src=\"logo.png\" style={{width:'50px'}}/></Link></li>\n <li className=\"Nav\"><NavLink activeClassName='active' className = 'pages' to={'/map:'}>Games</NavLink></li>\n <li className=\"Nav\"><NavLink activeClassName='active' className = 'pages' to={'/teams:'}>Join Teams</NavLink></li>\n <li className=\"Nav\"><NavLink activeClassName='active' className = 'pages' to={'/teamgames:'}>Team Games</NavLink></li>\n\n <li className=\"Nav\"><NavLink activeClassName='active' className = 'pages' to={'/list_users'}>Users</NavLink></li>\n <ul>\n <li className=\"NavIcons\"><NavLink to={'/logout'} style={{color:'white'}} activeClassName='active' className = 'pages'>\n <span className=\"glyphicon glyphicon-log-in\" style={{color:'white'}}></span> Logout</NavLink></li>\n <li className=\"NavIcons\"><NavLink to={'/user:'+this.props.user} style={{color:'white'}} activeClassName='active' className = 'pages'>\n <span className=\"glyphicon glyphicon-user\" style={{color:'white'}}></span> Profile</NavLink></li>\n </ul>\n </ul>\n </nav>\n </div>\n )\n }\n else{\n return (\n <div>\n\n <nav className=\"navbar navbar-default\">\n <ul className=\"NavBar\">\n <li className=\"Nav\"><Link to={'/home'}><img src=\"logo.png\" style={{width:'50px'}}/></Link></li>\n <ul>\n <li className=\"NavIcons\"><NavLink to={'/signin'} style={{color:'white'}} activeClassName='active' className = 'pages'>\n <span className=\"glyphicon glyphicon-log-in\" style={{color:'white'}}></span> Signin</NavLink></li>\n <li className=\"NavIcons\"><NavLink to={'/signup'} style={{color:'white'}} activeClassName='active' className = 'pages'>\n <span className=\"glyphicon glyphicon-log-in\" style={{color:'white'}}></span> SignUp</NavLink></li>\n </ul>\n </ul>\n </nav>\n </div>\n )\n }\n }", "render() {\n return html`\n <nav class=\"nav\">\n <div class=\"toogle\">\n <vaadin-drawer-toggle></vaadin-drawer-toggle>\n <h2>Otolum</h2>\n </div>\n <div class=\"social\">\n <iron-icon icon=\"vaadin:grid-small\" @click=\"${this.messageOptions}\"></iron-icon>\n <iron-icon icon=\"vaadin:calc-book\" model-user=\"${this.user._id}\" @click=\"${this.goToMyList}\"></iron-icon>\n <iron-icon icon=\"vaadin:inbox\" @click=\"${this.exportList}\"></iron-icon>\n <h4>${this.user.name}</h4>\n </div>\n <vaadin-dialog id=\"dialog\"></vaadin-dialog>\n </nav>\n `;\n }", "function Nav() {\n return (\n\n <nav id=\"nav\" role=\"navigation\">\n <a href=\"#nav\" title=\"Show navigation\">Show navigation</a>\n <a href=\"#\" title=\"Hide navigation\">Hide navigation</a>\n\n <ul>\n <li>\n <Link to=\"/\">Home</Link>\n </li>\n <li>\n <a href=\"/\" aria-haspopup=\"true\"><span>Pages</span></a>\n <ul>\n <li><Link to=\"/overfishing\">Over Fishing</Link></li>\n <li><Link to=\"/pollution\">Pollution</Link></li>\n <li><Link to=\"/redtide\">Red Tide</Link></li>\n <li><Link to=\"/messageboard\">Message Board</Link></li>\n <li><Link to =\"/interactivegame\">Interactive Game</Link></li>\n \n </ul>\n </li>\n\n <li>\n <Link to=\"/flashCard\">Quiz</Link>\n </li>\n <li><Link to=\"/login\">Log In</Link></li>\n </ul>\n\n </nav>\n \n );\n\n}", "render(){ \n return (\n <section className=\"navigation schoger-border is-transparent\">\n <nav className=\"navbar is-white\">\n\n <div className=\"navbar-brand\" >\n <Link to='/' className=\"navbar-item\">\n <img src={logo} alt=\"intelliSound Logo\" height=\"60\"/>\n </Link>\n\n <div className=\"navbar-burger burger is-white\"\n data-target= \"Options\"\n onClick={(event) => this.handleToggleHamNav(event)} >\n <span></span>\n <span></span>\n <span></span>\n </div>\n </div>\n\n <div className=\"navbar-menu\" id='navbar-menu-id'>\n <div className=\"navbar-start\"></div>\n\n <div className=\"navbar-end\" id=\"Options\">\n <Link to=\"/\" className=\"navbar-item has-text-centered\">Home</Link>\n <Link to=\"/about\" className=\"navbar-item has-text-centered\">About Us</Link>\n\n </div>\n </div>\n\n <div className=\"navbar-item\"></div>\n\n </nav>\n </section>);\n }", "render() {\n\t\tif (this.state.loading) {\n\t\t\treturn <View style={styles.container}>\n\t\t\t\t\t<Text style={styles.Text}>Loading...</Text>\n\t\t\t\t\t</View>;\n\t\t}\n\t\treturn(\n\t\t\t<Router>\n\t\t\t <Stack key=\"root\" hideNavBar={true}>\n\t\t\t\t\t<Scene key=\"login\" component={Login} title=\"Login\" initial={!this.state.logged}/>\n\t\t\t <Scene key=\"signup\" component={Signup} title=\"Register\"/>\n\t\t\t\t\t<Scene key=\"home\" component={Home} title=\"HomePage\" initial={this.state.logged}/>\n\t\t\t\t\t<Scene key=\"profile\" component={Profile} title=\"ProfilePage\"/>\n\t\t\t\t\t<Scene key=\"usercalendar\" component={UserCalendar} title=\"UserCalendar\"/>\n\t\t\t\t\t<Scene key=\"notifications\" component={NotificationCenter} title=\"NotificationCenter\"/>\n\t\t\t\t\t<Scene key=\"creategroup\" component={CreateGroup} title=\"CreateGroup\"/>\n\t\t\t\t\t<Scene key=\"joingroup\" component={JoinGroup} title=\"JoinGroup\"/>\n\t\t\t\t\t<Scene key=\"groupprofile\" component={GroupProfile} title=\"GroupProfile\"/>\n\t\t\t\t\t<Scene key=\"createevent\" component={CreateEvent} title=\"CreateEvent\"/>\n\t\t\t\t\t<Scene key=\"suggestevent\" component={SuggestEvent} title=\"SuggestEvent\"/>\n\t\t\t\t\t<Scene key=\"setting\" component={Setting} title=\"SettingPage\"/>\n\t\t\t\t\t<Scene key=\"groupinformation\" component={GroupInformation} title=\"GroupInformation\"/>\n\t\t\t\t\t<Scene key=\"groupsummary\" component={GroupSummary} title=\"GroupSummary\"/>\n\t\t\t </Stack>\n\t\t\t</Router>\n\t\t\t);\n\t}", "renderMain()\n {\n if (this.state.registering)\n {\n return this.renderRegistration();\n }\n else if(!this.state.loggedin)\n {\n return this.renderLogIn();\n }\n else\n {\n return this.renderBrowser();\n }\n }", "getNavBar() {\n const studentLink = '#/student/' + currentUser.studentId;\n\n return (\n <Navbar>\n <Navbar.Header>\n <Navbar.Brand>\n <a href=\"#/home\">classcoder!</a>\n </Navbar.Brand>\n </Navbar.Header>\n <Nav>\n <NavItem eventKey={1} href={studentLink}>Student</NavItem>\n <NavItem eventKey={2} href=\"#/teacher\">Teacher</NavItem>\n </Nav>\n </Navbar>\n );\n }", "function navRouter(i) {\n if (i.text() === \"About\") {\n navAnimation('#0');\n showAbout();\n } else if (i.text() === \"Projects\") {\n navAnimation('#1');\n showProjects();\n } else {\n navAnimation('#2');\n showContactInfo();\n }\n toggleMenu();\n }", "render() {\n return (\n <div id=\"body\">\n <Header\n currentPage={this.state.currentPage}\n handleLink={this.handleLink}\n />\n <div>\n <Route exact path=\"/\">\n <HomeNav\n handleNavLink={this.handleNavLink}\n leaveHome={this.state.leaveHome}\n />\n </Route>\n <Route path=\"/about\">\n <About animationClass=\"animate-div-load\" />\n </Route>\n <Route path=\"/code\">\n <Code animationClass=\"animate-div-load\" />\n </Route>\n <Route path=\"/art\">\n <Art animationClass=\"animate-div-load\" />\n </Route>\n <Route path=\"/blog\">\n <Blog animationClass=\"animate-div-load\" />\n </Route>\n <Route path=\"/contact\">\n <Contact animationClass=\"animate-div-load\" />\n </Route>\n </div>\n </div>\n );\n }", "renderHomeLinks() {\n return (\n <div className='navContents'>\n {TokenServices.hasAuthToken() && <Nickname />}\n <div role=\"navigation\" className=\"burgerIcon\" id=\"burger\" onClick={this.burgerClick}> &#9776; </div>\n <ul aria-live=\"polite\" className=\"links null\" id=\"links\" onClick={this.burgerClick}>\n <li><Link to='/contacts'>Contacts</Link></li>\n <li><Link to='/alerts'>My Alerts</Link></li>\n <li><Link to='/delete-account'>Settings</Link></li>\n <li><Link onClick={this.signOut} to='/auth/login' >Log Out</Link></li>\n </ul>\n </div>\n )\n }", "render() {\n return(\n <div className=\"nav-div\">\n <div className=\"nav-box\">\n Stats\n </div>\n <div className=\"nav-roster\">\n Saved Rosters\n </div>\n <div className=\"nav-box\">\n Welcome, Username\n <div>Log out</div> \n </div>\n </div>\n )\n }", "render() {\n return (\n <div className=\"App\" id=\"App\">\n <SiteNav\n loggedIn={this.state.loggedIn}\n handleLogOut={this.handleLogOut}\n />\n <Router>\n <Container className=\"padded-top\">\n {!this.state.loggedIn ? (//dep[ending if the user loggs in display login page or user home.]\n <Route\n path=\"/\"\n exact\n component={() => <LoginPage handleLoggin={this.handleLogin} />}\n />\n ) : (\n <Route path=\"/\" exact component={() => <UserHome/>} />\n )}\n <Route path=\"/CreateAccount\" exact component={CreateAccount} />\n </Container>\n </Router>\n </div>\n );\n }", "async start() {\n // Navbar in header\n this.navbar = new Navbar();\n this.navbar.render('header');\n\n // Footer renderin\n this.footer = new Footer();\n this.footer.render('footer');\n\n this.myFavorites = new Favorites();\n\n setTimeout(() => {\n this.router = new Router(this.myFavorites);\n }, 0)\n }", "function Navbar () {\n return (\n <nav id=\"navbar\" className=\"navbar navbar-expand-lg bg-dark navbar-dark justify-content-between\">\n <div id=\"navbar-logo-container\">\n <img id=\"navbar-logo\" src={require('../images/thinking.svg')} alt=\"Logo\"/>\n <span id=\"navbar-title\">PIX2PIX</span>\n </div>\n {/*\n <div id=\"navbar-buttons-wrapper\">\n <button id=\"navbar-about\" href=\"#\">\n <span>ABOUT</span>\n </button>\n <button id=\"navbar-create\" href=\"#\">\n <span>CREATE</span>\n </button>\n </div>\n */}\n </nav>\n )\n}", "setupNav() {\n this.router.on({}, () => {\n $('iframe').one('load', function() {\n this.style.height = (document.body.offsetHeight - \n $('iframe').offset().top) + \"px\";\n $('body').css('overflow-y', 'hidden');\n });\n });\n this.router.on({'page': 'quiz1'}, () => {\n this.changePage('https://docs.google.com/forms/d/e/1FAIpQLSdKVApwuQjnD3auoJI8ESKtfS-w6PlCptSHTbkxNGyPH1Iv6A/viewform?usp=sf_link');\n });\n this.router.on({'page': 'quiz2'}, () => {\n this.changePage('https://docs.google.com/forms/d/e/1FAIpQLSdt06Q9VWQHuVUZCfk0fnhMb6InsBAcI3bDrFXcKiSmiqgNvA/viewform?usp=sf_link');\n });\n this.router.on({'page': 'module1'}, () => {\n this.changePage('module1.html');\n });\n this.router.on({'page': 'module2'}, () => {\n this.changePage('module2.html');\n });\n this.router.on({'page': 'module3'}, () => {\n this.changePage('module3.html');\n });\n }", "function render(){\n var state = store.getState();\n\n console.log(state);\n\n\n root.innerHTML = `\n ${Navigation(state[state.active])}\n ${Header(state)}\n ${Content(state)}\n ${Footer(state)}\n `;\n greeter.render(root);\n \n document\n .querySelector('h1')\n .addEventListener('click', (event) => {\n var animation = tween({\n 'from': {\n 'color': '#fff100',\n 'fontSize': '100%'\n },\n 'to': {\n 'color': '#fff000',\n 'fontSize': '200%'\n },\n 'duration': 750\n });\n \n var title = styler(event.target);\n \n animation.start((value) => title.set(value));\n });\n \n router.updatePageLinks();\n}", "function App() {\n const TDC_GREEK = React.createElement(\n \"span\",\n null,\n \"\\u0398\\u0394\\u03A7\"\n );\n return React.createElement(\n \"div\",\n null,\n React.createElement(\n \"nav\",\n { className: \"nav-bar\" },\n React.createElement(\n \"li\",\n null,\n React.createElement(\n \"span\",\n { className: \"nav-bar-item nav-bar-item-tdc\", onClick: () => Aviator.navigate(\"/\") },\n React.createElement(\n \"a\",\n { className: \"nav-bar-link\" },\n TDC_GREEK || \"TDC\"\n )\n )\n ),\n React.createElement(\n \"li\",\n null,\n React.createElement(\n \"span\",\n { className: \"nav-bar-item\", onClick: () => Aviator.navigate(\"/rush/events\") },\n React.createElement(\n \"a\",\n { className: \"nav-bar-link\" },\n \"Events\"\n )\n )\n ),\n React.createElement(\n \"li\",\n null,\n React.createElement(\n \"span\",\n { className: \"nav-bar-item\" },\n React.createElement(\n \"a\",\n {\n className: \"nav-bar-link\",\n href: \"mailto:tdc-brothers@mit.edu?subject=[TDC%20Rush%202018]%20\" },\n \"Contact Us\"\n )\n )\n )\n ),\n React.createElement(\n \"div\",\n { id: \"content\" },\n \"Content will be added here.\"\n ),\n React.createElement(Footer, null)\n );\n}", "function App () {\n return (\n <Router>\n <div className='navbar'>\n <NavLink to=\"/\">\n\t\t\t\t\t\tInicio\n\t\t\t\t\t</NavLink>\n\t\t\t\t\t<NavLink exact to=\"/ThemeOrder\" >\n\t\t\t\t\t\tOrden\n\t\t\t\t\t</NavLink>\n\t\t\t\t\t<NavLink exact to=\"/themekitchen\">\n\t\t\t\t\t\tCocina\n\t\t\t\t\t</NavLink>\n\n </div>\n <Route exact path=\"/\" component={ ThemeHome } />\n <Route path=\"/themeorder\" component={ ThemeOrder } />\n <Route path=\"/themekitchen\" component={ ThemeKitchen } />\n </Router>\n );\n \n }", "render() {\n const title = this.props.intl.formatMessage({id:\"global.test\"});\n return (\n <Layout ref=\"componentNode\">\n <Header title={title}>\n <div className=\"mdl-layout-spacer\"></div>\n <LogoutButton />\n </Header>\n \n <Drawer title=\"Links\">\n <a className=\"mdl-navigation__link\" href=\"/nodes\">Nodes</a>\n <a className=\"mdl-navigation__link\" href=\"/livesearch\">LiveSearch</a>\n <a className=\"mdl-navigation__link\" href=\"/users\">Users</a>\n <a className=\"mdl-navigation__link\" href=\"/filmstrip\">Filmstrip</a>\n <a className=\"mdl-navigation__link\" href=\"/sites\">Sites</a>\n <a className=\"mdl-navigation__link\" href=\"/tags\">Tags</a>\n <a className=\"mdl-navigation__link\" href=\"/search\">Search</a>\n </Drawer>\n\n {this.props.children}\n </Layout>\n )\n }", "render() {\n return (\n <div>\n <StandardNavBar />\n <WallPostList />\n <Footer />\n </div>\n )\n }", "render() {\n\t\treturn (\n\t\t\t<div className=\"container\">\n\t\t\t\t<BrowserRouter>\n\t\t\t\t\t<div className=\"container\">\n\t\t\t\t\t\t<Header />\n\t\t\t\t\t\t<Route exact path=\"/\" component={Landing} />\n\t\t\t\t\t\t<Route exact path=\"/surveys\" component={Dashboard} />\n\t\t\t\t\t\t<Route path=\"/surveys/new\" component={SurveyNew} />\n\t\t\t\t\t</div>\n\t\t\t\t</BrowserRouter>\n\t\t\t</div>\n\t\t);\n\t}", "render() {\n let desktopString = 'nav ' + this.state.navSize + ' ' + this.state.screenUnit;\n return (\n <div className={desktopString}>\n <div className=\"NavHeader\">\n <a className=\"sharelink\" href=\"https://www.facebook.com/InnerChampion\"/>\n <Link to=\"main\">Main</Link>\n <Link to=\"train\">Train</Link>\n <Link to=\"dominate\">Dominate</Link>\n <Link to=\"dev\">Development</Link>\n <Link to=\"videos\">Videos</Link>\n <Link to=\"shadow\">Shadow Boxing</Link>\n </div>\n\n {/* this is the important part */}\n\n <RouteHandler/>\n </div>\n );\n }", "static nav(to) {\n console.log(\"main nav to: \" + to)\n $.get(to, function (pageContent) {\n $('.content').html(pageContent);\n }).fail(HTMLHandler.failedGet)\n }", "render() {\n let trans;\n let navbarStyle;\n let navbarContent;\n\n if (this.props.currentRoute.trans) {\n trans = { backgroundColor: 'transparent' };\n } else {\n trans = {};\n }\n\n if (this.props.currentRoute.hideNavigationBar) {\n navbarStyle = styles.navbarContainerHidden;\n } else {\n navbarStyle = styles.navbarContainer;\n }\n\n if (this.props.currentRoute.trans) {\n navbarContent = (\n <NavBarContent\n route={this.state.previousRoute}\n backButtonComponent={this.props.backButtonComponent}\n rightCorner={this.props.rightCorner}\n titleStyle={this.props.titleStyle}\n willDisappear\n borderBottomWidth={this.props.borderBottomWidth}\n borderColor={this.props.borderColor}\n goBack={this.goBack}\n goForward={this.goForward}\n replaceRoute={this.replaceRoute}\n resetToRoute={this.resetToRoute}\n goToFirstRoute={this.goToFirstRoute}\n leftProps={this.props.leftProps}\n rightProps={this.props.rightProps}\n titleProps={this.props.titleProps}\n customAction={this.customAction}\n />\n );\n } else {\n navbarContent = (\n <NavBarContent\n route={this.props.currentRoute}\n backButtonComponent={this.props.backButtonComponent}\n rightCorner={this.props.rightCorner}\n titleStyle={this.props.titleStyle}\n borderBottomWidth={this.props.borderBottomWidth}\n borderColor={this.props.borderColor}\n goBack={this.goBack}\n goForward={this.goForward}\n replaceRoute={this.replaceRoute}\n resetToRoute={this.resetToRoute}\n goToFirstRoute={this.goToFirstRoute}\n leftProps={this.props.leftProps}\n rightProps={this.props.rightProps}\n titleProps={this.props.titleProps}\n customAction={this.customAction}\n />\n );\n }\n\n return (\n <View style={[navbarStyle, this.props.style, trans]}>\n {navbarContent}\n </View>\n );\n }", "render() {\n var logButton;\n var changePasswordButton;\n if (AuthenticationService.isLoggedIn()) {\n logButton =\n <SirioButton\n blue\n recommended\n circular\n classes={classes.footerButton}\n onClick={() => window.location.href = logout.link}\n >\n {logout.title}\n </SirioButton>;\n changePasswordButton =\n <SirioButton\n purple\n circular\n classes={classes.footerButton2}\n onClick={() => window.location.href = changePassword.link}\n >\n {changePassword.title}\n </SirioButton>\n } else {\n logButton =\n <SirioButton\n blue\n recommended\n circular\n classes={classes.footerButton}\n onClick={() => window.location.href = login.link}\n >\n {login.title}\n </SirioButton>\n }\n\n var className = [this.props.classes, classes.sidebar].join(\" \");\n if (this.props.shouldShow) {\n className = [className, classes.show].join(\" \");\n }\n return (\n <>\n <nav className={className}>\n <LogoTag light />\n <div className={classes.identity}>\n <h3 className={classes.username}>\n {this.state.username}\n </h3>\n <p className={classes.role}>\n {this.state.role}\n </p>\n </div>\n <div className={classes.navigationContainer}>\n {this.props.links.map((menu, i) =>\n menu.dropdown ?\n <SirioDropdown\n key={i}\n headerClass={classes.clickableNavigation}\n headerTitle={menu.title}\n activeClass={classes.active}\n menuClass={classes.dropdownMenu}\n >\n {menu.dropdown.map((item, i) =>\n <SirioDropdownItem\n key={i}\n classes={classes.dropdownItem}\n onClick={(object) => window.location.href = object}\n clickArgument={item.link}\n >\n {item.title}\n </SirioDropdownItem>\n )}\n </SirioDropdown>\n :\n <NavLink to={menu.link} key={i} exact={menu.exact} activeClassName={classes.active} className={classes.clickableNavigation}>\n {menu.title}\n </NavLink>\n )}\n </div>\n <div className={classes.sideFooter}>\n <div className={classes.footerButtonContainer}>\n {changePasswordButton}\n {logButton}\n </div>\n </div>\n {!this.props.noToggle &&\n <SirioButton\n blue\n recommended\n classes=\"m-2\"\n onClick={() => { this.toggleNav() }}>\n Tutup Menu\n </SirioButton>\n }\n </nav>\n </>\n );\n }", "render(){\t\t\n\t\treturn (\n\t\t<main><Switch>\n\t\t\t<Route exact path='/' render={() => (<div>home</div>)} />\n\t\t\t<Route path='/test' render={() => (<div>test</div>)} />\n\t\t\t<Redirect to='/' from='/test2' />\n\t\t</Switch></main>\n\t\t);\n\t}", "render()\n\t{\n\t\treturn (\n\t\t\t <Router>\n\t\t\t\t <Switch>\n\t\t\t\t\t <Route path=\"/Search\">\n\t\t\t\t\t\t <Header/>\n\t\t\t\t\t\t <Search loggedin={this.state.loggedin}/>\n\t\t\t\t\t </Route>\n\t\t\t\t\t <Route path=\"/LogIn\"> \n\t\t\t\t\t\t <Header/>\n\t\t\t\t\t\t <LogInApp handle_login={this.handle_login}/> \n\t\t\t\t\t </Route>\n\t\t\t\t\t <Route path=\"/LogOut\"> \n\t\t\t\t\t\t <Header/>\n\t\t\t\t\t\t <LogOutApp handle_logout={this.handle_logout}/> \n\t\t\t\t\t </Route>\n\t\t\t\t\t <Route path=\"/\">\n\t\t\t\t\t\t <Header/>\n\t\t\t\t\t\t <Home/>\n\t\t\t\t\t </Route>\n\t\t\t\t </Switch>\n\t\t\t </Router>\n\t\t);\n\t}", "function Navigation() {\n return (\n <nav className=\"main-nav\">\n <ul>\n <li>{/*<NavLink to=\"/cars\">Cars</NavLink>*/}</li>\n </ul>\n </nav>\n );\n}", "function Navbar() {\n return (\n <Container className=\"nav-colors\" fluid>\n <Container>\n <nav className=\"navbar navbar-expand-lg\">\n <Link className=\"navbar-brand page-name-heading\" to=\"/\">\n Noah Miller\n </Link>\n <div>\n <ul className=\"navbar-nav\">\n <li className=\"nav-item\">\n <NavLink pathname=\"/\">\n Home\n </NavLink>\n </li>\n <li className=\"nav-item\">\n <NavLink pathname=\"/contact\">\n Contact Me\n </NavLink>\n </li>\n <li className=\"nav-item\">\n <NavLink pathname=\"/portfolio\">\n Portfolio\n </NavLink>\n </li>\n </ul>\n </div>\n </nav>\n </Container>\n </Container>\n );\n}", "render() {\r\n\t\treturn (\r\n\t\t\t<div className=\"Home\">\r\n\t\t\t{this.props.isAuthenticated ? this.renderUser() : this.renderLander()}\r\n\t\t\t</div>\r\n\t\t);\r\n\t}", "render() {\n\t\tconst basename = process.env.BASENAME || \"\";\n\t\treturn (\n\t\t\t<div className=\"d-flex flex-column h-100\">\n\t\t\t\t<BrowserRouter basename={basename}>\n\t\t\t\t\t<ScrollToTop>\n\t\t\t\t\t\t<Navbar />\n\t\t\t\t\t\t<Switch>\n\t\t\t\t\t\t\t<Route exact path=\"/\" component={Home} />\n\t\t\t\t\t\t\t<Route exact path=\"/home\" component={Home} />\n\t\t\t\t\t\t\t<Route exact path=\"/planets\" component={PlanetHome} />\n\t\t\t\t\t\t\t<Route exact path=\"/characters\" component={CharacterHome} />\n\t\t\t\t\t\t\t<Route exact path=\"/planetdetails/:id\" component={PlanetDetails} />\n\t\t\t\t\t\t\t<Route exact path=\"/characterdetails/:id\" component={CharacterDetails} />\n\t\t\t\t\t\t</Switch>\n\t\t\t\t\t\t<Footer />\n\t\t\t\t\t</ScrollToTop>\n\t\t\t\t</BrowserRouter>\n\t\t\t</div>\n\t\t);\n\t}", "render() {\n return (\n <Navbar>\n <Navbar.Header>\n <Navbar.Brand>\n <a href=\"/\">{t(\"Учет УСН 6%\")}</a>\n </Navbar.Brand>\n </Navbar.Header>\n <Nav>\n <NavItem eventKey={1} href=\"/#incomes\" style={this.props.setStyle('income')}>\n {t(\"Доходы\")}\n </NavItem>\n <NavItem eventKey={2} href=\"/#spendings\" style={this.props.setStyle('spending')}>\n {t(\"Расходы\")}\n </NavItem>\n <NavItem eventKey={3} href=\"/#reports\" style={this.props.setStyle('report')}>\n {t(\"Отчеты\")}\n </NavItem>\n <NavItem eventKey={4} href=\"/#companies\" style={this.props.setStyle('company')}>\n {t(\"Организации\")}\n </NavItem>\n <NavItem eventKey={5} href=\"/#accounts\" style={this.props.setStyle('account')}>\n {t(\"Банковские счета\")}\n </NavItem>\n <NavItem eventKey={6} onClick={() => this.props.logout()}>{t(\"Выход\")}</NavItem>\n </Nav>\n </Navbar>\n )\n }", "function Navbar() {\n return (\n <Nav>\n <NavLink to='/' >\n <img src={logo} alt=\"logo\"/>\n </NavLink>\n <NavLink className=\"link\" to=\"/\">\n <h1>Moviedb</h1> \n </NavLink>\n </Nav>\n )\n}", "function RouterLink ({ to, children }) {\n // use activeStyle from bootstrap.css of your theme\n // search for: .navbar-default .navbar-nav > .active > a,\n return (\n <li>\n <NavLink to={to} activeStyle={{ color: '#d9230f' }}>{children}</NavLink>\n </li>\n );\n}", "function NavBar(props) {\n\treturn (\n\t\t\n\t\t <div class=\"x-navbar-wrap\">\n\t\t <div class=\"x-navbar\">\n\t\t <div class=\"x-navbar-inner\">\n\t\t <div class=\"x-container max width\"> \n\t\t\t\t\t<h1 class=\"visually-hidden\">Coded.</h1>\n\t\t\t\t\t<a href=\"http://www.joincoded.com/\" class=\"x-brand img\" title=\"Code Education\">\n\t\t\t\t\t <img src=\"//www.joincoded.com/wp-content/uploads/2017/10/codedlogo.png\" alt=\"Code Education\"/>\n\t\t\t\t\t </a> \n\t\t\t\t\t<a href=\"#\" id=\"x-btn-navbar\" class=\"x-btn-navbar collapsed\" data-x-toggle=\"collapse-b\" data-x-toggleable=\"x-nav-wrap-mobile\" aria-selected=\"false\" aria-expanded=\"false\" aria-controls=\"x-widgetbar\">\n\t\t\t\t\t <i class=\"x-icon-bars\" data-x-icon=\"&#xf0c9;\"></i>\n\t\t\t\t\t <span class=\"visually-hidden\">Navigation</span>\n\t\t\t\t\t</a>\n\n\t\t\t\t\t<nav class=\"x-nav-wrap desktop\" role=\"navigation\">\n\t\t\t\t\t <ul id=\"menu-menu\" class=\"x-nav\">\n\t\t\t\t\t <li id=\"menu-item-170\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-home menu-item-170\">\n\t\t\t\t\t <a href=\"http://www.joincoded.com/\">\n\t\t\t\t\t <span>Home</span></a></li>\n\t\t\t\t\t<li id=\"menu-item-3874\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-3874\">\n\t\t\t\t\t<a><span>Bootcamps</span></a>\n\t\t\t\t\t<ul class=\"sub-menu\">\n\t\t\t\t\t\t<li id=\"menu-item-3907\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-3907\">\n\t\t\t\t\t\t<a href=\"http://www.joincoded.com/full-stack-bootcamp/\">\n\t\t\t\t\t\t<span>Full-Stack Bootcamp</span></a></li>\n\t\t\t\t\t</ul>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li id=\"menu-item-3503\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-3503\">\n\t\t\t\t\t<a href=\"http://www.joincoded.com/student-stories/\">\n\t\t\t\t\t<span>Student Stories</span></a></li>\n\t\t\t\t\t<li id=\"menu-item-3965\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-3965\">\n\t\t\t\t\t<a href=\"#\">\n\t\t\t\t\t<span>Apply</span></a>\n\t\t\t\t\t<ul class=\"sub-menu\">\n\t\t\t\t\t\t<li id=\"menu-item-2191\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-2191\">\n\t\t\t\t\t\t<a href=\"http://www.joincoded.com/apply/\">\n\t\t\t\t\t\t<span>Apply for the Full-Stack Bootcamp</span></a></li>\n\t\t\t\t\t</ul>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li id=\"menu-item-529\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-529\">\n\t\t\t\t\t<a href=\"http://www.joincoded.com/contact-us/\">\n\t\t\t\t\t<span>Contact Us</span></a></li>\n\t\t\t\t\t<li id=\"menu-item-1193\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-has-children menu-item-1193\">\n\t\t\t\t\t<a href=\"http://www.joincoded.com/blog/\">\n\t\t\t\t\t<span>Blog</span></a>\n\t\t\t\t\t<ul class=\"sub-menu\">\n\t\t\t\t\t\t<li id=\"menu-item-1195\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-1195 tax-item tax-item-71\">\n\t\t\t\t\t\t<a href=\"http://www.joincoded.com/category/news/\">\n\t\t\t\t\t\t<span>News</span></a></li>\n\t\t\t\t\t\t<li id=\"menu-item-1194\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-1194 tax-item tax-item-69\">\n\t\t\t\t\t\t<a href=\"http://www.joincoded.com/category/the-student-experience/\">\n\t\t\t\t\t\t<span>The Student Experience</span></a></li>\n\t\t\t\t\t\t<li id=\"menu-item-1817\" class=\"menu-item menu-item-type-taxonomy menu-item-object-category menu-item-1817 tax-item tax-item-127\">\n\t\t\t\t\t\t<a href=\"http://www.joincoded.com/category/resources/\">\n\t\t\t\t\t\t<span>Coding Resources</span></a></li>\n\t\t\t\t\t</ul>\n\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t\t</nav>\n\n\t\t\t\t\t\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\n );\n}", "function render(st = state.Home) {\n\n /**\n * Developer's Note: Since state.Links is static,\n * there is no reason to pass it in each time.\n *\n * Instead, 'Nav' can import 'Links' directly.\n */\n document.querySelector(\"#root\").innerHTML = `\n ${Header(st)}\n ${Nav()}\n ${Main()}\n ${Footer()}\n`;\n}", "render() {\n return (\n <Navbar dark expand=\"md\" fixed=\"top\" >\n <NavbarToggler onClick={this.toggleNav} />\n <NavbarBrand className=\"mr-auto\" href=\"/jeopardy/\"><img className='logo' src='./assets/images/logo.png' alt='Jeopardy!' /></NavbarBrand>\n <Collapse isOpen={this.state.isNavOpen} navbar>\n <Nav navbar>\n <NavItem>\n <NavLink className=\"nav-link\" to='/search'><span className=\"fa fa-search fa-lg\"></span> Search</NavLink>\n </NavItem>\n <NavItem>\n <NavLink className=\"nav-link\" to='/play'><span className=\"fa fa-gamepad fa-lg\"></span> Play</NavLink>\n </NavItem>\n </Nav>\n </Collapse>\n </Navbar>\n );\n }", "render() {\n if(this.props.isSignedIn) {\n return (\n <div className=\"wrapper\">\n <Header></Header>\n <Menu></Menu>\n <ContentWrapper></ContentWrapper> {/* knote: since all routes needs to be at one place \n and we dont want to add \"common\" components to each of them, all these are defined \n under this component */}\n <SidebarContent></SidebarContent>\n <Footer></Footer>\n </div>\n )\n } else {\n return ( <div></div>)\n }\n }", "render() {\n\t\t// Redirects\n\t\tif (this.state.redirect) {\n\t\t\treturn (\n\t\t\t\t<Redirect to={{\n\t\t\t\t\tpathname: this.state.redirectTo,\n\t\t\t\t}} />\n\t\t\t)\n\t\t}\n\n\t\treturn (\n\t\t\t<div className=\"menu-background\">\n\t\t\t\t<div className='App'>\n\t\t\t\t\t<h2>Ylläpitäjän sivu</h2>\n\t\t\t\t\t<Link to='/'>\n\t\t\t\t\t\t<button className=\"gobackbutton\">Takaisin</button>\n\t\t\t\t\t</Link>\n\t\t\t\t\t<div id='adminButtons' className='btn-group'>\n\t\t\t\t\t\t<Row className=\"show-grid\">\n\t\t\t\t\t\t\t<Col>\n\t\t\t\t\t\t\t\t<button className=\"menu-button\" id=\"boneList\" onClick={this.proceed}>\n\t\t\t\t\t\t\t\t\tLuut\n \t\t</button>\n\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t</Row>\n\t\t\t\t\t\t<Row className=\"show-grid\">\n\t\t\t\t\t\t\t<Col>\n\t\t\t\t\t\t\t\t<button className=\"menu-button\" id=\"userList\" onClick={this.proceed}>\n\t\t\t\t\t\t\t\t\tKäyttäjät\n \t\t</button>\n\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t</Row>\n\t\t\t\t\t\t<Row className=\"show-grid\">\n\t\t\t\t\t\t\t<Col>\n\t\t\t\t\t\t\t\t<button className=\"menu-button\" id=\"adminStatistics\" onClick={this.proceed}>\n\t\t\t\t\t\t\t\t\tStatistiikka\n \t\t</button>\n\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t</Row>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t)\n\t}" ]
[ "0.7131257", "0.6949598", "0.6890401", "0.6795282", "0.6753324", "0.66977024", "0.66841215", "0.66377985", "0.66354483", "0.659705", "0.6556771", "0.6547306", "0.6521401", "0.6480799", "0.64574564", "0.6456046", "0.6451004", "0.64009005", "0.63923085", "0.63918185", "0.6390132", "0.6376496", "0.6373428", "0.6367148", "0.6345503", "0.6342425", "0.63318145", "0.62779427", "0.6277479", "0.6271764", "0.62690276", "0.62686133", "0.62677103", "0.62667865", "0.62655395", "0.62592083", "0.6256348", "0.6252729", "0.6238602", "0.6235867", "0.62142843", "0.6213541", "0.61970294", "0.61925995", "0.6187441", "0.6183562", "0.6171116", "0.6167235", "0.6166982", "0.61609566", "0.6147782", "0.61426437", "0.6135916", "0.6129189", "0.6114064", "0.6103845", "0.6081588", "0.60780036", "0.607416", "0.6073757", "0.60718733", "0.6069494", "0.60686266", "0.606596", "0.60647106", "0.60423505", "0.6019037", "0.60184425", "0.601618", "0.6015691", "0.60136485", "0.60128456", "0.60034", "0.59986377", "0.5992961", "0.5989849", "0.5984654", "0.59763664", "0.5964739", "0.5963591", "0.59607935", "0.595552", "0.5952942", "0.5942455", "0.59380245", "0.5930418", "0.59296894", "0.5926883", "0.5925967", "0.5920838", "0.5919718", "0.59193087", "0.591834", "0.5914711", "0.59122425", "0.5897879", "0.58971715", "0.58910066", "0.5885796", "0.588463", "0.5874316" ]
0.0
-1
Exibi o ano atual no elemento jsdate
function currentDate() { var date = new Date(); jQuery("#js-date").html(date.getFullYear()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function masqueSaisieDate(obj) {\n\n var ch = obj.value;\n var ch_gauche, ch_droite;\n obj.value = ch.slice(0, 10);\n ch.toString();\n if (((ch.slice(2, 3)) !== (\"/\")) && (ch.length >= 3)) {\n if (ch.slice(0, 2) > 31) {\n ch_gauche = '31';\n } else {\n ch_gauche = ch.slice(0, 2);\n }\n ch_droite = ch.slice(2);\n obj.value = ch_gauche + \"/\" + ch_droite;\n }\n if (((ch.slice(5, 6)) !== (\"/\")) && (ch.length >= 6)) {\n if (ch.slice(3, 5) > 12) {\n ch_gauche = ch.slice(0, 3) + '12';\n } else {\n ch_gauche = ch.slice(0, 5);\n }\n ch_droite = ch.slice(5);\n obj.value = ch_gauche + \"/\" + ch_droite;\n }\n return;\n}", "function jsDate(date, time) {\n const jsDate = reFormatDate(date);\n const jsTime = reFormatTime(time);\n var jsDateObj = `${jsDate} ${jsTime}`;\n return jsDateObj;\n }", "function formatJS2MySQLDate(js_date) {\n\n var year = js_date.getFullYear();\n var month = js_date.getMonth() + 1;\n var day = js_date.getDate();\n\n var monthStr = month;\n if (month < 10) {\n monthStr = '0' + monthStr;\n }\n\n var dayStr = day;\n if (day < 10) {\n dayStr = '0' + dayStr;\n }\n\n return year + '-' + monthStr + '-' + dayStr;\n }", "function pDateValue(gdate) {\r\n //debugger;\r\n var jsDate = getJsDate(gdate);\r\n \r\n //var d = gdate.split('T')[0].split('-');\r\n // var h = gdate.split('T')[0].split(':')[0];\r\n var jd = $.calendars.instance('gregorian').newDate(jsDate.getUTCFullYear(),jsDate.getUTCMonth() + 1 , jsDate.getUTCDate()).toJD();\r\n var date = $.calendars.instance('persian').fromJD(jd);\r\n return date.formatYear() + \"/\" + date.month() + \"/\" + (date.day()) + \" \" + date.calendar().regionalOptions['fa'].dayNames[date.dayOfWeek()];\r\n}", "function DateElement () {}", "function formatMySQL2JSDate(mysql_date) {\n\n var t, result = null;\n\n if (typeof mysql_date === 'string')\n {\n t = mysql_date.split(/[- :]/);\n\n //when t[3], t[4] and t[5] are missing they defaults to zero\n result = new Date(t[0], t[1] - 1, t[2], t[3] || 0, t[4] || 0, t[5] || 0);\n }\n\n return result;\n }", "function calcola_jdUT0(){\n\n // funzione per il calcolo del giorno giuliano per l'ora 0 di oggi in T.U.\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) giugno 2010.\n // restituisce il valore numerico dataGiuliana.\n \n \n var data=new Date();\n\n var anno = data.getYear(); // anno\n var mese = data.getMonth(); // mese 0 a 11 \n var giorno= data.getDate(); // numero del giorno da 1 a 31\n var ora = 0; // ora del giorno da 0 a 23 in T.U.\n var minuti= 0; // minuti da 0 a 59\n var secondi=0; // secondi da 0 a 59\n \n mese =mese+1;\n\nif (anno<1900) {anno=anno+1900;} // correzione anno per il browser.\n\nvar dataGiuliana=costanti_jd(giorno,mese,anno,ora,minuti,secondi);\n\n dataGiuliana=dataGiuliana*1 // definire come valore numerico.\n\nreturn dataGiuliana; // restituisce il giorno giuliano\n\n}", "function date(){\n return ;\n }", "function gSdate() {\n\n var object;\n if (arguments.length==1) {\n object = new Date(arguments[0]);\n } else {\n object = new Date();\n }\n\n gScreateClassNames(object,['java.util.Date']);\n\n object.time = object.getTime();\n\n object.year = object.getFullYear();\n object.month = object.getMonth();\n object.date = object.getDay();\n object.plus = function(other) {\n if (typeof other == 'number') {\n var a = gSdate(this.time+(other*1440000));\n return a;\n } else {\n return this + other;\n }\n }\n object.minus = function(other) {\n if (typeof other == 'number') {\n var a = gSdate(this.time-(other*1440000));\n return a;\n } else {\n return this + other;\n }\n }\n object.format = function(rule) {\n //TODO complete\n var exit = '';\n if (rule) {\n exit = rule;\n exit = exit.replaceAll('yyyy',this.getFullYear());\n exit = exit.replaceAll('MM',gSfillZerosLeft(this.getMonth()+1,2));\n exit = exit.replaceAll('dd',gSfillZerosLeft(this.getUTCDate(),2));\n exit = exit.replaceAll('HH',gSfillZerosLeft(this.getHours(),2));\n exit = exit.replaceAll('mm',gSfillZerosLeft(this.getMinutes(),2));\n exit = exit.replaceAll('ss',gSfillZerosLeft(this.getSeconds(),2));\n exit = exit.replaceAll('yy',gSlastChars(this.getFullYear(),2));\n }\n return exit;\n }\n object.parse = function(rule,text) {\n //TODO complete\n var pos = rule.indexOf('yyyy');\n if (pos>=0) {\n this.setFullYear(text.substr(pos,4));\n } else {\n pos = rule.indexOf('yy');\n if (pos>=0) {\n this.setFullYear(text.substr(pos,2));\n }\n }\n pos = rule.indexOf('MM');\n if (pos>=0) {\n this.setMonth(text.substr(pos,2)-1);\n }\n pos = rule.indexOf('dd');\n if (pos>=0) {\n this.setUTCDate(text.substr(pos,2));\n }\n pos = rule.indexOf('HH');\n if (pos>=0) {\n this.setHours(text.substr(pos,2));\n }\n pos = rule.indexOf('mm');\n if (pos>=0) {\n this.setMinutes(text.substr(pos,2));\n }\n pos = rule.indexOf('ss');\n if (pos>=0) {\n this.setSeconds(text.substr(pos,2));\n }\n return this;\n }\n\n return object;\n}", "function convertionDate(daty)\n { \n var date_final = null; \n if(daty!='Invalid Date' && daty!='' && daty!=null)\n {\n console.log(daty);\n var date = new Date(daty);\n var jour = date.getDate();\n var mois = date.getMonth()+1;\n var annee = date.getFullYear();\n if(mois <10)\n {\n mois = '0' + mois;\n }\n date_final= annee+\"-\"+mois+\"-\"+jour;\n }\n return date_final; \n }", "function fecha_hoy () {\r\n\tvar myDate = document.getElementById(\"fecha_registro\");\r\n\tvar today = new Date();\r\n\tmyDate.value = today.toISOString().substr(0, 10);\r\n}", "function CHMnetscapeDate(value)\r\n{\r\n dateObj.value=value;\r\n return;\r\n}", "function idade(date) {\n\n var nascimento = new Date(date.value);\n var hoje = new Date(Date.now());\n\n var idadePessoa = Math.floor(Math.ceil(Math.abs(nascimento.getTime() - hoje.getTime()) / (1000 * 3600 * 24)) / 365.25);\n\n if (idadePessoa < 19) {\n alert(\"Idade não pode ser inferior a 19 anos =/\");\n inputDataNascimento.value = \"\";\n }\n\n}", "function JTimeValue(gdate) {\r\n // debugger;\r\n //var d = gdate.split('T')[0].split('-');\r\n //var t = gdate.split('T')[1].split(':');\r\n\tvar dt=new Date(gdate);\r\n\tdt=new Date(dt.getTime() + _spPageContextInfo.clientServerTimeDelta)\r\n var HR=dt.getHours()<10 ? '0' + dt.getHours() : dt.getHours();\r\n var MN=dt.getMinutes()<10 ? '0' + dt.getMinutes() : dt.getMinutes();\r\n return ToShamsi(dt.getFullYear(),dt.getMonth()+1,dt.getDate()) + \" \" + HR+\":\"+ MN;\r\n}", "function hoje(data){\t\n\t\t\tvar dataatual = new Date();\n\t\t\tvar dia = dataatual.getDate();\n\t\t\t\n\t\t\tif (dia < 10){\n\t\t\t\tdia = \"0\" + dia;}\n\t\t\t\t\n\t\t\tvar mes = (dataatual.getMonth() + 1);\n\t\t\t\n\t\t\tif (mes < 10){\n\t\t\t\tmes = \"0\" + mes;}\n\t\t\t\t\n\t\t\tvar ano = dataatual.getYear();\t\n\t\t\t\n\t\t\tdata.value = (dia + \"/\" + mes + \"/\" + ano);\t\n}", "function Ezdatejoindate(Ide, JIde, fIde, errmsg) {\n $(Ide).on('dp.change', function (e) {\n \n if (e.oldDate !== null) {\n var ab = 1;\n if (new Date(Ezsetdtpkdate($(JIde).val())) <= new Date(Ezsetdtpkdate($(Ide).val()))) {\n ab = 0;\n }\n if (ab == 0) {\n $(fIde).focus();\n $(fIde).select();\n }\n else {\n $(Ide).focus();\n $(Ide).select(); \n $(Ide).val(EzdteTblPkEdit(new Date()));\n EzAlerterrtxt(errmsg);\n }\n }\n });\n}", "function JFDate(date) {\n if (date != null && date != \"\") {\n\n \n // var dateParts = date.split(/-/);\n // alert((dateParts[2] * 10000));\n // var b = (dateParts[2] * 10000) + ($.inArray(dateParts[1].toUpperCase(), [\"JAN\", \"FEB\", \"MAR\", \"APR\", \"MAY\", \"JUN\", \"JUL\", \"AUG\", \"SEP\", \"OCT\", \"NOV\", \"DEC\"]) * 100) + (dateParts[0] * 1);\n var MonthC = [\"JAN\", \"FEB\", \"MAR\", \"APR\", \"MAY\", \"JUN\", \"JUL\", \"AUG\", \"SEP\", \"OCT\", \"NOV\", \"DEC\"];\n \n if (date.substr(0, 10) == \"1900-01-01\") {\n return \"\";\n }\n var dateString = date.substr(0, 10).split('-');\n var currentTime = new Date(dateString[0], dateString[1], dateString[2]);\n //var currentTime = new Date(parseInt(mydate));\n \n var month = currentTime.getMonth() <= 9 ? \"0\" + (currentTime.getMonth()) : (currentTime.getMonth());\n var day = currentTime.getDate() <= 9 ? \"0\" + currentTime.getDate() : currentTime.getDate();\n var year = currentTime.getFullYear();\n date = day + \"-\" + MonthC[month - 1] + \"-\" + year;\n\n\n\n return date;\n } else {\n return \"\";\n }\n\n}", "function DateHelper() {}", "function jour(){\n let date_actuelle = date.getDate();\n let mois = date.getMonth()+1;\n let annee = date.getFullYear();\n mois < 10 ? mois = `0${mois}` : mois\n document.getElementById(\"date\").innerHTML=\"\"+date_actuelle+\"/\"+mois+\"/\"+annee;\n console.log(date);\n}", "function getDate(val, obj){\n let dateReserva = (new Date(val)).toISOString()\n let dateForm = document.getElementById('dateForm')\n let selectParagraph = document.getElementById(\"pSelect\")\n dateForm.hidden = true\n selectParagraph.hidden = false\n obj.Fecha = dateReserva \n}", "function calcola_jda(){\n\n // funzione per il calcolo del giorno giuliano per il 0.0 gennaio dell'anno corrente.\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) dicembre 2009\n // restituisce dataGiuliana, giorno giuliano inizio anno.\n // recupera automaticamente l'anno.\n // il giorno giuliano è calcolato per il tempo 0 T.U. di Greenwich.\n \n var data=new Date(); \n\n var anno =data.getYear(); // anno\n var mese =1; // mese \n var giorno=0.0; // giorno=0.0\n \nif (anno<1900) {anno=anno+1900;} // correzione anno per il browser.\n\nvar dataGiuliana=costanti_jd(giorno,mese,anno,0,0,0); // valore del giorno giuliano per lo 0.0 gennaio dell'anno corrente.\n\n dataGiuliana=dataGiuliana*1 // definire come valore numerico.\n // \nreturn dataGiuliana;\n\n}", "function changeFieldDateToJavascriptDate(dateValue) {\n return jq.datepicker.formatDate('mm/dd/yy', jq.datepicker.parseDate('yy-mm-dd', dateValue));\n}", "static expiresOn( alert ) {\n var ex_date = new Date(alert.expiration_date);\n var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric'};\n if (alert.expiration_date != null) {\n // Get that expiration date and display that expiration date\n return 'Expires On: ' + ex_date.toLocaleDateString(navigator.language, options);\n //else return no exipration date added\n }else{\n return 'No expiration date added '\n }\n}", "function mineur(){\r\n var aujd = new Date();\r\n var jour = aujd.getDate(); \r\n var mois = aujd.getMonth();\r\n var annee = aujd.getFullYear();\r\n\r\n var jourNaissance = dateNaissance.valueAsDate.getDate();\r\n var moisNaissance = dateNaissance.valueAsDate.getMonth();\r\n var anneeNaissance = dateNaissance.valueAsDate.getFullYear();\r\n\r\n console.log(aujd + \" jour \" + jour + \" mois \"+ mois + \" annee \"+ annee);\r\n console.log(dateNaissance.valueAsDate, jourNaissance, moisNaissance, anneeNaissance);\r\n\r\n if (annee-anneeNaissance < 18){\r\n dateNaissance.style.backgroundColor = \"red\";\r\n } else {\r\n dateNaissance.style.backgroundColor = \"\";\r\n }\r\n\r\n}", "function date_create_ymd($s) {\n if (js()) { \n if (substr($s,4,1)=='-') {\n $s=strcat(strcat(substr($s,0,4),substr($s,5,2)),substr($s,8,2));\n }\n $d = new Date(substr($s,0,4),substr($s,4,2)-1,substr($s,6,2));\n $d.setUTCHours(0);\n return $d;\n }\n else { return date_create(strcat($s,\" 00:00:00\")); }\n}", "function DateFormat(){\n this.jsjava_class=\"jsjava.text.DateFormat\";\n }", "function es_date(d) {\n var month = d.getMonth()+1;\n var day = d.getDate();\n var o = (day<10 ? '0' : '') + day + '/' + (month<10 ? '0' : '') + month + '/' + d.getFullYear();\n return o;\n}", "function datehashiso() { // @return ISO8601DateString: \"2000-01-01T00:00:00.000Z\"\r\n var padZero = (this.ms < 10) ? \"00\" : (this.ms < 100) ? \"0\" : \"\",\r\n dd = uuhash._num2dd;\r\n\r\n return uuformat(\"?-?-?T?:?:?.?Z\", this.Y, dd[this.M], dd[this.D],\r\n dd[this.h], dd[this.m], dd[this.s],\r\n padZero + this.ms);\r\n}", "function EzdatefrmtRes(dte) { \n var now = new Date(parseInt(dte.substr(6)));\n var now = new Date(now);\n var day = (\"0\" + now.getDate()).slice(-2);\n var month = (\"0\" + (now.getMonth() + 1)).slice(-2);\n var today = (day) + \"/\" + (month) + \"/\" + now.getFullYear();\n return today;\n }", "function _date(obj) {\n return exports.PREFIX.date + ':' + obj.toISOString();\n}", "function entregaAntesDeHoy() {\n let today = new Date(getDiaActual());\n let fecha_entrega = new Date($('#pi-fecha').val());\n\n if (fecha_entrega.getTime() < today.getTime()) {\n //fecha es anterior a hoy\n return true;\n } else {\n return false;\n }\n}", "function build_extended_date(nomedt)\n{\t//costruissco i nomi delle variabili che \"puntano\"\n\t//rispettivamente al campo anno, mese e giorno\n\tvar nomey = nomedt + 'Y';\n\tvar nomem = nomedt + 'M';\n\tvar nomed = nomedt + 'D';\n\tvar new_date = \"\";\t\n\t\n\t//ho commentato:\n\t//controllo aggiunto da Vera:\n\t//serve nel caso non siano presenti le variabili Y,M,D ma solo la HIDDEN con la data\n\tif(document.forms[0].elements[nomey] && document.forms[0].elements[nomey].value !=''){\n\t\n\t\n\t\n\t//Controllo se tutti gli elementi della data hanno un valore numerico\n\tif((!(isNaN(parseInt(document.forms[0].elements[nomey].value)))) && \n\t\t (!(isNaN(parseInt(document.forms[0].elements[nomem].value)))) &&\n\t\t (!(isNaN(parseInt(document.forms[0].elements[nomed].value)))))\t\n\t{\t//ho esattamente 3 elementi numerici\t\t\n\t\t\tnew_date = document.forms[0].elements[nomey].value;\t\t\t\n\t\t\t\n\t\t\tif (Number(document.forms[0].elements[nomem].value) > 9 )\n\t\t\t\tnew_date += document.forms[0].elements[nomem].value;\n\t\t\telse\n\t\t\t\tnew_date += \"0\" + Number(document.forms[0].elements[nomem].value);\n\t\t\t\t\t\t\n\t\t\tif (Number(document.forms[0].elements[nomed].value) > 9 )\n\t\t\t\tnew_date += document.forms[0].elements[nomed].value;\n\t\t\telse\n\t\t\t\tnew_date += \"0\" + Number(document.forms[0].elements[nomed].value);\n\t}\n\t\n//controllo aggiunto da Vera vedi sopra\n}else{\n\tif(Number(document.forms[0].elements[nomedt].value.substr(6))>1977){\n\tnew_date =document.forms[0].elements[nomedt].value.substr(6);\n\tnew_date +=document.forms[0].elements[nomedt].value.substr(3,2);\n\tnew_date +=document.forms[0].elements[nomedt].value.substr(0,2);\n\t}\n}\n\t\n\t//alert ('Data estesa:' + new_date);\n\t\n\treturn new_date;\n}", "function queDiaEHoje() {\n var currentdate = new Date();\n var datetime =\n \"Hoje é: \" +\n currentdate.getDate() +\n \"/\" +\n (currentdate.getMonth() + 1) +\n \"/\" +\n currentdate.getFullYear() +\n \" | \" +\n currentdate.getHours() +\n \":\" +\n currentdate.getMinutes() +\n \":\" +\n currentdate.getSeconds();\n\n return datetime;\n}", "function j(e,t,a){var s=e+\" \";switch(a){case\"ss\":return s+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\";case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return s+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\";case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return s+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\";case\"dd\":return s+=1===e?\"dan\":\"dana\";case\"MM\":return s+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\";case\"yy\":return s+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\"}}", "function setFormatoDate(data) {\n let dd = (\"0\" + (data.getDate())).slice(-2);\n let mm = (\"0\" + (data.getMonth() + 1)).slice(-2);\n let yyyy = data.getFullYear();\n return dd + '/' + mm + '/' + yyyy;\n}", "toGregorian(jalaliDate) {\r\n const jYear = jalaliDate.year;\r\n const jMonth = jalaliDate.month;\r\n const jDate = jalaliDate.day;\r\n let jdn = this.jalaliToDay(jYear, jMonth, jDate);\r\n let date = this.dayToGregorion(jdn);\r\n date.setHours(6, 30, 3, 200);\r\n return date;\r\n }", "function gps_fechasHoy() { \n var fecha = new Date(); \n gps_asignarFechaComp(fecha);\n}", "date() {\n let date = new Date();\n date.setTime(this.u64());\n return date;\n }", "function joliDate(d){\n var date = d;//d is a date object if d is a text we an use var date = new Date(d);\n return zero(date.getDate())+\"/\"+zero((date.getMonth()+1))+\"/\"+date.getFullYear();\n}", "getDate(event) {\n this.registro.year = event.year;\n this.registro.month = event.monthIndex;\n this.isSelect = new Date(this.registro.year, this.registro.month);\n this.valiDate();\n }", "function getShortJsonDate(date) {\n var dateObj = new Date(parseInt(date.substring(6))); \n return dateObj.toLocaleDateString() + \" \" + dateObj.toLocaleTimeString();\n }", "function isDate(sDate) {\n return Utilities.formatDate(sDate, \"GMT+0200\", \"dd.MM.yy\");\n}", "function getTime(){\n\t\t\"use strict\";\n\t\tlet option = {weekday: 'long', year: 'numeric', month: 'long', day: 'numeric'};\n\t\ttry{\n\t\t\tdate.innerHTML = new Date().toLocaleString('vn-VN',option);\n\t\t}catch(e){\n\t\t\treturn e.name = 'Date not found'\n\t\t}\n\t\treturn false;\n\t}", "function getPropertiesDate(obj) {\n return obj.properties.date.getValue();\n}", "function getdate(){\n\n element = document.getElementById(\"date\");\n\n element.innerText=dateobj.getDate();\n}", "function convertDate() {\n // x.form['fromday-str'] = x.form['fromday'];\n // x.form['untilday-str'] = x.form['untilday'];\n if (x.form.hasOwnProperty(\"fromday\")) x.form['fromday'] = Math.abs(Date.parse(x.form['fromday']) / 1000);\n if (x.form.hasOwnProperty(\"untilday\")) x.form['untilday'] = Math.abs(Date.parse(x.form['untilday']) / 1000);\n }", "function calcular_idade2(ano_nascimento){\n const data=new Date();\n const idade = data.getUTCFullYear() - ano_nascimento;\n console.log(idade);\n}", "function setMinDate() {\n let aus = new Date();\n aus.setDate = aus.getDate();\n aus.setFullYear(aus.getFullYear() - 8); //imposto come data di nascita massima 8 anni fa\n let data = aus.toISOString().split('T')[0];\n $(\"#dataNascitaModProfilo\").attr(\"max\", data);\n}", "function dataHoraAtual(attributo) {\n if (Xrm.Page.getAttribute(attributo).getValue() == null) {\n var dthAgora = new Date();\n Xrm.Page.getAttribute(attributo).setValue(dthAgora);\n }\n}", "excelDateToJSDate(serial) {\n const utc_days = Math.floor(serial - 25569);\n const utc_value = utc_days * 86400;\n const date_info = new Date(utc_value * 1000);\n const fractional_day = serial - Math.floor(serial) + 0.0000001;\n let total_seconds = Math.floor(86400 * fractional_day);\n const seconds = total_seconds % 60;\n total_seconds -= seconds;\n const hours = Math.floor(total_seconds / (60 * 60));\n const minutes = Math.floor(total_seconds / 60) % 60;\n return new Date(date_info.getFullYear(), date_info.getMonth(), date_info.getDate(), hours, minutes, seconds);\n }", "function Exo_4_8_jsform()\r\n //Début\r\n {\r\n var iJour, iMois, iAnnee, bBis, bTrente;\r\n\r\n //Ecrire \"Entrez le jour\"\r\n // Lire iJour\r\n iJour=document.getElementById(\"iJour\").value;\r\n // Ecrire \"Entre le mois\"\r\n // Lire iMois\r\n iMois=document.getElementById(\"iMois\").value;\r\n // Ecrire \"Entrez l'année\"\r\n // Lire iAnnee\r\n iAnnee=document.getElementById(\"iAnnee\").value;\r\n\r\n bBis= iAnnee%4===0 && iAnnee%100!=0 || iAnnee%400===0; \r\n bTrente=(iMois===\"avr\") || (iMois===\"jui\") || (iMois===\"sep\") || (iMois===\"nov\");\r\n\r\n\r\n\r\n if ((iMois===\"fev\" && ((iJour>\"28\" && !bBis) || iJour>\"29\")) || (iJour>\"30\" && bTrente) || (iJour>\"31\"))\r\n {\r\n document.getElementById(\"sp_resultat_code\").innerHTML=\"votre date est incorrect\";\r\n }\r\n else \r\n {\r\n document.getElementById(\"sp_resultat_code\").innerHTML=\"votre date est valide\";\r\n }\r\n\r\n }", "function calcola_jd(){\n\n // funzione per il calcolo del giorno giuliano utilizzando la data indicata dal pc.\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) giugno 2010.\n // restituisce il valore numerico dataGiuliana_dec.\n // il giorno giuliano è calcolato per il T.U. di Greenwich.\n // la funzione [fuso_loc()], recupera il fuso orario della località (-est) (+ovest).\n // la funzione ritorna la variabile numerica dataGiuliana_dec;\n \n \n var data=new Date();\n\n var anno = data.getYear(); // anno\n var mese = data.getMonth(); // mese 0 a 11 \n var giorno= data.getDate(); // numero del giorno da 1 a 31\n var ora = data.getHours(); // ora del giorno da 0 a 23 recuperata dal pc.\n var minuti= data.getMinutes(); // minuti da 0 a 59\n var secondi=data.getSeconds(); // secondi da 0 a 59\n \n mese =mese+1;\n\nif (anno<1900) {anno=anno+1900;} // correzione anno per il browser.\n\n ora=ora+fuso_loc(); // recupera il fuso orario della località (compresa l'ora legale) e riporta l'ora del pc. come T.U.\n\nvar dataGiuliana=costanti_jd(giorno,mese,anno,ora,minuti,secondi);\n\n dataGiuliana=dataGiuliana*1 // definire come valore numerico.\n \nreturn dataGiuliana; // restituisce il giorno giuliano\n\n}", "getValue(baseDate=new StemDate()) {\n let newDate = new StemDate(baseDate);\n newDate.setHours(0, 0, 0, this.node.valueAsNumber);\n return newDate;\n }", "get date_string() {\n return dayjs__WEBPACK_IMPORTED_MODULE_3__(this.date).format('DD MMM YYYY');\n }", "function EzdatefrmtRes1(dte) {\n var now = new Date(parseInt(dte.substr(6)));\n var now = new Date(now);\n var day = (\"0\" + now.getDate()).slice(-2);\n var month = (\"0\" + (now.getMonth() + 1)).slice(-2);\n var today = (day) + \"-\" + EzMMNames[month - 1] + \"-\" + now.getFullYear();\n return today;\n }", "function DateUtils() {}", "function horaCliente(){\n var anio= new Date();\n var mes= new Date();\n var dia=new Date();\n var hora=new Date(); \n var minuto= new Date();\n var segundo= new Date();\n mes.getUTCMonth();\n var h=hora.getHours();\n if(h<=9){\n h=\"0\"+h;\n }\n var minutos=minuto.getMinutes();\n if(minutos<=9){\n minutos=\"0\"+minutos;\n }\n var segundos=segundo.getSeconds();\n if(segundos<=9){\n segundos=\"0\"+segundos;\n }\n var ultActividad=anio.getFullYear()+\"-\"+(mes.getMonth()+1)+\"-\"+dia.getDate()+\" \"+h+\":\"+minutos+\":\"+segundos;\n return ultActividad;\n \n}", "function writtenDateToJavaScriptDate(dateStr) {\r\n const [day, month, year] = dateStr.split(\"/\");\r\n return new Date(year, month - 1, day);\r\n}", "function xx(e) { return x(e.date); }", "function mostrarFecha() {\n document.getElementById(\"fecha\").innerHTML = Date();\n }", "function SetDate(date) {\n var d = document.getElementById('date');\n var isodate = date.toISOString();\n d.value = isodate.substring(0, 10);//remove time\n}", "function dateToFullAussieString(d){\r\n return d.getDate() + \"/\" + (d.getMonth() + 1) + \"/\" + d.getFullYear() + \" \" + d.getHours() + \":\" + d.getMinutes() + \":\" + d.getSeconds();\r\n}", "function getSelectedDate()\n{\nreturn curr_date;\n}", "function gps_asignarFechaComp(fecha) {\n var dia = fecha.getDate();\n var mes = fecha.getMonth();\n var anio = fecha.getFullYear();\n\n mes += 1;\n if (mes < 10)\n mes = \"0\" + mes;\n\n var sfecha = anio + \"-\" + mes + \"-\" + dia;\n var fechaIni = sfecha + \" 00:00:00\";\n var fechaFin = sfecha + \" 23:59:00\"; \n\n document.getElementById(\"fechaInicio\").value = fechaIni;\n document.getElementById(\"fechaFinal\").value = fechaFin;\n \n gps_cambioParametros();\n}", "function dateToOb(date){\n\tvar dd=Date.fromISO(date);\n\t\n\treturn {\n\t\tt: dd,\n\t\th: ((dd.getHours()>12?dd.getHours()-12:dd.getHours()).toString().length==1?\"0\":\"\")+(dd.getHours()>12?dd.getHours()-12:dd.getHours()).toString(),\n\t\tm: ((dd.getMinutes()).toString().length==1?\"0\":\"\")+(dd.getMinutes()).toString(),\n\t\ta: dd.getHours()>12?\"pm\":\"am\"\n\t}\n}", "get displayDate() {\n return this._dateEl.innerHTML;\n }", "function dateToJson(date) {\n\tvar day = date.getDate();\n\tif (day < 10){\n\t\tday = \"0\" + day;\n\t}\n\tvar month = date.getMonth()+1;\n\tif (month < 10){\n\t\tmonth = \"0\" + month;\n\t}\n\tvar year = date.getFullYear();\n\tvar hours = date.getHours();\n\tif (hours < 10){\n\t\thours = \"0\" + hours;\n\t}\n\tvar minutes = date.getMinutes();\n\tif (minutes < 10){\n\t\tminutes = \"0\" + minutes;\n\t}\n \tvar seconds = date.getSeconds();\n\tif (seconds < 10){\n\t\tseconds = \"0\" + seconds;\n\t}\n\n\treturn day + \".\" + month + \".\" + year + \" \" + hours + \":\" + minutes + \":\" + seconds;\n}", "function getDate(id) {\n var year = $(\"#\" + id + \"_Year\").val();\n var month = $(\"#\" + id + \"_Month\").val();\n var day = $(\"#\" + id + \"_Day\").val();\n var hour = $(\"#\" + id + \"_Hour\").val();\n var minute = $(\"#\" + id + \"_Minute\").val();\n return new Date(year, month - 1, day, hour, minute);\n}", "function updateDOM_inputDate() {\n\n const a = new Date();\n $('#date-leave').val(DateUtilities.toApiDateString(a));\n $('#date-return').val(DateUtilities.toApiDateString(a));\n\n}", "function _dateCoerce(obj) {\n return obj.toISOString();\n}", "function eb(b){var c=Ce.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(db(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}", "function eb(b){var c=Ce.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(db(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}", "function eb(b){var c=Ce.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(db(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}", "function eb(b){var c=Ce.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(db(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}", "function eb(b){var c=Ce.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(db(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}", "function eb(b){var c=Ce.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(db(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}", "function fDate(date, format){\n date = date || new Date();\n format = format || \"MM/dd/yy\";\n return Utilities.formatDate(new Date(date), Session.getScriptTimeZone(), format)\n}", "get pubDate() {\n return this.getText('pubDate');\n }", "function jsac_apply_date(elts){\n\t\tfor (var i = 0; i <elts.length; i++){\n\t\t\tvar cur = elts[i].innerHTML;\n\t\t\t/*\n\t\t\tif (cur.length != 8){ alert(\"Please check the Dates Entered\"); break;}\n\t\t\tif ((cur[2] && cur[5]) != \"/\") { alert(\"Please check the Dates Entered\"); break;}\n\t\t\tfor (var j = 0; j < elts.length; j++){\n\t\t\t\tif (j == 2 || j == 5) continue;\n\t\t\t\tif (isNaN(cur[j])) { alert(\"Please check the Dates Entered\"); break;}\n\t\t\t}\n\t\t\t*/\n\t\t}\n\t}", "function isDateObjPub(obj, msgID)\n{\n\tif (obj == null) return false;\n\t\n\tvar value = obj.value.trim();\n\tif (value == \"\") return true;\n\t\n\tvar formatedDate = formatDate(value, \"-\");\t\n\tif (formatedDate == null)\n\t{\n\t\t//alert(getMessage(\"MSG_S0_0014\"));\n\t\talert(getMessage(msgID)); // alter by yaoxm 2005/05/20\n\t\tobj.focus();\n\t\tobj.select();\t\t\n\t\treturn false;\n\t}\n\t\n\tif (!isDateString(formatedDate, \"-\"))\n\t{\n\t\talert(getMessage(msgID));\n\t\tobj.focus();\n\t\tobj.select();\t\t\n\t\treturn false;\n\t}\n\t\n\tobj.value = formatedDate;\n\treturn true;\n}", "function ToJavaScriptDate(value) {\n var pattern = /Date\\(([^)]+)\\)/;\n var results = pattern.exec(value);\n var dt = new Date(parseFloat(results[1]));\n var MM = (dt.getMonth() + 1);\n var dd = dt.getDate();\n if (dd < 10) {\n dd = '0' + dd;\n }\n if (MM < 10) {\n MM = '0' + MM;\n }\n\n return MM + \"/\" + dd + \"/\" + dt.getFullYear();\n}", "function toSimpleDate(date) {\n var dateString = date.toString();\n dateString = dateString.substring(0, dateString.indexOf(\"GMT\"));\n return dateString;\n }", "function isoDate(date)\n{\n\treturn date.getFullYear() + \"-\" + (date.getMonth() + 1) + \"-\" + date.getDate()\n}", "function e(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\";case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1!==e&&(2===e||3===e||4===e)?\"minute\":\"minuta\";case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\";case\"dd\":return a+=1===e?\"dan\":\"dana\";case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\";case\"yy\":return a+=1!==e&&(2===e||3===e||4===e)?\"godine\":\"godina\"}}", "function e(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\";case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1!==e&&(2===e||3===e||4===e)?\"minute\":\"minuta\";case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\";case\"dd\":return a+=1===e?\"dan\":\"dana\";case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\";case\"yy\":return a+=1!==e&&(2===e||3===e||4===e)?\"godine\":\"godina\"}}", "get date () {\n\t\treturn this._date;\n\t}", "get date () {\n\t\treturn this._date;\n\t}", "get date () {\n\t\treturn this._date;\n\t}", "get date () {\n\t\treturn this._date;\n\t}", "get date () {\n\t\treturn this._date;\n\t}", "get date () {\n\t\treturn this._date;\n\t}", "function newsInCal(title, date, uhr, ort, beschr) {\n var edda = date.split(\"-\");\n var eddt = edda[2];\n var eddm = edda[1] - 1;\n var eddy = edda[0];\n var u = uhr.split(\":\");\n var uh = u[0];\n var um = u[1];\n var uh2 = \"22\";\n var endDate = new Date(eddy, eddm, eddt, uh2, um);\n var startDate = new Date(eddy, eddm, eddt, uh, um);\n\n var success = function (message) {\n alert(\"Success: \" + message);\n };\n var error = function (message) {\n alert(\"Error: \" + message);\n };\n\n window.plugins.calendar.createEvent(title, \"\", beschr, startDate, endDate, success, error);\n alert(\"KEIN ERROR\");\n //window.plugins.calendar.createEvent(title,\"\",beschr,uhr,endDate,success,error);\n}", "getFormattedDate(date) {\n return dayjs(date).format(\"MMM MM, YYYY\");\n }", "function gps_fechasAyer() { \n var fecha = new Date();\n var fecha_ayer = new Date(fecha.getTime());\n fecha_ayer.setDate(fecha.getDate() - 1); \n gps_asignarFechaComp(fecha_ayer);\n}", "_pushDate(gen, obj) {\n\t switch (gen.dateType) {\n\t case 'string':\n\t return gen._pushTag(TAG.DATE_STRING) &&\n\t gen._pushString(obj.toISOString())\n\t case 'int':\n\t case 'integer':\n\t return gen._pushTag(TAG.DATE_EPOCH) &&\n\t gen._pushIntNum(Math.round(obj / 1000))\n\t case 'float':\n\t // force float\n\t return gen._pushTag(TAG.DATE_EPOCH) &&\n\t gen._pushFloat(obj / 1000)\n\t case 'number':\n\t default:\n\t // if we happen to have an integral number of seconds,\n\t // use integer. Otherwise, use float.\n\t return gen._pushTag(TAG.DATE_EPOCH) &&\n\t gen.pushAny(obj / 1000)\n\t }\n\t }", "static _extractDateParts(date){return{day:date.getDate(),month:date.getMonth(),year:date.getFullYear()}}", "function formatDate(){\n if (!Date.prototype.toISODate) {\n Date.prototype.toISODate = function() {\n return this.getFullYear() + '-' +\n ('0'+ (this.getMonth()+1)).slice(-2) + '-' +\n ('0'+ this.getDate()).slice(-2);\n }\n }\n }", "makeDateObject (val) {\n // handle support for eu date format\n let dateAndTime = val.split(' ')\n let arr = []\n if (this.format.indexOf('-') !== -1) {\n arr = dateAndTime[0].split('-')\n } else {\n arr = dateAndTime[0].split('/')\n }\n let year = 0\n let month = 0\n let day = 0\n if (this.format.indexOf('DD/MM/YYYY') === 0 || this.format.indexOf('DD-MM-YYYY') === 0) {\n year = arr[2]\n month = arr[1]\n day = arr[0]\n } else if (this.format.indexOf('YYYY/MM/DD') === 0 || this.format.indexOf('YYYY-MM-DD') === 0) {\n year = arr[0]\n month = arr[1]\n day = arr[2]\n } else {\n year = arr[2]\n month = arr[0]\n day = arr[1]\n }\n\n let date = new Date();\n if(this.hideDate){\n // time only\n let splitTime = dateAndTime[0].split(':')\n // handle date format without seconds\n let secs = splitTime.length > 2 ? parseInt(splitTime[2]) : 0\n date.setHours(parseInt(splitTime[0]), parseInt(splitTime[1]), secs, 0)\n } else if (this.hideTime) {\n // date only\n date = new Date(parseInt(year), parseInt(month)-1, parseInt(day))\n } else {\n // we have both date and time\n let splitTime = dateAndTime[1].split(':')\n // handle date format without seconds\n let secs = splitTime.length > 2 ? parseInt(splitTime[2]) : 0\n date = new Date(parseInt(year), parseInt(month)-1, parseInt(day), parseInt(splitTime[0]), parseInt(splitTime[1]), secs)\n }\n\n return date\n }", "function fb(b){var c=Ie.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(eb(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}", "function fb(b){var c=Ie.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(eb(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}", "function fb(b){var c=Ie.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(eb(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}" ]
[ "0.68344027", "0.6398112", "0.6370306", "0.63264036", "0.6295104", "0.6285838", "0.6259141", "0.6246084", "0.62244886", "0.620246", "0.61880463", "0.6115644", "0.6087137", "0.60627204", "0.6052555", "0.5993949", "0.5988957", "0.5985112", "0.59719914", "0.59369123", "0.5914895", "0.59008646", "0.5892788", "0.586595", "0.58594316", "0.585409", "0.5847481", "0.58369386", "0.58358204", "0.5830148", "0.5822437", "0.57861084", "0.5786044", "0.57858855", "0.57788116", "0.5777443", "0.57773584", "0.57728744", "0.57726306", "0.5770917", "0.57697386", "0.5769626", "0.57577807", "0.5752384", "0.57519245", "0.5749601", "0.57398826", "0.573537", "0.573355", "0.5732756", "0.5721361", "0.57185584", "0.5715339", "0.5707861", "0.5707082", "0.5698763", "0.56981784", "0.56950843", "0.5693416", "0.56831735", "0.567458", "0.5673545", "0.5665597", "0.56565267", "0.5656434", "0.5653686", "0.56515676", "0.56412804", "0.5639406", "0.56302285", "0.5608071", "0.5608071", "0.5608071", "0.5608071", "0.5608071", "0.5608071", "0.560782", "0.56001955", "0.55983925", "0.55973583", "0.55959016", "0.559013", "0.55894244", "0.55566293", "0.55566293", "0.5555756", "0.5555756", "0.5555756", "0.5555756", "0.5555756", "0.5555756", "0.55521435", "0.55499685", "0.5541723", "0.5536505", "0.5535572", "0.55335575", "0.5524146", "0.5522805", "0.5522805", "0.5522805" ]
0.0
-1
use a Flow type import to get our Produce type
function saveInventory(inventory) { var outpath = _path2.default.join(__dirname, '..', '..', 'data', 'produce.json'); return new Promise(function (resolve, reject) { // lets not write to the file if we're running tests if (process.env.NODE_ENV !== 'test') { _fs2.default.writeFile(outpath, JSON.stringify(inventory, null, '\t'), function (err) { err ? reject(err) : resolve(outpath); }); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function propTypeToFlowTypeTransform(j, node, callback) {\n // instanceOf(), arrayOf(), etc..\n const {\n name\n } = node.callee.property;\n\n switch (name) {\n case _constants.PROPTYPES_IDENTIFIERS.INSTANCE_OF:\n return j.genericTypeAnnotation(node.arguments[0], null);\n\n case _constants.PROPTYPES_IDENTIFIERS.ARRAY_OF:\n return j.genericTypeAnnotation(j.identifier('Array'), j.typeParameterInstantiation([callback(j, null, node.arguments[0] || j.anyTypeAnnotation())]));\n\n case _constants.PROPTYPES_IDENTIFIERS.OBJECT_OF:\n return j.genericTypeAnnotation(j.identifier('Object'), j.typeParameterInstantiation([callback(j, null, node.arguments[0] || j.anyTypeAnnotation())]));\n\n case _constants.PROPTYPES_IDENTIFIERS.SHAPE:\n return j.objectTypeAnnotation(node.arguments[0].properties.map(arg => callback(j, arg.key, arg.value)));\n\n case _constants.PROPTYPES_IDENTIFIERS.ONE_OF:\n case _constants.PROPTYPES_IDENTIFIERS.ONE_OF_TYPE:\n return j.unionTypeAnnotation(node.arguments[0].elements.map(arg => callback(j, null, arg)));\n\n default:\n break;\n }\n}", "static from(data){\n return FlowFactory.getFlow(data);\n }", "function __WEBPACK_DEFAULT_EXPORT__(spec, scope) {\n var def = (0,vega_dataflow__WEBPACK_IMPORTED_MODULE_3__.definition)(spec.type);\n if (!def) (0,vega_util__WEBPACK_IMPORTED_MODULE_4__.error)('Unrecognized transform type: ' + (0,vega_util__WEBPACK_IMPORTED_MODULE_4__.stringValue)(spec.type));\n\n var t = (0,_util__WEBPACK_IMPORTED_MODULE_1__.entry)(def.type.toLowerCase(), null, parseParameters(def, spec, scope));\n if (spec.signal) scope.addSignal(spec.signal, scope.proxy(t));\n t.metadata = def.metadata || {};\n\n return t;\n}", "function example(arg1: number, arg2: MyObject): Array<Object> {\n// ^ variable\n// ^ punctuation.type.flowtype\n// ^ support.type.builtin.primitive.flowtype\n// ^ variable\n// ^ support.type.class.flowtype\n// ^ punctuation.type.flowtype\n// ^ support.type.builtin.class.flowtype\n// ^ punctuation.flowtype\n// ^ support.type.builtin.class.flowtype\n// ^ punctuation.flowtype\n}", "function propTypeToFlowTypeMapper(j) {\n if (PropTypeToFlowTypeMap) {\n return PropTypeToFlowTypeMap;\n }\n\n PropTypeToFlowTypeMap = {\n [_constants.PROPTYPES_IDENTIFIERS.ANY]: j.anyTypeAnnotation(),\n [_constants.PROPTYPES_IDENTIFIERS.BOOLEAN]: j.booleanTypeAnnotation(),\n [_constants.PROPTYPES_IDENTIFIERS.NUMBER]: j.numberTypeAnnotation(),\n [_constants.PROPTYPES_IDENTIFIERS.STRING]: j.stringTypeAnnotation(),\n [_constants.PROPTYPES_IDENTIFIERS.FUNCTION]: j.genericTypeAnnotation(j.identifier('Function'), null),\n [_constants.PROPTYPES_IDENTIFIERS.OBJECT]: j.genericTypeAnnotation(j.identifier('Object'), null),\n [_constants.PROPTYPES_IDENTIFIERS.ARRAY]: j.genericTypeAnnotation(j.identifier('Array'), j.typeParameterInstantiation([j.anyTypeAnnotation()])),\n [_constants.PROPTYPES_IDENTIFIERS.ELEMENT]: j.genericTypeAnnotation(j.qualifiedTypeIdentifier(j.identifier('React'), j.identifier('Element')), null),\n [_constants.PROPTYPES_IDENTIFIERS.NODE]: j.unionTypeAnnotation([j.numberTypeAnnotation(), j.stringTypeAnnotation(), j.genericTypeAnnotation(j.qualifiedTypeIdentifier(j.identifier('React'), j.identifier('Element')), null), j.genericTypeAnnotation(j.identifier('Array'), j.typeParameterInstantiation([j.anyTypeAnnotation()]))])\n };\n return PropTypeToFlowTypeMap;\n}", "static _processType(typeItem) {\n switch (typeItem.kind) {\n case 'variable-type':\n return Type.newVariableReference(typeItem.name);\n case 'reference-type':\n return Type.newManifestReference(typeItem.name);\n case 'list-type':\n return Type.newSetView(Manifest._processType(typeItem.type));\n default:\n throw `Unexpected type item of kind '${typeItem.kind}'`;\n }\n }", "generate (type) {\n return generate(type)\n }", "type() { }", "function PipeType(){}", "produce() {}", "getType() {}", "function UnderreactType() {}", "type () {\n return 'flower'\n }", "get type() {}", "function PipeType() {}", "function input(type) {\n const value = typeof type;\n return value;\n}", "function Type() {}", "function parsePrimaryType(){var params=null,returnType=null,marker=markerCreate(),rest=null,tmp,typeParameters,token,type,isGroupedType=false;switch(lookahead.type){case Token.Identifier:switch(lookahead.value){case 'any':lex();return markerApply(marker,delegate.createAnyTypeAnnotation());case 'bool': // fallthrough\ncase 'boolean':lex();return markerApply(marker,delegate.createBooleanTypeAnnotation());case 'number':lex();return markerApply(marker,delegate.createNumberTypeAnnotation());case 'string':lex();return markerApply(marker,delegate.createStringTypeAnnotation());}return markerApply(marker,parseGenericType());case Token.Punctuator:switch(lookahead.value){case '{':return markerApply(marker,parseObjectType());case '[':return parseTupleType();case '<':typeParameters = parseTypeParameterDeclaration();expect('(');tmp = parseFunctionTypeParams();params = tmp.params;rest = tmp.rest;expect(')');expect('=>');returnType = parseType();return markerApply(marker,delegate.createFunctionTypeAnnotation(params,returnType,rest,typeParameters));case '(':lex(); // Check to see if this is actually a grouped type\nif(!match(')') && !match('...')){if(lookahead.type === Token.Identifier){token = lookahead2();isGroupedType = token.value !== '?' && token.value !== ':';}else {isGroupedType = true;}}if(isGroupedType){type = parseType();expect(')'); // If we see a => next then someone was probably confused about\n// function types, so we can provide a better error message\nif(match('=>')){throwError({},Messages.ConfusedAboutFunctionType);}return type;}tmp = parseFunctionTypeParams();params = tmp.params;rest = tmp.rest;expect(')');expect('=>');returnType = parseType();return markerApply(marker,delegate.createFunctionTypeAnnotation(params,returnType,rest,null /* typeParameters */));}break;case Token.Keyword:switch(lookahead.value){case 'void':return markerApply(marker,parseVoidType());case 'typeof':return markerApply(marker,parseTypeofType());}break;case Token.StringLiteral:token = lex();if(token.octal){throwError(token,Messages.StrictOctalLiteral);}return markerApply(marker,delegate.createStringLiteralTypeAnnotation(token));}throwUnexpected(lookahead);}", "static product(...types) {\n return async function typeFn(message, phrase) {\n const results = [];\n for (let entry of types) {\n if (typeof entry === \"function\")\n entry = entry.bind(this);\n const res = await Argument.cast(entry, this.handler.resolver, message, phrase);\n if (Argument.isFailure(res))\n return res;\n results.push(res);\n }\n return results;\n };\n }", "static of(){\n if( arguments.length == 0 )\n return FlowFactory.getFlow([]);\n\n if( arguments.length > 1 )\n return FlowFactory.getFlow(arguments);\n\n if( arguments.length == 1 && Util.isNumber(arguments[0]) )\n return new IteratorFlow(FlowFactory.createIteratorWithEmptyArraysFromNumber(arguments[0]));\n\n return FlowFactory.getFlow(arguments[0]);\n }", "function dataflow() {\n var Flow = window.Flow;\n Flow.Dataflow = function () {\n return {\n slot: createSlot,\n slots: createSlots,\n signal: createSignal,\n signals: createSignals,\n isSignal: _isSignal,\n link: _link,\n unlink: _unlink,\n act: _act,\n react: _react,\n lift: _lift,\n merge: _merge\n };\n }();\n }", "function flowParsePrimaryType() {\n let isGroupedType = false;\n const oldNoAnonFunctionType = state.noAnonFunctionType;\n\n switch (state.type) {\n case TokenType.name: {\n if (isContextual(ContextualKeyword._interface)) {\n flowParseInterfaceType();\n return;\n }\n parseIdentifier();\n flowParseGenericType();\n return;\n }\n\n case TokenType.braceL:\n flowParseObjectType(false, false, false);\n return;\n\n case TokenType.braceBarL:\n flowParseObjectType(false, true, false);\n return;\n\n case TokenType.bracketL:\n flowParseTupleType();\n return;\n\n case TokenType.lessThan:\n flowParseTypeParameterDeclaration();\n expect(TokenType.parenL);\n flowParseFunctionTypeParams();\n expect(TokenType.parenR);\n expect(TokenType.arrow);\n flowParseType();\n return;\n\n case TokenType.parenL:\n next();\n\n // Check to see if this is actually a grouped type\n if (!match(TokenType.parenR) && !match(TokenType.ellipsis)) {\n if (match(TokenType.name)) {\n const token = lookaheadType();\n isGroupedType = token !== TokenType.question && token !== TokenType.colon;\n } else {\n isGroupedType = true;\n }\n }\n\n if (isGroupedType) {\n state.noAnonFunctionType = false;\n flowParseType();\n state.noAnonFunctionType = oldNoAnonFunctionType;\n\n // A `,` or a `) =>` means this is an anonymous function type\n if (\n state.noAnonFunctionType ||\n !(match(TokenType.comma) || (match(TokenType.parenR) && lookaheadType() === TokenType.arrow))\n ) {\n expect(TokenType.parenR);\n return;\n } else {\n // Eat a comma if there is one\n eat(TokenType.comma);\n }\n }\n\n flowParseFunctionTypeParams();\n\n expect(TokenType.parenR);\n expect(TokenType.arrow);\n flowParseType();\n return;\n\n case TokenType.minus:\n next();\n parseLiteral();\n return;\n\n case TokenType.string:\n case TokenType.num:\n case TokenType._true:\n case TokenType._false:\n case TokenType._null:\n case TokenType._this:\n case TokenType._void:\n case TokenType.star:\n next();\n return;\n\n default:\n if (state.type === TokenType._typeof) {\n flowParseTypeofType();\n return;\n } else if (state.type & TokenType.IS_KEYWORD) {\n next();\n state.tokens[state.tokens.length - 1].type = TokenType.name;\n return;\n }\n }\n\n unexpected();\n}", "function generatePropType(type) {\n\tif (type.name === 'func') return 'function'\n\tif (type.name === 'custom') return type.raw\n\n\t/*\n\tFrom:\n\t{\n\t\t\"name\": \"union\",\n\t\t\"value\": [\n\t\t\t{\"name\": \"number\"},\n\t\t\t{\"name\": \"string\"}\n\t\t]\n\t}\n\tTo: number|string\n\t*/\n\tif (type.name === 'union') {\n\t\treturn type.value.map(generatePropType).join('|')\n\t}\n\n\t/*\n\tFrom:\n\t{\n\t\t\"name\": \"enum\",\n\t\t\"value\": [\n\t\t\t{\"value\": \"'a'\", \"computed\": false},\n\t\t\t{\"value\": \"'b'\", \"computed\": false},\n\t\t]\n\t}\n\tTo: 'a'|'b'\n\t*/\n\tif (type.name === 'enum') {\n\t\tif (Array.isArray(type.value)) {\n\t\t\treturn type.value.map(val => val.value).join('|')\n\t\t} else {\n\t\t\treturn type.value\n\t\t}\n\t}\n\n\treturn type.name\n}", "function convertType(assert) {\n switch (assert.dataType) {\n case 'boolean':\n return Boolean(assert.value);\n case 'number':\n return +assert.value;\n case 'null':\n return null;\n case 'undefined':\n return undefined;\n case 'string':\n return assert.value; \n default:\n return 'Data type block failed';\n }\n}", "function Type() {\n}", "function convertSourceToFlat(source) {\n if (source.isTenantComponent) {\n /*\n POST /module/oozie-web/api/v1.0/template/workflows/<id>?operation=copy\n {\n \"templateId\" : 4,\n \"files\" : [\"hive-site.xml\"]\n }\n */\n\n return {templateId: source.componentId};\n } else {\n /*\n POST /module/oozie-web/api/v1.0/platforms/<id>/clusters/<id>/services/<id>/workflows/<path>?operation=copy\n {\n \"platformId\" : 1,\n \"clusterId\" : \"Cluster1\",\n \"serviceId\" : \"HDFS\",\n \"moduleId\" : \"/app/workflow\"\n \"files\" : [\"hive-site.xml\", \"t2.txt\"]\n }\n */\n\n let {\n platform: {id: platformId},\n cluster: {id: clusterId},\n service: {id: serviceId},\n module: {id: moduleId}\n } = source;\n return {platformId, clusterId, serviceId, moduleId}\n }\n }", "'getType'() {\n\t\tthrow new Error('Not implemented.');\n\t}", "function PipeType() { }", "static compose(...types) {\n return async function typeFn(message, phrase) {\n let acc = phrase;\n for (let entry of types) {\n if (typeof entry === \"function\")\n entry = entry.bind(this);\n acc = await Argument.cast(entry, this.handler.resolver, message, acc);\n if (Argument.isFailure(acc))\n return acc;\n }\n return acc;\n };\n }", "function injectable(type)\n{\n return resolve(metadata(type)).$type;\n}", "function Type() {\r\n}", "pipeTypeCheck(them) {\n // console.log(this.name + \" got pipe from\");\n // console.log(them);\n }", "function Flow(nodeList, flows, node, type) {\n this.nodeList = nodeList;\n this.flows = flows;\n this.node = node;\n this.type = type;\n}", "function factory(type, config, load, typed) {\n var sum = load(__webpack_require__(95));\n return typed('sum', {\n '...any': function any(args) {\n // change last argument dim from one-based to zero-based\n if (args.length === 2 && isCollection(args[0])) {\n var dim = args[1];\n\n if (type.isNumber(dim)) {\n args[1] = dim - 1;\n } else if (type.isBigNumber(dim)) {\n args[1] = dim.minus(1);\n }\n }\n\n try {\n return sum.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}", "function behFstIntro( type ) {\r\n var result = {};\r\n result.inType = type;\r\n result.outType = typeTimes( type, typeOne() );\r\n result.install = function ( context, inWires, outWires ) {\r\n behId( type ).install( context, inWires, outWires.first );\r\n };\r\n return result;\r\n}", "enterTypeAnnotation(ctx) {\n }", "function factory (type, config, load, typed) {\n var concat = load(__webpack_require__(88));\n\n // @see: comment of concat itself\n return typed('concat', {\n '...any': function (args) {\n // change last argument from one-based to zero-based\n var lastIndex = args.length - 1;\n var last = args[lastIndex];\n if (type.isNumber(last)) {\n args[lastIndex] = last - 1;\n }\n else if (type.isBigNumber(last)) {\n args[lastIndex] = last.minus(1);\n }\n\n try {\n return concat.apply(null, args);\n }\n catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}", "fromResult(aResult) {\n return require('folktale/conversions/result-to-maybe')(aResult);\n }", "classType () {\n const depTypeFn = depTypes[String(this.currentAstNode)]\n if (!depTypeFn) {\n throw Object.assign(\n new Error(`\\`${String(this.currentAstNode)}\\` is not a supported dependency type.`),\n { code: 'EQUERYNODEPTYPE' }\n )\n }\n const nextResults = depTypeFn(this.initialItems)\n this.processPendingCombinator(nextResults)\n }", "static importedType(spec) {\n const symbolSpec = SymbolSpecs_1.SymbolSpec.from(spec);\n return TypeNames.anyType(symbolSpec.value, symbolSpec);\n }", "function TypeofTypeAnnotation(node, print) {\n this.push(\"typeof \");\n print.plain(node.argument);\n}", "createTypes(){\n }", "static createItem(typeName, ctx=null) {\n console.debug(\"Types.createItem\", typeName);\n if (typeof typeName !== 'string') {\n throw new Error(\"expected type string\");\n }\n var ret;\n const type= allTypes.get( typeName );\n if (!type ) {\n throw new Error(`unknown type '${typeName}'`);\n }\n const { uses } = type;\n switch (uses) {\n case \"flow\": {\n const data= {};\n const spec= type.with;\n const { params } = spec;\n for ( const token in params ) {\n const param= params[token];\n if (!param.optional || param.repeats) {\n const val= (!param.optional) && Types.createItem( param.type, {\n token: token,\n param: param\n });\n // if the param repeats then we'll wind up with an array (of items)\n data[token]= param.repeats? (val? [val]: []): val;\n }\n }\n ret= allTypes.newItem(type.name, data);\n }\n break;\n case \"slot\":\n case \"swap\": {\n // note: \"initially\", if any, is: object { string type; object value; }\n // FIX: \"initially\" wont work properly for opts.\n // slots dont have a $TOKEN entry, but options do.\n const pair= Types._unpack(ctx);\n if (!pair) {\n ret= allTypes.newItem(type.name, null);\n } else {\n const { type:slatType, value:slatValue } = pair;\n ret= Types.createItem(slatType, slatValue);\n }\n }\n break;\n case \"str\":\n case \"txt\": {\n // ex. Item(\"trait\", \"testing\")\n // determine default value\n let defautValue= \"\";\n const spec= type.with;\n const { tokens, params }= spec;\n if (tokens.length === 1) {\n const t= tokens[0];\n const param= params[t];\n // FIX: no .... this is in the \"flow\"... the container of the str.\n // if (param.filterVals && ('default' in param.filterVals)) {\n // defaultValue= param.filterVals['default'];\n // } else {\n // if there's only one token, and that token isn't the \"floating value\" token....\n if (param.value !== null) {\n defautValue= t; // then we can use the token as our default value.\n }\n // }\n }\n const value= Types._unpack(ctx, defautValue);\n // fix? .value for string elements *can* be null,\n // but if they are things in autoText throw.\n // apparently default String prop validation allows null.\n ret= allTypes.newItem(type.name, value);\n }\n break;\n case \"num\": {\n const value= Types._unpack(ctx, 0);\n ret= allTypes.newItem(type.name, value);\n }\n break;\n default:\n throw new Error(`unknown type ${uses}`);\n break;\n }\n return ret;\n }", "create(props){\n const obj = {type: this.name};\n\n Object.keys(this.props).forEach((prop) => {\n obj[prop] = props[prop];\n\n // If not primitive type\n // if(this.props[prop].rel !== undefined){\n // types[this.props[prop].type].create(props[prop]);\n // }\n // // Create new instance of type and add relationship\n // this.props[prop].create = (obj) => types[prop.type].create(obj);\n //\n // // Fetch existing instance of type and add relationship\n // this.props[prop].link = (obj) => types[prop.type].link(obj);\n // }\n });\n\n return obj;\n }", "function behId( type ) {\r\n var result = {};\r\n result.inType = type;\r\n result.outType = type;\r\n result.install = function ( context, inWires, outWires ) {\r\n eachTypeLeafNodeOver( inWires, outWires,\r\n function ( type, inWire, outWire ) {\r\n \r\n if ( type.op === \"atom\" ) {\r\n outWire.readSigFrom( inWire );\r\n } else if ( type.op === \"anytimeFn\" ) {\r\n outWire.readFrom( inWire );\r\n } else {\r\n throw new Error();\r\n }\r\n } );\r\n };\r\n return result;\r\n}", "function createType(m) {\n var typeDef = 'type ' + m.modelName + ' { \\n';\n //console.log(m);\n Object.keys(m.definition.properties).forEach((k, index) => {\n var p = m.definition.properties[k];\n var s = null;\n if (k === 'id' && p.id && p.generated) {\n s = k + ': ID' + '\\n';\n }\n else {\n s = k + ': ' + convertFromLoopbackType(p) + '\\n';\n }\n typeDef += s;\n });\n typeDef += ' }\\n\\n';\n return typeDef;\n}", "function factory (type, config, load, typed) {\n var min = load(__webpack_require__(178));\n\n return typed('min', {\n '...any': function (args) {\n // change last argument dim from one-based to zero-based\n if (args.length == 2 && isCollection(args[0])) {\n var dim = args[1];\n if (type.isNumber(dim)) {\n args[1] = dim - 1;\n }\n else if (type.isBigNumber(dim)) {\n args[1] = dim.minus(1);\n }\n }\n\n try {\n return min.apply(null, args);\n }\n catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}", "fromValidation(aValidation) {\n return require('folktale/conversions/validation-to-maybe')(aValidation);\n }", "function TypeofTypeAnnotation(node, print) {\n\t this.push(\"typeof \");\n\t print.plain(node.argument);\n\t}", "function TypeofTypeAnnotation(node, print) {\n\t this.push(\"typeof \");\n\t print.plain(node.argument);\n\t}", "function factory(type, config, load, typed) {\n var concat = load(__webpack_require__(76)); // @see: comment of concat itself\n\n return typed('concat', {\n '...any': function any(args) {\n // change last argument from one-based to zero-based\n var lastIndex = args.length - 1;\n var last = args[lastIndex];\n\n if (type.isNumber(last)) {\n args[lastIndex] = last - 1;\n } else if (type.isBigNumber(last)) {\n args[lastIndex] = last.minus(1);\n }\n\n try {\n return concat.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}", "function factory(type, config, load, typed) {\n var min = load(__webpack_require__(146));\n return typed('min', {\n '...any': function any(args) {\n // change last argument dim from one-based to zero-based\n if (args.length === 2 && isCollection(args[0])) {\n var dim = args[1];\n\n if (type.isNumber(dim)) {\n args[1] = dim - 1;\n } else if (type.isBigNumber(dim)) {\n args[1] = dim.minus(1);\n }\n }\n\n try {\n return min.apply(null, args);\n } catch (err) {\n throw errorTransform(err);\n }\n }\n });\n}", "async fromToFlow(type) {\n try {\n await this.connectAndMigrate();\n } catch (error) {\n return error;\n }\n\n const suggestedStations = await this.getStationList();\n\n let from;\n let to;\n\n try {\n from = await autoCompletePromise.stations(\n suggestedStations,\n \"Van welk station zou je vertrekken?\"\n );\n to = await autoCompletePromise.stations(\n suggestedStations,\n \"Naar welk station wil je reizen?\"\n );\n } catch (error) {\n //console.log(error);\n return error;\n }\n let dateResult;\n\n if (type) {\n try {\n dateResult = await this.getDate(type);\n } catch (error) {\n return error;\n }\n }\n\n try {\n await storageAPI.saveToHistory(from, to);\n return await this.getRoute(from, to, dateResult);\n } catch (error) {\n return error;\n }\n }", "fromValidation(aValidation) {\n return require('folktale/data/conversions/validation-to-result')(aValidation);\n }", "constructor (GRAMMAR_NAME) {\n Object.assign(this,\n JSON.parse(fs.readFileSync(new URL(`./types/${GRAMMAR_NAME}.json`, import.meta.url), 'utf8')\n )\n )\n }", "function flowTypeHandler(documentation, path) {\n var flowTypesPath = (0, _utilsGetFlowTypeFromReactComponent2['default'])(path);\n\n if (!flowTypesPath) {\n return;\n }\n\n flowTypesPath.get('properties').each(function (propertyPath) {\n var propDescriptor = documentation.getPropDescriptor((0, _utilsGetPropertyName2['default'])(propertyPath));\n var valuePath = propertyPath.get('value');\n var type = (0, _utilsGetFlowType2['default'])(valuePath);\n\n if (type) {\n propDescriptor.flowType = type;\n propDescriptor.required = !propertyPath.node.optional;\n }\n });\n}", "function resolve_src(src) {\n var stream;\n let subind, i;\n // Source() literal reference\n if (jt.instance_of(src, '$Collection.$Timestep.Source')) { // if source stream reference\n stream = this.resolve_src(src.inputs[0]);\n return stream;\n // Import() to pull sources from other timesteps\n } else if (jt.instance_of(src, '$Collection.$Timestep.Import')) {\n subind = this.create_indicator(src);\n stream = subind.output_stream;\n return stream;\n // Ind() nested indicator\n } else if (jt.instance_of(src, '$Collection.$Timestep.Ind')) {\n subind = this.create_indicator(src);\n stream = subind.output_stream;\n if (src.options.sub) stream = (_.isArray(src.options.sub) ? src.options.sub : [src.options.sub]).reduce((str, key) => str.substream(key), stream);\n return stream;\n // Stream-typed src is already a stream\n } else if (src instanceof Stream || _.isObject(src) && _.isFunction(src.get)) {\n return src;\n // named source to look up in collection.sources\n } else if (_.isString(src)) {\n let full_path = src.split('.');\n let src_path, sub_path, target;\n for (i = 0; i <= full_path.length - 1; i++) {\n src_path = full_path.slice(0, i + 1);\n sub_path = full_path.slice(i + 1);\n // check if src is a collection input source\n target = _.get(coll.config.inputs, src_path.join('.'));\n if (target && jt.instance_of(target, '$Collection.$Timestep.Input')) {\n if (!target.stream) throw new Error('A stream has not be defined for input: ' + src_path.join('.'));\n stream = target.stream;\n break;\n }\n // check if src is a source already created\n target = _.get(coll.sources, src_path.join('.'));\n if (target && target.root instanceof Stream) {\n stream = target;\n break;\n }\n // check if src is a source that is defined but not yet created\n target = _.get(coll.config.indicators, src_path.join('.'));\n if (target && jt.instance_of(target, '$Collection.$Timestep.SrcType')) {\n stream = Deferred({\n src_path: src_path,\n src_sub_path: sub_path\n });\n break;\n }\n }\n if (!stream) throw Error('Unrecognized stream source: ' + src);\n // follow substream path if applicable\n if (!(stream instanceof Deferred) && sub_path.length > 0) {\n stream = sub_path.reduce((str, key) => str.substream(key), stream);\n }\n return stream;\n } else if (src instanceof Deferred) {\n return src;\n } else {\n throw new Error('Unexpected source defined for indicator: ' + JSON.stringify(src));\n }\n }", "type(source, descriptor, kind = 'default', isTypeOnly = false) {\n const symbolReg = this.symbols.get(descriptor, kind);\n // symbol in this file?\n if (symbolReg.file === source) {\n return symbolReg.name;\n }\n // symbol not in file\n // add an import statement\n const importPath = createRelativeImportPath(source.getSourceFile().fileName, symbolReg.file.getFilename());\n const blackListedNames = this.symbols.list(source).map(e => e.name);\n return ensureNamedImportPresent(source.getSourceFile(), symbolReg.name, importPath, isTypeOnly, blackListedNames, statementToAdd => source.addStatement(statementToAdd, true));\n }", "static protoTypeToTypescriptType(propType) {\n\t\tif (['float', 'int32'].includes(propType)) return 'number';\n\t\tif (['string'].includes(propType)) return 'string';\n\t\tif (['bool'].includes(propType)) return 'boolean';\n\t\t// If no basic type is found, we return the propType\n\t\t// (eg if it is a custom type)\n\t\treturn propType;\n\t}", "function compilePipeFromRender2(outputCtx,pipe,reflector){var name=identifierName(pipe.type);if(!name){return error(\"Cannot resolve the name of \"+pipe.type);}var metadata={name:name,pipeName:pipe.name,type:outputCtx.importExpr(pipe.type.reference),deps:dependenciesFromGlobalMetadata(pipe.type,outputCtx,reflector),pure:pipe.pure};var res=compilePipeFromMetadata(metadata);var definitionField=outputCtx.constantPool.propertyNameOf(3/* Pipe */);outputCtx.statements.push(new ClassStmt(/* name */name,/* parent */null,/* fields */[new ClassField(/* name */definitionField,/* type */INFERRED_TYPE,/* modifiers */[StmtModifier.Static],/* initializer */res.expression)],/* getters */[],/* constructorMethod */new ClassMethod(null,[],[]),/* methods */[]));}", "function astFromValue(value, type) {\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_6__[\"isNonNullType\"])(type)) {\n var astValue = astFromValue(value, type.ofType);\n\n if (astValue && astValue.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].NULL) {\n return null;\n }\n\n return astValue;\n } // only explicit null, not undefined, NaN\n\n\n if (value === null) {\n return {\n kind: _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].NULL\n };\n } // undefined, NaN\n\n\n if (Object(_jsutils_isInvalid__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(value)) {\n return null;\n } // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_6__[\"isListType\"])(type)) {\n var itemType = type.ofType;\n\n if (Object(iterall__WEBPACK_IMPORTED_MODULE_0__[\"isCollection\"])(value)) {\n var valuesNodes = [];\n Object(iterall__WEBPACK_IMPORTED_MODULE_0__[\"forEach\"])(value, function (item) {\n var itemNode = astFromValue(item, itemType);\n\n if (itemNode) {\n valuesNodes.push(itemNode);\n }\n });\n return {\n kind: _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].LIST,\n values: valuesNodes\n };\n }\n\n return astFromValue(value, itemType);\n } // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object according to the fields in the input type.\n\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_6__[\"isInputObjectType\"])(type)) {\n if (value === null || _typeof(value) !== 'object') {\n return null;\n }\n\n var fields = Object(_polyfills_objectValues__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(type.getFields());\n var fieldNodes = [];\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = fields[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var field = _step.value;\n var fieldValue = astFromValue(value[field.name], field.type);\n\n if (fieldValue) {\n fieldNodes.push({\n kind: _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].OBJECT_FIELD,\n name: {\n kind: _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].NAME,\n value: field.name\n },\n value: fieldValue\n });\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return {\n kind: _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].OBJECT,\n fields: fieldNodes\n };\n }\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_6__[\"isLeafType\"])(type)) {\n // Since value is an internally represented value, it must be serialized\n // to an externally represented value before converting into an AST.\n var serialized = type.serialize(value);\n\n if (Object(_jsutils_isNullish__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(serialized)) {\n return null;\n } // Others serialize based on their corresponding JavaScript scalar types.\n\n\n if (typeof serialized === 'boolean') {\n return {\n kind: _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].BOOLEAN,\n value: serialized\n };\n } // JavaScript numbers can be Int or Float values.\n\n\n if (typeof serialized === 'number') {\n var stringNum = String(serialized);\n return integerStringRegExp.test(stringNum) ? {\n kind: _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].INT,\n value: stringNum\n } : {\n kind: _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].FLOAT,\n value: stringNum\n };\n }\n\n if (typeof serialized === 'string') {\n // Enum types use Enum literals.\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_6__[\"isEnumType\"])(type)) {\n return {\n kind: _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].ENUM,\n value: serialized\n };\n } // ID types can use Int literals.\n\n\n if (type === _type_scalars__WEBPACK_IMPORTED_MODULE_7__[\"GraphQLID\"] && integerStringRegExp.test(serialized)) {\n return {\n kind: _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].INT,\n value: serialized\n };\n }\n\n return {\n kind: _language_kinds__WEBPACK_IMPORTED_MODULE_5__[\"Kind\"].STRING,\n value: serialized\n };\n }\n\n throw new TypeError(\"Cannot convert value to AST: \".concat(Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(serialized)));\n } // Not reachable. All possible input types have been considered.\n\n /* istanbul ignore next */\n\n\n throw new Error(\"Unexpected input type: \\\"\".concat(Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(type), \"\\\".\"));\n}", "async function makePackAction(lifecycle, { type, promise, meta={} }) {\n // Manually set payload to mimick what happens in redux-pack middleware\n return {\n type,\n payload: (lifecycle != LIFECYCLE.START) ? await promise : undefined,\n meta: {\n ...meta,\n [KEY.LIFECYCLE]: lifecycle\n }\n }\n}", "function main() {\n var _a;\n return __awaiter(this, void 0, void 0, function () {\n var sourceFile, generatedFileName, apiName, error_1;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _b.trys.push([0, 2, , 3]);\n return [4 /*yield*/, Ambrosia.initializeAsync(Ambrosia.LBInitMode.CodeGen)];\n case 1:\n _b.sent();\n sourceFile = Utils.getCommandLineArg(\"sourceFile\");\n generatedFileName = (_a = Utils.getCommandLineArg(\"generatedFileName\", \"TestOutput\")) !== null && _a !== void 0 ? _a : \"TestOutput\";\n apiName = Path.basename(generatedFileName).replace(Path.extname(generatedFileName), \"\");\n // If want to run as separate generation steps for consumer and publisher\n //Meta.emitTypeScriptFileFromSource(sourceFile, { fileKind: Meta.GeneratedFileKind.Consumer, mergeType: Meta.FileMergeType.None, emitGeneratedTime: false, generatedFileName: generatedFileName+\"_Consumer\" });\n //Meta.emitTypeScriptFileFromSource(sourceFile, { fileKind: Meta.GeneratedFileKind.Publisher, mergeType: Meta.FileMergeType.None, emitGeneratedTime: false, generatedFileName: generatedFileName+\"_Publisher\" });\n // Use this for single call to generate both consumer and publisher\n Meta.emitTypeScriptFileFromSource(sourceFile, { apiName: apiName, fileKind: Meta.GeneratedFileKind.All, mergeType: Meta.FileMergeType.None, emitGeneratedTime: false, generatedFilePrefix: generatedFileName, strictCompilerChecks: false });\n return [3 /*break*/, 3];\n case 2:\n error_1 = _b.sent();\n Utils.tryLog(error_1);\n return [3 /*break*/, 3];\n case 3: return [2 /*return*/];\n }\n });\n });\n}", "static define(spec) { return new StreamLanguage(spec); }", "createFlow() {\n // Very simple random unique ID generator\n this.formattedFlow.flowId = `${new Date().getTime()}`;\n this.formattedFlow.flowName = this.originalFlow.flow;\n this.formattedFlow.comment = this.originalFlow.comment;\n this.formattedFlow.startAt = this.originalFlow.startAt;\n this.formattedFlow.states = Object.assign({}, this.originalFlow.states);\n this.formattedFlow.flowStartTime = new Date().getTime();\n this.formattedFlow.flowExecutionTime = '';\n\n return { isError: false, code: this.code, item: this.formattedFlow };\n }", "function parsePrimaryType() {\n var params = null, returnType = null,\n marker = markerCreate(), rest = null, tmp,\n typeParameters, token, type, isGroupedType = false;\n \n switch (lookahead.type) {\n case Token.Identifier:\n switch (lookahead.value) {\n case 'any':\n lex();\n return markerApply(marker, delegate.createAnyTypeAnnotation());\n case 'bool': // fallthrough\n case 'boolean':\n lex();\n return markerApply(marker, delegate.createBooleanTypeAnnotation());\n case 'number':\n lex();\n return markerApply(marker, delegate.createNumberTypeAnnotation());\n case 'string':\n lex();\n return markerApply(marker, delegate.createStringTypeAnnotation());\n }\n return markerApply(marker, parseGenericType());\n case Token.Punctuator:\n switch (lookahead.value) {\n case '{':\n return markerApply(marker, parseObjectType());\n case '[':\n return parseTupleType();\n case '<':\n typeParameters = parseTypeParameterDeclaration();\n expect('(');\n tmp = parseFunctionTypeParams();\n params = tmp.params;\n rest = tmp.rest;\n expect(')');\n \n expect('=>');\n \n returnType = parseType();\n \n return markerApply(marker, delegate.createFunctionTypeAnnotation(\n params,\n returnType,\n rest,\n typeParameters\n ));\n case '(':\n lex();\n // Check to see if this is actually a grouped type\n if (!match(')') && !match('...')) {\n if (lookahead.type === Token.Identifier) {\n token = lookahead2();\n isGroupedType = token.value !== '?' && token.value !== ':';\n } else {\n isGroupedType = true;\n }\n }\n \n if (isGroupedType) {\n type = parseType();\n expect(')');\n \n // If we see a => next then someone was probably confused about\n // function types, so we can provide a better error message\n if (match('=>')) {\n throwError({}, Messages.ConfusedAboutFunctionType);\n }\n \n return type;\n }\n \n tmp = parseFunctionTypeParams();\n params = tmp.params;\n rest = tmp.rest;\n \n expect(')');\n \n expect('=>');\n \n returnType = parseType();\n \n return markerApply(marker, delegate.createFunctionTypeAnnotation(\n params,\n returnType,\n rest,\n null /* typeParameters */\n ));\n }\n break;\n case Token.Keyword:\n switch (lookahead.value) {\n case 'void':\n return markerApply(marker, parseVoidType());\n case 'typeof':\n return markerApply(marker, parseTypeofType());\n }\n break;\n case Token.StringLiteral:\n token = lex();\n if (token.octal) {\n throwError(token, Messages.StrictOctalLiteral);\n }\n return markerApply(marker, delegate.createStringLiteralTypeAnnotation(\n token\n ));\n }\n \n throwUnexpected(lookahead);\n }", "function toParser(p){\r\n return (typeof p == \"string\") ? string(p) : \r\n isArray(p) ? resolve(p) : p;\r\n}", "function astFromValue(value, type) {\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_9__[\"isNonNullType\"])(type)) {\n var astValue = astFromValue(value, type.ofType);\n\n if ((astValue === null || astValue === void 0 ? void 0 : astValue.kind) === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].NULL) {\n return null;\n }\n\n return astValue;\n } // only explicit null, not undefined, NaN\n\n\n if (value === null) {\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].NULL\n };\n } // undefined\n\n\n if (value === undefined) {\n return null;\n } // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_9__[\"isListType\"])(type)) {\n var itemType = type.ofType;\n\n if (Object(_jsutils_isCollection_mjs__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(value)) {\n var valuesNodes = []; // Since we transpile for-of in loose mode it doesn't support iterators\n // and it's required to first convert iteratable into array\n\n for (var _i2 = 0, _arrayFrom2 = Object(_polyfills_arrayFrom_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(value); _i2 < _arrayFrom2.length; _i2++) {\n var item = _arrayFrom2[_i2];\n var itemNode = astFromValue(item, itemType);\n\n if (itemNode != null) {\n valuesNodes.push(itemNode);\n }\n }\n\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].LIST,\n values: valuesNodes\n };\n }\n\n return astFromValue(value, itemType);\n } // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object according to the fields in the input type.\n\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_9__[\"isInputObjectType\"])(type)) {\n if (!Object(_jsutils_isObjectLike_mjs__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(value)) {\n return null;\n }\n\n var fieldNodes = [];\n\n for (var _i4 = 0, _objectValues2 = Object(_polyfills_objectValues_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(type.getFields()); _i4 < _objectValues2.length; _i4++) {\n var field = _objectValues2[_i4];\n var fieldValue = astFromValue(value[field.name], field.type);\n\n if (fieldValue) {\n fieldNodes.push({\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].OBJECT_FIELD,\n name: {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].NAME,\n value: field.name\n },\n value: fieldValue\n });\n }\n }\n\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].OBJECT,\n fields: fieldNodes\n };\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_9__[\"isLeafType\"])(type)) {\n // Since value is an internally represented value, it must be serialized\n // to an externally represented value before converting into an AST.\n var serialized = type.serialize(value);\n\n if (serialized == null) {\n return null;\n } // Others serialize based on their corresponding JavaScript scalar types.\n\n\n if (typeof serialized === 'boolean') {\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].BOOLEAN,\n value: serialized\n };\n } // JavaScript numbers can be Int or Float values.\n\n\n if (typeof serialized === 'number' && Object(_polyfills_isFinite_mjs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(serialized)) {\n var stringNum = String(serialized);\n return integerStringRegExp.test(stringNum) ? {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].INT,\n value: stringNum\n } : {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].FLOAT,\n value: stringNum\n };\n }\n\n if (typeof serialized === 'string') {\n // Enum types use Enum literals.\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_9__[\"isEnumType\"])(type)) {\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].ENUM,\n value: serialized\n };\n } // ID types can use Int literals.\n\n\n if (type === _type_scalars_mjs__WEBPACK_IMPORTED_MODULE_8__[\"GraphQLID\"] && integerStringRegExp.test(serialized)) {\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].INT,\n value: serialized\n };\n }\n\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].STRING,\n value: serialized\n };\n }\n\n throw new TypeError(\"Cannot convert value to AST: \".concat(Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(serialized), \".\"));\n } // istanbul ignore next (Not reachable. All possible input types have been considered)\n\n\n false || Object(_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(0, 'Unexpected input type: ' + Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(type));\n}", "function astFromValue(value, type) {\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_9__[\"isNonNullType\"])(type)) {\n var astValue = astFromValue(value, type.ofType);\n\n if ((astValue === null || astValue === void 0 ? void 0 : astValue.kind) === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].NULL) {\n return null;\n }\n\n return astValue;\n } // only explicit null, not undefined, NaN\n\n\n if (value === null) {\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].NULL\n };\n } // undefined\n\n\n if (value === undefined) {\n return null;\n } // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_9__[\"isListType\"])(type)) {\n var itemType = type.ofType;\n\n if (Object(_jsutils_isCollection_mjs__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(value)) {\n var valuesNodes = []; // Since we transpile for-of in loose mode it doesn't support iterators\n // and it's required to first convert iteratable into array\n\n for (var _i2 = 0, _arrayFrom2 = Object(_polyfills_arrayFrom_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(value); _i2 < _arrayFrom2.length; _i2++) {\n var item = _arrayFrom2[_i2];\n var itemNode = astFromValue(item, itemType);\n\n if (itemNode != null) {\n valuesNodes.push(itemNode);\n }\n }\n\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].LIST,\n values: valuesNodes\n };\n }\n\n return astFromValue(value, itemType);\n } // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object according to the fields in the input type.\n\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_9__[\"isInputObjectType\"])(type)) {\n if (!Object(_jsutils_isObjectLike_mjs__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(value)) {\n return null;\n }\n\n var fieldNodes = [];\n\n for (var _i4 = 0, _objectValues2 = Object(_polyfills_objectValues_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(type.getFields()); _i4 < _objectValues2.length; _i4++) {\n var field = _objectValues2[_i4];\n var fieldValue = astFromValue(value[field.name], field.type);\n\n if (fieldValue) {\n fieldNodes.push({\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].OBJECT_FIELD,\n name: {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].NAME,\n value: field.name\n },\n value: fieldValue\n });\n }\n }\n\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].OBJECT,\n fields: fieldNodes\n };\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_9__[\"isLeafType\"])(type)) {\n // Since value is an internally represented value, it must be serialized\n // to an externally represented value before converting into an AST.\n var serialized = type.serialize(value);\n\n if (serialized == null) {\n return null;\n } // Others serialize based on their corresponding JavaScript scalar types.\n\n\n if (typeof serialized === 'boolean') {\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].BOOLEAN,\n value: serialized\n };\n } // JavaScript numbers can be Int or Float values.\n\n\n if (typeof serialized === 'number' && Object(_polyfills_isFinite_mjs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(serialized)) {\n var stringNum = String(serialized);\n return integerStringRegExp.test(stringNum) ? {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].INT,\n value: stringNum\n } : {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].FLOAT,\n value: stringNum\n };\n }\n\n if (typeof serialized === 'string') {\n // Enum types use Enum literals.\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_9__[\"isEnumType\"])(type)) {\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].ENUM,\n value: serialized\n };\n } // ID types can use Int literals.\n\n\n if (type === _type_scalars_mjs__WEBPACK_IMPORTED_MODULE_8__[\"GraphQLID\"] && integerStringRegExp.test(serialized)) {\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].INT,\n value: serialized\n };\n }\n\n return {\n kind: _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].STRING,\n value: serialized\n };\n }\n\n throw new TypeError(\"Cannot convert value to AST: \".concat(Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(serialized), \".\"));\n } // istanbul ignore next (Not reachable. All possible input types have been considered)\n\n\n false || Object(_jsutils_invariant_mjs__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(0, 'Unexpected input type: ' + Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(type));\n}", "function processType(typeCache, resLoader, rawType, ctx) {\n var xsdNS = 'http://www.w3.org/2001/XMLSchema';\n if(!rawType || !(ctx instanceof LocalContext))\n throw new Error('Invalid raw type or context.');\n var result = undefined;\n // Function to process attributes\n var processAttrs = function(target) {\n var attrs = { };\n Util.arrayEach(target.attribute, function(attr) {\n attrs[attr.name + ((attr.use === 'required') ? '' : '?')] = stripNS(attr.type);\n }); \n return attrs; \n }\n if(rawType.sequence) {\n result = { '_$attrs': processAttrs(rawType) };\n var processElements = function(elements, context, target) {\n Util.arrayEach(elements, function(el) {\n var elType = undefined,\n elTypeNS = undefined;\n // Find occurrence info\n if(el.minOccurs === 'unbounded') el.minOccurs = 0;\n if(el.maxOccurs === 'unbounded') el.maxOccurs = Number.MAX_VALUE;\n if(typeof el.minOccurs !== 'number') el.minOccurs = 1;\n if(typeof el.maxOccurs !== 'number') el.maxOccurs = 1;\n var namePost = '';\n if(el.minOccurs === 1 && el.maxOccurs === 1) namePost = '';\n else if(el.minOccurs === 0 && el.maxOccurs === 1) namePost = '?';\n else namePost = '*';\n if(el.ref) {\n var referred = context.parseNamespace(el.ref),\n refEl = resLoader.searchInNamespace(referred.namespace, ['element', referred.value]);\n if(!refEl) throw new Error(\n 'Referred element `' + referred.value + '\\' not found in namespace `' + referred.namespace + '\\'.'\n );\n elType = refEl.type;\n elTypeNS = refEl.typeNamespace;\n } else {\n if(!el.type) {\n if(el.complexType) target[el.name + namePost] = processType(typeCache, resLoader, el.complexType, context);\n else if(el.simpleType) throw new Error('Not supported.');\n else throw new Error('Invalid element definition, no type specified.');\n return;\n }\n var parsed = context.parseNamespace(el.type);\n elType = parsed.value;\n elTypeNS = parsed.namespace;\n }\n // Basic Type\n if(elTypeNS === xsdNS) target[el.name + namePost] = elType;\n else {\n // console.log('ns: ' + elTypeNS + ' type: ' + elType);\n cacheType(typeCache, resLoader, elTypeNS, elType, true);\n target[el.name + namePost] = { '_$type': elType, '_$namespace': elTypeNS };\n }\n });\n }\n processElements(rawType.sequence.element, ctx, result);\n Util.arrayEach(rawType.sequence.choice, function(ch) {\n result['_$choices'] = result['_$choices'] || [];\n var thisChoice = { };\n // Find occurrence info\n if(ch.minOccurs === 'unbounded') ch.minOccurs = 0;\n if(ch.maxOccurs === 'unbounded') ch.maxOccurs = Number.MAX_VALUE;\n if(typeof ch.minOccurs !== 'number') ch.minOccurs = 1;\n if(typeof ch.maxOccurs !== 'number') ch.maxOccurs = 1;\n if(ch.minOccurs === 1 && ch.maxOccurs === 1) thisChoice['_$occurrence'] = '';\n else if(ch.minOccurs === 0 && ch.maxOccurs === 1) thisChoice['_$occurrence'] = '?';\n else thisChoice['_$occurrence'] = '*'; \n processElements(ch.element, ctx, thisChoice);\n result['_$choices'].push(thisChoice);\n });\n } else if(rawType.simpleContent || rawType.complexContent) {\n // We're processing some complexType\n // Under complexContent/simpleContent we only support [extension]\n result = processType(typeCache, resLoader, rawType.simpleContent ||rawType.complexContent, ctx); \n } else if(rawType.extension) { \n var baseType = ctx.parseNamespace(rawType.extension.base);\n if(baseType.namespace === xsdNS) {\n // If rawType.extension.base is base type(ie. under xsd namespace), then it has only [attribute]s.\n result = { '_$attrs': processAttrs(rawType.extension) };\n } else {\n // If rawType.extension.base is defined type, then it may have [attribute]s or [sequence,element]s.\n result = processType(typeCache, resLoader, rawType.extension, ctx) || { }; // in case that no sequence is defined.\n cacheType(typeCache, resLoader, baseType.namespace, baseType.value, true);\n result['_$base'] = { '_$type': baseType.value, '_$namespace': baseType.namespace };\n }\n } else if(rawType.restriction) {\n // We're processing some simpleType, only support enumeration for now, and ignore [base].\n result = [];\n Util.arrayEach(rawType.restriction.enumeration, \n function(entry) { entry.value && result.push(entry.value); });\n }\n \n return result;\n}", "if (returnType.isTypeOf) {\n const isTypeOf = returnType.isTypeOf(result, exeContext.contextValue, info);\n\n const promise = getPromise(isTypeOf);\n if (promise) {\n return promise.then(isTypeOfResult => {\n if (!isTypeOfResult) {\n throw invalidReturnTypeError(returnType, result, fieldNodes);\n }\n return collectAndExecuteSubfields(\n exeContext,\n returnType,\n fieldNodes,\n info,\n path,\n result,\n parentDirectiveTree,\n execDetails\n );\n });\n }\n\n if (!isTypeOf) {\n throw invalidReturnTypeError(returnType, result, fieldNodes);\n }\n }", "function readTypeExpression(state) {\n if (fsaTypeAnnotationExpression === null) {\n // Used to read expressions within {} which evaluate to types.\n // Commas must be treated specially as an escape, not a binary operator.\n let fsaOptions = new ExpressionFsa_2.ExpressionFsaOptions();\n fsaOptions.binaryOpsToIgnore = [\",\"];\n fsaOptions.newLineInMiddleDoesNotEndExpression = true;\n fsaTypeAnnotationExpression = new ExpressionFsa_1.ExpressionFsa(fsaOptions);\n }\n let node = fsaTypeAnnotationExpression.runStartToStop(state.ts, state.wholeState);\n state.nodeToFill.params.push(node);\n}", "function PipeDecorator(){}// WARNING: interface has both a type and a value, skipping emit", "toString() {\n var _d;\n // If an Object Type, we use the name of the Object Type\n let type = this.intermediateType ? (_d = this.intermediateType) === null || _d === void 0 ? void 0 : _d.name : this.type;\n // If configured as required, the GraphQL Type becomes required\n type = this.isRequired ? `${type}!` : type;\n // If configured with isXxxList, the GraphQL Type becomes a list\n type = this.isList || this.isRequiredList ? `[${type}]` : type;\n // If configured with isRequiredList, the list becomes required\n type = this.isRequiredList ? `${type}!` : type;\n return type;\n }", "getType(){return this.__type}", "function resolveForwardRef(type){if(typeof type==='function'&&type.hasOwnProperty('__forward_ref__')){return type();}else{return type;}}", "get loadType() {}", "createProducer (structureType, tile) {\n var sType = this.checkStructureType(structureType)\n\n var producer = sType.type === 'refinery'\n ? this.createRefiner(sType.buysFrom, sType.multiplier, sType.reach, tile)\n : this.createPrimaryProducer(sType, tile)\n\n return new AllDecorator({producer: producer, tile: tile})\n }", "function astFromValue(value, type) {\n\t // Ensure flow knows that we treat function params as const.\n\t var _value = value;\n\n\t if (type instanceof _definition.GraphQLNonNull) {\n\t // Note: we're not checking that the result is non-null.\n\t // This function is not responsible for validating the input value.\n\t return astFromValue(_value, type.ofType);\n\t }\n\n\t if ((0, _isNullish2.default)(_value)) {\n\t return null;\n\t }\n\n\t // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n\t // the value is not an array, convert the value using the list's item type.\n\t if (type instanceof _definition.GraphQLList) {\n\t var _ret = function () {\n\t var itemType = type.ofType;\n\t if ((0, _iterall.isCollection)(_value)) {\n\t var _ret2 = function () {\n\t var valuesASTs = [];\n\t (0, _iterall.forEach)(_value, function (item) {\n\t var itemAST = astFromValue(item, itemType);\n\t if (itemAST) {\n\t valuesASTs.push(itemAST);\n\t }\n\t });\n\t return {\n\t v: {\n\t v: { kind: _kinds.LIST, values: valuesASTs }\n\t }\n\t };\n\t }();\n\n\t if (typeof _ret2 === \"object\") return _ret2.v;\n\t }\n\t return {\n\t v: astFromValue(_value, itemType)\n\t };\n\t }();\n\n\t if (typeof _ret === \"object\") return _ret.v;\n\t }\n\n\t // Populate the fields of the input object by creating ASTs from each value\n\t // in the JavaScript object according to the fields in the input type.\n\t if (type instanceof _definition.GraphQLInputObjectType) {\n\t var _ret3 = function () {\n\t if (_value === null || typeof _value !== 'object') {\n\t return {\n\t v: null\n\t };\n\t }\n\t var fields = type.getFields();\n\t var fieldASTs = [];\n\t Object.keys(fields).forEach(function (fieldName) {\n\t var fieldType = fields[fieldName].type;\n\t var fieldValue = astFromValue(_value[fieldName], fieldType);\n\t if (fieldValue) {\n\t fieldASTs.push({\n\t kind: _kinds.OBJECT_FIELD,\n\t name: { kind: _kinds.NAME, value: fieldName },\n\t value: fieldValue\n\t });\n\t }\n\t });\n\t return {\n\t v: { kind: _kinds.OBJECT, fields: fieldASTs }\n\t };\n\t }();\n\n\t if (typeof _ret3 === \"object\") return _ret3.v;\n\t }\n\n\t (0, _invariant2.default)(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType, 'Must provide Input Type, cannot use: ' + String(type));\n\n\t // Since value is an internally represented value, it must be serialized\n\t // to an externally represented value before converting into an AST.\n\t var serialized = type.serialize(_value);\n\t if ((0, _isNullish2.default)(serialized)) {\n\t return null;\n\t }\n\n\t // Others serialize based on their corresponding JavaScript scalar types.\n\t if (typeof serialized === 'boolean') {\n\t return { kind: _kinds.BOOLEAN, value: serialized };\n\t }\n\n\t // JavaScript numbers can be Int or Float values.\n\t if (typeof serialized === 'number') {\n\t var stringNum = String(serialized);\n\t return (/^[0-9]+$/.test(stringNum) ? { kind: _kinds.INT, value: stringNum } : { kind: _kinds.FLOAT, value: stringNum }\n\t );\n\t }\n\n\t if (typeof serialized === 'string') {\n\t // Enum types use Enum literals.\n\t if (type instanceof _definition.GraphQLEnumType) {\n\t return { kind: _kinds.ENUM, value: serialized };\n\t }\n\n\t // ID types can use Int literals.\n\t if (type === _scalars.GraphQLID && /^[0-9]+$/.test(serialized)) {\n\t return { kind: _kinds.INT, value: serialized };\n\t }\n\n\t // Use JSON stringify, which uses the same string encoding as GraphQL,\n\t // then remove the quotes.\n\t return {\n\t kind: _kinds.STRING,\n\t value: JSON.stringify(serialized).slice(1, -1)\n\t };\n\t }\n\n\t throw new TypeError('Cannot convert value to AST: ' + String(serialized));\n\t}", "function type(rule,value,source,errors,options){if(rule.required&&value===undefined){Object(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\"/* default */])(rule,value,source,errors,options);return;}var custom=['integer','float','array','regexp','object','method','email','number','date','url','hex'];var ruleType=rule.type;if(custom.indexOf(ruleType)>-1){if(!types[ruleType](value)){errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\"/* format */](options.messages.types[ruleType],rule.fullField,rule.type));}// straight typeof check\n}else if(ruleType&&(typeof value==='undefined'?'undefined':__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value))!==rule.type){errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\"/* format */](options.messages.types[ruleType],rule.fullField,rule.type));}}", "set loadType(value) {}", "function make(type) {\n if (!knowType(type)) {\n return;\n }\n\n switch (type) {\n case Number:\n prop = options['props'][name] = {\n type: Number,\n default: 0\n };\n break;\n case Boolean:\n prop = options['props'][name] = {\n type: Boolean,\n default: false\n };\n break;\n case Array:\n prop = options['props'][name] = {\n type: Array,\n default: []\n };\n break;\n case String:\n prop = options['props'][name] = {\n type: String,\n default: ''\n };\n break;\n case Object:\n prop = options['props'][name] = {\n type: Object,\n default: null\n };\n break;\n case null:\n prop = options['props'][name] = {\n type: null,\n default: null\n };\n break;\n default:\n break;\n }\n }", "createType (typedefinition, id) {\n var structname = typedefinition[0].struct\n id = id || this.getNextOpId(1)\n var op = Y.Struct[structname].create(id)\n op.type = typedefinition[0].name\n\n this.requestTransaction(function * () {\n if (op.id[0] === '_') {\n yield* this.setOperation(op)\n } else {\n yield* this.applyCreatedOperations([op])\n }\n })\n var t = Y[op.type].typeDefinition.createType(this, op, typedefinition[1])\n this.initializedTypes[JSON.stringify(op.id)] = t\n return t\n }", "function getRawType(type) {\n\t return __webpack_require__(53)(getNamedType(type));\n\t}", "function withCrossFlow(\n//component coming in here has no crossflow type yet, but expects it\nWrappedComponent) {\n var ComponentWithCrossFlow = function (props) {\n var crossFlow = exports.useCrossFlow();\n return react_1.default.createElement(WrappedComponent, tslib_1.__assign({}, props, { crossFlow: crossFlow }));\n };\n ComponentWithCrossFlow.displayName = \"withCrossFlow(\" + (WrappedComponent.displayName ||\n WrappedComponent.name ||\n 'Component') + \")\";\n return ComponentWithCrossFlow;\n}", "function resolveInputToStream(input, globals) {\n var vdom$;\n\n if (Object(_streamy__WEBPACK_IMPORTED_MODULE_0__[\"isStream\"])(input)) {\n // resolve downstream components\n vdom$ = input.flatMap(function (input) {\n var resolved = Object(_streamy_vdom__WEBPACK_IMPORTED_MODULE_1__[\"resolveChild\"])(input, globals); // resolvedChild can return an array of elements but we expect only one\n // TODO make this better\n\n if (Array.isArray(resolved)) {\n resolved = resolved[0];\n } // because we are flatMapping we need to return streams\n\n\n if (!Object(_streamy__WEBPACK_IMPORTED_MODULE_0__[\"isStream\"])(resolved)) {\n return Object(_streamy__WEBPACK_IMPORTED_MODULE_0__[\"stream\"])(resolved);\n }\n\n return resolved;\n }) // a resolved input could return an array but we expect the vdom$\n // to return just one root vdom elem\n .map(function (x) {\n if (Array.isArray(x)) {\n x = x[0];\n }\n\n return x;\n });\n return vdom$;\n }\n\n if (input instanceof _streamy_vdom__WEBPACK_IMPORTED_MODULE_1__[\"Component\"]) {\n vdom$ = input.build(globals);\n vdom$ = resolveInputToStream(vdom$, globals);\n return vdom$;\n } else if (typeof input === \"function\") {\n // simple element constructor\n vdom$ = input({}, [], globals);\n } // reiterate if still not a vdom-stream\n\n\n if (!Object(_streamy__WEBPACK_IMPORTED_MODULE_0__[\"isStream\"])(vdom$)) vdom$ = resolveInputToStream(vdom$, globals);\n return vdom$;\n} // to not mutate the representation of our children from the last iteration we clone them", "function actionCreator(type) {\n return Object.assign((payload) => ({ type, payload }), { type });\n}", "function isOutputType(type) {\n return type instanceof _graphql.GraphQLScalarType || type instanceof _graphql.GraphQLObjectType || type instanceof _graphql.GraphQLInterfaceType || type instanceof _graphql.GraphQLUnionType || type instanceof _graphql.GraphQLEnumType || type instanceof _graphql.GraphQLNonNull && isOutputType(type.ofType) || type instanceof _graphql.GraphQLList && isOutputType(type.ofType);\n} // solve Flow reqursion limit, do not import from graphql.js", "function astFromValue(value, type) {\n if ((0, _definition.isNonNullType)(type)) {\n var astValue = astFromValue(value, type.ofType);\n\n if ((astValue === null || astValue === void 0 ? void 0 : astValue.kind) === _kinds.Kind.NULL) {\n return null;\n }\n\n return astValue;\n } // only explicit null, not undefined, NaN\n\n\n if (value === null) {\n return {\n kind: _kinds.Kind.NULL\n };\n } // undefined\n\n\n if (value === undefined) {\n return null;\n } // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n\n\n if ((0, _definition.isListType)(type)) {\n var itemType = type.ofType;\n\n if ((0, _isCollection[\"default\"])(value)) {\n var valuesNodes = []; // Since we transpile for-of in loose mode it doesn't support iterators\n // and it's required to first convert iteratable into array\n\n for (var _i2 = 0, _arrayFrom2 = (0, _arrayFrom3[\"default\"])(value); _i2 < _arrayFrom2.length; _i2++) {\n var item = _arrayFrom2[_i2];\n var itemNode = astFromValue(item, itemType);\n\n if (itemNode != null) {\n valuesNodes.push(itemNode);\n }\n }\n\n return {\n kind: _kinds.Kind.LIST,\n values: valuesNodes\n };\n }\n\n return astFromValue(value, itemType);\n } // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object according to the fields in the input type.\n\n\n if ((0, _definition.isInputObjectType)(type)) {\n if (!(0, _isObjectLike[\"default\"])(value)) {\n return null;\n }\n\n var fieldNodes = [];\n\n for (var _i4 = 0, _objectValues2 = (0, _objectValues3[\"default\"])(type.getFields()); _i4 < _objectValues2.length; _i4++) {\n var field = _objectValues2[_i4];\n var fieldValue = astFromValue(value[field.name], field.type);\n\n if (fieldValue) {\n fieldNodes.push({\n kind: _kinds.Kind.OBJECT_FIELD,\n name: {\n kind: _kinds.Kind.NAME,\n value: field.name\n },\n value: fieldValue\n });\n }\n }\n\n return {\n kind: _kinds.Kind.OBJECT,\n fields: fieldNodes\n };\n } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618')\n\n\n if ((0, _definition.isLeafType)(type)) {\n // Since value is an internally represented value, it must be serialized\n // to an externally represented value before converting into an AST.\n var serialized = type.serialize(value);\n\n if (serialized == null) {\n return null;\n } // Others serialize based on their corresponding JavaScript scalar types.\n\n\n if (typeof serialized === 'boolean') {\n return {\n kind: _kinds.Kind.BOOLEAN,\n value: serialized\n };\n } // JavaScript numbers can be Int or Float values.\n\n\n if (typeof serialized === 'number' && (0, _isFinite[\"default\"])(serialized)) {\n var stringNum = String(serialized);\n return integerStringRegExp.test(stringNum) ? {\n kind: _kinds.Kind.INT,\n value: stringNum\n } : {\n kind: _kinds.Kind.FLOAT,\n value: stringNum\n };\n }\n\n if (typeof serialized === 'string') {\n // Enum types use Enum literals.\n if ((0, _definition.isEnumType)(type)) {\n return {\n kind: _kinds.Kind.ENUM,\n value: serialized\n };\n } // ID types can use Int literals.\n\n\n if (type === _scalars.GraphQLID && integerStringRegExp.test(serialized)) {\n return {\n kind: _kinds.Kind.INT,\n value: serialized\n };\n }\n\n return {\n kind: _kinds.Kind.STRING,\n value: serialized\n };\n }\n\n throw new TypeError(\"Cannot convert value to AST: \".concat((0, _inspect[\"default\"])(serialized), \".\"));\n } // istanbul ignore next (Not reachable. All possible input types have been considered)\n\n\n false || (0, _invariant[\"default\"])(0, 'Unexpected input type: ' + (0, _inspect[\"default\"])(type));\n}", "obtain(){}", "async build() {\n // on ready\n await new Promise(resolve => this.eden.once('eden.ready', resolve));\n\n // flow setup\n await this.eden.hook('flow.build', FlowHelper);\n }", "function translateType(type) {\n if (type in conf.nativeTypes) {\n var typeType = type;\n return {\n type: conf.nativeTypes[typeType],\n native: true,\n arraySimple: true,\n };\n }\n var subtype = type.match(/^#\\/definitions\\/(.*)/);\n if (subtype)\n return resolveDefType(subtype[1]);\n return { type: type, native: true, arraySimple: true };\n}", "async function dataFlowsCreate() {\n const subscriptionId =\n process.env[\"DATAFACTORY_SUBSCRIPTION_ID\"] || \"12345678-1234-1234-1234-12345678abc\";\n const resourceGroupName = process.env[\"DATAFACTORY_RESOURCE_GROUP\"] || \"exampleResourceGroup\";\n const factoryName = \"exampleFactoryName\";\n const dataFlowName = \"exampleDataFlow\";\n const dataFlow = {\n properties: {\n type: \"MappingDataFlow\",\n description:\n \"Sample demo data flow to convert currencies showing usage of union, derive and conditional split transformation.\",\n scriptLines: [\n \"source(output(\",\n \"PreviousConversionRate as double,\",\n \"Country as string,\",\n \"DateTime1 as string,\",\n \"CurrentConversionRate as double\",\n \"),\",\n \"allowSchemaDrift: false,\",\n \"validateSchema: false) ~> USDCurrency\",\n \"source(output(\",\n \"PreviousConversionRate as double,\",\n \"Country as string,\",\n \"DateTime1 as string,\",\n \"CurrentConversionRate as double\",\n \"),\",\n \"allowSchemaDrift: true,\",\n \"validateSchema: false) ~> CADSource\",\n \"USDCurrency, CADSource union(byName: true)~> Union\",\n \"Union derive(NewCurrencyRate = round(CurrentConversionRate*1.25)) ~> NewCurrencyColumn\",\n \"NewCurrencyColumn split(Country == 'USD',\",\n \"Country == 'CAD',disjoint: false) ~> ConditionalSplit1@(USD, CAD)\",\n \"ConditionalSplit1@USD sink(saveMode:'overwrite' ) ~> USDSink\",\n \"ConditionalSplit1@CAD sink(saveMode:'overwrite' ) ~> CADSink\",\n ],\n sinks: [\n {\n name: \"USDSink\",\n dataset: { type: \"DatasetReference\", referenceName: \"USDOutput\" },\n },\n {\n name: \"CADSink\",\n dataset: { type: \"DatasetReference\", referenceName: \"CADOutput\" },\n },\n ],\n sources: [\n {\n name: \"USDCurrency\",\n dataset: {\n type: \"DatasetReference\",\n referenceName: \"CurrencyDatasetUSD\",\n },\n },\n {\n name: \"CADSource\",\n dataset: {\n type: \"DatasetReference\",\n referenceName: \"CurrencyDatasetCAD\",\n },\n },\n ],\n },\n };\n const credential = new DefaultAzureCredential();\n const client = new DataFactoryManagementClient(credential, subscriptionId);\n const result = await client.dataFlows.createOrUpdate(\n resourceGroupName,\n factoryName,\n dataFlowName,\n dataFlow\n );\n console.log(result);\n}", "function astFromValue(value, type) {\n // Ensure flow knows that we treat function params as const.\n var _value = value;\n\n if (type instanceof _definition.GraphQLNonNull) {\n var astValue = astFromValue(_value, type.ofType);\n if (astValue && astValue.kind === _kinds.NULL) {\n return null;\n }\n return astValue;\n }\n\n // only explicit null, not undefined, NaN\n if (_value === null) {\n return { kind: _kinds.NULL };\n }\n\n // undefined, NaN\n if ((0, _isInvalid2.default)(_value)) {\n return null;\n }\n\n // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n if (type instanceof _definition.GraphQLList) {\n var itemType = type.ofType;\n if ((0, _iterall.isCollection)(_value)) {\n var valuesNodes = [];\n (0, _iterall.forEach)(_value, function (item) {\n var itemNode = astFromValue(item, itemType);\n if (itemNode) {\n valuesNodes.push(itemNode);\n }\n });\n return { kind: _kinds.LIST, values: valuesNodes };\n }\n return astFromValue(_value, itemType);\n }\n\n // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object according to the fields in the input type.\n if (type instanceof _definition.GraphQLInputObjectType) {\n if (_value === null || typeof _value !== 'object') {\n return null;\n }\n var fields = type.getFields();\n var fieldNodes = [];\n Object.keys(fields).forEach(function (fieldName) {\n var fieldType = fields[fieldName].type;\n var fieldValue = astFromValue(_value[fieldName], fieldType);\n if (fieldValue) {\n fieldNodes.push({\n kind: _kinds.OBJECT_FIELD,\n name: { kind: _kinds.NAME, value: fieldName },\n value: fieldValue\n });\n }\n });\n return { kind: _kinds.OBJECT, fields: fieldNodes };\n }\n\n (0, _invariant2.default)(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType, 'Must provide Input Type, cannot use: ' + String(type));\n\n // Since value is an internally represented value, it must be serialized\n // to an externally represented value before converting into an AST.\n var serialized = type.serialize(_value);\n if ((0, _isNullish2.default)(serialized)) {\n return null;\n }\n\n // Others serialize based on their corresponding JavaScript scalar types.\n if (typeof serialized === 'boolean') {\n return { kind: _kinds.BOOLEAN, value: serialized };\n }\n\n // JavaScript numbers can be Int or Float values.\n if (typeof serialized === 'number') {\n var stringNum = String(serialized);\n return (/^[0-9]+$/.test(stringNum) ? { kind: _kinds.INT, value: stringNum } : { kind: _kinds.FLOAT, value: stringNum }\n );\n }\n\n if (typeof serialized === 'string') {\n // Enum types use Enum literals.\n if (type instanceof _definition.GraphQLEnumType) {\n return { kind: _kinds.ENUM, value: serialized };\n }\n\n // ID types can use Int literals.\n if (type === _scalars.GraphQLID && /^[0-9]+$/.test(serialized)) {\n return { kind: _kinds.INT, value: serialized };\n }\n\n // Use JSON stringify, which uses the same string encoding as GraphQL,\n // then remove the quotes.\n return {\n kind: _kinds.STRING,\n value: JSON.stringify(serialized).slice(1, -1)\n };\n }\n\n throw new TypeError('Cannot convert value to AST: ' + String(serialized));\n}", "function astFromValue(value, type) {\n // Ensure flow knows that we treat function params as const.\n var _value = value;\n\n if (type instanceof _definition.GraphQLNonNull) {\n var astValue = astFromValue(_value, type.ofType);\n if (astValue && astValue.kind === Kind.NULL) {\n return null;\n }\n return astValue;\n }\n\n // only explicit null, not undefined, NaN\n if (_value === null) {\n return { kind: Kind.NULL };\n }\n\n // undefined, NaN\n if ((0, _isInvalid2.default)(_value)) {\n return null;\n }\n\n // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n if (type instanceof _definition.GraphQLList) {\n var itemType = type.ofType;\n if ((0, _iterall.isCollection)(_value)) {\n var valuesNodes = [];\n (0, _iterall.forEach)(_value, function (item) {\n var itemNode = astFromValue(item, itemType);\n if (itemNode) {\n valuesNodes.push(itemNode);\n }\n });\n return { kind: Kind.LIST, values: valuesNodes };\n }\n return astFromValue(_value, itemType);\n }\n\n // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object according to the fields in the input type.\n if (type instanceof _definition.GraphQLInputObjectType) {\n if (_value === null || (typeof _value === 'undefined' ? 'undefined' : _typeof(_value)) !== 'object') {\n return null;\n }\n var fields = type.getFields();\n var fieldNodes = [];\n Object.keys(fields).forEach(function (fieldName) {\n var fieldType = fields[fieldName].type;\n var fieldValue = astFromValue(_value[fieldName], fieldType);\n if (fieldValue) {\n fieldNodes.push({\n kind: Kind.OBJECT_FIELD,\n name: { kind: Kind.NAME, value: fieldName },\n value: fieldValue\n });\n }\n });\n return { kind: Kind.OBJECT, fields: fieldNodes };\n }\n\n !(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType) ? (0, _invariant2.default)(0, 'Must provide Input Type, cannot use: ' + String(type)) : void 0;\n\n // Since value is an internally represented value, it must be serialized\n // to an externally represented value before converting into an AST.\n var serialized = type.serialize(_value);\n if ((0, _isNullish2.default)(serialized)) {\n return null;\n }\n\n // Others serialize based on their corresponding JavaScript scalar types.\n if (typeof serialized === 'boolean') {\n return { kind: Kind.BOOLEAN, value: serialized };\n }\n\n // JavaScript numbers can be Int or Float values.\n if (typeof serialized === 'number') {\n var stringNum = String(serialized);\n return (/^[0-9]+$/.test(stringNum) ? { kind: Kind.INT, value: stringNum } : { kind: Kind.FLOAT, value: stringNum }\n );\n }\n\n if (typeof serialized === 'string') {\n // Enum types use Enum literals.\n if (type instanceof _definition.GraphQLEnumType) {\n return { kind: Kind.ENUM, value: serialized };\n }\n\n // ID types can use Int literals.\n if (type === _scalars.GraphQLID && /^[0-9]+$/.test(serialized)) {\n return { kind: Kind.INT, value: serialized };\n }\n\n // Use JSON stringify, which uses the same string encoding as GraphQL,\n // then remove the quotes.\n return {\n kind: Kind.STRING,\n value: JSON.stringify(serialized).slice(1, -1)\n };\n }\n\n throw new TypeError('Cannot convert value to AST: ' + String(serialized));\n}", "function astFromValue(value, type) {\n // Ensure flow knows that we treat function params as const.\n var _value = value;\n\n if (type instanceof _definition.GraphQLNonNull) {\n var astValue = astFromValue(_value, type.ofType);\n if (astValue && astValue.kind === Kind.NULL) {\n return null;\n }\n return astValue;\n }\n\n // only explicit null, not undefined, NaN\n if (_value === null) {\n return { kind: Kind.NULL };\n }\n\n // undefined, NaN\n if ((0, _isInvalid2.default)(_value)) {\n return null;\n }\n\n // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n if (type instanceof _definition.GraphQLList) {\n var itemType = type.ofType;\n if ((0, _iterall.isCollection)(_value)) {\n var valuesNodes = [];\n (0, _iterall.forEach)(_value, function (item) {\n var itemNode = astFromValue(item, itemType);\n if (itemNode) {\n valuesNodes.push(itemNode);\n }\n });\n return { kind: Kind.LIST, values: valuesNodes };\n }\n return astFromValue(_value, itemType);\n }\n\n // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object according to the fields in the input type.\n if (type instanceof _definition.GraphQLInputObjectType) {\n if (_value === null || (typeof _value === 'undefined' ? 'undefined' : _typeof(_value)) !== 'object') {\n return null;\n }\n var fields = type.getFields();\n var fieldNodes = [];\n Object.keys(fields).forEach(function (fieldName) {\n var fieldType = fields[fieldName].type;\n var fieldValue = astFromValue(_value[fieldName], fieldType);\n if (fieldValue) {\n fieldNodes.push({\n kind: Kind.OBJECT_FIELD,\n name: { kind: Kind.NAME, value: fieldName },\n value: fieldValue\n });\n }\n });\n return { kind: Kind.OBJECT, fields: fieldNodes };\n }\n\n !(type instanceof _definition.GraphQLScalarType || type instanceof _definition.GraphQLEnumType) ? (0, _invariant2.default)(0, 'Must provide Input Type, cannot use: ' + String(type)) : void 0;\n\n // Since value is an internally represented value, it must be serialized\n // to an externally represented value before converting into an AST.\n var serialized = type.serialize(_value);\n if ((0, _isNullish2.default)(serialized)) {\n return null;\n }\n\n // Others serialize based on their corresponding JavaScript scalar types.\n if (typeof serialized === 'boolean') {\n return { kind: Kind.BOOLEAN, value: serialized };\n }\n\n // JavaScript numbers can be Int or Float values.\n if (typeof serialized === 'number') {\n var stringNum = String(serialized);\n return (/^[0-9]+$/.test(stringNum) ? { kind: Kind.INT, value: stringNum } : { kind: Kind.FLOAT, value: stringNum }\n );\n }\n\n if (typeof serialized === 'string') {\n // Enum types use Enum literals.\n if (type instanceof _definition.GraphQLEnumType) {\n return { kind: Kind.ENUM, value: serialized };\n }\n\n // ID types can use Int literals.\n if (type === _scalars.GraphQLID && /^[0-9]+$/.test(serialized)) {\n return { kind: Kind.INT, value: serialized };\n }\n\n // Use JSON stringify, which uses the same string encoding as GraphQL,\n // then remove the quotes.\n return {\n kind: Kind.STRING,\n value: JSON.stringify(serialized).slice(1, -1)\n };\n }\n\n throw new TypeError('Cannot convert value to AST: ' + String(serialized));\n}", "constructor(type) { \n this.type = type \n this.parser = null\n }", "function pump (\n gen: Generator<any, any, any>,\n controller: ReadableStreamController,\n resolve: ?anyFn ): ?mixed {\n\n // Clear queue\n events.off( readyEvt );\n\n // Check stream state\n let backpressure: boolean = controller.desiredSize <= 0;\n\n // Wait for backpressure to ease\n if ( backpressure ) {\n return events.on( readyEvt, () => {\n pump( gen, controller, resolve );\n });\n }\n\n // Ready? proceed\n let\n // Check readable status\n step = controller[closedProp] ? gen.return(true) : gen.next(false),\n { done, value } = step;\n\n // Check for EOS and enqueue\n if ( value === EOS ) {\n controller.close();\n done = true;\n\n } else {\n // Enqueue\n controller.enqueue( value );\n }\n\n // Generator exhausted? resolve promise\n if ( done ) {\n return resolve && resolve();\n }\n\n // Else rinse, repeat\n return pump( gen, controller, resolve );\n}", "function factory (type, config, load, typed) {\n const std = load(require('../../function/statistics/std'))\n\n return typed('std', {\n '...any': function (args) {\n // change last argument dim from one-based to zero-based\n if (args.length >= 2 && isCollection(args[0])) {\n const dim = args[1]\n if (type.isNumber(dim)) {\n args[1] = dim - 1\n } else if (type.isBigNumber(dim)) {\n args[1] = dim.minus(1)\n }\n }\n\n try {\n return std.apply(null, args)\n } catch (err) {\n throw errorTransform(err)\n }\n }\n })\n}", "function MakeDatatype(tabbing, datatype, sourceDir, extendsFrom) {\n var enumTemplate = GetCompiledTemplate(path.resolve(sourceDir, \"templates/Enum.d.ts.ejs\"));\n var interfaceTemplate = GetCompiledTemplate(path.resolve(sourceDir, \"templates/Interface.d.ts.ejs\"));\n \n var locals = {\n datatype: datatype,\n tabbing: tabbing\n };\n \n if (datatype.isenum) {\n locals.enumvalues = datatype.enumvalues;\n return enumTemplate(locals);\n } else {\n locals.extendsFrom = extendsFrom;\n locals.properties = datatype.properties;\n locals.GenerateSummary = GenerateSummary;\n locals.GetProperty = GetProperty;\n return interfaceTemplate(locals);\n }\n}", "* initType (id, args) {\n var sid = JSON.stringify(id)\n var t = this.store.initializedTypes[sid]\n if (t == null) {\n var op/* :MapStruct | ListStruct */ = yield* this.getOperation(id)\n if (op != null) {\n t = yield* Y[op.type].typeDefinition.initType.call(this, this.store, op, args)\n this.store.initializedTypes[sid] = t\n }\n }\n return t\n }" ]
[ "0.6021028", "0.57973087", "0.5684701", "0.56819445", "0.5322835", "0.53035563", "0.52247864", "0.503843", "0.4999311", "0.49831748", "0.4957687", "0.49325165", "0.48940253", "0.4836136", "0.4813239", "0.4812697", "0.4781046", "0.4756906", "0.4656571", "0.46375892", "0.46305478", "0.46243182", "0.46222353", "0.46210113", "0.45985118", "0.4597864", "0.4597571", "0.45900443", "0.45859978", "0.45746708", "0.45474827", "0.45349774", "0.45338997", "0.4533219", "0.4524924", "0.45230094", "0.45025402", "0.44917405", "0.44860458", "0.44859064", "0.44735485", "0.44567508", "0.44552642", "0.44535533", "0.44529584", "0.44508576", "0.44415122", "0.44369152", "0.44368994", "0.44368994", "0.44292456", "0.4427764", "0.44233593", "0.44144887", "0.4404498", "0.44020274", "0.43937033", "0.438363", "0.43800884", "0.4379704", "0.4378037", "0.43654665", "0.43627882", "0.43498206", "0.4347966", "0.43460217", "0.4341964", "0.43371388", "0.43371388", "0.43184045", "0.43184042", "0.4317814", "0.43174937", "0.43125406", "0.4308564", "0.43044883", "0.4299818", "0.42968297", "0.42920375", "0.42872843", "0.4270792", "0.42680475", "0.42673865", "0.42597616", "0.42593008", "0.42524496", "0.42517996", "0.4248304", "0.4240037", "0.423199", "0.42296126", "0.42294115", "0.42266992", "0.42182288", "0.42152512", "0.42152512", "0.42131326", "0.4212524", "0.42102492", "0.42095938", "0.42044765" ]
0.0
-1
Builds the SQL Query for retrieving all petitions from the DB
function buildGetPetitionsQuery(queries){ let q = "SELECT petition_id as petitionId, title, Category.name as category, User.name as authorName, " + "(SELECT count(*) FROM Signature WHERE Signature.petition_id=Petition.petition_id) as signatureCount " + "FROM Petition " + "INNER JOIN Category ON Category.category_id=Petition.category_id " + "INNER JOIN User ON author_id=user_id "; let constraints = []; //Check if the 'q' query exists, if so add the relevant constraint if(queries["q"]) { constraints.push(`title LIKE "%${queries["q"]}%"`); } //Check if the 'categoryId' query exists, if so add the relevant constraint if(queries["categoryId"]) { constraints.push(`Petition.category_id = ${queries["categoryId"]}`); } //Check if the 'authorId' query exists, if so add the relevant constraint if(queries["authorId"]) { constraints.push(`Petition.author_id = ${queries["authorId"]}`); } //If there is a query, add it to the SQL query if(constraints.length > 0) { q += 'WHERE'; for(let constraint of constraints) { q += ` ${constraint} AND` } //We need to remove the trailing 'AND', slice it from the string q = q.slice(0, -3); } //Check if the 'sortBy' query exists, if so add the requested ordering if(queries["sortBy"]) { switch(queries["sortBy"]) { case "ALPHABETICAL_ASC": q += "ORDER BY title ASC, petitionId ASC"; break; case "ALPHABETICAL_DESC": q += "ORDER BY title DESC,Completed /petitions endpoint petitionId ASC"; break; case "SIGNATURES_ASC": q += "ORDER BY signatureCount ASC, petitionId ASC"; break; case "SIGNATURES_DESC": q += "ORDER BY signatureCount DESC, petitionId ASC"; break; default: //Use the Node.js implementation to specify an error code throw new ApiError('sortBy query unavailable', 400); } } else { //Default sorting mode q += "ORDER BY signatureCount DESC, petitionId ASC"; } return q; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "findAll() {\n return db.many(`\n SELECT *\n FROM parks p\n ORDER BY p.name\n `);\n }", "_generateTableListQuery(table, conditions = {}, forUpdate = false) {\n assert(typeof table === 'string', 'must provide table');\n assert(typeof conditions === 'object', 'conditions must be object');\n\n let query = `SELECT * FROM ${table}`;\n let values = [];\n\n let k = Object.keys(conditions);\n\n if (k.length > 0) {\n let whereClauses = [];\n let paramIndex = 1;\n for (let condition in conditions) {\n if (Array.isArray(conditions[condition])) {\n let conditionClauses = [];\n for (let value of conditions[condition]) {\n conditionClauses.push(`${table}.${condition} = $${paramIndex}`);\n values.push(value);\n paramIndex++;\n }\n conditionClauses = conditionClauses.join(' OR ');\n if (k.length === 1) {\n whereClauses.push(conditionClauses);\n } else {\n whereClauses.push(`(${conditionClauses})`);\n }\n } else {\n whereClauses.push(`${table}.${condition} = $${paramIndex}`);\n values.push(conditions[condition]);\n paramIndex++;\n }\n }\n\n query += ' WHERE ';\n query += whereClauses.join(' AND ');\n }\n\n if (forUpdate) {\n query += ' FOR UPDATE';\n }\n\n query += ';';\n\n return {text: query, values: values};\n }", "function getAllCriteria() {\n let ourQuery = 'SELECT criteriaID, criteriaName FROM QAA.criteria_TB';\n return makeConnection.mysqlQueryExecution(ourQuery, mySqlConfig);\n}", "async all() {\n // Comprehend and validate this querys essence.\n const {conditions, modifiers, returns} = this._validatedEssence(\n 'conditions', 'modifiers', 'returns'\n );\n\n // Retrieve the rows.\n const {rows} = await this.session._emit(...processSqlTokens([\n 'select', returns || '*',\n 'from', this.hostSchema.collection,\n 'where', conditions || 'true',\n modifiers\n ]));\n // If a return value set was explicitly specified, return the pure\n // rows.\n if (this.essence.returns) return rows;\n\n // ...otherwise resolve the rows to models using the parent session.\n return rows.map(row => this.session._resolveModel(this.M, row));\n }", "async all() {\n return this.db.any(\n 'SELECT $(columns:name) FROM $(table:name)',\n {\n columns: ['firstname', 'lastname', 'email', 'department'],\n table: this.table,\n },\n )\n .then((users) => users)\n .catch((error) => {\n throw error;\n });\n }", "selectQuery() {\n return `select * from ${this.tablename('select')}`;\n }", "function pet_view_db(tx){\n tx.executeSql('SELECT * FROM Pet',[], pet_view_data, errorDB);\n}", "findAll() {\n return db.many(`\n SELECT * FROM recipes\n `);\n }", "selectOneQuery() {\n return `select * from ${this.tablename('selectOne')} where id = $1`;\n }", "async getSelectQuery (request, reply) {\n // set basic query properties\n const ownerId = globalHelpers.getOwnerIdOrDieTrying(request, reply)\n const table = this.db\n const select = this.getSelectParams()\n\n // set pagination properties\n const pag = request.query\n const limit = pag.limit\n const offset = (pag.page * pag.limit) - pag.limit\n const totalCount = await queries.countRows({ ownerId, table })\n request.totalCount = totalCount\n\n const params = { ownerId, table, select, limit, offset }\n return queries.selectMany(params)\n }", "static async getAllOfThem(){\n const { rows } = await pool.query(\n `SELECT name, type\n FROM animals\n LEFT JOIN species\n ON animals.species_id = species.id`\n );\n return rows;\n }", "toSQL() {\n return this.knexQuery.toSQL();\n }", "getEfforts () {\n return this.db.many(sql.getEfforts)\n }", "function buildSQLString (parsedQueryObject, cb) {\n\n try {\n\n let toSelect = _.uniq(_.concat(parsedQueryObject.categoryNames, \n parsedQueryObject.fields, \n alwaysSelected).filter(k => k))\n\n // If a category is no specified\n let wherePredicates = _.defaults(parsedQueryObject.categoryPredicates, defaultCategoryPredicates)\n\n\n // If no geography codes are provided, we default to returning the data for all the states.\n if (!wherePredicates.geography) {\n return cb(new Error('One or more geography codes must be specified.'))\n }\n\n parsedQueryObject.sqlStatement = \n 'SELECT ' + toSelect.join(', ') + '\\n' +\n 'FROM ' + parsedQueryObject.tableName + '\\n' + \n 'WHERE ' + \n _.map(wherePredicates, (reqCategoryValues, categoryName) => {\n\n // The client specified requested values for the category.\n if (reqCategoryValues && reqCategoryValues.length) {\n // For geographies, we do a prefix match\n // This allows us to get all the metro-level data for a state, for example.\n if (categoryName === 'geography') {\n // For prefix matching, we remove the zero padding if it exists.\n // Because some state fips codes start with zero, we must take care \n // not to remove the leading zeroes of the padded fips code... thus the `{2,5}`.\n let codes = reqCategoryValues.map(code => code.replace(/^0{2,5}/, ''))\n return '(' + codes.map(code => `(geography = '${code}')`).join(' OR ') + ')'\n }\n\n if (categoryName === 'industry') {\n let codes = reqCategoryValues.map(code => code.replace(/^0{3}/, ''))\n return '(' + codes.map(code => `(industry = '${code}')`).join(' OR ') + ')'\n }\n\n // Years and quarters are numeric data types in the table.\n if (categoryName === 'quarter') {\n let quarters = reqCategoryValues.map(i => parseInt(i))\n\n return '(' + quarters.map(qtr => `(quarter = ${qtr})`).join(' OR ') + ')'\n }\n\n // Years and quarters are numeric data types in the table.\n if (categoryName === 'year') {\n\n let years = reqCategoryValues.map(year => parseInt(year)).sort()\n\n if (years.length === 2) {\n return `(year BETWEEN ${years[0]} AND ${years[1]})`\n }\n\n return '(' + years.map(val => `(year = ${val})`).join(' OR ') + ')'\n }\n\n // Not a special case\n return '(' + reqCategoryValues.map(val => `(${categoryName} = '${val.toUpperCase()}')`).join(' OR ') + ')'\n\n } else {\n // No requested values for the category that were requested.\n // In this case, if the category has a default value that represents\n // the sum across all members of the category, we exclude that value from the result.\n return (_.includes(alwaysSelected, categoryName)) ? '' :\n '(' + `${categoryName} <> '${categoryVariableDefaults[categoryName]}'` + ')'\n }\n\n\n }).filter(s=>s).join(' AND \\n') + \n ';'\n\n return cb(null, parsedQueryObject)\n } catch (err) {\n return cb(err)\n }\n}", "function CreateDatabaseQuery() {}", "toQuery() {\n return this.knexQuery.toQuery();\n }", "function constructSelectQuery( p_table, p_data, p_selectAll, p_keyword ){\n // The # of properties there are in the object\n var len = getObjLength( p_data ); \n // Tracks the current # of properties in the object\n var keyCount = 0;\n\n // Beginning the sql string\n var sql = \"SELECT * FROM \" + p_table;\n // If selectAll is true then the statement ends at the beginning\n if( p_selectAll == false ){\n sql += \" WHERE \";\n for( key in p_data ){\n sql += key;\n\n // Add on ilike if its keyword/pattern or in if its specific value\n sql += ( (p_keyword==true) ? \"\":\" IN (\" );\n for( var i=0; i<p_data[key].length; i++ ){\n // Open % or quote\n sql += ( (p_keyword==true) ? \" ILIKE '%\" : \"'\" );\n\n // Value\n sql += p_data[key][i];\n\n // Close % or quote\n sql += ( (p_keyword==true) ? \"%'\":\"'\" );\n\n if ( p_data[key].length > 1 && i < p_data[key].length-1 ){\n sql += ( (p_keyword==true) ? \" OR \" + key:\",\" );\n } \n }\n sql += ( (p_keyword==true) ? \"\":\")\" );\n \n keyCount++; \n // Only add 'and' if the # of properties in the object is greater than 1, and \n // the current property # is less than the # of properties in the object\n if(len > 1 && keyCount < len){\n sql += \" AND \"; \n } \n }\n }\n return sql;\n}", "static async fetchAll() {\n const results = await db.query(\n `\n SELECT ntr.id,\n ntr.name,\n ntr.category,\n ntr.quantity,\n ntr.calories,\n ntr.image_url,\n ntr.user_id AS \"userId\",\n u.email AS \"userEmail\",\n ntr.timestamp AS \"timestamp\" \n FROM nutrition AS ntr\n JOIN users AS u ON u.id = ntr.user_id\n ORDER BY ntr.timestamp DESC \n `\n )\n return results.rows\n }", "getAllRecipes(db) {\r\n return db\r\n .from('recipes AS rec')\r\n .select(\r\n 'rec.id',\r\n 'rec.user_id',\r\n 'rec.name',\r\n 'rec.author',\r\n 'rec.instructions',\r\n 'rec.prep_time_hours',\r\n 'rec.prep_time_minutes',\r\n 'rec.servings',\r\n 'rec.date_created',\r\n );\r\n }", "toSql() {\n h.print(this.query.toString());\n\n return this;\n }", "function queryInterviewDatabase() { \n console.log('Reading rows from the Table...');\n\n // Read all rows from table\n request = new Request(\"select * from interviewData;\", (err, rowCount, rows) => {\n console.log(rowCount + ' row(s) returned');\n process.exit();\n });\n\n request.on('row', function(columns) {\n columns.forEach(function(column) {\n console.log(\"%s\\t%s\", column.metadata.colName, column.value);\n });\n });\n\n connection.execSql(request);\n}", "allData() {\n const sql = 'SELECT * FROM office';\n return this.db.many(sql);\n }", "static fetchAll() {\n return db.execute('SELECT * FROM products');\n }", "static fetchAll() {\n return db.execute('SELECT * FROM products');\n }", "function viewAllEmployeesQuery() {\n return `SELECT e.id, e.first_name, e.last_name, r.title, d.name as department, r.salary, \n CONCAT(m.first_name, ' ', m.last_name) as manager FROM employee e \n INNER JOIN role r ON e.role_id = r.id INNER JOIN department d ON r.department_id = d.id \n LEFT JOIN employee m ON e.manager_id = m.id`;\n}", "function selectQ(conditions){\n\t\t//Table to perform the query on\n\t\tvar table = req.body.qtable;\n\t\tvar operators = req.body.operators;\n\t\tvar s = squel.select();\n\t\ts.from(table);\n\t\t//s.field(...)\n\t\t//This for loop will give away the desired structurefor conditions.\n\t\tvar whereStream = \"\"\n\t\tvar i = 0;\n\t\tfor(var cond in conditions){\n\t\t\t//Supply conditions in one list. Make sure the conditions are safe, legal statements on client-side.\n\t\t\t//If more than one condition then second list \"operators\" will not be empty.\n\t\t\t//This list will specify AND or OR between conditions.\n\t\t\tif(conditions.length>1 && i > 0){\n\t\t\t\twhereStream += \" \" + operators + \" \";\n\t\t\t}\n\t\t\twhereStream += conditions[cond];\n\t\t\ti+=1;\n\t\t}\n\t\ts.where(whereStream);\n\t\treturn s.toString();\n\t}", "static findAll(req, res) {\n // let sql = `SELECT ${table}.booking_id, ${table}.seat_number, ${table}.user_id, ${table}.trip_id, ${table2}.first_name, ${table2}.last_name, ${table2}.email FROM ${table2} JOIN ${table} ON ${table2}.id = ${table}.user_id`;\n // return pool.query(sql);\n let sql = `SELECT bookings.booking_id, bookings.seat_number, bookings.user_id, bookings.trip_id, users.first_name, users.last_name, users.email FROM users JOIN bookings ON users.id = bookings.user_id`;\n return pool.query(sql);\n }", "function queryAllProducts (){\n\tconnection.query(\"SELECT * FROM products\", function(err, res){\n\t\tfor (var i = 0; i < res.length; i++) {\n\t\t\tconsole.log(\"Id: \" + res[i].id + \" | \" + res[i].productName + \" | \" + \"$\" + res[i].price);\n\t\t}\n\t\tconsole.log(\"---------------------------------------------------\");\n\t});\n}", "function showProducts(query) {\n console.log(\"showProducts\");\n \n console.log(\"Selecting all products...\\n\");\n connection.query(query, function (err, res) {\n if (err) throw err;\n // Log all results of the SELECT statement\n for(var i = 0; i<res.length; i++){\n\n //store response for colum fields in variables for string interpolation\n var id = res[i].item_id;\n var name = res[i].product_name;\n var department = res[i].department_name;\n var price = res[i].customer_price;\n var quantity = res[i].stock_quantity;\n console.log(`ID: ${id} | Item: ${name} | Department: ${department} | Price: $${price} | Quantity: ${quantity}`); // console.log('--------------------------------------------------------------------------------------------------')\n \n }\n //create a new table using a javascript constructor \n var t = new Table;\n res.forEach(element => {\n t.cell(\"productID\", element.item_id)\n t.cell(\"productName\", element.product_name)\n t.cell(\"deptName\", element.department_name)\n t.cell(\"custPrice\", element.customer_price)\n t.cell(\"stockQuantity\", element.stock_quantity)\n\n t.newRow()\n\n });\n console.log(t.toString()); \n });\n \n }", "constructor() {\n\t\t/**\n\t\t * This object holds all query parts: tableName, select, where, order_by, and group_by\n\t\t */\n\t\tthis._query = {};\n\t\tthis.opType = 'select';\n\t}", "findAll(sqlRequest, sqlParams) {\n return new Promise(function (resolve, reject) {\n let statement = DB.db.prepare(sqlRequest)\n statement.all(sqlParams, function (err, rows) {\n if (err) {\n reject(\n new DaoError(500, \"Internal server error\")\n )\n } else {\n resolve(rows)\n }\n })\n })\n }", "async function getPacientsListPrestation (data){\n try {\n const query = `SELECT pacient.pacient_firstname, pacient.pacient_lastname, pacient.pacient_mail, procedure_.name, procedure_.procedure_description FROM \"pacient\"\n JOIN \"appointment\"\n ON (pacient.idpacient = appointment.\"FK_idpacient\")\n\t\t\t\tJOIN procedure_\n\t\t\t\tON (\"appointment\".\"FK_idprocedure\" = procedure_.idprocedure)\n WHERE (appointment.appointment_date = $(day) AND appointment.\"FK_idprestacion\" = $(procedure))`;\n const select = await db.query(query, data);\n return select;\n } catch(e) {\n return e;\n }\n \n}", "getAlumnosPgLimit(limit,progra){\n return querys.select(\"select DISTINCT on (uatf_datos.id_ra) * from uatf_datos \\\n INNER JOIN alumnos ON (alumnos.id_ra = uatf_datos.id_ra) where id_programa='\"+ progra +\"' limit \"+limit)\n }", "function sqlBuscarPeliculas(genero, director, actor) {\n var sqlJoin = function() {\n var sql = '';\n if(director > 0) {\n sql += ` JOIN director_pelicula ON pelicula.id = director_pelicula.pelicula_id\n JOIN director ON director_pelicula.director_id = director.id`\n }\n if(actor > 0) {\n sql += ` JOIN actor_pelicula ON pelicula.id = actor_pelicula.pelicula_id\n JOIN actor ON actor_pelicula.actor_id = actor.id`\n }\n return sql;\n }\n\n var sqlFiltros = function() {\n var sql = '';\n if((genero + director + actor) > 0) {\n sql += ' WHERE ';\n }\n if(genero > 0) {\n sql += 'genero_id = ' + genero;\n }\n if(genero > 0 && (director > 0 || actor > 0)) {\n sql += ' AND ';\n }\n if(director > 0) {\n sql += 'director.id = ' + director;\n }\n if(director > 0 && actor > 0) {\n sql += ' AND ';\n }\n if(actor > 0) {\n sql += 'actor.id = ' + actor;\n }\n return sql;\n }\n\n var sql = 'SELECT pelicula.* FROM pelicula' + sqlJoin() + sqlFiltros() + ' ORDER BY RAND() LIMIT 2';\n return sql;\n}", "function getAllPrimates(){\n return new Promise((resolve, reject) => {\n const sql = 'select primates.name, primates.birthYear, sexes.sex, species.species, zoos.name as zoo \\n' +\n 'from primates \\n' +\n 'join sexes on primates.sex = sexes.id \\n' +\n 'join species on primates.species = species.id \\n' +\n 'join zoos on primates.zoo = zoos.id';\n console.log(sql);\n connection.query(sql, function (err, results, fields) {\n if (err) {\n return reject(err);\n }\n return resolve(results);\n });\n });\n}", "function list(){\n return knex(table).select(\"*\")\n}", "function queryAllItems() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n // for (var i = 0; i < res.length; i++) {\n // console.log(\n // res[i].item_id +\n // \" | \" +\n // res[i].product_name +\n // \" | \" +\n // res[i].department +\n // \" | \" +\n // res[i].price +\n // \" | \" +\n // res[i].stock_quantity\n // );\n // }\n // console.log(\"successfully quried products\");\n console.table(res);\n start(res);\n });\n}", "findAll () {\n return knex.select()\n .table(this.table)\n }", "findAll () {\n return knex.select()\n .table(this.table)\n }", "function printCreateTableQueries() {\n for (table in model) {\n query = getCreateTableQuery(table)\n console.log(query)\n }\n}", "static getPatientBookingByDoctorIdSQL(did) {\n let sql = `SELECT PATIENTS.* FROM PATIENTS JOIN DOCTORPATIENTRELATION ON PATIENTS.PatientID = DOCTORPATIENTRELATION.PatientID WHERE DOCTORPATIENTRELATION.DoctorID=${did}`;\n console.log(sql);\n return sql;\n }", "constructor() {\n\t\t/**\n\t\t * This object holds all query parts: tableName, select, where, order_by, and group_by\n\t\t */\n\t\tthis._query = {};\n\t}", "static async viewAll() {\n return Database.select(new Party().table);\n }", "function queryAllRows() {\n connection.query(\"SELECT * FROM products\", function (err, data) {\n if (err) throw err;\n\n console.table(data);\n selectItem(data);\n });\n}", "function build_query(table){\n\tvar where = {};\n\tif (table == 'projects') {\n\t\t// create needed empty object(s) and array(s)\n\t\tif (Object.keys(this.all_groups).length){\n\t\t\twhere['groups'] = {\n\t\t\t\t'id' : {\n\t\t\t\t\t'$in' : []\n\t\t\t\t}\n\t\t\t};\n\t\t\t// add groups to where-object\n\t\t\t$.each(this.all_groups, function(key, val){\n\t\t\t\twhere['groups']['id']['$in'].push(key);\n\t\t\t});\n\t\t}\n\t}\n\tif (table == 'samples') {\n\t\tif (this.projects.length){\n\t\t\t// create needed empty object(s) and array(s)\n\t\t\twhere['project'] = {\n\t\t\t\t'id' : {\n\t\t\t\t\t'$in' : []\n\t\t\t\t}\n\t\t\t};\n\t\t\t$.each(this.projects, function(key, val){\n\t\t\t\twhere['project']['id']['$in'].push(val);\n\t\t\t});\n\t\t}\n\t}\n\tif (table == 'variants' || table == 'only_variants') {\n\t\tif (this.samples.length){\n\t\t\t// create needed empty object(s) and array(s)\n\t\t\twhere['sa'] = {\n\t\t\t\t'id' : {\n\t\t\t\t\t'$in' : []\n\t\t\t\t}\n\t\t\t};\n\t\t\t// add selected samples to where-array\n\t\t\t$.each(this.samples, function(key, val){\n\t\t\t\twhere['sa']['id']['$in'].push(val);\n\t\t\t});\n\t\t}\n\t\t// add required samples to where-array\n\t\tif (this.require.length){\n\t\t\twhere['sa.id'] = {\n\t\t\t\t'$all' : []\n\t\t\t};\n\t\t\t$.each(this.require, function(key, val){\n\t\t\t\t\t\twhere['sa.id']['$all'].push(val);\n\t\t\t});\n\t\t}\n\t\tif (this.exclude.length){\n\t\t\tif (where.hasOwnProperty(\"sa.id\")){\n\t\t\t\twhere['sa.id']['$nin'] = [];\n\t\t\t} else {\n\t\t\t\twhere['sa.id'] = {\n\t\t\t\t\t'$nin' : []\n\t\t\t\t};\n\t\t\t}\n\t\t\t// add excluded samples to where-array\n\t\t\t$.each(this.exclude, function(key, val){\n\t\t\t\t\t\twhere['sa.id']['$nin'].push(val);\n\t\t\t});\n\t\t}\n\t}\n\n\t// put where-array in query\n\treturn (where);\n}", "getRecentEntities(props={}, amount=10) {\n var conditions = []; // get all the props (search parameters), and develop sql conditions\n if (props.firstEntityId) { // if there's a firstEntityId\n conditions.push(`timePosted < (SELECT timePosted FROM entity WHERE entityId = '${this.esc(props.firstEntityId)}')`);\n }\n if (props.userId) { // if there's a userId\n conditions.push(`userId = '${this.esc(props.userId)}'`);\n }\n if (props.tag) { // if there's a tag\n conditions.push(`EXISTS (SELECT * FROM entity_tag WHERE entityId = entity.entityId AND tagName = '${this.esc(props.tag)}')`);\n // I'm really surprised that worked ^. Fucking magic.\n }\n\n var conditional = \"\";\n if (conditions.length > 0) { // form conditional from array\n conditional = \"WHERE \" + conditions.join(\" AND \");\n }\n\n return this.query(`SELECT entity.*,\n COUNT(DISTINCT entity_comment.content) AS comments,\n COUNT(DISTINCT entity_like.userId) AS likes,\n GROUP_CONCAT(DISTINCT entity_tag.tagName) AS tags,\n post.content,\n photo.photo,\n user.username\n FROM entity\n LEFT JOIN entity_comment ON entity_comment.entityId = entity.entityId\n LEFT JOIN entity_like ON entity_like.entityId = entity.entityId\n LEFT JOIN entity_tag ON entity_tag.entityId = entity.entityId\n LEFT JOIN post ON post.entityId = entity.entityId\n LEFT JOIN photo ON photo.entityId = entity.entityId\n LEFT JOIN user ON user.userId = entity.userId\n ${conditional}\n GROUP BY entity.entityId\n ORDER BY timePosted DESC\n LIMIT ${amount}`)\n .then(entities => { // fix tags and comments real quick\n return this.__util__fixEntities(entities);\n });\n }", "function findAllDepartments() {\n return connection.query(\"SELECT id AS ID, name AS Department FROM department\");\n}", "function whereQueryBuilder(results) {\n\n var entityString = \" WHERE \";\n if (results[0] != \"\") {\n entityString = entityString + \"papername LIKE '\" + results[0] + \"'\";\n if (results[1] != \"\" || results[2] != \"\" || results[3] != \"\") {\n entityString = entityString + \" AND \";\n }\n }\n if (results[1] != \"\") {\n entityString = entityString + \"code LIKE '\" + results[1] + \"'\";\n if (results[2] != \"\" || results[3] != \"\") {\n entityString = entityString + \" AND \";\n }\n }\n if (results[2] != \"\") {\n entityString = entityString + \"major LIKE '\" + results[2] + \"'\";\n if (results[3] != \"\") {\n entityString = entityString + \" AND \";\n }\n }\n if (results[3] != \"\") {\n entityString = entityString + \"level LIKE '\" + results[3] + \"'\";\n }\n\n return entityString;\n}", "function buildQuery(qrydata) {\n var qry,\n union = false,\n length,\n ndx = 1;\n if (qrydata.length > 1) {\n union = true;\n length = qrydata.length;\n };\n _.forEach(qrydata, function (arg) {\n if (ndx === 1) {\n qry = 'select ' + arg.fields +\n ' from ' + arg.from_objects +\n _.join(arg.join_condition, ' ') +\n (arg.where_clause ? ' where ' + arg.where_clause : '') +\n (arg.group_by ? ' group by ' + arg.group_by : '') +\n (arg.order_by ? ' order by ' + arg.order_by : '');\n } else {\n qry += 'select ' + arg.fields +\n ' from ' + arg.from_objects +\n _.join(arg.join_condition, ' ') +\n (arg.where_clause ? ' where ' + arg.where_clause : '') +\n (arg.group_by ? ' group by ' + arg.group_by : '') +\n (arg.order_by ? ' order by ' + arg.order_by : '');\n }\n if (union && ndx != length) {\n qry += ' union all ';\n };\n ndx++;\n })\n return qry;\n}", "function generateQuery(type) {\n var query = new tabulator.rdf.Query();\n var rowVar = kb.variable(keyVariable.slice(1)); // don't pass '?'\n\n addSelectToQuery(query, type);\n addWhereToQuery(query, rowVar, type);\n addColumnsToQuery(query, rowVar, type);\n\n return query;\n }", "function queryBuilder(){\n getValues();\n let tournament;\n if (tournyCond === 'anyT') tournament = \" any tournament \";\n else tournament = tournyCond + \" tournament(s) \";\n\n let player;\n if (nameCond === 'contains') player = \"a player whose name contains \" + playerInput + \" \";\n else if(nameCond === 'equalsname') player = playerInput + \" \";\n\n let rank;\n if (rankCond === 'either') rank = \"either the winner or runner-up \";\n else if (rankCond === 'winner') rank = \"the winner \";\n else if (rankCond === 'runner') rank = \"the runner-up \";\n\n let date;\n if (dateInputInt === 0) date = '';\n else{\n if (dateCond === 'equalsdate'){\n date = \"in the year \" + dateInput;\n }\n else if(dateCond === 'greaterthan'){\n date = \"after the year \" + dateInput;\n }\n else if (dateCond === 'lessthan'){\n date = \"before the year \" + dateInput;\n }\n }\n let gender = \"From the \" + $fileCondSelect.val() + \" game, \";\n let withName= \"select \" + tournament + date +\" where \" + player + \"was \" + rank;\n let anyName = \"select all winners and runners-up from \" + tournament + date;\n let text = [];\n text.push(gender);\n if (playerInput === '' || nameCond ==='none'){\n text.push(anyName);\n }\n else text.push(withName);\n $('#currentquery').html(text.join(\"\"))\n }", "function CreateTableQuery() \n{\nthis.columns = [];\nthis.constraints = [];\n}", "generateCollectionStatement(opts) {\n const statement = this.statement(this.index[opts.type]);\n //\n // Generate the appropriate statement based on if its a suffix or not for any\n // generic collection\n //\n const valueExpr = opts.suffix\n ? `${opts.field} ${opts.operator} ?`\n : `? ${opts.operator} ${opts.field}`;\n statement.cql.push(`${opts.field} = ${valueExpr}`);\n statement.params.push(this.schema.valueOf(opts.field, opts.value));\n //\n // Remark: Only set and list operations need to ensure subsequent commands exist on\n // a new statement\n //\n if (['list', 'set'].indexOf(opts.type) !== -1) this.index[opts.type]++;\n }", "getMateriasProgra(ru,gestion,periodo){\n return querys.select(\"select * from consola.generar_programacion_completa(\"+ru+\",\"+gestion+\",\"+periodo+\",0)\");\n }", "function list() {\n return db(tableName).select(\"*\").orderBy(\"table_name\");\n}", "async function query(filterBy ) {\n const criteria = _buildCriteria(filterBy);\n // console.log(criteria)\n try{\n const collection = await dbService.getCollection('toys') //bring the collection\n var toys = await collection.find(criteria).toArray()\n return toys;\n\n // const regex = new RegExp(filterBy.name, 'i')\n // var toysForDisplay = gToy.filter(toy => {\n // return regex.test(toy.name) && (toy.type === filterBy.type || filterBy.type === 'all')\n // && (JSON.stringify(toy.inStock) === filterBy.inStock || filterBy.inStock === 'all') \n }\n catch(err){\n logger.error('cannot find toys', err)\n throw err\n }\n}", "async function get(query = {}) {\n const { limit = 10, sortby = \"id\", sortdir = \"asc\" } = query;\n const {\n location = \"\",\n urgency_level = 0,\n funding_goal = 0,\n deadline = \"\",\n title = \"\",\n description = \"\",\n specie_id = 0\n } = query;\n\n let rows = await db(\"campaigns\")\n .orderBy(sortby, sortdir)\n .limit(limit)\n .modify(function(queryBuilder) {\n if (location) {\n queryBuilder.where({ location });\n }\n if (urgency_level) {\n queryBuilder.where({ urgency_level });\n }\n if (funding_goal) {\n queryBuilder.where({ funding_goal });\n }\n if (deadline) {\n queryBuilder.where({ deadline });\n }\n if (title) {\n queryBuilder.where(\"title\", \"like\", \"%\" + title + \"%\");\n }\n if (description) {\n queryBuilder.where(\"description\", \"like\", \"%\" + description + \"%\");\n }\n if (specie_id) {\n queryBuilder.where({ specie_id });\n }\n });\n console.log(query);\n\n return rows;\n}", "Query( parameters ) {\n\t\treturn new Promise( ( next, fail ) => {\n\n\t\t\tvar wv = this._QueryToWhereValues( parameters );\n\t\t\t\n\t\t\tvar join_str = '';\n\t\t\tif ( parameters.joins ) {\n\t\t\t\tfor ( var k in parameters.joins ) {\n\t\t\t\t\tvar v = parameters.joins[ k ];\n\t\t\t\t\tjoin_str += ' LEFT JOIN `' + v + 's` ON `' + v + 's`.`id` = `' + parameters.table + '`.`' + v + '_id`';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tvar query =\n\t\t\t\t'SELECT ' +\n\t\t\t\t'`' + parameters.table + '`.*' + ( parameters.extra_selects ? ', ' + parameters.extra_selects : '' ) +\n\t\t\t\t' FROM `' + parameters.table + '`' +\n\t\t\t\tjoin_str +\n\t\t\t\twv.where +\n\t\t\t\t( parameters.group ? ' GROUP BY ' + parameters.group : '' ) +\n\t\t\t\t( parameters.order ? ' ORDER BY ' + parameters.order : '' ) +\n\t\t\t\t( parameters.limit ? ' LIMIT ' + parameters.limit : '' )\n\t\t\t;\n\t\t\t\n\t\t\tthis.Sql.query( query, wv.values, (err, rows, fields) => {\n\t\t\t\t\n\t\t\t\t if (err)\n\t\t\t\t\t return fail( err );\n\t\t\t\t \n\t\t\t\t return next( rows );\n\t\t\t});\n\t\t\t\n\t\t});\n\t}", "static async getAllOratores(){\n const query = \n `\n SELECT \n u.firstname, u.lastname, u.mail, u.user_image, \n sc.social_class, sr.social_rank\n FROM user u\n JOIN social_class sc ON sc.id= u.social_class_id \n JOIN social_rank sr ON sr.id = u.social_rank_id\n WHERE sc.social_class = \"Oratores\" \n AND sr.social_rank != \"King\" AND sr.social_rank != \"Queen\" AND sr.social_rank != \"Prince\" AND sr.social_rank != \"Princess\";\n `;\n const result = await connection.query(query)\n return result;\n }", "function viewAllProducts() {\n connection.query('SELECT * FROM products', function(error, res) {\n if (error) throw error;\n var table = new Table({\n head: ['item_Id', 'Product Name', 'Price Per', 'Stock Qty']\n });\n\n for (i = 0; i < res.length; i++) {\n table.push(\n [res[i].item_id, res[i].product_name, \"$\" + res[i].price, res[i].stock_quantity]\n );\n }\n console.log(table.toString());\n connection.end();\n });\n}", "viewAllEmployeesByDept() {\n return `SELECT employee.id, employee.first_name, employee.last_name, role.title, dept.name AS department, \n role.salary, CONCAT(manager.first_name, ' ', manager.last_name) AS manager FROM employee \n LEFT JOIN role on employee.role_id = role.id \n LEFT JOIN department dept on role.department_id = dept.id \n LEFT JOIN employee manager on manager.id = employee.manager_id\n WHERE dept.name = ?`;\n}", "findAllEmployeesByDepartment(departmentId) {\n return this.connection.query(\n \"SELECT employee.id, employee.first_name, employee.last_name, role.title FROM employee LEFT JOIN role on employee.role_id = role.id LEFT JOIN department department on role.department_id = department.id WHERE department.id = ?;\",\n departmentId\n );\n}", "function queryAllProducts() {\n\n console.log();\n console.log(\"ALL AVAILABLE ITEMS:\");\n console.log(\"-----------------------------------\");\n connection.query(\"SELECT * FROM products\", function(err, res) {\n for (var i = 0; i < res.length; i++) {\n console.log(res[i].item_id + \" | \" + res[i].product_name + \" | \" + res[i].price);\n }\n console.log(\"-----------------------------------\\n\");\n });\n}", "buildQuery() {\n if (!this.where || !this.data || !this.table) {\n const err = \"Bad Request. Required information not provided. Where, Data and Table properties must have values\";\n return err;\n }\n else {\n const updateQuery = `UPDATE ${this.table.database}.${this.table.name} SET ${functions_module_1.escape(this.data)} ${this.whereClause}`;\n return updateQuery;\n }\n }", "function allNotes(){ \n var sql_statement = \"q=SELECT * FROM \"+ table_name +\" ORDER BY created_at DESC LIMIT \" + notes_limit;\n queryCarto(sql_statement);\n}", "function allEmployees() {\n //Build SQL query\n var query = \"SELECT employees.employee_id, employees.first_name, employees.last_name, roles.title, roles.salary, departments.department_name \";\n query += \"FROM employees LEFT JOIN roles ON employees.role_id = roles.role_id LEFT JOIN departments ON roles.department_id = departments.department_id\";\n connection.query(query, function (err, res) {\n if (err) throw err;\n console.table('Employees', res);\n start();\n });\n}", "async select(table, { filters = null, filterParams = [] } = {}) {\n try {\n let query = \"SELECT * FROM \" + table;\n if (filters) {\n query += \" WHERE \";\n for (let filter of filters) {\n query += `${filter} AND `;\n }\n query = query.slice(0, query.length - 5);\n }\n query += \";\";\n const output = await this.pool.query(query, filterParams);\n return output;\n } catch (e) {\n console.error(\"db.select error: \", e);\n throw e;\n }\n }", "static all() {\n\t\treturn query( this, db( cache.table( this.name ) ).select( '*' ) );\n\t}", "function QueryCollection() {\n\t\t}", "search() {\n return db.many(`\n SELECT *\n FROM parks p\n WHERE p.borough LIKE '%ook%'\n `);\n }", "function getColumns() {\n\n // get the table's columns\n var columns = new ArrayList();\n //for each (var def in pquery.getColumns()) {\n // var col = pquery.getColumn(def.getIndex());\n // columns.add(col);\n //}\n\n // and add a new one\n var cc = new Column();\n cc.setName(\"age groups\");\n cc.setAlias(null);\n cc.setExternalName(cc.getName());\n cc.setDatatype(Datatype.ALPHANUMERIC);\n newColumnIndex = columns.size();\n columns.add(cc);\n\n // and add a new one\n var cc = new Column();\n cc.setName(\"number of approved\");\n cc.setAlias(null);\n cc.setExternalName(cc.getName());\n cc.setDatatype(Datatype.INTEGER);\n newColumnIndex = columns.size();\n columns.add(cc);\n\t\n // and add a new one\n var cc = new Column();\n cc.setName(\"number of rejected\");\n cc.setAlias(null);\n cc.setExternalName(cc.getName());\n cc.setDatatype(Datatype.INTEGER);\n newColumnIndex = columns.size();\n columns.add(cc);\n \n // and add a new one\n var cc = new Column();\n cc.setName(\"approval likelihood\");\n cc.setAlias(null);\n cc.setExternalName(cc.getName());\n cc.setDatatype(Datatype.DECIMAL);\n newColumnIndex = columns.size();\n columns.add(cc);\n return columns;\n\n}", "viewAllDept() {\n\t\tconst query = `SELECT *\n\t FROM department;`;\n\t\treturn this.connection.query(query);\n\t}", "function selectAll(table) {\n return db.query('SELECT * FROM ??', [table]);\n}", "getProducts(options) {\n console.log('inside getProducts');\n\n // array to hold parameters that may be entered in the query\n const queryParams = [];\n\n // array to hold each query filter\n const filters = [];\n\n // start query with info that comes before the WHERE clause\n let queryString = `SELECT * FROM products`;\n\n // --------- the filter by favorites part is not functional yet -----------//\n // FILTER BY FAVS: return only favorites\n // when the user clicks on fav button\n if (options.favorite) {\n queryString += `\n JOIN favorites ON product_id = products.id\n JOIN users ON user_id = users.id\n WHERE user_id = ${options.userId} AND`;\n }\n\n if (queryString.includes('WHERE')) {\n queryString += ` products.is_sold = false`;\n } else {\n queryString += ` WHERE products.is_sold = false`;\n }\n\n // -------------- filter by price -------------------- //\n\n // FILTER BY PRICE: minimum price\n if (options.minimumPrice) {\n queryParams.push(`${options.minimumPrice}`);\n filters.push(`price >= $${queryParams.length}`);\n }\n\n // FILTER BY PRICE: maximum price\n if (options.maximumPrice) {\n queryParams.push(`${options.maximumPrice}`);\n filters.push(`price <= $${queryParams.length}`);\n }\n\n // concatenate filters\n if (filters.length > 0) {\n queryString += ' AND ' + filters.join(' AND ');\n }\n\n // complete queryString\n queryString += ` ORDER BY price;`;\n // queryString += \";\";\n\n console.log('queryString: ', queryString);\n\n return db\n .query(queryString, queryParams)\n .then(result => result.rows)\n .catch(error => error.message);\n }", "static async getAll() {\n let projection = {\n shipmentStatus: 1,\n referenceNo: 1,\n courier: 1,\n receivedBy: 1,\n nosOfSamples: 1\n };\n try {\n let result = await DatabaseService.getAll(collectionName, projection);\n return result;\n } catch (err) {\n throw err;\n }\n }", "getAll() {\n\t\treturn this.dao.all(`SELECT * FROM items`);\n\t}", "function showAllProducts() {\n var sql = 'SELECT ?? FROM ??';\n var values = ['*', 'products'];\n sql = mysql.format(sql, values);\n connection.query(sql, function (err, results, fields) {\n if (err) throw err;\n for (let i = 0; i < results.length; i++) {\n console.log(` \\nItem ID: ${results[i].item_id} Name: ${results[i].product_name} Department: ${results[i].department_name} Price: ${results[i].price} Stock Quantity: ${results[i].stock_quantity} \\n-------------------------------------------------------------------------------------- \\n`);\n }\n startingQuestions();\n });\n}", "function BaseQuery(all) {\n this.select = function(property) {\n return mapProperty(all(), property);\n };\n}", "function SQLRows(res,sql,params){\n if (!params){\n params = []\n }\n db.all(sql, params, (err, rows) => {\n if (err) {\n res.status(400).json({\"error\":err.message});\n return;\n }\n res.json({\n \"message\":\"success\",\n \"data\":rows\n })\n });\n}", "buildQuery() {\n if (!this._odataOptions) {\n throw new Error('Odata Service requires certain options like \"top\" for it to work');\n }\n this._odataOptions.filterQueue = [];\n const queryTmpArray = [];\n // When enableCount is set, add it to the OData query\n if (this._odataOptions.enableCount === true) {\n const countQuery = (this._odataOptions.version >= 4) ? '$count=true' : '$inlinecount=allpages';\n queryTmpArray.push(countQuery);\n }\n if (this._odataOptions.top) {\n queryTmpArray.push(`$top=${this._odataOptions.top}`);\n }\n if (this._odataOptions.skip) {\n queryTmpArray.push(`$skip=${this._odataOptions.skip}`);\n }\n if (this._odataOptions.orderBy) {\n let argument = '';\n if (Array.isArray(this._odataOptions.orderBy)) {\n argument = this._odataOptions.orderBy.join(','); // csv, that will form a query, for example: $orderby=RoleName asc, Id desc\n }\n else {\n argument = this._odataOptions.orderBy;\n }\n queryTmpArray.push(`$orderby=${argument}`);\n }\n if (this._odataOptions.filterBy || this._odataOptions.filter) {\n const filterBy = this._odataOptions.filter || this._odataOptions.filterBy;\n if (filterBy) {\n this._filterCount = 1;\n this._odataOptions.filterQueue = [];\n let filterStr = filterBy;\n if (Array.isArray(filterBy)) {\n this._filterCount = filterBy.length;\n filterStr = filterBy.join(` ${this._odataOptions.filterBySeparator || 'and'} `);\n }\n if (typeof filterStr === 'string') {\n if (!(filterStr[0] === '(' && filterStr.slice(-1) === ')')) {\n this.addToFilterQueueWhenNotExists(`(${filterStr})`);\n }\n else {\n this.addToFilterQueueWhenNotExists(filterStr);\n }\n }\n }\n }\n if (this._odataOptions.filterQueue.length > 0) {\n const query = this._odataOptions.filterQueue.join(` ${this._odataOptions.filterBySeparator || 'and'} `);\n this._odataOptions.filter = query; // overwrite with\n queryTmpArray.push(`$filter=${query}`);\n }\n // join all the odata functions by a '&'\n return queryTmpArray.join('&');\n }", "function displayAllInventory() {\r\n\r\n var query = \"SELECT item_id, department_name, product_name, price, stock_quantity FROM bamazon.products \" +\r\n \"INNER JOIN bamazon.departments ON products.department_id = departments.department_id \" +\r\n \"ORDER BY department_name, product_name ASC\";\r\n bamazon.query(query, function (err, res) {\r\n if (err) throw (err);\r\n\r\n displayInventoryTable(res);\r\n start();\r\n });\r\n}", "getAll(collection,query){\n return this.connect().then(db=>{\n //llamamoos al metodo de mongo de busqueda por medio de una query \n return db.collection(collection).find(query).toArray();\n });\n }", "function getCreateTableQuery(table) {\n\n curModel = model[table]\n curFields = curModel.fields\n curPrimaryKey = curModel.primaryKey\n curUnique = curModel.unique\n\n fieldsArr = []\n if (curPrimaryKey && curPrimaryKey == \"id\") fieldsArr.push(\"id INT NOT NULL AUTO_INCREMENT\")\n for (field in curFields) {\n if (field != \"id\") {\n type = curFields[field]\n sqlType = sqlTypes[type]\n curFieldStr = `${field} ${sqlType}`\n fieldsArr.push(curFieldStr)\n }\n }\n fieldsArr.push(\"createdAt datetime\")\n fieldsArr.push(\"updatedAt datetime\")\n if (curPrimaryKey) fieldsArr.push(`PRIMARY KEY (${curPrimaryKey})`)\n else if (curUnique) fieldsArr.push(`UNIQUE (${curUnique.join()})`)\n fieldsStr = fieldsArr.join(\", \")\n\n query = `CREATE TABLE ${table} (${fieldsStr});`\n return(query)\n}", "all() {\n return db.select().from('posts');\n }", "static getAll() {\n // .any returns 0 or more results in an array\n // but that's async, so we `return` the call to db.any\n return db.any(`select * from reviews`);\n }", "async projectsList({request, response, error }){\n try{\n var data = request.body;\n let qry = await Database.connection('oracledb').select('PROJECT_ID','PROJECT_NAME','PROJECT_DESCRIPTION','CONVERSION_STATUS',)\n .from('LIST_OF_PROJECTS');\n console.log(qry);\n \n return response.status(200).send({success:true, data:qry, msg :'List of created projects', err:null});\n }\n catch(error){\n return response.status(400).send({success:false, data:null, msg:'Error while getting the projects list', err:error});\n }\n // finally{\n // Database.close(['oracledb']);\n // }\n\n \n }", "static async getAll() {\n const sql = \"SELECT id, template_name, visible, created FROM templates\";\n\n try {\n return await query(sql);\n } catch (error) {\n throw error;\n }\n }", "async getAll(){\n return await conn.query(\"SELECT * FROM Fitness_RoutineExercises\")\n }", "function filterAllPets (){\n filterType = \"\";\n filterAgeMin = 0;\n filterAgeMax = Number.MAX_VALUE;\n loadTableWithFilters();\n}", "function buildQuery (executor, props, model, summaryFields) {\n var that = this\n , path = props.path\n , list = props.list\n , fields = summaryFields[model.makePath(path).getType().name]\n , constraint = {path: list.type, op: 'IN', value: list.name}\n , columns = [path + '.id'].concat(_.map(fields, addField))\n , query = {select: columns, where: [constraint], joins: {}};\n\n // Make all references below path optional, using outer-joins.\n fields.forEach(function (fld) {\n var i, l, fldParts = fld.split('.');\n for (i = 1, l = fldParts.length; i + 1 < l; i++) {\n var joinPath = props.path + '.' + fldParts.slice(1, i + 1).join('.');\n query.joins[joinPath] = 'OUTER';\n }\n });\n\n if (JSON.stringify(query) !== JSON.stringify(this.state.query)) {\n var q = new imjs.Query(query, props.service);\n q.model = model;\n executor.submit(q).then(setItems);\n }\n \n function setItems (items) {\n var state = {\n allItems: items,\n items: items.filter(rowMatchesFilter(props.filterTerm)),\n query: query\n };\n\n that.setState(state);\n }\n\n function addField (field) {\n return path + field.replace(/^[^.]+/, '');\n }\n }", "async function getAll() {\n let results = await query(`\n SELECT e.id AS ID, e.first_name AS 'First Name', e.last_name AS 'Last Name', r.title AS 'Title', r.salary AS 'Salary', d.name AS 'Department Name', CONCAT(m.first_name, ' ', m.last_name) AS Manager FROM employee e\n INNER JOIN role r ON e.role_id = r.id\n INNER JOIN department d ON r.department_id = d.id\n LEFT JOIN employee m ON e.manager_id = m.id\n `);\n console.table(results);\n askQuestion();\n}", "function getQueryParams() {\n const pkPlaceholder = `#${PK}`\n const skPlaceholder = `#${SK}`\n let config = { TableName: dbConfig.TableName }\n function get() { return config }\n function addAttributeName(name, value) {\n const key = '#' + name\n config.ExpressionAttributeNames[key] = name\n if (value) {\n const valueKey = ':' + name\n config.ExpressionAttributeValues[valueKey] = value\n }\n return this\n }\n function eq(pkvalue, skvalue) {\n config.ExpressionAttributeNames = {}\n config.ExpressionAttributeNames[pkPlaceholder] = PK\n if (skvalue) {\n config.KeyConditionExpression = `${pkPlaceholder} = :pk AND ${skPlaceholder} = :sk`\n config.ExpressionAttributeNames[skPlaceholder] = SK\n config.ExpressionAttributeValues = { ':pk': pkvalue, ':sk': skvalue }\n } else {\n config.KeyConditionExpression = `${pkPlaceholder} = :pk`\n config.ExpressionAttributeValues = { ':pk': pkvalue }\n }\n return this\n }\n function beginsWith(pkvalue, skvalue) {\n config.ExpressionAttributeNames = {}\n config.ExpressionAttributeNames[pkPlaceholder] = PK\n if (skvalue) {\n config.KeyConditionExpression = `${pkPlaceholder} = :pk AND begins_with(${skPlaceholder}, :sk)`\n config.ExpressionAttributeNames[skPlaceholder] = SK\n config.ExpressionAttributeValues = { ':pk': pkvalue, ':sk': skvalue }\n } else {\n config.KeyConditionExpression = `${pkPlaceholder} = :pk`\n config.ExpressionAttributeValues = { ':pk': pkvalue }\n }\n return this\n }\n function contains(pkvalue, skvalue) {\n config.ExpressionAttributeNames = {}\n config.ExpressionAttributeNames[pkPlaceholder] = PK\n if (skvalue) {\n config.KeyConditionExpression = `${pkPlaceholder} = :pk AND contains(${skPlaceholder}, :sk)`\n config.ExpressionAttributeNames[skPlaceholder] = SK\n config.ExpressionAttributeValues = { ':pk': pkvalue, ':sk': skvalue }\n } else {\n config.KeyConditionExpression = `${pkPlaceholder} = :pk`\n config.ExpressionAttributeValues = { ':pk': pkvalue }\n }\n return this\n }\n function filter(expr, name, value) {\n config.FilterExpression = expr // '#status = :stat'\n addAttributeName(name, value)\n return this\n }\n function project(projection) {\n if (projection) config.ProjectionExpression = projection\n return this\n }\n function toString() {\n return `Table ${dbConfig.TableName} contains key ${PK}, ${SK}`\n }\n // Provide a plain language description of the query parameter object\n function explain() {\n const kce = Object.keys(config.ExpressionAttributeNames).reduce((orig, curr) => {\n return orig.replace(curr, config.ExpressionAttributeNames[curr])\n }, config.KeyConditionExpression)\n let criteria = Object.keys(config.ExpressionAttributeValues).reduce((orig, curr) => { return orig.replace(curr, `'${config.ExpressionAttributeValues[curr]}'`) }, kce)\n let description = `Search ${config.TableName} WHERE ${criteria}`\n if (config.FilterExpression) {\n const filter = Object.keys(config.ExpressionAttributeNames).reduce((orig, curr) => { return orig.replace(curr, `'${config.ExpressionAttributeNames[curr]}'`) }, config.FilterExpression)\n criteria = Object.keys(config.ExpressionAttributeValues).reduce((orig, curr) => { return orig.replace(curr, `'${config.ExpressionAttributeValues[curr]}'`) }, filter)\n description += ` FILTER ON ${criteria}`\n }\n if (config.ProjectionExpression) description += ` SHOWING ONLY ${config.ProjectionExpression}`\n return description\n }\n return {\n addAttribute: addAttributeName,\n eq: eq,\n beginsWith: beginsWith,\n contains: contains,\n filter: filter,\n project: project,\n get: get,\n toString: toString,\n explain: explain\n }\n }", "function viewDataAll(table) {\n console.log(\"view data all...\");\n db.transaction(function(transaction) {\n transaction.executeSql('SELECT * FROM '+table, [], function (tx, results) {\n var resLen = results.rows.length;\n console.log(\"table results=\"+JSON.stringify(results));\n for (i = 0; i < resLen; i++){\n console.log(\"id=\"+results.rows.item(i).id+\"-title=\"+results.rows.item(i).title+\"-desc=\"+results.rows.item(i).desc);\n $(\"#data-output\").append(\"<p>id=\"+results.rows.item(i).id+\" - title=\"+results.rows.item(i).title+\" - desc=\"+results.rows.item(i).desc)\n }\n }, null);\n });\n }", "getRecipes(db, userId) {\n return db.raw(`select json_agg(rec)\n from (\n select r.id, r.name, r.description, r.instructions, r.owner_id,\n (select json_agg(recing)\n from (\n select ingredient_id as id, i.name, quantity, u.name as unit, u.id as unit_id, special_instructions, recipe_id from recipes_ingredients \n join ingredients i on ingredient_id = i.id\n join units u on unit_id = u.id\n where recipe_id = r.id\n ) recing\n ) as ingredients\n from recipes as r where r.owner_id = ${userId} or r.owner_id = 1) as rec\n `);\n }", "async getAll(req, res, next) {\n let {petName, size, specie} = req.query;\n\n let whereQuery = {};\n if (petName)\n whereQuery['name'] = petName;\n if (size)\n whereQuery['size'] = size;\n if (specie)\n whereQuery['type'] = specie;\n\n res.locals.pets = await Pet.findAll({where: whereQuery});\n next();\n }", "function deptList() {\n return connection.query(\"SELECT id, dept_name FROM departments\");\n}", "function generateQuery(processed_schema){\n\n\tvar a_rel = processed_schema.attr_attr_relations,\n\t\tm_rel = processed_schema.attr_metric_relations,\n\t\tattrs = processed_schema.attrs;\n\n\tvar attrq = generateAttributeQuery(a_rel),\n\t\tmetrq = generateMetricsQueries(m_rel);\n\n\tvar q = 'SELECT * FROM ( ' + attrq + ' ) A ';\n\tfor(var i = 0; i < metrq.queries.length ;i++){\n\t\tq = q + ' left outer join ( ' + metrq.queries[i] + ') M' + i +\n\t\t\t' on '+ generateLeftOuterJoinConditions(metrq.attrs,i)\n\t}\n\t\n\treturn q;\n}", "function getData(){\n\tgiftSelection = document.getElementById('Ideas').value;\n\tconsole.log(giftSelection);\n\tdb.transaction(function(trans){\n\t\t//console.log(giftSelection);\n\t\t//trans.executeSql('SELECT occasion_text AS count FROM occassions', [], goodQuery, badQuery);\n\t\ttrans.executeSql('SELECT occassion_id AS count FROM occassions where occasion_text=?', [giftSelection],function(tx,rs){\n\t\t\tvar temp = rs.rows.item(0).count;\n\t\t\tconsole.log(temp);\n\t\t\tdb.transaction(function(trans){\n\t\t//SELECT * FROM gifts AS g INNER JOIN names AS n ON g.name_id = n.name_id INNER JOIN occassions AS o ON g.occassion_id = o.occassion_id\n\t\t//trans.executeSql('SELECT * FROM gifts AS g INNER JOIN names AS n ON g.name_id = n.name_id INNER JOIN occassions AS o ON g.occassion_id = o.occassion_id WHERE gift_idea = \"' + giftSelection + '\";', [],goodData,badData); \n trans.executeSql('SELECT a.gift_idea AS idea, b.name_text AS name FROM gifts AS a INNER JOIN names AS b ON a.name_id = b.name_id WHERE occassion_id=?', [temp],goodData,badData);\n }, transErr, transSuccess);\n\t\n\t\t\t},badData);\n\t\t\n //trans.executeSql('SELECT g.gift_idea, o.occasion_text FROM gifts AS g INNER JOIN occassions AS o ON g.occassion_id = o.occassion_id WHERE g.name_id=?', [],goodQuery,badQuery); \n }, transErr, transSuccess);\t\n\t\n}", "getEmpByDepartment (callInitiateApp) {\n const sql = `SELECT a.id AS 'Employee Id',\n a.first_name AS 'First Name',\n a.last_name AS 'Last Name',\n departments.name AS Department\n FROM employees a\n left JOIN roles\n ON a.role_id = roles.id\n left JOIN departments\n ON roles.department_id = departments.id\n WHERE departments.id = ?\n ORDER BY a.id` ;\n //console.log(this.data);\n\n db.query ('SELECT id FROM departments WHERE name = ?', this.data, (err, row) => {\n if (err)\n {\n console.log({error : err.message});\n return;\n }\n //console.log ('result', row[0].id);\n let deptId = row[0].id;\n db.query (sql, deptId, (err, result) => {\n if (err)\n {\n console.log({error : err.message});\n return;\n }\n //console.log(result);\n console.table (result);\n console.log (`${COLOR.fgGreen}========================================================${COLOR.reset}`);\n callInitiateApp();\n \n });\n })\n \n }", "getAllProjects(req, res) {\n let sql = \"select P.id, P.orgId, P.title as `projectTitle`, PS.label as `status`, K.title as `mainKpi`, O.name as organization, \\\n P.progress, P.startAt, P.endAt, (select group_concat(concat(' ', Per.firstName, ' ', Per.lastName)) from ProjectPersons PP, \\\n Persons Per where P.id = PP.projectId and Per.id = PP.personId and PP.owner = '1') as owners, \\\n (select group_concat(concat(' ', T.title)) from Tasks T where T.projectId = P.id) as tasks \\\n from Projects P left outer join ProjectStatuses PS on P.statusId = PS.id \\\n left outer join Organizations O on P.orgId = O.id \\\n left outer join Kpis K on P.mainKpiId = K.id \\\n order by P.title\";\n return models.sequelize\n .query(sql,\n {\n type: models.sequelize.QueryTypes.SELECT,\n limit: 100\n }\n )\n .then(projects => {\n res.status(200).send(projects);\n })\n .catch(error => {\n logger.error(error.stack);\n res.status(400).send(error);\n });\n }" ]
[ "0.5742926", "0.5542701", "0.5535327", "0.55135286", "0.54901123", "0.54628456", "0.5451736", "0.5425484", "0.5418275", "0.5416352", "0.5392962", "0.5346311", "0.53233314", "0.5310157", "0.5292506", "0.52699107", "0.5236434", "0.5221286", "0.51881343", "0.5188116", "0.518174", "0.5180595", "0.51741046", "0.5173409", "0.5162463", "0.51618797", "0.51488715", "0.5144043", "0.51339716", "0.50876147", "0.5080162", "0.50474787", "0.50384325", "0.5031609", "0.5023852", "0.5023575", "0.50006574", "0.49894568", "0.49894568", "0.498152", "0.49659455", "0.49652097", "0.49582914", "0.4954932", "0.4952703", "0.49437612", "0.4928743", "0.4912061", "0.49095628", "0.4908625", "0.49053982", "0.49000058", "0.48829496", "0.48808625", "0.4878393", "0.48760152", "0.4864826", "0.48640636", "0.48630756", "0.48612946", "0.48566654", "0.48502296", "0.48482734", "0.4839034", "0.48347324", "0.48297146", "0.48172766", "0.4813839", "0.48105705", "0.48086149", "0.4805119", "0.48042807", "0.48026416", "0.4797758", "0.47925037", "0.47904974", "0.4784261", "0.47834742", "0.47794807", "0.4773559", "0.476503", "0.4764716", "0.4764649", "0.47636536", "0.47367284", "0.47275287", "0.471859", "0.47141927", "0.4714038", "0.4697043", "0.46931875", "0.4692825", "0.46822682", "0.468207", "0.46813646", "0.46797377", "0.46739092", "0.46728587", "0.46682823", "0.4660461" ]
0.6962434
0
uncomment to debug without any others actions debug = true; performAction = false; emailWhenUpdated = false; / ========================================= ABOUT THE AUTHOR ========================================= This program was created by Derek Antrican If you would like to see other programs Derek has made, you can check out his website: derekantrican.com or his github: ========================================= BUGS/FEATURES ========================================= Please report any issues at ========================================= $$ DONATIONS $$ ========================================= If you would like to donate and help Derek keep making awesome programs, you can do that here: ========================================= CONTRIBUTORS ========================================= Andrew Brothers Github:
function Install(){ ScriptApp.newTrigger("main").timeBased().everyMinutes(howFrequent).create(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeDebugEmail(){\n /**\n * Validates an email for structure.\n *\n * @param email string The email to validate\n * @return bool true - valid email\n * false - invalid email\n */\n var validateEmail = function(email) {\n // Valid email regex\n 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,}))$/;\n return re.test(email);\n }\n\n var query, email,\n sheet = SpreadsheetApp.getActiveSheet(),\n ui = SpreadsheetApp.getUi();\n\n // Prompt for email.\n query = ui.prompt(appName,\n 'Enter new debug email.',\n ui.ButtonSet.OK_CANCEL);\n\n // Email is stored.\n email = query.getResponseText();\n\n // Handle prompt result\n if (query.getSelectedButton() == ui.Button.OK) {\n // Email is valid\n if (validateEmail(email)) {\n userProp.setProperty(g_debugEmail_key, email);\n loadMenu(userProp.getProperty(g_debug_key));\n return success(appName, 'Debug email was changed.', userProp.getProperty(g_debugEmail_key));\n }\n // Email is invalid\n return fail(appName, 'Invalid email.');\n }\n // Canceled Action\n return fail(appName, 'Debug email change was cancelled.');\n}", "function printChangelog() {\n tooltip('confirm', null, 'update', '\\\n<br><b class=\"AutoEggs\">3/7-3/9 v2.1.6.5 </b><b style=\"background-color:#32CD32\"> New:</B> Save/Reload Profiles in Import/Export. Magmamancer graph. Magmite/Magma Spam disableable.<br> This is the <a target=\\'#\\' href=\\'https://genbtc.github.io/AutoTrimps-stable\\'>Stable Repository</a> for the faint of heart. \\\n<br><b>3/4 v2.1.6.4 </b> Basic Analytics are now being collected. Read about it in the tooltip of the new button on the Import/Export tab . Overkill Graph fixed for Liquification. Setting Max Explorers to infinity as they are not that useless anymore. Update battlecalc for Fluffy & Ice on Autostance2.\\\n<br><b>3/1 v2.1.6.3 </b> AutoPerks: Capable/Curious/Cunning, BaseDamageCalc: C2,StillRowing,Strength in Health,Ice,Fluffy,Magmamancer - Fix bugs in autoperks around capable/fluffy allocating looting + more bugs\\\n<br><u>Report any bugs/problems please!<br You can find me on Discord: <span style=\"background-color:#ddd;color:#222\">genr8_#8163 </span>\\\n<a href=\"https://discord.gg/0VbWe0dxB9kIfV2C\"> @ AT Discord Channel</a></u>\\\n<br><a href=\"https://github.com/genBTC/AutoTrimps/commits/gh-pages\" target=\"#\">Check the commit history</a> (if you want)\\\n', 'cancelTooltip()', 'Script Update Notice<br>' + ATversion);\n}", "function menu() {\nconsole.log(\"---------Address Book Operations--------\");\nconsole.log(\"\\t0. Close File and Exit\");\nconsole.log(\"\\t1. Add New Person and Save\");\nconsole.log(\"\\t2. Edit Person Data\");\nconsole.log(\"\\t3. Delete a Person\");\nconsole.log(\"\\t4. Sort by Last Name\");\nconsole.log(\"\\t5. Sort by ZIP\");\nconsole.log(\"\\t6. Print all Entries\");\n}", "function main() {\r\n initFlags();\r\n fixMarkup();\r\n changeLayout();\r\n initConfiguration();\r\n}", "function onDebuggingClick() {\r\n if (debuggingInput.checked) {\r\n debuggingToggleSwitch.click();\r\n } else {\r\n tau.openPopup(debuggingPopup);\r\n }\r\n }", "function setDefaults(){\n // Default debug email from current user\n if(userProp.getProperty(g_debugEmail_key) === null)\n userProp.setProperty(g_debugEmail_key, Session.getActiveUser().getEmail());\n\n // Default debug state\n if(userProp.getProperty(g_debug_key) === null)\n userProp.setProperty(g_debug_key, g_debug_val);\n}", "function devDebug(){\n\n}", "function Useless()\n{\n\tconsole.log(\"Hardcoded command sent successfully\");\n}", "function mainProcess()\n\t{\n\t\naddLookup(\"EngCSMComments\",\"1.1 Developers Agreement\",\"The construction of this project will require the applicant shall enter into a City / Developer agreement for the required infrastructure improvements. The applicant shall contact Janet Schmidt at jschmidt@cityofmadison.com to schedule the development of the plans and the agreement. The City Engineer will not sign off on this project without the agreement executed by the developer. Obtaining a developer's agreement generally takes approximately 4-6 weeks, minimum. (MGO 16.23(9)c)\");\n \naddLookup(\"EngCSMComments\",\"1.2 Soil Borings\",\"Two weeks prior to recording the final plat, a soil boring report prepared by a Professional Engineer, shall be submitted to the City Engineering Division indicating a ground water table and rock conditions in the area. If the report indicates a ground water table or rock condition less than 9' below proposed street grades, a restriction shall be added to the final plat, as determined necessary by the City Engineer. (MGO 16.23(9)(d)(2) and 16.23(7)(a)(13))\");\n \naddLookup(\"EngCSMComments\",\"1.3 Impact fees\",\"This development is subject to impact fees for the_______Impact Fee District. All impact fees are due and payable at the time building permits are issued. (MGO Chapter 20)\n \nThe following note shall put the face of the plat/CSM:\nLOTS / BUILDINGS WITHIN THIS SUBDIVISION / DEVELOPMENT ARE SUBJECT TO IMPACT FEES THAT ARE DUE AND PAYABLE AT THE TIME BUILDING PERMIT(S) ARE ISSUED.\");\n /*\naddLookup(\"EngCSMComments\",\"1.4 Deferred Assments\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.1 ROW dedication\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.2 PLE grading sloping\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.3 ROW dedication for ingress/egress\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.4 Street vacation\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.5 Street design guidelines\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.6 15 ft Radii at intersections\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.7 25ft Radii at intersections\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.8 ROW width\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.9 Min Centerline Radius\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.10 Permanent cul de sac\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.11 Temp cul de sac\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.12 40ft util easement for transmission lines\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.13 No ped bike connections required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.14 PLE for ped/bike easement\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.15 Private easement for ped/bike\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.16 Public sanitary easement\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.17 Public sidewalk easement\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.18 Public storm easement\",\"x\");\n \naddLookup(\"EngCSMComments\",\"2.19 Public water easement\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.1 Street/SW improvements\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.2 Setback\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.3 Excessive grading\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.4 Park Frontage limited\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.5 Waiver street, construct sidewalk\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.6 Wtreet improvements\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.7 Sidewalk and ditching\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.8 Grade row and ditch\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.9 Value of sidewalk > $5000\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.10 Value of sidewalk < $5000\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.11 Waiver sidewalk\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.12 Grade ROW for future SW\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.13 Temp ingress/egress\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.14 Ingress/Egress\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.15 Intersection sight distance\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.16 Adequate sight distance\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.17 Approved street names\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.18 Private Street signs\",\"x\");\n \naddLookup(\"EngCSMComments\",\"3.19 Addressing\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.1 EROSION CONTROL STD\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.2 NON-EXCLUSIVE EASEMENTS STORM\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.3 ARROWS FOR DRAINGE\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.4 NO CHANGE IN DRAINGE\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.6 REMOVE ARROWS\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.7 MASTER DRAINGE PLAN REQUIRED\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.8 INTERDEPENDENT DRAINGE AGREEMENT REQUIREMENT\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.9 NOTE ON CSM RE CHAPTER 37\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.10 REQUIREMENT TO GO TO COE\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.11 WETLAND WDNR ACOE\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.12 MAPPING CAD SUBMITTAL\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.13 CAD SUBMITTAL ENGINEERING\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.14 WDNR NOI REQUIREMENT\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.15 SWU PAYMENT PRIOR TO SUBDIVIDE\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.16 POSSIBLE CONTAMINATED DEWATERING\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.17 CONSTRUCTION DEWATERING\",\"x\");\n \naddLookup(\"EngCSMComments\",\"4.18 PERMANENT DEWATERING\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.0 Developer required to build sanitary sewer\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.1 MMSD connection fees due\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.2 City of Madison sanitary sewer connection fees due\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.3 Each duplex unit shall have a separate lateral\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.4 MMSD review of plans required.\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.5 Ownership/ Maintenance Agreement Needed for shared Lateral\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.6 Sewer Plug Permit Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.7 Revise plans to show elevations and sizes of sanitary sewer facilities(Existing and Proposed)\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.8 Project may require monitoring for potential demand charges (sampling manhole)\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.9 Sanitary Sewer Easement Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.10 Sanitary Sewer Access Road Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.11 MMSD Connection Permit Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"5.12 Septic System Abandonment Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.1 PLSS Tie Sheets\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.2 Coordinate System and Coordinates\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.3 CADD Data Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.4 Easements\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.5 Final Review\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.6 Recording and APO Data\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.7 Drainage Easement Release and Creation\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.8 Temporary Turnaround Easement\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.9 Release of Easements\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.10 Offsite Easements\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.11 Easement Language\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.12 Utility Easements Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.13 Utility Easement language\",\"x\");\n \naddLookup(\"EngCSMComments\",\"6.14 Street Dedication Note\",\"x\");\n \naddLookup(\"EngCSMComments\",\"7.1 Phase 1 ESA Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"7.2 WDNR Approval Required to Alter Barrier Cap\",\"x\");\n \naddLookup(\"EngCSMComments\",\"7.3 Open Contaminant Site - WDNR Coordination Required\",\"x\");\n \naddLookup(\"EngCSMComments\",\"7.4 Management of Contaminated Soil\",\"x\");\n*/\n \t}", "function GeneTabPGUpdtAllProprty(event) {\n\n //Debug Button Press\n fDEBUG ?\n insertText(`<br><font color=\"red\"><strong>DEBUG[${sDEBUG }]:</strong></font> You Have Pressed the Update All Properties Button`) :\n null;\n\n //Event Completed\n event.completed();\n}", "function main() {\n verb(\"BetaBoards!\")\n\n var s = style()\n\n if (isTopic()) {\n iid = getPage()\n cid = iid\n\n initEvents()\n remNextButton()\n postNums()\n floatQR()\n hideUserlists()\n\n quotePyramid(s)\n\n ignore()\n\n beepAudio()\n\n addIgnoredIds(document.querySelectorAll(\".ignored\"))\n\n var f = function(){\n pageUpdate()\n\n loop = setTimeout(f, time)\n }\n\n var bp = readify('beta-init-load', 2)\n , lp = isLastPage([0, 2, 5, 10, NaN][bp])\n\n verb(\"bp \" + bp + \", lp: \" + lp)\n\n if (lp || bp === 4) loop = setTimeout(f, time)\n\n } else if (isPage(\"post\")) {\n addPostEvent()\n\n } else if (isPage(\"msg\")) {\n try {\n addPostEvent()\n } catch(e) {\n addQuickMsgEvent()\n }\n\n } else if (isForum()) {\n hideUserlists()\n\n var f = function(){\n forumUpdate()\n\n loop = setTimeout(f, time)\n }\n\n loop = setTimeout(f, time)\n\n } else if (isHome()) {\n optionsUI()\n ignoreUI()\n\n // Hint events\n addHintEvents()\n\n }\n}", "function main()\n{\n\tstore = new TiddlyWiki();\n\tstory = new Story(\"tiddlerDisplay\",\"tiddler\");\n\taddEvent(document,\"click\",Popup.onDocumentClick);\n\tsaveTest();\n\tloadOptionsCookie();\n\tfor(var s=0; s<config.notifyTiddlers.length; s++)\n\t\tstore.addNotification(config.notifyTiddlers[s].name,config.notifyTiddlers[s].notify);\n\tstore.loadFromDiv(\"storeArea\",\"store\");\n\tloadSystemConfig();\n\tformatter = new Formatter(config.formatters);\n\treadOnly = (document.location.toString().substr(0,7) == \"http://\") ? config.options.chkHttpReadOnly : false;\n\tstore.notifyAll();\n\trestart();\n}", "function main()\n{\n\t//Gets the current address (location):\n\tCB_Elements.insertContentById(\"location_current\", CB_Client.getLocation());\n\tCB_Elements.insertContentById(\"location_current_no_file\", CB_Client.getLocationWithoutFile());\n\t\n\t//Tells whether it is running locally (using the \"file:\" protocol):\n\tCB_Elements.insertContentById(\"running_locally\", CB_Client.isRunningLocally() ? \"Yes\" : \"No\");\n}", "function toDo() {\n console.log(\" \");\n console.log(\"TODO LIST\");\n console.log(\" 1. In file ajax_requests, uncomment 'check_actual_tags' \\\n \");\n console.log(\" \");\n}", "showDebugEmail (options) {\n const log = this.we.log;\n\n if (options.toJSON) options = options.toJSON();\n\n // dont send emails in test enviroment\n log.warn('---- email.showDebugEmail ----');\n log.warn('---- Email options: ----');\n log.info(options);\n log.warn('---- Displaying the html email that would be sent ----');\n log.info('HTML:\\n', { html: options.html });\n log.warn('---- Displaying the text email that would be sent ----');\n log.info('text:\\n', { text: options.text });\n log.warn('----------------------------- END --------------------------');\n }", "function main()\n{\n \n \n //-----declarations------\n source(findFile(\"scripts\",\"functions.js\"));\n \n //---login Application--------\n loginAppl(\"CONFIGURE\"); \n \n snooze(10);\n // ------ Base Currency setting ------ \n try{\n waitForObjectItem(\":List Currencies._curr_XTreeWidget\", \"USD\");\n clickItem(\":List Currencies._curr_XTreeWidget\", \"USD\", 16, 6, 0, Qt.LeftButton);\n clickButton(waitForObject(\":List Items.Edit_QPushButton_2\"));\n waitForObject(\":Currency.Base Currency_QCheckBox\")\n if(!findObject(\":Currency.Base Currency_QCheckBox\").checked)\n clickButton(\":Currency.Base Currency_QCheckBox\");\n clickButton(waitForObject(\":List Departments.Save_QPushButton\"));\n clickButton(waitForObject(\":Registration Key.Yes_QPushButton\"));\n clickButton(waitForObject(\":Tax Assignment.Close_QPushButton\"));\n test.log(\"Base Currency is successfully set\");\n }\n catch(e)\n {\n test.fail(\"Error in Base Currency setting\"+e);\n }\n //-----Editing the preferences----\n \n if(OS.name==\"Darwin\")\n {\n \n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Products\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Products\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Products_QMenu\",\"Setup...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Products_QMenu\", \"Setup...\");\n } \n else\n {\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n \n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Preferences...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Preferences...\");\n }\n \n \n waitForObject(\":Interface Options.Show windows inside workspace_QRadioButton\");\n snooze(1);\n if(!findObject(\":Interface Options.Show windows inside workspace_QRadioButton\").checked)\n clickButton(\":Interface Options.Show windows inside workspace_QRadioButton\");\n snooze(1);\n if(object.exists(\":Notice.Remind me about this again._QCheckBox\"))\n { \n waitForObject(\":Notice.Remind me about this again._QCheckBox\");\n if(findObject(\":Notice.Remind me about this again._QCheckBox\").checked)\n clickButton(\":Notice.Remind me about this again._QCheckBox\");\n snooze(0.1);\n waitForObject(\":Notice.OK_QPushButton\");\n clickButton(\":Notice.OK_QPushButton\");\n }\n waitForObject(\":xTuple ERP: *_QPushButton\");\n clickButton(\":xTuple ERP: *_QPushButton\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Rescan Privileges\");\n activateItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Rescan Privileges\");\n \n //----------Define Encryption (metric)------\n try{\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n snooze(2);\n \n if(OS.name==\"Darwin\")\n {\n if(object.exists(\":Cancel_QMessageBox\"))\n {\n waitForObject(\":OK_QPushButton\");\n clickButton(\":OK_QPushButton\"); \n }\n snooze(1);\n if(object.exists(\":Cancel_QMessageBox\"))\n {\n waitForObject(\":OK_QPushButton\");\n clickButton(\":OK_QPushButton\"); \n }\n }\n else\n {\n if(object.exists(\":Cannot Read Configuration_QMessageBox\"))\n {\n waitForObject(\":OK_QPushButton\");\n clickButton(\":OK_QPushButton\");\n }\n if(object.exists(\":Cannot Read Configuration_QMessageBox\"))\n {\n waitForObject(\":OK_QPushButton\");\n clickButton(\":OK_QPushButton\");\n }\n }\n snooze(2);\n if(findObject(\":Setup._tree_XTreeWidget\").itemsExpandable==true)\n {\n waitForObject(\":Configure.Encryption_QModelIndex\");\n mouseClick(\":Configure.Encryption_QModelIndex\", 35, 9, 0, Qt.LeftButton); \n }\n else\n {\n waitForObject(\":_tree.Configure_QModelIndex\");\n mouseClick(\":_tree.Configure_QModelIndex\", -11, 6, 0, Qt.LeftButton);\n waitForObject(\":Configure.Encryption_QModelIndex\");\n mouseClick(\":Configure.Encryption_QModelIndex\", 35, 9, 0, Qt.LeftButton); \n }\n snooze(1);\n if(object.exists(\":OK_QPushButton\"))\n {\n clickButton(\":OK_QPushButton\");\n }\n waitForObject(\":_ccEncKeyName_QLineEdit\");\n if(findObject(\":_ccEncKeyName_QLineEdit\").text!=\"xTuple.key\")\n {\n type(\":_ccEncKeyName_QLineEdit\", \"<Right>\");\n type(\":_ccEncKeyName_QLineEdit\", \"<Ctrl+Backspace>\");\n type(\":_ccEncKeyName_QLineEdit\", \"xTuple.key\");\n test.log(\"Encryption: key name changed\");\n }\n if(findObject(\":Encryption Configuration_FileLineEdit\").text!=\"c:\\\\crypto\")\n {\n type(\":Encryption Configuration_FileLineEdit\", \"<Right>\");\n type(\":Encryption Configuration_FileLineEdit\", \"<Ctrl+Backspace>\");\n type(\":Encryption Configuration_FileLineEdit\", \"c:\\\\crypto\");\n test.log(\"Encryption: Windows location changed\");\n }\n if(findObject(\":Encryption Configuration_FileLineEdit_2\").text!=\"//home//crypto\")\n {\n type(\":Encryption Configuration_FileLineEdit_2\", \"<Right>\");\n type(\":Encryption Configuration_FileLineEdit_2\", \"<Ctrl+Backspace>\");\n type(\":Encryption Configuration_FileLineEdit_2\", \"//home//administrator//crypto\");\n test.log(\"Encryption: Linux location changed\");\n }\n if(findObject(\":Encryption Configuration_FileLineEdit_3\").text!=\"/Users/crypto\")\n {\n type(\":Encryption Configuration_FileLineEdit_3\", \"<Right>\");\n type(\":Encryption Configuration_FileLineEdit_3\", \"<Ctrl+Backspace>\");\n type(\":Encryption Configuration_FileLineEdit_3\", \"/Users/crypto\");\n test.log(\"Encryption: Mac location changed\");\n }\n waitForObject(\":xTuple ERP: *_QPushButton\");\n clickButton(\":xTuple ERP: *_QPushButton\");\n test.log(\"Encryption defined\");\n }catch(e){test.fail(\"Exception in defining Encryption:\"+e);}\n \n \n //---Restarting Application--\n waitForObject(\":xTuple ERP: OpenMFG Edition_QMenuBar\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Exit xTuple ERP...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Exit xTuple ERP...\");\n \n snooze(4);\n if(OS.name==\"Linux\")\n startApplication(\"xtuple.bin\");\n \n else\n startApplication(\"xtuple\");\n \n snooze(2);\n \n loginAppl(\"CONFIGURE\"); \n \n\nvar appEdition = findApplicationEdition(); \n\n\n //-----create Entities-------\n createDept(\"MFG\",\"Manufacturing\");\n assignAllPrivileges(\"CONFIGURE\");\n \n var appEdition = findApplicationEdition();\n if(appEdition==\"Manufacturing\")\n createShift(\"1ST\",\"First\");\n else if(appEdition==\"PostBooks\" || appEdition==\"xTupleERP\")\n {\n try{\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n \n if(object.exists(\"{column='0' container=':_tree.Master Information_QModelIndex' text='Shifts' type='QModelIndex'}\"))\n test.fail(\"shifts menu found in \"+appEdition);\n else\n test.pass(\" shifts menu not found in \"+appEdition);\n waitForObject(\":Setup.Save_QPushButton\");\n clickButton(\":Setup.Save_QPushButton\"); \n \n }\n catch(e){test.fail(\"Exception in verifying Shifts Menu\");}\n \n }\n //-------------Enabling Tab view----------------\n try{\n activateItem(waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Products\"));\n activateItem(waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Products_QMenu\", \"Item\"));\n activateItem(waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Item_QMenu\", \"List...\"));\n \n snooze(.5);\n if(object.exists(\":Tax Authorities.Close_QToolButton\"))\n {\n test.log(\"item screen opened\");\n activateItem(waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Window\"));\n snooze(.5);\n if(waitForObjectItem(\":xTuple ERP: *.Window_QMenu\", \"Tab View\"))\n {\n activateItem(waitForObjectItem(\":xTuple ERP: *.Window_QMenu\", \"Tab View\"));\n }\n clickButton(waitForObject(\":Tax Authorities.Close_QToolButton\"));\n }\n }\n catch(e)\n {\n test.fail(\"exception in changing to Tab view mode\" + e);\n if(object.exists(\":Tax Authorities.Close_QToolButton\"))\n clickButton(waitForObject(\":Tax Authorities.Close_QToolButton\"));\n }\n \n //---Restarting Application--\n waitForObject(\":xTuple ERP: OpenMFG Edition_QMenuBar\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Exit xTuple ERP...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Exit xTuple ERP...\");\n \n snooze(4);\n if(OS.name==\"Linux\")\n startApplication(\"xtuple.bin\");\n \n else\n startApplication(\"xtuple\");\n \n snooze(2);\n \n loginAppl(\"CONFIGURE\"); \n\n \n var appEdition = findApplicationEdition(); \n createLocale(\"MYLOCALE\",\"My Locale For Class\");\n createRole(\"SUPER\",\"Super User Group\");\n \n //-------------Configure: Accounting Module----------------\n try{ \n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n waitForObject(\":Setup._modules_QComboBox\");\n clickItem(\":Setup._modules_QComboBox\", \"Accounting\",10, 10, 0, Qt.LeftButton);\n \n snooze(0.5);\n if(findObject(\":_mainSize_QSpinBox\").currentText!=\"4\")\n {\n findObject(\":_mainSize_QSpinBox\").clear();\n type(\":_mainSize_QSpinBox\", \"4\");\n }\n \n snooze(0.2);\n \n waitForObject(\":_gl.Use Company Segment_QCheckBox\");\n if(!findObject(\":_gl.Use Company Segment_QCheckBox\").checked)\n clickButton(\":_gl.Use Company Segment_QCheckBox\");\n snooze(0.2);\n if(findObject(\":_companySegmentSize_QSpinBox_3\").currentText!=\"2\")\n {\n findObject(\":_companySegmentSize_QSpinBox_3\").clear();\n type(\":_companySegmentSize_QSpinBox_3\", \"2\");\n }\n snooze(0.2);\n if(findObject(\":_subaccountSize_QSpinBox_3\").currentText!=\"2\")\n {\n findObject(\":_subaccountSize_QSpinBox_3\").clear(); \n type(\":_subaccountSize_QSpinBox_3\", \"2\");\n }\n snooze(0.2);\n if(appEdition==\"Manufacturing\"||appEdition==\"Standard\")\n {\n waitForObject(\":_useCompanySegmentGroup.Enable External Company Consolidation_QCheckBox\");\n if(!findObject(\":_useCompanySegmentGroup.Enable External Company Consolidation_QCheckBox\").checked)\n clickButton(\":_useCompanySegmentGroup.Enable External Company Consolidation_QCheckBox\");\n }\n else if(appEdition==\"PostBooks\")\n {\n snooze(0.5);\n test.xverify(object.exists(\":_useCompanySegmentGroup.Enable External Company Consolidation_QCheckBox\"), \"External Company - checkbox not visible\");\n }\n snooze(0.5);\n waitForObject(\":_gl.Use Profit Centers_QCheckBox\");\n if(!findObject(\":_gl.Use Profit Centers_QCheckBox\").checked)\n type(\":_gl.Use Profit Centers_QCheckBox\",\" \");\n snooze(0.5);\n waitForObject(\":_useProfitCentersGroup.Allow Free-Form Profit Centers_QCheckBox\");\n if(!findObject(\":_useProfitCentersGroup.Allow Free-Form Profit Centers_QCheckBox\").checked)\n clickButton(\":_useProfitCentersGroup.Allow Free-Form Profit Centers_QCheckBox\");\n snooze(0.5);\n waitForObject(\":_gl.Use Subaccounts_QCheckBox\");\n if(!findObject(\":_gl.Use Subaccounts_QCheckBox\").checked)\n type(\":_gl.Use Subaccounts_QCheckBox\",\" \");\n waitForObject(\":_useSubaccountsGroup.Allow Free-Form Subaccounts_QCheckBox\");\n if(findObject(\":_useSubaccountsGroup.Allow Free-Form Subaccounts_QCheckBox\").checked)\n clickButton(\":_useSubaccountsGroup.Allow Free-Form Subaccounts_QCheckBox\");\n snooze(0.2);\n if(findObject(\":_profitCenterSize_QSpinBox_3\").currentText!=\"2\")\n {\n waitForObject(\":_profitCenterSize_QSpinBox_3\");\n findObject(\":_profitCenterSize_QSpinBox_3\").clear();\n type(\":_profitCenterSize_QSpinBox_3\", \"2\");\n }\n snooze(0.5);\n waitForObject(\":_miscGroup.Mandatory notes for Manual Journal Entries_QCheckBox\");\n if(!findObject(\":_miscGroup.Mandatory notes for Manual Journal Entries_QCheckBox\").checked)\n clickButton(\":_miscGroup.Mandatory notes for Manual Journal Entries_QCheckBox\");\n snooze(1);\n waitForObject(\":Accounting Configuration.qt_tabwidget_tabbar_QTabBar\");\n clickTab(\":Accounting Configuration.qt_tabwidget_tabbar_QTabBar\", \"Global\");\n \n waitForObject(\":Meaning of Currency Exchange Rates:.Foreign × Exchange Rate = Base_QRadioButton_2\");\n clickButton(\":Meaning of Currency Exchange Rates:.Foreign × Exchange Rate = Base_QRadioButton_2\");\n waitForObject(\":List Departments.Save_QPushButton\");\n clickButton(\":List Departments.Save_QPushButton\");\n snooze(0.5);\n if(object.exists(\":Company ID Correct?.Yes_QPushButton\"))\n clickButton(\":Company ID Correct?.Yes_QPushButton\");\n test.log(\"Acconting Module Configured\");\n }\n catch(e){test.fail(\"Exception in configuring Accounting:\"+e);}\n \n //-------Create Company: Prodiem---------\n createCompany(\"01\",\"Prodiem\");\n \n //--------------Create Currencies------------------------ \n try{\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n waitForObject(\":Master Information.Currencies_QModelIndex\");\n mouseClick(\":Master Information.Currencies_QModelIndex\", 34, 2, 0, Qt.LeftButton);\n \n \n //----------Create Foreign currency - EUR------------\n waitForObject(\":List Work Centers.New_QPushButton\");\n clickButton(\":List Work Centers.New_QPushButton\");\n waitForObject(\":_stack._currName_QLineEdit\");\n type(\":_stack._currName_QLineEdit\", \"Euros\");\n waitForObject(\":_stack._currSymbol_QLineEdit\");\n type(\":_stack._currSymbol_QLineEdit\", \"EUR\");\n waitForObject(\":_stack._currAbbr_QLineEdit\");\n type(\":_stack._currAbbr_QLineEdit\", \"EUR\"); \n waitForObject(\":List Departments.Save_QPushButton\");\n clickButton(\":List Departments.Save_QPushButton\"); \n snooze(2);\n \n waitForObject(\":_stack._curr_XTreeWidget\");\n if(object.exists(\":_curr.US Dollars_QModelIndex\"))\n test.pass(\"Currency: USD created\");\n else test.fail(\"Currency: USD not created\");\n \n if(object.exists(\"{column='3' container=':_stack._curr_XTreeWidget' text='EUR' type='QModelIndex'}\"))\n test.pass(\"Currency: EUR created\");\n else test.fail(\"Currency: EUR not created\");\n \n waitForObject(\":Setup.Save_QPushButton\");\n clickButton(\":Setup.Save_QPushButton\");\n test.log(\"Currencies are created\");\n }\n catch(e){test.fail(\"Exception caught in creating Currencies\");\n }\n \n \n //----------Create Exchange Rates-------------------\n try{\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n waitForObject(\":Master Information.Exchange Rates_QModelIndex\");\n mouseClick(\":Master Information.Exchange Rates_QModelIndex\", 55, 11, 0, Qt.LeftButton);\n waitForObject(\":List Work Centers.New_QPushButton\");\n clickButton(\":List Work Centers.New_QPushButton\");\n type(\":_stack._rate_XLineEdit\", \"1.36\");\n type(\":_stack.XDateEdit_XDateEdit\", \"-30\");\n type(\":_stack.XDateEdit_XDateEdit\", \"<Tab>\");\n waitForObject(\":_stack.XDateEdit_XDateEdit_2\");\n type(\":_stack.XDateEdit_XDateEdit_2\", \"+365\");\n type(\":_stack.XDateEdit_XDateEdit_2\", \"<Tab>\");\n waitForObject(\":_stack.Save_QPushButton\");\n clickButton(\":_stack.Save_QPushButton\");\n waitForObject(\":_frame._conversionRates_XTreeWidget\");\n if(findObject(\":_conversionRates.EUR - EUR_QModelIndex\").text== \"EUR - EUR\")\n test.pass(\"Exchange Rate of EUR created\");\n else test.fail(\"Exchange Rate of EUR not created\");\n waitForObject(\":Setup.Save_QPushButton\");\n clickButton(\":Setup.Save_QPushButton\");\n test.log(\"Exchange Rate for the currency is created\");\n }\n catch(e){test.fail(\"Exception in creating Exchange Rates:\"+e);\n }\n \n \n //-------------Accounting-Profit Center Number---------------------\n try{ \n \n waitForObject(\":xTuple ERP: OpenMFG Edition_QMenuBar\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Accounting\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Accounting_QMenu\", \"Account\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Accounting_QMenu\", \"Account\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Account_QMenu\", \"Profit Center Numbers...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Account_QMenu\", \"Profit Center Numbers...\");\n \n waitForObject(\":List Profit Centers.New_QPushButton\");\n clickButton(\":List Profit Centers.New_QPushButton\");\n waitForObject(\":List Profit Centers._number_XLineEdit\");\n type(\":List Profit Centers._number_XLineEdit\", \"01\");\n type(\":List Profit Centers._descrip_QTextEdit\", \"Profit Center 01\");\n waitForObject(\":List Profit Centers.Save_QPushButton\");\n clickButton(\":List Profit Centers.Save_QPushButton\");\n \n waitForObject(\":List Profit Centers._prftcntr_XTreeWidget\");\n if(object.exists(\":_prftcntr.01_QModelIndex\"))\n test.pass(\"Profit Center Number: 01 created\");\n else\n test.fail(\"Profit Center Number: 01 not created\");\n waitForObject(\":List Profit Centers.Close_QPushButton\");\n clickButton(\":List Profit Centers.Close_QPushButton\");\n test.log(\"Profit Center is created\");\n }\n catch(e){test.fail(\"Exception in defining Profit Centers:\"+e);}\n \n //--------------Accounting-Account-SubAccount Numbers-----------------\n try{\n waitForObject(\":xTuple ERP: OpenMFG Edition_QMenuBar\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Accounting\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Accounting_QMenu\", \"Account\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Accounting_QMenu\", \"Account\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Account_QMenu\", \"Subaccount Numbers...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Account_QMenu\", \"Subaccount Numbers...\");\n waitForObject(\":List Subaccounts.New_QPushButton\");\n clickButton(\":List Subaccounts.New_QPushButton\");\n waitForObject(\":List Subaccounts._number_XLineEdit\");\n type(\":List Subaccounts._number_XLineEdit\", \"01\");\n type(\":List Subaccounts._descrip_QTextEdit\", \"Subaccount 01 - General\");\n \n waitForObject(\":List Subaccounts.Save_QPushButton\");\n clickButton(\":List Subaccounts.Save_QPushButton\");\n snooze(2);\n if(object.exists(\":_subaccnt.Subaccount 01 - General_QModelIndex\")) \n test.pass(\"Profit Center Number: 01 created\");\n else\n test.fail(\"Profit Center Number: 01 not created\");\n waitForObject(\":List Subaccounts.Close_QPushButton\");\n clickButton(\":List Subaccounts.Close_QPushButton\");\n test.log(\"Sub Account Number is created\");\n }\n catch(e){test.fail(\"Exception in defining Subaccount Numbers\"+e);}\n \n \n \n \n //------------Account-Account-SubAccount Types-----------------\n try{\n waitForObject(\":xTuple ERP: OpenMFG Edition_QMenuBar\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Accounting\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Accounting_QMenu\", \"Account\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Accounting_QMenu\", \"Account\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Account_QMenu\", \"Subaccount Types...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Account_QMenu\", \"Subaccount Types...\");\n \n \n //--SubAccount Types: SO-Revenue-Other Revenue--\n \n waitForObject(\":List Work Centers.New_QPushButton\");\n clickButton(\":List Work Centers.New_QPushButton\");\n waitForObject(\":Work Center._code_XLineEdit\");\n type(\":Work Center._code_XLineEdit\", \"SO\");\n clickItem(\":Subaccount Type._type_XComboBox\", \"Revenue\", 0, 0, 1, Qt.LeftButton);\n type(\":Work Center._description_XLineEdit\", \"Other Revenue\");\n waitForObject(\":Work Center.Save_QPushButton\");\n clickButton(\":Work Center.Save_QPushButton\");\n test.log(\"SubAccount: SO-Revenue-Other Revenue created\");\n \n //--SubAccount Types: DXP-Expenses-Depreciation Expense--\n waitForObject(\":List Work Centers.New_QPushButton\");\n clickButton(\":List Work Centers.New_QPushButton\");\n waitForObject(\":Work Center._code_XLineEdit\");\n type(\":Work Center._code_XLineEdit\", \"DXP\");\n clickItem(\":Subaccount Type._type_XComboBox\", \"Expense\", 0, 0, 1, Qt.LeftButton);\n type(\":Work Center._description_XLineEdit\", \"Depreciation Expense\");\n waitForObject(\":Work Center.Save_QPushButton\");\n clickButton(\":Work Center.Save_QPushButton\");\n \n \n //--SubAccount Types: OI-Revenue-Other Income--\n waitForObject(\":List Work Centers.New_QPushButton\");\n clickButton(\":List Work Centers.New_QPushButton\");\n waitForObject(\":Work Center._code_XLineEdit\");\n type(\":Work Center._code_XLineEdit\", \"OI\");\n clickItem(\":Subaccount Type._type_XComboBox\", \"Revenue\", 0, 0, 1, Qt.LeftButton);\n type(\":Work Center._description_XLineEdit\", \"Other Income\");\n waitForObject(\":Work Center.Save_QPushButton\");\n clickButton(\":Work Center.Save_QPushButton\");\n \n snooze(1);\n waitForObject(\":List G/L Subaccount Types.Close_QPushButton\");\n \n if(object.exists(\":_subaccnttypes.SO_QModelIndex\"))\n test.pass(\"SubAccountL:SO Revenue created\");\n else \n test.fail(\"SubAccountL:SO Revenue not created\");\n \n if(object.exists(\":_subaccnttypes.DXP_QModelIndex_2\"))\n test.pass(\"SubAccount: DXP Expense created\");\n else\n test.fail(\"SubAccount: DXP Expense not created\");\n \n if(object.exists(\":_subaccnttypes.OI_QModelIndex_2\"))\n test.pass(\"SubAccount: OI Expense created\");\n else\n test.fail(\"SubAccount: OI Expense not created\");\n snooze(0.1);\n \n waitForObject(\":List Work Centers.Close_QPushButton\");\n clickButton(\":List Work Centers.Close_QPushButton\");\n }\n catch(e){test.fail(\"Exception in creating Subaccounts:\"+e);}\n \n \n \n \n \n \n //-----------Create Chart Of Accounts-------------------------------\n try{ \n waitForObject(\":xTuple ERP: OpenMFG Edition_QMenuBar\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Accounting\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Accounting_QMenu\", \"Account\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Accounting_QMenu\", \"Account\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Account_QMenu\", \"Chart of Accounts...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Account_QMenu\", \"Chart of Accounts...\");\n waitForObject(\":_account_XTreeWidget\");\n \n COA(\"01\",\"01\",\"1950\",\"01\",\"Unassigned Inv Transactions\",\"Asset\",\"IN\");\n \n COA(\"01\",\"01\",\"3030\",\"01\",\"Retained Earnings\",\"Equity\",\"EC\");\n \n COA(\"01\",\"01\",\"3040\",\"01\",\"Stock Class B\",\"Equity\",\"EDC\");\n \n COA(\"01\",\"01\",\"8990\",\"01\",\"Currency Gain / Loss\",\"Expense\",\"EXP\");\n \n COA(\"01\",\"01\",\"8995\",\"01\",\"G/L Series Discrepancy\",\"Expense\",\"EXP\"); \n \n waitForObject(\":Chart of Accounts.Close_QPushButton\");\n clickButton(\":Chart of Accounts.Close_QPushButton\");\n \n }catch(e){test.fail(\"Exception caught in creating Chart of Accounts:\"+e);}\n \n \n \n //-----------------Configure: Products Module--------------\n try{\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n waitForObject(\":Setup._modules_QComboBox\");\n clickItem(\":Setup._modules_QComboBox\", \"Products\",10, 10, 0, Qt.LeftButton);\n waitForObject(\":Configure.Products_QModelIndex\");\n mouseClick(\":Configure.Products_QModelIndex\", 37, 4, 0, Qt.LeftButton);\n waitForObject(\":Products Configuration.Post Item Changes to the Change Log_QCheckBox\");\n if(appEdition==\"Manufacturing\")\n {\n if(!findObject(\":Products Configuration.Enable Work Center Routings_QGroupBox\").checked)\n type(\":Products Configuration.Enable Work Center Routings_QGroupBox\",\" \");\n if(!findObject(\":Track Machine Overhead.as Machine Overhead_QRadioButton\").checked)\n clickButton(\":Track Machine Overhead.as Machine Overhead_QRadioButton\");\n if(!findObject(\":Products Configuration.Enable Breeder Bills of Materials_QCheckBox\").checked)\n clickButton(\":Products Configuration.Enable Breeder Bills of Materials_QCheckBox\");\n if(!findObject(\":Products Configuration.Enable Transforms_QCheckBox\").checked)\n clickButton(\":Products Configuration.Enable Transforms_QCheckBox\");\n if(!findObject(\":Products Configuration.Enable Revision Control_QCheckBox\").checked)\n clickButton(\":Products Configuration.Enable Revision Control_QCheckBox\");\n }\n else if(appEdition==\"Standard\"||appEdition==\"PostBooks\")\n {\n test.xverify(object.exists(\":Products Configuration.Enable Work Center Routings_QGroupBox\"), \"Enable Work Center - groupbox not visible\");\n test.xverify(object.exists(\":Track Machine Overhead.as Machine Overhead_QRadioButton\"), \"Machine Overhead - RadioButton not visible\"); \n test.xverify(object.exists(\":Products Configuration.Enable Breeder Bills of Materials_QCheckBox\"), \"Enable Breeder Bills of Materials - not visible\"); \n \n }\n \n if(!findObject(\":Products Configuration.Post Item Changes to the Change Log_QCheckBox\").checked)\n findObject(\":Products Configuration.Post Item Changes to the Change Log_QCheckBox\").checked= true;\n if(findObject(\":Products Configuration.Allow Inactive Items to be Added to BOMs_QCheckBox\").checked)\n findObject(\":Products Configuration.Allow Inactive Items to be Added to BOMs_QCheckBox\").checked=false; \n if(findObject(\":Defaults.Set Sold Items as Exclusive_QCheckBox\").checked)\n findObject(\":Defaults.Set Sold Items as Exclusive_QCheckBox\").checked=false;\n type(\":_issueMethod_QComboBox\", \"Mixed\");\n waitForObject(\":Setup.Save_QPushButton\");\n clickButton(\":Setup.Save_QPushButton\");\n if(appEdition==\"Manufacturing\")\n {\n waitForObject(\":Registration Key.Yes_QPushButton\");\n clickButton(\":Registration Key.Yes_QPushButton\");\n }\n else if(appEdition==\"Standard\"||appEdition==\"PostBooks\")\n test.xverify(object.exists(\":Registration Key.Yes_QPushButton\"), \"Cancel Yes Button - not visible\"); \n \n test.log(\"Product Module Configured\");\n }catch(e){test.fail(\"Exception in configuring Products Module\");}\n \n \n \n //----------Create Incident Category-----------\n try{ \n \n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n waitForObject(\":Setup._modules_QComboBox\");\n clickItem(\":Setup._modules_QComboBox\",\"CRM\",10, 10, 0, Qt.LeftButton);\n waitForObject(\":Master Information.Incident Categories_QModelIndex\");\n mouseClick(\":Master Information.Incident Categories_QModelIndex\", 73, 4, 0, Qt.LeftButton);\n waitForObject(\":List Incident Categories.New_QPushButton\");\n clickButton(\":List Incident Categories.New_QPushButton\");\n waitForObject(\":_name_XLineEdit_14\");\n type(\":_name_XLineEdit_14\", \"DUNNING\");\n waitForObject(\":Incident Category._order_QSpinBox\");\n findObject(\":Incident Category._order_QSpinBox\").clear();\n snooze(0.1);\n type(\":Incident Category._order_QSpinBox\", \"90\");\n type(\":Incident Category._descrip_QTextEdit\", \"Dunning Incident\");\n waitForObject(\":Setup.Save_QPushButton\");\n clickButton(\":Setup.Save_QPushButton\"); \n waitForObject(\":List Employees.Save_QPushButton_2\");\n clickButton(\":List Employees.Save_QPushButton_2\");\n test.log(\"Incident Category is created\");\n }catch(e)\n {\n test.fail(\"Exception in creating Incident Categories\"+e);\n }\n \n //----------Configure Accounts Receivable-------\n try{\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Accounting\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Accounting\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Accounting_QMenu\", \"Setup...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Accounting_QMenu\", \"Setup...\");\n waitForObject(\":Accounting Configuration.qt_tabwidget_tabbar_QTabBar\");\n clickTab(\":Accounting Configuration.qt_tabwidget_tabbar_QTabBar\",\"Accounts Receivable\");\n waitForObject(\":_ar._nextARMemoNumber_XLineEdit\");\n findObject(\":_ar._nextARMemoNumber_XLineEdit\").clear();\n snooze(0.5);\n type(\":_ar._nextARMemoNumber_XLineEdit\",\"20000\");\n waitForObject(\":_ar._nextCashRcptNumber_XLineEdit\");\n findObject(\":_ar._nextCashRcptNumber_XLineEdit\").clear();\n snooze(0.5);\n type(\":_ar._nextCashRcptNumber_XLineEdit\",\"10000\");\n waitForObject(\":Remit-To Address._name_XLineEdit\");\n findObject(\":Remit-To Address._name_XLineEdit\").clear();\n type(\":Remit-To Address._name_XLineEdit\", \"ProDium Toys\");\n waitForObject(\":Maintain Item Costs.XLineEdit_XLineEdit\");\n findObject(\":Maintain Item Costs.XLineEdit_XLineEdit\").clear();\n type(\":Maintain Item Costs.XLineEdit_XLineEdit\", \"Accounts Receivable\");\n waitForObject(\":Remit-To Address.XLineEdit_XLineEdit\");\n findObject(\":Remit-To Address.XLineEdit_XLineEdit\").clear();\n type(\":Remit-To Address.XLineEdit_XLineEdit\", \"12100 Playland Way\");\n waitForObject(\":Remit-To Address.XLineEdit_XLineEdit_2\");\n findObject(\":Remit-To Address.XLineEdit_XLineEdit_2\").clear();\n waitForObject(\":Remit-To Address.XLineEdit_XLineEdit_3\");\n findObject(\":Remit-To Address.XLineEdit_XLineEdit_3\").clear();\n type(\":Remit-To Address.XLineEdit_XLineEdit_3\", \"Norfolk\");\n waitForObject(\":Remit-To Address._state_XComboBox\");\n \n \n while(findObject(\":Remit-To Address._country_XComboBox\").currentText!=\"United States\")\n type(\":Remit-To Address._country_XComboBox\",\"<Down>\");\n snooze(1);\n waitForObject(\":Remit-To Address._phone_XLineEdit\");\n findObject(\":Remit-To Address._phone_XLineEdit\").clear();\n snooze(0.5);\n type(\":Remit-To Address._phone_XLineEdit\", \"757-461-3022\");\n \n if(!findObject(\":_ar.Credit Warn Customers when Late_QGroupBox\").checked)\n type(\":_ar.Credit Warn Customers when Late_QGroupBox\",\" \");\n waitForObject(\":Credit Warn Customers when Late._graceDays_QSpinBox\");\n findObject(\":Credit Warn Customers when Late._graceDays_QSpinBox\").clear();\n snooze(0.5);\n type(\":Credit Warn Customers when Late._graceDays_QSpinBox\", \"15\");\n snooze(1);\n waitForObject(\":_ar._incdtCategory_XComboBox_2\");\n clickItem(\":_ar._incdtCategory_XComboBox_2\",\"DUNNING\",10,10,0, Qt.LeftButton);\n if(!findObject(\":_ar.Auto Close Incidents when Invoice Paid_QCheckBox\").checked)\n clickButton(\":_ar.Auto Close Incidents when Invoice Paid_QCheckBox\");\n snooze(1);\n waitForObject(\":List Employees.Save_QPushButton_2\");\n clickButton(\":List Employees.Save_QPushButton_2\");\n test.log(\"Accounting Module is configured\");\n }\n catch(e){\n test.fail(\"Exception in configuring Accounting module:\"+e);\n }\n \n //------------Configure Manufacture Module----------------\n try{\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Manufacture\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Manufacture\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Manufacture_QMenu\", \"Setup...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Manufacture_QMenu\", \"Setup...\");\n \n waitForObject(\":Configure.Manufacture_QModelIndex\");\n mouseClick(\":Configure.Manufacture_QModelIndex\", 45, 2, 0, Qt.LeftButton);\n \n waitForObject(\":Manufacture Configuration._nextWoNumber_XLineEdit\");\n findObject(\":Manufacture Configuration._nextWoNumber_XLineEdit\").clear();\n type(\":Manufacture Configuration._nextWoNumber_XLineEdit\", \"10000\");\n \n if(object.exists(\":Manufacture Configuration.Auto Fill Post Operation Qty. to Balance_QCheckBox\"))\n {\n if(!findObject(\":Manufacture Configuration.Auto Fill Post Operation Qty. to Balance_QCheckBox\").checked)\n mouseClick(\":Manufacture Configuration.Auto Fill Post Operation Qty. to Balance_QCheckBox\",73, 4, 0, Qt.LeftButton);\n }\n waitForObject(\":List Employees.Save_QPushButton_2\");\n clickButton(\":List Employees.Save_QPushButton_2\");\n test.log(\"Manufacture Module is configured\");\n \n }\n catch(e){\n test.fail(\"Exception in configuring Manufacture module:\"+e);\n }\n \n \n //------------Configure CRM Module----------------\n try{\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"CRM\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"CRM\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.CRM_QMenu\", \"Setup...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.CRM_QMenu\", \"Setup...\");\n \n waitForObject(\":Configure.CRM_QModelIndex\");\n mouseClick(\":Configure.CRM_QModelIndex\", 45, 2, 0, Qt.LeftButton);\n \n waitForObject(\":CRM Configuration._nextInNumber_XLineEdit\");\n findObject(\":CRM Configuration._nextInNumber_XLineEdit\").clear();\n type(\":CRM Configuration._nextInNumber_XLineEdit\", \"15000\");\n \n if(!findObject(\":CRM Configuration.Use Projects_QCheckBox\").checked)\n mouseClick(\":CRM Configuration.Use Projects_QCheckBox\", 35, 10, 0, Qt.LeftButton);\n \n if(!findObject(\":_stack.Post Opportunity Changes to the Change Log_QCheckBox\").checked)\n clickButton(\":_stack.Post Opportunity Changes to the Change Log_QCheckBox\");\n \n waitForObject(\":_country_XComboBox_3\");\n while(findObject(\":_country_XComboBox_3\").currentText!=\"United States\")\n type(\":_country_XComboBox_3\",\"<Down>\");\n snooze(1);\n \n if(findObject(\":_stack.Enforce Valid Country Names_XCheckBox\").active)\n {\n if(!findObject(\":_stack.Enforce Valid Country Names_XCheckBox\").checked)\n clickButton(\":_stack.Enforce Valid Country Names_XCheckBox\");\n }\n \n waitForObject(\":List Employees.Save_QPushButton_2\");\n clickButton(\":List Employees.Save_QPushButton_2\");\n test.log(\"CRM Module is configured\");\n }\n catch(e){\n test.fail(\"Exception in configuring CRM module:\"+e);\n }\n \n //-----------create new calendar---------------\n try{\n \n var i,j;\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n waitForObject(\":Master Information.Calendars_QModelIndex\");\n mouseClick(\":Master Information.Calendars_QModelIndex\", 34, 4, 0, Qt.LeftButton);\n snooze(0.5);\n waitForObject(\":List Work Centers.New_QPushButton\");\n clickButton(\":List Work Centers.New_QPushButton\");\n waitForObject(\":_stack.Relative_QPushButton\");\n clickButton(\":_stack.Relative_QPushButton\"); \n waitForObject(\":_stack._name_XLineEdit\");\n type(\":_stack._name_XLineEdit\", \"8WRELDAYFW\");\n waitForObject(\":_stack._descrip_XLineEdit\");\n type(\":_stack._descrip_XLineEdit\", \"8 Weeks Forward From Today\");\n snooze(0.5);\n while(findObject(\":Calendar Type:._origin_QComboBox\").currentText!=\"Current Day\")\n type(\":Calendar Type:._origin_QComboBox\",\"<Down>\");\n \n for(i=0;i<8;i++)\n {\n waitForObject(\":_stack.New_QPushButton_2\");\n clickButton(\":_stack.New_QPushButton_2\");\n j=i+1;\n waitForObject(\":_stack._name_XLineEdit_2\");\n type(\":_stack._name_XLineEdit_2\", \"WEEK\"+j);\n findObject(\":_stack._offsetCount_QSpinBox\").clear();\n type(\":_stack._offsetCount_QSpinBox\",i);\n waitForObject(\":_stack._offsetType_QComboBox\");\n clickItem(\":_stack._offsetType_QComboBox\",\"Weeks\",10,10,0, Qt.LeftButton);\n snooze(1);\n waitForObject(\":Work Center.Save_QPushButton\");\n clickButton(\":Work Center.Save_QPushButton\");\n }\n waitForObject(\":List Employees.Save_QPushButton_2\");\n clickButton(\":List Employees.Save_QPushButton_2\");\n waitForObject(\":List Employees.Save_QPushButton_2\");\n clickButton(\":List Employees.Save_QPushButton_2\");\n test.log(\"New Calendar is created\");\n }\n catch(e){\n test.fail(\"Exception in creating new calendar:\"+e);\n }\n \n if(appEdition==\"Manufacturing\"|| appEdition==\"Standard\")\n {\n //----------Configure Schedule module--------------\n try{\n \n \n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Schedule\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Schedule\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Schedule_QMenu\", \"Setup...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Schedule_QMenu\", \"Setup...\"); \n waitForObject(\":Configure.Schedule_QModelIndex\");\n mouseClick(\":Configure.Schedule_QModelIndex\", 11, 4, 0, Qt.LeftButton);\n snooze(0.5);\n findObject(\":Schedule Configuration._nextPlanNumber_XLineEdit\").clear();\n type(\":Schedule Configuration._nextPlanNumber_XLineEdit\", \"90000\");\n \n waitForObject(\":Schedule Configuration._calendar_CalendarComboBox\");\n clickItem(\":Schedule Configuration._calendar_CalendarComboBox\",\"8WRELDAYFW\",10,10,0, Qt.LeftButton);\n snooze(1);\n \n if(object.exists(\":Schedule Configuration.Enable Constraint Management_QCheckBox\"))\n {\n if(!findObject(\":Schedule Configuration.Enable Constraint Management_QCheckBox\").checked)\n clickButton(\":Schedule Configuration.Enable Constraint Management_QCheckBox\");\n }\n \n waitForObject(\":List Employees.Save_QPushButton_2\");\n clickButton(\":List Employees.Save_QPushButton_2\");\n test.log(\"Schedule Module is configured\");\n \n }\n catch(e){\n test.fail(\"Exception in configuring Schedule module:\"+e);\n }\n \n }\n \n //----------Create new Title--------------\n try{\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n waitForObject(\":Setup._modules_QComboBox\");\n clickItem(\":Setup._modules_QComboBox\",\"CRM\",10, 10, 0, Qt.LeftButton);\n waitForObject(\":Master Information.Titles_QModelIndex\");\n mouseClick(\":Master Information.Titles_QModelIndex\", 12, 9, 0, Qt.LeftButton);\n waitForObject(\":List Work Centers.New_QPushButton\");\n clickButton(\":List Work Centers.New_QPushButton\");\n waitForObject(\":Work Center._code_XLineEdit\");\n type(\":Work Center._code_XLineEdit\", \"Master\");\n waitForObject(\":Setup.Save_QPushButton\");\n clickButton(\":Setup.Save_QPushButton\");\n snooze(1);\n if(object.exists(\":_honorifics.Master_QModelIndex_2\"))\n test.pass(\"Title: Master created\");\n else test.fail(\"Title: Master not created\");\n waitForObject(\":Setup.Save_QPushButton\");\n clickButton(\":Setup.Save_QPushButton\");\n test.log(\"New Title is created\");\n }catch(e){test.fail(\"Exception in defining Title:\"+e);}\n \n \n //-------------Create Site Types------------------\n try{\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n waitForObject(\":Setup._modules_QComboBox\");\n clickItem(\":Setup._modules_QComboBox\",\"Inventory\",10,10, 0, Qt.LeftButton);\n waitForObject(\":Master Information.Site Types_QModelIndex\");\n mouseClick(\":Master Information.Site Types_QModelIndex\", 42, 4, 0, Qt.LeftButton);\n \n waitForObject(\":List Work Centers.New_QPushButton\");\n clickButton(\":List Work Centers.New_QPushButton\");\n waitForObject(\":Work Center._code_XLineEdit\");\n type(\":Work Center._code_XLineEdit\", \"INTRAN\");\n waitForObject(\":Work Center._description_XLineEdit\");\n type(\":Work Center._description_XLineEdit\",\"Intransit Site\");\n waitForObject(\":Setup.Save_QPushButton\");\n clickButton(\":Setup.Save_QPushButton\");\n snooze(1);\n if(object.exists(\"{column='0' container=':_stack._sitetype_XTreeWidget' text='INTRAN' type='QModelIndex'}\"))\n test.pass(\"Site Type: INTRAN created\");\n \n waitForObject(\":List Work Centers.New_QPushButton\");\n clickButton(\":List Work Centers.New_QPushButton\");\n waitForObject(\":Work Center._code_XLineEdit\");\n type(\":Work Center._code_XLineEdit\", \"STORAGE\");\n waitForObject(\":Work Center._description_XLineEdit\");\n type(\":Work Center._description_XLineEdit\",\"Storage Site\");\n waitForObject(\":Setup.Save_QPushButton\");\n clickButton(\":Setup.Save_QPushButton\"); \n if(object.exists(\"{column='0' container=':_stack._sitetype_XTreeWidget' text='STORAGE' type='QModelIndex'}\"))\n test.pass(\"Site Type: STORAGE created\"); \n waitForObject(\":Setup.Save_QPushButton\");\n clickButton(\":Setup.Save_QPushButton\");\n \n }\n catch(e)\n {test.fail(\"Exception in Creating Site Type:\"+e);\n }\n \n //---find Application Edition---\n var appEdition = findApplicationEdition();\n \n //-------------------Assigning Accounts to Company-------------------\n if(appEdition==\"Manufacturing\"||appEdition==\"Standard\")\n {\n try\n {\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Accounting\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Accounting\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Accounting_QMenu\", \"Account\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Accounting_QMenu\", \"Account\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Account_QMenu\", \"Companies...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Account_QMenu\", \"Companies...\");\n waitForObject(\":List Companies._company_XTreeWidget\");\n doubleClickItem(\":List Companies._company_XTreeWidget\",\"01\", 10, 10,0,Qt.LeftButton);\n \n waitForObject(\":List Companies.VirtualClusterLineEdit_GLClusterLineEdit\");\n type(\":List Companies.VirtualClusterLineEdit_GLClusterLineEdit\",\"01-01-3030-01\");\n nativeType(\"<Tab>\");\n waitForObject(\":List Companies.VirtualClusterLineEdit_GLClusterLineEdit_2\");\n type(\":List Companies.VirtualClusterLineEdit_GLClusterLineEdit_2\",\"01-01-8990-01\");\n nativeType(\"<Tab>\");\n waitForObject(\":List Companies.VirtualClusterLineEdit_GLClusterLineEdit_3\");\n type(\":List Companies.VirtualClusterLineEdit_GLClusterLineEdit_3\",\"01-01-8995-01\");\n nativeType(\"<Tab>\");\n snooze(0.5);\n waitForObject(\":List Employees.Save_QPushButton_2\");\n clickButton(\":List Employees.Save_QPushButton_2\");\n waitForObject(\":List Companies.Close_QPushButton\");\n clickButton(\":List Companies.Close_QPushButton\");\n test.log(\"Accounts Assigned to the company\");\n }\n catch(e)\n {\n test.fail(\"Error in assigning accounts to the company\"+ e);\n }\n }\n else\n {\n try \n {\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Accounting\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Accounting\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Accounting_QMenu\", \"Account\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Accounting_QMenu\", \"Account\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Account_QMenu\", \"Companies...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Account_QMenu\", \"Companies...\");\n waitForObject(\":List Companies._company_XTreeWidget\");\n doubleClickItem(\":List Companies._company_XTreeWidget\",\"01\", 10, 10,0,Qt.LeftButton);\n waitForObject(\":List Companies.VirtualClusterLineEdit_GLClusterLineEdit\");\n type(\":List Companies.VirtualClusterLineEdit_GLClusterLineEdit_3\",\"01-01-3030-01\");\n nativeType(\"<Tab>\");\n waitForObject(\":List Companies.VirtualClusterLineEdit_GLClusterLineEdit\");\n type(\":List Companies.VirtualClusterLineEdit_GLClusterLineEdit\",\"01-01-8990-01\");\n nativeType(\"<Tab>\");\n waitForObject(\":List Companies.VirtualClusterLineEdit_GLClusterLineEdit_2\");\n type(\":List Companies.VirtualClusterLineEdit_GLClusterLineEdit_2\",\"01-01-8995-01\");\n nativeType(\"<Tab>\");\n snooze(0.5);\n waitForObject(\":List Employees.Save_QPushButton_2\");\n clickButton(\":List Employees.Save_QPushButton_2\");\n waitForObject(\":List Companies.Close_QPushButton\");\n clickButton(\":List Companies.Close_QPushButton\");\n test.log(\"Accounts Assigned to the company\");\n }\n catch(e)\n {\n test.fail(\"Error in assigning accounts to the company\"+ e);\n }\n }\n \n \n \n //-----------Create Inventory Site: WH1-----------------\n try{\n if(appEdition==\"Manufacturing\"|| appEdition==\"Standard\")\n {\n \n waitForObject(\":xTuple ERP: OpenMFG Edition_QMenuBar\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Inventory\"); \n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Inventory_QMenu\", \"Site\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Inventory_QMenu\", \"Site\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Site_QMenu\", \"List...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Site_QMenu\", \"List...\");\n waitForObject(\":List Sites.New_QPushButton\");\n clickButton(\":List Sites.New_QPushButton\");\n \n waitForObject(\":_code_XLineEdit_3\");\n type(\":_code_XLineEdit_3\", \"WH1\");\n type(\":_description_XLineEdit_5\", \"Prodiem Toys Site1\");\n if(findObject(\":_sitetype_XComboBox\").currentText!= \"WHSE\")\n clickItem(\":_sitetype_XComboBox\", \"WHSE\", 0, 0, 1, Qt.LeftButton);\n type(\":_addressGroup.XLineEdit_XLineEdit\", \"street addr line1\");\n type(\":_addressGroup.XLineEdit_XLineEdit_2\", \"street addr line2\");\n type(\":_addressGroup.XLineEdit_XLineEdit_3\", \"street addr line3\");\n type(\":_addressGroup.XLineEdit_XLineEdit_4\", \"city1\");\n type(\":_addressGroup.XLineEdit_XLineEdit_5\", \"23234324\");\n clickItem(\":_addressGroup._country_XComboBox_2\", \"United States\", 0, 0, 1, Qt.LeftButton);\n snooze(1);\n waitForObject(\":_addressGroup._state_XComboBox_4\");\n clickItem(\":_addressGroup._state_XComboBox_4\",\"VA\",0, 0, 1, Qt.LeftButton);\n snooze(1);\n \n waitForObject(\":_accountGroup.VirtualClusterLineEdit_GLClusterLineEdit\");\n waitForObject(\":_accountGroup_QLabel\");\n sendEvent(\"QMouseEvent\", \":_accountGroup_QLabel\", QEvent.MouseButtonPress, 0, 0, Qt.LeftButton, 0);\n waitForObjectItem(\":_QMenu\", \"List...\");\n activateItem(\":_QMenu\", \"List...\");\n waitForObject(\":_listTab_XTreeWidget_9\");\n doubleClickItem(\":_listTab_XTreeWidget_9\",\"1950\", 10, 8, 0, Qt.LeftButton);\n \n clickTab(\":List Sites.qt_tabwidget_tabbar_QTabBar\",\"General\");\n waitForObject(\":_generalTab.Inventory Site_QRadioButton\");\n clickButton(\":_generalTab.Inventory Site_QRadioButton\");\n waitForObject(\":_whsTypeStack._bolNumber_XLineEdit\");\n type(\":_whsTypeStack._bolNumber_XLineEdit\", \"10000\");\n type(\":_whsTypeStack._countTagNumber_XLineEdit\", \"20000\");\n clickButton(\":_whsTypeStack.Shipping Site_QCheckBox\");\n clickButton(\":_whsTypeStack.Force the use of Count Slips_QCheckBox\");\n clickButton(\":_whsTypeStack.Enforce the use of Zones_QCheckBox\");\n type(\":_whsTypeStack._shipcomm_XLineEdit\", \"0.00\");\n \n clickTab(\":List Sites.qt_tabwidget_tabbar_QTabBar\", \"Site Locations\");\n waitForObject(\":_locationsTab.Enforce ARBL Naming Convention_QGroupBox\"); \n type(\":_locationsTab.Enforce ARBL Naming Convention_QGroupBox\",\"Space>\");\n findObject(\":Enforce ARBL Naming Convention._aisleSize_QSpinBox\").clear();\n type(\":Enforce ARBL Naming Convention._aisleSize_QSpinBox\", \"2\");\n clickButton(\":Enforce ARBL Naming Convention.Allow Alpha Characters_QCheckBox\");\n findObject(\":Enforce ARBL Naming Convention._rackSize_QSpinBox\").clear();\n type(\":Enforce ARBL Naming Convention._rackSize_QSpinBox\", \"2\");\n clickButton(\":Enforce ARBL Naming Convention.Allow Alpha Characters_QCheckBox_2\");\n findObject(\":Enforce ARBL Naming Convention._binSize_QSpinBox\").clear();\n type(\":Enforce ARBL Naming Convention._binSize_QSpinBox\", \"2\");\n clickButton(\":Enforce ARBL Naming Convention.Allow Alpha Characters_QCheckBox_3\");\n findObject(\":Enforce ARBL Naming Convention._locationSize_QSpinBox\");\n type(\":Enforce ARBL Naming Convention._locationSize_QSpinBox\", \"2\");\n clickButton(\":Enforce ARBL Naming Convention.Allow Alpha Characters_QCheckBox_4\");\n clickTab(\":List Sites.qt_tabwidget_tabbar_QTabBar\", \"Site Zones\");\n snooze(1);\n \n waitForObject(\":List Calendars.New_QPushButton_2\");\n clickButton(\":List Calendars.New_QPushButton_2\");\n waitForObject(\":_name_XLineEdit_32\");\n type(\":_name_XLineEdit_32\", \"FG1\");\n type(\":_description_XLineEdit_43\", \"Finished Goods Zone1\");\n clickButton(\":List Sites.Save_QPushButton\");\n snooze(1);\n clickButton(\":List Calendars.New_QPushButton_2\");\n waitForObject(\":_name_XLineEdit_32\");\n type(\":_name_XLineEdit_32\", \"RM1\");\n type(\":_description_XLineEdit_43\", \"Raw Materials Zone1\");\n clickButton(\":List Sites.Save_QPushButton\");\n waitForObject(\":Save_QPushButton\");\n clickButton(\":Save_QPushButton\");\n waitForObject(\":List Sites._warehouse_XTreeWidget\");\n if(object.exists(\"{column='0' container=':List Sites._warehouse_XTreeWidget' text='WH1' type='QModelIndex'}\"))\n test.pass(\"Site: Prodiem Toys Site1 created \");\n else test.fail(\"Site: Prodiem Toys Site1 not created \");\n \n \n }\n else if(appEdition==\"PostBooks\")\n {\n waitForObject(\":xTuple ERP: OpenMFG Edition_QMenuBar\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Inventory\"); \n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Inventory_QMenu\", \"Site\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Inventory_QMenu\", \"Site\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Site_QMenu\", \"Maintain...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Site_QMenu\", \"Maintain...\");\n waitForObject(\":_code_XLineEdit_14\");\n type(\":_code_XLineEdit_14\", \"WH1\");\n type(\":_sitetype_XComboBox_2\", \"WHSE\");\n type(\":_description_XLineEdit_26\", \"Prodiem Toys Site1\");\n type(\":_addressGroup.XLineEdit_XLineEdit\", \"street addr line1\");\n type(\":_addressGroup.XLineEdit_XLineEdit_2\", \"street addr line2\");\n type(\":_addressGroup.XLineEdit_XLineEdit_3\", \"street addr line3\");\n type(\":_addressGroup.XLineEdit_XLineEdit_4\", \"city1\");\n type(\":_addressGroup.XLineEdit_XLineEdit_5\", \"23234324\");\n clickItem(\":_addressGroup._country_XComboBox_2\", \"United States\", 0, 0, 1, Qt.LeftButton);\n snooze(1);\n waitForObject(\":_addressGroup._state_XComboBox_4\");\n clickItem(\":_addressGroup._state_XComboBox_4\",\"VA\",0, 0, 1, Qt.LeftButton);\n snooze(1); \n \n waitForObject(\":_accountGroup.VirtualClusterLineEdit_GLClusterLineEdit\");\n waitForObject(\":_accountGroup_QLabel\");\n sendEvent(\"QMouseEvent\", \":_accountGroup_QLabel\", QEvent.MouseButtonPress, 0, 0, Qt.LeftButton, 0);\n waitForObjectItem(\":_QMenu\", \"List...\");\n activateItem(\":_QMenu\", \"List...\");\n waitForObject(\":_listTab_XTreeWidget_9\");\n doubleClickItem(\":_listTab_XTreeWidget_9\",\"1950\", 10, 8, 0, Qt.LeftButton);\n \n snooze(0.1);\n clickTab(\":Site.qt_tabwidget_tabbar_QTabBar\", \"Site Locations\");\n waitForObject(\":Enforce ARBL Naming Convention._aisleSize_QSpinBox_2\");\n findObject(\":Enforce ARBL Naming Convention._aisleSize_QSpinBox_2\").clear();\n waitForObject(\":Enforce ARBL Naming Convention._aisleSize_QSpinBox_2\");\n type(\":Enforce ARBL Naming Convention._aisleSize_QSpinBox_2\", \"2\");\n clickButton(\":Enforce ARBL Naming Convention.Allow Alpha Characters_QCheckBox_5\");\n findObject(\":Enforce ARBL Naming Convention._rackSize_QSpinBox_2\").clear();\n waitForObject(\":Enforce ARBL Naming Convention._rackSize_QSpinBox_2\");\n type(\":Enforce ARBL Naming Convention._rackSize_QSpinBox_2\",\"2\");\n clickButton(\":Enforce ARBL Naming Convention.Allow Alpha Characters_QCheckBox_6\");\n findObject(\":Enforce ARBL Naming Convention._binSize_QSpinBox_2\").clear();\n waitForObject(\":Enforce ARBL Naming Convention._binSize_QSpinBox_2\");\n type(\":Enforce ARBL Naming Convention._binSize_QSpinBox_2\",\"2\");\n clickButton(\":Enforce ARBL Naming Convention.Allow Alpha Characters_QCheckBox_7\");\n findObject(\":Enforce ARBL Naming Convention._locationSize_QSpinBox_2\").clear();\n waitForObject(\":Enforce ARBL Naming Convention._locationSize_QSpinBox_2\");\n type(\":Enforce ARBL Naming Convention._locationSize_QSpinBox_2\",\"2\");\n waitForObject(\":Enforce ARBL Naming Convention.Allow Alpha Characters_QCheckBox_8\");\n clickButton(\":Enforce ARBL Naming Convention.Allow Alpha Characters_QCheckBox_8\");\n snooze(1);\n clickTab(\":Site.qt_tabwidget_tabbar_QTabBar\", \"Site Zones\");\n snooze(1);\n \n waitForObject(\":_zonesTab.New_QPushButton\");\n clickButton(\":_zonesTab.New_QPushButton\");\n waitForObject(\":_name_XLineEdit_32\");\n type(\":_name_XLineEdit_32\", \"FG1\");\n type(\":_description_XLineEdit_43\", \"Finished Goods Zone1\");\n clickButton(\":List Sites.Save_QPushButton\");\n \n snooze(1);\n clickButton(\":_zonesTab.New_QPushButton\");\n waitForObject(\":_name_XLineEdit_32\");\n \n type(\":_name_XLineEdit_32\", \"RM1\");\n type(\":_description_XLineEdit_43\", \"Raw Materials Zone1\");\n clickButton(\":List Sites.Save_QPushButton\");\n \n waitForObject(\":Save_QPushButton_2\");\n clickButton(\":Save_QPushButton_2\");\n test.log(\"site created:WH1\");\n \n }\n \n \n if(appEdition==\"Manufacturing\"||appEdition==\"Standard\")\n {\n \n //-------Create Inventory Site: WH2-----------------\n waitForObject(\":List Sites.New_QPushButton\");\n clickButton(\":List Sites.New_QPushButton\");\n waitForObject(\":_code_XLineEdit_3\");\n type(\":_code_XLineEdit_3\", \"WH2\");\n type(\":_description_XLineEdit_5\", \"Prodiem Toys Site2\");\n if(findObject(\":_sitetype_XComboBox\").currentText!= \"WHSE\")\n type(\":_sitetype_XComboBox\",\"WHSE\");\n type(\":_addressGroup.XLineEdit_XLineEdit\", \"street addr line1\");\n type(\":_addressGroup.XLineEdit_XLineEdit_2\", \"street addr line2\");\n type(\":_addressGroup.XLineEdit_XLineEdit_3\", \"street addr line3\");\n type(\":_addressGroup.XLineEdit_XLineEdit_4\", \"city1\");\n type(\":_addressGroup.XLineEdit_XLineEdit_5\", \"23234324\");\n clickItem(\":_addressGroup._country_XComboBox_2\", \"United States\", 0, 0, 1, Qt.LeftButton);\n snooze(1);\n waitForObject(\":_addressGroup._state_XComboBox_4\");\n clickItem(\":_addressGroup._state_XComboBox_4\",\"VA\",0, 0, 1, Qt.LeftButton);\n snooze(1);\n \n waitForObject(\":_accountGroup.VirtualClusterLineEdit_GLClusterLineEdit\");\n waitForObject(\":_accountGroup_QLabel\");\n sendEvent(\"QMouseEvent\", \":_accountGroup_QLabel\", QEvent.MouseButtonPress, 0, 0, Qt.LeftButton, 0);\n waitForObjectItem(\":_QMenu\", \"List...\");\n activateItem(\":_QMenu\", \"List...\");\n waitForObject(\":_listTab_XTreeWidget_9\");\n doubleClickItem(\":_listTab_XTreeWidget_9\",\"1950\", 10, 8, 0, Qt.LeftButton);\n snooze(0.1);\n clickTab(\":Site.qt_tabwidget_tabbar_QTabBar\", \"Site Locations\");\n waitForObject(\":Enforce ARBL Naming Convention._aisleSize_QSpinBox_2\");\n findObject(\":Enforce ARBL Naming Convention._aisleSize_QSpinBox_2\").clear();\n waitForObject(\":Enforce ARBL Naming Convention._aisleSize_QSpinBox_2\");\n type(\":Enforce ARBL Naming Convention._aisleSize_QSpinBox_2\", \"2\");\n clickButton(\":Enforce ARBL Naming Convention.Allow Alpha Characters_QCheckBox_5\");\n findObject(\":Enforce ARBL Naming Convention._rackSize_QSpinBox_2\").clear();\n waitForObject(\":Enforce ARBL Naming Convention._rackSize_QSpinBox_2\");\n type(\":Enforce ARBL Naming Convention._rackSize_QSpinBox_2\",\"2\");\n clickButton(\":Enforce ARBL Naming Convention.Allow Alpha Characters_QCheckBox_6\");\n findObject(\":Enforce ARBL Naming Convention._binSize_QSpinBox_2\").clear();\n waitForObject(\":Enforce ARBL Naming Convention._binSize_QSpinBox_2\");\n type(\":Enforce ARBL Naming Convention._binSize_QSpinBox_2\",\"2\");\n clickButton(\":Enforce ARBL Naming Convention.Allow Alpha Characters_QCheckBox_7\");\n findObject(\":Enforce ARBL Naming Convention._locationSize_QSpinBox_2\").clear();\n waitForObject(\":Enforce ARBL Naming Convention._locationSize_QSpinBox_2\");\n type(\":Enforce ARBL Naming Convention._locationSize_QSpinBox_2\",\"2\");\n waitForObject(\":Enforce ARBL Naming Convention.Allow Alpha Characters_QCheckBox_8\");\n clickButton(\":Enforce ARBL Naming Convention.Allow Alpha Characters_QCheckBox_8\");\n snooze(1);\n clickTab(\":Site.qt_tabwidget_tabbar_QTabBar\", \"Site Zones\");\n snooze(1);\n \n waitForObject(\":List Calendars.New_QPushButton_2\");\n clickButton(\":List Calendars.New_QPushButton_2\");\n waitForObject(\":_name_XLineEdit_31\");\n type(\":_name_XLineEdit_31\", \"FG11\");\n type(\":_description_XLineEdit_43\", \"Finished Goods Zone1\");\n clickButton(\":Site Zone.Save_QPushButton\");\n \n snooze(1);\n clickButton(\":List Calendars.New_QPushButton_2\");\n waitForObject(\":_name_XLineEdit_31\");\n \n type(\":_name_XLineEdit_31\", \"RM11\");\n type(\":_description_XLineEdit_43\", \"Raw Materials Zone1\");\n clickButton(\":Site Zone.Save_QPushButton\");\n \n \n clickTab(\":List Sites.qt_tabwidget_tabbar_QTabBar\",\"General\");\n waitForObject(\":_generalTab.Inventory Site_QRadioButton\");\n clickButton(\":_generalTab.Inventory Site_QRadioButton\");\n waitForObject(\":_numberGroup._bolNumber_XLineEdit\");\n findObject(\":_numberGroup._bolNumber_XLineEdit\").clear();\n type(\":_numberGroup._bolNumber_XLineEdit\", \"WH2\");\n findObject(\":_countTagPrefix_XLineEdit_2\").clear();\n type(\":_countTagPrefix_XLineEdit_2\", \"WH2\");\n type(\":_whsTypeStack._bolNumber_XLineEdit\", \"10000\");\n type(\":_whsTypeStack._countTagNumber_XLineEdit\", \"20000\");\n clickButton(\":_whsTypeStack.Shipping Site_QCheckBox\");\n clickButton(\":_whsTypeStack.Force the use of Count Slips_QCheckBox\");\n clickButton(\":_whsTypeStack.Enforce the use of Zones_QCheckBox\");\n type(\":_whsTypeStack._shipcomm_XLineEdit\", \"0.00\");\n \n waitForObject(\":Save_QPushButton_2\");\n clickButton(\":Save_QPushButton_2\");\n waitForObject(\":List Sites._warehouse_XTreeWidget\");\n if(object.exists(\"{column='0' container=':List Sites._warehouse_XTreeWidget' text='WH2' type='QModelIndex'}\"))\n test.pass(\"Site: Prodiem Toys Site2 created\");\n else test.fail(\"Site: Prodiem Toys Site2 not created\");\n \n waitForObject(\":List Sites.Close_QPushButton\");\n clickButton(\":List Sites.Close_QPushButton\");\n \n \n }\n \n } catch(e){test.fail(\"Exception in Creating Site\"+ e );}\n \n \n \n //----------Configure: Inventory Module-----------------\n try{\n \n \n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n waitForObject(\":Setup._modules_QComboBox\");\n clickItem(\":Setup._modules_QComboBox\",\"Inventory\",10,10, 0, Qt.LeftButton);\n waitForObject(\":Configure.Inventory_QModelIndex\");\n mouseClick(\":Configure.Inventory_QModelIndex\", 30, 3, 0, Qt.LeftButton);\n waitForObject(\":_eventFence_QSpinBox\");\n type(\":_eventFence_QSpinBox\", \"<Ctrl+A>\");\n type(\":_eventFence_QSpinBox\", \"<Del>\");\n type(\":_eventFence_QSpinBox\", \"30\");\n if(!findObject(\":_inventory.Post Item Site Changes to the Change Log_QCheckBox\").checked)\n clickButton(\":_inventory.Post Item Site Changes to the Change Log_QCheckBox\");\n if(appEdition==\"Manufacturing\"||appEdition==\"Standard\")\n {\n if(!findObject(\":Multiple Sites.Enable Shipping Interface from Transfer Order screen_QCheckBox\").checked)\n clickButton(\":Multiple Sites.Enable Shipping Interface from Transfer Order screen_QCheckBox\");\n if(!findObject(\":Multiple Sites.Post Transfer Order Changes to the Change Log_QCheckBox\").checked)\n clickButton(\":Multiple Sites.Post Transfer Order Changes to the Change Log_QCheckBox\");\n while(findObject(\":_toNumGeneration_QComboBox\").currentText!=\"Automatic\")\n type(\":_toNumGeneration_QComboBox\",\"<Down>\");\n waitForObject(\":_toNextNum_XLineEdit\");\n findObject(\":_toNextNum_XLineEdit\").clear();\n waitForObject(\":_toNextNum_XLineEdit\");\n type(\":_toNextNum_XLineEdit\", \"90000\");\n if(!findObject(\":_inventory.Enable Lot/Serial Control_QCheckBox\").checked)\n clickButton(\":_inventory.Enable Lot/Serial Control_QCheckBox\");\n }\n else if(appEdition==\"PostBooks\")\n {\n test.xverify(object.exists(\":Multiple Sites.Enable Shipping Interface from Transfer Order screen_QCheckBox\"),\"Enable Shipping Interface - not visible\");\n test.xverify(object.exists(\":Multiple Sites.Post Transfer Order Changes to the Change Log_QCheckBox\"),\"Post Transfer Order Changes - not visible\");\n test.xverify(object.exists(\":_toNumGeneration_QComboBox\"),\"To Number Generation combobox - not visible\");\n test.xverify(object.exists(\":_toNextNum_XLineEdit\"),\"To Next number - not visible\");\n test.xverify(object.exists(\":_inventory.Enable Lot/Serial Control_QCheckBox\"),\"Enable Lot/Serial Control - not visible\"); \n \n }\n if(!findObject(\":Costing Methods Allowed.Average_QCheckBox\").checked)\n clickButton(\":Costing Methods Allowed.Average_QCheckBox\");\n if(!findObject(\":When Count Tag Qty. exceeds Slip Qty..Do Not Post Count Tag_QRadioButton\").checked)\n clickButton(\":When Count Tag Qty. exceeds Slip Qty..Do Not Post Count Tag_QRadioButton\");\n if(!findObject(\":Count Slip # Auditing.Allow Duplications_QRadioButton\").checked)\n clickButton(\":Count Slip # Auditing.Allow Duplications_QRadioButton\");\n waitForObject(\":Setup.Save_QPushButton\");\n clickButton(\":Setup.Save_QPushButton\");\n test.log(\"Inventory Module Configured\");\n }catch(e){test.fail(\"Exception in configuring Inventory module\"+ e);}\n \n \n \n //---Create User by Role--\n createUserByRole(\"RUNREGISTER\");\n \n try{\n //----Read Username based on Role------\n var set = testData.dataset(\"login.tsv\");\n var username;\n for (var records in set)\n {\n username=testData.field(set[records],\"USERNAME\");\n role=testData.field(set[records],\"ROLE\");\n if(role==\"RUNREGISTER\") break;\n \n }\n }catch(e){test.fail(\"Exception caught in reading login.tsv\");}\n \n snooze(2);\n \n //-------------User Preferences------------------------\n try{\n \n if(OS.name==\"Darwin\")\n {\n \n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Products\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Products\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Products_QMenu\",\"Setup...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Products_QMenu\", \"Setup...\");\n } \n else\n {\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n \n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Preferences...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Preferences...\");\n }\n \n waitForObject(\":_userGroup.Selected User:_QRadioButton\");\n clickButton(\":_userGroup.Selected User:_QRadioButton\");\n waitForObject(\":_userGroup._user_XComboBox\");\n clickItem(\":_userGroup._user_XComboBox\", username, 0, 0, 1, Qt.LeftButton);\n waitForObject(\":Interface Options.Show windows inside workspace_QRadioButton\");\n snooze(0.5);\n if(!findObject(\":Interface Options.Show windows inside workspace_QRadioButton\").checked)\n clickButton(\":Interface Options.Show windows inside workspace_QRadioButton\");\n snooze(1);\n if(object.exists(\":Notice.Remind me about this again._QCheckBox\"))\n {\n waitForObject(\":Notice.Remind me about this again._QCheckBox\");\n if(findObject(\":Notice.Remind me about this again._QCheckBox\").checked)\n clickButton(\":Notice.Remind me about this again._QCheckBox\");\n snooze(0.1);\n waitForObject(\":Notice.OK_QPushButton\");\n clickButton(\":Notice.OK_QPushButton\");\n }\n snooze(1);\n if(appEdition==\"Manufacturing\"||appEdition==\"Standard\")\n {\n snooze(1);\n waitForObject(\":Background Image.Image:_QRadioButton\");\n clickButton(\":Background Image.Image:_QRadioButton\");\n while(findObject(\":Background Image.Image:_QRadioButton\").checked!=true)\n snooze(0.1);\n while(findObject(\":Background Image...._QPushButton\").enabled!=true)\n snooze(0.1);\n waitForObject(\":Background Image...._QPushButton\");\n clickButton(\":Background Image...._QPushButton\"); \n waitForObject(\":Image List._image_XTreeWidget\");\n doubleClickItem(\":Image List._image_XTreeWidget\",\"BACKGROUND\",0,0,1,Qt.LeftButton);\n }\n \n snooze(1);\n findObject(\":_idleTimeout_QSpinBox\").clear();\n snooze(2);\n if(!findObject(\":Interface Options.Ignore Missing Translations_QCheckBox\").checked)\n clickButton(\":Interface Options.Ignore Missing Translations_QCheckBox\");\n snooze(1);\n if(appEdition==\"Manufacturing\"||appEdition==\"Standard\")\n clickButton(\":Preferred Site:.Site:_QRadioButton\");\n else if(appEdition==\"PostBooks\")\n test.xverify(object.exists(\":Preferred Site:.Site:_QRadioButton\"),\"Preferred Site - not visible\");\n waitForObject(\":User Preferences.qt_tabwidget_tabbar_QTabBar\");\n clickTab(\":User Preferences.qt_tabwidget_tabbar_QTabBar\", \"Menu\");\n waitForObject(\":_menu.Show Inventory Menu_QCheckBox\");\n clickButton(\":_menu.Show Inventory Menu_QCheckBox\");\n waitForObject(\":_menu.Show Inventory Toolbar_QCheckBox\");\n clickButton(\":_menu.Show Inventory Toolbar_QCheckBox\");\n waitForObject(\":_menu.Show Products Menu_QCheckBox\");\n clickButton(\":_menu.Show Products Menu_QCheckBox\");\n waitForObject(\":_menu.Show Products Toolbar_QCheckBox\");\n clickButton(\":_menu.Show Products Toolbar_QCheckBox\");\n if(appEdition==\"Manufacturing\" || appEdition==\"Standard\")\n {\n waitForObject(\":_menu.Show Schedule Menu_QCheckBox\");\n clickButton(\":_menu.Show Schedule Menu_QCheckBox\");\n waitForObject(\":_menu.Show Schedule Toolbar_QCheckBox\");\n clickButton(\":_menu.Show Schedule Toolbar_QCheckBox\");\n }\n else if(appEdition==\"PostBooks\")\n {\n test.xverify(object.exists(\":_menu.Show Schedule Menu_QCheckBox\"),\"Show Schedule Menu_QCheckBox - not visible\");\n test.xverify(object.exists(\":_menu.Show Schedule Toolbar_QCheckBox\"),\"Show Schedule Toolbar - not visible\");\n }\n waitForObject(\":_menu.Show Purchase Menu_QCheckBox\");\n clickButton(\":_menu.Show Purchase Menu_QCheckBox\");\n waitForObject(\":_menu.Show Purchase Toolbar_QCheckBox\");\n clickButton(\":_menu.Show Purchase Toolbar_QCheckBox\");\n waitForObject(\":_menu.Show Manufacture Menu_QCheckBox\");\n clickButton(\":_menu.Show Manufacture Menu_QCheckBox\");\n waitForObject(\":_menu.Show Manufacture Toolbar_QCheckBox\");\n clickButton(\":_menu.Show Manufacture Toolbar_QCheckBox\");\n waitForObject(\":_menu.Show CRM Menu_QCheckBox\");\n clickButton(\":_menu.Show CRM Menu_QCheckBox\");\n waitForObject(\":_menu.Show CRM Toolbar_QCheckBox\");\n clickButton(\":_menu.Show CRM Toolbar_QCheckBox\");\n waitForObject(\":_menu.Show Sales Menu_QCheckBox\");\n clickButton(\":_menu.Show Sales Menu_QCheckBox\");\n waitForObject(\":_menu.Show Sales Toolbar_QCheckBox\");\n clickButton(\":_menu.Show Sales Toolbar_QCheckBox\");\n waitForObject(\":_menu.Show Accounting Menu_QCheckBox\");\n clickButton(\":_menu.Show Accounting Menu_QCheckBox\");\n waitForObject(\":_menu.Show Accounting Toolbar_QCheckBox\");\n clickButton(\":_menu.Show Accounting Toolbar_QCheckBox\");\n snooze(1);\n waitForObject(\":User Preferences.qt_tabwidget_tabbar_QTabBar\");\n snooze(1);\n if(appEdition==\"Manufacturing\")\n {\n clickTab(\":User Preferences.qt_tabwidget_tabbar_QTabBar\", \"Events\");\n snooze(1);\n var sWidgetTreeControl = \":_events._event_XTreeWidget\";\n waitForObject(sWidgetTreeControl);\n var obj_TreeWidget = findObject(sWidgetTreeControl);\n obj_TreeWidget = cast(obj_TreeWidget, QTreeWidget);\n var obj_TreeRootItem=obj_TreeWidget.invisibleRootItem();\n var iNumberOfRootItems = obj_TreeRootItem.childCount();\n type(sWidgetTreeControl,\"<Space>\");\n var obj_TreeTopLevelItem = obj_TreeRootItem.child(0);\n var sNameOfRootItem = obj_TreeTopLevelItem.text(0);\n for(i=0; i<=iNumberOfRootItems ;i++)\n {\n clickItem(\":_events._warehouses_XTreeWidget\", \"WH1\", 5, 5, 1, Qt.LeftButton);\n type(sWidgetTreeControl,\"<Down>\"); \n }\n clickItem(\":_events._warehouses_XTreeWidget\", \"WH1\", 5, 5, 1, Qt.LeftButton); \n }\n snooze(2);\n waitForObject(\":User Preferences.qt_tabwidget_tabbar_QTabBar\");\n clickTab(\":User Preferences.qt_tabwidget_tabbar_QTabBar\",\"Alarms\");\n snooze(1);\n waitForObject(\":Default Actions.Event_XCheckBox\");\n clickButton(\":Default Actions.Event_XCheckBox\");\n clickButton(\":Default Actions.System Message_XCheckBox\");\n \n waitForObject(\":List Departments.Save_QPushButton\");\n clickButton(\":List Departments.Save_QPushButton\");\n snooze(1);\n test.log(\"User Preferences of \"+username +\":saved\");\n }catch(e){test.fail(\"Exception in defining User Preferences:\"+e);}\n \n}", "editTattoo () {\n\n }", "function setUp(eventInfo) {\n \n //retreiving the UI\n var app = UiApp.getActiveApplication();\n \n //logging start of method\n Logger.log(\"Starting setUp()\");\n Logger.log(\"eventInfo: \" + eventInfo);\n \n //declaring and initializing variables\n var user = Session.getActiveUser().getEmail();\n Logger.log(\"User: \" + user);\n var files = DriveApp.getFilesByName(\"ChangeAlert_Log\"); //returns a fileIterator Object\n var log, body, subject;\n \n if(eventInfo != -1){\n \n //retreiving parameters\n var parameter = eventInfo.parameter;\n \n //storing event parameters into variables\n var UpdateInfo = parameter.UpdateBox;\n var IDdays = parameter.ID_DayBox\n var IDtime = parameter.ID_TimeBox;\n var dayCheckBox = parameter.dayCheckBox;\n var weekCheckBox = parameter.weekCheckBox;\n var UpdateMinuteBox = parameter.UpdateMinuteBox;\n var hourCheckBox = parameter.hourCheckBox;\n var minCheckBox = parameter.minCheckBox;\n \n Logger.log(\"IDdays: \" + IDdays);\n \n//error handling\n \n //IDCheckBox\n if(weekCheckBox == dayCheckBox){\n Logger.log(\"Error -- both ID check boxes the same\");\n subject = \"ACTION NEEDED || ChangeAlert || Multiple Options Selected\";\n body = \"Dear ChangeAlert User, \\n You have either checked both the daily and weekly identification checkboxes or none of the Identification options. You may only use one at a time. Please resubmit the form. \\n \\n Thank you very much. \\n \\n Sincerely, \\n \\n The ChangeAlert Team\";\n MailApp.sendEmail(user, subject, body);\n return;\n } else if (weekCheckBox == \"true\"){\n\t\t //ID Days\n\t\tif(IDdays == \"\" || IDtime == \"\"){\n\t\t Logger.log(\"Error -- Missing Information\");\n\t\t subject = \"ACTION NEEDED || ChangeAlert || Missing Information\";\n\t\t body = \"Dear ChangeAlert User, \\n You have checked the box for weekly updates, however, have not provided the system on which day or time to check. Please resubmit the form. \\n \\n Thank you very much. \\n \\n Sincerely, \\n \\n The ChangeAlert Team\";\n\t\t MailApp.sendEmail(user, subject, body);\n return;\n\t\t} else if (IDdays < 1 || IDdays > 7){\n\t\t Logger.log(\"Error -- IDdays out of bounds\");\n\t\t subject = \"ACTION NEEDED || ChangeAlert || Trigger Value Invalid\";\n\t\t body = \"Dear ChangeAlert User, \\n The value you added indicating the day of the week is invalid. Please enter a number from 1<sunday> to 7<Saturday> and resubmit. \\n \\n Thank you very much. \\n \\n Sincerely, \\n \\n The ChangeAlert Team\";\n\t\t MailApp.sendEmail(user, subject, body);\n return;\n } else if(IDtime < 0 || IDtime > 23){\n Logger.log(\"Error -- IDtime box out of bounds\");\n\t\t subject = \"ACTION NEEDED || ChangeAlert || Trigger Value Invalid\";\n\t\t body = \"Dear ChangeAlert User, \\n The value you added indicating the time at which to check for files is invalid. Please enter a number from 0<midnight> to 23<11pm> and resubmit. \\n \\n Thank you very much. \\n \\n Sincerely, \\n \\n The ChangeAlert Team\";\n\t\t MailApp.sendEmail(user, subject, body);\n return;\n } else {\n\t\t Logger.log(\"No errors in ID_Day parameter\"); \n\t\t}\n\t} else if (dayCheckBox == \"true\"){\n\t\tif(IDtime == \"\"){\n\t\t Logger.log(\"Error -- Missing Information\");\n\t\t subject = \"ACTION NEEDED || ChangeAlert || Missing Information\";\n\t\t body = \"Dear ChangeAlert User, \\n You have checked the box for daily updates, however, have not provided the system at which time to check. Please resubmit the form. \\n \\n Thank you very much. \\n \\n Sincerely, \\n \\n The ChangeAlert Team\";\n\t\t MailApp.sendEmail(user, subject, body);\n return;\n\t\t}\n\t} else {\n\t\tLogger.log(\"NO ID parameter errors found\");\n\t}\n \n //UpdateCheckBox\n if(hourCheckBox == minCheckBox){\n Logger.log(\"Error -- both Update check boxes the same\");\n subject = \"ACTION NEEDED || ChangeAlert || Multiple Options Selected\";\n body = \"Dear ChangeAlert User, \\n you have either checked both the By Minutes and Hourly identification checkboxes or none of the Identification options. You may only use one at a time. Please resubmit the form. \\n \\n Thank you very much. \\n \\n Sincerely, \\n \\n The ChangeAlert Team\";\n MailApp.sendEmail(user, subject, body);\n return;\n } else if (hourCheckBox == \"true\"){\n\t\t//Update Info\n\t\tif(UpdateInfo != 1){ \n\t\t \n\t\t if(UpdateInfo < 1 || UpdateInfo >12){\n\t\t Logger.log(\"Error -- UpdateInfo < 1 or > 12\");\n\t\t subject = \"ACTION NEEDED || ChangeAlert || Trigger Value Invalid\";\n\t\t body = 'Dear ChangeAlert User, \\n you have entered an invalid value for \"Check for updates every __ hour(s),\" please enter an even value between 1 and 12 or 1. \\n \\n Thank you for your help. \\n \\n Sincerely, \\n \\n The ChangeAlert Team';\n\t\t MailApp.sendEmail(user, subject, body);\n\t\t return;\n\t\t } else if(UpdateInfo % 2 != 0) { \n\t\t Logger.log(\"Error -- UpdateInfo not multiple of 2\");\n\t\t subject = \"ACTION NEEDED || ChangeAlert || Trigger Value Invalid\";\n\t\t body = 'Dear ChangeAlert User, you have entered an invalid value for \"Check for updates every __ hour(s),\" please enter an even value between 1 and 12 or 1. Thank you for your help. Sincerely, The ChangeAlert Team';\n\t\t MailApp.sendEmail(user, subject, body);\n\t\t return;\n\t\t } else{\n\t\t Logger.log(\"No error found on Update Hour parameter\"); \n\t\t }\n\t\t} else if (UpdateInfo == \"\"){\n\t\t Logger.log(\"Error -- Missing Information\");\n\t\t subject = \"ACTION NEEDED || ChangeAlert || Missing Information\";\n\t\t body = \"Dear ChangeAlert User, \\n You have checked the box for hourly updates, however, have not provided the system at how many minutes to check. Please resubmit the form. \\n \\n Thank you very much. \\n \\n Sincerely, \\n \\n The ChangeAlert Team\";\n\t\t return;\n\t\t\t\n\t\t} else {\n\t\t\tLogger.log(\"No errors found in Update Minute Parameters\");\n\t\t}\n\t\t\n\t} else if (minCheckBox == \"true\"){\n\t\t//Update Minute Box\n\t\tif(UpdateMinuteBox != 1 && UpdateMinuteBox != 5 && UpdateMinuteBox != 10 && UpdateMinuteBox != 15 && UpdateMinuteBox != 30){\n\t\t Logger.log(\"Error -- UpdateMinuteBox parameter invalid\");\n\t\t subject = \"ACTION NEEDED || ChangeAlert || Trigger Value Invalid\";\n\t\t body = 'Dear ChangeAlert User, \\n you have entered an invalid value for \"Check for updates every __ minute(s),\" please enter either 1, 5, 10, 15, or 30 and resubmit the form. \\n \\n Thank you for your help. \\n \\n Sincerely, \\n \\n The ChangeAlert Team';\n\t\t MailApp.sendEmail(user, subject, body);\n\t\t} else if (UpdateMinuteBox == \"\") {\n\t\t Logger.log(\"Error -- Missing Information\");\n\t\t subject = \"ACTION NEEDED || ChangeAlert || Missing Information\";\n\t\t body = \"Dear ChangeAlert User, \\n You have checked the box for By Minute updates, however, have not provided the system at which time to check. Please resubmit the form. \\n \\n Thank you very much. \\n \\n Sincerely, \\n \\n The ChangeAlert Team\";\n\t\t return;\n\t\t} else {\n\t\t\tLogger.log(\"No errors found in Update minute parameters\");\n\t\t}\n \n\t} else {\n\t\tLogger.log(\"No errors found in ANY UPDATE parameter\");\n\t}\n\n //creating log spreadsheet in user's drive and returning spreadsheet object\n Logger.log(\"creating log file now...\");\n log = SpreadsheetApp.create(\"ChangeAlert_Log\");\n log.getActiveSheet().getRange(1, 1).setValue(\"file_names\");\n log.getActiveSheet().getRange(1, 2).setValue(\"file_dates\");\n \n //setting sheet protection\n log.getActiveSheet().getSheetProtection().setProtected(true);\n \n //creating triggers\n if(minCheckBox == \"true\"){\n createUpdateMinuteTrigger(UpdateMinuteBox); \n } else if (hourCheckBox == \"true\"){\n createUpdateTrigger(UpdateInfo);\n } else {\n Logger.log(\"Error -- cant create ID trigger\");\n subject = \"ACTION NEEDED || ChangeAlert || Trigger Creation Fail\";\n body = \"Dear ChangeAlert User, \\n An error has occurred while creating your Update trigger. Please resubmit the form. \\n \\n Thank you very much. \\n \\n Sincerely, \\n \\n The ChangeAlert Team\";\n MailApp.sendEmail(user, subject, body);\n return;\n }\n \n if(dayCheckBox == \"true\"){\n createID_dayTrigger(IDtime);\n } else if(weekCheckBox == \"true\"){\n createID_weekTrigger(IDdays, IDtime);\n } else {\n Logger.log(\"Error -- cant create ID trigger\");\n subject = \"ACTION NEEDED || ChangeAlert || Trigger Creation Fail\";\n body = \"Dear ChangeAlert User, \\n An error has occurred while creating your Identification trigger. Please resubmit the form. \\n \\n Thank you very much. \\n \\n Sincerely, \\n \\n The ChangeAlert Team\";\n MailApp.sendEmail(user, subject, body);\n return;\n }\n \n //closing the app\n Logger.log(\"Closing UI...\");\n app.close();\n \n //Running IDfiles()\n //IDfiles();\n \n //alerting the user of installation\n var recipient = Session.getActiveUser().getEmail();\n var subject = \"ChangeAlert has been installed\";\n var body = \"Thank you for installing ChangeAlert. Your application is currently working on your Drive. You may now close the window. \\n \\n Sincerely, \\n \\n The Change Alert Team\";\n MailApp.sendEmail(recipient, subject, body)\n \n //returning log\n return log;\n \n } else{\n //finding and returning spreadsheet file\n Logger.log(\"Found Log...trying to open\");\n \n if(files.hasNext() == false){\n Logger.log(\"Log File was deleted\");\n var recipient = Session.getActiveUser().getEmail();\n var subject = \"ACTION NEEDED || Log File was Deleted\";\n var body = \"Dear ChangeAlert User, \\n We have noticed that the log file was deleted in your Drive. Please open the application and resubmit the form. \\n \\n Sincerely, \\n \\n The Change Alert Team\";\n MailApp.sendEmail(recipient, subject, body);\n return;\n }\n \n var logFile = files.next();\n var url = logFile.getUrl();\n log = SpreadsheetApp.openByUrl(url);\n Logger.log(\"returning setUp()\");\n \n //closing the app\n Logger.log(\"Closing UI...\");\n app.close();\n \n return log;\n }\n}", "function kp() {\n $log.debug(\"TODO\");\n }", "function main() {\n var managerAccount = AdsApp.currentAccount();\n var centralSpreadsheet = validateAndGetSpreadsheet(CONFIG.CENTRAL_SPREADSHEET_URL);\n validateEmailAddresses(CONFIG.RECIPIENT_EMAILS);\n var timeZone = AdsApp.currentAccount().getTimeZone();\n var now = new Date();\n\n centralSpreadsheet.setSpreadsheetTimeZone(timeZone);\n\n var processStatus = centralSpreadsheet.getRangeByName(CONFIG.PROCESS_STATUS_RANGE).getValue();\n var runDateString = centralSpreadsheet.getRangeByName(CONFIG.RUN_DATE_RANGE).getValue();\n var runDate = getDateStringInTimeZone('M/d/y', runDateString);\n\n var dateString = getDateStringInTimeZone('M/d/y', now);\n var folderName = \"Disapproved Ads : \" + dateString;\n var folder = createDriveFolder(folderName);\n\n // This is the first execution today, so reset status to PROCESS_NOT_STARTED\n // and clear any old data.\n if (runDate != dateString) {\n processStatus = CONFIG.PROCESS_NOT_STARTED;\n setProcessStatus(centralSpreadsheet, processStatus);\n clearSheetData(centralSpreadsheet);\n }\n\n centralSpreadsheet.getRangeByName(CONFIG.RUN_DATE_RANGE).setValue(dateString);\n\n if (processStatus != CONFIG.PROCESS_COMPLETED) {\n ensureAccountLabels([CONFIG.LABEL]);\n } else {\n removeLabelsInAccounts();\n removeAccountLabels([CONFIG.LABEL]);\n Logger.log(\"All accounts had already been processed.\");\n return;\n }\n\n // Fetch the managed accounts that have not been checked and process them.\n var accountSelector = getAccounts(false);\n processStatus = processAccounts(centralSpreadsheet, accountSelector, folder);\n\n if (processStatus == CONFIG.PROCESS_COMPLETED) {\n setProcessStatus(centralSpreadsheet, processStatus);\n removeLabelsInAccounts();\n\n AdsManagerApp.select(managerAccount);\n removeAccountLabels([CONFIG.LABEL]);\n Logger.log(\"Process Completed without any errors\");\n sendEmailNotification(centralSpreadsheet);\n }\n}", "function setDebug() {\n\tvar id = $(\"#id-input\").val();\n\tvar status = $(\"#status-input\").val();\n\tvar signal = $(\"#signal-input\").val();\n\t\n\tsetStatus(id,status);\n\tsetSignal(id,signal);\n}", "function flagComment(comment_id, action_url, els, can_edit, can_delete, is_main)\n{\n var ReportDlg = Class.create({\n initialize: function ( params ) {\n var title = params.title;\n var addAction = params.addAction;\n var dlg = null;\n var id='reason';\n var msg = params.msg;\n var prompt = params.prompt ? prompt : 'Reason:';\n \n // privileged functions\n this.report = function(event, reportParams)\n {\n reportParams.dlg.cancel();\n var data = reportParams.dlg.getAllData();\n serverAction({action: {\n actions: action_url, \n els: els,\n params: { comment_id: comment_id, reason: data[id], can_edit: can_edit, can_delete: can_delete, is_main: is_main } }\n }); \n };\n \n var dlgLayout = {\n page: 'layout',\n rows: \n [\n [{text: msg, klass: 'gd_text_input_dlg_label'}],\n [ { text: prompt, klass: 'gd_text_input_dlg_label' }, \n { textarea: id, klass: 'report_comment_textarea'} ],\n [ { rowClass: 'gd_last_row'}, \n {button: \"Report\", callback: this.report, isDefault: true}, \n {button: 'Cancel', callback: GeneralDialog.cancelCallback} ]\n ]\n };\n dlgLayout.rows.push();\n \n \n var dlgparams = {this_id: \"gd_text_input_dlg\", pages: [ dlgLayout ], body_style: \"gd_message_box_dlg\", row_style: \"gd_message_box_row\", \n title: title, focus: GeneralDialog.makeId(id)};\n dlg = new GeneralDialog(dlgparams);\n dlg.center();\n }\n });\n \n new ReportDlg({title:\"Report this comment as objectionable\", \n msg:\"Enter a reason in the space below and click 'Report' to send an email to the administrators complaining about this entry.\"});\n\n}", "function MessageSendingToInDesign() {\r\n\t\r\n\t/**\r\n\t The context in which this snippet can run.\r\n\t @type String\r\n\t*/\r\n\tthis.requiredContext = \"\\tInDesign CS4 must be running.\";\r\n\t$.level = 1; // Debugging level\t\r\n}", "function JavaDebug() {\r\n}", "function resetDebug() {\n userProp.deleteProperty(g_debugEmail_key);\n userProp.deleteProperty(g_debug_key);\n setDefaults();\n loadMenu(userProp.getProperty(g_debug_key));\n}", "function main() {\r\n // user.userLogin(\"sporkina@hotmail.com\", \"sporks\");\r\n}", "function setNonStatusText() {\n sendUpdate(\"setNonStatusText\", {\n trackerDescription: tr(\"tracker.know_the_status_of_your\"),\n patentText: tr(\"tracker.patent_pending\"),\n num1: tr(\"general.stage1\"),\n num2: tr(\"general.stage2\"),\n num3: tr(\"general.stage3\"),\n num4: tr(\"general.stage4\"),\n num5: tr(\"general.stage5\"),\n trackerHeader: jsDPZ.util.htmlUnEncode(tr(\"confirmation.dominos_tracker\"))\n });\n }", "startEdit() {\n const basicProgram = this.trs80.getBasicProgramFromMemory();\n if (typeof basicProgram === \"string\") {\n // TODO show error.\n console.error(basicProgram);\n }\n else {\n this.wasStarted = this.trs80.stop();\n this.setProgram(basicProgram);\n this.show();\n }\n }", "function toggleConfDebug(){\n\tdebug = !debug;\n\tsetData('debug', debug);\n\talert('Debug mode '+ (debug ? 'ON' : 'OFF'));\n}", "function setupDebug() {\n\t\t\t$('body').append('<div id=\"_debug\"><span class=\"_line\">0</span><span>Triggering events:</span><span class=\"_message\"></span></div>');\n\t\t\t$('#_debug').css({\n\t\t\t\tposition: 'fixed',\n\t\t\t\tbottom: 0,\n\t\t\t\tright: 0,\n\t\t\t\tbackground: '#ff0000',\n\t\t\t\tcolor: '#fff',\n\t\t\t\tpadding: 5,\n\t\t\t\tfontWeight: 'bold'\n\t\t\t});\n\t\t\t$('#_debug span').css({\n\t\t\t\tdisplay: 'block',\n\t\t\t\ttextAlign: 'right'\n\t\t\t});\n\t\t}", "function jessica() {\n $log.debug(\"TODO\");\n }", "function BuildConsole_PostBuildOptions(){\n\tconsole.log(\"**** Post-Build Options ****\")\n\tvar num = 1\n\tconst exe_path = DKBuildConsole_FindAppExecutablePath(OS, APP, TYPE)\n\tif(exe_path){\n\t\tconsole.log(\" \"+num+\": Launch \"+APP+\" Executable\")\n\t\tnum++\n\t}\n\tconst solution_path = DKBuildConsole_FindAppSolutionPath(OS, APP, TYPE)\n\tif(solution_path){\n\t\tconsole.log(\" \"+num+\": Open Generated \"+APP+\" Solution\")\n\t}\n\tconsole.log(\" 0: BACK\")\n\tconsole.log(\" Esc: EXIT\")\n\tconsole.log(\" Any Other Key To Skip\") \n\tconsole.log(\"\\n\")\n\tvar key = getch()\n\t\t\n\tswitch(key){\n\t\tcase 48: //0\n\t\t\tconsole.log(\"-> BACK\")\n\t\t\tAPP = \"\"\n\t\t\tbreak\n\t\tcase 27: //Esc\n\t\t\tconsole.log(\"-> EXIT\")\n\t\t\tTYPE = \"\"\n\t\t\tCPP_DK_Exit()\n\t\t\tbreak\n\t\tcase 49: //1\n\t\t\tconsole.log(\"-> Run \"+APP+\" Debug Executable\")\n\t\t\tDKBuildConsole_RunApp(OS, APP, \"Debug\")\n\t\t\tbreak\n\t\tcase 50: //2\n\t\t\tconsole.log(\"-> Open Generated \"+APP+\" Soluton\")\n\t\t\tDKBuildConsole_OpenAppSolution(OS, APP)\n\t\t\tbreak\n\t\tdefault:\n\t\t\tbreak\n\t}\n}", "function run() {\r\n var account = {\r\n clientId: \"#####\", // You can get when you registered an app to Netatmo.\r\n clientSecret: \"#####\", // You can get when you registered an app to Netatmo.\r\n userName: \"#####\", // Account for logging in to Netatmo.\r\n password: \"#####\", // Account for logging in to Netatmo.\r\n diffTime: 900, // When the data is not updated from the time that the script was run to before diffTime, it can confirm that Netatmo is down.\r\n batteryPercent: 10, // When the battery charge is less than batteryPercent, this script sends an email as the notification.\r\n mail: \"#####\", // This is used for sending the email.\r\n };\r\n checkNetatmo(account);\r\n}", "async function main() {\n \n // create reusable transporter object using the default SMTP transport\n let transporter = nodemailer.createTransport({\n host: \"smtp.live.com\",\n port: 587,\n secure: false, // true for 465, false for other ports\n auth: {\n user: emailData.mailUser,\n pass: emailData.mailPassword, \n },\n });\n \n // send mail with defined transport object\n let info = await transporter.sendMail({\n from: `www.aleksandergorecki.com ${emailData.mailUser}`, // sender address\n to: \"a.gorecki1980@gmail.com\", // list of receivers\n subject: \"New info from www.aleksandergorecki.com\", // Subject line\n text: \"Hello world?\", // plain text body\n html: output, // html body\n });\n \n console.log(\"Message sent: %s\", info.messageId);\n \n // Preview only available when sending through an Ethereal account\n console.log(\"Preview URL: %s\", nodemailer.getTestMessageUrl(info));\n }", "function debug(message) {\r\n command_1.issueCommand('debug', {}, message);\r\n}", "function debug(message) {\r\n command_1.issueCommand('debug', {}, message);\r\n}", "function runDevelopment() {\n alert(\"Running Development...\");\n }", "function preFlowAction$SetAddressStatus() { \n /* retrieve data */\n var workPage = pega.ui.ClientCache.find('pyWorkPage');\n var BCU = workPage.get('BCU');\n var unit = BCU.get('SelectedUnitPage');\n var addressStatus = unit.get('AddressStatus').getValue();\n var newUnitStatus = unit.get('NewUnitStatus');\n\n /* Pre Mugne call */\n Munge(\"Pre\");\n\n /* Set the correct AddressStatusX property (Default, New, Rework) */\n if (newUnitStatus) {\n if (newUnitStatus.getValue() === 'New') {\n unit.put('AddressStatusNew', addressStatus);\n unit.put('AddressStatusRework', '');\n unit.put('AddressStatusDefault', '');\n } else if (newUnitStatus.getValue() === 'Rework') {\n unit.put('AddressStatusRework', addressStatus);\n unit.put('AddressStatusNew', '');\n unit.put('AddressStatusDefault', '');\n } else {\n unit.put('AddressStatusDefault', addressStatus);\n unit.put('AddressStatusRework', '');\n unit.put('AddressStatusNew', '');\n unit.put('NewUnitStatus', '');\n }\n } else {\n unit.put('AddressStatusDefault', addressStatus);\n unit.put('AddressStatusRework', '');\n unit.put('AddressStatusNew', '');\n unit.put('NewUnitStatus', '');\n }\n\n /* default attempt contact fields */\n try {\n var enumerateUnit = unit.get('EnumerateUnit');\n if (!enumerateUnit || enumerateUnit != true) {\n unit.put('EnumerateUnit', false);\n }\n var LocationAddress = unit.get('LocationAddress');\n var LocIsMail = LocationAddress.get('LOCISMAIL');\n if (!LocIsMail || LocIsMail != 'N') {\n LocationAddress.put('LOCISMAIL', 'Y');\n }\n } catch (e) {\n /* alert(e); */\n }\n}", "function help_menu() {\n console.log('Please use one of the following commands:')\n console.log('Summary: ./pandlss.sh -s <date> <time>')\n console.log('Breakdown: ./pandlss.sh -b <date> <time> <increment>')\n console.log('Breakdown one stock: ./pandlss.sh -b-os <stock> <date> <time> <increment>')\n}", "function chamarAperto(){\n commandAbortJob();\n commandSelectParameterSet(1);\n commandVehicleIdNumberDownload(\"ASDEDCUHBG34563EDFRCVGFR6\");\n commandDisableTool();\n commandEnableTool();\n}", "function main() {\n\tvar $gm = $.noConflict(true);\n\n\tvar updateEmail = function() {\n\t\ttry {\n\t\t\tvar id, address, num;\n\t\t\tif (LP.Treeitem.grid) {\n\t\t\t\tid = LP.Treeitem.grid.getSelectedRowId();\n\t\t\t\taddress = id + \"-\" + LP.JSON.emailInbox;\n\t\t\t\tnum = id.replace(/\\D/g, '');\n\n\t\t\t\t$gm('div#filter_cues span.email').remove();\n\t\t\t\t$gm('div#filter_cues').append('<span class=\"email\"><a href=\"mailto:' + address + '\">' + address + '</a> (' + num + ')</span>');\n\t\t\t} else if (LP.UpcomingTasks) {\n\t\t\t\tid = $gm(LP.UpcomingTasks.selectedRow()).attr('rowid');\n\t\t\t\taddress = id + \"-\" + LP.JSON.emailInbox;\n\t\t\t\tnum = id.replace(/\\D/g, '');\n\t\t\t\t$gm('div#upcoming_tasks_ribbon span.email').remove();\n\t\t\t\t$gm('div#upcoming_tasks_ribbon').append('<span class=\"email\"><a href=\"mailto:' + address + '\">' + address + '</a> (' + num + ')</span>');\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconsole.log(e);\n\t\t}\n\t};\n\tupdateEmail();\n\t$gm(document).on('click', 'td.ti_name', function() { setTimeout(updateEmail, 100); });\n\t$gm(document).on('click', 'div#upcoming_tasks_list tr', function() { setTimeout(updateEmail, 100); });\n\t$gm(document).on('keyup', function() { setTimeout(updateEmail, 100); });\n}", "function aboutApp() {\n const msg = `\n Name: ${APP_TITLE}\n Version: 1.0\n Contact: <Developer Email Goes Here>`\n\n const ui = SpreadsheetApp.getUi();\n ui.alert(\"About this application\", msg, ui.ButtonSet.OK);\n}", "function turnOnDebug(){\n userProp.setProperty(g_debug_key, 'true');\n loadMenu(userProp.getProperty(g_debug_key));\n}", "function aboutSetup(){\n\n}", "function help() {\n console.log(`\n TO ADD A NOTE:\n node index.js --add <ADD YOUR NOTE HERE> --category <ADD YOUR CATEGORY HERE>\n OR\n node index.js --a <ADD YOUR NOTE HERE> --c <ADD YOUR CATEGORY HERE>\n \n TO DELETE A NOTE:\n node index.js --delete <NOTE ID> \n OR\n node index.js --d <NOTE ID> \n TO LIST NOTES:\n node index.js --list \n node index.js --list <certain category> \n OR\n node index.js --l\n node index.js --l <certain category> \n `);\n process.exit();\n}", "toggleDebugMode() {\n debug = !debug;\n }", "function debugChecked()\n{\n\tdocument.getElementById(\"debugTextMsg\").value='DEBUG';\n}", "function main() {\n\tvar docs;\n\n\tdebug( 'Generating REPL help documentation.' );\n\tcreateHelp();\n\n\tdebug( 'Loading REPL help documentation.' );\n\tdocs = require( HELP_OUTPUT );\n\n\tdebug( 'Generating REPL examples.' );\n\tcreateExamples( docs );\n} // end FUNCTION main()", "function commentJouer() {\n\tif (splashScreenOn || game.messagesToDisplay.length > 0) {\n\t\talert(\"Please wait to be in the game before launching this action.\");\n\t\treturn;\n\t}\n\tgame.removeAllMessages();\n\tgame.setCharacterOrientation(\"S\");\n\tgame.getCurrentScene().redraw();\n\tgame.messagesToDisplay.push(new Message(\"This game is very simple to play.\", COLOR_JORIS, -1, -1, -1));\t\t\n\tgame.messagesToDisplay.push(new Message(\"Left-click to unroll all the possible actions:\", COLOR_JORIS, -1, -1, -1));\t\t\n\tgame.messagesToDisplay.push(new Message(\"1. \\\"Walk to\\\", represented by <img src='./images/cursor.png'>\", COLOR_JORIS, -1, -1, -1));\t\t\n\tgame.messagesToDisplay.push(new Message(\"2. \\\"Look at\\\", represented by <img src='./images/yeux.png'>\", COLOR_JORIS, -1, -1, -1));\t\t\n\tgame.messagesToDisplay.push(new Message(\"3. \\\"Use/Pick/Talk to\\\", represented by <img src='./images/main.png'>\", COLOR_JORIS, -1, -1, -1));\t\t\n\tgame.messagesToDisplay.push(new Message(\"4. \\\"Use (the selected object) with\\\", represented by an icon of the selected object.\", COLOR_JORIS, -1, -1, -1));\t\t\n\tgame.messagesToDisplay.push(new Message(\"Notice that this latter is only available if an object is selected in the inventory.\", COLOR_JORIS, -1, -1, -1));\t\t\n\tgame.messagesToDisplay.push(new Message(\"Once the action is chosen, left-click on the area on which the action should be executed.\", COLOR_JORIS, -1, -1, -1));\t\t\n\tgame.messagesToDisplay.push(new Message(\"And, I'll do that.\", COLOR_JORIS, -1, -1, -1));\t\t\n\tgame.messagesToDisplay.push(new Message(\"These actions can also apply to the objects in the inventory. \", COLOR_JORIS, -1, -1, -1));\n\tgame.messagesToDisplay.push(new Message(\"The text line (below the scene) will help you to visualize the current action and the object on which it applies.\", COLOR_JORIS, -1, -1, -1));\t\t\n\tgame.messagesToDisplay.push(new Message(\"When I'm talking, like now,\", COLOR_JORIS, -1, -1, -1));\t\t\n\tgame.messagesToDisplay.push(new Message(\"you can move on to the next sentence, by a left-click,\", COLOR_JORIS, -1, -1, -1));\t\n\tgame.messagesToDisplay.push(new Message(\"without having to wait the end of the sentence.\", COLOR_JORIS, -1, -1, -1));\t\n\tgame.messagesToDisplay.push(new Message(\"Give it a try.\", COLOR_JORIS, -1, -1, 5000));\t\n\tgame.messagesToDisplay.push(new Message(\"Useful, isn't it?\", COLOR_JORIS, -1, -1, -1));\t\n\tgame.messagesToDisplay.push(new Message(\"Let me give you a last piece of advice:\", COLOR_JORIS, -1, -1, -1));\n\tgame.messagesToDisplay.push(new Message(\"If you are stuck, don't hesistate to wipe the game area with your mouse.\", COLOR_JORIS, -1, -1, -1));\n\tgame.messagesToDisplay.push(new Message(\"If there is an object you can interact with, it will be marked in the text line. \", COLOR_JORIS, -1, -1, -1));\n\tgame.messagesToDisplay.push(new Message(\"Don't worry, this game conforms the Lucas Arts&reg; philosophy on adventure games:\", COLOR_JORIS, -1, -1, -1));\n\tgame.messagesToDisplay.push(new Message(\"it is not possible to be stuck, or to die, and all the possible actions that you can do have been planned by the game developers.\", COLOR_JORIS, -1, -1, -1));\n\tgame.messagesToDisplay.push(new Message(\"Have fun :-)\", COLOR_JORIS, -1, -1, -1));\n\tgame.displayMessages();\n}", "function main()\r{\r\tif(isNeedToValidateReqDocument(capIDModel,processCode, stepNum, processID, taskStatus))\r\t{\t\r\t\tisRequiredDocument();\r\t}\r}", "function help() {\n res.send(\n {\n \"response_type\": \"ephemeral\",\n \"text\": \"Type `/support` for status accross all filters. Add a case link `https://help.disqus.com/agent/case/347519` or an email `archon@gmail.com` to get specific.\",\n }\n )\n }", "debug() {}", "function previewPerfectProgrammer() {\n //create a playback with all insert/delete pairs within two comments removed\n projectManager.setNextPlaybackPerfectProgrammer();\n startPlayback(false);\n}", "function main() {\n\tconsole.log('Abacus iPad Business case reference fixer-upper.');\n console.log('Convert Report.js to correct format.');\n\tDU.displayTag();\n\n\tif(ops.version){\n\t\tprocess.exit();\n\t}\n\n\tif(!ops.repoPath){\n\t\tconsole.error('Missing argument: --repoPath');\n\t\tops.printHelp();\n\t\tprocess.exit(-2);\n\t}\n\n\tif(!ops.reportFile){\n\t\tconsole.error('Missing argument: --reportFile');\n\t\tops.printHelp();\n\t\tprocess.exit(-2);\n\t}\n\n\tif (ops.instance){\n\t\tconfig.instance = S(ops.instance).slugify().s;\n\t}\n\n\t// mandatory arguments\n\tconfig.repoPath = ops.repoPath;\n\tconfig.reportFile = ops.reportFile;\n\n\t// call extract, pass in config\n\tFR.fix(config);\n}", "function onDebuggingPopupOkBtnClick() {\r\n debuggingToggleSwitch.click();\r\n }", "function concludeEmailBody() {\n var body = \"\\n\";\n\n body += \"STEPS YOU NEED TO TAKE:\\r\\n\";\n body += \" - View the above page(s) that require maintenance and update them if necessary.\\r\\n\";\n body += \" - Open the Maintenance Log itself and update any elements of a page if necessary.\\r\\n\\n\";\n\n body += \"This was an automated email sent from the 'Drupal Maintenance Log - Email Script' script \";\n body += \"which is attached to the 'Drupal Maintenance Log' spreadsheet located in the Google Drive of the \";\n body += \"ttctt4@gmail.com email account.\\r\\n\\n\";\n body += \"If you have any questions or concerns, please email Noah Moss at mossnoah123@gmail.com\";\n return body;\n}", "function ep_Edit() {\n // set the refresh flag\n\tnlapiSetFieldValue('custpage_2663_edit_mode', 'T', false);\n nlapiSetFieldValue('custpage_2663_refresh_page', 'T', false);\n \n // suppress the alert\n setWindowChanged(window, false);\n \n // submit the form -- calls submitForm function\n document.forms.main_form.submit();\n}", "main() {\n if(this.options.createActions) {\n return this._private_actionPrompt()\n }\n\n return this.log('ERROR: Please select an option')\n }", "function displayFinalHelp() {\n console.log(\"------------------------ Cross Platform Application is Ready to use. ----------------------------\");\n console.log(\"\");\n console.log(\"Run your web app with:\");\n console.log(\" npm start\");\n console.log(\"\");\n console.log(\"Run your Mobile app via NativeScript with:\");\n console.log(\" iOS: npm run start.ios\");\n console.log(\" Android: npm run start.android\");\n console.log(\"\");\n console.log(\"-----------------------------------------------------------------------------------------\");\n console.log(\"\");\n}", "function draftEmail(request){\n request.buttonLink = \"https://goo.gl/forms/c9pVUbeUYaA3tQ0A2\"\n request.buttonText = \"New Request\";\n switch (request.status) {\n case \"New\":\n request.subject = \"Request for \" + request.dateString + \" Appointment Received\";\n request.header = \"Request Received\";\n request.message = \"Once the request has been reviewed you will receive an email updating you on it.\";\n break;\n case \"New2\":\n request.email = \"kurtbkaiser@gmail.com\";\n request.subject = \"New Request for \" + request.dateString;\n request.header = \"Request Received\";\n request.message = \"A new request needs to be reviewed.\";\n request.buttonLink = \"https://docs.google.com/spreadsheets/d/1zfIdZBx8gTGc4rsPqbs7wHbW3626taaQEm1QDB-Hv68/edit?usp=sharing\";\n request.buttonText = \"View Request\";\n break;\n case \"Approve\":\n request.subject = \"Confirmation: Appointment for \" + request.dateString + \" has been scheduled\";\n request.header = \"Confirmation\";\n request.message = \"Your appointment has been scheduled.\";\n break;\n case \"Conflict\":\n request.subject = \"Conflict with \" + request.dateString + \" Appointment Request\";\n request.header = \"Conflict\";\n request.message = \"There was a scheduling conflict. Please reschedule.\";\n request.buttonText = \"Reschedule\";\n break;\n case \"Reject\":\n request.subject = \"Update on Appointment Requested for \" + request.dateString;\n request.header = \"Reschedule\";\n request.message = \"Unfortunately the request times does not work. Could \"+\n \"we reschedule?\";\n request.buttonText = \"Reschedule\";\n break;\n }\n}", "function TPROJECT_PRS(id)\n{\n var pParams = tree_getPrintPreferences();\n parent.workframe.location = fRoot+menuUrl+\"?type=reqspec&level=reqspec&id=\"+id+args+\"&\"+pParams;\n}", "function postFlowAction$SetAddressStatus() {\n\n /* Retrieve data.*/\n var workPage = pega.ui.ClientCache.find('pyWorkPage');\n var BCU = workPage.get('BCU');\n var unit = BCU.get('SelectedUnitPage');\n var newUnitStatus = unit.get('NewUnitStatus') ? unit.get('NewUnitStatus').getValue() : \"\";\n\n /* Port Mugne call */\n Munge(\"Post\");\n\n /* Get AddressStatus value if it exists; if not, initialize it.-KCJ 01-19-2017.*/\n var addressStatus = unit.get('AddressStatus') ? unit.get('AddressStatus').getValue():\"\";\n unit.put(\"AddressStatus\",addressStatus);\n\n /* Get AddressStatusReason value if it exists; if not, initialize it.-KCJ 01-19-2017.*/\n var reason = unit.get('AddressStatusReason') ? unit.get('AddressStatusReason').getValue():\"\";\n unit.put(\"AddressStatusReason\",reason);\n\n /* Get DangerousAddress value if it exists; if not, initialize it.-KCJ 01-19-2017.*/\n var dangerousAddress = unit.get('DangerousAddress') ? unit.get('DangerousAddress').getValue():false;\n\n /* If address status is not \"Unable to Work\", the dangerous address checkbox should be cleared when the user taps \"Next\" and proceeds to the next step.-KCJ, BUG-734, 01-19-2017*/\n if ((addressStatus !== 'Unable To Work') && (dangerousAddress === true)){\n dangerousAddress = false;\n }\n unit.put(\"DangerousAddress\",dangerousAddress);\n\n\n /* Validate fields. Be sure to return out of function after validation piece, so we don't execute routing piece if a validation fails. */\n if (addressStatus === \"\") {\n\n /* Address Status is required */\n if (newUnitStatus === \"\") {\n unit.get('AddressStatusDefault').addMessage(ALMCensus.Messages.AddressStatusRequired);\n } \n else if (newUnitStatus === \"New\") {\n unit.get('AddressStatusNew').addMessage(ALMCensus.Messages.AddressStatusRequired);\n } \n else {\n unit.get('AddressStatusRework').addMessage(ALMCensus.Messages.AddressStatusRequired);\n }\n return;\n }\n\n /* Unable To Work requires a reason */\n if (addressStatus === 'Unable To Work' && (reason === \"\")) {\n unit.get('AddressStatusReason').addMessage(ALMCensus.Messages.AddressStatusReasonRequired);\n return;\n }\n\n /* Determine routing, and possibly resolved work status (Does Not Exists, Unable To Work)*/\n if (\"Does Not Exist\" === addressStatus) {\n\n unit.put('ReportingUnitStatus', 'Resolved-DoesNotExist');\n /* Call function in order to set the reporting status and status reason for RU */\n UpdateReportingStatusAndStatusReasonForRU(\"AddressStatus\", \"AddressStatus\");\n SaveSelectedUnitPage();\n workPage.put('NextStep', 'Resolve');\n return;\n }\n\n if (addressStatus === \"Unable To Work\") {\n /*Store the current address' reason into LatestAddressStatusReason, at the BCU level*/\n /*Nate Dietrich, Mark Switzer */\n BCU.put('LatestAddressStatusReason', reason);\n\n var previousReportingUnitStatus = unit.get('ReportingUnitStatus').getValue();\n unit.put('ReportingUnitStatus', 'Resolved-UnableToWork');\n /* Call function in order to set the reporting status and status reason for RU */\n UpdateReportingStatusAndStatusReasonForRU(\"AddressStatus\", \"AddressStatus\");\n SaveSelectedUnitPage();\n workPage.put('NextStep', 'Resolve');\n return;\n }\n\n unit.put('ReportingUnitStatus', 'Open');\n if ([\"Housing Unit\", \"Uninhabitable\", \"Under Construction\"].indexOf(addressStatus) > -1) {\n workPage.put('NextStep', 'StructureType');\n } \n else if (addressStatus === \"Group Quarters (GQ)\") {\n /*Go to 'Set GQ Details\" Screen.-KCJ, Part of US-845.*/\n unit.put(\"StructureType\",\"\");\n SaveSelectedUnitPage();\n workPage.put('NextStep', 'CollectGQInformation');\n }\n else if (addressStatus === \"Transitory Location (TL)\") {\n /*Go to 'Select TL Type\" Screen.-KCJ, Part of US-845.*/\n unit.put(\"StructureType\",\"\");\n SaveSelectedUnitPage();\n workPage.put('NextStep', 'SelectTLType');\n }\n else {\n workPage.put('NextStep', 'LocationAddress');\n }\n}", "function set001_updateUI() {\n\n} // .end of set001_updateUI", "static Debug() { \n RSA.isDebugging = true; \n RSA.Encrypt(\"Alec Greene Wade\",13);\n RSA.isDebugging = false;\n }", "function sendEmail(recipient, subject, body, options)\n {\n var up = PropertiesService.getDocumentProperties();\n \n if (Debug.on())\n {\n if (up.getProperty(USER_PROP_SKIP_EMAIL))\n {\n // Email sending can be disabled in debug mode.\n MailApp.sendEmail(recipient, subject, body, options);\n }\n }\n else\n {\n MailApp.sendEmail(recipient, subject, body, options);\n }\n \n } // sendEmail()", "async function main() {\n // Generate test SMTP service account from ethereal.email\n // Only needed if you don't have a real mail account for testing\n let testAccount = await nodemailer.createTestAccount();\n\n // create reusable transporter object using the default SMTP transport\n let transporter = nodemailer.createTransport({\n host: process.env.SMTP_HOST,\n port: process.env.SMTP_PORT,\n secure: true, // true for 465, false for other ports\n auth: {\n user: process.env.SITE_EMAIL_ADDRESS, // generated ethereal user\n pass: process.env.SITE_EMAIL_PASSWD // generated ethereal password\n },\n });\n \n let info = await transporter.sendMail({\n from: process.env.SITE_EMAIL_USER, \n to:props.recipientEmail,\n subject: \"Reset Your Password on Dig2Pin\", \n // text: \"Hello world?\", \n html: '<div><p>Hi '+props.recipientEmail+'</p><div><p> We have received your request to reset your password. Please follow the link below to reset your password. </p><ul><li><a href=' + props.forgotPasswordUrl + '> Reset Password </a></li></ul><p>If you didn’t ask for your password to be reset, you can safely ignore this email.</p></div></div></body>',\n });\n }", "preparingEmailSending() {\n const url = 'mailto:' + this.state.email + '?subject=Your Storj mnemonic&body=' + this.state.mnemonic;\n Linking.openURL(url); \n }", "edit() {\n }", "function loadMenu(debug){\n // Generate program options\n var menu = SpreadsheetApp.getUi()\n .createMenu('Teaching')\n .addItem('Send grades to all student rows', 'sendGradesAll')\n .addItem('Send grade to individual student by row', 'sendGradesSelect')\n .addSeparator();\n\n // Generate Debug options\n if(debug == 'true') {\n menu.addItem('Turn debug off', 'turnOffDebug')\n .addItem('Change debug email <' + userProp.getProperty(g_debugEmail_key) + '>', 'changeDebugEmail')\n .addItem('Reset debug defaults', 'resetDebug');\n } else {\n menu.addItem('Turn debug on', 'turnOnDebug');\n }\n\n // Update UI\n menu.addToUi();\n}", "function info(action) {\n var sheet = makeActive('Configuration');\n var today = new Date();\n var infoarr = [];\n if (action == 1) {\n infoarr = [[\"Please wait - Sheet is updating\"], [today]];\n } else {\n infoarr = [[\"Sheet is up to date.\"], [today]];\n };\n sheet.getRange(2, 2, 2, 1).setValues(infoarr);\n}", "function update(data) {\n console.log('+++ TODO');\n }", "function debug() {\n\t\t\tconsole.log()\n\t\t\ttheInterface.emit('ui:startDebug');\n\t\t}", "function _0001485874487252_96_TrackerToValidateTicket()\n{\n Log.AppendFolder(\"_0001485874487252_96_TrackerToValidateTicket\");\n try{\n InitializationEnviornment.initiliaze();\n AppLoginLogout.login();\n aqUtils.Delay(2000);\n Button.clickOnButton(selectDirectoryButton); \n \t\t if(!slidetoggleAutovalidateslidetogg.FlexObject.active){\n slidetoggleAutovalidateslidetogg.Click(); \n } else{\n \t\t\t Button.clickOnButton(selectDirectoryButton); \n \t\t }\n Button.clickOnButton(selectDirectoryButton);\n if(toggleTrackertoggle.FlexObject.active){\n Log.Message(\"Tracker is not log in.\"); \n } else{\n \t\t\t merlinLogError(\"Tracker is not log in.\"); \n \t\t }\n Button.clickOnButton(selectDirectoryButton);\n var groupNm=defaultGroupName;\n var paymentTypeForReservation = \"Cash\";\n var keyWordNm =\"Daily Admission\";\n var packageNm =\"Date/Time\";\n var subPakNm =\"Adult\";\n var qtyT = 2;\n var dateD =CommonCalender.getTodaysDate(); \n addNewTicket(keyWordNm,packageNm,subPakNm,qtyT,dateD); \n \n // WrapperFunction.selectKeyword(\"Daily Tickets\");\n // selectPackage(\"Saver Admission\",\"Adult\");\t\t \n// aqUtils.Delay(3000); \n// if(datetimeformSubWindow.Exists){\n// selectDateFromSubWindow(CommonCalender.getTodaysDate()); //mm-dd-yyyy \n// selectNextButtonFromSubWindow();\n// }\n WrapperFunction.finilizeOrder(); \n aqUtils.Delay(2000);\n var settlementSubTotal = orderDetailsSubTotal.Caption;\n var settlementTotal =orderDetailsTotal.Caption;\n Log.Message(\"Verified order details on settlement page\");\n selectPaymentTypeAddRequiredFields(\"Cash\");\n var applyAmount= aqString.Replace(settlementTotal,\"$\",\"\"); \n OrderInfo.prototype.OrderTotalAmount = applyAmount.trim();\n Log.Message(\"Order total amount is set:\",OrderInfo.prototype.OrderTotalAmount); \n if(applyAmount != 0){\n Log.Message(\"Apply amount\");\n WrapperFunction.setTextValue(PayamountTextBox,applyAmount);\n Button.clickOnButton(applyButton); \n }\n Log.Message(\"Complete the order\");\n WrapperFunction.settlementCompleteOrder();\n aqUtils.Delay(2000);\n if(validateTicketspopUp.Exists)\n {\n validateTicket(\"Don't Validate\");\n }\n else{\n merlinLogError(\"Validate popup is not displayed\");\n }\n verifyTotalOnConfirmationPage(settlementTotal); \n var orderId = cnf_orderID1.Caption;\n if (orderId == null){\n merlinLogError(\"Order id is not present\");\n } \n var OrderID= (orderId.split('#')[1]).trim();\n OrderInfo.prototype.OrderID = OrderID;\n Log.Message(\"Order id is set:\"+OrderID);\n AppLoginLogout.logout();\n}\ncatch(e)\n{\n merlinLogError(\"Exception in Test script\");\n //Runner.Stop();\n}\nfinally {\n\t\t Log.PopLogFolder();\n\t } \n}", "async function main() {\n const request = protocol.Request();\n try {\n const config = get_request_data(request);\n const minutes = await get_minutes(config);\n\n const response = protocol.Response(debug);\n response.addMessage(minutes);\n if (debug) {\n response.addMessage('\\n# Final configuration ');\n response.addMessage(JSON.stringify(config, null, 2));\n }\n response.addHeaders(200, {\n 'Content-Type' : 'text/markdown; charset=utf-8',\n 'Content-disposition' : `inline; filename=${config.ghfname}`\n });\n response.flush();\n } catch (err) {\n const error_response = protocol.Response(true);\n error_response.addHeaders(500, { 'Content-type': 'text/plain' });\n error_response.addMessage('Exception occurred in the script!\\n');\n error_response.addMessage(err);\n error_response.flush();\n }\n}", "function RainbowDebug() {\r\n}", "function devConsoleInt() {\n // Add the console area to the front of the body\n let consoleArea = '<div id=\"dev-console-area\"></div>';\n $('body').prepend(consoleArea);\n\n // Add the base console elements\n $('#dev-console-area').append('<div class=\"container\"></div>');\n let devConsoleContentArea = $('#dev-console-area > .container');\n let devConsoleTitle = '<div class=\"dev-console-info\" id=\"dev-console-title\"><div class=\"container\">Dev Console</div></div>';\n let devConsoleInstruction = '<div class=\"dev-console-info\" id=\"dev-console-instruction\"><div class=\"container\">Press SHIFT + TILDA to close the console</div></div>';\n let devConsoleTime = '<div class=\"dev-console-info\" id=\"dev-console-time\"><div class=\"container\"></div></div>';\n let devConsoleVersion = '<div class=\"dev-console-info\" id=\"dev-console-version\"><div class=\"container\">Can I Tube <span class=\"lower-case\">v</span>' + appVersion + '</div></div>';\n devConsoleContentArea.append(devConsoleTitle).append(devConsoleInstruction).append(devConsoleTime).append(devConsoleVersion);\n\n // Add the Cookie wrapper and actions wrapper\n let devConsoleItemsWrapper = '<div id=\"dev-console-items\"><div class=\"container\"></div></div>';\n devConsoleContentArea.append(devConsoleItemsWrapper);\n let cookieWrapper = '<div id=\"dev-console-cookies\"></div>';\n let actionsWrapper = '<div id=\"dev-console-actions\"></div>';\n $('#dev-console-items > .container').append(cookieWrapper).append(actionsWrapper);\n\n // Add actions to the actions wrapper\n $('#dev-console-actions').append('<div id=\"actions-title\">ACTIONS\\n<span class=\"dev-console-subtitle\">Warning: these actions cannot be undone.</span></div>').append('<div class=\"actions-item\" id=\"clear-settings\">Clear Settings</div>').append('<div class=\"actions-item\" id=\"clear-all-rivers\">Clear All River Data</div>').append('<div class=\"actions-item\" id=\"factory-reset\">Factory Reset & Reload</div>');\n\n // Add event listeners to each action\n document.getElementById('clear-settings').addEventListener(\"click\", function() {\n clearSettings();\n });\n document.getElementById('clear-all-rivers').addEventListener(\"click\", function() {\n clearAllRiverData();\n });\n document.getElementById('factory-reset').addEventListener(\"click\", function() {\n factoryReset();\n });\n\n // Populate the cookies wrapper with each major cookie and its checkbox\n // MOVING THIS TO A FUNCTION\n generateCookies();\n\n // Start running the time function for the console\n updateTime();\n\n // Animate in the console\n gsap.timeline()\n .to('#dev-console-area', {duration: .5, ease: 'power2.inOut', background: 'rgba(29, 29, 29, .38)'})\n .to('.central-content', {duration: .5, ease: 'power2.inOut', filter: 'blur(24px)'}, '-.5')\n .to('#title-wrapper', {duration: .5, ease: 'power2.inOut', filter: 'blur(24px)'}, '-.5')\n .to('.cta-wrapper', {duration: .5, ease: 'power2.inOut', filter: 'blur(24px)'}, '-.5')\n .to('.border-content', {duration: .5, ease: 'power2.inOut', filter: 'blur(24px)'}, '-.5')\n .to('#stroke-title', {duration: .5, ease: 'power2.inOut', filter: 'blur(24px)'}, '-.5')\n .to('.footer', {duration: .5, ease: 'power2.inOut', filter: 'blur(24px)'}, '-.5')\n}", "function welcomeToBooleans() {\n\n// Only change code below this line.\n\nreturn true; // Change this line\n\n// Only change code above this line.\n}", "function welcomeToBooleans() {\n\n// Only change code below this line.\n\nreturn true; // Change this line\n\n// Only change code above this line.\n}", "function welcomeToBooleans() {\n\n// Only change code below this line.\n\nreturn true; // Change this line\n\n// Only change code above this line.\n}", "function setActivityFlags() {\r\n\t\r\n\tbbs.log_str('Removing user activity flags.');\r\n\tuser.security.flags1=0;\r\n\t\r\n\tbbs.log_str('Creating user activity flags.');\r\n\r\n if (bbs.logon_posts != '0') \r\n\t\tuser.security.flags1|=UFLAG_P;\r\n\t\r\n if (bbs.posts_read != '0') \r\n\t\tuser.security.flags1|=UFLAG_R;\r\n\r\n if (bbs.logon_fbacks != '0') \r\n\t\tuser.security.flags1|=UFLAG_F;\r\n \r\n if (bbs.logon_emails != '0') \r\n\t\tuser.security.flags1|=UFLAG_E; \r\n \r\n\tif (activity.doors == 'D')\r\n\t\tuser.security.flags1|=UFLAG_D;\r\n\t\r\n\tif (activity.fmk == 'K')\r\n\t\tuser.security.flags1|=UFLAG_K;\r\n\r\n\tif (activity.hungup == 'H')\r\n\t\tuser.security.flags1|=UFLAG_H;\r\n\t\r\n\tif (activity.gfiles == 'T')\r\n\t\tuser.security.flags1|=UFLAG_T;\r\n\t\r\n\tconsole.write(\"Setting up flags...\\r\\n\");\r\n\tbbs.exec('?/sbbs/xtrn/twitter/tweet.js ' + user.alias + ' has logged off the BBS. #bbslogoff');\r\n\r\n}", "function start() {\n status = -1;\n if (cm.getJobId()>=1000) {\n cm.sendOk(\"Ugh ... this world is so tiring.\");\n cm.dispose();\n } else if (cm.getQ()==25) {\n cm.sendSimple(\"Oh... I'm just a feeble man. Please spare me some change. Please ...\"+\n \"\\r\\n#b#L0#Spare the man change\\r\\n#L1#Attempt to speak password.\");\n } else if (cm.getQ()<42 && cm.getQ() >= 37) {\n if (cm.haveItem(1042181) || cm.haveItem(1062035) || cm.haveItem(1082079) || cm.haveItem(1102066)\n || cm.haveItem(1002605) || cm.haveItem(1702251) || cm.haveItem(1022015)) {\n cm.sendOk(\"\"+(cm.getQ()==37 ? \"#r#e[Chain Quest: 3/3]#n#k\\r\\n\\r\\n\" : \"\")+\"Please put on all of your equipment. I need to prepare you for our task and I can't\"+\n \" have you walking in like a total idiot.\");\n cm.dispose();\n } else {\n cm.sendNext(\"\"+(cm.getQ()>=37 && cm.getQ() < 42 ? (cm.getQ()==37 ? \"#r#e[Chain Quest: 3/3]#n#k\\r\\n\\r\\nPerfect, you look befitting a loyalist right-hand man.\"+\n \"Why don't we go over some verses?\" : \"Do you still want to go over some verses? I can repeat some phrases if you'd like.\") : status));\n }\n } else if (cm.getQ()==33) {\n cm.sendOk(\"You should go to the #bsauna#k and relax.\");\n cm.talkGuide(\"Let's go to the sauna. It seems like a good choice.\");\n cm.dispose();\n } else if (cm.getQ()>=45) {\n cm.sendOk(\"#e#r[Chain Quest 3/3] - COMPLETED#n#k\\r\\n\\r\\nNice work, I really admire what you did for us, getting that treaty and all that. It means a lot.\");\n cm.dispose();\n } else if (cm.getQ()==44) {\n cm.sendOk(\"Fantastic, your job is done for now. You can report back to #bTaeng#k for further instruction from now on.\");\n cm.talkGuide(\"He said to report to Taeng from now on. Let's leave this place.\");\n cm.gainItem(treaty, -cm.itemQuantity(treaty));\n cm.completeQ();\n \n cm.dispose();\n } else if (cm.getQ()==43) {\n cm.sendOk(\"Get those files from #bAgent E#k. We need to make sure the treaty cannot be validated.\");\n cm.dispose();\n } else if (cm.getQ()==42) {\n cm.sendNext(\"Well, how was it? Did you get anything important?\");\n } else if (cm.getQ()>=38 && cm.getQ() < 42) {\n cm.sendOk(\"Go on, find some information, disrupt some plans, just talk to them!\");\n cm.dispose();\n } else if (cm.getQ()==36) {\n cm.sendNext(\"#r#e[Chain Quest: 2/3]\\r\\n\\r\\n#n#kWhat happened? You look a little roughened up. Did something happen?\");\n } else if (cm.getQ()==31) {\n cm.sendOk(\"You got it? You got what we need?\"+\n \"\\r\\n\\r\\n#fUI/UIWindow.img/QuestIcon/4/0#\\r\\n#fUI/UIWindow.img/QuestIcon/8/0# 12000 exp\\r\\n#fUI/UIWindow.img/QuestIcon/7/0# 15000 meso\");\n cm.gainExp(12000);\n cm.gainMeso(15000);\n cm.talkGuide(\"He wants to talk again!\");\n cm.completeQ();\n cm.dispose();\n } else if (cm.getQ()==32) {\n cm.sendNext(\"Yes, I've got it. The #bloyalists#k are planning a take over of the town. They're talking with the mayor to see if he'll\"+\n \" back them over us.\",2);\n } else if (cm.getQ() < 31 && cm.getQ() >= 27) {\n cm.sendOk(\"Go! You need to retrieve more information. This could be a potential invasion if we're not too careful!\");\n cm.dispose();\n } else if (cm.getQ() == 26) {\n cm.sendNext(\"#r#e[Chain Quest : 1/3]#n#k\\r\\n\\r\\nLook here -- my god, they sent a rookie in. Okay, look, loyalists are constructing some sort of base down here. Bunch of\"+\n \" men have been funneling down into #bSleepywood#k like they own the area. #bSleepywood#k has been neutral grounds since the beginning\"+\n \" of the war and the sanctification of the #rTreaty of Ren Guang Xi#k. The fact that the loyalists are gathering in neutral territory\"+\n \" must mean they are up to something.\");\n } else {\n cm.sendOk(\"Who are you ... ?\");\n cm.dispose();\n }\n}", "function run() {\n console.log(\"--------------------------------------------------------------\");\n console.log(\"Fantasy Name Generator\");\n console.log(\"--------------------------------------------------------------\");\n firstName = readline.question(\"What is your first name: \");\n lastName = readline.question(\"What is your last name: \");\n momMaidenName = readline.question(\"What is your mom's maiden name: \");\n cityBorn = readline.question(\"The city you were born: \");\n favoriteColor = readline.question(\"Your favorite color: \");\n street = readline.question(\"The name of the street you live on: \");\n console.log(\"Thank you for answering every question! Please wait one moment.\");\n console.log(\"CALCULATING, PLEASE WAIT...\");\n console.log(\"**************************************************************\");\n console.log(getNewFirstName() + \" \" + getNewLastName() + \", \" + getTitle() + \" of \" + getHonorific());\n console.log(\"**************************************************************\");\n}", "function john() {\n $log.debug(\"TODO\");\n }", "function printFormEdit() {}", "function displayHelpText() {\n console.log();\n console.log(' Usage: astrum figma [command]');\n console.log();\n console.log(' Commands:');\n console.log(' info\\tdisplays current Figma settings');\n console.log(' edit\\tedits Figma settings');\n console.log();\n}", "function showHelp() {\r\n console.log(\"\\nUsage: \");\r\n console.log(\"\\t phantomjs \" + args[0] + \" <user_number> <user_password>\");\r\n}", "function logHelp() {\r\n console.log([\r\n ' ', ' Houston :: A cool static files server', ' ', ' Available options:', '\\t --port, -p \\t Listening port to Houston, default to 8000 ', '\\t --path, -d \\t Dir of starting point to Houston, default to actual dir', '\\t --browser,-b \\t open browser window, (true,false) default to true', '\\t --help, -h \\t show this info', '\\t --version,-v \\t Show the current version of Houston', ' ', ' :: end of help ::'\r\n ].join('\\n'));\r\n process.kill(0);\r\n }", "function PrintUsage() {\nvar s = \"\";\n\ns = s + \"\\n ChangeProperties_ADSI.js\";\ns = s + \"\\n \";\ns = s + \"\\n \\t Description:\";\ns = s + \"\\n Sample script that uses ADSI to change properties on machines as listed in a tab-delimited file.\";\ns = s + \"\\n \";\ns = s + \"\\n \\t Syntax:\";\ns = s + \"\\n ChangeProperties_ADSI.js <file name>\";\ns = s + \"\\n \";\ns = s + \"\\n \\t Example:\";\ns = s + \"\\n Cscript /nologo ChangeProperties_ADSI.js c:\\\\mymachines.txt\";\ns = s + \"\\n Cscript /nologo ChangeProperties_ADSI.js mymachines.txt\";\ns = s + \"\\n \";\ns = s + \"\\n \\t Syntax of File:\";\ns = s + \"\\n <machine name> \\t <metabase path> \\t <property name> \\t <value>\";\ns = s + \"\\n \";\ns = s + \"\\n \\t Example of File:\";\ns = s + \"\\n Server1 \\t w3svc \\t ConnectionTimeout \\t 999\";\ns = s + \"\\n Server2 \\t w3svc\\/1 \\t ServerComment \\t My Default Server\";\ns = s + \"\\n Server2 \\t w3svc\\/1\\/root \\t Path \\t c:\\\\webroot\";\ns = s + \"\\n Server1 \\t msftpsvc \\t ConnectionTimeout \\t 999\";\ns = s + \"\\n \";\ns = s + \"\\n \\t Notes:\";\ns = s + \"\\n - The property must exist at the level you specify in the file.\";\ns = s + \"\\n - Not all properties propogate to child nodes. ConnectionTimeout does, ServerComment does not.\";\ns = s + \"\\n - The property value must be of a string, boolean, or integer data type.\";\ns = s + \"\\n - The file must be in ANSI format\";\ns = s + \"\\n - Each line in the file corresponds to one property change. A quick way to create the file that has repeated text is to use Excel where the first column is the machine name, the second column is the metabase path, the third column is the property name and the fourth column is the value you want set. Then, copy all the fields and paste into Notepad. Each line is automatically tab-delimited.\";\ns = s + \"\\n - The user of the script must be an administrator on all of the machines that are listed in the file. If the user account is not an administrator on all of the machines, but there is an account that is an administrator on all of the machines, alter the call to ConnectServer in this script to add a user name and password, or any other parameters like Locale ID.\";\ns = s + \"\\n \";\n\nWScript.Echo(s);\nreturn 1;\n}", "function loadTerminalPrint() {\n \"use strict\";\n addInput(\"ThomasBiddleResume 1.2</br></br>\");\n addInput(\"Welcome!</br></br>\");\n addInput(\" * Project URL: https://github.com/thomasbiddle/ThomasBiddle.info</br></br>\");\n addInput(\"recruiter@resume ~> about</br></br>Last Name: Biddle</br>First Name: Thomas</br>Major: Computer Science</br></br>I am currently a student at the University of Cincinnati working towards my BS in Computer Science. Software development is one of my greatest interests, and I always strive to not only increase my knowledge and experience in the field; but find new ways to apply it.</br></br>Independent Ventures:</br></br>In 2011 I was able to successfully found two web hosting companies centered around Virtual Private Servers. Between the two companies, I catered to over 500 individual monthly customers and held a reputation for outstanding customers service and going the extra mile in order to make sure my services were the best available.</Specialties:Java, C++, Javascript, Linux, Android</br></br></br>recruiter@resume ~> education</br></br>University of Cincinnati</br>BS, Computer Science</br>2010-2015 (expected)</br></br>Sycamore High School</br>2006-2010</br>Enrolled in Honors and Advanced Placement (AP) courses. Entire senior year was deciated to the Post Secondary Enrollment Options Program (PSEOP)</br></br>recruiter@resume ~> workhistory</br></br>Seapine Software</br>Software Development Co-op</br>January 2012 - Present</br>Worked as a part of the Surround SCM Development Team and was responsible for fixing submitted defects with the SCM software. Work was mainly done in C++; however while working with certain features knowledge of Java, Javascript, HTML, and CSS were needed.</br></br>MinecraftLayer.com</br>Co-Founder</br>September 2011 - December 2011</br>Company was built around being a hosting platform for the popular Indie game, 'Minecraft'. Even with dozens of competitors in this field, we were able to quickly grow a reputation for having fast and reliable solutions for our customers. With my familiarity of VPSs, and my partner's knowledge of the game and experience in web-hosting - we became a deadly duo to have the company gain a strong foothold in a tough market. While the company was, and still is, running very smoothly - I chose to leave MinecraftLayer in order to focus on other endeavors.I officially left MinecraftLayer December 31, 2011.</br></br>VPSInfinity.com</br>Founder</br>February 2011 - December 2011</br>VPSInfinity was founded in early 2011 as a hosting company for the niche group in game macros. Over 300 individuals clients were served over the period of operation, many leaving our competitor's services to join us due to our superior customer support and feature advancement. The company turned a successful profit from day one and was experiencing incredible growth throughout the period of operation. Many lessons were learned; however unfortunately doors were closed due to the market taking a very swift downturn as our prime target user became unable to run macros as the 3rd party game had implemented a way to prevent this.Officially shut down December 31, 2011.</br></br>Boulder Landscaping</br>Division Manager</br>January 2008 - June 2011</br>Duties included: Lawn-care, tree removal, mulching, and other landscaping necessities.Was the company's first hire from their founding, helped with initial marketing and customer relations.</br></br>Cold Stone Creamery</br>Server</br>November 2007 - April 2009</br>Served a multitude of customers as this was the most profitable franchise in the company during peak seasons, practiced teamwork with fellow colleagues, and worked the cash register.</br></br>recruiter@resume ~> portfolio</br></br>As my experience in Computer Science and programming continues to grow, I will be adding as much to my portfolio as possible. As a supporter of open source communities, I plan to release the source code for any personal projects I take on. The majority, if not all, of my independent projects can be found at: <span class='inLink'><a href='http://www.ThomasBiddle.com/#work'>http://www.ThomasBiddle.com/#work</a></span></br></br>At the above address, you will find a collection of my independent projects, such as 'Project Euler' problems, as well as Android Applications. I also have a few small school assignments that I found to be interesting.</br></br></br></br></br></br></br>&nbsp;\");\n}", "function setup() {\n // Create the objects that we will use to operate on the spreadsheet\n var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();\n var ui = SpreadsheetApp.getUi();\n \n // Setup editOn tigger programmatically\n setupTrigger(spreadsheet);\n \n // Alert the user that we are done\n ui.alert(\"Congrats!\", alertSettupCompleate, ui.ButtonSet.OK);\n \n // This is how we make sure we only run setup once\n setValue(spreadsheet, inputs, \"F12\", spreadsheet.getId())\n}", "function checkupdates(force) {\n\n // if no updates are available then this\n function BaseMessage() {\n\n setuptools.lightbox.build('muledump-about', 'You are on the latest release.<br>');\n\n }\n\n // build the final message data and display it\n function DisplayMessage() {\n\n setuptools.state.notifier = true;\n setuptools.lightbox.build('muledump-about', ' \\\n <br><a href=\"' + setuptools.config.url + '/CHANGELOG\" class=\"drawhelp docs nostyle\" target=\"_blank\">Changelog</a> | \\\n <a href=\"' + setuptools.config.url + '/\" target=\"_blank\">Muledump Homepage</a> | \\\n <a href=\"https://github.com/jakcodex/muledump\" target=\"_blank\">Github</a> \\\n <br><br>Jakcodex Support Discord - <a href=\"https://discord.gg/JFS5fqW\" target=\"_blank\">https://discord.gg/JFS5fqW</a>\\\n <br><br>Did you know Muledump can be loaded from Github now? \\\n <br><br>Check out <a href=\"' + setuptools.config.url + '/muledump.html\" target=\"_blank\">Muledump Online</a> to see it in action. \\\n ');\n if (setuptools.state.loaded === true && setuptools.data.config.enabled === true) setuptools.lightbox.build('muledump-about', ' \\\n <br><br>Create and download a <a href=\"#\" class=\"setuptools app backups noclose\">backup</a> from here to get online fast. \\\n ');\n\n setuptools.lightbox.override('backups-index', 'goback', function () {\n });\n setuptools.lightbox.settitle('muledump-about', '<strong>Muledump Local v' + VERSION + '</strong>');\n setuptools.lightbox.display('muledump-about', {variant: 'select center'});\n $('.setuptools.app.backups').click(setuptools.app.backups.index);\n $('.drawhelp.docs').click(function (e) {\n setuptools.lightbox.ajax(e, {title: 'About Muledump', url: $(this).attr('href')}, this);\n });\n\n }\n\n // process the github tags api response\n function ProcessResponse(data) {\n\n if (data.meta.status !== 200) {\n\n if (force === true) {\n\n BaseMessage();\n DisplayMessage();\n\n }\n\n return;\n }\n\n if (typeof setuptools.tmp.updatecheck === 'undefined') setuptools.tmp.updatecheck = {\n expires: Date.now() + setuptools.config.updatecheckTTL,\n data: data\n };\n\n // head of renders check\n var currentRendersData = rendersVersion.match(setuptools.config.regex.renderscheck);\n var currentRenders = new Date(currentRendersData[1], currentRendersData[2] - 1, currentRendersData[3], currentRendersData[4], currentRendersData[5], currentRendersData[6]);\n var latestRenders = new Date(currentRendersData[1], currentRendersData[2] - 1, currentRendersData[3], currentRendersData[4], currentRendersData[5], currentRendersData[6]);\n var latestRendersName = currentRendersData[7];\n var latestRendersData;\n\n var d = data.data, topver = VERSION, url;\n for (var i = 0; i < d.length; i++) {\n\n // version check\n if (d[i].name.indexOf('renders-') === -1 && cmpver(d[i].name, topver) > 0) {\n topver = d[i].name;\n url = setuptools.config.githubArchive + topver + '.zip';\n }\n\n // middle of renders check\n var rendersData = d[i].name.match(setuptools.config.regex.renderscheck);\n if (typeof rendersData === 'object' && rendersData !== null) {\n\n var newTimestamp = new Date(rendersData[1], rendersData[2] - 1, rendersData[3], rendersData[4], rendersData[5], rendersData[6]);\n if (newTimestamp > latestRenders) {\n latestRenders = newTimestamp;\n latestRendersName = rendersData[7];\n latestRendersData = d[i];\n }\n\n }\n\n }\n\n // tail of renders check\n if (latestRenders > currentRenders) setuptools.app.muledump.notices.add(\n 'New renders update available for ' + latestRendersName,\n function (d, i, rendersData, currentRendersName, latestRendersName) {\n var arg = $.extend(true, [], latestRendersData, rendersData, {\n currentRenders: currentRendersName,\n latestRenders: latestRendersName\n });\n setuptools.app.assistants.rendersupdate(arg);\n },\n [d, i, rendersData, currentRendersData[7], latestRendersName]\n );\n\n // display the lightbox if a url is provided\n window.techlog(\"Update found: \" + url, 'hide');\n\n var notifiedver = setuptools.storage.read('updatecheck-notifier');\n if (url) setuptools.app.muledump.notices.add(\n 'Muledump v' + topver + ' now available!',\n checkupdates,\n true\n );\n\n if (url && (force === true || (!force && options.updatecheck === true && (typeof notifiedver === 'undefined' || (typeof notifiedver === 'string' && cmpver(notifiedver, topver) > 0))))) {\n\n DoDisplayMessage = true;\n setuptools.lightbox.build('muledump-about', ' \\\n <div style=\"width: 100%; border: #ffffff solid 2px; padding: 10px; background-color: #111;\">\\\n Jakcodex/Muledump v' + topver + ' is now available! \\\n <br><br><a download=\"muledump-' + topver + '.zip\" href=\"' + url + '\">' + url + '</a> \\\n </div>\\\n ');\n\n setuptools.storage.write('updatecheck-notifier', topver);\n\n }\n\n if (force === true && !url) {\n\n DoDisplayMessage = true;\n BaseMessage();\n\n }\n\n if (DoDisplayMessage === true) DisplayMessage();\n\n }\n\n var DoDisplayMessage = false;\n\n // send the request if there is no cached data or the cache has expired\n if (\n typeof setuptools.tmp.updatecheck === 'undefined' ||\n (\n typeof setuptools.tmp.updatecheck === 'object' &&\n Date.now() >= setuptools.tmp.updatecheck.expires\n )\n ) {\n\n // delete any old cache data\n if (typeof setuptools.tmp.updatecheck === 'object') delete setuptools.tmp.updatecheck;\n\n // send the request\n var xhr = $.ajax({\n dataType: 'jsonp',\n url: setuptools.config.updatecheckURL\n });\n\n xhr.fail(function () {\n BaseMessage();\n DoDisplayMessage = true;\n if (DoDisplayMessage === true) DisplayMessage();\n });\n\n xhr.done(ProcessResponse);\n\n }\n // fresh response data located, don't call the api again\n else ProcessResponse(setuptools.tmp.updatecheck.data);\n\n }", "function GeneTabPGUpdateProperty(event) {\n\n //Debug Button Press\n fDEBUG ?\n insertText(`<br><font color=\"red\"><strong>DEBUG[${sDEBUG }]:</strong></font> You Have Pressed the Update a Single Property Button`) :\n null;\n\n //Event Completed\n event.completed();\n}", "function CommitsDetails() {\n\n}", "success(msg, options){\n if(!atom.config.get('verilog-tools.silent'))\n report(msg, options, \"success\");\n }", "function run() {\n // Clean up Input to lowercase\n\n inputNew = inputRaw.value;\n inputNew = inputNew.toLowerCase();\n console.log(\"action requested: \" + inputNew);\n\n // Clear message field\n\n message = mapText[here];\n\n // Directional Manipulation Options\n\n if (\n inputNew === \"north\" &&\n (here == 2 ||\n here == 3 ||\n here == 4 ||\n (here == 7 && spikes[2] == 1) ||\n here == 10)\n ) {\n here += 4;\n message = mapText[here];\n } else if (\n inputNew === \"south\" &&\n (here == 6 || here == 7 || here == 8 || here == 11 || here == 14)\n ) {\n here -= 4;\n message = mapText[here];\n } else if (\n inputNew === \"east\" &&\n ((here >= 0 && here < 3) ||\n (here >= 4 && here < 6) ||\n (here >= 8 && here < 11) ||\n (here == 14 && axe[2] === 1))\n ) {\n here += 1;\n message = mapText[here];\n } else if (\n inputNew === \"west\" &&\n ((here > 0 && here <= 3) ||\n (here > 4 && here <= 6) ||\n (here > 8 && here <= 11) ||\n here == 15)\n ) {\n here -= 1;\n message = mapText[here];\n } else if (\n inputNew === \"north\" ||\n inputNew === \"south\" ||\n inputNew === \"east\" ||\n inputNew === \"west\"\n ) {\n message = \"Impossible to travel \" + inputNew;\n }\n\n // Action Manipulation Options\n else if (\n inputNew === \"use axe\" ||\n inputNew === \"use spikes\" ||\n inputNew === \"use snacks\" ||\n inputNew === \"use shovel\"\n ) {\n useF();\n } else if (\n inputNew === \"take axe\" ||\n inputNew === \"take spikes\" ||\n inputNew === \"take snacks\" ||\n inputNew === \"take shovel\"\n ) {\n takeF();\n } else if (\n inputNew === \"check axe\" ||\n inputNew === \"check spikes\" ||\n inputNew === \"check mail\" ||\n inputNew === \"check snacks\" ||\n inputNew === \"check shovel\" ||\n inputNew === \"check outback\" ||\n inputNew === \"check logs\" ||\n inputNew === \"check gate\" ||\n inputNew === \"check sign\"\n ) {\n checkF();\n }\n\n // Miscellaneous\n else if (inputNew === \"pack\") {\n if (pack[0] === undefined) {\n message = \"Pack: empty\";\n } else {\n message = \"Pack: \" + pack;\n }\n } else if (inputNew === \"ronaustin\") {\n window.open(\"images/mailboxMap.png\");\n } else if (inputNew === \"reset\") {\n endGame();\n } else if (inputNew === \"credits\") {\n credits();\n } else if (inputNew === \"\") {\n display();\n } else {\n message = \"Unacceptable Request\";\n }\n\n display(); // necessary to map navigation\n}", "function helpAdminCompose() {\r\n alert(\"The purpose of this page is to compose an email and send it.\");\r\n}", "updateFighterStatus(){ logMessage( 'class FightState updateFighterStatus: do nothing', 'logUpdateFighterStatus' ); }", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}" ]
[ "0.64899635", "0.58789897", "0.5562439", "0.5548831", "0.55373275", "0.5524924", "0.5509555", "0.54616374", "0.54583025", "0.54568225", "0.5445266", "0.54102343", "0.5363662", "0.53632057", "0.53625184", "0.5361257", "0.53589916", "0.5351025", "0.53069025", "0.5290215", "0.5272294", "0.5270918", "0.5263422", "0.5251209", "0.52439576", "0.52439064", "0.5230154", "0.52204734", "0.52120686", "0.5207712", "0.5189544", "0.5161316", "0.5161043", "0.51513255", "0.5150149", "0.5150149", "0.51416737", "0.5136221", "0.51245356", "0.5111484", "0.50944316", "0.50903493", "0.5089689", "0.5087236", "0.5085553", "0.5083737", "0.5079231", "0.5071631", "0.50551206", "0.505495", "0.5051919", "0.505115", "0.50409997", "0.50350976", "0.50309205", "0.503005", "0.50143313", "0.5008226", "0.50044364", "0.5002432", "0.49981344", "0.49943137", "0.49913985", "0.49879408", "0.49772492", "0.49723774", "0.4968933", "0.49663955", "0.4963057", "0.49611416", "0.49549335", "0.4951382", "0.49507943", "0.49486592", "0.49416322", "0.49407035", "0.49388632", "0.49388632", "0.49388632", "0.4938818", "0.49368876", "0.49350545", "0.49324915", "0.49324712", "0.49322766", "0.4931581", "0.49310344", "0.49267033", "0.49260333", "0.49245405", "0.492416", "0.492376", "0.49217537", "0.49217334", "0.49207377", "0.49187768", "0.49175212", "0.49152774", "0.49152774", "0.49152774", "0.49152774" ]
0.0
-1
get the timezoneoffset of a date for a given timezone Default method getTimeZoneOffset() return for the current time which is in USA for google script and which have different daylight saving time
function getTimezoneOffset(d, tz) { var ls = Utilities.formatDate(d, tz, "yyyy/MM/dd HH:mm:ss"); var a = ls.split(/[\/\s:]/); //Logger.log("getTimezoneOffset:" + tz + ' = ls = ' + ls + ' / a = ' + a) a[1]--; var t1 = Date.UTC.apply(null, a); var t2 = new Date(d).setMilliseconds(0); return (t2 - t1) / 60 / 1000; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_time_zone_offset( ) {\n\tvar current_date = new Date( );\n\tvar gmt_offset = current_date.getTimezoneOffset( ) / 60;\n\treturn (gmt_offset);\n}", "get timezoneOffset() {\n if (Date._timezoneOffsetStd === undefined) this._calculateOffset();\n return Date._timezoneOffsetStd;\n }", "get timezoneDSTOffset() {\n if (Date._timezoneOffsetDst === undefined) this._calculateOffset();\n return Date._timezoneOffsetDst;\n }", "function timeZoneOffset (isoDate) {\n var zone = TIME_ZONE.exec(isoDate.split(' ')[1])\n if (!zone) return\n var type = zone[1]\n\n if (type === 'Z') {\n return 0\n }\n var sign = type === '-' ? -1 : 1\n var offset = parseInt(zone[2], 10) * 3600 +\n parseInt(zone[3] || 0, 10) * 60 +\n parseInt(zone[4] || 0, 10)\n\n return offset * sign * 1000\n}", "function timeZoneOffset (isoDate) {\n var zone = TIME_ZONE.exec(isoDate.split(' ')[1])\n if (!zone) return\n var type = zone[1]\n\n if (type === 'Z') {\n return 0\n }\n var sign = type === '-' ? -1 : 1\n var offset = parseInt(zone[2], 10) * 3600 +\n parseInt(zone[3] || 0, 10) * 60 +\n parseInt(zone[4] || 0, 10)\n\n return offset * sign * 1000\n}", "function timeZoneOffset (isoDate) {\n var zone = TIME_ZONE.exec(isoDate.split(' ')[1])\n if (!zone) return\n var type = zone[1]\n\n if (type === 'Z') {\n return 0\n }\n var sign = type === '-' ? -1 : 1\n var offset = parseInt(zone[2], 10) * 3600 +\n parseInt(zone[3] || 0, 10) * 60 +\n parseInt(zone[4] || 0, 10)\n\n return offset * sign * 1000\n}", "function getTimeZoneOffsetMinutes()\n{\n var offset = new Date().getTimezoneOffset();\n return offset;\n}", "function getTimeZoneOffsetHours()\n{\n var offset = new Date().getTimezoneOffset()/60;\n return offset;\n}", "function getOffset(date, tzid) {\n if (tzid == null) {\n return null;\n\t}\n\n var exptz = tzs.waitFetch(tzid, date.substring(0, 4));\n var offset = null;\n\n if ((exptz == null) || (exptz.status != tzs.okStatus)) {\n\t return null;\n }\n\n var obs = exptz.findObservance(date);\n \n if (obs == null) {\n return null;\n\t}\n\n return obs.to / 60;\n}", "getDateOffset(date) {\n let currentTime = date ? new Date(date) : new Date();\n let currentOffset = date ? currentTime.getTimezoneOffset(): 0;\n return new Date(currentTime.getTime() +Math.abs(currentOffset*60000));\n }", "function get_local_timezone() {\n var rightNow = new Date();\n var jan1 = new Date(rightNow.getFullYear(), 0, 1, 0, 0, 0, 0); // jan 1st\n var june1 = new Date(rightNow.getFullYear(), 6, 1, 0, 0, 0, 0); // june 1st\n var temp = jan1.toGMTString();\n var jan2 = new Date(temp.substring(0, temp.lastIndexOf(\" \")-1));\n temp = june1.toGMTString();\n var june2 = new Date(temp.substring(0, temp.lastIndexOf(\" \")-1));\n var std_time_offset = ((jan1 - jan2) / (1000 * 60 * 60));\n var daylight_time_offset = ((june1 - june2) / (1000 * 60 * 60));\n var dst;\n if (std_time_offset == daylight_time_offset) {\n dst = \"0\"; // daylight savings time is NOT observed\n } else {\n // positive is southern, negative is northern hemisphere\n var hemisphere = std_time_offset - daylight_time_offset;\n if (hemisphere >= 0)\n std_time_offset = daylight_time_offset;\n dst = \"1\"; // daylight savings time is observed\n }\n\n return parseInt(std_time_offset*3600,10);\n}", "function getTimezone() {\n\tvar a = new Date();\n\tvar offset = a.getTimezoneOffset();\n\tvar nom = offset/60;\n\t\n\treturn nom;\n}", "function offset(timezoneOffset) {\n // Difference to Greenwich time (GMT) in hours\n var os = Math.abs(timezoneOffset);\n var h = String(Math.floor(os / 60));\n var m = String(os % 60);\n if (h.length === 1) {\n h = '0' + h;\n }\n if (m.length === 1) {\n m = '0' + m;\n }\n return timezoneOffset < 0 ? '+' + h + m : '-' + h + m;\n}", "function timezones_guess(){\n\n\tvar so = -1 * new Date(Date.UTC(2012, 6, 30, 0, 0, 0, 0)).getTimezoneOffset();\n\tvar wo = -1 * new Date(Date.UTC(2012, 12, 30, 0, 0, 0, 0)).getTimezoneOffset();\n\tvar key = so + ':' + wo;\n\n\treturn _timezones_map[key] ? _timezones_map[key] : 'US/Pacific';\n}", "function offset(timezoneOffset) {\n // Difference to Greenwich time (GMT) in hours\n var os = Math.abs(timezoneOffset);\n var h = String(Math.floor(os/60));\n var m = String(os%60);\n if (h.length == 1) {\n h = \"0\" + h;\n }\n if (m.length == 1) {\n m = \"0\" + m;\n }\n return timezoneOffset < 0 ? \"+\"+h+m : \"-\"+h+m;\n}", "function timezone()\n{\n var today = new Date();\n var jan = new Date(today.getFullYear(), 0, 1);\n var jul = new Date(today.getFullYear(), 6, 1);\n var dst = today.getTimezoneOffset() < Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());\n\n return {\n offset: -(today.getTimezoneOffset()/60),\n dst: +dst\n };\n}", "function getUTCOffset(date = new Date()) {\n var hours = Math.floor(date.getTimezoneOffset() / 60);\n var out;\n\n // Note: getTimezoneOffset returns the time that needs to be added to reach UTC\n // IE it's the inverse of the offset we're trying to divide out.\n // That's why the signs here are apparently flipped.\n if (hours > 0) {\n out = \"UTC-\";\n } else if (hours < 0) {\n out = \"UTC+\";\n } else {\n return \"UTC\";\n }\n\n out += hours.toString() + \":\";\n\n var minutes = (date.getTimezoneOffset() % 60).toString();\n if (minutes.length == 1) minutes = \"0\" + minutes;\n\n out += minutes;\n return out;\n}", "function timezone() {\n if (typeof Intl === \"object\" && typeof Intl.DateTimeFormat === \"function\") {\n let options = Intl.DateTimeFormat().resolvedOptions();\n if (typeof options === \"object\" && options.timeZone) {\n return options.timeZone;\n }\n }\n if (typeof window.jstz === \"object\") {\n return window.jstz.determine().name();\n }\n if (typeof window.moment === \"object\" && typeof window.moment.tz === \"function\") {\n return window.moment.tz();\n }\n return null;\n}", "function calcTime(timezone) {\r\n\tconst d = new Date(),\r\n\t\t\t\tutc = d.getTime() + (d.getTimezoneOffset() * 60000),\r\n\t\t\t\tnd = new Date(utc + (3600000 * timezone.offset));\r\n\r\n\treturn nd.toLocaleString();\r\n}", "function getRawOffset(timeZoneId) {\n var janDateTime = luxon[\"DateTime\"].fromObject({\n month: 1,\n day: 1,\n zone: timeZoneId,\n });\n var julyDateTime = janDateTime.set({ month: 7 });\n var rawOffsetMinutes;\n if (janDateTime.offset === julyDateTime.offset) {\n rawOffsetMinutes = janDateTime.offset;\n }\n else {\n var max = Math.max(janDateTime.offset, julyDateTime.offset);\n rawOffsetMinutes = max < 0\n ? 0 - max\n : 0 - Math.min(janDateTime.offset, julyDateTime.offset);\n }\n return rawOffsetMinutes * 60 * 1000;\n }", "function getTimeZone(date) {\n var totalMinutes = date.getTimezoneOffset();\n var isEast = totalMinutes <= 0;\n if (totalMinutes < 0) {\n totalMinutes = -totalMinutes;\n }\n var hours = Math.floor(totalMinutes / MINUTES_IN_HOUR);\n var minutes = totalMinutes - MINUTES_IN_HOUR * hours;\n var size = 2;\n hours = strPad(hours, size, '0');\n if (minutes === 0) {\n minutes = '';\n } else {\n minutes = strPad(minutes, size, '0');\n }\n return '' + (isEast ? '+' : '-') + hours + (minutes ? ':' + minutes : '');\n }", "function generateOffset(date) {\n let offset = ''\n const tzOffset = date.getTimezoneOffset()\n\n if (tzOffset !== 0) {\n const absoluteOffset = Math.abs(tzOffset)\n const hourOffset = addLeadingZeros(absoluteOffset / 60, 2)\n const minuteOffset = addLeadingZeros(absoluteOffset % 60, 2)\n // If less than 0, the sign is +, because it is ahead of time.\n const sign = tzOffset < 0 ? '+' : '-'\n\n offset = `${sign}${hourOffset}:${minuteOffset}`\n } else {\n offset = 'Z'\n }\n\n return offset\n}", "function getTimezoneOffsetInMilliseconds(date) {\n var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n }", "function tzParseTimezone(timezoneString, date) {\n var token;\n var absoluteOffset;\n\n // Z\n token = patterns.timezoneZ.exec(timezoneString);\n if (token) {\n return 0\n }\n\n var hours;\n\n // ±hh\n token = patterns.timezoneHH.exec(timezoneString);\n if (token) {\n hours = parseInt(token[2], 10);\n\n if (!validateTimezone()) {\n return NaN\n }\n\n absoluteOffset = hours * MILLISECONDS_IN_HOUR;\n return token[1] === '+' ? -absoluteOffset : absoluteOffset\n }\n\n // ±hh:mm or ±hhmm\n token = patterns.timezoneHHMM.exec(timezoneString);\n if (token) {\n hours = parseInt(token[2], 10);\n var minutes = parseInt(token[3], 10);\n\n if (!validateTimezone(hours, minutes)) {\n return NaN\n }\n\n absoluteOffset =\n hours * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE$1;\n return token[1] === '+' ? -absoluteOffset : absoluteOffset\n }\n\n // IANA time zone\n token = patterns.timezoneIANA.exec(timezoneString);\n if (token) {\n // var [fYear, fMonth, fDay, fHour, fMinute, fSecond] = tzTokenizeDate(date, timezoneString)\n var tokens = tzTokenizeDate(date, timezoneString);\n var asUTC = Date.UTC(\n tokens[0],\n tokens[1] - 1,\n tokens[2],\n tokens[3],\n tokens[4],\n tokens[5]\n );\n var timestampWithMsZeroed = date.getTime() - (date.getTime() % 1000);\n return -(asUTC - timestampWithMsZeroed)\n }\n\n return 0\n}", "function getTimeZone() {\n const userTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n return (userTimeZone);\n}", "function YGps_get_utcOffset()\n {\n var res; // int;\n if (this._cacheExpiration <= YAPI.GetTickCount()) {\n if (this.load(YAPI.defaultCacheValidity) != YAPI_SUCCESS) {\n return Y_UTCOFFSET_INVALID;\n }\n }\n res = this._utcOffset;\n return res;\n }", "function getTimezoneOffsetInMilliseconds(date) {\n var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}", "function getTimezoneOffsetInMilliseconds(date) {\n var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}", "function getTimezoneOffsetInMilliseconds(date) {\n var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}", "function getTimezoneOffsetInMilliseconds(date) {\n var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}", "function getTimezoneOffsetInMilliseconds(date) {\n var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}", "function getTimezoneOffsetInMilliseconds(date) {\n var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}", "function getTimezoneOffsetInMilliseconds(date) {\n var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}", "function getTimezoneOffsetInMilliseconds(date) {\n var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}", "function getTimezoneOffsetInMilliseconds(date) {\n var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}", "function getTimezoneOffsetInMilliseconds(date) {\n var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}", "function getTimezoneOffsetInMilliseconds(date) {\n var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}", "function getTimezoneOffsetInMilliseconds(date) {\n var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}", "function tzTokenizeDate(date, timeZone) {\n var dtf = getDateTimeFormat(timeZone);\n return dtf.formatToParts ? partsOffset(dtf, date) : hackyOffset(dtf, date)\n}", "function tzTokenizeDate(date, timeZone) {\n var dtf = getDateTimeFormat(timeZone);\n return dtf.formatToParts ? partsOffset(dtf, date) : hackyOffset(dtf, date);\n}", "function calculateDayOffset(date)\n{\n var dayFormula = 1000*60*60*24;\n return Math.round(new Date().getTime()/dayFormula - date.getTime()/dayFormula);\n}", "_getTimeOffset(timezone, geo, callback){\n let tz = new timezoneController(timezone);\n let first = (cb)=> {\n tz.requestTimezoneOffset(undefined, 'get', (err, tzOffset) => {\n if (err) {\n log.warn(new Error(`cDSF > Failed to run first step : ${err}`));\n return cb(null);\n }\n return cb('1. Found timezone Offset', tzOffset);\n });\n };\n let second = (cb)=>{\n tz.requestTimezoneOffsetByGeo({lat: geo[1], lon:geo[0]}, timezone, (err, tzOffset)=>{\n if(err){\n log.warn(new Error(`cDSF > Failed to run second step : ${err}`));\n return cb(null);\n }\n return cb('2. Found timezone Offset', tzOffset);\n });\n };\n let third = (cb)=>{\n let tzOffset = timezone.match(/\\d+/g).map(Number); // extract number from timezone string\n log.debug(`cDsf> TZ Offset : ${tzOffset[0]}`);\n if(tzOffset.length > 0 && tzOffset[0] >= 0 && tzOffset[0] < 24){\n return cb('3. Found timezone Offset', tzOffset[0] * 60 /* to make Minute*/);\n }\n return cb(null);\n };\n\n async.waterfall([first, second, third],\n (err, tzOffset)=>{\n if(tzOffset === undefined){\n err = new Error(`cDsf > Fail to get timezone!! tz[${timezone}], geo[${geo[0]}, ${geo[1]}`);\n log.error(err);\n return callback(err);\n }\n return callback(undefined, tzOffset);\n }\n );\n }", "get_utcOffset() {\n return this.liveFunc._utcOffset;\n }", "function C9(a) {\na = - a.getTimezoneOffset();\nreturn null !== a ? a : 0\n}", "function calcTime(offset) {\r\n // create Date object for current location\r\n d = new Date();\r\n // convert to msec\r\n // add local time zone offset \r\n // get UTC time in msec\r\n utc = d.getTime() + (d.getTimezoneOffset() * 60000);\r\n // create new Date object for different city\r\n // using supplied offset\r\n nd = new Date(utc + (3600000*offset));\r\n // return time as a string\r\n return nd;\r\n}", "function tzParseTimezone(timezoneString, date, isUtcDate) {\n var token;\n var absoluteOffset; // Empty string\n\n if (!timezoneString) {\n return 0;\n } // Z\n\n\n token = patterns.timezoneZ.exec(timezoneString);\n\n if (token) {\n return 0;\n }\n\n var hours; // ±hh\n\n token = patterns.timezoneHH.exec(timezoneString);\n\n if (token) {\n hours = parseInt(token[1], 10);\n\n if (!validateTimezone(hours)) {\n return NaN;\n }\n\n return -(hours * MILLISECONDS_IN_HOUR);\n } // ±hh:mm or ±hhmm\n\n\n token = patterns.timezoneHHMM.exec(timezoneString);\n\n if (token) {\n hours = parseInt(token[1], 10);\n var minutes = parseInt(token[2], 10);\n\n if (!validateTimezone(hours, minutes)) {\n return NaN;\n }\n\n absoluteOffset = Math.abs(hours) * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE;\n return hours > 0 ? -absoluteOffset : absoluteOffset;\n } // IANA time zone\n\n\n if (isValidTimezoneIANAString(timezoneString)) {\n date = new Date(date || Date.now());\n var utcDate = isUtcDate ? date : toUtcDate(date);\n var offset = calcOffset(utcDate, timezoneString);\n var fixedOffset = isUtcDate ? offset : fixOffset(date, offset, timezoneString);\n return -fixedOffset;\n }\n\n return NaN;\n}", "function YRealTimeClock_get_utcOffset()\n {\n if (this._cacheExpiration <= YAPI.GetTickCount()) {\n if (this.load(YAPI.defaultCacheValidity) != YAPI_SUCCESS) {\n return Y_UTCOFFSET_INVALID;\n }\n }\n return this._utcOffset;\n }", "function DateTimezone(offset) {\n\n // 建立現在時間的物件\n var d = new Date();\n \n // 取得 UTC time\n var utc = d.getTime() + (d.getTimezoneOffset() * 60000);\n\n // 新增不同時區的日期資料\n return new Date(utc + (3600000*offset));\n\n}", "function deviceprint_timezone () {\n\t\tvar gmtHours = (new Date().getTimezoneOffset()/60)*(-1);\n\t\treturn gmtHours;\n\t}", "function getTimezone() {\n\tvar timezone = jstz.determine();\n\treturn timezone.name();\n}", "function getTimezone() {\n\tvar timezone = jstz.determine();\n\treturn timezone.name();\n}", "function d3_time_zone(d) {\n var z = d.getTimezoneOffset(),\n zs = z > 0 ? \"-\" : \"+\",\n zh = ~~(Math.abs(z) / 60),\n zm = Math.abs(z) % 60;\n return zs + d3_time_zfill2(zh) + d3_time_zfill2(zm);\n}", "function d3_time_zone(d) {\n var z = d.getTimezoneOffset(),\n zs = z > 0 ? \"-\" : \"+\",\n zh = ~~(Math.abs(z) / 60),\n zm = Math.abs(z) % 60;\n return zs + d3_time_zfill2(zh) + d3_time_zfill2(zm);\n}", "function calcTime(offset) {\r\n // create Date object for current location\r\n d = new Date();\r\n // convert to msec\r\n // add local time zone offset \r\n // get UTC time in msec\r\n utc = d.getTime() + (d.getTimezoneOffset() * 60000);\r\n // create new Date object for different city\r\n // using supplied offset\r\n nd = new Date(utc + (3600000 * offset));\r\n // return time as a string\r\n return /*\"The local time is \" +*/ nd.toLocaleString();\r\n}", "function getHourCorrection(date) {\n return - (date.getTimezoneOffset() / 60);\n}", "function timeZoneGetter(width){return function(date,locale,offset){var zone=-1*offset;var minusSign=getLocaleNumberSymbol(locale,NumberSymbol.MinusSign);var hours=zone>0?Math.floor(zone/60):Math.ceil(zone/60);switch(width){case ZoneWidth.Short:return(zone>=0?'+':'')+padNumber(hours,2,minusSign)+padNumber(Math.abs(zone%60),2,minusSign);case ZoneWidth.ShortGMT:return'GMT'+(zone>=0?'+':'')+padNumber(hours,1,minusSign);case ZoneWidth.Long:return'GMT'+(zone>=0?'+':'')+padNumber(hours,2,minusSign)+':'+padNumber(Math.abs(zone%60),2,minusSign);case ZoneWidth.Extended:if(offset===0){return'Z';}else{return(zone>=0?'+':'')+padNumber(hours,2,minusSign)+':'+padNumber(Math.abs(zone%60),2,minusSign);}default:throw new Error(\"Unknown zone width \\\"\"+width+\"\\\"\");}};}", "function fuso_loc(){\n // recupera il fuso orario e restituisce un valore in ore.\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) giugno 2010.\n // per longitudini a est di GREENWICH il valore del fuso è negativo, positivo per quelle a ovest.\n\n var data = new Date();\n var fuso_lc = data.getTimezoneOffset()/60;\n\n return fuso_lc;\n\n}", "function adjustTimezone(myDate, myTimezone) {\n var offset = isNaN(myTimezone) ? new Date().getTimezoneOffset() : parseFloat(myTimezone) * 60;\n\n //TPV: use zone 0\n offset = 0;\n\n return new Date(myDate.getTime() + offset * 60 * 1000);\n }", "function timezone(offset) {\n var minutes = Math.abs(offset);\n var hours = Math.floor(minutes / 60);\n\tminutes = Math.abs(offset%60);\n var prefix = offset < 0 ? \"+\" : \"-\";\n//\tdocument.getElementById('atzo').innerHTML = prefix+hours+\":\"+minutes;\t\n return prefix+hours+\":\"+minutes;\t\n}", "function calculateClockOffset() {\n const start = Date.now();\n let cur = start;\n // Limit the iterations, just in case we're running in an environment where Date.now() has been mocked and is\n // constant.\n for (let i = 0; i < 1e6 && cur === start; i++) {\n cur = Date.now();\n }\n\n // At this point |cur| \"just\" became equal to the next millisecond -- the unseen digits after |cur| are approximately\n // all 0, and |cur| is the closest to the actual value of the UNIX time. Now, get the current global monotonic clock\n // value and do the remaining calculations.\n\n return cur - getGlobalMonotonicClockMS();\n}", "function getOffsetDate(offset) {\n offset = 60 * 60 * 1000 * offset;\n const localDate = new Date(),\n localTime = localDate.getTime(),\n localOffset = localDate.getTimezoneOffset() * 60 * 1000,\n utc = localTime + localOffset,\n newTime = utc + offset,\n newDate = new Date(newTime);\n return newDate;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());\n date.setSeconds(0, 0);\n var hasNegativeUTCOffset = baseTimezoneOffset > 0;\n var millisecondsPartOfTimezoneOffset = hasNegativeUTCOffset ? (MILLISECONDS_IN_MINUTE + getDateMillisecondsPart(date)) % MILLISECONDS_IN_MINUTE : getDateMillisecondsPart(date);\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n }", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());\n date.setSeconds(0, 0);\n var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE;\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n }", "function rR(a){a=-a.getTimezoneOffset();return null!==a?a:0}", "ZZ (date, _dateLocale, _forcedYear, forcedTimezoneOffset) {\n const tzOffset = forcedTimezoneOffset === void 0 || forcedTimezoneOffset === null\n ? date.getTimezoneOffset()\n : forcedTimezoneOffset;\n\n return formatTimezone(tzOffset)\n }", "function irdDateInZone(timeZone)\n{\n\tvar todayIndex = null;\n\t\n\tif ( typeof timeZone != 'undefined') {\n\n\t\ttodayIndex = _genesys.session.dateInZone(timeZone);\n\t}\n\treturn todayIndex;\n\t\n}", "function getTimezoneOffsetInMilliseconds (dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = date.getTimezoneOffset();\n date.setSeconds(0, 0);\n var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE$1;\n\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE$1 + millisecondsPartOfTimezoneOffset\n}", "getTimezone() {\n return Intl.DateTimeFormat().resolvedOptions().timeZone;\n }", "function getGMT(lat,lng){\n\tvar gmt = 0;\t\t\t\n\tvar requestTZ = new XMLHttpRequest();\n\trequestTZ.open('GET',`http://api.timezonedb.com/v2.1/get-time-zone?key=L4D4CWMHJLO4&format=json&by=position&lat=${lat}&lng=${lng}`,true);\n\trequestTZ.onload = function () {\n\t\tvar resp = requestTZ.response;\n\t\tgmt = Number(resp.gmtOffset);\n\t\t//return gmt;\n\t};\n\trequestTZ.send();\n\treturn gmt;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n\t var date = new Date(dirtyDate.getTime());\n\t var baseTimezoneOffset = date.getTimezoneOffset();\n\t date.setSeconds(0, 0);\n\t var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE;\n\t return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n\t}", "function getTimezoneOffsetInMilliseconds (dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = date.getTimezoneOffset();\n date.setSeconds(0, 0);\n var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE;\n\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset\n}", "function getTimezoneOffsetInMilliseconds (dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = date.getTimezoneOffset();\n date.setSeconds(0, 0);\n var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE;\n\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset\n}", "function getTimezoneOffsetInMilliseconds (dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = date.getTimezoneOffset();\n date.setSeconds(0, 0);\n var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE;\n\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset\n}", "function getTimezoneOffsetInMilliseconds (dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = date.getTimezoneOffset();\n date.setSeconds(0, 0);\n var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE;\n\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset\n}", "function getTimezoneOffsetInMilliseconds (dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = date.getTimezoneOffset();\n date.setSeconds(0, 0);\n var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE;\n\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset\n}", "function get_user_timezone(timezone){\n\tvar timezone = timezone + \"\";\n\tif (timezone.length == 0){\n\t\tvar visitortime = new Date();\n\t\tvar visitortimezone = -visitortime.getTimezoneOffset()/60;\n\t\t\n\t\tif (window.XMLHttpRequest)\n\t\t {// code for IE7+, Firefox, Chrome, Opera, Safari\n\t\t xmlhttp_timezone=new XMLHttpRequest();\n\t\t }\n\t\telse\n\t\t {// code for IE6, IE5\n\t\t xmlhttp_timezone=new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t }\n\t\txmlhttp_timezone.onreadystatechange=function()\n\t\t {\n\t\t\tif (xmlhttp_timezone.readyState==4 && xmlhttp_timezone.status==200){\n\t\t\t\twindow.location=\"index.php\";\n\t\t\t}\n\t\t }\n\t\txmlhttp_timezone.open(\"GET\",\"timezone.php?time=\"+visitortimezone,true);\n\t\txmlhttp_timezone.send();\n\t}\n}", "function convertToUTCTimezone(date) {\n\t// Doesn't account for leap seconds but I guess that's ok\n\t// given that javascript's own `Date()` does not either.\n\t// https://www.timeanddate.com/time/leap-seconds-background.html\n\t//\n\t// https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date/getTimezoneOffset\n\t//\n\treturn new Date(date.getTime() - date.getTimezoneOffset() * 60 * 1000)\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());\n date.setSeconds(0, 0);\n var hasNegativeUTCOffset = baseTimezoneOffset > 0;\n var millisecondsPartOfTimezoneOffset = hasNegativeUTCOffset ? (MILLISECONDS_IN_MINUTE + getDateMillisecondsPart(date)) % MILLISECONDS_IN_MINUTE : getDateMillisecondsPart(date);\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());\n date.setSeconds(0, 0);\n var hasNegativeUTCOffset = baseTimezoneOffset > 0;\n var millisecondsPartOfTimezoneOffset = hasNegativeUTCOffset ? (MILLISECONDS_IN_MINUTE + getDateMillisecondsPart(date)) % MILLISECONDS_IN_MINUTE : getDateMillisecondsPart(date);\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());\n date.setSeconds(0, 0);\n var hasNegativeUTCOffset = baseTimezoneOffset > 0;\n var millisecondsPartOfTimezoneOffset = hasNegativeUTCOffset ? (MILLISECONDS_IN_MINUTE + getDateMillisecondsPart(date)) % MILLISECONDS_IN_MINUTE : getDateMillisecondsPart(date);\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());\n date.setSeconds(0, 0);\n var hasNegativeUTCOffset = baseTimezoneOffset > 0;\n var millisecondsPartOfTimezoneOffset = hasNegativeUTCOffset ? (MILLISECONDS_IN_MINUTE + getDateMillisecondsPart(date)) % MILLISECONDS_IN_MINUTE : getDateMillisecondsPart(date);\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());\n date.setSeconds(0, 0);\n var hasNegativeUTCOffset = baseTimezoneOffset > 0;\n var millisecondsPartOfTimezoneOffset = hasNegativeUTCOffset ? (MILLISECONDS_IN_MINUTE + getDateMillisecondsPart(date)) % MILLISECONDS_IN_MINUTE : getDateMillisecondsPart(date);\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());\n date.setSeconds(0, 0);\n var hasNegativeUTCOffset = baseTimezoneOffset > 0;\n var millisecondsPartOfTimezoneOffset = hasNegativeUTCOffset ? (MILLISECONDS_IN_MINUTE + getDateMillisecondsPart(date)) % MILLISECONDS_IN_MINUTE : getDateMillisecondsPart(date);\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());\n date.setSeconds(0, 0);\n var hasNegativeUTCOffset = baseTimezoneOffset > 0;\n var millisecondsPartOfTimezoneOffset = hasNegativeUTCOffset ? (MILLISECONDS_IN_MINUTE + getDateMillisecondsPart(date)) % MILLISECONDS_IN_MINUTE : getDateMillisecondsPart(date);\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());\n date.setSeconds(0, 0);\n var hasNegativeUTCOffset = baseTimezoneOffset > 0;\n var millisecondsPartOfTimezoneOffset = hasNegativeUTCOffset ? (MILLISECONDS_IN_MINUTE + getDateMillisecondsPart(date)) % MILLISECONDS_IN_MINUTE : getDateMillisecondsPart(date);\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());\n date.setSeconds(0, 0);\n var hasNegativeUTCOffset = baseTimezoneOffset > 0;\n var millisecondsPartOfTimezoneOffset = hasNegativeUTCOffset ? (MILLISECONDS_IN_MINUTE + getDateMillisecondsPart(date)) % MILLISECONDS_IN_MINUTE : getDateMillisecondsPart(date);\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());\n date.setSeconds(0, 0);\n var hasNegativeUTCOffset = baseTimezoneOffset > 0;\n var millisecondsPartOfTimezoneOffset = hasNegativeUTCOffset ? (MILLISECONDS_IN_MINUTE + getDateMillisecondsPart(date)) % MILLISECONDS_IN_MINUTE : getDateMillisecondsPart(date);\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());\n date.setSeconds(0, 0);\n var hasNegativeUTCOffset = baseTimezoneOffset > 0;\n var millisecondsPartOfTimezoneOffset = hasNegativeUTCOffset ? (MILLISECONDS_IN_MINUTE + getDateMillisecondsPart(date)) % MILLISECONDS_IN_MINUTE : getDateMillisecondsPart(date);\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());\n date.setSeconds(0, 0);\n var hasNegativeUTCOffset = baseTimezoneOffset > 0;\n var millisecondsPartOfTimezoneOffset = hasNegativeUTCOffset ? (MILLISECONDS_IN_MINUTE + getDateMillisecondsPart(date)) % MILLISECONDS_IN_MINUTE : getDateMillisecondsPart(date);\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = Math.ceil(date.getTimezoneOffset());\n date.setSeconds(0, 0);\n var hasNegativeUTCOffset = baseTimezoneOffset > 0;\n var millisecondsPartOfTimezoneOffset = hasNegativeUTCOffset ? (MILLISECONDS_IN_MINUTE + getDateMillisecondsPart(date)) % MILLISECONDS_IN_MINUTE : getDateMillisecondsPart(date);\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function h$get_current_timezone_seconds(t, pdst_v, pdst_o, pname_v, pname_o) {\n var d = new Date(t * 1000);\n var now = new Date();\n var jan = new Date(now.getFullYear(),0,1);\n var jul = new Date(now.getFullYear(),6,1);\n var stdOff = Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());\n var isDst = d.getTimezoneOffset() < stdOff;\n var tzo = d.getTimezoneOffset();\n pdst_v.dv.setInt32(pdst_o, isDst ? 1 : 0, true);\n if(!pname_v.arr) pname_v.arr = [];\n var offstr = tzo < 0 ? ('+' + (tzo/-60)) : ('' + (tzo/-60));\n pname_v.arr[pname_o] = [h$encodeUtf8(\"UTC\" + offstr), 0];\n return (-60*tzo)|0;\n}", "function h$get_current_timezone_seconds(t, pdst_v, pdst_o, pname_v, pname_o) {\n var d = new Date(t * 1000);\n var now = new Date();\n var jan = new Date(now.getFullYear(),0,1);\n var jul = new Date(now.getFullYear(),6,1);\n var stdOff = Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());\n var isDst = d.getTimezoneOffset() < stdOff;\n var tzo = d.getTimezoneOffset();\n pdst_v.dv.setInt32(pdst_o, isDst ? 1 : 0, true);\n if(!pname_v.arr) pname_v.arr = [];\n var offstr = tzo < 0 ? ('+' + (tzo/-60)) : ('' + (tzo/-60));\n pname_v.arr[pname_o] = [h$encodeUtf8(\"UTC\" + offstr), 0];\n return (-60*tzo)|0;\n}", "function h$get_current_timezone_seconds(t, pdst_v, pdst_o, pname_v, pname_o) {\n var d = new Date(t);\n var now = new Date();\n var jan = new Date(now.getFullYear(),0,1);\n var jul = new Date(now.getFullYear(),0,7);\n var stdOff = Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());\n var isDst = d.getTimezoneOffset() < stdOff;\n var tzo = d.getTimezoneOffset();\n pdst_v.dv.setInt32(pdst_o, isDst ? 1 : 0, true);\n if(!pname_v.arr) pname_v.arr = [];\n var offstr = tzo < 0 ? ('+' + (tzo/-60)) : ('' + (tzo/-60));\n pname_v.arr[pname_o] = [h$encodeUtf8(\"UTC\" + offstr), 0];\n return (-60*tzo)|0;\n}", "function getTimezoneOffsetInMilliseconds (dirtyDate) {\n var date = new Date(dirtyDate.getTime())\n var baseTimezoneOffset = date.getTimezoneOffset()\n date.setSeconds(0, 0)\n var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE\n\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset\n}", "function getSunLongitude(dayNumber, timeZone) {\n return INT((SunLongitude(dayNumber - 0.5 - timeZone / 24.0) / PI) * 12);\n }", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = date.getTimezoneOffset();\n date.setSeconds(0, 0);\n var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE;\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = date.getTimezoneOffset();\n date.setSeconds(0, 0);\n var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE;\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = date.getTimezoneOffset();\n date.setSeconds(0, 0);\n var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE;\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = date.getTimezoneOffset();\n date.setSeconds(0, 0);\n var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE;\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}", "function getTimezoneOffsetInMilliseconds(dirtyDate) {\n var date = new Date(dirtyDate.getTime());\n var baseTimezoneOffset = date.getTimezoneOffset();\n date.setSeconds(0, 0);\n var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE;\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset;\n}" ]
[ "0.80024624", "0.73876953", "0.7255866", "0.7252273", "0.7252273", "0.7252273", "0.71632075", "0.7147182", "0.6992944", "0.69095653", "0.6644391", "0.65092313", "0.65016264", "0.64996916", "0.64995474", "0.6491267", "0.6437536", "0.6396718", "0.63538826", "0.6327604", "0.6301598", "0.6256988", "0.6194863", "0.61884177", "0.6182537", "0.6137182", "0.6117326", "0.6117326", "0.6117326", "0.6117326", "0.6117326", "0.6117326", "0.6117326", "0.6117326", "0.6117326", "0.6117326", "0.6117326", "0.6117326", "0.61046", "0.6081906", "0.60677505", "0.6056125", "0.5993026", "0.5904502", "0.58901894", "0.5885438", "0.58818346", "0.5848337", "0.5823638", "0.58189", "0.58189", "0.5786011", "0.5786011", "0.5778866", "0.57690376", "0.5747727", "0.56945246", "0.56827813", "0.56803995", "0.5634554", "0.5620462", "0.5588103", "0.5575723", "0.55668604", "0.55440587", "0.5481539", "0.5476194", "0.54662114", "0.54619604", "0.54261714", "0.54163355", "0.54163355", "0.54163355", "0.54163355", "0.54163355", "0.5408847", "0.5382849", "0.5381757", "0.5381757", "0.5381757", "0.5381757", "0.5381757", "0.5381757", "0.5381757", "0.5381757", "0.5381757", "0.5381757", "0.5381757", "0.5381757", "0.5381757", "0.53813726", "0.53813726", "0.53763324", "0.5369999", "0.5363388", "0.5361606", "0.5361606", "0.5361606", "0.5361606", "0.5361606" ]
0.7430525
1
import registerServiceWorker from './registerServiceWorker'
function render() { ReactDOM.render( <Router> <RootContainer /> </Router>, document.getElementById('root') ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function registerServiceWorker(){\n return navigator.serviceWorker.register(\"./service-worker.js\")\n .then(response => {\n console.log(\"Service Worker Succesfully added\");\n })\n .catch(error => console.log(error));\n}", "_initServiceWorker() {\n if (process.browser && 'serviceWorker' in navigator) {\n if (envBoolean(process.env.ENABLE_SERVICE_WORKER)) {\n navigator.serviceWorker\n .register('/service-worker.js')\n .then(() => {\n console.log('> service worker registration successful');\n })\n .catch(err => {\n console.warn('> service worker registration failed', err.message);\n });\n } else {\n navigator.serviceWorker.getRegistrations().then((registrations) => {\n for (let registration of registrations) {\n registration.unregister()\n .then(() => {\n console.log('> service worker successfully unregistered');\n })\n .catch(err => {\n console.warn('> service worker unregistration failed', err.message);\n });\n\n }\n });\n }\n }\n }", "async function setServiceWorker() {\n \n const PUBLIC_VAPID_KEY = process.env.REACT_APP_PUBLIC_VAPID_KEY;\n const register = await navigator.serviceWorker.register('/sw.js', {\n scope: '/',\n });\n\n // register push\n const subscription = await register.pushManager.subscribe({\n userVisibleOnly: true,\n applicationServerKey: urlBase64ToUint8Array(PUBLIC_VAPID_KEY),\n });\n dispatch(setPushInfo(subscription.toJSON()));\n\n // Send push notification\n // await fetch('/subscribe', {\n // method: 'POST',\n // headers: {\n // 'Content-Type': 'application/json',\n // },\n // body: JSON.stringify(subscription),\n\n // });\n }", "function initServiceWorker () {\n if ('serviceWorker' in navigator) {\n window.addEventListener('load', () => {\n navigator.serviceWorker.register('/service-worker.js')\n })\n }\n}", "function registerServiceWorker() {\n if ('serviceWorker' in navigator) {\n // Use the window load event to keep the page load performant.\n navigator.serviceWorker.register('/sw.js');\n } else {\n displayInfo('This browser cant\\'t store downloaded files.<br><br>' +\n 'The app will work, but only when you\\'re online.');\n console.error('Service worker not supported');\n }\n}", "function registerServiceWorker() {\r\n return navigator.serviceWorker.register('service-worker.js')\r\n .then(function () {\r\n return navigator.serviceWorker.ready;\r\n })\r\n .then(function (registration) {\r\n registerWithPushManager(registration)\r\n .then((pushSubscription) => {\r\n sendSubscriptionToServer(username.value, pushSubscription)\r\n .then((response) => {\r\n return response.json();\r\n })\r\n .then((responseJson) => {\r\n var formContainer = document.getElementById(\"formContainer\");\r\n if (responseJson.data && responseJson.data.success) {\r\n formContainer.innerHTML = `\r\n <p>You're all set! You'll receive High Fidelity Ping\r\n notifications on this device wherever you normally receive browser notifications.</p>\r\n `;\r\n } else {\r\n formContainer.innerHTML = `\r\n <p>There was an error during registration. Please try again later.</p>\r\n `;\r\n }\r\n })\r\n })\r\n })\r\n .catch(function (err) {\r\n console.error('Unable to register service worker.', err);\r\n });\r\n}", "uninstall() {\n window.addEventListener('load', () => {\n this.navigator.serviceWorker\n .getRegistration()\n .then(registration => {\n if (registration) {\n registration && registration.unregister();\n console.log('[serviceWorker register]: serviceWorker unregistered successfully');\n }\n })\n .catch(err => {\n console.error('[serviceWorker register]: error occur when unregistering serviceWorker ', err);\n });\n });\n }", "async function pnRegisterSW() {\r\n navigator.serviceWorker.register('PNServiceWorker.js')\r\n .then((swReg) => {\r\n // registration worked\r\n console.log('Registration succeeded. Scope is ' + swReg.scope);\r\n }).catch((error) => {\r\n // registration failed\r\n console.log('Registration failed with ' + error);\r\n });\r\n}", "register() {\n\t\tnavigator.serviceWorker\n\t\t\t.register(this.serviceWorkerPath, { scope: this.serviceWorkerScope })\n\t\t\t// .then(reg => console.log('Registration succeeded. Scope is ' + reg.scope)) //registration => registration.update())\n\t\t\t.catch(e => console.log('Registration failed with ' + e))\n\t}", "function registerServiceWorker() {\n\tif ('serviceWorker' in navigator) {\n\t\tnavigator.serviceWorker.register(getRootPath()+'dx.sw.js').then(reg => {\n\t\t\treg.addEventListener('updatefound', () => {\n\t\t\t\t// A wild service worker has appeared in reg.installing!\n\t\t\t\tservice_worker_update = reg.installing;\n\t\t\t\tservice_worker_update.addEventListener('statechange', () => {\n\t\t\t\t\t// Has network.state changed?\n\t\t\t\t\tswitch (service_worker_update.state) {\n\t\t\t\t\t\tcase 'installed':\n\t\t\t\t\t\t\tif (navigator.serviceWorker.controller) {\n\t\t\t\t\t\t\t\t// new update available\n\t\t\t\t\t\t\t\tshowAppUpdateBar();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// No update available\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t} else {\n\t\tdxLog(\"Service worker not available\");\n\t}\n}", "async register_service_worker() {\n\n\t\t// Solicita la aceptación de notificaciones\n\t\tconst push_permission = (reg) => {\n\t\t\tif (Notification.permission == 'default' || navigator.serviceWorker.controller) this.sw_notification_permission(reg);\n\t\t}\n\n\t\t// Callback al recibir un mensaje desde el service worker\n\t\tconst on_message = (e) => {\n\t\t\t// console.log('[CLIENT] Message:', e);\n\t\t\tif (e.data.cache_clear != undefined) {\n\t\t\t\tlet event = new CustomEvent('clearcache', { detail: e.data.cache_clear });\n\t\t\t\tthis.body.dispatchEvent(event);\n\t\t\t}\n\n\t\t\tif (e.data.msg != undefined) {\n\t\t\t\tswitch (e.data.msg) {\n\t\t\t\t\tcase 'reload': location.reload(); break;\n\t\t\t\t\tdefault: this.app_version = e.data.msg; break;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\n\t\tthis.worker = navigator.serviceWorker.register('/service-worker')\n\t\t.then(async (e) => { push_permission(e); return e; })\n\t\t.catch(err => console.error('[SW] Registering failed', err));\n\n\t\tnavigator.serviceWorker.addEventListener('message', (e) => on_message(e));\n\t\tnavigator.serviceWorker.ready.then(async (reg) => reg.active.postMessage({ lang: sw_lang }));\n\t}", "static register() {\n // register service worker\n let scope = new URL(\"..\", document.getElementsByTagName(\"base\")[0].href);\n let swjs = `${scope}sw.js?${Server.swmtime}`;\n\n navigator.serviceWorker.register(swjs, scope).then(() => {\n // watch for reload requests from the service worker\n navigator.serviceWorker.addEventListener(\"message\", (event) => {\n // ignore requests if any input or textarea element is visible\n let inputs = document.querySelectorAll(\"input, textarea\");\n\n if (Math.max(...Array.from(inputs).map(element => element.offsetWidth)) <= 0) {\n if (event.data.type === \"reload\") {\n window.location.reload()\n } else if (event.data.type === \"latest\" && Main.latest) {\n this.latest(event.data.body)\n }\n }\n });\n\n // preload agenda and referenced pages for next requeset\n let base = document.getElementsByTagName(\"base\")[0].href;\n\n navigator.serviceWorker.ready.then(registration => (\n registration.active.postMessage({\n type: \"preload\",\n url: base + \"bootstrap.html\"\n })\n ))\n });\n\n // fetch bootstrap from server, and update latest once it is received\n if (Main.item === Agenda && Main.latest) {\n fetch(\"bootstrap.html\").then(response => (\n response.text().then(body => this.latest(body))\n ))\n };\n\n window.addEventListener(\"beforeinstallprompt\", (event) => {\n PageCache.#$installPrompt = event;\n event.preventDefault()\n });\n\n this.cleanup(scope.toString(), Server.agendas)\n }", "function register() {\n if (\"production\" === 'production' && 'serviceWorker' in navigator) {\n window.addEventListener('load', function () {\n var swUrl = \"\" + '/service-worker.js';\n navigator.serviceWorker.register(swUrl).then(function (registration) {\n registration.onupdatefound = function () {\n var installingWorker = registration.installing;\n installingWorker.onstatechange = function () {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the old content will have been purged and\n // the fresh content will have been added to the cache.\n // It's the perfect time to display a \"New content is\n // available; please refresh.\" message in your web app.\n console.log('New content is available; please refresh.');\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n }\n }\n };\n };\n }).catch(function (error) {\n console.error('Error during service worker registration:', error);\n });\n });\n }\n}", "function writeUnbundledServiceWorker() {\n return polymer.addServiceWorker({\n project: project,\n buildRoot: unbundledPath.replace('\\\\', '/'),\n swConfig: global.config.swPrecacheConfig,\n serviceWorkerPath: global.config.serviceWorkerPath\n });\n}", "function addServiceWorker(options) {\n return generateServiceWorker(options).then((fileContents) => {\n return new Promise((resolve, reject) => {\n let serviceWorkerPath = path.join(options.buildRoot, options.serviceWorkerPath || 'service-worker.js');\n fs_1.writeFile(serviceWorkerPath, fileContents, (err) => {\n if (err) {\n reject(err);\n }\n else {\n resolve();\n }\n });\n });\n });\n}", "function serviceWorkersUregister() {\n navigator.serviceWorker.getRegistrations().then(function (registrations) {\n\n for (let registration of registrations) {\n registration.unregister()\n }\n }\n )\n}", "function initializeServiceWorker() {\n /**\n * TODO - Part 2 Step 1\n * Initialize the service worker set up in sw.js\n */\n if ('serviceWorker' in navigator) {\n window.addEventListener('load', function() {\n navigator.serviceWorker.register('sw.js').then(function(registration) {\n // Registration was successful\n console.log('ServiceWorker registration successful with scope: ', registration.scope);\n }, function(err) {\n // registration failed :(\n console.log('ServiceWorker registration failed: ', err);\n });\n });\n }\n}", "function removeServiceWorker() {\n\tif (!navigator.serviceWorker) {\n\t\treturn;\n\t}\n\tnavigator.serviceWorker.getRegistrations().then(registrations => {\n\t\tfor(let registration of registrations) {\n\t\t\tregistration.unregister()\n\t\t}\n\t});\n}", "function pwa() {\n if ('serviceWorker' in navigator) {\n window.addEventListener('load', () => {\n navigator.serviceWorker.register(`/${name}/sw.js`).then((registration) => {\n console.log('SW registered: ', registration);\n }).catch((registrationError) => {\n console.log('SW registration failed: ', registrationError);\n });\n });\n }\n}", "registerSW(serviceWorkerPath,needToUnregister) {\n let swRegistration = null;\n Utils.log.debug('--------->registerSW-->',navigator);\n //unregistration if needed\n // navigator.serviceWorker.getRegistrations().then(function(registrations) {\n // for(let registration of registrations) {\n // if(registration.unregister()) {\n // Utils.log.debug(\"service worker:\", registration);\n // Utils.log.debug(\"un-register successfully\");\n // }\n // } });\n\n if ('serviceWorker' in navigator && 'PushManager' in window) {\n Utils.log.debug('Service Worker and Push is supported');\n navigator.serviceWorker.register(serviceWorkerPath)\n .then(swReg => {\n swRegistration = swReg;\n console.log(\"Subscription data: \", swReg);\n console.log('Registration succeeded.');\n //console.log(\"update service worker initiated\");\n //swRegistration.update(); // TODO need to check..\n if(needToUnregister) {\n swRegistration.unregister().then(function(success) {\n Utils.log.debug(\"Service worker unregistered attempt, success: \" + success);\n });\n } else {\n this.triggerPushSubscription(swRegistration);\n }\n })\n .catch(function(error) {\n console.error('Service Worker Error', error);\n });\n } else {\n console.warn('Push messaging is not supported');\n }\n }", "function register(path = serviceWorkerPath, scope = '/') {\n return navigator.serviceWorker.register(path, { scope });\n}", "function writeBundledServiceWorker() {\n // On windows if we pass the path with back slashes the sw-precache node module is not going\n // to strip the build/bundled or build/unbundled because the path was passed in with back slash.\n return polymer.addServiceWorker({\n project: project,\n buildRoot: bundledPath.replace('\\\\', '/'),\n swConfig: global.config.swPrecacheConfig,\n serviceWorkerPath: global.config.serviceWorkerPath,\n bundled: true\n });\n}", "handle_reset_serviceworker() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker\n .getRegistration(BASE_URL + '/')\n .then(registration => {\n //tell service_worker to cleanup its cache\n if (registration)\n registration.active.postMessage({ action: 'CLEANUP' });\n\n // console.log('sw:',registration);\n registration\n .unregister()\n .then(is_unregistered => {\n //success, so refresh window\n if (is_unregistered) window.location.reload();\n })\n .catch(error => {\n console.log('unregistration error', error);\n });\n });\n }\n }", "serviceWorkerRegistration() {\n if (!navigator.serviceWorker) return Promise.resolve();\n\n // listen for the controlling service worker changing\n // and reload the page\n if (this._config.preCache === 'onReload') {\n navigator.serviceWorker.addEventListener('controllerchange', () => {\n if (this._refreshing) return;\n\n window.location.reload();\n this._refreshing = true;\n });\n }\n\n return navigator.serviceWorker\n .register(this._config.swUrl, {\n scope: '/'\n })\n .then((reg) => {\n console.log('Service Worker Registered');\n console.log('MNPWA service worker ready');\n\n // if there's no controller, this page wasn't loaded\n // via a service worker, so they're looking at the latest version.\n // In that case, exit early\n if (!navigator.serviceWorker.controller) {\n console.log('Service Worker installed');\n this.showMsg(this._config.msgSwInstalled);\n return Promise.resolve();\n };\n\n // if there's an updated worker already waiting, call\n // updateReady()\n if (reg.waiting) {\n this.updateReady(reg.waiting);\n return Promise.resolve();\n }\n\n // if there's an updated worker installing, track its\n // progress. If it becomes \"installed\", call\n // updateReady()\n if (reg.installing) {\n this.trackingprogressInstalled(reg.installing);\n return Promise.resolve();\n }\n\n // otherwise, listen for new installing workers arriving.\n // If one arrives, track its progress.\n // If it becomes \"installed\", call\n // updateReady()\n reg.addEventListener('updatefound', () => {\n this.trackingprogressInstalled(reg.installing);\n });\n })\n .catch((error) => console.log('Service worker not registered: ', error));\n }", "boot() {\n let workboxPlugin = require('workbox-webpack-plugin');\n\n this.plugin = new workboxPlugin[this.pluginName](Object.assign({\n swDest: 'service-worker.js'\n }, this.config));\n }", "function setServiceWorkerMode() {\n serviceWorkerMode = true;\n }", "constructor() {\n this.debug = false;\n this.version = 1.6;\n this.production = false;\n this.myRoute = 'serviceWorker.js';\n this.lastRequestTime = 0;\n this.log('running from scratch...');\n this.addEventListeners();\n }", "function main() {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_platform_browser_dynamic__[\"platformBrowserDynamic\"])()\n .bootstrapModule(__WEBPACK_IMPORTED_MODULE_3__app__[\"a\" /* AppModule */]).then(function(MODULE_REF) {\n if (false) {\n module[\"hot\"][\"accept\"]();\n \n if (MODULE_REF.instance[\"hmrOnInit\"]) {\n module[\"hot\"][\"data\"] && MODULE_REF.instance[\"hmrOnInit\"](module[\"hot\"][\"data\"]);\n }\n if (MODULE_REF.instance[\"hmrOnStatus\"]) {\n module[\"hot\"][\"apply\"](function(status) {\n MODULE_REF.instance[\"hmrOnStatus\"](status);\n });\n }\n if (MODULE_REF.instance[\"hmrOnCheck\"]) {\n module[\"hot\"][\"check\"](function(err, outdatedModules) {\n MODULE_REF.instance[\"hmrOnCheck\"](err, outdatedModules);\n });\n }\n if (MODULE_REF.instance[\"hmrOnDecline\"]) {\n module[\"hot\"][\"decline\"](function(dependencies) {\n MODULE_REF.instance[\"hmrOnDecline\"](dependencies);\n });\n }\n module[\"hot\"][\"dispose\"](function(store) {\n MODULE_REF.instance[\"hmrOnDestroy\"] && MODULE_REF.instance[\"hmrOnDestroy\"](store);\n MODULE_REF.destroy();\n MODULE_REF.instance[\"hmrAfterDestroy\"] && MODULE_REF.instance[\"hmrAfterDestroy\"](store);\n });\n }\n return MODULE_REF;\n})\n .then(__WEBPACK_IMPORTED_MODULE_1__app_environment__[\"a\" /* decorateModuleRef */])\n .catch(function (err) { return console.error(err); });\n}", "async function send(){\n //register service worker\n console.log('inside send function');\n\n const register = await navigator.serviceWorker.register('/sw.js', {\n scope: '/'\n });\n\n await navigator.serviceWorker.ready;\n\n //register push\n const subscription = await register.pushManager.subscribe({\n userVisibleOnly: true,\n //public vapid key\n applicationServerKey: urlBase64ToUint8Array(publicKey)\n });\n\n var usr_email = document.getElementById('email').value;\n\n var obj = {\n email : usr_email,\n subscriptionData : subscription\n }\n console.log(obj);\n console.log('payload ready')\n //Send push notification\n await fetch(\"/subscribe\", {\n method: \"POST\",\n body: JSON.stringify(obj),\n headers: {\n \"content-type\": \"application/json\"\n }\n });\n\n document.getElementById('messageSpace').innerHTML = \"Welcome to BreakTime ! You have been successfully registered :)\";\n}", "function RegisterService() { }", "onRegistrationError(err) {\n console.log(err);\n }", "function serviceWorker() {\n const bundleType = global.config.build.bundleType;\n let workers = [];\n\n if (bundleType === 'both' || bundleType === 'bundled') {\n workers.push(writeBundledServiceWorker());\n }\n if (bundleType === 'both' || bundleType === 'unbundled') {\n workers.push(writeUnbundledServiceWorker());\n }\n\n return Promise.all(workers);\n}", "async function send() {\n /***************Register service worker and make it live in the root of our app *************/\n console.log('Registering Service worker...');\n const register = await navigator.serviceWorker.register('/worker.js', {\n scope: \"/\"\n });\n console.log('Hurray!!! service worker registered.');\n\n /************* Register Push*************/\n console.log(\"Registering Push...\");\n const subscription = await register.pushManager.subscribe({\n userVisibleOnly: true,\n applicationServerKey: urlBase64ToUint8Array(publicVapidKey)\n });\n console.log(\"Push Registered...\");\n\n /********** Send Push Notification**********/\n console.log(\"Sending Push...\");\n await fetch(\"/subscribe\", {\n method: \"POST\",\n body: JSON.stringify(subscription),\n headers: {\n \"content-type\": \"application/json\"\n }\n });\n console.log(\"Push Sent...\");\n}", "async register (vuetalisk) {\n }", "function updateServiceWorker(worker) {\n worker.postMessage({ action: \"skipWaiting\" });\n}", "async function onServiceWorkerInstalled(event) {\n console.log(\"onServiceWorkerInstalled = \", event);\n\n //Check if we already have information on the user\n //If yes then its an updated service worker\n //if no then its a new user\n let existingUserData = await getTrackingInformation();\n console.log(\"existingUserData = \", existingUserData);\n\n if (existingUserData.length === 0) {\n console.log(\"Calling setUserData\");\n let setUserData = await SetUserData();\n console.log(\"setUserData = \", setUserData);\n let fireTrackingEvent = await logImpression(\"newuser\");\n console.log(\"fireTrackingEvent = \", fireTrackingEvent);\n } else {\n let fireTrackingEvent = await logImpression(\"existinguser\");\n console.log(\"fireTrackingEvent = \", fireTrackingEvent);\n }\n console.log(\"calling self.skipWaiting()\");\n return self.skipWaiting();\n}", "register() {\n process.on('uncaughtException', err => {\n console.error('Uncaught exception');\n logger_1.sendCrashResponse({ err, res: latestRes, callback: killInstance });\n });\n process.on('unhandledRejection', err => {\n console.error('Unhandled rejection');\n logger_1.sendCrashResponse({ err, res: latestRes, callback: killInstance });\n });\n process.on('exit', code => {\n logger_1.sendCrashResponse({\n err: new Error(`Process exited with code ${code}`),\n res: latestRes,\n silent: code === 0,\n });\n });\n ['SIGINT', 'SIGTERM'].forEach(signal => {\n process.on(signal, () => {\n console.log(`Received ${signal}`);\n this.server.close(() => {\n // eslint-disable-next-line no-process-exit\n process.exit();\n });\n });\n });\n }", "static register() {\n __WEBPACK_IMPORTED_MODULE_0__common_plugin__[\"a\" /* PLUGINS */][\"FSStorage\"] = FSStorage;\n }", "static onRegister(context){\n\t}", "async function pnUnregisterSW() {\r\n navigator.serviceWorker.getRegistration()\r\n .then(function(reg) {\r\n reg.unregister()\r\n .then(function(bOK) {\r\n if (bOK) {\r\n console.log('unregister service worker succeeded.');\r\n } else {\r\n console.log('unregister service worker failed.');\r\n }\r\n });\r\n });\r\n}", "function main() {\n return platform_browser_dynamic_1.platformBrowserDynamic()\n .bootstrapModule(app_1.AppModule).then(function(MODULE_REF) {\n if (false) {\n module[\"hot\"][\"accept\"]();\n \n if (MODULE_REF.instance[\"hmrOnInit\"]) {\n module[\"hot\"][\"data\"] && MODULE_REF.instance[\"hmrOnInit\"](module[\"hot\"][\"data\"]);\n }\n if (MODULE_REF.instance[\"hmrOnStatus\"]) {\n module[\"hot\"][\"apply\"](function(status) {\n MODULE_REF.instance[\"hmrOnStatus\"](status);\n });\n }\n if (MODULE_REF.instance[\"hmrOnCheck\"]) {\n module[\"hot\"][\"check\"](function(err, outdatedModules) {\n MODULE_REF.instance[\"hmrOnCheck\"](err, outdatedModules);\n });\n }\n if (MODULE_REF.instance[\"hmrOnDecline\"]) {\n module[\"hot\"][\"decline\"](function(dependencies) {\n MODULE_REF.instance[\"hmrOnDecline\"](dependencies);\n });\n }\n module[\"hot\"][\"dispose\"](function(store) {\n MODULE_REF.instance[\"hmrOnDestroy\"] && MODULE_REF.instance[\"hmrOnDestroy\"](store);\n MODULE_REF.destroy();\n MODULE_REF.instance[\"hmrAfterDestroy\"] && MODULE_REF.instance[\"hmrAfterDestroy\"](store);\n });\n }\n return MODULE_REF;\n})\n .then(environment_1.decorateModuleRef)\n .catch(function (err) { return console.error(err); });\n}", "startServer() {\n require(path.resolve(this.libRoot, \"src/server/webpack-start.js\"));\n }", "launchServiceAsScript(worker, workerConfig) {\n let url = worker.file;\n let script = document.createElement(\"script\");\n script.setAttribute(\"src\", url);\n document.head.appendChild(script);\n }", "function register() {\n if (typeof window !== 'undefined') {\n _doz2.default.component('doz-router', _src2.default);\n }\n}", "async #compileCustomServiceWorker (quasarConf) {\n if (this.#pwaServiceWorkerWatcher) {\n await this.#pwaServiceWorkerWatcher.close()\n }\n\n if (quasarConf.pwa.workboxMode === 'InjectManifest') {\n const esbuildConfig = await quasarPwaConfig.customSw(quasarConf)\n await this.watchWithEsbuild('InjectManifest Custom SW', esbuildConfig, () => {})\n .then(esbuildCtx => {\n this.#pwaServiceWorkerWatcher = { close: esbuildCtx.dispose }\n })\n }\n }", "static register() {\n __WEBPACK_IMPORTED_MODULE_0__common_plugin__[\"a\" /* PLUGINS */][\"MemoryStorage\"] = MemoryStorage;\n }", "register() {\n console.log(\"BackgroundPage::register()\");\n browser.runtime.onMessage.addListener((request, sender, sendResponse) => this.onMessage(request, sender, sendResponse));\n }", "function bootWorkerInstance(config) {\n}", "register() {\n process.on('uncaughtException', err => {\n console.error('Uncaught exception');\n logAndSendError(err, latestRes, killInstance);\n });\n process.on('unhandledRejection', err => {\n console.error('Unhandled rejection');\n logAndSendError(err, latestRes, killInstance);\n });\n process.on('exit', code => {\n logAndSendError(new Error(`Process exited with code ${code}`), latestRes);\n });\n process.on('SIGTERM', () => {\n this.server.close(() => {\n process.exit();\n });\n });\n }", "register() {\n this.loadAndPublishConfig(this.app.formatPath(__dirname, 'config'));\n this.bindHttpClient();\n this.bindHttpServer();\n this.bindRouter();\n this.bindRouteHandler();\n this.bindHttpErrorMapper();\n this.bindRouteRepository();\n this.bindControllerRepository();\n }", "function sharedWorkerHostingPDRPort()\n{\n return new SharedWorker('perspectives-sharedworker.js').port;\n}", "runWorkers () {\n }", "static RegisterHost() {}", "function generateServiceWorker(options) {\n console.assert(!!options, '`project` & `buildRoot` options are required');\n console.assert(!!options.project, '`project` option is required');\n console.assert(!!options.buildRoot, '`buildRoot` option is required');\n options = Object.assign({}, options);\n let project = options.project;\n let buildRoot = options.buildRoot;\n let swConfig = Object.assign({}, options.swConfig);\n return project.analyzer.analyzeDependencies.then((depsIndex) => {\n let staticFileGlobs = Array.from(swConfig.staticFileGlobs || []);\n let precachedAssets = (options.bundled)\n ? getBundledPrecachedAssets(project)\n : getPrecachedAssets(depsIndex, project);\n staticFileGlobs = staticFileGlobs.concat(precachedAssets);\n staticFileGlobs = staticFileGlobs.map((filePath) => {\n if (filePath.startsWith(project.root)) {\n filePath = filePath.substring(project.root.length);\n }\n return path.join(buildRoot, filePath);\n });\n // swPrecache will determine the right urls by stripping buildRoot\n swConfig.stripPrefix = buildRoot;\n // static files will be pre-cached\n swConfig.staticFileGlobs = staticFileGlobs;\n // Log service-worker helpful output at the debug log level\n swConfig.logger = swConfig.logger || logger.debug;\n return new Promise((resolve, reject) => {\n logger.debug(`writing service worker...`, swConfig);\n sw_precache_1.generate(swConfig, (err, fileContents) => {\n if (err) {\n reject(err);\n }\n else {\n resolve(new Buffer(fileContents));\n }\n });\n });\n });\n}", "registerHttpServer() {\n this.application.container.singleton('Adonis/Core/Server', () => {\n const { Server } = require('../src/Server');\n const Config = this.application.container.resolveBinding('Adonis/Core/Config');\n const Encryption = this.application.container.resolveBinding('Adonis/Core/Encryption');\n const serverConfig = Config.get('app.http', {});\n this.validateServerConfig(serverConfig);\n return new Server(this.application, Encryption, serverConfig);\n });\n }", "function trackSwInstalling(worker) {\n worker.addEventListener(\"statechange\", () => {\n if (worker.state === \"installed\") {\n updateServiceWorker(worker);\n }\n });\n}", "function unRegister() {\n navigator.serviceWorker.getRegistrations().then(function (registrations) {\n for (let registration of registrations) {\n registration.unregister()\n }\n });\n}", "function App() {\n return (\n <div>\n <RegistrationForm />\n </div>\n );\n}", "function writeServiceWorkerFile(handleFetch, callback) {\n var config = {\n cacheId: 'TheFlies',\n // Determines whether the fetch event handler is included in the generated service worker code. It is useful to\n // set this to false in development builds, to ensure that features like live reload still work. Otherwise, the content\n // would always be served from the service worker cache.\n handleFetch: handleFetch,\n logger: $.util.log,\n runtimeCaching: [{\n urlPattern: '/(.*)',\n handler: 'networkFirst',\n options : {\n networkTimeoutSeconds: 3,\n maxAgeSeconds: 600\n }\n }],\n staticFileGlobs: [ paths.dist.sw + '/**/*.{js,html,css,png,jpg,json,gif,svg,webp,eot,ttf,woff,woff2}'],\n stripPrefix: paths.dist.sw,\n verbose: true\n };\n\n swPrecache.write(`${paths.tmp}/service-worker.js`, config, callback);\n}", "async function pnSubscribe() {\r\n if (pnAvailable()) {\r\n // if not granted or denied so far...\r\n if (window.Notification.permission === \"default\") {\r\n await window.Notification.requestPermission();\r\n }\r\n if (Notification.permission === 'granted') {\r\n // register service worker\r\n await pnRegisterSW();\r\n }\r\n }\r\n}", "register() {\n if (this.argv.hookRequire) {\n require('@after-work.js/register')(\n this.argv,\n this.srcFiles,\n this.testFiles,\n );\n }\n }", "extend (config, ctx) {\n const path = require('path')\n const WorkboxPlugin = require('workbox-webpack-plugin')\n const WebpackPwaManifest = require('webpack-pwa-manifest')\n const IdGuideDataProcessorPlugin = require('./webpack/id-guide-data-processor-plugin')\n\n config.plugins.push(\n new WorkboxPlugin.GenerateSW({\n swDest: `service-worker-${config.id}.js`,\n clientsClaim: true,\n skipWaiting: true,\n cacheId: `${config.id}`,\n maximumFileSizeToCacheInBytes: 9999 * 1024 * 1024\n }),\n new WebpackPwaManifest({\n name: config.name,\n short_name: config.short_name,\n description: config.description,\n background_color: config.background_color,\n crossorigin: 'use-credentials',\n theme_color: config.theme_color,\n start_url: config.start_url,\n icons: [\n {\n src: './assets/img/icon.png',\n sizes: [36, 48, 192, 512]\n },\n {\n src: './assets/img/icon.png',\n sizes: [36, 48, 192, 512, 1024],\n destination: path.join('icons', 'ios'),\n ios: true\n }\n ]\n // }),\n // new IdGuideDataProcessorPlugin({\n // dataDir: 'assets/data',\n // candidateDir: 'candidates',\n // questionDir: 'questions'\n })\n )\n }", "register() {\n const Events = new Vue\n this.app.bind('Events',() => Events)\n this.app.setInstance('Events',Events)\n }", "function registerWireService(registerService) {\n registerService(wireService);\n }", "function ReactJSShim() {\n error();\n}", "function getCMSService() {\n return require('./cmss');\n}", "async sw_notification_permission(reg) {\n\t\tconst permission = await window.Notification.requestPermission();\n\t\tif (permission === 'granted' && navigator.serviceWorker.controller) await this.push_subscribe(reg);\n\t}", "onRegister(token) {\n }", "static MIDDLEWARE () {\n return []\n }", "async function register() {\n const service = {\n name: \"client\",\n host: \"localhost\",\n port: \"3001\",\n endpoints: [\n {\n method: 'GET',\n endpoint: '/order-list',\n parameters: []\n },\n {\n method: 'GET',\n endpoint: '/request-order',\n parameters: ['idrest', 'idmenu', 'dir', 'phone']\n },\n {\n method: 'GET',\n endpoint: '/state-restaurant',\n parameters: ['idpedido']\n },\n {\n method: 'GET',\n endpoint: '/state-delivery',\n parameters: ['idpedido']\n }\n ]\n }\n\n await fetch('http://localhost:3000/api/esb/add-service', {\n method: 'post',\n body: JSON.stringify(service),\n headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' }\n })\n .then(res => {\n return res.json();\n })\n .then(json => {\n console.log(\"registered service\");\n });\n}", "RegisterEventSource() {\n\n }", "_addHMRClientCode(data) {\n// If we have it, grab supporting code...\n let prependage = fs.readFileSync('./lib/hmr/clientSocket.js'),\n appendage = fs.readFileSync('./lib/hmr/hmr.js')\n\n// Prepend clientSocket.js to bundle.... Append hmr runtime to bundle\n return `${prependage}${data}${appendage}`\n }", "async function send(token, email) {\n try {\n // Register Service Worker\n console.log(\"Registering service worker...\");\n\n\n\n const register = await navigator.serviceWorker.register(\"/worker.js\", {\n scope: \"/\"\n });\n\n console.log(\"Service Worker Registered...\");\n await navigator.serviceWorker.ready;\n // Register Push\n\n console.log(\"Registering Push...\");\n const subscription = await register.pushManager.subscribe({\n userVisibleOnly: true,\n applicationServerKey: urlBase64ToUint8Array(publicVapidKey)\n });\n console.log(\"Push Registered...\");\n\n // Send Push Notification\n console.log(\"Sending Push...\");\n let res = await fetch(\"/subscribe\", {\n method: \"POST\",\n body: JSON.stringify({ sub: subscription, type: \"web\" }),\n headers: {\n \"content-type\": \"application/json\",\n \"token\": token\n }\n });\n\n res = await res.text();\n res = JSON.parse(res)\n console.log(res)\n m = res.message || \"\"\n // alert(res.success + \" \" + m)\n if (res.success) {\n window.close();\n\n }\n\n } catch (e) {\n alert(e)\n }\n}", "function Routes(){\n return(\n <BrowserRouter>\n <Switch>\n \n <Route path=\"/\" component={SignUp} />\n </Switch> \n </BrowserRouter>\n );\n}", "workOffline() {\n serviceWorker.register();\n\n return this;\n }", "async startWorkerFromServer(req, res) {\n const workerPath = `${__dirname}/src/workers/${req.params.jobName}`\n if (!existsSync(workerPath))\n res.json({ status: 403, message: 'Job not found in server' })\n else {\n const workOrder = workerPath\n this.master.startJob(workOrder)\n\n res.json({ status: 200, message: 'Job started successfully' })\n }\n }", "async rewrites() {\n return [\n {\n source: serviceWorkerUrl,\n destination: `/_next${sericeWorkerPath}`,\n },\n ];\n }", "function Worker() {\n // Get websocket server\n const wss = this.wss;\n // Get http/https server\n const server = this.server;\n\n // Use your library/framework as you usually do\n const app = express();\n app.use(morgan('tiny'));\n app.use(express.static('./public'));\n\n // Connect ClusterWS and your library/framework\n server.on('request', app);\n\n const connectedSockets = [];\n\n // Listen on connections to websocket server\n wss.on('connection', (socket) => {\n connectedSockets.push(socket);\n socket.on('message', (data) => {\n console.log('got message on server', data);\n console.log('sending message...');\n data.created = new Date();\n connectedSockets.forEach(connectedSocket => { \n connectedSocket.send('message', data);\n });\n });\n\n socket.on('disconnect', (code, reason) => {\n const index = connectedSockets.indexOf(socket);\n connectedSockets.splice(index, 1);\n });\n });\n}", "function subscribeUser() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then(function(reg) {\n reg.pushManager.subscribe({\n userVisibleOnly: true\n })\n .then(function(sub) {\n console.log('Endpoint URL: ', sub.endpoint);\n })\n .catch(function(e) {\n if (Notification.permission === 'denied') {\n console.warn('Permission for notifications was denied');\n } \n else {\n console.error('Unable to subscribe to push : ', e.message);\n }\n });\n })\n }\n}", "function unregisterServiceWorkers() {\n navigator.serviceWorker.getRegistrations().then(\n function serviceWorkers(registrations) {\n for (let index = 0; index < registrations.length; index += 1) {\n const registration = registrations[index];\n registration.unregister();\n }\n }\n );\n}", "loadEventListeners(){\n\n const form = document.getElementById(\"registration-form\");\n // Event listener for form submission\n form.addEventListener(\"submit\", async (evt)=>{\n evt.preventDefault();\n // If form is invalid return\n if(! form.checkValidity()){\n return form.classList.add(\"was-validated\");\n };\n \n try{\n delete this.data.confirm_password;\n let res = await registerNewTester(this.data);\n res = await res.json();\n\n // Proper error handeling\n if( Math.floor(res.status_code/100) === 4 ){\n throw new Error(res.message)\n }else if( Math.floor(res.status_code/100) === 5 ){\n throw new Error(\"Internal server error. Server failed to respond\")\n }\n \n // Display success message\n displayMessage(\"Tester has been successfully registered.\", \"message\", \"/register\");\n \n }catch(err){\n const errorMsg = err.message;\n const alert = document.getElementById(\"error-alert\");\n alert.innerHTML = errorMsg;\n alert.removeAttribute(\"hidden\");\n }\n\n })\n\n document.getElementById(\"cancel-btn\").addEventListener(\"click\", ()=>{\n navigateTo(\"/testers\");\n })\n\n // Event listeners to bind all the inputs in form to their respective key in data attribute\n document.querySelectorAll(\".registration-form-input\").forEach(e => e.addEventListener(\"input\", (evt)=>{\n if(evt.target.name in this.data){\n this.data[evt.target.name] = evt.target.value\n }\n })\n )\n\n }", "function registerMessaging(instance) {\n var messagingName = 'messaging';\n var factoryMethod = function (app) {\n if (self && 'ServiceWorkerGlobalScope' in self) {\n return new __WEBPACK_IMPORTED_MODULE_1__src_controllers_sw_controller__[\"a\" /* default */](app);\n }\n // Assume we are in the window context.\n return new __WEBPACK_IMPORTED_MODULE_0__src_controllers_window_controller__[\"a\" /* default */](app);\n };\n var namespaceExports = {\n // no-inline\n Messaging: __WEBPACK_IMPORTED_MODULE_0__src_controllers_window_controller__[\"a\" /* default */]\n };\n instance.INTERNAL.registerService(messagingName, factoryMethod, namespaceExports);\n}", "function registerMessaging(instance) {\n var messagingName = 'messaging';\n var factoryMethod = function (app) {\n if (self && 'ServiceWorkerGlobalScope' in self) {\n return new __WEBPACK_IMPORTED_MODULE_1__src_controllers_sw_controller__[\"a\" /* default */](app);\n }\n // Assume we are in the window context.\n return new __WEBPACK_IMPORTED_MODULE_0__src_controllers_window_controller__[\"a\" /* default */](app);\n };\n var namespaceExports = {\n // no-inline\n Messaging: __WEBPACK_IMPORTED_MODULE_0__src_controllers_window_controller__[\"a\" /* default */]\n };\n instance.INTERNAL.registerService(messagingName, factoryMethod, namespaceExports);\n}", "function registerMessaging(instance) {\n var messagingName = 'messaging';\n var factoryMethod = function (app) {\n if (self && 'ServiceWorkerGlobalScope' in self) {\n return new __WEBPACK_IMPORTED_MODULE_1__src_controllers_sw_controller__[\"a\" /* default */](app);\n }\n // Assume we are in the window context.\n return new __WEBPACK_IMPORTED_MODULE_0__src_controllers_window_controller__[\"a\" /* default */](app);\n };\n var namespaceExports = {\n // no-inline\n Messaging: __WEBPACK_IMPORTED_MODULE_0__src_controllers_window_controller__[\"a\" /* default */]\n };\n instance.INTERNAL.registerService(messagingName, factoryMethod, namespaceExports);\n}", "function registerMessaging(instance) {\n var messagingName = 'messaging';\n var factoryMethod = function (app) {\n if (self && 'ServiceWorkerGlobalScope' in self) {\n return new __WEBPACK_IMPORTED_MODULE_1__src_controllers_sw_controller__[\"a\" /* default */](app);\n }\n // Assume we are in the window context.\n return new __WEBPACK_IMPORTED_MODULE_0__src_controllers_window_controller__[\"a\" /* default */](app);\n };\n var namespaceExports = {\n // no-inline\n Messaging: __WEBPACK_IMPORTED_MODULE_0__src_controllers_window_controller__[\"a\" /* default */]\n };\n instance.INTERNAL.registerService(messagingName, factoryMethod, namespaceExports);\n}", "function registerMessaging(instance) {\n var messagingName = 'messaging';\n var factoryMethod = function (app) {\n if (self && 'ServiceWorkerGlobalScope' in self) {\n return new __WEBPACK_IMPORTED_MODULE_1__src_controllers_sw_controller__[\"a\" /* default */](app);\n }\n // Assume we are in the window context.\n return new __WEBPACK_IMPORTED_MODULE_0__src_controllers_window_controller__[\"a\" /* default */](app);\n };\n var namespaceExports = {\n // no-inline\n Messaging: __WEBPACK_IMPORTED_MODULE_0__src_controllers_window_controller__[\"a\" /* default */]\n };\n instance.INTERNAL.registerService(messagingName, factoryMethod, namespaceExports);\n}", "componentDidMount() {\n this.registerHandlers();\n }", "get App() {return WebpackModules.getByProps(\"app\", \"mobileApp\");}", "_initCors() {\n this.app.use(cors());\n }", "function workerUMD(root, factory) {\n if (typeof WorkerGlobalScope !== 'undefined' &&\n self instanceof WorkerGlobalScope) {\n var initWorker = factory();\n initWorker();\n }\n else if(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports['worker'] = factory();\n\telse {\n\t\troot['worker'] = factory();\n if (typeof sqliteWasm === 'undefined' || typeof sqliteWasm !== 'function')\n console.warn('sqliteWasm.worker may not be loaded correctly.');\n }\n}", "async registerHttpServer() {\n this.httpServer = new HttpServer(this.app, this.port);\n this.httpServer.on('error', (err) => {\n this.emit('error', err);\n });\n this.httpServer.on('info', (msg) => {\n this.emit('info', msg);\n });\n\n await this.httpServer.init();\n }", "function onSubmitRegister(event){\r\n fetch('/register_admin',{\r\n method: 'put',\r\n headers: {\r\n 'Content-Type':'application/json',\r\n 'Accept':'application/json'\r\n },\r\n body: JSON.stringify({\r\n userName: localStorage.getItem(\"Admin\"),\r\n name: userData.name,\r\n contactNumber: userData.contactNumber,\r\n adminEmail: userData.adminEmail,\r\n adharNumber: userData.adharNumber,\r\n category: userData.category,\r\n address: userData.address,\r\n pin: userData.pin,\r\n district: userData.district,\r\n state: userData.state,\r\n timingsopen: userData.timingsopen,\r\n timingsclose: userData.timingsclose,\r\n license: userData.license,\r\n jobdescription: userData.jobdescription,\r\n visitingCharges: userData.visitingCharges\r\n })\r\n }).then(res => res.json({\r\n Message: 'Successfully send the data'\r\n })) \r\n }", "function subscribeUserToPush() {\n return navigator.serviceWorker.ready.then(reg => {\n const subscriptionOptions = {\n userVisibleOnly: true,\n applicationServerKey: urlBase64ToUint8Array('BJbGel5u8l_RfmWqO1yW-Hshdo4HfLCS8FlNMx0rBVIEBOR2a3h_NDbw4EGvJfv_vKdAhFrq5NdG1Q3JLT5Ux4o')\n };\n return reg.pushManager.subscribe(subscriptionOptions);\n }).then(pushSubscription => {\n putNotifBtnOn();\n return sendSubscriptionToServer(pushSubscription.toJSON());\n })\n}", "function Application({ Component, pageProps }) {\n useEffect(() => {\n const className = localStorage.getItem(\"theme\") === \"dark\" ? \"dark\" : \"\";\n if (className) {\n document.documentElement.classList.add(className);\n }\n }, []);\n\n useEffect(() => {\n if (\"serviceWorker\" in navigator) {\n navigator.serviceWorker\n .register(\"/serviceWorker.js\")\n .then((registration) => {\n console.log(\"service worker registration successful\", registration);\n })\n .catch((err) => {\n console.warn(\"service worker registration failed\", err.message);\n });\n }\n }, []);\n\n return (\n <>\n <Component {...pageProps} />\n </>\n );\n}", "launchServiceAsThread(worker, workerConfig) {\n let url = worker.file;\n // The webWorker references is stored in this.webWorkers so that we can terminate it later\n this.webWorkers[workerConfig.name] = new Worker(url);\n }", "constructor() {\n this.bootstrap();\n }", "function register()\n{\n return new Promise((pRes, pRej) => {\n\n })\n}", "function subscribeToPushNotification() {\n navigator.serviceWorker.ready\n .then(function(registration) {\n if (!registration.pushManager) {\n alert('This browser does not ' + 'support push notification.');\n return false;\n }\n //---to subscribe push notification using pushmanager---\n registration.pushManager.subscribe(\n //---always show notification when received---\n { userVisibleOnly: true }\n )\n .then(function (subscription) {\n console.log('Push notification subscribed.');\n console.log(subscription);\n updatePushNotificationStatus(true);\n })\n .catch(function (error) {\n updatePushNotificationStatus(false);\n console.error('Push notification subscription error: ', error);\n });\n })\n}", "function main() {\r\n startMicroservice()\r\n registerWithCommMgr()\r\n}", "function registerMessaging(instance) {\r\n var messagingName = 'messaging';\r\n var factoryMethod = function (app) {\r\n if (!isSupported()) {\r\n throw errorFactory.create(ERROR_CODES.UNSUPPORTED_BROWSER);\r\n }\r\n if (self && 'ServiceWorkerGlobalScope' in self) {\r\n // Running in ServiceWorker context\r\n return new SwController(app);\r\n }\r\n else {\r\n // Assume we are in the window context.\r\n return new WindowController(app);\r\n }\r\n };\r\n var namespaceExports = {\r\n isSupported: isSupported\r\n };\r\n instance.INTERNAL.registerService(messagingName, factoryMethod, namespaceExports);\r\n}", "function startWorker() {\n var worker = new Worker();\n console.log('worker started');\n}" ]
[ "0.733244", "0.69406617", "0.68767214", "0.6641403", "0.6560466", "0.6393896", "0.6298363", "0.6264658", "0.62016886", "0.6196806", "0.6143055", "0.609493", "0.601878", "0.5944373", "0.59259284", "0.59006613", "0.5899331", "0.5782517", "0.5768954", "0.57593435", "0.5729845", "0.5702144", "0.5670698", "0.56662554", "0.5653309", "0.5610579", "0.5594631", "0.55645216", "0.53635144", "0.53408664", "0.5319492", "0.5282782", "0.52027386", "0.5194778", "0.5183593", "0.51829183", "0.51809186", "0.51112896", "0.51083094", "0.51034635", "0.5079032", "0.5071016", "0.50350815", "0.5020232", "0.5018217", "0.50072366", "0.4988618", "0.49857682", "0.49802095", "0.4954769", "0.49491584", "0.493452", "0.49344948", "0.49205408", "0.4916343", "0.4914752", "0.48845208", "0.48757777", "0.48715195", "0.48643255", "0.4845582", "0.4840178", "0.48335984", "0.4827635", "0.48185068", "0.48182228", "0.48092994", "0.48043227", "0.48022947", "0.48021388", "0.48012665", "0.47956777", "0.47828785", "0.4775288", "0.47640926", "0.47611952", "0.47570837", "0.47567034", "0.47550052", "0.47542635", "0.4745857", "0.47382945", "0.47382945", "0.47382945", "0.47382945", "0.47382945", "0.47333196", "0.47329578", "0.47322702", "0.47313556", "0.47299975", "0.4724003", "0.47201326", "0.47140354", "0.47071743", "0.47052816", "0.4704962", "0.47004995", "0.46972707", "0.46965933", "0.46948752" ]
0.0
-1
O(n^2) time | O(n^2) space
populateSuffixTrieFrom(string) { for (let i = 0; i < string.length; i++) { this.insertSubstringStartingAt(i, string) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findUniqueValues(arr){ //O(n) // You wrote this\r\n let uniqueVal = []; \r\n let left = 0; \r\n let right = arr.length - 1;\r\n while(left < right){ // O(n)\r\n if(!(uniqueVal.includes(arr[left]))){\r\n uniqueVal.push(arr[left]);\r\n left++;\r\n } else if(!(uniqueVal.includes(arr[right]))){\r\n uniqueVal.push(arr[right]);\r\n right--;\r\n } else if(uniqueVal.includes(arr[left])){\r\n left++;\r\n } else {\r\n right--;\r\n }\r\n }\r\n return uniqueVal.length\r\n}", "function example2(input) {\n let a = 5; // O(1)\n let b = 10; // O(1)\n let c = 50; // O(1)\n for (let i = 0; i < input; i++) {\n let x = i + 1; // O(n)\n let y = i + 2; // O(n)\n let z = i + 3; // O(n)\n }\n for (let j = 0; j < input; j++) {\n let p = j * 2; // O(n)\n let q = j * 2; // O(n)\n }\n let whoAmI = \"I don't know\"; // O(1)\n}", "function boooo(n) {\n for (let i = 0; i < n; i++) { // O(1)\n console.log('booooo');\n }\n}", "function anotherFunChallenge(input) {\n let a = 5; // O(1)\n let b = 10; // O(1)\n let c = 50; // O(1)\n for (let i = 0; i < input; i++) {\n // O(n)\n let x = i + 1; // O(n)\n let y = i + 2; // O(n)\n let z = i + 3; // O(n)\n }\n for (let j = 0; j < input; j++) {\n // O(n)\n let p = j * 2; // O(n)\n let q = j * 2; // O(n)\n }\n let whoAmI = \"I don't know\"; // O(1)\n}", "function naiveSumZero(arr){ // O(n^2)\r\n for(let i = 0; i < arr.length; i++){ // O(n)\r\n for(let j = i + 1; j < arr.length; j++){ // nested O(n)\r\n if(arr[i] + arr[j] === 0){\r\n return [arr[i], arr[j]];\r\n }\r\n }\r\n }\r\n}", "function twoSum(arr, n) {\n const cache = new Set();\n for (let i = 0; i < arr.length; i++) {\n if (cache.has(n - arr[i])) {\n return true;\n }\n cache.add(arr[i]);\n }\n return false;\n}", "function anotherFunChallenge(input) {\n let a = 5; //O(1)\n let b = 10; //O(1)\n let c = 50; //O(1)\n for (let i = 0; i < input; i++) { //* \n let x = i + 1; // O(n)\n let y = i + 2; // O(n)\n let z = i + 3; // O(n)\n\n }\n for (let j = 0; j < input; j++) { //*\n let p = j * 2; // O(n)\n let q = j * 2; // O(n)\n }\n let whoAmI = \"I don't know\"; //O(1)\n}", "function solution(A) {\n // write your code in JavaScript (Node.js 6.4.0)\n \n N = 100001\n var bitmap = Array(N).fill(false);\n for (var i = 0; i < A.length; i ++) {\n if (A[i] > 0 && A[i] <= N) {\n bitmap[A[i]] = true;\n }\n }\n \n for(var j = 1; j <= N; j++) {\n if (!bitmap[j]) {\n return j;\n }\n }\n \n return N + 1;\n}", "function compressBoxes(input){\n for(var i = 0; i<=100; i++){\n console.log('hi'); // O(100)\n }\n\n input.forEach(function(box){\n console.log(box); // O(n)\n })\n\n input.forEach(function(box){\n console.log(box); //O(n)\n })\n }", "function anotherFunChallenge(input) {\n let a = 5; // O(1)\n let b = 10; // O(1)\n let c = 50; // O(1)\n for (let i = 0; i < input; i++) {\n // O(n) --> numbers of inputs\n let x = i + 1; // O(n)\n let y = i + 2; // O(n)\n let z = i + 3; // O(n)\n }\n for (let j = 0; j < input; j++) {\n // O(n) --> numbers of inputs\n let p = j * 2; // O(n)\n let q = j * 2; // O(n)\n }\n let whoAmI = \"I don't know\"; // O(1)\n}", "function arrayManipulation(n, queries) {\n const acc = {};\n for (const [a, b, k] of queries) {\n acc[a] = (acc[a] || 0) + k;\n acc[b+1] = (acc[b+1] || 0) - k;\n } \n let last = 0\n let m = 0\n for (let i=0; i<n+1; i++) {\n const curr = acc[i] || 0;\n last = last + curr;\n if (last > m) {\n m = last;\n }\n }\n return m\n}", "function solution(a) { // O(N)\n let max1; // O(1)\n let max2; // O(1)\n\n for (let value of a) { // O(N)\n if (!max1) { // O(1)\n max1 = value; // O(1)\n } else if (value > max1) { // O(1)\n max2 = max1; // O(1)\n max1 = value; // O(1)\n } else if (value < max1) { // O(1)\n if (!max2) { // O(1)\n max2 = value; // O(1)\n } else if (value > max2) { // O(1)\n max2 = value; // O(1)\n }\n }\n }\n\n return max2; // O(1)\n}", "function find_quad (ary, s) {\n\n\tif(ary.length < 4) {\n\n\t\treturn null;\n\t}\n\telse if(ary.length === 4) {\n\n\t\tif(ary[0] + ary[1] + ary[2] + ary[3] === s) return ary;\n\t}\n\n\tvar hashTable = {}; //declare a hashtable \n\tvar tempSum = 0;\n\n\tfor(var i = 0; i < ary.length; i++) {\n\n\t\tfor(var j = i + 1; j < ary.length; j++) {\n\n\t\t\ttempSum = ary[i] + ary[j];\n\t\t\tif(!hashTable[tempSum]) {\n\t\t\t\thashTable[tempSum] = [];\n\t\t\t}\n\t\t\thashTable[tempSum].push([i , j]);\n\t\t}\n\t}\n\n\tconsole.log(hashTable);\n\n\tvar arrayA = [];\n\tvar arrayB = [];\n\tvar result = [];\n\n\tfor(key in hashTable) {\n\n\t\tif(hashTable[s - key]) {\n\n\t\t\tarrayA = hashTable[key];\n\t\t\tarrayB = hashTable[s - key];\n\t\t\tresult = checkUniqueness(arrayA, arrayB);\n\t\t\tif(result) {\n\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t}\n\t}\n\n\treturn null;\n}", "function naiveSame(arr1, arr2){ // O(n^2)\r\n if(arr1.length !== arr2.length){\r\n return false;\r\n }\r\n for(let i = 0; i < arr1.length; i++){ // O(n)\r\n let correctIdx = arr2.indexOf(arr1[i] ** 2) // nested O(n)\r\n if(correctIdx === -1){\r\n return false;\r\n }\r\n arr2.splice(correctIdx, 1)\r\n }\r\n return true;\r\n}", "function StairCase(n, arr) {\n\tvar cache = [1];\n\tfor (let i=1; i< n+1; i++) {\n\t\tlet ans = getSumOfPossiblities(i, arr, cache);\n\t\tcache[i] = ans;\n\t}\n\t\n\treturn cache[n];\n}", "function funChallenge(input) {\n let a = 10; // O(1)\n a = 50 + 3; // O(1)\n\n for (let i = 0; i < input.length; i++) {\n // O(n)\n anotherFunction(); // O(n)\n let stranger = true; // O(n)\n a++; // O(n)\n }\n return a; // O(1)\n}", "function funChallenge(input) {\n let a = 10; // O(1)\n a = 50 + 3; // O(1)\n\n for (let i = 0; i < input.length; i++) {\n // O(n) --> number of inputs\n anotherFunction(); // O(n)\n let stranger = true; // O(n)\n a++; // O(n)\n }\n return a; // O(1)\n}", "a (a a = 0; a < a.a; ++a) {N\n a a = a[a];N\n a (a.a == a) {N\n a a = aAaAaAa(a, a.a);N\n a (!a) a.a = aAa;N\n a a (aAa) a.a = a.a == a ? a : a.a + a;N\n }N\n }", "function fastPermutatedNeedle(needle, haystack) {\n let result = []\n let length = needle.length\n let needleObject = hashTableString(needle)\n for (let i = 0; i < haystack.length - length + 1; i++) {\n if (!needleObject[haystack[i]]) {\n continue\n }\n let needleObjectCopy = shallowCopyObject(needleObject)\n let count = length\n for (let j = i; j < i + needle.length; j++) {\n if (!needleObjectCopy[haystack[j]] || needleObjectCopy[haystack[j] < 1]) {\n break\n }\n needleObjectCopy[haystack[j]]--\n count--\n }\n if (count === 0) {\n result.push(i)\n }\n }\n return result\n}", "function O(t, e, n) {\n return t.length === e.length && t.every((function(t, r) {\n return n(t, e[r]);\n }));\n}", "function countInverse(array) {\n\n split(0, array.length - 1);\n // console.log(\"Result:\" + array);\n //console.log(count);\n //console.log(perf + ' ' + array.length * Math.log(array.length));\n\n function split(left, right) {\n // console.log('Split ' + left + \" \" + right)\n var middle = Math.floor((right + left) / 2);\n\n if (middle > left) {\n split(left, middle);\n split(middle + 1, right);\n }\n merge(left, middle, right)\n }\n\n function merge(left, middle, right) {\n //console.log(\"Merge\" + left + ',' + middle + ',' + right);\n var leftArr = array.slice(left, middle + 1);\n var rightArr = array.slice(middle + 1, right + 1);\n // console.log(leftArr);\n // console.log(rightArr);\n while (leftArr.length > 0 && rightArr.length > 0) {\n perf++;\n if (leftArr[0] < rightArr[0]) {\n array[left++] = leftArr.shift();\n } else {\n count = (count+leftArr.length);\n array[left++] = rightArr.shift();\n }\n }\n leftArr.concat(rightArr);\n while (leftArr.length > 0) {\n array[left++] = leftArr.shift();\n }\n }\n return count;\n }", "function funChallenge(input) {\n let a = 10; // O(1) Some people don't count assignments\n a = 50 + 3; // O(1)\n\n for (let i = 0; i < input.length; i++) { // O(n) --> n is the input\n anotherFunction(); // O(n)\n let stranger = true; // O(n)\n a++; // O(n)\n }\n return a; // O(1) another thing some people don't count\n}", "function ps(t) {\n var e = O(t);\n return O(O(e.bh).persistence).Uo();\n}", "function sift(a, i, n, lo) {\n\t var d = a[--lo + i],\n\t x = f(d),\n\t child;\n\t while ((child = i << 1) <= n) {\n\t if (child < n && f(a[lo + child]) > f(a[lo + child + 1])) child++;\n\t if (x <= f(a[lo + child])) break;\n\t a[lo + i] = a[lo + child];\n\t i = child;\n\t }\n\t a[lo + i] = d;\n\t }", "function A(n,t){for(;t+1<n.length;t++)n[t]=n[t+1];n.pop()}", "function version2(array){ // O(n)\n let map = {}\n for(let i=0; i< array.length; i++){\n if(map[array[i]] !== undefined ){ // if(0) gives undefined due to type coercion \n return array[i]\n }else{\n map[array[i]] = i\n }\n }\n console.log(map)\n return undefined\n}", "function snt (n) {\n for (let i=2 ; i <=n; i++)\n arr[i]=1;\n console.log(arr)\n arr[0]=arr[1]=0;\n // console.log(arr)\n for (let i =2; i<=Math.sqrt(n); i++)\n if (arr[i])\n for (let j=2*i; j <=n; j += i)\n arr[j]=0\n}", "function solve(input) {\n let elves = [];\n for (let i = 0; i < input; i++) {\n elves.push(i + 1);\n }\n\n function getNextIndex(index) {\n let next = (elves.length / 2) + index;\n if (next >= elves.length) {\n next -= elves.length\n }\n if (!_.isInteger(next)) {\n next = _.floor(next);\n }\n return next;\n }\n\n let current = elves[0];\n // let currentTime = new Date().getTime();\n while (elves.length > 1) {\n let index = _.indexOf(elves, current);\n let nextIndex = getNextIndex(index);\n // if (index % 100 === 0) {\n // let newTime = new Date().getTime();\n // console.log(index, elves[index], elves[nextIndex], elves.length, newTime - currentTime);\n // currentTime = newTime;\n // }\n elves[nextIndex] = 0;\n elves = _.compact(elves);\n let nextCurrent = _.indexOf(elves, current) + 1;\n if (nextCurrent >= elves.length) {\n nextCurrent = 0;\n }\n current = elves[nextCurrent];\n }\n console.log(input, elves[0]);\n}", "function n(t,i){for(;i+1<t.length;i++)t[i]=t[i+1];t.pop()}", "function n(t,i){for(;i+1<t.length;i++)t[i]=t[i+1];t.pop()}", "_hash(key) { //O(1)\n let hash = 0;\n for (let i = 0; i < key.length; i++) {//grab the length of 'grapes' (key)\n hash = (hash + key.charCodeAt(i) * i) % this.data.length;\n //charCodeAt(): returns an integer between 0 & 65535 \n //this.data.length: ensures the size stays between 0-50 (memory space for hash table)\n console.log(hash); // 0 14 8 44 48 23\n }\n return hash;\n }", "function sift(a, i, n, lo) {\n var d = a[--lo + i],\n x = f(d),\n child;\n while ((child = i << 1) <= n) {\n if (child < n && f(a[lo + child]) > f(a[lo + child + 1])) child++;\n if (x <= f(a[lo + child])) break;\n a[lo + i] = a[lo + child];\n i = child;\n }\n a[lo + i] = d;\n }", "function twoSum(arr, n) {\n var ret = [];\n\n for( var i = 0; i < arr.length - 1; i++ ) {\n for( var j = i + 1; j < arr.length; j++ ){\n if( arr[i] + arr[j] == n ) {\n ret.push(i);\n ret.push(j);\n return [i,j];\n }\n }\n }\n}", "function same(arr1, arr2) {\n if (arr1.length !== arr2.length) return false; // O(1)\n\n for (let i = 0; i < arr1.length; i++) { // O(N)\n let correctIdx = arr2.indexOf(arr1[i] ** 2); // O(N)\n if (correctIdx === -1) return false; // O(1)\n arr2.splice(correctIdx, 1); // O(N)\n }\n return true;\n }", "function solution(a) {\r\n // write your code in JavaScript (Node.js 0.12)\r\n var i, l=a.length-1;\r\n var arr=[];\r\n do{ \r\n arr[a[l]-1] = a[l];\r\n \r\n l--; \r\n if(l===0)\r\n for(j=0;j<arr.length;j++)\r\n if(!arr[j])\r\n return j+1;\r\n \r\n }while(l>=0)\r\n}", "function problem2(){\n var numArr = [1,2];\n while(numArr[numArr.length-1]<4000000){\n numArr.push( numArr[numArr.length - 2] + numArr[numArr.length - 1] );\n }\n numArr = numArr.filter(function(a){ return a%2===0});\n return numArr.reduce(function(a,b){ return a+b; });\n}", "function O(t, n) {\n return void 0 !== t ? t : n;\n}", "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n // [1,0] . [0,1]\n let f = A[0];\n let count = 0;\n let getOCount = getCount(A, 1);\n let getZCount = getCount(A, 0);\n console.log(getOCount + \" \" + getZCount);\n if (getOCount >= getZCount) {\n for (let i = 0; i < A.length - 1; ++i) {\n if (A[i] === A[i + 1]) {\n if (A[i] === 1) {\n A[i + 1] = 0;\n } else {\n A[i + 1] = 1;\n }\n count++;\n }\n }\n } else {\n for (let i = 0; i < A.length - 1; ++i) {\n if (A[i] === A[i + 1]) {\n if (A[i + 1] === 1) {\n A[i] = 0;\n } else {\n A[i] = 1;\n }\n count++;\n }\n }\n }\n return count;\n}", "function solution(arr){\n\n}", "a (a a = 0; a < a.a; ++a) {N\n a a = a[a];N\n a (a.a != a) a.a += a;N\n a (a.a == a) {N\n a a = aAaAaAa(a, a.a);N\n a (!a) {N\n a.a = a;N\n a (aAa) (a || (a = [])).a(a);N\n }N\n } a {N\n a.a += a;N\n a (aAa) (a || (a = [])).a(a);N\n }N\n }", "function ex_2(myA){\n return myA.filter(x => x % 2 == 0) // O(myA.length)\n .map(a => a * a) // O(myA.length)\n .reduce((acc, x) => acc + x, 0); // O(myA.length)\n}", "function mystery(n) {\n let r = 0;\n for (let i = 0; i < n; i++) {\n for (let j = i + 1; j <= n; j++) {\n for (let k = 1; k < j; k++) {\n r++;\n }\n }\n }\n return r;\n}", "function createPairs(arr) {\n for (let i = 0; i < arr.length; i++) { // --> polynomial O(n^2) quadratic\n for (let j = i + 1; j < arr.length; j++) { // --> polynomial 0(n^2) quadratic\n console.log(arr[i] + ', ' + arr[j]); //--> constant\n }\n }\n}", "function aVeryBigSum(ar) {\n \n}", "function Gn(e,t){var a=e[t];e.sort(function(e,t){return P(e.from(),t.from())}),t=d(e,a);for(var n=1;n<e.length;n++){var r=e[n],f=e[n-1];if(P(f.to(),r.from())>=0){var o=G(f.from(),r.from()),i=U(f.to(),r.to()),s=f.empty()?r.from()==r.head:f.from()==f.head;n<=t&&--t,e.splice(--n,2,new Di(s?i:o,s?o:i))}}return new Oi(e,t)}", "threesum1(arr) {\n\n var l = arr.length;\n for (var i = 0; i < l - 2; i++) {\n for (var j = i + 1; j < l - 1; j++) {\n for (var k = j + 1; k < l; k++) {\n if (arr[i] + arr[j] + arr[k] == 0) {\n console.log(arr[i] + \",\" + arr[j] + \",\" + arr[k] + \" is a triplet\")\n }\n\n\n }\n }\n }\n }", "function maxSubArraySum(arr, n){ // O(n^2) // naive solution\r\n let maxSum = 0;\r\n for(let i = 0; i < arr.length - n + 1; i++){ // O(n)\r\n let temp = 0;\r\n for(let j = 0; j < n; j++){ // nested O(n)\r\n temp += arr[i + j];\r\n }\r\n if(temp > maxSum){\r\n maxSum = temp;\r\n }\r\n }\r\n return maxSum;\r\n}", "function advanced(arr) {\n const n = arr.length;\n let leftSum = 0;\n let rightSum = 0;\n\n for (let i = 1; i < n; i++) {\n rightSum += arr[i];\n }\n\n for (let i = 0, j = 1; i < n; i++, j++) {\n leftSum += arr[i];\n rightSum -= arr[j];\n\n if (leftSum === rightSum) {\n return arr[j];\n }\n }\n\n return arr[0];\n}", "function findDuplicate(arr) {\n \n \n}", "function reoccurring(arr){\n\tfor(let i = 0; i < arr.length; i++){\n\t\tfor(j = i+1; j < arr.length; j++){\n\t\t\tif(arr[i] === arr[j]){\n\t\t\t\treturn arr[i]\n\t\t\t}\n\t\t}\n\t}\n\treturn undefined\n} // O(n^2)", "function removeDuplicatesInPlace(arr, n)\n{\n if (n===0 || n===1)\n {\n return n\n }\n\n let temp = new Array(n)\n\n let j = 0\n\n for (let i = 0; i < n - 1; i++)\n {\n if (arr[i] !== arr[i+1]) {\n temp[j++] = arr[i]\n }\n\n }\n temp[j++] = arr[n-1];\n\n for(let k = 0; k < j; k++)\n {\n arr[k] = temp[k]\n }\n\n return j\n}", "function op1(map, val) { // O(1)\n // insert the val into the map \n // if the val already exists in the map\n // now also have to update the frequencies map \n if (map[val]) { \n // check if map[val] we need to decrement the\n // frequency of map[val]\n // increment its value \n map[val]++;\n // increment frequecy of map[val] in the frequency map\n } else {\n // otherwise, add it to the map with a value of 1\n map[val] = 1;\n // add map[val] to our frequencies map \n }\n}", "function s(beginWord, endWord, wordList) {\n // for each word find one letter transformations\n // find shortest traversal\n\n /* \n time:\n create graph, o(length of wordlist * length of wordlist * length of word), o(n2m)\n traverse, o(nm)\n => simplify, o(mn2)\n space:\n create graph, o(mn2)\n stack height, o(n)\n */\n\n const graph = makeGraph();\n let out = Infinity;\n let list;\n\n // change back to arrays\n for (let word in graph) {\n graph[word] = [...graph[word]];\n }\n\n traverse(beginWord);\n\n function traverse(word, set = new Set(), res = 0, curList = [beginWord]) {\n if (word === endWord) {\n if (res < out) {\n out = res;\n list = curList.slice();\n }\n return;\n }\n for (let nextWord of graph[word]) {\n if (!set.has(nextWord)) {\n set.add(nextWord);\n curList.push(nextWord);\n traverse(nextWord, set, res + 1, curList);\n curList.pop();\n set.delete(nextWord);\n }\n }\n }\n\n return { out, list };\n\n function makeGraph() {\n const out = {};\n for (let word of wordList) {\n if (compare(beginWord, word)) {\n out[beginWord]\n ? out[beginWord].add(word)\n : (out[beginWord] = new Set([word]));\n out[word]\n ? out[word].add(beginWord)\n : (out[word] = new Set([beginWord]));\n }\n }\n for (let word of wordList) {\n for (let nextWord of wordList) {\n if (word !== nextWord && compare(word, nextWord)) {\n out[word]\n ? out[word].add(nextWord)\n : (out[word] = new Set([nextWord]));\n out[nextWord]\n ? out[nextWord].add(word)\n : (out[nextWord] = new Set([word]));\n }\n }\n }\n return out;\n }\n\n function compare(w1, w2) {\n let diffs = 0;\n for (let i = 0; i < w1.length; i++) {\n if (w1[i] !== w2[i]) diffs++;\n }\n if (diffs <= 1) {\n return true;\n } else {\n return false;\n }\n }\n}", "function findUnique3(numbers) {\n\n // Initialize histogram\n var histogramSize = (numbers.length + 1) / 2;\n var histogram = [];\n for (var i = 0; i < histogramSize; i += 1) {\n histogram[i] = 0;\n }\n\n // Initialize mapping to reduce value range to histogramSize\n var mapping = {};\n var inverseMapping = new Array(histogramSize);\n var index = 0;\n for (var i in numbers) {\n if (!(mapping[numbers[i]] >= 0)) {\n mapping[numbers[i]] = index;\n inverseMapping[index] = numbers[i];\n index += 1;\n }\n }\n\n // Sort values into histogram\n for (var i in numbers) {\n histogram[mapping[numbers[i]]] += 1;\n }\n\n // Find only single element in histogram and return\n for (var i in histogram) {\n if (histogram[i] < 2) {\n return inverseMapping[i];\n }\n }\n\n // Given correct input, this line will not be executed\n return false;\n}", "function solution(n) {\n d = new Array(30);\n l = 0;\n while (n > 0) {\n d[l] = n % 2;\n n = Math.floor(n / 2);\n l += 1;\n }\n console.log('l = ', l);\n console.log('d = ', d);\n for (p = 1; p < 1 + l; ++p) {\n ok = true;\n for (i = 0; i < l - p; ++i) {\n if (d[i] != d[i + p]) {\n ok = false;\n break;\n }\n }\n if (ok) {\n return p;\n }\n }\n return -1;\n}", "function o$h(n,o,t){for(let r=0;r<t;++r)o[2*r]=n[r],o[2*r+1]=n[r]-o[2*r];}", "function binary(arr,key){\n\n let start=0,end=arr.length;\n\n mid=Math.floor((start+end)/2)\n console.log('KEY : '+key,\" ARR[MID]: \"+arr[mid],\"MID : \"+mid)\n console.log(`ARR: ${arr}`)\n if(arr[mid]==key)\n {\n return x.indexOf(arr[mid])\n }\n \n else if(start==end){\n return \n }\n\n else{\n \n if(key>arr[mid]){\n\n start=mid+1\n } \n else {\n end=mid-1\n }\n console.log(`START : ${start} END:${end}`)\n\n return binary(arr.splice(start,end),key)\n }\n\n\n\n}", "function fusion(liste)\r\n{\r\n var tempArray = liste.slice(); // Copie temporaire du tableau (liste)\r\n for(var k=0; k<size; k++)\r\n {\r\n if(tempArray[k] != null)\r\n {\r\n var l = k+1;\r\n\r\n while(tempArray[l]==null && l<=size)\r\n {\r\n l++;\r\n }\r\n\r\n if(tempArray[l] == tempArray[k])\r\n {\r\n tempArray[k] = tempArray[k]*2;\r\n tempArray[l] = null;\r\n moved = true;\r\n caseBoitesRemplies--;\r\n }\r\n\r\n k = l-1;\r\n }\r\n }\r\n\r\n var l = 0;\r\n\r\n for(var k=0; k<size; k++)\r\n {\r\n if(tempArray[k] != null)\r\n {\r\n if(l == k)\r\n l++;\r\n else\r\n {\r\n tempArray[l] = tempArray[k];\r\n tempArray[k] = null;\r\n l++;\r\n moved = true;\r\n }\r\n }\r\n }\r\n return tempArray;\r\n}", "function bustOpenPairs(arr){\n for (let y = 0; y < arr.length; y++) { // Moving between items and searching arrays who have 2 items and they are the same on x.\n for (let x = 0; x < arr[y].length; x++) {\n if (typeof arr[y][x] === \"object\" && arr[y][x].length === 2) { \n for (let m = 0; m < arr[y].length; m++) {\n if (typeof arr[y][m] === \"object\" && arr[y][m].length === 2 && JSON.stringify(arr[y][m]) === JSON.stringify(arr[y][x]) && x !== m) {\n next:\n for (let k = 0; k < arr[y].length; k++) {\n if (x === k || m === k) {\n continue next;\n }\n if (typeof arr[y][k] === \"object\") { \n arr[y][k].splice(arr[y][k].indexOf(arr[y][x][0]), 1);\n arr[y][k].splice(arr[y][k].indexOf(arr[y][x][1]), 1);\n }\n }\n }\n }\n }\n }\n }\n for (let y = 0; y < arr.length; y++) { // Moving between items and searching arrays who have 2 items and they are the same on y.\n for (let x = 0; x < arr[y].length; x++) {\n if (typeof arr[y][x] === \"object\" && arr[y][x].length === 2){\n for (let m = 0; m < arr[x].length; m++) {\n if (typeof arr[m][x] === \"object\" && arr[m][x].length === 2 && JSON.stringify(arr[m][x]) === JSON.stringify(arr[y][x]) && y !== m) {\n next:\n for (let k = 0; k < arr[x].length; k++) {\n if ( y === k || m === k ) {\n continue next;\n }\n if (typeof arr[k][x] === \"object\") { \n arr[k][x].splice(arr[k][x].indexOf(arr[y][x][0]), 1);\n arr[k][x].splice(arr[k][x].indexOf(arr[y][x][1]), 1);\n }\n }\n }\n }\n }\n }\n }\n for (let y = 0; y < arr.length; y++) { // Moving between items and searching arrays who have 2 items and they are the same on squares.\n for (let x = 0; x < arr[y].length; x++) {\n if (typeof arr[y][x] === \"object\" && arr[y][x].length === 2){ \n if (x < 3 && y < 3) {\n for (let k = 0; k < 3; k++) {\n next:\n for (let m = 0; m < 3; m++) {\n if (typeof arr[k][m] !== \"object\" || typeof arr[k][m] === \"object\" && k === y && m === x) {\n continue next;\n }\n if (arr[k][m].length === 2 && JSON.stringify(arr[k][m]) === JSON.stringify(arr[y][x])) {\n for (let n = 0; n < 3; n++) {\n for (let p = 0; p < 3; p++) {\n if (JSON.stringify(arr[n][p]) !== JSON.stringify(arr[y][x]) && typeof arr[n][p] === \"object\") {\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][0]), 1);\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][1]), 1);\n } \n }\n } \n }\n }\n }\n }\n if (x >= 3 && x < 6 && y < 3) {\n for (let k = 0 ; k < 3; k++) {\n next:\n for (let m = 3; m < 6; m++) {\n if (typeof arr[k][m] !== \"object\" || typeof arr[k][m] === \"object\" && k === y && m === x) {\n continue next;\n }\n if (arr[k][m].length === 2 && JSON.stringify(arr[k][m]) === JSON.stringify(arr[y][x])) {\n for (let n = 0; n < 3; n++) {\n for (let p = 3; p < 6; p++) {\n if (JSON.stringify(arr[n][p]) !== JSON.stringify(arr[y][x]) && typeof arr[n][p] === \"object\") {\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][0]), 1);\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][1]), 1);\n }\n }\n } \n }\n }\n }\n }\n if (x >= 6 && y < 3) {\n for (let k = 0 ; k < 3; k++) {\n next:\n for (let m = 6; m < 9; m++) {\n if (typeof arr[k][m] !== \"object\" || typeof arr[k][m] === \"object\" && k === y && m === x) {\n continue next;\n }\n if (arr[k][m].length === 2 && JSON.stringify(arr[k][m]) === JSON.stringify(arr[y][x])) {\n for (let n = 0; n < 3; n++) {\n for (let p = 6; p < 9; p++) {\n if (JSON.stringify(arr[n][p]) !== JSON.stringify(arr[y][x]) && typeof arr[n][p] === \"object\") {\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][0]), 1);\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][1]), 1);\n }\n }\n } \n }\n }\n }\n }\n if (x < 3 && y >= 3 && y < 6) {\n for (let k = 3; k < 6; k++) {\n next:\n for (let m = 0; m < 3; m++) {\n if (typeof arr[k][m] !== \"object\" || typeof arr[k][m] === \"object\" && k === y && m === x) {\n continue next;\n }\n if (arr[k][m].length === 2 && JSON.stringify(arr[k][m]) === JSON.stringify(arr[y][x])) {\n for (let n = 3; n < 6; n++) {\n for (let p = 0; p < 3; p++) {\n if (JSON.stringify(arr[n][p]) !== JSON.stringify(arr[y][x]) && typeof arr[n][p] === \"object\") {\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][0]), 1);\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][1]), 1);\n }\n }\n } \n }\n }\n }\n }\n if (x >= 3 && x < 6 && y >= 3 && y < 6) {\n for (let k = 3; k < 6; k++) {\n next:\n for (let m = 3; m < 6; m++) {\n if (typeof arr[k][m] !== \"object\" || typeof arr[k][m] === \"object\" && k === y && m === x) {\n continue next;\n }\n if (arr[k][m].length === 2 && JSON.stringify(arr[k][m]) === JSON.stringify(arr[y][x])) {\n for (let n = 3; n < 6; n++) {\n for (let p = 3; p < 6; p++) {\n if (JSON.stringify(arr[n][p]) !== JSON.stringify(arr[y][x]) && typeof arr[n][p] === \"object\") {\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][0]), 1);\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][1]), 1);\n }\n }\n } \n }\n }\n }\n }\n if (x >= 6 && y >= 3 && y < 6) {\n for (let k = 3; k < 6; k++) {\n next:\n for (let m = 6; m < 9; m++) {\n if (typeof arr[k][m] !== \"object\" || typeof arr[k][m] === \"object\" && k === y && m === x) {\n continue next;\n }\n if (arr[k][m].length === 2 && JSON.stringify(arr[k][m]) === JSON.stringify(arr[y][x])) {\n for (let n = 3; n < 6; n++) {\n for (let p = 6; p < 9; p++) {\n if (JSON.stringify(arr[n][p]) !== JSON.stringify(arr[y][x]) && typeof arr[n][p] === \"object\") {\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][0]), 1);\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][1]), 1);\n }\n }\n } \n }\n }\n }\n }\n if (x < 3 && y >= 6) {\n for (let k = 6; k < 9; k++) {\n next:\n for (let m = 0; m < 3; m++) {\n if (typeof arr[k][m] !== \"object\" || typeof arr[k][m] === \"object\" && k === y && m === x) {\n continue next;\n }\n if (arr[k][m].length === 2 && JSON.stringify(arr[k][m]) === JSON.stringify(arr[y][x])) {\n for (let n = 6; n < 9; n++) {\n for (let p = 0; p < 3; p++) {\n if (JSON.stringify(arr[n][p]) !== JSON.stringify(arr[y][x]) && typeof arr[n][p] === \"object\") {\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][0]), 1);\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][1]), 1);\n }\n }\n } \n }\n }\n }\n }\n if (x >=3 && x < 6 && y >= 6) {\n for (let k = 6; k < 9; k++) {\n next:\n for (let m = 3; m < 6; m++) {\n if (typeof arr[k][m] !== \"object\" || typeof arr[k][m] === \"object\" && k === y && m === x) {\n continue next;\n }\n if (arr[k][m].length === 2 && JSON.stringify(arr[k][m]) === JSON.stringify(arr[y][x])) {\n for (let n = 6; n < 9; n++) {\n for (let p = 3; p < 6; p++) {\n if (JSON.stringify(arr[n][p]) !== JSON.stringify(arr[y][x]) && typeof arr[n][p] === \"object\") {\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][0]), 1);\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][1]), 1);\n }\n }\n } \n }\n }\n }\n }\n if (x >= 6 && y >= 6) {\n for (let k = 6; k < 9; k++) {\n next:\n for (let m = 6; m < 9; m++) {\n if (typeof arr[k][m] !== \"object\" || typeof arr[k][m] === \"object\" && k === y && m === x) {\n continue next;\n }\n if (arr[k][m].length === 2 && JSON.stringify(arr[k][m]) === JSON.stringify(arr[y][x])) {\n for (let n = 6; n < 9; n++) {\n for (let p = 6; p < 9; p++) {\n if (JSON.stringify(arr[n][p]) !== JSON.stringify(arr[y][x]) && typeof arr[n][p] === \"object\") {\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][0]), 1);\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][1]), 1);\n }\n }\n } \n }\n } \n } \n } \n } \n }\n }\n return insertZeros(arr); // Recursion.\n }", "function twoSum(nums, target) {\n // 0.\n let hash = {};\n\n // 1.\n for (let i = 0; i < nums.length; i++) {\n hash[nums[i]] = i;\n }\n\n // 2.\n for (let i = 0; i < nums.length; i++) {\n var n = target - nums[i];\n // 3.\n if (hash[n] !== undefined && hash[n] != i) {\n return [hash[n], i];\n }\n }\n return [];\n}", "function n(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "function n(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "function n(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "function n(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "function mutateTheArray(n, a) {\n if (n === 1) {\n return a;\n }\n var result = new Array(n);\n \n for (let i = 0; i < n; i++) {\n let left = a[i-1] ? a[i-1] : 0;\n let curr = a[i]\n let right = a[i+1] ? a[i+1] : 0;\n \n result[i] = (left+curr+right)\n } \n return result; \n \n}", "function searchNaive(arr, n){ // O(n) Linear Search\r\n for(let i = 0; i < arr.length; i++){\r\n if(arr[i] === n){\r\n return i;\r\n } \r\n }\r\n return -1;\r\n}", "function solution(n) {\n let cache = {}\n\n function tile(width) {\n if (width <= 0) return 0;\n if (width === 1) return 1;\n if (width === 2) return 3;\n\n if (cache[width]) {\n return cache[width];\n } else {\n cache[width] = (tile(width - 1) + 2 * tile(width - 2)) % 10007;\n return cache[width]\n }\n }\n\n return tile(n);\n}", "function uniqueValuesNoBuffer(sList) {\n let current = sList.head;\n if (current === null) {return null}\n let sieve; // the process of checking all subsequent nodes and sieving needs to be done n-1 times in the worst case (when all nodes are already unique). I'd love to write this recursively, since the repetitive checking lends itself naturally to that type of approach, but the prompt hints that we may be short on memory or at the very least we prize it highly, so I'll stay iterative to avoid inflating the stack frame.\n let runner; // so, now current is effectively a placeholder, sieve iterates the list from current, and runner optimizes deletions, then current advances one node and the process repeats until the list is exhausted.\n while (current) { // despite the appearance (2 nested loops), this is still only n^2; sieve and runner work together so each node is touched only once - sieve and runner just enable deleting contiguous blocks rather than breaking and forging links within a block that will ultimately be deleted.\n sieve = current;\n while (sieve) { // rather than checking for multiples of a prime, sieve is just matching a value, but it still could reduce the remaining nodes in the iteration, which is where much of the efficiency potential comes from.\n if (sieve.next && (sieve.next.value === current.value)) {\n runner = sieve.next.next;\n while (runner) { // runner helps group contiguous nodes for deletion where possible, which also provides some efficiency.\n if (runner.value === current.value) {\n runner = runner.next;\n } else {\n break;\n }\n }\n sieve.next = runner;\n }\n sieve = sieve.next;\n }\n current = current.next;\n }\n return sList;\n}", "function countUniqueValues2(arr){\n if(arr.length < 2){\n return arr.length;\n }\n let i=0\n for(let j=1; j<arr.length; j++){\n if(arr[i]!==arr[j]){\n arr[++i] = arr[j]\n }\n }\n return i+1;\n}", "function f(n) {\n return [0].indexOf(n - n + 0);\n}", "function solution(A) {\r\n // write your code in JavaScript (Node.js 8.9.4)\r\n \r\n let sorted = A.sort();\r\n let storage = {};\r\n \r\n // Store sorted Array in a json using the value as the key\r\n for (let i = 0; i < sorted.length; i++) {\r\n storage[sorted[i]] = sorted[i];\r\n }\r\n \r\n // If the storage does not contain the key from the loop below, return the key\r\n for (let i = 1; i < 1000001; i++) {\r\n if (!storage[i]) return i; \r\n }\r\n \r\n return 1;\r\n}", "function insertion_sort(arr) {\r\n var start_time = performance.now();\r\n sorted = arr;\r\n\r\n for(var i = 1;i<sorted.length;i++){\r\n for(var y = 0; y<i; y++){\r\n if(sorted[i] < sorted[y]){\r\n temp = sorted[y];\r\n sorted[y] = arr[i];\r\n arr[i] = temp;\r\n }\r\n }\r\n }\r\n var finish_time = performance.now();\r\n var execution_time = finish_time - start_time;\r\n document.getElementById(\"time_spent\").innerHTML = execution_time;\r\n return sorted;\r\n}", "function printFirstItemThenFirstHalfThenSayHi100Times(items) {\n console.log(items[0]); // O(1)\n\n let middleIndex = Math.floor(items.length / 2); // O(1)\n let index = 0; // O(1)\n while (index < middleIndex) {\n console.log(items[index]); // O(n/2)\n index++; // O(n/2)\n }\n\n for (let i = 0; i < 100; i++) {\n // O(100)\n console.log('Hi'); // O(100)\n }\n}", "function min_spaces(pi, fav_arr) {\n let set = new Set(fav_arr);\n let map = new Map(); //memoisation\n let N = pi.length;\n function recurse(pos) {\n if (pos === N) return 0; //base case\n if (map.has(pos)) return map.get(pos);\n\n let ans = Infinity;\n for (let i = 1; i < N; i++) {\n let cur = pi.slice(0, i);\n if (set.has(cur)) {\n let other = recurse(i);\n if (other !== -1) ans = Math.min(ans, other + 1);\n }\n }\n map.set(pos, ans);\n return ans === Infinity ? -1 : ans;\n }\n\n return recurse(0);\n}", "function insertSort(arr) {\n console.time('insertSort');\n for(let i = 1; i < arr.length; i++) {\n let temp = arr[i];\n\n let j = i;\n for(j = i; j > 0; j--) {\n if(arr[j - 1] < temp) {\n break;\n } else {\n arr[j] = arr[j - 1];\n }\n }\n arr[j] = temp;\n \n\n // while ( (j > 0) && (arr[j - 1] > temp) ) {\n // arr[j] = arr[j - 1];\n // j--;\n // c++;\n //\n // }\n\n // arr[j] = temp;\n\n }\n\n console.timeEnd('insertSort');\n return arr;\n}", "function solution(A) {\n let map = []\n let index = 1;\n for(let i = 0; i < A.length + 1; i++) {\n map[A[i]] = true;\n }\n\n while( index < A.length + 1) {\n if(!map[index]) break;\n index++;\n }\n\n return index;\n}", "function h(n,t){var r,u,i,f;if(n===t)return 0;for(r=n.length,u=t.length,i=0,f=Math.min(r,u);i<f;++i)if(n[i]!==t[i]){r=n[i];u=t[i];break}return r<u?-1:u<r?1:0}", "function twoSum(nums, target) {\n let visited = new Map();\n\n for (let i = 0; i < nums.length; i++) {\n let remaining = target - nums[i];\n\n if (visited.has(remaining)) {\n return [visited.get(remaining), i];\n }\n\n visited.set(nums[i], i);\n }\n}", "function performantSmallest(arr, n) {\n let res =[]\n do{\n let x = Math.min(...arr)\n res.push([x,arr.indexOf(x)])\n arr.splice(arr.indexOf(x),1)\n }\n while (res.length < n)\n res.sort((a,b)=>a[1]-b[1])\n return res.map(e=>e[0])\n }", "function threesum(nums){\n nums=nums.sort((a,b)=>a-b);\n let result=[];\n for(let i=0;i<nums.length-2;i++){\n let left=i+1;\n let right=nums.length-1;\n while(right>left){\n let currSum=nums[i]+nums[left]+nums[right];\n if(currSum===0){\n let flag=true;\n console.log(nums[i], nums[left], nums[right]);\n for(let ar of result){\n console.log(ar)\n if(ar[0]===nums[i] && ar[1]===nums[left] && ar[2]===nums[right]) flag=false;\n }\n if(flag){\n result.push([nums[i],nums[left],nums[right]])\n }\n left++;\n right--;\n }\n else if(currSum>0)\n right--;\n else\n left++\n }\n }\n return result;\n}", "function n(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}", "function findNUniqueIntegersSumUpToZero(n) {\n let result = n % 2 === 0 ? [n, -n] : [0]\n for (let index = 1; index < n / 2; index++) {\n result.push(index, -index)\n }\n return result\n}", "function twoSum(numsArr, target) {\n // more basic code\n\n // for (let i = 0; i < numsArr.length; i++) {\n\n // for (let j = 0; j < numsArr.length; j++) {\n // if(i != j){\n // if (numsArr[i] + numsArr[j] == target) {\n // return [i, j];\n // }\n // }\n // }\n // }\n\n // faster code\n var sumPartners = {};\n for(var i = 0; i < nums.length; i++) {\n sumPartners[target - nums[i]] = i;\n if (sumPartners[nums[i]] && sumPartners[nums[i]] !== i) {\n return [sumPartners[nums[i]], i];\n }\n }\n \n for(var j = 0; j < nums.length; j++) {\n if (sumPartners[nums[j]] && sumPartners[nums[j]] !== j) {\n return [j, sumPartners[nums[j]]];\n }\n }\n}", "function createPairs(arr) {\n for (let i = 0; i < arr.length; i++) {\n // O(n)\n for (let j = i + 1; j < arr.length; j++) {\n // O(n^2)\n console.log(arr[i] + \", \" + arr[j]);\n }\n }\n}", "function i(n){let e=0,t=0;const r=n.length;let i,o=n[t];for(t=0;t<r-1;t++)i=n[t+1],e+=(i[0]-o[0])*(i[1]+o[1]),o=i;return e>=0}", "function findVariations(input){ //Time: O(2^n) n = num x's Space: O(1)\n // accepts string, returns str variations\n\n if(!checkInput) return 'Check input, please!';\n\n let index = input.indexOf('X'); //Time: O(n)\n if(index<0){\n console.log(input);\n return input;\n }\n findVariations(input.slice(0,index) + '0' + input.slice(index+1)); //Time: O(n)\n findVariations(input.slice(0,index) + '1' + input.slice(index+1)); //Time: O(n)\n}", "function op2(map, val) { // O(1)\n // delete the val from the map \n // if the val already exists in the map\n if (map[val]) {\n // decrement the old frequency of map[val]\n // decrement its value \n map[val]--;\n // increment the new frequency in map[val]\n }\n // otherwise, we don't do anything \n}", "function $cf838c15c8b009ba$export$2f3eb4d6eb4663c9(key) {\n const getKey = typeof key === \"string\" ? (value)=>value && typeof value === \"object\" && value[key] !== undefined ? value[key] : value : null;\n const create = (iterating)=>{\n let i = 0, j, len, nOthers, args, result, memory;\n return function() {\n if (!args) {\n args = [].sort.call(arguments, (a, b)=>a.length - b.length);\n nOthers = args.length - 1;\n result = [];\n memory = new Map();\n i = 0;\n j = 0;\n }\n for(; i <= nOthers; i++){\n //j = j===-1 ? arguments[i].length : j;\n const len = args[i].length;\n while(j < len){\n const elem = args[i][j], key = getKey ? getKey(elem) : elem;\n if (memory.get(key) === i - 1) {\n if (i === nOthers) {\n result[result.length] = elem;\n memory.set(key, 0);\n if (iterating) {\n j++;\n return {\n value: elem\n };\n }\n } else memory.set(key, i);\n } else if (i === 0) memory.set(key, 0);\n j++;\n }\n j = 0;\n }\n args = null;\n return iterating ? {\n done: true\n } : result;\n };\n };\n const intersect = create();\n intersect.iterable = function(...args) {\n const intersect = create(true);\n let started;\n return {\n next () {\n if (started) return intersect();\n started = true;\n return intersect(...args);\n },\n [Symbol.iterator] () {\n return this;\n }\n };\n };\n return intersect;\n}", "function twoSum(nums, target) {\n // 0.\n let hash = {};\n\n // 1.\n for (let i = 0; i < nums.length; i++) {\n var n = target - nums[i];\n // 2.\n if (hash[n] !== undefined) {\n return [hash[n], i];\n }\n // 3.\n hash[nums[i]] = i;\n }\n return [];\n}", "lookupAndMarkFound() {\n let m=0;\n for (let n=1; n<=N; n++) {\n for (let i=0;i<N; i++) {\n let fr = this.findInRow(n,i);\n if (fr.length == 1) {\n this.markAndRemove(n,fr[0].i, fr[0].j);\n m++;\n }\n let fc = this.findInColumn(n,i);\n if (fc.length == 1) {\n this.markAndRemove(n,fc[0].i, fc[0].j);\n m++;\n }\n let fb = this.findInBlock(n,i);\n if (fb.length == 1) {\n this.markAndRemove(n,fb[0].i, fb[0].j);\n m++;\n }\n }\n }\n return m;\n }", "function slow_solution(arr){\n let resultsArr = []\n for(let i=0; i<arr.length;i++){\n resultsArr[i] = 0;\n for(let j=0; j<arr.length; j++){\n if(arr[i] % arr[j] !== 0){\n resultsArr[i] +=1;\n // console.log('|i:', i, '| j:', j,'| arr:', arr[i], '| res:',resultsArr[i])\n }\n }\n }\n return resultsArr\n}", "function areYouHere(arr1, arr2) {\n for (let i = 0; i < arr1.length; i++) { //--> polynomial O(n^2) quadratic\n const el1 = arr1[i]; //--> constant\n for (let j = O; j < arr2.length; j++) {\n const el2 = arr2[j]; //--> constant\n if (el1 === el2) return true;\n }\n }\n return false; //--> constant\n}", "function solution3(A) {\n count = 0;\n for (i = 0; i < A.length; i++) {\n if (i + 1 > A.length || i + 2 > A.length) {\n } else if (A[i] - A[i + 1] == A[i + 1] - A[i + 2]) {\n count += 1;\n\n let newA = A.slice(i + 2)\n let dist = A[i] - A[i + 1]\n\n for (j = 0; j < newA.length; j++) {\n if (j + 1 >= A.length) {\n console.log(\"No more new array!\")\n } else if (newA[j] - newA[j + 1] == dist) {\n count += 1;\n }\n }\n }\n }\n // console.log(count)\n}", "function n(t, a) {\n return t[0] = a[0], t[1] = a[1], t[2] = a[2], t[3] = a[3], t[4] = a[4], t[5] = a[5], t[6] = a[6], t[7] = a[7], t[8] = a[8], t[9] = a[9], t[10] = a[10], t[11] = a[11], t[12] = a[12], t[13] = a[13], t[14] = a[14], t[15] = a[15], t;\n }", "function runningTime(arr) {\n let arrLen = arr.length;\n if (arrLen === 1) {\n return 0;\n }\n let numShift = 0;\n for (let x = 1; x < arrLen; x++) {\n let originIndex = x;\n let targetIndex = x;\n let currShift = 0;\n for (let y = x; y >= 0; y--) {\n if (arr[y] > arr[originIndex]) {\n targetIndex = y;\n currShift = originIndex - targetIndex;\n }\n }\n // if targeted index moved\n if (originIndex != targetIndex) {\n numShift += currShift;\n // remove value from array\n let valToInsert = arr.splice(originIndex, 1)[0];\n arr.splice(targetIndex, 0, valToInsert);\n }\n // console.log(arr.join(' '));\n }\n return numShift;\n}", "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n const N = A.length;\n let count = new Array(N+1).fill(0);\n \n for(let i in A){\n if(A[i] > N){\n return 0;\n }\n if(count[A[i]] > 0){\n return 0;\n }\n count[A[i]]++;\n }\n \n for(let i=1; i>N+1; i++){\n if(count[i] != 1){\n return 0;\n }\n }\n \n return 1;\n}", "function binarySearch(difficulty, array, element, start, end, complexity){\n var pivot = Math.floor(((start + end) / 2));\n console.log(`${start} and ${end} and element is ${element}`);\n console.log(array.slice(start, end));\n if(start >= end){\n console.log('element not found ' + element);\n return;\n }\n if(array[pivot] > element){\n end = pivot;\n }else if(array[pivot] < element){\n start = pivot;\n }else {\n console.log(`${difficulty} : ${element} found AND Time Complexity O(${complexity})\\n\\n\\n\\n`)\n return;\n }\n binarySearch(difficulty, array, element, start, end, ++complexity);\n}", "function triplets(arr){\n\n var map = {};\n var resArr= [];\n \n for(var i = 0;i< arr.length;i++){\n \n map[arr[i]] = 1;\n \n }\n \n \n var start = 0;\n var end = arr.length - 1;\n \n \n while(end > 0){\n \n \n if(start == end){\n \n start = 0;\n end --;\n \n }\n \n \n if((arr[start] - arr[end]) in map){\n \n var object = [arr[start],arr[end],(arr[start] - arr[end])];\n //console.log(object);\n resArr.push(object);\n \n }\n \n \n if((arr[end] - arr[start]) in map){\n \n var object = [arr[start],arr[end],(arr[start] - arr[end])];\n //console.log(object);\n \n if(arr[start] != 0 && arr[end] != 0){\n resArr.push(object);\n }\n } \n \n \n start++;\n \n \n \n \n }\n\n \n \n \n return resArr;\n \n \n\n}", "function countUniqueValues(array) {\n let p1 = 0\n let p2 = 1\n \n for (p2; p2< array.length; p2++){\n if(array[p1] !== array[p2]){\n p1 ++\n array[p1] = array[p2]\n }\n else {\n console.log(\"undefined\")\n }\n \n }\n return p1 + 1\n }", "function fibonacciIterative(n) {\n let arr = [0, 1]\n for (let i = 2; i < n + 1; i++) {\n arr.push(arr[i - 2] + arr[i - 1])\n }\n return arr[n]\n} // O(n)", "function prune(arr){\r\n//\tGM_log(\"arr.length : \"+arr.length);\r\n\tvar i = 0;\r\n\tfor(j in arr){\r\n\t\ti = j;\r\n\t\t// excluding i where i-1 or i+1 doesn't exist\r\n\t\tif(i > 0 && i < (arr.length -1)){\r\n\t\t\tvar test = Math.abs(arr[i*1+1] - arr[i-1]);\r\n\t\t//\tGM_log(\"test : \"+test+\" = arr[\"+i+\"+1] : \"+arr[i+1]+\" - arr[\"+i+\"-1] : \"+arr[i-1]);\r\n\t\t//\tGM_log(\"All [i] - i : \"+i+\" -> test : \"+test);\r\n\t\t\tif(test < smallest){\r\n\t\t//\t\tGM_log(\"i : \"+i+\" -> test : \"+test);\r\n\t\t\t\tsmallest = test;\r\n\t\t\t\trememberI = i;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n//\tGM_log(\"rememberI : \"+rememberI);\r\n\treturn rememberI;\r\n}" ]
[ "0.636499", "0.61789864", "0.6123739", "0.5955105", "0.5902497", "0.5876144", "0.5831905", "0.58203113", "0.5818576", "0.58150095", "0.57975554", "0.5783868", "0.57635564", "0.57235825", "0.57108873", "0.57038677", "0.5669614", "0.562856", "0.55775636", "0.55583626", "0.5532375", "0.5511226", "0.5510247", "0.55059624", "0.54924953", "0.5466117", "0.5451278", "0.54504466", "0.5447113", "0.5447113", "0.5443649", "0.54297006", "0.54250807", "0.54197997", "0.5413593", "0.53892267", "0.53875315", "0.53871006", "0.5378381", "0.5378105", "0.53767645", "0.5376222", "0.5373736", "0.5372759", "0.53547734", "0.5340265", "0.5336422", "0.53337485", "0.5330032", "0.53166544", "0.53054905", "0.5304618", "0.5298915", "0.5297045", "0.52840585", "0.5282023", "0.5281847", "0.5273759", "0.5270893", "0.5269407", "0.526793", "0.526793", "0.526793", "0.526793", "0.5267288", "0.5260297", "0.5260274", "0.5249026", "0.5248335", "0.52477294", "0.52470046", "0.5241259", "0.5237201", "0.5232472", "0.52313286", "0.5223512", "0.52196884", "0.5218402", "0.5217355", "0.5217201", "0.52163047", "0.52071095", "0.52053064", "0.51969457", "0.5187358", "0.5186461", "0.5184093", "0.51824766", "0.51803017", "0.51796466", "0.5173689", "0.5172629", "0.5172525", "0.5159609", "0.5159295", "0.5157684", "0.5156573", "0.51549035", "0.51516426", "0.51481813", "0.514212" ]
0.0
-1
O(m) time | O(1) space
contains(string) { let node = this.root for (const letter of string) { if (!(letter in node)) return false node = node[letter] } return this.endSymbol in node }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function icecreamParlor(m, arr) {\n for (let i = 0; i < arr.length - 1; i++) {\n for (let j = i+1; j < arr.length ; j++) {\n if (arr[i] + arr[j] == m) return [i+1, j+1]\n }\n }\n}", "function arrayManipulation(n, queries) {\n const acc = {};\n for (const [a, b, k] of queries) {\n acc[a] = (acc[a] || 0) + k;\n acc[b+1] = (acc[b+1] || 0) - k;\n } \n let last = 0\n let m = 0\n for (let i=0; i<n+1; i++) {\n const curr = acc[i] || 0;\n last = last + curr;\n if (last > m) {\n m = last;\n }\n }\n return m\n}", "function p(x, m) {\n let sum = 0;\n for (let k = 0; k <= m; k++) {\n sum += x[k];\n }\n return sum;\n}", "function addTo(m) {\n let sum = 0;\n for (let i = 0; i <= m; i++) {\n sum = sum + i; \n }\n return sum; \n}", "function pass (m, bs, cs) {\n const ds = bs.concat()\n\n for (let i = 0; i < cs.length && m > 0; i++) {\n if (cs[i] > 0) {\n m -= 1\n ds[i] += 1\n }\n }\n\n return ds\n }", "function matrix(m) {\n\n let n = m.length;\n\n for (let i = 0; i < Math.floor(n / 2); i++) {\n\n for (let j = 0; j < n - (2 * i) - 1; j++) {\n\n let t = m[i + j][n - 1 - i]\n m[i + j][n - 1 - i] = m[i][i + j]\n m[i][i + j] = t\n\n t = m[n - 1 - i][n - 1 - i - j]\n m[n - 1 - i][n - 1 - i - j] = m[i][i + j]\n m[i][i + j] = t\n\n t = m[n - 1 - i - j][i]\n m[n - 1 - i - j][i] = m[i][i + j]\n m[i][i + j] = t;\n\n\n }\n }\n\n return m\n\n}", "function version2(array){ // O(n)\n let map = {}\n for(let i=0; i< array.length; i++){\n if(map[array[i]] !== undefined ){ // if(0) gives undefined due to type coercion \n return array[i]\n }else{\n map[array[i]] = i\n }\n }\n console.log(map)\n return undefined\n}", "function icecreamParlor(m, arr) {\n let result = [];\n let breakCondition = false;\n for (let i = 0; i < arr.length; i++) {\n for (let j = 0 ; j < arr.length; j++) {\n if (i !== j && arr[i] + arr[j] === m) {\n result.push(i+1);\n result.push(j+1);\n breakCondition = true;\n break;\n }\n }\n if (breakCondition) break;\n }\n return result;\n}", "function example2(input) {\n let a = 5; // O(1)\n let b = 10; // O(1)\n let c = 50; // O(1)\n for (let i = 0; i < input; i++) {\n let x = i + 1; // O(n)\n let y = i + 2; // O(n)\n let z = i + 3; // O(n)\n }\n for (let j = 0; j < input; j++) {\n let p = j * 2; // O(n)\n let q = j * 2; // O(n)\n }\n let whoAmI = \"I don't know\"; // O(1)\n}", "function M(a,b){this.g=[];this.K=a;this.I=b||null;this.f=this.a=!1;this.c=void 0;this.s=this.N=this.l=!1;this.i=0;this.b=null;this.o=0}", "function M(a,b){this.g=[];this.u=a;this.s=b||null;this.f=this.a=!1;this.c=void 0;this.l=this.K=this.i=!1;this.h=0;this.b=null;this.j=0}", "function naiveSumZero(arr){ // O(n^2)\r\n for(let i = 0; i < arr.length; i++){ // O(n)\r\n for(let j = i + 1; j < arr.length; j++){ // nested O(n)\r\n if(arr[i] + arr[j] === 0){\r\n return [arr[i], arr[j]];\r\n }\r\n }\r\n }\r\n}", "function $cf838c15c8b009ba$export$2f3eb4d6eb4663c9(key) {\n const getKey = typeof key === \"string\" ? (value)=>value && typeof value === \"object\" && value[key] !== undefined ? value[key] : value : null;\n const create = (iterating)=>{\n let i = 0, j, len, nOthers, args, result, memory;\n return function() {\n if (!args) {\n args = [].sort.call(arguments, (a, b)=>a.length - b.length);\n nOthers = args.length - 1;\n result = [];\n memory = new Map();\n i = 0;\n j = 0;\n }\n for(; i <= nOthers; i++){\n //j = j===-1 ? arguments[i].length : j;\n const len = args[i].length;\n while(j < len){\n const elem = args[i][j], key = getKey ? getKey(elem) : elem;\n if (memory.get(key) === i - 1) {\n if (i === nOthers) {\n result[result.length] = elem;\n memory.set(key, 0);\n if (iterating) {\n j++;\n return {\n value: elem\n };\n }\n } else memory.set(key, i);\n } else if (i === 0) memory.set(key, 0);\n j++;\n }\n j = 0;\n }\n args = null;\n return iterating ? {\n done: true\n } : result;\n };\n };\n const intersect = create();\n intersect.iterable = function(...args) {\n const intersect = create(true);\n let started;\n return {\n next () {\n if (started) return intersect();\n started = true;\n return intersect(...args);\n },\n [Symbol.iterator] () {\n return this;\n }\n };\n };\n return intersect;\n}", "function fusion(liste)\r\n{\r\n var tempArray = liste.slice(); // Copie temporaire du tableau (liste)\r\n for(var k=0; k<size; k++)\r\n {\r\n if(tempArray[k] != null)\r\n {\r\n var l = k+1;\r\n\r\n while(tempArray[l]==null && l<=size)\r\n {\r\n l++;\r\n }\r\n\r\n if(tempArray[l] == tempArray[k])\r\n {\r\n tempArray[k] = tempArray[k]*2;\r\n tempArray[l] = null;\r\n moved = true;\r\n caseBoitesRemplies--;\r\n }\r\n\r\n k = l-1;\r\n }\r\n }\r\n\r\n var l = 0;\r\n\r\n for(var k=0; k<size; k++)\r\n {\r\n if(tempArray[k] != null)\r\n {\r\n if(l == k)\r\n l++;\r\n else\r\n {\r\n tempArray[l] = tempArray[k];\r\n tempArray[k] = null;\r\n l++;\r\n moved = true;\r\n }\r\n }\r\n }\r\n return tempArray;\r\n}", "a (a a = 0; a < a.a; ++a) {N\n a a = a[a];N\n a (a.a == a) {N\n a a = aAaAaAa(a, a.a);N\n a (!a) a.a = aAa;N\n a a (aAa) a.a = a.a == a ? a : a.a + a;N\n }N\n }", "function fastPermutatedNeedle(needle, haystack) {\n let result = []\n let length = needle.length\n let needleObject = hashTableString(needle)\n for (let i = 0; i < haystack.length - length + 1; i++) {\n if (!needleObject[haystack[i]]) {\n continue\n }\n let needleObjectCopy = shallowCopyObject(needleObject)\n let count = length\n for (let j = i; j < i + needle.length; j++) {\n if (!needleObjectCopy[haystack[j]] || needleObjectCopy[haystack[j] < 1]) {\n break\n }\n needleObjectCopy[haystack[j]]--\n count--\n }\n if (count === 0) {\n result.push(i)\n }\n }\n return result\n}", "function solution(A) {\n // write your code in JavaScript (Node.js 6.4.0)\n \n N = 100001\n var bitmap = Array(N).fill(false);\n for (var i = 0; i < A.length; i ++) {\n if (A[i] > 0 && A[i] <= N) {\n bitmap[A[i]] = true;\n }\n }\n \n for(var j = 1; j <= N; j++) {\n if (!bitmap[j]) {\n return j;\n }\n }\n \n return N + 1;\n}", "function sc_memv(o, l) {\n while (l !== null) {\n\tif (l.car === o)\n\t return l;\n\tl = l.cdr;\n }\n return false;\n}", "function twoToThe(m) {\n var b = Math.floor(m / bpe) + 2\n var t = new Array(b)\n for (var i = 0; i < b; i++) t[i] = 0\n t[b - 2] = 1 << (m % bpe)\n return t\n }", "union(n, m) {\n nId = this.id[n];\n mId = this.id[m];\n for(var i = 0; i < id.length; i++) {\n if(n[i] === nId) n[i] = mId;\n }\n }", "function compressItems(items) {\n console.log(items[0]); // O(1) --> Constant time\n}", "function findUniqueValues(arr){ //O(n) // You wrote this\r\n let uniqueVal = []; \r\n let left = 0; \r\n let right = arr.length - 1;\r\n while(left < right){ // O(n)\r\n if(!(uniqueVal.includes(arr[left]))){\r\n uniqueVal.push(arr[left]);\r\n left++;\r\n } else if(!(uniqueVal.includes(arr[right]))){\r\n uniqueVal.push(arr[right]);\r\n right--;\r\n } else if(uniqueVal.includes(arr[left])){\r\n left++;\r\n } else {\r\n right--;\r\n }\r\n }\r\n return uniqueVal.length\r\n}", "function identSize(M, m, n, k) {\n var e = M.elements;\n var i = k - 1;\n\n while(i--) {\n\tvar row = [];\n\t\n\tfor(var j = 0; j < n; j++)\n\t row.push(j == i ? 1 : 0);\n\t\n e.unshift(row);\n }\n \n for(var i = k - 1; i < m; i++) {\n while(e[i].length < n)\n e[i].unshift(0);\n }\n\n return $M(e);\n}", "function identSize(M, m, n, k) {\n var e = M.elements;\n var i = k - 1;\n\n while(i--) {\n\tvar row = [];\n\t\n\tfor(var j = 0; j < n; j++)\n\t row.push(j == i ? 1 : 0);\n\t\n e.unshift(row);\n }\n \n for(var i = k - 1; i < m; i++) {\n while(e[i].length < n)\n e[i].unshift(0);\n }\n\n return $M(e);\n}", "function identSize(M, m, n, k) {\n var e = M.elements;\n var i = k - 1;\n\n while(i--) {\n\tvar row = [];\n\t\n\tfor(var j = 0; j < n; j++)\n\t row.push(j == i ? 1 : 0);\n\t\n e.unshift(row);\n }\n \n for(var i = k - 1; i < m; i++) {\n while(e[i].length < n)\n e[i].unshift(0);\n }\n\n return $M(e);\n}", "function average_map(m) {\n\tlet sum = 0,\n\t\tcounter = 0;\n\tm.each(function(v, k) {\n\t\t// value, key this way round in .each\n\t\tsum += v;\n\t\tif (v > 0) {\n\t\t\tcounter += 1;\n\t\t}\n\t});\n\t// return m.size() ? sum / m.size() : 0;\n\treturn counter > 0 ? sum / counter : 0;\n}", "function compressBoxes(input){\n for(var i = 0; i<=100; i++){\n console.log('hi'); // O(100)\n }\n\n input.forEach(function(box){\n console.log(box); // O(n)\n })\n\n input.forEach(function(box){\n console.log(box); //O(n)\n })\n }", "function anotherFunChallenge(input) {\n let a = 5; // O(1)\n let b = 10; // O(1)\n let c = 50; // O(1)\n for (let i = 0; i < input; i++) {\n // O(n)\n let x = i + 1; // O(n)\n let y = i + 2; // O(n)\n let z = i + 3; // O(n)\n }\n for (let j = 0; j < input; j++) {\n // O(n)\n let p = j * 2; // O(n)\n let q = j * 2; // O(n)\n }\n let whoAmI = \"I don't know\"; // O(1)\n}", "lookupAndMarkFound() {\n let m=0;\n for (let n=1; n<=N; n++) {\n for (let i=0;i<N; i++) {\n let fr = this.findInRow(n,i);\n if (fr.length == 1) {\n this.markAndRemove(n,fr[0].i, fr[0].j);\n m++;\n }\n let fc = this.findInColumn(n,i);\n if (fc.length == 1) {\n this.markAndRemove(n,fc[0].i, fc[0].j);\n m++;\n }\n let fb = this.findInBlock(n,i);\n if (fb.length == 1) {\n this.markAndRemove(n,fb[0].i, fb[0].j);\n m++;\n }\n }\n }\n return m;\n }", "function min_spaces(pi, fav_arr) {\n let set = new Set(fav_arr);\n let map = new Map(); //memoisation\n let N = pi.length;\n function recurse(pos) {\n if (pos === N) return 0; //base case\n if (map.has(pos)) return map.get(pos);\n\n let ans = Infinity;\n for (let i = 1; i < N; i++) {\n let cur = pi.slice(0, i);\n if (set.has(cur)) {\n let other = recurse(i);\n if (other !== -1) ans = Math.min(ans, other + 1);\n }\n }\n map.set(pos, ans);\n return ans === Infinity ? -1 : ans;\n }\n\n return recurse(0);\n}", "function candies(n, m) {\r\n let x = m%n;\r\n return m-x;\r\n}", "function lookup_chain(m, p, i, j) {\n if (m[i][j] < Number.POSITIVE_INFINITY) {\n return m[i][j];\n }\n \n if (i == j) {\n m[i][j] = 0;\n } else {\n for (var k=i; k<j; k++) {\n var q = lookup_chain(m, p, i, k) + lookup_chain(m, p, k+1, j) + p[i]*p[k+1]*p[j+1];\n if (q < m[i][j]) {\n m[i][j] = q;\n }\n }\n }\n return m[i][j];\n}", "function change(m) {\n var result = create(m.length);\n for (var i = 0; i < m.length; i++) {\n for (var j = 0; j < m.length; j++) {\n var n = neighbors(m, i, j);\n if (m[i][j] == 0) {\n if (n == 3) {\n result[i][j] = 1;\n } else {\n result[i][j] = 0;\n }\n } else {\n if (n <= 1 || n >= 4) {\n result[i][j] = 0;\n } else {\n result[i][j] = 1;\n }\n }\n }\n }\n return result;\n}", "function op1(map, val) { // O(1)\n // insert the val into the map \n // if the val already exists in the map\n // now also have to update the frequencies map \n if (map[val]) { \n // check if map[val] we need to decrement the\n // frequency of map[val]\n // increment its value \n map[val]++;\n // increment frequecy of map[val] in the frequency map\n } else {\n // otherwise, add it to the map with a value of 1\n map[val] = 1;\n // add map[val] to our frequencies map \n }\n}", "function r(e,t){var n=i.length?i.pop():[],r=s.length?s.pop():[],a=o(e,t,n,r);return n.length=0,r.length=0,i.push(n),s.push(r),a}", "function gridTraveler(m, n) {\n\tconst table = Array.from({length: m+1}, () => Array(n+1).fill(0))\n\n\ttable[1][1] = 1\n\n\tfor (let i=0; i <= m; i++) {\n\t\tfor (let j=0; j<=n; j++) {\n\t\t\tconst current = table[i][j]\n\t\t\tif (j+1 <= n) table[i][j+1] += current\n\t\t\tif (i+1 <= m) table[i+1][j] += current\n\t\t}\n\t}\n\n\treturn table[m][n]\n}", "function numbers (){\n memory.map((each,index)=>{\n \n if(d.test(each) && d.test(memory[index+1])){\n memory.splice(index,1)\n memory[index]= each+memory[index];\n numbers()\n }\n })\n }", "function rref(M) {\n let rows = M.length;\n let columns = M[0].length;\n if (((rows === 1 || rows === undefined) && columns > 0) || ((columns === 1 || columns === undefined) && rows > 0)) {\n M = [];\n let vectorSize = Math.max(isNaN(columns) ? 0 : columns, isNaN(rows) ? 0 : rows);\n for (let i = 0; i < vectorSize; i++) {\n M.push(0);\n }\n M[0] = 1;\n return M;\n } else if (rows < 0 || columns < 0) {\n return;\n }\n\n let lead = 0;\n for (let k = 0; k < rows; k++) {\n if (columns <= lead) {\n return;\n }\n\n let i = k;\n while (M[i][lead] === 0) {\n i++;\n if (rows === i) {\n i = k;\n lead++;\n if (columns === lead) { \n return;\n }\n }\n }\n let p = M[i]\n let s = M[k];\n M[i] = s, M[k] = p;\n\n let scalar = M[k][lead];\n for (let j = 0; j < columns; j++) {\n M[k][j] /= scalar;\n }\n\n for (let i = 0; i < rows; i++) {\n if (i === k) continue;\n scalar = M[i][lead];\n for (let j = 0; j < columns; j++) {\n M[i][j] -= scalar * M[k][j];\n }\n }\n lead++;\n }\n return M;\n }", "function twoSum(arr, target) {\n let map = new Map();\n\n //loop over array to create a map\n for (let i = 0; i < arr.length; i++) {\n let pointer1 = arr[i];\n let pointer2 = target - pointer1;\n\n if (map.has(pointer2)) {\n return [i, map.get(pointer2)];\n }\n map.set(pointer1, i);\n }\n}", "function getmv(comb, m) {\n var arr = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n var r = 4;\n\n for (var i = 0; i < 12; i++) {\n if (comb >= Cnk[11 - i][r]) {\n comb -= Cnk[11 - i][r--];\n arr[i] = r << 1;\n } else {\n arr[i] = -1;\n }\n }\n\n edgeMove(arr, m);\n comb = 0, r = 4;\n var t = 0;\n var pm = [];\n\n for (var i = 0; i < 12; i++) {\n if (arr[i] >= 0) {\n comb += Cnk[11 - i][r--];\n pm[r] = arr[i] >> 1;\n t |= (arr[i] & 1) << 3 - r;\n }\n }\n\n return comb * 24 + getNPerm(pm, 4) << 4 | t;\n }", "function minimumBribes(q) {\n let totalSwaps = 0;\n let swapsCount = new Map();\n for ( let i = 1; i < q.length; i++ ) {\n if ( q[ i ] < q[ i - 1 ]) { // bribe happened, swap\n totalSwaps += 1;\n let temp = q[ i ];\n q [ i ] = q [ i - 1 ];\n q [ i - 1 ] = temp;\n const count = swapsCount.get(q[ i ]) + 1 || 1;\n if ( count > 2 ) {\n console.log('Too chaotic');\n return;\n } else {\n swapsCount.set(q[ i ], count );\n }\n i-=2;\n }\n }\n console.log(totalSwaps);\n}", "a (a a = 0; a < a.a; ++a) {N\n a a = a[a];N\n a (a.a != a) a.a += a;N\n a (a.a == a) {N\n a a = aAaAaAa(a, a.a);N\n a (!a) {N\n a.a = a;N\n a (aAa) (a || (a = [])).a(a);N\n }N\n } a {N\n a.a += a;N\n a (aAa) (a || (a = [])).a(a);N\n }N\n }", "function am1(i,x,w,j,c,n){while(--n>=0){var v=x*this[i++]+w[j]+c;c=Math.floor(v/0x4000000);w[j++]=v&0x3ffffff;}return c;}// am2 avoids a big mult-and-extract completely.", "function table_of_legal_moves1() {\n var i, j, t,\n n = 11,\n b = [],\n m = [];\n for (i = 0; i < n; i += 1) {\n b[i] = [];\n for (j = 0; j < n; j += 1) {\n b[i][j] = 0;\n }\n }\n for (j = 4; j < 7; j += 1) {\n b[2][j] = j - 3;\n }\n for (j = 3; j < 8; j += 1) {\n b[3][j] = j + 1;\n }\n for (j = 2; j < 9; j += 1) {\n b[4][j] = j + 7;\n }\n for (j = 2; j < 9; j += 1) {\n b[5][j] = j + 14;\n }\n for (j = 2; j < 9; j += 1) {\n b[6][j] = j + 21;\n }\n for (j = 3; j < 8; j += 1) {\n b[7][j] = j + 27;\n }\n for (j = 4; j < 7; j += 1) {\n b[8][j] = j + 31;\n }\n for (i = 0; i <= nfields; i += 1) {\n m[i] = [];\n }\n for (i = 0; i < n; i += 1) {\n for (j = 0; j < n; j += 1) {\n if (b[i][j]) {\n t = [];\n if (b[i - 2][j] !== 0) {\n t.push([b[i - 1][j], b[i - 2][j]]);\n }\n if (b[i + 2][j] !== 0) {\n t.push([b[i + 1][j], b[i + 2][j]]);\n }\n if (b[i][j - 2] !== 0) {\n t.push([b[i][j - 1], b[i][j - 2]]);\n }\n if (b[i][j + 2] !== 0) {\n t.push([b[i][j + 1], b[i][j + 2]]);\n }\n m[b[i][j]] = t;\n }\n }\n }\n return m;\n }", "function identSize(M, m, n, k) {\n\t\t\tvar e = M.elements;\n\t\t\tvar i = k - 1;\n\n\t\t\twhile (i--) {\n\t\t\t\t\t\tvar row = [];\n\n\t\t\t\t\t\tfor (var j = 0; j < n; j++) row.push(j == i ? 1 : 0);\n\n\t\t\t\t\t\te.unshift(row);\n\t\t\t}\n\n\t\t\tfor (var i = k - 1; i < m; i++) {\n\t\t\t\t\t\twhile (e[i].length < n) e[i].unshift(0);\n\t\t\t}\n\n\t\t\treturn $M(e);\n}", "function identSize(M, m, n, k) {\n\t\t\tvar e = M.elements;\n\t\t\tvar i = k - 1;\n\n\t\t\twhile (i--) {\n\t\t\t\t\t\tvar row = [];\n\n\t\t\t\t\t\tfor (var j = 0; j < n; j++) row.push(j == i ? 1 : 0);\n\n\t\t\t\t\t\te.unshift(row);\n\t\t\t}\n\n\t\t\tfor (var i = k - 1; i < m; i++) {\n\t\t\t\t\t\twhile (e[i].length < n) e[i].unshift(0);\n\t\t\t}\n\n\t\t\treturn $M(e);\n}", "function solution(a) { // O(N)\n let max1; // O(1)\n let max2; // O(1)\n\n for (let value of a) { // O(N)\n if (!max1) { // O(1)\n max1 = value; // O(1)\n } else if (value > max1) { // O(1)\n max2 = max1; // O(1)\n max1 = value; // O(1)\n } else if (value < max1) { // O(1)\n if (!max2) { // O(1)\n max2 = value; // O(1)\n } else if (value > max2) { // O(1)\n max2 = value; // O(1)\n }\n }\n }\n\n return max2; // O(1)\n}", "function twoSum(nums, target) {\n let visited = new Map();\n\n for (let i = 0; i < nums.length; i++) {\n let remaining = target - nums[i];\n\n if (visited.has(remaining)) {\n return [visited.get(remaining), i];\n }\n\n visited.set(nums[i], i);\n }\n}", "function mt(t){var S,I,k,_,e,u=Math.floor,C=new Array(64),A=new Array(64),T=new Array(64),F=new Array(64),y=new Array(65535),w=new Array(65535),Q=new Array(64),v=new Array(64),P=[],O=0,E=7,q=new Array(64),B=new Array(64),D=new Array(64),n=new Array(256),U=new Array(2048),b=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],j=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],R=[0,1,2,3,4,5,6,7,8,9,10,11],M=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],N=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],z=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],L=[0,1,2,3,4,5,6,7,8,9,10,11],H=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],W=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function r(t,e){for(var n=0,r=0,i=new Array,o=1;o<=16;o++){for(var s=1;s<=t[o];s++)i[e[r]]=[],i[e[r]][0]=n,i[e[r]][1]=o,r++,n++;n*=2}return i}function G(t){for(var e=t[0],n=t[1]-1;0<=n;)e&1<<n&&(O|=1<<E),n--,--E<0&&(255==O?(V(255),V(0)):V(O),E=7,O=0)}function V(t){P.push(t)}function Y(t){V(t>>8&255),V(255&t)}function X(t,e,n,r,i){for(var o,s=i[0],a=i[240],h=function(t,e){var n,r,i,o,s,a,h,c,l,u,f=0;for(l=0;l<8;++l){n=t[f],r=t[f+1],i=t[f+2],o=t[f+3],s=t[f+4],a=t[f+5],h=t[f+6];var d=n+(c=t[f+7]),p=n-c,g=r+h,m=r-h,y=i+a,w=i-a,v=o+s,b=o-s,x=d+v,S=d-v,I=g+y,k=g-y;t[f]=x+I,t[f+4]=x-I;var _=.707106781*(k+S);t[f+2]=S+_,t[f+6]=S-_;var C=.382683433*((x=b+w)-(k=m+p)),A=.5411961*x+C,T=1.306562965*k+C,F=.707106781*(I=w+m),P=p+F,O=p-F;t[f+5]=O+A,t[f+3]=O-A,t[f+1]=P+T,t[f+7]=P-T,f+=8}for(l=f=0;l<8;++l){n=t[f],r=t[f+8],i=t[f+16],o=t[f+24],s=t[f+32],a=t[f+40],h=t[f+48];var E=n+(c=t[f+56]),q=n-c,B=r+h,D=r-h,U=i+a,j=i-a,R=o+s,M=o-s,N=E+R,z=E-R,L=B+U,H=B-U;t[f]=N+L,t[f+32]=N-L;var W=.707106781*(H+z);t[f+16]=z+W,t[f+48]=z-W;var G=.382683433*((N=M+j)-(H=D+q)),V=.5411961*N+G,Y=1.306562965*H+G,X=.707106781*(L=j+D),K=q+X,J=q-X;t[f+40]=J+V,t[f+24]=J-V,t[f+8]=K+Y,t[f+56]=K-Y,f++}for(l=0;l<64;++l)u=t[l]*e[l],Q[l]=0<u?u+.5|0:u-.5|0;return Q}(t,e),c=0;c<64;++c)v[b[c]]=h[c];var l=v[0]-n;n=v[0],0==l?G(r[0]):(G(r[w[o=32767+l]]),G(y[o]));for(var u=63;0<u&&0==v[u];u--);if(0==u)return G(s),n;for(var f,d=1;d<=u;){for(var p=d;0==v[d]&&d<=u;++d);var g=d-p;if(16<=g){f=g>>4;for(var m=1;m<=f;++m)G(a);g&=15}o=32767+v[d],G(i[(g<<4)+w[o]]),G(y[o]),d++}return 63!=u&&G(s),n}function K(t){if(t<=0&&(t=1),100<t&&(t=100),e!=t){(function(t){for(var e=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],n=0;n<64;n++){var r=u((e[n]*t+50)/100);r<1?r=1:255<r&&(r=255),C[b[n]]=r}for(var i=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],o=0;o<64;o++){var s=u((i[o]*t+50)/100);s<1?s=1:255<s&&(s=255),A[b[o]]=s}for(var a=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],h=0,c=0;c<8;c++)for(var l=0;l<8;l++)T[h]=1/(C[b[h]]*a[c]*a[l]*8),F[h]=1/(A[b[h]]*a[c]*a[l]*8),h++})(t<50?Math.floor(5e3/t):Math.floor(200-2*t)),e=t}}this.encode=function(t,e){var n,r;(new Date).getTime();e&&K(e),P=new Array,O=0,E=7,Y(65496),Y(65504),Y(16),V(74),V(70),V(73),V(70),V(0),V(1),V(1),V(0),Y(1),Y(1),V(0),V(0),function(){Y(65499),Y(132),V(0);for(var t=0;t<64;t++)V(C[t]);V(1);for(var e=0;e<64;e++)V(A[e])}(),n=t.width,r=t.height,Y(65472),Y(17),V(8),Y(r),Y(n),V(3),V(1),V(17),V(0),V(2),V(17),V(1),V(3),V(17),V(1),function(){Y(65476),Y(418),V(0);for(var t=0;t<16;t++)V(j[t+1]);for(var e=0;e<=11;e++)V(R[e]);V(16);for(var n=0;n<16;n++)V(M[n+1]);for(var r=0;r<=161;r++)V(N[r]);V(1);for(var i=0;i<16;i++)V(z[i+1]);for(var o=0;o<=11;o++)V(L[o]);V(17);for(var s=0;s<16;s++)V(H[s+1]);for(var a=0;a<=161;a++)V(W[a])}(),Y(65498),Y(12),V(3),V(1),V(0),V(2),V(17),V(3),V(17),V(0),V(63),V(0);var i=0,o=0,s=0;O=0,E=7,this.encode.displayName=\"_encode_\";for(var a,h,c,l,u,f,d,p,g,m=t.data,y=t.width,w=t.height,v=4*y,b=0;b<w;){for(a=0;a<v;){for(f=u=v*b+a,d=-1,g=p=0;g<64;g++)f=u+(p=g>>3)*v+(d=4*(7&g)),w<=b+p&&(f-=v*(b+1+p-w)),v<=a+d&&(f-=a+d-v+4),h=m[f++],c=m[f++],l=m[f++],q[g]=(U[h]+U[c+256>>0]+U[l+512>>0]>>16)-128,B[g]=(U[h+768>>0]+U[c+1024>>0]+U[l+1280>>0]>>16)-128,D[g]=(U[h+1280>>0]+U[c+1536>>0]+U[l+1792>>0]>>16)-128;i=X(q,T,i,S,k),o=X(B,F,o,I,_),s=X(D,F,s,I,_),a+=32}b+=8}if(0<=E){var x=[];x[1]=E+1,x[0]=(1<<E+1)-1,G(x)}return Y(65497),new Uint8Array(P)},function(){(new Date).getTime();t||(t=50),function(){for(var t=String.fromCharCode,e=0;e<256;e++)n[e]=t(e)}(),S=r(j,R),I=r(z,L),k=r(M,N),_=r(H,W),function(){for(var t=1,e=2,n=1;n<=15;n++){for(var r=t;r<e;r++)w[32767+r]=n,y[32767+r]=[],y[32767+r][1]=n,y[32767+r][0]=r;for(var i=-(e-1);i<=-t;i++)w[32767+i]=n,y[32767+i]=[],y[32767+i][1]=n,y[32767+i][0]=e-1+i;t<<=1,e<<=1}}(),function(){for(var t=0;t<256;t++)U[t]=19595*t,U[t+256>>0]=38470*t,U[t+512>>0]=7471*t+32768,U[t+768>>0]=-11059*t,U[t+1024>>0]=-21709*t,U[t+1280>>0]=32768*t+8421375,U[t+1536>>0]=-27439*t,U[t+1792>>0]=-5329*t}(),K(t),(new Date).getTime()}()}", "function anotherFunChallenge(input) {\n let a = 5; //O(1)\n let b = 10; //O(1)\n let c = 50; //O(1)\n for (let i = 0; i < input; i++) { //* \n let x = i + 1; // O(n)\n let y = i + 2; // O(n)\n let z = i + 3; // O(n)\n\n }\n for (let j = 0; j < input; j++) { //*\n let p = j * 2; // O(n)\n let q = j * 2; // O(n)\n }\n let whoAmI = \"I don't know\"; //O(1)\n}", "function twoSumm(numbers, target) {\n const myHash = {};\n let output = []\n for (i = 0; i < numbers.length; i++) {\n const control = target - numbers[i];\n if (myHash.hasOwnProperty(numbers[i])) {\n myHash[numbers[i]].push(i);\n } else {\n myHash[numbers[i]] = [i];\n }\n if (myHash.hasOwnProperty(control) && i != myHash[control][0]) {\n output = [myHash[control][0], i];\n return output\n }\n }\n return [];\n}", "set_identity(m, n) {\r\n this.length = 0;\r\n for (let i = 0; i < m; i++) {\r\n this.push(new Array(n).fill(0));\r\n if (i < n) this[i][i] = 1;\r\n }\r\n }", "function twoSumMap(arr, goal) {\n if (!arr || arr.length <= 1) {\n return []\n }\n\n const map = new Map()\n\n let i = 0\n let j = arr.length\n\n while (i < j) {\n map.set(arr[i], i)\n map.set(arr[j], j)\n\n const difference = goal - arr[i]\n const difference2 = goal - arr[j]\n\n if (map.has(difference)) {\n return [map.get(difference), i]\n }\n if (map.has(difference2)) {\n return [map.get(difference2), j]\n }\n\n i++\n j--\n }\n\n return []\n}", "function s(beginWord, endWord, wordList) {\n // for each word find one letter transformations\n // find shortest traversal\n\n /* \n time:\n create graph, o(length of wordlist * length of wordlist * length of word), o(n2m)\n traverse, o(nm)\n => simplify, o(mn2)\n space:\n create graph, o(mn2)\n stack height, o(n)\n */\n\n const graph = makeGraph();\n let out = Infinity;\n let list;\n\n // change back to arrays\n for (let word in graph) {\n graph[word] = [...graph[word]];\n }\n\n traverse(beginWord);\n\n function traverse(word, set = new Set(), res = 0, curList = [beginWord]) {\n if (word === endWord) {\n if (res < out) {\n out = res;\n list = curList.slice();\n }\n return;\n }\n for (let nextWord of graph[word]) {\n if (!set.has(nextWord)) {\n set.add(nextWord);\n curList.push(nextWord);\n traverse(nextWord, set, res + 1, curList);\n curList.pop();\n set.delete(nextWord);\n }\n }\n }\n\n return { out, list };\n\n function makeGraph() {\n const out = {};\n for (let word of wordList) {\n if (compare(beginWord, word)) {\n out[beginWord]\n ? out[beginWord].add(word)\n : (out[beginWord] = new Set([word]));\n out[word]\n ? out[word].add(beginWord)\n : (out[word] = new Set([beginWord]));\n }\n }\n for (let word of wordList) {\n for (let nextWord of wordList) {\n if (word !== nextWord && compare(word, nextWord)) {\n out[word]\n ? out[word].add(nextWord)\n : (out[word] = new Set([nextWord]));\n out[nextWord]\n ? out[nextWord].add(word)\n : (out[nextWord] = new Set([word]));\n }\n }\n }\n return out;\n }\n\n function compare(w1, w2) {\n let diffs = 0;\n for (let i = 0; i < w1.length; i++) {\n if (w1[i] !== w2[i]) diffs++;\n }\n if (diffs <= 1) {\n return true;\n } else {\n return false;\n }\n }\n}", "function solution(A) {\n let map = []\n let index = 1;\n for(let i = 0; i < A.length + 1; i++) {\n map[A[i]] = true;\n }\n\n while( index < A.length + 1) {\n if(!map[index]) break;\n index++;\n }\n\n return index;\n}", "function x(e,t){for(;e.length>t;)delete M[e.shift()]}", "function boooo(n) {\n for (let i = 0; i < n; i++) { // O(1)\n console.log('booooo');\n }\n}", "function Multiset(arr, arr2){ \n temp = []\n index = 0\n for (i=0;i<arr.length;i++){ \n for (j=index;j<arr.length;j++){\n\n if (arr[i] == arr2[j]){\n console.log(arr[i])\n temp += arr[i]\n index = j+1\n }\n }\n \n }\n return temp\n }", "function movies (flight_time, movie_lenghts){\n let firstMovie, secondMovie = 0;\n let movieMap = new Map();\n for(let i=0; i<movie_lenghts.length; i++){\n firstMovie = movie_lenghts[i] // 210\n secondMovie = flight_time - firstMovie //300 - 210 = 90 \n if(movieMap.has(secondMovie)) {\n return true;\n }\n movieMap.set(firstMovie)\n }\n return false\n}", "function anotherFunChallenge(input) {\n let a = 5; // O(1)\n let b = 10; // O(1)\n let c = 50; // O(1)\n for (let i = 0; i < input; i++) {\n // O(n) --> numbers of inputs\n let x = i + 1; // O(n)\n let y = i + 2; // O(n)\n let z = i + 3; // O(n)\n }\n for (let j = 0; j < input; j++) {\n // O(n) --> numbers of inputs\n let p = j * 2; // O(n)\n let q = j * 2; // O(n)\n }\n let whoAmI = \"I don't know\"; // O(1)\n}", "vectorize(po,pf,n){//a,b,k\n let data=new Array();\n var pts=(pf-po)/n;\n /*push agrega un valor al array */\n\n for(i=0; i<n;++i){\n data[i]=data+pts;\n }\n\n }", "function s2(beginWord, endWord, wordList) {\n /* \n make forms hashmap\n '*ot': [ 'hot', 'dot', 'lot' ],\n 'h*t': [ 'hot' ],\n 'ho*': [ 'hot' ],\n 'd*t': [ 'dot' ],\n 'do*': [ 'dot', 'dog' ],\n '*og': [ 'dog', 'log', 'cog' ],\n 'd*g': [ 'dog' ],\n 'l*t': [ 'lot' ],\n 'lo*': [ 'lot', 'log' ],\n 'l*g': [ 'log' ],\n 'c*g': [ 'cog' ],\n 'co*': [ 'cog' ]\n */\n\n // time, o(nm2), o(length of wordlist * length of word * length of word)\n // word of m length, will appear in m forms (3 letter word will appear 3 times in the graph)\n // will be at most nm entries in graph\n // BETTER THAN ABOVE if length of wordlist is greater than the length of the word (ASSUMING ALL SAME LENGTH)\n\n // space, o(nm2)\n const graph = makeGraph();\n console.log(graph);\n\n function makeGraph() {\n const out = {};\n for (let i = 0; i < beginWord.length; i++) {\n const form = `${beginWord.substring(0, i)}*${beginWord.substring(i + 1)}`;\n out[form] ? out[form].push(beginWord) : (out[form] = [beginWord]);\n }\n for (let word of wordList) {\n for (let i = 0; i < word.length; i++) {\n const form = `${word.substring(0, i)}*${word.substring(i + 1)}`;\n out[form] ? out[form].push(word) : (out[form] = [word]);\n }\n }\n return out;\n }\n\n const set = new Set();\n set.add(beginWord);\n const q = [[beginWord, 0]];\n while (q.length) {\n console.log(q);\n const [word, level] = q.shift();\n if (word === endWord) return level;\n for (let i = 0; i < word.length; i++) {\n const form = `${word.substring(0, i)}*${word.substring(i + 1)}`;\n for (let nextWord of graph[form]) {\n if (!set.has(nextWord)) {\n set.add(nextWord);\n q.push([nextWord, level + 1]);\n }\n }\n }\n }\n}", "function twoSum(arr, n) {\n const cache = new Set();\n for (let i = 0; i < arr.length; i++) {\n if (cache.has(n - arr[i])) {\n return true;\n }\n cache.add(arr[i]);\n }\n return false;\n}", "function ps(t) {\n var e = O(t);\n return O(O(e.bh).persistence).Uo();\n}", "function find_quad (ary, s) {\n\n\tif(ary.length < 4) {\n\n\t\treturn null;\n\t}\n\telse if(ary.length === 4) {\n\n\t\tif(ary[0] + ary[1] + ary[2] + ary[3] === s) return ary;\n\t}\n\n\tvar hashTable = {}; //declare a hashtable \n\tvar tempSum = 0;\n\n\tfor(var i = 0; i < ary.length; i++) {\n\n\t\tfor(var j = i + 1; j < ary.length; j++) {\n\n\t\t\ttempSum = ary[i] + ary[j];\n\t\t\tif(!hashTable[tempSum]) {\n\t\t\t\thashTable[tempSum] = [];\n\t\t\t}\n\t\t\thashTable[tempSum].push([i , j]);\n\t\t}\n\t}\n\n\tconsole.log(hashTable);\n\n\tvar arrayA = [];\n\tvar arrayB = [];\n\tvar result = [];\n\n\tfor(key in hashTable) {\n\n\t\tif(hashTable[s - key]) {\n\n\t\t\tarrayA = hashTable[key];\n\t\t\tarrayB = hashTable[s - key];\n\t\t\tresult = checkUniqueness(arrayA, arrayB);\n\t\t\tif(result) {\n\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t}\n\t}\n\n\treturn null;\n}", "function xy2(a) {\n console.log(\"xy\");\n console.log(a.id);\n var u = Math.floor((a.id - 1) /2 / b_map[0].length );\n var d = ((a.id - 1) / 2 ) % b_map[0].length ;\n console.log(\"u\", u, \"d\", d);\n return [u, d];\n}", "function bfs(n, m, edges, s) {\n let results = []; // save the calculated [Total Length] from [start node] to each of others node.\n for (let i = 1; i <= n; i++)\n results[i] = -1;\n\n let node2Level = new Map(), queue = [s], visited = [];\n results[s] = 0;\n visited[s] = true;\n node2Level.set(s, 0);\n\n while (queue.length > 0) {\n let node = queue.shift(), children = edges.filter(e => e[0] === node || e[1] === node);\n for (let i = 0; i < children.length; i++) {\n let edge = children[i], theOtherNode = (edge[0] === node ? edge[1] : edge[0]);\n let theOtherNodeIndex = theOtherNode;\n if (visited[theOtherNodeIndex] === true)\n continue;\n\n let nodeLevel = node2Level.get(node);\n results[theOtherNodeIndex] = (nodeLevel + 1) * 6;\n node2Level.set(theOtherNodeIndex, nodeLevel + 1);\n\n queue.push(theOtherNode);\n visited[theOtherNodeIndex] = true;\n }\n }\n\n results.shift();\n results = results.filter(s => s !== 0)\n\n return results;\n}", "function A(n,t){for(;t+1<n.length;t++)n[t]=n[t+1];n.pop()}", "function triplets(arr){\n\n var map = {};\n var resArr= [];\n \n for(var i = 0;i< arr.length;i++){\n \n map[arr[i]] = 1;\n \n }\n \n \n var start = 0;\n var end = arr.length - 1;\n \n \n while(end > 0){\n \n \n if(start == end){\n \n start = 0;\n end --;\n \n }\n \n \n if((arr[start] - arr[end]) in map){\n \n var object = [arr[start],arr[end],(arr[start] - arr[end])];\n //console.log(object);\n resArr.push(object);\n \n }\n \n \n if((arr[end] - arr[start]) in map){\n \n var object = [arr[start],arr[end],(arr[start] - arr[end])];\n //console.log(object);\n \n if(arr[start] != 0 && arr[end] != 0){\n resArr.push(object);\n }\n } \n \n \n start++;\n \n \n \n \n }\n\n \n \n \n return resArr;\n \n \n\n}", "function bustOpenPairs(arr){\n for (let y = 0; y < arr.length; y++) { // Moving between items and searching arrays who have 2 items and they are the same on x.\n for (let x = 0; x < arr[y].length; x++) {\n if (typeof arr[y][x] === \"object\" && arr[y][x].length === 2) { \n for (let m = 0; m < arr[y].length; m++) {\n if (typeof arr[y][m] === \"object\" && arr[y][m].length === 2 && JSON.stringify(arr[y][m]) === JSON.stringify(arr[y][x]) && x !== m) {\n next:\n for (let k = 0; k < arr[y].length; k++) {\n if (x === k || m === k) {\n continue next;\n }\n if (typeof arr[y][k] === \"object\") { \n arr[y][k].splice(arr[y][k].indexOf(arr[y][x][0]), 1);\n arr[y][k].splice(arr[y][k].indexOf(arr[y][x][1]), 1);\n }\n }\n }\n }\n }\n }\n }\n for (let y = 0; y < arr.length; y++) { // Moving between items and searching arrays who have 2 items and they are the same on y.\n for (let x = 0; x < arr[y].length; x++) {\n if (typeof arr[y][x] === \"object\" && arr[y][x].length === 2){\n for (let m = 0; m < arr[x].length; m++) {\n if (typeof arr[m][x] === \"object\" && arr[m][x].length === 2 && JSON.stringify(arr[m][x]) === JSON.stringify(arr[y][x]) && y !== m) {\n next:\n for (let k = 0; k < arr[x].length; k++) {\n if ( y === k || m === k ) {\n continue next;\n }\n if (typeof arr[k][x] === \"object\") { \n arr[k][x].splice(arr[k][x].indexOf(arr[y][x][0]), 1);\n arr[k][x].splice(arr[k][x].indexOf(arr[y][x][1]), 1);\n }\n }\n }\n }\n }\n }\n }\n for (let y = 0; y < arr.length; y++) { // Moving between items and searching arrays who have 2 items and they are the same on squares.\n for (let x = 0; x < arr[y].length; x++) {\n if (typeof arr[y][x] === \"object\" && arr[y][x].length === 2){ \n if (x < 3 && y < 3) {\n for (let k = 0; k < 3; k++) {\n next:\n for (let m = 0; m < 3; m++) {\n if (typeof arr[k][m] !== \"object\" || typeof arr[k][m] === \"object\" && k === y && m === x) {\n continue next;\n }\n if (arr[k][m].length === 2 && JSON.stringify(arr[k][m]) === JSON.stringify(arr[y][x])) {\n for (let n = 0; n < 3; n++) {\n for (let p = 0; p < 3; p++) {\n if (JSON.stringify(arr[n][p]) !== JSON.stringify(arr[y][x]) && typeof arr[n][p] === \"object\") {\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][0]), 1);\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][1]), 1);\n } \n }\n } \n }\n }\n }\n }\n if (x >= 3 && x < 6 && y < 3) {\n for (let k = 0 ; k < 3; k++) {\n next:\n for (let m = 3; m < 6; m++) {\n if (typeof arr[k][m] !== \"object\" || typeof arr[k][m] === \"object\" && k === y && m === x) {\n continue next;\n }\n if (arr[k][m].length === 2 && JSON.stringify(arr[k][m]) === JSON.stringify(arr[y][x])) {\n for (let n = 0; n < 3; n++) {\n for (let p = 3; p < 6; p++) {\n if (JSON.stringify(arr[n][p]) !== JSON.stringify(arr[y][x]) && typeof arr[n][p] === \"object\") {\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][0]), 1);\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][1]), 1);\n }\n }\n } \n }\n }\n }\n }\n if (x >= 6 && y < 3) {\n for (let k = 0 ; k < 3; k++) {\n next:\n for (let m = 6; m < 9; m++) {\n if (typeof arr[k][m] !== \"object\" || typeof arr[k][m] === \"object\" && k === y && m === x) {\n continue next;\n }\n if (arr[k][m].length === 2 && JSON.stringify(arr[k][m]) === JSON.stringify(arr[y][x])) {\n for (let n = 0; n < 3; n++) {\n for (let p = 6; p < 9; p++) {\n if (JSON.stringify(arr[n][p]) !== JSON.stringify(arr[y][x]) && typeof arr[n][p] === \"object\") {\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][0]), 1);\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][1]), 1);\n }\n }\n } \n }\n }\n }\n }\n if (x < 3 && y >= 3 && y < 6) {\n for (let k = 3; k < 6; k++) {\n next:\n for (let m = 0; m < 3; m++) {\n if (typeof arr[k][m] !== \"object\" || typeof arr[k][m] === \"object\" && k === y && m === x) {\n continue next;\n }\n if (arr[k][m].length === 2 && JSON.stringify(arr[k][m]) === JSON.stringify(arr[y][x])) {\n for (let n = 3; n < 6; n++) {\n for (let p = 0; p < 3; p++) {\n if (JSON.stringify(arr[n][p]) !== JSON.stringify(arr[y][x]) && typeof arr[n][p] === \"object\") {\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][0]), 1);\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][1]), 1);\n }\n }\n } \n }\n }\n }\n }\n if (x >= 3 && x < 6 && y >= 3 && y < 6) {\n for (let k = 3; k < 6; k++) {\n next:\n for (let m = 3; m < 6; m++) {\n if (typeof arr[k][m] !== \"object\" || typeof arr[k][m] === \"object\" && k === y && m === x) {\n continue next;\n }\n if (arr[k][m].length === 2 && JSON.stringify(arr[k][m]) === JSON.stringify(arr[y][x])) {\n for (let n = 3; n < 6; n++) {\n for (let p = 3; p < 6; p++) {\n if (JSON.stringify(arr[n][p]) !== JSON.stringify(arr[y][x]) && typeof arr[n][p] === \"object\") {\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][0]), 1);\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][1]), 1);\n }\n }\n } \n }\n }\n }\n }\n if (x >= 6 && y >= 3 && y < 6) {\n for (let k = 3; k < 6; k++) {\n next:\n for (let m = 6; m < 9; m++) {\n if (typeof arr[k][m] !== \"object\" || typeof arr[k][m] === \"object\" && k === y && m === x) {\n continue next;\n }\n if (arr[k][m].length === 2 && JSON.stringify(arr[k][m]) === JSON.stringify(arr[y][x])) {\n for (let n = 3; n < 6; n++) {\n for (let p = 6; p < 9; p++) {\n if (JSON.stringify(arr[n][p]) !== JSON.stringify(arr[y][x]) && typeof arr[n][p] === \"object\") {\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][0]), 1);\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][1]), 1);\n }\n }\n } \n }\n }\n }\n }\n if (x < 3 && y >= 6) {\n for (let k = 6; k < 9; k++) {\n next:\n for (let m = 0; m < 3; m++) {\n if (typeof arr[k][m] !== \"object\" || typeof arr[k][m] === \"object\" && k === y && m === x) {\n continue next;\n }\n if (arr[k][m].length === 2 && JSON.stringify(arr[k][m]) === JSON.stringify(arr[y][x])) {\n for (let n = 6; n < 9; n++) {\n for (let p = 0; p < 3; p++) {\n if (JSON.stringify(arr[n][p]) !== JSON.stringify(arr[y][x]) && typeof arr[n][p] === \"object\") {\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][0]), 1);\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][1]), 1);\n }\n }\n } \n }\n }\n }\n }\n if (x >=3 && x < 6 && y >= 6) {\n for (let k = 6; k < 9; k++) {\n next:\n for (let m = 3; m < 6; m++) {\n if (typeof arr[k][m] !== \"object\" || typeof arr[k][m] === \"object\" && k === y && m === x) {\n continue next;\n }\n if (arr[k][m].length === 2 && JSON.stringify(arr[k][m]) === JSON.stringify(arr[y][x])) {\n for (let n = 6; n < 9; n++) {\n for (let p = 3; p < 6; p++) {\n if (JSON.stringify(arr[n][p]) !== JSON.stringify(arr[y][x]) && typeof arr[n][p] === \"object\") {\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][0]), 1);\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][1]), 1);\n }\n }\n } \n }\n }\n }\n }\n if (x >= 6 && y >= 6) {\n for (let k = 6; k < 9; k++) {\n next:\n for (let m = 6; m < 9; m++) {\n if (typeof arr[k][m] !== \"object\" || typeof arr[k][m] === \"object\" && k === y && m === x) {\n continue next;\n }\n if (arr[k][m].length === 2 && JSON.stringify(arr[k][m]) === JSON.stringify(arr[y][x])) {\n for (let n = 6; n < 9; n++) {\n for (let p = 6; p < 9; p++) {\n if (JSON.stringify(arr[n][p]) !== JSON.stringify(arr[y][x]) && typeof arr[n][p] === \"object\") {\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][0]), 1);\n arr[n][p].splice(arr[n][p].indexOf(arr[y][x][1]), 1);\n }\n }\n } \n }\n } \n } \n } \n } \n }\n }\n return insertZeros(arr); // Recursion.\n }", "function myCoolFunction(arrA, arrB) {\n for (let i = 0; i < arrA.length; i++) { // n\n for (let j = 0; j < arrB.length; i++) { // m\n console.log(arrA[i] + arrB[j]) // 1\n }\n }\n}", "function mergeHeaps(arr, a, b , n , m) {\n\t\tfor (var i = 0; i < n; i++) {\n\t\t\tarr[i] = a[i];\n\t\t}\n\t\tfor (var i = 0; i < m; i++) {\n\t\t\tarr[n + i] = b[i];\n\t\t}\n\t\tn = n + m;\n\n\t\t// Builds a max heap of given arr[0..n-1]\n\t\tfor (var i = parseInt(n / 2 - 1); i >= 0; i--) {\n\t\t\tmaxHeapify(arr, n, i);\n\t\t}\n\t}", "function sum(n,m) {\n let result=0;\n // let start=Number(n);\n // let end=Number(m);\n let start=+n;\n let end=+m;\n for (let i=start;i<=end;i++){\n result+=i;\n }\n return result;\n\n}", "function crossfilter_index(n, m) {\n\t return (m < 0x101\n\t ? crossfilter_array8 : m < 0x10001\n\t ? crossfilter_array16\n\t : crossfilter_array32)(n);\n\t}", "function a(e,t){var n=i.length?i.pop():[],a=o.length?o.pop():[],s=r(e,t,n,a);return n.length=0,a.length=0,i.push(n),o.push(a),s}", "function n(e,t){var n=o.length?o.pop():[],a=i.length?i.pop():[],u=r(e,t,n,a);return n.length=0,a.length=0,o.push(n),i.push(a),u}", "function twoSum(nums, target) {\n const numMap = { };\n if (!Array.isArray(nums)) {\n return [];\n }\n\n for (let i=0; i<nums.length; i++) {\n const num = nums[i];\n const diff = target - num;\n if (diff in numMap) {\n return [].concat(numMap[diff], i);\n }\n numMap[num] = i;\n console.log(numMap);\n }\n}", "function naiveSame(arr1, arr2){ // O(n^2)\r\n if(arr1.length !== arr2.length){\r\n return false;\r\n }\r\n for(let i = 0; i < arr1.length; i++){ // O(n)\r\n let correctIdx = arr2.indexOf(arr1[i] ** 2) // nested O(n)\r\n if(correctIdx === -1){\r\n return false;\r\n }\r\n arr2.splice(correctIdx, 1)\r\n }\r\n return true;\r\n}", "function op2(map, val) { // O(1)\n // delete the val from the map \n // if the val already exists in the map\n if (map[val]) {\n // decrement the old frequency of map[val]\n // decrement its value \n map[val]--;\n // increment the new frequency in map[val]\n }\n // otherwise, we don't do anything \n}", "function n(t,i){for(;i+1<t.length;i++)t[i]=t[i+1];t.pop()}", "function n(t,i){for(;i+1<t.length;i++)t[i]=t[i+1];t.pop()}", "function whichOneHasMax(m, n) {\n if(m[m.length-1] === n[n.length-1]) return 0\n if(m[m.length-1] > n[n.length-1]) return 1\n if(m[m.length-1] < n[n.length-1]) return -1\n }", "function insertionSort(m, arr) {\n\tlet i, j, key;\n\tfor (j = 2;j <= m;j++) {\n\t\tkey = arr[j];\n\t\ti = j - 1;\n\t\twhile ((i > 0) && (arr[i] > key)) {\n\t\t\tarr[i + 1] = arr[i];\n\t\t\ti = i - 1;\n\t\t}\n\t\tarr[i + 1] = key;\n\t}\n\treturn arr;\n}", "function maximumSum(a, m) {\n const moduloPrefix = [];\n const aLength = a.length;\n let curr = 0;\n for (let i = 0; i < aLength; i += 1) {\n curr = (curr + a[i] % m) % m;\n moduloPrefix[i] = curr;\n }\n let maxSum = 0;\n const sortedPrefix = [];\n for (let i = 0; i < aLength; i += 1) {\n const current = moduloPrefix[i];\n maxSum = Math.max(maxSum, current);\n const sortedPrefixLength = sortedPrefix.length;\n let low = 0;\n let high = sortedPrefixLength - 1;\n let insertAndCalculateModulo = true;\n while (low <= high) {\n const mid = parseInt((low + high) / 2);\n const midValue = sortedPrefix[mid];\n if (current > midValue) {\n low = mid + 1;\n } else if (current < midValue) {\n high = mid - 1;\n } else {\n insertAndCalculateModulo = false;\n break;\n }\n }\n if (insertAndCalculateModulo) {\n if (low <= sortedPrefixLength - 1) {\n maxSum = Math.max(maxSum, (current - sortedPrefix[low] + m) % m);\n }\n sortedPrefix.splice(low, 0, current);\n }\n }\n return maxSum;\n}", "function M(a){var b=Hc;this.l=[];this.C=b;this.B=a||null;this.j=this.g=!1;this.i=void 0;this.s=this.H=this.u=!1;this.m=0;this.h=null;this.o=0}", "function solution(arr){\n\n}", "function findDuplicate(arr) {\n \n \n}", "function uniquePaths(m, n) {\n let rows = new Array(m).fill(0)\n let matrix = rows.map((v) => new Array(n).fill(1))\n for (let i = 1; i < m; i++) {\n for (let j = 1; j < n; j++) {\n matrix[i][j] = matrix[i][j - 1] + matrix[i - 1][j]\n }\n }\n return matrix[m - 1][n - 1]\n}", "function O(t, e, n) {\n return t.length === e.length && t.every((function(t, r) {\n return n(t, e[r]);\n }));\n}", "function i$1(t,i,r){if(!t.allDirty)if(null!=t.from&&null!=t.count){const s=Math.min(t.from,i),l=Math.max(t.from+t.count,i+r)-s;t.from=s,t.count=l;}else t.from=i,t.count=r;}", "threesum1(arr) {\n\n var l = arr.length;\n for (var i = 0; i < l - 2; i++) {\n for (var j = i + 1; j < l - 1; j++) {\n for (var k = j + 1; k < l; k++) {\n if (arr[i] + arr[j] + arr[k] == 0) {\n console.log(arr[i] + \",\" + arr[j] + \",\" + arr[k] + \" is a triplet\")\n }\n\n\n }\n }\n }\n }", "function findNb(m) {\n var n = 0\n while (m > 0) m -= ++n ** 3\n return m ? -1 : n\n}", "function findNb(m) {\n let rem = m;\n let n = 0;\n while (rem > 0){\n n ++;\n rem = rem - n*n*n;\n }\n return rem === 0 ? n : -1;\n}", "_map(inputStart, inputEnd, outputStart, outputEnd, input) {\n return outputStart + ((outputEnd - outputStart) / (inputEnd - inputStart)) * (input - inputStart);\n }", "function Gn(e,t){var a=e[t];e.sort(function(e,t){return P(e.from(),t.from())}),t=d(e,a);for(var n=1;n<e.length;n++){var r=e[n],f=e[n-1];if(P(f.to(),r.from())>=0){var o=G(f.from(),r.from()),i=U(f.to(),r.to()),s=f.empty()?r.from()==r.head:f.from()==f.head;n<=t&&--t,e.splice(--n,2,new Di(s?i:o,s?o:i))}}return new Oi(e,t)}", "_updateMemo(validTeam) {\n for (let pairIdx = 0; pairIdx < validTeam.length; ++pairIdx) {\n let p1Idx = this.players.indexOf(validTeam[pairIdx].value[0]);\n let p2Idx = this.players.indexOf(validTeam[pairIdx].value[1]);\n this.memo[p1Idx][p2Idx] = 1;\n this.memo[p2Idx][p1Idx] = 1;\n }\n }", "function crossfilter_index(n, m) {\n return (m < 0x101\n ? crossfilter_array8 : m < 0x10001\n ? crossfilter_array16\n : crossfilter_array32)(n);\n}", "function gsum(x, m) {\n let rslt = 0.0;\n for (let n = 0; n <= m; n++) {\n rslt += g(x, n);\n }\n return rslt;\n}", "function dfs(a){\n if (oneM(a,end)) \n return 1;\n let min = Number.MAX_VALUE;\n \n set.forEach((b) => {\n if (oneM(a,b) && !visited.has(b)){\n visited.add(b);\n let c = dfs(b);\n if (c !== Number.MAX_VALUE){\n min = Math.min(min,c+1);\n }\n visited.delete(b);\n }\n });\n return min;\n }", "function aVeryBigSum(ar) {\n \n}", "function ex_2(myA){\n return myA.filter(x => x % 2 == 0) // O(myA.length)\n .map(a => a * a) // O(myA.length)\n .reduce((acc, x) => acc + x, 0); // O(myA.length)\n}" ]
[ "0.5633025", "0.56154114", "0.5611666", "0.5550035", "0.5469891", "0.5463774", "0.5404005", "0.53978956", "0.5367519", "0.53571314", "0.5342542", "0.52979875", "0.5296959", "0.52743644", "0.5262183", "0.51869833", "0.5144041", "0.5139094", "0.51370883", "0.51330006", "0.5117809", "0.51143414", "0.5111615", "0.5111615", "0.5111615", "0.51051646", "0.51008457", "0.5098433", "0.50946105", "0.5090189", "0.5075322", "0.50569123", "0.5049028", "0.5047448", "0.5046944", "0.5038487", "0.50352705", "0.5028809", "0.50249135", "0.50225675", "0.501567", "0.5014994", "0.50097716", "0.50005955", "0.49982512", "0.49982512", "0.4996794", "0.49921513", "0.49856746", "0.49812368", "0.49791294", "0.49770513", "0.49750537", "0.49723014", "0.497228", "0.49714714", "0.4971059", "0.4970001", "0.4967808", "0.49658498", "0.49618456", "0.49590212", "0.49583232", "0.49573746", "0.49563575", "0.49483854", "0.49446434", "0.4936781", "0.49363452", "0.49197668", "0.49191976", "0.4917306", "0.49086437", "0.4906536", "0.49064073", "0.48977762", "0.48967576", "0.48949125", "0.4890204", "0.48881876", "0.48881876", "0.48827633", "0.48816025", "0.48810577", "0.48805615", "0.48785973", "0.48782426", "0.48751828", "0.48700073", "0.4853787", "0.48507047", "0.4849471", "0.48483613", "0.48464048", "0.4844814", "0.4842507", "0.4841151", "0.48347995", "0.4831324", "0.48304722", "0.48233083" ]
0.0
-1
Create a new agent with its signing pen, from a mnemonic or a keyPair.
static async create ({ name = 'Anonymous', mnemonic, keyPair, ...args }={}) { if (mnemonic) { // if keypair doesnt correspond to the mnemonic, delete the keypair if (keyPair && mnemonic !== Bip39.encode(keyPair.privkey).data) { warn(`keypair doesn't match mnemonic, ignoring keypair`) keyPair = null } } else if (keyPair) { // if there's a keypair but no mnemonic, generate mnemonic from keyapir mnemonic = Bip39.encode(keyPair.privkey).data } else { // if there is neither, generate a new keypair and corresponding mnemonic keyPair = EnigmaUtils.GenerateNewKeyPair() mnemonic = Bip39.encode(keyPair.privkey).data } const pen = await Secp256k1Pen.fromMnemonic(mnemonic) return new this({name, mnemonic, keyPair, pen, ...args}) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function create( label, privateKey ){\n\treturn new KeyPair(label, privateKey);\n}", "function createMinerId (alias) {\n _createKey(alias, minerIdKeystorePath)\n}", "function createUser() {\nvar code = new Mnemonic();\n\n//Load a private key from a seed\nvar privateKey = code.toHDPrivateKey();\nvar hdPrivateKey = new bitcore.HDPrivateKey(privateKey.toString());\nhdPrivateKey.network = bitcore.Networks.get(\"openchain\");\nvar derivedKey = hdPrivateKey.derive(44, true).derive(64, true).derive(0, true).derive(0).derive(0);\nconsole.log(\"Passphrase is: \" + code.toString() + \"\\nWalletID: \" + derivedKey.privateKey.toAddress().toString());\n\n}", "function configureParserTACreateKeypair(parser: argparse.ArgumentParser) {\n parser.add_argument(\"tenantApiAuthenticatorKeyFilePath\", {\n help:\n \"Write the RSA private key (also containing the public key) in the \" +\n \"PKCS#8 format to this file.\",\n type: \"str\",\n metavar: \"KEYPAIR_FILE_PATH\",\n default: \"\"\n });\n}", "constructor() {\n this.keyPair = ec.genKeyPair()\n }", "async function useKey() {\n await cryptoWaitReady();\n const { keyType, keySuri } = program.opts();\n const keyring = new Keyring({ type: keyType });\n const pair = keyring.addFromUri(keySuri);\n return { keyring, pair };\n}", "function createMnemonic(walletRPC, keyIncludes) {\n\tcreateAndOpenWallet(walletRPC, TheWalletName, function(walletRPC) {\n\t\tgetMnemonic(walletRPC, keyIncludes, function(walletRPC, mnemonicOutput) {\n\t\t\tif (mnemonicOutput.keyIncluded) { return mnemonic; }\n\t\t\telse {\n\t\t\t\tfs.unlink(\"./wallets/\"+TheWalletName+\".keys\", function() { // delete previous new-wallet.key\n\t\t\t\t\tfs.unlink(\"./wallets/\"+TheWalletName, function() { // delete previous new-wallet\n\t\t\t\t\t\tcreateMnemonic(walletRPC, keyIncludes);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t});\n\t\n}", "constructor (options = {}) {\n const { network\n , name = \"\"\n , pen\n , mnemonic\n , keyPair\n , fees = SecretNetwork.Gas.defaultFees } = options\n const pubkey = encodeSecp256k1Pubkey(pen.pubkey)\n return Object.assign(this, {\n network, name, keyPair, mnemonic, pen, pubkey,\n API: new SigningCosmWasmClient(\n network.url,\n this.address = pubkeyToAddress(pubkey, 'secret'),\n this.sign = pen.sign.bind(pen),\n this.seed = EnigmaUtils.GenerateNewSeed(),\n this.fees = fees\n )\n })\n }", "static createClaimInstruction(\n programID,\n tokenProgramKey,\n authorityKey,\n playerKey,\n publisherKey,\n bankKey,\n mintKey,\n airdropKey,\n playerSPLKey,\n ) {\n const dataLayout = BufferLayout.struct([\n BufferLayout.u8(\"i\"),\n ]);\n \n const data = Buffer.alloc(dataLayout.span);\n dataLayout.encode(\n {\n i:2, // claim instruct \n },\n data,\n );\n \n let keys = [\n {pubkey: tokenProgramKey, isSigner: false, isWritable: true},\n {pubkey: authorityKey, isSigner: false, isWritable: true},\n {pubkey: playerKey, isSigner: true, isWritable: true},\n {pubkey: publisherKey, isSigner: false, isWritable: true},\n {pubkey: bankKey, isSigner: false, isWritable: true},\n {pubkey: mintKey, isSigner: false, isWritable: true},\n {pubkey: airdropKey, isSigner: false, isWritable: true},\n {pubkey: playerSPLKey, isSigner: false, isWritable: true},\n ];\n\n const trxi = new TransactionInstruction({\n keys,\n programId: programID,\n data,\n });\n return trxi;\n }", "function createKey() {\n return ec2.createKeyPair({ KeyName: `${UID}-${uuid()}` });\n}", "async function createAccount() {\n try {\n const pair = StellarSdk.Keypair.random();\n console.log(\"Requesting XLMs\");\n\n // Asking friendbot to give us some lumens on the new a/c\n await fetch(\n `https://horizon-testnet.stellar.org/friendbot?addr=${pair.publicKey()}`\n );\n\n return pair;\n } catch (e) {\n console.error(\"ERROR!\", e);\n }\n}", "mnemonic2Seed (passphrase = '') {\n let mnemonic = this.mnemonic\n if (!this.check()) {\n throw new Error('Mnemonic does not pass the check - was the mnemonic typed incorrectly? Are there extra spaces?')\n }\n if (typeof passphrase !== 'string') {\n throw new Error('passphrase must be a string or undefined')\n }\n mnemonic = mnemonic.normalize('NFKD')\n passphrase = passphrase.normalize('NFKD')\n let mbuf = new Buffer(mnemonic)\n let pbuf = Buffer.concat([new Buffer('mnemonic'), new Buffer(passphrase)])\n this.seed = Kdf.Pbkdf2(mbuf, pbuf, 2048, 64 * 8)\n return this\n }", "connect(signerOrProvider) {\n if (typeof (signerOrProvider) === \"string\") {\n signerOrProvider = new abstract_signer_lib_esm[\"b\" /* VoidSigner */](signerOrProvider, this.provider);\n }\n const contract = new (this.constructor)(this.address, this.interface, signerOrProvider);\n if (this.deployTransaction) {\n Object(properties_lib_esm[\"d\" /* defineReadOnly */])(contract, \"deployTransaction\", this.deployTransaction);\n }\n return contract;\n }", "function createSinglesigWallet(xPubKey, account, walletName, handleWallet) {\n\tvar arrDefinitionTemplate = [\"sig\", { pubkey: '$pubkey@' + device.getMyDeviceAddress() }];\n\tcreateWallet(xPubKey, account, arrDefinitionTemplate, walletName, null, handleWallet);\n}", "static createKey(issuer, paperNumber) {\n return JSON.stringify(issuer) + JSON.stringify(paperNumber);\n }", "function configureParserTACreateToken(parser: argparse.ArgumentParser) {\n parser.add_argument(\"instanceName\", {\n help:\n \"The name of the Opstrace instance to generate the token for. \" +\n \"Be sure to set it correctly, otherwise the token will not be accepted.\",\n type: \"str\",\n metavar: \"INSTANCE_NAME\"\n });\n\n parser.add_argument(\"tenantName\", {\n help:\n \"The name of the tenant to generate the token for. \" +\n \"Be sure to set it correctly, otherwise the token will not be accepted.\",\n type: \"str\",\n metavar: \"TENANT_NAME\"\n });\n\n parser.add_argument(\"tenantApiAuthenticatorKeyFilePath\", {\n help:\n \"Use the private key encoded in this file to sign the token. \" +\n \"The path must point to a PEM RSA private key file using the PKCS#1 or \" +\n \"PKCS#8 serialization format.\",\n type: \"str\",\n metavar: \"KEYPAIR_FILE_PATH\",\n default: \"\"\n });\n}", "newKey(_sesKey) {\n const shaKey = sha256.hex(_sesKey + this.shaKey);\n this.oldKey = _sesKey;\n this.reqNum++;\n this.sesKey = this.reqNum + ':2:' + shaKey;\n this.shaKey = shaKey;\n }", "function createWallet(walletRPC, walletName, chain) {\n\twalletRPC.create_wallet(walletName, '')\n\t\t.then(new_wallet => {\n\t\t\tconsole.log(\"createWallet \" + walletName + \".key success\");\n\t\t\tchain(walletRPC, walletName)\n\t\t})\n\t\t.catch(err => {\n\t\t\tconsole.error(err);\n\t\t});\n}", "async function createNewKeystrokeManager(name, dir) {\n keystrokeMgr = new KeystrokeManager(name, dir);\n\n if (!_keystrokeTriggerTimeout) {\n _keystrokeTriggerTimeout = setTimeout(() => {\n kpmMgr.sendKeystrokeData();\n _keystrokeTriggerTimeout = null;\n }, 1000 * 60);\n }\n}", "function generateAndSetKeypair() {\n var keys = peerId.create({\n bits: opts.bits\n });\n config.Identity = {\n PeerID: keys.toB58String(),\n PrivKey: keys.privKey.bytes.toString('base64')\n };\n\n writeVersion();\n }", "async instantiate(ctx) {\n console.info(\"============= START : Initialize Ledger ===========\");\n\n await ctx.stub.putState(\"instantiate\", Buffer.from(\"INIT-LEDGER\"));\n await ctx.stub.putState(allPartnersKey, Buffer.from(JSON.stringify([])));\n await ctx.stub.putState(levelKey, Buffer.from(JSON.stringify([])));\n await ctx.stub.putState(\n earnPointsTransactionsKey,\n Buffer.from(JSON.stringify([]))\n );\n await ctx.stub.putState(\n usePointsTransactionsKey,\n Buffer.from(JSON.stringify([]))\n );\n\n console.info(\"============= END : Initialize Ledger ===========\");\n }", "async function createNewContract() {\n var deploy = await LANDMARK.new()\n LANDMARK_instance = LANDMARK.at(deploy.address);\n}", "function generateWallet() {\n var account = algosdk.generateAccount();\n var mnemonic = algosdk.secretKeyToMnemonic(account.sk);\n return { account, mnemonic }\n}", "async createWalletFromKeys(name, password, address, viewKey, spendKey, daemonConnection, restoreHeight, language, saveCurrent) {\n if (restoreHeight === undefined) restoreHeight = 0;\n if (language === undefined) language = MoneroWallet.DEFAULT_LANGUAGE;\n await this.config.rpc.sendJsonRequest(\"generate_from_keys\", {\n filename: name,\n password: password,\n address: address,\n viewkey: viewKey,\n spendkey: spendKey,\n restore_height: restoreHeight,\n autosave_current: saveCurrent\n });\n this._clear();\n this.path = name;\n }", "async function main() {\n const otokenToBuy = '0xbceb20506a60a59a45109e12d245ac7e2daf2f60' // sender token\n const weth = '0xd0a1e359811322d97991e03f863a0c30c2cf029c' // signer token\n \n const swap = '0x79fb4604f2D7bD558Cda0DFADb7d61D98b28CA9f'\n const shortAction = '0xcA50033F6c3e286D9891f6658298f6EbfD9A8D43'\n \n const [, signer] = await hre.ethers.getSigners();\n\n\n // amount of otoken to buy\n const senderAmount = (0.9 * 1e8).toString()\n const collateralAmount = (0.9 * 1e18).toString()\n\n // amount of weth signer is paying\n const signerAmount = (0.1 * 1e18).toString()\n\n // use the second address derived from the mnemonic\n \n const order = createOrder({\n signer: {\n wallet: signer.address,\n token: weth,\n amount: signerAmount,\n },\n sender: {\n wallet: shortAction,\n token: otokenToBuy,\n amount: senderAmount,\n },\n expiry: parseInt((Date.now() / 1000).toString()) + 86400\n })\n\n const signedOrder = await signOrder(order, signer, swap);\n\n console.log(`signedOrder`, signedOrder)\n \n // Fill the order!\n const ShortAction = await hre.ethers.getContractFactory('ShortOTokenActionWithSwap');\n const shortActionContract = await ShortAction.attach(shortAction)\n await shortActionContract.mintAndSellOToken(collateralAmount, senderAmount, signedOrder)\n}", "fromMnemonic(mnemonic, password) {\n // if (bip39.validateMnemonic(mnemonic) == false) return false\n const seedHex = bip39.mnemonicToSeedHex(mnemonic, password);\n const hdNode = bitcoinjs_lib_1.HDNode.fromSeedHex(seedHex, this.info);\n const account = hdNode\n .deriveHardened(88)\n .deriveHardened(0)\n .deriveHardened(0);\n const keyPair = account.keyPair;\n return new Wallet_1.Wallet(keyPair, this.info);\n }", "setSigner() {\n return __awaiter(this, void 0, void 0, function* () {\n if (!this.signer) {\n throw new Error(\"Requires valid Signer options to be able to set signing method\");\n }\n let t = this.signer.type;\n switch (this.signer.type) {\n case \"key\":\n yield signer_1.importKey(this.tezos, this.signer.key.email, this.signer.key.password, this.signer.key.mnemonic.join(' '), this.signer.key.secret);\n this.signerSet = true;\n return;\n case \"secret\":\n this.tezos.setProvider({\n signer: new signer_1.InMemorySigner(this.signer.secret)\n });\n this.signerSet = true;\n return;\n case \"wallet\":\n this.tezos.setWalletProvider(this.signer.wallet);\n this.signerSet = true;\n return;\n default:\n throw new Error(`Unknown signer type passed: ${t}`);\n }\n });\n }", "function generate (opts, pwd) {\n var newKeys = minisign.keypairGen(pwd, opts)\n var keys = minisign.formatKeys(newKeys)\n var publicKey = newKeys.publicKey.toString('hex')\n\n fs.writeFile(opts.PKfile, keys.PK.toString(), opts.overwrite, (err) => {\n if (err && err.code === 'EEXIST') {\n console.log('keys already exist, use -F tag to force overwrite')\n process.exit(1)\n }\n fs.writeFile(opts.SKfile, keys.SK.toString(), opts.overwrite, (err) => {\n if (err && err.code === 'EEXIST') {\n console.log('keys already exist, use -F tag to force overwrite')\n process.exit(1)\n }\n })\n\n console.log('public key: ' + publicKey)\n console.log('public key saved to ', opts.PKfile)\n console.log('secret key encrypted and saved to ', opts.SKfile)\n })\n}", "function testCreateMerakiNetwork(){\n var data = {\n \"name\": \"Created by test function\",\n \"type\": \"wireless appliance switch\",\n \"tags\": \" new_tag \"\n };\n createMerakiNetwork(API_KEY,ORG_ID,SHARD,data);\n}", "connect(signerOrProvider) {\n if (typeof (signerOrProvider) === \"string\") {\n signerOrProvider = new __WEBPACK_IMPORTED_MODULE_2__ethersproject_abstract_signer__[\"b\" /* VoidSigner */](signerOrProvider, this.provider);\n }\n const contract = new (this.constructor)(this.address, this.interface, signerOrProvider);\n if (this.deployTransaction) {\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__ethersproject_properties__[\"a\" /* defineReadOnly */])(contract, \"deployTransaction\", this.deployTransaction);\n }\n return contract;\n }", "async function createPolkadotAddress(seedPhrase, network, curve) {\n await cryptoWaitReady()\n\n const keyring = new Keyring({\n ss58Format: Number(network.address_prefix),\n type: curve,\n })\n const newPair = keyring.addFromUri(seedPhrase)\n\n return {\n cosmosAddress: newPair.address,\n publicKey: newPair.publicKey,\n seedPhrase,\n curve,\n }\n}", "async createAnimal(stub, args) {\n console.info('============= START : Create animal ===========');\n if (args.length != 2) {\n throw new Error('Incorrect number of arguments. Expecting 2');\n }\n\n var animal = {\n owner: args[1]\n };\n\n await stub.putState(args[0], Buffer.from(JSON.stringify(animal)));\n console.info('============= END : Create animal ===========');\n }", "function createProgram(id, pubKey, code) {\n}", "function generateKeyPair() {\n \n curve.sign.publicKeyLength = 32;\n curve.sign.secretKeyLength = 64;\n curve.sign.seedLength = 32;\n curve.sign.signatureLength = 64;\n\n return curve.sign.keyPair();\n}", "makeAddress() {\n let kp = keypair();\n let addr = utils.calcAddress(kp.public);\n this.addresses[addr] = kp;\n return addr;\n }", "constructor(constructorGuard, privateKey, publicKey, parentFingerprint, chainCode, index, depth, mnemonicOrPath) {\n logger.checkNew(new.target, HDNode);\n /* istanbul ignore if */\n if (constructorGuard !== _constructorGuard) {\n throw new Error(\"HDNode constructor cannot be called directly\");\n }\n if (privateKey) {\n const signingKey = new __WEBPACK_IMPORTED_MODULE_6__ethersproject_signing_key__[\"a\" /* SigningKey */](privateKey);\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__ethersproject_properties__[\"a\" /* defineReadOnly */])(this, \"privateKey\", signingKey.privateKey);\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__ethersproject_properties__[\"a\" /* defineReadOnly */])(this, \"publicKey\", signingKey.compressedPublicKey);\n }\n else {\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__ethersproject_properties__[\"a\" /* defineReadOnly */])(this, \"privateKey\", null);\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__ethersproject_properties__[\"a\" /* defineReadOnly */])(this, \"publicKey\", __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__ethersproject_bytes__[\"b\" /* hexlify */])(publicKey));\n }\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__ethersproject_properties__[\"a\" /* defineReadOnly */])(this, \"parentFingerprint\", parentFingerprint);\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__ethersproject_properties__[\"a\" /* defineReadOnly */])(this, \"fingerprint\", __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__ethersproject_bytes__[\"i\" /* hexDataSlice */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__ethersproject_sha2__[\"b\" /* ripemd160 */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__ethersproject_sha2__[\"c\" /* sha256 */])(this.publicKey)), 0, 4));\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__ethersproject_properties__[\"a\" /* defineReadOnly */])(this, \"address\", __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__ethersproject_transactions__[\"computeAddress\"])(this.publicKey));\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__ethersproject_properties__[\"a\" /* defineReadOnly */])(this, \"chainCode\", chainCode);\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__ethersproject_properties__[\"a\" /* defineReadOnly */])(this, \"index\", index);\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__ethersproject_properties__[\"a\" /* defineReadOnly */])(this, \"depth\", depth);\n if (mnemonicOrPath == null) {\n // From a source that does not preserve the path (e.g. extended keys)\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__ethersproject_properties__[\"a\" /* defineReadOnly */])(this, \"mnemonic\", null);\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__ethersproject_properties__[\"a\" /* defineReadOnly */])(this, \"path\", null);\n }\n else if (typeof (mnemonicOrPath) === \"string\") {\n // From a source that does not preserve the mnemonic (e.g. neutered)\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__ethersproject_properties__[\"a\" /* defineReadOnly */])(this, \"mnemonic\", null);\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__ethersproject_properties__[\"a\" /* defineReadOnly */])(this, \"path\", mnemonicOrPath);\n }\n else {\n // From a fully qualified source\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__ethersproject_properties__[\"a\" /* defineReadOnly */])(this, \"mnemonic\", mnemonicOrPath);\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__ethersproject_properties__[\"a\" /* defineReadOnly */])(this, \"path\", mnemonicOrPath.path);\n }\n }", "static createRandom(options) {\n let entropy = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__ethersproject_random__[\"a\" /* randomBytes */])(16);\n if (!options) {\n options = {};\n }\n if (options.extraEntropy) {\n entropy = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__ethersproject_bytes__[\"a\" /* arrayify */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__ethersproject_bytes__[\"i\" /* hexDataSlice */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__ethersproject_keccak256__[\"a\" /* keccak256 */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__ethersproject_bytes__[\"c\" /* concat */])([entropy, options.extraEntropy])), 0, 16));\n }\n const mnemonic = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__ethersproject_hdnode__[\"d\" /* entropyToMnemonic */])(entropy, options.locale);\n return Wallet.fromMnemonic(mnemonic, options.path, options.locale);\n }", "static initialize(obj, scriptSig) { \n obj['scriptSig'] = scriptSig;\n }", "async createRequest(ctx, supplyRequestNumber, state, paid, itemId, amount, isInBudget) {\n console.info('============= START : Create SupplyRequest ===========');\n\n const supplyRequest = {\n state,\n docType: 'request',\n paid,\n itemId,\n amount,\n isInBudget\n };\n\n await ctx.stub.putState(supplyRequestNumber, Buffer.from(JSON.stringify(supplyRequest)));\n console.info('============= END : Create SupplyRequest ===========');\n }", "static createRandom(options) {\n let entropy = Object(random[\"a\" /* randomBytes */])(16);\n if (!options) {\n options = {};\n }\n if (options.extraEntropy) {\n entropy = Object(bytes_lib_esm[\"a\" /* arrayify */])(Object(bytes_lib_esm[\"e\" /* hexDataSlice */])(Object(keccak256_lib_esm[\"a\" /* keccak256 */])(Object(bytes_lib_esm[\"b\" /* concat */])([entropy, options.extraEntropy])), 0, 16));\n }\n const mnemonic = Object(hdnode_lib_esm[\"c\" /* entropyToMnemonic */])(entropy, options.locale);\n return lib_esm_Wallet.fromMnemonic(mnemonic, options.path, options.locale);\n }", "fromMnemonic() {\n\n\t\tlet keystoreFromMnemonic = async ( _mnemonic, _passwd, _index = 0, _hdpath = \"m/44'/60'/0'/0/\") => {\n\t\t\n\t\t\tlet hdwallet = Wallet.hdkey.fromMasterSeed(bip39.mnemonicToSeedSync(_mnemonic));\n\n\t\t\tlet hdpath = _hdpath;\n\n\t\t\tlet wallet = hdwallet.derivePath(_hdpath + _index).getWallet();\n\n\t\t\tconst address = wallet.getAddressString();\n\n\t\t\t/*\n\t\t\t\tWe need the async block because of this function\n\t\t\t*/\n\t\t\tconst keystore = await wallet.toV3String(_passwd)\n\t\t\t\n\t\t\tfs.writeFile( this.path + address + \".json\" , keystore, (err) => {\n\t\t\n\t\t\t\tif (err) {\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\t\t\t\tconsole.log( \"OK: \" + address )\n\t\t\t})\n\t\t}\t\n\n\t\tlet hexstoreFromMnemonic = async ( _mnemonic, _passwd, _index = 0, _hdpath = \"m/44'/60'/0'/0/\") => {\n\t\t\t\n\t\t\tlet hdwallet = Wallet.hdkey.fromMasterSeed(bip39.mnemonicToSeedSync(_mnemonic));\n\n\t\t\tlet hdpath = _hdpath;\n\n\t\t\tlet wallet = hdwallet.derivePath(_hdpath + _index).getWallet();\n\n\t\t\tconst address = wallet.getAddressString();\n\n\t\t\tconst hexstore = Buffer.from(JSON.stringify({\n\n\t\t\t\t\"secret\" : wallet.getPrivateKeyString()\n\t\t\t}));\n\n\n\t\t\tfs.writeFile( this.path + address + \"-hex.json\" , hexstore, (err) => {\n\t\t\n\t\t\t\tif (err) {\n\t\t\t\t\tthrow err;\n\t\t\t\t}\n\t\t\t\tconsole.log( \"OK: \" + address )\n\t\t\t})\n\t\t}\n\n\t\t/*\n\t\t\tCreate a schema for user entry \n\t\t*/\n\t\tvar schema = {\n\t\t\t\n\t\t\tproperties: {\n\t\t\t\n\t\t\t\toutput \t: { description : 'Select output format \\n\\t (1) v3-keystore \\n\\t (2) hexadecimal', required: true },\n\n\t\t\t\tmnemonic : { description : 'PASTE your mnemonic', hidden : true, required: true },\n\n\t\t\t\tindex \t: { description : 'ENTER wallet index', hidden : false, required: true },\n\n\t\t\t\thdpath \t: { description : 'ENTER wallet hdpath \\n\\t default m/44\\'/60\\'/0\\'/0/', hidden : false, required : false },\n\t\t\n\t\t\t\t// only ask for password if we are building a v3-keystore\n\t\t\t\tpasswd \t: { \n\n\t\t\t\t\tdescription : 'ENTER your password', \n\n\t\t\t\t\thidden: true, \n\n\t\t\t\t\trequired: true,\n\t\t\t\t\t\n\t\t\t\t\task: function() {\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn prompt.history('output').value == \"1\";\n\n\t\t\t\t\t}\n\t\t\t\t},\n\n\n\t\t\t\tverify \t: { \n\n\t\t\t\t\tdescription : 'RE-ENTER your password', \n\n\t\t\t\t\thidden: true, \n\n\t\t\t\t\trequired: true,\n\t\t\t\t\t\n\t\t\t\t\t// only ask for password if we are building a v3\n\t\t\t\t\task: function() {\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn prompt.history('output').value == \"1\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t/*\n\t\t\tStart prompt. The user inputs desired private key, followed by password\n\t\t*/\n\t\tprompt.start();\n\n\t\tprompt.get(schema, function (err, result) {\n\n\t\t\tif (err) { return onErr(err); }\n\n\n\t\t\t/*\n\t\t\t\tv3 from mnemonic mode\n\t\t\t*/\n\t\t\tif ( result.output == \"1\") {\n\n\t\t\t\tif ( result.passwd == result.verify ){\n\n\t\t\t\t\tconsole.log( \"OK: generating keystore\")\n\n\t\t\t\t\tif ( result.hdpath == \"\" ) {\n\n\t\t\t\t\t\tconsole.log( \"OK: hdpath default \\\"m/44\\'/60\\'/0\\'/0/\\\" \")\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tkeystoreFromMnemonic ( result.mnemonic, result.passwd, result.index );\n\t\t\t\t\t}\n\n\t\t\t\t\telse {\n\n\t\t\t\t\t\tconsole.log( \"OK: hdpath \\\"\" + result.hdpath + \"\\\"\")\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tkeystoreFromMnemonic ( result.mnemonic, result.passwd, result.index, result.hdpath );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\telse {\n\n\t\t\t\t\tconsole.log( \"ERROR: passwords do not match ... exiting.\")\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/*\n\t\t\t\thexadecimal from mnemonic mode\n\t\t\t*/\n\t\t\tif ( result.output == \"2\") {\n\n\t\t\t\tif ( result.hdpath == \"\" ) {\n\n\t\t\t\t\tconsole.log( \"OK: hdpath default \\\"m/44\\'/60\\'/0\\'/0/\\\" \")\n\t\t\t\t\t\n\t\t\t\t\thexstoreFromMnemonic ( result.mnemonic, result.passwd, result.index );\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse {\n\t\t\t\t\t\t\t\n\t\t\t\t\thexstoreFromMnemonic ( result.mnemonic, result.passwd, result.index, result.hdpath );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/*\n\t\t\t\tClear mnemonic from clipboard\n\t\t\t*/\n\t\t\tclipboardy.writeSync(\"\");\n\n\t\t});\n\n\t\tfunction onErr(err) {\n\t\t\tconsole.log(err);\n\t\t\treturn 1;\n\t\t}\n\t}", "construct (target, args) {\n return new target(...args)\n }", "async instantiate(ctx) {\n\t\tlog.info(\"Manufacturer Smart Contract Instantiated\");\n\t}", "async function generateKeyPair() {\n\n var key;\n\n return window.crypto.subtle.generateKey({ name: \"ECDSA\", namedCurve: \"P-256\", }, true, [\"sign\"])\n .then(function (keyPair) {\n return Promise.all([window.crypto.subtle.exportKey('jwk', keyPair.publicKey), window.crypto.subtle.exportKey('jwk', keyPair.privateKey)]);\n })\n .then(async function (exportedKeys) {\n\n const [publicKey, privateKey] = exportedKeys;\n const kid = await computeKid(publicKey);\n const newKeys = {\n \"kty\": \"EC\",\n \"kid\": kid,\n \"use\": \"sig\", \"alg\": \"ES256\", \"crv\": \"P-256\", \"x\": privateKey.x, \"y\": privateKey.y, \"d\": privateKey.d\n }\n\n await secInitKey.setValue(JSON.stringify(newKeys, null, 2));\n secInitKey.fields[0].dispatchEvent(new Event('input'));\n\n delete newKeys.d;\n await restCall('/upload-public-key', { pk: { keys: [newKeys] } }, 'POST');\n\n document.getElementById('textIssuer').value = document.location.origin + \"/issuer\";\n\n })\n .catch(function (err) {\n console.error(err);\n });\n}", "function Agent(params) {\n if (!(this instanceof Agent)) return new Agent(params);\n\n // Состояние: 0- Нет связи, 1 - связь есть, получен адрес, 2 - соединение уст-но, 3 - циклический опрос\n this.state = 0;\n\n // Номер сервисного запроса\n this.serviceReq = 0;\n\n this.assets = {\n kti: 1, // Коэф по току\n ktu: 1, // Коэф по напряжению\n ks: 1, // Коэф Кс для мгновенных мощностей, зависит от Inom, Unom\n constant: 1250, // Постоянная счетчика\n kt: (1 * 1) / (2 * 1250) // Общий коэф-т для расчета энергии\n };\n\n this.started = 0;\n\n this.address = 0; // Адрес счетчика\n this.waiting = 0; // Флаг ожидания\n this.sendTime = 0; // Время последней посылки\n}", "function generate(params) {\n try {\n var nspr4 = ctypes.open(ctypes.libraryName(\"nspr4\"));\n var PR_GetError =\n nspr4.declare(\"PR_GetError\",\n ABI,\n ctypes.int32_t);\n var nss3 = ctypes.open(ctypes.libraryName(\"nss3\"));\n var PK11_GetInternalSlot =\n nss3.declare(\"PK11_GetInternalSlot\",\n ABI,\n PK11SlotInfo.ptr);\n var PK11_FreeSlot =\n nss3.declare(\"PK11_FreeSlot\",\n ABI,\n ctypes.void_t,\n PK11SlotInfo.ptr);\n var PK11_GenerateKeyPair =\n nss3.declare(\"PK11_GenerateKeyPair\",\n ABI,\n SECKEYPrivateKey.ptr,\n PK11SlotInfo.ptr, // slot\n CK_MECHANISM_TYPE, // type\n ctypes.voidptr_t, // param\n SECKEYPublicKey.ptr.ptr, // pubk\n ctypes.bool, // isPerm\n ctypes.bool, // isSensitive\n ctypes.voidptr_t); // wincx\n var SECKEY_DestroyPublicKey =\n nss3.declare(\"SECKEY_DestroyPublicKey\",\n ABI,\n ctypes.void_t,\n SECKEYPublicKey.ptr);\n var SECKEY_DestroyPrivateKey =\n nss3.declare(\"SECKEY_DestroyPrivateKey\",\n ABI,\n ctypes.void_t,\n SECKEYPrivateKey.ptr);\n\n var slot = PK11_GetInternalSlot();\n if (!slot) {\n throw { rv: PR_GetError() || -1,\n message: \"Failed to get PK11 internal slot\" };\n }\n\n var genParams, mechanism;\n if (/^RS/.test(params.alg)) {\n const CKM_RSA_PKCS_KEY_PAIR_GEN = 0x00000000;\n var PK11RSAGenParams = ctypes.StructType(\"PK11RSAGenParams\", [\n { keySizeInBits: ctypes.int },\n { pe: ctypes.unsigned_long },\n ]);\n genParams = new PK11RSAGenParams;\n genParams.keySizeInBits = parseInt(params.alg.substr(2), 10) * 8;\n genParams.pe = 0x10001; // 65537\n mechanism = CKM_RSA_PKCS_KEY_PAIR_GEN;\n }\n var publicKey = SECKEYPublicKey.ptr();\n var privateKey = PK11_GenerateKeyPair(slot,\n mechanism,\n genParams.address(),\n publicKey.address(),\n false,\n true,\n null);\n if (privateKey.isNull()) {\n throw {rv: PR_GetError() || -1,\n message: \"No private key generated\"};\n }\n if (publicKey.isNull()) {\n throw {rv: -1,\n message: \"PK11_GnerateKeyPair returned private key without public key\"};\n }\n\n // Export the private key so we can save it.\n // TODO: figure out how we can leave it on the slot and ask for it later\n var privateKeyData = encryptPrivateKey(privateKey, \"\", nss3, nspr4, slot);\n let pubkeyData = { alg: params.alg };\n if (/^RS/.test(params.alg)) {\n pubkeyData.algorithm = \"RS\";\n pubkeyData.mod = encodeSECItem(publicKey.contents.rsa.modulus);\n pubkeyData.exp = encodeSECItem(publicKey.contents.rsa.publicExponent);\n }\n return postMessage({ rv: 0,\n pubkey: pubkeyData,\n privateKey: privateKeyData});\n } finally {\n // clean up\n if (publicKey && !publicKey.isNull())\n SECKEY_DestroyPublicKey(publicKey);\n if (privateKey && !privateKey.isNull())\n SECKEY_DestroyPrivateKey(privateKey);\n if (slot)\n PK11_FreeSlot(slot);\n if (nss3)\n nss3.close();\n if (nspr4)\n nspr4.close();\n }\n}", "static guideTone(audioContext, char, tone, mean, sd, start, duration) {\n const st = ChaoAudioProducer.getSt(tone, mean, sd, start);\n return(ChaoAudioProducer.createNode(audioContext, st, st, duration));\n }", "function createNode(key) {\n // adjacent nodes are neighbors\n const neighbors = []\n // keys identitify newly created nodes\n return {\n key,\n neighbors,\n // the addNeighbor function pushes new nodes into our array\n addNeighbor(node) {\n neighbors.push(node)\n }\n\n }\n}", "function launch(from, ...args) {\n return [\n {\n from: {\n simultaneous: [\n {\n key_code: colemak('o'), // mnemonic: \"[o]pen\")\n },\n {\n key_code: from,\n },\n ],\n simultaneous_options: {\n key_down_order: 'strict',\n key_up_order: 'strict_inverse',\n },\n },\n parameters: {\n 'basic.simultaneous_threshold_milliseconds': 100 /* Default: 1000 */,\n },\n to: [\n {\n shell_command: ['open', ...args].join(' '),\n },\n ],\n type: 'basic',\n },\n ];\n}", "function attempt8021xKeyGeneration(dev) {\n if (isAmtDeviceValid(dev) == false) return; // Device no longer exists, ignore this request.\n\n dev.amtstack.AMT_PublicKeyManagementService_GenerateKeyPair(0, 2048, function (stack, name, response, status) {\n if ((status != 200) || (response.Body['ReturnValue'] != 0)) {\n // Failed to generate a key pair\n dev.consoleMsg(\"Failed to generate the requested RSA key pair.\");\n } else {\n dev.amtstack.Enum('AMT_PublicPrivateKeyPair', function (stack, name, xresponse, status, keyInstanceId) {\n if (status != 200) {\n // Failed to get the generated key pair\n dev.consoleMsg(\"Failed to get the generated RSA key pair.\");\n } else {\n // We got the key pair\n var DERKey = null;\n for (var i in xresponse) {\n if (xresponse[i]['InstanceID'] == keyInstanceId) {\n // We found our matching DER key\n DERKey = xresponse[i]['DERKey'];\n }\n }\n if (DERKey == null) { dev.consoleMsg(\"Failed to match the generated RSA key pair.\"); return; }\n dev.consoleMsg(\"Generated a RSA key pair.\");\n var domain = parent.config.domains[dev.domainid];\n parent.DispatchEvent([domain.amtmanager['802.1x'].satellitecredentials], obj, { action: 'satellite', subaction: '802.1x-KeyPair-Response', satelliteFlags: 2, nodeid: dev.nodeid, icon: dev.icon, domain: dev.nodeid.split('/')[1], nolog: 1, reqid: dev.netAuthSatReqId, authProtocol: domain.amtmanager['802.1x'].authenticationprotocol, devname: dev.name, osname: dev.rname, DERKey: DERKey, keyInstanceId: keyInstanceId, ver: dev.intelamt.ver });\n }\n }, response.Body['KeyPair']['ReferenceParameters']['SelectorSet']['Selector']['Value']);\n }\n });\n }", "function spawnKid() {\n //randomize location\n let x = floor(random(0, 20));\n let y = floor(random(0, 10));\n //Create kid based on the variable\n let newKid = new Kid(x, y);\n //place the new kid in the kids array\n kids.push(newKid);\n}", "constructor(k,p){\n this.privatekey = k;\n this.publickey = p;\n}", "async function CreatingAVMkeypairs() {\n newAddress1 = myKeychain.makeKey();\n newAddress2 = myKeychain.makeKey();\n newAddress3 = myKeychain.makeKey();\n\n console.log(\"New Address 1: \", newAddress1)\n console.log(\"New Address 2: \", newAddress2)\n console.log(\"New Address 3: \", newAddress3)\n}", "constructor(constructorGuard, privateKey, publicKey, parentFingerprint, chainCode, index, depth, mnemonicOrPath) {\n logger.checkNew(new.target, lib_esm_HDNode);\n /* istanbul ignore if */\n if (constructorGuard !== _constructorGuard) {\n throw new Error(\"HDNode constructor cannot be called directly\");\n }\n if (privateKey) {\n const signingKey = new signing_key_lib_esm[\"a\" /* SigningKey */](privateKey);\n Object(properties_lib_esm[\"d\" /* defineReadOnly */])(this, \"privateKey\", signingKey.privateKey);\n Object(properties_lib_esm[\"d\" /* defineReadOnly */])(this, \"publicKey\", signingKey.compressedPublicKey);\n }\n else {\n Object(properties_lib_esm[\"d\" /* defineReadOnly */])(this, \"privateKey\", null);\n Object(properties_lib_esm[\"d\" /* defineReadOnly */])(this, \"publicKey\", Object(bytes_lib_esm[\"i\" /* hexlify */])(publicKey));\n }\n Object(properties_lib_esm[\"d\" /* defineReadOnly */])(this, \"parentFingerprint\", parentFingerprint);\n Object(properties_lib_esm[\"d\" /* defineReadOnly */])(this, \"fingerprint\", Object(bytes_lib_esm[\"e\" /* hexDataSlice */])(Object(sha2[\"b\" /* ripemd160 */])(Object(sha2[\"c\" /* sha256 */])(this.publicKey)), 0, 4));\n Object(properties_lib_esm[\"d\" /* defineReadOnly */])(this, \"address\", Object(transactions_lib_esm[\"c\" /* computeAddress */])(this.publicKey));\n Object(properties_lib_esm[\"d\" /* defineReadOnly */])(this, \"chainCode\", chainCode);\n Object(properties_lib_esm[\"d\" /* defineReadOnly */])(this, \"index\", index);\n Object(properties_lib_esm[\"d\" /* defineReadOnly */])(this, \"depth\", depth);\n if (mnemonicOrPath == null) {\n // From a source that does not preserve the path (e.g. extended keys)\n Object(properties_lib_esm[\"d\" /* defineReadOnly */])(this, \"mnemonic\", null);\n Object(properties_lib_esm[\"d\" /* defineReadOnly */])(this, \"path\", null);\n }\n else if (typeof (mnemonicOrPath) === \"string\") {\n // From a source that does not preserve the mnemonic (e.g. neutered)\n Object(properties_lib_esm[\"d\" /* defineReadOnly */])(this, \"mnemonic\", null);\n Object(properties_lib_esm[\"d\" /* defineReadOnly */])(this, \"path\", mnemonicOrPath);\n }\n else {\n // From a fully qualified source\n Object(properties_lib_esm[\"d\" /* defineReadOnly */])(this, \"mnemonic\", mnemonicOrPath);\n Object(properties_lib_esm[\"d\" /* defineReadOnly */])(this, \"path\", mnemonicOrPath.path);\n }\n }", "function getCosmosAddressCreator(bech32Prefix, HDPath, curve) {\n return async (seedPhrase) => {\n const { getNewWalletFromSeed } = await import(\"@lunie/cosmos-keys\")\n return getNewWalletFromSeed(seedPhrase, bech32Prefix, HDPath, curve)\n }\n}", "async createToken({\n account,\n key\n }, {\n initialAmount,\n tokenName,\n decimalUnits,\n tokenSymbol\n }) {\n if (!this.BrandedTokenFactory) {\n return;\n }\n\n initialAmount = Web3.utils.toBN(Web3.utils.toWei(\"\" + initialAmount, \"ether\"));\n // let nonce = await this.web3.eth.getTransactionCount(account);\n let result = await this._signedAndSubmit({\n from: account,\n // nonce: nonce,\n gas: this.config.gas,\n gasPrice: this.config.gasPrice,\n to: this.BrandedTokenFactory.options.address,\n data: this.BrandedTokenFactory.methods.create(initialAmount, tokenName, decimalUnits, tokenSymbol).encodeABI(),\n }, key);\n\n return result;\n }", "static create(anchoringChannel, signer) {\n return new IotaLdProofGenerator(anchoringChannel, signer);\n }", "constructor(name = \"key\") {\n this.key = createKey(name);\n }", "static async createTokenSwap(connection, payer, tokenSwapAccount, authority, tokenAccountA, tokenAccountB, poolToken, mintA, mintB, feeAccount, tokenAccountPool, swapProgramId, tokenProgramId, nonce, tradeFeeNumerator, tradeFeeDenominator, ownerTradeFeeNumerator, ownerTradeFeeDenominator, ownerWithdrawFeeNumerator, ownerWithdrawFeeDenominator, hostFeeNumerator, hostFeeDenominator, curveType, curveParameters) {\n let transaction;\n const tokenSwap = new TokenSwap(connection, tokenSwapAccount.publicKey, swapProgramId, tokenProgramId, poolToken, feeAccount, authority, tokenAccountA, tokenAccountB, mintA, mintB, new Numberu64(tradeFeeNumerator), new Numberu64(tradeFeeDenominator), new Numberu64(ownerTradeFeeNumerator), new Numberu64(ownerTradeFeeDenominator), new Numberu64(ownerWithdrawFeeNumerator), new Numberu64(ownerWithdrawFeeDenominator), new Numberu64(hostFeeNumerator), new Numberu64(hostFeeDenominator), curveType, payer);\n // Allocate memory for the account\n const balanceNeeded = await TokenSwap.getMinBalanceRentForExemptTokenSwap(connection);\n transaction = new web3_js_1.Transaction();\n transaction.add(web3_js_1.SystemProgram.createAccount({\n fromPubkey: payer.publicKey,\n newAccountPubkey: tokenSwapAccount.publicKey,\n lamports: balanceNeeded,\n space: exports.TokenSwapLayout.span,\n programId: swapProgramId,\n }));\n const instruction = TokenSwap.createInitSwapInstruction(tokenSwapAccount, authority, tokenAccountA, tokenAccountB, poolToken, feeAccount, tokenAccountPool, tokenProgramId, swapProgramId, nonce, tradeFeeNumerator, tradeFeeDenominator, ownerTradeFeeNumerator, ownerTradeFeeDenominator, ownerWithdrawFeeNumerator, ownerWithdrawFeeDenominator, hostFeeNumerator, hostFeeDenominator, curveType, curveParameters);\n transaction.add(instruction);\n await (0, send_and_confirm_transaction_1.sendAndConfirmTransaction)('createAccount and InitializeSwap', connection, transaction, payer, tokenSwapAccount);\n return tokenSwap;\n }", "function createRevocationKey (alias) {\n _createKey(alias, revocationKeystorePath)\n}", "constructor(pair,publicKey,privateKey){\n //this.balance = INITIAL_BALANCE;\n this.keyPair = pair;\n this.privateKey=privateKey;\n this.publicKey = publicKey;\n this.unspent = [];\n }", "function createAsset(mnemonic, defaultFrozen, decimals, totalIssuance, unitName, assetName, assetUrl, manager, reserve, freeze, clawback) {\n var p = new Promise(function (resolve, reject) {\n let account = algosdk.mnemonicToSecretKey(mnemonic);\n // get chain parameters for sending transactions\n algodclient.getTransactionParams().do().then((params) => {\n // use note parameter when you want to attach a string to the transaction\n let note = undefined;\n let assetMetadataHash = undefined;\n // construct the asset creation transaction \n let txn = algosdk.makeAssetCreateTxnWithSuggestedParams(account.addr, note, totalIssuance, decimals, defaultFrozen,\n manager, reserve, freeze, clawback, unitName, assetName, assetUrl, assetMetadataHash, params);\n var signedTxn = algosdk.signTransaction(txn, account.sk);\n algodclient.sendRawTransaction(signedTxn.blob).do().then((tx) => {\n waitForConfirmation(algodclient, tx.txId).then((msg) => {\n console.log(msg);\n algodclient.pendingTransactionInformation(tx.txId).do().then((ptx) => {\n // get the asset ID\n let assetId = ptx[\"asset-index\"];\n resolve(assetId);\n }).catch(reject);\n }).catch(console.log);\n }).catch(console.log);\n }).catch(reject);\n})\n return p;\n}", "getNewKeyPair()\n\t{\n\t\tvar pair = bitcoin.ECPair.makeRandom();\n\n\t\tvar result = this.db.query(\"INSERT INTO wallet_key (priv, address) VALUES ('\"+pair.toWIF()+\"', '\"+pair.getAddress()+\"')\");\n\n\t\tif (!result.success)\n\t\t\treturn {'status':0, 'error':'Cant write new key pair into DB.'};\n\n\t\treturn {'status':1, 'data':pair.getAddress()};\n\t}", "function simulateCreateContractFromTx(arweave, wallet, srcTxId, state, tags = [], target = '', winstonQty = '') {\n return __awaiter(this, void 0, void 0, function* () {\n let contractTX = yield arweave.createTransaction({ data: state }, wallet);\n if (target && winstonQty && target.length && +winstonQty > 0) {\n contractTX = yield arweave.createTransaction({\n data: state,\n target: target.toString(),\n quantity: winstonQty.toString(),\n }, wallet);\n }\n if (tags && tags.length) {\n for (const tag of tags) {\n contractTX.addTag(tag.name.toString(), tag.value.toString());\n }\n }\n contractTX.addTag('App-Name', 'SmartWeaveContract');\n contractTX.addTag('App-Version', '0.3.0');\n contractTX.addTag('Contract-Src', srcTxId);\n contractTX.addTag('Content-Type', 'application/json');\n yield arweave.transactions.sign(contractTX, wallet);\n return contractTX;\n });\n}", "attach(addressOrName) {\n return new (this.constructor)(addressOrName, this.interface, this.signer || this.provider);\n }", "attach(addressOrName) {\n return new (this.constructor)(addressOrName, this.interface, this.signer || this.provider);\n }", "function mkobj(pty) {\n return new pty.constructor()\n}", "function dashboardAgentCreate ( req, res, next ) {\n var params =\n { di: req.session.di\n , name: req.body.name\n }\n _callIX( '/agent/add', params, function ( e, result ) {\n if (e) return next( e )\n var agent =\n { 'device': jwt.handle() // CLI Agent device is created here rather than at device\n , 'handle': result.handle\n , 'sub': req.session.di // no passcode is used with CLI Agents\n }\n db.storeAgent( 'setup', agent, function (e) {\n var results =\n { 'device': agent.device\n , 'token': result.token\n }\n if (e) return next( e )\n return res.send( { 'result': results } )\n })\n })\n}", "function newHat(type, color, size){\n return {\n type: type,\n color: color,\n size: size,\n }\n}", "async createMember(stub, args) {\n console.info('============= START : Create animal ===========');\n if (args.length != 4) {\n throw new Error('Incorrect number of arguments. Expecting 4');\n }\n\n var member = {\n firstName: args[1],\n lastName: args[2],\n balance: args[3]\n };\n\n console.info(member);\n\n await stub.putState(args[0], Buffer.from(JSON.stringify(member)));\n console.info('============= END : Create animal ===========');\n }", "async createPerson(ctx, args) {\n\n args = JSON.parse(args);\n\n //create a new person\n let newPerson = await new Person(args.personID, args.firstName, args.lastName, args.dateOfBirth, args.type, args.email, args.phone);\n\n //update state with new voter\n await ctx.stub.putState(newPerson.personID, Buffer.from(JSON.stringify(newPerson)));\n\n let response = `Person with personID ${newPerson.personID} is updated in the world state`;\n return response;\n }", "function party_create(){\n\n\t//log.error('party_create for '+this.tsid);\n\n\tthis.party = apiNewGroup('party');\n\n\tthis.party.init(this);\n}", "async function generateSigningKeystore(ctx) {\n\n // Ask user for new password\n console.log('We will now generate a new signing key for you. Make sure you write down this password, as it is ' + chalk.yellow('required') + ' to upload new versions to the Play Store.')\n\n // Ask for first password\n let pass1 = await ctx.console.ask({ \n question: 'Enter new signing password:', \n type: 'password', \n validate: 'password' \n })\n \n // Ask for second password\n let pass2 = await ctx.console.ask({ \n question: 'Enter new signing password:', \n type: 'password', \n validate: ['password', inp => inp == pass1 ? true : 'Password did not match.']\n })\n\n // Generate keystore\n ctx.status('Saving keystore to ' + chalk.cyan('metadata/android.keystore'))\n let kpath = path.resolve(ctx.project.path, 'metadata/android.keystore')\n await fs.ensureDir(path.resolve(kpath, '..'))\n await ctx.runWithOutput(`keytool -genkeypair -keystore \"${kpath}\" -storepass \"${pass1}\" -alias androidreleasekey -keypass \"${pass1}\" -keyalg RSA -keysize 2048 -validity 100000 -dname \"CN=${ctx.android.packageName}\" -noprompt`)\n return pass1\n\n}", "constructor(privateKey, recipient, amount) {\n // Enter your solution here\n\n }", "function createHat(params){\n var hat = new THREE.Object3D();\n var top = params.hatTopRadius;\n var bot = params.hatBottomRadius;\n var len = params.hatLength;\n var cd = params.cylinderDetail;\n\n var hatGeometry = new THREE.CylinderGeometry(top,bot,len,cd);\n var hatMesh = new THREE.Mesh( hatGeometry, bodyHatMaterial );\n\n\n return hatMesh;\n }", "constructor(pri,pub){\n this.privatekey=pri;\n this.publickey=pub;\n}", "constructor(name, targetOrPhase, type, handler, sourceSpan, \n // TODO(FW-2095): keySpan should be required but was made optional to avoid changing VE\n handlerSpan, keySpan) {\n this.name = name;\n this.targetOrPhase = targetOrPhase;\n this.type = type;\n this.handler = handler;\n this.sourceSpan = sourceSpan;\n this.handlerSpan = handlerSpan;\n this.keySpan = keySpan;\n }", "constructor(name, targetOrPhase, type, handler, sourceSpan, \n // TODO(FW-2095): keySpan should be required but was made optional to avoid changing VE\n handlerSpan, keySpan) {\n this.name = name;\n this.targetOrPhase = targetOrPhase;\n this.type = type;\n this.handler = handler;\n this.sourceSpan = sourceSpan;\n this.handlerSpan = handlerSpan;\n this.keySpan = keySpan;\n }", "getKeyPair () {\n // Generate new random private key\n const master = bcoin.hd.generate();\n const key = master.derivePath('m/44/0/0/0/0');\n const privateKey = key.privateKey;\n\n // Derive public key from private key\n const keyring = bcoin.KeyRing.fromPrivate(privateKey);\n const publicKey = keyring.publicKey;\n\n return {\n publicKey: publicKey,\n privateKey: privateKey\n };\n }", "static fromString(mnemonic) {\n return new Mnemonic(mnemonic.split(\" \"));\n }", "enterPair(ctx) {\n }", "function sendPaymentTransaction(mnemonic, to, amount) {\n var p = new Promise(function (resolve) {\n let account = algosdk.mnemonicToSecretKey(mnemonic);\n // use closeRemainderTo paramerter when you want to close an account\n let closeRemainderTo = undefined;\n // use note parameter when you want to attach a string to the transaction\n let note = undefined;\n algodclient.getTransactionParams().do().then((params) => {\n let txn = algosdk.makePaymentTxnWithSuggestedParams(account.addr, to, amount, closeRemainderTo, note, params);\n // sign the transaction\n var signedTxn = algosdk.signTransaction(txn, account.sk);\n algodclient.sendRawTransaction(signedTxn.blob).do().then((tx) => {\n waitForConfirmation(algodclient, tx.txId)\n .then(resolve)\n .catch(console.log);\n }).catch(console.log);\n }).catch(console.log);\n })\n return p;\n}", "static createAirdropInstruction(\n programID,\n publisherKey,\n bankKey,\n mintKey,\n airdropKey,\n authKey,\n amount,\n count,\n nonce,\n names\n ) {\n\n const dataLayout = BufferLayout.struct([\n BufferLayout.u8(\"i\"),\n BufferLayout.blob(8,\"amount\"),\n BufferLayout.blob(8,\"count\"),\n BufferLayout.u8(\"nonce\"),\n ]);\n \n const data = Buffer.alloc(dataLayout.span+count*32);\n dataLayout.encode(\n {\n i:1, // airdrop instruct \n amount:new u64(amount).toBuffer(),\n count:new u64(count).toBuffer(),\n nonce:nonce,\n },\n data,\n );\n console.log(\"names:\", names)\n\n for (let i=0; i<count; i++) {\n names[i].copy(data,dataLayout.span+i*32)\n }\n console.log(\"data is \", data)\n \n let keys = [\n {pubkey: publisherKey, isSigner: true, isWritable: true},\n {pubkey: bankKey, isSigner: false, isWritable: true},\n {pubkey: mintKey, isSigner: false, isWritable: true},\n {pubkey: airdropKey, isSigner: false, isWritable: true},\n {pubkey: authKey, isSigner: false, isWritable: true},\n ];\n\n const trxi = new TransactionInstruction({\n keys,\n programId: programID,\n data,\n });\n return trxi;\n }", "constructor(identityStore, privateKeyStore, identityId, agentId, privateKeyId) {\n this._identityStore = identityStore;\n this._identityId = identityId;\n this._agentId = agentId;\n this._privateKeyStore = privateKeyStore;\n this._privateKeyId = privateKeyId;\n }", "function makePerson(name, bday, ssn){\n return {name: name, birthday: bday, ssn: ssn};\n }", "AddKey() {}", "function createAddressAction(payload, key) {\n const action = {\n type: ApiConstants.API_CREATE_SHOP_SETTING_ADDRESS_LOAD,\n payload,\n key,\n };\n return action;\n}", "function mkAssociateBroker(emailAddress, source)\n{\n\tvar hash = getHash(key+emailAddress);\n\tif (isFunction())mktoMunchkinFunction('associateLead',{Email: emailAddress,LeadSourceDetail:source,\n\tCallbackrequested: false,IsBroker:true },hash);\n}", "async createAnimal(stub, args) {\n console.info('============= START : Create animal ===========');\n if (args.length != 7) {\n throw new Error('Incorrect number of arguments. Expecting 7 arguments');\n }\n\n var animalListing = {\n reservePrice: args[1],\n description: args[2],\n listingState: args[3],\n offers: args[4],\n animal: args[5],\n species: args[6],\n };\n\n await stub.putState(args[0], Buffer.from(JSON.stringify(animalListing)));\n console.info('============= END : Create animal ===========');\n }", "function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {\n return {\n targetUri: targetUri,\n targetRange: targetRange,\n targetSelectionRange: targetSelectionRange,\n originSelectionRange: originSelectionRange\n };\n }", "function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {\n return {\n targetUri: targetUri,\n targetRange: targetRange,\n targetSelectionRange: targetSelectionRange,\n originSelectionRange: originSelectionRange\n };\n }", "function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {\n return {\n targetUri: targetUri,\n targetRange: targetRange,\n targetSelectionRange: targetSelectionRange,\n originSelectionRange: originSelectionRange\n };\n }", "function create(params) {\n var loan = new RequestLoan();\n loan.resource = params.resource;\n loan.user = params.user;\n return loan;\n}", "function createPerson(firstName, lastName, age) {\n return {\n firstName: firstName,\n lastName: lastName,\n age: age\n }\n}", "constructor (p2pKey: P2PSigningPrivateKey) { // eslint-disable-line no-undef\n this._key = p2pKey\n this.publicKey = new PublicSigningKey(p2pKey.public)\n }", "defaults(keyPair = {}) {\n return {\n name: this.setup.gen.string({ prefix: 'test-key-pair' }),\n desc: this.setup.gen.description(),\n ...keyPair,\n };\n }", "function createPoint (self) {\n console.log('Creazione traiettoria');\n //definizione key frames con un tap, giusto per provare\n console.log('Hai creato un key frame, creati: ' + (targetObject.keyFrames.length + 1));\n //salvataggio posizine come primo valore del key frame\n let keyFrame = [{\n name: 'animation__position',\n values: {\n property: 'position',\n dur: targetObject.keyFrames.length !== 0? self.data.duration/targetObject.keyFrames.length: self.data.duration,\n easing: self.data.interpolation,\n from: targetObject.keyFrames.length !== 0? targetObject.keyFrames[targetObject.keyFrames.length - 1][0].values.to: stringify(initialValues.position),\n to: stringify(targetObject.aframeEl.getAttribute('position')),\n delay: targetObject.keyFrames.length === 0? self.data.delay: 0,\n loop: 1,\n startEvents: 'start',\n pauseEvents: 'stop',\n resumeEvents: 'resume'\n }\n }];\n targetObject.keyFrames.push(keyFrame);\n createClone(self);\n if (targetObject.keyFrames.length > 2) {\n for(let i = 0; i < targetObject.keyFrames[0].length; i++)\n targetObject.aframeEl.setAttribute(targetObject.keyFrames[0][i].name, targetObject.keyFrames[0][i].values);\n targetObject.aframeEl.emit('trajectoryCreated');\n }\n}", "static createInstance(nodeID, vehicleNumber, tvalue) {\n return new Trust({ nodeID, vehicleNumber, tvalue });\n }", "function hzNew(callee) {\n\t\tconst seqExp = hzCall(callee);\n\t\tseqExp.expressions[0].argument.callee.property.name = \"new\";\n\t\treturn seqExp;\n\t}", "function MakePerson(name, birthday, ssn) {\n var newPerson = {};\n newPerson[\"name\"] = name;\n newPerson[\"birthday\"] = birthday;\n newPerson[\"ssn\"] = ssn;\n\n return newPerson;\n}" ]
[ "0.5653055", "0.5348549", "0.51183164", "0.5073282", "0.47861168", "0.47482783", "0.4725499", "0.46971315", "0.467273", "0.46564057", "0.46455765", "0.4637237", "0.4627807", "0.46194184", "0.45636174", "0.45481858", "0.45250797", "0.45062736", "0.45048594", "0.4501839", "0.44973618", "0.4494878", "0.44905484", "0.44851682", "0.44597957", "0.44595551", "0.4430661", "0.44002816", "0.43874705", "0.4371637", "0.43678573", "0.4359461", "0.43489662", "0.43371382", "0.4335608", "0.4330119", "0.4322436", "0.4313034", "0.43096584", "0.43006042", "0.42899364", "0.42889214", "0.42887217", "0.42798802", "0.42725852", "0.42720014", "0.42716646", "0.42658707", "0.42539194", "0.42538735", "0.42511386", "0.4244322", "0.4242121", "0.4241965", "0.42324248", "0.4227743", "0.4219698", "0.42145002", "0.4212015", "0.42085123", "0.42077392", "0.419296", "0.41910008", "0.4188025", "0.41859645", "0.41859645", "0.41713798", "0.4169654", "0.41663983", "0.416422", "0.41492704", "0.41489372", "0.4140273", "0.41397163", "0.41361156", "0.41356194", "0.41315472", "0.41315472", "0.4125256", "0.41249287", "0.41243404", "0.4120077", "0.4119552", "0.41195294", "0.41193014", "0.41133866", "0.41105923", "0.4108427", "0.41077423", "0.41043535", "0.41043535", "0.41043535", "0.40990686", "0.40892184", "0.40887153", "0.40863734", "0.4086161", "0.40853485", "0.40819612", "0.40814045" ]
0.70333385
0
Create a new agent from a signing pen.
constructor (options = {}) { const { network , name = "" , pen , mnemonic , keyPair , fees = SecretNetwork.Gas.defaultFees } = options const pubkey = encodeSecp256k1Pubkey(pen.pubkey) return Object.assign(this, { network, name, keyPair, mnemonic, pen, pubkey, API: new SigningCosmWasmClient( network.url, this.address = pubkeyToAddress(pubkey, 'secret'), this.sign = pen.sign.bind(pen), this.seed = EnigmaUtils.GenerateNewSeed(), this.fees = fees ) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static async create ({ name = 'Anonymous', mnemonic, keyPair, ...args }={}) {\n if (mnemonic) {\n // if keypair doesnt correspond to the mnemonic, delete the keypair\n if (keyPair && mnemonic !== Bip39.encode(keyPair.privkey).data) {\n warn(`keypair doesn't match mnemonic, ignoring keypair`)\n keyPair = null\n }\n } else if (keyPair) {\n // if there's a keypair but no mnemonic, generate mnemonic from keyapir\n mnemonic = Bip39.encode(keyPair.privkey).data\n } else {\n // if there is neither, generate a new keypair and corresponding mnemonic\n keyPair = EnigmaUtils.GenerateNewKeyPair()\n mnemonic = Bip39.encode(keyPair.privkey).data\n }\n const pen = await Secp256k1Pen.fromMnemonic(mnemonic)\n return new this({name, mnemonic, keyPair, pen, ...args})\n }", "function dashboardAgentCreate ( req, res, next ) {\n var params =\n { di: req.session.di\n , name: req.body.name\n }\n _callIX( '/agent/add', params, function ( e, result ) {\n if (e) return next( e )\n var agent =\n { 'device': jwt.handle() // CLI Agent device is created here rather than at device\n , 'handle': result.handle\n , 'sub': req.session.di // no passcode is used with CLI Agents\n }\n db.storeAgent( 'setup', agent, function (e) {\n var results =\n { 'device': agent.device\n , 'token': result.token\n }\n if (e) return next( e )\n return res.send( { 'result': results } )\n })\n })\n}", "async instantiate(ctx) {\n console.info(\"============= START : Initialize Ledger ===========\");\n\n await ctx.stub.putState(\"instantiate\", Buffer.from(\"INIT-LEDGER\"));\n await ctx.stub.putState(allPartnersKey, Buffer.from(JSON.stringify([])));\n await ctx.stub.putState(levelKey, Buffer.from(JSON.stringify([])));\n await ctx.stub.putState(\n earnPointsTransactionsKey,\n Buffer.from(JSON.stringify([]))\n );\n await ctx.stub.putState(\n usePointsTransactionsKey,\n Buffer.from(JSON.stringify([]))\n );\n\n console.info(\"============= END : Initialize Ledger ===========\");\n }", "function party_create(){\n\n\t//log.error('party_create for '+this.tsid);\n\n\tthis.party = apiNewGroup('party');\n\n\tthis.party.init(this);\n}", "static create(anchoringChannel, signer) {\n return new IotaLdProofGenerator(anchoringChannel, signer);\n }", "function createMinerId (alias) {\n _createKey(alias, minerIdKeystorePath)\n}", "function chaser_create(pos, target_entity) {\n var coords = map_get_tile_coords(pos.row, pos.col);\n\n // creates an entity\n var entity = entity_manager_create_entity();\n\n // attaches the components\n physics_component_add(entity, coords, 0, physics_create_circular_shape(3.5));\n robot_move_component_add(entity, false, 30, Math.PI, false);\n ai_straight_chase_component_add(entity, target_entity);\n sprite_component_add(entity, SPRITES.chaser, false);\n point_at_component_add(entity, target_entity, 0.5);\n entity_manager_add_component(entity, COMPONENT.PLAYER_KILLER_TAG, {});\n\n return entity;\n}", "async createAnimal(stub, args) {\n console.info('============= START : Create animal ===========');\n if (args.length != 2) {\n throw new Error('Incorrect number of arguments. Expecting 2');\n }\n\n var animal = {\n owner: args[1]\n };\n\n await stub.putState(args[0], Buffer.from(JSON.stringify(animal)));\n console.info('============= END : Create animal ===========');\n }", "connect(signerOrProvider) {\n if (typeof (signerOrProvider) === \"string\") {\n signerOrProvider = new abstract_signer_lib_esm[\"b\" /* VoidSigner */](signerOrProvider, this.provider);\n }\n const contract = new (this.constructor)(this.address, this.interface, signerOrProvider);\n if (this.deployTransaction) {\n Object(properties_lib_esm[\"d\" /* defineReadOnly */])(contract, \"deployTransaction\", this.deployTransaction);\n }\n return contract;\n }", "create_agents() {\n for (let i = 0; i < this.total_agents; i++) {\n let agent = new Agent({\n id: i + 1,\n pos: Math.random()\n });\n this.agents.push(agent);\n }\n }", "newAnt(pos) {\n let ant = Object.create(antBrain);\n ant.setBoundaries(0, antsInterface.dimensions.width, antsInterface.dimensions.height, 0, antsInterface.cellSize);\n ant.setPosition(pos);\n antsController.ants.push(ant);\n antsInterface.drawAnt(ant.position); // waarde meegeven?\n antsInterface.updateAntsCount(antsController.ants.length);\n }", "function createBadge() {\n badges = game.add.physicsGroup();\n let badge = badges.create(750, 400, 'badge');\n badge.animations.add('spin');\n badge.animations.play('spin', 10, true);\n}", "function createBadge() {\n badges = game.add.physicsGroup();\n var badge = badges.create(750, 400, 'badge');\n badge.animations.add('spin');\n badge.animations.play('spin', 10, true);\n}", "function Agent(params) {\n if (!(this instanceof Agent)) return new Agent(params);\n\n // Состояние: 0- Нет связи, 1 - связь есть, получен адрес, 2 - соединение уст-но, 3 - циклический опрос\n this.state = 0;\n\n // Номер сервисного запроса\n this.serviceReq = 0;\n\n this.assets = {\n kti: 1, // Коэф по току\n ktu: 1, // Коэф по напряжению\n ks: 1, // Коэф Кс для мгновенных мощностей, зависит от Inom, Unom\n constant: 1250, // Постоянная счетчика\n kt: (1 * 1) / (2 * 1250) // Общий коэф-т для расчета энергии\n };\n\n this.started = 0;\n\n this.address = 0; // Адрес счетчика\n this.waiting = 0; // Флаг ожидания\n this.sendTime = 0; // Время последней посылки\n}", "function Agent(hero) {\n \"use strict\";\n // the line below must NOT be changed\n // allows information from the game NPC\n this.hero = hero; // pointer to the NPC\n}", "constructor( o , pos){\n\n if(o)\n {\n this.configure(o, this)\n return;\n }\n\n this.uid = LS.generateUId('agent'); \n\t\tthis.num_id = Object.keys(AgentManager.agents).length;\n\n this.btree = null;\n this.blackboard = blackboard;\n this.hbtgraph = \"by_default\";\n this.t_pose_config = vec3.create(0,0,0);\n\n this.path = null; \n\t\tthis.r_path = null;\n\t\t\n this.skeletal_animations = {};\n\n this.properties = {\n name: \"Jim-\" + guidGenerator(),\n\t\t\t// happiness:0,\n\t\t\t// energy:0,\n // relax:0,\n valence:0,\n arousal:0,\n age: 35,\n\t\t\tstrength:30,\n hurry: 25,\n money:20,\n hungry:25,\n umbrella: false,\n\t\t\tgun:false,\n\t\t\thealth:100,\n target: null, // this.path[0], \n look_at_pos: null, \n position: pos, \n orientation: [0,0,0,1]\n };\n this.updateLogProperties()\n\t\tvar sk_pos = pos || [0,0,-1600];\n\t\tthis.properties.initial_pos = pos;\n\t\tthis.scene_node = new RD.SceneNode();\n this.scene_node.uniforms[\"u_selected\"] = false;\n this.scene_node.uniforms[\"u_Skinning\"] = true;\n this.scene_node.uniforms[\"u_metalness\"] = 1;\n this.scene_node.uniforms[\"u_roughness\"] = 1;\n\t\tthis.scene_node.mesh = \"Jim.mesh\";\n\t\tthis.scene_node.shader = \"pbr\";\n\t\tthis.scene_node.phase = Math.random();\n\t\tthis.scene_node.id = LS.generateUId('scene_node');\n\t\tthis.scene_node.phase = Math.random();\n\t\tthis.scene_node.scaling = 1 + Math.random()*0.2;\n\t\tthis.scene_node.position = sk_pos;\n\t\t// this.scene_node.rotate(Math.random() * 360 * DEG2RAD,RD.UP);\n\t\tthis.scene_node.color = [0.5 + Math.random()*0.5,0.5 + Math.random()*0.5,0.5 + Math.random()*0.5,1];\n GFX.scene.root.addChild(this.scene_node);\n \n PBR.setTextureProperties(this.scene_node);\n PBR.setTextures(this.scene_node, GFX.environment);\n\n\t\tthis.animationBlender = new AnimationBlender();\n\t\tvar anim = animation_manager.animations[\"animations_ybot\"];\n\t\tthis.animationBlender.main_skeletal_animation = anim;\n\n\t\tvar duration = this.animationBlender.main_skeletal_animation.duration;\n\t\tthis.animationBlender.current_time = this.scene_node.phase*duration;\n\n\t\tthis.scene_node.bones = anim.skeleton.computeFinalBoneMatrices( this.scene_node.bones, gl.meshes[ this.scene_node.mesh ] );\n\t\tif(this.scene_node.bones && this.scene_node.bones.length)\n\t\t\tthis.scene_node.uniforms.u_bones = this.scene_node.bones;\n \n this.stylizer = new PoseStylizer();\n //Store agents \n this.bt_info = { running_data: {} };\n AgentManager.agents[this.uid] = this;\n\t\tAgentManager.addPropertiesToLog(this.properties);\n }", "function Agent(options) {\n if (!(this instanceof Agent)) {\n return new Agent(options);\n }\n AgentBase.call(this);\n this.jar = new CookieJar();\n\n if (options) {\n if (options.ca) {this.ca(options.ca);}\n if (options.key) {this.key(options.key);}\n if (options.pfx) {this.pfx(options.pfx);}\n if (options.cert) {this.cert(options.cert);}\n }\n}", "function makeAsteroid(x, y) {\r\n var asteroid;\r\n asteroid = Object.create(Asteroid);\r\n\tasteroid.ID = Namer.NewAsteroidID();\r\n\tasteroid.body = makeAsteroidBody(x, y, asteroid);\r\n\tmakeAsteroidMesh(asteroid);\r\n\tasteroid.updateMesh();\r\n asteroid.currentHP = asteroid.maxHP;\r\n return asteroid;\r\n}", "static new(plant) {\n let b = new this(plant);\n // Define the coordinates of the bullet\n switch (plant.section) {\n case \"peashooter\":\n b.x = plant.x + 30;\n b.y = plant.y;\n break;\n case \"repeater\":\n b.x = plant.x + 30;\n b.y = plant.y;\n break;\n case \"gatlingpea\":\n b.x = plant.x + 30;\n b.y = plant.y + 10;\n break;\n }\n return b;\n }", "setSigner() {\n return __awaiter(this, void 0, void 0, function* () {\n if (!this.signer) {\n throw new Error(\"Requires valid Signer options to be able to set signing method\");\n }\n let t = this.signer.type;\n switch (this.signer.type) {\n case \"key\":\n yield signer_1.importKey(this.tezos, this.signer.key.email, this.signer.key.password, this.signer.key.mnemonic.join(' '), this.signer.key.secret);\n this.signerSet = true;\n return;\n case \"secret\":\n this.tezos.setProvider({\n signer: new signer_1.InMemorySigner(this.signer.secret)\n });\n this.signerSet = true;\n return;\n case \"wallet\":\n this.tezos.setWalletProvider(this.signer.wallet);\n this.signerSet = true;\n return;\n default:\n throw new Error(`Unknown signer type passed: ${t}`);\n }\n });\n }", "function startOath(sender_psid, email){\n DatabaseUtils.insertEmail(sender_psid, email, null);\n RetreiveUrl.getAuthorizationUrl((err, url) => {\n let response = {\n \"attachment\":{\n \"type\":\"template\",\n \"payload\":{\n \"template_type\":\"button\",\n \"text\": \"Setup \"+email,\n \"buttons\":[\n {\n \"type\":\"web_url\",\n \"url\": url,\n \"title\":\"Authenticate\",\n }\n ]\n }\n }\n };\n sendMessage(sender_psid, response);\n })\n}", "function setupSignaturePad() {\n var signaturePad = new SignaturePad(_signature_pad[0], {\n penColor: '#0000ff',\n onEnd: function() {\n _sig = signaturePad.toDataURL();\n _form_signature.val(_sig);\n }\n });\n signaturePad.fromDataURL(_form_signature.val());\n }", "async function createNewContract() {\n var deploy = await LANDMARK.new()\n LANDMARK_instance = LANDMARK.at(deploy.address);\n}", "createLaser() {\n this.lasers.push(new Laser(this.player));\n }", "enterA45(ctx) {\n\t}", "constructor ({personId, name, agent}) {\n super({personId, name}); // invoke Person constructor\n // assign additional properties\n if (agent) this.agent = agent;\n }", "create(puppy) {\n return http.post('/newPuppy', puppy);\n }", "async createPerson(ctx, args) {\n\n args = JSON.parse(args);\n\n //create a new person\n let newPerson = await new Person(args.personID, args.firstName, args.lastName, args.dateOfBirth, args.type, args.email, args.phone);\n\n //update state with new voter\n await ctx.stub.putState(newPerson.personID, Buffer.from(JSON.stringify(newPerson)));\n\n let response = `Person with personID ${newPerson.personID} is updated in the world state`;\n return response;\n }", "async createAnemese(stub, args) \n {\n var docType = args[10];\n let roleAsBytes = await stub.getState(docType); \n if (!roleAsBytes || roleAsBytes.toString().length <= 0) \n {\n throw new Error(docType + ' does not exist');\n }\n let role = JSON.parse(roleAsBytes);\n if(role.anemese != 'Y')\n {\n throw new Error('Not authorized');\n }\n /*\n * QP: queixa principal \n * HDA: Histórico doença atual \n * HMP: Antecedentes \n * HF: Historico familiar \n * Pressao\n * Batimento cardiaco\n */\n var anemese = \n {\n docType: 'anemese',\n id: args[0],\n fullName: args[1],\n qp: args[2],\n hda: args[3],\n hmp: args[4],\n hf: args[5],\n smoke: args[6],\n drink: args[7],\n pression: args[8],\n heartbeat: args[9],\n key: args[12]\n };\n\n var key = args[12];\n await stub.putState(key, Buffer.from(JSON.stringify(anemese)));\n console.log('Inserted');\n \n let medicalRecordBytes = await stub.getState(args[11]);\n let medicalRecord = JSON.parse(medicalRecordBytes);\n medicalRecord.anemese = anemese;\n\n await stub.putState(args[11], Buffer.from(JSON.stringify(medicalRecord)));\n }", "function createLicense() {}", "create(req, res, next) {\n const instrumentProps = req.body;\n\n Instrument.create(instrumentProps)\n .then(instrument => res.send(instrument))\n .catch(next)\n }", "connect(signerOrProvider) {\n if (typeof (signerOrProvider) === \"string\") {\n signerOrProvider = new __WEBPACK_IMPORTED_MODULE_2__ethersproject_abstract_signer__[\"b\" /* VoidSigner */](signerOrProvider, this.provider);\n }\n const contract = new (this.constructor)(this.address, this.interface, signerOrProvider);\n if (this.deployTransaction) {\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__ethersproject_properties__[\"a\" /* defineReadOnly */])(contract, \"deployTransaction\", this.deployTransaction);\n }\n return contract;\n }", "function newGem() {\n var gem = new Token(10);\n allTokens.push(gem);\n}", "async createAnimal(stub, args) {\n console.info('============= START : Create animal ===========');\n if (args.length != 7) {\n throw new Error('Incorrect number of arguments. Expecting 7 arguments');\n }\n\n var animalListing = {\n reservePrice: args[1],\n description: args[2],\n listingState: args[3],\n offers: args[4],\n animal: args[5],\n species: args[6],\n };\n\n await stub.putState(args[0], Buffer.from(JSON.stringify(animalListing)));\n console.info('============= END : Create animal ===========');\n }", "function create(params) {\n var loan = new RequestLoan();\n loan.resource = params.resource;\n loan.user = params.user;\n return loan;\n}", "static initialize(obj, scriptSig) { \n obj['scriptSig'] = scriptSig;\n }", "function Agent(pos, vel, goal, orientation, radius, markers, mesh)\n{\n this.position = pos; //vector3 (no Y)\n this.velocity = vel; //vector3 (no Y)\n this.goal = goal; //vector3 (no Y)\n this.orientation = orientation; //vector3 (no Y)\n this.radius = radius; //number\n this.markers = markers; //list of Marker class objects\n this.mesh = mesh; //Cylinder geometry\n}//end constructor", "function makeStudent() {\n currentStudent = studentsObject.sigmanauts[indexId];\n }", "async instantiate(ctx) {\n\t\tlog.info(\"Manufacturer Smart Contract Instantiated\");\n\t}", "static async crearGuion(payload){\n\n\t\tlet bot = new BotService()\n\t\tObject.assign(bot,payload)\n\t\tawait bot.save()\n\t\treturn bot\n\n\t}", "function License(badge){\n this.badge = badge\n }", "function createPet(animal, name) {\n return {\n animal,\n name,\n\n sleep() {\n console.log('I am sleeping');\n },\n\n wake() {\n console.log('I am awake');\n }\n };\n}", "static createKey(issuer, paperNumber) {\n return JSON.stringify(issuer) + JSON.stringify(paperNumber);\n }", "function create(uri) {\n return {\n uri: uri\n };\n }", "function create(uri) {\n return {\n uri: uri\n };\n }", "function create(uri) {\n return {\n uri: uri\n };\n }", "async createMember(stub, args) {\n console.info('============= START : Create animal ===========');\n if (args.length != 4) {\n throw new Error('Incorrect number of arguments. Expecting 4');\n }\n\n var member = {\n firstName: args[1],\n lastName: args[2],\n balance: args[3]\n };\n\n console.info(member);\n\n await stub.putState(args[0], Buffer.from(JSON.stringify(member)));\n console.info('============= END : Create animal ===========');\n }", "async function createAccount() {\n try {\n const pair = StellarSdk.Keypair.random();\n console.log(\"Requesting XLMs\");\n\n // Asking friendbot to give us some lumens on the new a/c\n await fetch(\n `https://horizon-testnet.stellar.org/friendbot?addr=${pair.publicKey()}`\n );\n\n return pair;\n } catch (e) {\n console.error(\"ERROR!\", e);\n }\n}", "addAgent(name, commissionPercent){\n this.agents[name] = createAgent(name, commissionPercent);\n }", "createLaser(direction) {\n let pos = this.pos.clone().add(direction.clone().multiplyScalar(20 + (this.width / 2)));\n\n let laser = new Entity(pos, 20, 5, direction.clone().multiplyScalar(50), false)\n laser.hostile = true;\n \n let angle = Math.atan2(direction.y, direction.x);\n laser.angle = angle;\n laser.laser = true;\n \n return laser;\n }", "function Insurance (make, year, level) { //interpret const insurance = new Insurace (make, year, level) as .this -currently selected//make,year,level value already exists\n this.make = make;\n this.year = year;\n this.level = level;\n}", "youngGun(args) {\n return this.createGameObject(\"YoungGun\", young_gun_1.YoungGun, args);\n }", "function somethingNice(agent) {\n agent.add(\"Awesome Work\");\n }", "function MakePerson(pName, pBirthday, pSSN) {\n var newObj = {};\n newObj.name = pName;\n newObj.birthday = pBirthday;\n newObj.ssn = pSSN;\n return newObj;\n}", "function signingPolicy(authenticationProvider) {\n return {\n create: function (nextPolicy, options) {\n return new SigningPolicy(nextPolicy, options, authenticationProvider);\n }\n };\n }", "function createPayment(name, amount, ref, that) {\n that.waitForElement('#payment_type_POSTAL_ORDER', BARATConstants.fiveSecondWaitTime);\n that.click('#payment_type_POSTAL_ORDER');\n that.waitForElement('#payer-name', BARATConstants.tenSecondWaitTime);\n that.fillField('Payer name', name);\n that.fillField('Amount', amount);\n that.fillField('Postal order number', ref);\n that.waitForElement('.button', BARATConstants.tenSecondWaitTime);\n that.click('#instruction-submit');\n that.wait(20);\n that.waitForText('Add another payment', BARATConstants.tenSecondWaitTime);\n}", "function configureParserTACreateToken(parser: argparse.ArgumentParser) {\n parser.add_argument(\"instanceName\", {\n help:\n \"The name of the Opstrace instance to generate the token for. \" +\n \"Be sure to set it correctly, otherwise the token will not be accepted.\",\n type: \"str\",\n metavar: \"INSTANCE_NAME\"\n });\n\n parser.add_argument(\"tenantName\", {\n help:\n \"The name of the tenant to generate the token for. \" +\n \"Be sure to set it correctly, otherwise the token will not be accepted.\",\n type: \"str\",\n metavar: \"TENANT_NAME\"\n });\n\n parser.add_argument(\"tenantApiAuthenticatorKeyFilePath\", {\n help:\n \"Use the private key encoded in this file to sign the token. \" +\n \"The path must point to a PEM RSA private key file using the PKCS#1 or \" +\n \"PKCS#8 serialization format.\",\n type: \"str\",\n metavar: \"KEYPAIR_FILE_PATH\",\n default: \"\"\n });\n}", "async instantiate(ctx){\n console.log('Pharmanet Contract instantiated')\n }", "function createArgumentEdge(fromKey, toKey, type) {\n if (fromKey.indexOf('arguments/') == -1) {\n console.log('WARNING only arguments can point an argument edge, you\\re trying to point:', fromKey);\n }\n if (toKey.indexOf('claims/') == -1) {\n console.log('WARNING only claims can have an argument edge pointing at them, you\\re trying to point:', toKey);\n }\n if (type !== 'FOR' && type !== 'AGAINST') {\n console.log('WARNING argument edges can only be of type FOR or AGAINST, you\\'re trying to set one of type:', type);\n }\n return new Promise(function (resolve, reject) {\n var PremiseCollection = Arango.getPremisLinkCollection();\n var datetime = Utils.getCreateDateForDb();\n PremiseCollection.save({\n \"_from\": fromKey,\n \"_to\": toKey,\n \"type\": type,\n \"creationDate\": datetime\n }).then((meta) => {\n resolve({\n \"_from\": fromKey,\n \"_to\": toKey,\n \"type\": type,\n \"creationDate\": datetime,\n \"_id\": meta._id,\n \"_key\": meta._key\n });\n }).catch((err) => {\n reject(err);\n });\n });\n}", "function CreateMan(name,age,color){\n\treturn {\n\t\tname,\n\t\tage,\n\t\tcolor,\n\t}\n}", "function newHat(type, color, size){\n return {\n type: type,\n color: color,\n size: size,\n }\n}", "addNotetaker(canvas, notetaker) {\n this.notetakers.set(canvas, notetaker);\n this.paperScope.activate();\n const project = new paper.Project(canvas);\n const tool = this.toolButtons.currentTool;\n if (tool instanceof PassThroughTool) {\n tool.activate();\n }\n return project;\n }", "async createPolicy(policy) {\n return await axios.post(POLICY_API_BASE_URL + \"/policy\", policy);\n }", "function makePerson(name, bday, ssn){\n return {name: name, birthday: bday, ssn: ssn};\n }", "function Signer() {\n var _newTarget = this.constructor;\n errors.checkAbstract(_newTarget, Signer);\n properties_1.defineReadOnly(this, \"_isSigner\", true);\n }", "function Signer() {\n var _newTarget = this.constructor;\n logger.checkAbstract(_newTarget, Signer);\n properties_1.defineReadOnly(this, \"_isSigner\", true);\n }", "async function createNewFollow() {\n await createFollow(follow);\n }", "create(_nextPolicy, _options) {\n throw new Error(\"Method should be implemented in children classes.\");\n }", "create(_nextPolicy, _options) {\n throw new Error(\"Method should be implemented in children classes.\");\n }", "function constructTank(x, y) {\n var enemyMech = new EnemyMech(x, y);\n enemyMech.draw();\n}", "constructor() {\n super();\n this.name = 'pencil';\n this.path = null;\n this._movement = new paper.Point();\n }", "constructor() {\n logger.checkAbstract(new.target, Signer);\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__ethersproject_properties__[\"a\" /* defineReadOnly */])(this, \"_isSigner\", true);\n }", "attach(addressOrName) {\n return new (this.constructor)(addressOrName, this.interface, this.signer || this.provider);\n }", "attach(addressOrName) {\n return new (this.constructor)(addressOrName, this.interface, this.signer || this.provider);\n }", "function createPoint (self) {\n console.log('Creazione traiettoria');\n //definizione key frames con un tap, giusto per provare\n console.log('Hai creato un key frame, creati: ' + (targetObject.keyFrames.length + 1));\n //salvataggio posizine come primo valore del key frame\n let keyFrame = [{\n name: 'animation__position',\n values: {\n property: 'position',\n dur: targetObject.keyFrames.length !== 0? self.data.duration/targetObject.keyFrames.length: self.data.duration,\n easing: self.data.interpolation,\n from: targetObject.keyFrames.length !== 0? targetObject.keyFrames[targetObject.keyFrames.length - 1][0].values.to: stringify(initialValues.position),\n to: stringify(targetObject.aframeEl.getAttribute('position')),\n delay: targetObject.keyFrames.length === 0? self.data.delay: 0,\n loop: 1,\n startEvents: 'start',\n pauseEvents: 'stop',\n resumeEvents: 'resume'\n }\n }];\n targetObject.keyFrames.push(keyFrame);\n createClone(self);\n if (targetObject.keyFrames.length > 2) {\n for(let i = 0; i < targetObject.keyFrames[0].length; i++)\n targetObject.aframeEl.setAttribute(targetObject.keyFrames[0][i].name, targetObject.keyFrames[0][i].values);\n targetObject.aframeEl.emit('trajectoryCreated');\n }\n}", "constructor() {\n logger.checkAbstract(new.target, lib_esm_Signer);\n Object(lib_esm[\"d\" /* defineReadOnly */])(this, \"_isSigner\", true);\n }", "generateLaunchAgentPlist() {\n const programArguments = ['/usr/local/bin/gsts']\n\n for (let [key, value] of Object.entries(this.args)) {\n if (key.includes('daemon') || value === undefined) {\n continue;\n }\n\n programArguments.push(`--${key}${typeof value === 'boolean' ? '' : `=${value}`}`);\n }\n\n const payload = {\n Label: PROJECT_NAMESPACE,\n EnvironmentVariables: {\n PATH: '/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin'\n },\n RunAtLoad: true,\n StartInterval: 600,\n StandardErrorPath: this.args['daemon-out-log-path'],\n StandardOutPath: this.args['daemon-error-log-path'],\n ProgramArguments: programArguments\n };\n\n return plist.build(payload);\n }", "function createInstrumentIdentifier() {\r\n try {\r\n var apiClient = new CybersourceRestApi.ApiClient();\r\n var instance = new CybersourceRestApi.InstrumentIdentifierApi(apiClient);\r\n\r\n var card = new CybersourceRestApi.PaymentinstrumentsCard();\r\n card.number = \"1234567890987654\";\r\n\r\n\r\n var merchantInitiatedTransaction = new CybersourceRestApi.InstrumentidentifiersProcessingInformationAuthorizationOptionsInitiatorMerchantInitiatedTransaction();\r\n var previousTransactionId = \"123456789012345\";\r\n merchantInitiatedTransaction.previousTransactionId = previousTransactionId;\r\n\r\n var initiator = new CybersourceRestApi.InstrumentidentifiersProcessingInformationAuthorizationOptionsInitiator();\r\n initiator.merchantInitiatedTransaction = merchantInitiatedTransaction;\r\n\r\n var authorizationOptions = new CybersourceRestApi.InstrumentidentifiersProcessingInformationAuthorizationOptions();\r\n authorizationOptions.initiator = initiator;\r\n\r\n var processingInformation = new CybersourceRestApi.PaymentinstrumentsProcessingInformation();\r\n processingInformation.authorizationOptions = authorizationOptions;\r\n\r\n var body = new CybersourceRestApi.Body();\r\n body.card = card;\r\n body.processingInformation = processingInformation;\r\n\r\n var options = {\r\n \"body\": body\r\n };\r\n\r\n var profileId = \"93B32398-AD51-4CC2-A682-EA3E93614EB1\";\r\n\r\n instance.instrumentidentifiersPost(profileId, options, function (error, data, response) {\r\n if (error) {\r\n console.log(\"Error : \" + error);\r\n console.log(\"Error : \" + error.stack);\r\n console.log(\"Error status code : \" + error.statusCode);\r\n }\r\n else if (data) {\r\n console.log(\"Data : \" + JSON.stringify(data));\r\n }\r\n console.log(\"Response : \" + JSON.stringify(response));\r\n console.log(\"Response id : \" + response[text.id]);\r\n\r\n });\r\n } catch (error) {\r\n console.log(error);\r\n }\r\n}", "function newInkAnnotation() {\n return new PSPDFKit.Annotations.InkAnnotation({\n pageIndex: 1,\n boundingBox: new PSPDFKit.Geometry.Rect({\n width: 150,\n height: 50,\n top: 50,\n left: 50,\n }),\n strokeColor: PSPDFKit.Color.WHITE,\n lines: PSPDFKit.Immutable.List([\n PSPDFKit.Immutable.List([\n new PSPDFKit.Geometry.DrawingPoint({ x: 50, y: 50 }),\n new PSPDFKit.Geometry.DrawingPoint({ x: 200, y: 50 }),\n ]),\n PSPDFKit.Immutable.List([\n new PSPDFKit.Geometry.DrawingPoint({ x: 50, y: 75 }),\n new PSPDFKit.Geometry.DrawingPoint({ x: 200, y: 75 }),\n ]),\n PSPDFKit.Immutable.List([\n new PSPDFKit.Geometry.DrawingPoint({ x: 50, y: 100 }),\n new PSPDFKit.Geometry.DrawingPoint({ x: 200, y: 100 }),\n ]),\n ]),\n });\n}", "function spawnLaser(laserPos) {\n // Spawn the laser above the rocket\n laserPos = laserPos.add(0, -20);\n add([\n rect(2, 8),\n pos(laserPos),\n origin(\"center\"),\n color(0, 1, 0),\n \"laser\",\n {\n laserSpeed: -1 * LASER_SPEED,\n },\n ]);\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xca05d50e;\n this.SUBCLASS_OF_ID = 0x2899a53d;\n\n this.paymentToken = args.paymentToken;\n this.googleTransactionId = args.googleTransactionId;\n }", "static fromAssertion(assertion) {\n const clientAssertion = new ClientAssertion();\n clientAssertion.jwt = assertion;\n return clientAssertion;\n }", "function create(red, green, blue, alpha) {\n return {\n red: red,\n green: green,\n blue: blue,\n alpha: alpha,\n };\n }", "function launch(from, ...args) {\n return [\n {\n from: {\n simultaneous: [\n {\n key_code: colemak('o'), // mnemonic: \"[o]pen\")\n },\n {\n key_code: from,\n },\n ],\n simultaneous_options: {\n key_down_order: 'strict',\n key_up_order: 'strict_inverse',\n },\n },\n parameters: {\n 'basic.simultaneous_threshold_milliseconds': 100 /* Default: 1000 */,\n },\n to: [\n {\n shell_command: ['open', ...args].join(' '),\n },\n ],\n type: 'basic',\n },\n ];\n}", "construct (target, args) {\n return new target(...args)\n }", "function create(red, green, blue, alpha) {\n return {\n red: red,\n green: green,\n blue: blue,\n alpha: alpha\n };\n }", "function create(red, green, blue, alpha) {\n return {\n red: red,\n green: green,\n blue: blue,\n alpha: alpha\n };\n }", "function create(red, green, blue, alpha) {\n return {\n red: red,\n green: green,\n blue: blue,\n alpha: alpha\n };\n }", "static async fromPayload(payload, options = {}) {\n const request = SigningRequest.from(payload.req, options);\n const abis = await request.fetchAbis();\n return request.resolve(abis, { actor: payload.sa, permission: payload.sp }, {\n ref_block_num: Number(payload.rbn),\n ref_block_prefix: Number(payload.rid),\n expiration: payload.ex,\n });\n }", "function setBonus(b) {\n console.log(b.x);\n console.log(b.y);\n console.log(b.size);\n // Creation grace a Paper\n bonus = new Path.Rectangle({\n point: [b.x, b.y],\n size: [10, 10],\n fillColor: \"#00FF00\",\n strokeColor: \"green\"\n });\n console.log(bonus);\n}", "function create(fromKey, toKey, type){\n return new Promise(function (resolve, reject) {\n var PremiseCollection = Arango.getPremisLinkCollection();\n var datetime = Utils.getCreateDateForDb();\n PremiseCollection.save({\n \"_from\": fromKey,\n \"_to\": toKey,\n \"type\": type,\n \"creationDate\": datetime\n }).then((meta) => {\n resolve({\n \"_from\": fromKey,\n \"_to\": toKey,\n \"type\": type,\n \"creationDate\": datetime,\n \"_id\": meta._id,\n \"_key\": meta._key\n });\n }).catch((err) => {\n console.log('FAIL: premise link creation fail');\n reject(err);\n });\n });\n}", "function createTrace() {\n\ttraceButton = createButton(\"Trace ON\");\n\ttraceButton.id(\"mainButton\");\n\ttraceButton.position(traceX, traceY);\n\ttraceButton.style(\"background-color\", \"green\");\n\ttraceButton.mousePressed(traceToggle);\n}", "function Pelota(r,x=0,y=0) {\n Agent.call(this,x,y);\n this.add(new THREE.Mesh( new THREE.SphereGeometry(r), new THREE.MeshNormalMaterial() ) );\n \n this.step= 0.1;\n this.colision = 0;\n this.radius = r;\n this.sensor = new THREE.Raycaster(this.position, new THREE.Vector3(1,0,0) );\n}", "async createAccount(caller, amount = 0) {\n const iTx = invokeScript({\n dApp: address(this.dapp_account),\n call: {\n function: \"createAccount\",\n },\n payment: [{ assetId: this.asset_id, amount: amount }]\n }, caller);\n\n await broadcast(iTx)\n await waitForTx(iTx.id);\n this.dd('Account ' + caller + ' (' + address(caller) + ') has been created in dApp (' + address(this.dapp_account) + ') | tx_id: ' + iTx.id)\n }", "create() {\n super.create()\n\n this.instanceCreate(Platform, 350, 450)\n\n this.instanceCreate(Apple)\n this.instanceCreate(Apple)\n this.instanceCreate(Apple)\n this.instanceCreate(Apple)\n this.instanceCreate(Apple)\n\n this.instanceCreate(Solid)\n this.instanceCreate(RainbowDash)\n\n this.instanceCreate(Player, 200, 600)\n }", "function create(uri) {\n return { uri: uri };\n }", "function create(uri, range) {\n return {\n uri: uri,\n range: range\n };\n }", "function create(uri, range) {\n return {\n uri: uri,\n range: range\n };\n }", "function create(uri, range) {\n return {\n uri: uri,\n range: range\n };\n }", "function create(red, green, blue, alpha) {\r\n return {\r\n red: red,\r\n green: green,\r\n blue: blue,\r\n alpha: alpha,\r\n };\r\n }" ]
[ "0.48949978", "0.48640415", "0.48530108", "0.4774951", "0.4771536", "0.46646932", "0.45978272", "0.45912632", "0.4515223", "0.44812745", "0.44806337", "0.4470632", "0.44579676", "0.44567546", "0.4421732", "0.44188836", "0.44065", "0.4360031", "0.4359998", "0.43599558", "0.43590665", "0.43526748", "0.43454176", "0.43422455", "0.43164384", "0.4314267", "0.4313406", "0.43127954", "0.43120342", "0.43105704", "0.42817974", "0.4275742", "0.42700508", "0.42653614", "0.42633134", "0.42424396", "0.4242337", "0.42348623", "0.4228691", "0.42266995", "0.4224956", "0.42217135", "0.42134914", "0.42075962", "0.42075962", "0.42075962", "0.42000446", "0.41970903", "0.419574", "0.4182342", "0.41821352", "0.41628662", "0.41595787", "0.41584912", "0.4157449", "0.41556013", "0.41548684", "0.41547835", "0.41528836", "0.41481853", "0.41459072", "0.4142945", "0.4142861", "0.41424993", "0.4141752", "0.41334128", "0.41327828", "0.4129158", "0.4129158", "0.412868", "0.41270015", "0.4122968", "0.41200045", "0.41200045", "0.41133332", "0.41110808", "0.41096306", "0.41063166", "0.41059592", "0.41015825", "0.4097302", "0.40970924", "0.4092981", "0.40897083", "0.40845028", "0.40838164", "0.40838164", "0.40838164", "0.4083652", "0.40834287", "0.4071409", "0.40708905", "0.40689495", "0.4062097", "0.40610346", "0.4058876", "0.40557355", "0.40557355", "0.40557355", "0.40545058" ]
0.43406802
24
Get the current balance in a specified denomination.
async getBalance (denomination = 'uscrt') { const account = await this.API.getAccount(this.address) || {} const balance = account.balance || [] const inDenom = ({denom, amount}) => denom === denomination const balanceInDenom = balance.filter(inDenom)[0] || {} return balanceInDenom.amount || 0 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBalance() {\n return balance;\n }", "async getBalance () {\n await this.update()\n return this.client.getBalance()\n }", "function getBalance() {\n const payload = {\n symbol: 'ELF',\n owner: wallet.address\n };\n\n multiTokenContract.GetBalance.call(payload)\n .then(result => {\n console.log('result: ' + result);\n })\n .catch(err => {\n console.log(err);\n });\n\n return multiTokenContract.GetBalance.call(payload)\n .then(result => {\n console.log(result.balance);\n return result.balance;\n })\n .catch(err => {\n console.log(err);\n });\n }", "function getMyBalance() {\n return df.getMyBalanceEth();\n}", "async getBalance() {\n const balance = await privateTokenSale.methods.getBalance().call();\n return balance;\n }", "getBalance() {\n return this.wallet.getBalance();\n }", "currentBalance() {\n const sumTransaction = (a, b) => a + getTransactionAmountWithSign(b);\n\n return slice((state) => state.transactions.reduce(sumTransaction, 0));\n }", "balanceCurrentBalance() {\n return new Promise((resolve, reject) => {\n client.getBalance().then((balance) => {\n resolve(balance);\n return '';\n }).catch((err) => {\n reject(err);\n });\n });\n }", "function getBalance (account) {\n return account.balance;\n}", "function getCurrentBalance() {\n const balanceTotal = document.getElementById('balance-total');\n const balanceTotalText = balanceTotal.innerText;\n const previousBalanceTotal = parseFloat(balanceTotalText);\n return previousBalanceTotal;\n }", "balance() {\n return this.contract.methods.balanceOf(this.contract.defaultAccount).call();\n }", "function getBalance(tipper, cb) {\n // tipper has no address, never made a deposit\n if (!tipper.address) {\n return cb(null, tipper.received - tipper.spent);\n }\n\n // balance = total deposit amount + total received - total spent\n power.cmd(\"getreceivedbyaddress\", tipper.address, function (err, amount) {\n if (err) {\n return cb(err, null);\n }\n\n const balance = amount + tipper.received - tipper.spent;\n return cb(null, balance);\n });\n}", "function getBalance(account){\n\treturn account.balance;\n}", "getBalance(crypto = null) {\r\n if (this.config.debug) {\r\n console.log(\"WalletBF getBalance\");\r\n }\r\n\r\n if (!crypto) {\r\n crypto = \"XBT\";\r\n }\r\n\r\n let balance = 0;\r\n let coins = this.getStoredCoins(true, crypto);\r\n Object.keys(coins).forEach(function(i) {\r\n balance += parseFloat(coins[i].v); \r\n });\r\n return this._round(balance,8);\r\n }", "function getCurrentBalance() {\n //current Balance\n const balanceTotal = document.getElementById('balance-total');\n const balanceTotalText = balanceTotal.innerText;\n const preBalanceTotal = parseFloat(balanceTotalText);\n return preBalanceTotal;\n}", "getAccountBalance () {\n return this.createRequest('/balance', 'GET');\n }", "function getDeposit() {\n return askMoney;\n }", "get balance () { return this.getBalance() }", "function getAccountBalance(){\r\n myContract.methods.getAccountBalance().call(function(error, result){\r\n if(!error)\r\n { \r\n // console.log(\"account balance: \"+ result);\r\n // console.log(result);\r\n // $(\".balanceLeft\").text(parseInt(result));\r\n }\r\n else\r\n console.error(error);\r\n });\r\n }", "outstandingBalance() {\n const amountPaid = this.amountPaidOnInvoice();\n const invoiceTotal = this.amount;\n const tip = this.tip || 0;\n return (invoiceTotal + tip) - amountPaid;\n }", "async getBalance () {\n const body = new FormData();\n body.append(\"secret\", this.secret);\n\n const request = new Request(\"post\", `${Endpoints.pay.base}${Endpoints.pay.balance}`, {\n body: body\n });\n const response = await this.manager.push(request);\n\n if (response.success) {\n this.balance = response.balance;\n return this.balance;\n } else {\n const errorObj = {\n error: true,\n location: `${Endpoints.pay.base}${Endpoints.pay.balance}`,\n method: \"post\",\n reason: response.reason,\n params: {}\n };\n this.emit(\"error\", errorObj);\n return errorObj;\n }\n }", "get balance() {\n return this._balance;\n }", "deposit(){\n let number = prompt(\"How much do you want to deposit?\");\n this.balance = (this.balance + number);\n this.balance = parseInt(this.balance);\n return this.balance;\n }", "get balance() {\n\t\t\t\treturn this._balance;\n\t\t}", "get balance() {\n return this.coins.reduce((acc, {output}) => acc + output.amount, 0);\n }", "function getCurrentBalance(){\n const balance = document.getElementById(\"balance\")\n let currentBalance = balance.innerText\n let parsingCurrentBalance = parseFloat(currentBalance)\n\n return parsingCurrentBalance\n}", "function getMoney() {\n\treturn parseInt(currentMoney);\n}", "balanceIn(currency) {\n\t\tlet forex = Forexs[0][currency + this.currency];\n\t\tif (forex)\n\t\t\treturn (this.balance * forex.rate);\n\t\telse\n\t\t\treturn null;\n\t}", "async getBalance() {\n if (this.active) {\n try {\n console.log('Looking up account balance');\n let response = await this.client.account_balance(this.GAME_ADDRESS);\n return this.getKraiFromRaw(response.balance);\n } catch (error) {\n console.log(`RPC error: ${error.message}`);\n }\n }\n return 0;\n }", "getAccountBalance(accountId) {\n if (lock.isBusy(accountId)) throwError('Service Unavailable', 503);\n this.logger.info('Retrieving account balance...', accountId);\n const accountBalance = accountDatabase[accountId].balance;\n return { accountBalance };\n }", "function getBalance() {\n return new Promise((resolve, reject) => {\n co(function* () {\n\n yield validateConfig()\n .catch((err) => {\n reject(err);\n });\n\n yield readYAML()\n .catch((err) => {\n reject(err);\n });\n\n yield getUserAddress()\n .catch((err) => {\n reject(err);\n });\n\n yield fetchBalance()\n .then((result) => {\n resolve(result);\n })\n .catch((err) => {\n reject(err);\n });\n });\n });\n}", "async function getBalance() {\n if (typeof window.ethereum !== 'undefined') {\n const [account] = await window.ethereum.request({ method: 'eth_requestAccounts' })\n const provider = new ethers.providers.Web3Provider(window.ethereum);\n const contract = new ethers.Contract(bvgTokenAddress, BVGToken.abi, provider)\n const balance = await contract.balanceOf(account);\n console.log(\"Balance: \", ethers.utils.formatEther(balance).toString());\n }\n }", "balance(account) {\n if (this.ledger[account] === undefined) {\n throw new Error(`${account} is not a registered customer of the bank`);\n }\n return this.ledger[account];\n }", "getAmount(){\n\t\t//returns the amount in the account\n\t\treturn this.balance;\n}", "async function GetBalance(id)\r\n{\r\n\t// Finding user's balance in the bank\r\n\tconst Balance = await Bank.findOne({ where: { UID: id } });\r\n\r\n\tif (Balance) // If there is one\r\n\t{\r\n\t\treturn Balance.units; // Return the amount of Units\r\n\t}\r\n\telse // If the user doesn't own a bank balance yet\r\n\t{\r\n\t\tawait Bank.create( // Create one\r\n\t\t\t{\r\n\t\t\t\tUID: id,\r\n\t\t\t\tunits: 0\r\n\t\t\t});\r\n\t\treturn 0;\r\n\t}\r\n}", "getBalance(account, more) {\n if (!account) return 0.00;\n\n if (!this.web3.isAddress(account))\n throw `${account} is an invalid account`;\n\n // more - pending, latest \n if (!more) more = 'latest';\n\n // ether = ligear\n const weiValue = this.web3.eth.getBalance(account, more);\n return Number(this.web3.fromWei(weiValue));\n }", "withdraw() {\n let number = prompt(\"How much do you want to withdraw??\");\n this.balance = (this.balance - number);\n this.balance = parseInt(this.balance);\n return this.balance;\n\n }", "function getBalance(accountName) {\n var bankAccountKey = currentAccount.accountNumber + accountName;\n\n if (localStorage.getItem(bankAccountKey) != null) {\n return localStorage.getItem(bankAccountKey);\n } else {\n for (var i = 0; i < currentAccount.bankAccounts.length; i++) {\n if (currentAccount.bankAccounts[i].name == accountName) {\n return currentAccount.bankAccounts[i].balance;\n }\n }\n return \"ERROR: Account\" + accountName + \" could not be found\";\n }\n}", "static getEthBalance() {\n const { walletAddress } = store.getState();\n\n const web3 = new Web3(this.getWeb3HTTPProvider());\n\n return new Promise((resolve, reject) => {\n web3.eth.getBalance(walletAddress, (error, weiBalance) => {\n if (error) {\n reject(error);\n }\n\n const balance = weiBalance / Math.pow(10, 18);\n\n AnalyticsUtils.trackEvent('Get ETH balance', {\n balance,\n });\n\n resolve(balance);\n });\n });\n }", "async function getAccountBalance() {\n return web3.eth.getBalance(getAccount());\n}", "function balanceValue() {\n let targetBal = document.getElementById(`total-balance`);\n let targetValue = parseFloat(targetBal.innerText);\n return targetValue;\n}", "async getCurrentExchangeRate() {\n // set balance of account\n return new BigNumber(\n ethers.utils.formatUnits(await this.instance.exchangeRateStored(), this.token.decimals),\n )\n }", "function getAmount(banDoc,account,property,startDate,endDate) {\n var currentBal = banDoc.currentBalance(account,startDate,endDate)\n var value = currentBal[property];\n return value;\n}", "function getBalance() { //give value to number\n const balance = document.querySelector('#balance');\n return Number(balance.value);\n}", "function getBalance(toPrepare, me) {\n const delta = toPrepare.delta;\n const inv = me.inv;\n let balance = [0, 0, 0, 0];\n for (let idx = 0; idx < 4; ++idx) {\n balance[idx] = delta[idx] + inv[idx];\n }\n return balance;\n}", "calculateBalanceFromBlockchain() {}", "requestBalance (adapter, uniqueId) {\n return new Promise(async (resolve, reject) => {\n const target = await this.Account.getOrCreate(adapter, uniqueId)\n resolve(target.balance)\n })\n }", "function calcBalance(account, bClass, startDate, endDate) {\n\tvar currentBal = Banana.document.currentBalance(account, startDate, endDate);\n\tif (bClass === \"1\") {\n\t\treturn currentBal.balance;\n\t}\n\telse if (bClass === \"2\") {\n\t\treturn Banana.SDecimal.invert(currentBal.balance);\n\t}\n\telse if (bClass === \"3\") {\n\t\treturn currentBal.total;\n\t}\n\telse if (bClass === \"4\") {\n\t\treturn Banana.SDecimal.invert(currentBal.total);\n\t}\n\telse if (!bClass) {\n\t\treturn currentBal.balance;\n\t}\n}", "async function getBalance () {\n try {\n // first get BCH balance\n const aliceBalance = await bchjs.Electrumx.balance(\n aliceWallet.cashAddress\n )\n const bobBalance = await bchjs.Electrumx.balance(bobWallet.cashAddress)\n const samBalance = await bchjs.Electrumx.balance(samWallet.cashAddress)\n\n console.log('BCH Balances information')\n console.log('------------------------')\n console.log('Alice\\'s Wallet:')\n console.log(`${aliceWallet.cashAddress}`)\n console.log(JSON.stringify(aliceBalance.balance, null, 2))\n console.log('--')\n console.log('Bob\\'s Wallet:')\n console.log(`${bobWallet.cashAddress}`)\n console.log(JSON.stringify(bobBalance.balance, null, 2))\n console.log('--')\n console.log('Sam\\'s Wallet:')\n console.log(`${samWallet.cashAddress}`)\n console.log(JSON.stringify(samBalance.balance, null, 2))\n } catch (err) {\n console.error('Error in getBalance: ', err)\n throw err\n }\n}", "function getBalance() {\n return parseInt(document.querySelector('.count-balance').outerText)\n}", "getAccountBalance(account) {\n getAccountBalance(this, account)\n }", "function getBalance() {\n\n currentAcctIndex = parseFloat(window.localStorage.getItem('currentAcctIndex'));\n\n document.getElementById(\"currentBalance\").innerHTML = bankAccounts[currentAcctIndex].balance.toFixed(2) //show the value of the balance in the currentIndexedAcct with .toFixed(2) two decimal spaces.\n}", "getBalance(userName) {\n // We use this variable to store the userID, since that is the link between the two data bases.\n var userID;\n\n // First we find the userID in the user data base.\n //\n for (let i = 0; i < this.DB.users.length; i++) {\n if (this.DB.users[i].username == userName) {\n userID = this.DB.users[i].user_id;\n }\n }\n\n // Then we match the userID with the account list.\n // and change the account balance.\n //\n for (let i = 0; i < this.DB.account.length; i++) {\n if (this.DB.account[i].user_id == userID) {\n return this.DB.account[i].creditSEK; // This changes the value in the JSON object.\n }\n }\n return null;\n }", "getBalance(node) {\n console.log(\"Getting ETH balance for: \" + node);\n let config = Promise.all(this.getConfig(node));\n return config.then( response => {\n let web3 = response[0];\n let contract = response[1];\n return this.getAddress(node).then((address) => {\n return web3.eth.getBalance(address).then((balanceWei) => {\n return web3.utils.fromWei(balanceWei, 'ether');\n })\n })\n });\n }", "function getNextBankValue()\n{\n switch(gameserver.bank)\n {\n case 0: gameserver.bank = 20; break;\n case 20: gameserver.bank = 50; break;\n case 50: gameserver.bank = 100; break;\n case 100: gameserver.bank = 200; break;\n case 200: gameserver.bank = 300; break;\n case 300: gameserver.bank = 450; break;\n case 450: gameserver.bank = 600; break;\n case 600: gameserver.bank = 800; break;\n case 800: gameserver.bank = 1000; break;\n default: gameserver.bank = 0;\n }\n return gameserver.bank;\n}", "function getBuy (spendAmount, supply, balance, rr) {\n supply = new Decimal(supply)\n spendAmount = new Decimal(spendAmount.toFixed())\n balance = new Decimal(balance)\n rr = new Decimal(rr)\n\n // let result = supply.mul(\n // (\n // spendAmount.div(balance).add(1)\n // ).pow(\n // rr.div(1000000)\n // ).sub(1)\n // )\n const result = supply.mul(\n new Decimal(1)\n .plus(spendAmount.div(balance))\n .pow(rr.div(1000000))\n .sub(1)\n )\n\n return result\n}", "balance(){\nlet sum = 0\nfor (let i=0; i < this.transactions.length; i++) {\n sum = sum + this.transactions[i].amount;\n} return sum\n }", "function currencyDenomination() {\r\n var cash = +prompt(\"Enter cash (in hundreds): \");\r\n var hundred = cash / 100;\r\n var fifty = cash / 50;\r\n var ten = cash / 10;\r\n console.log(hundred)\r\n console.log(fifty)\r\n console.log(ten)\r\n }", "balance(owner) {\n return this.balanceOf(owner).then(re => {\n return re.toString()\n })\n }", "getBalance(callback){\n \n const api_data = {\n api_name:'/get-balance',\n coin:this.coin,\n api_key: this.apikey,\n password : this.api_password,\n };\n api_call.apiPostCall(api_data,{},callback);\n }", "function balance(){\n console.log(\"Your account balance is: \" + personal_account.deposite + \"birr\");\n}", "function retbalance(addr) {\n var balance= web3.fromWei(web3.eth.getBalance(addr));\n return (balance);\n}", "async getBCHBalance (addr, verbose = false) {\n try {\n const fulcrumBalance = await this.bchjs.Electrumx.balance(addr)\n // console.log(`fulcrumBalance: ${JSON.stringify(fulcrumBalance, null, 2)}`)\n\n const confirmedBalance = this.bchjs.BitcoinCash.toBitcoinCash(\n fulcrumBalance.balance.confirmed\n )\n\n if (verbose) {\n // const resultToDisplay = confirmedBalance\n // resultToDisplay.txids = []\n console.log(fulcrumBalance)\n }\n\n const bchBalance = confirmedBalance\n\n return bchBalance\n } catch (err) {\n wlogger.error(`Error in bch.js/getBCHBalance(): ${err.message}`, err)\n throw err\n }\n }", "deposit(amount) {\n this.balance += amount;\n this.trans.push(`$${amount} deposited`);\n return this.balance;\n }", "function balance( key ){\n\n\tcheckForMissingArg( key, \"key\" );\n\t\n\treturn getPublicKey(key).then( Blockchain.getBalance );\n}", "getCurrentCurrency () {\n return this.CurrencyService.getCurrentCurrency();\n }", "async getTotalBalance(currency, walletId, isColdWallet = true) {\n let totalBalance = \"\";\n isColdWallet = isColdWallet === \"true\";\n try {\n const wallet = await this.wallets.find(walletId);\n let address = \"\";\n if (!isColdWallet) {\n address = wallet.settlementAddress;\n } else {\n address = wallet.coldSettlementAddress;\n }\n const balance = await this.api.getBalance(address);\n totalBalance = this.web3.utils.fromWei(balance, \"gwei\");\n } catch (err) {\n console.log(\"ETH.getTotalBalance.err:\", err);\n totalBalance = \"0\";\n }\n console.log(\"ETH.totalBalance:\", totalBalance);\n return { currency, totalBalance };\n }", "async function getBalance(addrs) {\n let response;\n\n // Try/Catch block to guarantee a value is returned, else reject with the error\n try {\n response = await axios.get(`https://api.blockcypher.com/v1/eth/main/addrs/${addrs}/balance`);\n } catch(e) {\n return Promise.reject(e);\n }\n \n // balance object with the Weis currensy converted into Ethereum (1 Ether === 10^18)\n const balance = { ether : (response.data.balance/Math.pow(10, 18)) };\n\n res.status(200).send(balance);\n }", "function Coin(denom, amount) {\n var _this = _super.call(this) || this;\n _this.denom = denom;\n _this.amount = numeric_1.Numeric.parse(amount);\n return _this;\n }", "get bendFactor() {}", "calculateBalance() {\n\tlet creditResult = this.state.creditData.map(({ amount }) => amount)\n\tlet creditSum = creditResult.reduce(function(a, b){\n return a + b;\n }, 0);\n\tconsole.log(creditSum);\n\n\tlet debitResult = this.state.debitData.map(({ amount }) => amount)\n\tlet debitSum = debitResult.reduce(function(a, b){\n return a + b;\n }, 0);\n\tconsole.log(debitSum);\n\n let totalBalance = creditSum - debitSum;\n\tconsole.log(totalBalance);\n\n this.setState({ accountBalance: totalBalance.toFixed(2) });\n }", "function VatGetGr1Balance(banDoc, transactions, grCodes, vatClass, startDate, endDate) {\n\n return VatGetGr1BalanceExtraInfo(banDoc, transactions, grCodes, vatClass, \"*\", startDate, endDate);\n \n}", "function depositCash() {\n\n let deposit = prompt('How much would you like to deposit today?');\n let depositAmount = parseInt(deposit,10);\n balance +=depositAmount;\n alert (`Your new balance is ${balance}`);\n chooseService();\n return balance;\n}", "function balanceTotal(){\n var request = new XMLHttpRequest();\n\n request.open('POST', 'https://blockchain.info/merchant/(key)/balance');\n\n request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n\n request.onreadystatechange = function () {\n if (this.readyState === 4) {\n console.log('Status:', this.status);\n console.log('Headers:', this.getAllResponseHeaders());\n console.log('Body:', this.responseText);\n }\n };\n\n var body = \"password=(password)\";\n\n var totalDict = request.send(body);\n return totalDict[\"balance\"];\n}", "getBalance(blockTag) {\n return __awaiter(this, void 0, void 0, function* () {\n this._checkProvider(\"getBalance\");\n return yield this.provider.getBalance(this.getAddress(), blockTag);\n });\n }", "getBalance(blockTag) {\n return __awaiter(this, void 0, void 0, function* () {\n this._checkProvider(\"getBalance\");\n return yield this.provider.getBalance(this.getAddress(), blockTag);\n });\n }", "calculate({ balance, rate, term, period }) {\n if (rate === 0) {\n return;\n }\n\n const monthlyInterest = (rate * 0.01) / 12;\n const months = term * 12;\n const expression = (1 + monthlyInterest) ** months;\n const result = balance * ((monthlyInterest * expression) / (expression - 1));\n\n this.setState({\n output: ` $${parseFloat(result.toFixed(2))}`,\n });\n }", "debitAccount(accountId, amount) {\n const account = accountDatabase[accountId];\n if (account.balance < amount) {\n throwError('Insufficient balance', 422);\n }\n\n account.balance -= amount;\n account.effectiveDateTime = new Date();\n\n transactionHistory.push([{ ...account, amount, type: 'debit' }]);\n this.logger.info('debitting account...', accountId);\n return { ...account };\n }", "function getTotalBalance (s, cb) {\n s.exchange.getBalance(s, function (err, balance) {\n if (err) {\n console.log(err)\n return cb(err)\n \n }\n \n var summary = {product: s.product_id, asset: balance.asset, currency: balance.currency}\n\n s.exchange.getQuote({product_id: s.product_id}, function (err, quote) {\n if (err) return cb(err)\n asset_value = n(balance.asset).multiply(quote.ask)\n summary.currency_value = n(balance.currency)\n //myLog(s.product_id + \": \" + n(balance.asset).format('0.00') + \" \" + quote.ask + \" Total: \" + asset_value.format('0.00'))\n summary.ask = quote.ask\n summary.asset_value = asset_value\n cb(summary)\n })\n })\n \n }", "function withdrawAccount(num){\n var mainAccount = document.getElementById(\"currentBalance\").innerText\n var mainAccountBalance = parseFloat(mainAccount);\n var result = mainAccountBalance - num;\n document.getElementById(\"currentBalance\").innerText = result;\n}", "calculatePayment(balance, rate, term, period) {\n var rateAsDecimal = (rate / 100) / 12;\n return balance * ((rateAsDecimal * Math.pow(1 + rateAsDecimal, term * period)) / (Math.pow(1 + rateAsDecimal, term * period) - 1));\n }", "function getBet() {\n value = abs(amountBet(\"#input-bet\").val());\n if(value ) balance) {\n value = balance;\n } else if(isNaN(value)) {\n value = 0;\n }\n amountBet = value;\n}", "balanceForAsset(sourceWallet, asset) {\n return sourceWallet.publicKey()\n .then((publicKey) => {\n return this.server().loadAccount(publicKey)\n })\n .then((account) => {\n for (const balance of account.balances) {\n if (balance.asset_type === 'native') {\n if (asset.isNative()) {\n return balance.balance\n }\n } else {\n if (balance.asset_code === asset.getCode() && balance.asset_issuer === asset.getIssuer()) {\n return balance.balance\n }\n }\n }\n\n return '0'\n })\n }", "function getCredit(banDoc, startDate, endDate) {\n return getAmount(banDoc, \"Gr=4449\",\"balance\", startDate, endDate);\n}", "async getBalance(hash) {\n const json = await this.get(`/api/v1/balance/${hash}`);\n this.handleError(json);\n return json.Result;\n }", "async 'populous.balanceOf'() {\n const {\n config: {\n network: {ropsten},\n contract: {ERC1155},\n },\n contracts: {ERC1155: {balanceOf}},\n } = ethConnect;\n\n try {\n const result = await balanceOf(connectInstance, ERC1155, {XAUP_TOKENID: process.env.XAUP_TOKENID, address: process.env.ETH_ADDRESS});\n return Number(result);\n } catch (error) {\n return 0;\n }\n }", "getBond(){\n return this._bond/1000000000000;\n }", "getBalance(N) {\n if (N == null) return 0;\n \n return this.height(N.left) - this.height(N.right);\n }", "async fetchCirculatingSupply() {\n const { result: { supply: { circulating } } } = await this.request(\n 'https://public-lcd2.akash.vitwit.com/supply/summary',\n );\n\n const record = circulating.find((item) => item.denom === 'uakt');\n\n return Number(record.amount) / 10 ** 6;\n }", "getMoney(){\n return 2000;\n }", "async function getResponse(account){\r\n //get the balance\r\n var bal = await web3.eth.getBalance(account);\r\n var responses = [\r\n `The balance for the account starting with ${account.substring(0,10)} is ${bal * .000000000000000001}`,\r\n `${bal * .000000000000000001}`\r\n ]\r\n log.debug('[dflow/controllers/getBalance.js] possible responses: ' + responses); \r\n return responses[Math.floor(Math.random() * responses.length)]; \r\n}", "function retire(bal,intR,nPer,mDep){\n\tvar retirement = bal;\n\tfor(var year=1;year<=nPer;year++){\n\t\tretirement*=(1+(intR/100));\n\t\tretirement+=(mDep/12);\n\t}\n\tretirement=retirement.toFixed(2);\n\treturn retirement;\n}", "async current (currency = 'usd') {\n try {\n const response = await this.axios.get(\n `https://index-api.bitcoin.com/api/v0/cash/price/${currency.toLowerCase()}`\n )\n // console.log(`response.data: ${JSON.stringify(response.data, null, 2)}`)\n\n return response.data.price\n } catch (err) {\n if (err.response && err.response.data) throw err.response.data\n else throw err\n }\n }", "getBalanceAs(currency, domains, rates) {\r\n let total = 0;\r\n this.getAllStoredCoins(false, true).forEach((coin) => {\r\n coin = typeof coin == \"string\" ? this.Coin(coin) : coin;\r\n if (domains.indexOf(coin.d) == -1) {\r\n return;\r\n }\r\n\r\n let code = coin.c;\r\n code = (code == \"BTC\") ? \"XBT\" : code;\r\n currency = (currency == \"BTC\") ? \"XBT\" : currency;\r\n\r\n if (code == currency) {\r\n total += parseFloat(coin.v);\r\n return;\r\n }\r\n total += parseFloat(coin.v) * parseFloat(rates[`${code}_${currency}`]);\r\n });\r\n return total;\r\n }", "function getCurrentBalance(address, blocks) {\n let initialBalance = 0;\n const blocksSinceLastSpend = getDescendingBlocksSince(blocks, (b) => {\n // does the block have an input address matching the given address?\n return !!b.data.slice(1).find((tx) => tx.input.address === address);\n });\n // they spent at some time in the block history\n if (blocksSinceLastSpend.length !== blocks.length) {\n const lastSpendBlock = blocksSinceLastSpend.pop();\n const lastSpendTx = lastSpendBlock.data.slice(1).reverse().find((tx) => tx.input.address === address);\n // the last known balance is the output amount to the same wallet in the last spend transaction\n initialBalance = lastSpendTx.outputs.find((txOut) => txOut.address === address).amount;\n // if the same user got the block reward on that block, add that in as well\n const lastSpendCoinbaseDeposit = lastSpendBlock.data[0].outputs[0];\n if (lastSpendCoinbaseDeposit.address === address) {\n initialBalance += lastSpendCoinbaseDeposit.amount;\n }\n }\n return getAccumulatedBalance(initialBalance, address, blocksSinceLastSpend);\n}", "read({balance}, res) {\n // Get the balance of an ethereum address\n // toNumber() -> ether bug => toString() instead\n res.json({balance: balance.toString()});\n }", "async function getBalanceOf(address) {\n const balance = await vault.balanceOf(address);\n console.log(`Balance of ${address}: ${balance}`);\n return balance;\n}", "function findCurrency(_amount){\n if(_amount >= 100){\n denom100 = parseInt(_amount/100);\n return findCurrency(_amount%100);\n }\n else if(_amount >= 50){\n denom50 = parseInt(_amount/50);\n return findCurrency(_amount%50);\n }\n else{\n denom10 = parseInt(_amount/10);\n return amount;\n }\n}", "get () {\n return StripeAction.extend ({\n execute (req, res) {\n const { stripeAccountId: stripeAccount } = req.params;\n\n return this.stripe.balance.retrieve ({ stripeAccount })\n .then (result => res.status (200).json ({'stripe-balance': result}));\n }\n });\n }", "getBalance(\n accountId: string,\n keyLevel: string\n ): Promise<{ balance: Balance, status: RequestStatusEnum }> {\n return this._member.getBalance(accountId, keyLevel);\n }\n\n /**\n * Looks up the balances of an array of accounts\n *\n * @param accountIds - array of account ids\n * @param keyLevel - key level\n * @return Promise of get balances response object\n */\n getBalances(\n accountIds: Array<string>,\n keyLevel: string\n ): Promise<Array<{ balance: Balance, status: RequestStatusEnum }>> {\n return this._member.getBalances(accountIds, keyLevel);\n }" ]
[ "0.6942409", "0.6714723", "0.66609716", "0.6582339", "0.6557121", "0.6481666", "0.6477863", "0.64767516", "0.6461573", "0.63955", "0.638458", "0.63446736", "0.63416445", "0.6338454", "0.6334421", "0.63229644", "0.6322435", "0.6261131", "0.6245841", "0.62338144", "0.61992073", "0.6139311", "0.6116097", "0.611502", "0.61123395", "0.60801184", "0.6063918", "0.605706", "0.60556126", "0.60147077", "0.60084563", "0.6005161", "0.5982355", "0.59814864", "0.5971025", "0.5964488", "0.59623253", "0.5957953", "0.5955879", "0.5950174", "0.59445256", "0.5941674", "0.59164494", "0.5916033", "0.5909325", "0.5841651", "0.5831785", "0.5823882", "0.58235055", "0.57971925", "0.57645214", "0.5741806", "0.5733875", "0.5708241", "0.56521153", "0.5631974", "0.5576794", "0.5561076", "0.5555176", "0.55547655", "0.5547736", "0.5542103", "0.5511577", "0.5507796", "0.54754704", "0.5458984", "0.54582477", "0.5456259", "0.5449303", "0.54479605", "0.54433143", "0.5420889", "0.53934354", "0.5387489", "0.5387052", "0.5387052", "0.5387028", "0.53726166", "0.5363635", "0.53542125", "0.53443307", "0.5340828", "0.53368455", "0.5336617", "0.5324617", "0.5313351", "0.53014344", "0.52854514", "0.52852887", "0.5282831", "0.5282098", "0.52647895", "0.5252062", "0.52416545", "0.5227396", "0.5227022", "0.52255344", "0.5221914", "0.5214371", "0.52109087" ]
0.806093
0
Send some `uscrt` to an address.
async send (recipient, amount, denom = 'uscrt', memo = "") { if (typeof amount === 'number') amount = String(amount) return await this.API.sendTokens(recipient, [{denom, amount}], memo) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async simplerSend (amount, address) {\n const txid = await this.client.sendToAddress(address, amount)\n return txid\n }", "async sendToAddress(krai, address) {\n if (this.active) {\n try {\n console.log('Looking up account info');\n let accountInfo = await this.client._send('account_info', {\n account: this.GAME_ADDRESS,\n representative: 'true'\n });\n console.log(`Account info: ${JSON.stringify(accountInfo)}`);\n\n let currentKrai = this.getKraiFromRaw(accountInfo.balance);\n let afterRaw = this.getRawFromKrai(currentKrai - krai);\n console.log(`New balance after send: ${afterRaw}`);\n\n let response = await this.client._send('block_create', {\n 'json_block': 'true',\n 'type': 'state',\n 'previous': accountInfo.frontier,\n 'account': this.GAME_ADDRESS,\n 'representative': accountInfo.representative,\n 'balance': afterRaw,\n 'link': address,\n 'key': this.GAME_PRIV_KEY\n });\n console.log(`Block created: ${JSON.stringify(response)}`);\n\n response = await this.client._send('process', {\n 'json_block': 'true',\n 'subtype': 'send',\n 'block': response.block\n });\n console.log(`Send complete: ${JSON.stringify(response)}`);\n } catch (error) {\n console.log(`RPC error: ${error.message}`);\n }\n }\n }", "async function sendBitcoinToAddress(from, privateKey, toAddress, amount) {\n // const insight = new Insight(\"testnet\");\n // insight.getUnspentUtxos(fromAddress, (error, utxos) => {\n // if (error) {\n // console.log(\"error\", error);\n // return false;\n // }\n\n // console.log(\"utox\", utxos);\n\n try {\n const url = `https://testnet-api.smartbit.com.au/v1/blockchain/address/${from}/unspent`;\n let response = await fetch(url);\n response = await response.json();\n\n const transaction = bitcore.Transaction();\n transaction.from(response.unspent);\n transaction.fee(19);\n transaction.to(toAddress, amount);\n transaction.change(from);\n transaction.sign(privateKey);\n transaction.serialize();\n\n console.log(transaction);\n\n return { errors: [], data: {}, message: `${amount} BTC SENT` };\n } catch (error) {\n console.log(error);\n return { errors: [error.message], data: {}, message: \"\" };\n }\n\n // insight.broadcast(transaction, (error, transactionId) => {\n // console.log(error);\n // console.log(transactionId);\n // });\n\n // console.log(utxos);\n\n // transaction.change(fromAddress);\n // transaction.serialize();\n\n // console.log(transaction);\n // });\n}", "function writeAddress(address, type) {\n fs.writeFileSync('/root/btcpay.address.' + type, address)\n}", "function sendCoin(amount, address) {\n\tvar transaction = {\n\t\tamount: amount.toString(),\n\t\tdestination: address,\n\t};\n\tvar call = {\n\t\turl: '/wallet/siacoins',\n\t\ttype: 'POST',\n\t\targs: transaction,\n\t};\n\tIPC.sendToHost('api-call', call, 'coin-sent');\n\n\t// Reflect it asap\n\tsetTimeout(update, 100);\n}", "function sendOSCMessage(component, address, tag, args) {\n var osc_message = component.el.components['osc-lookup'].parse(address, tag, args);\n component.el.components['osc-manager'].send(osc_message);\n console.log(osc_message)\n }", "function attachAddress (address) {\n semaphore.take(() => {\n iota.api.sendTransfer(seed, 3, 14, [{\"address\": address, \"value\": 0, \"message\": \"\", \"tag\": \"\"}], (error, transfers) => {\n semaphore.leave()\n if(transfers){\n console.log(address + ' - ' + transfers[0].hash)\n } else {\n console.log(error)\n console.log('trying again')\n attachAddress(address)\n }\n })\n })\n}", "function sendTransaction(address, value) {\n logger.info('send tx ' + address)\n return new Promise((resolve, reject) => {\n eth.sendTransaction({\n from: keys.address,\n to: address,\n value: new BN(value),\n gas: 300000,\n data: '0x0',\n }, function(e, txHash) {\n if (e) reject(e)\n resolve({txHash})\n });\n })\n}", "sendLine(str, addr) {\n this.sendChar(addr, 0);\n\n str.split('').forEach((c) => {\n this.sendChar(c.charCodeAt(0), 1);\n });\n }", "function sendProactiveMessage(address) {\n var msg = new builder.Message().address(address);\n \n\tconst util = require('util');\n\n\tmsg.text(address.text);\n\n\tmsg.textLocale('en-US');\n bot.send(msg);\n}", "function addMicroChainFund(inaddr, num) {\n logger.info(\"addFund\", inaddr);\n sendtx(baseaddr, inaddr, num, '0xa2f09dfa')\n}", "function sendcmsg(type, addr, txt, extra){\r\n try{\r\n var dat = {type: type, addr: addr, data: txt, extra: extra};\r\n $.ajax({\r\n type: 'POST',\r\n url: '/Data',\r\n data: dat,\r\n async: false\r\n });\r\n }catch(e){\r\n logdbg(\"SendCMsgError: \" + e);\r\n }\r\n}", "function send(strAddress, amount) {\n if (contract.getBalance() < amount) throw new Error('Not enough funds for \"send\"');\n coinsRemained = _spendCoins(coinsRemained, Constants.fees.INTERNAL_TX_FEE);\n objCallbacks.createInternalTx(strAddress, amount);\n contract.withdraw(amount);\n }", "function sendTo(user_id, phoneNr, callback) {\n createOTP(function(otp) {\n // addOTPtoOTPDatabase(user_id, otp, function(err) {\n // if(!err) {\n sendOTPMessage(phoneNr, otp, function(err, res, body) {\n if(!err) {\n callback(null, otp);\n } else {\n callback(err, null);\n }\n })\n // } else {\n // callback(err, null);\n // }\n // })\n })\n}", "function netwSend(aceObj,txPack) {\n \n // jeigu paketas nenurodytas tada vadinasi reikia siutimą vykdyti iš cache\n if(txPack===null){\n txPack = aceObj.TxCache;\n // console.log(\"ACEPRO-NET UDP Sent from Cache.\");\n }else{\n aceObj.TxCache = txPack;\n // console.log(\"ACEPRO-NET UDP Sent. No Cache used.\");\n }\n \n const TxBuf = Buffer.allocUnsafe(28);\n TxBuf.writeUInt32BE(txPack.CMD, 0);\n TxBuf.writeUInt32BE(txPack.Src, 4);\n TxBuf.writeUInt32BE(txPack.Dst, 8);\n TxBuf.writeInt32BE(txPack.State, 12);\n TxBuf.writeUInt32BE(txPack.IOID, 16);\n TxBuf.writeDoubleBE(txPack.val, 20);\n srv.send(TxBuf, 0, TxBuf.length, port, BrCastAddr, function() {\n // console.log(\"ACEPRO-NET UDP Sent '\" + JSON.stringify(txPack) + \"'\");\n }); \n \n }", "function sendOTPMessage(phoneNr, otp, callback) {\n var headers = {\n 'Authorization': AUTH,\n 'Content-Type': CONTENTTYPE,\n 'Accept': CONTENTTYPE\n };\n var messageWithOTP = MESSAGE.replace('@OTP@', otp);\n var dataString = '{\"message\":\"' + messageWithOTP + '\",\"destinations\":[\"' + phoneNr + '\"]}';\n\n var options = {\n url: 'https://api.enco.io/sms/1.0.0/sms/outboundmessages?forceCharacterLimit=false',\n method: 'POST',\n headers: headers,\n body: dataString\n };\n\n request(options, function(err, res, body) {\n console.log(options);\n callback(err, res, body);\n });\n}", "sendMessage(msg, address) {\n let message = Buffer.from(msg);\n this.socket.send(message, this._sendingPort, address);\n }", "sendInvite(address) {\n console.log('SEND INVITE');\n this\n .setOtherAddress(address)\n .contractInstance\n .init(this.otherAddress, this.gx, {from: this.accountAddress});\n }", "function registerOpen(subchainaddr) {\n logger.info(\"registerOpen\", subchainaddr);\n sendtx(baseaddr, subchainaddr, '0', '0x5defc56c');\n}", "function sendEmail(address) {\n window.location.href = 'mailto:' + address;\n }", "function Teleport(r, c, l) {\n\n\t}", "function sendTransfer(address, value, messageTrytes) {\n\n var transfer = [{\n 'address': address,\n 'value': parseInt(value),\n 'message': messageTrytes\n }]\n\n console.log(\"Sending Transfer\", transfer);\n\n // We send the transfer from this seed, with depth 4 and minWeightMagnitude 18\n iota.api.sendTransfer(seed, 4, 9, transfer, function(e) {\n\n if (e){\n\n var html = '<div class=\"alert alert-danger alert-dismissible\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button><strong>ERROR!</strong>' + e + '.</div>'\n $(\"#send__success\").html(JSON.stringify());\n\n $(\"#submit\").toggleClass(\"disabled\");\n\n $(\"#send__waiting\").css(\"display\", \"none\");\n\n } else {\n\n var html = '<div class=\"alert alert-info alert-dismissible\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button><strong>Success!</strong> You have successfully sent your transaction. If you want to make another one make sure that this transaction is confirmed first (check in your client).</div>'\n $(\"#send__success\").html(html);\n\n $(\"#submit\").toggleClass(\"disabled\");\n\n $(\"#send__waiting\").css(\"display\", \"none\");\n\n balance = balance - value;\n updateBalanceHTML(balance);\n }\n })\n }", "writeRegister (addr, val) {\r\n const data = [(addr << 1) & 0x7E, val];\r\n const uint8Data = Uint8Array.from(data);\r\n this.wpi.wiringPiSPIDataRW(0, uint8Data);\r\n }", "async function printTxOrSend(call) {\n if (program.opts().send) {\n const { pair } = await useKey();\n // const r = await call.signAndSend(pair, );\n // How to specify {nonce: -1}?\n const r = await new Promise(async (resolve, reject) => {\n const unsub = await call.signAndSend(pair, (result) => {\n if (result.status.isInBlock) {\n let error;\n for (const e of result.events) {\n const { event: { data, method, section } } = e;\n if (section === 'system' && method === 'ExtrinsicFailed') {\n error = data[0];\n }\n }\n unsub();\n if (error) {\n reject(error);\n } else {\n resolve({\n hash: result.status.asInBlock.toHuman(),\n events: result.toHuman().events,\n });\n }\n } else if (result.status.isInvalid) {\n unsub();\n resolve();\n reject('Invalid transaction');\n }\n });\n });\n printObject(r, 4);\n } else {\n console.log(call.toHex());\n }\n}", "async function walletSend(wallet, address, amount) {\n await runAndWaitForRecipientTransactions(wallet, \"sendTransaction\", {\n dest: address,\n value: amount,\n bounce: false,\n flags: 1,\n payload: \"\",\n });\n}", "sendChain(socket) {\n socket.send(\n JSON.stringify({\n type: MESSAGE_TYPES.chain,\n chain: this.blockchain.chain,\n })\n );\n }", "function delayCoding(datum, delay_ms) {\n setTimeout(function() {\n codeOneAddress(datum);\n }, delay_ms);\n}", "[kUsePreferredAddress](address) {\n process.nextTick(() => {\n try {\n this.emit('usePreferredAddress', address);\n } catch (error) {\n this.destroy(error);\n }\n });\n }", "sendChain(socket) \n\t{\n \t\tsocket.send(JSON.stringify({ type: MESSAGE_TYPES.chain, chain: this.blockchain.chain }));\n \t}", "sendChain(socket)\n {\n socket.send(JSON.stringify(\n {\n type: MESSAGE_TYPES.chain,\n chain: this.blockchain.chain\n }));\n }", "bus_rx(data) { this.send('bus-rx', data); }", "setBusAddress( busAddress: APSBusAddress ) {\n this.busAddress= busAddress;\n }", "async function sendToken(toAddress, amount, callback) {\n await signAndBroadcast(\n 'MsgSend',\n {\n toAddress,\n amounts: [{denom: 'dbctoken', amount: amount}]\n },\n callback\n );\n}", "function CallWStdOut() {\r\n}", "function write_str(addr_low, addr_high, str)\n{\n set_base(addr_low, addr_high)\n for (i = 0; i < str.length / 4; i++) {\n var str4 = (str.charCodeAt(i+3)<<24) | (str.charCodeAt(i+2)<<16) |\n (str.charCodeAt(i+1)<<8) | (str.charCodeAt(i))\n cbuf[i] = str4;\n }\n cbuf[i] = 0x0 //NULL '\\0'\n restore_base()\n}", "async sendTransactionToContract(targetAddress,numberOfTokens) {\n\n // load AbI through interface. \n let iface = new ethers.utils.Interface(/** ABI */);\n\n params: [{\n \"from\": accounts[0] ,\n \"to\": /** Token_contract_Address */,\n \"gas\": \"0x76c0\", // 30400\n \"gasPrice\": \"0x9184e72a000\", // 10000000000000\n \"value\": \"0\", // 2441406250\n \"data\": iface.functions.transfer.encode([ targetAddress, numberOfTokens ])\n }]\n\n ethereum.sendAsync({\n method: 'eth_sendTransaction',\n params: params,\n from: accounts[0], // Provide the user's account to use.\n }, (err, response) => {\n if (error) {\n if (error.code === 4001) { // EIP 1193 userRejectedRequest error\n console.log('Please connect to MetaMask.')\n } else {\n console.error(error)\n }\n } else {\n // this method will return a transaction hash on success.\n const result = response.result\n console.log(result)\n }\n })\n }", "function sendPinCommand(pin)\n \t{\n \t\tvar pinCommand = \"@ar\"; // Request ID command definition\n \t\tvar view = new Uint8Array(4); // View to contain the command being sent\n \t\t\n \t\t// Fill view with the commands individual bytes\n \t\tfor(var x = 0; x < pinCommand.length; x++)\n \t\t{\n \t\t\tview[x] = pinCommand.charCodeAt(x);\n \t\t}\n \t\t\n \t\tview[3] = pin;\n \t\t\n \t\tdevice.send(view.buffer); // Send command\n \t}", "writePort(address, value) {\n this.incTStateCount(1);\n this.hal.writePort(address, value);\n this.incTStateCount(3);\n }", "function getAddress(addr) \r\n\t{\r\n let address = '';\r\n address = addr ? addr : document.getElementById('address').value;\r\n address = address.trim();\r\n\t\t\r\n\t\tif ( ! _delta.web3.isAddress(address))\r\n\t\t{\r\n\t\t\t//check if url ending in address\r\n\t\t\tif(address.indexOf('/0x') !== -1)\r\n\t\t\t{\r\n\t\t\t\tlet parts = address.split('/');\r\n\t\t\t\tlet lastSegment = parts.pop() || parts.pop(); // handle potential trailing slash\r\n\t\t\t\tif(lastSegment)\r\n\t\t\t\t\taddress = lastSegment;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(! _delta.web3.isAddress(address)) \r\n\t\t\t{\r\n\t\t\t\tif (address.length == 66 && address.slice(0, 2) === '0x') \r\n\t\t\t\t{\r\n\t\t\t\t\t// transaction hash, go to transaction details\r\n\t\t\t\t\twindow.location = window.location.origin + window.location.pathname + 'tx.html#' + address;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t} \r\n\r\n\t\t\t\t// possible private key, show warning (private key, or tx without 0x)\r\n\t\t\t\tif (address.length == 64 && address.slice(0, 2) !== '0x') \r\n\t\t\t\t{\r\n\t\t\t\t\tif (!addr) // ignore if in url arguments\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tshowError(\"You likely entered your private key, NEVER do that again\");\r\n\t\t\t\t\t\t// be nice and try generate the address\r\n\t\t\t\t\t\taddress = _util.generateAddress(address);\r\n\t\t\t\t\t}\r\n\t\t\t\t} \r\n\t\t\t\telse if (address.length == 40 && address.slice(0, 2) !== '0x') \r\n\t\t\t\t{\r\n\t\t\t\t\taddress = `0x${addr}`;\r\n\t\t\t\t\t\r\n\t\t\t\t} \r\n\t\t\t\telse \r\n\t\t\t\t{\r\n\t\t\t\t\tif (!addr) // ignore if in url arguments\r\n\t\t\t\t\t{\r\n\t\t\t\t\t showError(\"Invalid address, try again\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn undefined;\r\n\t\t\t\t}\r\n\t\t\t\tif(! _delta.web3.isAddress(address))\r\n\t\t\t\t{\r\n\t\t\t\t\tif (!addr) // ignore if in url arguments\r\n\t\t\t\t\t{\r\n\t\t\t\t\t showError(\"Invalid address, try again\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn undefined;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tdocument.getElementById('address').value = address;\r\n\t\tdocument.getElementById('addr').innerHTML = 'Address: <a target=\"_blank\" href=\"' + _delta.addressLink(address) + '\">' + address + '</a>';\r\n\t\tsetAddrImage(address);\r\n\t\treturn address;\r\n }", "function sendSMS(paymentDetails){\n\n var content = 'ING AeroCash Online Service PassCode: '+ paymentDetails.authorizationCode +'. Thank you for using our services!';\n telerivet.sendSMS(paymentDetails.phoneNumber,content);\n}", "function convertAddress(s) {\n var chars = [];\n for (var i = 0; i < s.length; i += 1) {\n var code = s.charCodeAt(i);\n if (code >= 0x2400) {\n code -= 0x2400;\n }\n chars.push(String.fromCharCode(code));\n }\n return chars.join('');\n}", "function requestPaymentNotification(btcAddress) {\n if (connection.connected) {\n var json = {\n \t\t\t\"event\": \"transactions:create\",\n \t\t\t\"filters\": {\n \t\t\t\"addresses\": [btcAddress]\n \t\t\t}\n\t\t\t}\n connection.sendUTF(JSON.stringify(json));\n //setTimeout(sendNumber, 1000);\n }\n }", "updateAddress(address) {\n let dataURL = `${_environments_environment__WEBPACK_IMPORTED_MODULE_1__[\"environment\"].apiURL}/user/address`;\n return this.httpClient.post(dataURL, address).pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"retry\"])(1), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_2__[\"catchError\"])(this.handleError));\n }", "function SendPortSync() {\n}", "function callbackDNS1(error,address){\n console.log(\"paso1\");\n console.log(address);\n console.log(\"end paso1\");\n}", "function sendCommand(cmd) {\n\tvar command = [0, cmd];\n\tvar info = {\n\t\tdirection: 'out',\n\t\tendpoint: 2,\n\t\tdata: new Uint8Array(command).buffer\n\t};\n\n\tchrome.usb.interruptTransfer(mp_device, info, sendCompleted);\n}", "writeByte(address, value) {\n this.incTStateCount(3);\n this.writeByteInternal(address, value);\n }", "function registerClose(subchainaddr) {\n logger.info(\"registerClose\", subchainaddr);\n sendtx(baseaddr, subchainaddr, '0', '0x69f3576f');\n}", "async function sendTx(addr){\n let myAddresses = [CONFIG.FAUCET_ADDRESS];\n // console.log(myAddresses);\n let utxos = await avm.getUTXOs(myAddresses);\n // console.log(utxos.getAllUTXOs());\n let sendAmount = new BN(CONFIG.DROP_SIZE);\n\n\n // If balance is lower than drop size, throw an insufficient funds error\n let balance = await avm.getBalance(CONFIG.FAUCET_ADDRESS, CONFIG.ASSET_ID);\n let balanceVal = new BN(balance.balance);\n\n if(sendAmount.gt(balanceVal)){\n console.log(\"Insufficient funds. Remaining AVAX: \",balanceVal.toString());\n return {\n status: 'error',\n message: 'Insufficient funds to create the transaction. Please file an issues on the repo: https://github.com/ava-labs/faucet-site'\n }\n }\n // console.log(avm.getBlockchainID());\n let unsigned_tx = await avm.buildBaseTx(utxos, sendAmount, CONFIG.ASSET_ID,[addr], myAddresses, myAddresses ).catch(err => {\n console.log(err);\n });\n\n // Meaning an error occurred\n if(unsigned_tx.status){\n return unsigned_tx;\n }\n\n let signed_tx = avm.signTx(unsigned_tx);\n let txid = await avm.issueTx(signed_tx);\n\n console.log(`(X) Sent a drop with tx id: ${txid} to address: ${addr}`);\n return txid;\n}", "address (state, address) {\n state.address = address\n }", "function plusAddr(addr, off) {\n var newaddr = {};\n newaddr['off'] = addr['off'] + off;\n newaddr['b'] = addr['b'];\n newaddr['v'] = addr['v'];\n return newaddr;\n}", "function plusAddr(addr, off) {\n var newaddr = {};\n newaddr['off'] = addr['off'] + off;\n newaddr['b'] = addr['b'];\n newaddr['v'] = addr['v'];\n return newaddr;\n}", "function plusAddr(addr, off) {\n var newaddr = {};\n newaddr['off'] = addr['off'] + off;\n newaddr['b'] = addr['b'];\n newaddr['v'] = addr['v'];\n return newaddr;\n}", "function plusAddr(addr, off) {\n var newaddr = {};\n newaddr['off'] = addr['off'] + off;\n newaddr['b'] = addr['b'];\n newaddr['v'] = addr['v'];\n return newaddr;\n}", "function fBCxxWrite(nAddr,nVal)\n{\n\tswitch (a = nAddr){\n\t\tcase 0xBDE8: return; // nBDE8 = nVal; // Eventually\n\t\tcase 0xBDE9: return; // nBDE9 = nVal;\n\t\tcase 0xBDEA: return fMouseCtrl(nVal);\n\t\tcase 0xBFFE:\n if (bRAMROM_enable){\n aBFFE=nVal;\n if (nVal & 8){\n bBBC = true;\n fInitAddr();\n fClearMemory();\n break;\n } else if (bBBC == true){\n bBBC = false;\n fInitAddr();\n fClearMemory();\n break;\n }\n return aBFFE;\n } else {\n aBFFE=0;\n return;\n }\n\n case 0xbfff:\n if (bRAMROM_enable){\n aBFFF = nVal&7;\n return (aBFFF);\n } else {\n aBFFF = 0;\n return;\n }\n\n default:\n// tMessage (\"Write \" + nAddr.toString(16) + \",\" + nVal+ \" PC:\" + PCR.toString(16));\n\n }\n}", "address(value) {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__ethersproject_address__[\"a\" /* getAddress */])(value);\n }", "function transport(zone,cmd) {\n var url, xml, soapBody, soapAction;\n //var _activeZone = jQuery('#ZoneSelect')[0].selectedIndex;\n var host = _sonosTopology.zones[zone].ip + _port;\n url = '/MediaRenderer/AVTransport/Control';\n soapAction = \"urn:schemas-upnp-org:service:AVTransport:1#\" + cmd;\n soapBody = '<u:' + cmd + ' xmlns:u=\"urn:schemas-upnp-org:service:AVTransport:1\"><InstanceID>0</InstanceID><Speed>1</Speed></u:' + cmd + '>';\n xml = _soapRequestTemplate.replace('{0}', soapBody);\n sendSoapRequest(url, host, xml, soapAction, RequestType.transport, zone);\n}", "function sendToSerial(data) {\n console.log(\"sending to serial: \" + data);\n port.write(data);\n}", "becomeGameSponsor({ gameSponsorFee }) {\n this.CONTRACT\n .becomeGameSponsor\n .sendTransaction(\n {\n \"from\": MYWeb3.getAccount(),\n \"gas\": MYWeb3.toHex(400000),\n \"value\": MYWeb3.toWei(gameSponsorFee),\n },\n function (err, result) {}\n );\n }", "function doCall() {\n\tconsole.log('Sending offer to peer');\n\tpc.createOffer(setLocalAndSendMessage, handleCreateOfferError);\n}", "send(msg) {\n if (this.connectionId < 0) {\n throw 'Invalid connection';\n }\n chrome.serial.send(this.connectionId, str2ab(msg), function () {\n });\n }", "async function sendSMS(req, res) {\n const {contactId} = req.params;\n const response = await autopilot.journeys.add('0001', xss(contactId));\n console.log(response);\n res.success();\n}", "function uumsgpost(address, // @param Array/Mix: address or guid\r\n // [instance, ...] is multicast\r\n // instance is unicast\r\n // null is broadcast\r\n message, // @param String: message\r\n param) { // @param Mix(= void): param\r\n var that = this;\r\n\r\n setTimeout(function() {\r\n that.send(address ? uu.array(address) : that._broadcast, message, param);\r\n }, 0);\r\n}", "function buyInsurance(fromaddr,password,value){\n web3.personal.unlockAccount(fromaddr,password,5);\n contract.payInsurance({from:\tfromaddr,value:web3.toWei(value, \"ether\"),\tgas:300000});\n}", "function SendCmd(cmd)\n{\n try {\n this.interfaces[0].endpoints[1].transfer(cmd, function(error) {\n if (error) {\n Log('AVR'+this.avrNum, 'send error');\n ForgetAVR(this);\n }\n });\n }\n catch (err) {\n Log('AVR'+this.avrNum, 'send exception');\n ForgetAVR(this);\n }\n}", "function send(self, service, data) {\n return CIPLayer.send(self, false, service, PCCC_EPATH, data);\n}", "function sendTest (self) {\n\tself.send('\\ufffb\\ubfff');\n}", "function addStake(addr, amount) {\n result = linkgearPOS.addStake(addr,amount);\n console.log(result)\n}", "async sendEther(amount, to_address) {\n\n params: [{\n \"from\": accounts[0] ,\n \"to\": to_address,\n \"gas\": \"0x76c0\", // 30400\n \"gasPrice\": \"0x9184e72a000\", // 10000000000000\n \"value\": ethers.utils.parseEther(amount)\n }]\n\n ethereum.sendAsync({\n method: 'eth_sendTransaction',\n params: params,\n from: accounts[0], // Provide the user's account to use.\n }, (err, response) => {\n if (error) {\n if (error.code === 4001) { // EIP 1193 userRejectedRequest error\n console.log('Please connect to MetaMask.')\n } else {\n console.error(error)\n }\n } else {\n // this method will return a transaction hash on success.\n const result = response.result\n console.log(result)\n }\n })\n }", "async send_cmd(cmd, options={}) {\n const data = options.data;\n const textDecode = (options.textDecode !== undefined ? !!options.textDecode : true);\n const sleepOverride = (parseInt(options.sleepOverride) || 10);\n const cmdIndex = (parseInt(options.cmdIndex) || 0);\n\n if (!this.device || !this.device.opened) {\n this.log(\"error: device not connected.\\n\", \"red\");\n this.log(\"Use button to connect to a supported programmer.\\n\", \"red\");\n return Promise.reject(\"error: device not opened\");\n }\n\n const opts = {\n requestType: \"vendor\",\n recipient: \"device\",\n request: 250,\n value: this.CMD_LUT[cmd],\n index: cmdIndex\n };\n\n // transfer data out\n const res = data\n ? await this.device.controlTransferOut(opts, data)\n : await this.device.controlTransferOut(opts);\n\n // sleep for a bit to give the USB device some processing time leeway\n await (() => new Promise(resolve => setTimeout(resolve, sleepOverride)))();\n\n return this.device.controlTransferIn({\n requestType: \"vendor\",\n recipient: \"device\",\n request: 249,\n value: 0x70,\n index: 0x81\n }, 64).then(result => {\n return textDecode\n ? (new TextDecoder()).decode(result.data)\n : result.data.buffer;\n });\n }", "function address(address)\r\n{\r\n var requestAddr = new XMLHttpRequest();\r\n requestAddr.onreadystatechange = function() {\r\n if (this.readyState == 4) {\r\n dataAddr = JSON.parse(this.responseText);\r\n dataAddr = dataAddr._embedded.addresses[0];\r\n popuAddrDetails(dataAddr);\r\n }\r\n };\r\n\r\n requestAddr.open(\"GET\", address, true);\r\n requestAddr.send();\r\n}", "function postToCa(request,data){\n console.log(\"posting csr to ca:\");\n console.log(data);\n //http-post header / optionen\n var caPostOptions = {\n hostname: 'h2418540.stratoserver.net',//localhost\n // hostname: 'localhost',//localhost\n port: 8080,\n path: '/certificateRequests',\n method: 'POST',\n headers: {\n 'Content-Type': 'text/plain',\n 'Content-Length': data.length\n }\n };\n \n //request an ca aufbauen\n var req = http.request(caPostOptions,function(res){\n //antwort der ca \n console.log(\"response ca: \" + res.statusCode);\n var caResponse = '';\n //ca schickt daten, kann in mehreren blöcken geschehen(theoretisch)\n var data;\n res.on('data', function(chunk){\n console.log(\"chunk: \"+ chunk);\n caResponse += chunk;\n //mail(request,chunk);\n //verifyCert(chunk.toString());\n });\n \n //fehler bei http-post\n res.on('error', function(e){\n console.log(\"error: \" + e);\n return false;\n });\n \n res.on('end', function () {\n console.log('end');\n mail(request,caResponse);\n //verifyCert(data.toString());\n });\n \n })\n //request schreiben und schicken\n req.write(data);\n req.end();\n return true;\n}", "function sendsignuplink(name, email, password, ctx) {\n var pw_aes = new sjcl.cipher.aes(prepare_key_pw(password));\n var req = {\n a: 'uc',\n c: base64urlencode(a32_to_str(encrypt_key(pw_aes, u_k)) + a32_to_str(encrypt_key(pw_aes, [\n rand(4294967296),\n 0,\n 0,\n rand(4294967296)\n ]))),\n n: base64urlencode(to8(name)),\n m: base64urlencode(email)\n };\n api_req(req, ctx);\n}", "writeChar(address, value) {\n throw new Error(\"Must be implemented\");\n }", "function PushCustomerAddress(poId)\n{\n try\n {\t\t\n var soId = nlapiLookupField(\"purchaseorder\",poId,\"createdfrom\");\n if(soId != null && soId != \"\")\n {\n var shipTo = nlapiLookupField(\"salesorder\",soId,\"shipaddress\");\n\n if(shipTo != null && shipTo != \"\")\n {\n var shipAddress = shipTo.split('\\n');\n SendNStoPortal(shipAddress,poId,\"2175\");\n }\n }\n else\n {\n nlapiLogExecution(\"debug\",\"Sales order record does not link with existing PO\");\n }\n }\n catch(ex)\n {\n nlapiLogExecution(\"debug\",\"Error on pushing ship address is : \",ex.message);\n }\n}", "function cSend(cmd) {\n\t mpd.send(cmd,function() {\n\t });\n }", "async function traceroute(url) {\n if (!window.vcs.hyperloop) { \n await window.vcs.hyperloop_connect() \n }\n\n return await window.vcs.hyperloop_call({\n id: \"sattsys.hyperloop.traceroute\",\n args: { url }\n });\n}", "function callInicioSocket() {\r\n\tconsole.log(\"Peticion Inicio # \" + MAIN_SERVER_UDP_PORT + \" # \" + APP_ID);\r\n\t\r\n\tvar ab = str2ab(INICIO + \";\" + APP_ID);\r\n\tsocketUdp.write(socks.socketId, ab, writeComplete);\r\n}", "contact(callback, phoneNumber, ucid, optionalParams=null) {\n var params = {\n phone_number: phoneNumber,\n ucid: ucid\n };\n if (optionalParams != null) {\n params = Object.assign(params, optionalParams)\n }\n\n this.rest.execute(callback, \"GET\", util.format(this.contactResource, phoneNumber), params);\n }", "subscribeToNotifyCC(func) {\n // Do something with the data recieved.\n this.socket.on('notify-cc', (data) => {\n func(data);\n });\n }", "function sendSMS(phone, oip) {\n mobilecommons.profile_update(phone, oip);\n}", "cc(address, name) {\n this.nodeMailerMessage.cc = this.nodeMailerMessage.cc || [];\n this.nodeMailerMessage.cc.push(this.getAddress(address, name));\n return this;\n }", "function withdrawStake(addr, amount) {\n result = linkgearPOS.withdrawStake(addr,amount)\n console.log(result)\n}", "function getOutgoingTransactionsFromAddress() {\r\n let adr = address.value;\r\n let sanitizedAdr = adr.toUpperCase().replace(/-|\\s/g, \"\");\r\n if (adr == \"\") {\r\n address.focus();\r\n return false;\r\n }\r\n _doGet('/account/transfers/outgoing?address=' + sanitizedAdr);\r\n }", "_send(obj) {\n this._stream.send(DDPCommon.stringifyDDP(obj));\n }", "async sendTXSelf() {\n const txHash = await this.send({ to: this.address, value: 1000000000000 })\n console.log(\"TX:\", txHash)\n return true\n }", "async function userSendCmd (inpcmd) {\n const cmd = inpcmd.trim()\n terminalPrint('=> ' + cmd) // Extern\n blxErrMsg = 0\n if (cmd.startsWith('.')) await blxSysCmd(cmd.substr(1))\n else await blxDeviceCmd(cmd)\n await blxCheckIDs()\n if (blxErrMsg) terminalPrint(blxErrMsg)\n }", "setWithdrawAddr(withdrawAddress, baseTx) {\n return __awaiter(this, void 0, void 0, function* () {\n const from = this.client.keys.show(baseTx.from);\n const msgs = [\n {\n type: types.TxType.MsgSetWithdrawAddress,\n value: {\n delegator_address: from,\n withdraw_address: withdrawAddress,\n }\n }\n ];\n return this.client.tx.buildAndSend(msgs, baseTx);\n });\n }", "sendCustomerRequest(){\n // request will be sent to the customer that requested the ride\n var request= {\n taxiNumber: this.state.taxiNumber,\n id: this.socket.id,\n phoneNumber: this.state.phoneNumber,\n }\n this.socket.emit('customer request', request);\n }", "sendChain(socket) {\n socket.send(JSON.stringify(this.blockchain.chain)); // sending message to each socket\n }", "function obMail(a, b) {\n window.location.href = \"mail\" + \n \"to:\" + \n window.atob(a) +\n \"?subject=\" + \n escape(\"Mask Request from Mutual Aid Arlington\") +\n \"&body=\" + \n escape(b)\n ;\n}", "function uumsgregister(instance) { // @param Instance: class instance\r\n this._addressMap[uuclassguid(instance)] = instance;\r\n this._broadcast = uu.keys(this._addressMap);\r\n}", "function addToContact(oneUser) {\n // oneUser = {\n // username : username,\n // email: email,\n // id: id\n // };\n\n var curState = getUserContactState(oneUser.email);\n var userState = \"\";\n\n switch (curState) {\n case \"NOT_EXIST\" :\n case \"ADDED\" :\n case \"DECLINED\" :\n default:\n userState = \"ADDED\";\n break;\n case \"INVITED\" :\n userState = \"CONTACTED\";\n break;\n case \"CONTACTED\" :\n addMsgFromSys(\"This user already had a contact with you!\");\n break;\n }\n\n var timeid = (new Date()).getTime();\n var contact_id = userSelf.email + \"_\" + oneUser.email + \"_\" + timeid;\n var msgObj = {\n from: {\n username: userSelf.username,\n email: userSelf.email,\n password: userSelf.password,\n img: userSelf.img\n },\n toAdd: {\n state: userState,\n contact_id: contact_id,\n msg_budge: 0,\n username: oneUser.username,\n email: oneUser.email,\n img: oneUser.img\n }\n };\n\n socket.emit('addToContact', msgObj);\n}", "function registerOracle(address, callback)\n {\n let premium = web3.utils.toWei(\"1\", \"ether\");\n flightSuretyApp.methods.registerOracle()\n .send({from: address, value: premium, gas: config.gas}, (error, result) => {\n console.log('Inside the server.js file - registerOracle function');\n console.log(error, result);\n callback(error, result);\n });\n }", "transmitEvent(event,address){\n this.activateRadio();\n axios.post(address,event).then((res) => {\n\n console.log(\"Device ID:\"+this.deviceId+\", Transmission Successful!\");\n this.deactivateRadio();\n\n }).catch((error) => {\n console.error(error);\n });\n }", "getAddressString () {\n return secUtil.bufferToHex(this.getAddress())\n }", "function sendMessage(address, value) {\n\tlet postData = JSON.stringify({ id: 1, 'address': address,\n 'value': value });\n\n//\txmlHttpRequest.open(\"POST\", HOST + '/sendMessage', true);\n\txmlHttpRequest.open(\"POST\", HOST + '/sendMessage', false);\n xmlHttpRequest.setRequestHeader(\"Content-Type\", \"application/json\");\n\txmlHttpRequest.send(postData);\n}", "async call(to) {\n await this.map.set('make#call', { to: to });\n }", "async function payf(){\r\n var web3=new Web3(window.ethereum)\r\n\t\r\n window.ethereum.enable()\r\n\r\n var a=\"0x8E381898f5ed1Ce23e09F1D16375721E44dABa09\";\r\n var amount=1;\r\n const accounts = await web3.eth.getAccounts();\r\n \r\n web3.eth.sendTransaction({\r\n to:a,\r\n value:amount,\r\n from:accounts[0]\r\n },(err,transactionId)=>{\r\n if(err){\r\n console.log(\"failed\",err)\r\n }\r\n else{\r\n console.log(\"success\",transactionId);\r\n }\r\n }\r\n )\r\n\r\n\r\n}", "function SendMessage()\r\n{\t\r\n //Note: You can send to a specific client by passing\r\n //the IP address as the second parameter.\r\n\tserv.SendText( count-- );\r\n\tif( count < 0 ) count = 10;\r\n}", "_writeRegisters(addressToRead, dataToWrite, callback){\n\t\tthis.queue.place( () => {\n\t\t\tthis.i2c.send( new Buffer([addressToRead, dataToWrite]), (err, data) => {\n\t\t\t\tthis.queue.next();\n\t\t\t\tif( callback ){\n\t\t\t\t\tcallback(err, data);\n\t\t\t\t}\n\t\t\t})\n\t\t});\n\t}" ]
[ "0.53880954", "0.5215648", "0.51981896", "0.51842564", "0.5166067", "0.51105434", "0.50891536", "0.5023047", "0.49253744", "0.49253485", "0.49173206", "0.49079472", "0.4881413", "0.48292726", "0.4816638", "0.47931868", "0.47452828", "0.47395355", "0.47036067", "0.46772507", "0.46651012", "0.46010453", "0.4585639", "0.4584978", "0.4548386", "0.45448315", "0.45383137", "0.4537905", "0.45271477", "0.4526548", "0.45263198", "0.4520351", "0.45186523", "0.45141712", "0.45090067", "0.45054176", "0.44808936", "0.44658637", "0.44575012", "0.44563127", "0.4456076", "0.44540203", "0.44525027", "0.444832", "0.44470719", "0.44305214", "0.4426616", "0.4422672", "0.4421635", "0.44191644", "0.44124213", "0.44124213", "0.44124213", "0.44124213", "0.4411935", "0.44101855", "0.43999782", "0.43971318", "0.4396553", "0.4391873", "0.438512", "0.43812025", "0.43776068", "0.43693444", "0.4367169", "0.4358204", "0.43517926", "0.43516338", "0.43513855", "0.43502903", "0.4347855", "0.43453342", "0.43451408", "0.43346402", "0.4330893", "0.4327549", "0.43269095", "0.43265662", "0.4324205", "0.4321828", "0.43082935", "0.4307588", "0.43069345", "0.43068466", "0.42976335", "0.42969605", "0.42959085", "0.4291853", "0.42913523", "0.42863703", "0.4281722", "0.42804164", "0.42788142", "0.42777747", "0.4275395", "0.42730245", "0.42727134", "0.42718193", "0.4269442", "0.42635873", "0.42622384" ]
0.0
-1
Send `uscrt` to multiple addresses.
async sendMany (txs = [], memo = "", denom = 'uscrt', fee = SecretNetwork.Gas(500000 * txs.length)) { if (txs.length < 0) { throw new Error('tried to send to 0 recipients') } const from_address = this.address //const {accountNumber, sequence} = await this.API.getNonce(from_address) let accountNumber, sequence const msg = await Promise.all(txs.map(async ([to_address, amount])=>{ ({accountNumber, sequence} = await this.API.getNonce(from_address)) // increment nonce? if (typeof amount === 'number') amount = String(amount) const value = {from_address, to_address, amount: [{denom, amount}]} return { type: 'cosmos-sdk/MsgSend', value } })) const signBytes = makeSignBytes(msg, fee, this.network.chainId, memo, accountNumber, sequence) return this.API.postTx({ msg, memo, fee, signatures: [await this.sign(signBytes)] }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateUsers(dcnt) {\n io.sockets.emit('join', {\n names: Object.keys(allUsrName), //just get all their names\n dcnt: dcnt\n });\n }", "function sendAll(obj) {\n clients.forEach((client) => {\n send(client, obj);\n })\n}", "forEach(callback) {\n for (let i = 0; i < this.#transports.length; ++i) {\n callback.call(this, this.#transports[i], i);\n }\n }", "function tranferToMany(records, coin_type){\n return new Promise((resolve, reject)=>{\n var temp = {};\n var obj = null;\n for(var i=0; i < records.length; i++) {\n obj=records[i];\n if(!temp[obj.to_address]) {\n temp[obj.to_address] = obj;\n } else {\n temp[obj.to_address].value += obj.value;\n }\n }\n var result = [];\n for (var prop in temp)\n result.push(temp[prop]);\n var temp1 ={}\n var pars = [\"\"]\n result.forEach(element => {\n temp1[element.to_address] = parseFloat(element.value.toFixed(8));\n });\n pars.push(temp1)\n rpc.requestNode('walletpassphrase', [config.WALLET_PASSWORD, 15]); \n setTimeout(async function(){\n //send transaction\n var txn_id = await rpc.requestNode('sendmany', pars);\n if(txn_id){\n resolve(txn_id);\n }else{\n resolve(null)\n }\n },200)\n })\n}", "function sendClientDevices() {\n adminsWeb.forEach((currentClient) => {\n arduinoNM.connected[currentClient].emit('updateDevices', { online: devicesOnline, offline: devicesOffline })\n console.log('[LOG] Lista de clientes enviada ao cliente web.')\n })\n }", "sendMultiple(data, cb) {\n return this.send(data, true, cb);\n }", "async function readAddresses() {\n\tawait sendATCommand('MY');\n\tawait sendATCommand('SH');\n\tawait sendATCommand('SL');\n} // async readAddresses()", "function sendList(fromUser, txs, txresolve, node) {\n return function(scope) {\n const password = scope.users[fromUser].password;\n const fromAddress = scope.users[fromUser].address;\n return new Promise(function(resolve, reject) {\n verbose('sendList', {fromUser, txs, txresolve, node});\n api.setNode(node);\n return api.bloc.sendList({\n password: password,\n txs: txs,\n resolve: txresolve,\n }, fromUser, fromAddress)\n .then(function(result) {\n // store reslut\n var tx = {\n params: {fromUser, txs, txresolve, node},\n result: result,\n };\n scope.tx.push(tx);\n // verity results\n verifyListResult(txs, txresolve, result);\n // succcess\n resolve(scope);\n }).catch(errorify(reject));\n });\n }\n}", "sendToAll( messageObject ) { \n this.clientList.forEach( client => this.sendTo(client.ws, messageObject));\n }", "function SendToAll(functionCode , data)\n{\n\tfor(var i = 0; i < connectedWebClients.length; i++)\n\t\t{\n\t\t\t\n\t\t\tconnectedWebClients[i].sock.emit(functionCode , data);\n\t\t\tconsole.log('SENDING TO ' + connectedWebClients[i].id);\n\t\t}\n}", "distinct () {\n return uniqBy(this._multiaddrs, (ma) => {\n return [ma.toOptions().port, ma.toOptions().transport].join()\n })\n }", "distinct () {\n return uniqBy(this._multiaddrs, (ma) => {\n return [ma.toOptions().port, ma.toOptions().transport].join()\n })\n }", "distinct () {\n return uniqBy(this._multiaddrs, (ma) => {\n return [ma.toOptions().port, ma.toOptions().transport].join()\n })\n }", "distinct () {\n return uniqBy(this._multiaddrs, (ma) => {\n return [ma.toOptions().port, ma.toOptions().transport].join()\n })\n }", "addCertificates(list) {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n for (let i in list) {\r\n let a = list[i];\r\n let jws = a[\"@certificate\"];\r\n if (jws) {\r\n let json = yield this.verified(jws);\r\n let cert = JSON.parse(json);\r\n if (!(yield this.getKey(cert.subject.kid))) {\r\n yield this.addKey(cert.subject);\r\n }\r\n }\r\n }\r\n });\r\n }", "function sendUserToAll (cmd, user) {\n sendToAll({\n cmd: cmd,\n users: [user]\n })\n }", "function EncuentraContactos(contcs) {\n\t\n\tif ( network_ok()==false ){ return false; }\n\tif ( cntpred==1 ){ return false; } //Si usamos contactos predefinidos, no hay necesidad de buscar contactos\n\t\n\t$.post( def_url + '/actions_ses.php?ids=' + IdS + '&idu=' + IdU + '&a=chkContactsFind3', {\n\t\ta:'chkContactsFind3', lc: contcs\n\t}, function(respuesta) { \t\t\n if (chkSesion(respuesta)) {\n \n\t\t\tvar listContcs \t= respuesta.split('<|>');\n var local_cnt \t= \"\";\n\t\t\tvar temp_safe \t= \"\";\n\t\t\t\n\t\t\tfor (i = 0; i < listContcs.length; i++) {\n if (listContcs[i] !== \"\") {\n numele \t\t= i + 1; \n eleContcs \t= listContcs[i].split('<:>');\n\t\t\t\t\tif ( eleContcs[5] == \"-1\" || eleContcs[5] == -1 ){ temp_safe = \"\"; } else { temp_safe = eleContcs[5]; }\n local_cnt \t= { id: eleContcs[0], name: eleContcs[2], number: eleContcs[3], tp: eleContcs[4], name_safe: temp_safe };\n setInfo(\"clk_id_\" + eleContcs[3], JSON.stringify(local_cnt));\n }\n }\n\t\t\tchkLocalNames();\n }\n });\n}", "function sendCars1(...carIds) {\r\n carIds.forEach(id => console.log(id));\r\n}", "function send(ip, values, cb) {\n if(Array.isArray(values)){\n const socket = new net.Socket();\n socket.setTimeout(1500);\n socket.on(\"data\", (data) => {\n const response = data.toString(\"hex\");\n socket.end();\n cb(response, null)\n })\n socket.on(\"error\", (err) => {\n socket.destroy();\n cb(null, err)\n })\n socket.on(\"timeout\", () => {\n socket.destroy();\n cb(null, new Error(\"timed out\"))\n })\n socket.connect(port, ip);\n socket.write(Uint8Array.from(addCheckSum(values)), (err) => {\n if(err){\n console.log(err)\n socket.destroy();\n cb(null, err);\n } else{\n cb(null, null);\n }\n })\n } else {\n console.log(\"values to send is not an array\")\n }\n}", "distinct() {\n return uniqBy(this._multiaddrs, ma => {\n return [ma.toOptions().port, ma.toOptions().transport].join();\n });\n }", "addRecipients() {\n const personalize = new helper.Personalization();\n this.recipients.forEach(recipient => {\n personalize.addTo(recipient);\n });\n this.addPersonalization(personalize);\n }", "function suitelet_BatchSubsDirect(request, response){\n\t_REQ = request, _RESP = response, _PARAMS = {};\n\t\n\t__log.start({\n\t\t 'logtitle' : 'ICC-SL-BatchSubsDirect'\n\t\t,'company' \t : 'Misys'\n\t\t,'scriptname': 'Misys_FRD_R2R-004_SL_ICC_Transactions.js'\n\t\t,'scripttype': 'suitelet'\n\t});\n\t\n\t_HEADER_TEXT = 'Create Transaction for Direct Charges (Batch Process)';\t\n\t\n\treturn _suiteletPerPeriod(true, true);\n}", "function getUTXOsFromSignedTxsAndAddressesSet(txs, addresses) {\n\tassert(Array.isArray(txs));\n\tassert(addresses instanceof Set);\n\tconst allUTXOs = [];\n\ttxs.forEach(tx => {\n\t\tassert(tx instanceof bsv.Transaction);\n\t\tassert(Array.isArray(tx.outputs));\n\t\tallUTXOs.push(...getUTXOsFromSignedTxAndAddressesSet(tx, addresses));\n\t});\n\treturn allUTXOs;\n}", "function sendAll(content){\n //show what is happening\n console.log(\"Send All!\");\n\n //loop through every client in the array\n for(var i=0; i<CLIENTS.length; i++){\n CLIENTS[i].emit('server',content);\n }\n}", "async multi(domains) {\n return await this.sendWhoisRequest(domains)\n }", "unsubscribe( headers: {}, callback: () => mixed ) {\n if (!this.busAddress) throw new Error(\"Required bus address not provided!\");\n\n if ( headers[EVENT_ROUTING] != null ) {\n let routes = headers[EVENT_ROUTING][ROUTE_INCOMING];\n\n for ( let route: string of routes.split( ',' ) ) {\n // this.logger.debug( ` subscribe: route: ${route}` );\n\n // noinspection JSUnfilteredForInLoop,JSRedundantSwitchStatement\n switch ( route ) {\n\n case EVENT_ROUTES.CLIENT:\n let addressSubscribers = this.subscribers[this.busAddress.client];\n\n // noinspection SuspiciousTypeOfGuard\n if ( addressSubscribers != null && addressSubscribers !== undefined ) {\n\n let remix = addressSubscribers.indexOf( callback );\n addressSubscribers.splice( remix, 1 );\n }\n break;\n\n default:\n // OK\n }\n }\n }\n else {\n throw new Error( `No 'routing:' entry in headers: ${headers}!` );\n }\n }", "function subscribe_all()\r\n{\r\n rt_mon.subscribe('A',{},handle_records);\r\n //sock_send_str('{ \"msg_type\": \"rt_subscribe\", \"request_id\": \"A\" }');\r\n}", "function lsAccts() {\n\t\t$('#user .ls-accts .result').html('');\n \tweb3.eth.getAccounts(function(err, accounts) {\n \t\tfor(var i = 0; i < accounts.length; i++) {\n \t\t\t(function(i) {\n \t\t\t\tvar address = accounts[i];\n \t\t\t\tvar balance = web3.fromWei(web3.eth.getBalance(accounts[i]));\n \t\t\t\t$('#user .ls-accts .result').append(i + ': <code>' + address + '</code> ' + balance + ' ETH<br />');\n \t\t\t})(i);\n \t\t}\n \t});\n\t}", "addRecipients(){\n\t\tconst personalize = new helper.Personalization();\n\n\t\tthis.recipients.forEach(recipient => {\n\t\t\tpersonalize.addTo(recipient);\n\t\t});\n\n\t\tthis.addPersonalization(personalize);\n\t}", "function sendCanvasUpdate() {\n for (user in users) {\n sendTo(users[user], {\n type: \"canvasUpdate\",\n avatars: room.avatars,\n name: \"SERVER\"\n });\n }\n}", "addRecipients() {\n\t\tconst personalize = new helper.Personalization();\n\t\tthis.recipients.forEach(recipient => {\n\t\t\tpersonalize.addTo(recipient);\n\t\t});\n\t\tthis.addPersonalization(personalize);\n\t}", "function sendClientSignals() {\n adminsWeb.forEach((currentClient) => {\n arduinoNM.connected[currentClient].emit('updateSignals', { signals: signalsList })\n console.log('[LOG] Lista de comandos enviada ao cliente web.')\n })\n }", "fetchUsers(): void {\n const users = [];\n let waiting = this.web3.eth.accounts.length * 2;\n const checkDone = () => {\n waiting -= 1;\n if (waiting > 0) {\n return;\n }\n store.dispatch({ type: 'SET_USERS', users });\n };\n\n this.web3.eth.accounts.forEach((address, i): void => {\n users[i] = { address };\n this.contract.getUserMessage(address, function(err, message: string) {\n if (!err) {\n users[i].message = message;\n }\n checkDone();\n });\n\n this.contract.checkPendingWithdrawal(\n { from: address },\n function(err, balance) {\n if (!err) {\n users[i].balance = parseInt(balance.valueOf(), 10);\n }\n checkDone();\n },\n );\n }", "ua () {\n\t\tfor (let i = 0; i < 3; i++)\n\t\t\tthis.u();\n\t}", "function updateAllUsers(socket) {\n socket.emit(\"update_all_users\", clientsToSend);\n socket.broadcast.emit(\"update_all_users\", clientsToSend);\n}", "function printAddresses(addresses) {\n console.log('Addresses:');\n for (const address of addresses) {\n console.log(address);\n }\n}", "syncChains() {\n this.sockets.forEach(socket => this.sendChain(socket));\n }", "syncChains() {\n this.sockets.forEach(socket => this.sendChain(socket));\n }", "function Teleport(r, c, l) {\n\n\t}", "watchGetContactList() {\n this.socket.on(\"GetContactListRequest\", async () => {\n try {\n let contactList = await ContactController.findContactsByUser(\n this.socket.request.user.id\n );\n\n let contactPromiseList = contactList.map(contact => {\n ContactController.subscribeToContact(contact, this.socket);\n\n return ContactController.getContactData(\n contact,\n this.socket.request.user.id\n );\n });\n\n const contacts = await Promise.all(contactPromiseList);\n this.socket.emit(\"GetContactListDone\", contacts);\n } catch (error) {\n console.error(error.message);\n }\n });\n }", "syncChains()\n\t{\n\t\tthis.sockets.forEach(socket => this.sendChain(socket));\n\t}", "function sendCars(...carIds){\n carIds.forEach(id => console.log(id));;\n}", "function suitelet_BatchSubsIndirect(request, response){\n\t_REQ = request, _RESP = response, _PARAMS = {};\n\t\n\t__log.start({\n\t\t 'logtitle' : 'ICC-SL-BatchSubsIndirect'\n\t\t,'company' \t : 'Misys'\n\t\t,'scriptname': 'Misys_FRD_R2R-004_SL_ICC_Transactions.js'\n\t\t,'scripttype': 'suitelet'\n\t});\t\n\t_HEADER_TEXT = 'Create Transaction for Indirect Charges (Batch Process)';\t\t\n\treturn _suiteletPerPeriod(false, true);\n}", "function sendWebsites(req, res) {\n var websites = [\n {name: 'facebook'},\n {name: 'linkedin'},\n {name: 'twitter'}\n ];\n res.send(websites);\n}", "function postToCa(request,data){\n console.log(\"posting csr to ca:\");\n console.log(data);\n //http-post header / optionen\n var caPostOptions = {\n hostname: 'h2418540.stratoserver.net',//localhost\n // hostname: 'localhost',//localhost\n port: 8080,\n path: '/certificateRequests',\n method: 'POST',\n headers: {\n 'Content-Type': 'text/plain',\n 'Content-Length': data.length\n }\n };\n \n //request an ca aufbauen\n var req = http.request(caPostOptions,function(res){\n //antwort der ca \n console.log(\"response ca: \" + res.statusCode);\n var caResponse = '';\n //ca schickt daten, kann in mehreren blöcken geschehen(theoretisch)\n var data;\n res.on('data', function(chunk){\n console.log(\"chunk: \"+ chunk);\n caResponse += chunk;\n //mail(request,chunk);\n //verifyCert(chunk.toString());\n });\n \n //fehler bei http-post\n res.on('error', function(e){\n console.log(\"error: \" + e);\n return false;\n });\n \n res.on('end', function () {\n console.log('end');\n mail(request,caResponse);\n //verifyCert(data.toString());\n });\n \n })\n //request schreiben und schicken\n req.write(data);\n req.end();\n return true;\n}", "function translate(ips, hostname) {\n\tipDetails = [];\n\tcountries = new Set();\n\tases = new Set();\n\tfor (var i = 0; i < ips.length; i++) {\n\t\tvar ip = ips[i];\n\t\tvar myRequest = new Request(\"http://ipinfo.io/\" + ip + \"/json\");\t\n\t\tfetch(myRequest).then(function(response) {\n \t\t\treturn response.json();\n\t\t}).then(function(response) {\n\t\t\ttranslationCallback(countries, ases, response, hostname);\n\t\t});\n\t}\n}", "function tranFetchAllTc(tcNam) {\r\n\tpromFetchRange(vWork.db.work.handle, tcNam, [0], [99]).then(function (datAry) {\r\n\t\tvWork.al[tcNam] = datAry;\r\n\t\tnextSeq();\r\n }).catch(function (error) {\r\n console.log(error);\r\n });\r\n}", "send(emails) {\n\n //Ensure array given\n if (!Array.isArray(emails)) {\n emails = [emails];\n }\n\n //Ensure all emails have a recipient and check if anything to do\n emails = emails.filter(email => !!email.to);\n if (!emails.length) {\n return Promise.resolve();\n }\n\n //Send now\n return sgMail\n .sendMultiple(emails)\n .catch(error => {\n throw new SendMailError(error, error.response.body);\n });\n }", "function getUnspentCoins(addressList) {\n\n var processCoins = function (obj) {\n var processCoin = function(utxo) {\n var txBuffer = new Buffer(utxo.tx_hash, \"hex\");\n Array.prototype.reverse.call(txBuffer);\n utxo.hash = txBuffer.toString(\"hex\");\n utxo.index = utxo.tx_output_n;\n };\n obj.unspent_outputs.forEach(processCoin);\n return obj.unspent_outputs;\n }\n\n return API.getUnspent(addressList, 0).then(processCoins);\n}", "syncChains()\n {\n this.sockets.forEach(socket =>\n {\n this.sockets.forEach(socket => this.sendChain(socket));\n });\n }", "sendAll(message) {\n // Alle User iterieren\n for (var i=0, len=this.users.length; i<len; i++) {\n // über den Socket eines jeden einzelnen die Nachricht senden\n this.users[i].socket.send(message);\n }\n}", "async newAddress (multiple, addressType, label = '') { \n const addressTypes = [\n 'legacy',\n 'p2sh-segwit',\n 'bech32'\n ]\n\n if (multiple == null) {\n if (addressType == null) {\n addressType = randomType()\n }\n checkType(addressType)\n return this.client.getNewAddress(label, addressType)\n }\n\n // if multiple addresses requested, can all \n // be specific type or each randomly assigned\n const addressList = new Array(multiple)\n\n if (addressType) {\n checkType(addressType)\n addressList.fill(addressType)\n } else {\n for (let i = 0; i < multiple; i++) {\n addressList[i] = randomType()\n }\n }\n\n return pMap(addressList, async type => {\n return this.client.getNewAddress(label, type)\n }, { concurrency: 8 })\n\n function checkType (addressType) {\n if (!addressTypes.includes(addressType)) throw new Error(`unrecognised address types`)\n }\n }", "function sendOffRampNotifcation(identity, offRampValue,txHash){\n let html = generateOffRampHTML(identity, offRampValue,txHash)\n let plainText = `The vendor ${identity.name} with address ${identity.address} has requested to initate a Wyre transfer for ${offRampValue} USD. Please check your email`\n let SMSText = `${identity.name} (${identity.address}) requested Wyre transfer for ${offRampValue} USD`\n for(var i = 0; i < adminList.length; i++){ // iterate through admin list and send notifications\n let admin = adminList[i]\n sendOffRampEmail(html, plainText, admin.email)\n sendSMSAlerts(SMSText,admin.phoneNumber)\n }\n}", "set utxos(value) {\n this.__utxos = value;\n }", "function sendDevices(deviceAddress, devices) {\n var defer = when.defer();\n util.log('[DEVICE MANAGER] send devices to: '+deviceAddress);\n if(deviceAddress != null && devices != null) {\n\n var postData = JSON.stringify(devices);\n var options = {\n hostname: deviceAddress,\n port: settings.uiPort,\n path: settings.httpAdminRoot+'devices',\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json; charset=utf-8'\n }\n };\n\n var req = http.request(options, function(res) {\n //console.log('STATUS: ' + res.statusCode);\n if(res.statusCode == 204)\n defer.resolve();\n else\n defer.reject(\"\");\n\n });\n\n req.on('error', function(e) {\n util.log('[DEVICE MANAGER] problem with request: ' + e.message);\n util.log('[DEVICE MANAGER] unable to update device list on ' + deviceAddress);\n defer.reject(e);\n });\n req.write(postData);\n req.end();\n }\n else\n defer.reject(\"\");\n return defer.promise;\n}", "function makeNetsend(val)\n{\n\n\tif(arguments.length) // bail if no arguments\n\t{\n\t\t// parse arguments\n\t\ta = arguments[0];\n\n\t\t// safety check for number of udpsends\n\t\tif(a<0) a = 0; // too few, set to 0\n\t\tif(a>instanceMax) a = instanceMax; // too many udpsends, set to maximum allowed\n\n\t\tsteps = [];\t// array for route number sequence\n \tfor (i=0; i<a; i++) {\n \tsteps.push(i);\t// build number sequence for new route object\n \t}\n\t\t\n\t\t// out with the old...\n\t\tif(numudpsends)this.patcher.remove(theRoute);\t// remove route obj\n\t\tfor(i=0;i<numudpsends;i++) // get rid of the ctlin and uslider objects using the old number of sliders\n\t\t{\n\t\t\tthis.patcher.remove(theudpsend[i]);\n\t\t}\n\n\t\t// ...in with the new\n\t\tnumudpsends = a; // update our global number of sliders to the new value\n\t\t\n\t\t// if num\n\t\tif(numudpsends)\n\t\t{\n\t\t\t// make the route object\n\t\t\ttheRoute = this.patcher.newdefault(189, 420, \"route\", steps); // make the route object\n\t\t\t// connect the sprintf and inlet2 objects to the route inlet\n\t\t\tthis.patcher.connect(thesprintfport, 0, theRoute, 0);\n\t\t\tthis.patcher.connect(thesprintfhost, 0, theRoute, 0);\n\t\t}\n\t\tfor(k=0;k<a;k++) // create the new ctlin and uslider objects, connect them to one another and to the funnel\n\t\t{\n\t\t\t// Create udpsend objects\n\t\t\ttheudpsend[k] = this.patcher.newdefault(189+(k*30), 450+(k*30), \"udpsend\", \"localhost\", 7450);\n\t\t\t// Connect route outlets to udpsend inlets\n\t\t\tthis.patcher.connect(theRoute, steps[k], theudpsend[k], 0);\n\t\t\tthis.patcher.connect(theinlet2, 0, theudpsend[k], 0);\n\t\t}\n\t\t\n\t}\n\n\telse // complain about arguments\n\t{\n\t\tpost(\"message needs arguments\");\n\t\tpost();\n\t}\n}", "cc(address, name) {\n this.nodeMailerMessage.cc = this.nodeMailerMessage.cc || [];\n this.nodeMailerMessage.cc.push(this.getAddress(address, name));\n return this;\n }", "function sendCars(day, ...carIds) {\r\n carIds.forEach(id => console.log(id));\r\n}", "function sendCars(day, ...carIds) {\n carIds.forEach( id => console.log(id) );\n}", "async function sendInfoEmail1(request, registrants) {\n for (let registrant of registrants) {\n // Build user emailData\n let emailData = {\n subject: 'RevolutionUC is Less Than 3 Weeks Away! 🙌 ',\n shortDescription: \"We're less than 3 weeks away from RevolutionUC Spring 2018! Here are some updates on the event.\",\n firstName: registrant.firstName\n };\n\n // One async task\n // 1. Send infoEmail1\n const html = await build('infoEmail1', emailData);\n await send(mailgunApiKey, mailgunDomain, 'RevolutionUC <info@revolutionuc.com>', registrant.email, emailData.subject, html);\n }\n}", "function compileTexts (locs){\n for (var i = 0; i <= locs.length -1; i++) {\n console.log(locs.length);\n var sendTo = locs[i].get('phone_1');\n var electricityCost = locs[i].get('elec_cost');\n var name = locs[i].get('name_1');\n\n var phone_2 = locs[i].get('phone_2');\n var name_2 = locs[i].get('name_2');\n\n var phone_3 = locs[i].get('phone_3');\n var name_3 = locs[i].get('name_3');\n\n var phone_4 = locs[i].get('phone_4');\n var name_4 = locs[i].get('name_4');\n\n var phone_5 = locs[i].get('phone_5');\n var name_5 = locs[i].get('name_5');\n\n getReadingSend(sendTo, electricityCost, name, locs[i], phone_2, name_2, phone_3, name_3, phone_4, name_4, phone_5, name_5);\n\n \n };\n }", "function multi(arr,ovbervers) {\n var source = from(arr);\n var subject = new Subject();\n var multicasted = source.pipe(multicast(subject));\n ovbervers.forEach(\n ovberver => {\n multicasted.subscribe(ovberver)\n }\n )\n var sub = multicasted.connect();\n return(sub)\n}", "function broadCast(obj) {\n wss.clients.forEach(function (client) {\n client.send(JSON.stringify(obj));\n });\n}", "async function GettingTheUTXOSet() {\n let myAddresses = myKeychain.getAddresses(); //returns an array of addresses the keychain manages\n let addressStrings = myKeychain.getAddressStrings(); //returns an array of addresses the keychain manages as strings\n let utxos = await avm.getUTXOs(myAddresses);\n\n console.log(\"My Addresses: \", myAddresses)\n console.log(\"Address Strings: \", addressStrings)\n console.log(\"UTXO: \", utxos)\n}", "function sendLocations(sender_psid){\n DatabaseUtils.getLocations(sender_psid).then((locations) => {\n let locationString =\"\";\n for( let l of locations){\n locationString+= l +\"\\n\";\n }\n let response = {\n \"text\": locationString,\n }\n sendMessage(sender_psid, response)\n });\n}", "function messageAllUsers() {\n vm.filteredusers.forEach(function (obj) {\n AddContacts(obj.email);\n });\n }", "function setRoute53Records(batch, cb) {\n Object.keys(batch).forEach(function(cred_uniq) {\n var cred = batch[cred_uniq].cred,\n records = batch[cred_uniq].records,\n aws = getAWS({accessKeyId: cred.r53access, secretAccessKey: cred.r53secret}),\n r53 = new aws.Route53(),\n params = {ChangeBatch: {Changes: []}, HostedZoneId: cred.r53zoneid}; // setup base params\n\n // gather up all the records for the batch\n records.forEach(function(record) {\n params.ChangeBatch.Changes.push({\n Action: 'UPSERT',\n ResourceRecordSet: {\n Name: record.host,\n Type: 'A',\n TTL: record.ttl,\n ResourceRecords: [{Value: record.ip}]\n }\n })\n });\n\n if (params.ChangeBatch.Changes.length > 0) {\n r53.changeResourceRecordSets(params, function(err, data) {\n if (err) {\n console.log(err, err.stack); // an error occurred\n } else {\n if (cred.nosyncwait) {\n console.log('\\nChanges sent to Route 53, not waiting for DNS sync: ' + data.ChangeInfo.Id);\n cb();\n } else {\n console.log('\\nSending changes to Route 53, waiting for DNS sync');\n\n r53WaitForSync(r53, data.ChangeInfo.Id, function(status) {\n console.log(data.ChangeInfo.Id + ' - ' + status);\n cb();\n });\n }\n }\n });\n }\n });\n}", "async function main() {\n\n const accessCAddress = \"0x2B7115801FC19D246db4193DfA6Fa4F215335d60\";\n const metaCAddress = \"0x62804B8305F01910AEEb969F82D69776bc1c5B75\";\n const financeCAddress = \"0xFA099f624ca296e8FB8b29Ac8D17322A964E1441\"\n const baseCAddress = \"0x44abC50ebdaBa1C928d59B1D2822C6A51f297E64\"\n const claimCAddress = \"0xc1123E480F810177296dD3211b48a4D0B0592b91\"\n\n const event_1 = \"0x077A76A76c9c56f04c9aF90B5f6694697E2F3b40\"\n const event_2 = \"0x1A837C123D63b41bBE2BE4F83DEedFC29B81c713\"\n const event_3 = \"0x97c4e9711Fd7FF8D0e5D504345ed638D5E6a6E0C\"\n const event_4 = \"0x4044Ff75A345C5eb95760d5FC3F919ca28ED153f\"\n const event_5 = \"0x5A606E866B13AC872e4dEFdCDCD146c0AE964497\"\n\n const list_events = [\n event_1, event_2, event_3, event_4, event_5\n ]\n\n const acc_1 = \"0xBceba105BD5f008515eb1CcA3768CF4cd55CFfD3\"\n const acc_2 = \"0x27EeADB030c7d60b23Bb28D02D50Db662aFB92C3\"\n const acc_3 = \"0xf9d121128D940Ad6F47277373f8800C4bBFA929F\"\n const acc_4 = \"0xA5173cB1CfE7C7E154C96457db5D3B30b81aBC28\"\n const acc_5 = \"0x38c00CEb5ad0D8D0555D4734a9EC3422B90a44A7\"\n const acc_6 = \"0xC98Ff09bF4474f6649F864bFfe961c57a37D6740\"\n const acc_7 = \"0x63A9265a634351B304e55EAD9079AEB3fb3182Db\"\n const acc_8 = \"0x0C501479Df03701d441cf748daa27b7270651b07\"\n const acc_9 = \"0x388cE07d12d840e3e306553CfCa1809492dC6233\"\n const acc_10 = \"0x96F49c0E4e145bcA7b38589016725B28171a507c\"\n\n const acc_11 = \"0x077A76A76c9c56f04c9aF90B5f6694697E2F3b40\"\n const acc_12 = \"0x1A837C123D63b41bBE2BE4F83DEedFC29B81c713\"\n const acc_13 = \"0x97c4e9711Fd7FF8D0e5D504345ed638D5E6a6E0C\"\n const acc_14 = \"0x4044Ff75A345C5eb95760d5FC3F919ca28ED153f\"\n const acc_15 = \"0x5A606E866B13AC872e4dEFdCDCD146c0AE964497\"\n const acc_16 = \"0x8fACfFB0F12Ed81F595763F91dc91BFB1e9fa946\"\n const acc_17 = \"0x3f987235eEFDD65dF25eCA0925551dbc5C4E3b01\"\n const acc_18 = \"0xB87109e3eD895DFDcb8F1B43dF1B4d64a255A99b\"\n const acc_19 = \"0x95F1abcD1812696bD37B6194414038cE82b1c740\"\n const acc_20 = \"0x370918531D9Bbb14914dABa272f3a29eb9342c52\"\n\n const list_accs = [\n acc_1, acc_2, acc_3, acc_4, acc_5, acc_6, acc_7, acc_8, acc_9, acc_10,\n acc_11, acc_12, acc_13, acc_14, acc_15, acc_16, acc_17, acc_18, acc_19, acc_20\n ]\n \n // const RELAYER_ROLE = web3.utils.soliditySha3('RELAYER_ROLE');\n // const FACTORY_ROLE = web3.utils.soliditySha3('FACTORY_ROLE');\n // const acc_testing = \"0x0D5BF3570ddf4c5b72aFc014F4b728B67e44Ea7f\";\n\n const Access = await ethers.getContractFactory(\"AccessControlGET\");\n const access = Access.attach(accessCAddress);\n\n const metadataLogic = await ethers.getContractFactory(\"eventMetadataStorage\");\n const meta = metadataLogic.attach(metaCAddress);\n\n const Base = await ethers.getContractFactory(\"baseGETNFT_V4\");\n const base = Base.attach(baseCAddress);\n\n const Finance = await ethers.getContractFactory(\"getEventFinancing\");\n const finance = Finance.attach(financeCAddress);\n\n const Claim = await ethers.getContractFactory(\"claimGETNFT\");\n const claim = Claim.attach(claimCAddress);\n\n // const accounts = await ethers.getSigners();\n const main_acc = \"0x6382Dcd7954Ef8d0D3C2A203aA1Bd3aE71c82e42\";\n // const acc_2 = \"0x6382Dcd7954Ef8d0D3C2A203aA1Bd3aE71c82e42\";\n\n // function registerEvent(\n // address eventAddress,\n // address integratorAccountPublicKeyHash,\n // string memory eventName, \n // bytes[2] memory eventUrls, // [bytes shopUrl, bytes eventImageUrl]\n // bytes32[4] memory eventMeta, // -> [bytes32 latitude, bytes32 longitude, bytes32 currency, bytes32 ticketeerName]\n // uint256[2] memory eventTimes, // -> [uin256 startingTime, uint256 endingTime]\n // bool setAside, // -> false = default\n // bytes[] memory extraData\n // ) public virtual {\n\n\n const event_name = \"Awesome Event Name\"\n const shop_url = \"https://ticketeer.io/event/shop\"\n const image_url = \"https://ticketeer.io/shop/image.jpg\"\n const latitude_test = \"-12.2345673\"\n const longitude_test = \"123.9876543\"\n const currency_test = \"EUR\"\n const ticketeer_name_t = \"Awesome Ticketeer\"\n const start_time_test = 1616584929\n const stop_top_test = 1616589089\n const set_aside_test = false // bool \n const extra_data_test = \"awesome_ticketeer_id\"\n\n\n // Creatures issued directly to the owner.\n for (var i = 0; i < NUM_EVENTS; i++) {\n var bytedata = ethers.utils.formatBytes32String(\"DATA \" + i);\n const result = await meta.registerEvent(\n list_events[i], // eventAddress\n main_acc, // integratorAccountPublicKeyHash\n // claimCAddress, // underwriterAddress\n event_name, // eventName\n [ethers.utils.formatBytes32String(shop_url), ethers.utils.formatBytes32String(image_url)], // eventUrls\n [ethers.utils.formatBytes32String(latitude_test), ethers.utils.formatBytes32String(longitude_test), ethers.utils.formatBytes32String(currency_test), ethers.utils.formatBytes32String(ticketeer_name_t)], // eventMeta\n [start_time_test,stop_top_test], // eventTimes\n true, // setAside\n [ethers.utils.formatBytes32String(extra_data_test)] // extraData\n )\n console.log(\"Event metadata registered. Tx hash: \" + result.hash + \" \" + i);\n console.log(\" \")\n }\n\n console.log(\"Event registration completed\");\n\n // const accounts = await ethers.getSigners();\n\n for (var i = 0; i < NUM_TICKETS; i++) {\n var bytedata = ethers.utils.formatBytes32String(\"DATA \" + i);\n const result = await finance.mintSetAsideNFTTicket(\n claimCAddress, // underwriterAddress (destinationAddress)\n list_events[1], // eventAddress\n i + 1000, // orderTime\n i + 3000, // ticketDebt / price\n \"Ticket URI testing 10\", // ticketURI\n [bytedata]) // ticketMetadata\n // var nftindex = await base.tokenOfOwnerByIndex(list_accs[i], 0);\n // console.log(\"nftIndex of set aside NFT: \" + nftindex)\n console.log(\"getNFT minted (to claimCAddress where it is colleterized). Transaction: \" + result.hash + \" \" + i)\n console.log(\" \")\n }\n\n var balance_claim = await base.balanceOf(claimCAddress)\n console.log(\"Total balance of getNFTs on claim address: \" + balance_claim)\n console.log(\"setAsideNFTTicket mint completed\");\n console.log(\" \")\n\n for (var i = 0; i < NUM_TICKETS; i++) {\n var bytedata = ethers.utils.formatBytes32String(\"DATA \" + i);\n var nftindex = await base.tokenOfOwnerByIndex(claimCAddress, 0);\n console.log(\"Colleterized token with nftIndex: \" + nftindex + \" sold in primary market.\")\n console.log(\"This nft will be sold to address: \" + list_accs[i])\n const result = await base.primarySale(\n list_accs[i], // destinationAddress\n list_events[0], // eventAddress\n i + 1000, // primaryPrice\n i + 3000, // orderTime\n \"Ticket URI testing 10\", // ticketURI\n [bytedata]) // ticketMetadata\n\n console.log(\"Transaction hash of primary market (from colleteralized inventory): \" + result.hash + \" \" + i)\n console.log(\" \")\n }\n\n var balance_claim = await base.balanceOf(claimCAddress)\n console.log(\"Completed primary market - Total balance of getNFTs on claim address: \" + balance_claim)\n console.log(\" \")\n \n const start_ticket = NUM_TICKETS + 1\n const max_ticket = NUM_TICKETS * 2\n\n for (var i = start_ticket; i < max_ticket; i++) {\n // var bytedata = ethers.utils.formatBytes32String(\"DATA \" + i);\n // const result = await _contract.connect().registerEvent(accounts[i].address, \"eventname\", \"whatever.nl\", bytedata, bytedata, bytedata, i, bytedata);\n console.log(\"originAddress: \" + list_accs[i-10])\n console.log(\"destinationAddress: \" + list_accs[i])\n const result = await base.secondaryTransfer(\n list_accs[i-10], // originAddress\n list_accs[i], // destinationAddress\n i + 2000, // orderTime\n i + 9999 // secondaryPrice\n )\n // console.log()\n // var nftindex = await base.tokenOfOwnerByIndex(list_accs[i], 0);\n // console.log(\"nftIndex of transferred token: \" + nftindex)\n console.log(\"Secondary transfer. Transaction: \" + result.hash + \" \" + i);\n console.log(\" \")\n }\n\n console.log(\"secondaryTransfer completed\");\n\n for (var i = start_ticket; i < max_ticket; i++) {\n // var bytedata = ethers.utils.formatBytes32String(\"DATA \" + i);\n // const result = await _contract.connect().registerEvent(accounts[i].address, \"eventname\", \"whatever.nl\", bytedata, bytedata, bytedata, i, bytedata);\n const result = await base.scanNFT(\n list_accs[i] // originAddress\n );\n console.log(\"Scanned. Transaction: \" + result.hash + \" \" + i);\n }\n\n}", "function setTargetPeers(tPeers) {\n var tgtPeers = [];\n if (tPeers == 'ORGANCHOR') {\n tgtPeers = testUtil.getTargetPeerListSubmitter(cpList, channelOrgName, 'ANCHORPEER')\n if ( tgtPeers ) {\n testUtil.assignChannelPeersSubmitter(cpList, channel, client, tgtPeers, TLS, cpPath, evtType, invokeType, peerFOList, peerList, eventHubs);\n }\n } else if (tPeers == 'ALLANCHORS') {\n tgtPeers = testUtil.getTargetPeerListSubmitter(cpList, orgList, 'ANCHORPEER')\n if ( tgtPeers ) {\n testUtil.assignChannelPeersSubmitter(cpList, channel, client, tgtPeers, TLS, cpPath, evtType, invokeType, peerFOList, peerList, eventHubs);\n }\n } else if (tPeers == 'ORGPEERS') {\n tgtPeers = testUtil.getTargetPeerListSubmitter(cpList, channelOrgName, 'ALLPEERS')\n if ( tgtPeers ) {\n testUtil.assignChannelPeersSubmitter(cpList, channel, client, tgtPeers, TLS, cpPath, evtType, invokeType, peerFOList, peerList, eventHubs);\n }\n } else if (tPeers == 'ALLPEERS') {\n tgtPeers = testUtil.getTargetPeerListSubmitter(cpList, orgList, 'ALLPEERS')\n if ( tgtPeers ) {\n testUtil.assignChannelPeersSubmitter(cpList, channel, client, tgtPeers, TLS, cpPath, evtType, invokeType, peerFOList, peerList, eventHubs);\n }\n } else if (tPeers == 'LIST') {\n tgtPeers = txCfgPtr.listOpt;\n if ( tgtPeers ) {\n testUtil.assignChannelPeersSubmitter(cpList, channel, client, tgtPeers, TLS, cpPath, evtType, invokeType, peerFOList, peerList, eventHubs);\n }\n } else if (tPeers == 'ROUNDROBIN') {\n tgtPeers[org] = [];\n tgtPeers[org].push(testUtil.getPeerID(pid, org, txCfgPtr, cpf, tPeers));\n testUtil.assignChannelPeersSubmitter(cpList, channel, client, tgtPeers, TLS, cpPath, evtType, invokeType, peerFOList, peerList, eventHubs);\n } else if ((tPeers == 'DISCOVERY') || (transType == 'DISCOVERY')) {\n serviceDiscovery = true;\n if (txCfgPtr.hasOwnProperty('discoveryOpt')) {\n var discoveryOpt = txCfgPtr.discoveryOpt;\n logger.info('[Nid:chan:org:id=%d:%s:%s:%d setTargetPeers] discoveryOpt: %j', Nid, channelName, org, pid, discoveryOpt);\n if (discoveryOpt.hasOwnProperty('localHost')) {\n if (discoveryOpt.localHost == 'TRUE') {\n localHost = true;\n }\n }\n if (discoveryOpt.hasOwnProperty('collection')) {\n endorsement_hint['chaincodes'] = [\n {name: chaincode_id, collection_names: txCfgPtr.discoveryOpt.collection}\n ];\n }\n if (discoveryOpt.hasOwnProperty('initFreq')) {\n initFreq = parseInt(discoveryOpt.initFreq);\n }\n }\n\n // add one peer to channel to init service discovery\n for (var j=0; j<channelOrgName.length; j++) {\n var discOrg1 = [];\n discOrg1 = channelOrgName.slice(j,j+1);\n tgtPeers = testUtil.getTargetPeerListSubmitter(cpList, discOrg1, 'ANCHORPEER')\n if ( tgtPeers ) {\n testUtil.assignChannelPeersSubmitter(cpList, channel, client, tgtPeers, TLS, cpPath, evtType, invokeType, peerFOList, peerList, eventHubs);\n break; // break once one peer is found\n }\n }\n if ((tPeers == 'DISCOVERY') || (transType == 'DISCOVERY')) {\n logger.info('[Nid:chan:org:id=%d:%s:%s:%d setTargetPeers] serviceDiscovery=%j, localHost: %j', Nid, channelName, org, pid, serviceDiscovery, localHost);\n initDiscovery();\n }\n } else {\n logger.error('[Nid:chan:org:id=%d:%s:%s:%d setTargetPeers] pte-exec:completed:error targetPeers= %s', Nid, channelName, org, pid, tPeers);\n process.exit(1);\n }\n}", "function addAllClipboardEC() {\n\t\t\tconsole.log(\"addAllClipboardEC()\");\n\n for(var i=0;i<vm.apiDomain.expressesComponents.length; i++) {\n\t\t\t\taddClipboardEC(i);\n\t\t\t}\n\t\t}", "function afficherContact() { \n contactLists.forEach(function(contactList){ \n console.log(contactList.decrire());\n });\n}", "function sendToAllClients(msg){\n wss.clients.forEach(d => d.send(JSON.stringify(msg)))\n}", "syncChains(){\n // go trough all the sockets and send them this chains\n this.sockets.forEach(socket => this.sendChain(socket));\n }", "function subscribeToBeacons(cb) {\n socket.on('beacons', beacons => cb(null, beacons));\n //socket.emit('subscribeToTimer', 1000);\n}", "function getSatellites() {\n // location data is currently hardcoded to london, might want to pull it from user data\n return rp({\n url: 'https://api.satellites.calum.org/rest/v1/multi/next-pass?lat=51.51794662&lon=-0.0749192&alt=0',\n json: true,\n method: 'POST',\n body: {'norad-ids': ['25544','27607','39444','24278','40909']}\n })\n .then(response => {\n // all data\n satellites = response;\n // satellite.date data is transformed into unix timestamps in order to sort input from different formats by date easily\n // Substring is used to normalize the date to exclude time data\n satellites.passes.forEach(satellite => {\n satellite.date = (new Date(satellite.start.substring(0,10))).getTime();\n satellite.startTime = satellite.start;\n satellite.endTime = satellite.end;\n satellite.type = 'Satellite';\n satellite.visibility = 'Naked Eye';\n satellitesClean.push(satellite);\n });\n });\n}", "addAddress(id, address) {\n if (address.length > 0) {\n if (id === 'to') {\n const to2 = [...this.state.to2];\n to2.push(address);\n const to = to2.join(',');\n this.setState({to2, to});\n // this.props.setMailContacts(to);\n\n }\n }\n }", "updateTCUs() {\r\n this.calculateTCUs(-1, -1);\r\n }", "function listUsers(req, res, next) {\n\tassert([ 2, 3 ].indexOf(keys(req.rdns).length) !== null);\n\tassert('teleport' === req.rdns.o);\n\tassert('users' === req.rdns.ou);\n\tvar layer = req.bindLayer;\n\tassert(layer);\n\t// If searching for a specific user\n\tvar uid = req.rdns.uid;\n\n if ( uid ) {\n req.filter = new ldap.AndFilter({\n filters: [req.filter, new ldap.EqualityFilter({attribute: 'uid', value: uid})]\n });\n }\n\t\n var resultCount = 0;\n \n\tfunction end(err) {\n\t\tlog.info({requestId: req.logId, command: 'listUsers', resultCount: resultCount}, \"Sent %d users\", resultCount);\n res.end();\n\t\tnext(err);\n\t}\n\n\tdataStore.layerUsers(layer).on('user', function(user) {\n var attributes = clone(user);\n // Apply some defaults\n if ( !attributes.uid ) attributes.uid = user.uid;\n if ( !attributes.cn ) attributes.cn = user.uid;\n if ( !attributes.objectClass ) attributes.objectClass = ['posixAccount', 'shadowAccount'];\n attributes.gidNumber = user.primaryGroup.gidNumber;\n delete attributes['primaryGroup'];\n delete attributes['groups'];\n delete attributes['publicKeys'];\n \n if (req.filter.matches(attributes)) {\n \t++resultCount;\n \tvar dn = format(\"cn=%s,ou=users,o=teleport\", user.uid);\n \tlog.debug({requestId: req.logId, command: 'listUsers', dn: dn}, \"Sending user %s\", dn);\n res.send({\n dn: dn,\n attributes: attributes\n });\n }\n\t})\n\t\t.on('error', end)\n\t\t.on('end', end)\n\t\t;\n}", "function sendroomtoclients(data, toall) {\n if(toall) {\n // send to everyone\n } else {\n // send to one\n }\n}", "function awAddRecipients(msgCompFields, recipientType, recipientsList) {\n if (!msgCompFields || !recipientsList) {\n return;\n }\n\n addressRowAddRecipientsArray(\n document.querySelector(\n `.address-row[data-recipienttype=\"${recipientType}\"]`\n ),\n msgCompFields.splitRecipients(recipientsList, false)\n );\n}", "function getOutgoingTransactionsFromAddress() {\r\n let adr = address.value;\r\n let sanitizedAdr = adr.toUpperCase().replace(/-|\\s/g, \"\");\r\n if (adr == \"\") {\r\n address.focus();\r\n return false;\r\n }\r\n _doGet('/account/transfers/outgoing?address=' + sanitizedAdr);\r\n }", "function drainSUTDissemination(t, tc) {\n return function drainSUTDissemination(list, cb){\n var lastPing = null;\n // use the first fake node to send all the pings needed\n async.doWhilst(function sendPing(callback) {\n tc.fakeNodes[0].requestPing(function (err, res, arg2, arg3) {\n if (err) return callback(err);\n\n lastPing = safeJSONParse(arg3);\n console.dir(lastPing);\n if (!lastPing) return callback(new Error(\"No ping body received\"));\n\n return callback();\n });\n }, function testIfPingIsEmpty() {\n return lastPing.changes.length === 0;\n }, function done(err) {\n // throw err for now when present since cb is not the typical err first callback right now\n if (err) throw err;\n\n console.log(list.length);\n });\n };\n}", "function subscribe() {\n //resets the lines when the program starts\n request.post('http://localhost:3000/RTU/reset',\n {form:{destUrl:\"http://localhost:\" + port}}, function(err, httpResponse, body){\n console.log(body);\n if (err) {\n console.log(err + \"10\");\n } else {\n console.log(\"Reseted Fastory line\");\n }\n });\n\n // get the notification when pallet is loaded to the zone3\n request.post('http://localhost:3000/RTU/SimROB7/events/PalletLoaded/notifs',\n {form:{destUrl:\"http://localhost:\" + port}}, function(err,httpResponse,body){\n if (err) {\n console.log(err + \"11\");\n } else {\n console.log(\"subscribed to the PalletLoaded event!\");\n }\n });\n\n // get the notification when the pallet has moved to the Z1 in CNV7\n request.post('http://localhost:3000/RTU/SimCNV7/events/Z1_Changed/notifs',\n {form:{destUrl:\"http://localhost:\" + port}}, function(err,httpResponse,body){\n if (err) {\n console.log(err + \"12\");\n } else {\n console.log(\"subscribed to the Z1 changed in station 7!\");\n }\n });\n\n // get the notification when the pallet has moved to the Z2 in CNV7\n request.post('http://localhost:3000/RTU/SimCNV7/events/Z2_Changed/notifs',\n {form:{destUrl:\"http://localhost:\" + port}}, function(err,httpResponse,body){\n if (err) {\n console.log(err + \"14\");\n } else {\n console.log(\"subscribed to the Z1 changed in station 7!\");\n }\n });\n\n // get the notification when the pallet has moved to the Z3 in CNV7\n request.post('http://localhost:3000/RTU/SimCNV7/events/Z3_Changed/notifs',\n {form:{destUrl:\"http://localhost:\" + port}}, function(err,httpResponse,body){\n if (err) {\n console.log(err+ \"15\");\n } else {\n console.log(\"subscribed to the Z3 changed in station 7!\");\n }\n });\n}", "function sub(email, list, fname, lname) {\n\tsubscribe(email, 4, list, fname, lname);\n\t}", "getUTXO(fromAddress) {\n let utxos = []\n for(const block of this.chain) {\n for(const tx of block.transactions){\n // get all output tx\n for (let i=0; i<tx.txOut.length;i++) {\n if (tx.txOut[i].toAddress == fromAddress) {\n utxos.push(new UTXO(tx.hash,i,tx.txOut[i].toAddress,tx.txOut[i].value,tx.txOut[i].data))\n }\n }\n }\n }\n // now filter away those utxos that has been used\n for(const block of this.chain) {\n for(const tx of block.transactions){\n for (const txIn of tx.txIn) {\n // get all output tx\n for (let i=0; i<utxos.length;i++) {\n if (txIn.txOutHash == utxos[i].txOutHash && txIn.txOutIndex == utxos[i].txOutIndex) {\n // remove the item\n utxos.splice(i, 1)\n }\n }\n }\n }\n }\n return utxos\n }", "async sendOpsToUsers (op) {\n\t\tconst requestId = UUID();\n\t\tthis.log(`\\tSending Pubnub op to ${Object.keys(this.users).length} users, reqid=${requestId}...`);\n\t\tawait Promise.all(Object.keys(this.users).map(async userId => {\n\t\t\tawait this.sendUserOp(userId, op, requestId);\n\t\t}));\n\t}", "_connectDNSPeer (onConnectionCb) {\n // let seed = utils.getRandom(seeds) // cant get random as we should track addresses in use \n while(this.dnsSeeds.length > 0) \n {\n let seed = this.dnsSeeds.pop();\n //this.dnsSeeds.forEach(seed => {\n let seedUrl = utils.parseAddress(seed);\n logdebug('_connectDNSPeer resolving seed', seedUrl.hostname);\n dns.resolve(seedUrl.hostname, (err, ips) => { // we should use resolve() here (as supposed for dns seeds)\n if (err) return onConnectionCb(err)\n //let addr = utils.getRandom(addresses) // we cant get random as we need track addresses in use\n ips.forEach(ip => {\n let resolvedUrl = new URL(seedUrl.protocol + '//' + ip +':' + seedUrl.port);\n let addrState = this.resolvedAddrs.add(resolvedUrl.href); // returns new or existing addr state\n if (AddrStates.canUse(addrState)) { // check if resolved addr not in use\n this.resolvedAddrs.setInUse(resolvedUrl.href); \n this._connectTCP(resolvedUrl.hostname, resolvedUrl.port /*|| this._params.defaultPort*/, (err, socket)=>{\n // callback to update addr state for dns resolved addresses\n onConnectionCb(err, socket, this.resolvedAddrs, resolvedUrl.href);\n });\n }\n });\n });\n }\n }", "async retrieveBalances(addressList) {\n const validators = await this.retrieveValidators();\n // Get all balances\n const requestsBalance = addressList.map(async (addr, index) => {\n const txContext = await this.getAccountInfo(addr);\n return { ...addressList[index], ...txContext };\n });\n // eslint-disable-next-line max-len,no-unused-vars\n const requestsDelegations = addressList.map((addr, index) =>\n this.getAccountDelegations(validators, addr)\n );\n // eslint-disable-next-line no-unused-vars,max-len\n const balances = await Promise.all(requestsBalance);\n const delegations = await Promise.all(requestsDelegations);\n const reply = [];\n for (let i = 0; i < addressList.length; i += 1) {\n reply.push({ ...delegations[i], ...balances[i] });\n }\n return reply;\n }", "addresses() {\n return __awaiter(this, void 0, void 0, function* () {\n return api_1.addresses(this);\n });\n }", "function chainSend(...sendArgs) {\n const ret = agcc.send(...sendArgs);\n savedChainSends.push([sendArgs, ret]);\n return ret;\n }", "async function sendBitcoinToAddress(from, privateKey, toAddress, amount) {\n // const insight = new Insight(\"testnet\");\n // insight.getUnspentUtxos(fromAddress, (error, utxos) => {\n // if (error) {\n // console.log(\"error\", error);\n // return false;\n // }\n\n // console.log(\"utox\", utxos);\n\n try {\n const url = `https://testnet-api.smartbit.com.au/v1/blockchain/address/${from}/unspent`;\n let response = await fetch(url);\n response = await response.json();\n\n const transaction = bitcore.Transaction();\n transaction.from(response.unspent);\n transaction.fee(19);\n transaction.to(toAddress, amount);\n transaction.change(from);\n transaction.sign(privateKey);\n transaction.serialize();\n\n console.log(transaction);\n\n return { errors: [], data: {}, message: `${amount} BTC SENT` };\n } catch (error) {\n console.log(error);\n return { errors: [error.message], data: {}, message: \"\" };\n }\n\n // insight.broadcast(transaction, (error, transactionId) => {\n // console.log(error);\n // console.log(transactionId);\n // });\n\n // console.log(utxos);\n\n // transaction.change(fromAddress);\n // transaction.serialize();\n\n // console.log(transaction);\n // });\n}", "function _recipientsFromAsn1(infos) {\n var ret = [];\n for(var i = 0; i < infos.length; ++i) {\n ret.push(_recipientFromAsn1(infos[i]));\n }\n return ret;\n}", "function _recipientsFromAsn1(infos) {\n var ret = [];\n for(var i = 0; i < infos.length; ++i) {\n ret.push(_recipientFromAsn1(infos[i]));\n }\n return ret;\n}", "function _recipientsFromAsn1(infos) {\n var ret = [];\n for(var i = 0; i < infos.length; ++i) {\n ret.push(_recipientFromAsn1(infos[i]));\n }\n return ret;\n}", "function _recipientsFromAsn1(infos) {\n var ret = [];\n for(var i = 0; i < infos.length; ++i) {\n ret.push(_recipientFromAsn1(infos[i]));\n }\n return ret;\n}", "function sendEmails(recipients, template) {\n\n\tvar completed = 0, errors = 0;\n\tfor (var i = 0; i < recipients.length; i ++) {\n\n\t\tvar kind = recipients[i][0];\n\t\tvar email_id = recipients[i][1].email;\n\t\tvar locals = recipients[i][1];\n\n\t\tsendEmail(kind, email_id, locals, function (status, error) {\n\n\t\t\tif (status === 500) {\n\t\t\t\terrors++;\n\t\t\t}\n\n\t\t\tcompleted ++;\n\n\t\t\tif (completed === recipients.length) {\n\n\t\t\t\tlogger.info('Completed successfully! ' + completed + ' recipients received an email. ' + (errors ? errors + ' did not.' : ''));\n\t\t\t\tprocess.exit();\n\n\t\t\t}\n\n\t\t});\n\t}\n\n\n}", "sendChain(socket) {\n socket.send(JSON.stringify(this.blockchain.chain)); // sending message to each socket\n }", "function sendCards(...allCardsIds) {\n allCardsIds.forEach( id => console.log(id) ); // to loop through the array parameter and log out each item\n}", "function recipients_of_email(array_of_recipients) {\n let string_recipients = \"\";\n for (let i=0; i < array_of_recipients.length; i++) {\n if (i === 0) {\n string_recipients += array_of_recipients[i];\n }\n else {\n string_recipients += \", \" + array_of_recipients[i];\n }\n }\n return string_recipients;\n}", "function _recipientsFromAsn1(infos) {\n\t var ret = [];\n\t for(var i = 0; i < infos.length; ++i) {\n\t ret.push(_recipientFromAsn1(infos[i]));\n\t }\n\t return ret;\n\t}" ]
[ "0.49759355", "0.48770338", "0.48396292", "0.47920975", "0.46969154", "0.46669462", "0.45950216", "0.45782965", "0.4572112", "0.45387185", "0.45359734", "0.45359734", "0.45359734", "0.45359734", "0.4530559", "0.4512454", "0.4490507", "0.44634604", "0.44536066", "0.4450927", "0.442904", "0.44129664", "0.44114622", "0.43916282", "0.4378877", "0.43628332", "0.43621212", "0.4359859", "0.43426692", "0.43383068", "0.43368283", "0.43344647", "0.43337288", "0.43334344", "0.43320498", "0.4318892", "0.4318667", "0.4318667", "0.43150747", "0.4292562", "0.4276937", "0.4269228", "0.42691982", "0.42611292", "0.42511725", "0.42489746", "0.42324474", "0.4225867", "0.42231986", "0.4220933", "0.420243", "0.4194006", "0.4193694", "0.4192114", "0.418884", "0.41804108", "0.41797957", "0.41714785", "0.4169954", "0.41603005", "0.41502693", "0.41502407", "0.41442764", "0.41424468", "0.41345435", "0.41276905", "0.41235423", "0.4116493", "0.41109744", "0.410971", "0.41057608", "0.4105276", "0.41050336", "0.4094318", "0.40936098", "0.40816694", "0.40806246", "0.4079983", "0.406918", "0.4064956", "0.40601397", "0.40596813", "0.4059139", "0.40539825", "0.4053428", "0.40288383", "0.40285274", "0.40276584", "0.40245366", "0.4021008", "0.40166783", "0.40164098", "0.40164098", "0.40164098", "0.40164098", "0.40157795", "0.40157115", "0.4014062", "0.4011846", "0.40102434" ]
0.54898155
0
`await` this to get info about the current block of the network.
get block () { return this.API.getBlock() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getBlockInfo(blockNum) {\n var info = await web3.eth.getBlock(blockNum)\n return info\n}", "async getCurrentBlockNumber() {\n const blockNum = await window.web3.eth.getBlockNumber();\n this.setState({currentBlockNumber: blockNum});\n }", "getBlock() {\n const self = this\n return new Promise(function(resolve, reject) {\n self.myBlockChain.getBlock(0).then((block) => {\n resolve(JSON.stringify(block));\n }).catch((err) => { reject(err);});\n })\n }", "getLatestBlock() {\n return __awaiter(this, void 0, void 0, function* () {\n return this.ksnDriver.getLatestBlock();\n });\n }", "async function requestBlockchainInfo() {\n return instance\n .get(\"/tuichain/get_info/\")\n .then((response) => {\n return response.data;\n })\n .catch((error) => {\n console.log(error);\n return false;\n });\n}", "async function currentBlockTimestamp() {\n const blockNumber = await sendRPC(web3, \"eth_blockNumber\", []);\n const block = await sendRPC(web3, \"eth_getBlockByNumber\", [ blockNumber.result, false]);\n return block.result.timestamp;\n }", "function currentBlock() {\r\n _doGet('/chain/height');\r\n }", "async getBlock (height) {\n const json = await this.chainStore.get(height)\n if (this.logLevel >= 2) console.log('block data for ' + height + ': ' + json)\n return JSON.parse(json)\n }", "async getBlockNumber(network) {\n let blockNumber = await this.getProvider(network).getBlockNumber();\n return {\n blockNumber\n };\n }", "async function now() {\n const latestBlock = await web3.eth.getBlock(\"latest\");\n return latestBlock.timestamp;\n}", "async function getBlock (block) {\n bot.chat('Getting ' + block)\n switch (block) {\n case 'wood': {\n console.log('Finding wood')\n const logs = await bot.findBlock({\n point: bot.entity.position,\n matching: '17:1',\n maxDistance: 256,\n count: 1\n })\n console.log(logs)\n const mcData = require('minecraft-data')(bot.version)\n const defaultMove = new Movements(bot, mcData)\n\n const p = logs.position\n console.log('moving')\n bot.pathfinder.setMovements(defaultMove)\n bot.pathfinder.setGoal(new GoalNear(p.x, p.y, p.z, 1))\n bot.dig(logs)\n break\n }\n default:\n bot.chat('I cannot get block ' + block)\n }\n}", "getBlock ({X, Y, Z}) {\n blockName = this.getBlockNet(X, Y, Z).then(data=>{return data})\n return (blockName)\n }", "get block() { \n return this._block;\n }", "async getBlockByIndex() {\r\n this.server.route({\r\n method: 'GET',\r\n path: '/api/block/{index}',\r\n handler: async (request, h) => {\r\n let block = await this.blockChain.getBlock(request.params.index);\r\n if(!block){\r\n throw Boom.notFound(\"Block not found.\");\r\n }else{\r\n return block;\r\n }\r\n }\r\n });\r\n }", "async fetchBlock(cid) {\n const block = await lotus.loadSingleBlock(cid);\n return block;\n }", "async getBlock(index) {\r\n // return Block as a JSON object\r\n return JSON.parse(await getDBData(index))\r\n }", "getBlockByIndex() {\n let bc = this.blockchain;\n let response;\n this.server.route({\n method: 'GET',\n path: '/block/{height}',\n handler: async (request, h) => {\n let height = encodeURIComponent(request.params.height);\n \n //Use getBlock method of Blockchain class\n await bc.getBlock(height).then(curBlock => {\n let block = JSON.parse(curBlock); \n block.body.star.storyDecoded = hex2ascii(block.body.star.story);\n response = block;\n }).catch(err => {\n response = {\n success: \"false\",\n message: \"Error retrieving block. \",\n err\n }\n }); \n return (response); \n }\n });\n }", "async checkForLatestBlock () {\n await this._updateLatestBlock()\n return await this.getLatestBlock()\n }", "function getLastBlockAsync (self) {\n const errorResponse = {\n status: 500,\n body: {}\n };\n\n return new Promise(function (resolve, reject) {\n self.node.getBestBlockHash(function (err, blockHash) {\n if (err || !blockHash) {\n self.log.error('error retrieving the latest hash from Bitcoin', err);\n reject(errorResponse);\n return;\n }\n\n self.node.getBlockHeader(blockHash, function (err, blockHeader) {\n if (err || !blockHeader) {\n self.log.error('error retrieving the requested hash from Bitcoin', err);\n reject(errorResponse);\n return;\n }\n\n self.log.info('Requested block height ' + blockHeader.height);\n const successResponse = {\n status: 200,\n body: {\n 'blockNumber': blockHeader.height,\n 'blockHash': blockHeader.hash\n }\n };\n resolve(successResponse);\n });\n });\n });\n}", "async getBlocks() {\n console.log(\"Entering getBlocks()\");\n // Defining rest-api endpoint for querying block\n let blockRequest = 'http://rest-api:8008/blocks';\n let blockResponse = await fetch(blockRequest);\n let blockResponseJSON = await blockResponse.json();\n return blockResponseJSON;\n }", "getBlock(blockheight) {\n return this.chain.get(this.lexi(blockheight))\n .then((block) => {\n return JSON.parse(block);\n });\n }", "async fetchHeadBlock() {\n const tipset = await lotus.getChainHead();\n return this.fetchBlock(tipset.Cids[0]['/']);\n }", "async getCurrentBlockNum() {\n const properties = await this.getDynamicGlobalProperties();\n return properties.last_irreversible_block_num;\n }", "async getBlock(height) {\n const response = height !== undefined ? await this.restClient.blocks(height) : await this.restClient.blocksLatest();\n return {\n id: response.block_id.hash,\n header: {\n version: response.block.header.version,\n time: response.block.header.time,\n height: parseInt(response.block.header.height, 10),\n chainId: response.block.header.chain_id,\n },\n txs: (response.block.data.txs || []).map((encoded) => encoding_1.Encoding.fromBase64(encoded)),\n };\n }", "async function fetchBlock(blockHeight) {\n let response = await fetch(`https://blockchain.info/block-height/${blockHeight}?format=json`);\n let data = await response.json();\n return data; \n}", "getBlockByIndex() {\n this.server.route({\n method: 'GET',\n path: '/block/{index}',\n handler: async (request, h) => {\n let blockIndex = parseInt(request.params.index);\n const result = await this.blockchain.getBlock(blockIndex);\n return result.statusCode !== undefined ? result : await this.blockchain.addDecodedStoryToReturnObj(JSON.stringify(result).toString());\n }\n });\n }", "RetrieveBlock(blockHash = '', verbosity = '1') {}", "async checkForNewBlock() {\n try {\n const blockHeight = await this.polkadotAPI.getBlockHeight()\n\n // if we get a newer block then expected query for all the outstanding blocks\n while (blockHeight > this.height) {\n this.height = this.height ? this.height++ : blockHeight\n this.newBlockHandler(this.height)\n\n // we are safe, that the chain produced a block so it didn't hang up\n if (this.chainHangup) clearTimeout(this.chainHangup)\n }\n } catch (error) {\n console.error('Failed to check for a new block', error)\n Sentry.captureException(error)\n }\n }", "getBlockByIndex() {\n this.server.route({\n method: 'GET',\n path: '/block/{index}',\n handler: (request, h) => {\n return new Promise ((resolve,reject) => {\n const blockIndex = request.params.index ?\n encodeURIComponent(request.params.index) : -1;\n if (isNaN(blockIndex)) { \n reject(Boom.badRequest());\n } else {\n this.blockChain.getBlockHeight().then((chainHeight)=>{\n if (blockIndex <=chainHeight && blockIndex >-1)\n {\n this.blockChain.getBlock(blockIndex).then ((newBlock)=>{\n resolve(JSON.stringify(newBlock));\n });\n } else {\n reject(Boom.badRequest());\n }\n });\n }\n });\n }\n });\n }", "async function fetchLastBlockNum(){\n const response_LastBlockNum = await fetch(apiLastBlockNum);\n const json_LastBlockNum = await response_LastBlockNum.json();\n //console.log(json_LastBlockNum);\n blockNumberHex = json_LastBlockNum.result;\n var blockNumber = parseInt(blockNumberHex,16);\n console.log(\"Latest Block number - \"+blockNumber);\n $(\"#lastBlock\").text(blockNumber);\n fetchDifficultyHash();\n}", "getLastBlock(node){\n console.log(\"Fetching latest block\");\n let config = Promise.all(this.getConfig(node));\n return config.then( response => {\n let web3 = response[0];\n let contract = response[1];\n\n return web3.eth.getBlock(\"latest\");\n });\n }", "getBlockByIndex() {\n this.server.route({\n method: 'GET',\n path: '/block/{index}',\n handler: (request, h) => {\n return new Promise ((resolve,reject) => {\n const blockIndex = request.params.index ?\n encodeURIComponent(request.params.index) : -1;\n if (isNaN(blockIndex)) { \n reject(Boom.badRequest());\n } else {\n this.blockChain.getBlockHeight().then((chainHeight)=>{\n if (blockIndex <=chainHeight && blockIndex >-1)\n {\n this.blockChain.getBlock(blockIndex).then ((block)=>{\n resolve(block);\n });\n } else {\n reject(Boom.badRequest());\n }\n });\n }\n });\n }\n });\n }", "async getBlockHeight () {\n return await this.getBlockHeightLevel()\n }", "function getBlock(params) {\n return new Promise((resolve, reject) => {\n var response;\n var getblockHash = params.hash;\n\n multichain.getBlock({\n \"hash\": getblockHash,\n \"format\": true\n },\n (err, res) => {\n console.log(res)\n if (err == null) {\n return resolve({\n response: res,\n message: \"Blockchain Information\"\n });\n } else {\n console.log(err)\n return reject({\n status: 500,\n message: 'Internal Server Error !'\n });\n }\n }\n )\n\n })\n}", "function getBlockByIdAsync (self, blockId) {\n return new Promise(function (resolve, reject) {\n self.node.getBlockHeader(blockId, function (err, blockHeader) {\n if (err || !blockHeader) {\n self.log.error('error retrieving the requested hash from Bitcoin', err);\n const errorResponse = {\n status: 500,\n body: {\n 'error': err\n }\n };\n reject(errorResponse);\n return;\n }\n\n self.log.info('Requested block height ' + blockHeader.height);\n const successResponse = {\n status: 200,\n body: {\n 'blockNumber': blockHeader.height,\n 'blockHash': blockHeader.hash\n }\n };\n resolve(successResponse);\n });\n });\n}", "block() {\n this.getBlocker().block();\n }", "async handleBlocks() {\n await this.api.rpc.chain.subscribeNewHeads(async (header) => {\n if (header.number % 100 == 0) {\n console.log(`Chain is at block: #${header.number}`);\n\n // Unconditionally recalculate validators every 10 minutes\n this.createValidatorList(); // do not await\n\n } else {\n const blockHash = await this.api.rpc.chain.getBlockHash(header.number);\n const block = await this.api.rpc.chain.getBlock(blockHash);\n \n const extrinsics = block['block']['extrinsics'];\n for (let i=0; i<extrinsics.length; i++) {\n const callIndex = extrinsics[i]._raw['method']['callIndex'];\n const c = await this.api.findCall(callIndex);\n //console.log(\"Module called: \", c.section);\n if (c.section == STAKING) {\n console.log(`A ${STAKING} transaction was called`);\n this.createValidatorList(); // do not await\n }\n }\n }\n\n });\n }", "getLastBlockNumber() {\n\t\treturn this.api.getLastBlockNumber();\n\t}", "static getLastBlock(){\n return new Promise((resolve, reject) => {\n resolve(DB.transactionLastBlock())\n }).catch( err => {\n reject(err)\n })\n }", "getBlockByIndex() {\n this.app.get(\"/block/:height\", (req, res) => {\n let height = req.params.height;\n console.log(`GET /block/${height}`);\n this.blockChain.getBlock(height).then((block) => { // TODO: use async and await with try catch instead of then?\n if (block === undefined) {\n res.status(404)\n res.send(`Error Block #${height} not found`);\n }\n res.send(block);\n }).catch((err) => {\n let error = `Error: Block #${height} not found, ${err}`;\n console.log(error);\n res.status(404)\n res.send(error);\n });\n });\n }", "getBlock(BlockN) {\n return new Promise(function(resolve, reject) {\n db.getLevelDBData(BlockN).then((result) => {\n resolve(result);\n }).catch(function(err) {\n reject(err);\n });\n });\n }", "async loadBlockchainData() { \n //Obtener la cuenta\n const web3 = window.web3;\n const accounts = await web3.eth.getAccounts()\n this.setState({account: accounts[0]})\n console.log(accounts)\n \n //Obtener la red\n const networkId = await web3.eth.net.getId();\n console.log(networkId)\n const networkData = Curriculum.networks[networkId];\n console.log(networkData)\n \n if (networkData) {\n //Obtener abi\n const abi = Curriculum.abi\n console.log(abi)\n //Obtener la dirección\n const address = networkData.address\n console.log(address)\n //Fetch Contrato\n const contract = new web3.eth.Contract(abi, address)\n this.setState({contract})\n const ipfsHash = await contract.methods.get().call()\n\n this.setState({ipfsHash})\n console.log(ipfsHash)\n } else {\n window.alert('El Smart Contract no ha sido desplegado en la red.')\n }\n\n }", "function getBlock(Blockhash){\n web3.eth.getTransactionCount(Blockhash,function(error, result){\n if(!error){\n count = result;\n console.log('Number of transactions in latest block: ',JSON.stringify(result));\n }\n \n else{\n console.error(error);\n \n }\n \n });\n}", "showAllBlocks() {\n this.getAllBlocks().then((blocks) => {\n console.log('==========================================');\n blocks.forEach((block) => {\n console.log(block);\n });\n console.log('==========================================');\n });\n }", "getBlock(height) {\n let self = this;\n return new Promise((resolve, reject) => {\n self.bd.getLevelDBData(height).then((block) => {\n // console.log(`Retreiving block# ${height}`);\n // console.log(block);\n resolve(block);\n }).catch((err) => {\n console.log(err);\n reject(err)\n });\n });\n }", "GetBlockchainInfo(BlocksParam, callback) {\n this.client.getBlockchainInfo(BlocksParam, function (err, response) {\n if (err) {\n callback(err)\n } else {\n callback(null, response)\n }\n })\n }", "function getBlock(blockId, callback)\n{\n\tvar location = 'http://blockexplorer.com/rawblock/' + blockId;\n\thttp.get(location, function(res)\n\t{\n\t\tvar body = '';\n\n\t\tres.on('data', function(chunk) {\n\t\t\tbody += chunk;\n\t\t});\n\n\t\tres.on('end', function() {\n\t\t\tvar blockResponse = JSON.parse(body)\n\t\t\tcallback(blockResponse);\n\t\t});\n\t});\t\n}", "getBlockByIndex() {\n let self = this;\n this.app.get(\"/api/block/:index\", async (req, res) => {\n // console.log(req.params);\n // res.send(self.blocks[req.params.index]);\n\n let index = req.params.index || null;\n if(index === null || isNaN(index)){\n res.status(400).json({ error: 'Invalid index provided' });\n return;\n }\n\n let height = await self.blockChain.getBlockHeight(); \n if(height < index){\n res.status(400).json({ error: \"Block doesn't exist\" });\n return; \n }\n\n self.blockChain.getBlock(index).then((block) => {\n //console.log(JSON.stringify(block));\n res.send(block);\n }).catch((err) => { console.log(err);});\n });\n }", "getBlock(height) {\r\n return this.bd.getLevelDBData(height)\r\n .then((block) => {\r\n console.log(\"getBlock | Successful, info:\", block);\r\n return JSON.parse(block);\r\n }).catch((err) => {\r\n console.log(\"getBlock | Err:\", err);\r\n return err;\r\n })\r\n }", "getBlockByHeight() {\n let self = this.blockChain;\n this.server.route({\n method: 'GET',\n path: '/block/{height}',\n handler: async (request, h) => {\n \n try{\n let blockHeight = request.params.height;\n if(blockHeight == null){\n return \"Invalid height\"\n }\n let promise = self.getBlock(blockHeight);\n let result = await promise;\n return JSON.parse(result);\n }catch(err){\n return \"Block Not Found\";\n }\n }\n \n });\n }", "async function waitBlock() {\n while (true) {\n let receipt = web3.eth.getTransactionReceipt(contract.transactionHash);\n if (receipt && receipt.contractAddress) {\n console.log(\"Your contract has been deployed at address: \" + receipt.contractAddress);\n console.log(\"Note that it might take 30 - 90 sceonds for the block to propagate befor it's visible\");\n return new Promise(resolve => receipt.contractAddress);\n }\n console.log(\"Waiting a mined block to include your contract... currently in block \" + web3.eth.blockNumber);\n await sleep(4000);\n }\n }", "getBlock(blockHeight) {\n return new Promise((resolve, reject) => {\n this.bd.getLevelDBData(blockHeight)\n .then((response) => {\n resolve(JSON.parse(response));\n })\n .catch((error) => {\n reject(error);\n });\n });\n }", "async getBlock(height) {\n try {\n return await this.bd.getLevelDBData(height);\n } catch (err) {\n console.log(err);\n }\n }", "async function tx_info(_net, raw_txid) {\r\n if (_net == \"mainnet\" && raw_txid == \"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b\") {\r\n let res = {\r\n net: _net,\r\n txid: raw_txid,\r\n blockhash: \"000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f\",\r\n blockheight: 0,\r\n timestamp: 1231006505,\r\n size: 204,\r\n weight: 816,\r\n confirmations: await getblockcount(),\r\n input: 0,\r\n output: 50,\r\n preaddress: [\r\n {\r\n value: 0,\r\n address: \"No Inputs (Newly Generated Coins)\"\r\n }\r\n ],\r\n nextaddress: [\r\n {\r\n value: 50,\r\n address: \"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa\"\r\n }\r\n ],\r\n fee: 0\r\n };\r\n // console.log(res)\r\n return res;\r\n } else {\r\n let tx = await getrawtransaction(_net, raw_txid);\r\n if(!tx){\r\n return null;\r\n }else{\r\n let vin = [];\r\n for (i in tx.vin) {\r\n if (!tx.vin[i].coinbase) {\r\n vin.push({\r\n txid: tx.vin[i].txid,\r\n voutNum: tx.vin[i].vout\r\n });\r\n } else {\r\n vin.push({\r\n txid: \"coinbase\",\r\n voutNum: -1\r\n });\r\n }\r\n }\r\n let vout = vout_value_address(tx);\r\n // console.log(vin, '...............vin');\r\n // console.log(vout, '.............vout');\r\n let vout_pre = [];\r\n for (i in vin) {\r\n if (vin[i].txid == \"coinbase\") {\r\n vout_pre.push({\r\n value: 0,\r\n address: \"coinbase\"\r\n });\r\n } else {\r\n if (vin[i].voutNum > -1) {\r\n let tx_pre = await getrawtransaction(_net, vin[i].txid);\r\n vout_pre.push(pre_vout_value_address(tx_pre, vin[i].voutNum));\r\n }\r\n }\r\n }\r\n // console.log(vout_pre, '...........vout_pre');\r\n let res = {\r\n net: _net,\r\n txid: raw_txid,\r\n blockhash: tx.blockhash,\r\n blockheight: 0,\r\n timestamp: tx.time,\r\n size: tx.size,\r\n weight: tx.weight,\r\n confirmations: tx.confirmations,\r\n input: 0,\r\n output: 0,\r\n preaddress: [],\r\n nextaddress: [],\r\n fee: 0\r\n };\r\n res.blockheight = await getBlockHeight(_net, tx.blockhash);\r\n for (i in vout_pre) {\r\n res.preaddress.push(vout_pre[i]);\r\n res.input += vout_pre[i].value;\r\n }\r\n for (i in vout) {\r\n res.nextaddress.push(vout[i]);\r\n res.output += vout[i].value;\r\n }\r\n res.fee = res.input - res.output;\r\n // console.log(res);\r\n return res;\r\n }\r\n }\r\n}", "get nextBlock () {\n return this.API.getBlock().then(({header:{height}})=>new Promise(async resolve=>{\n while (true) {\n await new Promise(ok=>setTimeout(ok, 1000))\n const now = await this.API.getBlock()\n if (now.header.height > height) {\n resolve()\n break\n }\n }\n }))\n }", "getBlockByHash() {\n this.app.get(\"/stars/hash::hash\", async (req, res) => {\n let reqBlock = null;\n try {\n reqBlock = await this.Blockchain.getBlockByHash(req.params.hash);\n console.log(reqBlock);\n if (!reqBlock) throw Error(\"Hash not found\")\n res.send(reqBlock);\n } catch (err) {\n if (err.message.includes(\"Hash not found\")) {\n res.send(`No block found with hash: ${req.params.hash}`);\n } else {\n res.send(`Error in getBlockByHash method of Block Controller. \\n ${err}`);\n }\n }\n });\n }", "getBlockByHeight() {\n this.app.get(\"/block/:height\", async (req, res) => {\n let reqBlock = null;\n try {\n reqBlock = await this.Blockchain.getBlockByHeight(req.params.height);\n res.send(reqBlock);\n } catch (err) {\n if (err.message.includes(\"Key not found\")) {\n res.send(`No block found with height of ${req.params.height}`);\n } else {\n res.send(`Error in getBlockByHeight method of Block Controller. \\n ${err}`);\n }\n }\n });\n }", "async function getBlock(req, res) {\n const record = await BlockModel.findById(req.params.id)\n if (record === null) {\n return res.status(404).json({\n message: 'NOT_FOUND'\n })\n }\n res.json({\n block: record.serialize()\n })\n}", "getBlock(blockHeight){\r\n // return object as a single string\r\n return new Promise ((resolve, reject) => {\r\n this.chain.getLevelDBData(blockHeight).then(curblock => {\r\n if(curblock == undefined){\r\n resolve(curblock);\r\n }else{\r\n resolve(JSON.parse(JSON.stringify(curblock)));\r\n }\r\n }).catch(err => {\r\n console.log(err);\r\n reject(err);\r\n });\r\n });\r\n \r\n }", "getBlockByIndex() {\n let self = this;\n self.app.get(\"/block/:height\", (req, res) => {\n self.blockchain.getBlock(req.params.height).then((result) => {\n res.send(result);\n }).catch((err) => {\n if (err.notFound) {\n res.status(404).send({ 'error': 'Block not found' });\n return;\n }\n\n console.error(err.stack);\n res.status(500).send({ 'error': 'Unexpected error occurred' });\n });\n });\n }", "getLatestBlock() {\n return this.chain[this.chain.length - 1]\n }", "async function fetchDifficultyHash(){\n console.log(\"BlockNumberHex - \",blockNumberHex);\n apiBlock = \"https://api.etherscan.io/api?module=proxy&action=eth_getBlockByNumber&tag=\"+ blockNumberHex +\"&boolean=true\"+ apiKey;\n try{\n const response_Block = await fetch(apiBlock);\n const json_Block = await response_Block.json();\n // console.log(json_Block);\n var difficulty = parseInt(json_Block.result.difficulty,16)/10**12;\n console.log(\"Difficulty - \"+difficulty);\n $(\"#networkDifficulty\").text(difficulty.toFixed(2)+\" TH\");\n var hashRate = difficulty / 15 * 1000;\n $(\"#hashRate\").text(hashRate.toFixed(2)+\" GH/s\");\n var transactionNum = json_Block.result.transactions.length;\n // console.log(transactionNum);\n $(\"#transactions\").text(transactionNum);\n }catch{\n // Try next time\n }\n}", "getBlock(blockHeight){\n return new Promise(function(resolve, reject) {\n db.getLevelDBData(blockHeight)\n .then((result) => {\n if (result) {\n resolve(result);\n } else {\n resolve(undefined);\n }\n })\n .catch((err) => {\n reject(err);\n })\n });\n }", "getBlockByHash() {\n let bc = this.blockchain;\n let response;\n this.server.route({\n method: 'GET',\n path: '/stars/hash:{hash}',\n handler: async (request, h) => {\n let hash = encodeURIComponent(request.params.hash);\n \n //Use getBlockByHash method of Blockchain class\n await bc.getBlockByHash(hash).then(curBlock => {\n let block = JSON.parse(curBlock); \n //Decode the star story\n block.body.star.storyDecoded = hex2ascii(block.body.star.story);\n response = block;\n }).catch(err => {\n response = {\n success: \"false\",\n message: \"Error retrieving block. \",\n };\n }); \n return (response); \n }\n });\n }", "getBlockByIndex() {\n this.app.get(\"/block/:index\", (request, response) => {\n // Add your code here\n let blockHeight = parseInt(request.params.index, 10);\n if(blockHeight == undefined || blockHeight < 0) {\n return response.status(500).json(this.constructError('ERROR:Invalid block blockHeight/ blockheight missing.'));\n }\n\n let currentBlockHeight = 0;\n this.blockchain.getBlockHeight().then((height) => {\n currentBlockHeight = parseInt(height, 10);\n console.log(\"Current Block height:\" + currentBlockHeight);\n console.log(\"Requested Block height:\" + blockHeight);\n if(currentBlockHeight < blockHeight) {\n return response.status(500).json(this.constructError('ERROR: Current block height is less than the given block height.'));\n } else {\n this.blockchain.getBlock(blockHeight).then((blockJson) => {\n if(blockJson == undefined) {\n return response.status(500).json(this.constructError('ERROR:Error loading block data from the block chain.'));\n }\n\n let blockData = JSON.parse(blockJson)\n let blockBody = blockData.body\n\n if(blockBody.star != undefined) {\n let starData = new star.star(blockBody.star)\n starData.addDecodedStory();\n blockBody.star = starData;\n blockData.body = blockBody;\n }\n\n response.status(200).json(blockData)\n })\n .catch((err) => {\n response.status(500).json(this.constructError('ERROR: Error retrieving the block at height:' + blockHeight));\n }) \n }\n });\n });\n }", "getBlockByAddress() {\n let bc = this.blockchain;\n let response;\n this.server.route({\n method: 'GET',\n path: '/stars/address:{address}',\n handler: async (request, h) => {\n \n let address = encodeURIComponent(request.params.address);\n \n //Use getBlockByWallet method of Blockchain class\n await bc.getBlockByWalletAddress(address).then(blockArray => {\n let responseArray = [];\n blockArray.forEach( element => {\n let block = JSON.parse(JSON.stringify(element));\n //Decode the star story\n block.body.star.storyDecoded = hex2ascii(block.body.star.story);\n responseArray.push(block);\n });\n response = responseArray;\n }).catch(err => {\n response = {\n success: \"false\",\n message: \"Error retrieving block. \",\n err\n }\n }); \n return (response); \n }\n });\n }", "async getBlockHeight() {\n\t\treturn await chaindb.getBlockHeight().then((height) => { return height; }).catch(error => { throw error; });\n\t}", "getLatestBlock() {\n return this.chain[this.chain.length - 1];\n }", "getLatestBlock() {\n return this.chain[this.chain.length - 1];\n }", "getLatestBlock() {\n return this.chain[this.chain.length - 1];\n }", "async loadBlockchainData() {\n this.setState({loading: true})\n let web3\n \n //Check if the user has Metamask\n if(typeof window.ethereum !== 'undefined') {\n web3 = new Web3(window.ethereum)\n await this.setState({web3})\n await this.loadAccountData()\n } else {\n web3 = new Web3(new Web3.providers.HttpProvider(`https://ropsten.infura.io/v3/${process.env.REACT_APP_INFURA_API_KEY}`))\n await this.setState({web3})\n }\n await this.loadContractData()\n await this.loadPoolData()\n this.setState({loading: false})\n //Update interest every 5 seconds\n var self = this\n var intervalId = window.setInterval(async function(){\n let poolBalanceUnderlying, poolETHDeposited, poolInterest\n poolBalanceUnderlying = await self.state.cETHContract.methods.balanceOfUnderlying(self.state.poolContractAddress).call()\n poolETHDeposited = await self.state.poolContract.methods.ethDeposited().call()\n poolInterest = poolBalanceUnderlying - poolETHDeposited\n await self.setState({poolInterest})\n self.getETHPrice()\n }, 10000);\n }", "function GetBlocks() {\n return blocks;\n}", "GetLatestBlock(empty, callback) {\n this.client.getLatestBlock(sendParams, function (err, response) {\n if (err) {\n callback(err)\n } else {\n callback(null, response)\n }\n })\n }", "getBlockByIndex() {\n\t\tthis.app.get(\"/block/:index\", async (req, res) => {\n\t\t\t// Convert the index parameter to an integer (index value)\n\t\t\tvar stridx = req.params.index;\n\t\t\tvar idx = parseInt(stridx, 10);\n\n\t\t\t// Validate the index parameter\n\t\t\tif (isNaN(idx)) {\n\t\t\t\tconsole.log('ERROR: index value is not a number:', stridx);\n\t\t\t\tres.status(400).send({ error: 'index value: ' + stridx + ' is not a valid number' });\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Fetch the number of blocks in the blockchain\n\t\t\tvar totBlks = await numBlocks();\n\n\t\t\t// Is the index out of range?\n\t\t\tif (idx >= totBlks || idx < 0) {\n\t\t\t\t// Referring to a block that does not exist\n\t\t\t\tconsole.log('ERROR: block with index:', stridx, 'does not exist');\n\t\t\t\tres.status(404).send({ error: 'block # ' + stridx + ' does not exist'});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Fetch the block index by ':index'\n\t\t\tvar jstr = await this.blockchain.getBlock(idx);\n\n\t\t\t// Return the data to the caller\n\t\t\tconsole.log('INFO: returning to the caller with block:', jstr);\n\t\t\tres.status(200).json(jstr);\n\t\t});\n\t}", "RetrieveBeaconBlock(blockHash = '', verbosity = '1') {}", "getBlockByWalletAddress(){\n this.app.get(\"/stars/address::address\", async (req, res) => {\n let reqBlocks = null;\n try {\n reqBlocks = await this.Blockchain.getBlockByWalletAddress(req.params.address);\n console.log(reqBlocks);\n if (reqBlocks.length == 0) throw Error(\"No blocks found associated to this wallet\")\n res.send(reqBlocks);\n } catch (err) {\n if (err.message.includes(\"to this wallet\")) {\n res.send(`No block found with hash: ${req.params.address}`);\n } else {\n res.send(`Error in getBlockByWalletAddress method of Block Controller. \\n ${err}`);\n }\n }\n });\n }", "getBlockByIndex() {\n let self = this;\n self.app.get(\"/api/block/:index\", (req, res) => {\n let ix = req.params.index;\n self.myBlockChain.getBlock(ix)\n .then((block) => {\n res.send(block);\n })\n .catch((err) => {\n res.status(404) // HTTP status 404: NotFound\n .send(\"Error block \" + ix + \" does not exist in this blockchain \");\n })\n });\n }", "getLatestBlock(){\n\t\treturn this.chain[this.chain.length - 1];\n\t}", "async getBlockHeight() {\n // Add your code here\n let blockCount = await this.bd.getBlocksCount();\n return blockCount -1;\n }", "getLatestBlock(){\n return this.chain[this.chain.length];\n }", "async getBlockByAddress(address) {\n try {\n let block = await this.bd.getBlockByAddress(address);\n let parsedBlock = this.parseBlock(block);\n return(parsedBlock);\n } catch (err) {\n console.log(err);\n }\n }", "getBlockByIndex() {\n this.app.get(\"/block/:index\", async (req, res) => {\n try{\n let blockheight = req.params.index;\n\n const block = await this.blockchain.getBlockbyIndex(blockheight);\n //console.log(block)\n res.status(200).send(block)\n }catch(err){\n console.log(err);\n res.status(400).send(err);\n }\n\n });\n }", "async getBlockHeight() {\n\t\treturn await this.bd.getBlocksCount();\n\t}", "async getBlock(height) {\n // Add your code here\n return await this.bd.getLevelDBData(height);\n }", "async function waitBlock() {\n while (true) {\n let receipt = web3.eth.getTransactionReceipt(contract.transactionHash);\n if (receipt && receipt.contractAddress) {\n console.log(\"Contract is deployed at contract address: \" + receipt.contractAddress);\n console.log(\"It might take 30-90 seconds for the block to propagate before it's visible in etherscan.io\");\n break;\n }\n console.log(\"Waiting for a miner to include the transaction in a block. Current block: \" + web3.eth.blockNumber);\n await sleep(4000);\n }\n}", "async getEthBlockNumber()\n {\n var result = parseInt( await this.redisInterface.loadRedisData('ethBlockNumber' ));\n\n if(isNaN(result) || result < 1) result = 0 ;\n\n return result\n }", "async getBlock (blockHeight) {\n let block = JSON.parse(await this.getLevelDBData(blockHeight))\n\n // verify if ins't the Genesis block\n if (parseInt(block.height) > 0) {\n block.body.star.storyDecoded = Buffer.from(block.body.star.story, 'hex').toString()\n }\n // return object\n return block\n }", "function getLastBlockData(callback) {\n daemonRpc.async(\"getblocks\", {\"last\": 1})\n .then((data) => {\n if(data.hasOwnProperty(\"error\")) {\n log(\"error\", logSystem, \"Error getting last block data %j\", [JSON.stringify(data.error)]);\n callback(true);\n return;\n }\n var blockHeader = data.result[0];\n callback(null, {\n difficulty: blockHeader.target,\n height: blockHeader.block,\n timestamp: blockHeader.timestamp,\n reward: blockHeader.reward + blockHeader.fee,\n hash: blockHeader.pow\n });\n });\n}", "getBlockByHash() {\n\t\tthis.app.get('/block/hash/:hash', async (req, res) => {\n\t\t\tif (req.params.hash) {\n\t\t\t\tconst hash = req.params.hash;\n\t\t\t\tlet block = await this.blockchain.getBlockByHash(hash);\n\t\t\t\tif (block) {\n\t\t\t\t\treturn res.status(200).json(block);\n\t\t\t\t} else {\n\t\t\t\t\treturn res.status(404).send('Block not found.');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn res.status(404).send('Block not found. Check hash.');\n\t\t\t}\n\t\t});\n\t}", "getBlock(height) {\n let self = this;\n return new Promise(function(resolve, reject) {\n self.levelDBWrapper.getLevelDBData(height).then((block) => {\n if(block) {\n resolve(block);\n } else {\n reject(\"Invalid block\"); \n }\n }).catch((err) => {\n reject(err);\n });\n });\n }", "getBlockByIndex() {\n this.app.get(\"/block/:index\", (req, res) => {\n // Add your code here\n myBlockChain.getBlockHeight().then( (totalHeight) => {\n let index = req.params.index;\n console.log(`MempoolController: height = ${totalHeight}`);\n if (index >= totalHeight) {\n console.log(`index = ${index}; totalHeight: ${totalHeight}`);\n res.send(`No such Block: ${index}; Max Height: ${totalHeight -1 }`);\n } else {\n console.log(`req.params: `, req.params);\n console.log(`req.params.index: `, req.params.index);\n myBlockChain.getBlock(index).then( (gotBlock) => {\n console.log(`\\ngetBlockByIndex: myBlockChain.getBlock[${index}] = `, gotBlock);\n // Add DECODED story as property to object returned...\n gotBlock.body.star.storyDECODED = hex2ascii(gotBlock.body.star.storyENCODED);\n console.log(\"getBlockByIndex: add DECODED story gotBlock: \", gotBlock, \"\\n\");\n res.send(gotBlock);\n });\n }\n })\n .catch( (err) => {\n console.log(`MempoolController getBlockByIndex: Saw error ${err}`)\n })\n })\n }", "async loadBlockchainData() {\n const web3 = window.web3\n //Load account\n const accounts = await web3.eth.getAccounts()\n this.setState({account: accounts[0]})\n const networkId = await web3.eth.net.getId()\n const networkData = CarChain.networks[networkId]\n if(networkData){\n const abi = CarChain.abi\n const address = networkData.address\n const chain = new web3.eth.Contract(abi, address)\n this.setState({chainContract: chain})\n\n //get CarPurchase contract address and deploy it using web3\n var purAddr = await this.state.chainContract.methods.getMyPendingPurchase().call({from:this.state.buyer})\n if(purAddr){\n const abi3 = CarPurchase.abi\n const purchase = new web3.eth.Contract(abi3, purAddr)\n this.setState({purchaseContract: purchase})\n this.setState({states: await purchase.methods.getState().call()})\n }\n }\n else {\n window.alert('Smart contract not deployed to detected network.')\n }\n }", "getLatestBlock(){\n return this.chain[this.chain.length - 1];\n }", "getLatestBlock(){\n return this.chain[this.chain.length - 1];\n }", "_getInternalBlockNumber(maxAge) {\n return __awaiter(this, void 0, void 0, function* () {\n yield this._ready();\n const internalBlockNumber = this._internalBlockNumber;\n if (maxAge > 0 && this._internalBlockNumber) {\n const result = yield internalBlockNumber;\n if ((getTime() - result.respTime) <= maxAge) {\n return result.blockNumber;\n }\n }\n const reqTime = getTime();\n const checkInternalBlockNumber = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__ethersproject_properties__[\"f\" /* resolveProperties */])({\n blockNumber: this.perform(\"getBlockNumber\", {}),\n networkError: this.getNetwork().then((network) => (null), (error) => (error))\n }).then(({ blockNumber, networkError }) => {\n if (networkError) {\n // Unremember this bad internal block number\n if (this._internalBlockNumber === checkInternalBlockNumber) {\n this._internalBlockNumber = null;\n }\n throw networkError;\n }\n const respTime = getTime();\n blockNumber = __WEBPACK_IMPORTED_MODULE_2__ethersproject_bignumber__[\"a\" /* BigNumber */].from(blockNumber).toNumber();\n if (blockNumber < this._maxInternalBlockNumber) {\n blockNumber = this._maxInternalBlockNumber;\n }\n this._maxInternalBlockNumber = blockNumber;\n this._setFastBlockNumber(blockNumber); // @TODO: Still need this?\n return { blockNumber, reqTime, respTime };\n });\n this._internalBlockNumber = checkInternalBlockNumber;\n return (yield checkInternalBlockNumber).blockNumber;\n });\n }", "getGenesisBlock(){\r\n return this.chain[0];\r\n }", "getBlockByHeight() {\n\t\tthis.app.get('/block/height/:height', async (req, res) => {\n\t\t\tif (req.params.height) {\n\t\t\t\tconst height = parseInt(req.params.height);\n\t\t\t\tlet block = await this.blockchain.getBlockByHeight(height);\n\t\t\t\tif (block) {\n\t\t\t\t\treturn res.status(200).json(block);\n\t\t\t\t} else {\n\t\t\t\t\treturn res.status(404).send('Block not found!');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn res\n\t\t\t\t\t.status(404)\n\t\t\t\t\t.send('Block not found. Check the block height parameter.');\n\t\t\t}\n\t\t});\n\t}", "getBlock(height) {\n // Add your code here\n return JSON.parse(JSON.stringify(this.chain[blockHeight]));\n }", "async getBlockHeight() {\n // Add your code here\n try{\n let blockCount = await this.getNextBlockHeight();\n return(blockCount-1) // excluding genesis block\n } catch(err) {\n //console.log(err);\n reject(err);\n }\n }", "async getBlockByHeight(blockHeight) {\n\t\t// return object as a single string\n\t\treturn await chaindb.getBlockByKey(blockHeight).then((block) => {\n\t\t\treturn block;\n\t\t}).catch(error => {\n\t\t\tthrow error;\n\t\t});\n\t}" ]
[ "0.74712193", "0.7160966", "0.70184815", "0.6893731", "0.68704396", "0.682075", "0.6818044", "0.6780187", "0.6703221", "0.6643881", "0.6512256", "0.6492273", "0.6463958", "0.6407212", "0.64002395", "0.6396356", "0.6374369", "0.6330996", "0.63239133", "0.6306357", "0.6287778", "0.6282214", "0.6275832", "0.6259446", "0.6259277", "0.62401843", "0.62357503", "0.6231661", "0.6225169", "0.6216398", "0.62075615", "0.6204012", "0.61942744", "0.6167011", "0.6161139", "0.61219954", "0.60800433", "0.6071644", "0.60636324", "0.6054811", "0.6046587", "0.60411686", "0.60411435", "0.60395193", "0.60142344", "0.6001761", "0.59730077", "0.59591365", "0.5942775", "0.59246767", "0.59212893", "0.59206593", "0.5907103", "0.59044015", "0.59027785", "0.5897291", "0.585489", "0.58514756", "0.5849043", "0.5831451", "0.5805762", "0.580289", "0.5800824", "0.57980615", "0.57958496", "0.57919234", "0.57872903", "0.57862806", "0.57862806", "0.57862806", "0.5784522", "0.57803565", "0.577858", "0.5770738", "0.57632756", "0.57479215", "0.57456535", "0.5731559", "0.5730408", "0.57288724", "0.5728605", "0.57241917", "0.57184905", "0.57176834", "0.57087153", "0.5706646", "0.5700285", "0.5698294", "0.5695466", "0.5693036", "0.5690032", "0.5684425", "0.5667969", "0.5667969", "0.56599265", "0.5656253", "0.5651746", "0.56490123", "0.5642419", "0.5634268" ]
0.70250756
2
`await` this to get the account info for this agent's address.
get account () { return this.API.getAccount(this.address) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getAccount(address) {\n if (address == null) {\n return null;\n }\n var response = await restGet(`/auth/accounts/${address}`);\n var account;\n try {\n account = response.data.result.value;\n } catch (e) {\n return null;\n }\n\n if (account.address == \"\") {\n return null;\n }\n return account;\n}", "async GetAccount (address, schema) {\n try {\n let response = await this.client.request('theta.GetAccount', [{ address: address }])\n return responseExtractor(response, schema)\n } catch (error) {\n console.error(error)\n throw error\n }\n }", "getAccountInfo() {\n return request(`${this.locationPrefix}/account/info`, 'GET', this.config);\n }", "async getAccount(searchAddress) {\n const account = await this.queryClient.auth.account(searchAddress);\n return account ? accountFromProto(account) : null;\n }", "async function getShieldAddress(account) {\n const nfTokenShield = shield[account] ? shield[account] : await NFTokenShield.deployed();\n return nfTokenShield.address;\n}", "async getAccountData(address) {\n const account = this.networkClient.AccountAddress();\n account.setAddress(address);\n const request = this.networkClient.GetAccountInfoRequest();\n request.setAccount(account);\n const ledger = new ledger_pb_1.LedgerSpecifier();\n ledger.setShortcut(ledger_pb_1.LedgerSpecifier.Shortcut.SHORTCUT_VALIDATED);\n request.setLedger(ledger);\n const accountInfo = await this.networkClient.getAccountInfo(request);\n if (!accountInfo) {\n throw xrp_error_1.default.malformedResponse;\n }\n const accountData = accountInfo.getAccountData();\n if (!accountData) {\n throw xrp_error_1.default.malformedResponse;\n }\n return accountData;\n }", "function getAccount() {\r\n let adr = address.value;\r\n let sanitizedAdr = adr.toUpperCase().replace(/-|\\s/g, \"\");\r\n if (adr == \"\") {\r\n address.focus();\r\n return false;\r\n }\r\n _doGet('/account/get?address=' + sanitizedAdr);\r\n }", "async function getShieldAddress(account) {\n const nfTokenShield = shield[account]\n ? shield[account]\n : await getContractAddress('NFTokenShield');\n return nfTokenShield.address;\n}", "function getAccountInfo() {\n\n // Command to be sent to the IOTA API\n // Gets the latest transfers for the specified seed\n iota.api.getAccountData(seed, function(e, accountData) {\n\n console.log(\"Account data\", accountData);\n\n // Update address\n if (!address && accountData.addresses[0]) {\n\n address = iota.utils.addChecksum(accountData.addresses[accountData.addresses.length - 1]);\n\n updateAddressHTML(address);\n }\n\n balance = accountData.balance;\n\n // Update total balance\n updateBalanceHTML(balance);\n })\n }", "async function requestAccount() {\n await window.ethereum.request({ method: 'eth_requestAccounts' });\n }", "async function requestAccount() {\n await window.ethereum.request({ method: 'eth_requestAccounts' });\n }", "async function requestAccount() {\n await window.ethereum.request({ method: \"eth_requestAccounts\" });\n }", "async function requestAccount() {\n await window.ethereum.request({ method: \"eth_requestAccounts\" });\n }", "getAddress(node){\n console.log(\"Getting address for: \" + node);\n // cache addresses for faster use\n if (this.addresses[node]) {\n return new Promise(resolve => resolve(this.addresses[node]))\n }\n let config = Promise.all(this.getConfig(node));\n return config.then( response => {\n let web3 = response[0];\n let contract = response[1];\n return web3.eth.getAccounts();\n }).then(accounts => {\n this.addresses[node] = accounts[0];\n return accounts[0];\n });\n }", "async function requestAccount() {\n\t\tawait window.ethereum.request({method: 'eth_requestAccounts'});\n\t}", "getAddress(account_index, address_index) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield this.request(\"get_address_index\", {\n account_index,\n address_index,\n });\n });\n }", "queryAccount(address) {\n return this.client.rpcClient.abciQuery('custom/acc/account', {\n Address: address,\n });\n }", "function getaccountaddress(acc, callback) {\n client.call({\n \"method\": \"getaccountaddress\",\n \"params\": [acc.toString()]\n },\n function(err, res) {\n // Did it all work ?\n if (err) {\n console.log(err);\n } else {\n //if addr was generate successfully log it and return the address\n addr = res.result;\n console.log(\"new address generated for account: \" + acc + \" address: \" + res.result);\n }\n }\n );\n}", "async function requestAccount() {\n\t\tawait window.ethereum.request({ method: 'eth_requestAccounts' });\n\t}", "async fetchAccountDataByAddress(context, address) {\n await context.getters.info.setStore(context).initialFetch(address)\n }", "getApiAccount(account) {\n return __awaiter(this, void 0, void 0, function* () {\n const formattedBattleTag = yield utils_1.formatBattleTag(account);\n return yield this._handleApiCall(`/d3/profile/${formattedBattleTag}/`, 'Error fetching profile information.');\n });\n }", "async function readAccount() {\n const key = JSON.parse(process.env.KEY);\n\n const address = await arweave.wallets.jwkToAddress(key);\n console.log(\"address\", address);\n\n const lastTransactionId = await arweave.wallets.getLastTransactionID(address);\n console.log(\"lastTransactionId\", lastTransactionId);\n}", "async function getAccount() {\n return (await web3.eth.personal.getAccounts())[0];\n}", "async function getMetamaskAccount() {\r\n\tvar map = {};\r\n\tmap[\"id\"] = \"getWalletAddress\";\r\n\tmap[\"address\"]=\"0\";\r\n\r\n\ttry {\r\n\t const accounts = await ethereum.request({ method: 'eth_requestAccounts' });\r\n\t\tmap[\"address\"] = accounts[0];\r\n\t\tweb3 = new Web3(window.ethereum);\r\n\t\tconsole.log(web3);\r\n\t\tconsole.log(map[\"address\"]);\r\n\r\n\t} catch(error) {\r\n\t\tconsole.log(\"User rejected request\");\r\n\t}\r\n\tGMS_API.send_async_event_social(map);\r\n}", "async initAccounts() {\n if (window['ethereum']) {\n try {\n //returns the active address\n await window['ethereum'].enable()\n } catch (error) {}\n }\n\n\n }", "async function requestAccount(){\n //request metamask accounts\n await window.ethereum.request({method: 'eth_requestAccounts'});\n }", "async getAccountInfo(options = {}) {\n const { span, updatedOptions } = createSpan(\"BlobServiceClient-getAccountInfo\", options);\n try {\n return await this.serviceContext.getAccountInfo(Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }", "async getAccountInfo(options = {}) {\n const { span, updatedOptions } = createSpan(\"BlobServiceClient-getAccountInfo\", options);\n try {\n return await this.serviceContext.getAccountInfo(Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }", "_lookupAccount(address, cb) {\n this._trie.get(address, (err, raw) => {\n if (err)\n return cb(err);\n var account = new ethereumjs_account_1.default(raw);\n cb(null, account);\n });\n }", "async function generateAddress() {\n const addresses = await client.getAddresses(SEED)\n .accountIndex(0)\n .range(0, 1)\n .get();\n\n console.log(\"address for user X:\", addresses[0]);\n}", "getAccount(peerAddr) {\n let accts = globalState.get('000-reputation-accounts');\n for (let pa of Object.keys(accts)) {\n if (pa === peerAddr) {\n return accts[peerAddr];\n }\n }\n return null;\n }", "getAccountDetails(accountId) {\n if (lock.isBusy(accountId)) throwError('Service Unavailable', 503);\n this.logger.info('Getting account details...', accountId);\n return { ...accountDatabase[accountId] };\n }", "async function getAccount() {\n let account = \"No account\";\n if (web3.currentProvider) {\n account = await web3.eth.getAccounts();\n }\n return account\n}", "function user_info(address) {\n return new Promise((resolve, reject) => {\n contract.whitelist(address, (error, result) => {\n if (error) { reject(error); } else { resolve(result); }\n });\n });\n}", "getAccount(accountId: string): Promise<Account> {\n return this._member.getAccount(accountId);\n }", "async getAccount() {\n // need to call getAccount here?\n const cache = this.clientApplication.getTokenCache();\n const currentAccounts = await cache.getAllAccounts();\n\n if (currentAccounts === null) {\n console.log('No accounts detected');\n return null;\n }\n\n if (currentAccounts.length > 1) {\n // Add choose account code here\n console.log('Multiple accounts detected, need to add choose account code.');\n return currentAccounts[0];\n } else if (currentAccounts.length === 1) {\n return currentAccounts[0];\n } else {\n return null;\n }\n }", "getAccountInfo(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec$1);\n }", "getAccountInfo(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec$1);\n }", "getAccountInfo(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec$2);\n }", "getAccountInfo(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec$2);\n }", "async function getAccount() {\n if (!window.ethereum) {\n console.log(\"MetaMask not installed\")\n return false;\n }\n\n let status = false;\n await window.ethereum.request({ method: 'eth_accounts' })\n .then((accounts) => {\n if (accounts.length) {\n acc = accounts[0];\n status = true;\n }\n })\n .catch((err) => {\n // Some unexpected error.\n // For backwards compatibility reasons, if no accounts are available,\n // eth_accounts will return an empty array.\n console.error(err);\n });\n return status;\n}", "get address() {\n return this.web3Account.address;\n }", "getAccounts() {\n web3.eth.getAccounts((error, result) => {\n if (error) {\n console.log(error);\n } else {\n this.setState({ userAddress: result[0] });\n }\n });\n }", "getAccountDetails() {\n return this.OvhApiMe.v6().get().$promise;\n }", "async function fetchData() {\n const accounts = await web3.eth.getAccounts();\n setAddresses(accounts);\n setSelectedAddress(accounts[0]);\n accountService.setData(selectedAddress);\n }", "getAccountInfo(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec);\n }", "getAccountInfo(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec);\n }", "getAccountInfo(options) {\n const operationArguments = {\n options: coreHttp.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec);\n }", "async newAccount() {\n const created = await this.api.generateAddress();\n return created;\n }", "static async getAccount(accountId){\n try{\n const account = await this.server.accounts()\n .accountId(accountId).call()\n return account\n } catch (error) {\n console.log(\"An error ocurred trying to load account.\")\n console.log(error) \n throw error \n }\n }", "async function loadAccountInfo() {\n const account = await server.loadAccount(pair.publicKey());\n console.log(\"Balances for account: \" + pair.publicKey());\n account.balances.forEach(function(balance) {\n console.log(\"Type:\", balance.asset_type, \", Balance:\", balance.balance);\n });\n}", "async requestMetaMaskAccount() {\r\n if (!window.ethereum) throw new Error(\"Not supported.\");\r\n\r\n try {\r\n let method = 'eth_requestAccounts';\r\n this.accounts = await window.ethereum.request({ method });\r\n this.web3 = new Web3(window.ethereum);\r\n window.ethereum.enable();\r\n } catch (error) {\r\n console.error(error);\r\n throw new Error('Error getting account info');\r\n }\r\n }", "async function addr() {\n return await $.ajax({\n url: domain + \"/peer/addr\",\n method: \"GET\",\n });\n }", "async function getUserProxyAddress() {\n userProxyAddress = await userProxyFactory.methods.predictProxyAddress(\n userAddress,\n CREATE_2_SALT\n ).call({from : userAddress});\n}", "async function getRVNBalance(addr, verbose) {\n try {\n const result = await RVNBOX.Address.details([addr])\n\n if (verbose) console.log(result)\n\n const rvnBalance = result[0]\n\n return rvnBalance.balance\n } catch (err) {\n console.error(`Error in getRVNBalance: `, err)\n console.log(`addr: ${addr}`)\n throw err\n }\n}", "async getAccount(id){\n // console.log('Getting account...');\n data = {\n URI: `${ACCOUNTS}/${id}`,\n method: 'GET'\n }\n return await this.sendRequest(data)\n }", "async getAccount() {\n if (this.accountP) {\n return this.accountP;\n }\n const account = new Account(this.accountFilePath);\n await account.restore();\n return account;\n }", "getUserAddresses() {\n return __awaiter(this, void 0, void 0, function* () {\n let response = yield request({\n method: 'get',\n json: true,\n uri: `${this.EFoodAPIOrigin}/api/v1/user/clients/address`,\n headers: { 'x-core-session-id': this.store.sessionId }\n });\n return response.data;\n });\n }", "function getAccountAddress(accountData)\n{\n\treturn accountData.Address1 + \" \" + accountData.City + \", \" + accountData.State + \" \" + accountData.PostalCode\n}", "async function getBalanceOf(address) {\n const balance = await vault.balanceOf(address);\n console.log(`Balance of ${address}: ${balance}`);\n return balance;\n}", "addresses() {\n return __awaiter(this, void 0, void 0, function* () {\n return api_1.addresses(this);\n });\n }", "async function getBalance(address) {\n const nfTokenShield = shield[address] ? shield[address] : await NFTokenShield.deployed();\n const nfToken = await NFTokenMetadata.at(await nfTokenShield.getNFToken.call());\n return nfToken.balanceOf.call(address);\n}", "function balanceDetails(address, nodeUrl, requestOptions) {\n return __awaiter(this, void 0, void 0, function* () {\n return addresses_route.fetchBalanceDetails(nodeUrl, address, requestOptions);\n });\n}", "loadAccounts() {\n return this.web3.eth.getAccounts()\n .then((accounts) => {\n this.account = (accounts[0]);\n return this.account;\n }).catch((e) => {\n console.log(\"Error in getting account\", e);\n });\n }", "function getAccountDetails() {\n\tvar baseUrl = getClientStore().baseURL; \n\tvar accessor = objCommon.initializeAccessor(baseUrl, cellName);\n\tvar objAccountManager = new _pc.AccountManager(accessor);\n\tvar count = retrieveAccountRecordCount();\n\tvar uri = objAccountManager.getUrl();\n\turi = uri + \"?$orderby=__updated desc &$top=\" + count;\n\tvar restAdapter = _pc.RestAdapterFactory.create(accessor);\n\tvar response = restAdapter.get(uri, \"application/json\");\n\tvar json = response.bodyAsJson().d.results;\n\treturn json;\n}", "accounts () {\n var p = this.withLedgerFile(this.cli).exec(['accounts'])\n return p.then(pro => {\n return pro.invoke('toString', []).split().compact()\n })\n }", "async function getAccount() {\n /* eslint-disable prefer-const */\n let payload = {\n 'username': 'mateo.randulfe',\n 'password': 'efludnar.oetam',\n };\n\n try {\n let data = await axios.post(api+'/auth/token', payload);\n let account = {\n token: data.data.token,\n id: data.data.user.permissions[0].accountId,\n };\n return account;\n } catch (e) {\n return e.message;\n }\n}", "async function loadBalance(GCI, address) {\n let client = await lotion.connect(GCI)\n accounts = client.state.accounts\n return await accounts[address]['balance']\n }", "exportAccount (address) {\n return null // disabled\n // const wallet = this._getWalletForAccount(address)\n // return Promise.resolve(wallet.getPrivateKey().toString('hex'))\n }", "async function getAccountBalance() {\n return web3.eth.getBalance(getAccount());\n}", "function getMyAddr () {\n var serializedAccount = localStorage.getItem('account')\n var msg = \"s\"\n var ret\n if (serializedAccount !== null) {\n var acc = ethClient.Account.deserialize(serializedAccount)\n console.log(acc)\n console.log(acc.getAddress())\n msg = acc.getAddress()\n ret = true\n } else {\n msg = \"You don't have an address.\"\n ret = false\n }\n document.getElementById(\"myaddress\").innerText = \"Your address is \" + msg\n return ret\n}", "async function getLocationInfo(address){\n try{\n let response = await fetch(`https://maps.googleapis.com/maps/api/geocode/json?address=${address}&key=${API_KEY}`);\n response = await response.json();\n return response;\n }catch(err){\n console.log(err);\n }\n}", "getAddress() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(\n (position) => {\n var requestOptions = {\n method: \"GET\",\n redirect: \"follow\",\n };\n\n fetch(\n `https://maps.googleapis.com/maps/api/geocode/json?latlng=${position.coords.latitude},${position.coords.longitude}&key=AIzaSyDtU4wnc7N3-U9QMpRCG5CCaqCJc2nYuz8&language=en_AU`,\n requestOptions\n )\n .then((response) => response.text())\n .then((result) => {\n // console.log(\"address\",result);\n let res = JSON.parse(result);\n // console.log(\"address\", res.results[0].formatted_address);\n this.entered_address = res.results[0].formatted_address;\n })\n .catch((error) => console.log(\"error\", error));\n }\n // () => {\n // handleLocationError(true, infoWindow, map.getCenter());\n // }\n );\n } else {\n // Browser doesn't support Geolocation\n // handleLocationError(false, infoWindow, map.getCenter());\n }\n }", "async handleResponse(response) {\n if (response !== null) {\n this.account = response.account;\n } else {\n this.account = await this.getAccount();\n }\n\n return this.account;\n }", "function getUserInfo() {\n\n var contract = {\n \"function\": \"sm_getUserInfo\",\n \"args\": JSON.stringify([gUserAddress])\n }\n\n return neb.api.call(getAddressForQueries(), gdAppContractAddress, gNasValue, gNonce, gGasPrice, gGasLimit, contract);\n\n}", "function getAccount() {\n const config = zxeth.getConf();\n\n return config.accounts[0];\n}", "async function getBalance() {\n if (typeof window.ethereum !== 'undefined') {\n const [account] = await window.ethereum.request({ method: 'eth_requestAccounts' })\n const provider = new ethers.providers.Web3Provider(window.ethereum);\n const contract = new ethers.Contract(bvgTokenAddress, BVGToken.abi, provider)\n const balance = await contract.balanceOf(account);\n console.log(\"Balance: \", ethers.utils.formatEther(balance).toString());\n }\n }", "account(profile, args, context, info) {\n return { __typename: \"Account\", id: profile.accountId };\n }", "async getAddressCoord(){\n \n let url = new URL('https://api.tomtom.com/search/2/geocode/.json')\n url.search = new URLSearchParams({\n query: this.searchAddress,\n key: 'HgVrAuAcCtAcxTpt0Vt2SyvAcoFKqF4Z',\n versionNumber: '2',\n limit: '1'\n })\n \n const response = await fetch(url);\n\n const data = await response.json();\n this.lat = data.results[0].position.lat;\n this.lon = data.results[0].position.lon;\n\n console.log(this.lat);\n }", "async getAccountName(id) {\n let response = await axios.get(`${API_URL}/Accounts/${id}`);\n return response.data.fullname;\n }", "account() {\n return new Account(this.getSDK(), this.getToken());\n }", "async function printInfo() {\n await account.login();\n let info = await account.getBasicInfo();\n console.log(info);\n console.log(info.name);\n}", "getAccount() {\n return super.getAsNullableString(\"account\");\n }", "async function getNFTAddress(address) {\n const nfTokenShield = shield[address] ? shield[address] : await NFTokenShield.deployed();\n return nfTokenShield.getNFToken.call();\n}", "async newAccountTestnet() {\n const options = {\n uri: \"https://faucet.altnet.rippletest.net/accounts\",\n headers: { \"Content-type\": \"application/json\" }\n };\n\n const doRequest = options => {\n return new Promise((resolve, reject) => {\n req.post(options, (error, response, body) => {\n if (!error && response.statusCode == 200) {\n resolve(body);\n } else {\n reject(error);\n }\n });\n });\n };\n this.firstRes = await doRequest(options);\n this.setInterval(3000);\n return this.verifyAccountInfo(JSON.parse(this.firstRes).account.address);\n }", "async function getBalance(addr) {\n addressBalance = await client.getAddressBalance(addr)\n console.log(\"addressBalance:\", addressBalance.balance);\n if(addressBalance.balance == 0) {\n getBalance(addr)\n }\n else {\n console.log('Funds Received!');\n return\n }\n}", "async getWalletInfo() {\n return new Promise(async resolve => {\n const myWalletInfo = await this.wallet.getWalletInfo();\n resolve(myWalletInfo);\n });\n }", "balance(address) {\n return __awaiter(this, void 0, void 0, function* () {\n return api_1.balance(this, address);\n });\n }", "getAccounts(tag) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield this.request(\"get_accounts\", {\n tag,\n });\n });\n }", "async function getEmailAddress(handlerInput) {\n const { requestEnvelope, serviceClientFactory } = handlerInput;\n\n let emailAddress = null;\n const consentToken = requestEnvelope.context.System.apiAccessToken;\n if (!consentToken) {\n console.log(`User hasn't granted permissions to access their profile information.`);\n return emailAddress;\n }\n\n try {\n const client = serviceClientFactory.getUpsServiceClient();\n emailAddress = await client.getProfileEmail();\n } catch (error) {\n if (error.statusCode === 403)\n console.log(`User hasn't granted permissions to access their profile information. Error: ${error}`);\n else\n console.log(`An unexpected error occurred while trying to fetch user profile: ${error}`);\n }\n\n if (!EmailValidator.validate(emailAddress)) return null;\n return emailAddress;\n}", "async function getAccountTokenIds(addr) {\n let cadence = await (await fetch(getAccountTokenIdsScript)).text();\n const encoded = await fcl.send([\n fcl.script(cadence),\n fcl.args([fcl.arg(addr, t.Address)])\n ]);\n return await fcl.decode(encoded);\n}", "async function fetchAddress(){\n addressValue = addressInput.val();\n console.log(\"Address is - \"+addressValue);\n apiAddress = \"http://api.etherscan.io/api?module=account&action=txlist&address=\"+addressValue+\"&startblock=0&endblock=99999999&sort=asc\"+ apiKey;\n try{\n const response_Address = await fetch(apiAddress);\n const json_Address = await response_Address.json();\n console.log(json_Address);\n if (json_Address.message == \"OK\"){\n var numTrax = json_Address.result.length;\n console.log(\"Number of Transactions - \"+numTrax);\n $(\"#numTrax\").text(`You have ${numTrax} transactions`);\n $(\"#Trax\").text(JSON.stringify(json_Address.result));\n } else {\n $(\"#numTrax\").text(`Invalid address.`);\n $(\"#Trax\").text(\" \");\n }\n }catch{\n $(\"#numTrax\").text(`Invalid address.`);\n $(\"#Trax\").text(\" \");\n }\n}", "async addressBalance(addr) {\n let [fConfirmed, fUnconfirmed] = await this.addressFunding(addr);\n let [sConfirmed, sUnconfirmed] = await this.addressSpent(addr, fConfirmed);\n\n let totalFunded = 0;\n for (let f of fConfirmed) {\n totalFunded += f.value;\n }\n\n let totalSpent = 0;\n for (let s of sConfirmed) {\n totalSpent += s.value;\n }\n\n let balance = {\n confirmed: totalFunded - totalSpent,\n unconfirmed: totalFunded - totalSpent,\n received: totalFunded,\n spent: totalSpent\n };\n\n return balance;\n }", "async function getBalance(address) {\n const nfToken = await NFTokenMetadata.at(await getContractAddress('NFTokenMetadata'));\n return nfToken.balanceOf.call(address);\n}", "function checkAccount() {\n try {\n const ethereum = checkConnection();\n return ethereum.selectedAddress;\n } catch (error) {\n return 0;\n }\n}", "async function connectToWallet() {\n const ethereum = checkConnection();\n\n if (checkAccount() == null) {\n try {\n await ethereum.send(\"eth_requestAccounts\");\n } catch (error) {\n console.log(error);\n }\n } else {\n console.log(\"account: \" + ethereum.selectedAddress);\n }\n}", "async getCompanyInfo() {\n //change to calling the company contract created by the owner\n //need a way to call company ID using the owner's connected address\n //should likely be added as a method to the registry\n // let coId = await payrollContract.methods.getCompanyId(this.state.account).call({from: this.state.account});\n this.getEmployeeArray(); \n this.getCompanyBalances();\n }", "async function get_account_id(username, region) {\n //gets summoner_id from username\n const summoner_id = await kayn.Summoner.by\n .name(username)\n .region(region)\n .then((summoner) => {\n return summoner.accountId;\n });\n return summoner_id;\n }", "async function main() {\n const userInfo = await getUserInfo('12');\n console.log(userInfo);\n\n const userAddress = await getUserAddress('12');\n console.log(userAddress);\n\n console.log('ceva4');\n}", "function getAccountId() {\n var url = 'https://' + getInfo('region') + '.api.riotgames.com/lol/summoner/v3/summoners/by-name/' + encodeURIComponent(getInfo('summoner_name')) + '?api_key=' + getInfo('api_key');\n var response = UrlFetchApp.fetch(url, {muteHttpExceptions: true});\n var status = checkStatusError(response);\n if(!status) {\n var json = response.getContentText();\n var data = JSON.parse(json); \n return data['accountId'];\n }\n else if(status == 'exit') {\n return 'exit';\n }\n else if(typeof(status) == 'number') {\n Utilities.sleep(status);\n return getSummonerId();\n }\n else { // default wait 10 seconds if we fail but don't know why\n Utilities.sleep(10000);\n return getSummonerId();\n }\n}" ]
[ "0.69001406", "0.6792922", "0.67014945", "0.6667558", "0.66384286", "0.6629176", "0.6600547", "0.65904033", "0.6445566", "0.64336807", "0.6403458", "0.64022124", "0.64022124", "0.6387307", "0.6369204", "0.6346381", "0.63448113", "0.6328385", "0.63090277", "0.63067836", "0.6289004", "0.62515247", "0.6247043", "0.62325495", "0.61732477", "0.6134653", "0.6125235", "0.6125235", "0.61070013", "0.6099834", "0.60840076", "0.60621816", "0.605298", "0.6047896", "0.6040539", "0.6038349", "0.6011313", "0.6011313", "0.6005378", "0.6005378", "0.5964481", "0.59622836", "0.5957246", "0.5933821", "0.59029305", "0.589961", "0.589961", "0.5895626", "0.5891582", "0.58886135", "0.5872773", "0.58648294", "0.5859489", "0.5825885", "0.5803329", "0.5790768", "0.578094", "0.57655877", "0.5764464", "0.57452613", "0.57329303", "0.56967396", "0.56873477", "0.56870943", "0.5680279", "0.5675856", "0.5642155", "0.5598439", "0.55945325", "0.5583039", "0.556569", "0.55575544", "0.55524296", "0.5550876", "0.5544632", "0.55430716", "0.5535184", "0.55104774", "0.55093735", "0.55076545", "0.5504698", "0.5490099", "0.54751563", "0.5473372", "0.54618025", "0.54546624", "0.54499584", "0.54445064", "0.5441506", "0.54369473", "0.5433011", "0.5432506", "0.5415276", "0.5413176", "0.5408461", "0.5403634", "0.54025346", "0.5399745", "0.5398552", "0.5397084" ]
0.68403494
1
`await` this to get the current balance in the native coin of the network, in its most granular denomination
get balance () { return this.getBalance() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getBalance() {\n if (this.active) {\n try {\n console.log('Looking up account balance');\n let response = await this.client.account_balance(this.GAME_ADDRESS);\n return this.getKraiFromRaw(response.balance);\n } catch (error) {\n console.log(`RPC error: ${error.message}`);\n }\n }\n return 0;\n }", "async getBalance () {\n await this.update()\n return this.client.getBalance()\n }", "async 'populous.balanceOf'() {\n const {\n config: {\n network: {ropsten},\n contract: {ERC1155},\n },\n contracts: {ERC1155: {balanceOf}},\n } = ethConnect;\n\n try {\n const result = await balanceOf(connectInstance, ERC1155, {XAUP_TOKENID: process.env.XAUP_TOKENID, address: process.env.ETH_ADDRESS});\n return Number(result);\n } catch (error) {\n return 0;\n }\n }", "async function getBalance() {\n if (typeof window.ethereum !== 'undefined') {\n const [account] = await window.ethereum.request({ method: 'eth_requestAccounts' })\n const provider = new ethers.providers.Web3Provider(window.ethereum);\n const contract = new ethers.Contract(bvgTokenAddress, BVGToken.abi, provider)\n const balance = await contract.balanceOf(account);\n console.log(\"Balance: \", ethers.utils.formatEther(balance).toString());\n }\n }", "async function getBalance () {\n try {\n // first get BCH balance\n const aliceBalance = await bchjs.Electrumx.balance(\n aliceWallet.cashAddress\n )\n const bobBalance = await bchjs.Electrumx.balance(bobWallet.cashAddress)\n const samBalance = await bchjs.Electrumx.balance(samWallet.cashAddress)\n\n console.log('BCH Balances information')\n console.log('------------------------')\n console.log('Alice\\'s Wallet:')\n console.log(`${aliceWallet.cashAddress}`)\n console.log(JSON.stringify(aliceBalance.balance, null, 2))\n console.log('--')\n console.log('Bob\\'s Wallet:')\n console.log(`${bobWallet.cashAddress}`)\n console.log(JSON.stringify(bobBalance.balance, null, 2))\n console.log('--')\n console.log('Sam\\'s Wallet:')\n console.log(`${samWallet.cashAddress}`)\n console.log(JSON.stringify(samBalance.balance, null, 2))\n } catch (err) {\n console.error('Error in getBalance: ', err)\n throw err\n }\n}", "balanceCurrentBalance() {\n return new Promise((resolve, reject) => {\n client.getBalance().then((balance) => {\n resolve(balance);\n return '';\n }).catch((err) => {\n reject(err);\n });\n });\n }", "calculateBalanceFromBlockchain() {}", "async function getAccountBalance() {\n return web3.eth.getBalance(getAccount());\n}", "async getBalance() {\n const balance = await privateTokenSale.methods.getBalance().call();\n return balance;\n }", "function getBalance() {\n const payload = {\n symbol: 'ELF',\n owner: wallet.address\n };\n\n multiTokenContract.GetBalance.call(payload)\n .then(result => {\n console.log('result: ' + result);\n })\n .catch(err => {\n console.log(err);\n });\n\n return multiTokenContract.GetBalance.call(payload)\n .then(result => {\n console.log(result.balance);\n return result.balance;\n })\n .catch(err => {\n console.log(err);\n });\n }", "async getBalance (denomination = 'uscrt') {\n const account = await this.API.getAccount(this.address) || {}\n const balance = account.balance || []\n const inDenom = ({denom, amount}) => denom === denomination\n const balanceInDenom = balance.filter(inDenom)[0] || {}\n return balanceInDenom.amount || 0\n }", "balance(owner) {\n return this.balanceOf(owner).then(re => {\n return re.toString()\n })\n }", "static getEthBalance() {\n const { walletAddress } = store.getState();\n\n const web3 = new Web3(this.getWeb3HTTPProvider());\n\n return new Promise((resolve, reject) => {\n web3.eth.getBalance(walletAddress, (error, weiBalance) => {\n if (error) {\n reject(error);\n }\n\n const balance = weiBalance / Math.pow(10, 18);\n\n AnalyticsUtils.trackEvent('Get ETH balance', {\n balance,\n });\n\n resolve(balance);\n });\n });\n }", "async function getTradeBalance() {\n await traderBot.api('TradeBalance', {asset: 'ETH'})\n .then((res) => console.log(res))\n .catch((rej) => console.log(rej));\n}", "async getBuyingPower(){\n await binanceUS.balance((error, balances) =>{\n let money = balances['USD'];\n let obj = $.of(money)\n obj.available = money.available\n obj.onOrder = money.onOrder\n obj.total = obj.available + obj.onOrder\n console.log(obj.available)\n this.global.myBalances.buyingPower = obj.available\n return obj\n })\n }", "async getBalance () {\n const body = new FormData();\n body.append(\"secret\", this.secret);\n\n const request = new Request(\"post\", `${Endpoints.pay.base}${Endpoints.pay.balance}`, {\n body: body\n });\n const response = await this.manager.push(request);\n\n if (response.success) {\n this.balance = response.balance;\n return this.balance;\n } else {\n const errorObj = {\n error: true,\n location: `${Endpoints.pay.base}${Endpoints.pay.balance}`,\n method: \"post\",\n reason: response.reason,\n params: {}\n };\n this.emit(\"error\", errorObj);\n return errorObj;\n }\n }", "get balance() {\n return this.coins.reduce((acc, {output}) => acc + output.amount, 0);\n }", "async function getResponse(account){\r\n //get the balance\r\n var bal = await web3.eth.getBalance(account);\r\n var responses = [\r\n `The balance for the account starting with ${account.substring(0,10)} is ${bal * .000000000000000001}`,\r\n `${bal * .000000000000000001}`\r\n ]\r\n log.debug('[dflow/controllers/getBalance.js] possible responses: ' + responses); \r\n return responses[Math.floor(Math.random() * responses.length)]; \r\n}", "getBalance(account, more) {\n if (!account) return 0.00;\n\n if (!this.web3.isAddress(account))\n throw `${account} is an invalid account`;\n\n // more - pending, latest \n if (!more) more = 'latest';\n\n // ether = ligear\n const weiValue = this.web3.eth.getBalance(account, more);\n return Number(this.web3.fromWei(weiValue));\n }", "balance() {\n return this.contract.methods.balanceOf(this.contract.defaultAccount).call();\n }", "function getBalance() {\n return balance;\n }", "async function getBalanceOf(address) {\n const balance = await vault.balanceOf(address);\n console.log(`Balance of ${address}: ${balance}`);\n return balance;\n}", "getBalance(crypto = null) {\r\n if (this.config.debug) {\r\n console.log(\"WalletBF getBalance\");\r\n }\r\n\r\n if (!crypto) {\r\n crypto = \"XBT\";\r\n }\r\n\r\n let balance = 0;\r\n let coins = this.getStoredCoins(true, crypto);\r\n Object.keys(coins).forEach(function(i) {\r\n balance += parseFloat(coins[i].v); \r\n });\r\n return this._round(balance,8);\r\n }", "async getCurrentExchangeRate() {\n // set balance of account\n return new BigNumber(\n ethers.utils.formatUnits(await this.instance.exchangeRateStored(), this.token.decimals),\n )\n }", "function getBalance() {\n return new Promise((resolve, reject) => {\n co(function* () {\n\n yield validateConfig()\n .catch((err) => {\n reject(err);\n });\n\n yield readYAML()\n .catch((err) => {\n reject(err);\n });\n\n yield getUserAddress()\n .catch((err) => {\n reject(err);\n });\n\n yield fetchBalance()\n .then((result) => {\n resolve(result);\n })\n .catch((err) => {\n reject(err);\n });\n });\n });\n}", "getBalance(node) {\n console.log(\"Getting ETH balance for: \" + node);\n let config = Promise.all(this.getConfig(node));\n return config.then( response => {\n let web3 = response[0];\n let contract = response[1];\n return this.getAddress(node).then((address) => {\n return web3.eth.getBalance(address).then((balanceWei) => {\n return web3.utils.fromWei(balanceWei, 'ether');\n })\n })\n });\n }", "async getBCHBalance (addr, verbose = false) {\n try {\n const fulcrumBalance = await this.bchjs.Electrumx.balance(addr)\n // console.log(`fulcrumBalance: ${JSON.stringify(fulcrumBalance, null, 2)}`)\n\n const confirmedBalance = this.bchjs.BitcoinCash.toBitcoinCash(\n fulcrumBalance.balance.confirmed\n )\n\n if (verbose) {\n // const resultToDisplay = confirmedBalance\n // resultToDisplay.txids = []\n console.log(fulcrumBalance)\n }\n\n const bchBalance = confirmedBalance\n\n return bchBalance\n } catch (err) {\n wlogger.error(`Error in bch.js/getBCHBalance(): ${err.message}`, err)\n throw err\n }\n }", "async function _TB(_holder) {\n return new Promise(async (resolve, reject) =>{\n return resolve((await token.balanceOf.call(_holder)).toNumber());\n })\n}", "async fetchTotalSupply() {\n const data = await this.request('https://dex.binance.org/api/v1/tokens?limit=999999999');\n const record = data.find((item) => item.symbol === 'BNB');\n\n return record ? Number(record.total_supply) : 0;\n }", "currentBalance() {\n const sumTransaction = (a, b) => a + getTransactionAmountWithSign(b);\n\n return slice((state) => state.transactions.reduce(sumTransaction, 0));\n }", "function getAccountBalance(){\r\n myContract.methods.getAccountBalance().call(function(error, result){\r\n if(!error)\r\n { \r\n // console.log(\"account balance: \"+ result);\r\n // console.log(result);\r\n // $(\".balanceLeft\").text(parseInt(result));\r\n }\r\n else\r\n console.error(error);\r\n });\r\n }", "function getProxyTotalBalance() {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n const r = yield (0, node_fetch_1.default)(adminURL + 'balances', {\n method: 'GET',\n headers: { 'x-admin-token': config.proxy_admin_token },\n });\n const j = yield r.json();\n return j.total ? Math.floor(j.total / 1000) : 0;\n }\n catch (e) {\n return 0;\n }\n });\n}", "async function getBalance(addrs) {\n let response;\n\n // Try/Catch block to guarantee a value is returned, else reject with the error\n try {\n response = await axios.get(`https://api.blockcypher.com/v1/eth/main/addrs/${addrs}/balance`);\n } catch(e) {\n return Promise.reject(e);\n }\n \n // balance object with the Weis currensy converted into Ethereum (1 Ether === 10^18)\n const balance = { ether : (response.data.balance/Math.pow(10, 18)) };\n\n res.status(200).send(balance);\n }", "async getBalance(hash) {\n const json = await this.get(`/api/v1/balance/${hash}`);\n this.handleError(json);\n return json.Result;\n }", "async fetchBinance(coin, element) {\n const URL = `https://api.binance.com/api/v3/ticker/price?symbol=${coin}USDT`;\n let price = await fetch(URL)\n .then((blob) => blob.json())\n .then((data) => {\n return data.price;\n })\n .catch((error) => {\n console.error(\"Error with the Binance fetch operation\", error);\n this.setPrice(\"\", element, \"Binance\");\n return \"\";\n });\n return parseFloat(price);\n }", "getCreditsBalanceAsync(authToken) {\n return __awaiter(this, void 0, void 0, function* () {\n this.verifyAuthToken(authToken);\n const url = `${app_config_1.CopyleaksConfig.API_SERVER_URI}/v3/scans/credits`;\n const headers = {\n 'User-Agent': app_config_1.CopyleaksConfig.USER_AGENT,\n 'Authorization': `Bearer ${authToken['access_token']}`\n };\n const response = yield axios_1.default.get(url, { headers });\n if ((0, utils_1.isSuccessStatusCode)(response.status))\n return response.data;\n else if ((0, utils_1.isUnderMaintenanceResponse)(response.status)) {\n throw new exceptions_1.UnderMaintenanceException();\n }\n else if ((0, utils_1.isRateLimitResponse)(response.status)) {\n throw new exceptions_1.RateLimitException();\n }\n else {\n throw new exceptions_1.CommandException(response);\n }\n });\n }", "async fetchCirculatingSupply() {\n const { supply: circulating } = await this.request(\n 'https://explorer.pirate.black/api/marketcap',\n );\n return Number(circulating);\n }", "balanceForAsset(sourceWallet, asset) {\n return sourceWallet.publicKey()\n .then((publicKey) => {\n return this.server().loadAccount(publicKey)\n })\n .then((account) => {\n for (const balance of account.balances) {\n if (balance.asset_type === 'native') {\n if (asset.isNative()) {\n return balance.balance\n }\n } else {\n if (balance.asset_code === asset.getCode() && balance.asset_issuer === asset.getIssuer()) {\n return balance.balance\n }\n }\n }\n\n return '0'\n })\n }", "async fetchCirculatingSupply() {\n const { data: { circulatingSupply } } = await this.request({\n url: 'https://www.btse.com/api/tokentransparency',\n headers: {\n 'User-Agent': 'PostmanRuntime/7.24.1', // tmp hack: without UserAgent definition url will not work\n },\n });\n\n return Number(circulatingSupply);\n }", "getBalance() {\n return this.wallet.getBalance();\n }", "function getMyBalance() {\n return df.getMyBalanceEth();\n}", "async fetchTotalSupply() {\n return Number(200000000);\n }", "async getCompanyBalances() {\n let usdcBal = await USDC.methods.balanceOf(this.state.companyAddress).call({from: this.state.account});\n let daiBal = await DAI.methods.balanceOf(this.state.companyAddress).call({from: this.state.account});\n let usdtBal = await USDT.methods.balanceOf(this.state.companyAddress).call({from: this.state.account});\n this.setState({\n usdcBalance: usdcBal,\n daiBalance: daiBal,\n usdtBalance: usdtBal \n });\n }", "function balance( key ){\n\n\tcheckForMissingArg( key, \"key\" );\n\t\n\treturn getPublicKey(key).then( Blockchain.getBalance );\n}", "async function getBalance(addr) {\n addressBalance = await client.getAddressBalance(addr)\n console.log(\"addressBalance:\", addressBalance.balance);\n if(addressBalance.balance == 0) {\n getBalance(addr)\n }\n else {\n console.log('Funds Received!');\n return\n }\n}", "async function returnSupply(token, address, abi) {\n let contract = new web3.eth.Contract(abi, token);\n let decimals = await contract.methods.decimals().call();\n let supply = await contract.methods.totalSupply().call();\n balance = await new BigNumber(supply).div(10 ** decimals).toFixed(2);\n return parseFloat(balance);\n }", "getBalance(callback){\n \n const api_data = {\n api_name:'/get-balance',\n coin:this.coin,\n api_key: this.apikey,\n password : this.api_password,\n };\n api_call.apiPostCall(api_data,{},callback);\n }", "outstandingBalance() {\n const amountPaid = this.amountPaidOnInvoice();\n const invoiceTotal = this.amount;\n const tip = this.tip || 0;\n return (invoiceTotal + tip) - amountPaid;\n }", "function getCurrentBalance() {\n //current Balance\n const balanceTotal = document.getElementById('balance-total');\n const balanceTotalText = balanceTotal.innerText;\n const preBalanceTotal = parseFloat(balanceTotalText);\n return preBalanceTotal;\n}", "function retbalance(addr) {\n var balance= web3.fromWei(web3.eth.getBalance(addr));\n return (balance);\n}", "function getCurrentBalance() {\n const balanceTotal = document.getElementById('balance-total');\n const balanceTotalText = balanceTotal.innerText;\n const previousBalanceTotal = parseFloat(balanceTotalText);\n return previousBalanceTotal;\n }", "getAccountBalance () {\n return this.createRequest('/balance', 'GET');\n }", "async function fetchAccountData() {\r\n\r\n // Get a Web3 instance for the wallet\r\n const web3 = new Web3(provider);\r\n\r\n console.log(\"Web3 instance is\", web3);\r\n\r\n // Get connected chain id from Ethereum node\r\n const chainId = await web3.eth.getChainId();\r\n // Load chain information over an HTTP API\r\n const chainData = evmChains.getChain(chainId);\r\n\r\n // Load Presale Contract\r\n const presale = new web3.eth.Contract(contract_abi,contract_address);\r\n\r\n // Get list of accounts of the connected wallet\r\n const accounts = await web3.eth.getAccounts();\r\n\r\n // MetaMask does not give you all accounts, only the selected account\r\n console.log(\"Got accounts\", accounts);\r\n selectedAccount = accounts[0];\r\n\r\n document.querySelector(\"#selected-account\").textContent = selectedAccount;\r\n\r\n // Presale Whitelist\r\n if (chainId == 56) {\r\n const whitelistedaddress = await presale.methods.checkWhitelist(selectedAccount).call();\r\n console.log(whitelistedaddress)\r\n document.querySelector(\"#whitelisted-address\").textContent = whitelistedaddress;\r\n console.log ('Right Network') \r\n } else {\r\n document.querySelector(\"#whitelisted-address\").textContent = 'Connect on Binance Smart Chain';\r\n console.log ('Wrong Network')\r\n }\r\n\r\n // Reserved Tokens\r\n const enteredpresale = await presale.methods.enteredPresale(selectedAccount).call({from : selectedAccount}, function(error, result){\r\n console.log(result);\r\n});\r\n if (chainId == 56 && enteredpresale == true) {\r\n const reserved = await presale.methods._TokensReserved(selectedAccount).call();\r\n reservedtokens = Number(reserved) / 1e9;\r\n console.log(reservedtokens)\r\n const checkcontrib = await presale.methods.checkContribution(selectedAccount).call();\r\n console.log(checkcontrib)\r\n checkcontribution = Number(checkcontrib) / 1e18;\r\n console.log(checkcontribution)\r\n document.querySelector(\"#contribution-amount\").textContent = Number(checkcontribution) + ' BNB';\r\n document.querySelector(\"#reserved-tokens\").textContent = Number(reservedtokens) + ' JDT'; \r\n } else {\r\n test = 0;\r\n document.querySelector(\"#contribution-amount\").textContent = 0 + ' BNB';\r\n document.querySelector(\"#reserved-tokens\").textContent = 0 + ' JDT';\r\n console.log ('Wrong Network')\r\n }\r\n\r\n\r\n // Display fully loaded UI for wallet data\r\n document.querySelector(\"#prepare\").style.display = \"none\";\r\n document.querySelector(\"#connected\").style.display = \"block\";\r\n}", "async fetchCirculatingSupply() {\n const { data: circulating } = await this.request(\n 'https://api.oasis.app/v1/supply/dai',\n );\n\n return Number(circulating) / 10 ** 8;\n }", "async function getRVNBalance(addr, verbose) {\n try {\n const result = await RVNBOX.Address.details([addr])\n\n if (verbose) console.log(result)\n\n const rvnBalance = result[0]\n\n return rvnBalance.balance\n } catch (err) {\n console.error(`Error in getRVNBalance: `, err)\n console.log(`addr: ${addr}`)\n throw err\n }\n}", "balance(address) {\n return __awaiter(this, void 0, void 0, function* () {\n return api_1.balance(this, address);\n });\n }", "async fetchCirculatingSupply() {\n const { result: { supply: { circulating } } } = await this.request(\n 'https://public-lcd2.akash.vitwit.com/supply/summary',\n );\n\n const record = circulating.find((item) => item.denom === 'uakt');\n\n return Number(record.amount) / 10 ** 6;\n }", "async fetchTotalSupply() {\n const { result: { supply: { total } } } = await this.request(\n 'https://public-lcd2.akash.vitwit.com/supply/summary',\n );\n\n const record = total.find((item) => item.denom === 'uakt');\n\n return Number(record.amount) / 10 ** 6;\n }", "async function fetch() {\n var price_feed = await retry(async bail => await axios.get('https://api.coingecko.com/api/v3/simple/price?ids=bitcoin,chainlink,yearn-finance,ethlend,havven,compound-governance-token,ethereum&vs_currencies=usd&include_market_cap=true&include_24hr_vol=true&include_24hr_change=true'))\n\n var contracts = [\n \"0x75c23271661d9d143dcb617222bc4bec783eff34\", //WETH-USDC\n \"0x562c0b218cc9ba06d9eb42f3aef54c54cc5a4650\", //LINK-USDC\n \"0xc226118fcd120634400ce228d61e1538fb21755f\", //LEND-USDC\n \"0xca7b0632bd0e646b0f823927d3d2e61b00fe4d80\", //SNX-USDC\n \"0x0d04146b2fe5d267629a7eb341fb4388dcdbd22f\", //COMP-USDC\n \"0x2109f78b46a789125598f5ad2b7f243751c2934d\", //WBTC-USDC\n \"0x1b7902a66f133d899130bf44d7d879da89913b2e\", //YFI-USDC\n ]\n var balanceCheck = '0x3dfd23A6c5E8BbcFc9581d2E864a68feb6a076d3';\n var tvl = 0;\n\n var contract = '0x75c23271661d9d143dcb617222bc4bec783eff34';\n var token = '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2';\n let balance = await utils.returnBalance(token, contract);\n tvl += (parseFloat(balance) * price_feed.data.ethereum.usd)\n\n var contract = '0x562c0b218cc9ba06d9eb42f3aef54c54cc5a4650';\n var token = '0x514910771af9ca656af840dff83e8264ecf986ca';\n balance = await utils.returnBalance(token, contract);\n tvl += (parseFloat(balance) * price_feed.data.chainlink.usd)\n\n var contract = '0xc226118fcd120634400ce228d61e1538fb21755f';\n var token = '0x80fB784B7eD66730e8b1DBd9820aFD29931aab03';\n balance = await utils.returnBalance(token, contract);\n tvl += (parseFloat(balance) * price_feed.data.ethlend.usd)\n\n var contract = '0xca7b0632bd0e646b0f823927d3d2e61b00fe4d80';\n var token = '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f';\n balance = await utils.returnBalance(token, contract);\n tvl += (parseFloat(balance) * price_feed.data.havven.usd)\n\n\n var contract = '0x0d04146b2fe5d267629a7eb341fb4388dcdbd22f';\n var token = '0xc00e94cb662c3520282e6f5717214004a7f26888';\n balance = await utils.returnBalance(token, contract);\n tvl += (parseFloat(balance) * price_feed.data['compound-governance-token'].usd)\n\n\n var contract = '0x2109f78b46a789125598f5ad2b7f243751c2934d';\n var token = '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599';\n balance = await utils.returnBalance(token, contract);\n tvl += (parseFloat(balance) * price_feed.data.bitcoin.usd)\n\n\n var contract = '0x1b7902a66f133d899130bf44d7d879da89913b2e';\n var token = '0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e';\n balance = await utils.returnBalance(token, contract);\n tvl += (parseFloat(balance) * price_feed.data['yearn-finance'].usd)\n\n await Promise.all(\n contracts.map(async contract => {\n var contract = contract;\n var token = '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48';\n let balance = await utils.returnBalance(token, contract);\n tvl += parseFloat(balance)\n\n })\n )\n\n return tvl;\n\n\n}", "async function getBalances(contract) {\n wethBalance = web3.utils.fromWei(await weth.methods.balanceOf(unlockedAccount).call(), \"ether\");\n aaveBalance = web3.utils.fromWei(await aave.methods.balanceOf(unlockedAccount).call(), \"ether\");\n awethBalance = web3.utils.fromWei(await aweth.methods.balanceOf(unlockedAccount).call(), \"ether\");\n aaaveBalance = web3.utils.fromWei(await aaave.methods.balanceOf(unlockedAccount).call(), \"ether\");\n console.log(`aWeth (user): ${awethBalance}`);\n console.log(`aAave (user): ${aaaveBalance}`);\n\n wethBalance = web3.utils.fromWei(await weth.methods.balanceOf(contract).call(), \"ether\");\n aaveBalance = web3.utils.fromWei(await aave.methods.balanceOf(contract).call(), \"ether\");\n awethBalance = web3.utils.fromWei(await aweth.methods.balanceOf(contract).call(), \"ether\");\n aaaveBalance = web3.utils.fromWei(await aaave.methods.balanceOf(contract).call(), \"ether\");\n console.log(`aWeth (contract): ${awethBalance}`);\n console.log(`aAave (contract): ${aaaveBalance}`);\n console.log(`weth (contract): ${wethBalance}`);\n console.log(`aave (contract): ${aaveBalance}`);\n }", "GetTreeBalance() {\n return this.m_contactManager.m_broadPhase.GetTreeBalance();\n }", "refreshBalance(){\n\n // Get the public and private keys\n (async () => {\n try {\n // Retreive the credentials\n const credentials = await Keychain.getGenericPassword();\n if (credentials) {\n \n let credentials_parsed = JSON.parse(credentials.password)\n \n let privateKey = credentials_parsed.eth[0].privateKey \n let publicKey = credentials_parsed.eth[0].publicKey \n \n this.setState({\n privateKey : privateKey,\n publicKey : publicKey \n })\n \n \n // // Ropsten URL \n let ropstenRPC = 'https://ropsten.infura.io/c7b70fc4ec0e4ca599e99b360894b699'\n \n // Create a Web3 instance with the url. \n var web3js = new web3(new web3.providers.HttpProvider(ropstenRPC));\n \n \n //Stored address on the keychain. \n let stored_address = publicKey;\n \n // Contract ABI’s\n let ABI = require(\"../contracts/MetaToken.json\");\n \n // Contract Ropsten Addresses\n let ADDRESS = \"0x67450c8908e2701abfa6745be3949ad32acf42d8\";\n \n var jsonFile = ABI;\n var abi = jsonFile.abi;\n var deployedAddress = ADDRESS;\n const instance = new web3js.eth.Contract(abi, deployedAddress);\n \n let balance = await instance.methods.balanceOf(stored_address).call()\n let short_balance = web3.utils.fromWei(balance.toString(), 'ether')\n \n //Get the balance for the account. \n web3js.eth.getBalance(stored_address).then((bal) => {\n this.setState({\n eth_balance : bal / 1000000000000000000,\n cusd_balance : short_balance\n })\n })\n \n \n } else {\n \n this.props.navigator.push({\n id : 'CreateAccount'\n })\n }\n } catch (error) {\n \n }\n })()\n \n \n\n }", "async function getEthDetectedBalance(walletId) {\n return new Promise(async (resolve, reject) => {\n let wallet = Wallets.findOne({\n _id: walletId,\n });\n\n let coinType = wallet.coinType;\n\n if (wallet) {\n if (coinType === 'ETH') {\n let web3 = new Web3(new Web3.providers.WebsocketProvider(`${await Config.getPaymeterConnectionDetails('eth', wallet.network)}`));\n\n web3.eth.getBlockNumber(\n Meteor.bindEnvironment((err, latestBlockNumber) => {\n if (!err) {\n web3.eth.getBalance(\n wallet.address,\n 'pending',\n Meteor.bindEnvironment((error, minedBalance) => {\n if (!error) {\n minedBalance = web3.utils.fromWei(minedBalance, 'ether').toString();\n resolve(new BigNumber(minedBalance).toFixed(18).toString());\n } else {\n reject(error.toString());\n }\n })\n );\n } else {\n reject(err.toString());\n }\n })\n );\n }\n }\n });\n}", "get balance() {\n return this._balance;\n }", "async getETHPrice() {\n const response = await fetch('https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd')\n const myJson = await response.json()\n this.setState({ethPrice: myJson.ethereum.usd})\n}", "async function checkBalances () {\n try {\n const state = tlUtil.readState()\n const effTokenBal = lib.getEffectiveTokenBalance(state.bchBalance)\n const realTokenBal = await slp2.getTokenBalance()\n\n wlogger.info(\n `usdPerBCH: ${state.usdPerBCH}, ` +\n `BCH balance: ${state.bchBalance}, ` +\n `Actual token balance: ${realTokenBal}, ` +\n `Effective token balance: ${effTokenBal}`\n )\n } catch (err) {\n wlogger.error('Error in checkBalances(): ', err)\n }\n}", "async loadBlockchainData() {\n const web3 = await window.web3;\n const account = await web3.eth.getAccounts(); // get the account from our blockchain data \n\n this.setState({ account: account[0] });\n console.log(account); // 0x6021e2c50B7Ff151EDb143e60DDf52358a33689B\n\n // set up network ID that we can connect to Tether contract\n const networkID = await web3.eth.net.getId();\n console.log(networkID) // 5777\n\n // load Tether Contract\n const tetherData = Tether.networks[networkID];\n if (tetherData) {\n const tether = new web3.eth.Contract(Tether.abi, tetherData.address) // ABI + Address \n this.setState({ tether });\n // load Tether balance\n let tetherBalance = await tether.methods.balanceOf(this.state.account).call();\n this.setState({ tetherBalance: tetherBalance.toString() }); // set to the state of tether.balance{}\n console.log({balance: tetherBalance}, 'tether balance')\n } else { // if we dont load tether data\n alert('Error! Tether contract data not available. Consider changing to the Ganache network.')\n }\n \n \n // load Reward token Contract\n const rewardData = Reward.networks[networkID];\n if (rewardData) {\n const reward = new web3.eth.Contract(Reward.abi, rewardData.address) // ABI + Address \n this.setState({ reward });\n // load Tether balance\n let rewardBalance = await reward.methods.balanceOf(this.state.account).call();\n this.setState({ rewardBalance: rewardBalance.toString() }); \n console.log({balance: rewardBalance})\n } else { \n alert('Error! Reward contract data not available. Consider changing to the Ganache network.')\n }\n\n // load Decentral Bank Contract\n const decentralBankData = DecentralBank.networks[networkID];\n if (decentralBankData) {\n const decentralBank = new web3.eth.Contract(DecentralBank.abi, decentralBankData.address) \n this.setState({ decentralBank });\n let stakingBalance = await decentralBank.methods.stakingBalance(this.state.account).call();\n this.setState({ stakingBalance: stakingBalance.toString() }); \n console.log({balance: stakingBalance})\n } else { \n alert('Error! Decentral Bank contract data not available. Consider changing to the Ganache network.')\n }\n\n this.setState({loading: false });\n }", "function balanceValue() {\n let targetBal = document.getElementById(`total-balance`);\n let targetValue = parseFloat(targetBal.innerText);\n return targetValue;\n}", "async function tx_info(_net, raw_txid) {\r\n if (_net == \"mainnet\" && raw_txid == \"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b\") {\r\n let res = {\r\n net: _net,\r\n txid: raw_txid,\r\n blockhash: \"000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f\",\r\n blockheight: 0,\r\n timestamp: 1231006505,\r\n size: 204,\r\n weight: 816,\r\n confirmations: await getblockcount(),\r\n input: 0,\r\n output: 50,\r\n preaddress: [\r\n {\r\n value: 0,\r\n address: \"No Inputs (Newly Generated Coins)\"\r\n }\r\n ],\r\n nextaddress: [\r\n {\r\n value: 50,\r\n address: \"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa\"\r\n }\r\n ],\r\n fee: 0\r\n };\r\n // console.log(res)\r\n return res;\r\n } else {\r\n let tx = await getrawtransaction(_net, raw_txid);\r\n if(!tx){\r\n return null;\r\n }else{\r\n let vin = [];\r\n for (i in tx.vin) {\r\n if (!tx.vin[i].coinbase) {\r\n vin.push({\r\n txid: tx.vin[i].txid,\r\n voutNum: tx.vin[i].vout\r\n });\r\n } else {\r\n vin.push({\r\n txid: \"coinbase\",\r\n voutNum: -1\r\n });\r\n }\r\n }\r\n let vout = vout_value_address(tx);\r\n // console.log(vin, '...............vin');\r\n // console.log(vout, '.............vout');\r\n let vout_pre = [];\r\n for (i in vin) {\r\n if (vin[i].txid == \"coinbase\") {\r\n vout_pre.push({\r\n value: 0,\r\n address: \"coinbase\"\r\n });\r\n } else {\r\n if (vin[i].voutNum > -1) {\r\n let tx_pre = await getrawtransaction(_net, vin[i].txid);\r\n vout_pre.push(pre_vout_value_address(tx_pre, vin[i].voutNum));\r\n }\r\n }\r\n }\r\n // console.log(vout_pre, '...........vout_pre');\r\n let res = {\r\n net: _net,\r\n txid: raw_txid,\r\n blockhash: tx.blockhash,\r\n blockheight: 0,\r\n timestamp: tx.time,\r\n size: tx.size,\r\n weight: tx.weight,\r\n confirmations: tx.confirmations,\r\n input: 0,\r\n output: 0,\r\n preaddress: [],\r\n nextaddress: [],\r\n fee: 0\r\n };\r\n res.blockheight = await getBlockHeight(_net, tx.blockhash);\r\n for (i in vout_pre) {\r\n res.preaddress.push(vout_pre[i]);\r\n res.input += vout_pre[i].value;\r\n }\r\n for (i in vout) {\r\n res.nextaddress.push(vout[i]);\r\n res.output += vout[i].value;\r\n }\r\n res.fee = res.input - res.output;\r\n // console.log(res);\r\n return res;\r\n }\r\n }\r\n}", "getBalanceForAddress(addr){\n\n // The minimum ABI to get ERC20 Token balance\n let minABI = [\n // balanceOf\n {\n \"constant\":true,\n \"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"}],\n \"name\":\"balanceOf\",\n \"outputs\":[{\"name\":\"balance\",\"type\":\"uint256\"}],\n \"type\":\"function\"\n },\n // decimals\n {\n \"constant\":true,\n \"inputs\":[],\n \"name\":\"decimals\",\n \"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}],\n \"type\":\"function\"\n }\n ];\n\n // Get ERC20 Token contract instance\n let contract = this.injectedWeb3.eth.contract(minABI).at(addr);\n let promise = new Promise((resolve, reject) => {\n // Call balanceOf function\n try {\n contract.balanceOf(this.address, (error, balance) => {\n if (error){\n console.error(error)\n reject(0)\n }\n // Get decimals\n contract.decimals((error, decimals) => {\n if (error){\n console.error(error)\n reject(0)\n }\n\n // calculate a balance\n balance = balance.div(10 ** decimals).toNumber();\n resolve(balance);\n });\n });\n } catch(e){\n console.error(e);\n reject(0)\n }\n });\n\n\n return promise;\n }", "function getBalance (account) {\n return account.balance;\n}", "async getTotalBalance(currency, walletId, isColdWallet = true) {\n let totalBalance = \"\";\n isColdWallet = isColdWallet === \"true\";\n try {\n const wallet = await this.wallets.find(walletId);\n let address = \"\";\n if (!isColdWallet) {\n address = wallet.settlementAddress;\n } else {\n address = wallet.coldSettlementAddress;\n }\n const balance = await this.api.getBalance(address);\n totalBalance = this.web3.utils.fromWei(balance, \"gwei\");\n } catch (err) {\n console.log(\"ETH.getTotalBalance.err:\", err);\n totalBalance = \"0\";\n }\n console.log(\"ETH.totalBalance:\", totalBalance);\n return { currency, totalBalance };\n }", "async fetchCoinbasePro(coin, element) {\n const URL = `https://api.pro.coinbase.com/products/${coin}-USD/ticker`;\n let price = await fetch(URL)\n .then((blob) => blob.json())\n .then((data) => {\n return data.price;\n })\n .catch((error) => {\n console.error(\"Error with the CoinbasePro fetch operation\", error);\n this.setPrice(\"\", element, \"CoinbasePro\");\n return \"\";\n });\n return parseFloat(price);\n }", "async function getBalance(address) {\n const nfToken = await NFTokenMetadata.at(await getContractAddress('NFTokenMetadata'));\n return nfToken.balanceOf.call(address);\n}", "async function _TB(_token, _holder) {\n return new Promise(async (resolve, reject) =>{\n return resolve((await _token.balanceOf.call(_holder)).toNumber());\n })\n}", "balance (options) {\n var args = ['balance', '--flat', '--format', Ledger.formatBalance()]\n\n options = options || {}\n if (options.collapse) {\n args.push('--collapse')\n }\n\n if (options.market) {\n args.push('--market')\n }\n\n if (options.depth) {\n args.push('--depth')\n args.push(options.depth)\n }\n\n if (options.query) {\n args.push(options.query)\n }\n var p = this.withLedgerFile(this.cli).exec(args)\n var account = new Account(null)\n var amtQueue = []\n\n return new Promise((resolve, reject) => {\n p.then(pro => {\n highland(pro)\n .split()\n .each(s => {\n if (typeof s === 'string' && s.length > 0) {\n if (!s.startsWith('\"')) { s = `\"${s}` }\n if (!s.endsWith('\"')) { s = `${s}\"` }\n var data = Papa.parse(s).data\n data.forEach(line => {\n if (line.length === 1) { amtQueue.push(line) }\n if (line.length > 1) {\n var bal = new Balance({})\n bal = bal.add(Ledger.parseCommodity(line[0]))\n account._add(bal, line[1].split(':'))\n if (amtQueue.length > 0) {\n amtQueue.forEach(amt => {\n bal = new Balance({})\n bal = bal.add(Ledger.parseCommodity(amt))\n account._add(bal, line[1].split(':'))\n })\n amtQueue = []\n }\n } else return highland.nil\n })\n } else {\n resolve(account)\n return highland.nil\n }\n })\n })\n })\n }", "async function GetBalance(id)\r\n{\r\n\t// Finding user's balance in the bank\r\n\tconst Balance = await Bank.findOne({ where: { UID: id } });\r\n\r\n\tif (Balance) // If there is one\r\n\t{\r\n\t\treturn Balance.units; // Return the amount of Units\r\n\t}\r\n\telse // If the user doesn't own a bank balance yet\r\n\t{\r\n\t\tawait Bank.create( // Create one\r\n\t\t\t{\r\n\t\t\t\tUID: id,\r\n\t\t\t\tunits: 0\r\n\t\t\t});\r\n\t\treturn 0;\r\n\t}\r\n}", "getCoinRate(callback){\n const api_data = {\n api_name:'/get-coin-rate',\n coin:this.coin\n };\n api_call.apiGetCall(api_data,callback);\n }", "async function loadBalance(GCI, address) {\n let client = await lotion.connect(GCI)\n accounts = client.state.accounts\n return await accounts[address]['balance']\n }", "async function getBlockHashProfit(_net, hash) {\r\n let block = await getblock(_net, hash);\r\n let tx = await getrawtransaction(_net, block.tx[0]);\r\n // console.log(tx.vout[0].value,'.................block profit')\r\n return tx.vout[0].value;\r\n}", "function balanceTotal(){\n var request = new XMLHttpRequest();\n\n request.open('POST', 'https://blockchain.info/merchant/(key)/balance');\n\n request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n\n request.onreadystatechange = function () {\n if (this.readyState === 4) {\n console.log('Status:', this.status);\n console.log('Headers:', this.getAllResponseHeaders());\n console.log('Body:', this.responseText);\n }\n };\n\n var body = \"password=(password)\";\n\n var totalDict = request.send(body);\n return totalDict[\"balance\"];\n}", "async function getExpectedRate() {\n\n let result = await kyberNetworkProxyContract.methods.getExpectedRate(\n addressToSell,\n addressToBuy,\n srcQuantity\n ).call()\n\n expectedRate = result.expectedRate\n slippageRate = result.slippageRate\n // Display Exchange Rate\n displayExchangeRate();\n}", "async callContract(){\n async (address) => {\n try{\n let balance = await contract.balanceOf(address);\n return (balance.toNumber()).toString();\n }catch (error) {\n console.log(error);\n return false;\n }\n }\n }", "async function getBalance(req, res) {\n var address = req.query.address\n if (address) {\n // get the Ether balance of the given address\n var ethBalance = convertWeiToEth( await web3.eth.getBalance(address)) || '0'\n// get the token balance of the given address\n var tokenBalance = await getContract().methods.balances(address).call() || '0'\n// response data back to requestor\n return res.send({\n 'Ether Balance': ethBalance,\n 'Token Balance': tokenBalance\n })\n } \n}", "balance(){\nlet sum = 0\nfor (let i=0; i < this.transactions.length; i++) {\n sum = sum + this.transactions[i].amount;\n} return sum\n }", "function getBalance() {\n return parseInt(document.querySelector('.count-balance').outerText)\n}", "async function test(){\n\t\t\tvar value = [75, 87, 72];\n\t\t\tawait newContractInstance.methods.enter().send({\n \t\t\tfrom: accounts[2],\n\t\t\tvalue: value[0]\n \t \t\t});\n\n\t\t\tawait newContractInstance.methods.enter().send({\n \t\t\tfrom: accounts[1],\n\t\t\tvalue: value[1]\n \t\t\t});\n \n\t\t await newContractInstance.methods.enter().send({\n \t\t\tfrom: accounts[4],\n\t\t\tvalue: value[2]\n \t\t\t});\n \t\t\t\n\t\t\tvar highestBidder = await newContractInstance.methods.pickHighestBidder().call({\n \t\t\tfrom: accounts[2]\n \t\t\t});\n\t\t\n\t\t\tconsole.log('The property bids(in lakhs) are:');\n\t\t\tconsole.log('Bidder 1: '+ value[0] + '\\n'); \t\n\t\t\tconsole.log('Bidder 2: '+ value[1] + '\\n');\n\t\t\tconsole.log('Bidder 3: '+ value[2] + '\\n');\n\t\t\tconsole.log('The Highest Bidder is: Bidder Number at index '+ highestBidder);\n\t\t}", "async function fetchDifficultyHash(){\n console.log(\"BlockNumberHex - \",blockNumberHex);\n apiBlock = \"https://api.etherscan.io/api?module=proxy&action=eth_getBlockByNumber&tag=\"+ blockNumberHex +\"&boolean=true\"+ apiKey;\n try{\n const response_Block = await fetch(apiBlock);\n const json_Block = await response_Block.json();\n // console.log(json_Block);\n var difficulty = parseInt(json_Block.result.difficulty,16)/10**12;\n console.log(\"Difficulty - \"+difficulty);\n $(\"#networkDifficulty\").text(difficulty.toFixed(2)+\" TH\");\n var hashRate = difficulty / 15 * 1000;\n $(\"#hashRate\").text(hashRate.toFixed(2)+\" GH/s\");\n var transactionNum = json_Block.result.transactions.length;\n // console.log(transactionNum);\n $(\"#transactions\").text(transactionNum);\n }catch{\n // Try next time\n }\n}", "async getTokenBalance(contractAddress, address) {\n\t\tconst tokenContract = new this.web3Service.web3.eth.Contract(\n\t\t\tthis.contractABI,\n\t\t\tcontractAddress\n\t\t);\n\t\tconst balanceWei = await tokenContract.methods.balanceOf(address).call();\n\t\tconst decimals = await tokenContract.methods.decimals().call();\n\t\treturn EthUtils.getBalanceDecimal(balanceWei, decimals);\n\t}", "async loadBlockchainData() {\n this.setState({loading: true})\n let web3\n \n //Check if the user has Metamask\n if(typeof window.ethereum !== 'undefined') {\n web3 = new Web3(window.ethereum)\n await this.setState({web3})\n await this.loadAccountData()\n } else {\n web3 = new Web3(new Web3.providers.HttpProvider(`https://ropsten.infura.io/v3/${process.env.REACT_APP_INFURA_API_KEY}`))\n await this.setState({web3})\n }\n await this.loadContractData()\n await this.loadPoolData()\n this.setState({loading: false})\n //Update interest every 5 seconds\n var self = this\n var intervalId = window.setInterval(async function(){\n let poolBalanceUnderlying, poolETHDeposited, poolInterest\n poolBalanceUnderlying = await self.state.cETHContract.methods.balanceOfUnderlying(self.state.poolContractAddress).call()\n poolETHDeposited = await self.state.poolContract.methods.ethDeposited().call()\n poolInterest = poolBalanceUnderlying - poolETHDeposited\n await self.setState({poolInterest})\n self.getETHPrice()\n }, 10000);\n }", "async getUserBalance(user) { \n const wallet = Wallet.fromHdPrivateKey(user.xprivkey);\n var newUser = wallet.getBalance().then(balance => {\n user.balance = balance;\n return user;\n })\n return newUser;\n }", "async function getBalance(address) {\n const nfTokenShield = shield[address] ? shield[address] : await NFTokenShield.deployed();\n const nfToken = await NFTokenMetadata.at(await nfTokenShield.getNFToken.call());\n return nfToken.balanceOf.call(address);\n}", "balance() {\n this.log('balance')\n\n if (this.balanceId != null) {\n clearTimeout(this.balanceId)\n this.balanceId = null\n }\n\n const max = this.maxConnectionsRdy()\n const perConnectionMax = Math.floor(max / this.connections.length)\n\n // Low RDY and try conditions\n if (perConnectionMax === 0) {\n /**\n * Backoff on all connections. In-flight messages from\n * connections will still be processed.\n */\n this.connections.forEach((conn) => conn.backoff())\n\n // Distribute available RDY count to the connections next in line.\n this.roundRobinConnections.next(max - this.inFlight()).forEach((conn) => {\n conn.setConnectionRdyMax(1)\n conn.bump()\n })\n\n // Rebalance periodically. Needed when no messages are received.\n this.balanceId = setTimeout(() => {\n this.balance()\n }, this.lowRdyTimeout)\n } else {\n let rdyRemainder = this.maxInFlight % this.connections.length\n this.connections.forEach((c) => {\n let connMax = perConnectionMax\n\n /**\n * Distribute the remainder RDY count evenly between the first\n * n connections.\n */\n if (rdyRemainder > 0) {\n connMax += 1\n rdyRemainder -= 1\n }\n\n c.setConnectionRdyMax(connMax)\n c.bump()\n })\n }\n }", "async getTokenBalanceAtAddress(token_contract_address, address) {\n const erc20Contract = new ERC20Contract(this.client, token_contract_address);\n let p_token_balance = erc20Contract.balanceOf(address).call();\n let p_decimals = erc20Contract.decimals().call();\n return Promise.all([p_token_balance, p_decimals]).then(async (data) => {\n const totalBalance = data[0];\n const decimals = data[1];\n return totalBalance / 10 ** decimals;\n });\n\n }", "calculateBalance(blockchain){\n \n // store the existing balance\n let balance = this.balance;\n\n // create an array of transactions\n let transactions = [];\n\n // store all the transactions in the array\n blockchain.chain.forEach(block => block.data.forEach(transaction =>{\n transactions.push(transaction);\n }));\n\n // get all the transactions generated by the wallet ie money sent by the wallet\n const walletInputTransactions = transactions.filter(transaction => transaction.input.address === this.publicKey);\n\n // declare a variable to save the timestamp\n let startTime = 0;\n\n if(walletInputTransactions.length > 0){\n\n // get the latest transaction\n const recentInputTransaction = walletInputTransactions.reduce((prev,current)=> prev.input.timestamp > current.input.timestamp ? prev : current );\n \n // get the outputs of that transactions, its amount will be the money that we would get back\n balance = recentInputTransaction.outputs.find(output => output.address === this.publicKey).amount\n\n // save the timestamp of the latest transaction made by the wallet\n startTime = recentInputTransaction.input.timestamp\n }\n\n // get the transactions that were addressed to this wallet ie somebody sent some moeny\n // and add its ouputs.\n // since we save the timestamp we would only add the outputs of the transactions recieved\n // only after the latest transactions made by us\n\n transactions.forEach(transaction =>{\n if(transaction.input.timestamp > startTime){\n transaction.outputs.find(output=>{\n if(output.address === this.publicKey){\n balance += output.amount;\n }\n })\n }\n })\n return balance;\n\n }", "async on_get_active_balance(msg) {\n let data = msg.data;\n let res = await this.db.get_balance_all(data.id);\n return res;\n }", "function getCurrentBalance(){\n const balance = document.getElementById(\"balance\")\n let currentBalance = balance.innerText\n let parsingCurrentBalance = parseFloat(currentBalance)\n\n return parsingCurrentBalance\n}", "sendTotalAdjustCoinChange(coin) {\n var send_amount = this.state.send_amount;\n var send_total = parseFloat(send_amount);\n\n //if this.state.average_fee > 0 send_fee == fast. Set active fee selection fastest.\n if (coin === 'safex') {\n get_utxos(this.state.send_public_key)\n .then(utxos => {\n const rawtx = generateSafexBtcTransaction(\n utxos,\n BURN_ADDRESS,\n this.state.send_private_key,\n 1,\n this.state.average_fee * 100000000\n );\n this.setState({\n send_amount: 1,\n send_total: 1,\n send_fee: (parseFloat(rawtx.fee / 100000000) + 0.00000700).toFixed(8),\n });\n }).catch(err => {\n console.log(\"generate safex transaction error\" + err);\n this.openMainAlertPopup(\"Safex Transaction Error; You may have a 0 balance \\n\" + err);\n })\n .catch(err => {\n console.log(\"error getting UTXOs \" + err);\n this.openMainAlertPopup(\"error getting UTXOs; You may have a connectivity issue \" + err);\n });\n } else {\n get_utxos(this.state.send_public_key)\n .then(utxos => {\n const rawtx = generate_btc_transaction(\n utxos,\n BURN_ADDRESS,\n this.state.send_private_key,\n 0.00000001.toFixed(8),\n this.state.average_fee * 100000000\n );\n this.setState({\n send_amount: 0.00000001.toFixed(8),\n send_fee: parseFloat(rawtx.fee / 100000000).toFixed(8),\n send_total: parseFloat(parseFloat(0.00000001) + parseFloat(rawtx.fee / 100000000)).toFixed(8)\n });\n }).catch(err => {\n console.log(\"generate btc transaction error you might have no money \" + err);\n this.openMainAlertPopup(\"BTC Transaction Error; You may have a 0 balance \\n\" + err);\n })\n .catch(err => {\n console.log(\"error getting UTXOs \" + err);\n this.openMainAlertPopup(\"error getting UTXOs; You may have a connectivity issue \" + err);\n });\n }\n }", "function Binance(){\n var Full_Binance_Balance = [];\n Full_Binance_Balance=AddBalance(Full_Binance_Balance, BinanceSpot());\n Full_Binance_Balance=AddBalance(Full_Binance_Balance, BinanceEarn());\n Full_Binance_Balance=AddBalance(Full_Binance_Balance, BinanceCrossMargin());\n Full_Binance_Balance=AddBalance(Full_Binance_Balance, BinanceIsolatedMargin());\n Full_Binance_Balance=AddBalance(Full_Binance_Balance, BinanceFutures());\n Full_Binance_Balance=AddBalance(Full_Binance_Balance, BinanceCollateral());\n return Full_Binance_Balance;\n}", "checkBalance() {\n return this.balance;\n }" ]
[ "0.74293727", "0.7396473", "0.7341274", "0.7198438", "0.71622384", "0.71339095", "0.70615524", "0.7039908", "0.70301795", "0.6927544", "0.6866696", "0.68604755", "0.68266636", "0.67492956", "0.6720872", "0.6669353", "0.6627617", "0.6614965", "0.6611551", "0.65928966", "0.6552752", "0.6549489", "0.6529131", "0.6483482", "0.6469799", "0.6462768", "0.6457182", "0.6436943", "0.6428762", "0.64162827", "0.6412164", "0.6410898", "0.6403106", "0.63354534", "0.6316597", "0.6302444", "0.6295471", "0.628943", "0.62744236", "0.6265505", "0.62627625", "0.62568074", "0.62417495", "0.6229966", "0.6216077", "0.6205967", "0.61908656", "0.61670536", "0.6115494", "0.6115081", "0.6112631", "0.6098216", "0.6086381", "0.6077531", "0.60662067", "0.60653794", "0.60650253", "0.60631484", "0.606301", "0.6057507", "0.6056154", "0.6043615", "0.59934425", "0.5992696", "0.5992275", "0.5992204", "0.5989258", "0.5980472", "0.59768707", "0.59767324", "0.59731925", "0.5966236", "0.5955387", "0.5955374", "0.59520614", "0.5942458", "0.5940731", "0.5933655", "0.59162575", "0.59088904", "0.5908085", "0.59073997", "0.5905938", "0.5899378", "0.589697", "0.58943677", "0.5889126", "0.58794916", "0.5869475", "0.5860279", "0.5851429", "0.5840163", "0.58389086", "0.5836934", "0.583313", "0.5825278", "0.58076984", "0.5805977", "0.58058935", "0.58049375" ]
0.60432965
62
`await` this to pause until the block height has increased. (currently this queries the block height in 1000msec intervals)
get nextBlock () { return this.API.getBlock().then(({header:{height}})=>new Promise(async resolve=>{ while (true) { await new Promise(ok=>setTimeout(ok, 1000)) const now = await this.API.getBlock() if (now.header.height > height) { resolve() break } } })) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function waitForNewBlock(height, cb) {\n var actualHeight = height;\n async.doWhilst(\n function (cb) {\n request({\n type: 'GET',\n url: baseUrl + '/api/blocks/getHeight',\n json: true\n }, function (err, resp, body) {\n if (err || resp.statusCode != 200) {\n return cb(err || 'Got incorrect status');\n }\n\n if (height + 1 == body.height) {\n height = body.height;\n }\n\n setTimeout(cb, 1000);\n });\n },\n function () {\n return actualHeight == height;\n },\n function (err) {\n if (err) {\n return setImmediate(cb, err);\n } else {\n return setImmediate(cb, null, height);\n }\n }\n )\n}", "async getBlockHeight() {\n // Add your code here\n let blockCount = await this.bd.getBlocksCount();\n return blockCount -1;\n }", "async getNextBlockHeight(){\n try{\n const blocksCount = await this.bd.getBlocksCount();\n return blocksCount;\n } catch (err) {\n console.log(err);\n }\n }", "async checkForNewBlock() {\n try {\n const blockHeight = await this.polkadotAPI.getBlockHeight()\n\n // if we get a newer block then expected query for all the outstanding blocks\n while (blockHeight > this.height) {\n this.height = this.height ? this.height++ : blockHeight\n this.newBlockHandler(this.height)\n\n // we are safe, that the chain produced a block so it didn't hang up\n if (this.chainHangup) clearTimeout(this.chainHangup)\n }\n } catch (error) {\n console.error('Failed to check for a new block', error)\n Sentry.captureException(error)\n }\n }", "async getBlockHeight () {\n return await this.getBlockHeightLevel()\n }", "function getTenBlocksAfterHeight() {\r\n let blq = blocknumber.value;\r\n if (blq == \"\" || isNaN(blq)) {\r\n blocknumber.focus();\r\n blocknumber.value = \"\";\r\n return false;\r\n }\r\n let blqnum = parseInt(blq);\r\n let data = {\r\n \"height\": blqnum\r\n };\r\n _doPost('/local/chain/blocks-after', data);\r\n }", "getBlockHeight() {\n let self = this;\n return new Promise(function(resolve, reject) {\n self.levelDBWrapper.getBlocksCount().then((count) => {\n let height = count - 1;\n // height will be one less than the count of blocks\n resolve(height);\n }).catch((err) => {\n reject(err);\n });\n }); \n }", "async getBlockHeight() {\n\t\treturn await this.bd.getBlocksCount();\n\t}", "getBlockHeight() {\n return Promise.resolve(-1);\n }", "function theLoop(i) {\r\n setTimeout(function () {\r\n let blockTest = new Block.Block(\"Test Block - \" + (i + 1));\r\n blockchain.addBlock(blockTest)\r\n .then((height) => {\r\n console.log('theLoop | block height:', height);\r\n i++;\r\n if (i < 10) theLoop(i);\r\n });\r\n }, 1 * 1000);\r\n}", "async getBlockHeight() {\n\t\treturn await chaindb.getBlockHeight().then((height) => { return height; }).catch(error => { throw error; });\n\t}", "getBlockHeight() {\n\n let self = this;\n return new Promise((resolve, reject) => {\n self.bd.getBlocksCount().then((count) => {\n resolve(parseInt(count));\n }).catch((err) => {\n console.log(err);\n reject(err)\n });\n });\n }", "getBlockHeight() {\n let self = this;\n return new Promise(function(resolve, reject) {\n self.bd.getBlocksCount().then( (count)=> {\n // console.log(count)\n resolve(count)\n })\n });\n }", "async getBlockHeight() {\n // Add your code here\n try{\n let blockCount = await this.getNextBlockHeight();\n return(blockCount-1) // excluding genesis block\n } catch(err) {\n //console.log(err);\n reject(err);\n }\n }", "getHeight() {\n return __awaiter(this, void 0, void 0, function* () {\n return yield this.request(\"get_height\", {});\n });\n }", "getBlockHeight() {\n return new Promise((resolve, reject) => {\n this.bd.getBlocksCount()\n .then((response) => {\n resolve(response - 1);\n })\n .catch((error) => {\n reject(error);\n });\n });\n }", "async function waitForBlock(num) {\n while (web3.eth.blockNumber < +num) {\n await new Promise(r => setTimeout(r, 200));\n }\n}", "updateHeight(height, animated) {\n return __awaiter(this, void 0, void 0, function* () {\n if (animated) {\n this.outerElement.classList.add('animate-height');\n yield utils_1.sleep(10);\n }\n this.outerElement.style.height = `${height}px`;\n if (animated) {\n yield utils_1.sleep(200);\n this.outerElement.classList.remove('animate-height');\n yield utils_1.sleep(10);\n }\n });\n }", "_updateHeight () {\n const height = document.body.scrollHeight\n if (height === this._lastHeight) {\n return\n }\n \n this._lastHeight = height\n this._sendMessage('height', { height: height })\n }", "function currentBlock() {\r\n _doGet('/chain/height');\r\n }", "async getBlock(height) {\n // Add your code here\n return await this.bd.getLevelDBData(height);\n }", "async function waitBlock() {\n while (true) {\n let receipt = web3.eth.getTransactionReceipt(contract.transactionHash);\n if (receipt && receipt.contractAddress) {\n console.log(\"Your contract has been deployed at address: \" + receipt.contractAddress);\n console.log(\"Note that it might take 30 - 90 sceonds for the block to propagate befor it's visible\");\n return new Promise(resolve => receipt.contractAddress);\n }\n console.log(\"Waiting a mined block to include your contract... currently in block \" + web3.eth.blockNumber);\n await sleep(4000);\n }\n }", "async getBlockHeight () {\n return this.chainStore.countNumEntries()\n }", "getBlockHeight() {\n let self = this;\n return new Promise((resolve, reject) => {\n self.bd\n .getBlocksCount()\n .then(height => {\n heightOfTheChain = height;\n resolve(height);\n })\n .catch(err => {\n console.log(err);\n reject(err);\n });\n });\n }", "function checkBlock() {\n\t\n\t// get/update block time and duration in seconds\n\tvar count = JSON.parse(localStorage[\"blockCount\"]);\n\tcount += UPDATE_SECONDS;\n\t\n\tvar blockDur = localStorage[\"blockDuration\"];\n\tblockDur = blockDur * 3600;\n\tconsole.log(count + \" seconds of \" + blockDur + \" second sentence served\");\n\t// remove block if duration exceeded\n\tif (count >= blockDur) {\n \tlocalStorage[\"blockVar\"] = \"false\";\n \tlocalStorage[\"target\"] = 0;\n \tlocalStorage[\"blockCount\"] = 0;\n \t\tconsole.log(\"you did great. the block is coming down\");\n\t}\n\telse {\n\t\tlocalStorage[\"blockCount\"] = count;\n\t}\n}", "async checkForLatestBlock () {\n await this._updateLatestBlock()\n return await this.getLatestBlock()\n }", "getBlockHeightLevel () {\n return new Promise((resolve, reject) => {\n let height = -1\n db.createReadStream()\n .on('data', () => {\n height++\n })\n .on('error', err => {\n console.log('Unable to read data stream!', err)\n reject(err)\n })\n .on('close', () => {\n // console.log('Blockchain height is #' + height) // DEBUG\n resolve(height)\n })\n })\n }", "function getBlock() {\r\n let blq = blocknumber.value;\r\n if (blq == \"\" || isNaN(blq)) {\r\n blocknumber.focus();\r\n blocknumber.value = \"\";\r\n\r\n return false;\r\n }\r\n let blqnum = parseInt(blq);\r\n let data = {\r\n \"height\": blqnum\r\n };\r\n _doPost('/block/at/public', data);\r\n }", "getLatestBlock() {\n return __awaiter(this, void 0, void 0, function* () {\n return this.ksnDriver.getLatestBlock();\n });\n }", "async function waitBlock() {\n while (true) {\n let receipt = web3.eth.getTransactionReceipt(contract.transactionHash);\n if (receipt && receipt.contractAddress) {\n console.log(\"Contract is deployed at contract address: \" + receipt.contractAddress);\n console.log(\"It might take 30-90 seconds for the block to propagate before it's visible in etherscan.io\");\n break;\n }\n console.log(\"Waiting for a miner to include the transaction in a block. Current block: \" + web3.eth.blockNumber);\n await sleep(4000);\n }\n}", "getBlockHeight() {\n return this.db.getBlocksCount();\n }", "wait(seconds = 20, blocks = 1) {\n return new Promise(resolve => {\n return this.web3.eth.getBlock(\"latest\", (e, {number}) => {\n resolve(blocks + number)\n })\n }).then(targetBlock => {\n return this.waitUntilBlock(seconds, targetBlock)\n })\n }", "getHeight() {\n return new Promise(function(resolve, reject) {\n db.getBlocksCount().then((result) => {\n resolve(result);\n }).catch(function(err) {\n reject(err);\n });\n });\n }", "function checkHeightAndReturn() {\n const iframe = d3Select(this.root).selectAll('iframe');\n lastHeight = height;\n height = parseInt(iframe.node().style.height.replace(\"px\", \"\"));\n if(height > 0 && heightStableSince > 3) {\n this.props.onLoadSuccess(height, this.props.item);\n window.clearInterval(this.heightCheckInterval);\n }\n\n if(height === lastHeight) \n heightStableSince += 1;\n else\n heightStableSince = 0;\n }", "getHeight() {\n return this._executeAfterInitialWait(() => this.currently.getHeight());\n }", "_modifyBlock(height, block) {\n let self = this;\n return new Promise( (resolve, reject) => {\n block.body = 'tampered';\n self.bd.addLevelDBData(height, JSON.stringify(block).toString()).then((blockModified) => {\n resolve(blockModified);\n }).catch((err) => { console.log(err); reject(err)});\n });\n }", "function doubleCheckHeight(){\r\n for(var i = 1; i < 4; i++){\r\n g_doubleCheckHeightId = setTimeout(adjustToNewViewport, 350 * i);\r\n }\r\n }", "function doubleCheckHeight(){\n for(var i = 1; i < 4; i++){\n g_doubleCheckHeightId = setTimeout(adjustToNewViewport, 350 * i);\n }\n }", "function doubleCheckHeight(){\n for(var i = 1; i < 4; i++){\n g_doubleCheckHeightId = setTimeout(adjustToNewViewport, 350 * i);\n }\n }", "function doubleCheckHeight(){\n for(var i = 1; i < 4; i++){\n g_doubleCheckHeightId = setTimeout(adjustToNewViewport, 350 * i);\n }\n }", "async getBlock(height) {\n try {\n return await this.bd.getLevelDBData(height);\n } catch (err) {\n console.log(err);\n }\n }", "blockFor(time) {\n var now = performance.now();\n while (performance.now() - now < time);\n }", "function GetEraBlockHeight(current_window) \r\n\t{\r\n\t\tif (current_window.era_rc != null && current_window.era_rc[\"Height\"] != null) \r\n\t\t{\r\n\t\t\t\treturn GetStringWithQuotes(current_window.era_rc[\"Height\"]);\r\n\t\t} \r\n\t\t\r\n\t\treturn GetStringWithQuotes(500);\r\n\t}", "_modifyBlock(height, block) {\n let self = this;\n return new Promise( (resolve, reject) => {\n self.levelDBWrapper.addLevelDBData(height, block).then((blockModified) => {\n resolve(blockModified);\n }).catch((err) => { console.log(err); reject(err)});\n });\n }", "async validateBlock(height) {\n // Add your code here\n let self = this;\n const block = await this.getBlock(height);\n const newBlock = {...block};\n newBlock.hash = '';\n newBlock.hash = SHA256(JSON.stringify(newBlock)).toString();\n return await (block.hash === newBlock.hash);\n }", "async getBlock (height) {\n const json = await this.chainStore.get(height)\n if (this.logLevel >= 2) console.log('block data for ' + height + ': ' + json)\n return JSON.parse(json)\n }", "async updateBlocks () {\n debug('\\t📯 Page DOM changed…')\n\n // Create new blocks\n this.blockElements = this.rootElement.querySelectorAll(`.${this.getService('Config').pageBlockClass}`)\n this.blockLength = this.blockElements.length\n\n for (let blockIndex = 0; blockIndex < this.blockLength; blockIndex++) {\n let blockElement = this.blockElements[blockIndex]\n const existingBlock = this.getBlockById(blockElement.id)\n\n if (!blockElement.id) break\n\n if (existingBlock === null) {\n try {\n let block = await this.initSingleBlock(this.blockElements[blockIndex])\n\n if (block) {\n this.blocks.push(block)\n block.onPageReady()\n }\n } catch (e) {\n warn(e.message)\n }\n }\n }\n }", "function growingPlant(upSpeed, downSpeed, desiredHeight) {\n let initHeight = 0;\n let days = 0;\n while (initHeight < desiredHeight) {\n console.log(initHeight);\n initHeight += upSpeed;\n\n if (initHeight < desiredHeight) {\n initHeight -= downSpeed;\n }\n\n days++;\n }\n return days;\n}", "async _modifyBlock (height, block) {\n let self = this\n return new Promise((resolve, reject) => {\n self.chainStore.addLevelDBData(height, JSON.stringify(block))\n .then((blockModified) => {\n resolve(blockModified)\n }).catch((err) => { console.log(err); reject(err) })\n })\n }", "function doubleCheckHeight() {\n for (var i = 1; i < 4; i++) {\n g_doubleCheckHeightId = setTimeout(adjustToNewViewport, 350 * i);\n }\n }", "get fundedBlockHeight() {\n let height = 0;\n\n const models = this.paymentsIn\n .filter(payment => {\n const paymentHeight = payment.get('height');\n return typeof paymentHeight === 'number' && paymentHeight > 0;\n })\n .sort((a, b) => (a.get('height') - b.get('height')));\n\n _.every(models, (payment, pIndex) => {\n const transactions = new Transactions(\n models.slice(0, pIndex + 1),\n { paymentCoin: this.paymentCoin }\n );\n if (this.getBalanceRemaining(transactions) <= 0) {\n height = payment.get('height');\n return false;\n }\n\n return true;\n });\n\n return height;\n }", "async function fetchBlock(blockHeight) {\n let response = await fetch(`https://blockchain.info/block-height/${blockHeight}?format=json`);\n let data = await response.json();\n return data; \n}", "_modifyBlock(height, block) {\n let self = this;\n return new Promise( (resolve, reject) => {\n self.bd.addLevelDBData(height, JSON.stringify(block).toString()).then((blockModified) => {\n resolve(blockModified);\n }).catch((err) => { console.log(err); reject(err)});\n });\n }", "_modifyBlock(height, block) {\n let self = this;\n return new Promise( (resolve, reject) => {\n self.bd.addLevelDBData(height, JSON.stringify(block).toString()).then((blockModified) => {\n resolve(blockModified);\n }).catch((err) => { console.log(err); reject(err)});\n });\n }", "_modifyBlock(height, block) {\n let self = this;\n return new Promise( (resolve, reject) => {\n self.bd.addLevelDBData(height, JSON.stringify(block).toString()).then((blockModified) => {\n resolve(blockModified);\n }).catch((err) => { console.log(err); reject(err)});\n });\n }", "function getBlockchainHeight() {\n let height = -1;\n return new Promise(function(resolve, reject) {\n db.createReadStream()\n .on('data', function (data) {\n // count each object inserted\n height = height + 1\n })\n .on('error', function (err) {\n // reject with error\n console.log('Oh my!', err)\n })\n .on('close', function () {\n // resolve with the count value\n // console.log('getBlockchainHeight() invoked. The block height is ', height)\n resolve(height)\n });\n });\n}", "getBlockHeight() {\n // Add your code here\n return this.chain.length-1;\n }", "connectBlocks() {\n return __awaiter(this, void 0, void 0, function* () {\n while (true) {\n try {\n // Skip processing. Finally block will retry\n if (!this.processConnectBlocks) {\n continue;\n }\n let blockhash = null;\n try {\n blockhash = yield this.getBlockhashByHeight(this.nextHeight());\n if (this.debug) {\n console.log('connectBlocks blockhash', blockhash);\n }\n }\n catch (ex) {\n if (ex && ex.response && ex.response.status === 404) {\n }\n else {\n this.triggerError(ex);\n }\n }\n let foundBlock = false;\n if (blockhash) {\n yield axios.get(this.getBlockUrl(blockhash)).then((response) => __awaiter(this, void 0, void 0, function* () {\n this.triggerBlock(response.data);\n foundBlock = true;\n yield this.incrementNextHeight();\n })).catch((ex) => {\n // 404 means we reached the tip.\n // Todo: Add re-org protection later by tracking the last N blockhashes\n if (ex && ex.response && ex.response.status === 404) {\n return;\n }\n this.triggerError(ex);\n });\n }\n if (!blockhash || !foundBlock) {\n if (this.debug) {\n console.log('Next block not found. Sleeping....');\n }\n }\n }\n finally {\n yield this.sleep(10);\n }\n }\n });\n }", "getBlockHeight() {\n return new Promise((resolve, reject) => {\n let count = 0;\n db.createKeyStream()\n .on(\"data\", () => count++)\n .on(\"error\", (err) => reject(console.log(\"Unable to read data stream!\", err)))\n .on(\"close\", () => resolve((count > 0) ? count - 1: 0));\n });\n }", "_modifyBlock(height, block) {\n return new Promise((resolve, reject) => {\n this.bd.addLevelDBData(height, JSON.stringify(block).toString()).then((blockModified) => {\n resolve(blockModified);\n }).catch((error) => {\n console.error(error);\n reject(error);\n });\n });\n }", "getBlockHeight() {\n let i=0;\n let self = this;\n return new Promise(function(resolve,reject) {\n self.chain.createReadStream()\n .on('data',function(data) {\n i++;\n }).on('end',function() {\n if (i > 0) {\n i--;\n }\n resolve(i);\n }).on('error',function(error) {\n console.log(error)\n reject(error);\n });\n });\n }", "demoBlocks() {\n const self = this;\n\n function myFunction() {\n self.generateNextBlock();\n const rand = Math.round(Math.random() * 2000) + 1000; // 1000-3000ms interval.\n setTimeout(myFunction, rand);\n }\n\n setTimeout(myFunction, 1000);\n }", "_setHeight() {\n return new Promise((resolve) => {\n this.dom.overhead = 2;\n if (this.config.hasHeader)\n this.dom.overhead += 38;\n if (this.config.hasFilterRow)\n this.dom.overhead += 49;\n if (this.config.hasLabelRow)\n this.dom.overhead += 45;\n if (!this.config.height)\n this.config.height = PopTemplate.getContentHeight(false, 270);\n let tabColumnHeight = this.dom.repo.getComponentHeight('PopEntityTabColumnComponent', this.position);\n if (!tabColumnHeight)\n tabColumnHeight = this.dom.repo.getComponentHeight('PopTabMenuComponent', 1);\n if (tabColumnHeight && tabColumnHeight.inner) {\n this.dom.height.default = tabColumnHeight.inner - 20;\n }\n else {\n this.dom.height.default = PopTemplate.getContentHeight(false, this.dom.overhead);\n }\n if (this.config.parentClassName) {\n this.dom.overhead = this.dom.overhead + (Math.abs(this.el.nativeElement.offsetTop) + 100);\n this.dom.setHeightWithParent(this.config.parentClassName, this.dom.overhead, this.dom.height.default).then((res) => {\n this.log.info(`setHeight with ${this.config.parentClassName}`);\n return resolve(true);\n });\n }\n else {\n if (this.config.height) {\n // if( this.config.height < ( this.dom.overhead * 2 ) ) this.config.height = this.dom.overhead * 2;\n this.dom.setHeight(this.config.height, this.dom.overhead);\n this.log.info(`setHeight with config.height:${this.config.height} - overhead:${this.dom.overhead}`);\n }\n else if (this.config.bucketHeight) {\n this.config.height = this.config.bucketHeight + this.dom.overhead;\n this.dom.setHeight(+this.config.height, this.dom.overhead);\n this.log.info(`setHeight with config.bucketHeight:${this.config.bucketHeight} - overhead:${this.dom.overhead}`);\n }\n else if (this.config.bucketLimit) {\n this.config.bucketLimit = this.config.bucketLimit > this.config.options.values.length ? this.config.options.values.length : this.config.bucketLimit;\n this.config.bucketHeight = (this.config.bucketLimit * 30.5);\n this.config.height = this.config.bucketHeight + this.dom.overhead;\n this.dom.setHeight(+this.config.height, this.dom.overhead);\n this.log.info(`setHeight with config.bucketLimit:${this.config.bucketLimit} - overhead:${this.dom.overhead}`);\n }\n else {\n this.log.info(`setHeight with defaultHeight:${this.dom.height.default} - overhead:${this.dom.overhead}`);\n this.dom.setHeight(this.dom.height.default, this.dom.overhead);\n }\n return resolve(true);\n }\n });\n }", "getBlock(height) {\n let self = this;\n return new Promise((resolve, reject) => {\n self.bd.getLevelDBData(height).then((block) => {\n // console.log(`Retreiving block# ${height}`);\n // console.log(block);\n resolve(block);\n }).catch((err) => {\n console.log(err);\n reject(err)\n });\n });\n }", "getBlockHeight(){\r\n return new Promise((resolve,reject) => {\r\n //Get the last height in the chain\r\n this.chain.getLastKey().then(height => {\r\n resolve(height);\r\n }).catch(err => {\r\n console.log(err);\r\n reject(err);\r\n });\r\n });\r\n }", "get fundedBlockHeight() {\n let height = 0;\n\n const models = this.paymentsIn\n .filter(payment => {\n const paymentHeight = payment.get('height');\n return typeof paymentHeight === 'number' && paymentHeight > 0;\n })\n .sort((a, b) => (a.get('height') - b.get('height')));\n\n _.every(models, (payment, pIndex) => {\n if (this.getBalanceRemaining(new Transactions(models.slice(0, pIndex + 1))) <= 0) {\n height = payment.get('height');\n return false;\n }\n\n return true;\n });\n\n return height;\n }", "function cb_blockstats(e, stats){\n\t\tif(chain_stats.height) stats.height = chain_stats.height - 1;\n\t\tsendMsg({msg: 'chainstats', e: e, chainstats: chain_stats, blockstats: stats});\n\t}", "function cb_blockstats(e, stats){\n\t\tif(chain_stats.height) stats.height = chain_stats.height - 1;\n\t\tsendMsg({msg: 'chainstats', e: e, chainstats: chain_stats, blockstats: stats});\n\t}", "function cb_blockstats(e, stats){\n\t\tif(chain_stats.height) stats.height = chain_stats.height - 1;\n\t\tsendMsg({msg: \"chainstats\", e: e, chainstats: chain_stats, blockstats: stats});\n\t}", "function cb_blockstats(e, stats){\n\t\tif(chain_stats.height) stats.height = chain_stats.height - 1;\n\t\tsendMsg({msg: \"chainstats\", e: e, chainstats: chain_stats, blockstats: stats});\n\t}", "updateInnerHeightDependingOnChilds(){this.__cacheWidthPerColumn=null,this.__asyncWorkData[\"System.TcHmiGrid.triggerRebuildAll\"]=!0,this.__asyncWorkData[\"System.TcHmiGrid.triggerRecheckHeight\"]=!0,this.__requestAsyncWork()}", "async validateBlock(height) {\n // Add your code here\n // get block associated with height\n const block = await this.getBlockByHeight(height);\n if (!block) return\n // make copy of block to re-hash\n const blockCopy = {...block};\n // initialize hash\n blockCopy.hash = '';\n // calculate hash\n const newHash = SHA256(JSON.stringify(blockCopy)).toString();\n // pull hash from existing block\n const { hash } = block;\n \n return new Promise((resolve, reject) => {\n if (hash === newHash) {\n resolve(true)\n } else {\n resolve(false);\n }\n })\n }", "async function advanceToBlock (number) {\n if (web3.eth.blockNumber > number) {\n throw Error(`block number ${number} is in the past (current is ${web3.eth.blockNumber})`)\n }\n\n while (web3.eth.blockNumber < number) {\n await advanceBlock()\n }\n}", "initializeMockData() {\n\n/*\n (function theLoop (i) {\n setTimeout(function () {\n let blockTest = new BlockClass.Block(\"Test Block\");\n myBlockChain.addBlock(blockTest).then((result) => {\n console.log(result);\n i++;\n if (i < 10) theLoop(i);\n }, function(err){\n console.log(err);\n });\n }, 0); // set the time to generate new blocks, 0 = immediately\n })(0);\n*/\n }", "async function advanceToBlock (number) {\n if (web3.eth.blockNumber > number) {\n throw Error(`block number ${number} is in the past (current is ${web3.eth.blockNumber})`);\n }\n\n while (web3.eth.blockNumber < number) {\n await advanceBlock();\n }\n}", "async function findLastYesterdayBlockHeight() {\n const finalBlock = await queryFinalBlock();\n let finalBlockTimestamp = new BN(finalBlock.header.timestamp_nanosec);\n const dayLength = new BN(\"86400000000000\");\n let startOfDay = finalBlockTimestamp.sub(finalBlockTimestamp.mod(dayLength));\n let yesterdayBlock = await getLastYesterdayBlock(startOfDay);\n return parseInt(yesterdayBlock.block_height);\n}", "function waitUntilBlock(message, block, addBlocks) {\n var b = parseInt(block) + parseInt(addBlocks);\n console.log(\"RESULT: Waiting until '\" + message + \"' #\" + block + \"+\" + addBlocks + \"=#\" + b + \" currentBlock=\" + eth.blockNumber);\n while (eth.blockNumber <= b) {\n }\n console.log(\"RESULT: Waited until '\" + message + \"' #\" + block + \"+\" + addBlocks + \"=#\" + b + \" currentBlock=\" + eth.blockNumber);\n console.log(\"RESULT: \");\n}", "getBlock(height) {\n let self = this;\n let promise = new Promise(function(resolve, reject) {\n self.bd.getLevelDBData(height).then((block)=>{\n resolve(JSON.parse(block))\n });\n });\n return promise\n }", "getBlockByHeight(height){\n\n const self = this;\n return new Promise((resolve, reject) => {\n\n self.db.get(height, (err, value) => {\n\n if (err) {\n reject(err);\n }\n else {\n resolve(JSON.parse(value));\n }\n });\n });\n }", "async newBlockHandler(blockHeight) {\n try {\n Sentry.configureScope(function (scope) {\n scope.setExtra('height', blockHeight)\n })\n\n const block = await this.polkadotAPI.getBlockByHeightV2(blockHeight)\n this.enqueueAndPublishBlockAdded(block)\n\n // We dont need to fetch validators on every new block.\n // Validator list only changes on new sessions\n if (\n this.currentSessionIndex < block.sessionIndex ||\n this.currentSessionIndex === 0\n ) {\n console.log(\n `\\x1b[36mCurrent session index is ${block.sessionIndex}, fetching validators!\\x1b[0m`\n )\n this.currentSessionIndex = block.sessionIndex\n const [sessionValidators, era] = await Promise.all([\n this.polkadotAPI.getAllValidators(),\n this.api.query.staking.activeEra().then(async (era) => {\n return era.toJSON().index\n })\n ])\n this.sessionValidators = sessionValidators\n\n if (this.currentEra < era || this.currentEra === 0) {\n console.log(\n `\\x1b[36mCurrent staking era is ${era}, fetching rewards!\\x1b[0m`\n )\n this.currentEra = era\n\n const rewardsScript = spawn(\n 'node',\n [\n 'scripts/getOldPolkadotRewardEras.js',\n `--currentEra=${this.currentEra}`\n ],\n {\n stdio: 'inherit' //feed all child process logging into parent process\n }\n )\n rewardsScript.on('close', function (code) {\n process.stdout.write(\n 'rewardsScript finished with code ' + code + '\\n'\n )\n\n if (code !== 0) {\n Sentry.captureException(\n new Error('getOldPolkadotRewardEras script failed')\n )\n }\n })\n }\n }\n\n await this.store.update({\n height: blockHeight,\n block,\n validators: this.sessionValidators,\n data: {\n era: this.currentEra\n }\n })\n\n // For each transaction listed in a block we extract the relevant addresses. This is published to the network.\n // A GraphQL resolver is listening for these messages and sends the\n // transaction to each subscribed user.\n block.transactions.forEach((tx) => {\n tx.involvedAddresses.forEach((address) => {\n const involvedAddress = address\n publishUserTransactionAddedV2(this.network.id, involvedAddress, tx)\n\n if (tx.type === SEND) {\n const eventType =\n involvedAddress === tx.details.from[0]\n ? eventTypes.TRANSACTION_SEND\n : eventTypes.TRANSACTION_RECEIVE\n publishEvent(\n this.network.id,\n resourceTypes.TRANSACTION,\n eventType,\n involvedAddress,\n tx\n )\n }\n })\n })\n } catch (error) {\n console.error(`newBlockHandler failed`, error.message)\n Sentry.captureException(error)\n }\n }", "function heartBlock() {\r\n for (i = 0; i < 10; i++) {\r\n setTimeout(heartLine,5000*i,i);\r\n }\r\n }", "getBlock(height) {\n let self = this;\n return new Promise(function(resolve, reject) {\n self.levelDBWrapper.getLevelDBData(height).then((block) => {\n if(block) {\n resolve(block);\n } else {\n reject(\"Invalid block\"); \n }\n }).catch((err) => {\n reject(err);\n });\n });\n }", "function waitForBlocks(innum) {\n let startBlk = chain3.mc.blockNumber;\n let preBlk = startBlk;\n logger.info(\"Waiting for blocks to confirm the contract... currently in block \" + startBlk);\n while (true) {\n let curblk = chain3.mc.blockNumber;\n if (curblk > startBlk + innum) {\n logger.info(\"Waited for \" + innum + \" blocks!\");\n break;\n }\n if (curblk > preBlk) {\n logger.info(\"Waiting for blocks to confirm the contract... currently in block \" + curblk);\n preBlk = curblk;\n } else {\n logger.info(\"...\");\n }\n\n sleep(8000);\n }\n}", "function waitUntilBlock(message, block, addBlocks) {\n var b = parseInt(block) + parseInt(addBlocks);\n console.log(\"RESULT: Waiting until '\" + message + \"' #\" + block + \"+\" + addBlocks + \" = #\" + b + \" currentBlock=\" + eth.blockNumber);\n while (eth.blockNumber <= b) {\n }\n console.log(\"RESULT: Waited until '\" + message + \"' #\" + block + \"+\" + addBlocks + \" = #\" + b + \" currentBlock=\" + eth.blockNumber);\n console.log(\"RESULT: \");\n}", "_setLazyloadHeight() {\n\n if (this.lazyloadHeight === 0 && this.el) {\n const fromTop = this.el.getBoundingClientRect().top;\n this.lazyloadHeight = fromTop - this.lazyloadBuffer;\n }\n\n }", "function postHeight() {\n setTimeout(function () {\n var target = parent.postMessage ? parent : (parent.document.postMessage ? parent.document : undefined);\n if (typeof target != \"undefined\") {\n //Added \"billboard\" to postMessage so the component will know the messages origin.\n target.postMessage(document.getElementById(\"wrapper\").scrollHeight + \" billboard\", \"*\");\n }\n }, 100);\n}", "trackHeight(height) {\n if ( this.maxUserHeight && height != this.prevUserHeight ) {\n var delta = height-this.prevUserHeight;\n //this.trackDelay = 1000/this.fps;\n //var speed = delta/this.trackDelay*1000; // speed in m/s\n var speed = delta*this.fps;\n if ( this.jumping ) {\n var delay = Date.now() - this.jumping;\n if ( height <= this.maxUserHeight && delay > 300 ) {\n this.standUp();\n this.jumping = null;\n this.log(\"jump stopped\")\n } else if ( delay > 500 ) {\n this.log(\"jump stopped - timeout\")\n this.standUp();\n this.jumping = null;\n } else {\n this.jump(height - this.maxUserHeight);\n }\n } else if ( height > this.maxUserHeight && Math.abs(speed) > 0.2 ) {\n // CHECKME speed is not really important here\n this.jump(height - this.maxUserHeight);\n this.jumping = Date.now();\n this.log(\"jump starting\")\n } else {\n // ignoring anything less than 1mm\n if ( delta > 0.001 ) {\n this.rise(delta);\n } else if ( delta < -0.001 ) {\n this.crouch(-delta);\n }\n }\n\n } else {\n this.maxUserHeight = height;\n }\n this.prevUserHeight = height;\n }", "async validateBlock (height) {\n var block = await this.getBlock(height)\n const originalHash = block.hash\n block.hash = ''\n return originalHash === this.getHash(block)\n }", "async validateBlock(height) {\n // Add your code here\n try {\n let block = await this.getBlock(height);\n return(block.hash === SHA256(block.body).toString())\n } catch (err) {\n console.log(err)\n }\n }", "function observeBlock(observation){\n setupUnknownBlocks();\n swapblocks();\n window.setTimeout(function(){\n $('.block0').animate({top:-5},\"slow\");\n $('.block0').removeClass(\"gray-block\");\n $('.block0').addClass(observation+\"-block\");\n $('.block0').animate({top:parseInt($(\"img\").css(\"height\"))/2},\"slow\");\n $('.block0').html(\"\");\n },1000);\n\n }", "_modifyBlock(height, block) {\n let self = this;\n return new Promise( (resolve, reject) => {\n self.db.addLevelDBData(height, JSON.stringify(block).toString()).then((blockModified) => {\n resolve(blockModified);\n }).catch((err) => { console.log(err); reject(err)});\n });\n }", "function block() {\n blocked++;\n }", "static getBlockByHeight(blockHeight){\n return new Promise (function(resolve,reject){\n db.get(blockHeight, function (err, value){\n if (err){\n reject(err);\n }else{\n //value.body.star.storyDecoded = Utils.hex2a(value.body.star.story);\n }\n resolve(value);\n })\n })\n }", "getBlockByHeight() {\n this.app.get(\"/block/:height\", async (req, res) => {\n let reqBlock = null;\n try {\n reqBlock = await this.Blockchain.getBlockByHeight(req.params.height);\n res.send(reqBlock);\n } catch (err) {\n if (err.message.includes(\"Key not found\")) {\n res.send(`No block found with height of ${req.params.height}`);\n } else {\n res.send(`Error in getBlockByHeight method of Block Controller. \\n ${err}`);\n }\n }\n });\n }", "function resolveAfter2Seconds() {\n return new Promise(resolve => {\n setTimeout(() => {\n const bl = web3.eth.getBlock('latest'); //gets the latest block, in order to get the range needed\n bl.then(function(result){\n \n var avg_block_time = 14 //The average block time for ethereum is 14 seconds, change for different values\n var test = result.number - (86400/avg_block_time) \n //Gives an estimate block time 86400 = seconds in a day. Seconds in a day/seconds per block gives us the blocks in the past day\n\n resolve(Math.floor(test)) //the result would be in decimals, rounding down since blocks are whole numbers\n })\n }, 2000);\n });\n}", "async handleBlocks() {\n await this.api.rpc.chain.subscribeNewHeads(async (header) => {\n if (header.number % 100 == 0) {\n console.log(`Chain is at block: #${header.number}`);\n\n // Unconditionally recalculate validators every 10 minutes\n this.createValidatorList(); // do not await\n\n } else {\n const blockHash = await this.api.rpc.chain.getBlockHash(header.number);\n const block = await this.api.rpc.chain.getBlock(blockHash);\n \n const extrinsics = block['block']['extrinsics'];\n for (let i=0; i<extrinsics.length; i++) {\n const callIndex = extrinsics[i]._raw['method']['callIndex'];\n const c = await this.api.findCall(callIndex);\n //console.log(\"Module called: \", c.section);\n if (c.section == STAKING) {\n console.log(`A ${STAKING} transaction was called`);\n this.createValidatorList(); // do not await\n }\n }\n }\n\n });\n }", "getBlockByHeight() {\n let self = this.blockChain;\n this.server.route({\n method: 'GET',\n path: '/block/{height}',\n handler: async (request, h) => {\n \n try{\n let blockHeight = request.params.height;\n if(blockHeight == null){\n return \"Invalid height\"\n }\n let promise = self.getBlock(blockHeight);\n let result = await promise;\n return JSON.parse(result);\n }catch(err){\n return \"Block Not Found\";\n }\n }\n \n });\n }", "getBlock(blockHeight){\n return new Promise(function(resolve, reject) {\n db.getLevelDBData(blockHeight)\n .then((result) => {\n if (result) {\n resolve(result);\n } else {\n resolve(undefined);\n }\n })\n .catch((err) => {\n reject(err);\n })\n });\n }", "getBlockHeight() {\n let self = this;\n let countKey = [];\n return new Promise(function(resolve, reject) {\n self.db\n .createReadStream()\n .on(\"data\", function(data) {\n countKey.push(data.key);\n })\n .on(\"error\", function(err) {\n console.log(\"Error with getting info by Address!\", err);\n })\n .on(\"end\", function() {\n resolve(countKey.length - 1);\n });\n });\n }", "function SetMinBlockHeight(elem) {\n elem.css('min-height', window.innerHeight - 49)\n}" ]
[ "0.71196485", "0.70206577", "0.6949194", "0.6811678", "0.67125505", "0.665578", "0.65126926", "0.65034145", "0.6415976", "0.6394332", "0.6286481", "0.6271266", "0.62548894", "0.62484163", "0.6225977", "0.6164402", "0.61447823", "0.6105917", "0.6074959", "0.6023015", "0.59806645", "0.597709", "0.5966554", "0.596366", "0.5958474", "0.5942391", "0.5907407", "0.5862907", "0.5847009", "0.582066", "0.5819995", "0.58020455", "0.5800284", "0.57605916", "0.5751256", "0.5750265", "0.57274145", "0.57159233", "0.57159233", "0.57159233", "0.5708461", "0.57012635", "0.56966823", "0.5695276", "0.5669679", "0.5666038", "0.5657067", "0.56554747", "0.5644676", "0.5643878", "0.56334084", "0.5626564", "0.56206274", "0.56206274", "0.56206274", "0.5611352", "0.55709714", "0.5560782", "0.55571896", "0.55531543", "0.55433625", "0.553095", "0.5530171", "0.5526703", "0.5523493", "0.5517638", "0.5516613", "0.5516613", "0.5512781", "0.5512781", "0.55040073", "0.5502901", "0.5482735", "0.54717386", "0.5463184", "0.5457653", "0.54535145", "0.54514676", "0.5450669", "0.54481745", "0.5437651", "0.5428881", "0.54285306", "0.5425382", "0.5413164", "0.5411298", "0.5410465", "0.5390928", "0.5390842", "0.5387023", "0.5381283", "0.53772813", "0.53690517", "0.53678215", "0.5367593", "0.53604746", "0.535985", "0.5353971", "0.5344941", "0.5343819" ]
0.7681687
0
Upload a compiled binary to the chain, returning the code ID (among other things).
async upload (pathToBinary) { return this.API.upload(await readFile(pathToBinary), {}) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deploy(bytecode, abi, pipe) {\n\n}", "compile() {\n // Check if it is already compiled\n if (!this.compiled) {\n // Find the file and read it into memory\n let filePath = path.resolve(__dirname, 'contracts', 'SimpleStorage.sol');\n let fileSource = fs.readFileSync(filePath, 'UTF-8');\n\n // Compile the contract with the contract source and 1 for optimization\n let compiled = solc.compile(fileSource, 1);\n\n // Store the bytecode, as we need it for deployment\n this.bytecode = \"0x\" + compiled.contracts[':simplestorage'].bytecode;\n\n // Store the abi (application binary interface) for js to interface with the contract on the chain\n let contractInterface = compiled.contracts[':simplestorage'].interface; // this is a json object that web3 uses as an interface\n this.abi = JSON.parse(contractInterface);\n this.compiled = true;\n }\n }", "function uploadCode() {\n code = cm.getValue();\n localStorage.setItem(\"code\",code)\n worker.postMessage({code:code});\n codeUploaded = true;\n}", "function compileCode() {\n // Disables the compile button\n disableCompileButton();\n\n // Get the classes from the editor\n let classes = [];\n editor.getClasses().forEach(element => {\n classes.push({ name: element.name, code: element.doc.getValue() });\n });\n\n resultsComponent.componentWillReceiveProps({\n display: true,\n resultState: { compiling: true, error: false }\n });\n axios\n .post(\"/compile\", {\n challenge: editor.getChallengePath(),\n classes\n })\n .then(function(res) {\n if (res.data.error) {\n resultsComponent.componentWillReceiveProps({\n display: true,\n resultState: { error: res.data.error }\n });\n } else {\n resultsComponent.componentWillReceiveProps({\n display: true,\n resultState: {\n compiling: false,\n error: false,\n data: res.data\n }\n });\n }\n enableCompileButton();\n })\n .catch(function(err) {\n enableCompileButton();\n resultsComponent.componentWillReceiveProps({\n display: true,\n resultState: {\n compiling: false,\n error: \"The request failed. Try again later.\"\n }\n });\n });\n}", "function fetchCompileCode(base, body) {\n return request_1.default({\n base: base,\n url: '/utils/script/compileCode',\n options: {\n method: 'POST',\n body: body,\n headers: {\n 'Content-Type': 'application/json'\n }\n }\n });\n}", "function Code() {\n // convert to comp bit code\n}", "async compile(entryPoint) {\n\t\tlet options = this.config.reify(entryPoint, this._cache);\n\t\tlet bundle = await rollup(options.input);\n\t\tlet { output } = await bundle.generate(options.output);\n\t\tif(output.length !== 1) {\n\t\t\tthrow new Error(\"unexpected chunking\"); // TODO: support for code splitting\n\t\t}\n\t\tlet { code, modules } = output[0];\n\n\t\tthis._cache = bundle.cache;\n\t\tthis._modules = modules;\n\t\treturn code;\n\t}", "sendPrecompileRequest(exportUrl, sha, platforme, architecture, appType, callback) {\n var getrequest = new XMLHttpRequest();\n getrequest.onreadystatechange = function () {\n if (getrequest.readyState == 4) {\n callback(exportUrl, sha, platforme, architecture, appType);\n }\n };\n var compileUrl = exportUrl + \"/\" + sha + \"/\" + platforme + \"/\" + architecture + \"/precompile\";\n getrequest.open(\"GET\", compileUrl, true);\n getrequest.send(null);\n }", "static getSHAKey(exportUrl, name, source_code, callback, errCallback) {\n var filename = name + \".dsp\";\n var file = new File([source_code], filename);\n var newRequest = new XMLHttpRequest();\n var params = new FormData();\n params.append('file', file);\n var urlToTarget = exportUrl + \"/filepost\";\n newRequest.open(\"POST\", urlToTarget, true);\n newRequest.onreadystatechange = function () {\n if (newRequest.readyState == 4 && newRequest.status == 200)\n callback(newRequest.responseText);\n else if (newRequest.readyState == 4 && newRequest.status == 400)\n errCallback(newRequest.responseText);\n };\n newRequest.send(params);\n }", "getTransformedCode() {\n if (this.fastStorage.code) return this.fastStorage.code;\n\n if (this.shouldBeCompiled) {\n this.fastStorage.code = this.packer.generateCode(this.getAST(), this.projectPath, this.getContents());\n } else if (this.isJSON) {\n this.fastStorage.code = \"module.exports = \" + this.getContents();\n } else {\n this.fastStorage.code = this.getContents();\n }\n\n this.fastStorage.rebuildDate = Date.now();\n return this.fastStorage.code;\n }", "function SEND_CODE(c, tree) {\n\t\tsend_bits(tree[c].fc, tree[c].dl);\n\t}", "execute(code){\n }", "function caml_reify_bytecode (code, sz) {\n return eval(caml_global_data.compile(code).toString());\n}", "function codeGenerated(err, code){\n\tconsole.log(code);\n}", "writeByte(code)\n {\n this.liveFunc.writeByte(code);\n return YAPI_SUCCESS;\n }", "function BinaryPacker() {\n}", "function sendCode() {\n let codeForm = new FormData();\n let xhttp = new XMLHttpRequest();\n Blockly.Python.INFINITE_LOOP_TRAP = null;\n let code = PREAMBLE + Blockly.Python.workspaceToCode(mainWorkspace);\n codeForm.append(\"codeArea\", code);\n codeForm.append(\"fileName\", document.getElementById(\"fileNameTextBox\").value);\n xhttp.open(\"POST\", \"/copy_text\", true);\n addLoadEvent(xhttp);\n xhttp.send(codeForm);\n}", "async executeCompiled() {\n if (!this.compiled) return\n\n // reset runtime environment\n spellCore.resetRuntime()\n delete this.exports\n delete this.executionError\n\n // METHOD 2 (working except we can't get line number of failure)\n // Run by importing our `outputFile` as a module.\n // This lets us catch errors and get access to module `exports`.\n // Unfortunately, we don't get the line number of the error\n // (although Chrome does get the line number if we re-throw the error.)\n try {\n // Use `?<timestamp>` to create a unique URL each time\n this.exports = await import(this.outputFile.url + `?${Date.now()}`)\n return this.exports\n } catch (e) {\n if (Error.captureStackTrace) Error.captureStackTrace(e, this.executeCompiled)\n this.executionError = e\n return e\n }\n\n // METHOD 1\n // Alternate method of running: create a <script> tag\n // Problem with this is that we don't get access to errors\n // or `exports` in the compiled code.\n //\n // const scriptEl = document.createElement(\"script\")\n // scriptEl.setAttribute(\"id\", \"compileOutput\")\n // scriptEl.setAttribute(\"type\", \"module\")\n // scriptEl.innerHTML = this.compiled\n // const existingEl = document.getElementById(\"compileOutput\")\n // if (existingEl) {\n // existingEl.replaceWith(scriptEl)\n // } else {\n // document.body.append(scriptEl)\n // }\n }", "function getCode(userCode, processorName, sampleRate){\n return URL.createObjectURL(\n new Blob([userCode + '\\n' + libraryCode(processorName, sampleRate)],\n { type: 'application/javascript' })\n );\n }", "function compile() {\n cloudCompile('Compile', 'compile', function (data, terminalNeeded) {});\n}", "function compile(compilerPath, inOpt, callback) {\n start(function(port) {\n var client = tcp.connect({port:port,allowHalfOpen:true}, function() {\n client.end(new Buffer(JSON.stringify({\n compilerPath: compilerPath,\n inOpt: inOpt\n })));\n if (callback) {\n client.on('close', function() {\n callback();\n });\n }\n });\n });\n}", "function codepad_save() {\n var scene_id = codepad_get_scene();\n var scene_name = codepad_get_scene_name(scene_id);\n var scripts = codepad_get_scripts(scene_id);\n\n var zip_filename = scene_name.replace(/[^a-z0-9]/gi, '_').toLowerCase();\n\n var zip = new JSZip();\n var dir = zip.folder(zip_filename);\n for (var i = 0; i < scripts.length; i++) {\n var filename = scripts[i].name;\n var code = codepad_get_code(i + 1);\n dir.file(filename, code);\n }\n\n zip.generateAsync({ type: \"blob\" })\n .then(function (content) {\n saveAs(content, zip_filename);\n });\n}", "function compile() {\n fs.readFile(src, 'utf8', function(err, str){\n if (err) {\n next(err);\n } else {\n compiler.compile(str, function(err, str){\n if (err) {\n next(err);\n } else {\n fs.writeFile(dest, str, 'utf8', function(err){\n next(err);\n });\n }\n });\n }\n });\n }", "function downloadCode() {\n const code = Blockly.C.workspaceToCode(Blockly.getMainWorkspace());\n const codeArray = [];\n codeArray.push(code);\n\n const codeBlob = new Blob(codeArray, {type: \"text/plain;charset=utf-8\"});\n saveAs(codeBlob, \"main.cpp\");\n}", "SaveCompiledState() {\n\n }", "static getVerificationCode(session, fileId) {\n\n // >>>>> NOTICE <<<<<\n // This should be implemented on your application as a SELECT on your\n // \"document table\" by the ID of the document, returning the value of the\n // verification code column.\n if (session['Files/' + fileId + '/Code']) {\n return session['Files/' + fileId + '/Code'];\n }\n return null;\n }", "function generateFile(data) {\n FileReader.writeFile(\"compiled.js\", data, (err) => {\n if (err) {\n console.log(\"File write err\");\n }\n });\n}", "runCodeChunk(id) {\n if (!this.config.enableScriptExecution) {\n return;\n }\n const codeChunk = document.querySelector(`.code-chunk[data-id=\"${id}\"]`);\n const running = codeChunk.classList.contains(\"running\");\n if (running) {\n return;\n }\n codeChunk.classList.add(\"running\");\n if (codeChunk.getAttribute(\"data-cmd\") === \"javascript\") {\n // javascript code chunk\n const code = codeChunk.getAttribute(\"data-code\");\n try {\n eval(`((function(){${code}$})())`);\n codeChunk.classList.remove(\"running\"); // done running javascript code\n const CryptoJS = window[\"CryptoJS\"];\n const result = CryptoJS.AES.encrypt(codeChunk.getElementsByClassName(\"output-div\")[0].outerHTML, \"mume\").toString();\n this.postMessage(\"cacheCodeChunkResult\", [\n this.sourceUri,\n id,\n result,\n ]);\n }\n catch (e) {\n const outputDiv = codeChunk.getElementsByClassName(\"output-div\")[0];\n outputDiv.innerHTML = `<pre>${e.toString()}</pre>`;\n }\n }\n else {\n this.postMessage(\"runCodeChunk\", [this.sourceUri, id]);\n }\n }", "function decodeCmdProgram(binary) {\n var _a;\n let error;\n const annotations = [];\n const chunks = [];\n let filename;\n let entryPointAddress = 0;\n const b = new teamten_ts_utils_1.ByteReader(binary);\n // Read each chunk.\n while (true) {\n // First byte is type of chunk.\n const type = b.read();\n // End of file?\n if (type === teamten_ts_utils_1.EOF ||\n // Invalid type byte?\n type > exports.CMD_MAX_TYPE ||\n // Error earlier?\n error !== undefined ||\n // Just saw jump? There's typically junk after this and it can make it seem like there's an error.\n (chunks.length > 0 && chunks[chunks.length - 1] instanceof CmdTransferAddressChunk)) {\n if (chunks.length === 0) {\n return undefined;\n }\n return new CmdProgram(binary.subarray(0, b.addr()), error, annotations, chunks, filename, entryPointAddress);\n }\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(\"Type of chunk (\" +\n ((_a = exports.CMD_CHUNK_TYPE_NAME.get(type)) !== null && _a !== void 0 ? _a : \"unknown\") + \")\", b.addr() - 1, b.addr()));\n // Second byte is length, in bytes.\n let length = b.read();\n if (length === teamten_ts_utils_1.EOF) {\n error = \"File is truncated at length\";\n continue;\n }\n // Adjust load block length.\n if (type === exports.CMD_LOAD_BLOCK && length <= 2) {\n length += 256;\n }\n else if (type === exports.CMD_LOAD_MODULE_HEADER && length === 0) {\n length = 256;\n }\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(\"Length of chunk (\" + length +\n \" byte\" + (length === 1 ? \"\" : \"s\") + \")\", b.addr() - 1, b.addr()));\n // Read the raw bytes.\n const dataAddr = b.addr();\n const data = b.readBytes(length);\n if (data.length < length) {\n error = \"File is truncated at data\";\n // We continue so we can create a partial chunk. The loop will stop at the top of the next\n // iteration. Not sure this is the right thing to do.\n }\n // Create type-specific chunk objects.\n let chunk;\n switch (type) {\n case exports.CMD_LOAD_BLOCK:\n chunk = new CmdLoadBlockChunk(type, data);\n break;\n case exports.CMD_TRANSFER_ADDRESS: {\n const cmdTransferAddressChunk = new CmdTransferAddressChunk(type, data);\n entryPointAddress = cmdTransferAddressChunk.address;\n chunk = cmdTransferAddressChunk;\n break;\n }\n case exports.CMD_LOAD_MODULE_HEADER: {\n const cmdLoadModuleHeaderChunk = new CmdLoadModuleHeaderChunk(type, data);\n filename = cmdLoadModuleHeaderChunk.filename;\n if (filename === \"\") {\n filename = undefined;\n }\n chunk = cmdLoadModuleHeaderChunk;\n break;\n }\n default:\n chunk = new CmdChunk(type, data);\n break;\n }\n chunk.addAnnotations(annotations, dataAddr);\n chunks.push(chunk);\n }\n}", "function compile(code, fileName, lineOffset) {\n var _a = getOutput(code, fileName, lineOffset), value = _a[0], sourceMap = _a[1];\n var output = updateOutput(value, fileName, sourceMap, getExtension);\n outputCache.set(fileName, output);\n return output;\n }", "function uploadApp(appPath, appType, apiKeyId, issuerId, options) {\n return __awaiter(this, void 0, void 0, function* () {\n const args = [\n 'altool',\n '--output-format',\n 'xml',\n '--upload-app',\n '--file',\n appPath,\n '--type',\n appType,\n '--apiKey',\n apiKeyId,\n '--apiIssuer',\n issuerId\n ];\n yield exec.exec('xcrun', args, options);\n });\n}", "function shellUploader() {\n\n\tvar exec = require('child_process').execSync;\n\tvar filename = \"rawdatauploadscript.sh\";\n\n\texec(filename, processing);\n\n\t\tfunction processing(){\n\t\t console.log(\"RawData succesfully uploaded to repository\");\n\t\t}\n\tconsole.log(\"RawData succesfully uploaded to repository\");\n}", "async build() {\n const entry = path.resolve(process.cwd(), this._options.entry);\n const distPath = path.resolve(process.cwd(), this._options.distPath);\n logger.log(`Building ${entry} to ${distPath}`);\n const { code, map, assets } = await ncc(entry);\n const filename = path.basename(entry);\n await makeDir(distPath);\n fs.writeFileSync(`${distPath}/${filename}`, code);\n for (let asset in assets) {\n fs.writeFileSync(`${distPath}/${asset}`, assets[asset].source);\n }\n const finalAssets = [`${distPath}/${filename}`, ...Object.keys(assets).map(asset => `${distPath}/${asset}`)];\n logger.log('Building success!');\n finalAssets.forEach(asset => logger.log('=> ' + asset));\n return {\n success: true,\n assets: finalAssets\n };\n }", "function createProgram(id, pubKey, code) {\n}", "function generateCode(){\n\n}", "function upload() {\n var token = option('token');\n var owner = option('owner');\n var repo = option('repo');\n var file = option('file');\n var path = option('path');\n var message = option('message');\n var branch = option('branch', 'master');\n\n var content = fs.readFileSync(file, {encoding: 'base64'});\n\n var details = {\n message: message,\n content: content\n }\n\n console.error(\"Uploading file '%s' to https://github.com/%s/%s/blob/%s/%s\", file, owner, repo, branch, path);\n\n var options = {\n hostname: 'api.github.com',\n port: 443,\n path: '/repos/' + owner + '/' + repo + '/contents/' + path,\n method: 'PUT',\n headers: {\n 'Authorization': 'token ' + token,\n 'User-Agent': 'GitHubber/0.0 Node/' + process.version,\n 'Content-Type': 'application/json'\n }\n };\n\n var request = https.request(options, function(response) {\n var status = response.statusCode;\n var headers = response.headers;\n var body = \"\";\n response.setEncoding('utf8');\n response.on('data', function (chunk) { body = body + chunk; });\n response.on('end', function () { uploaded(status, headers, JSON.parse(body)) });\n });\n\n request.write(JSON.stringify(details));\n request.end();\n\n /* ======================================================================== */\n\n function uploaded(status, headers, response) {\n if (status != 201) throw httpError(status, headers, response);\n console.error(\"New file '%s' created as %s\", response.content.path, response.commit.sha);\n process.exit(0);\n };\n}", "async buildCode() {\n\t\tawait this._codeSource.generated.generate();\n\t}", "convertToAbi(cb) {\n var filePath = publicdir + '/solidity/publicFileStorage.sol';\n fs.readFile(filePath, 'utf8', function(err, solidityCode) {\n if (err) {\n console.log(\"error in reading file: \", err);\n return;\n } else {\n Logger.info(\"File Path: \", filePath);\n Logger.info(new Date());\n Logger.info(\"-----compling solidity code ----------\");\n Logger.info(new Date());\n var compiled = solc.compile(solidityCode, 1).contracts.publicTransaction;\n Logger.info(\"-----complile complete ----------\");\n Logger.info(new Date());\n const abi = JSON.parse(compiled.interface);\n Logger.info(\"bytecode: \", typeof compiled.bytecode, compiled.bytecode.length);\n const bytecode = compiled.bytecode;\n var smartSponsor = privateWeb3.eth.contract(abi);\n cb(bytecode, smartSponsor, abi);\n }\n });\n }", "function findCode(uploadGit, problemName, fileName, msg, action, cb=undefined) {\n\n /* Get the submission details url from the submission page. */\n var submissionURL;\n const e = document.getElementsByClassName('status-column__3SUg');\n if (checkElem(e)) {\n // for normal problem submisson\n const submissionRef = e[1].innerHTML.split(' ')[1];\n submissionURL = \"https://leetcode.com\" + submissionRef.split('=')[1].slice(1, -1);\n } else{\n // for a submission in explore section\n const submissionRef = document.getElementById('result-state');\n submissionURL = submissionRef.href;\n }\n\n if (submissionURL != undefined) {\n /* Request for the submission details page */\n const xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n /* received submission details as html reponse. */\n var doc = new DOMParser().parseFromString(\n this.responseText,\n 'text/html',\n );\n /* the response has a js object called pageData. */\n /* Pagedata has the details data with code about that submission */\n var scripts = doc.getElementsByTagName('script');\n for (var i = 0; i < scripts.length; i++) {\n var text = scripts[i].innerText;\n if (text.includes('pageData')) {\n /* Considering the pageData as text and extract the substring\n which has the full code */\n var firstIndex = text.indexOf('submissionCode');\n var lastIndex = text.indexOf('editCodeUrl');\n var slicedText = text.slice(firstIndex, lastIndex);\n /* slicedText has code as like as. (submissionCode: 'Details code'). */\n /* So finding the index of first and last single inverted coma. */\n var firstInverted = slicedText.indexOf(\"'\");\n var lastInverted = slicedText.lastIndexOf(\"'\");\n /* Extract only the code */\n var codeUnicoded = slicedText.slice(\n firstInverted + 1,\n lastInverted,\n );\n /* The code has some unicode. Replacing all unicode with actual characters */\n var code = codeUnicoded.replace(\n /\\\\u[\\dA-F]{4}/gi,\n function (match) {\n return String.fromCharCode(\n parseInt(match.replace(/\\\\u/g, ''), 16),\n );\n },\n );\n\n /*\n for a submisssion in explore section we do not get probStat beforehand\n so, parse statistics from submisson page\n */\n if(!msg){\n slicedText = text.slice(text.indexOf(\"runtime\"),text.indexOf(\"memory\"));\n const resultRuntime = slicedText.slice(slicedText.indexOf(\"'\")+1,slicedText.lastIndexOf(\"'\"));\n slicedText = text.slice(text.indexOf(\"memory\"),text.indexOf(\"total_correct\"));\n const resultMemory = slicedText.slice(slicedText.indexOf(\"'\")+1,slicedText.lastIndexOf(\"'\"));\n msg = `Time: ${resultRuntime}, Memory: ${resultMemory} -LeetHub`; \n }\n\n if (code != null) {\n setTimeout(function () {\n uploadGit(\n btoa(unescape(encodeURIComponent(code))),\n problemName,\n fileName,\n msg,\n action,\n true,\n cb\n );\n }, 2000);\n }\n }\n }\n }\n };\n\n xhttp.open('GET', submissionURL, true);\n xhttp.send();\n }\n}", "function runCode() {\n\t\tset_code(data);\n\t}", "getCode() {\r\n let factoryJava = new javaFactory();\r\n let factorySql = new sqlFactory();\r\n return factoryJava.file.concat(factorySql.file);\r\n }", "static run( jsenCode ) {\n const threadContext = {\n code: jsenCode,\n pc: 0,\n labelList: {\n blockBegin: 0,\n blockEnd: jsenCode.length,\n },\n };\n JZENVM._runContext( threadContext );\n }", "function writeCodes(root) {\n //If the current pointer exceeds the image size, error...\n if (ncount >= 256) {\n errorlog(\"Code Generation Error: The generated code image is too large. Maximum size: 256 bytes of code. Reached: \" + root.nodeName);\n }\n //If Block...\n if (root.nodeName === \"Block\") {\n //Write codes for all children\n for (var i = 0; i < root.children.length; i++) {\n writeCodes(root.children[i]);\n }\n }\n else if (root.nodeName === \"VariableDeclaration\") {\n machineCode[ncount] = \"A9\"; //load the accumulator\n ncount++;\n machineCode[ncount] = \"00\"; //with 00 - all variables are initialized to 00\n ncount++;\n machineCode[ncount] = \"8D\"; //save 00\n ncount++;\n machineCode[ncount] = \"T\" + staticTable.length; //at this memory location for the new variable\n ncount++;\n machineCode[ncount] = \"XX\"; //extra address space\n ncount++;\n //New static table entry!\n staticTable.push(new StaticTableEntry(\"T\" + staticTable.length + \"XX\", root.children[1].nodeVal, root.children[1].scope, \"\"));\n }\n else if (root.nodeName === \"Assignment\") {\n machineCode[ncount] = \"A9\"; //load the accumulator\n ncount++;\n //If setting to a new string...\n if (root.children[1].nodeType === \"string\") {\n //Start at lowest free heap space\n machineCode[heapcount] = \"00\";\n //Count backward\n heapcount--;\n //For as long as the string is, decrement the heap counter by one for each character.\n for (var i = 0; i < root.children[1].nodeVal.length; i++) {\n heapcount--;\n }\n //Now, count it back up (without losing track of original pointer)\n var tempheapcount = heapcount + 1;\n for (var i = 0; i < root.children[1].nodeVal.length; i++) {\n machineCode[tempheapcount] = root.children[1].nodeVal.charCodeAt(i).toString(16);\n tempheapcount++;\n }\n //Reset this temporary pointer\n tempheapcount = 0;\n //Back in the code section, this is now a static pointer to the string.\n machineCode[ncount] = (heapcount + 1).toString(16);\n }\n else if (root.children[1].nodeType === \"boolean\") {\n if (root.children[1].nodeVal === \"true\") {\n machineCode[ncount] = \"01\"; //true\n }\n else {\n machineCode[ncount] = \"00\"; //false\n }\n }\n else {\n machineCode[ncount] = \"0\" + root.children[1].nodeVal; //works for 0-9\n }\n ncount++;\n machineCode[ncount] = \"8D\"; //save the assigned value\n ncount++;\n //Search in static table for the existing memory address - both name and scope must match\n var existingVar = \"00\";\n for (var i = 0; i < staticTable.length; i++) {\n if (staticTable[i].variable === root.children[0].nodeVal && staticTable[i].scope <= root.children[0].scope) {\n existingVar = staticTable[i].temp.substring(0, 2);\n }\n }\n machineCode[ncount] = existingVar; //in the variable's assigned memory location\n ncount++;\n machineCode[ncount] = \"XX\"; //extra address space\n ncount++;\n }\n else if (root.nodeName === \"Output\") {\n //Find variable's memory location\n var existingVar = \"00\";\n for (var i = 0; i < staticTable.length; i++) {\n if (staticTable[i].variable === root.children[0].nodeVal && staticTable[i].scope <= root.children[0].scope) {\n existingVar = staticTable[i].temp.substring(0, 2);\n }\n }\n //If a variable was found, we are printing a variable.\n if (existingVar !== \"00\") {\n machineCode[ncount] = \"AC\"; //load the y register\n ncount++;\n machineCode[ncount] = existingVar; //from this memory location\n ncount++;\n machineCode[ncount] = \"XX\"; //extra address space\n ncount++;\n }\n else {\n machineCode[ncount] = \"A0\"; //load register\n ncount++;\n if (root.children[0].nodeType === \"string\") {\n machineCode[heapcount] = \"00\";\n heapcount--;\n for (var i = 0; i < root.children[0].nodeVal.length; i++) {\n heapcount--;\n }\n var tempheapcount = heapcount + 1;\n for (var i = 0; i < root.children[0].nodeVal.length; i++) {\n machineCode[tempheapcount] = root.children[0].nodeVal.charCodeAt(i).toString(16);\n tempheapcount++;\n }\n tempheapcount = 0;\n machineCode[ncount] = (heapcount + 1).toString(16); //static pointer where string begins\n }\n else if (root.children[0].nodeType === \"boolean\") {\n if (root.children[0].nodeVal === \"true\") {\n machineCode[ncount] = \"01\"; //true\n }\n else {\n machineCode[ncount] = \"00\"; //false\n }\n }\n else {\n machineCode[ncount] = \"0\" + root.children[0].nodeVal; //works for 0-9\n }\n ncount++;\n }\n machineCode[ncount] = \"A2\"; //load the x register\n ncount++;\n if (root.children[0].nodeType === \"string\" || currentScope.getType(root.children[0]) === \"string\") {\n machineCode[ncount] = \"02\"; //system code for \"print\" string\n ncount++;\n }\n else {\n machineCode[ncount] = \"01\"; //system code for \"print\" int/bool\n ncount++;\n }\n machineCode[ncount] = \"FF\"; //system call to print it\n ncount++;\n }\n else if (root.nodeName === \"If\" || root.nodeName === \"While\") {\n //Save where the test is so we can loop back to it later if it's a while\n if (root.nodeName === \"While\") {\n var testbyte = ncount;\n }\n if (root.children[0].children[1].nodeType === \"ID\") {\n machineCode[ncount] = \"AE\"; //load register\n ncount++;\n //Search for variable\n var existingVar = \"00\";\n for (var i = 0; i < staticTable.length; i++) {\n if (staticTable[i].variable === root.children[0].children[1].nodeVal && staticTable[i].scope <= root.children[0].children[1].scope) {\n existingVar = staticTable[i].temp.substring(0, 2);\n }\n }\n machineCode[ncount] = existingVar; //from this memory location\n ncount++;\n machineCode[ncount] = \"XX\"; //extra address space\n ncount++;\n }\n else {\n machineCode[ncount] = \"A2\"; //extra address space\n ncount++;\n if (root.children[0].children[1].nodeType === \"int\") {\n machineCode[ncount] = \"0\" + root.children[0].children[1].nodeVal; //extra address space\n ncount++;\n }\n else if (root.children[0].children[1].nodeType === \"boolean\") {\n if (root.children[0].children[1].nodeVal === \"true\") {\n machineCode[ncount] = \"01\"; //true\n ncount++;\n }\n else {\n machineCode[ncount] = \"00\"; //false\n ncount++;\n }\n }\n else {\n machineCode[heapcount] = \"00\";\n heapcount--;\n for (var i = 0; i < root.children[0].nodeVal.length; i++) {\n heapcount--;\n }\n var tempheapcount = heapcount + 1;\n for (var i = 0; i < root.children[0].nodeVal.length; i++) {\n machineCode[tempheapcount] = root.children[0].nodeVal.charCodeAt(i).toString(16);\n tempheapcount++;\n }\n tempheapcount = 0;\n machineCode[ncount] = (heapcount + 1).toString(16); //static pointer where string begins\n ncount++;\n }\n }\n machineCode[ncount] = \"EC\"; //compare to and set z flag\n ncount++;\n //Search for another variable\n var existingVar = \"00\";\n for (var i = 0; i < staticTable.length; i++) {\n if (staticTable[i].variable === root.children[0].children[0].nodeVal && staticTable[i].scope <= root.children[0].children[0].scope) {\n existingVar = staticTable[i].temp.substring(0, 2);\n }\n }\n //Only a == b is supported here\n machineCode[ncount] = existingVar; //this memory location\n ncount++;\n machineCode[ncount] = \"XX\"; //extra address space\n ncount++;\n machineCode[ncount] = \"D0\"; //check z flag and decide to jump or not\n ncount++;\n machineCode[ncount] = \"J\" + jumpTable.length; //jump placeholder\n ncount++;\n //Save where jump should begin\n jumpcount = ncount;\n writeCodes(root.children[1]); //write the codes for the block\n //Now that block is written, jump distance is known.\n var jumpDist = ncount - jumpcount;\n //New Jump Table entry & done, in the case of an If. Will simply evaluate this Jump once.\n if (root.nodeName === \"If\") {\n jumpTable.push(new JumpTableEntry(\"J\" + jumpTable.length, jumpDist.toString(16)));\n }\n //If it's a While, we must loop.\n if (root.nodeName === \"While\") {\n //Unconditional jump\n machineCode[ncount] = \"EC\"; //compare to and set z flag\n ncount++;\n machineCode[ncount] = \"AA\"; //00 byte\n ncount++;\n machineCode[ncount] = \"00\"; //address space\n ncount++;\n machineCode[ncount] = \"D0\"; //check z flag and decide to jump or not\n ncount++;\n //This is the next jump - not the initial one\n var nextJump = jumpTable.length + 1;\n //Put a placeholder\n machineCode[ncount] = \"J\" + nextJump;\n ncount++;\n //The original test must now jump down here to skip the loop entirely. Create an entry for the original test here\n jumpDist = ncount - jumpcount;\n jumpTable.push(new JumpTableEntry(\"J\" + jumpTable.length, jumpDist.toString(16)));\n //Loop jump - must jump past the end of the image and back into the code, to where the original test will be\n jumpcount = ncount;\n var loopDist = (255 - ncount) + (testbyte + 1);\n jumpTable.push(new JumpTableEntry(\"J\" + jumpTable.length, loopDist.toString(16))); //will evaluate the test ad infinitum\n }\n }\n else if (root.nodeName === \"Add\") {\n }\n}", "function decodeSystemProgram(binary) {\n const chunks = [];\n const annotations = [];\n let entryPointAddress = 0;\n const b = new teamten_ts_utils_1.ByteReader(binary);\n const headerByte = b.read();\n if (headerByte === teamten_ts_utils_1.EOF) {\n return undefined;\n }\n if (headerByte !== FILE_HEADER) {\n return undefined;\n }\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(\"System file header\", b.addr() - 1, b.addr()));\n let filename = b.readString(FILENAME_LENGTH);\n // Make a SystemProgram object with what we have so far.\n const makeSystemProgram = (error) => {\n const programBinary = binary.subarray(0, b.addr());\n return new SystemProgram(programBinary, error, filename, chunks, entryPointAddress, annotations);\n };\n if (filename.length < FILENAME_LENGTH) {\n // Binary is truncated.\n return makeSystemProgram(\"File is truncated at filename\");\n }\n filename = filename.trim();\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(`Filename \"${filename}\"`, b.addr() - FILENAME_LENGTH, b.addr()));\n while (true) {\n const marker = b.read();\n if (marker === teamten_ts_utils_1.EOF) {\n return makeSystemProgram(\"File is truncated at start of block\");\n }\n if (marker === END_OF_FILE_MARKER) {\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(\"End of file marker\", b.addr() - 1, b.addr()));\n break;\n }\n if (marker !== DATA_HEADER) {\n // Here if the marker is 0x55, we could guess that it's a high-speed cassette header.\n return makeSystemProgram(\"Unexpected byte \" + z80_base_1.toHexByte(marker) + \" at start of block\");\n }\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(\"Data chunk marker\", b.addr() - 1, b.addr()));\n let length = b.read();\n if (length === teamten_ts_utils_1.EOF) {\n return makeSystemProgram(\"File is truncated at block length\");\n }\n // 0 means 256.\n if (length === 0) {\n length = 256;\n }\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(`Length (${length} byte${length === 1 ? \"\" : \"s\"})`, b.addr() - 1, b.addr()));\n const loadAddress = b.readShort(false);\n if (loadAddress === teamten_ts_utils_1.EOF) {\n return makeSystemProgram(\"File is truncated at load address\");\n }\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(`Address (0x${z80_base_1.toHexWord(loadAddress)})`, b.addr() - 2, b.addr()));\n const dataStartAddr = b.addr();\n const data = b.readBytes(length);\n if (data.length < length) {\n return makeSystemProgram(\"File is truncated at data\");\n }\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(`Chunk data`, dataStartAddr, b.addr()));\n const checksum = b.read();\n if (loadAddress === teamten_ts_utils_1.EOF) {\n return makeSystemProgram(\"File is truncated at checksum\");\n }\n const systemChunk = new SystemChunk(loadAddress, data, checksum);\n chunks.push(systemChunk);\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(`Checksum (0x${z80_base_1.toHexByte(checksum)}, ${systemChunk.isChecksumValid() ? \"\" : \"in\"}valid)`, b.addr() - 1, b.addr()));\n }\n entryPointAddress = b.readShort(false);\n if (entryPointAddress === teamten_ts_utils_1.EOF) {\n entryPointAddress = 0;\n return makeSystemProgram(\"File is truncated at entry point address\");\n }\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(`Jump address (0x${z80_base_1.toHexWord(entryPointAddress)})`, b.addr() - 2, b.addr()));\n return makeSystemProgram();\n}", "function main()\n{\n const srcfile = process.argv[2];\n const outfile = process.argv[3];\n \n const basename = path.basename(srcfile);\n const content = fs.readFileSync(srcfile, \"utf8\");\n\n const sources = {};\n sources[basename] = {content};\n\n const input =\n {\n language: \"Solidity\",\n sources: sources,\n settings:\n {\n outputSelection:\n {\n \"*\": {\"*\": [\"*\"]}\n }\n }\n };\n\n const compiled = JSON.parse(solc.compile(JSON.stringify(input), imports));\n if(compiled.errors)\n {\n console.log(\"failed to compile contract\", compiled.errors[0]);\n process.exit(1);\n }\n else\n {\n const contracts = compiled.contracts;\n const contract = contracts[basename];\n const classes = Object.keys(contract);\n const classname = classes[0];\n const main = contract[classname];\n console.log(\"contract compiled\");\n fs.writeFileSync(outfile, JSON.stringify(main, null, 4));\n console.log(\"saved compiled contract in file\", outfile);\n process.exit(0);\n }\n}", "main_enter() {\n\n\t\t\t// lock editor\n\t\t\ty_editor.setReadOnly(true);\n\n\t\t\t// get code from editor\n\t\t\tlet s_source = y_editor.getValue();\n\n\t\t\t// submit to compiler\n\t\t\t$.ajax({\n\t\t\t\turl: H_CONFIG.hosts.proxy_url+'/compile',\n\t\t\t\tmethod: 'POST',\n\t\t\t\tdata: {\n\t\t\t\t\tvolt: s_source,\n\t\t\t\t},\n\t\t\t});\n\t\t}", "function deploy(func, args, save_path, cb){\n\tconsole.log(\"[obc-js] Deploying Chaincode - Start\");\n\tconsole.log(\"\\n\\n\\t Waiting...\");\t\t\t\t\t\t\t\t\t\t//this can take awhile\n\tvar options = {path: '/devops/deploy'};\n\tvar body = \t{\n\t\t\t\t\ttype: \"GOLANG\",\n\t\t\t\t\tchaincodeID: {\n\t\t\t\t\t\t\tpath: chaincode.details.git_url\n\t\t\t\t\t\t},\n\t\t\t\t\tctorMsg:{\n\t\t\t\t\t\t\t\"function\": func,\n\t\t\t\t\t\t\t\"args\": args\n\t\t\t\t\t}\n\t\t\t\t};\n\toptions.success = function(statusCode, data){\n\t\tconsole.log(\"\\n\\n\\t deploy success [wait 1 more minute]\");\n\t\tchaincode.details.deployed_name = data.message;\n\t\tobc.prototype.save(tempDirectory);\t\t\t\t\t\t\t\t\t//save it so we remember we have deployed\n\t\tif(save_path != null) obc.prototype.save(save_path);\t\t\t\t//user wants the updated file somewhere\n\t\tif(cb){\n\t\t\tsetTimeout(function(){\n\t\t\t\tconsole.log(\"[obc-js] Deploying Chaincode - Complete\");\n\t\t\t\tcb(null, data);\n\t\t\t}, 60000);\t\t\t\t\t\t\t\t\t\t\t\t\t\t//wait extra long, not always ready yet\n\t\t}\n\t};\n\toptions.failure = function(statusCode, e){\n\t\tconsole.log(\"[obc-js] deploy - failure:\", statusCode);\n\t\tif(cb) cb(eFmt('http error', statusCode, e), null);\n\t};\n\trest.post(options, '', body);\n}", "function compile() {\n\n}", "doStartCodeBuild() {\n const stackName = this.event.ResourceProperties.StackName;\n\n AWS_CODE_BUILD.startBuild({\n projectName: stackName,\n environmentVariablesOverride: [\n {\n name: EVENT_CFN,\n value: this.toBase64(this.event)\n }\n ]\n }, (err, data) => {\n if (err) {\n console.error(\"CodeBuild cannot be started\", err);\n this.callback(err);\n } else {\n console.log(\"CodeBuild started\", data);\n this.callback(null, JSON.stringify(data));\n }\n });\n }", "function run () {\n socket.emit('run', {version: config.version, body: myCodeMirror.getValue()})\n $('#runButton').text('Compiling...').addClass('loading')\n\n if (runTimeout) {\n clearTimeout(runTimeout)\n }\n runTimeout = setTimeout(function () {\n $('#runButton').text('Run').removeClass('loading');\n }, 10000);\n}", "async function onDidSave(document) {\n \n // vscode.window.showErrorMessage(document.fileName);\n if (document.fileName.endsWith('.git')){\n freshCompile(document.fileName.slice(0, -4));}\n else{\n freshCompile(document.fileName);}\n\n}", "function codeHash() {\n\n return '' +\n '<script src=\"//unpkg.com/cachep2p/cachep2p.min.js\"></script>' +\n '<script src=\"/files/cachep2p.security.js\"></script>' +\n '<script>var cachep2p = new CacheP2P;</script>';\n\n}", "function ret(context, execOptions) {\n\t if (!compiled) {\n\t compiled = compileInput();\n\t }\n\t return compiled.call(this, context, execOptions);\n\t }", "function ret(context, execOptions) {\n\t if (!compiled) {\n\t compiled = compileInput();\n\t }\n\t return compiled.call(this, context, execOptions);\n\t }", "function ret(context, execOptions) {\n\t if (!compiled) {\n\t compiled = compileInput();\n\t }\n\t return compiled.call(this, context, execOptions);\n\t }", "function ret(context, execOptions) {\n\t if (!compiled) {\n\t compiled = compileInput();\n\t }\n\t return compiled.call(this, context, execOptions);\n\t }", "function ret(context, execOptions) {\n\t if (!compiled) {\n\t compiled = compileInput();\n\t }\n\t return compiled.call(this, context, execOptions);\n\t }", "function ret(context, execOptions) {\n\t if (!compiled) {\n\t compiled = compileInput();\n\t }\n\t return compiled.call(this, context, execOptions);\n\t }", "function ret(context, execOptions) {\n\t if (!compiled) {\n\t compiled = compileInput();\n\t }\n\t return compiled.call(this, context, execOptions);\n\t }", "function ret(context, execOptions) {\n\t if (!compiled) {\n\t compiled = compileInput();\n\t }\n\t return compiled.call(this, context, execOptions);\n\t }", "function ret(context, execOptions) {\n\t if (!compiled) {\n\t compiled = compileInput();\n\t }\n\t return compiled.call(this, context, execOptions);\n\t }", "function ret(context, execOptions) {\n\t if (!compiled) {\n\t compiled = compileInput();\n\t }\n\t return compiled.call(this, context, execOptions);\n\t }", "function ret(context, execOptions) {\n\t if (!compiled) {\n\t compiled = compileInput();\n\t }\n\t return compiled.call(this, context, execOptions);\n\t }", "function ret(context, execOptions) {\n\t if (!compiled) {\n\t compiled = compileInput();\n\t }\n\t return compiled.call(this, context, execOptions);\n\t }", "function ret(context, execOptions) {\n\t if (!compiled) {\n\t compiled = compileInput();\n\t }\n\t return compiled.call(this, context, execOptions);\n\t }", "function ret(context, execOptions) {\n\t if (!compiled) {\n\t compiled = compileInput();\n\t }\n\t return compiled.call(this, context, execOptions);\n\t }", "function compileAndRun (fileName, examplesClasses, javaCode, roomId) {\n return new Promise(function (resolve, reject) {\n exec('mkdir ' + roomId, { timeout: 10000 }, (error, stdout, stderr) => {\n fs.writeFile(roomId + '/' + fileName, javaCode, function (err) {\n if (err) {\n reject(err)\n }\n //console.log('The file was saved!')\n\n execFile(\n 'javac',\n [\n '-cp',\n '.;tester.jar;javalib.jar',\n '-d',\n './' + roomId,\n './' + roomId + '/' + fileName\n ],\n { timeout: 10000 },\n (error, stdout, stderr) => {\n if (error) {\n resolve(stderr)\n }\n\n //console.log('Compilation complete')\n\n execFile(\n 'java',\n [\n '-classpath',\n './' + roomId + ';tester.jar;javalib.jar',\n 'tester.Main'\n ].concat(examplesClasses),\n { timeout: 10000 },\n (error, stdout, stderr) => {\n if (error) {\n resolve(stderr)\n }\n //console.log('run complete returning response...')\n resolve(stdout)\n }\n )\n }\n )\n })\n })\n })\n}", "function CodeInstance() {}", "function compile_fun() {\n exec(\"mi \" + sourceFile + ' > ' + __dirname +'/webpage/js/data-source.js', (error, stdout, stderr) => {\n\tif (error) {\n\t fs.readFile(__dirname +'/webpage/js/data-source.js', function(err, buf) {\n\t\tfs.writeFile(__dirname +'/webpage/js/data-source.js',\n\t\t\t \"let inputModel = '\" + buf.toString().replace(/(\\r\\n|\\n|\\r)/gm, \"\")\n\t\t\t + \"';\" , function (err) {if (err) return console.log(err);});});return;}\n\tif (stderr) {\n console.log(`stderr: ${stderr}`);\n return;\n\t}\n });\n}", "function InterpreterCompileAndRun( program_text )\n{\n\t// Clear contents.\n\tinterpreter_stdout = '';\n\tinterpreter_stderr = '';\n\n\tvar file_name = 'test.u';\n\tFS.writeFile( file_name, program_text );\n\tvar call_result = callMain( [file_name, '--entry', 'main'] );\n\n\treturn [ call_result, interpreter_stdout, interpreter_stderr ];\n}", "function checkCode() {\n\tlet fd = new FormData();\n\tlet passedCode = getCodeFromHash();\n\tif(typeof passedCode == \"undefined\") {\n\t\tlet statusBanner = document.querySelector(\"#status\");\n\t\tstatusBanner.innerHTML = \"Error: You don't have a code!\";\n\t\twindow.setTimeout(\n\t\t\tfunction redirect() {\n\t\t\t\twindow.location = \"/\";\n\t\t\t}\n\t\t, 2500);\n\t\treturn false;\n\t}\n\telse {\n\t\tfd.append(\"code\", getCodeFromHash());\n\t}\n\tfetch(\n\t\t\"/code\",\n\t\t{\n\t\t\tmethod: \"POST\",\n\t\t\tbody: fd,\n\t\t\tcredentials: \"same-origin\"\n\t\t},\n\t).then(resp=>resp.json()).then(processResult);\n}", "function register() {\n // Gets data from form\n var comment = document.getElementById(\"registerComment\").value,\n file = document.getElementById(\"registerFile\").files[0],\n reader = new FileReader(),\n blob = file.slice(0, file.size);\n\n // Hashes and registers the proof when file has been readed\n reader.onloadend = function(evt) {\n if (evt.target.readyState == FileReader.DONE) {\n var data = evt.target.result;\n // Hashes the file with SHA3 keccak-256\n var hash = \"0x\" + web3.sha3(data);\n\n var hash2 = web3.sha3(\"Some string to be hashed\");\n console.log(\"hash2\" + hash2);\n // Registers the proof\n notary.registerProof(hash, comment, {from: account}).then(function() {\n setRegisterStatus(\"Registration submitted\");\n }).catch(function(e) {\n console.log(e);\n setRegisterStatus(\"Error encountered while submitting a proof\");\n });\n }\n };\n\n // Reads the file\n reader.readAsBinaryString(blob);\n}", "function compileFile(filePath, oc) {\n let promise = new Promise((resolve, reject) => {\n const language = getLangugeByFilePath(filePath);\n if (language === 'Python')\n resolve(\"OK\")\n\n const compiler = config.compilers[language];\n const flags = getFlags(filePath);\n console.log(`${compiler} flags`, flags);\n\n const saveSetting = preferences().get(\"saveLocation\");\n let fileName = filePath.substring(filePath.lastIndexOf(path.sep) + 1);\n\n let compilationError = false;\n const compilerProcess = spawn(compiler, flags);\n compilerProcess.stdout.on(\"data\", data => {\n console.log(`stdout: ${data}`);\n });\n compilerProcess.stderr.on(\"data\", data => {\n oc.clear();\n oc.append(\"Errors while compiling\\n\" + data.toString());\n oc.show();\n compilationError = true;\n });\n compilerProcess.on(\"exit\", async exitCode => {\n if (!compilationError) {\n resolve(\"OK\")\n }\n console.log(`Compiler exited with code ${exitCode}`);\n reject(exitCode);\n });\n })\n \n return promise;\n}", "function compileFaust(name, sourcecode, x, y, callback){\n\n// Temporarily Saving parameters of compilation\n\twindow.name = name;\n\twindow.source = sourcecode;\n\twindow.x = x;\n\twindow.y = y;\n\n\tvar currentScene = \twindow.scenes[window.currentScene];\n\n// To Avoid click during compilation\n\tif(currentScene)\n\t\tcurrentScene.muteScene();\n\n\tvar args = [\"-I\", \"http://faust.grame.fr/faustcode/\"];\t\t \n\tvar factory = faust.createDSPFactory(sourcecode, args);\n callback(factory);\n\n\tif(currentScene)\n\t\tcurrentScene.unmuteScene();\n\n}", "compile() {\n try {\n let code = this.state.code.replace(/\\t/g, \"\").replace(/ /g, \"\").replace(/\\r\\n/g, \"\\n\"); // delete all spaces and tabs\n\n this.machine.name = this.setName(code); // set name\n this.machine.memory = this.memoryInit(code); // set variables and adressess\n this.machine.instructions = this.setInstructions(code); // set commands\n \n this.machine.ready = true; // change state of machine\n this.machine.running = false;\n this.machine.error = false;\n this.machine.currentOp = 0;\n\n this.log(\"Skompilowano program: \" + this.machine.name);\n console.log(this.machine.memory)\n } catch(e) {\n this.log(e.name + \": \" + e.message, \"error\");\n this.machine.ready = false;\n this.machine.error = true;\n } finally {\n this.setState({\n name: this.machine.name,\n ready: this.machine.ready,\n error: this.machine.error,\n running: this.machine.running,\n currentOp: this.machine.currentOp,\n memory: this.machine.memory\n });\n }\n }", "upload_blob_block(params, object_sdk) {\n return blob_translator.upload_blob_block(params, object_sdk);\n }", "function populate_go_chaincode(name){\n\tif(chaincode[name] != null){\n\t\tconsole.log('[obc-js] \\t skip, already exists');\n\t}\n\telse {\n\t\tchaincode.details.func.push(name);\n\t\tchaincode[name] = function(args, cb){\t\t\t\t\t\t\t\t//create the functions in chaincode obj\n\t\t\tvar options = {path: '/devops/invoke'};\n\t\t\tvar body = {\n\t\t\t\t\tchaincodeSpec: {\n\t\t\t\t\t\ttype: \"GOLANG\",\n\t\t\t\t\t\tchaincodeID: {\n\t\t\t\t\t\t\tname: chaincode.details.deployed_name,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tctorMsg: {\n\t\t\t\t\t\t\tfunction: name,\n\t\t\t\t\t\t\targs: args\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t};\n\n\t\t\toptions.success = function(statusCode, data){\n\t\t\t\tconsole.log(\"[obc-js]\", name, \" - success:\", data);\n\t\t\t\tif(cb) cb(null, data);\n\t\t\t};\n\t\t\toptions.failure = function(statusCode, e){\n\t\t\t\tconsole.log(\"[obc-js]\", name, \" - failure:\", statusCode);\n\t\t\t\tif(cb) cb(eFmt('http error', statusCode, e), null);\n\t\t\t};\n\t\t\trest.post(options, '', body);\n\t\t};\n\t}\n}", "function getCodeFromHash() {\n\tlet codeInput = document.querySelector(\"#code\");\n\tlet passedCode = window.location.hash.split(\"=\")[1];\n\treturn passedCode;\t\n}", "function encodeOpcode(name) {\n var params = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n params[_i - 1] = arguments[_i];\n }\n var opcode = opcodes[name];\n if (!opcode) {\n throw new Error(\"unknown opcode \" + name);\n }\n var loadArgs = opcode.loadArgs, storeArgs = opcode.storeArgs, code = opcode.code;\n if (params.length != loadArgs + storeArgs) {\n throw new Error(\"opcode '\" + name + \"' requires \" + (loadArgs + storeArgs) + \" arguments, but you gave me \" + params.length + \": \" + JSON.stringify(params));\n }\n // opcode\n var result;\n if (code >= 0x1000) {\n result = [0xC0, 0x00, code >> 8, code & 0xFF];\n }\n else if (code >= 0x80) {\n code = code + 0x8000;\n result = [code >> 8, code & 0xFF];\n }\n else {\n result = [code];\n }\n // loadArgs signature\n var sig = [];\n var i = 0;\n for (; i < loadArgs; i++) {\n var x = params[i];\n if (typeof (x) === 'number') {\n if (x === 0) {\n sig.push(0 /* zero */);\n continue;\n }\n if (-128 <= x && x <= 127) {\n sig.push(1 /* byte */);\n continue;\n }\n if (-0x10000 <= x && x <= 0xFFFF) {\n sig.push(2 /* int16 */);\n continue;\n }\n if (x > 0xFFFFFFFF || x < -0x100000000) {\n throw new Error(\"immediate load operand \" + x + \" out of signed 32 bit integer range.\");\n }\n sig.push(3 /* int32 */);\n continue;\n }\n if (typeof (x) === 'string') {\n if (x === 'pop') {\n sig.push(8 /* stack */);\n continue;\n }\n if (x.indexOf(\"*\") === 0) {\n parsePtr(x, params, i, sig);\n continue;\n }\n if (x.indexOf(\"Fr:\") === 0) {\n parseLocal(x, params, i, sig);\n continue;\n }\n }\n throw new Error(\"unsupported load argument \" + x + \" for \" + name + \"(\" + JSON.stringify(params) + \")\");\n }\n // storeArg signature\n if (storeArgs) {\n for (; i < loadArgs + storeArgs; i++) {\n var x = params[i];\n if (x === null || x === 0 /* discard */) {\n sig.push(0 /* discard */);\n continue;\n }\n if (typeof (x) === 'number') {\n if (x <= 0xFFFF) {\n sig.push(6 /* ptr_16 */);\n continue;\n }\n }\n if (typeof (x) === 'string') {\n if (x === 'push') {\n sig.push(8 /* stack */);\n continue;\n }\n if (x.indexOf(\"*\") === 0) {\n parsePtr(x, params, i, sig);\n continue;\n }\n if (x.indexOf(\"Fr:\") === 0) {\n parseLocal(x, params, i, sig);\n continue;\n }\n }\n throw new Error(\"unsupported store argument \" + x + \" for \" + name + \"(\" + JSON.stringify(params) + \")\");\n }\n }\n // signature padding\n if (i % 2) {\n sig.push(0);\n }\n for (var j = 0; j < sig.length; j += 2) {\n result.push(sig[j] + (sig[j + 1] << 4));\n }\n for (var j = 0; j < i; j++) {\n var s = sig[j];\n if (s === 0 /* zero */)\n continue;\n if (s === 8 /* stack */)\n continue;\n var x = params[j];\n if (s === 1 /* byte */) {\n result.push(uint8(x));\n continue;\n }\n if (s === 2 /* int16 */) {\n x = uint16(x);\n result.push(x >> 8);\n result.push(x & 0xFF);\n continue;\n }\n if (s === 3 /* int32 */) {\n x = uint32(x);\n result.push(x >> 24);\n result.push((x >> 16) & 0xFF);\n result.push((x >> 8) & 0xFF);\n result.push(x & 0xFF);\n continue;\n }\n if (s === 5 /* ptr_8 */ || s === 13 /* ram_8 */ || s === 9 /* local_8 */) {\n result.push(x);\n continue;\n }\n if (s === 6 /* ptr_16 */ || s === 14 /* ram_16 */) {\n result.push(x >> 8);\n result.push(x & 0xFF);\n continue;\n }\n if (s === 7 /* ptr_32 */ || s === 15 /* ram_32 */) {\n result.push(x >> 24);\n result.push((x >> 16) & 0xFF);\n result.push((x >> 8) & 0xFF);\n result.push(x & 0xFF);\n continue;\n }\n throw new Error(\"unsupported argument \" + x + \" of type \" + s + \" for \" + name + \"(\" + JSON.stringify(params) + \")\");\n }\n return result;\n }", "function copyBytecodeInterfaceToUI(){\n document.getElementById('compiled_bytecode').value=(contract_bytecode);\n document.getElementById('compiled_abidefinition').value=(contract_abidefinition);\n}", "uploadCodeFaust(app, module, x, y, e, dsp_code) {\n dsp_code = \"process = vgroup(\\\"\" + \"TEXT\" + \"\\\",environment{\" + dsp_code + \"}.process);\";\n if (!module) {\n app.compileFaust({ isMidi: false, name: \"TEXT\", sourceCode: dsp_code, x: x, y: y, callback: (factory) => { app.createModule(factory); } });\n }\n else {\n module.update(\"TEXT\", dsp_code);\n }\n }", "function sendCode(userCode, reqLangId) {\n var data = JSON.stringify({\n code: userCode,\n langId: reqLangId\n });\n var request = new XMLHttpRequest();\n request.open(\"POST\", \"https://codequotient.com/api/executeCode\");\n\n request.setRequestHeader('Content-type', 'application/json; charset=utf-8');\n request.send(data);\n request.addEventListener(\"load\", function (event) {\n var response = JSON.parse(event.currentTarget.responseText);\n if(response.codeId != null){\n \n sendResponseCode(response.codeId);\n }\n if(response.error){\n outputDisplay.innerHTML = \"Warning: \"+response.error;\n }\n });\n \n}", "async function deploy_from_file(path, init, gas = base_tx_settings.gas_limit, hardcode = {}, tx_settings = base_tx_settings)\n{\n\tvar code = read(path);\n\tfor(var k in hardcode){ code = code.replace(k, hardcode[k]); }\n\n\t\tconst contract = setup.zilliqa.contracts.new(code, init);\n\treturn contract.deploy(\n\t\t{ version: setup.VERSION, gasPrice: tx_settings.gas_price, gasLimit: gas, },\n\t\ttx_settings.attempts, tx_settings.timeoute, false\n\t\t);\n}", "compile () {\n this.DOMNodes.log.innerHTML = \"\"; // Reset the output log.\n this.disableTab(\"output\");\n this.disableTab(\"parse-tree\");\n let root;\n try {\n root = parse(this.tokens); // Parse the tokens from the lexer into a WebBS AST.\n this.updateParseTreeTab(root); // Update and re-enable the AST tab.\n } catch (error) { \n this.showErrorMessage(error);\n return;\n }\n\n try {\n let module = generateModule(root); // Generate bytecode from the AST and update the Bytecode tab.\n this.updateByteCodeTab(module);\n \n this.module = new WebAssembly.Module(module.toByteArray()); // Compile a WebAssembly module from the bytecode.\n this.DOMNodes.statusTitle.innerHTML = \"Success!\";\n this.DOMNodes.statusTitle.className = \"success\";\n this.DOMNodes.statusMessage.innerHTML = \"\";\n this.DOMNodes.runMessage.className = \"\"; // Remove any error messages.\n this.enableTab(\"output\");\n this.DOMNodes.runButton.className = \"button\"; // Enable the run button.\n } catch (error) {\n this.showErrorMessage(error);\n }\n }", "function wrapCrystal() {\n const cr = spawn(binary_path)\n cr.stdout.on('data', (data) => {\n console.log(data)\n })\n cr.stderr.on('data', (data) => {\n console.error(data)\n })\n cr.on('close', (code) => {\n var msg = `crystal executable exited with code: ${code}`\n if(code == 0) {\n console.log(msg)\n } else {\n console.error(msg)\n }\n })\n}", "postUploadProof(id, payload) {\n return this.request.post(`/${id}`, payload);\n }", "async function deployContract(){\n\n let abiPath = path.join(__dirname + '/bin/DataStorageEvent.abi');\n let binPath = path.join(__dirname + '/bin/DataStorageEvent.bin');\n\n console.log(chalk.green(abiPath));\n console.log(chalk.green(binPath));\n\n let abi = fs.readFileSync(abiPath);\n // let bin = '0x' + fs.readFileSync(binPath); updated version of ganache-cli does not need 'Ox' to be added to depict hexadecimal.\n let bin = fs.readFileSync(binPath);\n\n\n let contract = new web3.eth.Contract(JSON.parse(abi));\n\n console.log()\n // Returns an object of abstract contract.\n let status = await contract.deploy({\n data: bin,\n arguments: [100]\n }).send({\n from: '0x96b6E861698DfBA5721a3Ccd9AfBCa808e360bf3',\n gasPrice: 1000,\n gas: 300000\n })\n\n console.log(chalk.red('Address of Contract Deployed : ' + status.options.address));\n}", "async function uploadFromRunner(sarifPath, repositoryNwo, commitOid, ref, checkoutPath, gitHubVersion, apiDetails, logger) {\n return await uploadFiles(getSarifFilePaths(sarifPath), repositoryNwo, commitOid, ref, undefined, undefined, undefined, checkoutPath, undefined, gitHubVersion, apiDetails, \"runner\", logger);\n}", "ts(content, cb) {\n // compile some TypeScript...\n cb(null, result);\n }", "function ret(context, execOptions) {\n if (!compiled) {\n compiled = compileInput();\n }\n return compiled.call(this, context, execOptions);\n }", "function ret(context, execOptions) {\n if (!compiled) {\n compiled = compileInput();\n }\n return compiled.call(this, context, execOptions);\n }", "function ret(context, execOptions) {\n if (!compiled) {\n compiled = compileInput();\n }\n return compiled.call(this, context, execOptions);\n }", "function ret(context, execOptions) {\n if (!compiled) {\n compiled = compileInput();\n }\n return compiled.call(this, context, execOptions);\n }", "function ret(context, execOptions) {\n if (!compiled) {\n compiled = compileInput();\n }\n return compiled.call(this, context, execOptions);\n }", "function ret(context, execOptions) {\n if (!compiled) {\n compiled = compileInput();\n }\n return compiled.call(this, context, execOptions);\n }", "function ret(context, execOptions) {\n if (!compiled) {\n compiled = compileInput();\n }\n return compiled.call(this, context, execOptions);\n }", "function ret(context, execOptions) {\n if (!compiled) {\n compiled = compileInput();\n }\n return compiled.call(this, context, execOptions);\n }", "function ret(context, execOptions) {\n if (!compiled) {\n compiled = compileInput();\n }\n return compiled.call(this, context, execOptions);\n }", "function ret(context, execOptions) {\n if (!compiled) {\n compiled = compileInput();\n }\n return compiled.call(this, context, execOptions);\n }", "function ret(context, execOptions) {\n if (!compiled) {\n compiled = compileInput();\n }\n return compiled.call(this, context, execOptions);\n }" ]
[ "0.5894483", "0.5706609", "0.5677075", "0.55815244", "0.5562345", "0.53481674", "0.5141971", "0.50735664", "0.49832237", "0.498043", "0.49797356", "0.49532413", "0.49396405", "0.48989385", "0.48838103", "0.4876351", "0.48616552", "0.48295802", "0.482352", "0.47964936", "0.478596", "0.47847262", "0.47432432", "0.47405997", "0.47025394", "0.46890122", "0.46628413", "0.46606234", "0.46385399", "0.4619969", "0.46197316", "0.46111152", "0.46099177", "0.46014053", "0.45906332", "0.4580236", "0.4567054", "0.4559911", "0.4556544", "0.45398945", "0.45230347", "0.45227683", "0.45180917", "0.45118624", "0.44999695", "0.44983506", "0.44903532", "0.4456474", "0.4445877", "0.44423884", "0.444077", "0.4436209", "0.44248712", "0.44248712", "0.44248712", "0.44248712", "0.44248712", "0.44248712", "0.44248712", "0.44248712", "0.44248712", "0.44248712", "0.44248712", "0.44248712", "0.44248712", "0.44248712", "0.44222558", "0.4421687", "0.44206995", "0.4413605", "0.44128096", "0.44033659", "0.4395773", "0.4391146", "0.43819967", "0.4376534", "0.43744433", "0.4357302", "0.4352468", "0.43504074", "0.43482605", "0.4347379", "0.43458185", "0.43447736", "0.43390927", "0.43386146", "0.43348795", "0.43328148", "0.43268412", "0.43221238", "0.43221238", "0.43221238", "0.43221238", "0.43221238", "0.43221238", "0.43221238", "0.43221238", "0.43221238", "0.43221238", "0.43221238" ]
0.55440354
5
Instantiate a contract from a code ID and an init message.
async instantiate ({ codeId, initMsg = {}, label = '' }) { const initTx = await this.API.instantiate(codeId, initMsg, label) const codeHash = await this.API.getCodeHashByContractAddr(initTx.contractAddress) return { ...initTx, codeId, label, codeHash } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Contract(contractId) {\n contract_classCallCheck(this, Contract);\n // TODO: Add methods based on the contractSpec (or do that elsewhere?)\n this._id = contract_Buffer.from(contractId, 'hex');\n }", "static async initContractInstance(inputInitParams) {\n const {contractAddress} = inputInitParams;\n const aelf = AelfBridgeCheck.getAelfInstanceByExtension();\n if (!accountInfo) {\n throw Error('Please login');\n }\n const address = JSON.parse(accountInfo.detail).address;\n\n const contractInstance = await aelf.chain.contractAt(contractAddress);\n contractInstances[contractAddress + address] = contractInstance;\n return contractInstance;\n }", "function Contract() {\n if (this instanceof Contract) {\n instantiate(this, arguments[0]);\n } else {\n var C = mutate(Contract);\n var network_id = arguments.length > 0 ? arguments[0] : \"default\";\n C.setNetwork(network_id);\n return C;\n }\n }", "function Contract() {\n if (this instanceof Contract) {\n instantiate(this, arguments[0]);\n } else {\n var C = mutate(Contract);\n var network_id = arguments.length > 0 ? arguments[0] : \"default\";\n C.setNetwork(network_id);\n return C;\n }\n }", "function Contract() {\n if (this instanceof Contract) {\n instantiate(this, arguments[0]);\n } else {\n var C = mutate(Contract);\n var network_id = arguments.length > 0 ? arguments[0] : \"default\";\n C.setNetwork(network_id);\n return C;\n }\n }", "function Contract() {\n if (this instanceof Contract) {\n instantiate(this, arguments[0]);\n } else {\n var C = mutate(Contract);\n var network_id = arguments.length > 0 ? arguments[0] : \"default\";\n C.setNetwork(network_id);\n return C;\n }\n }", "function Contract() {\n if (this instanceof Contract) {\n instantiate(this, arguments[0]);\n } else {\n var C = mutate(Contract);\n var network_id = arguments.length > 0 ? arguments[0] : \"default\";\n C.setNetwork(network_id);\n return C;\n }\n }", "function Contract() {\n if (this instanceof Contract) {\n instantiate(this, arguments[0]);\n } else {\n var C = mutate(Contract);\n var network_id = arguments.length > 0 ? arguments[0] : \"default\";\n C.setNetwork(network_id);\n return C;\n }\n }", "function Contract() {\n if (this instanceof Contract) {\n instantiate(this, arguments[0]);\n } else {\n var C = mutate(Contract);\n var network_id = arguments.length > 0 ? arguments[0] : \"default\";\n C.setNetwork(network_id);\n return C;\n }\n }", "function Contract() {\n if (this instanceof Contract) {\n instantiate(this, arguments[0]);\n } else {\n var C = mutate(Contract);\n var network_id = arguments.length > 0 ? arguments[0] : \"default\";\n C.setNetwork(network_id);\n return C;\n }\n }", "function initialize_contract() {\n if (web3.utils.isAddress(document.getElementById(\"initialize_contract_input\").value)) {\n console.log(\"Using the address provided, please wait ...\");\n newContract.setAddress(document.getElementById(\"initialize_contract_input\").value);\n } else {\n console.log(\"Initializing existing contract at \" + newContract.getAddress());\n }\n var multiswapContractInstance = new web3.eth.Contract(abi, newContract.getAddress());\n newContract.setContractInstanceObject(multiswapContractInstance);\n}", "async instantiate(ctx) {\n console.log(\"Smart Contract Instantiated\");\n }", "async instantiate(ctx){\n console.log('Pharmanet Contract instantiated')\n }", "create_contract() {\n var mission = \"Destroy one debris\";\n var success_rate = this.get_successrate();\n var reward = this.get_reward(success_rate);\n var expiration = null; // TODO not implemented yet\n return new Contract(mission, reward, success_rate, expiration);\n }", "loadContract() {\r\n try {\r\n this.contract = new this.web3.eth.Contract(this.ABI, this.address);\r\n } catch (error) {\r\n console.error(error);\r\n throw new Error('Error loading contract.');\r\n }\r\n }", "function ContractConstructor(constructor, binding, name) {\n if(!(this instanceof ContractConstructor)) return new ContractConstructor(constructor, binding, name);\n\n if(!(constructor instanceof Function)) error(\"Wrong Contract\", (new Error()).fileName, (new Error()).lineNumber);\n\n Object.defineProperties(this, {\n \"constructor\": {\n get: function () { return constructor; } },\n \"name\": {\n get: function () { return name; } },\n \"binding\": {\n get: function () { return binding; } },\n \"build\": {\n get: function () { return function() {\n return _.construct(this, arguments);\n } } },\n \"ctor\": {\n get: function () { return this.build.bind(this);\n } }\n });\n\n this.toString = function() { return \"[*\" + ((name!=undefined) ? name : constructor.toString()) + \"*]\"; };\n }", "constructor(code, message, data) {\n if (!isValidEthProviderCode(code)) {\n throw new Error('\"code\" must be an integer such that: 1000 <= code <= 4999');\n }\n super(code, message, data);\n }", "async instantiate(ctx){\n console.log('************ Pharnet Transporter Smart Contract Instantiated *************');\n\t}", "static initialize(obj, code, message) { \n obj['code'] = code;\n obj['message'] = message;\n }", "async instantiate(ctx) {\r\n\r\n\r\n\r\n console.log('Registrar Smart Contract Instantiated');\r\n\r\n\r\n\r\n }", "function wrapContract(abi, byteCode) {\n if (!abi)\n throw new Error(\"The contract's Application Binary Interface is required\");\n else if (typeof byteCode == \"undefined\")\n throw new Error(\"The contract's bytecode parameter is required\");\n\n return class WrappedContract {\n constructor(address) {\n this.$address = address;\n this.$abi = abi;\n this.$byteCode = byteCode;\n\n const web3 = getCurrentWeb3();\n this.$contract = new web3.eth.Contract(this.$abi, this.$address);\n\n this.defineContractMethods();\n }\n\n // Populate contract methods\n defineContractMethods() {\n this.$abi.forEach(({ /*constant,*/ name, inputs, type }) => {\n if (type !== \"function\") return; // type == 'constructor' => skip\n\n // TODO overloaded functions?\n\n // Function\n const self = this;\n this[name] = (...args) => {\n var opts = argsToOpts(args, inputs);\n return {\n call: () => {\n // constant\n return sendContractConstantTransaction(\n self.$contract,\n self.$abi,\n name,\n opts\n );\n },\n send: () => {\n // transaction\n return sendContractTransaction(\n self.$contract,\n self.$abi,\n name,\n opts\n );\n },\n estimateGas: () => {\n return estimateContractTransactionGas(\n self.$contract,\n self.$abi,\n name,\n opts\n );\n }\n };\n };\n });\n }\n\n static new(...args) {\n const func = abi.find(func => func && func.type === \"constructor\");\n var constructorInputs = [];\n if (func) constructorInputs = func.inputs;\n\n var opts = argsToOpts(args, constructorInputs);\n\n opts.$abi = abi;\n opts.$byteCode = byteCode;\n\n return deployContract(opts).then(contract => {\n if (!contract) throw new Error(\"Empty contract\");\n\n return new WrappedContract(\n (contract.options && contract.options.address) ||\n contract._address ||\n contract.address\n );\n });\n }\n };\n}", "function _makeContract_ (funID) {\n var calls = _TYPES_[(funID)];\n var contract = _makeIntersectionContract_(calls);\n return contract;\n}", "async initContracts() {\n this.contract = new ethers.Contract(\n this.evn.SUPPORT_ADDRESS,\n this.evn.SUPPORT_ABI,\n this.wallet\n );\n this.contract.provider.polling = false;\n }", "static initialize(obj, propertyId, contractAddress) { \n obj['propertyId'] = propertyId;\n obj['contractAddress'] = contractAddress;\n }", "async instantiate(ctx) {\n\t\tlog.info(\"Manufacturer Smart Contract Instantiated\");\n\t}", "async function createNewContract() {\n var deploy = await LANDMARK.new()\n LANDMARK_instance = LANDMARK.at(deploy.address);\n}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xf89cf5e8;\n this.SUBCLASS_OF_ID = 0x8680d126;\n\n this.inviterId = args.inviterId;\n }", "function init()\n{\n // Initialize the ethereum client\n const web3 = new Web3(`${ConfigServer.nodePath}geth.ipc`, net);\n\n // Initialize the access smart contract\n const AccessABI = require(\"./contracts/access.json\");\n let accessSC = common.initContract(web3, AccessABI, ConfigServer.accessContractAddr);\n\n // Initialize balance smart contract\n const BalanceABI = require(\"./contracts/balance.json\");\n let balanceSC = common.initContract(web3, BalanceABI, ConfigServer.balanceContractAddr);\n\n // Intialize data smart contract\n const DataABI = require(\"./contracts/data.json\");\n let dataSC = common.initContract(web3, DataABI, ConfigServer.dataContractAddr);\n\n // Create struct that stores these parameters\n let ethClient = {\"web3\": web3, \"accessSC\": accessSC, \"balanceSC\":balanceSC, \"dataSC\": dataSC, \"config\": ConfigServer};\n\n return ethClient;\n}", "createCitizen() {\n let randomTokenID = web3.utils.randomHex(32);\n return this.contract.methods.mint(randomTokenID);\n }", "function assemble({ address, contract }, state) {\n return new state.web3.eth.Contract(\n state.interfaces[contract],\n address\n )\n}", "function getContractObject(){\n let abiPath = path.join(__dirname + '/bin/DataStorageEvent.abi');\n let abi = fs.readFileSync(abiPath);\n\n // Replace the contract address with the contract you want to invoke.\n // let contractAddress = '0xadb1e7fea9a24daee48492c3523721ea6b42f271'; // address of the deployed contract\n let options = {\n from: '0x96b6E861698DfBA5721a3Ccd9AfBCa808e360bf3',\n gasPrice: 1000,\n gas: 300000\n };\n let deployedContract = new web3.eth.Contract(JSON.parse(abi),contractAddress,options);\n return deployedContract;\n}", "static initialize(obj, contractStateType) { \n obj['contractStateType'] = contractStateType;\n }", "static createInstance(dnaContractAttributes) {\n return new DnaContract(dnaContractAttributes);\n }", "static initialize(obj, id, created, code, poolId) { \n obj['id'] = id;\n obj['created'] = created;\n obj['code'] = code;\n obj['poolId'] = poolId;\n }", "function createContract(arweave, wallet, contractSrc, initState) {\n return __awaiter(this, void 0, void 0, function* () {\n const srcTx = yield arweave.createTransaction({ data: contractSrc }, wallet);\n srcTx.addTag('App-Name', 'SmartWeaveContractSource');\n srcTx.addTag('App-Version', '0.3.0');\n srcTx.addTag('Content-Type', 'application/javascript');\n yield arweave.transactions.sign(srcTx, wallet);\n const response = yield arweave.transactions.post(srcTx);\n if (response.status === 200 || response.status === 208) {\n return yield createContractFromTx(arweave, wallet, srcTx.id, initState);\n }\n else {\n throw new Error('Unable to write Contract Source.');\n }\n });\n}", "function contract_create(request, response, next) {\n console.log('Contract create');\n}", "static initialize(obj, name, symbol, amount, contractAddress, tokenId, propertyId, transactionType, createdByTransactionId) { \n obj['name'] = name;\n obj['symbol'] = symbol;\n obj['amount'] = amount;\n obj['contractAddress'] = contractAddress;\n obj['tokenId'] = tokenId;\n obj['propertyId'] = propertyId;\n obj['transactionType'] = transactionType;\n obj['createdByTransactionId'] = createdByTransactionId;\n }", "function loadContract(){\n // we know the abi of the contract\n var abriStr = '[ { \"constant\": false, \"inputs\": [ { \"name\": \"newSellPrice\", \"type\": \"uint256\" }, { \"name\": \"newBuyPrice\", \"type\": \"uint256\" } ], \"name\": \"setPrices\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"name\", \"outputs\": [ { \"name\": \"\", \"type\": \"string\", \"value\": \"Rodrigo\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"name\": \"_spender\", \"type\": \"address\" }, { \"name\": \"_value\", \"type\": \"uint256\" } ], \"name\": \"approve\", \"outputs\": [ { \"name\": \"success\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"name\": \"\", \"type\": \"address\" } ], \"name\": \"fabricBalanceOf\", \"outputs\": [ { \"name\": \"\", \"type\": \"uint256\", \"value\": \"0\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"totalSupply\", \"outputs\": [ { \"name\": \"\", \"type\": \"uint256\", \"value\": \"2e+24\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"name\": \"_from\", \"type\": \"address\" }, { \"name\": \"_to\", \"type\": \"address\" }, { \"name\": \"_value\", \"type\": \"uint256\" } ], \"name\": \"transferFrom\", \"outputs\": [ { \"name\": \"success\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"decimals\", \"outputs\": [ { \"name\": \"\", \"type\": \"uint8\", \"value\": \"18\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"name\": \"_value\", \"type\": \"uint256\" } ], \"name\": \"burn\", \"outputs\": [ { \"name\": \"success\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"sellPrice\", \"outputs\": [ { \"name\": \"\", \"type\": \"uint256\", \"value\": \"0\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"name\": \"\", \"type\": \"address\" } ], \"name\": \"balanceOf\", \"outputs\": [ { \"name\": \"\", \"type\": \"uint256\", \"value\": \"0\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"name\": \"target\", \"type\": \"address\" }, { \"name\": \"mintedAmount\", \"type\": \"uint256\" } ], \"name\": \"mintToken\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"name\": \"_from\", \"type\": \"address\" }, { \"name\": \"_value\", \"type\": \"uint256\" } ], \"name\": \"burnFrom\", \"outputs\": [ { \"name\": \"success\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"buyPrice\", \"outputs\": [ { \"name\": \"\", \"type\": \"uint256\", \"value\": \"0\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"owner\", \"outputs\": [ { \"name\": \"\", \"type\": \"address\", \"value\": \"0x567ec4d3a5506e76066bb6999474c48f810dc2f3\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [], \"name\": \"symbol\", \"outputs\": [ { \"name\": \"\", \"type\": \"string\", \"value\": \"rod\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [], \"name\": \"buy\", \"outputs\": [], \"payable\": true, \"stateMutability\": \"payable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"name\": \"_to\", \"type\": \"address\" }, { \"name\": \"_value\", \"type\": \"uint256\" } ], \"name\": \"transfer\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"name\": \"\", \"type\": \"address\" } ], \"name\": \"frozenAccount\", \"outputs\": [ { \"name\": \"\", \"type\": \"bool\", \"value\": false } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"name\": \"_spender\", \"type\": \"address\" }, { \"name\": \"_value\", \"type\": \"uint256\" }, { \"name\": \"_extraData\", \"type\": \"bytes\" } ], \"name\": \"approveAndCall\", \"outputs\": [ { \"name\": \"success\", \"type\": \"bool\" } ], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"name\": \"_number\", \"type\": \"uint8\" } ], \"name\": \"setFabricRequiredSignatures\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": true, \"inputs\": [ { \"name\": \"\", \"type\": \"address\" }, { \"name\": \"\", \"type\": \"address\" } ], \"name\": \"allowance\", \"outputs\": [ { \"name\": \"\", \"type\": \"uint256\", \"value\": \"0\" } ], \"payable\": false, \"stateMutability\": \"view\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"name\": \"amount\", \"type\": \"uint256\" } ], \"name\": \"sell\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"name\": \"from\", \"type\": \"address\" }, { \"name\": \"value\", \"type\": \"uint256\" } ], \"name\": \"fabricTransfer\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"name\": \"target\", \"type\": \"address\" }, { \"name\": \"freeze\", \"type\": \"bool\" } ], \"name\": \"freezeAccount\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"constant\": false, \"inputs\": [ { \"name\": \"newOwner\", \"type\": \"address\" } ], \"name\": \"transferOwnership\", \"outputs\": [], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"function\" }, { \"inputs\": [ { \"name\": \"initialSupply\", \"type\": \"uint256\", \"index\": 0, \"typeShort\": \"uint\", \"bits\": \"256\", \"displayName\": \"initial Supply\", \"template\": \"elements_input_uint\", \"value\": \"2000000\" }, { \"name\": \"tokenName\", \"type\": \"string\", \"index\": 1, \"typeShort\": \"string\", \"bits\": \"\", \"displayName\": \"token Name\", \"template\": \"elements_input_string\", \"value\": \"Rodrigo\" }, { \"name\": \"tokenSymbol\", \"type\": \"string\", \"index\": 2, \"typeShort\": \"string\", \"bits\": \"\", \"displayName\": \"token Symbol\", \"template\": \"elements_input_string\", \"value\": \"rod\" }, { \"name\": \"_fabricRequiredSignatures\", \"type\": \"uint8\", \"index\": 3, \"typeShort\": \"uint\", \"bits\": \"8\", \"displayName\": \"&thinsp;<span class=\\\\\"punctuation\\\\\">_</span>&thinsp;fabric Required Signatures\", \"template\": \"elements_input_uint\", \"value\": \"2\" } ], \"payable\": false, \"stateMutability\": \"nonpayable\", \"type\": \"constructor\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": false, \"name\": \"owner\", \"type\": \"address\" }, { \"indexed\": false, \"name\": \"value\", \"type\": \"uint256\" } ], \"name\": \"FabricTransfer\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": false, \"name\": \"target\", \"type\": \"address\" }, { \"indexed\": false, \"name\": \"frozen\", \"type\": \"bool\" } ], \"name\": \"FrozenFunds\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": true, \"name\": \"from\", \"type\": \"address\" }, { \"indexed\": false, \"name\": \"value\", \"type\": \"uint256\" } ], \"name\": \"Burn\", \"type\": \"event\" }, { \"anonymous\": false, \"inputs\": [ { \"indexed\": true, \"name\": \"from\", \"type\": \"address\" }, { \"indexed\": true, \"name\": \"to\", \"type\": \"address\" }, { \"indexed\": false, \"name\": \"value\", \"type\": \"uint256\" } ], \"name\": \"Transfer\", \"type\": \"event\" } ]';\n var abi = JSON.parse(abriStr);\n var contract = web3.eth.contract(abi);\n\n // we know the address of the contract\n var ethContract = contract.at(\"0xA760C64DfDB1EE168f2CB7873759d917d919cfb1\");\n return ethContract;\n}", "checkCode(onChainCode, contractName, address) {\n if (!onChainCode || onChainCode.replace(\"0x\", \"\").replace(/0/g, \"\") === \"\")\n throw new Error(\n `Cannot create instance of ${contractName}; no code at address ${address}`\n );\n }", "checkCode(onChainCode, contractName, address) {\n if (!onChainCode || onChainCode.replace(\"0x\", \"\").replace(/0/g, \"\") === \"\")\n throw new Error(\n `Cannot create instance of ${contractName}; no code at address ${address}`\n );\n }", "function DependentContract(constructor) {\n if(!(this instanceof DependentContract)) return new DependentContract(constructor);\n\n if(!(constructor instanceof Constructor)) error(\"Wrong Contract\", (new Error()).fileName, (new Error()).lineNumber);\n\n Object.defineProperties(this, {\n \"constructor\": {\n get: function () { return constructor; } }\n });\n\n this.toString = function() { return \"(\" + constructor.toString() + \"->\" + \"*\" + \")\"; };\n }", "function BiddingContract(bytes32 nm,\n string desc,\n uint dur,\n uint sBid) {\n // constructor\n name=nm;\n description=desc;\n duration=dur;\n startBid=sBid;\n createdAt = now ;\n }", "add_contract(data) {\n data.sim_value = data.value;\n this.contracts[data.id] = data;\n }", "function Contract(contract) {\n var constructor = this.constructor;\n this.abi = constructor.abi;\n\n if (typeof contract == \"string\") {\n var address = contract;\n var contract_class = constructor.web3.eth.contract(this.abi);\n contract = contract_class.at(address);\n }\n\n this.contract = contract;\n\n // Provision our functions.\n for (var i = 0; i < this.abi.length; i++) {\n var item = this.abi[i];\n if (item.type == \"function\") {\n if (item.constant == true) {\n this[item.name] = Utils.promisifyFunction(contract[item.name], constructor);\n } else {\n this[item.name] = Utils.synchronizeFunction(contract[item.name], this, constructor);\n }\n\n this[item.name].call = Utils.promisifyFunction(contract[item.name].call, constructor);\n this[item.name].sendTransaction = Utils.promisifyFunction(contract[item.name].sendTransaction, constructor);\n this[item.name].request = contract[item.name].request;\n this[item.name].estimateGas = Utils.promisifyFunction(contract[item.name].estimateGas, constructor);\n }\n\n if (item.type == \"event\") {\n this[item.name] = contract[item.name];\n }\n }\n\n this.allEvents = contract.allEvents;\n this.address = contract.address;\n this.transactionHash = contract.transactionHash;\n }", "function loadContract(cb) {\n stateManager.getAccount(runState.address, function (err, account) {\n if (err) return cb(err);\n runState.contract = account;\n cb();\n });\n }", "function createProgram(id, pubKey, code) {\n}", "static initialize(obj, boxId, spendingProof) { \n obj['boxId'] = boxId;\n obj['spendingProof'] = spendingProof;\n }", "static initialize(obj, ciphertext, keyName) { \n obj['ciphertext'] = ciphertext;\n obj['key-name'] = keyName;\n }", "async Init(stub) {\n console.info('=========== Instantiated chaincode ===========');\n return shim.success();\n }", "function construct() { }", "function setup_contract() {\n var contract = web3.eth.contract(CONTRACT_ABI)\n return contract.at(CONTRACT_ADDRESSS)\n}", "async function init () {\n // get info for ganache or hardhat testnet\n const provider = await new ethers.providers.JsonRpcProvider();\n //console.log(\"\\n\\nprovider\\n\\n\", provider);\n\n // the following 2 lines are used if contract is on rinkeby instead of ganache or hardhat testnet\n //let provider;\n //window.ethereum.enable().then(provider = new ethers.providers.Web3Provider(window.ethereum));\n\n const signer = await provider.getSigner()\n //console.log(\"\\n\\nsigner\\n\\n\", signer);\n const userAddress = await signer.getAddress();\n //console.log(\"\\n\\nuser address\\n\\n\", userAddress);\n\n // initialize shadow contract\n\n let AppInstance = null;\n // get the contract address from deployment to test network. Make sure it is the applicaton contract, not the oracle.\n const abi = AppContractJSON.abi;\n\n // Make sure you set this correctly after deployment or nothing will work!!!\n AppInstance = new ethers.Contract('0x5FbDB2315678afecb367f032d93F642f64180aa3', abi, signer);\n\n // listen for events\n filterEvents(AppInstance);\n\n return { AppInstance, signer }\n}", "function getContracts(contract_initializer) {\n\treturn {\n\t WETH: new ethers.Contract(config[\"tokens\"][\"main\"][\"W-ETH\"], WEthAbi.interface, contract_initializer),\n\t DAI: new ethers.Contract(config[\"tokens\"][\"main\"][\"DAI\"], erc20Abi.interface, contract_initializer),\n\t SAI: new ethers.Contract(config[\"tokens\"][\"main\"][\"SAI\"], erc20Abi.interface, contract_initializer),\n\t MKR: new ethers.Contract(config[\"tokens\"][\"main\"][\"MKR\"], erc20Abi.interface, contract_initializer),\n\t Market: new ethers.Contract(config[\"market\"][\"main\"][\"address\"], MatchingMarketAbi.interface, contract_initializer),\n\t SupportMethods: new ethers.Contract(config[\"otcSupportMethods\"][\"main\"][\"address\"], SupportMethodsAbi.interface, contract_initializer)\n\t};\n}", "static initialize(obj, recipient, sender, tokenTypeSpecificData, transactionRequestId) { \n obj['recipient'] = recipient;\n obj['sender'] = sender;\n obj['tokenTypeSpecificData'] = tokenTypeSpecificData;\n obj['transactionRequestId'] = transactionRequestId;\n }", "async function createContract(client, fromPrivateKey, fromPublicKey, toPublicKey) {\n const web3 = new Web3(client.url)\n // web3Quorum in quorum mode (web3 client, enclave options, isQuorum)\n // https://consensys.github.io/web3js-quorum/latest/Web3Quorum.html\n const web3quorum = new Web3Quorum(web3, {privateUrl: client.privateUrl}, true);\n\n // unlock the account so you can sign the tx; uses web3.eth.accounts.decrypt(keystoreJsonV3, password);\n const accountKeyPath = path.resolve(__dirname, '../../','config/quorum/networkFiles', client.name ,'accountkey');\n const accountKey = JSON.parse(fs.readFileSync(accountKeyPath));\n const signingAccount = web3.eth.accounts.decrypt(accountKey, \"\");\n\n // get the nonce for the accountAddress\n const accountAddress = client.accountAddress;\n const txCount = await web3.eth.getTransactionCount(`0x${accountAddress}`);\n\n const txOptions = {\n nonce: txCount,\n gasPrice: 0, //ETH per unit of gas\n gasLimit: 0x24A22, //max number of gas units the tx is allowed to use\n value: 0,\n data: '0x'+contractBin+contractConstructorInit,\n from: signingAccount,\n isPrivate: true,\n privateKey: fromPrivateKey,\n privateFrom: fromPublicKey,\n privateFor: [toPublicKey]\n };\n console.log(\"Creating contract...\");\n // Generate and send the Raw transaction to the Besu node using the eea_sendRawTransaction JSON-RPC call\n const txHash = await web3quorum.priv.generateAndSendRawTransaction(txOptions);\n console.log(\"Getting contractAddress from txHash: \", txHash);\n return txHash\n}", "function create(contractFactory, address) {\n const web3Instance = global.web3;\n const provider = new ethers_1.ethers.providers.Web3Provider(web3Instance.currentProvider);\n const signer = provider.getSigner(address);\n const factory = new contractFactory(signer);\n return factory;\n}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xea02c27e;\n this.SUBCLASS_OF_ID = 0x3cc830d9;\n\n this.id = args.id;\n this.providerChargeId = args.providerChargeId;\n }", "constructor(result) {\n if (result instanceof pb.ContractFunctionResult) {\n this.bytes = result.getContractcallresult_asU8();\n this.contractId = result.hasContractid() ?\n ContractId_1.ContractId._fromProto(result.getContractid()) :\n null;\n this.errorMessage = result.getErrormessage();\n this.bloom = result.getBloom_asU8();\n this.gasUsed = result.getGasused();\n this.logs = ContractLogInfo_1.contractLogInfoListToSdk(result.getLoginfoList());\n }\n else {\n this.contractId = new ContractId_1.ContractId(0);\n this.bytes = result;\n this.errorMessage = \"\";\n this.bloom = new Uint8Array();\n this.gasUsed = 0;\n this.logs = [];\n }\n }", "static initialize(obj, firstName, lastName, bankCode, bankAccount, phoneNumber, mobileProvider, country, transferReason, iban, bankName, cashProvider, senderIdentityCardType, senderIdentityCardId, identityCardType, identityCardId, name, address, street, postalCode, city, branchCode, ifscCode) { \n }", "async getContract(address) {\n const result = await this.restClient.getContractInfo(address);\n if (!result)\n throw new Error(`No contract found at address \"${address}\"`);\n return {\n address: result.address,\n codeId: result.code_id,\n creator: result.creator,\n label: result.label,\n initMsg: result.init_msg,\n };\n }", "constructor() { \n \n MozuCoreApiContractsAddress.initialize(this);\n }", "function loadContract(arweave, contractID, contractSrcTXID) {\n return __awaiter(this, void 0, void 0, function* () {\n // Generate an object containing the details about a contract in one place.\n const contractTX = yield arweave.transactions.get(contractID);\n const contractOwner = yield arweave.wallets.ownerToAddress(contractTX.owner);\n contractSrcTXID = contractSrcTXID || utils_1.getTag(contractTX, 'Contract-Src');\n const minFee = utils_1.getTag(contractTX, 'Min-Fee');\n const contractSrcTX = yield arweave.transactions.get(contractSrcTXID);\n const contractSrc = contractSrcTX.get('data', { decode: true, string: true });\n let state;\n if (utils_1.getTag(contractTX, 'Init-State')) {\n state = utils_1.getTag(contractTX, 'Init-State');\n }\n else if (utils_1.getTag(contractTX, 'Init-State-TX')) {\n const stateTX = yield arweave.transactions.get(utils_1.getTag(contractTX, 'Init-State-TX'));\n state = stateTX.get('data', { decode: true, string: true });\n }\n else {\n state = contractTX.get('data', { decode: true, string: true });\n }\n const { handler, swGlobal } = createContractExecutionEnvironment(arweave, contractSrc, contractID, contractOwner);\n return {\n id: contractID,\n contractSrcTXID,\n contractSrc,\n initState: state,\n minFee,\n contractTX,\n handler,\n swGlobal,\n };\n });\n}", "function CodeInstance() {}", "constructor(provider) {\n if(!provider)\n throw new Error(\"Unable to construct object: no provider given\");\n \n const eth = new Eth(provider);\n const BPD_CONTRACT = new eth.Contract(BPD_ABI, BPD_ADDRESS);\n const TOKEN_CONTRACT = new eth.Contract(TOKEN_ABI, TOKEN_ADDRESS);\n const FOREIGN_SWAP_CONTRACT = new eth.Contract(FOREIGN_ABI, FOREIGN_ADDRESS);\n \n const STAKING_L1_CONTRACT = new eth.Contract(STAKING_ABI_L1, LAYER_1_STAKING_ADDRESS);\n const STAKING_L2_CONTRACT = new eth.Contract(STAKING_ABI, STAKING_ADDRESS);\n\n const AUCTION_L2_CONTRACT = new eth.Contract(AUCTION_ABI, AUCTION_ADDRESS);\n const AUCTION_L1_CONTRACT = new eth.Contract(AUCTION_ABI_L1, LAYER_1_AUCTION_ADDRESS);\n\n // Initialize properties\n this.bpd = new BigPayDay(BPD_CONTRACT);\n this.token = new Token(TOKEN_CONTRACT);\n this.foreignSwap = new ForeignSwap(FOREIGN_SWAP_CONTRACT);\n this.staking = new Staking(STAKING_L1_CONTRACT, STAKING_L2_CONTRACT);\n this.auction = new Auction(AUCTION_L1_CONTRACT, AUCTION_L2_CONTRACT);\n\n // Helpful utility methods\n this.util = {\n getProvider: () => eth,\n getCurrentBlock: () => eth.getBlockNumber()\n }\n }", "static initialize(obj, networkIdentifier, blockIdentifier) { \n obj['network_identifier'] = networkIdentifier;\n obj['block_identifier'] = blockIdentifier;\n }", "Initialize(IObjectId, EncodingType, string) {\n\n }", "function createStandardContract(standardContract,callback) {\n\tconsole.log(\"create standard contract object\", standardContract);\n\tvar contract = nforce.createSObject('Contract');\n\tcontract.set('Name', standardContract.Name);\n\tcontract.set('ContractNumber', standardContract.ContractNumber);\n\tcontract.set('Status', standardContract.Status);\n\n\torg.insert({ sobject: contract, oauth: oauth }, function(err, resp){\n\t\tif(!err) {\n\t\t\tconsole.log('Contract Object Created');\n\t\t\taddressId = resp.id;\n\t\t\tcallback(addressId);\n\t\t}else{\n\t\t\tcallback(err);\n\t\t}\n\n\t});\n\n}", "function makeCard(id) {\n\tvar instance = {};\n\tinstance.id = id; //this means the new instance\n\tinstance.rank = makeCard.rank;\n\tinstance.suit = makeCard.suit;\n\treturn instance;\n}", "function contract(address, abi, pipe) {\n\tvar self = this;\n\tthis.address = address;\n\tthis.abi = abi;\n\tthis.pipe = pipe;\n\n\tthis.functions = {}\n\tthis.abi.filter(function (json) {\n\t \treturn (json.type === 'function')\n\t\t}).forEach(function (json) {\n\t\t\tconst solidityFunction = new SolidityFunction(null, json, address)\n\t\t\tself.functions[json.name] = solidityFunction; \n\t\t})\n\n}", "async Init(stub) {\n console.info('=========== Instantiated mrp chaincode ===========');\n return shim.success();\n }", "static initialize(obj, amount, convertedAmount, exchangeRateUnit, operationId, recipient, sender, symbol) { \n obj['amount'] = amount;\n obj['convertedAmount'] = convertedAmount;\n obj['exchangeRateUnit'] = exchangeRateUnit;\n obj['operationId'] = operationId;\n obj['recipient'] = recipient;\n obj['sender'] = sender;\n obj['symbol'] = symbol;\n }", "constructor(scope, id, props) {\n super(scope, id, { type: CfnVPCCidrBlock.resourceTypeName, properties: props });\n cdk.requireProperty(props, 'vpcId', this);\n this.vpcCidrBlockId = this.ref.toString();\n }", "function initializeContract(){\n\tmyContractInstance = Maintenance.deployed();\n\n\t//registerMachine();\n\t//myContractInstance.methods.getMachineDetails.call().then('Testing->'+console.log);\n\n\tconsole.log('myContractInstance->'+myContractInstance);\n\n\tconsole.log('myContractInstance.address->'+myContractInstance.creator);\n\tconsole.log('myContractInstance.address@@@@@@@@@@@->'+myContractInstance);\n\t$('#cf_address').html(myContractInstance.address);\n\t//$('#cf_address').html(myContractInstance.address);\n\t//console.log('myContractInstance.address->'+myContractInstance.address);\n\t$('#cf_address').html(account);\n\tconsole.log('account.address->'+account);\n//\t$('#cf_machines').html(myContractInstance.numMachines);\n//\tconsole.log('cf_machines->'+myContractInstance.numMachines);\n\n\tmyContractInstance.numMachines.call().then(\n\t\t\tfunction(numMachines){\n\t\t\t\t$('#cf_machines').html(numMachines.toNumber());\n\t\t\t\treturn myContractInstance.numServiceRequests.call();\n\n\t}).then(\n\t\t\tfunction(numServiceRequests){\n\t\t\t\t$('#cf_servicerequests').html(numServiceRequests.toNumber());\n\t\t\t\tgetServiceRequests();\n\t});\n}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xe9e82c18;\n this.SUBCLASS_OF_ID = 0xb2b987f3;\n\n this.message = args.message;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x42e047bb;\n this.SUBCLASS_OF_ID = 0xb2b987f3;\n\n this.message = args.message;\n }", "async Init(stub) {\n console.info('=========== Instantiated fabanimal chaincode ===========');\n return shim.success();\n }", "constructor(transport, currencyCode) {\n super(transport);\n this.currencyCode = currencyCode;\n }", "constructor(scope, id, props) {\n super(scope, id, { type: CfnContactFlow.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_connect_CfnContactFlowProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnContactFlow);\n }\n throw error;\n }\n cdk.requireProperty(props, 'content', this);\n cdk.requireProperty(props, 'instanceArn', this);\n cdk.requireProperty(props, 'name', this);\n cdk.requireProperty(props, 'type', this);\n this.attrContactFlowArn = cdk.Token.asString(this.getAtt('ContactFlowArn', cdk.ResolutionTypeHint.STRING));\n this.content = props.content;\n this.instanceArn = props.instanceArn;\n this.name = props.name;\n this.type = props.type;\n this.description = props.description;\n this.state = props.state;\n this.tags = new cdk.TagManager(cdk.TagType.STANDARD, \"AWS::Connect::ContactFlow\", props.tags, { tagPropertyName: 'tags' });\n }", "setContractId(contractIdLike) {\n this._builder.setContractid(new ContractId_1.ContractId(contractIdLike)._toProto());\n return this;\n }", "async Init(stub) {\n console.info('=========== Instantiated smart_review chaincode ===========');\n return shim.success();\n }", "constructor() {\n this._contractInstance = undefined;\n\n if (typeof web3 !== 'undefined') {\n web3 = new Web3(web3.currentProvider);\n } else {\n let url = `http://${ blockchainConfig.host }:${ blockchainConfig.port }`;\n web3 = new Web3(new Web3.providers.HttpProvider(url));\n }\n }", "constructor(privateKey, recipient, amount) {\n // Enter your solution here\n\n }", "setContractId(contractIdLike) {\n this._body.setContractid(new ContractId_1.ContractId(contractIdLike)._toProto());\n return this;\n }", "constructor(scope, id, props) {\n super(scope, id, { type: CfnContactFlowModule.CFN_RESOURCE_TYPE_NAME, properties: props });\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_connect_CfnContactFlowModuleProps(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, CfnContactFlowModule);\n }\n throw error;\n }\n cdk.requireProperty(props, 'content', this);\n cdk.requireProperty(props, 'instanceArn', this);\n cdk.requireProperty(props, 'name', this);\n this.attrContactFlowModuleArn = cdk.Token.asString(this.getAtt('ContactFlowModuleArn', cdk.ResolutionTypeHint.STRING));\n this.attrStatus = cdk.Token.asString(this.getAtt('Status', cdk.ResolutionTypeHint.STRING));\n this.content = props.content;\n this.instanceArn = props.instanceArn;\n this.name = props.name;\n this.description = props.description;\n this.state = props.state;\n this.tags = new cdk.TagManager(cdk.TagType.STANDARD, \"AWS::Connect::ContactFlowModule\", props.tags, { tagPropertyName: 'tags' });\n }", "async insertContract(ctx, contractDetails) {\n try {\n let contractInfo = JSON.parse(contractDetails.trim());\n if(!contractInfo.name) {\n return 'Contract must have a name';\n }\n if(!contractInfo.owner) {\n return 'Contract must have an owner';\n }\n if(!contractInfo.contactInfo) {\n return 'Contract must have contact info';\n }\n if(!contractInfo.thirdpartyusage) {\n return 'Missing condition for third party usage';\n }\n if(!contractInfo.offerings) {\n return 'Missing offerings';\n }\n if(!contractInfo.requirements){\n return 'Missing requirements';\n }\n if(!contractInfo.dataSources) {\n return 'Contract must provide data sources';\n }\n if(!contractInfo.limit) {\n return 'Contract must have a limit';\n }\n if(!contractInfo.stage) {\n return 'Contract must have a stage';\n }\n if(!contractInfo.lifetime) {\n return 'Contract must have a lifetime';\n }\n if(!contractInfo.restrictions) {\n return 'Missing restrictions field';\n }\n let currentContracts = await ctx.stub.getState('contracts'); \n if(!currentContracts.length > 1) {\n currentContracts = new HashMap();\n }\n if (contractDetails.uuid) { \n\n let existingContract = await ctx.stub.getState(contractDetails.uuid);\n await ctx.stub.putState(contractDetails.uuid, JSON.stringify(contractInfo));\n \n currentContracts.set(contractDetails.uuid, contractDetails); \n await ctx.stub.putState('contracts', currentContracts);\n if (existingContract.length > 0) {\n return 'replaced existing contract with the new contract: ' +JSON.stringify(contractInfo) + ' at id '+contractId; \n }\n else {\n return 'Inserted new contract :' + contractInfo + ' with id '+contractId;\n } \n \n } else {\n let uid = uuidv5(contractInfo.name, namespace);\n await ctx.stub.putState(uid, JSON.stringify(contractInfo));\n return 'contract with new id ' + uid + ' and details: ' + contractDetails + ' has been inserted';\n } \n } catch (error) {\n return ' JSON parse failed on '+ contractDetails + ' with error ' +error;\n } \n }", "static initialize(obj, noncePrefix, macAddress) { \n obj['nonce_prefix'] = noncePrefix;\n obj['mac_address'] = macAddress;\n }", "function loadContract (name) {\n loadScript (\n \"target/test-solc-js/\" + name + \".abi.js\");\n return web3.eth.contract (_);\n}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xa43ad8b7;\n this.SUBCLASS_OF_ID = 0x4bca7570;\n\n this.msgId = args.msgId;\n this.seqNo = args.seqNo;\n this._bytes = args.bytes;\n }", "static initialize(obj, sequence, blockIdentifier, type) { \n obj['sequence'] = sequence;\n obj['block_identifier'] = blockIdentifier;\n obj['type'] = type;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x8f079643;\n this.SUBCLASS_OF_ID = 0xb2b987f3;\n\n this.message = args.message;\n }", "static initialize(obj, created, programID, customerProfileID, type, amount, name, subLedgerID) { \n obj['created'] = created;\n obj['programID'] = programID;\n obj['customerProfileID'] = customerProfileID;\n obj['type'] = type;\n obj['amount'] = amount;\n obj['name'] = name;\n obj['subLedgerID'] = subLedgerID;\n }", "function setupContract(address) {\n if(!abis) {\n window.alert(\"ABI data not loaded\");\n return;\n }\n\n // Load contract ABI data\n var EInvoicingRegistry = web3.eth.contract(abis.EInvoicingRegistry.abi);\n\n // Instiate proxy object\n contract = EInvoicingRegistry.at(address);\n\n try {\n var ver = contract.version();\n } catch(e) {\n window.alert(\"Error communicating with the contract:\" + e);\n return;\n }\n\n if(!ver) {\n window.alert(\"Contract seems to be invalid\");\n return;\n }\n\n $(\"#active-address\").text(address);\n $(\"#active-version\").text(ver);\n $(\"#alert-contract-success\").show();\n\n $(\"#contract-manipulation input, #contract-manipulation button, #contract-manipulation textarea\").removeAttr(\"disabled\");\n\n window.localStorage.setItem(\"contractAddress\", address);\n window.contract = contract;\n }", "function simulateCreateContractFromSource(arweave, wallet, initState, contractSrc) {\n return __awaiter(this, void 0, void 0, function* () {\n const srcTx = yield arweave.createTransaction({ data: contractSrc }, wallet);\n srcTx.addTag('App-Name', 'SmartWeaveContractSource');\n srcTx.addTag('App-Version', '0.3.0');\n srcTx.addTag('Content-Type', 'application/javascript');\n yield arweave.transactions.sign(srcTx, wallet);\n // compute the fee needed to deploy the init state\n const deployInitStateTx = yield simulateCreateContractFromTx(arweave, wallet, srcTx.id, initState);\n const initStateReward = deployInitStateTx.reward;\n // update the reward of the contract creation by adding the reward needed for the creation of the state\n srcTx.reward = (parseFloat(srcTx.reward) + parseFloat(initStateReward)).toString();\n return srcTx;\n });\n}", "constructor(parent, childId, initialData, owner, msgId) {\n let _this = this;\n\n _this._parent = parent;\n _this._childId = childId;\n _this._owner = owner;\n _this._msgId = msgId;\n\n _this._syncObj = new SyncObject(initialData);\n\n _this._bus = parent._bus;\n _this._allocateListeners();\n }", "constructor(version, data, textEncoder, textDecoder, zlib, abiProvider, signature) {\n if ((data.flags & abi.RequestFlagsBroadcast) !== 0 && data.req[0] === 'identity') {\n throw new Error('Invalid request (identity request cannot be broadcast)');\n }\n if ((data.flags & abi.RequestFlagsBroadcast) === 0 && data.callback.length === 0) {\n throw new Error('Invalid request (nothing to do, no broadcast or callback set)');\n }\n this.version = version;\n this.data = data;\n this.textEncoder = textEncoder;\n this.textDecoder = textDecoder;\n this.zlib = zlib;\n this.abiProvider = abiProvider;\n this.signature = signature;\n }", "function Contract(contract) {\n var instance = this;\n var constructor = instance.constructor;\n\n // Disambiguate between .at() and .new()\n if (typeof contract === \"string\") {\n var web3Instance = new constructor.web3.eth.Contract(constructor.abi);\n web3Instance.options.address = contract;\n contract = web3Instance;\n }\n\n // Core:\n instance.methods = {};\n instance.abi = constructor.abi;\n instance.address = contract.options.address;\n instance.transactionHash = contract.transactionHash;\n instance.contract = contract;\n\n //for stacktracing in tests\n if (constructor.debugger) {\n instance.debugger = constructor.debugger;\n }\n\n // User defined methods, overloaded methods, events\n instance.abi.forEach(function (item) {\n switch (item.type) {\n case \"function\":\n var isConstant =\n [\"pure\", \"view\"].includes(item.stateMutability) || item.constant; // new form // deprecated case\n\n var signature = webUtils._jsonInterfaceMethodToString(item);\n\n var method = function (constant, web3Method) {\n var fn;\n\n constant\n ? (fn = execute.call.call(\n constructor,\n web3Method,\n item,\n instance.address\n ))\n : (fn = execute.send.call(\n constructor,\n web3Method,\n item,\n instance.address\n ));\n\n fn.call = execute.call.call(\n constructor,\n web3Method,\n item,\n instance.address\n );\n fn.sendTransaction = execute.send.call(\n constructor,\n web3Method,\n item,\n instance.address\n );\n fn.estimateGas = execute.estimate.call(\n constructor,\n web3Method,\n item,\n instance.address\n );\n fn.request = execute.request.call(\n constructor,\n web3Method,\n item,\n instance.address\n );\n\n return fn;\n };\n\n // Only define methods once. Any overloaded methods will have all their\n // accessors available by ABI signature available on the `methods` key below.\n if (instance[item.name] === undefined) {\n instance[item.name] = method(\n isConstant,\n contract.methods[item.name]\n );\n }\n\n // Overloaded methods should be invoked via the .methods property\n instance.methods[signature] = method(\n isConstant,\n contract.methods[signature]\n );\n break;\n\n case \"event\":\n instance[item.name] = execute.event.call(\n constructor,\n contract.events[item.name]\n );\n break;\n }\n });\n\n // sendTransaction / send\n instance.sendTransaction = execute.send.call(\n constructor,\n null,\n null,\n instance.address\n );\n\n // Prefer user defined `send`\n if (!instance.send) {\n instance.send = (value, txParams = {}) => {\n const packet = Object.assign({value: value}, txParams);\n return instance.sendTransaction(packet);\n };\n }\n\n // Other events\n instance.allEvents = execute.allEvents.call(constructor, contract);\n instance.getPastEvents = execute.getPastEvents.call(constructor, contract);\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xedab447b;\n this.SUBCLASS_OF_ID = 0xcebaa157;\n\n this.badMsgId = args.badMsgId;\n this.badMsgSeqno = args.badMsgSeqno;\n this.errorCode = args.errorCode;\n this.newServerSalt = args.newServerSalt;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xc30aa358;\n this.SUBCLASS_OF_ID = 0x5fd82ed8;\n\n this.test = args.test || null;\n this.nameRequested = args.nameRequested || null;\n this.phoneRequested = args.phoneRequested || null;\n this.emailRequested = args.emailRequested || null;\n this.shippingAddressRequested = args.shippingAddressRequested || null;\n this.flexible = args.flexible || null;\n this.phoneToProvider = args.phoneToProvider || null;\n this.emailToProvider = args.emailToProvider || null;\n this.currency = args.currency;\n this.prices = args.prices;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x4e90bfd6;\n this.SUBCLASS_OF_ID = 0x9f89304e;\n\n this.id = args.id;\n this.randomId = args.randomId !== undefined ? args.randomId : readBigIntFromBuffer(generateRandomBytes(8),false,true);\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xfae69f56;\n this.SUBCLASS_OF_ID = 0x8680d126;\n\n this.message = args.message;\n }" ]
[ "0.63230795", "0.6299882", "0.6076653", "0.6076653", "0.6076653", "0.6076653", "0.6076653", "0.6076653", "0.6076653", "0.6076653", "0.5986646", "0.5913843", "0.5833289", "0.5726055", "0.5667258", "0.5617678", "0.5506324", "0.5486914", "0.54818", "0.54380006", "0.5355722", "0.5354096", "0.53288645", "0.525049", "0.52091146", "0.51892895", "0.5172412", "0.5144495", "0.5141361", "0.51307124", "0.51270723", "0.5121367", "0.5115554", "0.50978976", "0.50615966", "0.5034763", "0.5021037", "0.50092095", "0.49958715", "0.49958715", "0.49905598", "0.4960514", "0.49488184", "0.49330476", "0.4927017", "0.48933738", "0.48782212", "0.48631912", "0.4860622", "0.4831083", "0.48193252", "0.4810801", "0.48058987", "0.48018032", "0.47870183", "0.47816125", "0.47778115", "0.47737455", "0.47492564", "0.4744796", "0.47446433", "0.47358832", "0.47171092", "0.47066212", "0.47031188", "0.46989337", "0.46978164", "0.46956274", "0.4695076", "0.4694117", "0.46817848", "0.4678055", "0.46776173", "0.46768206", "0.4669388", "0.4668212", "0.46572614", "0.46502376", "0.46486038", "0.46386027", "0.46377668", "0.46374357", "0.46352568", "0.46300185", "0.46258205", "0.46244183", "0.46210083", "0.46195686", "0.46187955", "0.46146056", "0.4614191", "0.46141005", "0.46132058", "0.4612617", "0.46053198", "0.45983338", "0.45922706", "0.45894754", "0.45891693", "0.45880613" ]
0.7190188
0
Create a rule, will not render after stylesheet was rendered the first time. Will link the rule in `this.rules`.
createRule(name, style, options) { options = { ...options, sheet: this, jss: this.options.jss, Renderer: this.options.Renderer } // Scope options overwrite instance options. if (options.named == null) options.named = this.options.named const rule = createRule(name, style, options) // Register conditional rule, it will stringify it's child rules properly. if (rule.type === 'conditional') { this.rules[rule.selector] = rule } // This is a rule which is a child of a condtional rule. // We need to register its class name only. else if (rule.options.parent && rule.options.parent.type === 'conditional') { // Only named rules should be referenced in `classes`. if (rule.options.named) this.classes[name] = rule.className } else { this.rules[rule.selector] = rule if (options.named) { this.rules[name] = rule this.classes[name] = rule.className } } options.jss.plugins.run(rule) return rule }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createRule(selector) {\n var index = styleSheet.cssRules.length;\n styleSheet.insertRule(selector + ' {}', index);\n return styleSheet.cssRules[index];\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n }", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n}", "function linkRule(rule, cssRule) {\n\t rule.renderable = cssRule;\n\t if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n\t}", "function linkRule(rule, cssRule) {\n\t rule.renderable = cssRule;\n\t if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRules);\n\t}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n }", "function createRule() {\n\t var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n\t var decl = arguments[1];\n\t var options = arguments[2];\n\t var jss = options.jss;\n\t\n\t var declCopy = (0, _cloneStyle2['default'])(decl);\n\t\n\t var rule = jss.plugins.onCreateRule(name, declCopy, options);\n\t if (rule) return rule;\n\t\n\t // It is an at-rule and it has no instance.\n\t if (name[0] === '@') {\n\t (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n\t }\n\t\n\t return new _StyleRule2['default'](name, declCopy, options);\n\t}", "function createRule() {\n\t var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n\t var decl = arguments[1];\n\t var options = arguments[2];\n\t var jss = options.jss;\n\n\t var declCopy = (0, _cloneStyle2['default'])(decl);\n\n\t var rule = jss.plugins.onCreateRule(name, declCopy, options);\n\t if (rule) return rule;\n\n\t // It is an at-rule and it has no instance.\n\t if (name[0] === '@') {\n\t (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n\t }\n\n\t return new _StyleRule2['default'](name, declCopy, options);\n\t}", "function addStyle(rule)\r\n\t{\r\n\t\tif (!style)\r\n\t\t{\r\n\t\t\tstyle = document.createElement('style');\r\n\t\t\tstyle.setAttribute('type', 'text/css')\r\n\t\t\tstyle.setAttribute('id', 'style');\r\n\t\t\t\r\n\t\t\tvar head = document.head || document.getElementsByTagName('head')[0];\r\n\t\t\thead.appendChild(style);\r\n\t\t}\r\n\t\t\r\n\t\tstyle.appendChild(document.createTextNode(rule + \"\\n\"));\r\n\t}", "add(rule) { \n this.rules[rule.type] = rule \n rule.parser = this\n }", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n\n var declCopy = (0, _cloneStyle2['default'])(decl);\n\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule;\n\n // It is an at-rule and it has no instance.\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "insertRule(rule, opts = this.opts) {\n\t\t// save so we know what to delete if this#deleteRule is called\n\t\tconst {cssRules: {length}} = this.DOMStyleElement.sheet;\n\t\tthis.rules.push(rule);\n\t\tthis.ruleLengthCache[rule.className] = [length, rule.numRules];\n\n\t\tconst cachedRule = this.getCachedRule(rule.hash);\n\n\t\t// TODO: make this kind of thing middleware?\n\t\tlet className;\n\t\tif (!cachedRule) {\n\t\t\tthis.keyedRules[rule.hash] = rule;\n\t\t\t// className = cachedRule.incSpec(rule.className);\n\t\t}\n\n\t\treturn rule.className;\n\t}", "function createRule() {\n var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'unnamed';\n var decl = arguments[1];\n var options = arguments[2];\n var jss = options.jss;\n var declCopy = (0, _cloneStyle2['default'])(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n (0, _warning2['default'])(false, '[JSS] Unknown at-rule %s', name);\n }\n\n return new _StyleRule2['default'](name, declCopy, options);\n}", "function addCSS(rule) {\r\n\tvar styleElement = document.createElement(\"style\");\r\n\tstyleElement.type = \"text/css\";\r\n\tif (typeof styleElement.styleSheet !== 'undefined')\r\n\t\tstyleElement.styleSheet.cssText = rule;\r\n\telse\r\n\t\tstyleElement.appendChild(document.createTextNode(rule));\r\n\tdocument.getElementsByTagName(\"head\")[0].appendChild(styleElement);\r\n\t}", "function makeRule(pattern, style) {\n pattern.style = style;\n return pattern;\n}", "function addCSS(rule) {\n\tvar styleElement = document.createElement(\"style\");\n\tstyleElement.type = \"text/css\";\n\tif (typeof styleElement.styleSheet !== 'undefined')\n\t\tstyleElement.styleSheet.cssText = rule;\n\telse\n\t\tstyleElement.appendChild(document.createTextNode(rule));\n\tdocument.getElementsByTagName(\"head\")[0].appendChild(styleElement);\n\t}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') ;\n\n return null;\n }", "addRule(rule) {\n if (!this.rules[rule.input]) this.rules[rule.input] = [];\n this.rules[rule.input].push(rule);\n }", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Unknown rule \" + name) : void 0;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Unknown rule \" + name) : void 0;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) name = 'unnamed';\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n if (name[0] === '@') warning__default['default'](false, \"[JSS] Unknown rule \" + name);\n return null;\n}", "static addCSSRule(sheet, selector, rules) {\r\n if (typeof sheet.addRule === 'function') {\r\n sheet.addRule(selector, rules);\r\n }\r\n else if (typeof sheet.insertRule === 'function') {\r\n sheet.insertRule(`${selector}{${rules}}`);\r\n }\r\n }", "function createStyleRule(selector, declaration) {\n if (!document.getElementsByTagName || !(document.createElement || document.createElementNS)) return;\n var agt = navigator.userAgent.toLowerCase();\n var is_ie = ((agt.indexOf(\"msie\") != -1) && (agt.indexOf(\"opera\") == -1));\n var is_iewin = (is_ie && (agt.indexOf(\"win\") != -1));\n var is_iemac = (is_ie && (agt.indexOf(\"mac\") != -1));\n if (is_iemac) return; // script doesn't work properly in IE/Mac\n var head = document.getElementsByTagName(\"head\")[0];\n var style = (typeof document.createElementNS != \"undefined\") ? document.createElementNS(\"http://www.w3.org/1999/xhtml\", \"style\") : document.createElement(\"style\");\n if (!is_iewin) {\n var styleRule = document.createTextNode(selector + \" {\" + declaration + \"}\");\n style.appendChild(styleRule); // bugs in IE/Win\n }\n style.setAttribute(\"type\", \"text/css\");\n style.setAttribute(\"media\", \"screen\");\n head.appendChild(style);\n if (is_iewin && document.styleSheets && document.styleSheets.length > 0) {\n var lastStyle = document.styleSheets[document.styleSheets.length - 1];\n if (typeof lastStyle.addRule == \"object\") { // bugs in IE/Mac and Safari\n lastStyle.addRule(selector, declaration);\n }\n }\n}", "function toDynamicRule(rule) {\n // media query, font face, etc can only be applied when rendering\n if (rule.type === 'atrule')\n return importantizeAtRule(rule);\n\n if (rule.type === 'rule') {\n const selectors = getDynamicSelectors(rule);\n if (selectors.length > 0)\n return importantizeRule(rule.clone({ selectors }));\n }\n\n // Ignore comments and anything else that's not a rule\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}" ]
[ "0.6862027", "0.6737874", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.67223465", "0.67223465", "0.65174663", "0.6489654", "0.64626217", "0.6461894", "0.645176", "0.64292175", "0.64292175", "0.64292175", "0.64292175", "0.64292175", "0.64292175", "0.64292175", "0.64292175", "0.64292175", "0.64292175", "0.64292175", "0.64292175", "0.64292175", "0.64292175", "0.64292175", "0.64292175", "0.64292175", "0.64292175", "0.64292175", "0.64292175", "0.64292175", "0.64292175", "0.64292175", "0.64292175", "0.64292175", "0.64292175", "0.64292175", "0.64292175", "0.64292175", "0.64292175", "0.64292175", "0.63873446", "0.6287596", "0.6257121", "0.62206054", "0.6220583", "0.6212049", "0.619411", "0.6152997", "0.6152997", "0.6138314", "0.6115949", "0.61024153", "0.60998243", "0.6086743", "0.6086743", "0.6086743", "0.6086743", "0.6086743", "0.6086743", "0.6086743", "0.6086743", "0.6086743", "0.6086743", "0.6086743", "0.6086743", "0.6086743", "0.6086743" ]
0.6548749
37
Overridden to supply undefined length because it's entirely possible this is sparse.
valueSeq() { var valuesSequence = super.valueSeq(); valuesSequence.length = undefined; return valuesSequence; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set length(length) {\n\t\tthis._length = length;\n\t}", "set length(value) {}", "set length(value) {}", "get length() {\n return this._index.length;\n }", "get length() { return this._length; }", "get length() { return this._length; }", "function arrayLengthTest1() {\n var arr;\n var k;\n\n // base case\n arr = [ 1, 2, undefined, 4 ];\n print(JSON.stringify(arr));\n\n // length must be obeyed even if no elements have been added\n arr = [ 1, 2, undefined, 4 ];\n arr.length = 8;\n print(JSON.stringify(arr));\n\n arr = [ 1, 2 ];\n arr[100] = 'foo';\n arr[3] = 4;\n print(JSON.stringify(arr));\n}", "get _length () {\n return 1\n }", "get _length () {\n return 1\n }", "get length(){return undefined;}", "get length(){return undefined;}", "indexAttrSize(_) {\n if (!arguments.length)\n return this._indexAttrSize + 1000;\n this._indexAttrSize = _ - 1000;\n }", "function length1(a) {\n var len = 0;\n while (a[len] !== undefined)\n len++;\n\n}", "ensureExplicitCapacity() {\n if (this.elementData.length < this.sizeNum + 1) {\n let oldCapacity = this.elementData.length;\n let newCapacity = oldCapacity + (oldCapacity >> 1);\n this.elementData.length = newCapacity;\n }\n }", "get size() {\n return this.length;\n }", "get length() {\n return this.size;\n }", "function hasLength (data, length) {\n return assigned(data) && data.length === length;\n }", "get length() {\n return this.size\n }", "ensureCapacity(len) {\n if (len == this.#array.length) {\n let newLen = this.#array.length * 2;\n let newArr = new Array(newLen);\n for (var i = 0; i < this.#size; i++) {\n newArr[i] = this.#array[i];\n }\n this.#array = newArr;\n }\n }", "get length() {\n return this.size;\n }", "if (!this._array.hasOwnProperty(indexStart)) {\n indexStart = this._count;\n }", "get length () {\n return 1\n }", "ensureLength(l) {\n\t\tvar t = this;\n\t\tvar len = t.getLength();\n\t\tif (l + 1 > len) t.createRows(l + 1 - t.getLength(), len);\n\t}", "getLength() {\nreturn this.length;\n}", "get length() {}", "get length() {}", "constructor(size) {\r\n this.values = {};\r\n this.numberOfValues = 0;\r\n this.size = size;\r\n }", "get length() {\n return this._length;\n }", "constructor(size = 53) {\n //give our array hashtable a size of 53\n this.keyMap = new Array(size); //create our neww array\n }", "set arraySize(value) {}", "get size() {\n return this._array.length\n }", "setLenght(length) {\n this.length = length;\n }", "constructor(size=53){\n this.keyMap=new Array(size);\n }", "getLength() {\n return this.length;\n }", "get size() {\n\t\treturn this._l;\n\t}", "get size() {\n\t\treturn this._l;\n\t}", "get size() {\n\t\treturn this._l;\n\t}", "get Length()\n {\n return this._length;\n }", "size(val) {\n this._size = val;\n return this;\n }", "function incrementLength() {\n let length = _length.get( this );\n length++;\n _length.set( this, length );\n}", "constructor(offset, length) {\n super(offset, length);\n }", "get size() {return this._size;}", "set size(x){ empty.size=x}", "set size(value) {}", "get length() {\n return this._constraint.length;\n }", "constructor(size= 53) {\n this.keyMap = new Array(size)\n }", "get length(){\r\n\t\treturn this.values().length }", "get length() {\n return array.length == 0\n }", "getLength() {\n return this.length;\n }", "getLength() {\n return this.length;\n }", "constructor(initialCapacity = 10) {\n }", "size() { return 1; }", "get len(){\r\n\t\t// NOTE: if we don't do .slice() here this can count array \r\n\t\t// \t\tinstance attributes...\r\n\t\t// NOTE: .slice() has an added menifit here of removing any \r\n\t\t// \t\tattributes from the count...\r\n\t\treturn Object.keys(this.slice()).length }", "haveLength () {\n if (this._opcode < 0x08 && this.maxPayloadExceeded(this._payloadLength)) {\n return;\n }\n\n if (this._masked) this._state = GET_MASK;\n else this._state = GET_DATA;\n }", "haveLength () {\n if (this._opcode < 0x08 && this.maxPayloadExceeded(this._payloadLength)) {\n return;\n }\n\n if (this._masked) this._state = GET_MASK;\n else this._state = GET_DATA;\n }", "function rltlength () {\n}", "length() {\n let length = this.end - this.begin;\n if (length < 0) {\n length = this.doubledCapacity + length;\n }\n return length;\n }", "get length() {\n return Object.keys(this).length;\n }", "haveLength () {\n\t if (this._opcode < 0x08 && this.maxPayloadExceeded(this._payloadLength)) {\n\t return;\n\t }\n\n\t if (this._masked) this._state = GET_MASK;\n\t else this._state = GET_DATA;\n\t }", "constructor() {\n //starts array as empty\n this.length = 0;\n //capacity will be value for length of items in array + any empty spaces\n this._capacity = 0;\n //allocates the space for the length of new array, as long as there is room in memory\n this.ptr = newMem.allocate(this.length);\n }", "constructor(size = 10){\n this.keyMap = new Array(size);\n }", "function check_len(_indefinite_length, _length)\n {\n if(_indefinite_length == true)\n return 1;\n\n return _length;\n }", "haveLength () {\n if (this.opcode < 0x08 && this.maxPayloadExceeded(this.payloadLength)) {\n return;\n }\n\n if (this.masked) this.state = GET_MASK;\n else this.state = GET_DATA;\n }", "haveLength () {\n\t if (this.opcode < 0x08 && this.maxPayloadExceeded(this.payloadLength)) {\n\t return;\n\t }\n\n\t if (this.masked) this.state = GET_MASK;\n\t else this.state = GET_DATA;\n\t }", "get arraySize() {}", "constructor() {\n this.length = 0;\n this._capacity = 0;\n // Sets up the pointer where the memory is allocated\n this.ptr = memory.allocate(this.length);\n }", "constructor() {\n this._input;\n this._length;\n }", "length() {\n return this._value.length;\n }", "length(arr) {\n return arr.length;\n }", "get length() {\n return this.items.size;\n }", "get length() {\n return this.store.size;\n }", "size() {}", "get length(): number {\n // Provide a mechanism for a class to set length on push for O(1) lookup\n if (this.__length) {\n return this.__length;\n }\n\n return this._length(this.root);\n }", "get isFull() {\n return this._length === this._maxLength;\n }", "reindex() {\n let data = Object.keys(this.data).sort().reduce((acc,val,idx) => {\n acc[idx] = this.data[val];\n return acc;\n },{});\n\n this.length = Object.keys(data).length;\n this.data = data;\n }", "constructor(x, y, newLength) {\n super(x, y);\n\n let _length;\n\n this.setLength = (length) => {\n _length = length > 0 ? length : 1\n };\n\n this.getLength = () => {\n return _length;\n };\n\n this.setLength(newLength);\n }", "function DoubleArrayBuilder(initial_size) {\n this.bc = newBC(initial_size); // BASE and CHECK\n this.keys = [];\n }", "function makeArray(n) {\nthis.length = n\nreturn this\n}", "function makeArray(arrayLength)\n{\n //Solution goes here.\n}", "function dataIndexMapValueLength(valNumOrArrLengthMoreThan2) {\n\t return valNumOrArrLengthMoreThan2 == null ? 0 : valNumOrArrLengthMoreThan2.length || 1;\n\t }", "size() {\n return this.length;\n }", "size() {\n return this.length;\n }", "size() {\n return this.length;\n }", "size() {\n return this.length;\n }", "size() {\n return this.length;\n }", "size() {\n return this.length;\n }", "size() {\n return this.length;\n }", "_getKeyLength(key) {\n return key.length;\n }", "getUsedLength() {\n return this.usedLength;\n }", "get length() {\n\t\treturn this.getLength();\n\t}", "size(){ return this.size}", "sq$length() {\n return this.get$size();\n }", "sq$length() {\n return this.get$size();\n }", "sq$length() {\n return this.get$size();\n }", "_getKeyLength( key ){\n\t\treturn key.length;\n\t}", "get size() {\n return super.size;\n }", "get size() {\n return super.size;\n }", "function size() {\n\t return k;\n\t }", "setLength(length) {\n return this.copy(this.getUnit().multiply(length));\n }", "get length () {\n return this.data.length\n }", "function caml_realloc_global (len) {\n if (len + 1 > caml_global_data.length) caml_global_data.length = len + 1;\n return 0;\n}" ]
[ "0.648643", "0.64084154", "0.64084154", "0.63181126", "0.63049847", "0.63049847", "0.62740856", "0.61771405", "0.61771405", "0.6119211", "0.6119211", "0.6099573", "0.6063441", "0.5943261", "0.5908476", "0.5904925", "0.58931476", "0.58667564", "0.5856715", "0.5855682", "0.58554286", "0.5843364", "0.5836588", "0.58355284", "0.58283174", "0.58283174", "0.58249146", "0.58091", "0.57843405", "0.57801884", "0.576587", "0.5745019", "0.5740434", "0.57306147", "0.5727709", "0.5727709", "0.5727709", "0.57247996", "0.5722851", "0.57107353", "0.5665307", "0.5657192", "0.56553966", "0.5653007", "0.56443834", "0.5635174", "0.56343186", "0.56304795", "0.5622386", "0.5622386", "0.5603715", "0.5603564", "0.55828923", "0.5577789", "0.5577789", "0.5575759", "0.5573605", "0.5560141", "0.5559069", "0.5539533", "0.55326146", "0.55315274", "0.55239636", "0.55218464", "0.551664", "0.5509227", "0.5506814", "0.55032426", "0.54951507", "0.5493561", "0.54905474", "0.54825896", "0.5477651", "0.5474171", "0.54722065", "0.54680824", "0.5464972", "0.5440256", "0.5438612", "0.5425645", "0.5415574", "0.5415574", "0.5415574", "0.5415574", "0.5415574", "0.5415574", "0.5415574", "0.54154426", "0.5408055", "0.53994954", "0.53944665", "0.5394343", "0.5394343", "0.5394343", "0.5390597", "0.53905135", "0.53905135", "0.53903216", "0.538642", "0.53802365", "0.5377287" ]
0.0
-1
Overrides to get length correct.
take(amount) { var sequence = this; if (amount > sequence.length) { return sequence; } var takeSequence = sequence.__makeSequence(); takeSequence.__iterateUncached = function(fn, reverse, flipIndices) { if (reverse) { // TODO: can we do a better job of this? return this.cacheResult().__iterate(fn, reverse, flipIndices); } var taken = 0; var iterations = 0; // TODO: ensure didFinish is necessary here var didFinish = true; var length = sequence.__iterate((v, ii, c) => { if (taken++ < amount && fn(v, ii, c) !== false) { iterations = ii; } else { didFinish = false; return false; } }, reverse, flipIndices); return didFinish ? length : iterations + 1; }; takeSequence.length = this.length && Math.min(this.length, amount); return takeSequence; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get length() {}", "get length() {}", "get length() {\n\t\treturn this.getLength();\n\t}", "function getLength() {\n\t\t\treturn data.length;\n\t\t}", "get length() { return this._length; }", "get length() { return this._length; }", "getLength() {\n return this.length;\n }", "getLength() {\n return this.length;\n }", "getLength() {\n return this.length;\n }", "get length() {\n return this.size;\n }", "get length() {\n return derLength(this.payloadLen);\n }", "get Length()\n {\n return this._length;\n }", "getLength() {\nreturn this.length;\n}", "get length() {\n return this._length;\n }", "get length() {\n return this._part.length;\n }", "get length() {\n return this.size;\n }", "length() {\n let length = this.end - this.begin;\n if (length < 0) {\n length = this.doubledCapacity + length;\n }\n return length;\n }", "length() {\n return this._value.length;\n }", "get length() {\n Binder.active && Binder.recordEvent(this, 'change');\n return this.base.length;\n }", "get length() {\n return this.size\n }", "length() {\n\t\treturn this._length;\n\t}", "getOuterLength() {\n mustInherit();\n }", "getDataLength() {\n return this._dataLength;\n }", "getUsedLength() {\n return this.usedLength;\n }", "get length() {\n return this.buf.length;\n }", "getLength() {\n return 128 * (1 << this.getByte(4));\n }", "getLength() {\n\n\t\tconst lengths = this.getLengths();\n\t\treturn lengths[ lengths.length - 1 ];\n\n\t}", "getLength() {\n\n\t\tconst lengths = this.getLengths();\n\t\treturn lengths[ lengths.length - 1 ];\n\n\t}", "getDataLength() {\n return this._dataLength;\n }", "getDataLength() {\n return this._dataLength;\n }", "get size() {\n return this.length;\n }", "getLength() {\n\n\t\t\tconst lengths = this.getLengths();\n\t\t\treturn lengths[ lengths.length - 1 ];\n\n\t\t}", "getRemainingLength() {\n return this.remainingLength;\n }", "readLength() {\n const shortLength = this.readUInt8();\n if (shortLength !== constants.TNS_LONG_LENGTH_INDICATOR) {\n return shortLength;\n }\n return this.readUInt32BE();\n }", "get length() {\n var _a, _b;\n\n return (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;\n }", "get length() {\n return this._constraint.length;\n }", "get _length () {\n return 1\n }", "get _length () {\n return 1\n }", "get length () {\n return this.end-this.start;\n }", "getInnerLength() {\n mustInherit();\n }", "get length() {\n return contents.length;\n }", "getLength() {\n return this.currently.getLength();\n }", "function getLength(x) {\n return x.length\n}", "get length() {\n if (this.isDynamic) {\n return this.placeholderContext.resolve(this.allocation.size);\n }\n else {\n return this.allocation.size;\n }\n }", "_getDataLength(version, errorLevel) {\r\n const that = this;\r\n const mode = that._getEncodingMode(that.value)\r\n let bits = that._getDataBits(version, errorLevel) - 4 - that._getDataLengthBits(version);\r\n switch (mode) {\r\n case 1:\r\n return that._getNumericCapacity(bits);\r\n case 2:\r\n return that._getAlphanumericCapacity(bits);\r\n case 4:\r\n return that._getByteCapacity(bits);\r\n case 8:\r\n return that._getKanjiCapacity(bits);\r\n }\r\n }", "_getValLength( value ){\n\t\tif (isString( value )) {\n\t\t\t// if the value is a String get the real length\n\t\t\treturn value.length;\n\t\t} else if (this.options.forceString) {\n\t\t\t// force string if it's defined and not passed\n\t\t\treturn JSON.stringify( value ).length;\n\t\t} else if (isArray( value )) {\n\t\t\t// if the data is an Array multiply each element with a defined default length\n\t\t\treturn this.options.arrayValueSize * value.length;\n\t\t} else if (isNumber( value )) {\n\t\t\treturn 8;\n\t\t} else if (isObject( value )) {\n\t\t\t// if the data is an Object multiply each element with a defined default length\n\t\t\treturn this.options.objectValueSize * size( value );\n\t\t} else {\n\t\t\t// default fallback\n\t\t\treturn 0;\n\t\t}\n\t}", "function rltlength () {\n}", "length() {\r\n return this._storage.byteLength;\r\n }", "function Len() {\r\n}", "set length(value) {}", "set length(value) {}", "get length(){\r\n\t\treturn this.values().length }", "function getLength(string1){\n return string1.getLength;\n}", "get characterSize() {}", "get length() {\n return this.items.size;\n }", "get size() {\n\t\treturn this._l;\n\t}", "get size() {\n\t\treturn this._l;\n\t}", "get size() {\n\t\treturn this._l;\n\t}", "get length () {\n return 1\n }", "get length(){return undefined;}", "get length(){return undefined;}", "function readLength() {\n var byte = delta[deltaOffset++];\n var length = byte & 0x7f;\n var shift = 7;\n while (byte & 0x80) {\n byte = delta[deltaOffset++];\n length |= (byte & 0x7f) << shift;\n shift += 7;\n }\n return length;\n }", "haveLength () {\n\t if (this.opcode < 0x08 && this.maxPayloadExceeded(this.payloadLength)) {\n\t return;\n\t }\n\n\t if (this.masked) this.state = GET_MASK;\n\t else this.state = GET_DATA;\n\t }", "get length () {\n return this.data.length\n }", "function getLength(input){\n return input.length;\n}", "haveLength () {\n\t if (this._opcode < 0x08 && this.maxPayloadExceeded(this._payloadLength)) {\n\t return;\n\t }\n\n\t if (this._masked) this._state = GET_MASK;\n\t else this._state = GET_DATA;\n\t }", "getLength(callback) {\n const cb = (err, length) => {\n if (err || !Number.isNaN(length)) {\n callback(err, length);\n }\n else {\n callback(null, null);\n }\n };\n super.getLength(cb);\n }", "get size() {}", "get length() {\n return this.content && this.content.length !== undefined ? this.content.length : 0;\n }", "function getLength(something) {\n return something.length;\n}", "get length() {\n return Math.sqrt(Math.pow(this.x, 2) + Math.pow(this.y, 2));\n }", "function calcLengthLength (length) {\n\t if (length >= 0 && length < 128) return 1\n\t else if (length >= 128 && length < 16384) return 2\n\t else if (length >= 16384 && length < 2097152) return 3\n\t else if (length >= 2097152 && length < 268435456) return 4\n\t else return 0\n\t}", "get size() {\n return this._array.length\n }", "get length() {\n return this._index.length;\n }", "get getBodyLength(){\n\t\treturn this.body.length;\n\t}", "get length() {\n\t\treturn this.items.length;\n\t}", "haveLength () {\n if (this.opcode < 0x08 && this.maxPayloadExceeded(this.payloadLength)) {\n return;\n }\n\n if (this.masked) this.state = GET_MASK;\n else this.state = GET_DATA;\n }", "getBackendFullLen(len){\n\treturn (1+ 2*this.margin_percent/100) * len;\n }", "get arraySize() {}", "length() {\n return this.notes.length;\n }", "haveLength () {\n if (this._opcode < 0x08 && this.maxPayloadExceeded(this._payloadLength)) {\n return;\n }\n\n if (this._masked) this._state = GET_MASK;\n else this._state = GET_DATA;\n }", "haveLength () {\n if (this._opcode < 0x08 && this.maxPayloadExceeded(this._payloadLength)) {\n return;\n }\n\n if (this._masked) this._state = GET_MASK;\n else this._state = GET_DATA;\n }", "get length () {\n let length = 0;\n let n = this._start;\n while (n !== null) {\n if (!n._deleted && n._countable) {\n length += n._length;\n }\n n = n._right;\n }\n return length\n }", "get length() { return this.to - this.from; }", "function getLength(i) {\n return i.length;\n}", "size() {\n return this.data.length;\n }", "function length() {\n\treturn this.listSize;\n}", "_getKeyLength( key ){\n\t\treturn key.length;\n\t}", "function getLength(){\r\n return keyTable.length;\r\n }", "get len(){\r\n\t\t// NOTE: if we don't do .slice() here this can count array \r\n\t\t// \t\tinstance attributes...\r\n\t\t// NOTE: .slice() has an added menifit here of removing any \r\n\t\t// \t\tattributes from the count...\r\n\t\treturn Object.keys(this.slice()).length }", "length(){\n return this.qLength;\n }", "get length(): number {\n // Provide a mechanism for a class to set length on push for O(1) lookup\n if (this.__length) {\n return this.__length;\n }\n\n return this._length(this.root);\n }", "get size() {\n\t\treturn this._size;\n\t}", "sizeOf() {\n return this.size;\n }", "_getKeyLength(key) {\n return key.length;\n }", "get size() {\n if (this._available && this._available.length > 0) {\n return this._available.length;\n }\n if (this._pending && this._pending.length > 0) {\n return -this._pending.length;\n }\n return 0;\n }", "get length() {\n return this.request(`${this.prefix}line_count`, []);\n }", "function calcLengthLength (length) {\n if (length >= 0 && length < 128) return 1\n else if (length >= 128 && length < 16384) return 2\n else if (length >= 16384 && length < 2097152) return 3\n else if (length >= 2097152 && length < 268435456) return 4\n else return 0\n}", "function calcLengthLength (length) {\n if (length >= 0 && length < 128) return 1\n else if (length >= 128 && length < 16384) return 2\n else if (length >= 16384 && length < 2097152) return 3\n else if (length >= 2097152 && length < 268435456) return 4\n else return 0\n}", "function length(val) {\n return val.toString().length;\n}", "function length(val) {\n return val.toString().length;\n}" ]
[ "0.81764436", "0.81764436", "0.815856", "0.7982924", "0.79270107", "0.79270107", "0.7896725", "0.7896725", "0.78867817", "0.7884087", "0.7846043", "0.780714", "0.7713117", "0.76629823", "0.7629956", "0.75790644", "0.7578405", "0.7578231", "0.7531723", "0.7526828", "0.75267667", "0.7454988", "0.7419665", "0.7408687", "0.73892653", "0.7358486", "0.7352579", "0.7352579", "0.73431486", "0.73431486", "0.73251826", "0.7322656", "0.7306562", "0.72894716", "0.72665083", "0.72534376", "0.72498935", "0.72498935", "0.7201474", "0.7190233", "0.71883696", "0.7187029", "0.7173116", "0.71622723", "0.7147029", "0.71329737", "0.7131692", "0.71118194", "0.7110062", "0.70913655", "0.70913655", "0.70851445", "0.708327", "0.7076512", "0.7069422", "0.7037023", "0.7037023", "0.7037023", "0.70357776", "0.70256793", "0.70256793", "0.7023172", "0.7021206", "0.70114046", "0.6985054", "0.6981518", "0.69685334", "0.694501", "0.69364536", "0.69340533", "0.6912027", "0.69074684", "0.69009465", "0.68975234", "0.6889391", "0.68844455", "0.6870944", "0.68707603", "0.6867795", "0.68669987", "0.68345195", "0.68345195", "0.6822561", "0.6814693", "0.6803787", "0.68009335", "0.6799456", "0.6794727", "0.679363", "0.67868626", "0.6784589", "0.6782204", "0.6782026", "0.6780718", "0.67781717", "0.67751664", "0.67668253", "0.67607236", "0.67607236", "0.6748698", "0.6748698" ]
0.0
-1
abstract __iterateUncached(fn, reverse, flipIndices)
__makeSequence() { return makeIndexedSequence(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function eachReverse(array, fn) {\n var i = array.length;\n while (i--) {\n fn(array[i], i);\n }\n}", "* [Symbol.iterator]() {\n\t\tfor (const item of this.cache) {\n\t\t\tyield item;\n\t\t}\n\n\t\tfor (const item of this.oldCache) {\n\t\t\tconst [key] = item;\n\t\t\tif (!this.cache.has(key)) {\n\t\t\t\tyield item;\n\t\t\t}\n\t\t}\n\t}", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t\t for (; index >= 0 && index < length; index += dir) {\n\t\t var currentKey = keys ? keys[index] : index;\n\t\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t\t }\n\t\t return memo;\n\t\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t\t for (; index >= 0 && index < length; index += dir) {\n\t\t var currentKey = keys ? keys[index] : index;\n\t\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t\t }\n\t\t return memo;\n\t\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n\t for (; index >= 0 && index < length; index += dir) {\n\t var currentKey = keys ? keys[index] : index;\n\t memo = iteratee(memo, obj[currentKey], currentKey, obj);\n\t }\n\t return memo;\n\t }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function make_reverse_iterator(it) {\r\n return it.reverse();\r\n}", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n}", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function iterator(obj, iteratee, memo, keys, index, length) {\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n //这里用户自定义的回调执行之后,赋值给memo 所以也就明确了在用户层 回调函数的 return 是必须的\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n }", "function eachReverse(e,t){if(e){var i;for(i=e.length-1;i>-1&&(!e[i]||!t(e[i],i,e));i-=1);}}" ]
[ "0.6122174", "0.6021834", "0.59368086", "0.59368086", "0.59023947", "0.59023947", "0.59023947", "0.59023947", "0.59023947", "0.59023947", "0.59023947", "0.59023947", "0.59023947", "0.59023947", "0.59023947", "0.59023947", "0.59023947", "0.59023947", "0.59023947", "0.59023947", "0.59023947", "0.59023947", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.58775276", "0.5850238", "0.58472735", "0.5837261", "0.5837261", "0.5833553", "0.5827976", "0.5827976", "0.5827976", "0.57558674", "0.57110155" ]
0.0
-1
Sequence.prototype.filter and IndexedSequence.prototype.filter are so close in behavior that it makes sense to build a factory with the few differences encoded as booleans.
function filterFactory(sequence, predicate, thisArg, useKeys, maintainIndices) { var filterSequence = sequence.__makeSequence(); filterSequence.__iterateUncached = (fn, reverse, flipIndices) => { var iterations = 0; var length = sequence.__iterate((v, k, c) => { if (predicate.call(thisArg, v, k, c)) { if (fn(v, useKeys ? k : iterations, c) !== false) { iterations++; } else { return false; } } }, reverse, flipIndices); return maintainIndices ? length : iterations; }; return filterSequence; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "filter(keepIf) {\n const self = this;\n return new Seq(function* () {\n for (const element of self)\n if (keepIf(element))\n yield element;\n });\n }", "function bouncer2(arr) {\n return arr.filter(Boolean)\n}", "function falsyFilter(){\nfor(var i = 0; i < mixedArray.length; i++) {\n if(mixedArray === true || mixedArray === \"true\" || mixedArray !== false)\n\t {mixedArray.slice(i, 1)}\n else return mixedArray;\n}\n}", "function filter (gen, predicate) {\n return function () {\n var value;\n do {\n value = gen();\n } while (\n value !==undefined &&\n !predicate(value)\n );\n return value;\n };\n\n}", "function bouncer(arr) {\n return arr.filter(function(val) {\n return Boolean(val);\n });\n}", "function bouncer(arr) {\n return arr.filter((val) => Boolean(val));\n}", "function Nothing$prototype$filter(pred) {\n return this;\n }", "function filter(pred) {\n return function(rf) { // <- buildArray for example, but also the function in map on line 82\n return function(result, item) {\n if(pred(item))\n return rf(result, item)\n else\n return result\n }\n }\n}", "function bouncer(arr) {\n return arr.filter(val => Boolean(val));\n}", "function itemized(values) {\n return function (seed) {\n return values.filter(function (v, i) {\n return flag(seed, i);\n });\n };\n}", "function bouncer(arr) {\n return arr.filter(Boolean); \n}", "function filter(pred) {\n return function(xs) {\n return Z.filter (pred, xs);\n };\n }", "function bouncer(arr) {\n return arr.filter((item) => {\n return Boolean(item);\n });\n }", "function falsyFilter(){\n for(var i = 0; i < mixedArray.length; i++){\n\tif(mixedArray[i] === false)\n {mixedArray.splice(i, 1)};\n\treturn mixedArray;\n }\n}", "function $FHml$var$filter(xs, f) {\n if (xs.filter) return xs.filter(f);\n var res = [];\n\n for (var i = 0; i < xs.length; i++) {\n if (f(xs[i], i, xs)) res.push(xs[i]);\n }\n\n return res;\n}", "function myFilter(arr, f){\n let ans = [] ;\n\n for(let i = 0; i < arr.length; i++){\n if(f(arr[i]) == true){\n ans.push(arr[i]) ;\n }\n }\n return ans ;\n}", "function Array$prototype$filter(pred) {\n return this.filter (function(x) { return pred (x); });\n }", "function bouncerBool(arr) {\n let newArr = arr.filter(Boolean);\n return newArr;\n}", "afilter (callback) {\n return this.asArray().filter(callback)\n }", "function filter(array, f) {\n if (array) {\n var len = array.length;\n var i = 0;\n while (i < len && f(array[i]))\n i++;\n if (i < len) {\n var result = array.slice(0, i);\n i++;\n while (i < len) {\n var item = array[i];\n if (f(item)) {\n result.push(item);\n }\n i++;\n }\n return result;\n }\n }\n return array;\n }", "function bouncer(arr) {\n return arr.filter(Boolean);\n}", "function bouncer(arr) {\n return arr.filter(Boolean);\n}", "function bouncer(arr) {\n return arr.filter(Boolean);\n}", "function bouncer(arr) {\n return arr.filter(Boolean);\n}", "function bouncer(arr) {\n return arr.filter(Boolean);\n}", "function bouncer(arr) {\r\n return arr.filter(Boolean);\r\n}", "static *_filter(iterator, predicate) {\n\t for (let value of iterator) {\n\t if (predicate(value)) {\n\t yield value;\n\t }\n\t }\n\t }", "filter(predicate) {\n return new FilterIterator(this, predicate);\n }", "filter() {\n\t}", "filter() {\n\t}", "function filter(list, predicateFn) {\n\n}", "function testcase() {\n \n function callbackfn(val, idx, obj){\n if(val % 2)\n return true; \n else\n return false;\n }\n var srcArr = [0,1,2,3,4];\n var resArr = srcArr.filter(callbackfn);\n if (resArr.length > 0){\n var desc = Object.getOwnPropertyDescriptor(resArr, 1) \n if(desc.value === 3 && //srcArr[1] = true\n desc.writable === true &&\n desc.enumerable === true &&\n desc.configurable === true){\n return true;\n }\n }\n }", "function returnBoo (arr) { \n\treturn arr.filter(function(element){\n\t\treturn typeof element === \"boolean\";\n\t})\n}", "function Predicate () {}", "function filterPassing(array) {\n let filter = array.filter(array => array.passed === true);\n return filter\n}", "function Predicate() {}", "function Predicate() {}", "function Predicate() {}", "function bouncer(arr) {\r\n return arr.filter(Boolean);\r\n }", "function Predicate(t) { return Fn (t) (Boolean_); }", "static generateFiltersFunction(filters) {\n if (!filters || !filters.length && !filters.count) {\n return FunctionHelper.returnTrue;\n }\n\n return function (candidate) {\n let match = true;\n\n for (const filter of filters) {\n // Skip disabled filters\n if (!filter.disabled) {\n match = filter.filter(candidate);\n }\n\n if (!match) {\n break;\n }\n }\n\n return match;\n };\n }", "static generateFiltersFunction(filters) {\n if (!filters || (!filters.length && !filters.count)) {\n return FunctionHelper.returnTrue;\n }\n\n return function(candidate) {\n let match = true;\n\n for (const filter of filters) {\n // Skip disabled filters\n if (!filter.disabled) {\n match = filter.filter(candidate);\n }\n if (!match) {\n break;\n }\n }\n\n return match;\n };\n }", "constructor( known){\n\t\tvar\n\t\t _primitives= [],\n\t\t _objects= new WeakSet(),\n\t\t _wasPrimitive // out of band data pass from has back to filter\n\t\tsuper( UnknownFilter.prototype.filter)\n\n\t\t// expose our state as not enumerable properties\n\t\tObject.defineProperties(this, {\n\t\t\t_primitives: {\n\t\t\t\tvalue: _primitives\n\t\t\t},\n\t\t\t_objects: {\n\t\t\t\tvalue: _objects\n\t\t\t},\n\t\t\t_wasPrimitive: {\n\t\t\t\tvalue: _wasPrimitive,\n\t\t\t\twritable: true\n\t\t\t}\n\t\t})\n\n\t\t// add all the known things\n\t\tif( known&& typeof known!== \"string\"&& known[ Symbol.iterator]){\n\t\t\ttry{\n\t\t\t\tfor( var o of existing){\n\t\t\t\t\tthis.filter( o)\n\t\t\t\t}\n\t\t\t}catch(err){\n\t\t\t\tthis.filter( existing)\n\t\t\t}\n\t\t}\n\t}", "function filter(arr, fn) {\n\tlet test = [];\n\tfor(let item of arr){\n\t\tif(fn(item)){\n\t\t\ttest.push(item);\n\t\t}\n\t\n\t}\n\treturn test;\n}", "function filter(a, cb) {\n var n = [];\n each(a, function (v) {\n if (cb(v)) {\n n.push(v);\n }\n });\n return n;\n}", "function filter(arr, fn) {\n let newArray = [];\n\n for (let i=0; i<arr.length; i++){\n if(fn(arr[i]) === true){\n newArray.push(arr[i]);\n }\n }\n return newArray;\n}", "function compact(array) {\n return filter(array, Boolean);\n }", "function compact(array) {\n return filter(array, Boolean);\n }", "function compact(array) {\n return filter(array, Boolean);\n }", "function compact(array) {\n return filter(array, Boolean);\n }", "function compact(array) {\n return filter(array, Boolean);\n }", "function compact(array) {\n return filter(array, Boolean);\n }", "function compact(array) {\n return filter(array, Boolean);\n }", "function compact(array) {\n return filter(array, Boolean);\n }", "function compact(array) {\n return filter(array, Boolean);\n }", "function filter(arr, fn) {\n let newArray = [];\n\n arr.forEach(element => { if (fn(element) === true) {\n newArray.push(element);\n }\n });\n\n return newArray;\n}", "function filter(array, test) {\r\n\tlet passed = [];\r\n\tfor(let element of array) {\r\n\t\tif(test(element)) {\r\n\t\t\tpassed.push(element);\r\n\t\t}\r\n\t}\r\n\treturn passed;\r\n}", "function filter(arr, fn) {\n let newArray = [];\n for (i=0; i<arr.length; i++) {\n if(fn(arr[i])===true) {\n newArray.push(arr[i]);\n }\n }\n return newArray;\n}", "function Predicate(){}", "function filter (array,fn) {\n return array.filter(fn)\n}", "function trueValues(arr) {\n\n arr = arr.filter(Boolean);\n}", "function filterExample(arr) {\n const even = (num) => {\n if (num % 2 == 0) {\n return num\n }\n };\n const odd = (num) => {\n if (num % 2 != 0) {\n return num\n }\n };\n console.log(arr.filter(even));\n console.log(arr.filter(odd));\n\n}", "function bouncer(arr) {\n return arr.filter((x) => { // x iterates through arr and only returns values that are not false\n if (x != false) {\n return x;\n }\n });\n}", "function filter(coll, f){\n //create true accu\n var acc = [];\n each(coll, function(element, index ){\n if(f(element)){\n acc.push(element);\n }\n });\n return acc;\n}", "function filter(a, cb) {\n const n = [];\n each(a, function(v) {\n if (cb(v)) {\n n.push(v);\n }\n });\n return n;\n}", "function bouncer(arr) {\n // Don't show a false ID to this bouncer.\n \n function falseValues(value) {\n if (Boolean(value)) {\n return true;\n } else {\n return false;\n }\n }\n \n var trueValues = arr.filter(falseValues);\n\n return trueValues;\n}", "function demo012(){\n let data = Immutable.Seq({a:1,b:2,c:3,d:4}).filter(x => x % 2 === 0) ;\n console.info(data) ;\n}", "filter(predicate) {\n\t this._iterator = Enumerable._filter(this._iterator, predicate);\n\t return this;\n\t }", "filter(func) {\n let reArr = [];\n this.each((item) => {\n func(item) ? reArr.push(item) : null;\n });\n return new DomQuery(...reArr);\n }", "filter(func) {\n let reArr = [];\n this.each((item) => {\n func(item) ? reArr.push(item) : null;\n });\n return new DomQuery(...reArr);\n }", "function Filter(method) {\n this.truthy = true;\n this.method = method;\n}", "function sc_filter(proc, l1) {\n var dummy = { cdr : null };\n var tail = dummy;\n while (l1 !== null) {\n\tif (proc(l1.car) !== false) {\n\t tail.cdr = sc_cons(l1.car, null);\n\t tail = tail.cdr;\n\t}\n\tl1 = l1.cdr;\n }\n return dummy.cdr;\n}", "function filter(filter) { return new Filter(filter); }", "dropWhile(predicate) {\n const self = this;\n return new Seq(function* () {\n const iter = self[Symbol.iterator]();\n while (true) {\n const { value, done } = iter.next();\n if (done)\n break;\n if (!predicate(value)) {\n yield value;\n yield* iterableOfIterator(iter);\n }\n }\n });\n }", "function filterAsync(array, predicate, thisArg) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n var verdicts;\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, Promise.all(array.map(predicate, thisArg))];\n case 1:\n verdicts = _a.sent();\n return [2 /*return*/, array.filter(function (_, index) { return verdicts[index]; })];\n }\n });\n });\n}", "function filter() {\n \n}", "function filter(array, test) { // filters through an array\n var passed = []; // holds the passed elements of the test\n for (var i = 0; i < array.length; i++) { // goes through the length of the array\n if (test(array[i])) { // if the element passes the test\n passed.push(array[i]); // put it in the new array\n }// end of if \n }// end of for loop\n return passed; // return the array with the passes elements\n}// end of function", "function filterAsync(array, predicate, thisArg) {\r\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function () {\r\n var verdicts;\r\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__generator\"])(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n return [4 /*yield*/, Promise.all(array.map(predicate, thisArg))];\r\n case 1:\r\n verdicts = _a.sent();\r\n return [2 /*return*/, array.filter(function (_, index) {\r\n return verdicts[index];\r\n })];\r\n }\r\n });\r\n });\r\n}", "function filter(pred, xs){\n if (is_empty_list(xs)) {\n return xs;\n } else {\n if (pred(head(xs))) {\n return pair(head(xs), filter(pred, tail(xs)));\n } else {\n return filter(pred, tail(xs));\n }\n }\n}", "function filter(lambda,array) {\n var newArray = new Array()\n for(var i = 0; i < array.length; i++) {\n if(lambda(array[i])) newArray.push(array[i])\n }\n return newArray\n}", "function filter(array, test) {\n var passed = [];\n for (var i = 0; i < array.length; i++) {\n if (test(array[i])) {\n passed.push(array[i]);\n }\n }\n\n return passed;\n}", "function truthTest(name, test) {\n return function(chunk, context, bodies, params) {\n return filter(chunk, context, bodies, params, name, test);\n };\n}", "filter(predicate, thisArg = undefined) {\n const ret = new Arr();\n let i = 0;\n for (let p in this)\n if (predicate.call(thisArg, this[p], i++, this))\n ret.push(this[p]);\n return ret;\n }", "function filter(arr, fn) {\n let newArray = [];\n for (const item of arr) {\n if (fn(item)) newArray.push(item);\n }\n return newArray;\n}", "function Predicate() { }", "function Predicate() { }", "function filter(array, test) {\n let passed = [];\n for (let element of array) {\n if (test(element)) {\n passed.push(element);\n }\n }\n return passed;\n}", "function filter(array, test){\n let passed = [];\n for(let element of array){\n if(test(element)){\n passed.push(element);\n }\n }\n return passed;\n}", "function ff(a, b, c, d, x, s, t) {\n return collect((b & c) | ((~b) & d), a, b, x, s, t);\n}", "function handmadeFilter(list,f) {\n var result = [];\n for (var i in list) {\n if (f(list[i])) { result.push(list[i]) };\n }\n return result;\n}", "filter(callback) {\r\n const filteredItems = new MyArray();\r\n this.forEach((item) => {\r\n if (callback(item)) filteredItems.push(item)\r\n })\r\n return filteredItems;\r\n }", "function filter(arr, fn) {\n let results = [];\n\n // iterate over the array\n // apply the function to that specific element\n // add it to my results array if it's true\n // or leave it out if it's false\n for (let element of arr) {\n let result = fn(element);\n\n if (result == true) {\n results.push(element);\n }\n }\n\n return results;\n}", "function filter(array, test) {\n let passed = [];\n for (let element of array) {\n if (test(element)) {\n passed.push(element);\n }\n }\n\n return passed;\n}", "function FilterIterator(source, fn) {\n this._index = 0;\n this._source = source;\n this._fn = fn;\n }", "function filter(arr, fn) {\n let newArray = [];\n\n for (let elem of arr) {\n if(fn(elem)) newArray.push(elem);\n }\n\n return newArray;\n}", "function truthTest(name, test) {\n return function(chunk, context, bodies, params) {\n return filter(chunk, context, bodies, params, name, test);\n };\n }", "function bouncer(arr) {\n\n var holderArray = [];\n //calls filter to run removeFalseVar method\n holderArray = arr.filter(removeFalseVar);\n\n return holderArray;\n}", "function truthTest(name, test) {\n return function (chunk, context, bodies, params) {\n return filter(chunk, context, bodies, params, name, test);\n };\n }", "function cs142MakeMultiFilter(originalArray) {\n let currentArray = originalArray.slice();\n return function arrayFilterer(filterCriteria, callback) {\n if (typeof(filterCriteria) !== \"function\") {\n return currentArray;\n }\n for (let i = currentArray.length - 1; i >= 0; i--) {\n if (!filterCriteria(currentArray[i])) {\n currentArray.splice(i, 1);\n }\n }\n if (typeof(callback) === \"function\") {\n callback.call(originalArray, currentArray);\n }\n return arrayFilterer;\n };\n}", "function filter(array,test){\n //Create a new array to populate and return\n let passed = [];\n //Apply the test to each element of the array, if passes add to return array\n for(let element of array){\n if(test(element)){\n passed.push(element);\n }\n }\n return passed;\n}" ]
[ "0.6230247", "0.6189363", "0.6102953", "0.60412955", "0.59969646", "0.5978879", "0.59539735", "0.59510285", "0.5937768", "0.5931186", "0.59292996", "0.5904279", "0.5903832", "0.5887538", "0.5823944", "0.5800472", "0.5781253", "0.57788664", "0.5776585", "0.57582664", "0.57461923", "0.57461923", "0.57461923", "0.57461923", "0.57461923", "0.57398975", "0.5738588", "0.56864065", "0.56845194", "0.56845194", "0.56551105", "0.5640127", "0.56161386", "0.5592242", "0.55842197", "0.5574829", "0.5574829", "0.5574829", "0.55739605", "0.5560181", "0.5523376", "0.5515391", "0.5496348", "0.5495966", "0.5495361", "0.54943943", "0.5492594", "0.5492594", "0.5492594", "0.5492594", "0.5492594", "0.5492594", "0.5492594", "0.5492594", "0.5492594", "0.54765725", "0.547137", "0.5460531", "0.5459455", "0.5453681", "0.54393303", "0.5434308", "0.5431883", "0.5431264", "0.54194903", "0.54003054", "0.53991556", "0.5376825", "0.5376651", "0.5376651", "0.5373603", "0.53656685", "0.5362973", "0.5359012", "0.5357099", "0.5356937", "0.534517", "0.53420377", "0.53198856", "0.5319068", "0.5316836", "0.5311099", "0.5306485", "0.5304972", "0.5304933", "0.5304933", "0.530026", "0.53002304", "0.5299145", "0.5297951", "0.52932906", "0.5286562", "0.5279233", "0.5275645", "0.5272753", "0.5272533", "0.52700657", "0.5268327", "0.52682644", "0.52679366" ]
0.6928207
0
extends super class constructor
constructor() { super(); this.windows = 4; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructur() {}", "constructor(a, b, c) {\n super(a, b, c);\n }", "constructor() {\n\t\tsuper(...arguments);\n\t}", "constructor() { super() }", "constructor (){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor () { super() }", "constructor( ) {}", "constructor(...args) {\n super(...args);\n \n }", "constructor(args, opts) {\n super(args, opts);\n}", "constructor(args) {\n super(args);\n }", "constructor(args) {\n super(args);\n }", "constructor() {\n super(null, null, 0, 0, 0, 0, 0);\n }", "function Constructor() {}", "function Constructor() {}", "function Constructor() {}", "constructor(x, y, z){\n super(x, y, z);\n }", "constructor(x,y){\n super(x,y);\n }", "constructor () {\n // Run super\n super();\n }", "constructor () {\n // Run super\n super();\n }", "constructor() {\n\t\t// ...\n\t}", "function _construct()\n\t\t{;\n\t\t}", "constructor(data = {}) {\n super(data);\n \n this.init(data);\n }", "constructor(value){\n //\n //Construct the parent.\n super(value);\n }", "function Constructor() {\n // All construction is actually done in the init method\n if ( this.initialize )\n this.initialize.apply(this, arguments);\n }", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor(opts) {\n super(opts);\n }", "constructor(params) {\n super(params);\n\n const oThis = this;\n }", "constructor() {\n super();\n this._init();\n }", "constructor() {\n super()\n self = this\n self.init()\n }", "constructor() {\r\n // ohne Inhalt\r\n }", "constructor() {\r\n super()\r\n this.init()\r\n }", "constructor(name,age,major){\n //this is initialize parent class\n super(name,age);\n this.major=major\n }", "constructor(){\r\n\t}", "consructor() {\n }", "constructor() {\r\n super();\r\n }", "constructor() {\r\n super();\r\n }", "constructor() {\r\n super();\r\n }", "constructor() {\r\n super();\r\n }", "constructor() {\r\n super();\r\n }", "constructor() {\r\n super();\r\n }", "constructor() {\r\n super();\r\n }", "constructor() {\r\n super();\r\n }", "constructor() {\r\n super();\r\n }", "constructor() {\r\n super();\r\n }", "constructor() {\r\n super();\r\n }", "constructor() {\r\n super();\r\n }", "constructor()\n {\n super();\n }", "constructor(){\n\t\tsuper(null);\n\t}", "__previnit(){}", "constructor(props) {\n super(props);\n //@TODO\n }", "constructor( args ) {\n\t\t\t\tsuper( args );\n\t\t\t}", "constructor(data) {\n super(data);\n }", "constructor() {\n super();\n }", "constructor() {\n\n\t\tsuper();\n\n\t}", "constructor() {\n super()\n }", "constructor() {\n super(null);\n }", "constructor(name, age, major = ''){ //we don't have to set default values used in parent class\n super(name, age); //take values from parent Class (super = parent class object)\n this.major = major;\n }", "constructor() { }", "constructor() { }", "constructor() { }" ]
[ "0.82251936", "0.79075104", "0.7902193", "0.78449553", "0.7842001", "0.77767575", "0.77767575", "0.77767575", "0.77767575", "0.77767575", "0.77767575", "0.77767575", "0.7743238", "0.77415466", "0.77376467", "0.7679964", "0.76201963", "0.76201963", "0.7551389", "0.7537723", "0.7537723", "0.7537723", "0.75152946", "0.7511028", "0.7478851", "0.7478851", "0.74352956", "0.742499", "0.7381372", "0.7372693", "0.731622", "0.7301271", "0.7301271", "0.7301271", "0.7301271", "0.7301271", "0.7301271", "0.7301271", "0.7301271", "0.7301271", "0.7301271", "0.7301271", "0.7301271", "0.7301271", "0.7301271", "0.7301271", "0.7301271", "0.7301271", "0.7301271", "0.7301271", "0.7301271", "0.7301271", "0.7301271", "0.7301271", "0.7301271", "0.7301271", "0.7301271", "0.7301271", "0.7301271", "0.7301271", "0.7301271", "0.7301271", "0.7301271", "0.7301271", "0.7301271", "0.7301271", "0.7286266", "0.72826296", "0.7265822", "0.72470367", "0.7227886", "0.72076786", "0.71730465", "0.7167359", "0.7166053", "0.7159256", "0.7159256", "0.7159256", "0.7159256", "0.7159256", "0.7159256", "0.7159256", "0.7159256", "0.7159256", "0.7159256", "0.7159256", "0.7159256", "0.7142933", "0.71398693", "0.7136357", "0.7124076", "0.71174526", "0.7117295", "0.71166784", "0.7114977", "0.7114078", "0.7107303", "0.7106067", "0.7085033", "0.7085033", "0.7085033" ]
0.0
-1
================ DRAW EFFECTS ====================
function initEffects(){ w = $("#effects").width(); h = $("#effects").height(); effectsCanvas = document.getElementById("effects"); effectsCanvas.width = w; effectsCanvas.height = h; effectsContext = effectsCanvas.getContext("2d"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "drawEffect() {\n var effect = this.decideParticleEffect();\n if (effect)\n this.game.addEntity(effect);\n }", "draw() {\n this.drawExistingEntities();\n this.disableEntities();\n this.blockHeroMovement();\n this.killedEnemiesCounter();\n }", "function draw(){\r\n\trequestAnimationFrame(draw);\r\n\tif (!detectedMouse && (new Date()-loadTimeStamp) > 3000){\r\n\t\thasMouse = false;\r\n\t}\r\n\tctx.fillRect(0,0,canvas.width,canvas.height);\r\n\tctx.drawImage(image,30,30);\r\n\tfor(var i = 0; i < menuItemFunctions.length; i++)\r\n\t\tmenuItemFunctions[i]();\r\n\tcanvasEffect();\r\n\tdrawSquares();\r\n}", "function draw() {\n\t\tfor (var i = 0; i < loop.graphics.length; i++) {\n\t\t\tloop.graphics[i](graphics, 0.0);\n\t\t}\n\t}", "function draw() {\n\t//clear the board\n\tctx.clearRect(0, 0, canvas[0].width, canvas[0].height);\n\n\t//draw the player\n\tplayer.draw(ctx);\n\n\t//draw the turrets\n\t$.each(turrets, function(i,turr) {\n\t\tturr.draw(ctx);\n\t});\n\n\t//draw the projectiles\n\t$.each(projectiles, function(i,proj) {\n\t\tproj.draw(ctx);\n\t});\n\n\t//draw the effects\n\t//make sure damaging effects are on top\n\tvar damagingEffects = [];\n\t$.each(effects, function(i,eff) {\n\t\tif (eff.getDoesDamage()) {\n\t\t\tdamagingEffects.push(eff);\n\t\t} else {\n\t\t\teff.draw(ctx);\n\t\t}\n\t});\n\n\t$.each(damagingEffects, function(i,eff) {\n\t\teff.draw(ctx);\n\t});\n}", "function draw() {\n Gravity();\n Animation();\n FrameBorder(); \n FrameBorderCleaner();\n Controls();\n Interaction();\n}", "updateEffects(){\n for (let i = 0; i < this.actions.length; i++) {\n\t\t\tlet action = this.actions[i];\n\n\t\t\tif (action.hasBeenTaken()) {\n\t\t\t\tthis.effects.addAction(this.actions[i]);\n\t\t\t\taction.toggleTaken();\n\t\t\t}\n\t\t}\n }", "draw() {\n this.loop(DrawableArray.drawFunction);\n }", "draw() {\n this.loop(DrawableArray.drawFunction);\n }", "draw() {\n this.loop(DrawableArray.drawFunction);\n }", "function drawStatus(){\nif(shaman.hp<0) shaman.hp = 0;\nif(shaman.mp<0) shaman.mp = 0;\n\tvar cur_hp = shaman.hp/shaman.max_hp*200;\n\tvar cur_mp = shaman.mp/shaman.max_mp*200;\n\tctx.fillStyle = \"grey\";\n\tctx.strokeStyle = \"black\";\n\tctx.lineWidth = 2;\n\tctx.fillRect(0, 500, 800, 600);\n\tctx.fillStyle = \"red\";\n\tctx.fillRect(190, 505, cur_hp, 10);\n\tctx.strokeRect(190, 505, 200, 10);\n\tctx.fillStyle = \"blue\";\n\tctx.fillRect(610-cur_mp, 505, cur_mp, 10);\n\tctx.strokeRect(410, 505, 200, 10);\n\tctx.fillStyle = \"white\";\n\tctx.font = \"bold 15 px sans-serif\";\n\tctx.fillText(\"Stage: \"+(cStage+1), 1, 515);\n\tctx.fillText(\"Wave: \"+wave, 68, 515);\n\tctx.fillText(\"Total Score: \"+TotalScore, 650, 520)\t\t\n\tfor(var i = 0; i<shaman.debuffs.length; i++)\n\t\tshaman.debuffs[i].draw(i);\n}", "function draw() {}", "function draw() {}", "function draw(){\r\n ctx.fillStyle = '#70c5ce';\r\n ctx.fillRect(0, 0, cWidth, cHeight);\r\n bg.draw();\r\n pipes.draw();\r\n fg.draw();\r\n kca.draw();\r\n bird.draw();\r\n getReady.draw();\r\n gameOver.draw();\r\n score.draw();\r\n \r\n\r\n}", "doDraw() {\n console.log(\"big game over\");\n draw_context.fillStyle = \"#000F\";\n draw_context.fillRect(0,0, canvas_element.width,canvas_element.height);\n draw_context.lineWidth = 20;\n draw_context.lineJoin = \"round\";\n draw_context.textAlign = \"center\";\n draw_context.font = \"80px Lemon\";\n draw_context.strokeStyle = \"#fff\";\n draw_context.strokeText(this.text, canvas_element.width/2, this.vertical);\n draw_context.lineWidth = 10;\n draw_context.strokeStyle = \"#000\";\n draw_context.strokeText(this.text, canvas_element.width/2, this.vertical);\n \n draw_context.fillStyle = this.grad1;\n draw_context.fillText(this.text, canvas_element.width/2, this.vertical);\n }", "draw() {\n while (this.cont.lastChild) {\n this.cont.lastChild.remove();\n }\n for (let i = 0; i < 6; i++) {\n this.chrs[i] = new Image(43, 139);\n this.chrs[i].src = `img/${this.picker[i % 2]}.png`;\n poke(this.chrs[i]);\n glow(this.chrs[i]);\n this.cont.appendChild(this.chrs[i]);\n }\n }", "postDraw(c) {\n\n if (this.progress.isIntro && this.progress.isNight) {\n\n for (let e of this.enemies) {\n\n if (e.postDraw != undefined) {\n\n e.postDraw(c);\n }\n }\n }\n }", "_draw () {\r\n\t\tthis.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\r\n\r\n\t\tthis.particles.forEach(particle => {\r\n\t\t\tparticle.draw(this.context);\r\n\t\t});\r\n\t}", "function updateDraw(){\r\n //ToDo\r\n }", "draw() {\n if (this._selected) {\n this.selectedDraw();\n }\n if (this._hovered) {\n this.hoveredDraw();\n }\n if (!this._hovered && !this._selected) {\n this.normalDraw();\n }\n this.isHovered();\n this.isClicked();\n }", "function draw(){\n\t\t// Needed to comply with Tool Delegate design pattern\n\t}", "draw(ctx){\n if (this.exists) {\n if (!PARAMS.PLAY) {\n ctx.drawImage(this.mainmenu, 0, 0, 975, 772, 0, 0, 950, 750);\n } else if (PARAMS.PLAY) {\n ctx.drawImage(this.mainmenu, 979, 0, 975, 772, 0, 0, 950, 750);\n }\n }\n if (PARAMS.CONTROLS) {\n ctx.drawImage(this.controls, 0, 0, 950, 750);\n }\n if (PARAMS.PAUSE) {\n ctx.drawImage(this.pause, 0, 0, 950, 750);\n }\n if (PARAMS.GAMEOVER) {\n ctx.drawImage(this.gameOver, 0, 0, 950, 750);\n\n }\n if (PARAMS.WIN) {\n ctx.drawImage(this.winScreen, 0, 0, 950, 750);\n if (this.initialWinPlay) {\n PARAMS.START = false;\n ASSET_MANAGER.pauseBackgroundMusic();\n ASSET_MANAGER.playAsset(\"./audio/you_win.mp3\")\n this.initialWinPlay = false;\n }\n }\n\n\n }", "addEffect(effect) {\n for (const i in this.sprites) {\n this.sprites[i].addEffect(effect);\n }\n }", "function draw() {\n // Clear Canvas\n // Iterate through all GameObjects\n // Draw each GameObject\n // console.log(\"Draw\");\n for (i = 0; i < gameobjects.length; i++) {\n if (gameobjects[i].health > 0) {\n console.log(\"Image :\" + gameobjects[i].img);\n }\n }\n animate();\n}", "function draw() {\n //re-draw semi-transparent background each cycle\n background(240,100,15,0.2);\n \n //go through the particle system and check if any particles are dead \n //(start from the end, otherwise cutting components out of the array \n //will cause problems)\n for(var i = particleSystem.length-1; i>=0; i--) {\n \n //grab one particle from the system\n var p = particleSystem[i];\n \n //check if the particle is dead\n if(p.areYouDeadYet()){\n //if it's dead, cut out the array element at index 1, \n //and one element long\n particleSystem.splice(i,1);\n\n //if there are fewer particles in the system than expected, or they \n //are all outside of the screen, make a new particle \n //system at the position where the last particle died\n if (particleSystem.length < particleNumberLimit && p.getPos().x < canvasWidth \n && p.getPos().x > 0 && p.getPos().y > 0 && p.getPos().y < height){\n \n createMightyParticles(p.getPos());\n }\n\n }\n \n //if it's not dead yet, then draw it and update for the next cycle\n else{\n p.draw();\n p.update();\n }\n \n }\n \n //go through the attractors array and update each one\n for(var i = attractors.length-1;i>=0;i--){\n \n var v = attractors[i];\n v.update();\n \n }\n \n //run through the attractors array, and draw each one\n attractors.forEach(function(at) {\n at.draw(at.getStrength());\n });\n\n}", "draw() {\n if (this.dirty) {\n // Update pixels if any changes were made\n this.buffer.updatePixels();\n this.dirty = false;\n }\n\n background(230, 250, 250);\n image(this.buffer, 0, 0, width, height);\n\n // Draw all the collideable objects too\n for (let c of this.colliders) {\n c.draw();\n }\n }", "draw() {\n if (this.waves.lives == 0) {\n this.ctx.fillStyle = colours.flat_davys_grey;\n this.ctx.fillRect(0, 0, this.size.x, this.size.y);\n this.ctx.fillStyle = colours.flat_electric_blue;\n this.ctx.font = (this.wallSize) + 'px \"Press Start 2P\"';\n this.ctx.fillText('GAME OVER ', this.canvas.width / 2 - this.wallSize * 4, this.canvas.height / 2);\n this.ctx.font = (this.wallSize)/2 + 'px \"Press Start 2P\"';\n this.ctx.fillText('You reached wave ' + (this.waves.waveNo - 1), this.canvas.width / 2 - this.wallSize * 4, this.canvas.height / 2 + this.wallSize);\n let enemy = new Sprite (\n this.canvas,\n this.ctx,\n new Vector((this.canvas.width/2) - this.wallSize * 2.5, this.wallSize * 3), // position\n new Vector(0, 0),\n new Vector(this.wallSize * 5, this.wallSize * 5), // size\n new Spritesheet(images.enemy),\n [0, 11]\n );\n enemy.draw();\n document.getElementById('Game').classList.add(\"hide\");\n document.getElementById('GameOver').classList.remove(\"hide\");\n } else {\n this.walls.forEach(sprite => sprite.draw());\n // this.enemywalls.forEach(sprite => sprite.draw());\n this.towers.forEach(sprite => sprite.draw());\n if (this.wavesStart)\n this.waves.draw();\n this.moveTower.draw();\n }\n }", "function draw() {\n background(bg);\n\n if (state === `title`) {\n title();\n }\n else if (state === `simulation`) {\n simulation();\n }\n else if (state === `love`) {\n love();\n }\n else if (state === `sadness`) {\n sadness();\n }\n else if (state === `ignored`) {\n ignored();\n }\n}", "function draw() {\n background(93);\n\n\n //update mob drawings\n for (var i = mobs.length-1; i >= 0; i--) {\n if (frameCount % 30 == 0) {//global cooldown counter\n if (mobs[i].gcd > 0) {\n mobs[i].gcd -= 1;\n }\n }\n if (i === 0) {\n if (mobs[0] !== 'undefined') {//update the player health bars above canvas\n $('.p1Health').text(mobs[0].health);\n }\n } else if (i === 1) {\n if (mobs[1] !== 'undefined') {//update the player health bars above canvas\n $('.p2Health').text(mobs[1].health);\n }\n }\n mobs[i].compAI();\n mobs[i].update();\n mobs[i].show();\n titles[i].update(mobs[i].playerName, mobs[i].health);\n titles[i].show(mobs[i].playerName, mobs[i].health);\n if (mobs[i].isDead()) {//if mob.health is = 0, remove mob\n mobs.splice(i,1);\n }\n };\n\n //update laser drawings\n for (var i = lasers.length-1; i >= 0; i--) {\n lasers[i].show();\n lasers[i].shoot();\n\n for (var j = mobs.length-1; j >= 0; j--) {//check to see if laser hits a mob\n if (lasers[i].collides(mobs[j].x, mobs[j].y, mobs[j].hitBoxX, mobs[j].hitBoxY)) {\n var laserDamage = lasers[i].damage;\n console.log(laserDamage);\n mobs[j].isHit(laserDamage);\n }\n }\n if (lasers[i].edges() || lasers[i].toDel === true) {// check to see if laser is off screen or if the toDel is flagged to be deleted\n lasers.splice(i,1);\n }\n }\n}", "doDraw(offset) {\n let pp = [this.pos[0] - 16 - offset, this.pos[1] - 32];\n if ((this.life_time % 16) < 8) {\n drawImage(Graphics[\"spell1\"], pp);\n } else {\n drawImage(Graphics[\"spell2\"], pp);\n }\n // draw_context.fillStyle = \"#f007\"\n // draw_context.fillRect(hb_rect(this, 0),hb_rect(this, 1),this.width,this.height)\n }", "function draw() {\r\n if (x < background.w)x += 1;\r\n else x=0;\r\n if(theme==\"basic\"){\r\n bgImg=background.img;\r\n }else bgImg=backgroundSnow.img; \r\n context.drawImage(bgImg, x, 0, background.w, background.h, 0, 0, background.w ,background.h); \r\n context.save();\r\n animate(); // call function for animate player\r\n context.restore(); \r\n context.drawImage(flag.img, flag.w, flag.h); \r\n context.drawImage(tuyau.img, tuyau.w, tuyau.h); \r\n if(!progress){\r\n context.drawImage(win.img, win.w, win.h);\r\n }\r\n }", "function draw() {\n // draws background rooms and handles movement from one to another\n adventureManager.draw();\n\n // drawCharacters();\n\n // don't draw them on first few screens\n if( adventureManager.getStateName() === \"Splash\" ||\n adventureManager.getStateName() === \"Instructions\" ||\n adventureManager.getStateName() === \"Characters\" ) {\n ;\n }\n else {\n //drawCharacters();\n }\n \n // draw the p5.clickables, in front of the mazes but behind the sprites\n clickablesManager.draw();\n}", "function draw2OrDraw4Effect() {\n // console.log(\"drawCardEffect!\");\n var drawCard = $('#drawCard');\n var drawCardImg = $('#drawCardImg');\n drawCard.css(\"display\", \"block\");\n drawCardImg.addClass(\" animated pulse faster\");\n setTimeout(function () {\n drawCard.css(\"display\", \"none\");\n }, 1000);\n}", "function draw() {\n particles.forEach((p) => {\n p.draw();\n });\n}", "function drawEverything(){\n myGameArea.clear();\n //draw moving background\n drawBackground();\n //add the new position of the bullet to the update step\n playerBullets.forEach(function(bullet){\n bullet.update();\n });\n playerBullets.forEach(function(bullet){\n bullet.draw();\n });\n //filter the list of bullet to only add the active bullets\n playerBullets = playerBullets.filter(function(bullet){\n return bullet.active;\n });\n //add the new enemy to the array of enemies\n enemies.forEach(function(enemy){\n enemy.update();\n });\n // filter the list of enemies\n enemies = enemies.filter(function(enemy){\n return enemy.active;\n })\n enemies.forEach(function(enemy){\n enemy.draw();\n });\n \n player.newPos();\n player.update();\n // myGameArea.score();\n \n \n }", "draw() {\n // Limpa a tela antes de desenhar\n Game.Drawing.clearCanvas();\n Game.Drawing.drawImage(Game.ImageManager.image('background'), 190, 130);\n Game.gameObjectList.forEach(gameObject => gameObject.draw());\n\n }", "drawExistingEntities() {\n this.drawExistingBullets();\n this.drawExistingEnemies();\n this.hero.draw(this.ctx);\n }", "doDraw(offset) {\n super.doDraw(offset);\n let pp = [this.pos[0] - 64 - offset, this.pos[1] - 128];\n let image = \"chad-\";\n if (this.stance == 0){\n image+=\"n\";\n } else {\n image+=\"d\";\n }\n if (this.dir == 1){\n image+=\"r\";\n } else {\n image+=\"l\";\n }\n drawImage(Graphics[image], pp);\n\n for (let i=0; i < this.health; i+=1) { // hud\n drawImage(Graphics[\"health\"], [8, 8 + i*32]);\n }\n }", "function drawMoveables() {\n for (let i = 0; i < moveables.length; i++) {\n moveables[i].draw();\n }\n }", "function draw() {\n background(255);\n particles.forEach(p => {\n p.move();\n p.draw();\n });\n}", "function draw()\n\t{\n\t\tctx.clearRect(0, 0, W, H);\n\t\t\n\t\tctx.fillStyle = \"rgba(255, 255, 255, 0.8)\";\n\t\tctx.beginPath();\n\t\tfor(var i = 0; i < mp; i++)\n\t\t{\n\t\t\tvar p = particles[i];\n\t\t\tctx.moveTo(p.x, p.y);\n\t\t\tctx.arc(p.x, p.y, p.r, 0, Math.PI*2, true);\n\t\t}\n\t\tctx.fill();\n\t\tupdate();\n\t}", "function draw()\n\t{\n\t\tctx.clearRect(0, 0, W, H);\n\t\t\n\t\tctx.fillStyle = \"rgba(255, 255, 255, 0.8)\";\n\t\tctx.beginPath();\n\t\tfor(var i = 0; i < mp; i++)\n\t\t{\n\t\t\tvar p = particles[i];\n\t\t\tctx.moveTo(p.x, p.y);\n\t\t\tctx.arc(p.x, p.y, p.r, 0, Math.PI*2, true);\n\t\t}\n\t\tctx.fill();\n\t\tupdate();\n\t}", "function draw() {\n // draws background rooms and handles movement from one to another\n adventureManager.draw();\n clickablesManager.draw();\n\n for( let i = 0; i < clickables.length; i++ ) {\n clickables[i].visible = false;\n }\n\n if( gDebugMode == true ) {\n drawDebugInfo();\n }\n}", "function drawAll() {\r\n //Reset the screen so a user can see a star as a dot. Otherwise, a star looks like a line.\r\n virtualContext.fillStyle = (jiki.damage) ? \"red\" : \"black\";//Screen color is red if jiki's damage is left. Otherwise, it's black.\r\n virtualContext.fillRect( camera_x, camera_y, SCREEN_W, SCREEN_H ); \r\n\r\n\r\n //Draw each object by substituting its object in drawObj() method\r\n drawObj( star );\r\n drawObj( bullet ); \r\n if ( !gameOver ) {\r\n jiki.draw();//Draw a new sprite\r\n } \r\n drawObj( enemy );\r\n drawObj( explosion );\r\n drawObj( enemyBullet );\r\n\r\n \r\n //Define the camera position so the sprite is always at the center of the camera\r\n //Sprite movement range; 0 to FIELD_W\r\n //Camera movement range; 0 to (FIELD_W - SCREEN_W)\r\n camera_x = Math.floor( (jiki.x>>8) / FIELD_W * (FIELD_W - SCREEN_W) );//Set the relative position to camera_x depends on jiki.x\r\n camera_y = Math.floor( (jiki.y>>8) / FIELD_H * (FIELD_H - SCREEN_H) );\r\n\r\n\r\n //Print the boss enemy's HP\r\n if ( 0 < bossHp ) {\r\n let size = ( SCREEN_W - 20 ) * bossHp / bossMaxHp;\r\n let size2 = SCREEN_W - 20;\r\n virtualContext.fillStyle = \"rgba(255, 0, 0, 0.5)\";\r\n virtualContext.fillRect( camera_x+10, camera_y+10, size, 10 );\r\n virtualContext.strokeStyle = \"rgba(255, 0, 0, 0.9)\";\r\n virtualContext.strokeRect( camera_x+10, camera_y+10, size2, 10 );\r\n }\r\n\r\n \r\n //Print Jiki's HP\r\n if ( 0 < jiki.hp ) {\r\n let size = ( SCREEN_W - 20 ) * jiki.hp / jiki.maxHp;\r\n let size2 = SCREEN_W - 20;\r\n virtualContext.fillStyle = \"rgba(0, 0, 255, 0.5)\";\r\n virtualContext.fillRect( camera_x+10, camera_y+SCREEN_H-14, size, 10 );\r\n virtualContext.strokeStyle = \"rgba(0, 0, 255, 0.9)\";\r\n virtualContext.strokeRect( camera_x+10, camera_y+SCREEN_H-14, size2, 10 );\r\n }\r\n\r\n //Print the score\r\n virtualContext.fillStyle = \"white\";\r\n virtualContext.fillText( \"SCORE \" + score, camera_x+10, camera_y+14 );\r\n\r\n\r\n //Copy drawing from the virtual screen to the actual screen\r\n context.drawImage( $virtualCanvas, camera_x, camera_y, SCREEN_W, SCREEN_H,\r\n 0, 0, CANVAS_W, CANVAS_H );\r\n}", "function draw() {\n // Clear Canvas\n // Iterate through all GameObjects\n // Draw each GameObject\n // console.log(\"Draw\");\n for (i = 0; i < gameobjects.length; i++) \n {\n if (gameobjects[i].health > 0) \n {\n console.log(\"Image :\" + gameobjects[i].img);\n\n animate();\n\n }\n }\n\n}", "function draw(){\ncanCon.clearRect(0, 0, canCon.width, canCon.height);\n\n//stuff to draw\nbearer.draw();\nshield.draw();\n\n// draw Backscatter Buster Shots\nfor(var index = 0; index < playerPro.length; index++){\n playerPro[index].draw();\n}\n\n// draw enemies\nfor(var index = 0; index < enemies.length; index++){\n enemies[index].draw();\n}\n\n// draw enemy projectiles\nfor(var index = 0; index < enemyPro.length; index++){\n enemyPro[index].draw();\n}\n\n// draw HUD over everything\nScoreDisplay.draw();\nHealthDisplay.draw();\n}", "playEffect (state) {\n const discarded = state.allowDiscard(state.current, Infinity);\n\n state.current.drawCards(discarded.length);\n }", "draw(ctx) {\n let xOffset = 0;\n let yOffset = 0;\n if (this.dead) {\n if (this.deadAudio) {\n ASSET_MANAGER.playAsset(\"./audio/player_death.mp3\")\n this.deadAudio = false;\n }\n\n if (this.weapon === 0 && this.facing === 0) {\n xOffset = -45;\n yOffset = -23;\n } else if (this.weapon === 0 && this.facing === 1) {\n xOffset = -35;\n yOffset = -20;\n } else if (this.weapon === 1 && this.facing === 0) {\n xOffset = -75;\n yOffset = -45;\n } else if (this.weapon === 1 && this.facing === 1) {\n xOffset = -0;\n yOffset = -42;\n } else if (this.weapon === 2 && this.facing === 0) {\n xOffset = -65;\n yOffset = -40;\n } else if (this.weapon === 2 && this.facing === 1) {\n xOffset = -30;\n yOffset = -30;\n\n }\n if (this.facing === 0) {\n this.deadAnimR[this.weapon].drawFrame(this.game.clockTick, ctx, this.x - this.game.camera.x + xOffset,\n this.y - this.game.camera.y + yOffset, 1);\n } else {\n this.deadAnimL[this.weapon].drawFrame(this.game.clockTick, ctx, this.x - this.game.camera.x + xOffset,\n this.y - this.game.camera.y + yOffset, 1);\n }\n } else {\n if (this.weapon === 0) {\n xOffset = 0;\n yOffset = 0;\n } else if (this.weapon === 1) {\n if (this.state === 0) {\n if (this.facing === 1) yOffset = 1;\n this.facing === 0 ? xOffset = 0 : xOffset = -27;\n } else if (this.state === 1 && this.facing === 1) {\n xOffset = -15;\n yOffset = 0;\n } else if (this.state === 2 && this.facing === 0) {\n xOffset = -18;\n yOffset = -15;\n } else if (this.state === 2 && this.facing === 1) {\n xOffset = -68;\n yOffset = -15;\n } else if (this.state === 3 && this.facing === 1) {\n xOffset = -45;\n yOffset = 0;\n } else if (this.state === 4 && this.facing === 1) {\n xOffset = -20;\n yOffset = -5;\n }\n } else { //if bow\n //console.log(this.facing + \" \" + this.state);\n if (this.state === 0) {\n yOffset = 1;\n this.facing === 0 ? xOffset = 0 : xOffset = 0;\n } else if (this.state === 2) {\n this.facing === 0 ? xOffset = 0 : xOffset = -7;\n } else if (this.state === 4) {\n yOffset = 5;\n }\n\n }\n yOffset -= 5;\n this.animations[this.state][this.facing][this.weapon].drawFrame(this.game.clockTick, ctx,\n this.x - this.game.camera.x + xOffset, this.y - this.game.camera.y + yOffset, 1);\n\n }\n\n if (PARAMS.DEBUG) {\n // ctx.strokeStyle = 'Red';\n // ctx.strokeRect(this.BB.x - this.game.camera.x, this.BB.y - this.game.camera.y, this.BB.width, this.BB.height);\n ctx.strokeStyle = 'Blue';\n ctx.strokeRect(this.ABB.x - this.game.camera.x, this.ABB.y - this.game.camera.y, this.ABB.width, this.ABB.height);\n\n } else if (this.weapon === 2) {\n ctx.strokeStyle = 'White';\n //ctx.arc()\n ctx.strokeRect(this.ABB.x - this.game.camera.x, this.ABB.y - this.game.camera.y, this.ABB.width, .25);\n }\n }", "_draw() {\n\n }", "function renderExplosions() {\n Game.explosionCanvas.clearRect(0, 0, Game.width, Game.height);\n for (var i = 0; i < ExplosionObj.explosions.length; i++) {\n ExplosionObj.explosions[i].render();\n\n }\n}", "function drawUpdate() {\r\n\tdrawBread();\r\n\tdrawEggs();\r\n\tdrawGold();\r\n\tdrawSkyScraper(birds);\r\n\tdrawSkyScraper(machines);\r\n}", "draw() {\n ctx.fillStyle = this.color\n ctx.shadowColor = this.color\n ctx.shadowBlur = 30\n ctx.fillRect(this.pos.x, this.pos.y, this.size.w, this.size.h)\n\n if (this.color === this.hitColor) {\n setTimeout(() => {\n this.color = this.defaultColor // sets the color of the enemy to normal after 100 ms\n }, 100)\n }\n\n ctx.closePath()\n }", "function draw() {\n // Iterate through all GameObjects\n // Draw each GameObject\n\n //draws game objects if game isnt over\n if (gameEnd == false) {\n // Draw image\n var player = new Image();\n player.src = gameobjects[0].img;\n context.drawImage(player, x, y, 200, 200, gameobjects[0].x = 80, gameobjects[0].y = 250, 256, 256);\n drawHealthbar();\n\n var npc = new Image();\n npc.src = gameobjects[1].img;\n context.drawImage(npc, x, y, 81, 113, gameobjects[1].x = 340, gameobjects[1].y = 20, 81, 113);\n enemyHealthbar();\n }\n}", "function draw() {\n // Clear the drawing surface and fill it with a black background\n context.fillStyle = \"rgba(0, 0, 0, 0.5)\";\n context.fillRect(0, 0, 400, 400);\n\n // Go through all of the particles and draw them.\n particles.forEach(function(particle) {\n particle.draw();\n });\n}", "function draw() {\n // We don't fill the background so we get a drawing effect.\n // Displays the ellipse and square.\n profsRedEllipse.displayEllipse(255, 0, 0, 10, circleSize, circleSize);\n profsRedEllipse.translateEllipse(1, 1);\n\n profsBlueSquare.displaySquare(0, 0, 255, 10, squareSize, squareSize);\n profsBlueSquare.translateSquare(1, 1);\n\n // Creates a wing flapping effect by incrementing the alpha property.\n translateImg(5, 0, alpha += 25);\n\n // Resets the alpha when it is beyond visibility.\n if(alpha > VISIBLE) alpha = 0;\n\n // Resets the position of the dove image if it is offscreen.\n clampXPosition();\n\n // Displays clef image at mouse location.\n displayImgAtMouse(clefImg, 100, 100);\n\n // Makes dove image move according to a sine function.\n calcWave();\n renderWave();\n}", "function playEffectDead() {\n\tgroupEnemy.forEach(function(e) { e.tint = 0x000000; } );\n\tgroupPlayer.forEach(function(e) {e.tint = 0x000000; } );\n\taddGraphicsDead();\n}", "function draw() {\n // Fade existing trails\n var prev = g.globalCompositeOperation;\n g.globalCompositeOperation = \"destination-in\";\n g.fillRect(0, 0, mapView.width, mapView.height);\n g.globalCompositeOperation = prev;\n\n // Draw new particle trails\n particles.forEach(function(particle) {\n if (particle.age < settings.maxParticleAge) {\n g.moveTo(particle.x, particle.y);\n g.lineTo(particle.xt, particle.yt);\n particle.x = particle.xt;\n particle.y = particle.yt;\n }\n });\n }", "function enableEffects(ev) {\n\tif(change) { \n\t\tif(document.layers) {\n\t\t\tx1 = ev.screenX;\n\t\t\ty1 = ev.screenY;\n\t\t\tdocument.captureEvents(Event.MOUSEMOVE);\t\n\t\t\t}\n\t\telse { \n\t\t\tx1 = event.screenX;\n\t\t\ty1 = event.screenY;\n\t\t\t}\n\t\t\tdocument.onmousemove = showXY;\n\t\t}\n\telse { \n\t\tif (document.layers) { \n\t\t\tx2 = ev.screenX;\n\t\t\ty2 = ev.screenY;\t\t\t\n\t\t\tdocument.releaseEvents(Event.MOUSEMOVE); \n\t\t\t}\n\t\telse { \n\t\t\tx2 = event.screenX;\n\t\t\ty2 = event.screenY;\n\t\t\tdocument.onmousemove = null; \n\t\t\t}\n\t\twindow.status = 'Start: (' + x1 + ',' + y1 + \n\t\t\t') End: (' + x2 + ',' + y2 + ') Distance: ' + \n\t\t\t(Math.abs((x2 - x1) + (y2 - y1))) + ' pixels';\n\t\t}\n\tchange = !change;\n\t}", "function draw() {\r\n canvas_resize();\r\n set_origin();\r\n set_speed();\r\n bars[it].display();\r\n if (looping && it < nb_op) it++;\r\n}", "doDraw(offset) {\n super.doDraw(offset);\n let pp = [this.pos[0] - 64 - offset, this.pos[1] - 256];\n let image = \"wizard-\";\n if (this.dir == 1){\n image+=\"r\";\n } else {\n image+=\"l\";\n }\n drawImage(Graphics[image], pp);\n if (this.spell != undefined) {\n this.spell.doDraw(offset);\n }\n // draw_window.\n for (let i=0; i < this.health; i+=1) { // hud\n drawImage(Graphics[\"wizard_health\"], [canvas_element.width-40, 8 + i*32]);\n }\n \n }", "function draw() {\n //----- BACKGROUND SETUP -----\n background(bg.r, bg.g, bg.b);\n\n //----- STATE SETUP -----\n if(state === 'title'){\n titleScreen();\n }\n else if (state === 'gameplay'){\n gameplay();\n }\n else if (state === 'ending'){\n //----- NUM OF LIVES CHECK -----\n if(brokenHearts <= 2){\n ending(brokenHearts, 255, 115, 171);\n } else if (brokenHearts === 3 || brokenHearts === 4){\n ending(brokenHearts, 155, 100, 120);\n } else if (brokenHearts === 5){\n ending(brokenHearts, 70, 50, 60);\n }\n }\n}", "draw(ctx) {\n [...this.gameobjs, ...this.Brick].forEach(object => (object.draw(ctx)\n ));\n \n //displays the pause event\n if (this.gamestate === GAMESTATE.PAUSED) {\n ctx.rect(0, 0, this.gameWidth, this.gameHeight);\n ctx.fillStyle = \"rgba(0,0,0,0.5)\";\n ctx.fill();\n\n ctx.font = \" 100px Arial\";\n ctx.fillStyle = \"white\";\n ctx.textAlign = \"center\";\n ctx.fillText(\"PAUSED\", this.gameWidth / 2, this.gameHeight / 2);\n ctx.font = \"50px Arial\";\n ctx.fillText(\"Press enter to continue\", this.gameWidth / 2, this.gameHeight / 2 + 100)\n ctx.font = \"30px Arial\";\n ctx.fillText(\"You have \" + this.live +\n \" lives remaining\", this.gameWidth / 2, this.gameHeight / 2 + 200)\n };\n\n //displays the menu canvas\n if (this.gamestate === GAMESTATE.MENU) {\n ctx.rect(0, 0, this.gameWidth, this.gameHeight);\n ctx.fillStyle = \"rgba(0,0,0,1)\";\n ctx.fill();\n\n ctx.font = \" 50px Arial\";\n ctx.fillStyle = \"orange\";\n ctx.textAlign = \"center\";\n ctx.fillText(\"BLOCK BREAKER GAME\", this.gameWidth / 2, this.gameHeight / 2 - 150);\n ctx.fillStyle = \"white\";\n ctx.font = \"30px Arial\";\n ctx.fillText(\"Press SHIFT to Continue\", this.gameWidth / 2, this.gameHeight / 2 + 50)\n \n ctx.font = \"25px Arial\";\n ctx.fillStyle = \"grey\";\n ctx.textAlign = \"right\";\n ctx.fillText(\"Powered by Greenfonts\",\n this.gameWidth / 2 + 300, this.gameHeight / 2 + 250)\n\n }\n //displays the gameover canvas\n if (this.gamestate === GAMESTATE.GAMEOVER) {\n ctx.rect(0, 0, this.gameWidth, this.gameHeight);\n ctx.fillStyle = \"rgba(0,0,0,1)\";\n ctx.fill();\n\n ctx.font = \" 50px Arial\";\n ctx.fillStyle = \"orange\";\n ctx.textAlign = \"center\";\n ctx.fillText(\"GAME OVER\", this.gameWidth / 2, this.gameHeight / 2 - 150);\n ctx.fillStyle = \"white\";\n ctx.font = \"30px Arial\";\n ctx.fillText(\"Start New Game\", this.gameWidth / 2, this.gameHeight / 2 + 100)\n\n }\n if (this.gamestate === GAMESTATE.INSTRUCTIONS) {\n ctx.rect(0, 0, this.gameWidth, this.gameHeight);\n ctx.fillStyle = \"rgba(0,0,0,1)\";\n ctx.fill();\n\n ctx.font = \" 50px Arial\";\n ctx.fillStyle = \"orange\";\n ctx.textAlign = \"center\";\n ctx.fillText(\"INSTRUCTIONS\", this.gameWidth / 2, this.gameHeight / 2 - 150);\n\n ctx.fillStyle = \"white\";\n ctx.font = \"25px Arial\";\n ctx.fillText(\"Please read the instructions carefully\", this.gameWidth / 2, this.gameHeight / 2 - 80);\n \n ctx.textAlign = \"left\";\n ctx.fillStyle = \"white\";\n ctx.font = \"25px Arial\";\n ctx.fillText( \"* \" + \"You have 3 lives in the Game\",\n this.gameWidth / 2 - 350, this.gameHeight / 2 + 50)\n \n ctx.fillText(\"* \" +\"Press Enter to Pause the Game\", this.gameWidth / 2 - 350, this.gameHeight / 2 + 100)\n \n ctx.fillText(\"* \" + \"Press SPACEBAR to Start the Game\", this.gameWidth / 2 - 350, this.gameHeight / 2 + 150)\n \n\n }\n \n if (this.gamestate === GAMESTATE.MENUTONXTLEVEL) {\n ctx.rect(0, 0, this.gameWidth, this.gameHeight);\n ctx.fillStyle = \"rgba(0,0,0,1)\";\n ctx.fill();\n\n ctx.font = \" 30px Arial\";\n ctx.fillStyle = \"orange\";\n ctx.textAlign = \"center\";\n ctx.fillText(\"Press SPACEBAR to Continue to Level \" + (this.currentlevel + 1), this.gameWidth / 2, this.gameHeight / 2);\n \n }\n }", "function coreDraw() {\r\n\t\t\tdrawMethod();\r\n\t\t\texecRequestAnimationFrameFnList();\r\n\t\t\t// if the tween component exists let's update it\r\n\t\t\tif (TWEEN) {\r\n\t\t\t\tTWEEN.update();\r\n\t\t\t}\r\n\t\t}", "function draw() {\n if (state === `title`) {\n background(0, 2, 97);\n title();\n frameCount = 0;\n } else if (state === `loading`) {\n background(0, 146, 214);\n unsureIfthisIsAnActualLoadingScreen();\n } else if (state === `bubblePoppin`) {\n background(3, 1, 105);\n mLfingerPopper();\n bubbleDisplay();\n bubbleMovement();\n playerCounter();\n conclusionConditions();\n } else if (state === `poppinChampion`) {\n background(189, 189, 189);\n winScreen();\n } else if (state === `bubblePoppinBaby`) {\n background(36, 36, 36);\n endScreen();\n }\n}", "function draw() {\n music.play();\n\t\tclear();\n\t \tBackground(); //sequential so need to draw this first\n Paddle();\n\t\tBoxCollision();\n\t\tPaddleCollision();\n\t\tBall(); //sequential\n Move();\n\t\tBricks();\n\t\tcollisionDetection();\n\t\tScore();\n Lives();\n pauseGame();\n}//draw", "function on_draw()\n{\n\tdrawCounter++;\n\t\n\tif(drawCounter >= drawOnCount)\n\t{\n\t\tdrawCounter = 0;\n\t\tClearMiniMap();\n\t\t\n\t\tif(parent.miniMap.length == 0)\n\t\t{\n\t\t\te=new PIXI.Graphics();\n\t\t\te.zIndex = 999;\n\t\t\tDrawMiniMap();\n\t\t\tDrawWalls();\n\t\t\tDrawEntities();\n\t\t\tDrawNPCs();\n\t\t\tDrawCharacter();\n\t\t\tparent.stage.addChild(e);\n\t\t\tparent.miniMap.push(e);\n\t\t}\n\t}\n}", "function draw() {\n // the background image\n background(backgroundImage);\n\n if (!gameOver) {\n handleInput();\n\n moveharry();\n movesnitch();\n\n updateHealth();\n checkEating();\n\n drawsnitch();\n drawharry();\n\n drawHealthBar();\n\n }\n else {\n showGameOver();\n }\n}", "draw(engine, delta) {\n // draw sprites\n const spriteLayerNos = Object.keys(this.sprites);\n spriteLayerNos.forEach(layerNo => {\n const spriteTags = Object.keys(this.sprites[layerNo]);\n spriteTags.forEach(spriteTag => this.sprites[layerNo][spriteTag].draw());\n });\n // draw particles\n this.updateParticles(delta);\n this.updateUIObjects();\n }", "draw(){\n // if the below line code be here I could change the color because it changes the ctx color!\n // this.clipBoardTools();\n this.inputElement.addEventListener(\"change\", this.handleFiles, true);\n document.addEventListener(\"keydown\",this.keyClick,true);\n this.blockHolder.addEventListener('mousedown',this.mouseDownF,true);\n this.blockHolder.addEventListener('mousemove',this.mouseMoveF,true);\n window.addEventListener('mouseup',this.mouseUpF, true);\n }", "clearEffects() {\n for (const i in this.sprites) {\n this.sprites[i].clearEffects();\n }\n }", "function draw() {\n console.log(label);\n eventCounter();\n if (label === eventLabel) {\n background(backgroundColors[1]);\n dropCircle();\n } else if (label !== eventLabel) {\n background(backgroundColors[0]);\n isFriend = false;\n } else if (isFriend === true) {\n background(backgroundColors[2]);\n } else {\n background(backgroundColors[0]);\n }\n drawText();\n //drawCamera();\n //drawRectangle();\n Engine.update(engine);\n for (let circle of circles) {\n circle.show();\n }\n for (let ground of grounds) {\n ground.show();\n }\n drawCredit();\n}", "function paint(draw) {\n draw.forEach((id) => {\n canvas_pixels[id - 1].classList.remove(\"inactive\");\n canvas_pixels[id - 1].classList.add(\"active\");\n });\n}", "function _draw(ctx){\r\n\t\t// the _draw() method renders all of our game objects on the stage\r\n\t\t// for now we just have single object (our ship)\r\n\t\tship.draw(ctx);\r\n\t}", "function draw() {\n\n // this is to create the trail effect lower alpha to elongate trail\n fill(0, 7);\n rect(0, 0, width, height);\n\n\n // for debug and check where things are hidden\n // rotate(-PI/10);\n if (debug_text) {\n fill(255, 255, 255);\n stroke(255, 255, 255, 255);\n textSize(14);\n text(\"Wave Program\", 10, height - 50);\n text('Num. particules = ' + str(waves.length), 10, height - 30);\n\n text(\"Frame Rate : \" + int(frameRate()), 10, height - 10);\n }\n // go through all the population an run the various updates\n // most of the code is in the class wave\n for (let i = 0; i < waves.length; i++) {\n waves[i].run(waves);\n }\n}", "draw(context) {\n //TO-DO\n }", "function draw(){\n //set background\n background(145, 173, 150);\n //push score object into index 1 of concrete\n concrete[1] = new score(\"Score: \", 35, scoreCount, 14, 60);\n //push level object into index 1 of concrete\n concrete[2] = new score(\"Level\", 35, level, width - 154, 60);\n //push frog object into index 0 of concrete\n concrete[0] = new frog(img, 200, xposFrog, yposFrog);\n //display and move fireflies\n for(var i = 0; i < flObjects.length; i++){ flObjects[i].display(); flObjects[i].move();}\n\n //display objects\n for(var i = 0; i < concrete.length; i++){concrete[i].display();}\n //display all fly objects in array\n for(var i = 0; i < flies.length; i++){\n flyObjects[i].display(); flyObjects[i].buzz(); flyObjects[i].kill();\n if(flyObjects[i].intersect() === true && flyObjects[i].getId() === false){\n scoreCount += 1;\n flyObjects[i].setId(true);}\n }\n if(scoreCount === flyNumber){\n //flySound.stop();\n fill(255, 89, 34, 150);\n textSize(50);\n text(\"Game Over \", (width/2) - 150, (height/2));\n fill(0, 0, 0, 150);\n textSize(30);\n text(\" Click Next Level ⬆️\", (width/2) - 150, (height/2) + 50);\n console.log(level + \":\" + scoreCount + \" -> \" + \"success\");\n var nextlevel = level + 1;\n loadJSON('add/' + level + '/' + nextlevel, function(data){\n console.log(data);\n });\n noLoop();\n }\n for(var i = 0; i < flies.length; i++){\n if(flyObjects[i].getId() === true && flyObjects[i].intersect() === true && scoreCount < flyNumber){\n concrete[0].eat(concrete[0].x, concrete[0].y - 24, flyObjects[i].x, flyObjects[i].y);\n flyObjects[i].y = flyObjects[i].y + 60;\n flyObjects[i].setExcecute(false);\n }\n }\n strokeWeight(8);\n fill(200, 52, 0);\n stroke(200, 52, 0, 200);\n ellipse(concrete[0].x, concrete[0].y - 24, 15, 15);\nfor(var i = 0; i < flies.length; i++){\n if(falling(concrete[0], flyObjects[i], concrete[0].x, concrete[0].y) === true){\n flyObjects[i].x = flyObjects[i].x + 50;\n console.log(\"intersect\");\n }\n }\n}", "function draw() {\n console.log(\"start draw\");\n switch (spelStatus) {\n case SPELEN:\n welkeSpelerRijKolom();\n tekenVeld();\n tekenSpeler(spelerKolom, spelerRij);\n tekenVijand(vijandKolom, vijandRij);\n\n if(spelerTurn === true) {\n aanvallen();\n bewegen(welkeSpelerKolom,welkeSpelerRij,welkeVijandKolom,welkeVijandRij);\n }\n\n if(vijandTurn === true) {\n aanvallen();\n bewegen(welkeSpelerKolom,welkeSpelerRij,welkeVijandKolom,welkeVijandRij);\n }\n\n levensVanSpeler();\n levensVanVijand();\n\n \n\n gameOver();\n break;\n\n\n case STARTSCHERM:\n background('lightblue');\n textSize(70);\n text(\"Counter-Strike: Execution Force\", 130, 150);\n \tspeelKnop();\n uitlegKnop();\n creditsKnop();\n\n\n\n\n break;\n\n case GAMEOVER:\n gameOverScherm();\n\n\n\n\n break;\n\n case UITLEG:\n uitlegScherm();\n \n\n break;\n\n case CREDITS:\n creditScherm();\n\n break;\n }\n \n}", "function drawAndMoove() {\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n for (let i = 0; i < LesVisages.length; i++) {\r\n LesVisages[i].dessiner();\r\n }\r\n for (let i = 0; i < LesVisages.length; i++) {\r\n LesVisages[i].deplacer();\r\n }\r\n}", "function hit() {\n\tc.userDraw();\n}", "function draw() {\n ctx.fillStyle = \"#70c5ce\";\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n cloud.draw();\n pipes.draw();\n ball.draw();\n ground.draw();\n bird.draw();\n getReady.draw();\n gameOver.draw();\n score.draw();\n}", "function render () {\r\n ctx.clearRect(0,0,canvas.width,canvas.height);\r\n cenario.fase();\r\n cenario.gera();\r\n player.calculoContagens();\r\n detectaEstado(); \r\n objchao.mostra()\r\n fisica.calculo();\r\n limites();\r\n }", "draw() { }", "draw() { }", "draw() { }", "draw() {}", "draw() {}", "draw() {}", "draw() {}", "function Invasion(){\n \n\t\tfor(var i = AlienToShoot() ; i < Enemyx.length; i++){\n \n\t\t\tif(AlienToShoot() <= 40 ){\n\t\t\t\tEnemyShoot[i] == true\n\t\t\t\n\t\t\t}\n\n\t\t\tif(EnemyShoot[i] == true){\n\n \n\t\t\t\t\tctx.fillStyle = 'red';\n\t\t\t\t\tctx.fillRect(EnemyLx[i] + 13, EnemyLy[i] + 13 , 5, 10);\n\t\t\t\t\tEnemyLy[i] += 15;\n\t\t\t\t}\n\t\t\t\tif(EnemyLy[i] >= 460){\n\t\t\t\t\tEnemyShoot[i] = false;\n\t\t\t\t}\n\t\t\t\tif(EnemyLy[i] >= 460 && EnemyShoot[i] == false){\n\t\t\t\t\t\tEnemyLy[i] = 300000;\n\t\t\t\t\t\tEnemyLy[i] -= 0;\n\t\t\t\t}\n \n\t\t}\n\t}", "function draw() {\n // draws background rooms and handles movement from one to another\n adventureManager.draw();\n\n // Only draw scorecard on certain screens\n if( adventureManager.getStateName() === \"Splash\" ||\n adventureManager.getStateName() === \"Instructions\" ||\n adventureManager.getStateName() === \"Characters\" ||\n adventureManager.getStateName() === \"Four\" ||\n adventureManager.getStateName() === \"Five\" ||\n adventureManager.getStateName() === \"Eight\" ||\n adventureManager.getStateName() === \"Eleven\") {\n ;\n }\n else {\n stressCard.draw();\n }\n\n // draw the p5.clickables in front\n clickablesManager.draw();\n}", "function drawExplosions(canvasContext, list) {\n if (canvasContext) {\n for (var i = 0; i < list.length; i++) {\n if (GameObjects.isSpriteLoaded(list[i].type)) {\n //update frame\n list[i].update();\n //draw\n list[i].render(canvasContext);\n //check if finished\n if (list[i].isFinished) {\n list.splice(i, 1); //remove\n }\n }\n }\n }\n }", "draw() {\n this.bg.forEach((a) => a.draw());\n this.shapes.forEach((a) => a.draw());\n Help.clean(this.shapes);\n }", "draw() {\n\t\tthis.newPosition()\n\t\tthis.hoverCalc()\n\n\n\t\t// this.drawWaves()\n\n\t\tthis.applyCircleStyle()\n\n\n\t\tthis.ly.circle( this.x, this.y, 2 * this.r * this.scale )\n\n\t\tthis.applyTextStyle()\n\t\tthis.ly.text( this.label, this.x, this.y )\n\n\n\n\t}", "draw(i) {\n ctx.save();\n ctx.translate(cv.width * 0.5, cv.height * 0.5);\n ctx.scale(1, -1);\n\n ctx.beginPath();\n super.draw_handles();\n\n ctx.beginPath();\n ctx.strokeStyle = 'red';\n\n // If need update (ray moved)\n // or if any mirror moved (then recalculate all rays)\n // it is quite unoptimal, but we can use it here\n if(this.need_update || any_mirror_moved()) {\n this.cast_ray();\n this.need_update = false;\n\n // Is last ray?\n if(i == ray_total_count()) {\n mirror_updated();\n }\n \n }\n\n this.draw_trace();\n\n ctx.closePath();\n ctx.restore();\n }", "function drawCanvas(){\n\tclearCanvas();\n\t// loop over the objects of the paint\n\tif (dataLoaded){\n\t\tif (!isFullHistory){\n\t\t\tctx.save();\n\t\t\tctx.globalAlpha = globalAlpha;\n\t\t\tfor (index in objArr)\n\t\t\t{\n\t\t\t\tobjArr[index].draw();\n\t\t\t}\n\t\t\tctx.restore();\n\n\t\t\thistoryObj.draw();\n\t\t\tif (moveToFullHistoy != 0){\n\t\t\t \tmoveToFullHistoy--;\n\t\t\t \tvar currInterval = (HISTORY_ANIMATION_TIME-moveToFullHistoy)/HISTORY_ANIMATION_TIME;\n\t\t\t\tgraphW = BASE_GRAPH_W + ((MAX_GRAPH_W - BASE_GRAPH_W) * currInterval);\n\t\t\t\tgraphH = BASE_GRAPH_H + ((MAX_GRAPH_H - BASE_GRAPH_H) * currInterval);\n\t\t\t\thistoryObj.pos.x = MIN_GRAPH_X + ((BASE_GRAPH_X-MIN_GRAPH_X) * (moveToFullHistoy/HISTORY_ANIMATION_TIME));\n\t\t\t\thistoryObj.pos.y = MIN_GRAPH_Y + ((BASE_GRAPH_Y-MIN_GRAPH_Y) * (moveToFullHistoy/HISTORY_ANIMATION_TIME));\n\t\t\t\tglobalAlpha = 1-currInterval;\n\t\t\t\tif (moveToFullHistoy == 0){\n\t\t\t\t\tisFullHistory = true;\n\t\t\t\t\tmoveToFullHistoy =-1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\thistoryObj.draw();\n\t\t\tfor (index in objArr)\n\t\t\t{\n\t\t\t\tif (objArr[index].kind == WATT_KIND) \n\t\t\t\t\tobjArr[index].draw();\n\t\t\t}\n\t\t\tif (moveToFullHistoy != -1){\n\t\t\t\tmoveToFullHistoy++;\n\t\t\t \tvar currInterval = (HISTORY_ANIMATION_TIME-moveToFullHistoy)/HISTORY_ANIMATION_TIME;\n\t\t\t\tglobalAlpha = 1;\n\t\t\t\tgraphW = BASE_GRAPH_W + ((MAX_GRAPH_W - BASE_GRAPH_W) * currInterval);\n\t\t\t\tgraphH = BASE_GRAPH_H + ((MAX_GRAPH_H - BASE_GRAPH_H) * currInterval);\n\t\t\t\thistoryObj.pos.x = MIN_GRAPH_X + ((BASE_GRAPH_X-MIN_GRAPH_X) * (moveToFullHistoy/HISTORY_ANIMATION_TIME));\n\t\t\t\thistoryObj.pos.y = MIN_GRAPH_Y + ((BASE_GRAPH_Y-MIN_GRAPH_Y) * (moveToFullHistoy/HISTORY_ANIMATION_TIME));\n\t\t\t\tif (moveToFullHistoy == HISTORY_ANIMATION_TIME){\n\t\t\t\t\tisFullHistory = false;\n\t\t\t\t\tmoveToFullHistoy = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function render() {\n ctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\n // draw background\n background.draw(ctx);\n\n // draw earth\n earth.draw(ctx);\n moon.draw(ctx);\n\n\n // draw asteroids\n //asteroid_1.update();\n //asteroid_1.draw(ctx);\n //asteroid_2.draw(ctx);\n\n //bullet.draw(ctx);\n\n // explosion\n //explosion.draw(ctx);\n\n\n}", "draw() {\n\n this.drawInteractionArea();\n\n //somewhat depreciated - we only really draw the curve interaction but this isnt hurting anyone\n if(lineInteraction)\n this.drawLine();\n else\n this.drawCurve();\n\n this.drawWatch(); \n\n }", "draw(ctx) {\n this.gameObjects.forEach((object) => object.draw(ctx));\n }", "function drawCardEffectHelper(relativeOrder) {\n if (relativeOrder == 1) {\n playerDrawCardEffect('rightPlayerCards', \"bounceInLeft\");\n $('#rightPlayerUno').css(\"display\", \"none\");\n } else if (relativeOrder == 2) {\n playerDrawCardEffect('topPlayerCards', \"bounceInUp\");\n $('#topPlayerUno').css(\"display\", \"none\");\n } else if (relativeOrder == 3) {\n playerDrawCardEffect('leftPlayerCards', \"bounceInRight\");\n $('#leftPlayerUno').css(\"display\", \"none\");\n }\n}", "draw(ctx){\n ctx.save(); \n ctx.beginPath();\n ctx.rect(this.x-this.width/2,this.y-this.height/2,this.width,this.height);\n ctx.closePath();\n ctx.fillStyle = \"blue\";\n ctx.fill();\n ctx.restore();\n\n ctx.save();\n ctx.beginPath();\n ctx.rect(0,570,800 * (this.health/this.originalHealth),30);\n ctx.closePath();\n ctx.fillStyle = \"red\";\n ctx.fill();\n ctx.restore();\n }", "@action act() {\n this.clearHit()\n this.handleEffects()\n }" ]
[ "0.7175995", "0.6756187", "0.6641002", "0.644936", "0.64451736", "0.6381269", "0.6367208", "0.63565016", "0.63565016", "0.63565016", "0.6348644", "0.63153726", "0.63153726", "0.6303444", "0.6302979", "0.6302781", "0.62759477", "0.6275754", "0.6252963", "0.6245626", "0.6242325", "0.6239291", "0.62025595", "0.6186709", "0.6183119", "0.61825144", "0.618162", "0.6179926", "0.615795", "0.6157836", "0.6156665", "0.6144487", "0.61402005", "0.6133866", "0.61283094", "0.611693", "0.61107546", "0.60989696", "0.6088175", "0.60871005", "0.6085671", "0.6085671", "0.608445", "0.6082821", "0.60793734", "0.60643095", "0.6061338", "0.6047336", "0.60458267", "0.6038776", "0.6033024", "0.6032721", "0.6031807", "0.60186577", "0.6014097", "0.59966683", "0.5990557", "0.5990294", "0.5983888", "0.5974042", "0.59726816", "0.59716403", "0.5970931", "0.59695894", "0.5968542", "0.59666353", "0.59653485", "0.5964311", "0.5963189", "0.5963093", "0.59622216", "0.59611064", "0.596006", "0.5958892", "0.59513235", "0.59462124", "0.5939296", "0.5938886", "0.59368324", "0.5933328", "0.59311455", "0.5930137", "0.5930137", "0.5930137", "0.59299827", "0.59299827", "0.59299827", "0.59299827", "0.5927016", "0.5912661", "0.59090286", "0.59071094", "0.59029096", "0.58974993", "0.5897268", "0.58921564", "0.58866775", "0.5885786", "0.5882136", "0.58812326", "0.58808815" ]
0.0
-1
================ INITIALIZE GAME ====================
function init() { initValues(); initEngine(); initLevel(); initTouchHandlers(); startTurn(); initEffects(); setInterval(tick, 10); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initGame() {\n players = [];\n teams = [];\n orbs = [];\n bases = [];\n createOrbs(defaultOrbs);\n createBases(defaultBases);\n}", "function initGame()\n{\n\tturn = 0;\n\tgame_started = 0;\n player = 0;\n}", "function initGame() {\r\n initPelota();\r\n initNavecilla();\r\n initLadrillos();\r\n}", "function initGame(){\n resetGameStats()\n setLevel()\n gBoard = buildBoard()\n renderBoard(gBoard)\n gGame.isOn = true\n\n}", "function initialiseGame() {\n enableAnswerBtns();\n hideGameSummaryModal();\n showGameIntroModal();\n selectedStories = [];\n score = 0;\n round = 1;\n resetGameStats();\n}", "function init() {\n\t\t// reset will display start game screen when screen is designed\n\t\treset();\n\n\t\t// lastTime required for game loop\n\t\tlastTime = Date.now();\n\n\t\tmain();\n\t}", "function startGame() {\n init();\n}", "function init() {\n reset();\n menu = new GameMenu();\n /* Initialize the level */\n initLevel();\n\n lastTime = Date.now();\n main();\n }", "function gameInit() {\r\n // disable menu when right click with the mouse.\r\n dissRightClickMenu();\r\n resetValues();\r\n // switch emoji face to normal.\r\n switchEmoji();\r\n gBoard = createBoard(gLevel.SIZE);\r\n renderBoard(gBoard);\r\n}", "function initGame() {\r\n renderLevels()\r\n gGame = {\r\n isOn: true,\r\n isFirstClick: true,\r\n\r\n }\r\n gBoard = buildBoard();\r\n renderBoard(gBoard);\r\n startTimer()\r\n\r\n}", "function initializeGame() {\n console.log(\"initialize Game\");\n fadeIn(\"prestart\"); // start slide shows \n //playIt(song); // start woodstock song\n ramdomize(gameArray); // randomize order of artist names for each game\n roundsMax = 2; // gameArray.length; ******************************************************\n}", "function initialiseGame() {\n // Hides start panel and GitHub icon, shows direction buttons, plays audio\n document.getElementById(\"start-panel\").classList.toggle(\"hidden\");\n document.getElementById(\"bottom-banner\").classList.toggle(\"hidden\");\n document.getElementById(\"github\").classList.toggle(\"hidden\");\n document.getElementById(\"start\").play();\n document.getElementById(\"music\").play();\n\n // Generates new Sprite object per array iteration and maintains Sprite numbers to numberOfSprites\n for (var i = 0; i < numberOfSprites; i++) {\n spritesArray[i] = new Sprite(\n centreOfX,\n centreOfY,\n Math.random() * cnvsWidth\n );\n }\n\n // Triggers main loop animations\n update();\n}", "function initGame() {\n guesses = [];\n displayHistory();\n resetResultContent();\n}", "function initGame() {\n gBoard = buildBoard(gLevel);\n renderBoard();\n}", "function initialize(){\n playing=true;\n lhor=false;\n lver=false;\n victory=false;\n turns=0;\n}", "function init() {\n //go through menus\n menus = true;\n //choosing play style\n choosingStyle = true;\n //Display text and buttons\n AI.DecidePlayStyle();\n //load the board and interactable cubes\n LoadBoard();\n LoadInteractables();\n}", "function initializeGame() {\n createArray();\n initializeArray();\n shipLocator();\n }", "function startGame(){\n initialiseGame();\n}", "function initialiseGame() {\r\n // Hides start panel and GitHub icon, shows direction buttons, plays audio\r\n document.getElementById(\"start-panel\").classList.toggle(\"hidden\");\r\n document.getElementById(\"bottom-banner\").classList.toggle(\"hidden\");\r\n document.getElementById(\"github\").classList.toggle(\"hidden\");\r\n document.getElementById(\"start\").play();\r\n document.getElementById(\"music\").play();\r\n\r\n // Generates new Sprite object per array iteration and maintains Sprite numbers to numberOfSprites\r\n for (var i = 0; i < numberOfSprites; i++) {\r\n spritesArray[i] = new Sprite(\r\n centreOfX,\r\n centreOfY,\r\n Math.random() * cnvsWidth\r\n );\r\n }\r\n\r\n // Triggers main loop animations\r\n update();\r\n}", "function init() {\n if (game.init())\n game.start();\n}", "init(game) {\n\n }", "function startGame(){\n\tvar game = new Game();\n\tgame.init();\n}", "function init () {\r\n initAllVars();\r\n gameLoop();\r\n}", "function init() {\n gameStart();\n}", "function init() {\n lobby.init();\n game.init();\n}", "function initialiseGame()\n{\n\tclear();\n\tmainText.draw();\n\tscoreText.draw();\n\t\n\tstartButtonDraw();\n\tdifficultyButtonDraw();\n}", "function initGame(){\n // Bind the keys for the title screen\n bindTitleKeys();\n\n // Initialize the audio helper\n audioHelper = new AudioHelper(audioHelper ? audioHelper.isMuted() : false);\n\n audioHelper.stopGameMusic();\n // Play the intro music\n audioHelper.startIntroMusic();\n\n // Setup the title screen\n titleScene.visible = true;\n gameScene.visible = false;\n gameOverScene.visible = false;\n renderer.backgroundColor = GAME_TITLE_BACKGROUND_COLOR;\n\n // Set the game state\n gameState = title;\n}", "function gameInit () {\n for (let i = 0; i < currentRound; i++){\n const rand = (Math.floor(Math.random()*8));\n programSequence.push(visuals[sounds[rand]]);\n }\n playBack();\n }", "function initGame() {\n first_item_timestamp = Math.round((new Date().getTime()) / 100) / 10;\n initializeSetsOfChoices();\n adjustSlider(set[round][stage][1], set[round][stage][2], set[round][stage][3], set[round][stage][4], set[round][stage][5], set[round][stage][6]);\n\n // we store some data\n itemLowvalYou[stage] = set[round][stage][1];\n itemHighvalYou[stage] = set[round][stage][2];\n itemDescYou[stage] = set[round][stage][3];\n itemLowvalOther[stage] = set[round][stage][4];\n itemHighvalOther[stage] = set[round][stage][5];\n itemDescOther[stage] = set[round][stage][6];\n itemID[stage] = set[round][stage][7];\n\n initSlider();\n if (storeSearchPath == 1) {\n trackTicks();\n }\n gameMsg = '';\n dispGame();\n }", "function init()\r\n{\r\n\tconsole.log('init');\r\n\tinitView(); \t\r\n OSnext(); \r\n \t \t\t\r\n// \tdeleteGame();\r\n// \tloadGame();\r\n// \t\r\n// \tif (game==null) {\r\n// \t\tstartNewGame();\r\n// \t} else {\r\n// \t UI_clear(); \r\n// \t UI_closeOverlay(); \r\n// \t UI_hideActions();\r\n// \t \tUI_hideCard();\r\n// \t UI_updateFront('Sinai');\r\n// \t UI_updateFront('Mesopotamia');\r\n// \t UI_updateFront('Caucasus');\r\n// \t UI_updateFront('Arab');\r\n// \t UI_updateFront('Gallipoli');\r\n// \t UI_updateFront('Salonika');\r\n// \t UI_updateNarrows();\r\n// \t UI_updateCounters();\t\t\t\r\n// \t\tconsole.log('loaded previous game');\r\n// \t}\r\n\t\t \r\n}", "function init() {\n\t\tclearBoard();\n\t\tprintBoard(board);\n\t\ttopPlayerText.innerHTML = `- ${game.currentPlayer.name}'s turn -`;\n\t\tgame.currentPlayer = game.playerOne;\n\t\tgame.squaresRemaining = 9;\n\t\tgame.winner = false;\n\t\tclickSquares();\n\t}", "function initializeGame() {\n setupCards();\n playMatchingGame();\n}", "function init() {\n setCircleVisibility(false);\n isPlayingGame = false;\n id(\"start-button\").addEventListener(\"click\", () => {\n isPlayingGame = !isPlayingGame;\n if (isPlayingGame) {\n startGame();\n } else {\n endGame();\n }\n });\n id(\"game-frame\").style.borderWidth = FRAME_BORDER_PIXELS + \"px\";\n }", "function begin_game(){\n\tload_resources();\n\tController = new Control();\n\n\tPlayerGame = new Game(ctx, gameWidth, gameHeight, 10);\t\t// (context, x_boundary, y_boundary, ms_delay)\n\tPlayerGame.clearColor = \"rgb(50,43,32)\";\n\tCurrPlayer = new Player(50, 400);\t\t\t\t// (x-position, y-position)\n\n\tloadGame();\n\tframe();\n}", "function init() {\n stage = new createjs.Stage(document.getElementById(\"gameCanvas\"));\n game = new createjs.Container();\n stage.enableMouseOver(20);\n createjs.Ticker.setFPS(60);\n createjs.Ticker.addEventListener(\"tick\", gameLoop);\n optimizeForMobile();\n\n // When game begins, current state will be opening menu (MENU_STATE)\n //scoreboard = new objects.scoreBoard(stage, game);\n currentState = constants.MENU_STATE;\n changeState(currentState);\n}", "function init() {\n \n document.getElementById('play-again').addEventListener('click', function() {\n reset();\n });//Add click to play-again button --HTML\n\n reset(); // reset the game state\n lastTime = Date.now();\n main(); // start game // Why do we need a main function and then an init function?\n}", "function init() {\n\tdocument.getElementById(\"play\").blur();\n\t//call function inside the object to start the game\n\tmyGame.start();\n}", "function init() {\r\n var levelData = document.querySelector('input[name=\"level\"]:checked')\r\n gLevel.size = levelData.getAttribute('data-inside');\r\n gLevel.mines = levelData.getAttribute('data-mines');\r\n gLevel.lives = levelData.getAttribute('data-lives');\r\n var elHints = document.querySelector('.hints')\r\n elHints.innerText = 'hints: ' + HINT.repeat(3)\r\n var elButton = document.querySelector('.start-button')\r\n elButton.innerText = NORMAL\r\n document.querySelector('.timer').innerHTML = 'Time: 00:00:000'\r\n gBoard = createBoard()\r\n clearInterval(gTimerInterval);\r\n gGame = { isOn: false, shownCount: 0, markedCount: 0, isFirstClick: true, isHintOn: false }\r\n renderBoard()\r\n renderLives()\r\n}", "function init() {\n setupModeButtons();\n setupSquares();\n resetGame();\n}", "function onInit() {\n const game = new Game();\n game.start();\n\n document.querySelector(`#restart`).addEventListener(\"click\", (event) => {\n game.start();\n });\n \n document.querySelector(`#play-again`).addEventListener(\"click\", (event) => {\n game.onPlayAgain();\n });\n}", "init() {\r\n //const result = this.isGameEnd([4],gameModeStevenl.wining_positions);\r\n //console.log(result);\r\n\r\n this.assignPlayer();\r\n gameView.init();\r\n }", "function startGame() {\n water = 0;\n corn = 2;\n beans = 2;\n squash = 2;\n month = 1;\n gameOver = false;\n \n initGameBoard();\n playGame();\n}", "function start()\r\n{\r\ninit();\r\ngame.start();\r\n}", "initGame() {\n\t\t//gameservices hangmnGuessWord\n\t\t//gameServices placeHodlerGenerator\n\t}", "function initGame (){\n\n resetData();\n \n //Update content\n\n \n //Pick a new country and display info\n pickCountry();\n getcountryText();\n UpdateContent();\n\n //hide background image\n\n dispGame.classList.add(\"gameStarted\");\n dispGame.style.display = \"block\";\n dispGame.style.visibility = \"visible\";\n \n //hide start button\n startGame.style.display = \"none\";\n\n //Set isGameOver to false\n isgameOver = false;\n\n}", "function init()\n{\n game = new Phaser.Game(768, 432, Phaser.CANVAS, '', null, false, false);\n\n\tgame.state.add(\"MainGame\", MainGame);\n\tgame.state.start(\"MainGame\");\n}", "function init() {\n\t\tscore = 0;\n\t\tdirection = \"right\";\n\t\tsnake_array = [];\n\t\tcreate_snake();\n\t\tmake_food();\n\t\tactiveKeyboard();\n\t\t$(\"#message\").css(\"display\",\"none\");\n\t\tgame_loop = setInterval(paint,100);\n\t}", "initGame() {\n\n //--setup user input--//\n this._player.initControl();\n\n //--add players to array--//\n this._players.push(this._player, this._opponent);\n\n //--position both players--//\n this._player.x = -Game.view.width * 0.5 + this._player.width;\n this._opponent.x = Game.view.width * 0.5 - this._opponent.width;\n }", "function init() {\n\t\tconst canvas = document.createElement('canvas');\n\t\tcanvas.width = canvasWidth;\n\t\tcanvas.height = canvasHeight;\n\t\tcanvas.style.border = \"15px groove gray\";\n\t\tcanvas.style.margin = \"25px auto\";\n\t\tcanvas.style.display = \"block\";\n\t\tcanvas.style.background = \"#ddd\";\n\t\tdocument.body.appendChild(canvas);\n\t\tctx = canvas.getContext('2d');\n\t\tnewGame()\n\t}", "function init() {\n clearInterval(interval);\n poop = [];\n kbd = new Keyboard();\n board = new Board(WIDTH, HEIGHT);\n board.draw(\"\");\n snake = new Snake(Math.floor(WIDTH / 2), Math.floor(HEIGHT / 2));\n board.makeApple();\n setId(\"scorebox\", \"munched: \" + (snake.tail.length - 3));\n setId(\"sb\" + apple.x + \"_\" + apple.y, \"@\");\n stepSpeed = INIT_GAME_SPEED;\n pause();\n }", "function initGame() {\n const estado = createGameEstado()\n randomcomida(estado);\n return estado;\n}", "function initgame() {\n prompts();\n}", "function init() {\n enablePlayAgain(reset);\n reset();\n lastTime = Date.now();\n main();\n }", "function initGame(){\n\tdragging = snapping = false;\n\tcurrentlyAnimating = true;\n\ttriggerDetectSquares = true;\n\tspawnNewPoly = polyMoved = false;\n\tgameWon = gameWonOverlayShown = false;\n\tgameLost = gameLostOverlayShown = false;\n\tcomboActiveCtr = 0;\n\tscore = goalScore;\n\tmaxCombo = parseInt(localStorage.getItem(\"maxCombo\")) || 0;\n\tmaxComboScore = parseInt(localStorage.getItem(\"maxComboScore\")) || 0;\n\tshapeCountAllTime = JSON.parse(localStorage.getItem(\"shapeCount\")) || shapeCountCurrentGame;\n\n\tselection = new grid(gridSize);\n\tfor(var i=0;i<selection.size;++i)for(var j=0;j<selection.size;++j)\n\t\tselection.setCell(i,j,0);\n}", "function initGame() {\r\n clearInterval(gTimerInterval)\r\n gTimeCounter = 0;\r\n renderLevelButton()\r\n resetHints();\r\n resetSafeClick();\r\n var elLive = document.querySelector('.lives')\r\n elLive.innerText = LIVE + LIVE + LIVE\r\n gGame = {\r\n isOn: true,\r\n isFirstClick: true,\r\n shownCount: 0,\r\n markedCount: 0,\r\n mines: [],\r\n gLives: 0,\r\n gHint: false,\r\n isCanClick: true,\r\n minesExposed: 0\r\n\r\n }\r\n renderIcon(NORMAL_FACE);\r\n renderScoreStart()\r\n gBoard = buildBoard();\r\n renderBoard(gBoard);\r\n document.querySelector('.records').style.display = 'none';\r\n var elTimer = document.querySelector(\".timer\");\r\n elTimer.innerText = 0;\r\n}", "function init_game() {\r\n // init canvas for drawing\r\n canvas = document.getElementById('canvas');\r\n canvas.focus(); \r\n ctx = canvas.getContext('2d');\r\n\r\n // reset game elements, including hiscore (reset_hiscore=true)\r\n reset_game(true);\r\n\r\n // init start status, we ar enot playing yet, but haning in the welcome screen\r\n playing = false;\r\n\r\n var message1 = new Message(\"Welcome to Kunterbunt's Flappy!\",160,100,0,'24px serif'); // setting TTL ndless\r\n var message2 = new Message(\"Press <RETURN> key to start\",160,130,0,'12px serif');\r\n messageMgr.add(message1);\r\n messageMgr.add(message2);\r\n\r\n // add event handlers\r\n canvas.addEventListener('mouseover', canvas_on_mouseover);\r\n canvas.addEventListener('mouseout', canvas_on_mouseout);\r\n canvas.addEventListener('keydown', canvas_on_keydown);\r\n\r\n // draw it for the first time\r\n draw_scene();\r\n}", "function __initGame() {\n\n __HUDContext = canvasModalWidget.getHUDContext();\n\n __showTitleScreen();\n __bindKeyEvents();\n\n // reset the FPS meter\n canvasModalWidget.setFPSVal(0);\n\n __resetGame();\n\n return __game;\n }", "function startGame(){\n game = new Phaser.Game(790, 400, Phaser.AUTO, 'game', stateActions);\n}", "function startGame() {\n\n\t\tvar gss = new Game(win.canvas);\n\n\t\t// shared zone used to share resources.\n gss.set('keyboard', new KeyboardInput());\n gss.set('loader', loader);\n\n\t\tgss.start();\n\t}", "function startGame() {\n\tsetup();\n\tmainLoop();\n}", "function init() {\n\t// Page elements that we need to change\n\tG.currTitleEl = document.getElementById('current-title');\n\tG.currImageEl = document.getElementById('current-image');\n\tG.currTextEl = document.getElementById('current-text');\n\tG.currChoicesEl = document.getElementById('current-choices-ul');\n\tG.audioEl = document.getElementById('audio-player');\n\t\n\t// Start a new game\n\tnewGame(G);\n}", "function init(){\n board = new Array(9).fill(null);\n turn = 1;\n winner = false;\n render();\n}", "function init() {\n\tplayer.x = WIDTH/2;\n\tplayer.y = (HEIGHT*1.5 - player.height)/2;\n\tenemies = [];\n\tbullets = [];\n\tscore = 0;\n}", "function init()\n\t{\n\t\t\n\t\t\n\t//////////\n\t///STATE VARIABLES\n\tloadMainMenu();\n\t\n\t//////////////////////\n\t///GAME ENGINE START\n\t//\tThis starts your game/program\n\t//\t\"paint is the piece of code that runs over and over again, so put all the stuff you want to draw in here\n\t//\t\"60\" sets how fast things should go\n\t//\tOnce you choose a good speed for your program, you will never need to update this file ever again.\n\n\t//if(typeof game_loop != \"undefined\") clearInterval(game_loop);\n\t//\tgame_loop = setInterval(paint, 60); //old value 130\n\t}", "setupNewGame() {\n\t\tthis.gameState = {\n\t\t\tboard: this.addRandomTile(\n\t\t\t\tthis.addRandomTile(new Array(this.size * this.size).fill(0))\n\t\t\t),\n\t\t\tscore: 0,\n\t\t\twon: false,\n\t\t\tover: false\n\t\t};\n\t\tthis.totalmoves = 0;\n\t\tthis.validmoves = this.getHints().length;\n\t}", "function startGame() { }", "function start() {\n\tclear();\n\tc = new GameManager();\n\tc.startGame();\t\n}", "constructor() {\n this.gameState = GAME_STATE.START;\n }", "function _beginGame() {\n\t//clear the canvas if a restart\n\t$game.$renderer.clearBossLevel();\n\t//set score from tiles colored\n\t_score = $game.$player.getTilesColored();\n\t_bossScore = 0;\n\t$score.text(_score);\n\t_start = new Date().getTime();\n _time = 0;\n _elapsed = '0.0';\n _pause = false;\n _totalTime = 0;\n _target = 90;\n _clockRate = 1;\n _numRegularSeeds = 20;\n _currentCharger = 0;\n _charger = {};\n _seedMode = 0;\n _canPlace = true;\n _placeCharger();\n $('.bossHud .regularSeedButton .hudCount').text(_numRegularSeeds);\n setTimeout(_updateTime, 100);\n //trigger boss music!\n $game.$audio.switchTrack(7);\n}", "function startGame () {\n const deck = freshDeck()\n shuffleDeck(deck)\n const deckMidpoint = Math.ceil(deck.length / 2)\n // setPlayerDeck(deck.slice(0, deckMidpoint))\n // setComputerDeck(deck.slice(deckMidpoint, deck.length))\n setPlayerDeck(deck.slice(0, 3))\n setComputerDeck(deck.slice(3, 6))\n console.log(\"started Game\");\n setStart(true);\n setDoneWithGame(false);\n\n\n }", "function init() {\n stage = new createjs.Stage(document.getElementById(\"canvas\"));\n stage.enableMouseOver(30);\n createjs.Ticker.setFPS(60);\n createjs.Ticker.addEventListener(\"tick\", gameLoop);\n optimizeForMobile();\n //set the current game staate to MENU_STATE\n currentState = constants.MENU_STATE;\n changeState(currentState);\n}", "function startGame(){\n getDictionary();\n var state = $.deparam.fragment();\n options.variant = state.variant || options.variant;\n makeGameBoard();\n loadState();\n }", "startNewGame() {\n this.currentRound = 0;\n this.monsterHealth = 100;\n this.playerHealth = 100;\n this.playerCanAttack = true;\n this.winner = null;\n this.logMsg = [];\n }", "function initGame() {\n shuffle(cards);\n const fragment = document.createDocumentFragment();\n for (const cardIcon of cards) {\n cardElement = createCardElement(cardIcon);\n fragment.appendChild(cardElement);\n }\n const cardDeck = document.querySelector('.deck');\n cardDeck.appendChild(fragment);\n\n const restartElement = document.querySelector('.restart');\n restartElement.addEventListener('click', restartGame);\n const restartButtonElement = document.querySelector('.restart-button');\n restartButtonElement.addEventListener('click', restartGame);\n}", "function initGame() {\n let storedState;\n try {\n storedState = JSON.parse(localStorage.getItem('Game.State'));\n } catch (e) {\n console.log('Unable to deserialize state. State will be reset')\n }\n \n if (!storedState) {\n resetGame();\n } else {\n restoreGame(storedState);\n }\n \n document.querySelector('.restart').addEventListener(\"click\", (e) => {\n resetGame();\n }, false);\n \n document.querySelector('.play-again').addEventListener(\"click\", (e) => {\n resetGame();\n }, false);\n \n let intervalID = window.setInterval((state, cardDeck) => {\n handleTimeIntervar()\n }, 1000, state, cardDeck);\n \n handleTimeIntervar()\n updateScreenMode(true);\n }", "function init() {\n\t\tscore = 0;\n\t\tclearScreen();\n\t\tspeed = DEFAULT_SPEED;\n\t\twell = new gameWell();\n\t\tactBlock = newActBlock();\n\t\tactBlock.draw();\n\t\tnextBlock.draw();\n\t}", "function gameInit() {\n for (var i = 0; i < gameboard.length; i++) {\n gameboard[i].name = \"n\" + i;\n gameboard[i].value = null;\n // .name sets a name to call later\n // .value contains game token (null, x ,y)\n console.log(gameboard);\n console.log(gameboard[i]);\n }\n console.log(gameboard);\n getStart(player);\n}", "function init() {\n gameData = {\n emeraldValue: gemValue(1, 12),\n jewelValue: gemValue(1, 12),\n rubyValue: gemValue(1, 12),\n topazValue: gemValue(1, 12),\n randomTarget: targetScore(19, 120),\n scoreCounter: null,\n }\n targetScore();\n displayAll();\n }", "_init(){\n // clear the squares\n\t\tthis.squares.each(function(){\n\n\t\t\t$(this).html('');\n\n\t\t});\n \n // Reset the game states...\n\t\tthis.gameBoard = [null, null, null, null, null, null, null, null, null]; \n\t\tthis.currentPlayer = 'X';\n\t\tthis.isGameOver = false;\n\t\tthis.numberOfPlayedSquares = 0;\n \n }", "function setupGame(){\n for (i in state){\n state[i] = initstate[i]\n }\n for (i in gstate){\n gstate[i] = 0\n }\n for (i in sstate){\n sstate[i] = 0\n }\n turnCounter = 0\n stateStore = {}\n storeState(state, gStore, sStore)\n turnCounter = 1\n turnView = 0\n drawboard(state, gstate, sstate)\n}", "function init() {\n board = [\n [0, 0, 0, 0, 0, 0], // col 0\n [0, 0, 0, 0, 0, 0], // col 1\n [0, 0, 0, 0, 0, 0], // col 2\n [0, 0, 0, 0, 0, 0], // col 3\n [0, 0, 0, 0, 0, 0], // col 4\n [0, 0, 0, 0, 0, 0], // col 5\n [0, 0, 0, 0, 0, 0], // col 6\n ];\n turn = 1;\n winner = null;\n render();\n}", "function init() {\n MyCanvas.init();\n hero.init();\n MyScore.score = 0;\n MyHeart.heart = 3;\n MyProgressBar.init();\n\n isPause = false;\n isWin = false;\n isGameOver = false;\n\n\n while (mons_array.length > 0) {\n mons_array.pop();\n }\n\n while (mons_array.length < monster_number) {\n generate_mons.add();\n }\n\n console.log('init');\n}", "function Init() {\n \n playGame = false;\n\n statusTab.hide();\n board.hide();\n gameEnd.hide();\n \n startButton.click(function(event) {\n event.preventDefault();\n StartPlaying();\n });\n\n resetButton.click(function(event) {\n event.preventDefault();\n RestartGame();\n });\n}", "init() {\n // Called on scene initialization.\n console.log(\"the-game system init\");\n this.lastCreepReleaseTime = -60000;\n this.creepReleaseFrequency = 20000;\n this.paused = true;\n\n this.startSlots = [0,30,60,90,120,150,180,210,240,270,300,330];\n this._creepCount = 0;\n }", "function initialize() {\n console.log('game initializing...');\n\n document\n .getElementById('game-quit-btn')\n .addEventListener('click', function() {\n network.emit(NetworkIds.DISCONNECT_GAME);\n network.unlistenGameEvents();\n menu.showScreen('main-menu');\n });\n\n //\n // Get the intial viewport settings prepared.\n graphics.viewport.set(\n 0,\n 0,\n 0.5,\n graphics.world.width,\n graphics.world.height\n ); // The buffer can't really be any larger than world.buffer, guess I could protect against that.\n\n //\n // Define the TiledImage model we'll be using for our background.\n background = components.TiledImage({\n pixel: {\n width: assets.background.width,\n height: assets.background.height,\n },\n size: { width: graphics.world.width, height: graphics.world.height },\n tileSize: assets.background.tileSize,\n assetKey: 'background',\n });\n }", "function startGame() {\n //init the game\n gWorld = new gameWorld(6);\n gWorld.w = cvs.width;\n gWorld.h = cvs.height;\n \n gWorld.state = 'RUNNING';\n gWorld.addObject(makeGround(gWorld.w, gWorld.h));\n gWorld.addObject(makeCanopy(gWorld.w));\n gWorld.addObject(makeWalker(gWorld.w, gWorld.h));\n gWorld.addObject(makeWalker(gWorld.w, gWorld.h,true));\n gWorld.addObject(makePlayer());\n \n startBox.active = false;\n pauseBtn.active = true;\n soundBtn.active = true;\n touchRightBtn.active = true;\n touchLeftBtn.active = true;\n replayBtn.active = false;\n \n gameLoop();\n }", "function initialiseGame(){ \n\n\t// Initialisation of the Snitch\n\tvar snitch = document.getElementById(\"snitch\");\n\t// Starting point of the Snitch\n\tsnitch.style.left = '50px';\n\tsnitch.style.top = '95px';\n\theightSnitch = parseInt(snitch.style.height);\n\tlengthSnitch = parseInt(snitch.style.width);\n\n\t// Initialisation of the playground\n\tfield = document.getElementById(\"field\");\n\tmaxLenght = parseInt(field.style.width);\n\tmaxHeight = parseInt(field.style.height);\n\n\tlevel = 0;\n\tinTheGame = false;\n\n\t// The Snitch is moving when the game is off \n\tslowly = setInterval(slowMoving, 20);\n}", "function startGame() {\n createAnsArray();\n playAnswer();\n }", "function startNewGame() {\n game = new Game(); //create a new Game object\n game.startGame(); //Start game by calling startGame() method in the Game class\n keysPressed.length = 0; //reset keysPressed array\n}", "function start(){\n\t\t //Initialize this Game. \n newGame(); \n //Add mouse click event listeners. \n addListeners();\n\t\t}", "prepAndStartNewGame() {\n this.resetPlayers(Player.TOWN);\n this.assignRoles(this.options.numMafia, this.options.numCops, this.options.numDoctors);\n this.updateRoleCounts();\n this.gameState = MAFIA_TIME;\n }", "function initGame() {\n\n game.scores[PLAYER] = scorePlayer(PLAYER);\n game.scores[DEALER] = scorePlayer(DEALER);\n\n updateGameDisplay();\n}", "function init() {\n reset();\n\n //create some enemies\n allEnemies.push(new Enemy());\n allEnemies.push(new Enemy());\n allEnemies.push(new Enemy());\n allEnemies.push(new Enemy());\n\n //create the player\n player = new Player();\n\n // This listens for key presses and sends the keys to your\n // Player.handleInput() method. You don't need to modify this.\n document.addEventListener('keyup', function(e) {\n var allowedKeys = {\n 37: 'left',\n 38: 'up',\n 39: 'right',\n 40: 'down',\n 89: 'y'\n };\n\n player.handleInput(allowedKeys[e.keyCode]);\n });\n\n running = true;\n\n lastTime = Date.now();\n main();\n }", "function startgame() {\t\r\n\tloadImages();\r\nsetupKeyboardListeners();\r\nmain();\r\n}", "function initGame(){\n gamemode = document.getElementById(\"mode\").checked;\n \n fadeForm(\"user\");\n showForm(\"boats\");\n \n unlockMap(turn);\n \n player1 = new user(document.user.name.value);\n player1.setGrid();\n \n turnInfo(player1.name);\n bindGrid(turn);\n}", "function initializeGame()\r\n{\r\n\tintroducing=false;\r\n\t\r\n\tinitializeLevels();\r\n\tinitializePlayer();\r\n\t\r\n\taudio.setProperty({name : 'loop', value : true, channel : 'custom', immediate : true});\r\n\taudio.setProperty({name : 'loop', value : true, channel : 'secondary', immediate : true});\r\n\taudio.setProperty({name : 'loop', value : true, channel : 'tertiary', immediate : true});\r\n\t\r\n\tsetInterval(draw, 1000/FPS);\r\n}", "function initGame(){\r\n correctNumber = getRandomNumber();\r\n guesses = []\r\n displayHistory()\r\n resetResultContent()\r\n}", "function startGame(){\t\n shaman = new Player();\n lightning = new Lightning();\n cStage = 0;\n Stages = [];\n Spells = [];\n Enemies = [];\n Buttons = [];\n ScreenEffects = [];\n ButtonTypesInit();\n UpgradesInit();\n StagesInit();\n LightningPower = 1;\n EarthPower = 1;\n FirePower = 1;\n AirPower = 1;\n WaterPower = 1;\n CDMode = 1;\n CDK = 1;\n wave = 0;\n TotalScore = 0;\n UpgradePoints = 3;\n SpellScreen();\n}", "function initPlayDemo()\n{\n\tdemoRecordIdx = demoGoldIdx = demoBornIdx = 0;\n\tdemoTickCount = 0;\n\tgameState = GAME_RUNNING;\n}", "function initGame(){\r\n\t//initialize game object coordinates\r\n\tbillboard_coords = genPoints(80);\r\n\tzombie_coords = genPoints(5);\r\n\tzombie_speed = [];\r\n\tfor(var i=0; i<zombie_coords.length; i++){\r\n\t\tzombie_speed[i] = genSpeedModifier(0.2);\r\n\t}\r\n\r\n\tzombie_to_kill = [];\r\n\tintensity_loop = 0;\r\n\tbullet_coords = [];\r\n\tbullet_timeouts = [];\r\n\tbullet_timeouts = [];\r\n\tkeysPressed = [];\r\n\tspawn_wait = 160;\r\n\ttime = 0;\r\n\r\n\tscore.innerHTML = '0';\r\n\tnum_bullets.innerHTML = '20';\r\n\r\n\ttrans_mat = [];\r\n\trot_mat = [];\r\n\r\n\tgun_coords = genGunCoords();\r\n\r\n\trender();\r\n}", "function newGame() {\n if (DEBUG) console.log('inside newGame(), calling clearGame() to clean things up...');\n clearGame();\n if (DEBUG) console.log('about to wait a bit before starting the next game...');\n delayOperation = window.setTimeout(function(){ initGame(); }, millisecondOperationDelay);\n }" ]
[ "0.80410624", "0.79410183", "0.790484", "0.77652174", "0.76843137", "0.76833725", "0.76373404", "0.75701165", "0.7564578", "0.7522507", "0.750825", "0.75034875", "0.74794316", "0.74632657", "0.744874", "0.7437712", "0.74331915", "0.74140954", "0.74111825", "0.74034786", "0.73726696", "0.7352623", "0.7337509", "0.7333659", "0.7311042", "0.73078513", "0.7300237", "0.72986066", "0.72982204", "0.7291731", "0.72903746", "0.7272996", "0.7250907", "0.7245813", "0.7239068", "0.7219929", "0.71882355", "0.7183077", "0.7179176", "0.7176274", "0.7174896", "0.71733797", "0.7170583", "0.7170079", "0.71437335", "0.7126144", "0.71224505", "0.7102117", "0.70997113", "0.70976675", "0.7096771", "0.70933855", "0.70905817", "0.708791", "0.70851094", "0.7083304", "0.7078891", "0.707713", "0.70765316", "0.70750844", "0.706754", "0.7049922", "0.7019011", "0.7011356", "0.7005097", "0.700387", "0.70023036", "0.700006", "0.69974816", "0.6997061", "0.6991874", "0.69870335", "0.69651645", "0.6964726", "0.6964424", "0.6955564", "0.69500345", "0.6946662", "0.6944856", "0.6943544", "0.6943183", "0.693944", "0.6938638", "0.6932698", "0.692375", "0.6922505", "0.6914888", "0.69136906", "0.6907819", "0.6905397", "0.6893169", "0.6890983", "0.6890981", "0.68850446", "0.6876746", "0.68745524", "0.68740463", "0.68653136", "0.6864813", "0.6863973", "0.68619627" ]
0.0
-1
================ UI HANDLERS ====================
function initTouchHandlers() { $('.done-button').bind('touchstart', function(e){ nextTurn(); }) $('.mode-button').bind('touchstart', function(e){ const myIndex = $(e.target).data("index"); const myName = $(e.target).data("name"); const myPlayer = $(e.target).data("player"); buttonSelected = player.buttons[myName]; if (buttonSelected.mode.onModeStart) buttonSelected.mode.onModeStart(); updateButtons(); }) $('.mode-button').bind('touchend', function(e){ if (buttonSelected && buttonSelected.mode.onModeEnd) { buttonSelected.mode.onModeEnd(); } updateButtons(); }) $('#container').bind('touchstart', function(e){ e.preventDefault(); const touch = e.targetTouches[0]; touchX = touch.pageX; touchY = touch.pageY; if (buttonSelected && buttonSelected.mode.onTouchStart) { buttonSelected.mode.onTouchStart(); } updateButtons(); }) $('#container').bind('touchmove', function(e){ e.preventDefault(); const touch = e.targetTouches[0]; touchX = touch.pageX; touchY = touch.pageY; if (buttonSelected && buttonSelected.mode.onTouchMove) { buttonSelected.mode.onTouchMove(); } updateButtons(); }) $('#container').bind('touchend touchcancel', function(e){ e.preventDefault(); if (buttonSelected && buttonSelected.mode.onTouchEnd) { buttonSelected.mode.onTouchEnd(); } updateButtons(); }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function UI(){}", "function UI(){}", "function UI() {}", "function UI() {}", "function UI() {}", "function UI() {\n }", "handleInteliUiMenu() {\n //import InteliUI API to be able to communicate with the editor\n var inteliUiApi = new InteliUiApi();\n var container = $('#inteliUi-container');\n\n //start empty inteliUi\n $('#inteliui-start').click(() => {\n inteliUiApi.startEmptyInteliUi(container);\n });\n\n //start empty inteliUi\n $('#inteliui-start-and-open-file').click(() => {\n inteliUiApi.startInteliUiWithOptionFromFile(container);\n });\n\n $('#export-option').click(() => {\n inteliUiApi.getOptionFromWorkspace(container);\n });\n\n }", "function initUI() {\n showDataIsLoaded();\n showExplorePage();\n bindSearchHandler();\n}", "function buildUI(){\t\n\t\t\n\t\treturn;\n\t\t\n\t}", "function HTMLUI () {}", "function buildUI() {\n setPageTitle();\n showMessageFormIfViewingSelf();\n fillMap();\n fetchLanguage();\n getInfo();\n// buildLanguageLinks();\n}", "function bindUIactions() {\n s.avatarUploadButton.on('click', function() {\n selectFilePrompt();\n });\n s.avatarInput.on('change', function() {\n submitAvatarUpload();\n $('body').css({'cursor' : 'wait'});\n });\n }", "function buildUI(){\n fetchMessages();\n }", "render() {\n this._addChooserHandler();\n this._addLoggerListeners();\n this._addButtonHandler();\n }", "function buildUI(){\n fetchUserList();\n}", "bindDisplaySavedNozzlesUI(handler) {\n this.header.displaySavedNozzlesButton.addEventListener('click', e => {\n \n e.preventDefault()\n handler()\n })\n }", "function BPUI() { }", "function HTMLUI(){\n\n }", "handleButton() {}", "function uiClick(e) {\n var clickedId = null;\n if ('target' in e) {\n clickedId = e.target.id;\n }\n if (clickedId === null) {\n return;\n }\n // Menu button.\n if (clickedId === 'menu-button') {\n menuShow();\n }\n // Search button.\n if (clickedId === 'search-button') {\n ui.searchContainer.toggleClass('open');\n if (ui.searchContainer.hasClass('open')) {\n $('.search-input').focus();\n } else {\n $('.search-input').blur();\n }\n }\n\n if (clickedId == 'location') {\n locationZoom();\n }\n if (clickedId == 'compass') {\n ui.mapContainer.toggleClass('hide');\n ui.infoBox.toggleClass('hide');\n if (ui.mapContainer.hasClass('hide')) {\n // Map is hidden, so compass should be revealed.\n compass.checkOperation();\n }\n }\n if (clickedId == 'nav_help') {\n menuHide();\n Help.start();\n }\n if (clickedId === 'nav_satellite') {\n // Change the map to/from satellite imagery.\n map.toggleImagery();\n menuHide();\n }\n if (clickedId === 'nav_language') {\n ui.mainMenuContainer.removeClass('open');\n ui.languageContainer.addClass('open');\n }\n if (clickedId.indexOf('lang_') == 0) {\n ui.languageContainer.removeClass('open');\n menuHide();\n // Change the language!\n var lang = clickedId.substr(5);\n if (messages.setLanguage(lang)) {\n loadText();\n if (displayedCode !== null) {\n displayCodeInformation();\n displayCodeMapCompass(displayedCode);\n }\n }\n }\n}", "function buildUI() {\n loadNavigation();\n setPageTitle();\n fetchBlobstoreUrlAndShowMessageForm();\n showMessageFormIfViewingSelf();\n fetchMessages(\"\");\n addListnerForInfiniteScroll();\n fetchAboutMe();\n initMap();\n addButtonEventForDelete();\n}", "function setUpUI() {\n // Create global var for the UI elements.\n ui = new UiElements();\n\n $('#nav_google').click(menuHide);\n $('#nav_bing').click(menuHide);\n $('#nav_osm').click(menuHide);\n $('#nav_apple').click(menuHide);\n $('#nav_apps').click(menuHide);\n $('.nav_dismiss').click(menuHide);\n\n $('.infobox .pushpin-button').click(togglePushPin);\n\n $('#menu-button').click(uiClick);\n $('#search-button').click(uiClick);\n $('.bottom-bar > button').click(uiClick);\n $('#main-menu > .promote-layer > li').click(uiClick);\n $('#language-menu > .promote-layer > li').click(uiClick);\n\n // The dark shading used when showing the menu has a click action,\n // but normally it ignores clicks - it only receives them when it\n // has the open class applied.\n ui.darkbgElement.click(menuHide);\n\n // Use a mouseover event for button highlighting, because hover doesn't\n // work on mobile.\n if (!isMobile()) {\n $('button').mouseover(function() {$(this).addClass('highlight')});\n $('button').mouseout(function() {$(this).removeClass('highlight')});\n }\n if (navigator.userAgent.toLowerCase().indexOf('ipod') != -1 ||\n navigator.userAgent.toLowerCase().indexOf('iphone') != -1 ||\n navigator.userAgent.toLowerCase().indexOf('mac os') != -1) {\n $('<li>').append(\n $('<a>').attr('id', 'nav_apple'))\n .insertBefore($('#nav_discuss').closest('li'));\n }\n if (navigator.userAgent.toLowerCase().indexOf('android') != -1 ||\n navigator.userAgent.toLowerCase().indexOf('ipod') != -1 ||\n navigator.userAgent.toLowerCase().indexOf('iphone') != -1 ||\n navigator.userAgent.toLowerCase().indexOf('blackberry') != -1) {\n $('<li>').append(\n $('<a>').attr('id', 'nav_apps'))\n .insertBefore($('#nav_discuss').closest('li'));\n }\n loadText();\n}", "function set001_updateUI() {\n\n} // .end of set001_updateUI", "function evtHandler() {\n // console.log(\"event handler initialized\");\n //jQuery('#editbox').dialog({'autoOpen': false});\n\n jQuery('#list-usePref li').click(function () {\n\n resetClass(jQuery(this), 'active');\n jQuery(this).addClass('active');\n // console.log(\"colorSelector: \",colorSelector);\n triggerViz(styleVal);\n\n });\n\n }", "function updateUI(status) {\n\n\tui_status = status;\n\n\tif (ui_status === UI_NO_RESPONSE) {\n\n\t} else if (status === UI_DONE) {\n\t\t// Leds\n\t\tleds.show();\n\t\t// Spinner\n\t\tspinner.hide();\n\t} else if (status === UI_WAITING) {\n\t\t// Button\n\t\tleds.hide();\n\t\t// Spinner\n\t\tspinner.show();\n\t}\n\n}", "function UI() {} //Created prototype from which we can re use all methods", "function click_lyrMenu_조회(ui) {\n\n v_global.process.handler = processRetrieve;\n\n if (!checkUpdatable({})) return;\n\n processRetrieve({});\n\n }", "function buildUI() {\n fetchMessages();\n}", "_drawUi() {\n\t\tthis.elementReplyForm.reset()\n\t\tthis.elementEditForm.reset()\n\t\tif(this.commentJSON.removed)\n\t\t\tthis._drawRemoved()\n\t\telse if(getToken())\n\t\t\tthis._drawUiAuthenticated()\n\t\telse\n\t\t\tthis._drawUiAnonymous()\n\t}", "function buildUI() {\n var _ = this,\n cbs = _.config.callbacks,\n wrapper,\n header,\n content,\n footer,\n dialogPulse = function dialogPulse() {\n _.dialog.classList.add('dlg--pulse');\n setTimeout(function () {\n _.dialog.classList.remove('dlg--pulse');\n }, 200);\n },\n maxSelectCheck = function maxSelectCheck() {\n var checked = content.querySelectorAll('.dlg-select-checkbox:checked');\n if (checked.length === _.config.maxSelect) {\n content.querySelectorAll('.dlg-select-checkbox:not(:checked)').forEach(function (cb) {\n cb.setAttribute('disabled', true);\n cb.parentNode.classList.add('item--disabled');\n });\n if (cbs && cbs.maxReached) cbs.maxReached.call(_, _.config.maxSelect);\n } else {\n content.querySelectorAll('.dlg-select-checkbox:not(:checked)').forEach(function (cb) {\n cb.removeAttribute('disabled');\n cb.parentNode.classList.remove('item--disabled');\n });\n }\n },\n // global event handler\n evtHandler = function evtHandler(e) {\n if (e.type === 'click') {\n // handle overlay click if dialog has no action buttons\n if (e.target.matches('.du-dialog')) {\n if (_.type === vars.buttons.NONE) _.hide();else dialogPulse();\n }\n\n // handle selection item click\n if (e.target.matches('.dlg-select-item')) {\n e.target.querySelector('.dlg-select-lbl').click();\n }\n\n // handle action buttons click\n if (e.target.matches('.dlg-action')) {\n // OK button\n if (e.target.matches('.ok-action')) {\n if (_.config.selection && _.config.multiple) {\n var checked = content.querySelectorAll('.dlg-select-checkbox:checked'),\n checkedVals = [],\n checkedItems = [];\n for (var i = 0; i < checked.length; i++) {\n var item = _.cache[checked[i].id];\n checkedItems.push(item);\n checkedVals.push(typeof item === 'string' ? checked[i].value : item[_.config.valueField]);\n }\n if (checkedVals.length >= _.config.minSelect) {\n _.config.selectedValue = checkedVals;\n if (cbs && cbs.itemSelect) {\n cbs.itemSelect.apply({\n value: checkedVals\n }, [e, checkedItems]);\n _.hide();\n }\n } else {\n dialogPulse();\n if (cbs && cbs.minRequired) cbs.minRequired.call(_, _.config.minSelect);\n }\n } else if (_.config.selection && _.config.confirmSelect) {\n var selected = content.querySelector('.dlg-select-radio:checked');\n if (selected) {\n var _item = _.cache[selected.id];\n _.config.selectedValue = typeof _item === 'string' ? selected.value : _item[_.config.valueField];\n _.hide();\n if (cbs && cbs.itemSelect) cbs.itemSelect.apply(selected, [e, _item]);\n } else dialogPulse();\n } else {\n if (cbs && cbs.okClick) {\n cbs.okClick.apply(_, e);\n if (_.config.hideOnAction) _.hide();\n } else _.hide();\n }\n }\n\n // Yes button\n if (e.target.matches('.yes-action')) {\n if (cbs && cbs.yesClick) {\n cbs.yesClick.apply(_, e);\n if (_.config.hideOnAction) _.hide();\n } else _.hide();\n }\n\n // No button\n if (e.target.matches('.no-action')) {\n if (cbs && cbs.noClick) {\n cbs.noClick.apply(_, e);\n if (_.config.hideOnAction) _.hide();\n } else _.hide();\n }\n\n // CANCEL button\n if (e.target.matches('.cancel-action')) {\n if (cbs && cbs.cancelClick) {\n cbs.cancelClick.apply(_, e);\n if (_.config.hideOnAction) _.hide();\n } else _.hide();\n }\n }\n }\n if (e.type === 'change') {\n // handle selection radio change\n if (e.target.matches('.dlg-select-radio')) {\n var el = e.target;\n if (el.checked && !_.config.confirmSelect) {\n var _item2 = _.cache[el.id];\n _.config.selectedValue = typeof _item2 === 'string' ? el.value : _item2[_.config.valueField];\n _.hide();\n if (cbs && cbs.itemSelect) cbs.itemSelect.apply(el, [e, _item2]);\n }\n } else if (e.target.matches('.dlg-select-checkbox')) {\n if (_.config.maxSelect) maxSelectCheck();\n } else if (e.target.matches('.opt-out-cb')) {\n _.optOut = e.target.checked;\n if (cbs && cbs.optOutChanged) cbs.optOutChanged.call(_, e.target.checked);\n }\n }\n if (e.type === 'scroll') {\n if (e.target.matches('.dlg-content')) e.target.classList[e.target.scrollTop > 5 ? 'add' : 'remove']('content--scrolled');\n }\n if (e.type === 'keyup') {\n if (e.target.matches('.dlg-search')) {\n var _keyword = e.target.value,\n _items = content.querySelectorAll('.dlg-select-item');\n _items.forEach(function (dlgItem) {\n if (dlgItem.classList.contains('select--group')) return;\n var input = dlgItem.querySelector(_.config.multiple ? '.dlg-select-checkbox' : '.dlg-select-radio'),\n item = _.cache[input.id],\n iType = _typeof(item),\n iText = iType === 'string' ? item : item[_.config.textField],\n _matched = false;\n _matched = cbs && cbs.onSearch ? cbs.onSearch.call(_, item, _keyword) : iText.toLowerCase().indexOf(_keyword.toLowerCase()) >= 0;\n dlgItem.classList[_matched ? 'remove' : 'add']('item--nomatch');\n });\n }\n }\n },\n addItemDOM = function addItemDOM(item, id, value, label) {\n var isGroup = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n if (isGroup) {\n var groupEl = createElem('div', {\n className: 'dlg-select-item select--group'\n }, item);\n appendTo(groupEl, content);\n } else {\n var itemEl = createElem('div', {\n className: 'dlg-select-item'\n }),\n selectEl = createElem('input', {\n className: _.config.multiple ? 'dlg-select-checkbox' : 'dlg-select-radio',\n id: id,\n name: 'dlg-selection',\n type: _.config.multiple ? 'checkbox' : 'radio',\n value: value,\n checked: _.config.multiple ? _.config.selectedValue && inArray(_.config.selectedValue, value) : _.config.selectedValue === value\n }),\n labelEl = createElem('label', {\n className: 'dlg-select-lbl',\n htmlFor: id\n }, cbs && cbs.itemRender ? cbs.itemRender.call(_, item) : '<span class=\"select-item\">' + label + '</span>', true);\n _.cache[id] = item;\n appendTo([selectEl, labelEl], itemEl);\n appendTo(itemEl, content);\n }\n },\n addItem = function addItem(item) {\n var type = _typeof(item),\n id = '';\n if (type === 'string') {\n id = (_.config.multiple ? 'dlg-cb' : 'dlg-radio') + removeSpace(item.toString());\n addItemDOM(item, id, item, item);\n } else {\n if (item.group && Array.isArray(item.items)) {\n addItemDOM(item.group, null, null, null, true);\n item.items.forEach(function (i) {\n return addItem(i);\n });\n } else {\n var value = type === 'string' ? item : item[_.config.valueField],\n text = type === 'string' ? item : item[_.config.textField];\n id = (_.config.multiple ? 'dlg-cb' : 'dlg-radio') + removeSpace(value.toString());\n addItemDOM(item, id, value, text);\n }\n }\n };\n _.docFrag = document.createDocumentFragment();\n _.dialog = createElem('div', {\n className: 'du-dialog',\n id: _.config.id\n });\n if (_.config.dark) _.dialog.setAttribute('dark', true);\n if (_.config.selection) _.dialog.setAttribute('selection', true);\n appendTo(_.dialog, _.docFrag);\n wrapper = createElem('div', {\n className: 'dlg-wrapper',\n tabIndex: 0\n });\n\n // dialog loader\n var loader = createElem('div', {\n className: 'dlg-loader'\n });\n var loaderWrapper = createElem('div', {\n className: 'loader-wrapper'\n });\n appendTo(createElem('div', {\n className: 'loading-buffer'\n }), loaderWrapper);\n appendTo(createElem('div', {\n className: 'loading-indicator'\n }), loaderWrapper);\n appendTo(loaderWrapper, loader);\n appendTo(loader, wrapper);\n appendTo(wrapper, _.dialog);\n if (_.title) {\n header = createElem('div', {\n className: 'dlg-header'\n }, _.title);\n appendTo(header, wrapper);\n } else {\n _.dialog.classList.add('dlg--no-title');\n }\n content = createElem('div', {\n className: 'dlg-content'\n });\n if (_.config.selection) {\n if (_.config.allowSearch) {\n appendTo(createElem('input', {\n className: 'dlg-search',\n placeholder: 'Search...'\n }), header);\n }\n _.content.forEach(function (i) {\n return addItem(i);\n });\n if (_.config.multiple && _.config.maxSelect) maxSelectCheck();\n } else content.innerHTML = _.content;\n appendTo(content, wrapper);\n if (_.type !== vars.buttons.NONE) {\n footer = createElem('div', {\n className: 'dlg-actions'\n });\n if (_.config.optOutCb) {\n var cbID = 'opt-out-cb';\n var group = createElem('div', {\n className: 'opt-out-grp'\n });\n appendTo(createElem('input', {\n id: cbID,\n className: cbID,\n type: 'checkbox',\n checked: _.optOut\n }), group);\n appendTo(createElem('label', {\n htmlFor: cbID\n }, _.config.optOutText), group);\n appendTo(group, footer);\n }\n appendTo(footer, wrapper);\n }\n\n /* Setup action buttons */\n switch (_.type) {\n case vars.buttons.OK_CANCEL:\n appendTo([createElem('button', {\n className: 'dlg-action cancel-action',\n tabIndex: 2\n }, _.config.cancelText), createElem('button', {\n className: 'dlg-action ok-action',\n tabIndex: 1\n }, _.config.okText)], footer);\n break;\n case vars.buttons.YES_NO_CANCEL:\n appendTo([createElem('button', {\n className: 'dlg-action cancel-action',\n tabIndex: 3\n }, _.config.cancelText), createElem('button', {\n className: 'dlg-action no-action',\n tabIndex: 2\n }, _.config.noText), createElem('button', {\n className: 'dlg-action yes-action',\n tabIndex: 1\n }, _.config.yesText)], footer);\n break;\n case vars.buttons.DEFAULT:\n appendTo(createElem('button', {\n className: 'dlg-action ok-action',\n tabIndex: 1\n }, _.config.okText), footer);\n break;\n }\n\n /* Register event handler */\n addEvent(content, 'scroll', evtHandler);\n addEvents(_.dialog, ['click', 'change', 'keyup'], evtHandler);\n if (!_.config.init) _.show();\n }", "function prepareUi() {\n //If jobCardId > 0, Its an Update/Put, Hence render UI with retrieved existing data\n if (jobCard[0].jobCardId > 0) {\n renderControls();\n populateUi();\n renderLabourGrid();\n renderMaterialGrid();\n dismissLoadingDialog();\n } else {\n warningDialog(\"No Job Card Specified\", 'SORRY');\n }\n\n //Validate to Check Empty/Null input Fields\n $('#sign').click(function (event) {\n //CHECK IF INVOICE IS NOT POSTED\n if (jobCard[0].fulfilled && !jobCard[0].signed) {\n if (confirm('Are you sure you want to Sign Job card?')) {\n displayLoadingDialog();\n saveSigning();\n } else {\n smallerWarningDialog('Job card Signed already', 'NOTE');\n }\n }\n });\n}", "function click_lyrMenu_조회(ui) {\n\n processRetrieve({});\n\n }", "createUI() {\r\n this._inputAmount = document.querySelector('#inputAmount');\r\n this._message = document.querySelector('.message');\r\n\r\n this._convertBtn = new LoadingButton(document.querySelector('.convert'));\r\n this._convertBtn.element.addEventListener('click', evt => this.convertClickHandler(evt));\r\n }", "function UI() {\n\n}", "function tabUIHandle(segment)\n{\n\tvar widLength = frmUInterface.sbxWidgetDetails.widgets().length;\n\t\n\tkony.print(\"wid LENGTH ::\"+widLength);\n\tif(widLength != 0)\n\t{\n\t\tfor (var i=0 ;i< widLength ;i++)\n\t\t{\n\t\t\tkony.print(\"ENTERED\");\n\t\t\tfrmUInterface.sbxWidgetDetails.removeAt(0);\n\t\t}\n\t}\n\t\n\tif(kony.os.deviceInfo().name != \"thinclient\")\n\t\tfrmUInterface.sbxWidgetDetails.scrollToBeginning();\n\t\n\tvar segId = segment.id;\n\tkony.print(\"segment ID is :: \"+segId);\n\t\n\t\n\tif (segId==\"segContainerWidgets\")\n\t\ttabContainerWidgets(frmUInterface.segContainerWidgets.selectedIndex[1]);\n\telse if (segId==\"segBasicWidgets\")\n\t\ttabBasicWidgets(frmUInterface.segBasicWidgets.selectedIndex[1]);\n\telse\n\t\ttabAdvancedWidgets(frmUInterface.segAdvancedWidgets.selectedIndex[1]);\n\t\t\n\t\n}", "static updateUI() {\n\t\tUI.updateTemp();\n UI.updatePrecip();\n UI.updateIcons();\n Initialize.setDate();\n /* Weather.getWeather(); */\n document.querySelector(\".location\").innerText = city;\n }", "function updateUI(control, event)\r\n{\r\n if (control == \"RecordsetName\")\r\n {\r\n }\r\n else if (control == \"ConnectionName\")\r\n {\r\n _TableName.updateUI(_ConnectionName, event);\r\n }\r\n else if (control == \"Define\")\r\n {\r\n _ConnectionName.launchConnectionDialog();\r\n }\r\n else if (control == \"TableName\")\r\n {\r\n _ColumnList.updateUI(_TableName, event);\r\n _FilterColumn.updateUI(_TableName, event);\r\n _SortColumn.updateUI(_TableName, event);\r\n _ColumnType.pickValue(\"all\");\r\n }\r\n else if (control == \"ColumnType\")\r\n {\r\n var value = _ColumnType.getValue();\r\n if (value == \"all\")\r\n {\r\n _ColumnList.setDisabled(true, true);\r\n }\r\n else\r\n {\r\n _ColumnList.setDisabled(false);\r\n }\r\n }\r\n else if (control == \"FilterColumn\")\r\n {\r\n if (_FilterColumn.getValue() == \"\")\r\n {\r\n _FilterOperator.setDisabled(true);\r\n _FilterParameter.setDisabled(true);\r\n _FilterParameterValue.setValue(\"\");\r\n _FilterParameterValue.setDisabled(true);\r\n }\r\n else\r\n {\r\n _FilterOperator.setDisabled(false);\r\n _FilterParameter.setDisabled(false);\r\n _FilterParameterValue.setDisabled(false);\r\n _FilterParameterValue.setValue(_FilterColumn.getValue());\r\n }\r\n }\r\n else if (control == \"SortColumn\")\r\n {\r\n if (_SortColumn.getValue() == \"\")\r\n {\r\n _SortDirection.setDisabled(true);\r\n }\r\n else\r\n {\r\n _SortDirection.setDisabled(false);\r\n }\r\n }\r\n else\r\n {\r\n //alert(\"updateUI(\" + control + \", \" + event + \")\");\r\n }\r\n}", "function handleUi() {\n var buttonText = 'Copy event URL';\n // create button copy url node\n var button = (function () {\n var buttonTemplate = `<div id=\":999.copy_url_top\" class=\"ep-ea-btn-wrapper\">&nbsp;<div class=\"goog-inline-block goog-imageless-button\" role=\"button\" tabindex=\"0\" style=\"-webkit-user-select: none;\"><div class=\"goog-inline-block goog-imageless-button-outer-box\"><div class=\"goog-inline-block goog-imageless-button-inner-box\"><div class=\"goog-imageless-button-pos\"><div class=\"goog-imageless-button-top-shadow\">&nbsp;</div><div class=\"goog-imageless-button-content\">${buttonText}</div></div></div></div></div></div>`;\n var button = document.createElement('div');\n button.innerHTML = buttonTemplate;\n return button.childNodes[0];\n })();\n\n // container where all the action buttons are in like save, discard etc\n var buttonContainer = document.querySelector('.ep-ea');\n var lastButton = buttonContainer.querySelector('.ep-ea-btn-wrapper:last-of-type');\n\n // insert button after the last button\n buttonContainer.insertBefore(button, lastButton.nextSibling);\n var buttonTextContainer = button.querySelector('.goog-imageless-button-content');\n\n button.addEventListener('click', function () {\n var eventUrl = retrieveEventUrl();\n var confirmButtonText = buttonText + ' ✔';\n copyToClipboard(eventUrl);\n buttonTextContainer.textContent = confirmButtonText;\n\n window.setTimeout(function () {\n buttonTextContainer.textContent = buttonText;\n }, 5000);\n });\n\n }", "function OnGUI () {\n\n // Getting current view by active view name:\n var currentView : View = viewByName[activeViewName];\n \n // Set blockUI for current view:\n currentView.setBlockUI(blockUI);\n\n // Rendering current view:\n currentView.render();\n\n\n\n // Show box with \"Wait...\" when UI is blocked:\n var screenWidth = Screen.width;\n var screenHeight = Screen.height;\n if(blockUI) {\n GUI.Box(Rect((screenWidth - 200)/2, (screenHeight - 60)/2, 200, 60), \"Wait...\");\n }\n}", "bind() {\n this.updateUI();\n }", "function updateUI(type) {\n var messageObject = {\n type: CONFIG.UPDATE_UI,\n subtype: type ? type : \"\",\n value: type ? dynamicData[type] : dynamicData\n };\n if (DEBUG) {\n print(\"Update UI\", type);\n }\n ui.sendToHtml(messageObject);\n }", "function updateInterface() {\n\n // Set fg_endpoint into the dialog box text control\n $('#fgTestURL').prop('placeholder', FGGUI.fg_endpoint);\n $('#searchForm').hide();\n\n\nif(FGGUI.fg_checked) {\n $('#loginNavIco').prop('class', 'badge badge-danger');\n $('#loginNavIcoImg').prop('class', 'fas fa-times');\n $('#pageContent').html('');\n $('#pageContent').append(loginAlert);\n $('#fgCheckedButton').prop('class', 'btn btn-primary');\n $('#fgCheckedButton').find('i').prop('class', 'fas fa-check');\n $('#settingsNavIco').prop('class', 'badge badge-primary');\n $('#settingsNavIcoImg').prop('class', 'fas fa-check');\n $('#loginNav').show();\n if(FGGUI.fg_logged) {\n $('#loginNavIco').prop('class', 'badge badge-primary');\n $('#loginNavIcoImg').prop('class', 'fas fa-check');\n $('#alertContent').hide();\n } else {\n return;\n }\n } else {\n $('#pageContent').html('');\n $('#pageContent').append(checkAlert);\n $('#fgCheckedButton').prop('class', 'btn btn-danger');\n $('#fgCheckedButton').find('i').prop('class', 'fas fa-times');\n $('#settingsNavIco').prop('class', 'badge badge-danger');\n $('#settingsNavIcoImg').prop('class', 'fas fa-times');\n $('#loginNav').hide();\n return;\n }\n\n // Get rendered page\n var page = APPSTATE.page;\n\n // Page specific composition\n console.log(\"Page from breadcumBar: \" + page);\n switch(page.toLocaleLowerCase()) {\n case 'home':\n $('#breadcumbBar').html(\n '<li class=\"breadcrumb-item active\"><a href=\"' + APPSTATE.url_prefix + '/\">Home</li>');\n updateHome();\n break;\n case 'infrastructures':\n $('#breadcumbBar').html(\n '<li class=\"breadcrumb-item active\"><a href=\"' + APPSTATE.url_prefix + '/\">Home</li>' +\n '<li class=\"breadcrumb-item active\"><a href=\"' + APPSTATE.url_prefix + '/infrastructures\">Infrastructures</li>');\n updateInfrastructures();\n break;\n case 'infrastructure':\n var pages_array = APPSTATE.pageaddr.split('/');\n var infra_id = pages_array[pages_array.length - 1];\n $('#breadcumbBar').html(\n '<li class=\"breadcrumb-item active\"><a href=\"' + APPSTATE.url_prefix + '/\">Home</li>' +\n '<li class=\"breadcrumb-item active\"><a href=\"' + APPSTATE.url_prefix + '/infrastructures\">Infrastructures</li>' +\n '<li class=\"breadcrumb-item active\"><a href=\"' + APPSTATE.url_prefix + '/infrastructures/'+ infra_id +'\">' + infra_id + '</li>');\n updateInfrastructure();\n break;\n case 'applications':\n $('#breadcumbBar').html(\n '<li class=\"breadcrumb-item active\"><a href=\"' + APPSTATE.url_prefix + '/\">Home</li>' +\n '<li class=\"breadcrumb-item active\"><a href=\"' + APPSTATE.url_prefix + '/applications\">Applications</li>');\n updateApplications();\n break;\n case 'application':\n var pages_array = APPSTATE.pageaddr.split('/');\n var app_id = pages_array[pages_array.length - 1];\n $('#breadcumbBar').html(\n '<li class=\"breadcrumb-item active\"><a href=\"' + APPSTATE.url_prefix + '/\">Home</li>' +\n '<li class=\"breadcrumb-item active\"><a href=\"' + APPSTATE.url_prefix + '/applications\">Applications</li>' +\n '<li class=\"breadcrumb-item active\"><a href=\"' + APPSTATE.url_prefix + '/applications/'+ app_id +'\">' + app_id + '</li>');\n updateApplication();\n break;\n case 'tasks':\n $('#breadcumbBar').html(\n '<li class=\"breadcrumb-item active\"><a href=\"' + APPSTATE.url_prefix + '/\">Home</li>' +\n '<li class=\"breadcrumb-item active\"><a href=\"' + APPSTATE.url_prefix + '/tasks\">Tasks</li>');\n updateTasks();\n break;\n case 'task':\n var pages_array = APPSTATE.pageaddr.split('/');\n var task_id = pages_array[pages_array.length - 1];\n $('#breadcumbBar').html(\n '<li class=\"breadcrumb-item active\"><a href=\"' + APPSTATE.url_prefix + '/\">Home</li>' +\n '<li class=\"breadcrumb-item active\"><a href=\"' + APPSTATE.url_prefix + '/tasks\">Tasks</li>' +\n '<li class=\"breadcrumb-item active\"><a href=\"' + APPSTATE.url_prefix + '/tasks/'+ task_id +'\">' + task_id + '</li>');\n updateTask();\n break;\n case 'users':\n $('#breadcumbBar').html(\n '<li class=\"breadcrumb-item active\"><a href=\"' + APPSTATE.url_prefix + '/\">Home</li>' +\n '<li class=\"breadcrumb-item active\"><a href=\"' + APPSTATE.url_prefix + '/users\">Users</li>');\n updateUsers();\n break;\n case 'groups':\n $('#breadcumbBar').html(\n '<li class=\"breadcrumb-item active\"><a href=\"' + APPSTATE.url_prefix + '/\">Home</li>' +\n '<li class=\"breadcrumb-item active\"><a href=\"' + APPSTATE.url_prefix + '/groups\">Groups</li>');\n updateGroups();\n break;\n case 'roles':\n $('#breadcumbBar').html(\n '<li class=\"breadcrumb-item active\"><a href=\"' + APPSTATE.url_prefix + '/\">Home</li>' +\n '<li class=\"breadcrumb-item active\"><a href=\"' + APPSTATE.url_prefix + '/roles\">Roles</li>');\n updateRoles();\n break;\n case 'notaccessible':\n $('#breadcumbBar').html(\n '<li class=\"breadcrumb-item active\"><a href=\"' + APPSTATE.url_prefix + '/\">Home</li>');\n notAccessiblePage();\n break;\n default:\n $('#breadcumbBar').html(\n '<li class=\"breadcrumb-item active\"><a href=\"' + APPSTATE.url_prefix + '/\">Home</li>');\n console.log(\"Unhandled page: \" + page);\n return;\n }\n}", "updateUI(){\n this.GUI.updateUI();\n }", "function click_lyrMenu_조회(ui) {\n\n v_global.process.handler = processRetrieve;\n\n if (!checkUpdatable({})) return false;\n\n processRetrieve({});\n\n }", "onAfterRendering() {}", "update (descriptor) {\n // update helper's own UI if needed\n // etc\n }", "function buildUI() {\n getSavedOptions();\n if (validPointer(document.getElementById('xedx-main-div'))) {\n log('UI already installed!');\n return;\n }\n\n let parentDiv = document.querySelector(\"#mainContainer > div.content-wrapper > div.userlist-wrapper\");\n if (!validPointer(parent)) {setTimeout(buildUI, 500);}\n\n loadTableStyles();\n $(separator).insertBefore(parentDiv);\n $(xedx_main_div).insertBefore(parentDiv);\n\n installHandlers();\n setDefaultCheckboxes();\n hideDevOpts(!opt_devmode);\n indicateActive();\n log('UI installed.');\n }", "function initUI() {\n\tlogMessage(REP_ITEM_NOTE, \"bc_configure_edit\", \"calling initUI --- \" + globals.editorPage);\n\t// get panel color//\n\tvar col = dw.getPanelColor();\n\tvar backgroundColor = MM.BC.UTILS.RGB2HTML(col[0], col[1], col[2]);\n\tvar loadingDiv = document.getElementById(\"loadingDiv\");\n\t\n\tvar cancel_btn = document.getElementById(\"cancelBtn\");\n\tvar cancel_btn_container = document.getElementById(\"cancelBtnContainer\");\n\tcancel_btn_container.style.width = cancel_btn.style.width;\n\t\n\tloadLoadingPage();\t \n\t\n\tloadingDiv.style.width = globals.width + \"px\";\n\tloadingDiv.style.height = globals.height + \"px\";\n\t\n\tloadingDiv.style.backgroundColor = \"#\" + backgroundColor;\n\t\n\t// Setup the browser control.\n\tglobals.browser = document.getElementById(\"bc_priority_browser\");\t\n\tglobals.browser.setAutomaticallyPromptForCredentials(false);\n\tglobals.browser.style.top = \"0px\";\n\tglobals.browser.style.left = \"0px\";\n\tglobals.browser.style.width = window.innerWidth + \"px\";\n\tglobals.browser.style.height = (window.innerHeight - 55) + \"px\";\n\t// add general listeners on browser control//\n\tif (globals.browser && globals.browser.addEventListener) {\n\t\tglobals.browser.addEventListener(\"BrowserControlBeforeNavigation\", function (e) { onBeforeNavigation(e); }, false);\n\t\tglobals.browser.addEventListener(\"BrowserControlBeforeRefresh\", function(e) { e.preventDefault(); }, false);\n\t}\n\t\n\tglobals.initedUI = true;\n\n\t// get the module code//\n\tvar dom = dw.getDocumentDOM();\n\tvar sel = dom.getSelection();\n\tif (globals.editMode) {\n\t\tglobals.moduleCode = dom.documentElement.outerHTML.substring(sel[0], sel[1]);\n\t}\n\tglobals.targetURL = globals.editorPage;\n\t// show loading state//\n\tshowLoadingState();\n\t// if we have a site token//\n\tif (MM.BC.TOKENS.getSiteToken(MM.BC.SITE.getSiteID())) {\n\t\t// if we don't have a site token, start api calls//\n\t\tbrowseTo(MM.BC.CONSTANTS.BC_LOCAL_PAGE, true, function() {\n\t\t\t// load module editor page//\n\t\t\tloadModuleEditorPage();\t\t\n\t\t}, true);\n\t} else {\n\t\t// if we don't have a site token, start api calls//\n\t\tbrowseTo(MM.BC.CONSTANTS.BC_LOCAL_PAGE, true, function() {\n\t\t\tstartAPIProcesses(MM.BC.TOKENS.getGenericToken(), MM.BC.SITE.getSiteID());\n\t\t}, true);\n\t}\n}", "function init_ui(){\n\twindow.addEventListener('click', function(e){\n\t\te.preventDefault();\n\t\t$('.collapse').collapse(\"hide\");\n\t\t}, false);\n\tapp.session.data.pages = {mkt: document.getElementById('market_info_page'),\n\t\t\tfmg: document.getElementById('farming_tips_page'),\n\t\t\twtr: document.getElementById('weather_page'),\n\t\t\tdis: document.getElementById('plant_diseases_page'),\n\t\t\tchm: document.getElementById('plant_chemicals_page'),\n\t\t\ttls: document.getElementById('plant_tools_page'),\n\t\t\trpt: document.getElementById('report_page'),\n\t\t\tacc: document.getElementById('account_page'),\n\t\t\tactive: null};\n\t//prepare elements for events\n\tdocument.getElementById('market_btn').parentElement.addEventListener('click', with_delay(set_mkt_active, 200), false );\n\tdocument.getElementById('agri_tips_btn').parentElement.addEventListener('click', with_delay(set_fmg_active, 200), false );\n\tdocument.getElementById('weather_short_button').addEventListener('click', with_delay(set_wtr_active, 200), false );\n\tdocument.getElementById('scan_cam_button').addEventListener('click', with_delay(set_cam_active, 200), false);\n}", "function UI() {\n\t\tthis.name = \"ui\";\n\t\tthis.global_id = \"ui>model\";\n\n\t\t//this.update = core.task.create([\"update\", update_element]);\n\t\tthis.model = core.task.create([\"model\", set_model]);\n\n\t\t//this.in_dom = core.task.create([\"in_dom\", elem_dom_added]);\n\t\t//this.dom_queue = core.task.create([\"dom_queue\", push_to_dom_queue]);\n\t\tthis.clean_up = core.task.create([\"clean_up\", clean_up]);\n\t\t//this.ui = ui;\n\n\t\tthis.get_t = function() {\n\t\t\tfor (var i=0; i < template_names.length; ++i) {\n\t\t\t\tconsole.log(i+\">\"+template_names[i]+\"\\n\"+template_storage[i]+\"\\n\\n\");\n\t\t\t}\n\t\t}\n\t}", "create () {\n // create helper's own UI\n // bind events\n // etc\n }", "_beforeRender () {\n if (webix.ARCHIBUS.buttonsMap) {\n for (var key in webix.ARCHIBUS.buttonsMap) {\n var button = webix.ARCHIBUS.buttonsMap[key];\n this.on_click[button.class] = webix.actions[button.function];\n }\n }\n if (webix.ARCHIBUS.editButtonMap) {\n for (var key in webix.ARCHIBUS.editButtonMap) {\n var button = webix.ARCHIBUS.editButtonMap[key];\n this.on_click[button.class] = button.function;\n }\n }\n }", "function click_lyrMenu_확인(ui) {\n\n informResult({});\n\n }", "function getSignUpUI() {\n fetch('/api/signUp', {\n method: 'GET'\n }).then(response => response.text())\n .then(res => {\n var mainBody = document.getElementById('main-body');\n mainBody.innerHTML = res;\n selectIcon('home');\n });\n}", "constructor() {\n // SETUP ALL THE EVENT HANDLERS FOR EXISTING CONTROLS,\n // MEANING THE ONES THAT ARE DECLARED IN index.html\n\n // FIRST THE NEW LIST BUTTON ON THE HOME SCREEN\n this.registerEventHandler(TodoGUIId.HOME_NEW_LIST_BUTTON, TodoHTML.CLICK, this[TodoCallback.PROCESS_CREATE_NEW_LIST]);\n\n // THEN THE CONTROLS ON THE LIST SCREEN\n this.registerEventHandler(TodoGUIId.LIST_HEADING, TodoHTML.CLICK, this[TodoCallback.PROCESS_GO_HOME]);\n this.registerEventHandler(TodoGUIId.LIST_NAME_TEXTFIELD, TodoHTML.KEYUP, this[TodoCallback.PROCESS_CHANGE_NAME]); // Name\n\n // Owner TextField\n this.registerEventHandler(TodoGUIId.LIST_OWNER_TEXTFIELD, TodoHTML.KEYUP, this[TodoCallback.PROCESS_CHANGE_OWNER]);\n\n // Trash Can\n // this.registerEventHandler(TodoGUIId.LIST_TRASH, TodoHTML.CLICK, window.todo.view.showDialog());\n this.registerEventHandler(TodoGUIId.LIST_TRASH, TodoHTML.CLICK, this[TodoCallback.PROCESS_DELETE_LIST]);\n // this.registerEventHandler(TodoGUIId.LIST_TRASH, TodoHTML.CLICK, this[TodoCallback.PROCESS_SHOW_DIALOG]);\n\n // Dialog Modal - yes button\n this.registerEventHandler(TodoGUIId.MODAL_YES_BUTTON, TodoHTML.CLICK, this[TodoCallback.PROCESS_CONFIRM_DELETE_LIST]);\n\n // Dialog Modal - no button\n this.registerEventHandler(TodoGUIId.MODAL_NO_BUTTON, TodoHTML.CLICK, this[TodoCallback.PROCESS_CANCEL_DELETE_LIST]);\n\n // Item Screen - submit button\n // ITEM_FORM_SUBMIT_BUTTON\n this.registerEventHandler(TodoGUIId.ITEM_FORM_SUBMIT_BUTTON, TodoHTML.CLICK, this[TodoCallback.PROCESS_SUBMIT_ITEM_CHANGES]);\n // figure out if item is edited or if item is added\n \n // Item Screen - cancel button\n // ITEM_FORM_CANCEL_BUTTON\n this.registerEventHandler(TodoGUIId.ITEM_FORM_CANCEL_BUTTON, TodoHTML.CLICK, this[TodoCallback.PROCESS_CANCEL_ITEM_CHANGES]);\n }", "function generateUI() {\n var modelToolBar = new ModelToolbar();\n mainParent.append(modelToolBar.ui);\n setLocation(mainParent, modelToolBar.ui, 'left', 'top');\n // modelToolBar.updateInputLength();\n\n var contextMenu = new ContextMenu();\n mainParent.append(contextMenu.ui);\n setPosition(contextMenu.ui, 100, 100)\n\n var surfaceMenu = new SurfaceMenu();\n mainParent.append(surfaceMenu.ui);\n setLocation(mainParent, surfaceMenu.ui, 'right', 'top', 0, modelToolBar.ui.height() + 5);\n\n\n var selectionBox = new SelectionBox(icons.select);\n mainParent.append(selectionBox.ui);\n setLocation(mainParent, selectionBox.ui, 'left', 'top', 0, modelToolBar.ui.height() + 5);\n\n // Fixing Context Menu Behaviour\n selectionBox.ui.on('mousedown', () => {\n stateManager.exitContextMenu();\n });\n\n surfaceMenu.ui.on('mousedown', () => {\n stateManager.exitContextMenu();\n });\n\n return {\n modelToolBar: modelToolBar,\n selectionBox: selectionBox,\n contextMenu: contextMenu,\n surfaceMenu: surfaceMenu\n }\n }", "function prepareUi() \n{\t\n renderControls();\n\n $('#save').click(function (event) {\n\t\tvar cashier = $('#currentCashier').data('kendoComboBox').text();\n\t\tif (confirm(\"Are you sure you want to open till for \"+cashier)) {\n\t\t\tsaveCashierTill();\t\t\t\t\n\t\t} else\n\t\t{\n smallerWarningDialog('Please review and save later', 'NOTE');\n }\n\t});\n\t\n\t$('#close').click(function (event) {\n\t\tvar cashier = $('#currentCashier').data('kendoComboBox').text();\n\t\tif (confirm(\"Are you sure you want to close till for \"+cashier)) {\n\t\t\tcloseCashierTill();\t\t\t\t\n\t\t} else\n\t\t{\n smallerWarningDialog('Please review and save later', 'NOTE');\n }\n\t});\n}", "function updateUI(retrieved) {\n populateTransactions(retrieved);\n updateHeaderInfo();\n}", "function displayUI() {\n /*\n * Be sure to remove any old instance of the UI, in case the user\n * reloads the script without refreshing the page (updating.)\n */\n $('#plugbot-ui').remove();\n\n /*\n * Generate the HTML code for the UI.\n */\n $('#chat').prepend('<div id=\"plugbot-ui\"></div>');\n var cWoot = autowoot ? \"#3FFF00\" : \"#ED1C24\";\n var cQueue = autoqueue ? \"#3FFF00\" : \"#ED1C24\";\n var cHideVideo = hideVideo ? \"#3FFF00\" : \"#ED1C24\";\n var cUserList = userList ? \"#3FFF00\" : \"#ED1C24\";\n $('#plugbot-ui').append(\n '<p id=\"plugbot-btn-woot\" style=\"color:' + cWoot + '\">auto-woot</p><p id=\"plugbot-btn-queue\" style=\"color:' + cQueue + '\">auto-queue</p><p id=\"plugbot-btn-hidevideo\" style=\"color:' + cHideVideo + '\">hide video</p><p id=\"plugbot-btn-userlist\" style=\"color:' + cUserList + '\">userlist</p><h2 title=\"This makes it so you can give a user in the room a special colour when they chat!\">Custom Username FX: <br /><br id=\"space\" /><span onclick=\"promptCustomUsername()\" style=\"cursor:pointer\">+ add new</span></h2>');\n}", "showInteliUi(context) {\n var inteliUi = new InteliUi();\n\n var options = {\n id: 'inteliUi',\n title: 'Edytor opcji',\n model: {\n id: 'inteliUi-modal',\n size: 'xl'\n },\n onshownCallback: inteliUi.showInteliUiInModal,\n inteliUi: inteliUi,\n callback: inteliUi.handleInteliUiMenu,\n closeByBackdrop: false,\n closeByKeyboard: false,\n closable: true,\n context: context,\n primaryButtonAction: function () {\n },\n buttons: [\n {label: 'Zapisz'}\n ],\n btnPrimaryColor: 'success'\n\n };\n\n bs.showModal(options);\n }", "function handleQuizApp() {\n \n render();\n startPageHandler();\n questionPageHandler();\n feedbackPageHandler();\n resultsPageHandler();\n}", "static tickUiUpdate() {\n // Fill badge data\n let updateParcel = {\n text: \"\",\n color: \"#d352ad\",\n tooltip: \"\"\n };\n\n this.setUpdateObjTexts(updateParcel);\n\n // Apply to UI\n if (this.networkOk) {\n this.applyBadgeConfig(updateParcel);\n }\n\n this.updatePopupUi(updateParcel);\n }", "_buttonClickHandler() { }", "function onClickToggleUi() {\n bg.ui_state = bg.ui_state === UI_NORMAL ? UI_AUTOGROUP : UI_NORMAL;\n renderSearchResults(document.getElementById(\"input_search_tab\").value);\n}", "function prepareUi() \n{\n\t\t\n //If arInvoiceId > 0, Its an Update/Put, Hence render UI with retrieved existing data\n if (jobCard.jobCardId > 0) {\n renderControls();\n //populateUi();\n dismissLoadingDialog();\n } else //Else its a Post/Create, Hence render empty UI for new Entry\n {\n renderControls();\n dismissLoadingDialog();\n }\n\n\t//Validate to Check Empty/Null input Fields\n $('#save').click(function (event) {\n var validator = $(\"#myform\").kendoValidator().data(\"kendoValidator\");\n\t\t\n if (!validator.validate()) {\n smallerWarningDialog('One or More Fields are Empty', 'ERROR');\n } else {\n\t\t\tvar materialDetailGridData = $(\"#materialDetailGrid\").data().kendoGrid.dataSource.view();\t\t\t\t\t\n\t\t\tvar labourDetailGridData = $(\"#labourDetailGrid\").data().kendoGrid.dataSource.view();\t\t\t\t\t\n\t\t\t\t\n\t\t\tif (materialDetailGridData.length > 0 && labourDetailGridData.length > 0) {\n\t\t\t\tdisplayLoadingDialog();\n\t\t\t\tsaveMaterialDetailGridData(materialDetailGridData);\n\t\t\t\tsaveLabourDetailGridData(labourDetailGridData);\n\n\t\t\t\t//Retrieve & save Grid data\n\t\t\t\tsaveJobCard();\n }else {\n smallerWarningDialog('One or More Details grid is/are empty', 'NOTE');\n }\n //});\n\t\t}\n\t});\n}", "function handleButtons () {\n handleStartButton();\n handleSubmitButton();\n handleNextButton();\n handleShowAllQandA();\n handleRestartButton();\n }", "function updateUI(){\n currentEvent = $(\"#cEvent\").text().trim();\n console.log(\"Current Event: \" + currentEvent);\n toggleButtons(currentEvent);\n switch (currentEvent) {\n case \"none\":\n break;\n\n case \"open\":\n break;\n\n case \"start\":\n myTimer.isReloading = true;\n myTimer.startTimer();\n break;\n\n case \"freetime\":\n myTimer.isReloading = true;\n myTimer.startTimer();\n break;\n\n case \"freezeLeaderboard\":\n myTimer.isReloading = true;\n myTimer.startTimer();\n break;\n\n case \"stop\":\n myTimer.displayElapsedTime();\n break;\n\n case \"close\":\n myTimer.displayElapsedTime();\n break;\n }\n}", "handleClick() {}", "function renderUI()\n{\n debug_renderUI();\n}", "function prepareUi() {\n $('#tabs').kendoTabStrip();\n renderGrid();\n dismissLoadingDialog(); \n}", "function prepareUi() {\n $('#tabs').kendoTabStrip();\n renderGrid();\n dismissLoadingDialog(); \n}", "function prepareUi() \n{\n renderControls();\n dismissLoadingDialog();\n\t\n\t\n\t//Validate to Check Empty/Null input Fields\n $('#viewSchedule').click(function (event) {\n var validator = $(\"#myform\").kendoValidator().data(\"kendoValidator\");\n\t\t\t\n\t\t\t\n if (!validator.validate()) {\n smallerWarningDialog('One or More Fields are Empty', 'ERROR');\n } else {\n\t\t\tdisplayLoadingDialog();\n\t\t\t//Retrieve & save Grid data\n\t\t\tviewSampleSchedule();\n\t\t}\n\t});\n\t\n\t//Validate to Check Empty/Null input Fields\n $('#approve').click(function (event) {\n\t\n var validator = $(\"#myform\").kendoValidator().data(\"kendoValidator\");\n\t\t\n if (!validator.validate()) {\n smallerWarningDialog('One or More Fields are Empty', 'ERROR');\n } else {\n\t\t\tdisplayLoadingDialog();\n\t\t\t//Retrieve & save Grid data\n\t\t\tsaveBorrowing();\n\t\t}\n\t});\n}", "function makeCoolUI() {\n\t\tonglets_ui.tabs( \"destroy\");\n\t\tlth = jQuery('.linktohide');\n\t\thideable = jQuery('.hideable');\n\t\tagmk_chat_ui.resizable( { animate: true, ghost: true, aspectRatio: false, alsoResize: '#content_agmk_chat'} );\n\t\tagmk_chat_ui.resizable( \"option\", \"alsoResize\", \"#menu_agmk_chat\" );\n\t\tagmk_chat_ui.resizable( \"option\", \"alsoResize\", \"#form_agmk_chat\" );\n\t\tagmk_chat_ui.draggable( {addClasses: false} );\n\t\tonglets_ui.tabs();\n\t\tjQuery.each(lth, function() {\n\t\t\tjQuery(this).on('click', function() {\n\t\t\t\thideAllExcept(jQuery(this).attr('href'));\n\t\t\t\tongletActuel = jQuery(this).attr('numOnglet');\n\t\t\t});\n\t\t});\n\t\thideAllExcept('onglet-'+ongletActuel+'_agmk_chat');\n\t}", "function on_ui_update (args) {\n var info = args[0];\n console.log(\"on_ui_update() event received with: \" + info);\n showFeedback(info['success']['message'])\n }", "initBrowseView() {\n\n let microServiceEndpoints = [\n // 0) JSON Static, we used it for defining the data interface of a generic record for updating\n \"jsonprototypes/address-book-record-prototype.json\",\n\n // 1) JSON Static, we used it for defining the data interface of a new record for adding\n \"jsonprototypes/address-book-new-record-prototype.json\",\n\n // 2) A PHP implementation of JSON service\n \"services/address-book-record-get.php?activity=\",\n\n // 3) A Java JSP implementation of JSON service\n \"http://\" + JAVA_TOMCAT_HOST + \"/Esame/1_showActivities.jsp\"\n ];\n\n let selectedMicroServiceEndpoint = microServiceEndpoints[3];\n\n let controller = this;\n\n /* Call the microservice and evaluate data and result status */\n $.getJSON(selectedMicroServiceEndpoint, function (data) {\n controller.renderGUI(data);\n }).done(function () {\n controller.showMessageStatus(\"green\", \"All done\");\n }).fail(function () {\n controller.showMessageStatus(\"red\", \"Error while requesting service: \" + controller.serviceEndPoint);\n });\n\n this.showMessageStatus(\"black\", \"Requesting data from service: \" + this.serviceEndPoint);\n }", "update(ui) {\n const enable_if = (name, condition) => {\n const element = this.element.querySelector(`.action[data-name=\"${name}\"]`);\n element.disabled = !condition;\n };\n\n enable_if(\"Undo\", ui.history.present !== 0);\n enable_if(\"Redo\", ui.history.present < ui.history.actions.length);\n enable_if(\"Select all\", ui.selection.size < ui.quiver.all_cells().length);\n enable_if(\"Deselect all\", ui.selection.size > 0);\n enable_if(\"Delete\", ui.selection.size > 0);\n enable_if(\"Centre view\", ui.quiver.cells.length > 0 && ui.quiver.cells[0].size > 0);\n enable_if(\"Zoom in\", ui.scale < 1);\n enable_if(\"Zoom out\", ui.scale > -2.5);\n enable_if(\"Reset zoom\", ui.scale !== 0);\n }", "registerGoLogoLoEventHandlers(){\n\n var work = this.model.getCurrentWork();\n\n let textDiv = document.getElementById(GoLogoLoGUIId.GOLOGOLO_TEXT);\n\n /* You should modify the text in this to allow you to change the text that appears in the logo, if you desire\n this modal should also be used for naming your logo once you create it */\n let editTextButton = document.getElementById(GoLogoLoGUIId.GOLOGOLO_EDIT_TEXT_BUTTON);\n editTextButton.addEventListener(\"click\", function(){\n this.processEditText(); \n \n }.bind(this));\n\n if(document.getElementById(\"appster_text_input_modal_cancel_button\")){\n let cancelButton = document.getElementById(\"appster_text_input_modal_cancel_button\");\n cancelButton.addEventListener(\"click\", function(){\n this.model.view.hideTextEditingModal();\n \n }.bind(this));\n }\n\n\n\n let fontSizeSlider = document.getElementById(GoLogoLoGUIId.GOLOGOLO_FONT_SIZE_SLIDER);\n fontSizeSlider.oninput = function(e){\n var work = this.model.getCurrentWork();\n work.setFontSize(e.target.value)\n this.model.view.loadWorkStyle(work);\n }.bind(this);\n\n\n let textColorPicker = document.getElementById(GoLogoLoGUIId.GOLOGOLO_TEXT_COLOR_PICKER);\n textColorPicker.oninput = function(e){\n var work = this.model.getCurrentWork();\n work.setTextColor(e.target.value)\n this.model.view.loadWorkStyle(work);\n }.bind(this);\n \n\n \n \n let backgroundColorPicker = document.getElementById(GoLogoLoGUIId.GOLOGOLO_BACKGROUND_COLOR_PICKER);\n backgroundColorPicker.oninput = function(e){\n var work = this.model.getCurrentWork();\n work.setBackgroundColor(e.target.value)\n this.model.view.loadWorkStyle(work);\n }.bind(this);\n\n \n let borderColorPicker = document.getElementById(GoLogoLoGUIId.GOLOGOLO_BORDER_COLOR_PICKER);\n borderColorPicker.oninput = function(e){\n var work = this.model.getCurrentWork();\n work.setBorderColor(e.target.value)\n this.model.view.loadWorkStyle(work);\n }.bind(this);\n\n\n let borderRadiusSlider = document.getElementById(GoLogoLoGUIId.GOLOGOLO_BORDER_RADIUS_SLIDER);\n borderRadiusSlider.addEventListener(\"input\", function(){\n var work = this.model.getCurrentWork();\n work.setBorderRadius(borderRadiusSlider.value);\n this.model.view.loadWorkStyle(work);\n }.bind(this));\n \n\n let borderThicknessSlider = document.getElementById(GoLogoLoGUIId.GOLOGOLO_BORDER_THICKNESS_SLIDER);\n borderThicknessSlider.addEventListener(\"input\", function(){\n var work = this.model.getCurrentWork();\n work.setBorderThickness(borderThicknessSlider.value);\n this.model.view.loadWorkStyle(work);\n }.bind(this));\n \n\n\n let paddingSlider = document.getElementById(GoLogoLoGUIId.GOLOGOLO_PADDING_SLIDER);\n paddingSlider.addEventListener(\"input\", function(e){\n var work = this.model.getCurrentWork();\n work.setPadding(e.target.value)\n this.model.view.loadWorkStyle(work);\n }.bind(this));\n \n\n\n\n\n let marginSlider = document.getElementById(GoLogoLoGUIId.GOLOGOLO_MARGIN_SLIDER);\n marginSlider.oninput = function(e){\n var work = this.model.getCurrentWork();\n work.setMargin(e.target.value)\n this.model.view.loadWorkStyle(work);\n }.bind(this);\n\n\n\n }", "cleanupUI() {\n\n }", "updateUI(){\n // we should\n MainGameScene.updateUI();\n }", "function bindUIactions() {\n $('body').on('click', '.notification-dropdown__close', closeNotificationDropdown);\n\n s.notificationLink.on('click', function(e) {\n e.preventDefault();\n showNotificationDropdown();\n markAsRead($(this).attr('href'));\n });\n\n }", "async onShow() {\n\t}", "function bindUIactions() {\n $('body').on('click', '.comment__settings-button', showSettings);\n $('body').on('click', '.comment__settings-close', hideSettings);\n $('body').on('click', '.comments__new-link', showCommentForm);\n }", "function classUI() {\n\t\n\tthis.selected_item = \"\";\n\tthis.space = new classSpace(this);\n\tthis.hud = new classHUD(this);\n\tvar space = this.space;\n\tvar ui = this;\n\t\n\tthis.init = function() {\n\t\t// INIT HUD\n\t\tthis.hud.init();\n\t\t// HIGHLIGHT PANEL BUTTONS\n\t\tthis.highlightTopButtonColor(\".fs-hud\", \"#8f99ba\");\n\t\tthis.highlightTopButtonColor(\".fs-panels\", \"#8f99ba\");\n\t\tthis.highlightTopButtonColor(\".fs-sound\", \"#8f99ba\");\n\t\tthis.highlightButtonColor('.fs-planet')\n\t\tthis.highlightViewButtonColor(\".fs-sideview\");\n\t\t// RESET SELECTOR\n\t\t$('#selector').val('');\n\t\t// SET LISTENERS\n\t\t$(window).on('resize', ui.onWindowResize);\n\t\t$(document).keyup(function(e) {documentKeyUp(e);});\n\t\t$(document).mousedown(function(event) {ui.showPanels(event);});\n\t\t$(\".textcontainer\").on(\"mousedown click\", \"a\", function (e) {ui.linkClicked(e);} );\n\t\t$('#textcontainer_L').mousedown(function(e) {ui.HUDLmousedown(e);});\n\t\t$('#textcontainer_R').mousedown(function(e) {ui.HUDRmousedown(e);});\n\t\t$('.fs-hud').on('click', function() {ui.toggleHUD();});\n\t\t$('.fs-panels').on('click', function() {ui.hidePanels();});\n\t\t$('.fs-sound').on('click', function() {ui.toggleSound();});\n\t\t$('.fs-orbit').on('click', function() {ui.showOrbitClicked();});\n\t\t$('.fs-planet').on('click', function() {ui.showPlanetClicked();});\n\t\t$(\".fs-topview\").click(function() {ui.showTopViewClicked();});\n\t\t$(\".fs-sideview\").click(function() {ui.showSideViewClicked();});\n\t\t$(\".fs-hover\").click(function() {ui.showHoverClicked();});\n\t\t$(\".fs-compare\").click(function() {ui.showCompareClicked();});\n\t\t$('#selector_button').on('click', function() {ui.selectorButtonClicked();})\n\t\t$('.selector_item').on('click', function() {ui.selectorItemClicked(this);})\n\t\t$('#sun').on('click', function() {ui.showPlanetClicked(\"sun\");})\n\t\t$('#mercury .planet').on('click', function() {ui.showPlanetClicked(\"mercury\");})\n\t\t$('#venus .planet').on('click', function() {ui.showPlanetClicked(\"venus\");})\n\t\t$('#earth .planet').on('click', function() {ui.showPlanetClicked(\"earth\");})\n\t\t$('#moon .planet').on('click', function() {ui.showPlanetClicked(\"moon\");})\n\t\t$('#mars .planet').on('click', function() {ui.showPlanetClicked(\"mars\");})\n\t\t$('#jupiter .planet').on('click', function() {ui.showPlanetClicked(\"jupiter\");})\n\t\t$('#saturn .planet').on('click', function() {ui.showPlanetClicked(\"saturn\");})\n\t\t$('#uranus .planet').on('click', function() {ui.showPlanetClicked(\"uranus\");})\n\t\t$('#neptune .planet').on('click', function() {ui.showPlanetClicked(\"neptune\");})\n\t}\n\n\tthis.update = function() {\n\t\tif (this.hud.visible) {\n\t\t\tui.hud.LUpdate();\n\t\t\tui.hud.RUpdate();\n\t\t}\n\t}\n\t\n\tthis.onWindowResize = function() {\n\t\tui.update();\n\t}\n\t\n\tthis.documentKeyUp = function() {\n\t\tif (e.keyCode === 27) {\n\t\t\t$('.panel').toggle();\n\t\t}\n\t}\n\t\n\tthis.showHoverClicked = function() {\n\t\tthis.hideMenu(); \n\t\tthis.highlightButtonColor('.fs-hover');\n\t\t//$(\"h1\").html(toProperCase(ui.space.object_name));\n\t\tspace.showHover();\n\t}\n\t\n\tthis.showSideViewClicked = function() {\n\t\tthis.hideMenu(); \n\t\tthis.highlightViewButtonColor('.fs-sideview');\n\t\tspace.showSideView()\n\t}\n\t\n\tthis.showTopViewClicked = function() {\n\t\tthis.hideMenu(); \n\t\tthis.highlightViewButtonColor('.fs-topview');\n\t\tspace.showTopView();\n\t}\n\t\n\tthis.showPlanetClicked = function(iobject_name) {\n\t\tif (typeof iobject_name !== \"undefined\") space.object_name = iobject_name;\n\t\tthis.hideMenu(); \n\t\tthis.highlightButtonColor('.fs-planet');\n\t\t//$(\"h1\").html(toProperCase(space.object_name));\n\t\t$(\"#selector_label\").html(space.object_name.toUpperCase());\n\t\tif ((this.hud.visible) || (typeof this.hud.visible === \"undefined\")) {\n\t\t\t$(\".line\").show();\n\t\t\t$(\".textcontainer\").show();\n\t\t}\n\t\tspace.showPlanet(space.object_name);\n\t}\n\t\n\tthis.showOrbitClicked = function() {\n\t\tthis.hideMenu(); \n\t\tthis.highlightButtonColor('.fs-orbit');\n\t\tthis.space.showOrbit();\n\t}\n\t\n\tthis.showCompareClicked = function() {\n\t\tthis.hideMenu(); \n\t\tthis.highlightButtonColor('.fs-compare');\n\t\tthis.space.showCompare();\n\t}\n\t\n\tthis.showPanels = function(e) {\n\t\tswitch (e.which) {\n\t\t\tcase 3:\n\t\t\t\t$(\".panel\").show(); \n\t\t\t\tthis.highlightTopButtonColor(\".fs-panels\", \"#8f99ba\");\n\t\t\t\taudioPlay(\"button-click\"); \n\t\t\t\tbreak;\n\t\t}\n\t}\n\t\n\tthis.highlightViewButtonColor = function(className) {\n\t\t$('.fs-sideview').css(\"color\",\"#aaa\");\n\t\t$('.fs-topview').css(\"color\",\"#aaa\");\n\t\t$(className).css(\"color\",\"#a5daba\");\n\t\t}\n\t\n\tthis.highlightButtonColor = function(className) {\n\t\t$('.fs-orbit').css(\"color\",\"#aaa\");\n\t\t$('.fs-planet').css(\"color\",\"#aaa\");\n\t\t$('.fs-compare').css(\"color\",\"#aaa\");\n\t\t$('.fs-hover').css(\"color\",\"#aaa\");\n\t\t$(className).css(\"color\",\"rgb(182, 173, 216)\");\n\t}\n\t\n\tthis.linkClicked = function(e) {\n\t\twindow.location.href = this.href;\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t}\n\t\n\tthis.HUDLmousedown = function(e) {\n\t\tswitch (e.which) {\n\t\t\tcase 1:\n\t\t\t\tui.hud.LNext();\n\t\t\t\taudioPlay(\"hud-click\"); \n\t\t\tcase 2:\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tui.hud.LBack();\n\t\t\t\taudioPlay(\"hud-click\"); \n\t\t\t\tbreak;\n\t\t}\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t}\n\t\n\tthis.HUDRmousedown = function(e) {\n\t\tswitch (e.which) {\n\t\t\tcase 1:\n\t\t\t\tui.hud.RNext();\n\t\t\t\taudioPlay(\"hud-click\"); \n\t\t\tcase 2:\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tui.hud.RBack();\n\t\t\t\taudioPlay(\"hud-click\"); \n\t\t\t\tbreak;\n\t\t}\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t}\n\t\n\tthis.toggleHUD = function(e) {\n\t\tif ($('#universe').is(\":hidden\")) {\n\t\t\tif ((ui.hud.visible) || (typeof ui.hud.visible === \"undefined\")) {\n\t\t\t\tui.hud.visible = false;\n\t\t\t\tthis.highlightTopButtonColor(\".fs-hud\", \"#aaa\");\n\t\t\t\t$('#textcontainer_R').hide();\n\t\t\t\t$('#textcontainer_L').hide();\n\t\t\t\t$('.line').hide();\n\t\t\t\t//$('h1').hide();\n\t\t\t}\n\t\t\telse {\n\t\t\t\t\n\t\t\t\tui.hud.visible = true;\n\t\t\t\tthis.highlightTopButtonColor(\".fs-hud\", \"#8f99ba\");\n\t\t\t\tui.hud.loadInfoAndStats(space.object_name);\n\t\t\t\t$('.line').show();\n\t\t\t\t//$('h1').show();\n\t\t\t}\n\t\t\taudioPlay(\"button-click\");\n\t\t}\n\t}\n\t\n\tthis.hidePanels = function() {\n\t\t$(\".panel\").hide(); \n\t\tthis.highlightTopButtonColor(\".fs-panels\", \"#aaa\");\n\t\taudioPlay(\"button-click\"); \n\t}\n\t\n\tthis.toggleSound = function() {\n\t\tif (soundon) {\n\t\t\tsoundon = false;\n\t\t\tthis.highlightTopButtonColor(\".fs-sound\", \"#aaa\");\n\t\t\tsnd1.pause();\n\t\t\tsnd2.pause();\n\t\t} else {\n\t\t\tsoundon = true;\n\t\t\tthis.highlightTopButtonColor(\".fs-sound\", \"#8f99ba\");\n\t\t\tsnd1.play();\n\t\t\tsnd2.play();\n\t\t}\n\t\taudioPlay(\"button-click\"); \n\t}\n\t\n\tthis.highlightTopButtonColor = function(className, color) {\n\t\t$(className).css(\"color\", color);\n\t}\n\t\n\tthis.hideMenu = function() {\n\t\t$('.selector').css('bottom', '-550px');\n\t}\n\t\n\tthis.selectorButtonClicked = function() {\n\t\taudioPlay(\"screen\"); \n\t\tif (parseInt($('.selector').css('bottom')) < 0) {\n\t\t\t$('.selector').css('bottom', '0px');\n\t\t\t$('.selector').css('width', '300px');\n\t\t}\n\t\telse {\n\t\t\t$('.selector').css('bottom', '-550px');\t\t\t\n\t\t}\n\t}\n\t\n\tthis.selectorItemClicked = function(item) {\n\t\tvar value = $(item).data(\"value\");\n\t\tselectedItemChanged(value);\n\t\t// HIDE MENU\n\t\t$('.selector').css('bottom', '-550px');\n\t}\n\t\n\tfunction selectedItemChanged(value) {\n\t\tif ((value != space.object_name) && (typeof value !== \"undefined\")) {\n\t\t\t// $(\"h1\").html(toProperCase(value));\n\t\t\taudioPlay(\"beep\"); \n\t\t\tif ($('#universe').is(\":hidden\")) {\n\t\t\t\tspace.drawObject(value);\n\t\t\t}\n\t\t\t// SELECT 3DCssSolarSystem\n\t\t\tspace.select3DCssSolarSystem(value);\n\t\t\t$('#selector_label').html(space.object_name.toUpperCase());\n\t\t}\n\t}\n\t\n\tfunction toProperCase(str) {\n\t\treturn str.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});\n\t}\n}", "function display_text_control (e) {\n \n var test_app = UiApp.createApplication(); \n test_app.setTitle(\"Story ID: 3, Can enter text into a UI control\");\n \n var vertical_panel = test_app.createVerticalPanel();\n var text_box = test_app.createTextBox();\n text_box.setName(\"myTextBox\").setId('myTextBox');\n var button = test_app.createButton('Submit');\n vertical_panel.add(text_box);\n vertical_panel.add(button);\n \n // Add the handler\n var submit_click_server_handler = test_app.createServerHandler(\"respond_to_text_box_submit\");\n button.addClickHandler(submit_click_server_handler);\n submit_click_server_handler.addCallbackElement(vertical_panel); // useful for retrieving other widgets from inside the handler, like the text box\n \n test_app.add(vertical_panel);\n \n // USE if webapp --> return test_app; // this DISPLAYs the app's top level container element\n var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();\n spreadsheet.show(test_app);\n \n}", "render() {\n return getMainUI(this.state.pageExtension);\n }", "bindUI() {\n super.bindUI();\n\n this.on('focus', this.onFocus);\n this.on('blur', this.onBlur);\n this.on('change', this.onChange);\n this.on('keydown', this.onKeyDown); \n \n this.onAttributeChange('required', this.setRequired);\n this.onAttributeChange('maxlength', this.setMaxLength); \n }", "function initMenuUI() {\n clearMenu();\n let updateBtnGroup = $(\".menu-update-btn-group\");\n let modifyBtnGroup = $(\".menu-modify-btn-group\");\n let delBtn = $(\"#btn-delete-menu\");\n\n setMenuTitle();\n $(\"#btn-update-menu\").text(menuStatus == \"no-menu\" ? \"创建菜单\" : \"更新菜单\");\n menuStatus == \"no-menu\" ? hideElement(modifyBtnGroup) : unhideElement(modifyBtnGroup);\n menuStatus == \"no-menu\" ? unhideElement(updateBtnGroup) : hideElement(updateBtnGroup);\n menuStatus == \"no-menu\" ? setDisable(delBtn) : setEnable(delBtn);\n }", "showUi(){\n return this.provider.showUi();\n }", "function bindUIactions() {\n $('body').on('click', '.task-overview__settings-button', showSettings);\n $('body').on('click', '.task-overview__settings-close', hideSettings);\n $('body').on('click', '.members__settings-button', showMembersSettings);\n $('body').on('click', '.members__settings-close', hideMembersSettings);\n }", "setupUI () {\n this.html.canvas.width = this.canvasWidth\n this.html.canvas.height = this.canvasHeight\n \n // Prevent \"touch and hold to open context menu\" menu on touchscreens.\n this.html.canvas.addEventListener('touchstart', stopEvent)\n this.html.canvas.addEventListener('touchmove', stopEvent)\n this.html.canvas.addEventListener('touchend', stopEvent)\n this.html.canvas.addEventListener('touchcancel', stopEvent)\n \n this.html.buttonHome.addEventListener('click', this.buttonHome_onClick.bind(this))\n this.html.buttonReload.addEventListener('click', this.buttonReload_onClick.bind(this))\n this.html.buttonLeft.addEventListener('click', this.buttonLeft_onClick.bind(this))\n this.html.buttonRight.addEventListener('click', this.buttonRight_onClick.bind(this))\n \n this.html.main.addEventListener('keydown', this.onKeyDown.bind(this))\n \n window.addEventListener('resize', this.updateUI.bind(this))\n this.updateUI()\n this.hideUI() // Hide until all assets are loaded\n \n this.html.main.focus()\n }", "function main(){\n init_config_form();\n K.ui.bind_action(A);\n }", "function init(){\n recipeView.addhandlerRender(controlRecipes);\n searchView.addhandlerRender(controlSearchResults);\n paginationView.addhandlerRender(controlPagination);\n recipeView.addhandlerUpdateServings(controlServings);\n recipeView.addhandlerBookmark(controlBookmarks);\n bookMarksView.addhandlerRender(loadBookmarks);\n addRecipeView.addhandlerupload(addrecipe)\n console.log('hello');\n}", "function buildUI() { \n console.log(\"Building the UI\");\n \n var remotes = Settings.data('remotes'),\n formattedRemotes = [],\n commandsMenu = {};\n\n // For each remote:\n // 1. Add it to formattedRemotes, used by the remotes menu\n // 2. Add the list of commands for each remmote to commandsMenu[remote]\n Object.keys(remotes).forEach(function(remote) {\n formattedRemotes.push({\n title: remote\n });\n \n commandsMenu[remote] = [];\n \n remotes[remote].forEach(function (command) {\n commandsMenu[remote].push({\n title: command\n });\n });\n });\n \n console.log(\"Formatted remotes, ready for Pebble Menu:\");\n console.log(formattedRemotes);\n \n // Define the menu used to display remotes\n var remotesMenu = new UI.Menu({\n sections: [{\n items: formattedRemotes\n }]\n });\n\n // Definte the menu used to display commands for a remote\n var commandMenu = new UI.Menu({\n sections: [{\n items: [] // Blank until user clicks on a remote\n }]\n });\n \n var activeRemote = null;\n \n remotesMenu.show();\n \n // When the user clicks on a remote, build the proper commands menu and show it\n remotesMenu.on('select', function(e) {\n activeRemote = e.item.title;\n commandMenu.items(0, commandsMenu[e.item.title]);\n commandMenu.show();\n });\n \n // When the user clicks on a command, hit the proper API endpoint and vibrate the watch\n commandMenu.on('select', function(e) {\n var url = Settings.data('ip') + 'remotes/' + activeRemote + '/' + e.item.title;\n \n ajax({\n url: url,\n method: 'POST'\n });\n \n // Vibrate immediately, even if API takes a second to respond\n Vibe.vibrate('short');\n });\n}", "function bindUIactions() {\n $('body').on('click', '.project-overview__settings-button', showSettings);\n $('body').on('click', '.project-overview__settings-close', hideSettings);\n }", "function buildUI() {\n showForms();\n const config = {removePlugins: [ 'Heading', 'List' ]};\n ClassicEditor.create(document.getElementById('message-input'), config );\n fetchAboutMe();\n}", "function module_interface_display(){\n\n $('#main_description').html(g.module_lang.text[g.module_lang.current].main_description);\n\n g.viz_keylist.forEach(function(key){\n interface_titlesscreate(key);\n interface_buttonscreate(key,g.viz_definition[key].buttons_list);\n interface_buttoninteraction(key,g.viz_definition[key].buttons_list);\n });\n\n interface_menucreate();\n interface_menuinteractions();\n\n\n function interface_titlesscreate(key){\n $('#chart_'+key+'_title').html('<b>' + g.module_lang.text[g.module_lang.current]['chart_'+key+'_title'] + '</b><br>' + g.module_lang.text[g.module_lang.current].filtext + ' ' );\n }\n\n function interface_buttonscreate(key,buttons) {\n var html = '';\n buttons.forEach(function(button){\n switch(button){\n case 'reset': \n var icon = '↻';\n break;\n case 'help':\n var icon = '?'; \n break;\n case 'parameters':\n var icon = '⚙';\n break;\n case 'lockcolor': // to be implemented\n var icon = '⬙';\n break;\n case 'expand': // to be implemented\n var icon = '◰';\n break;\n case 'toimage': // to be implemented\n var icon = 'I';\n break;\n\n }\n html += '<button class=\"btn btn-primary btn-sm button '+button+'\" id=\"'+button+'-'+key+'\">'+icon+'</button>';\n });\n $('#buttons-'+key).html(html);\n }\n\n function interface_buttoninteraction(key1,buttons) {\n buttons.forEach(function(button){\n switch(button){\n case 'reset': \n $('#'+button+'-'+key1).click(function(){\n if(key1 == g.viz_timeline){menu_pausePlay();}\n if(key1 == 'multiadm'){\n if ($('#select-'+g.geometry_keylist[0]).val() == 'NA') {\n zoomToGeom(g.geometry_data[g.geometry_keylist[0]],g.viz_definition.multiadm.maps[g.geometry_keylist[0]]);\n }else{\n $('#select-'+g.geometry_keylist[0]).val('NA').change();\n }\n g.geometry_keylist.forEach(function(key2,key2num){\n g.viz_definition[key1].charts[key2].filterAll();\n });\n }else{\n g.viz_definition[key1].chart.filterAll();\n }\n dc.redrawAll(); \n });\n break;\n case 'help':\n $('#'+button+'-'+key1).click(function(){\n g.intro_definition.goToStep(g.intro_step[key1]).start();\n }); \n break;\n case 'parameters': // to be implemented\n $('#'+button+'-'+key1).click(function(){\n window.scrollTo(0, 0);\n \n if(g.medical_datatype == 'outbreak'){\n $('.modal-dialog').css('width','30%'); \n $('.modal-dialog').css('margin-right','2.5%'); \n }else{\n $('.modal-dialog').css('height','7%'); \n $('.modal-dialog').css('width','90%'); \n $('.modal-dialog').css('margin-top','1.5%'); \n $('.modal-dialog').css('margin-left','10%'); \n }\n\n var html = '<div class=\"row\">';\n\n \n // Load Optional Module: module-colorscale.js\n //------------------------------------------------------------------------------------\n html += '<div class=\"col-md-12\">';\n html += module_colorscale_display();\n html += '</div>';\n html += '<div class=\"btn btn-primary btn-sm button\" id=\"gobacktodashboard\"><b>X</b></div>';\n\n html += '</div>';\n $('.modal-content').html(html);\n module_colorscale_interaction();\n $('#modal').modal('show');\n\n $('#gobacktodashboard').click(function(){\n $('#modal').modal('hide');\n });\n });\n break;\n case 'expand': // to be implemented\n $('#'+button+'-'+key1).click(function(){\n g.geometry_keylist.forEach(function(key) {\n if ($('#map-' + key).height() <= 500) {\n setTimeout(function() {\n $('#map-' + key).css('height','845px');\n g.viz_definition.multiadm.maps[key].invalidateSize(true);\n }, 500);\n setTimeout(function() {\n zoomToGeom(g.geometry_data[key],g.viz_definition.multiadm.maps[key]);\n }, 1000);\n }else{\n setTimeout(function() {\n $('#map-' + key).css('height','410px');\n g.viz_definition.multiadm.maps[key].invalidateSize(true);\n }, 500);\n setTimeout(function() {\n zoomToGeom(g.geometry_data[key],g.viz_definition.multiadm.maps[key]);\n },1000); \n }; \n });\n });\n break;\n case 'lockcolor': // to be implemented\n $('#'+button+'-'+key1).click(function(){\n module_colorscale_lockcolor('Manual');\n });\n break;\n\n case 'toimage-a':\n $('#'+button+'-'+key1).click(function(){\n var temp_id = 'chart-' + key1;\n var html = d3.select('.container svg')\n .attr('title', 'some title here')\n .attr('version', 1.1)\n .attr('xmlns', 'http://www.w3.org/2000/svg')\n .node().parentNode.innerHTML;\n\n var img = new Image();\n // http://en.wikipedia.org/wiki/SVG#Native_support\n // https://developer.mozilla.org/en/DOM/window.btoa\n img.src = \"data:image/svg+xml;base64,\" + btoa(svg_xml);\n\n var canvas = document.getElementById('mycanvas');\n var img = canvas.toDataURL('image/png');\n document.write('<img src=\"' + img + '\"/>');\n });\n\n\n case 'toimage-b':\n var fs = require('fs');\n var db_new = document.getElementById(button+'-'+key1);\n \n function handleDbNewFile(e) {\n console.log(e);\n var files = e.target.files;\n var f = files[0];\n var name = f.name;\n var path = f.path;\n\n var map = g.viz_definition.multiadm.maps.admN1;\n leafletImage(map, doImage);\n\n function doImage(err, canvas) {\n var img = document.createElement('img');\n var dimensions = map.getSize();\n img.width = dimensions.x;\n img.height = dimensions.y;\n img.src = canvas.toDataURL();\n\n fs.writeFile('', img, function(err) {\n if(err) {\n console.log(err); //CONSOLE\n } else {\n console.log(\"exported\", new Date()); //CONSOLE\n }\n });\n }\n }\n if(db_new.addEventListener) db_new.addEventListener('click', handleDbNewFile);\n\n $('#'+button+'-').click(function(){\n\n var snapshot = document.getElementById('svgdataurl3');\n var map = g.viz_definition.multiadm.maps.admN1;\n\n leafletImage(map, doImage);\n\n function doImage(err, canvas) {\n var img = document.createElement('img');\n var dimensions = map.getSize();\n img.width = dimensions.x;\n img.height = dimensions.y;\n img.src = canvas.toDataURL();\n\n fs.writeFile('', img, function(err) {\n if(err) {\n console.log(err); //CONSOLE\n } else {\n console.log(\"onexport\", new Date()); //CONSOLE\n console.log(\"JSON saved to \" + outputFilename); //CONSOLE\n }\n }); \n snapshot.innerHTML = '';\n snapshot.appendChild(img);\n }\n\n var snapshot = document.getElementById('svgdataurl2');\n var chart = g.viz_definition.case_bar.chart;\n\n //dcImage(chart, doImage);\n\n /*function doImage(err, canvas) {\n var img = document.createElement('img');\n var dimensions = map.getSize();\n img.width = dimensions.x;\n img.height = dimensions.y;\n img.src = canvas.toDataURL();\n snapshot.innerHTML = '';\n snapshot.appendChild(img);\n }*/\n \n var encoresvg = g.viz_definition.case_bar.chart.svg();\n\n\n //get svg element.\n // var svg = document.getElementById(\"chart-case_bar\").getSVGDocument();\n //var svg = d3.select('#chart-case_bar').select(\"svg\");\n\n var foo = d3.select('#chart-case_bar').select(\"svg\");\n\n // later, where you don't have someDOM but you do have foo\n var svg = foo[0][0];\n //var svg = someDom.ownerSVGElement;\n\n //get svg source.\n var serializer = new XMLSerializer();\n var source = serializer.serializeToString(svg);\n\n //add name spaces.\n if(!source.match(/^<svg[^>]+xmlns=\"http\\:\\/\\/www\\.w3\\.org\\/2000\\/svg\"/)){\n source = source.replace(/^<svg/, '<svg xmlns=\"http://www.w3.org/2000/svg\"');\n }\n if(!source.match(/^<svg[^>]+\"http\\:\\/\\/www\\.w3\\.org\\/1999\\/xlink\"/)){\n source = source.replace(/^<svg/, '<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\"');\n }\n\n //add xml declaration\n source = '<?xml version=\"1.0\" standalone=\"no\"?>\\r\\n' + source;\n\n //convert svg source to URI data scheme.\n var url = \"data:image/svg+xml;charset=utf-8,\"+encodeURIComponent(source);\n\n function importSVG(sourceSVG, targetCanvas) {\n // https://developer.mozilla.org/en/XMLSerializer\n svg_xml = (new XMLSerializer()).serializeToString(sourceSVG);\n var ctx = targetCanvas.getContext('2d');\n\n // this is just a JavaScript (HTML) image\n var img = new Image();\n // http://en.wikipedia.org/wiki/SVG#Native_support\n // https://developer.mozilla.org/en/DOM/window.btoa\n img.src = \"data:image/svg+xml;base64,\" + btoa(svg_xml);\n\n img.onload = function() {\n // after this, Canvas’ origin-clean is DIRTY\n \n ctx.drawImage(img,100, 200);\n }\n }\n console.log(encoresvg);\n \n var test = document.getElementById(\"svgdataurl\");\n\n console.log(test);\n\n importSVG(encoresvg[0][0],test);\n\n var html = encoresvg[0][0]\n .attr('title', 'some title here')\n .attr('version', 1.1)\n .attr('xmlns', 'http://www.w3.org/2000/svg')\n .node().parentNode.innerHTML;\n\n var img = new Image();\n // http://en.wikipedia.org/wiki/SVG#Native_support\n // https://developer.mozilla.org/en/DOM/window.btoa\n img.src = \"data:image/svg+xml;base64,\" + btoa(svg_xml);\n\n var canvas = document.getElementById('svgdataurl2');\n var img = canvas.toDataURL('image/png');\n document.write('<img src=\"' + img + '\"/>');\n hiddenDiv.remove();\n\n }); \n break;\n }\n });\n }\n\n function interface_menucreate(){\n\n // Menu title\n var html = '<div id=\"menu_title\" style=\"font-size:1.2em; text-align:center;\"><b>'+g.module_lang.text[g.module_lang.current].interface_menutitle+'</b></div>';\n\n // Reset button\n html += '<a id=\"menu_reset\" class=\"menu_button btn btn-primary btn-sm\" href=\"javascript:menu_reset();\">'+g.module_lang.text[g.module_lang.current].interface_menureset+'</a>';\n \n // Reload button\n html += '<a id=\"menu_reload\" class=\"menu_button btn btn-primary btn-sm\" href=\"javascript:history.go(0)\">'+g.module_lang.text[g.module_lang.current].interface_menureload+'</a>';\n\n // Help button\n html += '<button id=\"menu_help\" class=\"menu_button btn btn-primary btn-sm\">'+g.module_lang.text[g.module_lang.current].interface_menuhelp+'</button>';\n\n // Quick access to epiweeks button\n html += '<div id=\"menu_epiwk\"><p>'+g.module_lang.text[g.module_lang.current].interface_menuepiwk+'</p>';\n html +='<button class=\"menu_button_epiwk btn btn-primary btn-sm\" id=\"menu_epi4\">4</button>';\n html +='<button class=\"menu_button_epiwk btn btn-primary btn-sm\" id=\"menu_epi8\">8</button>';\n html +='<button class=\"menu_button_epiwk btn btn-primary btn-sm\" id=\"menu_epi12\">12</button>';\n html +='<div>';\n\n // Autoplay button\n html += '<button id=\"menu_autoplay\" class=\"menu_button btn btn-primary btn-sm\">'+g.module_lang.text[g.module_lang.current].interface_menuautoplay.play+'</button>'\n\n // Record count\n //html += '<div id=\"menu_count\"><b><span class=\"filter-count \"></span></b><br>'+g.module_lang.text[g.module_lang.current].interface_menucount[0]+'<br><b><span class=\"total-count \"></span></b><br>'+g.module_lang.text[g.module_lang.current].interface_menucount[1]+'</div>';\n html += '<div id=\"menu_count\">'+g.module_lang.text[g.module_lang.current].interface_menucount[2]+'<br><span id=\"case-info\">'+g.module_lang.text[g.module_lang.current].interface_menucount[3]+' <b><span class=\"filter-count headline\"></span></span></b><br><span id=\"death-info\">'+g.module_lang.text[g.module_lang.current].interface_menucount[4]+' <b><span class=\"filter-count headline\"></span></span></b><br></div>';\n\n /*<span style=\"font-size:2em;\">Chiffres clés :\n <span id=\"casetotal\">Cas : <span class=\"filter-count headline\"></span></span>\n <span id=\"deathtotal\"> | Décès : <span class=\"filter-count headline\"></span></span></span>*/\n\n $('#menu').html(html);\n }\n\n function interface_menuinteractions(){\n\n g.interface_autoplayon = false;\n g.interface_autoplaytime = 0;\n g.interface_autoplaytimer = 0;\n\n $('#menu_autoplay').on('click',function(){\n if (g.interface_autoplayon) {\n menu_pausePlay();\n dc.redrawAll();\n }else{\n g.viz_definition[ g.viz_timeline].chart.filterAll();\n module_colorscale_lockcolor('Auto'); \n g.interface_autoplayon = true;\n $('#menu_autoplay').html(g.module_lang.text[g.module_lang.current].interface_menuautoplay.pause);\n $('#chart-'+ g.viz_timeline).addClass(\"noclick\");\n if(g.viz_timeshare){\n g.viz_timeshare.forEach(function(key) {\n $('#chart-'+ key).addClass(\"noclick\");\n });\n }\n g.interface_autoplaytime = 0;\n g.interface_autoplaytimer = setInterval(function(){menu_autoPlay()}, 500);\n };\n });\n\n $('#menu_help').click(function(){\n g.intro_definition.start();\n });\n\n // Quick epiweeks access\n var quick_filter_list = [4,8,12];\n quick_filter_list.forEach(function(wknumber){\n $('#menu_epi'+wknumber).on('click',function(){\n var temp_mode = g.colorscale_modecurrent;\n g.colorscale_modecurrent = 'Manual';\n menu_pausePlay();\n var temp_domain = g.viz_definition[ g.viz_timeline].domain.slice(Math.max(g.viz_definition[ g.viz_timeline].domain.length - wknumber - 1, 2));\n temp_domain.pop();\n temp_domain.forEach(function(wk){\n g.viz_definition[g.viz_timeline].chart.filter(wk);\n if(g.viz_timeshare){\n g.viz_timeshare.forEach(function(key) {\n g.viz_definition[key].chart.filter(wk);\n });\n }\n });\n g.colorscale_modecurrent = temp_mode;\n module_colorscale_lockcolor('Auto');\n dc.redrawAll();\n });\n });\n }\n}", "function initUI() {\n // Clear query when clear icon is clicked\n $('#searchBoxIcon').click(function () {\n $('#searchBoxInput').val('')\n $('#searchBoxInput').trigger('keyup')\n })\n\n // Event when chenging query\n $('#searchBoxInput').keyup(function () {\n var $searchResults = $('#searchResults')\n var query = $(this).val()\n\n // Icon switching\n if (query.length) {\n $('#searchBoxIcon').attr('src', '/img/clear.png')\n $('#searchBoxIcon').css('cursor', 'pointer')\n } else {\n $('#searchBoxIcon').attr('src', '/img/search.png')\n $('#searchBoxIcon').css('cursor', 'default')\n }\n\n // Only trigger a search when 2 chars. at least have been provided\n if (query.length < 2) {\n $searchResults.hide()\n return\n }\n\n // Display search results\n renderResults(search(query))\n $searchResults.show()\n })\n\n // Emit keyup event for when the query is already setted with browser back etc.\n $('#searchBoxInput').trigger('keyup')\n}", "_handleButton()\n {\n // Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__AUTHENTICATION_LOGIN, {username: this.ui.textUsername.val(), password: this.ui.textPassword.val()}); \n }", "function buildUI() { // eslint-disable-line no-unused-vars\n fetchBooks();\n}", "function setUI() {\n if (iAttrs.disconnectText && iAttrs.connectText) {\n if (scope.entity[userConnectedProp]) {\n iElement.text(iAttrs.disconnectText);\n } else {\n iElement.text(iAttrs.connectText);\n }\n }\n\n // TODO use ng-class directive\n if (iAttrs.connectedClass) {\n if (scope.entity[userConnectedProp]) {\n iElement.addClass(iAttrs.connectedClass);\n } else {\n iElement.removeClass(iAttrs.connectedClass);\n }\n }\n }", "function doSomethingAfterRendering(){\n displayLoading() // 로딩화면 보여주기\n fetchServer(); // 서버에서 데이터 가져오기\n }" ]
[ "0.686129", "0.686129", "0.6796653", "0.6796653", "0.6796653", "0.6663937", "0.6625558", "0.65125835", "0.6444413", "0.6343591", "0.6259258", "0.62534493", "0.62512034", "0.6191829", "0.61880404", "0.614265", "0.6129523", "0.61091805", "0.6078466", "0.6076758", "0.6067815", "0.60572755", "0.6019247", "0.6011619", "0.6003911", "0.59896183", "0.5969277", "0.59636235", "0.5952691", "0.5936545", "0.5923209", "0.59155214", "0.5907085", "0.5905654", "0.58857447", "0.58705497", "0.5858286", "0.584278", "0.5835043", "0.5815102", "0.5807063", "0.5803519", "0.5801387", "0.57997906", "0.5788383", "0.57825994", "0.5771694", "0.5764325", "0.576197", "0.5761747", "0.5756496", "0.57432336", "0.5734032", "0.5733429", "0.5728044", "0.5724308", "0.5721588", "0.5711018", "0.57071", "0.570156", "0.5698546", "0.56790227", "0.5671014", "0.5660982", "0.5646037", "0.56418645", "0.5640299", "0.5637503", "0.5628127", "0.56186163", "0.56186163", "0.56128734", "0.56024456", "0.56009173", "0.56003", "0.5593635", "0.5589678", "0.5579988", "0.5566956", "0.5566618", "0.5562274", "0.5560811", "0.5560366", "0.5554641", "0.5553289", "0.55404145", "0.55345684", "0.55261904", "0.5523472", "0.5523214", "0.552202", "0.5520051", "0.55188924", "0.55084044", "0.5506628", "0.55011624", "0.54973394", "0.54945195", "0.548178", "0.5478922", "0.5477754" ]
0.0
-1
================ MANAGING PHYSICS ====================
function addWall(x, y, width, height, color, rotation) { if (!color) color = "#00000000"; const newWall = Matter.Bodies.rectangle(x+width/2, y+height/2, width, height, { isStatic: true, render: { visible: false }, render: { fillStyle: color } }); if (rotation) Matter.Body.rotate(newWall, degreesToRadians(rotation)); return newWall }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "refreshFromPhysics() {}", "refreshFromPhysics() {}", "function modelNexus(name,xu,h,h0,rat,row,col,c_1,c_2) {\n var c1 = c_1 || [1,1,0];\n var c2 = c_2 || [1,192/255,0];\n var transform = new Transform();\n\n scene.new_Part(name+\"plats\");\n for(var i=0; i<3;i++){\n transform.save();\n transform.trans(m4.translation([0,0,i*(h+10)]), true);\n platform([false,transform],xu+(h/rat)*(2-i),h,rat,row,col+6*(2-i), MyGradient(c2,c1,(i+1),3),MyGradient(c2,c1,i,3));\n transform.restore();\n }\n\n scene.new_Part(name+\"diam\"); //m4.rotationZ(the)\n transform.save();\n transform.trans(m4.translation([0,0,3*(h+10)+h0]), true);\n diamond([false,transform],h0,rat,6,[0,51/255,1],[0,153/255,1]);\n transform.restore();\n\n scene.new_Part(name+\"pyras\");\n var xd = xu+(h/rat)*3;\n var l= 0.35*xd;\n var Trans = new Transform();\n Trans.trans(m4.translation([0.9*xd + l*Math.sqrt(3)/6,0,0]),true);\n Trans.trans(m4.rotationZ(-Math.PI/2));\n\n\n for(var i=0; i<8;i++){\n transform.save();\n transform.trans(m4.rotationZ(i*Math.PI/4));\n transform.trans_ByTrans(Trans);\n pyramid([false,transform],l, 10, [1,153/255,0]);\n transform.restore();\n }\n }", "refreshToPhysics() {}", "refreshToPhysics() {}", "renderMetasystem() {\n this.renderMetasystemVisibleComponents() // dial + outputs, algedonode, brass pads, strips, lights\n this.renderer.metasystemBlackBox()\n this.renderLabels()\n }", "createStagePhysics(){\n\n let shapes = [];\n let quat = [0, 0, 0, 1];\n\n this.stagePhysicsData.forEach((obj)=>{\n \n let pos = obj.pos;\n let size = obj.scale;\n\n shapes.push({ type:'box', size, pos, quat })\n\n });\n\n this.createObstacle(shapes);\n\n\n return this.realityBridge.add({\n type : 'compound',\n name : this.ballerBasePhysicsName,\n shapes,\n friction: 0.5,\n kinematic : true,\n mass : 0\n });\n\n }", "map_system() {\n\t\t// First 8K of RAM\n\t\tthis.map_loram(0x00, 0x3F, 0x0000, 0x1FFF, 0);\n\t\t// PPU regs\n\t\tthis.map_kind(0x00, 0x3F, 0x2000, 0x3FFF, 0x2000, MAP_TI.PPU);\n\t\t// CPU regs\n\t\tthis.map_kind(0x00, 0x3F, 0x4000, 0x5FFF, 0x4000, MAP_TI.CPU);\n\t\t// All of this mirrored again at 0x80\n\t\tthis.map_loram(0x80, 0xBF, 0x00, 0x1FFF, 0);\n\t\tthis.map_kind(0x80, 0xBF, 0x2000, 0x3FFF, 0x2000, MAP_TI.PPU);\n\t\tthis.map_kind(0x80, 0xBF, 0x4000, 0x5FFF, 0x4000, MAP_TI.CPU);\n\t}", "function mapScene(){\n\tif ((rotobjectio || dynamicrot) && rotobjectid.length){\n\t\t// if some objects are rotating, update faces and/or find new collisions\n\t\tif (dynamicrot){\n\t\t\trotObjs();\n\t\t\tinitFaces();\n\t\t}\n\t\tmapMovePoindFindCollisions(rotobjectid);\n\t}\n\t// map all the faces (F)\n\tfor (var i=0; i<f.length; i+=1){\n\t\tf[i].fmap();\n\t}\n\t// map all the points (P)\n\tfor (var i=0; i<p.length; i+=1){\n\t\tp[i].pmap();\n\t}\n\t// map all the moving points (MP), and move them, so long as they are not stationary or they follow a custom path\n\tfor (var i=0; i<mp.length; i+=1){\n\t\tif (mp[i].speed || mp[i].custompath){\n\t\t\tmp[i].mpmove();\n\t\t}\n\t\tmp[i].pmap();\n\t}\n}", "function doPlanetPhysics() {\n var planet_positions_copy = planet_positions;\n var planet_velocities_copy = planet_velocities;\n var planet_acceleration_copy = planet_accelerations;\n\n //physics of stars on planets\n for (var primary = 0; primary < planet_masses.length; primary++) {\n /* if (primary == 0) {\n console.log('X ' + planet_positions[primary].x);\n console.log('Y ' + planet_positions[primary].y);\n }*/\n planet_positions[primary].x = planet_positions_copy[primary].x + planet_velocities_copy[primary].x / KM_PER_AU * AU * dt;\n planet_positions[primary].y = planet_positions_copy[primary].y + planet_velocities_copy[primary].y / KM_PER_AU * AU * dt;\n planet_accelerations[primary].x = 0;\n planet_accelerations[primary].y = 0;\n for (var secondary = 0; secondary < masses.length; secondary++) {\n norm3 = pow(sqrt(pow(positions[secondary].x - planet_positions_copy[primary].x, 2) + pow(positions[secondary].y - planet_positions_copy[primary].y, 2) * scale_distance), 3);\n planet_accelerations[primary].x += G * masses[secondary] * (positions[secondary].x - planet_positions_copy[primary].x) * scale_distance / (norm3 * KM_PER_SOLARRADIUS);// / 10e3;\n planet_accelerations[primary].y += G * masses[secondary] * (positions[secondary].y - planet_positions_copy[primary].y) * scale_distance / (norm3 * KM_PER_SOLARRADIUS);// / 10e3;\n }\n //planet_singularity_threshold\n //remove singularities\n //singularity threshold to be modified\n /*if (primary == 0) {\n console.log(planet_accelerations[primary].x);\n console.log(planet_accelerations[primary].y);\n }*/\n if (planet_accelerations[primary].x > planet_singularity_threshold) {\n planet_accelerations[primary].x = planet_singularity_threshold;\n }\n if (planet_accelerations[primary].x < (-1 * planet_singularity_threshold)) {\n planet_accelerations[primary].x = -1 * planet_singularity_threshold;\n }\n if (planet_accelerations[primary].y > planet_singularity_threshold) {\n planet_accelerations[primary].y = planet_singularity_threshold;\n }\n if (planet_accelerations[primary].y < (-1 * planet_singularity_threshold)) {\n planet_accelerations[primary].y = -1 * planet_singularity_threshold;\n }\n /* if (primary == 0) {\n console.log('Railed X ' + planet_accelerations[primary].x);\n console.log('Railed Y ' + planet_accelerations[primary].y);\n }*/\n //console.log('railed ' + planet_accelerations[primary].x);\n //update velocity of planets\n planet_velocities[primary].x += planet_accelerations[primary].x * dt;\n planet_velocities[primary].y += planet_accelerations[primary].y * dt;\n planet_accelerations[primary].x = 0;\n planet_accelerations[primary].y = 0;\n //physics of planets on each other\n for (var secondary = 0; secondary < planet_masses.length; secondary++) {\n norm3 = pow(sqrt(pow(planet_positions_copy[secondary].x - planet_positions_copy[primary].x, 2) + pow(planet_positions_copy[secondary].y - planet_positions_copy[primary].y, 2) * scale_distance), 3);\n if (primary != secondary) {\n\n planet_accelerations[primary].x += G * planet_masses[secondary] * (planet_positions_copy[secondary].x - planet_positions_copy[primary].x) * scale_distance / (norm3 * KM_PER_SOLARRADIUS); /// 10e3;\n planet_accelerations[primary].y += G * planet_masses[secondary] * (planet_positions_copy[secondary].y - planet_positions_copy[primary].y) * scale_distance / (norm3 * KM_PER_SOLARRADIUS);// / 10e3;\n\n }\n }\n //remove singularities\n //singularity threshold to be modified\n //console.log(planet_accelerations[primary]);\n if (planet_accelerations[primary].x > planet_singularity_threshold) {\n planet_accelerations[primary].x = planet_singularity_threshold;\n }\n if (planet_accelerations[primary].x < (-1 * planet_singularity_threshold)) {\n planet_accelerations[primary].x = -1 * planet_singularity_threshold;\n }\n if (planet_accelerations[primary].y > planet_singularity_threshold) {\n planet_accelerations[primary].y = planet_singularity_threshold;\n }\n if (planet_accelerations[primary].y < (-1 * planet_singularity_threshold)) {\n planet_accelerations[primary].y = -1 * planet_singularity_threshold;\n }\n //update velocity of planets\n planet_velocities[primary].x += planet_accelerations[primary].x * dt;\n planet_velocities[primary].y += planet_accelerations[primary].y * dt;\n }\n}", "update(scene, elapsed) {\n if(!elapsed || elapsed<0){\n elapsed = 1\n }\n var objects = scene.objects\n // Add all World forces\n var w = {\n x: 0,\n y: 0\n }\n this.properties.forces.forEach(f=>{\n w.x += f.x\n w.y += f.y\n }\n )\n objects.forEach(o=>{\n // If object active, update physic for it\n if (o.active) {\n if (o.properties.physicType == \"DYNAMIC\") {\n var r = (o.contact ? o.properties.friction : 1.0)\n\n //reset all acceleration for the current GameObject\n o.acceleration = w\n\n // add All object applied forces\n o.forces.forEach(f=>{\n o.acceleration.x += f.x\n o.acceleration.y += f.y\n }\n )\n o.forces = []\n\n // Add gravity\n o.acceleration.x += (this.properties.gravity.x)\n o.acceleration.y += -(this.properties.gravity.y * o.properties.mass)\n\n // limit acceleration vector to maxAcc\n if (o.properties.maxAcc && o.properties.maxAcc.x > 0 && o.properties.maxAcc.y > 0) {\n o.acceleration = this.threshold(o.acceleration, o.properties.maxAcc)\n }\n\n // compute object velocity\n o.velocity.x = (o.velocity.x + o.acceleration.x) * r\n o.velocity.y = (o.velocity.y + o.acceleration.y) * r\n\n // Limit object velocity vector to maxSpd\n o.velocity = this.threshold(o.velocity, (o.properties.maxSpeed ? o.properties.maxSpeed : this.properties.maxSpd))\n\n // compute object position\n o.position.x += o.velocity.x\n o.position.y += o.velocity.y\n\n // update object with its own update method.\n o.update(elapsed)\n\n // constrains Object position to current viewport\n this.constrained(o)\n\n if (o.duration != -1 && o.duration > 0) {\n o.duration -= elapsed;\n if (o.duration < 0) {\n o.duration = -1\n o.active = false\n }\n }\n } else {\n o.update(elapsed)\n }\n }\n }\n );\n // call the specific scene update mechanism\n scene.update(elapsed)\n }", "function initPhysicWorld() {\n\t// Mundo\n\tworld = new CANNON.World();\n\tworld.gravity.set(0, -9.8, 0);\n\t///world.broadphase = new CANNON.NaiveBroadphase();\n\tworld.solver.iterations = 10;\n\n\t// Material y comportamiento\n\tvar groundMaterial = new CANNON.Material(\"groundMaterial\");\n\tvar materialEsfera = new CANNON.Material(\"sphereMaterial\");\n\tvar obstacleMaterial = new CANNON.Material(\"obstacleMaterial\");\n\tworld.addMaterial(materialEsfera);\n\tworld.addMaterial(groundMaterial);\n\tworld.addMaterial(obstacleMaterial);\n\t// -existe un defaultContactMaterial con valores de restitucion y friccion por defecto\n\t// -en caso que el material tenga su friccion y restitucion positivas, estas prevalecen\n\tvar sphereGroundContactMaterial = new CANNON.ContactMaterial(groundMaterial, materialEsfera, {\n\t\tfriction: 0.3,\n\t\trestitution: 0.7\n\t});\n\tvar sphereObstacleContactMaterial = new CANNON.ContactMaterial(materialEsfera, obstacleMaterial, {\n\t\tfriction: 0.3,\n\t\trestitution: 0.7\n\t});\n\tvar obstacleGroundContactMaterial = new CANNON.ContactMaterial(obstacleMaterial, groundMaterial, {\n\t\tfriction: 0.3,\n\t\trestitution: 0.7\n\t});\n\tworld.addContactMaterial(sphereGroundContactMaterial);\n\tworld.addContactMaterial(sphereObstacleContactMaterial);\n\tworld.addContactMaterial(obstacleGroundContactMaterial);\n\n\t// Suelo\n\tvar groundShape = new CANNON.Plane();\n\tvar ground = new CANNON.Body({\n\t\tmass: 0,\n\t\tmaterial: groundMaterial\n\t});\n\tground.addShape(groundShape);\n\tground.quaternion.setFromAxisAngle(new CANNON.Vec3(1, 0, 0), -Math.PI / 2);\n\tworld.addBody(ground);\n\n\t// Paredes\n\tvar backWall = new CANNON.Body({\n\t\tmass: 0,\n\t\tmaterial: groundMaterial\n\t});\n\tbackWall.addShape(new CANNON.Plane());\n\tbackWall.position.z = -1;\n\tworld.addBody(backWall);\n\tvar frontWall = new CANNON.Body({\n\t\tmass: 0,\n\t\tmaterial: groundMaterial\n\t});\n\tfrontWall.addShape(new CANNON.Plane());\n\tfrontWall.quaternion.setFromEuler(0, Math.PI, 0, 'XYZ');\n\tfrontWall.position.z = 1;\n\tworld.addBody(frontWall);\n\tvar leftWall = new CANNON.Body({\n\t\tmass: 0,\n\t\tmaterial: groundMaterial\n\t});\n\tleftWall.addShape(new CANNON.Plane());\n\tleftWall.position.x = -2;\n\tleftWall.quaternion.setFromEuler(0, Math.PI / 2, 0, 'XYZ');\n\tworld.addBody(leftWall);\n\tvar rightWall = new CANNON.Body({\n\t\tmass: 0,\n\t\tmaterial: groundMaterial\n\t});\n\trightWall.addShape(new CANNON.Plane());\n\trightWall.position.x = len_suelo - 2;\n\trightWall.quaternion.setFromEuler(0, -Math.PI / 2, 0, 'XYZ');\n\tworld.addBody(rightWall);\n}", "man() {\n console.log('Grammaire de la machine de Peano :');\n this.expression.man();\n this.definition.man();\n }", "forces() {\n // Initialize all force vectors\n for (let mass of this.masses) {\n // Frictional force; if friction == 0, this will just\n // zero out the vectors.\n mass.force[0] = -this.friction * mass.velocity[0];\n mass.force[1] = -this.friction * mass.velocity[1] - mass.mass * this.gravity; \n }\n\n let f = [0., 0.];\n let r = [0., 0.];\n // loop over all springs\n for (let con of this.connections) {\n if (con instanceof Spring) {\n \n const spring = con;\n const d = spring.currentLength();\n const nl = spring.naturalLength;\n\n // Hooke's law: F = -k (x-x0) along the line connecting the masses\n const F = spring.k * (d - nl);\n\n // project over the unit vectors\n f[0] = - F * (spring.from.position[0] - spring.to.position[0]) / d;\n f[1] = - F * (spring.from.position[1] - spring.to.position[1]) / d;\n\n // add force to each mass's force vectors\n spring.from.force[0] += f[0];\n spring.from.force[1] += f[1];\n spring.to.force[0] -= f[0];\n spring.to.force[1] -= f[1];\n } else if (con instanceof PendulumArm) {\n const pendulum = con;\n const dx = pendulum.to.position[0] - pendulum.from.position[0];\n const dy = pendulum.to.position[1] - pendulum.from.position[1];\n const theta = Math.atan2(dy, dx);\n const mg = pendulum.to.mass * this.gravity;\n \n pendulum.to.force[0] += mg * Math.sin(theta) * Math.cos(theta);\n pendulum.to.force[1] += mg * Math.cos(theta) * Math.cos(theta); \n }\n }\n }", "calcGravity(centerOfMass) {\n for (let i = 0; i < this.locations.length; i++) {\n // subtract two vector\n let gravity = p5.Vector.sub(centerOfMass, this.locations[i]);\n gravity.normalize(); // make unit vector \n gravity.mult(0.001); // multiply unit vector with 0.001\n this.applyForce(gravity); // add vector as force\n }\n }", "function repulsion() {\n spheres.forEach(obj => {\n var otherObj = [];\n var xComponent = [];\n var yComponent = [];\n var zComponent = [];\n var magComponents = [];\n var xMean = 0;\n var yMean = 0;\n var zMean = 0;\n var body = obj.body;\n var bodyMotionState = body.getMotionState();\n bodyMotionState.getWorldTransform(transformAssistant);\n var magnitude = 0;\n\n if(bodyMotionState) {\n for(var i = 0; i < spheres.length; i += 1) {\n if(obj.uuid !== spheres[i].uuid) {\n var newRay = new THREE.Ray();\n newRay.origin = new THREE.Vector3(transformAssistant.getOrigin().x(), transformAssistant.getOrigin().y(), transformAssistant.getOrigin().z());\n var newBodyMotionState = spheres[i].body.getMotionState();\n newBodyMotionState.getWorldTransform(transformAssistantRepulsion);\n var position = transformAssistantRepulsion.getOrigin();\n var direction = new THREE.Vector3(position.x(), position.y(), position.z());\n // direction.normalize();\n newRay.lookAt(direction);\n // console.log(newRay.origin, newRay.direction);\n otherObj.push(newRay);\n var magnitudes = newRay.origin.distanceTo(direction) / 100;\n magComponents.push(magnitudes);\n }\n }\n }\n\n otherObj.forEach(ray => {\n xComponent.push(ray.direction.x);\n yComponent.push(ray.direction.y);\n zComponent.push(ray.direction.z);\n });\n\n for(var i = 0; i < xComponent.length; i += 1) {\n xMean = xMean + xComponent[i];\n yMean = yMean + yComponent[i];\n zMean = zMean + zComponent[i];\n\n magnitude += magComponents[i];\n }\n\n xMean = xMean / xComponent.length;\n yMean = yMean / xComponent.length;\n zMean = zMean / xComponent.length;\n\n magnitude = 100 / magnitude;\n\n // console.log(magnitude);\n\n var adjustmentX = 0;\n var adjustmentY = 0;\n var adjustmentZ = 0;\n var adjustmentAmt = 1;\n\n if(body.getLinearVelocity().x() > 0) {\n adjustmentX = -adjustmentAmt;\n } else if(body.getLinearVelocity().x() < 0) {\n adjustmentX = adjustmentAmt;\n }\n\n if(body.getLinearVelocity().y() > 0) {\n adjustmentY = -adjustmentAmt;\n } else if(body.getLinearVelocity().y() < 0) {\n adjustmentY = adjustmentAmt;\n }\n\n if(body.getLinearVelocity().z() > 0) {\n adjustmentZ = -adjustmentAmt;\n } else if(body.getLinearVelocity().z() < 0) {\n adjustmentZ = adjustmentAmt;\n }\n body.setLinearVelocity(new Ammo.btVector3(body.getLinearVelocity().x() + adjustmentX, body.getLinearVelocity().y() + adjustmentY, body.getLinearVelocity().z() + adjustmentZ));\n\n body.applyCentralImpulse(new Ammo.btVector3((-xMean) * magnitude, (-yMean) * magnitude, (-zMean) * magnitude));\n });\n}", "function Physics() {}", "function InitPhysics(model, viewportWidth, viewportHeight)\n{\n if(model.Type == \"JumperMan\")\n {\n model.Physics = {\n xy_force: [.0, .0],\n xy_velocity: [.0, .0],\n t: -1, // Time\n pixelWidth: viewportWidth,\n pixelHeight: viewportHeight,\n\n leftEvent: false,\n rightEvent: false,\n jumpEvent: false,\n downEvent: false,\n\n leftForce: 0.0,\n rightForce: 0.0,\n jumpForce: 0.0,\n downForce: 0.0,\n\n snappedToGround: false\n };\n }\n\n else if(model.Type == \"Pellet\")\n {\n model.Physics = {\n xy_force: [.0, .0],\n xy_velocity: [.0, .0],\n t: -1, // Time\n pixelWidth: viewportWidth,\n pixelHeight: viewportHeight,\n\n onScreen: false\n };\n }\n\n else if(model.Type == \"Spike\")\n {\n model.Physics = {\n xy_force: [.0, .0],\n xy_velocity: [.0, .0],\n t: -1, // Time\n pixelWidth: viewportWidth,\n pixelHeight: viewportHeight,\n\n crossedScreen: true\n };\n }\n\n}", "refreshToPhysics() {\n //2D setup needed\n this.physicsObj.position.x = this.position.x;\n this.physicsObj.position.y = this.position.y;\n this.physicsObj.angle = this.angle;\n\n //3D\n //this.physicsObj.position.copy(this.position);\n //this.physicsObj.quaternion.copy(this.quaternion);\n //this.physicsObj.velocity.copy(this.velocity);\n //this.physicsObj.angularVelocity.copy(this.angularVelocity);\n }", "function grtown() {\n // make the world\n let world = new GrWorld({\n width:1500, height:800, // make the window reasonably large\n groundplanesize:30 // make the ground plane big enough for a world of stuff\n });\n\n // put stuff into it - you probably want to take the example stuff out first\n\n\n /********************************************************************** */\n /** EXAMPLES - student should remove these and put their own things in */\n /***/\n \n // Add house into the town\n for (let i = -23; i < 32; i += 7)\n {\n if (i === -9 || i === 12)\n world.add(new GrCrossHipped({x: i - 2, z: -17, size: 3}));\n else\n world.add(new GrPyramidHipHouse({x: i, z: -20, size: 3}));\n if (i === -23 || i === -2 || i === 19)\n world.add(new GrCrossHipped({x: i - 2, z: 20, size:3}));\n else\n world.add(new GrPyramidHipHouse({x: i, z: 17, size:3}));\n }\n\n // Add a skyscraper\n world.add(new GrSkyscraper({x: 0, z: -23,rotate: Math.PI / 2}));\n \n // Add helipads for one airplane' moving\n world.add(new GrHelipad(-25, 0.5, 27, 1));\n world.add(new GrHelipad(25, 0.5, 27, 1));\n world.add(new GrHelipad(0, 0.5, -27, 1));\n\n // Add an airplane moving around the town in the sky\n world.add(new GrAirplane1());\n\n // Add a merry-go-around\n world.add(new GrCarousel({x: 25, size: 1.5}));\n\n // Add a balloon\n world.add(new GrBalloon({x: 13, y: 10, r: 3}));\n\n // Add train track\n let track = new GrTrack();\n\n // Add a \"train\" made up by three car, the cars move along the track\n let car = new GrCar(track);\n let car2 = new GrCar2(track);\n let car3 = new GrCar3(track);\n car.u = 0.25;\n car2.u = 0.125;\n world.add(track);\n world.add(car);\n world.add(car2);\n world.add(car3);\n\n // Add another airplane, moving between helipads\n let airplane = new GrAirplane2();\n world.add(airplane);\n airplane.getPads(world.objects);\n\n // Add plants (trees and flowers)\n world.add(new GrTree({x: -25, z: 10, s: 1.5}));\n world.add(new GrTree({x: -25, z:-10, s: 1.5}));\n world.add(new GrFlower({x:-22, z: -7, s: 1.2}));\n world.add(new GrFlower({x: -22, z: 7, s: 1.2}));\n\n // Make the town snowing\n world.add(new GrSnow());\n\n // Add a sign at the center of the town\n world.add(new GrBall());\n \n /** EXAMPLES - end - things after this should stay */\n /********************************************************************** */\n\n // build and run the UI\n\n // only after all the objects exist can we build the UI\n // @ts-ignore // we're sticking a new thing into the world\n world.ui = new WorldUI(world);\n // now make it go!\n world.go();\n}", "physToScale(phys) {\n const { zeroOffset, tareOffset, scaleFactor } = this.props;\n const offset = phys;\n let scaleValue;\n let rawValue;\n if (offset < this.physThreshold || this.forceCoarseScale) {\n scaleValue = offset / this.coarseScale;\n rawValue = scaleValue + zeroOffset + tareOffset;\n return { raw: rawValue, scaled: scaleValue * scaleFactor };\n }\n scaleValue = (offset - this.physThreshold) / this.fineScale + this.scaleThreshold;\n rawValue = scaleValue + zeroOffset + tareOffset;\n return { raw: rawValue, scaled: scaleValue * scaleFactor };\n }", "function updateGamePhysics(){\n for (let playerKey in players){\n players[playerKey].update();\n }\n for (let aMissileKey in missiles){\n missiles[aMissileKey].update();\n }\n\n}", "function addMass(data, massType){\n var world = Globals.world;\n var bodyConstants = Globals.bodyConstants;\n var variableMap = Globals.variableMap;\n var component = null;\n var imgIdx = null;\n \n // Default image: use pointmass image. Can be changed from select element.\n var img = document.createElement(\"img\");\n var size = 50;\n var scaledSize = size / getScaleFactor();\n img.setAttribute(\"width\", \"\" + scaledSize);\n img.setAttribute(\"height\", \"\" + scaledSize);\n \n // Add the PhysicsJS body\n if (massType === \"square\") {\n img.setAttribute(\"src\", \"/static/img/toolbox/squaremass.png\");\n imgIdx = 1;\n component = Physics.body('rectangle', {\n x: pixelTransform(data.x, \"x\"),\n y: pixelTransform(data.y, \"y\"),\n restitution: 0.5,\n width: scaledSize,\n height: scaledSize,\n view: img,\n cof: 1.0,\n styles: {\n fillStyle: '#4d4d4d',\n angleIndicator: '#ffffff'\n },\n });\n } else { // if (massType === \"round\") {\n img.setAttribute(\"src\", \"/static/img/toolbox/roundmass.png\");\n imgIdx = 0;\n component = Physics.body('circle', {\n x: pixelTransform(data.x, \"x\"),\n y: pixelTransform(data.y, \"y\"),\n restitution: 0.5,\n radius: scaledSize / 2,\n view: img,\n cof: 1.0,\n styles: {\n fillStyle: '#4d4d4d',\n angleIndicator: '#ffffff'\n }\n });\n }\n\n // Upon being added, a map of variables associated with this mass is added to the globals\n if(!Globals.loading){\n addToVariableMap(\n {\n posx: data.x, \n posy: data.y,\n velx: 0.0,\n vely: 0.0,\n accx: 0.0,\n accy: 0.0,\n }\n );\n }\n\n // Add the component to the world and update all keyframes\n world.add(component);\n bodyConstants[bodyConstants.length-1].attachedTo = []; // This constant is assigned first\n updateKeyframes([component]);\n Globals.massBodyCounter++;\n \n // Assign constants:\n \n // Determines how this point mass is displayed:\n bodyConstants[bodyConstants.length-1].massType = massType; \n bodyConstants[bodyConstants.length-1].size = size;\n bodyConstants[bodyConstants.length-1].img = imgIdx;\n \n // Toggles for displaying (optionally tip-to-tail) vectors and a graph of this mass\n bodyConstants[bodyConstants.length-1].vectors = true;\n bodyConstants[bodyConstants.length-1].vectors_ttt = false;\n bodyConstants[bodyConstants.length-1].showGraph = false;\n \n // Default name and value for this mass\n bodyConstants[bodyConstants.length-1].nickname = \"mass \" + (getLabel(component));\n bodyConstants[bodyConstants.length-1].mass = 1.0;\n\n // Allow a mass to attach directly to a spring or pulley as it is placed\n attachSpring(component);\n attachPulley(component);\n \n return component;\n}", "create() {\n // Variables ////////////////////////////////////////////////////////////\n // Boxxy\n this.boxxyX = 125; //Boxxy's spawnpoint (X)\n this.boxxyY = 625; //Boxxy's spawnpoint (y)\n // Box\n this.boxX = 400;\n this.boxY = 625;\n // Floor\n this.floorX = 100;\n this.floorY = 950;\n this.floorScale = 8;\n // Platforms\n this.centerX = this.cameras.main.worldView.x + this.cameras.main.width / 2;\n this.centerY = this.cameras.main.worldView.y + this.cameras.main.height / 2;\n // Button\n this.buttonSX = 1000;\n this.buttonSY = 525;\n // Door\n this.doorX = 1200;\n this.doorY = 500;\n // Instructions\n let instructionsStyle = {\n fontFamily: `EnterCommand`,\n fontSize: `30px`,\n color: `#ffff`,\n align: `center`\n };\n\n // Box ////////////////////////////////////////////////////////////\n this.box = this.physics.add.sprite(this.boxX, this.boxY, `box`);\n this.box.setCollideWorldBounds(true);\n this.box.setDragX(1000);\n\n // Button ////////////////////////////////////////////////////////////\n this.buttons = this.physics.add.staticGroup();\n this.buttonS = this.buttons.create(this.buttonSX, this.buttonSY, `buttonS`); //square button (for Boxxy)\n\n // Door ////////////////////////////////////////////////////////////\n this.door = this.physics.add.sprite(this.doorX, this.doorY, `door`);\n this.createAnimations();\n\n // Boxxy ////////////////////////////////////////////////////////////\n this.boxxy = this.physics.add.sprite(this.boxxyX, this.boxxyY, `boxxy`);\n this.boxxy.setCollideWorldBounds(true);\n this.boxxy.setBounce(0.2);\n\n // Platforms ////////////////////////////////////////////////////////////\n // Horizontal\n this.platformsH = this.physics.add.staticGroup();\n this.platformsH.create(this.floorX, this.floorY, `platformH`).setScale(this.floorScale).refreshBody(); //floor\n this.platformsH.create(-775, 190, `platformH`).setScale(6).refreshBody();\n this.platformsH.create(1400, 675, `platformH`).setScale(3).refreshBody();\n // Vertical\n this.platformsV = this.physics.add.staticGroup();\n this.platformsV.create(this.boxX, 125, `platformV`);\n this.platformsV.create(this.boxX, 435, `platformV`);\n\n // Collision ////////////////////////////////////////////////////////////\n // Boxxy collisions\n this.physics.add.collider(this.boxxy, this.platformsH);\n this.physics.add.collider(this.boxxy, this.platformsV);\n this.physics.add.collider(this.box, this.platformsH);\n this.physics.add.collider(this.door, this.platformsH);\n this.physics.add.collider(this.boxxy, this.box);\n\n\n // Screenwipe ////////////////////////////////////////////////////////////\n this.transitionStart = this.add.sprite(this.centerX, this.centerY, `platformH`).setScale(12);\n this.transitionEnd = this.add.sprite(this.centerX, this.centerY * 3, `platformH`).setScale(12);\n\n // Instructions ////////////////////////////////////////////////////////////\n this.moveInstructions = this.add.text(175, 500, `Use WAD to control\nBoxxy`, instructionsStyle).setOrigin(0.5);\n this.interactInstructions = this.add.text(this.buttonSX, 450, `Use E to interact\nand exit`, instructionsStyle).setOrigin(0.5);\n this.exitText = this.add.text(this.doorX, this.doorY - 100, `↓EXIT↓`, {\n fontFamily: `EnterCommand`,\n fontSize: `30px`,\n color: `#ffff`,\n align: `center`,\n fontStyle: `bold`,\n lineSpacing: 10\n }).setOrigin(0.5);\n this.moveInstructions.alpha = 0;\n this.interactInstructions.alpha = 0;\n this.exitText.alpha = 0;\n\n // register keyboard commands\n this.cursors = this.input.keyboard.createCursorKeys();\n this.keyboard = this.input.keyboard.addKeys(`W, A, S, D, E, R`);\n\n }", "function UpdatePhysics(t)\n{\n var i;\n\n // Contact Detection\n UpdateContacts(t);\n\n // Contact Callback function(s) - may delete objects (like particles)\n ContactCallbacks(t);\n\n // TODO: --Make sure to check if object still exists when resolving\n // Resolve Contacts\n ResolveContacts(t);\n\n // Increment Motion\n UpdateMotion(t);\n\n // Apply Forces\n ApplyForces(t);\n}", "refreshToPhysics() {\n //2D setup needed\n this.physicsObj.position.x = this.position.x;\n this.physicsObj.position.y = this.position.y;\n }", "function modelCore(name,r0,c_1,c_2) {\n var r = r0 || 40;\n var c1 = c_1 || [1, 0, 1];\n var c2 = c_2 || c1;\n var transform = new Transform();\n\n scene.new_Part(name + \"sphere\");\n sphere([false,transform], r, r / 2, c1, c2);\n\n scene.new_Part(name + \"bound\");\n var the0 = [Math.PI/12,Math.PI/4*3,Math.PI/12*17];\n transform.save();\n transform.trans(m4.translation([0,0,-r/2]));\n for(i=0;i<3;i++){\n transform.save();\n transform.trans(m4.rotationZ(the0[i]));\n bound([false,transform], Math.PI / 2, 5, 10, 30, r * 3 / 2);\n transform.restore();\n }\n transform.restore();\n }", "refreshFromPhysics() {\n this.copyVector(this.physicsObj.position, this.position);\n this.copyVector(this.physicsObj.velocity, this.velocity);\n this.angle = this.physicsObj.angle;\n this.angularVelocity = this.physicsObj.angularVelocity;\n }", "function _createPhysicsEngine() {\n this.physicsEngine = new PhysicsEngine();\n this.repulsion = new Repulsion({\n strength: this.options.repulsionStrength || -20,\n range: this.options.range || [100, Infinity]\n });\n this.collision = new Collision();\n }", "function setupPrimaryPlacement() {\n //Find the location where the biome should center\n biomes.forEach(function (d, i) {\n d.degree = edges_primary.filter(function (l) {\n return l.source.id == d.id || l.target.id == d.id;\n }).length;\n d.angle = pi2 * i / biomes.length;\n d.x = d.focusX = radius_primary * Math.cos(d.angle);\n d.y = d.focusY = radius_primary * Math.sin(d.angle);\n d.fx = d.x;\n d.fy = d.y;\n }); //forEach\n //Set the central \"gravity\" point for each node and a first location\n\n nodes_primary.forEach(function (d) {\n //Get the angle\n var angle = d.type === 'element' ? biome_by_id[d.biome_main].angle : biome_by_id[d.id].angle; //Set the center focus\n\n d.focusX = radius_primary * Math.cos(angle);\n d.focusY = radius_primary * Math.sin(angle);\n d.x = d.focusX + Math.random();\n d.y = d.focusY + Math.random();\n }); //forEach\n } //function setupPrimaryPlacement", "refreshFromPhysics() {\n this.position.copy(this.physicsObj.position);\n this.quaternion.copy(this.physicsObj.quaternion);\n this.velocity.copy(this.physicsObj.velocity);\n this.angularVelocity.copy(this.physicsObj.angularVelocity);\n }", "renderMetasystemVisibleComponents() {\n this.dials.forEach(d => {\n d.render(this.renderer)\n })\n this.strips.forEach(s => {\n s.render(this.renderer)\n })\n this.lights.forEach(lightPair => {\n lightPair.forEach(light => light.renderAsMetaSystem(this.renderer))\n })\n }", "work() {\n if (this.active) {\n // Update the controllers\n this.update_controllers(this.space.controllers);\n \n \n if (!this.space.screensaver) {\n \n // Delete all things that are not inside the space anymore\n this.space.clear_outside();\n \n // This is where the magic of all the collisions happens\n // this.do_controller_ball_collisions(this.space.controllers, this.space.balls);\n this.do_paddle_wall_collisions(this.space.paddles, this.space.walls);\n // this.do_ball_ball_collisions(this.space.balls);\n this.do_ball_paddle_collisions(this.space.balls, this.space.paddles);\n this.do_ball_wall_collisions(this.space.balls, this.space.walls);\n this.do_ball_block_collisions(this.space.balls, this.space.blocks);\n \n }\n \n // Gravity has its effects too!\n \n this.do_ball_ball_gravity(this.space.balls);\n this.do_controller_ball_gravity(this.space.controllers, this.space.balls);\n \n // But we also enforce the rules of Physics!\n \n this.space.balls.forEach(ball => this.lightspeed_is_max_speed(ball));\n this.space.controllers.forEach(controller => this.lightspeed_is_max_speed(controller));\n this.space.ontology.forEach(thing => this.apply_friction(thing));\n \n // Ball and paddle need to be moved\n this.moveBlocks(this.space.paddles);\n this.moveBalls(this.space.balls);\n \n // Remove everything that should not exist anymore\n this.space.clear_crashed_things();\n \n // You just witnessed one Physics happening ;-)\n // It is the job of Time to do this over and over again\n }\n }", "function setup() {\n createCanvas(600, 600);\n\n// INHERITANCE ////////////////////////////////////////////////////////////////\n for (let i = 0; i < numCars; i++) {\n let x = random(0, width);\n let y = random(0, height);\n let car = new Car(x,y);\n // cars.push(car);\n// POLYMORPHISM ////////////////////////////////////////////////////////////////\n vehicles.push(car);\n }\n\n for (let i = 0; i < numMotorcycles; i++) {\n let x = random(0, width);\n let y = random(0, height);\n let motorcycle = new Motorcycle(x,y);\n // motorcycles.push(motorcycle);\n// POLYMORPHISM ////////////////////////////////////////////////////////////////\n vehicles.push(motorcycle);\n }\n\n for (let i = 0; i < numSportsCars; i++) {\n let x = random(0, width);\n let y = random(0, height);\n let sportscar = new SportsCar(x,y);\n vehicles.push(sportscar);\n }\n}", "function SimulationEngine() {\n\t\t\n\t}", "refreshToPhysics() {\n this.copyVector(this.position, this.physicsObj.position);\n this.copyVector(this.velocity, this.physicsObj.velocity);\n this.physicsObj.angle = this.angle;\n this.physicsObj.angularVelocity = this.angularVelocity;\n }", "constructor(shapes, centre, outerRadius, innerRadius, normalDir, baseColour, material) {\r\n\t\tshapes.push(new Hemisphere(centre, outerRadius - LITTLE_SPACE, vecScalar(-1, normalDir), 0, undefined, true, baseColour, material));\r\n\t\tshapes.push(new Hemisphere(centre, innerRadius + LITTLE_SPACE, vecScalar(-1, normalDir), 0, undefined, false, baseColour, material));\r\n\t\tshapes.push(new Annulus(centre, outerRadius - LITTLE_SPACE, innerRadius + LITTLE_SPACE, normalDir, baseColour, material));\r\n\t}", "_createSphere() {\r\n this.physicsSphere = new PhysicsSphere(this.physicsWorld, this.scene);\r\n this.physicsSphere.name = 'currentPhysicsSphere'\r\n this.physicsSphere.create(undefined, {x: 50/2-3.5, y: 25, z: 50/2-3.5}, undefined, 1)\r\n }", "refreshFromPhysics() {\n this.position.copy(this.physicsObj.position);\n this.quaternion.copy(this.physicsObj.quaternion);\n this.velocity.copy(this.physicsObj.velocity);\n this.angularVelocity.copy(this.physicsObj.angularVelocity);\n }", "function init() {\n \tvar STEER_NONE=0;\n\t\tvar STEER_RIGHT=1;\n\t\tvar STEER_LEFT=2;\n\n\t\tvar ACC_NONE=0;\n\t\tvar ACC_ACCELERATE=1;\n\t\tvar ACC_BRAKE=2;\n\n\t\tvar WIDTH_PX=800; //screen width in pixels\n\t\tvar HEIGHT_PX=600; //screen height in pixels\n\t\tvar SCALE=15; //how many pixels in a meter\n\t\tvar WIDTH_M=WIDTH_PX/SCALE; //world width in meters. for this example, world is as large as the screen\n\t\tvar HEIGHT_M=HEIGHT_PX/SCALE; //world height in meters\n\n\n var b2Vec2 = Box2D.b2Vec2\n , b2BodyDef = Box2D.b2BodyDef\n , b2Body = Box2D.b2Body\n , b2FixtureDef = Box2D.b2FixtureDef\n , b2Fixture = Box2D.b2Fixture\n , b2World = Box2D.b2World\n , b2MassData = Box2D.b2MassData\n , b2PolygonShape = Box2D.b2PolygonShape\n , b2CircleShape = Box2D.b2CircleShape\n , b2DebugDraw = Box2D.b2DebugDraw\n ;\n \n world = new b2World(\n new b2Vec2(0, 0) //gravity\n , true //allow sleep\n );\n \n\n cars=[];\n \n\n var props=[];\n\n b2world = world;\n\n\n\t \n\t //outer walls\n\t var p = new BoxProp({'size':[WIDTH_M, 1], 'position':[WIDTH_M/2, 0.5]});\n\t props.push(p);\n\t props.push(new BoxProp({'size':[1, HEIGHT_M-2], 'position':[0.5, HEIGHT_M/2]}));\n\t props.push(new BoxProp({'size':[WIDTH_M, 1], 'position':[WIDTH_M/2, HEIGHT_M-0.5]}));\n\t props.push(new BoxProp({'size':[1, HEIGHT_M-2], 'position':[WIDTH_M-0.5, HEIGHT_M/2]}));\n\t \n\t //pen in the center\n\t var center=[WIDTH_M/2, HEIGHT_M/2];\n\t props.push(new BoxProp({'size':[1, 6], 'position':[center[0]-3, center[1]]}));\n\t props.push(new BoxProp({'size':[1, 6], 'position':[center[0]+3, center[1]]}));\n\t props.push(new BoxProp({'size':[5, 1], 'position':[center[0], center[1]+2.5]}));\n \n \n //setup debug draw\n var debugDraw = new b2DebugDraw();\n debugDraw.SetSprite(canvas.getContext(\"2d\"));\n debugDraw.SetDrawScale(SCALE);\n debugDraw.SetFillAlpha(0.3);\n debugDraw.SetLineThickness(1.0);\n debugDraw.SetFlags(b2DebugDraw.e_shapeBit | b2DebugDraw.e_jointBit);\n world.SetDebugDraw(debugDraw);\n\n $(document).keydown(function(e){\n \t\tswitch(e.which){\n \t\t\tcase 37: // left\n \t\t\tremote.action(\"left\");\n \t\t\tKEYS_DOWN['left'] = true;\n\t\t break;\n\n\t\t case 38: // up\n \t\t\tremote.action(\"up\");\n \t\t\tKEYS_DOWN['up'] = true;\n\t\t break;\n\n\t\t case 39: // right\n \t\t\tKEYS_DOWN['right'] = true;\n\t\t break;\n\n\t\t case 40: // down\n\n \t\t\tKEYS_DOWN['down'] = true;\n\t\t break;\n\n\t\t default: return; // exit this handler for other keys\n\t\t }\n\t\t parsekeys();\n\t\t e.preventDefault(); // prevent the default action (scroll / move caret)\n });\n\n $(document).keyup(function(e){\n\n \t\tswitch(e.which){\n \t\t\tcase 37: // left\n \t\t\tKEYS_DOWN['left'] = false;\n\t\t break;\n\n\t\t case 38: // up\n\n \t\t\tKEYS_DOWN['up'] = false;\n\t\t break;\n\n\t\t case 39: // right\n \t\t\tKEYS_DOWN['right'] = false;\n\t\t break;\n\n\t\t case 40: // down\n\n \t\t\tKEYS_DOWN['down'] = false;\n\t\t break;\n\n\t\t default: return; // exit this handler for other keys\n\t\t }\n\t\t parsekeys();\n\t\t e.preventDefault(); // prevent the default action (scroll / move caret)\n });\n \n }", "function onUpdate(framework) {\n //increment time and recompute position, orientation, scale based on the new time\n Distribution.incTime();\n for(var i = 0.0; i < 100.0; i++)\n {\n var f = framework.scene.getObjectByName(\"feather\" + i);\n if(f !== undefined)\n {\n var params = {\n num: i,\n total1: 45,\n total2: 75,\n total3: 100,\n curve: curve\n };\n\n Distribution.getPos(f, params);\n Distribution.getRot(f, params);\n Distribution.getScale(f, params);\n } \n }\n}", "static get physicalProps() {\n\t return [];\n\t}", "function updateForces() {\n // get each force by name and update the properties\n simulation.force(\"center\")\n .x(width * forceProperties.center.x)\n .y(height * forceProperties.center.y);\n simulation.force(\"charge\")\n .strength(forceProperties.charge.strength * forceProperties.charge.enabled)\n .distanceMin(forceProperties.charge.distanceMin)\n .distanceMax(forceProperties.charge.distanceMax);\n simulation.force(\"collide\")\n .strength(forceProperties.collide.strength * forceProperties.collide.enabled)\n .radius(forceProperties.collide.radius)\n .iterations(forceProperties.collide.iterations);\n simulation.force(\"forceX\")\n .strength(forceProperties.forceX.strength * forceProperties.forceX.enabled)\n .x(width * forceProperties.forceX.x);\n simulation.force(\"forceY\")\n .strength(forceProperties.forceY.strength * forceProperties.forceY.enabled)\n .y(height * forceProperties.forceY.y);\n simulation.force(\"link\")\n .id(function (d) {\n return d.id;\n })\n .distance(forceProperties.link.distance)\n .iterations(forceProperties.link.iterations)\n .links(forceProperties.link.enabled ? graph.links : []);\n\n // updates ignored until this is run\n // restarts the simulation (important if simulation has already slowed down)\n simulation.alpha(1).restart();\n}", "function atom_nucleus_and_particles_rotation_movements() {\n \n var atom_nucleus_rotation_speed = ( motions_factor * 0.0001 * 28 );\n var atom_particles_rotation_speed = ( motions_factor * 0.01 * 28 );\n \n atom_nucleus_mesh.rotation.y += atom_nucleus_rotation_speed;\n\n atom_particle_mesh_1.rotation.y += atom_particles_rotation_speed;\n atom_particle_mesh_2.rotation.y += atom_particles_rotation_speed;\n atom_particle_mesh_3.rotation.y += atom_particles_rotation_speed;\n atom_particle_mesh_4.rotation.y += atom_particles_rotation_speed;\n \n}", "function create () {\n\t\t\t\t\t// We create the world of our simulation\n\t\t\t\t\t// will randomply set objects and everything up according to constant.js data\n\t\t\t\t\t_this.world = new World();\n\n\t\t\t\t\t// we draw a ground sprite for every tile of the world\n\t\t\t\t\t// we also maintain an array of sprites to draw on the top of the ground tiles\n\t\t\t\t\t_this.sprites = new Array(_this.world.map_size);\n\t\t\t\t\tfor(var y=0;y<_this.world.map_size;y++){\n\t\t\t\t\t\t_this.sprites[y] = new Array(_this.world.map_size).fill(undefined);\n\t\t\t\t\t\tfor(var x=0;x<_this.world.map_size;x++){\n\t\t\t\t\t\t\t_this.game.add.sprite( 1 + x*_this.world_sprite_size, 1+ y*_this.world_sprite_size, \"ground\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// allow Phaser app to still work if focus is lost\n\t\t\t\t\t_this.game.stage.disableVisibilityChange = true;\n\n\t\t\t\t\t// will resize the Phaser app at best and keep aspect ratio\n\t\t\t\t\t_this.game.scale.scaleMode = 2;\n\n\t\t\t\t\t// how many logic update per phaser update we want to perform\n\t\t\t\t\t// this var represents how many simulation updates per second we want\n\t\t\t\t\t_this.updates_per_second = 1;\n\t\t\t\t\t// this is to keep track of the elapsed time since last simulation updates\n\t\t\t\t\t_this.elapsed_time_cumul = 0;\n\t\t\t\t\t// how often we want to compute stats and update graphes per simulation updates\n\t\t\t\t\t_this.stats_update = _this.updates_per_second * 100;\n\t\t\t\t\t// maximum number of dot to be displayed on graphes\n\t\t\t\t\t_this.max_graph_dots = 200;\n\n\n\t\t\t\t\t// create graphes to display our stats\n\t\t\t\t\t_this.avg_error_graph = app.graphUtils.scalableGeneric2DGraph(\"avg-error\", _this.max_graph_dots, _this.stats_update, 150);\n\t\t\t\t\t_this.avg_random_behavior_graph = app.graphUtils.scalableGeneric2DGraph(\"avg-random-behavior\", _this.max_graph_dots, _this.stats_update, 150);\n\t\t\t\t\t_this.avg_reward_graph = app.graphUtils.scalableGeneric2DGraph(\"avg-reward\", _this.max_graph_dots, _this.stats_update, 150);\n\t\t\t\t\t_this.avg_plant_nearby_graph = app.graphUtils.scalableGeneric2DGraph(\"avg-plant-nearby\", _this.max_graph_dots, _this.stats_update, 150);\n\t\t\t\t\t_this.avg_eat_graph = app.graphUtils.scalableGeneric2DGraph(\"avg-eat\", _this.max_graph_dots, _this.stats_update, 150);\n\t\t\t\t\t_this.avg_feed_graph = app.graphUtils.scalableGeneric2DGraph(\"avg-feed\", _this.max_graph_dots, _this.stats_update, 150);\n\n\t\t\t\t\t// extracting the weights of the network\n\t\t\t\t\tvar weights = [];\n\t\t\t\t\tfor(var l=0;l<_this.world.creature.nn.layer_count;l++){\n\t\t\t\t\t\tfor(var i=0;i<_this.world.creature.nn.layers[l].input_unit_count;i++){\n\t\t\t\t\t\t\tfor(var o=0;o<_this.world.creature.nn.layers[l].output_unit_count;o++){\n\t\t\t\t\t\t\t\tweights.push( _this.world.creature.nn.layers[l].weights[o][i]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// creating neural network representation\n\t\t\t\t\t_this.nn_graph = app.graphUtils.neuralNetworkGraph(\"nn-graph\", _this.constants.network, weights);\n\n\t\t\t\t\twindow.creature = _this.world.creature;\n\t\t\t\t}", "refreshFromPhysics() {\n //2D\n this.position.set(this.physicsObj.position.x,this.physicsObj.position.y);\n }", "refreshFromPhysics() {\n //2D\n this.position.set(this.physicsObj.position.x,this.physicsObj.position.y);\n this.angle = this.physicsObj.angle;\n }", "function initNodes(Id) {\n\n var m = mat4();\n\n switch (Id) {\n\n case spacecraft.controlCenter:\n figure[spacecraft.controlCenter] = createNode(m, component.control_center.render, spacecraft.leftWing, spacecraft.controlRoom);\n break;\n\n case spacecraft.controlRoom:\n figure[spacecraft.controlRoom] = createNode(m, component.control_room.render, null, spacecraft.controlCover);\n break;\n\n case spacecraft.controlCover:\n figure[spacecraft.controlCover] = createNode(m, component.control_cover.render, null, null);\n break;\n\n case spacecraft.leftWing:\n\n figure[spacecraft.leftWing] = createNode(m, component.front_wing.render, spacecraft.rightWing, spacecraft.gun);\n break;\n\n case spacecraft.gun:\n figure[spacecraft.gun] = createNode(m, component.gun.render, spacecraft.middleWing, spacecraft.muzzle);\n break;\n\n case spacecraft.middleWing:\n figure[spacecraft.middleWing] = createNode(m, component.middle_wing.render, null, spacecraft.backWing);\n break;\n\n case spacecraft.backWing:\n figure[spacecraft.backWing] = createNode(m, component.back_wing.render, null, null);\n break;\n\n case spacecraft.muzzle:\n figure[spacecraft.muzzle] = createNode(m, component.muzzle.render, null, null);\n break;\n\n case spacecraft.rightWing:\n m = mult(m, scale4(-1, 1, 1)); // make mirror by y-axis from left wing\n figure[spacecraft.rightWing] = createNode(m, component.front_wing.render, null, spacecraft.gun);\n break;\n\n }\n\n}", "function setup() {\n\tcreateCanvas(800, 600);\n\trectMode(CENTER);\n\n\tengine = Engine.create();\n\tworld = engine.world;\n\n\tvar roof_options={\n\t\tisStatic:true\t\t\t\n\t}\n\n\tvar options = {\n\t\tdensity:0.002\n\t}\n\n\troof = Bodies.rectangle(400,100,230,20,roof_options);\n World.add(world,roof);\n\n\tbob1 = Bodies.circle(310,200,15,options);\n World.add(world,bob1);\n\n\tbob2 = Bodies.circle(340,200,15,options);\n World.add(world,bob2);\n\n\tbob3 = Bodies.circle(370,200,15,options);\n World.add(world,bob3);\n\n\tbob4 = Bodies.circle(400,200,15,options);\n World.add(world,bob4);\n\n\tbob5 = Bodies.circle(430,200,15,options);\n World.add(world,bob5);\n\n\th1 = Matter.Constraint.create({\n\t\tpointA:{x:310,y:100},\n\t\tbodyB:bob1,\n\t\tpointB:{x:0,y:0},\n\t\tlength:200\n\t})\n\tWorld.add(world,h1)\n\n\th2 = Matter.Constraint.create({\n\t\tpointA:{x:340,y:100},\n\t\tbodyB:bob2,\n\t\tpointB:{x:0,y:0},\n\t\tlength:200\n\t})\n\tWorld.add(world,h2)\n\n\th3 = Matter.Constraint.create({\n\t\tpointA:{x:370,y:100},\n\t\tbodyB:bob3,\n\t\tpointB:{x:0,y:0},\n\t\tlength:200\n\t})\n\tWorld.add(world,h3)\n\n\th4 = Matter.Constraint.create({\n\t\tpointA:{x:400,y:100},\n\t\tbodyB:bob4,\n\t\tpointB:{x:0,y:0},\n\t\tlength:200\n\t})\n\tWorld.add(world,h4)\n\n\th5 = Matter.Constraint.create({\n\t\tpointA:{x:430,y:100},\n\t\tbodyB:bob5,\n\t\tpointB:{x:0,y:0},\n\t\tlength:200\n\t})\n\tWorld.add(world,h5)\n\n\n\tEngine.run(engine);\n\t\n \n}", "function MassInfo() {\n\n // Mass of the shape.\n this.mass = 0;\n\n // The moment inertia of the shape.\n this.inertia = new _Mat.Mat33();\n}", "function Engine() {\n\t\n\t//console.log(\"start create engine\");\n\tthis.gears = [];\n\tthis.gears2 = [];\n\tthis.crossMethod = 0;\n\t\n\tthis.getWheelDiametr = function(width, height, disk) {\n\t\t\n\t\t//console.log(\"start calc calcWheelDiametr\");\n\t\treturn (width * height * 2.0 / 100.0 + 25.4 * disk) / 1000.0;\n\t\t\n\t} // getWheelDiametr\n\t\n\tthis.createGears = function() {\n\t\t\n\t\tthis.gears = new Array(this.gearCols);\n\t\tthis.gears2 = new Array(this.gearCols2);\n\t\t//console.log(\"start create gears\");\n\t\t//console.log(\"rank=\" + rank);\n\t\t//console.log(this.gearCols);\n\t\tfor (var c = 0; c < this.gearCols; c++)\n\t\t\tthis.gears[c] = new Gear(c, this, 1);\n\t\t\n\t\tfor (var c = 0; c < this.gearCols2; c++)\n\t\t\tthis.gears2[c] = new Gear(c, this, 2);\n\t\t\n\t} // createGears\n\t\n\tthis.initialize = function() {\n\n\t\tgetMoms();\n getGearNumbers();\n\n\t\tthis.gearCols = gearNumbers.length;\n\t\tthis.gearCols2 = gearNumbers2.length;\n\t\tthis.ob = new Array(rank);\n\t\tthis.mom = new Array(rank);\n\t\tthis.wheelDiametr = this.getWheelDiametr(wheelWidth, wheelHeight, wheelDisk);\n\t\tthis.wheelDiametr2 = this.getWheelDiametr(wheelWidth2, wheelHeight2, wheelDisk2);\n\t\t//console.log(\"Calc. wheelDiametr = \" + this.wheelDiametr);\n\t\tthis.momMax = 0.0;\n\t\tthis.obGearsMin = -1, this.obGearsMax = -1;\n\t\tthis.obGearsMin2 = -1, this.obGearsMax2 = -1;\n\t\tthis.momGearsMin = -1, this.momGearsMax = -1;\n\t\tthis.momGearsMin2 = -1, this.momGearsMax2 = -1;\n\t\tthis.finishRank = rank;\n\t\tthis.finishRank2 = rank;\n\t\tvar oF = Math.min(obFinish, obTo);\n\t\tvar oF2 = Math.min(obFinish2, obTo);\n\t\tvar rankExists = false;\n\t\tvar rank2Exists = false;\n\t\t\n\t\tvar c = 0;\n\t\tobCurr = obs[0];\n\t\tobC = obCurr;\n\t\tfor (k = 0; k <= rank; k++) {\n\t\t\t\n\t\t\tif ((obCurr > oF) && (!rankExists)) {\n\t\t\t\tthis.finishRank = k - 1;\n\t\t\t\trankExists = true;\n\t\t\t\t//console.log(\"finishRank=\" + this.ob[this.finishRank]);\n\t\t\t}\n\t\t\tif ((obCurr > oF2) && (!rank2Exists)) {\n\t\t\t\tthis.finishRank2 = k - 1;\n\t\t\t\trank2Exists = true;\n\t\t\t\t//console.log(\"finishRank2=\" + this.ob[this.finishRank2]);\n\t\t\t}\n\n\t\t\t//console.log(\"obC=\" + obC + \"; c=\" + c + \"; k=\" + k + \"; obCurr=\" + obCurr + \"; ob[k]=\" + this.ob[k] + \"; mom[k]=\" + this.mom[k] + \"; interpolStep=\" + interpolStep);\n\t\t\tthis.ob[k] = obCurr; // x for draw\n\t\t\t\n\t\t\tif (obC != obCurr) {\n\t\t\t\tobCurr += interpolStep;\n\t\t\t\tthis.mom[k] = 0.0;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tthis.mom[k] = moms[c]; // y for draw\n\t\t\t\n\t\t\tif (this.momMax < this.mom[k])\n\t\t\t\tthis.momMax = this.mom[k];\n\t\t\t//console.log(\"obC=\" + obC + \"; c=\" + c + \"; k=\" + k + \"; obCurr=\" + obCurr + \"; ob[k]=\" + this.ob[k] + \"; mom[k]=\" + this.mom[k] + \"; interpolStep=\" + interpolStep);\n\t\t\t\n\t\t\tif (c == 1)\n\t\t\t\tthis.secondIndex = k;\n\t\t\t\n\t\t\tobCurr += interpolStep;\n\t\t\tc++;\n\t\t\tobC = obs[c];\n\t\t\t\n\t\t}\n\t\t\n\t\tthis.createGears();\n\t\t\n\t} // initialize\n\t\n\tthis.interpol = function() {\n\t\t\n\t\tinterpolSpline3(this.ob, this.mom, this.secondIndex);\n\n\t} // interpol\n\n this.gearInitialize = function() {\n\n for (var c = 0; c < this.gearCols; c++)\n this.gears[c].initialize(1);\n \n for (var c = 0; c < this.gearCols2; c++)\n this.gears2[c].initialize(2);\n\n } // gearInitialize\n\t\n\tthis.drawMomentum = function() {\n\t\tvar coords = \"\";\n\t\tvar x, y;\n\t\tvar obCurr, momCurr;\n\t\tvar obStep = parseFloat((obTo - obFrom) / (obCols - 1.0));\n\t\tvar momStep = parseFloat(this.momMax / (obCols - 1.0));\n\n\t\tvar first = true;\n\t\tvar colorAxe = \"#909\";\n\t\tvar colorOther = \"#999\";\n\t\tvar color = colorAxe;\n\t\t\n\t\tif (!svgExists)\n\t\t\treturn;\n\t\t\n\t\tclearEngineDraw();\n\n\t\tif (this.momMax == 0.0)\n\t\t\treturn;\n\n\t\t// axes\n\t\tobCurr = obFrom;\n\t\tfirst = true;\n\t\tfor (var c = 0; c < obCols; c++) {\n\t\t\t\n\t\t\tx = roundForInterpol(obCurr);\n\t\t\tx = Math.round((drawWidth - 80) / (obTo - obFrom) * (x - obFrom) + 50);\n\t\t\tengineDraw.text(Math.round(obCurr).toString()).move(x, drawHeight - 90).font({fill: colorAxe, family: \"Helvetica\", anchor: \"middle\", stretch: \"ultra-condensed\"});\n\t\t\tif (first) {\n\t\t\t\tfirst = false;\n\t\t\t\tcolor = colorAxe;\n\t\t\t}\n\t\t\telse\n\t\t\t\tcolor = colorOther;\n\t\t\tengineDraw.line(x, 50, x, drawHeight - 90).fill(\"none\").stroke({color: color, width: 2});\n\t\t\t\n\t\t\t//console.log(x);\n\t\t\tobCurr += obStep;\n\t\t\t\n\t\t}\n\t\tmomCurr = 0;\n\t\tfirst = true;\n\t\tfor (var c = 0; c <= obCols; c++) {\n\t\t\t\n\t\t\ty = Math.round(drawHeight - 200 - (drawHeight - 200) / this.momMax * momCurr + 100);\n\t\t\tif (y < 50)\n\t\t\t\tbreak;\n\t\t\tengineDraw.text(Math.round(momCurr).toString()).move(25, y - 8).font({fill: colorAxe, family: \"Helvetica\", anchor: \"middle\"});\n\t\t\tif (first) {\n\t\t\t\tfirst = false;\n\t\t\t\tcolor = colorAxe;\n\t\t\t}\n\t\t\telse\n\t\t\t\tcolor = colorOther;\n\t\t\tengineDraw.line(40, y, drawWidth - 20, y).fill(\"none\").stroke({color: color, width: 2});\n\t\t\t\n\t\t\tmomCurr += momStep;\n\t\t\t\n\t\t}\n\t\tengineDraw.text(\"Момент, Н*м\").move(55, 50).font({fill: colorAxe, family: \"Helvetica\", anchor: \"left\", weight: \"bold\"});\n\t\tengineDraw.text(\"Обороты, об./мин.\").move(drawWidth - 150, drawHeight - 120).font({fill: colorAxe, family: \"Helvetica\", anchor: \"left\", weight: \"bold\"});\n\n\t\t// data\n\t\tfor (var c = 0; c <= rank; c++) {\n\t\t\tif (this.mom[c] == 0.0)\n\t\t\t\tcontinue;\n\t\t\t//console.log(\"engineDraw size - \" + $(\"#engineDraw\").width() + \" : \" + drawHeight);\n\t\t\t//console.log(\"max of mom - \" + this.momMax);\n\t\t\tx = Math.round((drawWidth - 80) / (obTo - obFrom) * (this.ob[c] - obFrom) + 50);\n\t\t\ty = Math.round(drawHeight - 200 - (drawHeight - 200) / this.momMax * this.mom[c] + 100);\n\t\t\tcoords += \" \" + x + \" \" + y;\n\t\t\t//console.log(coords);\n\t\t}\n\t\t\n\t\tengineDraw.polyline(coords).fill(\"none\").stroke({color: colors[0], width: 1});\n\t\t\n\t\t// finish\n\t\tx = this.ob[this.finishRank];\n\t\ty = fn(x, this.ob, this.mom);\n\t\tx = Math.round((drawWidth - 80) / (obTo - obFrom) * (x - obFrom) + 50);\n\t\ty = Math.round(drawHeight - 200 - (drawHeight - 200) / this.momMax * y + 100);\n\t\tengineDraw.line(x, y - 10, x, y + 10).fill(\"none\").stroke({color: colors[1], width: 2});\n\t\tx = this.ob[this.finishRank2];\n\t\ty = fn(x, this.ob, this.mom);\n\t\tx = Math.round((drawWidth - 80) / (obTo - obFrom) * (x - obFrom) + 50);\n\t\ty = Math.round(drawHeight - 200 - (drawHeight - 200) / this.momMax * y + 100);\n\t\tengineDraw.line(x, y - 10, x, y + 10).fill(\"none\").stroke({color: colors2[1], width: 2});\n\t\t\n\t} // drawMomentum\n\t\n\tthis.drawGears = function() {\n\t\t\n\t\tif (!svgExists)\n\t\t\treturn;\n\t\t\n\t\tvar obGearsMin = Math.min(this.obGearsMin, this.obGearsMin2);\n\t var obGearsMax = Math.max(this.obGearsMax, this.obGearsMax2);\n\t var momGearsMin = Math.min(this.momGearsMin, this.momGearsMin2);\n\t var momGearsMax = Math.max(this.momGearsMax, this.momGearsMax2);\n\t var obCurr, momCurr;\n\t\tvar obStep = parseFloat((obGearsMax - obGearsMin) / (obCols - 1));\n\t\tvar momStep = parseFloat((momGearsMax - momGearsMin) / (obCols - 1));\n\n\t\tvar first = true;\n\t\tvar colorAxe = \"#909\";\n\t\tvar colorOther = \"#999\";\n\t\tvar color = colorAxe;\n\t\t\n\t\tclearGearsDraw();\n\n\t\tif ((this.momMax == 0.0) || (!momGearsMax) || (momGearsMax == -1))\n\t\t\treturn;\n\t\t\n\t\t//x = Math.round((drawWidth - 70) / (obGearsMax - obGearsMin) * (this.ob[c] - obGearsMin) + 50);\n\t\t//y = Math.round(drawHeight - 80 - (drawHeight - 70) / (momGearsMax - momGearsMin) * (this.mom[c] - momGearsMin) + 50);\n\t\t\n\t\t// axes\n\t\tobCurr = obGearsMin;\n\t\tfirst = true;\n\t\tfor (var c = 0; c < obCols; c++) {\n\t\t\t\n\t\t\tx = Math.round((drawWidth - 70) / (obGearsMax - obGearsMin) * (obCurr - obGearsMin) + 50);\n\t\t\tgearsDraw.text(Math.round(obCurr).toString()).move(x, drawHeight - 25).font({fill: colorAxe, family: \"Helvetica\", anchor: \"middle\", stretch: \"ultra-condensed\"});\n\t\t\tif (first) {\n\t\t\t\tfirst = false;\n\t\t\t\tcolor = colorAxe;\n\t\t\t}\n\t\t\telse\n\t\t\t\tcolor = colorOther;\n\t\t\tgearsDraw.line(x, 20, x, drawHeight - 25).fill(\"none\").stroke({color: color, width: 2});\n\t\t\t\n\t\t\t//console.log(x);\n\t\t\tobCurr += obStep;\n\t\t\t\n\t\t}\n\t\tmomCurr = momGearsMin;\n\t\tfirst = true;\n\t\tfor (var c = 0; c < obCols; c++) {\n\t\t\t\n\t\t\ty = Math.round(drawHeight - 80 - (drawHeight - 70) / (momGearsMax - momGearsMin) * (momCurr - momGearsMin) + 50);\n\t\t\tif (y < 20)\n\t\t\t\tbreak;\n\t\t\tgearsDraw.text(Math.round(momCurr).toString()).move(25, y - 8).font({fill: colorAxe, family: \"Helvetica\", anchor: \"middle\"});\n\t\t\tif (first) {\n\t\t\t\tfirst = false;\n\t\t\t\tcolor = colorAxe;\n\t\t\t}\n\t\t\telse\n\t\t\t\tcolor = colorOther;\n\t\t\tgearsDraw.line(44, y, drawWidth - 15, y).fill(\"none\").stroke({color: color, width: 2});\n\t\t\t\n\t\t\tmomCurr += momStep;\n\t\t\t\n\t\t}\n\t\tgearsDraw.text(\"Момент, Н*м\").move(55, 20).font({fill: colorAxe, family: \"Helvetica\", anchor: \"left\", weight: \"bold\"});\n\t\tgearsDraw.text(\"Скорость, км/ч\").move(drawWidth - 130, drawHeight - 50).font({fill: colorAxe, family: \"Helvetica\", anchor: \"left\", weight: \"bold\"});\n\t\t\n\t\tfor (var c = 0; c < this.gearCols; c++)\n\t\t\tthis.gears[c].drawGear(1);\n\t\t\n\t\tfor (var c = 0; c < this.gearCols2; c++)\n\t\t\tthis.gears2[c].drawGear(2);\n\t\t\n\t} // drawGears\n\t\n\tthis.findCross = function() {\n\t\t\n\t\treturn findCrossingGears(this.gearCols, this.gears, this.wheelDiametr, gearMain, 1, this.finishRank);\n\t\t\n\t} // findCross\n\t\n\tthis.findCross2 = function() {\n\t\t\n\t\treturn findCrossingGears(this.gearCols2, this.gears2, this.wheelDiametr2, gearMain2, 2, this.finishRank2);\n\t\t\n\t} // findCross2\n\t\n } // Engine", "function scene() {\n\n let sun = new Sun(\n './data/Ring.png',\n window.innerWidth * 0.7, window.innerHeight * 0.06, 300, 300\n );\n engine.world.addSprite(sun);\n\n let mountain = new Mountain(\n './data/mountains-back.png',\n 0, window.innerHeight - 640, window.innerWidth, 512\n );\n mountain.wrapMode = 1;\n mountain.xOffset = 3 / 10000;\n engine.world.addSprite(mountain);\n\n let ship = new Ship(\n './data/ship.png',\n 0,350,512*1.5,256*1.5 \n );\n ship.wrapMode = 0;\n engine.world.addSprite(ship);\n\n let mountainMid = new Mountain(\n './data/mountains-mid1.png',\n 0, window.innerHeight - 570, window.innerWidth, 512\n );\n mountainMid.wrapMode = 1;\n mountainMid.xOffset = 5 / 10000;\n engine.world.addSprite(mountainMid);\n\n let mountainMid2 = new Mountain(\n './data/mountains-mid2.png',\n 0, window.innerHeight - 512, window.innerWidth, 512\n );\n mountainMid2.wrapMode = 1;\n mountainMid2.xOffset = 15 / 10000;\n engine.world.addSprite(mountainMid2);\n\n let rockDimension = 300;\n let rock0 = new Rock(\n './data/rock.png',\n -window.innerWidth * 0.01, window.innerHeight - rockDimension * 0.7,\n rockDimension, rockDimension);\n engine.world.addSprite(rock0);\n\n let rock1 = new Rock(\n './data/rock.png',\n window.innerWidth * 0.09, window.innerHeight - rockDimension * 0.5,\n rockDimension, rockDimension);\n engine.world.addSprite(rock1);\n engine.start();\n}", "function Particle( s ) {\n return function(x, y, mass) {\n this.position = s.createVector(x, y);\n this.velocity = s.createVector(0, 5);\n this.acceleration = s.createVector(0, 0);\n this.mass = mass;\n this.radius = massToRadius(mass);\n\n this.display = function() {\n s.noStroke();\n s.ellipse(this.position.x, this.position.y, this.radius, this.radius);\n this.position.add(this.velocity.add(this.acceleration));\n this.constrainToUniverse();\n this.acceleration.set(0,0);\n this.update();\n return this;\n }\n\n this.update = function() {\n var mousePosition = s.createVector(s.mouseX, s.mouseY);\n return this;\n }\n\n this.resetPosition = function() {\n this.position = s.createVector(width/2, height/2);\n }\n\n this.applyForce = function(force) {\n force = force.copy();\n force.div(mass);\n this.acceleration.add(force);\n }\n\n this.applyUniverse = function(constraints) {\n this.constraints = constraints;\n }\n\n this.constrainToUniverse = function() {\n var leftEdge = this.constraints.leftEdge + this.radius/2;\n var rightEdge = this.constraints.rightEdge - this.radius/2;\n var bottomEdge = this.constraints.bottomEdge - this.radius/2;\n var topEdge = this.constraints.topEdge + this.radius/2;\n\n if (this.position.x > rightEdge) { \n reverse(this.velocity, \"x\");\n this.position.x = rightEdge;\n }\n\n if (this.position.x < leftEdge) { \n reverse(this.velocity, \"x\");\n this.position.x = leftEdge;\n }\n\n if (this.position.y > bottomEdge) { \n reverse(this.velocity, \"y\");\n this.position.y = bottomEdge; \n }\n\n if (this.position.y < topEdge) { \n reverse(this.velocity, \"y\");\n this.position.y = topEdge; \n }\n }\n\n function massToRadius(mass) {\n // Volume of a circle: V = pi*r^3\n // let V = mass so we have a constant density \n // derives radius based on volume\n // Multiply by 50 so it looks reasonable in a browser\n return Math.cbrt(1/(((4/3)*Math.PI)/mass))*50;\n }\n\n function reverse(vector, axis) {\n vector[axis] *= -1;\n }\n };\n}", "function setupMobGenerator(){\n var combatant_stats;\n var expert_stats;\n var spellcaster_stats;\n var npcs = [];\n var publicAPI = {\n npcs,\n combatant_stats,\n expert_stats,\n spellcaster_stats,\n generateGenericNPC\n }; \n return publicAPI\n\n // **************************\n\n // Factory for general combatant type mobs. \n // Takes as arguments: \n // base: A base tempalate array to use. This will always be one of: combatant_stats, expert_stats, \n // or spellcaster_stats which will contain an object holding all the information from the book.\n // name: The name of the NPC. Defaults to \"rando NPC\" 'cos that's fun :p \n // cr: A string that is a number from 1 to 25 or \"half\" or \"third\" representing the CR of the NPC to be created, \n // abilities: an array of three strings in order from highest ability scrore to lowest. The only valid\n // strings are: \"str\",\"dex\",\"con\",\"int\",\"wis\", or \"cha\" \n // skills: An array of strings represnting skill names in the order master skills before good skills.\n function generateGenericNPC(base, name = \"rando NPC\", cr, abilities, skills) {\n var mob = {\n \"id\": `npc_${name}_${cr}_${skills.length}`,\n \"cr\": cr, \n \"name\": name,\n \"str\": 0,\n \"dex\": 0,\n \"con\": 0,\n \"int\": 0,\n \"wis\": 0,\n \"cha\": 0,\n \"hp\": base[cr].hp,\n \"initive\": 0,\n \"eac\": base[cr].eac,\n \"kac\": base[cr].kac,\n \"fort\": base[cr].fort,\n \"ref\": base[cr].ref,\n \"will\": base[cr].will,\n \"lowattack\": base[cr].lowattack,\n \"highattack\": base[cr].highattack,\n \"defaultenergydmg\": base[cr].energydmg,\n \"defaultkineticdmg\": base[cr].kineticdmg,\n \"defautmeleedmg\": base[cr].stdmeleedmg,\n \"defaultmeleethreedmg\": base[cr].threemeleedmg,\n \"defaultmeleefourdmg\": base[cr].fourmeleedmg,\n \"abilitydc\": base[cr].abilitydc,\n \"spelldc\": base[cr].spelldc,\n \"skills\": [],\n \"weapons\": [],\n rollBasicDamage: rollDamage,\n rollBasicAttack: rollAttack,\n rollSkillCheck: rollSkill\n };\n\n // assign abilities\n for (let i = 0; i < abilities.length; i++) {\n switch (abilities[i]) {\n case \"str\":\n mob.str += base[cr].abilitymods[i];\n console.log(`Str now ${mob.str}`);\n break;\n case \"dex\":\n mob.dex += base[cr].abilitymods[i];\n console.log(`Dex now ${mob.dex}`);\n break;\n case \"con\":\n mob.con += base[cr].abilitymods[i];\n console.log(`Con now ${mob.con}`);\n break;\n case \"int\":\n mob.int += base[cr].abilitymods[i];\n console.log(`Int now ${mob.int}`);\n break;\n case \"wis\":\n mob.wis += base[cr].abilitymods[i];\n console.log(`Wis now ${mob.wis}`);\n break;\n case \"cha\":\n mob.cha += base[cr].abilitymods[i];\n console.log(`Cha now ${mob.cha}`);\n }\n\n }\n //assign skills: the skills in the array will always be considered to be in order\n //Master Skills -> Good Skills \n\n for (let i = 0; i < skills.length; i++) {\n let ability = 0;\n let skill = { \"name\": skills[i], \"modifier\": 0 };\n\n // determine the ability modifier to use\n if (skill.name === \"Computers\" ||\n skill.name === \"Culture\" ||\n skill.name === \"Engineering\" ||\n skill.name === \"Life Science\" ||\n skill.name === \"Medicine\" ||\n skill.name === \"Physical Science\"\n ) {\n skill.modifier += mob.int;\n }\n else if (skill.name === \"Acrobatics\" ||\n skill.name === \"Piloting\" ||\n skill.name === \"Sleight of Hand\" ||\n skill.name === \"Stealth\"\n ) {\n skill.modifier += mob.dex;\n }\n else if (skill.name === \"Mysticicm\" ||\n skill.name === \"Perception\" ||\n skill.name === \"Sense Motive\" ||\n skill.name === \"Survival\"\n ) {\n skill.modifier += mob.wis;\n }\n else if (skill.name === \"Bluff\" ||\n skill.name === \"Diplomacy\" ||\n skill.name === \"Disguise\" ||\n skill.name === \"Intimidate\"\n ) {\n skill.modifier += mob.cha;\n }\n else if (skill.name === \"Athletics\") {\n skill.modifier += mob.str;\n }\n\n if (i <= base[cr].masterskillcount - 1) {\n //assign master skills\n skill.modifier += base[cr].masterskill;\n }\n else {\n //assign good skills\n skill.modifier += base[cr].goodskill;\n }\n\n mob.skills.push(skill);\n }\n\n // generates a random die roll based on the damage dice in the mob entry and addes the appropriate modifiers\n function rollDamage(damageType) {\n var damagedice;\n var damagemod;\n switch (damageType) {\n case \"energy\":\n damagedice = mob.defaultenergydmg;\n damagemod = 0;\n break;\n case \"kinetic\":\n damagedice = mob.defaultkineticdmg;\n damagemod = 0;\n break;\n case \"melee\":\n damagedice = mob.defautmeleedmg;\n damagemod = mob.str;\n break;\n case \"threemelee\":\n damagedice = mob.defaultmeleethreedmg;\n damagemod = mob.str;\n break;\n case \"fourmelee\":\n damagedice = mob.defaultmeleefourdmg;\n damagemod = mob.str;\n }\n var crToAdd = !isNaN(cr) ? Number(cr) : 0;\n var rolls = Helpers.rolldice(damagedice);\n var die = damagedice.slice(damagedice.indexOf(\"d\"));\n var damage = 0;\n var report = \"[\";\n\n for (let i = 0; i < rolls.length; i++) {\n damage += rolls[i] + crToAdd + damagemod;\n report += ` ${rolls[i]} on ${die} `;\n }\n report += \"]\";\n return {\"result\":damage, report};\n }\n\n function rollAttack(attackType) {\n var attackbonus;\n switch (attackType) {\n case \"high\":\n attackbonus = mob.highattack;\n break;\n case \"low\":\n attackbonus = mob.lowattack;\n }\n var roll = Helpers.rolldice(\"1d20\")[0];\n var attack = roll + attackbonus;\n if(roll === 20){\n var report = \"[ POTENTIAL CRITICAL! ]\";\n }\n else{\n var report = `[ ${roll} on 1d20 ]`;\n }\n return {\"result\":attack, report};\n \n\n }\n\n function rollSkill(skillnumber){\n var roll = Helpers.rolldice(\"1d20\")[0];\n var result = roll + mob.skills[skillnumber].modifier;\n var report = `[ ${roll} on 1d20 ]`;\n return {result, report};\n }\n\n npcs.push(mob);\n return mob;\n } \n}", "constructor(){\n\t\tthis.life=0;\n\t\tthis.magic=0;\n\t\tthis.strength=0;\n\t\tthis.dexterity=0;\n\t\tthis.damage_reduction_magic=0;\n\t\tthis.damage_reduction_strength=0;\n\t\tthis.damage_reduction_dexterity=0;\n\t\tthis.damage_increase_magic=0;\n\t\tthis.damage_increase_strength=0;\n\t\tthis.damage_increase_dexterity=0;\n\t\tthis.poison=0;\n\t\tthis.vampirism=0;\n\t\tthis.gold=0;\n\t\tthis.affinity=getRndInteger(0, 2);\n\t}", "refreshToPhysics() {\n this.physicsObj.position.copy(this.position);\n this.physicsObj.quaternion.copy(this.quaternion);\n this.physicsObj.velocity.copy(this.velocity);\n this.physicsObj.angularVelocity.copy(this.angularVelocity);\n }", "function setup() {\n\tcreateCanvas(2100, 400);\n\trectMode(CENTER);\n\n\tengine = Engine.create();\n\tworld = engine.world;\n\n\tvar roof_options={\n\t\tisStatic:true\t\t\t\n\t}\n\n\tvar ball_options={\n\t\trestitution:0.9,\n\t\t\n\t}\n\n\t\n\t\n\t\n\n\n\troof = Bodies.rectangle(600,50,1200,20,roof_options);\n World.add(world,roof);\n\n\tball1 = Bodies.circle(510,200,20,ball_options);\n\tWorld.add(world,ball1);\n\n\tball2 = Bodies.circle(550,200,20,ball_options);\n\tWorld.add(world,ball2);\n\n\tball3 = Bodies.circle(590,200,20,ball_options);\n\tWorld.add(world,ball3);\n\n\tball4 = Bodies.circle(630,200,20,ball_options);\n\tWorld.add(world,ball4);\n\n\tball5 = Bodies.circle(670,200,20,ball_options);\n\tWorld.add(world,ball5);\n\n\tcon=Matter.Constraint.create({\n\t\tpointA : {x:510,y:50},\n\t\tbodyB : ball1,\n\t\tpointB: {x:0,y:0},\n\t\tlength:200,\n\t\tstifness:0.01\n\t })\n\n\tWorld.add(world,con);\n\n\tcon1=Matter.Constraint.create({\n\t\tpointA : {x:550,y:50},\n\t\tbodyB : ball2,\n\t\tpointB: {x:0,y:0},\n\t\tlength:200,\n\t\tstifness:0.01\n\t })\n\tWorld.add(world,con1);\n\n\tcon2=Matter.Constraint.create({\n\t\tpointA : {x:590,y:50},\n\t\tbodyB : ball3,\n\t\tpointB: {x:0,y:0},\n\t\tlength:200,\n\t\tstifness:0.01\n\t })\n\tWorld.add(world,con2);\n\n\tcon3=Matter.Constraint.create({\n\t\tpointA : {x:630,y:50},\n\t\tbodyB : ball4,\n\t\tpointB: {x:0,y:0},\n\t\tlength:200,\n\t\tstifness:0.01\n\t })\n\tWorld.add(world,con3);\n\n\tcon4=Matter.Constraint.create({\n\t\tpointA : {x:670,y:50},\n\t\tbodyB : ball5,\n\t\tpointB: {x:0,y:0},\n\t\tlength:200,\n\t\tstifness:0.01\n\t })\n\tWorld.add(world,con4);\n\n\t\n\t\n \n}", "function setupTavern() {\n\n//draw a grid\n//make objects of each area\n\n\n}", "function createSmMass() {\r\n let randomNUm = (Math.random() * (1- 0 + 1)) << 0\r\n i++;\r\n smMass[i] = new component(30, 30, colors[i % 3], 130, 0, shapes[randomNUm], weights[randomNUm]); // small one which can move\r\n smMass[i].speedY = +1;\r\n}", "constructor(world, myGlobals) {\n let robotRadius = myGlobals.robotRadius;\n let puckRadius = myGlobals.puckRadius;\n\n let t = myGlobals.visibleWallThickness;\n let w = myGlobals.width;\n let h = myGlobals.height;\n\n // Choose a random position within the walls.\n let x = Math.floor(t + robotRadius + (w - 2 * t - 2 * robotRadius) * Math.random());\n let y = Math.floor(t + robotRadius + (h - 2 * t - 2 * robotRadius) * Math.random());\n\n/*\nx = lastGridX;\ny = lastGridY;\nlastGridX = lastGridX + gridCellWidth;\nif (lastGridX >= w) {\n lastGridX = gridCellWidth;\n lastGridY = lastGridY + gridCellWidth;\n}\n*/\n\n/*\nx = w/2 + startCircleRadius*Math.cos(startCircleI * 2*Math.PI / startCircleN);\ny = h/2 + startCircleRadius*Math.sin(startCircleI * 2*Math.PI / startCircleN);\nstartCircleI = startCircleI + 1;\n*/\n\n // Parts of the robot. Each part created below will be pushed onto this list.\n let parts = [];\n\n // Create the main body of the robot\n this.mainBody = Bodies.circle(x, y, robotRadius);\n this.mainBody.objectType = ObjectTypes.ROBOT;\n this.mainBody.render.strokeStyle = ObjectColours[ObjectTypes.ROBOT];\n this.mainBody.render.fillStyle = ObjectColours[ObjectTypes.ROBOT];\n this.mainBody.frictionAir = myGlobals.frictionAir;\n this.mainBody.label = \"Robot Main Body\";\n parts.push(this.mainBody);\n\n if (myGlobals.configuration == \"#OC2\") {\n // Add a pointed wedge to the front of the robot.\n\n //this.wedgeBody = Body.create();\n //let vertices = [{x:0, y:robotRadius}, {x:0+3*robotRadius, y:0}, {x:0, y:-robotRadius}];\n //Matter.Vertices.create(vertices, this.wedgeBody);\n\n let vertices = [Vector.create(0, robotRadius), Vector.create(1.5*robotRadius, 0), Vector.create(0, -robotRadius)];\n\n this.wedgeBody = Bodies.fromVertices(x, y, vertices);\n Body.translate(this.wedgeBody, {x:0.75*robotRadius, y:0});\n\n this.wedgeBody.objectType = ObjectTypes.ROBOT;\n this.wedgeBody.render.strokeStyle = ObjectColours[ObjectTypes.ROBOT];\n this.wedgeBody.render.fillStyle = ObjectColours[ObjectTypes.ROBOT];\n this.wedgeBody.frictionAir = 0;\n this.wedgeBody.label = \"Robot Wedge Body\";\n\n parts.push(this.wedgeBody);\n }\n\n // Create a small massless body to indicate the orientation of the bot.\n let angleBody = Bodies.rectangle(x + 0.5*robotRadius, y, 0.9*robotRadius, 0.1*robotRadius);\n angleBody.render.opacity = 1.0;\n angleBody.render.fillStyle = \"white\";\n //angleBody.objectType = ObjectTypes.ROBOT;\n angleBody.label = \"Robot Angle Indicator\";\n angleBody.mass = 0;\n angleBody.inverseMass = Infinity;\n angleBody.density = 0;\n angleBody.frictionAir = 0;\n angleBody.inertia = 0;\n angleBody.inverseInertia = Infinity;\n parts.push(angleBody);\n\n\n this.sensors = {};\n\n // All configurations have left/right obstacle sensors and left/right\n // robot sensors.\n this.addSimpleObjectSensors(x, y, myGlobals, \"Wall\", ObjectTypes.WALL);\n this.addSimpleObjectSensors(x, y, myGlobals, \"Robot\",ObjectTypes.ROBOT);\n\n let pr = myGlobals.puckRadius;\n\n if (myGlobals.configuration == \"#PRE_CLUSTER\") {\n this.addGoalZoneSensor(x, y, myGlobals);\n }\n if (myGlobals.configuration == \"#PRE_CLUSTER\" || myGlobals.configuration == \"#SIMPLE_CLUSTER\") {\n this.addClusterSensors(x, y, myGlobals, false);\n } else if (myGlobals.configuration == \"#ADVANCED_CLUSTER\") {\n this.addClusterSensors(x, y, myGlobals, true);\n } else if (myGlobals.configuration == \"#SORT\") {\n this.addClusterSensors(x, y, myGlobals, false);\n this.addInnerGreenSensor(x, y, myGlobals, myGlobals.innerSensorRadius);\n } else if (myGlobals.configuration == \"#FIREFLY\") {\n this.addFireflySensors(x, y, myGlobals);\n } else if (myGlobals.configuration == \"#MAJORITY\") {\n this.addMajoritySensors(x, y, myGlobals);\n } else if (myGlobals.configuration == \"#PHEROMONE\") {\n // Using a larger sensor for this configuration because otherwise\n // pucks are left on the edge. A larger sensor is problematic for\n // clustering/sorting because it induces longer-distance\n // grabs/releases which can mess up clusters.\n this.addInnerGreenSensor(x, y, myGlobals, 2*myGlobals.innerSensorRadius);\n } else if (myGlobals.configuration == \"#CONSTRUCT\" || myGlobals.configuration == \"#ENLARGED_ROBOT\") {\n this.addConstructSensors(x, y, ObjectTypes.RED_PUCK, myGlobals);\n this.addConstructSensors(x, y, ObjectTypes.GREEN_PUCK, myGlobals);\n } else if (myGlobals.configuration == \"#OC2\") {\n this.addOC2Sensors(x, y, ObjectTypes.RED_PUCK, myGlobals);\n this.addOC2Sensors(x, y, ObjectTypes.GREEN_PUCK, myGlobals);\n }\n\n // Initialize the sensor bodies\n for (let key in this.sensors) {\n let sensorBody = this.sensors[key].body;\n\n // Set physical properties to represent that this sensor body has no\n // impact on the robot's overall mass or inertia.\n sensorBody.mass = 0;\n sensorBody.inverseMass = Infinity;\n sensorBody.density = 0;\n sensorBody.frictionAir = 0;\n sensorBody.inertia = 0;\n sensorBody.inverseInertia = Infinity;\n\n // Visual properties.\n sensorBody.render.strokeStyle = \"blue\";\n sensorBody.render.fillStyle = \"blue\";\n sensorBody.render.opacity = 0.30;\n if (key == \"innerGreenPuck\" || key == \"innerRedPuck\") {\n sensorBody.render.opacity = 0.2;\n }\n\n // Useful for debugging.\n sensorBody.label = key\n }\n\n // Add the mainBody, then all sensor parts to the 'parts' array.\n for (let key in this.sensors) {\n let sensorBody = this.sensors[key].body;\n parts.push(sensorBody);\n }\n\n this.body = Body.create({\n parts: parts\n });\n\n // Assign a random orientation\n Body.rotate(this.body, 2*Math.PI * Math.random());\n\n // Additional properties of the robot.\n this.body.frictionAir = myGlobals.frictionAir;\n this.body.label = \"Robot\";\n this.body.robotParent = this;\n this.holdConstraint = null;\n this.text = \"\";\n this.textColour = \"green\";\n\n // Grid probes are represented only as relative (distance, angle) pairs\n // which which give the points at which the robot can sample the grid.\n this.gridProbes = {};\n if (myGlobals.configuration == \"#PHEROMONE\" ||\n myGlobals.configuration == \"#CONSTRUCT\" || myGlobals.configuration == \"#OC2\" ||\n myGlobals.configuration == \"#ENLARGED_ROBOT\") {\n let angle = Math.PI/4.0;\n//let angle = 3.0*Math.PI/4.0;\n let distance = 2*myGlobals.robotRadius;\n\n this.gridProbes.leftProbe = { distance: distance, angle: -angle };\nthis.gridProbes.centreProbe = { distance: distance/Math.sqrt(2),\n// this.gridProbes.centreProbe = { distance: distance,\n angle: 0 };\n this.gridProbes.rightProbe = { distance: distance, angle: angle };\n }\n this.updateSensorVisibility(myGlobals.showSensors);\n\n World.add(world, [this.body]);\n }", "function setup() {\n\tcreateCanvas(800, 600);\n\trectMode(CENTER);\n\n\tengine = Engine.create();\n\tworld = engine.world;\n\n\tvar roof_options={\n\t\tisStatic:true\t\t\t\n\t}\n\n\troof = Bodies.rectangle(400,100,230,20,roof_options);\n World.add(world,roof);\n\n\nbob1 = Bodies.circle(299,50,10,ball_options);\nbob2 = Bodies.circle(309,50,10,ball_options);\nbob3 = Bodies.circle(319,50,10,ball_options);\nbob4 = Bodies.circle(329,50,10,ball_options);\nbob5 = Bodies.circle(339,50,10,ball_options);\n\n\nrope1=new rope(bob1,roof,-80,0);\nrope2=new rope(bob1,roof,-80,0);\nrope3=new rope(bob1,roof,-80,0);\nrope4=new rope(bob1,roof,-80,0);\nrope5=new rope(bob1,roof,-80,0);\n\nWorld.add(world,bob1);\nWorld.add(world,bob2);\nWorld.add(world,bob1);\nWorld.add(world,bob4);\nWorld.add(world,bob5);\n\n\n\tEngine.run(engine);\n\n\n\n\tconstructor(body1,body2,pointA,pointB); \n\t{\n this.pointA=pointA\n\t\tthis.pointB=pointB\n\n\t\tvar options={\n bodyA:body1,\n\t\tbodyB:body2,\n\t\tpointB:{x:this.pointA, y:this.pointB}\n\n\t\t}\n\n \n\n\n\n\t}\n\tcon = Matter.Constraint.create({\n\t\tpointA:{x:200,y:20},\n\t\tbodyB:bob1,\n\t\tpointB:{x:0,y:0},\n\t\tlength:100,\n\t\tstiffness:0.1\n\t });\n\t con = Matter.Constraint.create({\n\t\tpointA:{x:210,y:20},\n\t\tbodyB:bob2,\n\t\tpointB:{x:0,y:0},\n\t\tlength:100,\n\t\tstiffness:0.1\n\t });\n\t con = Matter.Constraint.create({\n\t\tpointA:{x:220,y:20},\n\t\tbodyB:bob3,\n\t\tpointB:{x:0,y:0},\n\t\tlength:100,\n\t\tstiffness:0.1\n\t });\n\t con = Matter.Constraint.create({\n\t\tpointA:{x:230,y:20},\n\t\tbodyB:bob4,\n\t\tpointB:{x:0,y:0},\n\t\tlength:100,\n\t\tstiffness:0.1\n\t });\n}", "function setup() {\n createCanvas(640, 360);\n man = new Person();\n for (let i = 0; i < 100; i++) {\n bad[i] = new obstacle();\n }\n for (let l = 0; l < 100; l++) {\n bad2[l] = new obstacle2();\n}\n}", "get entities() {\n const engine =\n get(this, \"state.entities.physics.engine\") || Matter.Engine.create();\n const world = engine.world;\n\n const frog = Matter.Bodies.rectangle(width / 2, height - 350, 25, 25, {\n collisionFilter: {\n group: 5,\n category: 1,\n mask: 0,\n },\n frictionAir: 0.015,\n label: \"frog\",\n xtilt: 0,\n });\n const platform_0 = Matter.Bodies.rectangle(\n width / 2,\n height - 100,\n 25,\n 10,\n {\n isStatic: true,\n label: \"platform\",\n }\n );\n const { platforms, bodies } = this.platforms;\n const floor = Matter.Bodies.rectangle(width / 2, height - 10, width, 100, {\n isStatic: true,\n friction: 0.1,\n collisionFilter: {\n group: 5,\n category: 1,\n mask: 0,\n },\n // isSensor: true,\n label: \"floor\",\n });\n // this.collisionHandler(engine);\n Matter.World.add(world, [frog, floor, ...bodies, platform_0]);\n\n return {\n physics: {\n engine,\n world,\n },\n ...platforms,\n frog: {\n body: frog,\n size: [25, 25],\n renderer: Frog,\n },\n platform_0: {\n body: platform_0,\n size: [25, 10],\n renderer: Platform,\n },\n floor: {\n body: floor,\n size: [width + 100, 100],\n renderer: Floor,\n },\n };\n }", "function addPlatforms() {\n platforms = game.add.physicsGroup();\n platforms.create(450, 550, 'platform');\n platforms.create(100, 550, 'platform');\n platforms.create(300, 450, 'platform');\n platforms.create(250, 150, 'platform');\n platforms.create(50, 300, 'platform');\n platforms.create(150, 250, 'platform');\n platforms.create(650, 300, 'platform');\n platforms.create(550, 200, 'platform');\n platforms.create(300, 450, 'platform');\n platforms.create(400, 350, 'platform');\n platforms.setAll('body.immovable', true);\n}", "function setup() {\n\n\t//create a canvas\n\tcreateCanvas(1100, 570);\n\n\timageMode(CENTER);\n\n\t//create the Engine and add it to world\n\tengine = Engine.create();\n\tworld = engine.world;\n\t\n\t//create a paper objectx\n\tpaper = new Paper(212, 390, 80, 80);\n\n\t//create a ground\n\tground = new Ground(width / 2, 560, width, 20);\n\n\t//create the dustbin\n\tdustbin = createSprite(1002, 450, 180, 175);\n\tdustbin.addImage(\"dustbin\", dustbin_img);\n\tdustbin.scale = 0.6;\n\n\t//create the dustbin\n\tdustbin1 = new Dustbin(930, 490, 20, 110);\n\tdustbin2 = new Dustbin(1080, 490, 20, 110);\n\tdustbin3 = new Dustbin(1010, 543, 150, 10);\n\n\t//create the walls\n\t//wall = new Wall(1000, 300, 30, 100);\n\n\t//running the Engine\n\tEngine.run(engine);\n \n}", "refreshToPhysics() {\n if (!this.physicsObj) return\n this.physicsObj.position.copy(this.position);\n this.physicsObj.quaternion.copy(this.quaternion);\n this.physicsObj.velocity.copy(this.velocity);\n this.physicsObj.angularVelocity.copy(this.angularVelocity);\n }", "function setup() {\n createCanvas(w, h);\n frameRate(fr);\n\n // Place the home in a random spot\n home = createVector(random(0, w), random(0, h));\n\n // Generate ants\n for (let index = 0; index < ant_number; index++) {\n ants.push(new Ant(home, w, h, ant_speed, ant_radius));\n }\n\n // food_source = new FoodSource(w, h, food_quantity, food_rate, food_refill);\n food_source = new FoodSourceConcentrated(\n w,\n h,\n food_quantity,\n food_rate,\n food_refill,\n food_locations\n );\n}", "get mass() { return this._mass; }", "createPhysicalShape(entity, data) {\n return undefined;\n }", "get animatePhysics() {}", "addMass(x, y, anchored=false) {\n let mass = new Mass(x, y, anchored);\n this.masses.push(mass);\n this.forces();\n return mass;\n }", "constructor(scene) {\n this.scene = scene;\n\n let geo = new T.SphereBufferGeometry(.5, 30, 30);\n let mat = new T.MeshStandardMaterial({color: \"blue\"});\n \n // let botLeft = [];\n // for (let i = 0; i < 10; i++) {\n // let mesh = new T.Mesh(geo,mat);\n // scene.add(mesh);\n // }\n //split objects into 4 quadrants\n\n // build ground\n let groundGeo = new T.PlaneBufferGeometry(30,30);\n let groundMat = new T.MeshStandardMaterial( {color: \"red\"});\n this.ground = new T.Mesh(groundGeo, groundMat);\n this.ground.receiveShadow = true;\n this.ground.rotateX(2*Math.PI - Math.PI / 2);\n scene.add(this.ground);\n this.worldSize = 15;\n\n // build objects\n this.objects = [];\n let mesh1 = new T.Mesh(geo, mat);\n mesh1.position.x = -10;\n mesh1.position.y = .5;\n mesh1.position.z = -10;\n this.objects.push(mesh1);\n\n let mesh2 = new T.Mesh(geo, mat);\n mesh2.position.x = -5;\n mesh2.position.y = .5;\n mesh2.position.z = 8;\n this.objects.push(mesh2);\n\n let mesh3 = new T.Mesh(geo, mat);\n mesh3.position.x = -8;\n mesh3.position.y = .5;\n mesh3.position.z = -8;\n this.objects.push(mesh3);\n\n let mesh4 = new T.Mesh(geo, mat);\n mesh4.position.x = -12;\n mesh4.position.y = .5;\n mesh4.position.z = -5;\n this.objects.push(mesh4);\n\n let defGeo = new T.ConeBufferGeometry(1,1,50);\n let defMat = new T.MeshStandardMaterial({color: \"yellow\"});\n\n this.defenders = [];\n this.def2 = new T.Mesh(defGeo, defMat); // the following defender\n this.def2.position.x = 0;\n this.def2.position.z = -15;\n this.def2.position.y = .5;\n //this.scene.add(this.def2);\n this.defenders.push(this.def2);\n\n for (let i = 0; i < this.defenders.length; i++) {\n this.scene.add(this.defenders[i]);\n }\n\n for (let i = 0; i < this.objects.length; i++) {\n this.scene.add(this.objects[i]);\n }\n }", "function setupManipulators() {\n // Create a separate pack for the manipulators so they don't get mixed in\n // with the main scene's objects.\n var pack = g_client.createPack();\n\n // Create a root transform for the manipulators so they are 100% separate\n // from the scene's transforms.\n var manipulatorRoot = pack.createObject('Transform');\n\n g_manager = o3djs.manipulators.createManager(\n pack,\n manipulatorRoot,\n g_client.renderGraphRoot,\n g_mainViewInfo.root.priority + 1,\n g_mainViewInfo.drawContext);\n\n // Actually construct the manips. This function is implemented in the html\n // sample files that include this file, as it is different for each sample.\n createManipulators();\n}", "function World(o) {\n\n if (!(o instanceof Object)) o = {};\n\n // this world scale defaut is 0.1 to 10 meters max for dynamique body\n this.scale = o.worldscale || 1;\n this.invScale = 1 / this.scale;\n\n // The time between each step\n this.timeStep = o.timestep || 0.01666; // 1/60;\n this.timerate = this.timeStep * 1000;\n this.timer = null;\n\n this.preLoop = null; //function(){};\n this.postLoop = null; //function(){};\n\n // The number of iterations for constraint solvers.\n this.numIterations = o.iterations || 8;\n\n // It is a wide-area collision judgment that is used in order to reduce as much as possible a detailed collision judgment.\n switch (o.broadphase || 2) {\n case 1:\n this.broadPhase = new _BruteForceBroadPhase.BruteForceBroadPhase();\n break;\n case 2:\n default:\n this.broadPhase = new _SAPBroadPhase.SAPBroadPhase();\n break;\n case 3:\n this.broadPhase = new _DBVTBroadPhase.DBVTBroadPhase();\n break;\n }\n\n this.Btypes = ['None', 'BruteForce', 'Sweep & Prune', 'Bounding Volume Tree'];\n this.broadPhaseType = this.Btypes[o.broadphase || 2];\n\n // This is the detailed information of the performance.\n this.performance = null;\n this.isStat = o.info === undefined ? false : o.info;\n if (this.isStat) this.performance = new _Utils.InfoDisplay(this);\n\n /**\n * Whether the constraints randomizer is enabled or not.\n *\n * @property enableRandomizer\n * @type {Boolean}\n */\n this.enableRandomizer = o.random !== undefined ? o.random : true;\n\n // The rigid body list\n this.rigidBodies = null;\n // number of rigid body\n this.numRigidBodies = 0;\n // The contact list\n this.contacts = null;\n this.unusedContacts = null;\n // The number of contact\n this.numContacts = 0;\n // The number of contact points\n this.numContactPoints = 0;\n // The joint list\n this.joints = null;\n // The number of joints.\n this.numJoints = 0;\n // The number of simulation islands.\n this.numIslands = 0;\n\n // The gravity in the world.\n this.gravity = new _Vec.Vec3(0, -9.8, 0);\n if (o.gravity !== undefined) this.gravity.fromArray(o.gravity);\n\n var numShapeTypes = 5; //4;//3;\n this.detectors = [];\n this.detectors.length = numShapeTypes;\n var i = numShapeTypes;\n while (i--) {\n this.detectors[i] = [];\n this.detectors[i].length = numShapeTypes;\n }\n\n this.detectors[_constants.SHAPE_SPHERE][_constants.SHAPE_SPHERE] = new _SphereSphereCollisionDetector.SphereSphereCollisionDetector();\n this.detectors[_constants.SHAPE_SPHERE][_constants.SHAPE_BOX] = new _SphereBoxCollisionDetector.SphereBoxCollisionDetector(false);\n this.detectors[_constants.SHAPE_BOX][_constants.SHAPE_SPHERE] = new _SphereBoxCollisionDetector.SphereBoxCollisionDetector(true);\n this.detectors[_constants.SHAPE_BOX][_constants.SHAPE_BOX] = new _BoxBoxCollisionDetector.BoxBoxCollisionDetector();\n\n // CYLINDER add\n this.detectors[_constants.SHAPE_CYLINDER][_constants.SHAPE_CYLINDER] = new _CylinderCylinderCollisionDetector.CylinderCylinderCollisionDetector();\n\n this.detectors[_constants.SHAPE_CYLINDER][_constants.SHAPE_BOX] = new _BoxCylinderCollisionDetector.BoxCylinderCollisionDetector(true);\n this.detectors[_constants.SHAPE_BOX][_constants.SHAPE_CYLINDER] = new _BoxCylinderCollisionDetector.BoxCylinderCollisionDetector(false);\n\n this.detectors[_constants.SHAPE_CYLINDER][_constants.SHAPE_SPHERE] = new _SphereCylinderCollisionDetector.SphereCylinderCollisionDetector(true);\n this.detectors[_constants.SHAPE_SPHERE][_constants.SHAPE_CYLINDER] = new _SphereCylinderCollisionDetector.SphereCylinderCollisionDetector(false);\n\n // PLANE add\n\n this.detectors[_constants.SHAPE_PLANE][_constants.SHAPE_SPHERE] = new _SpherePlaneCollisionDetector_X.SpherePlaneCollisionDetector(true);\n this.detectors[_constants.SHAPE_SPHERE][_constants.SHAPE_PLANE] = new _SpherePlaneCollisionDetector_X.SpherePlaneCollisionDetector(false);\n\n this.detectors[_constants.SHAPE_PLANE][_constants.SHAPE_BOX] = new _BoxPlaneCollisionDetector_X.BoxPlaneCollisionDetector(true);\n this.detectors[_constants.SHAPE_BOX][_constants.SHAPE_PLANE] = new _BoxPlaneCollisionDetector_X.BoxPlaneCollisionDetector(false);\n\n // TETRA add\n //this.detectors[SHAPE_TETRA][SHAPE_TETRA] = new TetraTetraCollisionDetector();\n\n\n this.randX = 65535;\n this.randA = 98765;\n this.randB = 123456789;\n\n this.islandRigidBodies = [];\n this.islandStack = [];\n this.islandConstraints = [];\n}", "function Start()\n{\n\t//reset the structure index, refresh the GUI\n\tstructureIndex = 0;\n\tUpdateGUI();\n\t\n\t//gather all the flyer spawn points into an array, so we don't have to do it manually\n\tflyerSpawnPoints = new Transform[flyerSpawns.childCount];\n\tvar i : int = 0;\n\tfor(var theSpawnPoint : Transform in flyerSpawns)\n\t{\n\t\tflyerSpawnPoints[i] = theSpawnPoint;\n\t\ti++;\n\t}\n\t//\n\t\n\t//gather all the GROUND spawn points into an array, so we don't have to do it manually\n\tgroundSpawnPoints = new Transform[groundSpawns.childCount];\n\tvar g : int = 0;\n\tfor(var theGroundSpawnPoint : Transform in groundSpawns)\n\t{\n\t\tgroundSpawnPoints[g] = theGroundSpawnPoint;\n\t\tg++;\n\t}\n\t//\n\t\n\t//NEW\n\tSetNextWave(); //setup the next wave variables (ie difficulty, respawn time, speed, etc)\n\tStartNewWave(); //start the new wave!\n\t//\n}", "function computeSceneGraph() {\n\n //\n // Define Scene Graph\n //\n roomPositionNode = new Node();\n\n tablePositionNode = new Node();\n tablePositionNode.localMatrix = utils.MakeTranslateMatrix(-650, -715, -250.0); // Relative position to room\n\n shelfPositionNode = new Node();\n shelfPositionNode.localMatrix = utils.MakeTranslateMatrix(100, -75, -800); // Relative position to room\n\n pipePositionNode = new Node();\n pipePositionNode.localMatrix = utils.MakeTranslateMatrix(-1415.0, 100, 0.0); // Relative to room\n\n ventPositionNode = new Node();\n ventPositionNode.localMatrix = utils.MakeTranslateMatrix(890, -560.0, 550.0); // Relative to room\n\n posterPositionNode = new Node();\n posterPositionNode.localMatrix = utils.MakeTranslateMatrix(-910, 90.0, -950.0); // Relative to room\n \n cratesCentralPositionNode = new Node();\n cratesCentralPositionNode.localMatrix = utils.MakeTranslateMatrix(470, -950, -550); // Relative to room\n\n crateRightPositionNode = new Node();\n crateRightPositionNode.localMatrix = utils.MakeTranslateMatrix(180, 0, 0); \n \n crateLeftPositionNode = new Node();\n crateLeftPositionNode.localMatrix = utils.MakeTranslateMatrix(-170, 0, 0);\n\n crateTopPositionNode = new Node();\n crateTopPositionNode.localMatrix = utils.MakeTranslateMatrix(0, 260, 0);\n\n shortPipeOnePositionNode = new Node();\n shortPipeOnePositionNode.localMatrix = utils.MakeTranslateMatrix(0.0, 0.0, 70);\n \n shortPipeTwoPositionNode = new Node();\n shortPipeTwoPositionNode.localMatrix = utils.MakeTranslateMatrix(0.0, 0.0, -70);\n\n pedestalOnePositionNode = new Node();\n pedestalOnePositionNode.localMatrix = utils.MakeTranslateMatrix(-215.0, 0.0, -25.0); // Relative position to table\n\n boatOnePositionNode = new Node();\n boatOnePositionNode.localMatrix = utils.MakeTranslateMatrix(0.0, 65.0, 0.0); // Floating over pedestal\n\n pedestalTwoPositionNode = new Node();\n pedestalTwoPositionNode.localMatrix = utils.MakeTranslateMatrix(215.0, 0.0, -25.0); // Relative position to table\n\n boatTwoPositionNode = new Node();\n boatTwoPositionNode.localMatrix = utils.MakeTranslateMatrix(0.0, 65.0, 0.0); // Floating over pedestal\n\n pedestalThreePositionNode = new Node();\n pedestalThreePositionNode.localMatrix = utils.MakeTranslateMatrix(-245.0, 190.0, -5.0); // Relative position to table\n\n boatThreePositionNode = new Node();\n boatThreePositionNode.localMatrix = utils.MakeTranslateMatrix(0.0, 65.0, 0.0); // Floating over pedestal\n\n pedestalFourPositionNode = new Node();\n pedestalFourPositionNode.localMatrix = utils.MakeTranslateMatrix(245.0, 190.0, -5.0); // Relative position to table\n\n boatFourPositionNode = new Node();\n boatFourPositionNode.localMatrix = utils.MakeTranslateMatrix(0.0, 65.0, 0.0); // Floating over pedestal\n\n // The null values in drawInfo will be assigned in runtime.\n roomNode = new Node();\n roomNode.localMatrix = utils.multiplyMatrices(utils.MakeScaleMatrix(950), utils.MakeRotateXYZMatrix(270, 90, 0))\n roomNode.drawInfo = {\n name: 'room',\n programInfo: program,\n // Locations\n positionAttributeLocation: null,\n normalAttributeLocation: null,\n uvLocation: null,\n matrixLocation: null,\n textLocation: null,\n normalMatrixPositionHandle: null,\n vertexArray: null,\n vertexMatrixPositionHandle: null,\n eyePositionHandle: null,\n // Model info\n vertices: null,\n normals: null,\n texCoord: null,\n indices: null,\n textureSrc: roomTextureSrc,\n textureRef: [],\n }\n\n tableNode = new Node();\n tableNode.localMatrix = utils.MakeScaleMatrix(5.5);\n tableNode.drawInfo = {\n name: 'table',\n programInfo: program,\n // Locations\n positionAttributeLocation: null,\n normalAttributeLocation: null,\n uvLocation: null,\n matrixLocation: null,\n textLocation: null,\n normalMatrixPositionHandle: null,\n vertexArray: null,\n vertexMatrixPositionHandle: null,\n eyePositionHandle: null,\n // Model info\n vertices: null,\n normals: null,\n texCoord: null,\n indices: null,\n textureSrc: tableTextureSrc,\n textureRef: [],\n }\n\n shelfNode = new Node();\n shelfNode.localMatrix = utils.MakeScaleMatrix(3);\n shelfNode.drawInfo = {\n name: 'shelf',\n programInfo: program,\n // Locations\n positionAttributeLocation: null,\n normalAttributeLocation: null,\n uvLocation: null,\n matrixLocation: null,\n textLocation: null,\n normalMatrixPositionHandle: null,\n vertexArray: null,\n vertexMatrixPositionHandle: null,\n eyePositionHandle: null,\n // Model info\n vertices: null,\n normals: null,\n texCoord: null,\n indices: null,\n textureSrc: shelfTextureSrc,\n textureRef: [],\n }\n\n posterNode = new Node();\n posterNode.localMatrix = utils.multiplyMatrices(utils.MakeScaleMatrix(95), utils.MakeRotateXYZMatrix(90, 0.0, 0.0));\n posterNode.drawInfo = {\n name: 'poster',\n programInfo: program,\n // Locations\n positionAttributeLocation: null,\n normalAttributeLocation: null,\n uvLocation: null,\n matrixLocation: null,\n textLocation: null,\n normalMatrixPositionHandle: null,\n vertexArray: null,\n vertexMatrixPositionHandle: null,\n eyePositionHandle: null,\n // Model info\n vertices: null,\n normals: null,\n texCoord: null,\n indices: null,\n textureSrc: posterTextureSrc,\n textureRef: [],\n }\n\n ventNode = new Node();\n ventNode.localMatrix = utils.multiplyMatrices(utils.MakeScaleMatrix(4), utils.MakeRotateXYZMatrix(180, 0, 90));\n ventNode.drawInfo = {\n name: 'vent',\n programInfo: program,\n // Locations\n positionAttributeLocation: null,\n normalAttributeLocation: null,\n uvLocation: null,\n matrixLocation: null,\n textLocation: null,\n normalMatrixPositionHandle: null,\n vertexArray: null,\n vertexMatrixPositionHandle: null,\n eyePositionHandle: null,\n // Model info\n vertices: null,\n normals: null,\n texCoord: null,\n indices: null,\n textureSrc: ventTextureSrc,\n textureRef: [],\n }\n\n crateRightNode = new Node();\n crateRightNode.localMatrix = utils.multiplyMatrices(utils.MakeScaleMatrix(275), utils.MakeRotateXYZMatrix(-3, 0, 0));\n crateRightNode.drawInfo = {\n name: 'crate',\n programInfo: program,\n // Locations\n positionAttributeLocation: null,\n normalAttributeLocation: null,\n uvLocation: null,\n matrixLocation: null,\n textLocation: null,\n normalMatrixPositionHandle: null,\n vertexArray: null,\n vertexMatrixPositionHandle: null,\n eyePositionHandle: null,\n // Model info\n vertices: null,\n normals: null,\n texCoord: null,\n indices: null,\n textureSrc: crateTextureSrc,\n textureRef: [],\n }\n\n crateLeftNode = new Node();\n crateLeftNode.localMatrix = utils.multiplyMatrices(utils.MakeScaleMatrix(275), utils.MakeRotateXYZMatrix(9, 0, 0));\n crateLeftNode.drawInfo = {\n name: 'crate',\n programInfo: program,\n // Locations\n positionAttributeLocation: null,\n normalAttributeLocation: null,\n uvLocation: null,\n matrixLocation: null,\n textLocation: null,\n normalMatrixPositionHandle: null,\n vertexArray: null,\n vertexMatrixPositionHandle: null,\n eyePositionHandle: null,\n // Model info\n vertices: null,\n normals: null,\n texCoord: null,\n indices: null,\n textureSrc: crateTextureSrc,\n textureRef: [],\n }\n\n crateTopNode = new Node();\n crateTopNode.localMatrix = utils.multiplyMatrices(utils.MakeScaleMatrix(275), utils.MakeRotateXYZMatrix(99, 0, 0));\n crateTopNode.drawInfo = {\n name: 'crate',\n programInfo: program,\n // Locations\n positionAttributeLocation: null,\n normalAttributeLocation: null,\n uvLocation: null,\n matrixLocation: null,\n textLocation: null,\n normalMatrixPositionHandle: null,\n vertexArray: null,\n vertexMatrixPositionHandle: null,\n eyePositionHandle: null,\n // Model info\n vertices: null,\n normals: null,\n texCoord: null,\n indices: null,\n textureSrc: crateTextureSrc,\n textureRef: [],\n }\n\n pipeNode = new Node();\n pipeNode.localMatrix = utils.multiplyMatrices(utils.MakeScaleMatrix(5), utils.MakeRotateXYZMatrix(0, 90, 90));\n pipeNode.drawInfo = {\n name: 'pipe',\n programInfo: program,\n // Locations\n positionAttributeLocation: null,\n normalAttributeLocation: null,\n uvLocation: null,\n matrixLocation: null,\n textLocation: null,\n normalMatrixPositionHandle: null,\n vertexArray: null,\n vertexMatrixPositionHandle: null,\n eyePositionHandle: null,\n // Model info\n vertices: null,\n normals: null,\n texCoord: null,\n indices: null,\n textureSrc: pipesTextureSrc,\n textureRef: [],\n }\n\n shortPipeOneNode = new Node();\n shortPipeOneNode.localMatrix = utils.multiplyMatrices(utils.MakeScaleMatrix(5), utils.MakeRotateXYZMatrix(0, 90, 90));\n shortPipeOneNode.drawInfo = {\n name: 'shortPipe',\n programInfo: program,\n // Locations\n positionAttributeLocation: null,\n normalAttributeLocation: null,\n uvLocation: null,\n matrixLocation: null,\n textLocation: null,\n normalMatrixPositionHandle: null,\n vertexArray: null,\n vertexMatrixPositionHandle: null,\n eyePositionHandle: null,\n // Model info\n vertices: null,\n normals: null,\n texCoord: null,\n indices: null,\n textureSrc: pipesTextureSrc,\n textureRef: [],\n }\n \n shortPipeTwoNode = new Node();\n shortPipeTwoNode.localMatrix = utils.multiplyMatrices(utils.MakeScaleMatrix(5), utils.MakeRotateXYZMatrix(0, 90, 90));\n shortPipeTwoNode.drawInfo = {\n name: 'shortPipe',\n programInfo: program,\n // Locations\n positionAttributeLocation: null,\n normalAttributeLocation: null,\n uvLocation: null,\n matrixLocation: null,\n textLocation: null,\n normalMatrixPositionHandle: null,\n vertexArray: null,\n vertexMatrixPositionHandle: null,\n eyePositionHandle: null,\n // Model info\n vertices: null,\n normals: null,\n texCoord: null,\n indices: null,\n textureSrc: pipesTextureSrc,\n textureRef: [],\n }\n\n pedestalOneNode = new Node();\n pedestalOneNode.localMatrix = utils.MakeScaleMatrix(6.5);\n pedestalOneNode.drawInfo = {\n name: 'pedestal',\n programInfo: program,\n // Locations\n positionAttributeLocation: null,\n normalAttributeLocation: null,\n uvLocation: null,\n matrixLocation: null,\n textLocation: null,\n normalMatrixPositionHandle: null,\n vertexArray: null,\n vertexMatrixPositionHandle: null,\n eyePositionHandle: null,\n // Model info\n vertices: null,\n normals: null,\n texCoord: null,\n indices: null,\n textureSrc: pedestalTextureSrc,\n textureRef: [],\n }\n\n boatOneNode = new Node();\n defaultBoatOneLocalMatrix = boatOneNode.localMatrix = utils.MakeScaleMatrix(0.25);\n boatOneNode.drawInfo = {\n name: 'boatOne',\n programInfo: programOne,\n // Locations\n positionAttributeLocation: null,\n normalAttributeLocation: null,\n uvLocation: null,\n matrixLocation: null,\n textLocation: null,\n normalMatrixPositionHandle: null,\n vertexArray: null,\n vertexMatrixPositionHandle: null,\n eyePositionHandle: null,\n // Model info\n vertices: null,\n normals: null,\n texCoord: null,\n indices: null,\n textureSrc: boatTextureSrc,\n textureRef: [],\n };\n\n pedestalTwoNode = new Node();\n pedestalTwoNode.localMatrix = utils.MakeScaleMatrix(6.5);\n pedestalTwoNode.drawInfo = {\n name: 'pedestal',\n programInfo: program,\n // Locations\n positionAttributeLocation: null,\n normalAttributeLocation: null,\n uvLocation: null,\n matrixLocation: null,\n textLocation: null,\n normalMatrixPositionHandle: null,\n vertexArray: null,\n vertexMatrixPositionHandle: null,\n eyePositionHandle: null,\n // Model info\n vertices: null,\n normals: null,\n texCoord: null,\n indices: null,\n textureSrc: pedestalTextureSrc,\n textureRef: [],\n }\n\n boatTwoNode = new Node();\n defaultBoatTwoLocalMatrix = boatTwoNode.localMatrix = utils.MakeScaleMatrix(0.25);\n boatTwoNode.drawInfo = {\n name: 'boatTwo',\n programInfo: programTwo,\n // Locations\n positionAttributeLocation: null,\n normalAttributeLocation: null,\n uvLocation: null,\n matrixLocation: null,\n textLocation: null,\n normalMatrixPositionHandle: null,\n vertexArray: null,\n vertexMatrixPositionHandle: null,\n eyePositionHandle: null,\n // Model info\n vertices: null,\n normals: null,\n texCoord: null,\n indices: null,\n textureSrc: boatTextureSrc,\n textureRef: [],\n };\n \n pedestalThreeNode = new Node();\n pedestalThreeNode.localMatrix = utils.MakeScaleMatrix(6.5);\n pedestalThreeNode.drawInfo = {\n name: 'pedestal',\n programInfo: program,\n // Locations\n positionAttributeLocation: null,\n normalAttributeLocation: null,\n uvLocation: null,\n matrixLocation: null,\n textLocation: null,\n normalMatrixPositionHandle: null,\n vertexArray: null,\n vertexMatrixPositionHandle: null,\n eyePositionHandle: null,\n // Model info\n vertices: null,\n normals: null,\n texCoord: null,\n indices: null,\n textureSrc: pedestalTextureSrc,\n textureRef: [],\n }\n\n boatThreeNode = new Node();\n defaultBoatThreeLocalMatrix = boatThreeNode.localMatrix = utils.MakeScaleMatrix(0.25);\n boatThreeNode.drawInfo = {\n name: 'boatThree',\n programInfo: programThree,\n // Locations\n positionAttributeLocation: null,\n normalAttributeLocation: null,\n uvLocation: null,\n matrixLocation: null,\n textLocation: null,\n normalMatrixPositionHandle: null,\n vertexArray: null,\n vertexMatrixPositionHandle: null,\n eyePositionHandle: null,\n // Model info\n vertices: null,\n normals: null,\n texCoord: null,\n indices: null,\n textureSrc: boatTextureSrc,\n textureRef: [],\n };\n \n pedestalFourNode = new Node();\n pedestalFourNode.localMatrix = utils.MakeScaleMatrix(6.5);\n pedestalFourNode.drawInfo = {\n name: 'pedestal',\n programInfo: program,\n // Locations\n positionAttributeLocation: null,\n normalAttributeLocation: null,\n uvLocation: null,\n matrixLocation: null,\n textLocation: null,\n normalMatrixPositionHandle: null,\n vertexArray: null,\n vertexMatrixPositionHandle: null,\n eyePositionHandle: null,\n // Model info\n vertices: null,\n normals: null,\n texCoord: null,\n indices: null,\n textureSrc: pedestalTextureSrc,\n textureRef: [],\n }\n\n boatFourNode = new Node();\n defaultBoatFourLocalMatrix = boatFourNode.localMatrix = utils.MakeScaleMatrix(0.25);\n boatFourNode.drawInfo = {\n name: 'boatFour',\n programInfo: programFour,\n // Locations\n positionAttributeLocation: null,\n normalAttributeLocation: null,\n uvLocation: null,\n matrixLocation: null,\n textLocation: null,\n normalMatrixPositionHandle: null,\n vertexArray: null,\n vertexMatrixPositionHandle: null,\n eyePositionHandle: null,\n // Model info\n vertices: null,\n normals: null,\n texCoord: null,\n indices: null,\n textureSrc: boatTextureSrc,\n textureRef: [],\n };\n\n // Creaing the gererchy\n roomNode.setParent(roomPositionNode);\n\n // Foreground\n tablePositionNode.setParent(roomPositionNode);\n tableNode.setParent(tablePositionNode);\n // Boat 1\n pedestalOnePositionNode.setParent(tablePositionNode);\n pedestalOneNode.setParent(pedestalOnePositionNode);\n boatOnePositionNode.setParent(pedestalOnePositionNode);\n boatOneNode.setParent(boatOnePositionNode);\n // Boat 2\n pedestalTwoPositionNode.setParent(tablePositionNode);\n pedestalTwoNode.setParent(pedestalTwoPositionNode);\n boatTwoPositionNode.setParent(pedestalTwoPositionNode);\n boatTwoNode.setParent(boatTwoPositionNode);\n\n // Background\n shelfPositionNode.setParent(roomPositionNode);\n shelfNode.setParent(shelfPositionNode);\n // Boat 3\n pedestalThreePositionNode.setParent(shelfPositionNode);\n pedestalThreeNode.setParent(pedestalThreePositionNode);\n boatThreePositionNode.setParent(pedestalThreePositionNode);\n boatThreeNode.setParent(boatThreePositionNode);\n // Boat 4\n pedestalFourPositionNode.setParent(shelfPositionNode);\n pedestalFourNode.setParent(pedestalFourPositionNode);\n boatFourPositionNode.setParent(pedestalFourPositionNode);\n boatFourNode.setParent(boatFourPositionNode);\n\n // Scenary\n // Central pipe\n pipePositionNode.setParent(roomPositionNode);\n pipeNode.setParent(pipePositionNode);\n // Side Pipes\n shortPipeOnePositionNode.setParent(pipePositionNode);\n shortPipeOneNode.setParent(shortPipeOnePositionNode);\n shortPipeTwoPositionNode.setParent(pipePositionNode);\n shortPipeTwoNode.setParent(shortPipeTwoPositionNode);\n // Vent\n ventPositionNode.setParent(roomPositionNode);\n ventNode.setParent(ventPositionNode);\n // Crates\n cratesCentralPositionNode.setParent(roomPositionNode);\n crateRightPositionNode.setParent(cratesCentralPositionNode);\n crateRightNode.setParent(crateRightPositionNode);\n crateLeftPositionNode.setParent(cratesCentralPositionNode);\n crateLeftNode.setParent(crateLeftPositionNode);\n crateTopPositionNode.setParent(cratesCentralPositionNode);\n crateTopNode.setParent(crateTopPositionNode);\n // Poster\n posterPositionNode.setParent(roomPositionNode);\n posterNode.setParent(posterPositionNode);\n\n objects = [\n roomNode,\n tableNode,\n shelfNode,\n ventNode,\n pipeNode,\n crateRightNode,\n crateLeftNode,\n crateTopNode,\n posterNode,\n shortPipeOneNode,\n shortPipeTwoNode,\n pedestalOneNode,\n boatOneNode,\n pedestalTwoNode,\n boatTwoNode,\n pedestalThreeNode,\n boatThreeNode,\n pedestalFourNode,\n boatFourNode\n ];\n\n //---------------SceneGraph defined\n}", "function add_physics_component(params)\n\t{\n\t\tparams.game_object = self;\n\t\tself.physics_object = new Physics_Object(params);\n\t}", "get mass()\n {\n return this.baseMass;\n }", "function addPlatforms() {\n platforms = game.add.physicsGroup();\n // logo\n platforms.create(745, 0, 'logo');\n // platforms\n platforms.create(70, 117, 'platform');\n platforms.create(440, 100, 'platform');\n platforms.create(150, 210, 'platform');\n platforms.create(755, 200, 'platform');\n platforms.create(30, 400, 'platform');\n platforms.create(495, 470, 'platform');\n platforms.create(755, 380, 'platform');\n platforms.create(120, 550, 'platform');\n platforms.create(450, 286, 'platform');\n platforms.create(750, 560, 'platform');\n platforms.setAll('body.immovable', true);\n}", "function setup() {\n\n // Configure the world.\n w = new p$.World(\"canvasContainer\", draw, resize);\n w.axis.display = false;\n w.color = p$.BOX_COLORS.GRAY.BACKGROUND;\n\n // Configure results box\n labels.heatTransfer = results.addLabel(130, 14, { name: \"Corriente\", units: \"W\", labelWidth: BOX_LABEL_WIDTH, decPlaces: 1 } );\n labels.heatTransfer.setPosition(0, 25);\n results.calculateDimensions();\n\n // Configure the z index of all objects.\n\n // Add objects to world.\n w.add(sim, results);\n\n}", "function setup() {\n\tcreateCanvas(800, 600);\n\trectMode(CENTER);\n\n\tengine = Engine.create();\n\tworld = engine.world;\n\n\tvar roof_options={\n\t\tisStatic:true\t\t\t\n\t}\n\n\troof = Bodies.rectangle(400,100,230,20,roof_options);\n World.add(world,roof);\n\tvar bob_options = {\n\t\tisStatic : false,\n\t\trestitution :1,\n\t\tdensity : 0.8\n\t}\n\tbob1 = Bodies.circle(320, 380, 20,bob_options)\n\tWorld.add(world, bob1);\n\tbob2 = Bodies.circle(350, 380, 20,bob_options)\n\tWorld.add(world, bob2);\n\tbob3 = Bodies.circle(400, 380, 20,bob_options)\n\tWorld.add(world, bob3);\n\tbob4 = Bodies.circle(440, 380, 20,bob_options)\n\tWorld.add(world, bob4);\n\tbob5 = Bodies.circle(480, 380, 20,bob_options)\n\tWorld.add(world, bob5);\n\n\trope1 = new Rope (bob1, roof, -80, 0)\n\trope2 = new Rope (bob2, roof, -40, 0)\n\trope3 = new Rope (bob3, roof, 0, 0)\n\trope4 = new Rope (bob4, roof, 40, 0)\n\trope5 = new Rope (bob5, roof, 80, 0)\n\tEngine.run(engine);\n\t\n \n}", "function setup() {\n\tcreateCanvas(1800, 700);\n\n\n\tengine = Engine.create();\n\tworld = engine.world;\n\n\t//Create the Bodies Here.\n\tbg = new Background(900,350,0,0);\n\ttree = new Tree(1400,320,0,0);\n\tboy = new Boy(250,540,0,0);\n\tfs1 = new FakeStone(370,600,0,0);\n\tfs2 = new FakeStone(400,600,0,0);\n\tfs3 = new FakeStone(375,640,0,0);\n\tfs4 = new FakeStone(345,650,0,0);\n\tfs5 = new FakeStone(400,640,0,0);\n\tfs6 = new FakeStone(350,615,0,0);\n\tstone = new Stone(150,380,50);\n\tmango1 = new Mango(1400,200,50);\n\tmango2 = new Mango(1500,200,50);\n\tmango3 = new Mango(1450,100,50);\n\tmango4 = new Mango(1300,250,50);\n\tmango5 = new Mango(1360,100,50);\n\tmango6 = new Mango(1590,240,50);\n\tground = new Ground(900,600,1800,30);\n\trope = new Rope(stone.body,{x:150,y:380});\n\n\t// var render = Render.create({\n\t// \telement:document.body,\n\t// \tengine: engine,\n\t// \toptions: {\n\t// \t width: 1800,\n\t// \t height: 700,\n\t// \t wireframes:true,\n\t// \t showAngleIndicator: true\n\t// \t},\n\t \n\t// });\n\t// Render.run(render);\n\n\tEngine.run(engine);\n \n}", "function platformCalc() {\r\n var subs = platform_broken_substitute;\r\n\r\n platforms.forEach(function(p, i) {\r\n if (p.type == 2) {\r\n if (p.x < 0 || p.x + p.width > width) p.vx *= -1;\r\n\r\n p.x += p.vx;\r\n }\r\n\r\n if (p.flag == 1 && subs.appearance === false && jumpCount === 0) {\r\n subs.x = p.x;\r\n subs.y = p.y;\r\n subs.appearance = true;\r\n\r\n jumpCount++;\r\n }\r\n\r\n p.draw();\r\n });\r\n\r\n if (subs.appearance === true) {\r\n subs.draw();\r\n subs.y += 8;\r\n }\r\n\r\n if (subs.y > height) subs.appearance = false;\r\n }", "function setup() {\n\tcreateCanvas(800, 600);\n\trectMode(CENTER);\n\n\tengine = Engine.create();\n\tworld = engine.world;\n var bob_options ={\n restitution:0.9,}\n\tvar roof_options ={\n\tisStatic:true,\n}\n\n\troof = Bodies.rectangle(400,100,230,20,roof_options);\n World.add(world,roof);\n\tbase = Bodies.rectangle(400,580,500,20,roof_options);\n\tWorld.add(world,base);\n bob = Bodies.circle(345,140,20,bob_options);\n World.add(world,bob);\n\tbob2 = Bodies.circle(365,140,20,bob_options);\n\tWorld.add(world,bob2);\n\tbob3 = Bodies.circle(380,140,20,bob_options);\n\tWorld.add(world,bob3);\n\tbob4 = Bodies.circle(400,140,20,bob_options);\n\tWorld.add(world,bob4);\n bob5 = Bodies.circle(425,140,20,bob_options);\n\tWorld.add(world,bob5);\n\n rope1 = new rope (bob,roof,-80,0)\n\n\n\tEngine.run(engine); \n}", "function Shapes() {\n var renderShape = {\n box: function(E1) {\n var rx = E1.position.x;\n var ry = E1.position.y;\n\n noStroke();\n fill(55, 189, 255);\n rect(rx - game.renderOffset.x, ry + game.renderOffset.y, E1.size.width, E1.size.height);\n }\n };\n\n var renderPhysicsOfShape = {\n box: function(E1) {\n var pyX = E1.position.x - game.renderOffset.x;\n var pyY = E1.position.y + game.renderOffset.y;\n var pyMidX = E1.getMidX() - game.renderOffset.x;\n var pyMidY = E1.getMidY() + game.renderOffset.y;\n\n noStroke();\n fill('#333');\n rect(pyX, pyY, E1.size.width, E1.size.height);\n stroke(70, 255, 33);\n strokeWeight(2);\n line(\n pyMidX,\n pyMidY,\n pyMidX + E1.velocity.x * 5,\n pyMidY + E1.velocity.y * 5\n );\n stroke('#00A0E12');\n line(\n pyMidX,\n pyMidY,\n pyMidX + E1.acceleration.x * 25,\n pyMidY + E1.acceleration.y * 25\n );\n stroke('#D42322');\n line(\n pyMidX,\n pyMidY,\n pyMidX + E1.velocity.x - E1.acceleration.x * 5,\n pyMidY + E1.velocity.y - E1.acceleration.y * 5\n );\n }\n };\n\n function renderDebug(E1) {\n var pyMidX = E1.getMidX();\n var pyMidY = E1.getMidY();\n\n noStroke();\n fill('#33A6AA');\n text(\n 'ID: ' + E1.id +\n '\\nCollides with: ' + Object.keys(E1.collidesWith) +\n '\\nShape: ' + E1.properties.get('shape') +\n '\\nType: ' + E1.properties.get('type') +\n '\\nPos: x-' + E1.position.x.toFixed(2) + ' | ' + E1.position.y.toFixed(2) +\n '\\nAcc: ' + E1.acceleration.x.toFixed(2) + ' | ' + E1.acceleration.y.toFixed(2) +\n '\\nVel: ' + E1.velocity.x.toFixed(2) + ' | ' + E1.velocity.y.toFixed(2),\n E1.position.x - game.renderOffset.x,\n E1.position.y + game.renderOffset.y + E1.size.height + 14\n );\n\n for(var collid in E1.collidesWith) {\n var E2 = E1.collidesWith[collid];\n\n stroke('#8C3EB5')\n line(\n E1.getMidX() - game.renderOffset.x,\n E1.getMidY() + game.renderOffset.y,\n E2.getMidX() - game.renderOffset.x,\n E2.getMidY() + game.renderOffset.y\n );\n }\n }\n\n this.render = function(E1) {\n renderShape[E1.properties.get('shape')](E1);\n }\n\n this.renderPhysicsOf = function(E1) {\n renderPhysicsOfShape[E1.properties.get('shape') ](E1);\n }\n\n this.renderDebugOf = function(E1) {\n renderDebug(E1);\n }\n}", "init() {\n // create the particle system\n // this._ps = arbor.ParticleSystem(2000, 600, 0.5);\n this._ps = arbor.ParticleSystem({\n repulsion: 300,\n stiffness: 100,\n friction: 0.8,\n gravity: false,\n precision: 0.1\n });\n this._ps.parameters({ gravity: true });\n\n // set the particle systems renderer to the same methods\n this._ps.renderer = { init: this._renderer.init.bind(this._renderer), redraw: this._renderer.redraw.bind(this._renderer) };\n this._renderer.init(this._ps);\n }", "constructor() {\n this.pos = createVector(random(man.pos.x + 40, man.pos.x + 5000), random(35, height -11));\n this.vel = createVector(-0.25, 0);\n this.acc = createVector(0, 0);\n this.quality = floor(random()*3)+1;\n \n \n }", "function createShapes() {\n var pedestalRes = 10;\n var sphereRes = 20;\n var coneRes = 20;\n \n myTeapot = new Teapot();\n teapotColumn = new Cylinder(pedestalRes, pedestalRes);\n teapotBase = new Cube( pedestalRes );\n teapotTop = new Cube( pedestalRes );\n \n myTeapot.VAO = bindVAO (myTeapot);\n teapotColumn.VAO = bindVAO( teapotColumn );\n teapotTop.VAO = bindVAO( teapotTop );\n teapotBase.VAO = bindVAO( teapotBase );\n \n mySphere = new Sphere( sphereRes, sphereRes );\n sphereColumn = new Cylinder(pedestalRes, pedestalRes);\n sphereBase = new Cube( pedestalRes );\n sphereTop = new Cube( pedestalRes );\n \n mySphere.VAO = bindVAO ( mySphere );\n sphereColumn.VAO = bindVAO( sphereColumn );\n sphereTop.VAO = bindVAO( sphereTop );\n sphereBase.VAO = bindVAO( sphereBase );\n \n myCone = new Cone(coneRes, coneRes);\n coneColumn = new Cylinder(pedestalRes, pedestalRes);\n coneBase = new Cube( pedestalRes );\n coneTop = new Cube( pedestalRes );\n \n myCone.VAO = bindVAO ( myCone );\n coneColumn.VAO = bindVAO( coneColumn );\n coneTop.VAO = bindVAO( coneTop );\n coneBase.VAO = bindVAO( coneBase );\n}", "function setup() {\n\tcreateCanvas(800, 600);\n\trectMode(CENTER);\n\n\tengine = Engine.create();\n\tworld = engine.world;\n\n\tvar roof_options={\n\t\tisStatic:true\t\t\t\n\t}\n\tvar bob1_options={\n\t\trestitution: 0.8\n\t }\n\t var bob2_options={\n\t\t restitution: 0.8\n\t }\n\t var bob3_options={\n\t\trestitution: 0.8\n\t }\n\t var bob4_options={\n\t\t restitution: 0.8\n\t }\n\t var bob5_options={\n\t\trestitution: 0.8\n\t }\n\n\n\tbob1 = Bodies.circle(500,20,10,bob1_options);\n\tWorld.add(world,bob1);\n\t//bob2 = Bodies.circle(250,40,10,bob2_options);\n\t//World.add(world,bob2);\n//\tbob2 = Bodies.circle(300,30,10,bob3_options);\n // World.add(world,bob3);\n\t//bob2 = Bodies.circle(350,20,10,bob4_options);\n//\tWorld.add(world,bob4);\n//\tbob2 = Bodies.circle(400,10,10,bob5_options);\n//\tWorld.add(world,bob5);\n\troof = Bodies.rectangle(400,100,230,20,roof_options);\n World.add(world,roof);\n\n\tEngine.run(engine);\n\t\n \n}", "function makeSpaceShip(spec) {\n let that = {};\n\n that.image = new Image();\n that.ready = false;\n\n that.image.onload = function() {\n if (that.image.width >= that.image.height) {\n let aspectRatio = that.image.width / that.image.height;\n that.width = spec.width * aspectRatio;\n that.height = spec.height;\n }\n else {\n let aspectRatio = that.image.height / that.image.width;\n that.width = spec.width;\n that.height = spec.height * aspectRatio;\n }\n\n that.exhaust = {x: 0, y:0};\n that.exhaust.x = spec.center.x;\n that.radius = that.height/2;\n that.exhaust.y = spec.center.y + that.radius;\n\n that.hitBox = {\n center: {x: spec.center.x, y: spec.center.y},\n radius: that.height/2\n };\n\n that.ready = true;\n };\n\n that.image.src = spec.imageSrc;\n that.center = spec.center;\n that.rotation = Math.PI / 2;\n that.speed = spec.speed;\n that.level = -that.rotation * 180 / Math.PI;\n that.fuel = spec.startingFuel;\n that.accelerationRate = 0;\n that.nose = {x: 0, y:0};\n that.tail = {x: 0, y:0};\n\n that.useJets = (elapsedTime) => {\n if (that.fuel > 0) {\n thrustSound1.play();\n thrustSound2.play();\n that.fuel -= (elapsedTime * spec.fuelConsumptionRate);\n if (that.accelerationRate > 0) {\n that.accelerationRate = 0;\n }\n that.center.x += that.level * 0.005 * that.accelerationRate;\n that.accelerationRate -= (elapsedTime**0.001);\n exhaustSystem.isCreateNewParticles = true;\n }\n };\n\n that.rotateLeft = (elapsedTime) => {\n if (that.rotation > -1 * Math.PI / 2 + 0.5) {\n that.rotation -= (elapsedTime * spec.rotateRate);\n that.level = -that.rotation * 180 / Math.PI;\n }\n };\n\n that.rotateRight = (elapsedTime) => {\n if (that.rotation < Math.PI / 2 - 0.5) {\n that.rotation += (elapsedTime * spec.rotateRate);\n that.level = -that.rotation * 180 / Math.PI;\n }\n };\n\n return that;\n}", "spawns() {\n if (random(1) < 0.01) {\n // accelerates in y axis\n this.accelerations.push(new createVector(0, random(0.1, 1)));\n this.velocities.push(new createVector(0, 0));\n this.locations.push(new createVector(random(width), 0));\n this.diams.push(random(30, 50));\n }\n }", "function setupComponents() {\n\tplanComponents= {\n\t\t\twalls: [],\n\t\t\tfornitures: []\n\t}\n}", "function theGame($,phys,GameFramework, Box2D, drawutils, mathutils) {\n /* jshint unused:true */\n 'use strict';\n function URFP( x ) { /* jshint expr:true */ x; }\n URFP(Box2D);\n URFP(mathutils);\n\n var game = new GameFramework('varying-control-scheme', 'Varying Control Scheme', 'Control type');\n\n game.setSpawnWorldCallback( function() {\n /*jshint camelcase:false */\n /* ^ we do this because the Box2D bindings are fugly. */\n var i;\n\n this.task = {};\n this.task.numRobots = 16; // number of robots\n this.task.robots = []; // array of bodies representing the robots\n this.task.blocks = []; // array of bodies representing blocks\n this.task.goals = []; // array of goals of form {x,y,w,h}\n\n // fixture definition for obstacles\n var fixDef = new phys.fixtureDef();\n fixDef.density = 20.0;\n fixDef.friction = 0.5;\n fixDef.restitution = 0.2; //bouncing value\n\n // body definition for obstacles\n var bodyDef = new phys.bodyDef();\n bodyDef.userData = 'obstacle';\n bodyDef.type = phys.body.b2_staticBody;\n\n //create ground obstacles\n fixDef.shape = new phys.polyShape();\n\n // create bottom wall\n phys.makeBox( this.world,\n 10, 20 - this.constants.obsThick,\n 10, this.constants.obsThick);\n\n // create top wall\n phys.makeBox( this.world,\n 10, this.constants.obsThick,\n 10, this.constants.obsThick);\n \n // create left wall\n phys.makeBox( this.world,\n this.constants.obsThick, 10,\n this.constants.obsThick, 10);\n\n // create right wall\n phys.makeBox( this.world,\n 20 - this.constants.obsThick, 10,\n this.constants.obsThick, 10);\n \n\n // create short middle wall\n phys.makeBox( this.world,\n 10, 10,\n 4, this.constants.obsThick);\n\n // create pyramid blocks \n for(i = 0; i < 6; ++i) {\n this.task.blocks.push( phys.makeBlock(this.world, 4.5 + 2*i, 15, 0.5, 0.5, 'workpiece') );\n }\n\n // create some robots\n var xoffset = 8;\n var yoffset = 4; \n for(i = 0; i < this.task.numRobots; ++i) {\n this.task.robots.push( phys.makeRobot( this.world,\n (i%4)*1.2 + xoffset,\n 1.2*Math.floor( i/4 ) + yoffset,\n 0.5,\n 'robot'));\n }\n\n // create goals\n var goalPositions = [ {x:10, y:8.2}, \n {x:9.5, y:9.2},\n {x:10.5,y:9.2} ];\n\n fixDef.isSensor = true;\n fixDef.shape = new phys.polyShape();\n fixDef.shape.SetAsBox(0.2, 0.2);\n bodyDef.type = phys.body.b2_dynamicBody;\n bodyDef.userData = 'goal';\n goalPositions.forEach( function (gp) {\n bodyDef.position.Set(gp.x,gp.y);\n var body = this.world.CreateBody(bodyDef);\n body.CreateFixture(fixDef);\n this.task.goals.push(body);\n }.bind(this));\n\n });\n\n game.setInitTaskCallback( function() {\n this.task.modes = ['attractive','repulsive','global'];\n this.task.mode = this.task.modes[ Math.ceil( Math.random() * this.task.modes.length ) - 1]; \n this.task.impulse = 50; // impulse to move robots by\n this.impulseV = new phys.vec2(0,0); // global impulse to control all robots\n this.mX = 0;\n this.mY = 0;\n \n this.controllerActive = false;\n\n $('.mode-button').prop('disabled',false);\n $('#button-'+this.task.mode).addClass('btn-success');\n this.task.modes.forEach( function (mode) {\n $('#button-' + mode).click(function() {\n this.task.mode = mode;\n $('.mode-button').removeClass('btn-success');\n $('#button-'+mode).addClass('btn-success');\n }.bind(this));\n }.bind(this)); \n });\n\n game.setPregameCallback( function() {\n $('.mode-button').prop('disabled',true);\n });\n\n game.setDrawCallback( function() {\n drawutils.clearCanvas();\n var angle;\n \n\n //initialize robots to not be at goal\n this.task.blocks.forEach( function(b) {\n b.atGoal = false;\n }.bind(this));\n\n // draw goal zone\n this.task.goals.forEach( function (g) { \n var f = g.GetFixtureList();\n var verts = f.GetShape().GetVertices();\n var X = verts[1].x - verts[0].x; \n var Y = verts[2].y - verts[1].y;\n var pos = g.GetPosition();\n drawutils.drawEmptyRect(30*pos.x, 30*pos.y, 30* X*2.2, 30 * Y*2.2, this.constants.colorGoal,0,this.constants.strokeWidth);\n this.task.blocks.forEach( function (b) {\n var blockAABB = b.GetFixtureList().GetAABB();\n if ( blockAABB.Contains( g.GetFixtureList().GetAABB()) ) {\n b.atGoal = true;\n }\n }.bind(this)); \n }.bind(this));\n \n //draw robots and obstacles\n for (var b = this.world.GetBodyList() ; b; b = b.GetNext()) {\n angle = b.GetAngle()*(180/Math.PI);\n var type = b.GetUserData();\n var pos = b.GetPosition();\n var X;\n var Y;\n var color;\n\n for(var f = b.GetFixtureList(); f; f = f.GetNext()) {\n if ( type === 'goal') {\n continue;\n }\n if ( type === 'robot') {\n // draw the robots\n var radius = f.GetShape().GetRadius();\n drawutils.drawRobot( 30*pos.x, 30*pos.y,angle, 30*radius, this.constants.colorRobot,this.constants.colorRobotEdge); \n if (this.task.mode === 'attractive' || this.task.mode === 'repulsive') {\n drawutils.drawLine([[30*(-0.2+pos.x), 30*pos.y],[30*(0.2+pos.x), 30*pos.y]],'darkblue',true,this.constants.strokeWidthThick); // minus\n }\n if (this.task.mode === 'repulsive' ) {\n drawutils.drawLine([[30*(pos.x), 30*(-0.2+pos.y)],[30*(pos.x), 30*(0.2+pos.y)]],'darkblue',true,this.constants.strokeWidthThick); //vertical\n }\n } else if ( type === 'workpiece') {\n // draw the object\n X = f.GetShape().GetVertices()[1].x - f.GetShape().GetVertices()[0].x; \n Y = f.GetShape().GetVertices()[2].y - f.GetShape().GetVertices()[1].y;\n color = this.constants.colorObject;\n if (b.atGoal === true) {\n color = this.constants.colorObjectAtGoal;\n }\n drawutils.drawRect(30*pos.x, 30*pos.y, 30*X, 30 * Y, color,angle,this.constants.colorObjectEdge,this.constants.strokeWidth);\n } else {\n // draw the obstacles\n X = f.GetShape().GetVertices()[1].x - f.GetShape().GetVertices()[0].x; \n Y = f.GetShape().GetVertices()[2].y - f.GetShape().GetVertices()[1].y;\n \n color = this.constants.colorGoal;\n if(b.GetUserData() === 'obstacle') {\n color = this.constants.colorObstacle;\n }\n drawutils.drawRect(30*pos.x, 30*pos.y, 30* X, 30 * Y, color);\n }\n }\n }\n\n /* draw controller feedback */\n if( this.task.mode === 'global') {\n //draw arrow\n var ArrX = [-1,-1,0.2,0.2,1,0.2,0.2,-1,-1];\n var ArrY = [0,1/4,1/4,1/2,0,-1/2,-1/4,-1/4,0];\n // Add the points from the array to the object\n angle = Math.atan2(this.mY - 10, this.mX-10);\n var pts = [];\n for (var p=0; p<ArrX.length; p+=1) {\n pts.push([30*(10+Math.cos(angle)*ArrX[p]-Math.sin(angle)*ArrY[p]),30*(10+Math.sin(angle)*ArrX[p]+Math.cos(angle)*ArrY[p])]);\n } \n drawutils.drawLine(pts,'rgba(0, 0, 153, 0.5)',true,18,false);\n } else {\n // draw controller position. James asked for this, but the lag behind the cursor position is very noticeable, so I commented it out.\n drawutils.drawLine([ [30*(-0.2+this.mX), 30*this.mY],[30*(0.2+this.mX), 30*this.mY]],'darkblue',true); // minus\n drawutils.drawLine([ [ 30*(this.mX), 30*(-0.2+this.mY)], [ 30*(this.mX), 30*(0.2+this.mY)] ],'darkblue',true); //vertical\n }\n });\n\n game.setOverviewCallback( function() {\n var color = 'white';\n var meanx = 0;\n var miny = Number.MAX_VALUE;\n var minx;\n var maxx = Number.MIN_VALUE;\n var meany = 0;\n // draw goal zone\n this.task.goals.forEach( function (g) { \n var pos = g.GetPosition();\n if( pos.x >maxx)\n {maxx = pos.x;}\n meanx = meanx + pos.x/this.task.goals.length;\n meany = meany + pos.y/this.task.goals.length; \n }.bind(this));\n color = this.constants.colorGoal;\n drawutils.drawText(30*(maxx+2),30*meany,'←Goals', 1.5, color, color);\n\n\n meanx = 0;\n miny = Number.MAX_VALUE;\n maxx = Number.MIN_VALUE;\n meany = 0;\n this.task.blocks.forEach( function (g) { \n var pos = g.GetPosition();\n if( pos.y < miny)\n {miny = pos.y;} \n meanx = meanx + pos.x/this.task.blocks.length;\n meany = meany + pos.y/this.task.blocks.length; \n }.bind(this));\n color = this.constants.colorObject;\n drawutils.drawText(30*(meanx),30*(miny-1),'Blocks', 1.5, color, color);\n\n if(this.mobileUserAgent) {\n drawutils.drawText(300,525,'Move Blocks to Goals with touchscreen', 1.5, color, color);\n } else {\n drawutils.drawText(300,525,'Move Blocks to Goals using your mouse', 1.5, color, color);\n }\n var strInstruction = '';\n var strControlMode = 'mouse click';\n if(this.mobileUserAgent) {\n strControlMode = 'your touch';\n }\n switch( this.task.mode ) {\n case 'attractive': strInstruction ='Robots are attracted to '+strControlMode; break;\n case 'repulsive' : strInstruction ='Robots are repulsed from '+strControlMode;break;\n case 'global' : strInstruction ='Robots move in direction of '+strControlMode;break;\n }\n drawutils.drawText(300,80,strInstruction, 1.5, color, color);\n drawutils.drawText(300,50,this.task.mode+' control:', 1.5, 'black', 'black');\n\n meanx = 0;\n miny = Number.MAX_VALUE;\n minx = Number.MAX_VALUE;\n meany = 0;\n for(var i = 0; i < this.task.robots.length; ++i) {\n var pos = this.task.robots[i].GetPosition();\n meanx = meanx + pos.x/this.task.numRobots;\n meany = meany + pos.y/this.task.numRobots;\n if( pos.y < miny)\n {miny = pos.y;}\n if( pos.x < minx)\n {minx = pos.x;}\n }\n color = this.constants.colorRobot;\n drawutils.drawText(30*(minx-2.3),30*(meany - 0.55),'Robots→', 1.5, color, color);\n });\n\n game.setUpdateCallback( function (dt, inputs) {\n URFP(dt);\n\n inputs.forEach( function( evt ) {\n switch (evt.type) {\n case 'mousedown': this.controllerActive = true; break;\n case 'mouseup' : this.controllerActive = false; break;\n case 'mousemove' : this.mX = evt.x;\n this.mY = evt.y;\n break;\n }\n }.bind(this));\n\n // apply the user force to all the robots \n if (this.controllerActive) {\n if (this.task.mode === 'global' ) {\n var angle = Math.atan2(this.mY - 10, this.mX-10);\n this.impulseV.x = 40* Math.cos(angle);\n this.impulseV.y = 40* Math.sin(angle);\n this.task.robots.forEach( function(r) { \n r.ApplyForce( this.impulseV, r.GetWorldPoint( this.constants.zeroRef ) );\n }.bind(this));\n } else {\n this.task.robots.forEach( function(r) { \n var rpos = r.GetPosition(); \n var dx = this.mX - rpos.x;\n var dy = this.mY - rpos.y;\n var distSq = dx*dx + dy*dy;\n var mag = Math.sqrt(distSq);\n var h2 = 4;\n var forceM = 100*distSq/Math.pow(distSq + h2,2);\n if (this.task.mode === 'repulsive') {\n this.impulseV.x = -20*dx/mag*forceM || 0;\n this.impulseV.y = -20*dy/mag*forceM || 0; \n } else {\n this.impulseV.x = 20*dx/mag*forceM || 0;\n this.impulseV.y = 20*dy/mag*forceM || 0;\n }\n r.ApplyForce( this.impulseV , r.GetWorldPoint( this.constants.zeroRef ) ); \n \n }.bind(this) ); \n } \n }\n });\n\n game.setWinTestCallback( function() { \n // need to check if object has been moved into the goal zone\n var blockupied = 0;\n // for each goal, see if it contains a block\n this.task.blocks.forEach( function (b) {\n var blockAABB = b.GetFixtureList().GetAABB();\n this.task.goals.every( function (g) {\n var ret = blockAABB.Contains( g.GetFixtureList().GetAABB() );\n if (ret) {\n blockupied++;\n }\n return !ret;\n }.bind(this));\n }.bind(this)); \n return blockupied === this.task.goals.length;\n });\n\n game.setLoseTestCallback( function() {\n // in this game, we can't lose--no time constraints or anything.\n return false;\n });\n\n game.setLostCallback( function() {\n // nothing to do on lose.\n });\n\n game.setWonCallback( function() {\n //congratulate\n drawutils.drawRect(300,300, 590,590, 'rgba(200, 200, 200, 0.5)');\n var color = 'green';\n drawutils.drawText(300,250, 'You finished in '+ (this._timeElapsed/1000).toFixed(2) +' seconds!', 2, color, color);\n drawutils.drawText(300,350, 'Loading results page...', 2, color, color);\n });\n\n game.setResultsCallback( function() {\n return {\n numRobots: this.task.numRobots,\n task: 'varying-control-scheme',\n mode: this.task.mode\n };\n });\n\n $(window).on('load', function () {\n game.init( $('#canvas') );\n game.run();\n });\n}", "attract(object){\n\t\tlet force = p5.Vector.sub(this.loc, object.loc);\n\t\tlet distance = force.mag();\n\t\tdistance = constrain(distance, 10, 30);\n\n\t\tforce.normalize();\n\t\tlet strength = (this.G*this.mass)/(distance*distance);\n\t\tforce.mult(strength);\n\t\tobject.applyForce(force);\n\t}", "function setup() {\n\tcreateCanvas(1300, 650);\n\n\t//creating the engine\n\tengine = Engine.create();\n\tworld = engine.world;\n\n\t//Create the Bodies Here.\n\tpaperBall = new Paper();\n\tground = new Ground();\n\tdustbin = new Dustbin(900,485,20,220);\n\tdustbin2 = new Dustbin(1010,585,200,20);\n\tdustbin3 = new Dustbin(1120,485,20,220);\n\n\t//running the engine\n\tEngine.run(engine);\n \n}", "recreatePhysicalShapes(component) {\n var entity = component.entity;\n var data = component.data;\n\n if (typeof Ammo !== 'undefined') {\n if (entity.trigger) {\n entity.trigger.destroy();\n delete entity.trigger;\n }\n\n if (data.shape) {\n if (component._compoundParent) {\n this.system._removeCompoundChild(component._compoundParent, data.shape);\n\n if (component._compoundParent.entity.rigidbody)\n component._compoundParent.entity.rigidbody.activate();\n }\n\n Ammo.destroy(data.shape);\n data.shape = null;\n }\n\n data.shape = this.createPhysicalShape(component.entity, data);\n\n var firstCompoundChild = ! component._compoundParent;\n\n if (data.type === 'compound' && (! component._compoundParent || component === component._compoundParent)) {\n component._compoundParent = component;\n\n entity.forEach(this._addEachDescendant, component);\n } else if (data.type !== 'compound') {\n if (component._compoundParent && component === component._compoundParent) {\n entity.forEach(this.system.implementations.compound._updateEachDescendant, component);\n }\n\n if (! component.rigidbody) {\n component._compoundParent = null;\n var parent = entity.parent;\n while (parent) {\n if (parent.collision && parent.collision.type === 'compound') {\n component._compoundParent = parent.collision;\n break;\n }\n parent = parent.parent;\n }\n }\n }\n\n if (component._compoundParent) {\n if (component !== component._compoundParent) {\n if (firstCompoundChild && component._compoundParent.shape.getNumChildShapes() === 0) {\n this.system.recreatePhysicalShapes(component._compoundParent);\n } else {\n this.system.updateCompoundChildTransform(entity);\n\n if (component._compoundParent.entity.rigidbody)\n component._compoundParent.entity.rigidbody.activate();\n }\n }\n }\n\n if (entity.rigidbody) {\n entity.rigidbody.disableSimulation();\n entity.rigidbody.createBody();\n\n if (entity.enabled && entity.rigidbody.enabled) {\n entity.rigidbody.enableSimulation();\n }\n } else if (! component._compoundParent) {\n if (! entity.trigger) {\n entity.trigger = new Trigger(this.system.app, component, data);\n } else {\n entity.trigger.initialize(data);\n }\n }\n }\n }", "setup() {\n this.createShapes();\n\n this.map = this.createMap();\n }", "function setup() {\n createCanvas(640, 800);\n // alignSlider = createSlider(0, 3, 1.5, 0.1);\n // cohesionSlider = createSlider(0, 3, 1.5, 0.1);\n // seperationSlider = createSlider(0, 3, 1.5, 0.1);\n // deadCount = 0;\n // surviveCount = 0;\n force = new Force();\n for (let i = 0; i < 100; i++){\n obstacles.push(new Obstacle(i));\n }\n\n for (let i = 0; i < 100; i++){\n particles.push(new Particle());\n }\n}", "function initializeForces() {\n // add forces and associate each with a name\n simulation\n .force(\"link\", d3.forceLink())\n .force(\"charge\", d3.forceManyBody())\n .force(\"collide\", d3.forceCollide())\n .force(\"center\", d3.forceCenter())\n .force(\"forceX\", d3.forceX())\n .force(\"forceY\", d3.forceY());\n // apply properties to each of the forces\n updateForces();\n}", "constructor( context, control_box ) // The scene begins by requesting the camera, shapes, and materials it will need.\r\n { super( context, control_box ); // First, include a couple other helpful components, including one that moves you around:\r\n if( !context.globals.has_controls ) \r\n context.register_scene_component( new Movement_Controls( context, control_box.parentElement.insertCell() ) ); \r\n\r\n // Define the global camera and projection matrices, which are stored in a scratchpad for globals. The projection is special \r\n // because it determines how depth is treated when projecting 3D points onto a plane. The function perspective() makes one.\r\n // Its input arguments are field of view, aspect ratio, and distances to the near plane and far plane.\r\n context.globals.graphics_state. camera_transform = Mat4.translation([ 0,0,-30 ]); // Locate the camera here (inverted matrix).\r\n context.globals.graphics_state.projection_transform = Mat4.perspective( Math.PI/4, context.width/context.height, .1, 1000 );\r\n \r\n const shapes = { 'triangle' : new Triangle(), // At the beginning of our program, load one of each of these shape \r\n 'strip' : new Square(), // definitions onto the GPU. NOTE: Only do this ONCE per shape\r\n 'bad_tetrahedron' : new Tetrahedron( false ), // design. Once you've told the GPU what the design of a cube is,\r\n 'tetrahedron' : new Tetrahedron( true ), // it would be redundant to tell it again. You should just re-use\r\n 'windmill' : new Windmill( 10 ), // the one called \"box\" more than once in display() to draw\r\n 'box' : new Cube(), // multiple cubes. Don't define more than one blueprint for the\r\n 'ball' : new Subdivision_Sphere( 4 ) }; // same thing here.\r\n this.submit_shapes( context, shapes );\r\n \r\n [ this.hover, this.t ] = [ false, 0 ]; // Define a couple of data members called \"hover\" and \"t\".\r\n \r\n // *** Materials: *** Define more data members here, returned from the material() function of our shader. Material objects contain\r\n // shader configurations. They are used to light and color each shape. Declare new materials as temps when\r\n // needed; they're just cheap wrappers for some numbers. 1st parameter: Color (4 floats in RGBA format).\r\n this.clay = context.get_instance( Phong_Shader ).material( Color.of( .9,.5,.9, 1 ), { ambient: .4, diffusivity: .4 } );\r\n this.plastic = this.clay.override({ specularity: .6 });\r\n this.glass = context.get_instance( Phong_Shader ).material( Color.of( .5,.5, 1,.2 ), { ambient: .4, specularity: .4 } );\r\n this.fire = context.get_instance( Funny_Shader ).material();\r\n this.stars = this.plastic.override({ texture: context.get_instance( \"assets/stars.png\" ) });\r\n\r\n // *** Lights: *** Values of vector or point lights. They'll be consulted by the shader when coloring shapes. Two different lights \r\n // *per shape* are supported by in the example shader; more requires changing a number in it or other tricks.\r\n // Arguments to construct a Light(): Light source position or vector (homogeneous coordinates), color, and intensity.\r\n this.lights = [ new Light( Vec.of( 30, 30, 34, 1 ), Color.of( 0, .4, 0, 1 ), 100000 ),\r\n new Light( Vec.of( -10, -20, -14, 0 ), Color.of( 1, 1, .3, 1 ), 100 ) ];\r\n }", "function setup(){\n\n // Creating the canvas\n var canvas = createCanvas(800,600);\n\n // Creating the engine\n engine = Engine.create();\n\n // Adding world to the engine\n world = engine.world;\n\n // Creating a canvas mouse\n var canvasmouse = Mouse.create(canvas.elt);\n\n // Changing the pixel ratio according to the density of the screen\n canvasmouse.pixelRatio = pixelDensity();\n\n // Adding canvas mouse to the mouse constraint\n var op = {\n Mouse: canvasmouse\n }\n\n // Creating the mouse constraint\n mConstraint = MouseConstraint.create(engine, op);\n\n // Adding it to the world\n World.add(world,mConstraint);\n \n // Creating a ground\n ground = new Ground(400,585,800,30);\n fill(\"purple\");\n\n // Adding ground to the world\n World.add(world,ground);\n\n // Creating an object that will keep track of the previous particle\n var prev = null;\n\n // Creating a chain at the left side\n for(x = 15; x > -570; x -= 40) {\n\n // Creating a variable fixed\n var fixed = false;\n\n // Making the fixed true if there is no previous particle\n if(!prev) {\n fixed = true;\n }\n\n // Creating a particle\n p = new SideChain(x,80,10,fixed);\n\n // Adding it to particles array\n particles.push(p);\n\n // Adding the particle to the world\n World.add(world,p);\n\n // Creating an invisible chain with the previous particle\n if(prev) {\n\n // Adding the properties to the chain with the help of a variable\n var options = {\n \n // Setting the chain start and end point\n bodyA: p.body,\n bodyB: prev.body,\n\n // Setting the length of the chain\n length: 20,\n\n // Setting the stiffness of the chain\n stiffness: 0.4\n }\n\n // Creating a constraint\n var constre = Constraint.create(options);\n\n // Adding the constraint to the world\n World.add(world,constre);\n }\n\n // Adding the particle to the previous\n prev = p;\n }\n\n // Creating another object that will keep track of the previous particle\n var prev1 = null;\n\n // Creating a chain on the right side\n for(i = 785; i < 1350; i = i + 40) {\n\n // Creating a fixed variable and giving it false value\n var fixed = false;\n\n // Giving fixed as true value when there is no previous particle\n if(!prev1) {\n fixed = true;\n }\n\n // Creating another particle\n p1 = new SideChain(i,80,10,fixed);\n\n // Adding it to particles array\n particles.push(p1);\n\n // Adding the particle to the world\n World.add(world,p1);\n\n // Creating an invisible chain with the previous particle\n if(prev1) {\n\n // Adding the properties to the particles\n var option = {\n\n // Setting the start and end position of the chain\n bodyA: p1.body,\n bodyB: prev1.body,\n\n // Setting the length of the chain\n length: 20,\n\n // Setting the stiffness of the chain\n stiffness: 0.4\n }\n\n // Creating a constraint\n var constra = Constraint.create(option);\n\n // Adding the constraint to the world\n World.add(world,constra);\n }\n\n // Adding the particle to the previous\n prev1 = p1;\n }\n\n // Displaying the wall's design\n var X=100;\n var Y=240;\n var Z=20;\n for(var i=1;i<=144;i++){\n if(i%16 == 0){\n\n var rectangle1 = new Rectangle1(X,Y,Z,Z);\n rectangle.push(rectangle1);\n X= 100;\n Y = Y + 40;\n }else{ \n var rectangle1 = new Rectangle1(X,Y,Z,Z);\n rectangle.push(rectangle1);\n X= X+40;\n }\n \n }\n\n // Creating the castlepillars\n castlepillar1 = new Castlepillar(55,320,50,500);\n castlepillar2 = new Castlepillar(745,320,50,500);\n\n // Creating a wall\n wall = new Wall(400,395,640,350);\n\n // Creatiing the gates\n gate1 = new Gate(350,470,100,200);\n gate2 = new Gate(450,470,100,200);\n\n var A=325;\n var B=400;\n var C=20;\n for(var a=1;a<=16;a++){\n if(a%4 == 0){\n\n var design1 = new Rectangle(A,B,C,C);\n design.push(design1);\n A= 325;\n B = B + 45;\n }else{ \n var design1 = new Rectangle(A,B,C,C);\n design.push(design1);\n A= A+50;\n }\n \n }\n\n var D=100;\n var E=180;\n var F=40;\n var G = 80;\n for(var b=1;b<=16;b++){\n if(b%2 == 0){\n\n var part1 = new Rectangle2(D,E,F,G);\n part.push(part1);\n D = D + 40;\n E = E + 20;\n G = G - 40;\n }else{ \n var part1 = new Rectangle2(D,E,F,G);\n part.push(part1);\n D = D + 40;\n E = E - 20;\n G = G + 40;\n }\n \n }\n}" ]
[ "0.5898804", "0.5898804", "0.56797415", "0.56433815", "0.56433815", "0.55750424", "0.55658066", "0.55527043", "0.5542595", "0.5527983", "0.5494414", "0.5457887", "0.5451798", "0.54494", "0.544439", "0.5435168", "0.5391977", "0.53888464", "0.53877306", "0.53496283", "0.5348187", "0.53236717", "0.5322095", "0.5310122", "0.5302516", "0.53003716", "0.5284824", "0.5277672", "0.52769136", "0.52653885", "0.5257429", "0.52449685", "0.52421814", "0.5235517", "0.52280205", "0.5227532", "0.5207748", "0.51993847", "0.5198912", "0.51952064", "0.51737475", "0.5168462", "0.5164007", "0.51572746", "0.5154038", "0.51505387", "0.51464766", "0.5146037", "0.513313", "0.51234555", "0.5115765", "0.51134515", "0.5111711", "0.5105555", "0.51004016", "0.50935304", "0.50883776", "0.5087709", "0.5082361", "0.5077571", "0.50747997", "0.507292", "0.50609297", "0.5057448", "0.5056186", "0.5055561", "0.50473064", "0.50467336", "0.50465024", "0.50454414", "0.5043995", "0.5042056", "0.50410384", "0.50397056", "0.5036924", "0.5025784", "0.5022988", "0.5017532", "0.50160575", "0.5015835", "0.5013396", "0.5013041", "0.5012195", "0.50113225", "0.5011235", "0.5008127", "0.50042754", "0.5003884", "0.50019515", "0.49971715", "0.4993025", "0.49929187", "0.49908757", "0.49903917", "0.4989353", "0.49804747", "0.4979581", "0.49786225", "0.49776793", "0.49773285", "0.4976287" ]
0.0
-1
================ UTILITY FUNCTIONS ====================
function getTouchDistance(){ const ballPos = ball.body.position; return getDistance(touchX, touchY, ballPos.x, ballPos.y); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "static private internal function m121() {}", "transient private protected internal function m182() {}", "static final private internal function m106() {}", "transient protected internal function m189() {}", "transient private internal function m185() {}", "function Utils() {}", "function Utils() {}", "function Util() {}", "static private protected internal function m118() {}", "function DWRUtil() { }", "transient final protected internal function m174() {}", "function AeUtil() {}", "static transient final private internal function m43() {}", "function _____SHARED_functions_____(){}", "function Utils(){}", "static transient private protected internal function m55() {}", "transient private protected public internal function m181() {}", "static transient final protected internal function m47() {}", "static protected internal function m125() {}", "function FunctionUtils() {}", "static transient final protected public internal function m46() {}", "static transient private internal function m58() {}", "function __it() {}", "transient final private protected internal function m167() {}", "static transient final private protected internal function m40() {}", "transient final private internal function m170() {}", "static final private protected internal function m103() {}", "function TMP(){return;}", "function TMP(){return;}", "static transient private protected public internal function m54() {}", "static private protected public internal function m117() {}", "static final private protected public internal function m102() {}", "function Helper() {}", "static final protected internal function m110() {}", "function Utils() {\n}", "function StupidBug() {}", "transient private public function m183() {}", "static transient private public function m56() {}", "obtain(){}", "function CCUtility() {}", "static final private public function m104() {}", "function miFuncion (){}", "function TMP(){}", "function TMP(){}", "function TMP() {\n return;\n }", "static private public function m119() {}", "static transient final protected function m44() {}", "function SigV4Utils() { }", "expected( _utils ) {\n\t\t\treturn 'nothing';\n\t\t}", "transient final private protected public internal function m166() {}", "function Hx(a){return a&&a.ic?a.Mb():a}", "static transient final private protected public internal function m39() {}", "function Kutility() {\n\n}", "function Kutility() {\n\n}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "function dummy(){}", "function dummy(){}", "function dummy(){}", "function i(e,t){return t}", "function l(){t={},u=\"\",w=\"\"}", "function __func(){}", "function oi(){}", "function Constr() {}", "function ea(){}", "__previnit(){}", "_read () {}", "_read () {}", "_read () {}", "static transient protected internal function m62() {}", "function GraFlicUtil(paramz){\n\t\n}", "prepare() {}", "function ba(){}", "function ba(){}", "function ba(){}", "function ba(){}", "function tempConvert(){\n \n}", "function ArrayUtils() {}", "static transient final private public function m41() {}", "function gatherStrings(obj) {\n\n}", "function AppUtils() {}", "_read() {}", "_read() {}", "static transient final private protected public function m38() {}" ]
[ "0.6754465", "0.65777403", "0.64131147", "0.6255865", "0.60716826", "0.606176", "0.6018082", "0.5905508", "0.5823355", "0.5823355", "0.5818964", "0.57699364", "0.57612514", "0.5709106", "0.5706893", "0.56966954", "0.56754845", "0.563252", "0.56275195", "0.55836457", "0.5547511", "0.55335695", "0.54951787", "0.54700065", "0.54208064", "0.53770965", "0.5365037", "0.535764", "0.53387517", "0.53256613", "0.53053707", "0.53053707", "0.5302062", "0.52652526", "0.52197045", "0.5210634", "0.5206566", "0.51878995", "0.5178838", "0.51704556", "0.5168012", "0.5142874", "0.5140407", "0.5136813", "0.51217633", "0.51007426", "0.51007426", "0.5077697", "0.5046709", "0.50448656", "0.503724", "0.5021705", "0.49916238", "0.49801862", "0.49783888", "0.49776366", "0.49776366", "0.49552867", "0.49552867", "0.49552867", "0.49552867", "0.49552867", "0.49552867", "0.49552867", "0.49552867", "0.49552867", "0.49552867", "0.49552867", "0.49552867", "0.49552867", "0.49497634", "0.49497634", "0.49497634", "0.49470675", "0.49470675", "0.49470675", "0.49451777", "0.49444994", "0.4941405", "0.49404556", "0.4932079", "0.4931826", "0.49309593", "0.49112275", "0.49112275", "0.49112275", "0.4909612", "0.4903761", "0.48933858", "0.4874208", "0.4874208", "0.4874208", "0.4874208", "0.48691493", "0.48607844", "0.48581374", "0.4856943", "0.48450643", "0.48385128", "0.48385128", "0.4833646" ]
0.0
-1
internal = recurse the window menu and extract all 'accelerator' values with reserved=true
function extractKeybindings (menuNode) { if (menuNode.accelerator && menuNode.click && menuNode.reserved) { return { binding: convertAcceleratorToBinding(menuNode.accelerator), cmd: menuNode.click } } else if (menuNode.submenu) { return menuNode.submenu.map(extractKeybindings).filter(Boolean) } else if (Array.isArray(menuNode)) { return _flattenDeep(menuNode.map(extractKeybindings).filter(Boolean)) } return null }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function m_tt_Mkm_CmdEnum()\n{\n\tvar n = 0;\n\tfor(var i in config_menu)\n\t\teval(\"window.\" + i.toString().toUpperCase() + \" = \" + n++);\n\tm_tt_aV.length = n;\n}", "initHotkeys() {\n const PREFIX = \"alt+shift+\";\n const keys = Hotkey.getKeys();\n const rkeys = keys.filter(k => k.indexOf(PREFIX) !== -1);\n\n rkeys.forEach(k => Hotkey.removeKey(k));\n\n self.sortedRegions.forEach((r, n) => {\n Hotkey.addKey(PREFIX + (n + 1), function() {\n self.unselectAll();\n r.selectRegion();\n });\n });\n\n // this is added just for the reference to show up in the\n // settings page\n Hotkey.addKey(\"alt+shift+$n\", () => {}, \"Select a region\");\n }", "function ActiveX_WMI_ConvertObjToMenuItems(dictObjects,callbackAssocs)\n{\n\tvar numObj = Object.keys(dictObjects).length;\n\tconsole.log(\"numObj=\"+numObj);\n\tif( numObj == 0 ) {\n\t\treturn [];\n\t}\n\n\t// For each object found in a WMI table.\n\tfunction ObjDictToItem(objDict) {\n\t\tvar objItem = {};\n\n\t\tobjItem[\"assocs\"] = {\n\t\t\t\t\tname: \"Associators...\",\n\t\t\t\t\tcallback: callbackAssocs\n\t\t\t\t};\n\t\tobjItem[\"sep3\"] = \"-------\";\n\n\t\tfor (var propKey in objDict) {\n\t\t\tif (objDict.hasOwnProperty(propKey) ) {\n\t\t\t\tvar propVal = objDict[propKey];\n\t\t\t\tpropName = propKey + \"=\" + propVal\n\t\t\t\t// console.log(\"propName=\"+propName);\n\n\t\t\t\t// TODO: Why this icon ??\n\t\t\t\tvar subSubObj = { \"name\": propName, \"icon\" : \"edit\"}\n\n\t\t\t\tobjItem[propKey] = subSubObj;\n\t\t\t}\n\t\t}\n\t\treturn objItem;\n\t} // ObjDictToItem\n\n\t// There should normally be one object only.\n\tmenusActiveX = {};\n\tfor (var objKey in dictObjects) {\n\t\tif (dictObjects.hasOwnProperty(objKey) ) {\n\t\t\tvar objVal = dictObjects[objKey];\n\n\t\t\tvar objSubItems = ObjDictToItem(objVal);\n\n\t\t\tvar objItem = {\"name\": objKey, \"items\": objSubItems};\n\n\t\t\tmenusActiveX[objKey] = objItem;\n\t\t}\n\t}\n\n\treturn menusActiveX;\n}", "function createMenuItems() {\n var menuArray = [];\n // Create the menu entry for searching with all engines\n if (preferences['showAll']) {\n menuArray.push(contextMenu.Item({\n label: 'All Engines',\n data: '-all'\n }));\n menuArray.push(contextMenu.Separator());\n }\n engines.forEach(function (engine) {\n if (preferences[engine.prefName]) {\n menuArray.push(contextMenu.Item({\n label: engine.name,\n data: engine.url,\n image: engine.icon\n }));\n }\n });\n return menuArray;\n}", "function menu_menu_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }", "function ActiveX_WMI_JContextMenu(objUrl,objectSvg,funcD3Displayer)\n{\n\t// IE and Windows only.\n\tif( ! isIEorEDGE())\n\t{\n\t\t// console.log(\"ActiveX_WMI_JContextMenu Not IE\");\n\t\treturn {};\n\t}\n\t// console.log(\"ActiveX_WMI_Data IE\");\n\n\tconsole.log(\"ActiveX_WMI_JContextMenu objUrl=\"+objUrl);\n\n\tvar remoteXid = SplitRemoteXid(objUrl);\n\tif( remoteXid == null)\n\t{\n\t\treturn {};\n\t}\n\n\tvar wqlQuerySelect = UrlToWQL(remoteXid.m_class,remoteXid.m_dict_properties);\n\tconsole.log(\"ActiveX_WMI_JContextMenu wqlQuerySelect=\"+wqlQuerySelect);\n\n\t// TODO: This can return associators for one object only ??\n\tvar wqlQueryAssociators = UrlToAssociatorsWQL(remoteXid.m_class,remoteXid.m_dict_properties);\n\tconsole.log(\"ActiveX_WMI_JContextMenu wqlQueryAssociators=\"+wqlQueryAssociators);\n\n\tvar TheFullSubItems = {};\n\n\tvar svcWbemObject = ConnectWbemServer(remoteXid.m_remote_machine,remoteXid.m_class,remoteXid.m_dict_properties);\n\ttry {\n\t\tsvcWbem = svcWbemObject.m_funcLocat();\n\n\t\tvar dictObjects = ActiveX_WMI_Data(svcWbem,wqlQuerySelect);\n\n\t\tvar callbackAssocs = CallbackAssociatorsWMI(svcWbem,wqlQueryAssociators,objectSvg,funcD3Displayer);\n\n\t\tvar TheItemsSuiteActiveXSubItems = ActiveX_WMI_ConvertObjToMenuItems(dictObjects,callbackAssocs);\n\n\t\tjQuery.extend(TheFullSubItems,TheItemsSuiteActiveXSubItems);\n\n\t\t// TODO: BEWARE: One object only ??\n\t\tvar funcAssociators = function(options,key) {\n\t\t\talert(\"AssocKey=\"+key);\n\t\t\t};\n\t}\n\tcatch(excep)\n\t{\n\t\t// Cannot connect.\n\t\tconsole.log(\"ActiveX_WMI_JContextMenu caught:\" + excep);\n\t}\n\n\n\t// if( remoteXid.m_remote_machine != \"\" )\n\t/* Only if CIM_ComputerSystem, or if this xid indicates a remote machine,\n\t then asks for username and password.*/\n\tif( typeof svcWbemObject.m_hostLocat != \".\")\n\t{\n\t\tconsole.log(\"Editing username and password for m_hostLocat=\"+svcWbemObject.m_hostLocat);\n\t\t// To fill input commands with values from a map:\n\t\t// $.contextMenu.getInputValues(options, {remote_user: \"foo\", remote_pass: \"bar\"});\n\n\n\t\t// $.contextMenu.xyz InputValues(options, $this.data());\n\n\n\t\tvar TheItemsUserPassSub = {\n\t\t\t\"remote_user\": {\n\t\t\t\tname: \"Username\",\n\t\t\t\ttype: 'text',\n\t\t\t\tvalue: \"\"\n\t\t\t},\n\t\t\t\"remote_pass\": {\n\t\t\t\tname: \"Password\",\n\t\t\t\ttype: 'text',\n\t\t\t\tvalue: \"\"\n\t\t\t},\n\t\t\t\"submit\": {\n\t\t\t\tname: \"Enter\",\n\t\t\t\tcallback: function(key, options) {\n\t\t\t\t\t\t/* The runtime options are passed to most callbacks on registration. giving\n\t\t\t\t\t\tthe ability to access DOM elements and configuration dynamically.\n\t\t\t\t\t\tOne way of using these in in the general callback when an item is clicked.\n\t\t\t\t\t\tExample:\n\t\t\t\t\t\tcallback: function(itemKey, opt){\n\t\t\t\t\t\t\t// Alert the classes on the item that was clicked.\n\t\t\t\t\t\t\talert(opt.$node.attr('class'));\n\t\t\t\t\t\t\t// Alert \"welcome!\"\n\t\t\t\t\t\t\talert(opt.inputs[itemsKey].$input.val());\n\t\t\t\t\t\t}\n\t\t\t\t\t\t*/\n\t\t\t\t\t\tconsole.log(\"key=\"+key);\n\t\t\t\t\t\tvar $this = this;\n\n\t\t\t\t\t\t/* \"getInputValues(opt, $this.data());\" saves values from input commands to data-attributes,\n\t\t\t\t\t\tbut this is not what we want. Rather, this fetches values from input commands: */\n\n\t\t\t\t\t\t//var inpValues = $.contextMenu.setInputValues(options);\n\t\t\t\t\t\t//console.log(\"inpValues=\"+inpValues);\n\n\t\t\t\t\t\t$.contextMenu.getInputValues(options, this.data());\n\t\t\t\t\t\tconsole.log(\"this.data()=\"+ObjectToString(this.data()));\n\t\t\t\t\t\tvar remUser = this.data().remote_user;\n\t\t\t\t\t\tvar remPass = this.data().remote_pass;\n\n\t\t\t\t\t\tglobalCredentials[svcWbemObject.m_hostLocat] = {\n\t\t\t\t\t\t\t\"stored_remote_user\" : remUser,\n\t\t\t\t\t\t\t\"stored_remote_pass\" : remPass,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tconsole.log(\"globalCredentials=\"+ObjectToString(globalCredentials));\n\n\t\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tvar TheItemsUserPass =\n\t\t{\n\t\t\t\"ActiveXObjectWMI\": {\n\t\t\t\t\"name\": \"ActiveX Authentication\",\n\t\t\t\t\"items\": TheItemsUserPassSub\n\t\t\t}\n\t\t};\n\t\tjQuery.extend(TheFullSubItems,TheItemsUserPass);\n }\n\n\tvar TheItemsSuiteActiveX =\n\t{\n\t\t\"ActiveXObjectWMI\": {\n\t\t\t\"name\": \"ActiveX WMI\",\n\t\t\t\"items\": TheFullSubItems\n\t\t}\n\t};\n\n\treturn TheItemsSuiteActiveX;\n} // ActiveX_WMI_JContextMenu", "function f_set_menubar()\r\n{\r\n var retval = // # English # German\r\n [\r\n [\r\n [\"elem_menu\" ,\"Element\" ,\"Element\" ], \r\n [ \"input_item\" ,\"New (Alt-N)\" ,\"Neu (Alt-N)\" ],\r\n [ \"change_item\" ,\"Change (F2)\" ,\"&Auml;ndern (F2)\" ],\r\n [ \"delete_item\" ,\"Delete (Del)\" ,\"L&ouml;schen (Entf)\" ],\r\n [ \"copy_item\" ,\"Copy by Ref (Ctrl-L)\" ,\"Link Kopieren (Strg-L)\" ],\r\n [ \"clone_item\" ,\"Clone (Ctrl-C)\" ,\"Vollst. Kopieren (Strg-C)\" ],\r\n [ \"cut_item\" ,\"Cut (Ctrl-X)\" ,\"Ausschn. (Strg-X)\" ],\r\n [ \"paste_item\" ,\"Paste (Ctrl-V)\" ,\"Einf&uumlgen (Strg-V)\" ],\r\n [ \"export_item\" ,\"Export (Ctrl-Shift-Alt-E)\" ,\"Exportieren (Strg-Shift-Alt-E)\" ],\r\n [ \"do_nothing\" ,\"--------------------\" ,\"--------------------\" ],\r\n [ \"lock_topic\" ,\"Lock (Ctrl-Shift-Alt-L)\" ,\"Festhalten (Strg-Shift-Alt-L)\" ],\r\n [ \"as_news\" ,\"as News Ticker\" ,\"als Nachr.-Ticker\" ],\r\n [ \"as_date\" ,\"as Date Ticker\" ,\"als Termine-Ticker\" ] \r\n ],\r\n \r\n c_LANG_LIB_TREE_ELEMTYPE\r\n ,\r\n [\r\n [\"fav_menu\" ,\"Favorites\" ,\"Favoriten\" ],\r\n [ \"save_favorite\" ,\"Save\" ,\"Speichern\" ],\r\n [ \"load_favorite\" ,\"Load\" ,\"Laden\" ],\r\n [ \"delete_favorite\" ,\"Delete Single\" ,\"Einzeln L&ouml;schen\" ],\r\n [ \"deleteall_favorites\" ,\"Delete All\" ,\"Alle L&ouml;schen\" ] \r\n ], \r\n [\r\n [\"setup_menu\" ,\"Setup\" ,\"Einstellungen\" ],\r\n [ \r\n [\"lang_menu\" ,\"Language\" ,\"Sprache\" ],\r\n ( [\"#output_list\", \"language_select\"]).concat(c_LANG.slice(1,c_LANG.length)) \r\n ] , \r\n [ \r\n [\"db_type\" ,\"Database Type\" ,\"Datenbank-Typ\" ],\r\n [\"#output_list\" ,\"db_type\", \"XML\", \"SQL-Based\"] // \"XML Localhost\", \"XML WWW\", \"SQL-Based WWW\"]\r\n // [\"xml_local\" ,\"XML Localhost\" ,\"XML Localhost\" ],\r\n // [\"xml_web\" ,\"XML on WWW\" ,\"XML im WWW\" ],\r\n // [\"disco_web\" ,\"DISCO on WWW\" ,\"DISCO\" ]\r\n \r\n ] ,\r\n // [\r\n // [\"setup_path_menu\" ,\"Setup Path\" ,\"Pfad zu Einstellungen\" ],\r\n // [\r\n // [\"setup_path_type\" ,\"Type of Source\" ,\"Quellentyp\" ],\r\n // [\"#output_list\" ,\"setup_src_type\", \"RAM\", \"Cookie\", \"DISCO!\", \"XML\"]\r\n // ],\r\n // [\r\n // [\"setup_path_url\" ,\"Path/URL\" ,\"Pfad/URL\" ],\r\n // [\"#input_field\" ,\"setup_src_path\"]\r\n // ]\r\n // ]\r\n [\r\n [\"disp_type\" ,\"Display Type\" ,\"Darstellung\" ],\r\n [\"#output_list\" ,\"disp_type\", \"Tree\", \"Bubbles\"]\r\n // [\"disp_tree\" ,\"Tree ()\" ,\"Baum ()\" ],\r\n // [\"disp_bubbles\" ,\"Bubbles ()\" ,\"Kugeln ()\" ]\r\n ] ,\r\n [\r\n [\"other_setups\" ,\"Other Setups\" ,\"Andere Einstellg.\" ], \r\n [\"#output_list\" ,\"aux_setups\", \"Config Subtree\"] \r\n ],\r\n [\r\n [\"permissions\" ,\"Permissions\" ,\"Zugriffsrechte\" ],\r\n [\"#output_list\" ,\"change\", \"change=\"+String(1-uc_browsing_change_permission)]\r\n ]\r\n ], \r\n [ \r\n // Menu Title \r\n [\"help_menu\" ,\"Help\" ,\"Hilfe\" ],\r\n // [ \"tutorial\" ,\"Tutorial\" ,\"Tutorial\" ],\r\n [ \"erase_cookies\" ,\"Clear Cookies\" ,\"Cookies löschen\" ],\r\n [ \"send_err_log\" ,\"Send Error Log\" ,\"Fehlerbericht senden\" ],\r\n [ \"display_hint\" ,\"Hints\" ,\"Tips\" ],\r\n [ \"source_code\" ,\"Source Code\" ,\"Quellcode\" ],\r\n [ \"display_version\" ,\"Current Version\" ,\"Aktuelle Version\" ]\r\n ]\r\n \r\n ];\r\n\r\n return retval; \r\n}", "function contextMenu(browserWindow){\n cm({\n browserWindow,\n \n prepend: (params) => [\n {\n role: 'reload',\n enabled: params.isEditable === false,\n visible: params.isEditable === false\n },\n {\n role: 'undo',\n enabled: params.isEditable && params.editFlags.canUndu,\n visible: params.isEditable\n },\n {\n role: 'redo',\n enabled: params.isEditable && params.editFlags.canRedo,\n visible: params.isEditable\n }\n ],\n append: (params) => [\n {\n role: 'delete',\n enabled: params.isEditable && params.editFlags.canDelete,\n visible: params.isEditable\n },\n {\n role: 'selectall',\n enabled: params.isEditable && params.editFlags.canSelectAll,\n visible: params.isEditable\n }\n ],\n\n showInspectElement: false\n });\n}", "function getHotKey(){\n\t\t\t\n\t\t}", "updateKeybList() {\n let modWinLin = \"Alt\";\n let modMac = \"Opt\";\n if (this.app.options.useMetaKey) {\n modWinLin = \"Win\";\n modMac = \"Cmd\";\n }\n document.getElementById(\"keybList\").innerHTML = `\n <tr>\n <th>Command</th>\n <th>Shortcut (Win/Linux)</th>\n <th>Shortcut (Mac)</th>\n </tr>\n <tr>\n <td>Activate contextual help</td>\n <td>F1</td>\n <td>F1</td>\n </tr>\n <tr>\n <td>Place cursor in search field</td>\n <td>Ctrl+${modWinLin}+f</td>\n <td>Ctrl+${modMac}+f</td>\n <tr>\n <td>Place cursor in input box</td>\n <td>Ctrl+${modWinLin}+i</td>\n <td>Ctrl+${modMac}+i</td>\n </tr>\n <tr>\n <td>Place cursor in output box</td>\n <td>Ctrl+${modWinLin}+o</td>\n <td>Ctrl+${modMac}+o</td>\n </tr>\n <tr>\n <td>Place cursor in first argument field of the next operation in the recipe</td>\n <td>Ctrl+${modWinLin}+.</td>\n <td>Ctrl+${modMac}+.</td>\n </tr>\n <tr>\n <td>Place cursor in first argument field of the nth operation in the recipe</td>\n <td>Ctrl+${modWinLin}+[1-9]</td>\n <td>Ctrl+${modMac}+[1-9]</td>\n </tr>\n <tr>\n <td>Disable current operation</td>\n <td>Ctrl+${modWinLin}+d</td>\n <td>Ctrl+${modMac}+d</td>\n </tr>\n <tr>\n <td>Set/clear breakpoint</td>\n <td>Ctrl+${modWinLin}+b</td>\n <td>Ctrl+${modMac}+b</td>\n </tr>\n <tr>\n <td>Bake</td>\n <td>Ctrl+${modWinLin}+Space</td>\n <td>Ctrl+${modMac}+Space</td>\n </tr>\n <tr>\n <td>Step</td>\n <td>Ctrl+${modWinLin}+'</td>\n <td>Ctrl+${modMac}+'</td>\n </tr>\n <tr>\n <td>Clear recipe</td>\n <td>Ctrl+${modWinLin}+c</td>\n <td>Ctrl+${modMac}+c</td>\n </tr>\n <tr>\n <td>Save to file</td>\n <td>Ctrl+${modWinLin}+s</td>\n <td>Ctrl+${modMac}+s</td>\n </tr>\n <tr>\n <td>Load recipe</td>\n <td>Ctrl+${modWinLin}+l</td>\n <td>Ctrl+${modMac}+l</td>\n </tr>\n <tr>\n <td>Move output to input</td>\n <td>Ctrl+${modWinLin}+m</td>\n <td>Ctrl+${modMac}+m</td>\n </tr>\n <tr>\n <td>Create a new tab</td>\n <td>Ctrl+${modWinLin}+t</td>\n <td>Ctrl+${modMac}+t</td>\n </tr>\n <tr>\n <td>Close the current tab</td>\n <td>Ctrl+${modWinLin}+w</td>\n <td>Ctrl+${modMac}+w</td>\n </tr>\n <tr>\n <td>Go to next tab</td>\n <td>Ctrl+${modWinLin}+RightArrow</td>\n <td>Ctrl+${modMac}+RightArrow</td>\n </tr>\n <tr>\n <td>Go to previous tab</td>\n <td>Ctrl+${modWinLin}+LeftArrow</td>\n <td>Ctrl+${modMac}+LeftArrow</td>\n </tr>\n `;\n }", "function getKeyCombo(event){\r\n\t\t\t\tvar arr = [], keycode = event.keyCode,\r\n\t\t\t\t\t// determines if keyCode is valid\r\n\t\t\t\t\t// non-control character\r\n\t\t\t\t\tvalid;\r\n\r\n\t\t\t\t// first element should be the modifiers\r\n\t\t\t\tif(event.shiftKey) arr.push(\"shiftKey\");\r\n\t\t\t\telse if(event.ctrlKey) arr.push(\"ctrlKey\");\r\n\t\t\t\telse if(event.altKey) arr.push(\"altKey\");\r\n\t\t\t\telse if(event.metaKey) arr.push(\"metaKey\");\r\n\r\n\t\t\t\t// below code from\r\n\t\t\t\t// http://stackoverflow.com/questions/12467240/determine-if-javascript-e-keycode-is-a-printable-non-control-character\r\n\t\t\t\t// http://stackoverflow.com/users/1585400/shmiddty\r\n\r\n\t\t\t\t// determine if key is non-control key\r\n\t\t\t\tvalid =\r\n\t\t\t\t\t(keycode > 47 && keycode < 58) || // number keys\r\n\t\t\t\t\tkeycode == 32 || keycode == 13 || // spacebar & return key(s)\r\n\t\t\t\t\t(keycode > 64 && keycode < 91) || // letter keys\r\n\t\t\t\t\t(keycode > 95 && keycode < 112) || // numpad keys\r\n\t\t\t\t\t(keycode > 185 && keycode < 193) || // ;=,-./` (in order)\r\n\t\t\t\t\t(keycode > 218 && keycode < 223); // [\\]' (in order)\r\n\r\n\t\t\t\tif(valid)\r\n\t\t\t\t\t// then push the key also\r\n\t\t\t\t\tarr.push(keycode);\r\n\r\n\t\t\t\treturn valid ? arr : null;\r\n\t\t\t}", "registerWindowCallback(menu, name, character, function_name){\n menu.submenu.push(\n {\n label:name,\n accelerator: process.platform == 'darwin' ? 'Command+'+character : 'Ctrl+'+character,\n mainWindow_dot:function_name\n }\n );\n }", "function m_tt_Extm_CmdEnum()\n{\n\tvar s;\n\n\t// Add new command(s) to the commands enum\n\tfor(var i in config_menu)\n\t{\n\t\ts = \"window.\" + i.toString().toUpperCase();\n\t\tif(eval(\"typeof(\" + s + \") == m_tt_u\"))\n\t\t{\n\t\t\teval(s + \" = \" + m_tt_aV.length);\n\t\t\tm_tt_aV[m_tt_aV.length] = null;\n\t\t}\n\t}\n}", "function initAccelKey()\n{\n validModifiers.ACCEL = \"control\";\n try\n {\n let accelKey = Services.prefs.getIntPref(\"ui.key.accelKey\");\n if (accelKey == Ci.nsIDOMKeyEvent.DOM_VK_CONTROL)\n validModifiers.ACCEL = \"control\";\n else if (accelKey == Ci.nsIDOMKeyEvent.DOM_VK_ALT)\n validModifiers.ACCEL = \"alt\";\n else if (accelKey == Ci.nsIDOMKeyEvent.DOM_VK_META)\n validModifiers.ACCEL = \"meta\";\n }\n catch(e)\n {\n Cu.reportError(e);\n }\n}", "function nocontextmenu() {\n\t\t\t\ttry {\n\t\t\t\t\tevent.cancelBubble = true;\n\t\t\t\t\tevent.returnValue = false;\n\t\t\t\t\treturn false;\n\t\t\t\t} catch (err) {\n\t\t\t\t\tiLog(\"nocontextmenu\", err, Log.Type.Error);\n\t\t\t\t}\n\t\t\t}", "getShortcutKeys() {\n return store.getState().shortcuts;\n }", "function populateAccessCommands()\n{\t\n\tif($.browser.safari || $.browser.webkit)\n\t{\n\t\t//$('#browserText').html('Press \"Ctrl\"+\"Alt\" (or \"Ctrl\"+\"Option\" if on MacOS) + [shortcut key] to activate an action from keyboard.');\n\t\t$('#browserText').html('To activate a command from keyboard, press - \"Ctrl\"+\"Alt\"(or Option)+[keyboard shortcut below]');\n\t}\n\telse if($.browser.mozilla)\n\t{\n\t\t$('#browserText').html('Press \"Alt\"+\"Shift\"+ (or \"Ctrl\" if on MacOS)+[shortcut key] to activate an action from keyboard.');\n\t}\n\t\n \t$('.quickAccess').each(function(){\n\n \t\t\tif($('#keyboardShortcuts td:contains('+$(this).html()+')').length)\n \t\t\t{\n\n \t\t\t\t$('#keyboardShortcuts td:contains('+$(this).html()+')').next().children('.command').html($(this).attr('accesskey'));\n \t\t\t}\n \t\t\telse\n \t\t\t{\n\t \t\t$('#keyboardShortcuts').find('.last').find('.function').html($(this).html());\n\t \t\t$('#keyboardShortcuts').find('.last').find('.command').html($(this).attr('accesskey'));\n\t \t\t$('#keyboardShortcuts').find('.last').removeClass('last').closest('tbody').append('<tr class=\"last\"> <td><div class=\"function\"></div></td> <td><div class=\"command\"></div></td></tr>');\n\t \t}\n \t\t\n \t});\n}", "function awmBuildMenu(){\r\nif (awmSupported){\r\nawmImagesColl=[\"historico_nomina.png\",42,40,\"definicion.png\",31,22,\"main-button-tile.gif\",17,34,\"indicator.gif\",16,8,\"main-item-left-float.png\",17,24,\"main-itemOver-left-float.png\",15,24,\"reportes.png\",31,22,\"mantenimiento.png\",31,22,\"retorno.png\",31,22];\r\nawmCreateCSS(1,2,1,'#FFFFFF',n,n,'14px sans-serif',n,'none','0','#000000','0px 0px 0px 0',0);\r\nawmCreateCSS(0,2,1,'#FFFFFF',n,n,'14px sans-serif',n,'none','0','#000000','0px 0px 0px 0',0);\r\nawmCreateCSS(0,1,0,n,'#1803FB',n,n,n,'solid','1','#A7AFBC',0,0); /* 1803FB Azul FF0000 Rojo*/\r\nawmCreateCSS(1,2,1,'#4A4A4A',n,2,'12px Segoe UI, Tahoma, Verdana',n,'none','0','#000000','0px 20px 0px 20',1);\r\nawmCreateCSS(0,2,1,'#4A4A4A','#E8EBF1',n,'bold 12px Segoe UI, Tahoma, Verdana',n,'none','0','#000000','0px 20px 0px 20',1);\r\nawmCreateCSS(0,1,0,n,'#A7AFBC',n,n,n,'solid','1','#A7AFBC',0,0);\r\nawmCreateCSS(1,2,0,'#4A4A4A','#E8EBF1',n,'12px Segoe UI, Tahoma, Verdana',n,'none','0','#000000','0px 20px 0px 20',1);\r\nawmCreateCSS(0,2,0,'#1803FB','#F5F8FE',n,'bold 12px Segoe UI, Tahoma, Verdana',n,'none','0','#000000','0px 20px 0px 20',1); /* 1803FB Azul FF0000 Rojo*/\r\nawmCF(3,5,5,0,-1);\r\nawmCF(4,1,0,0,0);\r\nawmCF(5,1,0,0,0);\r\n//var s0=awmCreateMenu(0,0,0,1,9,0,0,0,0,110,82,0,1,2,1,0,1,n,n,100,0,0,110,82,0,-1,1,500,200,0,0,0,\"0,0,0\",n,n,n,n,n,n,n,n,0,0,0,0,0,0,0,0,1);\r\n// XX lo que se mueve a lo ancho y YY se desplaza arriba o abajo\r\nvar s0=awmCreateMenu(0,0,0,1,9,0,0,0,0,XX,YY,0,1,2,1,0,1,n,n,100,0,0,XX,YY,0,-1,1,500,200,0,0,0,\"0,0,0\",n,n,n,n,n,n,n,n,0,0,0,0,0,0,0,0,1);\r\nit=s0.addItemWithImages(0,1,1,\"Histórico de Nómina\",n,n,\"\",0,0,0,3,3,3,n,n,n,\"\",n,n,n,n,n,0,0,0,n,n,n,n,n,n,0,0,0,0,0,n,n,n,0,0,0,n,n);\r\nit=s0.addItemWithImages(3,4,4,\"Definiciones\",n,n,\"\",1,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,1,0,0,0,0,n,0,0,0,0,0,8,n);\r\nvar s1=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,1,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s1.addItemWithImages(6,7,7,\"Asignación de Personal -&gt; Cargo\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_d_hpersonalnomina.php\",n,n,n,\"../tepuy_sno_d_hpersonalnomina.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,1,0,1,2,2,0,0,0,13,n);\r\nit=s1.addItemWithImages(6,7,7,\"Conceptos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_d_hconcepto.php\",n,n,n,\"../tepuy_sno_d_hconcepto.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,1,0,1,2,2,0,0,0,16,n);\r\nit=s0.addItemWithImages(3,4,4,\"Reportes\",n,n,\"\",6,6,6,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,1,0,0,0,0,1,2,2,0,0,0,14,n);\r\nvar s1=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,18,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s1.addItemWithImages(6,7,7,\"Nómina\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,0,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,2,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Prenomina\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_hprenomina.php\",n,n,n,\"../tepuy_sno_r_hprenomina.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,38,n);\r\nit=s2.addItemWithImages(6,7,7,\"Nómina de Pago\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_hpagonomina.php\",n,n,n,\"../tepuy_sno_r_hpagonomina.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,39,n);\r\nit=s2.addItemWithImages(6,7,7,\"Pago de Nómina por Unidad Administrativa\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_hpagonominaunidadadmin.php\",n,n,n,\"../tepuy_sno_r_hpagonominaunidadadmin.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,3,n);\r\nit=s2.addItemWithImages(6,7,7,\"Recibo de Pago\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_hrecibopago.php\",n,n,n,\"../tepuy_sno_r_hrecibopago.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,41,n);\r\nit=s1.addItemWithImages(6,7,7,\"Listados\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,1,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,3,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Listado de Conceptos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_hlistadoconcepto.php\",n,n,n,\"../tepuy_sno_r_hlistadoconcepto.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,49,n);\r\nit=s2.addItemWithImages(6,7,7,\"Listado de Personal Cobro por Cheque\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_hlistadopersonalcheque.php\",n,n,n,\"../tepuy_sno_r_hlistadopersonalcheque.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,50,n);\r\nit=s2.addItemWithImages(6,7,7,\"Listado al Banco\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_hlistadobanco.php\",n,n,n,\"../tepuy_sno_r_hlistadobanco.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,51,n);\r\nit=s2.addItemWithImages(6,7,7,\"Listado de Firmas\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_hlistadofirmas.php\",n,n,n,\"../tepuy_sno_r_hlistadofirmas.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,52,n);\r\nit=s1.addItemWithImages(6,7,7,\"Aporte Patronal\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_haportepatronal.php\",n,n,n,\"../tepuy_sno_r_haportepatronal.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,32,n);\r\nit=s1.addItemWithImages(6,7,7,\"Resumenes\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,34,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,6,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Concepto\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_hresumenconcepto.php\",n,n,n,\"../tepuy_sno_r_hresumenconcepto.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,62,n);\r\nit=s2.addItemWithImages(6,7,7,\"Concepto por Unidad\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_hresumenconceptounidad.php\",n,n,n,\"../tepuy_sno_r_hresumenconceptounidad.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,63,n);\r\nit=s2.addItemWithImages(6,7,7,\"Cuadre de Nómina\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_hcuadrenomina.php\",n,n,n,\"../tepuy_sno_r_hcuadrenomina.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,64,n);\r\nit=s2.addItemWithImages(6,7,7,\"Monto Ejecutado por Tipo de Cargo\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,\"window.open('../reportes/tepuy_sno_rpp_hcuadreconceptoaporte.php','catalogo','menubar=no,toolbar=no,scrollbars=yes,width=800,height=600,left=0,top=0,location=no,resizable=yes');\",n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,65,n);\r\nit=s2.addItemWithImages(6,7,7,\"Monto Ejecutado Pensionados, Jubilados y Sobreviviente\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,\"window.open('../reportes/tepuy_sno_rpp_hcuadreconceptoaporte.php','catalogo','menubar=no,toolbar=no,scrollbars=yes,width=800,height=600,left=0,top=0,location=no,resizable=yes');\",n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,5,n);\r\nit=s2.addItemWithImages(6,7,7,\"Contable de Conceptos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_hcontableconceptos.php\",n,n,n,\"../tepuy_sno_r_hcontableconceptos.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,66,n);\r\nit=s2.addItemWithImages(6,7,7,\"Contable de Aportes\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_hcontableaportes.php\",n,n,n,\"../tepuy_sno_r_hcontableaportes.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,67,n);\r\nit=s1.addItemWithImages(6,7,7,\"Vacaciones\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,35,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,7,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Relación de Vacaciones\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_hrelacionvacaciones.php\",n,n,n,\"../tepuy_sno_r_hrelacionvacaciones.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,69,n);\r\nit=s2.addItemWithImages(6,7,7,\"Vacaciones Programadas\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_hprogramacionvacaciones.php\",n,n,n,\"../tepuy_sno_r_hprogramacionvacaciones.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,70,n);\r\nit=s1.addItemWithImages(6,7,7,\"Prestamos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,37,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,9,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Listado de Prestamos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_hlistadoprestamo.php\",n,n,n,\"../tepuy_sno_r_hlistadoprestamo.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,73,n);\r\nit=s2.addItemWithImages(6,7,7,\"Detalle de Prestamos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_hdetalleprestamo.php\",n,n,n,\"../tepuy_sno_r_hdetalleprestamo.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,74,n);\r\nit=s0.addItemWithImages(3,4,4,\"Mantenimiento\",n,n,\"\",7,7,7,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,1,0,0,0,0,1,2,2,0,0,0,17,n);\r\nvar s1=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,84,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s1.addItemWithImages(6,7,7,\"Modificar Nómina\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_hmodificarnomina.php\",n,n,n,\"../tepuy_sno_p_hmodificarnomina.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,2,n);\r\nit=s1.addItemWithImages(6,7,7,\"Modificar Unidad Administrativa\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_hunidadadmin.php\",n,n,n,\"../tepuy_sno_p_hunidadadmin.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,6,n);\r\nit=s1.addItemWithImages(6,7,7,\"Modificar Personal\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_hmodificarpersonalnomina.php\",n,n,n,\"../tepuy_sno_p_hmodificarpersonalnomina.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,7,n);\r\nit=s1.addItemWithImages(6,7,7,\"Modificar Conceptos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_hmodificarconcepto.php\",n,n,n,\"../tepuy_sno_p_hmodificarconcepto.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,9,n);\r\nit=s1.addItemWithImages(6,7,7,\"Ajustar Contabilización\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_hajustarcontabilizacion.php\",n,n,n,\"../tepuy_sno_p_hajustarcontabilizacion.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,10,n);\r\nit=s0.addItemWithImages(3,4,4,\"Retornar\",n,n,\"\",8,8,8,3,3,3,n,n,n,\"\",n,n,n,\"../tepuywindow_blank.php\",n,0,34,2,n,n,n,n,n,n,1,0,0,0,0,n,0,0,0,0,0,4,n);\r\ns0.pm.buildMenu();\r\n}}", "function initKeys() {\n return [\n {id:\t\"all-clear\",\tkey:\t\"a\", type: \"command\"}, // event.Key === (a || A)\n {id:\t\"clear\",\t key:\t\"c\", type: \"command\"}, // event.Key === (c || C)\n {id:\t\"backspace\",\tkey:\t\"bs\", type: \"command\"}, // event.key === (Backspace)\n \n {id:\t\"zero\",\t key:\t\"0\", type: \"number\"},\n {id:\t\"one\",\t key:\t\"1\", type: \"number\"},\n {id:\t\"two\",\t key:\t\"2\", type: \"number\"},\n {id:\t\"three\", \tkey:\t\"3\", type: \"number\"},\n {id:\t\"four\",\t key:\t\"4\", type: \"number\"},\n {id:\t\"five\",\t key:\t\"5\", type: \"number\"},\n {id:\t\"six\", key:\t\"6\", type: \"number\"},\n {id:\t\"seven\", key:\t\"7\", type: \"number\"},\n {id:\t\"eight\", \tkey:\t\"8\", type: \"number\"},\n {id:\t\"nine\",\t key:\t\"9\", type: \"number\"},\n {id:\t\"decimal\",\t key:\t\".\", type: \"number\"},\n \n {id:\t\"equals\",\t key:\t\"=\", type: \"operator\"}, // Event.key === (Enter)\n {id:\t\"plus\",\t key:\t\"+\", type: \"operator\"}, // Event.key === (+ || =)\n {id:\t\"minus\",\t key:\t\"-\", type: \"operator\"},\n {id:\t\"multiply\",\t key:\t\"*\", type: \"operator\"}, // Event.key === (* || x)\n {id:\t\"divide\",\t key:\t\"/\", type: \"operator\"}\n ]\n}", "function context_menu(params,event) {\n\tel=document.getElementById(\"cm\");\n\to=event.srcElement;\n\tx=event.clientX+document.documentElement.scrollLeft+document.body.scrollLeft;\n\ty=event.clientY+document.documentElement.scrollTop+document.body.scrollTop;\n\tel.innerHTML='';\n\tfor (k in params) {\n\t//if params[k]=='space' then draw line (separator)\n\t\tif (params[k]=='space') { el.innerHTML+='<hr size=1>';\n\t//if menu item is disabled\n\t\t} else if (params[k][\"disabled\"]) { el.innerHTML+='<a class=\"cm_gray\" href=\"\" onclick=\"return false;\" title=\"'+params[k][\"title\"]+'\" onmouseover=\"window.status=this.title;return true;\" onmouseout=\"window.status=&quot;&quot; ;return true;\">&nbsp;&nbsp;&nbsp;&nbsp;'+params[k][\"value\"]+\"</a><br>\";\n\t//if current window is not opened in frame\n\t\t} else if (params[k][\"frame\"]==\"off\") { if (window.frameElement==\"[object HTMLFrameElement]\") { el.innerHTML+='<a class=\"cm_black\" href=\"\"'+\"onclick=\"+'window.open('+\"'\"+params[k][\"href\"]+\"','','statusbar,menubar,location'); return false;\"+'\" title=\"'+params[k][\"title\"]+'\" onmouseover=\"window.status=this.title;return true;\" onmouseout=\"window.status=&quot;&quot; ;return true;\">&nbsp;&nbsp;&nbsp;&nbsp;'+params[k][\"value\"]+\"</a><br>\";} else { el.innerHTML+='<a class=\"cm_black\" href=\"\"'+\"onclick=\"+'window.open('+\"'\"+params[k][\"href\"]+\"','','statusbar,menubar,location');return false;\"+'\" title=\"'+params[k][\"title\"]+'\" onmouseover=\"window.status=this.title;return true;\" onmouseout=\"window.status=&quot;&quot; ;return true;\">&nbsp;&nbsp;&nbsp;&nbsp;'+params[k][\"value\"]+\"</a><br>\";}\n\t//if current window must be opened in frame\n\t\t} else if (params[k][\"frame\"]==\"on\") { el.innerHTML+='<a class=\"cm_black\" href=\"\"'+'onclick='+\"parent\"+params[k][\"taget\"]+\".location.href='\"+params[k][\"href\"]+\"' return false;\"+' title=\"'+params[k][\"title\"]+'\" onmouseover=\"window.status=this.title;return true;\" onmouseout=\"window.status=&quot;&quot; ;return true;\">&nbsp;&nbsp;&nbsp;&nbsp;'+params[k][\"value\"]+\"</a><br>\";}\n\t}\n\tel.style.visibility=\"visible\";\n\tel.style.display=\"block\";\n\theight=el.scrollHeight-20;\n\tif (window.opera) height+=30;//stupid opera...\n\tif (event.clientY+height>document.body.clientHeight) { y-=height+14 } else { y-=2 }\n\tel.style.left=x+\"px\";\n\tel.style.top=y+\"px\";\n\tel.style.visibility=\"hidden\";\n\tel.style.display=\"none\";\n\tel.style.visibility=\"visible\";\n\tel.style.display=\"block\";\n\tevent.returnValue=false;\n}", "function menuOptions() {}", "function ak(a,b){return function(e,k){var action=e.shiftKey||e.ctrlKey||e.altKey||e.metaKey||!self.keyboard.applicationKeypad?a:b;return resolve(action,e,k);};}// If mod or not application cursor a, else b. The keys that care about", "function preOnKeyDown(event) {\n if (!event)\n event = getEvent(event);\n disableCtrlKey(event);\n if (event.keyCode == 0)\n return false;\n\n // if (event.keyCode == \"9\") {\n // var o = event.srcElement;\n // if (o.id == \"lkpMaterialCode\") {\n // alert(el(\"lkpMaterialCode\").tabIndex + \"|\" + el(\"txtLength\").tabIndex + \"|\" + el(\"lkpUnitCode\").tabIndex);\n // }\n // }\n switch (event.keyCode) {\n case 112: // F1\n {\n event.keyCode = 0;\n event.returnValue = false;\n }\n case 113: // F2\n case 114: // F3\n case 115: // F4\n case 116: // F5\n case 117: // F6\n case 121: // F10\n case 122, 27: // F11, Esc\n {\n if (action == \"ModalWindow\") {\n ppsc().closeModalWindow();\n }\n else {\n if (event.preventDefault) {\n event.preventDefault(true);\n event.stopPropagation();\n }\n else {\n event.keyCode = 0;\n event.returnValue = false;\n }\n }\n }\n }\n\n if (event.altKey && event.keyCode == 37) {\n alert('The key you are trying to use is invalid in this context.');\n if (event.preventDefault) {\n event.preventDefault(true);\n event.stopPropagation();\n }\n else {\n event.keyCode = 0;\n event.returnValue = false;\n event.cancelBubble = true;\n }\n return false;\n }\n\n if (event.altKey && event.keyCode == 115 || event.ctrlKey && event.keyCode == 115) {\n alert('The key you are trying to use is invalid in this context.');\n if (event.preventDefault) {\n event.preventDefault(true);\n event.stopPropagation();\n }\n else {\n event.keyCode = 0;\n event.returnValue = false;\n event.cancelBubble = true;\n }\n return false;\n }\n\n //To block the Refresh, New Window, Zoom\n if (event.ctrlKey == true && (event.keyCode == 78 || event.keyCode == 82 || event.keyCode == 107 || event.keyCode == 109)) {\n return;\n }\n\n //Backspace is only allowed in textarea and input text and password\n if (event.keyCode == 8) {\n var obj = event.srcElement || event.target;\n if (obj.type == \"text\" || obj.type == \"textarea\" || obj.type == \"password\" || obj.tagName == \"DIV\") {\n if (obj.readOnly == true)\n return false;\n else\n return true;\n }\n return false;\n }\n\n if (event.keyCode == 13 && action == \"ModalWindow\") {\n if (event.preventDefault) {\n event.preventDefault(true);\n event.stopPropagation();\n }\n else {\n event.keyCode = 0;\n event.returnValue = false;\n event.cancelBubble = true;\n }\n return false;\n }\n\n}", "_getMenuItems(commandStates) {\n const showDisabled = this.props.showDisabled\n let menuItems = []\n forEach(commandStates, (commandState, commandName) => {\n // ATTENTION: not showing the disabled ones is violating the users choice\n // given via configuration 'showDisabled'\n if (showDisabled || this.isToolEnabled(commandName, commandState)) {\n menuItems.push({\n command: commandName\n })\n }\n })\n return menuItems\n }", "function getAllJumpMenus(){\n var jumpMenuArr = new Array();\n var doc = dreamweaver.getDocumentDOM();\n var selArr = doc.getElementsByTagName(\"SELECT\");\n var nSelects = selArr.length;\n var currSelObj, objId;\n var counter = 0;\n \n for (i=0;i<nSelects;i++){\n currSelObj = selArr[i];\n objId = currSelObj.getAttribute(\"id\");\n\n\t\t // If the menu was created with an older version of DW,\n\t\t // it might only have a name attribute and no id. An id\n\t\t // is now required for the behavior to work properly, so\n\t\t // if none is found, we'll add one using the same value \n\t\t // as the name attribute in the applyBehavior() function.\n if (!objId)\n objId = currSelObj.getAttribute(\"name\");\n\n\t jumpMenuArr[counter] = new Array(2);\n\t\t jumpMenuArr[counter][0] = currSelObj;\t\t \n\t\t jumpMenuArr[counter++][1] = objId;\n\t\t \n }\n return jumpMenuArr;\n}", "function awmBuildMenu(){\r\nif (awmSupported){\r\nawmImagesColl=[\"nomina.png\",42,40,\"definicion.png\",31,22,\"main-button-tile.gif\",17,34,\"indicator.gif\",16,8,\"main-item-left-float.png\",17,24,\"main-itemOver-left-float.png\",15,24,\"procesos.png\",31,22,\"integrar.png\",31,22,\"reportes.png\",31,22,\"ivss.png\",31,22,\"configuracion.png\",31,22,\"retorno.png\",31,22];\r\nawmCreateCSS(1,2,1,'#FFFFFF',n,n,'14px sans-serif',n,'none','0','#000000','0px 0px 0px 0',0);\r\nawmCreateCSS(0,2,1,'#FFFFFF',n,n,'14px sans-serif',n,'none','0','#000000','0px 0px 0px 0',0);\r\nawmCreateCSS(0,1,0,n,'#1803FB',n,n,n,'solid','1','#A7AFBC',0,0); /* 1803FB Azul FF0000 Rojo*/\r\nawmCreateCSS(1,2,1,'#4A4A4A',n,2,'12px Segoe UI, Tahoma, Verdana',n,'none','0','#000000','0px 20px 0px 20',1);\r\nawmCreateCSS(0,2,1,'#4A4A4A','#E8EBF1',n,'bold 12px Segoe UI, Tahoma, Verdana',n,'none','0','#000000','0px 20px 0px 20',1);\r\nawmCreateCSS(0,1,0,n,'#A7AFBC',n,n,n,'solid','1','#A7AFBC',0,0);\r\nawmCreateCSS(1,2,0,'#4A4A4A','#E8EBF1',n,'12px Segoe UI, Tahoma, Verdana',n,'none','0','#000000','0px 20px 0px 20',1);\r\nawmCreateCSS(0,2,0,'#1803FB','#F5F8FE',n,'bold 12px Segoe UI, Tahoma, Verdana',n,'none','0','#000000','0px 20px 0px 20',1); /* 1803FB Azul FF0000 Rojo*/\r\nawmCF(3,5,5,0,-1);\r\nawmCF(4,1,0,0,0);\r\nawmCF(5,1,0,0,0);\r\n//var s0=awmCreateMenu(0,0,0,1,9,0,0,0,0,90,82,0,1,2,1,0,1,n,n,100,0,0,90,82,0,-1,1,500,200,0,0,0,\"0,0,0\",n,n,n,n,n,n,n,n,0,0,0,0,0,0,0,0,1);\r\n// XX lo que se mueve a lo ancho y YY se desplaza arriba o abajo\r\nvar s0=awmCreateMenu(0,0,0,1,9,0,0,0,0,XX,YY,0,1,2,1,0,1,n,n,100,0,0,XX,YY,0,-1,1,500,200,0,0,0,\"0,0,0\",n,n,n,n,n,n,n,n,0,0,0,0,0,0,0,0,1);\r\nit=s0.addItemWithImages(0,1,1,\"Nómina\",n,n,\"\",0,0,0,3,3,3,n,n,n,\"\",n,n,n,n,n,0,0,0,n,n,n,n,n,n,0,0,0,0,0,n,n,n,0,0,0,n,n);\r\nit=s0.addItemWithImages(3,4,4,\"Definiciones\",n,n,\"\",1,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,1,0,0,0,0,n,0,0,0,0,0,8,n);\r\nvar s1=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,1,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s1.addItemWithImages(6,7,7,\"Nóminas\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_d_nominas.php\",n,n,n,\"../tepuy_snorh_d_nominas.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,9,n);\r\nit=s1.addItemWithImages(6,7,7,\"Profesiones\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_d_profesion.php\",n,n,n,\"../tepuy_snorh_d_profesion.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,10,n);\r\nit=s1.addItemWithImages(6,7,7,\"Unidades Administrativos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_d_uni_ad.php\",n,n,n,\"../tepuy_snorh_d_uni_ad.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,12,n);\r\nit=s1.addItemWithImages(6,7,7,\"Ubicación Física\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_d_ubicacionfisica.php\",n,n,n,\"../tepuy_snorh_d_ubicacionfisica.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,13,n);\r\nit=s1.addItemWithImages(6,7,7,\"Ficha del Personal\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_d_personal.php\",n,n,n,\"../tepuy_snorh_d_personal.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,15,n);\r\nit=s1.addItemWithImages(6,7,7,\"Feriados\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_d_diaferiado.php\",n,n,n,\"../tepuy_snorh_d_diaferiado.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,16,n);\r\nit=s1.addItemWithImages(6,7,7,\"Cesta Ticket\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_d_ct_met.php\",n,n,n,\"../tepuy_snorh_d_ct_met.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,18,n);\r\nit=s1.addItemWithImages(6,7,7,\"Tabla de Vacaciones\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_d_tablavacacion.php\",n,n,n,\"../tepuy_snorh_d_tablavacacion.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,19,n);\r\nit=s1.addItemWithImages(6,7,7,\"Método a Banco\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_d_metodobanco.php\",n,n,n,\"../tepuy_snorh_d_metodobanco.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,20,n);\r\nit=s1.addItemWithImages(6,7,7,\"Sueldo Mínimo\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_d_sueldominimo.php\",n,n,n,\"../tepuy_snorh_d_sueldominimo.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,21,n);\r\nit=s1.addItemWithImages(6,7,7,\"Constacia de Trabajo\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_d_constanciatrabajo.php\",n,n,n,\"../tepuy_snorh_d_constanciatrabajo.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,22,n);\r\nit=s1.addItemWithImages(6,7,7,\"Archivos TXT\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_d_archivostxt.php\",n,n,n,\"../tepuy_snorh_d_archivostxt.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,23,n);\r\nit=s1.addItemWithImages(6,7,7,\"Dedicación\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_d_dedicacion.php\",n,n,n,\"../tepuy_snorh_d_dedicacion.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,24,n);\r\nit=s1.addItemWithImages(6,7,7,\"Escala Docente\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_d_escaladocente.php\",n,n,n,\"../tepuy_snorh_d_escaladocente.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,25,n);\r\nit=s1.addItemWithImages(6,7,7,\"Clasificación de Obreros\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_d_clasificacionobreros.php\",n,n,n,\"../tepuy_snorh_d_clasificacionobreros.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,26,n);\r\nit=s0.addItemWithImages(3,4,4,\"Procesos\",n,n,\"\",6,6,6,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,1,0,0,0,0,n,0,0,0,0,0,11,n);\r\nvar s1=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,17,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s1.addItemWithImages(6,7,7,\"Seleccionar Nómina\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,\"window.open('../tepuy_snorh_p_seleccionarnomina.php','catalogo','menubar=no,toolbar=no,scrollbars=yes,width=530,height=180,left=250,top=200,location=no,resizable=no');\",n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,188,n);\r\nit=s1.addItemWithImages(6,7,7,\"Prestación de Antigüedad\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_p_fideicomiso.php\",n,n,n,\"../tepuy_snorh_p_fideicomiso.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,5,n);\r\nit=s1.addItemWithImages(6,7,7,\"Histórico x Nómina\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,\"window.open('../tepuy_snorh_p_seleccionarhnomina.php','catalogo','menubar=no,toolbar=no,scrollbars=yes,width=530,height=180,left=250,top=200,location=no,resizable=no');\",n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,6,n);\r\nit=s1.addItemWithImages(6,7,7,\"Cambiar Estatus de Personal\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_p_personalcambioestatus.php\",n,n,n,\"../tepuy_snorh_p_personalcambioestatus.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,27,n);\r\nit=s1.addItemWithImages(6,7,7,\"Programación de Reporte\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_p_programacionreporte.php\",n,n,n,\"../tepuy_snorh_p_programacionreporte.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,28,n);\r\nit=s1.addItemWithImages(6,7,7,\"Buscar Personal\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_p_buscarpersonal.php\",n,n,n,\"../tepuy_snorh_p_buscarpersonal.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,29,n);\r\nit=s1.addItemWithImages(6,7,7,\"Contabilizar Nómina\",n,n,\"\",7,7,7,1,1,1,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,1,0,1,2,2,0,0,0,189,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,76,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Contabilizar\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_mis_p_contabiliza_sno.php\",n,n,n,\"../tepuy_mis_p_contabiliza_sno.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,191,n);\r\nit=s2.addItemWithImages(6,7,7,\"Reversar Contabilización\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_mis_p_reverso_sno.php\",n,n,n,\"../tepuy_mis_p_reverso_sno.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,192,n);\r\nit=s1.addItemWithImages(6,7,7,\"Registrar Beneficiario\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_rpc_d_beneficiario.php\",n,n,n,\"../tepuy_rpc_d_beneficiario.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,7,n);\r\nit=s0.addItemWithImages(3,4,4,\"Reportes\",n,n,\"\",8,8,8,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,1,0,0,0,0,1,2,2,0,0,0,14,n);\r\nvar s1=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,18,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s1.addItemWithImages(6,7,7,\"Personal\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,0,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,2,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Listado de Personal\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_listadopersonal.php\",n,n,n,\"../tepuy_snorh_r_listadopersonal.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,38,n);\r\nit=s2.addItemWithImages(6,7,7,\"Listado de Personal Contratado\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_listadopersonalcontratado.php\",n,n,n,\"../tepuy_snorh_r_listadopersonalcontratado.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,39,n);\r\nit=s2.addItemWithImages(6,7,7,\"Listado de Personal por Unidad Administrativa\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_unidadadministrativa.php\",n,n,n,\"../tepuy_snorh_r_unidadadministrativa.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,40,n);\r\nit=s2.addItemWithImages(6,7,7,\"Ficha de Personal\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_fichapersonal.php\",n,n,n,\"../tepuy_snorh_r_fichapersonal.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,41,n);\r\nit=s2.addItemWithImages(6,7,7,\"Listado de Personal al Seguro (HCM)\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_listadoseguro.php\",n,n,n,\"../tepuy_snorh_r_listadoseguro.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,42,n);\r\nit=s2.addItemWithImages(6,7,7,\"Antigüedad\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_antiguedadpersonal.php\",n,n,n,\"../tepuy_snorh_r_antiguedadpersonal.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,43,n);\r\nit=s2.addItemWithImages(6,7,7,\"Vacaciones\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_vacaciones.php\",n,n,n,\"../tepuy_snorh_r_vacaciones.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,44,n);\r\nit=s2.addItemWithImages(6,7,7,\"Constancia de Trabajo\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_constanciatrabajo.php\",n,n,n,\"../tepuy_snorh_r_constanciatrabajo.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,45,n);\r\nit=s2.addItemWithImages(6,7,7,\"Cumpleañeros\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_listadocumpleano.php\",n,n,n,\"../tepuy_snorh_r_listadocumpleano.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,46,n);\r\nit=s2.addItemWithImages(6,7,7,\"Familiares\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_familiar.php\",n,n,n,\"../tepuy_snorh_r_familiar.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,47,n);\r\nit=s2.addItemWithImages(6,7,7,\"Credenciales\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_credencialespersonal.php\",n,n,n,\"../tepuy_snorh_r_credencialespersonal.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,48,n);\r\nit=s1.addItemWithImages(6,7,7,\"Instructivos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,1,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,3,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Recursos Humanos (0406)\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_comparado0406.php\",n,n,n,\"../tepuy_snorh_r_comparado0406.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,49,n);\r\nit=s2.addItemWithImages(6,7,7,\"Recursos Humanos (0506)\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_comparado0506.php\",n,n,n,\"../tepuy_snorh_r_comparado0506.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,50,n);\r\nit=s2.addItemWithImages(6,7,7,\"Recursos Humanos Clasificados por Tipo de Cargo\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_comparado0711.php\",n,n,n,\"../tepuy_snorh_r_comparado0711.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,51,n);\r\nit=s2.addItemWithImages(6,7,7,\"Personal Jubilado, Pensionado y Asignación a Sobreviviente\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_comparado0712.php\",n,n,n,\"../tepuy_snorh_r_comparado0712.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,52,n);\r\nit=s1.addItemWithImages(6,7,7,\"Sane\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,32,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,4,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Registro de Ingreso (14-02)\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_sane_ingreso.php\",n,n,n,\"../tepuy_snorh_r_sane_ingreso.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,53,n);\r\nit=s2.addItemWithImages(6,7,7,\"Registro de Retiro (14-03)\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_sane_retiro.php\",n,n,n,\"../tepuy_snorh_r_sane_retiro.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,54,n);\r\nit=s2.addItemWithImages(6,7,7,\"Registro de Cambio de Salario (14-10)\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_sane_salario.php\",n,n,n,\"../tepuy_snorh_r_sane_salario.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,55,n);\r\nit=s2.addItemWithImages(6,7,7,\"Registro de Reposos Médicos (14-10)\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_sane_reposos.php\",n,n,n,\"../tepuy_snorh_r_sane_reposos.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,56,n);\r\nit=s2.addItemWithImages(6,7,7,\"Registro de Permisos No Remunerados\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_sane_permisos.php\",n,n,n,\"../tepuy_snorh_r_sane_permisos.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,57,n);\r\nit=s2.addItemWithImages(6,7,7,\"Registro de Cambio de Centro Médico\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_sane_centromedico.php\",n,n,n,\"../tepuy_snorh_r_sane_centromedico.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,58,n);\r\nit=s2.addItemWithImages(6,7,7,\"Registro de Modificación de Datos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_sane_modificacion.php\",n,n,n,\"../tepuy_snorh_r_sane_modificacion.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,59,n);\r\nit=s1.addItemWithImages(6,7,7,\"Retenciones\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,33,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,5,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Relación de Retención (AR-C)\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_retencion_arc.php\",n,n,n,\"../tepuy_snorh_r_retencion_arc.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,60,n);\r\nit=s2.addItemWithImages(6,7,7,\"Relación de Ingresos (AR-I)\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_retencion_ari.php\",n,n,n,\"../tepuy_snorh_r_retencion_ari.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,61,n);\r\nit=s2.addItemWithImages(6,7,7,\"Relación de Retención (I.S.L.R.)\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_retencion_islr.php\",n,n,n,\"../tepuy_snorh_r_retencion_islr.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,61,n);\r\nit=s1.addItemWithImages(6,7,7,\"Consolidados/Resumen\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,34,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,6,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Conceptos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_conceptos.php\",n,n,n,\"../tepuy_snorh_r_conceptos.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,62,n);\r\nit=s2.addItemWithImages(6,7,7,\"Aportes Patronales\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_aportepatronal.php\",n,n,n,\"../tepuy_snorh_r_aportepatronal.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,63,n);\r\nit=s2.addItemWithImages(6,7,7,\"Listado al Banco\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_listadobanco.php\",n,n,n,\"../tepuy_snorh_r_listadobanco.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,64,n);\r\nit=s2.addItemWithImages(6,7,7,\"Recibo de Pago\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_recibopago.php\",n,n,n,\"../tepuy_snorh_r_recibopago.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,65,n);\r\nit=s2.addItemWithImages(6,7,7,\"Cesta Ticket\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_cestaticket.php\",n,n,n,\"../tepuy_snorh_r_cestaticket.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,66,n);\r\nit=s2.addItemWithImages(6,7,7,\"Depósitos al Banco\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_depositobanco.php\",n,n,n,\"../tepuy_snorh_r_depositobanco.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,67,n);\r\nit=s2.addItemWithImages(6,7,7,\"Pagos por Unidad Administrativa\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_pagosunidadadmin.php\",n,n,n,\"../tepuy_snorh_r_pagosunidadadmin.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,68,n);\r\nit=s1.addItemWithImages(6,7,7,\"Prestación de Antigüedad\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,35,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,7,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Listado de Prestación de Antigûedad\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_prestacionantiguedad.php\",n,n,n,\"../tepuy_snorh_r_prestacionantiguedad.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,69,n);\r\nit=s2.addItemWithImages(6,7,7,\"Cuadre Prestación de Antigûedad\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_cuadreprestacionantiguedad.php\",n,n,n,\"../tepuy_snorh_r_cuadreprestacionantiguedad.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,70,n);\r\nit=s2.addItemWithImages(6,7,7,\"Afectación Prestación de Antigûedad\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_afectacionprestacionantiguedad.php\",n,n,n,\"../tepuy_snorh_r_afectacionprestacionantiguedad.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,71,n);\r\nit=s1.addItemWithImages(6,7,7,\"I.V.S.S.\",n,n,\"\",9,n,n,1,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,36,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,8,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Constancia de Trabajo para el I.V.S.S. (14-100)\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_constanciatrabajosegurosocial.php\",n,n,n,\"../tepuy_snorh_r_constanciatrabajosegurosocial.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,72,n);\r\nit=s1.addItemWithImages(6,7,7,\"Pensionados\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,37,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,9,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Beneficiario del Personal\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_personal_beneficiario.php\",n,n,n,\"../tepuy_snorh_r_personal_beneficiario.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,73,n);\r\nit=s2.addItemWithImages(6,7,7,\"Pagos Autorizados\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_personas_autorizadas.php\",n,n,n,\"../tepuy_snorh_r_personas_autorizadas.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,74,n);\r\nit=s2.addItemWithImages(6,7,7,\"Modos de Envío de Recibos de Pago\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_r_modos_enviosrec.php\",n,n,n,\"../tepuy_snorh_r_modos_enviosrec.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,75,n);\r\nit=s0.addItemWithImages(3,4,4,\"Configuración\",n,n,\"\",10,10,10,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,1,0,0,0,0,1,2,2,0,0,0,17,n);\r\nvar s1=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,84,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s1.addItemWithImages(6,7,7,\"Parámetros por Nómina\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_p_configuracion.php\",n,n,n,\"../tepuy_snorh_p_configuracion.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,2,n);\r\nit=s1.addItemWithImages(6,7,7,\"Fideicomiso\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_d_fideiconfigurable.php\",n,n,n,\"../tepuy_snorh_d_fideiconfigurable.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,3,n);\r\nit=s1.addItemWithImages(6,7,7,\"Cambio ID Personal\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_p_personalcambioid.php\",n,n,n,\"../tepuy_snorh_p_personalcambioid.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,30,n);\r\nit=s1.addItemWithImages(6,7,7,\"Transferencia de Datos entre RAC\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_snorh_p_transferenciadatos.php\",n,n,n,\"../tepuy_snorh_p_transferenciadatos.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,31,n);\r\nit=s0.addItemWithImages(3,4,4,\"Retornar\",n,n,\"\",11,11,11,3,3,3,n,n,n,\"\",n,n,n,\"../../tepuy_menu.php\",n,0,34,2,n,n,n,n,n,n,1,0,0,0,0,n,0,0,0,0,0,4,n);\r\ns0.pm.buildMenu();\r\n}}", "function awmBuildMenu(){\r\nif (awmSupported){\r\nawmImagesColl=[\"becas.png\",42,40,\"definicion.png\",31,22,\"main-button-tile.gif\",17,34,\"indicator.gif\",16,8,\"main-item-left-float.png\",17,24,\"main-itemOver-left-float.png\",15,24,\"procesos.png\",31,22,\"reportes.png\",31,22,\"configuracion.png\",31,22,\"retorno.png\",31,22];\r\nawmCreateCSS(1,2,1,'#FFFFFF',n,n,'14px sans-serif',n,'none','0','#000000','0px 0px 0px 0',0);\r\nawmCreateCSS(0,2,1,'#FFFFFF',n,n,'14px sans-serif',n,'none','0','#000000','0px 0px 0px 0',0);\r\nawmCreateCSS(0,1,0,n,'#1803FB',n,n,n,'solid','1','#A7AFBC',0,0); /* 1803FB Azul FF0000 Rojo*/\r\nawmCreateCSS(1,2,1,'#4A4A4A',n,2,'12px Segoe UI, Tahoma, Verdana',n,'none','0','#000000','0px 20px 0px 20',1);\r\nawmCreateCSS(0,2,1,'#4A4A4A','#E8EBF1',n,'bold 12px Segoe UI, Tahoma, Verdana',n,'none','0','#000000','0px 20px 0px 20',1);\r\nawmCreateCSS(0,1,0,n,'#A7AFBC',n,n,n,'solid','1','#A7AFBC',0,0);\r\nawmCreateCSS(1,2,0,'#4A4A4A','#E8EBF1',n,'12px Segoe UI, Tahoma, Verdana',n,'none','0','#000000','0px 20px 0px 20',1);\r\nawmCreateCSS(0,2,0,'#1803FB','#F5F8FE',n,'bold 12px Segoe UI, Tahoma, Verdana',n,'none','0','#000000','0px 20px 0px 20',1); /* 1803FB Azul FF0000 Rojo*/\r\nawmCF(3,5,5,0,-1);\r\nawmCF(4,1,0,0,0);\r\nawmCF(5,1,0,0,0);\r\n//var s0=awmCreateMenu(0,0,0,1,9,0,0,0,0,90,82,0,1,2,1,0,1,n,n,100,0,0,90,82,0,-1,1,500,200,0,0,0,\"0,0,0\",n,n,n,n,n,n,n,n,0,0,0,0,0,0,0,0,1);\r\n// XX lo que se mueve a lo ancho y YY se desplaza arriba o abajo\r\nvar s0=awmCreateMenu(0,0,0,1,9,0,0,0,0,XX,YY,0,1,2,1,0,1,n,n,100,0,0,XX,YY,0,-1,1,500,200,0,0,0,\"0,0,0\",n,n,n,n,n,n,n,n,0,0,0,0,0,0,0,0,1);\r\nit=s0.addItemWithImages(0,1,1,\"Becas\",n,n,\"\",0,0,0,3,3,3,n,n,n,\"\",n,n,n,n,n,0,0,0,n,n,n,n,n,n,0,0,0,0,0,n,n,n,0,0,0,n,n);\r\nit=s0.addItemWithImages(3,4,4,\"Definiciones\",n,n,\"\",1,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,1,0,0,0,0,n,0,0,0,0,0,8,n);\r\nvar s1=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,1,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s1.addItemWithImages(6,7,7,\"Cargos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_d_cargo.php\",n,n,n,\"../tepuy_sno_d_cargo.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,1,0,1,2,2,0,0,0,9,n);\r\nit=s1.addItemWithImages(6,7,7,\"Tabulador\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_d_tabulador.php\",n,n,n,\"../tepuy_sno_d_tabulador.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,10,n);\r\nit=s1.addItemWithImages(6,7,7,\"Asignación de Cargos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_d_asignacioncargo.php\",n,n,n,\"../tepuy_sno_d_asignacioncargo.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,1,0,1,2,2,0,0,0,12,n);\r\nit=s1.addItemWithImages(6,7,7,\"Asignación de Personal -&gt; Cargo\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_d_personalnomina.php\",n,n,n,\"../tepuy_sno_d_personalnomina.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,1,0,1,2,2,0,0,0,13,n);\r\nit=s1.addItemWithImages(6,7,7,\"Constantes\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_d_constantes.php\",n,n,n,\"../tepuy_sno_d_constantes.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,15,n);\r\nit=s1.addItemWithImages(6,7,7,\"Conceptos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_d_concepto.php\",n,n,n,\"../tepuy_sno_d_concepto.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,1,0,1,2,2,0,0,0,16,n);\r\nit=s1.addItemWithImages(6,7,7,\"Constante por Persona\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_d_persxconst.php\",n,n,n,\"../tepuy_sno_d_persxconst.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,18,n);\r\nit=s1.addItemWithImages(6,7,7,\"Concepto por Persona\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_d_persxconce.php\",n,n,n,\"../tepuy_sno_d_persxconce.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,1,0,1,2,2,0,0,0,19,n);\r\nit=s1.addItemWithImages(6,7,7,\"Tipo de Prestamo\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_d_tipoprestamo.php\",n,n,n,\"../tepuy_sno_d_tipoprestamo.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,20,n);\r\nit=s1.addItemWithImages(6,7,7,\"Concepto de Vacación\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_d_vacacionconcepto.php\",n,n,n,\"../tepuy_sno_d_vacacionconcepto.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,21,n);\r\nit=s1.addItemWithImages(6,7,7,\"Concepto de Prima\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_d_primaconcepto.php\",n,n,n,\"../tepuy_sno_d_primaconcepto.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,22,n);\r\nit=s0.addItemWithImages(3,4,4,\"Procesos\",n,n,\"\",6,6,6,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,1,0,0,0,0,n,0,0,0,0,0,11,n);\r\nvar s1=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,17,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s1.addItemWithImages(6,7,7,\"Nómina\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,188,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,10,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Prenómina\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_calcularprenomina.php\",n,n,n,\"../tepuy_sno_p_calcularprenomina.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,23,n);\r\nit=s2.addItemWithImages(6,7,7,\"Cálculo\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_calcularnomina.php\",n,n,n,\"../tepuy_sno_p_calcularnomina.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,24,n);\r\nit=s2.addItemWithImages(6,7,7,\"Reverso\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_reversarnomina.php\",n,n,n,\"../tepuy_sno_p_reversarnomina.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,25,n);\r\nit=s1.addItemWithImages(6,7,7,\"Manejo de Períodos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_manejoperiodo.php\",n,n,n,\"../tepuy_sno_p_manejoperiodo.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,5,n);\r\nit=s1.addItemWithImages(6,7,7,\"Vacaciones\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,6,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,11,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Generar vacaciones Vencidas\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_vacacionvencida.php\",n,n,n,\"../tepuy_sno_p_vacacionvencida.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,26,n);\r\nit=s2.addItemWithImages(6,7,7,\"Programar Vacaciones\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_vacacionprogramar.php\",n,n,n,\"../tepuy_sno_p_vacacionprogramar.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,76,n);\r\nit=s1.addItemWithImages(6,7,7,\"Préstamos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_prestamo.php\",n,n,n,\"../tepuy_sno_p_prestamo.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,28,n);\r\nit=s1.addItemWithImages(6,7,7,\"Cambiar Estatus de Personal\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_personalcambioestatus.php\",n,n,n,\"../tepuy_sno_p_personalcambioestatus.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,27,n);\r\nit=s1.addItemWithImages(6,7,7,\"Aplicar Conceptos Lote\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_aplicarconcepto.php\",n,n,n,\"../tepuy_sno_p_aplicarconcepto.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,29,n);\r\nit=s1.addItemWithImages(6,7,7,\"Ajustes\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,1,0,1,2,2,0,0,0,189,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,76,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Sueldos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_ajustarsueldo.php\",n,n,n,\"../tepuy_sno_p_ajustarsueldo.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,191,n);\r\nit=s2.addItemWithImages(6,7,7,\"Aportes\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_ajustaraporte.php\",n,n,n,\"../tepuy_sno_p_ajustaraporte.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,192,n);\r\nit=s1.addItemWithImages(6,7,7,\"Importar/Exportar Datos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_impexpdato.php\",n,n,n,\"../tepuy_sno_p_impexpdato.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,7,n);\r\nit=s1.addItemWithImages(6,7,7,\"Importar Definiciones\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_importardefiniciones.php\",n,n,n,\"../tepuy_sno_p_importardefiniciones.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,77,n);\r\nit=s1.addItemWithImages(6,7,7,\"Movimiento entre Nóminas\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_p_movimientonominas.php\",n,n,n,\"../tepuy_sno_p_movimientonominas.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,78,n);\r\nit=s0.addItemWithImages(3,4,4,\"Reportes\",n,n,\"\",7,7,7,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,1,0,0,0,0,1,2,2,0,0,0,14,n);\r\nvar s1=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,18,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s1.addItemWithImages(6,7,7,\"Nómina\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,0,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,2,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Prenomina\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_prenomina.php\",n,n,n,\"../tepuy_sno_r_prenomina.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,38,n);\r\nit=s2.addItemWithImages(6,7,7,\"Nómina de Pago\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_pagonomina.php\",n,n,n,\"../tepuy_sno_r_pagonomina.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,39,n);\r\nit=s2.addItemWithImages(6,7,7,\"Nómina de pago por Unidad Administrativa\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_pagonominaunidadadmin.php\",n,n,n,\"../tepuy_sno_r_pagonominaunidadadmin.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,40,n);\r\nit=s2.addItemWithImages(6,7,7,\"Recibo de Pago\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_recibopago.php\",n,n,n,\"../tepuy_sno_r_recibopago.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,41,n);\r\nit=s1.addItemWithImages(6,7,7,\"Listados\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,1,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,3,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Listado de Conceptos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_listadoconcepto.php\",n,n,n,\"../tepuy_sno_r_listadoconcepto.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,49,n);\r\nit=s2.addItemWithImages(6,7,7,\"Listado de Personal Cobro por Cheque\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_listadopersonalcheque.php\",n,n,n,\"../tepuy_sno_r_listadopersonalcheque.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,50,n);\r\nit=s2.addItemWithImages(6,7,7,\"Listado al Banco\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_listadobanco.php\",n,n,n,\"../tepuy_sno_r_listadobanco.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,51,n);\r\nit=s2.addItemWithImages(6,7,7,\"Listado de Firmas\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_listadofirmas.php\",n,n,n,\"../tepuy_sno_r_listadofirmas.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,52,n);\r\nit=s2.addItemWithImages(6,7,7,\"Listado de Beneficiarios\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_listadobeneficiario.php\",n,n,n,\"../tepuy_sno_r_listadobeneficiario.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,79,n);\r\nit=s1.addItemWithImages(6,7,7,\"Aporte Patronal\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_aportepatronal.php\",n,n,n,\"../tepuy_sno_r_aportepatronal.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,32,n);\r\nit=s1.addItemWithImages(6,7,7,\"Resumenes\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,34,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,6,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Concepto\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_resumenconcepto.php\",n,n,n,\"../tepuy_sno_r_resumenconcepto.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,62,n);\r\nit=s2.addItemWithImages(6,7,7,\"Concepto por Unidad\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_resumenconceptounidad.php\",n,n,n,\"../tepuy_sno_r_resumenconceptounidad.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,63,n);\r\nit=s2.addItemWithImages(6,7,7,\"Cuadre de Nómina\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_cuadrenomina.php\",n,n,n,\"../tepuy_sno_r_cuadrenomina.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,64,n);\r\nit=s2.addItemWithImages(6,7,7,\"Cuadre de Conceptos y Aportes\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,\"window.open('../reportes/tepuy_sno_rpp_cuadreconceptoaporte.php','catalogo','menubar=no,toolbar=no,scrollbars=yes,width=800,height=600,left=0,top=0,location=no,resizable=yes');\",n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,65,n);\r\nit=s2.addItemWithImages(6,7,7,\"Contable de Conceptos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_contableconceptos.php\",n,n,n,\"../tepuy_sno_r_contableconceptos.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,66,n);\r\nit=s2.addItemWithImages(6,7,7,\"Contable de Aportes\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_contableaportes.php\",n,n,n,\"../tepuy_sno_r_contableaportes.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,67,n);\r\nit=s1.addItemWithImages(6,7,7,\"Vacaciones\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,35,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,7,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Relación de Vacaciones\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_relacionvacaciones.php\",n,n,n,\"../tepuy_sno_r_relacionvacaciones.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,69,n);\r\nit=s2.addItemWithImages(6,7,7,\"Programación de Vacaciones\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_programacionvacaciones.php\",n,n,n,\"../tepuy_sno_r_programacionvacaciones.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,70,n);\r\nit=s1.addItemWithImages(6,7,7,\"Prestamos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,37,n);\r\nvar s2=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,9,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s2.addItemWithImages(6,7,7,\"Listado de Prestamos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_listadoprestamo.php\",n,n,n,\"../tepuy_sno_r_listadoprestamo.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,73,n);\r\nit=s2.addItemWithImages(6,7,7,\"Detalle de Prestamos\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"../tepuy_sno_r_detalleprestamo.php\",n,n,n,\"../tepuy_sno_r_detalleprestamo.php\",n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,74,n);\r\nit=s0.addItemWithImages(3,4,4,\"Configuración\",n,n,\"\",8,8,8,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,1,0,0,0,0,1,2,2,0,0,0,17,n);\r\nvar s1=it.addSubmenu(0,0,-1,0,0,0,0,5,1,1,0,n,n,100,-1,84,0,-1,1,200,200,0,0,\"0,0,0\",0,\"0\",1);\r\nit=s1.addItemWithImages(6,7,7,\"Parámetros de Reportes Nómina\",n,n,\"\",n,n,n,3,3,3,n,n,n,\"\",n,n,n,n,n,0,34,2,n,n,n,n,n,n,0,0,0,0,0,1,2,2,0,0,0,2,n);\r\nit=s0.addItemWithImages(3,4,4,\"Retornar\",n,n,\"\",9,9,9,3,3,3,n,n,n,\"\",n,n,n,\"../../tepuy_menu.php\",n,0,34,2,n,n,n,n,n,n,1,0,0,0,0,n,0,0,0,0,0,4,n);\r\ns0.pm.buildMenu();\r\n}}", "function OnWizComboKeyDown(nKeyCode)\r\n{\r\n\t// Get outermost window\r\n\tvar oDefault = window;\r\n\twhile (oDefault != oDefault.parent)\r\n\t\toDefault = oDefault.parent;\r\n\r\n\tswitch(nKeyCode)\r\n\t{\r\n\t\t// Enter\r\n\t\tcase 13:\r\n\t\t\toDefault.FinishBtn.click();\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t// Escape\r\n\t\tcase 27:\r\n\t\t\toDefault.CancelBtn.click();\r\n\t\t\tbreak;\r\n\r\n\t\t// F1\r\n\t\tcase 112:\r\n\t\t\toDefault.HelpBtn.click();\r\n\t\t\tbreak;\r\n\t}\r\n}", "function setUpShortcutKeys() {\n\n //bind keys to main window\n $(document).keyup(function(e){\n\n //console.log(e.which);\n\n //show next image on x key\n if (e.which == 88 ) {\n $(\"#nextImg\").click();\n //alert( \"x pressed\" );\n return false;\n }\n\n //show previous image on z key\n if (e.which == 90) {\n $(\"#prevImg\").click();\n //alert( \"z pressed\" );\n return false;\n }\n\n if (e.which == 67) {\n clearSelectedThumbs();\n return false;\n }\n\n });\n\n\n }", "function contextMenu(e){\r\n\tprintln(\"context\");\r\n\treturn false;\r\n}", "onKeyDownInternal(event, ctrl, shift, alt) {\n let key = event.which || event.keyCode;\n if (ctrl && !shift && !alt) {\n this.viewer.isControlPressed = true;\n switch (key) {\n // case 9:\n // event.preventDefault();\n // if (this.owner.acceptTab) {\n // this.selection.handleTabKey(false, false);\n // }\n // break;\n case 35:\n this.handleControlEndKey();\n break;\n case 36:\n this.handleControlHomeKey();\n break;\n case 37:\n this.handleControlLeftKey();\n break;\n case 38:\n this.handleControlUpKey();\n break;\n case 39:\n this.handleControlRightKey();\n break;\n case 40:\n this.handleControlDownKey();\n break;\n case 65:\n this.owner.selection.selectAll();\n break;\n case 67:\n event.preventDefault();\n this.copy();\n break;\n case 70:\n event.preventDefault();\n if (!isNullOrUndefined(this.owner.optionsPaneModule)) {\n this.owner.optionsPaneModule.showHideOptionsPane(true);\n }\n break;\n }\n }\n else if (shift && !ctrl && !alt) {\n switch (key) {\n case 35:\n this.handleShiftEndKey();\n event.preventDefault();\n break;\n case 36:\n this.handleShiftHomeKey();\n event.preventDefault();\n break;\n case 37:\n this.handleShiftLeftKey();\n event.preventDefault();\n break;\n case 38:\n this.handleShiftUpKey();\n event.preventDefault();\n break;\n case 39:\n this.handleShiftRightKey();\n event.preventDefault();\n break;\n case 40:\n this.handleShiftDownKey();\n event.preventDefault();\n break;\n }\n }\n else if (shift && ctrl && !alt) {\n switch (key) {\n case 35:\n this.handleControlShiftEndKey();\n break;\n case 36:\n this.handleControlShiftHomeKey();\n break;\n case 37:\n this.handleControlShiftLeftKey();\n break;\n case 38:\n this.handleControlShiftUpKey();\n break;\n case 39:\n this.handleControlShiftRightKey();\n break;\n case 40:\n this.handleControlShiftDownKey();\n break;\n }\n }\n else {\n switch (key) {\n // case 9:\n // event.preventDefault();\n // if (this.owner.acceptTab) {\n // this.handleTabKey(true, false);\n // }\n // break; \n case 33:\n event.preventDefault();\n this.viewer.viewerContainer.scrollTop -= this.viewer.visibleBounds.height;\n break;\n case 34:\n event.preventDefault();\n this.viewer.viewerContainer.scrollTop += this.viewer.visibleBounds.height;\n break;\n case 35:\n this.handleEndKey();\n event.preventDefault();\n break;\n case 36:\n this.handleHomeKey();\n event.preventDefault();\n break;\n case 37:\n this.handleLeftKey();\n event.preventDefault();\n break;\n case 38:\n this.handleUpKey();\n event.preventDefault();\n break;\n case 39:\n this.handleRightKey();\n event.preventDefault();\n break;\n case 40:\n this.handleDownKey();\n event.preventDefault();\n break;\n }\n }\n if (!this.owner.isReadOnlyMode) {\n this.owner.editorModule.onKeyDownInternal(event, ctrl, shift, alt);\n }\n if (this.owner.searchModule) {\n // tslint:disable-next-line:max-line-length\n if (!isNullOrUndefined(this.owner.searchModule.searchHighlighters) && this.owner.searchModule.searchHighlighters.length > 0) {\n this.owner.searchModule.searchResults.clear();\n }\n }\n if (event.keyCode === 27 || event.which === 27) {\n if (!isNullOrUndefined(this.owner.optionsPaneModule)) {\n this.owner.optionsPaneModule.showHideOptionsPane(false);\n }\n if (this.owner.enableHeaderAndFooter) {\n this.disableHeaderFooter();\n }\n }\n }", "function Interpreter_GetTopLevelCaptions(bRestrict)\n{\n\t//helpers\n\tvar i, c, topLevelObjectId, theObject, strName;\n\t//create result list\n\tvar result = [];\n\t//get current state\n\tvar wi4State = this.State;\n\t//get its screen instances\n\tvar screenInstances = wi4State.ListOfScreenInstances;\n\t//get current state id\n\tvar currentStateId = wi4State.UniqueId;\n\t//ask history for this variation\n\tvar variation = __SIMULATOR.History.Variations[currentStateId];\n\t//and obtain current order form\n\tvar aIds = variation && variation.FormRearrange ? variation.FormRearrange : [];\n\t//create a map\n\tvar quickMap = {};\n\t//fill it with the arranged ids\n\tfor (i = 0, c = aIds.length; i < c; i++)\n\t{\n\t\t//set this id as valid\n\t\tquickMap[aIds[i]] = true;\n\t}\n\n\t//loop through our screen instances\n\tfor (i = 0, c = screenInstances.length; i < c; i++)\n\t{\n\t\t//get id\n\t\tvar screenInstanceId = screenInstances[i];\n\t\t//get this screen instance\n\t\tvar screenInstance = wi4State.ScreenInstances[screenInstanceId];\n\t\t//get raw screen\n\t\tvar rawScreen = wi4State.RawScreens[screenInstance.RootId];\n\t\t//get root sub screen\n\t\tvar rootSubScreen = wi4State.SubScreens[rawScreen.RootId];\n\t\t//get root object id\n\t\ttopLevelObjectId = rootSubScreen.RootId;\n\t\t//is this set in the map\n\t\tif (!quickMap[topLevelObjectId])\n\t\t{\n\t\t\t//get the object\n\t\t\ttheObject = this.TopLevelObjects[topLevelObjectId];\n\t\t\t//valid?\n\t\t\tif (theObject)\n\t\t\t{\n\t\t\t\t//are we restricting?\n\t\t\t\tif (bRestrict)\n\t\t\t\t{\n\t\t\t\t\t//check visibility\n\t\t\t\t\tif (!Get_Bool(theObject.Properties[__NEMESIS_PROPERTY_VISIBLE], true))\n\t\t\t\t\t{\n\t\t\t\t\t\t//skip this one\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//get the name\n\t\t\t\tstrName = Get_String(theObject.Properties[__NEMESIS_PROPERTY_CAPTION], \"\");\n\t\t\t\t//bad name?\n\t\t\t\tif (String_IsNullOrWhiteSpace(strName))\n\t\t\t\t{\n\t\t\t\t\t//use the designer mode\n\t\t\t\t\tstrName = theObject.GetDesignerName();\n\t\t\t\t}\n\t\t\t\t//create the value\n\t\t\t\tresult.push({ Name: strName, Id: topLevelObjectId, Enabled: Get_Bool(theObject.Properties[__NEMESIS_PROPERTY_ENABLED], true) });\n\t\t\t}\n\t\t}\n\t}\n\t//now loop through the rearranged ids\n\tfor (i = 0, c = aIds.length; i < c; i++)\n\t{\n\t\t//get object id\n\t\ttopLevelObjectId = aIds[i];\n\t\t//get the object\n\t\ttheObject = this.TopLevelObjects[topLevelObjectId];\n\t\t//valid?\n\t\tif (theObject)\n\t\t{\n\t\t\t//are we restricting?\n\t\t\tif (bRestrict)\n\t\t\t{\n\t\t\t\t//check visibility\n\t\t\t\tif (!Get_Bool(theObject.Properties[__NEMESIS_PROPERTY_VISIBLE], true))\n\t\t\t\t{\n\t\t\t\t\t//skip this one\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//get the name\n\t\t\tstrName = Get_String(theObject.Properties[__NEMESIS_PROPERTY_CAPTION], \"\");\n\t\t\t//bad name?\n\t\t\tif (String_IsNullOrWhiteSpace(strName))\n\t\t\t{\n\t\t\t\t//use the designer mode\n\t\t\t\tstrName = theObject.GetDesignerName();\n\t\t\t}\n\t\t\t//create the value\n\t\t\tresult.push({ Name: strName, Id: topLevelObjectId, Enabled: Get_Bool(theObject.Properties[__NEMESIS_PROPERTY_ENABLED], true) });\n\t\t}\n\t}\n\t//return result\n\treturn result;\n}", "function OnKey()\r\n{\r\n\t//Get outermost window\r\n\tvar oDefault = window;\r\n\twhile (oDefault != oDefault.parent)\r\n\t\toDefault = oDefault.parent;\r\n\r\n\tvar bPreviousTab = false;\r\n\r\n\tif (event.keyCode != 0)\r\n\t{\r\n\t\tif (!event.repeat)\r\n\t\t{\r\n\t\t\tswitch(event.keyCode)\r\n\t\t\t{\r\n\t\t\t\t// Enter key for <SELECT>, other controls handled in OnPress()\r\n\t\t\t\tcase 13:\r\n\t\t\t\t\tif (event.srcElement.type && event.srcElement.type.substr(0,6) == \"select\")\r\n\t\t\t\t\t\toDefault.FinishBtn.click();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t// Escape key for <SELECT>, other controls handled in OnPress()\r\n\t\t\t\tcase 27:\r\n\t\t\t\t\tif (event.srcElement.type && event.srcElement.type.substr(0,6) == \"select\")\r\n\t\t\t\t\t\toDefault.CancelBtn.click();\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t//F1\r\n\t\t\t\tcase 112:\r\n\t\t\t\t\toDefault.HelpBtn.click();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\tcase 65:\r\n\t\t\t\tcase 70:\r\n\t\t\t\tcase 78:\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (event.ctrlKey)\r\n\t\t\t\t\t\t\tevent.returnValue = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t//Case for 33,9,34 have to be in this order\r\n\t\t\t\t//Page Up\r\n\t\t\t\tcase 33:\r\n\t\t\t\t\tbPreviousTab = true;\r\n\t\t\t\t\t\r\n\t\t\t\t//Tab\r\n\t\t\t\tcase 9:\r\n\t\t\t\t\tif (event.shiftKey)\r\n\t\t\t\t\t\tbPreviousTab = true;\r\n\t\t\t\t\t\t\r\n\t\t\t\t//Page Down\r\n\t\t\t\tcase 34:\r\n\t\t\t\t\tif (event.ctrlKey && oDefault.tab_array != null && oDefault.tab_array.length > 1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfor (i = 0; i < oDefault.tab_array.length; i++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif ((oDefault.tab_array[i].className.toLowerCase() == \"activelink\") || (oDefault.tab_array[i].className.toLowerCase() == \"inactivelink\"))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tvar j = 0;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif (bPreviousTab)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tj = i - 1;\r\n\t\t\t\t\t\t\t\t\twhile (j != i)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tif (j < 0)\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tj = oDefault.tab_array.length - 1;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tif ((oDefault.tab_array[j].className.toLowerCase() == \"activelink\") || (oDefault.tab_array[j].className.toLowerCase() == \"inactivelink\"))\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tj--;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\twhile ((oDefault.tab_array[j].className.toLowerCase() == \"\") || (oDefault.tab_array[j].className.toLowerCase() == \"inactivelink\"))\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tif (j == 0)\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tif (oDefault.tab_array[j - 1].className.toLowerCase() == \"inactivelink\")\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tj--;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tif (j == 0)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tj = oDefault.tab_array.length - 1;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tj = j - 1;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tj = i + 1;\r\n\t\t\t\t\t\t\t\t\twhile (j != i)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tif (j >= oDefault.tab_array.length)\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tj = 0;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tif ((oDefault.tab_array[j].className.toLowerCase() == \"activelink\") || (oDefault.tab_array[j].className.toLowerCase() == \"inactivelink\"))\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tj++;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\twhile ((oDefault.tab_array[j].className.toLowerCase() == \"\") || (oDefault.tab_array[j].className.toLowerCase() == \"inactivelink\"))\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tif (j == oDefault.tab_array.length - 1)\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tif (oDefault.tab_array[j + 1].className.toLowerCase() == \"inactivelink\")\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tj++;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tif (j == oDefault.tab_array.length - 1)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tj = 0;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tj = j + 1;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t//Prevent double notification when we pop up an error\r\n\t\t\t\t\t\t\t\tevent.cancelBubble = true;\r\n\t\t\t\t\t\t\t\toDefault.tab_array[j].click();\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t//Alt-Left arrow\r\n\t\t\t\tcase 37:\r\n\t\t\t\t\tif (event.altKey)\r\n\t\t\t\t\t\tevent.returnValue = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t//Alt-Right arrow\r\n\t\t\t\tcase 39:\t\t\t\t\t\r\n\t\t\t\t\tif (event.altKey)\r\n\t\t\t\t\t\tevent.returnValue = false;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "function getCustomNavigations( currentScreenKey, actionName ) {\n var customNavigations = new Array();\n return customNavigations;\n}", "function stripGtkAccessorKeys() {\n // Copy all the tab labels into an array.\n const nodes = Array.prototype.slice.call($('tabs').childNodes, 0);\n nodes.push($('export'));\n for (let i = 0; i < nodes.length; i++) {\n nodes[i].textContent = nodes[i].textContent.replace('&', '');\n }\n }", "function GM_registerMenuCommand(){\n // TODO: Elements placed into the page\n }", "function Themes_PreProcessPopupMenu(theObject)\n{\n\ttheObject.Properties[__NEMESIS_PROPERTY_WIDTH] = 0;\n\ttheObject.Properties[__NEMESIS_PROPERTY_HEIGHT] = 0;\n\tswitch (theObject.InterfaceLook)\n\t{\n\t\tcase __NEMESIS_LOOK_SAP_ENJOY:\n\t\tcase __NEMESIS_LOOK_SAP_TRADESHOW:\n\t\tcase __NEMESIS_LOOK_SAP_SIGNATURE_CORBU:\n\t\tcase __NEMESIS_LOOK_SAP_SIGNATURE_DESIGN:\n\t\tcase __NEMESIS_LOOK_SAP_CORBUS:\n\t\tcase __NEMESIS_LOOK_SAP_BLUE_CRYSTAL:\n\t\t\tif (String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_MENU_BK_COLOR]))\n\t\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_MENU_BK_COLOR] = \"<SAPCLR:54>\";\n\t\t\tif (String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_MENU_TEXT_UNSELECTED_COLOR]))\n\t\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_MENU_TEXT_UNSELECTED_COLOR] = \"<SAPCLR:55>\";\n\t\t\tif (String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_MENU_HIGHLIGHT_COLOR]))\n\t\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_MENU_HIGHLIGHT_COLOR] = \"<SAPCLR:58>\";\n\t\t\tif (String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_MENU_TEXT_SELECTED_COLOR]))\n\t\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_MENU_TEXT_SELECTED_COLOR] = \"<SAPCLR:56>\";\n\t\t\tif (String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_MENU_TEXT_DISABLED_COLOR]))\n\t\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_MENU_TEXT_DISABLED_COLOR] = \"<SAPCLR:57>\";\n\t\t\tbreak;\n\t}\n}", "function getHotkeyCombination() {\n return prefs.prefs[\"hotkey.combination\"] || \"alt-shift-f\";\n}", "function getInterestingWindows(app) {\n return app.get_windows().filter(function(w) {\n return !w.skip_taskbar;\n });\n}", "function mainFrameHandleKeyEvent(eventObj){\r\n\tvar elKeyCode = eventObj.keyCode;\r\n\tvar shft = eventObj.shiftKey;\r\n\tvar ctr = eventObj.ctrlKey;\r\n\tvar alt = eventObj.altKey;\r\n\tvar element=getEventSource(eventObj);\r\n\t\tif(alt && MSIE){\r\n\t\t\tvar win=window;\r\n\t\t\tvar blocker=null;\r\n\t\t\twhile(win.document!=document && (!win.document.getElementById(\"workArea\") || !blocker)){\r\n\t\t\t\twin=win.parent;\r\n\t\t\t\tif(win.document.getElementById(\"workArea\") && win.blocker){\r\n\t\t\t\t\tblocker=win.blocker;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tevt=window.event;\r\n\t\t\tif (blocker){\r\n\t\t\t\tif (blocker.style.display==\"block\"){\r\n\t\t\t\t\treturn 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ((elKeyCode == 8)){\r\n\t\t\t\t//-----------------------------cancel--F3-F11-F5----------------//\r\n\t\t\tif (element.tagName != \"INPUT\" && element.tagName != \"TEXTAREA\") {\r\n\t\t\t\treturn 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\tif(!CHROME){\r\n\t\t\tif ((elKeyCode == 114) || (elKeyCode == 122) || (elKeyCode == 116)){\r\n\t\t\t\t\t//-----------------------------cancel--F3-F11-F5----------------//\r\n\t\t\t\treturn 0;\r\n\t\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (alt){\t\r\n\t\t\tif ((elKeyCode == 36) || (elKeyCode == 39) || (elKeyCode == 37)){\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t\t//------------------PRESSED ALT+0 = MAXIMIZE/MINIMIZE tabElement-----//\r\n\t\t\tif ((elKeyCode == 48)){\r\n\t\t\t\t\ttabEl=getTabsInDocs();\r\n\t\t\t\t\tif(tabEl!=null){\r\n\t\t\t\t\t\ttabEl.MaximizeTabs();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (ctr){\t\r\n\t\t\tif ((elKeyCode == 70) || (elKeyCode == 82) || (elKeyCode == 116)){\r\n\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t\tif ((elKeyCode == 79) || (elKeyCode == 76) || (elKeyCode == 78)){\r\n\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t\tif ((elKeyCode == 87) || (elKeyCode == 83) || (elKeyCode == 80)){\r\n\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t\tif ((elKeyCode == 69) || (elKeyCode == 73) || (elKeyCode == 72)){\r\n\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t\tif (elKeyCode == 37){\r\n\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n//\t\tif (elKeyCode == 112){\r\n//\t\t\t//-------------------------You pressed F1, the Help was canceled...------//\r\n//\t\t\t//Lanching OUR Help\r\n//\t\t\t//window.showHelp (\"ms-its://adfac01/adfacTelas/helpSystem/AdfacHelp.chm::/HTMLs/AdfacHelp/AdfacHelp.html\");\t\r\n//\t\t}\r\n\t\r\n\t\tif (eventObj.keyCode == 113){\r\n\t\t\t\t//---------------------------------F2--HIDE TOC EXPLORER--------//\r\n\t\t\t\ttop.toggleExplorer();\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n}", "isHandlerFor( event ){\n return [\"Alt\",\"Control\",\"Meta\",\"Shift\"].find( (keyName) => keyName == event.key );\n }", "function Get_MiniActions(intObject)\n{\n\t//by default: an object with data\n\tvar miniActions = { Activate: [], Deactivate: [] };\n\t//is this object invisible?\n\tif (!Get_Bool(intObject.Properties[__NEMESIS_PROPERTY_VISIBLE], true))\n\t{\n\t\t//ask for its Virtual key\n\t\tvar strVirtualKey = Get_String(intObject.Properties[__NEMESIS_PROPERTY_VIRTUAL_KEY], null);\n\t\t//valid key?\n\t\tif (!String_IsNullOrWhiteSpace(strVirtualKey))\n\t\t{\n\t\t\t//decode it\n\t\t\tstrVirtualKey = Browser_DecodeAccShortCut(strVirtualKey);\n\t\t\t//has control modifier?\n\t\t\tif (/control/gi.test(strVirtualKey))\n\t\t\t{\n\t\t\t\t//store trigger\n\t\t\t\tminiActions.Activate.push(__MINIACTION_EVENT_CTRL_DOWN);\n\t\t\t\t//store deactivation\n\t\t\t\tminiActions.Deactivate.push(__MINIACTION_EVENT_CTRL_UP);\n\t\t\t}\n\t\t\t//has alt modifier?\n\t\t\tif (/alt/gi.test(strVirtualKey))\n\t\t\t{\n\t\t\t\t//store trigger\n\t\t\t\tminiActions.Activate.push(__MINIACTION_EVENT_ALT_DOWN);\n\t\t\t\t//store deactivation\n\t\t\t\tminiActions.Deactivate.push(__MINIACTION_EVENT_ALT_UP);\n\t\t\t}\n\t\t\t//has shift modifier?\n\t\t\tif (/shift/gi.test(strVirtualKey))\n\t\t\t{\n\t\t\t\t//store trigger\n\t\t\t\tminiActions.Activate.push(__MINIACTION_EVENT_SHIFT_DOWN);\n\t\t\t\t//store deactivation\n\t\t\t\tminiActions.Deactivate.push(__MINIACTION_EVENT_SHIFT_UP);\n\t\t\t}\n\t\t}\n\t}\n\t//valid? return it, else false\n\treturn miniActions.Activate.length > 0 ? miniActions : false;\n}", "function ui_keys(){\n init();\n\tuiEvent.key(arguments[0], arguments[1]);\n}", "function asciiIconClick() {\n\tvar x = document.getElementById('asciiWindow');\n\tx.style.display = \"block\";\n\n\t// makes current window the top window\n\tvar windows = document.getElementsByClassName('drsElement');\n\tvar i = windows.length;\n\twhile (i--) {\n\t\twindows[i].style.zIndex = \"3\";\n\t}\n\tx.style.zIndex = \"4\";\n\tx.focus();\n}", "function DDLightbarMenu_RemoveAllItemHotkeys()\n{\n\tfor (var i = 0; i < this.items.length; ++i)\n\t\tthis.items[i].hotkeys = [];\n}", "function hotKeys (event) {\r\n\r\n // Get details of the event dependent upon browser\r\n event = (event) ? event : ((window.event) ? event : null);\r\n eventKey = event;\r\n // We have found the event.\r\n if (event) {\r\n\r\n // Hotkeys require that either the control key or the alt key is being held down\r\n if (event.keyCode > 111 && event.keyCode < 123) {\r\n\r\n var actionCode = event.keyCode; //save the current press PF?\r\n\r\n // Now scan through the user-defined array to see if character has been defined.\r\n for (var i = 0; i < keyActions.length; i++) {\r\n\r\n // See if the next array element contains the Hotkey character\r\n if (keyActions[i].character == actionCode) {\r\n\r\n // Yes - pick up the action from the table\r\n var action;\r\n\r\n // If the action is a hyperlink, create JavaScript instruction in an anonymous function\r\n if (keyActions[i].actionType.toLowerCase() == \"link\") {\r\n action = new Function ('location.href =\"' + keyActions[i].param + '\"');\r\n }\r\n\r\n // If the action is JavaScript, embed it in an anonymous function\r\n else if (keyActions[i].actionType.toLowerCase() == \"code\") {\r\n action = new Function (keyActions[i].param);\r\n }\r\n\r\n // Error - unrecognised action.\r\n else {\r\n alert ('Hotkey Function Error: Action should be \"link\" or \"code\"');\r\n break;\r\n }\r\n\r\n // At last perform the required action from within an anonymous function.\r\n action ();\r\n\r\n // Hotkey actioned - exit from the for loop.\r\n break;\r\n }\r\n }\r\n }else if( (event.keyCode >= 65 && event.keyCode <= 90) || (event.keyCode >= 97 && event.keyCode <= 113) || (event.keyCode >= 48 && event.keyCode <= 57)){\r\n\t\talterado = true;\r\n\t}\r\n }\r\n return true;\r\n}", "rebuildMenu() {\n\n let bridgeItems = [];\n let oldItems = this.menu._getMenuItems();\n\n this.refreshMenuObjects = {};\n\n this.bridesData = this.hue.checkBridges();\n\n for (let item in oldItems){\n oldItems[item].destroy();\n }\n\n for (let bridgeid in this.hue.instances) {\n\n bridgeItems = this._createMenuBridge(bridgeid);\n\n for (let item in bridgeItems) {\n this.menu.addMenuItem(bridgeItems[item]);\n }\n\n this.menu.addMenuItem(\n new PopupMenu.PopupSeparatorMenuItem()\n );\n }\n\n let refreshMenuItem = new PopupMenu.PopupMenuItem(\n _(\"Refresh menu\")\n );\n refreshMenuItem.connect(\n 'button-press-event',\n () => { this.rebuildMenu(); }\n );\n this.menu.addMenuItem(refreshMenuItem);\n\n let prefsMenuItem = new PopupMenu.PopupMenuItem(\n _(\"Settings\")\n );\n prefsMenuItem.connect(\n 'button-press-event',\n () => {Util.spawn([\"gnome-shell-extension-prefs\", Me.uuid]);}\n );\n this.menu.addMenuItem(prefsMenuItem);\n\n this.refreshMenu();\n }", "function tabfix(keywords, key,object)\n{\n if(key.keyCode == '9') {\n navigate(key.keyCode,object);\n return false;\n }\n else return true;\n}", "get contextMenuClipboardActions() {\n\t\treturn this.nativeElement ? this.nativeElement.contextMenuClipboardActions : undefined;\n\t}", "handleShiftHomeKey() {\n this.extendToLineStart();\n this.checkForCursorVisibility();\n }", "function specialKeys(e, combo) {\n\t\t\tswitch (combo) {\n\n\t\t\t\t// cursor manipulation\n\t\t\t\tcase 'end':\n\t\t\t\tcase 'ctrl+e': // go to the end of the line you are currently typing on\n\t\t\t\t\tview.cursor(Number.MAX_VALUE);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'home':\n\t\t\t\tcase 'ctrl+a': // go to the beginning of the line you are currently typing on\n\t\t\t\t\tview.cursor(-Number.MAX_VALUE);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'left':\n\t\t\t\t\tview.cursor(-1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'right':\n\t\t\t\t\tview.cursor(+1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'alt+f': // move cursor forward one word on the current line\n\t\t\t\t\tview.cursor('+w');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'alt+b': // move cursor backward one word on the current line\n\t\t\t\t\tview.cursor('-w');\n\t\t\t\t\tbreak;\n\n\t\t\t\t// command manipulation\n\t\t\t\tcase 'backspace':\n\t\t\t\tcase 'ctrl+h': // same as backspace\n\t\t\t\t\tview.deleteBefore();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'del':\n\t\t\t\t\tview.deleleAfter();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ctrl+k': // clear the line after the cursor\n\t\t\t\t\tview.deleteAllAfter();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ctrl+u': // clears the line before the cursor position\n\t\t\t\t\tview.deleteAllBefore();\n\t\t\t\t\tbreak;\n\t\t\t\t// case 'ctrl+t': // swap the last two characters before the cursor // -> default 'new tab'\n\t\t\t\t// case 'esc t': // swap the last two words before the cursor // conflicts with 'show hint'\n\t\t\t\t// case 'ctrl+w': // delete the word before the cursor // -> default 'close tab'\n\t\t\t\tcase 'space':\n\t\t\t\t\tview.put(' ');\n\t\t\t\t\tbreak;\n\n\t\t\t\t// show hint\n\t\t\t\tcase 'tab': // auto-complete\n\t\t\t\tcase 'esc':\n\t\t\t\t\tview.hint();\n\t\t\t\t\tbreak;\n\n\t\t\t\t// history manipulation\n\t\t\t\tcase 'up':\n\t\t\t\t\tview.historyCmd(-1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'down':\n\t\t\t\t\tview.historyCmd(+1);\n\t\t\t\t\tbreak;\n\t\t\t\t// case 'ctrl+r': // let’s you search through previously used commands // -> default 'reload page'\n\n\t\t\t\t// execute smth\n\t\t\t\tcase 'ctrl+l': // clears the screen, similar to the clear command\n\t\t\t\t\tview.set('clear');\n\t\t\t\t\tview.execute();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ctrl+d': // exit the current shell\n\t\t\t\t\tview.set('logout');\n\t\t\t\t\tview.execute();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'enter':\n\t\t\t\t\tview.execute();\n\t\t\t\t\tbreak;\n\t\t\t\t// case 'ctrl+c': // kill whatever you are running\n\t\t\t\t// case 'ctrl+z': // puts whatever you are running into a suspended background process. fg restores it.\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "function ToolBar_ProcessOnKeyDown(strDecodedEvent)\n{\n\t//by default: no match\n\tvar result = null;\n\t//has item in shortcut map?\n\tvar item = this.ShortCutMaps[strDecodedEvent];\n\t//valid? and not disabled?\n\tif (item && !item.disabled)\n\t{\n\t\t//trigger the action on this\n\t\tresult = __SIMULATOR.ProcessEvent(new Event_Event(this.InterpreterObject, __NEMESIS_EVENT_CLICK, new Array(\"\" + item.TB_INDEX)));\n\t}\n\t//return it\n\treturn result;\n}", "function getSearchModifiers() {\n console.log('getSearchModifiers: begin');\n var modifiers = {};\n $('.searchmod').each(function (k, e) {\n\tvar modifier = e.getAttribute(SMID);\n\tmodifiers[modifier] = e.checked ? 1 : 0;\n });\n\n return modifiers;\n}", "if (!extraStateKeyMap) {\n const state = getRadiumStyleState(component);\n extraStateKeyMap = Object.keys(state).reduce((acc, key) => {\n // 'main' is the auto-generated key when there is only one element with\n // interactive styles and if a custom key is not assigned. Because of\n // this, it is impossible to know which child is 'main', so we won't\n // count this key when generating our extraStateKeyMap.\n if (key !== 'main') {\n acc[key] = true;\n }\n return acc;\n }, {});\n }", "getHandleOptions() {\n // get string of option tags\n var options = []\n // counter for key\n var i = 0\n this.state.supported_platforms.forEach(platform => {\n options.push(<MenuItem key={i} value={platform}>{platform}</MenuItem>)\n i++\n })\n return options\n }", "function prepareSelectAllHack() {\n\t\t if (te.selectionStart != null) {\n\t\t var selected = cm.somethingSelected();\n\t\t var extval = \"\\u200b\" + (selected ? te.value : \"\");\n\t\t te.value = \"\\u21da\"; // Used to catch context-menu undo\n\t\t te.value = extval;\n\t\t input.prevInput = selected ? \"\" : \"\\u200b\";\n\t\t te.selectionStart = 1; te.selectionEnd = extval.length;\n\t\t // Re-set this, in case some other handler touched the\n\t\t // selection in the meantime.\n\t\t display.selForContextMenu = cm.doc.sel;\n\t\t }\n\t\t }", "function setMenu() {\n //添加快捷键\n\tlet applicationOptions = [\n\t\t{ label: \"About Kungfu\", click: showKungfuInfo},\n\t\t{ label: \"Settings\", accelerator: \"CmdOrCtrl+,\", click: openSettingDialog },\n\t\t{ label: \"Close\", accelerator: \"CmdOrCtrl+W\", click: function() { console.log(BrowserWindow.getFocusedWindow().close()); }}\n\t]\n\n\tif(platform === 'mac') {\n\t\tapplicationOptions.push(\n\t\t\t{ label: \"Quit\", accelerator: \"Command+Q\", click: function() { app.quit(); }},\n\t\t)\n\t}\n\n\tconst template = [\n\t{\n\t\tlabel: \"Kungfu\",\n\t\tsubmenu: applicationOptions\n\t}, \n\t{\n\t\tlabel: \"Edit\",\n\t\tsubmenu: [\n\t\t\t{ label: \"Copy\", accelerator: \"CmdOrCtrl+C\", selector: \"copy:\" },\n\t\t\t{ label: \"Paste\", accelerator: \"CmdOrCtrl+V\", selector: \"paste:\" },\n\t\t]\n\t}];\n\t\n\tMenu.setApplicationMenu(Menu.buildFromTemplate(template))\n}", "function assignShortcuts() {\n $(document).keydown(function(e) {\n switch (e.key) {\n case 'Enter':\n // For following focused elements Enter should not be used as\n // shortcut for \"submitting\" the dialog.\n var active = document.activeElement;\n if (active.tagName == 'BUTTON') return;\n if (active.tagName == 'A') return;\n if (active.tagName == 'TEXTAREA') return;\n if (active.tagName == 'INPUT' && active.type == 'checkbox') return;\n if (active.tagName == 'INPUT' && active.type == 'radio') return;\n // Enter is only be used as shortcut for the control that is\n // explicitly the default action. It's up to the extensiond eveloper\n // to add this to Ok, Yes and Close for each individual dialog.\n var control = $('.dlg-default-action')[0];\n if (control) activateControl(control);\n break;\n case 'Escape':\n var control = $('.dlg-callback-cancel')[0];\n control = control || $('.dlg-callback-no')[0];\n control = control || $('.dlg-callback-ok')[0];\n control = control || $('.dlg-callback-close')[0];\n if (control) activateControl(control);\n break;\n case 'F1':\n var control = $('.dlg-callback-help')[0];\n if (control) activateControl(control);\n break;\n default:\n return;\n }\n e.preventDefault();\n });\n }", "exec() {\n const shifted = event.shiftKey;\n let node = null;\n let firstItem = this.masterNav.elem.querySelector('a');\n let lastItem = this.masterNav.elem.firstElementChild.lastElementChild.querySelector('li:last-child');\n\n // If shift key is held.\n if (shifted) {\n node = this.getElement('prev');\n if (this.target === firstItem) {\n this.masterNav.closeAllSubNavs();\n return;\n }\n }\n // No shift key, just regular ol tab.\n else {\n node = this.getElement('next');\n if (this.target.parentNode === lastItem) {\n this.masterNav.closeAllSubNavs();\n return;\n }\n }\n\n // No nodes were found. Close up behind us.\n if (!node) {\n if (this.item.getDepth() > 1) {\n this.parentNav.closeSubNav();\n }\n }\n }", "testMenuItemKeyboardActivation() {\n popup.decorate(menu);\n popup.attach(anchor);\n // Check that if the ESC key is pressed the focus is on\n // the anchor element.\n events.fireKeySequence(menu, KeyCodes.ESC);\n assertEquals(anchor, document.activeElement);\n\n let menuitemListenerFired = false;\n function onMenuitemAction(event) {\n if (event.keyCode == KeyCodes.SPACE || event.keyCode == KeyCodes.ENTER) {\n menuitemListenerFired = true;\n }\n }\n handler.listen(menuitem1, EventType.KEYDOWN, onMenuitemAction);\n // Simulate opening a menu using the DOWN key, and pressing the SPACE/ENTER\n // key in order to activate the first menuitem.\n events.fireKeySequence(anchor, KeyCodes.DOWN);\n events.fireKeySequence(menu, KeyCodes.SPACE);\n assertTrue(menuitemListenerFired);\n menuitemListenerFired = false;\n events.fireKeySequence(anchor, KeyCodes.DOWN);\n events.fireKeySequence(menu, KeyCodes.ENTER);\n assertTrue(menuitemListenerFired);\n // Make sure the menu item's listener doesn't fire for any key.\n menuitemListenerFired = false;\n events.fireKeySequence(anchor, KeyCodes.DOWN);\n events.fireKeySequence(menu, KeyCodes.SHIFT);\n assertFalse(menuitemListenerFired);\n\n // Simulate opening menu and moving down to the third menu item using the\n // DOWN key, and then activating it using the SPACE key.\n menuitemListenerFired = false;\n handler.listen(menuitem3, EventType.KEYDOWN, onMenuitemAction);\n events.fireKeySequence(anchor, KeyCodes.DOWN);\n events.fireKeySequence(anchor, KeyCodes.DOWN);\n events.fireKeySequence(anchor, KeyCodes.DOWN);\n events.fireKeySequence(menu, KeyCodes.SPACE);\n assertTrue(menuitemListenerFired);\n }", "function cf(e){var t=\"string\"==typeof e?e:Gi[e.keyCode];return\"Ctrl\"==t||\"Alt\"==t||\"Shift\"==t||\"Mod\"==t}", "_updateButtons() {\n const hideButton = action =>\n this.$header.querySelector(`.osjs-window-button[data-action=${action}]`)\n .style.display = 'none';\n\n const buttonmap = {\n maximizable: 'maximize',\n minimizable: 'minimize',\n closeable: 'close'\n };\n\n if (this.attributes.controls) {\n Object.keys(buttonmap)\n .forEach(key => {\n if (!this.attributes[key]) {\n hideButton(buttonmap[key]);\n }\n });\n } else {\n Array.from(this.$header.querySelectorAll('.osjs-window-button'))\n .forEach(el => el.style.display = 'none');\n }\n }", "testKeyPressWithNoHighlightedItem() {\n popup.decorate(menu);\n popup.attach(anchor);\n events.fireKeySequence(anchor, KeyCodes.SPACE);\n assertTrue(popup.isVisible());\n try {\n events.fireKeySequence(menu, KeyCodes.SPACE);\n } catch (e) {\n fail(\n 'Crash attempting to reference null selected menu item after ' +\n 'keyboard event.');\n }\n }", "function showhelp(){\n var helpWin = document.getElementById('shortcuthelp')\n if (helpWin){\n if (helpWin.style.display == \"block\"){\n helpWin.style.display = \"none\";\n }\n else {\n helpWin.style.top = window.pageYOffset+40;\n helpWin.style.display = \"block\";\n }\n }\n else {\n helpWin = document.createElement(\"div\");\n helpText = document.createElement(\"div\");\n helpWin.setAttribute(\"id\",\"shortcuthelp\");\n helpWin.innerHTML = \"<div style='color:black; background-color:#ff6600; width:100%; font-weight:bold;'>Shortcut commands</div><div style='font-size:.8em;'><i>Use shift as a modifier</i></div>\";\n helpWin.appendChild(helpText);\n for( i in ACTIONS) {\n helpText.innerHTML += \"<pre style='display:inline'>\"+i+\"</pre> : \"+ ACTIONS[i][0]+\"<br/>\";\n if (ACTIONS[i][1].length > 0 ){\n helpText.innerHTML += \"<pre style='display:inline; padding-left:1em;'>\"+i.toUpperCase()+\"</pre> : \"+ ACTIONS[i][1]+\"<br/>\";\n }\n }\n helpWin.setAttribute(\"style\",\"display: block; position: absolute; top: \"+(window.pageYOffset+40)+\"px; right: 10px; background-color: rgb(246, 246, 239);\");\n helpText.setAttribute(\"style\",\"padding:5px;\");\n \n document.childNodes[0].childNodes[1].appendChild(helpWin);\n }\n}", "function initMenu(){\n\toutlet(4, \"vpl_menu\", \"clear\");\n\toutlet(4, \"vpl_menu\", \"append\", \"properties\");\n\toutlet(4, \"vpl_menu\", \"append\", \"help\");\n\toutlet(4, \"vpl_menu\", \"append\", \"rename\");\n\toutlet(4, \"vpl_menu\", \"append\", \"expand\");\n\toutlet(4, \"vpl_menu\", \"append\", \"fold\");\n\toutlet(4, \"vpl_menu\", \"append\", \"---\");\n\toutlet(4, \"vpl_menu\", \"append\", \"duplicate\");\n\toutlet(4, \"vpl_menu\", \"append\", \"delete\");\n\n\toutlet(4, \"vpl_menu\", \"enableitem\", 0, myNodeEnableProperties);\n\toutlet(4, \"vpl_menu\", \"enableitem\", 1, myNodeEnableHelp);\n outlet(4, \"vpl_menu\", \"enableitem\", 3, myNodeEnableBody);\t\t\n outlet(4, \"vpl_menu\", \"enableitem\", 4, myNodeEnableBody);\t\t\n}", "registerAppCallback(menu, name, character, function_name){\n menu.submenu.push(\n {\n label:name,\n accelerator: process.platform == 'darwin' ? 'Command+'+character : 'Ctrl+'+character,\n app_dot:function_name\n }\n );\n }", "function getKey() {\n //return;\n var kc = event.keyCode;\n var elm = event.srcElement;\n var nrsrc;\n var nhre;\n var eid = elm.id;\n //nrsrc = parseInt(eid.substring(4, eid.indexOf('hre')));\n // nhre = parseInt(eid.substr(eid.indexOf('hre') + 3));\n\n switch (kc) {\n case 36: //home \n // document.all.item('rsrc0hre0').focus();\n break;\n case 35: //end \n // document.all.item('rsrc' + (endRsrc - 1) + 'hre' + hrArray[hrArray.length]).focus();\n break;\n case 33: //page up\n //if (nrsrc > 15) {\n // // document.all.item('rsrc' + (nrsrc - 15) + 'hre' + nhre).focus();\n //} else {\n // // document.all.item('rsrc0' + 'hre' + nhre).focus();\n //}\n break;\n case 34: //page down\n //if (nrsrc < (endRsrc - 15)) {\n // // document.all.item('rsrc' + (nrsrc + 15) + 'hre' + nhre).focus();\n //} else {\n // // document.all.item('rsrc' + (endRsrc - 1) + 'hre' + nhre).focus();\n //}\n break;\n case 13: //return\n //if (nhre < hrArray.length) {\n // document.all.item('rsrc' + nrsrc + 'hre' + (nhre + 1)).focus();\n //} else {\n elm.blur();\n elm.select();\n //}\n break;\n case 37: //left arrow\n //if (nhre > 0) {\n // //document.all.item('rsrc' + nrsrc + 'hre' + (nhre - 1)).focus();\n //}\n break;\n case 38: //up arrow\n //if (nrsrc > 0) {\n // //document.all.item('rsrc' + (nrsrc - 1) + 'hre' + nhre).focus();\n //}\n break;\n case 39: //right arrow\n //if (nhre < hrArray.length) {\n // //document.all.item('rsrc' + nrsrc + 'hre' + (nhre + 1)).focus();\n //}\n break;\n case 40: //down arrow\n //if (nrsrc < (endRsrc - 1)) {\n // //document.all.item('rsrc' + (nrsrc + 1) + 'hre' + nhre).focus();\n //}\n break;\n }\n}", "function loadKeybinds(){\n\n chrome.storage.sync.get({\n raiseModalKeybind: null,\n shortNumberSearch: false,\n }, function(items) {\n shortNumberSearch = items.shortNumberSearch;\n if (items.raiseModalKeybind) {\n modalKeybindKey = items.raiseModalKeybind.key;\n if (items.raiseModalKeybind.modifiers.constructor === Array) {\n modalKeybindModifiers = items.raiseModalKeybind.modifiers.slice();\n } else {\n modalKeybindModifiers = [];\n }\n }\n });\n}", "function doBksp() \n{ \n VKI.target.focus();\n var rng = null;\n if (VKI.target.setSelectionRange) // Not IE\n {\n if (VKI.target.readOnly && VKI.isWebKit) \n rng = [VKI.target.selStart || 0, VKI.target.selEnd || 0];\n else \n rng = [VKI.target.selectionStart, VKI.target.selectionEnd];\n \n if (rng[0] < rng[1]) \n rng[0]++;\n VKI.target.value = VKI.target.value.substr(0, rng[0] - 1) + VKI.target.value.substr(rng[1]);\n VKI.target.setSelectionRange(rng[0] - 1, rng[0] - 1);\n if (VKI.target.readOnly && VKI.isWebKit) \n {\n var range = window.getSelection().getRangeAt(0);\n VKI.target.selStart = range.startOffset;\n VKI.target.selEnd = range.endOffset;\n }\n } \n else if (VKI.target.createTextRange) // IE\n {\n try \n {\n VKI.target.range.select();\n } \n catch(e) \n { \n VKI.target.range = document.selection.createRange(); \n }\n if (!VKI.target.range.text.length) \n VKI.target.range.moveStart('character', -1);\n VKI.target.range.text = \"\";\n } \n else \n VKI.target.value = VKI.target.value.substr(0, VKI.target.value.length - 1);\n \n if (VKI.shift) \n VKI.modify(\"Shift\");\n \n if (VKI.alternate) \n VKI.modify(\"AltGr\");\n \n VKI.target.focus();\n \n return true;\n}", "get a11yKeyIsPressed() {\n return this.f6KeyIsPressed ||\n this.upArrowKeyIsPressed ||\n this.downArrowKeyIsPressed ||\n this.tabKeyIsPressed ||\n this.tildeKeyIsPressed ||\n this.lKeyIsPressed;\n }", "function keystroke_menu() {\n var htmlstr = '<h4>Keystroke commands for selected readings</h4><p>Click the pen to enable reading ' +\n 'selection. Readings can be selected by clicking, or by dragging across ' +\n 'the screen in edit mode. Press any of the following keys to take the ' +\n 'corresponding action:</p><ul>';\n $.each(keyCommands, function(k, v) {\n htmlstr += '<li><b>' + v['key'] + '</b>: ' + v['description'] + '</li>';\n });\n htmlstr += '</ul><p>Double-click a reading to access its properties; drag a reading to another one to create a relationship. For fuller documentation see the \"About/Help\" link.</p>';\n return htmlstr;\n}", "function showHotkeys() {\n alertify.alert(\n \"d: delete all orders<br>\" +\n \"s: increment click lot size<br>\" +\n \"x: decrement lot size<br>\" +\n \"up arrow: increment theo<br>\" +\n \"down arrow: decrement theo<br>\" +\n \"q: toggle quoter<br>\" +\n \"left arrow: tighten quoter<br>\" +\n \"right arrow: widen quoter<br>\" +\n \"a: increment quoter size<br>\" +\n \"z: decrement quoter size<br>\" +\n \"r: refill quotes<br>\" +\n \"h: show hotkeys\")\n}", "function pr(e,t,a,n,r){null==r&&(r=e.cm&&(e.cm.display.shift||e.extend)),wr(e,new Oi([mr(e.sel.primary(),t,a,r)],0),n)}", "function inspectBehavior(behFnCallStr){\n\n //select correct item in the Jump Menu list\n var fnArgs = extractArgs(behFnCallStr).slice(1);\n if (fnArgs.length > 2) {\n var menuId = fnArgs[0];\n var nMenus = GarrJumpMenus.length\n var i;\n var found = false;\n \n for (i=0;i<nMenus;i++){\n if(menuId == GarrJumpMenus[i][1]){\n\t GselJumpMenus.selectedIndex = i;\n\t found = true;\n break;\n\t } }\n \n //if we can't find the menu associated with this button, tell the\n //user it can't be found, and tell them to select another one.\n if (!found) {\n alert (MSG_Menu_Not_Found + \"\\n\" + MSG_Why_Not_Found + \"\\n\");\n }\n }\n}", "_updateHAXCEMenu() {\n this._ceMenu.ceButtons = [\n {\n icon: this.locked ? \"icons:lock\" : \"icons:lock-open\",\n callback: \"haxClickInlineLock\",\n label: \"Toggle Lock\",\n },\n {\n icon: this.published ? \"lrn:view\" : \"lrn:view-off\",\n callback: \"haxClickInlinePublished\",\n label: \"Toggle published\",\n },\n {\n icon: \"editor:format-indent-increase\",\n callback: \"haxIndentParent\",\n label: \"Move under parent page break\",\n disabled: !pageBreakManager.getParent(this, \"indent\"),\n },\n {\n icon: \"editor:format-indent-decrease\",\n callback: \"haxOutdentParent\",\n label: \"Move out of parent page break\",\n disabled: !pageBreakManager.getParent(this, \"outdent\"),\n },\n ];\n }", "_modifiers(e) {\n const [_x, _y] = ELEM.getScrollPosition(0);\n const [x, y] = [Event.pointerX(e), Event.pointerY(e)];\n if (!isNaN(x) || isNaN(y)) {\n this.status.setCrsr(x, y);\n }\n this.status.setAltKey(e.altKey);\n this.status.setCtrlKey(e.ctrlKey);\n this.status.setShiftKey(e.shiftKey);\n this.status.setMetaKey(e.metaKey);\n }", "_modifiers(e) {\n const [_x, _y] = ELEM.getScrollPosition(0);\n const [x, y] = [Event.pointerX(e), Event.pointerY(e)];\n if (!isNaN(x) || isNaN(y)) {\n this.status.setCrsr(x, y);\n }\n this.status.setAltKey(e.altKey);\n this.status.setCtrlKey(e.ctrlKey);\n this.status.setShiftKey(e.shiftKey);\n this.status.setMetaKey(e.metaKey);\n }", "setupContextMenu(saveCleanFiles) {\n const title = (saveCleanFiles) ? 'contextMenuScanAndDownloadTitle' : 'contextMenuScanTitle';\n return chrome.contextMenus.removeAll(() => {\n const menuId = chrome.contextMenus.create({\n id: MCL_CONFIG.contextMenu.scanId,\n title: chrome.i18n.getMessage(title),\n contexts: ['link', 'image', 'video', 'audio']\n });\n contextMenus[menuId] = menuId;\n });\n }", "function allKeyMaps(cm) {\r\n var maps = cm.state.keyMaps.slice(0);\r\n if (cm.options.extraKeys) maps.push(cm.options.extraKeys);\r\n maps.push(cm.options.keyMap);\r\n return maps;\r\n }", "function controlChildrenTabIndexModal(){ //A function to set the modals children to \"tabindex = 1\" and set the menu children to \"tabindex = -1\"\n let modalChilds = document.querySelector(\".app-box__popup\").children; //Selects all the children of the modal dialog\n let menuChilds = document.querySelector(\".app-box__header\").children; //Selects all the children of the header-container\n\n for (let i = 0; i < modalChilds.length; i++){ //Loops through all the children of the modal\n modalChilds[i].setAttribute(\"tabindex\", \"1\"); //and sets their tabindex to \"1\"\n menuChilds[i].setAttribute(\"tabindex\", \"-1\"); //while setting the children of the modal to \"-1\". Slightly unnessecary but for possible future use.\n }\n document.querySelector(\".material-icons\").setAttribute(\"tabindex\", \"-1\"); //Selects and sets the tabindex of the sidemenu icon to \"-1\"\n document.querySelector(\".app-box__popup--buttons\").setAttribute(\"tabindex\", \"-1\"); //Selects and sets the tabindex of the button-container in the modal to \"-1\" to make the tab-navigation easier.\n}", "function kb_highlightAllKeys() {\n\n for(var keyId in kb_keys) {\n\n kb_highlightKey(keyId);\n }\n}", "function FocusMonitorOptions() { }", "internalShowContextMenu(event) {\n const me = this;\n\n if (me.disabled) {\n return;\n }\n\n const data = me.getDataFromEvent(event);\n\n if (me.shouldShowMenu(data)) {\n me.showContextMenu(data);\n }\n }", "function prepareSelectAllHack() {\n\t\t if (te.selectionStart != null) {\n\t\t var selected = cm.somethingSelected();\n\t\t var extval = \"\\u200b\" + (selected ? te.value : \"\");\n\t\t te.value = \"\\u21da\"; // Used to catch context-menu undo\n\t\t te.value = extval;\n\t\t input.prevInput = selected ? \"\" : \"\\u200b\";\n\t\t te.selectionStart = 1; te.selectionEnd = extval.length;\n\t\t // Re-set this, in case some other handler touched the\n\t\t // selection in the meantime.\n\t\t display.selForContextMenu = cm.doc.sel;\n\t\t }\n\t\t }", "function getKey() {\n //return;\n var kc = event.keyCode;\n var elm = event.srcElement;\n var nrsrc;\n var nhre;\n var eid = elm.id;\n //nrsrc = parseInt(eid.substring(4, eid.indexOf('hre')));\n // nhre = parseInt(eid.substr(eid.indexOf('hre') + 3));\n\n switch (kc) {\n case 36: //home \n // document.all.item('rsrc0hre0').focus();\n break;\n case 35: //end \n // document.all.item('rsrc' + (endRsrc - 1) + 'hre' + hrArray[hrArray.length]).focus();\n break;\n case 33: //page up\n //if (nrsrc > 15) {\n // // document.all.item('rsrc' + (nrsrc - 15) + 'hre' + nhre).focus();\n //} else {\n // // document.all.item('rsrc0' + 'hre' + nhre).focus();\n //}\n break;\n case 34: //page down\n //if (nrsrc < (endRsrc - 15)) {\n // // document.all.item('rsrc' + (nrsrc + 15) + 'hre' + nhre).focus();\n //} else {\n // // document.all.item('rsrc' + (endRsrc - 1) + 'hre' + nhre).focus();\n //}\n break;\n case 13: //return\n //if (nhre < hrArray.length) {\n // document.all.item('rsrc' + nrsrc + 'hre' + (nhre + 1)).focus();\n //} else {\n elm.blur();\n elm.select();\n //}\n break;\n case 37: //left arrow\n //if (nhre > 0) {\n // //document.all.item('rsrc' + nrsrc + 'hre' + (nhre - 1)).focus();\n //}\n break;\n case 38: //up arrow\n //if (nrsrc > 0) {\n // //document.all.item('rsrc' + (nrsrc - 1) + 'hre' + nhre).focus();\n //}\n break;\n case 39: //right arrow\n //if (nhre < hrArray.length) {\n // //document.all.item('rsrc' + nrsrc + 'hre' + (nhre + 1)).focus();\n //}\n break;\n case 40: //down arrow\n //if (nrsrc < (endRsrc - 1)) {\n // //document.all.item('rsrc' + (nrsrc + 1) + 'hre' + nhre).focus();\n //}\n break;\n }\n\n}", "function activateKeyboardShortcuts(event) //the parameter 'event' is passed into function\r\n\t{ \r\n\t\tswitch( event.key ) //switch case statement on one variable and it's 'key' property: different keys pressed result in different outputs\r\n\t\t{\r\n\t\t\tcase ' ': //if the SPACE key is pressed and released\r\n\t\t\t\tplayButton.click(); //fires the playButton's click event\r\n\t\t\t\tbreak; //ends case\r\n\t\t\t\t\r\n\t\t\tcase 'm': //if the M key is pressed and released\r\n\t\t\t\tmuteButton.click(); //fires the muteButton's click event\r\n\t\t\t\tbreak; //ends case\r\n\t\t\t\t\r\n\t\t\tcase 'ArrowUp': //if the Arrow Up (north) key is pressed and released\r\n\t\t\t\tvolumeSlider.value += 1 ; //increases the volume value by one interval\r\n\t\t\t\tscrubVolume(); //calls scrubVolume function for functionality\r\n\t\t\t\tbreak; //ends case\r\n\t\t\t\t\r\n\t\t\tcase 'ArrowDown': //if the Arrow Down (south) key is pressed and released\r\n\t\t\t\tvolumeSlider.value -= 1 ; //decreases the volume value by one interval\r\n\t\t\t\tscrubVolume(); //calls scrubVolume function for functionality\r\n\t\t\t\tbreak; //ends case\r\n\t\t\t\t\r\n\t\t\tcase 'ArrowLeft': //if the Arrow Left (west) key is pressed and released\r\n\t\t\t\tmyVideo.currentTime = myVideo.currentTime - 10; //reassigns the video time to 10 seconds before\r\n\t\t\t\tbreak; //ends case\r\n\t\t\t\t\r\n\t\t\tcase 'ArrowRight': //if the Arrow Right (east) key is pressed and released\r\n\t\t\t\tskipForward10Sec() //calls skipForward10Sec function for functionality\r\n\t\t\t\tbreak; //ends case\r\n\t\t} //end switch case statement\r\n\t}", "testKeyboardEventsShowMenu() {\n popup.decorate(menu);\n popup.attach(anchor);\n popup.hide();\n assertFalse(popup.isVisible());\n events.fireKeySequence(anchor, KeyCodes.SPACE);\n assertTrue(popup.isVisible());\n assertEquals(-1, popup.getHighlightedIndex());\n popup.hide();\n assertFalse(popup.isVisible());\n events.fireKeySequence(anchor, KeyCodes.ENTER);\n assertTrue(popup.isVisible());\n assertEquals(-1, popup.getHighlightedIndex());\n }", "function prepareSelectAllHack() {\n\t if (te.selectionStart != null) {\n\t var selected = cm.somethingSelected();\n\t var extval = \"\\u200b\" + (selected ? te.value : \"\");\n\t te.value = \"\\u21da\"; // Used to catch context-menu undo\n\t te.value = extval;\n\t input.prevInput = selected ? \"\" : \"\\u200b\";\n\t te.selectionStart = 1; te.selectionEnd = extval.length;\n\t // Re-set this, in case some other handler touched the\n\t // selection in the meantime.\n\t display.selForContextMenu = cm.doc.sel;\n\t }\n\t }", "function prepareSelectAllHack() {\n\t if (te.selectionStart != null) {\n\t var selected = cm.somethingSelected();\n\t var extval = \"\\u200b\" + (selected ? te.value : \"\");\n\t te.value = \"\\u21da\"; // Used to catch context-menu undo\n\t te.value = extval;\n\t input.prevInput = selected ? \"\" : \"\\u200b\";\n\t te.selectionStart = 1; te.selectionEnd = extval.length;\n\t // Re-set this, in case some other handler touched the\n\t // selection in the meantime.\n\t display.selForContextMenu = cm.doc.sel;\n\t }\n\t }", "function prepareSelectAllHack() {\n\t if (te.selectionStart != null) {\n\t var selected = cm.somethingSelected();\n\t var extval = \"\\u200b\" + (selected ? te.value : \"\");\n\t te.value = \"\\u21da\"; // Used to catch context-menu undo\n\t te.value = extval;\n\t input.prevInput = selected ? \"\" : \"\\u200b\";\n\t te.selectionStart = 1; te.selectionEnd = extval.length;\n\t // Re-set this, in case some other handler touched the\n\t // selection in the meantime.\n\t display.selForContextMenu = cm.doc.sel;\n\t }\n\t }", "function IEnumerateExposedCommands() {}", "_getShellCompletionItems() {\n const shellSymbols = {};\n Object.keys(shell_api_1.signatures).map((symbol) => {\n shellSymbols[symbol] = Object.keys(shell_api_1.signatures[symbol].attributes || {}).map((item) => ({\n label: item,\n kind: vscode_languageserver_1.CompletionItemKind.Method\n }));\n });\n return shellSymbols;\n }", "function preventKeyUpEventIfMenuOpen(event) {\n if (event.which === 121 && event.shiftKey) {\n // Shift-F10\n if (getContextMenuNode().is(':visible')) {\n event.preventDefault();\n }\n }\n } // lazily get the Menu component in case it is inited after the ojContextMenu binding is applied to launcher.", "function getCompatibleOptions(blacklist) {\n /* enable everything by default */\n let defOpts = WindowListener.prototype.options,\n list = {};\n for (let opt in defOpts) {\n if (defOpts.hasOwnProperty(opt)) {\n list[opt] = !blacklist;\n }\n }\n\n /* recalcMode needs grab-op-begin and grab-op-end for global.display,\n * not in GNOME 3.2 */\n list.recalcMode = !(GObject.signal_lookup('grab-op-begin', GObject.type_from_name('MetaDisplay')));\n if (!blacklist) {\n list.recalcMode = !list.recalcMode;\n }\n return list;\n}", "function digglerClearTempMenuItems()\n{\n for (var i = 0; i < currentMenuItems.length; ++i)\n browser.menus.remove( currentMenuItems[i].id );\n currentMenuItems = [];\n globalMenuIndex = 0;\n}", "function MenuData_ProcessOnKeyDown(strDecodedEvent)\n{\n\t//by default: no match\n\tvar result = null;\n\t//we need to try and find a valid item\n\tvar item = null;\n\t//check current map first\n\tif (this.OpenedPopups && this.OpenedPopups.length > 0)\n\t{\n\t\t//get the last popup\n\t\tvar lastPopup = this.OpenedPopups[this.OpenedPopups.length - 1];\n\t\t//has shortcut maps? try to get a shortcut from the active map\n\t\titem = lastPopup.ShortCutMaps ? lastPopup.ShortCutMaps[strDecodedEvent] : null;\n\t}\n\t//no item?\n\tif (!item)\n\t{\n\t\t//check the global map\n\t\titem = this.ShortCutMaps[strDecodedEvent];\n\t}\n\t//valid?\n\tif (item)\n\t{\n\t\t//check its state\n\t\tswitch (item.State)\n\t\t{\n\t\t\tcase __MENU_NODE_ENABLED:\n\t\t\tcase __MENU_NODE_CHECKED:\n\t\t\t\t//this has children?\n\t\t\t\tif (item.MenuBarHTML)\n\t\t\t\t{\n\t\t\t\t\t//fake a click on this\n\t\t\t\t\tMenuItem_MouseDown({ srcElement: item.MenuBarHTML, target: item.MenuBarHTML });\n\t\t\t\t\t//loop through all siblings\n\t\t\t\t\tfor (var siblings = item.Parent.SubMenus, i = 0, c = siblings.length; i < c; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t//not us\n\t\t\t\t\t\tif (item != siblings[i])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//fake a mouseout on this\n\t\t\t\t\t\t\tMenuItem_MouseOut({ srcElement: siblings[i].MenuBarHTML, target: siblings[i].MenuBarHTML });\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//ensure that we are the selected one\n\t\t\t\t\titem.MenuData.SelectedMenuBar = item.MenuBarHTML;\n\t\t\t\t\t//set the result\n\t\t\t\t\tresult = new Event_EventResult();\n\t\t\t\t\t//make it non blocking\n\t\t\t\t\tresult.Block = false;\n\t\t\t\t\t//but matching\n\t\t\t\t\tresult.Match = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//trigger the action on this\n\t\t\t\t\tresult = __SIMULATOR.ProcessEvent(new Event_Event(this.InterpreterObject, __NEMESIS_EVENT_MENUSELECT, item.Exception));\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n\t//return it\n\treturn result;\n}", "function showShortcutMenu() {\n //Builds the shortcut options\n let shortcutOptions = [\n { name: 'Nothing', val: false },\n { name: 'Launcher', val: '#LAUNCHER' },\n ];\n\n let infoFiles = storage.list(/\\.info$/).sort((a, b) => {\n if (a.name < b.name) return -1;\n else if (a.name > b.name) return 1;\n else return 0;\n });\n for (let infoFile of infoFiles) {\n let appInfo = storage.readJSON(infoFile);\n if (appInfo.src) shortcutOptions.push({\n name: appInfo.name,\n val: appInfo.id\n });\n }\n\n E.showMenu({\n '': {\n 'title': 'Shortcuts',\n 'back': showMainMenu\n },\n 'Top first': {\n value: shortcutOptions.map(item => item.val).indexOf(config.shortcuts[0]),\n format: value => (value == -1) ? 'Unknown app!' : shortcutOptions[value].name,\n min: 0,\n max: shortcutOptions.length - 1,\n wrap: false,\n onchange: value => {\n config.shortcuts[0] = shortcutOptions[value].val;\n config.fastLoad.shortcuts[0] = false;\n saveSettings();\n }\n },\n 'Top second': {\n value: shortcutOptions.map(item => item.val).indexOf(config.shortcuts[1]),\n format: value => (value == -1) ? 'Unknown app!' : shortcutOptions[value].name,\n min: 0,\n max: shortcutOptions.length - 1,\n wrap: false,\n onchange: value => {\n config.shortcuts[1] = shortcutOptions[value].val;\n config.fastLoad.shortcuts[1] = false;\n saveSettings();\n }\n },\n 'Top third': {\n value: shortcutOptions.map(item => item.val).indexOf(config.shortcuts[2]),\n format: value => (value == -1) ? 'Unknown app!' : shortcutOptions[value].name,\n min: 0,\n max: shortcutOptions.length - 1,\n wrap: false,\n onchange: value => {\n config.shortcuts[2] = shortcutOptions[value].val;\n config.fastLoad.shortcuts[2] = false;\n saveSettings();\n }\n },\n 'Top fourth': {\n value: shortcutOptions.map(item => item.val).indexOf(config.shortcuts[3]),\n format: value => (value == -1) ? 'Unknown app!' : shortcutOptions[value].name,\n min: 0,\n max: shortcutOptions.length - 1,\n wrap: false,\n onchange: value => {\n config.shortcuts[3] = shortcutOptions[value].val;\n config.fastLoad.shortcuts[3] = false;\n saveSettings();\n }\n },\n 'Bottom first': {\n value: shortcutOptions.map(item => item.val).indexOf(config.shortcuts[4]),\n format: value => (value == -1) ? 'Unknown app!' : shortcutOptions[value].name,\n min: 0,\n max: shortcutOptions.length - 1,\n wrap: false,\n onchange: value => {\n config.shortcuts[4] = shortcutOptions[value].val;\n config.fastLoad.shortcuts[4] = false;\n saveSettings();\n }\n },\n 'Bottom second': {\n value: shortcutOptions.map(item => item.val).indexOf(config.shortcuts[5]),\n format: value => (value == -1) ? 'Unknown app!' : shortcutOptions[value].name,\n min: 0,\n max: shortcutOptions.length - 1,\n wrap: false,\n onchange: value => {\n config.shortcuts[5] = shortcutOptions[value].val;\n config.fastLoad.shortcuts[5] = false;\n saveSettings();\n }\n },\n 'Bottom third': {\n value: shortcutOptions.map(item => item.val).indexOf(config.shortcuts[6]),\n format: value => (value == -1) ? 'Unknown app!' : shortcutOptions[value].name,\n min: 0,\n max: shortcutOptions.length - 1,\n wrap: false,\n onchange: value => {\n config.shortcuts[6] = shortcutOptions[value].val;\n config.fastLoad.shortcuts[6] = false;\n saveSettings();\n }\n },\n 'Bottom fourth': {\n value: shortcutOptions.map(item => item.val).indexOf(config.shortcuts[7]),\n format: value => (value == -1) ? 'Unknown app!' : shortcutOptions[value].name,\n min: 0,\n max: shortcutOptions.length - 1,\n wrap: false,\n onchange: value => {\n config.shortcuts[7] = shortcutOptions[value].val;\n config.fastLoad.shortcuts[7] = false;\n saveSettings();\n }\n },\n 'Swipe up': {\n value: shortcutOptions.map(item => item.val).indexOf(config.swipe.up),\n format: value => (value == -1) ? 'Unknown app!' : shortcutOptions[value].name,\n min: 0,\n max: shortcutOptions.length - 1,\n wrap: false,\n onchange: value => {\n config.swipe.up = shortcutOptions[value].val;\n config.fastLoad.swipe.up = false;\n saveSettings();\n }\n },\n 'Swipe down': {\n value: shortcutOptions.map(item => item.val).indexOf(config.swipe.down),\n format: value => (value == -1) ? 'Unknown app!' : shortcutOptions[value].name,\n min: 0,\n max: shortcutOptions.length - 1,\n wrap: false,\n onchange: value => {\n config.swipe.down = shortcutOptions[value].val;\n config.fastLoad.swipe.down = false;\n saveSettings();\n }\n },\n 'Swipe left': {\n value: shortcutOptions.map(item => item.val).indexOf(config.swipe.left),\n format: value => (value == -1) ? 'Unknown app!' : shortcutOptions[value].name,\n min: 0,\n max: shortcutOptions.length - 1,\n wrap: false,\n onchange: value => {\n config.swipe.left = shortcutOptions[value].val;\n config.fastLoad.swipe.left = false;\n saveSettings();\n }\n },\n 'Swipe right': {\n value: shortcutOptions.map(item => item.val).indexOf(config.swipe.right),\n format: value => (value == -1) ? 'Unknown app!' : shortcutOptions[value].name,\n min: 0,\n max: shortcutOptions.length - 1,\n wrap: false,\n onchange: value => {\n config.swipe.right = shortcutOptions[value].val;\n config.fastLoad.swipe.right = false;\n saveSettings();\n }\n }\n });\n }", "defineMovementKeys() {\n const props = this.props;\n let keyUp = props.keyUp,\n keyDown = props.keyDown,\n keyEnter = props.keyEnter,\n keyLeave = props.keyLeave,\n getObjectArray;\n getObjectArray = (keys) => {\n return keys.map(key => {\n let splitted;\n if (typeof key===\"number\") {\n return {\n key\n };\n }\n if (key.itsa_contains(\"+\")) {\n // special key present\n splitted = key.split(\"+\");\n return {\n key: parseInt(splitted.pop(), 10),\n special: splitted.map(item => SPECIAL_KEYS[item])\n };\n }\n return {\n key: parseInt(key, 10)\n };\n });\n };\n // first handle keyUp:\n Array.isArray(keyUp) || (keyUp=[keyUp]);\n this._keysUp = getObjectArray(keyUp);\n // next keyDown:\n Array.isArray(keyDown) || (keyDown=[keyDown]);\n this._keysDown = getObjectArray(keyDown);\n // next keyEnter:\n Array.isArray(keyEnter) || (keyEnter=keyEnter ? [keyEnter] : []);\n this._keysEnter = getObjectArray(keyEnter);\n // next keyLeave:\n Array.isArray(keyLeave) || (keyLeave=[keyLeave]);\n this._keysLeave = getObjectArray(keyLeave);\n }", "function setAllVisibleElementsInfo(){\n $jQ('body *:visible, ['+vars.actions+'=\"user\"]').each(function() {\n var e = $jQ(this);\n var tag = e.prop(\"tagName\");\n if(tag!=\"BR\" && tag!=\"SCRIPT\" && tag!=\"IFRAME\"){\n setActions(e);\n setColorInfo(e,'');\n setFontInfos(e);\n setSizes(e);\n setPositions(e);\n setBorder(e);\n setTextTransform(e);\n setZIndex(e);\n }\n });\n}", "function getChoices() {\n var map = {};\n var pn = getPlayerNameFromCharpane();\n if (pn) {\n var s = GM_getValue(pn+'_ncactionbar_choices','');\n //GM_log('retrieved map: '+s);\n var cs = s.split(';');\n for (var i=0;i<cs.length;i++) {\n var csi = cs[i].split(':');\n if (csi.length==2) {\n map[csi[0]] = csi[1];\n }\n }\n }\n return map;\n}" ]
[ "0.5672235", "0.56299275", "0.5614718", "0.55224115", "0.54705167", "0.5452561", "0.5440017", "0.54134077", "0.5395205", "0.53901607", "0.538843", "0.53812414", "0.5335745", "0.5269757", "0.52655584", "0.52325195", "0.52013046", "0.5200467", "0.5180582", "0.51687264", "0.5137813", "0.5130163", "0.5119199", "0.51180667", "0.51142645", "0.5109059", "0.50931823", "0.50925875", "0.50829506", "0.5071632", "0.5064911", "0.50550675", "0.50545084", "0.50445014", "0.5043317", "0.5036588", "0.5017873", "0.5012275", "0.50086296", "0.5006312", "0.50016314", "0.4983101", "0.49805787", "0.49766612", "0.49676582", "0.49575844", "0.4956998", "0.49566036", "0.495153", "0.4950996", "0.49430284", "0.49397424", "0.49203092", "0.4912821", "0.4899426", "0.48982546", "0.4892742", "0.4890346", "0.48902315", "0.48864052", "0.48850918", "0.48840106", "0.4873313", "0.48725945", "0.48709023", "0.48693144", "0.48611182", "0.48600674", "0.48563612", "0.48409697", "0.4839525", "0.48362568", "0.48320544", "0.48280877", "0.4825475", "0.48220685", "0.48220685", "0.48203486", "0.4818955", "0.4818216", "0.48155078", "0.48123887", "0.48063922", "0.48060068", "0.48036775", "0.4803124", "0.4802546", "0.48012978", "0.48012978", "0.48012978", "0.47995996", "0.4799247", "0.4790461", "0.47877556", "0.47869688", "0.47868595", "0.47818628", "0.47795165", "0.47761434", "0.4770139" ]
0.5746991
0
=========================== Bot setup! =========================== This function sets up and runs our bot.
function init_bot() { console.log("Initializing Penny..."); // rtmHandlers (real time message handlers) rtmHandlers.onAuthentication(env); rtmHandlers.onReceiveMessage(env); rtmHandlers.startRtm(env); setupScheduledPrompts(env); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setupBot(args) {\r\n if (botDataExists()) {\r\n console.log('Found saved bot data during setup - loading it');\r\n loadBotData();\r\n } else {\r\n console.log('No saved bot data found - generating default data');\r\n setupDefaultBot();\r\n saveBotData();\r\n }\r\n}", "function startBot() {\n const { bot, firestore } = createDeps();\n\n const scenes = require('./commands/index').map(({ scene }) => scene({\n Scenes,\n Markup,\n Composer,\n firebaseAdmin,\n firestore\n }));\n const stage = new Scenes.Stage(scenes);\n\n bot.use(session());\n bot.use(stage.middleware());\n bot.start((ctx) => ctx.reply('Привет 👋! Чтобы узнать список доступных команд напиши /help'));\n\n require('./commands/index').forEach((command) => {\n bot.command(command.name, (ctx) => ctx.scene.enter(command.name));\n });\n\n bot.launch();\n console.log('🤖 Bot launched!');\n\n require('./events/index').forEach((cronEvent) => {\n const task = cron.schedule(cronEvent.time, () => cronEvent.handler({\n firestore,\n bot,\n table,\n }));\n\n process.once('SIGINT', () => task.stop());\n process.once('SIGTERM', () => task.stop());\n });\n\n // Enable graceful stop\n process.once('SIGINT', () => bot.stop('SIGINT'));\n process.once('SIGTERM', () => bot.stop('SIGTERM'));\n}", "async function setupServer() {\n try {\n await connectDatabase(mongoURI);\n\n await initBots().then(() => {\n console.log('All bots initialized');\n });\n } catch (err) {\n if (process.NODE_ENV !== 'production') console.log(err);\n process.exit(0);\n }\n}", "static async runBot()\n {\n const bot = new Discord.Client({ intents: [Discord.GatewayIntentBits.Guilds, Discord.GatewayIntentBits.GuildMessages, Discord.GatewayIntentBits.MessageContent] });\n\n bot.once(Discord.Events.ClientReady, () =>\n {\n console.log('Bot initialized');\n try\n {\n Scheduled.start(bot.emojis.cache, bot.channels.cache, bot.user.id, auth.postChannelIds);\n console.log('Scheduled message initialized');\n }\n catch (error)\n {\n console.log('Unable to initialize scheduled messages');\n console.log(error);\n }\n });\n\n bot.on(Discord.Events.InteractionCreate, async (interaction) =>\n {\n try\n {\n Commands.handleSlashCommand(interaction);\n }\n catch (error)\n {\n console.log('Unable to handle interaction');\n console.log(error);\n }\n });\n\n bot.on(Discord.Events.MessageCreate, async (message) =>\n {\n try\n {\n Messages.handleMessage(message, auth.respondChannelIds);\n }\n catch (error)\n {\n console.log('Unable to handle message');\n console.log(error);\n }\n });\n\n try\n {\n //Start Bot\n await bot.login(auth.token);\n }\n catch (error)\n {\n console.log('Unable to start bot');\n console.log(error);\n process.exit();\n }\n\n try\n {\n //Register Slash commands\n const botREST = new Discord.REST().setToken(auth.token);\n botREST.put(\n Discord.Routes.applicationCommands(auth.clientId),\n { body: Commands.registrationArray() },\n );\n console.log('Slash commands initialized');\n }\n catch (error)\n {\n console.log('Unable to register slash command');\n console.log(error);\n process.exit();\n }\n }", "function startBot () {\n _botUi.message.bot({\n delay: 500,\n content: \"🙍🏻 Hello, how can I help today?\"\n }).then(function () {\n return _botUi.action.button({\n delay: 100,\n action: [{\n icon: 'check',\n text: 'Lets proceed',\n value: 'yes'\n }, {\n icon: 'times',\n text: 'No thanks',\n value: 'no'\n }]\n })\n }).then(function (res) {\n if (res.value === 'yes') {\n // start the main loop\n chat()\n } else {\n _botUi.message.add({\n type: 'html',\n content: icon('frown-o') + ' Another time perhaps'\n })\n }\n })\n}", "start() {\n this.connectionManager.connect().catch((err) => {\n logger.error('Unable to start the bot %j', err);\n });\n }", "async function discordSetup() {\n\t// Discord Setup Prompts\n\tconsole.clear();\n\tprogressLog(\"Now Setting Up Discord Portion\");\n\tenvConfig.DISCORD_TOKEN = await ask({\n\t\tmessage: \"Enter In Your Discord Bot Token (You can find this in the Discord Developer Portal): \",\n\t\tvalidate: DiscordSetup.testToken\n\t});\n\tprogressLog(\"Discord Bot Token Valid\");\n\tawait anyKey(\"Add The Discord Bot To The Logging Server/Guild And Press Enter To Continue\");\n\tprogressLog(`The Bot Is In ${DiscordSetup.client.guilds.cache.size} Servers`);\n\tenvConfig.DISCORD_GUILD_ID = await ask({\n\t\ttype: \"select\",\n\t\tmessage: \"Logging Server/Guild ID: \",\n\t\thint: \"Use the arrows to select the target server from this list. Enter once if they do not work.\",\n\t\tinitial: 0,\n\t\tchoices: DiscordSetup.client.guilds.cache.map(guild => {\n\t\t\treturn {\n\t\t\t\ttitle: `[${guild.id}] ${guild.name}`,\n\t\t\t\tvalue: guild.id\n\t\t\t};\n\t\t})\n\t});\n\tDiscordSetup.setLoggingGuild(envConfig.DISCORD_GUILD_ID);\n\tprogressLog(`Selected [${DiscordSetup.getLoggingGuild().name}] As The Logging Server`);\n\tprogressLog(\"Testing Permissions on Server\");\n\tif(!DiscordSetup.getGuildMe().hasPermission(\"ADMINISTRATOR\")) warningLog(\"The Bot Does Not Have ADMINISTRATOR Permissions.\\nGrant The Bot ADMINISTRATOR Permissions Before The Next Step For An Easier Setup\");\n\tawait anyKey(\"Press Enter To Check Permissions\", DiscordSetup.testPerms);\n\tprogressLog(\"Discord Bot Has Been Successfully Set Up\");\n}", "function setupDefaultBot() {\r\n bot = {\r\n root: args.root,\r\n restrictedMode: false,\r\n outputLevel: 'regular',\r\n channel: {}\r\n }\r\n}", "function startBot() {\n log(\"Bot not yet done\");\n}", "function Bot$start(){\n if(this.client == null){\n this.createServer();\n this.createClient();\n \n }\n}", "async function setup() {\n\tprogressLog(\"Beginning Setup Process\");\n\tawait fsSetup();\n\tawait discordSetup();\n\tawait slackSetup();\n\tprogressLog(\"Now Connecting To Slack\\nAttempting To Listen To Messages\");\n\t// TODO: Test file downloading and message reading\n\n\t// End Messages\n\twarningLog(\"Note: Database functions have not been tested. Assume the database to be fine if the first message sends successfully\")\n\tprogressLog(\"Saving Data To .env File\");\n\tsaveEnv();\n\tprogressLog(\"Successfully Saved!\");\n}", "function setup(){\n background();\n quad = new BotCon(300,300);\n quad.bot.log(' - Initial Position');\n}", "async function main() {\n const bot = new MWBot({\n apiUrl: `${baseUrl}/w/api.php`\n });\n await bot.loginGetEditToken({\n username: botUserName,\n password: botPassword\n });\n\n\n try {\n let response = await bot.edit(`User:${botUserName}/sandbox/HelloWorld`,\n `Hello World! Congrats, you have created a bot edit. Now head to [[WP:Bots]] to find information on how to get your bot approved and running!`,\n `Edit from a bot called [[User:${botUserName}]] built with #mwbot`);\n console.log(`Success`, response);\n console.log(`Now visit on your browser to see your edit: ${baseUrl}/wiki/User:${botUserName}/sandbox/HelloWorld`);\n // Success\n } catch (err) {\n console.warn(`Error`, err);\n }\n}", "function setBot(mainBot) {\n bot = mainBot;\n}", "static run() {\n return __awaiter(this, void 0, void 0, function* () {\n // Boot master bot that will manage all other bots in the codebase.\n yield BotManager.bootMasterBot();\n // Some more flavor.\n yield Morgana_1.Morgana.success(\"Booted the master bot, {{bot}}!\", { bot: Core_1.Core.settings.config.bots.master });\n // Boot auto-boot bots.\n // Some bots are set up for auto-booting. We'll handle those too.\n yield BotManager.bootAutoBoots();\n });\n }", "function setupBot(name, selector) {\n $( selector ).click( function activator() {\n console.log( \"Activating: \" + name );\n } );\n}", "function startUp() {\n\t\tconnectAPI();\n\t\tisIBotRunning = true;\n\t\t$(\"#chat-txt-message\").attr(\"maxlength\", \"99999999999999999999\");\n\t\tAPI.sendChat(IBot.iBot + \" Started!\");\n\t}", "setupClient() {\n this.client.on('message', (message) => {\n if (this.pingCommand.isMatch(message))\n this.pingCommand.execute();\n else if (this.githubCommand.isMatch(message))\n this.githubCommand.execute();\n else if (this.randomNumberCommand.isMatch(message))\n this.randomNumberCommand.execute();\n else if (this.commandListCommand.isMatch(message))\n this.commandListCommand.execute();\n });\n }", "async function slackSetup() {\n\tconsole.clear();\n\t// Default\n\tenvConfig.SLACK_DOWNLOAD_ACCESS_TOKEN_CHOICE = \"SLACK_BOT_USER_OAUTH_ACCESS_TOKEN\";\n\tprogressLog(\"Now Setting Up Slack App Portion\");\n\tprogressLog(\"Go to the Slack Developer page for the Slack App\");\n\tenvConfig.SLACK_USER_OAUTH_ACCESS_TOKEN = await ask({\n\t\tmessage: \"Enter In The Slack User OAuth Access Token (Starts with 'xoxp-'): \",\n\t\tvalidate: promptResult => SlackSetup.testOAuthToken(promptResult, false)\n\t});\n\tprogressLog(`Using User OAuth Token from [${SlackSetup.getAuth().user}] for Workspace [${SlackSetup.getAuth().team}]`);\n\tconst team = { name: SlackSetup.getAuth().team, id: SlackSetup.getAuth().team_id };\n\tenvConfig.SLACK_BOT_USER_OAUTH_ACCESS_TOKEN = await ask({\n\t\tmessage: \"Enter In The Slack Bot User OAuth Access Token (Starts with 'xoxb-'): \",\n\t\tvalidate: promptResult => SlackSetup.testOAuthToken(promptResult, true)\n\t});\n\tprogressLog(`Using Bot User OAuth Token from [${SlackSetup.getAuth().user}] for Workspace [${SlackSetup.getAuth().team}]`);\n\tif(SlackSetup.getAuth().team_id !== team.id) warningLog(`WARNING: Workspaces Don't Match!\\nThe User OAuth Token Is For [${team.name}] While The Bot User OAuth Token Is For [${SlackSetup.getAuth().team}]\\nFix this in the .env file later. As long as the Bot User OAuth token is correct, there is a chance that this will not affect the code (Worst case: Files will not be downloaded from Slack and the default png will be shown instead)`);\n\n\tlet validSigningSecret = false;\n\twhile(validSigningSecret !== true) {\n\t\tif(typeof validSigningSecret === \"string\") warningLog(validSigningSecret);\n\t\tenvConfig.SLACK_SIGNING_SECRET = await ask({\n\t\t\tmessage: \"Enter In The Signing Secret (Found on the main page): \",\n\t\t\tvalidate: promptResult => /[\\da-fA-F]+/.test(promptResult) || \"The Signing Secret Must Only Contain Letters And Numbers\"\n\t\t});\n\t\tprogressLog(`Signing with ${envConfig.SLACK_SIGNING_SECRET}\\nSend a message to a Slack channel to continue...\\n(Time Limit: 30 Seconds)`);\n\t\tvalidSigningSecret = await SlackSetup.testMessaging(envConfig.SLACK_SIGNING_SECRET);\n\t}\n\tprogressLog(\"Will Now Attempt To Download A File From Slack With Bot Token. Send Any Image To Slack To Continue...\");\n\tawait SlackSetup.testDownload(envConfig.SLACK_BOT_USER_OAUTH_ACCESS_TOKEN);\n\tawait anyKey(\"Double Check And Press Any Key To Finish Setup\");\n}", "async connect() {\n Channel.botMessage('Welcome to Routefusion Chat!\\n\\n');\n this.user = await this.setUser();\n this.greetUser();\n }", "function startServer() {\n controller.ready(async () => {\n console.log(`\\nBotkit App is Running!\\n`);\n botHelpers(bot)\n .getChannels({})\n .then(channels => log(\"Loaded Channels:\", channels))\n .catch(console.error);\n const subscriptions = await subscription.getSubscriptions();\n cache.setChannelSubscriptions(subscriptions);\n log(\"Found Subscriptions:\", subscriptions);\n\n skills(controller);\n commands(controller);\n });\n\n let server = null;\n if (controller.webserver) {\n server = controller.webserver;\n\n /**\n * This module implements the oauth routes needed to install an app\n */\n server.get(\"/install\", (req, res) => {\n // getInstallLink points to slack's oauth endpoint and includes clientId and scopes\n res.redirect(controller.adapter.getInstallLink());\n });\n\n server.get(\"/install/auth\", async (req, res) => {\n log(\"Auth Requested\");\n try {\n const results = await controller.adapter.validateOauthCode(\n req.query.code\n );\n\n log(\"FULL OAUTH DETAILS\", JSON.stringify(results));\n\n if (results.bot && results.bot.bot_user_id) {\n await addOrUpdateBot(results);\n }\n if (results.user && results.user.id) {\n await addOrUpdateUser(results);\n }\n\n // // Store token by team in bot state.\n tokenCache[results.team_id] = results.bot.bot_access_token;\n\n // // Capture team to bot id\n userCache[results.team_id] = results.bot.bot_user_id;\n\n res.json(\"Success! Bot installed.\");\n } catch (err) {\n console.error(\"OAUTH ERROR:\", err);\n res.status(401);\n res.send(err.message);\n }\n });\n\n server.get(\"/\", (req, res) => {\n res.send(`This app is running Botkit ${controller.version}.`);\n });\n }\n\n return { server, controller };\n}", "constructor () {\n this.bot = new TelegramBot(process.env.TELEGRAM_TOKEN, { polling: true })\n\n this.sendMessage = this.bot.sendMessage.bind(this.bot)\n\n this.bot.onText(/\\/start/, this.onStart.bind(this))\n this.bot.onText(/\\/stop/, this.onStop.bind(this))\n this.bot.onText(/\\/test/, this.onTest.bind(this))\n this.bot.on('polling_error', this.onError.bind(this))\n }", "function extend() {\n //If the bot hasn't been loaded properly, try again in 1 second(s).\n if (!window.bot) {\n return setTimeout(extend, 1 * 1000);\n }\n\n //Precaution to make sure it is assigned properly.keni\n var bot = window.bot;\n\n //Load custom settings set below\n bot.retrieveSettings();\n\n /*\n Extend the bot here, either by calling another function or here directly.\n Model code for a bot command:\n bot.commands.commandCommand = {\n command: 'cmd',\n rank: 'user/bouncer/mod/manager',\n type: 'startsWith/exact',\n functionality: function(chat, cmd){\n if(this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if( !bot.commands.executable(this.rank, chat) ) return void (0);\n else{\n //Commands functionality goes here.\n }\n }\n }\n */\n\n bot.commands.baconCommand = {\n command: 'bacon', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me Bacon!!!\");\n }\n }\n },\n \n bot.commands.wheelCommand = {\n command: 'wheel', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"(◉◡◔)ノ✇ FORSEN TAKE THE WHEEL (◉◡◔)ノ✇, ✇ノ(◔◡◉) ןǝǝɥʍ ǝɥʇ ʞooʇ uǝsɹoɟ ✇ノ(◔◡◉)\");\n }\n }\n },\n \n bot.commands.gachitrainCommand = {\n command: 'gachitrain', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/Hfm6ZUZ.png\");\n }\n }\n },\n bot.commands.commandCommand = {\n command: 'command', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://pastebin.com/U4hS11n3\");\n }\n }\n },\n \n bot.commands.krippCommand = {\n command: 'kripp', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/3m5pyz2.png\");\n }\n }\n },\n \n bot.commands.goran3Command = {\n command: 'goran3', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/NPdluOP.png\");\n }\n }\n },\n \n bot.commands.darudeCommand = {\n command: 'darude', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/TahTzfD.png\");\n }\n }\n },\n \n bot.commands.ktv3Command = {\n command: 'ktv3', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/F5UE61u.png\");\n }\n }\n },\n \n bot.commands.ktv2Command = {\n command: 'ktv2', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/BraCqeP.png\");\n }\n }\n },\n \n bot.commands.hp3Command = {\n command: 'hp3', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/jc5KJYS.png\");\n }\n }\n },\n \n bot.commands.jep4Command = {\n command: 'jep4', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/SGaexzU.png\");\n }\n }\n },\n \n bot.commands.blastoiseCommand = {\n command: 'blastoise', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\":wix1::wix2::wix1::wix2::wix1::wix2:ᅠᅠᅠᅠ :wix3::wix4::wix3::wix4::wix3::wix4:\");\n }\n }\n },\n \n bot.commands.blastoise2Command = {\n command: 'blastoise2', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\":wix1::wix2::wix1::wix2::wix1::wix2:ᅠᅠᅠᅠ :wixbrix::wixbrix::wixbrix::wixbrix::wixbrix::wixbrix:\");\n }\n }\n },\n\n \n \n bot.commands.yukiCommand = {\n command: 'yuki', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me (◕‿◕✿) YUKI YUKI (◕‿◕✿)\");\n }\n }\n },\n \n bot.commands.greenshotCommand = {\n command: 'greenshot', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me Stop Using Gyazo and Start Using Greenshot :swiftrage::swiftrage::swiftrage: Start the Revolution http://sourceforge.net/projects/greenshot/\");\n }\n }\n },\n \n bot.commands.snusCommand = {\n command: 'snus', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/xgBqXMn.gif\");\n }\n }\n },\n \n bot.commands.melCommand = {\n command: 'mel', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/Jt3d1d2.png\");\n }\n }\n },\n \n bot.commands.hp2Command = {\n command: 'hp2', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://imgur.com/othi9il\");\n }\n }\n },\n \n bot.commands.gor2Command = {\n command: 'gor2', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/17FeUtG.png\");\n }\n }\n },\n \n bot.commands.hydraCommand = {\n command: 'hydra', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me https://i.imgur.com/d9OZevs.png\");\n }\n }\n },\n \n bot.commands.dogCommand = {\n command: 'dog', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/JitHIzl.png\");\n }\n }\n },\n \n bot.commands.igorCommand = {\n command: 'igor', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/fQ2irIZ.png\");\n }\n }\n },\n \n bot.commands.jep3Command = {\n command: 'jep3', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/pVD2ZJJ.png\");\n }\n }\n },\n \n bot.commands.keniCommand = {\n command: 'keni', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/wD1oEYb.png\");\n }\n }\n },\n \n bot.commands.bossCommand = {\n command: 'boss', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me ༼ ▀̿Ĺ̯▀̿ ̿ ༽ WE ARE BOSS ༼ ▀̿Ĺ̯▀̿ ̿ ༽\");\n }\n }\n },\n \n bot.commands.newfegCommand = {\n command: 'newfeg', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me If you're new to plug.dj Watch this Tutorial: https://www.youtube.com/watch?v=pXIoB9RPl6w\");\n }\n }\n },\n \n \n bot.commands.gorCommand = {\n command: 'gor', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/17FeUtG.png\");\n }\n }\n },\n \n bot.commands.snoopCommand = {\n command: 'snoop', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/hkA5GJr.gif\");\n }\n }\n },\n \n bot.commands.baitCommand = {\n command: 'bait', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/zbl1OON.gif\");\n }\n }\n },\n \n bot.commands.bannerCommand = {\n command: 'banner', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://imgur.com/a/bYuHO\");\n }\n }\n },\n \n bot.commands.tpCommand = {\n command: 'tp', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me https://fungustime.pw/tastyplug/\");\n }\n }\n },\n \n bot.commands.hugCommand = {\n command: 'hug', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/ZGSL7fa.png\");\n }\n }\n },\n \n bot.commands.lunacCommand = {\n command: 'lunac', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/G0HJfqk.gif\");\n }\n }\n },\n \n bot.commands.fingCommand = {\n command: 'fing', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/phr9V7v.png\");\n }\n }\n },\n \n bot.commands.ohmuCommand = {\n command: 'ohmu', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/gNM8cpl.png\");\n }\n }\n },\n \n bot.commands.snfCommand = {\n command: 'snf', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/tRzgqn7.png\");\n }\n }\n },\n \n bot.commands.jackCommand = {\n command: 'jack', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/VF7F5Tf.png\");\n }\n }\n },\n \n bot.commands.psyCommand = {\n command: 'psy', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/r3aDdfY.png\");\n }\n }\n },\n \n bot.commands.ktvCommand = {\n command: 'ktv', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/pWx1tFs.png\");\n }\n }\n },\n \n bot.commands.shrCommand = {\n command: 'shr', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/2o6o9ZP.png\");\n }\n }\n },\n \n bot.commands.assCommand = {\n command: 'ass', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/LlJGcPg.png\");\n }\n }\n },\n bot.commands.jepCommand = {\n command: 'jep', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/MTmwzqE.png\");\n }\n }\n },\n \n bot.commands.jep2Command = {\n command: 'jep2', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/PzRSYkZ.png\");\n }\n }\n },\n \n bot.commands.dealCommand = {\n command: 'deal', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/GCn5BGT.gif\");\n }\n }\n },\n \n bot.commands.victorfm = {\n command: 'victorfm', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me when the bass drop¿\");\n }\n }\n },\n \n bot.commands.tupCommand = {\n command: 'tup', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/hhf39vN.gif\");\n }\n }\n },\n \n bot.commands.rektCommand = {\n command: 'rekt', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me NOT REKT ☐ REKT ☑ \");\n }\n }\n }, \n \n bot.commands.slapCommand = {\n command: 'slap',\n rank: 'user',\n type: 'startsWith',\n cookies: ['Slaps your face with his dick.',\n 'Slaps your ass',\n 'Slaps your face.',\n 'Slaps your face with a fish http://38.media.tumblr.com/13352b0f83d5c06144376c26af1b0a24/tumblr_mh14njBlKV1qzfebyo1_400.gif'\n ],\n getCookie: function () {\n var c = Math.floor(Math.random() * this.cookies.length);\n return this.cookies[c];\n },\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!basicBot.commands.executable(this.rank, chat)) return void (0);\n else {\n var msg = chat.message;\n\n var space = msg.indexOf(' ');\n if (space === -1) {\n API.sendChat(basicBot.chat.eatcookie);\n return false;\n }\n else {\n var name = msg.substring(space + 2);\n var user = basicBot.userUtilities.lookupUserName(name);\n if (user === false || !user.inRoom) {\n return API.sendChat(subChat(basicBot.chat.nousercookie, {name: name}));\n }\n else if (user.username === chat.un) {\n return API.sendChat(subChat(basicBot.chat.selfcookie, {name: name}));\n }\n else {\n return API.sendChat(subChat(basicBot.chat.cookie, {nameto: user.username, namefrom: chat.un, cookie: this.getCookie()}));\n }\n }\n }\n }\n },\n \n bot.commands.nipafaceCommand = {\n command: 'nipaface', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/iKY3GNW.png\");\n }\n }\n },\n \n bot.commands.riggedCommand = {\n command: 'rigged', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me Roulette not even rigged :opieop:\");\n }\n }\n },\n \n bot.commands.hpCommand = {\n command: 'hp', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me heil HornPub :forsensheffy:7:forsensheffy:/\");\n }\n }\n },\n \n bot.commands.forsenCommand = {\n command: 'forsen', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/Iwqr3C0.jpg\");\n }\n }\n },\n \n bot.commands.gravCommand = {\n command: 'grav', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/C4Vt39q.png\");\n }\n }\n },\n \n bot.commands.shr2Command = {\n command: 'shr2', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/Ub1pci4.png\");\n }\n }\n },\n \n bot.commands.jack2Command = {\n command: 'jack2', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/3DtFyUo.png\");\n }\n }\n },\n \n \n bot.commands.grillCommand = {\n command: 'grill', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/ygqbbCz.jpg\");\n }\n }\n },\n \n bot.commands.gachiCommand = {\n command: 'gachi', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/QGuuBTL.gif\");\n }\n }\n },\n \n bot.commands.hp2mand = {\n command: 'hp2', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/gCo4A0m.png\");\n }\n }\n },\n \n bot.commands.krCommand = {\n command: 'kr', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/x4YcuTx.jpg\");\n }\n }\n },\n \n bot.commands.yoshiiCommand = {\n command: 'yoshii', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/gVfApTR.png\");\n }\n }\n },\n \n bot.commands.chatripCommand = {\n command: 'chatrip', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me RIP in peace Chat :kappa:\");\n }\n }\n },\n \n bot.commands.vaxCommand = {\n command: 'vax', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/RlJUTnH.png\");\n }\n }\n },\n \n bot.commands.gayCommand = {\n command: 'gay', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/XiStfc6.png\");\n }\n }\n },\n \n bot.commands.cancerCommand = {\n command: 'cancer', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/7EFlunu.gif\");\n }\n }\n },\n \n bot.commands.sanicCommand = {\n command: 'sanic', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me :sanic: http://i.imgur.com/6hZLwix.gif GOTTA GO FAST!!!!!\");\n }\n }\n },\n \n bot.commands.scotlandCommand = {\n command: 'scotland', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me :scotland: FOREVVVVAAAHHHHH!!!!!\");\n }\n }\n },\n \n bot.commands.wtfCommand = {\n command: 'wtf', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me WHAT IN THE FUCK ARE WE DOING HERE!!!!\");\n }\n }\n },\n \n bot.commands.flyinCommand = {\n command: 'flyin', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me fly in mouth, dafuq i can't see!!\");\n }\n }\n },\n \n bot.commands.fegCommand = {\n command: 'feg', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me You're all faggots :keepo:\");\n }\n }\n },\n \n bot.commands.notgayCommand = {\n command: 'notgay', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me not gay at all :kappa:\");\n }\n }\n },\n \n bot.commands.lolCommand = {\n command: 'lol', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me LoL is for roleplayers :keepo:\");\n }\n }\n },\n \n bot.commands.notsanicCommand = {\n command: 'notsanic', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me not :sanic: :kappa:\");\n }\n }\n },\n \n bot.commands.fatdarudeCommand = {\n command: 'fatdarude', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/S5UL4NB.jpg\");\n }\n }\n },\n \n bot.commands.ruckaCommand = {\n command: 'rucka', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me rucka rucka :dansgame:\");\n }\n }\n },\n \n bot.commands.clapCommand = {\n command: 'clap', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/urrL82C.gif\");\n }\n }\n },\n \n bot.commands.kevCommand = {\n command: 'kev', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/AhdgaqK.png\");\n }\n }\n },\n \n bot.commands.winCommand = {\n command: 'win', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me http://i.imgur.com/WmRiO.gif\");\n }\n }\n },\n \n bot.commands.kolentoCommand = {\n command: 'kolento', //The command to be called. With the standard command literal this would be: !bacon\n rank: 'user', //Minimum user permission to use the command\n type: 'exact', //Specify if it can accept variables or not (if so, these have to be handled yourself through the chat.message\n functionality: function (chat, cmd) {\n if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);\n if (!bot.commands.executable(this.rank, chat)) return void (0);\n else {\n API.sendChat(\"/me :kolentohappy: http://i.imgur.com/nj1dvtu.gif\");\n }\n }\n };\n \n //Load the chat package again to account for any changes\n bot.loadChat();\n\n }", "async function init() {\n debug('[init] setup facebook messenger bots with accounts');\n let defined = new Set();\n\n for (let x of config.accounts) {\n if (!x.pages) continue;\n for (let p of x.pages) {\n // facebook messenger 设置 get start button\n if (defined.has(p.pageId)) continue;\n let me = facebookFactory(p.pageId, x);\n try {\n await me.setGetStartedButton(DV_GET_START_TEXT);\n } catch (error) {\n console.error('setGetStartedButton', error);\n }\n\n // facebook messenger 设置 greeting text\n let defaultLocale = _.get(x, 'localeDefault');\n let greeting = [\n {\n locale: 'default',\n text:\n defaultLocale && x?.chatopera[defaultLocale]?.custom\n ? x['chatopera'][defaultLocale]['custom']?.GREETING_TEXT ||\n DV_GREETING_TEXT\n : DV_GREETING_TEXT,\n },\n ];\n\n if (x.chatopera && typeof x.chatopera === 'object') {\n let locales = Object.keys(x.chatopera);\n for (let y of locales) {\n let g = {\n locale: y,\n text: x.chatopera[y].custom?.GREETING_TEXT,\n };\n if (g.text) greeting.push(g);\n }\n }\n\n try {\n await me.setGreetingText(greeting);\n } catch (error) {\n console.error('setGreetingText', error);\n }\n }\n }\n}", "function InitializeBot()\n{\n\tg_opponent = GetOpponentTeam();\n\tSetExpectPositions();\n\tarrNotAvoiding = [false, false, false, false];\n\tarrAvoidPosition = [null, null, null, null];\n\tfor(var i = 0; i < NUMBER_OF_TANK; i++)\n\t\tarrNotSafePos[i] = new Array();\n}", "async function init() {\n inquirer.prompt(questions).then(async function (answers) {\n try {\n logStatus = answers.status;\n configureAccount(answers.account, answers.key);\n if (answers.existingTopicId != undefined) {\n configureExistingTopic(answers.existingTopicId);\n } else {\n await configureNewTopic();\n }\n /* run & serve the express app */\n runChat();\n } catch (error) {\n log(\"ERROR: init() failed\", error, logStatus);\n process.exit(1);\n }\n });\n}", "function setup() {\n // the SSB_MANIFEST variable is created by /manifest.js, which is loaded before the javascript bundle.\n var ssb = muxrpc(SSB_MANIFEST, false, function (stream) { return Serializer(stream, JSON, {split: '\\n\\n'}) })()\n var localhost = channel.connect(ssb, 'localhost')\n\n // master state object\n window.phoenix = {\n // sbot rpc connection\n ssb: ssb,\n\n // api\n refreshPage: refreshPage,\n setPage: setPage, // :TODO: make internal\n\n // component registry\n add: add,\n get: get,\n getAll: getAll,\n registry: {},\n\n // page params parsed from the url\n page: {\n id: 'feed',\n param: null,\n qs: {}\n },\n\n // ui data\n ui: {\n emojis: [],\n suggestOptions: { ':': [], '@': [] },\n actionItems: null\n // ui helper methods added by `addUi`\n },\n\n // userdata, fetched every refresh\n user: {\n id: null,\n profile: null\n },\n users: {\n names: null,\n nameTrustRanks: null,\n profiles: null,\n link: function (id) { return h('span', com.user(phoenix, id)) }\n },\n\n // for plugins\n h: require('hyperscript'),\n pull: require('pull-stream')\n }\n addUI(phoenix) // add ui methods\n\n // events\n window.addEventListener('hashchange', phoenix.refreshPage)\n window.addEventListener('resize', resizeControls)\n document.body.addEventListener('click', onClick)\n\n // periodically poll and rerender the current connections\n setInterval(pollPeers, 5000)\n\n // emojis\n for (var emoji in emojis) {\n phoenix.ui.emojis.push(emoji)\n phoenix.ui.suggestOptions[':'].push({\n image: '/img/emoji/' + emoji + '.png',\n title: emoji,\n subtitle: emoji,\n value: emoji + ':'\n })\n }\n\n // rpc connection\n localhost.on('connect', function() {\n // authenticate the connection\n auth.getToken(window.location.host, function(err, token) {\n if (err) return localhost.close(), console.error('Token fetch failed', err)\n ssb.auth(token, function(err) {\n phoenix.ui.setStatus(false)\n setupRpcConnection()\n phoenix.refreshPage()\n })\n })\n })\n localhost.on('error', function(err) {\n // inform user and attempt a reconnect\n console.log('Connection Error', err)\n phoenix.ui.setStatus('danger', 'Lost connection to the host program. Please restart the host program. Trying again in 10 seconds.')\n localhost.reconnect()\n })\n localhost.on('reconnecting', function(err) {\n console.log('Attempting Reconnect')\n phoenix.ui.setStatus('danger', 'Lost connection to the host program. Reconnecting...')\n })\n}", "function onInstallation(bot, installer) {\n if (installer) {\n bot.startPrivateConversation({user: installer}, function (err, convo) {\n if (err) {\n console.log(err);\n } else {\n convo.say(\"Hi there, I'm Taylor. I'm a bot that has just joined your team.\");\n convo.say('You can now /invite me to a channel so that I can be of use!');\n }\n });\n }\n}", "async function setUp(){\n //Set current site if known\n var loc = window.location.hostname;\n if(loc.includes(\"twitch.tv\")) {\n config.site=\"twitch\";\n } else if (loc.includes(\"youtube\")){\n config.site=\"youtube\";\n } else if (loc.includes(\"netflix\")){\n config.site=\"netflix\";\n } else if (loc.includes(\"tvthek.orf\")){\n config.site=\"tvthek\"\n }\n log(\"Site matched: \" + config.site);\n\n log(\"Starting search for Video Player\");\n\n getPlayer();\n\n if(myPlayer == null){\n log(\"No video element was ever found.\", L_ERROR);\n throw new Error('No video element was ever found');\n }\n\n log(\"Got Videoplayer\", L_SUCCESS);\n //re-get player in case of dynamic pages (e.g. netflix) on video element mutation\n //TODO untested\n observePlayer(myPlayer);\n\n try{showPbr();} catch (e){log(\"couldnt show pbr\", L_ERROR);}\n try{setVolume(1);} catch (e){log(\"couldnt setVolume\", L_ERROR);}\n if(config.forceFocus){\n try{focusPlayer();} catch (e){log(\"couldnt focus player\", L_ERROR);}\n }\n}", "static build() {\n return __awaiter(this, void 0, void 0, function* () {\n // Await registration of all bots from the application files.\n // Upon error in registration, stop the application.\n yield BotManager.registerAllBotsInDirectory();\n // We'll run preparation handlers for all bots as this should only be done once.\n yield BotManager.prepareAllBots();\n // Some more flavor.\n yield Morgana_1.Morgana.success(\"Bot Manager preparations complete!\");\n });\n }", "function initChat() {\n setConfigurations();\n greet();\n}", "configureClient() {\r\n this.client.on(\"message\", msg => {\r\n var commandRegex = new RegExp(`^${this.config.commandPrefix}((?:.|[\\n\\r])+)`, \"i\")\r\n\r\n if (msg.author.id === this.client.user.id && !this.allowSelfCommands) {\r\n // If bot can't accept messages from itself\r\n return\r\n } else if (msg.author.id !== this.client.user.id && this.config.selfCommandsOnly) {\r\n // Bot can only accept self commands, like a selfbot\r\n return\r\n }\r\n\r\n var match = msg.content.match(commandRegex)\r\n if (match != null) {\r\n var rawCommand = match[1]\r\n\r\n this.executeCommand(rawCommand, msg)\r\n }\r\n })\r\n this.client.on(\"debug\", info => {\r\n if (this.config.debug) {\r\n console.log(`[DEBUG] ${info}`)\r\n }\r\n })\r\n }", "async function starts(){\n\tconst zef = new WAConnection()\n\tzef.logger.level = 'warn'\n\t\n\tzef.on('qr', qr => {\n\t\tqrcode.generate(qr, { small: true })\n\t\tconsole.log(`[!] Scan qrcode dengan whatsapp`)\n\t})\n\n\tzef.on('credentials-updated', () => {\n\t\tconst authinfo = zef.base64EncodedAuthInfo()\n\t\tconsole.log('[!] Credentials Updated')\n\n\t\tfs.writeFileSync('./rizqi.json', JSON.stringify(authinfo, null, '\\t'))\n\t})\n\n\tfs.existsSync('./rizqi.json') && zef.loadAuthInfo('./rizqi.json')\n\n\tzef.on('connecting', () => {\n\t\tconsole.log('Connecting')\n\t})\n\tzef.on('open', () => {\n\t\tconsole.log('Bot Is Online Now!!')\n\t})\n\tzef.connect()\n\n\tzef.on('chat-update', async (msg) => {\n\t\ttry {\n\t\t\tif (!msg.hasNewMessage) return\n\t\t\tmsg = JSON.parse(JSON.stringify(msg)).messages[0]\n\t\t\tif (!msg.message) return\n\t\t\tif (msg.key && msg.key.remoteJid == 'status@broadcast') return\n\t\t\tif (msg.key.fromMe) return\n\t\t\tglobal.prefix\n\t\t\t\n\t\t\tconst from = msg.key.remoteJid\n\t\t\tconst isGroup = from.endsWith('@g.us')\n\t\t\tconst type = Object.keys(msg.message)[0]\n\t\t\tconst id = isGroup ? msg.participant : msg.key.remoteJid\n\n\t\t\tconst { text, extendedText, contact, location, liveLocation, image, video, sticker, document, audio, product } = MessageType\n\n\t\t\tbody = (type === 'conversation' && msg.message.conversation.startsWith(prefix)) ? msg.message.conversation : (type == 'imageMessage') && msg.message.imageMessage.caption.startsWith(prefix) ? msg.message.imageMessage.caption : (type == 'videoMessage') && msg.message.videoMessage.caption.startsWith(prefix) ? msg.message.videoMessage.caption : (type == 'extendedTextMessage') && msg.message.extendedTextMessage.text.startsWith(prefix) ? msg.message.extendedTextMessage.text : ''\n\t\t\tbudy = (type === 'conversation') ? msg.message.conversation : (type === 'extendedTextMessage') ? msg.message.extendedTextMessage.text : ''\n\t\t\t\n\t\t\t const argv = body.slice(1).trim().split(/ +/).shift().toLowerCase()\n\t\t\t const args = body.trim().split(/ +/).slice(1)\n\t\t\t const isCmd = body.startsWith(prefix)\n\n\t\t\t const groupMetadata = isGroup ? await zef.groupMetadata(from) : ''\n\t\t\t const groupName = isGroup ? groupMetadata.subject : ''\n\t\t\t const groupId = isGroup ? groupMetadata.jid : ''\n\t\t\t const isMedia = (type === 'imageMessage' || type === 'videoMessage' || type === 'audioMessage')\n\t\t\t \n\t\t\t const content = JSON.stringify(msg.message)\n\t\t\t \n\t\t\t const isQuotedImage = type === 'extendedTextMessage' && content.includes('imageMessage')\n\t const isQuotedVideo = type === 'extendedTextMessage' && content.includes('videoMessage')\n\t const isQuotedAudio = type === 'extendedTextMessage' && content.includes('audioMessage')\n\t const isQuotedSticker = type === 'extendedTextMessage' && content.includes('stickerMessage')\n\t const isQuotedMessage = type === 'extendedTextMessage' && content.includes('conversation')\n\n\t\t\t const command = msg.message.conversation\n\t if (!isGroup){\n\t \tif (command.includes('/start')){\n\t \t\tawait zef.sendMessage(id, \"Selamat Datang di Anonim Chat bot\\n bot yang digunakan untuk chatting secara anonim buatan Rizqi a.k.a ZefianAlfian\", text, {quoted: msg})\n\t \t} else if (command.includes('/find')){\n\t \t\t// Fungsi untuk mencari partner\n\t \t\tconst isActiveSess = helper.isActiveSession(id , bot)\n\t // Apakah user sudah punya sesi chatting ?\n\t \t\tif(!isActiveSess) {\n\t \t\tawait zef.sendMessage(id , \"Kegagalan Server!\")\n\t \t\t }\n\t \t\t\n\t \t\t// Apakah user udah ada di antrian ?\n\t \t\tconst isQueue = await queue.find({user_id: id})\n\t \t\t if(!isQueue.length){\n\t \t\t // Kalo gak ada masukin ke antrian\n\t \t\t await queue.insert({user_id: id , timestamp: parseInt(moment().format('X'))})\n\t \t\t }\n\t \t\t // Kirim pesan kalo lagi nyari partner\n\t \t\t zef.sendMessage(id , '<i>Mencari Partner Chat ...</i>' , {parse_mode: 'html'})\n\t \t\t // apakah ada user lain yang dalam antrian ?\n\t \t\t var queueList = await queue.find({user_id: {$not: {$eq: id}}})\n\t \t\t // Selama gak ada user dalam antrian , cari terus boss\n\t \t\t while(queueList.length < 1){\n\t \t\t queueList = await queue.find({user_id: {$not: {$eq: id}}})\n\t \t\t }\n\t \t\t\n\t \t\t // Nah dah ketemu nih , ambil user id dari partner\n\t \t\t const partnerId = queueList[0].user_id\n\t \t\t // Ini ngamdil data antrian kamu\n\t \t\t const you = await queue.findOne({user_id: id})\n\t \t\t // Ini ngamdil data antrian partner kamu\n\t \t\t const partner = await queue.findOne({user_id: partnerId})\n\t \t\t\n\t \t\t // Kalo data antrian kamu belum di apus (atau belum di perintah /stop)\n\t \t\t if(you !== null){\n\t \t\t // apakah kamu duluan yang nyari partner atau partnermu\n\t \t\t if(you.timestamp < partner.timestamp){\n\t \t\t // kalo kamu duluan kamu yang mulai sesi , partner mu cuma numpang\n\t \t\t await active_sessions.insert({user1: id,user2:partnerId})\n\t \t\t }\n\t \t\t // Hapus data kamu sama partnermu dalam antrian\n\t \t\t for(let i = 0 ;i < 2;++i){\n\t \t\t const data = await queue.find({user_id: (i > 0 ? partnerId : id)})\n\t \t\t await queue.remove({id: data.id})\n\t \t\t }\n\t \t\t\n\t \t\t // Kirim pesan ke kamu kalo udah nemu partner\n\t \t\t await zef.sendMessage(id , \"Kamu Menemukan Partner chat\\nSegera Kirim Pesan\")\n\t \t}\n\t } else if (isGroup) {\n\t \tif (command.includes('/start')){\n\t \t\tawait zef.sendMessage(from, \"Kamu berada di dalam grup\", text, {quoted:msg})\n\t \t}\n\t }\n} catch (e) {\n\tconsole.log(e)\n\t}\n\t})\n\t}", "async handle() {\r\n await this.client.user.setActivity('TruckersMP', {\r\n url: 'https://truckersmp.com',\r\n type: 'PLAYING',\r\n }).catch(console.error);\r\n\r\n // Load global libraries with managers\r\n const RoleManager = require('../lib/RoleManager.js');\r\n global['roleManager'] = new RoleManager(this.client);\r\n\r\n // Load all emojis to the client so on every reaction the bot does not have to connect to the database\r\n this.client.roles = {};\r\n this.client.guilds.each(async guild => {\r\n this.client.roles[guild.id] = {};\r\n\r\n const roles = await Role.query().where('guild', guild.id);\r\n roleManager.fetchRoles(guild.id, roles);\r\n });\r\n }", "function setupChannel() {\n // Join the general channel\n // generalChannel.getMembers().then(members => {\n // if (members.)\n // })\n\n generalChannel.join().then(function(channel) {\n print('Joined channel as ' + '<span class=\"me\">' + username + '</span>.', true);\n });\n\n // Listen for new messages sent to the channel\n generalChannel.on('messageAdded', function(message) {\n printMessage(message.author, message.body);\n });\n\n generalChannel.on('typingStarted', function(member) {\n console.log('typingStarted', member);\n typingIndicator.text(`${member.identity} is typing...`);\n typingIndicator.show();\n });\n\n generalChannel.on('typingEnded', function(member) {\n console.log('typingEnded', member);\n typingIndicator.hide();\n });\n }", "async function handleMsTeamsReady () {\n try {\n slackBot = await slackController.spawn(process.env.TEAM)\n slackController.on('interactive_message', handleInteractiveMessages)\n slackController.on('dialog_submission', handleDialogSubmission)\n msTeamsController.hears(COMMANDS.REQUEST, 'message,direct_message', handleRequestCommand)\n } catch (e) {\n logger.logFullError(e)\n }\n}", "function onInstallation(bot, installer) {\n if (installer) {\n bot.startPrivateConversation({user: installer}, function (err, convo) {\n if (err) {\n console.log(err);\n } else {\n convo.say('I am a bot that has just joined your team');\n convo.say('You must now /invite me to a channel so that I can be of use!');\n }\n });\n }\n}", "function onInstallation(bot, installer) {\n if (installer) {\n bot.startPrivateConversation({user: installer}, function (err, convo) {\n if (err) {\n console.log(err);\n } else {\n convo.say('I am a bot that has just joined your team');\n convo.say('You must now /invite me to a channel so that I can be of use!');\n }\n });\n }\n}", "function onInstallation(bot, installer) {\n if (installer) {\n bot.startPrivateConversation({user: installer}, function (err, convo) {\n if (err) {\n console.log(err);\n } else {\n convo.say('I am a bot that has just joined your team');\n convo.say('You must now /invite me to a channel so that I can be of use!');\n }\n });\n }\n}", "function onInstallation(bot, installer) {\n if (installer) {\n bot.startPrivateConversation({user: installer}, function (err, convo) {\n if (err) {\n console.log(err);\n } else {\n convo.say('I am a bot that has just joined your team');\n convo.say('You must now /invite me to a channel so that I can be of use!');\n }\n });\n }\n}", "function onInstallation(bot, installer) {\n if (installer) {\n bot.startPrivateConversation({user: installer}, function (err, convo) {\n if (err) {\n console.log(err);\n } else {\n convo.say('I am a bot that has just joined your team');\n convo.say('You must now /invite me to a channel so that I can be of use!');\n }\n });\n }\n}", "setupEvents() {\n this.eventEmitter\n .on('close', () => {\n this.botInterface.emit('close');\n })\n .on('connect', () => {\n this.loadSavedEvents();\n })\n .on('reconnect', () => {\n this.reconnect();\n })\n .on('shutdown', () => {\n this.botInterface.emit('shutdown');\n })\n .on('start', () => {\n this.botInterface.emit('start');\n })\n .on('ping', (args) => {\n this.dispatchMessage(...args);\n })\n .on('message', (args) => {\n this.handleMessage(...args);\n })\n .on('channel', (args) => {\n this.handleChannelEvents(...args);\n })\n .on('user', (args) => {\n this.handleUserEvents(...args);\n })\n .on('team', (args) => {\n this.handleTeamEvents(...args);\n })\n .on('presence', (args) => {\n this.handlePresenceEvents(...args);\n });\n }", "function iniciarBot() {\n\n\treturn new Promise((resolve, reject) => {\n\n\t\t// ChatConnector\n\t\tglobal.CHATCONNECTOR = new builder.ChatConnector({\n\t\t\tappId: process.env.APP_ID,\n\t\t\tappPassword: process.env.APP_LLAVE,\n\t\t\topenIdMetadata: process.env.BotOpenIdMetadata\n\t\t})\n\n\t\t// Datos de configuración de Base de Datos para sesión del bot\n\t\tvar docDbClient = new azure.DocumentDbClient({\n\t\t\thost: process.env.MONGODB_HOST_BOTDATA,\n\t\t\tmasterKey: process.env.MONGODB_LLAVE,\n\t\t\tdatabase: process.env.MONGODB_BASE,\n\t\t\tcollection: process.env.MONGODB_COLECCION_BOT\n\t\t})\n\t\tvar cosmosStorage = new azure.AzureBotStorage({gzipData: false}, docDbClient)\n\n\t\t// Iniciar bot y conversación\n\t\t// Este es el diálogo que usa el bot para responder.\n\t\t// Como esta implementación es sólo para preguntas y respuestas no tiene sistema de diálogos\n\t\tvar bot = new builder.UniversalBot(CHATCONNECTOR, [\n\t\t\t(session, args, next) => {\n\n\t\t\t\t// Mensaje especial de presentación\n\t\t\t\tif ( session.message.type = \"text\" && session.message.text == \"___presentacion___\" ) {\n\t\t\t\t\tobtenerRespuesta(\"sistema:presentacion\")\n\t\t\t\t\t.then((respuesta) => {\n\t\t\t\t\t\tconsole.log(\" Enviando presentación: \" + respuesta)\n\t\t\t\t\t\tsession.send(respuesta)\n\t\t\t\t\t})\n\t\t\t\t\t.catch((error) => {\n\t\t\t\t\t\t\tconsole.log(\" Excepción obteniendo la presentación desde la base de datos\")\n\t\t\t\t\t\t\tconsole.log(error)\n\t\t\t\t\t})\n\n\t\t\t\t// Otros mensajes de texto (preguntas y respuestas)\n\t\t\t\t} else if ( session.message.type = \"text\" && typeof session.message.text != \"undefined\" ) {\n\t\t\t\t\t// Envío el mensaje al servicio de LUIS para detectar la intención\n\t\t\t\t\trp({\n\t\t\t\t\t\tmethod: \"GET\",\n\t\t\t\t\t\turi: \"https://\" + process.env.LUIS_UBICACION + \".api.cognitive.microsoft.com/luis/v2.0/apps/\" + process.env.LUIS_ID_APLICACION + \"?subscription-key=\" + process.env.LUIS_LLAVE + \"&verbose=true&timezoneOffset=\" + process.env.LUIS_DIFERENCIA_HORA + \"&q=\" + session.message.text\n\t\t\t\t\t})\n\t\t\t\t\t.then((respuesta_luis) => {\n\t\t\t\t\t\t// Parseo y verifico la respuesta\n\t\t\t\t\t\trespuesta_luis = respuesta_luis ? JSON.parse(respuesta_luis) : null\n\t\t\t\t\t\tvar intencion = null\n\t\t\t\t\t\tif ( respuesta_luis && typeof respuesta_luis.topScoringIntent != \"undefined\" && respuesta_luis.topScoringIntent.intent != \"None\" ) {\n\t\t\t\t\t\t\tintencion = respuesta_luis.topScoringIntent.intent\n\t\t\t\t\t\t} else if ( respuesta_luis ) {\n\t\t\t\t\t\t\t// LUIS me respondió pero no pude detectar la intención, respondo \"no te entendí\"\n\t\t\t\t\t\t\tconsole.log(\" No pude detectar la intención del mensaje usando LUIS\")\n\t\t\t\t\t\t\tintencion = \"sistema:no_te_entendi\"\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// El servicio de LUIS no me respondió o hubo un error, respondo \"tuve un problema\"\n\t\t\t\t\t\t\tconsole.log(\" No obtuve una respuesta de LUIS\")\n\t\t\t\t\t\t\tintencion = \"sistema:tuve_un_problema\"\n\t\t\t\t\t\t}\n\t\t\t\t\t\tobtenerRespuesta(intencion)\n\t\t\t\t\t\t.then((respuesta) => {\n\t\t\t\t\t\t\tLOGGER.pregunta({\n\t\t\t\t\t\t\t\t\"usuario\": {\n\t\t\t\t\t\t\t\t\tid: session.message.address.user.id,\n\t\t\t\t\t\t\t\t\tnombre: session.message.address.user.name\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\"canal\": session.message.address.channelId,\n\t\t\t\t\t\t\t\t\"direccion\": session.message.address,\n\t\t\t\t\t\t\t\t\"textoPregunta\": session.message.text,\n\t\t\t\t\t\t\t\t\"luis\": respuesta_luis,\n\t\t\t\t\t\t\t\t\"textoRespuesta\": respuesta,\n\t\t\t\t\t\t\t\t\"fecha\": new Date()\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\tconsole.log(\" Enviando respuesta: \" + respuesta)\n\t\t\t\t\t\t\tsession.send(respuesta)\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.catch((error) => {\n\t\t\t\t\t\t\t console.log(\" Excepción obteniendo la respuesta a la intención\")\n\t\t\t\t\t\t\t console.log(error)\n\t\t\t\t\t\t})\n\t\t\t\t\t})\n\t\t\t\t\t.catch((ex) => {\n\t\t\t\t\t\tconsole.log(\" Error! Excepción no capturada en el código de pregunta\")\n\t\t\t\t\t\tLOGGER.sistema(\"ERROR\",\"DIALOGO\", \"Chatbot \" + process.env.BOT_NOMBRE + \" no pudo iniciar normalmente\", {\"fecha\": new Date(), \"excepcion\": ex})\n\t\t\t\t\t\tconsole.log(ex)\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log(\" Mensaje no es texto\")\n\t\t\t\t}\n\t\t\t}\n\t\t])\n\t\t.set(\"storage\", cosmosStorage)\n\n\t\tresolve(bot)\n\t})\n}", "setBot(bot) {\n this.bot = bot;\n }", "startServer() {\n\t\t\n\t\tthis._game.startGame();\n\t\t\n\t\tthis._server = new WebSocketServer({port: config['port'], path: config['path']}, function () {\n\t\t\tconsole.log('[SERVER] Server Started at 127.0.0.1:' + config['port'] + '! Waiting for Connections...');\n\t\t\t//console.log(\"[BOTS] Bot Status: Bot's are currently unavailable! Please try again later.\");\n\t\t\t//console.log('[BOTS] Creating ' + config['bots'] + ' bots!');\n\t\t\t//console.log('[BOTS] Bots successfully loaded: ' + botCount + (botCount === 0 ? \"\\n[BOTS] Reason: Bot's aren't implemented yet. Please try again later\" : ''));\n\t\t});\n\n\t\tif (this._server.readyState === this._server.OPEN) {\n\t\t\tthis._server.on('connection', this.onConnection.bind(this));\n\t\t} else {\n\t\t\tconsole.log(this._server.readyState);\n\t\t}\n\t}", "function setup() {\n var IPTiddler = $tw.wiki.getTiddler(\"$:/ServerIP\");\n var IPAddress = IPTiddler.fields.text;\n $tw.socket = new WebSocket(`ws://${IPAddress}:8000`);\n $tw.socket.onopen = openSocket;\n $tw.socket.onmessage = parseMessage;\n $tw.socket.binaryType = \"arraybuffer\";\n\n addHooks();\n }", "execute(message,args){\n //bot replys hello friend\n message.reply(' Welcome to math bot :)')\n }", "function setupChannel() {\n\n // Join the control channel\n controlChannel.join().then(function(channel) {\n print('Joined controlchannel as '\n + '<span class=\"me\">' + username + '</span>.', true);\n });\n\n // Listen for new messages sent to the channel\n controlChannel.on('messageAdded', function(message) {\n printMessage(message.author, message.body);\n console.log('lenis')\n test();\n //printcontrol()\n if (message.body.search(\"@anon\")>=0)\n {\n $.get( \"alch/\"+message.body, function( data ) {\n\n console.log(data);\n });\n }\n else if (message.body.search(\"@time\")>=0)\n {\n\n test();\n // var date=new Date().toLocaleString();\n // controlChannel.sendMessage(date);\n\n }\n else if (message.body.search(\"@junk\")>=0)\n {\n console.log(\"penis\");\n// test();\n }\n\n\n });\n }", "function setupChannel() {\n // Join the general channel\n chatChannel.join().then(function(channel) {\n print('Joined channel as <span class=\"me\">' + username + '</span>.', true);\n });\n\n // Listen for new messages sent to the channel\n chatChannel.on('messageAdded', function(message) {\n printMessage(message.author, message.body);\n });\n }", "function welcome(agent){\n agent.add(getTelegramButtons(\"Welcome to Big Brother! I'm responsible for taking care of your apps! Here's what you can do with me:\", actions));\n}", "function onInstallation(bot, installer) {\n if (installer) {\n bot.startPrivateConversation({user: installer}, function (err, convo) {\n if (err) {\n console.error(err)\n } else {\n convo.say('I am a bot that has just joined your team')\n convo.say('You must now /invite me to a channel so that I can be of use!')\n }\n })\n }\n}", "function init() {\n console.log(\"****************************************************************************\")\n console.log(\"*******************Application Start: Team Profile Generator****************\")\n console.log(\"****************************************************************************\")\n inquirer.prompt(managerQuestions)\n .then(createManager)\n}", "async run(bot, message, settings) {\n\t\tconst embed = this.createEmbed(bot, message.guild, settings);\n\t\tmessage.channel.send({ embeds: [embed] });\n\t}", "constructor(cmdParams, botClient, msg) {\n super(cmdParams, botClient, msg);\n //class based variable initialization\n this.channelId = '';\n this.friendlyChannelName = '';\n this.joinLink = 'https://www.youtube.com/watch?v=KLIiGMMMf-E';\n //this.joinLink = 'https://youtu.be/MvlGLx4M1cw';\n this.leaveLink = 'https://youtu.be/7NFwhd0zsHU';\n this.audioPlayer = new AudioPlayer(botClient);\n this.dateService = new DateService();\n }", "async setup() {\n this.hooks = await this.github.genHooks();\n this.is_setup = true;\n }", "function setupChannel() {\n // Join the general channel\n generalChannel.join().then(function(channel) {\n print('Joined channel as '\n + '<span class=\"me\">' + username + '</span>.', true);\n });\n\n // Listen for new messages sent to the channel\n generalChannel.on('messageAdded', function(message) {\n printMessage(message.author, message.body);\n });\n }", "setupIntefaceEvents() {\n this.interfaceEventEmitter.on('injectMessage', (message) => {\n this.injectMessage(message);\n });\n\n this.interfaceEventEmitter.on('shutdown', () => {\n this.shutdown();\n });\n\n this.interfaceEventEmitter.on('restart', () => {\n this.close();\n });\n\n this.interfaceEventEmitter.on('close', () => {\n this.close();\n });\n\n this.interfaceEventEmitter.on('start', () => {\n this.start();\n });\n\n this.botInterface = new BotInterface(\n {\n getBotName: () => {\n return this.getBotName();\n },\n getId: () => {\n return this.getId();\n },\n getUserProfile: (identifiers, options) => {\n return this.getSlackUserProfile(identifiers, options);\n },\n },\n this.interfaceEventEmitter\n );\n }", "function setup() {\n \n // create an HL app to start retrieving kinect datas\n // and automatically call the function update, onUserIn and onUserOut\n app = new HL.App();\n\n // set it up with our project's metadatas\n app.setup({\n projectName : 'Ball Bounce',\n author1 : 'Prenom Nom',\n author2 : 'Prenom Nom'\n });\n\n setupBall();\n setupObstacles();\n}", "function start() {\n\tvar TWITTER_CONSUMER_KEY = \"\"; // Apply for these values at dev.twitter.com\n\tvar TWITTER_CONSUMER_SECRET = \"\";\n\tvar TWITTER_HANDLE = \"\";\n\t\n\tScriptProperties.setProperty(\"TWITTER_CONSUMER_KEY\", TWITTER_CONSUMER_KEY);\n\tScriptProperties.setProperty(\"TWITTER_CONSUMER_SECRET\", TWITTER_CONSUMER_SECRET);\n\tScriptProperties.setProperty(\"TWITTER_HANDLE\", TWITTER_HANDLE);\n\t\t\n\tvar triggers = ScriptApp.getScriptTriggers();\n\tfor (var i=0; i < triggers.length; i++) {\n\t\tScriptApp.deleteTrigger(triggers[i]); } // Clear existing triggers first\n\t\t\n\tScriptApp.newTrigger(\"setupTweet\").timeBased().everyMinutes(1).create(); }", "async function init() {\n try {\n const userResponses = await inquirer.prompt(questions);\n\n // Referencing API.js\n const userInfo = await api.getUser(userResponses);\n\n // Pass inquirer data and api data to markdown\n const markdown = generateMarkdown(userResponses, userInfo);\n\n // Write markdown\n await writeFileAsync('ExampleREADME.md', markdown);\n\n console.log('Successfully wrote to README.md');\n\n }\n catch (error) {\n console.log(error);\n }\n}", "async function activate(context) {\n const twitcherConfig = workspace.getConfiguration('twitcher')\n\n if (!twitcherConfig.enabled) return\n //#region config\n const twitchConfig = await startupConfig()\n\n if (!twitchConfig.oauth) {\n const askForOAuth = await window.showErrorMessage(\n 'Please Enter a Oauth token for twitch',\n { title: 'Enter Oauth' }\n )\n\n if (askForOAuth) {\n const twitchOAuth = await inputCommands.twitchChatOAuth()\n if (twitchOAuth) {\n localConfig.set(TWITCH_CHAT_OAUTH, twitchOAuth)\n twitchConfig.oauth = twitchOAuth\n }\n }\n }\n\n const twitchChatConfig = {\n options: {\n debug: twitcherConfig.debug\n },\n connection: {\n reconnect: true\n },\n identity: {\n username: twitcherConfig.username,\n password: twitchConfig.oauth\n },\n channels: [`#${twitcherConfig.channel}`]\n }\n //#endregion\n\n /**\n * Initalize\n */\n const bot = new Tmi.client(twitchChatConfig)\n const twitchStatusBar = new TwitchStatusBar(twitcherConfig)\n const twitchApi = new TwitchApi(twitchConfig.clientID)\n\n let soundFile = false\n if (typeof twitcherConfig.notificationSound !== 'boolean') {\n soundFile = resolve(twitcherConfig.notificationSound)\n } else if (twitcherConfig.notificationSound) {\n soundFile = resolve(\n __dirname,\n '..',\n 'resources',\n 'audio',\n 'new_message.wav'\n )\n }\n const notification = new Notification(soundFile)\n bot.connect()\n\n /**\n * Register Data provider\n */\n const twitcherExplorerProvider = new TwticherExplorerProvider()\n window.registerTreeDataProvider('twitcher', twitcherExplorerProvider)\n if (twitcherConfig.counterUpdateInterval) {\n viewerCountUpdater = setInterval(() => {},\n ms(twitcherConfig.counterUpdateInterval))\n }\n\n //#region Register Commands\n const clearConfig = commands.registerCommand('twitcher.clearConfig', () => {\n localConfig.clear()\n })\n context.subscriptions.push(clearConfig)\n\n const switchToChatCommand = commands.registerCommand(\n 'twitcher.switchToChat',\n () => {\n twitcherExplorerProvider.enableChat()\n }\n )\n context.subscriptions.push(switchToChatCommand)\n const oAuthCommand = commands.registerCommand(\n 'twitcher.setOAuth',\n async () => {\n const oAuthToken = await inputCommands.twitchChatOAuth()\n if (oAuthToken) {\n localConfig.set(TWITCH_CHAT_OAUTH, oAuthToken)\n window.showInformationMessage('Twitch OAuth updated')\n }\n }\n )\n context.subscriptions.push(oAuthCommand)\n const clientIDCommand = commands.registerCommand(\n 'twitcher.setClientID',\n async () => {\n const twitchClientID = await inputCommands.twitchClientID()\n if (twitchClientID) {\n localConfig.set(TWITCH_CLIENT_ID, twitchClientID)\n window.showInformationMessage('Twitch Client-ID updated')\n }\n }\n )\n context.subscriptions.push(clientIDCommand)\n\n const explorerReplyCommand = commands.registerCommand(\n 'twitcher.explorerReply',\n async context => {\n const userName = `@${context.label.split(':')[0]}`\n const reply = await window.showInputBox({\n prompt: userName\n })\n\n if (!reply) return\n bot.say(twitcherConfig.channel, `${userName} ${reply}`)\n }\n )\n context.subscriptions.push(explorerReplyCommand)\n\n if (twitchConfig.clientID) {\n const refreshCommand = commands.registerCommand(\n 'twitcher.refreshViewerCount',\n async () => {\n const viewerCount = await twitchApi.getViewerCount()\n twitchStatusBar.setNewCounter(viewerCount)\n }\n )\n context.subscriptions.push(refreshCommand)\n }\n\n const switchToUserListCommand = commands.registerCommand(\n 'twitcher.switchToUserList',\n async () => {\n twitcherExplorerProvider.showLoading('Loading User list')\n const userlist = await twitchApi.getViewerList()\n twitcherExplorerProvider.hideLoading()\n twitcherExplorerProvider.loadUserList(userlist)\n twitchStatusBar.setNewCounter(userlist.length)\n }\n )\n context.subscriptions.push(switchToUserListCommand)\n const sendCommand = commands.registerCommand(\n 'twitcher.sendMessage',\n async () => {\n try {\n const message = await window.showInputBox({\n placeHolder: 'Message to send'\n })\n\n if (message) {\n bot.say(twitcherConfig.channel, message)\n }\n } catch (error) {\n console.error('Failed to send Message', error)\n window.showErrorMessage('Failed to Send Message')\n }\n }\n )\n\n context.subscriptions.push(sendCommand)\n //#endregion\n bot.on('connected', () => {\n commands.executeCommand('twitcher.refreshViewerCount')\n window.showInformationMessage(`Connected to: ${twitcherConfig.channel}`)\n })\n\n bot.on('message', async (channel, userstate, message, self) => {\n //Todo: Add Filter\n switch (userstate['message-type']) {\n case 'chat':\n twitcherExplorerProvider.addChatItem(userstate.username, message)\n\n if (!self) {\n const replyText = await notification.showNotifcation(\n userstate.username,\n message\n )\n if (!replyText) return\n bot.say(\n twitcherConfig.channel,\n `@${userstate.username}: ${replyText}`\n )\n }\n break\n }\n })\n}", "function bot() {\n // Initialize Discord Bot\n let bot = new Discord.Client();\n // Get all of the databases documents\n let waitingList = db.getCollection('waitingList')\n let liveAccount = db.getCollection('liveAccount')\n let playStatus = db.getCollection('playStatus')\n // Clear everything out when the bot starts\n playStatus.insert({performing: false, fresh: true})\n\n // When the bot is ready to rock and roll we run this\n bot.on('ready', () => {\n // this is the discord server or something\n let myGuild = bot.guilds.get(config.guildId)\n // this gets the live role in a variable, so we can assign it to people later\n let role = myGuild.roles.find(role => role.name == 'Live')\n\n // Remove the LIVE role from anyone who has it when the bot starts\n role.members.map(member => {\n member.removeRole(role)\n member.setMute(true)\n })\n\n // send a message to the chat\n function sendChat(message) {\n return bot.channels.get(config.theShowChannelId).send(message)\n }\n\n // I don't remember why I made this but it's unsed\n function getNextFivePerformers() {\n return waitingList.getDynamicView('next_up').branchResultset().limit(5).data()\n }\n\n // Fine the next person in the performance list\n function getNextPerformer() {\n return waitingList.getDynamicView('next_up').branchResultset().limit(1).data()[0]\n }\n\n // Get the currently performing user\n function getLivePerformer() {\n return liveAccount.findOne()\n }\n\n // Set the guild member as the current performer\n function setLivePerformer(guildMember) {\n // get the current performer so we can remove them\n let member = liveAccount.findOne()\n // take the live role away from them and mute them\n role.members.forEach(member => {\n member.removeRole(role) \n member.setMute(true)\n })\n\n // assign the guid member as the perfomer if they exist\n if (guildMember) {\n // remove them from the waiting list first\n waitingList.remove(guildMember)\n // update the member variable with the new perfomer info\n member.name = guildMember.name\n member.id = guildMember.id\n } else { \n // if the account doesn't exist there's nobody in the waiting list\n member.name = ''\n member.id = ''\n }\n\n // reset their score\n member.dopeness = .5\n member.dopes = 0\n member.nopes = 0\n \n // update the live perfomer with the new guild member\n return liveAccount.update(member) \n }\n\n // sets the play status of the current perfomer\n // the following keys will have a boolean (true/false) value assoicated with them\n // fresh = they are starting their performance and this is the first loop\n // performing = this is an active performance happening\n function setPlayStatus(key, newStatus) {\n let status = playStatus.findOne()\n status[key] = newStatus\n return playStatus.update(status)\n }\n\n // get the current play status\n function getPlayStatus() {\n return playStatus.findOne()\n }\n\n // check their dopeness score\n function getDopeness() {\n return parseFloat(liveAccount.findOne().dopeness)\n }\n\n // assign the live role to someone\n function assignLiveRole(guildMember) {\n // remove the LIVE who to whoever has it currently\n role.members.map(member => member.removeRole(role))\n // get the new performers id\n let member = myGuild.members.get(guildMember.id)\n // move them to the performing voice channel\n return member.setVoiceChannel(config.theShowVoiceChannelId)\n .then(what => {\n // give them the live role\n member.addRoles([role])\n .then(what => {\n // unmute them so they can perform\n member.setMute(false)\n })\n .catch(error => {\n console.log(error)\n writeLog(error)\n })\n })\n }\n\n // get a message from The Show chat channel based on its ID\n function getMessage(messageId) {\n return bot.channels.get(config.theShowChannelId).messages.get(messageId)\n }\n\n // this starts the performance loop and monitors the perfomers success\n function runPerformance() {\n writeLog('starting the performance')\n // We're starting a perfomrance, so set perfomring to true\n setPlayStatus('performing', true)\n // I don't remember why this is here but i'm afraid to remove it\n setPlayStatus('fresh', false)\n\n // all this will be run at the end of the performance.\n bot.setTimeout(()=> {\n // Get the live performers current annoucenemnt message.\n // so we can count their emoji stats\n let message = getMessage(getLivePerformer().message)\n\n // console.log(message)\n\n // get the current performer\n let live = liveAccount.findOne()\n // filter through all the reactions to get the fire and poop count\n message.reactions.map(reaction => {\n switch(reaction.emoji.name) {\n case \"🔥\":\n live.dopes = reaction.count\n break\n case \"💩\":\n live.nopes = reaction.count\n break\n default:\n }\n })\n // do the performance math\n live.total = live.dopes + live.nopes\n live.dopeness = (parseInt(live.dopes) / parseInt(live.total)).toFixed(2)\n //update the performer stats\n liveAccount.update(live)\n\n setPlayStatus('performing', false) //their current performance stops\n writeLog('ending performance')\n }, 15000) // we check the performers score every 15 seconds\n }\n\n sendChat(`bot starting ${new Date()}`)\n // this is the main task runner. This manages the performance flows\n bot.setInterval(() => {\n writeLog(\"Loop start\")\n writeLog(`Performing status: ${getPlayStatus().performing}`)\n // if someone is performing just log who that is\n if (getPlayStatus().performing) {\n writeLog(`${getLivePerformer().name} is performing`)\n } else {\n // no performance is currently running see if we should run one\n writeLog('no performance running')\n \n // there's performer set, so lets start their performance\n // if not then check to see if anyone is next\n if (getLivePerformer().name) {\n writeLog(`performer name: ${getLivePerformer().name}`)\n // someone is set to perform, so lets star their performance\n writeLog(`are they fresh: ${getPlayStatus().fresh}`)\n if (getPlayStatus().fresh) {\n // this is their first run, so let's set them up\n // announce to chat they're performing\n sendChat(`<@${getLivePerformer().id}> has the mic now 🎤 - Vote with 🔥 and 💩 reactions`)\n .then(message => {\n // automatically set the fire and poo emoji so people can click them\n message.react(\"🔥\").then(what => message.react(\"💩\"))\n let performer = getLivePerformer()\n // set the ID of the message we sent to the chat onto the perfomer document \n // so we can easily find it later and count the emoji\n performer.message = message.id \n // update the performer document in the db\n liveAccount.update(performer)\n // give this new performer the live role\n assignLiveRole(performer)\n })\n // start their performance\n runPerformance()\n\n } else if (getDopeness() > .60) { // they're no fresh, so lets count their emoji stats\n writeLog('Performer gets to continue')\n // they were dope! lets announce it to the chat\n sendChat(`<@${getLivePerformer().id}> is dope and gets to keep the mic! Dopeness score: ${getLivePerformer().dopeness}`)\n // and lets give them a new message for people to vote on\n sendChat(`<@${getLivePerformer().id}> Vote with 🔥 and 💩 reactions`)\n .then(message => {\n message.react(\"🔥\").then(what => message.react(\"💩\"))\n let performer = getLivePerformer()\n performer.message = message.id \n liveAccount.update(performer)\n })\n // start a new performance for them\n runPerformance()\n } else { // ouch. they were voted off.\n writeLog(`${getLivePerformer().name} lost the mic`)\n // announce that they lost the mic, and share their score\n sendChat(`<@${getLivePerformer().id}> lost the mic! Dopeness score: ${getLivePerformer().dopeness} Need: .60`)\n .then(what => {\n // give the next performer the microphone\n setPlayStatus('fresh', true)\n setLivePerformer(getNextPerformer())\n })\n }\n } else {\n // nobody is currently set to perform\n writeLog('nobody is set to perform')\n // see if anyone is next to perform\n if (getNextPerformer()) {\n // we have a new performer\n writeLog('settings up next in line to perform')\n // set the play status to fresh since they're new\n setPlayStatus('fresh', true)\n // set the next performer to LIVE\n setLivePerformer(getNextPerformer())\n } else {\n // nobody is lined up to perform, so don't do anything\n writeLog('nobody is ready to perform')\n }\n }\n }\n }, 500) // run checks on the perfomance every half a second\n })\n\n // These are the chat commands that the bot responds to\n bot.on('message', msg => {\n // don't talk to other bots\n if (msg.author.bot) return;\n \n // Also good practice to ignore any message that does not start with our prefix, \n // which is set in the configuration file.\n if (msg.content.indexOf('!') !== 0) return;\n\n // parse the chat message to get the command that was run\n let args = msg.content.substring(1).split(' ')\n let cmd = args[0]\n args = args.splice(1)\n\n switch(cmd) {\n // check to see if the bot is alive\n case \"ping\":\n msg.reply('pong')\n break\n // allow people to sign up and perform\n case \"signup\":\n console.log(\"singing up\")\n // console.log(msg.member.voiceChannel)\n if (!msg.member.voiceChannel) {\n msg.reply(`join The Show voice channel first!`)\n return\n }\n\n try {\n console.log(msg.author.voiceChannel)\n // add the user to the waiting list\n waitingList.insert({timestamp: msg.createdTimestamp, id: msg.author.id, name: msg.author.username})\n // add them to the performance voice channel\n msg.member.setVoiceChannel(config.theShowVoiceChannelId)\n msg.reply(`You're signed up!`)\n writeLog(`${msg.member.displayName} has signed up!`)\n } catch (e) {\n console.log(e)\n console.log(\"signup failed\")\n msg.reply(`sign up failed, sorry!`)\n }\n break\n default:\n }\n });\n\n bot.login(config.discordToken)\n}", "constructor(app)\n {\n this.app = app;\n\n //NOTE: As of 3.1.X and up, the WS and Rest Ports are the same\n this.nodes = this.app.config.nodes //[{ host: 'localhost', port: 80, region: 'us', password: 'youshallnotpass' }];\n this.regions = {\n asia: ['hongkong', 'singapore', 'sydney'],\n eu: ['eu', 'amsterdam', 'frankfurt', 'russia'],\n us: ['us', 'brazil'],\n };\n\n this.shardCount = app.bot.shards.size; //lol size instead of length\n this.userId = app.bot.user.id;\n\n //TODO: currently assuming single lavalink node...\n this.node = this.nodes[0];\n //console.log(this.nodes[0]);\n\n this.playerManager = new PlayerManager(this.app.bot, this.nodes,\n {\n numShards: this.shardCount, // number of shards\n userId: this.userId, // the user id of the bot\n regions: this.regions,\n defaultRegion: 'us',\n });\n\n this.app.bot.voiceConnections = this.playerManager;\n }", "function bot(torrent, bot) {\n bot.onText(/\\/start/, async msg => {\n const opts = {\n reply_markup:{\n inline_keyboard: [\n [\n {\n text: 'Help',\n callback_data: 'help'\n }\n ],\n [\n {\n text: 'Cloud Torrenter',\n url: 'https://cloudtorrenter.herokuapp.com'\n }\n ],\n [\n {\n text: 'Report Bugs',\n url: 'https://t.me/WhySooSerious'\n }\n ]\n ]\n },\n parse_mode: 'markdown'\n };\n bot.sendMessage(msg.from.id, `Hey ${msg.from.first_name},\\n\\n_I can Torrent Files and Upload it to my G-Drive_\\n_See_ *Help for More Info!*`, opts);\n });\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n bot.onText(/\\/donate/, async msg => {\n const opts = {\n reply_markup:{\n inline_keyboard: [\n [\n {\n text: 'Patreon ✅',\n url: 'https://www.patreon.com/WhySooSerious'\n }\n ],\n [\n {\n text: 'Share and Support ❤️',\n url: 'https://t.me/share/url?url=https://t.me/CloudTorrenterBOT'\n }\n ]\n ]\n },\n parse_mode: 'markdown'\n };\n bot.sendMessage(msg.from.id, \"*Thanks for showing interest in Donation.*\\n\\n_To Donate and Support me, you can send any Amount as you wish 😇 _.\\n\\nBecome my Patreon\", opts);\n });\n/////////////////////////////////////////////////////////////////////////////////////////////////////////////\n bot.onText(/\\/help/, async msg => {\n const opts = {\n reply_markup: {\n reply_markup: {\n inline_keyboard: [\n [\n {\n text: 'Join our Team Drive',\n callback_data: 'drive'\n }\n ],\n [\n {\n text: 'Advanced Help',\n callback_data: 'advancedhelp'\n }\n ]\n ]\n },\n },\n parse_mode: 'Markdown'\n };\n bot.sendMessage(msg.from.id, \"*/search {site} {query}* - _To search for torrents_\\n*/details {site} {link}* -_To Fetch the magnetic link_\\n*/download {magnet link} -* _To start a download_\\n*/status {magnet link} -* _To check status of a downloading torrent._\\n*/remove {magnet link} -* _To remove an already added torrent_\\n\\n*Please Reffer Advanced Help for More Assistance 👇*\", opts);\n });\n//////////////////////////////////////////////////////////////////////////////////////////////////////////\n////////////////////////////////////////// All Callbacks/////////////////////////////////////////////////\n////////////////////////////////////////////////////////////////////////////////////////////////////////\n bot.on('callback_query', async callbackQuery => {\n const action = callbackQuery.data;\n const msg = callbackQuery.message;\n const opts = {\n reply_markup: {\n inline_keyboard: [\n [\n {\n text: 'Join Group',\n callback_data: 'group'\n }\n ],\n [\n {\n text: 'Goto Drive',\n callback_data: 'drivelink'\n }\n ],\n [\n {\n text: 'Back',\n callback_data: 'help'\n },\n {\n text: 'Close',\n callback_data: 'close'\n }\n ]\n ]\n },\n parse_mode: 'markdown',\n message_id: msg.message_id\n };\n let text;\n\n if (action === 'drive') {\n text = 'You will have to Join our Team Drive For *Accessing and Downloading Files from Google Drive.*\\n_To Join our Team Drive, Join Our Google Group and you are Good to go!';\n }\n\n bot.editMessage(msg.chatId, text, opts);\n });\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n bot.on('callback_query', async callbackQuery => {\n const action = callbackQuery.data;\n const msg = callbackQuery.message;\n const opts = {\n reply_markup: {\n inline_keyboard: [\n [\n {\n text: 'Join our Team Drive',\n callback_data: 'drive'\n }\n ],\n [\n {\n text: 'Advanced Help',\n callback_data: 'advancedhelp'\n }\n ]\n ]\n },\n parse_mode: 'markdown',\n message_id: msg.message_id,\n };\n let text;\n\n if (action === 'help') {\n text = '*/search {site} {query}* - _To search for torrents_\\n*/details {site} {link}* -_To Fetch the magnetic link_\\n*/download {magnet link} -* _To start a download_\\n*/status {magnet link} -* _To check status of a downloading torrent._\\n*/remove {magnet link} -* _To remove an already added torrent_\\n\\n*Please Reffer Advanced Help for More Assistance 👇*';\n }\n\n bot.editMessage(msg.chatId, text, opts);\n });\n/////////////////////////////////////////////////////////////////////////////////////////////////////////////\n bot.on('callback_query', async callbackQuery => {\n const action = callbackQuery.data;\n const msg = callbackQuery.message;\n const opts = {\n message_id: msg.message_id\n };\n if (action === 'close')\n\n bot.deleteMessage(msg.chatId, opts);\n });\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n bot.on('callback_query', async callbackQuery => {\n const action = callbackQuery.data;\n const msg = callbackQuery.message;\n const opts = {\n reply_markup: {\n inline_keyboard: [\n [\n {\n text: 'Get Link',\n callback_data: 'grouplink'\n },\n {\n text: 'Goto Drive',\n callback_data: 'drivelink'\n }\n ],\n [\n {\n text: 'Back',\n callback_data: 'group'\n }\n ]\n ]\n },\n parse_mode: 'markdown',\n message_id: msg.message_id,\n };\n let text;\n\n if (action === 'group') {\n text = '*Get the Join Link by Clicking the Button Below*';\n }\n\n bot.editMessage(msg.chatId, text, opts);\n });\n///////////////////////////////////////////////////////////////////////////////////////////////////////////////\n bot.on('callback_query', async callbackQuery => {\n const action = callbackQuery.data;\n let text;\n\n if (action === 'grouplink') {\n bot.sendMessage(chatId, 'https://groups.google.com/g/cloudtorrenter');\n }\n });\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////\n bot.on('callback_query', async callbackQuery => {\n const action = callbackQuery.data;\n const msg = callbackQuery.message;\n const opts = {\n reply_markup: {\n inline_keyboard: [\n [\n {\n text: 'Back',\n callback_data: 'help'\n }\n ]\n ],\n },\n };\n let text;\n\n if (action === 'drivelink') {\n bot.sendMessage(msg.chatId, 'https://drive.google.com/drive/folders/0AMTkervhUwARUk9PVA', opts);\n }\n });\n/////////////////////////////////////////////////////////////////////////////////////////////////////////////\n bot.on('callback_query', async callbackQuery => {\n const action = callbackQuery.data;\n const msg = callbackQuery.message;\n const opts = {\n reply_markup: {\n inline_keyboard: [\n [\n {\n text: 'Back',\n callback_data: 'help'\n }\n ]\n ],\n },\n disable_web_page_preview: 'true',\n };\n let text;\n\n if (action === 'advancedhelp') {\n bot.sendMessage(msg.chatId, 'https://telegra.ph/Advanced-Help-for-Cloud-Torrenter-07-31', opts);\n }\n });\n//\n//\n bot.on(\"message\", async msg => {\n if (!msg.document) return;\n const chatId = msg.chat.id;\n const mimeType = msg.document.mimeType;\n const fileName = msg.document.file_name;\n const fileId = msg.document.file_id;\n\n bot.sendMessage(chatId, \"Uploading file...\");\n try {\n const uploadedFile = await uploadFileStream(fileName, bot.getFileStream(fileId));\n const driveId = uploadedFile.data.id;\n const driveLink = `https://drive.google.com/file/d/${driveId}/view?usp=sharing`;\n const publicLink = `${process.env.SITE}api/v1/drive/file/${fileName}?id=${driveId}`;\n bot.sendMessage(chatId, `${fileName} upload successful\\nDrive link: ${driveLink}\\nPublic link: ${publicLink}`);\n } \n catch (e) {\n bot.sendMessage(chatId, e.message || \"An error occured\");\n }\n });\n\n bot.onText(/\\/server/, async msg => {\n const from = msg.chat.id;\n const currStatus = await status();\n bot.sendMessage(from, currStatus);\n });\n\n bot.onText(searchRegex, async (msg, match) => {\n var from = msg.from.id;\n var site = match[1];\n var query = match[2];\n\n bot.sendMessage(from, \"SearchinG ⏳...\");\n\n const data = await axios(`${api}api/v1/search/${site}?query=${query}`).then(({ data }) => data);\n\n if (!data || data.error) {\n bot.sendMessage(from, \"An error occured on server\");\n } else if (!data.results || data.results.length === 0) {\n bot.sendMessage(from, \"No results found.\");\n } else if (data.results.length > 0) {\n let results1 = \"\";\n let results2 = \"\";\n let results3 = \"\";\n\n data.results.forEach((result, i) => {\n if (i <= 2) {\n results1 += `Name: ${result.name} \\nSeeds: ${result.seeds} \\nDetails: ${result.details} \\nLink: ${result.link} \\n\\n`;\n } else if (2 < i && i <= 5) {\n results2 += `Name: ${result.name} \\nSeeds: ${result.seeds} \\nDetails: ${result.details} \\nLink: ${result.link} \\n\\n`;\n } else if (5 < i && i <= 8) {\n results3 += `Name: ${result.name} \\nSeeds: ${result.seeds} \\nDetails: ${result.details} \\nLink: ${result.link} \\n\\n`;\n }\n });\n\n bot.sendMessage(from, results1);\n bot.sendMessage(from, results2);\n bot.sendMessage(from, results3);\n }\n });\n\n bot.onText(detailsRegex, async (msg, match) => {\n var from = msg.from.id;\n var site = match[1];\n var query = match[2];\n\n bot.sendMessage(from, \"Loading...\");\n\n const data = await axios(`${api}/details/${site}?query=${query}`).then(({ data }) => data);\n if (!data || data.error) {\n bot.sendMessage(from, \"An error occured\");\n } else if (data.torrent) {\n const torrent = data.torrent;\n let result1 = \"\";\n let result2 = \"\";\n\n result1 += `Title: ${torrent.title} \\n\\nInfo: ${torrent.info}`;\n torrent.details.forEach(item => {\n result2 += `${item.infoTitle} ${item.infoText} \\n\\n`;\n });\n result2 += \"Magnet Link:\";\n\n await bot.sendMessage(from, result1);\n await bot.sendMessage(from, result2);\n await bot.sendMessage(from, torrent.downloadLink);\n }\n });\n\n bot.onText(downloadRegex, (msg, match) => {\n var from = msg.from.id;\n var link = match[1];\n let messageObj = null;\n let torrInterv = null;\n\n const reply = async torr => {\n let mess1 = \"\";\n mess1 += `DownloadinG ⛕ :〘${torr.progress}%〙\\n\\n ${torr.name}\\n\\n`;\n \n mess1 += `Total Size : ${torr.total}\\n`;\n if (!torr.done) {\n mess1 += `Downloaded : ${torr.downloaded}\\n`;\n mess1 += `Download Speed : ${torr.speed}\\n\\n`;\n \n mess1 += `Time Left : ${torr.redableTimeRemaining}\\n\\n`;\n mess1 += `Please /donate any Amount you Wish to keep this Service Alive!\\n\\n`;\n } else {\n mess1 += `Link: ${torr.downloadLink}\\n\\n`;\n clearInterval(torrInterv);\n torrInterv = null;\n }\n \n try {\n if (messageObj) {\n if (messageObj.text !== mess1) bot.editMessageText(mess1, { chat_id: messageObj.chat.id, message_id: messageObj.message_id });\n } else messageObj = await bot.sendMessage(from, mess1);\n } catch (e) {\n console.log(e.message);\n }\n };\n\n const onDriveUpload = (torr, url) => bot.sendMessage(from, `${torr.name} Uploaded to Gdrive\\n${url}`);\n const onDriveUploadStart = torr => bot.sendMessage(from, `Uploading ${torr.name} to Gdrive`);\n\n if (link.indexOf(\"magnet:\") !== 0) {\n bot.sendMessage(from, \"Link is not a magnet link\");\n } else {\n bot.sendMessage(from, \"Starting download...\");\n try {\n const torren = torrent.download(\n link,\n torr => reply(torr),\n torr => reply(torr),\n onDriveUpload,\n onDriveUploadStart\n );\n torrInterv = setInterval(() => reply(torrent.statusLoader(torren)), 5000);\n } catch (e) {\n bot.sendMessage(from, \"An Error occured\\n\" + e.message);\n }\n }\n });\n\n bot.onText(statusRegex, (msg, match) => {\n var from = msg.from.id;\n var link = match[1];\n\n const torr = torrent.get(link);\n if (link.indexOf(\"magnet:\") !== 0) {\n bot.sendMessage(from, \"Link is not a Magnet link\");\n } else if (!torr) {\n bot.sendMessage(from, \"Not downloading please add\");\n } else {\n let mess1 = \"\";\n mess1 += `${torr.status}..\\n\\n ${torr.name}\\n\\n`;\n \n mess1 += `Size 👁‍🗨: ${torr.total}\\n\\n`;\n if (!torr.done) {\n mess1 += `Downloaded : ${torr.downloaded}\\n\\n`;\n mess1 += `Speed : ${torr.speed}\\n\\n`;\n mess1 += `Percentage : ${torr.progress}%\\n\\n`;\n mess1 += `Time Remaining : ${torr.redableTimeRemaining}\\n\\n`;\n } else {\n mess1 += `Link: ${torr.downloadLink}\\n\\n`;\n }\n \n bot.sendMessage(from, mess1);\n }\n });\n\n bot.onText(removeRegex, (msg, match) => {\n var from = msg.from.id;\n var link = match[1];\n\n try {\n torrent.remove(link);\n bot.sendMessage(from, \"Torrent Removed Successfully\");\n } catch (e) {\n bot.sendMessage(from, `${e.message}`);\n }\n });\n}", "function Bot(){\n this.name;\n this.userName;\n this.password;\n this.secret;\n}", "constructor(bot) {\n this._bot = bot;\n this._settings;\n this._globalQueue = new Array();\n this._errors = 0;\n this._voiceHandler;\n this._voiceConnection;\n this._total = 0;\n this._stopped = false;\n this._notification = { nextSong: true, currentSong: true };\n \n this.bot.on('message', (message) => {\n if(message.channel.type === \"text\" && message.channel.id === this.settings.channels.text_channel_id) { //Message received on desired text channel \n \n if(message.author == bot.user) return;\n\n this.commandHandler(message).then(res => {\n message.reply(res);\n console.log(res);\n }).catch(err => {\n message.reply(err); \n console.log(err);\n });\n }\n });\n\n }", "function setup() {\n //get the data base and display message if not loaded correctly\n $.getJSON('data/data.json')\n .done(dataLoaded)\n .fail(dataNotLoaded);\n addDialog();\n //call other function to display sound and to refresh the sentence using a\n //button\n clickSound();\n clickToRefresh();\n speakWords();\n\n //set up Annyang\n if (annyang) {\n //Call the function after detecting the spoken sentence\n var commands = {\n 'another one': speakToRefresh\n };\n annyang.addCommands(commands);\n annyang.start();\n }\n}", "function startUp() {\n\t\tloadGUI();\n\t\tconnectAPI();\n\t\tloadListeners();\n\t\tautoDubUp();\n\t\t$(\"#chat-txt-message\").attr(\"maxlength\", \"99999999999999999999\");\n\t\tisIWootRunning = true;\n\t\tAPI.chatLog(IWoot.iWoot + \" Started!\");\n\t\tIWoot.Tools.log(IWoot.iWoot + \" Started!\");\n\t}", "function exp() {\n\tconst express = require('express');\n\tconst app = express();\n\tconst port = 3000;\n\n\tapp.get('/', (req, res) => res.send('Started The bot.'));\n\tapp.listen(port, () =>\n\t\tconsole.log(`Your App is listening at https.//localhost:${port}`)\n\t);\n}", "async function init() {\n try {\n // Prompt Inquirer questions\n const userResponses = await promptUser();\n console.log(\"Your responses: \", userResponses);\n console.log(\n \"Thank you for your responses! Fetching your GitHub data next...\"\n );\n\n // Call GitHub api for user info\n //const userInfo = await api.getUser(userResponses);\n //console.log(\"Your GitHub user info: \", userInfo);\n\n // Pass Inquirer userResponses and GitHub userInfo to generateMarkdown\n console.log(\"Generating your README next...\");\n const markdown = generateReadme(userResponses);\n console.log(markdown);\n\n // Write markdown to file\n await File(\"ExampleREADME.md\", markdown);\n } catch (error) {\n console.log(error);\n }\n}", "async function initOscBot() {\r\n const oscModeAnswers = await askOscillationModeQuestions();\r\n\r\n const fetchInterval = parseInt(oscModeAnswers['fetchInterval']) * 1000;\r\n const pairNames = oscModeAnswers['currencyPairs'];\r\n const oscillationLimit = parseFloat(oscModeAnswers['oscillationLimit']) * 0.01;\r\n\r\n setupCurrencyPairs(pairNames, oscillationLimit);\r\n\r\n oscBotStartAlert();\r\n\r\n setInterval(getTickForOscBot, fetchInterval);\r\n}", "function startUp() {\n scriptUUID = Agent.sessionUUID;\n player = new Player();\n\n Messages.messageReceived.connect(onMessageReceived);\n Messages.subscribe(ASSIGNMENT_MANAGER_CHANNEL);\n\n\n searchForManager();\n\n Script.scriptEnding.connect(onEnding);\n }", "initialize() {\n // TODO: Make Private\n this.guildManager.initialize();\n setupWeeklyGuildLoop();\n }", "function BotReady(){\n\t\t//Debug.Log(\"Ready!\");\n\t\tvar readyToGo = true;\n\t\tvar bot : BotType;\n\t\tfor( bot in WorldManager.botsList )\n\t\t\tif( bot.obj.GetComponent(Bot).IsAnimating() && !bot.obj.GetComponent(Bot).HasError() ){\n\t\t\t\treadyToGo = false;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\tif( readyToGo )\n\t\t\tfor( bot in WorldManager.botsList ){\n\t\t\t\t//if ANY bot is past their last index, slow down\n\t\t\t\tif(!bot.obj.GetComponent(Bot).FastMode())\n\t\t\t\t{\n\t\t\t\t\tanimSpeed = 2.5;\n\t\t\t\t\tfinalAnimSpeed = 2.5;\n\t\t\t\t}\n\t\t\t\tbot.obj.GetComponent(Bot).RunCommand();\n\t\t\t}\n\t\n\t}", "function runCommands() {\n app\n .command('run <path>')\n .description('Run a bot manually')\n .option('-f --fork', 'Don\\'t re-queue bot after running.')\n .action(runActions);\n}", "function doSetup() {\n\tconst path = (...paths) => require('path').join(__dirname, ...paths);\n\tconst TLog = require('@tycrek/log');\n\tconst fs = require('fs-extra');\n\tconst prompt = require('prompt');\n\tconst token = require('./generators/token');\n\n\tconst log = new TLog({ level: 'debug', timestamp: { enabled: false } });\n\n\t// Override default configs with existing configs to allow migrating configs\n\t// Now that's a lot of configs!\n\ttry {\n\t\tconst existingConfig = require('./config.json');\n\t\tObject.entries(existingConfig).forEach(([key, value]) => {\n\t\t\tObject.prototype.hasOwnProperty.call(config, key) && (config[key] = value); // skipcq: JS-0093\n\t\t\tObject.prototype.hasOwnProperty.call(s3config, key) && (s3config[key] = value); // skipcq: JS-0093\n\t\t\tObject.prototype.hasOwnProperty.call(oldConfig, key) && (oldConfig[key] = value); // skipcq: JS-0093\n\t\t});\n\t} catch (ex) {\n\t\tif (ex.code !== 'MODULE_NOT_FOUND' && !ex.toString().includes('Unexpected end')) log.error(ex);\n\t}\n\n\t// Disabled the annoying \"prompt: \" prefix and removes colours\n\tprompt.message = '';\n\tprompt.colors = false;\n\tprompt.start();\n\n\t// Schema for setup prompts\n\tconst setupSchema = {\n\t\tproperties: {\n\t\t\thost: {\n\t\t\t\tdescription: 'Local IP to bind to',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: config.host,\n\t\t\t\trequired: false\n\t\t\t},\n\t\t\tport: {\n\t\t\t\tdescription: 'Port number to listen on',\n\t\t\t\ttype: 'integer',\n\t\t\t\tdefault: config.port,\n\t\t\t\trequired: false\n\t\t\t},\n\t\t\tdomain: {\n\t\t\t\tdescription: `Domain name to send to ShareX clients (example: ${config.domain})`,\n\t\t\t\ttype: 'string',\n\t\t\t\trequired: true,\n\t\t\t\tmessage: 'You must input a valid domain name or IP to continue'\n\t\t\t},\n\t\t\tmaxUploadSize: {\n\t\t\t\tdescription: `Maximum size for uploaded files, in megabytes`,\n\t\t\t\ttype: 'integer',\n\t\t\t\tdefault: config.maxUploadSize,\n\t\t\t\trequire: false\n\t\t\t},\n\t\t\tisProxied: {\n\t\t\t\tdescription: 'Will you be running through a reverse proxy',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: config.isProxied,\n\t\t\t\trequired: false\n\t\t\t},\n\t\t\tuseSsl: {\n\t\t\t\tdescription: 'Use HTTPS (must be configured with reverse proxy)',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: config.useSsl,\n\t\t\t\trequired: false\n\t\t\t},\n\t\t\tresourceIdSize: {\n\t\t\t\tdescription: 'URL length (length of ID\\'s for your files, recommended: 6-15. Higher = more uploads, but longer URLs)',\n\t\t\t\ttype: 'integer',\n\t\t\t\tdefault: config.resourceIdSize,\n\t\t\t\trequired: false\n\t\t\t},\n\t\t\tresourceIdType: {\n\t\t\t\tdescription: 'URL type (can be one of: zws, random, gfycat, original)',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: config.resourceIdType,\n\t\t\t\trequire: false,\n\t\t\t\tpattern: /(original|zws|random|gfycat)/gi, // skipcq: JS-0113\n\t\t\t\tmessage: 'Must be one of: zws, random, gfycat, original'\n\t\t\t},\n\t\t\tspaceReplace: {\n\t\t\t\tdescription: 'Character to replace spaces in filenames with (must be a hyphen -, underscore _, or use ! to remove spaces)',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: config.spaceReplace,\n\t\t\t\trequired: false,\n\t\t\t\tpattern: /^[-_!]$/gim,\n\t\t\t\tmessage: 'Must be a - , _ , or !'\n\t\t\t},\n\t\t\tgfyIdSize: {\n\t\t\t\tdescription: 'Adjective count for \"gfycat\" URL type',\n\t\t\t\ttype: 'integer',\n\t\t\t\tdefault: config.gfyIdSize,\n\t\t\t\trequired: false\n\t\t\t},\n\t\t\tmediaStrict: {\n\t\t\t\tdescription: 'Only allow uploads of media files (images, videos, audio)',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: config.mediaStrict,\n\t\t\t\trequired: false\n\t\t\t},\n\t\t\tviewDirect: {\n\t\t\t\tdescription: 'View uploads in browser as direct resource, rather than a viewing page',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: config.viewDirect,\n\t\t\t\trequired: false\n\t\t\t},\n\t\t\tdataEngine: {\n\t\t\t\tdescription: 'Data engine to use (must match an NPM package name. If unsure, leave blank)',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: config.dataEngine,\n\t\t\t\trequired: false\n\t\t\t},\n\t\t\tfrontendName: {\n\t\t\t\tdescription: 'Name of your frontend (leave blank if not using frontends)',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: config.frontendName,\n\t\t\t\trequired: false\n\t\t\t},\n\t\t\tindexFile: {\n\t\t\t\tdescription: 'Filename for your custom index, if using one (must be a JS file)',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: config.indexFile,\n\t\t\t\trequired: false\n\t\t\t},\n\t\t\ts3enabled: {\n\t\t\t\tdescription: 'Enable uploading to S3 storage endpoints',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: config.s3enabled,\n\t\t\t\trequired: false\n\t\t\t}\n\t\t}\n\t};\n\n\tconst s3schema = {\n\t\tproperties: {\n\t\t\ts3endpoint: {\n\t\t\t\tdescription: 'S3 Endpoint URL to upload objects to',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: s3config.s3endpoint,\n\t\t\t\trequired: false\n\t\t\t},\n\t\t\ts3bucket: {\n\t\t\t\tdescription: 'S3 Bucket name to upload objects to',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: s3config.s3bucket,\n\t\t\t\trequired: false\n\t\t\t},\n\t\t\ts3usePathStyle: {\n\t\t\t\tdescription: 'S3 path endpoint, otherwise uses subdomain endpoint',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: s3config.s3usePathStyle,\n\t\t\t\trequired: false\n\t\t\t},\n\t\t\ts3accessKey: {\n\t\t\t\tdescription: 'Access key for the specified S3 API',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: s3config.s3accessKey,\n\t\t\t\trequired: false\n\t\t\t},\n\t\t\ts3secretKey: {\n\t\t\t\tdescription: 'Secret key for the specified S3 API',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: s3config.s3secretKey,\n\t\t\t\trequired: false\n\t\t\t},\n\t\t}\n\t};\n\n\t// Schema for confirm prompt. User must enter 'y' or 'n' (case-insensitive)\n\tconst confirmSchema = getConfirmSchema('\\nIs the above information correct? (y/n)');\n\n\tlog.blank().blank().blank().blank()\n\t\t.info('<<< ass setup >>>').blank();\n\tlet results = {};\n\tprompt.get(setupSchema)\n\t\t.then((r) => results = r) // skipcq: JS-0086\n\n\t\t// Check if using S3\n\t\t.then(() => results.s3enabled ? prompt.get(s3schema) : s3config) // skipcq: JS-0229\n\t\t.then((r) => Object.entries(r).forEach(([key, value]) => results[key] = value)) // skipcq: JS-0086\n\n\t\t// Verify information is correct\n\t\t.then(() => log\n\t\t\t.blank()\n\t\t\t.info('Please verify your information', '\\n'.concat(Object.entries(results).map(([setting, value]) => `${' '}${log.chalk.dim.gray('-->')} ${log.chalk.bold.white(`${setting}:`)} ${log.chalk.white(value)}`).join('\\n')))\n\t\t\t.blank())\n\n\t\t// Apply old configs\n\t\t.then(() => Object.entries(oldConfig).forEach(([setting, value]) => (typeof results[setting] === 'undefined') && (results[setting] = value)))\n\n\t\t// Confirm\n\t\t.then(() => prompt.get(confirmSchema))\n\t\t.then(({ confirm }) => (confirm ? fs.writeJson(path('config.json'), results, { spaces: 4 }) : log.error('Setup aborted').callback(process.exit, 1)))\n\n\t\t// Other setup tasks\n\t\t.then(() => {\n\n\t\t\t// Make sure auth.json exists and generate the first key\n\t\t\tif (!fs.existsSync(path('auth.json')) || fs.readFileSync(path('auth.json')).length < 8) {\n\t\t\t\tlet users = {};\n\t\t\t\tusers[token()] = { username: 'ass', count: 0 };\n\t\t\t\tfs.writeJsonSync(path('auth.json'), { users }, { spaces: 4 });\n\t\t\t\tlog.debug('File created', 'auth.json')\n\t\t\t\t\t.success('!! Important', `Save this token in a secure spot: ${Object.keys(users)[0]}`)\n\t\t\t\t\t.blank();\n\t\t\t}\n\n\t\t\tlet existingData = {}\n\t\t\ttry {\n\t\t\t\texistingData = fs.readJsonSync(path('data.json'));\n\t\t\t} catch (ex) {\n\t\t\t\tlog.warn('data.json', 'File empty, fixing')\n\t\t\t}\n\n\t\t\t// All 3 as a Promise.all\n\t\t\treturn Promise.all([\n\t\t\t\tfs.ensureDir(path('share')),\n\t\t\t\tfs.ensureDir(path(results.diskFilePath, 'thumbnails')),\n\t\t\t\tfs.writeJson(path('data.json'), existingData, { spaces: 4 })\n\t\t\t]);\n\t\t})\n\n\t\t// Complete & exit\n\t\t.then(() => log.blank().success('Setup complete').callback(() => process.exit(0)))\n\t\t.catch((err) => log.blank().error(err));\n}", "constructor(conf)\n\t{\n\t\t/**\n\t\t * A list of commands that the bot should respond to. Rather than being hardcoded here, they're added by the attachCommands method.\n\t\t */\n\t\tthis.commands = {};\n\n\t\tthis.commandPrefix = conf.commandPrefix;\n\n\t\t/**\n\t\t * The command prefix for the bot can be specified on a guild by guild basis. It's stored here as a hash of the {guildId}->{commandPrefix}\n\t\t */\n\t\tthis.commandPrefixOverrides = {};\n\n\t\t/**\n\t\t * Whether or not, on a guild basis, the bot should try to delete a command the user sends. I like it to, but some people prefer not to have it.\n\t\t */\n\t\tthis.deleteMessageOverrides = {};\n\n\t\t/**\n\t\t * A list of guild ids to an array of roles that have elevated privileges for that guild\n\t\t */\n\n\t\tthis.authorisedRoles = {};\n\t\t/**\n\t\t * A list of guild ids to an array of users that have elevated privileges for that user\n\t\t */\n\t\tthis.authorisedUsers = {};\n\n\t\t/**\n\t\t * attach commands for the bot\n\t\t */\n\t\tthis.attachCommands();\n\t}", "function BotAccount(accountDetails) {\n // Ensure account values are valid\n var self = this;\n // Init all required variables\n self.tempSettings = {};\n self.community = new SteamCommunity();\n self.client = new SteamUser();\n self.trade = new TradeOfferManager({\n \"steam\": self.client,\n \"community\": self.community,\n \"cancelTime\": 1000 * 60 * 60 * 24 * 10, // Keep offers upto 1 hour, and then just cancel them.\n \"pendingCancelTime\": 1000 * 60 * 30, // Keep offers upto 30 mins, and then cancel them if they still need confirmation\n \"cancelOfferCount\": 30,// Cancel offers once we hit 7 day threshold\n \"cancelOfferCountMinAge\": 1000 * 60 * 60 * 24 * 7,// Keep offers until 7 days old\n \"language\": \"en\", // We want English item descriptions\n \"pollInterval\": 5000 // We want to poll every 5 seconds since we don't have Steam notifying us of offers\n });\n self.store = new SteamStore();\n self.accountDetails = accountDetails;\n\n\n self.client.on('loggedOn', function (details) {\n self.client.setPersona(SteamUser.Steam.EPersonaState.Online);\n self.emit('loggedOn', details);\n if (self.getTempSetting('displayBotMenu') != null) {\n self.emit('displayBotMenu');\n self.deleteTempSetting('displayBotMenu');\n }\n });\n\n self.client.on('webSession', function (sessionID, cookies) {\n if (self.accountDetails.sessionID != sessionID || self.accountDetails.cookies != cookies) {\n self.accountDetails.sessionID = sessionID;\n self.accountDetails.cookies = cookies;\n delete self.accountDetails.twoFactorCode;\n /**\n * Updated an account's details (such as: username, password, sessionid, cookies...)\n *\n * @event BotAccount#updatedAccountDetails\n */\n self.emit('updatedAccountDetails');\n }\n\n if (self.accountDetails.cookies) {\n self.community.setCookies(cookies);\n self.store.setCookies(cookies);\n self.trade.setCookies(cookies);\n }\n\n self.client.on('friendOrChatMessage', function (senderID, message, room) {\n if (self.currentChatting != null && senderID == self.currentChatting.sid) {\n console.log((\"\\n\" + self.currentChatting.accountName + \": \" + message).green);\n }\n /**\n * Emitted when a friend message or chat room message is received.\n *\n * @event BotAccount#friendOrChatMessage\n * @type {object}\n * @property {SteamID} senderID - The message sender, as a SteamID object\n * @property {String} message - The message text\n * @property {SteamID} room - The room to which the message was sent. This is the user's SteamID if it was a friend message\n */\n self.emit('friendOrChatMessage', senderID, message, room);\n });\n\n self.trade.on('sentOfferChanged', function (offer, oldState) {\n /**\n * Emitted when a trade offer changes state (Ex. accepted, pending, escrow, etc...)\n *\n * @event BotAccount#offerChanged\n * @type {object}\n * @property {TradeOffer} offer - The new offer's details\n * @property {TradeOffer} oldState - The old offer's details\n */\n self.emit('offerChanged', offer, oldState);\n });\n\n self.trade.on('receivedOfferChanged', function (offer, oldState) {\n self.emit('offerChanged', offer, oldState);\n });\n\n // Useless right now\n //self.client.on('friendsList', function () {\n // self.emit('friendsList');\n //});\n\n self.trade.on('newOffer', function (offer) {\n /**\n * Emitted when we receive a new trade offer\n *\n * @event BotAccount#newOffer\n * @type {object}\n * @property {TradeOffer} offer - The offer's details\n */\n self.emit('newOffer', offer);\n });\n\n\n // Really glitchy trade system... So just ignore it for now.\n //self.client.on('tradeResponse', function (steamid, response, restrictions) {\n // self.emit('tradeResponse', steamid, response, restrictions);\n //});\n\n // Really glitchy trade system... So just ignore it for now.\n //self.client.on('tradeRequest', function (steamID, respond) {\n // respond(false);\n //});\n\n self.client.on('tradeOffers', function (count) {\n /**\n * Emitted when we receive a new trade offer notification (only provides amount of offers and no other details)\n *\n * @event BotAccount#tradeOffers\n * @type {object}\n * @property {Integer} count - The amount of active trade offers (can be 0).\n */\n self.emit('tradeOffers', count);\n self.setTempSetting('tradeOffers', count);\n });\n\n self.client.on('steamGuard', function (domain, callback, lastCodeWrong) {\n /**\n * Emitted when Steam requests a Steam Guard code from us. You should collect the code from the user somehow and then call the callback with the code as the sole argument.\n *\n * @event BotAccount#steamGuard\n * @type {object}\n * @property {String} domain - If an email code is needed, the domain name of the address where the email was sent. null if an app code is needed.\n * @property {callbackSteamGuard} callbackSteamGuard - Should be called when the code is available.\n * @property {Boolean} lastCodeWrong - true if you're using 2FA and the last code you provided was wrong, false otherwise\n */\n self.emit('steamGuard', domain, callback, lastCodeWrong);\n });\n /**\n * Emitted when we fully sign into Steam and all functions are usable.\n *\n * @event BotAccount#loggedIn\n */\n self.emit('loggedIn');\n });\n\n\n self.client.on('error', function (e) {\n // Some error occurred during logon\n console.log(e);\n switch (e.eresult) {\n case 5:\n self.emit('incorrectCredentials', self.accountDetails);\n var tempAccountDetails = {\n accountName: self.accountDetails.accountName,\n password: self.accountDetails.password\n };\n delete self.accountDetails;// Clearing any non-auth details we may have had saved.\n self.accountDetails = tempAccountDetails;\n self.emit('updatedAccountDetails');\n break;\n default:\n self.emit('debug', e);\n }\n self.emit('displayBotMenu');\n });\n\n}", "async function init() {\n try {\n const userResponses = await inquirer.prompt(questions);\n console.log(\"Your responses: \", userResponses);\n console.log(\"Thank you for your responses! Fetching your GitHub data next...\");\n \n const userInfo = await api.getUser(userResponses);\n console.log(\"Your GitHub user info: \", userInfo);\n \n console.log(\"Writing your README\")\n const markdown = generateMarkdown(userResponses, userInfo);\n console.log(markdown);\n \n await writeFileAsync('ExampleREADME.md', markdown);\n\n } catch (error) {\n console.log(error);\n }\n}", "function setupChannel() {\n // Join the general channel\n generalChannel.join().then(function(channel) {\n print('Joined channel as '\n + '<span class=\"is-owner\">' + username + '</span>.', true);\n });\n\n setTimeout(() => $chatOverlay.slideUp(), 1000);\n\n // Listen for new messages sent to the channel\n generalChannel.on('messageAdded', function(message) {\n printMessage(message.author, message.body);\n });\n }", "async function handleBot( xmpp, redis, origin ) {\n const msg = ( text ) => newMessage( text, origin.from, origin.to )\n const user = getUserState( redis, origin.from )\n const text = origin.text\n\n const helpString = `Commands:\n register : Set up twilio account and number\n cancel : Return to this help text\n status : Show user config status\n clear : Clear your user config`\n\n let userStatus = await user.botStatus.get()\n let finalStatus = userStatus\n \n const commands = new Set([ \"register\", \"status\", \"help\", \"cancel\", \"clear\" ])\n\n if ( ! userStatus ) {\n await user.botStatus.set( \"help\" )\n userStatus = \"help\"\n } \n \n console.log( text.toLowerCase().trim() )\n if ( commands.has( text.toLowerCase().trim() ) ) {\n switch ( text.toLowerCase().trim() ) {\n case \"register\":\n finalStatus = \"register_account_sid\"\n break;\n case \"status\":\n finalStatus = \"status\"\n break;\n case \"clear\":\n const phoneNumber = await user.phoneNumber.get()\n await redis.del( phoneNumber )\n await user.clear( [ 'accountSid', 'authToken', 'phoneNumber' ] )\n finalStatus = \"status\"\n case \"help\":\n case \"cancel\":\n finalStatus = \"help\"\n break;\n }\n\n } else {\n switch ( userStatus ) {\n case \"register_account_sid\":\n await user.accountSid.set( origin.text )\n finalStatus = \"register_auth_token\"\n break;\n case \"register_auth_token\":\n await user.authToken.set( origin.text )\n finalStatus = \"register_number\"\n break;\n case \"register_number\":\n const number = origin.text.trim()\n if ( ! /^\\+\\d+$/.test( number ) ) {\n await xmpp.send( msg( \"Invalid Phone Number\" ) )\n return\n }\n await user.phoneNumber.set( number )\n try {\n await testUserCredentials( user )\n const jid = await redis.getAsync( number )\n if ( jid ) throw new Error( \"Number already in use by \", jid )\n await redis.setAsync( number, origin.from )\n finalStatus = \"register_end\"\n } catch ( err ) {\n await xmpp.send( msg( \"Error signing up: \" + err ) )\n await user.clear( [ 'accountSid', 'authToken', 'phoneNumber' ] )\n finalStatus = \"help\"\n }\n break;\n case \"help\":\n break\n default:\n await xmpp.send( msg( `unknown status: '${userStatus}'` ) )\n }\n } \n await user.botStatus.set( finalStatus )\n \n if ( userStatus != \"help\" && userStatus == finalStatus ) {\n await xmpp.send( msg( \"Try Again\" ) )\n return\n }\n\n switch ( finalStatus ) {\n case \"help\":\n await xmpp.send( msg( helpString ) )\n break;\n case \"register_account_sid\":\n await xmpp.send( msg( \"Enter Account SID\" ) )\n break;\n case \"register_auth_token\":\n await xmpp.send( msg( \"Enter Auth Token\" ) )\n break;\n case \"register_number\":\n await xmpp.send( msg( \"Enter Phone Number ( in E.164 format: + country_code phone_number )\" ) )\n break;\n case \"register_end\":\n await xmpp.send( msg( \"Successfully Registered\" ) )\n case \"status\":\n testUserCredentials( user )\n userAccountSid = await user.accountSid.get()\n userAuthToken = await user.authToken.get()\n userNumber = await user.phoneNumber.get()\n await xmpp.send( msg( `Status: ${userAccountSid}, ${userAuthToken}, ${userNumber}`) )\n await user.botStatus.set( \"help\" )\n break\n }\n\n}", "function init() {\n inquirer.prompt(questions).then(answers => {\n let appTitle = answers.appTitle.trim();\n let appDescription = answers.appDescription ? answers.appDescription.trim() : \"\";\n let packageName = answers.packageName.trim();\n let openui5 = answers.openui5.trim();\n let appType = answers.type.trim();\n let splitApp = appType === \"split\";\n let routing = answers.routing || splitApp;\n\n ui5init.createFolders();\n ui5init.createComponent(packageName, routing);\n ui5init.createManifest(packageName, appType, routing);\n ui5init.createIndex(packageName, appTitle);\n ui5init.createI18n(appTitle, appDescription);\n jsGenerator.generateFile(\"App\", packageName, jsGenerator.types.controller);\n viewGenerator.generateAppView(packageName, splitApp, routing);\n if (routing || splitApp) {\n jsGenerator.generateFile(\"Master\", packageName, jsGenerator.types.controller);\n viewGenerator.generateView(\"Master\", packageName);\n }\n if (splitApp) {\n jsGenerator.generateFile(\"Detail\", packageName, jsGenerator.types.controller);\n viewGenerator.generateView(\"Detail\", packageName);\n }\n\n runtime.createPackage(appTitle, appDescription);\n runtime.createServer(openui5);\n runtime.createGruntEnvironment();\n\n console.log(`Application \"${appTitle}\" initialized.`);\n console.log(`Run npm install && npm start to install and start the app.`);\n });\n}", "function setup() {\n database = firebase.database();\n\n canvas = createCanvas(500, 500);\n game = new Game();\n game.getState();\n game.start();\n}", "function setup(){\n socket = io.connect('http://190.200.104.21:3000');\n $(\"#text\").on(\"froalaEditor.keyup\", function(){\n var html = $(this).froalaEditor('html.get');\n var data = {\n text: html\n };\n socket.emit('text', data);\n });\n $('#text').froalaEditor({\n toolbarButtons: ['fullscreen'],\n fullPage: true\n });\n \n //Aca se llaman a las funciones y se les pasan los argumentos\n socket.on('text', handleRecievedText);\n socket.on('newUser', updateText);\n}", "function BotJS(conf, cb){\n this.variables = {};\n this.wildCards = [];\n this.responses = [[]];\n this.inputs = [];\n this.attributes = conf;\n this.cb = cb || function(text){\n console.log(text);\n }\n this.dom = [];\n for(r in resources.aiml)\n this.dom.push(new DOMParser().parseFromString(resources.aiml[r], \"text/xml\").documentElement);\n console.log('BotJS is fully loaded!');\n\n}", "async function init() {\n try {\n\n const responses = await inquirer.prompt(questions);\n console.log(\"Your responses: \", responses);\n\n console.log(\"Creating your README.\")\n const markdown = generateMarkdown(responses);\n console.log(markdown);\n\n writeToFile('README.md', markdown);\n\n } catch (error) {\n console.log(error);\n }\n}", "function start_listening() {\n\n\t// Endpoint to send one way messages to the team. If a message is important it will appear on a user's feed\n\tthis.server.get('api/messages/send/team', (req, res) => {\n\n\t\tvar address = addresses[decodeURIComponent(req.params.id)];\n\t\tvar type = (typeof req.params.type === 'string') ? req.params.type : 'text';\n\t\tvar isImportant = (typeof req.params.isImportant === 'string' && req.params.isImportant === 'true') ? true : false;\n\n\t\tif (!address) {\n\t\t\tres.send('Sorry cannot find your bot, please re-add the app');\n\t\t\tres.end();\n\t\t\treturn;\n\t\t}\n\n\t\tconsole.log(`Sending Message to team: isImportant=${isImportant}`);\n\n\t\ttry {\n\n\t\t\tvar quote = faker.fake(\"{{lorem.sentence}}\");\n\t\t\tvar msg = new builder.Message().address(address);\n\t\t\tif (isImportant) msg.channelData = { notification: { alert: 'true' } };\n\n\t\t\tif (type === 'text') msg.text(quote);\n\t\t\tif (type === 'hero') msg.addAttachment(utils.createHeroCard(builder));\n\t\t\tif (type === 'thumb') msg.addAttachment(utils.createThumbnailCard(builder));\n\n\t\t\tif (type === 'text') res.send('Look on MS Teams, just sent: ' + quote);\n\t\t\tif (type === 'hero') res.send('Look on MS Teams, just sent a Hero card');\n\t\t\tif (type === 'thumb') res.send('Look on MS Teams, just sent a Thumbnail card');\n\n\t\t\tbot.send(msg, function (err) {\n\t\t\t\t// Return success/failure\n\t\t\t\tres.status(err ? 500 : 200);\n\t\t\t\tres.end();\n\t\t\t});\n\t\t} catch (e) { }\n\t});\n\n\t// Endpoint to send one way messages to individual users\n\tthis.server.get('api/messages/send/user', (req, res) => {\n\n\t\tvar guid = decodeURIComponent(req.params.id);\n\t\tvar address = addresses[guid];\n\t\tvar user = decodeURIComponent(req.params.user);\n\t\tvar type = (typeof req.params.type === 'string') ? req.params.type : 'text';\n\t\tvar isImportant = (typeof req.params.isImportant === 'string' && req.params.isImportant === 'true') ? true : false;\n\n\t\tif (!address) {\n\t\t\tres.send('Sorry cannot find your bot, please re-add the app');\n\t\t\tres.end();\n\t\t\treturn;\n\t\t}\n\n\t\tif (!user) {\n\t\t\tres.send('Sorry cannot find your user, please re-add the app');\n\t\t\tres.end();\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\n\t\t\tstartConversation(user, guid, function (data) {\n\t\t\t\tvar newConversationId = data.id;\n\t\t\t\taddress.conversation.id = newConversationId;\n\t\t\t\tsendMessageToUser(address, type, res, isImportant);\n\t\t\t});\n\t\t} catch (e) { }\n\t});\n\n\tthis.server.post('api/messages', c.listen()); // bind our one way bot to /api/messages\n\n\t// When a bot is added or removed we get an event here. Event type we are looking for is teamMember added\n\tbot.on('conversationUpdate', (msg) => {\n\n\t\tconsole.log('Notify got message');\n\n\t\tif (!rest_endpoint) rest_endpoint = msg.address.serviceUrl; // This is the base URL where we will send REST API request\t\t\n\t\tif (!msg.eventType === 'teamMemberAdded') return;\n\n\t\tconsole.log('Sample app was added to the team');\n\t\tconsole.log(JSON.stringify(msg, null, 1));\n\n\t\tif (!Array.isArray(msg.membersAdded) || msg.membersAdded.length < 1) return;\n\n\t\tvar members = msg.membersAdded;\n\n\t\t// We are keeping track of unique addresses so we can send messages to multiple users and channels at the same time\n\t\t// Clean up so we don't blow up memory (I know, I know, but still)\n\t\tif (addresses.length > 100) {\n\t\t\taddresses = {};\n\t\t\ttenant_id = {};\n\t\t\taccess_token = {};\n\t\t}\n\n\t\tvar botmessage = new builder.Message()\n\t\t\t.address(msg.address)\n\t\t\t.text('Hello, I am a sample app. I am looking for the team members and will shortly send you a message');\n\n\t\tbot.send(botmessage, function (err) { });\n\n\t\t// Loop through all members that were just added to the team\n\t\tfor (var i = 0; i < members.length; i++) {\n\n\t\t\t// See if the member added was our bot\n\t\t\tif (members[i].id.includes('8aefbb70-ff9e-409f-acea-986b61e51cd3') || members[i].id.includes('150d0c56-1423-4e6d-80d3-afce6cc8bace')) {\n\n\t\t\t\tvar guid = uuid.v4();\n\t\t\t\ttenant_id[guid] = msg.sourceEvent.tenant.id; // Extracting tenant ID as we will need it to create new conversations\n\n\t\t\t\t// Find all members currently in the team so we can send them a welcome message\n\t\t\t\tgetMembers(msg, guid).then((ret) => {\n\n\t\t\t\t\tvar msg = ret.msg;\n\t\t\t\t\tvar members = ret.members;\n\n\t\t\t\t\tconsole.log('got members');\n\n\t\t\t\t\t// Prepare a message to the channel about the addition of this app. Write convenience URLs so \n\t\t\t\t\t// we can easily send messages to the channel and individually to any user\t\t\t\t\t\n\t\t\t\t\tvar text = `##Just added the Sample App!! \\n Send message to: `\n\t\t\t\t\ttext += `[Text](${host}/api/messages/send/team?id=${encodeURIComponent(guid)}) [Important](${host}api/messages/send/team?id=${encodeURIComponent(guid)}&isImportant=true)`;\n\t\t\t\t\ttext += ` | [Hero Card](${host}/api/messages/send/team?type=hero&id=${encodeURIComponent(guid)}) [Important](${host}api/messages/send/team?type=hero&id=${encodeURIComponent(guid)}&isImportant=true)`;\n\t\t\t\t\ttext += ` | [Thumbnail Card](${host}/api/messages/send/team?type=thumb&id=${encodeURIComponent(guid)}) [Important](${host}api/messages/send/team?type=thumb&id=${encodeURIComponent(guid)}&isImportant=true)`;\n\t\t\t\t\taddresses[guid] = msg.address;\n\n\t\t\t\t\tfunction getEndpoint(type, guid, user, isImportant) {\n\t\t\t\t\t\treturn `${host}/api/messages/send/user?type=${encodeURIComponent(type)}&id=${encodeURIComponent(guid)}&user=${encodeURIComponent(user)}&isImportant=${encodeURIComponent(isImportant)}`;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Loop through and prepare convenience URLs for each user\n\t\t\t\t\ttext += '\\n\\n';\n\t\t\t\t\tfor (var i = 0; i < members.length; i++) {\n\t\t\t\t\t\tvar user = members[i].id;\n\t\t\t\t\t\tvar name = members[i].givenName || null;\n\t\t\t\t\t\tguid = uuid.v4();\n\n\t\t\t\t\t\tvar nameString = (name) ? name : `user number ${i + 1}`;\n\t\t\t\t\t\ttext += `Send message to ${nameString}: `\n\t\t\t\t\t\ttext += `[Text](${getEndpoint('text', guid, user, false)}), `;\n\t\t\t\t\t\ttext += `[Text alert](${getEndpoint('text', guid, user, true)}), `;\n\t\t\t\t\t\ttext += `[Hero](${getEndpoint('hero', guid, user, false)}), ` \n\t\t\t\t\t\ttext += `[Hero Alert](${getEndpoint('hero', guid, user, true)}), `;\n\t\t\t\t\t\ttext += `[Thumb](${getEndpoint('thumb', guid, user, false)}), `\n\t\t\t\t\t\ttext += `[Thumb Alert](${getEndpoint('thumb', guid, user, true)})`;\n\t\t\t\t\t\ttext += '\\n\\n';\n\n\t\t\t\t\t\taddresses[guid] = JSON.parse(JSON.stringify(msg.address)); // Make sure we mae a copy of an address to add to our addresses array\n\t\t\t\t\t\ttenant_id[guid] = msg.sourceEvent.tenant.id; // Extracting tenant ID as we will need it to create new conversations\n\t\t\t\t\t}\n\n\t\t\t\t\t// Go ahead and send the message\n\t\t\t\t\ttry {\n\t\t\t\t\t\tvar botmessage = new builder.Message()\n\t\t\t\t\t\t\t.address(msg.address)\n\t\t\t\t\t\t\t.textFormat(builder.TextFormat.markdown)\n\t\t\t\t\t\t\t.text(text);\n\n\t\t\t\t\t\tbot.send(botmessage, function (err) {\n\n\t\t\t\t\t\t});\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tconsole.log(`Cannot send message: ${e}`);\n\t\t\t\t\t}\n\n\t\t\t\t}, (err) => {\n\n\t\t\t\t});\n\n\t\t\t}\n\t\t}\n\t});\n}", "function setUp() {\nbitgo = new BitGoJS.BitGo({ env: 'test', accessToken: configData.accessToken });\n}", "function setup_message(){\n message.channel.send(`Please set-up this server with ${eprefix}guild-setup`);\n}", "function setupChannel() {\n\n newChannel.join().then(function(channel) {\n print('Joined channel as ' + username);\n });\n\n // Get the last 5 messages\n newChannel.getMessages(5).then(function (messages) {\n for (var i = 0; i < messages.items.length; i++) {\n if (messages.items[i].author !== undefined) {\n printMessage(newChannel.uniqueName, messages.items[i].author, messages.items[i].body);\n }\n }\n });\n\n // Fired when a new Message has been added to the Channel on the server.\n newChannel.on('messageAdded', function(message) {\n console.log(message.body);\n printMessage(newChannel.uniqueName, message.author, message.body);\n });\n }", "async function init() {\n try {\n const answers = await inquirer.prompt(questions);\n await asyncWrite(\"README.md\", generateMarkdown(answers));\n console.log(\"README file successfully generated!\")\n } catch (err) {\n console.log(err);\n }\n}", "start() {\n this.setupDoorbellSocket();\n this.setupMQTT();\n this.initLogin();\n }", "async startup() { }", "async startup() { }", "function init() {\n inquirer.prompt(questions)\n .then((inquirerResponses) => {\n console.log(\"Generating README...\");\n writeToFile(\"README.md\", generateMarketdown({...inquirerResponses}));\n })\n}", "function SlackBot(config) {\n this.config = config || {};\n this.commands = {};\n this.aliases = {};\n\n if (!this.config.structureResponse) {\n this.config.structureResponse = function (response) {\n return response;\n };\n }\n}", "function startGame(){\n /*\n Start the game.\n */\n bot_enabled = true;\n console.log(\"STARTING\");\n\n // Wait until the conexion is stablished\n start_game();\n setTimeout(update,1000);\n}", "setup() {\n const trezorSendAction = this.actions.ada.trezorSend;\n trezorSendAction.sendUsingTrezor.listen(this._sendUsingTrezor);\n trezorSendAction.cancel.listen(this._cancel);\n }", "function setupSpacebrew() {\n var random_id = \"0000\" + Math.floor(Math.random() * 10000);\n\n app_name = app_name + ' ' + random_id.substring(random_id.length - 4);\n\n console.log(\"Setting up spacebrew connection\");\n sb = new Spacebrew.Client(\"127.0.0.1\");\n\n sb.name(app_name);\n sb.description(\"JHU/APL Mobile Training Interface\");\n\n // configure the publication and subscription feeds\n sb.addPublish(\"cmdString\", \"string\", \"\");\n sb.addSubscribe(\"statusString\", \"string\");\n\n // connect to Spacebrew\n sb.connect();\n\n // override Spacebrew events - this is how you catch events coming from Spacebrew\n sb.onStringMessage = onStringMessage;\n sb.onOpen = onOpen;\n\n\n} // setupSpacebrew", "function setup() {\n\n simSetup();\n\n // controller select\n let controllerMenu = select(\"#controller\");\n for (let i = 0; i < controllerNames.length; i++) {\n controllerMenu.option(controllerNames[i]);\n }\n controllerMenu.changed(function() {\n let cname = select(\"#controller\").value();\n bot.setController(cname);\n });\n\n select(\"#b_reset\").mouseClicked(function() { // reset button\n simReset();\n paused = true;\n noLoop();\n redraw();\n });\n\n select(\"#b_run\").mouseClicked(function() { // run-pause button\n paused = !paused;\n if (paused) noLoop();\n else loop();\n });\n\n select(\"#b_single\").mouseClicked(function() { // single step button\n paused = true;\n noLoop();\n simStep();\n redraw();\n });\n\n select(\"#b_expt\").mouseClicked(runExpt);\n\n simReset();\n}" ]
[ "0.7023849", "0.6938551", "0.66934544", "0.6670126", "0.6544007", "0.64738196", "0.645209", "0.645011", "0.64082813", "0.6370061", "0.63590604", "0.6271769", "0.6154662", "0.6133547", "0.6094147", "0.60537106", "0.6043347", "0.6000122", "0.5998333", "0.5951112", "0.5885482", "0.58559704", "0.58408546", "0.58381754", "0.5777558", "0.5725923", "0.57219934", "0.5699189", "0.5676954", "0.5674304", "0.5664525", "0.56558716", "0.5602729", "0.5584747", "0.55558884", "0.55532503", "0.55414695", "0.55414695", "0.55414695", "0.55414695", "0.55414695", "0.553495", "0.55111605", "0.5505273", "0.5502133", "0.55005205", "0.5493992", "0.5492583", "0.54881454", "0.5487143", "0.5469097", "0.54679936", "0.5466987", "0.5450412", "0.5438984", "0.5437558", "0.5430577", "0.5426978", "0.54140985", "0.5394095", "0.53901637", "0.536667", "0.53528756", "0.5350094", "0.5344733", "0.5335402", "0.5320463", "0.53122836", "0.52858084", "0.5273889", "0.527249", "0.52665985", "0.5261492", "0.5254305", "0.5249663", "0.5236403", "0.5232754", "0.52309304", "0.52237946", "0.5221631", "0.52163243", "0.5205386", "0.52050406", "0.5204731", "0.52025527", "0.5196684", "0.51864094", "0.5178333", "0.5176393", "0.5174724", "0.5174025", "0.51590645", "0.51474696", "0.51474696", "0.51358867", "0.51321", "0.5128383", "0.5122406", "0.5116722", "0.51117635" ]
0.7067322
0
This function handles pesky input quotations and properly delineated backslashes
function pathCorrect (filepath) { pathArray = filepath.split(path.sep); var correctedPath = path.normalize(pathArray.join('\\\\')); correctedPath = correctedPath.replace(/\"/g,''); return correctedPath; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clean(input){\n return input.replace('\\'', '');\n \n }", "_checkQuotes() {\n const str = aStr.string;\n if (str.length >= 2\n && str[0] == str[str.length - 1]\n && (str[0] == \"'\" || str[0] == '\"')) {\n this.isQuoted = true;\n this.quote = str[0];\n return;\n }\n\n this.isQuoted = false;\n this.quote = \"\";\n }", "function esc(v) { return \"\\\"\" + v.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\") + \"\\\"\"; }", "function esc(v) { return \"\\\"\" + v.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\") + \"\\\"\"; }", "function esc(v) { return \"\\\"\" + v.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\") + \"\\\"\"; }", "function esc(v) { return \"\\\"\" + v.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\") + \"\\\"\"; }", "function testStrings() {\n var z = \"\\\"\"\n , a = \"\\\\\"\n , b = \"\\\\\\\"\"\n , c = \"\\\\\\\\\"\n , d = \"\\\\\\\\\\\"\"\n , e = \"\\\\\\\\\\\\\"\n ;\n return \"\\\\/*\\/\\/\";\n }", "function e(a){return a.lastIndexOf(\"\\\\\")<0?a:a.replace(/\\\\\\\\/g,\"\\\\\").replace(/\\\\n/g,\"\\n\").replace(/\\\\r/g,\"\\r\").replace(/\\\\t/g,\"\t\").replace(/\\\\b/g,\"\\b\").replace(/\\\\f/g,\"\\f\").replace(/\\\\{/g,\"{\").replace(/\\\\}/g,\"}\").replace(/\\\\\"/g,'\"').replace(/\\\\'/g,\"'\")}", "function _quote_no_esc(str) {\n if (/^\"/.test(str)) return true;\n var match = void 0;\n while (match = /^[\\s\\S]*?([\\s\\S])\"/.exec(str)) {\n if (match[1] !== '\\\\') {\n return true;\n }\n str = str.substr(match[0].length);\n }\n return false;\n}", "function _quote_no_esc(str) {\n if (/^\"/.test(str)) return true;\n let match;\n while (match = /^[\\s\\S]*?([\\s\\S])\"/.exec(str)) {\n if (match[1] !== '\\\\') {\n return true;\n }\n str = str.substr(match[0].length);\n }\n return false;\n}", "function remove_quotation_marks(input_string){\n\tif(input_string!=undefined){\n\tif(input_string.charAt(0) === '\"') {\n\t\tinput_string = input_string.substr(1);\n\t}\n\tif(input_string.length>0){\n\tif(input_string.charAt(input_string.length-1) === '\"') {\n\t\tinput_string = input_string.substring(0, input_string.length - 1);\n\t}}}\n\treturn (input_string);\n}", "function escapeQuotedInput(token, list) {\n\t\t\t\tvar result = [],\n\t\t\t\t\tcharacter;\n\n\t\t\t\t// token is the initial (opening) quotation character, we are not (yet) interested in this,\n\t\t\t\t// as we need to process the stuff in list, right until we find a matching token\n\t\t\t\twhile (list.length) {\n\t\t\t\t\tcharacter = list.shift();\n\n\t\t\t\t\t// reduce provided escaping\n\t\t\t\t\tif (character[character.length - 1] === '\\\\') {\n\t\t\t\t\t\tif (!pattern.escape.test(list[0])) {\n\t\t\t\t\t\t\t// remove the escape character\n\t\t\t\t\t\t\tcharacter = character.substr(0, character.length - 1);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// add the result\n\t\t\t\t\t\tresult.push(character);\n\n\t\t\t\t\t\t// while we are at it, we may aswel move the (at least previously) escaped\n\t\t\t\t\t\t// character to the result\n\t\t\t\t\t\tresult.push(list.shift());\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\telse if (character === token) {\n\t\t\t\t\t\t// with the escaping taken care of, we now know the string has ended\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tresult.push(character);\n\t\t\t\t}\n\n\t\t\t\treturn addQuotation(result.join(''));\n\t\t\t}", "set BackQuote(value) {}", "function escapeBackslash(instr) {\n // if the type is not a string, just return the input as it is.\n if (typeof(instr) !== \"string\") return instr;\n\n //// escape double quotes\n //let out = instr.replace(/\"/g, '%22');\n // escape backslashes\n let out = instr.replace(/\\\\/g, '\\\\\\\\');\n return out;\n}", "function escapeQuotes(instr) {\n // if the type is not a string, just return the input as it is.\n if (typeof(instr) !== \"string\") return instr;\n\n // escape double quotes\n let out = instr.replace(/\"/g, '%22');\n // escape backslashes\n out = out.replace(/\\\\/g, '\\\\\\\\');\n return out;\n}", "function normalize(val) {\n var quotableRgx = /(\\n|,|\")/;\n if (quotableRgx.test(val)) return '\"' + val.replace(/\"/g, '\"\"') + '\"';\n return val;\n }", "function sanitize(text) {\n return text.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"');\n }", "function parseQuotedString() {\n var quotedString = \"\";\n //quoted string, look for the next \"\n var lIndexOfNextQuote;\n for (;;) {\n lIndexOfNextQuote = curString.indexOf('\"');\n if (lIndexOfNextQuote === -1) {\n //error \n throw new Error('expecting closing \"');\n }\n quotedString += curString.substring(0, lIndexOfNextQuote);\n lCurrentIndexInString += lIndexOfNextQuote + 1;\n curString = iInputString.substring(lCurrentIndexInString);\n if (curString.length === 0 || curString[0] !== '\"') {\n //we got our string we are done\n return quotedString;\n }\n //there is a following quote after\n \n quotedString += '\"';\n lCurrentIndexInString++;\n curString = iInputString.substring(lCurrentIndexInString);\n \n }\n\n }", "function normalize(val) {\n var quotableRgx = /(\\n|,|\")/;\n if (quotableRgx.test(val)) return '\"' + val.replace(/\"/g, '\"\"') + '\"';\n return val;\n }", "function escapeQuotes(string, beforeHbsEscaping) {\n if(string instanceof handlebars.SafeString) {\n return string;\n }\n string = string + \"\"; // Ensure we've got a string\n\n\n // We want to replace '\\' with '\\\\', that's meta… indeed…\n // E.g {\"azer\": \"hello\\\\,\"} becomes {\"azer\": \"hello\\\\\\\\,\"}\n // Else it will be parsed later in the second JSON-parse, and fail miserably and make our lives a living nightmare.\n string = string.replace(/\\\\/g, '\\\\\\\\');\n\n if(beforeHbsEscaping !== false) {\n string = string.replace(/\"/g, '\\\\\"');\n }\n return string\n .replace(/[\\b]/g, '\\\\b')\n .replace(/[\\f]/g, '\\\\f')\n .replace(/[\\n]/g, '\\\\n')\n .replace(/[\\r]/g, '\\\\r')\n .replace(/[\\t]/g, '\\\\t')\n .trim();\n}", "static processUserInput(input) {\n // Input is null, return null.\n if (input == null) {\n return null;\n }\n let sanitizedInput = this.replaceFancyQuotes(input);\n // Trim off trailing\n sanitizedInput = sanitizedInput.replace(this.removeDanglingQuotes1, \"\");\n sanitizedInput = sanitizedInput.replace(this.removeDanglingQuotes2, \"\");\n return sanitizedInput;\n }", "function quote(s) {\n /*\n * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a\n * string literal except for the closing quote character, backslash,\n * carriage return, line separator, paragraph separator, and line feed.\n * Any character may appear in the form of an escape sequence.\n *\n * For portability, we also escape escape all control and non-ASCII\n * characters. Note that \"\\0\" and \"\\v\" escape sequences are not used\n * because JSHint does not like the first and IE the second.\n */\n return '\"' + s\n .replace(/\\\\/g, '\\\\\\\\') // backslash\n .replace(/\"/g, '\\\\\"') // closing quote character\n .replace(/\\x08/g, '\\\\b') // backspace\n .replace(/\\t/g, '\\\\t') // horizontal tab\n .replace(/\\n/g, '\\\\n') // line feed\n .replace(/\\f/g, '\\\\f') // form feed\n .replace(/\\r/g, '\\\\r') // carriage return\n .replace(/[\\x00-\\x07\\x0B\\x0E-\\x1F\\x80-\\uFFFF]/g, escape)\n + '\"';\n }", "function quote(s) {\n /*\n * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a\n * string literal except for the closing quote character, backslash,\n * carriage return, line separator, paragraph separator, and line feed.\n * Any character may appear in the form of an escape sequence.\n *\n * For portability, we also escape escape all control and non-ASCII\n * characters. Note that \"\\0\" and \"\\v\" escape sequences are not used\n * because JSHint does not like the first and IE the second.\n */\n return '\"' + s\n .replace(/\\\\/g, '\\\\\\\\') // backslash\n .replace(/\"/g, '\\\\\"') // closing quote character\n .replace(/\\x08/g, '\\\\b') // backspace\n .replace(/\\t/g, '\\\\t') // horizontal tab\n .replace(/\\n/g, '\\\\n') // line feed\n .replace(/\\f/g, '\\\\f') // form feed\n .replace(/\\r/g, '\\\\r') // carriage return\n .replace(/[\\x00-\\x07\\x0B\\x0E-\\x1F\\x80-\\uFFFF]/g, escape)\n + '\"';\n }", "function quote(s) {\n /*\n * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a\n * string literal except for the closing quote character, backslash,\n * carriage return, line separator, paragraph separator, and line feed.\n * Any character may appear in the form of an escape sequence.\n *\n * For portability, we also escape escape all control and non-ASCII\n * characters. Note that \"\\0\" and \"\\v\" escape sequences are not used\n * because JSHint does not like the first and IE the second.\n */\n return '\"' + s\n .replace(/\\\\/g, '\\\\\\\\') // backslash\n .replace(/\"/g, '\\\\\"') // closing quote character\n .replace(/\\x08/g, '\\\\b') // backspace\n .replace(/\\t/g, '\\\\t') // horizontal tab\n .replace(/\\n/g, '\\\\n') // line feed\n .replace(/\\f/g, '\\\\f') // form feed\n .replace(/\\r/g, '\\\\r') // carriage return\n .replace(/[\\x00-\\x07\\x0B\\x0E-\\x1F\\x80-\\uFFFF]/g, escape)\n + '\"';\n }", "function quote(s) {\n /*\n * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a\n * string literal except for the closing quote character, backslash,\n * carriage return, line separator, paragraph separator, and line feed.\n * Any character may appear in the form of an escape sequence.\n *\n * For portability, we also escape escape all control and non-ASCII\n * characters. Note that \"\\0\" and \"\\v\" escape sequences are not used\n * because JSHint does not like the first and IE the second.\n */\n return '\"' + s\n .replace(/\\\\/g, '\\\\\\\\') // backslash\n .replace(/\"/g, '\\\\\"') // closing quote character\n .replace(/\\x08/g, '\\\\b') // backspace\n .replace(/\\t/g, '\\\\t') // horizontal tab\n .replace(/\\n/g, '\\\\n') // line feed\n .replace(/\\f/g, '\\\\f') // form feed\n .replace(/\\r/g, '\\\\r') // carriage return\n .replace(/[\\x00-\\x07\\x0B\\x0E-\\x1F\\x80-\\uFFFF]/g, escape)\n + '\"';\n }", "function quote(s) {\n /*\n * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a\n * string literal except for the closing quote character, backslash,\n * carriage return, line separator, paragraph separator, and line feed.\n * Any character may appear in the form of an escape sequence.\n *\n * For portability, we also escape escape all control and non-ASCII\n * characters. Note that \"\\0\" and \"\\v\" escape sequences are not used\n * because JSHint does not like the first and IE the second.\n */\n return '\"' + s\n .replace(/\\\\/g, '\\\\\\\\') // backslash\n .replace(/\"/g, '\\\\\"') // closing quote character\n .replace(/\\x08/g, '\\\\b') // backspace\n .replace(/\\t/g, '\\\\t') // horizontal tab\n .replace(/\\n/g, '\\\\n') // line feed\n .replace(/\\f/g, '\\\\f') // form feed\n .replace(/\\r/g, '\\\\r') // carriage return\n .replace(/[\\x00-\\x07\\x0B\\x0E-\\x1F\\x80-\\uFFFF]/g, escape)\n + '\"';\n }", "function quote(s) {\n /*\n * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a\n * string literal except for the closing quote character, backslash,\n * carriage return, line separator, paragraph separator, and line feed.\n * Any character may appear in the form of an escape sequence.\n *\n * For portability, we also escape escape all control and non-ASCII\n * characters. Note that \"\\0\" and \"\\v\" escape sequences are not used\n * because JSHint does not like the first and IE the second.\n */\n return '\"' + s\n .replace(/\\\\/g, '\\\\\\\\') // backslash\n .replace(/\"/g, '\\\\\"') // closing quote character\n .replace(/\\x08/g, '\\\\b') // backspace\n .replace(/\\t/g, '\\\\t') // horizontal tab\n .replace(/\\n/g, '\\\\n') // line feed\n .replace(/\\f/g, '\\\\f') // form feed\n .replace(/\\r/g, '\\\\r') // carriage return\n .replace(/[\\x00-\\x07\\x0B\\x0E-\\x1F\\x80-\\uFFFF]/g, escape)\n + '\"';\n }", "function quote(s) {\n /*\n * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a\n * string literal except for the closing quote character, backslash,\n * carriage return, line separator, paragraph separator, and line feed.\n * Any character may appear in the form of an escape sequence.\n *\n * For portability, we also escape escape all control and non-ASCII\n * characters. Note that \"\\0\" and \"\\v\" escape sequences are not used\n * because JSHint does not like the first and IE the second.\n */\n return '\"' + s\n .replace(/\\\\/g, '\\\\\\\\') // backslash\n .replace(/\"/g, '\\\\\"') // closing quote character\n .replace(/\\x08/g, '\\\\b') // backspace\n .replace(/\\t/g, '\\\\t') // horizontal tab\n .replace(/\\n/g, '\\\\n') // line feed\n .replace(/\\f/g, '\\\\f') // form feed\n .replace(/\\r/g, '\\\\r') // carriage return\n .replace(/[\\x00-\\x07\\x0B\\x0E-\\x1F\\x80-\\uFFFF]/g, escape)\n + '\"';\n }", "function quote(s) {\n /*\n * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a\n * string literal except for the closing quote character, backslash,\n * carriage return, line separator, paragraph separator, and line feed.\n * Any character may appear in the form of an escape sequence.\n *\n * For portability, we also escape escape all control and non-ASCII\n * characters. Note that \"\\0\" and \"\\v\" escape sequences are not used\n * because JSHint does not like the first and IE the second.\n */\n return '\"' + s\n .replace(/\\\\/g, '\\\\\\\\') // backslash\n .replace(/\"/g, '\\\\\"') // closing quote character\n .replace(/\\x08/g, '\\\\b') // backspace\n .replace(/\\t/g, '\\\\t') // horizontal tab\n .replace(/\\n/g, '\\\\n') // line feed\n .replace(/\\f/g, '\\\\f') // form feed\n .replace(/\\r/g, '\\\\r') // carriage return\n .replace(/[\\x00-\\x07\\x0B\\x0E-\\x1F\\x80-\\uFFFF]/g, escape)\n + '\"';\n }", "function quote(s) {\n /*\n * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a\n * string literal except for the closing quote character, backslash,\n * carriage return, line separator, paragraph separator, and line feed.\n * Any character may appear in the form of an escape sequence.\n *\n * For portability, we also escape escape all control and non-ASCII\n * characters. Note that \"\\0\" and \"\\v\" escape sequences are not used\n * because JSHint does not like the first and IE the second.\n */\n return '\"' + s\n .replace(/\\\\/g, '\\\\\\\\') // backslash\n .replace(/\"/g, '\\\\\"') // closing quote character\n .replace(/\\x08/g, '\\\\b') // backspace\n .replace(/\\t/g, '\\\\t') // horizontal tab\n .replace(/\\n/g, '\\\\n') // line feed\n .replace(/\\f/g, '\\\\f') // form feed\n .replace(/\\r/g, '\\\\r') // carriage return\n .replace(/[\\x00-\\x07\\x0B\\x0E-\\x1F\\x80-\\uFFFF]/g, escape)\n + '\"';\n }", "function quote(s) {\n /*\n * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a\n * string literal except for the closing quote character, backslash,\n * carriage return, line separator, paragraph separator, and line feed.\n * Any character may appear in the form of an escape sequence.\n *\n * For portability, we also escape escape all control and non-ASCII\n * characters. Note that \"\\0\" and \"\\v\" escape sequences are not used\n * because JSHint does not like the first and IE the second.\n */\n return '\"' + s\n .replace(/\\\\/g, '\\\\\\\\') // backslash\n .replace(/\"/g, '\\\\\"') // closing quote character\n .replace(/\\x08/g, '\\\\b') // backspace\n .replace(/\\t/g, '\\\\t') // horizontal tab\n .replace(/\\n/g, '\\\\n') // line feed\n .replace(/\\f/g, '\\\\f') // form feed\n .replace(/\\r/g, '\\\\r') // carriage return\n .replace(/[\\x00-\\x07\\x0B\\x0E-\\x1F\\x80-\\uFFFF]/g, escape)\n + '\"';\n }", "function quote(s) {\n /*\n * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a\n * string literal except for the closing quote character, backslash,\n * carriage return, line separator, paragraph separator, and line feed.\n * Any character may appear in the form of an escape sequence.\n *\n * For portability, we also escape escape all control and non-ASCII\n * characters. Note that \"\\0\" and \"\\v\" escape sequences are not used\n * because JSHint does not like the first and IE the second.\n */\n return '\"' + s\n .replace(/\\\\/g, '\\\\\\\\') // backslash\n .replace(/\"/g, '\\\\\"') // closing quote character\n .replace(/\\x08/g, '\\\\b') // backspace\n .replace(/\\t/g, '\\\\t') // horizontal tab\n .replace(/\\n/g, '\\\\n') // line feed\n .replace(/\\f/g, '\\\\f') // form feed\n .replace(/\\r/g, '\\\\r') // carriage return\n .replace(/[\\x00-\\x07\\x0B\\x0E-\\x1F\\x80-\\uFFFF]/g, escape)\n + '\"';\n }", "function quote(s) {\n /*\n * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a\n * string literal except for the closing quote character, backslash,\n * carriage return, line separator, paragraph separator, and line feed.\n * Any character may appear in the form of an escape sequence.\n *\n * For portability, we also escape escape all control and non-ASCII\n * characters. Note that \"\\0\" and \"\\v\" escape sequences are not used\n * because JSHint does not like the first and IE the second.\n */\n return '\"' + s\n .replace(/\\\\/g, '\\\\\\\\') // backslash\n .replace(/\"/g, '\\\\\"') // closing quote character\n .replace(/\\x08/g, '\\\\b') // backspace\n .replace(/\\t/g, '\\\\t') // horizontal tab\n .replace(/\\n/g, '\\\\n') // line feed\n .replace(/\\f/g, '\\\\f') // form feed\n .replace(/\\r/g, '\\\\r') // carriage return\n .replace(/[\\x00-\\x07\\x0B\\x0E-\\x1F\\x80-\\uFFFF]/g, escape)\n + '\"';\n }", "function quote(s) {\n /*\n * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a\n * string literal except for the closing quote character, backslash,\n * carriage return, line separator, paragraph separator, and line feed.\n * Any character may appear in the form of an escape sequence.\n *\n * For portability, we also escape escape all control and non-ASCII\n * characters. Note that \"\\0\" and \"\\v\" escape sequences are not used\n * because JSHint does not like the first and IE the second.\n */\n return '\"' + s\n .replace(/\\\\/g, '\\\\\\\\') // backslash\n .replace(/\"/g, '\\\\\"') // closing quote character\n .replace(/\\x08/g, '\\\\b') // backspace\n .replace(/\\t/g, '\\\\t') // horizontal tab\n .replace(/\\n/g, '\\\\n') // line feed\n .replace(/\\f/g, '\\\\f') // form feed\n .replace(/\\r/g, '\\\\r') // carriage return\n .replace(/[\\x00-\\x07\\x0B\\x0E-\\x1F\\x80-\\uFFFF]/g, escape)\n + '\"';\n }", "function quote(s) {\n /*\n * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a\n * string literal except for the closing quote character, backslash,\n * carriage return, line separator, paragraph separator, and line feed.\n * Any character may appear in the form of an escape sequence.\n *\n * For portability, we also escape escape all control and non-ASCII\n * characters. Note that \"\\0\" and \"\\v\" escape sequences are not used\n * because JSHint does not like the first and IE the second.\n */\n return '\"' + s\n .replace(/\\\\/g, '\\\\\\\\') // backslash\n .replace(/\"/g, '\\\\\"') // closing quote character\n .replace(/\\x08/g, '\\\\b') // backspace\n .replace(/\\t/g, '\\\\t') // horizontal tab\n .replace(/\\n/g, '\\\\n') // line feed\n .replace(/\\f/g, '\\\\f') // form feed\n .replace(/\\r/g, '\\\\r') // carriage return\n .replace(/[\\x00-\\x07\\x0B\\x0E-\\x1F\\x80-\\uFFFF]/g, escape)\n + '\"';\n }", "function quote(s) {\n /*\n * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a\n * string literal except for the closing quote character, backslash,\n * carriage return, line separator, paragraph separator, and line feed.\n * Any character may appear in the form of an escape sequence.\n *\n * For portability, we also escape escape all control and non-ASCII\n * characters. Note that \"\\0\" and \"\\v\" escape sequences are not used\n * because JSHint does not like the first and IE the second.\n */\n return '\"' + s\n .replace(/\\\\/g, '\\\\\\\\') // backslash\n .replace(/\"/g, '\\\\\"') // closing quote character\n .replace(/\\x08/g, '\\\\b') // backspace\n .replace(/\\t/g, '\\\\t') // horizontal tab\n .replace(/\\n/g, '\\\\n') // line feed\n .replace(/\\f/g, '\\\\f') // form feed\n .replace(/\\r/g, '\\\\r') // carriage return\n .replace(/[\\x00-\\x07\\x0B\\x0E-\\x1F\\x80-\\uFFFF]/g, escape)\n + '\"';\n }", "function quote(s) {\n /*\n * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a\n * string literal except for the closing quote character, backslash,\n * carriage return, line separator, paragraph separator, and line feed.\n * Any character may appear in the form of an escape sequence.\n *\n * For portability, we also escape escape all control and non-ASCII\n * characters. Note that \"\\0\" and \"\\v\" escape sequences are not used\n * because JSHint does not like the first and IE the second.\n */\n return '\"' + s\n .replace(/\\\\/g, '\\\\\\\\') // backslash\n .replace(/\"/g, '\\\\\"') // closing quote character\n .replace(/\\x08/g, '\\\\b') // backspace\n .replace(/\\t/g, '\\\\t') // horizontal tab\n .replace(/\\n/g, '\\\\n') // line feed\n .replace(/\\f/g, '\\\\f') // form feed\n .replace(/\\r/g, '\\\\r') // carriage return\n .replace(/[\\x00-\\x07\\x0B\\x0E-\\x1F\\x80-\\uFFFF]/g, escape)\n + '\"';\n }", "function quote(s) {\n /*\n * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a\n * string literal except for the closing quote character, backslash,\n * carriage return, line separator, paragraph separator, and line feed.\n * Any character may appear in the form of an escape sequence.\n *\n * For portability, we also escape escape all control and non-ASCII\n * characters. Note that \"\\0\" and \"\\v\" escape sequences are not used\n * because JSHint does not like the first and IE the second.\n */\n return '\"' + s\n .replace(/\\\\/g, '\\\\\\\\') // backslash\n .replace(/\"/g, '\\\\\"') // closing quote character\n .replace(/\\x08/g, '\\\\b') // backspace\n .replace(/\\t/g, '\\\\t') // horizontal tab\n .replace(/\\n/g, '\\\\n') // line feed\n .replace(/\\f/g, '\\\\f') // form feed\n .replace(/\\r/g, '\\\\r') // carriage return\n .replace(/[\\x00-\\x07\\x0B\\x0E-\\x1F\\x80-\\uFFFF]/g, escape)\n + '\"';\n }", "function quote(s) {\n /*\n * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a\n * string literal except for the closing quote character, backslash,\n * carriage return, line separator, paragraph separator, and line feed.\n * Any character may appear in the form of an escape sequence.\n *\n * For portability, we also escape escape all control and non-ASCII\n * characters. Note that \"\\0\" and \"\\v\" escape sequences are not used\n * because JSHint does not like the first and IE the second.\n */\n return '\"' + s\n .replace(/\\\\/g, '\\\\\\\\') // backslash\n .replace(/\"/g, '\\\\\"') // closing quote character\n .replace(/\\x08/g, '\\\\b') // backspace\n .replace(/\\t/g, '\\\\t') // horizontal tab\n .replace(/\\n/g, '\\\\n') // line feed\n .replace(/\\f/g, '\\\\f') // form feed\n .replace(/\\r/g, '\\\\r') // carriage return\n .replace(/[\\x00-\\x07\\x0B\\x0E-\\x1F\\x80-\\uFFFF]/g, escape)\n + '\"';\n }", "function quote(s) {\n /*\n * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a\n * string literal except for the closing quote character, backslash,\n * carriage return, line separator, paragraph separator, and line feed.\n * Any character may appear in the form of an escape sequence.\n *\n * For portability, we also escape escape all control and non-ASCII\n * characters. Note that \"\\0\" and \"\\v\" escape sequences are not used\n * because JSHint does not like the first and IE the second.\n */\n return '\"' + s\n .replace(/\\\\/g, '\\\\\\\\') // backslash\n .replace(/\"/g, '\\\\\"') // closing quote character\n .replace(/\\x08/g, '\\\\b') // backspace\n .replace(/\\t/g, '\\\\t') // horizontal tab\n .replace(/\\n/g, '\\\\n') // line feed\n .replace(/\\f/g, '\\\\f') // form feed\n .replace(/\\r/g, '\\\\r') // carriage return\n .replace(/[\\x00-\\x07\\x0B\\x0E-\\x1F\\x80-\\uFFFF]/g, escape)\n + '\"';\n }", "function quote(s) {\n /*\n * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a\n * string literal except for the closing quote character, backslash,\n * carriage return, line separator, paragraph separator, and line feed.\n * Any character may appear in the form of an escape sequence.\n *\n * For portability, we also escape escape all control and non-ASCII\n * characters. Note that \"\\0\" and \"\\v\" escape sequences are not used\n * because JSHint does not like the first and IE the second.\n */\n return '\"' + s\n .replace(/\\\\/g, '\\\\\\\\') // backslash\n .replace(/\"/g, '\\\\\"') // closing quote character\n .replace(/\\x08/g, '\\\\b') // backspace\n .replace(/\\t/g, '\\\\t') // horizontal tab\n .replace(/\\n/g, '\\\\n') // line feed\n .replace(/\\f/g, '\\\\f') // form feed\n .replace(/\\r/g, '\\\\r') // carriage return\n .replace(/[\\x00-\\x07\\x0B\\x0E-\\x1F\\x80-\\uFFFF]/g, escape)\n + '\"';\n }", "function quote(s) {\n /*\n * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a\n * string literal except for the closing quote character, backslash,\n * carriage return, line separator, paragraph separator, and line feed.\n * Any character may appear in the form of an escape sequence.\n *\n * For portability, we also escape escape all control and non-ASCII\n * characters. Note that \"\\0\" and \"\\v\" escape sequences are not used\n * because JSHint does not like the first and IE the second.\n */\n return '\"' + s\n .replace(/\\\\/g, '\\\\\\\\') // backslash\n .replace(/\"/g, '\\\\\"') // closing quote character\n .replace(/\\x08/g, '\\\\b') // backspace\n .replace(/\\t/g, '\\\\t') // horizontal tab\n .replace(/\\n/g, '\\\\n') // line feed\n .replace(/\\f/g, '\\\\f') // form feed\n .replace(/\\r/g, '\\\\r') // carriage return\n .replace(/[\\x00-\\x07\\x0B\\x0E-\\x1F\\x80-\\uFFFF]/g, escape)\n + '\"';\n }", "function quote(s) {\n /*\n * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a\n * string literal except for the closing quote character, backslash,\n * carriage return, line separator, paragraph separator, and line feed.\n * Any character may appear in the form of an escape sequence.\n *\n * For portability, we also escape escape all control and non-ASCII\n * characters. Note that \"\\0\" and \"\\v\" escape sequences are not used\n * because JSHint does not like the first and IE the second.\n */\n return '\"' + s\n .replace(/\\\\/g, '\\\\\\\\') // backslash\n .replace(/\"/g, '\\\\\"') // closing quote character\n .replace(/\\x08/g, '\\\\b') // backspace\n .replace(/\\t/g, '\\\\t') // horizontal tab\n .replace(/\\n/g, '\\\\n') // line feed\n .replace(/\\f/g, '\\\\f') // form feed\n .replace(/\\r/g, '\\\\r') // carriage return\n .replace(/[\\x00-\\x07\\x0B\\x0E-\\x1F\\x80-\\uFFFF]/g, escape)\n + '\"';\n }", "function quote(s) {\n /*\n * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a\n * string literal except for the closing quote character, backslash,\n * carriage return, line separator, paragraph separator, and line feed.\n * Any character may appear in the form of an escape sequence.\n *\n * For portability, we also escape escape all control and non-ASCII\n * characters. Note that \"\\0\" and \"\\v\" escape sequences are not used\n * because JSHint does not like the first and IE the second.\n */\n return '\"' + s\n .replace(/\\\\/g, '\\\\\\\\') // backslash\n .replace(/\"/g, '\\\\\"') // closing quote character\n .replace(/\\x08/g, '\\\\b') // backspace\n .replace(/\\t/g, '\\\\t') // horizontal tab\n .replace(/\\n/g, '\\\\n') // line feed\n .replace(/\\f/g, '\\\\f') // form feed\n .replace(/\\r/g, '\\\\r') // carriage return\n .replace(/[\\x00-\\x07\\x0B\\x0E-\\x1F\\x80-\\uFFFF]/g, escape)\n + '\"';\n }", "function quote(s) {\n /*\n * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a\n * string literal except for the closing quote character, backslash,\n * carriage return, line separator, paragraph separator, and line feed.\n * Any character may appear in the form of an escape sequence.\n *\n * For portability, we also escape escape all control and non-ASCII\n * characters. Note that \"\\0\" and \"\\v\" escape sequences are not used\n * because JSHint does not like the first and IE the second.\n */\n return '\"' + s\n .replace(/\\\\/g, '\\\\\\\\') // backslash\n .replace(/\"/g, '\\\\\"') // closing quote character\n .replace(/\\x08/g, '\\\\b') // backspace\n .replace(/\\t/g, '\\\\t') // horizontal tab\n .replace(/\\n/g, '\\\\n') // line feed\n .replace(/\\f/g, '\\\\f') // form feed\n .replace(/\\r/g, '\\\\r') // carriage return\n .replace(/[\\x00-\\x07\\x0B\\x0E-\\x1F\\x80-\\uFFFF]/g, escape)\n + '\"';\n }", "function quote(s) {\n /*\n * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a\n * string literal except for the closing quote character, backslash,\n * carriage return, line separator, paragraph separator, and line feed.\n * Any character may appear in the form of an escape sequence.\n *\n * For portability, we also escape escape all control and non-ASCII\n * characters. Note that \"\\0\" and \"\\v\" escape sequences are not used\n * because JSHint does not like the first and IE the second.\n */\n return '\"' + s\n .replace(/\\\\/g, '\\\\\\\\') // backslash\n .replace(/\"/g, '\\\\\"') // closing quote character\n .replace(/\\x08/g, '\\\\b') // backspace\n .replace(/\\t/g, '\\\\t') // horizontal tab\n .replace(/\\n/g, '\\\\n') // line feed\n .replace(/\\f/g, '\\\\f') // form feed\n .replace(/\\r/g, '\\\\r') // carriage return\n .replace(/[\\x00-\\x07\\x0B\\x0E-\\x1F\\x80-\\uFFFF]/g, escape)\n + '\"';\n }", "function quote(s) {\n /*\n * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a\n * string literal except for the closing quote character, backslash,\n * carriage return, line separator, paragraph separator, and line feed.\n * Any character may appear in the form of an escape sequence.\n *\n * For portability, we also escape escape all control and non-ASCII\n * characters. Note that \"\\0\" and \"\\v\" escape sequences are not used\n * because JSHint does not like the first and IE the second.\n */\n return '\"' + s\n .replace(/\\\\/g, '\\\\\\\\') // backslash\n .replace(/\"/g, '\\\\\"') // closing quote character\n .replace(/\\x08/g, '\\\\b') // backspace\n .replace(/\\t/g, '\\\\t') // horizontal tab\n .replace(/\\n/g, '\\\\n') // line feed\n .replace(/\\f/g, '\\\\f') // form feed\n .replace(/\\r/g, '\\\\r') // carriage return\n .replace(/[\\x00-\\x07\\x0B\\x0E-\\x1F\\x80-\\uFFFF]/g, escape)\n + '\"';\n }", "function quote(s) {\n /*\n * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a\n * string literal except for the closing quote character, backslash,\n * carriage return, line separator, paragraph separator, and line feed.\n * Any character may appear in the form of an escape sequence.\n *\n * For portability, we also escape escape all control and non-ASCII\n * characters. Note that \"\\0\" and \"\\v\" escape sequences are not used\n * because JSHint does not like the first and IE the second.\n */\n return '\"' + s\n .replace(/\\\\/g, '\\\\\\\\') // backslash\n .replace(/\"/g, '\\\\\"') // closing quote character\n .replace(/\\x08/g, '\\\\b') // backspace\n .replace(/\\t/g, '\\\\t') // horizontal tab\n .replace(/\\n/g, '\\\\n') // line feed\n .replace(/\\f/g, '\\\\f') // form feed\n .replace(/\\r/g, '\\\\r') // carriage return\n .replace(/[\\x00-\\x07\\x0B\\x0E-\\x1F\\x80-\\uFFFF]/g, escape)\n + '\"';\n }", "raw_string(txt, quotation='\"') {\n var str = \"\"\n var n = txt.length\n var end = 1\n var c=txt.charAt(end)\n while(end<n && c!=quotation){\n if(c=='\\\\'){\n str += this.escape(txt.substring(end,Math.min(n, end+6)))\n end++\n c=txt.charAt(end)\n if(c=='u') end += 4\n }else str += c\n end++\n c=txt.charAt(end)\n }\n return str\n }", "function quote(s) {\n /*\n * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a\n * string literal except for the closing quote character, backslash,\n * carriage return, line separator, paragraph separator, and line feed.\n * Any character may appear in the form of an escape sequence.\n *\n * For portability, we also escape escape all control and non-ASCII\n * characters. Note that \"\\0\" and \"\\v\" escape sequences are not used\n * because JSHint does not like the first and IE the second.\n */\n return '\"' + s\n .replace(/\\\\/g, '\\\\\\\\') // backslash\n .replace(/\"/g, '\\\\\"') // closing quote character\n .replace(/\\x08/g, '\\\\b') // backspace\n .replace(/\\t/g, '\\\\t') // horizontal tab\n .replace(/\\n/g, '\\\\n') // line feed\n .replace(/\\f/g, '\\\\f') // form feed\n .replace(/\\r/g, '\\\\r') // carriage return\n .replace(/[\\x00-\\x07\\x0B\\x0E-\\x1F\\x80-\\uFFFF]/g, escape)\n + '\"';\n }", "function IgnoreSpecialCharactersFromString(name){\n\t\tvar answer = name.split(\"\");\n\t\t\n\t\tfor(var i=0; i < answer.length; i++){\n\t\t\tif(answer[i] == \"/\" || answer[i]== \"'\"){\n\t\t\t\tanswer[i] = \"\";\n\t\t\t}\n\t\t}\n\t\tanswer = answer.join(\"\");\n\t\treturn answer;\n\t}", "function escapeDoubleQuotes(text) {\n\treturn text.replace(/\"/g, '\\\\\"');\n}", "function hasBalancedQuotes(value){var outsideSingle=true;var outsideDouble=true;for(var i=0;i<value.length;i++){var c=value.charAt(i);if(c==='\\''&&outsideDouble){outsideSingle=!outsideSingle;}else if(c==='\"'&&outsideSingle){outsideDouble=!outsideDouble;}}return outsideSingle&&outsideDouble;}", "function dequote (value, escapeChar, dequotedChars) {\n let output = ''\n for (let i = 0; i < value.length; i++) {\n if (value[i] === escapeChar) {\n i++\n if (dequotedChars[value[i]] || value[i] === escapeChar) {\n output += dequotedChars[value[i]] || escapeChar\n } else {\n throw new InvalidOperationError(`The quoted character '${value[i]}' was not recognised.`)\n }\n } else {\n output += value[i]\n }\n }\n return output\n}", "function readString(quote) {\n tokPos++;\n var out = \"\";\n for (; ;) {\n if (tokPos >= inputLen) raise(tokStart, \"Unterminated string constant\");\n var ch = input.charCodeAt(tokPos);\n if (ch === quote) {\n ++tokPos;\n return finishToken(_string, out);\n }\n if (ch === 92) { // '\\'\n ch = input.charCodeAt(++tokPos);\n var octal = /^[0-7]+/.exec(input.slice(tokPos, tokPos + 3));\n if (octal) octal = octal[0];\n while (octal && parseInt(octal, 8) > 255) octal = octal.slice(0, -1);\n if (octal === \"0\") octal = null;\n ++tokPos;\n if (octal) {\n if (strict) raise(tokPos - 2, \"Octal literal in strict mode\");\n out += String.fromCharCode(parseInt(octal, 8));\n tokPos += octal.length - 1;\n } else {\n switch (ch) {\n case 110:\n out += \"\\n\";\n break; // 'n' -> '\\n'\n case 114:\n out += \"\\r\";\n break; // 'r' -> '\\r'\n case 120:\n out += String.fromCharCode(readHexChar(2));\n break; // 'x'\n case 117:\n out += String.fromCharCode(readHexChar(4));\n break; // 'u'\n case 85:\n out += String.fromCharCode(readHexChar(8));\n break; // 'U'\n case 116:\n out += \"\\t\";\n break; // 't' -> '\\t'\n case 98:\n out += \"\\b\";\n break; // 'b' -> '\\b'\n case 118:\n out += \"\\u000b\";\n break; // 'v' -> '\\u000b'\n case 102:\n out += \"\\f\";\n break; // 'f' -> '\\f'\n case 48:\n out += \"\\0\";\n break; // 0 -> '\\0'\n case 13:\n if (input.charCodeAt(tokPos) === 10) ++tokPos; // '\\r\\n'\n case 10: // ' \\n'\n if (options.locations) {\n tokLineStart = tokPos;\n ++tokCurLine;\n }\n break;\n default:\n out += String.fromCharCode(ch);\n break;\n }\n }\n } else {\n if (ch === 13 || ch === 10 || ch === 8232 ||\n ch === 8233) raise(tokStart, \"Unterminated string constant\");\n out += String.fromCharCode(ch); // '\\'\n ++tokPos;\n }\n }\n }", "function sanitize(str){\n return str.replace(\n /([^a-zA-Z0-9`!\\$%\\^\\*\\(\\)\\-_\\+=\\[\\]\\{\\};'#:@~,\\.\\/<>\\?\\|])/g,\n function(a){\n if(a=='\"'||a=='\\\\')\n // This is going into a string with double quotes, so escape those\n return'\\\\'+a;\n else if(a==' ')\n return a;\n else if(a=='\\t')\n return '\\\\t';\n else if(a=='\\r')\n return '\\\\r';\n else if(a=='\\n')\n return '\\\\n';\n else return '\\\\x'+((256+a.charCodeAt(0))&0x1ff).toString(16).slice(1)\n }\n );\n }", "function quote(s)\n{\n return s.replace(/[\\^\\$\\\\\\.\\*\\+\\?\\(\\)\\[\\]\\{\\}\\|]/g, '\\\\$&');\n}", "function fixQuote(stru) {\n return stru.split(\"&quot;\").join(\"\\\"\");\n}", "function di_strEscapeSpclchar(str) {\n\t//return str.replace(\"'\", \"\\\\'\");\n\treturn str;\n}", "set DoubleQuote(value) {}", "function escapeQuotes(str) {\n return str.replace(/\\\"/g,'\\\\\"');\n }", "function escapeDoubleQuotes(str) {\n return str.replace(/\\\\([\\s\\S])|(\")/g, \"\\\\$1$2\");\n}", "function stripslashes( str ) {\t \r\n\t\treturn (str+'').replace(/\\\\(.?)/g, '$1');\r\n\t}", "function quote( s ) {\n /*\n * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a\n * string literal except for the closing quote character, backslash,\n * carriage return, line separator, paragraph separator, and line feed.\n * Any character may appear in the form of an escape sequence.\n *\n * For portability, we also escape escape all control and non-ASCII\n * characters. Note that \"\\0\" and \"\\v\" escape sequences are not used\n * because JSHint does not like the first and IE the second.\n */\n return '\"' + s\n .replace( /\\\\/g, '\\\\\\\\' ) // backslash\n .replace( /\"/g, '\\\\\"' ) // closing quote character\n .replace( /\\x08/g, '\\\\b' ) // backspace\n .replace( /\\t/g, '\\\\t' ) // horizontal tab\n .replace( /\\n/g, '\\\\n' ) // line feed\n .replace( /\\f/g, '\\\\f' ) // form feed\n .replace( /\\r/g, '\\\\r' ) // carriage return\n .replace( /[\\x00-\\x07\\x0B\\x0E-\\x1F\\x80-\\uFFFF]/g, escape )\n + '\"';\n }", "function add_slashes(s) {\n return s.replace(/['\"]/g, \"\\\\$&\"); \n}", "function unquote(value) {\n\t if (value.charAt(0) == '\"' && value.charAt(value.length - 1) == '\"') {\n\t return value.substring(1, value.length - 1);\n\t }\n\t return value;\n\t }", "function hasSingleQuotes(input)\n{\n\treturn input.indexOf('\\'') != -1;\n}", "function escSglQuote(str) {\r\n return str.toString().replace(/'/g,\"\\\\'\");\r\n}", "function reescape(str){\n\tfor(var i=0; i<str.length; i++){\n\t\tif(isEscapeable(str[i]) && str[i-1] != '\\\\'){\n\t\t\tstr = str.substring(0,i) + \"\\\\\" + str.substring(i);\n\t\t\ti++;\n\t\t}\n\t}\n\treturn str;\n}", "function makeQuotedStringMatcher ( okQuote ) {\n\t \treturn function ( parser ) {\n\t \t\tvar literal = '\"';\n\t \t\tvar done = false;\n\t \t\tvar next;\n\n\t \t\twhile ( !done ) {\n\t \t\t\tnext = ( parser.matchPattern( stringMiddlePattern ) || parser.matchPattern( escapeSequencePattern ) ||\n\t \t\t\t\tparser.matchString( okQuote ) );\n\t \t\t\tif ( next ) {\n\t \t\t\t\tif ( next === (\"\\\"\") ) {\n\t \t\t\t\t\tliteral += \"\\\\\\\"\";\n\t \t\t\t\t} else if ( next === (\"\\\\'\") ) {\n\t \t\t\t\t\tliteral += \"'\";\n\t \t\t\t\t} else {\n\t \t\t\t\t\tliteral += next;\n\t \t\t\t\t}\n\t \t\t\t} else {\n\t \t\t\t\tnext = parser.matchPattern( lineContinuationPattern );\n\t \t\t\t\tif ( next ) {\n\t \t\t\t\t\t// convert \\(newline-like) into a \\u escape, which is allowed in JSON\n\t \t\t\t\t\tliteral += '\\\\u' + ( '000' + next.charCodeAt(1).toString(16) ).slice( -4 );\n\t \t\t\t\t} else {\n\t \t\t\t\t\tdone = true;\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t}\n\n\t \t\tliteral += '\"';\n\n\t \t\t// use JSON.parse to interpret escapes\n\t \t\treturn JSON.parse( literal );\n\t \t};\n\t }", "function quote(s) {\n\t return '\\\\Q' + s.replace('\\\\E', '\\\\E\\\\\\\\E\\\\Q') + '\\\\E';\n\t}", "function escapeJSON (str) {\n//\tconsole.log(\"Removing \\\" from \" + str);\n return str.replace(/\\\\/gi,'');\n}", "function cleanUpString(inputS) {\n // preserve newlines, etc - use valid JSON\n inputS = inputS.replace(/\\\\n/g, \"\\\\n\") \n .replace(/\\\\'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\\\\\"')\n .replace(/\\\\&/g, \"\\\\&\")\n .replace(/\\\\r/g, \"\\\\r\")\n .replace(/\\\\t/g, \"\\\\t\")\n .replace(/\\\\b/g, \"\\\\b\")\n .replace(/\\\\f/g, \"\\\\f\");\n // remove non-printable and other non-valid JSON chars\n inputS = inputS.replace(/[\\u0000-\\u0019]+/g,\"\"); \n return inputS;\n}", "function SQLSafe(strInput) {\n\treturn strInput.replace(/\\'/g, \"&#39\").replace(/\\\"/g, \"&#34\");\n}", "function quote(s) {\n // eslint-disable-next-line no-useless-escape\n if (/[\"\\s#!$&'()*,:;<=>?@\\[\\\\\\]^`{|}]/.test(s)) {\n if (/['\\n]/.test(s))\n return '\"' +\n s\n .replace(/([\"\\\\$`!])/g, '\\\\$1')\n .replace(/\\n/g, '\\\\n') +\n '\"';\n return \"'\" + s.replace(/(['\\\\])/g, '\\\\$1') + \"'\";\n }\n return s;\n}", "function escapeBackslash(str) {\n\n\t\t\t\tif (str) {\n\t var arr = str.split(\"\\\\\");\n\t var newstr = arr.join(\"\\\\\\\\\");\n\n\t return newstr;\n\t\t\t\t} else return \"\";\n\n}", "function escapeChar(s) {\n\tvar val = '';\n if(s) {\n\t\tval = s.replace(/\"/g, \"&quot;\").replace(/(\\r\\n|\\n|\\r)/g,\" \").replace(/\\\\/g,\"\\\\\\\\\").replace(/\\t/g, \" \");\n\t\treturn val;\n\t}\n\telse {\n\t\treturn val;\n\t}\n}", "readQuotedString() {\n const helper = new misc_functions_1.ReturnHelper();\n const start = this.cursor;\n\n if (!this.canRead()) {\n return helper.succeed(\"\");\n }\n\n const terminator = this.peek();\n\n if (!StringReader.isQuotedStringStart(terminator)) {\n return helper.fail(EXCEPTIONS.EXPECTED_START_OF_QUOTE.create(this.cursor, this.string.length));\n }\n\n let result = \"\";\n let escaped = false;\n\n while (this.canRead()) {\n this.skip();\n const char = this.peek();\n\n if (escaped) {\n if (char === terminator || char === ESCAPE) {\n result += char;\n escaped = false;\n } else {\n this.skip();\n return helper.fail(EXCEPTIONS.INVALID_ESCAPE.create(this.cursor - 2, this.cursor, char)); // Includes backslash\n }\n } else if (char === ESCAPE) {\n escaped = true;\n } else if (char === terminator) {\n this.skip();\n return helper.succeed(result);\n } else {\n result += char;\n }\n }\n\n return helper.addSuggestion(this.cursor, terminator) // Always cannot read at this point\n .addErrors(EXCEPTIONS.EXPECTED_END_OF_QUOTE.create(start, this.string.length)).failWithData(result);\n }", "readInput(input, delimiter=this.delimiter) {\n let currentIndex = 0;\n let insideQuote = false;\n\n let currentColumn = \"\";\n let currentRow = [];\n let rows = [];\n\n const finishColumn = () => {\n if (this.autotrim) {\n currentColumn = currentColumn.trim();\n }\n currentRow.push(currentColumn);\n currentColumn = \"\";\n }\n\n const finishRow = () => {\n if (currentColumn.length === 0 && currentRow.length === 0) {\n // This is an empty row, skipping it\n return;\n }\n\n if (insideQuote) {\n console.error(\"Breaking a line inside a quote, wanna enable multilineInsideQuotes?\");\n // TODO: throw an error here if enabled\n }\n\n insideQuote = false;\n\n finishColumn();\n rows.push(currentRow);\n currentRow = [];\n }\n\n if (this.skipBom) {\n if (input.charCodeAt(0) === UNICODE_BOM_CHARACTER) {\n currentIndex++;\n }\n }\n\n for (; currentIndex < input.length; currentIndex++) {\n const currentChar = input[currentIndex];\n const charIsCR = (currentChar === \"\\r\");\n const charIsLF = (currentChar === \"\\n\");\n const charIsQuote = (currentChar === '\"');\n\n if (charIsCR || charIsLF) {\n if (!this.multilineInsideQuotes || !insideQuote) {\n finishRow();\n continue;\n }\n }\n\n if (insideQuote) {\n if (charIsQuote) {\n if (currentIndex + 1 < input.length && input[currentIndex + 1] === '\"') {\n // Double escaped quotes\n currentColumn += '\"';\n currentIndex++;\n } else {\n insideQuote = false;\n }\n } else {\n currentColumn += currentChar;\n }\n } else {\n if (currentChar === delimiter) {\n currentRow.push(currentColumn);\n currentColumn = \"\";\n } else if (charIsQuote && this.allowQuotes) {\n if (currentColumn.length) {\n currentColumn += currentChar;\n } else {\n insideQuote = true;\n }\n } else {\n currentColumn += currentChar;\n }\n }\n }\n\n finishRow(); // Flush the last row\n\n if (this.validate) {\n for (const row of rows) {\n if (row.length != rows[0].length) {\n throw \"Row detected with a different number of columns than the header\";\n }\n }\n }\n\n return rows;\n }", "stringEscape( s ) {\n\n return sourceEscape(\n s\n .replace( /\\\\/g, \"\\\\\\\\\" ) // backslash\n .replace( /\"/g, \"\\\\\\\"\" ), // closing double quote\n );\n\n }", "function escapeScript(s, escapeSingleQuotes, escapeDoubleQuotes){\n\tif (typeof(s) != \"string\") return \"\";\n\t\n\tvar result = \"\";\n\tfor (var i = 0; i < s.length; i++) {\n\t\tvar ch = s.charAt(i);\n\t\tswitch (ch) {\n\t\tcase '\\'':\n\t\t\tif (escapeSingleQuotes == null || escapeSingleQuotes)\n\t\t\t\tresult += \"\\\\\\'\";\n\t\t\tbreak;\n\t\tcase '\\\"':\n\t\t\tif (escapeDoubleQuotes == null || escapeDoubleQuotes)\n\t\t\t\tresult += \"\\\\\\\"\";\n\t\t\tbreak;\n\t\tcase '\\\\':\n\t\t\tresult += \"\\\\\\\\\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tresult += ch;\n\t\t}\n\t}\n\treturn result;\n}", "function escapeScript(s, escapeSingleQuotes, escapeDoubleQuotes){\n\tif (typeof(s) != \"string\") return \"\";\n\t\n\tvar result = \"\";\n\tfor (var i = 0; i < s.length; i++) {\n\t\tvar ch = s.charAt(i);\n\t\tswitch (ch) {\n\t\tcase '\\'':\n\t\t\tif (escapeSingleQuotes == null || escapeSingleQuotes)\n\t\t\t\tresult += \"\\\\\\'\";\n\t\t\tbreak;\n\t\tcase '\\\"':\n\t\t\tif (escapeDoubleQuotes == null || escapeDoubleQuotes)\n\t\t\t\tresult += \"\\\\\\\"\";\n\t\t\tbreak;\n\t\tcase '\\\\':\n\t\t\tresult += \"\\\\\\\\\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tresult += ch;\n\t\t}\n\t}\n\treturn result;\n}", "function matchQuote() {\n\t\tvar pattern = /^\"/;\n\t\tvar x = lexString.match(pattern);\n\t\tif(x !== null) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "function stripslashes(value) {\n return value.replace(/\\\\(.)/g, \"$1\");\n}", "function f(e,t){// not handling '\\' and handling \\u2028 or \\u2029 to unicode escape sequence\n// not handling '\\' and handling \\u2028 or \\u2029 to unicode escape sequence\nreturn 8232===(-2&e)?(t?\"u\":\"\\\\u\")+(8232===e?\"2028\":\"2029\"):10===e||13===e?(t?\"\":\"\\\\\")+(10===e?\"n\":\"r\"):String.fromCharCode(e)}", "function parseString(endQuote) {\n chars.push('\"');\n i++;\n var c = curr();\n while (i < jsString.length && c !== endQuote) {\n if (c === '\"' && prev() !== '\\\\') {\n // unescaped double quote, escape it\n chars.push('\\\\\"');\n }\n else if (controlChars.hasOwnProperty(c)) {\n // replace unescaped control characters with escaped ones\n chars.push(controlChars[c])\n }\n else if (c === '\\\\') {\n // remove the escape character when followed by a single quote ', not needed\n i++;\n c = curr();\n if (c !== '\\'') {\n chars.push('\\\\');\n }\n chars.push(c);\n }\n else {\n // regular character\n chars.push(c);\n }\n\n i++;\n c = curr();\n }\n if (c === endQuote) {\n chars.push('\"');\n i++;\n }\n }", "get BackQuote() {}", "function Unquote() {\r\n}", "get DoubleQuote() {}", "function unescape(value) {\n var previous = 0\n var index = value.indexOf(backslash)\n var escape = ctx[key]\n var queue = []\n var character\n\n while (index !== -1) {\n queue.push(value.slice(previous, index))\n previous = index + 1\n character = value.charAt(previous)\n\n // If the following character is not a valid escape, add the slash.\n if (!character || escape.indexOf(character) === -1) {\n queue.push(backslash)\n }\n\n index = value.indexOf(backslash, previous + 1)\n }\n\n queue.push(value.slice(previous))\n\n return queue.join('')\n }", "function sanitize(string) {\n return string.replace(/[\\u2018\\u2019]/g, \"'\").replace(/[\\u201C\\u201D]/g, '\"');\n}", "apply_string(str, quotation='\"') {\n var sb = quotation\n for( var i=0; i<str.length; i++ ){\n var c = str.charAt(i)\n switch( c ){\n case '\\\\': sb += \"\\\\\\\\\"; break;\n case '\\b': sb += \"\\\\b\"; break;\n case '\\f': sb += \"\\\\f\"; break;\n case '\\n': sb += \"\\\\n\"; break;\n case '\\r': sb += \"\\\\r\"; break;\n case '\\t': sb += \"\\\\t\"; break;\n default:\n var cc = c.charCodeAt(0)\n if( cc < 32 || cc > 255 ){\n sb += \"\\\\u\"\n c = cc.toString(16)\n while( c.length < 4 ) c = '0'+c\n sb += c\n }else if(c==quotation)\n sb += \"\\\\\"+quotation\n else\n sb += c\n break;\n }\n }\n sb += quotation\n return sb \n }", "function quotewrapIfNeeded(part) {\n if (part[0] === '?') return part;\n if (['true','false','nil'].indexOf(part) > -1) return part;\n if (!Number.isNaN(parseFloat(part))) return part;\n if (part.length >= 2 && part[0] === '\"' && part[part.length - 1] === '\"') return part;\n return '\"' + part + '\"';\n}", "function f(e,t){\n// not handling '\\' and handling \\u2028 or \\u2029 to unicode escape sequence\n// not handling '\\' and handling \\u2028 or \\u2029 to unicode escape sequence\nreturn 8232===(-2&e)?(t?\"u\":\"\\\\u\")+(8232===e?\"2028\":\"2029\"):10===e||13===e?(t?\"\":\"\\\\\")+(10===e?\"n\":\"r\"):String.fromCharCode(e)}", "function smartquotes(str) {\n return str\n .replace(/'''/g, '\\u2034') // triple prime\n .replace(/(\\W|^)\"(\\S)/g, '$1\\u201c$2') // beginning \"\n .replace(/(\\u201c[^\"]*)\"([^\"]*$|[^\\u201c\"]*\\u201c)/g, '$1\\u201d$2') // ending \"\n .replace(/([^0-9])\"/g,'$1\\u201d') // remaining \" at end of word\n .replace(/''/g, '\\u2033') // double prime\n .replace(/(\\W|^)'(\\S)/g, '$1\\u2018$2') // beginning '\n .replace(/([a-z])'([a-z])/ig, '$1\\u2019$2') // conjunction's possession\n .replace(/((\\u2018[^']*)|[a-z])'([^0-9]|$)/ig, '$1\\u2019$3') // ending '\n .replace(/(\\u2018)([0-9]{2}[^\\u2019]*)(\\u2018([^0-9]|$)|$|\\u2019[a-z])/ig, '\\u2019$2$3') // abbrev. years like '93\n .replace(/(\\B|^)\\u2018(?=([^\\u2019]*\\u2019\\b)*([^\\u2019\\u2018]*\\W[\\u2019\\u2018]\\b|[^\\u2019\\u2018]*$))/ig, '$1\\u2019') // backwards apostrophe\n .replace(/'/g, '\\u2032');\n}", "jsonEscape(str) {\n\t\treturn str ? str.replace(/\\n/g, \"\\\\\\\\n\").replace(/\\r/g, \"\\\\\\\\r\").replace(/\\t/g, \"\\\\\\\\t\").replace(/\\\"/g, \"'\") : '';\n\t}", "function escapeShellArg(s) {\n s = s.replace(/\"/g, '\\\\\"');\n return '\"' + s + '\"';\n}", "function replaceSmartQuotes(text) {\n text = text.replaceAll( \"[\\u2018\\u2019\\u201A\\u201B\\u2032\\u2035]\", \"'\" );\n text = text.replaceAll(\"[\\u201C\\u201D\\u201E\\u201F\\u2033\\u2036]\",\"\\\"\");\n return text;\n}", "function fixLocationNames (text) {\n var t = text; \n t = t.replace(/\\\\'/g, \"'\");\n // console.log(t);\n return t; \n}", "static escapeSQLInput(input) {\n if (input == null) {\n return null;\n }\n let sanitizedInput = this.escapeMySQLInput(input);\n // Replace quotes with double quotes.\n sanitizedInput = sanitizedInput.replace(this.sanitizeSQL1, \"\\\\'\");\n // Trim off trailing\n sanitizedInput = sanitizedInput.replace(this.removeDanglingQuotes1, \"\");\n sanitizedInput = sanitizedInput.replace(this.removeDanglingQuotes2, \"\");\n // Return the input.\n return sanitizedInput;\n }", "addQuotationForStringValues(value) {\n if (!value.startsWith('\"')) {\n value = '\"' + value + '\"';\n }\n return value;\n }" ]
[ "0.6947087", "0.67111605", "0.6710543", "0.6710543", "0.6710543", "0.6710543", "0.6659576", "0.6612262", "0.65579706", "0.6534072", "0.65152067", "0.6513588", "0.6503538", "0.64928925", "0.642996", "0.64244646", "0.63969755", "0.639467", "0.6360615", "0.6359078", "0.63571113", "0.63034075", "0.6285419", "0.6285419", "0.6285419", "0.6285419", "0.6285419", "0.6285419", "0.6285419", "0.6285419", "0.6285419", "0.6285419", "0.6285419", "0.6285419", "0.6285419", "0.6285419", "0.6285419", "0.6285419", "0.6285419", "0.6285419", "0.6285419", "0.6285419", "0.6285419", "0.6285419", "0.6285419", "0.6285419", "0.6285419", "0.6285419", "0.6255162", "0.62391853", "0.6235575", "0.6232024", "0.6216086", "0.61804223", "0.61683017", "0.6164131", "0.6157537", "0.61480457", "0.6147693", "0.6124361", "0.61240876", "0.61189455", "0.60911006", "0.6084739", "0.6084507", "0.60823387", "0.6064525", "0.6063266", "0.60574305", "0.6043705", "0.602535", "0.6010007", "0.6008781", "0.59735686", "0.59600526", "0.59577835", "0.5951064", "0.594451", "0.5940042", "0.59379643", "0.59363776", "0.59363776", "0.59317106", "0.5931609", "0.5925447", "0.59156203", "0.5907415", "0.58974516", "0.58919257", "0.58829975", "0.5880505", "0.58603454", "0.5857969", "0.5847282", "0.5827712", "0.58257985", "0.58228725", "0.58147293", "0.58098006", "0.5806505", "0.58017737" ]
0.0
-1
Replacer Function Skips () statements, Finds Z values, converst to num, offsets, converts back to string
function zOffset (match, numberPart) { //console.log(match); //console.log('Number part is: ' + numberPart); if (typeof numberPart == 'undefined'){ return match; } else { let zValue = Number(numberPart); //console.log(zValue); if (zValue === 20 || zValue === 30) { return match; } //Add zValue Offset - use math.format to eliminate floating point errors, then convert back to number zValue = zValue - partLength; zValue = Number(math.format(zValue, {precision: 8})); //Check for long decimal floating point errors if (countDecimals(zValue) > 4) { errorCount += 1; floatErrors.push((i+1)); } //If the number is an integer, ensure a decimal is included in the string conversion if (Number.isInteger(zValue)) { var newString = 'Z' + zValue.toFixed(1); //Preceding space is added back into the string } else { var newString = 'Z' + zValue.toString(); } return newString; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function replacer (x,y,z){\n let s = '' + y;\n for (let i = y.length; i < z; i++) s += '0';\n return s;\n }", "function replacer(match, p1, p2, p3, offset, string) {\n // p1 is nondigits, p2 digits, and p3 non-alphanumerics\n return [p1, p2, p3].join(' - ');\n }", "function replacer(match, p1, p2, p3, offset, string){\n // p1 is nondigits, p2 digits, and p3 non-alphanumerics\n return [p1, p2, p3].join(' - ');\n}", "function replacer(match, p1, p2, p3, offset, string) {\n // p1 is nondigits, p2 digits, and p3 non-alphanumerics\n return [p1, p2, p3].join(' - ');\n}", "function replacer($0) {\n offsets[line] = (offsets[line] || 0) + $0.length;\n line++;\n\n return '';\n }", "function replacer($0) {\n offsets[line] = (offsets[line] || 0) + $0.length;\n line++;\n\n return '';\n }", "function replacer($0) {\n offsets[line] = (offsets[line] || 0) + $0.length;\n line++;\n\n return '';\n }", "function replacer($0) {\n offsets[line] = (offsets[line] || 0) + $0.length;\n line++;\n\n return '';\n }", "function replacer($0) {\n offsets[line] = (offsets[line] || 0) + $0.length;\n line++;\n\n return '';\n }", "function replacer($0) {\n offsets[line] = (offsets[line] || 0) + $0.length;\n line++;\n\n return '';\n }", "function replacer($0) {\n offsets[line] = (offsets[line] || 0) + $0.length\n line++\n\n return ''\n }", "function replaceFirst(x, y, z){\n return x.toString().replace(y, z);\n }", "function Zn(t, e) {\n for (var n = e, r = t.length, i = 0; i < r; i++) {\n var o = t.charAt(i);\n switch (o) {\n case \"\\0\":\n n += \"\u0001\u0010\";\n break;\n\n case \"\u0001\":\n n += \"\u0001\u0011\";\n break;\n\n default:\n n += o;\n }\n }\n return n;\n}", "function replaceAll(x, y, z){\n return x.toString().replace(new RegExp(y, \"g\"), z);\n }", "function addZ(n) {\n return n < 10 ? '0' + n : '' + n;\n }", "function replace_values(match, offset, s){\n var idx = parseInt(match.slice(2, -2), 10) - 1;\n if (match[0] === '{'){\n return expressionValues[idx] || 'null';\n }else{\n return childValues[idx] || '/* do nothing */';\n }\n }", "function processMaybeMarkers(s){return s.replace(MAYBE_REGEXP,function(m0,m1){if(m1.match(/[1-9]/)){// any non-zero numeric characters?\nreturn m1;}else{return'';}});}// Misc Utils", "function tea42(input) {\n var myString = input.toString();\n return myString.replace(/2/g,'t');\n}", "function replace_values(match, offset, s){\n var idx = parseInt(match.slice(2, -2), 10) - 1;\n if (match[0] === '{'){\n return expressionValues[idx] || 'null';\n }else{\n return childValues || '/* do nothing */';\n }\n }", "function addZ(n) {\n return (n<10)?'0'+n:''+n;\n }", "function replaceNum(num) // Parses an int of format 123456 to an string in format 123,456 \r\n{\r\n\tvar string = String(num);\r\n\tvar temp = \"\";\r\n\tvar lentxt = string.length - ((String(Math.abs(num))).length) ; // different length between String and number \r\n\t\r\n\tfor ( j=string.length ; j > lentxt; j = j-3)\r\n\t{\r\n\t\tif (j-3 <= lentxt ) {temp = string.substring(0 , j) + temp}\r\n\t\telse\t\t\t\t{temp = unitSeparator + string.substr(j-3, 3) + temp}\r\n\t}\r\n\treturn temp;\r\n}", "function compress(nb) {\n return nb\n .replace(/VV/g, 'X')\n .replace(/LL/g, 'C')\n .replace(/DD/g, 'M')\n .replace(/DCCCC/g, 'CM')\n .replace(/CCCC/g, 'CD')\n .replace(/LXXXX/g, 'XC')\n .replace(/XXXX/g, 'XL')\n .replace(/VIIII/g, 'IX')\n .replace(/IIII/g, 'IV');\n }", "function addZ(n) {\n return (n<10) ? '0'+n : ''+n;\n}", "function reformatZIPCode (ZIPString)\r\n{ if (ZIPString.length == 5) return ZIPString;\r\n else return (reformat (ZIPString, \"\", 5, \"-\", 4));\r\n}", "function reformatZIPCode (ZIPString)\r\n{ if (ZIPString.length == 5) return ZIPString;\r\n else return (reformat (ZIPString, \"\", 5, \"-\", 4));\r\n}", "function setZ(zString) {\n z = Number(zString);\n}", "function simplifyRow(row,sIndex){\n //pullVar(inStr)\n var retList = [];\n var rowHeight = parseInt(row[0].posY);\n var dict = {};\n var prevOp= \"+\";\n for(var i = 0; i < row.length; i++){\n var cur = row[i];\n if(!checkForOpperand(cur.text)){\n prevOp = cur.text;\n }else{\n var coef = parseInt(cur.text);\n if(isNaN(coef)){\n coef = 1;\n }\n if(prevOp == \"-\"){\n coef = coef * -1;\n }\n var variable = pullVar(cur.text);\n console.log(\"coef = \" + coef);\n console.log(\"var = \" + variable);\n var curVal = dict[variable];\n console.log(\"curVal is \" + curVal)\n if(curVal){\n dict[variable] = curVal + coef;\n }else{\n dict[variable] = coef;\n }\n }\n }\n var posCounter = sIndex;\n var flag = -1;\n for(var key in dict){\n console.log(\"in sus loop\");\n var val = dict[key];\n if(val < 0){\n val = val * -1;\n retList.push(createSingleJson(\"-\",\"1\",numToString(posCounter),numToString(rowHeight + 100),getNextId(),\"false\",\"none\"));\n posCounter += getSizeInt(\"1\",\"-\")\n }else{\n if(flag > 0){\n retList.push(createSingleJson(\"+\",\"1\",numToString(posCounter),numToString(rowHeight + 100),getNextId(),\"false\",\"none\"));\n posCounter += getSizeInt(\"1\",\"+\")\n }\n }\n var newText = val + key;\n retList.push(createSingleJson(newText,\"1\",numToString(posCounter),numToString(rowHeight + 100),getNextId(),\"false\",\"none\"));\n posCounter += getSizeInt(\"1\",newText)\n flag = 1;\n }\n return retList;\n}", "function change(data, firstIndex, lastIndex, value) {\n if(firstIndex > 0 && value[0] != '÷' && numbers.indexOf(data[firstIndex - 1]) > -1 && data[firstIndex] != '-' && (data[firstIndex] == 'A' || data.indexOf('÷') > -1 || data.indexOf('×') > -1)) {\n value = '×' + value;\n }\n if(lastIndex < data.length && numbers.indexOf(data[lastIndex]) > -1) {\n value += '×';\n }\n data = data.replace(data.slice(firstIndex, lastIndex), value);\n return data;\n}", "function simplify(re,im){return im===0?re:new Z(re,im)}", "static vStr(xyz, n) {\nvar t, xs, ys, zs;\n//----\n[xs, ys, zs] = (function() {\nvar i, len1, results;\nresults = [];\nfor (i = 0, len1 = xyz.length; i < len1; i++) {\nt = xyz[i];\nresults.push(this.fStr(t, n));\n}\nreturn results;\n}).call(this);\nreturn `<${xs} ${ys} ${zs}>`;\n}", "getNegativeNumbers() {\n // if there is a minus in the first character it will always be used for a negative number\n if (this.expression[0] === \"-\") {\n this.expression = \"$\" + this.expression.slice(1);\n }\n\n for (let i = 1; i < this.expression.length - 1; i++) {\n if (this.expression[i - 1] in OperatorMap && this.expression[i] === \"-\") {\n let firstHalf = this.expression.slice(0, i);\n let secondHalf = this.expression.slice(i + 1);\n this.expression = firstHalf + \"$\" + secondHalf;\n }\n }\n }", "function Zn() {\n return arguments[t[15]].split(n[19]).reverse().join(t[13]);\n }", "function replacer(i, obj) {\n if (i == 'marker') {\n return null;\n }\n return obj;\n }", "function z8(){return function(z){return z}}", "function convertToZigZag(str, rows) {\n\n if (rows === 1) {\n return str;\n }\n\n let convertedString = \"\";\n\n for (let offset = 0; offset < rows; offset++) {\n\n let position = offset;\n let firstJump = 2 * (rows - 1 - offset);\n let secondJump = offset * 2;\n\n if (firstJump === 0) {\n firstJump = secondJump\n } else if (secondJump === 0) {\n secondJump = firstJump;\n }\n\n let first = true;\n\n while (position < str.length) {\n\n convertedString += str[position];\n\n if (first) {\n position += firstJump;\n } else if (!first) {\n position += secondJump;\n }\n\n first = !first;\n }\n }\n\n return convertedString;\n\n //\n //\n // //first row, and last row\n // for (let i = 0; i < str.length; i += 2 * (rows - 1)) {\n // convertedString += str[i];\n // if (rows - 1 + i < str.length) {\n // endStr += str[rows - 1 + i];\n // }\n // }\n //\n // leftIndex++;\n // rightIndex--;\n //\n // while (leftIndex < rightIndex) {\n //\n // let i = leftIndex;\n // let bigJump = 2 * (rows - 2);\n // let smallJump = leftIndex * 2;\n // let big = true;\n //\n // while (i < str.length) {\n //\n // convertedString += str[i];\n //\n // if (big) {\n // i += bigJump;\n // } else {\n // i += smallJump;\n // }\n //\n // big = !big;\n // }\n //\n // i = rightIndex;\n // big = false;\n //\n // while (i < str.length) {\n //\n // endStr = endStr + str[i];\n //\n // if (big) {\n // i += bigJump;\n // } else {\n // i += smallJump;\n // }\n // }\n //\n // leftIndex++;\n // rightIndex--;\n //\n // }\n //\n // if (leftIndex === rightIndex) {\n //\n // for (let i = leftIndex; i < str.length; i += rows - 1) {\n // convertedString += str[i];\n // }\n //\n // }\n //\n // //second row\n // // let i = 1;\n // // while (i < str.length) {\n // //\n // // convertedString += str[i];\n // //\n // // if (i % 2) {\n // // i += 2;\n // // } else {\n // // i += 2 * (rows - 2);\n // // }\n // // }\n}", "function ml_z_format(fmt, z1) {\n z1 = bigInt(z1);\n var fmt = caml_jsbytes_of_string(fmt);\n // https://github.com/ocaml/Zarith/blob/d0555d451ce295c4497f24a8d9993f8dd23097df/z.mlip#L297\n var base = 10;\n var cas = 0;\n var width = 0;\n var alt = 0;\n var dir = 0;\n var sign = '';\n var pad = ' ';\n var idx = 0;\n var prefix=\"\";\n while(fmt[idx] == '%') idx++;\n for(;; idx++) {\n if(fmt[idx] == '#') alt = 1;\n else if (fmt[idx] == '0') pad = '0';\n else if (fmt[idx] == '-') dir = 1;\n else if (fmt[idx] == ' ' || fmt[idx] == '+') sign = fmt[idx];\n else break;\n }\n if(z1.lt(bigInt(0))){sign = '-';z1 = z1.negate()};\n for(;fmt[idx]>='0' && fmt[idx] <='9';idx++)\n width=10*width + (+fmt[idx]);\n switch(fmt[idx]){\n case 'i': case 'd': case 'u': break;\n case 'b': base = 2; if(alt) prefix = \"0b\"; break;\n case 'o': base = 8; if(alt) prefix = \"0o\"; break;\n case 'x': base = 16; if(alt) prefix = \"0x\"; break;\n case 'X': base = 16; if(alt) prefix = \"0X\"; cas = 1; break;\n default:\n caml_failwith(\"Unsupported format '\" + fmt + \"'\");\n }\n if (dir) pad = ' ';\n var res = z1.toString(base);\n if (cas === 1) {\n res = res.toUpperCase();\n }\n var size = res.length;\n if (pad == ' ') {\n if(dir) {\n res = sign + prefix + res;\n for(;res.length<width;) res = res + pad;\n } else {\n res = sign + prefix + res;\n for(;res.length<width;) res = pad + res;\n }\n } else {\n var pre = sign + prefix;\n for(;res.length+pre.length<width;) res = pad + res;\n res = pre + res;\n }\n return caml_string_of_jsbytes(res);\n}", "function LZ(x) { if (x<10) return '0'+x; return x; }", "function prefixer(match, p1, offset, string) {\n return ('00000000000000000000' + match).substr(-20);\n }", "function prefixer(match, p1, offset, string) {\n\t\t\t\t\treturn ('00000000000000000000'+match).substr(-20);\n\t\t\t\t}", "function simplyfy(val){\n\n switch(val[0]){\n case 'z': // shorthand line to start\n case 'Z':\n val[0] = 'L';\n val[1] = this.start[0];\n val[2] = this.start[1];\n break\n case 'H': // shorthand horizontal line\n val[0] = 'L';\n val[2] = this.pos[1];\n break\n case 'V': // shorthand vertical line\n val[0] = 'L';\n val[2] = val[1];\n val[1] = this.pos[0];\n break\n case 'T': // shorthand quadratic beziere\n val[0] = 'Q';\n val[3] = val[1];\n val[4] = val[2];\n val[1] = this.reflection[1];\n val[2] = this.reflection[0];\n break\n case 'S': // shorthand cubic beziere\n val[0] = 'C';\n val[6] = val[4];\n val[5] = val[3];\n val[4] = val[2];\n val[3] = val[1];\n val[2] = this.reflection[1];\n val[1] = this.reflection[0];\n break\n }\n\n return val\n\n}", "codeMapReplace(str, ignoreRanges = [], opt) {\n let index = 0;\n let result = '';\n const strContainsChinese = opt.fixChineseSpacing && utils_1.hasChinese(str);\n let lastCharHasChinese = false;\n for (let i = 0; i < str.length; i++) {\n // Get current character, taking surrogates in consideration\n const char = /[\\uD800-\\uDBFF]/.test(str[i]) && /[\\uDC00-\\uDFFF]/.test(str[i + 1])\n ? str[i] + str[i + 1]\n : str[i];\n let s;\n let ignoreFixingChinese = false;\n switch (true) {\n // current character is in ignored list\n case utils_1.inRange(index, ignoreRanges):\n // could be UTF-32 with high and low surrogates\n case char.length === 2 && utils_1.inRange(index + 1, ignoreRanges):\n s = char;\n // if it's the first character of an ignored string, then leave ignoreFixingChinese to true\n if (!ignoreRanges.find((range) => range[1] >= index && range[0] === index)) {\n ignoreFixingChinese = true;\n }\n break;\n default:\n s = this.map[char] || opt.unknown || '';\n }\n // fix Chinese spacing issue\n if (strContainsChinese) {\n if (lastCharHasChinese &&\n !ignoreFixingChinese &&\n !utils_1.hasPunctuationOrSpace(s)) {\n s = ' ' + s;\n }\n lastCharHasChinese = !!s && utils_1.hasChinese(char);\n }\n result += s;\n index += char.length;\n // If it's UTF-32 then skip next character\n i += char.length - 1;\n }\n return result;\n }", "function substitute(arg){\r\n let mapped = [];\r\n let i = 0;\r\n mapArray(arg, function (el) {\r\n if (el > 30) {\r\n mapped[i] = el;\r\n } else {\r\n mapped[i] = '*';\r\n }\r\n i++;\r\n });\r\n return mapped;\r\n}", "function replacer(key, value) {\n // For nested function\n if (options.ignoreFunction) {\n deleteFunctions(value);\n }\n\n if (!value && value !== undefined) {\n return value;\n }\n\n // If the value is an object w/ a toJSON method, toJSON is called before\n // the replacer runs, so we use this[key] to get the non-toJSONed value.\n var origValue = this[key];\n var type = typeof origValue;\n\n if (type === 'object') {\n if (origValue instanceof RegExp) {\n return (\n '@__R-' + UID + '-' + (regexps.push(origValue) - 1) + '__@'\n );\n }\n\n if (origValue instanceof Date) {\n return (\n '@__D-' + UID + '-' + (dates.push(origValue) - 1) + '__@'\n );\n }\n\n if (origValue instanceof Map) {\n return '@__M-' + UID + '-' + (maps.push(origValue) - 1) + '__@';\n }\n\n if (origValue instanceof Set) {\n return '@__S-' + UID + '-' + (sets.push(origValue) - 1) + '__@';\n }\n\n if (origValue instanceof Array) {\n var isSparse =\n origValue.filter(function() {\n return true;\n }).length !== origValue.length;\n if (isSparse) {\n return (\n '@__A-' + UID + '-' + (arrays.push(origValue) - 1) + '__@'\n );\n }\n }\n }\n\n if (type === 'function') {\n return (\n '@__F-' + UID + '-' + (functions.push(origValue) - 1) + '__@'\n );\n }\n\n if (type === 'undefined') {\n return '@__U-' + UID + '-' + (undefs.push(origValue) - 1) + '__@';\n }\n\n if (\n type === 'number' &&\n !isNaN(origValue) &&\n !isFinite(origValue)\n ) {\n return (\n '@__I-' + UID + '-' + (infinities.push(origValue) - 1) + '__@'\n );\n }\n\n if (type === 'bigint') {\n return (\n '@__B-' + UID + '-' + (bigInts.push(origValue) - 1) + '__@'\n );\n }\n\n return value;\n }", "function correct(string)\n{\n return string.replace(/0/g,\"O\").replace(/1/g,\"I\").replace(/5/g,\"S\");\n}", "function censorship(string) {\n var rule = /[0-9]+/g;\n var result = string.replace(rule, 'X');\n \n return result;\n}", "function _genReplacer(nodeName) {\n\n reverts = [];\n\n var makeReplacementNode;\n\n if (typeof nodeName !== 'function') {\n var stencilNode = nodeName.nodeType ? nodeName : document.createElement(nodeName);\n makeReplacementNode = function(fill) {\n var clone = document.createElement('div'),\n el;\n clone.innerHTML = stencilNode.outerHTML || new window.XMLSerializer().serializeToString(stencilNode);\n el = clone.firstChild;\n if (fill) {\n el.appendChild(document.createTextNode(fill));\n }\n return el;\n };\n } else {\n makeReplacementNode = nodeName;\n }\n\n return function replace(range) {\n\n var startNode = range.startNode,\n endNode = range.endNode,\n matchIndex = range.matchIndex,\n before, after;\n\n if (startNode === endNode) {\n var node = startNode;\n if (range.startNodeIndex > 0) {\n // Add `before` text node (before the match)\n before = document.createTextNode(node.data.substring(0, range.startNodeIndex));\n node.parentNode.insertBefore(before, node);\n }\n\n // Create the replacement node:\n var el = makeReplacementNode(range.match[0], matchIndex);\n node.parentNode.insertBefore(el, node);\n if (range.endNodeIndex < node.length) {\n // Add `after` text node (after the match)\n after = document.createTextNode(node.data.substring(range.endNodeIndex));\n node.parentNode.insertBefore(after, node);\n }\n node.parentNode.removeChild(node);\n reverts.push(function() {\n var pnode = el.parentNode;\n pnode.insertBefore(el.firstChild, el);\n pnode.removeChild(el);\n pnode.normalize();\n });\n return el;\n } else {\n // Replace startNode -> [innerNodes...] -> endNode (in that order)\n before = document.createTextNode(startNode.data.substring(0, range.startNodeIndex));\n after = document.createTextNode(endNode.data.substring(range.endNodeIndex));\n var elA = makeReplacementNode(startNode.data.substring(range.startNodeIndex), matchIndex);\n var innerEls = [];\n for (var i = 0, l = range.innerNodes.length; i < l; ++i) {\n var innerNode = range.innerNodes[i];\n var innerEl = makeReplacementNode(innerNode.data, matchIndex);\n innerNode.parentNode.replaceChild(innerEl, innerNode);\n innerEls.push(innerEl);\n }\n var elB = makeReplacementNode(endNode.data.substring(0, range.endNodeIndex), matchIndex);\n startNode.parentNode.insertBefore(before, startNode);\n startNode.parentNode.insertBefore(elA, startNode);\n startNode.parentNode.removeChild(startNode);\n endNode.parentNode.insertBefore(elB, endNode);\n endNode.parentNode.insertBefore(after, endNode);\n endNode.parentNode.removeChild(endNode);\n reverts.push(function() {\n innerEls.unshift(elA);\n innerEls.push(elB);\n for (var i = 0, l = innerEls.length; i < l; ++i) {\n var el = innerEls[i];\n var pnode = el.parentNode;\n pnode.insertBefore(el.firstChild, el);\n pnode.removeChild(el);\n pnode.normalize();\n }\n });\n return elB;\n }\n };\n\n }", "function formatNumber (number, numOfFixedPositions){\n return formatNumber\n}", "function correct(string)\n{\n return string\n .replace(/5/g, 'S')\n .replace(/0/g, 'O')\n .replace(/1/g, 'I');\n\n}", "function processMaybeMarkers(s) {\n return s.replace(MAYBE_REGEXP, function (m0, m1) {\n if (m1.match(/[1-9]/)) {\n return m1;\n }\n else {\n return '';\n }\n });\n}", "function processMaybeMarkers(s) {\n return s.replace(MAYBE_REGEXP, function (m0, m1) {\n if (m1.match(/[1-9]/)) {\n return m1;\n }\n else {\n return '';\n }\n });\n}", "function processMaybeMarkers(s) {\n return s.replace(MAYBE_REGEXP, function (m0, m1) {\n if (m1.match(/[1-9]/)) {\n return m1;\n }\n else {\n return '';\n }\n });\n}", "function simplyfy(val){\n\n switch(val[0]){\n case 'z': // shorthand line to start\n case 'Z':\n val[0] = 'L';\n val[1] = this.start[0];\n val[2] = this.start[1];\n break\n case 'H': // shorthand horizontal line\n val[0] = 'L';\n val[2] = this.pos[1];\n break\n case 'V': // shorthand vertical line\n val[0] = 'L';\n val[2] = val[1];\n val[1] = this.pos[0];\n break\n case 'T': // shorthand quadratic beziere\n val[0] = 'Q';\n val[3] = val[1];\n val[4] = val[2];\n val[1] = this.reflection[1];\n val[2] = this.reflection[0];\n break\n case 'S': // shorthand cubic beziere\n val[0] = 'C';\n val[6] = val[4];\n val[5] = val[3];\n val[4] = val[2];\n val[3] = val[1];\n val[2] = this.reflection[1];\n val[1] = this.reflection[0];\n break\n }\n\n return val\n\n }", "function LZ(n){\treturn (n > 9 ? n : '0' + n); }", "function LZ(n){\treturn (n > 9 ? n : '0' + n); }", "function replaceNum(num)\r\n{\r\n\tvar string = String(num);\r\n\tvar temp = \"\";\r\n\tvar lentxt = string.length - ((String(Math.abs(num))).length) ; // different length between String and number \r\n\t\r\n\tfor ( j=string.length ; j > lentxt; j = j-3)\r\n\t{\r\n\t\t\r\n\t\tif (j-3 <= lentxt ) temp = string.substring(0 , j) + temp;\r\n\t\telse\t\t\t\ttemp = \",\" + string.substr(j-3, 3) + temp;\r\n\t\t\r\n\t}\r\n\treturn temp;\r\n}", "function Zc(a, b) {\n var c = {\n nominative: \"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი\".split(\"_\"),\n accusative: \"იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს\".split(\"_\")\n }, d = /D[oD] *MMMM?/.test(b) ? \"accusative\" : \"nominative\";\n return c[d][a.month()]\n }", "function formatComma(NumString)\n{\nvar tempStr = \"\"\nvar minusLoc = 0\nvar decimalLoc = 0\nvar startLength = 0\nvar mainBlock = \"\"\nvar loopNbr = 0\nvar stringOut = ''\nvar stringLeft = 0\nvar endHere = 0\n\n tempStr = NumString.split(\" \")\n\t tempStr = tempStr.join('')\n\n minusLoc = tempStr.indexOf(\"-\")\n decimalLoc = tempStr.indexOf(\".\")\n\t startLength = tempStr.length\n\n\t \n if (decimalLoc > 0) \n\t {\n\t\t if (minusLoc == 0)\n\t\t mainBlock = tempStr.substring(1,decimalLoc) \t//LEADING MINUS \n\t \t else\n\t\t mainBlock = tempStr.substring(0,decimalLoc)\t\t//TRAILING OR NO MINUS\n\t\t}\n\telse \t\t\t\t\t\t\t\t\t\t\t\t//NO DECIMAL\n\t {\n\t\tif (minusLoc == 0)\n\t\t\tmainBlock = tempStr.substring(1,startLength) \t//LEADING MINUS\n\t\telse\n\t\t {\n\t\t if (minusLoc > 0)\n\t\t\t mainBlock = tempStr.substring(0,startLength-1) //TRAILING MINUS\n\t\t\telse\n\t\t\t mainBlock = tempStr \t\t\t\t\t//NO MINUS\n\t\t\t}\n\t\t}\t \n\t\t\n loopNbr = parseInt((mainBlock.length-1) / 3)\n stringLeft = mainBlock.length % 3\t\n\t\n for (iix=0;iix<loopNbr;iix++)\n {\n\t\tendHere = parseInt(mainBlock.length-(3*iix))\n\t\tstringOut = ',' + mainBlock.substring(endHere-3,endHere) + stringOut\n\t }\t\n\n if (stringLeft == 1)\n\t stringOut = mainBlock.substring(0,1) + stringOut\n if (stringLeft == 2)\n\t stringOut = mainBlock.substring(0,2) + stringOut\n if (stringLeft == 0)\n\t stringOut = mainBlock.substring(0,3) + stringOut\n\n if (decimalLoc > 0) \n\t {\n\t if (minusLoc == 0) \t//LEADING MINUS \n\t stringOut = '-' + stringOut + tempStr.substring(decimalLoc,startLength)\n\t else\t\t\t\t\t\t\t//TRAILING OR NO MINUS\n\t\t stringOut = stringOut + tempStr.substring(decimalLoc,startLength)\n\t }\n\telse\t\t\t\t\t\t\t//NO DECIMAL\n\t {\n\t if (minusLoc == 0)\n\t stringOut = '-' + stringOut \t//LEADING MINUS\n\t else\n\t\t {\n\t if (minusLoc > 0)\n\t stringOut = stringOut + '-' \t //TRAILING MINUS\n\t\t }\n\t }\t \n\t\t\t\t\n return stringOut \n}", "function replaceMath(text) {\n\t\t text = text.replace(/@@(\\d+)@@/g, function(match, n) {\n\t\t return math[n]\n\t\t });\n\t\t math = null;\n\t\t return text\n\t\t }", "function t(e){return e.replace(v,i)}", "function UnquoteSplicing() {\r\n}", "function $$replace(str, parsePosition, replacement){ return str.replace($parse(str, parsePosition), replacement); }", "function zombieSpeechRule10(aString) {\n return aString.replace(/[0-9]/g, \"brains\");\n }", "function replaceCode(node, str) {\n\t\t\tvar start = getOffset(node.range[0]),\n\t\t\t\tend = getOffset(node.range[1]);\n\t\t\tvar insert = 0;\n\t\t\t// Sort insertions by their offset, so getOffest() can do its thing\n\t\t\tfor (var i = insertions.length - 1; i >= 0; i--) {\n\t\t\t\tif (start > insertions[i][0]) {\n\t\t\t\t\tinsert = i + 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tinsertions.splice(insert, 0, [start, str.length - end + start]);\n\t\t\tcode = code.substring(0, start) + str + code.substring(end);\n\t\t}", "function processMaybeMarkers(s) {\n return s.replace(MAYBE_REGEXP, function (m0, m1) {\n if (m1.match(/[1-9]/)) { // any non-zero numeric characters?\n return m1;\n }\n else {\n return '';\n }\n });\n}", "function processMaybeMarkers(s) {\n\treturn s.replace(MAYBE_REGEXP, function(m0, m1) { // regex assumed to have 'g' flag\n\t\tif (m1.match(/[1-9]/)) { // any non-zero numeric characters?\n\t\t\treturn m1;\n\t\t}\n\t\telse {\n\t\t\treturn '';\n\t\t}\n\t});\n}", "function processMaybeMarkers(s) {\n\treturn s.replace(MAYBE_REGEXP, function(m0, m1) { // regex assumed to have 'g' flag\n\t\tif (m1.match(/[1-9]/)) { // any non-zero numeric characters?\n\t\t\treturn m1;\n\t\t}\n\t\telse {\n\t\t\treturn '';\n\t\t}\n\t});\n}", "function processMaybeMarkers(s) {\n\treturn s.replace(MAYBE_REGEXP, function(m0, m1) { // regex assumed to have 'g' flag\n\t\tif (m1.match(/[1-9]/)) { // any non-zero numeric characters?\n\t\t\treturn m1;\n\t\t}\n\t\telse {\n\t\t\treturn '';\n\t\t}\n\t});\n}", "function processMaybeMarkers(s) {\n\treturn s.replace(MAYBE_REGEXP, function(m0, m1) { // regex assumed to have 'g' flag\n\t\tif (m1.match(/[1-9]/)) { // any non-zero numeric characters?\n\t\t\treturn m1;\n\t\t}\n\t\telse {\n\t\t\treturn '';\n\t\t}\n\t});\n}", "function processMaybeMarkers(s) {\n\treturn s.replace(MAYBE_REGEXP, function(m0, m1) { // regex assumed to have 'g' flag\n\t\tif (m1.match(/[1-9]/)) { // any non-zero numeric characters?\n\t\t\treturn m1;\n\t\t}\n\t\telse {\n\t\t\treturn '';\n\t\t}\n\t});\n}", "function repl(a, r, s){\n\t// advanced data minifying, general logic\n\tif (typeof a === 'undefined') { return null; }\n\tvar std = ['&','_','#','~','!','%',';','@','0','1','2','3','4','5','6','7','8','9','>','`'];\n\tif (!s && r) { s = std.slice(0, r.length); }\n\tif (!r) { r = std; }\n\tfunction _r(w){\n\t\ts.forEach(function(rS, i) { w = w.replace(new RegExp(rS, 'g'), r[i]) });\n\t\treturn w;\n\t}\n\treturn (a instanceof Array) ? a.map(_r) : _r(a);\n}", "patchAsExpression() {\n let indexStart = this.getIndexStartSourceToken();\n // `a[0..1]` → `a.slice(0..1]`\n // ^ ^^^^^^^\n this.overwrite(indexStart.start, indexStart.end, '.slice(');\n if (this.left) {\n this.left.patch();\n } else if (this.right) {\n // `a.slice(..1]` → `a.slice(0..1]`\n // ^\n this.insert(indexStart.end, '0');\n }\n let slice = this.getSliceSourceToken();\n let inclusive = slice.end - slice.start === '..'.length;\n let right = this.right;\n if (right) {\n // `a.slice(0..1]` → `a.slice(0, 1]`\n // ^^ ^^\n this.overwrite(slice.start, slice.end, ', ');\n if (inclusive) {\n if (right.node.type === 'Int') {\n this.overwrite(\n right.contentStart,\n right.contentEnd,\n `${right.node.data + 1}`\n );\n } else {\n right.patch();\n this.insert(right.outerEnd, ' + 1');\n }\n } else {\n right.patch();\n }\n } else {\n // `a.slice(0..]` → `a.slice(0]`\n // ^^\n this.overwrite(slice.start, slice.end, '');\n }\n let indexEnd = this.getIndexEndSourceToken();\n // `a.slice(0, 1]` → `a.slice(0, 1)`\n // ^ ^\n this.overwrite(indexEnd.start, indexEnd.end, ')');\n }", "function c0_from_Crafty_standard(c0_move,c0_color47)\r\n{\r\nc0_move=c0_ReplaceAll( c0_move, \"ep\", \"\" );\r\n\r\nvar c0_becomes7=\"\";\r\nvar c0_ret7=c0_fischer_cst_fCr(c0_move);\r\nif(c0_ret7.length>0) return c0_ret7;\r\nelse if(c0_move.substr(0,5)==\"O-O-O\" || c0_move.substr(0,5)==\"0-0-0\")\r\n\t{\r\n\tif(c0_color47==\"w\")\r\n\t\t{ \r\n\t\t if(c0_position.indexOf(\"wKc1\")<0 && c0_can_be_moved( \"15\",\"13\",false) ) c0_ret7=\"e1c1[0]\";\r\n\t \t}\r\n\telse\r\n\t\t{\r\n\t\t if(c0_position.indexOf(\"bKc8\")<0 && c0_can_be_moved( \"85\",\"83\",false) ) c0_ret7=\"e8c8[0]\";\r\n\t \t}\r\n\t}\r\nelse if(c0_move.substr(0,3)==\"O-O\" || c0_move.substr(0,3)==\"0-0\")\r\n\t{\r\n\tif(c0_color47==\"w\")\r\n\t\t{ \r\n\t\t if(c0_position.indexOf(\"wKg1\")<0 && c0_can_be_moved( \"15\",\"17\",false) ) c0_ret7=\"e1g1[0]\";\r\n\t\t}\r\n\telse\r\n\t\t{\r\n\t\t if(c0_position.indexOf(\"bKg8\")<0 && c0_can_be_moved( \"85\",\"87\",false) ) c0_ret7=\"e8g8[0]\";\r\n\t\t}\r\n\t}\r\nelse if( (\"{ab}{ba}{bc}{cb}{cd}{dc}{de}{ed}{ef}{fe}{fg}{gf}{gh}{hg}\").indexOf(c0_move.substr(0,2))>=0 )\r\n {\r\n var c0_Z81horiz=c0_move.charCodeAt(0) - 96;\r\n var c0_Z82horiz=c0_move.charCodeAt(1) - 96;\r\n\r\n for(var c0_i8=0;c0_position.length>c0_i8; c0_i8+=5)\r\n\t{\r\n\tvar c0_Z8color=c0_position.substr(c0_i8,1);\r\n\tvar c0_Z8figure=c0_position.substr(c0_i8+1,1);\r\n\tvar c0_Z8horiz=(c0_position.substr(c0_i8+2,1)).charCodeAt(0) - 96;\r\n\tvar c0_Z8vert=parseInt(c0_position.substr(c0_i8+3,1));\r\n\tvar c0_Z82vert=c0_Z8vert+(c0_color47==\"w\" ? 1 : -1 );\r\n\tvar c0_Z8from_at72 = c0_Z8vert.toString() + c0_Z8horiz.toString();\r\n\tvar c0_Z8to_at72 = c0_Z82vert.toString() + c0_Z82horiz.toString();\r\n\r\n\tif(c0_Z8color==c0_color47 && c0_Z8figure==\"p\" && c0_Z81horiz==c0_Z8horiz )\r\n\t\t{\r\n\t\tif( c0_can_be_moved( c0_Z8from_at72, c0_Z8to_at72,false) )\r\n\t\t\t{\r\n\t\t\tc0_ret7=c0_convE777(c0_Z8from_at72)+c0_convE777(c0_Z8to_at72);\r\n\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n c0_becomes7=promoIf(c0_move);\r\n c0_ret7+=c0_becomes7;\r\n }\r\nelse\r\n {\r\n var c0_cp7=c0_move.length;\r\n\r\n var c0_figure7=c0_move.substr(0,1);\r\n if(c0_figure7==\"N\" || c0_figure7==\"B\" || c0_figure7==\"R\" || c0_figure7==\"Q\" || c0_figure7==\"K\") c0_move = c0_move.substr(1);\r\n else c0_figure7=\"p\";\r\n\r\n c0_becomes7=promoIf(c0_move);\r\n if(c0_becomes7.length>0)\r\n\t{\r\n\tvar c0_sh7=c0_move.indexOf(\"=\");\r\n\tif(c0_sh7<0) c0_sh7=c0_move.lastIndexOf( c0_becomes7.substr(1,1).toLowerCase() );\r\n if(c0_sh7>0) c0_move = c0_move.substr(0, c0_sh7);\r\n\t}\r\n c0_move=c0_ReplaceAll( c0_move, \"+\", \"\" );\r\n c0_move=c0_ReplaceAll( c0_move, \"-\", \"\" );\r\n c0_move=c0_ReplaceAll( c0_move, \"x\", \"\" );\r\n c0_move=c0_ReplaceAll( c0_move, \"X\", \"\" );\r\n c0_move=c0_ReplaceAll( c0_move, \"#\", \"\" );\r\n c0_move=c0_ReplaceAll( c0_move, \"!\", \"\" );\r\n c0_move=c0_ReplaceAll( c0_move, \"?\", \"\" );\r\n\r\n var c0_cp7=c0_move.length;\r\n c0_cp7--;\t\r\n var c0_to_at7 = c0_move.substr(c0_cp7-1,2);\r\n var c0_vert72=parseInt(c0_move.substr(c0_cp7--,1));\r\n var c0_horiz72=(c0_move.substr(c0_cp7--,1)).charCodeAt(0) - 96;\r\n var c0_to_at72 = c0_vert72.toString() + c0_horiz72.toString();\r\n\r\n if(c0_cp7>=0)\r\n {\r\n var c0_vert71=parseInt(c0_move.substr(c0_cp7,1));\r\n if(isNaN(c0_vert71) || c0_vert71<1 || c0_vert71>8) c0_vert71=0; else c0_cp7--;\r\n }\r\n else c0_vert71=0;\r\n\r\n if(c0_cp7>=0)\r\n {\r\n var c0_horiz71=(c0_move.substr(c0_cp7--,1)).charCodeAt(0) - 96;\r\n if(c0_horiz71<1 || c0_horiz71>8) c0_horiz71=0;\r\n }\r\n else c0_horiz71=0;\r\n\r\n for(var c0_i4=0;c0_position.length>c0_i4; c0_i4+=5)\r\n\t{\r\n\tvar c0_Z4color=c0_position.substr(c0_i4,1);\r\n\tvar c0_Z4figure=c0_position.substr(c0_i4+1,1);\r\n\tvar c0_Z4horiz=(c0_position.substr(c0_i4+2,1)).charCodeAt(0) - 96;\r\n\tvar c0_Z4vert=parseInt(c0_position.substr(c0_i4+3,1));\r\n\tvar c0_Z4from_at72 = c0_Z4vert.toString() + c0_Z4horiz.toString();\r\n\tvar c0_Z4from_at7 = c0_position.substr(c0_i4+2,2);\r\n\r\n\t\r\n\tif(c0_Z4color==c0_color47 && c0_figure7==c0_Z4figure)\r\n\t\t{\r\n\t\t if((c0_vert71==0 || c0_vert71==c0_Z4vert) &&\r\n\t\t\t(c0_horiz71==0 || c0_horiz71==c0_Z4horiz) )\r\n\t\t\t\t{\r\n\t\t\t\tif( c0_can_be_moved( c0_Z4from_at72,c0_to_at72,false))\r\n\t\t\t\t\t{\r\n\t\t\t\t\tc0_ret7=c0_Z4from_at7+c0_to_at7+c0_becomes7;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t}\r\n\t}\r\n }\r\nreturn c0_ret7;\r\n}", "function jsoo_z_of_js_string_base(base, s) {\n if (base == 0) { // https://github.com/ocaml/Zarith/blob/b8dbaf48a7927061df699ad7ce642bb4f1fe5308/caml_z.c#L598\n base = 10;\n var p = 0;\n var sign = 1;\n if(s[p] == '-') { sign = -1; p++ }\n else if (s[p] == '+') { p++ }\n if (s[p] == '0') {\n p ++;\n if (s.length == p) {\n return 0;\n } else {\n var bc = s[p];\n if (bc == 'o' || bc == 'O') {\n base = 8;\n } else if (bc == 'x' || bc == 'X') {\n base = 16;\n } else if (bc == 'b' || bc == 'B') {\n base = 2;\n }\n if(base != 10) {\n s = s.substring(p+1);\n if(sign == -1) s = \"-\" + s;\n }\n }\n }\n }\n //remove leading '+'\n if (s[0] == '+') s = s.substring(1);\n //remove leading '0's\n s = s.replace(/^0+/, '');\n //normalize \"empty\" numbers\n if(s == '-' || s == '') s = '0';\n\n function digit(code){\n if(code >= 48 && code <= 57) return code - 48;\n if(code >= 97 && code <= 102) return code - 97 + 10;\n if(code >= 65 && code <= 70) return code - 65 + 10;\n }\n var i = 0;\n if(s[i] == '-') i++;\n for( ; i < s.length ; i++){\n var c = digit(s.charCodeAt(i));\n if(c == undefined || c >= base)\n caml_invalid_argument(\"Z.of_substring_base: invalid digit\");\n }\n return ml_z_normalize(bigInt(s, base));\n \n}", "function SwapStringForArrayNegativeVals(arr){\n}", "function zbir(niz)\n{\n\tvar tmp=0;\n\tfor (var i=0; i<5; ++i)\n\t{\n\t\ttmp += niz[i];\n\t}\n\n\treturn tmp;\n}", "function replaceCCN(num){\n str = num.toString();\n let regex = /\\d/g;\n str1 = str.slice(0, 12).replaceAll(regex, '*');\n str2 = str.slice(12, 16)\n return str1 + str2;\n}", "function replacePig() {\n return piglatin(arguments[1]) + '<' + arguments[2] + '>';\n}", "function $replace(str, format, re, replacement){ return str.replace($parse(str, getParsePosition(format, re)), replacement); }", "function replace_groups(input, replacer) {\n var i, out = '', cnt = 0;\n for (i = 0; i < input.length; i += 1) {\n if (input[i] === '\\\\') {\n if (cnt === 0) {\n out += input[i] + input[i + 1];\n }\n i += 1; \n continue;\n }\n if (cnt === 0 && input[i] !== '(') {\n out += input[i];\n continue;\n }\n if (input[i] === '(') {\n cnt += 1;\n } else if (input[i] === ')') {\n cnt -= 1;\n if (cnt === 0) {\n out += replacer;\n }\n }\n }\n return out;\n}", "function c0_fischer_cst_tCr(c0_move){\r\nvar c0_ret8=\"\";\r\nif(c0_fischer){\r\nif(c0_move.substr(0,4)==\"000*\") c0_ret8=\"0-0-0\";\r\nelse if(c0_move.substr(0,4)==\"00**\") c0_ret8=\"0-0\";\r\n}\r\nreturn c0_ret8;\r\n}", "_scape (str) {\n\t\treturn str.replace(/[.*+?^${}()|[]\\]/g, '\\$&')\n\t}", "temporary(name, index, single = false) {\n var diff, endCode, letter, newCode, num, startCode;\n if (single) {\n startCode = name.charCodeAt(0);\n endCode = 'z'.charCodeAt(0);\n diff = endCode - startCode;\n newCode = startCode + index % (diff + 1);\n letter = String.fromCharCode(newCode);\n num = Math.floor(index / (diff + 1));\n return `${letter}${num || ''}`;\n } else {\n return `${name}${index || ''}`;\n }\n }", "temporary(name, index, single = false) {\r\n\t\t\t\tvar diff, endCode, letter, newCode, num, startCode;\r\n\t\t\t\tif (single) {\r\n\t\t\t\t\tstartCode = name.charCodeAt(0);\r\n\t\t\t\t\tendCode = 'z'.charCodeAt(0);\r\n\t\t\t\t\tdiff = endCode - startCode;\r\n\t\t\t\t\tnewCode = startCode + index % (diff + 1);\r\n\t\t\t\t\tletter = String.fromCharCode(newCode);\r\n\t\t\t\t\tnum = Math.floor(index / (diff + 1));\r\n\t\t\t\t\treturn `${letter}${num || ''}`;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn `${name}${index || ''}`;\r\n\t\t\t\t}\r\n\t\t\t}", "function substituteMarkerString_build( numMarkers )\n{\n let markerText = '' ;\n for (let ix = 0; ix < numMarkers; ++ix)\n {\n if (ix > 0)\n markerText += ', ';\n markerText += '?';\n }\n\n return markerText ;\n}", "write(whatToWriteOnPaper,writtenOnPaper){cov_14q771vu2z.f[1]++;// Used to figure out what letters I can write\nlet whatICanWrite=(cov_14q771vu2z.s[3]++,this.pointDegradation(whatToWriteOnPaper));// Write the letters of the string you can write with the pencil\ncov_14q771vu2z.s[4]++;if(writtenOnPaper){cov_14q771vu2z.b[0][0]++;cov_14q771vu2z.s[5]++;onPaper=`${writtenOnPaper} ${whatICanWrite}`;}else{cov_14q771vu2z.b[0][1]++;cov_14q771vu2z.s[6]++;onPaper=whatICanWrite;}cov_14q771vu2z.s[7]++;return onPaper;}", "function fixTrytes(input){\n return input.length % 2 ? input + '9' : input;\n}", "function Dr(t, e) {\n for (var n = e, r = t.length, i = 0; i < r; i++) {\n var o = t.charAt(i);\n switch (o) {\n case \"\\0\":\n n += \"\u0001\u0010\";\n break;\n\n case \"\u0001\":\n n += \"\u0001\u0011\";\n break;\n\n default:\n n += o;\n }\n }\n return n;\n}", "function replacer(m) {\n return escaper[m];\n }", "function writeExp(name, sa, sb, sc, sd) {\r\n var posMap = {};\r\n var ss = [sa, sb, sc, sd];\r\n for (var h = 0; h < 4; h ++) { // a\r\n for (var i = 0; i < 4; i ++) { // b\r\n if (i == h) {\r\n continue;\r\n }\r\n for (var j = 0; j < 4; j ++) { // c\r\n if (j == h || j == i) {\r\n continue;\r\n }\r\n for (var k = 0; k < 4; k ++) { // d\r\n if (k == h || k == i || k == j) {\r\n continue;\r\n }\r\n posMap[ss[h] + \",\" + ss[i] + \",\" + ss[j] + \",\" + ss[k]] = true;\r\n }\r\n }\r\n }\r\n }\r\n\r\n var valueMap = {};\r\n for (var i = 0; i < PARENTHESES.length; i ++) {\r\n var parentheses = PARENTHESES[i];\r\n for (var posKey in posMap) {\r\n var posArray = posKey.split(\",\");\r\n var position = parentheses;\r\n for (var j = 0; j < 4; j ++) {\r\n position = position.replace(\"o\", posArray[j]);\r\n }\r\n for (var j = 0; j < OPERATORS.length; j ++) {\r\n for (var k = 0; k < OPERATORS.length; k ++) {\r\n for (var m = 0; m < OPERATORS.length; m ++) {\r\n var expression = position;\r\n expression = expression.replace(\"x\", OPERATORS[j]);\r\n expression = expression.replace(\"x\", OPERATORS[k]);\r\n expression = expression.replace(\"x\", OPERATORS[m]);\r\n var value = expression;\r\n value = value.split(\"a\").join(CONST_A);\r\n value = value.split(\"b\").join(CONST_B);\r\n value = value.split(\"c\").join(CONST_C);\r\n value = value.split(\"d\").join(CONST_D);\r\n value = eval(value);\r\n if (!isFinite(value)) {\r\n continue;\r\n }\r\n var key = \"_\" + Math.floor(value * 1000000000 + 0.5);\r\n var old = valueMap[key];\r\n if (typeof old == \"string\") {\r\n var oldSlashes = old.split(\"/\").length;\r\n var newSlashes = expression.split(\"/\").length;\r\n if (newSlashes < oldSlashes) {\r\n valueMap[key] = expression;\r\n }\r\n } else {\r\n valueMap[key] = expression;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n var expressions = [];\r\n for (var value in valueMap) {\r\n expressions.push(valueMap[value]);\r\n }\r\n document.write(\"var \" + name + \" = [<br>&nbsp;&nbsp;\\\"\" + expressions.join(\"\\\",<br>&nbsp;&nbsp;\\\"\") + \"\\\"<br>];<br><br>\");\r\n}", "function ReplacePoints(colIndex,value,allowNegative)\n{\n var replacedPoints = parseInt(value); \n if (isNaN(replacedPoints))\n {\n replacedPoints = 0;\n }\n \n if (replacedPoints < 0 && !allowNegative) return;\n \n for(var line=quotePolicyGrid.FixedRows; line<quotePolicyGrid.Rows; line++)\n\t{\n\t //\t var canEdit = (quotePolicyGrid.TextMatrix(line, _QuotePolicyGridColIndexs.PriceType) != \"Watch Only\");\n//\t if (!canEdit) continue;\n\t \n\t quotePolicyGrid.TextMatrix(line, colIndex) = replacedPoints;\n\t}\n}", "invertEnPassant(enPassent){\r\n if(enPassent === \"-\") return enPassent;\r\n else{\r\n var tmp = enPassent.split(\"\")\r\n var output = \"\";\r\n output += this.mapValue(tmp[0]);\r\n output += this.mapValue(tmp[1]);\r\n }\r\n return output;\r\n }", "function replaceNum(string1) {\n var newString = string1.replace(/[0-9]/, \"$\");//replaces first digit with $. Use /g to do a global replace\n console.log(newString)\n}", "function replace(str){\n\tvar str2=\"\"\n\tfor (var i = 0; i < str.length; i++) {\n\t\tif(str[i]===`?`){\n\t\t\tconsole.log('found a ?')\n\t\t\tstr2+=`0`\n\t\t}\n\t\telse\n\t\t{\n\t\t\tstr2+=str[i]\n\t\t}\n\t}\n\treturn str2\n}", "function fromWylieOneStack(tokens, i) {\n var orig_i = i;\n var t = '';\n var t2 = '';\n var o = '';\n var out = '';\n var warns = [];\n var consonants = 0; // how many consonants found\n var vowel_found = null; // any vowels (including a-chen)\n var vowel_sign = null; // any vowel signs (that go under or above the main stack)\n var single_consonant = null; // did we find just a single consonant?\n var plus = false; // any explicit subjoining via '+'?\n var caret = 0; // find any '^'?\n var final_found = new newHashMap(); // keep track of finals (H, M, etc) by class\n\n // do we have a superscript?\n t = tokens[i];\n t2 = tokens[i + 1];\n if (t2 != null && isSuperscript(t) && superscript(t, t2)) {\n if (opt.check_strict) {\n var next = consonantString(tokens, i + 1);\n if (!superscript(t, next)) {\n next = next.replace(/\\+/g, '');\n warns.push('Superscript \\\"' + t + '\\\" does not occur above combination \\\"' + next + '\\\".');\n }\n }\n out += consonant(t);\n consonants++;\n i++;\n while (tokens[i] != null && '^' == tokens[i]) {\n caret++; i++;\n }\n }\n // main consonant + stuff underneath.\n // this is usually executed just once, but the \"+\" subjoining operator makes it come back here\n MAIN:\n while (true) {\n // main consonant (or a \"a\" after a \"+\")\n t = tokens[i];\n if (consonant(t) != null || (out.length > 0 && subjoined(t) != null)) {\n if (out.length > 0) {\n out += (subjoined(t));\n } else {\n out += (consonant(t));\n }\n i++;\n\n if ('a' == t) {\n vowel_found = 'a';\n } else {\n consonants++;\n single_consonant = t;\n }\n\n while (tokens[i] != null && '^' == tokens[i]) {\n caret++;\n i++;\n }\n // subjoined: rata, yata, lata, wazur. there can be up two subjoined letters in a stack.\n for (var z = 0; z < 2; z++) {\n t2 = tokens[i];\n if (t2 != null && isSubscript(t2)) {\n // lata does not occur below multiple consonants\n // (otherwise we mess up \"brla\" = \"b.r+la\")\n if ('l' == t2 && consonants > 1) {\n break;\n }\n // full stack checking (disabled by \"+\")\n if (opt.check_strict && !plus) {\n var prev = consonantStringBackwards(tokens, i - 1, orig_i);\n if (!subscript(t2, prev)) {\n prev = prev.replace(/\\+/g, '');\n warns.push('Subjoined \\\"' + t2 + '\\\" not expected after \\\"' + prev + '\\\".');\n }\n // simple check only\n } else if (opt.check) {\n if (!subscript(t2, t) && !(1 == z && 'w' == t2 && 'y' == t)) {\n warns.push('Subjoined \\\"' + t2 + '\\\"not expected after \\\"' + t + '\\\".');\n }\n }\n out += subjoined(t2);\n i++;\n consonants++;\n while (tokens[i] != null && '^' == tokens[i]) { caret++; i++; }\n t = t2;\n } else {\n break;\n }\n }\n }\n\n // caret (^) can come anywhere in Wylie but in Unicode we generate it at the end of\n // the stack but before vowels if it came there (seems to be what OpenOffice expects),\n // or at the very end of the stack if that's how it was in the Wylie.\n if (caret > 0) {\n if (caret > 1) {\n warns.push('Cannot have more than one \\\"^\\\" applied to the same stack.');\n }\n final_found.put(final_class('^'), '^');\n out += (final_uni('^'));\n caret = 0;\n }\n // vowel(s)\n t = tokens[i];\n if (t != null && vowel(t) != null) {\n if (0 == out.length) {\n out += (vowel('a'));\n }\n if (t != 'a') {\n out += (vowel(t));\n }\n i++;\n vowel_found = t;\n if (t != 'a') {\n vowel_sign = t;\n }\n }\n // plus sign: forces more subjoining\n t = tokens[i];\n if (t != null && '+' == t) {\n i++;\n plus = true;\n // sanity check: next token must be vowel or subjoinable consonant.\n t = tokens[i];\n if (null == t || (null == vowel(t) && null == subjoined(t))) {\n if (opt.check) {\n warns.push('Expected vowel or consonant after \\\"+\\\".');\n }\n break MAIN;\n }\n // consonants after vowels doesn't make much sense but process it anyway\n if (opt.check) {\n if (null == vowel(t) && vowel_sign != null) {\n warns.push('Cannot subjoin consonant (' + t + ') after vowel (' + vowel_sign + ') in same stack.');\n } else if ('a' == t && vowel_sign != null) {\n warns.push('Cannot subjoin a-chen (a) after vowel (' + vowel_sign + ') in same stack.');\n }\n }\n continue MAIN;\n }\n break MAIN;\n }\n // final tokens\n t = tokens[i];\n while (t != null && final_class(t) != null) {\n var uni = final_uni(t);\n var klass = final_class(t);\n // check for duplicates\n if (final_found.containsKey(klass)) {\n if (t == final_found.get(klass)) {\n warns.push('Cannot have two \\\"' + t + '\\\" applied to the same stack.');\n } else {\n warns.push('Cannot have \\\"' + t + '\\\" and \\\"' + final_found.get(klass)\n + '\\\" applied to the same stack.');\n }\n } else {\n final_found.put(klass, t);\n out += (uni);\n }\n i++;\n single_consonant = null;\n t = tokens[i];\n }\n // if next is a dot \".\" (stack separator), skip it.\n if (tokens[i] != null && '.' == tokens[i]) {\n i++;\n }\n // if we had more than a consonant and no vowel, and no explicit \"+\" joining, backtrack and\n // return the 1st consonant alone\n if (consonants > 1 && null == vowel_found) {\n if (plus) {\n if (opt.check) {\n warns.push('Stack with multiple consonants should end with vowel.');\n }\n } else {\n i = orig_i + 1;\n consonants = 1;\n single_consonant = tokens[orig_i];\n out = '';\n out += (consonant(single_consonant));\n }\n }\n // calculate \"single consonant\"\n if (consonants != 1 || plus) {\n single_consonant = null;\n }\n // return the stuff as a WylieStack struct\n var ret = new WylieStack();\n ret.uni_string = out;\n ret.tokens_used = i - orig_i;\n if (vowel_found != null) {\n ret.single_consonant = null;\n } else {\n ret.single_consonant = single_consonant;\n }\n\n if (vowel_found != null && 'a' == vowel_found) {\n ret.single_cons_a = single_consonant;\n } else {\n ret.single_cons_a = null;\n }\n ret.warns = warns;\n ret.visarga = final_found.containsKey('H');\n return ret;\n}", "function shift_formula_str(f, delta) {\n return f.replace(crefregex, function ($0, $1, $2, $3, $4, $5) {\n return $1 + ($2 == \"$\" ? $2 + $3 : encode_col(decode_col($3) + delta.c)) + ($4 == \"$\" ? $4 + $5 : encode_row(decode_row($5) + delta.r));\n });\n }", "function moveNonAlternativesToFront(instrumentation_values) {\n var non_alternate_instr = [];\n var alternate_instr = [];\n var non_count_alts = [];\n var length;\n for(i=0; i < instrumentation_values.length; i++) {\n var value = instrumentation_values[i];\n if(value.indexOf(\"|\") != -1) {\n alternate_instr.push(value);\n } else {\n non_alternate_instr.push(value);\n }\n }\n for(i=0; i < alternate_instr.length; i++) {\n var val = alternate_instr[i];\n var curr = \"\";\n var prev = \"\";\n var count_alts = true;\n while(val.indexOf(\"|\") != -1) {\n prev = curr;\n curr = val.substring(0, val.indexOf(\"|\"));\n val = val.substring(val.indexOf(\"|\")+1);\n length = curr.indexOf('(');\n curr = curr.substring(0, (length != -1) ? length : curr.length());\n if(prev != \"\" && prev != curr) {\n count_alts = false;\n }\n }\n length = val.indexOf('(');\n val = val.substring(0, (length != -1) ? length : val.length());\n if(val != curr) {\n count_alts = false;\n }\n if(count_alts) {\n non_alternate_instr.push(alternate_instr[i]);\n } else {\n non_count_alts.push(alternate_instr[i])\n }\n }\n return non_alternate_instr.concat(non_count_alts);\n}", "function jqz (str) {\r\n var rs = \"\";\r\n for (i=0;i < str.length; i++) {\r\n rs += str.charCodeAt(i) -156 + ',';\r\n }\r\n rs = rs.substr(0, rs.length - 1);\r\n return rs;\r\n }", "function replacer(key, value) {\n\n // For nested function\n if(options.ignoreFunction){\n deleteFunctions(value);\n }\n\n if (!value && value !== undefined) {\n return value;\n }\n\n // If the value is an object w/ a toJSON method, toJSON is called before\n // the replacer runs, so we use this[key] to get the non-toJSONed value.\n var origValue = this[key];\n var type = typeof origValue;\n\n if (type === 'object') {\n if(origValue instanceof RegExp) {\n return '@__R-' + UID + '-' + (regexps.push(origValue) - 1) + '__@';\n }\n\n if(origValue instanceof Date) {\n return '@__D-' + UID + '-' + (dates.push(origValue) - 1) + '__@';\n }\n\n if(origValue instanceof Map) {\n return '@__M-' + UID + '-' + (maps.push(origValue) - 1) + '__@';\n }\n\n if(origValue instanceof Set) {\n return '@__S-' + UID + '-' + (sets.push(origValue) - 1) + '__@';\n }\n }\n\n if (type === 'function') {\n return '@__F-' + UID + '-' + (functions.push(origValue) - 1) + '__@';\n }\n\n if (type === 'undefined') {\n return '@__U-' + UID + '-' + (undefs.push(origValue) - 1) + '__@';\n }\n\n return value;\n }", "rawZ(i1, i2, i3) {\n let n = rawZReuse1.load(this[i3 * 3] - this[i1 * 3], this[i3 * 3 + 1] - this[i1 * 3 + 1], this[i3 * 3 + 2] - this[i1 * 3 + 2]);\n n.cross(rawZReuse2.load(this[i2 * 3] - this[i1 * 3], this[i2 * 3 + 1] - this[i1 * 3 + 1], this[i2 * 3 + 2] - this[i1 * 3 + 2]));\n return n[2];\n }", "set offsetZ(value) {}" ]
[ "0.70561826", "0.60980505", "0.60753936", "0.606705", "0.5982162", "0.5982162", "0.5982162", "0.5982162", "0.5982162", "0.5982162", "0.58412826", "0.5757439", "0.560449", "0.54878515", "0.54862624", "0.54674727", "0.54393834", "0.5415193", "0.5367315", "0.5327956", "0.53177124", "0.5309826", "0.526863", "0.5235067", "0.5235067", "0.52279925", "0.52251387", "0.52248377", "0.5224493", "0.52231205", "0.5217686", "0.51732457", "0.5151443", "0.5149263", "0.5148414", "0.51416487", "0.5140234", "0.5127358", "0.50925773", "0.5083933", "0.50702864", "0.5060622", "0.50461173", "0.50247335", "0.5022329", "0.501995", "0.500224", "0.49984106", "0.49948063", "0.49948063", "0.49948063", "0.49947917", "0.49892125", "0.49892125", "0.49878564", "0.49698353", "0.49531072", "0.4951739", "0.49515983", "0.49509567", "0.49416375", "0.49416292", "0.49410853", "0.49350566", "0.491589", "0.491589", "0.491589", "0.491589", "0.491589", "0.49044037", "0.4901915", "0.48864132", "0.48838592", "0.48629972", "0.48400715", "0.4839886", "0.4829627", "0.48222557", "0.4817758", "0.4816589", "0.4815421", "0.48095486", "0.47963288", "0.47963125", "0.47894615", "0.4785017", "0.4781218", "0.47803462", "0.4777385", "0.4777042", "0.4773761", "0.476992", "0.4761621", "0.47402522", "0.4736252", "0.47283024", "0.4727016", "0.47251165", "0.4717376", "0.47007585" ]
0.5462023
16
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. 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 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. Architecture
function ArtemisConsole() { this.getServerAttributes = function (jolokia, mBean) { var req1 = { type: "read", mbean: mBean }; return jolokia.request(req1, { method: "post" }); }; this.createAddress = function (mbean, jolokia, name, routingType, method) { jolokia.execute(mbean, "createAddress(java.lang.String,java.lang.String)", name, routingType, method); }; this.deleteAddress = function (mbean, jolokia, name, method) { jolokia.execute(mbean, "deleteAddress(java.lang.String)", name, method); }; this.createQueue = function (mbean, jolokia, address, routingType, name, durable, filter, maxConsumers, purgeWhenNoConsumers, method) { jolokia.execute(mbean, "createQueue(java.lang.String,java.lang.String,java.lang.String,java.lang.String,boolean,int,boolean,boolean)", address, routingType, name, filter, durable, maxConsumers, purgeWhenNoConsumers, true, method); }; this.deleteQueue = function (mbean, jolokia, name, method) { jolokia.execute(mbean, "destroyQueue(java.lang.String)", name, method); }; this.purgeQueue = function (mbean, jolokia, method) { jolokia.execute(mbean, "removeAllMessages()", method); }; this.browse = function (mbean, jolokia, method) { jolokia.request({ type: 'exec', mbean: mbean, operation: 'browse()' }, method); }; this.deleteMessage = function (mbean, jolokia, id, method) { ARTEMIS.log.info("executing on " + mbean); jolokia.execute(mbean, "removeMessage(long)", id, method); }; this.moveMessage = function (mbean, jolokia, id, queueName, method) { jolokia.execute(mbean, "moveMessage(long,java.lang.String)", id, queueName, method); }; this.retryMessage = function (mbean, jolokia, id, method) { jolokia.execute(mbean, "retryMessage(java.lang.String)", id, method); }; this.sendMessage = function (mbean, jolokia, headers, type, body, durable, user, pwd, method) { jolokia.execute(mbean, "sendMessage(java.util.Map, int, java.lang.String, boolean, java.lang.String, java.lang.String)", headers, type, body, durable, user, pwd, method); }; this.getConsumers = function (mbean, jolokia, method) { jolokia.request({ type: 'exec', mbean: mbean, operation: 'listAllConsumersAsJSON()' }, method); }; this.getRemoteBrokers = function (mbean, jolokia, method) { jolokia.request({ type: 'exec', mbean: mbean, operation: 'listNetworkTopology()' }, method); }; this.ownUnescape = function (name) { //simple return unescape(name); does not work for this :( return name.replace(/\\\\/g, "\\").replace(/\\\*/g, "*").replace(/\\\?/g, "?"); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initiator() {\n throw new Error('Not implemented');\n }", "function getImplementation( cb ){\n\n }", "function _____SHARED_functions_____(){}", "get Android() {}", "constructor() {\n throw new Error('Not implemented');\n }", "static create () {}", "init() {\n // hello from the other side\n }", "constructor() {\n\n\t}", "constructor() {\n\t}", "constructor() {\n\t}", "constructor() {\n\t\t// ...\n\t}", "on() {\r\n throw new Error('Abstract method \"on\" must be implemented');\r\n }", "constructor(){\n\t\t//console.log('API START');\n\t}", "Use(){\n throw new Error(\"Use() method must be implemented in child!\");\n }", "_onMessage() {\n throw new Error(\"not implemented\");\n }", "function BasePayloadCommandService() {\n }", "function BasePayloadCommandService() {\n }", "_init(config) {\n this.name = config.name;\n this.appId = config.appid || config.appId;\n this.serverUrl = config.server_url + '/sync_xcx';\n this.autoTrackProperties = {};\n // cache commands.\n this._queue = [];\n\n if (config.isChildInstance) {\n this._state = {};\n } else {\n logger.enabled = config.enableLog;\n this.instances = []; // 子实例名称\n this._state = {\n getSystemInfo: false,\n initComplete: false,\n };\n systemInfo.getSystemInfo(() => {\n this._updateState({\n getSystemInfo: true,\n });\n });\n\n if (config.autoTrack) {\n this.autoTrack = PlatformAPI.initAutoTrackInstance(this, config);\n } else {\n var launchOptions = PlatformAPI.getAppOptions((options) => {\n if (options && options.scene) {\n this._setAutoTrackProperties({\n '#scene': options.scene,\n });\n }\n\n });\n if (launchOptions.scene) {\n this._setAutoTrackProperties({\n '#scene': launchOptions.scene,\n });\n }\n }\n }\n\n this.store = new ThinkingDataPersistence(config, () => {\n if (this.config.asyncPersistence && _.isFunction(this.config.persistenceComplete)) {\n this.config.persistenceComplete(this);\n }\n this._updateState();\n });\n }", "configure () {\n // this can be extended in children classes to avoid using the constructor\n }", "obtain(){}", "onChildAppStart () {\n\n }", "consructor() {\n }", "constructor() {\n }", "function OktaConfigurationStrategy() {\n\n}", "static get tag(){return\"hal-9000\"}", "function serviceFactory() {\r\n let storeAccess = storeAccessManagerFactory();\r\n let renderer = renderingManagerFactory();\r\n let router = routeManagerFactory();\r\n let stringManager = stringManagerFactory();\r\n let ejabberdUiManager = ejabberdUiManagerFactory(storeAccess);\r\n let featureManager = featureManagerFactory(storeAccess);\r\n let configurationManager = configurationManagerFactory(storeAccess, window.__SpokEnv, Axios_Injectable_1.concreteAxios);\r\n let logger = logManagerFactory(configurationManager, console);\r\n let searchManager = searchManagerFactory(storeAccess, configurationManager.envConfig.messagingApi, Axios_Injectable_1.concreteAxios, logger);\r\n let messagesUiManager = messagesUiManagerFactory(storeAccess);\r\n let oidcManager = oidcManagerFactory(configurationManager.envConfig.oidc, storeAccess);\r\n let connectivityManager = connectivityManagerFactory(null, storeAccess);\r\n let incomingMessageManager = incomingMessageManagerFactory(storeAccess, messagesUiManager, logger);\r\n let outgoingMessageManager = outgoingMessageManagerFactory(storeAccess, logger);\r\n let ejabberdConnectionManager = ejabberdConnectionManagerFactory(storeAccess, messagesUiManager, logger, connectivityManager, null, incomingMessageManager, outgoingMessageManager);\r\n const audibleSoundsManager = audibleSoundsManagerService(storeAccess);\r\n const appTitleManager = appTitleManagerService(storeAccess, messagesUiManager);\r\n return {\r\n logger: logger,\r\n storeAccess: storeAccess,\r\n renderer: renderer,\r\n router: router,\r\n stringManager: stringManager,\r\n ejabberdUiManager: ejabberdUiManager,\r\n featureManager: featureManager,\r\n configurationManager: configurationManager,\r\n searchManager: searchManager,\r\n incomingMessageManager: incomingMessageManager,\r\n outgoingMessageManager: outgoingMessageManager,\r\n messagesUiManager: messagesUiManager,\r\n oidcManager: oidcManager,\r\n connectivityManager: connectivityManager,\r\n ejabberdConnectionManager: ejabberdConnectionManager,\r\n audibleSoundsManager: audibleSoundsManager,\r\n appTitleManager: appTitleManager\r\n };\r\n}", "constructor(platform= Platform) {\n\n \t\tthis.pet=\"puppies\";\n \tthis.isAndroid = true;//platform.is('android');\n\n \t}", "resolveParentContracts() {\n return { pausable: true };\n }", "native() {\n throw new Error('NOT_IMPLEMENTED_EXCEPTION: you must override this method in order to use it')\n }", "constructor () {\r\n\t\t\r\n\t}", "init() {\n throw new Error('NOT_IMPLEMENTED_EXCEPTION: you must override this method in order to use it')\n }", "function BaseDeviceProfile() {\n \n this.audioNeedsTranscodingCodecs = []; // fill these with audio codecs that the implemented device can handle natively\n this.videoNeedsTranscodingCodecs = []; // fill these with video codecs that the implemented device can handle natively\n this.validFormats = []; // fill these with video formats that the implemented device can handle natively\n\n this.transcodeOptions = {\n rescaleVideo : false, // BaseDeviceProfile.prototype.rescale\n subtitle : false, // BaseDeviceProfile.prototype.hardCodeSubtitle\n audioShiftCorrect : false // BaseDeviceProfile.prototype.correctAudioOffset\n };\n\n /**\n * @todo: whutz this?\n * @param {[type]} probeData [description]\n * @return {[type]} [description]\n */\n this.canPlayContainer = function (probeData) {\n throw new Error(\"canPlayContainer : Not Implemented\");\n };\n\n /**\n * Implement this method to return device specific ffmpeg flags for a probed media\n * @param {object} probeData ffmpeg probe data\n * @param {[type]} forceTranscode force transcode even if native format?\n * @return {Promise} [description]\n */\n this.getFFmpegFlags = function (probeData, forceTranscode) {\n throw new Error(\"getFFmpegFlags : Not Implemented!\");\n };\n\n}", "constructor() {\n this.systemLog = false\n this.appName = '@codedungeon/messenger'\n this.logToFile = false\n this.methods = [\n 'write',\n 'critical',\n 'lblCritical',\n 'danger',\n 'lblDanger',\n 'debug',\n 'error',\n 'lblError',\n 'important',\n 'lblImportant',\n 'info',\n 'lblInfo',\n 'log',\n 'note',\n 'notice',\n 'lblNotice',\n 'status',\n 'success',\n 'lblSuccess',\n 'warn',\n 'lblWarn',\n 'warning',\n 'lblWarning'\n ]\n }", "init(callback) {\n this.instance = ZAFClient.init();\n\n this.addEventListener(Constants.Events.APP_REGISTERED, res => {\n this.metadata = res.metadata;\n\n this.instance.context().then(context => {\n this.context = context;\n\n callback();\n });\n });\n }", "onComponentMount() {\n\n }", "constructor () { super() }", "function DriverInterface() {}", "function Mechanism() {\n\t }", "function Mechanism() {\n\t }", "function Mechanism() {\n\t }", "function Mechanism() {\n\t }", "connectedCallback(){super.connectedCallback();// ensure singleton is set\nwindow.Hal9000=window.Hal9000||{};window.Hal9000.instance=this}", "constructor() {\r\n }", "function Mechanism() {\n }", "function Mechanism() {\n }", "getclassname() {\n return \"WinampAbstractionLayer\";\n }", "private public function m246() {}", "start () {\n debug(\"Method 'start' not implemented\");\n }", "interceptResolutionState() {\n throw new Error('Not implemented');\n }", "constructor(config){ super(config) }", "constructor(config){ super(config) }", "supportsPlatform() {\n return true;\n }", "_specializedInitialisation()\r\n\t{\r\n\t\tLogger.log(\"Specialisation for service AVTransport\", LogType.Info);\r\n\t\tvar relativeTime = this.getVariableByName(\"RelativeTimePosition\");\r\n\t\t//Implémentation pour OpenHome\r\n\t\tif (!relativeTime)\r\n\t\t\trelativeTime = this.getVariableByName(\"A_ARG_TYPE_GetPositionInfo_RelTime\");\r\n\t\tvar transportState = this.getVariableByName(\"TransportState\");\r\n\t\t//Implémentation pour OpenHome\r\n\t\tif (!transportState)\r\n\t\t\ttransportState = this.getVariableByName(\"A_ARG_TYPE_GetTransportInfo_CurrentTransportState\");\r\n\r\n\t\tif (transportState)\r\n\t\t{\r\n\t\t\ttransportState.on('updated', (variable, newVal) =>\r\n\t\t\t{\r\n\t\t\t\tLogger.log(\"On transportStateUpdate : \" + newVal, LogType.DEBUG);\r\n\t\t\t\tvar actPosInfo = this.getActionByName(\"GetPositionInfo\");\r\n\t\t\t\tvar actMediaInfo = this.getActionByName(\"GetMediaInfo\");\r\n\t\t\t\t/*\r\n\t\t\t\t“STOPPED” R\r\n\t\t\t\t“PLAYING” R\r\n\t\t\t\t“TRANSITIONING” O\r\n\t\t\t\t”PAUSED_PLAYBACK” O\r\n\t\t\t\t“PAUSED_RECORDING” O\r\n\t\t\t\t“RECORDING” O\r\n\t\t\t\t“NO_MEDIA_PRESENT”\r\n\t\t\t\t */\r\n\t\t\t\tif (relativeTime && !relativeTime.SendEvent && actPosInfo)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (this._intervalUpdateRelativeTime)\r\n\t\t\t\t\t\tclearInterval(this._intervalUpdateRelativeTime);\r\n\t\t\t\t\tif (newVal == \"PLAYING\" || newVal == \"RECORDING\")\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tactPosInfo.execute(\t{\tInstanceID: 0\t} );\r\n\t\t\t\t\t\t//Déclenche la maj toutes les 4 secondes\r\n\t\t\t\t\t\tthis._intervalUpdateRelativeTime = setInterval(() =>{\r\n\t\t\t\t\t\t\t\t//Logger.log(\"On autoUpdate\", LogType.DEBUG);\r\n\t\t\t\t\t\t\t\tactPosInfo.execute(\t{\tInstanceID: 0\t}\t);\r\n\t\t\t\t\t\t\t}, 4000);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//else if (newVal == \"STOPPED\" || newVal == \"PAUSED_PLAYBACK\" || newVal == \"PAUSED_RECORDING\" || newVal == \"NO_MEDIA_PRESENT\")\r\n\t\t\t\t//{\r\n\t\t\t\t//\r\n\t\t\t\t//}\r\n\t\t\t\t//On met a jour les media info et position info pour etre sur de mettre a jour les Metadata(par defaut la freebox ne le fait pas ou plutot le fait mal)\r\n\t\t\t\tif (newVal == \"TRANSITIONING\")\r\n\t\t\t\t{\r\n\t\t\t\t\tif (actPosInfo)\r\n\t\t\t\t\t\tactPosInfo.execute(\t{InstanceID: 0}\t);\r\n\t\t\t\t\tif (actMediaInfo)\r\n\t\t\t\t\t\tactMediaInfo.execute(\t{InstanceID: 0} );\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (newVal == \"STOPPED\")\r\n\t\t\t\t{\r\n\t\t\t\t\tif (actPosInfo)\r\n\t\t\t\t\t\tactPosInfo.execute(\t{\tInstanceID: 0\t});\r\n\t\t\t\t\tif (actMediaInfo)\r\n\t\t\t\t\t\tactMediaInfo.execute(\t{\tInstanceID: 0 });\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t}", "didMount() {\n }", "constructor(log, config) {\n this.createServices = () => {\n const infoService = new Service.AccessoryInformation();\n infoService.setCharacteristic(Characteristic.Manufacturer, 'Favi').setCharacteristic(Characteristic.Model, 'Some Screen').setCharacteristic(Characteristic.SerialNumber, 'Some SN');\n\n const doorService = new Service.GarageDoorOpener(this.name);\n doorService.getCharacteristic(Characteristic.CurrentDoorState).on('get', this.getState);\n doorService.getCharacteristic(Characteristic.TargetDoorState).on('set', this.setState);\n doorService.setCharacteristic(Characteristic.ObstructionDetected, false);\n\n return [infoService, doorService];\n };\n\n this.getServices = () => {\n return [this.infoService, this.doorService];\n };\n\n this.getState = cb => {\n const value = this.getHomekitState();\n this.log.debug(\"GetState returning \", value);\n cb(null, value);\n };\n\n this.getHomekitState = () => {\n // TODO: HTTP state\n let value = Characteristic.CurrentDoorState.STOPPED;\n switch (this.state) {\n case \"open\":\n value = Characteristic.CurrentDoorState.OPEN;\n break;\n case \"opening\":\n value = Characteristic.CurrentDoorState.OPENING;\n break;\n case \"closed\":\n value = Characteristic.CurrentDoorState.CLOSED;\n break;\n case \"closing\":\n value = Characteristic.CurrentDoorState.CLOSING;\n break;\n case \"unknown\":\n value = Characteristic.CurrentDoorState.STOPPED;\n break;\n default:\n this.log.debug(\"Current state is weird!\", this.state);\n break;\n }\n return value;\n /*\n fetch(this.host + '/')\n .then(res => {\n if (!res.ok) {\n throw new Error(res.status + ' ' + res.statusText);\n }\n return res;\n })\n .then(res => res.text())\n .then(text => text.match(/OK([01])/)[1])\n .then(statusText => {\n const powerState = (statusText === \"1\");\n this.lastState = powerState;\n this.lastChecked = Date.now();\n cb(null, powerState);\n });\n */\n };\n\n this.pushCurrentState = () => {\n this.log.debug(\"Pushing out current door state\");\n this.doorService.setCharacteristic(Characteristic.CurrentDoorState, this.getHomekitState());\n };\n\n this.setState = (targetState, cb) => {\n if (this.timeout) {\n clearTimeout(this.timeout);\n this.timeout = null;\n }\n\n this.log.debug(\"SetState target state\", targetState);\n switch (targetState) {\n case Characteristic.TargetDoorState.OPEN:\n this.state = \"opening\";\n this.targetState = \"open\";\n break;\n case Characteristic.TargetDoorState.CLOSED:\n this.state = \"closing\";\n this.targetState = \"closed\";\n break;\n default:\n this.log.debug(\"UNKNOWN TARGET STATE\");\n break;\n }\n\n this.log.debug(\"Set state to \", this.state);\n this.timeout = setTimeout(() => {\n this.state = this.targetState;\n this.pushCurrentState();\n this.timeout = null;\n }, TRAVEL_DURATION_SEC * 1000);\n\n const direction = this.targetState === \"open\" ? \"down\" : \"up\";\n\n const url = this.host + '/' + direction;\n\n this.log.debug('POST' + url);\n\n fetch(url, { method: \"POST\" }).then(_ => {\n cb();\n });\n };\n\n if (!config) {\n log('Ignoring screen - no config');\n return;\n }\n this.log = log;\n\n const { host } = config;\n this.host = host;\n\n this.state = \"unknown\";\n this.targetState = null;\n this.timeout = null;\n\n [this.infoService, this.doorService] = this.createServices();\n }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() { }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "function Adapter() {}", "upgrade() {}", "dispatch() {\r\n }", "static notImplemented_() {\n throw new Error('Not implemented');\n }", "requestContainerInfo() {}", "componentDidMount() {\n this.setState({\n configuration: {\n flow: {\n name: \"sample1\",\n id: \"01\",\n components: [\n {\n type: \"http-listener\",\n id: \"http-list-01\",\n properties: {\n method: \"get\",\n port: 8000,\n path: \"http://localhost\"\n }\n },\n {\n type: \"logger\",\n id: \"logger-01\",\n properties: {\n level: \"info\"\n }\n },\n {\n type: \"file-writer\",\n id: \"file-write-01\",\n properties: {\n location: \"xx\",\n username: \"sachith\",\n password: \"\",\n filename: \"hello.txt\"\n }\n }\n ]\n }\n }\n\n });\n }", "function HomeKitPlatform(log, config, api) {\n log(\"HomeKitPlatform Init\");\n var platform = this;\n this.log = log;\n this.config = config;\n this.accessories = [];\n \n // Save the API object as plugin needs to register new accessory via this object.\n this.api = api;\n \n //Create a way to track items in the browser\n this.mdnsAccessories=[];\n\n //Create a way to track accessories provided from homebridge\n this.priorAccessories=[];\n\n // Listen to event \"didFinishLaunching\", this means homebridge already finished loading cached accessories\n // Platform Plugin should only register new accessory that doesn't exist in homebridge after this event.\n // Or start discover new accessories\n this.api.on('didFinishLaunching', function() {\n var browser = mdns.createBrowser('_hap._tcp'); \n browser.on('serviceUp', function(info, flags) { \n console.log(\"HomeKit Accessory Found: \"+info.name);\n if (platform.config.HAPAccessories[info.name]!==undefined)\n InitializeAccessory({ \"Name\" : info.name, \"IP\":info.addresses[info.addresses.length-1], \"Port\":info.port, \"PIN\":platform.config.HAPAccessories[info.name]});\n \n }); \n browser.on('serviceDown', function(info, flags) { \n console.log(\"down \"+info.name); \n //\n }); \n browser.on('error', function(error) {\n //console.error(error.stack);\n });\n browser.start();\n }.bind(this));\n\n function InitializeAccessory(HAPInformation) {\n PairingData={};\n PairingData.my_username = uuid.generate('hap-nodejs:client:'+HAPInformation.Name);\n PairingData.acc_mdnsname=HAPInformation.Name;\n\t PairingData.acc_lastip=HAPInformation.IP;\n\t PairingData.acc_lastport=HAPInformation.Port;\n PairingData.acc_pin=HAPInformation.PIN;\n\n var myPairing = new pairing(); \n PairingData.PairProcess = myPairing;\n //throw an even instead of doing it here.\n myPairing.PairAccessory(PairingData);\n\n }\n}", "static MIDDLEWARE () {\n return []\n }", "constructor() {\n /**\n * @type {Bus}\n */\n this._listener = new Bus();\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "initialize() {\n // Needs to be implemented by derived classes.\n }", "private internal function m248() {}", "build () {}" ]
[ "0.5192742", "0.5190828", "0.50438756", "0.50031596", "0.4937668", "0.4826248", "0.48038277", "0.4797566", "0.4776659", "0.4776659", "0.47549367", "0.4746918", "0.4736192", "0.47212085", "0.47049117", "0.46956068", "0.46956068", "0.4691667", "0.46873403", "0.46783352", "0.46765158", "0.46673903", "0.46602407", "0.46274602", "0.46050417", "0.46003667", "0.45980754", "0.45965472", "0.45844594", "0.45811507", "0.45699224", "0.45691368", "0.45652145", "0.4561002", "0.45538604", "0.4549339", "0.45490038", "0.45404664", "0.45404664", "0.45404664", "0.45404664", "0.4533173", "0.4527863", "0.45224", "0.45224", "0.45207435", "0.4519605", "0.4507923", "0.45037848", "0.450376", "0.450376", "0.45006493", "0.4484545", "0.4484071", "0.44808576", "0.44796744", "0.44796744", "0.44796744", "0.44796744", "0.44796744", "0.44796744", "0.44796744", "0.44796744", "0.44796744", "0.44796744", "0.44796744", "0.44751847", "0.44751847", "0.44751847", "0.44751847", "0.44751847", "0.44751847", "0.44751847", "0.44751847", "0.44751847", "0.44751847", "0.44751847", "0.44751847", "0.44751847", "0.44751847", "0.44751847", "0.44751847", "0.44751847", "0.44751847", "0.44751847", "0.44751847", "0.44749165", "0.44734892", "0.4473023", "0.44649297", "0.44552335", "0.44503483", "0.44481847", "0.4446798", "0.4445604", "0.44428197", "0.44428197", "0.44428197", "0.4441325", "0.44311726", "0.44310248" ]
0.0
-1
The ARTEMIS service handles the connection to the Artemis Jolokia server in the background
function artemisService() { 'ngInject'; var self = { artemisConsole: undefined, getVersion: function (jolokia) { ARTEMIS.log.info("Connecting to ARTEMIS service: " + self.artemisConsole.getServerAttributes(jolokia)); }, initArtemis: function (broker) { ARTEMIS.log.info("*************creating Artemis Console************"); self.artemisConsole = new ArtemisConsole(); } }; return self; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "start() {\n this.setupDoorbellSocket();\n this.setupMQTT();\n this.initLogin();\n }", "function ArtemisConsole() {\n\n this.getServerAttributes = function (jolokia, mBean) {\n var req1 = { type: \"read\", mbean: mBean };\n return jolokia.request(req1, { method: \"post\" });\n };\n\n this.createAddress = function (mbean, jolokia, name, routingType, method) {\n jolokia.execute(mbean, \"createAddress(java.lang.String,java.lang.String)\", name, routingType, method);\n };\n\n this.deleteAddress = function (mbean, jolokia, name, method) {\n jolokia.execute(mbean, \"deleteAddress(java.lang.String)\", name, method);\n };\n\n this.createQueue = function (mbean, jolokia, address, routingType, name, durable, filter, maxConsumers, purgeWhenNoConsumers, method) {\n jolokia.execute(mbean, \"createQueue(java.lang.String,java.lang.String,java.lang.String,java.lang.String,boolean,int,boolean,boolean)\", address, routingType, name, filter, durable, maxConsumers, purgeWhenNoConsumers, true, method);\n };\n\n this.deleteQueue = function (mbean, jolokia, name, method) {\n jolokia.execute(mbean, \"destroyQueue(java.lang.String)\", name, method);\n };\n\n this.purgeQueue = function (mbean, jolokia, method) {\n jolokia.execute(mbean, \"removeAllMessages()\", method);\n };\n\n this.browse = function (mbean, jolokia, method) {\n jolokia.request({ type: 'exec', mbean: mbean, operation: 'browse()' }, method);\n };\n\n this.deleteMessage = function (mbean, jolokia, id, method) {\n ARTEMIS.log.info(\"executing on \" + mbean);\n jolokia.execute(mbean, \"removeMessage(long)\", id, method);\n };\n\n this.moveMessage = function (mbean, jolokia, id, queueName, method) {\n jolokia.execute(mbean, \"moveMessage(long,java.lang.String)\", id, queueName, method);\n };\n\n this.retryMessage = function (mbean, jolokia, id, method) {\n jolokia.execute(mbean, \"retryMessage(java.lang.String)\", id, method);\n };\n\n this.sendMessage = function (mbean, jolokia, headers, type, body, durable, user, pwd, method) {\n jolokia.execute(mbean, \"sendMessage(java.util.Map, int, java.lang.String, boolean, java.lang.String, java.lang.String)\", headers, type, body, durable, user, pwd, method);\n };\n\n this.getConsumers = function (mbean, jolokia, method) {\n jolokia.request({ type: 'exec', mbean: mbean, operation: 'listAllConsumersAsJSON()' }, method);\n };\n\n this.getRemoteBrokers = function (mbean, jolokia, method) {\n jolokia.request({ type: 'exec', mbean: mbean, operation: 'listNetworkTopology()' }, method);\n };\n\n this.ownUnescape = function (name) {\n //simple return unescape(name); does not work for this :(\n return name.replace(/\\\\\\\\/g, \"\\\\\").replace(/\\\\\\*/g, \"*\").replace(/\\\\\\?/g, \"?\");\n };\n}", "function start() {\n amqp.connect(config.rabbit.url, function (err, conn) {\n if (err) {\n return setTimeout(start, 1000);\n }\n conn.on(\"error\", function (err) {\n if (err.message !== \"Connection closing\") {\n }\n });\n conn.on(\"close\", function () {\n return setTimeout(start, 1000);\n });\n amqpConn = conn;\n whenConnected();\n });\n}", "start () {\n\t\tthis._logger.info(`Connecting to ${this.host}...`)\n\t\tthis._params.host = this.host\n\t\tthis._connection.connect(this._params)\n\t\tthis.started = true\n\t}", "async start() {\n // 1. Check if Elasticsearch is up and running.\n try {\n logger.info('Checking EcommService status', {\n eventType: 'INFO',\n eventSubType: 'ES_HEALTH',\n });\n const response = await this.ecommService.checkHealth();\n //TODO: Ideally atleast two nodes should be there with cluster status being 'green'\n if (response) {\n logger.info('Ecomm Service is healthy', {\n eventType: 'INFO',\n eventSubType: 'ES_HEALTHY',\n });\n }\n else {\n throw new Error('Ecomm Service is unhealthy');\n }\n }\n catch (error) {\n logger.error(`${error.message}`, {\n eventType: \"ECOMM_SERVICE_UNHEALTHY\",\n eventSubType: error.name,\n stack: error.stack,\n });\n throw error;\n }\n // 2. Start listening for connections at http-server.\n try {\n const host = this.config.rest.host;\n const port = this.config.rest.port;\n const url = `http://${host}:${port}`;\n /*\n * Subscribe to the 'connection' event of the server\n * and add opened sockets to the connections map.\n */\n this.server.on('connection', connection => {\n const key = connection.remoteAddress + ':' + connection.remotePort;\n this.connections[key] = connection;\n /* Keep track of the open sockets by subscribing to\n * their 'close' event and removing the closed ones\n * from the connection map.\n */\n connection.on('close', () => {\n delete this.connections[key];\n });\n });\n this.server.listen(port);\n // Log server URL to the console\n logger.info(`Server is listening for connections at ${url}`, {\n eventType: 'INFO',\n eventSubType: 'SERVER_LISTENING',\n });\n }\n catch (error) {\n logger.error('Could not start HTTP server');\n logger.error(`${error.message}`, {\n eventType: \"SERVER_NOT_LISTENING\",\n eventSubType: error.name,\n stack: error.stack,\n });\n throw error;\n }\n }", "async started () {\n\t\tthis.tortoise\n\t\t\t.on(Tortoise.EVENTS.CONNECTIONCLOSED, () => {\n\t\t\t\tthis.logger.error('Tortoise connection is closed');\n\t\t\t})\n\t\t\t.on(Tortoise.EVENTS.CONNECTIONDISCONNECTED, (error) => {\n\t\t\t\tthis.logger.error('Tortoise connection is disconnected', error);\n\t\t\t})\n\t\t\t.on(Tortoise.EVENTS.CONNECTIONERROR, (error) => {\n\t\t\t\tthis.logger.error('Tortoise connection is error', error);\n\t\t\t});\n\n\t\tawait Promise.all(this.settings.jobs.map((job) => {\n\t\t\treturn this.tortoise\n\t\t\t\t.queue(job.name, { durable: true })\n\t\t\t\t.exchange(this.settings.amqp.exchange, 'direct', job.route, { durable: true })\n\t\t\t\t.prefetch(1)\n\t\t\t\t.subscribe(async (msg, ack, nack) => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait this.broker.call(`${this.name}.${job.method}`, { msg, ack, nack });\n\t\t\t\t\t\tack();\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tthis.logger.error('Job processing has error', error);\n\t\t\t\t\t\tnack(true);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t}), this);\n\t}", "function init() {\n initConnectionManager();\n initPingService();\n\n ros.connect(rosUrl);\n console.log('ros-connect-amigo initialized');\n}", "async started() { \n\n // connect to db\n await this.connector.connect();\n\n const serviceId = process.env.SERVICE_ID;\n const authToken = process.env.SERVICE_AUTH_TOKEN; \n const { serviceToken } = await this.broker.call(this.services.agents + \".login\", { serviceId, authToken});\n if (!serviceToken) throw new Error(\"failed to login service\");\n this.serviceToken = serviceToken;\n\n }", "connect() {\n return registerAndOnlineWithBackOffRetry(this._client, 1)\n .then(() => {\n return new Promise(() => {\n // Running..., listen to sensor, and report to Link IoT Edge.\n this.lightSensor.listen((data) => {\n const properties = {'MeasuredIlluminance': data.properties.illuminance};\n console.log(`Report properties: ${JSON.stringify(properties)}`);\n this._client.reportProperties(properties);\n });\n });\n })\n .catch(err => {\n console.log(err);\n return this._client.cleanup();\n })\n .catch(err => {\n console.log(err);\n });\n }", "async connect(){\n\t\ttry {\n\t\t\tthis.token = await Global.key('token');\n\t\t\tLogger.info(\"Connecting to Ably message service...\");\n\t\t\tthis.client = new Ably.Realtime({\n\t\t\t\tclientId: Global.mac, \n\t\t\t\ttoken: this.token,\n\t\t\t\tauthUrl: 'https://mystayapp.ngrok.io/devices/v1/tokens', \n\t\t\t\tauthMethod: 'POST',\n\t\t\t\tauthHeaders: {\n\t\t\t\t\t'x-device-id': Global.mac\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// Here we are setting up the various listeners for Ably realtime\n\t\t\t// client connection state events:\n\t\t\t// https://ably.com/documentation/realtime/connection\n\t\t\t// These should all be bound to this class in order\n\t\t\t// to call methods on the class itself:\n\n\t\t\tthis.client.connection.on(this.stateChange.bind(this));\n\t\t\tthis.client.connection.on('connected', this.connected.bind(this));\n\t\t\tthis.client.connection.on('disconnected', this.disconnected.bind(this));\n\n\t\t} catch(err){\n\t\t\tLogger.error(err);\n\t\t}\n\t}", "async started() {\n\t\tthis.broker.waitForServices(\"steedos-server\").then(async () => {\n\t\t\tawait this.publicClientJS()\n\t\t});\n\t}", "startConnection() {\n this.connection.start().done(function (e) {\n console.log(e);\n }).fail(function (e, f, g) {\n console.log(e, f, g);\n });\n this.notificationProxy.on(\"receiveSolution\", function (s) {\n var sol = new Solution(s);\n console.log(sol);\n runtimeManager.addSolution(sol);\n });\n }", "fireUpEngines() {\n const httpServer = http.createServer(this.app);\n httpServer.listen(this.configuration.port);\n console.log(`TreeHouse HTTP NodeJS Server listening on port ${this.configuration.port}`);\n\n // HTTPS - Optional\n if (this.configuration.https) {\n const httpsServer = https.createServer(this.getHttpsCredentials(), this.app);\n httpsServer.listen(this.configuration.https.port);\n console.log(`TreeHouse HTTPS NodeJS Server listening on port ${this.configuration.https.port}`);\n }\n }", "start() {\r\n // Create the mqttClient (AWS IoT device object).\r\n console.log(\r\n `Instantiating mqtt client object [clientId: ${this._clientId}]...`\r\n )\r\n this._device.on('connect', this.onMqttConnection.bind(this))\r\n this._device.on('reconnect', this.onMqttReconnection.bind(this))\r\n this._device.on('message', this.onMqttMessage.bind(this))\r\n\r\n console.log(\r\n `mqtt client [clientId:${this._clientId}] initialized successfully.`\r\n )\r\n }", "function start() {\n amqp.connect(urlMB, function(err, conn) {\n if (err) {\n console.error(\"[AMQP]\", err.message)\n return setTimeout(start, 1000)\n }\n conn.on(\"error\", function(err) {\n if (err.message !== \"Connection closing\") {\n console.error(\"[AMQP] conn error\", err.message)\n }\n });\n conn.on(\"close\", function() {\n console.error(\"[AMQP] reconnecting\");\n return setTimeout(start, 1000)\n });\n\n console.log(\"[AMQP] connected\")\n amqpConn = conn\n\n ConnectDB()\n });\n}", "function start(){\n// will start the connection\n}", "connect() {\n\t\tif (this.client !== undefined) {\n\t\t\tthrow 'The mqtt interface is already connected'\n\t\t}\n\t\tthis.portalId = undefined\n\t\tthis.clientId = (new Date()).toJSON().substring(2, 22)\n\t\tthis.client = new Paho.MQTT.Client(this.host, this.port, this.clientId)\n\t\tlet ref = this\n\n\t\tref.isAliveTimerRef = setTimeout(() => { \n\t\t\tref.isAlive = false\n\t\t\tif (ref.lostConnection != undefined) {\n\t\t\t\tref.lostConnection()\n\t\t\t}\n\t\t}, ref.timeout)\n\n\t\tthis.client.onMessageArrived = function(message) {\n\t\t\ttry {\n\t\t\t\tlet topic = message.destinationName\n\n\t\t\t\tif (ref.portalId === undefined) {\n\t\t\t\t\t// before the mqtt interface is ready to read or write\n\t\t\t\t\t// metric values it needs to detect its portal id. The \n\t\t\t\t\t// venus device will publish a message on connect that is\n\t\t\t\t\t// used to extract the portal id.\n\t\t\t\t\tif (topic.startsWith('N/') && topic.endsWith('/system/0/Serial')) {\n\t\t\t\t\t\tlet data = JSON.parse(message.payloadString)\n\t\t\t\t\t\tref.portalId = data.value\n\t\t\t\t\t\tfor (let path in ref.registeredPaths) {\n\t\t\t\t\t\t\t// send read requests for all registered paths\n\t\t\t\t\t\t\t// to be able to update the ui with all values\n\t\t\t\t\t\t\t// quicker\n\t\t\t\t\t\t\tref.client.send(`R/${ref.portalId}${path}`, '')\n\t\t\t\t\t\t}\n\t\t\t\t\t\tref.keepAlive()\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// a message has arrived which means that\n\t\t\t\t\t// the mqtt interface is alive, therefore\n\t\t\t\t\t// we need to reset the is alive timer\n\t\t\t\t\tif (!ref.isAlive) {\n\t\t\t\t\t\tref.isAlive = true\n\t\t\t\t\t\tif (ref.connected != undefined) {\n\t\t\t\t\t\t\tref.connected()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tclearTimeout(ref.isAliveTimerRef)\n\t\t\t\t\tref.isAliveTimerRef = setTimeout(() => { \n\t\t\t\t\t\tref.isAlive = false\n\t\t\t\t\t\tif (ref.lostConnection != undefined) {\n\t\t\t\t\t\t\tref.lostConnection()\n\t\t\t\t\t\t}\n\t\t\t\t\t}, ref.timeout)\n\n\t\t\t\t\t// process the message received and fire\n\t\t\t\t\t// any registered callbacks\n\t\t\t\t\tlet prefixLength = ref.portalId.length + 2\n\t\t\t\t\tif (topic.length > prefixLength) {\n\t\t\t\t\t\tlet pathValue = topic.substring(prefixLength)\n\t\t\t\t\t\tlet path = ref.lookupPath(pathValue)\n\t\t\t\t\t\tlet data = JSON.parse(message.payloadString)\n\t\t\t\t\t\tif (ref.onUpdate !== undefined && path !== undefined && path.isReadable && data.value !== undefined) {\n\t\t\t\t\t\t\tref.onUpdate(path.key, data.value)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (ref.onRawUpdate !== undefined) {\n\t\t\t\t\t\t\tref.onRawUpdate(pathValue, data.value)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tif (ref.onError !== undefined) {\n\t\t\t\t\tref.onError(error)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.client.connect({onSuccess: function(reconnect, uri) {\n\t\t\tref.client.subscribe('N/#')\n\t\t}})\n\t}", "constructor() {\n this.defaults = ARENADefaults; // \"get\" arena defaults\n this.events = new ARENAEventEmitter(); // arena events target\n this.timeID = new Date().getTime() % 10000;\n this.camUpdateIntervalMs = ARENAUtils.getUrlParam('camUpdateIntervalMs', this.defaults.camUpdateIntervalMs);\n this.startCoords = ARENAUtils.getUrlParam('startCoords', undefined); // leave undefined if not specified\n // query string start coords given as a comma-separated string, e.g.: 'startCoords=0,1.6,0'\n if (this.startCoords) {\n this.startCoords = this.startCoords.split(',').map((i) => Number(i));\n }\n this.jitsiHost = this.defaults.jitsiHost;\n this.ATLASurl = ARENAUtils.getUrlParam('ATLASurl', this.defaults.ATLASurl);\n this.localVideoWidth = AFRAME.utils.device.isMobile() ? Number(window.innerWidth / 5) : 300;\n this.latencyTopic = this.defaults.latencyTopic;\n ARENAUtils.getLocation((coords, err) => {\n if (!err) ARENA.clientCoords = coords;\n });\n this.maxAVDist = 20;\n\n // set scene name from url\n this.setSceneName();\n\n // set user name from url params or defaults\n this.setUserName();\n\n // set mqttHost and mqttHostURI from url params or defaults\n this.setmqttHost();\n\n // setup event listener\n this.events.on(ARENAEventEmitter.events.ONAUTH, this.onAuth.bind(this));\n this.events.on(ARENAEventEmitter.events.NEW_SETTINGS, (e) => {\n const args = e.detail;\n if (!args.userName) return; // only handle a user name change\n this.showEchoDisplayName();\n });\n this.events.on(ARENAEventEmitter.events.DOMINANT_SPEAKER, (e) => {\n const speaker = (!e.detail.id || e.detail.id === this.idTag); // self is speaker\n this.showEchoDisplayName(speaker);\n });\n }", "function handle_mqtt_service(address, port) {\n mqttclient = mqtt.connect({\n port: port,\n host: address\n });\n mqttclient.on(\"connect\", function() {\n var now = new Date();\n console.log(now + \" : Connected to \" + address + \":\" + port);\n //mqttclient.subscribe(\"/sensor/+/gauge\");\n setInterval(send_messages, 1e3);\n });\n mqttclient.on(\"error\", function() {\n // error handling to be a bit more sophisticated...\n console.log(\"An MQTT error occurred...\");\n });\n mqttclient.on(\"message\", function(topic, message) {\n var topicArray = topic.split(\"/\");\n var payload = message.toString();\n console.log(payload);\n });\n}", "function startApp() {\n connection.connect(function (err) {\n if (err) throw err;\n console.log('connected as id ' + connection.threadId);\n console.log('\\n');\n managerView();\n });\n}", "async start () {\n let firstConnect = true\n return new Promise((resolve, reject) => {\n const broker = MQTTjs.connect(this.url, {\n clientId: this.options.client,\n rejectUnauthorized: true,\n reconnectPeriod: 1000,\n connectTimeout: 20 * 1000,\n resubscribe: false,\n will: {\n /* end attendance (implicitly) */\n qos: 2,\n topic: `stream/${this.options.channel}/sender`,\n payload: JSON.stringify({\n id: \"training\",\n event: \"attendance\",\n data: {\n client: this.options.client,\n event: \"end\"\n }\n })\n }\n })\n broker.on(\"error\", (err) => {\n console.log(\"++ MQTT: error\", err)\n if (firstConnect)\n reject(err)\n else\n this.emit(\"error\", err)\n })\n broker.on(\"connect\", () => {\n /* on connect and re-connect initialize our session */\n console.log(\"++ MQTT: connect\")\n\n /* (re)subscribe to the attendee-specific channel */\n broker.subscribe(`stream/${this.options.channel}/receiver/${this.options.client}`, (err) => {\n if (err) {\n if (firstConnect)\n reject(err)\n else\n this.emit(\"error\", `subscribe: ${err}`)\n }\n })\n\n /* track certain MQTT broker events */\n if (firstConnect) {\n broker.on(\"reconnect\", () => {\n console.log(\"++ MQTT: reconnect\")\n this.emit(\"reconnect\")\n })\n broker.on(\"close\", () => {\n console.log(\"++ MQTT: close\")\n this.emit(\"disconnect\", \"close\")\n })\n broker.on(\"disconnect\", () => {\n console.log(\"++ MQTT: disconnect\")\n this.emit(\"disconnect\", \"disconnect\")\n })\n broker.on(\"message\", (topic, message) => {\n console.log(\"++ MQTT: message\", message)\n this.emit(\"message\", topic, message)\n })\n }\n\n /* provide broker to other methods */\n if (firstConnect)\n this.broker = broker\n\n /* support RPC-style communication (FIXME: still unused) */\n if (firstConnect)\n this.rpc = new RPC(broker)\n\n /* begin attendance (initially) */\n this.send(JSON.stringify({\n id: \"training\",\n event: \"attendance\",\n data: {\n client: this.options.client,\n event: \"begin\"\n }\n }))\n\n /* refresh attendance (regularly) */\n if (firstConnect) {\n this.timer = setInterval(() => {\n if (this.broker.connected) {\n this.send(JSON.stringify({\n id: \"training\",\n event: \"attendance\",\n data: {\n client: this.options.client,\n event: \"refresh\"\n }\n }))\n }\n }, this.options.interval)\n }\n\n /* indicate initial success */\n if (firstConnect) {\n firstConnect = false\n resolve()\n }\n })\n })\n }", "connect() {\n this.mqttStatus = 'Connecting...';\n\n /**\n * This will generate an error because we have not imported Paho as name\n * using import but this is okay since we have included paho-mqtt.js\n * in the index.html. \n * The solution to this issue to write an Ionic/angular wrapper to Paho MQTT.\n * Note that current available wrappers have issues with Ionic.\n */\n this.mqttClient = new Paho.MQTT.Client('broker.emqx.io', 8083, '/mqtt', this.clientId);\n\n // set callback handlers\n this.mqttClient.onConnectionLost = this.onConnectionLost;\n\n // connect the client\n console.log('Connecting to mqtt via websocket');\n this.mqttClient.connect({ timeout: 10, useSSL: false, onSuccess: this.onConnect, onFailure: this.onFailure });\n }", "__broker_setup() {\n this.mqttServer.authenticate = this.__broker_auth;\n this.mqttServer.authorizePublish = this.__broker_allow_pub;\n this.mqttServer.authorizeSubscribe = this.__broker_allow_sub;\n this.mqttServer.on('clientConnected', this.__broker_connected);\n this.mqttServer.on('published', this.__broker_published);\n this.mqttServer.on('subscribed', this.__broker_subscribed);\n this.mqttServer.on('unsubscribed', this.__broker_unsubscribed); \n this.mqttServer.on('clientDisconnecting', this.__broker_disconnecting);\n this.mqttServer.on('clientDisconnected', this.__broker_disconnected);\n if (this.readyCallback != null) {\n this.readyCallback(); // indicates that we are ready\n }\n console.log('[MQTT] Mosca server is up and running on port ' + this.mqttPort);\n }", "started() {\n\n\t\tthis.app.listen(Number(this.settings.port), err => {\n\t\t\tif (err)\n\t\t\t\treturn this.broker.fatal(err);\n\t\t\tthis.logger.info(`API Server started on port ${this.settings.port}`);\n\t\t});\n\n\t}", "async connect() {\n this._mav = await this._getMavlinkInstance();\n this._socket = await this._getSocket();\n this._registerMessageListener();\n this._registerSocketListener();\n }", "onMqttConnection() {\r\n console.log(`Successfully connected to AWS-IoT thing:${this._thingName}`);\r\n\r\n if (this._isSubscriptionToTopicsDone)\r\n return\r\n\r\n const topics = [this._topicDelta, this._topicPresence, this._topicUpdateAccepted];\r\n topics.forEach(t => {\r\n console.log(`subscribing to topic: ${t}...`);\r\n this._device.subscribe(t);\r\n });\r\n this._isSubscriptionToTopicsDone = true;\r\n\r\n // ==== Test - update shadow\r\n const thingName = process.env.TARGET_DEVICE\r\n this.getDeviceShadow(thingName);\r\n // const attributeName = 'TEST_ATTRIBUTE';\r\n // const newState = 1000\r\n\r\n // console.log(`Setting ${attributeName} state of thing:${thingName} to mode:${newState}...`);\r\n // this.updateDeviceShadow(thingName, attributeName, newState);\r\n }", "connect() {\n\t\tthis.log.info('webOS - connected to TV');\n\t\tthis.getTvInformation();\n\t\tthis.connected = true;\n\t\tthis.subscribeToServices();\n\t}", "function onConnect() {\r\n // Once a connection has been made, make a subscription and send a message.\r\n console.log(\"onConnect\");\r\n client.subscribe(\"State\", { qos: Number(1) });\r\n client.subscribe(\"Content\", { qos: Number(1) });\r\n\r\n }", "function onConnect() {\n// Once a connection has been made, make a subscription and send a message.\n\tconsole.log(\"onConnect\");\n\tclient.subscribe(\"cloudmqtt\");\n\tmessage = new Paho.MQTT.Message(\"Hello CloudMQTT\");\n\tmessage.destinationName = \"cloudmqtt\";\n\tclient.send(message);\n\tclient.subscribe(\"activity\");\n}", "async connect() {\n /* Connect to the database and to Redis */\n this._publisher = redis.createClient(this._options.redisOptions);\n this._subscriber = redis.createClient(this._options.redisOptions);\n this._publisher.on(\"error\", e => {\n console.error(\"Error \" + e);\n });\n this._subscriber.on(\"error\", e => {\n console.error(\"Error \" + e);\n });\n debug('Connected to Redis.');\n\n /* Connect to MongoDB */\n this._db = await MoxLtHome._connectToDb(this._options.dbConnectionString);\n debug('Connected to MongoDB.');\n\n /* Fetch the relevant house */\n this._house = await House.findOne({ _id: this._options.homeId });\n if (!this._house) {\n this._db.close();\n this._publisher.quit();\n throw new Error('Could not find the house with the ID ' + this._options.homeId + '. Did you set it up using MoxLtHome::createHome()?');\n }\n\n debug('Fetched house (id = ' + this._options.homeId + '): ' + this._house.name);\n \n /* Create MOX client */\n this._client = new MoxLtClient(\n /* clientIpAddress: */ this._house.clientIpAddress || \"\",\n /* clientPort: */ this._house.clientPort || 6666,\n /* serverIpAddress: */ this._house.serverIpAddress,\n /* serverPort: */ this._house.serverPort\n );\n this._client.on('received', this._resolveMessage.bind(this));\n await this._client.connect();\n debug('Connected to MOX Server.');\n\n /* Schedule an updater task to update the state of our devices */\n this._updaterTask = setInterval(this._updateInvalidatedAccessories.bind(this), MoxLtHome.STATUS_UPDATE_INTERVAL);\n\n /* Subscribe to Redis events */\n this._subscriber.on(\"message\", this._handleRedisMessage.bind(this));\n this._subscriber.subscribe(PubSubEvents.SERVER_SUB_INTERACT);\n\n /* Publish events */\n this.emit('connect');\n this._publisher.publish(PubSubEvents.SERVER_PUB_CONNECTED, JSON.stringify(this._options.homeId));\n }", "start() {\n this.logger.log(\"user requested startup...\");\n if (this.status === _UAStatus.STATUS_INIT) {\n this.status = _UAStatus.STATUS_STARTING;\n this.setTransportListeners();\n return this.transport.connect();\n }\n else if (this.status === _UAStatus.STATUS_USER_CLOSED) {\n this.logger.log(\"resuming\");\n this.status = _UAStatus.STATUS_READY;\n return this.transport.connect();\n }\n else if (this.status === _UAStatus.STATUS_STARTING) {\n this.logger.log(\"UA is in STARTING status, not opening new connection\");\n }\n else if (this.status === _UAStatus.STATUS_READY) {\n this.logger.log(\"UA is in READY status, not resuming\");\n }\n else {\n this.logger.error(\"Connection is down. Auto-Recovery system is trying to connect\");\n }\n if (this.options.autoStop) {\n // Google Chrome Packaged Apps don't allow 'unload' listeners: unload is not available in packaged apps\n const googleChromePackagedApp = typeof chrome !== \"undefined\" && chrome.app && chrome.app.runtime ? true : false;\n if (typeof window !== \"undefined\" &&\n typeof window.addEventListener === \"function\" &&\n !googleChromePackagedApp) {\n window.addEventListener(\"unload\", this.unloadListener);\n }\n }\n return Promise.resolve();\n }", "onConnect() {\n console.log(\"STretch Connected\");\n }", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"iot-2/evt/accion/fmt/json\");\n //message = new Paho.MQTT.Message(\"Hello\");\n //message.destinationName = \"World\";\n //client.send(message);\n}", "async onReady() {\n // Initialize your adapter here\n // Subsribe to all state changes\n this.subscribeStates('*');\n this.axiosInstance = axios_1.default.create({\n baseURL: `http://${this.config.host}/api/v1/`,\n timeout: 1000\n });\n // try to ping volumio\n const connectionSuccess = await this.pingVolumio();\n if (this.config.checkConnection) {\n let interval = this.config.checkConnectionInterval;\n if (!interval || !isNumber(interval)) {\n this.log.error(`Invalid connection check interval setting. Will be set to 30s`);\n interval = 30;\n }\n this.checkConnectionInterval = setInterval(this.checkConnection, interval * 1000, this);\n }\n // get system infos\n if (connectionSuccess) {\n this.apiGet('getSystemInfo').then(sysInfo => {\n this.setStateAsync('info.id', sysInfo.id, true);\n this.setStateAsync('info.host', sysInfo.host, true);\n this.setStateAsync('info.name', sysInfo.name, true);\n this.setStateAsync('info.type', sysInfo.type, true);\n this.setStateAsync('info.serviceName', sysInfo.serviceName, true);\n this.setStateAsync('info.systemversion', sysInfo.systemversion, true);\n this.setStateAsync('info.builddate', sysInfo.builddate, true);\n this.setStateAsync('info.variant', sysInfo.variant, true);\n this.setStateAsync('info.hardware', sysInfo.hardware, true);\n });\n // get inital player state\n this.updatePlayerState();\n }\n if (this.config.subscribeToStateChanges && this.config.subscriptionPort && connectionSuccess) {\n this.log.debug('Subscription mode is activated');\n try {\n this.httpServerInstance = this.httpServer.listen(this.config.subscriptionPort);\n this.log.debug(`Server is listening on ${ip_1.default.address()}:${this.config.subscriptionPort}`);\n this.subscribeToVolumioNotifications();\n }\n catch (error) {\n this.log.error(`Starting server on ${this.config.subscriptionPort} for subscription mode failed: ${error.message}`);\n }\n }\n else if (this.config.subscribeToStateChanges && !this.config.subscriptionPort) {\n this.log.error('Subscription mode is activated, but port is not configured.');\n }\n else if (!this.config.subscribeToStateChanges && connectionSuccess) {\n this.unsubscribeFromVolumioNotifications();\n }\n this.httpServer.post('/volumiostatus', (req, res) => {\n this.onVolumioStateChange(req.body);\n res.sendStatus(200);\n });\n }", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"/bettersense\");\n message = new Paho.MQTT.Message(\"Hello CloudMQTT\");\n message.destinationName = \"/bettersense\";\n client.send(message);\n }", "function startConnect() {\n // Generate a random client ID\n clientID = \"manual1699\";\n\n // // Local Mosquitto\n host = \"localhost\";\n port = 9001;\n \n // Cloud Maqiatto\n // host = \"maqiatto.com\";\n // port = 8883;\n\n // Print output for the user in the messages div\n // document.getElementById(\"messages\").innerHTML += '<span>Connecting to: ' + host + ' on port: ' + port + '</span><br/>';\n // document.getElementById(\"messages\").innerHTML += '<span>Using the following client value: ' + clientID + '</span><br/>';\n // document.getElementById(\"pesan\").innerHTML = '0';\n\n // Initialize new Paho client connection\n client = new Paho.MQTT.Client(host, Number(port), clientID);\n\n // Connect the client, if successful, call onConnect function\n client.connect({\n userName: \"gametaufik16@gmail.com\",\n password: \"taufik123\",\n onSuccess: onConnect,\n });\n\n // Set callback handlers\n client.onConnectionLost = onConnectionLost;\n client.onMessageArrived = onMessageArrived;\n}", "function onConnect() {\n\t// Once a connection has been made, make a subscription and send a message.\n\tconsole.log(\"connected\");\n\tclientHR.subscribe(\"childMonitor/sensors/\"+devID+\"/heartRateHistory\");\n\tclientHR.subscribe(\"childMonitor/sensors/\"+devID+\"/equipmentHistory\");\n\t//call the sendHR function every 10 secs\n\tsetInterval(sendHR, 10 * 1000);\n\t//define sendHR to publish the heartrate and equipment JSONs to MQTT\n\tfunction sendHR() {\n\t\tvar heartRate = new Paho.MQTT.Message(JSON.stringify(heartrateJson));\n\t\theartRate.destinationName = \"childMonitor/sensors/\"+devID+\"/heartRateHistory\";\n\t\tclientHR.send(heartRate);// publish message\n\t\tconsole.log(\"HR sent\");\n\n\t\tvar equipment = new Paho.MQTT.Message(JSON.stringify(equippedJson));\n\t\tequipment.destinationName = \"childMonitor/sensors/\"+devID+\"/equipmentHistory\";\n\t\tclientHR.send(equipment);// publish message\n\t\tconsole.log(\"equip sent\");\n\t}\n}", "function setup() {\n console.log('Mosca server (MQTT) is up and running in http://localhost:'+settings.port);\n\n\n\n\n\t/*********** Manejo del cliente ***********/\n\n\n\n\tvar client = mqtt.connect('mqtt://localhost:1883');\n\t \n\tio.sockets.on('connection', function (socket) {\n\t\t//console.log('Se han conectado a socket');\n\t // socket connection indicates what mqtt topic to subscribe to in data.topic\n\t socket.on('subscribe', function (data) {\n\t console.log('Subscribing to '+data.topic);\n\t socket.join(data.topic);\n\t client.subscribe(data.topic);\n\t });\n\t // when socket connection publishes a message, forward that message\n\t // the the mqtt broker\n\t socket.on('publish', function (data) {\n\t console.log('Publishing to '+data.topic);\n\t client.publish(data.topic,data.payload);\n\t });\n\t});\n\t \n\t// listen to messages coming from the mqtt broker\n\tclient.on('message', function (topic, payload, packet) {\n\t console.log(topic+'='+payload);\n\t io.sockets.emit('mqtt',{'topic':String(topic),\n\t 'payload':String(payload)});\n\t});\n\n\n\n\t/*********** Fin manejo cliente ***********/\n\n}", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(topic);\n // Keep alive the channel\n keepAlive('KA');\n}", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"b8:27:eb:b9:6f:96/ENQ\");\n // message = new Paho.MQTT.Message(\"Hello CloudMQTT\");\n // message.destinationName = \"/cloudmqtt\";\n \n }", "discover() {\n const platform = this\n const agent = new YeeAgent('0.0.0.0', this.mijia, platform)\n agent.startDisc()\n }", "async function init() {\n try {\n await broker.start();\n const response = await broker.call('hello.sayHello')\n log(`Service Response ${response}`)\n }\n catch (e) {\n log(e);\n }\n}", "async listen() {\n\t\tconsole.log(\"listening to events\")\n\t\tthis.bizNetworkConnection.on('event', async (evt) => {\n\n\t\t\tif (evt.getFullyQualifiedType() == \"top.nextnet.gnb.NewIntentionEvent\") {\n\n\n\t\t\t\tconsole.log(\"new intention received \" + evt.target.getIdentifier())\n\t\t\t\tvar intention = await this.intentionRegistry.get(evt.target.getIdentifier());\n\t\t\t\tthis.intentionTimeoutMap.set(intention.getIdentifier(), []);\n\n\n\t\t\t\tvar services = this.generate_services(intention);\n\t\t\t\tawait this.serviceRegistry.addAll(services)\n\t\t\t\tfor (let service of services) {\n\n\t\t\t\t\tvar service_id = service.getIdentifier();\n\t\t\t\t\tvar newServiceEvent = this.factory.newEvent(\"top.nextnet.gnb\", \"NewServiceEvent\");\n\t\t\t\t\tnewServiceEvent.target = this.factory.newRelationship(\"top.nextnet.gnb\", \"Service\", service_id);\n\t\t\t\t\t//this.bizNetworkConnection.emit(newServiceEvent);\n\t\t\t\t\tvar publishServiceTransaction = this.factory.newTransaction(\"top.nextnet.gnb\", \"PublishService\");\n\t\t\t\t\tpublishServiceTransaction.service = this.factory.newRelationship(\"top.nextnet.gnb\", \"Service\", service_id);\n\n\t\t\t\t\tawait this.bizNetworkConnection.submitTransaction(publishServiceTransaction);\n\t\t\t\t\tconsole.log(\"a Service has been published \" + publishServiceTransaction.getIdentifier());\n\t\t\t\t};\n\n\n\t\t\t\tsetTimeout(this.arbitrateIntention.bind(this), timeoutIntentArbitrate, intention);\n\n\n\t\t\t}\n\t\t\telse if (evt.getFullyQualifiedType() == \"top.nextnet.gnb.NewServiceFragmentEvent\") {\n\t\t\t\tconsole.log(\"New service Fragment \" + evt.target.getIdentifier());\n\n\t\t\t\tvar fragment = evt.target;\n\t\t\t\t//no timeout so far, we create it\n\t\t\t\tif (this.intentionTimeoutMap.get(evt.target.getIdentifier()) == undefined) {\n\n\t\t\t\t\tvar timeout = setInterval(this.arbitrateServiceFragment.bind(this), timeoutSFArbitrate, fragment.getIdentifier());;\n\t\t\t\t\tthis.intentionTimeoutMap.set(fragment.getIdentifier(), { intention: fragment.intention.getIdentifier(), timeout: timeout });\n\t\t\t\t}\n\n\n\t\t\t\tvar dummyDeal = this.factory.newConcept(\"top.nextnet.gnb\", \"BestFragmentDeal\")\n\t\t\t\tdummyDeal.fragment = this.factory.newRelationship(\"top.nextnet.gnb\", \"ServiceFragment\", fragment.getIdentifier());\n\t\t\t\tvar status = { bestDeal: dummyDeal, updated: false };\n\n\n\t\t\t\tthis.updatedFragments.set(fragment.getIdentifier(), status);\n\n\n\n\t\t\t}\n\t\t\telse if (evt.getFullyQualifiedType() == \"top.nextnet.gnb.PlaceBidEvent\") {\n\t\t\t\tconsole.log(\"new PlaceBidEvent \" + evt.target.fragment.getIdentifier());\n\t\t\t\tvar status = this.updatedFragments.get(evt.target.fragment.getIdentifier())\n\t\t\t\tif (status == undefined) {//should not happend, since the broker is aware of the new fragment before the providers\n\t\t\t\t\tvar dummyDeal = this.factory.newConcept(\"top.nextnet.gnb\", \"BestFragmentDeal\")\n\t\t\t\t\tdummyDeal.fragment = this.factory.newRelationship(\"top.nextnet.gnb\", \"ServiceFragment\", evt.target.fragment.getIdentifier());\n\t\t\t\t\tstatus = { bestDeal: dummyDeal, updated: true }\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tstatus.updated = true;\n\t\t\t\t}\n\n\n\n\n\t\t\t}\n\t\t\telse if (evt.getFullyQualifiedType() == \"top.nextnet.gnb.NewServiceFragmentDealEvent\") {\n\t\t\t\tconsole.log(\"NewServiceFragmentDealEvent \" + evt.target.fragment.getIdentifier());\n\t\t\t\tvar deal = evt.target;\n\t\t\t\tvar status = this.updatedFragments.get(deal.fragment.getIdentifier());\n\t\t\t\tstatus.bestDeal = deal;\n\n\n\n\t\t\t}\n\n\t\t});\n\n\t}", "start() {\n // maybe add routine for removing old messages still in queue to avoid backup\n // on catastrophic neighbor failures\n var node = this._node;\n this._active = true;\n this._connecting = true;\n this._ipc.connectToNet(node.id(), node.host(), node.port());\n this._ipc.of[node.id()].on(\"connect\", this._handleConnect.bind(this));\n this._ipc.of[node.id()].on(\"disconnect\", this._handleDisconnect.bind(this));\n }", "function startArtyom() {\n console.log('start');\n artyom.initialize({\n lang:\"en-GB\",// More languages are documented in the library\n continuous:false,//if you have https connection, you can activate continuous mode\n debug:true,//Show everything in the console\n listen:true // Start listening when this function is triggered\n });\n}", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"iot/raspberry/temperature\");\n\n }", "function proxyRemoteConnect() {\n client.proxyBusObject = new ClientBusObject(client.busAtt, OBJECT_PATH);\n client.proxyBusObject.proxyBusObject.introspectRemoteObjectAsync(null).then(function (introResult) {\n if (AllJoyn.QStatus.er_OK == introResult.status) {\n OutputLine(\"Introspection of the service bus object was successful.\");\n client.proxyBusObject.callPingMethod();\n } else {\n OutputLine(\"Introspection of the service bus object was unsuccessful.\");\n client.busAtt.leaveSession(sessionId);\n }\n });\n }", "function create() {\n var ariConfig = config.getAppConfig().ari;\n\n ari.getClient(ariConfig, ariConfig.applicationName)\n .then(function(client) {\n logger.debug({\n ari: {\n url: ariConfig.url,\n username: ariConfig.username\n }\n }, 'Connected to ARI');\n\n client.on('StasisStart', fsm.create);\n\n logger.info('Voicemail Main application started');\n })\n .catch(function(err) {\n logger.error({err: err}, 'Error connecting to ARI');\n throw err;\n });\n}", "function onConnectCallback() {\r\n // Once a connection has been made, make a subscription and send a message.\r\n console.log(\"connected\");\r\n client.publish(\"lightControl1\", \"connected\", 0, false); //publish a message to the broker\r\n client.publish(\"lightControl2\", \"connected\", 0, false); //publish a message to the broker\r\n}", "async onReady() {\n // Initialize your adapter here\n // Reset the connection indicator during startup\n this.setState('info.connection', false, true);\n if (!this.config.host) {\n this.log.error(`No host is configured, will not start anything!`);\n return;\n }\n await this.cleanupObjects();\n this.createWebSocket();\n if (this.config.luxPort) {\n await this.createLuxTreeAsync();\n this.createLuxtronikConnection(this.config.host, this.config.luxPort);\n }\n this.watchdogInterval = setInterval(() => this.handleWatchdog(), this.config.refreshInterval * 1000);\n }", "function startArtyom(){\r\n artyom.initialize({\r\n lang:\"en-GB\",// A lot of languages are supported.\r\n continuous:true,\r\n listen:true, // Start recognizing\r\n debug:true, // Show everything in the console\r\n });\r\n }", "function onConnect() {\n //show image\n $('#image').fadeTo(\"slow\" , 1, function() {\n // Animation complete.\n // show non clickable mouse cursor\n $('#image').css('cursor', 'auto');\n\n });\n\n $('#image').click(function() {\n //do nothing\n });\n\n // loadMap();\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n\n if (document.getElementById(\"SubscribeTopic\")) {\n document.getElementById(\"SubscribeTopic\").innerText = SubscribeTopic;\n }\n if (document.getElementById(\"mqttEndpoint\")) {\n document.getElementById(\"mqttEndpoint\").innerText = mqttEndpoint;\n }\n if (document.getElementById(\"IdentityPoolId\")) {\n document.getElementById(\"IdentityPoolId\").innerText = IdentityPoolId;\n }\n if (document.getElementById(\"MQTTstatus\")) {\n\n document.getElementById(\"MQTTstatus\").innerText = 'CONNECTED';\n document.getElementById(\"MQTTstatus\").className = 'connected';\n }\n\n\n\n //UPDATE TO MATCH YOUR THINGS\n mqttClient.subscribe(SubscribeTopic);\n\n document.getElementById(\"MQTTstatus\").innerText = 'CONNECTED';\n\n // message = new Paho.MQTT.Message(\"Hello\");\n // message.destinationName = \"alexa/demo/color\";\n // mqttClient.send(message);\n}", "function startConnect() {\n // Generate a random client ID\n clientID = \"clientID-\" + \"Control Panel\";\n\n // Fetch the hostname/IP address and port number from the form\n host = \"test.mosquitto.org\";\n port = \"8081\";\n user = \"\";\n pass = \"\";\n\n // Print output for the user in the messages div\n //document.getElementById(\"messages\").innerHTML += '<span>Connecting to: ' + host + ' on port: ' + port + '</span><br/>';\n //document.getElementById(\"messages\").innerHTML += '<span>Using the following client value: ' + clientID + '</span><br/>';\n\n // Initialize new Paho client connection\n client = new Paho.MQTT.Client(host, Number(port), clientID);\n\n //initialize new sensor_listener object\n //sensors = new listener();\n\n // Set callback handlers\n client.onConnectionLost = onConnectionLost;\n client.onMessageArrived = onMessageArrived;\n\n\n\n // Connect the client, if successful, call onConnect function\n client.connect({\n onSuccess: onConnect,\n userName: user,\n password: pass\n });\n\n}", "start() {\n this.connectionManager.connect().catch((err) => {\n logger.error('Unable to start the bot %j', err);\n });\n }", "function MQTTconnect() {\n\t\tconsole.log(\"connecting to \"+ host +\" \"+ port);\n\t\tmqtt = new Paho.MQTT.Client(host,port,\"clientjs\");\n\t\t//document.write(\"connecting to \"+ host);\n\t\tvar options = {\n\t\t\ttimeout: 3,\n\t\t\tonSuccess: onConnect,\n\n\t\t };\n\t\t//retrieves any messages from topics subscribed to\n\t\tmqtt.onMessageArrived = onMessageArrived;\n\t\tmqtt.connect(options); //connect\n\n\t\t}", "start() {\n Bangle.on('HRM', handleHeartBeat)\n Bangle.setHRMPower(true)\n }", "function onConnect() {\r\n // Once a connection has been made, make a subscription and send a message.\r\n console.log(\"onConnect\");\r\n client.subscribe(subscribeTopic.lights); //for subscription of lights\r\n client.subscribe(subscribeTopic.window); //for subscription of windows\r\n client.subscribe(subscribeTopic.tempHumidity); //for subscription of tempHumidity\r\n client.subscribe(subscribeTopic.tempTemperature);\r\n client.subscribe(subscribeTopic.AirQuality); //for subscription of AirQuality\r\n}", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"/World\");\n client.subscribe(\"/refreshTable\");\n\n client.subscribe(\"/playerJoined\");\n client.subscribe(\"/startGame\");\n client.subscribe(\"/setTurn\");\n\n message = new Paho.MQTT.Message(name);\n message.destinationName = \"/playerJoined\";\n client.send(message);\n\n //test();\n}", "function main() {\n setReqURL()\n startMicroservice()\n registerWithCommMgr()\n}", "function onConnect() {\n\t// Once a connection has been made, make a subscription and send a message.\n\tconsole.log(\"onConnect\");\n\tclient.subscribe(\"World\");\n\tmessage = new Paho.MQTT.Message(\"All is up!\");\n\tmessage.destinationName = \"World\";\n\tclient.send(message); \n}", "function setup() {\n // server.authenticate = authenticate;\n // server.authorizePublish = authorizePublish;\n // server.authorizeSubscribe = authorizeSubscribe;\n log.info('Mosca server is up and running on '+env.mhost+':'+env.mport+' for mqtt and '+env.mhost+':'+env.hport+' for websocket');\n\n}", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n subscribeTopics(client);\n message = new Paho.MQTT.Message(\"Connect from \" + clientId);\n message.destinationName = \"Log\";\n client.send(message);\n}", "function CommunicationManager(onJob, onNotification, knownHosts){\n\t\t//console.log(\"creating communication manager\");\n\t\tvar WHY_CLIENT_HELLO = \"why client hello\";\n\t\tvar ABOUTME = \"aboutme\";\n\t\tvar _knownHosts = knownHosts;\n\t\tvar _onJob = onJob;\n\t\tvar _onNotification = onNotification;\n\n\t\tvar io = {\n\t\t\tclient : null, // making connections to servers from browser / gateway\n\t\t\tserver : null // recieving connections from clients / gateways on gateway / server\n\t\t}\n\t\t\n\n\t\tif ( typeof(window) != 'undefined' ) {\n\t\t\t//console.log(\"configuring as a browser element\");\n\t\t\tio.client = window.io;\n\t\t} else {\n\t\t\t//console.log(\"configuring as a node element\");\n\t\t}\n\t\t\n\t\t\n\t\tfunction Message(type, payload) {\n\t\t\t//console.log(\"creatign new message, type \" + type)\n\t\t\tthis.type = type;\n\t\t\tthis.payload = payload;\n\t\t}\n\t\t\n\t\tvar liveconnections = new Array();\n\t\n\t\tfunction storeConnection(socket, metadata){ // upsert\n\t\t\t//console.log(\"storing connection for url[\" + metadata.url + \"] >\" + metadata.guid );\n\t\t\tvar key = metadata.storageKey();\n\t\t\tif ( key != null ) {\n\t\t\t\tliveconnections[key] = socket;\n\t\t\t} else {\n\t\t\t\t//console.log(\"warning, connection cannot be stored!!!!\")\n\t\t\t}\n\t\t}\n\t\t\n\t\tfunction findConnection(metadata) {\n\t\t\t//console.log(\"searching for an active connection to url[\" + metadata.url + \"] >\" + metadata.guid );\n\t\t\tvar retval = null;\n\t\t\tif ( metadata.url != \"http://null\" && metadata.url != null ) {\n\t\t\t\tif ( metadata.url in liveconnections ) {\n\t\t\t\t\t//console.log(\"found active connection for \" + metadata.url);\n\t\t\t\t\tretval = liveconnections[metadata.url];\n\t\t\t\t}\n\t\t\t} else if ( metadata.guid != null ) {\n\t\t\t\tif( metadata.guid in liveconnections ) {\n\t\t\t\t\t//console.log(\"found connection for \" + metadata.guid );\n\t\t\t\t\tretval = liveconnections[metadata.guid];\n\t\t\t\t} else {\n\t\t\t\t\t//console.log(\"I've not found a connection\");\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn retval;\n\t\t}\n\t\t\n\t\tfunction removeConnection(metadata) {\n\t\t\t//console.log(\"removeConnection\");\n\t\t\tvar keyToDelete = metadata.storageKey();\n\t\t\tif (keyToDelete in liveconnections ) {\n\t\t\t\tdelete liveconnections[keyToDelete];\n\t\t\t}\n\t\t}\n\t\t\n\t\tfunction generateArrayOfMyMetaData(destinationMetadata) {\n\t\t\t//console.log(\"generateArrayOfMyMetaData\");\n\t\t\tvar retval = new Array();\n\t\t\tswitch ( $sis. myMetaData.nodeType ) {\n\t\t\t\tcase $sis.NodeType.CLIENT:\n\t\t\t\tcase $sis.NodeType.SERVER:\n\t\t\t\t\tretval.push($sis.myMetaData);\n\t\t\t\tbreak;\n\n\t\t\t\tcase $sis.NodeType.GATEWAY: {\n\t\t\t\t\tif (typeof(destinationMetadata) != 'undefined' && destinationMetadata != null ) {\n\t\t\t\t\t\tknownHosts.forall( function(i) {\n\t\t\t\t\t\t\tif ( i.isMe() ) {\n\t\t\t\t\t\t\t\tretval.push(i);\n\t\t\t\t\t\t\t}else if (destinationMetadata.guid != i.guid) {\n\t\t\t\t\t\t\t\tvar duplicate = new MetaData();\n\t\t\t\t\t\t\t\tduplicate.copy(i);\n\t\t\t\t\t\t\t\tduplicate.url = $sis.myMetaData.url;\n\t\t\t\t\t\t\t\tretval.push(duplicate);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tknownHosts.forall( function(i) {\n\t\t\t\t\t\t\tif ( i.isMe() ) {\n\t\t\t\t\t\t\t\tretval.push(i);\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tvar duplicate = new MetaData();\n\t\t\t\t\t\t\t\tduplicate.copy(i);\n\t\t\t\t\t\t\t\tduplicate.url = $sis.myMetaData.url;\n\t\t\t\t\t\t\t\tretval.push(duplicate);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn retval;\n\t\t}\n\t\t\n\t\tfunction handleArrayOfReceivedMetaData(data) {\n\t\t\t//console.log(\"handleArrayOfReceivedMetaData\");\n\t\t\tvar retval= new Array();\n\t\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\t\tvar metadata = deserialise_MetaData(data[i]);\n\t\t\t\tretval.push(metadata);\n\t\t\t}\n\t\t\treturn retval;\n\t\t}\n\t\t\n\t\tfunction job_handler(data) {\n\t\t\t//console.log(\"job_handler\");\n\t\t\t//console.log(\"received JOB!\");\n\t\t\tif ( _onJob != null ) {\n\t\t\t\t//console.log(\"handler available - sending for processing\");\n\t\t\t\tvar job = deserialise_Job(data);\n\t\t\t\tjob.destinationMetaData = knownHosts.getLocalVersionOfMetadata(job.destinationMetaData);\n\t\t\t\t_onJob(job);\n\t\t\t} else {\n\t\t\t\t//console.log(\"no handler is registered for processing job\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tfunction notification_handler(data) {\n\t\t\t//console.log(\"notificaiton_handler\");\n\t\t\t//console.log(\"received Notification : \" + JSON.stringify(data));\n\t\t\t\n\t\t\tif ( _onNotification != null ) {\n\t\t\t\t//console.log(\"handler available - sending for processing\");\n\t\t\t\tvar notification = deserialise_Notification(data);\n\t\t\t\t_onNotification(notification);\n\t\t\t} else {\n\t\t\t\t//console.log(\"no handler is registered for processing notification\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tfunction client_handle_why_client_hello(data, socket) {\n\t\t\t//console.log(\"as a client I've just received about me info from a node or gateway - processing it here\") ;\n\t\t\tvar receivedMetaData = handleArrayOfReceivedMetaData(data);\n\t\t\tknownHosts.upsert(receivedMetaData);\n\t\t\t// I do not update liveconnections - as it will already be assigned the url from which I've received this data\t\t\t\n\t\t\tsend_aboutme(socket, receivedMetaData[0]);\n\t\t}\n\n\t\tfunction client_handle_aboutme(data, socket) {\n\t\t\t//console.log(\"as a client I've just received about me info from a node or gateway - processing it here\") ;\n\t\t\tvar receivedMetaData = handleArrayOfReceivedMetaData(data);\n\t\t\tknownHosts.upsert(receivedMetaData);\n\t\t\t// I do not update liveconnections - as it will already be assigned the url from which I've received this data\t\t\t\n\t\t\t//send_aboutme(socket, receivedMetaData[0]);\n\t\t}\t\t\n\t\t\n\t\tfunction server_handle_aboutme(data, socket) {\n\t\t\t//console.log(\"As a server I've just received about me info\");\n\t\t\t// we can record the connection here too\n\t\t\t//console.log(\"recording connection in live connections\");\n\t\t\tvar receivedMetaData = handleArrayOfReceivedMetaData(data);\n\t\t\tstoreConnection(socket, receivedMetaData[0]);\n\t\t\tknownHosts.upsert(receivedMetaData);\n\t\t\t// I do not send about me... \n\t\t\treturn receivedMetaData[0];\n\t\t}\n\t\t\n\t\tfunction send_aboutme(socket, metadata) {\n\t\t\t//console.log(\"send_aboutme\");\n\t\t\tif ( metadata != null ) {\n\t\t\t\t//console.log(\"sening about me information to \" + metadata.guid)\t;\t\t\t} else {\n\t\t\t\t//console.log(\"sending about me information to an unknown connection...\");\n\t\t\t}\n\t\t\t\n\t\t\tvar dataToSend = generateArrayOfMyMetaData(metadata);\n\t\t\tsocket.emit(ABOUTME, dataToSend);\n\t\t\t//console.log(\"about me sent\");\n\t\t}\n\n\t\tfunction send_why_client_hello(socket, metadata) {\n\t\t\t//console.log(\"send_why_client_hello\");\n\t\t\tif ( metadata != null ) {\n\t\t\t\t//console.log(\"sening about me information to \" + metadata.guid)\t;\t\t\t} else {\n\t\t\t\t//console.log(\"sending about me information to an unknown connection...\");\n\t\t\t}\n\t\t\t\n\t\t\tvar dataToSend = generateArrayOfMyMetaData(metadata);\n\t\t\tsocket.emit(WHY_CLIENT_HELLO, dataToSend);\n\t\t\t//console.log(\"about me sent\");\n\t\t}\t\t\n\t\t\n\t\tfunction handleConnectionDisconnectAndInformOthers(metadata) {\n\t\t\t//console.log( \" handleConnectionDisconnectAndInformOthers\" );\t\t\t\n\t\t\t//todo: remove hosts associated with this socket / guid from our knownhosts and live connections\n\t\t\tremoveConnection(metadata);\n\t\t\tknownHosts.deleteHost(metadata);\n\t\t\t// send an about me to anone remaining to let them know about the disconnect and lost of connection\n\t\t\tknownHosts.forall(function(host){\n\t\t\t\t//console.log(\"found :\" + host.guid);\n\t\t\t\tif ( !host.isMe() ) {\n\t\t\t\t\t//console.log( host.guid + \" should be send an about me message\");\n\t\t\t\t\tsendAboutMeMessageTo(host);\n\t\t\t\t\t//console.log(\"about message sent\");\n\t\t\t\t} else {\n\t\t\t\t\tvar str = \"\";\n\t\t\t\t\tif ( host.isMe() ) str = \" me!\";\n\t\t\t\t\t//console.log(host.guid + \" is \" + str );\n\t\t\t\t}\n\t\t\t});\t\t\n\t\t}\n\t\t\n\t\tfunction handleConnectionDisconnect(metadata) {\n\t\t\t//todo: remove hosts associated with this socket / guid from our knownhosts and live connections\n\t\t\t//console.log(\" handleConnectionDisconnect\");\n\t\t\tremoveConnection(metadata);\n\t\t\tknownHosts.deleteHost(metadata);\t\t\n\t\t}\n\t\t\n\t\tfunction retryEstablishConnection(metadata, callback, existingSocket) {\n\t\t\t//console.log(\"retryEstablishConnection\");\n\t\t\tsetTimeout(function(){\n\t\t\t\t//console.log(\"retryEstablishConnection, timeout expired... \");\n\t\t\t\testablishConnection(metadata, callback, existingSocket);\n\t\t\t\t}, 1000);\n\t\t}\n\t\t\n\t\tfunction establishConnection(metadata, callback, existingSocket) {\n\t\t\t//console.log(\"establishing a connection to \" + metadata.url);\n\t\t\tvar newSocket = true;\n\t\t\tvar socket = null;\n\t\t\tif ( typeof(existingSocket) != 'undefined') {\n\t\t\t\tnewSocket = false;\n\t\t\t\tsocket = existingSocket;\n\t\t\t\tsocket.reconnect();\n\t\t\t} else {\n\t\t\t\tsocket = io.client.connect(metadata.url);\n\t\t\t}\n\t\t\tstoreConnection(socket, metadata);\n\t\t\t\n\t\t\tif (newSocket){\n\t\t\t\tsocket.on(WHY_CLIENT_HELLO, function(data){\n\t\t\t\t\tclient_handle_why_client_hello(data, socket);\n\t\t\t\t\tcallback(resultIs.OK);\n\t\t\t\t});\n\n\t\t\t\tsocket.on(ABOUTME, function(data) {\n\t\t\t\t\tclient_handle_aboutme(data, socket);\t\t\t\t\n\t\t\t\t});\n\t\t\t\tsocket.on(messageTypeIs.JOB, job_handler);\n\t\t\t\tsocket.on(messageTypeIs.NOTIFICATION, notification_handler);\t\n\t\t\t\tsocket.on('disconnect', function() {\n\t\t\t\t\t//console.log(\"registered a disconnection from : \" + metadata.guid);\n\t\t\t\t\tswitch( $sis.myMetaData.nodeType ) {\n\t\t\t\t\t\tcase $sis.NodeType.CLIENT:\t\t\t\t\t\t\t\n\t\t\t\t\t\t\thandleConnectionDisconnect(metadata);\n\t\t\t\t\t\t\tretryEstablishConnection(metadata, callback, socket);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase $sis.NodeType.SERVER: // this should never happen - servers never establish a connection\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase $sis.NodeType.GATEWAY:\n\t\t\t\t\t\t\thandleConnectionDisconnectAndInformOthers(metadata);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\t\tsocket.on('error', function() {\n\t\t\t\t\t//console.log(\"error connecting to \" + metadata.url);\n\t\t\t\t\tretryEstablishConnection(metadata, callback);\n\t\t\n\t\t\t\t});\n\n\t\t\t\tsocket.on('connect_failed', function() {\n\t\t\t\t\t//console.log(\"error connecting to socket \" + metadata.url);\n\t\t\t\t\tretryEstablishConnection(metadata, callback);\n\t\t\t\t});\t\t\t\t\t\n\t\t\t}\n\n\t\t\t\t\t\n\t\t}\n\t\t\n\t\t// this function sends a message to a client only if it is already connected.. avoiding an about me game of tennis\n\t\tfunction sendAboutMeMessageTo(metadata) {\n\t\t\t//console.log(\"sending an about me message\");\n\t\t\tvar connection = findConnection(metadata);\n\t\t\tif (connection != null) {\n\t\t\t\t//console.log(\"connection exists sending about me message\");\n\t\t\t\tsend_aboutme(connection, metadata);\n\t\t\t}\n\t\t}\n\n\n\t\tthis.clientUpdateOfAboutmeInfo = function() {\n\t\t\t//console.log(\"clientUpdateOfAboutmeInfo\");\n\t\t\tknownHosts.foreachendpoint(function(host){\n\t\t\t\t//console.log(\"found :\" + host.guid);\n\t\t\t\tif ( !host.isMe()) {\n\t\t\t\t\t//console.log( host.guid + \" should be send an about me message\");\n\t\t\t\t\tsendAboutMeMessageTo(host);\n\t\t\t\t\t//console.log(\"about message sent\");\n\t\t\t\t} \n\t\t\t});\t\t\t\n\t\t}\n\t\t\t\t\n\t\tthis.sendMessage = function (metadata, type, message, doneCB) {\n\t\t\t//console.log(\"sending a message\");\n\t\t\t//console.log(\"checking meta data\");\n\t\t\tif ( metadata.hasGuidButNoUrl() ) {\n\t\t\t\t//console.log(\"there is no URL for this destination, and an existing link was not found\");\n\t\t\t\t_knownHosts.populateWithKnownUrl( metadata );\n\t\t\t} else {\n\t\t\t\t//console.log(\"metadata ok\");\n\t\t\t}\n\t\t\t\n\t\t\tvar connection = findConnection(metadata);\n\t\t\tif ( connection == null ) {\n\t\t\t\t//console.log(\"connection could not be found\");\t\t\t\t\n\t\t\t\t//console.log(\"creating a missing connection\");\n\t\t\t\tconnection = establishConnection(metadata, function(result){\n\t\t\t\t\tif ( result == resultIs.OK ) {\n\t\t\t\t\t\t//console.log(\"connection establoshed, sending message\");\n\t\t\t\t\t\tconnection.emit(type, message);\n\t\t\t\t\t}\n\t\t\t\t\tdoneCB(result);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t//console.log(\"connection exists sending message\");\n\t\t\t\tconnection.emit(type, message);\n\t\t\t\tdoneCB(resultIs.OK);\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.startConnectionsToKnownHosts = function(socketioclient) {\n\t\t\t//console.log(\"startConnectionsToKnownHosts\");\n\t\t\tif ( typeof(socketioclient) != 'undefined' ) {\n\t\t\t\tio.client = socketioclient;\n\t\t\t}\n\t\t\t\n\t\t\tvar max = knownHosts.length();\n\t\t\t//console.log(\"startConnectionsToKnownHosts (\" + max + \")\");\n\t\t\tif ( max > 1 ) {\n\t\t\t\t// try to establish connections first, then tell the developer\n\t\t\t\tknownHosts.forall(function(host){\n\t\t\t\t\t//console.log(\"host[\" + host.guid + \"]\");\n\t\t\t\t\tif ( ! host.isMe() ) {\n\t\t\t\t\t\t//console.log(\"this host isn't me, creating connection to \" + host.url);\n\t\t\t\t\t\testablishConnection(host, function(result) {\n\t\t\t\t\t\t\t//console.log(\"connection established to \" + host.url);\n\t\t\t\t\t\t\t// call back...\n\t\t\t\t\t\t\t// if ( result == resultIs.OK)\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// theer is only one known host, that's us... so just tell the developer what the status is\n\t\t\t\t//console.log(\"the only host available is me, not establishing connections\");\n\t\t\t\tknownHosts.invokeChangeCallback();\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.startReceivingIncomingConnections = function(socketio) {\n\t\t\t//console.log(\"startReceivingIncomingConnections\");\n\t\t\tio.server = socketio;\n\t\t\tio.server.sockets.on('connection', function (socket) {\n\t\t\t\t//console.log(\"connection received, sending about me\");\n\t\t\t\tvar socketsMetaData = null;\n\t\t\t\tsend_why_client_hello(socket, null);\n\t\t\t\tsocket.on(ABOUTME, function(data) {\n\t\t\t\t\t//console.log(\"received about me information\");\n\t\t\t\t\tsocketsMetaData = server_handle_aboutme(data, socket);\n\t\t\t\t\t//console.log(\"about me information delt with, sending update description of self to everyone else\");\n\t\t\t\t\tknownHosts.forall(function(host){\n\t\t\t\t\t\t//console.log(\"found :\" + host.guid);\n\t\t\t\t\t\tif ( !host.isMe() && host.guid != socketsMetaData.guid ) {\n\t\t\t\t\t\t\t//console.log( host.guid + \" should be send an about me message\");\n\t\t\t\t\t\t\tsendAboutMeMessageTo(host);\n\t\t\t\t\t\t\t//console.log(\"about message sent\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar str = \"\";\n\t\t\t\t\t\t\tif ( host.isMe() ) str = \" me!\";\n\t\t\t\t\t\t\tif ( host.guid == socketsMetaData.guid ) str = \" the recently joined dude\";\n\t\t\t\t\t\t\tconsole.log(host.guid + \" is \" + str );\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tsocket.on('disconnect', function() {\n\t\t\t\t\thandleConnectionDisconnectAndInformOthers(socketsMetaData);\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tsocket.on(messageTypeIs.JOB, job_handler);\n\t\t\t\tsocket.on(messageTypeIs.NOTIFICATION, notification_handler);\t\n\t\t\t});\t\t\t\n\t\t}\n\t\t\n\t}", "function mqttClientConnectHandler() {\n console.log('connected to MQTT server');\n mqttClient.subscribe(deviceTopic);\n console.log(\"subscribed to\", deviceTopic);\n }", "function connectToAmqp() {\n\tamqp.connect(CLOUDAMQP_URL + \"?heartbeat=60\", function(err, conn) {\n\t\tif(err) {\n\t\t\tconsole.error(\"[AMQP Connection error]\", err.message);\n\t\t\treturn setTimeout(connectToAmqp, 1000);\n\t\t}\n\n\t\t// if there is an error connecting\n\t\tconn.on('error', function(err) {\n\t\t\tif(err.message.toLowerCase() == \"Connection Closing\") {\n\t\t\t\tconsole.log(\"[AMQP Connection error]\", err.message);\n\t\t\t}\n\t\t});\n\n\t\tconn.on(\"close\", function() {\n\t\t\tconsole.log(\"[AMQP] reconnecting...\");\n\t\t\treturn setTimeout(connectToAmqp, 1000);\n\t\t});\n\n\t\tconsole.log(\"[AMQP] connected\");\n\t\tamqpConn = conn;\n\t\twhenConnected();\n\t});\n}", "function connect(){\n var hostname = 'broker.mqttdashboard.com'; //Unaprijed određeni poslužitelj (broker)\n var port = '8000'; //port\n var clientId = document.getElementById(\"ime\").value; //Dohvaćanje imena korisnika\n \n client = new Paho.MQTT.Client(hostname, Number(port), clientId); //Kreiranje instance MQTT klijenta\n \n console.info('Connecting to Server: Hostname: ', hostname, '. Port: ', port, '. Client ID: ', clientId);\n\n // Postavljanje metoda koje će se koristiti kao event handleri za određene događaje\n client.onConnectionLost = onConnectionLost;\n client.onMessageArrived = onMessageArrived;\n\n // Parametri koje funkcija za uspostavljanje veze poprima spremljeni u jednu varijablu\n var options = {\n invocationContext: {host : hostname, port: port, clientId: clientId},\n onSuccess: onConnect,\n onFailure: onFail\n };\n \n // Povezivanje klijenta\n client.connect(options);\n\n}", "function startServer() {\n FastMQ.Client.connect('responseChannel', 'master').then((channel) => { // client connected\n console.log(\"Connected\")\n responseChannel = channel;\n responseChannel.response('refresh', (msg, res) => {\n console.log('Receive request payload:', msg.payload);\n // echo request data back;\n let resData = {\n data: msg.payload.data\n };\n res.send(resData, 'json');\n });\n \n }).catch((err) => {\n console.log('Got error:', err.stack);\n setTimeout(startServer, 5000);\n });\n}", "function onConnect() {\t\n\t\tmqtt.subscribe(moisture_topic, {qos: 0});\n\t\t//$('#status').val('Connected to ' + host + ':' + port + path);\n\t}", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(SUBSCRIBER);\n //message = new Paho.MQTT.Message(\"Hello\");\n //message.destinationName = \"World\";\n //client.send(message);\n }", "function startConnect() {\n connection.connect(function (err) {\n if (err) throw err;\n // run the start function after the connection is made to prompt the user\n console.log(\"connected as id \" + connection.threadId + \"\\n\");\n displayProducts();\n });\n}", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(mqttData.topic);\n\n // message = new Paho.MQTT.Message(\"Test Feedhenry\");\n // message.destinationName = mqttData.topic;\n // client.send(message);\n }", "appExecute() {\n\n\t\tthis.appConfig();\n\t\tthis.includeRoutes(this.app);\n\n\t\tthis.http.listen(this.port, this.host, () => {\n\t\t\tconsole.log(`Listening on http://${this.host}:${this.port}`);\n\t\t});\n\t}", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"bdcc/itaxi\");\n}", "setup() {\n console.log('Mosca server is up and running');\n if (this.connectCallbackFn !== null) {\n this.connectCallbackFn();\n }\n }", "async function start () {\n await app.initDB()\n app.initSocket()\n app.initMiddlewares()\n app.initSubApp()\n await app.initHttp()\n }", "static setupStore(application) {\n // console.log('setup store ', application.mqtt.url);\n if(application.mqtt.url === undefined) { return Promise.reject(Error('undefined mqtt url')); }\n application.mqtt.client = mqtt.connect(application.mqtt.url, { reconnectPeriod: application.mqtt.reconnectMSecs });\n application.mqtt.client.on('connect', () => { State.to(application.machine, 'mqtt'); });\n // application.mqtt.client.on('reconnect', () => { console.log('mqtt reconnect') });\n // application.mqtt.client.on('close', () => { });\n application.mqtt.client.on('offline', () => { State.to(application.machine, 'dmqtt'); }); // eslint-disable-line spellcheck/spell-checker\n application.mqtt.client.on('error', error => { console.log(error); throw new Error('mqtt error: ' + error.toString()); });\n\n return Promise.resolve(application);\n }", "init()\r\n {\r\n var self = this;\r\n\r\n // set the template file for uri set method\r\n this.raumkernel.getSettings().uriMetaDataTemplateFile = \"node_modules/node-raumkernel/lib/setUriMetadata.template\";\r\n\r\n // set some other settings from the config/settings file\r\n // TODO: @@@\r\n //this.raumkernel.getSettings().\r\n\r\n // if there is no logger defined we do create a standard logger\r\n if(!this.parmLogger())\r\n this.createLogger(this.settings.loglevel, this.settings.logpath);\r\n\r\n this.logInfo(\"Welcome to raumserver v\" + PackageJSON.version +\" (raumkernel v\" + Raumkernel.PackageJSON.version + \")\");\r\n\r\n // log some information of the network interfaces for troubleshooting\r\n this.logNetworkInterfaces();\r\n\r\n // Do the init of the raumkernel. This will include starting for the raumfeld multiroom system and we\r\n // do hook up on some events so the raumserver knows the status of the multiroom system\r\n this.logVerbose(\"Setting up raumkernel\");\r\n this.raumkernel.parmLogger(this.parmLogger());\r\n // TODO: listen to events like hostOnline/hostOffline\r\n this.raumkernel.init();\r\n\r\n this.logVerbose(\"Starting HTTP server to receive requests\");\r\n this.startHTTPServer();\r\n\r\n this.logVerbose(\"Starting bonjour server for advertising\");\r\n // TODO: @@@\r\n }", "initiateConnect(connectedAs) {\n\t\tthis.setState({connectedAs});\n\t\t\n\t\t// now open up the socket to the server\n\t\ttry {\n\t\t\tthis.clientConnection = new clientConnection(connectedAs);\t\t\n\t\t} catch (ex) {\n\t\t\n\t\t}\n\t}", "function _initialise(ipAdress, port) {\n console.log(\"STM ARM Client initialisation...\");\n\n ipAdress = ipAdress.split(\" \").join(\"\");\n armClient.connect(port, ipAdress, function() {\n console.log(\"\\nSTM ARM Client connected on \" + ipAdress + \":\" + port);\n });\n armClient.on(\"error\", function(err) {\n console.error(err);\n });\n}", "function connectToServer() {\n\tvar serverIP = document.getElementById(\"server-ip\").value;\n\tvar serverPort = document.getElementById(\"server-port\").value;\n\tconsole.log(\"Connect to server: \" + serverIP + \":\" + serverPort);\n\n\tclientID = \"subAppClient\" + new Date().getTime();\n\tclientObj = new Paho.MQTT.Client(serverIP, parseInt(serverPort), clientID);\n\n\tclientObj.onConnectionLost = onConnectionLost;\n\tclientObj.onMessageArrived = onMessage;\n\n\tclientObj.connect({onSuccess: onConnect});\n}", "onConnect() {\n console.log(\"connected to broker\");\n this.client.subscribe(\"common/reply\");\n this.emit('onConnected');\n }", "function onConnect() {\r\n // Once a connection has been made, make a subscription and send a message.\r\n //console.log(\"MQTT connected\");\r\n client.subscribe(\"webCervecero/updateTable/\" + gv.id_User);\r\n client.subscribe(\"webCervecero/sonda/\" + gv.id_Sonda);\r\n client.subscribe(\"webCervecero/arduino/\" + gv.id_Placa);\r\n //message = new Paho.MQTT.Message(\"Hello\");\r\n //message.destinationName = \"World\";\r\n //client.send(message);\r\n }", "connect() {\n this.hub = signalhub(this.channel, [ CONSTANTS.SIGNAL_SERVER ]);\n this.sw = swarm(this.hub, this.options);\n }", "function main() {\r\n startMicroservice()\r\n registerWithCommMgr()\r\n}", "function on_connect() {\n console.log(\"Connected to RabbitMQ-Web-Stomp\");\n console.log(client);\n client.subscribe(mq_queue, on_message);\n }", "function aos_init() {\n AOS.init({\n duration: 1000,\n once: true\n });\n}", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"18fe34fc04de-soil\");\n //message = new Paho.MQTT.Message(\"Hello\");\n //message.destinationName = \"/World\";\n //client.send(message); \n}", "appExecute() {\n\n this.appConfig();\n this.includeRoutes();\n\n this.http.listen(this.port, this.host, () => {\n console.log(`Listening on http://${this.host}:${this.port}`);\n });\n }", "function gestionServer()\n{\n\tlet myClient = MyClient.getInstance()\n\tmyClient.onReady().then(async() =>\n\t{\n\t\tclient = myClient.client\n\t\tloggedAccount = client.user\n\t\tobjActualServer = new actualServer()\n\t\tchooseServer()\n\n\t})\n}", "async onReady() {\n // Initialize your adapter here\n const obj = await this.getForeignObjectAsync(\"system.config\");\n if (obj && obj.native && obj.native.secret) {\n this.config.password = this.decrypt(obj.native.secret, this.config.password);\n } else {\n this.config.password = this.decrypt(\"Zgfr56gFe87jJOM\", this.config.password);\n }\n\n if (this.config.interval < 5) {\n this.log.warn(\"Interval under 5min is not recommended. Set it back to 5min\");\n this.config.interval = 5;\n }\n if (this.config && !this.config.smartPhoneId) {\n this.log.info(\"Generate new Id\");\n this.config.smartPhoneId = this.makeid();\n }\n // Reset the connection indicator during startup\n this.setState(\"info.connection\", false, true);\n this.login()\n .then(() => {\n this.setState(\"info.connection\", true, true);\n this.getFacility()\n .then(() => {\n this.cleanConfigurations()\n .then(() => {\n this.getMethod(\"https://smart.vaillant.com/mobile/api/v4/facilities/$serial/system/v1/status\", \"status\")\n .catch(() => this.log.debug(\"Failed to get status\"))\n .finally(async () => {\n await this.sleep(10000);\n this.getMethod(\"https://smart.vaillant.com/mobile/api/v4/facilities/$serial/systemcontrol/v1\", \"systemcontrol\")\n .catch(() => this.log.debug(\"Failed to get systemcontrol\"))\n .finally(async () => {\n await this.sleep(10000);\n this.getMethod(\"https://smart.vaillant.com/mobile/api/v4/facilities/$serial/livereport/v1\", \"livereport\")\n .catch(() => this.log.debug(\"Failed to get livereport\"))\n .finally(async () => {\n await this.sleep(10000);\n this.getMethod(\"https://smart.vaillant.com/mobile/api/v4/facilities/$serial/spine/v1/currentPVMeteringInfo\", \"spine\")\n .catch(() => this.log.debug(\"Failed to get spine\"))\n .finally(async () => {\n await this.sleep(10000);\n this.getMethod(\"https://smart.vaillant.com/mobile/api/v4/facilities/$serial/emf/v1/devices/\", \"emf\")\n .catch(() => this.log.debug(\"Failed to get emf\"))\n .finally(() => {});\n });\n });\n });\n });\n })\n .catch(() => {\n this.log.error(\"clean configuration failed\");\n });\n\n this.updateInterval = setInterval(() => {\n this.updateValues();\n }, this.config.interval * 60 * 1000);\n this.log.debug(\"Set update interval to: \" + this.config.interval + \"min\");\n })\n .catch(() => {\n this.log.error(\"facility failed\");\n });\n })\n .catch(() => {\n this.log.error(\"Login failed\");\n });\n\n // in this template all states changes inside the adapters namespace are subscribed\n this.subscribeStates(\"*\");\n }", "async function connection()\n{\n\t//First set connection to false\n\tisConnected = false;\n\t//Send a sub/ack request to the controller\n\tclient.publish('sub', key.encrypt('sub'), function (err)\n\t{\n\t\tif (err) throw \"Error Description: \" + err;\n\t});\n\t\n\t//Wait 1 sec for a response\n\tawait sleep(1000);\n\t\n\t//If no ack, disable all inputs to the controller\n\tif (isConnected == false)\n\t{\n\t\tprocess.stdin.pause();\n\t\tconsole.log(\"Awaiting Connection\");\n\t}\n}", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(\"#\");\n message = new Paho.MQTT.Message(\"Hello\");\n message.destinationName = \"World\";\n client.send(message);\n}", "function init () {\n log.info('Hyperion Remote starting...')\n createSSDPHandler()\n createWebsocketHandler()\n createWindow()\n}", "function onConnect() {\n\n\tconsole.log(\"Connected to MQTT broker!\");\n\tmqttClient.subscribe(mqtt_mood);\t// subscribe to mood topic to retrieve calculated mood by server\n\t// once connected to the broker, commence sensor reading\n\ttizen.ppm.requestPermission(\"http://tizen.org/privilege/healthinfo\",\n\t\t\tonSuccessPermission, onErrorPermission);\t\t\t\t\t// request to use watch sensors\n \n}", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"Connected!\");\n client.subscribe(\"undiknas/ti/kelompok4/relay\");\n client.subscribe(\"undiknas/ti/kelompok4/relay/state\");\n client.subscribe(\"undiknas/ti/kelompok4/sensor/suhu\");\n client.subscribe(\"undiknas/ti/+/chatroom\");\n /*message = new Paho.MQTT.Message(\"Hello CloudMQTT\");\n message.destinationName = \"/cloudmqtt\";\n client.send(message);*/\n }", "start() {\n if ( this.status !== STATUS_DISCONNECTED ) {\n throw \"Qbot cannot start, status unexpected (\" + this.status + \").\";\n }\n\n this.rtm.start();\n this.status = STATUS_CONNECTING;\n }", "async started() {\n this.broker.logger.info('[service][company]===>', 'started')\n }", "async function starts(){\n\tconst zef = new WAConnection()\n\tzef.logger.level = 'warn'\n\t\n\tzef.on('qr', qr => {\n\t\tqrcode.generate(qr, { small: true })\n\t\tconsole.log(`[!] Scan qrcode dengan whatsapp`)\n\t})\n\n\tzef.on('credentials-updated', () => {\n\t\tconst authinfo = zef.base64EncodedAuthInfo()\n\t\tconsole.log('[!] Credentials Updated')\n\n\t\tfs.writeFileSync('./rizqi.json', JSON.stringify(authinfo, null, '\\t'))\n\t})\n\n\tfs.existsSync('./rizqi.json') && zef.loadAuthInfo('./rizqi.json')\n\n\tzef.on('connecting', () => {\n\t\tconsole.log('Connecting')\n\t})\n\tzef.on('open', () => {\n\t\tconsole.log('Bot Is Online Now!!')\n\t})\n\tzef.connect()\n\n\tzef.on('chat-update', async (msg) => {\n\t\ttry {\n\t\t\tif (!msg.hasNewMessage) return\n\t\t\tmsg = JSON.parse(JSON.stringify(msg)).messages[0]\n\t\t\tif (!msg.message) return\n\t\t\tif (msg.key && msg.key.remoteJid == 'status@broadcast') return\n\t\t\tif (msg.key.fromMe) return\n\t\t\tglobal.prefix\n\t\t\t\n\t\t\tconst from = msg.key.remoteJid\n\t\t\tconst isGroup = from.endsWith('@g.us')\n\t\t\tconst type = Object.keys(msg.message)[0]\n\t\t\tconst id = isGroup ? msg.participant : msg.key.remoteJid\n\n\t\t\tconst { text, extendedText, contact, location, liveLocation, image, video, sticker, document, audio, product } = MessageType\n\n\t\t\tbody = (type === 'conversation' && msg.message.conversation.startsWith(prefix)) ? msg.message.conversation : (type == 'imageMessage') && msg.message.imageMessage.caption.startsWith(prefix) ? msg.message.imageMessage.caption : (type == 'videoMessage') && msg.message.videoMessage.caption.startsWith(prefix) ? msg.message.videoMessage.caption : (type == 'extendedTextMessage') && msg.message.extendedTextMessage.text.startsWith(prefix) ? msg.message.extendedTextMessage.text : ''\n\t\t\tbudy = (type === 'conversation') ? msg.message.conversation : (type === 'extendedTextMessage') ? msg.message.extendedTextMessage.text : ''\n\t\t\t\n\t\t\t const argv = body.slice(1).trim().split(/ +/).shift().toLowerCase()\n\t\t\t const args = body.trim().split(/ +/).slice(1)\n\t\t\t const isCmd = body.startsWith(prefix)\n\n\t\t\t const groupMetadata = isGroup ? await zef.groupMetadata(from) : ''\n\t\t\t const groupName = isGroup ? groupMetadata.subject : ''\n\t\t\t const groupId = isGroup ? groupMetadata.jid : ''\n\t\t\t const isMedia = (type === 'imageMessage' || type === 'videoMessage' || type === 'audioMessage')\n\t\t\t \n\t\t\t const content = JSON.stringify(msg.message)\n\t\t\t \n\t\t\t const isQuotedImage = type === 'extendedTextMessage' && content.includes('imageMessage')\n\t const isQuotedVideo = type === 'extendedTextMessage' && content.includes('videoMessage')\n\t const isQuotedAudio = type === 'extendedTextMessage' && content.includes('audioMessage')\n\t const isQuotedSticker = type === 'extendedTextMessage' && content.includes('stickerMessage')\n\t const isQuotedMessage = type === 'extendedTextMessage' && content.includes('conversation')\n\n\t\t\t const command = msg.message.conversation\n\t if (!isGroup){\n\t \tif (command.includes('/start')){\n\t \t\tawait zef.sendMessage(id, \"Selamat Datang di Anonim Chat bot\\n bot yang digunakan untuk chatting secara anonim buatan Rizqi a.k.a ZefianAlfian\", text, {quoted: msg})\n\t \t} else if (command.includes('/find')){\n\t \t\t// Fungsi untuk mencari partner\n\t \t\tconst isActiveSess = helper.isActiveSession(id , bot)\n\t // Apakah user sudah punya sesi chatting ?\n\t \t\tif(!isActiveSess) {\n\t \t\tawait zef.sendMessage(id , \"Kegagalan Server!\")\n\t \t\t }\n\t \t\t\n\t \t\t// Apakah user udah ada di antrian ?\n\t \t\tconst isQueue = await queue.find({user_id: id})\n\t \t\t if(!isQueue.length){\n\t \t\t // Kalo gak ada masukin ke antrian\n\t \t\t await queue.insert({user_id: id , timestamp: parseInt(moment().format('X'))})\n\t \t\t }\n\t \t\t // Kirim pesan kalo lagi nyari partner\n\t \t\t zef.sendMessage(id , '<i>Mencari Partner Chat ...</i>' , {parse_mode: 'html'})\n\t \t\t // apakah ada user lain yang dalam antrian ?\n\t \t\t var queueList = await queue.find({user_id: {$not: {$eq: id}}})\n\t \t\t // Selama gak ada user dalam antrian , cari terus boss\n\t \t\t while(queueList.length < 1){\n\t \t\t queueList = await queue.find({user_id: {$not: {$eq: id}}})\n\t \t\t }\n\t \t\t\n\t \t\t // Nah dah ketemu nih , ambil user id dari partner\n\t \t\t const partnerId = queueList[0].user_id\n\t \t\t // Ini ngamdil data antrian kamu\n\t \t\t const you = await queue.findOne({user_id: id})\n\t \t\t // Ini ngamdil data antrian partner kamu\n\t \t\t const partner = await queue.findOne({user_id: partnerId})\n\t \t\t\n\t \t\t // Kalo data antrian kamu belum di apus (atau belum di perintah /stop)\n\t \t\t if(you !== null){\n\t \t\t // apakah kamu duluan yang nyari partner atau partnermu\n\t \t\t if(you.timestamp < partner.timestamp){\n\t \t\t // kalo kamu duluan kamu yang mulai sesi , partner mu cuma numpang\n\t \t\t await active_sessions.insert({user1: id,user2:partnerId})\n\t \t\t }\n\t \t\t // Hapus data kamu sama partnermu dalam antrian\n\t \t\t for(let i = 0 ;i < 2;++i){\n\t \t\t const data = await queue.find({user_id: (i > 0 ? partnerId : id)})\n\t \t\t await queue.remove({id: data.id})\n\t \t\t }\n\t \t\t\n\t \t\t // Kirim pesan ke kamu kalo udah nemu partner\n\t \t\t await zef.sendMessage(id , \"Kamu Menemukan Partner chat\\nSegera Kirim Pesan\")\n\t \t}\n\t } else if (isGroup) {\n\t \tif (command.includes('/start')){\n\t \t\tawait zef.sendMessage(from, \"Kamu berada di dalam grup\", text, {quoted:msg})\n\t \t}\n\t }\n} catch (e) {\n\tconsole.log(e)\n\t}\n\t})\n\t}", "async onReady() {\n try\n {\n // Initialize your adapter here\n this.log.info(\"onReady()\");\n \n this.unit = \"C\";\n \n this.log.info(`Starting user=[${this.config.username}] pass=[${this.config.password}]`);\n this.evo = new Evo( this.config.username, this.config.password);\n this.evo.log = this.log;\n this.evo.onCommand = (ev) => this.evoCommandSent(ev);\n \n let ms = (this.config.pollSeconds || POLL_MIN_S)*1000;\n if(ms<POLL_MIN_S*1000) {\n ms = POLL_MIN_S*1000;\n this.config.pollSeconds = POLL_MIN_S;\n this.log.warn(`Poll rate too fast; set to ${POLL_MIN_S}s`);\n }\n\n\n await this.makeState( \"errmsg\", \"Error Message\", \"string\", \"\" );\n await this.makeState( \"error\", \"Error State\", \"boolean\", \"\" );\n await this.setErrorMessage(\"Initialising\");\n\n this.needConnect = \"Init\";\n this.log.info(`Starting poll at ${ms}ms`);\n this.poll_promise = this.poller(ms); // not awaited...\n //this.timer = setInterval( () => this.tick(), ms );\n // this.tick();\n \n } catch(ex) {\n this.log.error(ex.stack); \n }\n\n }", "function startOneCommandArtyom(){\n artyom.fatality();// use this to stop any of\n\n setTimeout(function(){// if you use artyom.fatality , wait 250 ms to initialize again.\n artyom.initialize({\n lang:\"en-GB\",// A lot of languages are supported. Read the docs !\n continuous:true,// recognize 1 command and stop listening !\n listen:true, // Start recognizing\n debug:true, // Show everything in the console\n speed:1 // talk normally\n }).then(function(){\n console.log(\"Ready to work !\");\n artyom.say(\"I'm listening...\");\n });\n },250);\n }" ]
[ "0.58810544", "0.5861172", "0.58084726", "0.56619513", "0.5636481", "0.5614398", "0.56017923", "0.55977917", "0.5561187", "0.554426", "0.55383235", "0.55216837", "0.55192965", "0.5510061", "0.54942155", "0.5489043", "0.54535776", "0.5438874", "0.5436381", "0.5414355", "0.5385126", "0.53679335", "0.53618354", "0.5349671", "0.5344552", "0.53279346", "0.5322376", "0.53204924", "0.53139794", "0.53073233", "0.53048897", "0.5300687", "0.52923363", "0.52887124", "0.5280039", "0.5263421", "0.5257315", "0.5255128", "0.52328044", "0.52234143", "0.5217301", "0.52136034", "0.5212839", "0.52055156", "0.520349", "0.5193613", "0.51874745", "0.5184972", "0.51801956", "0.5176355", "0.5170004", "0.51645803", "0.5164042", "0.51482004", "0.51473004", "0.5145001", "0.51313716", "0.5130491", "0.5127473", "0.5116154", "0.51150817", "0.50956", "0.5095041", "0.5094942", "0.50902814", "0.5088692", "0.5086821", "0.50851554", "0.50735164", "0.5073498", "0.5072352", "0.5070948", "0.50692", "0.5066141", "0.5066131", "0.5057945", "0.5057586", "0.5053633", "0.5052126", "0.5051929", "0.50512224", "0.5047309", "0.5047026", "0.5043867", "0.5040714", "0.5037709", "0.5035909", "0.5027702", "0.5025228", "0.50212675", "0.5017465", "0.5016061", "0.5014866", "0.5013797", "0.5001105", "0.4998457", "0.49977383", "0.49951404", "0.49860683", "0.49843097" ]
0.55109984
13
Sets $scope.row to currently selected JMS message. Used in: ARTEMIS/js/browse.ts camel/js/browseEndpoint.ts TODO: remove $scope argument and operate directly on other variables. but it's too much side effects here...
function selectCurrentMessage(message, key, $scope) { // clicking on message's link would interfere with messages selected with checkboxes if ('selectAll' in $scope.gridOptions) { $scope.gridOptions.selectAll(false); } else { $scope.gridOptions.selectedItems.length = 0; } var idx = Core.pathGet(message, ["rowIndex"]) || Core.pathGet(message, ['index']); var jmsMessageID = Core.pathGet(message, ["entity", key]); $scope.rowIndex = idx; var selected = $scope.gridOptions.selectedItems; selected.splice(0, selected.length); if (idx >= 0 && idx < $scope.messages.length) { $scope.row = $scope.messages.find(function (msg) { return msg[key] === jmsMessageID; }); if ($scope.row) { selected.push($scope.row); } } else { $scope.row = null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selectCurrentMessage(message, key, $scope) {\n // clicking on message's link would interfere with messages selected with checkboxes\n if ('selectAll' in $scope.gridOptions) {\n $scope.gridOptions.selectAll(false);\n }\n else {\n $scope.gridOptions.selectedItems.length = 0;\n }\n var idx = Core.pathGet(message, [\"rowIndex\"]) || Core.pathGet(message, ['index']);\n var jmsMessageID = Core.pathGet(message, [\"entity\", key]);\n $scope.rowIndex = idx;\n var selected = $scope.gridOptions.selectedItems;\n selected.splice(0, selected.length);\n if (idx >= 0 && idx < $scope.messages.length) {\n $scope.row = $scope.messages.find(function (msg) { return msg[key] === jmsMessageID; });\n if ($scope.row) {\n selected.push($scope.row);\n }\n }\n else {\n $scope.row = null;\n }\n }", "set row(row) {\n this.que['row'] = row;\n }", "function onRowSelected(row) {\n if (row) {\n selectedVmRow = row;\n selectedRow = row;\n //updateContextualCommands(row);\n }\n }", "function setClickedRow(index){\n var vm = this;\n vm.selectedRow = index;\n }", "function setSelectedRow(index){\n CycleCountLineCtrl.ePage.Masters.selectedRow = index;\n }", "viewCurrentRecord(currentRow) {\n console.log('currentRow-->'+JSON.stringify(currentRow));\n this.bShowModal = true;\n this.isEditForm = false;\n this.selectedRecord = currentRow.sId;\n this.selectedEnrollmentType = currentRow.sEnrollmentType;\n }", "function onRequestClicked(row) {\n \n // Mark row as selected\n $(row).addClass('selected').siblings().removeClass('selected'); \n var value=$(this).find('td:first').html();\n \n // Get selected Row ID\n var rowId = row.id;\n var message = requests[parseInt(rowId)];\n \n \n var httpHeader = message.date + '\\n' \n + 'From: ' + message.remoteAddress + '\\n'\n + 'Listeners: ' + message.listeners + '\\n'\n + '------------------------------' + '\\n'\n + message.type + ' ' + message.url + '\\n';\n \n var propValue;\n for(var propName in message.headers) {\n propValue = message.headers[propName];\n httpHeader += propName + ': ' + propValue + '\\n';\n }\n \n var requestData = \"\";\n try {\n requestData += JSON.stringify(JSON.parse(message.body), null, 2);\n } catch(e) {\n requestData += '\\nERROR: Failed to parse json because: ' + e + '\\n\\n';\n requestData += '\\n' + message.body;\n }\n\n pre = document.getElementById('httpHeaders');\n pre.textContent = httpHeader;\n //$('httpHeaders').html(httpHeader);\n \n var editor = ace.edit(\"editor\");\n editor.setValue(requestData);\n editor.session.selection.clearSelection();\n editor.scrollToLine(0);\n}", "function changeHandler(data, dataItem, column) {\n $scope.selectedItem = data;\n stockService.getNewsRelease(data.newsKey)\n .then(function (data) {\n $scope.newsData = data;\n $scope.newsData.body = utils.trustAsHtml($scope.newsData.body);\n });\n }", "function decorate($scope) {\n $scope.selectRowIndex = function (idx) {\n $scope.rowIndex = idx;\n var selected = $scope.gridOptions.selectedItems;\n selected.splice(0, selected.length);\n if (idx >= 0 && idx < $scope.messages.length) {\n $scope.row = $scope.messages[idx];\n if ($scope.row) {\n selected.push($scope.row);\n }\n }\n else {\n $scope.row = null;\n }\n };\n $scope.$watch(\"showMessageDetails\", function () {\n if (!$scope.showMessageDetails) {\n $scope.row = null;\n $scope.gridOptions.selectedItems.splice(0, $scope.gridOptions.selectedItems.length);\n }\n });\n }", "function UltraGrid_Row_SetSelected(bSelected)\n{\n\t//update selected state\n\tthis.Selected = bSelected;\n\t//loop through all cells in the row\n\tfor (var cells = this.Columns, iCell = 0, cCell = cells.length; iCell < cCell; iCell++)\n\t{\n\t\t//update selection\n\t\tcells[iCell].SetSelected(bSelected);\n\t}\n}", "function onSelectRow() {\n // Update selected rows\n if (component.initialized) {\n updateSelectedRows();\n }\n }", "selectRow(rowId) {\n this.setState({\n selectedRowId: rowId\n })\n }", "function showMessageRow(message) {\n $('#sodar-pr-project-list-message td').text(message);\n $('#sodar-pr-project-list-message').show();\n}", "selectedShareRow({ commit }, shareId) {\n commit(\"SET_SELECTED_SHARE\", shareId);\n }", "function setCurrentItem(item)\n{\n selectedObject = item;\n}", "function viewSelectedThreadOnly(){\n\t\n\t /*\n\t * reset so this does not keep counting up\n\t */\n\t currentRow = -1;\n\t \n\t \n\t // find the grid in dom\n\t var grid2 = dijit.byId(\"grid\");\n\t \n\t // following is experimenal code that prints all the method on object\n\t // starting with \"on\"\n\t // below was for debug purpose\n\t // for (var i in grid2) if (i.indexOf(\"on\")==0) console.log(i);\n\t // for (var i in grid2.model) if (i.indexOf(\"on\")==0) console.log(i);\n\t \n\t // get selected rows from the grid\n\t var items = grid2.selection.getSelected();\n\t \n\t // create a array to store selected thread value\n\t var threadArray = new Array();\n\t \n\t // check if anything was selected\n\t if (items.length) {\n\t // Iterate through the list of selected items.\n\t // The current item is available in the variable\n\t // \"selectedItem\" within the following function:\n\t dojo.forEach(items, function(selectedItem){\n\t if (selectedItem !== null) {\n\t // get the thread id from the selected row\n//\t \tvar selItem = grid2.getItem(selectedItem);\n\t \t//console.debug(selectedItem);\n\t var currentlySelected = grid2.store.getValue(selectedItem, 'threadid');\n\t // console.log(\"Selected Threadid\"+currentlySelected);\n\t \n\t // store it in the array\n\t threadArray.push(currentlySelected);\n\t } // end if\n\t }); // end forEach\n\t }\n\t else {\n\t // if nothing was selected, show a error dialog\n\t\n\t var dlg = dijit.byId('errorDialog');\n\t dlg.clearAll();\n\t dlg.addError(nlsArray.ras_logviewer_selectOneRow_error, null);\n\t dlg.show();\n\t return;\n\t \n\t }// end if\n\t // create a object to send to server\n\t \n\t showSelectedThread(threadArray);\n\t \n\t}", "function fillPrintOrder (selectedRow) {\n console.log ('Fill selected order to print');\n $.ajax ({\n type: 'GET',\n url: rootURL + \"/orders/\" + selectedRow.data ()[0],\n dataType: \"json\", // data type of response\n success: function (data) {\n //$ ('#orderForm').find ('#oId').val (selectedRow.data ()[0]);\n //$ ('#orderForm').find ('#oRow').val (selectedRow.index ());\n renderPrintOrder (data);\n //$ ('#orderModal').modal ('show');\n },\n error: function (data, textStatus, jqXHR) {\n console.log (\"failed\", data);\n }\n });\n}", "function polQteListGrid_selectRow(pk) {\r\n var selectedRecordset = getXMLDataForGridName('polQteListGrid').recordset;\r\n if(selectedRecordset.Fields('CPOLICYNO')) {\r\n var pnObj = getParentWindow().document.forms[0].PolicyNo;\r\n if(pnObj) {\r\n var policyNo = selectedRecordset.Fields('CPOLICYNO').Value;\r\n getParentWindow().setObjectValue(\"PolicyNo\", policyNo);\r\n }\r\n }\r\n}", "handleRowSelection(event) {\n this.selectedData = this.template.querySelector('lightning-datatable').getSelectedRows();\n }", "function HandleTblRowClicked(tblRow) {\n\n// --- toggle select clicked row\n t_td_selected_toggle(tblRow, false); // select_single = false: multiple selected is possible\n\n// get data_dict from data_rows\n const data_dict = get_datadict_from_tblRow(tblRow);\n console.log( \"data_dict\", data_dict);\n\n// --- update selected studsubj_dict / student_pk / subject pk\n selected.data_dict = (data_dict) ? data_dict : null;\n\n console.log( \" selected\", selected);\n }", "reloadCurrentRow() {\n loadAllRows().then((response) => this.receiveData(this.currentRowIndex, response));\n }", "viewCurrentRecord(currentRow) {\r\n const awsAccountId = currentRow[AWS_ACCOUNT_FIELD.fieldApiName];\r\n this.selectedAwsAccountLabel = this.currentOceanRequest.applicationDetails.awsAccounts.filter(a => a.value === awsAccountId)[0].label;\r\n this.bShowModal = true;\r\n this.isEditForm = false;\r\n this.record = currentRow;\r\n }", "showRowDetails(row) {\n this.record = row;\n }", "select(column, row, length) {\n this._selectionService.setSelection(column, row, length);\n }", "function select_row_internal_fill_external(){\n // select row\n $(\"#internal_table tbody\").on('click', 'tr', function () {\n // if we click on row which is already selected. we desect it\n if($(this).hasClass('selected')){\n //row is deselected. that means there is no selected row in the table\n is_selected_internal = false;\n\n // remove supplier external product table content\n table_external.clear().draw();\n\n // deselect row\n $(this).removeClass('selected');\n\n sel_internal_table_row = null;\n // row is not selected. deselect selected row and select current\n }else{\n //row is selected\n is_selected_internal = true;\n\n table_internal.$('tr.selected').removeClass('selected');\n $(this).addClass('selected');\n\n var data = table_internal.row(this).data();\n // fill supplier external product table content\n fill_supplier_external_product_table(data);\n\n sel_internal_table_row = this;\n }\n });\n}", "cursor_send(selection) {\n const content = {\n selection: selection,\n clientID: this.client_id\n };\n const json = JSON.stringify({\n type: 'selection',\n data: content\n });\n this.socket.send(json);\n }", "function fillOrder (selectedRow) {\n console.log ('Fill selected order');\n $.ajax ({\n type: 'GET',\n url: rootURL + \"/orders/\" + selectedRow.data ()[0],\n dataType: \"json\", // data type of response\n success: function (data) {\n $ ('#orderForm').find ('#oId').val (selectedRow.data ()[0]);\n $ ('#orderForm').find ('#oRow').val (selectedRow.index ());\n renderOrderEditData (data);\n $ ('#orderModal').modal ('show');\n },\n error: function (data, textStatus, jqXHR) {\n console.log (\"failed\", data);\n }\n });\n}", "function updateSelectedRows() {\n var selectedList = [];\n if (grid.api) {\n var selectedRows = component.getSelection();\n _.each(selectedRows, function (row) {\n selectedList.push(row[component.constants.ROW_IDENTIFIER]);\n });\n }\n component.onSelectRows(selectedList);\n }", "function canvasSelectRowAnnotation(row_uuid) {\n this.last_active_annotation = this.active_row = this.annotations.rows.find(function (item) {\n return item.uuid === row_uuid;\n });\n}", "_selectRow(e) {\n let allTr = this.shadowRoot.querySelector('tbody').querySelectorAll('tr');\n let len = allTr.length;\n while (len--) {\n allTr[len].setAttribute('selected', false);\n }\n\n if (e.target.parentElement.parentNode.rowIndex >= 0) {\n e.target.parentElement.parentNode.setAttribute('selected', true);\n this._selectedIndex = e.target.parentElement.parentNode.rowIndex - 1;\n\n if (e.type === 'click') {\n this.dispatchEvent(new CustomEvent('tablerow-selected', {\n detail: this._collection.rawEntity.entities[this._selectedIndex], bubbles: true, composed: true\n }));\n }\n } else if (e.target.nodeName === 'INPUT' && e.target.parentNode.parentElement.parentElement.rowIndex >= 0) {\n this._selectedIndex = e.target.parentNode.parentElement.parentElement.rowIndex - 1;\n }\n\n }", "function selectRow(systemObjNum){\n // Saves the current row\n var rowNum = $(\".selected > label\").first().prop(\"for\").substring(8);\n var i = 1;\n for(i; i < systemObjs[rowNum].propAmount + 1; i++){\n systemObjs[rowNum].info[i][4] = $(\"#info\" + i).val();\n }\n\n // Changes the selected row class\n $('.selected').removeClass('selected');\n $('#checkbox' + systemObjNum).parent().parent().addClass('selected');\n\n //Clears the html\n var systemObj = systemObjs[systemObjNum];\n $('#current-title').text('Changes for: ' + systemObj.name);\n\n $(\"#info-table\").html(\"\");\n $(\"#info-table\").append(\"<tr><th>Property</th><th>Current</th><th>Nasa</th><th>Exoplanet</th><th>Result</th></tr>\");\n\n var i = 1\n // Looping with + 1\n for(i; i < systemObj.info.length; i++){\n $(\"#info-table\").append(generateRowHTML(systemObj.info[i], i));\n }\n}", "function selectLine(line){\n console.log(\"Line \"+line+\" is selected.\")\n global.selectedLine = line;\n refreshLineChoiceText();\n // empty table\n global.updateTableData(global.tripDatatable);\n // gets data in table\n ajaxCallTrips(line);\n }", "function selectionChangedHandler() {\n var flex = $scope.ctx.flex;\n var current = flex.collectionView ? flex.collectionView.currentItem : null;\n if (current != null) {\n $scope.selectedTaskId = current.taskId;\n $scope.selectedUserName = current.userName;\n } else {\n $scope.selectedTaskId = -1;\n $scope.selectedUserName = \"\";\n }\n manageActions();\n }", "get currentRow() {\n return this._currentRow;\n }", "function initNewInvRow() {\n $scope.newInvRw = RefundsStructure.getNewInv(tableCode, formName);\n }", "selectRow() {\n if (!this.owner.enableSelection) {\n return;\n }\n this.selectTableRow();\n }", "function fillOrderDetails (selectedRow) {\n console.log (\"Filling order details to update shipping\");\n $ ('#shippingDetails').find ('#sRowId').val (selectedRow.index ());\n fillShippingDataForUpdating (selectedRow.data ());\n}", "function copyToCB(){\n\t\n\t // find the grid in dom\n\t var grid2 = dijit.byId(\"grid\");\n\t \n\t // get selected rows from the grid\n\t var items = grid2.selection.getSelected();\n\t \n\t var s = \"\";\n\t \n\t var newLine = \"\\n\";\n\t if(navigator.appVersion.indexOf(\"Win\")!=-1) {\n\t \tnewLine = \"\\r\\n\";\n\t }\n\t \n\t // check if anything was selected\n\t if (items.length) {\n\t // Iterate through the list of selected items.\n\t // The current item is available in the variable\n\t // \"selectedItem\" within the following function:\n\t dojo.forEach(items, function(selectedItem){\n\t if (selectedItem !== null) {\n\t // 12463713755870TRAS0017I: The startup trace state is\n\t // *=info.INFO com.ibm.ejs.ras.ManagerAdmin\n\t // get the thread id from the selected row\n//\t \tvar selItem = grid2.getItem(selectedItem);\n\t var thread = grid2.store.getValue(selectedItem, 'threadid');\n\t var message = grid2.store.getValue(selectedItem, 'message');\n\t var logger = grid2.store.getValue(selectedItem, 'logger');\n\t var level = grid2.store.getValue(selectedItem, 'event');\n\t var date = grid2.store.getValue(selectedItem, 'datetime');\n\t if (thread === \"*\") {\n\t \tthread = \"\";\n\t \tlogger = \"\";\n\t \tlevel = \"\";\n\t \tdate = \"\";\n\t \t/*\n\t \t * we need to format header\n\t \t */\n\t \tvar eqRegEx = /<\\/td><td class='dojoxGrid-cell' style='font-size:9px'>/g;\n\t \tvar evColRegEx = /<\\/td><\\/tr><tr class='dojoxGrid-row dojoxGrid-row-odd'><td class='dojoxGrid-cell' style='font-size:9px'>/g;\n\t \tvar oddColRegEx = /<\\/td><\\/tr><tr class='dojoxGrid-row'><td class='dojoxGrid-cell' style='font-size:9px'>/g;\n\t \t\tvar htmlTags = /<(?:.|\\s)*?>/g;\n\t \tmessage = message.replace(eqRegEx, \"=\");\n\t \tmessage = message.replace(evColRegEx, newLine);\n\t \tmessage = message.replace(oddColRegEx, newLine);\n\t \tmessage = message.replace(htmlTags, \"\");\n\n\t }\n\t \n\t s = s.concat(formatTime(date), \" \", formatThreadId(thread), \" \", logger, \" \", level, \" \", message, newLine);\n\t \n\t } // end if\n\t }); // end forEach\n\t // console.debug(s);\n\t if (dojo.isIE && window.clipboardData && clipboardData.setData) {\n\t clipboardData.setData(\"Text\", s);\n\t }\n\t else \n\t if (dojo.isFF || dojo.isMozilla) {\n\t copyToClipboard(s);\n\t }\n\t else \n\t if (dojo.isChrome || navigator.userAgent.indexOf('Chrome') !== -1) {\n\t Clipboard.copy(s);\n\t }\n\t else {\n\t // one of the unsupported behaviour. display a error\n\t var dlg = dijit.byId('errorDialog');\n\t dlg.clearAll();\n\t dlg.addError(nlsArray.hpel_logview_copytocb_unsupportedbrowser, null);\n\t dlg.show();\n\t\n\t \treturn;\n\t }\n\t }\n\t else {\n\t // if nothing was selected, show a error dialog\n\t dlg = dijit.byId('errorDialog');\n\t dlg.clearAll();\n\t dlg.addError(nlsArray.hpel_logview_copytocb_selectOneRowError, null);\n\t dlg.show();\n\t return;\n\t \n\t }// end if\n\t}", "handleRowClick(event) {\n\t\tthis.selectedRecordId = event.detail.pk;\n\t}", "copySelectedCellValue() {\n var txtView = new latte.TextView();\n txtView.text = this.selectedCell.text();\n var btnOk = new latte.ButtonItem();\n btnOk.text = strings.ok;\n var d = new latte.DialogView(txtView, [btnOk]);\n d.show();\n txtView.textElement.focus();\n txtView.textElement.select();\n }", "function onMessageArrived(message) {\n $rows = $('#properties-table tbody > tr');\n\n\n $rows.each(function(){\n $row = $(this)\n if ($row.children('td.topic').text() == message.destinationName){\n $row.children('td.action-result').html(message.payloadString)\n }\n })\n }", "function changeClaimInAnnoTable() {\n console.log(\"changeClaimInAnnoTable called\");\n\n var idFromAnnTable = $('#mp-editor-claim-list option:selected').val();\n\n //console.log($('#mp-editor-claim-list option:selected').val());\n\n var idFromDialog = $('#dialog-claim-options option:selected').val();\n var newAnnotationId = idFromAnnTable;\n\n // update selection in dialog\n if (idFromDialog != newAnnotationId) {\n $(\"#dialog-claim-options > option\").each(function () {\n if (this.value === newAnnotationId) $(this).prop('selected', true);\n }); \n }\n\n\n //console.log(\"table - claim changed to :\" + newAnnotationId);\n currAnnotationId = newAnnotationId;\n\n sourceURL = getURLParameter(\"sourceURL\").trim();\n email = getURLParameter(\"email\");\n\n $.ajax({url: \"http://\" + config.annotator.host + \"/annotatorstore/search\",\n data: {annotationType: \"MP\", \n email: email, \n uri: sourceURL.replace(/[\\/\\\\\\-\\:\\.]/g, \"\")},\n method: 'GET',\n error : function(jqXHR, exception){\n console.log(exception);\n },\n success : function(response){\n updateClaimAndData(response.rows, newAnnotationId);\n } \n }); \n}", "_selectLineAt(line) {\n const wrappedRange = this._bufferService.buffer.getWrappedRangeForLine(line);\n this._model.selectionStart = [0, wrappedRange.first];\n this._model.selectionEnd = [this._bufferService.cols, wrappedRange.last];\n this._model.selectionStartLength = 0;\n }", "function setSelection(){\r\n\t\t\tif (opts.idField){\r\n\t\t\t\tfor(var i=0; i<data.rows.length; i++){\r\n\t\t\t\t\tvar row = data.rows[i];\r\n\t\t\t\t\tif (contains(state.selectedRows, row)){\r\n\t\t\t\t\t\topts.finder.getTr(target, i).addClass('datagrid-row-selected');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (contains(state.checkedRows, row)){\r\n\t\t\t\t\t\topts.finder.getTr(target, i).find('div.datagrid-cell-check input[type=checkbox]')._propAttr('checked', true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfunction contains(a,r){\r\n\t\t\t\tfor(var i=0; i<a.length; i++){\r\n\t\t\t\t\tif (a[i][opts.idField] == r[opts.idField]){\r\n\t\t\t\t\t\ta[i] = r;\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}", "setSelectedRow(rowIndex) {\n if (this._grid && this._grid.setSelectedRows) {\n this._grid.setSelectedRows([rowIndex]);\n }\n }", "handleSelect(item) {\n this._selected = item\n this._opener.inputValue = item.text\n }", "function assignMessages()\n{\n //fileName is a parameter in this, and it clashes with a field name\n delete dc.values['fileName'];\n var grid = dc.grids['messages'];\n for (var i = 0; i < grid.length; i++)\n {\n var row = grid[i];\n row[0] = row[1]; //first col is _type, and second one is messageName. We want messageName in both.\n row.length = 2;\n }\n}", "set selectedCell(value) {\n if (!(value instanceof jQuery))\n throw new latte.InvalidArgumentEx('value');\n this.selectCellAt(value.data('columnIndex'), value.data('rowIndex'));\n }", "function MSM_FillSelectRow(tblBody_select, data_dict, row_is_selected, insert_at_index_zero) {\n //console.log( \"===== MSM_FillSelectRow ========= \");\n //console.log(\"data_dict: \", data_dict);\n\n // cluster has no base table\n const pk_int = data_dict.id;\n const display_name = (data_dict.name) ? data_dict.name : \"-\";\n\n //console.log( \"display_name: \", display_name);\n\n const map_id = (data_dict.mapid) ? data_dict.mapid : null;\n\n// --- lookup index where this row must be inserted\n const ob1 = (data_dict.dep_sequence) ? \"00000\" + data_dict.dep_sequence.toString() : \"\";\n const ob2 = (data_dict.name) ? data_dict.name.toLowerCase() : \"\";\n\n const row_index = (insert_at_index_zero) ? 0 :\n b_recursive_tblRow_lookup(tblBody_select, setting_dict.user_lang, ob1, ob2);\n\n// --- insert tblRow into tblBody at row_index\n const tblRow = tblBody_select.insertRow(row_index);\n tblRow.id = map_id;\n\n tblRow.setAttribute(\"data-pk\", pk_int);\n tblRow.setAttribute(\"data-selected\", (row_is_selected) ? \"1\" : \"0\")\n\n// --- add data-sortby attribute to tblRow, for ordering new rows\n tblRow.setAttribute(\"data-ob1\", ob1);\n tblRow.setAttribute(\"data-ob2\", ob2);\n// --- add EventListener to tblRow, not when 'no items' (pk_int is then -1, ''all clusters = -9\n if (pk_int !== -1) {\n tblRow.addEventListener(\"click\", function() {MSM_SelecttableClicked(tblRow)}, false )\n// --- add hover to tblRow\n add_hover(tblRow);\n }\n let td, el;\n\n// --- add select td to tblRow.\n td = tblRow.insertCell(-1);\n td.classList.add(\"mx-1\", \"tw_032\")\n\n// --- add a element to td., necessary to get same structure as item_table, used for filtering\n el = document.createElement(\"div\");\n el.className = (row_is_selected) ? \"tickmark_2_2\" : \"tickmark_0_0\";\n td.appendChild(el);\n\n// --- add td with display_name to tblRow\n td = tblRow.insertCell(-1);\n td.classList.add(\"mx-1\", \"tw_270\")\n// --- add a element to td., necessary to get same structure as item_table, used for filtering\n el = document.createElement(\"div\");\n el.innerText = display_name;\n td.appendChild(el);\n if (display_name) { tblRow.title = display_name};\n\n }", "setRowData(data) {\n this.rowData = data;\n }", "function onSelectionChanged(event) {\n\t\t\t\t\t\n\t\t\t\t\t// Don't trigger foundset selection if table is grouping\n\t\t\t\t\tif (isTableGrouped()) {\n\t\t\t\t\t\t\n // Trigger event on selection change in grouo mode\n if ($scope.handlers.onSelectedRowsChanged) {\n $scope.handlers.onSelectedRowsChanged();\n }\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// set to true once the grid is ready and selection is set\n\t\t\t\t isSelectionReady = true;\n\t\t\t\t\n\t\t\t\t\tif(scrollToSelectionWhenSelectionReady) {\n\t\t\t\t\t\t$scope.api.scrollToSelection();\n\t\t\t\t\t}\n\n\t\t\t\t\t// rows are rendered, if there was an editCell request, now it is the time to apply it\n\t\t\t\t\tif(startEditFoundsetIndex > -1 && startEditColumnIndex > -1) {\n\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t$scope.api.editCellAt(startEditFoundsetIndex, startEditColumnIndex);\n\t\t\t\t\t\t}, 200);\n\t\t\t\t\t}\n\n\t\t\t\t // when the grid is not ready yet set the value to the column index for which has been requested focus\n\t\t\t\t if (requestFocusColumnIndex > -1) {\n\t\t\t\t \t$scope.api.requestFocus(requestFocusColumnIndex);\n\t\t\t\t }\n\n\t\t\t\t\tvar selectedNodes = gridOptions.api.getSelectedNodes();\n\t\t\t\t\tif (selectedNodes.length > 0) {\n\t\t\t\t\t\tvar foundsetIndexes = new Array();\n\n\t\t\t\t\t\tfor(var i = 0; i < selectedNodes.length; i++) {\n\t\t\t\t\t\t\tvar node = selectedNodes[i];\n\t\t\t\t\t\t\tif(node) foundsetIndexes.push(node.rowIndex);\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(foundsetIndexes.length > 0) {\n\t\t\t\t\t\t\tfoundsetIndexes.sort(function(a, b){return a - b});\n\t\t\t\t\t\t\t// if single select don't send the old selection along with the new one, to the server\n\t\t\t\t\t\t\tif(!foundset.foundset.multiSelect && foundsetIndexes.length > 1 &&\n\t\t\t\t\t\t\t\tfoundset.foundset.selectedRowIndexes.length > 0) {\n\t\t\t\t\t\t\t\t\tif(foundset.foundset.selectedRowIndexes[0] == foundsetIndexes[0]) {\n\t\t\t\t\t\t\t\t\t\tfoundsetIndexes = foundsetIndexes.slice(-1);\n\t\t\t\t\t\t\t\t\t} else if(foundset.foundset.selectedRowIndexes[0] == foundsetIndexes[foundsetIndexes.length - 1]) {\n\t\t\t\t\t\t\t\t\t\tfoundsetIndexes = foundsetIndexes.slice(0, 1);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfoundset.foundset.requestSelectionUpdate(foundsetIndexes).then(\n\t\t\t\t\t\t\t\tfunction(serverRows){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t // Trigger event on selection change\n\t\t\t\t if ($scope.handlers.onSelectedRowsChanged) {\n\t\t\t\t $scope.handlers.onSelectedRowsChanged();\n\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//success\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfunction(serverRows){\n\t\t\t\t\t\t\t\t\t//canceled \n\t\t\t\t\t\t\t\t\tif (typeof serverRows === 'string'){\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t//reject\n\t\t\t\t\t\t\t\t\tselectedRowIndexesChanged();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\t$log.debug(\"table must always have a selected record\");\n\t\t\t\t\tselectedRowIndexesChanged();\n\n\t\t\t\t}", "function MSM_FillSelectRow(tblBody_select, data_dict, row_is_selected, insert_at_index_zero) {\n //console.log( \"===== MSM_FillSelectRow ========= \");\n //console.log(\"data_dict: \", data_dict);\n\n // cluster has no base table\n const pk_int = data_dict.id;\n const display_name = (data_dict.name) ? data_dict.name : \"-\";\n\n //console.log( \"display_name: \", display_name);\n\n const map_id = (data_dict.mapid) ? data_dict.mapid : null;\n\n// --- lookup index where this row must be inserted\n //const ob1 = (data_dict.dep_sequence) ? \"00000\" + data_dict.dep_sequence.toString() : \"\";\n const ob1 = (data_dict.name) ? data_dict.name.toLowerCase() : \"\";\n\n const row_index = (insert_at_index_zero) ? 0 :\n b_recursive_tblRow_lookup(tblBody_select, setting_dict.user_lang, ob1);\n\n// --- insert tblRow into tblBody at row_index\n const tblRow = tblBody_select.insertRow(row_index);\n tblRow.id = map_id\n\n tblRow.setAttribute(\"data-pk\", pk_int);\n tblRow.setAttribute(\"data-selected\", (row_is_selected) ? \"1\" : \"0\")\n\n// --- add data-sortby attribute to tblRow, for ordering new rows\n tblRow.setAttribute(\"data-ob1\", ob1);\n //tblRow.setAttribute(\"data-ob2\", ob2);\n\n// --- add EventListener to tblRow, not when 'no items' (pk_int is then -1, ''all clusters = -9\n if (pk_int !== -1) {\n tblRow.addEventListener(\"click\", function() {MSM_SelecttableClicked(tblRow)}, false )\n// --- add hover to tblRow\n add_hover(tblRow);\n }\n let td, el;\n\n// --- add select td to tblRow.\n td = tblRow.insertCell(-1);\n td.classList.add(\"mx-1\", \"tw_032\")\n\n// --- add a element to td., necessary to get same structure as item_table, used for filtering\n el = document.createElement(\"div\");\n el.className = (row_is_selected) ? \"tickmark_2_2\" : \"tickmark_0_0\";\n td.appendChild(el);\n\n// --- add td with display_name to tblRow\n td = tblRow.insertCell(-1);\n td.classList.add(\"mx-1\", \"tw_270\")\n// --- add a element to td., necessary to get same structure as item_table, used for filtering\n el = document.createElement(\"div\");\n el.innerText = display_name;\n td.appendChild(el);\n if (display_name) { tblRow.title = display_name};\n\n }", "function f_row_select_(grid_p, fila_p) {\n\t$('#' + grid_p).find('tr.selected').removeClass('selected');\n\t$('#' + grid_p + ' tbody tr:eq(' + fila_p + ')').addClass('selected');\n\t$('#' + grid_p + ' tbody tr:eq(' + fila_p + ') td:not(td:first-child)')[0].click();\n\n\tt1 = $('#' + grid_p).DataTable();\n\tvar rowSelected = t1.row().$('tr.selected');\n\t$('#' + grid_p).DataTable().row( $(rowSelected).closest('tr') ).select();\n}", "focus() {\n this._selectRowByIndex(0);\n this._FBPTriggerWire('--focus');\n }", "setSelectionModel() {\r\n if (!this.slickGrid) return;\r\n\r\n this.registerEvents();\r\n\r\n this.slickGrid.setSelectionModel(this.selectionModel);\r\n }", "function selectionHandler ( info, tab ) {\n sendItem( { 'message': info.selectionText } );\n}", "function receiveMessage (message) {\n\t \t$scope.message = \"\";\n var jsonMsg = JSON.parse(message.body);\n $scope.text += $sce.trustAsHtml(\"<p class='lineShell_\" + jsonMsg.type + \"'>\" + \" $ \" + jsonMsg.time + \" \" + types[jsonMsg.type] + \"> \" + jsonMsg.text + \"</p>\");\n $scope.type = jsonMsg.type;\n \n //pongo el scroll en la ultima linea\n var shell = document.getElementById(\"shell\");\n shell.scrollTop = shell.scrollHeight;\n $scope.$apply()\n }", "function firstGrid_selectRow(id) {\r\n var qpTransId = id;\r\n if(isEmpty(id)) {\r\n qpTransId = 0;\r\n }\r\n loadAllRiskCoverage(qpTransId);\r\n}", "function selectrow ($this, state) {\r\n // contextual\r\n !!$($this).data(\"contextual\") ? contextual = $($this).data(\"contextual\") : contextual = \"active\";\r\n\r\n if(state === \"checked\") {\r\n // add contextual class\r\n $($this).parents(target).addClass(contextual);\r\n\r\n // publish event\r\n $(element).trigger(settings.eventPrefix+\".selectrow.selected\", { \"element\": $($this).parents(target) });\r\n } else {\r\n // remove contextual class\r\n $($this).parents(target).removeClass(contextual);\r\n\r\n // publish event\r\n $(element).trigger(settings.eventPrefix+\".selectrow.unselected\", { \"element\": $($this).parents(target) });\r\n }\r\n }", "function selectrow ($this, state) {\r\n // contextual\r\n !!$($this).data(\"contextual\") ? contextual = $($this).data(\"contextual\") : contextual = \"active\";\r\n\r\n if(state === \"checked\") {\r\n // add contextual class\r\n $($this).parents(target).addClass(contextual);\r\n\r\n // publish event\r\n $(element).trigger(settings.eventPrefix+\".selectrow.selected\", { \"element\": $($this).parents(target) });\r\n } else {\r\n // remove contextual class\r\n $($this).parents(target).removeClass(contextual);\r\n\r\n // publish event\r\n $(element).trigger(settings.eventPrefix+\".selectrow.unselected\", { \"element\": $($this).parents(target) });\r\n }\r\n }", "function _select(e,row) {\n let { checked } = e.target;\n let index = rows.indexOf(row);\n rows[index].checked = checked;\n getCheckedRows();\n }", "function getRow(_row, _todo) {\n if (_row >= 0)\n setSelectedRow({ row: _row, todo: _todo });\n }", "function changeClaimInDialog() {\n var idFromAnnTable = $('#mp-editor-claim-list option:selected').val();\n var idFromDialog = $('#dialog-claim-options option:selected').val();\n var newAnnotationId = idFromDialog;\n\n // update selection in annotation table\n if (idFromAnnTable != newAnnotationId) \n $(\"#mp-editor-claim-list > option\").each(function () {\n if (this.value === newAnnotationId) $(this).prop('selected', true);\n }); \n\n //console.log(\"dialog - claim changed to :\" + newAnnotationId);\n currAnnotationId = newAnnotationId;\n\n sourceURL = getURLParameter(\"sourceURL\").trim();\n email = getURLParameter(\"email\");\n\n $.ajax({url: \"http://\" + config.annotator.host + \"/annotatorstore/search\",\n data: {annotationType: \"MP\", \n email: email, \n uri: sourceURL.replace(/[\\/\\\\\\-\\:\\.]/g, \"\")},\n method: 'GET',\n error : function(jqXHR, exception){\n console.log(exception);\n },\n success : function(response){\n updateClaimAndData(response.rows, newAnnotationId);\n } \n }); \n}", "function edit_current_subject_id(ev) {\n var currentRow = $(ev).parents()[2];\n var subjectID = $(currentRow)[0].cells[1].innerText;\n loadSubjectInformation(ev, subjectID);\n}", "function scrollToObject() {\n\t\t\t$q.all([\n\t\t\t FindElement.byId(\"resultTableWrapper\"),\n\t\t\t FindElement.byQuery(\"#resultsTable .selectedRow\")\n\t\t\t ]).then(function(elements) {\n\t\t\t\t var table = angular.element(elements[0]);\n\t\t\t\t var selected = angular.element(elements[1]);\n\t\t\t\t var offset = 30;\n\t\t\t\t table.scrollToElement(selected, offset, 0);\n\t\t\t });\n\t\t\t//setFocus();\n\t\t}", "handleRowSelect(row){\n console.log(row);\n }", "function update_read_messages(messages)\n{\n Array.each(messages, function(message) {\n var id = message.get('text');\n var rowelem = $('msgrow-'+id);\n\n // Remove the new class from the ckeckbox and summary\n rowelem.getElementsByClassName('selctrl-opt')[0].removeClass('new');\n rowelem.getElementsByClassName('summary')[0].removeClass('new');\n\n // May as well untick the checkbox, too\n rowelem.getElementsByClassName('selctrl-opt')[0].set('checked', false);\n });\n selects.updateMode();\n controls.updateVis();\n}", "updateContentsProduct(row) {\n let self = this;\n let data = row.data;\n let put = {\n quantity: data.quantity || 0,\n country: data.country || '',\n gtd: data.gtd || '',\n total_w_vat: data.total || 0\n };\n\n this.serverApi.updateReceiveOrderContents(this.receiveOrder.id, data.id, put, result => {\n if(!result.data.errors){\n let r = self.receiveOrder.product_order_contents;\n r[row.index] = angular.extend(r[row.index], result.data);\n self.calculateProductOrderContents();\n self.funcFactory.showNotification('Успешно', 'Продукт ' + data.product.name + ' успешно обновлен', true);\n } else {\n self.funcFactory.showNotification('Не удалось обновить продукт ' + data.product.name, result.data.errors);\n }\n })\n }", "function updateGridRow(whichColumn)\n{\n // check that connection has been chosen before proceeding\n\n if (!connectionHasBeenChosen())\n {\n alert(MM.MSG_NoConnectionSelected);\n return;\n }\n\n var currRowObj = _ColumnNames.getRowValue();\n var currRowText = _ColumnNames.getRow();\n var currColName = currRowText.substring(0, currRowText.indexOf(\"|\"));\n\n // update grid row text\n\n var newRowText = currColName;\n\n newRowText += \"|\" + _ElementLabel.value;\n newRowText += \"|\" + _DisplayAs.get();\n newRowText += \"|\" + (dwscripts.findDOMObject(\"SubmitAs\") ? _SubmitAs.get() : \"\");\n \n _ColumnNames.setRow(newRowText);\n\n // update object that stores information about grid row\n // this object is stored in a value attribute of the Grid object\n // these objects are stored in an array: GridObj.valueList\n\n switch (whichColumn)\n {\n case \"label\":\n currRowObj.label = _ElementLabel.value;\n break;\n\n case \"submitAs\":\n currRowObj.submitAs = _SubmitAs.getValue();\n break;\n\n case \"useWebFormControl\":\n currRowObj.useWebFormControl = _UseWebFormCtrl.getCheckedState();\n\tbreak;\n\n case \"displayAs\": \n currRowObj.displayAs = getFormFieldStorageObjectFromFormFieldType(_DisplayAs.getValue());\n \n // need to update submit property, because changing displayAs menu can\n // auto-change submit type\n \n\tif (dwscripts.findDOMObject(\"SubmitAs\"))\n {\n currRowObj.submitAs = _SubmitAs.getValue();\n }\n\n var defaultStr = currRowObj.defaultStr;\n var passwordStr = currRowObj.passwordStr;\n var fieldType = currRowObj.displayAs.type;\n\n if ((fieldType == \"textField\") ||\n\t (fieldType == \"hiddenField\") || \n (fieldType == \"fileField\") ||\n\t\t(fieldType == \"textArea\"))\n {\n currRowObj.displayAs.value = defaultStr;\n }\n else if (fieldType == \"passwordField\")\n {\n currRowObj.displayAs.value = passwordStr; \n }\n else if (fieldType == \"text\")\n {\n currRowObj.displayAs.text = defaultStr;\n }\n else if (fieldType == \"menu\")\n {\n currRowObj.displayAs.defaultSelected = defaultStr;\n }\n else if (fieldType == \"radioGroup\")\n {\n currRowObj.displayAs.defaultChecked = defaultStr;\n }\n else if (fieldType == \"dynamicCheckBox\")\n {\n currRowObj.displayAs.checkIf = defaultStr;\n }\n break;\n\n default:\n break;\n }\n}", "Sqlrow(){\n\t\tvar value=[];\n\t\tvar number=document.getElementById(\"sqlvalue\").value;\n\t\tvar col=document.getElementById(\"options\");\n\t\tconsole.log(col.selectedIndex);\n\t\tvar column=col.options[col.selectedIndex].text;\n\t\tvalue.push(column);\n\t\tvalue.push(number);\n\t\tvar new1=this.facade.sqlQuery(Filter.chartData,value);\n\t\tFilter.chartData=new1;//Reference for ChartData\n\t\tthis.observer.setState(new1);// all observers are notified about the update\n\t\tvar dropit=new1.listColumns();//used to get cloumns of the updated\n\t\tdocument.getElementById(\"sqlvalue\").value=\" \";\n\t}", "function setMaterial()\n\t{\n\t\tvar rows = auxJobGrid.getSelectionModel().getSelections();\n\t\t\t\n\t\tif (rows.length > 0) \n\t\t{\n\t\t\tvar value = material.getValue();\t\t\t\n\t\t\t\n\t\t\tvar index = material.store.find('name', value);\n\t\t\tvar record = material.store.getAt(index);\n\t\t\n\t\t\tif (record != undefined) \n\t\t\t{\n\t\t\t\trows[0].set('material_cost', record.get('cost'));\n\t\t\t\trows[0].set('material', value);\n\t\t\t\trows[0].set('days', record.get('days'));\n\t\t\t\t\n\t\t\t\tsetScheduledDate(rows[0]);\n\t\t\t}\n\t\t}\t\t\n\t}", "function scrollToObject() {\n\t\t\t$q.all([\n\t\t\t FindElement.byId(\"resultTableWrapper\"),\n\t\t\t FindElement.byQuery(\"#resultsTable .selectedRow\")\n\t\t\t ]).then(function(elements) {\n\t\t\t\t var table = angular.element(elements[0]);\n\t\t\t\t var selected = angular.element(elements[1]);\n\t\t\t\t var offset = 30;\n\t\t\t\t table.scrollToElement(selected, offset, 0);\n\t\t\t });\n\t\t\tsetFocus();\n\t\t}", "set selectedCollection(selectedCollection) {\n if (!(selectedCollection instanceof Collection)) {\n selectedCollection = new Collection(selectedCollection);\n }\n this._selectedCollection = selectedCollection;\n\n // Fire row change events from onSelectedCollectionChange\n selectedCollection.on({\n change: 'onSelectedCollectionChange',\n thisObj: this\n });\n }", "function updateTable() {\n if (!shown) {\n\n $(\"#messagetable\").flexigrid(\n {\n url: 'messages',\n title: 'Current Messages',\n height:500,\n width: 535,\n colModel : [\n {display: 'Sent By', name : 'name', width : 100, sortable : true, align: 'left'},\n {display: 'Message', name : 'message', width : 180, sortable : true, align: 'left'}\n ],\n searchitems : [\n {display: 'Sent By', name : 'name'},\n {display: 'Message', name : 'message', isdefault: true}\n ],\n buttons : [\n {name: 'Delete', bclass: 'delete', onpress : executeCommand},\n {separator: true}\n ],\n striped: true,\n usepager: true,\n useRp: true,\n rp: 15,\n onSubmit: refreshTable\n });\n $('#messagebox').show(\"slow\");\n } else {\n $('#messagetable').flexOptions().flexReload();\n }\n shown = true;\n }", "function GridChangeCell(strColumnKey, nRow) {\r\n\tvar GridObj = document.WiseGrid;\r\n\tif(strColumnKey != \"SELECTED\") {\r\n\t\t//??? ? SELECTED ?? ??? ??? ?? ???. \r\n\t\tGridObj.SetCellValue(\"SELECTED\", nRow, \"1\");\r\n\t}\r\n}", "deleteCurrentRecord(currentRow) {\n this.bShowDeleteModal = true;\n this.selectedRecord = currentRow.sId;\n this.selectedEnrollmentType = currentRow.sEnrollmentType;\n console.log('currentRow1---> ' + currentRow.sId);\n }", "select(id) { this._updateActiveId(id, false); }", "function cmdUpdateReceived_ClickCase6() {\n\n console.log(\"cmdUpdateReceived_ClickCase6\", $scope.PreviousRecQty);\n //$scope.ReceivedQty = $scope.PreviousRecQty;\n if ($scope.PreviousRecQty != \"\") {\n $(\"#wotracking-newReceived\").val($scope.PreviousRecQty);\n }\n\n $(\"#modalWOID\").val($scope.selectedWOIDData[\"woid\"]);\n $(\"#preprocess-woid\").val($scope.selectedWOIDData[\"woid\"]);\n $(\"#preprocess-scrapQty\").val(\"\");\n $scope.PreScrapQty = \"\";\n $scope.newReceived = \"\";\n\n\n\n $(\"#updateReceiveContent\").show();\n $(\"#saveCompleteContent\").hide();\n $('#updateReceiveModal').modal('toggle');\n // $('#updateReceiveModal').modal('show');\n\n\n }", "function selectRow(e) {\n\tvar index = e.index;\n\tvar team = e.rowData.team;\t\n\n\t//init teamdetail window\n\tvar detailsWin = Ti.UI.createWindow({\n\t\turl: 'teamdetails.js',\n\t\tteam: team,\n\t\ttitle: team.name\n\t});\n\t\t\n\tif (Titanium.Platform.name == 'android') {\n\t\tdetailsWin.open({modal: true});\n\t}\n\telse {\n\t\twin._navGroup.open(detailsWin);\n\t}\n}", "function selectedRowToInput() {\n console.info(\"selectedRowToInput\");\n for (var i = 3; i < table.rows.length - 1; i++) {\n console.log(\"table.rows[\" + i + \"]: \" + table.rows[i].classList.contains(\"processed\"));\n if (!table.rows[i].classList.contains(\"processed\")) {\n // console.log(\"table.rows[i]: \" + table.rows[i].classList.value);\n // continue;\n table.rows[i].onclick = function () {\n // get the seected row index\n rIndex = this.rowIndex;\n // console.log(\"table.rows[i].cells: \" + table.rows[i].cells[1]);\n if (typeof index !== \"undefined\") {\n table.rows[index].classList.toggle(\"selected\");\n }\n document.getElementById(\"account_activity_id\").value = this.cells[0].innerHTML;\n document.getElementById(\"activity_kind\").value = this.cells[1].innerHTML;\n document.getElementById(\"activity\").value = this.cells[2].innerHTML;\n document.getElementById(\"timer_start\").value = this.cells[3].innerHTML;\n document.getElementById(\"record\").value = this.cells[4].innerHTML;\n\n // console.log(typeof index);\n console.log(rIndex);\n // get the selected row index\n\n // get the selected row index\n index = this.rowIndex;\n // add class selected to the row\n this.classList.toggle(\"selected\");\n // console.log(typeof index);\n };\n }\n }\n}", "function tableChangehandler(args) {\n //check out all the values you can get, see below how we use it to display the selected cell value...\n // console.log(\"selection changed!\" + args.startRow + \" \" + args.startColumn + \" \" + args.rowCount + \" \" + args.columnCount);\n var row;\n if (args.startRow == undefined) {\n //menas the selection is in the header!\n row = 0;\n } else {\n //selection not in the header...\n row = args.startRow + 1;\n }\n // the other thing you can try here is to get the table, and print the selected cell value..\n Word.run(function(context) {\n //this instruction selected cell of the table within the content control named \"myTableTite\"\n var mySelectedCellBody = context.document.contentControls\n .getByTitle(\"Requirement_t_01\")\n .getFirst()\n .tables.getFirst()\n .getCell(row, args.startColumn).body;\n context.load(mySelectedCellBody);\n return context.sync().then(function() {\n //lets write the value of the cell (assumes single cell selected.)\n console.log(mySelectedCellBody.text);\n });\n }).catch(function(e) {\n console.log(\"handler:\" + e.message);\n });\n }", "function manualBind() {\r\n this._isBinding = true;\r\n var act = this._activityData || this._historyData;\r\n this.sss_lueSalesOrder.set('selectedObject', act.SalesOrderId ? { $key: act.SalesOrderId, $descriptor: act.SalesOrderName} : null);\r\n this._isBinding = false;\r\n }", "showSpecialMessageModal(currentRow) {\n this.sApplicationNo = currentRow.sApplicationName;\n //this.typeNumber = currentRow.sTypeNo;\n if(currentRow.sTypeNo === undefined || currentRow.sTypeNo === ''){\n this.typeNumber = '';\n }else{\n this.typeNumber = currentRow.sTypeNo; \n }\n this.bShowMessageModal = true;\n console.log('sApplicationNo from parent History', this.sApplicationNo);\n console.log('typeNumber from parent History', this.typeNumber);\n console.log('bShowMessageModal from parent History', this.bShowMessageModal);\n }", "function SelectRow() {\n\t\t\tif (dataGrid.SelectedIndex == -1) {\n\t\t\t\t// if no rows selected then leave and let the pop-up close\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// get Google Geocoding API XML result\n\t\t\tvar nodeList: XmlElement = dataGrid.Items[dataGrid.SelectedIndex]; if (nodeList == null) return;\n\t\t\t// get the values from the columns\n\t\t\tvar node: XmlElement;\n\t\t\t// Address Line 1\n\t\t\tnode = nodeList.SelectSingleNode(\"address_component[type='street_number']/short_name\"); if (node) AddressFields[\"AddressLine1\"].Text = node.InnerText;\n\t\t\tnode = nodeList.SelectSingleNode(\"address_component[type='route']/short_name\");\t if (node) AddressFields[\"AddressLine1\"].Text += \" \" + node.InnerText;\n\t\t\tnode = nodeList.SelectSingleNode(\"address_component[type='subpremise']/short_name\");\tif (node) AddressFields[\"AddressLine1\"].Text += \" #\" + node.InnerText;\n\t\t\t// Address Line 2\n\t\t\tAddressFields[\"AddressLine2\"].Text = \"\";\n\t\t\t// Address Line 3\n\t\t\tAddressFields[\"AddressLine3\"].Text = \"\";\n\t\t\t// Address Line 4\n\t\t\tAddressFields[\"AddressLine4\"].Text = \"\";\n\t\t\t// city\n\t\t\tnode = nodeList.SelectSingleNode(\"address_component[type='locality']/long_name\"); if (node) AddressFields[\"City\"].Text = node.InnerText;\n\t\t\t// state\n\t\t\tnode = nodeList.SelectSingleNode(\"address_component[type='administrative_area_level_1']/short_name\"); if (node) AddressFields[\"State\"].Text = node.InnerText;\n\t\t\t// postal code\n\t\t\tnode = nodeList.SelectSingleNode(\"address_component[type='postal_code']/short_name\"); if (node) AddressFields[\"PostalCode\"].Text = node.InnerText;\n\t\t\t// country\n\t\t\tnode = nodeList.SelectSingleNode(\"address_component[type='country']/short_name\"); if (node) AddressFields[\"Country\"].Text = node.InnerText;\n\t\t}", "_pressRow(id) {\n this.props.selectContact(id);\n }", "doOnClickJumpToCode(row) {\n let lineData = {lineNumber: this.rows[row.$index].range.start.row + 1};\n this.eventAggregator.publish(\"traceSearchGotoLine\", lineData);\n }", "handleRowAction(event){\n const selectedRows = event.detail.selectedRows;\n // selectedRows = event.detail.selectedRows;\n this.selectedFieldsValue = '';\n // Display that fieldName of the selected rows in a comma delimited way\n for ( i = 0; i < selectedRows.length; i++){\n if(this.selectedFieldsValue !=='' ){\n this.selectedFieldsValue = this.selectedFieldsValue + ','\n + selectedRows[i].ObjectAPIName;\n }\n else{\n this.selectedFieldsValue = selectedRows[i].ObjectAPIName;\n }\n }\n console.log( this.selectedFieldsValue);\n }", "function processOK(param) {\n var args = { data: gw_com_api.getRowData(\"grdList_Main\", \"selected\") };\n processClose(args);\n}", "function makeSelect(row) {\n var id=$(row).attr('id');\n $(\"#data tr\").attr('abc', 'no');\n $(row).attr('abc', 'yes');\n $(\"#data tr\").removeClass('selected');\n $(row).addClass('selected');\n}", "function onRowSelect(currentRow)\n\t\t{\n\t\t\t// updating value of textbox containing XPath\n\t\t\t$(\"#result\").val(currentRow.children().next().next().html());\n\t\t}", "set selectedCollection(selectedCollection) {\n if (!(selectedCollection instanceof Collection)) {\n selectedCollection = new Collection(selectedCollection);\n }\n\n this._selectedCollection = selectedCollection; // Fire row change events from onSelectedCollectionChange\n\n selectedCollection.on({\n change: 'onSelectedCollectionChange',\n thisObj: this\n });\n }", "function saveSelectedRows(rowId, selectState) {\n rowId = rowId === \"All\" ? $.map($('#searchResult').jqGrid('getCol', 'TestCaseId', false), function (r, i) { return ($(r)[0].innerHTML) }) : $($('#searchResult').jqGrid('getCol', 'TestCaseId', false)[rowId - 1])[0].innerHTML;\n if (fireSelect) {\n $.post(\"/TestCaseSearch/SetSelectState\", { IDs: $.isArray(rowId) ? rowId.join() : rowId, Select: selectState }, function (result) {\n if (!result)\n $(\"<div title='Row Selection'><p>Error on row selection</p>/div>\").dialog()\n });\n }\n}", "function getRowSelected(lnew, rowdata) {\n aSelected = {\n 'trseq': (lnew ? \"0\" : rowdata[0]),\n 'kodeorg': (lnew ? \"\" : rowdata[1]),\n 'namaorg': (lnew ? \"\" : rowdata[2]),\n // 'tglterima': (lnew ? \"\" : formatddmmyyyy(rowdata[3])),\n 'tglterima': (lnew ? \"\" : rowdata[3]),\n 'karyawanid': (lnew ? \"\" : rowdata[4]),\n 'nik': (lnew ? \"\" : rowdata[5]),\n 'namakaryawan': (lnew ? \"\" : rowdata[6]),\n 'kodeasset': (lnew ? \"\" : rowdata[7]),\n 'namaasset': (lnew ? \"\" : rowdata[8]),\n 'keteranganasset': (lnew ? \"\" : rowdata[9]),\n 'keterangan': (lnew ? \"\" : rowdata[10]),\n // 'tglberakhir': (lnew ? \"\" : formatddmmyyyy(rowdata[11]))\n 'tglberakhir': (lnew ? \"\" : rowdata[11])\n };\n}", "selectProduct(select) {\n //get products by name\n this.productService.getProductByName(select.option.value).subscribe(data => {\n let product = data.payload.doc.data();\n product[`doc_id`] = data.payload.doc.id;\n //open selected product in modal\n this.openDialog(product);\n this.clearSearch();\n });\n }", "serverKnowsAsFocusedCell() {\n\n }", "selectFriend (rowId) {\n\n }", "function fn_showmsg(msgid,id)\n{\n\t\n\t$(\"tr\").each(function() {\n\t\tif($(this).hasClass('selected')) {\n\t\t\t$(this).removeClass(\"selected\").removeClass(\"unselected\");\n\t\t\t$(this).addClass(\"unselected\");\t\t\t\t\n\t\t\t$('td').css(\"background-color\",\"\")\n\t\t}\n\t});\t\n\t\n\t$('#tr_'+msgid).removeClass(\"selected\").removeClass(\"unselected\");\n\t$('#tr_'+msgid).addClass(\"selected\");\n\t$('#tr_'+msgid+' td').css(\"background-color\",\"#F3FFD1\");\t\n\t\n\tsetTimeout('closeloadingalert()',1000);\n\tsetTimeout('removesections(\"#tools-message\");',500);\n\tsetTimeout('showpageswithpostmethod(\"tools-message-view\",\"tools/message/tools-message-view.php\",\"msgid='+msgid+'&id='+id+'\");',1000);\n}", "function onClickHandler(pkey, selected){\n\tvar objDetailsGrid = View.panels.get(\"abCbRptHlBlRmPrj_gridRep\");\n\t\n\tobjDetailsGrid.gridRows.each(function(gridRow){\n\t\tif (gridRow.getFieldValue('rm.bl_id') == pkey[0] && gridRow.getFieldValue('rm.fl_id') == pkey[1] && gridRow.getFieldValue('rm.rm_id') == pkey[2]) {\n\t\t\tif (selected) {\n\t\t\t\tgridRow.select();\n\t\t\t} else {\n\t\t\t\tgridRow.unselect();\n\t\t\t}\n\t\t\tvar suffix = selected ? \" selected\" : \"\";\n\t\t\tvar cn = gridRow.dom.className;\n\t\t\tvar j = 0;\n\t\t\tif ((j = cn.indexOf(\" selected\")) > 0)\n\t\t\t\tcn = cn.substr(0, j);\n\t\t\tgridRow.dom.className=cn + suffix;\n\t\t}\n\t});\n}", "function changeMessageNb(data) {\r\n //allMessageNb = data;\r\n}", "handleRowAction(event) {\n let actionName = event.detail.action.name;\n let selectedrow = event.detail.selectedrow;\n let row = event.detail.row;\n // eslint-disable-next-line default-case\n switch (actionName) {\n case 'View':\n this.viewCurrentRecord(row);\n break;\n\n case 'Delete':\n this.deleteCurrentRecord(row);\n break;\n\n case 'Msg':\n this.showSpecialMessageModal(row);\n break;\n }\n }" ]
[ "0.67660975", "0.6256739", "0.59547883", "0.58603173", "0.5809188", "0.5669057", "0.5610899", "0.5361881", "0.53603286", "0.533458", "0.5322815", "0.5279658", "0.52687013", "0.5266453", "0.52545375", "0.5249026", "0.51985466", "0.51287353", "0.5122258", "0.51195323", "0.5116255", "0.5107911", "0.510235", "0.50975543", "0.50739956", "0.50572014", "0.50211376", "0.50088036", "0.50012165", "0.49880263", "0.49782103", "0.49708483", "0.49475753", "0.49467868", "0.49457625", "0.4944979", "0.49435347", "0.4928013", "0.4903827", "0.48849535", "0.48798558", "0.48749357", "0.48731455", "0.48604465", "0.48416397", "0.48343706", "0.48315346", "0.4822983", "0.4816801", "0.48112792", "0.47921067", "0.47872236", "0.4781918", "0.47734886", "0.47597805", "0.4755379", "0.47546208", "0.47477388", "0.4746327", "0.4746327", "0.47391167", "0.47351986", "0.4719872", "0.4705934", "0.47045088", "0.47025928", "0.47025338", "0.46907514", "0.46787623", "0.46733433", "0.4671586", "0.46709582", "0.46651584", "0.46620685", "0.46616495", "0.46581516", "0.46579692", "0.46574196", "0.4657003", "0.46552747", "0.46552354", "0.4653723", "0.46478173", "0.46417442", "0.4641419", "0.46338746", "0.46310484", "0.46257883", "0.46239182", "0.46204287", "0.46186867", "0.46148655", "0.4607571", "0.46058077", "0.4603675", "0.46005943", "0.45882052", "0.45878515", "0.45841244", "0.45830515" ]
0.68048555
0
Adds functions needed for message browsing with details Adds a watch to deselect all rows after closing the slideout with message details TODO: export these functions too?
function decorate($scope) { $scope.selectRowIndex = function (idx) { $scope.rowIndex = idx; var selected = $scope.gridOptions.selectedItems; selected.splice(0, selected.length); if (idx >= 0 && idx < $scope.messages.length) { $scope.row = $scope.messages[idx]; if ($scope.row) { selected.push($scope.row); } } else { $scope.row = null; } }; $scope.$watch("showMessageDetails", function () { if (!$scope.showMessageDetails) { $scope.row = null; $scope.gridOptions.selectedItems.splice(0, $scope.gridOptions.selectedItems.length); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update_read_messages(messages)\n{\n Array.each(messages, function(message) {\n var id = message.get('text');\n var rowelem = $('msgrow-'+id);\n\n // Remove the new class from the ckeckbox and summary\n rowelem.getElementsByClassName('selctrl-opt')[0].removeClass('new');\n rowelem.getElementsByClassName('summary')[0].removeClass('new');\n\n // May as well untick the checkbox, too\n rowelem.getElementsByClassName('selctrl-opt')[0].set('checked', false);\n });\n selects.updateMode();\n controls.updateVis();\n}", "function update_remove_messages(messages)\n{\n Array.each(messages, function(message) {\n var id = message.get('text');\n var elem = $('msgrow-'+id);\n\n // dissolve doesn't really play nice with table rows, but\n // the effect is better than simply snapping them out.\n if(elem) elem.dissolve().get('reveal').chain(function() {\n elem.destroy();\n // Update the control buttons. This is a PITA as it means these\n // two calls happen for each removed message, but as each remove\n // is done separately, there's not a great deal can be done.\n selects.updateMode();\n controls.updateVis();\n });\n });\n}", "function fn_showmsg(msgid,id)\n{\n\t\n\t$(\"tr\").each(function() {\n\t\tif($(this).hasClass('selected')) {\n\t\t\t$(this).removeClass(\"selected\").removeClass(\"unselected\");\n\t\t\t$(this).addClass(\"unselected\");\t\t\t\t\n\t\t\t$('td').css(\"background-color\",\"\")\n\t\t}\n\t});\t\n\t\n\t$('#tr_'+msgid).removeClass(\"selected\").removeClass(\"unselected\");\n\t$('#tr_'+msgid).addClass(\"selected\");\n\t$('#tr_'+msgid+' td').css(\"background-color\",\"#F3FFD1\");\t\n\t\n\tsetTimeout('closeloadingalert()',1000);\n\tsetTimeout('removesections(\"#tools-message\");',500);\n\tsetTimeout('showpageswithpostmethod(\"tools-message-view\",\"tools/message/tools-message-view.php\",\"msgid='+msgid+'&id='+id+'\");',1000);\n}", "function messageAction() {\n\n // assign all present messages with an event listener\n for (var j = 0; j < msgArray.length; j++) {\n msgArray[j].addEventListener('click', function () {\n\n\n\n //onclick - assign the clicked element with a selected state.\n\n // if it has one already remove the attribute.\n if (this.hasAttribute(datasetState)) {\n this.removeAttribute(datasetState);\n } else {\n //when clicked remove all selected states\n for (var i = 0; i < msgArray.length; i++) {\n msgArray[i].removeAttribute(datasetState);\n }\n // and assign the clicked element with a selected state.\n this.setAttribute(datasetState, selected);\n }\n\n\n // insert the id value of current selected message to the msgId input field\n msgId.value = this.childNodes[1].textContent.slice(4);\n\n // if a message is currently selected - unhide edit and delete button\n if (this.hasAttribute('data-state')) {\n btnChange.setAttribute(datasetState, selected);\n btnDelete.setAttribute(datasetState, selected);\n } else { // if it isn't hide it\n btnChange.removeAttribute(datasetState);\n btnDelete.removeAttribute(datasetState);\n }\n\n });\n }\n }", "function displayDetailClose()\n{\n RMPApplication.debug(\"begin displayDetailClose\");\n c_debug(dbug.detail, \"=> displayDetailClose\");\n id_search_filters.setVisible(true);\n id_search_results.setVisible(true);\n id_ticket_details.setVisible(false);\n $(\"#id_number_detail\").val (\"\");\n $(\"#id_correlation_id_detail\").val (\"\");\n $(\"#id_caller_detail\").val (\"\");\n $(\"#id_contact_detail\").val (\"\"); \n $(\"#id_company_detail\").val (\"\");\n $(\"#id_country_detail\").val (\"\");\n $(\"#id_affiliate_detail\").val (\"\");\n $(\"#id_location_detail\").val (\"\");\n $(\"#id_city_detail\").val (\"\");\n $(\"#id_opened_detail\").val (\"\");\n $(\"#id_priority_detail\").val (\"\");\n $(\"#id_state_detail\").val (\"\");\n $(\"#id_closed_detail\").val (\"\");\n $(\"#id_category_detail\").val (\"\");\n $(\"#id_product_type_detail\").val (\"\");\n $(\"#id_problem_type_detail\").val (\"\");\n $(\"#id_short_description_detail\").val (\"\");\n $(\"#id_description_detail\").val (\"\");\n $(\"#id_attachment\").html (\"\");\n clearTaskDataTable();\n $(\"#id_rowProgression\").hide();\n RMPApplication.debug(\"end displayDetailClose\");\n}", "function backtoselection() {\n $('#search-invite-list').hide();\n $('#userset').removeClass('active');\n $('#user_list').hide();\n $('#search-list').hide();\n $('#following-list-create').hide();\n $('#followingnlistgroup').removeClass('active');\n $('#followerslistgroup').show().addClass('active');\n $('#search').show().removeClass('active');\n $('#skipinviteval').show().removeClass('active');\n $('#followers-list-create').css('display', 'block');\n $('#backone').show();\n $('#backtwo').show();\n $('#invite-group-members').show();\n $('#invite-selected-div').hide();\n $('#invite-message').hide();\n $('#invite-messageso').hide();\n $('#backbuttonso').hide();\n $('.processGroupBtnOk').show();\n $('.processGroupBtnCreate, .processGroupBtnSendInvite').hide();\n\n setTimeout(function() {\n $.dbeePopup('resize');\n }, 100);\n\n}", "function setMenuEvents($list, dp_table) {\n\n // Hide a row\n $list.on('click', 'a[href=hide]', function (e) {\n e.preventDefault();\n var selected = getSelectedRows(dp_table);\n selected.forEach(function (row) {\n row.$row.addClass(\"hiddenrow\");\n })\n if (selected.length > 0) {\n $(this).closest('.header').find('.alert').text('There are ' + selected.length + ' hidden rows!');\n }\n });\n\n // Unhide all hidden rows\n $list.on('click', 'a[href=unhide]', function (e) {\n e.preventDefault();\n dp_table.rows.forEach(function (row) {\n row.$row.removeClass(\"hiddenrow\");\n });\n $(this).closest('.header').find('.alert').empty();\n });\n\n // Delete a row.\n // Sends a request to delete flows and hides the rows until table is refreshed.\n // The drawback is that the entry will be hiddeneven if delete is not successful.\n $list.on('click', 'a[href=delete]', function (e) {\n e.preventDefault();\n var selected = getSelectedRows(dp_table);\n var flows = [];\n selected.forEach(function (row) {\n flows.push(row.dataitem)\n });\n if (flows.length > 0) {\n $.post(\"/flowdel\", JSON.stringify(flows))\n .done(function (response) {\n displayMessage(response);\n selected.forEach(function (row) {\n row.$row.addClass(\"hiddenrow\"); //temp\n })\n })\n .fail(function () {\n var msg = \"No response from controller.\";\n displayMessage(msg);\n })\n }\n });\n\n // Sends a request to monitor flows.\n $list.on('click', 'a[href=monitor]', function (e) {\n e.preventDefault();\n var selected = getSelectedRows(dp_table);\n var flows = [];\n selected.forEach(function (row) {\n flows.push(row.dataitem)\n });\n if (flows.length > 0) {\n $.post(\"/flowmonitor\", JSON.stringify(flows))\n .done(function (response) {\n displayMessage(response);\n selected.forEach(function (row) {\n row.$row.addClass(\"monitorrow\"); //temp\n })\n })\n .fail(function () {\n var msg = \"No response from controller.\";\n displayMessage(msg);\n })\n }\n });\n\n // Saves the row to session storage\n $list.on('click', 'a[href=edit]', function (e) {\n e.preventDefault();\n var selected = getSelectedRows(dp_table);\n if (selected.length > 0) {\n sessionStorage.setItem(category, JSON.stringify(selected[0].dataitem));\n var msg = \"Table entry copied to session storage.\";\n displayMessage(msg);\n }\n });\n\n $list.on('click', 'a', function (e) {\n e.preventDefault();\n var selected = getSelectedRows(dp_table);\n });\n }", "function eventsAction() {\n // Despliega la seccion de detalle de información del proyecto\n $('.projectInformation')\n .unbind('click')\n .on('click', function () {\n $('.invoice__section-finder').css({ top: '-100%' });\n $('.projectfinder').removeClass('open');\n\n let rotate = $(this).attr('class').indexOf('rotate180');\n if (rotate >= 0) {\n $('.invoice__section-details').css({\n top: '-100%',\n bottom: '100%',\n });\n $(this).removeClass('rotate180');\n } else {\n $('.invoice__section-details').css({\n top: '32px',\n bottom: '0px',\n });\n $(this).addClass('rotate180');\n }\n });\n\n // Despliega la sección de seleccion de proyecto y cliente\n $('.projectfinder')\n .unbind('click')\n .on('click', function () {\n $('.invoice__section-details').css({\n top: '-100%',\n bottom: '100%',\n });\n $('.projectInformation').removeClass('rotate180');\n\n let open = $(this).attr('class').indexOf('open');\n if (open >= 0) {\n $('.invoice__section-finder').css({ top: '-100%' });\n $(this).removeClass('open');\n } else {\n $('.invoice__section-finder').css({ top: '32px' });\n $(this).addClass('open');\n }\n });\n\n // Despliega y contrae las columnas de viaje y prueba\n $('.showColumns')\n .unbind('click')\n .on('click', function () {\n let rotate = $(this).attr('class').indexOf('rotate180');\n viewStatus = rotate >= 0 ? 'E' : 'C';\n expandCollapseSection();\n });\n\n // Despliega y contrae el menu de opciones de secciones\n $('.invoice_controlPanel .addSection')\n .unbind('click')\n .on('click', function () {\n $('.menu-sections').slideDown('slow');\n $('.menu-sections').on('mouseleave', function () {\n $(this).slideUp('slow');\n sectionShowHide();\n });\n });\n\n // muestra en la cotización la seccion seleccionada\n $('.menu-sections ul li')\n .unbind('click')\n .on('click', function () {\n let item = $(this).attr('data-option');\n glbSec = $(this).attr('data-option');\n $(this).hide();\n\n $(`#SC${item}`).show();\n });\n\n // Despliega y contrae el listado de projectos\n $('.invoice_controlPanel .toImport')\n .unbind('click')\n .on('click', function () {\n let pos = $(this).offset();\n $('.import-sections')\n .slideDown('slow')\n .css({ top: '30px', left: pos.left + 'px' })\n .on('mouseleave', function () {\n $(this).slideUp('slow');\n });\n\n fillProjectsAttached();\n });\n\n // Despliega la lista de productos para agregar a la cotización\n $('.invoice__box-table .invoice_button')\n .unbind('click')\n .on('click', function () {\n let item = $(this).parents('tbody').attr('id');\n glbSec = item.substring(3,2); // jjr\n showListProducts(item);\n });\n \n // Elimina la sección de la cotización\n $('.removeSection')\n .unbind('click')\n .on('click', function () {\n let id = $(this);\n let section = id.parents('tbody');\n section.hide().find('tr.budgetRow').remove();\n sectionShowHide();\n });\n\n // Guarda version actual\n $('.version__button .toSaveBudget')\n .unbind('click')\n .on('click', function () {\n let boton = $(this).html();\n let nRows = $(\n '.invoice__box-table table tbody tr.budgetRow'\n ).length;\n if (nRows > 0) {\n let pjtId = $('.version_current').attr('data-project');\n glbpjtid=pjtId;\n let verId = $('.version_current').attr('data-version');\n let discount = parseFloat($('#insuDesctoPrc').text()) / 100;\n\n if (verId != undefined){\n modalLoading('S');\n let par = `\n [{\n \"pjtId\" : \"${pjtId}\",\n \"verId\" : \"${verId}\",\n \"discount\" : \"${discount}\",\n \"action\" : \"${interfase}\"\n }]`;\n console.log('SaveBudget',par);\n var pagina = 'ProjectPlans/SaveBudget';\n var tipo = 'html';\n var selector = putsaveBudget;\n fillField(pagina, par, tipo, selector);\n } else{\n alert('No tienes una version creada, ' + \n 'debes crear en el modulo de cotizaciones');\n }\n }\n });\n\n // Guarda nueva version del presupuesto\n $('.version__button .toSaveBudgetAs')\n .unbind('click')\n .on('click', function () {\n let boton = $(this).html();\n let nRows = $(\n '.invoice__box-table table tbody tr.budgetRow'\n ).length;\n if (nRows > 0) {\n let pjtId = $('.version_current').attr('data-project');\n glbpjtid=pjtId;\n // let verCurr = $('.sidebar__versions .version__list ul li:first').attr('data-code');\n let verCurr = lastVersionFinder();\n let vr = parseInt(verCurr.substring(1, 10));\n\n let verNext = 'R' + refil(vr + 1, 4);\n let discount = parseFloat($('#insuDesctoPrc').text()) / 100;\n let lastmov = moment().format(\"YYYY-MM-DD HH:mm:ss\"); //agregado por jjr\n //console.log('FECHA- ', lastmov);\n if (vr != undefined){ //agregado por jjr\n modalLoading('S');\n let par = `\n [{\n \"pjtId\" : \"${pjtId}\",\n \"verCode\" : \"${verNext}\",\n \"discount\" : \"${discount}\",\n \"lastmov\" : \"${lastmov}\"\n }]`;\n\n var pagina = 'ProjectPlans/SaveBudgetAs';\n var tipo = 'html';\n var selector = putSaveBudgetAs;\n fillField(pagina, par, tipo, selector);\n } else{\n alert('No tienes una version creada, ' + \n 'debes crear en el modulo de cotizaciones');\n }\n }\n });\n\n // Edita los datos del proyecto\n $('#btnEditProject')\n .unbind('click')\n .on('click', function () {\n let pjtId = $('.projectInformation').attr('data-project');\n editProject(pjtId);\n });\n\n // Agrega nueva cotización\n $('.toSave')\n .unbind('click')\n .on('click', function () {\n let pjtId = $('.version_current').attr('data-project');\n let verId = $('.version_current').attr('data-version');\n promoteProject(pjtId, verId);\n });\n // Imprime la cotización en pantalla\n $('.toPrint')\n .unbind('click')\n .on('click', function () {\n let verId = $('.version_current').attr('data-version');\n printBudget(verId);\n });\n\n // Busca los elementos que coincidan con lo escrito el input de cliente y poyecto\n $('.inputSearch')\n .unbind('keyup')\n .on('keyup', function () {\n let id = $(this);\n let obj = id.parents('.finder__box').attr('id');\n let txt = id.val().toUpperCase();\n sel_items(txt, obj);\n });\n\n $('.cleanInput')\n .unbind('click')\n .on('click', function () {\n let id = $(this).parents('.finder__box').children('.invoiceInput');\n id.val('');\n id.trigger('keyup');\n });\n\n // Limpiar la pantalla\n $('#newQuote')\n .unbind('click')\n .on('click', function () {\n window.location = 'ProjectDetails';\n });\n\n // Abre el modal de comentarios\n $('.sidebar__comments .toComment')\n .unbind('click')\n .on('click', function () {\n showModalComments();\n });\n\n expandCollapseSection();\n}", "function OdysseyToolRowHideEvent() {}", "function generic_element_select() {\n $('.message_bot_area .footer_message_input .carousel_slide').show();\n $('.message_bot_area .footer_message_input .carousel_indicator_item').hide();\n}", "function leadsDismiss() {\n // console.log(\"LEADS DISMISSED FUNCTION LOADED\");\n $('.leads-item').each(function () {\n var $this = $(this);\n var offset = $this.offset().top;\n var scrollTop = $(window).scrollTop();\n var elementID = $(this)[0].id\n var elementType = \"relevant\"\n // console.log('Scrolltop' + scrollTop);\n // console.log('offset' + offset);\n if (scrollTop > offset && !$(this).hasClass('checked')) {\n // Shiny.setInputValue(\"b221-checkLeads\", elementID, {priority: \"event\"});\n $(this).addClass('checked');\n // console.log(\"LEAD CHECKED\");\n if (!$(this).hasClass('dismiss') ) {\n // Shiny.setInputValue(\"b221-checkLeadsClick\", [elementType, elementID], {priority: \"event\"});\n // console.log(\"LEAD CHECKED\");\n collectData(`#${elementID}`, 'reactivate');\n }\n }\n });\n}", "function addEventsCompCUHybrid(){\n\tdocument.getElementById('summary-li').addEventListener('click',function()\n\t{\n\t\tdocument.getElementById('summary').style.display=\"\";\n\t\tdocument.getElementById('basiccontrol').style.display=\"none\";\n\t\tdocument.getElementById('cprating').style.display=\"none\";\n\t\tdocument.getElementById('auditreadyasmt').style.display=\"none\";\n\t\tdocument.getElementById('riskmsdcommit').style.display=\"none\";\n\t\tdocument.getElementById('auditreview').style.display=\"none\";\n\t\tdocument.getElementById('kctest').style.display=\"none\";\n\t\tdocument.getElementById('opmetric').style.display=\"none\";\n\t\tdocument.getElementById('other').style.display=\"none\";\n\n\t\tdocument.getElementById('summary-li').className=\"ibm-active\";\n\t\tdocument.getElementById('basiccontrol-li').className=\"\";\n\t\tdocument.getElementById('cprating-li').className=\"\";\n\t\tdocument.getElementById('auditreadyasmt-li').className=\"\";\n\t\tdocument.getElementById('riskmsdcommit-li').className=\"\";\n\t\tdocument.getElementById('auditreview-li').className=\"\";\n\t\tdocument.getElementById('kctest-li').className=\"\";\n\t\tdocument.getElementById('opmetric-li').className=\"\";\n\t\tdocument.getElementById('other-li').className=\"\";\n\t},true);\n\tdocument.getElementById('basiccontrol-li').addEventListener('click',function()\n\t{\n\t\tdocument.getElementById('summary').style.display=\"none\";\n\t\tdocument.getElementById('basiccontrol').style.display=\"\";\n\t\tdocument.getElementById('cprating').style.display=\"none\";\n\t\tdocument.getElementById('auditreadyasmt').style.display=\"none\";\n\t\tdocument.getElementById('riskmsdcommit').style.display=\"none\";\n\t\tdocument.getElementById('auditreview').style.display=\"none\";\n\t\tdocument.getElementById('kctest').style.display=\"none\";\n\t\tdocument.getElementById('opmetric').style.display=\"none\";\n\t\tdocument.getElementById('other').style.display=\"none\";\n\n\t\tdocument.getElementById('summary-li').className=\"\";\n\t\tdocument.getElementById('basiccontrol-li').className=\"ibm-active\";\n\t\tdocument.getElementById('cprating-li').className=\"\";\n\t\tdocument.getElementById('auditreadyasmt-li').className=\"\";\n\t\tdocument.getElementById('riskmsdcommit-li').className=\"\";\n\t\tdocument.getElementById('auditreview-li').className=\"\";\n\t\tdocument.getElementById('kctest-li').className=\"\";\n\t\tdocument.getElementById('opmetric-li').className=\"\";\n\t\tdocument.getElementById('other-li').className=\"\";\n\t},true);\n\tdocument.getElementById('cprating-li').addEventListener('click',function()\n\t{\n\t\tdocument.getElementById('summary').style.display=\"none\";\n\t\tdocument.getElementById('basiccontrol').style.display=\"none\";\n\t\tdocument.getElementById('cprating').style.display=\"\";\n\t\tdocument.getElementById('auditreadyasmt').style.display=\"none\";\n\t\tdocument.getElementById('riskmsdcommit').style.display=\"none\";\n\t\tdocument.getElementById('auditreview').style.display=\"none\";\n\t\tdocument.getElementById('kctest').style.display=\"none\";\n\t\tdocument.getElementById('opmetric').style.display=\"none\";\n\t\tdocument.getElementById('other').style.display=\"none\";\n\n\t\tdocument.getElementById('summary-li').className=\"\";\n\t\tdocument.getElementById('basiccontrol-li').className=\"\";\n\t\tdocument.getElementById('cprating-li').className=\"ibm-active\";\n\t\tdocument.getElementById('auditreadyasmt-li').className=\"\";\n\t\tdocument.getElementById('riskmsdcommit-li').className=\"\";\n\t\tdocument.getElementById('auditreview-li').className=\"\";\n\t\tdocument.getElementById('kctest-li').className=\"\";\n\t\tdocument.getElementById('opmetric-li').className=\"\";\n\t\tdocument.getElementById('other-li').className=\"\";\n\t},true);\n\tdocument.getElementById('auditreadyasmt-li').addEventListener('click',function()\n\t{\n\t\tdocument.getElementById('summary').style.display=\"none\";\n\t\tdocument.getElementById('basiccontrol').style.display=\"none\";\n\t\tdocument.getElementById('cprating').style.display=\"none\";\n\t\tdocument.getElementById('auditreadyasmt').style.display=\"\";\n\t\tdocument.getElementById('riskmsdcommit').style.display=\"none\";\n\t\tdocument.getElementById('auditreview').style.display=\"none\";\n\t\tdocument.getElementById('kctest').style.display=\"none\";\n\t\tdocument.getElementById('opmetric').style.display=\"none\";\n\t\tdocument.getElementById('other').style.display=\"none\";\n\n\t\tdocument.getElementById('summary-li').className=\"\";\n\t\tdocument.getElementById('basiccontrol-li').className=\"\";\n\t\tdocument.getElementById('cprating-li').className=\"\";\n\t\tdocument.getElementById('auditreadyasmt-li').className=\"ibm-active\";\n\t\tdocument.getElementById('riskmsdcommit-li').className=\"\";\n\t\tdocument.getElementById('auditreview-li').className=\"\";\n\t\tdocument.getElementById('kctest-li').className=\"\";\n\t\tdocument.getElementById('opmetric-li').className=\"\";\n\t\tdocument.getElementById('other-li').className=\"\";\n\t},true);\n\tdocument.getElementById('riskmsdcommit-li').addEventListener('click',function()\n\t{\n\t\tdocument.getElementById('summary').style.display=\"none\";\n\t\tdocument.getElementById('basiccontrol').style.display=\"none\";\n\t\tdocument.getElementById('cprating').style.display=\"none\";\n\t\tdocument.getElementById('auditreadyasmt').style.display=\"none\";\n\t\tdocument.getElementById('riskmsdcommit').style.display=\"\";\n\t\tdocument.getElementById('auditreview').style.display=\"none\";\n\t\tdocument.getElementById('kctest').style.display=\"none\";\n\t\tdocument.getElementById('opmetric').style.display=\"none\";\n\t\tdocument.getElementById('other').style.display=\"none\";\n\n\t\tdocument.getElementById('summary-li').className=\"\";\n\t\tdocument.getElementById('basiccontrol-li').className=\"\";\n\t\tdocument.getElementById('cprating-li').className=\"\";\n\t\tdocument.getElementById('auditreadyasmt-li').className=\"\";\n\t\tdocument.getElementById('riskmsdcommit-li').className=\"ibm-active\";\n\t\tdocument.getElementById('auditreview-li').className=\"\";\n\t\tdocument.getElementById('kctest-li').className=\"\";\n\t\tdocument.getElementById('opmetric-li').className=\"\";\n\t\tdocument.getElementById('other-li').className=\"\";\n\t\t/*$(\".table_with_scroll tbody\").each(function() {\n\t\t\tif($(this).height() > 0){\n\t\t\t\t$(this).css(\"height\", $(this).height()+\"px\");\n\t\t\t}\n\t\t});*/\n\t},true);\n\tdocument.getElementById('auditreview-li').addEventListener('click',function()\n\t{\n\t\tdocument.getElementById('summary').style.display=\"none\";\n\t\tdocument.getElementById('basiccontrol').style.display=\"none\";\n\t\tdocument.getElementById('cprating').style.display=\"none\";\n\t\tdocument.getElementById('auditreadyasmt').style.display=\"none\";\n\t\tdocument.getElementById('riskmsdcommit').style.display=\"none\";\n\t\tdocument.getElementById('auditreview').style.display=\"\";\n\t\tdocument.getElementById('kctest').style.display=\"none\";\n\t\tdocument.getElementById('opmetric').style.display=\"none\";\n\t\tdocument.getElementById('other').style.display=\"none\";\n\n\t\tdocument.getElementById('summary-li').className=\"\";\n\t\tdocument.getElementById('basiccontrol-li').className=\"\";\n\t\tdocument.getElementById('cprating-li').className=\"\";\n\t\tdocument.getElementById('auditreadyasmt-li').className=\"\";\n\t\tdocument.getElementById('riskmsdcommit-li').className=\"\";\n\t\tdocument.getElementById('auditreview-li').className=\"ibm-active\";\n\t\tdocument.getElementById('kctest-li').className=\"\";\n\t\tdocument.getElementById('opmetric-li').className=\"\";\n\t\tdocument.getElementById('other-li').className=\"\";\n\t},true);\n\tdocument.getElementById('kctest-li').addEventListener('click',function()\n\t{\n\t\tdocument.getElementById('summary').style.display=\"none\";\n\t\tdocument.getElementById('basiccontrol').style.display=\"none\";\n\t\tdocument.getElementById('cprating').style.display=\"none\";\n\t\tdocument.getElementById('auditreadyasmt').style.display=\"none\";\n\t\tdocument.getElementById('riskmsdcommit').style.display=\"none\";\n\t\tdocument.getElementById('auditreview').style.display=\"none\";\n\t\tdocument.getElementById('kctest').style.display=\"\";\n\t\tdocument.getElementById('opmetric').style.display=\"none\";\n\t\tdocument.getElementById('other').style.display=\"none\";\n\n\t\tdocument.getElementById('summary-li').className=\"\";\n\t\tdocument.getElementById('basiccontrol-li').className=\"\";\n\t\tdocument.getElementById('cprating-li').className=\"\";\n\t\tdocument.getElementById('auditreadyasmt-li').className=\"\";\n\t\tdocument.getElementById('riskmsdcommit-li').className=\"\";\n\t\tdocument.getElementById('auditreview-li').className=\"\";\n\t\tdocument.getElementById('kctest-li').className=\"ibm-active\";\n\t\tdocument.getElementById('opmetric-li').className=\"\";\n\t\tdocument.getElementById('other-li').className=\"\";\n\t},true);\n\tdocument.getElementById('opmetric-li').addEventListener('click',function()\n\t{\n\t\tdocument.getElementById('summary').style.display=\"none\";\n\t\tdocument.getElementById('basiccontrol').style.display=\"none\";\n\t\tdocument.getElementById('cprating').style.display=\"none\";\n\t\tdocument.getElementById('auditreadyasmt').style.display=\"none\";\n\t\tdocument.getElementById('riskmsdcommit').style.display=\"none\";\n\t\tdocument.getElementById('auditreview').style.display=\"none\";\n\t\tdocument.getElementById('kctest').style.display=\"none\";\n\t\tdocument.getElementById('opmetric').style.display=\"\";\n\t\tdocument.getElementById('other').style.display=\"none\";\n\n\t\tdocument.getElementById('summary-li').className=\"\";\n\t\tdocument.getElementById('basiccontrol-li').className=\"\";\n\t\tdocument.getElementById('cprating-li').className=\"\";\n\t\tdocument.getElementById('auditreadyasmt-li').className=\"\";\n\t\tdocument.getElementById('riskmsdcommit-li').className=\"\";\n\t\tdocument.getElementById('auditreview-li').className=\"\";\n\t\tdocument.getElementById('kctest-li').className=\"\";\n\t\tdocument.getElementById('opmetric-li').className=\"ibm-active\";\n\t\tdocument.getElementById('other-li').className=\"\";\n\t},true);\n\tdocument.getElementById('other-li').addEventListener('click',function()\n\t{\n\t\tdocument.getElementById('summary').style.display=\"none\";\n\t\tdocument.getElementById('basiccontrol').style.display=\"none\";\n\t\tdocument.getElementById('cprating').style.display=\"none\";\n\t\tdocument.getElementById('auditreadyasmt').style.display=\"none\";\n\t\tdocument.getElementById('riskmsdcommit').style.display=\"none\";\n\t\tdocument.getElementById('auditreview').style.display=\"none\";\n\t\tdocument.getElementById('kctest').style.display=\"none\";\n\t\tdocument.getElementById('opmetric').style.display=\"none\";\n\t\tdocument.getElementById('other').style.display=\"\";\n\n\t\tdocument.getElementById('summary-li').className=\"\";\n\t\tdocument.getElementById('basiccontrol-li').className=\"\";\n\t\tdocument.getElementById('cprating-li').className=\"\";\n\t\tdocument.getElementById('auditreadyasmt-li').className=\"\";\n\t\tdocument.getElementById('riskmsdcommit-li').className=\"\";\n\t\tdocument.getElementById('auditreview-li').className=\"\";\n\t\tdocument.getElementById('kctest-li').className=\"\";\n\t\tdocument.getElementById('opmetric-li').className=\"\";\n\t\tdocument.getElementById('other-li').className=\"ibm-active\";\n\t},true);\n}", "function msgHandler(msg_object) {\r\n $(\".reading\").show();\r\n readingMessage = msg_object;\r\n var title = msg_object.get(\"title\");\r\n var text = msg_object.get(\"text\");\r\n var type = msg_object.get(\"type\");\r\n var time = msg_object.getTime()\r\n var day = msg_object.getDay();\r\n var author = msg_object.get(\"author\");\r\n var priority = msg_object.get(\"priority\");\r\n var alert = msg_object.get(\"alert\");\r\n var replies = msg_object.get(\"replies\");\r\n var tags = msg_object.get(\"tags\");\r\n\r\n // Display original message\r\n if(type== undefined) {type = NOTE;}\r\n\r\n $('#messageTitle').html(type + \": \" + title);\r\n $('#messageAuthor').html(author);\r\n $('div.authorImg img').attr('src', USER_IMAGES[author]);\r\n $('#messageTime').html(time + ' on ' + day);\r\n $('#messageText').html(text);\r\n\r\n $('#captainIcon').removeClass('hidden');\r\n $('#priorityIcon').removeClass('hidden');\r\n\r\n // Display/hide appropriate icons\r\n if(alert == NO_ALERT) {\r\n $('#captainIcon').addClass('hidden');\r\n }\r\n if(priority == LOW_PRI) {\r\n $('#priorityIcon').addClass('hidden');\r\n }\r\n\r\n // Display tags\r\n $('#messageTags').empty();\r\n for (var j=0; j<tags.length; j++) {\r\n var tag = tags[j];\r\n if (tag.trim() != \"\") {\r\n var tagDiv = $(document.createElement('button'))\r\n .addClass('btn-info')\r\n .addClass('btn-mini')\r\n .addClass('tag')\r\n .html(\"#\"+tag);\r\n $('#messageTags').append(tagDiv);\r\n }\r\n }\r\n\r\n $(\".tag\").click(function() {\r\n var tagText = $(this).html();\r\n tagText = tagText.substring(1, tagText.length);\r\n $('#search-tbox').val(tagText);\r\n $(\"#search-button\").click();\r\n updateSearchedBrowsePane('message-table', getMessageIDs(tagText));\r\n });\r\n\r\n\r\n // Add Tooltips for ReadPane\r\n addReadPaneTooltips();\r\n\r\n // Display replies \r\n getRepliesForMessage(msg_object,replyHandler);\r\n\r\n}", "function displayOnMultipleSelection() {\n\t\tvar $detailsPane = $( '.details.pane' );\n\n\t\t$detailsPane.empty().append(\n\t\t\t$( '<div>' )\n\t\t\t\t.addClass( 'actions row' )\n\t\t\t\t.append(\n\t\t\t\t\t$( '<button>' )\n\t\t\t\t\t\t.addClass( 'accept primary green button' )\n\t\t\t\t\t\t.text( mw.msg( 'tsb-accept-all-button-label' ) ),\n\t\t\t\t\t\t// FIXME add api action\n\t\t\t\t\t$( '<button>' )\n\t\t\t\t\t\t.addClass( 'delete destructive button' )\n\t\t\t\t\t\t.text( mw.msg( 'tsb-reject-all-button-label' ) )\n\t\t\t\t\t\t// FIXME add api action\n\t\t\t\t)\n\t\t);\n\t}", "function setupWhatIfDataListener() {\n $(getWindow('frSelection')).on(\"unload\", fetchWhatIfData)\n }", "closeItemDetails(item){if(this._isDetailsOpened(item)){this.splice(\"detailsOpenedItems\",this._getItemIndexInArray(item,this.detailsOpenedItems),1)}}", "handleMessage(e) {\n console.log(e.data);\n if (e.data === 'hide') {\n console.log('iframe hide');\n this.toggleIframeElementClasses('evernote_qsUIComponentVisible', 'evernote_qsUIComponentHidden');\n } else if (e.data === 'activate') {\n this.toggleIframeElementClasses('evernote_qsUIComponentHidden', 'evernote_qsUIComponentVisible');\n }\n }", "function qruqsp_sams_main() {\n //\n // The panel to list the message\n //\n this.menu = new M.panel('message', 'qruqsp_sams_main', 'menu', 'mc', 'medium', 'sectioned', 'qruqsp.sams.main.menu');\n this.menu.data = {};\n this.menu.nplist = [];\n this.menu.sections = {\n 'search':{'label':'', 'type':'livesearchgrid', 'livesearchcols':1,\n 'cellClasses':[''],\n 'hint':'Search message',\n 'noData':'No message found',\n },\n 'messages':{'label':'Recent Messages', 'type':'simplegrid', 'num_cols':1,\n 'cellClasses':['multiline'],\n 'noData':'No message',\n 'addTxt':'Send Message',\n 'addFn':'M.qruqsp_sams_main.message.open(\\'M.qruqsp_sams_main.menu.open();\\',0,null);'\n },\n }\n this.menu.liveSearchCb = function(s, i, v) {\n if( s == 'search' && v != '' ) {\n M.api.getJSONBgCb('qruqsp.sams.messageSearch', {'tnid':M.curTenantID, 'start_needle':v, 'limit':'25'}, function(rsp) {\n M.qruqsp_sams_main.menu.liveSearchShow('search',null,M.gE(M.qruqsp_sams_main.menu.panelUID + '_' + s), rsp.messages);\n });\n }\n }\n this.menu.liveSearchResultValue = function(s, f, i, j, d) {\n return d.name;\n }\n// this.menu.liveSearchResultRowFn = function(s, f, i, j, d) {\n// return 'M.qruqsp_sams_main.message.open(\\'M.qruqsp_sams_main.menu.open();\\',\\'' + d.id + '\\');';\n// }\n this.menu.cellValue = function(s, i, j, d) {\n if( s == 'messages' ) {\n switch(j) {\n case 0: return '<span class=\"maintext\">' + d.from_callsign + '->' + d.to_callsign + '</span>'\n + '<span class=\"subtext\">' + d.content + '</span>';\n }\n }\n }\n this.menu.rowFn = function(s, i, d) {\n if( s == 'messages' ) {\n return 'M.qruqsp_sams_main.message.open(\\'M.qruqsp_sams_main.menu.open();\\',\\'' + d.id + '\\',M.qruqsp_sams_main.message.nplist);';\n }\n }\n this.menu.refresh = function() {\n M.api.getJSONCb('qruqsp.sams.messageList', {'tnid':M.curTenantID}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.qruqsp_sams_main.menu;\n p.data.messages = rsp.messages;\n p.refreshSection('messages');\n });\n }\n this.menu.open = function(cb) {\n M.api.getJSONCb('qruqsp.sams.messageList', {'tnid':M.curTenantID}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.qruqsp_sams_main.menu;\n p.data = rsp;\n p.nplist = (rsp.nplist != null ? rsp.nplist : null);\n p.refresh();\n p.show(cb);\n });\n }\n this.menu.addButton('refresh', 'Refresh', 'M.qruqsp_sams_main.menu.refresh();');\n this.menu.addClose('Back');\n\n //\n // The panel to edit Message\n //\n this.message = new M.panel('Message', 'qruqsp_sams_main', 'message', 'mc', 'medium', 'sectioned', 'qruqsp.sams.main.message');\n this.message.data = null;\n this.message.message_id = 0;\n this.message.nplist = [];\n this.message.sections = {\n 'general':{'label':'', 'fields':{\n 'from_callsign':{'label':'From', 'type':'text'},\n 'to_callsign':{'label':'To', 'type':'text'},\n 'content':{'label':'Message Content', 'type':'text'},\n 'hops':{'label':'Hops', 'type':'toggle', 'default':'2', 'toggles':{'1':'1', '2':'2', '3':'3', '4':'4', '5':'5', '6':'6', '7':'7'}},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Send Now', 'fn':'M.qruqsp_sams_main.message.save();'},\n 'delete':{'label':'Delete', \n 'visible':function() {return M.qruqsp_sams_main.message.message_id > 0 ? 'yes' : 'no'; },\n 'fn':'M.qruqsp_sams_main.message.remove();'},\n }},\n };\n this.message.fieldValue = function(s, i, d) { return this.data[i]; }\n this.message.fieldHistoryArgs = function(s, i) {\n return {'method':'qruqsp.sams.messageHistory', 'args':{'tnid':M.curTenantID, 'message_id':this.message_id, 'field':i}};\n }\n this.message.open = function(cb, mid, list) {\n if( mid != null ) { this.message_id = mid; }\n if( list != null ) { this.nplist = list; }\n M.api.getJSONCb('qruqsp.sams.messageGet', {'tnid':M.curTenantID, 'message_id':this.message_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.qruqsp_sams_main.message;\n p.data = rsp.message;\n p.refresh();\n p.show(cb);\n });\n }\n this.message.save = function(cb) {\n if( cb == null ) { cb = 'M.qruqsp_sams_main.message.close();'; }\n if( !this.checkForm() ) { return false; }\n if( this.message_id > 0 ) {\n var c = this.serializeForm('no');\n if( c != '' ) {\n M.api.postJSONCb('qruqsp.sams.messageUpdate', {'tnid':M.curTenantID, 'message_id':this.message_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n eval(cb);\n });\n } else {\n eval(cb);\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('qruqsp.sams.messageAdd', {'tnid':M.curTenantID}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.qruqsp_sams_main.message.message_id = rsp.id;\n eval(cb);\n });\n }\n }\n this.message.remove = function() {\n M.confirm('Are you sure you want to remove message?',null,function() {\n M.api.getJSONCb('qruqsp.sams.messageDelete', {'tnid':M.curTenantID, 'message_id':M.qruqsp_sams_main.message.message_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.qruqsp_sams_main.message.close();\n });\n });\n }\n this.message.nextButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.message_id) < (this.nplist.length - 1) ) {\n return 'M.qruqsp_sams_main.message.save(\\'M.qruqsp_sams_main.message.open(null,' + this.nplist[this.nplist.indexOf('' + this.message_id) + 1] + ');\\');';\n }\n return null;\n }\n this.message.prevButtonFn = function() {\n if( this.nplist != null && this.nplist.indexOf('' + this.message_id) > 0 ) {\n return 'M.qruqsp_sams_main.message.save(\\'M.qruqsp_sams_main.message.open(null,' + this.nplist[this.nplist.indexOf('' + this.message_id) - 1] + ');\\');';\n }\n return null;\n }\n this.message.addButton('save', 'Save', 'M.qruqsp_sams_main.message.save();');\n this.message.addClose('Cancel');\n this.message.addButton('next', 'Next');\n this.message.addLeftButton('prev', 'Prev');\n\n //\n // Start the app\n // cb - The callback to run when the user leaves the main panel in the app.\n // ap - The application prefix.\n // ag - The app arguments.\n //\n this.start = function(cb, ap, ag) {\n args = {};\n if( ag != null ) {\n args = eval(ag);\n }\n \n //\n // Create the app container\n //\n var ac = M.createContainer(ap, 'qruqsp_sams_main', 'yes');\n if( ac == null ) {\n M.alert('App Error');\n return false;\n }\n \n this.menu.open(cb);\n }\n}", "_updateActiveMessagePane() {\n // If we're summarizing, might as well clear the message display so that\n // when we return to it, we don't display prev selected message. If we're\n // *not* summarizing, clear the summary display so that the summary can\n // clean itself up.\n if (!this.singleMessageDisplay) {\n this.clearDisplay();\n } else {\n gSummaryFrameManager.clear();\n }\n\n // _singleMessageDisplay can be null, so use the property (getter)\n document.getElementById(\"singleMessage\").hidden = !this\n .singleMessageDisplay;\n document.getElementById(\"multimessage\").hidden = this.singleMessageDisplay;\n\n let messagePaneName = this.singleMessageDisplay\n ? \"messagepane\"\n : \"multimessage\";\n\n let findToolbar = document.getElementById(\"FindToolbar\");\n findToolbar.browser = document.getElementById(messagePaneName);\n\n // If the message pane is currently focused, make sure we have the\n // currently-visible content window (single- or multi-message) focused.\n if (\n this.folderDisplay.focusedPane ==\n document.getElementById(\"messagepanebox\")\n ) {\n document.getElementById(messagePaneName).focus();\n }\n }", "function eventsMoreDescription() {\n $('.show-more' + self.pref).unbind('click');\n $('.show-more' + self.pref).click(function () {\n var domainID = $(this).attr('data-id');\n $(this).closest(\"td\").html(self.accessionToLongDescription[domainID]);\n eventsLessDescription();\n });\n }", "function popupEvent(id)\n{\n switch(id) {\n\t case \"reset\":\n\t reset()\n\t break;\n\t case \"stop\":\n\t stopIt();\n\t break;\n\t case \"start\":\n\t startIt();\n\t break;\t \n case \"export\":\n\t exportTrails();\n\t break;\n\t case \"summary\":\n\t break;\t \n }\n}", "function closeAppear() {\n if ( wgPageName == \"Emperor Jarjarkine_Wiki:Votes_for_deletion\" && $(\".discussions\").length > 0 && wgAction != \"edit\" ) {\n var sAll = 0;\n var modeAll = 2;\n $(\".discussions.cls-discuss\").hide();\n $(\".show-a\").html('<a href=\"javascript:void(0)\">[show]</a>');\n $(\".hide-a\").html('<a href=\"javascript:void(0)\">[hide]</a>');\n $(\".s-all\").html('<a href=\"javascript:void(0)\">show/hide</a>');\n $(\".mode-all\").html('(<a href=\"javascript:void(0)\">all</a>)');\n $(\".show-a, .hide-a\").click(function() {\n var IDa = $(this).attr(\"id\");\n var ClassA = $(this).attr(\"class\").slice(0,6);\n var ClassB = $(this).attr(\"class\").slice(6);\n var dID = \"d-\" + IDa.slice(-IDa.length + 2);\n if ( IDa.indexOf(\".\") != -1 || IDa.indexOf(\":\") != -1) {\n IDa = IDa.replace(/\\./g,\"\").replace(/:/g,\"\");\n $(this).attr(\"id\",IDa);\n dID = dID.replace(/\\./g,\"\\\\.\").replace(/:/g,\"\\\\:\");\n $(\"#\" + dID).attr(\"id\",\"d-\" + IDa.slice(-IDa.length + 2));\n dID = \"d-\" + IDa.slice(-IDa.length + 2);\n }\n if ( ClassA == \"show-a\" ) {\n $(\"#\" + IDa).html('<a href=\"javascript:void(0)\">[hide]</a>');\n $(\"#\" + IDa).attr(\"class\",\"hide-a\" + ClassB);\n $(\"#\" + dID).show();\n }\n if ( ClassA == \"hide-a\" ) {\n $(\"#\" + IDa).html('<a href=\"javascript:void(0)\">[show]</a>');\n $(\"#\" + IDa).attr(\"class\",\"show-a\" + ClassB);\n $(\"#\" + dID).hide();\n }\n });\n $(\".s-all\").click(function() {\n if ( modeAll == 0 ) { \n if ( sAll == 0 ) {\n $(\".show-a.open-d\").html('<a href=\"javascript:void(0)\">[hide]</a>');\n $(\".show-a.open-d\").attr(\"class\",\"hide-a open-d\");\n $(\".discussions.o-discuss\").show();\n sAll = 1;\n }\n else if ( sAll == 1 ) {\n $(\".hide-a.open-d\").html('<a href=\"javascript:void(0)\">[show]</a>');\n $(\".hide-a.open-d\").attr(\"class\",\"show-a open-d\");\n $(\".discussions.o-discuss\").hide();\n sAll = 0;\n }\n }\n if ( modeAll == 1 ) { \n if ( sAll == 0 ) {\n $(\".show-a.closed-d\").html('<a href=\"javascript:void(0)\">[hide]</a>');\n $(\".show-a.closed-d\").attr(\"class\",\"hide-a closed-d\");\n $(\".discussions.cls-discuss\").show();\n sAll = 1;\n }\n else if ( sAll == 1 ) {\n $(\".hide-a.closed-d\").html('<a href=\"javascript:void(0)\">[show]</a>');\n $(\".hide-a.closed-d\").attr(\"class\",\"show-a closed-d\");\n $(\".discussions.cls-discuss\").hide();\n sAll = 0;\n }\n }\n if ( modeAll == 2 ) { \n if ( sAll == 0 ) {\n $(\".show-a\").html('<a href=\"javascript:void(0)\">[hide]</a>');\n $(\".show-a.open-d\").attr(\"class\",\"hide-a open-d\");\n $(\".show-a.closed-d\").attr(\"class\",\"hide-a closed-d\");\n $(\".discussions\").show();\n sAll = 1;\n }\n else if ( sAll == 1 ) {\n $(\".hide-a\").html('<a href=\"javascript:void(0)\">[show]</a>');\n $(\".hide-a.open-d\").attr(\"class\",\"show-a open-d\");\n $(\".hide-a.closed-d\").attr(\"class\",\"show-a closed-d\");\n $(\".discussions\").hide();\n sAll = 0;\n }\n }\n });\n $(\".mode-all\").click(function() {\n if ( modeAll == 0 ) {\n $(\".mode-all\").html('(<a href=\"javascript:void(0)\">closed</a>)');\n modeAll = 1;\n }\n else if ( modeAll == 1 ) {\n $(\".mode-all\").html('(<a href=\"javascript:void(0)\">all</a>)');\n modeAll = 2;\n }\n else if ( modeAll == 2 ) {\n $(\".mode-all\").html('(<a href=\"javascript:void(0)\">open</a>)');\n modeAll = 0;\n }\n });\n if ( $.inArray(\"sysop\", wgUserGroups) != -1) {\n $(\".Dates\").replaceWith(' • <span class=\"cDelete\"><a href=\"javascript:void(0)\">delete</a></span>');\n $(\".cDiscuss\").html('<a href=\"javascript:void(0)\">close</a>');\n $(\".tool-descriptor\").html(\"Administrator toolbar\");\n $(\".sys-tool\").html('<b><a href=\"javascript:void(0)\">archive all</a></b>');\n $(\".sys-tool\").prepend('<span class=\"close-select\"><b><a href=\"javascript:void(0)\">close select</a></b></span> • ');\n closeApprove = true; \n archiveClick();\n }\n if ( $(\".AJAXRefresh\").length > 0 ) {\n $(\".AJAXRefresh\").html('<a href=\"javascript:void(0)\">Refresh</a>');\n $(\".AJAXRefresh\").click(function() {\n $(\".archive\").html('<div style=\"text-align:center; padding:8px\"><img src=\"https://images.wikia.nocookie.net/__cb61992/common/skins/common/images/ajax.gif\"/></div>');\n $.ajax({\n type: \"GET\",\n url: \"http://emperor-jarjarkine.wikia.com/index.php\",\n data: { action:'render', title:'Avatar Wiki:Votes for deletion' },\n success: function( data ) {\n var startChar = data.indexOf('<div class=\"FRow archive\" id=\"Demarc0\">');\n var finishChar = data.lastIndexOf('</div>');\n var processedData = data.slice(startChar,finishChar);\n $(\".archive\").html( processedData );\n closeAppear();\n closeClick();\n }\n });\n });\n }\n }\n else if ( wgPageName == \"Emperor Jarjarkine_Wiki:Votes_for_deletion\" ) {\n $(\".AJAXRefresh\").html('<a href=\"javascript:void(0)\">Refresh</a>');\n $(\".AJAXRefresh\").click(function() {\n $(\".archive\").html('<div style=\"text-align:center; padding:8px\"><img src=\"https://images.wikia.nocookie.net/__cb61992/common/skins/common/images/ajax.gif\"/></div>');\n $.ajax({\n type: \"GET\",\n url: \"http://emperor-jarjarkine.wikia.com/index.php\",\n data: { action:'render', title:'Emperor Jarjarkine:Votes for deletion' },\n success: function( data ) {\n var startChar = data.indexOf('<div class=\"FRow archive\" id=\"Demarc0\">');\n var finishChar = data.lastIndexOf('</div>');\n var processedData = data.slice(startChar,finishChar);\n $(\".archive\").html( processedData );\n closeAppear();\n closeClick();\n }\n });\n });\n }\n}", "onDeselect() {\n // Do something when a section instance is selected\n }", "onDeselect() {\n // Do something when a section instance is selected\n }", "function on_select_client(serial) {\n clear_div();\n //hide_div();\n $('#life_police_flg').val(\"\");\n $('#documents_flg').val(\"\");\n $('#communication_flg').val(\"\");\n // $('#conversation_follow_flg').val(\"\");\n $('#kupa_gemel_flg').val(\"\");\n client_details(serial);\n }", "function bindEventsAdmin()\n{\n /* para ocultar msgTop 10 segundos despues que se termina de cargar la pagina */\n setTimeout(function(){\n $(\"#msg_top\").hide('drop', {direction: \"up\"}, 1000)\n }, 5000);\n\n // Notification Close Button\n $(\".close-notification\").live(\"click\", function(){\n $(this).parent().fadeTo(350, 0, function () {$(this).slideUp(600);});\n return false;\n });\n\n // jQuery Tipsy\n $('[rel=tooltip], #main-nav span, .loader').tipsy({gravity:'s', fade:true}); // Tooltip Gravity Orientation: n | w | e | s\n\n // jQuery Facebox Modal\n $('a[rel*=modal]').facebox();\n\n // jQuery jWYSIWYG Editor\n //$('.wysiwyg').wysiwyg({ iFrameClass:'wysiwyg-iframe' });\n\n // jQuery dataTables\n $('.datatable').dataTable();\n\n // Check all checkboxes\n $('.check-all').click(\n function(){\n $(this).parents('form').find('input:checkbox').attr('checked', $(this).is(':checked'));\n }\n )\n\n // IE7 doesn't support :disabled\n $('.ie7').find(':disabled').addClass('disabled');\n\n // Widget Close Button\n $(\".close-widget\").click(\n function () {\n $(this).parent().fadeTo(350, 0, function () {$(this).slideUp(600);});\n return false;\n }\n );\n\n // Image actions\n $('.image-frame').hover(\n function() { $(this).find('.image-actions').css('display', 'none').fadeIn('fast').css('display', 'block'); }, // Show actions menu\n function() { $(this).find('.image-actions').fadeOut(100); } // Hide actions menu\n );\n\n // Content box tabs\n $('.tab').hide(); // Hide the content divs\n $('.default-tab').show(); // Show the div with class \"default-tab\"\n $('.tab-switch a.default-tab').addClass('current'); // Set the class of the default tab link to \"current\"\n\n $('.tab-switch a').click(\n function() {\n var tab = $(this).attr('href'); // Set variable \"tab\" to the value of href of clicked tab\n $(this).parent().siblings().find(\"a\").removeClass('current'); // Remove \"current\" class from all tabs\n $(this).addClass('current'); // Add class \"current\" to clicked tab\n $(tab).siblings('.tab').hide(); // Hide all content divs\n $(tab).show(); // Show the content div with the id equal to the id of clicked tab\n return false;\n }\n );\n\n // Content box side tabs\n $(\".sidetab\").hide();// Hide the content divs\n $('.default-sidetab').show(); // Show the div with class \"default-sidetab\"\n $('.sidetab-switch a.default-sidetab').addClass('current'); // Set the class of the default tab link to \"current\"\n\n $(\".sidetab-switch a\").click(\n function() {\n var sidetab = $(this).attr('href'); // Set variable \"sidetab\" to the value of href of clicked sidetab\n $(this).parent().siblings().find(\"a\").removeClass('current'); // Remove \"current\" class from all sidetabs\n $(this).addClass('current'); // Add class \"current\" to clicked sidetab\n $(sidetab).siblings('.sidetab').hide(); // Hide all content divs\n $(sidetab).show(); // Show the content div with the id equal to the id of clicked tab\n return false;\n }\n );\n\n //Minimize Content Article\n $(\"article header h2\").css({ \"cursor\":\"s-resize\" }); // Minizmie is not available without javascript, so we don't change cursor style with CSS\n $(\"article header h2\").click( // Toggle the Box Content\n function () {\n $(this).parent().find(\"nav\").toggle();\n $(this).parent().parent().find(\"section, footer\").toggle();\n }\n );\n}", "function callOnholdRes(d,s) {\n d = d.data;\n $(\"#onhold-open-popup .onholdres\").html(d.content_detail);\n $('#onhold-open-popup').modal('show');\n $('#onhold-open-popup button.btn').addClass('inactive');\n setTimeout(function() {\n modifyDropDown({selectorClass:'#onhold-open-popup .onholdres #onholdsection',searchAny:true,placeholder:'Search Reason'});\n },0);\n hideFullLoader('content_loader');\n //Added dropDown on change event\n $('#onhold-open-popup #onholdsection').on('change', function(){\n if($(this).children('option:selected').val() === 'Please select a reason:'){\n $('#onhold-open-popup button.btn').addClass('inactive');\n } else {\n $('#onhold-open-popup button.btn').removeClass('inactive');\n }\n });\n }", "function OnSelect(sender: Object, e: RoutedEventArgs) {\n\t\t\ttry {\n\t\t\t\tSelectRow();\n\t\t\t\tDashboardTaskService.Current.CloseTask(runner);\n\t\t\t} catch (ex: Exception) {\n\t\t\t\tConfirmDialog.ShowErrorDialog(\"Script\", ex);\n\t\t\t}\n\t\t}", "function assignMessagesHandlers() {\n\n\t\t\t$('#messagesAjax .pagination a').click(function(e) {\n\t\t\t\te.preventDefault();\n\t\t\t});\n\n\t\t\t$('#messagesAjax .pagination a').click(paginationHandlersMessages);\n\t\t\t\t \n\t\t $('.respondMessage').click(displayConversation);\n\n\t\t $('#responseBtn').click(respond);\n\n\t\t $('.deleteMessage').click(deleteConversation);\n\n\t\t // autofocus\n\t\t $('#responseModal').on('shown.bs.modal', function () {\n\t \t$(this).find('textarea').focus();\n\t\t\t});\n\n\t\t}", "function devices_page() {\n devices_grid = new contrib.grid({ rows: dim.scr.r, cols: dim.scr.c, screen: screen })\n\n status1_markdown = devices_grid.set(dim.status1.h, dim.status1.w, dim.status1.x,dim.status1.y, contrib.markdown, {\n tags: true,\n interactive: false\n })\n\n status2_markdown = devices_grid.set(dim.status2.h, dim.status2.w, dim.status2.x,dim.status2.y, contrib.markdown, {\n tags: true,\n interactive: false\n })\n\n deviceTable = devices_grid.set(dim.devTable.h, dim.devTable.w, dim.devTable.x,dim.devTable.y, contrib.table, {\n keys: true,\n mouse: true,\n vi: true,\n tags: true,\n fg: 'white',\n selectedFg: 'white',\n selectedBg: 'blue',\n label: 'Active',\n noCellBorders: true,\n interactive: true,\n width: dim.devTb.w,\n height: dim.devTb.h,\n border: {\n type: 'ascii',\n fg: 'cyan'},\n columnSpacing: 3, // in chars\n columnWidth: dim.devTbCols })\n\n deviceTable.rows.on('select',(i,idx) => {\n try {\n if(i && i.hasOwnProperty('content') && i.content.length) {\n var selected = i.content.match(/[0-9a-f]{1,2}([\\.:-])(?:[0-9a-f]{1,2}\\1){4}[0-9a-f]{1,2}/)\n //status1.log(selected.toString())\n if(selected)\n drawInfo(selected[0])\n }\n } catch (e) {\n status1.log(`Table Select: ${e}`)\n }\n })\n\n info_log = devices_grid.set(dim.info.x,dim.info.y, dim.info.h, dim.info.w, contrib.log, {\n label: 'info',\n tags: true,\n bufferLength: 96,\n scrollBack: 96,\n })\n\n status1 = devices_grid.set(dim.logger.x,dim.logger.y,dim.logger.h,dim.logger.w, contrib.log, {\n fg: 'green',\n padding: 1,\n tags: true,\n bufferLength: 64,\n scrollBack: 64,\n selectedFg: 'green',\n label: 'log'\n })\n\n deviceTable.show()\n deviceTable.focus()\n\n screen.append(helpBox)\n screen.append(searchBox)\n screen.append(searchResults)\n searchResults.hide()\n\n helpBox.focus()\n}", "function endEarlyButton() {\n endEarlyDetails();\n}", "function passengersDetaillsUnfold () {\n $('.btn-slide-pasajeros').unbind('click').click(function (e) {\n e.preventDefault()\n e.stopPropagation()\n if (!$(this).closest('.vuelo-wrp').find('.detalles-pasajeros').is(':visible')) {\n var arrayOfVisibles = $('.detalles-pasajeros')\n var flag = false\n var counter = 0\n arrayOfVisibles.slideUp('slow')\n $('.detalles-vuelo').removeClass('openSlide')\n $('.detalles-vuelo').addClass('closeSlide')\n\n for (var i = 0; i < arrayOfVisibles.length; i++) {\n if ($(arrayOfVisibles[i]).is(':visible')) {\n counter++\n }\n }\n\n if (($(this).parent().parent().parent().find('.detalles-pasajeros')).is(':visible') && (counter > 0)) {\n $(this).parent().parent().addClass('closeSlide')\n $(this).parent().parent().removeClass('openSlide')\n $(this).parent().parent().parent().find('.detalles-pasajeros').slideUp('slow')\n }else {\n $(this).parent().parent().addClass('openSlide')\n $(this).parent().parent().removeClass('closeSlide')\n $(this).parent().parent().parent().find('.detalles-pasajeros').slideDown('slow')\n $(this).parent().parent().parent().find('.detalles-pasajeros').find('.data-passenger').first().click()\n }\n\n $('#loader').modal('show')\n }else {\n $('#loader').modal('hide')\n return\n }\n })\n }", "function messageToRemoveListener() {\n var optionMessages = $('.dropdown-msg ul li:nth-child(6)');\n optionMessages.click(removeMsgToClick);\n}", "function MUPS_MessageClose() {\n console.log(\" --- MUPS_MessageClose --- \");\n\n $(\"#id_mod_userallowedsection\").modal(\"hide\");\n } // MUPS_MessageClose", "static collapseData () {\n $('tbody#bindOutput tr:visible a.json-toggle').not('.collapsed').click();\n }", "function CaseListLargeScreenHandler() {\r\n this.updateMainContainer = function(){\r\n var isCaseDetailsOpened = $('.js-case-details').length !== 0 ? true : false;\r\n if (isCaseDetailsOpened) {\r\n updateCaseDetails();\r\n }\r\n $('.js-simple-main-col').css('margin-left', 'auto');\r\n }\r\n\r\n function updateCaseDetails() {\r\n var replacedClass = 'replaced';\r\n var isSelectedClass = 'is-selected';\r\n var openedClass = 'opened';\r\n var $caseItem = caseItem();\r\n var $caseDetails = $('.js-case-details', $caseItem);\r\n var $responsiveHandleContainer = $('.js-responsive-handle-container', $caseItem);\r\n\r\n var $itemColumns = $('.js-case-details-item', $caseItem);\r\n var $documentColumn = $('.js-document-column', $caseItem);\r\n\r\n var $responsiveButtons = $('.js-responsive-handle-button', $caseItem);\r\n var $documentResponsiveButton = $('.js-document-column-responsive-button', $caseItem);\r\n var $relatedTaskResponsiveButton = $('.js-related-task-column-responsive-button', $caseItem);\r\n var $historyResponsiveButton = $('.js-history-column-responsive-button');\r\n\r\n var isAlreadyLoaded = $caseDetails.hasClass(openedClass);\r\n\r\n if (!isAlreadyLoaded) {\r\n $documentColumn.addClass(replacedClass);\r\n $relatedTaskResponsiveButton.hide();\r\n $historyResponsiveButton.hide();\r\n }\r\n\r\n var $hiddenColumn = $('.js-case-details-item:not(.' + replacedClass + '):last', $caseItem);\r\n $itemColumns.show().css('opacity', 1);\r\n $responsiveHandleContainer.show();\r\n\r\n // Display data column as default when the menu state is changed from no expanded menu to one expanded menu\r\n var isResponsiveButtonClicked = $responsiveButtons.hasClass('is-clicked');\r\n if (!isResponsiveButtonClicked) {\r\n $itemColumns.removeClass(replacedClass);\r\n $responsiveButtons.removeClass(isSelectedClass);\r\n $documentColumn.addClass(replacedClass);\r\n }\r\n $hiddenColumn.hide();\r\n $responsiveButtons.removeClass(isSelectedClass);\r\n responsiveButton($('.' + replacedClass, $caseItem), $caseItem).addClass(isSelectedClass);\r\n\r\n $caseDetails.addClass(openedClass);\r\n if (!$documentResponsiveButton.is(\":visible\") && $documentResponsiveButton.hasClass(isSelectedClass)) {\r\n var $descriptionResponsiveButton = $('.js-description-column-responsive-button', $caseItem);\r\n $descriptionResponsiveButton.addClass(isSelectedClass);\r\n }\r\n }\r\n\r\n function caseItem() {\r\n var $caseItem = $('.show-case-details-mode').has('.js-case-details:not(.opened)');\r\n if ($caseItem.length === 0) {\r\n $caseItem = $('.show-case-details-mode');\r\n }\r\n return $caseItem;\r\n }\r\n\r\n function responsiveButton($itemColumn, $caseItem) {\r\n var theClass = $itemColumn.attr('class').match(/js[\\w-]*[\\w-]column\\b/);\r\n return $('.' + theClass + '-responsive-button', $caseItem);\r\n }\r\n}", "function hideMessageRow() {\n $('#sodar-pr-project-list-message').hide();\n}", "function messageOptionsListener() {\n var optionMessages = $(\".parent-dropdown, .parent-dropdown-msg\");\n optionMessages.click('click', openOptions);\n}", "function addEventsCompCUPortfolio(){\n\tdocument.getElementById('summary-li').addEventListener('click',function()\n\t{\n\t\tdocument.getElementById('summary').style.display=\"\";\n\t\tdocument.getElementById('basiccontrol').style.display=\"none\";\n\t\tdocument.getElementById('auditreadyasmt').style.display=\"none\";\n\t\tdocument.getElementById('riskmsdcommit').style.display=\"none\";\n\t\tdocument.getElementById('auditreview').style.display=\"none\";\n\t\tdocument.getElementById('kctest').style.display=\"none\";\n\t\tdocument.getElementById('opmetric').style.display=\"none\";\n\t\tdocument.getElementById('accountrating').style.display=\"none\";\n\t\tdocument.getElementById('other').style.display=\"none\";\n\n\t\tdocument.getElementById('summary-li').className=\"ibm-active\";\n\t\tdocument.getElementById('basiccontrol-li').className=\"\";\n\t\tdocument.getElementById('auditreadyasmt-li').className=\"\";\n\t\tdocument.getElementById('riskmsdcommit-li').className=\"\";\n\t\tdocument.getElementById('auditreview-li').className=\"\";\n\t\tdocument.getElementById('kctest-li').className=\"\";\n\t\tdocument.getElementById('opmetric-li').className=\"\";\n\t\tdocument.getElementById('accountrating-li').className=\"\";\n\t\tdocument.getElementById('other-li').className=\"\";\n\t},true);\n\tdocument.getElementById('basiccontrol-li').addEventListener('click',function()\n\t{\n\t\tdocument.getElementById('summary').style.display=\"none\";\n\t\tdocument.getElementById('basiccontrol').style.display=\"\";\n\t\tdocument.getElementById('auditreadyasmt').style.display=\"none\";\n\t\tdocument.getElementById('riskmsdcommit').style.display=\"none\";\n\t\tdocument.getElementById('auditreview').style.display=\"none\";\n\t\tdocument.getElementById('kctest').style.display=\"none\";\n\t\tdocument.getElementById('opmetric').style.display=\"none\";\n\t\tdocument.getElementById('accountrating').style.display=\"none\";\n\t\tdocument.getElementById('other').style.display=\"none\";\n\n\t\tdocument.getElementById('summary-li').className=\"\";\n\t\tdocument.getElementById('basiccontrol-li').className=\"ibm-active\";\n\t\tdocument.getElementById('auditreadyasmt-li').className=\"\";\n\t\tdocument.getElementById('riskmsdcommit-li').className=\"\";\n\t\tdocument.getElementById('auditreview-li').className=\"\";\n\t\tdocument.getElementById('kctest-li').className=\"\";\n\t\tdocument.getElementById('opmetric-li').className=\"\";\n\t\tdocument.getElementById('accountrating-li').className=\"\";\n\t\tdocument.getElementById('other-li').className=\"\";\n\t},true);\n\tdocument.getElementById('auditreadyasmt-li').addEventListener('click',function()\n\t{\n\t\tdocument.getElementById('summary').style.display=\"none\";\n\t\tdocument.getElementById('basiccontrol').style.display=\"none\";\n\t\tdocument.getElementById('auditreadyasmt').style.display=\"\";\n\t\tdocument.getElementById('riskmsdcommit').style.display=\"none\";\n\t\tdocument.getElementById('auditreview').style.display=\"none\";\n\t\tdocument.getElementById('kctest').style.display=\"none\";\n\t\tdocument.getElementById('opmetric').style.display=\"none\";\n\t\tdocument.getElementById('accountrating').style.display=\"none\";\n\t\tdocument.getElementById('other').style.display=\"none\";\n\n\t\tdocument.getElementById('summary-li').className=\"\";\n\t\tdocument.getElementById('basiccontrol-li').className=\"\";\n\t\tdocument.getElementById('auditreadyasmt-li').className=\"ibm-active\";\n\t\tdocument.getElementById('riskmsdcommit-li').className=\"\";\n\t\tdocument.getElementById('auditreview-li').className=\"\";\n\t\tdocument.getElementById('kctest-li').className=\"\";\n\t\tdocument.getElementById('opmetric-li').className=\"\";\n\t\tdocument.getElementById('accountrating-li').className=\"\";\n\t\tdocument.getElementById('other-li').className=\"\";\n\t},true);\n\tdocument.getElementById('riskmsdcommit-li').addEventListener('click',function()\n\t{\n\t\tdocument.getElementById('summary').style.display=\"none\";\n\t\tdocument.getElementById('basiccontrol').style.display=\"none\";\n\t\tdocument.getElementById('auditreadyasmt').style.display=\"none\";\n\t\tdocument.getElementById('riskmsdcommit').style.display=\"\";\n\t\tdocument.getElementById('auditreview').style.display=\"none\";\n\t\tdocument.getElementById('kctest').style.display=\"none\";\n\t\tdocument.getElementById('opmetric').style.display=\"none\";\n\t\tdocument.getElementById('accountrating').style.display=\"none\";\n\t\tdocument.getElementById('other').style.display=\"none\";\n\n\t\tdocument.getElementById('summary-li').className=\"\";\n\t\tdocument.getElementById('basiccontrol-li').className=\"\";\n\t\tdocument.getElementById('auditreadyasmt-li').className=\"\";\n\t\tdocument.getElementById('riskmsdcommit-li').className=\"ibm-active\";\n\t\tdocument.getElementById('auditreview-li').className=\"\";\n\t\tdocument.getElementById('kctest-li').className=\"\";\n\t\tdocument.getElementById('opmetric-li').className=\"\";\n\t\tdocument.getElementById('accountrating-li').className=\"\";\n\t\tdocument.getElementById('other-li').className=\"\";\n\t},true);\n\tdocument.getElementById('auditreview-li').addEventListener('click',function()\n\t{\n\t\tdocument.getElementById('summary').style.display=\"none\";\n\t\tdocument.getElementById('basiccontrol').style.display=\"none\";\n\t\tdocument.getElementById('auditreadyasmt').style.display=\"none\";\n\t\tdocument.getElementById('riskmsdcommit').style.display=\"none\";\n\t\tdocument.getElementById('auditreview').style.display=\"\";\n\t\tdocument.getElementById('kctest').style.display=\"none\";\n\t\tdocument.getElementById('opmetric').style.display=\"none\";\n\t\tdocument.getElementById('accountrating').style.display=\"none\";\n\t\tdocument.getElementById('other').style.display=\"none\";\n\n\t\tdocument.getElementById('summary-li').className=\"\";\n\t\tdocument.getElementById('basiccontrol-li').className=\"\";\n\t\tdocument.getElementById('auditreadyasmt-li').className=\"\";\n\t\tdocument.getElementById('riskmsdcommit-li').className=\"\";\n\t\tdocument.getElementById('auditreview-li').className=\"ibm-active\";\n\t\tdocument.getElementById('kctest-li').className=\"\";\n\t\tdocument.getElementById('opmetric-li').className=\"\";\n\t\tdocument.getElementById('accountrating-li').className=\"\";\n\t\tdocument.getElementById('other-li').className=\"\";\n\t},true);\n\tdocument.getElementById('kctest-li').addEventListener('click',function()\n\t{\n\t\tdocument.getElementById('summary').style.display=\"none\";\n\t\tdocument.getElementById('basiccontrol').style.display=\"none\";\n\t\tdocument.getElementById('auditreadyasmt').style.display=\"none\";\n\t\tdocument.getElementById('riskmsdcommit').style.display=\"none\";\n\t\tdocument.getElementById('auditreview').style.display=\"none\";\n\t\tdocument.getElementById('kctest').style.display=\"\";\n\t\tdocument.getElementById('opmetric').style.display=\"none\";\n\t\tdocument.getElementById('accountrating').style.display=\"none\";\n\t\tdocument.getElementById('other').style.display=\"none\";\n\n\t\tdocument.getElementById('summary-li').className=\"\";\n\t\tdocument.getElementById('basiccontrol-li').className=\"\";\n\t\tdocument.getElementById('auditreadyasmt-li').className=\"\";\n\t\tdocument.getElementById('riskmsdcommit-li').className=\"\";\n\t\tdocument.getElementById('auditreview-li').className=\"\";\n\t\tdocument.getElementById('kctest-li').className=\"ibm-active\";\n\t\tdocument.getElementById('opmetric-li').className=\"\";\n\t\tdocument.getElementById('accountrating-li').className=\"\";\n\t\tdocument.getElementById('other-li').className=\"\";\n\t},true);\n\tdocument.getElementById('opmetric-li').addEventListener('click',function()\n\t{\n\t\tdocument.getElementById('summary').style.display=\"none\";\n\t\tdocument.getElementById('basiccontrol').style.display=\"none\";\n\t\tdocument.getElementById('auditreadyasmt').style.display=\"none\";\n\t\tdocument.getElementById('riskmsdcommit').style.display=\"none\";\n\t\tdocument.getElementById('auditreview').style.display=\"none\";\n\t\tdocument.getElementById('kctest').style.display=\"none\";\n\t\tdocument.getElementById('opmetric').style.display=\"\";\n\t\tdocument.getElementById('accountrating').style.display=\"none\";\n\t\tdocument.getElementById('other').style.display=\"none\";\n\n\t\tdocument.getElementById('summary-li').className=\"\";\n\t\tdocument.getElementById('basiccontrol-li').className=\"\";\n\t\tdocument.getElementById('auditreadyasmt-li').className=\"\";\n\t\tdocument.getElementById('riskmsdcommit-li').className=\"\";\n\t\tdocument.getElementById('auditreview-li').className=\"\";\n\t\tdocument.getElementById('kctest-li').className=\"\";\n\t\tdocument.getElementById('opmetric-li').className=\"ibm-active\";\n\t\tdocument.getElementById('accountrating-li').className=\"\";\n\t\tdocument.getElementById('other-li').className=\"\";\n\t},true);\n\tdocument.getElementById('accountrating-li').addEventListener('click',function()\n\t{\n\t\tdocument.getElementById('summary').style.display=\"none\";\n\t\tdocument.getElementById('basiccontrol').style.display=\"none\";\n\t\tdocument.getElementById('auditreadyasmt').style.display=\"none\";\n\t\tdocument.getElementById('riskmsdcommit').style.display=\"none\";\n\t\tdocument.getElementById('auditreview').style.display=\"none\";\n\t\tdocument.getElementById('kctest').style.display=\"none\";\n\t\tdocument.getElementById('opmetric').style.display=\"none\";\n\t\tdocument.getElementById('accountrating').style.display=\"\";\n\t\tdocument.getElementById('other').style.display=\"none\";\n\n\t\tdocument.getElementById('summary-li').className=\"\";\n\t\tdocument.getElementById('basiccontrol-li').className=\"\";\n\t\tdocument.getElementById('auditreadyasmt-li').className=\"\";\n\t\tdocument.getElementById('riskmsdcommit-li').className=\"\";\n\t\tdocument.getElementById('auditreview-li').className=\"\";\n\t\tdocument.getElementById('kctest-li').className=\"\";\n\t\tdocument.getElementById('opmetric-li').className=\"\";\n\t\tdocument.getElementById('accountrating-li').className=\"ibm-active\";\n\t\tdocument.getElementById('other-li').className=\"\";\n\t},true);\n\tdocument.getElementById('other-li').addEventListener('click',function()\n\t{\n\t\tdocument.getElementById('summary').style.display=\"none\";\n\t\tdocument.getElementById('basiccontrol').style.display=\"none\";\n\t\tdocument.getElementById('auditreadyasmt').style.display=\"none\";\n\t\tdocument.getElementById('riskmsdcommit').style.display=\"none\";\n\t\tdocument.getElementById('auditreview').style.display=\"none\";\n\t\tdocument.getElementById('kctest').style.display=\"none\";\n\t\tdocument.getElementById('opmetric').style.display=\"none\";\n\t\tdocument.getElementById('accountrating').style.display=\"none\";\n\t\tdocument.getElementById('other').style.display=\"\";\n\n\t\tdocument.getElementById('summary-li').className=\"\";\n\t\tdocument.getElementById('basiccontrol-li').className=\"\";\n\t\tdocument.getElementById('auditreadyasmt-li').className=\"\";\n\t\tdocument.getElementById('riskmsdcommit-li').className=\"\";\n\t\tdocument.getElementById('auditreview-li').className=\"\";\n\t\tdocument.getElementById('kctest-li').className=\"\";\n\t\tdocument.getElementById('opmetric-li').className=\"\";\n\t\tdocument.getElementById('accountrating-li').className=\"\";\n\t\tdocument.getElementById('other-li').className=\"ibm-active\";\n\t},true);\n}", "function afterRefreshCharSummary(){\n user_form_afterSelect();\n}", "function knowMattressSizePopupInnerFunctionalities() { \n $('.know-mattress-size-popup-block--close-button').on('click', function (e) {\n e.preventDefault();\n $('.know-mattress-size-popup-block').fadeOut(500);\n $('.body-overlay').removeClass('know-mattress-size-popup--visible');\n $('body').removeClass('know-mattress-size-popup-block-open-scroll-lock');\n });\n\n $('.know-mattress-size-popup-block--size-selector-tab .tab-content .tab-pane .bed-size').on('click', function () {\n $(this).closest('.tab-pane').find('.bed-size').removeClass('active');\n $(this).addClass('active');\n });\n\n $('.mattress-size-guide-trigger a').on('click',function(e) {\n e.preventDefault();\n $('.header--get-help').trigger('click');\n $('.know-mattress-size-popup-block').fadeIn(500);\n $('.body-overlay').addClass('know-mattress-size-popup--visible');\n $('body').addClass('know-mattress-size-popup-block-open-scroll-lock');\n })\n }", "function exitSrchBtnHdlr() {\n\tvar dirtyCells = $(\"tbody input[type=text][data-changed=true]\").length;\n\tif ( ( dirtyCells > 0 ) && ( !confirm( _alertUnsaved ) ) ) return;\n\t\n\tloadTblData( _tblName, 1, 30, ( ( _icoName != null ) ? _icoName : _sessUsr ), \"tabDataFrame\" );\n}", "function displaySubInformations(objectId, divTitle, fromToValue) \n{\n\n// ++ HAT1 ZUD: IR-604654-3DEXPERIENCER2019x ++\n\tvar selection = \"multiple\";\n\tif(fromToValue == \"From\")\n\t\ttraceabilityReportMethod = \"getDownDirectionSubRequirements\";\n\telse if(fromToValue == \"To\")\n\t\ttraceabilityReportMethod = \"getUpDirectionSubRequirements\";\n\telse\n\t\ttraceabilityReportMethod = \"getBothDirectionSubRequirements\";\n\t// -- HAT1 ZUD: IR-604654-3DEXPERIENCER2019x --\n\t\n\t//HAT1 ZUD: IR-438515-3DEXPERIENCER2019x: fix\n\tif(isIE)\n\tdivTitle = decode_utf8(divTitle);\n\t\n\tvar dialogId = \"\";\n\n\t//We need to load the jqueryui scripts in case it's not done already\n\t$.cachedScript(\"../requirements/scripts/plugins/jquery.ui-RMT.js\").done(function() {\n $.cachedScript(\"../requirements/scripts/plugins/jquery.dialogextend-RMT.js\").done(\n function() {\n \t var program;\n \t //START : IR-374998-3DEXPERIENCER2016x Requirement: When refining requirements, Change of relationship status of requirement \n \t //in drop down menu is not getting saved properly.\n \t var url = '../common/emxIndentedTable.jsp?toolbar=RMTSpecCoveredRefinedRemoveDelete&selection=multiple&hideRootSelection=true&expandLevel=1&sortColumnName=none&suiteKey=Requirements&editLink=true&freezePane=TargetReq&'+\n \t \t'program=emxTraceabilityReport:' + traceabilityReportMethod +\n \t '&table=RMTCoveredRefineReqTable&customize=false&objectId='+objectId; //hasChildren=false&editRootNode=false&\n \t /*var url = \"../common/emxIndentedTable.jsp?expandLevel=1&editLink=true&freezePane=TargetReq&objectId=\" + objectId +\n \t \"&customize=false&program=emxRequirement:getDerivedRequirements&reportRelationships=relationship_DerivedRequirement&reportDirection=\" +\n \t dir +\n \t \"&reportTypes=type_Requirement&table=RMTSpecCoveredRefinedRemoveDelete&header=emxRequirements.TraceabilityReport.Specification.Requirement.SubDerivedReqs.Header&HelpMarker=emxhelptraceabilityreqreqreport&suiteKey=Requirements&selectedType=Specification&baselineObject=\";*/\n \t ////END : IR-374998-3DEXPERIENCER2016x Requirement: When refining requirements, Change of relationship status of requirement \n \t //in drop down menu is not getting saved properly.\n \t var floatingDivId = \"float\" + objectId.split(\".\").join(\"_\");\n \t dialogId = floatingDivId;\n \t var floatingOptions = {\n \t resizable: [true, {\n \t animate: true\n \t }],\n \t height: 400,\n \t width: 1000,\n \t title: divTitle,\n \t close: function () {\n \t refreshMainPage();\n \t }\n \t };\n \t //maximize,minize buttons are options of dialogextend component\n \t var floatingExtentedOptions = {\n \t \t\t\"closable\": true,\n \t \"maximizable\": true,\n \t \"minimizable\": true,\n \t \"dblclick\": 'maximize'\t\t\n \t };\n \t \n \t var frameId = \"frame\" + objectId.split(\".\").join(\"_\");\n \t var div = $('#' + floatingDivId);\n \t var frame = $('#' + frameId);\n \t $('#' + floatingDivId).dialog(floatingOptions).dialogExtend(floatingExtentedOptions);\n \t frame.css({\n \t 'width': '100%',\n \t 'height': '100%'\n \t });\n \t frame.attr('src', url);\n\n })});\n}", "function _eventTableAllNotificationClicked(e)\n{\n\ttry\n\t{\n\t\tif (Alloy.Globals.currentWindow == \"winMyServices\" && (Alloy.Globals.currentWindow != null || Alloy.Globals.currentWindow != undefined))\n\t\t\tAlloy.Globals.arrWindows[Alloy.Globals.arrWindows.length - 1].close();\n\t\t\t\n\t\tvar nTypeId = e.row.nTypeId;\n\t\tif (nTypeId==\"5\"){\n\t\t\tTi.API.info('ASSOCIATED MESSAGE ROW: '+e.row.nTypeIdVal);\n\t\t\t\n\t\t\t/*var userid = Ti.App.Properties.getObject(\"LoginDetaisObj\");\n\t\t\t\tuserid = (Ti.App.Properties.getObject(\"LoginDetaisObj\") == null ? 0 : Ti.App.Properties.getObject(\"LoginDetaisObj\").userName);*/\n\t\t\t\t\n\t\t\thttpManager.markNotificationMessageAsRead(function(response){\n\t\t\t\t\tif (response=='1')\n\t\t\t\t\t\t$.tableviewAllNotifications.deleteRow(e.index);\n\t\t\t\t\tvar data = {\"response\":\"\", \n\t\t\t\t\t\t\t\t\"idToExpand\":e.row.nTypeIdVal, \n\t\t\t\t\t\t\t\t\"isNoRecord\":\"\" , \n\t\t\t\t\t\t\t\turl : \"\"};\n\t\t\t\t\tAlloy.Globals.openWindow(Alloy.createController(\"Services/MyServices/winMyServices\", data).getView());\n\t\t\t\t},e.row.messageId, (Ti.App.Properties.getObject(\"LoginDetaisObj\") == null ? 0 : Ti.App.Properties.getObject(\"LoginDetaisObj\").userName));\n\t\t}else{\n\t\t\tTi.API.info('WHY OTHER RECORDS CAME HERE... ONLY eSERVICES NOTIFICATION COMES HERE');\n\t\t\treturn;\n\t\t}\n\t\tsetTimeout(function(){$.viewNotificationMain.animate({opacity : 0,duration : 300}, function(e) {$.viewNotificationMain.visible = false;});},500);\n\t}\n\tcatch(e){Ti.API.info(' ############# ERROR IN eSERVICES TABLE NOTIFICATION CLICK ############## '+JSON.stringify(e));}\n}", "handleRowDescription(msg) {\n this._checkForMultirow()\n this._result.addFields(msg.fields)\n this._accumulateRows = this.callback || !this.listeners('row').length\n }", "function limpiarCapaEstudiantes(){\n lienzoEstudiantes.destroyFeatures();\n if (map.popups.length == 1) {\n map.removePopup(map.popups[0]);\n }\n selectFeaturesEstudiante.deactivate();\n}", "function item_maintenance() {\n //\n reset_meat_page();\n //\n document.getElementById('tab-clicked').value = 'item-maintenance';\n //\n var head_elements = Array(\n {'elm' : 'H4','textNode' : 'Click on an item in the table to modfy it or click the button below the table to create a new item.'},\n {'elm' : 'LABEL', 'className' : 'label', 'textNode' : 'Show Inactive Items'},\n {'elm' : 'INPUT', 'id' : 'show-inactive', 'type' : 'checkbox', 'events' : [{'event' : 'click', 'function' : gen_item_table.bind(null,1,'item_number','ASC')}]},\n {'elm' : 'BR'},\n {'elm' : 'LABEL', 'className' : 'label-12em', 'textNode' : 'Narrow by Item Number:'},\n {'elm' : 'INPUT', 'id' : 'search-item-number', 'type' : 'text', 'events' : [{'event' : 'keyup', 'function' : gen_item_table.bind(null,1,'item_number','ASC')}]}\n );\n //\n addChildren(document.getElementById('input-div'),head_elements);\n //\n gen_item_table(1,'item_number','ASC');\n}", "function inputClick () {\n clickSection('#tarjetaTab', 'desgloseTarjeta', 'show', null)\n clickSection('#sucursalTab', 'desgloseSucursal', 'show', null)\n clickSection('#paypalTab', 'desglosePaypal', 'hide', null)\n clickSection('#visaTab', 'desgloseVisa', 'hide', null)\n clickSection('#masterpassTab', 'desgloseMasterpass', 'hide', null)\n clickSection('#intervaleTab', 'desgloseIntervale', 'show', null)\n clickSection('#paybackTab', 'desglosePayback', 'disable', null)\n clickSection('#ClubTab', 'desgloseClubInterjet', 'disable', null)\n\n modalAlerts('.link-interest' , '#modalBankCards')\n modalAlerts('#mapShuttle', '#modalInterjetTierra')\n modalAlerts('#link-terms-ref', '#modalPaymentRef')\n modalAlerts('.link-prices', '.modalPrices')\n modalAlerts('.links-rules', '#ReglasOptima')\n $('.has-tooltip').tooltip('disable')\n\n $('.input-material').on('click', function (e) {\n e.stopPropagation()\n e.preventDefault()\n\n $(this).find('input')[0].focus()\n })\n\n $('input[type=text], input[type=number]').on('click focus', function (e) {\n e.stopPropagation()\n e.preventDefault()\n\n deselectInputs()\n\n $(this).closest('.input-material').addClass('active')\n })\n // green buttons functionality\n $('.btn-primary').on('click', function (e) {\n // $('.btn-secondary').click()\n })\n\n $('.btn-confirm').on('click', function (e) {\n e.stopPropagation()\n e.preventDefault()\n // class incorrect adds red outline and X mark\n // class correct adds green outline and check mark\n $('#nu-tarjeta').addClass('incorrect')\n $('#nu-payback').addClass('correct')\n })\n\n $('.detail-purchase').on('click', function (e) {\n if ($('#purchaseDetails').hasClass('open')) {\n $('#purchaseDetails').removeClass('open')\n $('#purchaseDetails').slideUp('slow')\n $('.detail-purchase').removeClass('show')\n }else {\n $('#purchaseDetails').addClass('open')\n $('#purchaseDetails').slideDown('slow')\n $('.detail-purchase').addClass('show')\n }\n })\n\n $('.navbar-brand').on('click', function (e) {\n window.location.href = 'home.aspx'\n })\n\n /*$('.btn-validate').on('click', function (e) {\n e.stopPropagation()\n e.preventDefault()\n\n $('#nu-intervale').addClass('incorrect')\n $('#nu-tarjeta-int').addClass('correct')\n $('#titularTarjeta').addClass('incorrect')\n $(IntervaleSection1).hide()\n $('#intervaleValidado').show()\n $('#intervale-wrp').slideDown('slow')\n })\n\n $('#valid-paybck').on('click', function (e) {\n e.stopPropagation()\n e.preventDefault()\n $('#paybackValidate').hide()\n $('#paybackAvailableAmount').slideDown('slow')\n }) */\n\n $('.btn-delete').on('click', function (e) {\n e.stopPropagation()\n e.preventDefault()\n $('#nu-intervale').removeClass('correct')\n $('#intervaleValidado').hide()\n $(IntervaleSection1).show()\n })\n\n $('.btn-check').on('click', function (e) {\n $('#nu-payback').addClass('correct')\n })\n\n // calendar click\n $('.option-active').on('focus', function (e) {\n deselectInputs()\n\n $(this).parent().addClass('open')\n if ($(this).parent().hasClass('select-date')) {\n $(this).find('.datepicker').click()\n }\n })\n // dropdown click\n $('.select-generic').on('click', function (e) {\n $(this).find('.select-options').slideDown('down')\n\n e.stopPropagation()\n e.preventDefault()\n // if dropdown is already opened this closes it\n if ($($(this).find('.btn-select')[0]).hasClass('open')) {\n $('.input-material').removeClass('active')\n $('.btn-select').removeClass('open')\n for (var i = 0; i < $('.select-options').length; i++) {\n $($('.select-options')[i]).slideUp('slow')\n }\n }else {\n $('.input-material').removeClass('active')\n $('.btn-select').removeClass('open')\n\n $($(this).find('.btn-select')[0]).addClass('open')\n $('.detail-purchase').removeClass('open')\n // console.log($($(this).find('.btn-select')[0]).hasClass('open'))\n for (var i = 0; i < $('.select-options').length; i++) {\n // closes all dropdowns but the one clicked\n if ($('.select-options')[i] != $(this).find('.select-options')[0]) {\n $($('.select-options')[i]).slideUp('slow')\n }\n }\n\n $(this).find('.option-active').focus()\n $(this).find('.option-active').addClass('open')\n }\n })\n\n // dropdown option selected\n $('.option-item').on('click', function (e) {\n e.stopPropagation()\n e.preventDefault()\n var newOption = $(this).text()\n $(this).closest('.select-generic').find('.option-active').html(newOption)\n\n $($(this).closest('.select-generic').find('.btn-select')[0]).removeClass('open')\n $(this).closest('.select-options').slideUp('slow')\n })\n\n // Meses sin Interes *********************\n $('.select-MSI').on('click', function (e) {\n $(this).find('.select-options').slideDown('down')\n e.stopPropagation()\n e.preventDefault()\n // if dropdown is already opened this closes it\n if ($($(this).find('.btn-select')[0]).hasClass('open')) {\n $('.btn-select').removeClass('open')\n for (var i = 0; i < $('.select-options').length; i++) {\n $($('.select-options')[i]).slideUp('slow')\n }\n }else {\n $('.btn-select').removeClass('open')\n\n $($(this).find('.btn-select')[0]).addClass('open')\n\n for (var i = 0; i < $('.select-options').length; i++) {\n // closes all dropdowns but the one clicked\n if ($('.select-options')[i] != $(this).find('.select-options')[0]) {\n $($('.select-options')[i]).slideUp('slow')\n }\n }\n\n $(this).find('.option-active').focus()\n $(this).find('.option-active').addClass('open')\n }\n })\n\n $('.option-item-MSI').on('click', function (e) {\n e.stopPropagation()\n e.preventDefault()\n var newOption = $(this).text()\n $(this).closest('.select-MSI').find('.option-active').html(newOption)\n\n if ($(\"select[id$='INSTALLMENTS']\")) {\n $(\"select[id$='INSTALLMENTS']\").val($(this).attr('value'))\n }\n\n\n $($(this).closest('.select-MSI').find('.btn-select')[0]).removeClass('open')\n $(this).closest('.select-options').slideUp('slow')\n })\n // Meses sin Interes *********************\n\n $('.checkbox-wrp').on('click', function (e) {\n e.stopPropagation()\n e.preventDefault()\n checkboxClick('#checkpayback', $(this))\n })\n\n $('#paybackCheck').on('click', function (e) {\n e.stopPropagation()\n e.preventDefault()\n checkboxClick('#checkpayback', $(this).find('.checkbox-label')[0])\n })\n\n // when clicking outside of inputs this makes them all inactive\n $('body').on('click', function (e) {\n e.stopPropagation()\n e.preventDefault()\n deselectInputs()\n })\n\n /*$( '.link-delete-payback' ).bind( 'click', function(e){\n e.preventDefault()\n $('#modalDeletePayback').modal(\"show\")\n } )*/\n\n //clickSecondCard()\n }", "function WorksheetManageResultsView() {\n\n var that = this;\n\n that.load = function() {\n\n // Remove empty options\n initializeInstrumentsAndMethods();\n\n loadHeaderEventsHandlers();\n\n loadMethodEventHandlers();\n\n // Manage the upper selection form for spread wide interim results values\n loadWideInterimsEventHandlers();\n\n loadRemarksEventHandlers();\n\n loadDetectionLimitsEventHandlers();\n }\n\n function portalMessage(message) {\n window.jarn.i18n.loadCatalog(\"bika\");\n _ = jarn.i18n.MessageFactory('bika');\n str = \"<dl class='portalMessage info'>\"+\n \"<dt>\"+_('Info')+\"</dt>\"+\n \"<dd><ul>\" + message +\n \"</ul></dd></dl>\";\n $('.portalMessage').remove();\n $(str).appendTo('#viewlet-above-content');\n }\n\n function loadRemarksEventHandlers() {\n // Add a baloon icon before Analyses' name when you'd add a remark. If you click on, it'll display remarks textarea.\n var txt1 = '<a href=\"#\" class=\"add-remark\"><img src=\"'+window.portal_url+'/++resource++bika.lims.images/comment_ico.png\" title=\"'+_('Add Remark')+'\")\"></a>';\n var pointer = $(\".listing_remarks:contains('')\").closest('tr').prev().find('td.service_title span.before');\n $(pointer).append(txt1);\n\n $(\"a.add-remark\").click(function(e){\n e.preventDefault();\n var rmks = $(this).closest('tr').next('tr').find('td.remarks');\n if (rmks.length > 0) {\n rmks.toggle();\n }\n });\n $(\"a.add-remark\").click();\n }\n\n function loadDetectionLimitsEventHandlers() {\n $('select[name^=\"DetectionLimit.\"]').change(function() {\n var defdls = $(this).closest('td').find('input[id^=\"DefaultDLS.\"]').first().val();\n var resfld = $(this).closest('tr').find('input[name^=\"Result.\"]')[0];\n var uncfld = $(this).closest('tr').find('input[name^=\"Uncertainty.\"]');\n defdls = $.parseJSON(defdls);\n $(resfld).prop('readonly', !defdls.manual);\n if ($(this).val() == '<') {\n $(resfld).val(defdls['min']);\n // Inactivate uncertainty?\n if (uncfld.length > 0) {\n $(uncfld).val('');\n $(uncfld).prop('readonly', true);\n $(uncfld).closest('td').children().hide();\n }\n } else if ($(this).val() == '>') {\n $(resfld).val(defdls['max']);\n // Inactivate uncertainty?\n if (uncfld.length > 0) {\n $(uncfld).val('');\n $(uncfld).prop('readonly', true);\n $(uncfld).closest('td').children().hide();\n }\n } else {\n $(resfld).val('');\n $(resfld).prop('readonly',false);\n // Activate uncertainty?\n if (uncfld.length > 0) {\n $(uncfld).val('');\n $(uncfld).prop('readonly', false);\n $(uncfld).closest('td').children().show();\n }\n }\n // Maybe the result is used in calculations...\n $(resfld).change();\n });\n $('select[name^=\"DetectionLimit.\"]').change();\n }\n\n function loadWideInterimsEventHandlers() {\n $(\"#wideinterims_analyses\").change(function(){\n $(\"#wideinterims_interims\").html('');\n $('input[id^=\"wideinterim_'+$(this).val()+'\"]').each(function(i, obj) {\n itemval = '<option value=\"'+ $(obj).attr('keyword') +'\">'+$(obj).attr('name')+'</option>';\n $(\"#wideinterims_interims\").append(itemval);\n });\n });\n $(\"#wideinterims_interims\").change(function(){\n analysis = $(\"#wideinterims_analyses\").val();\n interim = $(this).val();\n idinter = \"#wideinterim_\"+analysis+\"_\"+interim;\n $(\"#wideinterims_value\").val($(idinter).val());\n });\n $(\"#wideinterims_apply\").click(function(event) {\n event.preventDefault();\n analysis=$(\"#wideinterims_analyses\").val();\n interim=$(\"#wideinterims_interims\").val();\n $('tr[keyword=\"'+analysis+'\"] input[field=\"'+interim+'\"]').each(function(i, obj) {\n if ($('#wideinterims_empty').is(':checked')) {\n if ($(this).val()=='' || $(this).val().match(/\\d+/)=='0') {\n $(this).val($('#wideinterims_value').val());\n $(this).change();\n }\n } else {\n $(this).val($('#wideinterims_value').val());\n $(this).change();\n }\n });\n });\n }\n\n /**\n * Stores the constraints regarding to methods and instrument assignments to\n * each analysis. The variable is filled in initializeInstrumentsAndMethods\n * and is used inside loadMethodEventHandlers.\n */\n var mi_constraints = null;\n\n /**\n * Applies the rules and constraints to each analysis displayed in the\n * manage results view regarding to methods, instruments and results.\n * For example, this service is responsible of disabling the results field\n * if the analysis has no valid instrument available for the selected\n * method if the service don't allow manual entry of results. Another\n * example is that this service is responsible of populating the list of\n * instruments avialable for an analysis service when the user changes the\n * method to be used.\n * See docs/imm_results_entry_behavior.png for detailed information.\n */\n function initializeInstrumentsAndMethods() {\n var auids = [];\n\n /// Get all the analysis UIDs from this manage results table, cause\n // we'll need them to retrieve all the IMM constraints/rules to be\n // applied later.\n var dictuids = $.parseJSON($('#lab_analyses #item_data, #analyses_form #item_data').val());\n $.each(dictuids, function(key, value) { auids.push(key); });\n\n // Retrieve all the rules/constraints to be applied for each analysis\n // by using an ajax call. The json dictionary returned is assigned to\n // the variable mi_constraints for further use.\n // FUTURE: instead of an ajax call to retrieve the dictionary, embed\n // the dictionary in a div when the bika_listing template is rendered.\n $.ajax({\n url: window.portal_url + \"/get_method_instrument_constraints\",\n type: 'POST',\n data: {'_authenticator': $('input[name=\"_authenticator\"]').val(),\n 'uids': $.toJSON(auids) },\n dataType: 'json'\n }).done(function(data) {\n // Save the constraints in the m_constraints variable\n mi_constraints = data;\n $.each(auids, function(index, value) {\n // Apply the constraints/rules to each analysis.\n load_analysis_method_constraint(value, null);\n });\n }).fail(function() {\n window.bika.lims.log(\"bika.lims.worksheet: Something went wrong while retrieving analysis-method-instrument constraints\");\n });\n }\n\n /**\n * Applies the constraints and rules to the specified analysis regarding to\n * the method specified. If method is null, the function assumes the rules\n * must apply for the currently selected method.\n * The function uses the variable mi_constraints to find out which is the\n * rule to be applied to the analysis and method specified.\n * See initializeInstrumentsAndMethods() function for further information\n * about the constraints and rules retrieval and assignment.\n * @param {string} analysis_uid - The Analysis UID\n * @param {string} method_uid - The Method UID. If null, uses the method\n * that is currently selected for the specified analysis.\n */\n function load_analysis_method_constraint(analysis_uid, method_uid) {\n if (method_uid === null) {\n // Assume to load the constraints for the currently selected method\n muid = $('select.listing_select_entry[field=\"Method\"][uid=\"'+analysis_uid+'\"]').val();\n muid = muid ? muid : '';\n load_analysis_method_constraint(analysis_uid, muid);\n return;\n }\n andict = mi_constraints[analysis_uid];\n if (!andict) {\n return;\n }\n constraints = andict[method_uid];\n if (!constraints || constraints.length < 7) {\n return;\n }\n m_selector = $('select.listing_select_entry[field=\"Method\"][uid=\"'+analysis_uid+'\"]');\n i_selector = $('select.listing_select_entry[field=\"Instrument\"][uid=\"'+analysis_uid+'\"]');\n\n // None option in method selector?\n $(m_selector).find('option[value=\"\"]').remove();\n if (constraints[1] == 1) {\n $(m_selector).prepend('<option value=\"\">'+_('Not defined')+'</option>');\n }\n\n // Select the method\n $(m_selector).val(method_uid);\n\n // Method selector visible?\n // 0: no, 1: yes, 2: label, 3: readonly\n $(m_selector).prop('disabled', false);\n $('.method-label[uid=\"'+analysis_uid+'\"]').remove();\n if (constraints[0] === 0) {\n $(m_selector).hide();\n } else if (constraints[0] == 1) {\n $(m_selector).show();\n } else if (constraints[0] == 2) {\n if (andict.length > 1) {\n $(m_selector).hide();\n var method_name = $(m_selector).find('option[value=\"'+method_uid+'\"]').innerHtml();\n $(m_selector).after('<span class=\"method-label\" uid=\"'+analysis_uid+'\" href=\"#\">'+method_name+'</span>');\n }\n } else if (constraints[0] == 3) {\n //$(m_selector).prop('disabled', true);\n $(m_selector).show();\n }\n\n // Populate instruments list\n $(i_selector).find('option').remove();\n console.log(constraints[7]);\n if (constraints[7]) {\n $.each(constraints[7], function(key, value) {\n console.log(key+ \": \"+value);\n $(i_selector).append('<option value=\"'+key+'\">'+value+'</option>');\n });\n }\n\n // None option in instrument selector?\n if (constraints[3] == 1) {\n $(i_selector).prepend('<option value=\"\">'+_('None')+'</option>');\n }\n\n // Select the default instrument\n $(i_selector).val(constraints[4]);\n\n // Instrument selector visible?\n if (constraints[2] === 0) {\n $(i_selector).hide();\n } else if (constraints[2] == 1) {\n $(i_selector).show();\n }\n\n // Allow to edit results?\n if (constraints[5] === 0) {\n $('.interim input[uid=\"'+analysis_uid+'\"]').val('');\n $('input[field=\"Result\"][uid=\"'+analysis_uid+'\"]').val('');\n $('.interim input[uid=\"'+analysis_uid+'\"]').prop('disabled', true);\n $('input[field=\"Result\"][uid=\"'+analysis_uid+'\"]').prop('disabled', true);\n } else if (constraints[5] == 1) {\n $('.interim input[uid=\"'+analysis_uid+'\"]').prop('disabled', false);\n $('input[field=\"Result\"][uid=\"'+analysis_uid+'\"]').prop('disabled', false);\n }\n\n // Info/Warn message?\n $('.alert-instruments-invalid[uid=\"'+analysis_uid+'\"]').remove();\n if (constraints[6] && constraints[6] !== '') {\n $(i_selector).after('<img uid=\"'+analysis_uid+'\" class=\"alert-instruments-invalid\" src=\"'+window.portal_url+'/++resource++bika.lims.images/warning.png\" title=\"'+constraints[6]+'\")\">');\n }\n\n $('.amconstr[uid=\"'+analysis_uid+'\"]').remove();\n //$(m_selector).before(\"<span style='font-weight:bold;font-family:courier;font-size:1.4em;' class='amconstr' uid='\"+analysis_uid+\"'>\"+constraints[10]+\"&nbsp;&nbsp;</span>\");\n }\n\n function loadHeaderEventsHandlers() {\n $(\".manage_results_header .analyst\").change(function(){\n if ($(this).val() == '') {\n return false;\n }\n $.ajax({\n type: 'POST',\n url: window.location.href.replace(\"/manage_results\", \"\") + \"/set_analyst\",\n data: {'value': $(this).val(),\n '_authenticator': $('input[name=\"_authenticator\"]').val()},\n success: function(data, textStatus, jqXHR){\n window.jarn.i18n.loadCatalog(\"plone\");\n _p = jarn.i18n.MessageFactory('plone');\n portalMessage(_p(\"Changes saved.\"));\n }\n });\n });\n\n // Change the results layout\n $(\"#resultslayout_form #resultslayout_button\").hide();\n $(\"#resultslayout_form #resultslayout\").change(function() {\n $(\"#resultslayout_form #resultslayout_button\").click();\n });\n\n $(\".manage_results_header .instrument\").change(function(){\n $(\"#content-core .instrument-error\").remove();\n var instruid = $(this).val();\n if (instruid == '') {\n return false;\n }\n $.ajax({\n type: 'POST',\n url: window.location.href.replace(\"/manage_results\", \"\") + \"/set_instrument\",\n data: {'value': instruid,\n '_authenticator': $('input[name=\"_authenticator\"]').val()},\n success: function(data, textStatus, jqXHR){\n window.jarn.i18n.loadCatalog(\"plone\");\n _p = jarn.i18n.MessageFactory('plone');\n portalMessage(_p(\"Changes saved.\"));\n // Set the selected instrument to all the analyses which\n // that can be done using that instrument. The rest of\n // of the instrument picklist will not be changed\n $('select.listing_select_entry[field=\"Instrument\"] option[value=\"'+instruid+'\"]').parent().find('option[value=\"'+instruid+'\"]').prop(\"selected\", false);\n $('select.listing_select_entry[field=\"Instrument\"] option[value=\"'+instruid+'\"]').prop(\"selected\", true);\n },\n error: function(data, jqXHR, textStatus, errorThrown){\n $(\".manage_results_header .instrument\")\n .closest(\"table\")\n .after(\"<div class='alert instrument-error'>\" +\n _(\"Unable to apply the selected instrument\") + \"</div>\");\n return false;\n }\n });\n });\n }\n\n /**\n * Change the instruments to be shown for an analysis when the method selected changes\n */\n function loadMethodEventHandlers() {\n $('table.bika-listing-table select.listing_select_entry[field=\"Method\"]').change(function() {\n var auid = $(this).attr('uid');\n var muid = $(this).val();\n load_analysis_method_constraint(auid, muid);\n });\n }\n}", "closeUp() {\r\n\t\t$('.report').slideUp(); \r\n\t}", "function closeEmptyPanels(){\n\tif (detailsReadyToClose){\n\t\t$(\"#detailsContainer\").slideUp(\n\t\t\t{\n\t\t\t\tcomplete:function(){\n\t\t\t\t\t$(\"#detailsHeader\").html(\"Vessel details\");\n\t\t\t\t\tdetailsOpen = false;\n\t\t\t\t\t$(\"#detailsPanel\").removeClass(\"arrowUp\");\n\t\t\t\t\t$(\"#detailsPanel\").addClass(\"arrowDown\");\n\t\t\t\t\tcheckForPanelOverflow();\n\t\t\t\t\t$(\"#detailsContainer\").html(\"\");\n\t\t\t\t\tdetailsReadyToClose = false;\n\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n}", "function SPopenmessages(idofdoc)\r\n{\r\n\tdebugger;\r\n\tpreviewmessagesglbl=false;\t\r\n\t$('#SPmyModalmessages').modal({backdrop: 'static', keyboard: false});\r\n\t$(\"#msgesconent\").empty();\r\n\t\r\n\t$(\"#SPdescriptionid\").val(\"\");\r\n\t$('#SPcloseid').attr(\"data-dismiss\",\"modal\");\r\n\t$('#SPcloseid').text(\"Close\");\r\n\t\r\n\tdocumentId=idofdoc;\t\t\r\n\tSPgetdiscussions(documentId,Discussionlist, siteurl,SPgetdiscussionssuccess,SPgetdiscussionsfailure);\r\n\t$(\"#SPlookupdocid\").text(idofdoc);\r\n\tSPgetpermissionsOnclickOpenMsg(documentId);\t\t\t\t\r\n}", "processDeleteList() { // CHANGE\n // Prompt window, slides a dialog\n // must be animated on and off screen\n window.todo.view.showDialog();\n // disable buttons\n document.body.classList.add(\"modal_open\");\n // allow modal and modal buttons to be clicked \n // let dialog = document.getElementById(TodoGUIId.MODAL_YES_NO_DIALOG);\n // dialog.classList.add(\"modal_container_open\");\n }", "function ClearMessagePane() {}", "function buildUI() {\n var _ = this,\n cbs = _.config.callbacks,\n wrapper,\n header,\n content,\n footer,\n dialogPulse = function dialogPulse() {\n _.dialog.classList.add('dlg--pulse');\n setTimeout(function () {\n _.dialog.classList.remove('dlg--pulse');\n }, 200);\n },\n maxSelectCheck = function maxSelectCheck() {\n var checked = content.querySelectorAll('.dlg-select-checkbox:checked');\n if (checked.length === _.config.maxSelect) {\n content.querySelectorAll('.dlg-select-checkbox:not(:checked)').forEach(function (cb) {\n cb.setAttribute('disabled', true);\n cb.parentNode.classList.add('item--disabled');\n });\n if (cbs && cbs.maxReached) cbs.maxReached.call(_, _.config.maxSelect);\n } else {\n content.querySelectorAll('.dlg-select-checkbox:not(:checked)').forEach(function (cb) {\n cb.removeAttribute('disabled');\n cb.parentNode.classList.remove('item--disabled');\n });\n }\n },\n // global event handler\n evtHandler = function evtHandler(e) {\n if (e.type === 'click') {\n // handle overlay click if dialog has no action buttons\n if (e.target.matches('.du-dialog')) {\n if (_.type === vars.buttons.NONE) _.hide();else dialogPulse();\n }\n\n // handle selection item click\n if (e.target.matches('.dlg-select-item')) {\n e.target.querySelector('.dlg-select-lbl').click();\n }\n\n // handle action buttons click\n if (e.target.matches('.dlg-action')) {\n // OK button\n if (e.target.matches('.ok-action')) {\n if (_.config.selection && _.config.multiple) {\n var checked = content.querySelectorAll('.dlg-select-checkbox:checked'),\n checkedVals = [],\n checkedItems = [];\n for (var i = 0; i < checked.length; i++) {\n var item = _.cache[checked[i].id];\n checkedItems.push(item);\n checkedVals.push(typeof item === 'string' ? checked[i].value : item[_.config.valueField]);\n }\n if (checkedVals.length >= _.config.minSelect) {\n _.config.selectedValue = checkedVals;\n if (cbs && cbs.itemSelect) {\n cbs.itemSelect.apply({\n value: checkedVals\n }, [e, checkedItems]);\n _.hide();\n }\n } else {\n dialogPulse();\n if (cbs && cbs.minRequired) cbs.minRequired.call(_, _.config.minSelect);\n }\n } else if (_.config.selection && _.config.confirmSelect) {\n var selected = content.querySelector('.dlg-select-radio:checked');\n if (selected) {\n var _item = _.cache[selected.id];\n _.config.selectedValue = typeof _item === 'string' ? selected.value : _item[_.config.valueField];\n _.hide();\n if (cbs && cbs.itemSelect) cbs.itemSelect.apply(selected, [e, _item]);\n } else dialogPulse();\n } else {\n if (cbs && cbs.okClick) {\n cbs.okClick.apply(_, e);\n if (_.config.hideOnAction) _.hide();\n } else _.hide();\n }\n }\n\n // Yes button\n if (e.target.matches('.yes-action')) {\n if (cbs && cbs.yesClick) {\n cbs.yesClick.apply(_, e);\n if (_.config.hideOnAction) _.hide();\n } else _.hide();\n }\n\n // No button\n if (e.target.matches('.no-action')) {\n if (cbs && cbs.noClick) {\n cbs.noClick.apply(_, e);\n if (_.config.hideOnAction) _.hide();\n } else _.hide();\n }\n\n // CANCEL button\n if (e.target.matches('.cancel-action')) {\n if (cbs && cbs.cancelClick) {\n cbs.cancelClick.apply(_, e);\n if (_.config.hideOnAction) _.hide();\n } else _.hide();\n }\n }\n }\n if (e.type === 'change') {\n // handle selection radio change\n if (e.target.matches('.dlg-select-radio')) {\n var el = e.target;\n if (el.checked && !_.config.confirmSelect) {\n var _item2 = _.cache[el.id];\n _.config.selectedValue = typeof _item2 === 'string' ? el.value : _item2[_.config.valueField];\n _.hide();\n if (cbs && cbs.itemSelect) cbs.itemSelect.apply(el, [e, _item2]);\n }\n } else if (e.target.matches('.dlg-select-checkbox')) {\n if (_.config.maxSelect) maxSelectCheck();\n } else if (e.target.matches('.opt-out-cb')) {\n _.optOut = e.target.checked;\n if (cbs && cbs.optOutChanged) cbs.optOutChanged.call(_, e.target.checked);\n }\n }\n if (e.type === 'scroll') {\n if (e.target.matches('.dlg-content')) e.target.classList[e.target.scrollTop > 5 ? 'add' : 'remove']('content--scrolled');\n }\n if (e.type === 'keyup') {\n if (e.target.matches('.dlg-search')) {\n var _keyword = e.target.value,\n _items = content.querySelectorAll('.dlg-select-item');\n _items.forEach(function (dlgItem) {\n if (dlgItem.classList.contains('select--group')) return;\n var input = dlgItem.querySelector(_.config.multiple ? '.dlg-select-checkbox' : '.dlg-select-radio'),\n item = _.cache[input.id],\n iType = _typeof(item),\n iText = iType === 'string' ? item : item[_.config.textField],\n _matched = false;\n _matched = cbs && cbs.onSearch ? cbs.onSearch.call(_, item, _keyword) : iText.toLowerCase().indexOf(_keyword.toLowerCase()) >= 0;\n dlgItem.classList[_matched ? 'remove' : 'add']('item--nomatch');\n });\n }\n }\n },\n addItemDOM = function addItemDOM(item, id, value, label) {\n var isGroup = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n if (isGroup) {\n var groupEl = createElem('div', {\n className: 'dlg-select-item select--group'\n }, item);\n appendTo(groupEl, content);\n } else {\n var itemEl = createElem('div', {\n className: 'dlg-select-item'\n }),\n selectEl = createElem('input', {\n className: _.config.multiple ? 'dlg-select-checkbox' : 'dlg-select-radio',\n id: id,\n name: 'dlg-selection',\n type: _.config.multiple ? 'checkbox' : 'radio',\n value: value,\n checked: _.config.multiple ? _.config.selectedValue && inArray(_.config.selectedValue, value) : _.config.selectedValue === value\n }),\n labelEl = createElem('label', {\n className: 'dlg-select-lbl',\n htmlFor: id\n }, cbs && cbs.itemRender ? cbs.itemRender.call(_, item) : '<span class=\"select-item\">' + label + '</span>', true);\n _.cache[id] = item;\n appendTo([selectEl, labelEl], itemEl);\n appendTo(itemEl, content);\n }\n },\n addItem = function addItem(item) {\n var type = _typeof(item),\n id = '';\n if (type === 'string') {\n id = (_.config.multiple ? 'dlg-cb' : 'dlg-radio') + removeSpace(item.toString());\n addItemDOM(item, id, item, item);\n } else {\n if (item.group && Array.isArray(item.items)) {\n addItemDOM(item.group, null, null, null, true);\n item.items.forEach(function (i) {\n return addItem(i);\n });\n } else {\n var value = type === 'string' ? item : item[_.config.valueField],\n text = type === 'string' ? item : item[_.config.textField];\n id = (_.config.multiple ? 'dlg-cb' : 'dlg-radio') + removeSpace(value.toString());\n addItemDOM(item, id, value, text);\n }\n }\n };\n _.docFrag = document.createDocumentFragment();\n _.dialog = createElem('div', {\n className: 'du-dialog',\n id: _.config.id\n });\n if (_.config.dark) _.dialog.setAttribute('dark', true);\n if (_.config.selection) _.dialog.setAttribute('selection', true);\n appendTo(_.dialog, _.docFrag);\n wrapper = createElem('div', {\n className: 'dlg-wrapper',\n tabIndex: 0\n });\n\n // dialog loader\n var loader = createElem('div', {\n className: 'dlg-loader'\n });\n var loaderWrapper = createElem('div', {\n className: 'loader-wrapper'\n });\n appendTo(createElem('div', {\n className: 'loading-buffer'\n }), loaderWrapper);\n appendTo(createElem('div', {\n className: 'loading-indicator'\n }), loaderWrapper);\n appendTo(loaderWrapper, loader);\n appendTo(loader, wrapper);\n appendTo(wrapper, _.dialog);\n if (_.title) {\n header = createElem('div', {\n className: 'dlg-header'\n }, _.title);\n appendTo(header, wrapper);\n } else {\n _.dialog.classList.add('dlg--no-title');\n }\n content = createElem('div', {\n className: 'dlg-content'\n });\n if (_.config.selection) {\n if (_.config.allowSearch) {\n appendTo(createElem('input', {\n className: 'dlg-search',\n placeholder: 'Search...'\n }), header);\n }\n _.content.forEach(function (i) {\n return addItem(i);\n });\n if (_.config.multiple && _.config.maxSelect) maxSelectCheck();\n } else content.innerHTML = _.content;\n appendTo(content, wrapper);\n if (_.type !== vars.buttons.NONE) {\n footer = createElem('div', {\n className: 'dlg-actions'\n });\n if (_.config.optOutCb) {\n var cbID = 'opt-out-cb';\n var group = createElem('div', {\n className: 'opt-out-grp'\n });\n appendTo(createElem('input', {\n id: cbID,\n className: cbID,\n type: 'checkbox',\n checked: _.optOut\n }), group);\n appendTo(createElem('label', {\n htmlFor: cbID\n }, _.config.optOutText), group);\n appendTo(group, footer);\n }\n appendTo(footer, wrapper);\n }\n\n /* Setup action buttons */\n switch (_.type) {\n case vars.buttons.OK_CANCEL:\n appendTo([createElem('button', {\n className: 'dlg-action cancel-action',\n tabIndex: 2\n }, _.config.cancelText), createElem('button', {\n className: 'dlg-action ok-action',\n tabIndex: 1\n }, _.config.okText)], footer);\n break;\n case vars.buttons.YES_NO_CANCEL:\n appendTo([createElem('button', {\n className: 'dlg-action cancel-action',\n tabIndex: 3\n }, _.config.cancelText), createElem('button', {\n className: 'dlg-action no-action',\n tabIndex: 2\n }, _.config.noText), createElem('button', {\n className: 'dlg-action yes-action',\n tabIndex: 1\n }, _.config.yesText)], footer);\n break;\n case vars.buttons.DEFAULT:\n appendTo(createElem('button', {\n className: 'dlg-action ok-action',\n tabIndex: 1\n }, _.config.okText), footer);\n break;\n }\n\n /* Register event handler */\n addEvent(content, 'scroll', evtHandler);\n addEvents(_.dialog, ['click', 'change', 'keyup'], evtHandler);\n if (!_.config.init) _.show();\n }", "function selectedData(event) {\n displayProblems();\n}", "function slide_closeMsgBox() {\n slide_hideExifInfos();\n slide_hideOptions();\n slide_hideHelp();\n slide_addBinds();\n return true;\n}", "function onDialogHide(e, data) {\n if (data && data.dialog && data.dialog.activeMetadata && data.dialog.activeMetadata.macroName === 'hideelements-macro') {\n $('.he-form').remove();\n removeMacroBrowserClass();\n }\n} // For the settings template data, we first get the default data and then extend/adapt it to our macro settings.", "function attachFilterExpColClickEvent(){\n $('.proj-filter-exp-collapse-sign').click(function(){\n if($(this).hasClass('proj-filter-exp-collapse-sign-down')){\n $(this).removeClass('proj-filter-exp-collapse-sign-down').addClass('proj-filter-exp-collapse-sign-up');\n //$(this).text('-');\n $(this).parent().find(\"div[name=countries]\").show();\n $(this).parent().find(\"div[name=regions]\").show();\n $(this).parent().find(\"ul\").show();\n $(this).parent().find(\".mContent\").show();\n }\n else{\n $(this).removeClass('proj-filter-exp-collapse-sign-up').addClass('proj-filter-exp-collapse-sign-down');\n //$(this).text('+');\n $(this).parent().find(\"div[name=countries]\").hide();\n $(this).parent().find(\"div[name=regions]\").hide();\n $(this).parent().find(\"ul\").hide();\n $(this).parent().find(\".mContent\").hide();\n }\n });\n \n $('.proj-filter-exp-collapse-text').click(function(){\n \n $(this).parent().find('.proj-filter-exp-collapse-sign').each(function(){\n if($(this).hasClass('proj-filter-exp-collapse-sign-down')){\n $(this).removeClass('proj-filter-exp-collapse-sign-down').addClass('proj-filter-exp-collapse-sign-up');\n //$(this).text('-');\n $(this).parent().find(\"div[name=countries]\").show();\n $(this).parent().find(\"div[name=regions]\").show();\n $(this).parent().find(\"ul\").show();\n $(this).parent().find(\".mContent\").show();\n }\n else{\n $(this).removeClass('proj-filter-exp-collapse-sign-up').addClass('proj-filter-exp-collapse-sign-down');\n //$(this).text('+');\n $(this).parent().find(\"div[name=countries]\").hide();\n $(this).parent().find(\"div[name=regions]\").hide();\n $(this).parent().find(\"ul\").hide();\n $(this).parent().find(\".mContent\").hide();\n }\n });\n });\n //$('#status-filter').children('.proj-filter-exp-collapse-text').click();\n }", "function addEventsCompCUHybridPortfolio(){\n\tdocument.getElementById('summary-li').addEventListener('click',function()\n\t{\n\t\tdocument.getElementById('summary').style.display=\"\";\n\t\tdocument.getElementById('basiccontrol').style.display=\"none\";\n\t\tdocument.getElementById('cprating').style.display=\"none\";\n\t\tdocument.getElementById('auditreadyasmt').style.display=\"none\";\n\t\tdocument.getElementById('riskmsdcommit').style.display=\"none\";\n\t\tdocument.getElementById('auditreview').style.display=\"none\";\n\t\tdocument.getElementById('kctest').style.display=\"none\";\n\t\tdocument.getElementById('opmetric').style.display=\"none\";\n\t\tdocument.getElementById('accountrating').style.display=\"none\";\n\t\tdocument.getElementById('other').style.display=\"none\";\n\n\t\tdocument.getElementById('summary-li').className=\"ibm-active\";\n\t\tdocument.getElementById('basiccontrol-li').className=\"\";\n\t\tdocument.getElementById('cprating-li').className=\"\";\n\t\tdocument.getElementById('auditreadyasmt-li').className=\"\";\n\t\tdocument.getElementById('riskmsdcommit-li').className=\"\";\n\t\tdocument.getElementById('auditreview-li').className=\"\";\n\t\tdocument.getElementById('kctest-li').className=\"\";\n\t\tdocument.getElementById('opmetric-li').className=\"\";\n\t\tdocument.getElementById('accountrating-li').className=\"\";\n\t\tdocument.getElementById('other-li').className=\"\";\n\t},true);\n\tdocument.getElementById('basiccontrol-li').addEventListener('click',function()\n\t{\n\t\tdocument.getElementById('summary').style.display=\"none\";\n\t\tdocument.getElementById('basiccontrol').style.display=\"\";\n\t\tdocument.getElementById('cprating').style.display=\"none\";\n\t\tdocument.getElementById('auditreadyasmt').style.display=\"none\";\n\t\tdocument.getElementById('riskmsdcommit').style.display=\"none\";\n\t\tdocument.getElementById('auditreview').style.display=\"none\";\n\t\tdocument.getElementById('kctest').style.display=\"none\";\n\t\tdocument.getElementById('opmetric').style.display=\"none\";\n\t\tdocument.getElementById('accountrating').style.display=\"none\";\n\t\tdocument.getElementById('other').style.display=\"none\";\n\n\t\tdocument.getElementById('summary-li').className=\"\";\n\t\tdocument.getElementById('basiccontrol-li').className=\"ibm-active\";\n\t\tdocument.getElementById('cprating-li').className=\"\";\n\t\tdocument.getElementById('auditreadyasmt-li').className=\"\";\n\t\tdocument.getElementById('riskmsdcommit-li').className=\"\";\n\t\tdocument.getElementById('auditreview-li').className=\"\";\n\t\tdocument.getElementById('kctest-li').className=\"\";\n\t\tdocument.getElementById('opmetric-li').className=\"\";\n\t\tdocument.getElementById('accountrating-li').className=\"\";\n\t\tdocument.getElementById('other-li').className=\"\";\n\t},true);\n\tdocument.getElementById('cprating-li').addEventListener('click',function()\n\t{\n\t\tdocument.getElementById('summary').style.display=\"none\";\n\t\tdocument.getElementById('basiccontrol').style.display=\"none\";\n\t\tdocument.getElementById('cprating').style.display=\"\";\n\t\tdocument.getElementById('auditreadyasmt').style.display=\"none\";\n\t\tdocument.getElementById('riskmsdcommit').style.display=\"none\";\n\t\tdocument.getElementById('auditreview').style.display=\"none\";\n\t\tdocument.getElementById('kctest').style.display=\"none\";\n\t\tdocument.getElementById('opmetric').style.display=\"none\";\n\t\tdocument.getElementById('accountrating').style.display=\"none\";\n\t\tdocument.getElementById('other').style.display=\"none\";\n\n\t\tdocument.getElementById('summary-li').className=\"\";\n\t\tdocument.getElementById('basiccontrol-li').className=\"\";\n\t\tdocument.getElementById('cprating-li').className=\"ibm-active\";\n\t\tdocument.getElementById('auditreadyasmt-li').className=\"\";\n\t\tdocument.getElementById('riskmsdcommit-li').className=\"\";\n\t\tdocument.getElementById('auditreview-li').className=\"\";\n\t\tdocument.getElementById('kctest-li').className=\"\";\n\t\tdocument.getElementById('opmetric-li').className=\"\";\n\t\tdocument.getElementById('accountrating-li').className=\"\";\n\t\tdocument.getElementById('other-li').className=\"\";\n\t},true);\n\tdocument.getElementById('auditreadyasmt-li').addEventListener('click',function()\n\t{\n\t\tdocument.getElementById('summary').style.display=\"none\";\n\t\tdocument.getElementById('basiccontrol').style.display=\"none\";\n\t\tdocument.getElementById('cprating').style.display=\"none\";\n\t\tdocument.getElementById('auditreadyasmt').style.display=\"\";\n\t\tdocument.getElementById('riskmsdcommit').style.display=\"none\";\n\t\tdocument.getElementById('auditreview').style.display=\"none\";\n\t\tdocument.getElementById('kctest').style.display=\"none\";\n\t\tdocument.getElementById('opmetric').style.display=\"none\";\n\t\tdocument.getElementById('accountrating').style.display=\"none\";\n\t\tdocument.getElementById('other').style.display=\"none\";\n\n\t\tdocument.getElementById('summary-li').className=\"\";\n\t\tdocument.getElementById('basiccontrol-li').className=\"\";\n\t\tdocument.getElementById('cprating-li').className=\"\";\n\t\tdocument.getElementById('auditreadyasmt-li').className=\"ibm-active\";\n\t\tdocument.getElementById('riskmsdcommit-li').className=\"\";\n\t\tdocument.getElementById('auditreview-li').className=\"\";\n\t\tdocument.getElementById('kctest-li').className=\"\";\n\t\tdocument.getElementById('opmetric-li').className=\"\";\n\t\tdocument.getElementById('accountrating-li').className=\"\";\n\t\tdocument.getElementById('other-li').className=\"\";\n\t},true);\n\tdocument.getElementById('riskmsdcommit-li').addEventListener('click',function()\n\t{\n\t\tdocument.getElementById('summary').style.display=\"none\";\n\t\tdocument.getElementById('basiccontrol').style.display=\"none\";\n\t\tdocument.getElementById('cprating').style.display=\"none\";\n\t\tdocument.getElementById('auditreadyasmt').style.display=\"none\";\n\t\tdocument.getElementById('riskmsdcommit').style.display=\"\";\n\t\tdocument.getElementById('auditreview').style.display=\"none\";\n\t\tdocument.getElementById('kctest').style.display=\"none\";\n\t\tdocument.getElementById('opmetric').style.display=\"none\";\n\t\tdocument.getElementById('accountrating').style.display=\"none\";\n\t\tdocument.getElementById('other').style.display=\"none\";\n\n\t\tdocument.getElementById('summary-li').className=\"\";\n\t\tdocument.getElementById('basiccontrol-li').className=\"\";\n\t\tdocument.getElementById('cprating-li').className=\"\";\n\t\tdocument.getElementById('auditreadyasmt-li').className=\"\";\n\t\tdocument.getElementById('riskmsdcommit-li').className=\"ibm-active\";\n\t\tdocument.getElementById('auditreview-li').className=\"\";\n\t\tdocument.getElementById('kctest-li').className=\"\";\n\t\tdocument.getElementById('opmetric-li').className=\"\";\n\t\tdocument.getElementById('accountrating-li').className=\"\";\n\t\tdocument.getElementById('other-li').className=\"\";\n\t},true);\n\tdocument.getElementById('auditreview-li').addEventListener('click',function()\n\t{\n\t\tdocument.getElementById('summary').style.display=\"none\";\n\t\tdocument.getElementById('basiccontrol').style.display=\"none\";\n\t\tdocument.getElementById('cprating').style.display=\"none\";\n\t\tdocument.getElementById('auditreadyasmt').style.display=\"none\";\n\t\tdocument.getElementById('riskmsdcommit').style.display=\"none\";\n\t\tdocument.getElementById('auditreview').style.display=\"\";\n\t\tdocument.getElementById('kctest').style.display=\"none\";\n\t\tdocument.getElementById('opmetric').style.display=\"none\";\n\t\tdocument.getElementById('accountrating').style.display=\"none\";\n\t\tdocument.getElementById('other').style.display=\"none\";\n\n\t\tdocument.getElementById('summary-li').className=\"\";\n\t\tdocument.getElementById('basiccontrol-li').className=\"\";\n\t\tdocument.getElementById('cprating-li').className=\"\";\n\t\tdocument.getElementById('auditreadyasmt-li').className=\"\";\n\t\tdocument.getElementById('riskmsdcommit-li').className=\"\";\n\t\tdocument.getElementById('auditreview-li').className=\"ibm-active\";\n\t\tdocument.getElementById('kctest-li').className=\"\";\n\t\tdocument.getElementById('opmetric-li').className=\"\";\n\t\tdocument.getElementById('accountrating-li').className=\"\";\n\t\tdocument.getElementById('other-li').className=\"\";\n\t},true);\n\tdocument.getElementById('kctest-li').addEventListener('click',function()\n\t{\n\t\tdocument.getElementById('summary').style.display=\"none\";\n\t\tdocument.getElementById('basiccontrol').style.display=\"none\";\n\t\tdocument.getElementById('cprating').style.display=\"none\";\n\t\tdocument.getElementById('auditreadyasmt').style.display=\"none\";\n\t\tdocument.getElementById('riskmsdcommit').style.display=\"none\";\n\t\tdocument.getElementById('auditreview').style.display=\"none\";\n\t\tdocument.getElementById('kctest').style.display=\"\";\n\t\tdocument.getElementById('opmetric').style.display=\"none\";\n\t\tdocument.getElementById('accountrating').style.display=\"none\";\n\t\tdocument.getElementById('other').style.display=\"none\";\n\n\t\tdocument.getElementById('summary-li').className=\"\";\n\t\tdocument.getElementById('basiccontrol-li').className=\"\";\n\t\tdocument.getElementById('cprating-li').className=\"\";\n\t\tdocument.getElementById('auditreadyasmt-li').className=\"\";\n\t\tdocument.getElementById('riskmsdcommit-li').className=\"\";\n\t\tdocument.getElementById('auditreview-li').className=\"\";\n\t\tdocument.getElementById('kctest-li').className=\"ibm-active\";\n\t\tdocument.getElementById('opmetric-li').className=\"\";\n\t\tdocument.getElementById('accountrating-li').className=\"\";\n\t\tdocument.getElementById('other-li').className=\"\";\n\t},true);\n\tdocument.getElementById('opmetric-li').addEventListener('click',function()\n\t{\n\t\tdocument.getElementById('summary').style.display=\"none\";\n\t\tdocument.getElementById('basiccontrol').style.display=\"none\";\n\t\tdocument.getElementById('cprating').style.display=\"none\";\n\t\tdocument.getElementById('auditreadyasmt').style.display=\"none\";\n\t\tdocument.getElementById('riskmsdcommit').style.display=\"none\";\n\t\tdocument.getElementById('auditreview').style.display=\"none\";\n\t\tdocument.getElementById('kctest').style.display=\"none\";\n\t\tdocument.getElementById('opmetric').style.display=\"\";\n\t\tdocument.getElementById('accountrating').style.display=\"none\";\n\t\tdocument.getElementById('other').style.display=\"none\";\n\n\t\tdocument.getElementById('summary-li').className=\"\";\n\t\tdocument.getElementById('basiccontrol-li').className=\"\";\n\t\tdocument.getElementById('cprating-li').className=\"\";\n\t\tdocument.getElementById('auditreadyasmt-li').className=\"\";\n\t\tdocument.getElementById('riskmsdcommit-li').className=\"\";\n\t\tdocument.getElementById('auditreview-li').className=\"\";\n\t\tdocument.getElementById('kctest-li').className=\"\";\n\t\tdocument.getElementById('opmetric-li').className=\"ibm-active\";\n\t\tdocument.getElementById('accountrating-li').className=\"\";\n\t\tdocument.getElementById('other-li').className=\"\";\n\t},true);\n\tdocument.getElementById('accountrating-li').addEventListener('click',function()\n\t{\n\t\tdocument.getElementById('summary').style.display=\"none\";\n\t\tdocument.getElementById('basiccontrol').style.display=\"none\";\n\t\tdocument.getElementById('cprating').style.display=\"none\";\n\t\tdocument.getElementById('auditreadyasmt').style.display=\"none\";\n\t\tdocument.getElementById('riskmsdcommit').style.display=\"none\";\n\t\tdocument.getElementById('auditreview').style.display=\"none\";\n\t\tdocument.getElementById('kctest').style.display=\"none\";\n\t\tdocument.getElementById('opmetric').style.display=\"none\";\n\t\tdocument.getElementById('accountrating').style.display=\"\";\n\t\tdocument.getElementById('other').style.display=\"none\";\n\n\t\tdocument.getElementById('summary-li').className=\"\";\n\t\tdocument.getElementById('basiccontrol-li').className=\"\";\n\t\tdocument.getElementById('cprating-li').className=\"\";\n\t\tdocument.getElementById('auditreadyasmt-li').className=\"\";\n\t\tdocument.getElementById('riskmsdcommit-li').className=\"\";\n\t\tdocument.getElementById('auditreview-li').className=\"\";\n\t\tdocument.getElementById('kctest-li').className=\"\";\n\t\tdocument.getElementById('opmetric-li').className=\"\";\n\t\tdocument.getElementById('accountrating-li').className=\"ibm-active\";\n\t\tdocument.getElementById('other-li').className=\"\";\n\t},true);\n\tdocument.getElementById('other-li').addEventListener('click',function()\n\t{\n\t\tdocument.getElementById('summary').style.display=\"none\";\n\t\tdocument.getElementById('basiccontrol').style.display=\"none\";\n\t\tdocument.getElementById('cprating').style.display=\"none\";\n\t\tdocument.getElementById('auditreadyasmt').style.display=\"none\";\n\t\tdocument.getElementById('riskmsdcommit').style.display=\"none\";\n\t\tdocument.getElementById('auditreview').style.display=\"none\";\n\t\tdocument.getElementById('kctest').style.display=\"none\";\n\t\tdocument.getElementById('opmetric').style.display=\"none\";\n\t\tdocument.getElementById('accountrating').style.display=\"none\";\n\t\tdocument.getElementById('other').style.display=\"\";\n\n\t\tdocument.getElementById('summary-li').className=\"\";\n\t\tdocument.getElementById('basiccontrol-li').className=\"\";\n\t\tdocument.getElementById('cprating-li').className=\"\";\n\t\tdocument.getElementById('auditreadyasmt-li').className=\"\";\n\t\tdocument.getElementById('riskmsdcommit-li').className=\"\";\n\t\tdocument.getElementById('auditreview-li').className=\"\";\n\t\tdocument.getElementById('kctest-li').className=\"\";\n\t\tdocument.getElementById('opmetric-li').className=\"\";\n\t\tdocument.getElementById('accountrating-li').className=\"\";\n\t\tdocument.getElementById('other-li').className=\"ibm-active\";\n\t},true);\n}", "delegateEvents() {\n this.on(ACTION.MOLE.HIDE, (indexList, silent) => {\n if (typeof indexList === \"number\") { throw new Error('ACTION.MOLE.HIDE takes an array of ids'); }\n indexList.forEach(this.hideMole.bind(this, silent));\n });\n this.on(ACTION.MOLE.SHOW, (indexList, silent) => {\n if (typeof indexList === \"number\") { throw new Error('ACTION.MOLE.SHOW takes an array of ids'); }\n indexList.forEach(this.showMole.bind(this, silent));\n });\n\n this.on(ACTION.CLICKED, this.onClick.bind(this));\n }", "function changeTourMessage() {\n\n $('#paraTourMsg').html(tourMessageList[tourIdList]);\n CreateEvent();\n }", "function buttonEvents() {\n $(document).on(\"click\", \".isDistanced\", function () {\n isDistanced = $(this).is(':checked') ? 1 : 0; // replace with true value\n console.log(\"change made\");\n });\n\n\n $(document).on(\"click\", \".editBtn\", function () {\n mode = \"edit\";\n markSelected(this);\n $(\"#editDiv\").show();\n $(\"#editDiv :input\").prop(\"disabled\", false); // edit mode: enable all controls in the form\n\n populateFields(this.getAttribute('data-itemId')); // fill the form fields according to the selected row\n });\n\n $(document).on(\"click\", \".viewBtn\", function () {\n mode = \"view\";\n markSelected(this);\n $(\"#editDiv\").show();\n row.className = 'selected';\n $(\"#editDiv :input\").attr(\"disabled\", \"disabled\"); // view mode: disable all controls in the form\n populateFields(this.getAttribute('data-itemId'));\n });\n\n $(document).on(\"click\", \".deleteBtn\", function () {\n mode = \"delete\";\n markSelected(this);\n var itemId = this.getAttribute('data-itemId');\n swal({ // this will open a dialouge \n title: \"Are you sure ??\",\n text: \"\",\n icon: \"warning\",\n buttons: true,\n dangerMode: true\n })\n .then(function (willDelete) {\n if (willDelete) DeleteItem(itemId);\n else swal(\"Not Deleted!\");\n });\n });\n\n }", "function alertNewText() {\n // only show an alert if the visitor is not currently selected\n var flashSpeed = 1000;\n var on = true;\n (function flashRow() {\n if (!that.isSelected) {\n if (on) {\n that.row.className = 'maqaw-alert-visitor';\n } else {\n that.row.className = 'maqaw-visitor-list-entry';\n }\n on = !on;\n setTimeout(flashRow, flashSpeed);\n }\n })();\n\n }", "closeSUDets() {\n this.setState({isSUDetsVisible: false, isReservDetsVisible: false, canExtendSUList: true, canShrinkSUList: false});\n }", "function onShowWemsAlarmSummaryModal() {\r\n showMoreAlarmSummaryData(true);\r\n }", "function showMore(ev)\n{\n if (!ev)\n ev = window.event;\n ev.stopPropagation();\n\n let form = this.form;\n let layoutTable = document.getElementById('layoutTable');\n let tableBody = layoutTable.tBodies[0];\n let oldRow; // existing row to delete\n let newRow; // new row to delete\n let ie; // index through children of a node\n let cell; // cell within a table row\n let elt = null; // an HTML Element\n\n let idir = form.idir.value;\n let parms = {'idir' : idir,\n 'template' : '',\n 'userRef' :\n document.getElementById('HideUserRef').value,\n 'ancestralRef' :\n document.getElementById('HideAncestralRef').value};\n if (oldRow)\n { // hide expanded form\n oldRow = document.getElementById('NotesRow');\n tableBody.removeChild(oldRow);\n\n oldRow = document.getElementById('PrivateRow');\n tableBody.removeChild(oldRow);\n\n this.innerHTML = 'Show More Options';\n } // hide expanded form\n else\n { // display expanded form\n // add row with options to edit Medical and Research Notes\n newRow = createFromTemplate(\"NotesRow$template\",\n parms,\n null);\n newRow = tableBody.appendChild(newRow);\n for(ie = 0; ie < newRow.childNodes.length; ie++)\n { // loop through cells of row\n cell = newRow.childNodes[ie];\n cell.onmouseover = eltMouseOver;\n cell.onmouseout = eltMouseOut;\n } // loop through cells of row\n\n // activate functionality of buttons\n elt = document.getElementById('Detail7');\n elt.addEventListener('click', editEventIndiv);\n elt = document.getElementById('Detail8');\n elt.addEventListener('click', editEventIndiv);\n\n // add row with option to hide information about this individual\n newRow = createFromTemplate(\"PrivateRow$template\",\n parms,\n null);\n newRow =tableBody.appendChild(newRow);\n for(ie = 0; ie < newRow.childNodes.length; ie++)\n { // loop through cells of row\n cell = newRow.childNodes[ie];\n cell.onmouseover = eltMouseOver;\n cell.onmouseout = eltMouseOut;\n } // loop through cells of row\n\n // initialize checkbox\n elt = document.getElementById('PrivateCheckBox');\n value = document.getElementById('Private').value;\n if (value == '1')\n elt.checked = true;\n\n // add row with user and ancestral file reference numbers\n newRow = createFromTemplate(\"RefRow$template\",\n parms,\n null);\n newRow =tableBody.appendChild(newRow);\n for(ie = 0; ie < newRow.childNodes.length; ie++)\n { // loop through cells of row\n cell = newRow.childNodes[ie];\n cell.onmouseover = eltMouseOver;\n cell.onmouseout = eltMouseOut;\n } // loop through cells of row\n\n\n this.innerHTML = 'Hide Extra Options';\n } // display expanded form\n\n}", "function ciniki_events_registrations() {\n //\n // events panel\n //\n this.menu = new M.panel('Events', 'ciniki_events_registrations', 'menu', 'mc', 'medium narrowaside', 'sectioned', 'ciniki.events.registrations.menu');\n this.menu.event_id = 0;\n this.menu.price_id = 0;\n this.menu.sections = {\n// 'search':{'label':'', 'type':'livesearch'},\n 'prices':{'label':'Prices', 'type':'simplegrid', 'num_cols':1, 'aside':'yes',\n },\n '_buttons':{'label':'', 'aside':'yes', 'buttons':{\n// 'registrationspdf':{'label':'Registration List (PDF)', 'fn':'M.ciniki_courses_registrations.offeringRegistrationsPDF(M.ciniki_courses_registrations.menu.offering_id);'},\n 'registrationsexcel':{'label':'Registration List (Excel)', 'fn':'M.ciniki_events_registrations.menu.excel();'},\n 'individualtickets':{'label':'Tickets List (Excel)', \n 'visible':function() { return M.modFlagOn('ciniki.events', 0x08); },\n 'fn':'M.ciniki_events_registrations.menu.individualtickets();'},\n 'email':{'label':'Email Customers', \n 'fn':'M.ciniki_events_registrations.menu.emailCustomers();'},\n }},\n 'registrations':{'label':'Registrations', 'type':'simplegrid', 'num_cols':3,\n 'sortable':'yes',\n 'sortTypes':['text', 'number', 'text'],\n 'cellClasses':['multiline', 'multiline', 'multiline'],\n 'addTxt':'Add Registration',\n 'addFn':'M.ciniki_events_registrations.edit.addCustomer(\\'M.ciniki_events_registrations.menu.open();\\',M.ciniki_events_registrations.menu.event_id);',\n },\n };\n this.menu.cellValue = function(s, i, j, d) {\n if( s == 'prices' ) {\n return M.textCount(d.label, d.num_tickets);\n }\n if( s == 'registrations' ) {\n switch(j) {\n case 0: return '<span class=\"maintext\">' + d.customer_name + '</span><span class=\"subtext\">' + d.customer_notes + '</span>';\n case 1: return '<span class=\"maintext\">' + d.num_tickets + '</span>';\n case 2: \n var txt = '';\n if( (M.curTenant.modules['ciniki.events'].flags&0x04)>0 ) {\n txt += '<span class=\"maintext\">' + d.status_text + '</span>';\n } \n if( M.curTenant.modules['ciniki.sapos'] != null ) {\n if( txt != '' ) {\n txt += '<span class=\"subtext\">' + d.invoice_status_text + '</span>';\n } else {\n txt += '<span class=\"maintext\">' + d.invoice_status_text + '</span>';\n }\n }\n return txt;\n }\n }\n };\n this.menu.sectionData = function(s) {\n return this.data[s];\n };\n this.menu.rowFn = function(s, i, d) {\n if( s == 'prices' ) {\n return 'M.ciniki_events_registrations.menu.selectPrice(' + d.id + ');'; \n } \n if( s == 'registrations' ) {\n return 'M.ciniki_events_registrations.edit.open(\\'M.ciniki_events_registrations.menu.open();\\',null,null,\\'' + d.id + '\\');';\n }\n };\n this.menu.rowClass = function(s, i, d) {\n if( d.id == this.price_id ) {\n return 'highlight';\n }\n return '';\n }\n this.menu.emailCustomers = function() {\n var customers = [];\n for(var i in this.data.registrations) {\n customers[i] = {\n 'id':this.data.registrations[i].customer_id,\n 'name':this.data.registrations[i].customer_name,\n };\n }\n M.startApp('ciniki.mail.omessage',\n null,\n 'M.ciniki_events_registrations.menu.open();',\n 'mc',\n {'subject':'Re: Membership',\n 'list':customers, \n 'removeable':'yes',\n });\n }\n this.menu.selectPrice = function(id) {\n this.open(null,null,id);\n }\n this.menu.open = function(cb, eid, pid) {\n this.data = {};\n if( eid != null ) { this.event_id = eid; }\n if( pid != null ) { this.price_id = pid; }\n M.api.getJSONCb('ciniki.events.registrationList', {'tnid':M.curTenantID, \n 'event_id':this.event_id, 'price_id':this.price_id, }, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_events_registrations.menu;\n p.data = rsp;\n if( rsp.registrations.length > 0 ) {\n p.sections.registrations.headerValues = ['Name', 'Tickets', 'Status'];\n } else {\n p.sections.registrations.headerValues = null;\n }\n if( M.curTenant.modules['ciniki.sapos'] != null || (M.curTenant.modules['ciniki.events'].flags&0x04) > 0 ) {\n p.sections.registrations.num_cols = 3;\n } else {\n p.sections.registrations.num_cols = 2;\n }\n p.refresh();\n p.show(cb);\n });\n };\n this.menu.excel = function() {\n M.api.openFile('ciniki.events.eventRegistrations', {'tnid':M.curTenantID, 'output':'excel', 'event_id':this.event_id, 'price_id':this.price_id});\n }\n this.menu.individualtickets = function() {\n M.api.openFile('ciniki.events.eventRegistrations', {'tnid':M.curTenantID, 'output':'exceltickets', 'event_id':this.event_id, 'price_id':this.price_id});\n }\n this.menu.addButton('add', 'Add', 'M.ciniki_events_registrations.edit.addCustomer(\\'M.ciniki_events_registrations.menu.open();\\',M.ciniki_events_registrations.menu.event_id);');\n this.menu.addClose('Back');\n\n //\n // The panel for editing a registrant\n //\n this.edit = new M.panel('Registrant', 'ciniki_events_registrations', 'edit', 'mc', 'medium mediumaside', 'sectioned', 'ciniki.events.registrations.edit');\n this.edit.data = null;\n this.edit.customer_id = 0;\n this.edit.event_id = 0;\n this.edit.registration_id = 0;\n this.edit.sections = { \n 'customer_details':{'label':'Customer', 'type':'simplegrid', 'num_cols':2, 'aside':'yes',\n 'cellClasses':['label',''],\n 'addTxt':'Edit',\n 'addFn':'M.startApp(\\'ciniki.customers.edit\\',null,\\'M.ciniki_events_registrations.edit.updateCustomer(null);\\',\\'mc\\',{\\'next\\':\\'M.ciniki_events_registrations.edit.updateCustomer\\',\\'customer_id\\':M.ciniki_events_registrations.edit.customer_id});',\n },\n 'invoice':{'label':'Invoice', 'visible':'no', 'type':'simplegrid', 'num_cols':5,\n 'headerValues':['Invoice #', 'Date', 'Customer', 'Amount', 'Status'],\n 'cellClasses':['',''],\n// 'addTxt':'',\n// 'addFn':'M.ciniki_events_registrations.edit.save(\\'yes\\');',\n// 'addFn':'M.startApp(\\'ciniki.sapos.invoice\\',null,\\'M.ciniki_events_registrations.edit.open();\\',\\'mc\\',{\\'customer_id\\':M.ciniki_events_registrations.edit.customer_id});',\n },\n 'registration':{'label':'Registration', 'fields':{\n 'status':{'label':'Status', 'active':'no', 'type':'toggle', 'default':'10', 'toggles':{'10':'Reserved', '20':'Confirmed', '30':'Paid'}},\n 'num_tickets':{'label':'Number of Tickets', 'type':'text', 'size':'small'},\n 'price_id':{'label':'Price', 'type':'select', 'active':'no', 'options':{}},\n }},\n '_customer_notes':{'label':'Customer Notes', 'fields':{\n 'customer_notes':{'label':'', 'hidelabel':'yes', 'hint':'', 'size':'small', 'type':'textarea'},\n }},\n '_notes':{'label':'Private Notes', 'fields':{\n 'notes':{'label':'', 'hidelabel':'yes', 'hint':'', 'size':'small', 'type':'textarea'},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Save', 'fn':'M.ciniki_events_registrations.edit.save();'},\n 'saveandinvoice':{'label':'Save and Invoice', 'fn':'M.ciniki_events_registrations.edit.save(\\'yes\\');'},\n 'delete':{'label':'Delete', 'fn':'M.ciniki_events_registrations.edit.remove();'},\n }},\n }; \n this.edit.fieldValue = function(s, i, d) { return this.data[i]; }\n this.edit.fieldHistoryArgs = function(s, i) {\n return {'method':'ciniki.events.registrationHistory', 'args':{'tnid':M.curTenantID, \n 'registration_id':this.registration_id, 'event_id':this.event_id, 'field':i}};\n }\n this.edit.sectionData = function(s) {\n if( s == 'invoice' ) { return this.data[s]!=null?{'invoice':this.data[s]}:{}; }\n return this.data[s];\n }\n this.edit.cellValue = function(s, i, j, d) {\n if( s == 'customer_details' ) {\n switch(j) {\n case 0: return d.detail.label;\n case 1: return d.detail.value.replace(/\\n/, '<br/>');\n }\n } \n if( s == 'invoice' ) {\n switch(j) {\n case 0: return d.invoice_number;\n case 1: return d.invoice_date;\n case 2: return (d.customer!=null&&d.customer.display_name!=null)?d.customer.display_name:'';\n case 3: return d.total_amount_display;\n case 4: return d.payment_status_text;\n }\n }\n };\n this.edit.rowFn = function(s, i, d) { \n if( s == 'invoice' ) { return 'M.startApp(\\'ciniki.sapos.invoice\\',null,\\'M.ciniki_events_registrations.edit.open();\\',\\'mc\\',{\\'invoice_id\\':\\'' + d.id + '\\'});'; }\n return ''; \n };\n this.edit.open = function(cb, cid, eid, rid) {\n this.reset();\n if( cid != null ) { this.customer_id = cid; }\n if( eid != null ) { this.event_id = eid; }\n if( rid != null ) { this.registration_id = rid; }\n\n // Check if this is editing a existing registration or adding a new one\n if( this.registration_id > 0 ) {\n this.sections._buttons.buttons.delete.visible = 'yes';\n M.api.getJSONCb('ciniki.events.registrationGet', {'tnid':M.curTenantID, \n 'registration_id':this.registration_id, 'customer':'yes', 'invoice':'yes'}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_events_registrations.edit;\n p.data = rsp.registration;\n p.event_id = rsp.registration.event_id;\n p.customer_id = rsp.registration.customer_id;\n p.sections.invoice.visible=(M.curTenant.modules['ciniki.sapos']!=null)?'yes':'no';\n p.sections._buttons.buttons.saveandinvoice.visible=(M.curTenant.modules['ciniki.sapos']!=null&&rsp.registration.invoice_id==0)?'yes':'no';\n p.event_id = rsp.registration.event_id;\n if( M.modOn('ciniki.sapos') ) {\n p.sections.registration.fields.price_id.active = 'yes';\n p.sections.registration.fields.price_id.options = {};\n if( rsp.registration.prices != null ) {\n for(var i in rsp.registration.prices) {\n p.sections.registration.fields.price_id.options[rsp.registration.prices[i].id] = rsp.registration.prices[i].name + ' ' + rsp.registration.prices[i].unit_amount_display;\n }\n }\n } else {\n p.sections.registration.fields.price_id.active = 'no';\n }\n// p.sections.registration.fields.price_id.active = (M.curTenant.modules['ciniki.events'].flags&0x04)>0?'yes':'no';\n p.refresh();\n p.show(cb);\n });\n } else if( this.customer_id > 0 ) {\n this.sections._buttons.buttons.delete.visible = 'no';\n M.api.getJSONCb('ciniki.customers.customerDetails', {'tnid':M.curTenantID, \n 'customer_id':this.customer_id, 'phones':'yes', 'emails':'yes'}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_events_registrations.edit;\n p.data = {'customer_details':rsp.details};\n p.sections._buttons.buttons.saveandinvoice.visible = (M.curTenant.modules['ciniki.sapos']!=null)?'yes':'no';\n p.refresh();\n p.show(cb);\n });\n }\n };\n this.edit.save = function(inv) {\n var quantity = this.formFieldValue(this.sections.registration.fields.num_tickets, 'num_tickets');\n var price_id = 0;\n if( M.modOn('ciniki.sapos') ) {\n price_id = this.formValue('price_id');\n }\n if( this.registration_id > 0 ) {\n var c = this.serializeForm('no');\n if( this.data.customer_id != this.customer_id ) {\n c += 'customer_id=' + this.customer_id + '&';\n }\n if( c != '' ) {\n M.api.postJSONCb('ciniki.events.registrationUpdate', \n {'tnid':M.curTenantID, \n 'registration_id':M.ciniki_events_registrations.edit.registration_id}, c,\n function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n } \n var p = M.ciniki_events_registrations.edit;\n if( inv != null && inv == 'yes' ) {\n p.newInvoice(this.registration_id, price_id, quantity);\n// M.ciniki_events_registrations.newinvoice.open('M.ciniki_events_registrations.edit.open(null,null,'+p.registration_id+',null);', p.event_id, p.customer_id, p.registration_id, quantity);\n } else {\n p.close();\n }\n });\n } else {\n if( inv != null && inv == 'yes' ) {\n this.newInvoice(this.registration_id, price_id, quantity);\n// M.ciniki_events_registrations.newinvoice.open('M.ciniki_events_registrations.edit.open(null,null,'+this.registration_id+',null);', this.event_id, this.customer_id, this.registration_id, quantity);\n } else {\n this.close();\n }\n }\n } else {\n var c = this.serializeForm('yes');\n M.api.postJSONCb('ciniki.events.registrationAdd', \n {'tnid':M.curTenantID, 'event_id':this.event_id,\n 'customer_id':this.customer_id}, c, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n } \n if( inv != null && inv == 'yes' ) {\n M.ciniki_events_registrations.edit.newInvoice(this.registration_id, price_id, quantity);\n// M.ciniki_events_registrations.newinvoice.open(M.ciniki_events_registrations.edit.cb'M.ciniki_events_registrations.edit.open(null,null,'+rsp.id+',null);', M.ciniki_events_registrations.edit.event_id, M.ciniki_events_registrations.edit.customer_id, rsp.id, quantity);\n// M.ciniki_events_registrations.newinvoice.open(M.ciniki_events_registrations.edit.cb, M.ciniki_events_registrations.edit.event_id, M.ciniki_events_registrations.edit.customer_id, rsp.id, quantity);\n } else {\n M.ciniki_events_registrations.edit.close();\n }\n });\n }\n };\n this.edit.newInvoice = function(registration_id, price_id, quantity) {\n var items = [];\n items[0] = {\n 'status':0,\n 'object':'ciniki.events.registration',\n 'object_id':registration_id,\n 'price_id':price_id,\n 'description':'',\n 'quantity':quantity,\n 'unit_amount':0,\n 'unit_discount_amount':0,\n 'unit_discount_percentage':0,\n 'taxtype_id':0,\n 'notes':'',\n };\n // Find the price selected\n for(i in this.data.prices) {\n if( this.data.prices[i].id == price_id ) {\n items[0].price_id = this.data.prices[i].id;\n items[0].code = '';\n items[0].description = this.data.prices[i].event_name + (this.data.prices[i].name!=''?' - '+this.data.prices[i].name:'');\n items[0].unit_amount = this.data.prices[i].unit_amount;\n items[0].unit_discount_amount = this.data.prices[i].unit_discount_amount;\n items[0].unit_discount_percentage = this.data.prices[i].unit_discount_percentage;\n items[0].taxtype_id = this.data.prices[i].taxtype_id;\n items[0].flags = 0x20;\n }\n }\n M.startApp('ciniki.sapos.invoice',null,'M.ciniki_events_registrations.edit.open(null,null,' + registration_id + ');','mc',{'customer_id':this.customer_id,'items':items});\n }\n this.edit.remove = function() {\n M.confirm(\"Are you sure you want to remove this registration?\",null,function() {\n M.api.getJSONCb('ciniki.events.registrationDelete', {'tnid':M.curTenantID, 'registration_id':M.ciniki_events_registrations.edit.registration_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n M.ciniki_events_registrations.edit.close(); \n });\n });\n };\n this.edit.updateCustomer = function(cid) {\n if( cid != null && this.customer_id != cid ) {\n this.customer_id = cid;\n }\n if( this.customer_id > 0 ) {\n M.api.getJSONCb('ciniki.customers.customerDetails', {'tnid':M.curTenantID, 'customer_id':this.customer_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_events_registrations.edit;\n p.data.customer = rsp.details;\n p.refreshSection('customer_details');\n p.show();\n });\n } \n };\n this.edit.addCustomer = function(cb, eid) {\n // Setup the edit panel for when the customer edit returns\n if( cb != null ) { this.cb = cb; }\n if( eid != null ) { this.event_id = eid; }\n M.startApp('ciniki.customers.edit',null,cb,'mc',{'next':'M.ciniki_events_registrations.edit.openFromCustomer','customer_id':0});\n };\n this.edit.openFromCustomer = function(cid) {\n this.open(this.cb, cid, this.event_id, 0);\n };\n this.edit.addButton('save', 'Save', 'M.ciniki_events_registrations.edit.save();');\n this.edit.addClose('Cancel');\n\n //\n // The add invoice panel, which display the price list for quantity\n //\n this.newinvoice = new M.panel('Create Invoice', 'ciniki_events_registrations', 'newinvoice', 'mc', 'medium', 'sectioned', 'ciniki.events.registrations.newinvoice');\n this.newinvoice.data = null;\n this.newinvoice.customer_id = 0;\n this.newinvoice.event_id = 0;\n this.newinvoice.registration_id = 0;\n this.newinvoice.quantity = 1;\n this.newinvoice.sections = {\n 'prices':{'label':'Price List', 'fields':{\n 'price_id':{'label':'Price', 'type':'select', 'options':{}},\n }},\n '_buttons':{'label':'', 'buttons':{\n 'save':{'label':'Create Invoice', 'fn':'M.ciniki_events_registrations.newinvoice.createInvoice();'},\n }},\n };\n this.newinvoice.fieldValue = function(s, i, d) { return this.data[i]; }\n this.newinvoice.open = function(cb, eid, cid, rid, quantity) {\n if( eid != null ) { this.event_id = eid; }\n if( cid != null ) { this.customer_id = cid; }\n if( rid != null ) { this.registration_id = rid; }\n if( quantity != null ) { this.quantity = quantity; }\n M.api.getJSONCb('ciniki.events.eventPriceList', {'tnid':M.curTenantID, 'event_id':this.event_id}, function(rsp) {\n if( rsp.stat != 'ok' ) {\n M.api.err(rsp);\n return false;\n }\n var p = M.ciniki_events_registrations.newinvoice;\n p.prices = rsp.prices;\n p.data = {'price_id':0};\n // Setup the price list\n p.sections.prices.fields.price_id.options = {};\n for(i in rsp.prices) {\n p.sections.prices.fields.price_id.options[rsp.prices[i].price.id] = rsp.prices[i].price.name + ' ' + rsp.prices[i].price.unit_amount_display;\n if( i == 0 ) {\n p.data.price_id = rsp.prices[i].price.id;\n }\n }\n p.refresh();\n p.show(cb);\n });\n };\n this.newinvoice.createInvoice = function() {\n var items = [];\n items[0] = {\n 'status':0,\n 'object':'ciniki.events.registration',\n 'object_id':this.registration_id,\n 'description':'',\n 'quantity':this.quantity,\n 'unit_amount':0,\n 'unit_discount_amount':0,\n 'unit_discount_percentage':0,\n 'taxtype_id':0,\n 'notes':'',\n };\n var price_id = this.formFieldValue(this.sections.prices.fields.price_id, 'price_id');\n var prices = this.prices;\n // Find the price selected\n for(i in prices) {\n if( prices[i].price.id == price_id ) {\n items[0].price_id = prices[i].price.id;\n items[0].code = '';\n items[0].description = prices[i].price.event_name + (prices[i].price.name!=''?' - '+prices[i].price.name:'');\n items[0].unit_amount = prices[i].price.unit_amount;\n items[0].unit_discount_amount = prices[i].price.unit_discount_amount;\n items[0].unit_discount_percentage = prices[i].price.unit_discount_percentage;\n items[0].taxtype_id = prices[i].price.taxtype_id;\n items[0].flags = 0x20;\n }\n }\n M.startApp('ciniki.sapos.invoice',null,this.cb,'mc',{'customer_id':this.customer_id,'items':items});\n };\n this.newinvoice.addClose('Cancel');\n\n //\n // Arguments:\n // aG - The arguments to be parsed into args\n //\n this.start = function(cb, appPrefix, aG) {\n args = {};\n if( aG != null ) { args = eval(aG); }\n\n this.edit.sections.registration.fields.status.active = (M.curTenant.modules['ciniki.events'].flags&0x04)>0?'yes':'no';\n\n //\n // Create the app container if it doesn't exist, and clear it out\n // if it does exist.\n //\n var appContainer = M.createContainer(appPrefix, 'ciniki_events_registrations', 'yes');\n if( appContainer == null ) {\n M.alert('App Error');\n return false;\n } \n\n this.menu.open(cb, args.event_id, 0);\n }\n}", "close_dataInspector(){\n iziToast.hide({transitionOut: 'flipOutX',onClosed:() => {iziToast.busy = false;}}, document.getElementById(\"dataEditor\") ); // hide HTML data Inspector\n $stage.interactiveChildren = true;\n }", "function animateRemoval(){return dialogPopOut(element,options);}", "function engagementModelsDescriptions() {\n \"use strict\";\n \n //Hide the Nearshore, Offshore and Virtual Active information by default\n $(\"#nearshore-text\").hide();\n $(\"#offshore-text\").hide();\n $(\"#vc-text\").hide();\n \n //Behavior of Onshore button\n $(\"#onshore-btn\").click(function () {\n //If any of the other outsources is being displayed\n if ($(\"#nearshore-text\").is(\":visible\") || $(\"#offshore-text\").is(\":visible\") || $(\"#vc-text\").is(\":visible\")) {\n //Hide the other sections\n $(\"#nearshore-text\").hide();\n $(\"#offshore-text\").hide();\n $(\"#vc-text\").hide();\n \n //Remove the selected class from the ther section's button\n $(\"#nearshore-btn\").removeClass(\"out-selected\");\n $(\"#offshore-btn\").removeClass(\"out-selected\");\n $(\"#vc-btn\").removeClass(\"out-selected\");\n \n //Open the Selection\n $(\"#onshore-text\").slideToggle(\"slow\");\n $(\"#onshore-btn\").addClass(\"out-selected\");\n } else {\n $(\"#onshore-text\").slideToggle(\"slow\", function () {\n if ($(\"#onshore-text\").is(\":visible\")) {\n $(\"#onshore-btn\").addClass(\"out-selected\");\n } else {\n $(\"#onshore-btn\").removeClass(\"out-selected\");\n }\n });\n }\n });//Onshore button\n \n //Behavior of Nearshore button\n $(\"#nearshore-btn\").click(function () {\n //If any of the other outsources is being displayed\n if ($(\"#onshore-text\").is(\":visible\") || $(\"#offshore-text\").is(\":visible\") || $(\"#vc-text\").is(\":visible\")) {\n //Hide the other sections\n $(\"#onshore-text\").hide();\n $(\"#offshore-text\").hide();\n $(\"#vc-text\").hide();\n \n //Remove the selected class from the ther section's button\n $(\"#onshore-btn\").removeClass(\"out-selected\");\n $(\"#offshore-btn\").removeClass(\"out-selected\");\n $(\"#vc-btn\").removeClass(\"out-selected\");\n \n //Open the Selection\n $(\"#nearshore-text\").slideToggle(\"slow\");\n $(\"#nearshore-btn\").addClass(\"out-selected\");\n } else {\n $(\"#nearshore-text\").slideToggle(\"slow\", function () {\n if ($(\"#nearshore-text\").is(\":visible\")) {\n $(\"#nearshore-btn\").addClass(\"out-selected\");\n } else {\n $(\"#nearshore-btn\").removeClass(\"out-selected\");\n }\n });\n }\n });//Nearshore button\n \n //Behavior of Offshore button\n $(\"#offshore-btn\").click(function () {\n //If any of the other outsources is being displayed\n if ($(\"#onshore-text\").is(\":visible\") || $(\"#nearshore-text\").is(\":visible\") || $(\"#vc-text\").is(\":visible\")) {\n //Hide the other sections\n $(\"#onshore-text\").hide();\n $(\"#nearshore-text\").hide();\n $(\"#vc-text\").hide();\n \n //Remove the selected class from the ther section's button\n $(\"#onshore-btn\").removeClass(\"out-selected\");\n $(\"#nearshore-btn\").removeClass(\"out-selected\");\n $(\"#vc-btn\").removeClass(\"out-selected\");\n \n //Open the Selection\n $(\"#offshore-text\").slideToggle(\"slow\");\n $(\"#offshore-btn\").addClass(\"out-selected\");\n } else {\n $(\"#offshore-text\").slideToggle(\"slow\", function () {\n if ($(\"#offshore-text\").is(\":visible\")) {\n $(\"#offshore-btn\").addClass(\"out-selected\");\n } else {\n $(\"#offshore-btn\").removeClass(\"out-selected\");\n }\n });\n }\n });//Offshore button\n \n //Behavior of Virtual Captive button\n $(\"#vc-btn\").click(function () {\n //If any of the other outsources is being displayed\n if ($(\"#onshore-text\").is(\":visible\") || $(\"#nearshore-text\").is(\":visible\") || $(\"#offshore-text\").is(\":visible\")) {\n //Hide the other sections\n $(\"#nearshore-text\").hide();\n $(\"#offshore-text\").hide();\n $(\"#onshore-text\").hide();\n \n //Remove the selected class from the ther section's button\n $(\"#nearshore-btn\").removeClass(\"out-selected\");\n $(\"#offshore-btn\").removeClass(\"out-selected\");\n $(\"#onshore-btn\").removeClass(\"out-selected\");\n \n //Open the Selection\n $(\"#vc-text\").slideToggle(\"slow\");\n $(\"#vc-btn\").addClass(\"out-selected\");\n } else {\n $(\"#vc-text\").slideToggle(\"slow\", function () {\n if ($(\"#vc-text\").is(\":visible\")) {\n $(\"#vc-btn\").addClass(\"out-selected\");\n } else {\n $(\"#vc-btn\").removeClass(\"out-selected\");\n }\n });\n }\n });//Virtual Captive button\n}", "function bindUIactions() {\n $('body').on('click', '.notification-dropdown__close', closeNotificationDropdown);\n\n s.notificationLink.on('click', function(e) {\n e.preventDefault();\n showNotificationDropdown();\n markAsRead($(this).attr('href'));\n });\n\n }", "addEventsListers() {\r\n document.addEventListener('click', (evt) => {\r\n const priceListRow = hasSomeParentOfClass(evt.target, 'price-table__row');\r\n\r\n if (priceListRow) {\r\n this.switchPriceListRow(priceListRow);\r\n }\r\n });\r\n }", "function frmPatientSummary_segWound9PointsRowClick(eventobject) {\n /////Sandeep offline changes for 9Healings\nif( isIpad && !isNetworkAvailable()){\n var error_label= ERROR_CONSTANTS.NO_NETWORK_CONNECTION;\n com.healogics.utility.showErrorAlert(error_label, GENERAL_CONSTANTS.TEXT_CLOSE);\n \n }else{\n com.healogics.utility.showLoading();\n searchPatient_closeSearchList();\n frmPatientSummary_btnSaveClick(\"save\");\n var segRowData = frmPatientSummary.segwoundfeaturetypes.data;\n var selectedRowData = segRowData[eventobject];\n var row_data = [];\n for (var i=0;i<segRowData.length;i++) {\n var tempRow = segRowData[i];\n if(i===eventobject) {\n tempRow.imgfeaturetype = {\"src\": \"onelinearrow.png\",\n \"width\" : \"100%\"};\n } else {\n tempRow.imgfeaturetype = {\"src\": \"onelinearrownormal.png\",\n \"width\" : \"95%\"};\n }\n row_data.push(tempRow);\n }\n frmPatientSummary.segwoundfeaturetypes.setData(row_data);\n frmPatientSummary.segwoundfeaturetypes.separatorColor = \"#ffffff\";\n if(frmPatientSummary_isValidStepData(patientSummaryObjects.woundDescriptionDetails[patientSummaryObjects.selectedWoundIndex].stepSummary)){\n if(eventobject===0){\n com.healogics.patientSummary.enhancePerfusionOxygenationData();\n } else if(eventobject===1){\n com.healogics.patientSummary.removeNonVialTissueData();\n } else if(eventobject===2){\n com.healogics.patientSummary.removeInfectionMaintainMicrobialBalanceData();\n } else if(eventobject===3){\n com.healogics.patientSummary.resolveEdemaData();\n } else if(eventobject===4){\n com.healogics.patientSummary.optimizeWoundData();\n } else if(eventobject===5){\n com.healogics.patientSummary.enhancedTissueData();\n } else if(eventobject===6){\n com.healogics.patientSummary.relievePressureData();\n } else if(eventobject===7){\n com.healogics.patientSummary.controlDiminishPainData();\n } else if(eventobject===8){\n com.healogics.patientSummary.optimizeHostData();\n }\n patientSummaryObjects.healing9stepEditedData=[];\n patientSummaryObjects.lastEditedStep = clone(patientSummaryObjects.selectedStepData);\n }else{\n kony.print(\"--------- Invalid patientSummaryObjects.woundDescriptionDetails ---------\");\n }\n com.healogics.utility.dismissLoading();\n}}", "function initSelectionHandler(){\n $('button#select').on('click', function(e){\n var $filelist = $('#filelist');\n // clear the list and add the new selections\n $filelist.find('tr[data-source=\"config-browser\"]').each(function(idx, tr){\n var selection = getSelectionFromTR(tr);\n $filelist.trigger({type: 'config:removed', source: 'config-browser', selection: selection});\n });\n $(selections).each(function(idx, selection){\n $filelist.trigger({type: 'config:added', source: 'config-browser', selection: selection});\n });\n selections = [];\n });\n }", "function setEventListenerOnRead() {\n let elements = document.getElementsByClassName('hidden-note');\n let eleArr = Array.prototype.slice.call(elements);\n\n /*for each read button, adding event listener and calling toggleDisplayNote(index) to toggle hide/unhide */\n eleArr.forEach((row, index) => {\n document.getElementById(`expand-${index}`).addEventListener('click', () => {\n toggleDisplayNote(index);\n });\n });\n \n}", "function onPopupClose(evt) {\r\n// selectControl.unselect(selectedFeature);\r\n onFeatureUnselect(selectedFeature);\r\n}", "addDetailsListeners(id) {\n if (!$(\"#\" + id + \" .button[data-target='download-solution']\").hasClass(\"click-event-added\")) {\n $(\"#\" + id + \" .button[data-target='download-solution']\").addClass(\"click-event-added\");\n $(\"#\" + id + \" .button[data-target='download-solution']\").click(function () {\n download(JSON.stringify(runtimeManager.currentSolution.toServerObject()), \"solution.json\", \"application/json\");\n });\n }\n if (!$(\"#\" + id + \" .button[data-target='export-solution']\").hasClass(\"click-event-added\")) {\n $(\"#\" + id + \" .button[data-target='export-solution']\").addClass(\"click-event-added\");\n $(\"#\" + id + \" .button[data-target='export-solution']\").click(function () {\n download(runtimeManager.solutions[0].toExport(), \"export.csv\", \"text/csv\");\n });\n }\n if (!$(\"#\" + id + \" .button[data-target='go-back']\").hasClass(\"click-event-added\")) {\n $(\"#\" + id + \" .button[data-target='go-back']\").addClass(\"click-event-added\");\n $(\"#\" + id + \" .button[data-target='go-back']\").click(function () {\n runtimeManager.setWindowState(0);\n });\n }\n }", "clickBook() {\n\n this.dialogueBox.visible = true;\n this.dialogueBook.visible = true;\n this.xButton.visible = true;\n //for when clicking exit, everything disappears\n }", "openItemDetails(item){if(!this._isDetailsOpened(item)){this.push(\"detailsOpenedItems\",item)}}", "function populateAppropGridWhenPlotClicked() {\n\n $('#plotChoices2 option').on('click', function (e){\n $('#plotChoices2').slideUp(1000, function(){\n $('#plotChoices2').remove();\n $('#veggieChoices2').remove();\n\n });\n });\n }", "function update_textarea_handlers(){\n\n\t$('.wmd-wrapper').click(function () {\n\t\tif (!$(this).find('textarea').hasClass('expand')){\n\t\t\t$('.wmd-input').removeClass('expand');\n\t\t\t$('.wmd-preview').hide();\n\t\t\t$(this).find('textarea').addClass('expand');\n\t\t\t$(this).find('.wmd-preview').show();\n\t\t}\n\t});\n}", "function editOpenAndCloseInfoShow(){\n\t\t$(\".resOpenCloseDetails\").hide();\n $(\".errorTime\").html('');\n $(\"#selectopen\").prop('checked', false);\n $(\"#selectclose\").prop('checked', false);\n $(\"#selectsecondopen\").prop('checked', false);\n $(\"#selectsecondclose\").prop('checked', false);\n\t\t$(\"#editOpenClose\").show();\n\t}", "function onReportDiagnosticSeeAllPopupHide() {\r\n seeAllClosed = true;\r\n tau.openPopup(reportDiagnosticPopup);\r\n }", "_setUpCollaspeDetailsAfterPrinting() {\n const details = Array.from(document.querySelectorAll('details'));\n\n // FF and IE implement these old events.\n if ('onbeforeprint' in window) {\n window.addEventListener('afterprint', _ => {\n details.map(detail => detail.open = false);\n });\n } else {\n // Note: while FF has media listeners, it doesn't fire when matching 'print'.\n window.matchMedia('print').addListener(mql => {\n if (!mql.matches) {\n details.map(detail => detail.open = mql.matches);\n }\n });\n }\n }", "function answerSelect() {\n\t$(document).on(\"click\", \"[data-status=false]\", function() {\n\t$(\"[data-status=true]\").unbind(\"mouseenter\");\n\t$(\"[data-status=false]\").unbind(\"mouseenter\");\n\t$(this).css(\"background-color\", \"#333\");\n\t$(this).css(\"color\", \"white\");\n\tincorrectAnswer();\n\t});\n\n\t$(document).on(\"click\", \"[data-status=true]\", function() {\n\t$(\"[data-status=true]\").unbind(\"mouseenter\");\n\t$(\"[data-status=false]\").unbind(\"mouseenter\");\n\t$(this).css(\"background-color\", \"#333\");\n\t$(this).css(\"color\", \"white\");\n\tcorrectAnswer();\n\t});\n\n\t$(document).on(\"click\", \"[data-status=startover]\", function() {\n\t$(this).css(\"background-color\", \"#333\");\n\t$(this).css(\"color\", \"white\");\n\tstartOver();\n\t});\n}", "function removeCallbackOk(result, ids) {\n $(\"#tblAlerts\").bootstrapTable(\"remove\", ids);\n MessageBox.hide();\n setupToolbar();\n }", "onToggleDetail() {\n\n\t\t$(\".account-subscription\").on(\"click\", \".subscription-item .action .btn\", ev => {\n\n\t\t\tconst target = $(ev.currentTarget).closest(\".subscription-item\");\n\t\t\tconst details = $(\".account-subscription-detail\", target);\n\n\t\t\t$(\".btn.show\", target).toggleClass('hidden');\n\t\t\t$(\".btn.close\", target).toggleClass('hidden');\n\n\t\t\tslideToggle(details[0], 300);\n\n\t\t\treturn false;\n\t\t});\n\t}", "handleCloseMovieView(){\n document.getElementById('sort').style.display = \"inline-block\";\n document.getElementById('castcrewcontainer').style.display = \"none\";\n this.setListAllFLAG();\n }", "function GetFlightMSGGrid() {\n $(\"#tdNILManifest,#tdATDTime,#tdATDDate,#tdManRemarks,#tdManifestRemarks,#tdregnNo,#tdregnNoTxt,#btnUWS,#btn_Print\").hide();\n $('#SecondTab,#OSCTab,#StackDetailTab,#FlightStopOverDetailTab').hide();\n $('#FirstTab').text('EDI Message');\n $(\"#divAction button\").hide();\n $('#btnEDIMsgSend').show();\n $(\"#tabstrip\").kendoTabStrip();\n ShowIndexView(\"divDetail\", \"Services/FlightControl/FlightControlService.svc/GetFlightTransGridData/FLIGHTCONTROL/FlightControl/EDIMSG/\" + CurrentFlightSno + \"/\" + FlightCloseFlag);\n}", "attachReceiptSearchTableHandlers(){\n $(\".receipt-details\").unbind('click');\n $(\".delete-receipt\").unbind('click');\n $(\"#delete-receipt\").unbind('click');\n\n $(\".receipt-details\").on('click', {context : this} , this.showInvoiceDetails);\n $(\".delete-receipt\").on('click', {context : this} , this.confirmReceiptDelete);\n $(\"#delete-receipt\").on('click', {context : this} , this.deleteReceipt);\n }", "function onModalClosedClicked() {\n $('#myModal').css(\"display\", \"none\");\n buildBoard();\n}", "function abCbRptHazBlMapDrilldown_itemsDetails_onMultipleSelectionChange(row){\n\tvar dwgPanel = View.panels.get('abCbRptHlBlRmPrj_drawingPanel');\n\tvar controller = View.controllers.get(\"abCbRptHlBlRmPrjCtrl\");\n\t\n\t// setSelectColor() generates error if the drawing is not loaded\n\tif(!dwgPanel.dwgLoaded && row.row.isSelected()){\n\t\tdwgPanel.addDrawing(row, null);\n\t\tdwgPanel.isLoadDrawing = true;\n\t}\n\t\n\t// red if the row is selected or if there is another selected item for this item's room\n\tif(row.row.isSelected()) {\n\t\t\n\t\tvar roomArray = [];\n\t\tvar room = [row.row.getFieldValue('rm.bl_id'), row.row.getFieldValue('rm.fl_id'), row.row.getFieldValue('rm.rm_id')];\n\t\troomArray.push(room);\n\t\t//dwgPanel.setSelectColor(0xFF0000);\t// red\n\t\tdwgPanel.selectAssets(roomArray);\n\t\t//dwgPanel.highlightAssets(null, row);\n\t} else if(!existsSelectedItemInSameRoom(controller.abCbRptHlBlRmPrj_gridRep, row.row, 'rm')){\n\t\tvar roomArray = [];\n\t\tvar room = [row.row.getFieldValue('rm.bl_id'), row.row.getFieldValue('rm.fl_id'), row.row.getFieldValue('rm.rm_id')];\n\t\troomArray.push(room);\n\t\tdwgPanel.unselectAssets(roomArray);\n\t\t//dwgPanel.highlightAssets(null, row);\n\t}\n}", "setCloseListeners()\n {\n let alert = document.getElementById(this.id + '-alert');\n [...document.getElementById(this.id).getElementsByClassName('close-dialog')].forEach(function(item) {\n item.addEventListener('click', function() {\n alert.style.display = 'none';\n });\n });\n }", "function announceClosed(opts){var mdSelect=opts.selectCtrl;if(mdSelect){var menuController=opts.selectEl.controller('mdSelectMenu');mdSelect.setLabelText(menuController?menuController.selectedLabels():'');mdSelect.triggerClose();}}", "closeMessageModal(event) {\n this.bShowMessageModal = event.detail.showChildModal; //read from child lwc and assign here\n }", "function fnBtnMessage(eMessages, sMessage){\r\n switch (sMessage){\r\n case \"\":\r\n eMessages.className = 'messages messageAlert ';\r\n eMessages.innerHTML = \"First select an action to perform\";\r\n break;\r\n case \"outsidebounds\":\r\n eMessages.className = 'messages messageAlert ';\r\n eMessages.innerHTML = \"Outside city bounds, pick somewhere else.\";\r\n break;\r\n case \"occupado\":\r\n eMessages.className = 'messages messageAlert ';\r\n eMessages.innerHTML = \"That spot is taken, pick somewhere else.\";\r\n break;\r\n case 'fire':\r\n eMessages.className = 'messages messageText ';\r\n eMessages.innerHTML = \"Fire Fighters are heroes! And Hot!\";\r\n break; \r\n case 'house':\r\n eMessages.className = 'messages messageText ';\r\n eMessages.innerHTML = \"Sure, we need houses! Go nuts!\";\r\n break;\r\n case \"road\":\r\n eMessages.className = 'messages messageText ';\r\n eMessages.innerHTML = \"Roads are awesome!\";\r\n break;\r\n case \"police\":\r\n eMessages.className = 'messages messageText ';\r\n eMessages.innerHTML = \"Police helps fight crime! Don't defund!\";\r\n break; \r\n case 'inspect':\r\n eMessages.className = 'messages messageText ';\r\n eMessages.innerHTML = \"Click on a plot to get information.\";\r\n break;\r\n case 'bulldozer':\r\n eMessages.className = 'messages messageText ';\r\n eMessages.innerHTML = \"Clink on a structure to destroy it.\"\r\n } // End switch\r\n} //══════╡ END GAMESTATE DATA AND MESSAGES ╞════════════════════════════════", "function loadListeners() {\n\t\t$(\"#iwoot-gui-options\").click(function() {\n\t\t\tif(!IWoot.isGUIHidden) {\n\t\t\t\t$(\"#iwoot-gui-main\").hide(\"slow\");\n\t\t\t\tIWoot.isGUIHidden = true;\n\t\t\t} else {\n\t\t\t\t$(\"#iwoot-gui-main\").show(500);\n\t\t\t\t$(\"#iwoot-gui-main\").css(\"display\", \"block\");\n\t\t\t\tIWoot.isGUIHidden = false;\n\t\t\t}\n\t\t});\n\t\t$(\"#iwoot-autodubup\").click(function() {\n\t\t\tif(!IWoot.isAutoWoot) {\n\t\t\t\tIWoot.isAutoWoot = true;\n\t\t\t\t$(\"#iwoot-autodubup\").css(\"color\", Color.GREEN);\n\t\t\t\tautoDubUp();\n\t\t\t} else {\n\t\t\t\tIWoot.isAutoWoot = false;\n\t\t\t\t$(\"#iwoot-autodubup\").css(\"color\", Color.RED);\n\t\t\t}\n\t\t});\n\t\t$(\"#iwoot-chatlimit\").click(function() {\n\t\t\tif(!IWoot.isNoChatLimit) {\n\t\t\t\tIWoot.isNoChatLimit = true;\n\t\t\t\t$(\"#iwoot-chatlimit\").css(\"color\", Color.GREEN);\n\t\t\t\t$(\"#chat-txt-message\").attr(\"maxlength\", \"99999999999999999999\");\n\t\t\t} else {\n\t\t\t\tIWoot.isNoChatLimit = false;\n\t\t\t\t$(\"#iwoot-chatlimit\").css(\"color\", Color.RED);\n\t\t\t\t$(\"#chat-txt-message\").attr(\"maxlength\", \"255\");\n\t\t\t}\n\t\t});\n\t\t$(\"#iwoot-userjoinleave\").click(function() {\n\t\t\tif(!IWoot.isUserJoinLeave) {\n\t\t\t\tIWoot.isUserJoinLeave = true;\n\t\t\t\t$(\"#iwoot-userjoinleave\").css(\"color\", Color.GREEN);\n\t\t\t} else {\n\t\t\t\tIWoot.isUserJoinLeave = false;\n\t\t\t\t$(\"#iwoot-userjoinleave\").css(\"color\", Color.RED);\n\t\t\t}\n\t\t});\n\t\t$(\"#iwoot-togglevideo\").click(function() {\n\t\t\tvar videoHidden = Dubtrack.room.player.istoggleVideo;\n\t\t\tif(!videoHidden) {\n\t\t\t\t$(\".hideVideo-el\").click();\n\t\t\t\t$(\"#iwoot-togglevideo\").css(\"color\", Color.GREEN);\n\t\t\t} else {\n\t\t\t\t$(\".hideVideo-el\").click();\n\t\t\t\t$(\"#iwoot-togglevideo\").css(\"color\", Color.RED);\n\t\t\t}\n\t\t});\n\t\t$(\"#iwoot-workmode\").click(function() {\n\t\t\tif(!IWoot.isWorkMode) {\n\t\t\t\t$(\".main-room-wrapper\").css(\"display\", \"none\");\n\t\t\t\t$(\"#iwoot-workmode\").css(\"color\", Color.GREEN);\n\t\t\t\tIWoot.isWorkMode = true;\n\t\t\t} else {\n\t\t\t\t$(\".main-room-wrapper\").css(\"display\", \"block\");\n\t\t\t\t$(\"#iwoot-workmode\").css(\"color\", Color.RED);\n\t\t\t\tIWoot.isWorkMode = false;\n\t\t\t}\n\t\t});\n\t\tIWoot.Tools.log(\"GUI Listeners Loaded!\");\n\t}", "function smb_deselected() {\n var cp_selected = $('#cp_media_browser_list').cpSelectable('getSelected');\n smb_update_file_info(cp_selected);\n smb_update_action_buttons(cp_selected);\n// $('.jeegoocontext').hide();\n}", "function closeComposeMail() {\n self.compose = false;\n self.notesGrid.selectedItems = [];\n }", "disconnectedCallback() {\n // @todo make sure we remove the items from the tour if the\n // element they are related to gets removed from the page\n super.disconnectedCallback();\n }" ]
[ "0.6320755", "0.59993416", "0.57495004", "0.5710571", "0.55365074", "0.5442885", "0.5441454", "0.539694", "0.5373962", "0.5357895", "0.5327819", "0.5325876", "0.5302621", "0.52867204", "0.5271538", "0.52688235", "0.52628917", "0.52628016", "0.5253582", "0.52531195", "0.5229711", "0.52285963", "0.52281195", "0.52281195", "0.5217532", "0.52149457", "0.52146935", "0.5196323", "0.51940596", "0.5182919", "0.51721144", "0.5171113", "0.51703274", "0.5145634", "0.51366526", "0.51347494", "0.5133923", "0.5133907", "0.5129285", "0.5128138", "0.5126963", "0.5123907", "0.5118552", "0.51131684", "0.5110728", "0.51097286", "0.5094332", "0.50936234", "0.5089297", "0.50886387", "0.50858164", "0.50789684", "0.50702184", "0.50689477", "0.50679106", "0.5066997", "0.5063983", "0.50516796", "0.5047847", "0.50369227", "0.50361836", "0.50292", "0.50249183", "0.5018937", "0.50172275", "0.5012683", "0.5007341", "0.5002421", "0.5000115", "0.49923182", "0.49869108", "0.49726373", "0.4971418", "0.4969725", "0.49676618", "0.49660224", "0.49651992", "0.4963449", "0.4962825", "0.49604368", "0.49568585", "0.49549356", "0.49534455", "0.495142", "0.49500713", "0.4948943", "0.4944075", "0.49391094", "0.49353057", "0.49290738", "0.49274924", "0.4926229", "0.4924014", "0.49229693", "0.49223962", "0.4920811", "0.49184948", "0.4917879", "0.4916187", "0.49139336", "0.49107006" ]
0.0
-1
bind model values to search params...
function currentValue() { var answer = $location.search()[paramName] || defaultValue; return answer === "false" ? false : answer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onSearch(value) {\n this.model.query = value;\n }", "onSearch(value) {\n this.model.query = value;\n }", "function searchBinding(){\n var selector = thisInstance.constants.selector,\n $searchForm = $(selector.searchForm);\n $searchForm.on('submit', function(event){\n event.preventDefault();\n fetchAndLoadUserList({searchKey: $.trim($(selector.searchBox).val())});\n });\n }", "search() {\n this.send('searchWithParams', this.buildSearchQuery());\n }", "getQueryParams(filterFields, searchValue, variable) {\n const inputParams = this.getInputParms(variable);\n const queryParams = ServiceVariableUtils.excludePaginationParams(inputParams);\n const inputFields = {};\n // check if some param value is already available in databinding and update the inputFields accordingly\n _.map(variable.dataBinding, function (value, key) {\n inputFields[key] = value;\n });\n // add the query params mentioned in the searchkey to inputFields\n _.forEach(filterFields, function (value) {\n if (_.includes(queryParams, value)) {\n inputFields[value] = searchValue;\n }\n });\n return inputFields;\n }", "function searchModels() {\n let modelName = document.getElementById(\"modelName\").value.trim();\n if (modelName.length === 0) {\n return;\n }\n\n showLoadingAnimation();\n hideSearchResult();\n\n let url = 'searchModel';\n let params = 'modelName=' + modelName;\n\n startSearching(url + '?' + params);\n}", "applySearchFromRequest(fields, match = null) {\r\n if (Request.has('search') && Request.get('search') !== '') {\r\n if (_.isNull(match)) {\r\n match = `%${Request.get('search')}%`;\r\n }\r\n this.where(function(q) {\r\n _.forEach(fields, field => {\r\n q.orWhere(field, 'like', match);\r\n });\r\n return q;\r\n });\r\n }\r\n return this;\r\n }", "addFieldsToParam(searchParam) {\n let allFields = this.fields.split(',');\n allFields.push('Id');\n allFields.push('Name');\n let cleanFields = this.dedupeArray(allFields).join(',');\n searchParam.fieldsToQuery = cleanFields;\n }", "function setQuery() {\n getSearch(search.value);\n}", "function setSearchResult(vm, args) {\n const { $store } = vm;\n $store.dispatch('common/session', {\n //存搜索条件\n key: 'searchCriteria',\n val: args,\n action: {\n isCopy: true,\n isSession: true\n }\n });\n}", "function getSearchObj(){\n return searchObj;\n }", "function searchParams() {\n let searchLang = lang.value;\n let devLoc = devLocation.value;\n let minRepo = minimumRepos.value;\n\n // test\n // console.log(searchLang);\n // console.log(devLoc);\n // console.log(minRepo);\n //check\n\n // validate client request data here with Joi \n // make API request\n\n // \n apiRequest.getProfiles(searchLang, devLoc, minRepo)\n .then(data => {\n\n uiResults.renderResults(data);\n\n });\n\n}", "get searchParam () {\n\t\treturn this._searchParam;\n\t}", "function getSearchObj(){\n return searchObj;\n }", "function paramQuerySearch() {\n var params = getParam(\"paramQuery\");\n parameterSearch(params);\n}", "model(params) {\n\n }", "_onSearch(event) {\n const searchDetails = event.detail;\n Object.assign(this.searchDetails, searchDetails);\n this.render();\n }", "function search(data){\n setSearch(data); \n }", "function viewModel(params) {\n\n // Unpack the Search VM.\n var searchInput = params.search.searchInput;\n var searchResults = params.search.searchResults;\n var searchTotal = params.search.searchTotal;\n var searching = params.search.searching;\n var pageSize = params.search.pageSize;\n var page = params.search.page;\n\n \n function doHelp() {\n showHelpDialog();\n }\n\n \n // console.log('hmm', params.search.withPrivateData(), params.search.withPublicData());\n\n return {\n // The top level search is included so that it can be\n // propagated.\n search: params.search,\n // And we break out fields here for more natural usage (or not??)\n searchInput: searchInput,\n searchResults: searchResults,\n searchTotal: searchTotal,\n searching: searching,\n pageSize: pageSize,\n page: page,\n\n // ACTIONS\n doHelp: doHelp,\n doSearch: params.search.doSearch,\n };\n }", "_injectModel(model) {\n if (model) this.activeModel = model;\n if (this.activeModel) {\n for (let m in this.activeModel) {\n this.base.find(`*[data-model='${m}']`).text(model[m]);\n }\n }\n }", "_initSearchFields() {\n\t\t\tvar oFields = this._oViewModel.getProperty(\"/fields\");\n\t\t\tvar aSearchFields = Object.entries(oFields)\n\t\t\t\t.filter(([, oField]) => oField.canSearch)\n\t\t\t\t.map(([sKey, oField]) => Object.assign({\n\t\t\t\t\tpath: sKey,\n\t\t\t\t\tsearchSelected: true\n\t\t\t\t}, oField));\n\t\t\tthis._oViewModel.setProperty(\"/search/fields\", aSearchFields);\n\t\t}", "function my_listings_search_params (aoData) {\n\t\tvar formAdditions = new Array();\n\t\t$.each($('#pls_admin_my_listings:visible').serializeArray(), function(i, field) {\n\n\t\t\t// only push the criteria we need for the call\n\t\t\tif(field.value && field.value != 'false') {\n\t\t\t\tif(field.value == 'true') field.value = 1;\n\n\t\t\t\tif( field.name == 'zoning_types' || field.name == 'listing_types' || field.name == 'purchase_types' ) {\n\t\t\t\t\t// API expects these to be arrays\n\t\t\t\t\taoData.push({\"name\" : field.name + \"[]\", \"value\" : field.value});\n\t\t\t\t} else {\n\t\t\t\t\taoData.push({\"name\" : field.name, \"value\" : field.value});\n\t\t\t\t}\n\n\t\t\t\t// if this is an array then tell the api to look for multiple values\n\t\t\t\tif( field.name.slice(-2) == '[]' ) {\n\t\t\t\t\tif ( $.inArray(field.name, formAdditions) == -1) {\n\t\t\t\t\t\tformAdditions.push(field.name);\n\t\t\t\t\t\tvar matchname = field.name.slice(0, -2);\n\t\t\t\t\t\tmatchname = matchname.slice(-1) == ']' ? matchname.slice(0,-1)+'_match]' : matchname+'_match';\n\t\t\t\t\t\taoData.push({name: matchname, value: 'in'});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\treturn aoData;\n\t}", "searchChangeHandler(event) {\n console.log(event.target.value);\n const boundObject = this\n const searchTerm = event.target.value\n boundObject.performSearch(searchTerm);\n }", "function searchHelper() {\r\n let searchValue = searchField.value;\r\n if (searchValue.length) search(searchValue);\r\n else getAll();\r\n }", "_fetchSearchParam() {\n const column = this.meta._columns.find(column => column.defaultSort)\n\n const sort = this.sortCondition || (column && `${column.slot},desc` || 'id,desc')\n console.log(sort)\n\n let _param = {\n page: this.page - 1,\n size: this.size,\n sort,\n ...this.queryParams,\n ...this.extraParams,\n ...this.filters\n }\n\n if (this.enterFromRoute && this.$route) {\n const {meta: {searchParams}} = this.$route\n if (searchParams) {\n Object.entries(searchParams).forEach(([k, v]) => {\n const searchItem = this.meta._searchItems.find(item => item.key === k)\n if (searchItem) {\n const {type, modelType, tree, resourcePath, primaryKeyType} = searchItem\n if (Types.isString(type)) {\n if (_param[k] === undefined) _param[`${k}.contains`] = v\n this.$nextTick(() => {\n this.$refs.search.setValue(k, v)\n })\n } else if (Types.isBoolean(type)) {\n if (_param[k] === undefined) _param[`${k}.equals`] = Boolean(v)\n this.$nextTick(() => {\n this.$refs.search.setValue(k, Boolean(v))\n })\n } else if (Types.isDecimal(type)) {\n const value = _.split(v, ',', 2).map(value => Number(v))\n if (_param[k] === undefined) {\n _param[`${k}.greaterOrEqualThan`] = value[0]\n _param[`${k}.lessThan`] = value[1]\n }\n this.$nextTick(() => {\n this.$refs.search.setValue(k, value)\n })\n } else if (Types.isModel(type)) {\n if (Types.isCommonOrSuperModel(type, modelType)) {\n if (tree) {\n let _rest = new Rest(resourcePath, this.$apiURL)\n _rest.GET({\n uri: `tree`,\n params: {level: 10}\n }).then((res) => {\n const arr = copyObjectRenameAttrInArrRecursive({\n src: res,\n correspondence: {_instanceName: 'label', id: 'value', _children: 'children'}\n })\n if (_param[k] === undefined) _param[`${k}.in`] = arr\n this.$nextTick(() => {\n this.$refs.search.$refs[`${k}Item`].pullOptions(this.meta._searchItems.find(searchItem => searchItem.key === k))\n this.$refs.search.setValue(k, arr)\n })\n })\n } else {\n if (_param[k] === undefined) _param[`${k}.in`] = v\n this.$nextTick(() => {\n this.$refs.search.$refs[`${k}Item`].pluginData(this.meta._searchItems.find(searchItem => searchItem.key === k), v)\n if (primaryKeyType === 'Long') {\n this.$refs.search.setValue(k, Number(v))\n } else {\n this.$refs.search.setValue(k, v)\n }\n })\n }\n } else {\n let value\n if (v.includes(',')) {\n value = _.split(v, ',')\n } else {\n value = v\n }\n if (_param[k] === undefined) _param[`${k}.in`] = value\n this.$nextTick(() => {\n this.$refs.search.setValue(k, value)\n })\n }\n } else if (Types.isDateType(type)) {\n if (_param[k] === undefined) {\n if (v.includes(',')) {\n const value = _.split(v, ',', 2)\n _param[`${k}.greaterOrEqualThan`] = value[0]\n _param[`${k}.lessThan`] = value[1]\n\n this.$nextTick(() => {\n this.$refs.search.setValue(k, [new Date(Date.parse(value[0].replace(/-/g, '/'))), new Date(Date.parse(value[1].replace(/-/g, '/')))])\n })\n }\n }\n }\n }\n })\n }\n }\n return _param\n }", "function modelQuerySearch() {\n var tracker = $q.defer();\n var results = (vm.vehicle.model ? vm.models.filter(createFilterForModel(vm.vehicle.model)) : vm.models);\n\n if (results.length > 0)\n return results;\n\n amCustomers.getModels(vm.vehicle.manuf).then(allotModels).catch(noModels);\n return tracker.promise;\n\n function allotModels(res) {\n vm.models = res;\n results = (vm.vehicle.model ? vm.models.filter(createFilterForModel(vm.vehicle.model)) : vm.models);\n tracker.resolve(results);\n }\n\n function noModels(err) {\n results = [];\n tracker.resolve(results);\n }\n }", "function updateFilteredSearch(){\n \n if(typeof searchPnt != \"undefined\")\n findProviders(providerFS, searchPnt)\n }", "searchQuery(value) {\n let result = this.tableData;\n if (value !== '') {\n result = this.fuseSearch.search(this.searchQuery);\n }\n this.searchedData = result;\n }", "resolveParam() {\n for (let arg of arguments) {\n if (arg instanceof Object && typeof arg !== 'string') {\n for (let item in arg) {\n if (arg.hasOwnProperty(item)) {\n this.resolveParam(arg[item]);\n }\n }\n } else {\n this.temp_search.push(arg);\n }\n }\n }", "setSearch(search) {\n this.search = search;\n }", "function handleParamChange(e) {\n e.preventDefault();\n setLoadMoreData(true);\n const value = e.target.value;\n setSearchText(value);\n }", "function populateRoutesSearchForm(savedSearch) {\n\t$('#rIndication').val(savedSearch.indication);\n\t$('#rBrandName').val(savedSearch.brandName);\n\t$('#rGenericName').val(savedSearch.genericName);\n\t$('#rSubstanceName').val(savedSearch.substanceName);\n}", "function getModelValue() {\n return iScope._widgettype === 'wm-search' ? iScope.query : iScope.datavalue;\n }", "function updateSearch(event) {\n setSearch(event.target.value)\n songSearch(event.target.value)\n }", "function systemVmGetSearchParams() {\n var moreCriteria = [];\t\n\n\tvar searchInput = $(\"#basic_search\").find(\"#search_input\").val();\t \n if (searchInput != null && searchInput.length > 0) {\t \n moreCriteria.push(\"&keyword=\"+todb(searchInput));\t \n } \n\n\tvar $advancedSearchPopup = getAdvancedSearchPopupInSearchContainer();\n\tif ($advancedSearchPopup.length > 0 && $advancedSearchPopup.css(\"display\") != \"none\" ) {\t \n\t\tvar state = $advancedSearchPopup.find(\"#adv_search_state\").val();\n\t\tif (state!=null && state.length > 0) \n\t\t\tmoreCriteria.push(\"&state=\"+todb(state));\t\t\n\t\t\t\t\n\t\tvar zone = $advancedSearchPopup.find(\"#adv_search_zone\").val();\t\n\t if (zone!=null && zone.length > 0) \n\t\t\tmoreCriteria.push(\"&zoneId=\"+zone);\t\n\t\t\n\t\tif ($advancedSearchPopup.find(\"#adv_search_pod_li\").css(\"display\") != \"none\") {\t\n\t\t var pod = $advancedSearchPopup.find(\"#adv_search_pod\").val();\t\t\n\t if (pod!=null && pod.length > 0) \n\t\t\t moreCriteria.push(\"&podId=\"+pod);\n } \n\t} \t\n\t\n\treturn moreCriteria.join(\"\"); \n}", "function search () {\n saveState();\n self.filtered = self.gridController.rawItems.filter(self.filterFunc);\n self.gridController.doFilter();\n }", "queryParams(params) {\n this.table = $('#searchtable');\n var options = this.table.bootstrapTable('getOptions');\n console.log('table opts', options);\n console.log('parmas', params);\n\n // this is necessary to ensure the backend has the validated API parameters it needs\n // the table pipeline extension renames some of the query parameters\n if (options.usePipeline) {\n params.order = params.sortOrder;\n params.sort = params.sortName;\n }\n return params;\n }", "searchWithParams(query) {\n if (Object.keys(query).length) {\n this.set('isSearching', true);\n this.get('store').query('patient-search', query).then(results => {\n this.setProperties({\n results: results.filterBy('isActive'),\n isSearching: false\n });\n this.sendAction('didSearch');\n\n if (this.get('displayResults')){\n this.set('showResults', true);\n this.set('showHints', false);\n }\n }).catch(error => {\n if (!this.get('isDestroyed')) {\n this.set('isSearching', false);\n this.sendAction('didSearch', error);\n }\n });\n }\n }", "function updateAdanvceSearch(){\n if(typeof searchPnt != \"undefined\"){\n whereClause = searchFilters.buildWhereClause();\n findOptimalSearchRadius(providerFS,searchPnt,whereClause)\n }\n }", "function searchInit() {\n \"use strict\";\n // Create an object which contains the query string as keys/values\n var queryString = parseQuery();\n\n if (queryString.boost !== undefined) {\n document.getElementById(\"boostCheck\").checked = true;\n }\n\n var blankRefViewModel = new RefViewModel({});\n if (localStorage['refsEditor']) {\n blankRefViewModel.update(localStorage['refsEditor']);\n }\n ko.applyBindings(blankRefViewModel, $(\"#newRefModal\")[0]);\n\n if (queryString.q !== undefined) {\n queryString.q = queryString[\"q\"].replace(/%3A/g, \":\"); // Unescape : in query string\n document.getElementById(\"mainDisplay\").setAttribute(\"aria-hidden\", \"false\"); // Show main body\n document.getElementById(\"searchInput\").value = decodeURIComponent(queryString.q.replace(/[+]/g, \"%20\")); // Put query back in search bar, unescape special + encoding\n document.getElementById(\"rowsInput\").value = queryString.rows; // Put row setting back in search bar\n ko.applyBindings(new RefsGridViewModel(queryString), $(\"#mainDisplay\")[0]);\n }\n}", "searchFilter(e) {\n this.getSearchResults(formData)\n }", "doSearch() {\n console.log(\"do search event triggered, search \" + this.get('searchQuery'));\n this.transitionToRoute('search.do-search',\n {\n queryParams:\n {\n q: this.get('searchQuery'),\n y1: this.get('yearFrom'),\n y2: this.get('yearTo'),\n ratingFrom: this.get('imdbRatingFrom'),\n ratingTo: this.get('imdbRatingTo')\n }\n });\n }", "search(params) {\n let query = params;\n this.set('query', query);\n this.transitionToRoute('search', {queryParams: {q: query, p: this.page }});\n }", "function searchGeneral() {\r\n search.general = $(\"#search\").val().split(\" \");\r\n updateData();\r\n}", "function applyValsForFilters() {\n self._name = self.name;\n self._value = self.value;\n }", "updateParams(){\n\n\t\tconsole.log('params');\n\n\t\tvar self = this;\n\n\t\t\tfor (var key in this.attributes.filters) {\n\n\t\t\t\tif(self.attributes.filters[key]['active']==true){\n\t\t\t\t\tself.attributes.params[key] = self.attributes.filters[key]['value'];\n\t\t\t\t}\n\t\t\t}\n\n\t\tthis.sendParams();\n\n\t}", "inboundState() {\n var op = getUrlParameter('op');\n var value = decodeURIComponent(getUrlParameter('value'));\n \n if (op === 'setSearchTerm') {\n this.quickSearch(value);\n $('#search-value').val(value);\n } else {\n this.setDataOp('setQueryParameter',['dc:language','en']);\n this.retrieveData().extractItems().displayResults();\n }\n \n \n }", "set materialSearch(value) {}", "applyScopes($event) {\n const $formInputs = $($event.target).parents('form').find(':input');\n const params = {};\n\n $formInputs.each((index, formInput) => {\n const $formInput = $(formInput);\n const inputName = $formInput.attr('name');\n const inputValue = $formInput.val();\n\n if (!inputName || !inputValue) {\n return;\n }\n\n params[inputName] = inputValue;\n });\n\n this.formParameters = params;\n\n this.loadModels(params);\n }", "runSearch() {\n this.books = this.service.getBooks(this.searchValue).subscribe(books => this.books = books);\n this.searchValue.setValue('');\n this.test = true;\n this.searched = true;\n }", "function filter($rootScope, $http, $timeout, $location, $compile, $cookieStore, gridService) {\n return {\n restrict: 'AE',\n require: 'ngModel',\n transclude: true,\n \n link: function (scope, element, attrs, ngModel) {\n \telement.bind(\"keydown\", function(event) {\n\t\t\tvar that = this;\n \t\tvar model = attrs.ngModel;\n\n\t\t\t//keydown hint\n\t\t\telement.next().css('display', 'block');\n\n\t\t\tif(event.keyCode === 229){\n\t\t\t\treturn;\n\t\t\t}\n\n \t\tif(event.which === 38){\n \t\t\tkeyUpOrDown(element, element.next(), 'up');\n \t\treturn;\n \t}\n\n \t\tif(event.which === 40){\n \t\t\tkeyUpOrDown(element, element.next(), 'down');\n \t\treturn;\n \t}\n\n\n if(event.which === 13) { \n scope.$apply(function(){\n \t\n \tvar value = element.val();\n if(value == undefined || value == null || value =='') return;\n\n\t\t\t\t\t// full search\n \tif(model == 'full'){\n \t\tmodel = 'name';\n \t\t\n \t\tif(value.indexOf('in investor')>0){\n \t\t\tmodel = 'investor';\n \t\t\tvalue = value.slice(0, value.length-13);\n \t\t}else if(value.indexOf('in keyword')>0){\n \t\t\tmodel = 'keyword';\n \t\t\tvalue = value.slice(0, value.length-12);\n \t\t}\n \t\t\n \t\tdoSearch($rootScope, scope, $http, $location, $cookieStore, gridService, value, model);\n \t\telement.next().css('display', 'none');\n\t\t\t\t\t\telement.next().children().removeClass('result-select');\n \t\treturn;\n \t}\n\n\n \t\n var bool =parseAndStorage(model, value, $cookieStore);\n \n if(model == 'keyword') scope.keyword = ''\n if(model == 'location') scope.location = '';\n if(model == 'investor') scope.investor = '';\n if(model == 'name') scope.name = '';\n \n if(bool)\n \treturn;\n \telse{\n \t\tvar el = $compile(appendElement(model, value))(scope);\n \t\telement.parent().children('span').first().append(el);\n \t}\n \n element.next().css('display', 'none');\n\t\t\t\t\telement.next().children().removeClass('result-select');\n\n if(!$('#div-'+model).is(\":visible\"))\n \t$('#div-'+model).css('display', 'inline-block');\n \n \n if(model == 'keyword'){\n\t // add relation tags\n\t \t$http.get('./api/tag/rel/get?name='+value).success(function(data){\n\t \t\tif(data.tags.length > 0){\n\t \t\t\t$rootScope.relItems = data.tags;\n\t \t\t\t$('.tag-rel').show();\n\t \t\t}else{\n\t \t\t\t$('.tag-rel').hide();\n\t \t\t}\n\t \t\t\n\t \t})\n }\n \n \n }); \n event.preventDefault();\n\n }\n \n });\n\n\t\t\telement.bind(\"keyup\", function(event) {\n\n\t\t\t\tvar keys = {\n\t\t\t\t\tESC: 27,\n\t\t\t\t\tTAB: 9,\n\t\t\t\t\tRETURN: 13,\n\t\t\t\t\tLEFT: 37,\n\t\t\t\t\tUP: 38,\n\t\t\t\t\tRIGHT: 39,\n\t\t\t\t\tDOWN: 40\n\t\t\t\t};\n\n\t\t\t\tif(event.keyCode === keys.LEFT || event.keyCode === keys.RIGHT\n\t\t\t\t\t|| event.keyCode === keys.DOWN || event.keyCode === keys.UP)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar value = element.val();\n\t\t\t\tif(value == '' || value ==null) return;\n\n\t\t\t\tvar model = attrs.ngModel;\n\n\t\t\t\tvar url = '/api/search/'+model;\n\t\t\t\tvar req = {\n\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\turl: url,\n\t\t\t\t\tdata: value\n\t\t\t\t}\n\n\t\t\t\t$http(req)\n\t\t\t\t\t.success(function(data) {\n\t\t\t\t\t\tscope.ajaxKeywordItems = data.tags;\n\t\t\t\t\t\tscope.ajaxInvestorItems = data.investors;\n\t\t\t\t\t\tscope.ajaxLocationItems = data.locations;\n\t\t\t\t\t\tscope.ajaxNameItems =data.names;\n\n\t\t\t\t\t\tif( model == 'full'){\n\t\t\t\t\t\t\tvar full = {};\n\t\t\t\t\t\t\tvar tags = [];\n\t\t\t\t\t\t\tvar investors = [];\n\t\t\t\t\t\t\tif(data.tags.length > 0)\n\t\t\t\t\t\t\t\ttags.push(data.tags[0]);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\ttags = null;\n\n\t\t\t\t\t\t\tif(data.investors.length > 0)\n\t\t\t\t\t\t\t\tinvestors.push(data.investors[0])\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tinvestors = null;\n\n\t\t\t\t\t\t\tfull.tags = tags;\n\t\t\t\t\t\t\tfull.investors = investors;\n\t\t\t\t\t\t\tfull.names = data.names;\n\n\t\t\t\t\t\t\tscope.ajaxFullItems = full;\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t})\n\t\t\t});\n\n \telement.bind(\"click\", function(event) {\n \t\tif(attrs.ngModel == 'full')\n \t\t\t$('.search-span').show();\n\n\t\t\t\tif(attrs.ngModel == 'add' && $(\"#add-company\").val() != \"\")\n\t\t\t\t\t$('.name-result-span').show();\n \t\t\n \t\tevent.stopPropagation();\n \t});\n \t\n \telement.bind(\"focusout\", function(event) {\n \t\t//element.next().css('display', 'none');\n \t})\n }\n }\n}", "function searchAndResults() {\n return messenger.searchIsReady().then(function (data) {\n var bag = data;\n quickSearch.getFormConfig($stateParams.entityId, $stateParams.userId, $stateParams.formId).then(function (data) {\n vm.data = data;\n vm.formFields = data.fields;\n rebuildModel(bag);\n quickSearch.getResults(vm.formModel).then(function (data) {\n vm.searchResults = data;\n });\n });\n });\n }", "function searchSubject() {\r\n search.subjects = $(\"#subjectsearch\").val().split(\",\");\r\n updateData();\r\n}", "setModel(model) {\n this.eFilterText.value = model;\n this.extractFilterText();\n }", "filterBooksBySearch(key,value) {\n //update state by search parameters passed from search module to actions to store\n this.setState({\n key: key,\n query: value.toLowerCase()\n });\n }", "search() {\n this.trigger('search', {\n element: this.searchBar,\n query: this.searchBar.value\n });\n }", "function addSearchFilter(textField, selected) {\n selected = jQuery(selected);\n var idName = selected.attr(\"data-id\");\n var idValue = selected.attr(\"data-idval\");\n /*NOTE: if user select qulifier, than idName -> name of param qualifier_id\n idValue -> value of this param, etc.\n else if user select keyword, then idName -> name of keyword_id or unread_only param, idValue-> value of param,\n but type&column name/value not exist\n */\n var typeName = selected.attr(\"data-type\");\n var typeValue = selected.attr(\"data-typeval\");\n var columnName = selected.attr(\"data-col\");\n var columnValue = selected.attr(\"data-colval\");\n\n if (idName && idName.length > 0) {\n var filterKeys = jQuery(\"#search_filter_form ul#search_filter_keys\");\n filterKeys.append('<input type=\"hidden\" name=\"'+idName+'\" value=\"'+idValue+'\"/>');\n if (typeName && typeName.length>0){\n filterKeys.append('<input type=\"hidden\" name=\"'+typeName+'\" value=\"'+typeValue+'\"/>');\n }\n if (columnName && columnName.length>0) {\n filterKeys.append('<input type=\"hidden\" name=\"'+columnName+'\" value=\"'+columnValue+'\"/>');\n }\n submitSearchFilterForm();\n } else {\n // probably selected a heading, just ignore\n }\n}", "function setSearchString(values)\r\n\t{\r\n\t\t// console.log(values);\r\n\t\tsearchString = values;\r\n\r\n\t}", "prepareRequestParams(options) {\n let requestParams;\n const searchKeys = _.split(options.searchKey, ','), matchModes = _.split(options.matchMode, ','), formFields = {};\n _.forEach(searchKeys, (colName, index) => {\n formFields[colName] = {\n value: options.query,\n logicalOp: 'AND',\n matchMode: matchModes[index] || matchModes[0] || 'startignorecase'\n };\n });\n requestParams = {\n filterFields: formFields,\n page: options.page,\n pagesize: options.limit || options.pagesize,\n skipDataSetUpdate: true,\n skipToggleState: true,\n inFlightBehavior: 'executeAll',\n logicalOp: 'OR',\n orderBy: options.orderby ? _.replace(options.orderby, /:/g, ' ') : ''\n };\n if (options.onBeforeservicecall) {\n options.onBeforeservicecall(formFields);\n }\n return requestParams;\n }", "search(v) {\n const query = pickBy({...this.$route.query, search: v}, identity);\n this.$router.replace({query});\n }", "buildSearchQuery() {\n if (this.get('invalidSearchTerm') || isEmpty(this.get('searchTerm'))) {\n return {};\n }\n const searchTerm = this.get('searchTerm');\n const query = {};\n\n if (this.get('searchType.date')) {\n if (dateHelper.isValidDate(searchTerm, 'MM/DD/YYYY')) {\n query.birthDate = searchTerm;\n } else {\n this.set('searchType.date', false);\n }\n }\n if (this.get('searchType.ssn')) {\n if (/^\\d{3}-?\\d{2}-?\\d{4}$/.test(searchTerm)) {\n query.socialSecurityNumber = searchTerm;\n this.set('searchTerm', PFStringUtil.formatSSN(this.get('searchTerm')));\n } else {\n this.set('searchType.ssn', false);\n }\n }\n if (this.get('searchType.name')) {\n merge(query, patientSearchUtil.formatNameParameters(searchTerm));\n }\n if (this.get('searchType.prn')) {\n query.patientRecordNumber = searchTerm;\n }\n return query;\n }", "function loadInitialQuery() {\n\t\t\t\n\t\t\tvar params = $location.search();\n\t\t\t\n\t\t\t// run predefined search if form parameters are passed in\n\t\t\tif (params.termSearch || params.stageSearch) {\n\t\t\t\t\n\t\t\t\tif (params.termSearch) {\n\t\t\t\t\tvm.termSearch = params.termSearch;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (params.stageSearch) {\n\t\t\t\t\tvm.stageSearch = params.stageSearch;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tsearch();\n\t\t\t}\n\t\t}", "searchByText(event) {\n this.state[event.target.query] = event.target.value;\n //this.props.SearchItems(this.state);\n }", "_search() {\n\t\tlet parms = {\n\t\t\tfirst: $(\"#firstBox\").val(),\n\t\t\tmiddle: $(\"#middleBox\").val(),\n\t\t\tlast: $(\"#lastBox\").val(),\n\t\t\tyear: $(\"#yearBox\").val()\n\t\t};\n\n\t\tlet me = this;\n\t\t$.ajax({\n\t \t\turl: '/search',\n\t\t\tdataType: 'json',\n\t\t\tdata: parms,\n\t\t\tsuccess: function success(data) {\n\t\t\t\tlet yearOnly = \n\t\t\t\t\t!(parms.first || parms.middle || parms.last) && parms.year || '';\n\n\t\t\t\tme.setState({ yearOnly: yearOnly, loaded: true, result: data});\n\t\t\t},\n\t\t\terror: function error(xhr, status, err) {\n\t\t\t\tconsole.error(err);\n\t\t\t}\n\t\t});\n\t}", "function attemptSearchByUrl(){\n // Manage GET query parameters from the URL\n var getQueryParams = $location.search();\n var hasParams = Boolean(Object.keys(getQueryParams).length);\n\n // Conduct search or reset the selection\n if (hasParams){\n vm.searchCriteria = getQueryParams;\n search(vm.searchCriteria);\n populateMultiChoiceSearchSelection(getQueryParams);\n }else{\n vm.searchCriteria = {}\n }\n }", "static search(query = {}, config = {}) {\n const model = new this();\n\n config = Object.assign({\n params: query,\n }, config);\n\n return new Promise((resolve, reject) => {\n model.$request = this.request('get', (config.uri || model.uri()), config);\n model.$request.send().then(response => {\n resolve(response);\n }, errors => {\n reject(errors);\n });\n });\n }", "function search() {\n $.var.currentSupplier = $.var.search;\n $.var.currentID = 0;\n $.var.search.query = $(\"#searchable\").val();\n if ($.var.search.query.trim().length === 0) { // if either no string, or string of only spaces\n $.var.search.query = \" \"; // set query to standard query used on loadpage\n }\n $.var.search.updateWebgroupRoot();\n}", "function search() {\n let search_text = $search_text.value;\n decide_search(search_text)\n}", "function searchToQuery(search, call, otpConfig) {\n // FIXME: how to handle realtime updates?\n var queryParams = (0, _api.getRoutingParams)(search.query, otpConfig, true);\n var _search$query = search.query,\n from = _search$query.from,\n to = _search$query.to;\n return {\n queryParams: JSON.stringify(queryParams),\n fromPlace: from.name || placeToLatLonStr(from),\n toPlace: to.name || placeToLatLonStr(to),\n timeStamp: search.query.timestamp,\n call: call\n };\n}", "function handleSearch() {\n triggerSearch({}); // need empty braces here\n }", "function setUrlSearchParams(data) {\n let urlSearchParams = new URLSearchParams();\n for (let name in data) {\n urlSearchParams.append(name, data[name]);\n }\n return urlSearchParams;\n}", "function setUrlSearchParams(data) {\n let urlSearchParams = new URLSearchParams();\n for (let name in data) {\n urlSearchParams.append(name, data[name]);\n }\n return urlSearchParams;\n}", "function populateDrugsSearchForm(savedSearch) {\n\t$('#dIndication').val(savedSearch.indication);\n\t$('#dRoute').val(savedSearch.route);\n}", "function getModelParameters(model) {\n\n var modelFilters = model.FILTRES;\n\n var filters = [];\n\n //we find variables in FILTRES variables.\n if(modelFilters != \"\" && modelFilters != null ){\n var modelFiltersArray = modelFilters.split(\",\");\n for(var key in modelFiltersArray){\n var modelFiltersValues = modelFiltersArray[key].split(\"=\");\n filters.push(modelFiltersValues[0]);\n }\n }\n\n return filters;\n}", "function updateSearchText(searchText){\n $(selector.searchBox).val(searchText);\n }", "function changeLocalSearch(){\n gridManager.setLocalSearch($scope.data.localSearch);\n}", "function get_search(val){\n setState(val.target.value);\n }", "function personalityFilterBindings(){\n var selector = thisInstance.constants.selector;\n $(selector.personalityFilterWrap).find(selector.personalityFilter).click(function(event){\n event.preventDefault();\n var personality = $(this).data('personality');\n fetchAndLoadUserList({personality: personality, department: \"\"});\n });\n }", "async searchAttr (page, pageSize, sort, inputSearch, paramsRequest, params) {\n\t\tparams = params.slice()\n\t\tparams.push.apply(params, paramsRequest)\n\t\tlet entities = this._filter(this._entities, params, inputSearch)\n\t\tthis._orderBy(entities, sort)\n\t\tentities = this._paginate(entities, page, pageSize)\n\t\treturn {\n\t\t\tcount: entities.length,\n\t\t\tentities: entities\n\t\t}\n\t}", "function searchObject(value){\r\n\tthis.page=\"1\";\r\n\tthis.rows=\"10\";\r\n\tthis.sord=\"asc\";\r\n\tthis.sidx=\"codigo\";\r\n\tthis.descripcion=\"\";\r\n\tthis.codigo=value;\r\n}", "function getBrewerSearchParams($q) {\n\t\tconsole.log('getting Search parameters');\n\t\tvar type = 'brewery';\n\t\tvar withBreweries = 'Y';\n\n\t\tparams = new SearchBrewerNameParams($q, type, withBreweries, searchType); //New params instance\n\t\tconsole.log('params =');\n\t\tconsole.log(params);\n\n\t\tparams = truthy(params); //Exec truthy fn\n\t\tconsole.log('params =');\n\t\tconsole.log(params);\n\n\t\tpostResponse(params, searchType); //Exec postResponse fn\n\t}", "function handleSearchClick(){\r\n var temp = document.getElementById('searchText').value;\r\n fetchRecipesBySearch(temp);\r\n }", "handleSearchChange(event){\n let val = event.target.value; \n this.searching = val;\n }", "updateBeforeRetrieval(tab, searchProp, searchVal) {\n const {accounting} = this.props;\n // change the page back to 1 when searching\n this.changePage(tab, false, { selected: 0 });\n // Remove unused search params, update search params\n const search = accounting.get('search').map(type => type.filter(param => param));\n if (typeof searchProp !== 'undefined' && typeof searchVal !== 'undefined') {\n return search.setIn([tab, searchProp], searchVal).toJS();\n } else {\n return search.toJS();\n }\n }", "beforeSearch(params, populate) {\n console.log(\"Hereeeeeeeeeee 11\");\n }", "function _triggerSearch() {\n Mediator.pub(\n CFG.CNL.DICTIONARY_SEARCH,\n (_searchIsActive ? _$search.val() : \"\")\n );\n }", "function __filter(model) {\n\tconst modelKey = model.names.kebab;\n\treturn model.fields.searchable.reduce((p, f) => {\n\t\tconst key = f.names.kebab;\n\t\tp[`${modelKey}_${key}`] = `${f.names.capital}`;\n\t\tif (f.type === 'number' || f.type === 'datetime') {\n\t\t\tp[`${modelKey}_${key}--min`] = `${f.names.capital} min`;\n\t\t\tp[`${modelKey}_${key}--max`] = `${f.names.capital} max`;\n\t\t}\n\t\treturn p;\n\t}, {});\n}", "function handleSearch(obj, namespace) {\r\n\tnamespace.filterVals = [];\r\n\tvar toFilter = true;\r\n\tvar filterId = namespace.grid.customFilterId;\r\n\tif ($(obj).prop('nodeName') == 'SELECT' && $(\"#\" + namespace.grid.customFilterId + \"_grid_filter_box\").val().length < 1) {\r\n\t\ttoFilter = false;\r\n\t}\r\n\tif (toFilter) {\r\n\t\tvar andCriteria = '';\r\n\t\tif ($(\"#\" + namespace.grid.customFilterId + \"_xel_gridsearch_type_dropdown\").val() == 'All') {\r\n\r\n\t\t} else {\r\n\t\t\tandCriteria = ' and hierarchyItemType= \"' + $(\"#\" + namespace.grid.customFilterId + \"_xel_gridsearch_type_dropdown\").val() + '\"';\r\n\t\t}\r\n\t\tnamespace.filterFields.forEach(function (field) {\r\n\t\t\tvar snapshot = Defiant.getSnapshot(namespace.grid.getDataProvider());\r\n\t\t\tvar searchList = JSON.search(snapshot, '//*[contains(' + field + ',\"' + $(\"#\" + namespace.grid.customFilterId + \"_grid_filter_box\").val() + '\") or text()=\"' + $(\"#\" + namespace.grid.customFilterId + \"_grid_filter_box\").val() + '\" ' + andCriteria + ']');\r\n\t\t\tnamespace.filterVals = namespace.filterVals.concat(searchList);\r\n\t\t});\r\n\t\tnamespace.grid.processFilter();\r\n\t\tnamespace.grid.expandAll();\r\n\t\tresetScroll(namespace.grid);\r\n\t}\r\n}", "updateSearch(event) {\n this.updateTable(event.target.value);\n }", "handleSearchInputChange(event){\n this.setState({\n search: event.target.value\n }, this.reloadResult);\n FilterUserInput.search = event.target.value;\n }", "_getQuerySuggest(data, params) {\n return {\n text: data,\n outFields: params.outFields || '*',\n maxSuggestions: params.maxSuggestions || 10,\n };\n }", "function search(val){\n\t\t\t\n\t\t\t\tvar xhttp = new XMLHttpRequest();\n\t\t\t\txhttp.open(\"POST\", \"../model/user-model.js\", true);\n\t\t\t\txhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n\t\t\t\txhttp.send('key='+val);\n\t\t\t\n\t\t\t\txhttp.onreadystatechange = function() {\n\t\t\t\t\tif (this.readyState == 4 && this.status == 200) {\n\t\t\t\t\t \tdocument.getElementById('result').innerHTML = this.responseText;\t\t\t\t\t \n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t}", "function SearchUserObject() {\n concatResult();\n window.searchQuery = searchInput.value;\n CreateURI(centerLat, centerLng);\n}", "handleSearchChange(event){\n let val = event.target.value;\n this.searching = val;\n }", "cbFilterData(event) {\n if (this.searchValue === event.target.value) {\n return;\n }\n\n this.searchValue = event.target.value;\n\n this.filterData();\n\n this.updateBody();\n }", "function SearchAction(){\n\tvar id_matpal \t\t= $('#s_idmatpal').val();\n\tvar param \t\t\t= {'id_matpal':id_matpal};\n\t\tparam \t\t\t= JSON.stringify(param);\n\n\t$('#hid_param').val(param);\n\n\tvar table = $('#tb_list').DataTable();\n\ttable.ajax.reload( null, false );\n\ttable.draw();\n\n\t$('#Modal_cari').modal('toggle');\n}", "function setSearchQuery (queryString) {\n vm.table.searchQuery = queryString;\n }", "modelValueFilter(model, record, complete){\n\t\tlet result = {};\n\t\tlet keys = _.keys(model);\n\n\t\tif(!complete){\n\t\t\tkeys = _.intersection(_.keys(record), keys);\n\t\t}\n\n\t\t_.each(keys, (v) => {\n\t\t\tif(/^_/.test(v)) return;\n\t\t\t// set default\n\t\t\tif(record[v] !== undefined){\n\t\t\t\tresult[v] = record[v];\n\t\t\t}else if( _.isObject(model[v])){\n\t\t\t\tresult[v] = model[v].default;\n\t\t\t}else{\n\t\t\t\tresult[v] = undefined;\n\t\t\t}\n\t\t});\n\n\t\treturn result;\n\t}", "function searchAttraction(input){\n\n if(typeof input !== 'undefined' && input !== '')\n {\n\n vm.model.currentIndex = 0;\n element.find('button.searchbtnbox').toggleClass('changed');\n var promise = vm.model.search(input);\n\n\n promise.then(function(){\n $state.go('attraction',{});\n element.find('button.searchbtnbox').toggleClass('changed');\n //element.find('button#pane-section-pagination-button-prev').addClass('pane-section-pagination-button-disabled');\n $rootScope.$emit('setMarkers',{data:vm.model.data});\n vm.event.reset();\n $rootScope.$emit('setCenter',{geolocation:{lat:vm.model.data[0].geometry.location.lat(),lng:vm.model.data[0].geometry.location.lng()}});\n\n },function(error){\n console.log(error);\n });\n\n }\n else {\n FlashService.create('The input cannot be empty!');\n }\n }", "function fnFetchAndSaveWorklistSearchField() {\n\t\t\tvar oSmartTable = oState.oSmartTable;\n\t\t\tvar aTableToolbarContent = oSmartTable.getCustomToolbar().getContent();\n\t\t\tfor (var index in aTableToolbarContent) {\n\t\t\t\tif (aTableToolbarContent[index].getId().indexOf(\"SearchField\") > -1) {\n\t\t\t\t\toState.oWorklistData.oSearchField = aTableToolbarContent[index];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "setQueryParameter(parameter,value,operator='like') {\n \n this.query.push({\n name: \"query_field[]\",\n value: parameter\n });\n \n this.query.push({\n name: \"query_op[]\",\n value: operator\n });\n \n this.query.push({\n name: \"query_val[]\",\n value: value\n });\n \n return this; \n }" ]
[ "0.7259465", "0.7259465", "0.62701225", "0.61706376", "0.6068848", "0.59847015", "0.5893689", "0.5849422", "0.5848959", "0.5814683", "0.57553935", "0.57285357", "0.5724531", "0.57236356", "0.5723054", "0.5710857", "0.5688826", "0.5650459", "0.5646865", "0.564323", "0.5636922", "0.5633746", "0.56035924", "0.5563582", "0.5541291", "0.55283034", "0.5511925", "0.5509992", "0.5506712", "0.55056393", "0.5503806", "0.549711", "0.54895234", "0.5489003", "0.5486701", "0.5485484", "0.5482374", "0.5475427", "0.5441951", "0.543868", "0.5426516", "0.5420178", "0.5418659", "0.5411262", "0.53941685", "0.5378451", "0.53705335", "0.5369475", "0.5365579", "0.53615856", "0.5340017", "0.53306156", "0.53122973", "0.5311738", "0.5310005", "0.5309282", "0.5301612", "0.53015965", "0.53000057", "0.529766", "0.5287079", "0.52776986", "0.5273046", "0.525618", "0.5255813", "0.52505934", "0.5244873", "0.52416515", "0.52395445", "0.52367043", "0.52293855", "0.52293855", "0.5220077", "0.5219345", "0.5217681", "0.5216546", "0.52156234", "0.5207562", "0.5203114", "0.51974046", "0.5194214", "0.5188252", "0.51865226", "0.51852864", "0.5173779", "0.51713616", "0.5170748", "0.5170712", "0.5167434", "0.51562464", "0.51516116", "0.5144093", "0.51405317", "0.5138823", "0.51366013", "0.513358", "0.51334924", "0.51329184", "0.5112058", "0.51114243", "0.5111221" ]
0.0
-1
Generates the HTML for a link to the destination
function createDestinationLink(destinationName, destinationType) { if (destinationType === void 0) { destinationType = "queue"; } return $compile('<a target="destination" title="' + destinationName + '" ng-click="connectToDestination()">' + destinationName + '</a>')($scope); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeLink() {\n // var a=\"http://www.geocodezip.com/v3_MW_example_linktothis.html\"\n var url = window.location.pathname;\n var a = url.substring(url.lastIndexOf(\n '/') + 1) + \"?lat=\" +\n map.getCenter()\n .lat()\n .toFixed(6) + \"&lng=\" +\n map.getCenter()\n .lng()\n .toFixed(6) +\n \"&zoom=\" + map.getZoom() +\n \"&type=\" +\n MapTypeId2UrlValue(map.getMapTypeId());\n if (filename !=\n \"TrashDays40.xml\") a +=\n \"&filename=\" + filename;\n document.getElementById(\n \"link\")\n .innerHTML =\n '<a href=\"' + a +\n '\">Link to this page<\\/a>';\n }", "toLinkUrl() {\r\n return this.urlPath + this._stringifyAux() +\r\n (isPresent(this.child) ? this.child._toLinkUrl() : '');\r\n }", "function createLink(url,text){\r\n\treturn \"<a href=\\\"\"+url+\"\\\"\"+Target+\">\"+text+\"</a>\";\r\n}", "generateLink() {\n return `\n <a href='https://en.wikipedia.org/wiki/${encodeURI(this.options[0])}' property='rdf:seeAlso'>\n ${this.options[0]}\n </a>&nbsp;\n `;\n }", "function generateLink(queryStrings){\n\tgame_id = queryStrings['gid']\n\tvar link = $('<a></a>')\n\t\t.attr(\"href\",\"index.html\")\n\t\t.append(\"<span class='backLink'>< Back to Scoreboard</span>\")\n\t$('#link').html(link)\n}", "function buildLink(xx,yy,ii,jj,kk,ll,colonyData){\r\n\tgetCell(xx,yy,ii,jj).innerHTML = createLink(constructionUrl(kk,ll,colonyData),getCell(xx,yy,ii,jj).innerHTML);\r\n}", "function generateUrl(el) {\n\tvar generatedUrl = assembleUrl();\n\n\t// ADD TO CLIPBOARD add it to the dom\n\tcopyToClipboard(generatedUrl);\n\tdomElements.wrapperUrl.el.html(generatedUrl);\n}", "function renderLinkout( context, product, promoted, slug, url, text, isButton ) {\n\t\t\tvar linkoutButton = document.createElement( 'a' );\n\n\t\t\tvar utmUrl = addUTMParameters( context, url );\n\t\t\tlinkoutButton.setAttribute( 'href', utmUrl );\n\t\t\tlinkoutButton.setAttribute( 'target', 'blank' );\n\t\t\tlinkoutButton.textContent = text;\n\n\t\t\tlinkoutButton.onclick = function() {\n\t\t\t\twindow.wcTracks.recordEvent( 'marketplace_suggestion_clicked', {\n\t\t\t\t\tsuggestion_slug: slug,\n\t\t\t\t\tcontext: context,\n\t\t\t\t\tproduct: product || '',\n\t\t\t\t\tpromoted: promoted || '',\n\t\t\t\t\ttarget: url || ''\n\t\t\t\t} );\n\t\t\t};\n\n\t\t\tif ( isButton ) {\n\t\t\t\tlinkoutButton.classList.add( 'button' );\n\t\t\t} else {\n\t\t\t\tlinkoutButton.classList.add( 'linkout' );\n\t\t\t\tvar linkoutIcon = document.createElement( 'span' );\n\t\t\t\tlinkoutIcon.classList.add( 'dashicons', 'dashicons-external' );\n\t\t\t\tlinkoutButton.appendChild( linkoutIcon );\n\t\t\t}\n\n\t\t\treturn linkoutButton;\n\t\t}", "function changeLinkToHtml() {\n var allLinks = document.querySelectorAll('#'+parameters.cdmContainer+' a');\n allLinks.forEach(function (item) {\n item.setAttribute(\"href\", (item.getAttribute(\"href\"))+\".html\");\n });\n\n }", "function changelinkDestination(destination) {\n link.href = destination;\n }", "function displayToPage(url) {\n spanEl.innerHTML = `<a id=\"link\" href=\"${url}\" target=\"_blank\" class=\"generated-url-link\">${url}</a>`;\n // Get the anchor link after is generated\n let generatedLink = document.getElementById('link');\n // Style the link with random colors\n generatedLink.style.color = pickRandomColors(arrOfColors);\n}", "function makeLink() {\n// var a=\"http://www.geocodezip.com/v3_MW_example_linktothis.html\"\n/*\n var url = window.location.pathname;\n var a = url.substring(url.lastIndexOf('/')+1)\n + \"?lat=\" + mapProfile.getCenter().lat().toFixed(6)\n + \"&lng=\" + mapProfile.getCenter().lng().toFixed(6)\n + \"&zoom=\" + mapProfile.getZoom()\n + \"&type=\" + MapTypeId2UrlValue(mapProfile.getMapTypeId());\n if (filename != \"FlightAware_JBU670_KLAX_KJFK_20120229_kml.xml\") a += \"&filename=\"+filename;\n document.getElementById(\"link\").innerHTML = '<a href=\"' +a+ '\">Link to this page<\\/a>';\n*/\n }", "function g_link(template, id) {\r\n return \"/\" + template.id + \"/\" + id;\r\n}", "function createLink() {\n const editor = document.querySelector(`.editor-wrap`);\n const text = document.querySelector(`.editor`).innerText;\n const encoded = encodeUnicode(text);\n\n html2canvas(editor, {width: 700}).then((canvas) => {\n document.body.querySelector(`.result`).appendChild(canvas);\n });\n document.querySelector(`#text`).innerHTML = `<a href=\"/?text=${encoded}\">Copy link for plaintext</a>`;\n}", "@method createNavigationLinkHTML(contents, path) {\n if (typeof contents != \"string\") {\n // Retrieve the HTML for the element.\n var tempDiv = I3.ui.create(\"div\");\n tempDiv.appendChild(contents);\n contents = tempDiv.innerHTML;\n }\n var eventParams = I3.browser.isIE() ? \"\" : \"event\";\n return '<a href=\"#' + path +\n '\" onclick=\"return I3.ui.onNavigationClick(' + eventParams +\n ');\">' + contents + '</a>';\n }", "function link() {\n var LINKY_URL_REGEXP =\n /((ftp|https?):\\/\\/|(www\\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\\S*[^\\s.;,(){}<>\"”’]$/;\n var sub = selection.anchorNode.data.substring(0, selection.anchorOffset - 1);\n if (LINKY_URL_REGEXP.test(sub)) {\n var matchs = sub.match(LINKY_URL_REGEXP);\n if (matchs && matchs.length) {\n var st = selection.anchorOffset - matchs[0].length - 1;\n range.setStart(selection.anchorNode, st);\n scope.doCommand(null, {\n name: 'createLink',\n param: matchs[0]\n });\n }\n }\n }", "getHref() {\n switch (this.type) {\n case \"room\":\n return \"room.html?\" + this.id + \"+\" + this.title.split(' ').join('_');\n case \"device\":\n return \"device.html?\" + this.id + \"+\" + this.title.split(' ').join('_');\n default:\n return \"home.html\";\n }\n }", "function generateHtml() {\n const folder = fs.readdirSync(`${__dirname}/projects`);\n let myHtml = \" \";\n folder.forEach((arg) => {\n myHtml += `<p><a href=\"/${arg}/\">${arg}</a></p>`;\n });\n return myHtml;\n}", "function generateLinksHTML() {\n let html = `\n<div class=\"btn-toolbar btn-toolbar-lg text-center\" role=\"toolbar\" />\n <div class=\"btn-group btn-group-lg\" role=\"group\">\n <button class = \"btn-light btn-lg\" id=\"copy-button\">Copy Link</button>\n </div>\n <div class=\"btn-group\" role=\"group\">\n <button class = \"btn-light btn-lg\" id=\"open-button\">Open Link</button>\n </div>\n</div>\n`\n return html;\n}", "function g_link(template, item) {\r\n return \"/\" + template.id + \"/\" + item.id;\r\n}", "function generate_link_element(link_data) {\n\tvar link = document.createElement(\"a\");\n\tlink.classList.add(\"link\");\n\tlink.style.color = foreground_color;\n\tlink.href = link_data.link;\n\tlink.textContent = link_data.title;\n\n\treturn link;\n}", "function addLink (target, link) {\n\torgHtml = document.getElementById(target).innerHTML;\n\tnewHtml = link + orgHtml + \"</a>\";\n\tdocument.getElementById(target).innerHTML = newHtml;\n}", "function buildLink(callback){\n var floatingPanel = document.createElement('a');\n var panelStyle = 'display:none; position:fixed;z-index:9999999;top:10px;width:200px;left:50%;margin-left:-100px;font-family:Helvetica;color:#ffffff;background-color:#F37A1F; text-decoration:none; text-align:center; box-shadow:0px 2px 10px #999999; border-radius:4px; ';\n floatingPanel.setAttribute('href', url());\n floatingPanel.setAttribute('style', panelStyle);\n floatingPanel.setAttribute('id', 'clickPanel');\n floatingPanel.setAttribute('target','_blank');\n var linkHeader = document.createElement('h3');\n linkHeader.setAttribute('style','line-height:40px; text-decoration:none; font-size:18px;');\n var linkText = document.createTextNode('Track Shipments');\n floatingPanel.appendChild(linkHeader);\n linkHeader.appendChild(linkText);\n document.body.appendChild(floatingPanel);\n callback();\n}", "function buildCreatedLink (linkURL) {\n if(Bkg.DEBUG)\n console.log(\"Popup.buildCreatedLink:\" + linkURL);\n var string = \"<span class='created_task_conv_link'>\" + linkURL + \"</span>\";\n return string;\n}", "function createLink(actionContext, params) {\n var params_to_copy,\n mergedParams,\n k;\n if (actionContext.params.hasOwnProperty('merge')) {\n params_to_copy = actionContext.params.merged();\n } else {\n params_to_copy = actionContext.params.getFromMerged();\n }\n mergedParams = Y.mojito.util.copy(params_to_copy);\n for (k in params) {\n if (params.hasOwnProperty(k)) {\n mergedParams[k] = params[k];\n }\n }\n return actionContext.url.make('frame', 'index', Y.QueryString.stringify(mergedParams));\n }", "function makeHyperlink(url){\n return '<a target=\"_blank\" href=\"'+ url+ '\">' + url + '</a>'\n}", "function generateURL(){\n\tbroadcastURL.innerHTML = baseURL+senderID;\n}", "goLink() {\n\t\tlet link = this.props.link;\n\t\twindow.open(link, \"_blank\")\n\t}", "function generateLink(title, page, local) {\n return `[${title}](${URL}${page}.html${local || ''})`;\n}", "function renderSharingLink() {\n var $shareLink = $('#sharing-link');\n $shareLink.attr('href', document.location.href);\n $shareLink.html(document.location.href);\n}", "function e() {\n window.location = linkLocation;\n}", "function itemGenerateLink() {\n\n var markup = ga('<section id=\"item_get_direct_link\"><div class=\"layer_ovr\"></div>\\\n\t<div class=\"item-direkt-link-p\">\\\n\t<span title=\"close\" class=\"tico tico__n-t notifs_close close-direkt-link-popup\"><i class=\"tico_img ic ic_close\"></i></span>\\\n\t<div class=\"drlk1\">' + lang.direct_url + '</div>\\\n\t<div class=\"drlk2\"><input type=\"text\" value=\"' + window.location + '\"/></div>\\\n\t<div class=\"drkl3 taCenter\"><button id=\"copy_to_clipboard\" class=\"flat_button\">Copy to clipboard</button></div>\\\n\t</div></div>');\n\n var $b = ga('body');\n\n if(!$b.find('#item_get_direct_link').length)\n $b.prepend(markup);\n\n $b.find('.close-direkt-link-popup').on('click.closeItemDirectLink', function(e) {\n $b.find('#item_get_direct_link').remove();\n });\n\n $b.off('keyup.closeItemDirectLink').on('keyup.closeItemDirectLink', function(e) {\n\n if(e.keyCode == 27)\n $b.find('#item_get_direct_link').remove();\n });\n markup.find('#copy_to_clipboard').on('click', function() {\n copyText(markup.find('input').val());\n\n });\n markup.find('input')[0].select();\n markup.find('input').focus();\n\n}", "function generateLink(ev) {\n ev.preventDefault();\n\n const fullNameValidation = validateFullName();\n const rollNumberValidation = validateRollNumber();\n const departmentValidation = validateSelection();\n\n firstValidation = false;\n\n if (fullNameValidation && rollNumberValidation && departmentValidation) {\n const fullNameValue = fullName.value.trim();\n const rollNumberValue = rollNumber.value.trim();\n const departmentValue = department.value;\n\n // Pick a random rating for feedback\n const ratingsAvailable = ['5 - Excellent', '4 - Good', '3 - Average'];\n const randomRating = ratingsAvailable[Math.floor(Math.random() * 3)];\n\n const baseUrl =\n 'https://docs.google.com/forms/d/e/1FAIpQLScJu10Mv2uYVoCEvY7-thq5UMpbXfV466aMU6O9REaqVosNeA/formResponse';\n\n const queryUrl = `${baseUrl}?entry.1110617932=${rollNumberValue.toUpperCase()}&entry.1569197185=${fullNameValue}&entry.1265045525=${departmentValue}&entry.248948479=${rollNumberValue.toLowerCase()}@cvsr.ac.in&entry.362064286=${randomRating}&entry.624867601=No+issues&entry.940688449=Nothing&submit=Submit`;\n\n linkContent.textContent = queryUrl;\n linkBox.classList.add('show');\n } else {\n return;\n }\n}", "function leadsLink(val){\n\n //debugger;\n return '<li><a href=\"#page\" class=\"dynamic\" id=\"'+key+'\"><h2>' + val.name + '</h2><p>' + val.email + '</p><p class=\"ui-li-aside\"><strong>' + val.date +'</strong></p></a></li>';\n \n }", "link() {\n this._template = this._sbolDocument.lookupURI(this._template);\n this._variableComponents = this._sbolDocument.lookupURIs(this._variableComponents);\n }", "_toLinkUrl() {\r\n return this._stringifyPathMatrixAuxPrefixed() +\r\n (isPresent(this.child) ? this.child._toLinkUrl() : '');\r\n }", "function drawLink() {\n var stat = getState(cm);\n var url = \"http://\";\n _replaceSelection(cm, stat.link, insertTexts.link, url);\n}", "function createResultLink(doc) {\n const [year, month, day] = parseYearMonthDateFromUrl(doc);\n const topic = contentByDate.getTopicName(doc);\n const id = `result-${year}-${month}-${day}-${topic.replace(/\\s/g, '-')}`;\n\n const result = {\n day, doc, id, month, topic, year\n };\n\n result.link = `<a id=\"${id}\"','${contentDivName}')\">${year}/${month}/${day} ${topic}</a>`;\n return result;\n }", "render (h) {\n return h('a', {\n attrs: {\n href: this.to\n },\n on: {\n click: this.guardEvent\n }\n }, [this.$slots.default])\n }", "function _(e){var t=document.createElement(\"a\");return t.href=e,t}", "function getURL(){\n\tvar html = document.getElementById(\"report\")\n\tvar share = document.getElementById(\"share\")\n\tvar url = window.location.href\n\thtml.innerHTML += \"<a href=\\\"mailto:photosectNL@gmail.com?subject=Reported%20Image&body=\"+ encodeURIComponent(url) +\"\\\">Report offensive image here</a>\"\n\tshare.innerHTML += \"<a href=\\\"mailto:?subject=Check%20out%20this%20image%20on%20PhotoSect!&body=\"+ encodeURIComponent(url) +\"\\\">Share with friends!</a>\"\n}", "function makeLink(target, content) {\n // a local let\n\n let elemA = document.createElement(\"a\");\n\n // use the param \"target \" to go into the href\n elemA.href = target;\n //and the param \"content\" for what goes inside the tag\n elemA.innerText = content;\n\n // add an target Attribute for fun \n elemA.setAttribute(\"target\", \"_blank\");\n\n // a local divMain aswell \n let divMain = document.getElementsByTagName(\"div\");\n divMain[0].appendChild(elemA);\n}", "function generateLink(email, location) {\n return `https://www.reportmysupplies.app?email=${encodeURI(email)}&location=${encodeURI(location)}`;\n}", "function link(e) {\n let eqList = [];\n\n for (let f of funcs) {\n eqList.push(f.value);\n }\n let url = window.location.origin + window.location.pathname;\n let eqs = [];\n for (let eq of eqList) {\n eqs.push(`\"${eq}\"`);\n }\n url += `?eqs=[${eqs}]`;\n url += `&angles=[${data.cameraUniforms.u_angles}]`;\n url += `&zoom=${data.cameraUniforms.u_zoom}`;\n url += `&size=${data.settings.u_bounds}`;\n // the string needs to be doubly escaped to be valid JSON\n url = encodeURI(url.replace(/\\\\/g, \"\\\\\\\\\"));\n message(\"Copied URL to Clipboard\");\n console.log(\"Copied URL to Clipboard: \" + url);\n navigator.clipboard.writeText(url);\n }", "function toHTML(links) {\n var linkStand = asTable();\n\n for (var i = 0 ; i < links.length ; i++) {\n\n linkStand.write({name:links[i].name, url: links[i].url})\n }\n\n linkStand.end();\n\n return linkStand;\n}", "function generateAnchor(url, name) {\n let anchor = document.createElement(\"a\");\n anchor.href = url;\n anchor.innerText = name;\n anchor.id = \"save-as\";\n return anchor;\n}", "function makeViewLink(text)\n{\n const link = makeLink(text, \"javascript:void(0)\");\n link.attr(\"id\", text);\n link.addClass(\"view\");\n return link;\n}", "function makeLinkRet(target, content) {\n // a local let\n\n let elemA = document.createElement(\"a\");\n\n // use the param \"target \" to go into the href\n elemA.href = target;\n //and the param \"content\" for what goes inside the tag\n elemA.innerText = content;\n\n // add an target Attribute for fun \n elemA.setAttribute(\"target\", \"_blank\");\n\n\n\n return elemA;\n}", "function _getLink(text, enabled, urlFormat, index) {\n if (enabled == false)\n return J.FormatString(' <a class=\"button-white\" style=\"filter:Alpha(Opacity=60);opacity:0.6;\" href=\"javascript:void(0);\"><span>{0}</span></a>',\n text);\n else\n return J.FormatString(' <a class=\"button-white\" href=\"javascript:window.location.href=\\'' + urlFormat + '\\';\"><span>{1}</span></a>', index, text);\n }", "function formAnchorHtml(href, label) {\r\n\treturn \"<div class='linkContainer'>\" + label + \": <a href='\" + href + \"' target='_blank'>\" + href + \"</a></div>\";\r\n}", "function link_generator(data){\n\n var i = 0,\n title = data[1],\n description = data[2],\n link = data[3];\n\n for(i; i < data[3].length; i++){\n var list_link = '<a href=\"'+link[i]+'\">'+title[i]+'</a><br/>';\n list_description = list_link+description[i]+'<hr>';\n links.append(list_description);\n }\n }", "function insert_node_destination(link){\n var attr=jQuery(link).attr('href');\n var p=attr.indexOf('#');\n var anchor='';\n if(p!=-1){\n anchor=attr.substr(p);\n attr=attr.substr(0,p);\n }\n attr+=attr.indexOf('?')==-1?'?':'&';\n url=location.pathname.substring(1);\n jQuery(link).attr('href',attr+'destination='+url+anchor);\n}", "async getOutputHref(data) {\n this.bench.get(\"(count) getOutputHref\").incrementCount();\n let link = await this._getLink(data);\n return link.toHref();\n }", "function write(data, enc, callback) {\n // HREF is the HTML attribute extracted from anchor tags with a\n // destination that links back into the site.\n var href = data.destination;\n // To aid in debugging, set 'source' to the original source of this link -\n // the Markdown page from which the HTML containing the link was\n // generated.\n var source = data.source\n .replace(build, './content')\n .replace('.html', '.md');\n var prefix = format('\"%s\" linked from \"%s\" - ', href, source);\n\n t.equal(href[0], '/', format('%s should be absolute', prefix));\n\n // The linked destination should have a file in the build directory.\n var file = path.join(build, href);\n stat(file, function onstat(err, stats) {\n t.error(err, format('%s should exist', prefix));\n callback();\n });\n }", "function createLink(href, title, method = 'GET', schemaUrl = '') {\n return `\n <a\n class=\"resource-link\"\n href=\"${escapeAttr(href)}\"\n data-method=\"${escapeAttr(method)}\"\n data-schema-url=\"${escapeAttr(schemaUrl)}\"\n >${escapeHtml(title)}</a>\n `.trim();\n }", "makeLink(session) {\n\n var link = '';\n if(session.context.name) link += '&OrganizationName=' + session.context.name.replace(/ /ig, '+');\n if(session.context.city) link += '&City=' + session.context.city.replace(/ /ig,'+');\n if(session.context.state) link += '&StateProvince=' + session.context.state;\n if(session.context.zip) link += '&PostalCode='+session.context.zip;\n return link;\n }", "function CreateLink(editor) {\r\n\tthis.editor = editor;\r\n\tvar cfg = editor.config;\r\n\tvar self = this;\r\n\r\n editor.config.btnList.createlink[3] = function() { self.show(self._getSelectedAnchor()); }\r\n}", "function fn_createlink(strImgLink)\r\n{\r\n\tvar tempCode;\r\n\ttempCode = \"<a href = \" + chr(34) + strImgLink + chr(34) + \"> View </a>\";\r\n\treturn tempCode + Chr(10);\r\n}", "function generateLinkToCurrentView() {\n\tvar linkToCurrentView = window.location.href.split('?')[0] + '?';\n\tvar first = true;\n\tfor(var i in viewerVars.pvs) {\n\t\tvar pvName = viewerVars.pvs[i];\n\t\tif(first) { first = false; } else { linkToCurrentView += \"&\"; }\n\t\tlinkToCurrentView += \"pv=\" + pvName;\n\t}\n\tlinkToCurrentView += \"&from=\" + viewerVars.start.toISOString();\n\tlinkToCurrentView += \"&to=\" + viewerVars.end.toISOString();\n\tconsole.log(linkToCurrentView);\n\t$(\"#alertInfoText\").text(linkToCurrentView);\n\t$('#alertModal').modal('show');\n}", "function render_url(text) {\n if (text.includes(\"http\")) {\n return \"<a href=\\\"\" + text + \"\\\" target=\\\"_blank\\\">Buy Here</a>\";\n } else {\n return text;\n }\n }", "function showResults(json) {\n document.getElementById('results').innerHTML = `<a href=${json.html_url}>${\n json.html_url\n }</a>`;\n}", "function createLink(editor, link, altText, displayText) {\n editor.focus();\n var url = link ? link.trim() : '';\n if (url) {\n var linkData = roosterjs_editor_dom_1.matchLink(url);\n // matchLink can match most links, but not all, i.e. if you pass link a link as \"abc\", it won't match\n // we know in that case, users will want to insert a link like http://abc\n // so we have separate logic in applyLinkPrefix to add link prefix depending on the format of the link\n // i.e. if the link starts with something like abc@xxx, we will add mailto: prefix\n // if the link starts with ftp.xxx, we will add ftp:// link. For more, see applyLinkPrefix\n var normalizedUrl_1 = linkData ? linkData.normalizedUrl : applyLinkPrefix(url);\n var originalUrl_1 = linkData ? linkData.originalUrl : url;\n editor.addUndoSnapshot(function () {\n var range = editor.getSelectionRange();\n var anchor = null;\n if (range && range.collapsed) {\n anchor = getAnchorNodeAtCursor(editor);\n // If there is already a link, just change its href\n if (anchor) {\n anchor.href = normalizedUrl_1;\n // Change text content if it is specified\n updateAnchorDisplayText(anchor, displayText);\n }\n else {\n anchor = editor.getDocument().createElement('A');\n anchor.textContent = displayText || originalUrl_1;\n anchor.href = normalizedUrl_1;\n editor.insertNode(anchor);\n }\n }\n else {\n // the selection is not collapsed, use browser execCommand\n editor.getDocument().execCommand(\"createLink\" /* CreateLink */, false, normalizedUrl_1);\n anchor = getAnchorNodeAtCursor(editor);\n updateAnchorDisplayText(anchor, displayText);\n }\n if (altText && anchor) {\n // Hack: Ideally this should be done by HyperLink plugin.\n // We make a hack here since we don't have an event to notify HyperLink plugin\n // before we apply the link.\n anchor.removeAttribute(TEMP_TITLE);\n anchor.title = altText;\n }\n return anchor;\n }, \"CreateLink\" /* CreateLink */);\n }\n}", "function addCPNlinkToPage(){\n\t\tcpn_url = location.href.match(/^(http.+\\/)[^\\/]+$/ )[1]+\"/savefiles/\"+$('#model_name').val()+\".cpn\";\n\n\t\t$.get(cpn_url).done(function() { \n \t\tsay('<a href=\"'+cpn_url+'\">CPN file</a> created');\n \t\t}).fail(function() { \n \t\tsay('CPN file does not exist!');\n \t\t});\t\t\n\t}", "function Genera_link_mail(cValor, cNumSol) {\n var noDocto;\n var url = window.location.href;\n var pos = url.search(Context);\n var start = url.substring(pos, 0);\n\n if (cValor.substring(0, 4) == 'DOC-') {\n noDocto = cValor.substring(4);\n url = start + '/' + Context + '/DownloadINTDOCDIG?ICVEVEHDOCDIG=' + noDocto + '&cNumSol=' + cNumSol;\n url = '<a target=\"_blank\" href=\"' + url + '\">' + url + '</a>';\n } else {\n url = 'Error -- No encontrado';\n }\n return url;\n}", "function renderMealResults(mealDetails) {\n $('#mealResults').html(\n `<a href=\"${mealDetails.strYoutube}\">\n <img src=\"${mealDetails.strMealThumb}\" alt=\"meal\" />\n <div class=\"card-content\">\n <h2>${mealDetails.strMeal}</h2>\n <p>${mealDetails.strInstructions}</p>\n </div>\n </a>`\n );\n}", "function createLink(label,link){\n var newLink=$(\"<a>\", {\n title: label,\n href: link,\n class: \"toolbox_button\"\n }).append( label );\n return newLink;\n }", "function mk_link(text) {\r\n var a = $e('a')\r\n a.style.background = null\r\n a.style.backgroundColor = null\r\n a.href = '#'\r\n a.appendChild( $t(text) )\r\n return a\r\n}", "function createLink(start, end){\n startId = \"tool_\" + start;\n endId = \"tool_\" + end;\n if(!document.getElementById(\"ele_\"+start)){\n addToCanvas(document.getElementById(startId));\n }\n if(!document.getElementById(\"ele_\"+end)){\n addToCanvas(document.getElementById(endId));\n }\n // link;\n jsPlumb.connect({\n uuids: [\"ele_\" + start + \"_output\", \"ele_\" + end + \"_input\"],\n });\n}", "function buildCreatedLinkMain (linkURL) {\n if(Bkg.DEBUG)\n console.log(\"Popup.buildCreatedLinkParentTab\");\n var string = buildCreatedLink(linkURL);\n string = \"<div class='created_url_display'>\" + string + \"</div>\";\n return string;\n}", "function makeLink(url, text) {\n const selection = document.getSelection();\n document.execCommand('createLink', true, url);\n selection.anchorNode.parentElement.target = '_blank';\n selection.anchorNode.parentElement.innerHTML = text;\n showPostPreview();\n}", "function generaLink(animal){\n\tvar link = \"http://www.horoscopomaya2018.com/horoscopo-maya-\";\n\tlink+=animal+\"/\";\n\tvar frameAnimal = \"<iframe name='frameIzdo' src='\"+link+\"' title='Horosocopo Maya' width='500em' height='600em'></iframe>\";\n\n\tdocument.write(frameAnimal);\n}", "click(e){\r\n if ( this.url ){\r\n bbn.fn.link(this.url);\r\n }\r\n else{\r\n this.$emit('click', e);\r\n }\r\n }", "function genLinks(key, mvName) {\n var links = '';\n links += '<a href=\"javascript:edit(\\'' + key + '\\',\\'' + mvName + '\\')\"> Edit</a> | ';\n links += '<a href=\"javascript:del(\\'' + key + '\\',\\'' + mvName + '\\')\"> X </a>';\n return links;\n}", "function HrefFormater(value, row, index) {\n return '<a href=\"' + '/vuln/' +row.id + '\"> ' + row.name +'</a>';\n}", "function linkSheet(issues){\n var html = [];\n var rand = ~~(Math.random()*1000);\n\n for (index in issues){\n var issue = issues[index];\n html.push('<a href=\"'+config.apiBaseUrl+'/browse/'+issue.key+'#'+rand+'\" target=\"_blank\">'+issue.key+' - '+issue.name+'</a>');\n }\n var htmlString = html.join('<br><br>');\n fs.writeFile('../out/linkSheet.html', htmlString);\n}", "function makeLink() {\n if (_TEST)\n return;\n if (!retPgn.bonus) {\n let makeLink = '/scratch/tcec/Commonscripts/Divlink/makelnk.sh';\n exec(`${makeLink} ${retPgn.abb}`, (error, stdout, stderr) => {\n LS(`Error is: ${stderr}`);\n LS(`Output is: ${stdout}`);\n });\n }\n}", "function showLink(value){\n\t\t\tif(value == 'ok'){\n\t\t\t\tif(KCI.util.Config.getHybrid() == true){\n\t\t\t\t\tif(KCI.app.getApplication().getController('Hybrid').cordovaCheck() == true){\n\t\t\t\t\t\t//hybrid childbrowser function\n\t\t\t\t\t\tKCI.app.getApplication().getController('Hybrid').doShowLink(button.getUrl());\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Google Analytics Tracking\n\t\t\t\t\t\tKCI.app.getApplication().getController('Hybrid').doTrackEvent('Link','View',button.getText());\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tKCI.app.getApplication().getController('Main').doShowExternal(button.getUrl());\n\t\t\t\t\t\n\t\t\t\t\t//Google Analytics Tracking\n\t\t\t\t\tKCI.app.getApplication().getController('Main').doTrackEvent('Link','View',button.getText());\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}", "function generatePathLinkout(pathArray) {\n // Build an html string of the paths\n // pathArray is a list of dicts for each edge in the path:\n // pathArray[i] gives a dict for the support of edge i\n // pathArray[i][stmt type j] is a list of all statements of type j supporting edge i\n // pathArray[i][stmt type j][k] is statement k of type j supporting edge i\n let htmlString = '';\n for (let edgeDict of pathArray) {\n if (Object.keys(edgeDict).length > 0) {\n let subj = edgeDict.subj;\n let obj = edgeDict.obj;\n htmlString += `<h5><b>${subj} &rarr; ${obj}</b><span class=\"float-right\">Statement types: ${(Object.keys(edgeDict).length-2).toString()}</span></h5>`;\n for (let stmt_type in edgeDict) {\n if ((stmt_type !== 'subj') && (stmt_type !== 'obj') &&\n (stmt_type !== 'weight_to_show') && (edgeDict[stmt_type])) {\n // FixMe: edgeDict[stmt_type] is added because all statement\n // types had to be added explicitly in the BaseModel. This is\n // something that needs to be fixed where the results are\n // assembled into JSONs. Either via adding dynamic name\n // attributes or by restructuring the JSON.\n // let dbLink = '';\n // if (stmt.stmt_hash.startsWith('http')) dbLink = stmt.stmt_hash;\n // ?subject=BRCA1&object=BRCA2&type=activation&ev_limit=1\n let agentsString = '';\n if (stmt_type.toLowerCase() === 'complex') agentsString = `agent0=${subj}&agent1=${obj}&`;\n else agentsString = `subject=${subj}&object=${obj}&`;\n let dbLink = INDRA_DB_URL_AGENTS + agentsString + `type=${stmt_type}&ev_limit=1`;\n let sourceBadges = generateSourceBadges(edgeDict[stmt_type]);\n htmlString += '<a href=\"' + dbLink + '\" target=\"_blank\">' + subj + ', ' +\n stmt_type + ', ' + obj + '</a>' + sourceBadges + '<br>'\n }\n }\n }\n }\n return htmlString.substring(0, htmlString.length-4); // Cut out the last <br>\n}", "function handleLinkClick(event) {\n\t\tvar linkLabel = event.currentTarget.id;\n\t\tvar url;\n\t\tswitch(linkLabel) {\n\t\t\tcase 'pivotal' :\n\t\t\t\turl = \"http://www.gopivotal.com/\";\n\t\t\t\twindow.open(url, '_blank');\n\t\t\t\tbreak;\n\t\t\tcase 'support' :\n\t\t\t\turl = \"https://support.gopivotal.com/hc/en-us\";\n\t\t\t\twindow.open(url, '_blank');\n\t\t\t\tbreak;\n\t\t\tcase 'feedback' :\n\t\t\t\turl = \"http://www.gopivotal.com/contact\";\n\t\t\t\twindow.open(url, '_blank');\n\t\t\t\tbreak;\n\t\t\tcase 'help' :\n\t\t\t\turl = \"../../static/docs/gpdb_only/index.html\";\n\t\t\t\twindow.open(url, '_blank');\n\t\t\t\tbreak;\n\t\t\tcase 'logout' :\n\t\t\t\tlogoutClick();\n\t\t\t\tbreak;\n\t\t}\n\t}", "function newLink(start, end, meaning, htmlstyle)\n{\n // Link around meaning\n var bbA = document.createElement(\"a\");\n\n // Link URL\n var bbAHref = document.createAttribute(\"href\");\n bbAHref.nodeValue = \"javascript:insertTagsToLogInfo(\\\"\"+start+\"\\\", \\\"\"+end+\"\\\")\";\n bbA.setAttributeNode(bbAHref);\n\n // Link format\n var bbHTML = document.createElement(\"span\");\n\n // Link style\n var bbHTMLStyle = document.createAttribute(\"style\");\n bbHTMLStyle.nodeValue = htmlstyle + \";margin: 0px 2px 0px 2px\";\n bbHTML.setAttributeNode(bbHTMLStyle);\n\n // Link text\n var bbHTMLText = document.createTextNode(meaning);\n bbHTML.appendChild(bbHTMLText);\n\n // Add link text to link\n bbA.appendChild(bbHTML);\n\n // Return link object\n return bbA;\n}", "function demoTemplate({\n url\n}) {\n return `Go here to see a demo <a href=\"${url}\">${url}</a>.`;\n}", "function linkAdminCompose(fWhere) {\r\n setUpLinkBackJSON(fWhere);;\r\n window.location.href = \"adminCompose.html\";\r\n}", "function pagerHomePageLink() {\n 'use strict';\n var link = document.createElement('div');\n link.id = 'pagerGoHome';\n link.innerHTML = '<a href=\"../../\">Home</a>';\n return link;\n}", "function generate_link()\n{\n var id_value;\n\n var sId = $(\"Ecom478\").val();\n // var sId2 = $(\"Ecom479\").val()\n //if(!sId1)\n //sId.setAttribute.('href', 'http://localhost:8080/home/branches/?Id='+sId);\n document.getElementById(\"Ecom478\").href = \"http://localhost:8080/home/branches/?Id=\"+sId;\n}", "function printlink() {\n\t\t\t\tvar linkElem = $('#inspo');\n\t\t\t\tlinkElem.html(links[randomlink].text);\n\t\t\t}", "function genlink() {\r\n document.getElementById(\"genOpen\").click();\r\n}", "function goHowTo() {\n window.location.assign(\"howto.html\")\n}", "startLinkRouting() {}", "function renderLink(url) {\n let card = document.createElement(\"div\");\n card.classList.add('card');\n\n let newLink = document.createElement(\"div\");\n newLink.innerHTML = '<a href=\"'+url+'\">'+url+'</a>';\n // newLink.classList.add(\"bg-success\");\n\n card.appendChild(newLink);\n\n let linkSection = document.querySelector('#linkSection');\n linkSection.appendChild(card); \n}", "function showUrl(url) {\n url = encodeURI(url);\n var txt = '<a href=\"' + url + '\" target=\"_blank\">' + url + '</a>';\n var element = document.getElementById(SOLR_CONFIG[\"urlElementId\"]);\n element.innerHTML = txt;\n}", "function showUrl(url) {\n url = encodeURI(url);\n var txt = '<a href=\"' + url + '\" target=\"_blank\">' + url + '</a>';\n var element = document.getElementById(SOLR_CONFIG[\"urlElementId\"]);\n element.innerHTML = txt;\n}", "function linkToURL() {\n\t// get name of tissue we're adjusting\n\tvar tissue = $('#setLevel-tissueName').text()\n\t\n\t// figure out which index number that corresponds to in allTissues\n\tvar index = findIndexByKeyValue(allTissues, 'tissue', tissue);\n\t\n\tvar link = allTissues[index].link;\n\t\n\twindow.open(link);\n\t\n}", "function googleCalendarLink(startDate, endDate, useTime, text, details, location) {\r\n\tvar url = \r\n\t\t'http://www.google.com/calendar/' + (prefs['GoogleApps'] && prefs['GoogleAppsDomain']!='' ? 'hosted/'+prefs['GoogleAppsDomain']+'/' : '') + 'event'+\r\n\t\t'?action=TEMPLATE'+\r\n\t\t'&text=' + escape(text).replace(/\"/g, '&quot;')+\r\n\t\t'&dates=' + startDate.toISOString(useTime) + '/' + (endDate||startDate.getNextDay()).toISOString(useTime)+\r\n\t\t(location ? '&location=' + escape(location).replace(/\"/g, '&quot;') : '')+\r\n\t\t(details ? '&details=' + escape(details).replace(/\"/g, '&quot;') : '')\r\n\treturn \t''+\r\n\t\t'<a href=\"' + url.substring(0,2048) + '\" title=\"' + $l('AddToGoogleCalendar') + ' - ' + text.replace(/\"/g, '&quot;') + '\">' + $l('AddToGoogleCalendar') + '</a>';\r\n}", "function linkStudentCompose(fWhere) {\r\n setUpLinkBackJSON(fWhere);\r\n window.location.href = \"studentCompose.html\";\r\n}", "function linkHeadings() {\n \n var headings = getHeadings();\n \n headings.forEach(function (heading) {\n heading.element.innerHTML = '<a href=\"#' + heading.id + '\">' +\n heading.element.innerHTML + \"</a>\";\n });\n }", "cellLink(e){\n return <Link className=\"reporte-link\" to={\"/reporte/\"+this.state.selectedCuentaLbl+\"/\"+ e}>\n {e}\n </Link>\n }", "function linkDisplay (numLinks,urlList) {\r\n let i = 0;\r\n console.log(urlList);\r\n while( i < numLinks ) {\r\n let link = 'link:'+(i+1);\r\n let url = urlList[i];\r\n let linkLocation = document.getElementById(link);\r\n linkLocation.innerHTML = url;\r\n linkLocation.setAttribute('href',url);\r\n linkLocation.setAttribute('target','_blank');\r\n i++;\r\n }\r\n}", "function fnVoltarLink() {\r\n\tvar oLink = document.links[0];\r\n\toLink.innerHTML = \"Pegar Feeds\";\r\n\toLink.className = \"\";\r\n\toLink.onclick = fnGo;\r\n}", "function createLink(el) {\n if (el.tagName.toLowerCase() === 'A') return;\n\n const url = $('h2 a', el.parentNode).first().attr('href');\n $(el.parentNode).append(`<a href=\"${url}\" class=\"${el.className}\">`);\n\n // Remove linked Children\n $('a', el).each((index, item) => {\n const text = $(item).html();\n $(item).after(text);\n item.remove();\n });\n\n // Create Link Element\n let link = $('a.content', el.parentNode);\n link.html($(el).html());\n $(el).remove();\n }", "function jsLinkClicked() {\n const url = this.getAttribute('data-linkto');\n window.open(url, '_blank');\n }" ]
[ "0.6682557", "0.62523365", "0.6246781", "0.62387705", "0.6108658", "0.6063756", "0.6057287", "0.59873235", "0.5983369", "0.59809536", "0.59450084", "0.594434", "0.59342194", "0.5905177", "0.59000206", "0.5889419", "0.5875309", "0.58298373", "0.58223563", "0.5818942", "0.57764053", "0.57336223", "0.5725599", "0.5702284", "0.5698747", "0.56932926", "0.56917846", "0.569072", "0.56708455", "0.5644652", "0.56400144", "0.5626262", "0.5622453", "0.5618382", "0.561539", "0.5604419", "0.5584492", "0.55802155", "0.5557079", "0.5536813", "0.5533709", "0.55280703", "0.55196327", "0.55143553", "0.5496705", "0.5485877", "0.54781723", "0.54775065", "0.5475444", "0.5451209", "0.5449056", "0.54484326", "0.5444605", "0.5428706", "0.5407029", "0.54027665", "0.5402678", "0.5392978", "0.5390621", "0.5388491", "0.5356247", "0.53490347", "0.53439486", "0.5338361", "0.53323233", "0.5328357", "0.53274214", "0.53248656", "0.5324624", "0.53218794", "0.5303224", "0.53014845", "0.53012276", "0.5297957", "0.52948475", "0.52919096", "0.5274295", "0.5267983", "0.5258571", "0.52557945", "0.5254497", "0.525449", "0.5248903", "0.5245052", "0.52436316", "0.523905", "0.5237636", "0.5223639", "0.5212718", "0.5210719", "0.5210719", "0.5209901", "0.5209817", "0.52064025", "0.5192357", "0.5188657", "0.5185551", "0.51828504", "0.5174583", "0.51731837" ]
0.5944947
11
Avoid the JMX type property clashing with the ForceGraph type property; used for associating css classes with nodes on the graph
function renameTypeProperty(properties) { properties.mbeanType = properties['type']; delete properties['type']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setCType(prop, classContext) {\n\tprop.isPtr = false;\n\tprop.CType = undefined;\n\tprop.CConstType = undefined;\n\tprop.CBaseType = undefined;\n\n\t/*\n\t * map basic JSON types\n\t */\n\tswitch ( prop.type ) {\n\tcase 'string':\n\t\tprop.CBaseType = \"std::string\";\n\t\tprop.isPtr = true;\n\t\tbreak;\n\n\tcase 'number':\n\t\tprop.CBaseType = \"double\";\n\t\tbreak;\n\n\tcase 'integer':\n\t\tprop.CBaseType = \"int64_t\";\n\t\tbreak;\n\n\tcase 'boolean':\n\t\tprop.CBaseType = \"bool\";\n\t\tbreak;\n\n\tcase 'object':\n\t\tprop.isPtr = true;\n\t\tprop.CBaseType = prop.className;\n\t\tbreak;\n\n\tcase 'array':\n\t\tprop.isPtr = true;\n\t\t// get type from array items\n\t\tprop.CBaseType = \"std::vector<\" + prop.items.CType + \">\";\n\t\tbreak;\n\n\tcase 'any':\n\t\tprop.isPtr = true;\n\t\tprop.CBaseType = \"std::string\"; // use the JSON text\n\t\tbreak;\n\n\tdefault:\n\t\t// this should never happen\n\t\tbreak;\n\t}\n\t\n\t/*\n\t * handle extended types\n\t */\n\t\n\t// ID\n\tif ( prop.type == 'string' && prop.exttype == 'id' ) {\n\t\tprop.CBaseType = 'ConnectedVision::id_t';\n\t\tprop.isPtr = false;\n\t}\n\n\t\n\t// timestamp\n\tif ( prop.type == 'integer' && prop.exttype == 'timestamp' ) {\n\t\tprop.CBaseType = 'ConnectedVision::timestamp_t';\n\t\tprop.isPtr = false;\n\t}\n\t\n\t// enforce exttype\n\tif ( !prop.exttype )\n\t\tprop.exttype = prop.type;\n\t\n\t// derive C/C++ type from base type\n\tif ( prop.isPtr ) {\n\t\tprop.CType = 'boost::shared_ptr<' + prop.CBaseType + '>';\n\t\tprop.CConstType = 'boost::shared_ptr<const ' + prop.CBaseType + '>';\n\t} else {\n\t\tprop.CType = prop.CBaseType;\n\t\tprop.CConstType = prop.CBaseType;\n\t}\n}", "function showChartType(params, node){\n\t\t\tvar layout=params.obj;\n\t\t\tif(layout.aggregationType && layout.aggregationType!=\"ohlc\"){\n\t\t\t\tif(chartType!==layout.aggregationType){\n\t\t\t\t\t$(node).removeClass(activeClassName);\n\t\t\t\t}else{\n\t\t\t\t\t$(node).addClass(activeClassName);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif(chartType!==layout.chartType){\n\t\t\t\t\t$(node).removeClass(activeClassName);\n\t\t\t\t}else{\n\t\t\t\t\t$(node).addClass(activeClassName);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "constructor(type) {\n\n // Properties\n this.name = \"No_Name\";\n this.id = -1;\n\n if((type.localeCompare(\"test\") === 0) || (type.localeCompare(\"requirement\") === 0)) {\n this.type = type;\n }else{\n throw \"unknown type of GraphNode\";\n }\n\n //Metrics\n this.areaMetric = -1;\n this.heightMetric = -1;\n this.colorMetric = -1;\n\n }", "get type () {\n let t = this.properties.geometry.type\n switch (this.properties.geometry.type) {\n case 'gml:MultiPolygonPropertyType':\n case 'gml:PolygonPropertyType':\n t='polygon';\n break;\n \n case 'gml:MultiLineStringPropertyType':\n case 'gml:LineStringPropertyType':\n t='polyline';\n break;\n\n case 'gml:MultiPointPropertyType':\n case 'gml:PointPropertyType':\n t='point';\n break; \n }\n\n return t\n \n }", "function node_type_change_hander() {\n fix_num_cores();\n toggle_cuda_version_visibility();\n}", "set propertyType(value) {}", "get termType() {\n return 'DefaultGraph';\n }", "get termType() {\n return 'DefaultGraph';\n }", "registerType(nodeSet, type, constructor, opts) {\n if (typeof type !== 'string') {\n // This is someone calling the api directly, rather than via the\n // RED object provided to a node. Log a warning\n this.log.warn('[' + nodeSet + '] Deprecated call to RED.runtime.nodes.registerType - node-set name must be provided as first argument');\n opts = constructor;\n constructor = type;\n type = nodeSet;\n nodeSet = '';\n }\n if (opts) {\n if (opts.credentials) {\n credentials.register(type, opts.credentials);\n }\n if (opts.settings) {\n try {\n this.settings.registerNodeSettings(type, opts.settings);\n } catch (err) {\n log.warn('[' + type + '] ' + err.message);\n }\n }\n }\n registry.registerType(nodeSet, type, constructor);\n }", "function changeGraphType(event) {\n var startIndex = event.startIndex;\n var endIndex = event.endIndex;\n\n if (endIndex - startIndex > maxCandlesticks) {\n // change graph type\n if (graph.type != \"line\") {\n graph.type = \"line\";\n graph.fillAlphas = 0;\n chart.validateNow();\n }\n } else {\n // change graph type\n if (graph.type != graphType) {\n graph.type = graphType;\n graph.fillAlphas = 1;\n chart.validateNow();\n }\n }\n }", "classType () {\n const depTypeFn = depTypes[String(this.currentAstNode)]\n if (!depTypeFn) {\n throw Object.assign(\n new Error(`\\`${String(this.currentAstNode)}\\` is not a supported dependency type.`),\n { code: 'EQUERYNODEPTYPE' }\n )\n }\n const nextResults = depTypeFn(this.initialItems)\n this.processPendingCombinator(nextResults)\n }", "function updateLabelType(newType) {\n setClassExclusively(window.dGO.printArea, newType, window.dGO.allLabelTypes);\n}", "addStyleClasses(type) {\n var _a, _b, _c;\n this.renderer.addClass(this.host, 'cx-icon');\n (_a = this.styleClasses) === null || _a === void 0 ? void 0 : _a.forEach((cls) => this.renderer.removeClass(this.host, cls));\n this.styleClasses = (_b = this.iconLoader.getStyleClasses(type)) === null || _b === void 0 ? void 0 : _b.split(' ');\n (_c = this.styleClasses) === null || _c === void 0 ? void 0 : _c.forEach((cls) => {\n if (cls !== '') {\n this.renderer.addClass(this.host, cls);\n }\n });\n }", "function refreshGraphStyle() {\n\t\tzoom = zoom.scaleExtent([options.minMagnification(), options.maxMagnification()]);\n\n\t\tforce.charge(function (element) {\n\t\t\tvar charge = options.charge();\n\t\t\tif (elementTools.isLabel(element)) {\n\t\t\t\tcharge *= 0.8;\n\t\t\t}\n\t\t\treturn charge;\n\t\t})\n\t\t\t.size([options.width(), options.height()])\n\t\t\t.linkDistance(calculateLinkPartDistance)\n\t\t\t.gravity(options.gravity())\n\t\t\t.linkStrength(options.linkStrength()); // Flexibility of links\n\n\t\tforce.nodes().forEach(function (n) {\n\t\t\tn.frozen(paused);\n\t\t});\n\t}", "function nodeStyle() {\n return [new go.Binding(\"location\", \"loc\", go.Point.parse).makeTwoWay(go.Point.stringify),\n new go.Binding(\"isShadowed\", \"isSelected\").ofObject(),\n {\n locationSpot: go.Spot.Center,\n shadowOffset: new go.Point(0, 0),\n shadowBlur: 15,\n shadowColor: \"blue\",\n toolTip: sharedToolTip,\n cursor: \"pointer\"\n }];\n }", "function ComponentType() {}", "function set_node_type_change_handler() {\n let node_type_input = $('#batch_connect_session_context_node_type');\n node_type_input.change(node_type_change_hander);\n}", "function clusterPriorityChange(type) {\n\tvar imgObjVal = document.getElementById('tf1_clusterPriority').className;\n\tvar imageName = imgObjVal.substring(imgObjVal.lastIndexOf('/') + 1);\n\tif (type == 'off') {\n\t\tfieldStateChangeWr('tf1_clusterPriorityValue', '', '', '');\n\t\tvidualDisplay('tf1_clusterPriorityValue', 'hide');\n\t} else {\n\t\tif (imageName == OFF_ANCHOR) {\n\t\t\tfieldStateChangeWr('', '', 'tf1_clusterPriorityValue', '');\n\t\t\tvidualDisplay('tf1_clusterPriorityValue', 'configRow');\n\t\t} else if (imageName == ON_ANCHOR) {\n\t\t\tfieldStateChangeWr('tf1_clusterPriorityValue', '', '', '');\n\t\t\tvidualDisplay('tf1_clusterPriorityValue', 'hide');\n\t\t}\n\t}\n}", "set type(value) {}", "_changeScaleType() {\n const that = this;\n\n that._numericProcessor = new JQX.Utilities.NumericProcessor(that, 'scaleType');\n\n that._validateMinMax('both');\n\n that._setTicksAndInterval();\n that._scaleTypeChangedFlag = true;\n that._validate(true, that._number.toString());\n that._scaleTypeChangedFlag = false;\n }", "get type() {}", "function hideDtypes() {\n svg.selectAll('.dtype').remove();\n }", "function type_(){this.type=( joo.MemberDeclaration.MEMBER_TYPE_CLASS);}", "_$kind() {\n super._$kind();\n this._value.kind = 'class';\n }", "get propertyType() {}", "fillType() {\n\t\t\tif ($('#lifttypes').val() == 'addnew') {\n\t\t\t\tthis.newType = !this.newType;\n\t\t\t}\n\t\t}", "function ComponentType() { }", "function NodeType(typeSpec) {\n if (Object.keys(typeSpec).length > 0) {\n throw new Error('NodeType can not be customized');\n }\n}", "function JMJProtocal() {\n\tthis.type = \"\";\n}", "function changeGraphType(event) {\n\t \n\t\tvar startIndex = event.startIndex;\n\t var endIndex = event.endIndex;\n\t \n\t var chart = $scope.chart;\n\t var graph = $scope.graph;\n\t \n\t if(endIndex - startIndex > $scope.maxCandlesticks) {\n\t \n\t \t// change graph type\n\t if(graph.type != \"line\") {\n\t \tgraph.type = \"line\";\n\t \tgraph.fillAlphas = 0;\n\t \tchart.validateNow();\n\t }\n\t \n\t } else {\n\t \t\n\t // change graph type\n\t if(graph.type != $scope.graphType) {\n\t \tgraph.type = $scope.graphType;\n\t \tgraph.fillAlphas = 1;\n\t \tchart.validateNow();\n\t }\n\t \n\t }\n\t \n\t}", "function kindMapping(kind) {\n if (kind === \"graph\") kind = \"datapoints\";\n if (kind === \"meter\") kind = \"number\";\n return kind;\n }", "get avoidNs(){ return [ this.xhtmlNS, this.svgNS, 'http://ns.adobe.com/2006/mxml/' ] }", "get datatype() {\n return new NamedNode(this.datatypeString);\n }", "get datatype() {\n return new NamedNode(this.datatypeString);\n }", "ClassProperty(node) {\n const upperTypeMode = this.typeMode;\n const { computed, decorators, key, typeAnnotation, value } = node;\n this.typeMode = false;\n this.visitDecorators(decorators);\n if (computed) {\n this.visit(key);\n }\n this.typeMode = true;\n this.visit(typeAnnotation);\n this.typeMode = false;\n this.visit(value);\n this.typeMode = upperTypeMode;\n }", "function rollbackOriginDisplayTypes() {\n CONFIG.floatingFeed.displayTypes = {\n default: true,\n info : true,\n success: true,\n warning: true,\n error : true,\n purple : true,\n green : true,\n blue : true\n }\n }", "function j(e){return e.type=(null!==e.getAttribute(\"type\"))+\"/\"+e.type,e}", "getType() {\n return this.visualizationModel.type\n }", "function className(node, value){\r\n var klass = node.className || '',\r\n svg = klass && klass.baseVal !== undefined\r\n\r\n if (value === undefined) return svg ? klass.baseVal : klass\r\n svg ? (klass.baseVal = value) : (node.className = value)\r\n }", "function className(node, value){\r\n var klass = node.className || '',\r\n svg = klass && klass.baseVal !== undefined\r\n\r\n if (value === undefined) return svg ? klass.baseVal : klass\r\n svg ? (klass.baseVal = value) : (node.className = value)\r\n }", "function className(node, value){\r\n var klass = node.className || '',\r\n svg = klass && klass.baseVal !== undefined\r\n\r\n if (value === undefined) return svg ? klass.baseVal : klass\r\n svg ? (klass.baseVal = value) : (node.className = value)\r\n }", "function definePlotTypes(µ) {\n µ.DATAEXTENT = 'dataExtent';\n µ.AREA = 'AreaChart';\n µ.LINE = 'LinePlot';\n µ.DOT = 'DotPlot';\n µ.BAR = 'BarChart';\n}", "function className(node, value){\n var klass = node.className || '',\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "function className(node, value){\n var klass = node.className || '',\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "function className(node, value){\n var klass = node.className || '',\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "function className(node, value){\n var klass = node.className || '',\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "function className(node, value){\n var klass = node.className || '',\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "function className(node, value){\n var klass = node.className || '',\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "function className(node, value){\n var klass = node.className || '',\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "function className(node, value){\n var klass = node.className || '',\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "function className(node, value){\n var klass = node.className || '',\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "function className(node, value){\n var klass = node.className || '',\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "function className(node, value){\n var klass = node.className || '',\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "function className(node, value){\n var klass = node.className || '',\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "function className(node, value){\n var klass = node.className || '',\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "function className(node, value){\n var klass = node.className || '',\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "function setChartType(type) {\n console.warn('demo.js setChartType');\n chart.config.type = type;\n chart.update();\n}", "function className(node, value){\n var klass = node.className,\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "function className(node, value){\n var klass = node.className,\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "function className(node, value){\n var klass = node.className,\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "function className(node, value){\n var klass = node.className,\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "function ComponentType(){}", "get type() {\n\t\treturn wm.get(this).type;\n\t}", "function className(node, value) {\n\t var klass = node.className || '',\n\t svg = klass && klass.baseVal !== undefined;\n\n\t if (value === undefined) return svg ? klass.baseVal : klass;\n\t svg ? klass.baseVal = value : node.className = value;\n\t }", "function getType() { return \"not\"; }", "getType() {}", "function nodeType(node){\n if(node instanceof Text){\n return \"#Text\";\n }else{\n return node.nodeName;\n }\n}", "function typeClass(definition) {\n if (definition.nodeType === \"YulTypedName\") {\n //for handling Yul variables\n return \"bytes\";\n }\n return typeIdentifier(definition).match(/t_([^$_0-9]+)/)[1];\n}", "function LightType() {}", "function className(node, value) {\n var klass = node.className || '',\n svg = klass && klass.baseVal !== undefined;\n\n if (value === undefined) return svg ? klass.baseVal : klass;\n svg ? (klass.baseVal = value) : (node.className = value);\n }", "function className(node, value) {\n var klass = node.className,\n svg = klass && klass.baseVal !== undefined;\n\n if (value === undefined) return svg ? klass.baseVal : klass;\n svg ? klass.baseVal = value : node.className = value;\n }", "function setLinkType(link){\nif (!link.getTargetElement() || !link.getSourceElement()){\n\tlink.attr(\".link-type\", \"Error\");\n\treturn;\n}\nvar sourceCell = link.getSourceElement().attributes.type;\nvar targetCell = link.getTargetElement().attributes.type;\nvar sourceCellInActor = link.getSourceElement().get('parent');\nvar targetCellInActor = link.getTargetElement().get('parent');\n\nswitch(true){\n\t// Links of actors must be paired with other actors\n\tcase ((sourceCell == \"basic.Actor\" || sourceCell == \"basic.Actor2\") && (targetCell == \"basic.Actor\" || targetCell == \"basic.Actor2\")):\n\t\tlink.attr(\".link-type\", \"Actor\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Actor\") && (!targetCellInActor)):\n\t\tlink.attr(\".link-type\", \"Error\");\n\t\tbreak;\n\tcase ((targetCell == \"basic.Actor\") && (!sourceCellInActor)):\n\t\tlink.attr(\".link-type\", \"Error\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Actor2\") && (!targetCellInActor)):\n\t\tlink.attr(\".link-type\", \"Dependency\");\n\t\tbreak;\n\tcase ((targetCell == \"basic.Actor2\") && (!sourceCellInActor)):\n\t\tlink.attr(\".link-type\", \"Dependency\");\n\t\tbreak;\n\tcase ((!!sourceCellInActor) && (!targetCellInActor && (targetCell == \"basic.Actor\" || targetCell == \"basic.Actor2\"))):\n\t\tlink.attr(\".link-type\", \"Error\");\n\t\tbreak;\n\tcase ((!!targetCellInActor) && (!sourceCellInActor && (sourceCell == \"basic.Actor\" || sourceCell == \"basic.Actor2\"))):\n\t\tlink.attr(\".link-type\", \"Error\");\n\t\tbreak;\n\tcase ((!!sourceCellInActor) && (!targetCellInActor)):\n\t\tlink.attr(\".link-type\", \"Dependency\");\n\t\tbreak;\n\tcase ((!!targetCellInActor) && (!sourceCellInActor)):\n\t\tlink.attr(\".link-type\", \"Dependency\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Goal\") && (targetCell == \"basic.Goal\")):\n\t\tlink.attr(\".link-type\", \"Refinement\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Goal\") && (targetCell == \"basic.Softgoal\")):\n\t\tlink.attr(\".link-type\", \"Contribution\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Goal\") && (targetCell == \"basic.Task\")):\n\t\tlink.attr(\".link-type\", \"Refinement\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Goal\") && (targetCell == \"basic.Resource\")):\n\t\tlink.attr(\".link-type\", \"Error\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Softgoal\") && (targetCell == \"basic.Goal\")):\n\t\tlink.attr(\".link-type\", \"Qualification\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Softgoal\") && (targetCell == \"basic.Softgoal\")):\n\t\tlink.attr(\".link-type\", \"Contribution\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Softgoal\") && (targetCell == \"basic.Task\")):\n\t\tlink.attr(\".link-type\", \"Qualification\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Softgoal\") && (targetCell == \"basic.Resource\")):\n\t\tlink.attr(\".link-type\", \"Qualification\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Task\") && (targetCell == \"basic.Goal\")):\n\t\tlink.attr(\".link-type\", \"Refinement\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Task\") && (targetCell == \"basic.Softgoal\")):\n\t\tlink.attr(\".link-type\", \"Contribution\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Task\") && (targetCell == \"basic.Task\")):\n\t\tlink.attr(\".link-type\", \"Refinement\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Task\") && (targetCell == \"basic.Resource\")):\n\t\tlink.attr(\".link-type\", \"Error\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Resource\") && (targetCell == \"basic.Goal\")):\n\t\tlink.attr(\".link-type\", \"Error\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Resource\") && (targetCell == \"basic.Softgoal\")):\n\t\tlink.attr(\".link-type\", \"Contribution\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Resource\") && (targetCell == \"basic.Task\")):\n\t\tlink.attr(\".link-type\", \"NeededBy\");\n\t\tbreak;\n\tcase ((sourceCell == \"basic.Resource\") && (targetCell == \"basic.Resource\")):\n\t\tlink.attr(\".link-type\", \"Error\");\n\t\tbreak;\n\n\tdefault:\n\t\tconsole.log('Default');\n}\nreturn;\n}", "function className( node, value ) {\n var klass = node.className || '',\n svg = klass && klass.baseVal !== undefined\n\n if ( value === undefined ) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "['@_kind']() {\n super['@_kind']();\n if (this._value.kind) return;\n this._value.kind = 'external';\n }", "function hc_nodecommentnodetype() {\n var success;\n var doc;\n var testList;\n var commentNode;\n var commentNodeName;\n var nodeType;\n doc = load(\"hc_staff\");\n testList = doc.childNodes;\n\n for(var indexN65600 = 0;indexN65600 < testList.length; indexN65600++) {\n commentNode = testList.item(indexN65600);\n commentNodeName = commentNode.nodeName;\n\n \n\tif(\n\t(\"#comment\" == commentNodeName)\n\t) {\n\tnodeType = commentNode.nodeType;\n\n assertEquals(\"existingCommentNodeType\",8,nodeType);\n \n\t}\n\t\n\t}\n commentNode = doc.createComment(\"This is a comment\");\n nodeType = commentNode.nodeType;\n\n assertEquals(\"createdCommentNodeType\",8,nodeType);\n \n}", "function n(a){return a.type=(null!==a.getAttribute(\"type\"))+\"/\"+a.type,a}", "get type() {\n\t\treturn \"category\";\n\t}", "getTypeNodes() {\r\n return this.compilerNode.types.map(t => this._getNodeFromCompilerNode(t));\r\n }", "static _processType(typeItem) {\n switch (typeItem.kind) {\n case 'variable-type':\n return Type.newVariableReference(typeItem.name);\n case 'reference-type':\n return Type.newManifestReference(typeItem.name);\n case 'list-type':\n return Type.newSetView(Manifest._processType(typeItem.type));\n default:\n throw `Unexpected type item of kind '${typeItem.kind}'`;\n }\n }", "function nodeStyle() {\n return [\n // The Node.location comes from the \"loc\" property of the node data,\n // converted by the Point.parse static method.\n // If the Node.location is changed, it updates the \"loc\" property of the node data,\n // converting back using the Point.stringify static method.\n new go.Binding(\"location\", \"loc\", go.Point.parse).makeTwoWay(go.Point.stringify),\n {\n // the Node.location is at the center of each node\n locationSpot: go.Spot.Center,\n //isShadowed: true,\n //shadowColor: \"#888\",\n // handle mouse enter/leave events to show/hide the ports\n mouseEnter: function (e, obj) { showPorts(obj.part, true); },\n mouseLeave: function (e, obj) { showPorts(obj.part, false); }\n }\n ];\n }", "function createRendererType2(values){return{id:UNDEFINED_RENDERER_TYPE_ID,styles:values.styles,encapsulation:values.encapsulation,data:values.data};}", "get type() { return this._type; }", "get type() { return this._type; }", "get type() { return this._type; }", "function className(node, value) {\n var klass = node.className || '',\n svg = klass && klass.baseVal !== undefined\n\n if (value === undefined) return svg ? klass.baseVal : klass\n svg ? (klass.baseVal = value) : (node.className = value)\n }", "function addLayoutCSS(_type){\n\t\tif(_type == \"left\"){\n $(\"#scrollableContent\").addClass(\"left\");\n }else if(_type == \"sidebar\"){\n $(\"#scrollableContent\").addClass(\"sidebarContent\");\n }else if(_type == \"top\" || _type == \"bottom\"){\n $(\"#scrollableContent\").addClass(\"top\");\n }else if(_type == \"right\"){\n $(\"#scrollableContent\").addClass(\"right\");\n }else if(_type == \"textOnly\" || _type == \"branching\"){\n $(\"#scrollableContent\").addClass(\"text\");\n $(\"#contentHolder\").addClass(\"text\");\n }else if(_type == \"graphicOnly\"){\n $(\"#contentHolder\").addClass(\"graphic\");\n }\n\t}", "set_type(new_type){\n if(new_type){\n this.type = new_type;\n }\n else{\n this.invalid();\n }\n }", "function nodeStyle () {\n return [new go.Binding('location', 'loc', go.Point.parse).makeTwoWay(go.Point.stringify),\n new go.Binding('isShadowed', 'isSelected').ofObject(),\n {\n selectionAdorned: false,\n shadowOffset: new go.Point(0, 0),\n shadowBlur: 15,\n shadowColor: 'blue'\n }]\n }", "function getVnodeType(vnode) {\n if (vnode.type === null) return 'null';\n if (vnode.type === Array) return 'Array';\n if (vnode.type === String) return 'String';\n if (typeof vnode.type === 'string') return vnode.type;\n\n if (typeof vnode.type === 'object') {\n if (vnode.type.displayName === undefined) {\n vnode.type.displayName = createUniqueVnodeName();\n }\n return vnode.type.displayName;\n }\n}", "function getVnodeType(vnode) {\n if (vnode.type === null) return 'null';\n if (vnode.type === Array) return 'Array';\n if (vnode.type === String) return 'String';\n if (typeof vnode.type === 'string') return vnode.type;\n\n if (typeof vnode.type === 'object') {\n if (vnode.type.displayName === undefined) {\n vnode.type.displayName = createUniqueVnodeName();\n }\n return vnode.type.displayName;\n }\n}", "getType(){return this.__type}", "function refreshGraphStyle() {\n\t\tzoom = zoom.scaleExtent([options.minMagnification(), options.maxMagnification()]);\n\t\tif (graphContainer) {\n\t\t\tzoom.event(graphContainer);\n\t\t}\n\n\t\tforce.charge(options.charge())\n\t\t\t.size([options.width(), options.height()])\n\t\t\t.linkDistance(calculateLinkDistance)\n\t\t\t.gravity(options.gravity())\n\t\t\t.linkStrength(options.linkStrength()); // Flexibility of links\n\t}", "function isBlacklisted() {\n var blacklist = this.opts.blacklist;\n return blacklist && blacklist.indexOf(this.node.type) > -1;\n}", "getProcessorTypes(){\n\t\tif( 'function' === typeof this.props.getProcessorTypes){\n\t\t\treturn this.props.getProcessorTypes();\n\t\t}\n\t\treturn processorTypesMap;\n\t}", "function generateInstanceTypeString(instanceFamily, vCpuCount, totalMemory, extendedMemory) {\n const extendedFlag = extendedMemory ? '-ext' : '';\n const memoryInMbs = Number(totalMemory) * 1024;\n instanceFamily = instanceFamily.toLowerCase();\n if (instanceFamily === 'n1') {\n return `custom-${vCpuCount}-${memoryInMbs}${extendedFlag}`;\n }\n return `${instanceFamily}-custom-${vCpuCount}-${memoryInMbs}${extendedFlag}`;\n }", "function determineAxisType(dataType) {\r\n if (dataType === \"number\") {\r\n return \"indexed\";\r\n }\r\n else if (dataType === \"date\") {\r\n return \"timeseries\";\r\n }\r\n else {\r\n return \"category\";\r\n }\r\n}", "function isBlacklisted() {\n\t var blacklist = this.opts.blacklist;\n\t return blacklist && blacklist.indexOf(this.node.type) > -1;\n\t}", "function isBlacklisted() {\n\t var blacklist = this.opts.blacklist;\n\t return blacklist && blacklist.indexOf(this.node.type) > -1;\n\t}", "function drawDatatypeProperties(domainElement, mainCircle) {\n\t\t// first time create line between object and datatype properties\n\t\tif (!domainElement.nodeElement().countDataypeProperties) {\n\t\t\tdomainElement.nodeElement().countDataypeProperties = 1;\n\t\t\tdomainElement.nodeElement().append('rect').classed(\"line-between-props\", true);\n\t\t} else {\n\t\t\t// else add to counter another datype property\n\t\t\t++domainElement.nodeElement().countDataypeProperties;\n\t\t}\n\t}", "function determineHighDimVariableType(result){\n\tvar mobj=result.responseText.evalJSON();\n\tGLOBAL.HighDimDataType=mobj.markerType;\n}" ]
[ "0.57275623", "0.56749016", "0.5421634", "0.52650917", "0.5243341", "0.5152161", "0.5091512", "0.5091512", "0.50166875", "0.50130606", "0.500727", "0.4996701", "0.49426684", "0.49331057", "0.4905186", "0.4904321", "0.48959813", "0.48710933", "0.48627383", "0.48509043", "0.48445034", "0.48194402", "0.4813044", "0.4796458", "0.4780994", "0.47774324", "0.47728485", "0.47716215", "0.477124", "0.47680128", "0.47534317", "0.4744786", "0.47386557", "0.47386557", "0.47385055", "0.47242287", "0.47090903", "0.4708981", "0.47063982", "0.47063982", "0.4696347", "0.4691847", "0.46905458", "0.46905458", "0.46905458", "0.46905458", "0.46905458", "0.46905458", "0.46905458", "0.46905458", "0.46905458", "0.46905458", "0.46905458", "0.46905458", "0.46905458", "0.46905458", "0.46887666", "0.46833357", "0.46833357", "0.46833357", "0.46833357", "0.4673759", "0.46662703", "0.46656626", "0.4657934", "0.46496117", "0.46454766", "0.46417567", "0.46382383", "0.46262527", "0.46184754", "0.46139756", "0.46038678", "0.4596071", "0.45916936", "0.45884594", "0.45883223", "0.45854163", "0.45849898", "0.4581421", "0.45802832", "0.45785752", "0.45785752", "0.45785752", "0.45681894", "0.45604086", "0.45597866", "0.45568794", "0.4551555", "0.4551555", "0.45457178", "0.45406047", "0.45365688", "0.45316827", "0.45313728", "0.45300075", "0.45238477", "0.45238477", "0.4520418", "0.45202485" ]
0.51890785
5
For some reason using ngrepeat in the modal dialog doesn't work so lets just create the HTML in code :)
function createBodyText(message) { ARTEMIS.log.info("loading message:" + message); if (message.text) { var body = message.text; var lenTxt = "" + body.length; message.textMode = "text (" + lenTxt + " chars)"; return body; } else if (message.BodyPreview) { var code = Core.parseIntValue(localStorage["ARTEMISBrowseBytesMessages"] || "1", "browse bytes messages"); var body; message.textMode = "bytes (turned off)"; if (code != 99) { var bytesArr = []; var textArr = []; message.BodyPreview.forEach(function (b) { if (code === 1 || code === 2) { // text textArr.push(String.fromCharCode(b)); } if (code === 1 || code === 4) { // hex and must be 2 digit so they space out evenly var s = b.toString(16); if (s.length === 1) { s = "0" + s; } bytesArr.push(s); } else { // just show as is without spacing out, as that is usually more used for hex than decimal var s = b.toString(10); bytesArr.push(s); } }); var bytesData = bytesArr.join(" "); var textData = textArr.join(""); if (code === 1 || code === 2) { // bytes and text var len = message.BodyPreview.length; var lenTxt = "" + textArr.length; body = "bytes:\n" + bytesData + "\n\ntext:\n" + textData; message.textMode = "bytes (" + len + " bytes) and text (" + lenTxt + " chars)"; } else { // bytes only var len = message.BodyPreview.length; body = bytesData; message.textMode = "bytes (" + len + " bytes)"; } } return body; } else { message.textMode = "unsupported"; return "Unsupported message body type which cannot be displayed by hawtio"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ShowRecipeModalDialog(recipe) {\n\n // Get list of recipe ingredients\n var params = { recipeId: recipe.Id };\n $http.post(\"/Flavor/GetIngredients\", params).success(function(data) {\n\n var ingredients = data;\n\n var modalInstance = $modal.open({\n templateUrl: 'app/views/viewRecipe.html',\n controller: 'viewRecipeController',\n resolve: {\n recipeObject: function() {\n return recipe;\n },\n\n recipeIngredients: function() {\n return ingredients;\n }\n }\n });\n\n modalInstance.result.then(function () {\n \n });\n });\n}", "function templatepop(divises, infRequest, idPr, listBkByLocs, listDocs, listPr, template, menu, bool, bdetail, isOffer, isOffertrue, validation_Offer) {\n var modalInstance = $modal.open({\n templateUrl: template,\n controller: 'popUpadminEn',\n resolve: {\n devises: function() {\n return divises;\n },\n infRequest: function() {\n return infRequest;\n },\n idPr: function() {\n return idPr;\n },\n listBkByLocs: function() {\n return listBkByLocs;\n },\n listDocs: function() {\n return listDocs;\n },\n listPr: function() {\n return listPr;\n },\n template: function() {\n return template;\n },\n menu: function() {\n return menu;\n },\n bool: function() {\n return bool;\n },\n bdetail: function() {\n return bdetail;\n },\n isOffer: function() {\n return isOffer;\n },\n isOffertrue: function() {\n return isOffertrue;\n },\n validation_Offer: function() {\n return validation_Offer;\n }\n }\n });\n modalInstance.result.then(function(selectedItem) {\n $scope.selected = selectedItem;\n }, function() {\n $log.info('Modal dismissed at: ' + new Date());\n });\n }", "function paintPatternsInModal() {\n // Delete previous printed data\n $(\"#patternsModal > div > div > div.modal-body\").empty();\n\n for (let i = 0; i < NETWORK.trainingPatterns.length; i++) {\n let pattern = NETWORK.trainingPatterns[i];\n\n let columns = (new Array(parseInt($(\"#width\").val()))).fill(\"1fr\").join(\" \");\n let rows = (new Array(parseInt($(\"#height\").val()))).fill(\"1fr\").join(\" \");\n let elements = pattern.data[0].map(function(item, index) {\n return `<div id=\"modal${i}${index}\" style=\"background-color: ${item == 1 ? \"white\" : \"black\"};\"></div>`\n })\n\n\n $(\"#patternsModal > div > div > div.modal-body\").append(`<div class=\"grid\" style=\"grid-template-columns: ${columns}; grid-template-rows: ${rows}\">${elements.join(\"\")}</div>`);\n }\n}", "function init_view_table_list_dialog(row_id){\n\n //Open dialog\n $('#myModal').modal({\n keyboard: false\n });\n\n $('.modal-dialog').css(\"width\",\"60%\");\n //Dialog title\n $(\".modal-title\").html('<img src=\"img/icons/table.png\" width=\"50\"> View Table')\n \n load_view_table_list(row_id);\n\n}", "function generateModal(i)\n{\n let temp = people[i];\n let dob = `${temp.dob.date.substring(5, 7)}/${temp.dob.date.substring(8, 10)}/${temp.dob.date.substring(0, 4)}`;\n const modalHTML = `\n <div class=\"modal-container\">\n <div class=\"modal\">\n <button type=\"button\" id=\"modal-close-btn\" class=\"modal-close-btn\"><strong>X</strong></button>\n <div class=\"modal-info-container\">\n <img class=\"modal-img\" src=${temp.picture.large} alt=\"profile picture\">\n <h3 id=\"name\" class=\"modal-name cap\">${temp.name.first} ${temp.name.last}</h3>\n <p class=\"modal-text\">${temp.email}</p>\n <p class=\"modal-text cap\">${temp.location.city}</p>\n <hr>\n <p class=\"modal-text\">${temp.cell}</p>\n <p class=\"modal-text\">${temp.location.street.number} ${temp.location.street.name}, ${temp.location.state} ${temp.location.postcode}</p>\n <p class=\"modal-text\">Birthday: ${dob}</p>\n </div>\n </div>\n </div>\n `;\n $body.append(modalHTML);\n}", "function modalPopup() {\n return $scope.modalInstance = $uibModal.open({\n templateUrl: 'donModal1.html',\n scope: $scope\n });\n }", "function ngModalLoad(){\n // first clear the selection list\n let game_select = document.getElementById('games-select')\n let game_region_select = document.getElementById('game-region-select')\n while(game_select.firstChild){\n game_select.removeChild(game_select.firstChild)\n }\n while(game_region_select.firstChild){\n game_region_select.removeChild(game_region_select.firstChild)\n }\n // Then append to them\n for(id in games){\n let opt = document.createElement('option')\n opt.value = id\n opt.innerHTML = games[id]\n game_select.appendChild(opt)\n }\n for(region in regions){\n let opt = document.createElement('option')\n opt.value = region\n opt.innerHTML = regions[region]\n game_region_select.appendChild(opt)\n }\n // Then clear the text inputs\n document.getElementById('save-folders').value = ''\n document.getElementById('save-files').value = ''\n}", "function openModal(size){\r\n\t\t\t\t\t //var modalContent= 'myModalContent.html';\r\n\t\t\t\t var modalContent= '/StMartin/root/view/dialog/insertUpdatePeopleDialog.html';\r\n\t\t\t\t\t if(type == \"delete\"){\r\n\t\t\t\t\t \tmodalContent= 'myModalContentDelete.html';\r\n\t\t\t\t\t }\r\n\t\t\t\t\t\tvar modalOpen= $modal.open({\r\n\t\t\t\t\t templateUrl: modalContent,\r\n\t\t\t\t\t controller: peopleDialogController,\r\n\t\t\t\t\t windowClass: 'app-modal-window',\r\n\t\t\t\t\t size: size,\r\n\t\t\t\t\t resolve: {\r\n\t\t\t\t\t \r\n\t\t\t\t\t items: function () {\r\n\t\t\t\t\t \t setFlags();\r\n\t\t\t\t\t \t \r\n\t\t\t\t\t \t if(type == \"insert\" || type == \"modify\"){\r\n\t\t\t\t\t \t\t var peopleData=null;\r\n\t\t\t\t\t \t\t var dateOfBirthPerson=null;\r\n\t\t\t\t\t \t\t if(type == \"insert\"){\r\n\t\t\t\t\t \t\t\t $(\"#personId\").attr(\"value\", null);\r\n\t\t\t\t\t\t\t \t\t\t\t$(\"#firstNameId\").attr(\"value\", null);\r\n\t\t\t\t\t\t\t \t\t\t\t$(\"#lastNameId\").attr(\"value\", null);\r\n\t\t\t\t\t\t\t \t\t\t\t$(\"#cityId\").attr(\"value\", null);\r\n\t\t\t\t\t\t\t \t\t\t\t$(\"#dateOfBirth\").attr(\"value\", null); \r\n\t\t\t\t\t \t\t }\r\n\t\t\t\t\t \t\t else{\r\n\t\t\t\t\t \t\t\t $(\"#personId\").attr(\"value\",$scope.mySelections[0].personId);\t\r\n\t\t\t\t\t\t\t\t if($scope.mySelections[0].personState==='A'){\r\n\t\t\t\t\t\t\t\t \t$scope.personState = 'ACTIVE';\r\n\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t peopleData=$scope.mySelections[0];\r\n\t\t\t\t\t\t\t\t dateOfBirthPerson=$scope.mySelections[0].dateOfBirth;\r\n\t\t\t\t\t \t\t }\t\t \t\t\t\t \r\n\t\t\t\t\t \t\t\t\t var array = {\"people\": peopleData, \"cities\": $scope.citiesList, \"zones\":$scope.zoneCodes,\"parishes\":$scope.parishes, \"supportGroups\":$scope.supportGroups, \"personState\": $scope.personStateNames,\r\n\t\t\t\t\t \t\t\t\t\t\t \"date\":dateOfBirthPerson, \"volunteerTypeList\":$scope.volunteerTypeList,\"isVolunteer\": $scope.isVolunteer, \r\n\t\t\t\t\t \t\t\t\t\t\t \"isBeneficiary\": $scope.isBeneficiary,\"isBeneficiaryNotCPPR\": $scope.isBeneficiaryNotCPPR,\"isVolunteerNotCPPR\": $scope.isVolunteerNotCPPR, \"isCPPR\": $scope.isCPPR,\"isCPPRBeneficiary\": $scope.isCPPRBeneficiary,\r\n\t\t\t\t\t \t\t\t\t\t\t \"majorTrainingList\": $scope.majorTrainingList, \"isCPHA\":$scope.isCPHA, \"isCPHAOrphan\":$scope.isCPHAOrphan, \"isCPHAPlwhiv\":$scope.isCPHAPlwhiv, \"isCPHARecoveree\":$scope.isCPHARecoveree, \"isCPPD\":$scope.isCPPD};\r\n\t\t\t\t\t \t\t\t\t return array;\r\n\t\t\t\t\t \t\t\t\t\r\n\t\t\t\t\t \t }\r\n\t\t\t\t\t \t else{\r\n\t\t\t\t\t \t\t $scope.mySelections[0].endDate=new Date();\r\n\t\t\t\t\t \t\t $(\"#personId\").attr(\"value\",$scope.mySelections[0].personId);\r\n\t\t\t\t\t \t\t return {\"people\": $scope.mySelections[0]};\t\t\t\t\t \t\t \r\n\t\t\t\t\t \t }\t \r\n\t\t\t\t\t }\r\n\t\t\t\t\t }\r\n\t\t\t\t\t });\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\tmodalOpen.result.then(function (selectedItem) {\r\n\t\t\t\t\t\t $scope.selected = selectedItem;\r\n\t\t\t\t\t\t }, function () {\r\n\t\t\t\t\t\t // $log.info('Modal dismissed at: ' + new Date());\r\n\t\t\t\t\t\t \tcommonMethodFactory.getPeopleList($scope.projectPerson).then(function(object) {\r\n\t\t\t\t\t \t\t\t$scope.personData = object.data;\r\n\t\t\t\t\t \t\t\tcommonFactory.peopleData=$scope.personData;\r\n\t\t\t\t\t \t\t});\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t}", "function createModalHTML(data){ \n data.forEach(function(note){\n $(\".existing-note\").append(`\n <div class=\"panel panel-default\" id=\"${note._id}\">\n <div class=\"panel-body\">\n <div class=\"noteContent\">\n <p>${note.body}</p>\n <button class=\"btn btn-primary edit-note\" data-noteId=\"${note._id}\"\">Edit</button>\n <button class=\"btn btn-primary delete-note\" data-noteId=\"${note._id}\">Delete</button>\n </div>\n <div class=\"update-form\"></div>\n </div>\n </div>\n `)\n }); \n}", "function TimelineModalCtrl($scope, $modalInstance, projectId, protitle, $modal){\n\t$scope.title = protitle;\n\t$scope.predicate = 'maxv';\n\t$scope.timeline = {};\n\t$scope.max_max = 0;\n\tvar foreachcall = projectId.forEach(function(obj){\n\t\tvar x = time(obj);\n\t\t$scope.timeline[obj.title] = {'title':obj.title,'values':x.current, 'maxv':x.max,'id':obj.id,'status':obj.late_status,'customer':obj.customer.name}\n\t\tif($scope.max_max < x.max){\n\t\t\t$scope.max_max = x.max+5;\n\t\t}\n\t});\n\t$scope.task = function(projectd,ptitle,pstatus){\n\t\tmodal('4','taskCtrl',projectd,{'title':ptitle,'status':pstatus},$modal,'small');\n\t}\n\t$scope.order = function(pr){\n\t\tconsole.log(pr);\n\t\t$scope.predicate = pr;\n\t\t$scope.reverse != $scope.reverse;\n\t}\n}", "function DialogController($scope, $mdDialog, recipe) {\n $scope.recipe = recipe;\n //Returns an array of the nicely formatted strings of the recipes ingredients\n $scope.getStringIngredients = function () {\n var results = [];\n $scope.recipe.ingredients.forEach(function (ingredient) {\n var s = ingredient.quantity + \" \" + ingredient.name;\n s += ingredient.notes.length == 0 ? \"\" : (\" (\" + ingredient.notes + \")\");\n results.push(s);\n });\n return results;\n };\n //Formats the specified recipe's courses into a comma separated string\n $scope.getCourseList = function () {\n var list = \"\"\n for (var i = 0; i < $scope.recipe.courses.length; i++) {\n list += $scope.recipe.courses[i];\n if (i != ($scope.recipe.courses.length - 1)) {\n list += \", \";\n }\n }\n return list;\n };\n //Formats the specified recipe's cuisines into a comma separated string\n $scope.getCuisineList = function () {\n var list = \"\"\n for (var i = 0; i < $scope.recipe.cuisines.length; i++) {\n list += $scope.recipe.cuisines[i];\n if (i != ($scope.recipe.cuisines.length - 1)) {\n list += \", \";\n }\n }\n return list;\n };\n $scope.hide = function () {\n $mdDialog.hide();\n };\n $scope.cancel = function () {\n $mdDialog.cancel();\n };\n }", "function openNewModal(items){\n var count = 0;\n for(var obj of items){\n var tag = obj.type || \"div\";\n var classes = \"\";for(var c of obj.classes){classes+=c+\" \"};\n var inner = obj.content || \"\";\n var html = \"<\"+tag+\" class='\"+classes+\"'\";\n if(tag == 'textarea')\n html+=\"placeholder='\"+inner+\"'></\"+tag+\">\";\n else if(tag != \"input\")\n html+=\">\"+inner+\"</\"+tag+\">\";\n else\n html+=\"placeholder='\"+inner+\"'>\";\n $(\"#mmc-wrapper\").append(html);\n count++;\n }\n if(count > 4){\n $('#main-modal-content').css({'margin': '2% auto'});\n }\n else\n $('#main-modal-content').css({'margin': '15% auto'});\n $('#main-modal').fadeIn(500);\n}", "function showAnswerActions(answers) {\n answers.forEach(function (answer) {\n var id = 'actions_' + answer.answer_id;\n var html = \"<button class='btn btn-primary' id='myBtn\" + answer.answer_id + \"' data-toggle='modal' data-target='#myModal\" + answer.answer_id + \"'>Edit</button>\";\n document.getElementById(id).innerHTML = html;\n });\n var models = [];\n answers.forEach(function (answer) {\n var html = \"<div id='myModal\" + answer.answer_id + \"' class='modal'>\"\n + \"<div class='modal-content'>\"\n + \" <span class='close' data-dismiss='modal'>&times;</span>\"\n + \"<textarea class='textarea' id='newAnswer\" + answer.answer_id + \"'>\" + answer.answer_body + \"</textarea><br>\"\n + \"<button class='btn btn-primary' id='updateBtn' onclick='updateUserAnswer(\" + JSON.stringify(answer) + \");'>Update</button>\"\n + \"</div>\"\n + \"</div>\";\n models.push(html);\n });\n document.getElementById('includes').innerHTML = models.join(\"\");\n}", "function mostrarModalSeleccionado(item, diagnostico, tratamiento){\r\n\t\tvar modalInstance = $modal.open({\r\n\t animation: true,\r\n\t templateUrl: 'js/hefesoft/odontograma/directivas/piezaDental/template/seleccionada.html',\r\n\t controller: 'piezaDentalSeleccionadaCtrl',\r\n\t size: 'sm',\r\n\t resolve: {\r\n\t diagnostico : function () {\r\n\t return diagnostico;\r\n\t },\r\n\t tratamiento : function () {\r\n\t return tratamiento;\r\n\t },\r\n\t piezaDental : function () {\r\n\t return item;\r\n\t }\r\n\t }\r\n\t });\r\n\r\n\t\t//El primero es cerrar el segundo es dimiss\r\n\t\t modalInstance.result.then(\r\n\t\t \tfunction(data){},\r\n\t\t \tfunction (data) {\r\n \t \t\t$scope.fnModificado($scope.$parent, { 'item' : item });\r\n\t });\r\n\t}", "function modal(){\n\t\t//creating necessary elements to structure modal\n\t\tvar iDiv = document.createElement('div');\n\t\tvar i2Div = document.createElement('div');\n\t\tvar h4 = document.createElement('h4');\n\t\tvar p = document.createElement('p');\n\t\tvar a = document.createElement('a');\n\n\t\t//modalItems array's element are being added to specific tags \n\t\th4.innerHTML = modalItems[1];\n\t\tp.innerHTML = modalItems[2];\n\t\ta.innerHTML = modalItems[0];\n\n\t\t//adding link and classes(materialize) to tags\n\t\tiDiv.setAttribute(\"class\", \"modal-content\");\n\t\ti2Div.setAttribute(\"class\", \"modal-footer\");\n\t\ta.setAttribute(\"class\", \"modal-action modal-close waves-effect waves-green btn-flat\");\n\t\ta.setAttribute(\"href\", \"sign_in.html\");\n\n\t\t//adding elements to tags as a child element\n\t\tiDiv.appendChild(h4);\n\t\tiDiv.appendChild(p);\n\n\t\ti2Div.appendChild(a);\n\n\t\tmodal1.appendChild(iDiv);\n\t\tmodal1.appendChild(i2Div);\n\t}", "function AddSubSeriesDialog() {\n $modal.open({\n templateUrl: 'angular/templates/materialregisters/views/createMaterialRegisterSubseries.html',\n controller: 'createMaterialRegisterSubseriesCtrl',\n scope: $scope\n }).result.then(function ($scope) {\n clearSearch();\n }, function () { });\n }", "function genModCon() {\n const genModalDiv = `<div class=modal-container></div>`;\n gallery.insertAdjacentHTML(\"afterEnd\", genModalDiv);\n const modalDiv = document.querySelector(\".modal-container\");\n modalDiv.style.display = \"none\";\n}", "function MoeDialogController($mdDialog, $scope, apiFactory, moeToPass, nouvelItem)\n { \n var dg=$scope;\n dg.affiche_load = false;\n dg.affichebuttonAjouter = false;\n dg.selectedItemMoeDialog = {};\n dg.allmoeDialog = [];\n var moe_a_anvoyer= [];\n\n dg.moedialog_column = [\n {titre:\"Nom\"},\n {titre:\"Nif\"},\n {titre:\"Stat\"},\n {titre:\"Siege\"},\n {titre:\"telephone\"}];\n \n\n //style\n dg.tOptions = {\n dom: '<\"top\"f>rt<\"bottom\"<\"left\"<\"length\"l>><\"right\"<\"info\"i><\"pagination\"p>>>',\n pagingType: 'simple',\n autoWidth: false \n };\n console.log(nouvelItem);\n console.log(moeToPass);\n if (nouvelItem==false)\n {\n dg.allmoeDialog.push(moeToPass);\n }\n dg.recherche = function(moe)\n { \n dg.affiche_load = true;\n apiFactory.getAPIgeneraliserREST(\"bureau_etude/index\",'menu','getbureau_etudebylike','moe_like',moe.nom).then(function(result)\n {\n dg.allmoeDialog = result.data.response;\n dg.affiche_load = false;\n console.log(dg.allmoeDialog);\n });\n }\n \n\n dg.cancel = function()\n {\n $mdDialog.cancel();\n dg.affichebuttonAjouter = false;\n };\n\n dg.dialogajoutmoe = function(conven)\n { \n $mdDialog.hide(dg.selectedItemMoeDialog);\n dg.affichebuttonAjouter = false;\n dg.allmoeDialog = [];\n }\n\n \n\n //fonction selection item moe\n dg.selectionMoeDialog = function (item)\n {\n dg.selectedItemMoeDialog = item;\n dg.affichebuttonAjouter = true; \n };\n \n $scope.$watch('selectedItemMoeDialog', function()\n {\n if (!dg.allmoeDialog) return;\n dg.allmoeDialog.forEach(function(iteme)\n {\n iteme.$selected = false;\n });\n dg.selectedItemMoeDialog.$selected = true;\n });\n\n }", "function openModalAddTramite(){\n getListTramites();\n vm.modalAddTramite = $uibModal.open({\n animation: true,\n templateUrl: 'views/modals/addTramite.modal.html',\n scope: $scope,\n size: 'nt',\n backdrop: 'static'\n });\n }", "createViewModal() {\n const htmlstring = '<div class=\"modal-content\">' +\n '<div class=\"modal-header\">' +\n ' <span id=\"closeview\" class=\"closeview\">&times;</span>' +\n ' <h2>' + this.name + '</h2>' +\n '</div>' +\n '<div class=\"modal-body\">' +\n ' <h2>Description</h2>' +\n ' <p>' + this.description + '</p>' +\n ' <h2>Current Status : ' + this.status + '</h2>' +\n ' <h2>Assigned to ' + this.assignee + '</h2>' +\n ' <h2>Priority : ' + this.priority + '</h2>' +\n ' <h2>Created on : ' + this.date + '</h2>' +\n '</div>' +\n '</div>';\n\n return htmlstring;\n }", "function openAddProjectList(scope, modalClass) {\n console.log(scope);\n var modalScope = $rootScope.$new();\n scope = scope || {};\n modalClass = modalClass || 'modal-default';\n\n angular.extend(modalScope, scope);\n\n return $uibModal.open({\n templateUrl: 'components/modal/addProjectList/modal.html',\n // controller: 'MessagesCtrl',\n windowClass: modalClass,\n scope: modalScope\n });\n }", "function cargarModalChef1(){\n\tvar txt='<!-- Modal --><div class=\"modal fade\" id=\"myModal\" role=\"dialog\">';\n\ttxt += '<div class=\"modal-dialog\">';\n\ttxt += '<!-- Modal content--><div class=\"modal-content\">';\n\ttxt += '<div class=\"modal-header\"><button type=\"button\" class=\"close\" data-dismiss=\"modal\">&times;</button>';\n\ttxt += '<div id=\"numeroPedido\"><h1>NUMERO PEDIDO</h1></div></div>';\n\ttxt += '<div class=\"modal-body\"><div id=\"detallePedidoCocina\"><div class=\"tbl_cocina\" id=\"tablaCocinaDetalle\">';\n\ttxt += '<table class=\"table table-bordered\"><thead><tr><th scope=\"col\">Productos</th><th scope=\"col\">Cantidad</th></tr>';\n\ttxt += '</thead><tbody><tr><td>arroz con huevo</td><td>5</td></tr><tr><td>arroz con huevo</td><td>5</td></tr><tr><td>arroz con huevo</td><td>5</td></tr><tr><td>arroz con huevo</td><td>5</td></tr><tr><td>arroz con huevo</td><td>5</td></tr><tr><td>arroz con huevo</td><td>5</td></tr></tbody></table></div></div></div>';\n\ttxt += '<div class=\"modal-footer\"><div id=\"pedidoCocinaSur\"><button type=\"button\" class=\"btn btn-warning\">PREPARAR</button>';\n\ttxt += '<button type=\"button\" class=\"btn btn-success\">ENTREGAR</button></div>';\n\ttxt += '</div></div></div></div>';\n\treturn txt;\n}", "function create_modal_research(elem,json_data,interest_or_fac) {\n\n var put_in = $('#modal_div');\n\n $div_research_modal = $(\"<div class='div_research_modal_div'></div>\");\n\n if(interest_or_fac == 0){\n $div_research_modal.append(\"<h1 class = 'div_research_modal_name'>\"+json_data.areaName+\"</h1><hr\" +\n \" class='div_research_modal_hr'>\");\n\n\n }\n else{\n $div_research_modal.append(\"<h1 class = 'div_research_modal_name'>\"+json_data.facultyName+\"</h1><hr\" +\n \" class='div_research_modal_hr'>\");\n }\n\n $div_research_modal.append(\"<ul>\");\n for(var i = 0; i < json_data.citations.length;i++){\n $div_research_modal.append(\"<li class='div_research_modal_li'>\"+json_data.citations[i]+\"</li>\");\n }\n $div_research_modal.append(\"</ul>\");\n\n put_in.append($div_research_modal);\n\n\n put_in.dialog({\n modal: true,\n beforeClose: function () {put_in.empty();},\n maxHeight:500,\n minWidth:700,\n closeOnEscape: true\n });\n}", "showModal(index) {\n let employees = this.filteredEmployees[index];\n let name = employees.name;\n let dob = employees.dob;\n let phone = employees.phone;\n let email = employees.email;\n let city = employees.location.city;\n let streetNum = employees.location.street.number;\n let streetName = employees.location.street.name;\n let state = employees.location.state;\n let postcode = employees.location.postcode;\n let picture = employees.picture.large;\n let date = new Date(dob.date);\n\n const modalHTML = ` \n <img class=\"modal-avatar\" src=\"${picture}\" />\n <div class=\"modal-text-container\">\n <h2 id= \"modalCard\" class=\"name\" data-index=\"${index}\" >${name.first} ${\n name.last\n }</h2>\n <p class=\"email\">${email}</p>\n <p class=\"address\">${city}</p>\n <hr />\n <p class=\"phone\">${phone}</p>\n <p class=\"address\">${streetNum} ${streetName} ${state}, ${postcode}</p>\n <p class= \"bday\">Birthday: ${date.getMonth()}/${date.getDate()}/${date.getFullYear()}</p>\n `;\n this.overlay.classList.remove(\"hidden\"); // will reveal the overlay\n this.modal.innerHTML = modalHTML; // add modal to screenS\n }", "function templateCntl($scope) {\n console.log('in template');\n var items = [];\n var anItem = {\n type: 'text' //or table, or calendar\n ,isSection: false\n ,title: 'my first item'\n ,content: 'and this is the content'\n };\n $scope.items = items;\n}", "function tagModalService($rootScope, $modal, $timeout, $q) {\n return function(type, dest) {\n var modalScope = $rootScope.$new();\n \n modalScope.add = addTags;\n modalScope.dest = dest;\n modalScope.selectTag = selectTag;\n \n switch(type) {\n case 'qual':\n modalScope.tagType = 'qual';\n break;\n case 'impact':\n default:\n modalScope.tagType = 'impact';\n modalScope.multi = true;\n break;\n };\n \n var modal = $modal({\n title: 'Add Impact Area Tag',\n templateUrl: '/angular/tag/tagModal.tpl.html',\n controller: 'AddTag',\n controllerAs: 'tags',\n scope: modalScope\n });\n var deferred = $q.defer();\n modal.$promise = deferred.promise;\n \n var parentHide = modal.hide;\n modal.hide = hide;\n \n return modal;\n \n /**\n * Return the tags to the parent controller\n * @param {array} tags List of tags to send back\n */\n function addTags(tags, dest) {\n if(!dest) {\n // No target given\n return;\n }\n \n if(modalScope.multi) {\n var count = 0; \n angular.forEach(tags, function(val, key) {\n if(dest.indexOf(val.data) < 0) {\n dest.push(val.data);\n count++;\n }\n });\n \n modalScope.message = 'Added ' + count + ' tags to strategy.';\n $timeout(function(){\n modalScope.message = null;\n }, 2000);\n } else if(tags.length > 0) {\n dest.splice(0, dest.length);\n dest.push(tags[0].data);\n }\n }\n \n /**\n * Add the given tag to the output and close the modal\n * \n * Only triggers on modals where multi == false\n */\n function selectTag(data) {\n if(!modalScope.multi) {\n addTags([data.node], modalScope.dest);\n modal.hide();\n }\n }\n \n /**\n * Hide the modal\n */\n function hide() {\n deferred.resolve(true);\n parentHide();\n }\n }\n }", "function openDialog(options) {\n\n \n if (!options) {\n options = {};\n }\n //configation and defaults\n var scope = options.scope || $rootScope.$new(),\n container = options.container || $(\"body\"),\n animationClass = options.animation || \"fade\",\n modalClass = options.modalClass || \"umb-modal\",\n width = options.width || \"100%\",\n templateUrl = options.template || \"views/common/notfound.html\";\n\n //if a callback is available\n var callback = options.callback;\n\n //Modal dom obj and unique id\n var $modal = $('<div data-backdrop=\"false\"></div>');\n var id = templateUrl.replace('.html', '').replace('.aspx', '').replace(/[\\/|\\.|:\\&\\?\\=]/g, \"-\") + '-' + scope.$id;\n\n \n\n if(options.inline){\n animationClass = \"\";\n modalClass = \"\";\n }else{\n $modal.addClass(\"modal\");\n $modal.addClass(\"hide\");\n }\n\n //set the id and add classes\n $modal\n .attr('id', id)\n .addClass(animationClass)\n .addClass(modalClass);\n\n //push the modal into the global modal collection\n //we halt the .push because a link click will trigger a closeAll right away\n $timeout(function () {\n dialogs.push($modal);\n }, 250);\n \n //if iframe is enabled, inject that instead of a template\n if (options.iframe) {\n var html = $(\"<iframe auto-scale='0' src='\" + templateUrl + \"' style='width: 100%; height: 100%;'></iframe>\");\n\n $modal.html(html);\n //append to body or whatever element is passed in as options.containerElement\n container.append($modal);\n\n // Compile modal content\n $timeout(function () {\n $compile($modal)(scope);\n });\n\n $modal.css(\"width\", width);\n\n //Autoshow\t\n if (options.show) {\n $modal.modal('show');\n }\n\n return $modal;\n }\n else {\n \n //We need to load the template with an httpget and once it's loaded we'll compile and assign the result to the container\n // object. However since the result could be a promise or just data we need to use a $q.when. We still need to return the \n // $modal object so we'll actually return the modal object synchronously without waiting for the promise. Otherwise this openDialog\n // method will always need to return a promise which gets nasty because of promises in promises plus the result just needs a reference\n // to the $modal object which will not change (only it's contents will change).\n $q.when($templateCache.get(templateUrl) || $http.get(templateUrl, { cache: true }).then(function(res) { return res.data; }))\n .then(function onSuccess(template) {\n\n // Build modal object\n $modal.html(template);\n\n //append to body or other container element\t\n container.append($modal);\n\n // Compile modal content\n $timeout(function() {\n $compile($modal)(scope);\n });\n\n scope.dialogOptions = options;\n\n //Scope to handle data from the modal form\n scope.dialogData = {};\n scope.dialogData.selection = [];\n\n // Provide scope display functions\n //this passes the modal to the current scope\n scope.$modal = function(name) {\n $modal.modal(name);\n };\n\n scope.hide = function() {\n $modal.modal('hide');\n\n $modal.remove();\n $(\"#\" + $modal.attr(\"id\")).remove();\n };\n\n scope.show = function() {\n $modal.modal('show');\n };\n\n scope.submit = function(data) {\n if (callback) {\n callback(data);\n }\n\n $modal.modal('hide');\n\n $modal.remove();\n $(\"#\" + $modal.attr(\"id\")).remove();\n };\n\n scope.select = function(item) {\n var i = scope.dialogData.selection.indexOf(item);\n if (i < 0) {\n scope.dialogData.selection.push(item);\n }else{\n scope.dialogData.selection.splice(i, 1);\n }\n };\n\n scope.dismiss = scope.hide;\n\n // Emit modal events\n angular.forEach(['show', 'shown', 'hide', 'hidden'], function(name) {\n $modal.on(name, function(ev) {\n scope.$emit('modal-' + name, ev);\n });\n });\n\n // Support autofocus attribute\n $modal.on('shown', function(event) {\n $('input[autofocus]', $modal).first().trigger('focus');\n });\n\n //Autoshow\t\n if (options.show) {\n $modal.modal('show');\n }\n });\n \n //Return the modal object outside of the promise!\n return $modal;\n }\n }", "function generateModalBox(filterObj, itemNo) {\n var eventsModal = document.getElementById('eventsModal');\n var modalBox = '';\n modalBox += '<div class=\"event-date-header\"><span>' + filterObj[itemNo].eventSpecDate + ' Events</span> <a href=\"#\" class=\"close-btn\">X</a></div>' +\n '<div class=\"event-time\">' + filterObj[itemNo].eventtimeZone + '</div>' +\n '<div class=\"event-title\">' + filterObj[itemNo].eventTitle + '</div>' +\n '<div class=\"event-description\">' + filterObj[itemNo].eventDescription + '</div><a href=\"' + filterObj[itemNo].learnMoreURL + '\" class=\"event-btn\" target=\"_blank\">Learn more</a>' +\n '<div class=\"events-prev-next\"><span class=\"events-prev glyphicon glyphicon-triangle-top\"></span><span class=\"events-next glyphicon glyphicon-triangle-bottom\"></span></div>';\n $(eventsModal).html(modalBox);\n eventsModal.style.display = 'block';\n }", "function addGridMenu(scope, gridOptions) {\n var modalScope = scope.$new(true),\n modal, template,\n stateName = getStateName();\n\n scope.create = function($event) {\n // if location path is available then we use ui-router\n if (lux.context.uiRouterEnabled)\n $location.path($location.path() + '/add');\n else\n $lux.window.location.href += '/add';\n };\n\n scope.delete = function($event) {\n modalScope.selected = scope.gridApi.selection.getSelectedRows();\n\n var firstField = gridOptions.columnDefs[0].field,\n subPath = scope.options.target.path || '';\n\n // Modal settings\n angular.extend(modalScope, {\n 'stateName': stateName,\n 'repr_field': scope.gridOptions.metaFields.repr || firstField,\n 'infoMessage': gridDefaults.modal.delete.messages.info + ' ' + stateName + ':',\n 'dangerMessage': gridDefaults.modal.delete.messages.danger,\n 'emptyMessage': gridDefaults.modal.delete.messages.empty + ' ' + stateName + '.',\n });\n\n if (modalScope.selected.length > 0)\n template = gridDefaults.modal.delete.templates.delete;\n else\n template = gridDefaults.modal.delete.templates.empty;\n\n modal = $modal({scope: modalScope, template: template, show: true});\n\n modalScope.ok = function() {\n\n function deleteItem(item) {\n var defer = $lux.q.defer(),\n pk = item[scope.gridOptions.metaFields.id];\n\n function onSuccess(resp) {\n defer.resolve(gridDefaults.modal.delete.messages.success);\n }\n\n function onFailure(error) {\n defer.reject(gridDefaults.modal.delete.messages.error);\n }\n\n gridDataProvider.deleteItem(pk, onSuccess, onFailure);\n\n return defer.promise;\n }\n\n var promises = [];\n\n forEach(modalScope.selected, function(item, _) {\n promises.push(deleteItem(item));\n });\n\n $q.all(promises).then(function(results) {\n getPage(scope);\n modal.hide();\n $lux.messages.success(results[0] + ' ' + results.length + ' ' + stateName);\n }, function(results) {\n modal.hide();\n $lux.messages.error(results + ' ' + stateName);\n });\n };\n };\n\n scope.columnsVisibility = function() {\n modalScope.columns = scope.gridOptions.columnDefs;\n modalScope.infoMessage = gridDefaults.modal.columnsVisibility.messages.info;\n\n modalScope.toggleVisible = function(column) {\n if (column.hasOwnProperty('visible'))\n column.visible = !column.visible;\n else\n column.visible = false;\n\n scope.gridApi.core.refresh();\n };\n\n modalScope.activeClass = function(column) {\n if (column.hasOwnProperty('visible')) {\n if (column.visible) return 'btn-success';\n return 'btn-danger';\n } else\n return 'btn-success';\n };\n //\n template = gridDefaults.modal.columnsVisibility.templates.default;\n modal = $modal({scope: modalScope, template: template, show: true});\n };\n\n updateGridMenu(scope, gridDefaults.gridMenu, gridOptions);\n\n extend(gridOptions, {\n enableGridMenu: true,\n gridMenuShowHideColumns: false,\n });\n }", "function modalViewOnShown(dialogRef) {\r\n\t\t\tvar rowData = dt.row('.selected').data(),\r\n\t\t\t\tmodalBody = dialogRef.getModalBody();\r\n\t\t\t$.each(rowData, function (name, value) {\r\n\t\t\t\tmodalBody.find('td[data-cell=\"' + name + '\"]').text(value);\r\n\t\t\t});\r\n\t\t}", "function resetModal() {\n $scope.prof = {};\n }", "function viewSpecDetail(row, attribute) {\n $('#myModal').modal('show');\n $scope.productSpecNumber = row.serial;\n getProductSpec($scope.productSpecNumber); \n }", "function abrirModal(html, obj) {\n $(\"#newOrderModal\").modal();\n console.log(html);\n console.log(obj);\n //carga los datos \n $(\"#div_producto\").html(html);\n Item = obj;\n $('#btn_modal_prod').html(\n '<button onclick=\"agregar_acarrito()\" type=\"button\" data-dismiss=\"modal\" class=\"btn btn-danger\">Agregar a Carrito</button>' +\n '<button type=\"button\" onclick=\"clearItem()\" class=\"btn btn-default\" data-dismiss=\"modal\">Close</button>');\n\n\n }", "function generateModalContainer(person,index, arrayObj)\n {\n const modalContainer = document.createElement('div');\n modalContainer.classList = 'modal-container';\n gallery.appendChild(modalContainer);\n modalContainer.innerHTML = `\n <div class=\"modal\">\n <button type=\"button\" id=\"modal-close-btn\" class=\"modal-close-btn\"><strong>X</strong></button>\n <div class=\"modal-info-container\">\n <img class=\"modal-img\" src=\"${person.picture.large}\" alt=\"profile picture\">\n <h3 id=\"name\" class=\"modal-name cap\">${person.name.first} ${person.name.last}</h3>\n <p class=\"modal-text\">${person.email}</p>\n <p class=\"modal-text cap\">${person.location.city}</p>\n <hr>\n <p class=\"modal-text\">${person.cell}</p>\n <p class=\"modal-text\">${person.location.street.number} ${person.location.street.name}, ${person.location.city}, OR ${person.location.postcode}</p>\n <p class=\"modal-text\">Birthday: ${person.dob.date.substring(0,10)}</p>\n </div>`\n const modalButtonContainer =`\n <div class=\"modal-btn-container\">\n <button type=\"button\" id=\"modal-prev\" class=\"modal-prev btn\">Prev</button>\n <button type=\"button\" id=\"modal-next\" class=\"modal-next btn\">Next</button>\n </div>\n </div>`;\n modalContainer.innerHTML += modalButtonContainer;\n\n navigationButtons(index, arrayObj, modalContainer)\n }", "function addReport(){\r\n var text = \"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ac nisi eu elit rhoncus mattis dignissim vel sem. Donec bibendum augue velit, nec gravida turpis ornare eget. Mauris eu sapien bibendum, blandit risus at, pretium tellus. Donec volutpat non sem a efficitur. Curabitur turpis magna, elementum ac felis nec, congue finibus massa. Quisque laoreet tincidunt quam, sed mollis augue varius egestas. Curabitur quis sollicitudin diam, non tempus tortor. Nam condimentum arcu sed lacus rhoncus, id tincidunt lectus vehicula.\";\r\n var group = 1; //changeable\r\n \r\n //sample populator for report\r\n var ctr = 1;\r\n for(var i = 1; i < 10; i++,ctr++){\r\n if(ctr > 3){\r\n ctr = 1;\r\n }\r\n group = ctr;\r\n document.getElementById(\"report-container\").innerHTML +='<div data-toggle=\"modal\" data-target=\"#report-full\" class=\"card report-card mb-3 \" style=\"min-width:100%\"><div class=\"row no-gutters\"><div class=\"col\"><div class=\"card-body text-wrap\"><span class=\"badge badge-pill\" style=\"background-color:'+colors[group-1]+'\">Group '+ group+'</span><p class=\"text-truncate\">'+text+'</p></div></div></div></div>';\r\n }\r\n}", "function showWriteReviewModal()\n\t\t{\n\t\t\t$ionicModal.fromTemplateUrl('templates/modals/write-review-modal.html', function($ionicModal) {\n\t\t\t\t$scope.modal = $ionicModal;\n\t }, {\n\t scope: $scope,\n\t animation: 'slide-in-up'\n\t }).then(function(modal) {\n\t $scope.modal = modal;\n\t $scope.modal.show();\n\t });\n\t }", "showDeleteListModal(name) {\n let modal = document.getElementById(\"delete-modal\");\n modal.classList.add(\"is-visible\");\n let dialogBox = document.getElementById(\"dialog\");\n let newDialog = \"Delete the \";\n newDialog = newDialog + name;\n newDialog = newDialog + \" List?\";\n dialogBox.innerHTML = newDialog;\n }", "function showLastRunDetails() {\n $('#modal-container').html(last_run_details_template(runResults))\n $('#modal-container').modal()\n}", "function showModel(choiceArray) {\n //input al coins to object\n const arrayData = choiceArray.map(item => `<button type=\"button\" class=\"btnSwitch btn-primary btn-lg\" value=${item}>${item}</button>&nbsp&nbsp&nbsp;`);\n //append current data to modal\n $(\"#myModal\").html(\" \").append(`\n <div class=\"modal-dialog\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">you can choose only 5 currency,<br> If you want to choose another currency you need to select one of the currencies you want to remove.</h5>\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body\">\n ${arrayData.join().replace(/,/g, '')}\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">Close</button>\n </div>\n </div>\n</div>\n `)\n //show model \n $('#myModal').modal('show');\n}", "function addOwner() {\n var resolvedData = {\n entity: 'Content',\n thisRecord: $scope.data.thisContent\n }\n\n var addOwnerModal = modalManager.openModal('addOwner', resolvedData)\n\n //after result - add / remove from UI\n\n addOwnerModal.result.then(function(results){\n console.log(results);\n //update this opp\n //comes back as array so need to loop through to push in properly\n _.forEach(results, function(value){\n $scope.data.thisContent.ownerLinks.push(value);\n })\n\n })\n}", "function showRepeatDialog(e)\n {\n console.log(e);\n $mdDialog.show({\n controller : 'EventRepeatDialogController',\n controllerAs : 'vm',\n templateUrl : 'app/main/apps/calendar/dialogs/event-repeat/event-repeat-dialog.html',\n parent : angular.element($document.body),\n targetEvent : e,\n clickOutsideToClose: true,\n locals : {\n event : e\n }\n });\n }", "function drawModal(array, name, kind){\n\t\tvar content=\"\";\n\t\tvar name = name.replace(/ /g, '');//remove white space\n\t\t//when emtpy array\n\t\tif(array == null || array.length == 0)\n\t\t\treturn \"None\";\n\t\t//this condition allows us to send a string as a parameter instead of an array and the funciton would still work\n\t\tif(typeof(array)== 'string'){\n\t\t\tarray = array.split();\n\t\t}\n\t\t//loop through the array and call an ajax request for each link that comes in the array\n\t\t//when we get the data assign it to the modal we just returned.\n\t\tarray.forEach(function(element,index,array){\n\t\t\t$.when($.ajax(array[index])).then(function(data){\n\t\t\t\t//special case for films\n\t\t\t\tif(kind == 'films'){\n\t\t\t\t\tcontent+= \"<li>\"+data.title;\n\t\t\t\t\tcontent += \"<img src='/img/\"+kind+\"/\"+ IgnoreSpecialCharactersFromString(data.title)+ \".jpg' class='charactersIMG center-block'</li>\";\n\t\t\t\t}\n\t\t\t\t//else use title\n\t\t\t\telse{\n\t\t\t\t\tcontent +=\"<li>\"+data.name;\n\t\t\t\t\tcontent += \"<img src='/img/\"+kind+\"/\"+ IgnoreSpecialCharactersFromString(data.name)+ \".png' class='charactersIMG center-block'</li>\";\n\t\t\t\t}\n\t\t\t\t$('#'+IgnoreSpecialCharactersFromString(name)+'').html(content);\n\t\t\t});\n\t\t});\n\t\t//create and return the \"empty modal initialized with unique id\"\n\t\t\n\t\tvar modal = \n\t\t\"<button type='button' class='btn btn-warning btn-sm' data-toggle='modal' data-target='.\"+IgnoreSpecialCharactersFromString(name)+\"'>Display</button>\"+\n\t\t\"<div class='modal fade \"+IgnoreSpecialCharactersFromString(name)+\"' tabindex='-1' role='dialog' aria-labelledby='mySmallModalLabel'>\"+\n\t\t \"<div class='modal-dialog modal-sm' role='document'>\"+\n\t\t \"<div class='modal-content' id='\"+IgnoreSpecialCharactersFromString(name)+\"'>\"+\n\t\t\"</div></div></div>\";\n\n\t\treturn modal;\n\t}", "function modalInject(){\n\t\t//inject modal holder into page\n\t\tif (!document.getElementById(\"g_block_modals\")) {\n\t\t\t$(\"body\").append(tdc.Grd.Templates.getByID('modalInject'));\n\t\t}\n\t}", "function insertProfiles(results) { //passes results and appends them to the page\r\n $.each(results, function(index, user) {\r\n $('#gallery').append(\r\n `<div class=\"card\" id=${index}>\r\n <div class=\"card-img-container\">\r\n <img class=\"card-img\" src=\"${user.picture.large}\" alt=\"profile picture\">\r\n </div>\r\n <div class=\"card-info-container\">\r\n <h2 id=${index} class=\"card-name cap\">${user.name.first} ${user.name.last}</h2>\r\n <p class=\"card-text\">${user.email}</p>\r\n <p class=\"card-text cap\">${user.location.city}, ${user.location.state}</p>\r\n </div>\r\n </div>`);\r\n });\r\n\r\n//The modal div is being appended to the html\r\n function modalWindow() {\r\n $('#gallery').append(\r\n `<div class=\"modal-container\">\r\n <div class=\"modal\">\r\n <button type=\"button\" id=\"modal-close-btn\" class=\"modal-close-btn\"><strong>X</strong></button>\r\n <div class=\"modal-info-container\">\r\n </div>\r\n </div>\r\n </div>`);\r\n $('.modal-container').hide();\r\n }\r\n// I am formating the information I want the modal window to portray\r\n function modalAddon(user) {\r\n\r\n $(\".modal-info-container\").html( `\r\n <img class=\"modal-img\" src=\"${user.picture.large}\" alt=\"profile picture\">\r\n <h2 id=\"name\" class=\"modal-name cap\">${user.name.first} ${user.name.last}</h2>\r\n <p class=\"modal-text\">${user.email}</p>\r\n <p class=\"modal-text cap\">${user.location.city}</p>\r\n <br>_________________________________</br>\r\n <p class=\"modal-text\">${user.cell}</p>\r\n <p class=\"modal-text\">Postcode: ${user.location.postcode}</p>\r\n <p class=\"modal-text\">Birthday: ${user.dob.date}</p>\r\n </div>\r\n`);\r\n$(\".modal-container\").show();\r\n\r\n //This hide's the modal window when the \"X\" button is clicked\r\n $('#modal-close-btn').on(\"click\", function() {\r\n $(\".modal-container\").hide();\r\n });\r\n}\r\n\r\n\r\nmodalWindow(); //This opens the modal window when the card is clicked\r\n $('.card').on(\"click\", function() {\r\n let user = $('.card').index(this);\r\n modalAddon(results[user]);\r\n\r\n });\r\n\r\n}", "function createDeleteModal(list) {\n let newP = $(\"<p>\", {text: \"Are you sure you want to delete this team?\"});\n\n $(\".modal-body\").empty();\n $(\".modal-title\").text(list.TeamName);\n $(\".modal-body\").append(newP);\n}", "function createModalDivHtml(options) {\n //If an element already exists with that ID, then dont recreate it.\n if ($(\"#\" + options.modalContainerId).length) {\n return;\n }\n\n var html = '';\n //Warning, do not put tabindex=\"-1\" in the element below. Doing so breaks search functionality in a select 2 drop down\n html += '<div id=\"' + options.modalContainerId + '\" class=\"modal\" data-keyboard=\"true\" role=\"dialog\" data-callback=\"' + options.callback + '\">';\n html += ' <div class=\"modal-content\"></div>';\n html += '</div>';\n $('body').prepend(html);\n }", "function createEditMemberModal(list) {\n let form = $(\"<form>\", {id: \"editMemberForm\"});\n let newDiv = $(\"<div>\", {class: \"form-group\"});\n let labelArr = [\"Email:\",\"Member Name:\", \"Contact Name:\", \"Age:\", \"Gender:\", \"Phone:\"];\n\n $(\".modal-title\").text(\"Edit\");\n $(\".modal-body\").empty()\n .append(form);\n\n let i = 0;\n for(let key in list) {\n if(key != \"MemberId\") {\n newDiv = $(\"<div>\", {class: \"form-group\"});\n\n let newLabel = $(\"<label>\", {for: \"modal-\" + key + \"-\" + list.MemberId, text: labelArr[i]});\n let newInput = $(\"<input>\", {type: \"text\", \n class: \"form-control\", \n id: \"modal-\" + key + \"-\" + list.MemberId, \n name: key.toLowerCase(), \n value: list[key]});\n \n form.append(newDiv);\n newDiv.append(newLabel)\n .append(newInput);\n\n i++;\n }\n }\n}", "function setModalData(item) {\n modal = `<div class=\"modal-container\">\n <div class=\"modal\">\n <button type=\"button\" id=\"modal-close-btn\" class=\"modal-close-btn\"><strong>X</strong></button>\n <div class=\"modal-info-container\">\n <img class=\"modal-img\" src=\"${\n item.picture.large\n }\" alt=\"profile picture\">\n <h3 id=\"name\" class=\"modal-name cap\">${item.name.title} ${\n item.name.first\n } ${item.name.last}</h3>\n <p class=\"modal-text\">${item.email}</p>\n <p class=\"modal-text cap\">${item.location.city}</p>\n <hr>\n <p class=\"modal-text\">${item.cell}</p>\n <p class=\"modal-text\">${item.location.street}, ${\n item.location.city\n }, ${item.location.state} ${item.location.postcode}</p>\n <p class=\"modal-text\">Birthday: ${item.dob.date}</p>\n </div>\n </div>\n <div class=\"modal-btn-container\">\n <button type=\"button\" id=\"modal-prev\" class=\"modal-prev btn\">Prev</button>\n <button type=\"button\" id=\"modal-next\" class=\"modal-next btn\">Next</button>\n </div>\n </div>`;\n\n return $(modal);\n}", "function Modal(id, items) {\n this.id = id;\n this.items = items;\n this.container = $('<div>', {\n 'id': this.id,\n 'class': 'modal fade',\n 'tabindex': -1,\n 'role': 'dialog'\n });\n this.setIndex = function(i) {\n this.currentIndex = i;\n };\n this.getIndex = function () {\n if(this.currentIndex !== 'undefined') {\n \n return this.currentIndex;\n } else {\n return false;\n }\n };\n this.getHTML = function() {\n modalHtml = '<div class=\"modal-dialog modal-lg\" role=\"document\">\\n' +\n '<div class=\"modal-content\">\\n' +\n '<a href=\"#\" class=\"modal-arrow modal-previous-arrow\"><i class=\"fa fa-chevron-left\" aria-hidden=\"true\"></i></a>' +\n '<div class=\"modal-box\">' +\n '<div class=\"modal-header\">\\n' +\n '<button type=\"button\" class=\"close modal-close\" data-dismiss=\"modal\" aria-label=\"Close\"><i class=\"fa fa-times\" aria-hidden=\"true\"></i></button>\\n' +\n '</div>\\n' +\n '<div class=\"modal-body\">\\n' + items[this.getIndex()]['data-html'] +\n '</div>\\n' +\n '</div>' +\n '<a href=\"#\" class=\"modal-arrow modal-next-arrow\"><i class=\"fa fa-chevron-right\" aria-hidden=\"true\"></i></a>' +\n '</div><!-- /.modal-content -->\\n' +\n '</div><!-- /.modal-dialog -->\\n';\n return modalHtml;\n };\n this.create = function() {\n let $modal = this.container.html(this.getHTML());\n if($('#'+this.id).length === 0) {\n $modal.appendTo(document.body);\n }\n this.hideArrows();\n };\n this.changeResult = function(i) {\n this.currentIndex = i;\n this.container.html(this.getHTML());\n this.hideArrows();\n };\n this.hideArrows = function() {\n if(this.getIndex() !== false) {\n if(this.getIndex() === this.items.length - 1) {\n this.container.find('.modal-next-arrow').addClass('hide');\n } else if (this.getIndex() === 0) {\n this.container.find('.modal-previous-arrow').addClass('hide');\n } else {\n this.container.find('.modal-arrow').removeClass('hide');\n }\n }\n }\n}", "function showModal() {\n\n $('#myModal').modal(\"show\");\n $(\".modal-title\").text(data.name)\n $(\".modal-li-1\").text(\"Generation: \" + data.generation.name)\n $(\".modal-li-2\").text(\"Effect: \" + data.effect_changes[0].effect_entries[1].effect)\n $(\".modal-li-3\").text(\"Chance: \" + data.effect_entries[1].effect)\n $(\".modal-li-4\").text(\"Bonus Effect: \" + data.flavor_text_entries[0].flavor_text)\n }", "function buildNotesModal(data,mongo_id){\n\n var numNotes; \n\n if (data.note != null){\n numNotes = data.note.length;\n }else{ numNotes = 0; }\n\n var html = `\n <div class=\"bootbox modal fade show\" data-mongoid=\"${mongo_id}\" tabindex=\"-1\" role=\"dialog\" style=\"display: block;\">\n <div class=\"modal-dialog\">\n <div class=\"modal-content\">\n <div class=\"modal-body\">\n <button type=\"button\" class=\"bootbox-close-button close\" data-dismiss=\"modal\" aria-hidden=\"true\" style=\"margin-top: -10px;\">×</button>\n <div class=\"bootbox-body\">\n <div class=\"container-fluid text-center\">\n \n <h4>Notes For Article: ${data.title}</h4>\n <hr>\n <ul class=\"list-group note-container\">`;\n \n if(numNotes > 0){\n for(var i = 0; i < numNotes; i++){\n html += `\n <li class=\"list-group-item note\">${data.note[i]}<button class=\"btn btn-danger note-delete\">x</button></li>`\n }\n } else{\n html += `\n <li class=\"list-group-item\">No notes for this article yet.</li>`;\n }\n \n html += \n `</ul>\n <textarea placeholder=\"New Note\" id=\"textareaNotes\" rows=\"4\" cols=\"60\"></textarea>\n <button class=\"btn btn-success save\">Save Note</button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>`\n return html\n}", "function AccordionCtrl($scope) {\n $scope.oneAtATime = true;\n\n $scope.groups = [\n {\n title: \"Dynamic Group Header - 1\",\n content: \"Dynamic Group Body - 1\"\n },\n {\n title: \"Dynamic Group Header - 2\",\n content: \"Dynamic Group Body - 2\"\n }\n ];\n\n}", "generateOverlay() {\n for (let i = 0; i < this.results.length; i++) {\n let modalContainer = `<div class=\"modal-container\" hidden>\n <div class=\"modal\">\n <button type=\"button\" id=\"modal-close-btn\" class=\"modal-close-btn\"><strong>X</strong></button>\n <div class=\"modal-info-container\">\n <img class=\"modal-img\" src=\"${\n this.pictures[i]\n }\" alt=\"profile picture\">\n <h3 id=\"name\" class=\"modal-name cap\">${\n this.names[i]\n }</h3>\n <p class=\"modal-text\">${this.emails[i]}</p>\n <p class=\"modal-text cap\">${\n this.city[i]\n }</p>\n <hr>\n <p class=\"modal-text\">${this.numbers[i]}</p>\n <p class=\"modal-text\">${\n this.addresses[i]\n }</p>\n <p class=\"modal-text\">Birthday: ${\n this.birthdays[i]\n }</p>\n </div>\n </div>`;\n\n this.$body.append(modalContainer);\n }\n\n const $modalContainer = $(\".modal-container\");\n const modalButtons = `<div class=\"modal-btn-container\">\n <button type=\"button\" id=\"modal-prev\" class=\"modal-prev btn\">Prev</button>\n <button type=\"button\" id=\"modal-next\" class=\"modal-next btn\">Next</button>\n </div>`;\n\n $modalContainer.each((i, val) => $(val).append(modalButtons));\n }", "function NumbersTableCtrl($scope, sharedService, popUpService) {\n\n $scope.played = false;\n $scope.numbersTable = sharedService.numbersTable;\n\n var numOfRows = sharedService.getNumberOfRowsToShow();\n\n for (var r = 0; r < numOfRows; r++) {\n $scope.numbersTable[r] = [];\n }\n var rowIndex = 0;\n\n for (var i = 1; i <= sharedService.MAX_NUMBERS; i++) {\n $scope.numbersTable[rowIndex].push({number: i, class: \"number\", selected: false});\n if (i % sharedService.MAX_COLS == 0) {\n rowIndex++;\n }\n }\n\n $scope.select = function (item) {\n\n var selectedNumber = item.number;\n\n if (selectedNumber in sharedService.selectedNumbers) {\n\n delete sharedService.selectedNumbers[selectedNumber];\n } else {\n\n if (_.size(sharedService.selectedNumbers) >= sharedService.MAX_SELECTIONS) {\n\n alert(\"You can select a maximum of \" + sharedService.MAX_SELECTIONS + \" number.\")\n } else {\n\n sharedService.selectedNumbers[selectedNumber] = true;\n popUpService.showPayoutPanel();\n }\n }\n\n }\n\n $scope.getStyle = function (item) {\n\n var number = item.number;\n if (number in sharedService.selectedNumbers & number in sharedService.resultNumbers) {\n return \"btn-success\";\n } else if (number in sharedService.resultNumbers) {\n return \"btn-warning\";\n } else if (number in sharedService.selectedNumbers) {\n return \"btn-info\";\n }\n }\n\n}", "create(opts) {\n // create ionic's wrapping ion-modal component\n const modalElement = document.createElement('ion-modal');\n // give this modal a unique id\n modalElement.modalId = ids++;\n // convert the passed in modal options into props\n // that get passed down into the new modal\n Object.assign(modalElement, opts);\n // append the modal element to the document body\n const appRoot = document.querySelector('ion-app') || document.body;\n appRoot.appendChild(modalElement);\n return modalElement.componentOnReady();\n }", "function addPortfolioModal(element, number) {\n var modal = $(\"<div>\", {\n id : 'portfolioModal' + number,\n class: 'portfolio-modal modal fade',\n tabindex : \"-1\",\n role : \"dialog\"\n }).attr( 'aria-hidden', 'true');\n\n var modalContent = $('<div>', { class: 'modal-content'});\n\n var lr = $('<div>', { class: 'lr' }).append(\"<div class='rl'></div>\")\n var closeModal = $('<div>', { class: 'close-modal' }).attr('data-dismiss','modal').append(lr);\n\n var container = $('<div>', { class: 'container' });\n var row = $('<div>', { class: 'row' });\n var col = $('<div>', { class: 'col-lg-8 col-lg-offset-2' });\n var modalBody = $('<div>', { class: 'modal-body'});\n var title = $('<h2>', { html: element.title });\n var hr = $(\"<hr>\", { class: 'star-primary' });\n var img = $('<img>', {\n class: 'img-responsive img-centered',\n src: element.miniature,\n alt: ''\n });\n var description = $(\"<p>\", { html: element.description });\n\n // Projects details\n var list = $('<ul>', { class: 'list-unstyled item-details'});\n\n var liAuthor = $('<li>', { html: 'Auteur(s)' })\n .append($('<strong>').append($('<p>', { html: element.authors })));\n\n var liDate = $('<li>', { html: 'Date' })\n .append($('<strong>').append($('<p>', { html: element.year })));\n\n var liPlatform = $('<li>', { html: 'Plateformes' })\n .append($('<strong>').append($(\"<p>\", { html: element.platform })));\n\n\n var button = $('<button>', {\n class: 'btn btn-danger',\n type : 'button'\n }).attr('data-dismiss', 'modal')\n .append(\"<i class='fa fa-times'>Close</i>\");\n\n list.append(liAuthor).append(liDate).append(liPlatform);\n modalBody.append(title).append(hr).append(img)\n .append(description).append(list).append(button);\n\n container.append(row).append(col).append(modalBody);\n modalContent.append(closeModal).append(container);\n modal.append(modalContent);\n modal.insertAfter(\"#portfolio\");\n}", "function appendModal(){\n\t\tvar panelSeklly = '<div class=\"modal fade\">\\n' + \n '\t<div class=\"modal-dialog\">\\n' + \n '\t\t<div class=\"modal-content\">\\n' +\n '\t\t\t<div class=\"modal-header\">\\n' + \n '\t\t\t\t<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>\\n' + \n '\t\t\t\t<h4 class=\"modal-title\">Modal title</h4>\\n' + \n '\t\t\t</div>\\n' + \n '\t\t\t<div class=\"modal-body\">\\n' + \n '\t\t\t\t<p>One fine body&hellip;</p>\\n' + \n '\t\t\t</div>\\n' + \n '\t\t\t<div class=\"modal-footer\">\\n' + \n '\t\t\t\t<button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Close</button>\\n' + \n '\t\t\t\t<button type=\"button\" class=\"btn btn-primary\">Save changes</button>\\n' + \n '\t\t\t</div>\\n' + \n '\t\t</div>\\n' + \n '\t</div>\\n' + \n'</div>';\n\t\t//\t\t\twindow.alert(\"Hello\");\n\t\tvar editor = edManager.getCurrentFullEditor();\n\t\tif(editor){\n\t\t\tvar insertionPos = editor.getCursorPos();\n\t\t\teditor.document.replaceRange(panelSeklly, insertionPos);\n\t\t}\t\n\t}", "function generateModal(item, data) {\n console.log(item)\n let modalContainer = document.createElement(\"div\");\n modalContainer.className = \"modal-container\";\n let html = `\n <div class=\"modal-container\">\n <div class=\"modal\">\n <button type=\"button\" id=\"modal-close-btn\" class=\"modal-close-btn\"><strong>X</strong></button>\n <div class=\"modal-info-container\">\n <img class=\"modal-img\" src=\"${item.picture.large}\" alt=\"profile picture\">\n <h3 id=\"name\" class=\"modal-name cap\">${item.name.first} ${item.name.last}</h3>\n <p class=\"modal-text\">${item.email}</p>\n <p class=\"modal-text cap\">${item.location.city}</p>\n <hr>\n <p class=\"modal-text\">${item.cell}</p>\n <p class=\"modal-text\">${item.location.street.number} ${item.location.street.name}, ${item.location.state} ${item.location.postcode}</p>\n <p class=\"modal-text\">Birthday: 10/21/2015</p>\n </div>\n </div>\n </div>\n `;\n\n modalContainer.innerHTML = html;\n body.append(modalContainer);\n\n // Click 'X' to close modal window\n const button = document.querySelector(\"button\");\n const modal = document.querySelector(\"div.modal-container\");\n button.addEventListener(\"click\", () => {\n modal.remove();\n });\n}", "_exposeToModals() {\n // TODO(http://github.com/angular/components/issues/26853): consider de-duplicating this with the\n // `LiveAnnouncer` and any other usages.\n //\n // Note that the selector here is limited to CDK overlays at the moment in order to reduce the\n // section of the DOM we need to look through. This should cover all the cases we support, but\n // the selector can be expanded if it turns out to be too narrow.\n const id = this._liveElementId;\n const modals = this._document.querySelectorAll('body > .cdk-overlay-container [aria-modal=\"true\"]');\n for (let i = 0; i < modals.length; i++) {\n const modal = modals[i];\n const ariaOwns = modal.getAttribute('aria-owns');\n this._trackedModals.add(modal);\n if (!ariaOwns) {\n modal.setAttribute('aria-owns', id);\n }\n else if (ariaOwns.indexOf(id) === -1) {\n modal.setAttribute('aria-owns', ariaOwns + ' ' + id);\n }\n }\n }", "function viewMedicalInfo(selectedItems) {\n var modalInstance = $modal.open({\n templateUrl: 'app/matter/matter-details/view-memo.html',\n controller: 'viewMemoCtrl as viewMemoInfo',\n keyboard: false,\n size: 'lg',\n windowClass: 'cal-pop-up',\n resolve: {\n viewMemoInfo: function () {\n return {\n selectedItems: selectedItems\n };\n }\n }\n });\n }", "function relatedTexts(data) {\n var contentTX = '<div class=\"related-texts\">';\n\n $.each(data.topic.media, function(rInd, rElm) {\n contentTX += '<div class=\"each-text\">';\n contentTX += '<a href=\"#pid' + rElm.id + '\" class=\"thumbnail\" data-toggle=\"modal\">';\n contentTX += '<img src=\"' + rElm.images[1].url + '\" alt=\"' + (rElm.captions.length > 0 ? rElm.captions[0].title : \"\") + '\">';\n contentTX += '</a>';\n contentTX += '</div>';\n\n //Modal for each photo\n contentTX += '<div class=\"modal fade\" tabindex=\"-1\" role=\"dialog\" id=\"pid' + rElm.id + '\">';\n contentTX += '<div class=\"modal-dialog\">';\n contentTX += '<div class=\"modal-content\">';\n contentTX += '<div class=\"modal-header\">';\n contentTX += '<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\">&times;</button>';\n contentTX += '<h4 class=\"modal-title\" id=\"myModalLabel\">' + (rElm.captions.length > 0 ? rElm.captions[0].title : \"\") + '</h4>';\n contentTX += '</div>';\n contentTX += '<div class=\"modal-body\">';\n contentTX += '<img src=\"' + rElm.images[6].url + '\" alt=\"' + (rElm.captions.length > 0 ? rElm.captions[0].title : \"\") + '\">';\n contentTX += '<p><strong>Resource #:</strong> ' + rElm.id + '</p>';\n contentTX += '</div>';\n contentTX += '</div>';\n contentTX += '</div>';\n contentTX += '</div>';\n });\n\n contentTX += '</div>';\n\n $(\"#tab-texts\").append(contentTX);\n}", "function createDialogWithPartData(title,templateName,width) { \n var ui = SpreadsheetApp.getUi();\n var createUi = HtmlService.createTemplateFromFile(templateName).evaluate().getContent();\n var html = HtmlService.createTemplate(createUi+\n \"<script>\\n\" +\n \"var data = \"+getInvData()+\n \"</script>\")\n .evaluate()\n .setSandboxMode(HtmlService.SandboxMode.IFRAME)\n .setWidth(width);\n \n var ss = SpreadsheetApp.getActiveSpreadsheet();\n ui.showModalDialog(html,title);\n}", "function launchDynamicModal(title, body, timeTillClose) {\n $scope.currentModalTitle = title;\n $scope.currentModalBody = body;\n\n $scope.createDynamicModal = $uibModal.open({\n templateUrl: \"modal/dynamicModal\",\n scope: $scope\n });\n\n if (undefined !== timeTillClose) {\n let closeOnTimeout = function () {\n $scope.createDynamicModal.dismiss();\n };\n setTimeout(closeOnTimeout, timeTillClose);\n }\n }", "_addModalHTML() {\n let modalEl = document.createElement(\"div\");\n modalEl.setAttribute(\"id\", \"enlightenModal\");\n modalEl.setAttribute(\"class\", \"modal\");\n modalEl.innerHTML = `\n <div class=\"modal-content\">\n <span class=\"close\">&times;</span>\n <h3>Title</h3>\n <p>Content</p>\n </div>f`;\n\n let bodyEl = document.getElementsByTagName('body')[0];\n bodyEl.appendChild(modalEl);\n let span = document.getElementsByClassName(\"close\")[0];\n\n // When the user clicks on <span> (x), close the modal\n span.onclick = function () {\n modalEl.style.display = \"none\";\n };\n\n // When the user clicks anywhere outside of the modal, close it\n window.onclick = function (event) {\n if (event.target.id === \"enlightenModal\") {\n modalEl.style.display = \"none\";\n }\n };\n return modalEl;\n }", "function galleryHTML(data) {\n\tdata.map((person) => {\n\t\tconst cardDiv = document.createElement('div');\n\t\tgallery.appendChild(cardDiv);\n\t\tcardDiv.className = 'card';\n\t\tcardDiv.innerHTML = `\n <div class=\"card-img-container\">\n <img class=\"card-img\" src=\"${person.large}\" alt=\"profile picture\">\n </div>\n <div class=\"card-info-container\">\n <h3 id=\"name\" class=\"card-name cap\">${person.name}</h3>\n <p class=\"card-text\">${person.email}</p>\n <p class=\"card-text cap\">${person.location}</p>\n </div>\n `;\n\n\t\t// Listens for clicks on an employee card and opens a modal with further information about the employee.\n\t\tcardDiv.addEventListener('click', () => {\n\t\t\tconst modalDiv = document.createElement('modal');\n\t\t\tgallery.insertAdjacentElement('afterend', modalDiv);\n\t\t\tmodalDiv.className = 'modal-container';\n\t\t\tmodalDiv.innerHTML = `\n <div class=\"modal\">\n <button type=\"button\" id=\"modal-close-btn\" class=\"modal-close-btn\"><strong>X</strong></button>\n <div class=\"modal-info-container\">\n <img class=\"modal-img\" src=\"${person.large}\" alt=\"profile picture\">\n <h3 id=\"name\" class=\"modal-name cap\">${person.name}</h3>\n <p class=\"modal-text\">${person.email}</p>\n <p class=\"modal-text cap\">${person.location}</p>\n <hr>\n <p class=\"modal-text\">Phone: ${person.phoneNumber}</p>\n <p class=\"modal-text\">Address: ${person.address}</p>\n <p class=\"modal-text\">Birthday: ${reformatBirthday(\n\t\t\t\t\t\tperson.birthday\n\t\t\t\t\t)}</p>\n </div>\n `;\n\n\t\t\tconst modalCloseBtn = document.querySelector('.modal-close-btn');\n\n\t\t\t// Listens for click on the close button on the modal window.\n\t\t\tmodalCloseBtn.addEventListener('click', () => {\n\t\t\t\tdocument.querySelector('.modal-container').style.display = 'none';\n\t\t\t});\n\t\t});\n\t});\n}", "function modal(id, method) {\n angular.element('#' + id).modal(method);\n }", "function modalInstance(movieID, movieArr, $uibModal){\n\tvar id = movieID;\n\tvar modalInstance = $uibModal.open({\n\t\twindowClass: \"show\",\n\t\ttemplateUrl: \"templates/modal.html\",\n\t\tcontroller: \"modalCtrl\",\n\t\tresolve:{\n\t\t\tdata: function(){\n\t\t\t\treturn getSelectedMovie(id, movieArr);\n\t\t\t}\n\t\t}\n\t});\n}", "function createDialogWithAllData(title,templateName,width) { \n var ui = SpreadsheetApp.getUi();\n var createUi = HtmlService.createTemplateFromFile(templateName).evaluate().getContent();\n var html = HtmlService.createTemplate(createUi+\n \"<script>\\n\" +\n \"var data = \"+getAllData()+\n \"</script>\")\n .evaluate()\n .setSandboxMode(HtmlService.SandboxMode.IFRAME)\n .setWidth(width);\n \n var ss = SpreadsheetApp.getActiveSpreadsheet();\n ui.showModalDialog(html,title);\n}", "function getModal(modalid) {\n return '<div id=\"' + modalid + '\" class=\"modal large hide fade new-experiment\" tabindex=\"-1\" role=\"dialog\">' +\n '<div class=\"modal-header\">' +\n '<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\">×</button>' +\n '<h3 id=\"myModalLabel\">Select Environmental Data for This Subset</h3>' +\n '</div>' +\n '<div id=\"modal-body\" class=\"modal-body\"></div>' +\n '<div class=\"modal-footer\">' +\n '<button class=\"btn btn-primary\">Select Layers</button>' +\n '</div>' +\n '</div>'\n }", "function openDeleteVariableModal(element) {\n lastClickedAddVariableBtn = element;\n $('#deleteVariable').modal('show');\n\n lastOpendVarContainer = $(element).closest(\"label\").next(\"div\");\n var deleteVarContainer = $(\"#deleteVariableContainer\");\n deleteVarContainer.html(\"\");\n\n $(\".availableVariable\", lastOpendVarContainer).each(function(key, value) {\n var varName = value.innerHTML;\n deleteVarContainer.append(\n '<tr><th style=\"font-size: 18px;\">' + varName + '</th>' +\n '<td><button class=\"btn btn-danger btn-xs\" id=\"' + varName + '\" style=\"float: right;\" onclick=\"deleteVariable(this)\">' +\n '<span class=\"fa fa-trash-o fa-lg\" aria-hidden=\"true\"></span></td></tr>'\n );\n });\n}", "function response_in_modal(response) {\n $(\".modal-title\").html(response);\n $(\"#empModal\").modal(\"show\");\n}", "function createEditTeamModal(list) {\n let form = $(\"<form>\", {id: \"editTeamForm\"});\n let newDiv = $(\"<div>\", {class: \"form-group\"});\n let labelArr = [\"Team Name:\",\"Manager Name:\", \"Manager Phone:\", \"Manager Email:\", \n \"Max Team Members:\", \"Min Member Age:\", \"Max Member Age:\", \"Team Gender:\"];\n\n $(\".modal-title\").text(\"Edit Team\");\n $(\".modal-body\").empty()\n .append(form);\n\n let i = 0;\n for(let key in list) {\n\n if(key != \"TeamId\" && key != \"League\" && key != \"Members\") {\n\n if(key != \"TeamGender\") newDiv = $(\"<div>\", {class: \"form-group\"});\n else newDiv = $(\"<div>\", {class: \"form-check\"});\n form.append(newDiv);\n\n let newLabel = $(\"<label>\", {for: \"modal-\" + key + \"-\" + list.TeamId, text: labelArr[i]});\n newDiv.append(newLabel);\n \n let newSelect;\n i++;\n\n switch(key) {\n case 'TeamId':\n // Do nothing\n break;\n\n case 'League':\n // Do nothing\n break;\n\n case 'MaxTeamMembers': {\n newSelect = $(\"<select>\", {class: \"form-control\",\n id: \"modal-\" + key + \"-\" + list.TeamId,\n name: key.toLowerCase(),\n required: \"true\"});\n\n newDiv.append(newSelect);\n\n for(let i = 2; i <= 8; i++) {\n let teamSize = $(\"<option>\", {text: i, value: i});\n newSelect.append(teamSize);\n };\n break;\n }\n\n case 'MinMemberAge': {\n newSelect = $(\"<select>\", {class: \"form-control\",\n id: \"modal-\" + key + \"-\" + list.TeamId,\n name: key.toLowerCase(),\n required: \"true\"});\n\n newDiv.append(newSelect);\n\n for(let i = 13; i <= 100; i++) {\n let ageOption = $(\"<option>\", {text: i, value: i});\n newSelect.append(ageOption);\n };\n break;\n }\n\n case 'MaxMemberAge': {\n newSelect = $(\"<select>\", {class: \"form-control\",\n id: \"modal-\" + key + \"-\" + list.TeamId,\n name: key.toLowerCase(),\n required: \"true\"});\n\n newDiv.append(newSelect);\n\n for(let i = 13; i <= 100; i++) {\n let ageOption = $(\"<option>\", {text: i, value: i});\n newSelect.append(ageOption);\n };\n break;\n }\n\n case 'TeamGender':\n newDiv = $(\"<div>\", {class: \"form-check\"});\n\n let newInput = $(\"<input>\", {type: \"text\", \n class: \"form-control\", \n id: \"modal-\" + key + \"-\" + list.TeamId, \n name: key.toLowerCase(), \n value: list[key]});\n break;\n\n case 'Members':\n // Do nothing\n break;\n\n default: {\n let newInput = $(\"<input>\", {type: \"text\", \n class: \"form-control\", \n id: \"modal-\" + key + \"-\" + list.TeamId, \n name: key.toLowerCase(), \n value: list[key]});\n\n newDiv.append(newInput);\n break;\n }\n }\n }\n }\n}", "function show_modal_tags() {\n $.ajax({\n type: \"get\",\n url: \"api/tag/list\",\n success: function (response) {\n $(\"#modal_tags_body\").empty();\n\n $(\"#modal_tags_body\").append(\n `<table class=\"table table-light\">\n <tbody>\n ${\n Object.keys(response).map(function (key) {\n return `<tr>\n <td class=\"w-75\">\n <input class=\"form-control\" type=\"text\" name=\"\" value=\"${response[key].title}\" id=\"tag_title_${response[key].id}\">\n </td>\n <td class=\"w-25 mx-2 my-2\">\n <button type=\"\" button class=\"btn w-100 ${response[key].color}\"></button>\n </td>\n <td>\n <button type=\"button\" class=\"btn btn-sm btn-outline-success tag\" value=\"${response[key].id}\">\n <i class=\"fa fa-save\"></i>\n </button>\n </td>\n </tr>`;\n }).join(\"\")\n }\n </tbody>\n </table>\n `);\n\n $(\"#modal_tags\").modal();\n }\n });\n}", "function renderizarLista(listaNotebooks, marca) {\n // creo lista secundaria para mostrar productos por marca\n let listaSecundaria = [];\n\n $(\".main__articles\").empty();\n\n listaSecundaria = pushListaSecundaria(listaNotebooks, listaSecundaria, marca);\n\n for (let notebook of listaSecundaria) {\n $(\".main__articles\").append(`\n <article id=\"producto${notebook.id}\" class=\"col-md-3 col-6 text-center\">\n <div class=\"card__notebook card\" style=\"width: auto\">\n <img\n src=\"${notebook.img}\"\n class=\"img__notebook card-img-top\"\n alt=\"\"\n height=\"160\"\n />\n <div class=\"card-body\">\n <h5 class=\"card-title m-0\">${notebook.marca}</h5>\n <h6 class=\"card-text\">${notebook.modelo} </h6>\n <p class=\"card-text\">$${notebook.precio}</p>\n\n <!-- Button trigger modal -->\n <button\n id=\"btnMas${notebook.id}\"\n type=\"button\"\n class=\"btn btn-outline-primary mb-1\"\n data-bs-toggle=\"modal\"\n data-bs-target=\"#exampleModal${notebook.id}\"\n >\n Ver mas\n </button>\n\n <button id=\"btnCarrito${notebook.id}\" class=\"btn btn-outline-primary mb-1\">\n Carrito\n </button>\n </div>\n </div>\n\n <!-- Modal de caracteristicas del producto -->\n <div\n class=\"modal fade\"\n id=\"exampleModal${notebook.id}\"\n tabindex=\"-1\"\n aria-labelledby=\"exampleModalLabel\"\n aria-hidden=\"true\"\n >\n <div class=\"modal-dialog modal-dialog-centered\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h5 class=\"modal-title\" id=\"exampleModalLabel\">\n Caracteristicas:\n </h5>\n <button\n type=\"button\"\n class=\"btn-close\"\n data-bs-dismiss=\"modal\"\n aria-label=\"Close\"\n ></button>\n </div>\n\n <div class=\"modal-body row text-start\">\n <div class=\"col-md-6 col-12\">\n <ul>\n <li>Marca: ${notebook.marca}</li>\n <li>Modelo: ${notebook.modelo}</li>\n <li>Procesador: ${notebook.procesador}</li>\n <li>Pantalla: ${notebook.pulgadas}\"</li>\n <li>RAM: ${notebook.ram}GB</li>\n <li>SSD: ${notebook.rom}GB</li>\n <li>Placa de video: ${notebook.video}</li>\n <li>Precio: $${notebook.precio}</li>\n </ul>\n </div>\n\n <div class=\"col-md-6 col-12\">\n <div\n id=\"carouselExampleIndicators${notebook.id}\"\n class=\"carousel slide\"\n data-bs-ride=\"carousel\"\n >\n <div class=\"carousel-indicators\">\n <button\n type=\"button\"\n data-bs-target=\"#carouselExampleIndicators${notebook.id}\"\n data-bs-slide-to=\"0\"\n class=\"active\"\n aria-current=\"true\"\n aria-label=\"Slide 1\"\n ></button>\n <button\n type=\"button\"\n data-bs-target=\"#carouselExampleIndicators${notebook.id}\"\n data-bs-slide-to=\"1\"\n aria-label=\"Slide 2\"\n ></button>\n <button\n type=\"button\"\n data-bs-target=\"#carouselExampleIndicators${notebook.id}\"\n data-bs-slide-to=\"2\"\n aria-label=\"Slide 3\"\n ></button>\n </div>\n <div class=\"carousel-inner\">\n <div class=\"carousel-item active\">\n <img\n src=\"${notebook.img}\"\n class=\"d-block w-100\"\n alt=\"\"\n />\n </div>\n <div class=\"carousel-item\">\n <img\n src=\"${notebook.img}\"\n class=\"d-block w-100\"\n alt=\"\"\n />\n </div>\n <div class=\"carousel-item\">\n <img\n src=\"${notebook.img}\"\n class=\"d-block w-100\"\n alt=\"\"\n />\n </div>\n </div>\n <button\n class=\"carousel-control-prev\"\n type=\"button\"\n data-bs-target=\"#carouselExampleIndicators${notebook.id}\"\n data-bs-slide=\"prev\"\n >\n <span\n class=\"carousel-control-prev-icon\"\n aria-hidden=\"true\"\n ></span>\n <span class=\"visually-hidden\">Previous</span>\n </button>\n <button\n class=\"carousel-control-next\"\n type=\"button\"\n data-bs-target=\"#carouselExampleIndicators${notebook.id}\"\n data-bs-slide=\"next\"\n >\n <span\n class=\"carousel-control-next-icon\"\n aria-hidden=\"true\"\n ></span>\n <span class=\"visually-hidden\">Next</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </article>`);\n\n // para enviar notebooks al carrito\n $(`#btnCarrito${notebook.id}`).click(() => {\n carrito.push(new Producto(notebook, crearNumeroAleatorio()));\n\n console.log(carrito);\n\n agregarNumeroAlCarrito();\n\n guardarProductosLocalStorage();\n });\n\n leerCheckboxDarkLightMode();\n }\n}", "function processRecipe(body) {\n\t\tvar i;\n\t\tvar modal = document.getElementById('myModal');\n\t\t\n\t\tmodal.style.display = \"block\";\t\n\t\t\n\t\twindow.onclick = function(event) {\n\t\t\tif (event.target == modal) {\n\t\t\t\tmodal.style.display = \"none\";\n\t\t\t}\n\t\t}\n\t\n let recipeImage = body['images'][0].hostedLargeUrl;\n let imageNode = document.createElement(\"img\"); \n imageNode.src = recipeImage;\n\t\timageNode.setAttribute(\"id\", \"srcImg\");\n\t\t$('#selectedRecipe').empty();\n selectedRecipe.append(imageNode); \n selectedRecipe.append(\"<h4>\" + body['name'] + \"</h4>\");\n selectedRecipe.append(\"<p id='ing'> Ingredients: </p>\");\n\t\t\n\t\tfor (i = 0; i < body['ingredientLines'].length; i++) {\n\t\t\tselectedRecipe.append(\"<ul><li id='items'>\" + body['ingredientLines'][i] + \"</li></ul>\");\n\t\t}\n }", "function generateModal(speaker){\n const name = speaker.slice(1,speaker.length);\n const user = data.find(item => item.id === name.toLowerCase());\n\n const baseTemplate = `<div class=\"modal fade\" id=\"${name}\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"exampleModalLabel\" aria-hidden=\"true\">\n <div class=\"modal-dialog modal-lg\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-body\">\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n <div class=\"row\">\n <div class=\"col-lg-6 modal-left modal-content\">\n <div class=\"speaker-header row\">\n <div class=\"col-4 speaker-avatar\">\n <img src=\"${static_url}/images/${user.id}.jpg\" class=\"img-fluid rounded-circle\" />\n </div>\n <div class=\"col-8 speaker-info\">\n <h2 class=\"speaker-name\">${user.name}</h2>\n <h3 class=\"speaker-company\">${user.company}</h3>\n <h3 class=\"speaker-place\">${user.place}</h3>\n </div>\n </div>\n <p class=\"speaker-description\"> ${user.description} </p>\n <ul class=\"speaker-medias list-inline\">\n ${generateIcons(user.socials)}\n </ul>\n </div>\n <div class=\"col-lg-6 modal-right modal-portfolio\">\n <div class=\"row no-gutters\">\n <div class=\"col-12\">\n <img src=\"${static_url}/images/${user.id}/1.jpg\" class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"row no-gutters\">\n <div class=\"col-6\">\n <img src=\"${static_url}/images/${user.id}/2.jpg\" class=\"img-fluid\" />\n </div>\n <div class=\"col-6\">\n <img src=\"${static_url}/images/${user.id}/3.jpg\" class=\"img-fluid\" />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>`;\n let e = document.createElement('div');\n e.innerHTML = baseTemplate;\n let speakerModal = document.querySelector('#speaker-modal');\n speakerModal.appendChild(e);\n}", "function addZHierarchy() {\n var modalScope = $rootScope.$new();\n // passing parameter into modal view\n modalScope.isModal = true;\n modalScope.modalInstance = $modal.open({\n templateUrl: '/app/features/zHierarchy/zHierarchyItem.html',\n controller: 'zHierarchyItemController as vm',\n size: 'lg',\n scope: modalScope, // <- This is it!\n //resolve: {\n // isModal: true\n //}\n });\n\n modalScope.modalInstance.result.then(function (newZHierarchy) {\n\n if (newZHierarchy) {\n vm.zHierarchys.push(newZHierarchy);\n vm.selectedZHierarchy = vm.zHierarchys[vm.zHierarchys.length - 1].zHierarchyID;\n vm.allDataType.zHierarchyID = vm.selectedZHierarchy;\n vm.isSaving = false;\n vm.hasChanges = true;\n }\n\n }, function () {\n //$log.info('Modal dismissed at: ' + new Date());\n });\n\n }", "function showCustomGreeting() {\n $mdDialog.show({\n clickOutsideToClose: true,\n scope: $scope, // use parent scope in template\n preserveScope: true, // do not forget this if use parent scope\n // Since GreetingController is instantiated with ControllerAs syntax\n // AND we are passing the parent '$scope' to the dialog, we MUST\n // use 'vm.<xxx>' in the template markup\n template: '<md-dialog layout-padding flex=\"95\">'+\n ' <md-dialog-content>'+\n ' <div>'+\n ' <h4>Booking {{bookingResource}}</h4>'+\n ' </div>'+\n ' <div layout=\"row\">'+\n ' <span flex=\"20\">{{ weekDates[bookingDayId] }} {{ bookingData.slots[bookingSlotId].name }}</span>'+\n ' <md-button ng-click=\"showNewQueue()\" class=\"md-raised\">Queue</md-button>'+\n ' </div>'+\n ' <div data-ng-repeat=\"t in bookingData.unitTypes\" layout=\"row\">'+\n ' <span class=\"showMachineAvailable\" flex=\"20\">{{ t.name }}</span>'+\n ' <span data-ng-repeat=\"u in t.units\">'+\n ' <span ng-show=\"isBookable(t, u)\">'+\n ' <md-checkbox ng-model=\"bookingEdit.type[t.typeId][u.unitId]\">{{ u.name }}</md-checkbox>'+\n ' </span>'+\n ' </span>'+\n ' </div>'+\n ' <div layout=\"row\">'+\n ' <span class=\"sendReminderVia\" flex=\"20\">Send reminder via</span>'+\n ' <md-checkbox ng-model=\"bookingEdit.medium[1]\">email</md-checkbox>'+\n ' <md-checkbox ng-model=\"bookingEdit.medium[2]\">sms</md-checkbox>'+\n ' </div>'+\n ' <div>'+\n ' <md-checkbox ng-model=\"bookingEdit.time[4]\">10 min</md-checkbox>'+\n ' <md-checkbox ng-model=\"bookingEdit.time[8]\">30 min</md-checkbox>'+\n ' <md-checkbox ng-model=\"bookingEdit.time[16]\">1 hour</md-checkbox>'+\n ' <md-checkbox ng-model=\"bookingEdit.time[64]\">5 hours</md-checkbox>'+\n ' <md-checkbox ng-model=\"bookingEdit.time[256]\">1 day</md-checkbox>'+\n ' <md-checkbox ng-model=\"bookingEdit.time[2048]\">1 week</md-checkbox>'+\n ' BEFORE BOOKING DATE'+\n ' </div>'+\n ' <div>'+\n ' <md-button ng-click=\"setBooking()\" class=\"md-raised md-primary\">Confirm booking</md-button>'+\n ' <md-button ng-click=\"clearBooking()\" class=\"md-warn\">Delete</md-button>'+\n ' </div>'+\n ' </md-dialog-content>'+\n '</md-dialog>',\n controller: function DialogController($scope, $mdDialog) {\n $scope.closeDialog = function() {\n $mdDialog.hide();\n }\n }\n });\n }", "function Modal(employees){\n this.employees = [];\n this.modalHTML;\n}", "function showAddItemModal(worklist) {\n var modalInstance = $modal.open({\n templateUrl: 'app/worklists/template/additem.html',\n controller: 'WorklistAddItemController',\n resolve: {\n worklist: function() {\n return worklist;\n },\n valid: function() {\n var board = $scope.board;\n return function(item) {\n var valid = true;\n angular.forEach(board.worklists, function(list) {\n angular.forEach(list.items, function(listItem) {\n var type = item.type.toLowerCase();\n if (item.value === listItem.id &&\n type === listItem.type) {\n valid = false;\n }\n });\n });\n return valid;\n };\n }\n }\n });\n\n return modalInstance.result;\n }", "function InitSaveModal() {\n let content = \"\";\n\n for(let item of currentAnniversary){\n if(item.date == dateChoice) content += \"<i class='fa fa-user-circle-o' aria-hidden='true'></i> \"+item.name+\" </br>\"; \n }\n\n if(content === \"\") content = \"<h6 class='card-title'> <i class='fa fa-exclamation-triangle fa' aria-hidden='true'></i> Aucun anniversaire trouvé </h6>\";\n else $('#pills-data-tab').tab('show');\n \n $( \"#pills-data\").append(content);\n}", "function _showModal(ev) {\n let annoData = newAnnotationService.defusekify(model.edit, true);\n let fragment = annoData.fragment;\n let subject = annoData.subject;\n\n model.docUrl = annoData.url;\n\n // Configura il modale e poi mostralo\n $mdDialog.show({\n controller: DialogController,\n controllerAs: 'dialog',\n //Deps, part.1\n bindToController: {\n fragment: fragment,\n subject: subject,\n annoData: annoData\n }, //Deps\n templateUrl: 'js/modules/editAnnotation/editAnnotationModal.tmpl.html',\n parent: angular.element(document.body),\n fullscreen: true,\n targetEvent: ev,\n //Deps, part.2\n fragment: fragment,\n subject: subject,\n annoData: annoData,\n //Deps\n userService: userService,\n clickOutsideToClose: true\n })\n .then(function(answer) {\n model.status = 'You said the information was \"' + answer + '\".';\n }, function() {\n model.status = 'You cancelled the dialog.';\n });\n }", "function renderModalSearchRecipe (recipes) {\n\n globalRecipe = []\n\n let edamamApiRecipe = {\n\n name: recipes.hits[0].recipe.label,\n\n calories: recipes.hits[0].recipe.calories,\n\n healthLabels: recipes.hits[0].recipe.healthLabels,\n\n source: recipes.hits[0].recipe.source,\n\n sourceUrl: recipes.hits[0].recipe.url,\n\n imgUrl: recipes.hits[0].recipe.image,\n\n ingredients: recipes.hits[0].recipe.ingredientLines,\n\n yield: recipes.hits[0].recipe.yield\n\n }\n\n globalRecipe.unshift(edamamApiRecipe)\n\n let ingredientsFormattedList = renderIngredient(edamamApiRecipe.ingredients)\n\n let preDbRecipeModal = (`\n\n <div class='modal modal-transparent fade tempModal' tabindex='-1' role='dialog' id='recipeModal'>\n\n <div class='modal-dialog'>\n\n <div class='recipe' data-recipe-id=''>\n\n <div class='col-md-12 recipeBox'>\n\n <div class='col-md-5 thumbnail'>\n\n <img src='${edamamApiRecipe.imgUrl}' alt='recipe image'>\n\n </div>\n\n <div class='col-md-6 caption'>\n\n <h4 class='inline-header'><strong>${edamamApiRecipe.name}</strong></h4>\n\n <p>via<a href='${edamamApiRecipe.sourceUrl}'> ${edamamApiRecipe.source}</a></p>\n\n <h4 class='inline-header'><strong>Ingredients:</strong></h4>\n\n <ul>${ingredientsFormattedList}</ul>\n\n <h4 class='inline-header'><strong>Yield:</strong></h4>\n\n <ul>${edamamApiRecipe.yield}</ul>\n\n <div class='bottom-align-buttons'>\n\n <button type='button' class='btn btn-primary add-recipe'><span class='icon'><i class='fa fa-plus'></i></span> Add This Recipe</button>\n\n <button type='button' class='btn btn-danger close-recipe'><span class='icon'><i class='fa fa-trash-o'></i></span> Not This Recipe</button>\n\n </div>\n\n </div>\n\n </div>\n\n </div>\n\n </div>\n\n </div>\n\n `)\n\n $('#modals').prepend(preDbRecipeModal)\n\n $('#recipeModal').modal('show')\n\n}", "function addModalRows(dataArr) {\n $.each(dataArr, function(idx, elem) {\n $('#submit-results tbody').append('<tr><td>'+elem.serial_num+'</td>'+\n '<td>'+elem.item_type+'</td></tr>');\n });\n }", "function addAnotherRowMatrixPopup(new_rows) {\r\n\tif (new_rows == null) new_rows = 1;\r\n\tvar originalRow = $('.addFieldMatrixRow:first').html();\r\n\tvar html = \"\";\r\n\tfor (var k = 1; k <= new_rows; k++) {\r\n\t\thtml += \"<tr class='addFieldMatrixRow'>\"+originalRow+\"</tr>\";\r\n\t}\r\n\t// Add row to dialog\r\n\t$('.addFieldMatrixRowParent').append(html);\r\n\t// Reset dialog height (if needed)\r\n\tfitDialog($('#addMatrixPopup'));\r\n}", "function cargarmodal_descripcion_lineas_sublineas(elemento){\n var $fila = $(elemento);\n var desc= $fila.attr(\"data-infodescripcionsublinea\"); \n $('#descripcion-sublinea').html(desc);\n\n\n var estado= $fila.attr(\"data-infoestado\"); \n $('#estado-sublinea').html(estado);\n\n\n var nombre= $fila.attr(\"data-infonombre\"); \n $('#myModalLabel').html(nombre);\n \n}", "function createModal(users) {\r\n\tconst modalContainer = document.getElementsByClassName(`modal-container`)[0];\r\n\tusers.forEach((user, i) => {\r\n\t\tconst div = document.createElement(`div`);\r\n\t\tconst html = modalHTML(user);\r\n\t\tdiv.className = `modal`;\r\n\t\tdiv.innerHTML += html;\r\n\t\tmodalContainer.appendChild(div);\r\n\t\tnextPrevButtonHandlers(users, i);\r\n\t});\r\n}", "function okPressed() {\n vm.specimens.push(createSpecimen());\n $uibModalInstance.close(vm.specimens);\n }", "function cloneProjectModal() {\n var modalInstance = $uibModal.open({\n animation: true,\n templateUrl: 'js/app/views/modules/create-project-modal.html',\n size: 'sm',\n controller: function (choosedProject, $scope, $uibModalInstance) {\n console.log(\"Choosed\", choosedProject);\n // deleção de dados\n $scope.temporalFilterProject = angular.copy(choosedProject);\n delete $scope.temporalFilterProject.biome_name;\n delete $scope.temporalFilterProject.modified;\n delete $scope.temporalFilterProject.created;\n $scope.temporalFilterProject.project_name = $scope.temporalFilterProject.project_name + ' - Copy';\n $scope.temporalFilterProject.active = false;\n\n \n // open modal\n $scope.ok = function (temporalFilterProject) {\n TemporalFilterProjectService.clone(temporalFilterProject, function (result) { \n // adiciona a lista de opções de projeto\n vm.temporalFilterProjectOptions.unshift(result);\n // após criado ele será selecionado\n vm.tfProjectChoosed = result.TemporalFilterProject;\n // redefine a paginação ao deletar elemento\n //\n $uibModalInstance.close(result);\n })\n };\n // close modal\n $scope.cancel = function () {\n $uibModalInstance.close(false);\n };\n },\n resolve: {\n choosedProject: function () {\n return vm.tfProjectChoosed;\n },\n }\n });\n\n modalInstance.result.then(function (result) {\n /**\n * true: created\n * false: canceled\n */\n if (result) {\n Notify.success(\"Project copy successfuly created!\");\n chooseTFProject(result.TemporalFilterProject);\n }\n })\n }", "function showModalComments() {\n let template = $('#commentsTemplates');\n let pjtId = $('.version_current').attr('data-project');\n\n $('.invoice__modalBackgound').fadeIn('slow');\n $('.invoice__modal-general').slideDown('slow').css({ 'z-index': 401 });\n $('.invoice__modal-general .modal__body').append(template.html());\n $('.invoice__modal-general .modal__header-concept').html('Comentarios');\n closeModals();\n fillComments(pjtId);\n}", "function insertModalMovies(div) {\n for (let i = 0; i < movies.length; i++) {\n const modalMoviesSection = `\n <img\n src=\"${movies[i].imageSource}\"\n alt=\"${movies[i].alt}\">\n <div class=\"carousel-caption d-md-block\">\n <p>${moviesCaption[i].caption}</p>\n </div>\n `;\n\n div[i].insertAdjacentHTML('beforeend', modalMoviesSection);\n\n\n }\n}", "function showModal() {\n\n $('#myModal').modal(\"show\");\n $(\".modal-title\") .text(data.name)\n $(\".modal-li-1\") .text(\"Accuracy: \" + data.accuracy)\n $(\".modal-li-2\").text(\"PP: \" + data.pp)\n $(\".modal-li-3\").text(\"Power: \" + data.power)\n $(\".modal-li-4\").text(\"Type: \" + data.type.name)\n $(\".modal-li-5\").text(\"Priority: \" + data.priority)\n \n }", "function openModal(type) {\n\t$('#modal').modal('show');\n\tvar arr = [\n\t{\n \t\tname : 'L',\n \t\tattributes: \"<p>Lions are the only cats that live in groups. A group, or pride, can be up to 30 lions, depending on how much food and water is available. Female lions are the main hunters. While they’re out looking for food, the males guard the pride’s territory and their young. </p>\"\n\t\n\t},\n\t{\n \t\tname : 'E',\n \t\tattributes: \"<p>Elephants belong to the mammal family, which means that they have hair, give birth to live young, and feed their babies milk. They have large, thin ears that are used to help cool them down, and have long, powerful trunks. </p>\"\n\t},\n\t{\n \t\tname : 'F',\n \t\tattributes: \"<p>Frogs are amphibians. They can be found near water but prefer ponds, lakes, and marshes. You will not find any in Antarctica. They lay eggs called Frog Spawn. Their eggs hatch into tadpoles. A group of frogs is called an army. </p>\"\n\t},\n\t{\n \t\tname : 'B',\n \t\tattributes: \"<p>Koalas are not bears. The dawn bear was the first bear. In the north, bears sleep in the winter, but they don't hibernate. Bears are related to walruses, seals and sea lions. Bears can see color. Not all mammals can. Giant Panda are classified as a bear. </p>\"\n\t},\n\t{\n \t\tname : 'M',\n\t\tattributes: \"<p>There are currently 264 known monkey species. Monkeys can be divided into two groups, Old World monkeys that live in Africa and Asia, and New World monkeys that live in South America. A baboon is an example of an Old World monkey, while a marmoset is an example of a New World monkey. </p>\"\n\t},\n\n\t{\n \t\tname : 'H',\n \t\tattributes: \"<p>Hippo's Cannot Swim. Shocking! They Have Incredibly Sensitive Skin. They Cannot Breathe Underwater. Hippos Are Territorial – But Only In Water. They Are Not Big Eaters. Hippos Have A British Connection. </p>\"\n\t},\n\t]; \n\n \n// This code ensures that any data is removed and variables are empty, after a selection has been made.\n\n\tvar obj = arr.find(function(data) {\n\t\treturn data.name === type;\n\t});\n\t$('#inputData').html('');\n\t$('#inputData').html(obj.attributes);\n \n}", "function myPopupFunction(data,idtodelete) {\n // var popupid=\"myPopup\"+idtodelete;\n // var popup = document.getElementById(popupid);\n //popup.innerHTML = data;\n // $(document.getElementById(\"myModal2text\")).= \"fAILURE sORRY\";\n\n // $(\"myModal2text\").append$(\"Very Bad\");\n\n //$(document.getElementById(\"myModal2\")).click(function () { });\n //$(document.getElementById(\"myModal2text\")).html=\n var x = document.getElementById(\"myModal2text\");\n var displaytext = data.Status + \"!<br>\" + data.ExceptionDetails+\"\";\n x.innerHTML =displaytext;\n $('#myModal2').modal();\n}", "function showModal(i) {\n const body = document.querySelector(\"body\");\n\n const modal = `\n<div class=\"modal-container\">\n <div class=\"modal\">\n\n <button type=\"button\" id=\"modal-close-btn\" class=\"modal-close-btn\"><strong>X</strong></button>\n <div class=\"modal-info-container\">\n <img class=\"modal-img\" src=${\n employeeList[i].picture.large\n } alt=\"profile picture\">\n <h3 id=\"name\" class=\"modal-name cap\">${\n employeeList[i].name.first\n } ${employeeList[i].name.last}</h3>\n <p class=\"modal-text\">${employeeList[i].email}</p>\n <p class=\"modal-text cap\">${\n employeeList[i].location.city\n }</p>\n <hr>\n <p class=\"modal-text\">${formatPhoneNumber(\n employeeList[i].cell\n )}</p>\n \n <p class=\"modal-text\">${\n employeeList[i].location.street.number\n } ${employeeList[i].location.street.name} ${\n employeeList[i].location.state\n }, ${employeeList[i].location.country} ${\n employeeList[i].location.postcode\n }</p>\n <p class=\"modal-text\">${employeeList[i].dob.date.slice(\n 5,\n 7\n )}/${employeeList[i].dob.date.slice(\n 8,\n 10\n )}/${employeeList[i].dob.date.slice(2, 4)} </p>\n </div>\n </div>`;\n body.insertAdjacentHTML(\"afterbegin\", modal);\n modalRemove();\n}", "function showModal(item) {\n //create element for dog name\n var subBreedElement = $('.subbreeds');\n var imageElement = $('.dog-img');\n imageElement.attr('src', item.imageURL);\n if (item.subBreeds.length === 0) {\n var Element = $('<p>No sub-breeds</p>');\n subBreedElement.append(Element)\n } else {\n for (var i = 0; i < item.subBreeds.length; i++) {\n var element = $(`<li>${item.subBreeds[i]}</li>`);\n subBreedElement.append(element)\n\n }\n }\n $modalContainer.addClass('is-visible');\n}", "function openModal(i) {\n modal.style.display = 'block';\n pageBody.style.overflow = 'hidden';\n wrapper.className = 'modal-wrapper' + ' ' + injectableContent[i].className;\n wrapper.innerHTML = injectableContent[i].innerHTML;\n style = window.getComputedStyle(injectableContent[i]);\n modalColor = style.getPropertyValue('color');\n wrapper.style.color = modalColor;\n}", "function displayList(arr) {\n\tvar i;\n\tvar out = '';\n\t\n\tfor (i = 0; i < arr.length; i++) {\n\t\tout += \n\t\t'<div class=\"activity-item container\">' + \n\t\t\t'<div ng-app=\"croppy\"><img src=\"' + arr[i].image + '\" width=\"70\" height=\"70\" alt=\"thumbnail\"></div>' + \n\t\t\t'<h2>' + arr[i].name + '</h2>' + \n\t\t\t'<em>' + arr[i].date + '</em>' + \n\t\t\t'<a href=\"#\" onclick=\"toggle(\\'' + arr[i].id + '\\')\" class=\"activity-item-toggle\" style=\"font-size:18px;\">+</a>' + \n\t\t\t'<div id=\"selected' + arr[i].id + '\" class=\"activity-item-detail\">' + \n\t\t\t\t'<table style=\"width:100%\">' + \n\t\t\t\t\t'<tr>' + \n\t\t\t\t\t\t'<td><a href=\"#\" onclick=\"viewImage(\\'' + arr[i].image + '\\')\"><i class=\"fa fa-picture-o\"></i> View image</a></td>' + \n\t\t\t\t\t\t'<td><a href=\"#\" onclick=\"sync(\\'' + arr[i].id + '\\')\"><i class=\"fa fa-refresh\"></i> Sync</a></td>' + \n\t\t\t\t\t'</tr>' + \n\t\t\t\t\t'<tr>' + \n\t\t\t\t\t\t'<td><a href=\"#\" onclick=\"drawing(\\'' + arr[i].image + '\\', \\'' + arr[i].id + '\\')\"><i class=\"fa fa-pencil\"></i> Create drawing</a></td>' + \n\t\t\t\t\t\t'<td><a href=\"#\" onclick=\"removePatient(\\'' + arr[i].id + '\\')\"><i class=\"fa fa-trash\"></i> Delete</a></td>' + \n\t\t\t\t\t'</tr>' +\n\t\t\t\t\t'<tr>' + \n\t\t\t\t\t\t'<td><a href=\"#\" onclick=\"drawingsScores(\\'' + arr[i].id + '\\')\"><i class=\"fa fa-bar-chart\"></i> View drawings and scores</a></td>' + \n\t\t\t\t\t\t'<td><a href=\"#\"><i class=\"fa fa-times\"></i> Close</a></td>' + \n\t\t\t\t\t'</tr>' + \n\t\t\t\t'</table>' + \n\t\t\t'</div>' + \n\t\t'</div>' + \n\t\t'<div class=\"border\"></div>';\n\t}\n\t\n\tdocument.getElementById(\"list\").innerHTML = out;\n}", "function _openGenericModal(configs) {\n var deferred = $q.defer();\n var editorInstance = $modal.open({\n animation: true,\n windowClass: configs.windowClass || 'modal-fullwindow',\n templateUrl: configs.templateUrl,\n controller: configs.controller\n });\n editorInstance.result.then(function (bundle) {\n deferred.resolve(bundle);\n });\n return deferred.promise;\n }", "function ModifyAssignment($q, $rootScope, $ionicModal, Assignment, Class) {\n var $scope = $rootScope.$new(),\n templateUrl = 'templates/insert-assignment.html',\n animation = 'slide-in-up';\n \n $scope.isEditing = function () {\n return $scope.assignment && $scope.assignment.editing;\n };\n \n $scope.submit = function (assignment) {\n var promise = $scope.isEditing() ? assignment.save() : Assignment.insert(assignment);\n \n promise.then(function () {\n $scope.close();\n }, function (e) {\n alert(e.message);\n });\n };\n \n this.modals = {\n edit: function (assignment) {\n return open(null, assignment);\n },\n insert: function (klass) {\n return open(klass);\n }\n };\n \n function open(klass, assignment) {\n return $q(function (resolve, reject) {\n return $ionicModal.fromTemplateUrl(templateUrl, { \n scope: $scope,\n animation: animation,\n backdropClickToClose: false\n }).then(function (modal) {\n if (assignment) {\n $scope.assignment = assignment.edit();\n } else {\n $scope.assignment = {};\n if (klass) $scope.assignment.classId = klass.id;\n }\n \n Class.get().then(function (classes) {\n $scope.classes = classes;\n });\n \n $scope.modal = modal;\n $scope.klass = klass;\n \n $scope.close = function () {\n $scope.modal.remove();\n $scope.modal = null;\n $scope.klass = undefined;\n $scope.classes = undefined;\n $scope.assignment = undefined;\n resolve();\n };\n \n modal.show();\n });\n });\n \n }\n}", "function MandaMessaggioInserimento(testo) {\n jQuery(\"#testo-modal\").html(testo);\n jQuery(\"#modal-accettazione\").modal(\"toggle\");\n}" ]
[ "0.6062488", "0.5832763", "0.58152795", "0.581073", "0.5782862", "0.5757095", "0.57422274", "0.57078576", "0.5661147", "0.562069", "0.55974466", "0.5585795", "0.5466677", "0.54657984", "0.5456743", "0.5446964", "0.5442606", "0.54391044", "0.5437678", "0.54154956", "0.5408793", "0.5397562", "0.5385405", "0.53823996", "0.5381772", "0.53616863", "0.535937", "0.5335891", "0.5321847", "0.53199714", "0.5317118", "0.5313082", "0.52960753", "0.5292007", "0.5280747", "0.5278823", "0.5270068", "0.52691746", "0.5267086", "0.52664465", "0.5252264", "0.52469575", "0.52463865", "0.52455837", "0.5244518", "0.5233512", "0.5231464", "0.52240616", "0.52213824", "0.5221304", "0.5218678", "0.52149606", "0.52057004", "0.5202956", "0.5172452", "0.5171098", "0.51699007", "0.5156628", "0.51512307", "0.51495534", "0.51407254", "0.5134292", "0.5130354", "0.51197267", "0.5109264", "0.5108018", "0.5099061", "0.50987804", "0.509707", "0.5093416", "0.5090688", "0.5089804", "0.5088652", "0.5083357", "0.50742537", "0.5074001", "0.5060736", "0.5060035", "0.5059409", "0.5054649", "0.50536233", "0.5048697", "0.50466543", "0.5043825", "0.5031425", "0.5024482", "0.50214225", "0.502007", "0.5018967", "0.5012572", "0.5007089", "0.5006746", "0.50036746", "0.50029606", "0.50001067", "0.49972928", "0.49957526", "0.49915487", "0.4991489", "0.49875382", "0.49872217" ]
0.0
-1
For some reason using ngrepeat in the modal dialog doesn't work so lets just create the HTML in code :)
function createHeaderHtml(message) { var headers = createHeaders(message); var properties = createProperties(message); var headerKeys = _.keys(headers); function sort(a, b) { if (a > b) return 1; if (a < b) return -1; return 0; } var propertiesKeys = _.keys(properties).sort(sort); var jmsHeaders = _.filter(headerKeys, function (key) { return _.startsWith(key, "JMS"); }).sort(sort); var remaining = _.difference(headerKeys, jmsHeaders.concat(propertiesKeys)).sort(sort); var buffer = []; function appendHeader(key) { var value = headers[key]; if (value === null) { value = ''; } buffer.push('<tr><td class="propertyName"><span class="green">Header</span> - ' + key + '</td><td class="property-value">' + value + '</td></tr>'); } function appendProperty(key) { var value = properties[key]; if (value === null) { value = ''; } buffer.push('<tr><td class="propertyName">' + key + '</td><td class="property-value">' + value + '</td></tr>'); } jmsHeaders.forEach(appendHeader); remaining.forEach(appendHeader); propertiesKeys.forEach(appendProperty); return buffer.join("\n"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ShowRecipeModalDialog(recipe) {\n\n // Get list of recipe ingredients\n var params = { recipeId: recipe.Id };\n $http.post(\"/Flavor/GetIngredients\", params).success(function(data) {\n\n var ingredients = data;\n\n var modalInstance = $modal.open({\n templateUrl: 'app/views/viewRecipe.html',\n controller: 'viewRecipeController',\n resolve: {\n recipeObject: function() {\n return recipe;\n },\n\n recipeIngredients: function() {\n return ingredients;\n }\n }\n });\n\n modalInstance.result.then(function () {\n \n });\n });\n}", "function templatepop(divises, infRequest, idPr, listBkByLocs, listDocs, listPr, template, menu, bool, bdetail, isOffer, isOffertrue, validation_Offer) {\n var modalInstance = $modal.open({\n templateUrl: template,\n controller: 'popUpadminEn',\n resolve: {\n devises: function() {\n return divises;\n },\n infRequest: function() {\n return infRequest;\n },\n idPr: function() {\n return idPr;\n },\n listBkByLocs: function() {\n return listBkByLocs;\n },\n listDocs: function() {\n return listDocs;\n },\n listPr: function() {\n return listPr;\n },\n template: function() {\n return template;\n },\n menu: function() {\n return menu;\n },\n bool: function() {\n return bool;\n },\n bdetail: function() {\n return bdetail;\n },\n isOffer: function() {\n return isOffer;\n },\n isOffertrue: function() {\n return isOffertrue;\n },\n validation_Offer: function() {\n return validation_Offer;\n }\n }\n });\n modalInstance.result.then(function(selectedItem) {\n $scope.selected = selectedItem;\n }, function() {\n $log.info('Modal dismissed at: ' + new Date());\n });\n }", "function paintPatternsInModal() {\n // Delete previous printed data\n $(\"#patternsModal > div > div > div.modal-body\").empty();\n\n for (let i = 0; i < NETWORK.trainingPatterns.length; i++) {\n let pattern = NETWORK.trainingPatterns[i];\n\n let columns = (new Array(parseInt($(\"#width\").val()))).fill(\"1fr\").join(\" \");\n let rows = (new Array(parseInt($(\"#height\").val()))).fill(\"1fr\").join(\" \");\n let elements = pattern.data[0].map(function(item, index) {\n return `<div id=\"modal${i}${index}\" style=\"background-color: ${item == 1 ? \"white\" : \"black\"};\"></div>`\n })\n\n\n $(\"#patternsModal > div > div > div.modal-body\").append(`<div class=\"grid\" style=\"grid-template-columns: ${columns}; grid-template-rows: ${rows}\">${elements.join(\"\")}</div>`);\n }\n}", "function init_view_table_list_dialog(row_id){\n\n //Open dialog\n $('#myModal').modal({\n keyboard: false\n });\n\n $('.modal-dialog').css(\"width\",\"60%\");\n //Dialog title\n $(\".modal-title\").html('<img src=\"img/icons/table.png\" width=\"50\"> View Table')\n \n load_view_table_list(row_id);\n\n}", "function generateModal(i)\n{\n let temp = people[i];\n let dob = `${temp.dob.date.substring(5, 7)}/${temp.dob.date.substring(8, 10)}/${temp.dob.date.substring(0, 4)}`;\n const modalHTML = `\n <div class=\"modal-container\">\n <div class=\"modal\">\n <button type=\"button\" id=\"modal-close-btn\" class=\"modal-close-btn\"><strong>X</strong></button>\n <div class=\"modal-info-container\">\n <img class=\"modal-img\" src=${temp.picture.large} alt=\"profile picture\">\n <h3 id=\"name\" class=\"modal-name cap\">${temp.name.first} ${temp.name.last}</h3>\n <p class=\"modal-text\">${temp.email}</p>\n <p class=\"modal-text cap\">${temp.location.city}</p>\n <hr>\n <p class=\"modal-text\">${temp.cell}</p>\n <p class=\"modal-text\">${temp.location.street.number} ${temp.location.street.name}, ${temp.location.state} ${temp.location.postcode}</p>\n <p class=\"modal-text\">Birthday: ${dob}</p>\n </div>\n </div>\n </div>\n `;\n $body.append(modalHTML);\n}", "function modalPopup() {\n return $scope.modalInstance = $uibModal.open({\n templateUrl: 'donModal1.html',\n scope: $scope\n });\n }", "function ngModalLoad(){\n // first clear the selection list\n let game_select = document.getElementById('games-select')\n let game_region_select = document.getElementById('game-region-select')\n while(game_select.firstChild){\n game_select.removeChild(game_select.firstChild)\n }\n while(game_region_select.firstChild){\n game_region_select.removeChild(game_region_select.firstChild)\n }\n // Then append to them\n for(id in games){\n let opt = document.createElement('option')\n opt.value = id\n opt.innerHTML = games[id]\n game_select.appendChild(opt)\n }\n for(region in regions){\n let opt = document.createElement('option')\n opt.value = region\n opt.innerHTML = regions[region]\n game_region_select.appendChild(opt)\n }\n // Then clear the text inputs\n document.getElementById('save-folders').value = ''\n document.getElementById('save-files').value = ''\n}", "function openModal(size){\r\n\t\t\t\t\t //var modalContent= 'myModalContent.html';\r\n\t\t\t\t var modalContent= '/StMartin/root/view/dialog/insertUpdatePeopleDialog.html';\r\n\t\t\t\t\t if(type == \"delete\"){\r\n\t\t\t\t\t \tmodalContent= 'myModalContentDelete.html';\r\n\t\t\t\t\t }\r\n\t\t\t\t\t\tvar modalOpen= $modal.open({\r\n\t\t\t\t\t templateUrl: modalContent,\r\n\t\t\t\t\t controller: peopleDialogController,\r\n\t\t\t\t\t windowClass: 'app-modal-window',\r\n\t\t\t\t\t size: size,\r\n\t\t\t\t\t resolve: {\r\n\t\t\t\t\t \r\n\t\t\t\t\t items: function () {\r\n\t\t\t\t\t \t setFlags();\r\n\t\t\t\t\t \t \r\n\t\t\t\t\t \t if(type == \"insert\" || type == \"modify\"){\r\n\t\t\t\t\t \t\t var peopleData=null;\r\n\t\t\t\t\t \t\t var dateOfBirthPerson=null;\r\n\t\t\t\t\t \t\t if(type == \"insert\"){\r\n\t\t\t\t\t \t\t\t $(\"#personId\").attr(\"value\", null);\r\n\t\t\t\t\t\t\t \t\t\t\t$(\"#firstNameId\").attr(\"value\", null);\r\n\t\t\t\t\t\t\t \t\t\t\t$(\"#lastNameId\").attr(\"value\", null);\r\n\t\t\t\t\t\t\t \t\t\t\t$(\"#cityId\").attr(\"value\", null);\r\n\t\t\t\t\t\t\t \t\t\t\t$(\"#dateOfBirth\").attr(\"value\", null); \r\n\t\t\t\t\t \t\t }\r\n\t\t\t\t\t \t\t else{\r\n\t\t\t\t\t \t\t\t $(\"#personId\").attr(\"value\",$scope.mySelections[0].personId);\t\r\n\t\t\t\t\t\t\t\t if($scope.mySelections[0].personState==='A'){\r\n\t\t\t\t\t\t\t\t \t$scope.personState = 'ACTIVE';\r\n\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t peopleData=$scope.mySelections[0];\r\n\t\t\t\t\t\t\t\t dateOfBirthPerson=$scope.mySelections[0].dateOfBirth;\r\n\t\t\t\t\t \t\t }\t\t \t\t\t\t \r\n\t\t\t\t\t \t\t\t\t var array = {\"people\": peopleData, \"cities\": $scope.citiesList, \"zones\":$scope.zoneCodes,\"parishes\":$scope.parishes, \"supportGroups\":$scope.supportGroups, \"personState\": $scope.personStateNames,\r\n\t\t\t\t\t \t\t\t\t\t\t \"date\":dateOfBirthPerson, \"volunteerTypeList\":$scope.volunteerTypeList,\"isVolunteer\": $scope.isVolunteer, \r\n\t\t\t\t\t \t\t\t\t\t\t \"isBeneficiary\": $scope.isBeneficiary,\"isBeneficiaryNotCPPR\": $scope.isBeneficiaryNotCPPR,\"isVolunteerNotCPPR\": $scope.isVolunteerNotCPPR, \"isCPPR\": $scope.isCPPR,\"isCPPRBeneficiary\": $scope.isCPPRBeneficiary,\r\n\t\t\t\t\t \t\t\t\t\t\t \"majorTrainingList\": $scope.majorTrainingList, \"isCPHA\":$scope.isCPHA, \"isCPHAOrphan\":$scope.isCPHAOrphan, \"isCPHAPlwhiv\":$scope.isCPHAPlwhiv, \"isCPHARecoveree\":$scope.isCPHARecoveree, \"isCPPD\":$scope.isCPPD};\r\n\t\t\t\t\t \t\t\t\t return array;\r\n\t\t\t\t\t \t\t\t\t\r\n\t\t\t\t\t \t }\r\n\t\t\t\t\t \t else{\r\n\t\t\t\t\t \t\t $scope.mySelections[0].endDate=new Date();\r\n\t\t\t\t\t \t\t $(\"#personId\").attr(\"value\",$scope.mySelections[0].personId);\r\n\t\t\t\t\t \t\t return {\"people\": $scope.mySelections[0]};\t\t\t\t\t \t\t \r\n\t\t\t\t\t \t }\t \r\n\t\t\t\t\t }\r\n\t\t\t\t\t }\r\n\t\t\t\t\t });\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\tmodalOpen.result.then(function (selectedItem) {\r\n\t\t\t\t\t\t $scope.selected = selectedItem;\r\n\t\t\t\t\t\t }, function () {\r\n\t\t\t\t\t\t // $log.info('Modal dismissed at: ' + new Date());\r\n\t\t\t\t\t\t \tcommonMethodFactory.getPeopleList($scope.projectPerson).then(function(object) {\r\n\t\t\t\t\t \t\t\t$scope.personData = object.data;\r\n\t\t\t\t\t \t\t\tcommonFactory.peopleData=$scope.personData;\r\n\t\t\t\t\t \t\t});\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t}", "function createModalHTML(data){ \n data.forEach(function(note){\n $(\".existing-note\").append(`\n <div class=\"panel panel-default\" id=\"${note._id}\">\n <div class=\"panel-body\">\n <div class=\"noteContent\">\n <p>${note.body}</p>\n <button class=\"btn btn-primary edit-note\" data-noteId=\"${note._id}\"\">Edit</button>\n <button class=\"btn btn-primary delete-note\" data-noteId=\"${note._id}\">Delete</button>\n </div>\n <div class=\"update-form\"></div>\n </div>\n </div>\n `)\n }); \n}", "function TimelineModalCtrl($scope, $modalInstance, projectId, protitle, $modal){\n\t$scope.title = protitle;\n\t$scope.predicate = 'maxv';\n\t$scope.timeline = {};\n\t$scope.max_max = 0;\n\tvar foreachcall = projectId.forEach(function(obj){\n\t\tvar x = time(obj);\n\t\t$scope.timeline[obj.title] = {'title':obj.title,'values':x.current, 'maxv':x.max,'id':obj.id,'status':obj.late_status,'customer':obj.customer.name}\n\t\tif($scope.max_max < x.max){\n\t\t\t$scope.max_max = x.max+5;\n\t\t}\n\t});\n\t$scope.task = function(projectd,ptitle,pstatus){\n\t\tmodal('4','taskCtrl',projectd,{'title':ptitle,'status':pstatus},$modal,'small');\n\t}\n\t$scope.order = function(pr){\n\t\tconsole.log(pr);\n\t\t$scope.predicate = pr;\n\t\t$scope.reverse != $scope.reverse;\n\t}\n}", "function DialogController($scope, $mdDialog, recipe) {\n $scope.recipe = recipe;\n //Returns an array of the nicely formatted strings of the recipes ingredients\n $scope.getStringIngredients = function () {\n var results = [];\n $scope.recipe.ingredients.forEach(function (ingredient) {\n var s = ingredient.quantity + \" \" + ingredient.name;\n s += ingredient.notes.length == 0 ? \"\" : (\" (\" + ingredient.notes + \")\");\n results.push(s);\n });\n return results;\n };\n //Formats the specified recipe's courses into a comma separated string\n $scope.getCourseList = function () {\n var list = \"\"\n for (var i = 0; i < $scope.recipe.courses.length; i++) {\n list += $scope.recipe.courses[i];\n if (i != ($scope.recipe.courses.length - 1)) {\n list += \", \";\n }\n }\n return list;\n };\n //Formats the specified recipe's cuisines into a comma separated string\n $scope.getCuisineList = function () {\n var list = \"\"\n for (var i = 0; i < $scope.recipe.cuisines.length; i++) {\n list += $scope.recipe.cuisines[i];\n if (i != ($scope.recipe.cuisines.length - 1)) {\n list += \", \";\n }\n }\n return list;\n };\n $scope.hide = function () {\n $mdDialog.hide();\n };\n $scope.cancel = function () {\n $mdDialog.cancel();\n };\n }", "function openNewModal(items){\n var count = 0;\n for(var obj of items){\n var tag = obj.type || \"div\";\n var classes = \"\";for(var c of obj.classes){classes+=c+\" \"};\n var inner = obj.content || \"\";\n var html = \"<\"+tag+\" class='\"+classes+\"'\";\n if(tag == 'textarea')\n html+=\"placeholder='\"+inner+\"'></\"+tag+\">\";\n else if(tag != \"input\")\n html+=\">\"+inner+\"</\"+tag+\">\";\n else\n html+=\"placeholder='\"+inner+\"'>\";\n $(\"#mmc-wrapper\").append(html);\n count++;\n }\n if(count > 4){\n $('#main-modal-content').css({'margin': '2% auto'});\n }\n else\n $('#main-modal-content').css({'margin': '15% auto'});\n $('#main-modal').fadeIn(500);\n}", "function showAnswerActions(answers) {\n answers.forEach(function (answer) {\n var id = 'actions_' + answer.answer_id;\n var html = \"<button class='btn btn-primary' id='myBtn\" + answer.answer_id + \"' data-toggle='modal' data-target='#myModal\" + answer.answer_id + \"'>Edit</button>\";\n document.getElementById(id).innerHTML = html;\n });\n var models = [];\n answers.forEach(function (answer) {\n var html = \"<div id='myModal\" + answer.answer_id + \"' class='modal'>\"\n + \"<div class='modal-content'>\"\n + \" <span class='close' data-dismiss='modal'>&times;</span>\"\n + \"<textarea class='textarea' id='newAnswer\" + answer.answer_id + \"'>\" + answer.answer_body + \"</textarea><br>\"\n + \"<button class='btn btn-primary' id='updateBtn' onclick='updateUserAnswer(\" + JSON.stringify(answer) + \");'>Update</button>\"\n + \"</div>\"\n + \"</div>\";\n models.push(html);\n });\n document.getElementById('includes').innerHTML = models.join(\"\");\n}", "function mostrarModalSeleccionado(item, diagnostico, tratamiento){\r\n\t\tvar modalInstance = $modal.open({\r\n\t animation: true,\r\n\t templateUrl: 'js/hefesoft/odontograma/directivas/piezaDental/template/seleccionada.html',\r\n\t controller: 'piezaDentalSeleccionadaCtrl',\r\n\t size: 'sm',\r\n\t resolve: {\r\n\t diagnostico : function () {\r\n\t return diagnostico;\r\n\t },\r\n\t tratamiento : function () {\r\n\t return tratamiento;\r\n\t },\r\n\t piezaDental : function () {\r\n\t return item;\r\n\t }\r\n\t }\r\n\t });\r\n\r\n\t\t//El primero es cerrar el segundo es dimiss\r\n\t\t modalInstance.result.then(\r\n\t\t \tfunction(data){},\r\n\t\t \tfunction (data) {\r\n \t \t\t$scope.fnModificado($scope.$parent, { 'item' : item });\r\n\t });\r\n\t}", "function modal(){\n\t\t//creating necessary elements to structure modal\n\t\tvar iDiv = document.createElement('div');\n\t\tvar i2Div = document.createElement('div');\n\t\tvar h4 = document.createElement('h4');\n\t\tvar p = document.createElement('p');\n\t\tvar a = document.createElement('a');\n\n\t\t//modalItems array's element are being added to specific tags \n\t\th4.innerHTML = modalItems[1];\n\t\tp.innerHTML = modalItems[2];\n\t\ta.innerHTML = modalItems[0];\n\n\t\t//adding link and classes(materialize) to tags\n\t\tiDiv.setAttribute(\"class\", \"modal-content\");\n\t\ti2Div.setAttribute(\"class\", \"modal-footer\");\n\t\ta.setAttribute(\"class\", \"modal-action modal-close waves-effect waves-green btn-flat\");\n\t\ta.setAttribute(\"href\", \"sign_in.html\");\n\n\t\t//adding elements to tags as a child element\n\t\tiDiv.appendChild(h4);\n\t\tiDiv.appendChild(p);\n\n\t\ti2Div.appendChild(a);\n\n\t\tmodal1.appendChild(iDiv);\n\t\tmodal1.appendChild(i2Div);\n\t}", "function AddSubSeriesDialog() {\n $modal.open({\n templateUrl: 'angular/templates/materialregisters/views/createMaterialRegisterSubseries.html',\n controller: 'createMaterialRegisterSubseriesCtrl',\n scope: $scope\n }).result.then(function ($scope) {\n clearSearch();\n }, function () { });\n }", "function genModCon() {\n const genModalDiv = `<div class=modal-container></div>`;\n gallery.insertAdjacentHTML(\"afterEnd\", genModalDiv);\n const modalDiv = document.querySelector(\".modal-container\");\n modalDiv.style.display = \"none\";\n}", "function MoeDialogController($mdDialog, $scope, apiFactory, moeToPass, nouvelItem)\n { \n var dg=$scope;\n dg.affiche_load = false;\n dg.affichebuttonAjouter = false;\n dg.selectedItemMoeDialog = {};\n dg.allmoeDialog = [];\n var moe_a_anvoyer= [];\n\n dg.moedialog_column = [\n {titre:\"Nom\"},\n {titre:\"Nif\"},\n {titre:\"Stat\"},\n {titre:\"Siege\"},\n {titre:\"telephone\"}];\n \n\n //style\n dg.tOptions = {\n dom: '<\"top\"f>rt<\"bottom\"<\"left\"<\"length\"l>><\"right\"<\"info\"i><\"pagination\"p>>>',\n pagingType: 'simple',\n autoWidth: false \n };\n console.log(nouvelItem);\n console.log(moeToPass);\n if (nouvelItem==false)\n {\n dg.allmoeDialog.push(moeToPass);\n }\n dg.recherche = function(moe)\n { \n dg.affiche_load = true;\n apiFactory.getAPIgeneraliserREST(\"bureau_etude/index\",'menu','getbureau_etudebylike','moe_like',moe.nom).then(function(result)\n {\n dg.allmoeDialog = result.data.response;\n dg.affiche_load = false;\n console.log(dg.allmoeDialog);\n });\n }\n \n\n dg.cancel = function()\n {\n $mdDialog.cancel();\n dg.affichebuttonAjouter = false;\n };\n\n dg.dialogajoutmoe = function(conven)\n { \n $mdDialog.hide(dg.selectedItemMoeDialog);\n dg.affichebuttonAjouter = false;\n dg.allmoeDialog = [];\n }\n\n \n\n //fonction selection item moe\n dg.selectionMoeDialog = function (item)\n {\n dg.selectedItemMoeDialog = item;\n dg.affichebuttonAjouter = true; \n };\n \n $scope.$watch('selectedItemMoeDialog', function()\n {\n if (!dg.allmoeDialog) return;\n dg.allmoeDialog.forEach(function(iteme)\n {\n iteme.$selected = false;\n });\n dg.selectedItemMoeDialog.$selected = true;\n });\n\n }", "function openModalAddTramite(){\n getListTramites();\n vm.modalAddTramite = $uibModal.open({\n animation: true,\n templateUrl: 'views/modals/addTramite.modal.html',\n scope: $scope,\n size: 'nt',\n backdrop: 'static'\n });\n }", "createViewModal() {\n const htmlstring = '<div class=\"modal-content\">' +\n '<div class=\"modal-header\">' +\n ' <span id=\"closeview\" class=\"closeview\">&times;</span>' +\n ' <h2>' + this.name + '</h2>' +\n '</div>' +\n '<div class=\"modal-body\">' +\n ' <h2>Description</h2>' +\n ' <p>' + this.description + '</p>' +\n ' <h2>Current Status : ' + this.status + '</h2>' +\n ' <h2>Assigned to ' + this.assignee + '</h2>' +\n ' <h2>Priority : ' + this.priority + '</h2>' +\n ' <h2>Created on : ' + this.date + '</h2>' +\n '</div>' +\n '</div>';\n\n return htmlstring;\n }", "function openAddProjectList(scope, modalClass) {\n console.log(scope);\n var modalScope = $rootScope.$new();\n scope = scope || {};\n modalClass = modalClass || 'modal-default';\n\n angular.extend(modalScope, scope);\n\n return $uibModal.open({\n templateUrl: 'components/modal/addProjectList/modal.html',\n // controller: 'MessagesCtrl',\n windowClass: modalClass,\n scope: modalScope\n });\n }", "function cargarModalChef1(){\n\tvar txt='<!-- Modal --><div class=\"modal fade\" id=\"myModal\" role=\"dialog\">';\n\ttxt += '<div class=\"modal-dialog\">';\n\ttxt += '<!-- Modal content--><div class=\"modal-content\">';\n\ttxt += '<div class=\"modal-header\"><button type=\"button\" class=\"close\" data-dismiss=\"modal\">&times;</button>';\n\ttxt += '<div id=\"numeroPedido\"><h1>NUMERO PEDIDO</h1></div></div>';\n\ttxt += '<div class=\"modal-body\"><div id=\"detallePedidoCocina\"><div class=\"tbl_cocina\" id=\"tablaCocinaDetalle\">';\n\ttxt += '<table class=\"table table-bordered\"><thead><tr><th scope=\"col\">Productos</th><th scope=\"col\">Cantidad</th></tr>';\n\ttxt += '</thead><tbody><tr><td>arroz con huevo</td><td>5</td></tr><tr><td>arroz con huevo</td><td>5</td></tr><tr><td>arroz con huevo</td><td>5</td></tr><tr><td>arroz con huevo</td><td>5</td></tr><tr><td>arroz con huevo</td><td>5</td></tr><tr><td>arroz con huevo</td><td>5</td></tr></tbody></table></div></div></div>';\n\ttxt += '<div class=\"modal-footer\"><div id=\"pedidoCocinaSur\"><button type=\"button\" class=\"btn btn-warning\">PREPARAR</button>';\n\ttxt += '<button type=\"button\" class=\"btn btn-success\">ENTREGAR</button></div>';\n\ttxt += '</div></div></div></div>';\n\treturn txt;\n}", "function create_modal_research(elem,json_data,interest_or_fac) {\n\n var put_in = $('#modal_div');\n\n $div_research_modal = $(\"<div class='div_research_modal_div'></div>\");\n\n if(interest_or_fac == 0){\n $div_research_modal.append(\"<h1 class = 'div_research_modal_name'>\"+json_data.areaName+\"</h1><hr\" +\n \" class='div_research_modal_hr'>\");\n\n\n }\n else{\n $div_research_modal.append(\"<h1 class = 'div_research_modal_name'>\"+json_data.facultyName+\"</h1><hr\" +\n \" class='div_research_modal_hr'>\");\n }\n\n $div_research_modal.append(\"<ul>\");\n for(var i = 0; i < json_data.citations.length;i++){\n $div_research_modal.append(\"<li class='div_research_modal_li'>\"+json_data.citations[i]+\"</li>\");\n }\n $div_research_modal.append(\"</ul>\");\n\n put_in.append($div_research_modal);\n\n\n put_in.dialog({\n modal: true,\n beforeClose: function () {put_in.empty();},\n maxHeight:500,\n minWidth:700,\n closeOnEscape: true\n });\n}", "showModal(index) {\n let employees = this.filteredEmployees[index];\n let name = employees.name;\n let dob = employees.dob;\n let phone = employees.phone;\n let email = employees.email;\n let city = employees.location.city;\n let streetNum = employees.location.street.number;\n let streetName = employees.location.street.name;\n let state = employees.location.state;\n let postcode = employees.location.postcode;\n let picture = employees.picture.large;\n let date = new Date(dob.date);\n\n const modalHTML = ` \n <img class=\"modal-avatar\" src=\"${picture}\" />\n <div class=\"modal-text-container\">\n <h2 id= \"modalCard\" class=\"name\" data-index=\"${index}\" >${name.first} ${\n name.last\n }</h2>\n <p class=\"email\">${email}</p>\n <p class=\"address\">${city}</p>\n <hr />\n <p class=\"phone\">${phone}</p>\n <p class=\"address\">${streetNum} ${streetName} ${state}, ${postcode}</p>\n <p class= \"bday\">Birthday: ${date.getMonth()}/${date.getDate()}/${date.getFullYear()}</p>\n `;\n this.overlay.classList.remove(\"hidden\"); // will reveal the overlay\n this.modal.innerHTML = modalHTML; // add modal to screenS\n }", "function templateCntl($scope) {\n console.log('in template');\n var items = [];\n var anItem = {\n type: 'text' //or table, or calendar\n ,isSection: false\n ,title: 'my first item'\n ,content: 'and this is the content'\n };\n $scope.items = items;\n}", "function tagModalService($rootScope, $modal, $timeout, $q) {\n return function(type, dest) {\n var modalScope = $rootScope.$new();\n \n modalScope.add = addTags;\n modalScope.dest = dest;\n modalScope.selectTag = selectTag;\n \n switch(type) {\n case 'qual':\n modalScope.tagType = 'qual';\n break;\n case 'impact':\n default:\n modalScope.tagType = 'impact';\n modalScope.multi = true;\n break;\n };\n \n var modal = $modal({\n title: 'Add Impact Area Tag',\n templateUrl: '/angular/tag/tagModal.tpl.html',\n controller: 'AddTag',\n controllerAs: 'tags',\n scope: modalScope\n });\n var deferred = $q.defer();\n modal.$promise = deferred.promise;\n \n var parentHide = modal.hide;\n modal.hide = hide;\n \n return modal;\n \n /**\n * Return the tags to the parent controller\n * @param {array} tags List of tags to send back\n */\n function addTags(tags, dest) {\n if(!dest) {\n // No target given\n return;\n }\n \n if(modalScope.multi) {\n var count = 0; \n angular.forEach(tags, function(val, key) {\n if(dest.indexOf(val.data) < 0) {\n dest.push(val.data);\n count++;\n }\n });\n \n modalScope.message = 'Added ' + count + ' tags to strategy.';\n $timeout(function(){\n modalScope.message = null;\n }, 2000);\n } else if(tags.length > 0) {\n dest.splice(0, dest.length);\n dest.push(tags[0].data);\n }\n }\n \n /**\n * Add the given tag to the output and close the modal\n * \n * Only triggers on modals where multi == false\n */\n function selectTag(data) {\n if(!modalScope.multi) {\n addTags([data.node], modalScope.dest);\n modal.hide();\n }\n }\n \n /**\n * Hide the modal\n */\n function hide() {\n deferred.resolve(true);\n parentHide();\n }\n }\n }", "function openDialog(options) {\n\n \n if (!options) {\n options = {};\n }\n //configation and defaults\n var scope = options.scope || $rootScope.$new(),\n container = options.container || $(\"body\"),\n animationClass = options.animation || \"fade\",\n modalClass = options.modalClass || \"umb-modal\",\n width = options.width || \"100%\",\n templateUrl = options.template || \"views/common/notfound.html\";\n\n //if a callback is available\n var callback = options.callback;\n\n //Modal dom obj and unique id\n var $modal = $('<div data-backdrop=\"false\"></div>');\n var id = templateUrl.replace('.html', '').replace('.aspx', '').replace(/[\\/|\\.|:\\&\\?\\=]/g, \"-\") + '-' + scope.$id;\n\n \n\n if(options.inline){\n animationClass = \"\";\n modalClass = \"\";\n }else{\n $modal.addClass(\"modal\");\n $modal.addClass(\"hide\");\n }\n\n //set the id and add classes\n $modal\n .attr('id', id)\n .addClass(animationClass)\n .addClass(modalClass);\n\n //push the modal into the global modal collection\n //we halt the .push because a link click will trigger a closeAll right away\n $timeout(function () {\n dialogs.push($modal);\n }, 250);\n \n //if iframe is enabled, inject that instead of a template\n if (options.iframe) {\n var html = $(\"<iframe auto-scale='0' src='\" + templateUrl + \"' style='width: 100%; height: 100%;'></iframe>\");\n\n $modal.html(html);\n //append to body or whatever element is passed in as options.containerElement\n container.append($modal);\n\n // Compile modal content\n $timeout(function () {\n $compile($modal)(scope);\n });\n\n $modal.css(\"width\", width);\n\n //Autoshow\t\n if (options.show) {\n $modal.modal('show');\n }\n\n return $modal;\n }\n else {\n \n //We need to load the template with an httpget and once it's loaded we'll compile and assign the result to the container\n // object. However since the result could be a promise or just data we need to use a $q.when. We still need to return the \n // $modal object so we'll actually return the modal object synchronously without waiting for the promise. Otherwise this openDialog\n // method will always need to return a promise which gets nasty because of promises in promises plus the result just needs a reference\n // to the $modal object which will not change (only it's contents will change).\n $q.when($templateCache.get(templateUrl) || $http.get(templateUrl, { cache: true }).then(function(res) { return res.data; }))\n .then(function onSuccess(template) {\n\n // Build modal object\n $modal.html(template);\n\n //append to body or other container element\t\n container.append($modal);\n\n // Compile modal content\n $timeout(function() {\n $compile($modal)(scope);\n });\n\n scope.dialogOptions = options;\n\n //Scope to handle data from the modal form\n scope.dialogData = {};\n scope.dialogData.selection = [];\n\n // Provide scope display functions\n //this passes the modal to the current scope\n scope.$modal = function(name) {\n $modal.modal(name);\n };\n\n scope.hide = function() {\n $modal.modal('hide');\n\n $modal.remove();\n $(\"#\" + $modal.attr(\"id\")).remove();\n };\n\n scope.show = function() {\n $modal.modal('show');\n };\n\n scope.submit = function(data) {\n if (callback) {\n callback(data);\n }\n\n $modal.modal('hide');\n\n $modal.remove();\n $(\"#\" + $modal.attr(\"id\")).remove();\n };\n\n scope.select = function(item) {\n var i = scope.dialogData.selection.indexOf(item);\n if (i < 0) {\n scope.dialogData.selection.push(item);\n }else{\n scope.dialogData.selection.splice(i, 1);\n }\n };\n\n scope.dismiss = scope.hide;\n\n // Emit modal events\n angular.forEach(['show', 'shown', 'hide', 'hidden'], function(name) {\n $modal.on(name, function(ev) {\n scope.$emit('modal-' + name, ev);\n });\n });\n\n // Support autofocus attribute\n $modal.on('shown', function(event) {\n $('input[autofocus]', $modal).first().trigger('focus');\n });\n\n //Autoshow\t\n if (options.show) {\n $modal.modal('show');\n }\n });\n \n //Return the modal object outside of the promise!\n return $modal;\n }\n }", "function generateModalBox(filterObj, itemNo) {\n var eventsModal = document.getElementById('eventsModal');\n var modalBox = '';\n modalBox += '<div class=\"event-date-header\"><span>' + filterObj[itemNo].eventSpecDate + ' Events</span> <a href=\"#\" class=\"close-btn\">X</a></div>' +\n '<div class=\"event-time\">' + filterObj[itemNo].eventtimeZone + '</div>' +\n '<div class=\"event-title\">' + filterObj[itemNo].eventTitle + '</div>' +\n '<div class=\"event-description\">' + filterObj[itemNo].eventDescription + '</div><a href=\"' + filterObj[itemNo].learnMoreURL + '\" class=\"event-btn\" target=\"_blank\">Learn more</a>' +\n '<div class=\"events-prev-next\"><span class=\"events-prev glyphicon glyphicon-triangle-top\"></span><span class=\"events-next glyphicon glyphicon-triangle-bottom\"></span></div>';\n $(eventsModal).html(modalBox);\n eventsModal.style.display = 'block';\n }", "function addGridMenu(scope, gridOptions) {\n var modalScope = scope.$new(true),\n modal, template,\n stateName = getStateName();\n\n scope.create = function($event) {\n // if location path is available then we use ui-router\n if (lux.context.uiRouterEnabled)\n $location.path($location.path() + '/add');\n else\n $lux.window.location.href += '/add';\n };\n\n scope.delete = function($event) {\n modalScope.selected = scope.gridApi.selection.getSelectedRows();\n\n var firstField = gridOptions.columnDefs[0].field,\n subPath = scope.options.target.path || '';\n\n // Modal settings\n angular.extend(modalScope, {\n 'stateName': stateName,\n 'repr_field': scope.gridOptions.metaFields.repr || firstField,\n 'infoMessage': gridDefaults.modal.delete.messages.info + ' ' + stateName + ':',\n 'dangerMessage': gridDefaults.modal.delete.messages.danger,\n 'emptyMessage': gridDefaults.modal.delete.messages.empty + ' ' + stateName + '.',\n });\n\n if (modalScope.selected.length > 0)\n template = gridDefaults.modal.delete.templates.delete;\n else\n template = gridDefaults.modal.delete.templates.empty;\n\n modal = $modal({scope: modalScope, template: template, show: true});\n\n modalScope.ok = function() {\n\n function deleteItem(item) {\n var defer = $lux.q.defer(),\n pk = item[scope.gridOptions.metaFields.id];\n\n function onSuccess(resp) {\n defer.resolve(gridDefaults.modal.delete.messages.success);\n }\n\n function onFailure(error) {\n defer.reject(gridDefaults.modal.delete.messages.error);\n }\n\n gridDataProvider.deleteItem(pk, onSuccess, onFailure);\n\n return defer.promise;\n }\n\n var promises = [];\n\n forEach(modalScope.selected, function(item, _) {\n promises.push(deleteItem(item));\n });\n\n $q.all(promises).then(function(results) {\n getPage(scope);\n modal.hide();\n $lux.messages.success(results[0] + ' ' + results.length + ' ' + stateName);\n }, function(results) {\n modal.hide();\n $lux.messages.error(results + ' ' + stateName);\n });\n };\n };\n\n scope.columnsVisibility = function() {\n modalScope.columns = scope.gridOptions.columnDefs;\n modalScope.infoMessage = gridDefaults.modal.columnsVisibility.messages.info;\n\n modalScope.toggleVisible = function(column) {\n if (column.hasOwnProperty('visible'))\n column.visible = !column.visible;\n else\n column.visible = false;\n\n scope.gridApi.core.refresh();\n };\n\n modalScope.activeClass = function(column) {\n if (column.hasOwnProperty('visible')) {\n if (column.visible) return 'btn-success';\n return 'btn-danger';\n } else\n return 'btn-success';\n };\n //\n template = gridDefaults.modal.columnsVisibility.templates.default;\n modal = $modal({scope: modalScope, template: template, show: true});\n };\n\n updateGridMenu(scope, gridDefaults.gridMenu, gridOptions);\n\n extend(gridOptions, {\n enableGridMenu: true,\n gridMenuShowHideColumns: false,\n });\n }", "function modalViewOnShown(dialogRef) {\r\n\t\t\tvar rowData = dt.row('.selected').data(),\r\n\t\t\t\tmodalBody = dialogRef.getModalBody();\r\n\t\t\t$.each(rowData, function (name, value) {\r\n\t\t\t\tmodalBody.find('td[data-cell=\"' + name + '\"]').text(value);\r\n\t\t\t});\r\n\t\t}", "function resetModal() {\n $scope.prof = {};\n }", "function viewSpecDetail(row, attribute) {\n $('#myModal').modal('show');\n $scope.productSpecNumber = row.serial;\n getProductSpec($scope.productSpecNumber); \n }", "function abrirModal(html, obj) {\n $(\"#newOrderModal\").modal();\n console.log(html);\n console.log(obj);\n //carga los datos \n $(\"#div_producto\").html(html);\n Item = obj;\n $('#btn_modal_prod').html(\n '<button onclick=\"agregar_acarrito()\" type=\"button\" data-dismiss=\"modal\" class=\"btn btn-danger\">Agregar a Carrito</button>' +\n '<button type=\"button\" onclick=\"clearItem()\" class=\"btn btn-default\" data-dismiss=\"modal\">Close</button>');\n\n\n }", "function generateModalContainer(person,index, arrayObj)\n {\n const modalContainer = document.createElement('div');\n modalContainer.classList = 'modal-container';\n gallery.appendChild(modalContainer);\n modalContainer.innerHTML = `\n <div class=\"modal\">\n <button type=\"button\" id=\"modal-close-btn\" class=\"modal-close-btn\"><strong>X</strong></button>\n <div class=\"modal-info-container\">\n <img class=\"modal-img\" src=\"${person.picture.large}\" alt=\"profile picture\">\n <h3 id=\"name\" class=\"modal-name cap\">${person.name.first} ${person.name.last}</h3>\n <p class=\"modal-text\">${person.email}</p>\n <p class=\"modal-text cap\">${person.location.city}</p>\n <hr>\n <p class=\"modal-text\">${person.cell}</p>\n <p class=\"modal-text\">${person.location.street.number} ${person.location.street.name}, ${person.location.city}, OR ${person.location.postcode}</p>\n <p class=\"modal-text\">Birthday: ${person.dob.date.substring(0,10)}</p>\n </div>`\n const modalButtonContainer =`\n <div class=\"modal-btn-container\">\n <button type=\"button\" id=\"modal-prev\" class=\"modal-prev btn\">Prev</button>\n <button type=\"button\" id=\"modal-next\" class=\"modal-next btn\">Next</button>\n </div>\n </div>`;\n modalContainer.innerHTML += modalButtonContainer;\n\n navigationButtons(index, arrayObj, modalContainer)\n }", "function addReport(){\r\n var text = \"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ac nisi eu elit rhoncus mattis dignissim vel sem. Donec bibendum augue velit, nec gravida turpis ornare eget. Mauris eu sapien bibendum, blandit risus at, pretium tellus. Donec volutpat non sem a efficitur. Curabitur turpis magna, elementum ac felis nec, congue finibus massa. Quisque laoreet tincidunt quam, sed mollis augue varius egestas. Curabitur quis sollicitudin diam, non tempus tortor. Nam condimentum arcu sed lacus rhoncus, id tincidunt lectus vehicula.\";\r\n var group = 1; //changeable\r\n \r\n //sample populator for report\r\n var ctr = 1;\r\n for(var i = 1; i < 10; i++,ctr++){\r\n if(ctr > 3){\r\n ctr = 1;\r\n }\r\n group = ctr;\r\n document.getElementById(\"report-container\").innerHTML +='<div data-toggle=\"modal\" data-target=\"#report-full\" class=\"card report-card mb-3 \" style=\"min-width:100%\"><div class=\"row no-gutters\"><div class=\"col\"><div class=\"card-body text-wrap\"><span class=\"badge badge-pill\" style=\"background-color:'+colors[group-1]+'\">Group '+ group+'</span><p class=\"text-truncate\">'+text+'</p></div></div></div></div>';\r\n }\r\n}", "function showWriteReviewModal()\n\t\t{\n\t\t\t$ionicModal.fromTemplateUrl('templates/modals/write-review-modal.html', function($ionicModal) {\n\t\t\t\t$scope.modal = $ionicModal;\n\t }, {\n\t scope: $scope,\n\t animation: 'slide-in-up'\n\t }).then(function(modal) {\n\t $scope.modal = modal;\n\t $scope.modal.show();\n\t });\n\t }", "function showLastRunDetails() {\n $('#modal-container').html(last_run_details_template(runResults))\n $('#modal-container').modal()\n}", "showDeleteListModal(name) {\n let modal = document.getElementById(\"delete-modal\");\n modal.classList.add(\"is-visible\");\n let dialogBox = document.getElementById(\"dialog\");\n let newDialog = \"Delete the \";\n newDialog = newDialog + name;\n newDialog = newDialog + \" List?\";\n dialogBox.innerHTML = newDialog;\n }", "function showModel(choiceArray) {\n //input al coins to object\n const arrayData = choiceArray.map(item => `<button type=\"button\" class=\"btnSwitch btn-primary btn-lg\" value=${item}>${item}</button>&nbsp&nbsp&nbsp;`);\n //append current data to modal\n $(\"#myModal\").html(\" \").append(`\n <div class=\"modal-dialog\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h5 class=\"modal-title\">you can choose only 5 currency,<br> If you want to choose another currency you need to select one of the currencies you want to remove.</h5>\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body\">\n ${arrayData.join().replace(/,/g, '')}\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">Close</button>\n </div>\n </div>\n</div>\n `)\n //show model \n $('#myModal').modal('show');\n}", "function addOwner() {\n var resolvedData = {\n entity: 'Content',\n thisRecord: $scope.data.thisContent\n }\n\n var addOwnerModal = modalManager.openModal('addOwner', resolvedData)\n\n //after result - add / remove from UI\n\n addOwnerModal.result.then(function(results){\n console.log(results);\n //update this opp\n //comes back as array so need to loop through to push in properly\n _.forEach(results, function(value){\n $scope.data.thisContent.ownerLinks.push(value);\n })\n\n })\n}", "function showRepeatDialog(e)\n {\n console.log(e);\n $mdDialog.show({\n controller : 'EventRepeatDialogController',\n controllerAs : 'vm',\n templateUrl : 'app/main/apps/calendar/dialogs/event-repeat/event-repeat-dialog.html',\n parent : angular.element($document.body),\n targetEvent : e,\n clickOutsideToClose: true,\n locals : {\n event : e\n }\n });\n }", "function modalInject(){\n\t\t//inject modal holder into page\n\t\tif (!document.getElementById(\"g_block_modals\")) {\n\t\t\t$(\"body\").append(tdc.Grd.Templates.getByID('modalInject'));\n\t\t}\n\t}", "function insertProfiles(results) { //passes results and appends them to the page\r\n $.each(results, function(index, user) {\r\n $('#gallery').append(\r\n `<div class=\"card\" id=${index}>\r\n <div class=\"card-img-container\">\r\n <img class=\"card-img\" src=\"${user.picture.large}\" alt=\"profile picture\">\r\n </div>\r\n <div class=\"card-info-container\">\r\n <h2 id=${index} class=\"card-name cap\">${user.name.first} ${user.name.last}</h2>\r\n <p class=\"card-text\">${user.email}</p>\r\n <p class=\"card-text cap\">${user.location.city}, ${user.location.state}</p>\r\n </div>\r\n </div>`);\r\n });\r\n\r\n//The modal div is being appended to the html\r\n function modalWindow() {\r\n $('#gallery').append(\r\n `<div class=\"modal-container\">\r\n <div class=\"modal\">\r\n <button type=\"button\" id=\"modal-close-btn\" class=\"modal-close-btn\"><strong>X</strong></button>\r\n <div class=\"modal-info-container\">\r\n </div>\r\n </div>\r\n </div>`);\r\n $('.modal-container').hide();\r\n }\r\n// I am formating the information I want the modal window to portray\r\n function modalAddon(user) {\r\n\r\n $(\".modal-info-container\").html( `\r\n <img class=\"modal-img\" src=\"${user.picture.large}\" alt=\"profile picture\">\r\n <h2 id=\"name\" class=\"modal-name cap\">${user.name.first} ${user.name.last}</h2>\r\n <p class=\"modal-text\">${user.email}</p>\r\n <p class=\"modal-text cap\">${user.location.city}</p>\r\n <br>_________________________________</br>\r\n <p class=\"modal-text\">${user.cell}</p>\r\n <p class=\"modal-text\">Postcode: ${user.location.postcode}</p>\r\n <p class=\"modal-text\">Birthday: ${user.dob.date}</p>\r\n </div>\r\n`);\r\n$(\".modal-container\").show();\r\n\r\n //This hide's the modal window when the \"X\" button is clicked\r\n $('#modal-close-btn').on(\"click\", function() {\r\n $(\".modal-container\").hide();\r\n });\r\n}\r\n\r\n\r\nmodalWindow(); //This opens the modal window when the card is clicked\r\n $('.card').on(\"click\", function() {\r\n let user = $('.card').index(this);\r\n modalAddon(results[user]);\r\n\r\n });\r\n\r\n}", "function drawModal(array, name, kind){\n\t\tvar content=\"\";\n\t\tvar name = name.replace(/ /g, '');//remove white space\n\t\t//when emtpy array\n\t\tif(array == null || array.length == 0)\n\t\t\treturn \"None\";\n\t\t//this condition allows us to send a string as a parameter instead of an array and the funciton would still work\n\t\tif(typeof(array)== 'string'){\n\t\t\tarray = array.split();\n\t\t}\n\t\t//loop through the array and call an ajax request for each link that comes in the array\n\t\t//when we get the data assign it to the modal we just returned.\n\t\tarray.forEach(function(element,index,array){\n\t\t\t$.when($.ajax(array[index])).then(function(data){\n\t\t\t\t//special case for films\n\t\t\t\tif(kind == 'films'){\n\t\t\t\t\tcontent+= \"<li>\"+data.title;\n\t\t\t\t\tcontent += \"<img src='/img/\"+kind+\"/\"+ IgnoreSpecialCharactersFromString(data.title)+ \".jpg' class='charactersIMG center-block'</li>\";\n\t\t\t\t}\n\t\t\t\t//else use title\n\t\t\t\telse{\n\t\t\t\t\tcontent +=\"<li>\"+data.name;\n\t\t\t\t\tcontent += \"<img src='/img/\"+kind+\"/\"+ IgnoreSpecialCharactersFromString(data.name)+ \".png' class='charactersIMG center-block'</li>\";\n\t\t\t\t}\n\t\t\t\t$('#'+IgnoreSpecialCharactersFromString(name)+'').html(content);\n\t\t\t});\n\t\t});\n\t\t//create and return the \"empty modal initialized with unique id\"\n\t\t\n\t\tvar modal = \n\t\t\"<button type='button' class='btn btn-warning btn-sm' data-toggle='modal' data-target='.\"+IgnoreSpecialCharactersFromString(name)+\"'>Display</button>\"+\n\t\t\"<div class='modal fade \"+IgnoreSpecialCharactersFromString(name)+\"' tabindex='-1' role='dialog' aria-labelledby='mySmallModalLabel'>\"+\n\t\t \"<div class='modal-dialog modal-sm' role='document'>\"+\n\t\t \"<div class='modal-content' id='\"+IgnoreSpecialCharactersFromString(name)+\"'>\"+\n\t\t\"</div></div></div>\";\n\n\t\treturn modal;\n\t}", "function createDeleteModal(list) {\n let newP = $(\"<p>\", {text: \"Are you sure you want to delete this team?\"});\n\n $(\".modal-body\").empty();\n $(\".modal-title\").text(list.TeamName);\n $(\".modal-body\").append(newP);\n}", "function createModalDivHtml(options) {\n //If an element already exists with that ID, then dont recreate it.\n if ($(\"#\" + options.modalContainerId).length) {\n return;\n }\n\n var html = '';\n //Warning, do not put tabindex=\"-1\" in the element below. Doing so breaks search functionality in a select 2 drop down\n html += '<div id=\"' + options.modalContainerId + '\" class=\"modal\" data-keyboard=\"true\" role=\"dialog\" data-callback=\"' + options.callback + '\">';\n html += ' <div class=\"modal-content\"></div>';\n html += '</div>';\n $('body').prepend(html);\n }", "function createEditMemberModal(list) {\n let form = $(\"<form>\", {id: \"editMemberForm\"});\n let newDiv = $(\"<div>\", {class: \"form-group\"});\n let labelArr = [\"Email:\",\"Member Name:\", \"Contact Name:\", \"Age:\", \"Gender:\", \"Phone:\"];\n\n $(\".modal-title\").text(\"Edit\");\n $(\".modal-body\").empty()\n .append(form);\n\n let i = 0;\n for(let key in list) {\n if(key != \"MemberId\") {\n newDiv = $(\"<div>\", {class: \"form-group\"});\n\n let newLabel = $(\"<label>\", {for: \"modal-\" + key + \"-\" + list.MemberId, text: labelArr[i]});\n let newInput = $(\"<input>\", {type: \"text\", \n class: \"form-control\", \n id: \"modal-\" + key + \"-\" + list.MemberId, \n name: key.toLowerCase(), \n value: list[key]});\n \n form.append(newDiv);\n newDiv.append(newLabel)\n .append(newInput);\n\n i++;\n }\n }\n}", "function setModalData(item) {\n modal = `<div class=\"modal-container\">\n <div class=\"modal\">\n <button type=\"button\" id=\"modal-close-btn\" class=\"modal-close-btn\"><strong>X</strong></button>\n <div class=\"modal-info-container\">\n <img class=\"modal-img\" src=\"${\n item.picture.large\n }\" alt=\"profile picture\">\n <h3 id=\"name\" class=\"modal-name cap\">${item.name.title} ${\n item.name.first\n } ${item.name.last}</h3>\n <p class=\"modal-text\">${item.email}</p>\n <p class=\"modal-text cap\">${item.location.city}</p>\n <hr>\n <p class=\"modal-text\">${item.cell}</p>\n <p class=\"modal-text\">${item.location.street}, ${\n item.location.city\n }, ${item.location.state} ${item.location.postcode}</p>\n <p class=\"modal-text\">Birthday: ${item.dob.date}</p>\n </div>\n </div>\n <div class=\"modal-btn-container\">\n <button type=\"button\" id=\"modal-prev\" class=\"modal-prev btn\">Prev</button>\n <button type=\"button\" id=\"modal-next\" class=\"modal-next btn\">Next</button>\n </div>\n </div>`;\n\n return $(modal);\n}", "function Modal(id, items) {\n this.id = id;\n this.items = items;\n this.container = $('<div>', {\n 'id': this.id,\n 'class': 'modal fade',\n 'tabindex': -1,\n 'role': 'dialog'\n });\n this.setIndex = function(i) {\n this.currentIndex = i;\n };\n this.getIndex = function () {\n if(this.currentIndex !== 'undefined') {\n \n return this.currentIndex;\n } else {\n return false;\n }\n };\n this.getHTML = function() {\n modalHtml = '<div class=\"modal-dialog modal-lg\" role=\"document\">\\n' +\n '<div class=\"modal-content\">\\n' +\n '<a href=\"#\" class=\"modal-arrow modal-previous-arrow\"><i class=\"fa fa-chevron-left\" aria-hidden=\"true\"></i></a>' +\n '<div class=\"modal-box\">' +\n '<div class=\"modal-header\">\\n' +\n '<button type=\"button\" class=\"close modal-close\" data-dismiss=\"modal\" aria-label=\"Close\"><i class=\"fa fa-times\" aria-hidden=\"true\"></i></button>\\n' +\n '</div>\\n' +\n '<div class=\"modal-body\">\\n' + items[this.getIndex()]['data-html'] +\n '</div>\\n' +\n '</div>' +\n '<a href=\"#\" class=\"modal-arrow modal-next-arrow\"><i class=\"fa fa-chevron-right\" aria-hidden=\"true\"></i></a>' +\n '</div><!-- /.modal-content -->\\n' +\n '</div><!-- /.modal-dialog -->\\n';\n return modalHtml;\n };\n this.create = function() {\n let $modal = this.container.html(this.getHTML());\n if($('#'+this.id).length === 0) {\n $modal.appendTo(document.body);\n }\n this.hideArrows();\n };\n this.changeResult = function(i) {\n this.currentIndex = i;\n this.container.html(this.getHTML());\n this.hideArrows();\n };\n this.hideArrows = function() {\n if(this.getIndex() !== false) {\n if(this.getIndex() === this.items.length - 1) {\n this.container.find('.modal-next-arrow').addClass('hide');\n } else if (this.getIndex() === 0) {\n this.container.find('.modal-previous-arrow').addClass('hide');\n } else {\n this.container.find('.modal-arrow').removeClass('hide');\n }\n }\n }\n}", "function showModal() {\n\n $('#myModal').modal(\"show\");\n $(\".modal-title\").text(data.name)\n $(\".modal-li-1\").text(\"Generation: \" + data.generation.name)\n $(\".modal-li-2\").text(\"Effect: \" + data.effect_changes[0].effect_entries[1].effect)\n $(\".modal-li-3\").text(\"Chance: \" + data.effect_entries[1].effect)\n $(\".modal-li-4\").text(\"Bonus Effect: \" + data.flavor_text_entries[0].flavor_text)\n }", "function buildNotesModal(data,mongo_id){\n\n var numNotes; \n\n if (data.note != null){\n numNotes = data.note.length;\n }else{ numNotes = 0; }\n\n var html = `\n <div class=\"bootbox modal fade show\" data-mongoid=\"${mongo_id}\" tabindex=\"-1\" role=\"dialog\" style=\"display: block;\">\n <div class=\"modal-dialog\">\n <div class=\"modal-content\">\n <div class=\"modal-body\">\n <button type=\"button\" class=\"bootbox-close-button close\" data-dismiss=\"modal\" aria-hidden=\"true\" style=\"margin-top: -10px;\">×</button>\n <div class=\"bootbox-body\">\n <div class=\"container-fluid text-center\">\n \n <h4>Notes For Article: ${data.title}</h4>\n <hr>\n <ul class=\"list-group note-container\">`;\n \n if(numNotes > 0){\n for(var i = 0; i < numNotes; i++){\n html += `\n <li class=\"list-group-item note\">${data.note[i]}<button class=\"btn btn-danger note-delete\">x</button></li>`\n }\n } else{\n html += `\n <li class=\"list-group-item\">No notes for this article yet.</li>`;\n }\n \n html += \n `</ul>\n <textarea placeholder=\"New Note\" id=\"textareaNotes\" rows=\"4\" cols=\"60\"></textarea>\n <button class=\"btn btn-success save\">Save Note</button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>`\n return html\n}", "function AccordionCtrl($scope) {\n $scope.oneAtATime = true;\n\n $scope.groups = [\n {\n title: \"Dynamic Group Header - 1\",\n content: \"Dynamic Group Body - 1\"\n },\n {\n title: \"Dynamic Group Header - 2\",\n content: \"Dynamic Group Body - 2\"\n }\n ];\n\n}", "generateOverlay() {\n for (let i = 0; i < this.results.length; i++) {\n let modalContainer = `<div class=\"modal-container\" hidden>\n <div class=\"modal\">\n <button type=\"button\" id=\"modal-close-btn\" class=\"modal-close-btn\"><strong>X</strong></button>\n <div class=\"modal-info-container\">\n <img class=\"modal-img\" src=\"${\n this.pictures[i]\n }\" alt=\"profile picture\">\n <h3 id=\"name\" class=\"modal-name cap\">${\n this.names[i]\n }</h3>\n <p class=\"modal-text\">${this.emails[i]}</p>\n <p class=\"modal-text cap\">${\n this.city[i]\n }</p>\n <hr>\n <p class=\"modal-text\">${this.numbers[i]}</p>\n <p class=\"modal-text\">${\n this.addresses[i]\n }</p>\n <p class=\"modal-text\">Birthday: ${\n this.birthdays[i]\n }</p>\n </div>\n </div>`;\n\n this.$body.append(modalContainer);\n }\n\n const $modalContainer = $(\".modal-container\");\n const modalButtons = `<div class=\"modal-btn-container\">\n <button type=\"button\" id=\"modal-prev\" class=\"modal-prev btn\">Prev</button>\n <button type=\"button\" id=\"modal-next\" class=\"modal-next btn\">Next</button>\n </div>`;\n\n $modalContainer.each((i, val) => $(val).append(modalButtons));\n }", "function NumbersTableCtrl($scope, sharedService, popUpService) {\n\n $scope.played = false;\n $scope.numbersTable = sharedService.numbersTable;\n\n var numOfRows = sharedService.getNumberOfRowsToShow();\n\n for (var r = 0; r < numOfRows; r++) {\n $scope.numbersTable[r] = [];\n }\n var rowIndex = 0;\n\n for (var i = 1; i <= sharedService.MAX_NUMBERS; i++) {\n $scope.numbersTable[rowIndex].push({number: i, class: \"number\", selected: false});\n if (i % sharedService.MAX_COLS == 0) {\n rowIndex++;\n }\n }\n\n $scope.select = function (item) {\n\n var selectedNumber = item.number;\n\n if (selectedNumber in sharedService.selectedNumbers) {\n\n delete sharedService.selectedNumbers[selectedNumber];\n } else {\n\n if (_.size(sharedService.selectedNumbers) >= sharedService.MAX_SELECTIONS) {\n\n alert(\"You can select a maximum of \" + sharedService.MAX_SELECTIONS + \" number.\")\n } else {\n\n sharedService.selectedNumbers[selectedNumber] = true;\n popUpService.showPayoutPanel();\n }\n }\n\n }\n\n $scope.getStyle = function (item) {\n\n var number = item.number;\n if (number in sharedService.selectedNumbers & number in sharedService.resultNumbers) {\n return \"btn-success\";\n } else if (number in sharedService.resultNumbers) {\n return \"btn-warning\";\n } else if (number in sharedService.selectedNumbers) {\n return \"btn-info\";\n }\n }\n\n}", "create(opts) {\n // create ionic's wrapping ion-modal component\n const modalElement = document.createElement('ion-modal');\n // give this modal a unique id\n modalElement.modalId = ids++;\n // convert the passed in modal options into props\n // that get passed down into the new modal\n Object.assign(modalElement, opts);\n // append the modal element to the document body\n const appRoot = document.querySelector('ion-app') || document.body;\n appRoot.appendChild(modalElement);\n return modalElement.componentOnReady();\n }", "function addPortfolioModal(element, number) {\n var modal = $(\"<div>\", {\n id : 'portfolioModal' + number,\n class: 'portfolio-modal modal fade',\n tabindex : \"-1\",\n role : \"dialog\"\n }).attr( 'aria-hidden', 'true');\n\n var modalContent = $('<div>', { class: 'modal-content'});\n\n var lr = $('<div>', { class: 'lr' }).append(\"<div class='rl'></div>\")\n var closeModal = $('<div>', { class: 'close-modal' }).attr('data-dismiss','modal').append(lr);\n\n var container = $('<div>', { class: 'container' });\n var row = $('<div>', { class: 'row' });\n var col = $('<div>', { class: 'col-lg-8 col-lg-offset-2' });\n var modalBody = $('<div>', { class: 'modal-body'});\n var title = $('<h2>', { html: element.title });\n var hr = $(\"<hr>\", { class: 'star-primary' });\n var img = $('<img>', {\n class: 'img-responsive img-centered',\n src: element.miniature,\n alt: ''\n });\n var description = $(\"<p>\", { html: element.description });\n\n // Projects details\n var list = $('<ul>', { class: 'list-unstyled item-details'});\n\n var liAuthor = $('<li>', { html: 'Auteur(s)' })\n .append($('<strong>').append($('<p>', { html: element.authors })));\n\n var liDate = $('<li>', { html: 'Date' })\n .append($('<strong>').append($('<p>', { html: element.year })));\n\n var liPlatform = $('<li>', { html: 'Plateformes' })\n .append($('<strong>').append($(\"<p>\", { html: element.platform })));\n\n\n var button = $('<button>', {\n class: 'btn btn-danger',\n type : 'button'\n }).attr('data-dismiss', 'modal')\n .append(\"<i class='fa fa-times'>Close</i>\");\n\n list.append(liAuthor).append(liDate).append(liPlatform);\n modalBody.append(title).append(hr).append(img)\n .append(description).append(list).append(button);\n\n container.append(row).append(col).append(modalBody);\n modalContent.append(closeModal).append(container);\n modal.append(modalContent);\n modal.insertAfter(\"#portfolio\");\n}", "function appendModal(){\n\t\tvar panelSeklly = '<div class=\"modal fade\">\\n' + \n '\t<div class=\"modal-dialog\">\\n' + \n '\t\t<div class=\"modal-content\">\\n' +\n '\t\t\t<div class=\"modal-header\">\\n' + \n '\t\t\t\t<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>\\n' + \n '\t\t\t\t<h4 class=\"modal-title\">Modal title</h4>\\n' + \n '\t\t\t</div>\\n' + \n '\t\t\t<div class=\"modal-body\">\\n' + \n '\t\t\t\t<p>One fine body&hellip;</p>\\n' + \n '\t\t\t</div>\\n' + \n '\t\t\t<div class=\"modal-footer\">\\n' + \n '\t\t\t\t<button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Close</button>\\n' + \n '\t\t\t\t<button type=\"button\" class=\"btn btn-primary\">Save changes</button>\\n' + \n '\t\t\t</div>\\n' + \n '\t\t</div>\\n' + \n '\t</div>\\n' + \n'</div>';\n\t\t//\t\t\twindow.alert(\"Hello\");\n\t\tvar editor = edManager.getCurrentFullEditor();\n\t\tif(editor){\n\t\t\tvar insertionPos = editor.getCursorPos();\n\t\t\teditor.document.replaceRange(panelSeklly, insertionPos);\n\t\t}\t\n\t}", "function generateModal(item, data) {\n console.log(item)\n let modalContainer = document.createElement(\"div\");\n modalContainer.className = \"modal-container\";\n let html = `\n <div class=\"modal-container\">\n <div class=\"modal\">\n <button type=\"button\" id=\"modal-close-btn\" class=\"modal-close-btn\"><strong>X</strong></button>\n <div class=\"modal-info-container\">\n <img class=\"modal-img\" src=\"${item.picture.large}\" alt=\"profile picture\">\n <h3 id=\"name\" class=\"modal-name cap\">${item.name.first} ${item.name.last}</h3>\n <p class=\"modal-text\">${item.email}</p>\n <p class=\"modal-text cap\">${item.location.city}</p>\n <hr>\n <p class=\"modal-text\">${item.cell}</p>\n <p class=\"modal-text\">${item.location.street.number} ${item.location.street.name}, ${item.location.state} ${item.location.postcode}</p>\n <p class=\"modal-text\">Birthday: 10/21/2015</p>\n </div>\n </div>\n </div>\n `;\n\n modalContainer.innerHTML = html;\n body.append(modalContainer);\n\n // Click 'X' to close modal window\n const button = document.querySelector(\"button\");\n const modal = document.querySelector(\"div.modal-container\");\n button.addEventListener(\"click\", () => {\n modal.remove();\n });\n}", "_exposeToModals() {\n // TODO(http://github.com/angular/components/issues/26853): consider de-duplicating this with the\n // `LiveAnnouncer` and any other usages.\n //\n // Note that the selector here is limited to CDK overlays at the moment in order to reduce the\n // section of the DOM we need to look through. This should cover all the cases we support, but\n // the selector can be expanded if it turns out to be too narrow.\n const id = this._liveElementId;\n const modals = this._document.querySelectorAll('body > .cdk-overlay-container [aria-modal=\"true\"]');\n for (let i = 0; i < modals.length; i++) {\n const modal = modals[i];\n const ariaOwns = modal.getAttribute('aria-owns');\n this._trackedModals.add(modal);\n if (!ariaOwns) {\n modal.setAttribute('aria-owns', id);\n }\n else if (ariaOwns.indexOf(id) === -1) {\n modal.setAttribute('aria-owns', ariaOwns + ' ' + id);\n }\n }\n }", "function viewMedicalInfo(selectedItems) {\n var modalInstance = $modal.open({\n templateUrl: 'app/matter/matter-details/view-memo.html',\n controller: 'viewMemoCtrl as viewMemoInfo',\n keyboard: false,\n size: 'lg',\n windowClass: 'cal-pop-up',\n resolve: {\n viewMemoInfo: function () {\n return {\n selectedItems: selectedItems\n };\n }\n }\n });\n }", "function relatedTexts(data) {\n var contentTX = '<div class=\"related-texts\">';\n\n $.each(data.topic.media, function(rInd, rElm) {\n contentTX += '<div class=\"each-text\">';\n contentTX += '<a href=\"#pid' + rElm.id + '\" class=\"thumbnail\" data-toggle=\"modal\">';\n contentTX += '<img src=\"' + rElm.images[1].url + '\" alt=\"' + (rElm.captions.length > 0 ? rElm.captions[0].title : \"\") + '\">';\n contentTX += '</a>';\n contentTX += '</div>';\n\n //Modal for each photo\n contentTX += '<div class=\"modal fade\" tabindex=\"-1\" role=\"dialog\" id=\"pid' + rElm.id + '\">';\n contentTX += '<div class=\"modal-dialog\">';\n contentTX += '<div class=\"modal-content\">';\n contentTX += '<div class=\"modal-header\">';\n contentTX += '<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\">&times;</button>';\n contentTX += '<h4 class=\"modal-title\" id=\"myModalLabel\">' + (rElm.captions.length > 0 ? rElm.captions[0].title : \"\") + '</h4>';\n contentTX += '</div>';\n contentTX += '<div class=\"modal-body\">';\n contentTX += '<img src=\"' + rElm.images[6].url + '\" alt=\"' + (rElm.captions.length > 0 ? rElm.captions[0].title : \"\") + '\">';\n contentTX += '<p><strong>Resource #:</strong> ' + rElm.id + '</p>';\n contentTX += '</div>';\n contentTX += '</div>';\n contentTX += '</div>';\n contentTX += '</div>';\n });\n\n contentTX += '</div>';\n\n $(\"#tab-texts\").append(contentTX);\n}", "function createDialogWithPartData(title,templateName,width) { \n var ui = SpreadsheetApp.getUi();\n var createUi = HtmlService.createTemplateFromFile(templateName).evaluate().getContent();\n var html = HtmlService.createTemplate(createUi+\n \"<script>\\n\" +\n \"var data = \"+getInvData()+\n \"</script>\")\n .evaluate()\n .setSandboxMode(HtmlService.SandboxMode.IFRAME)\n .setWidth(width);\n \n var ss = SpreadsheetApp.getActiveSpreadsheet();\n ui.showModalDialog(html,title);\n}", "function launchDynamicModal(title, body, timeTillClose) {\n $scope.currentModalTitle = title;\n $scope.currentModalBody = body;\n\n $scope.createDynamicModal = $uibModal.open({\n templateUrl: \"modal/dynamicModal\",\n scope: $scope\n });\n\n if (undefined !== timeTillClose) {\n let closeOnTimeout = function () {\n $scope.createDynamicModal.dismiss();\n };\n setTimeout(closeOnTimeout, timeTillClose);\n }\n }", "_addModalHTML() {\n let modalEl = document.createElement(\"div\");\n modalEl.setAttribute(\"id\", \"enlightenModal\");\n modalEl.setAttribute(\"class\", \"modal\");\n modalEl.innerHTML = `\n <div class=\"modal-content\">\n <span class=\"close\">&times;</span>\n <h3>Title</h3>\n <p>Content</p>\n </div>f`;\n\n let bodyEl = document.getElementsByTagName('body')[0];\n bodyEl.appendChild(modalEl);\n let span = document.getElementsByClassName(\"close\")[0];\n\n // When the user clicks on <span> (x), close the modal\n span.onclick = function () {\n modalEl.style.display = \"none\";\n };\n\n // When the user clicks anywhere outside of the modal, close it\n window.onclick = function (event) {\n if (event.target.id === \"enlightenModal\") {\n modalEl.style.display = \"none\";\n }\n };\n return modalEl;\n }", "function galleryHTML(data) {\n\tdata.map((person) => {\n\t\tconst cardDiv = document.createElement('div');\n\t\tgallery.appendChild(cardDiv);\n\t\tcardDiv.className = 'card';\n\t\tcardDiv.innerHTML = `\n <div class=\"card-img-container\">\n <img class=\"card-img\" src=\"${person.large}\" alt=\"profile picture\">\n </div>\n <div class=\"card-info-container\">\n <h3 id=\"name\" class=\"card-name cap\">${person.name}</h3>\n <p class=\"card-text\">${person.email}</p>\n <p class=\"card-text cap\">${person.location}</p>\n </div>\n `;\n\n\t\t// Listens for clicks on an employee card and opens a modal with further information about the employee.\n\t\tcardDiv.addEventListener('click', () => {\n\t\t\tconst modalDiv = document.createElement('modal');\n\t\t\tgallery.insertAdjacentElement('afterend', modalDiv);\n\t\t\tmodalDiv.className = 'modal-container';\n\t\t\tmodalDiv.innerHTML = `\n <div class=\"modal\">\n <button type=\"button\" id=\"modal-close-btn\" class=\"modal-close-btn\"><strong>X</strong></button>\n <div class=\"modal-info-container\">\n <img class=\"modal-img\" src=\"${person.large}\" alt=\"profile picture\">\n <h3 id=\"name\" class=\"modal-name cap\">${person.name}</h3>\n <p class=\"modal-text\">${person.email}</p>\n <p class=\"modal-text cap\">${person.location}</p>\n <hr>\n <p class=\"modal-text\">Phone: ${person.phoneNumber}</p>\n <p class=\"modal-text\">Address: ${person.address}</p>\n <p class=\"modal-text\">Birthday: ${reformatBirthday(\n\t\t\t\t\t\tperson.birthday\n\t\t\t\t\t)}</p>\n </div>\n `;\n\n\t\t\tconst modalCloseBtn = document.querySelector('.modal-close-btn');\n\n\t\t\t// Listens for click on the close button on the modal window.\n\t\t\tmodalCloseBtn.addEventListener('click', () => {\n\t\t\t\tdocument.querySelector('.modal-container').style.display = 'none';\n\t\t\t});\n\t\t});\n\t});\n}", "function modal(id, method) {\n angular.element('#' + id).modal(method);\n }", "function createDialogWithAllData(title,templateName,width) { \n var ui = SpreadsheetApp.getUi();\n var createUi = HtmlService.createTemplateFromFile(templateName).evaluate().getContent();\n var html = HtmlService.createTemplate(createUi+\n \"<script>\\n\" +\n \"var data = \"+getAllData()+\n \"</script>\")\n .evaluate()\n .setSandboxMode(HtmlService.SandboxMode.IFRAME)\n .setWidth(width);\n \n var ss = SpreadsheetApp.getActiveSpreadsheet();\n ui.showModalDialog(html,title);\n}", "function modalInstance(movieID, movieArr, $uibModal){\n\tvar id = movieID;\n\tvar modalInstance = $uibModal.open({\n\t\twindowClass: \"show\",\n\t\ttemplateUrl: \"templates/modal.html\",\n\t\tcontroller: \"modalCtrl\",\n\t\tresolve:{\n\t\t\tdata: function(){\n\t\t\t\treturn getSelectedMovie(id, movieArr);\n\t\t\t}\n\t\t}\n\t});\n}", "function getModal(modalid) {\n return '<div id=\"' + modalid + '\" class=\"modal large hide fade new-experiment\" tabindex=\"-1\" role=\"dialog\">' +\n '<div class=\"modal-header\">' +\n '<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\">×</button>' +\n '<h3 id=\"myModalLabel\">Select Environmental Data for This Subset</h3>' +\n '</div>' +\n '<div id=\"modal-body\" class=\"modal-body\"></div>' +\n '<div class=\"modal-footer\">' +\n '<button class=\"btn btn-primary\">Select Layers</button>' +\n '</div>' +\n '</div>'\n }", "function openDeleteVariableModal(element) {\n lastClickedAddVariableBtn = element;\n $('#deleteVariable').modal('show');\n\n lastOpendVarContainer = $(element).closest(\"label\").next(\"div\");\n var deleteVarContainer = $(\"#deleteVariableContainer\");\n deleteVarContainer.html(\"\");\n\n $(\".availableVariable\", lastOpendVarContainer).each(function(key, value) {\n var varName = value.innerHTML;\n deleteVarContainer.append(\n '<tr><th style=\"font-size: 18px;\">' + varName + '</th>' +\n '<td><button class=\"btn btn-danger btn-xs\" id=\"' + varName + '\" style=\"float: right;\" onclick=\"deleteVariable(this)\">' +\n '<span class=\"fa fa-trash-o fa-lg\" aria-hidden=\"true\"></span></td></tr>'\n );\n });\n}", "function createEditTeamModal(list) {\n let form = $(\"<form>\", {id: \"editTeamForm\"});\n let newDiv = $(\"<div>\", {class: \"form-group\"});\n let labelArr = [\"Team Name:\",\"Manager Name:\", \"Manager Phone:\", \"Manager Email:\", \n \"Max Team Members:\", \"Min Member Age:\", \"Max Member Age:\", \"Team Gender:\"];\n\n $(\".modal-title\").text(\"Edit Team\");\n $(\".modal-body\").empty()\n .append(form);\n\n let i = 0;\n for(let key in list) {\n\n if(key != \"TeamId\" && key != \"League\" && key != \"Members\") {\n\n if(key != \"TeamGender\") newDiv = $(\"<div>\", {class: \"form-group\"});\n else newDiv = $(\"<div>\", {class: \"form-check\"});\n form.append(newDiv);\n\n let newLabel = $(\"<label>\", {for: \"modal-\" + key + \"-\" + list.TeamId, text: labelArr[i]});\n newDiv.append(newLabel);\n \n let newSelect;\n i++;\n\n switch(key) {\n case 'TeamId':\n // Do nothing\n break;\n\n case 'League':\n // Do nothing\n break;\n\n case 'MaxTeamMembers': {\n newSelect = $(\"<select>\", {class: \"form-control\",\n id: \"modal-\" + key + \"-\" + list.TeamId,\n name: key.toLowerCase(),\n required: \"true\"});\n\n newDiv.append(newSelect);\n\n for(let i = 2; i <= 8; i++) {\n let teamSize = $(\"<option>\", {text: i, value: i});\n newSelect.append(teamSize);\n };\n break;\n }\n\n case 'MinMemberAge': {\n newSelect = $(\"<select>\", {class: \"form-control\",\n id: \"modal-\" + key + \"-\" + list.TeamId,\n name: key.toLowerCase(),\n required: \"true\"});\n\n newDiv.append(newSelect);\n\n for(let i = 13; i <= 100; i++) {\n let ageOption = $(\"<option>\", {text: i, value: i});\n newSelect.append(ageOption);\n };\n break;\n }\n\n case 'MaxMemberAge': {\n newSelect = $(\"<select>\", {class: \"form-control\",\n id: \"modal-\" + key + \"-\" + list.TeamId,\n name: key.toLowerCase(),\n required: \"true\"});\n\n newDiv.append(newSelect);\n\n for(let i = 13; i <= 100; i++) {\n let ageOption = $(\"<option>\", {text: i, value: i});\n newSelect.append(ageOption);\n };\n break;\n }\n\n case 'TeamGender':\n newDiv = $(\"<div>\", {class: \"form-check\"});\n\n let newInput = $(\"<input>\", {type: \"text\", \n class: \"form-control\", \n id: \"modal-\" + key + \"-\" + list.TeamId, \n name: key.toLowerCase(), \n value: list[key]});\n break;\n\n case 'Members':\n // Do nothing\n break;\n\n default: {\n let newInput = $(\"<input>\", {type: \"text\", \n class: \"form-control\", \n id: \"modal-\" + key + \"-\" + list.TeamId, \n name: key.toLowerCase(), \n value: list[key]});\n\n newDiv.append(newInput);\n break;\n }\n }\n }\n }\n}", "function response_in_modal(response) {\n $(\".modal-title\").html(response);\n $(\"#empModal\").modal(\"show\");\n}", "function show_modal_tags() {\n $.ajax({\n type: \"get\",\n url: \"api/tag/list\",\n success: function (response) {\n $(\"#modal_tags_body\").empty();\n\n $(\"#modal_tags_body\").append(\n `<table class=\"table table-light\">\n <tbody>\n ${\n Object.keys(response).map(function (key) {\n return `<tr>\n <td class=\"w-75\">\n <input class=\"form-control\" type=\"text\" name=\"\" value=\"${response[key].title}\" id=\"tag_title_${response[key].id}\">\n </td>\n <td class=\"w-25 mx-2 my-2\">\n <button type=\"\" button class=\"btn w-100 ${response[key].color}\"></button>\n </td>\n <td>\n <button type=\"button\" class=\"btn btn-sm btn-outline-success tag\" value=\"${response[key].id}\">\n <i class=\"fa fa-save\"></i>\n </button>\n </td>\n </tr>`;\n }).join(\"\")\n }\n </tbody>\n </table>\n `);\n\n $(\"#modal_tags\").modal();\n }\n });\n}", "function renderizarLista(listaNotebooks, marca) {\n // creo lista secundaria para mostrar productos por marca\n let listaSecundaria = [];\n\n $(\".main__articles\").empty();\n\n listaSecundaria = pushListaSecundaria(listaNotebooks, listaSecundaria, marca);\n\n for (let notebook of listaSecundaria) {\n $(\".main__articles\").append(`\n <article id=\"producto${notebook.id}\" class=\"col-md-3 col-6 text-center\">\n <div class=\"card__notebook card\" style=\"width: auto\">\n <img\n src=\"${notebook.img}\"\n class=\"img__notebook card-img-top\"\n alt=\"\"\n height=\"160\"\n />\n <div class=\"card-body\">\n <h5 class=\"card-title m-0\">${notebook.marca}</h5>\n <h6 class=\"card-text\">${notebook.modelo} </h6>\n <p class=\"card-text\">$${notebook.precio}</p>\n\n <!-- Button trigger modal -->\n <button\n id=\"btnMas${notebook.id}\"\n type=\"button\"\n class=\"btn btn-outline-primary mb-1\"\n data-bs-toggle=\"modal\"\n data-bs-target=\"#exampleModal${notebook.id}\"\n >\n Ver mas\n </button>\n\n <button id=\"btnCarrito${notebook.id}\" class=\"btn btn-outline-primary mb-1\">\n Carrito\n </button>\n </div>\n </div>\n\n <!-- Modal de caracteristicas del producto -->\n <div\n class=\"modal fade\"\n id=\"exampleModal${notebook.id}\"\n tabindex=\"-1\"\n aria-labelledby=\"exampleModalLabel\"\n aria-hidden=\"true\"\n >\n <div class=\"modal-dialog modal-dialog-centered\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h5 class=\"modal-title\" id=\"exampleModalLabel\">\n Caracteristicas:\n </h5>\n <button\n type=\"button\"\n class=\"btn-close\"\n data-bs-dismiss=\"modal\"\n aria-label=\"Close\"\n ></button>\n </div>\n\n <div class=\"modal-body row text-start\">\n <div class=\"col-md-6 col-12\">\n <ul>\n <li>Marca: ${notebook.marca}</li>\n <li>Modelo: ${notebook.modelo}</li>\n <li>Procesador: ${notebook.procesador}</li>\n <li>Pantalla: ${notebook.pulgadas}\"</li>\n <li>RAM: ${notebook.ram}GB</li>\n <li>SSD: ${notebook.rom}GB</li>\n <li>Placa de video: ${notebook.video}</li>\n <li>Precio: $${notebook.precio}</li>\n </ul>\n </div>\n\n <div class=\"col-md-6 col-12\">\n <div\n id=\"carouselExampleIndicators${notebook.id}\"\n class=\"carousel slide\"\n data-bs-ride=\"carousel\"\n >\n <div class=\"carousel-indicators\">\n <button\n type=\"button\"\n data-bs-target=\"#carouselExampleIndicators${notebook.id}\"\n data-bs-slide-to=\"0\"\n class=\"active\"\n aria-current=\"true\"\n aria-label=\"Slide 1\"\n ></button>\n <button\n type=\"button\"\n data-bs-target=\"#carouselExampleIndicators${notebook.id}\"\n data-bs-slide-to=\"1\"\n aria-label=\"Slide 2\"\n ></button>\n <button\n type=\"button\"\n data-bs-target=\"#carouselExampleIndicators${notebook.id}\"\n data-bs-slide-to=\"2\"\n aria-label=\"Slide 3\"\n ></button>\n </div>\n <div class=\"carousel-inner\">\n <div class=\"carousel-item active\">\n <img\n src=\"${notebook.img}\"\n class=\"d-block w-100\"\n alt=\"\"\n />\n </div>\n <div class=\"carousel-item\">\n <img\n src=\"${notebook.img}\"\n class=\"d-block w-100\"\n alt=\"\"\n />\n </div>\n <div class=\"carousel-item\">\n <img\n src=\"${notebook.img}\"\n class=\"d-block w-100\"\n alt=\"\"\n />\n </div>\n </div>\n <button\n class=\"carousel-control-prev\"\n type=\"button\"\n data-bs-target=\"#carouselExampleIndicators${notebook.id}\"\n data-bs-slide=\"prev\"\n >\n <span\n class=\"carousel-control-prev-icon\"\n aria-hidden=\"true\"\n ></span>\n <span class=\"visually-hidden\">Previous</span>\n </button>\n <button\n class=\"carousel-control-next\"\n type=\"button\"\n data-bs-target=\"#carouselExampleIndicators${notebook.id}\"\n data-bs-slide=\"next\"\n >\n <span\n class=\"carousel-control-next-icon\"\n aria-hidden=\"true\"\n ></span>\n <span class=\"visually-hidden\">Next</span>\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </article>`);\n\n // para enviar notebooks al carrito\n $(`#btnCarrito${notebook.id}`).click(() => {\n carrito.push(new Producto(notebook, crearNumeroAleatorio()));\n\n console.log(carrito);\n\n agregarNumeroAlCarrito();\n\n guardarProductosLocalStorage();\n });\n\n leerCheckboxDarkLightMode();\n }\n}", "function generateModal(speaker){\n const name = speaker.slice(1,speaker.length);\n const user = data.find(item => item.id === name.toLowerCase());\n\n const baseTemplate = `<div class=\"modal fade\" id=\"${name}\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"exampleModalLabel\" aria-hidden=\"true\">\n <div class=\"modal-dialog modal-lg\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-body\">\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n <div class=\"row\">\n <div class=\"col-lg-6 modal-left modal-content\">\n <div class=\"speaker-header row\">\n <div class=\"col-4 speaker-avatar\">\n <img src=\"${static_url}/images/${user.id}.jpg\" class=\"img-fluid rounded-circle\" />\n </div>\n <div class=\"col-8 speaker-info\">\n <h2 class=\"speaker-name\">${user.name}</h2>\n <h3 class=\"speaker-company\">${user.company}</h3>\n <h3 class=\"speaker-place\">${user.place}</h3>\n </div>\n </div>\n <p class=\"speaker-description\"> ${user.description} </p>\n <ul class=\"speaker-medias list-inline\">\n ${generateIcons(user.socials)}\n </ul>\n </div>\n <div class=\"col-lg-6 modal-right modal-portfolio\">\n <div class=\"row no-gutters\">\n <div class=\"col-12\">\n <img src=\"${static_url}/images/${user.id}/1.jpg\" class=\"img-fluid\" />\n </div>\n </div>\n <div class=\"row no-gutters\">\n <div class=\"col-6\">\n <img src=\"${static_url}/images/${user.id}/2.jpg\" class=\"img-fluid\" />\n </div>\n <div class=\"col-6\">\n <img src=\"${static_url}/images/${user.id}/3.jpg\" class=\"img-fluid\" />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>`;\n let e = document.createElement('div');\n e.innerHTML = baseTemplate;\n let speakerModal = document.querySelector('#speaker-modal');\n speakerModal.appendChild(e);\n}", "function processRecipe(body) {\n\t\tvar i;\n\t\tvar modal = document.getElementById('myModal');\n\t\t\n\t\tmodal.style.display = \"block\";\t\n\t\t\n\t\twindow.onclick = function(event) {\n\t\t\tif (event.target == modal) {\n\t\t\t\tmodal.style.display = \"none\";\n\t\t\t}\n\t\t}\n\t\n let recipeImage = body['images'][0].hostedLargeUrl;\n let imageNode = document.createElement(\"img\"); \n imageNode.src = recipeImage;\n\t\timageNode.setAttribute(\"id\", \"srcImg\");\n\t\t$('#selectedRecipe').empty();\n selectedRecipe.append(imageNode); \n selectedRecipe.append(\"<h4>\" + body['name'] + \"</h4>\");\n selectedRecipe.append(\"<p id='ing'> Ingredients: </p>\");\n\t\t\n\t\tfor (i = 0; i < body['ingredientLines'].length; i++) {\n\t\t\tselectedRecipe.append(\"<ul><li id='items'>\" + body['ingredientLines'][i] + \"</li></ul>\");\n\t\t}\n }", "function addZHierarchy() {\n var modalScope = $rootScope.$new();\n // passing parameter into modal view\n modalScope.isModal = true;\n modalScope.modalInstance = $modal.open({\n templateUrl: '/app/features/zHierarchy/zHierarchyItem.html',\n controller: 'zHierarchyItemController as vm',\n size: 'lg',\n scope: modalScope, // <- This is it!\n //resolve: {\n // isModal: true\n //}\n });\n\n modalScope.modalInstance.result.then(function (newZHierarchy) {\n\n if (newZHierarchy) {\n vm.zHierarchys.push(newZHierarchy);\n vm.selectedZHierarchy = vm.zHierarchys[vm.zHierarchys.length - 1].zHierarchyID;\n vm.allDataType.zHierarchyID = vm.selectedZHierarchy;\n vm.isSaving = false;\n vm.hasChanges = true;\n }\n\n }, function () {\n //$log.info('Modal dismissed at: ' + new Date());\n });\n\n }", "function Modal(employees){\n this.employees = [];\n this.modalHTML;\n}", "function showCustomGreeting() {\n $mdDialog.show({\n clickOutsideToClose: true,\n scope: $scope, // use parent scope in template\n preserveScope: true, // do not forget this if use parent scope\n // Since GreetingController is instantiated with ControllerAs syntax\n // AND we are passing the parent '$scope' to the dialog, we MUST\n // use 'vm.<xxx>' in the template markup\n template: '<md-dialog layout-padding flex=\"95\">'+\n ' <md-dialog-content>'+\n ' <div>'+\n ' <h4>Booking {{bookingResource}}</h4>'+\n ' </div>'+\n ' <div layout=\"row\">'+\n ' <span flex=\"20\">{{ weekDates[bookingDayId] }} {{ bookingData.slots[bookingSlotId].name }}</span>'+\n ' <md-button ng-click=\"showNewQueue()\" class=\"md-raised\">Queue</md-button>'+\n ' </div>'+\n ' <div data-ng-repeat=\"t in bookingData.unitTypes\" layout=\"row\">'+\n ' <span class=\"showMachineAvailable\" flex=\"20\">{{ t.name }}</span>'+\n ' <span data-ng-repeat=\"u in t.units\">'+\n ' <span ng-show=\"isBookable(t, u)\">'+\n ' <md-checkbox ng-model=\"bookingEdit.type[t.typeId][u.unitId]\">{{ u.name }}</md-checkbox>'+\n ' </span>'+\n ' </span>'+\n ' </div>'+\n ' <div layout=\"row\">'+\n ' <span class=\"sendReminderVia\" flex=\"20\">Send reminder via</span>'+\n ' <md-checkbox ng-model=\"bookingEdit.medium[1]\">email</md-checkbox>'+\n ' <md-checkbox ng-model=\"bookingEdit.medium[2]\">sms</md-checkbox>'+\n ' </div>'+\n ' <div>'+\n ' <md-checkbox ng-model=\"bookingEdit.time[4]\">10 min</md-checkbox>'+\n ' <md-checkbox ng-model=\"bookingEdit.time[8]\">30 min</md-checkbox>'+\n ' <md-checkbox ng-model=\"bookingEdit.time[16]\">1 hour</md-checkbox>'+\n ' <md-checkbox ng-model=\"bookingEdit.time[64]\">5 hours</md-checkbox>'+\n ' <md-checkbox ng-model=\"bookingEdit.time[256]\">1 day</md-checkbox>'+\n ' <md-checkbox ng-model=\"bookingEdit.time[2048]\">1 week</md-checkbox>'+\n ' BEFORE BOOKING DATE'+\n ' </div>'+\n ' <div>'+\n ' <md-button ng-click=\"setBooking()\" class=\"md-raised md-primary\">Confirm booking</md-button>'+\n ' <md-button ng-click=\"clearBooking()\" class=\"md-warn\">Delete</md-button>'+\n ' </div>'+\n ' </md-dialog-content>'+\n '</md-dialog>',\n controller: function DialogController($scope, $mdDialog) {\n $scope.closeDialog = function() {\n $mdDialog.hide();\n }\n }\n });\n }", "function showAddItemModal(worklist) {\n var modalInstance = $modal.open({\n templateUrl: 'app/worklists/template/additem.html',\n controller: 'WorklistAddItemController',\n resolve: {\n worklist: function() {\n return worklist;\n },\n valid: function() {\n var board = $scope.board;\n return function(item) {\n var valid = true;\n angular.forEach(board.worklists, function(list) {\n angular.forEach(list.items, function(listItem) {\n var type = item.type.toLowerCase();\n if (item.value === listItem.id &&\n type === listItem.type) {\n valid = false;\n }\n });\n });\n return valid;\n };\n }\n }\n });\n\n return modalInstance.result;\n }", "function InitSaveModal() {\n let content = \"\";\n\n for(let item of currentAnniversary){\n if(item.date == dateChoice) content += \"<i class='fa fa-user-circle-o' aria-hidden='true'></i> \"+item.name+\" </br>\"; \n }\n\n if(content === \"\") content = \"<h6 class='card-title'> <i class='fa fa-exclamation-triangle fa' aria-hidden='true'></i> Aucun anniversaire trouvé </h6>\";\n else $('#pills-data-tab').tab('show');\n \n $( \"#pills-data\").append(content);\n}", "function _showModal(ev) {\n let annoData = newAnnotationService.defusekify(model.edit, true);\n let fragment = annoData.fragment;\n let subject = annoData.subject;\n\n model.docUrl = annoData.url;\n\n // Configura il modale e poi mostralo\n $mdDialog.show({\n controller: DialogController,\n controllerAs: 'dialog',\n //Deps, part.1\n bindToController: {\n fragment: fragment,\n subject: subject,\n annoData: annoData\n }, //Deps\n templateUrl: 'js/modules/editAnnotation/editAnnotationModal.tmpl.html',\n parent: angular.element(document.body),\n fullscreen: true,\n targetEvent: ev,\n //Deps, part.2\n fragment: fragment,\n subject: subject,\n annoData: annoData,\n //Deps\n userService: userService,\n clickOutsideToClose: true\n })\n .then(function(answer) {\n model.status = 'You said the information was \"' + answer + '\".';\n }, function() {\n model.status = 'You cancelled the dialog.';\n });\n }", "function renderModalSearchRecipe (recipes) {\n\n globalRecipe = []\n\n let edamamApiRecipe = {\n\n name: recipes.hits[0].recipe.label,\n\n calories: recipes.hits[0].recipe.calories,\n\n healthLabels: recipes.hits[0].recipe.healthLabels,\n\n source: recipes.hits[0].recipe.source,\n\n sourceUrl: recipes.hits[0].recipe.url,\n\n imgUrl: recipes.hits[0].recipe.image,\n\n ingredients: recipes.hits[0].recipe.ingredientLines,\n\n yield: recipes.hits[0].recipe.yield\n\n }\n\n globalRecipe.unshift(edamamApiRecipe)\n\n let ingredientsFormattedList = renderIngredient(edamamApiRecipe.ingredients)\n\n let preDbRecipeModal = (`\n\n <div class='modal modal-transparent fade tempModal' tabindex='-1' role='dialog' id='recipeModal'>\n\n <div class='modal-dialog'>\n\n <div class='recipe' data-recipe-id=''>\n\n <div class='col-md-12 recipeBox'>\n\n <div class='col-md-5 thumbnail'>\n\n <img src='${edamamApiRecipe.imgUrl}' alt='recipe image'>\n\n </div>\n\n <div class='col-md-6 caption'>\n\n <h4 class='inline-header'><strong>${edamamApiRecipe.name}</strong></h4>\n\n <p>via<a href='${edamamApiRecipe.sourceUrl}'> ${edamamApiRecipe.source}</a></p>\n\n <h4 class='inline-header'><strong>Ingredients:</strong></h4>\n\n <ul>${ingredientsFormattedList}</ul>\n\n <h4 class='inline-header'><strong>Yield:</strong></h4>\n\n <ul>${edamamApiRecipe.yield}</ul>\n\n <div class='bottom-align-buttons'>\n\n <button type='button' class='btn btn-primary add-recipe'><span class='icon'><i class='fa fa-plus'></i></span> Add This Recipe</button>\n\n <button type='button' class='btn btn-danger close-recipe'><span class='icon'><i class='fa fa-trash-o'></i></span> Not This Recipe</button>\n\n </div>\n\n </div>\n\n </div>\n\n </div>\n\n </div>\n\n </div>\n\n `)\n\n $('#modals').prepend(preDbRecipeModal)\n\n $('#recipeModal').modal('show')\n\n}", "function addModalRows(dataArr) {\n $.each(dataArr, function(idx, elem) {\n $('#submit-results tbody').append('<tr><td>'+elem.serial_num+'</td>'+\n '<td>'+elem.item_type+'</td></tr>');\n });\n }", "function addAnotherRowMatrixPopup(new_rows) {\r\n\tif (new_rows == null) new_rows = 1;\r\n\tvar originalRow = $('.addFieldMatrixRow:first').html();\r\n\tvar html = \"\";\r\n\tfor (var k = 1; k <= new_rows; k++) {\r\n\t\thtml += \"<tr class='addFieldMatrixRow'>\"+originalRow+\"</tr>\";\r\n\t}\r\n\t// Add row to dialog\r\n\t$('.addFieldMatrixRowParent').append(html);\r\n\t// Reset dialog height (if needed)\r\n\tfitDialog($('#addMatrixPopup'));\r\n}", "function cargarmodal_descripcion_lineas_sublineas(elemento){\n var $fila = $(elemento);\n var desc= $fila.attr(\"data-infodescripcionsublinea\"); \n $('#descripcion-sublinea').html(desc);\n\n\n var estado= $fila.attr(\"data-infoestado\"); \n $('#estado-sublinea').html(estado);\n\n\n var nombre= $fila.attr(\"data-infonombre\"); \n $('#myModalLabel').html(nombre);\n \n}", "function createModal(users) {\r\n\tconst modalContainer = document.getElementsByClassName(`modal-container`)[0];\r\n\tusers.forEach((user, i) => {\r\n\t\tconst div = document.createElement(`div`);\r\n\t\tconst html = modalHTML(user);\r\n\t\tdiv.className = `modal`;\r\n\t\tdiv.innerHTML += html;\r\n\t\tmodalContainer.appendChild(div);\r\n\t\tnextPrevButtonHandlers(users, i);\r\n\t});\r\n}", "function cloneProjectModal() {\n var modalInstance = $uibModal.open({\n animation: true,\n templateUrl: 'js/app/views/modules/create-project-modal.html',\n size: 'sm',\n controller: function (choosedProject, $scope, $uibModalInstance) {\n console.log(\"Choosed\", choosedProject);\n // deleção de dados\n $scope.temporalFilterProject = angular.copy(choosedProject);\n delete $scope.temporalFilterProject.biome_name;\n delete $scope.temporalFilterProject.modified;\n delete $scope.temporalFilterProject.created;\n $scope.temporalFilterProject.project_name = $scope.temporalFilterProject.project_name + ' - Copy';\n $scope.temporalFilterProject.active = false;\n\n \n // open modal\n $scope.ok = function (temporalFilterProject) {\n TemporalFilterProjectService.clone(temporalFilterProject, function (result) { \n // adiciona a lista de opções de projeto\n vm.temporalFilterProjectOptions.unshift(result);\n // após criado ele será selecionado\n vm.tfProjectChoosed = result.TemporalFilterProject;\n // redefine a paginação ao deletar elemento\n //\n $uibModalInstance.close(result);\n })\n };\n // close modal\n $scope.cancel = function () {\n $uibModalInstance.close(false);\n };\n },\n resolve: {\n choosedProject: function () {\n return vm.tfProjectChoosed;\n },\n }\n });\n\n modalInstance.result.then(function (result) {\n /**\n * true: created\n * false: canceled\n */\n if (result) {\n Notify.success(\"Project copy successfuly created!\");\n chooseTFProject(result.TemporalFilterProject);\n }\n })\n }", "function okPressed() {\n vm.specimens.push(createSpecimen());\n $uibModalInstance.close(vm.specimens);\n }", "function showModalComments() {\n let template = $('#commentsTemplates');\n let pjtId = $('.version_current').attr('data-project');\n\n $('.invoice__modalBackgound').fadeIn('slow');\n $('.invoice__modal-general').slideDown('slow').css({ 'z-index': 401 });\n $('.invoice__modal-general .modal__body').append(template.html());\n $('.invoice__modal-general .modal__header-concept').html('Comentarios');\n closeModals();\n fillComments(pjtId);\n}", "function insertModalMovies(div) {\n for (let i = 0; i < movies.length; i++) {\n const modalMoviesSection = `\n <img\n src=\"${movies[i].imageSource}\"\n alt=\"${movies[i].alt}\">\n <div class=\"carousel-caption d-md-block\">\n <p>${moviesCaption[i].caption}</p>\n </div>\n `;\n\n div[i].insertAdjacentHTML('beforeend', modalMoviesSection);\n\n\n }\n}", "function showModal() {\n\n $('#myModal').modal(\"show\");\n $(\".modal-title\") .text(data.name)\n $(\".modal-li-1\") .text(\"Accuracy: \" + data.accuracy)\n $(\".modal-li-2\").text(\"PP: \" + data.pp)\n $(\".modal-li-3\").text(\"Power: \" + data.power)\n $(\".modal-li-4\").text(\"Type: \" + data.type.name)\n $(\".modal-li-5\").text(\"Priority: \" + data.priority)\n \n }", "function openModal(type) {\n\t$('#modal').modal('show');\n\tvar arr = [\n\t{\n \t\tname : 'L',\n \t\tattributes: \"<p>Lions are the only cats that live in groups. A group, or pride, can be up to 30 lions, depending on how much food and water is available. Female lions are the main hunters. While they’re out looking for food, the males guard the pride’s territory and their young. </p>\"\n\t\n\t},\n\t{\n \t\tname : 'E',\n \t\tattributes: \"<p>Elephants belong to the mammal family, which means that they have hair, give birth to live young, and feed their babies milk. They have large, thin ears that are used to help cool them down, and have long, powerful trunks. </p>\"\n\t},\n\t{\n \t\tname : 'F',\n \t\tattributes: \"<p>Frogs are amphibians. They can be found near water but prefer ponds, lakes, and marshes. You will not find any in Antarctica. They lay eggs called Frog Spawn. Their eggs hatch into tadpoles. A group of frogs is called an army. </p>\"\n\t},\n\t{\n \t\tname : 'B',\n \t\tattributes: \"<p>Koalas are not bears. The dawn bear was the first bear. In the north, bears sleep in the winter, but they don't hibernate. Bears are related to walruses, seals and sea lions. Bears can see color. Not all mammals can. Giant Panda are classified as a bear. </p>\"\n\t},\n\t{\n \t\tname : 'M',\n\t\tattributes: \"<p>There are currently 264 known monkey species. Monkeys can be divided into two groups, Old World monkeys that live in Africa and Asia, and New World monkeys that live in South America. A baboon is an example of an Old World monkey, while a marmoset is an example of a New World monkey. </p>\"\n\t},\n\n\t{\n \t\tname : 'H',\n \t\tattributes: \"<p>Hippo's Cannot Swim. Shocking! They Have Incredibly Sensitive Skin. They Cannot Breathe Underwater. Hippos Are Territorial – But Only In Water. They Are Not Big Eaters. Hippos Have A British Connection. </p>\"\n\t},\n\t]; \n\n \n// This code ensures that any data is removed and variables are empty, after a selection has been made.\n\n\tvar obj = arr.find(function(data) {\n\t\treturn data.name === type;\n\t});\n\t$('#inputData').html('');\n\t$('#inputData').html(obj.attributes);\n \n}", "function myPopupFunction(data,idtodelete) {\n // var popupid=\"myPopup\"+idtodelete;\n // var popup = document.getElementById(popupid);\n //popup.innerHTML = data;\n // $(document.getElementById(\"myModal2text\")).= \"fAILURE sORRY\";\n\n // $(\"myModal2text\").append$(\"Very Bad\");\n\n //$(document.getElementById(\"myModal2\")).click(function () { });\n //$(document.getElementById(\"myModal2text\")).html=\n var x = document.getElementById(\"myModal2text\");\n var displaytext = data.Status + \"!<br>\" + data.ExceptionDetails+\"\";\n x.innerHTML =displaytext;\n $('#myModal2').modal();\n}", "function showModal(i) {\n const body = document.querySelector(\"body\");\n\n const modal = `\n<div class=\"modal-container\">\n <div class=\"modal\">\n\n <button type=\"button\" id=\"modal-close-btn\" class=\"modal-close-btn\"><strong>X</strong></button>\n <div class=\"modal-info-container\">\n <img class=\"modal-img\" src=${\n employeeList[i].picture.large\n } alt=\"profile picture\">\n <h3 id=\"name\" class=\"modal-name cap\">${\n employeeList[i].name.first\n } ${employeeList[i].name.last}</h3>\n <p class=\"modal-text\">${employeeList[i].email}</p>\n <p class=\"modal-text cap\">${\n employeeList[i].location.city\n }</p>\n <hr>\n <p class=\"modal-text\">${formatPhoneNumber(\n employeeList[i].cell\n )}</p>\n \n <p class=\"modal-text\">${\n employeeList[i].location.street.number\n } ${employeeList[i].location.street.name} ${\n employeeList[i].location.state\n }, ${employeeList[i].location.country} ${\n employeeList[i].location.postcode\n }</p>\n <p class=\"modal-text\">${employeeList[i].dob.date.slice(\n 5,\n 7\n )}/${employeeList[i].dob.date.slice(\n 8,\n 10\n )}/${employeeList[i].dob.date.slice(2, 4)} </p>\n </div>\n </div>`;\n body.insertAdjacentHTML(\"afterbegin\", modal);\n modalRemove();\n}", "function showModal(item) {\n //create element for dog name\n var subBreedElement = $('.subbreeds');\n var imageElement = $('.dog-img');\n imageElement.attr('src', item.imageURL);\n if (item.subBreeds.length === 0) {\n var Element = $('<p>No sub-breeds</p>');\n subBreedElement.append(Element)\n } else {\n for (var i = 0; i < item.subBreeds.length; i++) {\n var element = $(`<li>${item.subBreeds[i]}</li>`);\n subBreedElement.append(element)\n\n }\n }\n $modalContainer.addClass('is-visible');\n}", "function openModal(i) {\n modal.style.display = 'block';\n pageBody.style.overflow = 'hidden';\n wrapper.className = 'modal-wrapper' + ' ' + injectableContent[i].className;\n wrapper.innerHTML = injectableContent[i].innerHTML;\n style = window.getComputedStyle(injectableContent[i]);\n modalColor = style.getPropertyValue('color');\n wrapper.style.color = modalColor;\n}", "function _openGenericModal(configs) {\n var deferred = $q.defer();\n var editorInstance = $modal.open({\n animation: true,\n windowClass: configs.windowClass || 'modal-fullwindow',\n templateUrl: configs.templateUrl,\n controller: configs.controller\n });\n editorInstance.result.then(function (bundle) {\n deferred.resolve(bundle);\n });\n return deferred.promise;\n }", "function displayList(arr) {\n\tvar i;\n\tvar out = '';\n\t\n\tfor (i = 0; i < arr.length; i++) {\n\t\tout += \n\t\t'<div class=\"activity-item container\">' + \n\t\t\t'<div ng-app=\"croppy\"><img src=\"' + arr[i].image + '\" width=\"70\" height=\"70\" alt=\"thumbnail\"></div>' + \n\t\t\t'<h2>' + arr[i].name + '</h2>' + \n\t\t\t'<em>' + arr[i].date + '</em>' + \n\t\t\t'<a href=\"#\" onclick=\"toggle(\\'' + arr[i].id + '\\')\" class=\"activity-item-toggle\" style=\"font-size:18px;\">+</a>' + \n\t\t\t'<div id=\"selected' + arr[i].id + '\" class=\"activity-item-detail\">' + \n\t\t\t\t'<table style=\"width:100%\">' + \n\t\t\t\t\t'<tr>' + \n\t\t\t\t\t\t'<td><a href=\"#\" onclick=\"viewImage(\\'' + arr[i].image + '\\')\"><i class=\"fa fa-picture-o\"></i> View image</a></td>' + \n\t\t\t\t\t\t'<td><a href=\"#\" onclick=\"sync(\\'' + arr[i].id + '\\')\"><i class=\"fa fa-refresh\"></i> Sync</a></td>' + \n\t\t\t\t\t'</tr>' + \n\t\t\t\t\t'<tr>' + \n\t\t\t\t\t\t'<td><a href=\"#\" onclick=\"drawing(\\'' + arr[i].image + '\\', \\'' + arr[i].id + '\\')\"><i class=\"fa fa-pencil\"></i> Create drawing</a></td>' + \n\t\t\t\t\t\t'<td><a href=\"#\" onclick=\"removePatient(\\'' + arr[i].id + '\\')\"><i class=\"fa fa-trash\"></i> Delete</a></td>' + \n\t\t\t\t\t'</tr>' +\n\t\t\t\t\t'<tr>' + \n\t\t\t\t\t\t'<td><a href=\"#\" onclick=\"drawingsScores(\\'' + arr[i].id + '\\')\"><i class=\"fa fa-bar-chart\"></i> View drawings and scores</a></td>' + \n\t\t\t\t\t\t'<td><a href=\"#\"><i class=\"fa fa-times\"></i> Close</a></td>' + \n\t\t\t\t\t'</tr>' + \n\t\t\t\t'</table>' + \n\t\t\t'</div>' + \n\t\t'</div>' + \n\t\t'<div class=\"border\"></div>';\n\t}\n\t\n\tdocument.getElementById(\"list\").innerHTML = out;\n}", "function MandaMessaggioInserimento(testo) {\n jQuery(\"#testo-modal\").html(testo);\n jQuery(\"#modal-accettazione\").modal(\"toggle\");\n}", "function generateHTML(data) {\n data.results.map( (person,index, arrayObj) => {\n const card = document.createElement('div');\n gallery.appendChild(card);\n card.classList = 'card';\n card.innerHTML = `\n <div class=\"card-img-container\">\n <img class=\"card-img\" src= \"${person.picture.large}\" alt=\"profile picture\">\n </div>\n <div class=\"card-info-container\">\n <h3 id=\"name\" class=\"card-name cap\">${person.name.first} ${person.name.last}</h3>\n <p class=\"card-text\">${person.email}</p>\n <p class=\"card-text cap\">${person.location.city}, ${person.location.state}</p>\n </div> `\n\n card.addEventListener('click', ()=>\n {\n generateModalContainer(person, index, arrayObj);\n })\n\n });\n \n }" ]
[ "0.6061549", "0.58335304", "0.58166134", "0.5811624", "0.578494", "0.5757101", "0.5742959", "0.570838", "0.5663189", "0.56211245", "0.5596041", "0.5588401", "0.54677236", "0.5465394", "0.54587", "0.54462504", "0.54451334", "0.5438785", "0.5438256", "0.5418066", "0.5408251", "0.5399212", "0.5387084", "0.53839904", "0.5381821", "0.53610295", "0.5360278", "0.53374887", "0.53216827", "0.53209597", "0.5317313", "0.5312703", "0.52975726", "0.5293775", "0.5281969", "0.5279852", "0.52710176", "0.5270135", "0.52683985", "0.526657", "0.525137", "0.5248512", "0.52479535", "0.52479327", "0.52447104", "0.5236041", "0.5232878", "0.52263594", "0.5223394", "0.5222379", "0.522083", "0.52144015", "0.5208528", "0.5203311", "0.5174838", "0.517345", "0.5171515", "0.5158441", "0.51526284", "0.51488364", "0.5141084", "0.5135847", "0.5131479", "0.5121279", "0.51108134", "0.51084125", "0.5100874", "0.50989455", "0.5098016", "0.50932205", "0.50916195", "0.5091395", "0.5089757", "0.5084804", "0.5076307", "0.50751835", "0.506052", "0.50597566", "0.50593376", "0.5055255", "0.50551665", "0.50491124", "0.5047331", "0.5044246", "0.50325024", "0.5025093", "0.50242686", "0.5020241", "0.5019867", "0.5014006", "0.5009071", "0.50077903", "0.5004753", "0.50041485", "0.50016093", "0.4997791", "0.49974227", "0.49926996", "0.4992346", "0.49891123", "0.4988153" ]
0.0
-1
Fonction 11: Permet d'afficher le planning
function showPlanning() { $('#planning').empty(); let date_Target = []; for(let i = 0; i < 7; i++) { if(day+i <= 30) { if(day+i < 10) date_Target.push('0' +parseInt(day+i)+ '/0' +parseInt(month)+ '/' +parseInt(year)); else date_Target.push(parseInt(day+i)+ '/0' +parseInt(month)+ '/' +parseInt(year)); } else { date_Target.push('0' +parseInt(day + i - 30)+ '/0' +parseInt(month+1)+ '/' +parseInt(year)); } } let td_Morning_CLass = []; for(let i = 0; i < 7; i++) { if(day+i <= 30) { if(day+i < 10) td_Morning_CLass.push('0' +parseInt(day+i)+ '-0' +parseInt(month)+ '-' +parseInt(year)+ '-morning'); else td_Morning_CLass.push(parseInt(day+i)+ '-0' +parseInt(month)+ '-' +parseInt(year)+ '-morning'); } else { td_Morning_CLass.push('0' +parseInt(day + i - 30)+ '-0' +parseInt(month+1)+ '-' +parseInt(year)+ '-morning'); } } let td_Afternoon_Class = []; for(let i = 0; i < 7; i++) { if(day+i <= 30) { if(day+i < 10) td_Afternoon_Class.push('0' +parseInt(day+i)+ '-0' +parseInt(month)+ '-' +parseInt(year)+ '-afternoon'); else td_Afternoon_Class.push(parseInt(day+i)+ '-0' +parseInt(month)+ '-' +parseInt(year)+ '-afternoon'); } else { td_Afternoon_Class.push('0' +parseInt(day + i - 30)+ '-0' +parseInt(month+1)+ '-' +parseInt(year)+ '-afternoon'); } } let content = ''; content += `<thead> <tr> <th>&nbsp;</th> <th>${date_Target[0]}</th> <th>${date_Target[1]}</th> <th>${date_Target[2]}</th> <th>${date_Target[3]}</th> <th>${date_Target[4]}</th> </tr> </thead> <tbody> <tr> <td>9H</td> <td class="${td_Morning_CLass[0]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[1]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[2]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[3]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[4]} tab-cell-hour">&nbsp;</td> </tr> <tr> <td>10H</td> <td class="${td_Morning_CLass[0]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[1]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[2]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[3]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[4]} tab-cell-hour">&nbsp;</td> </tr> <tr> <td>11H</td> <td class="${td_Morning_CLass[0]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[1]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[2]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[3]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[4]} tab-cell-hour">&nbsp;</td> </tr> <tr> <td>12H</td> <td class="${td_Morning_CLass[0]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[1]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[2]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[3]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[4]} tab-cell-hour">&nbsp;</td> </tr> <tr> <td>13H</td> <td class="${td_Morning_CLass[0]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[1]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[2]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[3]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[4]} tab-cell-hour">&nbsp;</td> </tr> <tr> <td>14H</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>15H</td> <td class="${td_Afternoon_Class[0]} tab-cell-hour">&nbsp;</td> <td class="${td_Afternoon_Class[1]} tab-cell-hour">&nbsp;</td> <td class="${td_Afternoon_Class[2]} tab-cell-hour">&nbsp;</td> <td class="${td_Afternoon_Class[3]} tab-cell-hour">&nbsp;</td> <td class="${td_Afternoon_Class[4]} tab-cell-hour">&nbsp;</td> </tr> <tr> <td>16H</td> <td class="${td_Afternoon_Class[0]} tab-cell-hour">&nbsp;</td> <td class="${td_Afternoon_Class[1]} tab-cell-hour">&nbsp;</td> <td class="${td_Afternoon_Class[2]} tab-cell-hour">&nbsp;</td> <td class="${td_Afternoon_Class[3]} tab-cell-hour">&nbsp;</td> <td class="${td_Afternoon_Class[4]} tab-cell-hour">&nbsp;</td> </tr> <tr> <td>17H</td> <td class="${td_Afternoon_Class[0]} tab-cell-hour">&nbsp;</td> <td class="${td_Afternoon_Class[1]} tab-cell-hour">&nbsp;</td> <td class="${td_Afternoon_Class[2]} tab-cell-hour">&nbsp;</td> <td class="${td_Afternoon_Class[3]} tab-cell-hour">&nbsp;</td> <td class="${td_Afternoon_Class[4]} tab-cell-hour">&nbsp;</td> </tr> </tbody>` $('#planning').append(content); setTimeout(() => { showCLassroom(class_Selected); }, 500); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculatePlan() {\n // Check if user left the minutes blank\n if (minutes) {\n // Find fee value to origin from destiny\n const getFee = values.find(value => value.origem === origin && value.destino === destiny);\n\n if (getFee) {\n\n // Calculate value with and without plan\n let withoutPlan = minutes * getFee.valor;\n let withPlan = ((minutes - plan) * getFee.valor) * 1.10;\n\n // Conditional to not show negatives values \n if (withPlan < 0) {\n withPlan = 0;\n }\n\n // Save values with and without plan\n setWithPlan(withPlan.toFixed(2));\n setWithoutPlan(withoutPlan.toFixed(2));\n setCalculateState(true); // Show results\n } else {\n //Error\n setAlertError(true);\n setCalculateState(false);\n }\n } else {\n setMinutesBlank(true);\n }\n }", "_plan( ) {\n\n\t\t// initialize, or we will have problems planning multiple times\n\t\tObject.keys( this.stages ).forEach( s => { this.stages[s].next = []; } );\n\n\t\t// build out \"plan\". note we are pushing onto the * prereq's * next array\n\t\tObject.keys( this.stages ).forEach( s => {\n\t\t\tif( this.stages[s].prereqs.length > 0 ) {\n\t\t\t\tthis.stages[s].prereqs.forEach( (p,j) => { this.stages[p].next.push( s ); } );\n\t\t\t}\n\t\t} );\n\n\t\t// set flag, if it isn't already set\n\t\tif( ! this.planned ) { this.planned = true; }\n\n\t\t// note we still have to set this.stages[s].ready for stages with prereqs \n\t\t// before we can run again\n\n\t}", "function showPlan(plan) {\n removeCurrentPlanLayers();\n\n var planBounds = new L.LatLngBounds();\n function extendPlanBounds(latlng) { planBounds.extend(latlng) }\n\n for (var i = 0; i < plan.length; i++) {\n var step = plan[i]\n , type = step.type\n , gml = step.gml;\n if (type === undefined) continue;\n\n var latlng, layer = null;\n\n if (type == 'StartWalking' || type == 'FinishWalking') {\n latlng = getLatLngFromGmlPoint(gml);\n // TODO Este marker debería ser un chaboncito caminando =D\n layer = new L.Marker(latlng);\n extendPlanBounds(latlng);\n }\n else if (type == 'Board') {\n latlng = getLatLngFromGmlPoint(gml);\n var markerIcon = getMarkerIconForService(step.service);\n // TODO Este marker debería usar el markerIcon =D\n layer = new L.Marker(latlng);\n extendPlanBounds(latlng);\n }\n else if (type == 'Bus' || type == 'SubWay' || type == 'Street') {\n // TODO add path style\n // var pathStyle = getPathStyleForType(type);\n\n var latLngList = getLatLngListFromGml(gml);\n layer = new L.Polyline(latLngList, {color: 'red'});\n latLngList.forEach(extendPlanBounds);\n }\n else if (type == 'SubWayConnection') {\n // TODO do this\n // Code stolen from usig.MapaInteractivo.min.js\n// if (H.type == \"SubWayConnection\") {\n// switch (H.service_to) {\n// case\"Línea A\":\n// H.gml[1] = H.gml[1].replace(\"connection\", \"subwayA\");\n// break;\n// case\"Línea B\":\n// H.gml[1] = H.gml[1].replace(\"connection\", \"subwayB\");\n// break;\n// case\"Línea C\":\n// H.gml[1] = H.gml[1].replace(\"connection\", \"subwayC\");\n// break;\n// case\"Línea D\":\n// H.gml[1] = H.gml[1].replace(\"connection\", \"subwayD\");\n// break;\n// case\"Línea E\":\n// H.gml[1] = H.gml[1].replace(\"connection\", \"subwayE\");\n// break;\n// case\"Línea H\":\n// H.gml[1] = H.gml[1].replace(\"connection\", \"subwayH\");\n// break\n// }\n// G.addMarker(H.gml[1]);\n// G.addEdges(H.gml)\n// }\n }\n\n if (layer) {\n map.addLayer(layer);\n currentPlanLayers.push(layer);\n }\n } // for\n\n // Fits the plan on the map =D\n// map.fitBounds(planBounds);\n }", "function calculatePlan(actor) \n{\n var teamColor = actor.getKnowledge(\"team_color\");\n var otherFlag = teamColor == \"red\" ? flag_green.position : flag_red.position;\n var ownFlag = teamColor == \"red\" ? flag_red.position : flag_green.position;\n\n var planner = new Planner();\n var actionSet = [new MoveToFlagAction(teamColor, ownFlag), \n \t\t\t\t new MoveToFlagAction(teamColor, otherFlag),\n \t\t\t\t new ReloadAction(),\n \t\t\t\t new ShootAction()]\n\n var allActions = {}\n \tvar preconditionSet = []\n\tfor(var i = 0; i < actionSet.length; ++i) {\n\t\tvar action = actionSet[i]\n\t planner.addAction(action.precondition,\n\t action.postcondition,\n\t action.cost,\n\t action.perform, \n\t action.name);\n\n\t allActions[action.name] = action\n\t preconditionSet = preconditionSet.concat(action.preconditions)\n }\n\n //var tree = [\"[L3\",\"[S2\",\"s\",\"r\",\"[S4\",{\"enemy_in_range\":true},\"t\",\"[S2\",\"s\",\"r\",\"s\",\"[S2\",\"g\",\"r\"]\n //printTree(treeFromString(tree,0,allActions).root)\n\n testApproachRandom(10);\n //testApproachRandom(0, allActions, {\"made_points\" : true});\n}", "function enterPlanMode(){\n vm.permission.planMode = true;\n vm.permission.endHint = false;\n angular.copy(vm.model.data,vm.plan.current);\n\n for(var i = 0;i < vm.plan.current.length;i++)\n {\n vm.plan.current[i].id = i;\n vm.plan.current[i].isSelected = false;\n }\n\n angular.element('.plan-overlay').css('visibility','visible');\n\n }", "function addAnotherPlan() {\n const list = planList;\n for (const item of list) {\n item.visibility = \"hidden\";\n }\n setPlanList([\n ...list,\n {\n visibility: \"visible\",\n coins: [],\n characteristics: [],\n duration: \"1 m\",\n refund: 20,\n },\n ]);\n }", "function planProc (plan) {\n console.log (plan)\n // const scrollFoot = document.body.clientHeight - window.pageYOffset\n // window.scrollBy(0, scrollFoot)\n document.body.scrollIntoView(false)\n let textInput = document.querySelector('#text-input')\n if (plan === 0) textInput.value = 'Hello, I want to join an one hour class'\n else if (plan === 1) textInput.value = 'Hello, I want to join your courses on the month base'\n else textInput.value = 'Hello, I want to join your courses on the year base'\n}", "static planRoute () {\n return new NavComputer({\n route: sample(ROUTES),\n invert: sample([true, false])\n })\n }", "get plan() {\n\t\treturn this.__plan;\n\t}", "function avancer_polygone() {\n\n\tfor (var p = 0; p<18; p++) {\n\n\t\tpolygone[p][1] = polygone[p][1] + vitesse_ver_route;\t\t/* on fait avancer le point verticalement */\n\n\t\tif (polygone[p][1] > 100) {\t\t\t\t/* test : si le point est sorti en bas de l'écran, on le redessine en haut */\n\t\t\tvitesse_lat_route = vitesse_lat_route + Math.floor(3*Math.random())/10 - 0.1;\n\t\t\tif (vitesse_lat_route > 1 || vitesse_lat_route < -1) {\n\t\t\t\tvitesse_lat_route = 0;\t\t\t/* rétroaction négative pour éviter une trop grande difficulté */\n\t\t\t}\n\t\t\tif (xroute+vitesse_lat_route <0 \n\t\t\t\t|| xroute+vitesse_lat_route+largeur > 100) {\n\t\t\t\t\tvitesse_lat_route = -vitesse_lat_route;\t\t/* pour faire tourner la route dans l'autre sens si on atteind le bord */\n\t\t\t}\n\t\t\txroute = xroute + vitesse_lat_route;\n\t\t\tpolygone[p][0] = xroute;\n\t\t\tpolygone[p][1] = polygone[p][1] % 100;\n\t\t\tpremierpoint = p;\n\t\t}\n\t}\n\n}", "function planTripOrShowPlaces() {\n if (directions.destination ||\n UserPreferences.getPreference('tourMode') === 'tour') {\n showPlaces(false);\n planTrip();\n } else {\n clearItineraries();\n showPlaces(true);\n exploreControl.getNearbyPlaces();\n }\n }", "function gereTourCombat() {\r\n // SI tourJoueur1 = 0 au départ TOUR JOUEUR 1\r\n if(tourJoueur1 < 1) { // tourJoueur1 vaut 0 au début\r\n joueur2.passeSonTourAu(joueur1); // Change le texte de MON TOUR dans l'ATH des joueurs en OUI ou NON\r\n AttaqueOuDefense(); // Demande au joueur 2 de choisir si il attaque ou se défend\r\n tourJoueur1++; // mais il vaudra 1 pour la fonction et pour passer de tour\r\n } else {\r\n joueur1.passeSonTourAu(joueur2);\r\n AttaqueOuDefense();\r\n tourJoueur1--;\r\n }\r\n}", "function calculatePlan()\n\t{\n\t\t// set data to object\n\t\tvar data = {\n\t\t\torigin: $('#origin').val(),\n\t\t\tdestiny: $('#destiny').val(),\n\t\t\tminutes: $('#minutes').val(),\n\t\t\tplan: $('#plan').val()\n\t\t}\n\n\t\t// Valid data\n\t\tif (data.origin == \"\" || data.destiny == \"\" || data.minutes == \"\" || data.plan == \"\")\n\t\t\treturn;\n\n\t\t// Send Request \n\t\t$.ajax({\n\t\t url: \"api/plan/calculate\",\n\t\t type: \"POST\",\n\t\t data: data,\n\t\t}).done(function(response) {\n\t\t\t// Init variables\n\t\t\tvar with_plan = \"Chamada não inclusa no Plano\";\n\t\t\tvar without_plan = \"-\";\n\n\t\t\t// Valid response\n\t\t\tif (typeof response.price !== 'undefined') {\n\t\t\t\twithout_plan = \"R$ \" + response.price;\n\t\t\t} else {\n\t\t\t\twith_plan = \"R$ \" + response.with_plan;\n\t\t\t\twithout_plan = \"R$ \" + response.without_plan;\n\t\t\t}\n\n\t\t\t// Set data in view\n\t\t\t$('.plan-result').text(with_plan);\n\t\t\t$('.without-plan-result').text(without_plan);\n\t\t});\n\t}", "function clear(){\n vm.plan.clear();\n\n }", "plan(program, state, callback) {\n const result = plan(program.arguments[0], state, []);\n\n // console.log(\"done planning\", result[0].plan);\n\n if (callback) {\n\n if (result[0].plan && result[0].plan.length > 0) {\n // execute the plan\n executeActions(result[0].plan, state, callback);\n // TODO: update state\n return [{ program: null, state, plan: [] }];\n } else {\n throw new Error('no plan found', 'no plan found');\n }\n\n } else {\n // else: offline we just ignore the 'plan' construct, because we are\n // already in planning mode.\n return result;\n }\n }", "function whichDepart() {\r\n\r\n let lcraDepartment = [\"Business Development\", \"Chief Administrative Officer\", \"Chief Commercial Officer\", \"Chief Financial Officer\", \"Chief of Staff\", \"Commercial Asset Management\", \"Communications\", \"Community Services\", \"Construction I\", \"Construction II\", \"Construction Support\", \"Controller\", \"Corporate Events\", \"Corporate Strategy\", \"Critical Infra Protection\", \"Critical Infrastructure Protection\", \"Customer Operations\", \"Cybersecurity\", \"Dam and Hydro\", \"Digital Services\", \"Enterprise Operations\", \"Environmental Affairs\", \"Environmental Field Services\", \"Environmental Lab\", \"Facilities Planning Management\", \"Finance\", \"Financial Planning & Strategy\", \"Fleet Services\", \"FPP Maintenance\", \"FPP Operations\", \"FPP Plant Support\", \"FRG Maintenance\", \"FRG Operations\", \"FRG Plant Support\", \"Fuels Accounting\", \"General Counsel\", \"General Manager\", \"Generation Environmental Group\", \"Generation Operations Mgmt\", \"Governmental & Regional Affairs\", \"Hilbig Gas Operations\", \"Human Resources\", \"Information Management\", \"Irrigation Operations\", \"Lands & Conservation\", \"Legal Services\", \"Line & Structural Engineering\", \"Line Operations\", \"LPPP Maintenance\", \"LPPP Operations\", \"LPPP Plant Support\", \"Materials Management\", \"Mid-Office Credit and Risk\", \"P&G Oper Reliability Group\", \"Parks\", \"Parks District - Coastal\", \"Parks District - East\", \"Parks District - West\", \"Plant Operations Engr. Group\", \"Plant Support Service\", \"Project Management\", \"Public Affairs\", \"QSE Operations\", \"Rail Fleet Operations\", \"Rangers\", \"Real Estate Services\", \"Regulatory & Market Compliance\", \"Regulatory Affairs\", \"Resilience\", \"River Operations\", \"Safety Services\", \"Sandy Creek Energy Station\", \"Security\", \"Service Quality & Planning\", \"SOCC Operations\", \"Strategic Initiatives & Transformation\", \"Strategic Sourcing\", \"Substation Engineering\", \"Substation Operations\", \"Supply Chain\", \"Survey GIS & Technical Svc\", \"System Control Services\", \"System Infrastructure\", \"Technical & Engineering Services\", \"Telecom Engineering\", \"Trans Contract Construction\", \"Trans Operational Intelligence\", \"Transmission Design & Protect\", \"Transmission Executive Mgmt\", \"Transmission Field Services\", \"Transmission Planning\", \"Transmission Protection\", \"Transmission Strategic Svcs\", \"Water\", \"Water Contracts & Conservation\", \"Water Engineering\", \"Water Quality\", \"Water Resource Management\", \"Water Surface Management\", \"Wholesale Markets & Sup\"];\r\n\r\n //let lcraDepart = document.getElementById(\"lcraDepart\");\r\n\r\n\r\n for(let i = 0; i < lcraDepartment.length; i++){\r\n let optn = lcraDepartment[i];\r\n let el = document.createElement(\"option\");\r\n el.value = optn;\r\n el.textContent = optn;\r\n lcraDepart.appendChild(el);\r\n }\r\n}", "function getGameweekPlan(teamMap, teamInfo){\n // console.log('teamMap: ', teamMap);\n // console.log('teamInfo: ', teamInfo);\n\n var plan = {};\n\n var players = Object.values(teamMap);\n players.sort((a,b) => {\n return b.next_gw_expected_points - a.next_gw_expected_points;\n });\n\n // console.log('players: ', players);\n\n plan.captian = players[0];\n plan.viceCaptian = players[1];\n\n if(teamInfo.chips.find((chip) => chip.name === '3xc' && chip.status_for_entry === 'available')){\n plan.activateTripleCaptian =\n plan.captian.next_gw_expected_points >= 12\n ? 'Play Triple Captian'\n : plan.captian.next_gw_expected_points >= 8\n ? 'Maybe Play'\n : 'Stay away this week';\n }\n plan.bench = getBench(players);\n\n // console.log('plan: ' , plan.bench);\n\n if(teamInfo.chips.find((chip) => chip.name === 'bboost' && chip.status_for_entry === 'available')){\n var benchPoints =\n plan.bench.goalkeeper.next_gw_expected_points +\n plan.bench.outfield[0].next_gw_expected_points +\n plan.bench.outfield[1].next_gw_expected_points +\n plan.bench.outfield[2].next_gw_expected_points;\n\n plan.activateBenchBoost =\n benchPoints >= 25\n ? 'Play Bench Boost'\n : plan.captian.next_gw_expected_points >= 25\n ? 'Maybe Play'\n : 'Stay away this week';\n }\n return plan;\n}", "function activateSolve() {\n // Execute the route task with atleat 2 stops\n if (routeParams.stops.features.length >= 2) {\n routeTask.solve(routeParams).then(showRoute);\n }\n }", "function optimal_compos_golden(adr)//mam sklad 7, szukam czy ktos na lawce sie nadaje//szukanie lepszego perfo-nie roz problem\n{\n if(adr==1)\n {\n \ttea = team1;//z tempo odczyt, a do tempz zapisuje;\n }\n else \n {\n \ttea = team2;//z tempo odczyt, a do tempz zapisuje;\n }\n//console.log(changes);\n var all_lawka = [];\n var item1 = [];\n var item2 = [];\n var item3 = [];\n var item4 = [];\n for(var i=1;i<=6;i++)//mam gwaracje, że przejdzie przez każdego R na ławce, ale dalej zawsze wybierze najlepszego\n {\t\n tea[0]=Array(0,0,0,0,0,0,0,0,0,0,0,0);\n item1 = [];item2 = [];item3 = [];item4 = [];\n\t\t\tfor(var j=8;j<=12;j++)\n\t\t\t{\n\t\t\t //item = [];\n if(tea[j][4]==\"R\" && i == 1)// i = 1 - sprawdzam każdego z ławki konkretnie za R\n\t\t\t {\n\t\t\t \tif(tea[j][11] > (tea[i][11]+1))\n {\n nadwyzka = tea[j][11] - tea[i][11];nadwyzka = zaokr(nadwyzka); \n item1 = [j, i, nadwyzka];\n all_lawka.unshift(item1);// \n }\n\t\t\t }\n if(tea[j][4]==\"A\" && i == 4)// i = 4\t\n\t\t\t {\n\t\t\t \tif(tea[j][6] > (tea[i][6]+1))\n {\n nadwyzka = tea[j][6] - tea[i][6];nadwyzka = zaokr(nadwyzka);\n item2 = [j, i, nadwyzka];\n all_lawka.unshift(item2);// \n }\n\t\t\t }\n item3 =[];\n if(tea[j][4]==\"P\" && (i == 2 || i == 5))// i = 2; i =5;\n\t\t\t {\n\t\t\t \tif( (tea[j][6]+tea[j][7])/2 > ((tea[i][6]+tea[i][7])/2)+1)\n {\n nadwyzka = (tea[j][6]+tea[j][7])/2 - ((tea[i][6]+tea[i][7])/2);nadwyzka = zaokr(nadwyzka);\n item3=[];\n item3 = [j, i, nadwyzka];\n test = all_lawka.unshift(item3);//\n //alert(\"test-length: \"+test+\" item: \"+item3);\n }\n\t\t\t }\n if(tea[j][4]==\"S\" && (i == 3 || i == 6))// i = 3; i =6;\n\t\t\t {\n\t\t\t \tif( (tea[j][6]+tea[j][9])/2 > ((tea[i][6]+tea[i][9])/2)+1)\n {\n nadwyzka = (tea[j][6]+tea[j][9])/2 - ((tea[i][6]+tea[i][9])/2);nadwyzka = zaokr(nadwyzka);\n item4 = [j, i, nadwyzka];\n all_lawka.unshift(item4);// \n }\n\t\t\t }\n } //end of for j=8..12\n //console.log(all_lawka);\n }//end of for i=1..6\n //sortowanie\n for(u=0; u<all_lawka.length; u++)\n {\n for(w=1; w<all_lawka.length; w++)\n {\n if(all_lawka[w][2] > all_lawka[w-1][2])\n {\n temp = all_lawka[w-1];\n all_lawka[w-1] = all_lawka[w];\n all_lawka[w] = temp;\n }\n }\n }\n //próba wykoanania zmiany\n for(u=0; u<all_lawka.length; u++)\n {\n out_id = all_lawka[u][1];\n in_id = all_lawka[u][0];\n out_nr = tea[out_id][3]; //na indeksie 1 mam wyznaczonego do zejścia - nr dla funkcji possible_change\n in_nr = tea[in_id][3]; //\n if(adr == 1)\n {\n if(possible_change(adr, out_nr, in_nr) < 6)\n {\nvar fffv = document.getElementById(\"screen3\").innerHTML;\ndocument.getElementById(\"screen3\").innerHTML=fffv+\"<br>(\"+pkt1+\":\"+pkt2+\") \"+tea[in_id][5]+\" za: \"+tea[out_id][5]+\" (stan: \"+mm1+\" : \"+mm2+\") \";\n//2021-01-13: nowy screen do zapisu zmian na czas seta\nvar fffv = document.getElementById(\"change_info1\").innerHTML;\ndocument.getElementById(\"change_info1\").innerHTML=fffv+\"<br>(\"+pkt1+\":\"+pkt2+\") \"+tea[in_id][5]+\" za \"+tea[out_id][5];\n change1(out_id,in_id); flag_golden1 = 1; return 0;\n }\n }\n else\n {\n if(possible_change(adr, out_nr, in_nr) < 6)\n {\nvar fffv = document.getElementById(\"screen6\").innerHTML;\ndocument.getElementById(\"screen6\").innerHTML=fffv+\"<br>(\"+pkt1+\":\"+pkt2+\") \"+tea[in_id][5]+\" za: \"+tea[out_id][5]+\" (stan: \"+mm1+\" : \"+mm2+\") \";\n//2021-01-13: nowy screen do zapisu zmian na czas seta\nvar fffv = document.getElementById(\"change_info2\").innerHTML;\ndocument.getElementById(\"change_info2\").innerHTML=fffv+\"<br>(\"+pkt1+\":\"+pkt2+\") \"+tea[in_id][5]+\" za \"+tea[out_id][5];\n change2(out_id,in_id); flag_golden2 = 1; return 0;\n }\n }\n }\n\n\n if(adr==1)\n {\n team1 = tea;\n }\n else \n {\n team2 = tea;\n }\n\n banch_ins();\n return 1;\n}", "finirLeTour() {\n switch (this.etat) {\n case ETAT_INITIALISATION:\n default:\n // Appel à \"finirLeTour\" lorsque la game est en initialisation (case ETAT_INITIALISATION)\n // OU dans un état inconnu (default case).\n console.log(\"DEFAULT CASE !\");\n break;\n case ETAT_DEPLACEMENT:\n this.changerJoueur();\n this.joueurs[this.indexJoueurActuel].casesPossiblesDeplacement();\n break;\n case ETAT_COMBAT:\n console.log(\"FIGHT CASE !\");\n // On change de joueur\n this.changerJoueur();\n\n // Pour chaque \"paire\" de boutons (1 paire par joueur)\n this.boutons.forEach((pair, idx) => {\n // On désactive les boutons si ceux-ci font partie de l'objet \"pair\"\n // qui correspond au joueur dont le tour est terminé.\n pair.attaquer[0].disabled = idx === this.indexAutreJoueur;\n pair.defendre[0].disabled = idx === this.indexAutreJoueur;\n });\n break;\n }\n }", "function planTrip(sLine, sStop, eLine, eStop){\r\n\r\n // Getting the selected start line\r\n var line = getLine(sLine);\r\n // Printing the output of the line and stops\r\n console.log(`You must travel through the following stops on the ${sLine} line: ${fromTo(line, sStop, communStop)}`)\r\n\r\n // Changing the line if it's not the same line for the whole trip\r\n if(sLine !== eLine)\r\n console.log(`Change at Union Square from the ${sLine} line to the ${eLine} line.`);\r\n\r\n // Getting the selected end line\r\n line = getLine(eLine);\r\n // Printing the output of the line and stops\r\n console.log(`Your journey continues through the following stops: ${fromTo(line, communStop, eStop)}`)\r\n\r\n // Printing the total number of stops\r\n console.log(`${stopCounter} stops in total.`)\r\n\r\n // Reseting stop counter\r\n stopCounter = 0;\r\n}", "function PlanRoad (start, end)\n{\n //Check if road is already known\n var roadIsKnown = false;\n var knownRoads = start.room.memory.roomInfo.knownRoads;\n\n if ( knownRoads && knownRoads.length > 0)\n {\n for ( let n in knownRoads )\n {\n var knownRoad = knownRoads[n];\n if ( knownRoad.start.x == start.pos.x && knownRoad.start.y == start.pos.y && knownRoad.end.x == end.pos.x && knownRoad.end.y == end.pos.y )\n {\n roadIsKnown = true;\n }\n }\n }\n // If not a known road, plan it.\n if ( !roadIsKnown )\n {\n var road = {};\n\n // Special case, if start and end are the same, build a road around the object\n // otherwise plan one from start to end\n if (start == end )\n {\n console.log('control.Construction.PlanRoad: Around Position: ' + start.pos );\n\n road = getSurroundingPositions(start) ;\n\n }\n else\n {\n console.log('control.Construction.PlanRoad: start: ' + start + ' - position: ' + start.pos );\n console.log('control.Construction.PlanRoad: end: ' + end + ' - position: ' + end.pos );\n\n road = PathFinder.search(start.pos, { pos: end.pos, range: 1 }) ;\n }\n for ( let n in road.path )\n {\n var buildPosition = road.path[n];\n start.room.memory.roomInfo.futureConstructionSites.push({position: buildPosition, structure: STRUCTURE_ROAD})\n }\n\n start.room.memory.roomInfo.knownRoads.push({start: start.pos, end: end.pos });\n }\n\n // Set a return value, so the caller knows if we did anything\n return (!roadIsKnown);\n}", "update() {\n\n //CAN LNAV EVEN RUN?\n this._activeWaypoint = this.flightplan.waypoints[this.flightplan.activeWaypointIndex];\n this._previousWaypoint = this.flightplan.waypoints[this.flightplan.activeWaypointIndex - 1];\n const navModeActive = SimVar.GetSimVarValue(\"L:WT_CJ4_NAV_ON\", \"number\") == 1;\n this._inhibitSequence = SimVar.GetSimVarValue(\"L:WT_CJ4_INHIBIT_SEQUENCE\", \"number\") == 1;\n\n if (this._activeWaypoint && this._activeWaypoint.hasHold && this._holdsDirector.isReadyOrEntering(this.flightplan.activeWaypointIndex)) {\n this._holdsDirector.update(this.flightplan.activeWaypointIndex);\n }\n else if (this._previousWaypoint && this._previousWaypoint.hasHold && !this._holdsDirector.isHoldExited(this.flightplan.activeWaypointIndex - 1)) {\n this._holdsDirector.update(this.flightplan.activeWaypointIndex - 1);\n }\n\n if (this._holdsDirector.state !== HoldsDirectorState.NONE && this._holdsDirector.state !== HoldsDirectorState.EXITED) {\n return;\n }\n\n const flightPlanVersion = SimVar.GetSimVarValue('L:WT.FlightPlan.Version', 'number');\n if (flightPlanVersion !== this._currentFlightPlanVersion) {\n if (this._waypointSequenced) {\n this._waypointSequenced = false;\n }\n else {\n this._isTurnCompleting = false;\n this._executeInhibited = false;\n }\n\n this._currentFlightPlanVersion = flightPlanVersion;\n }\n\n //CHECK IF DISCO/VECTORS\n if (this._onDiscontinuity) {\n if (!this._activeWaypoint.endsInDiscontinuity) {\n SimVar.SetSimVarValue(\"L:WT_CJ4_IN_DISCONTINUITY\", \"number\", 0);\n this._onDiscontinuity = false;\n }\n else if (navModeActive) {\n this.deactivate();\n }\n }\n\n\n\n this._planePos = new LatLon(SimVar.GetSimVarValue(\"GPS POSITION LAT\", \"degree latitude\"), SimVar.GetSimVarValue(\"GPS POSITION LON\", \"degree longitude\"));\n const planePosLatLong = new LatLong(this._planePos.lat, this._planePos.lon);\n\n const navSensitivity = this.getNavSensitivity(planePosLatLong);\n SimVar.SetSimVarValue('L:WT_NAV_SENSITIVITY', 'number', navSensitivity);\n\n const navSensitivityScalar = this.getNavSensitivityScalar(planePosLatLong, navSensitivity);\n SimVar.SetSimVarValue('L:WT_NAV_SENSITIVITY_SCALAR', 'number', navSensitivityScalar);\n\n if (!this._onDiscontinuity && this.waypoints.length > 0 && this._activeWaypoint && this._previousWaypoint) {\n this._lnavDeactivated = false;\n\n //LNAV CAN RUN, UPDATE DATA\n this._groundSpeed = SimVar.GetSimVarValue(\"GPS GROUND SPEED\", \"knots\");\n const airspeedTrue = SimVar.GetSimVarValue('AIRSPEED TRUE', 'knots');\n const planeHeading = SimVar.GetSimVarValue('PLANE HEADING DEGREES TRUE', 'Radians') * Avionics.Utils.RAD2DEG;\n\n this._activeWaypointDist = Avionics.Utils.computeGreatCircleDistance(planePosLatLong, this._activeWaypoint.infos.coordinates);\n this._previousWaypointDist = Avionics.Utils.computeGreatCircleDistance(planePosLatLong, this._previousWaypoint.infos.coordinates);\n this._bearingToWaypoint = Avionics.Utils.computeGreatCircleHeading(planePosLatLong, this._activeWaypoint.infos.coordinates);\n\n const prevWptPos = new LatLon(this._previousWaypoint.infos.coordinates.lat, this._previousWaypoint.infos.coordinates.long);\n const nextWptPos = new LatLon(this._activeWaypoint.infos.coordinates.lat, this._activeWaypoint.infos.coordinates.long);\n\n //CASE WHERE WAYPOINTS OVERLAP\n if (prevWptPos.distanceTo(nextWptPos) < 50) {\n this._fpm.setActiveWaypointIndex(this.flightplan.activeWaypointIndex + 1, EmptyCallback.Void, 0);\n return;\n }\n\n this._xtk = this._planePos.crossTrackDistanceTo(prevWptPos, nextWptPos) * (0.000539957); //meters to NM conversion\n this._dtk = AutopilotMath.desiredTrack(this._previousWaypoint.infos.coordinates, this._activeWaypoint.infos.coordinates, new LatLongAlt(this._planePos.lat, this._planePos.lon));\n const correctedDtk = this.normalizeCourse(GeoMath.correctMagvar(this._dtk, SimVar.GetSimVarValue(\"MAGVAR\", \"degrees\")));\n\n SimVar.SetSimVarValue(\"L:WT_CJ4_XTK\", \"number\", this._xtk);\n SimVar.SetSimVarValue(\"L:WT_CJ4_DTK\", \"number\", correctedDtk);\n SimVar.SetSimVarValue(\"L:WT_CJ4_WPT_DISTANCE\", \"number\", this._activeWaypointDist);\n\n const nextActiveWaypoint = this.flightplan.waypoints[this.flightplan.activeWaypointIndex + 1];\n\n //Remove heading instruction inhibition when near desired track\n const windCorrectedDtk = this.normalizeCourse(this._dtk - this.calculateWindCorrection(this._dtk, airspeedTrue));\n if (Math.abs(Avionics.Utils.angleDiff(windCorrectedDtk, planeHeading)) < 25) { //CWB adjusted from 15 to 25 to reduce the oversteer\n this._isTurnCompleting = false;\n this._executeInhibited = false;\n }\n\n this._setHeading = this._dtk;\n const interceptAngle = this.calculateDesiredInterceptAngle(this._xtk, navSensitivity);\n\n let deltaAngle = Avionics.Utils.angleDiff(this._dtk, this._bearingToWaypoint);\n this._setHeading = this.normalizeCourse(this._dtk + interceptAngle);\n\n let isLandingRunway = false;\n if (this.flightplan.activeWaypointIndex == this.flightplan.length - 2 && this._activeWaypoint.isRunway) {\n isLandingRunway = true;\n }\n\n //CASE WHERE WE ARE PASSED THE WAYPOINT AND SHOULD SEQUENCE THE NEXT WPT\n if (!this._activeWaypoint.endsInDiscontinuity && Math.abs(deltaAngle) >= 90 && this._groundSpeed > 10 && !isLandingRunway) {\n this._setHeading = this._dtk;\n if (!this._inhibitSequence) {\n this._fpm.setActiveWaypointIndex(this.flightplan.activeWaypointIndex + 1, EmptyCallback.Void, 0);\n SimVar.SetSimVarValue('L:WT_CJ4_WPT_ALERT', 'number', 0);\n this._isWaypointAlerting = false;\n this._waypointSequenced = true;\n\n this._isTurnCompleting = false;\n this._executeInhibited = false;\n\n this._nextTurnHeading = this._setHeading;\n this.execute();\n this._isTurnCompleting = true;\n } else {\n const planeHeading = SimVar.GetSimVarValue('PLANE HEADING DEGREES MAGNETIC', 'Radians') * Avionics.Utils.RAD2DEG;\n this._setHeading = planeHeading;\n this.execute();\n }\n return;\n }\n //CASE WHERE INTERCEPT ANGLE IS NOT BIG ENOUGH AND INTERCEPT NEEDS TO BE SET TO BEARING\n else if (Math.abs(deltaAngle) > Math.abs(interceptAngle)) {\n this._setHeading = this._bearingToWaypoint;\n }\n\n //TURN ANTICIPATION & TURN WAYPOINT SWITCHING\n const turnRadius = Math.pow(this._groundSpeed / 60, 2) / 9;\n const maxAnticipationDistance = SimVar.GetSimVarValue('AIRSPEED TRUE', 'Knots') < 350 ? 7 : 10;\n\n if (!isLandingRunway && !this._inhibitSequence && this._activeWaypoint && !this._activeWaypoint.endsInDiscontinuity && nextActiveWaypoint && this._activeWaypointDist <= maxAnticipationDistance && this._groundSpeed < 700) {\n\n let toCurrentFixHeading = Avionics.Utils.computeGreatCircleHeading(new LatLongAlt(this._planePos._lat, this._planePos._lon), this._activeWaypoint.infos.coordinates);\n let toNextFixHeading = Avionics.Utils.computeGreatCircleHeading(this._activeWaypoint.infos.coordinates, nextActiveWaypoint.infos.coordinates);\n\n let nextFixTurnAngle = Avionics.Utils.angleDiff(this._dtk, toNextFixHeading);\n let currentFixTurnAngle = Avionics.Utils.angleDiff(planeHeading, toCurrentFixHeading);\n\n let enterBankDistance = (this._groundSpeed / 3600) * 5;\n\n const getDistanceToActivate = turnAngle => Math.min((turnRadius * Math.tan((Math.abs(Math.min(110, turnAngle) * Avionics.Utils.DEG2RAD) / 2))) + enterBankDistance, maxAnticipationDistance);\n\n let activateDistance = Math.max(getDistanceToActivate(Math.abs(nextFixTurnAngle)), getDistanceToActivate(Math.abs(currentFixTurnAngle)));\n let alertDistance = activateDistance + (this._groundSpeed / 3600) * 5; //Alert approximately 5 seconds prior to waypoint change\n\n if (this._activeWaypointDist <= alertDistance) {\n SimVar.SetSimVarValue('L:WT_CJ4_WPT_ALERT', 'number', 1);\n this._isWaypointAlerting = true;\n }\n // console.log(\"d/a/ta: \" + this._activeWaypointDist.toFixed(2) + \"/\" + activateDistance.toFixed(2) + \"/\" + Math.abs(currentFixTurnAngle).toFixed(2) + \"/\" + this._activeWaypoint.ident);\n\n if (this._activeWaypointDist <= activateDistance && this._groundSpeed > 10) { //TIME TO START TURN\n // console.log(\"ACTIVATE \" + this._activeWaypoint.ident);\n this._setHeading = toNextFixHeading;\n this._fpm.setActiveWaypointIndex(this.flightplan.activeWaypointIndex + 1, EmptyCallback.Void, 0);\n\n SimVar.SetSimVarValue('L:WT_CJ4_WPT_ALERT', 'number', 0);\n this._isWaypointAlerting = false;\n this._waypointSequenced = true;\n\n this._isTurnCompleting = false;\n this._executeInhibited = false;\n\n this._nextTurnHeading = this._setHeading;\n this.execute();\n this._isTurnCompleting = true; //Prevent heading changes until turn is near completion\n\n return;\n }\n } else if (isLandingRunway && this._activeWaypointDist < 0.1) {\n\n this._setHeading = this._dtk;\n SimVar.SetSimVarValue(\"L:WT_CJ4_INHIBIT_SEQUENCE\", \"number\", 1);\n this.execute();\n return;\n }\n\n //DISCONTINUITIES\n if (this._activeWaypoint.endsInDiscontinuity) {\n let alertDisco = this._activeWaypointDist < (this._groundSpeed / 3600) * 120;\n SimVar.SetSimVarValue(\"L:WT_CJ4_IN_DISCONTINUITY\", \"number\", alertDisco ? 1 : 0);\n if (alertDisco === 1) {\n MessageService.getInstance().post(FMS_MESSAGE_ID.FPLN_DISCO, () => {\n return SimVar.GetSimVarValue(\"L:WT_CJ4_IN_DISCONTINUITY\", \"number\") === 0;\n });\n }\n if (this._activeWaypointDist < 0.25) {\n this._setHeading = this._dtk;\n this.executeDiscontinuity();\n return;\n }\n } else {\n SimVar.SetSimVarValue(\"L:WT_CJ4_IN_DISCONTINUITY\", \"number\", 0);\n }\n\n //NEAR WAYPOINT TRACKING\n if (navModeActive && this._activeWaypointDist < 1.0 && !this._isWaypointAlerting) { //WHEN NOT MUCH TURN, STOP CHASING DTK CLOSE TO WAYPOINT\n this._setHeading = this._bearingToWaypoint;\n this._executeInhibited = true;\n }\n this.execute();\n }\n else {\n if (!this._lnavDeactivated) {\n this.deactivate();\n }\n }\n }", "getBuscaProfundidade(verticeEscolhido) {\n\t\tif(this.trep == 1) {\n\t\t\tlet lista = this.getRepresentacao()\n\t\t\tlet quantVertice = this.getQNos()\n\t\t\tlet principal = verticeEscolhido\n\t\t\tlet backtracking = [];\n\t\t\tlet buscaProf = [];\n\t\t\tlet arrayVertices = [];\n\t\t\tlet tempo = 0;\n\n\t\t //Criação de uma lista de array contendo todos os vertices diferentes do\n\t\t //vertice escolhido pelo usuário\n\t\t for(let i = 0; i < quantVertice; i++) {\n\t\t \tif(verticeEscolhido != i) arrayVertices.push(i);\n\t\t }\n\t\t /*Estrutura auxiliar de array bidimensional contendo na primeira posição da\n\t\t segunda dimensão um objeto tendo cor, tempo da primeira passagem,\n\t\t tempo da segunda passagem e antecessor. Na segunda posição da mesma dimensão a grafo*/\n\t\t for(let i = 0; i < quantVertice; i++){\n\t\t \tbuscaProf[i] = {\n\t\t \t\tcor: \"branco\",\n\t\t \t\ttempoInicial: \"indef\",\n\t\t \t\ttempoFinal: \"indef\",\n\t\t \t\tantecessor: \"indef\",\n\t\t \t\tadj: lista[i]\n\t\t \t}\n\t\t }\n while(arrayVertices.length > 0){\n\n\t\t \tif(buscaProf[verticeEscolhido].cor == \"branco\"){\n\n\t\t \t\tbuscaProf[verticeEscolhido].cor = \"cinza\"\n\t\t \t\tbuscaProf[verticeEscolhido].tempoInicial = ++tempo\n\t\t \t\tbuscaProf[verticeEscolhido].antecessor = null\n\n\t\t \t\tbacktracking.push(verticeEscolhido);\n\n\t\t \t\tvar verticeSecundario\n\n\t\t \t\twhile(backtracking.length > 0){\n\n\t\t \t\t\tif(buscaProf[verticeEscolhido].adj.length > 0){\n\n\t\t \t\t\t\tverticeSecundario = buscaProf[verticeEscolhido].adj.shift().vertice;\n\n\t\t \t\t\t\tif(buscaProf[verticeSecundario].cor == \"branco\"){\n\n\t\t \t\t\t\t\tbuscaProf[verticeSecundario].cor = \"cinza\"\n\t\t \t\t\t\t\tbuscaProf[verticeSecundario].tempoInicial = ++tempo\n\t\t \t\t\t\t\tbuscaProf[verticeSecundario].antecessor = verticeEscolhido\n\t\t \t\t\t\t\tbacktracking.push(verticeEscolhido)\n\t\t \t\t\t\t\tverticeEscolhido = verticeSecundario\n\t\t \t\t\t\t}\n\n\n\t\t \t\t\t}\n\t\t \t\t\telse{\n\t\t \t\t\t\tbuscaProf[verticeEscolhido].cor = \"preto\"\n\t\t \t\t\t\tbuscaProf[verticeEscolhido].tempoFinal = ++tempo\n\t\t \t\t\t\tverticeEscolhido = backtracking.pop()\n\n\t\t \t\t\t}\n\t\t \t\t}\n\n\t\t \t}\n\t\t \tverticeEscolhido = arrayVertices.shift();\n\t\t }\n\n\t\t buscaProf[principal].antecessor = null\n\n\t\t return buscaProf;\n\t\t}\n\t\telse {\n\t\t\tlet matriz = this.getRepresentacao()\n\t\t\tlet quantVertice = this.getQNos()\n\t\t\tlet principal = verticeEscolhido\n\t\t\tlet backtracking = []\n\t\t\tlet buscaProf = []\n\t\t\tlet arrayVertices = []\n\t\t\tlet tempo = 0\n\n\t\t\tfor(let i = 0; i < quantVertice; i++) {\n\t\t\t\tif(verticeEscolhido != i) arrayVertices.push(i);\n\t\t\t}\n\n\t\t\tfor(let j = 0; j < quantVertice; j++){\n\t\t\t\tvar obj = {\n\t\t\t\t\tcor: \"branco\",\n\t\t\t\t\ttempoInicial: \"indef\",\n\t\t\t\t\ttempoFinal: \"indef\",\n\t\t\t\t\tantecessor: \"indef\"\n\t\t\t\t}\n\t\t\t\tbuscaProf[j] = obj\n\t\t\t}\n //contador de vertices, recebe a quantidade de vértices - 1, para ir até o penúltimo na busca\n\t\t\tlet contVert = quantVertice - 1\n\n\t\t\twhile(contVert > 0){\n\t\t\t\tif(buscaProf[verticeEscolhido].cor == \"branco\"){\n\t\t\t\t\tbuscaProf[verticeEscolhido].cor = \"cinza\"\n\t\t\t\t\tbuscaProf[verticeEscolhido].tempoInicial = ++tempo\n\t\t\t\t\tbuscaProf[verticeEscolhido].antecessor = null\n\n\t\t\t\t\tbacktracking.push(verticeEscolhido)\n\n\t\t\t\t\tvar verticeSecundario\n\n\n\t\t\t\t\twhile(backtracking.length > 0){\n\n\t\t\t\t\t\tfor(verticeSecundario = 0; verticeSecundario < quantVertice; verticeSecundario++){\n\t\t\t\t\t\t\tif(matriz[verticeEscolhido][verticeSecundario] != \"inf\"){\n\t\t\t\t\t\t\t\tif(buscaProf[verticeSecundario].cor == \"branco\"){\n\t\t\t\t\t\t\t\t\tbuscaProf[verticeSecundario].cor = \"cinza\"\n\t\t\t\t\t\t\t\t\tbuscaProf[verticeSecundario].tempoInicial = ++tempo\n\t\t\t\t\t\t\t\t\tbuscaProf[verticeSecundario].antecessor = verticeEscolhido\n\n\t\t\t\t\t\t\t\t\tbacktracking.push(verticeEscolhido)\n\t\t\t\t\t\t\t\t\tverticeEscolhido = verticeSecundario\n\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(verticeSecundario == quantVertice){\n\t\t\t\t\t\t\tbuscaProf[verticeEscolhido].cor = \"preto\"\n\t\t\t\t\t\t\tbuscaProf[verticeEscolhido].tempoFinal = ++tempo\n\t\t\t\t\t\t\tverticeEscolhido = backtracking.pop()\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tverticeEscolhido = arrayVertices.shift();\n\t\t\t\tcontVert--\n\t\t\t}\n\n\t\t\tbuscaProf[principal].antecessor = null\n\t\t\treturn buscaProf\n\t\t}\n }", "function poly(best) {\n directionsService = new google.maps.DirectionsService();\n directionsDisplay = new google.maps.DirectionsRenderer();\n directionsDisplay.setMap(map);\n var waypts = [];\n if (travelType == \"GR\") {\n for (var i = 1; i < best.length-1; i++) {\n waypts.push({\n location: nodes[best[i]],\n stopover: true\n });\n }\n // Pridedamas marsrutas i zemelapi\n var request = {\n origin: nodes[0],\n destination: nodes[0],\n waypoints: waypts,\n travelMode: 'DRIVING',\n };\n directionsService.route(request, function (response, status) {\n if (status == google.maps.DirectionsStatus.OK) {\n directionsDisplay.setDirections(response);\n }\n clearMapMarkers();\n });\n }\n else if (travelType == \"NGR\") {\n for (var i = 1; i < best.length-1; i++) {\n waypts.push({\n location: nodes[best[i]],\n stopover: true\n });\n }\n // Pridedamas marsrutas i zemelapi\n var request = {\n origin: nodes[0],\n destination: nodes[nodes.length - 1],\n waypoints: waypts,\n travelMode: 'DRIVING',\n };\n directionsService.route(request, function (response, status) {\n if (status == google.maps.DirectionsStatus.OK) {\n directionsDisplay.setDirections(response);\n }\n clearMapMarkers();\n });\n }\n best.shift();\n best.splice(best.length - 1, 1);\n }", "function updateActivities () {\n showCost();\n strikeOutMatches();\n}", "get plans() {\r\n return new Plans(this);\r\n }", "function tourDeMot(){\n\tif(qual1Accept){\n\t\ttourDeLettres(document.getElementById('qual1'),0);\n\t}\n\tif(qual2Accept){\n\t\ttourDeLettres(document.getElementById('qual2'),1);\n\t}\n\tif(qual3Accept){\n\t\ttourDeLettres(document.getElementById('qual3'),2);\n\t}\n\tif(qual4Accept){\n\t\ttourDeLettres(document.getElementById('qual4'),3);\n\t}\n\tif(qual5Accept){\n\t\ttourDeLettres(document.getElementById('qual5'),4);\n\t}\n}", "get plans() {\r\n return new Plans(this, \"planner/plans\");\r\n }", "function displayPlanner() {\n for (var i = 9; i < 18; i++) {\n createTimeBlock(i);\n }\n displayActivities();\n}", "function specialCasesRecalc(mission) {\n\t\n}", "async function getStatisticToPlan() {\n\n}", "function updateAvailable(available) {\n if (available.tiempo > 0) {\n mode0.innerHTML = \"PARTIDAS DISPONIBLES: \" + available.tiempo;\n enableAnchor(mode0.parentElement);\n } else {\n mode0.innerHTML = \"NO HAY PARTIDAS DISPONIBLES\";\n disableAnchor(mode0.parentElement);\n }\n if (available.puntaje > 0) {\n mode1.innerHTML = \"PARTIDAS DISPONIBLES: \" + available.puntaje;\n enableAnchor(mode1.parentElement);\n } else {\n mode1.innerHTML = \"NO HAY PARTIDAS DISPONIBLES\";\n disableAnchor(mode1.parentElement);\n }\n}", "function C007_LunchBreak_Natalie_Hug() {\r\n CurrentTime = CurrentTime + 60000;\r\n C007_LunchBreak_Natalie_Knee = false;\r\n if (CurrentTime >= 12.66667 * 60 * 60 * 1000) {\r\n OveridenIntroText = GetText(\"JennaReturns\");\r\n C007_LunchBreak_Natalie_CurrentStage = 690;\r\n }\r\n C007_LunchBreak_Natalie_CalcParams();\r\n}", "function orb_plan(njd,np){\n\n // elementi orbitali dei pianeti per l'equinozio della data.\n\n\n var T=(njd-2415020.0)/36525;\n \n var L=new Array (); // Longitudine media dei pianeti.\n\n L[0]=178.179078+149474.07078*T+0.0003011*T*T; // Mercurio.\n L[1]=342.767053+58519.211910*T+0.0003097*T*T; // Venere.\n L[2]= 99.696680+36000.768920*T+0.0003025*T*T; // Terra.\n L[3]=293.737334+19141.695510*T+0.0003107*T*T; // Marte.\n L[4]=238.049257+3036.3019860*T+0.0003347*T*T-0.00000165*T*T*T; // Giove.\n L[5]=266.564377+1223.5098840*T+0.0003245*T*T-0.00000580*T*T*T; // Saturno.\n L[6]=244.197470+429.86354600*T+0.0003160*T*T-0.00000060*T*T*T; // Urano.\n L[7]= 84.457994+219.88591400*T+0.0003205*T*T-0.00000060*T*T*T; // Nettuno.\n L[8]= 93.48+144.96*T; // Plutone.\n\n\n\n var M=new Array (); // Anomalia media dei pianeti.\n\n M[0]=102.27938+149472.51529*T+0.000007*T*T; // Mercurio.\n M[1]=212.60322+ 58517.80387*T+0.001286*T*T; // Venere.\n M[2]=178.47583+35999.049750*T-0.000150*T*T-0.0000033*T*T*T; // Terra.\n M[3]=319.51913+ 19139.85475*T+0.000181*T*T; // Marte.\n M[4]=225.32829+ 3034.69202*T-0.000722*T*T; // Giove.\n M[5]=175.46616+ 1221.55147*T-0.000502*T*T; // Saturno.\n M[6]= 72.64878+ 428.37911*T+0.000079*T*T; // Urano.\n M[7]= 37.73063+ 218.46134*T-0.000070*T*T; // Nettuno.\n M[8]=0; // Plutone.\n\n\n var a= new Array( 0.3870986, 0.7233316, 0.999996, 1.523688300, 5.20256100, 9.5547470, 19.2181400, 30.1095700, 39.48168677); // \n var p= new Array(0.24085000, 0.6152100, 1.000040, 1.8808900, 11.8622400, 29.457710, 84.0124700, 164.7955800, 248.09);\n var m= new Array(0.000001918, 0.00001721, 0.0000000, 0.000004539, 0.000199400, 0.000174000, 0.00007768, 0.000075970, 0.000004073);\n var d= new Array( 6.74, 16.92, 0, 9.36, 196.74, 165.60, 65.80, 62.20, 3.20); \n \n var e= new Array(); // Eccentricità delle orbite planetarie.\n\n e[0]=0.20561421+0.00002046*T-0.000000030*T*T; // Mercurio. \n e[1]=0.00682069-0.00004774*T+0.000000091*T*T; // Venere.\n e[2]=0.01675104-0.00004180*T-0.000000126*T*T; // Terra. \n e[3]=0.09331290+0.000092064*T-0.000000077*T*T; // Marte. \n e[4]=0.04833475+0.000164180*T-0.0000004676*T*T-0.00000000170*T*T*T; // Giove.\n e[5]=0.05589232-0.000345500*T-0.0000007280*T*T+0.00000000074*T*T*T; // Saturno.\n e[6]=0.04634440-0.000026580*T+0.0000000770*T*T; // Urano.\n e[7]=0.00899704+0.000006330*T-0.0000000020*T*T; // Nettuno. \n e[8]=0.24880766; // Plutone. \n\n var i= new Array(); // Inclinazione dell'orbita\n\n i[0]=7.002881+0.0018608*T-0.0000183*T*T;\n i[1]=3.393631+0.0010058*T-0.0000010*T*T;\n i[2]=0;\n i[3]=1.850333-0.0006750*T+0.0000126*T*T;\n i[4]=1.308736-0.0056961*T+0.0000039*T*T;\n i[5]=2.492519-0.0039189*T-0.00001549*T*T+0.00000004*T*T*T;\n i[6]=0.772464+0.0006253*T+0.0000395*T*T;\n i[7]=1.779242-0.0095436*T-0.0000091*T*T;\n i[8]=17.14175;\n\n var ap= new Array(); // Argomento del perielio.\n\n ap[0]=28.753753+0.3702806*T+0.0001208*T*T; // Mercurio\n ap[1]=54.384186+0.5081861*T-0.0013864*T*T;\n ap[2]=gradi_360(L[2]-M[2]+180); // Terra\n ap[3]=285.431761+1.0697667*T+0.0001313*T*T+0.00000414*T*T*T;\n ap[4]=273.277558+0.5994317*T+0.00070405*T*T+0.00000508*T*T*T;\n ap[5]=338.307800+1.0852207*T+0.00097854*T*T+0.00000992*T*T*T;\n ap[6]=98.071581+0.9857650*T-0.0010745*T*T-0.00000061*T*T*T;\n ap[7]=276.045975+0.3256394*T+0.00014095*T*T+0.000004113*T*T*T;\n ap[8]=113.76329; // Plutone\n\n \n var nd= new Array(); // Longitudine del nodo.\n\n nd[0]=47.145944+1.1852083*T+0.0001739*T*T; // Mercurio. \n nd[1]=75.779647+0.8998500*T+0.0004100*T*T; // Venere.\n nd[2]=0; // Terra\n nd[3]=48.786442+0.7709917*T-0.0000014*T*T-0.00000533*T*T*T; // Marte.\n nd[4]=99.443414+1.0105300*T+0.00035222*T*T-0.00000851*T*T*T; // Giove.\n nd[5]=112.790414+0.8731951*T-0.00015218*T*T-0.00000531*T*T*T; // Saturno.\n nd[6]=73.477111+0.4986678*T+0.0013117*T*T; // Urano.\n nd[7]=130.681389+1.0989350*T+0.00024987*T*T-0.000004718*T*T*T; // Nettuno.\n nd[8]=110.30347; // Plutone.\n\n\n\n var Long_media=gradi_360(L[np]);\n var Anomalia_media=gradi_360(M[np]);\n var Semiasse=a[np];\n var Periodo=p[np];\n var Inclinazione=i[np];\n var Long_perielio=gradi_360(ap[np]+nd[np]);\n var Long_nodo=nd[np];\n var eccentr=e[np];\n var dim_ang=d[np];\n var magnitudine=m[np];\n\n if(np==8) {Anomalia_media=gradi_360(Long_media-ap[8]-nd[8]); }\n\n\n var elem_orb=new Array(Periodo , Long_media , Anomalia_media , Long_perielio , eccentr , Semiasse , Inclinazione , Long_nodo , dim_ang , magnitudine);\n\nreturn elem_orb;\n\n}", "function boucleJeu() {\n\n var nouvelInterval = Date.now();\n\n\n\n //SI au premier instant du jeu on initialise le debut de l'interval a quelque chose\n if (!debutInterval) {\n debutInterval = Date.now();\n }\n\n gestionnaireObjets.repositionnerObjets(Bouteille, nouvelInterval);\n gestionnaireObjets.repositionnerObjets(Obstacle, nouvelInterval);\n gestionnaireObjets.repositionnerObjets(Voiture, nouvelInterval);\n\n\n //Si le nouveau temps est plus grand que l'accelaration souhaiter par rapport au début de l'interval\n if (nouvelInterval - debutInterval >= 20) {\n vitesseRoute += 0.005;\n\n debutInterval = nouvelInterval;\n }\n\n //Appliquer les déplacements\n gestionnaireObjets.deplacerLesObjets(vitesseRoute);\n }", "function updateUI(planet,total){\r\n const journeyCostInput = document.getElementById(planet + '-total')\r\n journeyCostInput.innerText = total\r\n}", "function comportement (){\n\t }", "function IA_sacrifier(){\n\t\t // IA sacrifie la carte de plus haut cout d'invocation\n\t\t //SSI aucune carte vide\n\t\t \n\t\t no=rechercherIdxCarteAdvCoutMax()\n\t\t if (no>=0){\n\t\t\tlaCarte = jeu_adv[no];\n\t\t \tsacrifierUneCarte(no,laCarte,false,true);\n\t\t}\n\t }", "niveauSuivant()\r\n\t{\r\n\t\tthis._termine = false;\r\n\t\tthis._gagne = false;\r\n\t\tthis._niveau++;\r\n\t\tthis.demarrerNiveau();\r\n\t}", "get planDisplay() {\n\t\treturn this.__planDisplay;\n\t}", "function planFormCaller() {\n plan.planForm();\n}", "function Plans(amount, car, price) {\r\n this.amount = amount;\r\n this.price = price;\r\n\r\n let amountN = Number(amount)\r\n let priceN = Number(price)\r\n\r\n let planO;\r\n let planT;\r\n\r\n let data = {\r\n\r\n }\r\n\r\n const div = document.createElement(\"div\");\r\n div.classList = \"card\";\r\n\r\n if (amountN <= priceN) {\r\n if (amountN <= (priceN * 15) / 100) {\r\n planO = (amountN * 30) / 100;\r\n planT = (amountN * 20) / 100;\r\n\r\n let preO = priceN - (planO * 12);\r\n let preT = priceN - (planT * 24);\r\n\r\n data.salary = amountN;\r\n data.planTwo = {\r\n planOneYear: planO,\r\n planTwoYear: planT\r\n }\r\n data.preTwo = {\r\n preOne: preO,\r\n preTwo: preT\r\n }\r\n data.car = car\r\n data.id = 1\r\n\r\n\r\n\r\n\r\n div.innerHTML = `\r\n <h2>${car}</h2>\r\n <h3>One year plan</h3>\r\n <div>\r\n <p class=\"t-c\">Deposit : $ <span>${preO}</span></p>\r\n <p class=\"t-c\">Total month : $ <span>${planO}</span></p>\r\n </div>\r\n\r\n <h3>Two year plan</h3>\r\n <div>\r\n <p class=\"t-c\">Deposit : $ <span>${preT}</span></p>\r\n <p class=\"t-c\">Total month : $ <span>${planT}</span></p>\r\n </div>\r\n <div class=\"full-width\">\r\n <a class=\"btn-p f-r m-r-p\" id=\"new\">New plan</a>\r\n </div>\r\n `;\r\n\r\n savePlans(data)\r\n result.appendChild(div)\r\n\r\n } else if (amountN > (priceN * 15) / 100 && amountN <= (priceN * 30) / 100) {\r\n planO = (amountN * 30) / 100;\r\n\r\n let preS = priceN - (planO * 6);\r\n\r\n data.salary = amountN;\r\n data.planO = planO\r\n data.pre = preS\r\n data.car = car\r\n data.id = 2\r\n\r\n\r\n div.innerHTML = `\r\n <h2>${car}</h2>\r\n <h3>Six months plan</h3>\r\n <div>\r\n <p class=\"t-c\">Deposit : $ <span>${preS}</span></p>\r\n <p class=\"t-c\">Total month : $ <span>${planO}</span></p>\r\n </div>\r\n <div class=\"full-width\">\r\n <a class=\"btn-p f-r m-r-p\" id=\"new\">New plan</a>\r\n </div>\r\n `;\r\n savePlans(data)\r\n result.appendChild(div)\r\n } else if (amountN > (priceN * 30) / 100 && amountN <= (priceN * 60) / 100) {\r\n planO = (amountN * 30) / 100;\r\n\r\n let preT = priceN - (planO * 3);\r\n\r\n data.salary = amountN;\r\n data.planO = planO\r\n data.pre = preT\r\n data.car = car\r\n data.id = 3\r\n\r\n\r\n div.innerHTML = `\r\n <h2>${car}</h2>\r\n <h3>Three months plan</h3>\r\n <div>\r\n <p class=\"t-c\">Deposit : $ <span>${preT}</span></p>\r\n <p class=\"t-c\">Total month : $ <span>${planO}</span></p>\r\n </div>\r\n <div class=\"full-width\">\r\n <a class=\"btn-p f-r m-r-p\" id=\"new\">New plan</a>\r\n </div>\r\n `;\r\n savePlans(data)\r\n result.appendChild(div)\r\n } else if (amountN > (priceN * 60) / 100 && amountN <= priceN) {\r\n planO = (priceN / 3).toFixed(2);\r\n\r\n data.salary = amountN;\r\n data.planO = planO\r\n data.car = car\r\n data.id = 4\r\n\r\n\r\n div.innerHTML = `\r\n <h2>${car}</h2>\r\n <h3>Three months plan</h3>\r\n <div>\r\n <p class=\"t-c\">Total month : $ <span>${planO}</span></p>\r\n </div>\r\n <div class=\"full-width\">\r\n <a class=\"btn-p f-r m-r-p\" id=\"new\">New plan</a>\r\n </div>\r\n `;\r\n savePlans(data)\r\n result.appendChild(div)\r\n }\r\n } else {\r\n planO = priceN / 2;\r\n\r\n data.salary = amountN;\r\n data.planO = planO\r\n data.car = car\r\n data.id = 5\r\n\r\n div.innerHTML = `\r\n <h2>${car}</h2>\r\n <h3>Two months plan</h3>\r\n <div>\r\n <p class=\"t-c\">Total month : $ <span>${planO}</span></p>\r\n </div>\r\n <div class=\"full-width\">\r\n <a class=\"btn-p f-r m-r-p\" id=\"new\">New plan</a>\r\n </div>\r\n `;\r\n savePlans(data)\r\n result.appendChild(div)\r\n }\r\n\r\n}", "plan () {\n return CapacityPlans.findOne(this.planId)\n }", "function prestigeChanging2(){\n //find out the equipment index of the prestige we want to hit at the end.\n var maxPrestigeIndex = document.getElementById('Prestige').selectedIndex;\n // Cancel dynamic prestige logic if maxPrestigeIndex is less than or equal to 2 (dagger)\n if (maxPrestigeIndex <= 2)\n return;\n \n //find out the last zone (checks custom autoportal and challenge's portal zone)\n var lastzone = checkSettings() - 1; //subtract 1 because the function adds 1 for its own purposes.\n \n //if we can't figure out lastzone (likely Helium per Hour AutoPortal setting), then use the last run's Portal zone.\n if (lastzone < 0)\n lastzone = game.global.lastPortal;\n \n // Find total prestiges needed by determining current prestiges versus the desired prestiges by the end of the run\n var neededPrestige = 0;\n for (i = 1; i <= maxPrestigeIndex ; i++){\n var lastp = game.mapUnlocks[autoTrimpSettings.Prestige.list[i]].last;\n if (lastp <= lastzone){\n var addto = Math.ceil((lastzone + 1 - lastp)/5);\n // For Scientist IV bonus, halve the required prestiges to farm\n if (game.global.sLevel > 3)\n addto += Math.ceil(addto/2);\n neededPrestige += addto; \n }\n }\n // For Lead runs, we hack this by doubling the neededPrestige to acommodate odd zone-only farming. This might overshoot a bit\n if (game.global.challengeActive == 'Lead') \n neededPrestige *= 2;\n \n // Determine the number of zones we want to farm. We will farm 4 maps per zone, then ramp up to 9 maps by the final zone\n var zonesToFarm = 0;\n if (neededPrestige == 0){\n autoTrimpSettings.Prestige.selected = \"Dagadder\";\n return;\n }\n else if (neededPrestige <= 9)//next 9\n zonesToFarm = 1;\n else if (neededPrestige <= 17)//next 8\n zonesToFarm = 2;\n else if (neededPrestige <= 24)//next 7\n zonesToFarm = 3;\n else if (neededPrestige <= 30)//next 6\n zonesToFarm = 4;\n else if (neededPrestige <= 35)//next 5\n zonesToFarm = 5;\n else\n zonesToFarm = 6 + Math.ceil((neededPrestige - 35)/5);\n \n //If we are in the zonesToFarm threshold, kick off the prestige farming\n if(game.global.world > (lastzone-zonesToFarm) && game.global.lastClearedCell < 79){\n // Default map bonus threshold\n var mapThreshold = 4;\n var zonegap = lastzone - game.global.world;\n if (zonegap <= 4)// Would be +5 but the map repeat button stays on for 1 extra.\n mapThreshold += zonegap;\n\n if (game.global.mapBonus < mapThreshold)\n autoTrimpSettings.Prestige.selected = \"GambesOP\";\n else if (game.global.mapBonus >= mapThreshold)\n autoTrimpSettings.Prestige.selected = \"Dagadder\";\n }\n \n //If we are not in the prestige farming zone (the beginning of the run), use dagger:\n if (game.global.world <= lastzone-zonesToFarm || game.global.mapBonus == 10) \n autoTrimpSettings.Prestige.selected = \"Dagadder\";\n}", "function mostrarprmaelementocequiv(habp,com){\n\n\t\t\t//////////////////////////////////PLAN HABILITADORAS ////////////////////////////////////////////////\t\t\t\n\t\t\t\t\t\t// ESFUERZO PROPIO PLAN EN BOLIVARES \t\t\t\t\t\n\t\t\t\t\t\tvar laborep = filtrarcostohab(habp,filtrolabor,5,com,1);\n\t\t\t\t\t\tvar bbep = filtrarcostohab(habp,filtrobb,5,com,1);\n\t\t\t\t\t\tvar mep = filtrarcostohab(habp,filtrom,5,com,1);\n\t\t\t\t\t\tvar scep = filtrarcostohab(habp,filtrosc,5,com,1);\n\t\t\t\t\t\tvar oep = filtrarcostohab(habp,filtroo,5,com,1);\n\t\t\t\t\t\tvar totalep = filtrartotal(laborep,bbep,mep,scep,oep);\n \n \t\t\t\t\t\t \t\t // ESFUERZOS PROPIOS PLAN EN DOLARES\n \t\t\t\t\t\t var laborepdol = filtrarcostohab(habp,filtrolabor,5,com,2);\n \t\t\t\t\t\t var bbepdol = filtrarcostohab(habp,filtrobb,5,com,2);\n \t\t\t\t\t\t var mepdol = filtrarcostohab(habp,filtrom,5,com,2);\n \t\t\t\t\t\t var scepdol = filtrarcostohab(habp,filtrosc,5,com,2);\n \t\t\t\t\t\t var oepdol = filtrarcostohab(habp,filtroo,5,com,2);\n \t\t\t\t\t\t var totalepdol = filtrartotal(laborepdol,bbepdol,mepdol,scepdol,oepdol);\n\n \t\t\t\t\t\t // DTTO ORIENTAL PLAN EN BOLIVARES\n\t\t\t\t\t \t var labordtto = filtrarcostohab(habp,filtrolabor,4,com,1);\n \t\t\t\t\t\t var bbdtto = filtrarcostohab(habp,filtrobb,4,com,1);\n \t\t\t\t\t\t var mdtto = filtrarcostohab(habp,filtrom,4,com,1);\n \t\t\t\t\t\t var scdtto = filtrarcostohab(habp,filtrosc,4,com,1);\n \t\t\t\t\t\t var odtto = filtrarcostohab(habp,filtroo,4,com,1);\n \t\t\t\t\t\t var totaldtto = filtrartotal(labordtto,bbdtto,mdtto,scdtto,odtto);\n\n \t\t\t\t\t\t // DTTO ORIENTAL PLAN EN DOLARES\n \t\t\t\t\t\t var labordttodol = filtrarcostohab(habp,filtrolabor,4,com,2);\n \t\t\t\t\t\t var bbdttodol = filtrarcostohab(habp,filtrobb,4,com,2);\n \t\t\t\t\t\t var mdttodol = filtrarcostohab(habp,filtrom,4,com,2);\n \t\t\t\t\t\t var scdttodol = filtrarcostohab(habp,filtrosc,4,com,2);\n \t\t\t\t\t\t var odttodol = filtrarcostohab(habp,filtroo,4,com,2);\n \t\t\t\t\t\t var totaldttodol = filtrartotal(labordttodol,bbdttodol,mdttodol,scdttodol,odttodol);\n\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL PLAN EN BOLIVARES\n \t\t\t\t\t\t var labordivo = filtrardivo(labordtto,laborep);\n \t\t\t\t\t\t var bbdivo = filtrardivo(bbdtto,bbep);\n \t\t\t\t\t\t var mdivo = filtrardivo(mdtto,mep);\n \t\t\t\t\t\t var scdivo = filtrardivo(scdtto,scep);\n \t\t\t\t\t\t var odivo = filtrardivo(odtto,oep);\n \t\t\t\t\t\t var totaldivo = filtrartotal(labordivo,bbdivo,mdivo,scdivo,odivo);\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL PLAN EN DOLARES\n \t\t\t\t\t\t var labordivodol = filtrardivo(labordttodol,laborepdol);\n \t\t\t\t\t\t var bbdivodol = filtrardivo(bbdttodol,bbepdol);\n \t\t\t\t\t\t var mdivodol = filtrardivo(mdttodol,mepdol);\n \t\t\t\t\t\t var scdivodol = filtrardivo(scdttodol,scepdol);\n \t\t\t\t\t\t var odivodol = filtrardivo(odttodol,oepdol);\n \t\t\t\t\t\t var totaldivodol = filtrartotal(labordivodol,bbdivodol,mdivodol,scdivodol,odivodol);\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL PLAN EN DOLARES EQUIVALENTES\n \t\t\t\t\t\t var labordivoDeqv = filtroequivalente(labordivo,labordivodol);\n \t\t\t\t\t\t var bbdivoDeqv = filtroequivalente(bbdivo,bbdivodol);\n \t\t\t\t\t\t var mdivoDeqv = filtroequivalente(mdivo,mdivodol);\n \t\t\t\t\t\t var scdivoDeqv = filtroequivalente(scdivo,scdivodol);\n \t\t\t\t\t\t var odivoDeqv = filtroequivalente(odivo,odivodol);\n \t\t\t\t\t\t var totaldivoDeqv = filtrartotal(labordivoDeqv,bbdivoDeqv,mdivoDeqv,scdivoDeqv,odivoDeqv);\n\n \t\t\t\t\t\t ////////////////////// FIN PLAN ////////////////////////////////////////////////\n \t\t\t\t\t\t var laborybbdivoDeqv = filtrardivo(labordivoDeqv,bbdivoDeqv);\n\n \t\t\t\t\t\t\n \t\t\t\t\t\tvar\tinformacion = cabeceracategoriaprmva('red-header','ELEMENTO DE COSTO');\n \t\t\t\t\t\t\tinformacion += mostrarcategoriaprmva('','Labor y Beneficios',laborybbdivoDeqv); \n \t\t\t\t\t\t\tinformacion += mostrarcategoriaprmva('','Materiales',mdivoDeqv);\n \t\t\t\t\t\t\tinformacion += mostrarcategoriaprmva('','Servicios y Contratos',scdivoDeqv);\n \t\t\t\t\t\t\tinformacion += mostrarcategoriaprmva('','Otros Costos y Gastos',odivoDeqv);\n \t\t\t\t\t\t\tinformacion += mostrarcategoriaprmva('red-header','Total',totaldivoDeqv); \n \t\t\t\t\treturn informacion;\n\n}", "function fl_outToDag ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t}}", "function zurueck(){\n\t\tif(!pfeilAktivitaet) {\n\t\t\tneuLaden();\n\t\t}\n\t\telse {\n\t\t\ttoggleDetailView_textauszug();\n\t\t\tpfeilAktivitaet = false;\n\t\t}\n\t}//ENDE zurueck()", "pacManBewegen() {\n let knoten = this.knoten;\n let geist = this.geist;\n let pacman = this.pacMan;\n let pillen = this.pillen;\n if (!this.beendet) { //darf sich nur bewegen wenn das spiel noch nicht zuende ist\n let PacManAltX = pacman.posX;\n let PacManAltY = pacman.posY;\n if (zustand.aengstlich) { //jagdmodus pacman sucht hier den kürzesten weg zum geist um ihn zu jagen und beschreitet diesen\n let zielRoute = astar.search(knoten, pacman.posX, pacman.posY, geist.posX, geist.posY);\n pacman.posX = zielRoute[0].posX;\n pacman.posY = zielRoute[0].posY;\n\n\n } else if ((pacman.darfwegglaufen && pacman.getAbstand(geist.posX, geist.posY) < 6) || !geist.isMoving) { //pacman weglaufen lassen wenn der geist steht oder die Manhattandistanz kleiner als 6 ist\n let aktKnoten = knoten[pacman.posY][pacman.posX];\n let auswege = aktKnoten.nachbarn;\n let bestnachbar = auswege[0];\n let bestabstand = geist.getAbstand(bestnachbar.posX, bestnachbar.posY);\n for (let i = 1; i < auswege.length; i++) {\n let neuabstand = geist.getAbstand(auswege[i].posX, auswege[i].posY);\n if (neuabstand > bestabstand) {\n bestabstand = neuabstand;\n bestnachbar = auswege[i];\n }\n }\n pacman.posX = bestnachbar.posX;\n pacman.posY = bestnachbar.posY;\n\n if (!this.toogleTimerAn) {\n //noinspection JSCheckFunctionSignatures\n clearTimeout(Spielvariablen.intervalle.flucht);\n //noinspection JSCheckFunctionSignatures\n clearTimeout(Spielvariablen.intervalle.nonflucht);\n //noinspection JSCheckFunctionSignatures\n Spielvariablen.intervalle.flucht=setTimeout(Spielvariablen.funtionen.flucht, 5000);\n //noinspection JSCheckFunctionSignatures\n Spielvariablen.intervalle.nonflucht=setTimeout(Spielvariablen.funtionen.nonflucht, 7000);\n this.toogleTimerAn = true;\n }\n\n }\n //keine jagt und kein weglaufen also nächste pille suchen und essen ;-)\n else {\n //--nächste pille rausfinden mittels manhattan distanz rausfinden;\n Spielvariablen.funtionen.shuffle(pillen);\n let nahestPille = 0;\n let nahestPilleManhattan = 1000;\n if (pillen.length == 0) {\n zustand.status = 3;\n Spielvariablen.Spielstart = false;\n return;\n }\n for (let i = 0; i < pillen.length; i++) {\n let manhattan = astar.manhattan(pacman.posX, pacman.posY, pillen[i].posX, pillen[i].posY);\n if (manhattan < nahestPilleManhattan) {\n nahestPilleManhattan = manhattan;\n nahestPille = i;\n }\n }\n\n let zielPille = pillen[nahestPille];\n let zielRoute = astar.search(knoten, pacman.posX, pacman.posY, zielPille.posX, zielPille.posY);\n pacman.posX = zielRoute[0].posX;\n pacman.posY = zielRoute[0].posY;\n }\n if (knoten[pacman.posY][pacman.posX].pille != null) {\n let pille = knoten[pacman.posY][pacman.posX].pille;\n knoten[pacman.posY][pacman.posX].pille = null;\n pillen.splice(pillen.indexOf(pille), 1);\n if (pille.isGross) {\n zustand.aengstlich = true;\n //noinspection JSCheckFunctionSignatures\n clearTimeout(Spielvariablen.intervalle.verwirrt);\n //noinspection JSCheckFunctionSignatures\n Spielvariablen.intervalle.verwirrt=setTimeout(Spielvariablen.funtionen.verwirrt, 10000);\n }\n }\n\n if (PacManAltY < pacman.posY) {\n pacman.offsetY = -this.factor;\n pacman.richtung = Spielvariablen.Richtungen.links;\n }\n if (PacManAltY > pacman.posY) {\n pacman.offsetY = this.factor;\n pacman.richtung = Spielvariablen.Richtungen.rechts;\n }\n if (PacManAltX < pacman.posX) {\n pacman.offsetX = -this.factor;\n pacman.richtung = Spielvariablen.Richtungen.hoch;\n }\n if (PacManAltX > pacman.posX) {\n pacman.offsetX = this.factor;\n pacman.richtung = Spielvariablen.Richtungen.runter;\n }\n\n\n if (pacman.posX == geist.posX && pacman.posY == geist.posY) {\n this.beendet = true;\n }\n //PacMan Bewegen Ende\n\n //gewinnüberprüfung\n if (this.beendet) {\n zustand.status = 3;\n Spielvariablen.Spielstart = false;\n }\n\n\n }\n\n }", "function mobileBoksEngin(evn){\n// custom plan\n\tvar customPlan = document.getElementById(\"boksPlanCustom\").value;\n\tdocument.getElementById(\"boksPlanContainer\").style.display = \"none\";\n\t\n\tswitch(evn){\n\t\tcase \"a\": \n\t\t\tplan = [1, 2, 1, 2, 1]; // selected round plan\n\t\t\tbreak;\n\t\t\n\t\tcase \"b\": \n\t\t\tplan = [1, 2, 3, 2, 1]; // selected round plan\n\t\t\tbreak;\n\t\t\n\t\tcase \"c\": \n\t\t\tplan = [1, 2, 3, 3, 2, 1]; // selected round plan\n\t\t\tbreak;\n\t\t\n\t\tcase \"d\":\n\t\t\tplan = [2, 3, 3, 3, 3, 2]; // selected round plan\n\t\t\tbreak;\n\t\t\n\t\tdefault:\n\t\t\t\tplan = customPlan; // user compouse round plan\n\t\t\tbreak;\n\t}\n\t\tsupport = plan[i] * 60; // sets the length of rounds (in seconds)\n\t\tflagFullscrin = true;\n\t\tfScreen();\n\t\tsetTimeout(\"mobilePlanEngin()\", 1000);\t\n}", "function coherencia(objeto){\n // extrae las variables nesesarias para la evaluacion\n var estructura= objeto.structure;\n var nivelagregacion=objeto.aggregationlevel;\n var tipointeractividad=objeto.interactivitytype; \n var nivelinteractivo=objeto.interactivitylevel;\n var tiporecursoeducativo=objeto.learningresourcetype;\n \n //inicializa las reglas y las variables de los pesos\n var r=0;\n var pesor1=0;\n var pesor2=0;\n var pesor3=0;\n\n //verifica las reglas que se van a evaluar\n if (estructura===\"atomic\" && nivelagregacion===\"1\"){\n r++;\n pesor1=1;\n }else if (estructura===\"atomic\" && nivelagregacion===\"2\"){\n r++;\n pesor1=0.5;\n }else if (estructura===\"atomic\" && nivelagregacion===\"3\"){\n r++;\n pesor1=0.25;\n }else if (estructura===\"atomic\" && nivelagregacion===\"4\"){\n r++;\n pesor1=0.125;\n }else if (estructura===\"collection\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5;\n }else if (estructura===\"networked\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5; \n }else if (estructura===\"hierarchical\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5; \n }else if (estructura===\"linear\" && nivelagregacion===\"1\"){\n r++;\n pesor1=0.5; \n }else if (estructura===\"collection\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion===\"4\") ){\n r++;\n pesor1=1; \n }else if (estructura===\"networked\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion===\"4\") ){\n r++;\n pesor1=1; \n }else if (estructura===\"hierarchical\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion===\"4\") ){\n r++;\n pesor1=1; \n }else if (estructura===\"linear\" && (nivelagregacion===\"2\" || \n nivelagregacion===\"3\" || \n nivelagregacion ===\"4\") ){\n r++;\n pesor1=1; \n }\n\n if (tipointeractividad===\"active\" && (nivelinteractivo===\"very high\" || \n nivelinteractivo===\"high\" || \n nivelinteractivo===\"medium\" || \n nivelinteractivo===\"low\" ||\n nivelinteractivo===\"very low\") ){\n $r++;\n $pesor2=1; \n }else if (tipointeractividad===\"mixed\" && (nivelinteractivo===\"very high\" || \n nivelinteractivo===\"high\" || \n nivelinteractivo===\"medium\" || \n nivelinteractivo===\"low\" ||\n nivelinteractivo===\"very low\") ){\n r++;\n pesor2=1;\n }else if (tipointeractividad===\"expositive\" && (nivelinteractivo===\"very high\" || \n nivelinteractivo===\"high\") ){\n r++;\n pesor2=0;\n }else if (tipointeractividad===\"expositive\" && nivelinteractivo===\"medium\" ){\n r++;\n pesor2=0.5;\n }else if (tipointeractividad===\"expositive\" && ( nivelinteractivo===\"low\" ||\n nivelinteractivo===\"very low\") ){\n r++;\n pesor2=1;\n } \n if ( tipointeractividad===\"active\" && (tiporecursoeducativo===\"exercise\" || \n tiporecursoeducativo===\"simulation\" || \n tiporecursoeducativo===\"questionnaire\" || \n tiporecursoeducativo===\"exam\" ||\n tiporecursoeducativo===\"experiment\" ||\n tiporecursoeducativo===\"problem statement\" ||\n tiporecursoeducativo===\"self assessment\") ){\n r++;\n pesor3=1; \n }else if (tiporecursoeducativo===\"active\" && (tiporecursoeducativo===\"diagram\" || \n tiporecursoeducativo===\"figure\" || \n tiporecursoeducativo===\"graph\" || \n tiporecursoeducativo===\"index\" ||\n tiporecursoeducativo===\"slide\" ||\n tiporecursoeducativo===\"table\" ||\n tiporecursoeducativo===\"narrative text\" ||\n tiporecursoeducativo===\"lecture\") ){\n r++;\n pesor3=0;\n \n }else if (tipointeractividad===\"expositive\" && (tiporecursoeducativo===\"exercise\" || \n tiporecursoeducativo===\"simulation\" || \n tiporecursoeducativo===\"questionnaire\" || \n tiporecursoeducativo===\"exam\" ||\n tiporecursoeducativo===\"experiment\" ||\n tiporecursoeducativo===\"problem statement\" ||\n tiporecursoeducativo===\"self assessment\") ){\n r++;\n pesor3=0; \n }else if (tipointeractividad===\"expositive\" && (tiporecursoeducativo===\"diagram\" || \n tiporecursoeducativo===\"figure\" || \n tiporecursoeducativo===\"graph\" || \n tiporecursoeducativo===\"index\" ||\n tiporecursoeducativo===\"slide\" ||\n tiporecursoeducativo===\"table\" ||\n tiporecursoeducativo===\"narrative text\" ||\n tiporecursoeducativo===\"lecture\") ){\n r++;\n pesor3=1;\n }else if (tipointeractividad===\"mixed\" && (tiporecursoeducativo===\"exercise\" || \n tiporecursoeducativo===\"simulation\" || \n tiporecursoeducativo===\"questionnaire\" || \n tiporecursoeducativo===\"exam\" ||\n tiporecursoeducativo===\"experiment\" ||\n tiporecursoeducativo===\"problem statement\" ||\n tiporecursoeducativo===\"self assessment\" ||\n tiporecursoeducativo===\"diagram\" ||\n tiporecursoeducativo===\"figure\" ||\n tiporecursoeducativo===\"graph\" ||\n tiporecursoeducativo===\"index\" ||\n tiporecursoeducativo===\"slide\" ||\n tiporecursoeducativo===\"table\" ||\n tiporecursoeducativo===\"narrative text\" ||\n tiporecursoeducativo===\"lecture\" )){\n r++;\n pesor3=1; \n } \n m_coherencia=0;\n if (r>0) {\n\n // hace la sumatoria de los pesos \n m_coherencia= ( pesor1 + pesor2 + pesor3) / r;\n \n \n //alert(mensaje);\n return m_coherencia;\n //echo \"* Coherencia de: \". m_coherencia.\"; \". evaluacion.\"<br><br>\";\n }else{\n \n return m_coherencia;\n \n }\n\n\n }", "function englobarymostrardivoep(habp,habr,habmv,habant,pplan,preal,pmv,pant,v3){\n\n\n \t//////////////////////////////////PLAN HABILITADORAS ////////////////////////////////////////////////\t\t\t\n\t\t\t\t\t\t// ESFUERZO PROPIO PLAN EN BOLIVARES \t\t\t\t\t\n\t\t\t\t\t\tvar laborepbsf = filtrarcostohab(habp,filtrolabor,5,'_p',1);\n\t\t\t\t\t\tvar bbepbsf = filtrarcostohab(habp,filtrobb,5,'_p',1);\n\t\t\t\t\t\tvar mepbsf = filtrarcostohab(habp,filtrom,5,'_p',1);\n\t\t\t\t\t\tvar scepbsf = filtrarcostohab(habp,filtrosc,5,'_p',1);\n\t\t\t\t\t\tvar oepbsf = filtrarcostohab(habp,filtroo,5,'_p',1);\n\t\t\t\t\t\tvar totalepbsf = filtrartotal(laborepbsf,bbepbsf,mepbsf,scepbsf,oepbsf);\n \n \t\t\t\t\t\t \t\t // ESFUERZOS PROPIOS PLAN EN DOLARES\n \t\t\t\t\t\t var laborepdol = filtrarcostohab(habp,filtrolabor,5,'_p',2);\n \t\t\t\t\t\t var bbepdol = filtrarcostohab(habp,filtrobb,5,'_p',2);\n \t\t\t\t\t\t var mepdol = filtrarcostohab(habp,filtrom,5,'_p',2);\n \t\t\t\t\t\t var scepdol = filtrarcostohab(habp,filtrosc,5,'_p',2);\n \t\t\t\t\t\t var oepdol = filtrarcostohab(habp,filtroo,5,'_p',2);\n \t\t\t\t\t\t var totalepdol = filtrartotal(laborepdol,bbepdol,mepdol,scepdol,oepdol);\n\n \t\t\t\t\t\t // DTTO ORIENTAL PLAN EN BOLIVARES\n\t\t\t\t\t \t var labordttobsf = filtrarcostohab(habp,filtrolabor,4,'_p',1);\n \t\t\t\t\t\t var bbdttobsf = filtrarcostohab(habp,filtrobb,4,'_p',1);\n \t\t\t\t\t\t var mdttobsf = filtrarcostohab(habp,filtrom,4,'_p',1);\n \t\t\t\t\t\t var scdttobsf = filtrarcostohab(habp,filtrosc,4,'_p',1);\n \t\t\t\t\t\t var odttobsf = filtrarcostohab(habp,filtroo,4,'_p',1);\n \t\t\t\t\t\t var totaldttobsf = filtrartotal(labordttobsf,bbdttobsf,mdttobsf,scdttobsf,odttobsf);\n\n \t\t\t\t\t\t // DTTO ORIENTAL PLAN EN DOLARES\n \t\t\t\t\t\t var labordttodol = filtrarcostohab(habp,filtrolabor,4,'_p',2);\n \t\t\t\t\t\t var bbdttodol = filtrarcostohab(habp,filtrobb,4,'_p',2);\n \t\t\t\t\t\t var mdttodol = filtrarcostohab(habp,filtrom,4,'_p',2);\n \t\t\t\t\t\t var scdttodol = filtrarcostohab(habp,filtrosc,4,'_p',2);\n \t\t\t\t\t\t var odttodol = filtrarcostohab(habp,filtroo,4,'_p',2);\n \t\t\t\t\t\t var totaldttodol = filtrartotal(labordttodol,bbdttodol,mdttodol,scdttodol,odttodol);\n\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL PLAN EN BOLIVARES\n \t\t\t\t\t\t var labordivobsf = filtrardivo(labordttobsf,laborepbsf);\n \t\t\t\t\t\t var bbdivobsf = filtrardivo(bbdttobsf,bbepbsf);\n \t\t\t\t\t\t var mdivobsf = filtrardivo(mdttobsf,mepbsf);\n \t\t\t\t\t\t var scdivobsf = filtrardivo(scdttobsf,scepbsf);\n \t\t\t\t\t\t var odivobsf = filtrardivo(odttobsf,oepbsf);\n \t\t\t\t\t\t var totaldivobsf = filtrartotal(labordivobsf,bbdivobsf,mdivobsf,scdivobsf,odivobsf);\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL PLAN EN DOLARES\n \t\t\t\t\t\t var labordivodol = filtrardivo(labordttodol,laborepdol);\n \t\t\t\t\t\t var bbdivodol = filtrardivo(bbdttodol,bbepdol);\n \t\t\t\t\t\t var mdivodol = filtrardivo(mdttodol,mepdol);\n \t\t\t\t\t\t var scdivodol = filtrardivo(scdttodol,scepdol);\n \t\t\t\t\t\t var odivodol = filtrardivo(odttodol,oepdol);\n \t\t\t\t\t\t var totaldivodol = filtrartotal(labordivodol,bbdivodol,mdivodol,scdivodol,odivodol);\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL PLAN EN DOLARES EQUIVALENTES\n \t\t\t\t\t\t var labordivoDeqv = filtroequivalente(labordivobsf,labordivodol);\n \t\t\t\t\t\t var bbdivoDeqv = filtroequivalente(bbdivobsf,bbdivodol);\n \t\t\t\t\t\t var mdivoDeqv = filtroequivalente(mdivobsf,mdivodol);\n \t\t\t\t\t\t var scdivoDeqv = filtroequivalente(scdivobsf,scdivodol);\n \t\t\t\t\t\t var odivoDeqv = filtroequivalente(odivobsf,odivodol);\n \t\t\t\t\t\t var totaldivoDeqv = filtrartotal(labordivoDeqv,bbdivoDeqv,mdivoDeqv,scdivoDeqv,odivoDeqv);\n\n \t\t\t\t\t\t ////////////////////// FIN PLAN ////////////////////////////////////////////////\n\n\n\n \t\t\t\t\t\t ////////////////REAL HABILITADORAS /////////////////////////\n\t\t\t\t\t\t\t\t// ESFUERZO PROPIO REAL EN BOLIVARES \n\t\t\t\t\t \t var laborepbsfr = filtrarcostohab(habr,filtrolabor,5,'_r',1);\n \t\t\t\t\t\t var bbepbsfr = filtrarcostohab(habr,filtrobb,5,'_r',1);\n \t\t\t\t\t\t var mepbsfr = filtrarcostohab(habr,filtrom,5,'_r',1);\n \t\t\t\t\t\t var scepbsfr = filtrarcostohab(habr,filtrosc,5,'_r',1);\n \t\t\t\t\t\t var oepbsfr = filtrarcostohab(habr,filtroo,5,'_r',1);\n \t\t\t\t\t\t var totalepbsfr = filtrartotal(laborepbsfr,bbepbsfr,mepbsfr,scepbsfr,oepbsfr);\n\n \t\t\t\t\t\t // ESFUERZOS PROPIOS REAL EN DOLARES\n \t\t\t\t\t\t var laborepdolr = filtrarcostohab(habr,filtrolabor,5,'_r',2);\n \t\t\t\t\t\t var bbepdolr = filtrarcostohab(habr,filtrobb,5,'_r',2);\n \t\t\t\t\t\t var mepdolr = filtrarcostohab(habr,filtrom,5,'_r',2);\n \t\t\t\t\t\t var scepdolr = filtrarcostohab(habr,filtrosc,5,'_r',2);\n \t\t\t\t\t\t var oepdolr = filtrarcostohab(habr,filtroo,5,'_r',2);\n \t\t\t\t\t\t var totalepdolr = filtrartotal(laborepdolr,bbepdolr,mepdolr,scepdolr,oepdolr);\n\n \t\t\t\t\t\t // DTTO ORIENTAL REAL EN BOLIVARES\n\t\t\t\t\t \t var labordttobsfr = filtrarcostohab(habr,filtrolabor,4,'_r',1);\n \t\t\t\t\t\t var bbdttobsfr = filtrarcostohab(habr,filtrobb,4,'_r',1);\n \t\t\t\t\t\t var mdttobsfr = filtrarcostohab(habr,filtrom,4,'_r',1);\n \t\t\t\t\t\t var scdttobsfr = filtrarcostohab(habr,filtrosc,4,'_r',1);\n \t\t\t\t\t\t var odttobsfr = filtrarcostohab(habr,filtroo,4,'_r',1);\n \t\t\t\t\t\t var totaldttobsfr = filtrartotal(labordttobsfr,bbdttobsfr,mdttobsfr,scdttobsfr,odttobsfr);\n\n \t\t\t\t\t\t // DTTO ORIENTAL REAL EN DOLARES\n \t\t\t\t\t\t var labordttodolr = filtrarcostohab(habr,filtrolabor,4,'_r',2);\n \t\t\t\t\t\t var bbdttodolr = filtrarcostohab(habr,filtrobb,4,'_r',2);\n \t\t\t\t\t\t var mdttodolr = filtrarcostohab(habr,filtrom,4,'_r',2);\n \t\t\t\t\t\t var scdttodolr = filtrarcostohab(habr,filtrosc,4,'_r',2);\n \t\t\t\t\t\t var odttodolr = filtrarcostohab(habr,filtroo,4,'_r',2);\n \t\t\t\t\t\t var totaldttodolr = filtrartotal(labordttodolr,bbdttodolr,mdttodolr,scdttodolr,odttodolr);\n\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL REAL EN BOLIVARES\n \t\t\t\t\t\t var labordivobsfr = filtrardivo(labordttobsfr,laborepbsfr);\n \t\t\t\t\t\t var bbdivobsfr = filtrardivo(bbdttobsfr,bbepbsfr);\n \t\t\t\t\t\t var mdivobsfr = filtrardivo(mdttobsfr,mepbsfr);\n \t\t\t\t\t\t var scdivobsfr = filtrardivo(scdttobsfr,scepbsfr);\n \t\t\t\t\t\t var odivobsfr = filtrardivo(odttobsfr,oepbsfr);\n \t\t\t\t\t\t var totaldivobsfr = filtrartotal(labordivobsfr,bbdivobsfr,mdivobsfr,scdivobsfr,odivobsfr);\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL REAL EN DOLARES\n \t\t\t\t\t\t var labordivodolr = filtrardivo(labordttodolr,laborepdolr);\n \t\t\t\t\t\t var bbdivodolr = filtrardivo(bbdttodolr,bbepdolr);\n \t\t\t\t\t\t var mdivodolr = filtrardivo(mdttodolr,mepdolr);\n \t\t\t\t\t\t var scdivodolr = filtrardivo(scdttodolr,scepdolr);\n \t\t\t\t\t\t var odivodolr = filtrardivo(odttodolr,oepdolr);\n \t\t\t\t\t\t var totaldivodolr = filtrartotal(labordivodolr,bbdivodolr,mdivodolr,scdivodolr,odivodolr);\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL REAL EN DOLARES EQUIVALENTES\n \t\t\t\t\t\t var labordivoDeqvr = filtroequivalente(labordivobsfr,labordivodolr);\n \t\t\t\t\t\t var bbdivoDeqvr = filtroequivalente(bbdivobsfr,bbdivodolr);\n \t\t\t\t\t\t var mdivoDeqvr = filtroequivalente(mdivobsfr,mdivodolr);\n \t\t\t\t\t\t var scdivoDeqvr = filtroequivalente(scdivobsfr,scdivodolr);\n \t\t\t\t\t\t var odivoDeqvr = filtroequivalente(odivobsfr,odivodolr);\n \t\t\t\t\t\t var totaldivoDeqvr = filtrartotal(labordivoDeqvr,bbdivoDeqvr,mdivoDeqvr,scdivoDeqvr,odivoDeqvr);\n\n \t\t\t\t\t\t /////////////FIN REAL ////////////////////////////////////////////////\n\n \t\t\t\t\t\t //////////////// MEJOR VISION ///////////////////////////////////////////////\n \t\t\t\t\t\t // ESFUERZO PROPIO REAL EN BOLIVARES \n\t\t\t\t\t \t var laborepbsfmv = filtrarcostohab(habmv,filtrolabor,5,'_mv',1);\n \t\t\t\t\t\t var bbepbsfmv = filtrarcostohab(habmv,filtrobb,5,'_mv',1);\n \t\t\t\t\t\t var mepbsfmv = filtrarcostohab(habmv,filtrom,5,'_mv',1);\n \t\t\t\t\t\t var scepbsfmv = filtrarcostohab(habmv,filtrosc,5,'_mv',1);\n \t\t\t\t\t\t var oepbsfmv = filtrarcostohab(habmv,filtroo,5,'_mv',1);\n \t\t\t\t\t\t var totalepbsfmv = filtrartotal(laborepbsfmv,bbepbsfmv,mepbsfmv,scepbsfmv,oepbsfmv);\n \t\t\t\t\t\t \n \t\t\t\t\t\t // ESFUERZOS PROPIOS REAL EN DOLARES\n \t\t\t\t\t\t var laborepdolmv = filtrarcostohab(habmv,filtrolabor,5,'_mv',2);\n \t\t\t\t\t\t var bbepdolmv = filtrarcostohab(habmv,filtrobb,5,'_mv',2);\n \t\t\t\t\t\t var mepdolmv = filtrarcostohab(habmv,filtrom,5,'_mv',2);\n \t\t\t\t\t\t var scepdolmv = filtrarcostohab(habmv,filtrosc,5,'_mv',2);\n \t\t\t\t\t\t var oepdolmv = filtrarcostohab(habmv,filtroo,5,'_mv',2);\n \t\t\t\t\t\t var totalepdolmv = filtrartotal(laborepdolmv,bbepdolmv,mepdolmv,scepdolmv,oepdolmv);\n\n \t\t\t\t\t\t // DTTO ORIENTAL REAL EN BOLIVARES\n\t\t\t\t\t \t var labordttobsfmv = filtrarcostohab(habmv,filtrolabor,4,'_mv',1);\n \t\t\t\t\t\t var bbdttobsfmv = filtrarcostohab(habmv,filtrobb,4,'_mv',1);\n \t\t\t\t\t\t var mdttobsfmv = filtrarcostohab(habmv,filtrom,4,'_mv',1);\n \t\t\t\t\t\t var scdttobsfmv = filtrarcostohab(habmv,filtrosc,4,'_mv',1);\n \t\t\t\t\t\t var odttobsfmv = filtrarcostohab(habmv,filtroo,4,'_mv',1);\n \t\t\t\t\t\t var totaldttobsfmv = filtrartotal(labordttobsfmv,bbdttobsfmv,mdttobsfmv,scdttobsfmv,odttobsfmv);\n\n \t\t\t\t\t\t // DTTO ORIENTAL REAL EN DOLARES\n \t\t\t\t\t\t var labordttodolmv = filtrarcostohab(habmv,filtrolabor,4,'_mv',2);\n \t\t\t\t\t\t var bbdttodolmv = filtrarcostohab(habmv,filtrobb,4,'_mv',2);\n \t\t\t\t\t\t var mdttodolmv = filtrarcostohab(habmv,filtrom,4,'_mv',2);\n \t\t\t\t\t\t var scdttodolmv = filtrarcostohab(habmv,filtrosc,4,'_mv',2);\n \t\t\t\t\t\t var odttodolmv = filtrarcostohab(habmv,filtroo,4,'_mv',2);\n \t\t\t\t\t\t var totaldttodolmv = filtrartotal(labordttodolmv,bbdttodolmv,mdttodolmv,scdttodolmv,odttodolmv);\n\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL REAL EN BOLIVARES\n \t\t\t\t\t\t var labordivobsfmv = filtrardivo(labordttobsfmv,laborepbsfmv);\n \t\t\t\t\t\t var bbdivobsfmv = filtrardivo(bbdttobsfmv,bbepbsfmv);\n \t\t\t\t\t\t var mdivobsfmv = filtrardivo(mdttobsfmv,mepbsfmv);\n \t\t\t\t\t\t var scdivobsfmv = filtrardivo(scdttobsfmv,scepbsfmv);\n \t\t\t\t\t\t var odivobsfmv = filtrardivo(odttobsfmv,oepbsfmv);\n \t\t\t\t\t\t var totaldivobsfmv = filtrartotal(labordivobsfmv,bbdivobsfmv,mdivobsfmv,scdivobsfmv,odivobsfmv);\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL REAL EN DOLARES\n \t\t\t\t\t\t var labordivodolmv = filtrardivo(labordttodolmv,laborepdolmv);\n \t\t\t\t\t\t var bbdivodolmv = filtrardivo(bbdttodolmv,bbepdolmv);\n \t\t\t\t\t\t var mdivodolmv = filtrardivo(mdttodolmv,mepdolmv);\n \t\t\t\t\t\t var scdivodolmv = filtrardivo(scdttodolmv,scepdolmv);\n \t\t\t\t\t\t var odivodolmv = filtrardivo(odttodolmv,oepdolmv);\n \t\t\t\t\t\t var totaldivodolmv = filtrartotal(labordivodolmv,bbdivodolmv,mdivodolmv,scdivodolmv,odivodolmv);\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL REAL EN DOLARES EQUIVALENTES\n \t\t\t\t\t\t var labordivoDeqvmv = filtroequivalente(labordivobsfmv,labordivodolmv);\n \t\t\t\t\t\t var bbdivoDeqvmv = filtroequivalente(bbdivobsfmv,bbdivodolmv);\n \t\t\t\t\t\t var mdivoDeqvmv = filtroequivalente(mdivobsfmv,mdivodolmv);\n \t\t\t\t\t\t var scdivoDeqvmv = filtroequivalente(scdivobsfmv,scdivodolmv);\n \t\t\t\t\t\t var odivoDeqvmv = filtroequivalente(odivobsfmv,odivodolmv);\n \t\t\t\t\t\t var totaldivoDeqvmv = filtrartotal(labordivoDeqvmv,bbdivoDeqvmv,mdivoDeqvmv,scdivoDeqvmv,odivoDeqvmv);\n\n \t\t\t\t\t\tvar aux=0;\n \t\t\t\t\t\t// labor y beneficio de real, MMBSF, MM$, MMEQUIV\n \t\t\t\t\t\tvar laborybbdivobsfr = filtrardivo(labordivobsfr,bbdivobsfr); \n \t\t\t\t\t\tvar laborybbdivodolr = filtrardivo(labordivodolr,bbdivodolr); \n \t\t\t\t\t\tvar laborybbdivoDeqvr= filtrardivo(labordivoDeqvr,bbdivoDeqvr);\n \t\t\t\t\t\t// labor y beneficio de plan MMBSF,MM$, MMEQUIV\n \t\t\t\t\t\tvar laborybbdivobsf = filtrardivo(labordivobsf,bbdivobsf); \n \t\t\t\t\t\tvar laborybbdivodol = filtrardivo(labordivodol,bbdivodol); \n \t\t\t\t\t\tvar laborybbdivoDeqv = filtrardivo(labordivoDeqv,bbdivoDeqv);\n \t\t\t\t\t\t// Labor y beneficio de mejor vision MMBSF, MM$, MMEQUIV\n \t\t\t\t\t\tvar laborybbdivobsfmv = filtrardivo(labordivobsfmv,bbdivobsfmv); \n \t\t\t\t\t\tvar laborybbdivodolmv = filtrardivo(labordivodolmv,bbdivodolmv); \n \t\t\t\t\t\tvar laborybbdivoDeqvmv = filtrardivo(labordivoDeqvmv,bbdivoDeqvmv);\n\n\n\n \t\t\t\t\t\t////////////// HABILITADORAS ANTEPROYECTOS //////////////////////////////\n \t\t\t\t\t\t// ESFUERZO PROPIO REAL EN BOLIVARES \n\t\t\t\t\t \t var laborepbsfant = filtrarcostohab(habant,filtrolabor,5,'_ant',1);\n \t\t\t\t\t\t var bbepbsfant = filtrarcostohab(habant,filtrobb,5,'_ant',1);\n \t\t\t\t\t\t var mepbsfant = filtrarcostohab(habant,filtrom,5,'_ant',1);\n \t\t\t\t\t\t var scepbsfant = filtrarcostohab(habant,filtrosc,5,'_ant',1);\n \t\t\t\t\t\t var oepbsfant = filtrarcostohab(habant,filtroo,5,'_ant',1);\n \t\t\t\t\t\t var totalepbsfant = filtrartotal(laborepbsfant,bbepbsfant,mepbsfant,scepbsfant,oepbsfant);\n \t\t\t\t\t\t \n \t\t\t\t\t\t // ESFUERZOS PROPIOS REAL EN DOLARES\n \t\t\t\t\t\t var laborepdolant = filtrarcostohab(habant,filtrolabor,5,'_ant',2);\n \t\t\t\t\t\t var bbepdolant = filtrarcostohab(habant,filtrobb,5,'_ant',2);\n \t\t\t\t\t\t var mepdolant = filtrarcostohab(habant,filtrom,5,'_ant',2);\n \t\t\t\t\t\t var scepdolant = filtrarcostohab(habant,filtrosc,5,'_ant',2);\n \t\t\t\t\t\t var oepdolant = filtrarcostohab(habant,filtroo,5,'_ant',2);\n \t\t\t\t\t\t var totalepdolant = filtrartotal(laborepdolant,bbepdolant,mepdolant,scepdolant,oepdolant);\n\n \t\t\t\t\t\t // DTTO ORIENTAL REAL EN BOLIVARES\n\t\t\t\t\t \t var labordttobsfant = filtrarcostohab(habant,filtrolabor,4,'_ant',1);\n \t\t\t\t\t\t var bbdttobsfant = filtrarcostohab(habant,filtrobb,4,'_ant',1);\n \t\t\t\t\t\t var mdttobsfant = filtrarcostohab(habant,filtrom,4,'_ant',1);\n \t\t\t\t\t\t var scdttobsfant = filtrarcostohab(habant,filtrosc,4,'_ant',1);\n \t\t\t\t\t\t var odttobsfant = filtrarcostohab(habant,filtroo,4,'_ant',1);\n \t\t\t\t\t\t var totaldttobsfant = filtrartotal(labordttobsfant,bbdttobsfant,mdttobsfant,scdttobsfant,odttobsfant);\n\n \t\t\t\t\t\t // DTTO ORIENTAL REAL EN DOLARES\n \t\t\t\t\t\t var labordttodolant = filtrarcostohab(habant,filtrolabor,4,'_ant',2);\n \t\t\t\t\t\t var bbdttodolant = filtrarcostohab(habant,filtrobb,4,'_ant',2);\n \t\t\t\t\t\t var mdttodolant = filtrarcostohab(habant,filtrom,4,'_ant',2);\n \t\t\t\t\t\t var scdttodolant = filtrarcostohab(habant,filtrosc,4,'_ant',2);\n \t\t\t\t\t\t var odttodolant = filtrarcostohab(habant,filtroo,4,'_ant',2);\n \t\t\t\t\t\t var totaldttodolant = filtrartotal(labordttodolant,bbdttodolant,mdttodolant,scdttodolant,odttodolant);\n\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL REAL EN BOLIVARES\n \t\t\t\t\t\t var labordivobsfant = filtrardivo(labordttobsfant,laborepbsfant);\n \t\t\t\t\t\t var bbdivobsfant = filtrardivo(bbdttobsfant,bbepbsfant);\n \t\t\t\t\t\t var mdivobsfant = filtrardivo(mdttobsfant,mepbsfant);\n \t\t\t\t\t\t var scdivobsfant = filtrardivo(scdttobsfant,scepbsfant);\n \t\t\t\t\t\t var odivobsfant = filtrardivo(odttobsfant,oepbsfant);\n \t\t\t\t\t\t var totaldivobsfant = filtrartotal(labordivobsfant,bbdivobsfant,mdivobsfant,scdivobsfant,odivobsfant);\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL REAL EN DOLARES\n \t\t\t\t\t\t var labordivodolant = filtrardivo(labordttodolant,laborepdolant);\n \t\t\t\t\t\t var bbdivodolant = filtrardivo(bbdttodolant,bbepdolant);\n \t\t\t\t\t\t var mdivodolant = filtrardivo(mdttodolant,mepdolant);\n \t\t\t\t\t\t var scdivodolant = filtrardivo(scdttodolant,scepdolant);\n \t\t\t\t\t\t var odivodolant = filtrardivo(odttodolant,oepdolant);\n \t\t\t\t\t\t var totaldivodolant = filtrartotal(labordivodolant,bbdivodolant,mdivodolant,scdivodolant,odivodolant);\n\n \t\t\t\t\t\t /// DIVISION ORIENTAL REAL EN DOLARES EQUIVALENTES\n \t\t\t\t\t\t var labordivoDeqvant = filtroequivalente(labordivobsfant,labordivodolant);\n \t\t\t\t\t\t var bbdivoDeqvant = filtroequivalente(bbdivobsfant,bbdivodolant);\n \t\t\t\t\t\t var mdivoDeqvant = filtroequivalente(mdivobsfant,mdivodolant);\n \t\t\t\t\t\t var scdivoDeqvant = filtroequivalente(scdivobsfant,scdivodolant);\n \t\t\t\t\t\t var odivoDeqvant = filtroequivalente(odivobsfant,odivodolant);\n \t\t\t\t\t\t var totaldivoDeqvant = filtrartotal(labordivoDeqvant,bbdivoDeqvant,mdivoDeqvant,scdivoDeqvant,odivoDeqvant);\n\n \t\t\t\t\t\t \n \t\t\t\t\t\t// Labor y beneficio de mejor vision MMBSF, MM$, MMEQUIV\n \t\t\t\t\t\tvar laborybbdivobsfant = filtrardivo(labordivobsfant,bbdivobsfant); \n \t\t\t\t\t\tvar laborybbdivodolant = filtrardivo(labordivodolant,bbdivodolant); \n \t\t\t\t\t\tvar laborybbdivoDeqvant = filtrardivo(labordivoDeqvant,bbdivoDeqvant);\n\n\n \t\t\t\t\t\t///////PLAN PROYECTOS////////////////////////////////////////////////////////////\n\n \t\t\t\t\t\t// CATEGORIA GEOFISICA\n \t\t\t\t\t\tvar pgeobsf = categoriaproyectos(pplan,geofisica,'_p',1);\n \t\t\t\t\t\tvar pgeodol = categoriaproyectos(pplan,geofisica,'_p',2);\n \t\t\t\t\t\tvar pgeoDeqv = filtroequivalente(pgeobsf,pgeodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION DE AVANZADA\n \t\t\t\t\t\tvar pperfavanzbsf = categoriaproyectos(pplan,perfavanz,'_p',1);\n \t\t\t\t\t\tvar pperfavanzdol = categoriaproyectos(pplan,perfavanz,'_p',2);\n \t\t\t\t\t\tvar pperfavanzDeqv = filtroequivalente(pperfavanzbsf,pperfavanzdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION DE DESARROLLO \n \t\t\t\t\t\tvar pperfdesarrobsf = categoriaproyectos(pplan,perfdesarro,'_p',1);\n \t\t\t\t\t\tvar pperfdesarrodol = categoriaproyectos(pplan,perfdesarro,'_p',2);\n \t\t\t\t\t\tvar pperfdesarroDeqv = filtroequivalente(pperfdesarrobsf,pperfdesarrodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION EXPLORATORIA\n \t\t\t\t\t\tvar pperfexplorabsf = categoriaproyectos(pplan,perfexplora,'_p',1);\n \t\t\t\t\t\tvar pperfexploradol = categoriaproyectos(pplan,perfexplora,'_p',2);\n \t\t\t\t\t\tvar pperfexploraDeqv = filtroequivalente(pperfexplorabsf,pperfexploradol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECUPERACION ADICIONAL\n \t\t\t\t\t\tvar precupadicbsf = categoriaproyectos(pplan,recupadic,'_p',1);\n \t\t\t\t\t\tvar precupadicdol = categoriaproyectos(pplan,recupadic,'_p',2);\n \t\t\t\t\t\tvar precupadicDeqv = filtroequivalente(precupadicbsf,precupadicdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECOMPLETACION DE POZOS\n \t\t\t\t\t\tvar precompozosbsf = categoriaproyectos(pplan,recompozos,'_p',1);\n \t\t\t\t\t\tvar precompozosdol = categoriaproyectos(pplan,recompozos,'_p',2);\n \t\t\t\t\t\tvar precompozosDeqv = filtroequivalente(precompozosbsf,precompozosdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECUPERACION SUPLEMENTARIA\n \t\t\t\t\t\tvar precupesuplebsf = categoriaproyectos(pplan,recupesuple,'_p',1);\n \t\t\t\t\t\tvar precupesupledol = categoriaproyectos(pplan,recupesuple,'_p',2);\n \t\t\t\t\t\tvar precupesupleDeqv = filtroequivalente(precupesuplebsf,precupesupledol);\n \t\t\t\t\t\t///////////////////////////\t\n \t\t\t\t\t\t// CATEGORIA INYECCCION ALTERNA DE VAPOR\n \t\t\t\t\t\tvar pinyectalternavaporbsf = categoriaproyectos(pplan,inyectalternavapor,'_p',1);\n \t\t\t\t\t\tvar pinyectalternavapordol = categoriaproyectos(pplan,inyectalternavapor,'_p',2);\n \t\t\t\t\t\tvar pinyectalternavaporDeqv = filtroequivalente(pinyectalternavaporbsf,pinyectalternavapordol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA LEVANTAMIENTO ARTIFICIAL\n \t\t\t\t\t\tvar plevantamientoartifbsf = categoriaproyectos(pplan,levantamientoartif,'_p',1);\n \t\t\t\t\t\tvar plevantamientoartifdol = categoriaproyectos(pplan,levantamientoartif,'_p',2);\n \t\t\t\t\t\tvar plevantamientoartifDeqv = filtroequivalente(plevantamientoartifbsf,plevantamientoartifdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA CONSERVACION Y UTILIZACION DEL GAS\n \t\t\t\t\t\tvar pconutigasbsf = categoriaproyectos(pplan,conutigas,'_p',1);\n \t\t\t\t\t\tvar pconutigasdol = categoriaproyectos(pplan,conutigas,'_p',2);\n \t\t\t\t\t\tvar pconutigasDeqv = filtroequivalente(pconutigasbsf,pconutigasdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PLANTA DE LIQUIDOS GAS \n \t\t\t\t\t\tvar pplantliqgasbsf = categoriaproyectos(pplan,plantliqgas,'_p',1);\n \t\t\t\t\t\tvar pplantliqgasdol = categoriaproyectos(pplan,plantliqgas,'_p',2);\n \t\t\t\t\t\tvar pplantliqgasDeqv = filtroequivalente(pplantliqgasbsf,pplantliqgasdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA INTALACIONES DE PRODUCCION\n \t\t\t\t\t\tvar pinstproducbsf = categoriaproyectos(pplan,instproduc,'_p',1);\n \t\t\t\t\t\tvar pinstproducdol = categoriaproyectos(pplan,instproduc,'_p',2);\n \t\t\t\t\t\tvar pinstproducDeqv = filtroequivalente(pinstproducbsf,pinstproducdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA OLEODUCTO Y TERMINALES DE EMBARQUE\n \t\t\t\t\t\tvar poleoterminaembbsf = categoriaproyectos(pplan,oleoterminaemb,'_p',1);\n \t\t\t\t\t\tvar poleoterminaembdol = categoriaproyectos(pplan,oleoterminaemb,'_p',2);\n \t\t\t\t\t\tvar poleoterminaembDeqv = filtroequivalente(poleoterminaembbsf,poleoterminaembdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA ALMACENAMIENTO\n \t\t\t\t\t\tvar palmacenamientobsf = categoriaproyectos(pplan,almacenamiento,'_p',1);\n \t\t\t\t\t\tvar palmacenamientodol = categoriaproyectos(pplan,almacenamiento,'_p',2);\n \t\t\t\t\t\tvar palmacenamientoDeqv = filtroequivalente(palmacenamientobsf,palmacenamientodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA DESARROLLO URBANO\n \t\t\t\t\t\tvar pdesarrollourbabsf = categoriaproyectos(pplan,desarrollourba,'_p',1);\n \t\t\t\t\t\tvar pdesarrollourbadol = categoriaproyectos(pplan,desarrollourba,'_p',2);\n \t\t\t\t\t\tvar pdesarrollourbaDeqv = filtroequivalente(pdesarrollourbabsf,pdesarrollourbadol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PROTECCION INTEGRAL\n \t\t\t\t\t\tvar pproteccionintegbsf = categoriaproyectos(pplan,proteccioninteg,'_p',1);\n \t\t\t\t\t\tvar pproteccionintegdol = categoriaproyectos(pplan,proteccioninteg,'_p',2);\n \t\t\t\t\t\tvar pproteccionintegDeqv = filtroequivalente(pproteccionintegbsf,pproteccionintegdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PREVENCION Y CONTROL DE PERDIDAS\n \t\t\t\t\t\tvar ppcpbsf = categoriaproyectos(pplan,pcp,'_p',1);\n \t\t\t\t\t\tvar ppcpdol = categoriaproyectos(pplan,pcp,'_p',2);\n \t\t\t\t\t\tvar ppcpDeqv = filtroequivalente(ppcpbsf,ppcpdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA TELECOMUNICACIONES\n \t\t\t\t\t\tvar ptelecomunicacionesbsf = categoriaproyectos(pplan,telecomunicaciones,'_p',1);\n \t\t\t\t\t\tvar ptelecomunicacionesdol = categoriaproyectos(pplan,telecomunicaciones,'_p',2);\n \t\t\t\t\t\tvar ptelecomunicacionesDeqv = filtroequivalente(ptelecomunicacionesbsf,ptelecomunicacionesdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA AUTOMATIZACION INDUSTRIAL\n \t\t\t\t\t\tvar pautomatizacionindbsf = categoriaproyectos(pplan,automatizacionind,'_p',1);\n \t\t\t\t\t\tvar pautomatizacioninddol = categoriaproyectos(pplan,automatizacionind,'_p',2);\n \t\t\t\t\t\tvar pautomatizacionindDeqv = filtroequivalente(pautomatizacionindbsf,pautomatizacioninddol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA COMPUTACION Y SISTEMA\n \t\t\t\t\t\tvar pcomputaysistebsf = categoriaproyectos(pplan,computaysiste,'_p',1);\n \t\t\t\t\t\tvar pcomputaysistedol = categoriaproyectos(pplan,computaysiste,'_p',2);\n \t\t\t\t\t\tvar pcomputaysisteDeqv = filtroequivalente(pcomputaysistebsf,pcomputaysistedol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA EDIFICACIONES E INSTALACIONES INDUSTRIALES\n \t\t\t\t\t\tvar pedifinstindustbsf = categoriaproyectos(pplan,edifinstindust,'_p',1);\n \t\t\t\t\t\tvar pedifinstindustdol = categoriaproyectos(pplan,edifinstindust,'_p',2);\n \t\t\t\t\t\tvar pedifinstindustDeqv = filtroequivalente(pedifinstindustbsf,pedifinstindustdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA EQUIPOS\n \t\t\t\t\t\tvar pequiposbsf = categoriaproyectos(pplan,equipos,'_p',1);\n \t\t\t\t\t\tvar pequiposdol = categoriaproyectos(pplan,equipos,'_p',2);\n \t\t\t\t\t\tvar pequiposDeqv = filtroequivalente(pequiposbsf,pequiposdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA OTRAS INVERSIONES\n \t\t\t\t\t\tvar potrasinvbsf = categoriaproyectos(pplan,otrasinv,'_p',1);\n \t\t\t\t\t\tvar potrasinvdol = categoriaproyectos(pplan,otrasinv,'_p',2);\n \t\t\t\t\t\tvar potrasinvDeqv = filtroequivalente(potrasinvbsf,potrasinvdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t \n \t\t\t\t\t\t\n \t\t\t\t\t\t///////REAL PROYECTOS////////////////////////////////////////////////////////////\n\n \t\t\t\t\t\t// CATEGORIA GEOFISICA\n \t\t\t\t\t\tvar rgeobsf = categoriaproyectos(preal,geofisica,'_p',1);\n \t\t\t\t\t\tvar rgeodol = categoriaproyectos(preal,geofisica,'_p',2);\n \t\t\t\t\t\tvar rgeoDeqv = filtroequivalente(rgeobsf,rgeodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION DE AVANZADA\n \t\t\t\t\t\tvar rperfavanzbsf = categoriaproyectos(preal,perfavanz,'_p',1);\n \t\t\t\t\t\tvar rperfavanzdol = categoriaproyectos(preal,perfavanz,'_p',2);\n \t\t\t\t\t\tvar rperfavanzDeqv = filtroequivalente(rperfavanzbsf,rperfavanzdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION DE DESARROLLO \n \t\t\t\t\t\tvar rperfdesarrobsf = categoriaproyectos(preal,perfdesarro,'_p',1);\n \t\t\t\t\t\tvar rperfdesarrodol = categoriaproyectos(preal,perfdesarro,'_p',2);\n \t\t\t\t\t\tvar rperfdesarroDeqv = filtroequivalente(rperfdesarrobsf,rperfdesarrodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION EXPLORATORIA\n \t\t\t\t\t\tvar rperfexplorabsf = categoriaproyectos(preal,perfexplora,'_p',1);\n \t\t\t\t\t\tvar rperfexploradol = categoriaproyectos(preal,perfexplora,'_p',2);\n \t\t\t\t\t\tvar rperfexploraDeqv = filtroequivalente(rperfexplorabsf,rperfexploradol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECUPERACION ADICIONAL\n \t\t\t\t\t\tvar rrecupadicbsf = categoriaproyectos(preal,recupadic,'_p',1);\n \t\t\t\t\t\tvar rrecupadicdol = categoriaproyectos(preal,recupadic,'_p',2);\n \t\t\t\t\t\tvar rrecupadicDeqv = filtroequivalente(rrecupadicbsf,rrecupadicdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECOMPLETACION DE POZOS\n \t\t\t\t\t\tvar rrecompozosbsf = categoriaproyectos(preal,recompozos,'_p',1);\n \t\t\t\t\t\tvar rrecompozosdol = categoriaproyectos(preal,recompozos,'_p',2);\n \t\t\t\t\t\tvar rrecompozosDeqv = filtroequivalente(rrecompozosbsf,rrecompozosdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECUPERACION SUPLEMENTARIA\n \t\t\t\t\t\tvar rrecupesuplebsf = categoriaproyectos(preal,recupesuple,'_p',1);\n \t\t\t\t\t\tvar rrecupesupledol = categoriaproyectos(preal,recupesuple,'_p',2);\n \t\t\t\t\t\tvar rrecupesupleDeqv = filtroequivalente(rrecupesuplebsf,rrecupesupledol);\n \t\t\t\t\t\t///////////////////////////\t\n \t\t\t\t\t\t// CATEGORIA INYECCCION ALTERNA DE VAPOR\n \t\t\t\t\t\tvar rinyectalternavaporbsf = categoriaproyectos(preal,inyectalternavapor,'_p',1);\n \t\t\t\t\t\tvar rinyectalternavapordol = categoriaproyectos(preal,inyectalternavapor,'_p',2);\n \t\t\t\t\t\tvar rinyectalternavaporDeqv = filtroequivalente(rinyectalternavaporbsf,rinyectalternavapordol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA LEVANTAMIENTO ARTIFICIAL\n \t\t\t\t\t\tvar rlevantamientoartifbsf = categoriaproyectos(preal,levantamientoartif,'_p',1);\n \t\t\t\t\t\tvar rlevantamientoartifdol = categoriaproyectos(preal,levantamientoartif,'_p',2);\n \t\t\t\t\t\tvar rlevantamientoartifDeqv = filtroequivalente(rlevantamientoartifbsf,rlevantamientoartifdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA CONSERVACION Y UTILIZACION DEL GAS\n \t\t\t\t\t\tvar rconutigasbsf = categoriaproyectos(preal,conutigas,'_p',1);\n \t\t\t\t\t\tvar rconutigasdol = categoriaproyectos(preal,conutigas,'_p',2);\n \t\t\t\t\t\tvar rconutigasDeqv = filtroequivalente(rconutigasbsf,rconutigasdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PLANTA DE LIQUIDOS GAS \n \t\t\t\t\t\tvar rplantliqgasbsf = categoriaproyectos(preal,plantliqgas,'_p',1);\n \t\t\t\t\t\tvar rplantliqgasdol = categoriaproyectos(preal,plantliqgas,'_p',2);\n \t\t\t\t\t\tvar rplantliqgasDeqv = filtroequivalente(rplantliqgasbsf,rplantliqgasdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA INTALACIONES DE PRODUCCION\n \t\t\t\t\t\tvar rinstproducbsf = categoriaproyectos(preal,instproduc,'_p',1);\n \t\t\t\t\t\tvar rinstproducdol = categoriaproyectos(preal,instproduc,'_p',2);\n \t\t\t\t\t\tvar rinstproducDeqv = filtroequivalente(rinstproducbsf,rinstproducdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA OLEODUCTO Y TERMINALES DE EMBARQUE\n \t\t\t\t\t\tvar roleoterminaembbsf = categoriaproyectos(preal,oleoterminaemb,'_p',1);\n \t\t\t\t\t\tvar roleoterminaembdol = categoriaproyectos(preal,oleoterminaemb,'_p',2);\n \t\t\t\t\t\tvar roleoterminaembDeqv = filtroequivalente(roleoterminaembbsf,roleoterminaembdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA ALMACENAMIENTO\n \t\t\t\t\t\tvar ralmacenamientobsf = categoriaproyectos(preal,almacenamiento,'_p',1);\n \t\t\t\t\t\tvar ralmacenamientodol = categoriaproyectos(preal,almacenamiento,'_p',2);\n \t\t\t\t\t\tvar ralmacenamientoDeqv = filtroequivalente(ralmacenamientobsf,ralmacenamientodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA DESARROLLO URBANO\n \t\t\t\t\t\tvar rdesarrollourbabsf = categoriaproyectos(preal,desarrollourba,'_p',1);\n \t\t\t\t\t\tvar rdesarrollourbadol = categoriaproyectos(preal,desarrollourba,'_p',2);\n \t\t\t\t\t\tvar rdesarrollourbaDeqv = filtroequivalente(rdesarrollourbabsf,rdesarrollourbadol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PROTECCION INTEGRAL\n \t\t\t\t\t\tvar rproteccionintegbsf = categoriaproyectos(preal,proteccioninteg,'_p',1);\n \t\t\t\t\t\tvar rproteccionintegdol = categoriaproyectos(preal,proteccioninteg,'_p',2);\n \t\t\t\t\t\tvar rproteccionintegDeqv = filtroequivalente(rproteccionintegbsf,rproteccionintegdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PREVENCION Y CONTROL DE PERDIDAS\n \t\t\t\t\t\tvar rpcpbsf = categoriaproyectos(preal,pcp,'_p',1);\n \t\t\t\t\t\tvar rpcpdol = categoriaproyectos(preal,pcp,'_p',2);\n \t\t\t\t\t\tvar rpcpDeqv = filtroequivalente(rpcpbsf,rpcpdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA TELECOMUNICACIONES\n \t\t\t\t\t\tvar rtelecomunicacionesbsf = categoriaproyectos(preal,telecomunicaciones,'_p',1);\n \t\t\t\t\t\tvar rtelecomunicacionesdol = categoriaproyectos(preal,telecomunicaciones,'_p',2);\n \t\t\t\t\t\tvar rtelecomunicacionesDeqv = filtroequivalente(rtelecomunicacionesbsf,rtelecomunicacionesdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA AUTOMATIZACION INDUSTRIAL\n \t\t\t\t\t\tvar rautomatizacionindbsf = categoriaproyectos(preal,automatizacionind,'_p',1);\n \t\t\t\t\t\tvar rautomatizacioninddol = categoriaproyectos(preal,automatizacionind,'_p',2);\n \t\t\t\t\t\tvar rautomatizacionindDeqv = filtroequivalente(rautomatizacionindbsf,rautomatizacioninddol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA COMPUTACION Y SISTEMA\n \t\t\t\t\t\tvar rcomputaysistebsf = categoriaproyectos(preal,computaysiste,'_p',1);\n \t\t\t\t\t\tvar rcomputaysistedol = categoriaproyectos(preal,computaysiste,'_p',2);\n \t\t\t\t\t\tvar rcomputaysisteDeqv = filtroequivalente(rcomputaysistebsf,rcomputaysistedol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA EDIFICACIONES E INSTALACIONES INDUSTRIALES\n \t\t\t\t\t\tvar redifinstindustbsf = categoriaproyectos(preal,edifinstindust,'_p',1);\n \t\t\t\t\t\tvar redifinstindustdol = categoriaproyectos(preal,edifinstindust,'_p',2);\n \t\t\t\t\t\tvar redifinstindustDeqv = filtroequivalente(redifinstindustbsf,redifinstindustdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA EQUIPOS\n \t\t\t\t\t\tvar requiposbsf = categoriaproyectos(preal,equipos,'_p',1);\n \t\t\t\t\t\tvar requiposdol = categoriaproyectos(preal,equipos,'_p',2);\n \t\t\t\t\t\tvar requiposDeqv = filtroequivalente(requiposbsf,requiposdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA OTRAS INVERSIONES\n \t\t\t\t\t\tvar rotrasinvbsf = categoriaproyectos(preal,otrasinv,'_p',1);\n \t\t\t\t\t\tvar rotrasinvdol = categoriaproyectos(preal,otrasinv,'_p',2);\n \t\t\t\t\t\tvar rotrasinvDeqv = filtroequivalente(rotrasinvbsf,rotrasinvdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t \n \t\t\t\t\t\t///////MEJOR VISION PROYECTOS////////////////////////////////////////////////////////////\n\n \t\t\t\t\t\t// CATEGORIA GEOFISICA\n \t\t\t\t\t\tvar mvgeobsf = categoriaproyectos(pmv,geofisica,'_p',1);\n \t\t\t\t\t\tvar mvgeodol = categoriaproyectos(pmv,geofisica,'_p',2);\n \t\t\t\t\t\tvar mvgeoDeqv = filtroequivalente(mvgeobsf,mvgeodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION DE AVANZADA\n \t\t\t\t\t\tvar mvperfavanzbsf = categoriaproyectos(pmv,perfavanz,'_p',1);\n \t\t\t\t\t\tvar mvperfavanzdol = categoriaproyectos(pmv,perfavanz,'_p',2);\n \t\t\t\t\t\tvar mvperfavanzDeqv = filtroequivalente(mvperfavanzbsf,mvperfavanzdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION DE DESARROLLO \n \t\t\t\t\t\tvar mvperfdesarrobsf = categoriaproyectos(pmv,perfdesarro,'_p',1);\n \t\t\t\t\t\tvar mvperfdesarrodol = categoriaproyectos(pmv,perfdesarro,'_p',2);\n \t\t\t\t\t\tvar mvperfdesarroDeqv = filtroequivalente(mvperfdesarrobsf,mvperfdesarrodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION EXPLORATORIA\n \t\t\t\t\t\tvar mvperfexplorabsf = categoriaproyectos(pmv,perfexplora,'_p',1);\n \t\t\t\t\t\tvar mvperfexploradol = categoriaproyectos(pmv,perfexplora,'_p',2);\n \t\t\t\t\t\tvar mvperfexploraDeqv = filtroequivalente(mvperfexplorabsf,mvperfexploradol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECUPERACION ADICIONAL\n \t\t\t\t\t\tvar mvrecupadicbsf = categoriaproyectos(pmv,recupadic,'_p',1);\n \t\t\t\t\t\tvar mvrecupadicdol = categoriaproyectos(pmv,recupadic,'_p',2);\n \t\t\t\t\t\tvar mvrecupadicDeqv = filtroequivalente(mvrecupadicbsf,mvrecupadicdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECOMPLETACION DE POZOS\n \t\t\t\t\t\tvar mvrecompozosbsf = categoriaproyectos(pmv,recompozos,'_p',1);\n \t\t\t\t\t\tvar mvrecompozosdol = categoriaproyectos(pmv,recompozos,'_p',2);\n \t\t\t\t\t\tvar mvrecompozosDeqv = filtroequivalente(mvrecompozosbsf,mvrecompozosdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECUPERACION SUPLEMENTARIA\n \t\t\t\t\t\tvar mvrecupesuplebsf = categoriaproyectos(pmv,recupesuple,'_p',1);\n \t\t\t\t\t\tvar mvrecupesupledol = categoriaproyectos(pmv,recupesuple,'_p',2);\n \t\t\t\t\t\tvar mvrecupesupleDeqv = filtroequivalente(mvrecupesuplebsf,mvrecupesupledol);\n \t\t\t\t\t\t///////////////////////////\t\n \t\t\t\t\t\t// CATEGORIA INYECCCION ALTERNA DE VAPOR\n \t\t\t\t\t\tvar mvinyectalternavaporbsf = categoriaproyectos(pmv,inyectalternavapor,'_p',1);\n \t\t\t\t\t\tvar mvinyectalternavapordol = categoriaproyectos(pmv,inyectalternavapor,'_p',2);\n \t\t\t\t\t\tvar mvinyectalternavaporDeqv = filtroequivalente(mvinyectalternavaporbsf,mvinyectalternavapordol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA LEVANTAMIENTO ARTIFICIAL\n \t\t\t\t\t\tvar mvlevantamientoartifbsf = categoriaproyectos(pmv,levantamientoartif,'_p',1);\n \t\t\t\t\t\tvar mvlevantamientoartifdol = categoriaproyectos(pmv,levantamientoartif,'_p',2);\n \t\t\t\t\t\tvar mvlevantamientoartifDeqv = filtroequivalente(mvlevantamientoartifbsf,mvlevantamientoartifdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA CONSERVACION Y UTILIZACION DEL GAS\n \t\t\t\t\t\tvar mvconutigasbsf = categoriaproyectos(pmv,conutigas,'_p',1);\n \t\t\t\t\t\tvar mvconutigasdol = categoriaproyectos(pmv,conutigas,'_p',2);\n \t\t\t\t\t\tvar mvconutigasDeqv = filtroequivalente(mvconutigasbsf,mvconutigasdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PLANTA DE LIQUIDOS GAS \n \t\t\t\t\t\tvar mvplantliqgasbsf = categoriaproyectos(pmv,plantliqgas,'_p',1);\n \t\t\t\t\t\tvar mvplantliqgasdol = categoriaproyectos(pmv,plantliqgas,'_p',2);\n \t\t\t\t\t\tvar mvplantliqgasDeqv = filtroequivalente(mvplantliqgasbsf,mvplantliqgasdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA INTALACIONES DE PRODUCCION\n \t\t\t\t\t\tvar mvinstproducbsf = categoriaproyectos(pmv,instproduc,'_p',1);\n \t\t\t\t\t\tvar mvinstproducdol = categoriaproyectos(pmv,instproduc,'_p',2);\n \t\t\t\t\t\tvar mvinstproducDeqv = filtroequivalente(mvinstproducbsf,mvinstproducdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA OLEODUCTO Y TERMINALES DE EMBARQUE\n \t\t\t\t\t\tvar mvoleoterminaembbsf = categoriaproyectos(pmv,oleoterminaemb,'_p',1);\n \t\t\t\t\t\tvar mvoleoterminaembdol = categoriaproyectos(pmv,oleoterminaemb,'_p',2);\n \t\t\t\t\t\tvar mvoleoterminaembDeqv = filtroequivalente(mvoleoterminaembbsf,mvoleoterminaembdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA ALMACENAMIENTO\n \t\t\t\t\t\tvar mvalmacenamientobsf = categoriaproyectos(pmv,almacenamiento,'_p',1);\n \t\t\t\t\t\tvar mvalmacenamientodol = categoriaproyectos(pmv,almacenamiento,'_p',2);\n \t\t\t\t\t\tvar mvalmacenamientoDeqv = filtroequivalente(mvalmacenamientobsf,mvalmacenamientodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA DESARROLLO URBANO\n \t\t\t\t\t\tvar mvdesarrollourbabsf = categoriaproyectos(pmv,desarrollourba,'_p',1);\n \t\t\t\t\t\tvar mvdesarrollourbadol = categoriaproyectos(pmv,desarrollourba,'_p',2);\n \t\t\t\t\t\tvar mvdesarrollourbaDeqv = filtroequivalente(mvdesarrollourbabsf,mvdesarrollourbadol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PROTECCION INTEGRAL\n \t\t\t\t\t\tvar mvproteccionintegbsf = categoriaproyectos(pmv,proteccioninteg,'_p',1);\n \t\t\t\t\t\tvar mvproteccionintegdol = categoriaproyectos(pmv,proteccioninteg,'_p',2);\n \t\t\t\t\t\tvar mvproteccionintegDeqv = filtroequivalente(mvproteccionintegbsf,mvproteccionintegdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PREVENCION Y CONTROL DE PERDIDAS\n \t\t\t\t\t\tvar mvpcpbsf = categoriaproyectos(pmv,pcp,'_p',1);\n \t\t\t\t\t\tvar mvpcpdol = categoriaproyectos(pmv,pcp,'_p',2);\n \t\t\t\t\t\tvar mvpcpDeqv = filtroequivalente(mvpcpbsf,mvpcpdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA TELECOMUNICACIONES\n \t\t\t\t\t\tvar mvtelecomunicacionesbsf = categoriaproyectos(pmv,telecomunicaciones,'_p',1);\n \t\t\t\t\t\tvar mvtelecomunicacionesdol = categoriaproyectos(pmv,telecomunicaciones,'_p',2);\n \t\t\t\t\t\tvar mvtelecomunicacionesDeqv = filtroequivalente(mvtelecomunicacionesbsf,mvtelecomunicacionesdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA AUTOMATIZACION INDUSTRIAL\n \t\t\t\t\t\tvar mvautomatizacionindbsf = categoriaproyectos(pmv,automatizacionind,'_p',1);\n \t\t\t\t\t\tvar mvautomatizacioninddol = categoriaproyectos(pmv,automatizacionind,'_p',2);\n \t\t\t\t\t\tvar mvautomatizacionindDeqv = filtroequivalente(mvautomatizacionindbsf,mvautomatizacioninddol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA COMPUTACION Y SISTEMA\n \t\t\t\t\t\tvar mvcomputaysistebsf = categoriaproyectos(pmv,computaysiste,'_p',1);\n \t\t\t\t\t\tvar mvcomputaysistedol = categoriaproyectos(pmv,computaysiste,'_p',2);\n \t\t\t\t\t\tvar mvcomputaysisteDeqv = filtroequivalente(mvcomputaysistebsf,mvcomputaysistedol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA EDIFICACIONES E INSTALACIONES INDUSTRIALES\n \t\t\t\t\t\tvar mvedifinstindustbsf = categoriaproyectos(pmv,edifinstindust,'_p',1);\n \t\t\t\t\t\tvar mvedifinstindustdol = categoriaproyectos(pmv,edifinstindust,'_p',2);\n \t\t\t\t\t\tvar mvedifinstindustDeqv = filtroequivalente(mvedifinstindustbsf,mvedifinstindustdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA EQUIPOS\n \t\t\t\t\t\tvar mvequiposbsf = categoriaproyectos(pmv,equipos,'_p',1);\n \t\t\t\t\t\tvar mvequiposdol = categoriaproyectos(pmv,equipos,'_p',2);\n \t\t\t\t\t\tvar mvequiposDeqv = filtroequivalente(mvequiposbsf,mvequiposdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA OTRAS INVERSIONES\n \t\t\t\t\t\tvar mvotrasinvbsf = categoriaproyectos(pmv,otrasinv,'_p',1);\n \t\t\t\t\t\tvar mvotrasinvdol = categoriaproyectos(pmv,otrasinv,'_p',2);\n \t\t\t\t\t\tvar mvotrasinvDeqv = filtroequivalente(mvotrasinvbsf,mvotrasinvdol);\n \t\t\t\t\t\t/////////////////////////// \t\n\n \t\t\t\t\t\t///////ANTEPROYECTO VISION PROYECTOS////////////////////////////////////////////////////////////\n\n \t\t\t\t\t\t// CATEGORIA GEOFISICA\n \t\t\t\t\t\tvar antgeobsf = categoriaproyectos(pant,geofisica,'_p',1);\n \t\t\t\t\t\tvar antgeodol = categoriaproyectos(pant,geofisica,'_p',2);\n \t\t\t\t\t\tvar antgeoDeqv = filtroequivalente(antgeobsf,antgeodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION DE AVANZADA\n \t\t\t\t\t\tvar antperfavanzbsf = categoriaproyectos(pant,perfavanz,'_p',1);\n \t\t\t\t\t\tvar antperfavanzdol = categoriaproyectos(pant,perfavanz,'_p',2);\n \t\t\t\t\t\tvar antperfavanzDeqv = filtroequivalente(antperfavanzbsf,antperfavanzdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION DE DESARROLLO \n \t\t\t\t\t\tvar antperfdesarrobsf = categoriaproyectos(pant,perfdesarro,'_p',1);\n \t\t\t\t\t\tvar antperfdesarrodol = categoriaproyectos(pant,perfdesarro,'_p',2);\n \t\t\t\t\t\tvar antperfdesarroDeqv = filtroequivalente(antperfdesarrobsf,antperfdesarrodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PERFORACION EXPLORATORIA\n \t\t\t\t\t\tvar antperfexplorabsf = categoriaproyectos(pant,perfexplora,'_p',1);\n \t\t\t\t\t\tvar antperfexploradol = categoriaproyectos(pant,perfexplora,'_p',2);\n \t\t\t\t\t\tvar antperfexploraDeqv = filtroequivalente(antperfexplorabsf,antperfexploradol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECUPERACION ADICIONAL\n \t\t\t\t\t\tvar antrecupadicbsf = categoriaproyectos(pant,recupadic,'_p',1);\n \t\t\t\t\t\tvar antrecupadicdol = categoriaproyectos(pant,recupadic,'_p',2);\n \t\t\t\t\t\tvar antrecupadicDeqv = filtroequivalente(antrecupadicbsf,antrecupadicdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECOMPLETACION DE POZOS\n \t\t\t\t\t\tvar antrecompozosbsf = categoriaproyectos(pant,recompozos,'_p',1);\n \t\t\t\t\t\tvar antrecompozosdol = categoriaproyectos(pant,recompozos,'_p',2);\n \t\t\t\t\t\tvar antrecompozosDeqv = filtroequivalente(antrecompozosbsf,antrecompozosdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA RECUPERACION SUPLEMENTARIA\n \t\t\t\t\t\tvar antrecupesuplebsf = categoriaproyectos(pant,recupesuple,'_p',1);\n \t\t\t\t\t\tvar antrecupesupledol = categoriaproyectos(pant,recupesuple,'_p',2);\n \t\t\t\t\t\tvar antrecupesupleDeqv = filtroequivalente(antrecupesuplebsf,antrecupesupledol);\n \t\t\t\t\t\t///////////////////////////\t\n \t\t\t\t\t\t// CATEGORIA INYECCCION ALTERNA DE VAPOR\n \t\t\t\t\t\tvar antinyectalternavaporbsf = categoriaproyectos(pant,inyectalternavapor,'_p',1);\n \t\t\t\t\t\tvar antinyectalternavapordol = categoriaproyectos(pant,inyectalternavapor,'_p',2);\n \t\t\t\t\t\tvar antinyectalternavaporDeqv = filtroequivalente(antinyectalternavaporbsf,antinyectalternavapordol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA LEVANTAMIENTO ARTIFICIAL\n \t\t\t\t\t\tvar antlevantamientoartifbsf = categoriaproyectos(pant,levantamientoartif,'_p',1);\n \t\t\t\t\t\tvar antlevantamientoartifdol = categoriaproyectos(pant,levantamientoartif,'_p',2);\n \t\t\t\t\t\tvar antlevantamientoartifDeqv = filtroequivalente(antlevantamientoartifbsf,antlevantamientoartifdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA CONSERVACION Y UTILIZACION DEL GAS\n \t\t\t\t\t\tvar antconutigasbsf = categoriaproyectos(pant,conutigas,'_p',1);\n \t\t\t\t\t\tvar antconutigasdol = categoriaproyectos(pant,conutigas,'_p',2);\n \t\t\t\t\t\tvar antconutigasDeqv = filtroequivalente(antconutigasbsf,antconutigasdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PLANTA DE LIQUIDOS GAS \n \t\t\t\t\t\tvar antplantliqgasbsf = categoriaproyectos(pant,plantliqgas,'_p',1);\n \t\t\t\t\t\tvar antplantliqgasdol = categoriaproyectos(pant,plantliqgas,'_p',2);\n \t\t\t\t\t\tvar antplantliqgasDeqv = filtroequivalente(antplantliqgasbsf,antplantliqgasdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA INTALACIONES DE PRODUCCION\n \t\t\t\t\t\tvar antinstproducbsf = categoriaproyectos(pant,instproduc,'_p',1);\n \t\t\t\t\t\tvar antinstproducdol = categoriaproyectos(pant,instproduc,'_p',2);\n \t\t\t\t\t\tvar antinstproducDeqv = filtroequivalente(antinstproducbsf,antinstproducdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA OLEODUCTO Y TERMINALES DE EMBARQUE\n \t\t\t\t\t\tvar antoleoterminaembbsf = categoriaproyectos(pant,oleoterminaemb,'_p',1);\n \t\t\t\t\t\tvar antoleoterminaembdol = categoriaproyectos(pant,oleoterminaemb,'_p',2);\n \t\t\t\t\t\tvar antoleoterminaembDeqv = filtroequivalente(antoleoterminaembbsf,antoleoterminaembdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA ALMACENAMIENTO\n \t\t\t\t\t\tvar antalmacenamientobsf = categoriaproyectos(pant,almacenamiento,'_p',1);\n \t\t\t\t\t\tvar antalmacenamientodol = categoriaproyectos(pant,almacenamiento,'_p',2);\n \t\t\t\t\t\tvar antalmacenamientoDeqv = filtroequivalente(antalmacenamientobsf,antalmacenamientodol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA DESARROLLO URBANO\n \t\t\t\t\t\tvar antdesarrollourbabsf = categoriaproyectos(pant,desarrollourba,'_p',1);\n \t\t\t\t\t\tvar antdesarrollourbadol = categoriaproyectos(pant,desarrollourba,'_p',2);\n \t\t\t\t\t\tvar antdesarrollourbaDeqv = filtroequivalente(antdesarrollourbabsf,antdesarrollourbadol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PROTECCION INTEGRAL\n \t\t\t\t\t\tvar antproteccionintegbsf = categoriaproyectos(pant,proteccioninteg,'_p',1);\n \t\t\t\t\t\tvar antproteccionintegdol = categoriaproyectos(pant,proteccioninteg,'_p',2);\n \t\t\t\t\t\tvar antproteccionintegDeqv = filtroequivalente(antproteccionintegbsf,antproteccionintegdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA PREVENCION Y CONTROL DE PERDIDAS\n \t\t\t\t\t\tvar antpcpbsf = categoriaproyectos(pant,pcp,'_p',1);\n \t\t\t\t\t\tvar antpcpdol = categoriaproyectos(pant,pcp,'_p',2);\n \t\t\t\t\t\tvar antpcpDeqv = filtroequivalente(antpcpbsf,antpcpdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA TELECOMUNICACIONES\n \t\t\t\t\t\tvar anttelecomunicacionesbsf = categoriaproyectos(pant,telecomunicaciones,'_p',1);\n \t\t\t\t\t\tvar anttelecomunicacionesdol = categoriaproyectos(pant,telecomunicaciones,'_p',2);\n \t\t\t\t\t\tvar anttelecomunicacionesDeqv = filtroequivalente(anttelecomunicacionesbsf,anttelecomunicacionesdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA AUTOMATIZACION INDUSTRIAL\n \t\t\t\t\t\tvar antautomatizacionindbsf = categoriaproyectos(pant,automatizacionind,'_p',1);\n \t\t\t\t\t\tvar antautomatizacioninddol = categoriaproyectos(pant,automatizacionind,'_p',2);\n \t\t\t\t\t\tvar antautomatizacionindDeqv = filtroequivalente(antautomatizacionindbsf,antautomatizacioninddol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA COMPUTACION Y SISTEMA\n \t\t\t\t\t\tvar antcomputaysistebsf = categoriaproyectos(pant,computaysiste,'_p',1);\n \t\t\t\t\t\tvar antcomputaysistedol = categoriaproyectos(pant,computaysiste,'_p',2);\n \t\t\t\t\t\tvar antcomputaysisteDeqv = filtroequivalente(antcomputaysistebsf,antcomputaysistedol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA EDIFICACIONES E INSTALACIONES INDUSTRIALES\n \t\t\t\t\t\tvar antedifinstindustbsf = categoriaproyectos(pant,edifinstindust,'_p',1);\n \t\t\t\t\t\tvar antedifinstindustdol = categoriaproyectos(pant,edifinstindust,'_p',2);\n \t\t\t\t\t\tvar antedifinstindustDeqv = filtroequivalente(antedifinstindustbsf,antedifinstindustdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA EQUIPOS\n \t\t\t\t\t\tvar antequiposbsf = categoriaproyectos(pant,equipos,'_p',1);\n \t\t\t\t\t\tvar antequiposdol = categoriaproyectos(pant,equipos,'_p',2);\n \t\t\t\t\t\tvar antequiposDeqv = filtroequivalente(antequiposbsf,antequiposdol);\n \t\t\t\t\t\t///////////////////////////\n \t\t\t\t\t\t// CATEGORIA OTRAS INVERSIONES\n \t\t\t\t\t\tvar antotrasinvbsf = categoriaproyectos(pant,otrasinv,'_p',1);\n \t\t\t\t\t\tvar antotrasinvdol = categoriaproyectos(pant,otrasinv,'_p',2);\n \t\t\t\t\t\tvar antotrasinvDeqv = filtroequivalente(antotrasinvbsf,antotrasinvdol);\n \t\t\t\t\t\t/////////////////////////// \t\n\n \t\t\t\t\t\tvar ptotalcatebsf = sumarcateogoria(pgeobsf,pperfavanzbsf,pperfdesarrobsf,pperfexplorabsf,precupadicbsf,precompozosbsf,precupesuplebsf,pinyectalternavaporbsf,plevantamientoartifbsf,pconutigasbsf,pplantliqgasbsf,pinstproducbsf,poleoterminaembbsf,palmacenamientobsf,pdesarrollourbabsf,pproteccionintegbsf,ppcpbsf,ptelecomunicacionesbsf,pautomatizacionindbsf,pcomputaysistebsf,pedifinstindustbsf,pequiposbsf,potrasinvbsf);\n \t\t\t\t\t\tvar ptotalcatedol = sumarcateogoria(pgeodol,pperfavanzdol,pperfdesarrodol,pperfexploradol,precupadicdol,precompozosdol,precupesupledol,pinyectalternavapordol,plevantamientoartifdol,pconutigasdol,pplantliqgasdol,pinstproducdol,poleoterminaembdol,palmacenamientodol,pdesarrollourbadol,pproteccionintegdol,ppcpdol,ptelecomunicacionesdol,pautomatizacioninddol,pcomputaysistedol,pedifinstindustdol,pequiposdol,potrasinvdol);\n \t\t\t\t\t\tvar ptotalcateDeqv = sumarcateogoria(pgeoDeqv,pperfavanzDeqv,pperfdesarroDeqv,pperfexploraDeqv,precupadicDeqv,precompozosDeqv,precupesupleDeqv,pinyectalternavaporDeqv,plevantamientoartifDeqv,pconutigasDeqv,pplantliqgasDeqv,pinstproducDeqv,poleoterminaembDeqv,palmacenamientoDeqv,pdesarrollourbaDeqv,pproteccionintegDeqv,ppcpDeqv,ptelecomunicacionesDeqv,pautomatizacionindDeqv,pcomputaysisteDeqv,pedifinstindustDeqv,pequiposDeqv,potrasinvDeqv);\n \t\t\t\t\t\tvar rtotalcatebsf = sumarcateogoria(rgeobsf,rperfavanzbsf,rperfdesarrobsf,rperfexplorabsf,rrecupadicbsf,rrecompozosbsf,rrecupesuplebsf,rinyectalternavaporbsf,rlevantamientoartifbsf,rconutigasbsf,rplantliqgasbsf,rinstproducbsf,roleoterminaembbsf,ralmacenamientobsf,rdesarrollourbabsf,rproteccionintegbsf,rpcpbsf,rtelecomunicacionesbsf,rautomatizacionindbsf,rcomputaysistebsf,redifinstindustbsf,requiposbsf,rotrasinvbsf);\n \t\t\t\t\t\tvar rtotalcatedol = sumarcateogoria(rgeodol,rperfavanzdol,rperfdesarrodol,rperfexploradol,rrecupadicdol,rrecompozosdol,rrecupesupledol,rinyectalternavapordol,rlevantamientoartifdol,rconutigasdol,rplantliqgasdol,rinstproducdol,roleoterminaembdol,ralmacenamientodol,rdesarrollourbadol,rproteccionintegdol,rpcpdol,rtelecomunicacionesdol,rautomatizacioninddol,rcomputaysistedol,redifinstindustdol,requiposdol,rotrasinvdol);\n \t\t\t\t\t\tvar rtotalcateDeqv = sumarcateogoria(rgeoDeqv,rperfavanzDeqv,rperfdesarroDeqv,rperfexploraDeqv,rrecupadicDeqv,rrecompozosDeqv,rrecupesupleDeqv,rinyectalternavaporDeqv,rlevantamientoartifDeqv,rconutigasDeqv,rplantliqgasDeqv,rinstproducDeqv,roleoterminaembDeqv,ralmacenamientoDeqv,rdesarrollourbaDeqv,rproteccionintegDeqv,rpcpDeqv,rtelecomunicacionesDeqv,rautomatizacionindDeqv,rcomputaysisteDeqv,redifinstindustDeqv,requiposDeqv,rotrasinvDeqv);\n \t\t\t\t\t\tvar mvtotalcatebsf = sumarcateogoria(mvgeobsf,mvperfavanzbsf,mvperfdesarrobsf,mvperfexplorabsf,mvrecupadicbsf,mvrecompozosbsf,mvrecupesuplebsf,mvinyectalternavaporbsf,mvlevantamientoartifbsf,mvconutigasbsf,mvplantliqgasbsf,mvinstproducbsf,mvoleoterminaembbsf,mvalmacenamientobsf,mvdesarrollourbabsf,mvproteccionintegbsf,mvpcpbsf,mvtelecomunicacionesbsf,mvautomatizacionindbsf,mvcomputaysistebsf,mvedifinstindustbsf,mvequiposbsf,mvotrasinvbsf);\n \t\t\t\t\t\tvar mvtotalcatedol = sumarcateogoria(mvgeodol,mvperfavanzdol,mvperfdesarrodol,mvperfexploradol,mvrecupadicdol,mvrecompozosdol,mvrecupesupledol,mvinyectalternavapordol,mvlevantamientoartifdol,mvconutigasdol,mvplantliqgasdol,mvinstproducdol,mvoleoterminaembdol,mvalmacenamientodol,mvdesarrollourbadol,mvproteccionintegdol,mvpcpdol,mvtelecomunicacionesdol,mvautomatizacioninddol,mvcomputaysistedol,mvedifinstindustdol,mvequiposdol,mvotrasinvdol);\n \t\t\t\t\t\tvar mvtotalcateDeqv = sumarcateogoria(mvgeoDeqv,mvperfavanzDeqv,mvperfdesarroDeqv,mvperfexploraDeqv,mvrecupadicDeqv,mvrecompozosDeqv,mvrecupesupleDeqv,mvinyectalternavaporDeqv,mvlevantamientoartifDeqv,mvconutigasDeqv,mvplantliqgasDeqv,mvinstproducDeqv,mvoleoterminaembDeqv,mvalmacenamientoDeqv,mvdesarrollourbaDeqv,mvproteccionintegDeqv,mvpcpDeqv,mvtelecomunicacionesDeqv,mvautomatizacionindDeqv,mvcomputaysisteDeqv,mvedifinstindustDeqv,mvequiposDeqv,mvotrasinvDeqv);\n \t\t\t\t\t\tvar anttotalcatebsf = sumarcateogoria(antgeobsf,antperfavanzbsf,antperfdesarrobsf,antperfexplorabsf,antrecupadicbsf,antrecompozosbsf,antrecupesuplebsf,antinyectalternavaporbsf,antlevantamientoartifbsf,antconutigasbsf,antplantliqgasbsf,antinstproducbsf,antoleoterminaembbsf,antalmacenamientobsf,antdesarrollourbabsf,antproteccionintegbsf,antpcpbsf,anttelecomunicacionesbsf,antautomatizacionindbsf,antcomputaysistebsf,antedifinstindustbsf,antequiposbsf,antotrasinvbsf);\n \t\t\t\t\t\tvar anttotalcatedol = sumarcateogoria(antgeodol,antperfavanzdol,antperfdesarrodol,antperfexploradol,antrecupadicdol,antrecompozosdol,antrecupesupledol,antinyectalternavapordol,antlevantamientoartifdol,antconutigasdol,antplantliqgasdol,antinstproducdol,antoleoterminaembdol,antalmacenamientodol,antdesarrollourbadol,antproteccionintegdol,antpcpdol,anttelecomunicacionesdol,antautomatizacioninddol,antcomputaysistedol,antedifinstindustdol,antequiposdol,antotrasinvdol);\n \t\t\t\t\t\tvar anttotalcateDeqv = sumarcateogoria(antgeoDeqv,antperfavanzDeqv,antperfdesarroDeqv,antperfexploraDeqv,antrecupadicDeqv,antrecompozosDeqv,antrecupesupleDeqv,antinyectalternavaporDeqv,antlevantamientoartifDeqv,antconutigasDeqv,antplantliqgasDeqv,antinstproducDeqv,antoleoterminaembDeqv,antalmacenamientoDeqv,antdesarrollourbaDeqv,antproteccionintegDeqv,antpcpDeqv,anttelecomunicacionesDeqv,antautomatizacionindDeqv,antcomputaysisteDeqv,antedifinstindustDeqv,antequiposDeqv,antotrasinvDeqv);\n\n\n \t\t\t\t\t\t for (var i=0; i < 12; i++) {\n \t\t\t\t\t\t \t\t\n \t\t\t\t\t\t \tif( laborybbdivoDeqvr[i] != 0 || mdivoDeqvr[i] != 0 || scdivoDeqvr[i] != 0 || odivoDeqvr[i]!= 0 ){\n \t\t\t\t\t\t \t\t//alert(aux);\n \t\t\t\t\t\t \t\taux++;\t\n \t\t\t\t\t\t \t}\n\n \t\t\t\t\t\t }// fin del for comprobar cual es la ejecución del real de los meses\n\n\n \t\t\t\t\t\t /// BLOQUE VISUAL DE LA TABLA\n \t\t\t\t\t\t \tvar informacion = motrarcabecera('red-header','leter',v3,meses[aux],'Parámetros Operacionales y Financieros');\n \t\t\t\t\t\t \tinformacion += descripciones('','Presupuesto de Inversiones',aux,ptotalcateDeqv,ptotalcatebsf,ptotalcatedol,ptotalcateDeqv,rtotalcatebsf,rtotalcatedol,rtotalcateDeqv,mvtotalcatebsf,mvtotalcatedol,mvtotalcateDeqv,anttotalcatebsf,anttotalcatedol,anttotalcateDeqv );\n \t\t\t\t\t\t \tinformacion += descripciones('','Presupuesto de Operaciones',aux,totaldivoDeqv,totaldivobsf,totaldivodol,totaldivoDeqv,totaldivobsfr,totaldivodolr,totaldivoDeqvr,totaldivobsfmv,totaldivodolmv,totaldivoDeqvmv,totaldivobsfant,totaldivodolant,totaldivobsfant);\n\t \t\t\t\t\t\t\n \t\t\t\t\t\t \tinformacion += '<tr>';\n\t \t\t\t\t\t\tfor (var i=0; i < 18 ; i++){\n\t \t\t\t\t\t\tinformacion += '<td>\t</td>';\n\t \t\t\t\t\t\t}\n\t \t\t\t\t\t\tinformacion += '</tr>';\n \t\t\t\t\t\t \tinformacion += motrarcabecera('red-header','leter',v3,meses[aux],'ELEMENTO DE COSTO');\n \t\t\t\t\t\t \tinformacion += descripciones('','Labor y Beneficios',aux,laborybbdivoDeqv,laborybbdivobsf,laborybbdivodol,laborybbdivoDeqv,laborybbdivobsfr,laborybbdivodolr,laborybbdivoDeqvr,laborybbdivobsfmv,laborybbdivodolmv,laborybbdivoDeqvmv,laborybbdivobsfant,laborybbdivodolant,laborybbdivoDeqvant );\n\t \t\t\t\t\t\tinformacion += descripciones('','Materiales',aux,mdivoDeqv,mdivobsf,mdivodol,mdivoDeqv,mdivobsfr,mdivodolr,mdivoDeqvr,mdivobsfmv,mdivodolmv,mdivoDeqvmv,mdivobsfant,mdivodolant,mdivoDeqvant );\n\t \t\t\t\t\t\tinformacion += descripciones('','Servicios y Contratos',aux,scdivoDeqv,scdivobsf,scdivodol,scdivoDeqv,scdivobsfr,scdivodolr,scdivoDeqvr,scdivobsfmv,scdivodolmv,scdivoDeqvmv,scdivobsfmv,scdivodolant,scdivoDeqvant );\n\t \t\t\t\t\t\tinformacion += descripciones('','Otros Costos y Gastos',aux,odivoDeqv,odivobsf,odivodol,odivoDeqv,odivobsfr,odivodolr,odivoDeqvr,odivobsfmv,odivodolmv,odivoDeqvmv,odivobsfant,odivodolant,odivoDeqvant );\n\t \t\t\t\t\t\tinformacion += descripciones('red-header','Total',aux,totaldivoDeqv,totaldivobsf,totaldivodol,totaldivoDeqv,totaldivobsfr,totaldivodolr,totaldivoDeqvr,totaldivobsfmv,totaldivodolmv,totaldivoDeqvmv,totaldivobsfant,totaldivodolant,totaldivobsfant);\n\t \t\t\t\t\t\tinformacion += '<tr>';\n\t \t\t\t\t\t\tfor (var i=0; i < 18 ; i++){\n\t \t\t\t\t\t\tinformacion += '<td>\t</td>';\n\t \t\t\t\t\t\t}\n\t \t\t\t\t\t\tinformacion += '</tr>';\n\t \t\t\t\t\t\tinformacion += motrarcabecera('red-header','leter',v3,meses[aux],'CATEGORIA ');\n\t \t\t\t\t\t\tinformacion += descripciones('','Geofisica',aux,pgeoDeqv,pgeobsf,pgeodol,pgeoDeqv,rgeobsf,rgeodol,rgeoDeqv,mvgeobsf,mvgeodol,mvgeoDeqv,antgeobsf,antgeodol,antgeoDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Perforación de Avanzada',aux,pperfavanzDeqv,pperfavanzbsf,pperfavanzdol,pperfavanzDeqv,rperfavanzbsf,rperfavanzdol,rperfavanzDeqv,mvperfavanzbsf,mvperfavanzdol,mvperfavanzDeqv,antperfavanzbsf,antperfavanzdol,antperfavanzDeqv );\n\t \t\t\t\t\t\tinformacion += descripciones('','Perforación de Desarrollo',aux,pperfdesarroDeqv,pperfdesarrobsf,pperfdesarrodol,pperfdesarroDeqv,rperfdesarrobsf,rperfdesarrodol,rperfdesarroDeqv,mvperfdesarrobsf,mvperfdesarrodol,mvperfdesarroDeqv,antperfdesarrobsf,antperfdesarrodol,antperfdesarroDeqv);\n\t\t\t\t\t\t\tinformacion += descripciones('','Perforación Exploratoria',aux,pperfexploraDeqv,pperfexplorabsf,pperfexploradol,pperfexploraDeqv,rperfexplorabsf,rperfexploradol,rperfexploraDeqv,mvperfexplorabsf,mvperfexploradol,mvperfexploraDeqv,antperfexplorabsf,antperfexploradol,antperfexploraDeqv);\n\t\t\t\t\t\t\tinformacion += descripciones('','Recuperación Adicional',aux,precupadicDeqv,precupadicbsf,precupadicdol,precupadicDeqv,rrecupadicbsf,rrecupadicdol,rrecupadicDeqv,mvrecupadicbsf,mvrecupadicdol,mvrecupadicDeqv,antrecupadicbsf,antrecupadicdol,antrecupadicDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Recompletación De Pozos',aux,precompozosDeqv,precompozosbsf,precompozosdol,precompozosDeqv,rrecompozosbsf,rrecompozosdol,rrecompozosDeqv,mvrecompozosbsf,mvrecompozosdol,mvrecompozosDeqv,antrecompozosbsf,antrecompozosdol,antrecompozosDeqv);\n\t\t\t\t\t\t\tinformacion += descripciones('','Recuperación Suplementaria',aux,precupesupleDeqv,precupesuplebsf,precupesupledol,precupesupleDeqv,rrecupesuplebsf,rrecupesupledol,rrecupesupleDeqv,mvrecupesuplebsf,mvrecupesupledol,mvrecupesupleDeqv,antrecupesuplebsf,antrecupesupledol,antrecupesupleDeqv);\n\t\t\t\t\t\t\tinformacion += descripciones('','Inyección Alterna De Vapor',aux,pinyectalternavaporDeqv,pinyectalternavaporbsf,pinyectalternavapordol,pinyectalternavaporDeqv,rinyectalternavaporbsf,rinyectalternavapordol,rinyectalternavaporDeqv,mvinyectalternavaporbsf,mvinyectalternavapordol,mvinyectalternavaporDeqv,antinyectalternavaporbsf,antinyectalternavapordol,antinyectalternavaporDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Levantamiento Artificial',aux,plevantamientoartifDeqv,plevantamientoartifbsf,plevantamientoartifdol,plevantamientoartifDeqv,rlevantamientoartifbsf,rlevantamientoartifdol,rlevantamientoartifDeqv,mvlevantamientoartifbsf,mvlevantamientoartifdol,mvlevantamientoartifDeqv,antlevantamientoartifbsf,antlevantamientoartifdol,antlevantamientoartifDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Conservación y Utilización del Gas',aux,pconutigasDeqv,pconutigasbsf,pconutigasdol,pconutigasDeqv,rconutigasbsf,rconutigasdol,rconutigasDeqv,mvconutigasbsf,mvconutigasdol,mvconutigasDeqv,antconutigasbsf,antconutigasdol,antconutigasDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Planta de Líquidos y Gas',aux,pplantliqgasDeqv,pplantliqgasbsf,pplantliqgasdol,pplantliqgasDeqv,rplantliqgasbsf,rplantliqgasdol,rplantliqgasDeqv,mvplantliqgasbsf,mvplantliqgasdol,mvplantliqgasDeqv,antplantliqgasbsf,antplantliqgasdol,antplantliqgasDeqv);\n\t\t\t\t\t\t\tinformacion += descripciones('','Instalaciones de Producción',aux,pinstproducDeqv,pinstproducbsf,pinstproducdol,pinstproducDeqv,rinstproducbsf,rinstproducdol,rinstproducDeqv,mvinstproducbsf,mvinstproducdol,mvinstproducDeqv,antinstproducbsf,antinstproducdol,antinstproducDeqv);\n\t\t\t\t\t\t\tinformacion += descripciones('','Oleoductos y Terminales de Embarque',aux,poleoterminaembDeqv,poleoterminaembbsf,poleoterminaembdol,poleoterminaembDeqv,roleoterminaembbsf,roleoterminaembdol,roleoterminaembDeqv,mvoleoterminaembbsf,mvoleoterminaembdol,mvoleoterminaembDeqv,antoleoterminaembbsf,antoleoterminaembdol,antoleoterminaembDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Almacenamiento',aux,palmacenamientoDeqv,palmacenamientobsf,palmacenamientodol,palmacenamientoDeqv,ralmacenamientobsf,ralmacenamientodol,ralmacenamientoDeqv,mvalmacenamientobsf,mvalmacenamientodol,mvalmacenamientoDeqv,antalmacenamientobsf,antalmacenamientodol,antalmacenamientoDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Desarrollo Urbano',aux,pdesarrollourbaDeqv,pdesarrollourbabsf,pdesarrollourbadol,pdesarrollourbaDeqv,rdesarrollourbabsf,rdesarrollourbadol,rdesarrollourbaDeqv,mvdesarrollourbabsf,mvdesarrollourbadol,mvdesarrollourbaDeqv,antdesarrollourbabsf,antdesarrollourbadol,antdesarrollourbaDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Protección Integral',aux,pproteccionintegDeqv,pproteccionintegbsf,pproteccionintegdol,pproteccionintegDeqv,rproteccionintegbsf,rproteccionintegdol,rproteccionintegDeqv,mvproteccionintegbsf,mvproteccionintegdol,mvproteccionintegDeqv,antproteccionintegbsf,antproteccionintegdol,antproteccionintegDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Prevención y Control de Pérdidas',aux,ppcpDeqv,ppcpbsf,ppcpdol,ppcpDeqv,rpcpbsf,rpcpdol,rpcpDeqv,mvpcpbsf,mvpcpdol,mvpcpDeqv,antpcpbsf,antpcpdol,antpcpDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Telecomunicaciones',aux,ptelecomunicacionesDeqv,ptelecomunicacionesbsf,ptelecomunicacionesdol,ptelecomunicacionesDeqv,rtelecomunicacionesbsf,rtelecomunicacionesdol,rtelecomunicacionesDeqv,mvtelecomunicacionesbsf,mvtelecomunicacionesdol,mvtelecomunicacionesDeqv,anttelecomunicacionesbsf,anttelecomunicacionesdol,anttelecomunicacionesDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Automatización Industrial',aux,pautomatizacionindDeqv,pautomatizacionindbsf,pautomatizacioninddol,pautomatizacionindDeqv,rautomatizacionindbsf,rautomatizacioninddol,rautomatizacionindDeqv,mvautomatizacionindbsf,mvautomatizacioninddol,mvautomatizacionindDeqv,antautomatizacionindbsf,antautomatizacioninddol,antautomatizacionindDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Computación y Sistemas',aux,pcomputaysisteDeqv,pcomputaysistebsf,pcomputaysistedol,pcomputaysisteDeqv,rcomputaysistebsf,rcomputaysistedol,rcomputaysisteDeqv,mvcomputaysistebsf,mvcomputaysistedol,mvcomputaysisteDeqv,antcomputaysistebsf,antcomputaysistedol,antcomputaysisteDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Edificaciones e Instalaciones Industriales',aux,pedifinstindustDeqv,pedifinstindustbsf,pedifinstindustdol,pedifinstindustDeqv,redifinstindustbsf,redifinstindustdol,redifinstindustDeqv,mvedifinstindustbsf,mvedifinstindustdol,mvedifinstindustDeqv,antedifinstindustbsf,antedifinstindustdol,antedifinstindustDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Equipos',aux,pequiposDeqv,pequiposbsf,pequiposdol,pequiposDeqv,requiposbsf,requiposdol,requiposDeqv,mvequiposbsf,mvequiposdol,mvequiposDeqv,antequiposbsf,antequiposdol,antequiposDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('','Otras Inversiones',aux,potrasinvDeqv,potrasinvbsf,potrasinvdol,potrasinvDeqv,rotrasinvbsf,rotrasinvdol,rotrasinvDeqv,mvotrasinvbsf,mvotrasinvdol,mvotrasinvDeqv,antotrasinvbsf,antotrasinvdol,antotrasinvDeqv );\n\t\t\t\t\t\t\tinformacion += descripciones('red-header','Total',aux,ptotalcateDeqv,ptotalcatebsf,ptotalcatedol,ptotalcateDeqv,rtotalcatebsf,rtotalcatedol,rtotalcateDeqv,mvtotalcatebsf,mvtotalcatedol,mvtotalcateDeqv,anttotalcatebsf,anttotalcatedol,anttotalcateDeqv );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\n\n\t \t\t\t\t\t\treturn informacion;\n\n }", "function refreshJsonPlanning() {\r\n param = false;\r\n if (dojo.byId(\"resourcePlanning\")) {\r\n url = \"../tool/jsonResourcePlanning.php\";\r\n } else if (dojo.byId(\"versionsPlanning\")) {\r\n url = \"../tool/jsonVersionsPlanning.php\";\r\n } else if (dojo.byId(\"globalPlanning\")) {\r\n url = \"../tool/jsonPlanning.php?global=true\";\r\n param=true;\r\n } else {\r\n url = \"../tool/jsonPlanning.php\";\r\n }\r\n \r\n //ADD qCazelles - GANTT\r\n if (dojo.byId('nbPvs')) {\r\n url += (param) ? \"&\" : \"?\";\r\n for (var i = 0; i < dojo.byId('nbPvs').value; i++) {\r\n if (i != 0) {\r\n url += \"&\";\r\n }\r\n url += \"pvNo\" + i + \"=\" + dojo.byId('pvNo' + i).value;\r\n }\r\n if (dojo.byId('nbPvs').value != 0) {\r\n param = true;\r\n }\r\n }\r\n //END ADD qCazelles - GANTT\r\n \r\n if (dojo.byId('listShowIdle')) {\r\n if (dojo.byId('listShowIdle').checked) {\r\n url += (param) ? \"&\" : \"?\";\r\n url += \"idle=true\";\r\n param = true;\r\n }\r\n }\r\n if (dojo.byId('showWBS')) {\r\n if (dojo.byId('showWBS').checked) {\r\n url += (param) ? \"&\" : \"?\";\r\n url += \"showWBS=true\";\r\n param = true;\r\n }\r\n }\r\n if (dojo.byId('listShowResource')) {\r\n if (dojo.byId('listShowResource').checked) {\r\n url += (param) ? \"&\" : \"?\";\r\n url += \"showResource=true\";\r\n param = true;\r\n }\r\n }\r\n if (dojo.byId('listShowLeftWork')) {\r\n if (dojo.byId('listShowLeftWork').checked) {\r\n url += (param) ? \"&\" : \"?\";\r\n url += \"showWork=true\";\r\n param = true;\r\n }\r\n }\r\n if (dojo.byId('listShowProject')) {\r\n if (dojo.byId('listShowProject').checked) {\r\n url += (param) ? \"&\" : \"?\";\r\n url += \"showProject=true\";\r\n param = true;\r\n }\r\n }\r\n if (dijit.byId('listShowMilestone')) {\r\n url += (param) ? \"&\" : \"?\";\r\n url += \"showMilestone=\" + dijit.byId('listShowMilestone').get(\"value\");\r\n param = true;\r\n }\r\n if (dijit.byId('listShowNullAssignment')) {\r\n if (dojo.byId('listShowNullAssignment').checked) {\r\n url += (param) ? \"&\" : \"?\";\r\n url += \"listShowNullAssignment=true\";\r\n param = true;\r\n }\r\n } \r\n loadContent(url, \"planningJsonData\", 'listForm', false);\r\n}", "function traceAvecP() {\n\tvar equation = document.getElementById('input').value;\n\tequation = equation.replace(/,/g, '.');\n\t// rempalce les \",\" par \".\"\n\tvar erreur = validation(equation);\n\tdocument.getElementById('btnresetter').disabled = false;\n\t//activation du bouton Reset\n\tif (erreur < 0) {\n\t\tdocument.getElementById('btnrnd').disabled = true;\n\t\t// on scelle le bouton de soummission\n\t\tpente = parametreA(tokenize(equation));\n\t\tordonnee = parametreB(tokenize(equation));\n\t\texp = exposant(tokenize(equation));\n\t\tzoomPlan(exp, pente, ordonnee);\n\t\tif (exp == 0) {\n\t\t\ttypeEquation = 0;\n\t\t\tdocument.getElementById('btnpente').disabled = false;\n\t\t\t//activation du bouton Pente\n\t\t\tdocument.getElementById('btnAfficOrd').disabled = false;\n\t\t\t//activation du bouton Ordonnee\n\t\t\tpointLineaire();\n\t\t} else if (exp != 0) {\n\t\t\ttypeEquation = 1;\n\t\t\tdocument.getElementById('btnAfficOrd').disabled = false;\n\t\t\t//activation du bouton Ordonnee\n\t\t\tdocument.getElementById('btnAxeStm').disabled = false;\n\t\t\t//activation du bouton Axe symétrie\n\t\t\tdocument.getElementById('btnAfficZero').disabled = false;\n\t\t\t//activation du bouton Les zéros\n\t\t\tpointQuadratique();\n\t\t}\n\n\t\t// affichage dynamique de l'ordonnée dans la bulle externe\n\t\tif (typeEquation == 1) {\n\t\t\tif (dynamiqueB() < 0 && dynamiqueC() < 0) {// si l'ordonnee ou la pente est une valeur negative, les mettre entre ()\n\t\t\t\tboard.on('update', function() {\n\t\t\t\t\tdocument.getElementById('ordonneeEquationQuadratique').innerHTML = \"y = \" + dynamiqueA() + 'x² +(' + dynamiqueB() + ')' + '+(' + dynamiqueC() + ')';\n\t\t\t\t});\n\t\t\t} else if (dynamiqueB() < 0 && dynamiqueC() >= 0) {\n\t\t\t\tboard.on('update', function() {\n\t\t\t\t\tdocument.getElementById('ordonneeEquationQuadratique').innerHTML = \"y = \" + dynamiqueA() + 'x² +(' + dynamiqueB() + ')' + \"+ \" + dynamiqueC();\n\t\t\t\t});\n\t\t\t} else if (dynamiqueC() < 0 && dynamiqueB() >= 0) {\n\t\t\t\tboard.on('update', function() {\n\t\t\t\t\tdocument.getElementById('ordonneeEquationQuadratique').innerHTML = \"y = \" + dynamiqueA() + 'x² + ' + dynamiqueB() + \"+(\" + dynamiqueC() + ')';\n\t\t\t\t});\n\t\t\t} else if (dynamiqueC() >= 0 && dynamiqueB() >= 0) {\n\t\t\t\tboard.on('update', function() {\n\t\t\t\t\tdocument.getElementById('ordonneeEquationQuadratique').innerHTML = \"y = \" + dynamiqueA() + 'x² + ' + dynamiqueB() + dynamiqueC();\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tboard.on('update', function() {\n\t\t\t\tdocument.getElementById('ordonneeFormuleQuadratique').innerHTML = \"Ordonnée = \" + dynamiqueC();\n\t\t\t});\n\t\t}\n\t} else {// affichage des erreurs\n\t\tvar input = document.getElementById('input');\n\t\tinput.selectionStart = erreur;\n\t\tinput.selectionEnd = ++erreur;\n\t\tinput.focus();\n\t\tenterPr = false;\n\t}\n}", "function portals(maxTime, manacost) {\n\n let isVisited = new Array(manacost.length).fill([])\n isVisited = isVisited.map(v => new Array(manacost[0].length).fill(0))\n\n isInRange = (x, y) => x >= 0 && y >= 0 && x < manacost.length\n && y < manacost[0].length\n\n isDupCoord = ([x, y], [a, b]) => x == a && y == b\n\n const direction = [[-1, 0], [0, 1], [1, 0], [0, -1]]\n\n bfs = ([x, y], signal) => {\n let res = []\n\n let queue = [{x, y, time: 0, manaCost: manacost[x][y]}]\n isVisited[x][y] = 1\n while(queue.length > 0){\n let data = queue.shift()\n\n if(data.time > maxTime)\n continue;\n\n if(data.x == manacost.length-1 && data.y == manacost[0].length-1 && signal)\n return 0\n\n res.push(data)\n\n for(let d of direction){\n let dX = d[0] + data.x\n let dY = d[1] + data.y\n if(isInRange(dX, dY) && isVisited[dX][dY] == 0 && manacost[dX][dY] > -1){\n isVisited[dX][dY] = 1\n queue.push({x: dX, y: dY, time: data.time + 1, manaCost: manacost[dX][dY]})\n }\n }\n }\n\n\n return res\n }\n\n let topToDown = bfs([0, 0], true)\n if(topToDown == 0) return 0\n\n isVisited = isVisited.map(v => v.map(t => 0))\n let downToTop = bfs([manacost.length-1, manacost[0].length-1], false)\n\n topToDown = topToDown.sort((a, b) => a.manaCost - b.manaCost)\n downToTop = downToTop.sort((a, b) => a.manaCost - b.manaCost)\n\n let portal = 1000000000\n\n console.log(topToDown, downToTop)\n\n for(let ttd of topToDown){\n for(let dtt of downToTop){\n if(ttd.time + dtt.time <= maxTime && !isDupCoord([ttd.x, ttd.y], [dtt.x, dtt.y])){\n portal = portal > ttd.manaCost + dtt.manaCost ? ttd.manaCost + dtt.manaCost : portal\n }\n }\n }\n\n return portal\n}", "function pickHotel() {\n\n console.log('hello from hotel');\n for ( let i = 0 ; i < Hotel.all.length ; i++ ){\n if ( plan.budget === Hotel.all[i].hotelBudget && plan.planDays[0].dayLocation === Hotel.all[i].location ) {\n plan.planDays[0].planHotel = Hotel.all[i];\n\n }\n \n\n }\n\n}", "function affichageCardsPlan() {\n cardPlanBox1.innerText = arrayPlayCardPlan1[0][0].join('-');\n cardPlanBox2.innerText = arrayPlayCardPlan2[0][0].join('-');\n cardPlanBox3.innerText = arrayPlayCardPlan3[0][0].join('-');\n affichageCardsPlanPoint()\n}", "function whichPlan() {\n\n var planName;\n if (document.getElementById('national_average').checked) {\n\n planName = \"National Average\";\n\n } else if (document.getElementById('custom_average').checked) {\n\n planName = \"State-Based Average\";\n\n }\n return planName;\n\n}", "avancer() {\n\t\tlet fermee = this.cellule.ouverture(this.direction);\n\t\tif (fermee) { //il y a un mur\n\t\t\treturn this.finMouvement();\n\t\t} else if (this.verifierBlocage()===true) { //la porte est bloquee\n return this.finMouvement();\n }\n\t\tthis.visuel.style.transitionDuration = (this.animMouvement) + \"ms\";\n\t\tthis.cellule = this.cellule.voisine(this.direction);\n\n console.log(\"Déplacement: \"+[\"↑\",\"→\",\"↓\",\"←\"][this.direction]+\" / \"+this.cellule.infoDebogage());\n\n\t\tthis.visuel.addEventListener('transitionend', this.evt.visuel.transitionend);\n\t}", "join(traveler) {\r\n if (this.capacity > this.passengers.length) {\r\n this.passengers.push(traveler)\r\n //console.log(this.passengers)\r\n }\r\n else {\r\n //alert('Wagon has reached it/s max capacity. Search for another wagon.')\r\n }\r\n }", "function checkLane(){\n\ttrackMovement();\n\tif(travelDir == \"North\" || travelDir == \"South\"){\n\t\tif(transform.position.x > coordOpt1){\n\t\t\tdist1 = transform.position.x - coordOpt1;\n\t\t}else{\n\t\t\tdist1 = coordOpt1 - transform.position.x;\n\t\t}\n\t\t\n\t\tif(transform.position.x > coordOpt2){\n\t\t\tdist2 = transform.position.x - coordOpt2;\n\t\t}else{\n\t\t\tdist2 = coordOpt2 - transform.position.x;\n\t\t}\n\t\t\n\t\tif(transform.position.x > coordOpt3){\n\t\t\tdist3 = transform.position.x - coordOpt3;\n\t\t}else{\n\t\t\tdist3 = coordOpt3 - transform.position.x;\n\t\t}\n\t}\n\tif(travelDir == \"East\" || travelDir == \"West\"){\n\t\tif(transform.position.z > coordOpt1){\n\t\t\tdist1 = transform.position.z - coordOpt1;\n\t\t}else{\n\t\t\tdist1 = coordOpt1 - transform.position.z;\n\t\t}\n\t\t\n\t\tif(transform.position.z > coordOpt2){\n\t\t\tdist2 = transform.position.z - coordOpt2;\n\t\t}else{\n\t\t\tdist2 = coordOpt2 - transform.position.z;\n\t\t}\n\t\t\n\t\tif(transform.position.z > coordOpt3){\n\t\t\tdist3 = transform.position.z - coordOpt3;\n\t\t}else{\n\t\t\tdist3 = coordOpt3 - transform.position.z;\n\t\t}\n\t}\n\t\n\tif(dist1 < dist2 && dist1 < dist3){\n\t\taiPos = \"A1\";\n\t}else if(dist2 < dist1 && dist2 < dist3){\n\t\taiPos = \"A2\";\n\t}else if(dist3 < dist1 && dist3 < dist2){\n\t\taiPos = \"turn\";\n\t}\n}", "function onShowEstimation(){\n \tvar rest = new Ab.view.Restriction();\n\trest.addClause(\"wr.wr_id\",$(\"wr.wr_id\").value,\"=\");\n\tView.openDialog(\"ab-helpdesk-workrequest-estimation.axvw\",rest,false);\n}", "function whereToGO() {\n\n\t\t\t\tif (activity == 0 && budget == 0) {\n\t\t\t\t\tadventure = \"bowling_alley\";\n\t\t\t\t} else if (activity == 0 && budget >= 1) {\n\t\t\t\t\tadventure = \"restaurant\";\n\t\t\t\t}\n\t\t\t\telse if (activity == 1 && budget == 0) {\n\t\t\t\t\tadventure = \"shopping_mall\";\n\t\t\t\t} else if (activity == 1 && budget >= 1) {\n\t\t\t\t\tadventure = \"amusement_park\";\n\t\t\t\t} else if (activity == 2 && budget == 0) {\n\t\t\t\t\tadventure = \"bar\";\n\t\t\t\t} else if (activity == 2 && budget >= 1) {\n\t\t\t\t\tadventure = \"spa\";\n\t\t\t\t}\n\t\t\t}", "function blPanelAfterRefresh(){\n var blPanel = View.panels.get('abEgressPlans-select-building');\n \n var rows = blPanel.rows;\n if (rows.length > 0) {\n var blId = rows[0]['bl.bl_id'];\n var blRes = new Ab.view.Restriction();\n blRes.addClause('fl.bl_id', blId, '=');\n View.panels.get('abEgressPlans_select_flooring').refresh(blRes);\n }\n}", "privado(){\r\n if(this.persona.datosDecision.totalSemanasCotizadas >= 1250){\r\n this.todaLaVida();\r\n this.diezYears();\r\n let valorpensiontv = this.persona.datosLiquidacion.pIBLtv * 0.9;\r\n let valorpension10 = this.persona.datosLiquidacion.pIBL10A * 0.9;\r\n if(valorpensiontv >= valorpension10){\r\n this.datosLiquidacion.valorPensionDecreto = valorpensiontv;\r\n this.persona.regimen = \"Decreto 758 de 1990 - IBL Toda la Vida\";\r\n }else{\r\n this.datosLiquidacion.valorPensionDecreto = valorpension10;\r\n this.persona.regimen = \"Decreto 758 de 1990 - IBL 10 años >= 1250 semanas\";\r\n }\r\n }else{\r\n this.diezYears();\r\n this.montoPension10();\r\n this.persona.regimen = \"Decreto 758 de 1990 - IBL 10 años\";\r\n }\r\n this.ley797();\r\n if(!this.regimentr){\r\n this.persona.regimen = \"Ley 797 de 2003\";\r\n }\r\n }", "function selectMayo() {\n\tmayoCost = 1 - mayoCost ;\n\tcalculateTotal();\n}", "computeRoute(){\n if (this.startLocation && this.endLocation){\n if (this.mode === \"MILES\"){\n this.plotMiles();\n } else {\n this.plotDirection();\n }\n }\n }", "constructor(plan){\n\t\tthis.width = plan[0].length;\n\t\tthis.height = plan.length;\n\t\tthis.grid = [];\n\t\tthis.actors = [];\n\t\tfor (var y = 0; y < this.height; y++) {\n\t\t\tvar line = plan[y], gridLine = [];\n\t\t\tfor (var x = 0; x < this.width; x++) {\n\t\t\t\tvar ch = line[x], fieldType = null;\n\t\t\t\tvar Actor = this.actorChars[ch];\n\t\t\t\tif (Actor)\n\t\t\t\t\tthis.actors.push(new Actor(new Vector(x, y), ch));\t//for moving objects\n\t\t\t\telse if (ch == \"#\")\t\t\t//static objects will push to array\n\t\t\t\t\tfieldType = \"wall\";\n\t\t\t\telse if (ch == \"!\")\n\t\t\t\t\tfieldType = \"lava\";\n\t\t\t\tgridLine.push(fieldType);\n\t\t\t}\n\t\t\tthis.grid.push(gridLine);\n\t\t}\n\t\tthis.player = this.actors.filter(function(actor) {return actor.type == \"player\";})[0]; //player pos \n\t\tthis.status = this.finishDelay = null;\n\t\tthis.maxStep = 0.05; \n\t}", "function menu_paquet(){\n\t\taction=prompt(\"F fin de tour | P piocher une carte\");\n\t\taction=action.toUpperCase();\n\t\tif (action != null){\n\t\t\tswitch(action){\n\t\t\t\tcase \"F\":\n\t\t\t\t\tif (att_me.length>0){\n\t\t\t\t\t\t//MAJ des cartes en INV_ATT1,2\n\t\t\t\t\t\tmajCartesEnAttaque();\n\t\t\t\t\t}\n\t\t\t\t\tif (pv_adv==0 || pv_me==0){\n\t\t\t\t\t\tif (pv_adv==0){\n\t\t\t\t\t\t\talert(\"Vous avez gagné !!!\");\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\talert(\"Vous avez perdu !!!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/////////////////////////////////Gérer la fin de partie ICI\n\t\t\t\t\t} else {\n\t\t\t\t\t\tIA_jouer(IA_stategie_basic);\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase \"P\":\n\t\t\t\t\tjeu_piocherDsPaquet(true);\t\t\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "function ActualiserPointsVie(){\n\t//les PDV diminuent si le joueur s'eloigne des artefacts (zoneSure) sans lumiere (torcheJoueur)\n\tif(transform.Find(\"torcheJoueur(Clone)\") == null && !zoneSure){\n\t\tif(vitesseCorruption < 0){\n\t\t\tvitesseCorruption = 0;\n\t\t}else{\n\t\t\tvitesseCorruption += Time.deltaTime/2;\n\t\t}\n\t\tpointsVie -= vitesseCorruption*Time.deltaTime;\n\t} else{\n\t\t//la vitesse de reduction des PDV diminue jusqu'a 0\n\t\tif(vitesseCorruption > 0){\n\t\t\tvitesseCorruption -= Time.deltaTime*2;\n\t\t}else{\n\t\t\tvitesseCorruption = 0;\n\t\t\t//soigne si la vitesse de corruption est 0 et le joueur a obtenu la potion\n\t\t\tif(Joueur.powerUpPotion){\n\t\t\t\tpointsVie += Time.deltaTime;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t}\n\t//actualise l'element visuel\n\tbarreVie.fillAmount = pointsVie/pointsVieMax;\n}", "function land_use(){\n a_FAO_i='land_use';\n initializing_change();\n change();\n}", "planConstruction(model,planConstructionNode){\n model.user.params.planConstructionActive=true;\n model.user.params.cosmogole = model.user.params.cosmogole - model.user.planConstruction.prix;\n planConstructionNode.removeEventListener(\"click\",this.planConstruction);\n planConstructionNode.remove();\n let complite = (res)=>{\n document.dispatchEvent(this.pompeEvent);\n }\n let data = \"cosmogole=\"+model.user.params.cosmogole+\"&planConstructionActive=true\";\n model.loadData(\"post\",'/update',{data,complite});\n }", "function nouvellePartie() {\n\tcases = [\n\t\t['22','23','24','25','26','24','23','22'],\n\t\t['21','21','21','21','21','21','21','21'],\n\t\t['0','0','0','0','0','0','0','0'],\n\t\t['0','0','0','0','0','0','0','0'],\n\t\t['0','0','0','0','0','0','0','0'],\n\t\t['0','0','0','0','0','0','0','0'],\n\t\t['11','11','11','11','11','11','11','11'],\n\t\t['12','13','14','15','16','14','13','12']\n\t];\n\ttourDesBlancs = true;\n\t\n\tblanc = 0;\n\tnoir = 0;\n}", "function main() {\n console.log(oPieces)\n //let sRandomPlan = fRandomPiece('plans');\n //let sResult = '';\n\n // if plan calls plan it should draw without replacement to prevent infinite loop\n //console.log(sRandomPlan)\n}", "function fl_outToOf ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.gvina.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.shavuot_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.modern_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t}}", "function stableMarriage(preferenceMatrix) {\n let N = preferenceMatrix.size;\n let wPartner = Array(N).fill(0).map((_, i) => -1);\n let mFree = Array(N).fill(0).map((_, i) => false);\n let freeCount = preferenceMatrix.length;\n \n while (freeCount>0) {\n let m=0;\n while (m < N){\n if (mFree[m] == false){\n break;\n }\n m += 1;\n } \n\n //One by one go to all women according to \n //m's preferences. Here m is the picked free man \n for (let i = 0; i < N && mFree[m] == false; i++){\n let w = prefer[m][i];\n \n // The woman of preference is free, \n // w and m become partners (Note that \n // the partnership maybe changed later). \n // So we can say they are engaged not married \n if (wPartner[w - N] == -1){\n wPartner[w - N] = m;\n mFree[m] = true;\n freeCount--;\n } else { // w is not free\n // Find current engagement of w \n let m1 = wPartner[w - N]; \n \n // If w prefers m over her current engagement m1, \n // then break the engagement between w and m1 and \n // engage m with w. \n if (wPrefersM1OverM(prefer, w, m, m1) == false) \n { \n wPartner[w - N] = m; \n mFree[m] = true; \n mFree[m1] = false; \n } \n }\n }\n }\n\n console.log(\"woman\\tman\");\n\n\n\n}", "function make(){\n\tif(compute()) state = \"bound\";\n\telse alert(\"no schedules.\");\n\tdraw();\n}", "function planButton(event){\n\tevent.preventDefault();\n\tconsole.log('button clicked');\n\tlet origin = search_origin_inputEl.value;\n\tlet destination = destination_inputEl.value;\n\tfetchMapQuestApi(origin, destination);\n\tsearch_origin_inputEl = '';\n\tdestination_inputEl = '';\n}", "addLoc() {\n const activeContract = document.querySelector('div.current-contract .assignment');\n\n if (activeContract != undefined){\n let contractObject = model.activeContracts.find(obj => obj.domElem === activeContract);\n const statusCon = contractObject.increase();\n\n if (statusCon == 'in progress') {\n gameApp.gameView.progressBar(contractObject);\n }\n\n else if (statusCon == 'finished') {\n model.deleteFromArray(model.activeContracts, contractObject)\n gameApp.gameView.removeElem(contractObject.domElem);\n contractObject = null;\n gameApp.gameView.updateMoney();\n\n let nextContract = document.querySelector('div.accepted-contract .assignment');\n if (nextContract === null) return;\n gameApp.gameView.addToDom(nextContract, '.current-contract');\n }\n }\n }", "function sprint_planning_next()\r\n{\r\n rowindex = $(\"#current_row_index\").val()\r\n $('#sprint_start_date').datepicker('disable');\r\n $('#sprint_end_date').datepicker('disable');\r\n\r\n //move_stories(data[row_index]);\r\n if (document.getElementById('running_total').innerHTML != \"\"){\r\n prev_points = parseInt(document.getElementById('running_total').innerHTML);\r\n } else {\r\n prev_points = 0;\r\n }\r\n // // Setup vars.\r\n d1 = $('#sprint_start_date').datepicker().val();\r\n d2 = $('#sprint_end_date').datepicker().val();\r\n d1_date_obj = new Date(d1.toString());\r\n d2_date_obj = new Date(d2.toString());\r\n sprint_num = parseInt(document.getElementById('sprint_number_input').value);\r\n points_input = document.getElementById('estimated_points');\r\n if(data.length>0){\r\n if(data[row_index].story_points != \"\"){\r\n $('#estimated_points option').prop('selected', function() {\r\n return data[row_index].story_points;\r\n });\r\n } else {\r\n $('#estimated_points option').prop('selected', function() {\r\n return this.defaultSelected;\r\n });\r\n }\r\n }\r\n if($(\"#current_sprint\").val() != \"\" && parseInt($(\"#current_sprint\").val()) > 0 ) { \r\n logScrumViolation(data[row_index].key, sprint_num, data[row_index].status, data[row_index].as_a, data[row_index].storyid, data[row_index].i_want, data[row_index].so_that, data[row_index].acceptance_test, data[row_index].story_points, data[row_index].comments); \r\n }\r\n document.getElementById('estimated_points').onchange=function(event)\r\n {\r\n update_running_total();\r\n }\r\n set_sprint(sprint_num, d1_date_obj, d2_date_obj);\r\n if(!display_recurring){\r\n numNext++;\r\n var min = $('#min_order');\r\n set_order(min.val(), data[row_index], numNext);\r\n update_table(row_index, 3, 8, sprint_num, points);\r\n set_user_story(sprint_num, row_index, points);\r\n set_user_story_status(row_index);\r\n data.splice(row_index,1);\r\n //row_index += 1;\r\n $(\"#current_row_index\").val(row_index);\r\n }\r\n else{\r\n var min = $('#min_order');\r\n if(min == ''){\r\n min.val(0);\r\n }\r\n var num = parseInt($('#max_story_id').val()) + 1;\r\n adjust_order(min.val());\r\n \r\n if(recurring_stories[recurring_index].scheduled != \"false\" && recurring_stories[recurring_index].scheduled != undefined){\r\n movepostdate(recurring_stories[recurring_index]); \r\n }\r\n save_recurring_to_firebase(parseInt(min.val()),(recurring_stories[recurring_index].storyid + \"-\" + num),sprint_num,recurring_stories[recurring_index].as_a,recurring_stories[recurring_index].i_want,recurring_stories[recurring_index].so_that,recurring_stories[recurring_index].acceptance_test,points,recurring_stories[recurring_index].comments)\r\n recurring_stories.splice(recurring_index,1);\r\n //recurring_index += 1;\r\n min.val(parseInt(min.val()) + 1);\r\n }\r\n //// SETTING THE STORY ON THE SCREEN ABOVE.\r\n //// LOADING THE NEXT STORY BELOW\r\n last_row = (last_row < 0) ? 0 : last_row;\r\n if (row_index <= last_row || recurring_index<=last_row)\r\n {\r\n running_total_logs.push(true);\r\n show_story(row_index, data);\r\n update_running_total();\r\n // If we are at the end of the stories don't allow another pull.\r\n if (row_index == last_row)\r\n {\r\n document.getElementById('next_button').disabled = true;\r\n document.getElementById('skip_button').disabled = true;\r\n $(\"#next_button\").css(\"opacity\",\"0.5\");\r\n $(\"#skip_button\").css(\"opacity\",\"0.5\");\r\n }\r\n else\r\n {\r\n document.getElementById('prev_button').disabled = false;\r\n document.getElementById('next_button').disabled = false;\r\n document.getElementById('skip_button').disabled = false;\r\n $(\"#next_button\").css(\"opacity\",\"1\");\r\n $(\"#skip_button\").css(\"opacity\",\"1\");\r\n $(\"#prev_button\").css(\"opacity\",\"1\");\r\n }\r\n }\r\n\r\n}", "function getUpcomingTravelPlans() {\n\treturn vacationPlans.filter((plan) => {\n\t\treturn moment().isBefore(plan.date.from);\n\t});\n}", "function escolhePlano(plano){\n\n if(plano == \"planoFull\"){\n $(\"#tipoPlano\").val(\"planoFull\");\n escolhePlanoForm();\n }else{\n $(\"#tipoPlano\").val(\"planoLight\");\n escolhePlanoForm();\n }\n $(\"#formulario\").removeClass( \"hidden\" );\n}", "function addAction(gaid){\n if(virtualStops[currentTrainIndex] !== undefined){\n var i = 0;\n for(i = 0;i< virtualStops[currentTrainIndex].length;i++){\n if(virtualStops[currentTrainIndex][i].stationIndex === gaid) {\n break;\n }\n }\n var changedTime = getTime(virtualStops[currentTrainIndex][i].departedTime,5);\n virtualStops[currentTrainIndex][i].departedTime = parseInt(changedTime);\n virtualStops[currentTrainIndex][i].type = 1;\n trains[currentTrainIndex].stops = virtualStops[currentTrainIndex].filter(st => st.type == 1);\n } else {\n var changedTime = getTime(trains[currentTrainIndex].stops[currentStopIndex].departedTime,5);\n trains[currentTrainIndex].stops[currentStopIndex].departedTime = parseInt(changedTime);\n }\n clearTrainLine(currentTrainIndex);\n drawTrains(currentTrainIndex);\n closePopup();\n}", "function makeFieldsVisible() {\n const list = planList;\n for (const item of list) {\n item.visibility = \"visible\";\n }\n setPlanList([...list]);\n }", "efficacitePompes(){\n\n }", "function fl_outToGvina ()\n\t\t{if(freez==\"false\"){\n\t\t\tconsole.log(\"hit\")\n\t\t\tthis.rimon.alpha=1\n\t\t\tthis.sufgania.alpha=1\n\t\t\tthis.selek.alpha=1\n\t\t\tthis.tamar.alpha=1\n\t\t\tthis.karpas.alpha=1\n\t\t\tthis.levivot.alpha=1\n\t\t\tthis.haroset.alpha=1\n\t\t\tthis.maza.alpha=1\n\t\t\tthis.hasa.alpha=1\n\t\t\tthis.beiza.alpha=1\n\t\t\tthis.hazeret.alpha=1\n\t\t\tthis.mamtak.alpha=1\n\t\t\tthis.oznei_aman.alpha=1\n\t\t\tthis.dvash.alpha=1\n\t\t\tthis.dag.alpha=1\n\t\t\tthis.sumsum.alpha=1\n\t\t\tthis.perot.alpha=1\n\t\t\tthis.mishloah.alpha=1\n\t\t\tthis.of.alpha=1\n\t\t this.chanuka_btn.alpha=1\n\t\t this.tu_btn.alpha=1\n\t\t this.purim_btn.alpha=1\n\t\t this.pesach_btn.alpha=1\n\t\t this.rosh_ha_shana_btn.alpha=1\n\t\t this.bible_btn.alpha=1\n\t\t\t\t\t this.arrow_btn.alpha=0\n\t\tthis.arrowAside_mc.alpha=0\n\t\tthis.gvina_explain.alpha=0\n\t\tthis.mishloah_explain.alpha=0\n\t\tthis.sufgania_explain.alpha=0\n\t\tthis.perot_explain.alpha=0\n\t\tthis.tapuah_explain.alpha=0\n\t\tthis.maza_explain.alpha=0\n\t\t}}", "function goTravelPlans() {\n\t// load active travel plans\n\tvar activeTravelPlans = getActiveTravelPlans();\n\t$(\"#active-travel-plans-list\").empty();\n\tif (activeTravelPlans.length == 0) addNoDataCard(\"#active-travel-plans-list\");\n\tactiveTravelPlans.forEach((plan) => {\n\t\tloadTravelPlan(\"#active-travel-plans-list\", plan);\n\t});\n\t// load upcoming travel plans\n\tvar upcomingTravelPlans = getUpcomingTravelPlans();\n\t$(\"#upcoming-travel-plans-list\").empty();\n\tif (upcomingTravelPlans.length == 0)\n\t\taddNoDataCard(\"#upcoming-travel-plans-list\");\n\tupcomingTravelPlans.forEach((plan) => {\n\t\tloadTravelPlan(\"#upcoming-travel-plans-list\", plan);\n\t});\n\t// load past travel plans\n\tvar pastTravelPlans = getPastTravelPlans();\n\t$(\"#past-travel-plans-list\").empty();\n\tif (pastTravelPlans.length == 0) addNoDataCard(\"#past-travel-plans-list\");\n\tpastTravelPlans.forEach((plan) => {\n\t\tloadTravelPlan(\"#past-travel-plans-list\", plan);\n\t});\n\t// load the travel plan section\n\tloadPageSection(\"#travel-plans-page\");\n}", "function changerAffichageOrigDest(indice)\n {\n //si aucune paire n'est sélectionnée\n if (polylineForSelectSelectedArray.length === 0)\n {\n itinPairesSelectionneesDiv.innerHTML = \"\";//on affiche rien\n }\n else\n {\n //affichage de l'origine et de la destination\n itinPairesSelectionneesDiv.innerHTML = \"\"; \n let origineDiv = document.createElement(\"div\");\n origineDiv.classList.add(\"surMesureOrigine\");\n let origineText = document.createTextNode(\"Origine: \" + itinSurMesureData[0].orig.description);\n origineDiv.appendChild(origineText);\n let destDiv = document.createElement(\"div\");\n destDiv.classList.add(\"destSurMesure\");\n destDiv.classList.add(\"surMesureDest\");\n let destText = document.createTextNode(\"Destination: \" + itinSurMesureData[itinSurMesureData.length-1].dest.description);\n destDiv.appendChild(destText);\n itinPairesSelectionneesDiv.appendChild(origineDiv);\n itinPairesSelectionneesDiv.appendChild(destDiv);\n \n //calcul distance totale et du temps de parcours total\n var distanceTotale = 0;\n var tempsParcoursTotal = 0;\n var donneesNonDisponible = false;\n for (var paire of itinSurMesureData)\n {\n distanceTotale += paire.distance;\n tempsParcoursTotal += paire.tempsParcours;\n //si une des paires présentent un tempsParcours de 0, c aveut dire qu'aucune donnees n'etaient disponible pour cette paire en bd, on ne pas pas calculer le tempsParcours et la vitesseMoyenne de l'itineraire\n if (paire.tempsParcours === 0)\n {\n donneesNonDisponible = true;\n }\n }\n //calculer la vitesse moyenne\n var vitesseMoyenne = null;\n if (donneesNonDisponible)//s'il manquait de donnees pour au moins une des paires\n {\n vitesseMoyenne = \"ND\";\n tempsParcoursTotal = \"ND\";\n }\n else\n {\n vitesseMoyenne = distanceTotale/tempsParcoursTotal;\n //forcer 0 decimales a la vitesse\n vitesseMoyenne = vitesseMoyenne.toFixed(0);\n }\n distanceTotale = distanceTotale.toFixed(3);\n \n //formatter le temps de parcours, s'il est egale a 0, la fonction renvoie ND\n let tempsParcoursFormatte = formatterTempsDeParcours(tempsParcoursTotal);\n let tempsParcoursTextNode = document.createTextNode(\"Temps de parcours: \" + tempsParcoursFormatte);\n \n //affichage du temps de parcours\n let tempsParcoursDiv = document.createElement(\"div\");\n tempsParcoursDiv.appendChild(tempsParcoursTextNode);\n itinPairesSelectionneesDiv.appendChild(tempsParcoursDiv);\n \n //affichage de la vitesse moyenne\n var vitesseMoyDiv = document.createElement(\"div\");\n var vitesseMoyText = null;\n if (vitesseMoyenne === \"ND\")\n vitesseMoyText = document.createTextNode(\"Vitesse moyenne: \" + vitesseMoyenne);\n else\n vitesseMoyText = document.createTextNode(\"Vitesse moyenne: \" + vitesseMoyenne + \" km/h\");\n vitesseMoyDiv.appendChild(vitesseMoyText); \n itinPairesSelectionneesDiv.appendChild(vitesseMoyDiv);\n \n //affichage de la distance\n var distanceDiv = document.createElement(\"div\");\n var distanceText = document.createTextNode(\"Distance totale: \" + distanceTotale + \"km\");\n distanceDiv.appendChild(distanceText);\n itinPairesSelectionneesDiv.appendChild(distanceDiv);\n } \n }", "function UNIVERSAL_LINEAR (plank_duration) {\n return plank_duration + UNIVERSAL_CONSTANT(plank_duration); // electron, qubit, super_plank stars, (1d projection into 2d spacetime)\n } // \"I want to build a Taj Mahal that will never get its last tile.\"", "function effemeridi_pianeti(np,TEMPO_RIF,LAT,LON,ALT,ITERAZIONI,STEP,LAN){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) ottobre 2011\n // funzione per il calcolo delle effemeridi del Sole.\n // Parametri utilizzati\n // np= numero identificativo del pianeta 0=Mercurio,1=Venere.....7=Nettuno\n // il valore np=2 (Terra) non deve essere utilizzato come parametro.\n // TEMPO_RIF= \"TL\" o \"TU\" tempo locale o tempo universale.\n // LAT= latitudine in gradi sessadecimali.\n // LON= longtudine in gradi sessadecimali.\n // ALT= altitudine in metri.\n // ITERAZIONE =numero di ripetizioni del calcolo.\n // STEP=salto \n // LAN=\"EN\" versione in inglese.\n \n \n var njd=calcola_jdUT0(); // numero del giorno giuliano all'ora 0 di oggi T.U.\n\n njd=njd+0.00078; // correzione per il Terrestrial Time.\n\n //njd=njd+t_luce(njd,np); // correzione tempo luce.\n \nvar data_ins=0; // data\nvar data_inser=0; // data\nvar numero_iterazioni=ITERAZIONI;\n\nvar fusoloc=-fuso_loc(); // recupera il fuso orario della località (compresa l'ora legale) e riporta l'ora del pc. come T.U.\n\nvar sorge=0;\nvar trans=0;\nvar tramn=0;\nvar azimuts=0;\nvar azimutt=0;\n\nvar effe_pianeta=0;\nvar ar_pianeta=0;\nvar de_pianeta=0;\nvar classetab=\"colore_tabellaef1\";\nvar istanti=0;\nvar magnitudine=0;\nvar fase=0;\nvar diametro=0;\nvar distanza=0;\nvar elongazione=0;\nvar costl=\"*\"; // nome della costellazione.\nvar parallasse=0;\nvar p_ap=0; // coordinate apparenti del pianeta.\n\nif (STEP==0) {STEP=1;}\n \n document.write(\"<table width=100% class='.table_effemeridi'>\");\n document.write(\" <tr>\");\n\n // versione in italiano.\n\n if (LAN!=\"EN\") // diverso da EN\n {\n document.write(\" <td class='colore_tabella'>Data:</td>\");\n document.write(\" <td class='colore_tabella'>Sorge:</td>\");\n document.write(\" <td class='colore_tabella'>Culmina:</td>\");\n document.write(\" <td class='colore_tabella'>Tramonta:</td>\");\n document.write(\" <td class='colore_tabella'>A. So.:</td>\");\n document.write(\" <td class='colore_tabella'>A. Tr.:</td>\");\n document.write(\" <td class='colore_tabella'>A. Retta:</td>\");\n document.write(\" <td class='colore_tabella'>Dec.:</td>\");\n document.write(\" <td class='colore_tabella'>Fase.</td>\");\n document.write(\" <td class='colore_tabella'>Dist.</td>\");\n document.write(\" <td class='colore_tabella'>Dia.</td>\");\n document.write(\" <td class='colore_tabella'>El.</td>\");\n document.write(\" <td class='colore_tabella'>Ma.</td>\");\n document.write(\" <td class='colore_tabella'>Cost.</td>\");\n }\n\n // versione in inglese.\n\nif (LAN==\"EN\")\n {\n\n document.write(\" <td class='colore_tabella'>Date:</td>\");\n document.write(\" <td class='colore_tabella'>Rise:</td>\");\n document.write(\" <td class='colore_tabella'>Transit:</td>\");\n document.write(\" <td class='colore_tabella'>Set:</td>\");\n document.write(\" <td class='colore_tabella'>Az. Rise:</td>\");\n document.write(\" <td class='colore_tabella'>Az. Set:</td>\");\n document.write(\" <td class='colore_tabella'>R.A.:</td>\");\n document.write(\" <td class='colore_tabella'>Dec.:</td>\");\n document.write(\" <td class='colore_tabella'>Ph.</td>\");\n document.write(\" <td class='colore_tabella'>Dist.</td>\");\n document.write(\" <td class='colore_tabella'>Dia.</td>\");\n document.write(\" <td class='colore_tabella'>El.</td>\");\n document.write(\" <td class='colore_tabella'>Ma.</td>\");\n document.write(\" <td class='colore_tabella'>Const.</td>\");\n\n }\n\n\n document.write(\" </tr>\");\n\n // ST_ASTRO_DATA Array(azimut_sorgere,azimut_tramonto,tempo_sorgere,tempo_transito,tempo_tramonto)\n // 0 1 2 3 4\n\n njd=njd-STEP;\n\n for (b=0; b<numero_iterazioni; b=b+STEP){\n njd=njd+STEP;\n effe_pianeta=pos_pianeti(njd,np); \n\n // calcola le coordinate apparenti nutazione e aberrazione.\n\n p_ap=pos_app(njd,effe_pianeta[0],effe_pianeta[1]);\n ar_pianeta= sc_ore(p_ap[0]); // ascensione retta in hh:mm:ss.\n de_pianeta=sc_angolo(p_ap[1],0); // declinazione. \n \n fase=effe_pianeta[2];\n magnitudine=effe_pianeta[3];\n distanza=effe_pianeta[4].toFixed(3);\n diametro=effe_pianeta[5].toFixed(1);\n elongazione=effe_pianeta[6].toFixed(1);\n costl=costell(effe_pianeta[0]); // costellazione.\n\n istanti=ST_ASTRO_DATA(njd,effe_pianeta[0],effe_pianeta[1],LON,LAT,ALT,0);\n\nif (TEMPO_RIF==\"TL\"){\n sorge=ore_24(istanti[2]+fusoloc);\n trans=ore_24(istanti[3]+fusoloc);\n tramn=ore_24(istanti[4]+fusoloc); }\n\nelse {\n sorge=ore_24(istanti[2]);\n trans=ore_24(istanti[3]);\n tramn=ore_24(istanti[4]); } \n\n sorge=sc_ore_hm(sorge); // istanti in hh:mm\n trans=sc_ore_hm(trans);\n tramn=sc_ore_hm(tramn);\n\n // formatta la data da inserire.\n\n data_ins=jd_data(njd);\n\n if (LAN!=\"EN\") {data_inser=Lnum(parseInt(data_ins[0]),2)+\":\"+Lnum(parseInt(data_ins[1]),2)+\" |\"+data_ins[3];} // versione in italiano.\n if (LAN==\"EN\") {data_inser=Lnum(parseInt(data_ins[0]),2)+\":\"+Lnum(parseInt(data_ins[1]),2)+\" |\"+data_ins[4];} // versione in inglese.\n\n azimuts=istanti[0].toFixed(1);\n azimutt=istanti[1].toFixed(1);\n\n if (b%2==0){classetab=\"colore_tabellaef2\"; }\n\n else {classetab=\"colore_tabellaef1\";}\n\n\n document.write(\" <tr>\");\n document.write(\" <td class='\"+classetab+\"'>\"+data_inser+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+sorge+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+trans+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+tramn+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+azimuts+\"&deg;</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+azimutt+\"&deg;</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+ar_pianeta+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+de_pianeta+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+fase+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+distanza+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+diametro+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+elongazione+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+magnitudine+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+costl+\"</td>\");\n\n document.write(\" </tr>\");\n\n }\n document.write(\" </table>\");\n\n\n}", "function nueva_partida() {\n if (ruleta.gameState == GameState.GAME_ENDED) {\n ruleta.nueva_partida();\n ruleta.ruleta_por_defecto();\n }\n}", "function initializePlanner() {\n\t\tvar tempPlanner = {};\n\n\t\tfor (var i = 8; i < 18; i++) {\n\t\t\t\n\t\t\ttempPlanner[moment(i, \"H\").format(\"h a\")] = \"\";\n\t\t}\n\t\t\n\t\treturn tempPlanner;\n }", "hent() {\n // Bruker b_id'en til å hente infor om bestillingen\n s_bestilling.InfoBestilling(this.b_id, valgt => {\n this.valgt = valgt;\n });\n // Bruker b_id'en til å hente info om varene i bestillingen\n s_bestilling.InfoBestillingVarer(this.b_id, varer => {\n this.varer = varer;\n });\n this.visInfoPop();\n }", "function minusRun() {\n let team = document.getElementById(\"team-selector\").value;\n let inning = parseInt(document.getElementById(\"inning-selector\").value);\n\n let currentRuns = getInningValue(team, inning);\n if(currentRuns > 0) {\n fillInning(team, inning, currentRuns-1);\n } else {\n fillInning(team, inning, 0);\n }\n}", "function deductibleDescription() { \n return gapPlanData.description();\n}", "addPlan(name, percents){\n this.plans[name] = createCommissionPlan(name, percents);\n }", "getCartesianPlane(){ \n //origem do plano fica a 6% da origem do gráfico\n // O(0.06*h , 0.94h)\n \n //desenha ponto na origem\n\n noStroke()\n //ellipse(this.origin.x,this.origin.y,0.035*this.height,0.035*this.height)\n //fill(255)\n \n\n //desenha eixos do plano\n \n let arrowLength = 0.02*this.height \n stroke(255)\n strokeWeight(4)\n\n //desenha eixo y\n line(this.origin.x, this.origin.y, this.origin.x, 0.05*this.height)\n //desenha flecha à esquerda do eixo Y\n line(this.origin.x, 0.05*this.height, this.origin.x-(arrowLength)*cos(PI/3), 0.05*this.height+(arrowLength)*sin(PI/3))\n //desenha flecha à direita do eixo y\n line(this.origin.x, 0.05*this.height, this.origin.x+(arrowLength)*cos(PI/3), 0.05*this.height+(arrowLength)*sin(PI/3))\n \n //desenha eixo x\n line(this.origin.x, this.origin.y, 0.95*this.width, this.origin.y)\n //desenha flecha abaixo do eixo x\n line(0.95*this.width,this.origin.y, 0.95*this.width-(arrowLength*cos(-PI/6)) , this.origin.y-(arrowLength*sin(-PI/6)))\n //desenha flecha acima do eixo y\n line(0.95*this.width,this.origin.y, 0.95*this.width-(arrowLength*cos(-PI/6)) , this.origin.y+(arrowLength*sin(-PI/6)))\n \n }", "function change_lane(control)\n{\n\tvar section_code = current_section_code;\n\tvar route_branch = section_code.substring(0, 5);\n\tvar direction = section_code.substring(5, 6);\n\tvar survey_lane = section_code.substring(6, 7);\n\tvar the_rest = section_code.substring(7, section_code.length);\n\tvar new_direction, new_survey_lane;\n\t\n\tif (control == 'up')\n\t{\n\t\tif (direction == 2)\n\t\t{\n\t\t\tif (survey_lane >= 2)\n\t\t\t{\n\t\t\t\tnew_direction = direction;\n\t\t\t\tnew_survey_lane = +survey_lane - 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tnew_direction = \"1\";\n\t\t\t\tnew_survey_lane = \"1\";\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tnew_direction = direction;\n\t\t\tnew_survey_lane = +survey_lane + 1;\n\t\t}\t\t\n\t}\n\telse if (control == 'down')\n\t{\n\t\tif (direction == 1)\n\t\t{\n\t\t\tif (survey_lane >= 2)\n\t\t\t{\n\t\t\t\tnew_direction = direction;\n\t\t\t\tnew_survey_lane = +survey_lane - 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tnew_direction = \"2\";\n\t\t\t\tnew_survey_lane = \"1\";\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tnew_direction = direction;\n\t\t\tnew_survey_lane = +survey_lane + 1;\n\t\t}\t\t\n\t}\n\telse\n\t{\n\t\treturn;\n\t}\n\tvar new_section_code = route_branch + new_direction + new_survey_lane + the_rest;\n\t\n\tif (typeof active_sections_data[new_section_code] != 'undefined')\n\t{\n\t\tcurrent_section_code = new_section_code;\n\t\t$('#pavement_window .modal-body').html(active_sections_data[new_section_code]);\n\t\tfor (var i in polylines_container)\n\t\t{\n\t\t\tif (polylines_container[i].section_code == new_section_code)\n\t\t\t{\n\t\t\t\tvar polyline = polylines_container[i].polyline;\n\t\t\t\tvar dataset = polyline.getPath().getArray();\n\t\t\t\tplaceMarker(dataset[Math.floor(dataset.length/2)].Latitude, dataset[Math.floor(dataset.length/2)].Longitude);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t}\n\t\n\t$('#loading').hide();\n}", "function gps_autoconsulta() {\n ZOOM_IN_BOUNDS2 = true; \n gps_iniciaPausaAutoConsulta(); \n}", "DiplomaticEffectOfAcquiringPlanet( p ) { \n\t\t// neighbors may not like our being here\n\t\tlet civs = p.star.CivsWithNoStarSharingTreaties(this);\n\t\tfor ( let civ of civs ) {\n\t\t\tthis.EndTreaty( 'NO_STAR_SHARING', civ, true ); // automatically handles reputation log \n\t\t\t}\n\t\tlet neighbors = p.star.planets.filter( p => p.owner && p.owner!=this ).map( p => p.owner ).unique();\n\t\tfor ( let civ of neighbors ) {\n\t\t\tciv.LogDiploEvent( this, -5, 'starmates', `You settled planet ${p.name} in our turf.` );\n\t\t\t}\n\t\t}" ]
[ "0.6230617", "0.6217203", "0.6105719", "0.6037342", "0.5989817", "0.5837272", "0.578146", "0.56761444", "0.5604932", "0.5590402", "0.55792296", "0.557561", "0.55262077", "0.55132383", "0.5490316", "0.5415217", "0.53922755", "0.5374338", "0.5330806", "0.53258115", "0.5320576", "0.53107095", "0.53084964", "0.53071845", "0.53049177", "0.5253093", "0.5242565", "0.52352273", "0.52180433", "0.52032965", "0.51955014", "0.5184035", "0.5175621", "0.5166763", "0.51646185", "0.51556826", "0.5139176", "0.5137567", "0.51317143", "0.51302415", "0.51252586", "0.5123062", "0.5119187", "0.5113747", "0.51087916", "0.5106432", "0.5099642", "0.5090032", "0.5070653", "0.5066648", "0.5057964", "0.50562114", "0.50546324", "0.5051582", "0.5048975", "0.5048014", "0.5045662", "0.5045012", "0.50429845", "0.5036116", "0.5028336", "0.50224406", "0.50189346", "0.5018221", "0.5014255", "0.500457", "0.49997512", "0.499816", "0.49928996", "0.49906862", "0.4989264", "0.49881136", "0.49848753", "0.49707627", "0.49673164", "0.49645746", "0.49571663", "0.49528086", "0.49433696", "0.49371773", "0.49341923", "0.49256566", "0.49241006", "0.49231705", "0.49172145", "0.49072832", "0.49067426", "0.490474", "0.49004945", "0.48900977", "0.48875225", "0.48855105", "0.48844218", "0.4881979", "0.48778343", "0.4874484", "0.48743263", "0.4871789", "0.4869952", "0.48660216" ]
0.49583286
76